@prismicio/vue 5.2.1 → 5.3.0-canary.4c3e4ab
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/PrismicImage.vue.d.cts +280 -0
- package/dist/PrismicImage.vue.d.cts.map +1 -0
- package/dist/PrismicLink.vue.d.cts +222 -0
- package/dist/PrismicLink.vue.d.cts.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +77 -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 +40 -0
- package/dist/PrismicRichText/types.d.cts.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue.d.cts +41 -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 +29 -0
- package/dist/PrismicText.vue.d.cts.map +1 -0
- package/dist/SliceZone/SliceZone.vue.d.cts +35 -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/index.cjs +28 -32
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +17 -23
- package/dist/index.js +13 -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/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 +280 -0
- package/dist/src/PrismicImage.vue.d.ts.map +1 -0
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +115 -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 +115 -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 +222 -0
- package/dist/src/PrismicLink.vue.d.ts.map +1 -0
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +83 -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 +83 -0
- package/dist/src/PrismicLink.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 +77 -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 +72 -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 +72 -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 +123 -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 +123 -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 +40 -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 +40 -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/src/PrismicRichText/types.d.ts +40 -0
- 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 +42 -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 +93 -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 +93 -0
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +64 -0
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -0
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +64 -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 +54 -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 +54 -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 +29 -0
- package/dist/src/PrismicText.vue.d.ts.map +1 -0
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +37 -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 +37 -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 +35 -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 +70 -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 +70 -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/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.cjs +9 -0
- package/dist/src/types.cjs.map +1 -0
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +8 -0
- package/dist/src/types.js.map +1 -0
- package/dist/types.d.cts +8 -0
- package/dist/types.d.cts.map +1 -0
- package/package.json +32 -55
- package/src/PrismicImage.vue +59 -22
- package/src/PrismicLink.vue +16 -37
- package/src/PrismicRichText/PrismicRichText.vue +69 -116
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +61 -19
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +5 -30
- package/src/PrismicRichText/types.ts +33 -14
- package/src/PrismicTable/PrismicTable.vue +50 -20
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +45 -20
- package/src/PrismicTable/PrismicTableRow.vue +17 -24
- package/src/PrismicTable/types.ts +28 -15
- package/src/PrismicText.vue +2 -15
- package/src/SliceZone/SliceZone.vue +12 -35
- package/src/SliceZone/TODOSliceComponent.ts +2 -1
- package/src/index.ts +14 -32
- package/src/types.ts +30 -438
- 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/PrismicRichText/types.d.ts +0 -22
- 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.d.ts +0 -30
- package/dist/usePrismic.js +0 -10
- package/dist/usePrismic.js.map +0 -1
- package/src/PrismicEmbed.vue +0 -42
- package/src/PrismicRichText/DeprecatedPrismicRichText.vue +0 -146
- package/src/createPrismic.ts +0 -154
- package/src/lib/Wrapper.vue +0 -22
- package/src/usePrismic.ts +0 -36
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { TODOSliceComponent } from "./TODOSliceComponent.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/SliceZone/SliceZone.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "SliceZone",
|
|
7
|
+
__name: "SliceZone",
|
|
8
|
+
props: {
|
|
9
|
+
slices: {
|
|
10
|
+
type: Array,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
components: {
|
|
14
|
+
type: null,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
defaultComponent: {
|
|
18
|
+
type: [Object, Function],
|
|
19
|
+
required: false,
|
|
20
|
+
skipCheck: true
|
|
21
|
+
},
|
|
22
|
+
context: {
|
|
23
|
+
type: null,
|
|
24
|
+
required: false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const renderedSlices = computed(() => {
|
|
30
|
+
if (!props.slices) return [];
|
|
31
|
+
return props.slices.map((slice, index) => {
|
|
32
|
+
const type = "slice_type" in slice ? slice.slice_type : slice.type;
|
|
33
|
+
const key = "id" in slice && typeof slice.id === "string" ? slice.id : `${index}-${JSON.stringify(slice)}`;
|
|
34
|
+
const is = props.components?.[type] || props.defaultComponent;
|
|
35
|
+
if (!is) return {
|
|
36
|
+
is: TODOSliceComponent,
|
|
37
|
+
key,
|
|
38
|
+
props: { slice }
|
|
39
|
+
};
|
|
40
|
+
if (slice.__mapped) {
|
|
41
|
+
const { __mapped, ...mappedProps } = slice;
|
|
42
|
+
return {
|
|
43
|
+
is,
|
|
44
|
+
key,
|
|
45
|
+
props: mappedProps
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
is,
|
|
50
|
+
key,
|
|
51
|
+
props: {
|
|
52
|
+
slice,
|
|
53
|
+
index,
|
|
54
|
+
context: props.context,
|
|
55
|
+
slices: props.slices
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
return (_ctx, _cache) => {
|
|
61
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(renderedSlices.value, (renderedSlice) => {
|
|
62
|
+
return openBlock(), createBlock(resolveDynamicComponent(renderedSlice.is), mergeProps({ key: renderedSlice.key }, { ref_for: true }, renderedSlice.props), null, 16);
|
|
63
|
+
}), 128);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
export { SliceZone_vue_vue_type_script_setup_true_lang_default as default };
|
|
70
|
+
//# sourceMappingURL=SliceZone.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -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 {\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/**\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 React 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// 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\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst renderedSlices = computed(() => {\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,QAAQ;EAGd,MAAM,iBAAiB,eAAe;AACrC,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,36 @@
|
|
|
1
|
+
let vue = require("vue");
|
|
2
|
+
let esm_env = require("esm-env");
|
|
3
|
+
|
|
4
|
+
//#region src/SliceZone/TODOSliceComponent.ts
|
|
5
|
+
/**
|
|
6
|
+
* This Slice component can be used as a reminder to provide a proper
|
|
7
|
+
* implementation.
|
|
8
|
+
*
|
|
9
|
+
* This is also the default Vue component rendered when a component mapping
|
|
10
|
+
* cannot be found in `<SliceZone />`.
|
|
11
|
+
*/
|
|
12
|
+
const TODOSliceComponent = esm_env.DEV ? /* @__PURE__ */ (0, vue.defineComponent)({
|
|
13
|
+
name: "TODOSliceComponent",
|
|
14
|
+
props: { slice: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
} },
|
|
18
|
+
setup(props) {
|
|
19
|
+
const type = (0, vue.computed)(() => {
|
|
20
|
+
return "slice_type" in props.slice ? props.slice.slice_type : props.slice.type;
|
|
21
|
+
});
|
|
22
|
+
(0, vue.watchEffect)(() => {
|
|
23
|
+
console.warn(`[SliceZone] Could not find a component for Slice type "${type.value}"`, props.slice);
|
|
24
|
+
});
|
|
25
|
+
return () => {
|
|
26
|
+
return (0, vue.h)("section", {
|
|
27
|
+
"data-slice-zone-todo-component": "",
|
|
28
|
+
"data-slice-type": type.value
|
|
29
|
+
}, [`Could not find a component for Slice type "${type.value}"`]);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}) : (() => null);
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.TODOSliceComponent = TODOSliceComponent;
|
|
36
|
+
//# sourceMappingURL=TODOSliceComponent.cjs.map
|
|
@@ -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,15 @@
|
|
|
1
|
+
import { SliceComponentType } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/TODOSliceComponent.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This Slice component can be used as a reminder to provide a proper
|
|
7
|
+
* implementation.
|
|
8
|
+
*
|
|
9
|
+
* This is also the default Vue component rendered when a component mapping
|
|
10
|
+
* cannot be found in `<SliceZone />`.
|
|
11
|
+
*/
|
|
12
|
+
declare const TODOSliceComponent: SliceComponentType;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TODOSliceComponent };
|
|
15
|
+
//# sourceMappingURL=TODOSliceComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TODOSliceComponent.d.ts","names":[],"sources":["../../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;;;;;cAAa,oBAAkB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { computed, defineComponent, h, watchEffect } from "vue";
|
|
2
|
+
import { DEV } from "esm-env";
|
|
3
|
+
|
|
4
|
+
//#region src/SliceZone/TODOSliceComponent.ts
|
|
5
|
+
/**
|
|
6
|
+
* This Slice component can be used as a reminder to provide a proper
|
|
7
|
+
* implementation.
|
|
8
|
+
*
|
|
9
|
+
* This is also the default Vue component rendered when a component mapping
|
|
10
|
+
* cannot be found in `<SliceZone />`.
|
|
11
|
+
*/
|
|
12
|
+
const TODOSliceComponent = DEV ? /* @__PURE__ */ defineComponent({
|
|
13
|
+
name: "TODOSliceComponent",
|
|
14
|
+
props: { slice: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
} },
|
|
18
|
+
setup(props) {
|
|
19
|
+
const type = computed(() => {
|
|
20
|
+
return "slice_type" in props.slice ? props.slice.slice_type : props.slice.type;
|
|
21
|
+
});
|
|
22
|
+
watchEffect(() => {
|
|
23
|
+
console.warn(`[SliceZone] Could not find a component for Slice type "${type.value}"`, props.slice);
|
|
24
|
+
});
|
|
25
|
+
return () => {
|
|
26
|
+
return h("section", {
|
|
27
|
+
"data-slice-zone-todo-component": "",
|
|
28
|
+
"data-slice-type": type.value
|
|
29
|
+
}, [`Could not find a component for Slice type "${type.value}"`]);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}) : (() => null);
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { TODOSliceComponent };
|
|
36
|
+
//# sourceMappingURL=TODOSliceComponent.js.map
|
|
@@ -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,50 @@
|
|
|
1
|
+
let vue = require("vue");
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/defineSliceZoneComponents.ts
|
|
4
|
+
/**
|
|
5
|
+
* Gets an optimized record of Slice types mapped to Vue components. Each
|
|
6
|
+
* components will be rendered for each instance of their Slice type.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This is essentially an helper function to ensure {@link markRaw} is correctly
|
|
10
|
+
* applied on each components, improving performances.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* ```javascript
|
|
15
|
+
* // Defining a slice components
|
|
16
|
+
* import { defineSliceZoneComponents } from "@prismicio/vue";
|
|
17
|
+
*
|
|
18
|
+
* export default {
|
|
19
|
+
* data() {
|
|
20
|
+
* components: defineSliceZoneComponents({
|
|
21
|
+
* foo: Foo,
|
|
22
|
+
* bar: defineAsyncComponent(
|
|
23
|
+
* () => new Promise((res) => res(Bar)),
|
|
24
|
+
* ),
|
|
25
|
+
* baz: "Baz",
|
|
26
|
+
* }),
|
|
27
|
+
* }
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @typeParam TSlice - The type(s) of slices in the Slice Zone
|
|
32
|
+
* @typeParam TContext - Arbitrary data made available to all Slice components
|
|
33
|
+
*
|
|
34
|
+
* @param components - {@link SliceZoneComponents}
|
|
35
|
+
*
|
|
36
|
+
* @returns A new optimized record of {@link SliceZoneComponents}
|
|
37
|
+
*/
|
|
38
|
+
const defineSliceZoneComponents = (components) => {
|
|
39
|
+
const result = {};
|
|
40
|
+
let type;
|
|
41
|
+
for (type in components) {
|
|
42
|
+
const component = components[type];
|
|
43
|
+
result[type] = typeof component === "string" ? component : (0, vue.markRaw)(component);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
exports.defineSliceZoneComponents = defineSliceZoneComponents;
|
|
50
|
+
//# sourceMappingURL=defineSliceZoneComponents.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.cjs","names":["type: keyof typeof components"],"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,IAAIA;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,6BAEA,UAIA;;AAGL,QAAO"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SliceLike, SliceZoneComponents } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/defineSliceZoneComponents.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* Gets an optimized record of Slice types mapped to Vue components. Each
|
|
4
7
|
* components will be rendered for each instance of their Slice type.
|
|
@@ -33,4 +36,7 @@ import type { SliceLike, SliceZoneComponents } from "./types";
|
|
|
33
36
|
*
|
|
34
37
|
* @returns A new optimized record of {@link SliceZoneComponents}
|
|
35
38
|
*/
|
|
36
|
-
|
|
39
|
+
declare const defineSliceZoneComponents: <TSlice extends SliceLike = any, TContext = unknown>(components: SliceZoneComponents<TSlice, TContext>) => SliceZoneComponents<TSlice, TContext>;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { defineSliceZoneComponents };
|
|
42
|
+
//# sourceMappingURL=defineSliceZoneComponents.d.ts.map
|
|
@@ -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,50 @@
|
|
|
1
|
+
import { markRaw } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/defineSliceZoneComponents.ts
|
|
4
|
+
/**
|
|
5
|
+
* Gets an optimized record of Slice types mapped to Vue components. Each
|
|
6
|
+
* components will be rendered for each instance of their Slice type.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This is essentially an helper function to ensure {@link markRaw} is correctly
|
|
10
|
+
* applied on each components, improving performances.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* ```javascript
|
|
15
|
+
* // Defining a slice components
|
|
16
|
+
* import { defineSliceZoneComponents } from "@prismicio/vue";
|
|
17
|
+
*
|
|
18
|
+
* export default {
|
|
19
|
+
* data() {
|
|
20
|
+
* components: defineSliceZoneComponents({
|
|
21
|
+
* foo: Foo,
|
|
22
|
+
* bar: defineAsyncComponent(
|
|
23
|
+
* () => new Promise((res) => res(Bar)),
|
|
24
|
+
* ),
|
|
25
|
+
* baz: "Baz",
|
|
26
|
+
* }),
|
|
27
|
+
* }
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @typeParam TSlice - The type(s) of slices in the Slice Zone
|
|
32
|
+
* @typeParam TContext - Arbitrary data made available to all Slice components
|
|
33
|
+
*
|
|
34
|
+
* @param components - {@link SliceZoneComponents}
|
|
35
|
+
*
|
|
36
|
+
* @returns A new optimized record of {@link SliceZoneComponents}
|
|
37
|
+
*/
|
|
38
|
+
const defineSliceZoneComponents = (components) => {
|
|
39
|
+
const result = {};
|
|
40
|
+
let type;
|
|
41
|
+
for (type in components) {
|
|
42
|
+
const component = components[type];
|
|
43
|
+
result[type] = typeof component === "string" ? component : markRaw(component);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { defineSliceZoneComponents };
|
|
50
|
+
//# sourceMappingURL=defineSliceZoneComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.js","names":["type: keyof typeof components"],"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,IAAIA;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,YACA,QACA,UAIA;;AAGL,QAAO"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/SliceZone/getSliceComponentProps.ts
|
|
3
|
+
/**
|
|
4
|
+
* Gets native Vue props for a component rendering content from a Prismic Slice
|
|
5
|
+
* using the `<SliceZone />` component.
|
|
6
|
+
*
|
|
7
|
+
* Props are: `["slice", "index", "slices", "context"]`
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Defining a new slice component
|
|
13
|
+
* import { getSliceComponentProps } from "@prismicio/vue"
|
|
14
|
+
*
|
|
15
|
+
* defineProps(getSliceComponentProps())
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* ```typescript
|
|
21
|
+
* // Defining a new slice component with visual hint
|
|
22
|
+
* import { getSliceComponentProps } from "@prismicio/vue"
|
|
23
|
+
*
|
|
24
|
+
* defineProps(
|
|
25
|
+
* getSliceComponentProps(["slice", "index", "slices", "context"]),
|
|
26
|
+
* )
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @typeParam TSlice - The Slice type
|
|
30
|
+
* @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
|
|
31
|
+
* available to all Slice components
|
|
32
|
+
*
|
|
33
|
+
* @param propsHint - An optional array of prop names used for the sole purpose
|
|
34
|
+
* of having a visual hint of which props are made available to the slice,
|
|
35
|
+
* this parameters doesn't have any effect
|
|
36
|
+
*
|
|
37
|
+
* @returns Props object to use with `defineProps()`
|
|
38
|
+
*/
|
|
39
|
+
const getSliceComponentProps = (propsHint) => ({
|
|
40
|
+
slice: {
|
|
41
|
+
type: Object,
|
|
42
|
+
required: true
|
|
43
|
+
},
|
|
44
|
+
index: {
|
|
45
|
+
type: Number,
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
slices: {
|
|
49
|
+
type: Array,
|
|
50
|
+
required: true
|
|
51
|
+
},
|
|
52
|
+
context: {
|
|
53
|
+
type: null,
|
|
54
|
+
required: true
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.getSliceComponentProps = getSliceComponentProps;
|
|
60
|
+
//# sourceMappingURL=getSliceComponentProps.cjs.map
|
|
@@ -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"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { SliceComponentProps, SliceLike } from "./types.js";
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/SliceZone/getSliceComponentProps.d.ts
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
7
|
* Native Vue props for a component rendering content from a Prismic Slice using
|
|
5
8
|
* the `<SliceZone />` component.
|
|
@@ -9,22 +12,22 @@ import type { SliceComponentProps, SliceLike } from "./types";
|
|
|
9
12
|
* available to all Slice components
|
|
10
13
|
*/
|
|
11
14
|
type DefineComponentSliceComponentProps<TSlice extends SliceLike = any, TContext = unknown> = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
slice: {
|
|
16
|
+
type: PropType<SliceComponentProps<TSlice, TContext>["slice"]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
index: {
|
|
20
|
+
type: PropType<SliceComponentProps<TSlice, TContext>["index"]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
slices: {
|
|
24
|
+
type: PropType<SliceComponentProps<TSlice, TContext>["slices"]>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
context: {
|
|
28
|
+
type: PropType<SliceComponentProps<TSlice, TContext>["context"]>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
28
31
|
};
|
|
29
32
|
/**
|
|
30
33
|
* Gets native Vue props for a component rendering content from a Prismic Slice
|
|
@@ -62,5 +65,7 @@ type DefineComponentSliceComponentProps<TSlice extends SliceLike = any, TContext
|
|
|
62
65
|
*
|
|
63
66
|
* @returns Props object to use with `defineProps()`
|
|
64
67
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
declare const getSliceComponentProps: <TSlice extends SliceLike = any, TContext = unknown>(propsHint?: ["slice", "index", "slices", "context"]) => DefineComponentSliceComponentProps<TSlice, TContext>;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { getSliceComponentProps };
|
|
71
|
+
//# sourceMappingURL=getSliceComponentProps.d.ts.map
|
|
@@ -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,59 @@
|
|
|
1
|
+
//#region src/SliceZone/getSliceComponentProps.ts
|
|
2
|
+
/**
|
|
3
|
+
* Gets native Vue props for a component rendering content from a Prismic Slice
|
|
4
|
+
* using the `<SliceZone />` component.
|
|
5
|
+
*
|
|
6
|
+
* Props are: `["slice", "index", "slices", "context"]`
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Defining a new slice component
|
|
12
|
+
* import { getSliceComponentProps } from "@prismicio/vue"
|
|
13
|
+
*
|
|
14
|
+
* defineProps(getSliceComponentProps())
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Defining a new slice component with visual hint
|
|
21
|
+
* import { getSliceComponentProps } from "@prismicio/vue"
|
|
22
|
+
*
|
|
23
|
+
* defineProps(
|
|
24
|
+
* getSliceComponentProps(["slice", "index", "slices", "context"]),
|
|
25
|
+
* )
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @typeParam TSlice - The Slice type
|
|
29
|
+
* @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
|
|
30
|
+
* available to all Slice components
|
|
31
|
+
*
|
|
32
|
+
* @param propsHint - An optional array of prop names used for the sole purpose
|
|
33
|
+
* of having a visual hint of which props are made available to the slice,
|
|
34
|
+
* this parameters doesn't have any effect
|
|
35
|
+
*
|
|
36
|
+
* @returns Props object to use with `defineProps()`
|
|
37
|
+
*/
|
|
38
|
+
const getSliceComponentProps = (propsHint) => ({
|
|
39
|
+
slice: {
|
|
40
|
+
type: Object,
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
index: {
|
|
44
|
+
type: Number,
|
|
45
|
+
required: true
|
|
46
|
+
},
|
|
47
|
+
slices: {
|
|
48
|
+
type: Array,
|
|
49
|
+
required: true
|
|
50
|
+
},
|
|
51
|
+
context: {
|
|
52
|
+
type: null,
|
|
53
|
+
required: true
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { getSliceComponentProps };
|
|
59
|
+
//# sourceMappingURL=getSliceComponentProps.js.map
|
|
@@ -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,4 @@
|
|
|
1
|
+
import { SliceComponentProps, SliceComponentType, SliceLike, SliceLikeGraphQL, SliceLikeRestV2, SliceZoneComponents, SliceZoneLike } from "./types.js";
|
|
2
|
+
import { TODOSliceComponent } from "./TODOSliceComponent.js";
|
|
3
|
+
import { getSliceComponentProps } from "./getSliceComponentProps.js";
|
|
4
|
+
import { defineSliceZoneComponents } from "./defineSliceZoneComponents.js";
|