Merge branch 'main' into 'url-management'.

This commit is contained in:
Darshan committed 2025-08-24 17:28:38 +05:30
commit 2559ef99ec
313 files changed
+5050 -3158

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
PUBLIC_CONSOLE_MODE=self-hosted
PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths
PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths
PUBLIC_APPWRITE_MULTI_REGION=false
PUBLIC_APPWRITE_ENDPOINT=http://localhost/v1
PUBLIC_STRIPE_KEY=
+5 -5
View File
@@ -39,7 +39,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"PUBLIC_CONSOLE_MODE=cloud"
"PUBLIC_CONSOLE_FEATURE_FLAGS="
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites"
"PUBLIC_APPWRITE_MULTI_REGION=true"
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY }}"
@@ -79,7 +79,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"PUBLIC_CONSOLE_MODE=cloud"
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths"
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths"
"PUBLIC_APPWRITE_MULTI_REGION=true"
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}"
@@ -99,7 +99,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: appwrite/console
tags: |
@@ -118,7 +118,7 @@ jobs:
build-args: |
"PUBLIC_CONSOLE_MODE=self-hosted"
"PUBLIC_APPWRITE_MULTI_REGION=false"
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths"
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths"
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
publish-cloud-no-regions:
@@ -156,6 +156,6 @@ jobs:
build-args: |
"PUBLIC_CONSOLE_MODE=cloud"
"PUBLIC_APPWRITE_MULTI_REGION=false"
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,csv-import,attribute-encrypt,index-lengths"
"PUBLIC_CONSOLE_FEATURE_FLAGS=sites,index-lengths"
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}"
"PUBLIC_GROWTH_ENDPOINT=${{ secrets.PUBLIC_GROWTH_ENDPOINT }}"
+5
View File
@@ -11,7 +11,12 @@ test('upgrade - free tier', async ({ page }) => {
await page.waitForURL(/\/organization-[^/]+\/change-plan/);
await page.locator('input[value="tier-1"]').click();
await page.getByRole('button', { name: 'add' }).first().click();
await enterCreditCard(page);
// wait for a second after adding a card to update the UI.
await page.waitForSelector('button#method[role="combobox"]');
// skip members
await page.getByRole('button', { name: 'change plan' }).click();
await page.waitForURL(/\/console\/project-(?:[a-z0-9]+-)?([^/]+)\/get-started/);
+4 -1
View File
@@ -14,12 +14,15 @@ export async function enterCreditCard(page: Page) {
state: 'visible'
});
await page.getByPlaceholder('cardholder').fill('Test User');
const stripe = page.frameLocator('[title="Secure payment input frame"]');
const stripe = page.locator('[title="Secure payment input frame"]').nth(0).contentFrame();
await stripe.locator('id=Field-numberInput').fill('4242424242424242');
await stripe.locator('id=Field-expiryInput').fill('1250');
await stripe.locator('id=Field-cvcInput').fill('123');
await stripe.locator('id=Field-countryInput').selectOption('DE');
await dialog.getByRole('button', { name: 'Add', exact: true }).click();
await page.locator('id=state-picker').click(); // open dropdown
await page.getByRole('option', { name: 'Alabama' }).click();
await dialog.getByRole('button', { name: 'Add', exact: true }).click();
await dialog.waitFor({
state: 'hidden'
});
+10 -10
View File
@@ -22,11 +22,11 @@
},
"dependencies": {
"@ai-sdk/svelte": "^1.1.24",
"@appwrite.io/console": "^1.9.0",
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2408",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@0b77850",
"@appwrite.io/pink-legacy": "^1.0.3",
"@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778",
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@0b77850",
"@popperjs/core": "^2.11.8",
"@sentry/sveltekit": "^8.38.0",
"@stripe/stripe-js": "^3.5.0",
@@ -47,8 +47,8 @@
"tippy.js": "^6.3.7"
},
"devDependencies": {
"@eslint/compat": "^1.2.7",
"@eslint/js": "^9.24.0",
"@eslint/compat": "^1.3.1",
"@eslint/js": "^9.31.0",
"@melt-ui/pp": "^0.3.2",
"@melt-ui/svelte": "^0.86.5",
"@playwright/test": "^1.51.1",
@@ -57,20 +57,20 @@
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/svelte": "^5.2.4",
"@testing-library/svelte": "^5.2.8",
"@testing-library/user-event": "^14.6.1",
"@types/deep-equal": "^1.0.4",
"@types/prismjs": "^1.26.5",
"@types/remarkable": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^8.28.0",
"@typescript-eslint/parser": "^8.28.0",
"@vitest/ui": "^3.0.9",
"@vitest/ui": "^3.2.4",
"color": "^5.0.0",
"eslint": "^9.23.0",
"eslint": "^9.31.0",
"eslint-config-prettier": "^10.1.0",
"eslint-plugin-svelte": "^3.3.3",
"globals": "^16.0.0",
"jsdom": "^26.0.0",
"jsdom": "^26.1.0",
"kleur": "^4.1.5",
"prettier": "^3.5.3",
"prettier-plugin-svelte": "^3.3.3",
@@ -94,5 +94,5 @@
"svelte-preprocess"
]
},
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
"packageManager": "pnpm@10.13.1"
}
+223 -200
View File
@@ -12,20 +12,20 @@ importers:
specifier: ^1.1.24
version: 1.1.24(svelte@5.25.3)(zod@3.24.3)
'@appwrite.io/console':
specifier: ^1.9.0
version: 1.9.0
specifier: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2408
version: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2408
'@appwrite.io/pink-icons':
specifier: 0.25.0
version: 0.25.0
'@appwrite.io/pink-icons-svelte':
specifier: ^2.0.0-RC.1
version: https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9(svelte@5.25.3)
specifier: https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@0b77850
version: https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@0b77850(svelte@5.25.3)
'@appwrite.io/pink-legacy':
specifier: ^1.0.3
version: 1.0.3
'@appwrite.io/pink-svelte':
specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778
version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778(svelte@5.25.3)
specifier: https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@0b77850
version: https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@0b77850(svelte@5.25.3)
'@popperjs/core':
specifier: ^2.11.8
version: 2.11.8
@@ -82,11 +82,11 @@ importers:
version: 6.3.7
devDependencies:
'@eslint/compat':
specifier: ^1.2.7
version: 1.2.7(eslint@9.23.0)
specifier: ^1.3.1
version: 1.3.1(eslint@9.31.0)
'@eslint/js':
specifier: ^9.24.0
version: 9.24.0
specifier: ^9.31.0
version: 9.31.0
'@melt-ui/pp':
specifier: ^0.3.2
version: 0.3.2(@melt-ui/svelte@0.86.5(svelte@5.25.3))(svelte@5.25.3)
@@ -112,8 +112,8 @@ importers:
specifier: ^6.6.3
version: 6.6.3
'@testing-library/svelte':
specifier: ^5.2.4
version: 5.2.7(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(sass@1.86.0))(vitest@3.0.9)
specifier: ^5.2.8
version: 5.2.8(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(sass@1.86.0))(vitest@3.0.9)
'@testing-library/user-event':
specifier: ^14.6.1
version: 14.6.1(@testing-library/dom@10.4.0)
@@ -128,31 +128,31 @@ importers:
version: 2.0.8
'@typescript-eslint/eslint-plugin':
specifier: ^8.28.0
version: 8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.23.0)(typescript@5.8.2))(eslint@9.23.0)(typescript@5.8.2)
version: 8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.31.0)(typescript@5.8.2))(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/parser':
specifier: ^8.28.0
version: 8.28.0(eslint@9.23.0)(typescript@5.8.2)
version: 8.28.0(eslint@9.31.0)(typescript@5.8.2)
'@vitest/ui':
specifier: ^3.0.9
version: 3.0.9(vitest@3.0.9)
specifier: ^3.2.4
version: 3.2.4(vitest@3.0.9)
color:
specifier: ^5.0.0
version: 5.0.0
eslint:
specifier: ^9.23.0
version: 9.23.0
specifier: ^9.31.0
version: 9.31.0
eslint-config-prettier:
specifier: ^10.1.0
version: 10.1.1(eslint@9.23.0)
version: 10.1.1(eslint@9.31.0)
eslint-plugin-svelte:
specifier: ^3.3.3
version: 3.3.3(eslint@9.23.0)(svelte@5.25.3)
version: 3.3.3(eslint@9.31.0)(svelte@5.25.3)
globals:
specifier: ^16.0.0
version: 16.0.0
jsdom:
specifier: ^26.0.0
version: 26.0.0
specifier: ^26.1.0
version: 26.1.0
kleur:
specifier: ^4.1.5
version: 4.1.5
@@ -188,13 +188,13 @@ importers:
version: 5.8.2
typescript-eslint:
specifier: ^8.30.1
version: 8.30.1(eslint@9.23.0)(typescript@5.8.2)
version: 8.30.1(eslint@9.31.0)(typescript@5.8.2)
vite:
specifier: ^6.2.3
version: 6.2.3(@types/node@22.13.14)(sass@1.86.0)
vitest:
specifier: ^3.0.0
version: 3.0.9(@types/node@22.13.14)(@vitest/ui@3.0.9)(jsdom@26.0.0)(sass@1.86.0)
version: 3.0.9(@types/node@22.13.14)(@vitest/ui@3.2.4)(jsdom@26.1.0)(sass@1.86.0)
packages:
@@ -257,17 +257,17 @@ packages:
'@analytics/type-utils@0.6.2':
resolution: {integrity: sha512-TD+xbmsBLyYy/IxFimW/YL/9L2IEnM7/EoV9Aeh56U64Ify8o27HJcKjo38XY9Tcn0uOq1AX3thkKgvtWvwFQg==}
'@appwrite.io/console@1.9.0':
resolution: {integrity: sha512-g8+zfdBF8mz7tRUER4CGVe5FHWQVLp8TlY/UOGCZ2TgUF1qnpNu/DhiQgph8uF+QZ9jDKCLAAZlP5//9t7ckWA==}
'@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2408':
resolution: {tarball: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2408}
version: 1.10.0
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870':
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870}
version: 2.0.0-RC.1
'@appwrite.io/pink-icons-svelte@2.0.0-RC.1':
resolution: {integrity: sha512-iLFlV55hj8mGuAbmxJGenxN5RaZMmVT4GJb9dv/MP1xBAtYibFq7JvBcxm18qV2KU8c31Rntf+Ub4GL7HwqTYg==}
peerDependencies:
svelte: ^4.0.0
'@appwrite.io/pink-icons-svelte@https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9':
resolution: {tarball: https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9}
'@appwrite.io/pink-icons-svelte@https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@0b77850':
resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@0b77850}
version: 2.0.0-RC.1
peerDependencies:
svelte: ^4.0.0
@@ -281,8 +281,8 @@ packages:
'@appwrite.io/pink-legacy@1.0.3':
resolution: {integrity: sha512-GGde5fmPhs+s6/3aFeMPc/kKADG/gTFkYQSy6oBN8pK0y0XNCLrZZgBv+EBbdhwdtqVEWXa0X85Mv9w7jcIlwQ==}
'@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778':
resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778}
'@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@0b77850':
resolution: {tarball: https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@0b77850}
version: 2.0.0-RC.2
peerDependencies:
svelte: ^4.0.0
@@ -545,45 +545,41 @@ packages:
resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==}
engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
'@eslint/compat@1.2.7':
resolution: {integrity: sha512-xvv7hJE32yhegJ8xNAnb62ggiAwTYHBpUCWhRxEj/ksvgDJuSXfoDkBcRYaYNFiJ+jH0IE3K16hd+xXzhBgNbg==}
'@eslint/compat@1.3.1':
resolution: {integrity: sha512-k8MHony59I5EPic6EQTCNOuPoVBnoYXkP+20xvwFjN7t0qI3ImyvyBgg+hIVPwC8JaxVjjUZld+cLfBLFDLucg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^9.10.0
eslint: ^8.40 || 9
peerDependenciesMeta:
eslint:
optional: true
'@eslint/config-array@0.19.2':
resolution: {integrity: sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==}
'@eslint/config-array@0.21.0':
resolution: {integrity: sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/config-helpers@0.2.0':
resolution: {integrity: sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==}
'@eslint/config-helpers@0.3.0':
resolution: {integrity: sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/core@0.12.0':
resolution: {integrity: sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==}
'@eslint/core@0.15.1':
resolution: {integrity: sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/eslintrc@3.3.1':
resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/js@9.23.0':
resolution: {integrity: sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/js@9.24.0':
resolution: {integrity: sha512-uIY/y3z0uvOGX8cp1C2fiC4+ZmBhp6yZWkojtHL1YEMnRt1Y63HB9TM17proGEmeG7HeUY+UP36F0aknKYTpYA==}
'@eslint/js@9.31.0':
resolution: {integrity: sha512-LOm5OVt7D4qiKCqoiPbA7LWmI+tbw1VbTUowBcUMgQSuM6poJufkFkYDcQpo5KfgD39TnNySV26QjOh7VFpSyw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/object-schema@2.1.6':
resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/plugin-kit@0.2.7':
resolution: {integrity: sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==}
'@eslint/plugin-kit@0.3.3':
resolution: {integrity: sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@floating-ui/core@1.6.9':
@@ -1265,6 +1261,14 @@ packages:
'@swc/helpers@0.5.15':
resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==}
'@tanstack/svelte-virtual@3.13.12':
resolution: {integrity: sha512-SsOinCktvpMFbdSW61X6jeUNaJvD1tmt30AFVSLe1FQxGxjdPkZo0gAsoVPqM9FFZqidvvXQ4gpadDaTz/yGxA==}
peerDependencies:
svelte: ^3.48.0 || ^4.0.0 || ^5.0.0
'@tanstack/virtual-core@3.13.12':
resolution: {integrity: sha512-1YBOJfRHV4sXUmWsFSf5rQor4Ss82G8dQWLRbnk3GA4jeP8hQt1hxXh0tmflpC0dz3VgEv/1+qwPyLeWkQuPFA==}
'@testing-library/dom@10.4.0':
resolution: {integrity: sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==}
engines: {node: '>=18'}
@@ -1273,8 +1277,8 @@ packages:
resolution: {integrity: sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==}
engines: {node: '>=14', npm: '>=6', yarn: '>=1'}
'@testing-library/svelte@5.2.7':
resolution: {integrity: sha512-aGhUaFmEXEVost4QOsbHUUbHLwi7ZZRRxAHFDO2Cmr0BZD3/3+XvaYEPq70Rdw0NRNjdqZHdARBEcrCOkPuAqw==}
'@testing-library/svelte@5.2.8':
resolution: {integrity: sha512-ucQOtGsJhtawOEtUmbR4rRh53e6RbM1KUluJIXRmh6D4UzxR847iIqqjRtg9mHNFmGQ8Vkam9yVcR5d1mhIHKA==}
engines: {node: '>= 10'}
peerDependencies:
svelte: ^3 || ^4 || ^5 || ^5.0.0-next.0
@@ -1340,8 +1344,8 @@ packages:
'@types/prop-types@15.7.14':
resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==}
'@types/react@18.3.23':
resolution: {integrity: sha512-/LDXMQh55EzZQ0uVAZmKKhfENivEvWz6E+EYzh+/MCjMhNsotd+ZHhBGIjFDTi6+fz0OhQQQLbTgdQIxxCsC0w==}
'@types/react@18.3.22':
resolution: {integrity: sha512-vUhG0YmQZ7kL/tmKLrD3g5zXbXXreZXB3pmROW8bg3CnLnpjkRVwUlLne7Ufa2r9yJ8+/6B73RzhAek5TBKh2Q==}
'@types/remarkable@2.0.8':
resolution: {integrity: sha512-eKXqPZfpQl1kOADjdKchHrp2gwn9qMnGXhH/AtZe0UrklzhGJkawJo/Y/D0AlWcdWoWamFNIum8+/nkAISQVGg==}
@@ -1469,6 +1473,9 @@ packages:
'@vitest/pretty-format@3.0.9':
resolution: {integrity: sha512-OW9F8t2J3AwFEwENg3yMyKWweF7oRJlMyHOMIhO5F3n0+cgQAJZBjNgrF8dLwFTEXl5jUqBLXd9QyyKv8zEcmA==}
'@vitest/pretty-format@3.2.4':
resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==}
'@vitest/runner@3.0.9':
resolution: {integrity: sha512-NX9oUXgF9HPfJSwl8tUZCMP1oGx2+Sf+ru6d05QjzQz4OwWg0psEzwY6VexP2tTHWdOkhKHUIZH+fS6nA7jfOw==}
@@ -1478,14 +1485,17 @@ packages:
'@vitest/spy@3.0.9':
resolution: {integrity: sha512-/CcK2UDl0aQ2wtkp3YVWldrpLRNCfVcIOFGlVGKO4R5eajsH393Z1yiXLVQ7vWsj26JOEjeZI0x5sm5P4OGUNQ==}
'@vitest/ui@3.0.9':
resolution: {integrity: sha512-FpZD4aIv/qNpwkV3XbLV6xldWFHMgoNWAJEgg5GmpObmAOLAErpYjew9dDwXdYdKOS3iZRKdwI+P3JOJcYeUBg==}
'@vitest/ui@3.2.4':
resolution: {integrity: sha512-hGISOaP18plkzbWEcP/QvtRW1xDXF2+96HbEX6byqQhAUbiS5oH6/9JwW+QsQCIYON2bI6QZBF+2PvOmrRZ9wA==}
peerDependencies:
vitest: 3.0.9
vitest: 3.2.4
'@vitest/utils@3.0.9':
resolution: {integrity: sha512-ilHM5fHhZ89MCp5aAaM9uhfl1c2JdxVxl3McqsdVyVNN6JffnEen8UMCdRTzOhGXNQGo5GNL9QugHrz727Wnng==}
'@vitest/utils@3.2.4':
resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==}
'@vue/compiler-core@3.5.13':
resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==}
@@ -1530,6 +1540,11 @@ packages:
engines: {node: '>=0.4.0'}
hasBin: true
acorn@8.15.0:
resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==}
engines: {node: '>=0.4.0'}
hasBin: true
agent-base@6.0.2:
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
engines: {node: '>= 6.0.0'}
@@ -1611,9 +1626,6 @@ packages:
resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==}
engines: {node: '>=4'}
asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
autolinker@3.16.2:
resolution: {integrity: sha512-JiYl7j2Z19F9NdTmirENSUUIIL/9MytEWtmzhfmsKPCp9E+G35Y0UNCMoM9tFigxT59qSc8Ml2dlZXOCVTYwuA==}
@@ -1736,10 +1748,6 @@ packages:
resolution: {integrity: sha512-16BlyiuyLq3MLxpRWyOTiWsO3ii/eLQLJUQXBSNcxMBBSnyt1ee9YUdaozQp03ifwm5woztEZGDbk9RGVuCsdw==}
engines: {node: '>=18'}
combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
comma-separated-tokens@2.0.3:
resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
@@ -1956,10 +1964,6 @@ packages:
delaunator@5.0.1:
resolution: {integrity: sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==}
delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dequal@2.0.3:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
@@ -2023,10 +2027,6 @@ packages:
resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}
engines: {node: '>= 0.4'}
es-set-tostringtag@2.1.0:
resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}
engines: {node: '>= 0.4'}
esbuild@0.25.1:
resolution: {integrity: sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==}
engines: {node: '>=18'}
@@ -2066,6 +2066,10 @@ packages:
resolution: {integrity: sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint-scope@8.4.0:
resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint-visitor-keys@3.4.3:
resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -2074,8 +2078,12 @@ packages:
resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint@9.23.0:
resolution: {integrity: sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==}
eslint-visitor-keys@4.2.1:
resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
eslint@9.31.0:
resolution: {integrity: sha512-QldCVh/ztyKJJZLr4jXNUByx3gR+TDYZCRXEktiZoUR3PGy4qCmSbkxcIle8GEwGpb5JBZazlaJ/CxLidXdEbQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
hasBin: true
peerDependencies:
@@ -2091,6 +2099,10 @@ packages:
resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
espree@10.4.0:
resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
esprima@4.0.1:
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
engines: {node: '>=4'}
@@ -2157,6 +2169,14 @@ packages:
picomatch:
optional: true
fdir@6.4.6:
resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==}
peerDependencies:
picomatch: ^3 || ^4
peerDependenciesMeta:
picomatch:
optional: true
fflate@0.8.2:
resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==}
@@ -2186,10 +2206,6 @@ packages:
resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==}
engines: {node: '>= 0.4'}
form-data@4.0.2:
resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==}
engines: {node: '>= 6'}
forwarded-parse@2.1.2:
resolution: {integrity: sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw==}
@@ -2459,8 +2475,8 @@ packages:
resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
hasBin: true
jsdom@26.0.0:
resolution: {integrity: sha512-BZYDGVAIriBWTpIxYzrXjv3E/4u8+/pSG5bQdIYCbNCGOvsPkDQfTVLAIXAf9ETdCpduCVTkDe2NNZ8NIwUVzw==}
jsdom@26.1.0:
resolution: {integrity: sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==}
engines: {node: '>=18'}
peerDependencies:
canvas: ^3.0.0
@@ -2528,6 +2544,9 @@ packages:
loupe@3.1.3:
resolution: {integrity: sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==}
loupe@3.2.0:
resolution: {integrity: sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw==}
lru-cache@10.4.3:
resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
@@ -2589,14 +2608,6 @@ packages:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'}
mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
min-indent@1.0.1:
resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
engines: {node: '>=4'}
@@ -3230,8 +3241,8 @@ packages:
tinyexec@0.3.2:
resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}
tinyglobby@0.2.12:
resolution: {integrity: sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==}
tinyglobby@0.2.14:
resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==}
engines: {node: '>=12.0.0'}
tinypool@1.0.2:
@@ -3635,13 +3646,13 @@ snapshots:
'@analytics/type-utils@0.6.2': {}
'@appwrite.io/console@1.9.0': {}
'@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2408': {}
'@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870(svelte@5.25.3)':
'@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)':
dependencies:
svelte: 5.25.3
'@appwrite.io/pink-icons-svelte@https://try-module.cloud/module/@appwrite/%40appwrite.io%2Fpink-icons-svelte@12707b9(svelte@5.25.3)':
'@appwrite.io/pink-icons-svelte@https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@0b77850(svelte@5.25.3)':
dependencies:
svelte: 5.25.3
@@ -3654,12 +3665,13 @@ snapshots:
'@appwrite.io/pink-icons': 1.0.0
the-new-css-reset: 1.11.3
'@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778(svelte@5.25.3)':
'@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@0b77850(svelte@5.25.3)':
dependencies:
'@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870(svelte@5.25.3)
'@appwrite.io/pink-icons-svelte': 2.0.0-RC.1(svelte@5.25.3)
'@floating-ui/dom': 1.6.13
'@melt-ui/pp': 0.3.2(@melt-ui/svelte@0.86.6(svelte@5.25.3))(svelte@5.25.3)
'@melt-ui/svelte': 0.86.6(svelte@5.25.3)
'@tanstack/svelte-virtual': 3.13.12(svelte@5.25.3)
ansicolor: 2.0.3
d3: 7.9.0
fuse.js: 7.1.0
@@ -3874,18 +3886,18 @@ snapshots:
'@esbuild/win32-x64@0.25.1':
optional: true
'@eslint-community/eslint-utils@4.5.1(eslint@9.23.0)':
'@eslint-community/eslint-utils@4.5.1(eslint@9.31.0)':
dependencies:
eslint: 9.23.0
eslint: 9.31.0
eslint-visitor-keys: 3.4.3
'@eslint-community/regexpp@4.12.1': {}
'@eslint/compat@1.2.7(eslint@9.23.0)':
'@eslint/compat@1.3.1(eslint@9.31.0)':
optionalDependencies:
eslint: 9.23.0
eslint: 9.31.0
'@eslint/config-array@0.19.2':
'@eslint/config-array@0.21.0':
dependencies:
'@eslint/object-schema': 2.1.6
debug: 4.4.0
@@ -3893,9 +3905,9 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@eslint/config-helpers@0.2.0': {}
'@eslint/config-helpers@0.3.0': {}
'@eslint/core@0.12.0':
'@eslint/core@0.15.1':
dependencies:
'@types/json-schema': 7.0.15
@@ -3903,7 +3915,7 @@ snapshots:
dependencies:
ajv: 6.12.6
debug: 4.4.0
espree: 10.3.0
espree: 10.4.0
globals: 14.0.0
ignore: 5.3.2
import-fresh: 3.3.1
@@ -3913,15 +3925,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@eslint/js@9.23.0': {}
'@eslint/js@9.24.0': {}
'@eslint/js@9.31.0': {}
'@eslint/object-schema@2.1.6': {}
'@eslint/plugin-kit@0.2.7':
'@eslint/plugin-kit@0.3.3':
dependencies:
'@eslint/core': 0.12.0
'@eslint/core': 0.15.1
levn: 0.4.1
'@floating-ui/core@1.6.9':
@@ -4710,6 +4720,13 @@ snapshots:
dependencies:
tslib: 2.8.1
'@tanstack/svelte-virtual@3.13.12(svelte@5.25.3)':
dependencies:
'@tanstack/virtual-core': 3.13.12
svelte: 5.25.3
'@tanstack/virtual-core@3.13.12': {}
'@testing-library/dom@10.4.0':
dependencies:
'@babel/code-frame': 7.26.2
@@ -4731,13 +4748,13 @@ snapshots:
lodash: 4.17.21
redent: 3.0.0
'@testing-library/svelte@5.2.7(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(sass@1.86.0))(vitest@3.0.9)':
'@testing-library/svelte@5.2.8(svelte@5.25.3)(vite@6.2.3(@types/node@22.13.14)(sass@1.86.0))(vitest@3.0.9)':
dependencies:
'@testing-library/dom': 10.4.0
svelte: 5.25.3
optionalDependencies:
vite: 6.2.3(@types/node@22.13.14)(sass@1.86.0)
vitest: 3.0.9(@types/node@22.13.14)(@vitest/ui@3.0.9)(jsdom@26.0.0)(sass@1.86.0)
vitest: 3.0.9(@types/node@22.13.14)(@vitest/ui@3.2.4)(jsdom@26.1.0)(sass@1.86.0)
'@testing-library/user-event@14.6.1(@testing-library/dom@10.4.0)':
dependencies:
@@ -4791,7 +4808,7 @@ snapshots:
'@types/prop-types@15.7.14': {}
'@types/react@18.3.23':
'@types/react@18.3.22':
dependencies:
'@types/prop-types': 15.7.14
csstype: 3.1.3
@@ -4806,15 +4823,15 @@ snapshots:
'@types/unist@3.0.3': {}
'@typescript-eslint/eslint-plugin@8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.23.0)(typescript@5.8.2))(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/eslint-plugin@8.28.0(@typescript-eslint/parser@8.28.0(eslint@9.31.0)(typescript@5.8.2))(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@eslint-community/regexpp': 4.12.1
'@typescript-eslint/parser': 8.28.0(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/parser': 8.28.0(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/scope-manager': 8.28.0
'@typescript-eslint/type-utils': 8.28.0(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.28.0(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/type-utils': 8.28.0(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.28.0(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 8.28.0
eslint: 9.23.0
eslint: 9.31.0
graphemer: 1.4.0
ignore: 5.3.2
natural-compare: 1.4.0
@@ -4823,15 +4840,15 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/eslint-plugin@8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.23.0)(typescript@5.8.2))(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/eslint-plugin@8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.31.0)(typescript@5.8.2))(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@eslint-community/regexpp': 4.12.1
'@typescript-eslint/parser': 8.30.1(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/parser': 8.30.1(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/scope-manager': 8.30.1
'@typescript-eslint/type-utils': 8.30.1(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.30.1(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/type-utils': 8.30.1(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.30.1(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 8.30.1
eslint: 9.23.0
eslint: 9.31.0
graphemer: 1.4.0
ignore: 5.3.2
natural-compare: 1.4.0
@@ -4840,26 +4857,26 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@8.28.0(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/parser@8.28.0(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@typescript-eslint/scope-manager': 8.28.0
'@typescript-eslint/types': 8.28.0
'@typescript-eslint/typescript-estree': 8.28.0(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 8.28.0
debug: 4.4.0
eslint: 9.23.0
eslint: 9.31.0
typescript: 5.8.2
transitivePeerDependencies:
- supports-color
'@typescript-eslint/parser@8.30.1(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/parser@8.30.1(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@typescript-eslint/scope-manager': 8.30.1
'@typescript-eslint/types': 8.30.1
'@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.2)
'@typescript-eslint/visitor-keys': 8.30.1
debug: 4.4.0
eslint: 9.23.0
eslint: 9.31.0
typescript: 5.8.2
transitivePeerDependencies:
- supports-color
@@ -4874,23 +4891,23 @@ snapshots:
'@typescript-eslint/types': 8.30.1
'@typescript-eslint/visitor-keys': 8.30.1
'@typescript-eslint/type-utils@8.28.0(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/type-utils@8.28.0(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@typescript-eslint/typescript-estree': 8.28.0(typescript@5.8.2)
'@typescript-eslint/utils': 8.28.0(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.28.0(eslint@9.31.0)(typescript@5.8.2)
debug: 4.4.0
eslint: 9.23.0
eslint: 9.31.0
ts-api-utils: 2.1.0(typescript@5.8.2)
typescript: 5.8.2
transitivePeerDependencies:
- supports-color
'@typescript-eslint/type-utils@8.30.1(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/type-utils@8.30.1(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.2)
'@typescript-eslint/utils': 8.30.1(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.30.1(eslint@9.31.0)(typescript@5.8.2)
debug: 4.4.0
eslint: 9.23.0
eslint: 9.31.0
ts-api-utils: 2.1.0(typescript@5.8.2)
typescript: 5.8.2
transitivePeerDependencies:
@@ -4928,24 +4945,24 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@8.28.0(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/utils@8.28.0(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@eslint-community/eslint-utils': 4.5.1(eslint@9.23.0)
'@eslint-community/eslint-utils': 4.5.1(eslint@9.31.0)
'@typescript-eslint/scope-manager': 8.28.0
'@typescript-eslint/types': 8.28.0
'@typescript-eslint/typescript-estree': 8.28.0(typescript@5.8.2)
eslint: 9.23.0
eslint: 9.31.0
typescript: 5.8.2
transitivePeerDependencies:
- supports-color
'@typescript-eslint/utils@8.30.1(eslint@9.23.0)(typescript@5.8.2)':
'@typescript-eslint/utils@8.30.1(eslint@9.31.0)(typescript@5.8.2)':
dependencies:
'@eslint-community/eslint-utils': 4.5.1(eslint@9.23.0)
'@eslint-community/eslint-utils': 4.5.1(eslint@9.31.0)
'@typescript-eslint/scope-manager': 8.30.1
'@typescript-eslint/types': 8.30.1
'@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.2)
eslint: 9.23.0
eslint: 9.31.0
typescript: 5.8.2
transitivePeerDependencies:
- supports-color
@@ -4981,6 +4998,10 @@ snapshots:
dependencies:
tinyrainbow: 2.0.0
'@vitest/pretty-format@3.2.4':
dependencies:
tinyrainbow: 2.0.0
'@vitest/runner@3.0.9':
dependencies:
'@vitest/utils': 3.0.9
@@ -4996,16 +5017,16 @@ snapshots:
dependencies:
tinyspy: 3.0.2
'@vitest/ui@3.0.9(vitest@3.0.9)':
'@vitest/ui@3.2.4(vitest@3.0.9)':
dependencies:
'@vitest/utils': 3.0.9
'@vitest/utils': 3.2.4
fflate: 0.8.2
flatted: 3.3.3
pathe: 2.0.3
sirv: 3.0.1
tinyglobby: 0.2.12
tinyglobby: 0.2.14
tinyrainbow: 2.0.0
vitest: 3.0.9(@types/node@22.13.14)(@vitest/ui@3.0.9)(jsdom@26.0.0)(sass@1.86.0)
vitest: 3.0.9(@types/node@22.13.14)(@vitest/ui@3.2.4)(jsdom@26.1.0)(sass@1.86.0)
'@vitest/utils@3.0.9':
dependencies:
@@ -5013,6 +5034,12 @@ snapshots:
loupe: 3.1.3
tinyrainbow: 2.0.0
'@vitest/utils@3.2.4':
dependencies:
'@vitest/pretty-format': 3.2.4
loupe: 3.2.0
tinyrainbow: 2.0.0
'@vue/compiler-core@3.5.13':
dependencies:
'@babel/parser': 7.27.0
@@ -5075,8 +5102,14 @@ snapshots:
dependencies:
acorn: 8.14.1
acorn-jsx@5.3.2(acorn@8.15.0):
dependencies:
acorn: 8.15.0
acorn@8.14.1: {}
acorn@8.15.0: {}
agent-base@6.0.2:
dependencies:
debug: 4.4.0
@@ -5158,8 +5191,6 @@ snapshots:
dependencies:
tslib: 2.8.1
asynckit@0.4.0: {}
autolinker@3.16.2:
dependencies:
tslib: 2.8.1
@@ -5292,10 +5323,6 @@ snapshots:
color-convert: 3.1.0
color-string: 2.0.1
combined-stream@1.0.8:
dependencies:
delayed-stream: 1.0.0
comma-separated-tokens@2.0.3: {}
commander@7.2.0: {}
@@ -5540,8 +5567,6 @@ snapshots:
dependencies:
robust-predicates: 3.0.2
delayed-stream@1.0.0: {}
dequal@2.0.3: {}
detect-libc@1.0.3:
@@ -5600,13 +5625,6 @@ snapshots:
dependencies:
es-errors: 1.3.0
es-set-tostringtag@2.1.0:
dependencies:
es-errors: 1.3.0
get-intrinsic: 1.3.0
has-tostringtag: 1.0.2
hasown: 2.0.2
esbuild@0.25.1:
optionalDependencies:
'@esbuild/aix-ppc64': 0.25.1
@@ -5639,21 +5657,21 @@ snapshots:
escape-string-regexp@4.0.0: {}
eslint-compat-utils@0.6.4(eslint@9.23.0):
eslint-compat-utils@0.6.4(eslint@9.31.0):
dependencies:
eslint: 9.23.0
eslint: 9.31.0
semver: 7.7.1
eslint-config-prettier@10.1.1(eslint@9.23.0):
eslint-config-prettier@10.1.1(eslint@9.31.0):
dependencies:
eslint: 9.23.0
eslint: 9.31.0
eslint-plugin-svelte@3.3.3(eslint@9.23.0)(svelte@5.25.3):
eslint-plugin-svelte@3.3.3(eslint@9.31.0)(svelte@5.25.3):
dependencies:
'@eslint-community/eslint-utils': 4.5.1(eslint@9.23.0)
'@eslint-community/eslint-utils': 4.5.1(eslint@9.31.0)
'@jridgewell/sourcemap-codec': 1.5.0
eslint: 9.23.0
eslint-compat-utils: 0.6.4(eslint@9.23.0)
eslint: 9.31.0
eslint-compat-utils: 0.6.4(eslint@9.31.0)
esutils: 2.0.3
known-css-properties: 0.35.0
postcss: 8.5.3
@@ -5671,20 +5689,27 @@ snapshots:
esrecurse: 4.3.0
estraverse: 5.3.0
eslint-scope@8.4.0:
dependencies:
esrecurse: 4.3.0
estraverse: 5.3.0
eslint-visitor-keys@3.4.3: {}
eslint-visitor-keys@4.2.0: {}
eslint@9.23.0:
eslint-visitor-keys@4.2.1: {}
eslint@9.31.0:
dependencies:
'@eslint-community/eslint-utils': 4.5.1(eslint@9.23.0)
'@eslint-community/eslint-utils': 4.5.1(eslint@9.31.0)
'@eslint-community/regexpp': 4.12.1
'@eslint/config-array': 0.19.2
'@eslint/config-helpers': 0.2.0
'@eslint/core': 0.12.0
'@eslint/config-array': 0.21.0
'@eslint/config-helpers': 0.3.0
'@eslint/core': 0.15.1
'@eslint/eslintrc': 3.3.1
'@eslint/js': 9.23.0
'@eslint/plugin-kit': 0.2.7
'@eslint/js': 9.31.0
'@eslint/plugin-kit': 0.3.3
'@humanfs/node': 0.16.6
'@humanwhocodes/module-importer': 1.0.1
'@humanwhocodes/retry': 0.4.2
@@ -5695,9 +5720,9 @@ snapshots:
cross-spawn: 7.0.6
debug: 4.4.0
escape-string-regexp: 4.0.0
eslint-scope: 8.3.0
eslint-visitor-keys: 4.2.0
espree: 10.3.0
eslint-scope: 8.4.0
eslint-visitor-keys: 4.2.1
espree: 10.4.0
esquery: 1.6.0
esutils: 2.0.3
fast-deep-equal: 3.1.3
@@ -5723,6 +5748,12 @@ snapshots:
acorn-jsx: 5.3.2(acorn@8.14.1)
eslint-visitor-keys: 4.2.0
espree@10.4.0:
dependencies:
acorn: 8.15.0
acorn-jsx: 5.3.2(acorn@8.15.0)
eslint-visitor-keys: 4.2.1
esprima@4.0.1: {}
esquery@1.6.0:
@@ -5775,6 +5806,10 @@ snapshots:
optionalDependencies:
picomatch: 4.0.2
fdir@6.4.6(picomatch@4.0.2):
optionalDependencies:
picomatch: 4.0.2
fflate@0.8.2: {}
file-entry-cache@8.0.0:
@@ -5805,13 +5840,6 @@ snapshots:
dependencies:
is-callable: 1.2.7
form-data@4.0.2:
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
es-set-tostringtag: 2.1.0
mime-types: 2.1.35
forwarded-parse@2.1.2: {}
framesync@6.1.2:
@@ -6079,12 +6107,11 @@ snapshots:
dependencies:
argparse: 2.0.1
jsdom@26.0.0:
jsdom@26.1.0:
dependencies:
cssstyle: 4.3.0
data-urls: 5.0.0
decimal.js: 10.5.0
form-data: 4.0.2
html-encoding-sniffer: 4.0.0
http-proxy-agent: 7.0.2
https-proxy-agent: 7.0.6
@@ -6150,6 +6177,8 @@ snapshots:
loupe@3.1.3: {}
loupe@3.2.0: {}
lru-cache@10.4.3: {}
lru-cache@5.1.1:
@@ -6218,12 +6247,6 @@ snapshots:
braces: 3.0.3
picomatch: 2.3.1
mime-db@1.52.0: {}
mime-types@2.1.35:
dependencies:
mime-db: 1.52.0
min-indent@1.0.1: {}
minimatch@3.1.2:
@@ -6752,7 +6775,7 @@ snapshots:
svelte-motion@0.12.2(svelte@5.25.3):
dependencies:
'@types/react': 18.3.23
'@types/react': 18.3.22
framesync: 6.1.2
popmotion: 11.0.5
style-value-types: 5.1.2
@@ -6844,9 +6867,9 @@ snapshots:
tinyexec@0.3.2: {}
tinyglobby@0.2.12:
tinyglobby@0.2.14:
dependencies:
fdir: 6.4.3(picomatch@4.0.2)
fdir: 6.4.6(picomatch@4.0.2)
picomatch: 4.0.2
tinypool@1.0.2: {}
@@ -6905,12 +6928,12 @@ snapshots:
dependencies:
prelude-ls: 1.2.1
typescript-eslint@8.30.1(eslint@9.23.0)(typescript@5.8.2):
typescript-eslint@8.30.1(eslint@9.31.0)(typescript@5.8.2):
dependencies:
'@typescript-eslint/eslint-plugin': 8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.23.0)(typescript@5.8.2))(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/parser': 8.30.1(eslint@9.23.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.30.1(eslint@9.23.0)(typescript@5.8.2)
eslint: 9.23.0
'@typescript-eslint/eslint-plugin': 8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.31.0)(typescript@5.8.2))(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/parser': 8.30.1(eslint@9.31.0)(typescript@5.8.2)
'@typescript-eslint/utils': 8.30.1(eslint@9.31.0)(typescript@5.8.2)
eslint: 9.31.0
typescript: 5.8.2
transitivePeerDependencies:
- supports-color
@@ -7010,7 +7033,7 @@ snapshots:
optionalDependencies:
vite: 6.2.3(@types/node@22.13.14)(sass@1.86.0)
vitest@3.0.9(@types/node@22.13.14)(@vitest/ui@3.0.9)(jsdom@26.0.0)(sass@1.86.0):
vitest@3.0.9(@types/node@22.13.14)(@vitest/ui@3.2.4)(jsdom@26.1.0)(sass@1.86.0):
dependencies:
'@vitest/expect': 3.0.9
'@vitest/mocker': 3.0.9(vite@6.2.3(@types/node@22.13.14)(sass@1.86.0))
@@ -7034,8 +7057,8 @@ snapshots:
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 22.13.14
'@vitest/ui': 3.0.9(vitest@3.0.9)
jsdom: 26.0.0
'@vitest/ui': 3.2.4(vitest@3.0.9)
jsdom: 26.1.0
transitivePeerDependencies:
- jiti
- less
+5 -5
View File
@@ -5,9 +5,9 @@
<meta
name="description"
content="Appwrite is an open-source platform for building applications at any scale, using your preferred programming languages and tools." />
<link rel="icon" type="image/svg+xml" href="/console/logos/appwrite-icon.svg" />
<link rel="mask-icon" type="image/png" href="/console/logos/appwrite-icon.png" />
<link rel="stylesheet" href="/console/css/loading.css" />
<link rel="icon" type="image/svg+xml" href="%sveltekit.assets%/logos/appwrite-icon.svg" />
<link rel="mask-icon" type="image/png" href="%sveltekit.assets%/logos/appwrite-icon.png" />
<link rel="stylesheet" href="%sveltekit.assets%/css/loading.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
@@ -40,13 +40,13 @@
<div></div>
</div>
<img
src="/console/images/appwrite-logo-light.svg"
src="%sveltekit.assets%/images/appwrite-logo-light.svg"
width="120"
height="22"
class="logo-light"
alt="Appwrite Logo" />
<img
src="/console/images/appwrite-logo-dark.svg"
src="%sveltekit.assets%/images/appwrite-logo-dark.svg"
width="120"
height="22"
class="logo-dark"
+21 -4
View File
@@ -148,7 +148,12 @@
})}
clearOnCallback={false}
on:keydown={(e) => {
if (e.detail.key !== 'Escape') {
const showingExamples = !$isLoading && !answer;
if (e.detail.key === 'Enter' && $input.trim()) {
e.detail.cancel();
return;
}
if (e.detail.key !== 'Escape' && !showingExamples) {
e.detail.cancel();
}
}}
@@ -302,15 +307,27 @@
}
}
:global(.answer ul),
:global(.answer ol) {
gap: 1rem;
:global(.answer ul) {
padding-inline-start: 1rem;
list-style-type: disc;
display: grid;
gap: 1rem;
}
:global(.answer ol) {
padding-inline-start: 1.1rem;
list-style-type: decimal;
display: grid;
gap: 1rem;
}
:global(.answer a) {
text-decoration: underline;
}
:global(.answer a:hover) {
opacity: 0.8;
}
}
.experimental {
@@ -12,7 +12,7 @@
$organization.$id,
$paymentMissingMandate.$id
);
await confirmSetup(method.clientSecret, method.$id);
await confirmSetup(method.clientSecret, method.providerMethodId);
}
</script>
@@ -0,0 +1,56 @@
<script lang="ts">
import { page } from '$app/state';
import { Click } from '$lib/actions/analytics';
import { Button } from '$lib/elements/forms';
import { HeaderAlert } from '$lib/layout';
import {
billingProjectsLimitDate,
hideBillingHeaderRoutes,
upgradeURL
} from '$lib/stores/billing';
import { currentPlan } from '$lib/stores/organization';
import SelectProjectCloud from './selectProjectCloud.svelte';
import { toLocaleDate } from '$lib/helpers/date';
let selectedProjects: string[] = $state([]);
let showSelectProject: boolean = $state(false);
const organizationId = $derived(page.data.organization?.$id);
$effect(() => {
if (organizationId) {
selectedProjects = page.data.organization?.projects || [];
}
});
</script>
<SelectProjectCloud bind:showSelectProject bind:selectedProjects {organizationId} />
{#if $currentPlan && $currentPlan.projects > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)}
<HeaderAlert
type="warning"
title="Action required: You have more than {$currentPlan.projects} projects.">
<svelte:fragment>
Choose which projects to keep before {toLocaleDate(billingProjectsLimitDate)} or upgrade
to Pro. Projects over the limit will be blocked after this date.
</svelte:fragment>
<svelte:fragment slot="buttons">
<Button
compact
on:click={() => {
showSelectProject = true;
}}>Manage projects</Button>
<Button
href={$upgradeURL}
event={Click.OrganizationClickUpgrade}
eventData={{
from: 'button',
source: 'projects_limit_banner'
}}
secondary
fullWidthMobile>
<span class="text">Upgrade</span>
</Button>
</svelte:fragment>
</HeaderAlert>
{/if}
@@ -0,0 +1,176 @@
<script lang="ts">
import { type Models, Query } from '@appwrite.io/console';
import { Alert, Button, Skeleton, Table } from '@appwrite.io/pink-svelte';
import { Modal } from '$lib/components';
import { sdk } from '$lib/stores/sdk';
import { addNotification } from '$lib/stores/notifications';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { billingProjectsLimitDate } from '$lib/stores/billing';
import { toLocaleDate, toLocaleDateTime } from '$lib/helpers/date';
import { currentPlan } from '$lib/stores/organization';
let {
showSelectProject = $bindable(false),
selectedProjects = $bindable([]),
organizationId
}: {
showSelectProject: boolean;
selectedProjects: string[];
organizationId: string;
} = $props();
let loading = $state(false);
let projectsLoadingError = $state<string | null>(null);
let error = $state<string | null>(null);
let projects = $state<Array<Models.Project>>([]);
let projectsToArchive = $derived(
projects.filter((project) => !selectedProjects.includes(project.$id))
);
async function updateSelected() {
try {
await sdk.forConsole.billing.updateSelectedProjects(
projects[0].teamId,
selectedProjects
);
showSelectProject = false;
invalidate(Dependencies.ORGANIZATION);
addNotification({
type: 'success',
message: `Projects updated for archiving`
});
} catch (e) {
error = e.message;
}
}
function formatProjectsToArchive() {
let result = '';
projectsToArchive.forEach((project, index) => {
const text = `${index === 0 ? '' : ' '}<b>${project.name}</b> `;
result += text;
if (index < projectsToArchive.length - 1) {
if (index == projectsToArchive.length - 2) {
result += 'and ';
}
if (index < projectsToArchive.length - 2) {
result += ', ';
}
}
});
return result;
}
$effect(() => {
if (!showSelectProject) return;
const areProjectsLoaded = projects.length > 0;
const teamIdInLoadedProjects = areProjectsLoaded ? projects[0].teamId : null;
if (organizationId != teamIdInLoadedProjects) {
loading = true;
sdk.forConsole.projects
.list([
Query.equal('teamId', organizationId),
Query.limit(1000) // Get all projects for organization
])
.then((loadedProjects) => (projects = loadedProjects.projects))
.catch((err) => (projectsLoadingError = err.message))
.finally(() => (loading = false));
}
});
</script>
<Modal bind:show={showSelectProject} title="Manage projects" onSubmit={updateSelected}>
<svelte:fragment slot="description">
Choose which {$currentPlan?.projects || 2} projects to keep. Projects over the limit will be
blocked after this date.
</svelte:fragment>
{#if loading}
<div class="skeleton-projects">
<Table.Root let:root allowSelection columns={[{ id: 'name' }, { id: 'created' }]}>
<svelte:fragment slot="header" let:root>
<Table.Header.Cell column="name" {root}>Project Name</Table.Header.Cell>
<Table.Header.Cell column="created" {root}>Created</Table.Header.Cell>
</svelte:fragment>
{#each Array.from({ length: 5 }) as _}
<Table.Row.Base {root} select="disabled">
<Table.Cell column="name" {root}>
<Skeleton variant="line" height={20} width="80%" />
</Table.Cell>
<Table.Cell column="created" {root}>
<Skeleton variant="line" height={20} width="80%" />
</Table.Cell>
</Table.Row.Base>
{/each}
</Table.Root>
</div>
{:else if projectsLoadingError}
<Alert.Inline status="error" title="Error">{projectsLoadingError}</Alert.Inline>
{:else}
{#if error}
<Alert.Inline status="error" title="Error">{error}</Alert.Inline>
{/if}
<Table.Root
let:root
allowSelection
bind:selectedRows={selectedProjects}
columns={[{ id: 'name' }, { id: 'created' }]}>
<svelte:fragment slot="header" let:root>
<Table.Header.Cell column="name" {root}>Project Name</Table.Header.Cell>
<Table.Header.Cell column="created" {root}>Created</Table.Header.Cell>
</svelte:fragment>
{#each projects as project}
<Table.Row.Base {root} id={project.$id}>
<Table.Cell column="name" {root}>{project.name}</Table.Cell>
<Table.Cell column="created" {root}
>{toLocaleDateTime(project.$createdAt)}</Table.Cell>
</Table.Row.Base>
{/each}
</Table.Root>
{#if selectedProjects.length > $currentPlan?.projects}
<div class="u-text-warning u-mb-4">
You can only select {$currentPlan?.projects} projects. Please deselect others to continue.
</div>
{/if}
{#if selectedProjects.length === $currentPlan?.projects}
<Alert.Inline
status="warning"
title={`${projects.length - selectedProjects.length} projects will be archived on ${toLocaleDate(billingProjectsLimitDate)}`}>
<span>
{@html formatProjectsToArchive()}
will be archived.
</span>
</Alert.Inline>
{/if}
{/if}
<svelte:fragment slot="footer">
<Button.Button size="s" variant="secondary" on:click={() => (showSelectProject = false)}
>Cancel</Button.Button>
<Button.Button size="s" disabled={selectedProjects.length !== $currentPlan?.projects}
>Save</Button.Button>
</svelte:fragment>
</Modal>
<style lang="scss">
/* disable the top select all selector button */
.skeleton-projects :global([role='rowheader'] button) {
opacity: 0.4;
cursor: default;
pointer-events: none;
background: var(--bgcolor-neutral-tertiary);
}
</style>
+26 -17
View File
@@ -5,6 +5,8 @@
import { initializeStripe, unmountPaymentElement } from '$lib/stores/stripe';
import { Badge, Card, Layout } from '@appwrite.io/pink-svelte';
import type { PaymentMethodData } from '$lib/sdk/billing';
import type { PaymentMethod } from '@stripe/stripe-js';
import StatePicker from './statePicker.svelte';
export let methods: PaymentMethodData[];
export let group: string;
@@ -14,6 +16,9 @@
export let disabledCondition: string = null;
export let setAsDefault = false;
export let showSetAsDefault = false;
export let showState = false;
export let paymentMethod: PaymentMethod | null = null;
export let state: string = '';
let element: HTMLDivElement;
let loader: HTMLDivElement;
@@ -79,25 +84,29 @@
{/each}
<Card.Selector title="Add new payment method" name="$new" bind:group value="$new" />
{#if group === '$new'}
<InputText
id="name"
label="Cardholder name"
placeholder="Cardholder name"
bind:value={name}
required
autofocus={true} />
{#if showState}
<StatePicker card={paymentMethod} bind:state />
{:else}
<InputText
id="name"
label="Cardholder name"
placeholder="Cardholder name"
bind:value={name}
required
autofocus={true} />
<div class="aw-stripe-container" data-private>
<div class="loader-container" bind:this={loader}>
<div class="loader"></div>
<div class="aw-stripe-container" data-private>
<div class="loader-container" bind:this={loader}>
<div class="loader"></div>
</div>
<div bind:this={element}></div>
</div>
<div bind:this={element}></div>
</div>
{#if showSetAsDefault}
<InputChoice
bind:value={setAsDefault}
id="default"
label="Set as default payment method for this organization" />
{#if showSetAsDefault}
<InputChoice
bind:value={setAsDefault}
id="default"
label="Set as default payment method for this organization" />
{/if}
{/if}
{/if}
</Layout.Stack>
+52 -22
View File
@@ -2,12 +2,14 @@
import { FakeModal } from '$lib/components';
import { InputText, Button } from '$lib/elements/forms';
import { createEventDispatcher, onMount } from 'svelte';
import { initializeStripe, submitStripeCard } from '$lib/stores/stripe';
import { initializeStripe, setPaymentMethod, submitStripeCard } from '$lib/stores/stripe';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { addNotification } from '$lib/stores/notifications';
import { page } from '$app/state';
import { Spinner } from '@appwrite.io/pink-svelte';
import type { PaymentMethod } from '@stripe/stripe-js';
import StatePicker from './statePicker.svelte';
export let show = false;
@@ -16,12 +18,38 @@
let name: string;
let error: string;
let modal: FakeModal;
let showState: boolean = false;
let state: string = '';
let paymentMethod: PaymentMethod | null = null;
async function handleSubmit() {
try {
if (showState && !state) {
throw Error('Please select a state');
}
if (showState) {
const card = await setPaymentMethod(paymentMethod.id, name, state);
modal.closeModal();
await invalidate(Dependencies.PAYMENT_METHODS);
dispatch('submit', card);
addNotification({
type: 'success',
message: 'A new payment method has been added to your account'
});
return;
}
const card = await submitStripeCard(name, page?.params?.organization ?? null);
if (card && Object.hasOwn(card, 'id')) {
if ((card as PaymentMethod).card?.country === 'US') {
paymentMethod = card as PaymentMethod;
showState = true;
return;
}
}
modal.closeModal();
invalidate(Dependencies.PAYMENT_METHODS);
await invalidate(Dependencies.PAYMENT_METHODS);
dispatch('submit', card);
addNotification({
type: 'success',
@@ -73,28 +101,30 @@
bind:error
onSubmit={handleSubmit}>
<slot />
<InputText
id="name"
required
autofocus={true}
bind:value={name}
label="Cardholder name"
placeholder="Cardholder name" />
<div class="aw-stripe-container" data-private>
{#if isLoading}
<div class="loader-element">
<Spinner />
{#if showState}
<StatePicker card={paymentMethod} bind:state />
{:else}
<InputText
id="name"
required
autofocus={true}
bind:value={name}
label="Cardholder name"
placeholder="Cardholder name" />
<div class="aw-stripe-container" data-private>
{#if isLoading}
<div class="loader-element">
<Spinner />
</div>
{/if}
<div
style:display={isLoading ? 'none' : 'initial'}
class="stripe-element"
bind:this={element}>
<!-- Stripe will create form elements here -->
</div>
{/if}
<div
style:display={isLoading ? 'none' : 'initial'}
class="stripe-element"
bind:this={element}>
<!-- Stripe will create form elements here -->
</div>
</div>
{/if}
<slot name="end"></slot>
<svelte:fragment slot="footer">
<Button secondary on:click={() => (show = false)}>Cancel</Button>
@@ -24,9 +24,10 @@
bind:group={billingPlan}
disabled={anyOrgFree || !selfService}
value={BillingPlan.FREE}
tooltipShow={anyOrgFree}
title={tierFree.name}
tooltipText="You are limited to 1 Free organization per account.">
tooltipShow={anyOrgFree}
tooltipText="You are limited to 1 Free organization per account."
tooltipWidth="100%">
<svelte:fragment slot="action">
{#if $organization?.billingPlan === BillingPlan.FREE && !isNewOrg}
<Badge variant="secondary" size="xs" content="Current plan" />
@@ -11,17 +11,28 @@
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
export let methods: PaymentList;
export let value: string;
export let taxId = '';
export let methods: PaymentList;
let showTaxId = false;
let showPaymentModal = false;
async function cardSaved(event: CustomEvent<PaymentMethodData>) {
value = event.detail.$id;
invalidate(Dependencies.UPGRADE_PLAN);
invalidate(Dependencies.CREATE_ORGANIZATION);
if (value) {
methods = {
...methods,
total: methods.total + 1,
paymentMethods: [...methods.paymentMethods, event.detail]
};
}
await Promise.all([
invalidate(Dependencies.UPGRADE_PLAN),
invalidate(Dependencies.ORGANIZATION)
]);
}
onMount(() => {
+238
View File
@@ -0,0 +1,238 @@
export const states: Array<{ name: string; abbreviation: string }> = [
{
name: 'Alabama',
abbreviation: 'AL'
},
{
name: 'Alaska',
abbreviation: 'AK'
},
{
name: 'American Samoa',
abbreviation: 'AS'
},
{
name: 'Arizona',
abbreviation: 'AZ'
},
{
name: 'Arkansas',
abbreviation: 'AR'
},
{
name: 'California',
abbreviation: 'CA'
},
{
name: 'Colorado',
abbreviation: 'CO'
},
{
name: 'Connecticut',
abbreviation: 'CT'
},
{
name: 'Delaware',
abbreviation: 'DE'
},
{
name: 'District Of Columbia',
abbreviation: 'DC'
},
{
name: 'Federated States Of Micronesia',
abbreviation: 'FM'
},
{
name: 'Florida',
abbreviation: 'FL'
},
{
name: 'Georgia',
abbreviation: 'GA'
},
{
name: 'Guam',
abbreviation: 'GU'
},
{
name: 'Hawaii',
abbreviation: 'HI'
},
{
name: 'Idaho',
abbreviation: 'ID'
},
{
name: 'Illinois',
abbreviation: 'IL'
},
{
name: 'Indiana',
abbreviation: 'IN'
},
{
name: 'Iowa',
abbreviation: 'IA'
},
{
name: 'Kansas',
abbreviation: 'KS'
},
{
name: 'Kentucky',
abbreviation: 'KY'
},
{
name: 'Louisiana',
abbreviation: 'LA'
},
{
name: 'Maine',
abbreviation: 'ME'
},
{
name: 'Marshall Islands',
abbreviation: 'MH'
},
{
name: 'Maryland',
abbreviation: 'MD'
},
{
name: 'Massachusetts',
abbreviation: 'MA'
},
{
name: 'Michigan',
abbreviation: 'MI'
},
{
name: 'Minnesota',
abbreviation: 'MN'
},
{
name: 'Mississippi',
abbreviation: 'MS'
},
{
name: 'Missouri',
abbreviation: 'MO'
},
{
name: 'Montana',
abbreviation: 'MT'
},
{
name: 'Nebraska',
abbreviation: 'NE'
},
{
name: 'Nevada',
abbreviation: 'NV'
},
{
name: 'New Hampshire',
abbreviation: 'NH'
},
{
name: 'New Jersey',
abbreviation: 'NJ'
},
{
name: 'New Mexico',
abbreviation: 'NM'
},
{
name: 'New York',
abbreviation: 'NY'
},
{
name: 'North Carolina',
abbreviation: 'NC'
},
{
name: 'North Dakota',
abbreviation: 'ND'
},
{
name: 'Northern Mariana Islands',
abbreviation: 'MP'
},
{
name: 'Ohio',
abbreviation: 'OH'
},
{
name: 'Oklahoma',
abbreviation: 'OK'
},
{
name: 'Oregon',
abbreviation: 'OR'
},
{
name: 'Palau',
abbreviation: 'PW'
},
{
name: 'Pennsylvania',
abbreviation: 'PA'
},
{
name: 'Puerto Rico',
abbreviation: 'PR'
},
{
name: 'Rhode Island',
abbreviation: 'RI'
},
{
name: 'South Carolina',
abbreviation: 'SC'
},
{
name: 'South Dakota',
abbreviation: 'SD'
},
{
name: 'Tennessee',
abbreviation: 'TN'
},
{
name: 'Texas',
abbreviation: 'TX'
},
{
name: 'Utah',
abbreviation: 'UT'
},
{
name: 'Vermont',
abbreviation: 'VT'
},
{
name: 'Virgin Islands',
abbreviation: 'VI'
},
{
name: 'Virginia',
abbreviation: 'VA'
},
{
name: 'Washington',
abbreviation: 'WA'
},
{
name: 'West Virginia',
abbreviation: 'WV'
},
{
name: 'Wisconsin',
abbreviation: 'WI'
},
{
name: 'Wyoming',
abbreviation: 'WY'
}
];
@@ -0,0 +1,44 @@
<script lang="ts">
import { states } from './state';
import { InputSelect } from '$lib/elements/forms';
import type { PaymentMethod } from '@stripe/stripe-js';
import { Alert, Card, Layout, Typography } from '@appwrite.io/pink-svelte';
import { CreditCardBrandImage } from '../index.js';
export let state: string = '';
export let card: PaymentMethod | null = null;
</script>
<Layout.Stack direction="column" gap="m">
{#if card}
<Card.Base variant="secondary" padding="s">
<Layout.Stack direction="row" alignItems="center" gap="s">
<CreditCardBrandImage brand={card.card?.brand} />
<span>ending in {card.card?.last4}</span>
</Layout.Stack>
<Typography.Text size="s">
{card.card.country}
{card.billing_details.address.postal_code}
</Typography.Text>
</Card.Base>
{/if}
<Alert.Inline status="info" title="State is required for US payment methods">
<Typography.Text size="s">
To complete the billing information, select your state so we can apply the correct taxes
and meet U.S. legal requirements.
</Typography.Text>
</Alert.Inline>
<InputSelect
bind:value={state}
required
label="State"
placeholder="Select a state"
id="state-picker"
options={states.map((state) => ({
label: state.name,
value: state.abbreviation,
id: state.abbreviation.toLowerCase()
}))} />
</Layout.Stack>
@@ -48,7 +48,7 @@
}
</script>
<Modal bind:show title="Add credits" onSubmit={addCoupon} bind:error>
<Modal size="s" bind:show title="Add credits" onSubmit={addCoupon} bind:error>
<svelte:fragment slot="description">
Credits will be applied automatically to your next invoice.
</svelte:fragment>
@@ -58,10 +58,11 @@
placeholder="Promo code"
id="code"
label="Add promo code"
autofocus
bind:value={coupon} />
<svelte:fragment slot="footer">
<Button text on:click={() => (show = false)}>Cancel</Button>
<Button submit disabled={coupon === ''}>Add</Button>
<Button submissionLoader submit disabled={coupon === ''}>Add</Button>
</svelte:fragment>
</Modal>
@@ -11,7 +11,7 @@
{#if menu?.title}
<span class="menu-title">{menu.title}</span>
{/if}
<ActionMenu.Root>
<ActionMenu.Root width="100%">
{#each menu.items as menuItem}
{#if menuItem.href}
<ActionMenu.Item.Anchor
+59 -34
View File
@@ -3,7 +3,6 @@
import { hideNotification, shouldShowNotification } from '$lib/helpers/notifications';
import { app } from '$lib/stores/app';
import {
type BottomModalAlertAction,
type BottomModalAlertItem,
bottomModalAlertsConfig,
dismissBottomModalAlert,
@@ -20,18 +19,18 @@
import { goto } from '$app/navigation';
import { Typography } from '@appwrite.io/pink-svelte';
let currentIndex = 0;
let openModalOnMobile = false;
let currentIndex = $state(0);
let openModalOnMobile = $state(false);
function getPageScope(pathname: string) {
const isProjectPage = pathname.includes('project-[region]-[project]');
const isOrganizationPage = pathname.includes('organization-[organization]');
function getPageScope(route: string) {
const isProjectPage = route.includes('project-[region]-[project]');
const isOrganizationPage = route.includes('organization-[organization]');
return { isProjectPage, isOrganizationPage };
}
function filterModalAlerts(alerts: BottomModalAlertItem[], pathname: string) {
const { isProjectPage, isOrganizationPage } = getPageScope(pathname);
function filterModalAlerts(alerts: BottomModalAlertItem[], route: string) {
const { isProjectPage, isOrganizationPage } = getPageScope(route);
return alerts
.sort((a, b) => b.importance - a.importance)
@@ -51,19 +50,32 @@
});
}
$: filteredModalAlerts = filterModalAlerts($bottomModalAlertsConfig.alerts, page.route.id);
const bottomModalAlerts = $derived($bottomModalAlertsConfig.alerts);
$: currentModalAlert = filteredModalAlerts[currentIndex] as BottomModalAlertItem;
const filteredModalAlerts = $derived(filterModalAlerts(bottomModalAlerts, page.route.id));
$: hasOnlyPrimaryCta = typeof currentModalAlert?.learnMore === 'undefined';
const currentModalAlert = $derived(filteredModalAlerts[currentIndex] as BottomModalAlertItem);
function handleClose() {
filteredModalAlerts.forEach((alert) => {
const hasOnlyPrimaryCta = $derived(typeof currentModalAlert?.learnMore === 'undefined');
const isOnOnboarding = $derived(page.route.id.includes('(console)/onboarding'));
function handleClose(id: string | null = null) {
const alerts = !id
? filteredModalAlerts
: filteredModalAlerts.filter((alert) => alert.id === id);
alerts.forEach((alert) => {
const modalAlert = alert;
dismissBottomModalAlert(modalAlert.id);
hideNotification(modalAlert.id, { coolOffPeriod: 24 * 365 });
if (modalAlert.closed) modalAlert.closed();
});
// reset `currentIndex` if we removed the last item
if (currentIndex >= filteredModalAlerts.length - 1) {
currentIndex = Math.max(0, filteredModalAlerts.length - 2);
}
}
function showNext() {
@@ -114,8 +126,13 @@
}
// the button component cannot have both href and on:click!
function triggerWindowLink(alertAction: BottomModalAlertAction, event?: string) {
function triggerWindowLink(alert: BottomModalAlertItem, event?: string) {
const alertAction = alert.cta;
const shouldShowUpgrade = showUpgrade();
// for correct event tracking after removal
const currentModalId = currentModalAlert.id;
const url = shouldShowUpgrade
? $upgradeURL
: alertAction.link({
@@ -130,14 +147,12 @@
}
if (alertAction?.hideOnClick === true) {
// be careful of this one.
// once clicked, its gone!
handleClose();
handleClose(alert.id); // gone!
}
trackEvent(Click.PromoClick, {
promo: currentModalAlert.id,
type: shouldShowUpgrade ? 'upgrade' : (event ?? `cta_click_${currentModalAlert.id}`)
promo: currentModalId,
type: shouldShowUpgrade ? 'upgrade' : (event ?? `cta_click_${currentModalId}`)
});
}
@@ -156,12 +171,10 @@
}
}
onMount(() => {
addBottomModalAlerts();
});
onMount(addBottomModalAlerts);
</script>
{#if filteredModalAlerts.length > 0 && currentModalAlert && !page.url.pathname.includes('console/onboarding')}
{#if !isOnOnboarding && filteredModalAlerts.length > 0 && currentModalAlert}
{@const shouldShowUpgrade = showUpgrade()}
<div class="main-alert-wrapper is-not-mobile">
<div class="alert-container">
@@ -170,7 +183,7 @@
<button
aria-label="Close modal"
class="icon-inline-tag"
on:click={() => handleClose()}>
onclick={() => handleClose()}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
@@ -208,14 +221,19 @@
<button
aria-label="Previous"
class="icon-cheveron-left"
on:click={showPrevious}
style:cursor={currentIndex !== 0 ? 'pointer' : undefined}
onclick={showPrevious}
disabled={currentIndex === 0}
class:active={currentIndex > 0}></button>
<button
aria-label="Next"
class="icon-cheveron-right"
on:click={showNext}
onclick={showNext}
style:cursor={currentIndex !==
filteredModalAlerts.length - 1
? 'pointer'
: undefined}
disabled={currentIndex === filteredModalAlerts.length - 1}
class:active={currentIndex !==
filteredModalAlerts.length - 1}></button>
@@ -243,7 +261,7 @@
fullWidthMobile
secondary={!hasOnlyPrimaryCta}
class={`${hasOnlyPrimaryCta ? 'only-primary-cta' : ''}`}
on:click={() => triggerWindowLink(currentModalAlert.cta)}>
on:click={() => triggerWindowLink(currentModalAlert)}>
{currentModalAlert.cta.text}
</Button>
@@ -276,7 +294,7 @@
<button
aria-label="Close modal"
class="icon-inline-tag"
on:click={() => handleClose()}>
onclick={() => handleClose()}>
<svg
xmlns="http://www.w3.org/2000/svg"
width="20"
@@ -314,14 +332,21 @@
<button
aria-label="Previous"
class="icon-cheveron-left"
on:click={showPrevious}
style:cursor={currentIndex !== 0
? 'pointer'
: undefined}
onclick={showPrevious}
disabled={currentIndex === 0}
class:active={currentIndex > 0}></button>
<button
aria-label="Next"
class="icon-cheveron-right"
on:click={showNext}
onclick={showNext}
style:cursor={currentIndex !==
filteredModalAlerts.length - 1
? 'pointer'
: undefined}
disabled={currentIndex ===
filteredModalAlerts.length - 1}
class:active={currentIndex !==
@@ -352,7 +377,7 @@
fullWidthMobile
on:click={() => {
openModalOnMobile = false;
triggerWindowLink(currentModalAlert.cta);
triggerWindowLink(currentModalAlert);
}}>
{shouldShowUpgrade
? 'Upgrade plan'
@@ -382,13 +407,13 @@
{:else}
{@const mobileConfig = getMobileWindowConfig()}
<!-- we don't need keydown because we show this only on mobile -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
tabindex="0"
role="button"
class:showing={!openModalOnMobile}
class="card notification-card u-width-full-line"
on:click={() => {
onclick={() => {
if (mobileConfig.cta) {
// navigate manually!
triggerMobileWindowLink();
@@ -401,7 +426,7 @@
<Typography.Text variant="m-500" color="--fgcolor-neutral-primary">
{currentModalAlert.title}
</Typography.Text>
<button on:click={hideAllModalAlerts} aria-label="Close">
<button onclick={hideAllModalAlerts} aria-label="Close">
<span class="icon-x"></span>
</button>
</div>
+293 -231
View File
@@ -1,6 +1,14 @@
<script lang="ts">
import { createMenubar, melt } from '@melt-ui/svelte';
import { Badge, Icon, type SheetMenu, ActionMenu, Card } from '@appwrite.io/pink-svelte';
import {
Badge,
Icon,
type SheetMenu,
Layout,
ActionMenu,
Card,
Skeleton
} from '@appwrite.io/pink-svelte';
import {
IconChevronDown,
IconChevronRight,
@@ -14,21 +22,16 @@
import { base } from '$app/paths';
import { currentPlan, newOrgModal } from '$lib/stores/organization';
import { Click, trackEvent } from '$lib/actions/analytics';
import { page } from '$app/stores';
import { type Models, Query } from '@appwrite.io/console';
import { sdk } from '$lib/stores/sdk';
import { page } from '$app/state';
import { getProjectRoute } from '$lib/helpers/project';
type Project = {
name: string;
$id: string;
isSelected: boolean;
region: string;
};
type Organization = {
name: string;
$id: string;
tierName: string;
isSelected: boolean;
projects: Array<Project>;
};
const {
@@ -63,13 +66,15 @@
}
} = createMenu();
let isLoadingProjects = false;
let loadedProjects: Models.ProjectList = { total: 0, projects: [] };
export let organizations: Organization[] = [];
export let currentProject: Models.Project | null = null;
$: selectedOrg = organizations.find((organization) => organization.isSelected);
$: selectedProject = $page.data.project;
let organisationBottomSheetOpen = false;
let projectsBottomSheetOpen = false;
let organisationBottomSheetOpen = false;
let projectsBottomSheet: Promise<SheetMenu | null> = null;
function createOrg() {
trackEvent(Click.OrganizationClickCreate, { source: 'breadcrumbs' });
@@ -97,85 +102,94 @@
}
};
$: organizationsBottomSheet = !selectedOrg
? switchOrganization
: ({
top: {
items: [
{
name: 'Organization overview',
href: `${base}/organization-${selectedOrg?.$id}`
}
]
},
bottom:
organizations.length > 1
? {
items: [
{
name: 'Switch organization',
trailingIcon: IconChevronRight,
subMenu: switchOrganization
}
]
}
: {
items: [
{
name: 'Create organization',
leadingIcon: IconPlus,
onClick: createOrg
}
]
}
} satisfies SheetMenu);
async function createProjectsBottomSheet(
organization: Organization
): Promise<SheetMenu | null> {
if (!isOnProjects) return null;
$: projectsBottomSheet = {
top:
selectedOrg?.projects.length > 1
? {
title: 'Switch project',
items: !selectedOrg
? []
: selectedOrg?.projects
.map((project, index) => {
if (index < 4) {
return {
name: project.name,
href: getProjectRoute(project, '/overview')
};
} else if (index === 4) {
return {
name: 'All projects',
href: `${base}/organization-${selectedOrg?.$id}`
};
}
return null;
})
.filter((project) => project !== null)
}
: {
isLoadingProjects = true;
// null on non-org/project path like `onboarding`.
loadedProjects =
(await sdk.forConsole.projects.list([
Query.equal('teamId', organizationId ?? page.data.currentOrgId),
Query.limit(5),
Query.orderDesc('$updatedAt')
])) ?? loadedProjects;
for (const project of loadedProjects.projects) {
project.region ??= 'default';
}
isLoadingProjects = false;
const createProjectItem = {
name: 'Create project',
trailingIcon: IconPlus,
href: `${base}/organization-${organization?.$id}?create-project`
};
if (loadedProjects.total > 1 && selectedOrg) {
const projectLinks = loadedProjects.projects.slice(0, 4).map((project) => {
return {
name: project.name,
href: getProjectRoute(project, '/overview/platforms')
};
});
if (loadedProjects.projects.length > 4) {
projectLinks.push({
name: 'All projects',
href: `${base}/organization-${selectedOrg.$id}`
});
}
return {
top: { title: 'Switch project', items: projectLinks },
bottom: { items: [createProjectItem] }
};
}
return {
top: { items: [createProjectItem] },
bottom: { items: [createProjectItem] }
};
}
function createOrganizationBottomSheet(organization: Organization) {
return !organization
? switchOrganization
: ({
top: {
items: [
{
name: 'Create project',
trailingIcon: IconPlus,
href: `${base}/organization-${selectedOrg?.$id}?create-project`
name: 'Organization overview',
href: `${base}/organization-${organization?.$id}`
}
]
},
bottom:
selectedOrg?.projects.length > 1
? {
items: [
{
name: 'Create project',
trailingIcon: IconPlus,
href: `${base}/organization-${selectedOrg?.$id}?create-project`
}
]
}
: undefined
} satisfies SheetMenu;
bottom:
organizations.length > 1
? {
items: [
{
name: 'Switch organization',
trailingIcon: IconChevronRight,
subMenu: switchOrganization
}
]
}
: {
items: [
{
name: 'Create organization',
leadingIcon: IconPlus,
onClick: createOrg
}
]
}
} satisfies SheetMenu);
}
function onResize() {
if ((organisationBottomSheetOpen || projectsBottomSheetOpen) && !$isSmallViewport) {
@@ -184,6 +198,10 @@
}
}
$: selectedOrg = organizations.find((org) => org.isSelected);
$: organizationsBottomSheet = createOrganizationBottomSheet(selectedOrg);
$: correctPlanName =
// the plan names are hardcoded in some cases and are not available locally,
// so we rely on the plan's source of truth - `$currentPlan`
@@ -191,83 +209,121 @@
$currentPlan?.name.toLocaleLowerCase() !== selectedOrg?.tierName.toLocaleLowerCase()
? $currentPlan.name
: selectedOrg?.tierName; // fallback
$: derivedKey = `${selectedOrg?.$id}-${currentProject?.$id}`;
$: organizationId = currentProject?.teamId;
$: isOnProjects = page.route.id.includes('project-[region]-[project]');
$: shouldReloadProjects = isLoadingProjects
? false
: currentProject && loadedProjects.projects.length
? loadedProjects.projects[0].teamId != currentProject.teamId
: !loadedProjects.projects.length;
$: if (shouldReloadProjects) {
projectsBottomSheet = createProjectsBottomSheet(selectedOrg);
}
</script>
<svelte:window on:resize={onResize} />
<div use:melt={$menubar}>
{#if !$isSmallViewport}
<span class="breadcrumb-separator">/</span>
<button
type="button"
class="trigger"
use:melt={$triggerOrganizations}
aria-label="Open organizations tab">
<span class="orgName">{selectedOrg?.name ?? 'Organization'}</span>
<span class="not-mobile"
>{#if correctPlanName}<Badge
variant="secondary"
content={correctPlanName} />{/if}</span>
<Icon icon={IconChevronDown} size="s" color="--fgcolor-neutral-secondary" />
</button>
{:else}
<button
type="button"
class="trigger"
on:click={() => {
organisationBottomSheetOpen = true;
}}
aria-label="Open organizations tab">
<span class="orgName" class:noProjects={!selectedProject}
>{selectedOrg?.name ?? 'Organization'}</span>
<span class="not-mobile"
><Badge variant="secondary" content={correctPlanName ?? ''} /></span>
<Icon icon={IconChevronDown} size="s" color="--fgcolor-neutral-secondary" />
</button>
{/if}
<div class="menu" use:melt={$menuOrganizations}>
<Card.Base padding="xxxs" shadow={true}>
{#if selectedOrg}
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor href={`${base}/organization-${selectedOrg?.$id}`}
>Organization overview</ActionMenu.Item.Anchor
></ActionMenu.Root>
</div>
{#if organizations.length > 1}
<div class="separator" use:melt={$separatorOrganizations}></div>
{#key derivedKey}
<div use:melt={$menubar}>
{#if !$isSmallViewport}
<span class="breadcrumb-separator">/</span>
<button
type="button"
class="trigger"
use:melt={$triggerOrganizations}
aria-label="Open organizations tab">
<span class="orgName">{selectedOrg?.name ?? 'Organization'}</span>
<span class="not-mobile"
>{#if correctPlanName}<Badge
variant="secondary"
content={correctPlanName} />{/if}</span>
<Icon icon={IconChevronDown} size="s" color="--fgcolor-neutral-secondary" />
</button>
{:else}
<button
type="button"
class="trigger"
on:click={() => {
organisationBottomSheetOpen = true;
}}
aria-label="Open organizations tab">
<span class="orgName" class:noProjects={!currentProject}
>{selectedOrg?.name ?? 'Organization'}</span>
<span class="not-mobile"
><Badge variant="secondary" content={correctPlanName ?? ''} /></span>
<Icon icon={IconChevronDown} size="s" color="--fgcolor-neutral-secondary" />
</button>
{/if}
<div use:melt={$subTriggerOrganizations}>
<div class="menu" use:melt={$menuOrganizations}>
<Card.Base padding="xxxs" shadow={true}>
{#if selectedOrg}
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Button trailingIcon={IconChevronRight}
>Switch organization</ActionMenu.Item.Button>
</ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/organization-${selectedOrg?.$id}`}
>Organization overview</ActionMenu.Item.Anchor
></ActionMenu.Root>
</div>
<div class="menu subMenu" use:melt={$subMenuOrganizations}>
<Card.Base padding="xxxs" shadow={true}>
<div use:melt={$radioGroupOrganizations}>
{#each organizations as organization}
{#if organizations.length > 1}
<div class="separator" use:melt={$separatorOrganizations}></div>
<div use:melt={$subTriggerOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Button trailingIcon={IconChevronRight}
>Switch organization</ActionMenu.Item.Button>
</ActionMenu.Root>
</div>
<div class="menu subMenu" use:melt={$subMenuOrganizations}>
<Card.Base padding="xxxs" shadow={true}>
<div use:melt={$radioGroupOrganizations}>
{#each organizations as organization}
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/organization-${organization?.$id}`}
>{organization.name}</ActionMenu.Item.Anchor>
</ActionMenu.Root>
</div>
{/each}
<div class="separator" use:melt={$separatorOrganizations}></div>
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/organization-${organization?.$id}`}
>{organization.name}</ActionMenu.Item.Anchor>
</ActionMenu.Root>
<ActionMenu.Item.Button
leadingIcon={IconPlusSm}
on:click={createOrg}
>Create organization</ActionMenu.Item.Button
></ActionMenu.Root>
</div>
{/each}
<div class="separator" use:melt={$separatorOrganizations}></div>
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Button
leadingIcon={IconPlusSm}
on:click={createOrg}
>Create organization</ActionMenu.Item.Button
></ActionMenu.Root>
</div>
</div>
</Card.Base>
</div>
</Card.Base>
</div>
{:else}
<div class="separator" use:melt={$separatorOrganizations}></div>
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Button
leadingIcon={IconPlusSm}
on:click={createOrg}>Create organization</ActionMenu.Item.Button
></ActionMenu.Root>
</div>
{/if}
{:else}
{#each organizations as organization}
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/organization-${organization?.$id}`}
>{organization.name}</ActionMenu.Item.Anchor
></ActionMenu.Root>
</div>
{/each}
<div class="separator" use:melt={$separatorOrganizations}></div>
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
@@ -276,88 +332,85 @@
></ActionMenu.Root>
</div>
{/if}
{:else}
{#each organizations as organization}
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/organization-${organization?.$id}`}
>{organization.name}</ActionMenu.Item.Anchor
></ActionMenu.Root>
</div>
{/each}
<div class="separator" use:melt={$separatorOrganizations}></div>
<div use:melt={$itemOrganizations}>
<ActionMenu.Root>
<ActionMenu.Item.Button leadingIcon={IconPlusSm} on:click={createOrg}
>Create organization</ActionMenu.Item.Button
></ActionMenu.Root>
</div>
{/if}
</Card.Base>
</div>
{#if selectedOrg && selectedProject}
<span class="breadcrumb-separator">/</span>
{#if !$isSmallViewport}
<button
type="button"
class="trigger"
use:melt={$triggerProjects}
aria-label="Open projects tab">
<span class="projectName">{selectedProject.name}</span>
<Icon icon={IconChevronDown} size="s" />
</button>
{:else}
<button
type="button"
class="trigger"
on:click={() => (projectsBottomSheetOpen = true)}
aria-label="Open projects tab">
<span class="projectName">{selectedProject.name}</span>
<Icon icon={IconChevronDown} size="s" />
</button>
{/if}
<div class="menu" use:melt={$menuProjects}>
<Card.Base padding="xxxs" shadow={true}>
{#if selectedOrg.projects.length > 1}
{#each selectedOrg.projects as project, index}
{#if index < 4}
<div use:melt={$itemProjects}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor href={getProjectRoute(project)}>
{project.name}
</ActionMenu.Item.Anchor>
</ActionMenu.Root>
</div>
{:else if index === 4}
<div use:melt={$itemProjects}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/organization-${selectedOrg.$id}`}>
All projects
</ActionMenu.Item.Anchor>
</ActionMenu.Root>
</div>
{/if}
{/each}
<div class="separator" use:melt={$separatorProjects}></div>
{/if}
<div use:melt={$itemProjects}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
leadingIcon={IconPlusSm}
href={`${base}/organization-${selectedOrg?.$id}?create-project`}>
Create project
</ActionMenu.Item.Anchor></ActionMenu.Root>
</div>
</Card.Base>
</div>
{/if}
</div>
<BottomSheet.Menu bind:isOpen={organisationBottomSheetOpen} menu={organizationsBottomSheet} />
<BottomSheet.Menu bind:isOpen={projectsBottomSheetOpen} menu={projectsBottomSheet} />
{#if selectedOrg && currentProject}
<span class="breadcrumb-separator">/</span>
{#if !$isSmallViewport}
<button
type="button"
class="trigger"
use:melt={$triggerProjects}
aria-label="Open projects tab">
<span class="projectName">{currentProject.name}</span>
<Icon icon={IconChevronDown} size="s" />
</button>
{:else}
<button
type="button"
class="trigger"
on:click={() => (projectsBottomSheetOpen = true)}
aria-label="Open projects tab">
<span class="projectName">{currentProject.name}</span>
<Icon icon={IconChevronDown} size="s" />
</button>
{/if}
<div class="menu" use:melt={$menuProjects}>
<Card.Base padding="xxxs" shadow={true}>
{#if isLoadingProjects}
<div style:margin-inline="0.25rem" style:margin-block="0.25rem">
<Layout.Stack gap="s">
<!-- 2 should be enough -->
<Skeleton width="100%" height={30} variant="line" />
<Skeleton width="100%" height={30} variant="line" />
</Layout.Stack>
</div>
{:else if loadedProjects.total > 1}
{#each loadedProjects.projects as project, index}
{#if index < 4}
<div use:melt={$itemProjects}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor href={getProjectRoute(project)}>
<span class="projectName dropdown">{project.name}</span>
</ActionMenu.Item.Anchor>
</ActionMenu.Root>
</div>
{:else if index === 4}
<div use:melt={$itemProjects}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
href={`${base}/organization-${selectedOrg.$id}`}>
All projects
</ActionMenu.Item.Anchor>
</ActionMenu.Root>
</div>
{/if}
{/each}
<div class="separator" use:melt={$separatorProjects}></div>
{/if}
<div use:melt={$itemProjects}>
<ActionMenu.Root>
<ActionMenu.Item.Anchor
leadingIcon={IconPlusSm}
href={`${base}/organization-${selectedOrg?.$id}?create-project`}>
Create project
</ActionMenu.Item.Anchor></ActionMenu.Root>
</div>
</Card.Base>
</div>
{/if}
</div>
<BottomSheet.Menu bind:isOpen={organisationBottomSheetOpen} menu={organizationsBottomSheet} />
{#await projectsBottomSheet then menu}
{#if menu}
<BottomSheet.Menu bind:isOpen={projectsBottomSheetOpen} {menu} />
{/if}
{/await}
{/key}
<style lang="scss">
.menu {
@@ -402,6 +455,15 @@
@media (min-width: 1024px) {
max-width: 150px;
}
&.dropdown {
max-width: 200px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
vertical-align: middle;
}
}
.noProjects {
+5 -3
View File
@@ -16,9 +16,11 @@
</Typography.Text>
{/if}
</Layout.Stack>
<Layout.Stack {gap}>
<slot name="aside" />
</Layout.Stack>
<div style:overflow="hidden">
<Layout.Stack {gap}>
<slot name="aside" />
</Layout.Stack>
</div>
</Layout.GridFraction>
{#if $$slots.actions && !hideFooter}
<span
+20 -5
View File
@@ -8,7 +8,8 @@
</script>
<script lang="ts">
import { Pill } from '$lib/elements';
import { Badge, Icon } from '@appwrite.io/pink-svelte';
import { IconCode, IconAndroid, IconFlutter, IconApple } from '@appwrite.io/pink-icons-svelte';
import Prism from 'prismjs';
import 'prismjs/components/prism-dart';
import 'prismjs/components/prism-kotlin';
@@ -24,6 +25,21 @@
export let label: string = null;
export let labelIcon: 'code' | 'android' | 'flutter' | 'apple' = null;
function getIcon(iconName: string) {
switch (iconName) {
case 'code':
return IconCode;
case 'android':
return IconAndroid;
case 'flutter':
return IconFlutter;
case 'apple':
return IconApple;
default:
return null;
}
}
export let code: string;
export let language: 'js' | 'html' | 'dart' | 'kotlin' | 'json' | 'sh' | 'yml' | 'swift';
export let withLineNumbers = false;
@@ -49,12 +65,11 @@
<div
class="controls u-position-absolute u-inset-inline-end-8 u-inset-block-start-8 u-flex u-gap-8">
{#if label}
<Pill>
<Badge variant="secondary" content={label}>
{#if labelIcon}
<span class={`icon-${labelIcon}`} aria-hidden="true"></span>
<Icon icon={getIcon(labelIcon)} size="s" slot="start" />
{/if}
{label}
</Pill>
</Badge>
{/if}
{#if withCopy}
<Copy value={code}>
+38 -23
View File
@@ -19,34 +19,45 @@
} = $props();
let maxHeight = $state('none');
let containerRef = $state(null);
let containerRef = $state<HTMLElement>(null);
const collectionId = $derived(page.params.collection);
const calcMaxHeight = () => {
if (containerRef) {
// get parent row element for correct top position
const parent = containerRef.parentElement.parentElement;
const parent = containerRef?.parentElement?.parentElement;
const { top } = parent.getBoundingClientRect();
maxHeight = `${window.innerHeight - top - 48}px`;
}
};
onMount(async () => {
const saveColumnPreferences = () => {
const shownColumns = $columns.filter((n) => n.hide === true).map((n) => n.id);
if (isCustomCollection) {
const prefs = preferences.getCustomCollectionColumns(page.params.collection);
columns.set(
$columns.map((column) => {
column.hide = prefs?.includes(column.id) ?? false;
preferences.setCustomCollectionColumns(collectionId, shownColumns);
} else {
preferences.setColumns(shownColumns);
}
};
onMount(() => {
if (isCustomCollection) {
const shownColumns = preferences.getCustomCollectionColumns(collectionId);
columns.update((n) =>
n.map((column) => {
column.hide = shownColumns?.includes(column.id) ?? false;
return column;
})
);
} else {
const prefs = preferences.get(page.route);
// Override the shown columns only if a preference was set
if (prefs?.columns) {
columns.set(
$columns.map((column) => {
columns.update((n) =>
n.map((column) => {
column.hide = prefs.columns?.includes(column.id) ?? false;
return column;
})
@@ -54,29 +65,33 @@
}
}
columns.subscribe((ctx) => {
const columns = ctx.filter((n) => n.hide === true).map((n) => n.id);
if (isCustomCollection) {
preferences.setCustomCollectionColumns(columns);
} else {
preferences.setColumns(columns);
}
});
calcMaxHeight();
});
let selectedColumnsNumber = $derived(
$columns.reduce((acc, column) => {
if (column.hide === true) return acc;
if (column.hide) return acc;
return ++acc;
}, 0)
);
function toggleColumn(column: Column) {
columns.update((cols) =>
cols.map((col) => {
if (col.id === column.id) {
column.hide = !column.hide;
}
return col;
})
);
saveColumnPreferences();
}
</script>
<svelte:window on:resize={calcMaxHeight} />
{#if $columns?.length}
<Popover let:toggle placement="bottom-end" padding="none">
{@render children(toggle, selectedColumnsNumber)}
@@ -86,7 +101,7 @@
{#each $columns as column}
{#if !column?.exclude}
<ActionMenu.Item.Button
on:click={() => (column.hide = !column.hide)}
on:click={() => toggleColumn(column)}
disabled={allowNoColumns
? false
: selectedColumnsNumber <= 1 && column.hide !== true}>
@@ -94,7 +109,7 @@
<Selector.Checkbox
checked={!column.hide}
size="s"
on:click={() => (column.hide = !column.hide)} />
on:click={() => toggleColumn(column)} />
{column.title}
</Layout.Stack>
</ActionMenu.Item.Button>
+2
View File
@@ -8,6 +8,7 @@
export let action: string = 'Delete';
export let canDelete: boolean = true;
export let disabled: boolean = false;
export let submissionLoader = false;
export let confirmDeletion: boolean = false;
export let onSubmit: (e: SubmitEvent) => Promise<void> | void = function () {
return;
@@ -58,6 +59,7 @@
<Button
danger
submit
{submissionLoader}
disabled={disabled || (confirmDeletion ? !confirm : false)}
>{action}</Button>
{/if}
+6 -2
View File
@@ -43,8 +43,12 @@
style:cursor="pointer"
on:click|preventDefault|stopPropagation={handleClick}
on:keyup={clickOnEnter}
on:mouseenter={() => setTimeout(() => (content = 'Click to copy'))}>
on:mouseenter={() => setTimeout(() => (content = copyText))}>
<slot />
</span>
<p slot="tooltip">{content}</p>
<p slot="tooltip" let:showing>
{#if showing}
{content}
{/if}
</p>
</Tooltip>
+11 -5
View File
@@ -2,15 +2,21 @@
import { isValueOfStringEnum } from '$lib/helpers/types';
import { sdk } from '$lib/stores/sdk';
import { CreditCard } from '@appwrite.io/console';
import { Icon } from '@appwrite.io/pink-svelte';
import { IconCreditCard } from '@appwrite.io/pink-icons-svelte';
export let brand: string;
export let width = 23;
export let height = 16;
function getCreditCardImage(brand: string, width = 46, height = 32) {
if (!isValueOfStringEnum(CreditCard, brand)) return '';
return sdk.forConsole.avatars.getCreditCard(brand, width, height);
}
$: ccImage = isValueOfStringEnum(CreditCard, brand)
? sdk.forConsole.avatars.getCreditCard(brand, width, height)
: '';
</script>
<img style="border-radius: 2.5px" {width} {height} src={getCreditCardImage(brand)} alt={brand} />
{#if ccImage}
<img alt={brand} src={ccImage} {width} {height} style:border-radius="2.5px" />
{:else}
<!-- fallback: unionpay image not in Avatars API -->
<Icon icon={IconCreditCard} color="--fgcolor-neutral-tertiary" />
{/if}
+27 -22
View File
@@ -26,37 +26,42 @@
const importItems: Writable<ImportItemsMap> = writable(new Map());
async function showCompletionNotification(
databaseId: string,
collectionId: string,
importData: Payload
database: string,
collection: string,
payload: Payload
) {
await invalidate(Dependencies.DOCUMENTS);
const url = getProjectRoute(`/databases/database-${databaseId}/collection-${collectionId}`);
const isSuccess = payload.status === 'completed';
const isError = !isSuccess && !!payload.errors;
// extract clean message from nested backend error.
const match = importData.errors.join('').match(/message: '(.*)' Message:/i);
const errorMessage = match?.[1];
if (!isSuccess && !isError) return;
const type = importData.status === 'completed' ? 'success' : 'error';
const message =
importData.status === 'completed'
? 'CSV import finished successfully.'
: `${errorMessage}`;
let errorMessage = 'Import failed. Check your CSV for correct fields and required values.';
if (isError && Array.isArray(payload.errors)) {
try {
// the `errors` is a list of json encoded string.
errorMessage = JSON.parse(payload.errors[0]).message;
} catch {
// do nothing, fallback to default message.
}
}
const type = isSuccess ? 'success' : 'error';
const message = isError ? errorMessage : 'CSV import finished successfully.';
const url = getProjectRoute(`/databases/database-${database}/collection-${collection}`);
addNotification({
type,
message,
isHtml: true,
buttons:
collectionId === page.params.collection || type === 'error'
? undefined
: [
{
name: 'View documents',
method: () => goto(url)
}
]
isSuccess && collection !== page.params.collection
? [{ name: 'View documents', method: () => goto(url) }]
: undefined
});
if (isSuccess) {
await invalidate(Dependencies.DOCUMENTS);
}
}
async function updateOrAddItem(importData: Payload | Models.Migration) {
@@ -148,7 +153,7 @@
migrations.migrations.forEach(updateOrAddItem);
});
return sdk.forConsole.client.subscribe('console', (response) => {
return sdk.forConsoleIn(page.params.region).client.subscribe('console', (response) => {
if (!response.channels.includes(`projects.${getProjectId()}`)) return;
if (response.events.includes('migrations.*')) {
updateOrAddItem(response.payload as Payload);
+1 -1
View File
@@ -26,7 +26,7 @@
{#if verified === true}
<Badge variant="secondary" type="success" size="xs" content="Verified" />
{:else if verified === false}
<Badge variant="secondary" type="error" size="xs" content="Verification failed" />
<Badge variant="secondary" type="warning" size="xs" content="Verification failed" />
{/if}
</Layout.Stack>
<Typography.Text variant="m-400">
@@ -40,7 +40,7 @@
{#if verified === true}
<Badge variant="secondary" type="success" size="xs" content="Verified" />
{:else if verified === false}
<Badge variant="secondary" type="error" size="xs" content="Verification failed" />
<Badge variant="secondary" type="warning" size="xs" content="Verification failed" />
{/if}
</Layout.Stack>
<Typography.Text variant="m-400">
+60 -56
View File
@@ -10,7 +10,7 @@
import { Badge, InteractiveText, Layout, Popover, Typography } from '@appwrite.io/pink-svelte';
import { menuOpen } from '$lib/components/menu/store';
export let time: string = '';
export let time: string | null = null;
export let placement: ComponentProps<Popover>['placement'] = 'bottom';
function timeDifference(dateString: string): string {
@@ -75,64 +75,68 @@
$: timeToString = time ? timeDifference(time) : 'Invalid time';
</script>
<Popover let:show let:hide {placement} portal>
<button
on:mouseenter={() => {
if (!$menuOpen) {
setTimeout(show, 150);
}
}}
on:mouseleave={() => hidePopover(hide)}>
<slot>{capitalize(timeFromNow(time))}</slot>
</button>
{#if time}
<Popover let:show let:hide {placement} portal>
<button
on:mouseenter={() => {
if (!$menuOpen) {
setTimeout(show, 150);
}
}}
on:mouseleave={() => hidePopover(hide)}>
<slot>{capitalize(timeFromNow(time))}</slot>
</button>
<div
let:hide
slot="tooltip"
role="tooltip"
style:padding="1rem"
style:margin="-1rem"
on:mouseenter={() => (isMouseOverTooltip = true)}
on:mouseleave={() => hidePopover(hide, false)}>
<Layout.Stack gap="s" alignContent="flex-start">
<!-- `Raw time` as per design -->
<Typography.Caption color="--fgcolor-neutral-tertiary" variant="400">
{#if $$slots.title}
<slot name="title" />
{:else}
{timeToString}
{/if}
</Typography.Caption>
<div
let:hide
slot="tooltip"
role="tooltip"
style:padding="1rem"
style:margin="-1rem"
on:mouseenter={() => (isMouseOverTooltip = true)}
on:mouseleave={() => hidePopover(hide, false)}>
<Layout.Stack gap="s" alignContent="flex-start">
<!-- `Raw time` as per design -->
<Typography.Caption color="--fgcolor-neutral-tertiary" variant="400">
{#if $$slots.title}
<slot name="title" />
{:else}
{timeToString}
{/if}
</Typography.Caption>
<!-- `Absolute time` as per design -->
<Layout.Stack gap="xxs">
<Layout.Stack
direction="row"
alignItems="center"
alignContent="center"
justifyContent="space-between">
<InteractiveText
isVisible
variant="copy"
text={toLocaleDateTime(time, false, 'UTC')}
value={toISOString(time)} />
<!-- `Absolute time` as per design -->
<Layout.Stack gap="xxs">
<Layout.Stack
direction="row"
alignItems="center"
alignContent="center"
justifyContent="space-between">
<InteractiveText
isVisible
variant="copy"
text={toLocaleDateTime(time, false, 'UTC')}
value={toISOString(time)} />
<Badge variant="secondary" content="UTC" size="xs" />
</Layout.Stack>
<Badge variant="secondary" content="UTC" size="xs" />
</Layout.Stack>
<Layout.Stack
direction="row"
alignItems="center"
alignContent="center"
justifyContent="space-between">
<InteractiveText
isVisible
variant="copy"
text={toLocaleDateTime(time)}
value={toLocalDateTimeISO(time)} />
<Badge variant="secondary" content="Local" size="xs" />
<Layout.Stack
direction="row"
alignItems="center"
alignContent="center"
justifyContent="space-between">
<InteractiveText
isVisible
variant="copy"
text={toLocaleDateTime(time)}
value={toLocalDateTimeISO(time)} />
<Badge variant="secondary" content="Local" size="xs" />
</Layout.Stack>
</Layout.Stack>
</Layout.Stack>
</Layout.Stack>
</div>
</Popover>
</div>
</Popover>
{:else}
<Typography.Text>{time === null || time === undefined ? 'null' : time}</Typography.Text>
{/if}
+2 -4
View File
@@ -1,7 +1,6 @@
<script lang="ts">
import { Button } from '$lib/elements/forms';
import { Modal } from '$lib/components';
import { Pill } from '$lib/elements';
import { createEventDispatcher } from 'svelte';
import { at, empty } from '$lib/helpers/array';
import { singular } from '$lib/helpers/string';
@@ -295,13 +294,12 @@
<Typography.Text variant="m-500">Choose an attribute (optional)</Typography.Text>
<Layout.Stack gap="s" wrap="wrap" direction="row">
{#each available.attributes as attribute}
<Pill
<Tag
disabled={showInput}
selected={selected.attribute === attribute}
button
on:click={() => select('attribute', attribute)}>
{attribute}
</Pill>
</Tag>
{/each}
</Layout.Stack>
</Layout.Stack>
+23 -4
View File
@@ -85,7 +85,8 @@
return options[0]?.value ?? null;
}
let result = 'custom';
let result = null;
for (const option of options) {
if (!isValidDate(option.value)) continue;
@@ -95,6 +96,12 @@
}
}
// no matching date, check if 'custom' is available
if (result === null) {
const hasCustomOption = options.some((option) => option.value === 'custom');
result = hasCustomOption ? 'custom' : (options[0]?.value ?? null);
}
return result;
}
@@ -108,8 +115,18 @@
let expirationSelect = initExpirationSelect();
let expirationCustom: string | null = value ? splitDateValue(value) : null;
let initialized = false;
let hasUserInteracted = false;
$: {
if (!isSameDay(new Date(expirationSelect), new Date(value))) {
// Set initial value if value is null on first load
if (!initialized && value === null && expirationSelect !== null) {
value = expirationSelect === 'custom' ? expirationCustom : expirationSelect;
initialized = true;
}
// Only update value after user interaction
if (hasUserInteracted && !isSameDay(new Date(expirationSelect), new Date(value))) {
value = expirationSelect === 'custom' ? expirationCustom : expirationSelect;
}
}
@@ -126,7 +143,8 @@
{options}
id="preset"
label={selectorLabel}
bind:value={expirationSelect} />
bind:value={expirationSelect}
on:change={() => (hasUserInteracted = true)} />
{#if expirationSelect === 'custom'}
<InputDateTime
@@ -134,5 +152,6 @@
type="date"
id="expire"
label={dateSelectorLabel}
bind:value={expirationCustom} />
bind:value={expirationCustom}
on:change={() => (hasUserInteracted = true)} />
{/if}
+4 -4
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { Alert } from '$lib/components';
import { Alert } from '@appwrite.io/pink-svelte';
import { onMount } from 'svelte';
import Form from '$lib/elements/forms/form.svelte';
import { Click, trackEvent } from '$lib/actions/analytics';
@@ -112,14 +112,14 @@
<div class="modal-content">
<div class="modal-content-spacer u-flex-vertical u-gap-24 u-width-full-line">
{#if error}
<Alert
<Alert.Inline
status="warning"
dismissible
type="warning"
on:dismiss={() => {
error = null;
}}>
{error}
</Alert>
</Alert.Inline>
{/if}
<slot />
</div>
@@ -10,7 +10,12 @@
style="padding-block: 0.13rem">
{#each Array(11) as _, i}
<li>
<Tag size="m" selected={value === i} on:click={() => (value = i)}>
<Tag
size="m"
selected={value === i}
autofocus={i === 0}
data-rating={i}
on:click={() => (value = i)}>
{i}
</Tag>
</li>
@@ -6,6 +6,7 @@
<InputTextarea
required
id="feedback"
autofocus
bind:value={$feedbackData.message}
label="Tell us more about your experience"
placeholder="Share your suggestions and feature requests..." />
+62 -56
View File
@@ -8,79 +8,92 @@
InputSelectCheckbox,
InputDateTime
} from '$lib/elements/forms';
import { createEventDispatcher, onMount } from 'svelte';
import { operators, addFilter, queries, type TagValue } from './store';
import { onMount, createEventDispatcher } from 'svelte';
import { operators, addFilter, queries, tags } from './store';
import type { Column } from '$lib/helpers/types';
import type { Writable } from 'svelte/store';
import { TagList } from '.';
import { Icon, Layout } from '@appwrite.io/pink-svelte';
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
// We cast to any to not cause type errors in the input components
/* eslint @typescript-eslint/no-explicit-any: 'off' */
export let value: any = null;
export let columns: Writable<Column[]>;
export let columnId: string | null = null;
export let arrayValues: string[] = [];
export let operatorKey: string | null = null;
export let singleCondition = false;
let {
value = $bindable(null),
columns,
columnId = $bindable(null),
arrayValues = $bindable([]),
operatorKey = $bindable(null),
singleCondition = false
}: {
// We cast to any to not cause type errors in the input components
/* eslint @typescript-eslint/no-explicit-any: 'off' */
value?: any;
columns: Writable<Column[]>;
columnId?: string | null;
arrayValues?: string[];
operatorKey?: string | null;
singleCondition?: boolean;
} = $props();
$: column = $columns.find((c) => c.id === columnId) as Column;
$: operatorsForColumn = Object.entries(operators)
.filter(([, v]) => v.types.includes(column?.type))
.map(([k]) => ({
label: k,
value: k
let columnsArray = $derived($columns);
let column = $derived(columnsArray.find((c) => c.id === columnId));
let operatorsForColumn = $derived.by(() => {
if (!column?.type) return [];
return Object.entries(operators)
.filter(([, v]) => v.types.includes(column.type))
.map(([k]) => ({ label: k, value: k }));
});
let operator = $derived(operatorKey ? operators[operatorKey] : null);
let isDisabled = $derived(!operator);
let appliedTags = $derived($tags);
let columnOptions = $derived.by(() =>
columnsArray.filter((c) => c.filter !== false).map((c) => ({ label: c.title, value: c.id }))
);
let enumOptions = $derived.by(() => {
if (!column?.elements) return [];
return column.elements.map((e) => ({ label: e?.label ?? e, value: e?.value ?? e }));
});
let enumOptionsWithChecked = $derived.by(() => {
if (!column?.elements) return [];
return column.elements.map((e) => ({
label: e?.label ?? e,
value: e?.value ?? e,
checked: arrayValues.includes(e?.value ?? e)
}));
$: operator = operatorKey ? operators[operatorKey] : null;
$: {
columnId;
operatorKey = null;
}
$: isDisabled = !operator;
let localTags: TagValue[] = [];
});
onMount(() => {
value = column?.array ? [] : null;
if (column?.type === 'datetime') {
const today = new Date();
value = today.toISOString();
const now = new Date();
value = now.toISOString().slice(0, 16);
}
});
const dispatch = createEventDispatcher<{ clear: void; apply: { applied: number } }>();
function addFilterAndReset() {
addFilter($columns, columnId, operatorKey, value, arrayValues);
addFilter(columnsArray, columnId, operatorKey, value, arrayValues);
columnId = null;
operatorKey = null;
value = null;
arrayValues = [];
dispatch('apply', { applied: appliedTags.length });
if (singleCondition) {
queries.apply();
}
}
const dispatch = createEventDispatcher<{
clear: void;
apply: { applied: number };
}>();
dispatch('apply', { applied: localTags.length });
</script>
<div>
<form on:submit|preventDefault={addFilterAndReset}>
<form
onsubmit={(e) => {
e.preventDefault();
addFilterAndReset();
}}>
<Layout.Stack gap="s" direction="row" alignItems="flex-start">
<InputSelect
id="column"
options={$columns
.filter((c) => c.filter !== false)
.map((c) => ({
label: c.title,
value: c.id
}))}
options={columnOptions}
placeholder="Select column"
bind:value={columnId} />
<InputSelect
@@ -97,11 +110,7 @@
name="value"
bind:tags={arrayValues}
placeholder="Select value"
options={column?.elements?.map((e) => ({
label: e?.label ?? e,
value: e?.value ?? e,
checked: arrayValues.includes(e?.value ?? e)
}))}>
options={enumOptionsWithChecked}>
</InputSelectCheckbox>
{:else}
<InputTags
@@ -117,10 +126,7 @@
id="value"
bind:value
placeholder="Select value"
options={column?.elements?.map((e) => ({
label: e?.label ?? e,
value: e?.value ?? e
}))} />
options={enumOptions} />
{:else if column.type === 'integer' || column.type === 'double'}
<InputNumber id="value" bind:value placeholder="Enter value" />
{:else if column.type === 'boolean'}
@@ -131,11 +137,11 @@
options={[
{ label: 'True', value: true },
{ label: 'False', value: false }
].filter(Boolean)}
]}
bind:value />
{:else if column.type === 'datetime'}
{#key value}
<InputDateTime id="value" bind:value step={60} />
<InputDateTime id="value" bind:value step={60} type="datetime-local" />
{/key}
{:else}
<InputText id="value" bind:value placeholder="Enter value" />
@@ -151,10 +157,10 @@
{/if}
</form>
{#if !singleCondition}
{#if !singleCondition && appliedTags.length > 0}
<ul class="u-flex u-flex-wrap u-cross-center u-gap-8 u-margin-block-start-16 tags">
<TagList
tags={localTags}
tags={appliedTags}
on:remove={(e) => {
queries.removeFilter(e.detail);
queries.apply();
@@ -158,7 +158,7 @@
bind:value />
{:else if column.type === 'datetime'}
{#key value}
<InputDateTime id="value" bind:value step={60} />
<InputDateTime id="value" bind:value step={60} type="datetime-local" />
{/key}
{:else}
<InputText id="value" bind:value placeholder="Enter value" />
@@ -3,8 +3,16 @@
import { Link } from '$lib/elements';
import { Button } from '$lib/elements/forms';
import type { Models } from '@appwrite.io/console';
import { IconExternalLink, IconQrcode } from '@appwrite.io/pink-icons-svelte';
import { ActionMenu, Icon, Layout, Popover, Tag, Typography } from '@appwrite.io/pink-svelte';
import { IconExclamation, IconExternalLink, IconQrcode } from '@appwrite.io/pink-icons-svelte';
import {
ActionMenu,
Icon,
Layout,
Popover,
Tag,
Tooltip,
Typography
} from '@appwrite.io/pink-svelte';
import { regionalProtocol } from '$routes/(console)/project-[region]-[project]/store';
let {
@@ -34,9 +42,19 @@
<Link external href={`${$regionalProtocol}${sortedDomains[0]?.domain}`} variant="muted">
<Layout.Stack gap="xxs" direction="row" alignItems="center">
<Trim alternativeTrim>
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
{sortedDomains[0]?.domain}
</Typography.Text>
<Layout.Stack gap="xxs" direction="row" alignItems="flex-end">
<Typography.Text variant="m-400" color="--fgcolor-neutral-primary">
{sortedDomains[0]?.domain}
</Typography.Text>
{#if sortedDomains[0]?.status !== 'verified'}
<Tooltip>
<Icon icon={IconExclamation} size="s" color="--bgcolor-warning" />
<div slot="tooltip">Not verified</div>
</Tooltip>
{/if}
</Layout.Stack>
</Trim>
</Layout.Stack>
</Link>
@@ -16,17 +16,17 @@
let show = false;
async function loadBranches() {
const repo = await sdk
.forProject(page.params.region, page.params.project)
.vcs.getRepository(installationId, repositoryId);
branch = repo.defaultBranch ?? 'main';
const { branches } = await sdk
.forProject(page.params.region, page.params.project)
.vcs.listRepositoryBranches(installationId, repositoryId);
const sorted = sortBranches(branches);
branch = sorted[0]?.name ?? null;
if (!branch) {
branch = 'main';
}
return sorted;
return sortBranches(branches);
}
</script>
@@ -90,5 +90,5 @@
</Fieldset>
{#if show}
<SelectRootModal bind:show bind:rootDir {product} />
<SelectRootModal bind:show bind:rootDir {product} {branch} />
{/if}
+129 -146
View File
@@ -23,7 +23,8 @@
import { page } from '$app/state';
import Card from '../card.svelte';
import SkeletonRepoList from './skeletonRepoList.svelte';
import { onMount, untrack } from 'svelte';
import { onMount, untrack, onDestroy } from 'svelte';
import { debounce } from '$lib/helpers/debounce';
let {
action = $bindable('select'),
@@ -52,6 +53,28 @@
loadInstallations();
});
const debouncedLoadRepositories = debounce(
async (installationId: string, searchTerm: string) => {
isLoadingRepositories = true;
try {
await loadRepositories(installationId, searchTerm);
} finally {
isLoadingRepositories = false;
}
},
300
);
$effect(() => {
if (selectedInstallation && search !== undefined) {
debouncedLoadRepositories(selectedInstallation, search);
}
});
onDestroy(() => {
debouncedLoadRepositories.cancel();
});
async function loadInstallations() {
if (installationList) {
if (installationList.installations.length) {
@@ -71,7 +94,7 @@
.vcs.listInstallations();
if (installations.length) {
if (!selectedInstallation) {
untrack(() => (selectedInstallation = installationList.installations[0].$id));
untrack(() => (selectedInstallation = installations[0].$id));
}
installation.set(installations.find((entry) => entry.$id === selectedInstallation));
}
@@ -80,22 +103,6 @@
}
async function loadRepositories(installationId: string, search: string) {
if (
!$repositories ||
$repositories.installationId !== installationId ||
$repositories.search !== search
) {
await fetchRepos(installationId, search);
}
if ($repositories.repositories.length && action === 'select') {
selectedRepository = $repositories.repositories[0].id;
$repository = $repositories.repositories[0];
}
return $repositories.repositories;
}
async function fetchRepos(installationId: string, search: string) {
if (product === 'functions') {
$repositories.repositories = (
(await sdk
@@ -117,9 +124,9 @@
)) as unknown as Models.ProviderRepositoryFrameworkList
).frameworkProviderRepositories;
}
$repositories.search = search;
$repositories.installationId = installationId;
return $repositories.repositories;
}
selectedRepository;
@@ -168,10 +175,7 @@
installationsMap.find((entry) => entry.$id === selectedInstallation)
);
isLoadingRepositories = true;
loadRepositories(selectedInstallation, search).then(() => {
isLoadingRepositories = false;
});
debouncedLoadRepositories.cancel();
}}
bind:value={selectedInstallation} />
<InputSearch
@@ -185,130 +189,109 @@
<!-- manual installation change -->
{#if isLoadingRepositories}
<SkeletonRepoList />
{:else if $repositories?.repositories?.length}
<Paginator
items={$repositories.repositories}
hideFooter={$repositories.repositories?.length <= 6}
limit={6}>
{#snippet children(
paginatedItems: Models.ProviderRepositoryRuntime[] &
Models.ProviderRepositoryFramework[]
)}
<Table.Root columns={1} let:root>
{#each paginatedItems as repo}
<Table.Row.Base {root}>
<Table.Cell {root}>
<Layout.Stack direction="row" alignItems="center" gap="s">
{#if action === 'select'}
<input
class="is-small u-margin-inline-end-8"
type="radio"
name="repositories"
bind:group={selectedRepository}
onchange={() => repository.set(repo)}
value={repo.id} />
{/if}
{#if product === 'sites'}
{#if repo?.framework && repo.framework !== 'other'}
<Avatar size="xs" alt={repo.name}>
<SvgIcon
name={getFrameworkIcon(repo.framework)}
iconSize="small" />
</Avatar>
{:else}
<Avatar size="xs" alt={repo.name} empty />
{/if}
{:else}
{@const iconName = repo?.runtime
? repo.runtime.split('-')[0]
: undefined}
<Avatar size="xs" alt={repo.name} empty={!iconName}>
{#if iconName}
<SvgIcon name={iconName} iconSize="small" />
{/if}
</Avatar>
{/if}
<Layout.Stack
direction="row"
alignItems="center"
gap="s"
style="flex: 1; min-width: 0;">
<Typography.Text
truncate
color="--fgcolor-neutral-secondary"
style="flex: 1; min-width: 0;">
{repo.name}
</Typography.Text>
{#if repo.private}
<Icon
size="s"
icon={IconLockClosed}
color="--fgcolor-neutral-tertiary" />
{/if}
{#if !$isSmallViewport}
<time datetime={repo.pushedAt}>
<Typography.Caption
variant="400"
truncate
color="--fgcolor-neutral-tertiary">
{timeFromNow(repo.pushedAt)}
</Typography.Caption>
</time>
{/if}
</Layout.Stack>
{#if action === 'button'}
<PinkButton.Button
size="xs"
variant="secondary"
style="flex-shrink: 0;"
on:click={() => connect(repo)}>
Connect
</PinkButton.Button>
{/if}
</Layout.Stack>
</Table.Cell>
</Table.Row.Base>
{/each}
</Table.Root>
{/snippet}
</Paginator>
{:else if search}
<EmptySearch hidePages hidePagination bind:search target="repositories">
<svelte:fragment slot="actions">
{#if search}
<Button secondary on:click={() => (search = '')}>Clear search</Button>
{/if}
</svelte:fragment>
</EmptySearch>
{:else}
{#await loadRepositories(selectedInstallation, search)}
<SkeletonRepoList />
{:then response}
{#if response?.length}
<Paginator items={response} hideFooter={response?.length <= 6} limit={6}>
{#snippet children(
paginatedItems: Models.ProviderRepositoryRuntime[] &
Models.ProviderRepositoryFramework[]
)}
<Table.Root columns={1} let:root>
{#each paginatedItems as repo}
<Table.Row.Base {root}>
<Table.Cell {root}>
<Layout.Stack
direction="row"
alignItems="center"
gap="s">
{#if action === 'select'}
<input
class="is-small u-margin-inline-end-8"
type="radio"
name="repositories"
bind:group={selectedRepository}
onchange={() => repository.set(repo)}
value={repo.id} />
{/if}
{#if product === 'sites'}
{#if repo?.framework && repo.framework !== 'other'}
<Avatar size="xs" alt={repo.name}>
<SvgIcon
name={getFrameworkIcon(
repo.framework
)}
iconSize="small" />
</Avatar>
{:else}
<Avatar
size="xs"
alt={repo.name}
empty />
{/if}
{:else}
{@const iconName = repo?.runtime
? repo.runtime.split('-')[0]
: undefined}
<Avatar
size="xs"
alt={repo.name}
empty={!iconName}>
<SvgIcon
name={iconName}
iconSize="small" />
</Avatar>
{/if}
<Layout.Stack
gap="s"
direction="row"
alignItems="center"
justifyContent="space-between">
<Layout.Stack
direction="row"
gap="s"
alignItems="center">
<Typography.Text
truncate
color="--fgcolor-neutral-secondary">
{repo.name}
</Typography.Text>
{#if repo.private}
<Icon
size="s"
icon={IconLockClosed}
color="--fgcolor-neutral-tertiary" />
{/if}
{#if !$isSmallViewport}
<time datetime={repo.pushedAt}>
<Typography.Caption
variant="400"
truncate
color="--fgcolor-neutral-tertiary">
{timeFromNow(repo.pushedAt)}
</Typography.Caption>
</time>
{/if}
</Layout.Stack>
{#if action === 'button'}
<PinkButton.Button
size="xs"
variant="secondary"
on:click={() => connect(repo)}>
Connect
</PinkButton.Button>
{/if}
</Layout.Stack>
</Layout.Stack>
</Table.Cell>
</Table.Row.Base>
{/each}
</Table.Root>
{/snippet}
</Paginator>
{:else if search}
<EmptySearch hidePages hidePagination bind:search target="repositories">
<svelte:fragment slot="actions">
{#if search}
<Button secondary on:click={() => (search = '')}>
Clear search
</Button>
{/if}
</svelte:fragment>
</EmptySearch>
{:else}
<Card>
<Layout.Stack alignItems="center" justifyContent="center">
<Typography.Text
variation="m-500"
color="--fgcolor-neutral-tertiary">
No repositories available
</Typography.Text>
</Layout.Stack>
</Card>
{/if}
{/await}
<Card>
<Layout.Stack alignItems="center" justifyContent="center">
<Typography.Text variation="m-500" color="--fgcolor-neutral-tertiary">
No repositories available
</Typography.Text>
</Layout.Stack>
</Card>
{/if}
{/if}
</Layout.Stack>
@@ -22,6 +22,7 @@
export let show = false;
export let rootDir: string;
export let product: 'sites' | 'functions' = 'functions';
export let branch: string;
let isLoading = true;
let directories: Directory[] = [
@@ -42,7 +43,7 @@
try {
const content = await sdk
.forProject(page.params.region, page.params.project)
.vcs.getRepositoryContents($installation.$id, $repository.id, currentPath);
.vcs.getRepositoryContents($installation.$id, $repository.id, currentPath, branch);
directories[0].fileCount = content.contents?.length ?? 0;
directories[0].children = content.contents
.filter((e) => e.isDirectory)
@@ -82,7 +83,7 @@
try {
const content = await sdk
.forProject(page.params.region, page.params.project)
.vcs.getRepositoryContents($installation.$id, $repository.id, path);
.vcs.getRepositoryContents($installation.$id, $repository.id, path, branch);
const fileCount = content.contents?.length ?? 0;
const contentDirectories = content.contents.filter((e) => e.isDirectory);
+1 -1
View File
@@ -14,7 +14,7 @@
<slot name="subtitle" />
</div>
</Layout.Stack>
<Layout.Stack direction="row" justifyContent="flex-end" alignItems="center">
<Layout.Stack direction="row" justifyContent="flex-end" alignItems="flex-start">
<slot name="status" />
</Layout.Stack>
</Layout.Stack>
+14 -12
View File
@@ -50,15 +50,17 @@
export let event: string = null;
</script>
<Copy {value} {event}>
<Tag size="xs" variant="code">
<Icon icon={IconDuplicate} size="s" slot="start" />
<span
style:white-space="nowrap"
style:overflow="hidden"
style:word-break="break-all"
use:truncateText>
<slot />
</span>
</Tag>
</Copy>
{#key value}
<Copy {value} {event}>
<Tag size="xs" variant="code">
<Icon icon={IconDuplicate} size="s" slot="start" />
<span
style:white-space="nowrap"
style:overflow="hidden"
style:word-break="break-all"
use:truncateText>
<slot />
</span>
</Tag>
</Copy>
{/key}
+27 -23
View File
@@ -1,8 +1,8 @@
<script lang="ts">
import { Card, Tooltip } from '@appwrite.io/pink-svelte';
import type { HTMLAttributes } from 'svelte/elements';
import type { BaseCardProps } from './card.svelte';
import type { ComponentType } from 'svelte';
import type { BaseCardProps } from './card.svelte';
import type { HTMLAttributes } from 'svelte/elements';
import { Card, Tooltip } from '@appwrite.io/pink-svelte';
type Props = BaseCardProps &
HTMLAttributes<HTMLInputElement> & {
@@ -22,8 +22,10 @@
export let group: string;
export let value: string;
export let tooltipText: string = null;
export let tooltipShow = false;
export let tooltipText: string = null;
export let tooltipWidth: string = undefined;
// Pink v2
export let icon: Props['icon'] = undefined;
@@ -42,25 +44,27 @@
let slotTitle: HTMLSpanElement;
</script>
<Tooltip disabled={!tooltipText || !tooltipShow}>
<Card.Selector
{name}
{src}
{alt}
{icon}
{padding}
{imageRadius}
{variant}
{value}
{radius}
{disabled}
title={title ?? slotTitle?.innerText}
bind:group>
{#if $$slots.default}
<slot />
{/if}
<slot name="action" slot="action" />
</Card.Selector>
<Tooltip maxWidth={tooltipWidth} disabled={!tooltipText || !tooltipShow}>
<div style:cursor={disabled ? 'pointer' : ''}>
<Card.Selector
{name}
{src}
{alt}
{icon}
{padding}
{imageRadius}
{variant}
{value}
{radius}
{disabled}
title={title ?? slotTitle?.innerText}
bind:group>
{#if $$slots.default}
<slot />
{/if}
<slot name="action" slot="action" />
</Card.Selector>
</div>
<span slot="tooltip">{tooltipText}</span>
</Tooltip>
+2 -1
View File
@@ -5,6 +5,7 @@
import { Alert, Layout, Modal } from '@appwrite.io/pink-svelte';
export let show = false;
export let autoClose = true;
export let error: string = null;
export let dismissible = true;
export let size: 's' | 'm' | 'l' = 'm';
@@ -17,7 +18,7 @@
let alert: HTMLElement;
beforeNavigate(() => {
show = false;
if (autoClose) show = false;
});
$: $disableCommands(show);
+31 -32
View File
@@ -1,12 +1,5 @@
<script lang="ts" context="module">
export type NavbarProject = {
name: string;
$id: string;
region: string;
isSelected: boolean;
platformCount: number;
pingCount: number;
};
import type { HTMLAttributes } from 'svelte/elements';
export type BaseNavbarProps = HTMLAttributes<HTMLHeadElement> & {
logo: {
@@ -49,12 +42,13 @@
import { base } from '$app/paths';
import { logout } from '$lib/helpers/logout';
import { app } from '$lib/stores/app';
import { isTabletViewport } from '$lib/stores/viewport';
import { isTabletViewport, isSmallViewport } from '$lib/stores/viewport';
import { isCloud } from '$lib/system.js';
import { user } from '$lib/stores/user';
import { Click, trackEvent } from '$lib/actions/analytics';
import type { HTMLAttributes } from 'svelte/elements';
import { beforeNavigate } from '$app/navigation';
import { page } from '$app/state';
import type { Models } from '@appwrite.io/console';
import { getProjectRoute } from '$lib/helpers/project';
let showSupport = false;
@@ -67,7 +61,6 @@
isSelected: boolean;
showUpgrade: boolean;
tierName: string;
projects: Array<NavbarProject>;
}>;
showAccountMenu: boolean;
};
@@ -104,6 +97,7 @@
export let avatar: $$Props['avatar'];
export let sideBarIsOpen: $$Props['sideBarIsOpen'] = false;
export let showAccountMenu = false;
export let currentProject: Models.Project = undefined;
let activeTheme = $app.theme;
let shouldAnimateThemeToggle = false;
@@ -115,7 +109,7 @@
}
$: currentOrg = organizations.find((org) => org.isSelected);
$: selectedProject = currentOrg?.projects.find((project) => project.isSelected);
beforeNavigate(() => (showAccountMenu = false));
</script>
@@ -135,13 +129,15 @@
class="only-desktop">
<img src={logo.src} alt={logo.alt} />
</a>
<Breadcrumbs {organizations} />
{#if selectedProject && selectedProject.pingCount === 0}
<Breadcrumbs {organizations} {currentProject} />
{#if page.route?.id?.includes('/project-[region]-[project]') && currentProject && currentProject.pingCount === 0}
<div class="only-desktop" style:margin-inline-start="-16px">
<Button.Anchor
size="xs"
variant="secondary"
href={getProjectRoute(selectedProject, '/get-started')}>Connect</Button.Anchor>
href={getProjectRoute(currentProject, '/get-started')}>Connect</Button.Anchor>
</div>
{/if}
</div>
@@ -162,20 +158,22 @@
>Upgrade</Button.Anchor>
{/if}
<DropList show={$feedback.show} class="extended-width">
<Button.Button
type="button"
variant="compact"
on:click={() => {
toggleFeedback();
trackEvent(Click.FeedbackSubmitClick, { source: 'top_nav' });
}}
>Feedback
</Button.Button>
<svelte:fragment slot="other">
<Feedback />
</svelte:fragment>
</DropList>
{#if !$isSmallViewport}
<DropList show={$feedback.show} class="extended-width">
<Button.Button
type="button"
variant="compact"
on:click={() => {
toggleFeedback();
trackEvent(Click.FeedbackSubmitClick, { source: 'top_nav' });
}}
>Feedback
</Button.Button>
<svelte:fragment slot="other">
<Feedback />
</svelte:fragment>
</DropList>
{/if}
<DropList
noArrow
scrollable
@@ -223,7 +221,7 @@
style:user-select="none">
<Avatar size="s" src={avatar} />
</button>
<svelte:fragment slot="tooltip">
<svelte:fragment slot="tooltip" let:toggle>
<ActionMenu.Root noPadding>
<Layout.Stack gap="xxs">
<div
@@ -235,9 +233,10 @@
</Typography.Text>
</div>
<ActionMenu.Item.Anchor
trailingIcon={IconUser}
size="l"
href={`${base}/account`}>
trailingIcon={IconUser}
href={`${base}/account`}
on:click={() => toggle()}>
Account</ActionMenu.Item.Anchor>
<ActionMenu.Item.Button
@@ -12,7 +12,6 @@
export let showTeam: boolean;
export let showLabel: boolean;
export let showCustom: boolean;
export let hideOnClick: boolean = false;
export let groups: Writable<Map<string, Permission>>;
const dispatch = createEventDispatcher();
@@ -25,7 +24,7 @@
<ActionMenu.Item.Button
disabled={$groups.has('any')}
on:click={(e) => {
if (hideOnClick) hide(e);
hide(e);
dispatch('create', ['any']);
}}>
Any
@@ -33,7 +32,7 @@
<ActionMenu.Item.Button
disabled={$groups.has('guests')}
on:click={(e) => {
if (hideOnClick) hide(e);
hide(e);
dispatch('create', ['guests']);
}}>
All guests
@@ -41,7 +40,7 @@
<ActionMenu.Item.Button
disabled={$groups.has('users')}
on:click={(e) => {
if (hideOnClick) hide(e);
hide(e);
dispatch('create', ['users']);
}}>
All users
@@ -49,22 +48,22 @@
<ActionMenu.Item.Button
on:click={(e) => {
showUser = true;
if (hideOnClick) hide(e);
hide(e);
}}>Select users</ActionMenu.Item.Button>
<ActionMenu.Item.Button
on:click={(e) => {
showTeam = true;
if (hideOnClick) hide(e);
hide(e);
}}>Select teams</ActionMenu.Item.Button>
<ActionMenu.Item.Button
on:click={(e) => {
showLabel = true;
if (hideOnClick) hide(e);
hide(e);
}}>Label</ActionMenu.Item.Button>
<ActionMenu.Item.Button
on:click={(e) => {
showCustom = true;
if (hideOnClick) hide(e);
hide(e);
}}>Custom permission</ActionMenu.Item.Button>
</ActionMenu.Root>
</svelte:fragment>
@@ -16,12 +16,12 @@
import { writable } from 'svelte/store';
import Actions from './actions.svelte';
import Row from './row.svelte';
import { Icon, Selector, Table } from '@appwrite.io/pink-svelte';
import { Icon, Layout, Selector, Table, Typography } from '@appwrite.io/pink-svelte';
import { IconPlus, IconX } from '@appwrite.io/pink-icons-svelte';
import type { PinkColumn } from '$lib/helpers/types';
import { Card } from '$lib/components';
export let withCreate = false;
export let hideOnClick = false;
export let permissions: string[] = [];
let showUser = false;
@@ -196,7 +196,6 @@
bind:showTeam
bind:showUser
{groups}
{hideOnClick}
on:create={create}
let:toggle>
<Button secondary on:click={toggle}>
@@ -206,28 +205,23 @@
</Actions>
</div>
{:else}
<article class="card u-grid u-cross-center u-width-full-line dashed">
<div class="u-flex u-cross-center u-flex-vertical u-main-center u-flex">
<div class="common-section">
<Actions
bind:showLabel
bind:showCustom
bind:showTeam
bind:showUser
{groups}
{hideOnClick}
on:create={create}
let:toggle>
<Button compact icon on:click={toggle}>
<Icon icon={IconPlus} size="s" />
</Button>
</Actions>
</div>
<div class="common-section">
<span class="text"> Add a role to get started </span>
</div>
</div>
</article>
<Card variant="secondary">
<Layout.Stack direction="column" alignItems="center" gap="xl">
<Actions
bind:showLabel
bind:showCustom
bind:showTeam
bind:showUser
{groups}
on:create={create}
let:toggle>
<Button secondary icon on:click={toggle}>
<Icon icon={IconPlus} size="s" />
</Button>
</Actions>
<Typography.Text>Add a role to get started</Typography.Text>
</Layout.Stack>
</Card>
{/if}
<style lang="scss">
+8 -5
View File
@@ -34,6 +34,7 @@
offset = 0;
search = '';
selected.clear();
show = false;
}
function create() {
@@ -88,11 +89,13 @@
{@const exists = $groups.has(role)}
<Table.Row.Button {root} on:click={() => onSelection(role)} disabled={exists}>
<Table.Cell column="checkbox" {root}>
<Selector.Checkbox
size="s"
id={team.$id}
disabled={exists}
checked={exists || selected.has(role)} />
<div style:pointer-events="none">
<Selector.Checkbox
size="s"
id={team.$id}
disabled={exists}
checked={exists || selected.has(role)} />
</div>
</Table.Cell>
<Table.Cell column="team" {root}>
<Layout.Stack direction="row" alignItems="center" gap="s">
+8 -5
View File
@@ -37,6 +37,7 @@
offset = 0;
search = '';
selected.clear();
show = false;
}
function create() {
@@ -90,11 +91,13 @@
{@const exists = $groups.has(role)}
<Table.Row.Button {root} on:click={() => onSelection(role)} disabled={exists}>
<Table.Cell column="checkbox" {root}>
<Selector.Checkbox
size="s"
id={user.$id}
disabled={exists}
checked={exists || selected.has(role)} />
<div style:pointer-events="none">
<Selector.Checkbox
size="s"
id={user.$id}
disabled={exists}
checked={exists || selected.has(role)} />
</div>
</Table.Cell>
<Table.Cell column="user" {root}>
<Layout.Stack direction="row" alignItems="center" gap="s">
@@ -29,7 +29,8 @@
style:width={`${(item.size / maxSize) * 100}%`}>
</div>
<div slot="tooltip">
<span class="u-bold">{item.tooltip.title}</span> ${item.tooltip.label}
<span class="u-bold">{item.tooltip.title}</span>
{item.tooltip.label}
</div>
</Tooltip>
{/each}
+28 -27
View File
@@ -1,42 +1,43 @@
<script lang="ts">
import { Copy } from '.';
import { sdk } from '$lib/stores/sdk';
import { Flag } from '@appwrite.io/console';
import { Layout, Tag } from '@appwrite.io/pink-svelte';
import { Flag, type Models } from '@appwrite.io/console';
import { truncateText } from '$lib/components/id.svelte';
import { isValueOfStringEnum } from '$lib/helpers/types';
import { getProjectEndpoint } from '$lib/helpers/project';
import { projectRegion } from '$routes/(console)/project-[region]-[project]/store';
export let region: Models.ConsoleRegion;
$: flagSrc =
$projectRegion && isValueOfStringEnum(Flag, $projectRegion.flag)
? sdk.forConsole.avatars.getFlag($projectRegion.flag, 30, 20, 100)
region && isValueOfStringEnum(Flag, region.flag)
? sdk.forConsole.avatars.getFlag(region.flag, 30, 20, 100)
: '';
</script>
{#if $projectRegion}
{#if region}
<Copy value={getProjectEndpoint()} copyText="Copy endpoint">
<div
class="flex u-gap-8 u-cross-center interactive-text-output is-buttons-on-top u-text-center"
style:min-inline-size="0"
style:display="inline-flex">
<span
style:white-space="nowrap"
class="text u-line-height-1-5"
style:overflow="hidden"
style:word-break="break-all"
use:truncateText
style:font-family="unset">
{$projectRegion?.name}
</span>
<Tag size="xs" variant="default">
<Layout.Stack direction="row" gap="s" alignItems="center" inline>
{#if flagSrc}
<img
width={16}
height={12}
src={flagSrc}
alt={region?.name}
style:border-radius="2.5px" />
{/if}
{#if flagSrc}
<img
style="border-radius: 2.5px"
src={flagSrc}
alt={$projectRegion?.name}
width={16}
height={12} />
{/if}
</div>
<span
style:white-space="nowrap"
class="text u-line-height-1-5"
style:overflow="hidden"
style:word-break="break-all"
use:truncateText
style:font-family="unset">
{region?.name}
</span>
</Layout.Stack>
</Tag>
</Copy>
{/if}
+89 -73
View File
@@ -35,7 +35,7 @@
import MobileSupportModal from '$routes/(console)/wizard/support/mobileSupportModal.svelte';
import MobileFeedbackModal from '$routes/(console)/wizard/feedback/mobileFeedbackModal.svelte';
import { getSidebarState, updateSidebarState } from '$lib/helpers/sidebar';
import { isTabletViewport } from '$lib/stores/viewport';
import { isTabletViewport, isSmallViewport } from '$lib/stores/viewport';
import { Click, trackEvent } from '$lib/actions/analytics';
import type { HTMLAttributes } from 'svelte/elements';
@@ -79,8 +79,18 @@
{ name: 'Functions', icon: IconLightningBolt, slug: 'functions', category: 'build' },
{ name: 'Messaging', icon: IconChatBubble, slug: 'messaging', category: 'build' },
{ name: 'Storage', icon: IconFolder, slug: 'storage', category: 'build' },
{ name: 'Sites', icon: IconGlobeAlt, slug: 'sites', category: 'deploy', badge: 'New' }
{
name: 'Sites',
icon: IconGlobeAlt,
slug: 'sites',
category: 'deploy',
badge: 'Early access'
}
];
const isSelected = (service: string): boolean => {
return page.route.id?.includes(service);
};
</script>
<div
@@ -114,7 +124,7 @@
</Link.Button>
</div>
</div>
<div slot="middle" class:icons={state === 'icons'}>
<div slot="middle" class="middle-container" class:icons={state === 'icons'}>
{#if progressCard}
<Tooltip placement="right" disabled={state !== 'icons'}>
<a
@@ -143,9 +153,9 @@
<Layout.Stack direction="column" gap="s">
<Tooltip placement="right" disabled={state !== 'icons'}>
<a
href={`/console/project-${project.region}-${project.$id}/overview`}
href={`/console/project-${project.region}-${project.$id}/overview/platforms`}
class="link"
class:active={page.url.pathname.includes('overview')}
class:active={isSelected('overview')}
on:click={() => {
trackEvent(Click.MenuOverviewClick);
sideBarIsOpen = false;
@@ -175,7 +185,7 @@
<a
href={`/console/project-${project.region}-${project.$id}/${projectOption.slug}`}
class="link"
class:active={page.url.pathname.includes(projectOption.slug)}
class:active={isSelected(projectOption.slug)}
on:click={() => {
trackEvent(`click_menu_${projectOption.slug}`);
sideBarIsOpen = false;
@@ -206,7 +216,7 @@
<a
href={`/console/project-${project.region}-${project.$id}/${projectOption.slug}`}
class="link"
class:active={page.url.pathname.includes(projectOption.slug)}
class:active={isSelected(projectOption.slug)}
on:click={() => {
trackEvent(`click_menu_${projectOption.slug}`);
sideBarIsOpen = false;
@@ -230,28 +240,29 @@
<span slot="tooltip">{projectOption.name}</span>
</Tooltip>
{/each}
<div class="only-mobile divider">
<Divider />
</div>
<div class="only-mobile">
<Tooltip placement="right" disabled={state !== 'icons'}>
<a
href={`/console/project-${project.region}-${project.$id}/settings`}
on:click={() => {
trackEvent('click_menu_settings');
}}
class="link"
><span class="link-icon"><Icon icon={IconCog} size="s" /></span
><span
class:no-text={state === 'icons'}
class:has-text={state === 'open'}
class="link-text">Settings</span
></a>
<span slot="tooltip">Settings</span>
</Tooltip>
</div>
{#if project}
<div class="mobile-tablet-settings">
<Tooltip placement="right" disabled={state !== 'icons'}>
<a
href={`/console/project-${project.region}-${project.$id}/settings`}
on:click={() => {
trackEvent('click_menu_settings');
sideBarIsOpen = false;
}}
class="link"
class:active={isSelected('/settings') && !isSelected('sites')}
><span class="link-icon"><Icon icon={IconCog} size="s" /></span
><span
class:no-text={state === 'icons'}
class:has-text={state === 'open'}
class="link-text">Settings</span
></a>
<span slot="tooltip">Settings</span>
</Tooltip>
</div>
{/if}
</Layout.Stack>
{:else}
{:else if $isSmallViewport}
<div class="action-buttons">
<Layout.Stack direction="column" gap="s">
<DropList show={$feedback.show} scrollable>
@@ -278,7 +289,6 @@
trackEvent(Click.SupportOpenClick, { source: 'side_nav' });
}}>
<span>Support</span>
<svelte:fragment slot="other">
<MobileSupportModal bind:show={$showSupportModal}
></MobileSupportModal>
@@ -299,8 +309,7 @@
on:click={() => {
trackEvent('click_menu_settings');
}}
class:active={page.url.pathname.includes('/settings') &&
!page.url.pathname.includes('sites')}
class:active={isSelected('/settings') && !isSelected('sites')}
><span class="link-icon"><Icon icon={IconCog} size="s" /></span><span
class:no-text={state === 'icons'}
class:has-text={state === 'open'}
@@ -311,43 +320,33 @@
</div>
{/if}
{#if project}
<div class="only-mobile">
<div class="action-buttons">
<Layout.Stack direction="column" gap="s">
<DropList show={$feedback.show} scrollable>
<Button.Button
variant="secondary"
size="s"
on:click={() => {
toggleFeedback();
trackEvent('click_menu_feedback', { source: 'side_nav' });
}}
><span>Feedback</span>
</Button.Button>
<svelte:fragment slot="other">
<MobileFeedbackModal />
</svelte:fragment>
</DropList>
{#if project && $isSmallViewport}
<div class="action-buttons">
<Layout.Stack direction="column" gap="s">
<DropList show={$feedback.show} scrollable>
<Button.Button
variant="secondary"
size="s"
on:click={() => {
toggleFeedback();
trackEvent('click_menu_feedback', { source: 'side_nav' });
}}
><span>Feedback</span>
</Button.Button>
</DropList>
<DropList show={$showSupportModal} scrollable>
<Button.Button
variant="secondary"
size="s"
on:click={() => {
$showSupportModal = true;
trackEvent(Click.SupportOpenClick, { source: 'side_nav' });
}}>
<span>Support</span>
<svelte:fragment slot="other">
<MobileSupportModal bind:show={$showSupportModal}
></MobileSupportModal>
</svelte:fragment>
</Button.Button>
</DropList>
</Layout.Stack>
</div>
<DropList show={$showSupportModal} scrollable>
<Button.Button
variant="secondary"
size="s"
on:click={() => {
$showSupportModal = true;
trackEvent(Click.SupportOpenClick, { source: 'side_nav' });
}}>
<span>Support</span>
</Button.Button>
</DropList>
</Layout.Stack>
</div>
{/if}
</div>
@@ -361,6 +360,29 @@
{/if}
<style lang="scss">
.middle-container {
flex: 1;
overflow-y: visible;
max-height: none;
}
.mobile-tablet-settings {
display: block;
margin-top: var(--space-6, 12px);
&::before {
content: '';
display: block;
height: 1px;
background: var(--border-neutral, #ededf0);
margin-bottom: var(--space-6, 12px);
}
@media (min-width: 1024px) {
display: none;
}
}
.link {
display: flex;
height: 32px;
@@ -580,12 +602,6 @@
width: 100%;
}
.bottom {
@media (min-width: 1024px) {
height: var(--base-32, 32px);
}
}
:global(button.collapse) {
transform: translateX(-10px);
}
+3 -1
View File
@@ -6,10 +6,12 @@ export const NEW_DEV_PRO_UPGRADE_COUPON = 'appw50';
export const REGION_FRA = 'fra';
export const REGION_SYD = 'syd';
export const REGION_NYC = 'nyc';
export const REGION_SFO = 'sfo';
export const SUBDOMAIN_FRA = 'fra.';
export const SUBDOMAIN_SYD = 'syd.';
export const SUBDOMAIN_NYC = 'nyc.';
export const SUBDOMAIN_SFO = 'sfo.';
export enum Dependencies {
FACTORS = 'dependency:factors',
@@ -18,7 +20,7 @@ export enum Dependencies {
INVOICES = 'dependency:invoices',
ADDRESS = 'dependency:address',
UPGRADE_PLAN = 'dependency:upgrade_plan',
CREATE_ORGANIZATION = 'dependency:create_organization',
ORGANIZATIONS = 'dependency:organizations',
PAYMENT_METHODS = 'dependency:paymentMethods',
ORGANIZATION = 'dependency:organization',
MEMBERS = 'dependency:members',
+2 -5
View File
@@ -3,7 +3,7 @@
import { getContext, hasContext } from 'svelte';
import { readable } from 'svelte/store';
import type { FormContext } from './form.svelte';
import { Button } from '@appwrite.io/pink-svelte';
import { Button, Spinner } from '@appwrite.io/pink-svelte';
import type { ComponentProps } from 'svelte';
type Props = ComponentProps<Button.Button | Button.Anchor>;
@@ -115,10 +115,7 @@
type={submit ? 'submit' : 'button'}>
<slot name="start" slot="start" />
{#if ($isSubmitting && submissionLoader) || (forceShowLoader && submissionLoader)}
<span
class="loader is-small"
style:--p-loader-base-full-color="transparent"
aria-hidden="true"></span>
<Spinner size="s" />
{/if}
<slot isSubmitting={$isSubmitting} />
<slot slot="end" name="end" />
+16 -2
View File
@@ -18,6 +18,19 @@
let error: string;
function coerceToNumber(event: Event & { currentTarget: EventTarget & HTMLInputElement }) {
const raw = event.currentTarget?.value ?? '';
if (raw === '') {
value = nullable ? null : (undefined as unknown as number);
return;
}
const parsed = Number(raw);
if (Number.isFinite(parsed)) {
value = parsed;
}
}
const handleInvalid = (event: Event & { currentTarget: EventTarget & HTMLInputElement }) => {
event.preventDefault();
@@ -39,7 +52,7 @@
error = event.currentTarget.validationMessage;
};
$: if (value) {
$: if (value !== null && value !== undefined && !Number.isNaN(value)) {
error = null;
}
</script>
@@ -61,7 +74,8 @@
helper={error || helper}
state={error ? 'error' : 'default'}
on:invalid={handleInvalid}
on:input>
on:input={coerceToNumber}
on:change={coerceToNumber}>
<svelte:fragment slot="info">
<slot name="info" slot="info" />
</svelte:fragment>
@@ -16,6 +16,7 @@
disabled?: boolean;
leadingIcon?: ComponentType;
leadingHtml?: string;
badge?: string;
}[];
let element: HTMLSelectElement;
-1
View File
@@ -1,4 +1,3 @@
export { default as Pill } from './pill.svelte';
export { default as SelectSearchItem } from './selectSearchItem.svelte';
export { default as Flag } from './flag.svelte';
export { default as SelectSearchCheckbox } from './selectSearchCheckbox.svelte';
-83
View File
@@ -1,83 +0,0 @@
<script lang="ts">
import { trackEvent } from '$lib/actions/analytics';
export let disabled = false;
export let selected = false;
export let success = false;
export let warning = false;
export let danger = false;
export let info = false;
export let button = false;
export let submit = false;
export let external = false;
export let href: string = null;
export let event: string = null;
export let eventData: Record<string, unknown> = {};
export let style = '';
let classes = '';
export { classes as class };
function track() {
if (!event) {
return;
}
trackEvent(`click_${event}`, {
from: 'tag',
...eventData
});
}
</script>
{#if href}
<a
{style}
{href}
target={external ? '_blank' : '_self'}
rel={external ? 'noopener noreferrer' : ''}
class="tag {classes}"
class:is-disabled={disabled}
class:is-selected={selected}
class:is-success={success}
class:is-warning={warning}
class:is-danger={danger}
class:is-info={info}>
<slot />
</a>
{:else if button}
<button
on:click
on:click={track}
{style}
{disabled}
type={submit ? 'submit' : 'button'}
class="tag {classes}"
class:is-disabled={disabled}
class:is-selected={selected}
class:is-success={success}
class:is-warning={warning}
class:is-danger={danger}
class:is-info={info}>
<slot />
</button>
{:else}
<div
class="tag {classes}"
{style}
class:is-disabled={disabled}
class:is-selected={selected}
class:is-success={success}
class:is-warning={warning}
class:is-danger={danger}
class:is-info={info}>
<slot />
</div>
{/if}
<style>
/* button and anchor tags seem to have special dimens, this should be auto fixed in pink2. */
:global(.tag):where(button, a) {
--p-tag-height: 2.125rem;
--p-tag-content-height: 2.024rem;
}
</style>
-2
View File
@@ -20,7 +20,5 @@ function isFlagEnabled(name: string) {
export const flags = {
showSites: isFlagEnabled('sites'),
showCsvImport: isFlagEnabled('csv-import'),
showAttributeEncrypt: isFlagEnabled('attribute-encrypt'),
showIndexLengths: isFlagEnabled('index-lengths')
};
+5 -8
View File
@@ -1,11 +1,8 @@
import { get } from 'svelte/store';
import { user } from '$lib/stores/user';
import { sdk } from '$lib/stores/sdk';
import type { Account } from '$lib/stores/user';
const userPreferences = () => get(user)?.prefs;
export function hasOnboardingDismissed(projectId: string) {
const currentPrefs = userPreferences();
export function hasOnboardingDismissed(projectId: string, account?: Account) {
const currentPrefs = account?.prefs;
const onboardingDismissed = currentPrefs?.onboardingDismissed;
return (
onboardingDismissed &&
@@ -14,8 +11,8 @@ export function hasOnboardingDismissed(projectId: string) {
);
}
export async function setHasOnboardingDismissed(projectId: string) {
const currentPrefs = userPreferences();
export async function setHasOnboardingDismissed(projectId: string, account?: Account) {
const currentPrefs = account?.prefs;
const onboardingDismissed = Array.isArray(currentPrefs?.onboardingDismissed)
? currentPrefs.onboardingDismissed
: [];
+12 -3
View File
@@ -6,6 +6,7 @@ type RegionOption = {
value: string;
disabled: boolean;
leadingHtml: string;
badge?: string;
};
export function filterRegions(regions: Models.ConsoleRegion[]): RegionOption[] {
@@ -14,14 +15,22 @@ export function filterRegions(regions: Models.ConsoleRegion[]): RegionOption[] {
return regions
.filter((region) => region.$id !== 'default')
.sort((a, b) => {
if (a.disabled && !b.disabled) return 1;
if (!a.disabled && b.disabled) return -1;
// Check if regions are truly available (not disabled and available)
const aAvailable = !a.disabled && a.available;
const bAvailable = !b.disabled && b.available;
// Prioritize truly available regions
if (aAvailable && !bAvailable) return -1;
if (!aAvailable && bAvailable) return 1;
// Within the same availability group, sort alphabetically
return a.name.localeCompare(b.name);
})
.map((region) => ({
label: region.name,
value: region.$id,
disabled: region.disabled || !region.available,
leadingHtml: `<img src='${getFlagUrl(region.flag)}' alt='Region flag'/>`
leadingHtml: `<img src='${getFlagUrl(region.flag)}' alt='Region flag'/>`,
badge: region.disabled || !region.available ? 'Coming soon' : undefined
}));
}
+26
View File
@@ -0,0 +1,26 @@
import type { Models } from '@appwrite.io/console';
/**
* Build VCS repo URL from the template response model.
* Example (GitHub): https://github.com/appwrite/templates-for-sites
*/
export function getTemplateSourceUrl(
t: Models.TemplateSite | Models.TemplateFunction
): string | null {
const owner = t.providerOwner;
const repo = t.providerRepositoryId;
const provider = t.vcsProvider; // e.g., "github"
if (!owner || !repo || !provider) return null;
// Map provider → host (extend if needed)
const hostMap: Record<string, string> = {
github: 'github.com',
gitlab: 'gitlab.com',
bitbucket: 'bitbucket.org'
};
const host = hostMap[provider.toLowerCase()] ?? provider; // fallback
return `https://${host}/${owner}/${repo}`;
}
+2 -1
View File
@@ -60,7 +60,8 @@ export type TableRootProp = {
selectedAll: boolean;
selectedNone: boolean;
selectedSome: boolean;
columns: Record<PinkColumn['id'], PinkColumn>;
columns: Array<PinkColumn> | number;
columnsMap: Record<PinkColumn['id'], PinkColumn>;
toggle: (id: string) => void;
toggleAll: () => void;
addAvailableId: (id: string) => void;
+28
View File
@@ -0,0 +1,28 @@
import { sdk } from '$lib/stores/sdk';
import { type Account } from '$lib/stores/user';
export const joinWaitlistSites = (user: Account) => {
const prefs = user.prefs;
const newPrefs = {
...prefs,
joinWaitlistSites: true
};
sdk.forConsole.account.updatePrefs(newPrefs);
if (sessionStorage) {
sessionStorage.setItem('joinWaitlistSites', 'true');
}
};
export const isOnWaitlistSites = (user: Account): boolean => {
const prefs = user.prefs;
const joinedInPrefs = 'joinWaitlistSites' in prefs;
let joinedInSession = false;
if (sessionStorage) {
joinedInSession = sessionStorage.getItem('joinWaitlistSites') === 'true';
}
return joinedInSession || joinedInPrefs;
};
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

+22 -13
View File
@@ -1,7 +1,10 @@
<script lang="ts">
import { Alert, DropList } from '$lib/components';
import { DropList } from '$lib/components';
import { BillingPlan } from '$lib/constants';
import { Link, Pill } from '$lib/elements';
import { Link } from '$lib/elements';
import { Badge, Icon } from '@appwrite.io/pink-svelte';
import { IconInfo } from '@appwrite.io/pink-icons-svelte';
import { Alert } from '@appwrite.io/pink-svelte';
import {
checkForProjectLimitation,
checkForUsageFees,
@@ -22,7 +25,7 @@
export let title: string;
export let serviceId = title.toLocaleLowerCase() as PlanServices;
export let total: number = null;
export let alertType: 'info' | 'success' | 'warning' | 'error' | 'default' = 'warning';
export let alertType: 'info' | 'success' | 'warning' | 'error' = 'warning';
export let showAlert = true;
export let buttonText: string = null;
@@ -95,16 +98,16 @@
{#if services.length}
<slot name="alert" {limit} {tier} {title} {upgradeMethod} {hasUsageFees} {services}>
{#if $organization?.billingPlan !== BillingPlan.FREE && hasUsageFees}
<Alert type="info" isStandalone>
<Alert.Inline status="info">
<span class="text">
You've reached the {services} limit for the {tier} plan.
<Link on:mousedown={() => ($showUsageRatesModal = true)}
>Excess usage fees will apply</Link
>.
</span>
</Alert>
</Alert.Inline>
{:else}
<Alert type={alertType} isStandalone>
<Alert.Inline status={alertType}>
<span class="text">
You've reached the {services} limit for the {tier} plan. <Link
href={$upgradeURL}
@@ -112,7 +115,7 @@
eventData={{ from: 'event', source: 'inline_alert' }}>Upgrade</Link> your
organization for additional resources.
</span>
</Alert>
</Alert.Inline>
{/if}
</slot>
{/if}
@@ -124,13 +127,19 @@
{#if isCloud && isLimited}
<DropList bind:show={showDropdown} width="16">
{#if hasProjectLimitation}
<Pill button on:click={() => (showDropdown = !showDropdown)}>
<span class="icon-info"></span>{total}/{limit} created
</Pill>
<Badge
variant="secondary"
content={`${total}/${limit} created`}
on:click={() => (showDropdown = !showDropdown)}>
<Icon icon={IconInfo} size="s" slot="start" />
</Badge>
{:else if $organization?.billingPlan !== BillingPlan.SCALE}
<Pill button on:click={() => (showDropdown = !showDropdown)}>
<span class="icon-info"></span>Limits applied
</Pill>
<Badge
variant="secondary"
content="Limits applied"
on:click={() => (showDropdown = !showDropdown)}>
<Icon icon={IconInfo} size="s" slot="start" />
</Badge>
{/if}
<svelte:fragment slot="list">
<slot name="tooltip" {limit} {tier} {title} {upgradeMethod} {hasUsageFees}>
+77 -41
View File
@@ -1,19 +1,39 @@
<script lang="ts">
import { Layout, Typography, Input, Tag, Icon } from '@appwrite.io/pink-svelte';
import { Layout, Typography, Input, Tag, Icon, Alert } from '@appwrite.io/pink-svelte';
import { IconPencil } from '@appwrite.io/pink-icons-svelte';
import { CustomId } from '$lib/components/index.js';
import { getFlagUrl } from '$lib/helpers/flag';
import { isCloud } from '$lib/system.js';
import { currentPlan } from '$lib/stores/organization';
import { Button } from '$lib/elements/forms';
import { base } from '$app/paths';
import { page } from '$app/state';
import type { Models } from '@appwrite.io/console';
import { filterRegions } from '$lib/helpers/regions';
import type { Snippet } from 'svelte';
export let projectName: string;
export let id: string;
export let regions: Array<Models.ConsoleRegion> = [];
export let region: string;
export let showTitle = true;
let {
projectName = $bindable(''),
id = $bindable(''),
regions = [],
region = $bindable(''),
showTitle = true,
projects = undefined,
submit
}: {
projectName: string;
id: string;
regions: Array<Models.ConsoleRegion>;
region: string;
showTitle: boolean;
projects?: number;
submit?: Snippet;
} = $props();
let showCustomId = false;
let showCustomId = $state(false);
let projectsLimited = $derived(
$currentPlan?.projects > 0 && projects && projects >= $currentPlan?.projects
);
</script>
<svelte:head>
@@ -22,43 +42,59 @@
{/each}
</svelte:head>
<form on:submit|preventDefault>
<Layout.Stack direction="column" gap="xxl">
{#if showTitle}
<Typography.Title size="l">Create your project</Typography.Title>
{/if}
{#if projectsLimited}
<Alert.Inline
status="warning"
title={`You've reached your limit of ${$currentPlan?.projects || 2} projects`}>
Extra projects are available on paid plans for an additional fee
<svelte:fragment slot="actions">
<Button
compact
size="s"
href={`${base}/organization-${page.params.organization}/billing`}
external
text>Upgrade</Button>
</svelte:fragment>
</Alert.Inline>
{/if}
<Layout.Stack direction="column" gap="xxl">
{#if showTitle}
<Typography.Title size="l">Create your project</Typography.Title>
{/if}
<Layout.Stack direction="column" gap="xxl">
<Layout.Stack direction="column" gap="xxl">
<Layout.Stack direction="column" gap="s">
<Input.Text
label="Name"
placeholder="Project name"
required
bind:value={projectName} />
{#if !showCustomId}
<div>
<Tag
size="s"
on:click={() => {
showCustomId = true;
}}><Icon slot="start" icon={IconPencil} size="s" /> Project ID</Tag>
</div>
{/if}
<CustomId bind:show={showCustomId} name="Project" isProject bind:id />
</Layout.Stack>
{#if isCloud && regions.length > 0}
<Layout.Stack gap="xs">
<Input.Select
required
bind:value={region}
placeholder="Select a region"
options={filterRegions(regions)}
label="Region" />
<Typography.Text>Region cannot be changed after creation</Typography.Text>
</Layout.Stack>
<Layout.Stack direction="column" gap="s">
<Input.Text
disabled={projectsLimited}
label="Name"
placeholder="Project name"
required
autofocus
bind:value={projectName} />
{#if !showCustomId}
<div>
<Tag
size="s"
on:click={() => {
showCustomId = true;
}}><Icon icon={IconPencil} slot="start" size="s" /> Project ID</Tag>
</div>
{/if}
<CustomId bind:show={showCustomId} name="Project" isProject bind:id />
</Layout.Stack>
{#if isCloud && regions.length > 0}
<Layout.Stack gap="xs">
<Input.Select
disabled={projectsLimited}
required
bind:value={region}
placeholder="Select a region"
options={filterRegions(regions)}
label="Region" />
<Typography.Text>Region cannot be changed after creation</Typography.Text>
</Layout.Stack>
{/if}
</Layout.Stack>
<slot name="submit"></slot>
</Layout.Stack>
</form>
{@render submit?.()}
</Layout.Stack>
+54 -47
View File
@@ -11,7 +11,7 @@
Button,
Badge
} from '@appwrite.io/pink-svelte';
import { isSmallViewport, isTabletViewport } from '$lib/stores/viewport';
import { isSmallViewport } from '$lib/stores/viewport';
const currentYear = new Date().getFullYear();
</script>
@@ -23,7 +23,6 @@
direction="row"
alignItems="center"
gap={$isSmallViewport ? 'm' : 'l'}
inline={$isTabletViewport}
justifyContent="flex-start">
<Typography.Caption variant="400">
ⓒ {currentYear} Appwrite. All rights reserved.
@@ -54,52 +53,37 @@
</Button.Anchor>
</Layout.Stack>
</Layout.Stack>
{#if isCloud && $isSmallViewport}
<div class="extra-margin">
<Layout.Stack direction="row" justifyContent={'flex-start'} alignItems="center">
{#if $version}
{#if isCloud}
<Icon size="s" icon={IconCloud} />
{/if}
<Link.Anchor
size="s"
variant="quiet"
href="https://github.com/appwrite/appwrite/releases"
aria-label="Appwrite releases on Github"
target="_blank"
rel="noreferrer">
Version {$version}
</Link.Anchor>
<span class="divider-wrapper">
<Divider vertical />
</span>
{/if}
<Badge size="xs" variant="secondary" content="BETA" />
</Layout.Stack>
</div>
{/if}
<Layout.Stack
direction="row"
justifyContent={$isSmallViewport ? 'flex-start' : 'flex-end'}
alignItems="center">
{#if isCloud}
{#if !$isSmallViewport}<Badge size="xs" variant="secondary" content="BETA" /><Icon
alignItems="center"
wrap={$isSmallViewport ? 'wrap' : 'normal'}>
{#if !$isSmallViewport}
{#if isCloud}
<Badge
size="xs"
type="success"
variant="secondary"
content="Generally Available"
style="white-space: nowrap;" />
<Icon size="s" icon={IconCloud} />
{/if}
{#if $version}
<Link.Anchor
size="s"
icon={IconCloud} />
{#if $version}
<Link.Anchor
size="s"
variant="quiet"
href="https://github.com/appwrite/appwrite/releases"
aria-label="Appwrite releases on Github"
target="_blank"
rel="noreferrer">
Version {$version}
</Link.Anchor>
<span class="divider-wrapper">
<Divider vertical />
</span>
{/if}
variant="quiet"
href="https://github.com/appwrite/appwrite/releases"
aria-label="Appwrite releases on Github"
target="_blank"
rel="noreferrer"
style="white-space: nowrap;">
Version {$version}
</Link.Anchor>
<span class="divider-wrapper">
<Divider vertical />
</span>
{/if}
{/if}
@@ -146,6 +130,32 @@
Cookies
</Link.Anchor>
{/if}
{#if $isSmallViewport}
{#if $version}
<span class="divider-wrapper">
<Divider vertical />
</span>
<Link.Anchor
size="s"
variant="quiet"
href="https://github.com/appwrite/appwrite/releases"
aria-label="Appwrite releases on Github"
target="_blank"
rel="noreferrer"
style="white-space: nowrap;">
Version {$version}
</Link.Anchor>
{#if isCloud}
<Icon size="s" icon={IconCloud} />
<Badge
size="xs"
type="success"
variant="secondary"
content="Generally Available"
style="white-space: nowrap;" />
{/if}
{/if}
{/if}
</Layout.Stack>
</Layout.Stack>
</footer>
@@ -169,7 +179,4 @@
margin-inline-end: 2rem;
}
}
.extra-margin {
margin-block-start: var(--space-2, 4px);
}
</style>
+17 -9
View File
@@ -1,7 +1,6 @@
<script lang="ts">
import { beforeNavigate } from '$app/navigation';
import { Navbar, Sidebar } from '$lib/components';
import type { NavbarProject } from '$lib/components/navbar.svelte';
import { isNewWizardStatusOpen, wizard } from '$lib/stores/wizard';
import { activeHeaderAlert } from '$routes/(console)/store';
import { setContext } from 'svelte';
@@ -19,11 +18,10 @@
import { page } from '$app/stores';
import type { Models } from '@appwrite.io/console';
export let showSideNavigation = false;
export let showHeader = true;
export let showFooter = true;
export let loadedProjects: Array<NavbarProject> = [];
export let selectedProject: Models.Project | null = null;
export let showSideNavigation = false;
export let selectedProject: Models.Project = null;
let yOnMenuOpen: number;
let showContentTransition = false;
@@ -101,10 +99,11 @@
$id: org.$id,
showUpgrade: billingPlan === BillingPlan.FREE,
tierName: isCloud ? tierToPlan(billingPlan).name : null,
isSelected: $organization?.$id === org.$id,
projects: loadedProjects
isSelected: $organization?.$id === org.$id
};
})
}),
currentProject: selectedProject
};
let showAccountMenu = false;
@@ -121,10 +120,19 @@
}
const progressCard = function getProgressCard() {
if (selectedProject && !hasOnboardingDismissed(selectedProject.$id)) {
if (selectedProject && !hasOnboardingDismissed(selectedProject.$id, $user)) {
const { platforms, pingCount } = selectedProject;
let percentage = 33;
if (platforms.length > 0 && pingCount === 0) {
percentage = 66;
} else if (pingCount > 0) {
percentage = 100;
}
return {
title: 'Get started',
percentage: selectedProject && selectedProject.platforms.length ? 100 : 33
percentage
};
}
+27 -5
View File
@@ -10,6 +10,7 @@
import type { Campaign } from '$lib/stores/campaigns';
import { Typography, Layout, Avatar } from '@appwrite.io/pink-svelte';
import { getCampaignImageUrl } from '$routes/(public)/card/helpers';
import { isSmallViewport } from '$lib/stores/viewport';
export const imgLight = LoginLight;
export const imgDark = LoginDark;
@@ -44,7 +45,7 @@
<main class="grid-1-1 is-full-page" id="main">
<section
class={`u-flex u-flex-vertical ${variation !== 'default' ? 'u-cross-center u-main-center u-height-100-percent u-width-full-line side-bg' : 'side-default'}`}
class={`u-flex u-flex-vertical ${variation !== 'default' ? 'u-cross-center u-main-center u-height-100-percent u-width-full-line side-bg' : !$isSmallViewport ? 'side-default' : ''}`}
style:--url={variation !== 'default'
? ''
: `url(${$app.themeInUse === 'dark' ? imgDark : imgLight})`}>
@@ -159,7 +160,6 @@
<div class="u-margin-block-start-24">
<slot />
</div>
<ul
class="inline-links is-center is-with-sep u-margin-block-start-32"
class:u-hide={!$$slots?.links}>
@@ -167,18 +167,18 @@
</ul>
</div>
<div
class="logo u-flex u-gap-16 u-margin-inline-auto is-only-mobile u-margin-block-start-32">
class="logo u-flex u-gap-16 u-margin-inline-auto is-only-mobile u-margin-block-start-32 mobile-logo">
<a href={base}>
{#if $app.themeInUse === 'dark'}
<img
src={AppwriteLogoDark}
width="93"
width="120"
class="u-block u-only-dark"
alt="Appwrite Logo" />
{:else}
<img
src={AppwriteLogoLight}
width="93"
width="120"
class="u-block u-only-light"
alt="Appwrite Logo" />
{/if}
@@ -359,4 +359,26 @@
padding-block-start: 5rem;
}
}
// mobile logo positioned at bottom in mobile view
.mobile-logo {
position: absolute;
bottom: 20px;
left: 50%;
transform: translate(-50%, -50%);
max-width: 100%;
margin-block-start: 0 !important;
}
@media #{devices.$break1} {
.auth-container {
margin-block-end: 5rem;
margin-block-start: 2rem;
}
.container {
min-height: 100%;
position: relative;
}
}
</style>
+4 -2
View File
@@ -50,7 +50,7 @@
if (confirmExit) {
showExitModal = true;
} else {
goto(href);
goBack();
trackEvent('wizard_exit', {
from: 'escape'
});
@@ -58,6 +58,8 @@
}
}
const goBack = () => goto(href);
onMount(() => ($isNewWizardStatusOpen = true));
onDestroy(() => ($isNewWizardStatusOpen = false));
@@ -77,7 +79,7 @@
if (confirmExit) {
showExitModal = true;
} else {
goto(href);
goBack();
trackEvent('wizard_exit', {
from: 'button'
});
+44 -1
View File
@@ -151,6 +151,10 @@ export type CreditList = {
total: number;
};
export type AvailableCredit = {
available: number;
};
export type Aggregation = {
$id: string;
/**
@@ -309,6 +313,7 @@ export type Plan = {
webhooks: number;
users: number;
teams: number;
projects: number;
databases: number;
databasesAllowEncrypt: boolean;
buckets: number;
@@ -588,6 +593,25 @@ export class Billing {
);
}
async updateSelectedProjects(
organizationId: string,
projects: string[]
): Promise<Organization> {
const path = `/organizations/${organizationId}/projects`;
const params = {
projects
};
const uri = new URL(this.client.config.endpoint + path);
return await this.client.call(
'patch',
uri,
{
'content-type': 'application/json'
},
params
);
}
async setOrganizationPaymentMethod(
organizationId: string,
paymentMethodId: string
@@ -859,6 +883,20 @@ export class Billing {
);
}
async getAvailableCredit(organizationId: string): Promise<AvailableCredit> {
const path = `/organizations/${organizationId}/credits/available`;
const params = {};
const uri = new URL(this.client.config.endpoint + path);
return await this.client.call(
'GET',
uri,
{
'content-type': 'application/json'
},
params
);
}
async getCredit(organizationId: string, creditId: string): Promise<Credit> {
const path = `/organizations/${organizationId}/credits/${creditId}`;
const params = {
@@ -1073,7 +1111,8 @@ export class Billing {
async setPaymentMethod(
paymentMethodId: string,
providerMethodId: string | PaymentMethod,
name: string
name: string,
state: string | undefined = undefined
): Promise<PaymentMethodData> {
const path = `/account/payment-methods/${paymentMethodId}/provider`;
const params = {
@@ -1081,6 +1120,10 @@ export class Billing {
providerMethodId,
name
};
if (state !== undefined) {
params['state'] = state;
}
const uri = new URL(this.client.config.endpoint + path);
return await this.client.call(
'patch',
+56 -11
View File
@@ -24,7 +24,7 @@ import type {
} from '$lib/sdk/billing';
import { isCloud } from '$lib/system';
import { activeHeaderAlert, orgMissingPaymentMethod } from '$routes/(console)/store';
import { Query } from '@appwrite.io/console';
import { AppwriteException, Query } from '@appwrite.io/console';
import { derived, get, writable } from 'svelte/store';
import { headerAlert } from './headerAlert';
import { addNotification, notifications } from './notifications';
@@ -39,6 +39,7 @@ import { sdk } from './sdk';
import { user } from './user';
import BudgetLimitAlert from '$routes/(console)/organization-[organization]/budgetLimitAlert.svelte';
import TeamReadonlyAlert from '$routes/(console)/organization-[organization]/teamReadonlyAlert.svelte';
import ProjectsLimit from '$lib/components/billing/alerts/projectsLimit.svelte';
import EnterpriseTrial from '$routes/(console)/organization-[organization]/enterpriseTrial.svelte';
export type Tier = 'tier-0' | 'tier-1' | 'tier-2' | 'auto-1' | 'cont-1' | 'ent-1';
@@ -68,6 +69,7 @@ export const roles = [
export const teamStatusReadonly = 'readonly';
export const billingLimitOutstandingInvoice = 'outstanding_invoice';
export const billingProjectsLimitDate = '2025-09-01';
export const paymentMethods = derived(page, ($page) => $page.data.paymentMethods as PaymentList);
export const addressList = derived(page, ($page) => $page.data.addressList as AddressesList);
@@ -287,6 +289,7 @@ export function checkForEnterpriseTrial(org: Organization) {
}
export function calculateEnterpriseTrial(org: Organization) {
if (!org || !org.billingNextInvoiceDate) return 0;
const endDate = new Date(org.billingNextInvoiceDate);
const startDate = new Date(org.billingCurrentInvoiceDate);
const today = new Date();
@@ -314,6 +317,29 @@ export function calculateTrialDay(org: Organization) {
return days;
}
export async function checkForProjectsLimit(org: Organization, orgProjectCount?: number) {
if (!isCloud) return;
if (!org) return;
const plan = await sdk.forConsole.billing.getOrganizationPlan(org.$id);
if (!plan) return;
if (plan.$id !== BillingPlan.FREE) return;
if (org.projects?.length > 0) return;
const projectCount = orgProjectCount;
if (projectCount === undefined) return;
if (plan.projects > 0 && projectCount > plan.projects) {
headerAlert.add({
id: 'projectsLimitReached',
component: ProjectsLimit,
show: true,
importance: 12
});
}
}
export async function checkForUsageLimit(org: Organization) {
if (org?.status === teamStatusReadonly && org?.remarks === billingLimitOutstandingInvoice) {
headerAlert.add({
@@ -357,7 +383,10 @@ export async function checkForUsageLimit(org: Organization) {
const members = org.total;
const plan = get(currentPlan);
const membersOverflow =
members > plan.addons.seats.limit ? members - (plan.addons.seats.limit || members) : 0;
// nested null checks needed: GitHub Education plan have empty addons.
members > plan?.addons?.seats?.limit
? members - (plan?.addons?.seats?.limit || members)
: 0;
if (resources.some((r) => r.value >= 100) || membersOverflow > 0) {
readOnly.set(true);
@@ -524,25 +553,41 @@ export async function checkForMissingPaymentMethod() {
// Display upgrade banner for new users after 1 week for 30 days
export async function checkForNewDevUpgradePro(org: Organization) {
if (org?.billingPlan !== BillingPlan.FREE || !browser) return;
// browser or plan check.
if (!browser || org?.billingPlan !== BillingPlan.FREE) return;
const orgs = await sdk.forConsole.billing.listOrganization([
Query.notEqual('billingPlan', BillingPlan.FREE)
]);
if (orgs?.total) return;
// already dismissed by user!
if (localStorage.getItem('newDevUpgradePro')) return;
// saves one trip to backend!
const notValidKey = `${org.$id}:isNotValid`;
if (localStorage.getItem(notValidKey)) return;
const now = new Date().getTime();
const account = get(user);
const accountCreated = new Date(account.$createdAt).getTime();
if (now - accountCreated < 1000 * 60 * 60 * 24 * 7) return;
const isDismissed = !!localStorage.getItem('newDevUpgradePro');
if (isDismissed) return;
// check if coupon already applied
const organizations = await sdk.forConsole.billing.listOrganization([
Query.notEqual('billingPlan', BillingPlan.FREE)
]);
if (organizations?.total) return;
try {
await sdk.forConsole.billing.getCouponAccount(NEW_DEV_PRO_UPGRADE_COUPON);
} catch (e) {
} catch (error) {
if (
// already utilized if error is 409
error instanceof AppwriteException &&
error?.code === 409 &&
error.type === 'billing_coupon_already_used'
) {
localStorage.setItem(notValidKey, 'true');
}
return;
}
headerAlert.add({
id: 'newDevUpgradePro',
component: newDevUpgradePro,
+2 -4
View File
@@ -1,5 +1,5 @@
import { page } from '$app/state';
import { sdk } from './sdk';
import { getApiEndpoint } from './sdk';
export function connectGitHub(callbackState: Record<string, string> = null) {
const redirect = new URL(page.url);
@@ -8,9 +8,7 @@ export function connectGitHub(callbackState: Record<string, string> = null) {
redirect.searchParams.append(key, callbackState[key]);
});
}
const target = new URL(
`${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}/vcs/github/authorize`
);
const target = new URL(`${getApiEndpoint(page.params.region)}/vcs/github/authorize`);
target.searchParams.set('project', page.params.project);
target.searchParams.set('success', redirect.toString());
target.searchParams.set('failure', redirect.toString());
+1 -1
View File
@@ -34,6 +34,7 @@ export type Organization = Models.Team<Record<string, unknown>> & {
billingInvoiceId: string;
status: string;
remarks: string;
projects: string[];
};
export type OrganizationList = {
@@ -60,5 +61,4 @@ export const organizationList = derived(
export const organization = derived(page, ($page) => $page.data?.organization as Organization);
export const currentPlan = derived(page, ($page) => $page.data?.currentPlan as Plan);
export const members = derived(page, ($page) => $page.data.members as Models.MembershipList);
export const regions = writable<Models.ConsoleRegionList>({ total: 0, regions: [] });
+36 -30
View File
@@ -4,33 +4,35 @@ import type { Page } from '@sveltejs/kit';
import { get, writable } from 'svelte/store';
import { sdk } from './sdk';
import type { Models } from '@appwrite.io/console';
import { organization } from './organization';
import { page } from '$app/state';
import { user } from '$lib/stores/user';
import deepEqual from 'deep-equal';
type Preferences = {
type ConsolePreferences = {
limit?: number;
view?: View;
columns?: string[];
};
} /* support a strict + flexible preference type for TS compatibility */ & Record<
string,
string | number | boolean | object | null | unknown
>;
type TeamPreferences = {
names?: string[];
};
type PreferencesStore = {
[key: string]: Preferences;
type ConsolePreferencesStore = {
[key: string]: ConsolePreferences;
collections?: {
[key: string]: Preferences['columns'];
[key: string]: ConsolePreferences['columns'];
};
displayNames?: {
[key: string]: TeamPreferences['names'];
};
} & { hideAiDisclaimer?: boolean };
async function updateConsolePreferences(store: PreferencesStore): Promise<void> {
const currentPreferences = get(user).prefs ?? (await sdk.forConsole.account.getPrefs());
async function updateConsolePreferences(store: ConsolePreferencesStore): Promise<void> {
const currentPreferences = get(user)?.prefs ?? (await sdk.forConsole.account.getPrefs());
if (!currentPreferences?.console || Array.isArray(currentPreferences.console)) {
currentPreferences.console = {};
}
@@ -44,8 +46,8 @@ async function updateConsolePreferences(store: PreferencesStore): Promise<void>
}
function createPreferences() {
const { subscribe, set, update } = writable<PreferencesStore>({});
let preferences: PreferencesStore = {};
const { subscribe, set, update } = writable<ConsolePreferencesStore>({});
let preferences: ConsolePreferencesStore = {};
if (browser) {
// fresh fetch.
@@ -74,14 +76,14 @@ function createPreferences() {
/**
* Update the local store and then synchronizes them on user prefs.
*/
function updateAndSync(callback: (prefs: PreferencesStore) => void): Promise<void> {
let oldPrefsSnapshot: PreferencesStore;
let newPrefsSnapshot: PreferencesStore;
function updateAndSync(callback: (prefs: ConsolePreferencesStore) => void): Promise<void> {
let oldPrefsSnapshot: ConsolePreferencesStore;
let newPrefsSnapshot: ConsolePreferencesStore;
update((currentPrefs) => {
oldPrefsSnapshot = currentPrefs;
oldPrefsSnapshot = structuredClone(currentPrefs);
callback(currentPrefs);
newPrefsSnapshot = currentPrefs;
newPrefsSnapshot = structuredClone(currentPrefs);
return currentPrefs;
});
@@ -97,7 +99,7 @@ function createPreferences() {
subscribe,
set,
update,
get: (route?: Page['route']): Preferences => {
get: (route?: Page['route']): ConsolePreferences => {
const parsedRoute = route ?? page.route;
return (
preferences?.[parsedRoute.id] ?? {
@@ -107,11 +109,10 @@ function createPreferences() {
}
);
},
getCustomCollectionColumns: (collectionId: string): Preferences['columns'] => {
getCustomCollectionColumns: (collectionId: string): ConsolePreferences['columns'] => {
return preferences?.collections?.[collectionId] ?? [];
},
setLimit: (limit: Preferences['limit']) =>
setLimit: (limit: ConsolePreferences['limit']) =>
updateAndSync((n) => {
const path = page.route.id;
@@ -124,7 +125,7 @@ function createPreferences() {
return n;
}),
setView: (view: Preferences['view']) =>
setView: (view: ConsolePreferences['view']) =>
updateAndSync((n) => {
const path = page.route.id;
@@ -137,7 +138,7 @@ function createPreferences() {
return n;
}),
setColumns: (columns: Preferences['columns']) =>
setColumns: (columns: ConsolePreferences['columns']) =>
updateAndSync((n) => {
const path = page.route.id;
@@ -150,16 +151,17 @@ function createPreferences() {
return n;
}),
setCustomCollectionColumns: (columns: Preferences['columns']) =>
setCustomCollectionColumns: (
collectionId: string,
columns: ConsolePreferences['columns']
) =>
updateAndSync((n) => {
const collection = page.params.collection;
if (!n?.collections?.[collection]) {
if (!n?.collections?.[collectionId]) {
n ??= {};
n.collections ??= {};
}
n.collections[collection] = columns;
n.collections[collectionId] = Array.from(new Set(columns));
return n;
}),
loadTeamPrefs: async (id: string) => {
@@ -174,10 +176,13 @@ function createPreferences() {
getDisplayNames: () => {
return preferences?.displayNames ?? {};
},
setDisplayNames: async (collectionId: string, names: TeamPreferences['names']) => {
const id = get(organization).$id;
setDisplayNames: async (
orgId: string,
collectionId: string,
names: TeamPreferences['names']
) => {
let teamPrefs: Models.Preferences;
update((n) => {
await updateAndSync((n) => {
if (!n?.displayNames) {
n ??= {};
n.displayNames ??= {};
@@ -188,7 +193,8 @@ function createPreferences() {
return n;
});
await sdk.forConsole.teams.updatePrefs(id, teamPrefs);
await sdk.forConsole.teams.updatePrefs(orgId, teamPrefs);
}
};
}
+4
View File
@@ -30,8 +30,10 @@ import {
REGION_FRA,
REGION_NYC,
REGION_SYD,
REGION_SFO,
SUBDOMAIN_FRA,
SUBDOMAIN_NYC,
SUBDOMAIN_SFO,
SUBDOMAIN_SYD
} from '$lib/constants';
import { building } from '$app/environment';
@@ -59,6 +61,8 @@ const getSubdomain = (region?: string) => {
return SUBDOMAIN_SYD;
case REGION_NYC:
return SUBDOMAIN_NYC;
case REGION_SFO:
return SUBDOMAIN_SFO;
default:
return '';
}
+40 -3
View File
@@ -1,4 +1,10 @@
import type { Appearance, Stripe, StripeElement, StripeElements } from '@stripe/stripe-js';
import type {
Appearance,
PaymentMethod,
Stripe,
StripeElement,
StripeElements
} from '@stripe/stripe-js';
import { sdk } from './sdk';
import { app } from './app';
import { get, writable } from 'svelte/store';
@@ -83,7 +89,8 @@ export async function submitStripeCard(name: string, organizationId?: string) {
billing_details: {
name
}
}
},
expand: ['payment_method']
},
redirect: 'if_required'
});
@@ -95,9 +102,13 @@ export async function submitStripeCard(name: string, organizationId?: string) {
}
if (setupIntent && setupIntent.status === 'succeeded') {
if ((setupIntent.payment_method as PaymentMethod).card?.country === 'US') {
// need to get state
return setupIntent.payment_method as PaymentMethod;
}
const method = await sdk.forConsole.billing.setPaymentMethod(
paymentMethod.$id,
setupIntent.payment_method,
(setupIntent.payment_method as PaymentMethod).id,
name
);
paymentElement.destroy();
@@ -115,6 +126,32 @@ export async function submitStripeCard(name: string, organizationId?: string) {
}
}
export async function setPaymentMethod(providerMethodId: string, name: string, state: string) {
if (!paymentMethod) {
addNotification({
title: 'Error',
message: 'No payment method found. Please try again.',
type: 'error'
});
return;
}
try {
const method = await sdk.forConsole.billing.setPaymentMethod(
paymentMethod.$id,
providerMethodId,
name,
state
);
paymentElement.destroy();
isStripeInitialized.set(false);
trackEvent(Submit.PaymentMethodCreate);
return method;
} catch (e) {
trackError(e, Submit.PaymentMethodCreate);
throw e;
}
}
export async function confirmPayment(
orgId: string,
clientSecret: string,
+4
View File
@@ -103,6 +103,8 @@ const createUploader = () => {
newFile.progress = p.progress;
newFile.status = p.progress === 100 ? 'success' : 'pending';
updateFile(p.$id, newFile);
return {};
}
);
newFile.$id = uploadedFile.$id;
@@ -133,6 +135,8 @@ const createUploader = () => {
newDeployment.progress = p.progress;
newDeployment.status = p.progress === 100 ? 'success' : 'pending';
updateFile(p.$id, newDeployment);
return {};
});
newDeployment.$id = uploadedFile.$id;
newDeployment.progress = 100;
+9 -17
View File
@@ -4,8 +4,8 @@
import Footer from '$lib/layout/footer.svelte';
import Shell from '$lib/layout/shell.svelte';
import { app } from '$lib/stores/app';
import { newOrgModal, organization, type Organization } from '$lib/stores/organization';
import { database, checkForDatabaseBackupPolicies } from '$lib/stores/database';
import { newOrgModal, organization, type Organization } from '$lib/stores/organization';
import { wizard } from '$lib/stores/wizard';
import { afterUpdate, onMount } from 'svelte';
import { loading } from '$routes/store';
@@ -18,6 +18,7 @@
checkForMarkedForDeletion,
checkForMissingPaymentMethod,
checkForNewDevUpgradePro,
checkForProjectsLimit,
checkForUsageLimit,
checkPaymentAuthorizationRequired,
paymentExpired,
@@ -54,9 +55,10 @@
IconSwitchHorizontal
} from '@appwrite.io/pink-icons-svelte';
import type { LayoutData } from './$types';
import type { NavbarProject } from '$lib/components/navbar.svelte';
import { getProjectRoute } from '$lib/helpers/project';
export let data: LayoutData;
function kebabToSentenceCase(str: string) {
return str
.split('-')
@@ -64,20 +66,7 @@
.join(' ');
}
const isAssistantEnabled = $consoleVariables?._APP_ASSISTANT_ENABLED === true;
export let data: LayoutData;
$: loadedProjects = data.projects.map((project) => {
return {
name: project?.name,
$id: project.$id,
isSelected: project.$id === page.params.project,
region: project.region,
platformCount: project.platforms.length,
pingCount: project.pingCount
};
}) satisfies NavbarProject[];
$: isAssistantEnabled = $consoleVariables?._APP_ASSISTANT_ENABLED === true;
$: isOnSettingsLayout = $project?.$id
? page.url.pathname.includes(`project-${$project.region}-${$project.$id}/settings`)
@@ -262,6 +251,7 @@
rank: -1
}
]);
onMount(async () => {
loading.set(false);
if (!localStorage.getItem('feedbackElapsed')) {
@@ -304,6 +294,9 @@
if (currentOrganizationId === org.$id) return;
if (isCloud) {
currentOrganizationId = org.$id;
const orgProjectCount =
data.currentOrgId === org.$id ? data.allProjectsCount : undefined;
await checkForProjectsLimit(org, orgProjectCount);
checkForEnterpriseTrial(org);
await checkForUsageLimit(org);
checkForMarkedForDeletion(org);
@@ -344,7 +337,6 @@
!page.url.pathname.includes('/console/onboarding')}
showHeader={!page.url.pathname.includes('/console/onboarding/create-project')}
showFooter={!page.url.pathname.includes('/console/onboarding/create-project')}
{loadedProjects}
selectedProject={page.data?.project}>
<!-- <Header slot="header" />-->
<slot />
+50 -50
View File
@@ -1,71 +1,71 @@
import { Dependencies } from '$lib/constants';
import type { Plan } from '$lib/sdk/billing';
import type { Tier } from '$lib/stores/billing';
import { sdk } from '$lib/stores/sdk';
import { isCloud } from '$lib/system';
import type { LayoutLoad } from './$types';
import { Query, type Models } from '@appwrite.io/console';
import { Dependencies } from '$lib/constants';
import type { Tier } from '$lib/stores/billing';
import type { Plan, PlanList } from '$lib/sdk/billing';
import { Query } from '@appwrite.io/console';
export const load: LayoutLoad = async ({ depends, parent }) => {
const { organizations } = await parent();
export const load: LayoutLoad = async ({ params, fetch, depends, parent }) => {
await parent();
depends(Dependencies.RUNTIMES);
depends(Dependencies.CONSOLE_VARIABLES);
depends(Dependencies.ORGANIZATION);
const prefs = await sdk.forConsole.account.getPrefs();
const { endpoint, project } = sdk.forConsole.client.config;
const versionPromise = fetch(`${endpoint}/health/version`, {
headers: {
'X-Appwrite-Project': project
}
}).then((response) => response.json() as { version?: string });
const [preferences, plansArray, versionData, consoleVariables] = await Promise.all([
sdk.forConsole.account.getPrefs(),
isCloud ? sdk.forConsole.billing.getPlansInfo() : null,
fetch(`${endpoint}/health/version`, {
headers: { 'X-Appwrite-Project': project }
}).then((response) => response.json() as { version?: string }),
sdk.forConsole.console.variables()
]);
const variablesPromise = sdk.forConsole.console.variables();
const plansInfo = toPlanMap(plansArray);
const [data, variables] = await Promise.all([versionPromise, variablesPromise]);
const currentOrgId =
preferences.organization ??
(organizations.teams.length > 0 ? organizations.teams[0].$id : undefined);
let plansInfo = new Map<Tier, Plan>();
if (isCloud) {
const plansArray = await sdk.forConsole.billing.getPlansInfo();
plansInfo = plansArray.plans.reduce((map, plan) => {
map.set(plan.$id as Tier, plan);
return map;
}, new Map<Tier, Plan>());
}
const organizations = !isCloud
? await sdk.forConsole.teams.list()
: await sdk.forConsole.billing.listOrganization();
let projects: Models.Project[] = [];
let currentOrgId = params.organization ? params.organization : prefs.organization;
if (!currentOrgId && organizations.teams.length > 0) {
currentOrgId = organizations.teams[0].$id;
}
// Load projects for the current organization if one is selected
let projectsCount = 0;
if (currentOrgId) {
const orgProjects = await sdk.forConsole.projects.list([
Query.equal('teamId', currentOrgId),
Query.limit(5),
Query.orderDesc('$updatedAt')
]);
projects = orgProjects.projects.length > 0 ? orgProjects.projects : [];
}
// set `default` if no region!
for (const project of projects) {
project.region ??= 'default';
try {
projectsCount = (
await sdk.forConsole.projects.list([
Query.equal('teamId', currentOrgId),
Query.limit(1)
])
).total;
} catch (e) {
projectsCount = 0;
}
}
return {
consoleVariables: variables,
version: data?.version ?? null,
plansInfo,
roles: [],
scopes: [],
projects: projects,
currentProjectId: params.project ?? '',
organizations: organizations
preferences,
currentOrgId,
organizations,
consoleVariables,
version: versionData?.version ?? null,
allProjectsCount: projectsCount
};
};
function toPlanMap(plansArray: PlanList | null): Map<Tier, Plan> {
const map = new Map<Tier, Plan>();
if (!plansArray?.plans.length) return map;
const plans = plansArray.plans;
for (let i = 0; i < plans.length; i++) {
const plan = plans[i];
map.set(plan.$id as Tier, plan);
}
return map;
}
@@ -13,7 +13,7 @@
import { sdk } from '$lib/stores/sdk';
import type { PageData } from './$types';
import { isCloud } from '$lib/system';
import { Pill } from '$lib/elements';
import { Badge } from '@appwrite.io/pink-svelte';
import type { Models } from '@appwrite.io/console';
import type { Organization } from '$lib/stores/organization';
import { daysLeftInTrial, plansInfo, tierToPlan } from '$lib/stores/billing';
@@ -75,8 +75,10 @@
{#if organization?.billingPlan === BillingPlan.FREE || organization?.billingPlan === BillingPlan.GITHUB_EDUCATION}
<Tooltip>
<div class="u-flex u-cross-center">
<Pill class="eyebrow-heading-3"
>{tierToPlan(organization?.billingPlan)?.name}</Pill>
<Badge
variant="secondary"
content={tierToPlan(organization?.billingPlan)?.name}
class="eyebrow-heading-3" />
</div>
<span slot="tooltip"
>You are limited to 1 free organization per account</span>
@@ -85,7 +87,10 @@
{#if organization?.billingTrialStartDate && $daysLeftInTrial > 0 && organization.billingPlan !== BillingPlan.FREE && $plansInfo.get(organization.billingPlan)?.trialDays}
<Tooltip>
<div class="u-flex u-cross-center">
<Pill class="eyebrow-heading-3">TRIAL</Pill>
<Badge
class="eyebrow-heading-3"
variant="secondary"
content="TRIAL" />
</div>
<span slot="tooltip"
>{`Your trial ends on ${toLocaleDate(
@@ -6,6 +6,9 @@
import { page } from '$app/state';
import { confirmPayment } from '$lib/stores/stripe';
import { Typography } from '@appwrite.io/pink-svelte';
import type { PageData } from './$types';
export let data: PageData;
let showPayment = false;
@@ -21,5 +24,5 @@
<Container>
<Typography.Title size="s">Payment details</Typography.Title>
<PaymentMethods bind:showPayment />
<BillingAddress />
<BillingAddress {data} />
</Container>
@@ -6,12 +6,17 @@ export const load: PageLoad = async ({ depends }) => {
depends(Dependencies.PAYMENT_METHODS);
depends(Dependencies.ADDRESS);
const [paymentMethods, addressList] = await Promise.all([
const [paymentMethods, addressList, countryList, locale] = await Promise.all([
sdk.forConsole.billing.listPaymentMethods(),
sdk.forConsole.billing.listAddresses()
sdk.forConsole.billing.listAddresses(),
sdk.forConsole.locale.listCountries(),
sdk.forConsole.locale.get()
]);
return {
paymentMethods,
addressList
addressList,
countryList,
locale
};
};
@@ -8,9 +8,12 @@
import type { Organization } from '$lib/stores/organization';
import { sdk } from '$lib/stores/sdk';
import { onMount } from 'svelte';
import type { Models } from '@appwrite.io/console';
export let show = false;
export let locale: Models.Locale;
export let organization: string = null;
export let countryList: Models.CountryList;
let country: string;
let address: string;
@@ -27,8 +30,6 @@
let error: string = null;
onMount(async () => {
const countryList = await sdk.forConsole.locale.listCountries();
const locale = await sdk.forConsole.locale.get();
if (locale.countryCode) {
country = locale.countryCode;
}
@@ -55,7 +56,7 @@
if (organization) {
org = await sdk.forConsole.billing.setBillingAddress(organization, response.$id);
trackEvent(Submit.OrganizationBillingAddressUpdate);
await invalidate(Dependencies.ORGANIZATION);
await invalidate(Dependencies.ORGANIZATIONS);
}
await invalidate(Dependencies.ADDRESS);
@@ -2,8 +2,6 @@
import { CardGrid, Empty } from '$lib/components';
import { Button } from '$lib/elements/forms';
import { addressList } from '$lib/stores/billing';
import { sdk } from '$lib/stores/sdk';
import { onMount } from 'svelte';
import AddressModal from './addressModal.svelte';
import type { Models } from '@appwrite.io/console';
import DeleteAddress from './deleteAddressModal.svelte';
@@ -28,17 +26,18 @@
Tag,
Typography
} from '@appwrite.io/pink-svelte';
import type { PageData } from './$types';
export let data: PageData;
const locale: Models.Locale = data.locale;
const countryList: Models.CountryList = data.countryList;
let show = false;
let showEdit = false;
let selectedAddress: Address;
let selectedLinkedOrgs: Organization[] = [];
let showDelete = false;
let countryList: Models.CountryList;
onMount(async () => {
countryList = await sdk.forConsole.locale.listCountries();
});
$: orgList = $organizationList.teams as unknown as Organization[];
</script>
@@ -144,6 +143,6 @@
</svelte:fragment>
</CardGrid>
<AddressModal bind:show />
<EditAddressModal bind:show={showEdit} {selectedAddress} />
<AddressModal {locale} {countryList} bind:show />
<EditAddressModal bind:show={showEdit} {selectedAddress} {locale} {countryList} />
<DeleteAddress bind:showDelete {selectedAddress} linkedOrgs={selectedLinkedOrgs} />
@@ -1,6 +1,5 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { page } from '$app/state';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
@@ -9,9 +8,12 @@
import { addNotification } from '$lib/stores/notifications';
import { sdk } from '$lib/stores/sdk';
import { onMount } from 'svelte';
import type { Models } from '@appwrite.io/console';
export let show = false;
export let selectedAddress: Address;
export let locale: Models.Locale;
export let countryList: Models.CountryList;
let error: string = null;
let options = [
@@ -22,7 +24,6 @@
];
onMount(async () => {
const countryList = await sdk.forConsole.locale.listCountries();
options = countryList.countries.map((country) => {
return {
value: country.code,
@@ -63,13 +64,15 @@
* which really shouldn't happen, but here we are, playing it safe!
*/
$: if (show && !selectedAddress.country) {
sdk.forProject(page.params.region, page.params.project)
.locale.get()
.then((locale) => {
if (locale) {
selectedAddress.country = locale.countryCode;
} else {
sdk.forConsole.locale.get().then((locale) => {
if (locale.countryCode) {
selectedAddress.country = locale.countryCode;
}
});
}
}
</script>
@@ -13,7 +13,8 @@
import type { PageData } from './$types';
import { addNotification } from '$lib/stores/notifications';
import { onMount } from 'svelte';
import { Badge, Layout, Table, Typography } from '@appwrite.io/pink-svelte';
import { Badge, Layout, Table, Typography, Icon } from '@appwrite.io/pink-svelte';
import { IconGlobeAlt } from '@appwrite.io/pink-icons-svelte';
export let data: PageData;
@@ -90,9 +91,9 @@
let:root
columns={[
{ id: 'client' },
{ id: 'location', width: 120 },
{ id: 'ip', width: 120 },
{ id: 'actions', width: 70 }
{ id: 'location', width: 200 },
{ id: 'ip', width: 200 },
{ id: 'actions', width: 100 }
]}>
<svelte:fragment slot="header" let:root>
<Table.Header.Cell column="client" {root}>Client</Table.Header.Cell>
@@ -112,13 +113,9 @@
height="20"
width="20"
src={getBrowser(session.clientCode).toString()}
style="--p-text-size: 1.25rem"
alt={session.clientName} />
{:else}
<span
class="icon-globe-alt"
style="--p-text-size: 1.25rem"
aria-hidden="true"></span>
<Icon icon={IconGlobeAlt} size="s" />
{/if}
</div>
<Trim>
+70 -1
View File
@@ -1,11 +1,80 @@
import { isCloud } from '$lib/system';
import { isSameDay } from '$lib/helpers/date';
import { type BottomModalAlertItem, showBottomModalAlert } from '$lib/stores/bottom-alerts';
import AtomicNumericOperationsDark from '$lib/images/promos/atomic-numeric-operations-dark.png';
import AtomicNumericOperationsLight from '$lib/images/promos/atomic-numeric-operations-light.png';
import AppwriteGeneralAvailabiltyLight from '$lib/images/promos/appwrite-general-availability-light.png';
import AppwriteGeneralAvailabiltyDark from '$lib/images/promos/appwrite-general-availability-dark.png';
import TimestampOverridesDark from '$lib/images/promos/timestamp-overrides-dark.png';
import TimestampOverridesLight from '$lib/images/promos/timestamp-overrides-light.png';
const listOfPromotions: BottomModalAlertItem[] = [];
if (isCloud) {
/* add promos here */
const appwriteGeneralAvailabiltyPromo: BottomModalAlertItem = {
id: 'modal:appwrite_general_availability_announcement',
src: {
dark: AppwriteGeneralAvailabiltyDark,
light: AppwriteGeneralAvailabiltyLight
},
title: 'Now Generally Available',
message: 'After 26 months of Appwrite Cloud, we are ready to remove the beta tag.',
plan: 'free',
importance: 8,
scope: 'everywhere',
cta: {
text: 'Learn more',
link: () => 'https://apwr.dev/ygTXfxA',
external: true,
hideOnClick: true
},
show: true
};
const timestampOverridesPromo: BottomModalAlertItem = {
id: 'modal:timestamp_overrides_announcement',
src: {
dark: TimestampOverridesDark,
light: TimestampOverridesLight
},
title: 'Announcing Timestamp Overrides',
message:
'Move historical data into Appwrite without losing context or disrupting chronological accuracy.',
plan: 'free',
importance: 8,
scope: 'project',
cta: {
text: 'Read announcement',
link: () => 'https://appwrite.io/blog/post/announcing-timestamp-overrides',
external: true,
hideOnClick: true
},
show: true
};
const atomicNumericOperationsPromo: BottomModalAlertItem = {
id: 'modal:atomic_numeric_operations_announcement',
src: {
dark: AtomicNumericOperationsDark,
light: AtomicNumericOperationsLight
},
title: 'Announcing Atomic Numeric Operations',
message:
'Safely update numeric fields directly on the server, without conflicts or race conditions.',
plan: 'free',
importance: 8,
scope: 'project',
cta: {
text: 'Read announcement',
link: () => 'https://appwrite.io/blog/post/announcing-atomic-numeric-operations',
external: true,
hideOnClick: true
},
show: true
};
listOfPromotions.push(
timestampOverridesPromo,
appwriteGeneralAvailabiltyPromo,
atomicNumericOperationsPromo
);
}
export function addBottomModalAlerts() {
@@ -186,6 +186,7 @@
bind:value={name}
label="Organization name"
placeholder="Enter organization name"
autofocus
id="name"
required />
</Fieldset>
@@ -5,8 +5,9 @@ import type { Coupon } from '$lib/sdk/billing';
import type { Organization } from '$lib/stores/organization';
export const load: PageLoad = async ({ url, parent, depends }) => {
depends(Dependencies.CREATE_ORGANIZATION);
const { organizations } = await parent();
depends(Dependencies.ORGANIZATIONS);
const [coupon, paymentMethods] = await Promise.all([
getCoupon(url),
sdk.forConsole.billing.listPaymentMethods()
@@ -15,6 +16,7 @@ export const load: PageLoad = async ({ url, parent, depends }) => {
const hasFreeOrganizations = organizations.teams?.some(
(org) => (org as Organization)?.billingPlan === BillingPlan.FREE
);
if (plan === BillingPlan.FREE && hasFreeOrganizations) {
plan = BillingPlan.PRO;
}
@@ -2,14 +2,14 @@
import { isCloud } from '$lib/system';
import { sdk } from '$lib/stores/sdk';
import { ID } from '@appwrite.io/console';
import { BillingPlan } from '$lib/constants';
import { BillingPlan, Dependencies } from '$lib/constants';
import { tierToPlan } from '$lib/stores/billing';
import { addNotification } from '$lib/stores/notifications';
import { loadAvailableRegions } from '$routes/(console)/regions';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { Button, Card, Layout, Input, Typography, Spinner } from '@appwrite.io/pink-svelte';
import { Form } from '$lib/elements/forms/index.js';
import { goto } from '$app/navigation';
import { goto, invalidate } from '$app/navigation';
import { base } from '$app/paths';
let isLoading = false;
@@ -44,11 +44,15 @@
message: e.message
});
} finally {
isLoading = false;
if (organization) {
loadAvailableRegions(organization?.$id).then();
await goto(`${base}/organization-${organization.$id}`);
// fixes an edge case where
// the org is not available for some reason!
await invalidate(Dependencies.ORGANIZATIONS);
}
isLoading = false;
}
}
</script>
@@ -66,6 +70,7 @@
<Input.Text
required
autofocus
disabled={isLoading}
label="Organization name"
bind:value={organizationName}
@@ -15,7 +15,7 @@
import { getProjectRoute } from '$lib/helpers/project';
let isLoading = false;
let id: string;
let id: string = ID.unique();
let startAnimation = false;
let projectName = 'Appwrite project';
let region = Region.Fra;
@@ -99,14 +99,18 @@
bind:projectName
bind:id
bind:region
on:submit={createProject}>
<svelte:fragment slot="submit">
showTitle={true}>
{#snippet submit()}
<Layout.Stack direction="row" justifyContent="flex-end">
<Button.Button autofocus type="submit" variant="primary" size="s">
<Button.Button
on:click={createProject}
type="submit"
variant="primary"
size="s">
Create
</Button.Button>
</Layout.Stack>
</svelte:fragment>
{/snippet}
</CreateProject>
</Card.Base>
{/if}
Loaded 100 of 313 files, more files were not shown because too many files have changed in this diff. Show more