@prismicio/svelte 2.2.2-pr.61.b93ef15 → 2.2.2-pr.62.109b5be
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.
|
@@ -13,11 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
const defaultProps = getDefaultProps()
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
type Props = {
|
|
17
|
+
zIndex?: number
|
|
18
|
+
background?: string
|
|
19
|
+
class?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
zIndex = defaultProps.zIndex,
|
|
24
|
+
background = defaultProps.background,
|
|
25
|
+
class: className,
|
|
26
|
+
}: Props = $props()
|
|
18
27
|
|
|
19
|
-
let slices = getDefaultSlices()
|
|
20
|
-
let message = getDefaultMessage()
|
|
28
|
+
let slices = $state.raw(getDefaultSlices())
|
|
29
|
+
let message = $state(getDefaultMessage())
|
|
21
30
|
|
|
22
31
|
if (typeof window !== "undefined") {
|
|
23
32
|
const simulatorManager = new SimulatorManager()
|
|
@@ -42,7 +51,7 @@
|
|
|
42
51
|
</script>
|
|
43
52
|
|
|
44
53
|
<div
|
|
45
|
-
class="{simulatorClass} {
|
|
54
|
+
class="{simulatorClass} {className}"
|
|
46
55
|
style="z-index: {zIndex}; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; overflow: auto; background: {background}"
|
|
47
56
|
>
|
|
48
57
|
{#if message}
|
|
@@ -51,14 +60,16 @@
|
|
|
51
60
|
{@html message}
|
|
52
61
|
</article>
|
|
53
62
|
{:else if slices.length}
|
|
54
|
-
<!-- svelte-ignore
|
|
63
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
55
64
|
<div
|
|
56
65
|
id="root"
|
|
57
66
|
class={simulatorRootClass}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
onclick={onClickHandler}
|
|
68
|
+
onsubmit={disableEventHandler}
|
|
69
|
+
onkeypress={disableEventHandler}
|
|
61
70
|
>
|
|
71
|
+
<!-- TODO: Use a snippet in the next major; it would break `let:slices`. -->
|
|
72
|
+
<!-- svelte-ignore slot_element_deprecated -->
|
|
62
73
|
<slot {slices} />
|
|
63
74
|
</div>
|
|
64
75
|
{/if}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
zIndex?: number;
|
|
3
|
+
background?: string;
|
|
4
|
+
class?: string;
|
|
5
|
+
};
|
|
1
6
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
7
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
8
|
$$bindings?: Bindings;
|
|
@@ -16,11 +21,7 @@ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
|
16
21
|
} ? Props extends Record<string, never> ? any : {
|
|
17
22
|
children?: any;
|
|
18
23
|
} : {});
|
|
19
|
-
declare const SliceSimulator: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
[x: string]: any;
|
|
21
|
-
zIndex?: number | undefined;
|
|
22
|
-
background?: string | undefined;
|
|
23
|
-
}, {
|
|
24
|
+
declare const SliceSimulator: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<Props, {
|
|
24
25
|
default: {
|
|
25
26
|
slices: import("@prismicio/client").SliceZone;
|
|
26
27
|
};
|
|
@@ -30,6 +31,6 @@ declare const SliceSimulator: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_
|
|
|
30
31
|
default: {
|
|
31
32
|
slices: import("@prismicio/client").SliceZone;
|
|
32
33
|
};
|
|
33
|
-
}, {},
|
|
34
|
+
}, {}, "">;
|
|
34
35
|
type SliceSimulator = InstanceType<typeof SliceSimulator>;
|
|
35
36
|
export default SliceSimulator;
|
package/package.json
CHANGED
|
@@ -13,11 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
const defaultProps = getDefaultProps()
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
type Props = {
|
|
17
|
+
zIndex?: number
|
|
18
|
+
background?: string
|
|
19
|
+
class?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
zIndex = defaultProps.zIndex,
|
|
24
|
+
background = defaultProps.background,
|
|
25
|
+
class: className,
|
|
26
|
+
}: Props = $props()
|
|
18
27
|
|
|
19
|
-
let slices = getDefaultSlices()
|
|
20
|
-
let message = getDefaultMessage()
|
|
28
|
+
let slices = $state.raw(getDefaultSlices())
|
|
29
|
+
let message = $state(getDefaultMessage())
|
|
21
30
|
|
|
22
31
|
if (typeof window !== "undefined") {
|
|
23
32
|
const simulatorManager = new SimulatorManager()
|
|
@@ -42,7 +51,7 @@
|
|
|
42
51
|
</script>
|
|
43
52
|
|
|
44
53
|
<div
|
|
45
|
-
class="{simulatorClass} {
|
|
54
|
+
class="{simulatorClass} {className}"
|
|
46
55
|
style="z-index: {zIndex}; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; overflow: auto; background: {background}"
|
|
47
56
|
>
|
|
48
57
|
{#if message}
|
|
@@ -51,14 +60,16 @@
|
|
|
51
60
|
{@html message}
|
|
52
61
|
</article>
|
|
53
62
|
{:else if slices.length}
|
|
54
|
-
<!-- svelte-ignore
|
|
63
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
55
64
|
<div
|
|
56
65
|
id="root"
|
|
57
66
|
class={simulatorRootClass}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
onclick={onClickHandler}
|
|
68
|
+
onsubmit={disableEventHandler}
|
|
69
|
+
onkeypress={disableEventHandler}
|
|
61
70
|
>
|
|
71
|
+
<!-- TODO: Use a snippet in the next major; it would break `let:slices`. -->
|
|
72
|
+
<!-- svelte-ignore slot_element_deprecated -->
|
|
62
73
|
<slot {slices} />
|
|
63
74
|
</div>
|
|
64
75
|
{/if}
|