@prismicio/vue 5.3.0-canary.5d9ea4c → 5.3.0-canary.87748cc

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.
Files changed (170) hide show
  1. package/dist/PrismicImage.vue.d.cts +30 -58
  2. package/dist/PrismicImage.vue.d.cts.map +1 -1
  3. package/dist/PrismicLink.vue.d.cts +65 -137
  4. package/dist/PrismicLink.vue.d.cts.map +1 -1
  5. package/dist/PrismicRichText/PrismicRichText.vue.d.cts +25 -53
  6. package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
  7. package/dist/PrismicRichText/types.d.cts +18 -5
  8. package/dist/PrismicRichText/types.d.cts.map +1 -1
  9. package/dist/PrismicTable/PrismicTable.vue.d.cts +10 -10
  10. package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
  11. package/dist/PrismicTable/types.d.cts +8 -8
  12. package/dist/PrismicTable/types.d.cts.map +1 -1
  13. package/dist/PrismicText.vue.d.cts +3 -13
  14. package/dist/PrismicText.vue.d.cts.map +1 -1
  15. package/dist/SliceZone/SliceZone.vue.d.cts +5 -24
  16. package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
  17. package/dist/index.cjs +3 -10
  18. package/dist/index.d.cts +9 -13
  19. package/dist/index.d.ts +11 -15
  20. package/dist/index.js +3 -6
  21. package/dist/package.cjs +1 -1
  22. package/dist/package.cjs.map +1 -1
  23. package/dist/package.js +1 -1
  24. package/dist/package.js.map +1 -1
  25. package/dist/src/PrismicImage.cjs.map +1 -1
  26. package/dist/src/PrismicImage.js.map +1 -1
  27. package/dist/src/PrismicImage.vue.d.ts +26 -54
  28. package/dist/src/PrismicImage.vue.d.ts.map +1 -1
  29. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +2 -4
  30. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  31. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js +2 -4
  32. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/src/PrismicLink.cjs.map +1 -1
  34. package/dist/src/PrismicLink.js.map +1 -1
  35. package/dist/src/PrismicLink.vue.d.ts +61 -133
  36. package/dist/src/PrismicLink.vue.d.ts.map +1 -1
  37. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -6
  38. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  39. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js +3 -6
  40. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -1
  42. package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -1
  43. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +25 -53
  44. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
  45. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +41 -57
  46. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  47. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +42 -58
  48. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -1
  50. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -1
  51. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +53 -33
  52. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  53. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +54 -34
  54. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  55. package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -1
  56. package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -1
  57. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +9 -29
  58. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  59. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +10 -30
  60. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/src/PrismicRichText/types.d.ts +18 -5
  62. package/dist/src/PrismicRichText/types.d.ts.map +1 -1
  63. package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -1
  64. package/dist/src/PrismicTable/PrismicTable.js.map +1 -1
  65. package/dist/src/PrismicTable/PrismicTable.vue.d.ts +13 -13
  66. package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
  67. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +47 -19
  68. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  69. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +48 -20
  70. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +36 -18
  72. package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
  73. package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +36 -18
  74. package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
  75. package/dist/src/PrismicTable/PrismicTableRow.cjs.map +1 -1
  76. package/dist/src/PrismicTable/PrismicTableRow.js.map +1 -1
  77. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +13 -10
  78. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  79. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +14 -11
  80. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  81. package/dist/src/PrismicTable/types.d.ts +8 -8
  82. package/dist/src/PrismicTable/types.d.ts.map +1 -1
  83. package/dist/src/PrismicText.cjs.map +1 -1
  84. package/dist/src/PrismicText.js.map +1 -1
  85. package/dist/src/PrismicText.vue.d.ts +1 -11
  86. package/dist/src/PrismicText.vue.d.ts.map +1 -1
  87. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +1 -12
  88. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  89. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js +3 -14
  90. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/src/SliceZone/SliceZone.cjs.map +1 -1
  92. package/dist/src/SliceZone/SliceZone.js.map +1 -1
  93. package/dist/src/SliceZone/SliceZone.vue.d.ts +5 -24
  94. package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -1
  95. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +5 -17
  96. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  97. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +6 -18
  98. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
  99. package/dist/src/types.cjs +9 -0
  100. package/dist/src/types.cjs.map +1 -0
  101. package/dist/src/types.d.ts +3 -352
  102. package/dist/src/types.d.ts.map +1 -1
  103. package/dist/src/types.js +8 -0
  104. package/dist/src/types.js.map +1 -0
  105. package/dist/types.d.cts +3 -352
  106. package/dist/types.d.cts.map +1 -1
  107. package/package.json +6 -5
  108. package/src/PrismicImage.vue +10 -27
  109. package/src/PrismicLink.vue +18 -43
  110. package/src/PrismicRichText/PrismicRichText.vue +68 -118
  111. package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +61 -19
  112. package/src/PrismicRichText/PrismicRichTextSerialize.vue +5 -30
  113. package/src/PrismicRichText/types.ts +33 -14
  114. package/src/PrismicTable/PrismicTable.vue +50 -23
  115. package/src/PrismicTable/PrismicTableDefaultComponents.ts +45 -20
  116. package/src/PrismicTable/PrismicTableRow.vue +17 -24
  117. package/src/PrismicTable/types.ts +28 -15
  118. package/src/PrismicText.vue +3 -18
  119. package/src/SliceZone/SliceZone.vue +12 -41
  120. package/src/index.ts +13 -21
  121. package/src/types.ts +30 -438
  122. package/dist/PrismicEmbed.vue.d.cts +0 -25
  123. package/dist/PrismicEmbed.vue.d.cts.map +0 -1
  124. package/dist/createPrismic.d.cts +0 -29
  125. package/dist/createPrismic.d.cts.map +0 -1
  126. package/dist/src/PrismicEmbed.cjs +0 -8
  127. package/dist/src/PrismicEmbed.cjs.map +0 -1
  128. package/dist/src/PrismicEmbed.js +0 -8
  129. package/dist/src/PrismicEmbed.js.map +0 -1
  130. package/dist/src/PrismicEmbed.vue.d.ts +0 -25
  131. package/dist/src/PrismicEmbed.vue.d.ts.map +0 -1
  132. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs +0 -42
  133. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
  134. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js +0 -42
  135. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js.map +0 -1
  136. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs +0 -8
  137. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs.map +0 -1
  138. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js +0 -8
  139. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js.map +0 -1
  140. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs +0 -92
  141. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
  142. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js +0 -92
  143. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js.map +0 -1
  144. package/dist/src/createPrismic.cjs +0 -85
  145. package/dist/src/createPrismic.cjs.map +0 -1
  146. package/dist/src/createPrismic.d.ts +0 -29
  147. package/dist/src/createPrismic.d.ts.map +0 -1
  148. package/dist/src/createPrismic.js +0 -85
  149. package/dist/src/createPrismic.js.map +0 -1
  150. package/dist/src/lib/Wrapper.cjs +0 -8
  151. package/dist/src/lib/Wrapper.cjs.map +0 -1
  152. package/dist/src/lib/Wrapper.js +0 -8
  153. package/dist/src/lib/Wrapper.js.map +0 -1
  154. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs +0 -22
  155. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
  156. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js +0 -22
  157. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js.map +0 -1
  158. package/dist/src/usePrismic.cjs +0 -38
  159. package/dist/src/usePrismic.cjs.map +0 -1
  160. package/dist/src/usePrismic.d.ts +0 -36
  161. package/dist/src/usePrismic.d.ts.map +0 -1
  162. package/dist/src/usePrismic.js +0 -37
  163. package/dist/src/usePrismic.js.map +0 -1
  164. package/dist/usePrismic.d.cts +0 -36
  165. package/dist/usePrismic.d.cts.map +0 -1
  166. package/src/PrismicEmbed.vue +0 -42
  167. package/src/PrismicRichText/DeprecatedPrismicRichText.vue +0 -146
  168. package/src/createPrismic.ts +0 -154
  169. package/src/lib/Wrapper.vue +0 -22
  170. package/src/usePrismic.ts +0 -36
@@ -10,38 +10,41 @@ var PrismicTableRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
10
10
  type: Object,
11
11
  required: true
12
12
  },
13
- components: {
13
+ internalTableComponents: {
14
14
  type: Object,
15
15
  required: true
16
+ },
17
+ components: {
18
+ type: Object,
19
+ required: false
16
20
  }
17
21
  },
18
22
  setup(__props) {
19
- const props = __props;
20
23
  return (_ctx, _cache) => {
21
- return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.components.tr), { row: __props.row }, {
24
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.internalTableComponents.tr.is), (0, vue.mergeProps)({ row: __props.row }, __props.internalTableComponents.tr.shorthand), {
22
25
  default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.row.cells, (cell) => {
23
- return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: cell.key }, [cell.type === "header" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.components.th), {
26
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: cell.key }, [cell.type === "header" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.internalTableComponents.th.is), (0, vue.mergeProps)({
24
27
  key: 0,
25
28
  cell
26
- }, {
29
+ }, { ref_for: true }, __props.internalTableComponents.th.shorthand), {
27
30
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)(require_PrismicRichText.default, {
28
31
  field: cell.content,
29
32
  components: __props.components
30
33
  }, null, 8, ["field", "components"])]),
31
34
  _: 2
32
- }, 1032, ["cell"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.components.td), {
35
+ }, 1040, ["cell"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.internalTableComponents.td.is), (0, vue.mergeProps)({
33
36
  key: 1,
34
37
  cell
35
- }, {
38
+ }, { ref_for: true }, __props.internalTableComponents.td.shorthand), {
36
39
  default: (0, vue.withCtx)(() => [(0, vue.createVNode)(require_PrismicRichText.default, {
37
40
  field: cell.content,
38
- components: props.components
41
+ components: __props.components
39
42
  }, null, 8, ["field", "components"])]),
40
43
  _: 2
41
- }, 1032, ["cell"]))], 64);
44
+ }, 1040, ["cell"]))], 64);
42
45
  }), 128))]),
43
46
  _: 1
44
- }, 8, ["row"]);
47
+ }, 16, ["row"]);
45
48
  };
46
49
  }
47
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\n/**\n * Props for `<PrismicRowTable />`.\n */\nexport type PrismicTableRowProps = {\n\t/**\n\t * The Prismic table row to render.\n\t */\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * tr: TableRow,\n\t * }\n\t * ```\n\t */\n\tcomponents: VueTableComponents & VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component :is=\"props.components.tr\" :row=\"row\">\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"props.components.th\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component v-else :is=\"props.components.td\" :cell=\"cell\">\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"props.components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EA+BA,MAAM,QAAQ;;sFAKG,MAAM,WAAW,GAAE,EAAA,EAAG,KAAK,QAAA,KAAG,EAAA;oCACV,wDAWxB,cAAA,0BAXc,QAAA,IAAI,QAAZ,SAAI;mFAAqB,KAAK,QAEvC,KAAK,SAAI,wFACV,MAAM,WAAW,GAAE,EAAA;;MACjB;;sCAE2D,sBAAA,iCAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;wGAE9B,MAAM,WAAW,GAAE,EAAA;;MAAS;;sCACsB,sBAAA,iCAAA;OAAtD,OAAO,KAAK;OAAU,YAAY,MAAM"}
1
+ {"version":3,"file":"PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\nexport type PrismicTableRowProps = {\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\tinternalTableComponents: InternalVueTableComponents\n\tcomponents?: VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component\n\t\t:is=\"internalTableComponents.tr.is\"\n\t\t:row=\"row\"\n\t\tv-bind=\"internalTableComponents.tr.shorthand\"\n\t>\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"internalTableComponents.th.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.th.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component\n\t\t\t\tv-else\n\t\t\t\t:is=\"internalTableComponents.td.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.td.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;sFAoBO,QAAA,wBAAwB,GAAG,GAAE,sBAsBvB,EArBV,KAAK,QAAA,KAAG,EACD,QAAA,wBAAwB,GAAG,UAAS,EAAA;oCAET,wDAiBxB,cAAA,0BAjBc,QAAA,IAAI,QAAZ,SAAI;mFAAqB,KAAK,QAEvC,KAAK,SAAI,wFACV,QAAA,wBAAwB,GAAG,GAAE,sBAKvB;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;sCAEsB,sBAAA,iCAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;wGAI/C,QAAA,wBAAwB,GAAG,GAAE,sBAKvB;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;sCAEsB,sBAAA,iCAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA"}
@@ -1,5 +1,5 @@
1
1
  import PrismicRichText_default from "../PrismicRichText/PrismicRichText.js";
2
- import { Fragment, createBlock, createElementBlock, createVNode, defineComponent, openBlock, renderList, resolveDynamicComponent, withCtx } from "vue";
2
+ import { Fragment, createBlock, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, withCtx } from "vue";
3
3
 
4
4
  //#region src/PrismicTable/PrismicTableRow.vue?vue&type=script&setup=true&lang.ts
5
5
  var PrismicTableRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -10,38 +10,41 @@ var PrismicTableRow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
10
10
  type: Object,
11
11
  required: true
12
12
  },
13
- components: {
13
+ internalTableComponents: {
14
14
  type: Object,
15
15
  required: true
16
+ },
17
+ components: {
18
+ type: Object,
19
+ required: false
16
20
  }
17
21
  },
18
22
  setup(__props) {
19
- const props = __props;
20
23
  return (_ctx, _cache) => {
21
- return openBlock(), createBlock(resolveDynamicComponent(props.components.tr), { row: __props.row }, {
24
+ return openBlock(), createBlock(resolveDynamicComponent(__props.internalTableComponents.tr.is), mergeProps({ row: __props.row }, __props.internalTableComponents.tr.shorthand), {
22
25
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row.cells, (cell) => {
23
- return openBlock(), createElementBlock(Fragment, { key: cell.key }, [cell.type === "header" ? (openBlock(), createBlock(resolveDynamicComponent(props.components.th), {
26
+ return openBlock(), createElementBlock(Fragment, { key: cell.key }, [cell.type === "header" ? (openBlock(), createBlock(resolveDynamicComponent(__props.internalTableComponents.th.is), mergeProps({
24
27
  key: 0,
25
28
  cell
26
- }, {
29
+ }, { ref_for: true }, __props.internalTableComponents.th.shorthand), {
27
30
  default: withCtx(() => [createVNode(PrismicRichText_default, {
28
31
  field: cell.content,
29
32
  components: __props.components
30
33
  }, null, 8, ["field", "components"])]),
31
34
  _: 2
32
- }, 1032, ["cell"])) : (openBlock(), createBlock(resolveDynamicComponent(props.components.td), {
35
+ }, 1040, ["cell"])) : (openBlock(), createBlock(resolveDynamicComponent(__props.internalTableComponents.td.is), mergeProps({
33
36
  key: 1,
34
37
  cell
35
- }, {
38
+ }, { ref_for: true }, __props.internalTableComponents.td.shorthand), {
36
39
  default: withCtx(() => [createVNode(PrismicRichText_default, {
37
40
  field: cell.content,
38
- components: props.components
41
+ components: __props.components
39
42
  }, null, 8, ["field", "components"])]),
40
43
  _: 2
41
- }, 1032, ["cell"]))], 64);
44
+ }, 1040, ["cell"]))], 64);
42
45
  }), 128))]),
43
46
  _: 1
44
- }, 8, ["row"]);
47
+ }, 16, ["row"]);
45
48
  };
46
49
  }
47
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTableRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\n/**\n * Props for `<PrismicRowTable />`.\n */\nexport type PrismicTableRowProps = {\n\t/**\n\t * The Prismic table row to render.\n\t */\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * tr: TableRow,\n\t * }\n\t * ```\n\t */\n\tcomponents: VueTableComponents & VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component :is=\"props.components.tr\" :row=\"row\">\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"props.components.th\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component v-else :is=\"props.components.td\" :cell=\"cell\">\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"props.components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EA+BA,MAAM,QAAQ;;uBAKb,YAaY,wBAbI,MAAM,WAAW,GAAE,EAAA,EAAG,KAAK,QAAA,KAAG,EAAA;2BACV,mBAAnC,mBAWW,UAAA,MAAA,WAXc,QAAA,IAAI,QAAZ,SAAI;6DAAqB,KAAK,QAEvC,KAAK,SAAI,yBADhB,YAMY,wBAJN,MAAM,WAAW,GAAE,EAAA;;MACjB;;6BAE2D,CAAlE,YAAkE,yBAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;yCAErD,YAEY,wBAFW,MAAM,WAAW,GAAE,EAAA;;MAAS;;6BACsB,CAAxE,YAAwE,yBAAA;OAAtD,OAAO,KAAK;OAAU,YAAY,MAAM"}
1
+ {"version":3,"file":"PrismicTableRow.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicTable/PrismicTableRow.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { TableFieldBodyRow, TableFieldHeadRow } from \"@prismicio/client\"\n\nimport type { InternalVueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\nimport PrismicRichText from \"../PrismicRichText/PrismicRichText.vue\"\n\nexport type PrismicTableRowProps = {\n\trow: TableFieldHeadRow | TableFieldBodyRow\n\tinternalTableComponents: InternalVueTableComponents\n\tcomponents?: VueRichTextSerializer\n}\n\nconst props = defineProps<PrismicTableRowProps>()\ndefineOptions({ name: \"PrismicTableRow\" })\n</script>\n\n<template>\n\t<component\n\t\t:is=\"internalTableComponents.tr.is\"\n\t\t:row=\"row\"\n\t\tv-bind=\"internalTableComponents.tr.shorthand\"\n\t>\n\t\t<template v-for=\"cell in row.cells\" :key=\"cell.key\">\n\t\t\t<component\n\t\t\t\tv-if=\"cell.type === 'header'\"\n\t\t\t\t:is=\"internalTableComponents.th.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.th.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t\t<component\n\t\t\t\tv-else\n\t\t\t\t:is=\"internalTableComponents.td.is\"\n\t\t\t\t:cell=\"cell\"\n\t\t\t\tv-bind=\"internalTableComponents.td.shorthand\"\n\t\t\t>\n\t\t\t\t<PrismicRichText :field=\"cell.content\" :components=\"components\" />\n\t\t\t</component>\n\t\t</template>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;uBAmBC,YAuBY,wBAtBN,QAAA,wBAAwB,GAAG,GAAE,EADnC,WAuBY,EArBV,KAAK,QAAA,KAAG,EACD,QAAA,wBAAwB,GAAG,UAAS,EAAA;2BAET,mBAAnC,mBAiBW,UAAA,MAAA,WAjBc,QAAA,IAAI,QAAZ,SAAI;6DAAqB,KAAK,QAEvC,KAAK,SAAI,yBADhB,YAOY,wBALN,QAAA,wBAAwB,GAAG,GAAE,EAFnC,WAOY;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;6BAEsB,CAAlE,YAAkE,yBAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA;;;yCAErD,YAOY,wBALN,QAAA,wBAAwB,GAAG,GAAE,EAFnC,WAOY;;MAJJ;2BACC,QAAA,wBAAwB,GAAG,UAAS,EAAA;6BAEsB,CAAlE,YAAkE,yBAAA;OAAhD,OAAO,KAAK;OAAU,YAAY,QAAA"}
@@ -1,4 +1,5 @@
1
- import { DefineComponent, FunctionalComponent, defineAsyncComponent } from "vue";
1
+ import { VueComponent } from "../types.js";
2
+ import { VueShorthand } from "../PrismicRichText/types.js";
2
3
  import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, TableFieldHead, TableFieldHeadRow, TableFieldHeaderCell } from "@prismicio/client";
3
4
 
4
5
  //#region src/PrismicTable/types.d.ts
@@ -12,24 +13,23 @@ import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, Tabl
12
13
  type VueTableComponents = {
13
14
  table?: VueComponent<{
14
15
  table: TableField<"filled">;
15
- }>;
16
+ }> | VueShorthand;
16
17
  thead?: VueComponent<{
17
18
  head: TableFieldHead;
18
- }>;
19
+ }> | VueShorthand;
19
20
  tbody?: VueComponent<{
20
21
  body: TableFieldBody;
21
- }>;
22
+ }> | VueShorthand;
22
23
  tr?: VueComponent<{
23
24
  row: TableFieldBodyRow | TableFieldHeadRow;
24
- }>;
25
+ }> | VueShorthand;
25
26
  th?: VueComponent<{
26
27
  cell: TableFieldHeaderCell;
27
- }>;
28
+ }> | VueShorthand;
28
29
  td?: VueComponent<{
29
30
  cell: TableFieldDataCell;
30
- }>;
31
+ }> | VueShorthand;
31
32
  };
32
- type VueComponent<TProps> = ReturnType<typeof defineAsyncComponent> | DefineComponent<TProps> | FunctionalComponent<TProps>;
33
33
  //#endregion
34
34
  export { VueTableComponents };
35
35
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAqBA;;;;AAES,KAFG,kBAAA,GAEH;EACqB,KAAA,CAAA,EAFrB,YAEqB,CAAA;IAArB,KAAA,EAFsB,UAEtB,CAAA,QAAA,CAAA;EACiB,CAAA,CAAA;EAAoB,KAAA,CAAA,EAFrC,YAEqC,CAAA;IAAxC,IAAA,EAFwB,cAExB;EACqB,CAAA,CAAA;EAArB,KAAA,CAAA,EAFG,YAEH,CAAA;IACqB,IAAA,EAHG,cAGH;EAArB,CAAA,CAAA;EAAY,EAAA,CAAA,EAFZ,YAEY,CAAA;IAGb,GAAA,EALqB,iBAKT,GAL6B,iBAK7B;EACI,CAAA,CAAA;EAAlB,EAAA,CAAA,EALG,YAKH,CAAA;IACgB,IAAA,EANQ,oBAMR;EAAhB,CAAA,CAAA;EACoB,EAAA,CAAA,EANjB,YAMiB,CAAA;IAApB,IAAA,EANwB,kBAMxB;EAAmB,CAAA,CAAA;;KAHjB,uBACF,kBAAkB,wBAClB,gBAAgB,UAChB,oBAAoB"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAmBA;;;;AAE8B,KAFlB,kBAAA,GAEkB;EAArB,KAAA,CAAA,EADA,YACA,CAAA;IAAyC,KAAA,EADnB,UACmB,CAAA,QAAA,CAAA;EACpB,CAAA,CAAA,GAF2B,YAE3B;EAArB,KAAA,CAAA,EADA,YACA,CAAA;IAAyC,IAAA,EADpB,cACoB;EAE1B,CAAA,CAAA,GAH0B,YAG1B;EAAoB,KAAA,CAAA,EAFnC,YAEmC,CAAA;IAAxC,IAAA,EAF0B,cAE1B;EACA,CAAA,CAAA,GAH8C,YAG9C;EACuB,EAAA,CAAA,EAFvB,YAEuB,CAAA;IAArB,GAAA,EAFkB,iBAElB,GAFsC,iBAEtC;EAA+C,CAAA,CAAA,GADjD,YACiD;EAC1B,EAAA,CAAA,EADrB,YACqB,CAAA;IAArB,IAAA,EADqB,oBACrB;EAA6C,CAAA,CAAA,GADE,YACF;EAAY,EAAA,CAAA,EAAzD,YAAyD,CAAA;UAApC;OAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicText.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicText.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
@@ -1,4 +1,3 @@
1
- import { ComponentOrTagName } from "./types.js";
2
1
  import * as vue21 from "vue";
3
2
  import { RichTextField } from "@prismicio/client";
4
3
 
@@ -7,9 +6,7 @@ import { RichTextField } from "@prismicio/client";
7
6
  * Props for `<PrismicText />`.
8
7
  */
9
8
  type PrismicTextProps = {
10
- /**
11
- * The Prismic rich text field to render.
12
- */
9
+ /** The Prismic rich text field to render. */
13
10
  field: RichTextField | null | undefined;
14
11
  /**
15
12
  * The string value to be rendered when the field is empty. If a fallback is
@@ -22,13 +19,6 @@ type PrismicTextProps = {
22
19
  * @defaultValue `" "` (a whitespace)
23
20
  */
24
21
  separator?: string;
25
- /**
26
- * An HTML tag name or a component used to wrap the output. `<PrismicText />`
27
- * is not wrapped by default.
28
- *
29
- * @defaultValue `"template"` (no wrapper)
30
- */
31
- wrapper?: ComponentOrTagName;
32
22
  };
33
23
  declare const __VLS_export: vue21.DefineComponent<PrismicTextProps, {}, {}, {}, {}, vue21.ComponentOptionsMixin, vue21.ComponentOptionsMixin, {}, string, vue21.PublicProps, Readonly<PrismicTextProps> & Readonly<{}>, {}, {}, {}, {}, string, vue21.ComponentProvideOptions, false, {}, any>;
34
24
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;;;;AA8EY,KAAA,gBAAA,GAAgB;EAiFtB;;;EAAY,KAAA,EA7EV,aA6EU,GAAA,IAAA,GAAA,SAAA;EAAA;;;;EAAA,QAAA,CAAA,EAAA,MAAA;EAAA;;AAAA;;;;;;;;;;YAxDP;;cAwDL,cAAY,KAAA,CAAA,gBAAA,kCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
1
+ {"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;;;AA4DY,KAAA,gBAAA,GAAgB;EAqDtB;EAAY,KAAA,EAnDV,aAmDU,GAAA,IAAA,GAAA,SAAA;EAAA;;;;EAAA,QAAA,CAAA,EAAA,MAAA;EAAA;;;;AAAA;;;cAAZ,cAAY,KAAA,CAAA,gBAAA,kCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
@@ -1,4 +1,3 @@
1
- const require_Wrapper = require('./lib/Wrapper.cjs');
2
1
  const require_devMsg = require('./lib/devMsg.cjs');
3
2
  let vue = require("vue");
4
3
  let __prismicio_client = require("@prismicio/client");
@@ -20,10 +19,6 @@ var PrismicText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0
20
19
  separator: {
21
20
  type: String,
22
21
  required: false
23
- },
24
- wrapper: {
25
- type: null,
26
- required: false
27
22
  }
28
23
  },
29
24
  setup(__props) {
@@ -32,13 +27,7 @@ var PrismicText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0
32
27
  if (typeof props.field === "string") throw new Error(`[PrismicText] The "field" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${require_devMsg.devMsg("prismictext-works-only-with-rich-text-and-title-fields")}`);
33
28
  }, {});
34
29
  return (_ctx, _cache) => {
35
- return (0, vue.unref)(__prismicio_client.isFilled).richText(__props.field) || __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_Wrapper.default, {
36
- key: 0,
37
- wrapper: __props.wrapper
38
- }, {
39
- default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(__prismicio_client.asText)(__props.field) || __props.fallback), 1)]),
40
- _: 1
41
- }, 8, ["wrapper"])) : (0, vue.createCommentVNode)("v-if", true);
30
+ return (0, vue.toDisplayString)((0, vue.unref)(__prismicio_client.asText)(__props.field) || __props.fallback || "");
42
31
  };
43
32
  }
44
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,sBACnR,yDACA,GACF;KAEC,EAAE,CAAA;;yBAKU,4BAAQ,CAAC,SAAS,QAAA,MAAK,IAAK,QAAA,uDAEjC,yBAAA;;IAF4C,SAAS,QAAA;;oCAC/B,kEAA5B,0BAAM,CAAC,QAAA,MAAK,IAAK,QAAA,SAAQ,EAAA,EAAA"}
1
+ {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,sBACnR,yDACA,GACF;KAEC,EAAE,CAAA;;kDAKF,0BAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}
@@ -1,7 +1,6 @@
1
- import Wrapper_default from "./lib/Wrapper.js";
2
1
  import { devMsg } from "./lib/devMsg.js";
3
- import { createBlock, createCommentVNode, createTextVNode, defineComponent, openBlock, toDisplayString, unref, watchEffect, withCtx } from "vue";
4
- import { asText, isFilled } from "@prismicio/client";
2
+ import { defineComponent, toDisplayString, unref, watchEffect } from "vue";
3
+ import { asText } from "@prismicio/client";
5
4
  import { DEV } from "esm-env";
6
5
 
7
6
  //#region src/PrismicText.vue?vue&type=script&setup=true&lang.ts
@@ -20,10 +19,6 @@ var PrismicText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
20
19
  separator: {
21
20
  type: String,
22
21
  required: false
23
- },
24
- wrapper: {
25
- type: null,
26
- required: false
27
22
  }
28
23
  },
29
24
  setup(__props) {
@@ -32,13 +27,7 @@ var PrismicText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
32
27
  if (typeof props.field === "string") throw new Error(`[PrismicText] The "field" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg("prismictext-works-only-with-rich-text-and-title-fields")}`);
33
28
  }, {});
34
29
  return (_ctx, _cache) => {
35
- return unref(isFilled).richText(__props.field) || __props.fallback ? (openBlock(), createBlock(Wrapper_default, {
36
- key: 0,
37
- wrapper: __props.wrapper
38
- }, {
39
- default: withCtx(() => [createTextVNode(toDisplayString(unref(asText)(__props.field) || __props.fallback), 1)]),
40
- _: 1
41
- }, 8, ["wrapper"])) : createCommentVNode("v-if", true);
30
+ return toDisplayString(unref(asText)(__props.field) || __props.fallback || "");
42
31
  };
43
32
  }
44
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport Wrapper from \"./lib/Wrapper.vue\"\nimport { devMsg } from \"./lib/devMsg\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<PrismicText />`\n\t * is not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t<Wrapper v-if=\"isFilled.richText(field) || fallback\" :wrapper=\"wrapper\">\n\t\t{{ asText(field) || fallback }}\n\t</Wrapper>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,OACnR,yDACA,GACF;KAEC,EAAE,CAAA;;UAKU,MAAA,SAAQ,CAAC,SAAS,QAAA,MAAK,IAAK,QAAA,yBAA3C,YAEU,iBAAA;;IAF4C,SAAS,QAAA;;2BAC/B,iCAA5B,MAAA,OAAM,CAAC,QAAA,MAAK,IAAK,QAAA,SAAQ,EAAA,EAAA"}
1
+ {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,OACnR,yDACA,GACF;KAEC,EAAE,CAAA;;0BAKF,MAAA,OAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"SliceZone.cjs","names":[],"sources":["../../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport Wrapper from \"../lib/Wrapper.vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\n\tcomponents?: SliceZoneComponents\n\n\t/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t *\n\t * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<SliceZone />` is\n\t * not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst { options } = usePrismic()\n\nconst renderedSlices = computed(() => {\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is =\n\t\t\tprops.components?.[type] ||\n\t\t\tprops.defaultComponent ||\n\t\t\toptions.components?.sliceZoneDefaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<Wrapper v-if=\"slices\" :wrapper=\"wrapper\">\n\t\t<component\n\t\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t\t:is=\"renderedSlice.is\"\n\t\t\t:key=\"renderedSlice.key\"\n\t\t\tv-bind=\"renderedSlice.props\"\n\t\t/>\n\t</Wrapper>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SliceZone.cjs","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/** 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\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"SliceZone.js","names":[],"sources":["../../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport Wrapper from \"../lib/Wrapper.vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\n\tcomponents?: SliceZoneComponents\n\n\t/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t *\n\t * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<SliceZone />` is\n\t * not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst { options } = usePrismic()\n\nconst renderedSlices = computed(() => {\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is =\n\t\t\tprops.components?.[type] ||\n\t\t\tprops.defaultComponent ||\n\t\t\toptions.components?.sliceZoneDefaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<Wrapper v-if=\"slices\" :wrapper=\"wrapper\">\n\t\t<component\n\t\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t\t:is=\"renderedSlice.is\"\n\t\t\t:key=\"renderedSlice.key\"\n\t\t\tv-bind=\"renderedSlice.props\"\n\t\t/>\n\t</Wrapper>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"SliceZone.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/** 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\tif (!props.slices) return []\n\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is = props.components?.[type] || props.defaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t:is=\"renderedSlice.is\"\n\t\t:key=\"renderedSlice.key\"\n\t\tv-bind=\"renderedSlice.props\"\n\t/>\n</template>\n"],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  import { SliceComponentType, SliceLike, SliceZoneComponents, SliceZoneLike } from "./types.js";
2
- import { ComponentOrTagName } from "../types.js";
3
- import * as vue31 from "vue";
2
+ import * as vue26 from "vue";
4
3
 
5
4
  //#region src/SliceZone/SliceZone.vue.d.ts
6
5
 
@@ -10,38 +9,20 @@ import * as vue31 from "vue";
10
9
  * @typeParam TContext - Arbitrary data made available to all Slice components
11
10
  */
12
11
  type SliceZoneProps<TContext = unknown> = {
13
- /**
14
- * List of Slice data from the Slice Zone.
15
- */
12
+ /** List of slice data from the slice zone. */
16
13
  slices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>;
17
- /**
18
- * A record mapping Slice types to Vue components.
19
- */
14
+ /** A record mapping slice types to React components. */
20
15
  components?: SliceZoneComponents;
21
16
  /**
22
17
  * The Vue component rendered if a component mapping from the `components`
23
18
  * prop cannot be found.
24
- *
25
- * @remarks
26
- * Components will be rendered using the {@link SliceComponentProps} interface.
27
- *
28
- * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === "production"` else {@link TODOSliceComponent}.
29
19
  */
30
20
  defaultComponent?: SliceComponentType<any, TContext>;
31
- /**
32
- * Arbitrary data made available to all Slice components.
33
- */
21
+ /** Arbitrary data made available to all slice components. */
34
22
  context?: TContext;
35
- /**
36
- * An HTML tag name or a component used to wrap the output. `<SliceZone />` is
37
- * not wrapped by default.
38
- *
39
- * @defaultValue `"template"` (no wrapper)
40
- */
41
- wrapper?: ComponentOrTagName;
42
23
  };
43
24
  type __VLS_Props = SliceZoneProps;
44
- declare const __VLS_export: vue31.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue31.ComponentOptionsMixin, vue31.ComponentOptionsMixin, {}, string, vue31.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue31.ComponentProvideOptions, false, {}, any>;
25
+ declare const __VLS_export: vue26.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue26.ComponentOptionsMixin, vue26.ComponentOptionsMixin, {}, string, vue26.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue26.ComponentProvideOptions, false, {}, any>;
45
26
  declare const _default: typeof __VLS_export;
46
27
  //#endregion
47
28
  export { SliceZoneProps, _default };
@@ -1 +1 @@
1
- {"version":3,"file":"SliceZone.vue.d.ts","names":[],"sources":["../../../src/SliceZone/SliceZone.vue"],"sourcesContent":[],"mappings":";;;;;;;;;AAwIA;;AAIoC,KAJxB,cAIwB,CAAA,WAAA,OAAA,CAAA,GAAA;EAAY;;;EAiBJ,MAAA,EAjBnC,aAiBmC,CAjBrB,SAiBqB,GAAA,CAjBR,SAiBQ,GAjBI,MAiBJ,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,CAAA;EAAxB;;;EAaS,UAAA,CAAA,EAzBf,mBAyBe;EAGxB;AAA4B;;;;;;;;EA6Ff,gBAAA,CAAA,EA7GE,kBA6GF,CAAA,GAAA,EA7G0B,QA6G1B,CAAA;EAAA;;AAAA;YAxGP;;;;;;;YAQA;;KAGN,WAAA,GAAc;cA6Fb,cAAY,KAAA,CAAA,gBAAA,6BAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,eAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
1
+ {"version":3,"file":"SliceZone.vue.d.ts","names":[],"sources":["../../../src/SliceZone/SliceZone.vue"],"sourcesContent":[],"mappings":";;;;;;;;AAsGA;;AAEoC,KAFxB,cAEwB,CAAA,WAAA,OAAA,CAAA,GAAA;EAAY;EAAvC,MAAA,EAAA,aAAA,CAAc,SAAd,GAAA,CAA2B,SAA3B,GAAuC,MAAvC,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,CAAA;EAGK;EAO8B,UAAA,CAAA,EAP9B,mBAO8B;EAAxB;;;AAInB;EA2EK,gBAEJ,CAAA,EAjFkB,kBAiFlB,CAAA,GAAA,EAjF0C,QAiF1C,CAAA;EAFgB;EAAA,OAAA,CAAA,EA5EP,QA4EO;CAAA;KAzEb,WAAA,GAAc,cAyED;cAAZ,YAAY,EAAA,KAAA,CAAA,eAAA,CAAA,WAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,WAAA,EAAA,QAAA,CAAA,WAAA,CAAA,GAAA,QAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,uBAAA,EAAA,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;cAAA,QAAA,EAAA,OAGU,YAHV"}
@@ -1,5 +1,3 @@
1
- const require_Wrapper = require('../lib/Wrapper.cjs');
2
- const require_usePrismic = require('../usePrismic.cjs');
3
1
  const require_TODOSliceComponent = require('./TODOSliceComponent.cjs');
4
2
  let vue = require("vue");
5
3
 
@@ -24,20 +22,16 @@ var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
24
22
  context: {
25
23
  type: null,
26
24
  required: false
27
- },
28
- wrapper: {
29
- type: null,
30
- required: false
31
25
  }
32
26
  },
33
27
  setup(__props) {
34
28
  const props = __props;
35
- const { options } = require_usePrismic.usePrismic();
36
29
  const renderedSlices = (0, vue.computed)(() => {
30
+ if (!props.slices) return [];
37
31
  return props.slices.map((slice, index) => {
38
32
  const type = "slice_type" in slice ? slice.slice_type : slice.type;
39
33
  const key = "id" in slice && typeof slice.id === "string" ? slice.id : `${index}-${JSON.stringify(slice)}`;
40
- const is = props.components?.[type] || props.defaultComponent || options.components?.sliceZoneDefaultComponent;
34
+ const is = props.components?.[type] || props.defaultComponent;
41
35
  if (!is) return {
42
36
  is: require_TODOSliceComponent.TODOSliceComponent,
43
37
  key,
@@ -64,15 +58,9 @@ var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0,
64
58
  });
65
59
  });
66
60
  return (_ctx, _cache) => {
67
- return __props.slices ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_Wrapper.default, {
68
- key: 0,
69
- wrapper: __props.wrapper
70
- }, {
71
- default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(renderedSlices.value, (renderedSlice) => {
72
- return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(renderedSlice.is), (0, vue.mergeProps)({ key: renderedSlice.key }, { ref_for: true }, renderedSlice.props), null, 16);
73
- }), 128))]),
74
- _: 1
75
- }, 8, ["wrapper"])) : (0, vue.createCommentVNode)("v-if", true);
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);
76
64
  };
77
65
  }
78
66
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SliceZone.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport Wrapper from \"../lib/Wrapper.vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\n\tcomponents?: SliceZoneComponents\n\n\t/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t *\n\t * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<SliceZone />` is\n\t * not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst { options } = usePrismic()\n\nconst renderedSlices = computed(() => {\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is =\n\t\t\tprops.components?.[type] ||\n\t\t\tprops.defaultComponent ||\n\t\t\toptions.components?.sliceZoneDefaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<Wrapper v-if=\"slices\" :wrapper=\"wrapper\">\n\t\t<component\n\t\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t\t:is=\"renderedSlice.is\"\n\t\t\t:key=\"renderedSlice.key\"\n\t\t\tv-bind=\"renderedSlice.props\"\n\t\t/>\n\t</Wrapper>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DA,MAAM,QAAQ;EAGd,MAAM,EAAE,YAAY,+BAAW;EAE/B,MAAM,yCAAgC;AACrC,UAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OACL,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE9D,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAClC,MAAM,KACN,GAAG,MAAM,GAAG,KAAK,UAAU,MAAM;IAErC,MAAM,KACL,MAAM,aAAa,SACnB,MAAM,oBACN,QAAQ,YAAY;AAErB,QAAI,CAAC,GACJ,QAAO;KAAE,IAAI;KAAoB;KAAK,OAAO,EAAE,OAAO;KAAC;AAGxD,QAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;AAErC,YAAO;MAAE;MAAI;MAAK,OAAO;MAAY;;AAGtC,WAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;MACd;KACF;KACA;IACD;;UAIe,QAAA,qDAOL,yBAAA;;IAPc,SAAS,QAAA;;oCAEQ,wDAItC,cAAA,0BAJuB,eAAA,QAAjB,kBAAa;wFACf,cAAc,GAAE,sBAGpB,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
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 {\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\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCA,MAAM,QAAQ;EAGd,MAAM,yCAAgC;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;;gEASE,cAAA,0BAJuB,eAAA,QAAjB,kBAAa;uFACf,cAAc,GAAE,sBAGpB,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
@@ -1,7 +1,5 @@
1
- import Wrapper_default from "../lib/Wrapper.js";
2
- import { usePrismic } from "../usePrismic.js";
3
1
  import { TODOSliceComponent } from "./TODOSliceComponent.js";
4
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, withCtx } from "vue";
2
+ import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent } from "vue";
5
3
 
6
4
  //#region src/SliceZone/SliceZone.vue?vue&type=script&setup=true&lang.ts
7
5
  var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
@@ -24,20 +22,16 @@ var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
24
22
  context: {
25
23
  type: null,
26
24
  required: false
27
- },
28
- wrapper: {
29
- type: null,
30
- required: false
31
25
  }
32
26
  },
33
27
  setup(__props) {
34
28
  const props = __props;
35
- const { options } = usePrismic();
36
29
  const renderedSlices = computed(() => {
30
+ if (!props.slices) return [];
37
31
  return props.slices.map((slice, index) => {
38
32
  const type = "slice_type" in slice ? slice.slice_type : slice.type;
39
33
  const key = "id" in slice && typeof slice.id === "string" ? slice.id : `${index}-${JSON.stringify(slice)}`;
40
- const is = props.components?.[type] || props.defaultComponent || options.components?.sliceZoneDefaultComponent;
34
+ const is = props.components?.[type] || props.defaultComponent;
41
35
  if (!is) return {
42
36
  is: TODOSliceComponent,
43
37
  key,
@@ -64,15 +58,9 @@ var SliceZone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
64
58
  });
65
59
  });
66
60
  return (_ctx, _cache) => {
67
- return __props.slices ? (openBlock(), createBlock(Wrapper_default, {
68
- key: 0,
69
- wrapper: __props.wrapper
70
- }, {
71
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(renderedSlices.value, (renderedSlice) => {
72
- return openBlock(), createBlock(resolveDynamicComponent(renderedSlice.is), mergeProps({ key: renderedSlice.key }, { ref_for: true }, renderedSlice.props), null, 16);
73
- }), 128))]),
74
- _: 1
75
- }, 8, ["wrapper"])) : createCommentVNode("v-if", true);
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);
76
64
  };
77
65
  }
78
66
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SliceZone.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/SliceZone/SliceZone.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { computed } from \"vue\"\n\nimport Wrapper from \"../lib/Wrapper.vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n\tSliceZoneLike,\n} from \"./types\"\n\nimport { usePrismic } from \"../usePrismic\"\n\nimport { TODOSliceComponent } from \"./TODOSliceComponent\"\n\n/**\n * Props for `<SliceZone />`.\n *\n * @typeParam TContext - Arbitrary data made available to all Slice components\n */\nexport type SliceZoneProps<TContext = unknown> = {\n\t/**\n\t * List of Slice data from the Slice Zone.\n\t */\n\tslices: SliceZoneLike<SliceLike | (SliceLike & Record<string, unknown>)>\n\n\t/**\n\t * A record mapping Slice types to Vue components.\n\t */\n\tcomponents?: SliceZoneComponents\n\n\t/**\n\t * The Vue component rendered if a component mapping from the `components`\n\t * prop cannot be found.\n\t *\n\t * @remarks\n\t * Components will be rendered using the {@link SliceComponentProps} interface.\n\t *\n\t * @defaultValue The Slice Zone default component provided to `@prismicio/vue` plugin if configured, otherwise `null` when `process.env.NODE_ENV === \"production\"` else {@link TODOSliceComponent}.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdefaultComponent?: SliceComponentType<any, TContext>\n\n\t/**\n\t * Arbitrary data made available to all Slice components.\n\t */\n\tcontext?: TContext\n\n\t/**\n\t * An HTML tag name or a component used to wrap the output. `<SliceZone />` is\n\t * not wrapped by default.\n\t *\n\t * @defaultValue `\"template\"` (no wrapper)\n\t */\n\twrapper?: ComponentOrTagName\n}\n\nconst props = defineProps<SliceZoneProps>()\ndefineOptions({ name: \"SliceZone\" })\n\nconst { options } = usePrismic()\n\nconst renderedSlices = computed(() => {\n\treturn props.slices.map((slice, index) => {\n\t\tconst type =\n\t\t\t\"slice_type\" in slice ? (slice.slice_type as string) : slice.type\n\n\t\tconst key =\n\t\t\t\"id\" in slice && typeof slice.id === \"string\"\n\t\t\t\t? slice.id\n\t\t\t\t: `${index}-${JSON.stringify(slice)}`\n\n\t\tconst is =\n\t\t\tprops.components?.[type] ||\n\t\t\tprops.defaultComponent ||\n\t\t\toptions.components?.sliceZoneDefaultComponent\n\n\t\tif (!is) {\n\t\t\treturn { is: TODOSliceComponent, key, props: { slice } }\n\t\t}\n\n\t\tif (slice.__mapped) {\n\t\t\tconst { __mapped, ...mappedProps } = slice\n\n\t\t\treturn { is, key, props: mappedProps }\n\t\t}\n\n\t\treturn {\n\t\t\tis,\n\t\t\tkey,\n\t\t\tprops: {\n\t\t\t\tslice,\n\t\t\t\tindex,\n\t\t\t\tcontext: props.context,\n\t\t\t\tslices: props.slices,\n\t\t\t},\n\t\t}\n\t})\n})\n</script>\n\n<template>\n\t<Wrapper v-if=\"slices\" :wrapper=\"wrapper\">\n\t\t<component\n\t\t\tv-for=\"renderedSlice in renderedSlices\"\n\t\t\t:is=\"renderedSlice.is\"\n\t\t\t:key=\"renderedSlice.key\"\n\t\t\tv-bind=\"renderedSlice.props\"\n\t\t/>\n\t</Wrapper>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DA,MAAM,QAAQ;EAGd,MAAM,EAAE,YAAY,YAAW;EAE/B,MAAM,iBAAiB,eAAe;AACrC,UAAO,MAAM,OAAO,KAAK,OAAO,UAAU;IACzC,MAAM,OACL,gBAAgB,QAAS,MAAM,aAAwB,MAAM;IAE9D,MAAM,MACL,QAAQ,SAAS,OAAO,MAAM,OAAO,WAClC,MAAM,KACN,GAAG,MAAM,GAAG,KAAK,UAAU,MAAM;IAErC,MAAM,KACL,MAAM,aAAa,SACnB,MAAM,oBACN,QAAQ,YAAY;AAErB,QAAI,CAAC,GACJ,QAAO;KAAE,IAAI;KAAoB;KAAK,OAAO,EAAE,OAAO;KAAC;AAGxD,QAAI,MAAM,UAAU;KACnB,MAAM,EAAE,UAAU,GAAG,gBAAgB;AAErC,YAAO;MAAE;MAAI;MAAK,OAAO;MAAY;;AAGtC,WAAO;KACN;KACA;KACA,OAAO;MACN;MACA;MACA,SAAS,MAAM;MACf,QAAQ,MAAM;MACd;KACF;KACA;IACD;;UAIe,QAAA,uBAAf,YAOU,iBAAA;;IAPc,SAAS,QAAA;;2BAEQ,mBADxC,mBAKE,UAAA,MAAA,WAJuB,eAAA,QAAjB,kBAAa;yBADrB,YAKE,wBAHI,cAAc,GAAE,EAFtB,WAKE,EAFA,KAAK,cAAc,0BACZ,cAAc,MAAK,EAAA,MAAA,GAAA"}
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/** 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\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCA,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,9 @@
1
+
2
+ //#region src/types.ts
3
+ const isVueComponent = (component) => {
4
+ return !!component && (typeof component === "function" || typeof component === "object" && ("render" in component && typeof component.render === "function" || "setup" in component && typeof component.setup === "function" || "__file" in component && !!component.__file || "__name" in component && !!component.__name || "props" in component && typeof component.props === "object"));
5
+ };
6
+
7
+ //#endregion
8
+ exports.isVueComponent = isVueComponent;
9
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../src/types.ts"],"sourcesContent":["import type {\n\tConcreteComponent,\n\tDefineComponent,\n\tFunctionalComponent,\n\tRaw,\n\tdefineAsyncComponent,\n} from \"vue\"\n\nexport type ComponentOrTagName =\n\t| string\n\t| ConcreteComponent\n\t| Raw<DefineComponent>\n\nexport type VueComponent<TProps> =\n\t// For reference within TypeScript files when `*.vue` type cannot be inferred\n\t// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/no-explicit-any\n\t| DefineComponent<{}, {}, any>\n\t// Likewise, for reference with TypeScript files.\n\t| ReturnType<typeof defineAsyncComponent>\n\t| DefineComponent<TProps>\n\t| FunctionalComponent<TProps>\n\nexport const isVueComponent = <T>(\n\tcomponent: VueComponent<T> | unknown,\n): component is VueComponent<T> => {\n\treturn (\n\t\t!!component &&\n\t\t(typeof component === \"function\" ||\n\t\t\t(typeof component === \"object\" &&\n\t\t\t\t((\"render\" in component && typeof component.render === \"function\") ||\n\t\t\t\t\t(\"setup\" in component && typeof component.setup === \"function\") ||\n\t\t\t\t\t(\"__file\" in component && !!component.__file) ||\n\t\t\t\t\t(\"__name\" in component && !!component.__name) ||\n\t\t\t\t\t(\"props\" in component && typeof component.props === \"object\"))))\n\t)\n}\n"],"mappings":";;AAsBA,MAAa,kBACZ,cACkC;AAClC,QACC,CAAC,CAAC,cACD,OAAO,cAAc,cACpB,OAAO,cAAc,aACnB,YAAY,aAAa,OAAO,UAAU,WAAW,cACrD,WAAW,aAAa,OAAO,UAAU,UAAU,cACnD,YAAY,aAAa,CAAC,CAAC,UAAU,UACrC,YAAY,aAAa,CAAC,CAAC,UAAU,UACrC,WAAW,aAAa,OAAO,UAAU,UAAU"}