@prismicio/vue 5.3.0 → 6.0.0-canary.331d154
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 +10 -24
- package/dist/PrismicImage.cjs +8 -0
- package/dist/PrismicImage.cjs.map +1 -0
- package/dist/PrismicImage.js +8 -0
- package/dist/PrismicImage.js.map +1 -0
- package/dist/PrismicImage.vue.d.cts +267 -0
- package/dist/PrismicImage.vue.d.cts.map +1 -0
- package/dist/PrismicImage.vue.d.ts +258 -285
- package/dist/PrismicImage.vue.d.ts.map +1 -0
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +115 -0
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js +115 -0
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicLink.cjs +8 -0
- package/dist/PrismicLink.cjs.map +1 -0
- package/dist/PrismicLink.js +8 -0
- package/dist/PrismicLink.js.map +1 -0
- package/dist/PrismicLink.vue.d.cts +207 -0
- package/dist/PrismicLink.vue.d.cts.map +1 -0
- package/dist/PrismicLink.vue.d.ts +196 -268
- package/dist/PrismicLink.vue.d.ts.map +1 -0
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +79 -0
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.cjs +8 -0
- package/dist/PrismicRichText/PrismicRichText.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.js +8 -0
- package/dist/PrismicRichText/PrismicRichText.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +73 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts +72 -95
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +78 -0
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.cjs +8 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.js +8 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +123 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +123 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.cjs +8 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.js +8 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +46 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.cjs +39 -9
- package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts +54 -0
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts +15 -10
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.js +39 -10
- package/dist/PrismicRichText/getRichTextComponentProps.js.map +1 -1
- package/dist/PrismicRichText/index.d.ts +2 -2
- package/dist/PrismicRichText/types.d.cts +45 -0
- package/dist/PrismicRichText/types.d.cts.map +1 -0
- package/dist/PrismicRichText/types.d.ts +33 -10
- package/dist/PrismicRichText/types.d.ts.map +1 -0
- package/dist/PrismicTable/PrismicTable.cjs +8 -0
- package/dist/PrismicTable/PrismicTable.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTable.js +8 -0
- package/dist/PrismicTable/PrismicTable.js.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue.d.cts +37 -0
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue.d.ts +37 -31
- package/dist/PrismicTable/PrismicTable.vue.d.ts.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +101 -0
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +101 -0
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs +43 -41
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTableDefaultComponents.js +43 -41
- package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/PrismicTable/PrismicTableRow.cjs +8 -0
- package/dist/PrismicTable/PrismicTableRow.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.js +8 -0
- package/dist/PrismicTable/PrismicTableRow.js.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +54 -0
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +54 -0
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/PrismicTable/getTableComponentProps.cjs +131 -21
- package/dist/PrismicTable/getTableComponentProps.cjs.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.d.cts +136 -0
- package/dist/PrismicTable/getTableComponentProps.d.cts.map +1 -0
- package/dist/PrismicTable/getTableComponentProps.d.ts +40 -32
- package/dist/PrismicTable/getTableComponentProps.d.ts.map +1 -0
- package/dist/PrismicTable/getTableComponentProps.js +128 -29
- package/dist/PrismicTable/getTableComponentProps.js.map +1 -1
- package/dist/PrismicTable/index.d.ts +2 -1
- package/dist/PrismicTable/types.d.cts +34 -0
- package/dist/PrismicTable/types.d.cts.map +1 -0
- package/dist/PrismicTable/types.d.ts +27 -23
- package/dist/PrismicTable/types.d.ts.map +1 -0
- package/dist/PrismicText.cjs +8 -0
- package/dist/PrismicText.cjs.map +1 -0
- package/dist/PrismicText.js +8 -0
- package/dist/PrismicText.js.map +1 -0
- package/dist/PrismicText.vue.d.cts +25 -0
- package/dist/PrismicText.vue.d.cts.map +1 -0
- package/dist/PrismicText.vue.d.ts +24 -30
- package/dist/PrismicText.vue.d.ts.map +1 -0
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs +37 -0
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/SliceSimulator.cjs +8 -0
- package/dist/SliceSimulator.cjs.map +1 -0
- package/dist/SliceSimulator.js +8 -0
- package/dist/SliceSimulator.js.map +1 -0
- package/dist/SliceSimulator.vue.d.cts +57 -0
- package/dist/SliceSimulator.vue.d.cts.map +1 -0
- package/dist/SliceSimulator.vue.d.ts +57 -0
- package/dist/SliceSimulator.vue.d.ts.map +1 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs +66 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/SliceZone/SliceZone.cjs +8 -0
- package/dist/SliceZone/SliceZone.cjs.map +1 -0
- package/dist/SliceZone/SliceZone.js +8 -0
- package/dist/SliceZone/SliceZone.js.map +1 -0
- package/dist/SliceZone/SliceZone.vue.d.cts +29 -0
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -0
- package/dist/SliceZone/SliceZone.vue.d.ts +22 -34
- package/dist/SliceZone/SliceZone.vue.d.ts.map +1 -0
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +70 -0
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.cjs +35 -28
- package/dist/SliceZone/TODOSliceComponent.cjs.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.d.cts +15 -0
- package/dist/SliceZone/TODOSliceComponent.d.cts.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.d.ts +8 -2
- package/dist/SliceZone/TODOSliceComponent.d.ts.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.js +34 -27
- package/dist/SliceZone/TODOSliceComponent.js.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.cjs +47 -11
- package/dist/SliceZone/defineSliceZoneComponents.cjs.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.d.cts +42 -0
- package/dist/SliceZone/defineSliceZoneComponents.d.cts.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.d.ts +8 -2
- package/dist/SliceZone/defineSliceZoneComponents.d.ts.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.js +47 -11
- package/dist/SliceZone/defineSliceZoneComponents.js.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.cjs +57 -19
- package/dist/SliceZone/getSliceComponentProps.cjs.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.d.cts +71 -0
- package/dist/SliceZone/getSliceComponentProps.d.cts.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.d.ts +25 -20
- package/dist/SliceZone/getSliceComponentProps.d.ts.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.js +57 -20
- package/dist/SliceZone/getSliceComponentProps.js.map +1 -1
- package/dist/SliceZone/index.d.ts +4 -4
- package/dist/SliceZone/types.d.cts +94 -0
- package/dist/SliceZone/types.d.cts.map +1 -0
- package/dist/SliceZone/types.d.ts +34 -37
- package/dist/SliceZone/types.d.ts.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +19 -0
- package/dist/_virtual/rolldown_runtime.js +18 -0
- package/dist/createPrismic.cjs +32 -79
- package/dist/createPrismic.cjs.map +1 -1
- package/dist/createPrismic.d.cts +76 -0
- package/dist/createPrismic.d.cts.map +1 -0
- package/dist/createPrismic.d.ts +72 -16
- package/dist/createPrismic.d.ts.map +1 -0
- package/dist/createPrismic.js +31 -79
- package/dist/createPrismic.js.map +1 -1
- package/dist/index.cjs +33 -32
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +20 -23
- package/dist/index.js +12 -29
- package/dist/lib/devMsg.cjs +22 -5
- package/dist/lib/devMsg.cjs.map +1 -1
- package/dist/lib/devMsg.js +23 -6
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/lib/isInternalURL.cjs +17 -6
- package/dist/lib/isInternalURL.cjs.map +1 -1
- package/dist/lib/isInternalURL.js +17 -7
- package/dist/lib/isInternalURL.js.map +1 -1
- 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/types.cjs +9 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +18 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +18 -369
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +33 -57
- package/src/PrismicImage.vue +7 -27
- package/src/PrismicLink.vue +24 -49
- package/src/PrismicRichText/PrismicRichText.vue +77 -118
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +65 -19
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +6 -30
- package/src/PrismicRichText/index.ts +1 -1
- package/src/PrismicRichText/types.ts +62 -19
- package/src/PrismicTable/PrismicTable.vue +63 -28
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +14 -14
- package/src/PrismicTable/PrismicTableRow.vue +18 -25
- package/src/PrismicTable/index.ts +2 -0
- package/src/PrismicTable/types.ts +47 -16
- package/src/PrismicText.vue +4 -21
- package/src/SliceSimulator.vue +78 -0
- package/src/SliceZone/SliceZone.vue +18 -40
- package/src/SliceZone/TODOSliceComponent.ts +2 -1
- package/src/SliceZone/types.ts +6 -22
- package/src/createPrismic.ts +84 -133
- package/src/index.ts +18 -32
- package/src/lib/isInternalURL.ts +2 -6
- package/src/types.ts +24 -435
- 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 -112
- package/dist/PrismicImage.vue.cjs.map +0 -1
- package/dist/PrismicImage.vue.js +0 -113
- 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.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.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/PrismicTable/PrismicTable.vue.cjs +0 -62
- package/dist/PrismicTable/PrismicTable.vue.cjs.map +0 -1
- 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.d.ts +0 -2
- 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/PrismicText.vue.cjs +0 -43
- package/dist/PrismicText.vue.cjs.map +0 -1
- 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.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/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.d.ts +0 -16
- package/dist/lib/isInternalURL.d.ts +0 -8
- 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/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/lib/Wrapper.vue +0 -22
- package/src/usePrismic.ts +0 -36
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const require_TODOSliceComponent = require('./TODOSliceComponent.cjs');
|
|
2
|
+
let vue = require("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__ */ (0, vue.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 = (0, vue.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: require_TODOSliceComponent.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 (0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(renderedSlices.value, (renderedSlice) => {
|
|
62
|
+
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);
|
|
63
|
+
}), 128);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
exports.default = SliceZone_vue_vue_type_script_setup_true_lang_default;
|
|
70
|
+
//# 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 type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/** List of slice data from the slice zone. */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/** A record mapping slice types to React components. */\n\tcomponents?: SliceZoneComponents\n\n\t/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/** Arbitrary data made available to all slice components. */\n\tcontext?: TContext\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst renderedSlices = computed<\n\t{\n\t\tis: ComponentOrTagName\n\t\tkey: string\n\t\tprops: Record<string, unknown>\n\t}[]\n>(() => {\n\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,QAAQ;EAGd,MAAM,yCAME;AACP,OAAI,CAAC,MAAM,OAAQ,QAAO,EAAC;AAE3B,UAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OACL,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE9D,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAClC,MAAM,KACN,GAAG,MAAM,GAAG,KAAK,UAAU,MAAM;IAErC,MAAM,KAAK,MAAM,aAAa,SAAS,MAAM;AAE7C,QAAI,CAAC,GACJ,QAAO;KAAE,IAAI;KAAoB;KAAK,OAAO,EAAE,OAAO;KAAC;AAGxD,QAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;AAErC,YAAO;MAAE;MAAI;MAAK,OAAO;MAAY;;AAGtC,WAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;MACd;KACF;KACA;IACD;;gEASE,cAAA,0BAJuB,eAAA,QAAjB,kBAAa;uFACf,cAAc,GAAE,sBAGpB,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
|
|
@@ -0,0 +1,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 { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/** List of slice data from the slice zone. */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/** A record mapping slice types to React components. */\n\tcomponents?: SliceZoneComponents\n\n\t/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/** Arbitrary data made available to all slice components. */\n\tcontext?: TContext\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst renderedSlices = computed<\n\t{\n\t\tis: ComponentOrTagName\n\t\tkey: string\n\t\tprops: Record<string, unknown>\n\t}[]\n>(() => {\n\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCA,MAAM,QAAQ;EAGd,MAAM,iBAAiB,eAMf;AACP,OAAI,CAAC,MAAM,OAAQ,QAAO,EAAC;AAE3B,UAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OACL,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE9D,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAClC,MAAM,KACN,GAAG,MAAM,GAAG,KAAK,UAAU,MAAM;IAErC,MAAM,KAAK,MAAM,aAAa,SAAS,MAAM;AAE7C,QAAI,CAAC,GACJ,QAAO;KAAE,IAAI;KAAoB;KAAK,OAAO,EAAE,OAAO;KAAC;AAGxD,QAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;AAErC,YAAO;MAAE;MAAI;MAAK,OAAO;MAAY;;AAGtC,WAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;MACd;KACF;KACA;IACD;;2BAIA,mBAKE,UAAA,MAAA,WAJuB,eAAA,QAAjB,kBAAa;wBADrB,YAKE,wBAHI,cAAc,GAAE,EAFtB,WAKE,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
|
28
35
|
exports.TODOSliceComponent = TODOSliceComponent;
|
|
29
|
-
//# sourceMappingURL=TODOSliceComponent.cjs.map
|
|
36
|
+
//# sourceMappingURL=TODOSliceComponent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TODOSliceComponent.cjs","sources":["
|
|
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.cjs";
|
|
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.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TODOSliceComponent.d.cts","names":[],"sources":["../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;;;;;cAAa,oBAAkB"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SliceComponentType } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/TODOSliceComponent.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* This Slice component can be used as a reminder to provide a proper
|
|
4
7
|
* implementation.
|
|
@@ -6,4 +9,7 @@ import type { SliceComponentType } from "./types";
|
|
|
6
9
|
* This is also the default Vue component rendered when a component mapping
|
|
7
10
|
* cannot be found in `<SliceZone />`.
|
|
8
11
|
*/
|
|
9
|
-
|
|
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"}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
+
import { computed, defineComponent, h, watchEffect } from "vue";
|
|
1
2
|
import { DEV } from "esm-env";
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
12
|
const TODOSliceComponent = DEV ? /* @__PURE__ */ defineComponent({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=TODOSliceComponent.js.map
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TODOSliceComponent.js","sources":["
|
|
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"}
|
|
@@ -1,14 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
*/
|
|
4
38
|
const defineSliceZoneComponents = (components) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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;
|
|
12
46
|
};
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
13
49
|
exports.defineSliceZoneComponents = defineSliceZoneComponents;
|
|
14
|
-
//# sourceMappingURL=defineSliceZoneComponents.cjs.map
|
|
50
|
+
//# sourceMappingURL=defineSliceZoneComponents.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSliceZoneComponents.cjs","sources":["
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.cjs","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n} from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n *\n * @example\n *\n * ```javascript\n * // Defining a slice components\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n *\n * @param components - {@link SliceZoneComponents}\n *\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,EAAE;CAEjB,IAAI;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,6BAEA,UAIA;;AAGL,QAAO"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SliceLike, SliceZoneComponents } from "./types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/SliceZone/defineSliceZoneComponents.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Gets an optimized record of Slice types mapped to Vue components. Each
|
|
7
|
+
* components will be rendered for each instance of their Slice type.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is essentially an helper function to ensure {@link markRaw} is correctly
|
|
11
|
+
* applied on each components, improving performances.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* ```javascript
|
|
16
|
+
* // Defining a slice components
|
|
17
|
+
* import { defineSliceZoneComponents } from "@prismicio/vue";
|
|
18
|
+
*
|
|
19
|
+
* export default {
|
|
20
|
+
* data() {
|
|
21
|
+
* components: defineSliceZoneComponents({
|
|
22
|
+
* foo: Foo,
|
|
23
|
+
* bar: defineAsyncComponent(
|
|
24
|
+
* () => new Promise((res) => res(Bar)),
|
|
25
|
+
* ),
|
|
26
|
+
* baz: "Baz",
|
|
27
|
+
* }),
|
|
28
|
+
* }
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @typeParam TSlice - The type(s) of slices in the Slice Zone
|
|
33
|
+
* @typeParam TContext - Arbitrary data made available to all Slice components
|
|
34
|
+
*
|
|
35
|
+
* @param components - {@link SliceZoneComponents}
|
|
36
|
+
*
|
|
37
|
+
* @returns A new optimized record of {@link SliceZoneComponents}
|
|
38
|
+
*/
|
|
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.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.d.cts","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":[],"mappings":";;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,2CAEG,iDAGH,oBAAoB,QAAQ,cACtC,oBAAoB,QAAQ"}
|
|
@@ -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"}
|
|
@@ -1,14 +1,50 @@
|
|
|
1
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
|
+
*/
|
|
2
38
|
const defineSliceZoneComponents = (components) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
10
46
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=defineSliceZoneComponents.js.map
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { defineSliceZoneComponents };
|
|
50
|
+
//# sourceMappingURL=defineSliceZoneComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSliceZoneComponents.js","sources":["
|
|
1
|
+
{"version":3,"file":"defineSliceZoneComponents.js","names":[],"sources":["../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n} from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n *\n * @example\n *\n * ```javascript\n * // Defining a slice components\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n *\n * @param components - {@link SliceZoneComponents}\n *\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,EAAE;CAEjB,IAAI;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,YACA,QACA,UAIA;;AAGL,QAAO"}
|