From 92def1d2a4930f968faa07893f6fdea7dd29c6c4 Mon Sep 17 00:00:00 2001 From: Muhammed-Rahif Date: Sun, 24 Nov 2024 18:56:18 +0530 Subject: [PATCH 1/7] fix: temp --- package.json | 6 +- src/app.json | 4 +- src/lib/actions/longpress.ts | 2 +- src/lib/components/AboutDialog.svelte | 2 +- src/lib/components/Editor/Editor.svelte | 36 ++++---- src/lib/components/EditorTabs.svelte | 10 +-- src/lib/components/EditorTitle.svelte | 24 ++++-- src/lib/components/FindDialog.svelte | 16 ++-- src/lib/components/GoToDialog.svelte | 12 ++- src/lib/components/LicenseDialog.svelte | 14 ++-- src/lib/components/MenuBar.svelte | 10 +-- src/lib/components/StatusBar.svelte | 15 +++- .../components/font-dialog/FontDialog.svelte | 6 +- .../font-dialog/FontFamilyCombobox.svelte | 80 ++++++++++-------- .../font-dialog/FontSizeCombobox.svelte | 82 +++++++++++-------- src/lib/components/icons/Check.svelte | 11 ++- src/lib/components/icons/ChevronDown.svelte | 11 ++- src/lib/components/icons/ChevronUp.svelte | 11 ++- .../components/icons/ChevronsUpDown.svelte | 11 ++- src/lib/components/icons/Close.svelte | 11 ++- src/lib/components/icons/Download.svelte | 11 ++- src/lib/components/icons/GitHub.svelte | 11 ++- src/lib/components/icons/GithubOultine.svelte | 11 ++- src/lib/components/icons/Info.svelte | 11 ++- src/lib/components/icons/Linux.svelte | 11 ++- src/lib/components/icons/MacOS.svelte | 11 ++- src/lib/components/icons/Windows.svelte | 11 ++- src/lib/components/ui/badge/badge.svelte | 24 ++++-- src/lib/components/ui/button/button.svelte | 27 ++++-- .../components/ui/card/card-content.svelte | 14 +++- .../ui/card/card-description.svelte | 14 +++- src/lib/components/ui/card/card-footer.svelte | 13 ++- src/lib/components/ui/card/card-header.svelte | 14 +++- src/lib/components/ui/card/card-title.svelte | 15 ++-- src/lib/components/ui/card/card.svelte | 29 ++++--- .../components/ui/checkbox/checkbox.svelte | 31 +++---- .../ui/command/command-dialog.svelte | 22 +++-- .../ui/command/command-empty.svelte | 13 ++- .../ui/command/command-group.svelte | 14 +++- .../ui/command/command-input.svelte | 12 ++- .../components/ui/command/command-item.svelte | 23 ++++-- .../components/ui/command/command-list.svelte | 13 ++- .../ui/command/command-separator.svelte | 10 ++- .../ui/command/command-shortcut.svelte | 16 ++-- src/lib/components/ui/command/command.svelte | 19 +++-- .../context-menu-checkbox-item.svelte | 20 +++-- .../context-menu/context-menu-content.svelte | 23 ++++-- .../ui/context-menu/context-menu-item.svelte | 15 ++-- .../ui/context-menu/context-menu-label.svelte | 15 ++-- .../context-menu-radio-group.svelte | 12 ++- .../context-menu-radio-item.svelte | 15 ++-- .../context-menu-separator.svelte | 13 +-- .../context-menu/context-menu-shortcut.svelte | 16 ++-- .../context-menu-sub-content.svelte | 23 ++++-- .../context-menu-sub-trigger.svelte | 15 ++-- .../ui/dialog/dialog-content.svelte | 29 +++++-- .../ui/dialog/dialog-description.svelte | 16 ++-- .../components/ui/dialog/dialog-footer.svelte | 13 ++- .../components/ui/dialog/dialog-header.svelte | 13 ++- .../ui/dialog/dialog-overlay.svelte | 23 ++++-- .../components/ui/dialog/dialog-portal.svelte | 10 ++- .../components/ui/dialog/dialog-title.svelte | 13 ++- src/lib/components/ui/input/input.svelte | 58 +++++++------ src/lib/components/ui/label/label.svelte | 13 ++- .../ui/menubar/menubar-checkbox-item.svelte | 21 +++-- .../ui/menubar/menubar-content.svelte | 32 ++++++-- .../components/ui/menubar/menubar-item.svelte | 15 ++-- .../ui/menubar/menubar-label.svelte | 15 ++-- .../ui/menubar/menubar-radio-item.svelte | 15 ++-- .../ui/menubar/menubar-separator.svelte | 10 ++- .../ui/menubar/menubar-shortcut.svelte | 16 ++-- .../ui/menubar/menubar-sub-content.svelte | 29 +++++-- .../ui/menubar/menubar-sub-trigger.svelte | 15 ++-- .../ui/menubar/menubar-trigger.svelte | 13 ++- src/lib/components/ui/menubar/menubar.svelte | 10 ++- .../ui/popover/popover-content.svelte | 30 +++++-- .../components/ui/separator/separator.svelte | 19 +++-- src/lib/components/ui/sonner/sonner.svelte | 7 +- .../components/ui/tabs/tabs-content.svelte | 15 ++-- src/lib/components/ui/tabs/tabs-list.svelte | 13 ++- .../components/ui/tabs/tabs-trigger.svelte | 15 ++-- src/lib/components/ui/toggle/toggle.svelte | 26 ++++-- .../ui/tooltip/tooltip-content.svelte | 32 +++++--- src/main.ts | 3 +- 84 files changed, 1007 insertions(+), 473 deletions(-) diff --git a/package.json b/package.json index 1d44e398..5a0d777c 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", - "@sveltejs/vite-plugin-svelte": "^3.1.2", + "@sveltejs/vite-plugin-svelte": "^4.0.0", "@tauri-apps/cli": "^2.0.3", "@tsconfig/svelte": "^5.0.4", "@types/eslint": "^9.6.1", @@ -33,7 +33,7 @@ "bits-ui": "^0.21.16", "eslint": "^9.12.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.44.1", + "eslint-plugin-svelte": "^2.45.1", "gh-pages": "^6.2.0", "globals": "^15.11.0", "prettier": "^3.3.3", @@ -41,7 +41,7 @@ "prettier-plugin-tailwindcss": "^0.6.8", "replace-in-file": "^8.2.0", "semantic-release": "^24.1.2", - "svelte": "^4.2.19", + "svelte": "^5.0.0", "svelte-check": "^4.0.5", "svelte-radix": "^1.1.1", "tailwindcss": "^3.4.14", diff --git a/src/app.json b/src/app.json index e20839d7..0967ef42 100644 --- a/src/app.json +++ b/src/app.json @@ -1,3 +1 @@ -{ - "version": "1.0.0-3" -} +{} diff --git a/src/lib/actions/longpress.ts b/src/lib/actions/longpress.ts index 42646bbf..c31ba6df 100644 --- a/src/lib/actions/longpress.ts +++ b/src/lib/actions/longpress.ts @@ -3,7 +3,7 @@ import type { Action } from 'svelte/action'; export const longpress: Action< HTMLDivElement, number | undefined, - { 'on:longpress': (e: CustomEvent) => void } + { onlongpress: (e: CustomEvent) => void } > = (node, threshold = 500) => { const handle_mousedown = () => { // let start = Date.now(); diff --git a/src/lib/components/AboutDialog.svelte b/src/lib/components/AboutDialog.svelte index a8bd5ec1..561f8370 100644 --- a/src/lib/components/AboutDialog.svelte +++ b/src/lib/components/AboutDialog.svelte @@ -1,4 +1,4 @@ - @@ -33,8 +33,8 @@ tabindex="0" class="flex items-center justify-center rounded-md py-1 pl-2 pr-1 {$activeTabId === editor.id ? 'bg-background' : 'bg-secondary'}" - on:click={() => ($activeTabId = editor.id)} - on:keydown={(e) => { + onclick={() => ($activeTabId = editor.id)} + onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { $activeTabId = editor.id; } diff --git a/src/lib/components/EditorTitle.svelte b/src/lib/components/EditorTitle.svelte index 453820af..41156d3a 100644 --- a/src/lib/components/EditorTitle.svelte +++ b/src/lib/components/EditorTitle.svelte @@ -1,4 +1,6 @@ - - -
- -
- -
-
- - - - No font size found. - - {#each Object.values(FontSize).filter((s) => !isNaN(Number(s))) as fontSize} - {@const fSize = fontSize.toString()} - onSelect(fontSize, ids)}> - - {fontSize == FontSize.Size16 ? `${fontSize} (Default)` : fontSize} - - {/each} - - - + + {#snippet children({ ids })} + + {#snippet children({ builder })} +
+ +
+ +
+ {/snippet} +
+ + + + No font size found. + + {#each Object.values(FontSize).filter((s) => !isNaN(Number(s))) as fontSize} + {@const fSize = fontSize.toString()} + onSelect(fontSize, ids)}> + + {fontSize == FontSize.Size16 ? `${fontSize} (Default)` : fontSize} + + {/each} + + + + {/snippet}
diff --git a/src/lib/components/icons/Check.svelte b/src/lib/components/icons/Check.svelte index 002187e4..fe13c63b 100644 --- a/src/lib/components/icons/Check.svelte +++ b/src/lib/components/icons/Check.svelte @@ -1,4 +1,13 @@ - + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + + + + + + + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + + interface Props { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { ...props }: Props = $props(); + + + - + {@render children?.()} diff --git a/src/lib/components/ui/button/button.svelte b/src/lib/components/ui/button/button.svelte index eda64410..3969737c 100644 --- a/src/lib/components/ui/button/button.svelte +++ b/src/lib/components/ui/button/button.svelte @@ -6,20 +6,33 @@ type $$Props = Props; type $$Events = Events; - let className: $$Props['class'] = undefined; - export let variant: $$Props['variant'] = 'default'; - export let size: $$Props['size'] = 'default'; - export let builders: $$Props['builders'] = []; - export { className as class }; + interface Props_1 { + class?: $$Props['class']; + variant?: $$Props['variant']; + size?: $$Props['size']; + builders?: $$Props['builders']; + children?: import('svelte').Snippet; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { + class: className = undefined, + variant = 'default', + size = 'default', + builders = [], + children, + ...rest + }: Props_1 = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/card/card-content.svelte b/src/lib/components/ui/card/card-content.svelte index 2874d034..9f6d0443 100644 --- a/src/lib/components/ui/card/card-content.svelte +++ b/src/lib/components/ui/card/card-content.svelte @@ -4,10 +4,16 @@ type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); -
- +
+ {@render children?.()}
diff --git a/src/lib/components/ui/card/card-description.svelte b/src/lib/components/ui/card/card-description.svelte index 6ea78865..959c3bc2 100644 --- a/src/lib/components/ui/card/card-description.svelte +++ b/src/lib/components/ui/card/card-description.svelte @@ -4,10 +4,16 @@ type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); -

- +

+ {@render children?.()}

diff --git a/src/lib/components/ui/card/card-footer.svelte b/src/lib/components/ui/card/card-footer.svelte index 3a28097b..e7bf5c9a 100644 --- a/src/lib/components/ui/card/card-footer.svelte +++ b/src/lib/components/ui/card/card-footer.svelte @@ -4,10 +4,15 @@ type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); -
- +
+ {@render children?.()}
diff --git a/src/lib/components/ui/card/card-header.svelte b/src/lib/components/ui/card/card-header.svelte index 8d06458c..bd9a4b08 100644 --- a/src/lib/components/ui/card/card-header.svelte +++ b/src/lib/components/ui/card/card-header.svelte @@ -4,10 +4,16 @@ type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); -
- +
+ {@render children?.()}
diff --git a/src/lib/components/ui/card/card-title.svelte b/src/lib/components/ui/card/card-title.svelte index 2ca553f8..ba93f749 100644 --- a/src/lib/components/ui/card/card-title.svelte +++ b/src/lib/components/ui/card/card-title.svelte @@ -7,15 +7,20 @@ tag?: HeadingLevel; }; - let className: $$Props['class'] = undefined; - export let tag: $$Props['tag'] = 'h3'; - export { className as class }; + interface Props { + class?: $$Props['class']; + tag?: $$Props['tag']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, tag = 'h3', children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/card/card.svelte b/src/lib/components/ui/card/card.svelte index 45c71c16..d4a3286f 100644 --- a/src/lib/components/ui/card/card.svelte +++ b/src/lib/components/ui/card/card.svelte @@ -1,22 +1,31 @@ - +
- + {@render children?.()}
diff --git a/src/lib/components/ui/checkbox/checkbox.svelte b/src/lib/components/ui/checkbox/checkbox.svelte index 3be1a49e..1c57825f 100644 --- a/src/lib/components/ui/checkbox/checkbox.svelte +++ b/src/lib/components/ui/checkbox/checkbox.svelte @@ -7,9 +7,14 @@ type $$Props = CheckboxPrimitive.Props; type $$Events = CheckboxPrimitive.Events; - let className: $$Props['class'] = undefined; - export let checked: $$Props['checked'] = false; - export { className as class }; + interface Props { + class?: $$Props['class']; + checked?: $$Props['checked']; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { class: className = undefined, checked = $bindable(false), ...rest }: Props = $props(); - - {#if isIndeterminate} - - {:else} - - {/if} + + {#snippet children({ isChecked, isIndeterminate })} + {#if isIndeterminate} + + {:else} + + {/if} + {/snippet} diff --git a/src/lib/components/ui/command/command-dialog.svelte b/src/lib/components/ui/command/command-dialog.svelte index 1783d9cf..7f8b5401 100644 --- a/src/lib/components/ui/command/command-dialog.svelte +++ b/src/lib/components/ui/command/command-dialog.svelte @@ -6,18 +6,30 @@ type $$Props = DialogPrimitive.Props & CommandPrimitive.CommandProps; - export let open: $$Props['open'] = false; - export let value: $$Props['value'] = undefined; + interface Props { + open?: $$Props['open']; + value?: $$Props['value']; + children?: import('svelte').Snippet; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { + open = $bindable(false), + value = $bindable(undefined), + children, + ...rest + }: Props = $props(); - + - + {@render children?.()} diff --git a/src/lib/components/ui/command/command-empty.svelte b/src/lib/components/ui/command/command-empty.svelte index e4f7bc60..8c8ee712 100644 --- a/src/lib/components/ui/command/command-empty.svelte +++ b/src/lib/components/ui/command/command-empty.svelte @@ -3,10 +3,15 @@ import { cn } from '@/utils'; type $$Props = CommandPrimitive.EmptyProps; - let className: string | undefined | null = undefined; - export { className as class }; + interface Props { + class?: string | undefined | null; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - - + + {@render children?.()} diff --git a/src/lib/components/ui/command/command-group.svelte b/src/lib/components/ui/command/command-group.svelte index 522a720e..723eb248 100644 --- a/src/lib/components/ui/command/command-group.svelte +++ b/src/lib/components/ui/command/command-group.svelte @@ -3,8 +3,14 @@ import { cn } from '@/utils'; type $$Props = CommandPrimitive.GroupProps; - let className: string | undefined | null = undefined; - export { className as class }; + interface Props { + class?: string | undefined | null; + children?: import('svelte').Snippet; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/command/command-input.svelte b/src/lib/components/ui/command/command-input.svelte index fdcdeecd..21e1e294 100644 --- a/src/lib/components/ui/command/command-input.svelte +++ b/src/lib/components/ui/command/command-input.svelte @@ -5,9 +5,13 @@ type $$Props = CommandPrimitive.InputProps; - let className: string | undefined | null = undefined; - export { className as class }; - export let value: string = ''; + interface Props { + class?: string | undefined | null; + value?: string; + [key: string]: any; + } + + let { class: className = undefined, value = $bindable(''), ...rest }: Props = $props();
@@ -17,7 +21,7 @@ 'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50', className )} - {...$$restProps} + {...rest} bind:value />
diff --git a/src/lib/components/ui/command/command-item.svelte b/src/lib/components/ui/command/command-item.svelte index 00dc27a3..53aa7e4d 100644 --- a/src/lib/components/ui/command/command-item.svelte +++ b/src/lib/components/ui/command/command-item.svelte @@ -1,13 +1,22 @@ - + {#snippet children({ action, attrs })} + {@render children_render?.({ action, attrs })} + {/snippet} diff --git a/src/lib/components/ui/command/command-list.svelte b/src/lib/components/ui/command/command-list.svelte index dc486deb..f0915d2f 100644 --- a/src/lib/components/ui/command/command-list.svelte +++ b/src/lib/components/ui/command/command-list.svelte @@ -3,13 +3,18 @@ import { cn } from '@/utils'; type $$Props = CommandPrimitive.ListProps; - let className: string | undefined | null = undefined; - export { className as class }; + interface Props { + class?: string | undefined | null; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/command/command-separator.svelte b/src/lib/components/ui/command/command-separator.svelte index 469f7727..7e1c42fe 100644 --- a/src/lib/components/ui/command/command-separator.svelte +++ b/src/lib/components/ui/command/command-separator.svelte @@ -3,8 +3,12 @@ import { cn } from '@/utils'; type $$Props = CommandPrimitive.SeparatorProps; - let className: string | undefined | null = undefined; - export { className as class }; + interface Props { + class?: string | undefined | null; + [key: string]: any; + } + + let { class: className = undefined, ...rest }: Props = $props(); - + diff --git a/src/lib/components/ui/command/command-shortcut.svelte b/src/lib/components/ui/command/command-shortcut.svelte index 2cfcf99c..af485660 100644 --- a/src/lib/components/ui/command/command-shortcut.svelte +++ b/src/lib/components/ui/command/command-shortcut.svelte @@ -4,13 +4,15 @@ type $$Props = HTMLAttributes; - let className: string | undefined | null = undefined; - export { className as class }; + interface Props { + class?: string | undefined | null; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - - + + {@render children?.()} diff --git a/src/lib/components/ui/command/command.svelte b/src/lib/components/ui/command/command.svelte index a5019437..ffbba461 100644 --- a/src/lib/components/ui/command/command.svelte +++ b/src/lib/components/ui/command/command.svelte @@ -4,10 +4,19 @@ type $$Props = CommandPrimitive.CommandProps; - export let value: $$Props['value'] = undefined; + interface Props { + value?: $$Props['value']; + class?: string | undefined | null; + children?: import('svelte').Snippet; + [key: string]: any; + } - let className: string | undefined | null = undefined; - export { className as class }; + let { + value = $bindable(undefined), + class: className = undefined, + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte b/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte index 0cad9a47..8edff2cc 100644 --- a/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte +++ b/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte @@ -6,9 +6,19 @@ type $$Props = ContextMenuPrimitive.CheckboxItemProps; type $$Events = ContextMenuPrimitive.CheckboxItemEvents; - let className: $$Props['class'] = undefined; - export { className as class }; - export let checked: $$Props['checked'] = undefined; + interface Props { + class?: $$Props['class']; + checked?: $$Props['checked']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + checked = $bindable(undefined), + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-content.svelte b/src/lib/components/ui/context-menu/context-menu-content.svelte index 877ab471..af020a84 100644 --- a/src/lib/components/ui/context-menu/context-menu-content.svelte +++ b/src/lib/components/ui/context-menu/context-menu-content.svelte @@ -4,10 +4,21 @@ type $$Props = ContextMenuPrimitive.ContentProps; - let className: $$Props['class'] = undefined; - export let transition: $$Props['transition'] = flyAndScale; - export let transitionConfig: $$Props['transitionConfig'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + transition = flyAndScale, + transitionConfig = undefined, + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-item.svelte b/src/lib/components/ui/context-menu/context-menu-item.svelte index 5d58e091..f1229a39 100644 --- a/src/lib/components/ui/context-menu/context-menu-item.svelte +++ b/src/lib/components/ui/context-menu/context-menu-item.svelte @@ -7,9 +7,14 @@ }; type $$Events = ContextMenuPrimitive.ItemEvents; - let className: $$Props['class'] = undefined; - export let inset: $$Props['inset'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + inset?: $$Props['inset']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, inset = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-label.svelte b/src/lib/components/ui/context-menu/context-menu-label.svelte index 69425327..5c7eb50a 100644 --- a/src/lib/components/ui/context-menu/context-menu-label.svelte +++ b/src/lib/components/ui/context-menu/context-menu-label.svelte @@ -6,14 +6,19 @@ inset?: boolean; }; - let className: $$Props['class'] = undefined; - export let inset: $$Props['inset'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + inset?: $$Props['inset']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, inset = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-radio-group.svelte b/src/lib/components/ui/context-menu/context-menu-radio-group.svelte index caa9154c..00cdadf8 100644 --- a/src/lib/components/ui/context-menu/context-menu-radio-group.svelte +++ b/src/lib/components/ui/context-menu/context-menu-radio-group.svelte @@ -3,9 +3,15 @@ type $$Props = ContextMenuPrimitive.RadioGroupProps; - export let value: $$Props['value'] = undefined; + interface Props { + value?: $$Props['value']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { value = $bindable(undefined), children, ...rest }: Props = $props(); - - + + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-radio-item.svelte b/src/lib/components/ui/context-menu/context-menu-radio-item.svelte index a7ec53fe..c0fb210d 100644 --- a/src/lib/components/ui/context-menu/context-menu-radio-item.svelte +++ b/src/lib/components/ui/context-menu/context-menu-radio-item.svelte @@ -6,9 +6,14 @@ type $$Props = ContextMenuPrimitive.RadioItemProps; type $$Events = ContextMenuPrimitive.RadioItemEvents; - let className: $$Props['class'] = undefined; - export let value: $$Props['value']; - export { className as class }; + interface Props { + class?: $$Props['class']; + value: $$Props['value']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, value, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-separator.svelte b/src/lib/components/ui/context-menu/context-menu-separator.svelte index 5fc6ccc7..7860946e 100644 --- a/src/lib/components/ui/context-menu/context-menu-separator.svelte +++ b/src/lib/components/ui/context-menu/context-menu-separator.svelte @@ -4,11 +4,12 @@ type $$Props = ContextMenuPrimitive.SeparatorProps; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + [key: string]: any; + } + + let { class: className = undefined, ...rest }: Props = $props(); - + diff --git a/src/lib/components/ui/context-menu/context-menu-shortcut.svelte b/src/lib/components/ui/context-menu/context-menu-shortcut.svelte index 8a69353a..b0b51a62 100644 --- a/src/lib/components/ui/context-menu/context-menu-shortcut.svelte +++ b/src/lib/components/ui/context-menu/context-menu-shortcut.svelte @@ -4,13 +4,15 @@ type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - - + + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-sub-content.svelte b/src/lib/components/ui/context-menu/context-menu-sub-content.svelte index 1ffc8ba9..37c204b4 100644 --- a/src/lib/components/ui/context-menu/context-menu-sub-content.svelte +++ b/src/lib/components/ui/context-menu/context-menu-sub-content.svelte @@ -4,10 +4,21 @@ type $$Props = ContextMenuPrimitive.SubContentProps; - let className: $$Props['class'] = undefined; - export let transition: $$Props['transition'] = flyAndScale; - export let transitionConfig: $$Props['transitionConfig'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + transition = flyAndScale, + transitionConfig = undefined, + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte b/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte index fa7aa63a..7fa6a4ba 100644 --- a/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte +++ b/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte @@ -8,9 +8,14 @@ }; type $$Events = ContextMenuPrimitive.SubTriggerEvents; - let className: $$Props['class'] = undefined; - export let inset: $$Props['inset'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + inset?: $$Props['inset']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, inset = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/dialog/dialog-content.svelte b/src/lib/components/ui/dialog/dialog-content.svelte index c4d33959..1431c1a9 100644 --- a/src/lib/components/ui/dialog/dialog-content.svelte +++ b/src/lib/components/ui/dialog/dialog-content.svelte @@ -8,14 +8,25 @@ overlayClass?: DialogPrimitive.OverlayProps['class']; }; - let className: $$Props['class'] = undefined; - export let transition: $$Props['transition'] = flyAndScale; - export let transitionConfig: $$Props['transitionConfig'] = { - duration: 200 - }; - export { className as class }; + interface Props { + class?: $$Props['class']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + overlayClass?: DialogPrimitive.OverlayProps['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } - export let overlayClass: DialogPrimitive.OverlayProps['class'] = undefined; + let { + class: className = undefined, + transition = flyAndScale, + transitionConfig = { + duration: 200 + }, + overlayClass = undefined, + children, + ...rest + }: Props = $props(); @@ -27,9 +38,9 @@ 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:rounded-lg md:w-full', className )} - {...$$restProps} + {...rest} > - + {@render children?.()} diff --git a/src/lib/components/ui/dialog/dialog-description.svelte b/src/lib/components/ui/dialog/dialog-description.svelte index b0eb3a02..a1ec0478 100644 --- a/src/lib/components/ui/dialog/dialog-description.svelte +++ b/src/lib/components/ui/dialog/dialog-description.svelte @@ -4,13 +4,15 @@ type $$Props = DialogPrimitive.DescriptionProps; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - - + + {@render children?.()} diff --git a/src/lib/components/ui/dialog/dialog-footer.svelte b/src/lib/components/ui/dialog/dialog-footer.svelte index 0f5d0b23..820a1f5f 100644 --- a/src/lib/components/ui/dialog/dialog-footer.svelte +++ b/src/lib/components/ui/dialog/dialog-footer.svelte @@ -4,13 +4,18 @@ type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props();
- + {@render children?.()}
diff --git a/src/lib/components/ui/dialog/dialog-header.svelte b/src/lib/components/ui/dialog/dialog-header.svelte index a3e92cd7..abaf7eaf 100644 --- a/src/lib/components/ui/dialog/dialog-header.svelte +++ b/src/lib/components/ui/dialog/dialog-header.svelte @@ -4,10 +4,15 @@ type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); -
- +
+ {@render children?.()}
diff --git a/src/lib/components/ui/dialog/dialog-overlay.svelte b/src/lib/components/ui/dialog/dialog-overlay.svelte index fd819468..06ffc6e6 100644 --- a/src/lib/components/ui/dialog/dialog-overlay.svelte +++ b/src/lib/components/ui/dialog/dialog-overlay.svelte @@ -5,17 +5,26 @@ type $$Props = DialogPrimitive.OverlayProps; - let className: $$Props['class'] = undefined; - export let transition: $$Props['transition'] = fade; - export let transitionConfig: $$Props['transitionConfig'] = { - duration: 150 - }; - export { className as class }; + interface Props { + class?: $$Props['class']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + [key: string]: any; + } + + let { + class: className = undefined, + transition = fade, + transitionConfig = { + duration: 150 + }, + ...rest + }: Props = $props(); diff --git a/src/lib/components/ui/dialog/dialog-portal.svelte b/src/lib/components/ui/dialog/dialog-portal.svelte index e0720dc8..bfac9f62 100644 --- a/src/lib/components/ui/dialog/dialog-portal.svelte +++ b/src/lib/components/ui/dialog/dialog-portal.svelte @@ -1,9 +1,15 @@ - - + + {@render children?.()} diff --git a/src/lib/components/ui/dialog/dialog-title.svelte b/src/lib/components/ui/dialog/dialog-title.svelte index 4997be8d..ed054fbe 100644 --- a/src/lib/components/ui/dialog/dialog-title.svelte +++ b/src/lib/components/ui/dialog/dialog-title.svelte @@ -4,13 +4,18 @@ type $$Props = DialogPrimitive.TitleProps; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/input/input.svelte b/src/lib/components/ui/input/input.svelte index 6bf6059e..b0990857 100644 --- a/src/lib/components/ui/input/input.svelte +++ b/src/lib/components/ui/input/input.svelte @@ -1,4 +1,7 @@ bubble('wheel')]} + {...rest} /> diff --git a/src/lib/components/ui/label/label.svelte b/src/lib/components/ui/label/label.svelte index fdca3934..30581ad1 100644 --- a/src/lib/components/ui/label/label.svelte +++ b/src/lib/components/ui/label/label.svelte @@ -4,8 +4,13 @@ type $$Props = LabelPrimitive.Props; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-checkbox-item.svelte b/src/lib/components/ui/menubar/menubar-checkbox-item.svelte index 194f6efc..65499d16 100644 --- a/src/lib/components/ui/menubar/menubar-checkbox-item.svelte +++ b/src/lib/components/ui/menubar/menubar-checkbox-item.svelte @@ -4,9 +4,20 @@ import { cn } from '@/utils'; type $$Props = MenubarPrimitive.CheckboxItemProps; - let className: $$Props['class'] = undefined; - export { className as class }; - export let checked: $$Props['checked'] = undefined; + + interface Props { + class?: $$Props['class']; + checked?: $$Props['checked']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + checked = $bindable(undefined), + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-content.svelte b/src/lib/components/ui/menubar/menubar-content.svelte index 1473e5a7..0c1a6b49 100644 --- a/src/lib/components/ui/menubar/menubar-content.svelte +++ b/src/lib/components/ui/menubar/menubar-content.svelte @@ -3,13 +3,27 @@ import { cn, flyAndScale } from '@/utils'; type $$Props = MenubarPrimitive.ContentProps; - let className: $$Props['class'] = undefined; - export let align: $$Props['align'] = 'start'; - export let alignOffset: $$Props['alignOffset'] = -4; - export let sideOffset: $$Props['sideOffset'] = 8; - export let transition: $$Props['transition'] = flyAndScale; - export let transitionConfig: $$Props['transitionConfig'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + align?: $$Props['align']; + alignOffset?: $$Props['alignOffset']; + sideOffset?: $$Props['sideOffset']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + align = 'start', + alignOffset = -4, + sideOffset = 8, + transition = flyAndScale, + transitionConfig = undefined, + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-item.svelte b/src/lib/components/ui/menubar/menubar-item.svelte index d73a817b..7195b3fc 100644 --- a/src/lib/components/ui/menubar/menubar-item.svelte +++ b/src/lib/components/ui/menubar/menubar-item.svelte @@ -7,9 +7,14 @@ }; type $$Events = MenubarPrimitive.ItemEvents; - let className: $$Props['class'] = undefined; - export let inset: $$Props['inset'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + inset?: $$Props['inset']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, inset = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-label.svelte b/src/lib/components/ui/menubar/menubar-label.svelte index a5e3de8a..37f24e9e 100644 --- a/src/lib/components/ui/menubar/menubar-label.svelte +++ b/src/lib/components/ui/menubar/menubar-label.svelte @@ -5,14 +5,19 @@ type $$Props = MenubarPrimitive.LabelProps & { inset?: boolean; }; - let className: $$Props['class'] = undefined; - export let inset: $$Props['inset'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + inset?: $$Props['inset']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, inset = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-radio-item.svelte b/src/lib/components/ui/menubar/menubar-radio-item.svelte index 1ca53d27..69b8a1d7 100644 --- a/src/lib/components/ui/menubar/menubar-radio-item.svelte +++ b/src/lib/components/ui/menubar/menubar-radio-item.svelte @@ -5,9 +5,14 @@ type $$Props = MenubarPrimitive.RadioItemProps; type $$Events = MenubarPrimitive.RadioItemEvents; - let className: $$Props['class'] = undefined; - export let value: $$Props['value']; - export { className as class }; + interface Props { + class?: $$Props['class']; + value: $$Props['value']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, value, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-separator.svelte b/src/lib/components/ui/menubar/menubar-separator.svelte index 3814821b..1fdc55b6 100644 --- a/src/lib/components/ui/menubar/menubar-separator.svelte +++ b/src/lib/components/ui/menubar/menubar-separator.svelte @@ -3,8 +3,12 @@ import { cn } from '@/utils'; type $$Props = MenubarPrimitive.SeparatorProps; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + [key: string]: any; + } + + let { class: className = undefined, ...rest }: Props = $props(); - + diff --git a/src/lib/components/ui/menubar/menubar-shortcut.svelte b/src/lib/components/ui/menubar/menubar-shortcut.svelte index b76384ea..eaca691e 100644 --- a/src/lib/components/ui/menubar/menubar-shortcut.svelte +++ b/src/lib/components/ui/menubar/menubar-shortcut.svelte @@ -3,13 +3,15 @@ import { cn } from '@/utils'; type $$Props = HTMLAttributes; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - - + + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-sub-content.svelte b/src/lib/components/ui/menubar/menubar-sub-content.svelte index 833cd3cd..c8af3472 100644 --- a/src/lib/components/ui/menubar/menubar-sub-content.svelte +++ b/src/lib/components/ui/menubar/menubar-sub-content.svelte @@ -3,13 +3,24 @@ import { cn, flyAndScale } from '@/utils'; type $$Props = MenubarPrimitive.SubContentProps; - let className: $$Props['class'] = undefined; - export let transition: $$Props['transition'] = flyAndScale; - export let transitionConfig: $$Props['transitionConfig'] = { - x: -10, - y: 0 - }; - export { className as class }; + interface Props { + class?: $$Props['class']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + transition = flyAndScale, + transitionConfig = { + x: -10, + y: 0 + }, + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-sub-trigger.svelte b/src/lib/components/ui/menubar/menubar-sub-trigger.svelte index d035e9a4..5150fccc 100644 --- a/src/lib/components/ui/menubar/menubar-sub-trigger.svelte +++ b/src/lib/components/ui/menubar/menubar-sub-trigger.svelte @@ -8,9 +8,14 @@ }; type $$Events = MenubarPrimitive.SubTriggerEvents; - let className: $$Props['class'] = undefined; - export let inset: $$Props['inset'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + inset?: $$Props['inset']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, inset = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-trigger.svelte b/src/lib/components/ui/menubar/menubar-trigger.svelte index 9dfada70..dca80b1c 100644 --- a/src/lib/components/ui/menubar/menubar-trigger.svelte +++ b/src/lib/components/ui/menubar/menubar-trigger.svelte @@ -5,8 +5,13 @@ type $$Props = MenubarPrimitive.TriggerProps; type $$Events = MenubarPrimitive.TriggerEvents; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar.svelte b/src/lib/components/ui/menubar/menubar.svelte index 05625633..cd1e8b60 100644 --- a/src/lib/components/ui/menubar/menubar.svelte +++ b/src/lib/components/ui/menubar/menubar.svelte @@ -4,8 +4,12 @@ type $$Props = MenubarPrimitive.Props; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + } + + let { class: className = undefined, children }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/popover/popover-content.svelte b/src/lib/components/ui/popover/popover-content.svelte index 0fff1bbd..c3640a13 100644 --- a/src/lib/components/ui/popover/popover-content.svelte +++ b/src/lib/components/ui/popover/popover-content.svelte @@ -4,12 +4,26 @@ type $$Props = PopoverPrimitive.ContentProps; - let className: $$Props['class'] = undefined; - export let transition: $$Props['transition'] = flyAndScale; - export let transitionConfig: $$Props['transitionConfig'] = undefined; - export let align: $$Props['align'] = 'center'; - export let sideOffset: $$Props['sideOffset'] = 4; - export { className as class }; + interface Props { + class?: $$Props['class']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + align?: $$Props['align']; + sideOffset?: $$Props['sideOffset']; + children?: import('svelte').Snippet; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; + } + + let { + class: className = undefined, + transition = flyAndScale, + transitionConfig = undefined, + align = 'center', + sideOffset = 4, + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/separator/separator.svelte b/src/lib/components/ui/separator/separator.svelte index e4455d7e..3f666364 100644 --- a/src/lib/components/ui/separator/separator.svelte +++ b/src/lib/components/ui/separator/separator.svelte @@ -4,10 +4,19 @@ type $$Props = SeparatorPrimitive.Props; - let className: $$Props['class'] = undefined; - export let orientation: $$Props['orientation'] = 'horizontal'; - export let decorative: $$Props['decorative'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + orientation?: $$Props['orientation']; + decorative?: $$Props['decorative']; + [key: string]: any; + } + + let { + class: className = undefined, + orientation = 'horizontal', + decorative = undefined, + ...rest + }: Props = $props(); diff --git a/src/lib/components/ui/sonner/sonner.svelte b/src/lib/components/ui/sonner/sonner.svelte index 67dc9ce9..0ba223e7 100644 --- a/src/lib/components/ui/sonner/sonner.svelte +++ b/src/lib/components/ui/sonner/sonner.svelte @@ -1,6 +1,11 @@ @@ -17,5 +22,5 @@ cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground' } }} - {...$$restProps} + {...rest} /> diff --git a/src/lib/components/ui/tabs/tabs-content.svelte b/src/lib/components/ui/tabs/tabs-content.svelte index cee124af..356d081c 100644 --- a/src/lib/components/ui/tabs/tabs-content.svelte +++ b/src/lib/components/ui/tabs/tabs-content.svelte @@ -4,9 +4,14 @@ type $$Props = TabsPrimitive.ContentProps; - let className: $$Props['class'] = undefined; - export let value: $$Props['value']; - export { className as class }; + interface Props { + class?: $$Props['class']; + value: $$Props['value']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, value, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/tabs/tabs-list.svelte b/src/lib/components/ui/tabs/tabs-list.svelte index 621318c0..135dbd92 100644 --- a/src/lib/components/ui/tabs/tabs-list.svelte +++ b/src/lib/components/ui/tabs/tabs-list.svelte @@ -4,8 +4,13 @@ type $$Props = TabsPrimitive.ListProps; - let className: $$Props['class'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/tabs/tabs-trigger.svelte b/src/lib/components/ui/tabs/tabs-trigger.svelte index c65ad2e9..dda35d42 100644 --- a/src/lib/components/ui/tabs/tabs-trigger.svelte +++ b/src/lib/components/ui/tabs/tabs-trigger.svelte @@ -5,9 +5,14 @@ type $$Props = TabsPrimitive.TriggerProps; type $$Events = TabsPrimitive.TriggerEvents; - let className: $$Props['class'] = undefined; - export let value: $$Props['value']; - export { className as class }; + interface Props { + class?: $$Props['class']; + value: $$Props['value']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { class: className = undefined, value, children, ...rest }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/toggle/toggle.svelte b/src/lib/components/ui/toggle/toggle.svelte index eb4c15c6..f8c1400b 100644 --- a/src/lib/components/ui/toggle/toggle.svelte +++ b/src/lib/components/ui/toggle/toggle.svelte @@ -9,19 +9,31 @@ }; type $$Events = TogglePrimitive.Events; - let className: $$Props['class'] = undefined; - export let variant: $$Props['variant'] = 'default'; - export let size: $$Props['size'] = 'default'; - export let pressed: $$Props['pressed'] = undefined; - export { className as class }; + interface Props { + class?: $$Props['class']; + variant?: $$Props['variant']; + size?: $$Props['size']; + pressed?: $$Props['pressed']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + variant = 'default', + size = 'default', + pressed = $bindable(undefined), + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/lib/components/ui/tooltip/tooltip-content.svelte b/src/lib/components/ui/tooltip/tooltip-content.svelte index c6a588a8..caedb8b0 100644 --- a/src/lib/components/ui/tooltip/tooltip-content.svelte +++ b/src/lib/components/ui/tooltip/tooltip-content.svelte @@ -4,14 +4,26 @@ type $$Props = TooltipPrimitive.ContentProps; - let className: $$Props['class'] = undefined; - export let sideOffset: $$Props['sideOffset'] = 4; - export let transition: $$Props['transition'] = flyAndScale; - export let transitionConfig: $$Props['transitionConfig'] = { - y: 8, - duration: 150 - }; - export { className as class }; + interface Props { + class?: $$Props['class']; + sideOffset?: $$Props['sideOffset']; + transition?: $$Props['transition']; + transitionConfig?: $$Props['transitionConfig']; + children?: import('svelte').Snippet; + [key: string]: any; + } + + let { + class: className = undefined, + sideOffset = 4, + transition = flyAndScale, + transitionConfig = { + y: 8, + duration: 150 + }, + children, + ...rest + }: Props = $props(); - + {@render children?.()} diff --git a/src/main.ts b/src/main.ts index e64e8ee9..6f60f266 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,9 @@ import './app.css'; import './assets/css/fonts.css'; import App from './App.svelte'; +import { mount } from 'svelte'; -const app = new App({ +const app = mount(App, { target: document.getElementById('app')! }); From 0eab892362a0f84234a8fb47fdf9ddd469abb451 Mon Sep 17 00:00:00 2001 From: Muhammed-Rahif Date: Sun, 24 Nov 2024 22:29:02 +0530 Subject: [PATCH 2/7] fix(svelte): svelte 5 `run` replaced using `effect` --- src/lib/components/Editor/Editor.svelte | 58 +++++++++++++------------ src/lib/components/FindDialog.svelte | 4 +- src/lib/components/GoToDialog.svelte | 4 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/lib/components/Editor/Editor.svelte b/src/lib/components/Editor/Editor.svelte index 8c3427ec..733c3d8c 100644 --- a/src/lib/components/Editor/Editor.svelte +++ b/src/lib/components/Editor/Editor.svelte @@ -1,7 +1,5 @@ From f86a8f255c5086488e50742cd58d61923ed1de85 Mon Sep 17 00:00:00 2001 From: Muhammed-Rahif Date: Sun, 24 Nov 2024 23:14:39 +0530 Subject: [PATCH 3/7] chore(shadcn): migration of svelte-shadcn WIP --- components.json | 9 +- package.json | 6 +- pnpm-lock.yaml | 120 +++++++++--------- src/lib/components/AboutDialog.svelte | 6 +- src/lib/components/EditorTabs.svelte | 14 +- src/lib/components/EditorTitle.svelte | 90 +++++++------ src/lib/components/FindDialog.svelte | 10 +- src/lib/components/GoToDialog.svelte | 2 +- src/lib/components/LicenseDialog.svelte | 2 +- src/lib/components/MenuBar.svelte | 50 ++++---- .../components/font-dialog/FontDialog.svelte | 6 +- src/lib/components/ui/badge/badge.svelte | 48 ++++--- src/lib/components/ui/badge/index.ts | 20 +-- src/lib/components/ui/button/button.svelte | 89 ++++++++----- src/lib/components/ui/button/index.ts | 54 ++------ .../components/ui/card/card-content.svelte | 19 ++- .../ui/card/card-description.svelte | 19 ++- src/lib/components/ui/card/card-footer.svelte | 19 ++- src/lib/components/ui/card/card-header.svelte | 19 ++- src/lib/components/ui/card/card-title.svelte | 34 +++-- src/lib/components/ui/card/card.svelte | 29 ++--- src/lib/components/ui/card/index.ts | 2 - .../components/ui/checkbox/checkbox.svelte | 45 +++---- .../ui/command/command-dialog.svelte | 46 +++---- .../ui/command/command-empty.svelte | 22 ++-- .../ui/command/command-group.svelte | 37 +++--- .../ui/command/command-input.svelte | 29 ++--- .../components/ui/command/command-item.svelte | 36 ++---- .../ui/command/command-link-item.svelte | 19 +++ .../components/ui/command/command-list.svelte | 25 ++-- .../ui/command/command-separator.svelte | 19 ++- .../ui/command/command-shortcut.svelte | 25 ++-- src/lib/components/ui/command/command.svelte | 31 ++--- src/lib/components/ui/command/index.ts | 7 +- .../context-menu-checkbox-item.svelte | 58 ++++----- .../context-menu/context-menu-content.svelte | 48 +++---- .../context-menu-group-heading.svelte | 19 +++ .../ui/context-menu/context-menu-item.svelte | 34 ++--- .../ui/context-menu/context-menu-label.svelte | 25 ---- .../context-menu-radio-group.svelte | 18 --- .../context-menu-radio-item.svelte | 47 +++---- .../context-menu-separator.svelte | 20 +-- .../context-menu/context-menu-shortcut.svelte | 23 ++-- .../context-menu-sub-content.svelte | 35 ++--- .../context-menu-sub-trigger.svelte | 36 ++---- src/lib/components/ui/context-menu/index.ts | 16 +-- .../ui/dialog/dialog-content.svelte | 52 +++----- .../ui/dialog/dialog-description.svelte | 25 ++-- .../components/ui/dialog/dialog-footer.svelte | 22 ++-- .../components/ui/dialog/dialog-header.svelte | 25 ++-- .../ui/dialog/dialog-overlay.svelte | 34 ++--- .../components/ui/dialog/dialog-portal.svelte | 16 --- .../components/ui/dialog/dialog-title.svelte | 24 ++-- src/lib/components/ui/dialog/index.ts | 8 +- src/lib/components/ui/input/index.ts | 22 ---- src/lib/components/ui/input/input.svelte | 49 ++----- src/lib/components/ui/label/label.svelte | 24 ++-- src/lib/components/ui/menubar/index.ts | 7 +- .../ui/menubar/menubar-checkbox-item.svelte | 62 ++++----- .../ui/menubar/menubar-content.svelte | 61 ++++----- .../ui/menubar/menubar-group-heading.svelte | 19 +++ .../components/ui/menubar/menubar-item.svelte | 36 ++---- .../ui/menubar/menubar-label.svelte | 24 ---- .../ui/menubar/menubar-radio-item.svelte | 51 +++----- .../ui/menubar/menubar-separator.svelte | 21 +-- .../ui/menubar/menubar-shortcut.svelte | 24 ++-- .../ui/menubar/menubar-sub-content.svelte | 34 ++--- .../ui/menubar/menubar-sub-trigger.svelte | 36 ++---- .../ui/menubar/menubar-trigger.svelte | 28 ++-- src/lib/components/ui/menubar/menubar.svelte | 21 ++- .../ui/popover/popover-content.svelte | 53 +++----- .../components/ui/separator/separator.svelte | 24 +--- src/lib/components/ui/skeleton/index.ts | 7 + .../components/ui/skeleton/skeleton.svelte | 17 +++ src/lib/components/ui/sonner/sonner.svelte | 10 +- .../components/ui/tabs/tabs-content.svelte | 28 ++-- src/lib/components/ui/tabs/tabs-list.svelte | 22 +--- .../components/ui/tabs/tabs-trigger.svelte | 30 ++--- src/lib/components/ui/toggle/index.ts | 30 +---- src/lib/components/ui/toggle/toggle.svelte | 69 +++++----- src/lib/components/ui/tooltip/index.ts | 5 +- .../ui/tooltip/tooltip-content.svelte | 38 ++---- src/lib/utils.ts | 50 -------- tailwind.config.ts | 29 ++++- 84 files changed, 1050 insertions(+), 1474 deletions(-) create mode 100644 src/lib/components/ui/command/command-link-item.svelte create mode 100644 src/lib/components/ui/context-menu/context-menu-group-heading.svelte delete mode 100644 src/lib/components/ui/context-menu/context-menu-label.svelte delete mode 100644 src/lib/components/ui/context-menu/context-menu-radio-group.svelte delete mode 100644 src/lib/components/ui/dialog/dialog-portal.svelte create mode 100644 src/lib/components/ui/menubar/menubar-group-heading.svelte delete mode 100644 src/lib/components/ui/menubar/menubar-label.svelte create mode 100644 src/lib/components/ui/skeleton/index.ts create mode 100644 src/lib/components/ui/skeleton/skeleton.svelte diff --git a/components.json b/components.json index 995fadeb..7114db52 100644 --- a/components.json +++ b/components.json @@ -1,5 +1,5 @@ { - "$schema": "https://shadcn-svelte.com/schema.json", + "$schema": "https://next.shadcn-svelte.com/schema.json", "style": "new-york", "tailwind": { "config": "tailwind.config.ts", @@ -8,7 +8,10 @@ }, "aliases": { "components": "@/components", - "utils": "@/utils" + "utils": "@/utils", + "ui": "@/components/ui", + "hooks": "@/hooks" }, - "typescript": true + "typescript": true, + "registry": "https://next.shadcn-svelte.com/registry" } diff --git a/package.json b/package.json index 5a0d777c..6792eb9f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@types/wicg-file-system-access": "^2023.10.5", "@vite-pwa/assets-generator": "^0.2.6", "autoprefixer": "^10.4.20", - "bits-ui": "^0.21.16", + "bits-ui": "1.0.0-next.64", "eslint": "^9.12.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.45.1", @@ -64,7 +64,6 @@ "@tauri-apps/plugin-shell": "^2.0.1", "caret-pos": "^2.0.0", "clsx": "^2.1.1", - "cmdk-sv": "^0.0.18", "localforage": "^1.10.0", "lodash.debounce": "^4.0.8", "lodash.merge": "^4.6.2", @@ -78,6 +77,7 @@ "svelte-sonner": "^0.3.28", "tailwind-merge": "^2.5.4", "tailwind-scrollbar": "^3.1.0", - "tailwind-variants": "^0.2.1" + "tailwind-variants": "^0.2.1", + "tailwindcss-animate": "^1.0.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ffb8c2ba..b968233f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,9 +29,6 @@ importers: clsx: specifier: ^2.1.1 version: 2.1.1 - cmdk-sv: - specifier: ^0.0.18 - version: 0.0.18(svelte@5.2.7) localforage: specifier: ^1.10.0 version: 1.10.0 @@ -74,6 +71,9 @@ importers: tailwind-variants: specifier: ^0.2.1 version: 0.2.1(tailwindcss@3.4.15) + tailwindcss-animate: + specifier: ^1.0.7 + version: 1.0.7(tailwindcss@3.4.15) devDependencies: '@semantic-release/changelog': specifier: ^6.0.3 @@ -121,8 +121,8 @@ importers: specifier: ^10.4.20 version: 10.4.20(postcss@8.4.49) bits-ui: - specifier: ^0.21.16 - version: 0.21.16(svelte@5.2.7) + specifier: 1.0.0-next.64 + version: 1.0.0-next.64(svelte@5.2.7) eslint: specifier: ^9.12.0 version: 9.15.0(jiti@1.21.6) @@ -932,11 +932,6 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@melt-ui/svelte@0.76.2': - resolution: {integrity: sha512-7SbOa11tXUS95T3fReL+dwDs5FyJtCEqrqG3inRziDws346SYLsxOQ6HmX+4BkIsQh1R8U3XNa+EMmdMt38lMA==} - peerDependencies: - svelte: '>=3 <5' - '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1598,10 +1593,11 @@ packages: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} - bits-ui@0.21.16: - resolution: {integrity: sha512-XFZ7/bK7j/K+5iktxX/ZpmoFHjYjpPzP5EOO/4bWiaFg5TG1iMcfjDhlBTQnJxD6BoVoHuqeZPHZvaTgF4Iv3Q==} + bits-ui@1.0.0-next.64: + resolution: {integrity: sha512-r1JThjUSKwTkaB1onwIs7ZQoqygSsWhjBaUElCS8m8CCbY1RxmTz0HnbN+Xp2oJgJ4YQgIfiXTG3170l80FEgg==} + engines: {node: '>=18', pnpm: '>=8.7.0'} peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.118 + svelte: ^5.0.0-next.1 bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -1707,11 +1703,6 @@ packages: resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} engines: {node: '>=6'} - cmdk-sv@0.0.18: - resolution: {integrity: sha512-istixiQSy9Ez/mQ4VXWB69btqNyDZckbd1XFEwR46Vw+n5zjdmvoWAcOTj0uX3FZXtw9ikwLVmfoW2nwwMClRg==} - peerDependencies: - svelte: ^4.0.0 || ^5.0.0-next.1 - color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -1878,10 +1869,6 @@ packages: defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} - dequal@2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} - detect-libc@2.0.3: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} @@ -2183,9 +2170,6 @@ packages: flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - focus-trap@7.6.1: - resolution: {integrity: sha512-nB8y4nQl8PshahLpGKZOq1sb0xrMVFSn6at7u/qOsBZTlZRzaapISGENcB6mOkoezbClZyiMwEF/dGY8AZ00rA==} - for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -2453,6 +2437,9 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + inline-style-parser@0.2.4: + resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==} + internal-slot@1.0.7: resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} engines: {node: '>= 0.4'} @@ -2850,11 +2837,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - nanoid@5.0.8: - resolution: {integrity: sha512-TcJPw+9RV9dibz1hHUzlLVy8N4X9TnwirAjrU08Juo6BNKggzVfP2ZJ/3ZUSq15Xl5i85i+Z89XBO90pB2PghQ==} - engines: {node: ^18 || >=20} - hasBin: true - napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} @@ -3468,6 +3450,11 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + runed@0.15.3: + resolution: {integrity: sha512-HtayB+loDcGdqJDHW8JFdsZzGQMyVzim6+s3052MkjZnwmwDstmF+cusMeTssBe6TCdt5i9D/Tb+KYXN3L0kXA==} + peerDependencies: + svelte: ^5.0.0-next.1 + sade@1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} @@ -3697,6 +3684,9 @@ packages: resolution: {integrity: sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==} engines: {node: '>=0.10.0'} + style-to-object@1.0.8: + resolution: {integrity: sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==} + sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} @@ -3752,13 +3742,16 @@ packages: peerDependencies: svelte: ^3.0.0 || ^4.0.0 || ^5.0.0-next.1 + svelte-toolbelt@0.4.6: + resolution: {integrity: sha512-k8OUvXBUifHZcAlWeY/HLg/4J0v5m2iOfOhn8fDmjt4AP8ZluaDh9eBFus9lFiLX6O5l6vKqI1dKL5wy7090NQ==} + engines: {node: '>=18', pnpm: '>=8.7.0'} + peerDependencies: + svelte: ^5.0.0-next.126 + svelte@5.2.7: resolution: {integrity: sha512-cEhPGuLHiH2+Z8B1FwQgiZJgA39uUmJR4516TKrM5zrp0/cuwJkfhUfcTxhAkznanAF5fXUKzvYR4o+Ksx3ZCQ==} engines: {node: '>=18'} - tabbable@6.2.0: - resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} - tailwind-merge@2.5.4: resolution: {integrity: sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==} @@ -3774,6 +3767,11 @@ packages: peerDependencies: tailwindcss: '*' + tailwindcss-animate@1.0.7: + resolution: {integrity: sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==} + peerDependencies: + tailwindcss: '>=3.0.0 || insiders' + tailwindcss@3.4.15: resolution: {integrity: sha512-r4MeXnfBmSOuKUWmXe6h2CcyfzJCEk4F0pptO5jlnYSIViUkVmsawj80N5h2lO3gwcmSb4n3PuN+e+GC1Guylw==} engines: {node: '>=14.0.0'} @@ -5032,16 +5030,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@melt-ui/svelte@0.76.2(svelte@5.2.7)': - dependencies: - '@floating-ui/core': 1.6.8 - '@floating-ui/dom': 1.6.12 - '@internationalized/date': 3.5.6 - dequal: 2.0.3 - focus-trap: 7.6.1 - nanoid: 5.0.8 - svelte: 5.2.7 - '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -5744,12 +5732,15 @@ snapshots: binary-extensions@2.3.0: {} - bits-ui@0.21.16(svelte@5.2.7): + bits-ui@1.0.0-next.64(svelte@5.2.7): dependencies: + '@floating-ui/core': 1.6.8 + '@floating-ui/dom': 1.6.12 '@internationalized/date': 3.5.6 - '@melt-ui/svelte': 0.76.2(svelte@5.2.7) - nanoid: 5.0.8 + esm-env: 1.1.4 + runed: 0.15.3(svelte@5.2.7) svelte: 5.2.7 + svelte-toolbelt: 0.4.6(svelte@5.2.7) bl@4.1.0: dependencies: @@ -5872,12 +5863,6 @@ snapshots: clsx@2.1.1: {} - cmdk-sv@0.0.18(svelte@5.2.7): - dependencies: - bits-ui: 0.21.16(svelte@5.2.7) - nanoid: 5.0.8 - svelte: 5.2.7 - color-convert@1.9.3: dependencies: color-name: 1.1.3 @@ -6034,8 +6019,6 @@ snapshots: defu@6.1.4: {} - dequal@2.0.3: {} - detect-libc@2.0.3: {} didyoumean@1.2.2: {} @@ -6443,10 +6426,6 @@ snapshots: flatted@3.3.1: {} - focus-trap@7.6.1: - dependencies: - tabbable: 6.2.0 - for-each@0.3.3: dependencies: is-callable: 1.2.7 @@ -6717,6 +6696,8 @@ snapshots: ini@1.3.8: {} + inline-style-parser@0.2.4: {} + internal-slot@1.0.7: dependencies: es-errors: 1.3.0 @@ -7051,8 +7032,6 @@ snapshots: nanoid@3.3.7: {} - nanoid@5.0.8: {} - napi-build-utils@1.0.2: {} natural-compare@1.4.0: {} @@ -7524,6 +7503,11 @@ snapshots: dependencies: queue-microtask: 1.2.3 + runed@0.15.3(svelte@5.2.7): + dependencies: + esm-env: 1.1.4 + svelte: 5.2.7 + sade@1.8.1: dependencies: mri: 1.2.0 @@ -7813,6 +7797,10 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 + style-to-object@1.0.8: + dependencies: + inline-style-parser: 0.2.4 + sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.5 @@ -7875,6 +7863,12 @@ snapshots: dependencies: svelte: 5.2.7 + svelte-toolbelt@0.4.6(svelte@5.2.7): + dependencies: + clsx: 2.1.1 + style-to-object: 1.0.8 + svelte: 5.2.7 + svelte@5.2.7: dependencies: '@ampproject/remapping': 2.3.0 @@ -7891,8 +7885,6 @@ snapshots: magic-string: 0.30.12 zimmerframe: 1.1.2 - tabbable@6.2.0: {} - tailwind-merge@2.5.4: {} tailwind-scrollbar@3.1.0(tailwindcss@3.4.15): @@ -7904,6 +7896,10 @@ snapshots: tailwind-merge: 2.5.4 tailwindcss: 3.4.15 + tailwindcss-animate@1.0.7(tailwindcss@3.4.15): + dependencies: + tailwindcss: 3.4.15 + tailwindcss@3.4.15: dependencies: '@alloc/quick-lru': 5.2.0 diff --git a/src/lib/components/AboutDialog.svelte b/src/lib/components/AboutDialog.svelte index 561f8370..2908f0a6 100644 --- a/src/lib/components/AboutDialog.svelte +++ b/src/lib/components/AboutDialog.svelte @@ -120,19 +120,19 @@ - - + diff --git a/src/lib/components/EditorTabs.svelte b/src/lib/components/EditorTabs.svelte index 1d303837..2f334570 100644 --- a/src/lib/components/EditorTabs.svelte +++ b/src/lib/components/EditorTabs.svelte @@ -55,28 +55,28 @@ - Notpad.editOptions.undo()}> + Notpad.editOptions.undo()}> UndoCtrl+Z - Notpad.editOptions.redo()}> + Notpad.editOptions.redo()}> RedoCtrl+Y - Notpad.editOptions.cut()}> + Notpad.editOptions.cut()}> CutCtrl+X - Notpad.editOptions.copy()}> + Notpad.editOptions.copy()}> CopyCtrl+C - Notpad.editOptions.paste()}> + Notpad.editOptions.paste()}> PasteCtrl+V - Notpad.editOptions.selectAll()}> + Notpad.editOptions.selectAll()}> Select All Ctrl+A - Notpad.editOptions.insertDateAndTime()}> + Notpad.editOptions.insertDateAndTime()}> Time/Date diff --git a/src/lib/components/EditorTitle.svelte b/src/lib/components/EditorTitle.svelte index 41156d3a..926ab8f9 100644 --- a/src/lib/components/EditorTitle.svelte +++ b/src/lib/components/EditorTitle.svelte @@ -11,6 +11,7 @@ import CloseIcon from '@/components/icons/Close.svelte'; import Button from '@/components/ui/button/button.svelte'; import type { EditorType } from '@/src/lib/types/EditorTypes'; + import { cn } from '@/utils'; interface Props { editor: EditorType; @@ -53,53 +54,58 @@ readonly = true; } - function onEditorClose(e: ButtonEventHandler, id: string) { - e.preventDefault(); - e.stopPropagation(); - Notpad.editors.remove(id); + function onEditorClose(id: string) { + return (e: ButtonEventHandler) => { + e.preventDefault(); + e.stopPropagation(); + Notpad.editors.remove(id); + }; } - - -
-
- - -
- -
-
- {#if editor.filePath} - - {editor.filePath} - - {/if} -
+ + + +
+ + {#if editor.filePath} + + {editor.filePath} + + {/if} + + diff --git a/src/lib/components/FindDialog.svelte b/src/lib/components/FindDialog.svelte index 5dd84cd0..17d0221b 100644 --- a/src/lib/components/FindDialog.svelte +++ b/src/lib/components/FindDialog.svelte @@ -56,7 +56,7 @@ class="rounded-r-none border-secondary !ring-0" />
- + diff --git a/src/lib/components/LicenseDialog.svelte b/src/lib/components/LicenseDialog.svelte index 4b9c66b1..660d1928 100644 --- a/src/lib/components/LicenseDialog.svelte +++ b/src/lib/components/LicenseDialog.svelte @@ -58,7 +58,7 @@ SOFTWARE.`); {/each} - + diff --git a/src/lib/components/MenuBar.svelte b/src/lib/components/MenuBar.svelte index bb3f7465..597d7dcc 100644 --- a/src/lib/components/MenuBar.svelte +++ b/src/lib/components/MenuBar.svelte @@ -34,68 +34,68 @@ File - Notpad.editors.createNew()}> + Notpad.editors.createNew()}> New{isTauri ? 'Ctrl+N' : 'Ctrl+Alt+N'} - + Open...Ctrl+O - Notpad.fileOptions.save()}> + Notpad.fileOptions.save()}> SaveCtrl+S - Notpad.fileOptions.save({ saveAs: true })}> + Notpad.fileOptions.save({ saveAs: true })}> Save as... - Notpad.fileOptions.print()}> + Notpad.fileOptions.print()}> PrintCtrl+P - Exit + Exit Edit - Notpad.editOptions.undo()}> + Notpad.editOptions.undo()}> UndoCtrl+Z - Notpad.editOptions.redo()}> + Notpad.editOptions.redo()}> RedoCtrl+Y - Notpad.editOptions.cut()}> + Notpad.editOptions.cut()}> CutCtrl+X - Notpad.editOptions.copy()}> + Notpad.editOptions.copy()}> CopyCtrl+C - Notpad.editOptions.paste()}> + Notpad.editOptions.paste()}> PasteCtrl+V - Notpad.editOptions.selectAll()}> + Notpad.editOptions.selectAll()}> Select All Ctrl+A - Notpad.editOptions.insertDateAndTime()}>Time/Date + Notpad.editOptions.insertDateAndTime()}>Time/Date - Font + Font Search - Notpad.searchOptions.searchOnWeb()}> + Notpad.searchOptions.searchOnWeb()}> Search on Google - + Find/ReplaceCtrl+F - + Go ToCtrl+G @@ -107,36 +107,36 @@ Zoom - Notpad.viewOptions.zoom('in')}> + Notpad.viewOptions.zoom('in')}> Zoom InCtrl+Plus - Notpad.viewOptions.zoom('out')}> + Notpad.viewOptions.zoom('out')}> Zoom OutCtrl+Minus - Notpad.viewOptions.zoom('reset')}> + Notpad.viewOptions.zoom('reset')}> Reset ZoomCtrl+0 - screenfull.toggle()}> + screenfull.toggle()}> Full Screen F11 Status Bar Line Numbers - + Dark Mode @@ -151,7 +151,7 @@ Github - + About Notpad diff --git a/src/lib/components/font-dialog/FontDialog.svelte b/src/lib/components/font-dialog/FontDialog.svelte index ef06278d..cc1cd851 100644 --- a/src/lib/components/font-dialog/FontDialog.svelte +++ b/src/lib/components/font-dialog/FontDialog.svelte @@ -62,11 +62,11 @@ - - - + + diff --git a/src/lib/components/ui/badge/badge.svelte b/src/lib/components/ui/badge/badge.svelte index 4c326ffa..405f7134 100644 --- a/src/lib/components/ui/badge/badge.svelte +++ b/src/lib/components/ui/badge/badge.svelte @@ -1,30 +1,48 @@ + + {@render children?.()} diff --git a/src/lib/components/ui/badge/index.ts b/src/lib/components/ui/badge/index.ts index d9e3f2e6..f05fb87f 100644 --- a/src/lib/components/ui/badge/index.ts +++ b/src/lib/components/ui/badge/index.ts @@ -1,20 +1,2 @@ -import { type VariantProps, tv } from 'tailwind-variants'; - export { default as Badge } from './badge.svelte'; -export const badgeVariants = tv({ - base: 'focus:ring-ring inline-flex select-none items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2', - variants: { - variant: { - default: 'bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow', - secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent', - destructive: - 'bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow', - outline: 'text-foreground' - } - }, - defaultVariants: { - variant: 'default' - } -}); - -export type Variant = VariantProps['variant']; +export { badgeVariants, type BadgeVariant } from './badge.svelte'; diff --git a/src/lib/components/ui/button/button.svelte b/src/lib/components/ui/button/button.svelte index 3969737c..90c90d52 100644 --- a/src/lib/components/ui/button/button.svelte +++ b/src/lib/components/ui/button/button.svelte @@ -1,38 +1,69 @@ - + + - - {@render children?.()} - +{#if href} + + {@render children?.()} + +{:else} + +{/if} diff --git a/src/lib/components/ui/button/index.ts b/src/lib/components/ui/button/index.ts index 41b6d2c6..7fe4a81e 100644 --- a/src/lib/components/ui/button/index.ts +++ b/src/lib/components/ui/button/index.ts @@ -1,49 +1,17 @@ -import type { Button as ButtonPrimitive } from 'bits-ui'; -import { type VariantProps, tv } from 'tailwind-variants'; -import Root from './button.svelte'; - -const buttonVariants = tv({ - base: 'focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50', - variants: { - variant: { - default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow', - destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm', - outline: - 'border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm', - secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm', - ghost: 'hover:bg-accent hover:text-accent-foreground', - link: 'text-primary underline-offset-4 hover:underline' - }, - size: { - default: 'h-9 px-4 py-2', - sm: 'h-8 rounded-md px-3 text-xs', - lg: 'h-10 rounded-md px-8', - icon: 'h-9 w-9' - } - }, - defaultVariants: { - variant: 'default', - size: 'default' - } -}); - -type Variant = VariantProps['variant']; -type Size = VariantProps['size']; - -type Props = ButtonPrimitive.Props & { - variant?: Variant; - size?: Size; -}; - -type Events = ButtonPrimitive.Events; +import Root, { + type ButtonProps, + type ButtonSize, + type ButtonVariant, + buttonVariants +} from './button.svelte'; export { Root, - type Props, - type Events, + type ButtonProps as Props, // Root as Button, - type Props as ButtonProps, - type Events as ButtonEvents, - buttonVariants + buttonVariants, + type ButtonProps, + type ButtonSize, + type ButtonVariant }; diff --git a/src/lib/components/ui/card/card-content.svelte b/src/lib/components/ui/card/card-content.svelte index 9f6d0443..bff81f14 100644 --- a/src/lib/components/ui/card/card-content.svelte +++ b/src/lib/components/ui/card/card-content.svelte @@ -1,19 +1,16 @@ -
+
{@render children?.()}
diff --git a/src/lib/components/ui/card/card-description.svelte b/src/lib/components/ui/card/card-description.svelte index 959c3bc2..6194f03a 100644 --- a/src/lib/components/ui/card/card-description.svelte +++ b/src/lib/components/ui/card/card-description.svelte @@ -1,19 +1,16 @@ -

+

{@render children?.()}

diff --git a/src/lib/components/ui/card/card-footer.svelte b/src/lib/components/ui/card/card-footer.svelte index 67e66dee..ae580478 100644 --- a/src/lib/components/ui/card/card-footer.svelte +++ b/src/lib/components/ui/card/card-footer.svelte @@ -1,19 +1,16 @@ -
+
{@render children?.()}
diff --git a/src/lib/components/ui/card/card-header.svelte b/src/lib/components/ui/card/card-header.svelte index bd9a4b08..bb6da620 100644 --- a/src/lib/components/ui/card/card-header.svelte +++ b/src/lib/components/ui/card/card-header.svelte @@ -1,19 +1,16 @@ -
+
{@render children?.()}
diff --git a/src/lib/components/ui/card/card-title.svelte b/src/lib/components/ui/card/card-title.svelte index 2c99a24a..d2ecf3db 100644 --- a/src/lib/components/ui/card/card-title.svelte +++ b/src/lib/components/ui/card/card-title.svelte @@ -1,27 +1,25 @@ - {@render children?.()} - +
diff --git a/src/lib/components/ui/card/card.svelte b/src/lib/components/ui/card/card.svelte index d4a3286f..70d9adc1 100644 --- a/src/lib/components/ui/card/card.svelte +++ b/src/lib/components/ui/card/card.svelte @@ -1,31 +1,20 @@ -
{@render children?.()}
diff --git a/src/lib/components/ui/card/index.ts b/src/lib/components/ui/card/index.ts index 691e6d14..20de2a3d 100644 --- a/src/lib/components/ui/card/index.ts +++ b/src/lib/components/ui/card/index.ts @@ -20,5 +20,3 @@ export { Header as CardHeader, Title as CardTitle }; - -export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; diff --git a/src/lib/components/ui/checkbox/checkbox.svelte b/src/lib/components/ui/checkbox/checkbox.svelte index 1c57825f..d3f1e28a 100644 --- a/src/lib/components/ui/checkbox/checkbox.svelte +++ b/src/lib/components/ui/checkbox/checkbox.svelte @@ -1,38 +1,35 @@ - - {#snippet children({ isChecked, isIndeterminate })} - {#if isIndeterminate} - + {#snippet children({ checked, indeterminate })} + + {#if indeterminate} + {:else} - + {/if} - {/snippet} - + + {/snippet} diff --git a/src/lib/components/ui/command/command-dialog.svelte b/src/lib/components/ui/command/command-dialog.svelte index 7f8b5401..b69c40b9 100644 --- a/src/lib/components/ui/command/command-dialog.svelte +++ b/src/lib/components/ui/command/command-dialog.svelte @@ -1,35 +1,35 @@ - - + + - {@render children?.()} - + bind:ref + {children} + /> diff --git a/src/lib/components/ui/command/command-empty.svelte b/src/lib/components/ui/command/command-empty.svelte index 108dcc49..982a578b 100644 --- a/src/lib/components/ui/command/command-empty.svelte +++ b/src/lib/components/ui/command/command-empty.svelte @@ -1,18 +1,12 @@ - - {@render children?.()} - + diff --git a/src/lib/components/ui/command/command-group.svelte b/src/lib/components/ui/command/command-group.svelte index 723eb248..21efc857 100644 --- a/src/lib/components/ui/command/command-group.svelte +++ b/src/lib/components/ui/command/command-group.svelte @@ -1,24 +1,27 @@ - {@render children?.()} + {#if heading} + + {heading} + + {/if} + diff --git a/src/lib/components/ui/command/command-input.svelte b/src/lib/components/ui/command/command-input.svelte index 322ccd4d..c3cb696f 100644 --- a/src/lib/components/ui/command/command-input.svelte +++ b/src/lib/components/ui/command/command-input.svelte @@ -1,28 +1,25 @@ -
- +
+
diff --git a/src/lib/components/ui/command/command-item.svelte b/src/lib/components/ui/command/command-item.svelte index 53aa7e4d..d475caff 100644 --- a/src/lib/components/ui/command/command-item.svelte +++ b/src/lib/components/ui/command/command-item.svelte @@ -1,33 +1,19 @@ - {#snippet children({ action, attrs })} - {@render children_render?.({ action, attrs })} - {/snippet} - + bind:ref + {...restProps} +/> diff --git a/src/lib/components/ui/command/command-link-item.svelte b/src/lib/components/ui/command/command-link-item.svelte new file mode 100644 index 00000000..b82d3939 --- /dev/null +++ b/src/lib/components/ui/command/command-link-item.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/command/command-list.svelte b/src/lib/components/ui/command/command-list.svelte index a263c1c6..56ff0001 100644 --- a/src/lib/components/ui/command/command-list.svelte +++ b/src/lib/components/ui/command/command-list.svelte @@ -1,21 +1,16 @@ - {@render children?.()} - + bind:ref + {...restProps} +/> diff --git a/src/lib/components/ui/command/command-separator.svelte b/src/lib/components/ui/command/command-separator.svelte index e5e00525..6599ac82 100644 --- a/src/lib/components/ui/command/command-separator.svelte +++ b/src/lib/components/ui/command/command-separator.svelte @@ -1,15 +1,12 @@ - + diff --git a/src/lib/components/ui/command/command-shortcut.svelte b/src/lib/components/ui/command/command-shortcut.svelte index 0a0365fc..38032922 100644 --- a/src/lib/components/ui/command/command-shortcut.svelte +++ b/src/lib/components/ui/command/command-shortcut.svelte @@ -1,19 +1,20 @@ - + {@render children?.()} diff --git a/src/lib/components/ui/command/command.svelte b/src/lib/components/ui/command/command.svelte index 574e218b..f9632ea9 100644 --- a/src/lib/components/ui/command/command.svelte +++ b/src/lib/components/ui/command/command.svelte @@ -1,23 +1,13 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/command/index.ts b/src/lib/components/ui/command/index.ts index 21c637be..5c77a0b2 100644 --- a/src/lib/components/ui/command/index.ts +++ b/src/lib/components/ui/command/index.ts @@ -1,4 +1,4 @@ -import { Command as CommandPrimitive } from 'cmdk-sv'; +import { Command as CommandPrimitive } from 'bits-ui'; import Root from './command.svelte'; import Dialog from './command-dialog.svelte'; @@ -9,8 +9,9 @@ import Input from './command-input.svelte'; import List from './command-list.svelte'; import Separator from './command-separator.svelte'; import Shortcut from './command-shortcut.svelte'; +import LinkItem from './command-link-item.svelte'; -const Loading = CommandPrimitive.Loading; +const Loading: typeof CommandPrimitive.Loading = CommandPrimitive.Loading; export { Root, @@ -18,6 +19,7 @@ export { Empty, Group, Item, + LinkItem, Input, List, Separator, @@ -29,6 +31,7 @@ export { Empty as CommandEmpty, Group as CommandGroup, Item as CommandItem, + LinkItem as CommandLinkItem, Input as CommandInput, List as CommandList, Separator as CommandSeparator, diff --git a/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte b/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte index 00e097d1..fc1585d3 100644 --- a/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte +++ b/src/lib/components/ui/context-menu/context-menu-checkbox-item.svelte @@ -1,46 +1,40 @@ - - - - - - {@render children?.()} + {#snippet children({ checked, indeterminate })} + + {#if indeterminate} + + {:else} + + {/if} + + {@render childrenProp?.()} + {/snippet} diff --git a/src/lib/components/ui/context-menu/context-menu-content.svelte b/src/lib/components/ui/context-menu/context-menu-content.svelte index e65f2922..9c5a694f 100644 --- a/src/lib/components/ui/context-menu/context-menu-content.svelte +++ b/src/lib/components/ui/context-menu/context-menu-content.svelte @@ -1,36 +1,24 @@ - - {@render children?.()} - + + + diff --git a/src/lib/components/ui/context-menu/context-menu-group-heading.svelte b/src/lib/components/ui/context-menu/context-menu-group-heading.svelte new file mode 100644 index 00000000..eade76fd --- /dev/null +++ b/src/lib/components/ui/context-menu/context-menu-group-heading.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/context-menu/context-menu-item.svelte b/src/lib/components/ui/context-menu/context-menu-item.svelte index 0d81ab6a..8d3d3991 100644 --- a/src/lib/components/ui/context-menu/context-menu-item.svelte +++ b/src/lib/components/ui/context-menu/context-menu-item.svelte @@ -2,20 +2,14 @@ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui'; import { cn } from '@/utils.js'; - type $$Props = ContextMenuPrimitive.ItemProps & { + let { + ref = $bindable(null), + class: className, + inset, + ...restProps + }: ContextMenuPrimitive.ItemProps & { inset?: boolean; - }; - type $$Events = ContextMenuPrimitive.ItemEvents; - - interface Props { - class?: $$Props['class']; - inset?: $$Props['inset']; - children?: import('svelte').Snippet; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [key: string]: any; - } - - let { class: className = undefined, inset = undefined, children, ...rest }: Props = $props(); + } = $props(); - {@render children?.()} - + bind:ref + {...restProps} +/> diff --git a/src/lib/components/ui/context-menu/context-menu-label.svelte b/src/lib/components/ui/context-menu/context-menu-label.svelte deleted file mode 100644 index 133e2b82..00000000 --- a/src/lib/components/ui/context-menu/context-menu-label.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - - - {@render children?.()} - diff --git a/src/lib/components/ui/context-menu/context-menu-radio-group.svelte b/src/lib/components/ui/context-menu/context-menu-radio-group.svelte deleted file mode 100644 index a94499f2..00000000 --- a/src/lib/components/ui/context-menu/context-menu-radio-group.svelte +++ /dev/null @@ -1,18 +0,0 @@ - - - - {@render children?.()} - diff --git a/src/lib/components/ui/context-menu/context-menu-radio-item.svelte b/src/lib/components/ui/context-menu/context-menu-radio-item.svelte index 6a47b901..b74775ca 100644 --- a/src/lib/components/ui/context-menu/context-menu-radio-item.svelte +++ b/src/lib/components/ui/context-menu/context-menu-radio-item.svelte @@ -1,41 +1,30 @@ - - - - - - {@render children?.()} + {#snippet children({ checked })} + + {#if checked} + + {/if} + + {@render childrenProp?.({ checked })} + {/snippet} diff --git a/src/lib/components/ui/context-menu/context-menu-separator.svelte b/src/lib/components/ui/context-menu/context-menu-separator.svelte index 375cb5a5..d778e296 100644 --- a/src/lib/components/ui/context-menu/context-menu-separator.svelte +++ b/src/lib/components/ui/context-menu/context-menu-separator.svelte @@ -2,15 +2,15 @@ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui'; import { cn } from '@/utils.js'; - type $$Props = ContextMenuPrimitive.SeparatorProps; - - interface Props { - class?: $$Props['class']; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [key: string]: any; - } - - let { class: className = undefined, ...rest }: Props = $props(); + let { + ref = $bindable(null), + class: className, + ...restProps + }: ContextMenuPrimitive.SeparatorProps = $props(); - + diff --git a/src/lib/components/ui/context-menu/context-menu-shortcut.svelte b/src/lib/components/ui/context-menu/context-menu-shortcut.svelte index 15b70654..2fdeb4a9 100644 --- a/src/lib/components/ui/context-menu/context-menu-shortcut.svelte +++ b/src/lib/components/ui/context-menu/context-menu-shortcut.svelte @@ -1,19 +1,20 @@ - + {@render children?.()} diff --git a/src/lib/components/ui/context-menu/context-menu-sub-content.svelte b/src/lib/components/ui/context-menu/context-menu-sub-content.svelte index d8213ca4..61c6f727 100644 --- a/src/lib/components/ui/context-menu/context-menu-sub-content.svelte +++ b/src/lib/components/ui/context-menu/context-menu-sub-content.svelte @@ -1,38 +1,19 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte b/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte index e039d202..430f4cd9 100644 --- a/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte +++ b/src/lib/components/ui/context-menu/context-menu-sub-trigger.svelte @@ -1,38 +1,28 @@ {@render children?.()} - + diff --git a/src/lib/components/ui/context-menu/index.ts b/src/lib/components/ui/context-menu/index.ts index d1239039..559ddd0f 100644 --- a/src/lib/components/ui/context-menu/index.ts +++ b/src/lib/components/ui/context-menu/index.ts @@ -1,32 +1,32 @@ import { ContextMenu as ContextMenuPrimitive } from 'bits-ui'; import Item from './context-menu-item.svelte'; -import Label from './context-menu-label.svelte'; +import GroupHeading from './context-menu-group-heading.svelte'; import Content from './context-menu-content.svelte'; import Shortcut from './context-menu-shortcut.svelte'; import RadioItem from './context-menu-radio-item.svelte'; import Separator from './context-menu-separator.svelte'; -import RadioGroup from './context-menu-radio-group.svelte'; import SubContent from './context-menu-sub-content.svelte'; import SubTrigger from './context-menu-sub-trigger.svelte'; import CheckboxItem from './context-menu-checkbox-item.svelte'; -const Sub = ContextMenuPrimitive.Sub; -const Root = ContextMenuPrimitive.Root; -const Trigger = ContextMenuPrimitive.Trigger; -const Group = ContextMenuPrimitive.Group; +const Sub: typeof ContextMenuPrimitive.Sub = ContextMenuPrimitive.Sub; +const Root: typeof ContextMenuPrimitive.Root = ContextMenuPrimitive.Root; +const Trigger: typeof ContextMenuPrimitive.Trigger = ContextMenuPrimitive.Trigger; +const Group: typeof ContextMenuPrimitive.Group = ContextMenuPrimitive.Group; +const RadioGroup: typeof ContextMenuPrimitive.RadioGroup = ContextMenuPrimitive.RadioGroup; export { Sub, Root, Item, - Label, Group, Trigger, Content, Shortcut, Separator, RadioItem, + GroupHeading, SubContent, SubTrigger, RadioGroup, @@ -35,13 +35,13 @@ export { Root as ContextMenu, Sub as ContextMenuSub, Item as ContextMenuItem, - Label as ContextMenuLabel, Group as ContextMenuGroup, Content as ContextMenuContent, Trigger as ContextMenuTrigger, Shortcut as ContextMenuShortcut, RadioItem as ContextMenuRadioItem, Separator as ContextMenuSeparator, + GroupHeading as ContextMenuGroupHeading, RadioGroup as ContextMenuRadioGroup, SubContent as ContextMenuSubContent, SubTrigger as ContextMenuSubTrigger, diff --git a/src/lib/components/ui/dialog/dialog-content.svelte b/src/lib/components/ui/dialog/dialog-content.svelte index cbd6efc4..487347fb 100644 --- a/src/lib/components/ui/dialog/dialog-content.svelte +++ b/src/lib/components/ui/dialog/dialog-content.svelte @@ -1,51 +1,37 @@ - - + + {@render children?.()} - + Close diff --git a/src/lib/components/ui/dialog/dialog-description.svelte b/src/lib/components/ui/dialog/dialog-description.svelte index dde66fcd..1180a552 100644 --- a/src/lib/components/ui/dialog/dialog-description.svelte +++ b/src/lib/components/ui/dialog/dialog-description.svelte @@ -1,19 +1,16 @@ - - {@render children?.()} - + diff --git a/src/lib/components/ui/dialog/dialog-footer.svelte b/src/lib/components/ui/dialog/dialog-footer.svelte index 52b99eb6..afa576a3 100644 --- a/src/lib/components/ui/dialog/dialog-footer.svelte +++ b/src/lib/components/ui/dialog/dialog-footer.svelte @@ -1,22 +1,20 @@
{@render children?.()}
diff --git a/src/lib/components/ui/dialog/dialog-header.svelte b/src/lib/components/ui/dialog/dialog-header.svelte index 34bb298e..5c46f80f 100644 --- a/src/lib/components/ui/dialog/dialog-header.svelte +++ b/src/lib/components/ui/dialog/dialog-header.svelte @@ -1,19 +1,20 @@ -
+
{@render children?.()}
diff --git a/src/lib/components/ui/dialog/dialog-overlay.svelte b/src/lib/components/ui/dialog/dialog-overlay.svelte index 7d7d3229..34ec36a1 100644 --- a/src/lib/components/ui/dialog/dialog-overlay.svelte +++ b/src/lib/components/ui/dialog/dialog-overlay.svelte @@ -1,31 +1,19 @@ diff --git a/src/lib/components/ui/dialog/dialog-portal.svelte b/src/lib/components/ui/dialog/dialog-portal.svelte deleted file mode 100644 index 307add1b..00000000 --- a/src/lib/components/ui/dialog/dialog-portal.svelte +++ /dev/null @@ -1,16 +0,0 @@ - - - - {@render children?.()} - diff --git a/src/lib/components/ui/dialog/dialog-title.svelte b/src/lib/components/ui/dialog/dialog-title.svelte index 788c4f6e..78bd06f4 100644 --- a/src/lib/components/ui/dialog/dialog-title.svelte +++ b/src/lib/components/ui/dialog/dialog-title.svelte @@ -1,22 +1,16 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/dialog/index.ts b/src/lib/components/ui/dialog/index.ts index 950252f2..663336c0 100644 --- a/src/lib/components/ui/dialog/index.ts +++ b/src/lib/components/ui/dialog/index.ts @@ -1,16 +1,16 @@ import { Dialog as DialogPrimitive } from 'bits-ui'; import Title from './dialog-title.svelte'; -import Portal from './dialog-portal.svelte'; import Footer from './dialog-footer.svelte'; import Header from './dialog-header.svelte'; import Overlay from './dialog-overlay.svelte'; import Content from './dialog-content.svelte'; import Description from './dialog-description.svelte'; -const Root = DialogPrimitive.Root; -const Trigger = DialogPrimitive.Trigger; -const Close = DialogPrimitive.Close; +const Root: typeof DialogPrimitive.Root = DialogPrimitive.Root; +const Trigger: typeof DialogPrimitive.Trigger = DialogPrimitive.Trigger; +const Close: typeof DialogPrimitive.Close = DialogPrimitive.Close; +const Portal: typeof DialogPrimitive.Portal = DialogPrimitive.Portal; export { Root, diff --git a/src/lib/components/ui/input/index.ts b/src/lib/components/ui/input/index.ts index f7063b39..be0783a3 100644 --- a/src/lib/components/ui/input/index.ts +++ b/src/lib/components/ui/input/index.ts @@ -1,27 +1,5 @@ import Root from './input.svelte'; -export type FormInputEvent = T & { - currentTarget: EventTarget & HTMLInputElement; -}; -export type InputEvents = { - blur: FormInputEvent; - change: FormInputEvent; - click: FormInputEvent; - focus: FormInputEvent; - focusin: FormInputEvent; - focusout: FormInputEvent; - keydown: FormInputEvent; - keypress: FormInputEvent; - keyup: FormInputEvent; - mouseover: FormInputEvent; - mouseenter: FormInputEvent; - mouseleave: FormInputEvent; - mousemove: FormInputEvent; - paste: FormInputEvent; - input: FormInputEvent; - wheel: FormInputEvent; -}; - export { Root, // diff --git a/src/lib/components/ui/input/input.svelte b/src/lib/components/ui/input/input.svelte index 71e77cad..32236148 100644 --- a/src/lib/components/ui/input/input.svelte +++ b/src/lib/components/ui/input/input.svelte @@ -1,55 +1,22 @@ bubble('wheel')]} - {...rest} + {...restProps} /> diff --git a/src/lib/components/ui/label/label.svelte b/src/lib/components/ui/label/label.svelte index 14da0fcc..7522adaf 100644 --- a/src/lib/components/ui/label/label.svelte +++ b/src/lib/components/ui/label/label.svelte @@ -1,25 +1,19 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/menubar/index.ts b/src/lib/components/ui/menubar/index.ts index afa4416d..a6aa82d0 100644 --- a/src/lib/components/ui/menubar/index.ts +++ b/src/lib/components/ui/menubar/index.ts @@ -1,10 +1,9 @@ import { Menubar as MenubarPrimitive } from 'bits-ui'; - import Root from './menubar.svelte'; import CheckboxItem from './menubar-checkbox-item.svelte'; import Content from './menubar-content.svelte'; import Item from './menubar-item.svelte'; -import Label from './menubar-label.svelte'; +import GroupHeading from './menubar-group-heading.svelte'; import RadioItem from './menubar-radio-item.svelte'; import Separator from './menubar-separator.svelte'; import Shortcut from './menubar-shortcut.svelte'; @@ -22,7 +21,7 @@ export { CheckboxItem, Content, Item, - Label, + GroupHeading, RadioItem, Separator, Shortcut, @@ -38,7 +37,7 @@ export { CheckboxItem as MenubarCheckboxItem, Content as MenubarContent, Item as MenubarItem, - Label as MenubarLabel, + GroupHeading as MenubarGroupHeading, RadioItem as MenubarRadioItem, Separator as MenubarSeparator, Shortcut as MenubarShortcut, diff --git a/src/lib/components/ui/menubar/menubar-checkbox-item.svelte b/src/lib/components/ui/menubar/menubar-checkbox-item.svelte index 26ee4349..98d6d7d3 100644 --- a/src/lib/components/ui/menubar/menubar-checkbox-item.svelte +++ b/src/lib/components/ui/menubar/menubar-checkbox-item.svelte @@ -1,48 +1,40 @@ - - - - - - {@render children?.()} + {#snippet children({ checked, indeterminate })} + + {#if indeterminate} + + {:else} + + {/if} + + {@render childrenProp?.()} + {/snippet} diff --git a/src/lib/components/ui/menubar/menubar-content.svelte b/src/lib/components/ui/menubar/menubar-content.svelte index a7a9371c..6cf7e083 100644 --- a/src/lib/components/ui/menubar/menubar-content.svelte +++ b/src/lib/components/ui/menubar/menubar-content.svelte @@ -1,43 +1,32 @@ - - {@render children?.()} - + + + diff --git a/src/lib/components/ui/menubar/menubar-group-heading.svelte b/src/lib/components/ui/menubar/menubar-group-heading.svelte new file mode 100644 index 00000000..0b137cae --- /dev/null +++ b/src/lib/components/ui/menubar/menubar-group-heading.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/ui/menubar/menubar-item.svelte b/src/lib/components/ui/menubar/menubar-item.svelte index deda09cf..4a5d64f0 100644 --- a/src/lib/components/ui/menubar/menubar-item.svelte +++ b/src/lib/components/ui/menubar/menubar-item.svelte @@ -1,37 +1,23 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/menubar/menubar-label.svelte b/src/lib/components/ui/menubar/menubar-label.svelte deleted file mode 100644 index 5dc172ac..00000000 --- a/src/lib/components/ui/menubar/menubar-label.svelte +++ /dev/null @@ -1,24 +0,0 @@ - - - - {@render children?.()} - diff --git a/src/lib/components/ui/menubar/menubar-radio-item.svelte b/src/lib/components/ui/menubar/menubar-radio-item.svelte index f23bd4dc..7d61e7c9 100644 --- a/src/lib/components/ui/menubar/menubar-radio-item.svelte +++ b/src/lib/components/ui/menubar/menubar-radio-item.svelte @@ -1,43 +1,30 @@ - - - - - - {@render children?.()} + {#snippet children({ checked })} + + {#if checked} + + {/if} + + {@render childrenProp?.({ checked })} + {/snippet} diff --git a/src/lib/components/ui/menubar/menubar-separator.svelte b/src/lib/components/ui/menubar/menubar-separator.svelte index 00ca2c1f..26316604 100644 --- a/src/lib/components/ui/menubar/menubar-separator.svelte +++ b/src/lib/components/ui/menubar/menubar-separator.svelte @@ -1,15 +1,16 @@ - + diff --git a/src/lib/components/ui/menubar/menubar-shortcut.svelte b/src/lib/components/ui/menubar/menubar-shortcut.svelte index d4322aa4..dcf75f24 100644 --- a/src/lib/components/ui/menubar/menubar-shortcut.svelte +++ b/src/lib/components/ui/menubar/menubar-shortcut.svelte @@ -1,18 +1,20 @@ - + {@render children?.()} diff --git a/src/lib/components/ui/menubar/menubar-sub-content.svelte b/src/lib/components/ui/menubar/menubar-sub-content.svelte index 4d1f6e4f..bfdbe3f8 100644 --- a/src/lib/components/ui/menubar/menubar-sub-content.svelte +++ b/src/lib/components/ui/menubar/menubar-sub-content.svelte @@ -1,37 +1,19 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/menubar/menubar-sub-trigger.svelte b/src/lib/components/ui/menubar/menubar-sub-trigger.svelte index 0cd20c77..3e5bc856 100644 --- a/src/lib/components/ui/menubar/menubar-sub-trigger.svelte +++ b/src/lib/components/ui/menubar/menubar-sub-trigger.svelte @@ -1,38 +1,28 @@ {@render children?.()} - + diff --git a/src/lib/components/ui/menubar/menubar-trigger.svelte b/src/lib/components/ui/menubar/menubar-trigger.svelte index 940101b1..ca4d82b6 100644 --- a/src/lib/components/ui/menubar/menubar-trigger.svelte +++ b/src/lib/components/ui/menubar/menubar-trigger.svelte @@ -1,29 +1,19 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/menubar/menubar.svelte b/src/lib/components/ui/menubar/menubar.svelte index cd1e8b60..b177fd49 100644 --- a/src/lib/components/ui/menubar/menubar.svelte +++ b/src/lib/components/ui/menubar/menubar.svelte @@ -1,22 +1,19 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/popover/popover-content.svelte b/src/lib/components/ui/popover/popover-content.svelte index c3640a13..e00de1d9 100644 --- a/src/lib/components/ui/popover/popover-content.svelte +++ b/src/lib/components/ui/popover/popover-content.svelte @@ -1,41 +1,28 @@ - - {@render children?.()} - + + + diff --git a/src/lib/components/ui/separator/separator.svelte b/src/lib/components/ui/separator/separator.svelte index 67dfa9fe..1a76e063 100644 --- a/src/lib/components/ui/separator/separator.svelte +++ b/src/lib/components/ui/separator/separator.svelte @@ -1,32 +1,22 @@ diff --git a/src/lib/components/ui/skeleton/index.ts b/src/lib/components/ui/skeleton/index.ts new file mode 100644 index 00000000..df169ced --- /dev/null +++ b/src/lib/components/ui/skeleton/index.ts @@ -0,0 +1,7 @@ +import Root from './skeleton.svelte'; + +export { + Root, + // + Root as Skeleton +}; diff --git a/src/lib/components/ui/skeleton/skeleton.svelte b/src/lib/components/ui/skeleton/skeleton.svelte new file mode 100644 index 00000000..91efa611 --- /dev/null +++ b/src/lib/components/ui/skeleton/skeleton.svelte @@ -0,0 +1,17 @@ + + +
diff --git a/src/lib/components/ui/sonner/sonner.svelte b/src/lib/components/ui/sonner/sonner.svelte index 3fd44d74..887bad8d 100644 --- a/src/lib/components/ui/sonner/sonner.svelte +++ b/src/lib/components/ui/sonner/sonner.svelte @@ -1,14 +1,8 @@ diff --git a/src/lib/components/ui/tabs/tabs-content.svelte b/src/lib/components/ui/tabs/tabs-content.svelte index 31896894..37a4ddac 100644 --- a/src/lib/components/ui/tabs/tabs-content.svelte +++ b/src/lib/components/ui/tabs/tabs-content.svelte @@ -1,27 +1,21 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/tabs/tabs-list.svelte b/src/lib/components/ui/tabs/tabs-list.svelte index 2bace4e6..ae768207 100644 --- a/src/lib/components/ui/tabs/tabs-list.svelte +++ b/src/lib/components/ui/tabs/tabs-list.svelte @@ -1,25 +1,15 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/tabs/tabs-trigger.svelte b/src/lib/components/ui/tabs/tabs-trigger.svelte index 9fcb4e70..2af8a074 100644 --- a/src/lib/components/ui/tabs/tabs-trigger.svelte +++ b/src/lib/components/ui/tabs/tabs-trigger.svelte @@ -1,31 +1,21 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/toggle/index.ts b/src/lib/components/ui/toggle/index.ts index 5aab2a48..4a0d9d7e 100644 --- a/src/lib/components/ui/toggle/index.ts +++ b/src/lib/components/ui/toggle/index.ts @@ -1,28 +1,10 @@ -import { type VariantProps, tv } from 'tailwind-variants'; import Root from './toggle.svelte'; - -export const toggleVariants = tv({ - base: 'hover:bg-muted hover:text-muted-foreground focus-visible:ring-ring data-[state=on]:bg-accent data-[state=on]:text-accent-foreground inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50', - variants: { - variant: { - default: 'bg-transparent', - outline: - 'border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-sm' - }, - size: { - default: 'h-9 px-3', - sm: 'h-8 px-2', - lg: 'h-10 px-3' - } - }, - defaultVariants: { - variant: 'default', - size: 'default' - } -}); - -export type Variant = VariantProps['variant']; -export type Size = VariantProps['size']; +export { + toggleVariants, + type ToggleSize, + type ToggleVariant, + type ToggleVariants +} from './toggle.svelte'; export { Root, diff --git a/src/lib/components/ui/toggle/toggle.svelte b/src/lib/components/ui/toggle/toggle.svelte index 8f9e04da..490c40d0 100644 --- a/src/lib/components/ui/toggle/toggle.svelte +++ b/src/lib/components/ui/toggle/toggle.svelte @@ -1,40 +1,51 @@ + + - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/components/ui/tooltip/index.ts b/src/lib/components/ui/tooltip/index.ts index 30adbb72..cee9100d 100644 --- a/src/lib/components/ui/tooltip/index.ts +++ b/src/lib/components/ui/tooltip/index.ts @@ -3,13 +3,16 @@ import Content from './tooltip-content.svelte'; const Root = TooltipPrimitive.Root; const Trigger = TooltipPrimitive.Trigger; +const Provider = TooltipPrimitive.Provider; export { Root, Trigger, Content, + Provider, // Root as Tooltip, Content as TooltipContent, - Trigger as TooltipTrigger + Trigger as TooltipTrigger, + Provider as TooltipProvider }; diff --git a/src/lib/components/ui/tooltip/tooltip-content.svelte b/src/lib/components/ui/tooltip/tooltip-content.svelte index 2c18eb00..6363e293 100644 --- a/src/lib/components/ui/tooltip/tooltip-content.svelte +++ b/src/lib/components/ui/tooltip/tooltip-content.svelte @@ -1,41 +1,21 @@ - {@render children?.()} - + {...restProps} +/> diff --git a/src/lib/utils.ts b/src/lib/utils.ts index fe399cc4..cb90d5a1 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,60 +1,10 @@ import { type ClassValue, clsx } from 'clsx'; import { twMerge } from 'tailwind-merge'; -import { cubicOut } from 'svelte/easing'; -import type { TransitionConfig } from 'svelte/transition'; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } -type FlyAndScaleParams = { - y?: number; - x?: number; - start?: number; - duration?: number; -}; - -export const flyAndScale = ( - node: Element, - params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 } -): TransitionConfig => { - const style = getComputedStyle(node); - const transform = style.transform === 'none' ? '' : style.transform; - - const scaleConversion = (valueA: number, scaleA: [number, number], scaleB: [number, number]) => { - const [minA, maxA] = scaleA; - const [minB, maxB] = scaleB; - - const percentage = (valueA - minA) / (maxA - minA); - const valueB = percentage * (maxB - minB) + minB; - - return valueB; - }; - - const styleToString = (style: Record): string => { - return Object.keys(style).reduce((str, key) => { - if (style[key] === undefined) return str; - return str + `${key}:${style[key]};`; - }, ''); - }; - - return { - duration: params.duration ?? 200, - delay: 0, - css: (t) => { - const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]); - const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]); - const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]); - - return styleToString({ - transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`, - opacity: t - }); - }, - easing: cubicOut - }; -}; - // https://stackoverflow.com/a/63795192/14781260 export async function findAsyncSequential( array: T[], diff --git a/tailwind.config.ts b/tailwind.config.ts index 84af1069..f9163cc9 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,15 +1,13 @@ import { fontFamily } from 'tailwindcss/defaultTheme'; import type { Config } from 'tailwindcss'; import tailwindScrollbar from 'tailwind-scrollbar'; +import tailwindcssAnimate from 'tailwindcss-animate'; const config: Config = { darkMode: ['class'], content: ['./src/**/*.{html,js,svelte,ts}'], safelist: ['dark'], theme: { - fontFamily: { - suse: ['SUSE', 'system-ui'] - }, container: { center: true, padding: '2rem', @@ -59,11 +57,34 @@ const config: Config = { sm: 'calc(var(--radius) - 4px)' }, fontFamily: { + suse: ['SUSE', 'system-ui'], sans: [...fontFamily.sans] + }, + keyframes: { + 'accordion-down': { + from: { height: '0' }, + to: { height: 'var(--bits-accordion-content-height)' } + }, + 'accordion-up': { + from: { height: 'var(--bits-accordion-content-height)' }, + to: { height: '0' } + }, + 'caret-blink': { + '0%,70%,100%': { opacity: '1' }, + '20%,50%': { opacity: '0' } + } + }, + animation: { + 'accordion-down': 'accordion-down 0.2s ease-out', + 'accordion-up': 'accordion-up 0.2s ease-out', + 'caret-blink': 'caret-blink 1.25s ease-out infinite' } } }, - plugins: [tailwindScrollbar({ nocompatible: true, preferredStrategy: 'pseudoelements' })] + plugins: [ + tailwindScrollbar({ nocompatible: true, preferredStrategy: 'pseudoelements' }), + tailwindcssAnimate + ] }; export default config; From be81aa06d8437644c44ece49493e882937f8924a Mon Sep 17 00:00:00 2001 From: Muhammed-Rahif Date: Tue, 26 Nov 2024 00:37:38 +0530 Subject: [PATCH 4/7] chore(wip): component migration pending --- .github/workflows/gh-pages.yml | 5 + .github/workflows/prettier.yml | 4 + .github/workflows/semantic-release.yml | 5 + package.json | 11 +- pnpm-lock.yaml | 32 +++--- src/app.css | 35 +++--- src/lib/actions/input-auto-width.ts | 42 ++++++++ src/lib/components/AboutDialog.svelte | 10 +- src/lib/components/Editor/Editor.svelte | 4 +- src/lib/components/EditorTabs.svelte | 13 ++- src/lib/components/EditorTitle.svelte | 37 +++---- src/lib/components/LicenseDialog.svelte | 8 +- .../font-dialog/FontFamilyCombobox.svelte | 87 +++++++-------- src/lib/helpers/editors.ts | 1 + tailwind.config.ts | 15 ++- ....timestamp-1732543347608-6a23bfb58b803.mjs | 101 ++++++++++++++++++ 16 files changed, 282 insertions(+), 128 deletions(-) create mode 100644 src/lib/actions/input-auto-width.ts create mode 100644 vite.config.ts.timestamp-1732543347608-6a23bfb58b803.mjs diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 04638294..2ca09725 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -20,6 +20,11 @@ jobs: - name: Install dependencies run: npm install + - name: Check linting and errors + run: | + npm run lint + npm run check + - name: Deploy with gh-pages run: | git config --local user.name "github-actions[bot]" diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 691594a6..792775de 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -32,7 +32,11 @@ jobs: - name: Run Prettier run: | npm run format + + - name: Check linting and errors + run: | npm run lint + npm run check - name: Commit changes run: | diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 88134a21..95b907d1 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -54,6 +54,11 @@ jobs: - name: Install dependencies run: npm install + - name: Check linting and errors + run: | + npm run lint + npm run check + - name: Update version declarations env: GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/package.json b/package.json index 6792eb9f..780f23ab 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@vite-pwa/assets-generator": "^0.2.6", "autoprefixer": "^10.4.20", "bits-ui": "1.0.0-next.64", + "clsx": "^2.1.1", "eslint": "^9.12.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.45.1", @@ -44,7 +45,10 @@ "svelte": "^5.0.0", "svelte-check": "^4.0.5", "svelte-radix": "^1.1.1", + "tailwind-merge": "^2.5.4", + "tailwind-variants": "^0.2.1", "tailwindcss": "^3.4.14", + "tailwindcss-animate": "^1.0.7", "tslib": "^2.7.0", "typescript": "^5.6.3", "typescript-eslint": "^8.15.0", @@ -63,7 +67,6 @@ "@tauri-apps/plugin-fs": "^2.0.0", "@tauri-apps/plugin-shell": "^2.0.1", "caret-pos": "^2.0.0", - "clsx": "^2.1.1", "localforage": "^1.10.0", "lodash.debounce": "^4.0.8", "lodash.merge": "^4.6.2", @@ -73,11 +76,7 @@ "quill": "^2.0.2", "screenfull": "^6.0.2", "short-uuid": "^5.2.0", - "svelte-input-auto-width": "^2.1.0", "svelte-sonner": "^0.3.28", - "tailwind-merge": "^2.5.4", - "tailwind-scrollbar": "^3.1.0", - "tailwind-variants": "^0.2.1", - "tailwindcss-animate": "^1.0.7" + "tailwind-scrollbar": "^3.1.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b968233f..db2cea49 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,9 +26,6 @@ importers: caret-pos: specifier: ^2.0.0 version: 2.0.0 - clsx: - specifier: ^2.1.1 - version: 2.1.1 localforage: specifier: ^1.10.0 version: 1.10.0 @@ -56,24 +53,12 @@ importers: short-uuid: specifier: ^5.2.0 version: 5.2.0 - svelte-input-auto-width: - specifier: ^2.1.0 - version: 2.1.0 svelte-sonner: specifier: ^0.3.28 version: 0.3.28(svelte@5.2.7) - tailwind-merge: - specifier: ^2.5.4 - version: 2.5.4 tailwind-scrollbar: specifier: ^3.1.0 version: 3.1.0(tailwindcss@3.4.15) - tailwind-variants: - specifier: ^0.2.1 - version: 0.2.1(tailwindcss@3.4.15) - tailwindcss-animate: - specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.15) devDependencies: '@semantic-release/changelog': specifier: ^6.0.3 @@ -123,6 +108,9 @@ importers: bits-ui: specifier: 1.0.0-next.64 version: 1.0.0-next.64(svelte@5.2.7) + clsx: + specifier: ^2.1.1 + version: 2.1.1 eslint: specifier: ^9.12.0 version: 9.15.0(jiti@1.21.6) @@ -162,9 +150,18 @@ importers: svelte-radix: specifier: ^1.1.1 version: 1.1.1(svelte@5.2.7) + tailwind-merge: + specifier: ^2.5.4 + version: 2.5.4 + tailwind-variants: + specifier: ^0.2.1 + version: 0.2.1(tailwindcss@3.4.15) tailwindcss: specifier: ^3.4.14 version: 3.4.15 + tailwindcss-animate: + specifier: ^1.0.7 + version: 1.0.7(tailwindcss@3.4.15) tslib: specifier: ^2.7.0 version: 2.8.1 @@ -3729,9 +3726,6 @@ packages: svelte: optional: true - svelte-input-auto-width@2.1.0: - resolution: {integrity: sha512-QwgxIeCY7SEixoCUkVT8HRzWDWwFjEisQslJMNOGJO+EmNSkTQj4yqxabh9W+7ueCY2WvaE0JthofRl3gxZs9g==} - svelte-radix@1.1.1: resolution: {integrity: sha512-TCbV7fzlJ2aEUB0nu2EodVA+r1eYj526IYpmGUTV32Z0bIrCUvx3K8xX3tcxR5dDFA5ZBU1Hxr4RYC4TDFEQ4A==} peerDependencies: @@ -7853,8 +7847,6 @@ snapshots: optionalDependencies: svelte: 5.2.7 - svelte-input-auto-width@2.1.0: {} - svelte-radix@1.1.1(svelte@5.2.7): dependencies: svelte: 5.2.7 diff --git a/src/app.css b/src/app.css index b41a35b2..b27f5125 100644 --- a/src/app.css +++ b/src/app.css @@ -6,65 +6,62 @@ :root { --background: 0 0% 100%; --foreground: 0 0% 3.9%; - --muted: 0 0% 96.1%; --muted-foreground: 0 0% 45.1%; - --popover: 0 0% 100%; --popover-foreground: 0 0% 3.9%; - --card: 0 0% 100%; --card-foreground: 0 0% 3.9%; - --border: 0 0% 89.8%; --input: 0 0% 89.8%; - --primary: 0 0% 9%; --primary-foreground: 0 0% 98%; - --secondary: 0 0% 96.1%; --secondary-foreground: 0 0% 9%; - --accent: 0 0% 96.1%; --accent-foreground: 0 0% 9%; - --destructive: 0 72.2% 50.6%; --destructive-foreground: 0 0% 98%; - --ring: 0 0% 3.9%; - --radius: 0.5rem; + --sidebar-background: 0 0% 98%; + --sidebar-foreground: 240 5.3% 26.1%; + --sidebar-primary: 240 5.9% 10%; + --sidebar-primary-foreground: 0 0% 98%; + --sidebar-accent: 240 4.8% 95.9%; + --sidebar-accent-foreground: 240 5.9% 10%; + --sidebar-border: 220 13% 91%; + --sidebar-ring: 217.2 91.2% 59.8%; } .dark { --background: 0 0% 3.9%; --foreground: 0 0% 98%; - --muted: 0 0% 14.9%; --muted-foreground: 0 0% 63.9%; - --popover: 0 0% 3.9%; --popover-foreground: 0 0% 98%; - --card: 0 0% 3.9%; --card-foreground: 0 0% 98%; - --border: 0 0% 14.9%; --input: 0 0% 14.9%; - --primary: 0 0% 98%; --primary-foreground: 0 0% 9%; - --secondary: 0 0% 14.9%; --secondary-foreground: 0 0% 98%; - --accent: 0 0% 14.9%; --accent-foreground: 0 0% 98%; - --destructive: 0 62.8% 30.6%; --destructive-foreground: 0 0% 98%; - --ring: 0 0% 83.1%; + --sidebar-background: 240 5.9% 10%; + --sidebar-foreground: 240 4.8% 95.9%; + --sidebar-primary: 224.3 76.3% 48%; + --sidebar-primary-foreground: 0 0% 100%; + --sidebar-accent: 240 3.7% 15.9%; + --sidebar-accent-foreground: 240 4.8% 95.9%; + --sidebar-border: 240 3.7% 15.9%; + --sidebar-ring: 217.2 91.2% 59.8%; } } diff --git a/src/lib/actions/input-auto-width.ts b/src/lib/actions/input-auto-width.ts new file mode 100644 index 00000000..75543543 --- /dev/null +++ b/src/lib/actions/input-auto-width.ts @@ -0,0 +1,42 @@ +/** + * https://svelte.dev/playground/cb0b845fce1a43aabf4421989acaca39?version=3.55.1 + */ +export function resizeInputOnDynamicContent(node: HTMLInputElement) { + const measuringElement = document.createElement('div'); + document.body.appendChild(measuringElement); + + /** duplicate the styles of the existing node, but + remove the measuring element from the viewport. */ + function duplicateAndSet() { + const styles = window.getComputedStyle(node); + measuringElement.innerHTML = node.value; + measuringElement.style.fontSize = styles.fontSize; + measuringElement.style.fontFamily = styles.fontFamily; + measuringElement.style.paddingLeft = styles.paddingLeft; + measuringElement.style.paddingRight = styles.paddingRight; + measuringElement.style.boxSizing = 'border-box'; + measuringElement.style.border = styles.border; + measuringElement.style.width = 'max-content'; + measuringElement.style.position = 'absolute'; + measuringElement.style.top = '0'; + measuringElement.style.left = '-9999px'; + measuringElement.style.overflow = 'hidden'; + measuringElement.style.visibility = 'hidden'; + measuringElement.style.whiteSpace = 'pre'; + measuringElement.style.height = '0'; + node.style.width = `${measuringElement.offsetWidth}px`; + } + + duplicateAndSet(); + /** listen to any style changes */ + const observer = new MutationObserver(duplicateAndSet); + observer.observe(node, { attributes: true, childList: true, subtree: true }); + + node.addEventListener('input', duplicateAndSet); + return { + destroy() { + observer.disconnect(); + node.removeEventListener('input', duplicateAndSet); + } + }; +} diff --git a/src/lib/components/AboutDialog.svelte b/src/lib/components/AboutDialog.svelte index 2908f0a6..2620db3f 100644 --- a/src/lib/components/AboutDialog.svelte +++ b/src/lib/components/AboutDialog.svelte @@ -18,21 +18,22 @@ import { Badge } from '@/components/ui/badge'; import { openLicenseDialog } from '@/components/LicenseDialog.svelte'; import { mode } from 'mode-watcher'; - import type { ButtonEventHandler } from 'bits-ui'; import { Notpad } from '@/helpers/notpad'; import { slide } from 'svelte/transition'; import appJson from '@/src/app.json'; + import { tick } from 'svelte'; function closeDialog() { open.set(false); } - function showLicense() { + async function showLicense() { closeDialog(); + await tick(); openLicenseDialog(); } - function openGithubRepo(e: ButtonEventHandler) { + function openGithubRepo(e: MouseEvent) { e.stopPropagation(); e.preventDefault(); window.open('https://github.com/Muhammed-Rahif/Notpad', '_blank'); @@ -54,6 +55,7 @@ © 2024. All rights reserved.
+

Notpad is a simple, open source, beautiful note-taking app that helps you to take notes and @@ -69,7 +71,7 @@ {#await Notpad.github.getContributors() then contributors} {#if contributors} -

+

Our Valuable Contributors:

    {#each contributors as contributor} diff --git a/src/lib/components/Editor/Editor.svelte b/src/lib/components/Editor/Editor.svelte index 733c3d8c..570c37bc 100644 --- a/src/lib/components/Editor/Editor.svelte +++ b/src/lib/components/Editor/Editor.svelte @@ -17,8 +17,8 @@ let { editor }: Props = $props(); - let editorContainer: HTMLDivElement = $state({} as HTMLDivElement); - let quill: Quill = $state({} as Quill); + let editorContainer: HTMLDivElement = $state(null!); + let quill: Quill = $state(null!); let fakeCaret: HTMLSpanElement | null = $state(null); let caretPosition = $state({ top: 10, left: 8, height: 24 }); let lineNo = $state(0); diff --git a/src/lib/components/EditorTabs.svelte b/src/lib/components/EditorTabs.svelte index 2f334570..0a889568 100644 --- a/src/lib/components/EditorTabs.svelte +++ b/src/lib/components/EditorTabs.svelte @@ -6,6 +6,7 @@ import { activeTabId, editors } from '@/store/store'; import { Notpad } from '@/helpers/notpad'; import { slide } from 'svelte/transition'; + import { cn } from '@/utils'; let innerWidth = $state(window.innerWidth); @@ -23,16 +24,18 @@ {#if tabsMode || isXS}
    {#each $editors as editor} - +
    ($activeTabId = editor.id)} onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { diff --git a/src/lib/components/EditorTitle.svelte b/src/lib/components/EditorTitle.svelte index 926ab8f9..62a975ce 100644 --- a/src/lib/components/EditorTitle.svelte +++ b/src/lib/components/EditorTitle.svelte @@ -1,17 +1,14 @@ - + -
    -
    - +
    + diff --git a/src/lib/components/LicenseDialog.svelte b/src/lib/components/LicenseDialog.svelte index 660d1928..c7a5f27c 100644 --- a/src/lib/components/LicenseDialog.svelte +++ b/src/lib/components/LicenseDialog.svelte @@ -38,7 +38,7 @@ SOFTWARE.`); let licenseParagraphs = $derived( licenseText.split(/\n\n/g).map((line) => { - return { text: line, br: '

    ' }; + return { text: line, br: true }; }) ); @@ -54,7 +54,11 @@ SOFTWARE.`); {#each licenseParagraphs as { text, br }} {text} - {br} + + {#if br} +
    +
    + {/if} {/each}
    diff --git a/src/lib/components/font-dialog/FontFamilyCombobox.svelte b/src/lib/components/font-dialog/FontFamilyCombobox.svelte index b08f4489..b6702143 100644 --- a/src/lib/components/font-dialog/FontFamilyCombobox.svelte +++ b/src/lib/components/font-dialog/FontFamilyCombobox.svelte @@ -11,14 +11,13 @@ import ChevronsUpDownIcon from '@/components/icons/ChevronsUpDown.svelte'; import { FontFamily } from '@/types/SettingsTypes'; - let open = $state(false); - interface Props { value: FontFamily; } + let triggerRef = $state(null!); + let open = $state(false); let { value = $bindable() }: Props = $props(); - let selectedValue = $derived( Object.values(FontFamily).find((f) => f === value) ?? $settings.fontFamily ); @@ -26,22 +25,16 @@ // We want to refocus the trigger button when the user selects // an item from the list so users can continue navigating the // rest of the form with the keyboard. - function closeAndFocusTrigger(triggerId: string) { + function closeAndFocusTrigger() { open = false; tick().then(() => { - document.getElementById(triggerId)?.focus(); + triggerRef.focus(); }); } - const onSelect = ( - currentValue: FontFamily, - ids: { - content: string; - trigger: string; - } - ) => { + const onSelect = (currentValue: FontFamily) => { value = currentValue; - closeAndFocusTrigger(ids.trigger); + closeAndFocusTrigger(); }; onMount(() => () => { @@ -50,39 +43,37 @@ - {#snippet children({ ids })} - - {#snippet children({ builder })} -
    - -
    - -
    - {/snippet} -
    - - - - No font family found. - - {#each Object.values(FontFamily) as fontFamily} - onSelect(fontFamily, ids)}> - - {fontFamily == FontFamily.SUSE ? `${fontFamily} (Default)` : fontFamily} - - {/each} - - - - {/snippet} + + {#snippet child({ props })} +
    + +
    + +
    + {/snippet} +
    + + + + No font family found. + + {#each Object.values(FontFamily) as fontFamily} + onSelect(fontFamily)}> + + {fontFamily == FontFamily.SUSE ? `${fontFamily} (Default)` : fontFamily} + + {/each} + + +
    diff --git a/src/lib/helpers/editors.ts b/src/lib/helpers/editors.ts index 335b1954..772514c5 100644 --- a/src/lib/helpers/editors.ts +++ b/src/lib/helpers/editors.ts @@ -108,6 +108,7 @@ export class Editors { return value.map((editor) => { if (editor.id === editorId) { editor.fileName = fileName; + editor.fileHandle = undefined; } return editor; }); diff --git a/tailwind.config.ts b/tailwind.config.ts index f9163cc9..1df02d80 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -49,9 +49,20 @@ const config: Config = { card: { DEFAULT: 'hsl(var(--card) / )', foreground: 'hsl(var(--card-foreground) / )' + }, + sidebar: { + DEFAULT: 'hsl(var(--sidebar-background))', + foreground: 'hsl(var(--sidebar-foreground))', + primary: 'hsl(var(--sidebar-primary))', + 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))', + accent: 'hsl(var(--sidebar-accent))', + 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))', + border: 'hsl(var(--sidebar-border))', + ring: 'hsl(var(--sidebar-ring))' } }, borderRadius: { + xl: 'calc(var(--radius) + 4px)', lg: 'var(--radius)', md: 'calc(var(--radius) - 2px)', sm: 'calc(var(--radius) - 4px)' @@ -82,8 +93,8 @@ const config: Config = { } }, plugins: [ - tailwindScrollbar({ nocompatible: true, preferredStrategy: 'pseudoelements' }), - tailwindcssAnimate + tailwindcssAnimate, + tailwindScrollbar({ nocompatible: true, preferredStrategy: 'pseudoelements' }) ] }; diff --git a/vite.config.ts.timestamp-1732543347608-6a23bfb58b803.mjs b/vite.config.ts.timestamp-1732543347608-6a23bfb58b803.mjs new file mode 100644 index 00000000..dab8d17a --- /dev/null +++ b/vite.config.ts.timestamp-1732543347608-6a23bfb58b803.mjs @@ -0,0 +1,101 @@ +// vite.config.ts +import { VitePWA } from 'file:///home/muhammed-rahif/Workspace/Tauri/Notpad/node_modules/.pnpm/vite-plugin-pwa@0.20.5_@vite-pwa+assets-generator@0.2.6_vite@5.4.11_@types+node@22.9.0_terser_bytasdasf4le6dogdwc7qpmgke/node_modules/vite-plugin-pwa/dist/index.js'; +import { defineConfig } from 'file:///home/muhammed-rahif/Workspace/Tauri/Notpad/node_modules/.pnpm/vite@5.4.11_@types+node@22.9.0_terser@5.36.0/node_modules/vite/dist/node/index.js'; +import { svelte } from 'file:///home/muhammed-rahif/Workspace/Tauri/Notpad/node_modules/.pnpm/@sveltejs+vite-plugin-svelte@4.0.1_svelte@5.2.7_vite@5.4.11_@types+node@22.9.0_terser@5.36.0_/node_modules/@sveltejs/vite-plugin-svelte/src/index.js'; +import path from 'path'; +import fs from 'fs'; +function baseUrl() { + const baseArgIndex = process.argv.indexOf('--base'); + if (baseArgIndex !== -1 && baseArgIndex + 1 < process.argv.length) { + return process.argv[baseArgIndex + 1]; + } + return null; +} +(function () { + const appJson = path.resolve('./src/app.json'); + const content = { + version: process.env.npm_package_version + }; + fs.writeFileSync(appJson, JSON.stringify(content, null, 2) + '\n'); +})(); +var vite_config_default = defineConfig({ + resolve: { + alias: { + '@/src': path.resolve('./src'), + '@': path.resolve('./src/lib') + } + }, + define: { + APP_VERSION: JSON.stringify(process.env.npm_package_version) + }, + base: '/Notpad/', + build: { + outDir: 'www', + rollupOptions: { + output: { + // https://github.com/vitejs/vite/discussions/9440#discussioncomment-5913798 + manualChunks(id) { + if (id.includes('node_modules')) { + return id.toString().split('node_modules/')[1].split('/')[0].toString(); + } + } + } + } + }, + server: { + port: 5173, + strictPort: true + }, + plugins: [ + svelte(), + VitePWA({ + registerType: 'autoUpdate', + injectRegister: 'auto', + base: baseUrl() ?? '/Notpad/', + pwaAssets: { + disabled: false, + config: true + }, + manifest: { + name: 'Notpad', + short_name: 'Notpad', + description: 'Windows like notpad for cross platform.', + theme_color: '#888888', + background_color: '#d4d4d4', + icons: [ + { + purpose: 'maskable', + sizes: '512x512', + src: 'icon512_maskable.png', + type: 'image/png' + }, + { + purpose: 'any', + sizes: '512x512', + src: 'icon512_rounded.png', + type: 'image/png' + } + ], + orientation: 'any', + display: 'standalone', + dir: 'ltr', + lang: 'en-IN', + start_url: '/Notpad', + scope: '.' + }, + workbox: { + globPatterns: ['**/*.{js,css,html,svg,png,ico}'], + cleanupOutdatedCaches: true, + clientsClaim: true + }, + devOptions: { + enabled: false, + navigateFallback: 'index.html', + suppressWarnings: true, + type: 'module' + } + }) + ] +}); +export { vite_config_default as default }; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvaG9tZS9tdWhhbW1lZC1yYWhpZi9Xb3Jrc3BhY2UvVGF1cmkvTm90cGFkXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvaG9tZS9tdWhhbW1lZC1yYWhpZi9Xb3Jrc3BhY2UvVGF1cmkvTm90cGFkL3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9ob21lL211aGFtbWVkLXJhaGlmL1dvcmtzcGFjZS9UYXVyaS9Ob3RwYWQvdml0ZS5jb25maWcudHNcIjtpbXBvcnQgeyBWaXRlUFdBIH0gZnJvbSAndml0ZS1wbHVnaW4tcHdhJztcbmltcG9ydCB7IGRlZmluZUNvbmZpZyB9IGZyb20gJ3ZpdGUnO1xuaW1wb3J0IHsgc3ZlbHRlIH0gZnJvbSAnQHN2ZWx0ZWpzL3ZpdGUtcGx1Z2luLXN2ZWx0ZSc7XG5pbXBvcnQgcGF0aCBmcm9tICdwYXRoJztcbmltcG9ydCBmcyBmcm9tICdmcyc7XG5cbmZ1bmN0aW9uIGJhc2VVcmwoKSB7XG4gIGNvbnN0IGJhc2VBcmdJbmRleCA9IHByb2Nlc3MuYXJndi5pbmRleE9mKCctLWJhc2UnKTtcbiAgaWYgKGJhc2VBcmdJbmRleCAhPT0gLTEgJiYgYmFzZUFyZ0luZGV4ICsgMSA8IHByb2Nlc3MuYXJndi5sZW5ndGgpIHtcbiAgICByZXR1cm4gcHJvY2Vzcy5hcmd2W2Jhc2VBcmdJbmRleCArIDFdO1xuICB9XG4gIHJldHVybiBudWxsO1xufVxuXG4oZnVuY3Rpb24gKCkge1xuICAvLyBjcmVhdGUgYSBhcHAuanNvbiB3aXRoIHZlcnNpb24gdXNpbmcgcHJvY2Vzcy5lbnYubnBtX3BhY2thZ2VfdmVyc2lvblxuICBjb25zdCBhcHBKc29uID0gcGF0aC5yZXNvbHZlKCcuL3NyYy9hcHAuanNvbicpO1xuICBjb25zdCBjb250ZW50ID0ge1xuICAgIHZlcnNpb246IHByb2Nlc3MuZW52Lm5wbV9wYWNrYWdlX3ZlcnNpb25cbiAgfTtcbiAgZnMud3JpdGVGaWxlU3luYyhhcHBKc29uLCBKU09OLnN0cmluZ2lmeShjb250ZW50LCBudWxsLCAyKSArICdcXG4nKTtcbn0pKCk7XG5cbi8vIGh0dHBzOi8vdml0ZWpzLmRldi9jb25maWcvXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICByZXNvbHZlOiB7XG4gICAgYWxpYXM6IHtcbiAgICAgICdAL3NyYyc6IHBhdGgucmVzb2x2ZSgnLi9zcmMnKSxcbiAgICAgICdAJzogcGF0aC5yZXNvbHZlKCcuL3NyYy9saWInKVxuICAgIH1cbiAgfSxcbiAgZGVmaW5lOiB7XG4gICAgQVBQX1ZFUlNJT046IEpTT04uc3RyaW5naWZ5KHByb2Nlc3MuZW52Lm5wbV9wYWNrYWdlX3ZlcnNpb24pXG4gIH0sXG4gIGJhc2U6ICcvTm90cGFkLycsXG4gIGJ1aWxkOiB7XG4gICAgb3V0RGlyOiAnd3d3JyxcbiAgICByb2xsdXBPcHRpb25zOiB7XG4gICAgICBvdXRwdXQ6IHtcbiAgICAgICAgLy8gaHR0cHM6Ly9naXRodWIuY29tL3ZpdGVqcy92aXRlL2Rpc2N1c3Npb25zLzk0NDAjZGlzY3Vzc2lvbmNvbW1lbnQtNTkxMzc5OFxuICAgICAgICBtYW51YWxDaHVua3MoaWQpIHtcbiAgICAgICAgICBpZiAoaWQuaW5jbHVkZXMoJ25vZGVfbW9kdWxlcycpKSB7XG4gICAgICAgICAgICByZXR1cm4gaWQudG9TdHJpbmcoKS5zcGxpdCgnbm9kZV9tb2R1bGVzLycpWzFdLnNwbGl0KCcvJylbMF0udG9TdHJpbmcoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH0sXG4gIHNlcnZlcjoge1xuICAgIHBvcnQ6IDUxNzMsXG4gICAgc3RyaWN0UG9ydDogdHJ1ZVxuICB9LFxuICBwbHVnaW5zOiBbXG4gICAgc3ZlbHRlKCksXG4gICAgVml0ZVBXQSh7XG4gICAgICByZWdpc3RlclR5cGU6ICdhdXRvVXBkYXRlJyxcbiAgICAgIGluamVjdFJlZ2lzdGVyOiAnYXV0bycsXG4gICAgICBiYXNlOiBiYXNlVXJsKCkgPz8gJy9Ob3RwYWQvJyxcbiAgICAgIHB3YUFzc2V0czoge1xuICAgICAgICBkaXNhYmxlZDogZmFsc2UsXG4gICAgICAgIGNvbmZpZzogdHJ1ZVxuICAgICAgfSxcbiAgICAgIG1hbmlmZXN0OiB7XG4gICAgICAgIG5hbWU6ICdOb3RwYWQnLFxuICAgICAgICBzaG9ydF9uYW1lOiAnTm90cGFkJyxcbiAgICAgICAgZGVzY3JpcHRpb246ICdXaW5kb3dzIGxpa2Ugbm90cGFkIGZvciBjcm9zcyBwbGF0Zm9ybS4nLFxuICAgICAgICB0aGVtZV9jb2xvcjogJyM4ODg4ODgnLFxuICAgICAgICBiYWNrZ3JvdW5kX2NvbG9yOiAnI2Q0ZDRkNCcsXG4gICAgICAgIGljb25zOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgcHVycG9zZTogJ21hc2thYmxlJyxcbiAgICAgICAgICAgIHNpemVzOiAnNTEyeDUxMicsXG4gICAgICAgICAgICBzcmM6ICdpY29uNTEyX21hc2thYmxlLnBuZycsXG4gICAgICAgICAgICB0eXBlOiAnaW1hZ2UvcG5nJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgcHVycG9zZTogJ2FueScsXG4gICAgICAgICAgICBzaXplczogJzUxMng1MTInLFxuICAgICAgICAgICAgc3JjOiAnaWNvbjUxMl9yb3VuZGVkLnBuZycsXG4gICAgICAgICAgICB0eXBlOiAnaW1hZ2UvcG5nJ1xuICAgICAgICAgIH1cbiAgICAgICAgXSxcbiAgICAgICAgb3JpZW50YXRpb246ICdhbnknLFxuICAgICAgICBkaXNwbGF5OiAnc3RhbmRhbG9uZScsXG4gICAgICAgIGRpcjogJ2x0cicsXG4gICAgICAgIGxhbmc6ICdlbi1JTicsXG4gICAgICAgIHN0YXJ0X3VybDogJy9Ob3RwYWQnLFxuICAgICAgICBzY29wZTogJy4nXG4gICAgICB9LFxuICAgICAgd29ya2JveDoge1xuICAgICAgICBnbG9iUGF0dGVybnM6IFsnKiovKi57anMsY3NzLGh0bWwsc3ZnLHBuZyxpY299J10sXG4gICAgICAgIGNsZWFudXBPdXRkYXRlZENhY2hlczogdHJ1ZSxcbiAgICAgICAgY2xpZW50c0NsYWltOiB0cnVlXG4gICAgICB9LFxuICAgICAgZGV2T3B0aW9uczoge1xuICAgICAgICBlbmFibGVkOiBmYWxzZSxcbiAgICAgICAgbmF2aWdhdGVGYWxsYmFjazogJ2luZGV4Lmh0bWwnLFxuICAgICAgICBzdXBwcmVzc1dhcm5pbmdzOiB0cnVlLFxuICAgICAgICB0eXBlOiAnbW9kdWxlJ1xuICAgICAgfVxuICAgIH0pXG4gIF1cbn0pO1xuIl0sCiAgIm1hcHBpbmdzIjogIjtBQUFtVCxTQUFTLGVBQWU7QUFDM1UsU0FBUyxvQkFBb0I7QUFDN0IsU0FBUyxjQUFjO0FBQ3ZCLE9BQU8sVUFBVTtBQUNqQixPQUFPLFFBQVE7QUFFZixTQUFTLFVBQVU7QUFDakIsUUFBTSxlQUFlLFFBQVEsS0FBSyxRQUFRLFFBQVE7QUFDbEQsTUFBSSxpQkFBaUIsTUFBTSxlQUFlLElBQUksUUFBUSxLQUFLLFFBQVE7QUFDakUsV0FBTyxRQUFRLEtBQUssZUFBZSxDQUFDO0FBQUEsRUFDdEM7QUFDQSxTQUFPO0FBQ1Q7QUFBQSxDQUVDLFdBQVk7QUFFWCxRQUFNLFVBQVUsS0FBSyxRQUFRLGdCQUFnQjtBQUM3QyxRQUFNLFVBQVU7QUFBQSxJQUNkLFNBQVMsUUFBUSxJQUFJO0FBQUEsRUFDdkI7QUFDQSxLQUFHLGNBQWMsU0FBUyxLQUFLLFVBQVUsU0FBUyxNQUFNLENBQUMsSUFBSSxJQUFJO0FBQ25FLEdBQUc7QUFHSCxJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMxQixTQUFTO0FBQUEsSUFDUCxPQUFPO0FBQUEsTUFDTCxTQUFTLEtBQUssUUFBUSxPQUFPO0FBQUEsTUFDN0IsS0FBSyxLQUFLLFFBQVEsV0FBVztBQUFBLElBQy9CO0FBQUEsRUFDRjtBQUFBLEVBQ0EsUUFBUTtBQUFBLElBQ04sYUFBYSxLQUFLLFVBQVUsUUFBUSxJQUFJLG1CQUFtQjtBQUFBLEVBQzdEO0FBQUEsRUFDQSxNQUFNO0FBQUEsRUFDTixPQUFPO0FBQUEsSUFDTCxRQUFRO0FBQUEsSUFDUixlQUFlO0FBQUEsTUFDYixRQUFRO0FBQUE7QUFBQSxRQUVOLGFBQWEsSUFBSTtBQUNmLGNBQUksR0FBRyxTQUFTLGNBQWMsR0FBRztBQUMvQixtQkFBTyxHQUFHLFNBQVMsRUFBRSxNQUFNLGVBQWUsRUFBRSxDQUFDLEVBQUUsTUFBTSxHQUFHLEVBQUUsQ0FBQyxFQUFFLFNBQVM7QUFBQSxVQUN4RTtBQUFBLFFBQ0Y7QUFBQSxNQUNGO0FBQUEsSUFDRjtBQUFBLEVBQ0Y7QUFBQSxFQUNBLFFBQVE7QUFBQSxJQUNOLE1BQU07QUFBQSxJQUNOLFlBQVk7QUFBQSxFQUNkO0FBQUEsRUFDQSxTQUFTO0FBQUEsSUFDUCxPQUFPO0FBQUEsSUFDUCxRQUFRO0FBQUEsTUFDTixjQUFjO0FBQUEsTUFDZCxnQkFBZ0I7QUFBQSxNQUNoQixNQUFNLFFBQVEsS0FBSztBQUFBLE1BQ25CLFdBQVc7QUFBQSxRQUNULFVBQVU7QUFBQSxRQUNWLFFBQVE7QUFBQSxNQUNWO0FBQUEsTUFDQSxVQUFVO0FBQUEsUUFDUixNQUFNO0FBQUEsUUFDTixZQUFZO0FBQUEsUUFDWixhQUFhO0FBQUEsUUFDYixhQUFhO0FBQUEsUUFDYixrQkFBa0I7QUFBQSxRQUNsQixPQUFPO0FBQUEsVUFDTDtBQUFBLFlBQ0UsU0FBUztBQUFBLFlBQ1QsT0FBTztBQUFBLFlBQ1AsS0FBSztBQUFBLFlBQ0wsTUFBTTtBQUFBLFVBQ1I7QUFBQSxVQUNBO0FBQUEsWUFDRSxTQUFTO0FBQUEsWUFDVCxPQUFPO0FBQUEsWUFDUCxLQUFLO0FBQUEsWUFDTCxNQUFNO0FBQUEsVUFDUjtBQUFBLFFBQ0Y7QUFBQSxRQUNBLGFBQWE7QUFBQSxRQUNiLFNBQVM7QUFBQSxRQUNULEtBQUs7QUFBQSxRQUNMLE1BQU07QUFBQSxRQUNOLFdBQVc7QUFBQSxRQUNYLE9BQU87QUFBQSxNQUNUO0FBQUEsTUFDQSxTQUFTO0FBQUEsUUFDUCxjQUFjLENBQUMsZ0NBQWdDO0FBQUEsUUFDL0MsdUJBQXVCO0FBQUEsUUFDdkIsY0FBYztBQUFBLE1BQ2hCO0FBQUEsTUFDQSxZQUFZO0FBQUEsUUFDVixTQUFTO0FBQUEsUUFDVCxrQkFBa0I7QUFBQSxRQUNsQixrQkFBa0I7QUFBQSxRQUNsQixNQUFNO0FBQUEsTUFDUjtBQUFBLElBQ0YsQ0FBQztBQUFBLEVBQ0g7QUFDRixDQUFDOyIsCiAgIm5hbWVzIjogW10KfQo= From ed6f9a72669357d6093865313371c8993472dcaf Mon Sep 17 00:00:00 2001 From: Muhammed-Rahif Date: Sun, 1 Dec 2024 14:30:18 +0530 Subject: [PATCH 5/7] fix(shortcuts): remove unwanted trigger button from shortcuts dialog that caused scroll issues --- src/lib/components/ShortcutsDialog.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/components/ShortcutsDialog.svelte b/src/lib/components/ShortcutsDialog.svelte index 5e615f05..a8534b15 100644 --- a/src/lib/components/ShortcutsDialog.svelte +++ b/src/lib/components/ShortcutsDialog.svelte @@ -33,8 +33,6 @@ - - Shortcuts From d91c1e8d285c8895037d4bf35307ee91cee1e105 Mon Sep 17 00:00:00 2001 From: Muhammed-Rahif Date: Sun, 1 Dec 2024 19:47:18 +0530 Subject: [PATCH 6/7] chore(lint): tsc svelte module export errors suppressed only for linting - Add new icons: Minus, Circle, ChevronRight, and Search - Exclude certain files from tsconfig.json - Remove preventScroll property from Dialog.Root in FindDialog.svelte - Update icon import paths in command-input.svelte, menubar-radio-item.svelte, menubar-sub-trigger.svelte, context-menu-radio-item.svelte, menubar-checkbox-item.svelte, context-menu-checkbox-item.svelte, dialog-content.svelte - Adjust styling in AboutDialog.svelte and EditorTitle.svelte --- package.json | 2 +- src/app.json | 4 +- src/lib/components/AboutDialog.svelte | 2 +- src/lib/components/EditorTitle.svelte | 2 +- src/lib/components/FindDialog.svelte | 2 +- src/lib/components/MenuBar.svelte | 2 +- .../components/font-dialog/FontDialog.svelte | 2 +- .../font-dialog/FontSizeCombobox.svelte | 89 +++++++-------- src/lib/components/icons/ChevronRight.svelte | 10 ++ src/lib/components/icons/Circle.svelte | 12 +++ src/lib/components/icons/Minus.svelte | 10 ++ src/lib/components/icons/Search.svelte | 9 ++ .../components/ui/checkbox/checkbox.svelte | 4 +- .../ui/command/command-input.svelte | 2 +- .../context-menu-checkbox-item.svelte | 4 +- .../context-menu-radio-item.svelte | 2 +- .../context-menu-sub-trigger.svelte | 2 +- .../ui/dialog/dialog-content.svelte | 6 +- .../ui/menubar/menubar-checkbox-item.svelte | 4 +- .../ui/menubar/menubar-radio-item.svelte | 2 +- .../ui/menubar/menubar-sub-trigger.svelte | 2 +- tsconfig.check.json | 7 ++ ....timestamp-1731853281213-7678d18cfc336.mjs | 101 ------------------ ....timestamp-1732543347608-6a23bfb58b803.mjs | 101 ------------------ 24 files changed, 111 insertions(+), 272 deletions(-) create mode 100644 src/lib/components/icons/ChevronRight.svelte create mode 100644 src/lib/components/icons/Circle.svelte create mode 100644 src/lib/components/icons/Minus.svelte create mode 100644 src/lib/components/icons/Search.svelte create mode 100644 tsconfig.check.json delete mode 100644 vite.config.ts.timestamp-1731853281213-7678d18cfc336.mjs delete mode 100644 vite.config.ts.timestamp-1732543347608-6a23bfb58b803.mjs diff --git a/package.json b/package.json index 780f23ab..d153095a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "check": "svelte-check --tsconfig ./tsconfig.json", "predeploy": "npm run build", "deploy": "gh-pages -d www -m 'chore(gh-pages): updates' -f --nojekyll", - "lint": "prettier --check . && eslint . && npx tsc --noEmit", + "lint": "prettier --check . && eslint . && npx tsc --noEmit --project tsconfig.check.json", "format": "prettier --write .", "tauri": "tauri" }, diff --git a/src/app.json b/src/app.json index 0967ef42..e20839d7 100644 --- a/src/app.json +++ b/src/app.json @@ -1 +1,3 @@ -{} +{ + "version": "1.0.0-3" +} diff --git a/src/lib/components/AboutDialog.svelte b/src/lib/components/AboutDialog.svelte index aeafea15..5644711a 100644 --- a/src/lib/components/AboutDialog.svelte +++ b/src/lib/components/AboutDialog.svelte @@ -46,7 +46,7 @@ About Notpad -
    +
    icon diff --git a/src/lib/components/EditorTitle.svelte b/src/lib/components/EditorTitle.svelte index 62a975ce..43d7a96a 100644 --- a/src/lib/components/EditorTitle.svelte +++ b/src/lib/components/EditorTitle.svelte @@ -91,7 +91,7 @@ class={cn('h-6 w-6 p-0', { 'pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100': $activeTabId !== editor.id, - 'ml-1.5 mr-1': $activeTabId === editor.id + 'ml-1 mr-1': $activeTabId === editor.id })} variant={$activeTabId === editor.id ? 'secondary' : 'link'} > diff --git a/src/lib/components/FindDialog.svelte b/src/lib/components/FindDialog.svelte index 384d77ab..9e82fe47 100644 --- a/src/lib/components/FindDialog.svelte +++ b/src/lib/components/FindDialog.svelte @@ -40,7 +40,7 @@ }); - + Find And Replace diff --git a/src/lib/components/MenuBar.svelte b/src/lib/components/MenuBar.svelte index 5e4b4a94..9cef7f01 100644 --- a/src/lib/components/MenuBar.svelte +++ b/src/lib/components/MenuBar.svelte @@ -147,7 +147,7 @@ Help - + Shortcuts diff --git a/src/lib/components/font-dialog/FontDialog.svelte b/src/lib/components/font-dialog/FontDialog.svelte index 18f73446..8f922c04 100644 --- a/src/lib/components/font-dialog/FontDialog.svelte +++ b/src/lib/components/font-dialog/FontDialog.svelte @@ -47,7 +47,7 @@ -
    +
    diff --git a/src/lib/components/font-dialog/FontSizeCombobox.svelte b/src/lib/components/font-dialog/FontSizeCombobox.svelte index 54fddada..14a206f8 100644 --- a/src/lib/components/font-dialog/FontSizeCombobox.svelte +++ b/src/lib/components/font-dialog/FontSizeCombobox.svelte @@ -11,14 +11,13 @@ import { get } from 'svelte/store'; import { FontSize } from '@/types/SettingsTypes'; - let open = $state(false); - interface Props { value: FontSize; } + let triggerRef = $state(null!); + let open = $state(false); let { value = $bindable() }: Props = $props(); - let selectedValue = $derived( Object.values(FontSize).find((f) => f === value) ?? $settings.fontSize ); @@ -26,22 +25,16 @@ // We want to refocus the trigger button when the user selects // an item from the list so users can continue navigating the // rest of the form with the keyboard. - function closeAndFocusTrigger(triggerId: string) { + function closeAndFocusTrigger() { open = false; tick().then(() => { - document.getElementById(triggerId)?.focus(); + triggerRef.focus(); }); } - const onSelect = ( - currentValue: FontSize | string, - ids: { - content: string; - trigger: string; - } - ) => { + const onSelect = (currentValue: FontSize | string) => { value = currentValue as FontSize; - closeAndFocusTrigger(ids.trigger); + closeAndFocusTrigger(); }; onMount(() => () => { @@ -50,40 +43,38 @@ - {#snippet children({ ids })} - - {#snippet children({ builder })} -
    - -
    - -
    - {/snippet} -
    - - - - No font size found. - - {#each Object.values(FontSize).filter((s) => !isNaN(Number(s))) as fontSize} - {@const fSize = fontSize.toString()} - onSelect(fontSize, ids)}> - - {fontSize == FontSize.Size16 ? `${fontSize} (Default)` : fontSize} - - {/each} - - - - {/snippet} + + {#snippet child({ props })} +
    + +
    + +
    + {/snippet} +
    + + + + No font size found. + + {#each Object.values(FontSize).filter((s) => !isNaN(Number(s))) as fontSize} + {@const fSize = fontSize.toString()} + onSelect(fontSize)}> + + {fontSize == FontSize.Size16 ? `${fontSize} (Default)` : fontSize} + + {/each} + + +
    diff --git a/src/lib/components/icons/ChevronRight.svelte b/src/lib/components/icons/ChevronRight.svelte new file mode 100644 index 00000000..ac41e128 --- /dev/null +++ b/src/lib/components/icons/ChevronRight.svelte @@ -0,0 +1,10 @@ + diff --git a/src/lib/components/icons/Circle.svelte b/src/lib/components/icons/Circle.svelte new file mode 100644 index 00000000..3ae2b498 --- /dev/null +++ b/src/lib/components/icons/Circle.svelte @@ -0,0 +1,12 @@ + diff --git a/src/lib/components/icons/Minus.svelte b/src/lib/components/icons/Minus.svelte new file mode 100644 index 00000000..aef77c36 --- /dev/null +++ b/src/lib/components/icons/Minus.svelte @@ -0,0 +1,10 @@ + diff --git a/src/lib/components/icons/Search.svelte b/src/lib/components/icons/Search.svelte new file mode 100644 index 00000000..59de4ae7 --- /dev/null +++ b/src/lib/components/icons/Search.svelte @@ -0,0 +1,9 @@ + diff --git a/src/lib/components/ui/checkbox/checkbox.svelte b/src/lib/components/ui/checkbox/checkbox.svelte index d3f1e28a..58f43aa1 100644 --- a/src/lib/components/ui/checkbox/checkbox.svelte +++ b/src/lib/components/ui/checkbox/checkbox.svelte @@ -1,8 +1,8 @@