Merge branch 'main' into 'spreadsheet'.

This commit is contained in:
Darshan
2025-07-15 18:27:08 +05:30
8 changed files with 56 additions and 27 deletions
+18 -15
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,20 +75,21 @@
$: 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
let:showing
<div
let:hide
let:showing
slot="tooltip"
role="tooltip"
style:padding="1rem"
@@ -138,4 +139,6 @@
</Layout.Stack>
{/if}
</div>
</Popover>
</Popover>{:else}
<Typography.Text>{time === null || time === undefined ? 'null' : time}</Typography.Text>
{/if}
@@ -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>
@@ -22,7 +22,6 @@
import { Card } from '$lib/components';
export let withCreate = false;
export let hideOnClick = false;
export let permissions: string[] = [];
let showUser = false;
@@ -197,7 +196,6 @@
bind:showTeam
bind:showUser
{groups}
{hideOnClick}
on:create={create}
let:toggle>
<Button secondary on:click={toggle}>
@@ -215,7 +213,6 @@
bind:showTeam
bind:showUser
{groups}
{hideOnClick}
on:create={create}
let:toggle>
<Button secondary icon on:click={toggle}>
@@ -34,6 +34,7 @@
offset = 0;
search = '';
selected.clear();
show = false;
}
function create() {
@@ -37,6 +37,7 @@
offset = 0;
search = '';
selected.clear();
show = false;
}
function create() {
Binary file not shown.

After

Width:  |  Height:  |  Size: 949 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

+29 -1
View File
@@ -12,6 +12,8 @@ import DatabaseUpsertDark from '$lib/images/promos/database-upsert-dark.png';
import DatabaseUpsertLight from '$lib/images/promos/database-upsert-light.png';
import EncryptedDatabasesDark from '$lib/images/promos/encrypted-attribute-dark.png';
import EncryptedDatabasesLight from '$lib/images/promos/encrypted-attribute-light.png';
import AutoIncrementDark from '$lib/images/promos/auto-increment-dark.png';
import AutoIncrementLight from '$lib/images/promos/auto-increment-light.png';
const listOfPromotions: BottomModalAlertItem[] = [];
@@ -95,7 +97,33 @@ if (isCloud) {
},
show: true
};
listOfPromotions.push(encryptedAttributePromo, databaseUpsert, bulkApiPromo, csvImportPromo);
const autoIncrementPromo: BottomModalAlertItem = {
id: 'modal:auto_increment_announcement',
src: {
dark: AutoIncrementDark,
light: AutoIncrementLight
},
title: 'Announcing Auto-increment support',
message:
'Get a built-in numeric identifier that increases predictably with every new document added.',
plan: 'free',
importance: 8,
scope: 'project',
cta: {
text: 'Read announcement',
link: () => 'https://appwrite.io/blog/post/announcing-auto-increment',
external: true,
hideOnClick: true
},
show: true
};
listOfPromotions.push(
autoIncrementPromo,
encryptedAttributePromo,
databaseUpsert,
bulkApiPromo,
csvImportPromo
);
}
export function addBottomModalAlerts() {