- import { Click, trackEvent } from '$lib/actions/analytics';
import { InputId } from '$lib/elements/forms';
import { InputProjectId } from '$lib/elements/forms';
import Button from '$lib/elements/forms/button.svelte';
import { IconX } from '@appwrite.io/pink-icons-svelte';
+ import { Click, trackEvent } from '$lib/actions/analytics';
import { Card, Divider, Icon, Layout, Typography } from '@appwrite.io/pink-svelte';
- export let show = false;
- export let name: string;
- export let id: string;
- export let autofocus = true;
- export let isProject = false;
- $: if (!show) {
- id = null;
- }
- $: if (!id?.length) {
- id = null;
- }
+ let {
+ show = $bindable(false),
+ name,
+ id = $bindable(null),
+ autofocus = true,
+ isProject = false,
+ required = true
+ }: {
+ show: boolean;
+ name: string;
+ id: string;
+ autofocus?: boolean;
+ isProject?: boolean;
+ required?: boolean;
+ } = $props();
+
+ $effect(() => {
+ if (!show) {
+ id = null;
+ }
+
+ if (!id?.length) {
+ id = null;
+ }
- $: if (show) {
- trackEvent(Click.ShowCustomIdClick);
- }
+ if (show) {
+ trackEvent(Click.ShowCustomIdClick);
+ }
+ });
{#if show}
@@ -45,9 +59,9 @@
{#if isProject}
-
+
{:else}
-
+
{/if}
diff --git a/src/lib/components/dualTimeView.svelte b/src/lib/components/dualTimeView.svelte
index 644aabe678..61c28c4247 100644
--- a/src/lib/components/dualTimeView.svelte
+++ b/src/lib/components/dualTimeView.svelte
@@ -11,6 +11,7 @@
import { menuOpen } from '$lib/components/menu/store';
export let time: string | null = null;
+ export let canShowPopover: boolean = true;
export let placement: ComponentProps
['placement'] = 'bottom';
function timeDifference(dateString: string): string {
@@ -79,7 +80,7 @@
-{:else}
+ {:else}
{time === null || time === undefined ? 'null' : time}
{/if}
diff --git a/src/lib/components/eventModal.svelte b/src/lib/components/eventModal.svelte
index db94a71424..a96f474676 100644
--- a/src/lib/components/eventModal.svelte
+++ b/src/lib/components/eventModal.svelte
@@ -26,10 +26,10 @@
...services.flatMap((s) => s.actions.map((a) => a.name)),
...services.flatMap((s) => s.resources.flatMap((r) => r.actions.map((a) => a.name)))
];
- const attributeNames = [
- ...services.flatMap((s) => s.actions.flatMap((a) => a.attributes ?? [])),
+ const columnNames = [
+ ...services.flatMap((s) => s.actions.flatMap((a) => a.columns ?? [])),
...services.flatMap((s) =>
- s.resources.flatMap((r) => r.actions.flatMap((a) => a.attributes ?? []))
+ s.resources.flatMap((r) => r.actions.flatMap((a) => a.columns ?? []))
)
];
@@ -37,7 +37,7 @@
const isService = (s: string) => serviceNames.includes(s);
const isResource = (s: string) => resourceNames.includes(s);
const isAction = (s: string) => actionNames.includes(s);
- const isAttribute = (s: string) => attributeNames.includes(s);
+ const isColumn = (s: string) => columnNames.includes(s);
const dispatch = createEventDispatcher();
@@ -69,7 +69,7 @@
case 'service': {
selected.resource = null;
selected.action = null;
- selected.attribute = null;
+ selected.column = null;
break;
}
case 'resource': {
@@ -79,25 +79,25 @@
// We need to check if the selected action name is still
// on the available list, and if so, change the action to the
- // appropriate one, as it may contain different attributes
+ // appropriate one, as it may contain different attributes/columns.
const availableAction = availableActions.find(
(a) => a.name === selected.action?.name
);
if (!availableAction) {
selected.action = null;
- selected.attribute = null;
+ selected.column = null;
} else {
selected.action = availableAction;
- if (!selected?.action?.attributes?.includes(selected.attribute)) {
- selected.attribute = null;
+ if (!selected?.action?.columns?.includes(selected.column)) {
+ selected.column = null;
}
}
break;
}
case 'action': {
- selected.attribute = null;
+ selected.column = null;
break;
}
}
@@ -113,16 +113,13 @@
if (isService(field)) {
selected.service = services.find((s) => s.name === field);
} else if (isResource(field)) {
- const resource = selected.service?.resources.find((r) => r.name === field);
- selected.resource = resource;
+ selected.resource = selected.service?.resources.find((r) => r.name === field);
} else if (isAction(field)) {
- const action =
+ selected.action =
selected.resource?.actions.find((a) => a.name === field) ||
selected.service?.actions.find((a) => a.name === field);
- selected.action = action;
- } else if (isAttribute(field)) {
- const attribute = selected.action?.attributes?.find((a) => a === field);
- selected.attribute = attribute;
+ } else if (isColumn(field)) {
+ selected.column = selected.action?.columns?.find((a) => a === field);
}
}
}
@@ -143,7 +140,7 @@
const secondToLastField = at(fields, index - 2);
if (index === 0 || isService(currField)) return 'service';
- if (isAttribute(currField) || isAction(prevField)) return 'attribute';
+ if (isColumn(currField) || isAction(prevField)) return 'attribute';
if (isAction(currField)) return 'action';
if (isResource(currField)) return 'resource';
if (isService(prevField) || isResource(prevField) || index === 1) {
@@ -182,7 +179,7 @@
service: null as EventService | null,
resource: null as EventResource | null,
action: null as EventAction | null,
- attribute: null as string | null
+ column: null as string | null
};
let helper: string = null;
let customInput: string = null;
@@ -198,7 +195,7 @@
services: services,
resources: selected.service?.resources || [],
actions: (selected.resource ? selected.resource?.actions : selected.service?.actions) || [],
- attributes: selected.action?.attributes || []
+ columns: selected.action?.columns || []
};
$: eventString = (function createEventString(): Array<{ value: string; description: string }> {
@@ -212,8 +209,8 @@
if (selected.service) {
fields.push(selected.service.name, '*');
}
- if (selected.resource?.name === 'documents') {
- fields.push('collections', '*');
+ if (selected.resource?.name === 'rows') {
+ fields.push('tables', '*');
}
if (selected.resource) {
fields.push(selected.resource.name, '*');
@@ -221,8 +218,8 @@
if (selected.action) {
fields.push(selected.action.name);
}
- if (selected.attribute) {
- fields.push(selected.attribute);
+ if (selected.column) {
+ fields.push(selected.column);
}
}
@@ -290,14 +287,14 @@
{/if}
- {#if !empty(available.attributes)}
+ {#if !empty(available.columns)}
Choose an attribute (optional)
- {#each available.attributes as attribute}
+ {#each available.columns as attribute}
select('attribute', attribute)}>
{attribute}
diff --git a/src/lib/components/filePicker.svelte b/src/lib/components/filePicker.svelte
index df2d78f78b..bcb681cdd6 100644
--- a/src/lib/components/filePicker.svelte
+++ b/src/lib/components/filePicker.svelte
@@ -499,7 +499,7 @@
size="s"
event="empty_documentation"
href="https://appwrite.io/docs/products/storage/upload-download"
- ariaLabel="create document"
+ ariaLabel="upload download"
>Documentation
+ ariaLabel="create buckets">Documentation
+
+
diff --git a/src/lib/components/filters/store.ts b/src/lib/components/filters/store.ts
index 6be45f6a0f..0ea1a603b1 100644
--- a/src/lib/components/filters/store.ts
+++ b/src/lib/components/filters/store.ts
@@ -1,10 +1,10 @@
import { goto } from '$app/navigation';
-import { derived, get, writable } from 'svelte/store';
import { page } from '$app/stores';
import deepEqual from 'deep-equal';
-import type { Column, ColumnType } from '$lib/helpers/types';
import { Query } from '@appwrite.io/console';
import { toLocaleDateTime } from '$lib/helpers/date';
+import { derived, get, writable } from 'svelte/store';
+import type { Column, ColumnType } from '$lib/helpers/types';
export type TagValue = {
tag: string;
@@ -12,8 +12,8 @@ export type TagValue = {
};
export type Operator = {
- toTag: (attribute: string, input?: string | number | string[], type?: string) => TagValue;
- toQuery: (attribute: string, input?: string | number | string[]) => string;
+ toTag: (column: string, input?: string | number | string[], type?: string) => TagValue;
+ toQuery: (column: string, input?: string | number | string[]) => string;
types: ColumnType[];
hideInput?: boolean;
};
@@ -134,7 +134,7 @@ export enum ValidTypes {
const operatorsDefault = new Map<
ValidOperators,
{
- query: (attr: string, input: string | number | string[]) => string;
+ query: (col: string, input: string | number | string[]) => string;
types: ColumnType[];
hideInput?: boolean;
}
@@ -249,8 +249,8 @@ export function generateDefaultOperators() {
operatorsDefault.forEach((operator, operatorName) => {
operators[operatorName] = {
toQuery: operator.query,
- toTag: (attribute, input = null, type = null) => {
- return generateTag(attribute, operatorName, input, type);
+ toTag: (column, input = null, type = null) => {
+ return generateTag(column, operatorName, input, type);
},
types: operator.types,
hideInput: operator.hideInput
@@ -259,24 +259,24 @@ export function generateDefaultOperators() {
return operators;
}
-export function generateTag(attribute: string, operatorName: string, input = null, type = null) {
+export function generateTag(column: string, operatorName: string, input = null, type = null) {
if (input === null) {
return {
value: '',
- tag: `**${attribute}** ${operatorName}`
+ tag: `**${column}** ${operatorName}`
};
} else if (Array.isArray(input) && input.length > 2) {
return {
value: input,
- tag: `**${attribute}** ${operatorName} **${formatArray(input)}** `
+ tag: `**${column}** ${operatorName} **${formatArray(input)}** `
};
} else if (type === ValidTypes.Datetime) {
return {
value: input,
- tag: `**${attribute}** ${operatorName} **${toLocaleDateTime(input.toString())}**`
+ tag: `**${column}** ${operatorName} **${toLocaleDateTime(input.toString())}**`
};
} else {
- return { value: input, tag: `**${attribute}** ${operatorName} **${input}**` };
+ return { value: input, tag: `**${column}** ${operatorName} **${input}**` };
}
}
diff --git a/src/lib/components/id.svelte b/src/lib/components/id.svelte
index a2e19a8c88..c756ee8f6a 100644
--- a/src/lib/components/id.svelte
+++ b/src/lib/components/id.svelte
@@ -45,13 +45,18 @@
import { Icon, Tag } from '@appwrite.io/pink-svelte';
import { Copy } from '.';
import { IconDuplicate } from '@appwrite.io/pink-icons-svelte';
+ import type { TooltipPlacement } from '$lib/components/copy.svelte';
export let value: string;
export let event: string = null;
+
+ export let tooltipPortal = false;
+ export let tooltipDelay: number = 0;
+ export let tooltipPlacement: TooltipPlacement = undefined;
{#key value}
-