From d91c1e8d285c8895037d4bf35307ee91cee1e105 Mon Sep 17 00:00:00 2001 From: Muhammed-Rahif Date: Sun, 1 Dec 2024 19:47:18 +0530 Subject: [PATCH] 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 780f23a..d153095 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 0967ef4..e20839d 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 aeafea1..5644711 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 62a975c..43d7a96 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 384d77a..9e82fe4 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 5e4b4a9..9cef7f0 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 18f7344..8f922c0 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 54fddad..14a206f 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 0000000..ac41e12 --- /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 0000000..3ae2b49 --- /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 0000000..aef77c3 --- /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 0000000..59de4ae --- /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 d3f1e28..58f43aa 100644 --- a/src/lib/components/ui/checkbox/checkbox.svelte +++ b/src/lib/components/ui/checkbox/checkbox.svelte @@ -1,8 +1,8 @@