@prismicio/vue 5.2.1 → 5.3.0-canary.5d9ea4c
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/README.md +3 -15
- package/dist/PrismicEmbed.vue.d.cts +25 -0
- package/dist/PrismicEmbed.vue.d.cts.map +1 -0
- package/dist/PrismicImage.vue.d.cts +301 -0
- package/dist/PrismicImage.vue.d.cts.map +1 -0
- package/dist/PrismicLink.vue.d.cts +282 -0
- package/dist/PrismicLink.vue.d.cts.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +102 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts +54 -0
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts.map +1 -0
- package/dist/PrismicRichText/types.d.cts +27 -0
- package/dist/PrismicRichText/types.d.cts.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue.d.cts +38 -0
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -0
- package/dist/PrismicTable/getTableComponentProps.d.cts +136 -0
- package/dist/PrismicTable/getTableComponentProps.d.cts.map +1 -0
- package/dist/PrismicTable/types.d.cts +35 -0
- package/dist/PrismicTable/types.d.cts.map +1 -0
- package/dist/PrismicText.vue.d.cts +37 -0
- package/dist/PrismicText.vue.d.cts.map +1 -0
- package/dist/SliceZone/SliceZone.vue.d.cts +48 -0
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.d.cts +15 -0
- package/dist/SliceZone/TODOSliceComponent.d.cts.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.d.cts +42 -0
- package/dist/SliceZone/defineSliceZoneComponents.d.cts.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.d.cts +71 -0
- package/dist/SliceZone/getSliceComponentProps.d.cts.map +1 -0
- package/dist/SliceZone/types.d.cts +100 -0
- package/dist/SliceZone/types.d.cts.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +19 -0
- package/dist/_virtual/rolldown_runtime.js +18 -0
- package/dist/createPrismic.d.cts +29 -0
- package/dist/createPrismic.d.cts.map +1 -0
- package/dist/index.cjs +35 -32
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +21 -23
- package/dist/index.js +16 -32
- package/dist/package.cjs +12 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.js +6 -0
- package/dist/package.js.map +1 -0
- package/dist/src/PrismicEmbed.cjs +8 -0
- package/dist/src/PrismicEmbed.cjs.map +1 -0
- package/dist/src/PrismicEmbed.js +8 -0
- package/dist/src/PrismicEmbed.js.map +1 -0
- package/dist/src/PrismicEmbed.vue.d.ts +25 -0
- package/dist/src/PrismicEmbed.vue.d.ts.map +1 -0
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs +42 -0
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicImage.cjs +8 -0
- package/dist/src/PrismicImage.cjs.map +1 -0
- package/dist/src/PrismicImage.js +8 -0
- package/dist/src/PrismicImage.js.map +1 -0
- package/dist/src/PrismicImage.vue.d.ts +301 -0
- package/dist/src/PrismicImage.vue.d.ts.map +1 -0
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +117 -0
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicLink.cjs +8 -0
- package/dist/src/PrismicLink.cjs.map +1 -0
- package/dist/src/PrismicLink.js +8 -0
- package/dist/src/PrismicLink.js.map +1 -0
- package/dist/src/PrismicLink.vue.d.ts +282 -0
- package/dist/src/PrismicLink.vue.d.ts.map +1 -0
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +86 -0
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs +8 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs.map +1 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js +8 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js.map +1 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs +92 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichText.cjs +8 -0
- package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichText.js +8 -0
- package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +102 -0
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +88 -0
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs +8 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js +8 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +103 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs +8 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.js +8 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +60 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicRichText/getRichTextComponentProps.cjs +40 -0
- package/dist/src/PrismicRichText/getRichTextComponentProps.cjs.map +1 -0
- package/dist/{PrismicRichText → src/PrismicRichText}/getRichTextComponentProps.d.ts +15 -10
- package/dist/src/PrismicRichText/getRichTextComponentProps.d.ts.map +1 -0
- package/dist/src/PrismicRichText/getRichTextComponentProps.js +39 -0
- package/dist/src/PrismicRichText/getRichTextComponentProps.js.map +1 -0
- package/dist/src/PrismicRichText/index.d.ts +2 -0
- package/dist/{PrismicRichText → src/PrismicRichText}/types.d.ts +11 -6
- package/dist/src/PrismicRichText/types.d.ts.map +1 -0
- package/dist/src/PrismicTable/PrismicTable.cjs +8 -0
- package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -0
- package/dist/src/PrismicTable/PrismicTable.js +8 -0
- package/dist/src/PrismicTable/PrismicTable.js.map +1 -0
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts +39 -0
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -0
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +65 -0
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +46 -0
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -0
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +46 -0
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -0
- package/dist/src/PrismicTable/PrismicTableRow.cjs +8 -0
- package/dist/src/PrismicTable/PrismicTableRow.cjs.map +1 -0
- package/dist/src/PrismicTable/PrismicTableRow.js +8 -0
- package/dist/src/PrismicTable/PrismicTableRow.js.map +1 -0
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +51 -0
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicTable/getTableComponentProps.cjs +140 -0
- package/dist/src/PrismicTable/getTableComponentProps.cjs.map +1 -0
- package/dist/{PrismicTable → src/PrismicTable}/getTableComponentProps.d.ts +40 -32
- package/dist/src/PrismicTable/getTableComponentProps.d.ts.map +1 -0
- package/dist/src/PrismicTable/getTableComponentProps.js +129 -0
- package/dist/src/PrismicTable/getTableComponentProps.js.map +1 -0
- package/dist/src/PrismicTable/index.d.ts +1 -0
- package/dist/src/PrismicTable/types.d.ts +35 -0
- package/dist/src/PrismicTable/types.d.ts.map +1 -0
- package/dist/src/PrismicText.cjs +8 -0
- package/dist/src/PrismicText.cjs.map +1 -0
- package/dist/src/PrismicText.js +8 -0
- package/dist/src/PrismicText.js.map +1 -0
- package/dist/src/PrismicText.vue.d.ts +37 -0
- package/dist/src/PrismicText.vue.d.ts.map +1 -0
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +48 -0
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/SliceZone/SliceZone.cjs +8 -0
- package/dist/src/SliceZone/SliceZone.cjs.map +1 -0
- package/dist/src/SliceZone/SliceZone.js +8 -0
- package/dist/src/SliceZone/SliceZone.js.map +1 -0
- package/dist/src/SliceZone/SliceZone.vue.d.ts +48 -0
- package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -0
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +82 -0
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/SliceZone/TODOSliceComponent.cjs +36 -0
- package/dist/src/SliceZone/TODOSliceComponent.cjs.map +1 -0
- package/dist/src/SliceZone/TODOSliceComponent.d.ts +15 -0
- package/dist/src/SliceZone/TODOSliceComponent.d.ts.map +1 -0
- package/dist/src/SliceZone/TODOSliceComponent.js +36 -0
- package/dist/src/SliceZone/TODOSliceComponent.js.map +1 -0
- package/dist/src/SliceZone/defineSliceZoneComponents.cjs +50 -0
- package/dist/src/SliceZone/defineSliceZoneComponents.cjs.map +1 -0
- package/dist/{SliceZone → src/SliceZone}/defineSliceZoneComponents.d.ts +8 -2
- package/dist/src/SliceZone/defineSliceZoneComponents.d.ts.map +1 -0
- package/dist/src/SliceZone/defineSliceZoneComponents.js +50 -0
- package/dist/src/SliceZone/defineSliceZoneComponents.js.map +1 -0
- package/dist/src/SliceZone/getSliceComponentProps.cjs +60 -0
- package/dist/src/SliceZone/getSliceComponentProps.cjs.map +1 -0
- package/dist/{SliceZone → src/SliceZone}/getSliceComponentProps.d.ts +25 -20
- package/dist/src/SliceZone/getSliceComponentProps.d.ts.map +1 -0
- package/dist/src/SliceZone/getSliceComponentProps.js +59 -0
- package/dist/src/SliceZone/getSliceComponentProps.js.map +1 -0
- package/dist/src/SliceZone/index.d.ts +4 -0
- package/dist/{SliceZone → src/SliceZone}/types.d.ts +40 -37
- package/dist/src/SliceZone/types.d.ts.map +1 -0
- package/dist/src/createPrismic.cjs +85 -0
- package/dist/src/createPrismic.cjs.map +1 -0
- package/dist/src/createPrismic.d.ts +29 -0
- package/dist/src/createPrismic.d.ts.map +1 -0
- package/dist/src/createPrismic.js +85 -0
- package/dist/src/createPrismic.js.map +1 -0
- package/dist/src/lib/Wrapper.cjs +8 -0
- package/dist/src/lib/Wrapper.cjs.map +1 -0
- package/dist/src/lib/Wrapper.js +8 -0
- package/dist/src/lib/Wrapper.js.map +1 -0
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs +22 -0
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/lib/devMsg.cjs +25 -0
- package/dist/src/lib/devMsg.cjs.map +1 -0
- package/dist/src/lib/devMsg.js +25 -0
- package/dist/src/lib/devMsg.js.map +1 -0
- package/dist/src/lib/isInternalURL.cjs +24 -0
- package/dist/src/lib/isInternalURL.cjs.map +1 -0
- package/dist/src/lib/isInternalURL.js +23 -0
- package/dist/src/lib/isInternalURL.js.map +1 -0
- package/dist/src/types.d.ts +357 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/usePrismic.cjs +38 -0
- package/dist/src/usePrismic.cjs.map +1 -0
- package/dist/{usePrismic.d.ts → src/usePrismic.d.ts} +10 -4
- package/dist/src/usePrismic.d.ts.map +1 -0
- package/dist/src/usePrismic.js +37 -0
- package/dist/src/usePrismic.js.map +1 -0
- package/dist/types.d.cts +357 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/usePrismic.d.cts +36 -0
- package/dist/usePrismic.d.cts.map +1 -0
- package/package.json +29 -53
- package/src/PrismicImage.vue +54 -1
- package/src/SliceZone/TODOSliceComponent.ts +2 -1
- package/src/index.ts +7 -17
- package/dist/PrismicEmbed.vue.cjs +0 -25
- package/dist/PrismicEmbed.vue.cjs.map +0 -1
- package/dist/PrismicEmbed.vue.d.ts +0 -19
- package/dist/PrismicEmbed.vue.js +0 -26
- package/dist/PrismicEmbed.vue.js.map +0 -1
- package/dist/PrismicEmbed.vue2.cjs +0 -4
- package/dist/PrismicEmbed.vue2.cjs.map +0 -1
- package/dist/PrismicEmbed.vue2.js +0 -5
- package/dist/PrismicEmbed.vue2.js.map +0 -1
- package/dist/PrismicImage.vue.cjs +0 -84
- package/dist/PrismicImage.vue.cjs.map +0 -1
- package/dist/PrismicImage.vue.d.ts +0 -224
- package/dist/PrismicImage.vue.js +0 -85
- package/dist/PrismicImage.vue.js.map +0 -1
- package/dist/PrismicImage.vue2.cjs +0 -4
- package/dist/PrismicImage.vue2.cjs.map +0 -1
- package/dist/PrismicImage.vue2.js +0 -5
- package/dist/PrismicImage.vue2.js.map +0 -1
- package/dist/PrismicLink.vue.cjs +0 -64
- package/dist/PrismicLink.vue.cjs.map +0 -1
- package/dist/PrismicLink.vue.d.ts +0 -279
- package/dist/PrismicLink.vue.js +0 -65
- package/dist/PrismicLink.vue.js.map +0 -1
- package/dist/PrismicLink.vue2.cjs +0 -4
- package/dist/PrismicLink.vue2.cjs.map +0 -1
- package/dist/PrismicLink.vue2.js +0 -5
- package/dist/PrismicLink.vue2.js.map +0 -1
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs +0 -100
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs.map +0 -1
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.d.ts +0 -38
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js +0 -101
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js.map +0 -1
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.cjs +0 -4
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.cjs.map +0 -1
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.js +0 -5
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.js.map +0 -1
- package/dist/PrismicRichText/PrismicRichText.vue.cjs +0 -97
- package/dist/PrismicRichText/PrismicRichText.vue.cjs.map +0 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts +0 -96
- package/dist/PrismicRichText/PrismicRichText.vue.js +0 -98
- package/dist/PrismicRichText/PrismicRichText.vue.js.map +0 -1
- package/dist/PrismicRichText/PrismicRichText.vue2.cjs +0 -4
- package/dist/PrismicRichText/PrismicRichText.vue2.cjs.map +0 -1
- package/dist/PrismicRichText/PrismicRichText.vue2.js +0 -5
- package/dist/PrismicRichText/PrismicRichText.vue2.js.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.cjs +0 -133
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.cjs.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.d.ts +0 -37
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.js +0 -134
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.js.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.cjs +0 -4
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.cjs.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.js +0 -5
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.js.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.cjs +0 -47
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.cjs.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.d.ts +0 -10
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.js +0 -48
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.js.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.cjs +0 -4
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.cjs.map +0 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.js +0 -5
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.js.map +0 -1
- package/dist/PrismicRichText/getRichTextComponentProps.cjs +0 -10
- package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +0 -1
- package/dist/PrismicRichText/getRichTextComponentProps.js +0 -10
- package/dist/PrismicRichText/getRichTextComponentProps.js.map +0 -1
- package/dist/PrismicRichText/index.d.ts +0 -2
- package/dist/PrismicTable/PrismicTable.vue.cjs +0 -62
- package/dist/PrismicTable/PrismicTable.vue.cjs.map +0 -1
- package/dist/PrismicTable/PrismicTable.vue.d.ts +0 -32
- package/dist/PrismicTable/PrismicTable.vue.js +0 -63
- package/dist/PrismicTable/PrismicTable.vue.js.map +0 -1
- package/dist/PrismicTable/PrismicTable.vue2.cjs +0 -4
- package/dist/PrismicTable/PrismicTable.vue2.cjs.map +0 -1
- package/dist/PrismicTable/PrismicTable.vue2.js +0 -5
- package/dist/PrismicTable/PrismicTable.vue2.js.map +0 -1
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs +0 -44
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +0 -1
- package/dist/PrismicTable/PrismicTableDefaultComponents.d.ts +0 -2
- package/dist/PrismicTable/PrismicTableDefaultComponents.js +0 -44
- package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +0 -1
- package/dist/PrismicTable/PrismicTableRow.vue.cjs +0 -52
- package/dist/PrismicTable/PrismicTableRow.vue.cjs.map +0 -1
- package/dist/PrismicTable/PrismicTableRow.vue.d.ts +0 -26
- package/dist/PrismicTable/PrismicTableRow.vue.js +0 -53
- package/dist/PrismicTable/PrismicTableRow.vue.js.map +0 -1
- package/dist/PrismicTable/PrismicTableRow.vue2.cjs +0 -4
- package/dist/PrismicTable/PrismicTableRow.vue2.cjs.map +0 -1
- package/dist/PrismicTable/PrismicTableRow.vue2.js +0 -5
- package/dist/PrismicTable/PrismicTableRow.vue2.js.map +0 -1
- package/dist/PrismicTable/getTableComponentProps.cjs +0 -30
- package/dist/PrismicTable/getTableComponentProps.cjs.map +0 -1
- package/dist/PrismicTable/getTableComponentProps.js +0 -30
- package/dist/PrismicTable/getTableComponentProps.js.map +0 -1
- package/dist/PrismicTable/index.d.ts +0 -1
- package/dist/PrismicTable/types.d.ts +0 -30
- package/dist/PrismicText.vue.cjs +0 -43
- package/dist/PrismicText.vue.cjs.map +0 -1
- package/dist/PrismicText.vue.d.ts +0 -31
- package/dist/PrismicText.vue.js +0 -44
- package/dist/PrismicText.vue.js.map +0 -1
- package/dist/PrismicText.vue2.cjs +0 -4
- package/dist/PrismicText.vue2.cjs.map +0 -1
- package/dist/PrismicText.vue2.js +0 -5
- package/dist/PrismicText.vue2.js.map +0 -1
- package/dist/SliceZone/SliceZone.vue.cjs +0 -63
- package/dist/SliceZone/SliceZone.vue.cjs.map +0 -1
- package/dist/SliceZone/SliceZone.vue.d.ts +0 -41
- package/dist/SliceZone/SliceZone.vue.js +0 -64
- package/dist/SliceZone/SliceZone.vue.js.map +0 -1
- package/dist/SliceZone/SliceZone.vue2.cjs +0 -4
- package/dist/SliceZone/SliceZone.vue2.cjs.map +0 -1
- package/dist/SliceZone/SliceZone.vue2.js +0 -5
- package/dist/SliceZone/SliceZone.vue2.js.map +0 -1
- package/dist/SliceZone/TODOSliceComponent.cjs +0 -29
- package/dist/SliceZone/TODOSliceComponent.cjs.map +0 -1
- package/dist/SliceZone/TODOSliceComponent.d.ts +0 -9
- package/dist/SliceZone/TODOSliceComponent.js +0 -29
- package/dist/SliceZone/TODOSliceComponent.js.map +0 -1
- package/dist/SliceZone/defineSliceZoneComponents.cjs +0 -14
- package/dist/SliceZone/defineSliceZoneComponents.cjs.map +0 -1
- package/dist/SliceZone/defineSliceZoneComponents.js +0 -14
- package/dist/SliceZone/defineSliceZoneComponents.js.map +0 -1
- package/dist/SliceZone/getSliceComponentProps.cjs +0 -22
- package/dist/SliceZone/getSliceComponentProps.cjs.map +0 -1
- package/dist/SliceZone/getSliceComponentProps.js +0 -22
- package/dist/SliceZone/getSliceComponentProps.js.map +0 -1
- package/dist/SliceZone/index.d.ts +0 -4
- package/dist/createPrismic.cjs +0 -81
- package/dist/createPrismic.cjs.map +0 -1
- package/dist/createPrismic.d.ts +0 -22
- package/dist/createPrismic.js +0 -81
- package/dist/createPrismic.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/Wrapper.vue.cjs +0 -20
- package/dist/lib/Wrapper.vue.cjs.map +0 -1
- package/dist/lib/Wrapper.vue.d.ts +0 -28
- package/dist/lib/Wrapper.vue.js +0 -21
- package/dist/lib/Wrapper.vue.js.map +0 -1
- package/dist/lib/Wrapper.vue2.cjs +0 -4
- package/dist/lib/Wrapper.vue2.cjs.map +0 -1
- package/dist/lib/Wrapper.vue2.js +0 -5
- package/dist/lib/Wrapper.vue2.js.map +0 -1
- package/dist/lib/devMsg.cjs +0 -8
- package/dist/lib/devMsg.cjs.map +0 -1
- package/dist/lib/devMsg.d.ts +0 -16
- package/dist/lib/devMsg.js +0 -8
- package/dist/lib/devMsg.js.map +0 -1
- package/dist/lib/isInternalURL.cjs +0 -9
- package/dist/lib/isInternalURL.cjs.map +0 -1
- package/dist/lib/isInternalURL.d.ts +0 -8
- package/dist/lib/isInternalURL.js +0 -9
- package/dist/lib/isInternalURL.js.map +0 -1
- package/dist/package.json.cjs +0 -5
- package/dist/package.json.cjs.map +0 -1
- package/dist/package.json.js +0 -5
- package/dist/package.json.js.map +0 -1
- package/dist/types.d.ts +0 -369
- package/dist/usePrismic.cjs +0 -10
- package/dist/usePrismic.cjs.map +0 -1
- package/dist/usePrismic.js +0 -10
- package/dist/usePrismic.js.map +0 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { __export } from "../../_virtual/rolldown_runtime.js";
|
|
2
|
+
|
|
3
|
+
//#region src/PrismicTable/getTableComponentProps.ts
|
|
4
|
+
var getTableComponentProps_exports = /* @__PURE__ */ __export({
|
|
5
|
+
table: () => table,
|
|
6
|
+
tbody: () => tbody,
|
|
7
|
+
td: () => td,
|
|
8
|
+
th: () => th,
|
|
9
|
+
thead: () => thead,
|
|
10
|
+
tr: () => tr
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Gets native Vue props for a component rendering `table` elements from a
|
|
14
|
+
* Prismic table field with `<PrismicTable />`.
|
|
15
|
+
*
|
|
16
|
+
* Props are: `["table"]`
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Defining a new rich text component
|
|
22
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
23
|
+
*
|
|
24
|
+
* defineProps(getTableComponentProps.table())
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
const table = () => ({ table: {
|
|
28
|
+
type: Object,
|
|
29
|
+
required: true
|
|
30
|
+
} });
|
|
31
|
+
/**
|
|
32
|
+
* Gets native Vue props for a component rendering `thead` elements from a
|
|
33
|
+
* Prismic table field with `<PrismicTable />`.
|
|
34
|
+
*
|
|
35
|
+
* Props are: `["head"]`
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
*
|
|
39
|
+
* ```javascript
|
|
40
|
+
* // Defining a new rich text component
|
|
41
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
42
|
+
*
|
|
43
|
+
* defineProps(getTableComponentProps.thead())
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
const thead = () => ({ head: {
|
|
47
|
+
type: Object,
|
|
48
|
+
required: true
|
|
49
|
+
} });
|
|
50
|
+
/**
|
|
51
|
+
* Gets native Vue props for a component rendering `tbody` elements from a
|
|
52
|
+
* Prismic table field with `<PrismicTable />`.
|
|
53
|
+
*
|
|
54
|
+
* Props are: `["body"]`
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
*
|
|
58
|
+
* ```javascript
|
|
59
|
+
* // Defining a new rich text component
|
|
60
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
61
|
+
*
|
|
62
|
+
* defineProps(getTableComponentProps.body())
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
const tbody = () => ({ body: {
|
|
66
|
+
type: Object,
|
|
67
|
+
required: true
|
|
68
|
+
} });
|
|
69
|
+
/**
|
|
70
|
+
* Gets native Vue props for a component rendering `tr` elements from a Prismic
|
|
71
|
+
* table field with `<PrismicTable />`.
|
|
72
|
+
*
|
|
73
|
+
* Props are: `["row"]`
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
*
|
|
77
|
+
* ```javascript
|
|
78
|
+
* // Defining a new rich text component
|
|
79
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
80
|
+
*
|
|
81
|
+
* defineProps(getTableComponentProps.tr())
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
const tr = () => ({ row: {
|
|
85
|
+
type: Object,
|
|
86
|
+
required: true
|
|
87
|
+
} });
|
|
88
|
+
/**
|
|
89
|
+
* Gets native Vue props for a component rendering `th` elements from a Prismic
|
|
90
|
+
* table field with `<PrismicTable />`.
|
|
91
|
+
*
|
|
92
|
+
* Props are: `["cell"]`
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
*
|
|
96
|
+
* ```javascript
|
|
97
|
+
* // Defining a new rich text component
|
|
98
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
99
|
+
*
|
|
100
|
+
* defineProps(getTableComponentProps.th())
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
const th = () => ({ cell: {
|
|
104
|
+
type: Object,
|
|
105
|
+
required: true
|
|
106
|
+
} });
|
|
107
|
+
/**
|
|
108
|
+
* Gets native Vue props for a component rendering `td` elements from a Prismic
|
|
109
|
+
* table field with `<PrismicTable />`.
|
|
110
|
+
*
|
|
111
|
+
* Props are: `["cell"]`
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
*
|
|
115
|
+
* ```javascript
|
|
116
|
+
* // Defining a new rich text component
|
|
117
|
+
* import { getTableComponentProps } from "@prismicio/vue"
|
|
118
|
+
*
|
|
119
|
+
* defineProps(getTableComponentProps.td())
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
const td = () => ({ cell: {
|
|
123
|
+
type: Object,
|
|
124
|
+
required: true
|
|
125
|
+
} });
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
export { getTableComponentProps_exports, table, tbody, td, th, thead, tr };
|
|
129
|
+
//# sourceMappingURL=getTableComponentProps.js.map
|
|
@@ -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
|
+
import { getTableComponentProps_d_exports } from "./getTableComponentProps.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { DefineComponent, FunctionalComponent, defineAsyncComponent } from "vue";
|
|
2
|
+
import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, TableFieldHead, TableFieldHeadRow, TableFieldHeaderCell } from "@prismicio/client";
|
|
3
|
+
|
|
4
|
+
//#region src/PrismicTable/types.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A map of Table block types to Vue Components. It is used to render table
|
|
8
|
+
* fields.
|
|
9
|
+
*
|
|
10
|
+
* @see Templating Table fields from Prismic {@link https://prismic.io/docs/table}
|
|
11
|
+
*/
|
|
12
|
+
type VueTableComponents = {
|
|
13
|
+
table?: VueComponent<{
|
|
14
|
+
table: TableField<"filled">;
|
|
15
|
+
}>;
|
|
16
|
+
thead?: VueComponent<{
|
|
17
|
+
head: TableFieldHead;
|
|
18
|
+
}>;
|
|
19
|
+
tbody?: VueComponent<{
|
|
20
|
+
body: TableFieldBody;
|
|
21
|
+
}>;
|
|
22
|
+
tr?: VueComponent<{
|
|
23
|
+
row: TableFieldBodyRow | TableFieldHeadRow;
|
|
24
|
+
}>;
|
|
25
|
+
th?: VueComponent<{
|
|
26
|
+
cell: TableFieldHeaderCell;
|
|
27
|
+
}>;
|
|
28
|
+
td?: VueComponent<{
|
|
29
|
+
cell: TableFieldDataCell;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
type VueComponent<TProps> = ReturnType<typeof defineAsyncComponent> | DefineComponent<TProps> | FunctionalComponent<TProps>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { VueTableComponents };
|
|
35
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAqBA;;;;AAES,KAFG,kBAAA,GAEH;EACqB,KAAA,CAAA,EAFrB,YAEqB,CAAA;IAArB,KAAA,EAFsB,UAEtB,CAAA,QAAA,CAAA;EACiB,CAAA,CAAA;EAAoB,KAAA,CAAA,EAFrC,YAEqC,CAAA;IAAxC,IAAA,EAFwB,cAExB;EACqB,CAAA,CAAA;EAArB,KAAA,CAAA,EAFG,YAEH,CAAA;IACqB,IAAA,EAHG,cAGH;EAArB,CAAA,CAAA;EAAY,EAAA,CAAA,EAFZ,YAEY,CAAA;IAGb,GAAA,EALqB,iBAKT,GAL6B,iBAK7B;EACI,CAAA,CAAA;EAAlB,EAAA,CAAA,EALG,YAKH,CAAA;IACgB,IAAA,EANQ,oBAMR;EAAhB,CAAA,CAAA;EACoB,EAAA,CAAA,EANjB,YAMiB,CAAA;IAApB,IAAA,EANwB,kBAMxB;EAAmB,CAAA,CAAA;;KAHjB,uBACF,kBAAkB,wBAClB,gBAAgB,UAChB,oBAAoB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const require_PrismicText_vue_vue_type_script_setup_true_lang = require('./PrismicText.vue_vue_type_script_setup_true_lang.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/PrismicText.vue
|
|
4
|
+
var PrismicText_default = require_PrismicText_vue_vue_type_script_setup_true_lang.default;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.default = PrismicText_default;
|
|
8
|
+
//# sourceMappingURL=PrismicText.cjs.map
|
|
@@ -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, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\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\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\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<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import PrismicText_vue_vue_type_script_setup_true_lang_default from "./PrismicText.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
|
|
3
|
+
//#region src/PrismicText.vue
|
|
4
|
+
var PrismicText_default = PrismicText_vue_vue_type_script_setup_true_lang_default;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { PrismicText_default as default };
|
|
8
|
+
//# sourceMappingURL=PrismicText.js.map
|
|
@@ -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, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\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\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\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<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ComponentOrTagName } from "./types.js";
|
|
2
|
+
import * as vue21 from "vue";
|
|
3
|
+
import { RichTextField } from "@prismicio/client";
|
|
4
|
+
|
|
5
|
+
//#region src/PrismicText.vue.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Props for `<PrismicText />`.
|
|
8
|
+
*/
|
|
9
|
+
type PrismicTextProps = {
|
|
10
|
+
/**
|
|
11
|
+
* The Prismic rich text field to render.
|
|
12
|
+
*/
|
|
13
|
+
field: RichTextField | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The string value to be rendered when the field is empty. If a fallback is
|
|
16
|
+
* not given, `""` (nothing) will be rendered.
|
|
17
|
+
*/
|
|
18
|
+
fallback?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The separator used between blocks.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue `" "` (a whitespace)
|
|
23
|
+
*/
|
|
24
|
+
separator?: string;
|
|
25
|
+
/**
|
|
26
|
+
* An HTML tag name or a component used to wrap the output. `<PrismicText />`
|
|
27
|
+
* is not wrapped by default.
|
|
28
|
+
*
|
|
29
|
+
* @defaultValue `"template"` (no wrapper)
|
|
30
|
+
*/
|
|
31
|
+
wrapper?: ComponentOrTagName;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_export: vue21.DefineComponent<PrismicTextProps, {}, {}, {}, {}, vue21.ComponentOptionsMixin, vue21.ComponentOptionsMixin, {}, string, vue21.PublicProps, Readonly<PrismicTextProps> & Readonly<{}>, {}, {}, {}, {}, string, vue21.ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { PrismicTextProps, _default };
|
|
37
|
+
//# sourceMappingURL=PrismicText.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;;;;AA8EY,KAAA,gBAAA,GAAgB;EAiFtB;;;EAAY,KAAA,EA7EV,aA6EU,GAAA,IAAA,GAAA,SAAA;EAAA;;;;EAAA,QAAA,CAAA,EAAA,MAAA;EAAA;;AAAA;;;;;;;;;;YAxDP;;cAwDL,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,48 @@
|
|
|
1
|
+
const require_Wrapper = require('./lib/Wrapper.cjs');
|
|
2
|
+
const require_devMsg = require('./lib/devMsg.cjs');
|
|
3
|
+
let vue = require("vue");
|
|
4
|
+
let __prismicio_client = require("@prismicio/client");
|
|
5
|
+
let esm_env = require("esm-env");
|
|
6
|
+
|
|
7
|
+
//#region src/PrismicText.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var PrismicText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9
|
+
name: "PrismicText",
|
|
10
|
+
__name: "PrismicText",
|
|
11
|
+
props: {
|
|
12
|
+
field: {
|
|
13
|
+
type: null,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fallback: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
separator: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
wrapper: {
|
|
25
|
+
type: null,
|
|
26
|
+
required: false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
if (esm_env.DEV) (0, vue.watchEffect)(() => {
|
|
32
|
+
if (typeof props.field === "string") throw new Error(`[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 ${require_devMsg.devMsg("prismictext-works-only-with-rich-text-and-title-fields")}`);
|
|
33
|
+
}, {});
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return (0, vue.unref)(__prismicio_client.isFilled).richText(__props.field) || __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_Wrapper.default, {
|
|
36
|
+
key: 0,
|
|
37
|
+
wrapper: __props.wrapper
|
|
38
|
+
}, {
|
|
39
|
+
default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(__prismicio_client.asText)(__props.field) || __props.fallback), 1)]),
|
|
40
|
+
_: 1
|
|
41
|
+
}, 8, ["wrapper"])) : (0, vue.createCommentVNode)("v-if", true);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.default = PrismicText_vue_vue_type_script_setup_true_lang_default;
|
|
48
|
+
//# sourceMappingURL=PrismicText.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -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, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\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\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\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<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,sBACnR,yDACA,GACF;KAEC,EAAE,CAAA;;yBAKU,4BAAQ,CAAC,SAAS,QAAA,MAAK,IAAK,QAAA,uDAEjC,yBAAA;;IAF4C,SAAS,QAAA;;oCAC/B,kEAA5B,0BAAM,CAAC,QAAA,MAAK,IAAK,QAAA,SAAQ,EAAA,EAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Wrapper_default from "./lib/Wrapper.js";
|
|
2
|
+
import { devMsg } from "./lib/devMsg.js";
|
|
3
|
+
import { createBlock, createCommentVNode, createTextVNode, defineComponent, openBlock, toDisplayString, unref, watchEffect, withCtx } from "vue";
|
|
4
|
+
import { asText, isFilled } from "@prismicio/client";
|
|
5
|
+
import { DEV } from "esm-env";
|
|
6
|
+
|
|
7
|
+
//#region src/PrismicText.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var PrismicText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
9
|
+
name: "PrismicText",
|
|
10
|
+
__name: "PrismicText",
|
|
11
|
+
props: {
|
|
12
|
+
field: {
|
|
13
|
+
type: null,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
fallback: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
separator: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
wrapper: {
|
|
25
|
+
type: null,
|
|
26
|
+
required: false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
if (DEV) watchEffect(() => {
|
|
32
|
+
if (typeof props.field === "string") throw new Error(`[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("prismictext-works-only-with-rich-text-and-title-fields")}`);
|
|
33
|
+
}, {});
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return unref(isFilled).richText(__props.field) || __props.fallback ? (openBlock(), createBlock(Wrapper_default, {
|
|
36
|
+
key: 0,
|
|
37
|
+
wrapper: __props.wrapper
|
|
38
|
+
}, {
|
|
39
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(asText)(__props.field) || __props.fallback), 1)]),
|
|
40
|
+
_: 1
|
|
41
|
+
}, 8, ["wrapper"])) : createCommentVNode("v-if", true);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { PrismicText_vue_vue_type_script_setup_true_lang_default as default };
|
|
48
|
+
//# sourceMappingURL=PrismicText.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -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, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\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\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\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<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,OACnR,yDACA,GACF;KAEC,EAAE,CAAA;;UAKU,MAAA,SAAQ,CAAC,SAAS,QAAA,MAAK,IAAK,QAAA,yBAA3C,YAEU,iBAAA;;IAF4C,SAAS,QAAA;;2BAC/B,iCAA5B,MAAA,OAAM,CAAC,QAAA,MAAK,IAAK,QAAA,SAAQ,EAAA,EAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const require_SliceZone_vue_vue_type_script_setup_true_lang = require('./SliceZone.vue_vue_type_script_setup_true_lang.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/SliceZone.vue
|
|
4
|
+
var SliceZone_default = require_SliceZone_vue_vue_type_script_setup_true_lang.default;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.default = SliceZone_default;
|
|
8
|
+
//# sourceMappingURL=SliceZone.cjs.map
|
|
@@ -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 Wrapper from \"../lib/Wrapper.vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { usePrismic } from \"../usePrismic\"\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/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\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 * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<SliceZone />` is\n\t * not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst { options } = usePrismic()\n\nconst renderedSlices = computed(() => {\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 =\n\t\t\tprops.components?.[type] ||\n\t\t\tprops.defaultComponent ||\n\t\t\toptions.components?.sliceZoneDefaultComponent\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<Wrapper v-if=\"slices\" :wrapper=\"wrapper\">\n\t\t<component\n\t\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t\t:is=\"renderedSlice.is\"\n\t\t\t:key=\"renderedSlice.key\"\n\t\t\tv-bind=\"renderedSlice.props\"\n\t\t/>\n\t</Wrapper>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SliceZone_vue_vue_type_script_setup_true_lang_default from "./SliceZone.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/SliceZone.vue
|
|
4
|
+
var SliceZone_default = SliceZone_vue_vue_type_script_setup_true_lang_default;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { SliceZone_default as default };
|
|
8
|
+
//# sourceMappingURL=SliceZone.js.map
|
|
@@ -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 Wrapper from \"../lib/Wrapper.vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { usePrismic } from \"../usePrismic\"\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/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\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 * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<SliceZone />` is\n\t * not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst { options } = usePrismic()\n\nconst renderedSlices = computed(() => {\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 =\n\t\t\tprops.components?.[type] ||\n\t\t\tprops.defaultComponent ||\n\t\t\toptions.components?.sliceZoneDefaultComponent\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<Wrapper v-if=\"slices\" :wrapper=\"wrapper\">\n\t\t<component\n\t\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t\t:is=\"renderedSlice.is\"\n\t\t\t:key=\"renderedSlice.key\"\n\t\t\tv-bind=\"renderedSlice.props\"\n\t\t/>\n\t</Wrapper>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from "./types.js";
|
|
2
|
+
import { ComponentOrTagName } from "../types.js";
|
|
3
|
+
import * as vue31 from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/SliceZone/SliceZone.vue.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for `<SliceZone />`.
|
|
9
|
+
*
|
|
10
|
+
* @typeParam TContext - Arbitrary data made available to all Slice components
|
|
11
|
+
*/
|
|
12
|
+
type SliceZoneProps<TContext = unknown> = {
|
|
13
|
+
/**
|
|
14
|
+
* List of Slice data from the Slice Zone.
|
|
15
|
+
*/
|
|
16
|
+
slices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>;
|
|
17
|
+
/**
|
|
18
|
+
* A record mapping Slice types to Vue components.
|
|
19
|
+
*/
|
|
20
|
+
components?: SliceZoneComponents;
|
|
21
|
+
/**
|
|
22
|
+
* The Vue component rendered if a component mapping from the `components`
|
|
23
|
+
* prop cannot be found.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Components will be rendered using the {@link SliceComponentProps} interface.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}.
|
|
29
|
+
*/
|
|
30
|
+
defaultComponent?: SliceComponentType<any, TContext>;
|
|
31
|
+
/**
|
|
32
|
+
* Arbitrary data made available to all Slice components.
|
|
33
|
+
*/
|
|
34
|
+
context?: TContext;
|
|
35
|
+
/**
|
|
36
|
+
* An HTML tag name or a component used to wrap the output. `<SliceZone />` is
|
|
37
|
+
* not wrapped by default.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue `"template"` (no wrapper)
|
|
40
|
+
*/
|
|
41
|
+
wrapper?: ComponentOrTagName;
|
|
42
|
+
};
|
|
43
|
+
type __VLS_Props = SliceZoneProps;
|
|
44
|
+
declare const __VLS_export: vue31.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue31.ComponentOptionsMixin, vue31.ComponentOptionsMixin, {}, string, vue31.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue31.ComponentProvideOptions, false, {}, any>;
|
|
45
|
+
declare const _default: typeof __VLS_export;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { SliceZoneProps, _default };
|
|
48
|
+
//# sourceMappingURL=SliceZone.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceZone.vue.d.ts","names":[],"sources":["../../../src/SliceZone/SliceZone.vue"],"sourcesContent":[],"mappings":";;;;;;;;;AAwIA;;AAIoC,KAJxB,cAIwB,CAAA,WAAA,OAAA,CAAA,GAAA;EAAY;;;EAiBJ,MAAA,EAjBnC,aAiBmC,CAjBrB,SAiBqB,GAAA,CAjBR,SAiBQ,GAjBI,MAiBJ,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,CAAA;EAAxB;;;EAaS,UAAA,CAAA,EAzBf,mBAyBe;EAGxB;AAA4B;;;;;;;;EA6Ff,gBAAA,CAAA,EA7GE,kBA6GF,CAAA,GAAA,EA7G0B,QA6G1B,CAAA;EAAA;;AAAA;YAxGP;;;;;;;YAQA;;KAGN,WAAA,GAAc;cA6Fb,cAAY,KAAA,CAAA,gBAAA,6BAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,eAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const require_Wrapper = require('../lib/Wrapper.cjs');
|
|
2
|
+
const require_usePrismic = require('../usePrismic.cjs');
|
|
3
|
+
const require_TODOSliceComponent = require('./TODOSliceComponent.cjs');
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
|
|
6
|
+
//#region src/SliceZone/SliceZone.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
8
|
+
name: "SliceZone",
|
|
9
|
+
__name: "SliceZone",
|
|
10
|
+
props: {
|
|
11
|
+
slices: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
components: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
defaultComponent: {
|
|
20
|
+
type: [Object, Function],
|
|
21
|
+
required: false,
|
|
22
|
+
skipCheck: true
|
|
23
|
+
},
|
|
24
|
+
context: {
|
|
25
|
+
type: null,
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
wrapper: {
|
|
29
|
+
type: null,
|
|
30
|
+
required: false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
setup(__props) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const { options } = require_usePrismic.usePrismic();
|
|
36
|
+
const renderedSlices = (0, vue.computed)(() => {
|
|
37
|
+
return props.slices.map((slice, index) => {
|
|
38
|
+
const type = "slice_type" in slice ? slice.slice_type : slice.type;
|
|
39
|
+
const key = "id" in slice && typeof slice.id === "string" ? slice.id : `${index}-${JSON.stringify(slice)}`;
|
|
40
|
+
const is = props.components?.[type] || props.defaultComponent || options.components?.sliceZoneDefaultComponent;
|
|
41
|
+
if (!is) return {
|
|
42
|
+
is: require_TODOSliceComponent.TODOSliceComponent,
|
|
43
|
+
key,
|
|
44
|
+
props: { slice }
|
|
45
|
+
};
|
|
46
|
+
if (slice.__mapped) {
|
|
47
|
+
const { __mapped, ...mappedProps } = slice;
|
|
48
|
+
return {
|
|
49
|
+
is,
|
|
50
|
+
key,
|
|
51
|
+
props: mappedProps
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
is,
|
|
56
|
+
key,
|
|
57
|
+
props: {
|
|
58
|
+
slice,
|
|
59
|
+
index,
|
|
60
|
+
context: props.context,
|
|
61
|
+
slices: props.slices
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
return (_ctx, _cache) => {
|
|
67
|
+
return __props.slices ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_Wrapper.default, {
|
|
68
|
+
key: 0,
|
|
69
|
+
wrapper: __props.wrapper
|
|
70
|
+
}, {
|
|
71
|
+
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(renderedSlices.value, (renderedSlice) => {
|
|
72
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(renderedSlice.is), (0, vue.mergeProps)({ key: renderedSlice.key }, { ref_for: true }, renderedSlice.props), null, 16);
|
|
73
|
+
}), 128))]),
|
|
74
|
+
_: 1
|
|
75
|
+
}, 8, ["wrapper"])) : (0, vue.createCommentVNode)("v-if", true);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.default = SliceZone_vue_vue_type_script_setup_true_lang_default;
|
|
82
|
+
//# sourceMappingURL=SliceZone.vue_vue_type_script_setup_true_lang.cjs.map
|
|
@@ -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 Wrapper from \"../lib/Wrapper.vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { usePrismic } from \"../usePrismic\"\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/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\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 * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<SliceZone />` is\n\t * not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst { options } = usePrismic()\n\nconst renderedSlices = computed(() => {\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 =\n\t\t\tprops.components?.[type] ||\n\t\t\tprops.defaultComponent ||\n\t\t\toptions.components?.sliceZoneDefaultComponent\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<Wrapper v-if=\"slices\" :wrapper=\"wrapper\">\n\t\t<component\n\t\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t\t:is=\"renderedSlice.is\"\n\t\t\t:key=\"renderedSlice.key\"\n\t\t\tv-bind=\"renderedSlice.props\"\n\t\t/>\n\t</Wrapper>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DA,MAAM,QAAQ;EAGd,MAAM,EAAE,YAAY,+BAAW;EAE/B,MAAM,yCAAgC;AACrC,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,KACL,MAAM,aAAa,SACnB,MAAM,oBACN,QAAQ,YAAY;AAErB,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;;UAIe,QAAA,qDAOL,yBAAA;;IAPc,SAAS,QAAA;;oCAEQ,wDAItC,cAAA,0BAJuB,eAAA,QAAjB,kBAAa;wFACf,cAAc,GAAE,sBAGpB,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import Wrapper_default from "../lib/Wrapper.js";
|
|
2
|
+
import { usePrismic } from "../usePrismic.js";
|
|
3
|
+
import { TODOSliceComponent } from "./TODOSliceComponent.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, withCtx } from "vue";
|
|
5
|
+
|
|
6
|
+
//#region src/SliceZone/SliceZone.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "SliceZone",
|
|
9
|
+
__name: "SliceZone",
|
|
10
|
+
props: {
|
|
11
|
+
slices: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
components: {
|
|
16
|
+
type: null,
|
|
17
|
+
required: false
|
|
18
|
+
},
|
|
19
|
+
defaultComponent: {
|
|
20
|
+
type: [Object, Function],
|
|
21
|
+
required: false,
|
|
22
|
+
skipCheck: true
|
|
23
|
+
},
|
|
24
|
+
context: {
|
|
25
|
+
type: null,
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
wrapper: {
|
|
29
|
+
type: null,
|
|
30
|
+
required: false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
setup(__props) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const { options } = usePrismic();
|
|
36
|
+
const renderedSlices = computed(() => {
|
|
37
|
+
return props.slices.map((slice, index) => {
|
|
38
|
+
const type = "slice_type" in slice ? slice.slice_type : slice.type;
|
|
39
|
+
const key = "id" in slice && typeof slice.id === "string" ? slice.id : `${index}-${JSON.stringify(slice)}`;
|
|
40
|
+
const is = props.components?.[type] || props.defaultComponent || options.components?.sliceZoneDefaultComponent;
|
|
41
|
+
if (!is) return {
|
|
42
|
+
is: TODOSliceComponent,
|
|
43
|
+
key,
|
|
44
|
+
props: { slice }
|
|
45
|
+
};
|
|
46
|
+
if (slice.__mapped) {
|
|
47
|
+
const { __mapped, ...mappedProps } = slice;
|
|
48
|
+
return {
|
|
49
|
+
is,
|
|
50
|
+
key,
|
|
51
|
+
props: mappedProps
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
is,
|
|
56
|
+
key,
|
|
57
|
+
props: {
|
|
58
|
+
slice,
|
|
59
|
+
index,
|
|
60
|
+
context: props.context,
|
|
61
|
+
slices: props.slices
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
return (_ctx, _cache) => {
|
|
67
|
+
return __props.slices ? (openBlock(), createBlock(Wrapper_default, {
|
|
68
|
+
key: 0,
|
|
69
|
+
wrapper: __props.wrapper
|
|
70
|
+
}, {
|
|
71
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(renderedSlices.value, (renderedSlice) => {
|
|
72
|
+
return openBlock(), createBlock(resolveDynamicComponent(renderedSlice.is), mergeProps({ key: renderedSlice.key }, { ref_for: true }, renderedSlice.props), null, 16);
|
|
73
|
+
}), 128))]),
|
|
74
|
+
_: 1
|
|
75
|
+
}, 8, ["wrapper"])) : createCommentVNode("v-if", true);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { SliceZone_vue_vue_type_script_setup_true_lang_default as default };
|
|
82
|
+
//# sourceMappingURL=SliceZone.vue_vue_type_script_setup_true_lang.js.map
|