@prismicio/svelte 2.2.2-pr.62.4f19e8b → 2.2.3-pr.64.25522e1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PrismicTable.svelte +6 -6
- package/dist/SliceSimulator.svelte +7 -5
- package/dist/SliceSimulator.svelte.d.ts +9 -31
- package/dist/kit/PrismicPreview.svelte +8 -6
- package/package.json +9 -9
- package/src/PrismicTable.svelte +6 -6
- package/src/SliceSimulator.svelte +7 -5
- package/src/kit/PrismicPreview.svelte +8 -6
package/dist/PrismicTable.svelte
CHANGED
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
|
|
31
31
|
const { field, components = {}, fallback: Fallback }: Props = $props()
|
|
32
32
|
|
|
33
|
-
const Table = components.table
|
|
34
|
-
const Thead = components.thead
|
|
35
|
-
const Tbody = components.tbody
|
|
36
|
-
const Tr = components.tr
|
|
37
|
-
const Th = components.th
|
|
38
|
-
const Td = components.td
|
|
33
|
+
const Table = $derived(components.table)
|
|
34
|
+
const Thead = $derived(components.thead)
|
|
35
|
+
const Tbody = $derived(components.tbody)
|
|
36
|
+
const Tr = $derived(components.tr)
|
|
37
|
+
const Th = $derived(components.th)
|
|
38
|
+
const Td = $derived(components.td)
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
{#snippet thead(head: TableFieldHead)}
|
|
@@ -10,19 +10,23 @@
|
|
|
10
10
|
simulatorClass,
|
|
11
11
|
simulatorRootClass,
|
|
12
12
|
} from "@prismicio/simulator/kit"
|
|
13
|
+
import type { Snippet } from "svelte"
|
|
14
|
+
import type { ClassValue } from "svelte/elements"
|
|
13
15
|
|
|
14
16
|
const defaultProps = getDefaultProps()
|
|
15
17
|
|
|
16
18
|
type Props = {
|
|
17
19
|
zIndex?: number
|
|
18
20
|
background?: string
|
|
19
|
-
class?:
|
|
21
|
+
class?: ClassValue
|
|
22
|
+
children?: Snippet<[{ slices: ReturnType<typeof getDefaultSlices> }]>
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
const {
|
|
23
26
|
zIndex = defaultProps.zIndex,
|
|
24
27
|
background = defaultProps.background,
|
|
25
28
|
class: className,
|
|
29
|
+
children,
|
|
26
30
|
}: Props = $props()
|
|
27
31
|
|
|
28
32
|
let slices = $state.raw(getDefaultSlices())
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
</script>
|
|
52
56
|
|
|
53
57
|
<div
|
|
54
|
-
class=
|
|
58
|
+
class={[simulatorClass, className]}
|
|
55
59
|
style="z-index: {zIndex}; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; overflow: auto; background: {background}"
|
|
56
60
|
>
|
|
57
61
|
{#if message}
|
|
@@ -68,9 +72,7 @@
|
|
|
68
72
|
onsubmit={disableEventHandler}
|
|
69
73
|
onkeypress={disableEventHandler}
|
|
70
74
|
>
|
|
71
|
-
|
|
72
|
-
<!-- svelte-ignore slot_element_deprecated -->
|
|
73
|
-
<slot {slices} />
|
|
75
|
+
{@render children?.({ slices })}
|
|
74
76
|
</div>
|
|
75
77
|
{/if}
|
|
76
78
|
</div>
|
|
@@ -1,36 +1,14 @@
|
|
|
1
|
+
import { getDefaultSlices } from "@prismicio/simulator/kit";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { ClassValue } from "svelte/elements";
|
|
1
4
|
type Props = {
|
|
2
5
|
zIndex?: number;
|
|
3
6
|
background?: string;
|
|
4
|
-
class?:
|
|
7
|
+
class?: ClassValue;
|
|
8
|
+
children?: Snippet<[{
|
|
9
|
+
slices: ReturnType<typeof getDefaultSlices>;
|
|
10
|
+
}]>;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
$$bindings?: Bindings;
|
|
9
|
-
} & Exports;
|
|
10
|
-
(internal: unknown, props: Props & {
|
|
11
|
-
$$events?: Events;
|
|
12
|
-
$$slots?: Slots;
|
|
13
|
-
}): Exports & {
|
|
14
|
-
$set?: any;
|
|
15
|
-
$on?: any;
|
|
16
|
-
};
|
|
17
|
-
z_$$bindings?: Bindings;
|
|
18
|
-
}
|
|
19
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
20
|
-
default: any;
|
|
21
|
-
} ? Props extends Record<string, never> ? any : {
|
|
22
|
-
children?: any;
|
|
23
|
-
} : {});
|
|
24
|
-
declare const SliceSimulator: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Props, {
|
|
25
|
-
default: {
|
|
26
|
-
slices: import("@prismicio/client").SliceZone;
|
|
27
|
-
};
|
|
28
|
-
}>, {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {
|
|
31
|
-
default: {
|
|
32
|
-
slices: import("@prismicio/client").SliceZone;
|
|
33
|
-
};
|
|
34
|
-
}, {}, "">;
|
|
35
|
-
type SliceSimulator = InstanceType<typeof SliceSimulator>;
|
|
12
|
+
declare const SliceSimulator: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type SliceSimulator = ReturnType<typeof SliceSimulator>;
|
|
36
14
|
export default SliceSimulator;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { beforeNavigate, goto,
|
|
2
|
+
import { beforeNavigate, goto, refreshAll } from "$app/navigation"
|
|
3
3
|
import { getToolbarSrc } from "@prismicio/client"
|
|
4
|
+
import { VERSION } from "@sveltejs/kit"
|
|
4
5
|
import { onMount } from "svelte"
|
|
5
6
|
|
|
6
7
|
type Props = {
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"prismicPreviewUpdate",
|
|
37
38
|
(event) => {
|
|
38
39
|
event.preventDefault()
|
|
39
|
-
|
|
40
|
+
refreshAll()
|
|
40
41
|
},
|
|
41
42
|
{ signal: controller.signal },
|
|
42
43
|
)
|
|
@@ -55,10 +56,11 @@
|
|
|
55
56
|
),
|
|
56
57
|
window.location.origin,
|
|
57
58
|
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
// SvelteKit 3 replaced `noScroll` with `reset`, and
|
|
60
|
+
// throws if `noScroll` is passed.
|
|
61
|
+
(VERSION.startsWith("2.")
|
|
62
|
+
? { invalidateAll: true, noScroll: true }
|
|
63
|
+
: { refreshAll: true, reset: false }) as Parameters<typeof goto>[1],
|
|
62
64
|
)
|
|
63
65
|
},
|
|
64
66
|
{ signal: controller.signal },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismicio/svelte",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3-pr.64.25522e1",
|
|
4
4
|
"description": "Svelte components to present Prismic content.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismic",
|
|
@@ -64,25 +64,25 @@
|
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@prismicio/client": "^7.22.3",
|
|
66
66
|
"@prismicio/mock": "^0.7.2",
|
|
67
|
-
"@sveltejs/kit": "^
|
|
67
|
+
"@sveltejs/kit": "^3.0.1",
|
|
68
68
|
"@sveltejs/package": "^3.0.0",
|
|
69
69
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
70
70
|
"@testing-library/svelte": "^5.4.2",
|
|
71
71
|
"@types/node": "^26.6.5",
|
|
72
|
-
"@vitest/coverage-v8": "^5.0.
|
|
72
|
+
"@vitest/coverage-v8": "^5.0.4",
|
|
73
73
|
"globals": "^17.13.0",
|
|
74
|
-
"happy-dom": "^
|
|
75
|
-
"oxfmt": "^0.
|
|
76
|
-
"oxlint": "^1.
|
|
74
|
+
"happy-dom": "^21.0.1",
|
|
75
|
+
"oxfmt": "^0.73.0",
|
|
76
|
+
"oxlint": "^1.88.0",
|
|
77
77
|
"standard-version": "^9.5.0",
|
|
78
78
|
"svelte": "^5.57.2",
|
|
79
79
|
"typescript": "^6.0.3",
|
|
80
|
-
"vitest": "^5.0.
|
|
80
|
+
"vitest": "^5.0.4"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@prismicio/client": ">=7",
|
|
84
|
-
"@sveltejs/kit": "^2",
|
|
85
|
-
"svelte": "^5"
|
|
84
|
+
"@sveltejs/kit": "^2.27.0 || ^3.0.0",
|
|
85
|
+
"svelte": "^5.16.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependenciesMeta": {
|
|
88
88
|
"@sveltejs/kit": {
|
package/src/PrismicTable.svelte
CHANGED
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
|
|
31
31
|
const { field, components = {}, fallback: Fallback }: Props = $props()
|
|
32
32
|
|
|
33
|
-
const Table = components.table
|
|
34
|
-
const Thead = components.thead
|
|
35
|
-
const Tbody = components.tbody
|
|
36
|
-
const Tr = components.tr
|
|
37
|
-
const Th = components.th
|
|
38
|
-
const Td = components.td
|
|
33
|
+
const Table = $derived(components.table)
|
|
34
|
+
const Thead = $derived(components.thead)
|
|
35
|
+
const Tbody = $derived(components.tbody)
|
|
36
|
+
const Tr = $derived(components.tr)
|
|
37
|
+
const Th = $derived(components.th)
|
|
38
|
+
const Td = $derived(components.td)
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
{#snippet thead(head: TableFieldHead)}
|
|
@@ -10,19 +10,23 @@
|
|
|
10
10
|
simulatorClass,
|
|
11
11
|
simulatorRootClass,
|
|
12
12
|
} from "@prismicio/simulator/kit"
|
|
13
|
+
import type { Snippet } from "svelte"
|
|
14
|
+
import type { ClassValue } from "svelte/elements"
|
|
13
15
|
|
|
14
16
|
const defaultProps = getDefaultProps()
|
|
15
17
|
|
|
16
18
|
type Props = {
|
|
17
19
|
zIndex?: number
|
|
18
20
|
background?: string
|
|
19
|
-
class?:
|
|
21
|
+
class?: ClassValue
|
|
22
|
+
children?: Snippet<[{ slices: ReturnType<typeof getDefaultSlices> }]>
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
const {
|
|
23
26
|
zIndex = defaultProps.zIndex,
|
|
24
27
|
background = defaultProps.background,
|
|
25
28
|
class: className,
|
|
29
|
+
children,
|
|
26
30
|
}: Props = $props()
|
|
27
31
|
|
|
28
32
|
let slices = $state.raw(getDefaultSlices())
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
</script>
|
|
52
56
|
|
|
53
57
|
<div
|
|
54
|
-
class=
|
|
58
|
+
class={[simulatorClass, className]}
|
|
55
59
|
style="z-index: {zIndex}; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; overflow: auto; background: {background}"
|
|
56
60
|
>
|
|
57
61
|
{#if message}
|
|
@@ -68,9 +72,7 @@
|
|
|
68
72
|
onsubmit={disableEventHandler}
|
|
69
73
|
onkeypress={disableEventHandler}
|
|
70
74
|
>
|
|
71
|
-
|
|
72
|
-
<!-- svelte-ignore slot_element_deprecated -->
|
|
73
|
-
<slot {slices} />
|
|
75
|
+
{@render children?.({ slices })}
|
|
74
76
|
</div>
|
|
75
77
|
{/if}
|
|
76
78
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { beforeNavigate, goto,
|
|
2
|
+
import { beforeNavigate, goto, refreshAll } from "$app/navigation"
|
|
3
3
|
import { getToolbarSrc } from "@prismicio/client"
|
|
4
|
+
import { VERSION } from "@sveltejs/kit"
|
|
4
5
|
import { onMount } from "svelte"
|
|
5
6
|
|
|
6
7
|
type Props = {
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"prismicPreviewUpdate",
|
|
37
38
|
(event) => {
|
|
38
39
|
event.preventDefault()
|
|
39
|
-
|
|
40
|
+
refreshAll()
|
|
40
41
|
},
|
|
41
42
|
{ signal: controller.signal },
|
|
42
43
|
)
|
|
@@ -55,10 +56,11 @@
|
|
|
55
56
|
),
|
|
56
57
|
window.location.origin,
|
|
57
58
|
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
// SvelteKit 3 replaced `noScroll` with `reset`, and
|
|
60
|
+
// throws if `noScroll` is passed.
|
|
61
|
+
(VERSION.startsWith("2.")
|
|
62
|
+
? { invalidateAll: true, noScroll: true }
|
|
63
|
+
: { refreshAll: true, reset: false }) as Parameters<typeof goto>[1],
|
|
62
64
|
)
|
|
63
65
|
},
|
|
64
66
|
{ signal: controller.signal },
|