@prismicio/vue 6.1.2 → 6.1.3-canary.58d692d
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/PrismicImage.cjs.map +1 -1
- package/dist/PrismicImage.js.map +1 -1
- package/dist/PrismicImage.vue.d.cts +14 -11
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicImage.vue.d.ts +14 -11
- package/dist/PrismicImage.vue.d.ts.map +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicLink.cjs.map +1 -1
- package/dist/PrismicLink.js.map +1 -1
- package/dist/PrismicLink.vue.d.cts +17 -13
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.ts +17 -13
- package/dist/PrismicLink.vue.d.ts.map +1 -1
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -3
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +7 -8
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts +6 -7
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts +1 -2
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts +0 -1
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.js.map +1 -1
- package/dist/PrismicRichText/index.d.cts +2 -1
- package/dist/PrismicRichText/index.d.ts +2 -1
- package/dist/PrismicRichText/types.d.cts +1 -2
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.ts +1 -2
- package/dist/PrismicRichText/types.d.ts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +5 -5
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.ts +5 -5
- package/dist/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.cjs.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.d.cts +2 -4
- package/dist/PrismicTable/getTableComponentProps.d.cts.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.d.ts +1 -3
- package/dist/PrismicTable/getTableComponentProps.d.ts.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.js.map +1 -1
- package/dist/PrismicTable/index.d.cts +2 -1
- package/dist/PrismicTable/index.d.ts +2 -1
- package/dist/PrismicTable/types.d.cts +0 -1
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.ts +0 -1
- package/dist/PrismicTable/types.d.ts.map +1 -1
- package/dist/PrismicText.vue.d.cts +4 -5
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.ts +4 -5
- package/dist/PrismicText.vue.d.ts.map +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/SliceSimulator.vue.d.cts +14 -15
- package/dist/SliceSimulator.vue.d.cts.map +1 -1
- package/dist/SliceSimulator.vue.d.ts +14 -15
- package/dist/SliceSimulator.vue.d.ts.map +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +9 -7
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.ts +9 -7
- package/dist/SliceZone/SliceZone.vue.d.ts.map +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.cjs.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.d.cts +0 -1
- package/dist/SliceZone/TODOSliceComponent.d.cts.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.d.ts +0 -1
- package/dist/SliceZone/TODOSliceComponent.d.ts.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.js.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.cjs.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.d.cts +0 -1
- package/dist/SliceZone/defineSliceZoneComponents.d.cts.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.d.ts +0 -1
- package/dist/SliceZone/defineSliceZoneComponents.d.ts.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.js.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.cjs.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.d.cts +0 -1
- package/dist/SliceZone/getSliceComponentProps.d.cts.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.d.ts +0 -1
- package/dist/SliceZone/getSliceComponentProps.d.ts.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.js.map +1 -1
- package/dist/SliceZone/index.d.cts +2 -1
- package/dist/SliceZone/index.d.ts +2 -1
- package/dist/SliceZone/types.d.cts +8 -5
- package/dist/SliceZone/types.d.cts.map +1 -1
- package/dist/SliceZone/types.d.ts +8 -5
- package/dist/SliceZone/types.d.ts.map +1 -1
- package/dist/createPrismic.cjs.map +1 -1
- package/dist/createPrismic.d.cts +17 -8
- package/dist/createPrismic.d.cts.map +1 -1
- package/dist/createPrismic.d.ts +16 -7
- package/dist/createPrismic.d.ts.map +1 -1
- package/dist/createPrismic.js.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/lib/devMsg.cjs.map +1 -1
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/lib/isInternalURL.cjs.map +1 -1
- package/dist/lib/isInternalURL.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +3 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +18 -18
- package/src/PrismicImage.vue +1 -1
- package/src/PrismicLink.vue +2 -2
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
|
-
import * as _$_prismicio_client0 from "@prismicio/client";
|
|
3
|
-
|
|
4
1
|
//#region src/SliceSimulator.vue.d.ts
|
|
5
2
|
/** Props for `<SliceSimulator />`. */
|
|
6
3
|
type SliceSimulatorProps = {
|
|
7
|
-
/** The z-index value of the simulator so that it's displayed above layout elements. */
|
|
4
|
+
/** The z-index value of the simulator so that it's displayed above layout elements. */
|
|
5
|
+
zIndex?: number;
|
|
6
|
+
/** The background color of the simulator to match website design. */
|
|
8
7
|
background?: string;
|
|
9
8
|
};
|
|
10
9
|
declare var __VLS_1: {
|
|
@@ -12,43 +11,43 @@ declare var __VLS_1: {
|
|
|
12
11
|
slice_type: string;
|
|
13
12
|
slice_label: string | null;
|
|
14
13
|
id: string;
|
|
15
|
-
primary: Record<string,
|
|
16
|
-
items: Record<string,
|
|
14
|
+
primary: Record<string, import("@prismicio/client").AnyRegularField>;
|
|
15
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
17
16
|
} | {
|
|
18
17
|
slice_type: string;
|
|
19
18
|
slice_label: null;
|
|
20
19
|
id: string;
|
|
21
20
|
variation: string;
|
|
22
21
|
version: string;
|
|
23
|
-
primary: Record<string,
|
|
24
|
-
items: Record<string,
|
|
22
|
+
primary: Record<string, import("@prismicio/client").AnySlicePrimaryField>;
|
|
23
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
25
24
|
}, ...({
|
|
26
25
|
slice_type: string;
|
|
27
26
|
slice_label: string | null;
|
|
28
27
|
id: string;
|
|
29
|
-
primary: Record<string,
|
|
30
|
-
items: Record<string,
|
|
28
|
+
primary: Record<string, import("@prismicio/client").AnyRegularField>;
|
|
29
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
31
30
|
} | {
|
|
32
31
|
slice_type: string;
|
|
33
32
|
slice_label: null;
|
|
34
33
|
id: string;
|
|
35
34
|
variation: string;
|
|
36
35
|
version: string;
|
|
37
|
-
primary: Record<string,
|
|
38
|
-
items: Record<string,
|
|
36
|
+
primary: Record<string, import("@prismicio/client").AnySlicePrimaryField>;
|
|
37
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
39
38
|
})[]];
|
|
40
39
|
};
|
|
41
40
|
type __VLS_Slots = {} & {
|
|
42
41
|
default?: (props: typeof __VLS_1) => any;
|
|
43
42
|
};
|
|
44
|
-
declare const __VLS_base:
|
|
43
|
+
declare const __VLS_base: import("vue").DefineComponent<SliceSimulatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SliceSimulatorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
45
44
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
45
|
declare const _default: typeof __VLS_export;
|
|
47
46
|
type __VLS_WithSlots<T, S> = T & {
|
|
48
47
|
new (): {
|
|
49
48
|
$slots: S;
|
|
50
49
|
};
|
|
51
|
-
};
|
|
50
|
+
};
|
|
52
51
|
//#endregion
|
|
53
|
-
export { SliceSimulatorProps, _default };
|
|
52
|
+
export { SliceSimulatorProps, _default as default };
|
|
54
53
|
//# sourceMappingURL=SliceSimulator.vue.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceSimulator.vue.d.cts","names":[],"sources":["../src/SliceSimulator.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SliceSimulator.vue.d.cts","names":[],"sources":["../src/SliceSimulator.vue"],"mappings":";;KAmGY;;EAEX;;EAEA;;YA0FG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACC;EACD,WAAW,cAAc;;cAKvB,0BAAU,gBAAA,mDAAA,qCAAA,iDAAA,aAAA,SAAA,uBAAA,oDAAA;cAGV,cAAqB,uBAAuB,YAAY;cACzC,iBAAO;KACvB,gBAAgB,GAAG,KAAK;;IAE3B,QAAQ"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as _$vue from "vue";
|
|
2
|
-
import * as _$_prismicio_client0 from "@prismicio/client";
|
|
3
|
-
|
|
4
1
|
//#region src/SliceSimulator.vue.d.ts
|
|
5
2
|
/** Props for `<SliceSimulator />`. */
|
|
6
3
|
type SliceSimulatorProps = {
|
|
7
|
-
/** The z-index value of the simulator so that it's displayed above layout elements. */
|
|
4
|
+
/** The z-index value of the simulator so that it's displayed above layout elements. */
|
|
5
|
+
zIndex?: number;
|
|
6
|
+
/** The background color of the simulator to match website design. */
|
|
8
7
|
background?: string;
|
|
9
8
|
};
|
|
10
9
|
declare var __VLS_1: {
|
|
@@ -12,43 +11,43 @@ declare var __VLS_1: {
|
|
|
12
11
|
slice_type: string;
|
|
13
12
|
slice_label: string | null;
|
|
14
13
|
id: string;
|
|
15
|
-
primary: Record<string,
|
|
16
|
-
items: Record<string,
|
|
14
|
+
primary: Record<string, import("@prismicio/client").AnyRegularField>;
|
|
15
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
17
16
|
} | {
|
|
18
17
|
slice_type: string;
|
|
19
18
|
slice_label: null;
|
|
20
19
|
id: string;
|
|
21
20
|
variation: string;
|
|
22
21
|
version: string;
|
|
23
|
-
primary: Record<string,
|
|
24
|
-
items: Record<string,
|
|
22
|
+
primary: Record<string, import("@prismicio/client").AnySlicePrimaryField>;
|
|
23
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
25
24
|
}, ...({
|
|
26
25
|
slice_type: string;
|
|
27
26
|
slice_label: string | null;
|
|
28
27
|
id: string;
|
|
29
|
-
primary: Record<string,
|
|
30
|
-
items: Record<string,
|
|
28
|
+
primary: Record<string, import("@prismicio/client").AnyRegularField>;
|
|
29
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
31
30
|
} | {
|
|
32
31
|
slice_type: string;
|
|
33
32
|
slice_label: null;
|
|
34
33
|
id: string;
|
|
35
34
|
variation: string;
|
|
36
35
|
version: string;
|
|
37
|
-
primary: Record<string,
|
|
38
|
-
items: Record<string,
|
|
36
|
+
primary: Record<string, import("@prismicio/client").AnySlicePrimaryField>;
|
|
37
|
+
items: Record<string, import("@prismicio/client").AnyRegularField>[];
|
|
39
38
|
})[]];
|
|
40
39
|
};
|
|
41
40
|
type __VLS_Slots = {} & {
|
|
42
41
|
default?: (props: typeof __VLS_1) => any;
|
|
43
42
|
};
|
|
44
|
-
declare const __VLS_base:
|
|
43
|
+
declare const __VLS_base: import("vue").DefineComponent<SliceSimulatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SliceSimulatorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
45
44
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
45
|
declare const _default: typeof __VLS_export;
|
|
47
46
|
type __VLS_WithSlots<T, S> = T & {
|
|
48
47
|
new (): {
|
|
49
48
|
$slots: S;
|
|
50
49
|
};
|
|
51
|
-
};
|
|
50
|
+
};
|
|
52
51
|
//#endregion
|
|
53
|
-
export { SliceSimulatorProps, _default };
|
|
52
|
+
export { SliceSimulatorProps, _default as default };
|
|
54
53
|
//# sourceMappingURL=SliceSimulator.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceSimulator.vue.d.ts","names":[],"sources":["../src/SliceSimulator.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SliceSimulator.vue.d.ts","names":[],"sources":["../src/SliceSimulator.vue"],"mappings":";;KAmGY;;EAEX;;EAEA;;YA0FG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACC;EACD,WAAW,cAAc;;cAKvB,0BAAU,gBAAA,mDAAA,qCAAA,iDAAA,aAAA,SAAA,uBAAA,oDAAA;cAGV,cAAqB,uBAAuB,YAAY;cACzC,iBAAO;KACvB,gBAAgB,GAAG,KAAK;;IAE3B,QAAQ"}
|
|
@@ -2,7 +2,7 @@ let vue = require("vue");
|
|
|
2
2
|
let _prismicio_simulator_kit = require("@prismicio/simulator/kit");
|
|
3
3
|
//#region src/SliceSimulator.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
const _hoisted_1 = ["innerHTML"];
|
|
5
|
-
var SliceSimulator_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var SliceSimulator_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
6
6
|
name: "SliceSimulator",
|
|
7
7
|
__name: "SliceSimulator",
|
|
8
8
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceSimulator.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\"\nimport { ref, onMounted, onUnmounted } from \"vue\"\n\n/** Props for `<SliceSimulator />`. */\nexport type SliceSimulatorProps = {\n\t/** The z-index value of the simulator so that it's displayed above layout elements. */\n\tzIndex?: number\n\t/** The background color of the simulator to match website design. */\n\tbackground?: string\n}\n\nconst props = defineProps<SliceSimulatorProps>()\ndefineOptions({ name: \"SliceSimulator\" })\n\nconst slices = ref(getDefaultSlices())\nconst message = ref(getDefaultMessage())\n\nconst simulatorManager = new SimulatorManager()\n\nonMounted(() => {\n\tsimulatorManager.state.on(\n\t\tStateEventType.Slices,\n\t\t(_slices) => {\n\t\t\tslices.value = _slices\n\t\t},\n\t\t\"simulator-slices\",\n\t)\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => {\n\t\t\tmessage.value = _message\n\t\t},\n\t\t\"simulator-message\",\n\t)\n\n\tsimulatorManager.init()\n})\n\nonUnmounted(() => {\n\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n})\n</script>\n\n<template>\n\t<div\n\t\t:class=\"simulatorClass\"\n\t\t:style=\"{\n\t\t\tzIndex: props.zIndex || getDefaultProps().zIndex,\n\t\t\tposition: 'fixed',\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: '100%',\n\t\t\theight: '100vh',\n\t\t\toverflow: 'auto',\n\t\t\tbackground: props.background || getDefaultProps().background,\n\t\t}\"\n\t>\n\t\t<article v-if=\"message\" v-html=\"message\" />\n\t\t<div\n\t\t\tv-else-if=\"slices.length\"\n\t\t\tid=\"root\"\n\t\t\t:class=\"simulatorRootClass\"\n\t\t\t@click.capture=\"onClickHandler\"\n\t\t\t@submit.capture=\"disableEventHandler\"\n\t\t>\n\t\t\t<slot :slices=\"slices\" />\n\t\t</div>\n\t</div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAsBA,MAAM,QAAQ;EAGd,MAAM,UAAA,
|
|
1
|
+
{"version":3,"file":"SliceSimulator.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\"\nimport { ref, onMounted, onUnmounted } from \"vue\"\n\n/** Props for `<SliceSimulator />`. */\nexport type SliceSimulatorProps = {\n\t/** The z-index value of the simulator so that it's displayed above layout elements. */\n\tzIndex?: number\n\t/** The background color of the simulator to match website design. */\n\tbackground?: string\n}\n\nconst props = defineProps<SliceSimulatorProps>()\ndefineOptions({ name: \"SliceSimulator\" })\n\nconst slices = ref(getDefaultSlices())\nconst message = ref(getDefaultMessage())\n\nconst simulatorManager = new SimulatorManager()\n\nonMounted(() => {\n\tsimulatorManager.state.on(\n\t\tStateEventType.Slices,\n\t\t(_slices) => {\n\t\t\tslices.value = _slices\n\t\t},\n\t\t\"simulator-slices\",\n\t)\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => {\n\t\t\tmessage.value = _message\n\t\t},\n\t\t\"simulator-message\",\n\t)\n\n\tsimulatorManager.init()\n})\n\nonUnmounted(() => {\n\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n})\n</script>\n\n<template>\n\t<div\n\t\t:class=\"simulatorClass\"\n\t\t:style=\"{\n\t\t\tzIndex: props.zIndex || getDefaultProps().zIndex,\n\t\t\tposition: 'fixed',\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: '100%',\n\t\t\theight: '100vh',\n\t\t\toverflow: 'auto',\n\t\t\tbackground: props.background || getDefaultProps().background,\n\t\t}\"\n\t>\n\t\t<article v-if=\"message\" v-html=\"message\" />\n\t\t<div\n\t\t\tv-else-if=\"slices.length\"\n\t\t\tid=\"root\"\n\t\t\t:class=\"simulatorRootClass\"\n\t\t\t@click.capture=\"onClickHandler\"\n\t\t\t@submit.capture=\"disableEventHandler\"\n\t\t>\n\t\t\t<slot :slices=\"slices\" />\n\t\t</div>\n\t</div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAsBA,MAAM,QAAQ;EAGd,MAAM,UAAA,GAAS,IAAA,IAAA,EAAA,GAAI,yBAAA,iBAAA,CAAiB,CAAC;EACrC,MAAM,WAAA,GAAU,IAAA,IAAA,EAAA,GAAI,yBAAA,kBAAA,CAAkB,CAAC;EAEvC,MAAM,mBAAmB,IAAI,yBAAA,iBAAiB;EAE9C,CAAA,GAAA,IAAA,UAAA,OAAgB;GACf,iBAAiB,MAAM,GACtB,yBAAA,eAAe,SACd,YAAY;IACZ,OAAO,QAAQ;GAChB,GACA,kBACD;GACA,iBAAiB,MAAM,GACtB,yBAAA,eAAe,UACd,aAAa;IACb,QAAQ,QAAQ;GACjB,GACA,mBACD;GAEA,iBAAiB,KAAK;EACvB,CAAC;EAED,CAAA,GAAA,IAAA,YAAA,OAAkB;GACjB,iBAAiB,MAAM,IAAI,yBAAA,eAAe,QAAQ,kBAAkB;GAEpE,iBAAiB,MAAM,IAAI,yBAAA,eAAe,SAAS,mBAAmB;EACvE,CAAC;;GAIA,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,mBAAA,CAuBM,OAAA;IAtBJ,QAAA,GAAK,IAAA,eAAA,EAAA,GAAE,IAAA,MAAA,CAAA,yBAAA,cAAA,CAAc;IACrB,QAAA,GAAK,IAAA,eAAA,CAAA;KAAe,QAAA,MAAM,WAAA,GAAU,IAAA,MAAA,CAAA,yBAAA,eAAA,CAAe,CAAA,CAAA,CAAG;;;;;;;KAA+H,YAAA,MAAM,eAAA,GAAc,IAAA,MAAA,CAAA,yBAAA,eAAA,CAAe,CAAA,CAAA,CAAG;;GAW7M,GAAA,CAAA,QAAA,UAAA,GAAf,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,mBAAA,CAA2C,WAAA;;IAAnB,WAAQ,QAAA;GAEpB,GAAA,MAAA,GAAA,UAAA,KAAA,OAAA,MAAO,WAAA,GADnB,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,mBAAA,CAQM,OAAA;;IANL,IAAG;IACF,QAAA,GAAK,IAAA,eAAA,EAAA,GAAE,IAAA,MAAA,CAAA,yBAAA,kBAAA,CAAkB;IACV,gBAAA,OAAA,OAAA,OAAA,MAAA,GAAA,UAAA,GAAA,IAAA,MAAA,CAAA,yBAAA,cAAA,MAAA,GAAA,IAAA,MAAA,CAAA,yBAAA,cAAA,CAAA,CAAA,GAAA,IAAA;IACC,iBAAA,OAAA,OAAA,OAAA,MAAA,GAAA,UAAA,GAAA,IAAA,MAAA,CAAA,yBAAA,mBAAA,MAAA,GAAA,IAAA,MAAA,CAAA,yBAAA,mBAAA,CAAA,CAAA,GAAA,IAAA;GAEjB,GAAA,EAAA,GAAA,IAAA,WAAA,CAAyB,KAAA,QAAA,WAAA,EAAlB,QAAQ,OAAA,MAAM,CAAA,CAAA,GAAA,EAAA,MAAA,GAAA,IAAA,mBAAA,CAAA,QAAA,IAAA,CAAA,GAAA,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { createCommentVNode, createElementBlock, defineComponent, normalizeClass
|
|
|
2
2
|
import { SimulatorManager, StateEventType, disableEventHandler, getDefaultMessage, getDefaultProps, getDefaultSlices, onClickHandler, simulatorClass, simulatorRootClass } from "@prismicio/simulator/kit";
|
|
3
3
|
//#region src/SliceSimulator.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
const _hoisted_1 = ["innerHTML"];
|
|
5
|
-
var SliceSimulator_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var SliceSimulator_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "SliceSimulator",
|
|
7
7
|
__name: "SliceSimulator",
|
|
8
8
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceSimulator.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\"\nimport { ref, onMounted, onUnmounted } from \"vue\"\n\n/** Props for `<SliceSimulator />`. */\nexport type SliceSimulatorProps = {\n\t/** The z-index value of the simulator so that it's displayed above layout elements. */\n\tzIndex?: number\n\t/** The background color of the simulator to match website design. */\n\tbackground?: string\n}\n\nconst props = defineProps<SliceSimulatorProps>()\ndefineOptions({ name: \"SliceSimulator\" })\n\nconst slices = ref(getDefaultSlices())\nconst message = ref(getDefaultMessage())\n\nconst simulatorManager = new SimulatorManager()\n\nonMounted(() => {\n\tsimulatorManager.state.on(\n\t\tStateEventType.Slices,\n\t\t(_slices) => {\n\t\t\tslices.value = _slices\n\t\t},\n\t\t\"simulator-slices\",\n\t)\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => {\n\t\t\tmessage.value = _message\n\t\t},\n\t\t\"simulator-message\",\n\t)\n\n\tsimulatorManager.init()\n})\n\nonUnmounted(() => {\n\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n})\n</script>\n\n<template>\n\t<div\n\t\t:class=\"simulatorClass\"\n\t\t:style=\"{\n\t\t\tzIndex: props.zIndex || getDefaultProps().zIndex,\n\t\t\tposition: 'fixed',\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: '100%',\n\t\t\theight: '100vh',\n\t\t\toverflow: 'auto',\n\t\t\tbackground: props.background || getDefaultProps().background,\n\t\t}\"\n\t>\n\t\t<article v-if=\"message\" v-html=\"message\" />\n\t\t<div\n\t\t\tv-else-if=\"slices.length\"\n\t\t\tid=\"root\"\n\t\t\t:class=\"simulatorRootClass\"\n\t\t\t@click.capture=\"onClickHandler\"\n\t\t\t@submit.capture=\"disableEventHandler\"\n\t\t>\n\t\t\t<slot :slices=\"slices\" />\n\t\t</div>\n\t</div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAsBA,MAAM,QAAQ;EAGd,MAAM,SAAS,IAAI,
|
|
1
|
+
{"version":3,"file":"SliceSimulator.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\"\nimport { ref, onMounted, onUnmounted } from \"vue\"\n\n/** Props for `<SliceSimulator />`. */\nexport type SliceSimulatorProps = {\n\t/** The z-index value of the simulator so that it's displayed above layout elements. */\n\tzIndex?: number\n\t/** The background color of the simulator to match website design. */\n\tbackground?: string\n}\n\nconst props = defineProps<SliceSimulatorProps>()\ndefineOptions({ name: \"SliceSimulator\" })\n\nconst slices = ref(getDefaultSlices())\nconst message = ref(getDefaultMessage())\n\nconst simulatorManager = new SimulatorManager()\n\nonMounted(() => {\n\tsimulatorManager.state.on(\n\t\tStateEventType.Slices,\n\t\t(_slices) => {\n\t\t\tslices.value = _slices\n\t\t},\n\t\t\"simulator-slices\",\n\t)\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => {\n\t\t\tmessage.value = _message\n\t\t},\n\t\t\"simulator-message\",\n\t)\n\n\tsimulatorManager.init()\n})\n\nonUnmounted(() => {\n\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n})\n</script>\n\n<template>\n\t<div\n\t\t:class=\"simulatorClass\"\n\t\t:style=\"{\n\t\t\tzIndex: props.zIndex || getDefaultProps().zIndex,\n\t\t\tposition: 'fixed',\n\t\t\ttop: 0,\n\t\t\tleft: 0,\n\t\t\twidth: '100%',\n\t\t\theight: '100vh',\n\t\t\toverflow: 'auto',\n\t\t\tbackground: props.background || getDefaultProps().background,\n\t\t}\"\n\t>\n\t\t<article v-if=\"message\" v-html=\"message\" />\n\t\t<div\n\t\t\tv-else-if=\"slices.length\"\n\t\t\tid=\"root\"\n\t\t\t:class=\"simulatorRootClass\"\n\t\t\t@click.capture=\"onClickHandler\"\n\t\t\t@submit.capture=\"disableEventHandler\"\n\t\t>\n\t\t\t<slot :slices=\"slices\" />\n\t\t</div>\n\t</div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAsBA,MAAM,QAAQ;EAGd,MAAM,SAAS,IAAI,iBAAiB,CAAC;EACrC,MAAM,UAAU,IAAI,kBAAkB,CAAC;EAEvC,MAAM,mBAAmB,IAAI,iBAAiB;EAE9C,gBAAgB;GACf,iBAAiB,MAAM,GACtB,eAAe,SACd,YAAY;IACZ,OAAO,QAAQ;GAChB,GACA,kBACD;GACA,iBAAiB,MAAM,GACtB,eAAe,UACd,aAAa;IACb,QAAQ,QAAQ;GACjB,GACA,mBACD;GAEA,iBAAiB,KAAK;EACvB,CAAC;EAED,kBAAkB;GACjB,iBAAiB,MAAM,IAAI,eAAe,QAAQ,kBAAkB;GAEpE,iBAAiB,MAAM,IAAI,eAAe,SAAS,mBAAmB;EACvE,CAAC;;GAIA,OAAA,UAAA,GAAA,mBAuBM,OAAA;IAtBJ,OAAK,eAAE,MAAA,cAAA,CAAc;IACrB,OAAK,eAAA;KAAe,QAAA,MAAM,UAAU,MAAA,eAAA,CAAe,CAAA,CAAA,CAAG;;;;;;;KAA+H,YAAA,MAAM,cAAc,MAAA,eAAA,CAAe,CAAA,CAAA,CAAG;;GAW7M,GAAA,CAAA,QAAA,SAAf,UAAA,GAAA,mBAA2C,WAAA;;IAAnB,WAAQ,QAAA;GAEpB,GAAA,MAAA,GAAA,UAAA,KAAA,OAAA,MAAO,UADnB,UAAA,GAAA,mBAQM,OAAA;;IANL,IAAG;IACF,OAAK,eAAE,MAAA,kBAAA,CAAkB;IACV,gBAAA,OAAA,OAAA,OAAA,MAAA,GAAA,SAAA,MAAA,cAAA,KAAA,MAAA,cAAA,CAAA,CAAA,GAAA,IAAA;IACC,iBAAA,OAAA,OAAA,OAAA,MAAA,GAAA,SAAA,MAAA,mBAAA,KAAA,MAAA,mBAAA,CAAA,CAAA,GAAA,IAAA;GAEjB,GAAA,CAAA,WAAyB,KAAA,QAAA,WAAA,EAAlB,QAAQ,OAAA,MAAM,CAAA,CAAA,GAAA,EAAA,KAAA,mBAAA,QAAA,IAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from "./types.cjs";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
|
-
|
|
4
2
|
//#region src/SliceZone/SliceZone.vue.d.ts
|
|
5
3
|
/**
|
|
6
4
|
* Props for `<SliceZone />`.
|
|
@@ -8,14 +6,18 @@ import * as _$vue from "vue";
|
|
|
8
6
|
* @typeParam TContext - Arbitrary data made available to all Slice components
|
|
9
7
|
*/
|
|
10
8
|
type SliceZoneProps<TContext = unknown> = {
|
|
11
|
-
/** List of slice data from the slice zone. */
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/** List of slice data from the slice zone. */
|
|
10
|
+
slices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>;
|
|
11
|
+
/** A record mapping slice types to React components. */
|
|
12
|
+
components?: SliceZoneComponents;
|
|
13
|
+
/** The Vue component rendered if a component mapping from the `components` prop cannot be found. */
|
|
14
|
+
defaultComponent?: SliceComponentType<any, TContext>;
|
|
15
|
+
/** Arbitrary data made available to all slice components. */
|
|
14
16
|
context?: TContext;
|
|
15
17
|
};
|
|
16
18
|
type __VLS_Props = SliceZoneProps;
|
|
17
|
-
declare const __VLS_export:
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
20
|
declare const _default: typeof __VLS_export;
|
|
19
21
|
//#endregion
|
|
20
|
-
export { SliceZoneProps, _default };
|
|
22
|
+
export { SliceZoneProps, _default as default };
|
|
21
23
|
//# sourceMappingURL=SliceZone.vue.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceZone.vue.d.cts","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"SliceZone.vue.d.cts","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"mappings":";;;;;;;KA6FY,eAAe;;EAE1B,QAAQ,cAAc,aAAa,YAAY;;EAG/C,aAAa;;EAIb,mBAAmB,wBAAwB;;EAG3C,UAAU;;KAGN,cAAc;cA6Eb,4BAAY,gBAAA,2CAAA,qCAAA,iDAAA,aAAA,SAAA,eAAA,oDAAA;cAGG,iBAAO"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from "./types.js";
|
|
2
|
-
import * as _$vue from "vue";
|
|
3
|
-
|
|
4
2
|
//#region src/SliceZone/SliceZone.vue.d.ts
|
|
5
3
|
/**
|
|
6
4
|
* Props for `<SliceZone />`.
|
|
@@ -8,14 +6,18 @@ import * as _$vue from "vue";
|
|
|
8
6
|
* @typeParam TContext - Arbitrary data made available to all Slice components
|
|
9
7
|
*/
|
|
10
8
|
type SliceZoneProps<TContext = unknown> = {
|
|
11
|
-
/** List of slice data from the slice zone. */
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/** List of slice data from the slice zone. */
|
|
10
|
+
slices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>;
|
|
11
|
+
/** A record mapping slice types to React components. */
|
|
12
|
+
components?: SliceZoneComponents;
|
|
13
|
+
/** The Vue component rendered if a component mapping from the `components` prop cannot be found. */
|
|
14
|
+
defaultComponent?: SliceComponentType<any, TContext>;
|
|
15
|
+
/** Arbitrary data made available to all slice components. */
|
|
14
16
|
context?: TContext;
|
|
15
17
|
};
|
|
16
18
|
type __VLS_Props = SliceZoneProps;
|
|
17
|
-
declare const __VLS_export:
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
20
|
declare const _default: typeof __VLS_export;
|
|
19
21
|
//#endregion
|
|
20
|
-
export { SliceZoneProps, _default };
|
|
22
|
+
export { SliceZoneProps, _default as default };
|
|
21
23
|
//# sourceMappingURL=SliceZone.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceZone.vue.d.ts","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"SliceZone.vue.d.ts","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"mappings":";;;;;;;KA6FY,eAAe;;EAE1B,QAAQ,cAAc,aAAa,YAAY;;EAG/C,aAAa;;EAIb,mBAAmB,wBAAwB;;EAG3C,UAAU;;KAGN,cAAc;cA6Eb,4BAAY,gBAAA,2CAAA,qCAAA,iDAAA,aAAA,SAAA,eAAA,oDAAA;cAGG,iBAAO"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_TODOSliceComponent = require("./TODOSliceComponent.cjs");
|
|
2
2
|
let vue = require("vue");
|
|
3
3
|
//#region src/SliceZone/SliceZone.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var SliceZone_vue_vue_type_script_setup_true_lang_default =
|
|
4
|
+
var SliceZone_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
5
5
|
name: "SliceZone",
|
|
6
6
|
__name: "SliceZone",
|
|
7
7
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceZone.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\nimport type { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from \"./types\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/** List of slice data from the slice zone. */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/** A record mapping slice types to React components. */\n\tcomponents?: SliceZoneComponents\n\n\t/** The Vue component rendered if a component mapping from the `components` prop cannot be found. */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/** Arbitrary data made available to all slice components. */\n\tcontext?: TContext\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst renderedSlices = computed<\n\t{\n\t\tis: ComponentOrTagName\n\t\tkey: string\n\t\tprops: Record<string, unknown>\n\t}[]\n>(() => {\n\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type = \"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\" ? slice.id : `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EAGd,MAAM,kBAAA,
|
|
1
|
+
{"version":3,"file":"SliceZone.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\nimport type { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from \"./types\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/** List of slice data from the slice zone. */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/** A record mapping slice types to React components. */\n\tcomponents?: SliceZoneComponents\n\n\t/** The Vue component rendered if a component mapping from the `components` prop cannot be found. */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/** Arbitrary data made available to all slice components. */\n\tcontext?: TContext\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst renderedSlices = computed<\n\t{\n\t\tis: ComponentOrTagName\n\t\tkey: string\n\t\tprops: Record<string, unknown>\n\t}[]\n>(() => {\n\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type = \"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\" ? slice.id : `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EAGd,MAAM,kBAAA,GAAiB,IAAA,SAAA,OAMf;GACP,IAAI,CAAC,MAAM,QAAQ,OAAO,CAAC;GAE3B,OAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OAAO,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE1E,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,UAAU,KAAK;IAE5F,MAAM,KAAK,MAAM,aAAa,SAAS,MAAM;IAE7C,IAAI,CAAC,IACJ,OAAO;KAAE,IAAI,2BAAA;KAAoB;KAAK,OAAO,EAAE,MAAM;IAAE;IAGxD,IAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;KAErC,OAAO;MAAE;MAAI;MAAK,OAAO;KAAY;IACtC;IAEA,OAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;KACf;IACD;GACD,CAAC;EACF,CAAC;;GAIA,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,IAAA,GAAA,IAAA,mBAAA,CAKE,IAAA,UAAA,OAAA,GAAA,IAAA,WAAA,CAJuB,eAAA,QAAjB,kBAAa;IADrB,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAKE,IAAA,wBAAA,CAHI,cAAc,EAAE,IAAA,GAFtB,IAAA,WAAA,CAKE,EAFA,KAAK,cAAc,IACZ,GAAA,EAAA,SAAA,KAAA,GAAA,cAAc,KAAK,GAAA,MAAA,EAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TODOSliceComponent } from "./TODOSliceComponent.js";
|
|
2
2
|
import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent } from "vue";
|
|
3
3
|
//#region src/SliceZone/SliceZone.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var SliceZone_vue_vue_type_script_setup_true_lang_default =
|
|
4
|
+
var SliceZone_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
5
5
|
name: "SliceZone",
|
|
6
6
|
__name: "SliceZone",
|
|
7
7
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceZone.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\nimport type { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from \"./types\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/** List of slice data from the slice zone. */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/** A record mapping slice types to React components. */\n\tcomponents?: SliceZoneComponents\n\n\t/** The Vue component rendered if a component mapping from the `components` prop cannot be found. */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/** Arbitrary data made available to all slice components. */\n\tcontext?: TContext\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst renderedSlices = computed<\n\t{\n\t\tis: ComponentOrTagName\n\t\tkey: string\n\t\tprops: Record<string, unknown>\n\t}[]\n>(() => {\n\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type = \"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\" ? slice.id : `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EAGd,MAAM,iBAAiB,eAMf;
|
|
1
|
+
{"version":3,"file":"SliceZone.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\nimport type { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from \"./types\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/** List of slice data from the slice zone. */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/** A record mapping slice types to React components. */\n\tcomponents?: SliceZoneComponents\n\n\t/** The Vue component rendered if a component mapping from the `components` prop cannot be found. */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/** Arbitrary data made available to all slice components. */\n\tcontext?: TContext\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst renderedSlices = computed<\n\t{\n\t\tis: ComponentOrTagName\n\t\tkey: string\n\t\tprops: Record<string, unknown>\n\t}[]\n>(() => {\n\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type = \"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\" ? slice.id : `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EAGd,MAAM,iBAAiB,eAMf;GACP,IAAI,CAAC,MAAM,QAAQ,OAAO,CAAC;GAE3B,OAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OAAO,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE1E,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAAW,MAAM,KAAK,GAAG,MAAM,GAAG,KAAK,UAAU,KAAK;IAE5F,MAAM,KAAK,MAAM,aAAa,SAAS,MAAM;IAE7C,IAAI,CAAC,IACJ,OAAO;KAAE,IAAI;KAAoB;KAAK,OAAO,EAAE,MAAM;IAAE;IAGxD,IAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;KAErC,OAAO;MAAE;MAAI;MAAK,OAAO;KAAY;IACtC;IAEA,OAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;KACf;IACD;GACD,CAAC;EACF,CAAC;;GAIA,OAAA,UAAA,IAAA,GAAA,mBAKE,UAAA,MAAA,WAJuB,eAAA,QAAjB,kBAAa;IADrB,OAAA,UAAA,GAAA,YAKE,wBAHI,cAAc,EAAE,GAFtB,WAKE,EAFA,KAAK,cAAc,IACZ,GAAA,EAAA,SAAA,KAAA,GAAA,cAAc,KAAK,GAAA,MAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TODOSliceComponent.cjs","names":["DEV"],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":["import { DEV } from \"esm-env\"\nimport { computed, defineComponent, h, watchEffect } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { SliceComponentType, SliceLike } from \"./types\"\n\n/**\n * This Slice component can be used as a reminder to provide a proper implementation.\n *\n * This is also the default Vue component rendered when a component mapping cannot be found in\n * `<SliceZone />`.\n */\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const TODOSliceComponent = DEV\n\t? /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: {\n\t\t\t\tslice: {\n\t\t\t\t\ttype: Object as PropType<SliceLike>,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() => {\n\t\t\t\t\treturn \"slice_type\" in props.slice ? props.slice.slice_type : props.slice.type\n\t\t\t\t})\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t},\n\t\t}) as SliceComponentType)\n\t: ((() => null) as SliceComponentType)\n"],"mappings":";;;;;;;;AAaA,MAAa,
|
|
1
|
+
{"version":3,"file":"TODOSliceComponent.cjs","names":["DEV","computed","h"],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":["import { DEV } from \"esm-env\"\nimport { computed, defineComponent, h, watchEffect } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { SliceComponentType, SliceLike } from \"./types\"\n\n/**\n * This Slice component can be used as a reminder to provide a proper implementation.\n *\n * This is also the default Vue component rendered when a component mapping cannot be found in\n * `<SliceZone />`.\n */\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const TODOSliceComponent = DEV\n\t? /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: {\n\t\t\t\tslice: {\n\t\t\t\t\ttype: Object as PropType<SliceLike>,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() => {\n\t\t\t\t\treturn \"slice_type\" in props.slice ? props.slice.slice_type : props.slice.type\n\t\t\t\t})\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t},\n\t\t}) as SliceComponentType)\n\t: ((() => null) as SliceComponentType)\n"],"mappings":";;;;;;;;AAaA,MAAa,sCAAqBA,CAAAA,CAAAA,MAChB,iBAAA,GAAA,IAAA,gBAAA,CAAgB;CAC/B,MAAM;CACN,OAAO,EACN,OAAO;EACN,MAAM;EACN,UAAU;CACX,EACD;CACA,MAAM,OAAO;EACZ,MAAM,QAAA,GAAOC,IAAAA,SAAAA,OAAe;GAC3B,OAAO,gBAAgB,MAAM,QAAQ,MAAM,MAAM,aAAa,MAAM,MAAM;EAC3E,CAAC;EAED,CAAA,GAAA,IAAA,YAAA,OAAkB;GACjB,QAAQ,KACP,0DAA0D,KAAK,MAAM,IACrE,MAAM,KACP;EACD,CAAC;EAED,aAAa;GACZ,QAAA,GAAOC,IAAAA,EAAAA,CACN,WACA;IACC,kCAAkC;IAClC,mBAAmB,KAAK;GACzB,GACA,CAAC,8CAA8C,KAAK,MAAM,EAAE,CAC7D;EACD;CACD;AACD,CAAC,WACQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TODOSliceComponent.d.cts","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TODOSliceComponent.d.cts","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"mappings":";;;;;;;;cAaa,oBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TODOSliceComponent.d.ts","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TODOSliceComponent.d.ts","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"mappings":";;;;;;;;cAaa,oBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TODOSliceComponent.js","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":["import { DEV } from \"esm-env\"\nimport { computed, defineComponent, h, watchEffect } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { SliceComponentType, SliceLike } from \"./types\"\n\n/**\n * This Slice component can be used as a reminder to provide a proper implementation.\n *\n * This is also the default Vue component rendered when a component mapping cannot be found in\n * `<SliceZone />`.\n */\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const TODOSliceComponent = DEV\n\t? /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: {\n\t\t\t\tslice: {\n\t\t\t\t\ttype: Object as PropType<SliceLike>,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() => {\n\t\t\t\t\treturn \"slice_type\" in props.slice ? props.slice.slice_type : props.slice.type\n\t\t\t\t})\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t},\n\t\t}) as SliceComponentType)\n\t: ((() => null) as SliceComponentType)\n"],"mappings":";;;;;;;;;AAaA,MAAa,qBAAqB,MAChB,gCAAgB;CAC/B,MAAM;CACN,OAAO,EACN,OAAO;EACN,MAAM;EACN,UAAU;
|
|
1
|
+
{"version":3,"file":"TODOSliceComponent.js","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":["import { DEV } from \"esm-env\"\nimport { computed, defineComponent, h, watchEffect } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { SliceComponentType, SliceLike } from \"./types\"\n\n/**\n * This Slice component can be used as a reminder to provide a proper implementation.\n *\n * This is also the default Vue component rendered when a component mapping cannot be found in\n * `<SliceZone />`.\n */\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const TODOSliceComponent = DEV\n\t? /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: {\n\t\t\t\tslice: {\n\t\t\t\t\ttype: Object as PropType<SliceLike>,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() => {\n\t\t\t\t\treturn \"slice_type\" in props.slice ? props.slice.slice_type : props.slice.type\n\t\t\t\t})\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t},\n\t\t}) as SliceComponentType)\n\t: ((() => null) as SliceComponentType)\n"],"mappings":";;;;;;;;;AAaA,MAAa,qBAAqB,MAChB,gCAAgB;CAC/B,MAAM;CACN,OAAO,EACN,OAAO;EACN,MAAM;EACN,UAAU;CACX,EACD;CACA,MAAM,OAAO;EACZ,MAAM,OAAO,eAAe;GAC3B,OAAO,gBAAgB,MAAM,QAAQ,MAAM,MAAM,aAAa,MAAM,MAAM;EAC3E,CAAC;EAED,kBAAkB;GACjB,QAAQ,KACP,0DAA0D,KAAK,MAAM,IACrE,MAAM,KACP;EACD,CAAC;EAED,aAAa;GACZ,OAAO,EACN,WACA;IACC,kCAAkC;IAClC,mBAAmB,KAAK;GACzB,GACA,CAAC,8CAA8C,KAAK,MAAM,EAAE,CAC7D;EACD;CACD;AACD,CAAC,WACQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSliceZoneComponents.cjs","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type { SliceComponentType, SliceLike, SliceZoneComponents } from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each components will be\n * rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly applied on each\n * components, improving performances.\n * @example\n * \t```javascript\n * \t// Defining a slice components\n * \timport { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * \texport default {\n * \tdata() {\n * \tcomponents: defineSliceZoneComponents({\n * \tfoo: Foo,\n * \tbar: defineAsyncComponent(\n * \t() => new Promise((res) => res(Bar)),\n * \t),\n * \tbaz: \"Baz\",\n * \t}),\n * \t}\n * \t};\n * \t```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n * @param components - {@link SliceZoneComponents}\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<Extract<TSlice, SliceLike<typeof type>>, TContext>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.cjs","names":["markRaw"],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type { SliceComponentType, SliceLike, SliceZoneComponents } from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each components will be\n * rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly applied on each\n * components, improving performances.\n * @example\n * \t```javascript\n * \t// Defining a slice components\n * \timport { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * \texport default {\n * \tdata() {\n * \tcomponents: defineSliceZoneComponents({\n * \tfoo: Foo,\n * \tbar: defineAsyncComponent(\n * \t() => new Promise((res) => res(Bar)),\n * \t),\n * \tbaz: \"Baz\",\n * \t}),\n * \t}\n * \t};\n * \t```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n * @param components - {@link SliceZoneComponents}\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<Extract<TSlice, SliceLike<typeof type>>, TContext>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,CAAC;CAEhB,IAAI;CACJ,KAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;EAC7B,OAAO,QACN,OAAO,cAAc,WAClB,aAAA,GACAA,IAAAA,QAAAA,CACA,SACD;CACJ;CAEA,OAAO;AACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSliceZoneComponents.d.cts","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.d.cts","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCa,4BAEZ,eAAe,iBACf,oBAEA,YAAY,oBAAoB,QAAQ,cACtC,oBAAoB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSliceZoneComponents.d.ts","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.d.ts","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCa,4BAEZ,eAAe,iBACf,oBAEA,YAAY,oBAAoB,QAAQ,cACtC,oBAAoB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSliceZoneComponents.js","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type { SliceComponentType, SliceLike, SliceZoneComponents } from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each components will be\n * rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly applied on each\n * components, improving performances.\n * @example\n * \t```javascript\n * \t// Defining a slice components\n * \timport { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * \texport default {\n * \tdata() {\n * \tcomponents: defineSliceZoneComponents({\n * \tfoo: Foo,\n * \tbar: defineAsyncComponent(\n * \t() => new Promise((res) => res(Bar)),\n * \t),\n * \tbaz: \"Baz\",\n * \t}),\n * \t}\n * \t};\n * \t```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n * @param components - {@link SliceZoneComponents}\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<Extract<TSlice, SliceLike<typeof type>>, TContext>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.js","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type { SliceComponentType, SliceLike, SliceZoneComponents } from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each components will be\n * rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly applied on each\n * components, improving performances.\n * @example\n * \t```javascript\n * \t// Defining a slice components\n * \timport { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * \texport default {\n * \tdata() {\n * \tcomponents: defineSliceZoneComponents({\n * \tfoo: Foo,\n * \tbar: defineAsyncComponent(\n * \t() => new Promise((res) => res(Bar)),\n * \t),\n * \tbaz: \"Baz\",\n * \t}),\n * \t}\n * \t};\n * \t```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n * @param components - {@link SliceZoneComponents}\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<Extract<TSlice, SliceLike<typeof type>>, TContext>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,CAAC;CAEhB,IAAI;CACJ,KAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;EAC7B,OAAO,QACN,OAAO,cAAc,WAClB,YACA,QACA,SACD;CACJ;CAEA,OAAO;AACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSliceComponentProps.cjs","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":["import type { PropType } from \"vue\"\n\nimport type { SliceComponentProps, SliceLike } from \"./types\"\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using the `<SliceZone />`\n * component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n */\ntype DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>\n\t\trequired: true\n\t}\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>\n\t\trequired: true\n\t}\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>\n\t\trequired: true\n\t}\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice using the\n * `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps())\n * \t```\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component with visual hint\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]))\n * \t```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n * @param propsHint - An optional array of prop names used for the sole purpose of having a visual\n * hint of which props are made available to the slice, this parameters doesn't have any effect\n * @returns Props object to use with `defineProps()`\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;
|
|
1
|
+
{"version":3,"file":"getSliceComponentProps.cjs","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":["import type { PropType } from \"vue\"\n\nimport type { SliceComponentProps, SliceLike } from \"./types\"\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using the `<SliceZone />`\n * component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n */\ntype DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>\n\t\trequired: true\n\t}\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>\n\t\trequired: true\n\t}\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>\n\t\trequired: true\n\t}\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice using the\n * `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps())\n * \t```\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component with visual hint\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]))\n * \t```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n * @param propsHint - An optional array of prop names used for the sole purpose of having a visual\n * hint of which props are made available to the slice, this parameters doesn't have any effect\n * @returns Props object to use with `defineProps()`\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;CACX;CACA,OAAO;EACN,MAAM;EACN,UAAU;CACX;CACA,QAAQ;EACP,MAAM;EACN,UAAU;CACX;CACA,SAAS;EACR,MAAM;EACN,UAAU;CACX;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSliceComponentProps.d.cts","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSliceComponentProps.d.cts","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"mappings":";;;;;;;;;;;KAYK,mCAEJ,eAAe,iBACf;EAEA;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;EAED;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;EAED;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;EAED;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCW,yBAEZ,eAAe,iBACf,oBAGA,wDACE,mCAAmC,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSliceComponentProps.d.ts","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSliceComponentProps.d.ts","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"mappings":";;;;;;;;;;;KAYK,mCAEJ,eAAe,iBACf;EAEA;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;EAED;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;EAED;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;EAED;IACC,MAAM,SAAS,oBAAoB,QAAQ;IAC3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCW,yBAEZ,eAAe,iBACf,oBAGA,wDACE,mCAAmC,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSliceComponentProps.js","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":["import type { PropType } from \"vue\"\n\nimport type { SliceComponentProps, SliceLike } from \"./types\"\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using the `<SliceZone />`\n * component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n */\ntype DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>\n\t\trequired: true\n\t}\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>\n\t\trequired: true\n\t}\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>\n\t\trequired: true\n\t}\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice using the\n * `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps())\n * \t```\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component with visual hint\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]))\n * \t```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n * @param propsHint - An optional array of prop names used for the sole purpose of having a visual\n * hint of which props are made available to the slice, this parameters doesn't have any effect\n * @returns Props object to use with `defineProps()`\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;
|
|
1
|
+
{"version":3,"file":"getSliceComponentProps.js","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":["import type { PropType } from \"vue\"\n\nimport type { SliceComponentProps, SliceLike } from \"./types\"\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using the `<SliceZone />`\n * component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n */\ntype DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>\n\t\trequired: true\n\t}\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>\n\t\trequired: true\n\t}\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>\n\t\trequired: true\n\t}\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice using the\n * `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps())\n * \t```\n *\n * @example\n * \t```typescript\n * \t// Defining a new slice component with visual hint\n * \timport { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]))\n * \t```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made available to all Slice\n * components\n * @param propsHint - An optional array of prop names used for the sole purpose of having a visual\n * hint of which props are made available to the slice, this parameters doesn't have any effect\n * @returns Props object to use with `defineProps()`\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;CACX;CACA,OAAO;EACN,MAAM;EACN,UAAU;CACX;CACA,QAAQ;EACP,MAAM;EACN,UAAU;CACX;CACA,SAAS;EACR,MAAM;EACN,UAAU;CACX;AACD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SliceComponentProps, SliceComponentType, SliceLike, SliceLikeGraphQL, SliceLikeRestV2, SliceZoneComponents, SliceZoneLike } from "./types.cjs";
|
|
2
2
|
import { TODOSliceComponent } from "./TODOSliceComponent.cjs";
|
|
3
3
|
import { getSliceComponentProps } from "./getSliceComponentProps.cjs";
|
|
4
|
-
import { defineSliceZoneComponents } from "./defineSliceZoneComponents.cjs";
|
|
4
|
+
import { defineSliceZoneComponents } from "./defineSliceZoneComponents.cjs";
|
|
5
|
+
export { type SliceComponentProps, type SliceComponentType, type SliceLike, type SliceLikeGraphQL, type SliceLikeRestV2, type SliceZoneComponents, type SliceZoneLike, TODOSliceComponent, defineSliceZoneComponents, getSliceComponentProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SliceComponentProps, SliceComponentType, SliceLike, SliceLikeGraphQL, SliceLikeRestV2, SliceZoneComponents, SliceZoneLike } from "./types.js";
|
|
2
2
|
import { TODOSliceComponent } from "./TODOSliceComponent.js";
|
|
3
3
|
import { getSliceComponentProps } from "./getSliceComponentProps.js";
|
|
4
|
-
import { defineSliceZoneComponents } from "./defineSliceZoneComponents.js";
|
|
4
|
+
import { defineSliceZoneComponents } from "./defineSliceZoneComponents.js";
|
|
5
|
+
export { type SliceComponentProps, type SliceComponentType, type SliceLike, type SliceLikeGraphQL, type SliceLikeRestV2, type SliceZoneComponents, type SliceZoneLike, TODOSliceComponent, defineSliceZoneComponents, getSliceComponentProps };
|