@prismicio/vue 6.0.0 → 6.1.0-canary.46cd635
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 -0
- package/dist/PrismicImage.js.map +1 -0
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/{src/PrismicImage.vue.d.ts → PrismicImage.vue.d.ts} +4 -4
- package/dist/PrismicImage.vue.d.ts.map +1 -0
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicLink.cjs.map +1 -0
- package/dist/PrismicLink.js.map +1 -0
- package/dist/PrismicLink.vue.d.ts.map +1 -0
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +4 -4
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.js.map +1 -0
- package/dist/PrismicRichText/types.d.ts.map +1 -0
- package/dist/PrismicTable/PrismicTable.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTable.js.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue.d.cts +2 -2
- package/dist/{src/PrismicTable → PrismicTable}/PrismicTable.vue.d.ts +2 -2
- package/dist/PrismicTable/PrismicTable.vue.d.ts.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.js.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/{src/PrismicTable → PrismicTable}/getTableComponentProps.cjs +2 -2
- package/dist/PrismicTable/getTableComponentProps.cjs.map +1 -0
- package/dist/PrismicTable/getTableComponentProps.d.ts.map +1 -0
- package/dist/{src/PrismicTable → PrismicTable}/getTableComponentProps.js +2 -2
- package/dist/PrismicTable/getTableComponentProps.js.map +1 -0
- package/dist/PrismicTable/types.d.ts.map +1 -0
- package/dist/PrismicText.cjs.map +1 -0
- package/dist/PrismicText.js.map +1 -0
- package/dist/PrismicText.vue.d.cts +2 -2
- package/dist/PrismicText.vue.d.ts.map +1 -0
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/SliceSimulator.cjs +8 -0
- package/dist/SliceSimulator.cjs.map +1 -0
- package/dist/SliceSimulator.js +8 -0
- package/dist/SliceSimulator.js.map +1 -0
- package/dist/SliceSimulator.vue.d.cts +57 -0
- package/dist/SliceSimulator.vue.d.cts.map +1 -0
- package/dist/SliceSimulator.vue.d.ts +57 -0
- package/dist/SliceSimulator.vue.d.ts.map +1 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs +66 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/SliceZone/SliceZone.cjs.map +1 -0
- package/dist/SliceZone/SliceZone.js.map +1 -0
- package/dist/SliceZone/SliceZone.vue.d.cts +2 -2
- package/dist/SliceZone/SliceZone.vue.d.ts.map +1 -0
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.cjs.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.d.ts.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.js.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.cjs.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.d.ts.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.js.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.cjs.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.d.ts.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.js.map +1 -0
- package/dist/SliceZone/types.d.ts.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +2 -2
- package/dist/_virtual/rolldown_runtime.js +2 -2
- package/dist/createPrismic.cjs.map +1 -0
- package/dist/createPrismic.d.ts.map +1 -0
- package/dist/createPrismic.js.map +1 -0
- package/dist/index.cjs +14 -12
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +20 -19
- package/dist/index.js +14 -13
- package/dist/{src/lib → lib}/devMsg.cjs +1 -1
- package/dist/lib/devMsg.cjs.map +1 -0
- package/dist/{src/lib → lib}/devMsg.js +1 -1
- package/dist/lib/devMsg.js.map +1 -0
- package/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/lib/isInternalURL.js.map +1 -0
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js.map +1 -0
- package/package.json +18 -10
- package/src/SliceSimulator.vue +78 -0
- package/src/index.ts +3 -0
- package/dist/src/PrismicImage.cjs.map +0 -1
- package/dist/src/PrismicImage.js.map +0 -1
- package/dist/src/PrismicImage.vue.d.ts.map +0 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicLink.cjs.map +0 -1
- package/dist/src/PrismicLink.js.map +0 -1
- package/dist/src/PrismicLink.vue.d.ts.map +0 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichText.cjs.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichText.js.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/getRichTextComponentProps.cjs.map +0 -1
- package/dist/src/PrismicRichText/getRichTextComponentProps.d.ts.map +0 -1
- package/dist/src/PrismicRichText/getRichTextComponentProps.js.map +0 -1
- package/dist/src/PrismicRichText/types.d.ts.map +0 -1
- package/dist/src/PrismicTable/PrismicTable.cjs.map +0 -1
- package/dist/src/PrismicTable/PrismicTable.js.map +0 -1
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +0 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +0 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +0 -1
- package/dist/src/PrismicTable/PrismicTableRow.cjs.map +0 -1
- package/dist/src/PrismicTable/PrismicTableRow.js.map +0 -1
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicTable/getTableComponentProps.cjs.map +0 -1
- package/dist/src/PrismicTable/getTableComponentProps.d.ts.map +0 -1
- package/dist/src/PrismicTable/getTableComponentProps.js.map +0 -1
- package/dist/src/PrismicTable/types.d.ts.map +0 -1
- package/dist/src/PrismicText.cjs.map +0 -1
- package/dist/src/PrismicText.js.map +0 -1
- package/dist/src/PrismicText.vue.d.ts.map +0 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/SliceZone/SliceZone.cjs.map +0 -1
- package/dist/src/SliceZone/SliceZone.js.map +0 -1
- package/dist/src/SliceZone/SliceZone.vue.d.ts.map +0 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/SliceZone/TODOSliceComponent.cjs.map +0 -1
- package/dist/src/SliceZone/TODOSliceComponent.d.ts.map +0 -1
- package/dist/src/SliceZone/TODOSliceComponent.js.map +0 -1
- package/dist/src/SliceZone/defineSliceZoneComponents.cjs.map +0 -1
- package/dist/src/SliceZone/defineSliceZoneComponents.d.ts.map +0 -1
- package/dist/src/SliceZone/defineSliceZoneComponents.js.map +0 -1
- package/dist/src/SliceZone/getSliceComponentProps.cjs.map +0 -1
- package/dist/src/SliceZone/getSliceComponentProps.d.ts.map +0 -1
- package/dist/src/SliceZone/getSliceComponentProps.js.map +0 -1
- package/dist/src/SliceZone/types.d.ts.map +0 -1
- package/dist/src/createPrismic.cjs.map +0 -1
- package/dist/src/createPrismic.d.ts.map +0 -1
- package/dist/src/createPrismic.js.map +0 -1
- package/dist/src/lib/devMsg.cjs.map +0 -1
- package/dist/src/lib/devMsg.js.map +0 -1
- package/dist/src/lib/isInternalURL.cjs.map +0 -1
- package/dist/src/lib/isInternalURL.js.map +0 -1
- package/dist/src/types.cjs.map +0 -1
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js.map +0 -1
- /package/dist/{src/PrismicImage.cjs → PrismicImage.cjs} +0 -0
- /package/dist/{src/PrismicImage.js → PrismicImage.js} +0 -0
- /package/dist/{src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs → PrismicImage.vue_vue_type_script_setup_true_lang.cjs} +0 -0
- /package/dist/{src/PrismicImage.vue_vue_type_script_setup_true_lang.js → PrismicImage.vue_vue_type_script_setup_true_lang.js} +0 -0
- /package/dist/{src/PrismicLink.cjs → PrismicLink.cjs} +0 -0
- /package/dist/{src/PrismicLink.js → PrismicLink.js} +0 -0
- /package/dist/{src/PrismicLink.vue.d.ts → PrismicLink.vue.d.ts} +0 -0
- /package/dist/{src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs → PrismicLink.vue_vue_type_script_setup_true_lang.cjs} +0 -0
- /package/dist/{src/PrismicLink.vue_vue_type_script_setup_true_lang.js → PrismicLink.vue_vue_type_script_setup_true_lang.js} +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichText.cjs +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichText.js +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichText.vue.d.ts +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichText.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextDefaultComponent.cjs +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextDefaultComponent.js +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextSerialize.cjs +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextSerialize.js +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/getRichTextComponentProps.cjs +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/getRichTextComponentProps.d.ts +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/getRichTextComponentProps.js +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/index.d.ts +0 -0
- /package/dist/{src/PrismicRichText → PrismicRichText}/types.d.ts +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTable.cjs +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTable.js +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTable.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTableDefaultComponents.cjs +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTableDefaultComponents.js +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTableRow.cjs +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTableRow.js +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/getTableComponentProps.d.ts +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/index.d.ts +0 -0
- /package/dist/{src/PrismicTable → PrismicTable}/types.d.ts +0 -0
- /package/dist/{src/PrismicText.cjs → PrismicText.cjs} +0 -0
- /package/dist/{src/PrismicText.js → PrismicText.js} +0 -0
- /package/dist/{src/PrismicText.vue.d.ts → PrismicText.vue.d.ts} +0 -0
- /package/dist/{src/PrismicText.vue_vue_type_script_setup_true_lang.cjs → PrismicText.vue_vue_type_script_setup_true_lang.cjs} +0 -0
- /package/dist/{src/PrismicText.vue_vue_type_script_setup_true_lang.js → PrismicText.vue_vue_type_script_setup_true_lang.js} +0 -0
- /package/dist/{src/SliceZone → SliceZone}/SliceZone.cjs +0 -0
- /package/dist/{src/SliceZone → SliceZone}/SliceZone.js +0 -0
- /package/dist/{src/SliceZone → SliceZone}/SliceZone.vue.d.ts +0 -0
- /package/dist/{src/SliceZone → SliceZone}/SliceZone.vue_vue_type_script_setup_true_lang.cjs +0 -0
- /package/dist/{src/SliceZone → SliceZone}/SliceZone.vue_vue_type_script_setup_true_lang.js +0 -0
- /package/dist/{src/SliceZone → SliceZone}/TODOSliceComponent.cjs +0 -0
- /package/dist/{src/SliceZone → SliceZone}/TODOSliceComponent.d.ts +0 -0
- /package/dist/{src/SliceZone → SliceZone}/TODOSliceComponent.js +0 -0
- /package/dist/{src/SliceZone → SliceZone}/defineSliceZoneComponents.cjs +0 -0
- /package/dist/{src/SliceZone → SliceZone}/defineSliceZoneComponents.d.ts +0 -0
- /package/dist/{src/SliceZone → SliceZone}/defineSliceZoneComponents.js +0 -0
- /package/dist/{src/SliceZone → SliceZone}/getSliceComponentProps.cjs +0 -0
- /package/dist/{src/SliceZone → SliceZone}/getSliceComponentProps.d.ts +0 -0
- /package/dist/{src/SliceZone → SliceZone}/getSliceComponentProps.js +0 -0
- /package/dist/{src/SliceZone → SliceZone}/index.d.ts +0 -0
- /package/dist/{src/SliceZone → SliceZone}/types.d.ts +0 -0
- /package/dist/{src/createPrismic.cjs → createPrismic.cjs} +0 -0
- /package/dist/{src/createPrismic.d.ts → createPrismic.d.ts} +0 -0
- /package/dist/{src/createPrismic.js → createPrismic.js} +0 -0
- /package/dist/{src/lib → lib}/isInternalURL.cjs +0 -0
- /package/dist/{src/lib → lib}/isInternalURL.js +0 -0
- /package/dist/{src/types.cjs → types.cjs} +0 -0
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{src/types.js → types.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/PrismicTable/getTableComponentProps.ts
|
|
4
|
-
var getTableComponentProps_exports = /* @__PURE__ */ require_rolldown_runtime.
|
|
4
|
+
var getTableComponentProps_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
|
|
5
5
|
table: () => table,
|
|
6
6
|
tbody: () => tbody,
|
|
7
7
|
td: () => td,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTableComponentProps.cjs","names":[],"sources":["../../src/PrismicTable/getTableComponentProps.ts"],"sourcesContent":["import type {\n\tTableField,\n\tTableFieldBody,\n\tTableFieldBodyRow,\n\tTableFieldDataCell,\n\tTableFieldHead,\n\tTableFieldHeadRow,\n\tTableFieldHeaderCell,\n} from \"@prismicio/client\"\nimport type { PropType } from \"vue\"\n\n/**\n * Gets native Vue props for a component rendering `table` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"table\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.table())\n * ```\n */\nexport const table = (): {\n\ttable: { type: PropType<TableField<\"filled\">>; required: true }\n} => ({\n\ttable: { type: Object as PropType<TableField<\"filled\">>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `thead` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"head\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.thead())\n * ```\n */\nexport const thead = (): {\n\thead: { type: PropType<TableFieldHead>; required: true }\n} => ({\n\thead: { type: Object as PropType<TableFieldHead>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `tbody` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"body\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.body())\n * ```\n */\nexport const tbody = (): {\n\tbody: { type: PropType<TableFieldBody>; required: true }\n} => ({\n\tbody: { type: Object as PropType<TableFieldBody>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `tr` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"row\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.tr())\n * ```\n */\nexport const tr = (): {\n\trow: {\n\t\ttype: PropType<TableFieldHeadRow | TableFieldBodyRow>\n\t\trequired: true\n\t}\n} => ({\n\trow: {\n\t\ttype: Object as PropType<TableFieldHeadRow | TableFieldBodyRow>,\n\t\trequired: true,\n\t},\n})\n\n/**\n * Gets native Vue props for a component rendering `th` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"cell\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.th())\n * ```\n */\nexport const th = (): {\n\tcell: { type: PropType<TableFieldHeaderCell>; required: true }\n} => ({\n\tcell: { type: Object as PropType<TableFieldHeaderCell>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `td` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"cell\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.td())\n * ```\n */\nexport const td = (): {\n\tcell: { type: PropType<TableFieldDataCell>; required: true }\n} => ({\n\tcell: { type: Object as PropType<TableFieldDataCell>, required: true },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,eAEP,EACL,OAAO;CAAE,MAAM;CAA0C,UAAU;CAAM,EACzE;;;;;;;;;;;;;;;;AAiBD,MAAa,eAEP,EACL,MAAM;CAAE,MAAM;CAAoC,UAAU;CAAM,EAClE;;;;;;;;;;;;;;;;AAiBD,MAAa,eAEP,EACL,MAAM;CAAE,MAAM;CAAoC,UAAU;CAAM,EAClE;;;;;;;;;;;;;;;;AAiBD,MAAa,YAKP,EACL,KAAK;CACJ,MAAM;CACN,UAAU;CACV,EACD;;;;;;;;;;;;;;;;AAiBD,MAAa,YAEP,EACL,MAAM;CAAE,MAAM;CAA0C,UAAU;CAAM,EACxE;;;;;;;;;;;;;;;;AAiBD,MAAa,YAEP,EACL,MAAM;CAAE,MAAM;CAAwC,UAAU;CAAM,EACtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTableComponentProps.d.ts","names":[],"sources":["../../src/PrismicTable/getTableComponentProps.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;AA0BA;AAqBA;AAqBA;AAqBA;AAEiB,cAjEJ,KAiEI,EAAA,GAAA,GAAA;EAAoB,KAAA,EAAA;IAA7B,IAAA,EAhEQ,QAgER,CAhEiB,UAgEjB,CAAA,QAAA,CAAA,CAAA;IAAQ,QAAA,EAAA,IAAA;EAyBH,CAAA;AAqBb,CAAA;;;;;;;;;;;;;;;;cA1Fa;;UACE,SAAS;;;;;;;;;;;;;;;;;;;cAoBX;;UACE,SAAS;;;;;;;;;;;;;;;;;;;cAoBX;;UAEL,SAAS,oBAAoB;;;;;;;;;;;;;;;;;;;cAyBxB;;UACE,SAAS;;;;;;;;;;;;;;;;;;;cAoBX;;UACE,SAAS"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __exportAll } from "../_virtual/rolldown_runtime.js";
|
|
2
2
|
|
|
3
3
|
//#region src/PrismicTable/getTableComponentProps.ts
|
|
4
|
-
var getTableComponentProps_exports = /* @__PURE__ */
|
|
4
|
+
var getTableComponentProps_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
table: () => table,
|
|
6
6
|
tbody: () => tbody,
|
|
7
7
|
td: () => td,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTableComponentProps.js","names":[],"sources":["../../src/PrismicTable/getTableComponentProps.ts"],"sourcesContent":["import type {\n\tTableField,\n\tTableFieldBody,\n\tTableFieldBodyRow,\n\tTableFieldDataCell,\n\tTableFieldHead,\n\tTableFieldHeadRow,\n\tTableFieldHeaderCell,\n} from \"@prismicio/client\"\nimport type { PropType } from \"vue\"\n\n/**\n * Gets native Vue props for a component rendering `table` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"table\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.table())\n * ```\n */\nexport const table = (): {\n\ttable: { type: PropType<TableField<\"filled\">>; required: true }\n} => ({\n\ttable: { type: Object as PropType<TableField<\"filled\">>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `thead` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"head\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.thead())\n * ```\n */\nexport const thead = (): {\n\thead: { type: PropType<TableFieldHead>; required: true }\n} => ({\n\thead: { type: Object as PropType<TableFieldHead>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `tbody` elements from a\n * Prismic table field with `<PrismicTable />`.\n *\n * Props are: `[\"body\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.body())\n * ```\n */\nexport const tbody = (): {\n\tbody: { type: PropType<TableFieldBody>; required: true }\n} => ({\n\tbody: { type: Object as PropType<TableFieldBody>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `tr` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"row\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.tr())\n * ```\n */\nexport const tr = (): {\n\trow: {\n\t\ttype: PropType<TableFieldHeadRow | TableFieldBodyRow>\n\t\trequired: true\n\t}\n} => ({\n\trow: {\n\t\ttype: Object as PropType<TableFieldHeadRow | TableFieldBodyRow>,\n\t\trequired: true,\n\t},\n})\n\n/**\n * Gets native Vue props for a component rendering `th` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"cell\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.th())\n * ```\n */\nexport const th = (): {\n\tcell: { type: PropType<TableFieldHeaderCell>; required: true }\n} => ({\n\tcell: { type: Object as PropType<TableFieldHeaderCell>, required: true },\n})\n\n/**\n * Gets native Vue props for a component rendering `td` elements from a Prismic\n * table field with `<PrismicTable />`.\n *\n * Props are: `[\"cell\"]`\n *\n * @example\n *\n * ```javascript\n * // Defining a new rich text component\n * import { getTableComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getTableComponentProps.td())\n * ```\n */\nexport const td = (): {\n\tcell: { type: PropType<TableFieldDataCell>; required: true }\n} => ({\n\tcell: { type: Object as PropType<TableFieldDataCell>, required: true },\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,eAEP,EACL,OAAO;CAAE,MAAM;CAA0C,UAAU;CAAM,EACzE;;;;;;;;;;;;;;;;AAiBD,MAAa,eAEP,EACL,MAAM;CAAE,MAAM;CAAoC,UAAU;CAAM,EAClE;;;;;;;;;;;;;;;;AAiBD,MAAa,eAEP,EACL,MAAM;CAAE,MAAM;CAAoC,UAAU;CAAM,EAClE;;;;;;;;;;;;;;;;AAiBD,MAAa,YAKP,EACL,KAAK;CACJ,MAAM;CACN,UAAU;CACV,EACD;;;;;;;;;;;;;;;;AAiBD,MAAa,YAEP,EACL,MAAM;CAAE,MAAM;CAA0C,UAAU;CAAM,EACxE;;;;;;;;;;;;;;;;AAiBD,MAAa,YAEP,EACL,MAAM;CAAE,MAAM;CAAwC,UAAU;CAAM,EACtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;;;;AAGI,KAHQ,eAAA,GAGR;EAEkB,KAAA,CAAA,EAHlB,SAGkB,CAAA;IAAlB,KAAA,EAHmB,UAGnB,CAAA,QAAA,CAAA;EACK,CAAA,CAAA,GAHL,IAGK,CAHA,kBAGA,EAAA,IAAA,CAAA;EAAL,KAAA,CAAA,EADA,SACA,CAAA;IAEkB,IAAA,EAHA,cAGA;EAAlB,CAAA,CAAA,GAFA,IAEA,CAFK,kBAEL,EAAA,IAAA,CAAA;EACK,KAAA,CAAA,EADL,SACK,CAAA;IAAL,IAAA,EADkB,cAClB;EAEiB,CAAA,CAAA,GAFjB,IAEiB,CAFZ,kBAEY,EAAA,IAAA,CAAA;EAAoB,EAAA,CAAA,EAArC,SAAqC,CAAA;IAArC,GAAA,EAAiB,iBAAjB,GAAqC,iBAArC;EACK,CAAA,CAAA,GAAL,IAAK,CAAA,kBAAA,EAAA,IAAA,CAAA;EAAL,EAAA,CAAA,EAEA,SAFA,CAAA;IAEkB,IAAA,EAAA,oBAAA;EAAlB,CAAA,CAAA,GACA,IADA,CACK,kBADL,EAAA,IAAA,CAAA;EACK,EAAA,CAAA,EAEL,SAFK,CAAA;IAAL,IAAA,EAEkB,kBAFlB;EAEkB,CAAA,CAAA,GAClB,IADkB,CACb,kBADa,EAAA,IAAA,CAAA;CAAlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicText.cjs","names":[],"sources":["../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicText />`. */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicText.js","names":[],"sources":["../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicText />`. */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vue31 from "vue";
|
|
2
2
|
import { RichTextField } from "@prismicio/client";
|
|
3
3
|
|
|
4
4
|
//#region src/PrismicText.vue.d.ts
|
|
@@ -18,7 +18,7 @@ type PrismicTextProps = {
|
|
|
18
18
|
*/
|
|
19
19
|
separator?: string;
|
|
20
20
|
};
|
|
21
|
-
declare const __VLS_export:
|
|
21
|
+
declare const __VLS_export: vue31.DefineComponent<PrismicTextProps, {}, {}, {}, {}, vue31.ComponentOptionsMixin, vue31.ComponentOptionsMixin, {}, string, vue31.PublicProps, Readonly<PrismicTextProps> & Readonly<{}>, {}, {}, {}, {}, string, vue31.ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { PrismicTextProps, _default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;KAyDY,gBAAA;;EAAA,KAAA,EAEJ,aAFoB,GAAA,IAAA,GAAA,SAEpB;EAoDF;;;;EAAY,QAAA,CAAA,EAAA,MAAA;EAAA;;;;;EAAA,SAAA,CAAA,EAAA,MAAA;AAAA,CAAA;cAAZ,cAAY,KAAA,CAAA,gBAAA,kCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicText />`. */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,sBACnR,yDACA,GACF;KAEC,EAAE,CAAA;;kDAKF,yBAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicText />`. */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,OACnR,yDACA,GACF;KAEC,EAAE,CAAA;;0BAKF,MAAA,OAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const require_SliceSimulator_vue_vue_type_script_setup_true_lang = require('./SliceSimulator.vue_vue_type_script_setup_true_lang.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/SliceSimulator.vue
|
|
4
|
+
var SliceSimulator_default = require_SliceSimulator_vue_vue_type_script_setup_true_lang.default;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.default = SliceSimulator_default;
|
|
8
|
+
//# sourceMappingURL=SliceSimulator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceSimulator.cjs","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ref, onMounted, onUnmounted } from \"vue\";\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\";\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) => { slices.value = _slices; },\n\t\t\"simulator-slices\",\n\t);\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => { message.value = _message; },\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":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SliceSimulator_vue_vue_type_script_setup_true_lang_default from "./SliceSimulator.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SliceSimulator.vue
|
|
4
|
+
var SliceSimulator_default = SliceSimulator_vue_vue_type_script_setup_true_lang_default;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { SliceSimulator_default as default };
|
|
8
|
+
//# sourceMappingURL=SliceSimulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceSimulator.js","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { ref, onMounted, onUnmounted } from \"vue\";\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\";\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) => { slices.value = _slices; },\n\t\t\"simulator-slices\",\n\t);\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => { message.value = _message; },\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":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as vue26 from "vue";
|
|
2
|
+
import * as _prismicio_client0 from "@prismicio/client";
|
|
3
|
+
|
|
4
|
+
//#region src/SliceSimulator.vue.d.ts
|
|
5
|
+
/** Props for `<SliceSimulator />`. */
|
|
6
|
+
type SliceSimulatorProps = {
|
|
7
|
+
/** The z-index value of the simulator so that it's displayed above layout elements. */
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
/** The background color of the simulator to match website design. */
|
|
10
|
+
background?: string;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
slices: [] | [{
|
|
14
|
+
slice_type: string;
|
|
15
|
+
slice_label: string | null;
|
|
16
|
+
id: string;
|
|
17
|
+
primary: Record<string, _prismicio_client0.AnyRegularField>;
|
|
18
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
19
|
+
} | {
|
|
20
|
+
slice_type: string;
|
|
21
|
+
slice_label: null;
|
|
22
|
+
id: string;
|
|
23
|
+
variation: string;
|
|
24
|
+
version: string;
|
|
25
|
+
primary: Record<string, _prismicio_client0.AnySlicePrimaryField>;
|
|
26
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
27
|
+
}, ...({
|
|
28
|
+
slice_type: string;
|
|
29
|
+
slice_label: string | null;
|
|
30
|
+
id: string;
|
|
31
|
+
primary: Record<string, _prismicio_client0.AnyRegularField>;
|
|
32
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
33
|
+
} | {
|
|
34
|
+
slice_type: string;
|
|
35
|
+
slice_label: null;
|
|
36
|
+
id: string;
|
|
37
|
+
variation: string;
|
|
38
|
+
version: string;
|
|
39
|
+
primary: Record<string, _prismicio_client0.AnySlicePrimaryField>;
|
|
40
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
41
|
+
})[]];
|
|
42
|
+
};
|
|
43
|
+
type __VLS_Slots = {} & {
|
|
44
|
+
default?: (props: typeof __VLS_1) => any;
|
|
45
|
+
};
|
|
46
|
+
declare const __VLS_base: vue26.DefineComponent<SliceSimulatorProps, {}, {}, {}, {}, vue26.ComponentOptionsMixin, vue26.ComponentOptionsMixin, {}, string, vue26.PublicProps, Readonly<SliceSimulatorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue26.ComponentProvideOptions, false, {}, any>;
|
|
47
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
48
|
+
declare const _default: typeof __VLS_export;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=SliceSimulator.vue.d.ts.map
|
|
55
|
+
//#endregion
|
|
56
|
+
export { SliceSimulatorProps, _default };
|
|
57
|
+
//# sourceMappingURL=SliceSimulator.vue.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceSimulator.vue.d.cts","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":[],"mappings":";;;;;KA+FY,mBAAA;;;EAAA;EA0FR,UAAkB,CAAA,EAAA,MAAA;CAAA;YAAlB;;;;;4BAAkB,kBAAA,CAAA,eAAA;;;;;;;;;;;IACjB,UAAW,EAAA,MAAA;IAMV,WAEJ,EAAA,MAAA,GAAA,IAAA;IAFc,EAAA,EAAA,MAAA;IAAA,OAAA,QAAA,CAAA,MAAA,qCAAA;IAAA,KAAA,QAAA,CAAA,MAAA,qCAAA,EAAA;EAAA,CAAA,GAAA;IAAA,UAAA,EAAA,MAAA;IAAA,WAAA,EAAA,IAAA;IAAA,EAAA,EAAA,MAAA;IAAA,SAAA,EAAA,MAAA;IAAA,OAAA,EAAA,MAAA;IAAA,OAAA,QAAA,CAAA,MAAA,0CAAA;IAGV,KAAA,QAAoE,CAAA,MAAA,qCAAA,EAAA;EAAxB,CAAA,CAAA,EAAA,CAAA;CAAY;KATzD,WAAA,GASsB,CAAA,CAAA,GAAA;EAAe,OAAA,CAAA,EAAA,CAAA,KAAA,EAAA,OARb,OAQa,EAAA,GAAA,GAAA;AAAA,CAAA;AAC1C,cAJM,UAKc,EALJ,KAAA,CAAA,eAOL,CAPK,mBAOL,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAPK,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,EAOL,CAAA,CAAA,EAAA,MAAA,EAPK,KAAA,CAAA,WAAA,EAAA,QAOL,CAPK,mBAOL,CAAA,GAPK,QAOL,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAPK,KAAA,CAAA,uBAAA,EAOL,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;cAJL,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as vue31 from "vue";
|
|
2
|
+
import * as _prismicio_client0 from "@prismicio/client";
|
|
3
|
+
|
|
4
|
+
//#region src/SliceSimulator.vue.d.ts
|
|
5
|
+
/** Props for `<SliceSimulator />`. */
|
|
6
|
+
type SliceSimulatorProps = {
|
|
7
|
+
/** The z-index value of the simulator so that it's displayed above layout elements. */
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
/** The background color of the simulator to match website design. */
|
|
10
|
+
background?: string;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
slices: [] | [{
|
|
14
|
+
slice_type: string;
|
|
15
|
+
slice_label: string | null;
|
|
16
|
+
id: string;
|
|
17
|
+
primary: Record<string, _prismicio_client0.AnyRegularField>;
|
|
18
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
19
|
+
} | {
|
|
20
|
+
slice_type: string;
|
|
21
|
+
slice_label: null;
|
|
22
|
+
id: string;
|
|
23
|
+
variation: string;
|
|
24
|
+
version: string;
|
|
25
|
+
primary: Record<string, _prismicio_client0.AnySlicePrimaryField>;
|
|
26
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
27
|
+
}, ...({
|
|
28
|
+
slice_type: string;
|
|
29
|
+
slice_label: string | null;
|
|
30
|
+
id: string;
|
|
31
|
+
primary: Record<string, _prismicio_client0.AnyRegularField>;
|
|
32
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
33
|
+
} | {
|
|
34
|
+
slice_type: string;
|
|
35
|
+
slice_label: null;
|
|
36
|
+
id: string;
|
|
37
|
+
variation: string;
|
|
38
|
+
version: string;
|
|
39
|
+
primary: Record<string, _prismicio_client0.AnySlicePrimaryField>;
|
|
40
|
+
items: Record<string, _prismicio_client0.AnyRegularField>[];
|
|
41
|
+
})[]];
|
|
42
|
+
};
|
|
43
|
+
type __VLS_Slots = {} & {
|
|
44
|
+
default?: (props: typeof __VLS_1) => any;
|
|
45
|
+
};
|
|
46
|
+
declare const __VLS_base: vue31.DefineComponent<SliceSimulatorProps, {}, {}, {}, {}, vue31.ComponentOptionsMixin, vue31.ComponentOptionsMixin, {}, string, vue31.PublicProps, Readonly<SliceSimulatorProps> & Readonly<{}>, {}, {}, {}, {}, string, vue31.ComponentProvideOptions, false, {}, any>;
|
|
47
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
48
|
+
declare const _default: typeof __VLS_export;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=SliceSimulator.vue.d.ts.map
|
|
55
|
+
//#endregion
|
|
56
|
+
export { SliceSimulatorProps, _default };
|
|
57
|
+
//# sourceMappingURL=SliceSimulator.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceSimulator.vue.d.ts","names":[],"sources":["../src/SliceSimulator.vue"],"sourcesContent":[],"mappings":";;;;;KA+FY,mBAAA;;;EAAA;EA0FR,UAAkB,CAAA,EAAA,MAAA;CAAA;YAAlB;;;;;4BAAkB,kBAAA,CAAA,eAAA;;;;;;;;;;;IACjB,UAAW,EAAA,MAAA;IAMV,WAEJ,EAAA,MAAA,GAAA,IAAA;IAFc,EAAA,EAAA,MAAA;IAAA,OAAA,QAAA,CAAA,MAAA,qCAAA;IAAA,KAAA,QAAA,CAAA,MAAA,qCAAA,EAAA;EAAA,CAAA,GAAA;IAAA,UAAA,EAAA,MAAA;IAAA,WAAA,EAAA,IAAA;IAAA,EAAA,EAAA,MAAA;IAAA,SAAA,EAAA,MAAA;IAAA,OAAA,EAAA,MAAA;IAAA,OAAA,QAAA,CAAA,MAAA,0CAAA;IAGV,KAAA,QAAoE,CAAA,MAAA,qCAAA,EAAA;EAAxB,CAAA,CAAA,EAAA,CAAA;CAAY;KATzD,WAAA,GASsB,CAAA,CAAA,GAAA;EAAe,OAAA,CAAA,EAAA,CAAA,KAAA,EAAA,OARb,OAQa,EAAA,GAAA,GAAA;AAAA,CAAA;AAC1C,cAJM,UAKc,EALJ,KAAA,CAAA,eAOL,CAPK,mBAOL,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAPK,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,EAOL,CAAA,CAAA,EAAA,MAAA,EAPK,KAAA,CAAA,WAAA,EAAA,QAOL,CAPK,mBAOL,CAAA,GAPK,QAOL,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAPK,KAAA,CAAA,uBAAA,EAOL,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;cAJL,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
let vue = require("vue");
|
|
2
|
+
let _prismicio_simulator_kit = require("@prismicio/simulator/kit");
|
|
3
|
+
|
|
4
|
+
//#region src/SliceSimulator.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
const _hoisted_1 = ["innerHTML"];
|
|
6
|
+
var SliceSimulator_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
7
|
+
name: "SliceSimulator",
|
|
8
|
+
__name: "SliceSimulator",
|
|
9
|
+
props: {
|
|
10
|
+
zIndex: {
|
|
11
|
+
type: Number,
|
|
12
|
+
required: false
|
|
13
|
+
},
|
|
14
|
+
background: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const slices = (0, vue.ref)((0, _prismicio_simulator_kit.getDefaultSlices)());
|
|
22
|
+
const message = (0, vue.ref)((0, _prismicio_simulator_kit.getDefaultMessage)());
|
|
23
|
+
const simulatorManager = new _prismicio_simulator_kit.SimulatorManager();
|
|
24
|
+
(0, vue.onMounted)(() => {
|
|
25
|
+
simulatorManager.state.on(_prismicio_simulator_kit.StateEventType.Slices, (_slices) => {
|
|
26
|
+
slices.value = _slices;
|
|
27
|
+
}, "simulator-slices");
|
|
28
|
+
simulatorManager.state.on(_prismicio_simulator_kit.StateEventType.Message, (_message) => {
|
|
29
|
+
message.value = _message;
|
|
30
|
+
}, "simulator-message");
|
|
31
|
+
simulatorManager.init();
|
|
32
|
+
});
|
|
33
|
+
(0, vue.onUnmounted)(() => {
|
|
34
|
+
simulatorManager.state.off(_prismicio_simulator_kit.StateEventType.Slices, "simulator-slices");
|
|
35
|
+
simulatorManager.state.off(_prismicio_simulator_kit.StateEventType.Message, "simulator-message");
|
|
36
|
+
});
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
39
|
+
class: (0, vue.normalizeClass)((0, vue.unref)(_prismicio_simulator_kit.simulatorClass)),
|
|
40
|
+
style: (0, vue.normalizeStyle)({
|
|
41
|
+
zIndex: props.zIndex || (0, vue.unref)(_prismicio_simulator_kit.getDefaultProps)().zIndex,
|
|
42
|
+
position: "fixed",
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
width: "100%",
|
|
46
|
+
height: "100vh",
|
|
47
|
+
overflow: "auto",
|
|
48
|
+
background: props.background || (0, vue.unref)(_prismicio_simulator_kit.getDefaultProps)().background
|
|
49
|
+
})
|
|
50
|
+
}, [message.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("article", {
|
|
51
|
+
key: 0,
|
|
52
|
+
innerHTML: message.value
|
|
53
|
+
}, null, 8, _hoisted_1)) : slices.value.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
54
|
+
key: 1,
|
|
55
|
+
id: "root",
|
|
56
|
+
class: (0, vue.normalizeClass)((0, vue.unref)(_prismicio_simulator_kit.simulatorRootClass)),
|
|
57
|
+
onClickCapture: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(_prismicio_simulator_kit.onClickHandler) && (0, vue.unref)(_prismicio_simulator_kit.onClickHandler)(...args)),
|
|
58
|
+
onSubmitCapture: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(_prismicio_simulator_kit.disableEventHandler) && (0, vue.unref)(_prismicio_simulator_kit.disableEventHandler)(...args))
|
|
59
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "default", { slices: slices.value })], 34)) : (0, vue.createCommentVNode)("v-if", true)], 6);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
exports.default = SliceSimulator_vue_vue_type_script_setup_true_lang_default;
|
|
66
|
+
//# sourceMappingURL=SliceSimulator.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -0,0 +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 { ref, onMounted, onUnmounted } from \"vue\";\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\";\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) => { slices.value = _slices; },\n\t\t\"simulator-slices\",\n\t);\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => { message.value = _message; },\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,sEAA+B,CAAC;EACtC,MAAM,wEAAiC,CAAC;EAExC,MAAM,mBAAmB,IAAI,2CAAkB;AAE/C,2BAAgB;AACf,oBAAiB,MAAM,GACtB,wCAAe,SACd,YAAY;AAAE,WAAO,QAAQ;MAC9B,mBACA;AACD,oBAAiB,MAAM,GACtB,wCAAe,UACd,aAAa;AAAE,YAAQ,QAAQ;MAChC,oBACA;AAED,oBAAiB,MAAM;IACtB;AAEF,6BAAkB;AACjB,oBAAiB,MAAM,IAAI,wCAAe,QAAQ,mBAAmB;AAErE,oBAAiB,MAAM,IAAI,wCAAe,SAAS,oBAAoB;IACtE;;4DA2BK,OAAA;IAtBJ,8CAAO,wCAAc,CAAA;IACrB,+BAAK;aAAe,MAAM,yBAAU,yCAAe,EAAA,CAAG;;;;;;;iBAA+H,MAAM,6BAAc,yCAAe,EAAA,CAAG;;OAW7M,QAAA,2DAA4B,WAAA;;IAAnB,WAAQ,QAAA;8BAEpB,OAAA,MAAO,4DAOb,OAAA;;IANL,IAAG;IACF,8CAAO,4CAAkB,CAAA;0EACV,wCAAA,mBAAA,wCAAA,CAAA,GAAA,KAAc;2EACb,6CAAA,mBAAA,6CAAA,CAAA,GAAA,KAAmB;2BAEX,KAAA,QAAA,WAAA,EAAlB,QAAQ,OAAA,OAAM,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderSlot, unref } from "vue";
|
|
2
|
+
import { SimulatorManager, StateEventType, disableEventHandler, getDefaultMessage, getDefaultProps, getDefaultSlices, onClickHandler, simulatorClass, simulatorRootClass } from "@prismicio/simulator/kit";
|
|
3
|
+
|
|
4
|
+
//#region src/SliceSimulator.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
const _hoisted_1 = ["innerHTML"];
|
|
6
|
+
var SliceSimulator_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "SliceSimulator",
|
|
8
|
+
__name: "SliceSimulator",
|
|
9
|
+
props: {
|
|
10
|
+
zIndex: {
|
|
11
|
+
type: Number,
|
|
12
|
+
required: false
|
|
13
|
+
},
|
|
14
|
+
background: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const slices = ref(getDefaultSlices());
|
|
22
|
+
const message = ref(getDefaultMessage());
|
|
23
|
+
const simulatorManager = new SimulatorManager();
|
|
24
|
+
onMounted(() => {
|
|
25
|
+
simulatorManager.state.on(StateEventType.Slices, (_slices) => {
|
|
26
|
+
slices.value = _slices;
|
|
27
|
+
}, "simulator-slices");
|
|
28
|
+
simulatorManager.state.on(StateEventType.Message, (_message) => {
|
|
29
|
+
message.value = _message;
|
|
30
|
+
}, "simulator-message");
|
|
31
|
+
simulatorManager.init();
|
|
32
|
+
});
|
|
33
|
+
onUnmounted(() => {
|
|
34
|
+
simulatorManager.state.off(StateEventType.Slices, "simulator-slices");
|
|
35
|
+
simulatorManager.state.off(StateEventType.Message, "simulator-message");
|
|
36
|
+
});
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock("div", {
|
|
39
|
+
class: normalizeClass(unref(simulatorClass)),
|
|
40
|
+
style: normalizeStyle({
|
|
41
|
+
zIndex: props.zIndex || unref(getDefaultProps)().zIndex,
|
|
42
|
+
position: "fixed",
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
width: "100%",
|
|
46
|
+
height: "100vh",
|
|
47
|
+
overflow: "auto",
|
|
48
|
+
background: props.background || unref(getDefaultProps)().background
|
|
49
|
+
})
|
|
50
|
+
}, [message.value ? (openBlock(), createElementBlock("article", {
|
|
51
|
+
key: 0,
|
|
52
|
+
innerHTML: message.value
|
|
53
|
+
}, null, 8, _hoisted_1)) : slices.value.length ? (openBlock(), createElementBlock("div", {
|
|
54
|
+
key: 1,
|
|
55
|
+
id: "root",
|
|
56
|
+
class: normalizeClass(unref(simulatorRootClass)),
|
|
57
|
+
onClickCapture: _cache[0] || (_cache[0] = (...args) => unref(onClickHandler) && unref(onClickHandler)(...args)),
|
|
58
|
+
onSubmitCapture: _cache[1] || (_cache[1] = (...args) => unref(disableEventHandler) && unref(disableEventHandler)(...args))
|
|
59
|
+
}, [renderSlot(_ctx.$slots, "default", { slices: slices.value })], 34)) : createCommentVNode("v-if", true)], 6);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { SliceSimulator_vue_vue_type_script_setup_true_lang_default as default };
|
|
66
|
+
//# sourceMappingURL=SliceSimulator.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +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 { ref, onMounted, onUnmounted } from \"vue\";\nimport {\n\tgetDefaultProps,\n\tgetDefaultSlices,\n\tgetDefaultMessage,\n\tonClickHandler,\n\tdisableEventHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n\tStateEventType,\n\tSimulatorManager,\n} from \"@prismicio/simulator/kit\";\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) => { slices.value = _slices; },\n\t\t\"simulator-slices\",\n\t);\n\tsimulatorManager.state.on(\n\t\tStateEventType.Message,\n\t\t(_message) => { message.value = _message; },\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,kBAAkB,CAAC;EACtC,MAAM,UAAU,IAAI,mBAAmB,CAAC;EAExC,MAAM,mBAAmB,IAAI,kBAAkB;AAE/C,kBAAgB;AACf,oBAAiB,MAAM,GACtB,eAAe,SACd,YAAY;AAAE,WAAO,QAAQ;MAC9B,mBACA;AACD,oBAAiB,MAAM,GACtB,eAAe,UACd,aAAa;AAAE,YAAQ,QAAQ;MAChC,oBACA;AAED,oBAAiB,MAAM;IACtB;AAEF,oBAAkB;AACjB,oBAAiB,MAAM,IAAI,eAAe,QAAQ,mBAAmB;AAErE,oBAAiB,MAAM,IAAI,eAAe,SAAS,oBAAoB;IACtE;;uBAID,mBAuBM,OAAA;IAtBJ,OAAK,eAAE,MAAA,eAAc,CAAA;IACrB,OAAK,eAAA;aAAe,MAAM,UAAU,MAAA,gBAAe,EAAA,CAAG;;;;;;;iBAA+H,MAAM,cAAc,MAAA,gBAAe,EAAA,CAAG;;OAW7M,QAAA,sBAAf,mBAA2C,WAAA;;IAAnB,WAAQ,QAAA;8BAEpB,OAAA,MAAO,uBADnB,mBAQM,OAAA;;IANL,IAAG;IACF,OAAK,eAAE,MAAA,mBAAkB,CAAA;2DACV,MAAA,eAAA,IAAA,MAAA,eAAA,CAAA,GAAA,KAAc;4DACb,MAAA,oBAAA,IAAA,MAAA,oBAAA,CAAA,GAAA,KAAmB;OAEpC,WAAyB,KAAA,QAAA,WAAA,EAAlB,QAAQ,OAAA,OAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceZone.cjs","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\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/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\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 =\n\t\t\t\"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\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${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":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceZone.js","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\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/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\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 =\n\t\t\t\"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\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${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":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from "./types.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue21 from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/SliceZone/SliceZone.vue.d.ts
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@ type SliceZoneProps<TContext = unknown> = {
|
|
|
22
22
|
context?: TContext;
|
|
23
23
|
};
|
|
24
24
|
type __VLS_Props = SliceZoneProps;
|
|
25
|
-
declare const __VLS_export:
|
|
25
|
+
declare const __VLS_export: vue21.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue21.ComponentOptionsMixin, vue21.ComponentOptionsMixin, {}, string, vue21.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue21.ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
declare const _default: typeof __VLS_export;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { SliceZoneProps, _default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceZone.vue.d.ts","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":[],"mappings":";;;;;;;;AA+GA;;AAEoC,KAFxB,cAEwB,CAAA,WAAA,OAAA,CAAA,GAAA;EAAY;EAAvC,MAAA,EAAA,aAAA,CAAc,SAAd,GAAA,CAA2B,SAA3B,GAAuC,MAAvC,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,CAAA;EAGK;EAO8B,UAAA,CAAA,EAP9B,mBAO8B;EAAxB;;;AAInB;EAkFK,gBAEJ,CAAA,EAxFkB,kBAwFlB,CAAA,GAAA,EAxF0C,QAwF1C,CAAA;EAFgB;EAAA,OAAA,CAAA,EAnFP,QAmFO;CAAA;KAhFb,WAAA,GAAc,cAgFD;cAAZ,YAAY,EAAA,KAAA,CAAA,eAAA,CAAA,WAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,WAAA,EAAA,QAAA,CAAA,WAAA,CAAA,GAAA,QAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,uBAAA,EAAA,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;cAAA,QAAA,EAAA,OAGU,YAHV"}
|
|
@@ -0,0 +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 type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\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/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\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 =\n\t\t\t\"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\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${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":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,QAAQ;EAGd,MAAM,yCAME;AACP,OAAI,CAAC,MAAM,OAAQ,QAAO,EAAC;AAE3B,UAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OACL,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE9D,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAClC,MAAM,KACN,GAAG,MAAM,GAAG,KAAK,UAAU,MAAM;IAErC,MAAM,KAAK,MAAM,aAAa,SAAS,MAAM;AAE7C,QAAI,CAAC,GACJ,QAAO;KAAE,IAAI;KAAoB;KAAK,OAAO,EAAE,OAAO;KAAC;AAGxD,QAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;AAErC,YAAO;MAAE;MAAI;MAAK,OAAO;MAAY;;AAGtC,WAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;MACd;KACF;KACA;IACD;;gEASE,cAAA,0BAJuB,eAAA,QAAjB,kBAAa;uFACf,cAAc,GAAE,sBAGpB,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
|
|
@@ -0,0 +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 type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\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/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\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 =\n\t\t\t\"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\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${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":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,QAAQ;EAGd,MAAM,iBAAiB,eAMf;AACP,OAAI,CAAC,MAAM,OAAQ,QAAO,EAAC;AAE3B,UAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OACL,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE9D,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAClC,MAAM,KACN,GAAG,MAAM,GAAG,KAAK,UAAU,MAAM;IAErC,MAAM,KAAK,MAAM,aAAa,SAAS,MAAM;AAE7C,QAAI,CAAC,GACJ,QAAO;KAAE,IAAI;KAAoB;KAAK,OAAO,EAAE,OAAO;KAAC;AAGxD,QAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;AAErC,YAAO;MAAE;MAAI;MAAK,OAAO;MAAY;;AAGtC,WAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;MACd;KACF;KACA;IACD;;2BAIA,mBAKE,UAAA,MAAA,WAJuB,eAAA,QAAjB,kBAAa;wBADrB,YAKE,wBAHI,cAAc,GAAE,EAFtB,WAKE,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
|
|
@@ -0,0 +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\n * implementation.\n *\n * This is also the default Vue component rendered when a component mapping\n * cannot be found in `<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\n\t\t\t\t\t\t? props.slice.slice_type\n\t\t\t\t\t\t: 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":";;;;;;;;;;;AAcA,MAAa,qBAAqBA,cAChB,yCAAgB;CAC/B,MAAM;CACN,OAAO,EACN,OAAO;EACN,MAAM;EACN,UAAU;EACV,EACD;CACD,MAAM,OAAO;EACZ,MAAM,+BAAsB;AAC3B,UAAO,gBAAgB,MAAM,QAC1B,MAAM,MAAM,aACZ,MAAM,MAAM;IACd;AAEF,6BAAkB;AACjB,WAAQ,KACP,0DAA0D,KAAK,MAAM,IACrE,MAAM,MACN;IACA;AAEF,eAAa;AACZ,qBACC,WACA;IACC,kCAAkC;IAClC,mBAAmB,KAAK;IACxB,EACD,CAAC,8CAA8C,KAAK,MAAM,GAAG,CAC7D;;;CAGH,CAAC,UACO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TODOSliceComponent.d.ts","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;;;;;cAAa,oBAAkB"}
|
|
@@ -0,0 +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\n * implementation.\n *\n * This is also the default Vue component rendered when a component mapping\n * cannot be found in `<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\n\t\t\t\t\t\t? props.slice.slice_type\n\t\t\t\t\t\t: 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":";;;;;;;;;;;AAcA,MAAa,qBAAqB,MAChB,gCAAgB;CAC/B,MAAM;CACN,OAAO,EACN,OAAO;EACN,MAAM;EACN,UAAU;EACV,EACD;CACD,MAAM,OAAO;EACZ,MAAM,OAAO,eAAe;AAC3B,UAAO,gBAAgB,MAAM,QAC1B,MAAM,MAAM,aACZ,MAAM,MAAM;IACd;AAEF,oBAAkB;AACjB,WAAQ,KACP,0DAA0D,KAAK,MAAM,IACrE,MAAM,MACN;IACA;AAEF,eAAa;AACZ,UAAO,EACN,WACA;IACC,kCAAkC;IAClC,mBAAmB,KAAK;IACxB,EACD,CAAC,8CAA8C,KAAK,MAAM,GAAG,CAC7D;;;CAGH,CAAC,UACO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.cjs","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n} from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n *\n * @example\n *\n * ```javascript\n * // Defining a slice components\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\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 *\n * @param components - {@link SliceZoneComponents}\n *\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<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,EAAE;CAEjB,IAAI;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,6BAEA,UAIA;;AAGL,QAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.d.ts","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":[],"mappings":";;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,2CAEG,iDAGH,oBAAoB,QAAQ,cACtC,oBAAoB,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.js","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n} from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n *\n * @example\n *\n * ```javascript\n * // Defining a slice components\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\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 *\n * @param components - {@link SliceZoneComponents}\n *\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<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,EAAE;CAEjB,IAAI;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,YACA,QACA,UAIA;;AAGL,QAAO"}
|
|
@@ -0,0 +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\n * the `<SliceZone />` component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice 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\n * using the `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getSliceComponentProps())\n * ```\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component with visual hint\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(\n * \tgetSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n * )\n * ```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n *\n * @param propsHint - An optional array of prop names used for the sole purpose\n * of having a visual hint of which props are made available to the slice,\n * this parameters doesn't have any effect\n *\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<\n\t\t\tSliceComponentProps<TSlice, TContext>[\"context\"]\n\t\t>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,QAAQ;EACP,MAAM;EACN,UAAU;EACV;CACD,SAAS;EACR,MAAM;EAGN,UAAU;EACV;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSliceComponentProps.d.ts","names":[],"sources":["../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":[],"mappings":";;;;;;;AAE6D;;;;;;KAUxD,kCAUgC,CAAA,eARrB,SAQqB,GAAA,GAAA,EAAA,WAAA,OAAA,CAAA,GAAA;EAAQ,KAAA,EAAA;IAA5B,IAAA,EAJT,QAIS,CAJA,mBAIA,CAJoB,MAIpB,EAJ4B,QAI5B,CAAA,CAAA,OAAA,CAAA,CAAA;IAAT,QAAA,EAAA,IAAA;EAI6B,CAAA;EAAQ,KAAA,EAAA;IAA5B,IAAA,EAJT,QAIS,CAJA,mBAIA,CAJoB,MAIpB,EAJ4B,QAI5B,CAAA,CAAA,OAAA,CAAA,CAAA;IAAT,QAAA,EAAA,IAAA;EAI6B,CAAA;EAAQ,MAAA,EAAA;IAA5B,IAAA,EAJT,QAIS,CAJA,mBAIA,CAJoB,MAIpB,EAJ4B,QAI5B,CAAA,CAAA,QAAA,CAAA,CAAA;IAAT,QAAA,EAAA,IAAA;EAAQ,CAAA;EAyCH,OAAA,EAAA;IAEG,IAAA,EA3CR,QA2CQ,CA3CC,mBA2CD,CA3CqB,MA2CrB,EA3C6B,QA2C7B,CAAA,CAAA,SAAA,CAAA,CAAA;IAKsB,QAAA,EAAA,IAAA;EAAQ,CAAA;CAA3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAPU,wCAEG,6FAKb,mCAAmC,QAAQ"}
|
|
@@ -0,0 +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\n * the `<SliceZone />` component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice 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\n * using the `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getSliceComponentProps())\n * ```\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component with visual hint\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(\n * \tgetSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n * )\n * ```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n *\n * @param propsHint - An optional array of prop names used for the sole purpose\n * of having a visual hint of which props are made available to the slice,\n * this parameters doesn't have any effect\n *\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<\n\t\t\tSliceComponentProps<TSlice, TContext>[\"context\"]\n\t\t>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,QAAQ;EACP,MAAM;EACN,UAAU;EACV;CACD,SAAS;EACR,MAAM;EAGN,UAAU;EACV;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/SliceZone/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAEyC;;;KAOpC,gBAA4D,CAAA,eAA5B,SAA4B,CAAA,GAAf,MAAe,SAAA,eAAA,GAC9D,MAD8D,CAAA,YAAA,CAAA,GAE9D,MAF8D,SAE/C,gBAF+C,GAG7D,MAH6D,CAAA,MAAA,CAAA,GAAA,KAAA;;;;;;AAYjE;AACO,KADK,eACL,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAD2D,IAC3D,CAAN,KAAM,CAAA,UAAA,CAAA,EAAA,IAAA,GAAA,YAAA,CAAA;;;;AAUP;AAaA;;AACG,KAdS,gBAcT,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAAA;EACiB,IAAA,EAdb,KAca,CAdP,UAcO,CAAA,CAAA,YAAA,CAAA;CAAjB;;AAoBH;;;;;AAWA;;;AAKQ,KAtCI,SAsCJ,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAAA,CArCL,eAqCK,CArCW,UAqCX,CAAA,GApCL,gBAoCK,CApCY,UAoCZ,CAAA,CAAA,GAAA;EAWN;;;;;;EAOgB,QAAA,CAAA,EAAA,IAAA;AASlB,CAAA;;;;;;;AAaA;;;AAciC,KAtErB,aAsEqB,CAAA,eAtEQ,SAsER,GAtEoB,SAsEpB,CAAA,GAAA,SArEvB,MAqEuB,EAAA;;;;;;;;;AAIT,KA/DZ,mBA+DY,CAAA,eA9DR,SA8DQ,GA9DI,SA8DJ,EAAA,WAAA,OAAA,CAAA,GAAA;EAAhB;EACH,KAAA,EA3DG,MA2DH;EAJA;EAAkB,KAAA,EAAA,MAAA;;UA7Cd,cACP,eAAe,mBAAmB,mBAAmB;;;;;WAO7C;;;;;;;;KASE,kCAEI,uCAEZ,UAAU,oBAAoB,QAAQ;;;;;;;;KAS9B,mCACI,YAAY,iDAaZ,iBAAiB,UAC5B,mBACA,QAAQ,QAAQ,UAAU,4BACvB,YACA,QAAQ,QAAQ,UAAU,aAC7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region rolldown:runtime
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var
|
|
3
|
+
var __exportAll = (all, symbols) => {
|
|
4
4
|
let target = {};
|
|
5
5
|
for (var name in all) {
|
|
6
6
|
__defProp(target, name, {
|
|
@@ -16,4 +16,4 @@ var __export = (all, symbols) => {
|
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
18
|
|
|
19
|
-
exports.
|
|
19
|
+
exports.__exportAll = __exportAll;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region rolldown:runtime
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var
|
|
3
|
+
var __exportAll = (all, symbols) => {
|
|
4
4
|
let target = {};
|
|
5
5
|
for (var name in all) {
|
|
6
6
|
__defProp(target, name, {
|
|
@@ -15,4 +15,4 @@ var __export = (all, symbols) => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
18
|
-
export {
|
|
18
|
+
export { __exportAll };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPrismic.cjs","names":[],"sources":["../src/createPrismic.ts"],"sourcesContent":["import type { CreateClient, LinkResolverFunction } from \"@prismicio/client\"\nimport { isFilled } from \"@prismicio/client\"\nimport type { App, InjectionKey } from \"vue\"\nimport { inject } from \"vue\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport type { RichTextComponents } from \"./PrismicRichText\"\nimport type { TableComponents } from \"./PrismicTable\"\n\nconst prismicKey = Symbol.for(\n\t\"@prismicio/vue/plugin\",\n) as InjectionKey<PrismicPlugin>\n\n/** Components configuration. */\ntype ComponentsConfig = {\n\t/** The default component rendered for internal URLs. */\n\tlinkInternalComponent?: ComponentOrTagName\n\n\t/** The default component rendered for external URLs. */\n\tlinkExternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The default components or shorthand definitions for rich text and table\n\t * components.\n\t *\n\t * @see {@link https://prismic.io/docs/fields/rich-text}\n\t * @see {@link https://prismic.io/docs/fields/table}\n\t */\n\trichTextComponents?: RichTextComponents & TableComponents\n}\n\n/** Prismic Vue plugin configuration. */\nexport type PrismicPluginConfig = {\n\t/** A Prismic client instance to inject into the Vue app. */\n\tclient: ReturnType<CreateClient>\n\n\t/**\n\t * A default link resolver used to resolve links when route resolvers cannot be used.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/** Components configuration. */\n\tcomponents?: ComponentsConfig\n}\n\n/**\n * Prismic Vue plugin interface accessible through `usePrismic()` and\n * `$prismic`.\n */\nexport type PrismicPlugin = {\n\t/** A Prismic client that can be used to query content from a repository. */\n\tclient: ReturnType<CreateClient>\n\n\t/** Helpers to determine if a field is filled. */\n\tisFilled: typeof isFilled\n\n\t/**\n\t * The default link resolver used to resolve links when route resolvers cannot be used.\n\t *\n\t * @see {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/** @internal */\n\treadonly components: ComponentsConfig\n\n\t/** @internal */\n\tinstall: (app: App) => void\n}\n\n/** Creates a Prismic Vue plugin instance that can be used by a Vue app. */\nexport const createPrismic = (config: PrismicPluginConfig): PrismicPlugin => {\n\treturn {\n\t\t...config,\n\t\tcomponents: config.components || {},\n\t\tisFilled,\n\t\tinstall(app: App): void {\n\t\t\tapp.provide(prismicKey, this)\n\t\t\tapp.config.globalProperties.$prismic = this\n\t\t},\n\t}\n}\n\n/**\n * Access the Prismic Vue plugin interface.\n *\n * @example\n *\n * ```typescript\n * const { client, isFilled } = usePrismic()\n * ```\n */\nexport const usePrismic = (): PrismicPlugin => {\n\treturn inject(prismicKey, { components: {} } as PrismicPlugin)\n}\n\ndeclare module \"vue\" {\n\texport interface ComponentCustomProperties {\n\t\t/** The Prismic Vue plugin interface. */\n\t\t$prismic: PrismicPlugin\n\t}\n}\n"],"mappings":";;;;AAUA,MAAM,aAAa,OAAO,IACzB,wBACA;;AA8DD,MAAa,iBAAiB,WAA+C;AAC5E,QAAO;EACN,GAAG;EACH,YAAY,OAAO,cAAc,EAAE;EACnC;EACA,QAAQ,KAAgB;AACvB,OAAI,QAAQ,YAAY,KAAK;AAC7B,OAAI,OAAO,iBAAiB,WAAW;;EAExC;;;;;;;;;;;AAYF,MAAa,mBAAkC;AAC9C,wBAAc,YAAY,EAAE,YAAY,EAAE,EAAE,CAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPrismic.d.ts","names":[],"sources":["../src/createPrismic.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAeK,gBAAA;;EAAA,qBAAgB,CAAA,EAEI,kBAFJ;EAEI;EAGA,qBAAA,CAAA,EAAA,kBAAA;EASH;;;AAItB;;;;EAYc,kBAAA,CAAA,EAhBQ,kBAgBR,GAhB6B,eAgB7B;CAAgB;AAO9B;AAEoB,KArBR,mBAAA,GAqBQ;EAAX;EAGS,MAAA,EAtBT,UAsBS,CAtBE,YAsBF,CAAA;EAOF;;;;AAUhB;EAqBa,YAAA,CAEZ,EAvDe,oBAqDc;EAE7B;EAAA,UAAA,CAAA,EApDa,gBAoDb;;;;;;KA7CW,aAAA;;UAEH,WAAW;;mBAGF;;;;;;iBAOF;;uBAGM;;iBAGN;;;cAIH,wBAAyB,wBAAsB;;;;;;;;;;cAqB/C,kBAAiB;;;;cAOlB"}
|