Skip to content

Commit d1d28f5

Browse files
committed
Update SvelteKit & prettier plugin, Mark bindable props as bindable, Make container nodes accept children and switch from slot to @render blocks
1 parent be572b9 commit d1d28f5

33 files changed

+98
-62
lines changed

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"devDependencies": {
4646
"@sveltejs/adapter-static": "^3.0.1",
47-
"@sveltejs/kit": "^2.0.4",
47+
"@sveltejs/kit": "^2.5.7",
4848
"@sveltejs/package": "^2.1.0",
4949
"@tailwindcss/typography": "^0.5.7",
5050
"@testing-library/svelte": "^5.1.0",
@@ -61,7 +61,7 @@
6161
"lodash.clonedeep": "^4.5.0",
6262
"plop": "^4.0.1",
6363
"prettier": "^3.1.1",
64-
"prettier-plugin-svelte": "^3.1.2",
64+
"prettier-plugin-svelte": "^3.2.3",
6565
"svelte": "5.0.0-next.114",
6666
"svelte-check": "^3.6.9",
6767
"svelte-highlight": "^7.3.0",
@@ -269,4 +269,4 @@
269269
]
270270
}
271271
}
272-
}
272+
}

src/lib/Arc.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Arc.html), [
2929
3030
interface $$Events extends KonvaEvents {}
3131
32-
let { config, staticConfig = false }: Props<Konva.ArcConfig> = $props();
32+
let { config = $bindable(), staticConfig = false }: Props<Konva.ArcConfig> = $props();
3333
3434
export const handle = new Konva.Arc(config);
3535

src/lib/Arrow.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Arrow.html),
2929
3030
interface $$Events extends KonvaEvents {}
3131
32-
let { config, staticConfig = false }: Props<Konva.ArrowConfig> = $props();
32+
let { config = $bindable(), staticConfig = false }: Props<Konva.ArrowConfig> = $props();
3333
3434
export const handle = new Konva.Arrow(config);
3535

src/lib/Circle.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Circle.html)
2929
3030
interface $$Events extends KonvaEvents {}
3131
32-
let { config, staticConfig = false }: Props<Konva.CircleConfig> = $props();
32+
let { config = $bindable(), staticConfig = false }: Props<Konva.CircleConfig> = $props();
3333
3434
export const handle = new Konva.Circle(config);
3535

src/lib/Ellipse.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Ellipse.html
2929
3030
interface $$Events extends KonvaEvents {}
3131
32-
let { config, staticConfig = false }: Props<Konva.EllipseConfig> = $props();
32+
let { config = $bindable(), staticConfig = false }: Props<Konva.EllipseConfig> = $props();
3333
3434
export const handle = new Konva.Ellipse(config);
3535

src/lib/Group.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Group.html),
3030
} from '$lib/util/manageContext';
3131
import { registerEvents, type KonvaEvents } from '$lib/util/events';
3232
import { copyExistingKeys } from '$lib/util/object';
33-
import { type Props } from '$lib/util/props';
33+
import { type PropsContainer } from '$lib/util/props';
3434
3535
interface $$Events extends KonvaEvents {}
3636
37-
let { config = {}, staticConfig = false }: Props<Konva.GroupConfig | undefined> = $props();
37+
let {
38+
children,
39+
config = $bindable({}),
40+
staticConfig = false
41+
}: PropsContainer<Konva.GroupConfig | undefined> = $props();
3842
3943
export const handle = new Konva.Group(config);
4044
@@ -76,6 +80,6 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Group.html),
7680
setContainerContext(Container.Group, inner);
7781
</script>
7882

79-
{#if isReady}
80-
<slot />
83+
{#if isReady && children}
84+
{@render children()}
8185
{/if}

src/lib/Image.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Image.html),
2929
3030
interface $$Events extends KonvaEvents {}
3131
32-
let { config, staticConfig = false }: Props<Konva.ImageConfig> = $props();
32+
let { config = $bindable(), staticConfig = false }: Props<Konva.ImageConfig> = $props();
3333
3434
export const handle = new Konva.Image(config);
3535

src/lib/Label.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Label.html),
3131
type KonvaParent
3232
} from '$lib/util/manageContext';
3333
import { registerEvents, type KonvaEvents } from '$lib/util/events';
34-
import { type Props } from '$lib/util/props';
34+
import { type PropsContainer } from '$lib/util/props';
3535
3636
interface $$Events extends KonvaEvents {}
3737
38-
let { config, staticConfig = false }: Props<Konva.LabelConfig> = $props();
38+
let {
39+
children,
40+
config = $bindable(),
41+
staticConfig = false
42+
}: PropsContainer<Konva.LabelConfig> = $props();
3943
4044
export const handle = new Konva.Label(config);
4145
@@ -77,6 +81,6 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Label.html),
7781
setContainerContext(Container.Label, inner);
7882
</script>
7983

80-
{#if isReady}
81-
<slot />
84+
{#if isReady && children}
85+
{@render children()}
8286
{/if}

src/lib/Layer.svelte

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Layer.html),
2727
import { Container, getParentStage, setContainerContext } from '$lib/util/manageContext';
2828
import { registerEvents, type KonvaEvents } from '$lib/util/events';
2929
import { copyExistingKeys } from '$lib/util/object';
30-
import { type Props } from '$lib/util/props';
30+
import { type PropsContainer } from '$lib/util/props';
3131
3232
interface $$Events extends KonvaEvents {}
3333
34-
let { config = {}, staticConfig = false }: Props<Konva.LayerConfig | undefined> = $props();
34+
let {
35+
children,
36+
config = $bindable({}),
37+
staticConfig = false
38+
}: PropsContainer<Konva.LayerConfig | undefined> = $props();
3539
3640
export const handle = new Konva.Layer(config);
3741
@@ -75,6 +79,6 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Layer.html),
7579
setContainerContext(Container.Layer, inner);
7680
</script>
7781

78-
{#if isReady}
79-
<slot />
82+
{#if isReady && children}
83+
{@render children()}
8084
{/if}

0 commit comments

Comments
 (0)