Skip to content

Commit

Permalink
migrate svelte v5 + shadcn-svelte_next
Browse files Browse the repository at this point in the history
  • Loading branch information
L4Ph committed Dec 23, 2024
1 parent 17c5c1b commit aada57e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
Binary file modified bun.lockb
Binary file not shown.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@
"lucide-svelte": "^0.469.0",
"lz-string": "^1.5.0",
"mode-watcher": "^0.5.0",
"svelte-codemirror-editor": "^1.4.1",
"svelte-file-dropzone": "^2.0.9",
"svelte-sonner": "^0.3.28",
"tailwind-merge": "^2.5.5",
"tailwind-variants": "^0.3.0"
},
"devDependencies": {
"@biomejs/biome": "1.9.2",
"@svelte-put/shortcut": "^3.2.0",
"@svelte-put/shortcut": "^4.1.0",
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.14.0",
"@sveltejs/vite-plugin-svelte": "^4.0.4",
"@sveltejs/kit": "^2.15.0",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/typography": "^0.5.15",
"@tailwindcss/vite": "^4.0.0-beta.8",
"@types/bun": "latest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
</script>

<ContextMenuPrimitive.RadioGroup {...$$restProps} bind:value>
<slot />
<ContextMenuPrimitive.RadioGroup {...rest} bind:value>
{@render children?.()}
</ContextMenuPrimitive.RadioGroup>
10 changes: 8 additions & 2 deletions src/lib/components/ui/dialog/dialog-portal.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<script lang="ts">
import { Dialog as DialogPrimitive } from "bits-ui";
interface Props {
children?: import('svelte').Snippet;
[key: string]: any
}
let { children, ...rest }: Props = $props();
type $$Props = DialogPrimitive.PortalProps;
</script>

<DialogPrimitive.Portal {...$$restProps}>
<slot />
<DialogPrimitive.Portal {...rest}>
{@render children?.()}
</DialogPrimitive.Portal>
4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { readTextFileOnTauri } from "./utils/read-text-file-on-tauri";
import { writeTextFileOnTauri } from "./utils/write-text-file-on-tauri";
let inputText = $state("");
let textarea!: Textarea;
let textarea: Textarea;
let open = $state(true);
let fileInput = $state<HTMLInputElement | null>(null);
let textFilePath = $state<string>("");
Expand Down Expand Up @@ -122,7 +122,7 @@ if (isTauriApp()) {
/>

<main class="container h-screen">
{#if (inputText === "" || !inputText) && !isTauriApp() }
{#if (inputText === "" || !inputText) && !isTauriApp()}
<Dialog.Root bind:open>
<Dialog.Content>
<Dialog.Header>
Expand Down

0 comments on commit aada57e

Please sign in to comment.