@prismicio/vue 5.2.1 → 5.3.0-canary.5d9ea4c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +3 -15
  2. package/dist/PrismicEmbed.vue.d.cts +25 -0
  3. package/dist/PrismicEmbed.vue.d.cts.map +1 -0
  4. package/dist/PrismicImage.vue.d.cts +301 -0
  5. package/dist/PrismicImage.vue.d.cts.map +1 -0
  6. package/dist/PrismicLink.vue.d.cts +282 -0
  7. package/dist/PrismicLink.vue.d.cts.map +1 -0
  8. package/dist/PrismicRichText/PrismicRichText.vue.d.cts +102 -0
  9. package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -0
  10. package/dist/PrismicRichText/getRichTextComponentProps.d.cts +54 -0
  11. package/dist/PrismicRichText/getRichTextComponentProps.d.cts.map +1 -0
  12. package/dist/PrismicRichText/types.d.cts +27 -0
  13. package/dist/PrismicRichText/types.d.cts.map +1 -0
  14. package/dist/PrismicTable/PrismicTable.vue.d.cts +38 -0
  15. package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -0
  16. package/dist/PrismicTable/getTableComponentProps.d.cts +136 -0
  17. package/dist/PrismicTable/getTableComponentProps.d.cts.map +1 -0
  18. package/dist/PrismicTable/types.d.cts +35 -0
  19. package/dist/PrismicTable/types.d.cts.map +1 -0
  20. package/dist/PrismicText.vue.d.cts +37 -0
  21. package/dist/PrismicText.vue.d.cts.map +1 -0
  22. package/dist/SliceZone/SliceZone.vue.d.cts +48 -0
  23. package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -0
  24. package/dist/SliceZone/TODOSliceComponent.d.cts +15 -0
  25. package/dist/SliceZone/TODOSliceComponent.d.cts.map +1 -0
  26. package/dist/SliceZone/defineSliceZoneComponents.d.cts +42 -0
  27. package/dist/SliceZone/defineSliceZoneComponents.d.cts.map +1 -0
  28. package/dist/SliceZone/getSliceComponentProps.d.cts +71 -0
  29. package/dist/SliceZone/getSliceComponentProps.d.cts.map +1 -0
  30. package/dist/SliceZone/types.d.cts +100 -0
  31. package/dist/SliceZone/types.d.cts.map +1 -0
  32. package/dist/_virtual/rolldown_runtime.cjs +19 -0
  33. package/dist/_virtual/rolldown_runtime.js +18 -0
  34. package/dist/createPrismic.d.cts +29 -0
  35. package/dist/createPrismic.d.cts.map +1 -0
  36. package/dist/index.cjs +35 -32
  37. package/dist/index.d.cts +18 -0
  38. package/dist/index.d.ts +21 -23
  39. package/dist/index.js +16 -32
  40. package/dist/package.cjs +12 -0
  41. package/dist/package.cjs.map +1 -0
  42. package/dist/package.js +6 -0
  43. package/dist/package.js.map +1 -0
  44. package/dist/src/PrismicEmbed.cjs +8 -0
  45. package/dist/src/PrismicEmbed.cjs.map +1 -0
  46. package/dist/src/PrismicEmbed.js +8 -0
  47. package/dist/src/PrismicEmbed.js.map +1 -0
  48. package/dist/src/PrismicEmbed.vue.d.ts +25 -0
  49. package/dist/src/PrismicEmbed.vue.d.ts.map +1 -0
  50. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs +42 -0
  51. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  52. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js +42 -0
  53. package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js.map +1 -0
  54. package/dist/src/PrismicImage.cjs +8 -0
  55. package/dist/src/PrismicImage.cjs.map +1 -0
  56. package/dist/src/PrismicImage.js +8 -0
  57. package/dist/src/PrismicImage.js.map +1 -0
  58. package/dist/src/PrismicImage.vue.d.ts +301 -0
  59. package/dist/src/PrismicImage.vue.d.ts.map +1 -0
  60. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +117 -0
  61. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  62. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js +117 -0
  63. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  64. package/dist/src/PrismicLink.cjs +8 -0
  65. package/dist/src/PrismicLink.cjs.map +1 -0
  66. package/dist/src/PrismicLink.js +8 -0
  67. package/dist/src/PrismicLink.js.map +1 -0
  68. package/dist/src/PrismicLink.vue.d.ts +282 -0
  69. package/dist/src/PrismicLink.vue.d.ts.map +1 -0
  70. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +86 -0
  71. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  72. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js +86 -0
  73. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
  74. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs +8 -0
  75. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs.map +1 -0
  76. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js +8 -0
  77. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js.map +1 -0
  78. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs +92 -0
  79. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  80. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js +92 -0
  81. package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -0
  82. package/dist/src/PrismicRichText/PrismicRichText.cjs +8 -0
  83. package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -0
  84. package/dist/src/PrismicRichText/PrismicRichText.js +8 -0
  85. package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -0
  86. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +102 -0
  87. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -0
  88. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +88 -0
  89. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  90. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +88 -0
  91. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -0
  92. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs +8 -0
  93. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -0
  94. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js +8 -0
  95. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -0
  96. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +103 -0
  97. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  98. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +103 -0
  99. package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -0
  100. package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs +8 -0
  101. package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -0
  102. package/dist/src/PrismicRichText/PrismicRichTextSerialize.js +8 -0
  103. package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -0
  104. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +60 -0
  105. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  106. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +60 -0
  107. package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -0
  108. package/dist/src/PrismicRichText/getRichTextComponentProps.cjs +40 -0
  109. package/dist/src/PrismicRichText/getRichTextComponentProps.cjs.map +1 -0
  110. package/dist/{PrismicRichText → src/PrismicRichText}/getRichTextComponentProps.d.ts +15 -10
  111. package/dist/src/PrismicRichText/getRichTextComponentProps.d.ts.map +1 -0
  112. package/dist/src/PrismicRichText/getRichTextComponentProps.js +39 -0
  113. package/dist/src/PrismicRichText/getRichTextComponentProps.js.map +1 -0
  114. package/dist/src/PrismicRichText/index.d.ts +2 -0
  115. package/dist/{PrismicRichText → src/PrismicRichText}/types.d.ts +11 -6
  116. package/dist/src/PrismicRichText/types.d.ts.map +1 -0
  117. package/dist/src/PrismicTable/PrismicTable.cjs +8 -0
  118. package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -0
  119. package/dist/src/PrismicTable/PrismicTable.js +8 -0
  120. package/dist/src/PrismicTable/PrismicTable.js.map +1 -0
  121. package/dist/src/PrismicTable/PrismicTable.vue.d.ts +39 -0
  122. package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -0
  123. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +65 -0
  124. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  125. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +65 -0
  126. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -0
  127. package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +46 -0
  128. package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -0
  129. package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +46 -0
  130. package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -0
  131. package/dist/src/PrismicTable/PrismicTableRow.cjs +8 -0
  132. package/dist/src/PrismicTable/PrismicTableRow.cjs.map +1 -0
  133. package/dist/src/PrismicTable/PrismicTableRow.js +8 -0
  134. package/dist/src/PrismicTable/PrismicTableRow.js.map +1 -0
  135. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +51 -0
  136. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  137. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +51 -0
  138. package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -0
  139. package/dist/src/PrismicTable/getTableComponentProps.cjs +140 -0
  140. package/dist/src/PrismicTable/getTableComponentProps.cjs.map +1 -0
  141. package/dist/{PrismicTable → src/PrismicTable}/getTableComponentProps.d.ts +40 -32
  142. package/dist/src/PrismicTable/getTableComponentProps.d.ts.map +1 -0
  143. package/dist/src/PrismicTable/getTableComponentProps.js +129 -0
  144. package/dist/src/PrismicTable/getTableComponentProps.js.map +1 -0
  145. package/dist/src/PrismicTable/index.d.ts +1 -0
  146. package/dist/src/PrismicTable/types.d.ts +35 -0
  147. package/dist/src/PrismicTable/types.d.ts.map +1 -0
  148. package/dist/src/PrismicText.cjs +8 -0
  149. package/dist/src/PrismicText.cjs.map +1 -0
  150. package/dist/src/PrismicText.js +8 -0
  151. package/dist/src/PrismicText.js.map +1 -0
  152. package/dist/src/PrismicText.vue.d.ts +37 -0
  153. package/dist/src/PrismicText.vue.d.ts.map +1 -0
  154. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +48 -0
  155. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  156. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js +48 -0
  157. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -0
  158. package/dist/src/SliceZone/SliceZone.cjs +8 -0
  159. package/dist/src/SliceZone/SliceZone.cjs.map +1 -0
  160. package/dist/src/SliceZone/SliceZone.js +8 -0
  161. package/dist/src/SliceZone/SliceZone.js.map +1 -0
  162. package/dist/src/SliceZone/SliceZone.vue.d.ts +48 -0
  163. package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -0
  164. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +82 -0
  165. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  166. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +82 -0
  167. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -0
  168. package/dist/src/SliceZone/TODOSliceComponent.cjs +36 -0
  169. package/dist/src/SliceZone/TODOSliceComponent.cjs.map +1 -0
  170. package/dist/src/SliceZone/TODOSliceComponent.d.ts +15 -0
  171. package/dist/src/SliceZone/TODOSliceComponent.d.ts.map +1 -0
  172. package/dist/src/SliceZone/TODOSliceComponent.js +36 -0
  173. package/dist/src/SliceZone/TODOSliceComponent.js.map +1 -0
  174. package/dist/src/SliceZone/defineSliceZoneComponents.cjs +50 -0
  175. package/dist/src/SliceZone/defineSliceZoneComponents.cjs.map +1 -0
  176. package/dist/{SliceZone → src/SliceZone}/defineSliceZoneComponents.d.ts +8 -2
  177. package/dist/src/SliceZone/defineSliceZoneComponents.d.ts.map +1 -0
  178. package/dist/src/SliceZone/defineSliceZoneComponents.js +50 -0
  179. package/dist/src/SliceZone/defineSliceZoneComponents.js.map +1 -0
  180. package/dist/src/SliceZone/getSliceComponentProps.cjs +60 -0
  181. package/dist/src/SliceZone/getSliceComponentProps.cjs.map +1 -0
  182. package/dist/{SliceZone → src/SliceZone}/getSliceComponentProps.d.ts +25 -20
  183. package/dist/src/SliceZone/getSliceComponentProps.d.ts.map +1 -0
  184. package/dist/src/SliceZone/getSliceComponentProps.js +59 -0
  185. package/dist/src/SliceZone/getSliceComponentProps.js.map +1 -0
  186. package/dist/src/SliceZone/index.d.ts +4 -0
  187. package/dist/{SliceZone → src/SliceZone}/types.d.ts +40 -37
  188. package/dist/src/SliceZone/types.d.ts.map +1 -0
  189. package/dist/src/createPrismic.cjs +85 -0
  190. package/dist/src/createPrismic.cjs.map +1 -0
  191. package/dist/src/createPrismic.d.ts +29 -0
  192. package/dist/src/createPrismic.d.ts.map +1 -0
  193. package/dist/src/createPrismic.js +85 -0
  194. package/dist/src/createPrismic.js.map +1 -0
  195. package/dist/src/lib/Wrapper.cjs +8 -0
  196. package/dist/src/lib/Wrapper.cjs.map +1 -0
  197. package/dist/src/lib/Wrapper.js +8 -0
  198. package/dist/src/lib/Wrapper.js.map +1 -0
  199. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs +22 -0
  200. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
  201. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js +22 -0
  202. package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js.map +1 -0
  203. package/dist/src/lib/devMsg.cjs +25 -0
  204. package/dist/src/lib/devMsg.cjs.map +1 -0
  205. package/dist/src/lib/devMsg.js +25 -0
  206. package/dist/src/lib/devMsg.js.map +1 -0
  207. package/dist/src/lib/isInternalURL.cjs +24 -0
  208. package/dist/src/lib/isInternalURL.cjs.map +1 -0
  209. package/dist/src/lib/isInternalURL.js +23 -0
  210. package/dist/src/lib/isInternalURL.js.map +1 -0
  211. package/dist/src/types.d.ts +357 -0
  212. package/dist/src/types.d.ts.map +1 -0
  213. package/dist/src/usePrismic.cjs +38 -0
  214. package/dist/src/usePrismic.cjs.map +1 -0
  215. package/dist/{usePrismic.d.ts → src/usePrismic.d.ts} +10 -4
  216. package/dist/src/usePrismic.d.ts.map +1 -0
  217. package/dist/src/usePrismic.js +37 -0
  218. package/dist/src/usePrismic.js.map +1 -0
  219. package/dist/types.d.cts +357 -0
  220. package/dist/types.d.cts.map +1 -0
  221. package/dist/usePrismic.d.cts +36 -0
  222. package/dist/usePrismic.d.cts.map +1 -0
  223. package/package.json +29 -53
  224. package/src/PrismicImage.vue +54 -1
  225. package/src/SliceZone/TODOSliceComponent.ts +2 -1
  226. package/src/index.ts +7 -17
  227. package/dist/PrismicEmbed.vue.cjs +0 -25
  228. package/dist/PrismicEmbed.vue.cjs.map +0 -1
  229. package/dist/PrismicEmbed.vue.d.ts +0 -19
  230. package/dist/PrismicEmbed.vue.js +0 -26
  231. package/dist/PrismicEmbed.vue.js.map +0 -1
  232. package/dist/PrismicEmbed.vue2.cjs +0 -4
  233. package/dist/PrismicEmbed.vue2.cjs.map +0 -1
  234. package/dist/PrismicEmbed.vue2.js +0 -5
  235. package/dist/PrismicEmbed.vue2.js.map +0 -1
  236. package/dist/PrismicImage.vue.cjs +0 -84
  237. package/dist/PrismicImage.vue.cjs.map +0 -1
  238. package/dist/PrismicImage.vue.d.ts +0 -224
  239. package/dist/PrismicImage.vue.js +0 -85
  240. package/dist/PrismicImage.vue.js.map +0 -1
  241. package/dist/PrismicImage.vue2.cjs +0 -4
  242. package/dist/PrismicImage.vue2.cjs.map +0 -1
  243. package/dist/PrismicImage.vue2.js +0 -5
  244. package/dist/PrismicImage.vue2.js.map +0 -1
  245. package/dist/PrismicLink.vue.cjs +0 -64
  246. package/dist/PrismicLink.vue.cjs.map +0 -1
  247. package/dist/PrismicLink.vue.d.ts +0 -279
  248. package/dist/PrismicLink.vue.js +0 -65
  249. package/dist/PrismicLink.vue.js.map +0 -1
  250. package/dist/PrismicLink.vue2.cjs +0 -4
  251. package/dist/PrismicLink.vue2.cjs.map +0 -1
  252. package/dist/PrismicLink.vue2.js +0 -5
  253. package/dist/PrismicLink.vue2.js.map +0 -1
  254. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs +0 -100
  255. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs.map +0 -1
  256. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.d.ts +0 -38
  257. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js +0 -101
  258. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js.map +0 -1
  259. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.cjs +0 -4
  260. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.cjs.map +0 -1
  261. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.js +0 -5
  262. package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.js.map +0 -1
  263. package/dist/PrismicRichText/PrismicRichText.vue.cjs +0 -97
  264. package/dist/PrismicRichText/PrismicRichText.vue.cjs.map +0 -1
  265. package/dist/PrismicRichText/PrismicRichText.vue.d.ts +0 -96
  266. package/dist/PrismicRichText/PrismicRichText.vue.js +0 -98
  267. package/dist/PrismicRichText/PrismicRichText.vue.js.map +0 -1
  268. package/dist/PrismicRichText/PrismicRichText.vue2.cjs +0 -4
  269. package/dist/PrismicRichText/PrismicRichText.vue2.cjs.map +0 -1
  270. package/dist/PrismicRichText/PrismicRichText.vue2.js +0 -5
  271. package/dist/PrismicRichText/PrismicRichText.vue2.js.map +0 -1
  272. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.cjs +0 -133
  273. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.cjs.map +0 -1
  274. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.d.ts +0 -37
  275. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.js +0 -134
  276. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.js.map +0 -1
  277. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.cjs +0 -4
  278. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.cjs.map +0 -1
  279. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.js +0 -5
  280. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.js.map +0 -1
  281. package/dist/PrismicRichText/PrismicRichTextSerialize.vue.cjs +0 -47
  282. package/dist/PrismicRichText/PrismicRichTextSerialize.vue.cjs.map +0 -1
  283. package/dist/PrismicRichText/PrismicRichTextSerialize.vue.d.ts +0 -10
  284. package/dist/PrismicRichText/PrismicRichTextSerialize.vue.js +0 -48
  285. package/dist/PrismicRichText/PrismicRichTextSerialize.vue.js.map +0 -1
  286. package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.cjs +0 -4
  287. package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.cjs.map +0 -1
  288. package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.js +0 -5
  289. package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.js.map +0 -1
  290. package/dist/PrismicRichText/getRichTextComponentProps.cjs +0 -10
  291. package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +0 -1
  292. package/dist/PrismicRichText/getRichTextComponentProps.js +0 -10
  293. package/dist/PrismicRichText/getRichTextComponentProps.js.map +0 -1
  294. package/dist/PrismicRichText/index.d.ts +0 -2
  295. package/dist/PrismicTable/PrismicTable.vue.cjs +0 -62
  296. package/dist/PrismicTable/PrismicTable.vue.cjs.map +0 -1
  297. package/dist/PrismicTable/PrismicTable.vue.d.ts +0 -32
  298. package/dist/PrismicTable/PrismicTable.vue.js +0 -63
  299. package/dist/PrismicTable/PrismicTable.vue.js.map +0 -1
  300. package/dist/PrismicTable/PrismicTable.vue2.cjs +0 -4
  301. package/dist/PrismicTable/PrismicTable.vue2.cjs.map +0 -1
  302. package/dist/PrismicTable/PrismicTable.vue2.js +0 -5
  303. package/dist/PrismicTable/PrismicTable.vue2.js.map +0 -1
  304. package/dist/PrismicTable/PrismicTableDefaultComponents.cjs +0 -44
  305. package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +0 -1
  306. package/dist/PrismicTable/PrismicTableDefaultComponents.d.ts +0 -2
  307. package/dist/PrismicTable/PrismicTableDefaultComponents.js +0 -44
  308. package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +0 -1
  309. package/dist/PrismicTable/PrismicTableRow.vue.cjs +0 -52
  310. package/dist/PrismicTable/PrismicTableRow.vue.cjs.map +0 -1
  311. package/dist/PrismicTable/PrismicTableRow.vue.d.ts +0 -26
  312. package/dist/PrismicTable/PrismicTableRow.vue.js +0 -53
  313. package/dist/PrismicTable/PrismicTableRow.vue.js.map +0 -1
  314. package/dist/PrismicTable/PrismicTableRow.vue2.cjs +0 -4
  315. package/dist/PrismicTable/PrismicTableRow.vue2.cjs.map +0 -1
  316. package/dist/PrismicTable/PrismicTableRow.vue2.js +0 -5
  317. package/dist/PrismicTable/PrismicTableRow.vue2.js.map +0 -1
  318. package/dist/PrismicTable/getTableComponentProps.cjs +0 -30
  319. package/dist/PrismicTable/getTableComponentProps.cjs.map +0 -1
  320. package/dist/PrismicTable/getTableComponentProps.js +0 -30
  321. package/dist/PrismicTable/getTableComponentProps.js.map +0 -1
  322. package/dist/PrismicTable/index.d.ts +0 -1
  323. package/dist/PrismicTable/types.d.ts +0 -30
  324. package/dist/PrismicText.vue.cjs +0 -43
  325. package/dist/PrismicText.vue.cjs.map +0 -1
  326. package/dist/PrismicText.vue.d.ts +0 -31
  327. package/dist/PrismicText.vue.js +0 -44
  328. package/dist/PrismicText.vue.js.map +0 -1
  329. package/dist/PrismicText.vue2.cjs +0 -4
  330. package/dist/PrismicText.vue2.cjs.map +0 -1
  331. package/dist/PrismicText.vue2.js +0 -5
  332. package/dist/PrismicText.vue2.js.map +0 -1
  333. package/dist/SliceZone/SliceZone.vue.cjs +0 -63
  334. package/dist/SliceZone/SliceZone.vue.cjs.map +0 -1
  335. package/dist/SliceZone/SliceZone.vue.d.ts +0 -41
  336. package/dist/SliceZone/SliceZone.vue.js +0 -64
  337. package/dist/SliceZone/SliceZone.vue.js.map +0 -1
  338. package/dist/SliceZone/SliceZone.vue2.cjs +0 -4
  339. package/dist/SliceZone/SliceZone.vue2.cjs.map +0 -1
  340. package/dist/SliceZone/SliceZone.vue2.js +0 -5
  341. package/dist/SliceZone/SliceZone.vue2.js.map +0 -1
  342. package/dist/SliceZone/TODOSliceComponent.cjs +0 -29
  343. package/dist/SliceZone/TODOSliceComponent.cjs.map +0 -1
  344. package/dist/SliceZone/TODOSliceComponent.d.ts +0 -9
  345. package/dist/SliceZone/TODOSliceComponent.js +0 -29
  346. package/dist/SliceZone/TODOSliceComponent.js.map +0 -1
  347. package/dist/SliceZone/defineSliceZoneComponents.cjs +0 -14
  348. package/dist/SliceZone/defineSliceZoneComponents.cjs.map +0 -1
  349. package/dist/SliceZone/defineSliceZoneComponents.js +0 -14
  350. package/dist/SliceZone/defineSliceZoneComponents.js.map +0 -1
  351. package/dist/SliceZone/getSliceComponentProps.cjs +0 -22
  352. package/dist/SliceZone/getSliceComponentProps.cjs.map +0 -1
  353. package/dist/SliceZone/getSliceComponentProps.js +0 -22
  354. package/dist/SliceZone/getSliceComponentProps.js.map +0 -1
  355. package/dist/SliceZone/index.d.ts +0 -4
  356. package/dist/createPrismic.cjs +0 -81
  357. package/dist/createPrismic.cjs.map +0 -1
  358. package/dist/createPrismic.d.ts +0 -22
  359. package/dist/createPrismic.js +0 -81
  360. package/dist/createPrismic.js.map +0 -1
  361. package/dist/index.cjs.map +0 -1
  362. package/dist/index.js.map +0 -1
  363. package/dist/lib/Wrapper.vue.cjs +0 -20
  364. package/dist/lib/Wrapper.vue.cjs.map +0 -1
  365. package/dist/lib/Wrapper.vue.d.ts +0 -28
  366. package/dist/lib/Wrapper.vue.js +0 -21
  367. package/dist/lib/Wrapper.vue.js.map +0 -1
  368. package/dist/lib/Wrapper.vue2.cjs +0 -4
  369. package/dist/lib/Wrapper.vue2.cjs.map +0 -1
  370. package/dist/lib/Wrapper.vue2.js +0 -5
  371. package/dist/lib/Wrapper.vue2.js.map +0 -1
  372. package/dist/lib/devMsg.cjs +0 -8
  373. package/dist/lib/devMsg.cjs.map +0 -1
  374. package/dist/lib/devMsg.d.ts +0 -16
  375. package/dist/lib/devMsg.js +0 -8
  376. package/dist/lib/devMsg.js.map +0 -1
  377. package/dist/lib/isInternalURL.cjs +0 -9
  378. package/dist/lib/isInternalURL.cjs.map +0 -1
  379. package/dist/lib/isInternalURL.d.ts +0 -8
  380. package/dist/lib/isInternalURL.js +0 -9
  381. package/dist/lib/isInternalURL.js.map +0 -1
  382. package/dist/package.json.cjs +0 -5
  383. package/dist/package.json.cjs.map +0 -1
  384. package/dist/package.json.js +0 -5
  385. package/dist/package.json.js.map +0 -1
  386. package/dist/types.d.ts +0 -369
  387. package/dist/usePrismic.cjs +0 -10
  388. package/dist/usePrismic.cjs.map +0 -1
  389. package/dist/usePrismic.js +0 -10
  390. package/dist/usePrismic.js.map +0 -1
@@ -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 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"}
@@ -0,0 +1,36 @@
1
+ let vue = require("vue");
2
+ let esm_env = require("esm-env");
3
+
4
+ //#region src/SliceZone/TODOSliceComponent.ts
5
+ /**
6
+ * This Slice component can be used as a reminder to provide a proper
7
+ * implementation.
8
+ *
9
+ * This is also the default Vue component rendered when a component mapping
10
+ * cannot be found in `<SliceZone />`.
11
+ */
12
+ const TODOSliceComponent = esm_env.DEV ? /* @__PURE__ */ (0, vue.defineComponent)({
13
+ name: "TODOSliceComponent",
14
+ props: { slice: {
15
+ type: Object,
16
+ required: true
17
+ } },
18
+ setup(props) {
19
+ const type = (0, vue.computed)(() => {
20
+ return "slice_type" in props.slice ? props.slice.slice_type : props.slice.type;
21
+ });
22
+ (0, vue.watchEffect)(() => {
23
+ console.warn(`[SliceZone] Could not find a component for Slice type "${type.value}"`, props.slice);
24
+ });
25
+ return () => {
26
+ return (0, vue.h)("section", {
27
+ "data-slice-zone-todo-component": "",
28
+ "data-slice-type": type.value
29
+ }, [`Could not find a component for Slice type "${type.value}"`]);
30
+ };
31
+ }
32
+ }) : (() => null);
33
+
34
+ //#endregion
35
+ exports.TODOSliceComponent = TODOSliceComponent;
36
+ //# sourceMappingURL=TODOSliceComponent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TODOSliceComponent.cjs","names":["DEV"],"sources":["../../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":["import { DEV } from \"esm-env\"\nimport { computed, defineComponent, h, watchEffect } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { SliceComponentType, SliceLike } from \"./types\"\n\n/**\n * This Slice component can be used as a reminder to provide a proper\n * implementation.\n *\n * This is also the default Vue component rendered when a component mapping\n * cannot be found in `<SliceZone />`.\n */\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const TODOSliceComponent = DEV\n\t? /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: {\n\t\t\t\tslice: {\n\t\t\t\t\ttype: Object as PropType<SliceLike>,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() => {\n\t\t\t\t\treturn \"slice_type\" in props.slice\n\t\t\t\t\t\t? props.slice.slice_type\n\t\t\t\t\t\t: props.slice.type\n\t\t\t\t})\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t},\n\t\t}) as SliceComponentType)\n\t: ((() => null) as SliceComponentType)\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,qBAAqBA,cAChB,yCAAgB;CAC/B,MAAM;CACN,OAAO,EACN,OAAO;EACN,MAAM;EACN,UAAU;EACV,EACD;CACD,MAAM,OAAO;EACZ,MAAM,+BAAsB;AAC3B,UAAO,gBAAgB,MAAM,QAC1B,MAAM,MAAM,aACZ,MAAM,MAAM;IACd;AAEF,6BAAkB;AACjB,WAAQ,KACP,0DAA0D,KAAK,MAAM,IACrE,MAAM,MACN;IACA;AAEF,eAAa;AACZ,qBACC,WACA;IACC,kCAAkC;IAClC,mBAAmB,KAAK;IACxB,EACD,CAAC,8CAA8C,KAAK,MAAM,GAAG,CAC7D;;;CAGH,CAAC,UACO"}
@@ -0,0 +1,15 @@
1
+ import { SliceComponentType } from "./types.js";
2
+
3
+ //#region src/SliceZone/TODOSliceComponent.d.ts
4
+
5
+ /**
6
+ * This Slice component can be used as a reminder to provide a proper
7
+ * implementation.
8
+ *
9
+ * This is also the default Vue component rendered when a component mapping
10
+ * cannot be found in `<SliceZone />`.
11
+ */
12
+ declare const TODOSliceComponent: SliceComponentType;
13
+ //#endregion
14
+ export { TODOSliceComponent };
15
+ //# sourceMappingURL=TODOSliceComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TODOSliceComponent.d.ts","names":[],"sources":["../../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;;;;;cAAa,oBAAkB"}
@@ -0,0 +1,36 @@
1
+ import { computed, defineComponent, h, watchEffect } from "vue";
2
+ import { DEV } from "esm-env";
3
+
4
+ //#region src/SliceZone/TODOSliceComponent.ts
5
+ /**
6
+ * This Slice component can be used as a reminder to provide a proper
7
+ * implementation.
8
+ *
9
+ * This is also the default Vue component rendered when a component mapping
10
+ * cannot be found in `<SliceZone />`.
11
+ */
12
+ const TODOSliceComponent = DEV ? /* @__PURE__ */ defineComponent({
13
+ name: "TODOSliceComponent",
14
+ props: { slice: {
15
+ type: Object,
16
+ required: true
17
+ } },
18
+ setup(props) {
19
+ const type = computed(() => {
20
+ return "slice_type" in props.slice ? props.slice.slice_type : props.slice.type;
21
+ });
22
+ watchEffect(() => {
23
+ console.warn(`[SliceZone] Could not find a component for Slice type "${type.value}"`, props.slice);
24
+ });
25
+ return () => {
26
+ return h("section", {
27
+ "data-slice-zone-todo-component": "",
28
+ "data-slice-type": type.value
29
+ }, [`Could not find a component for Slice type "${type.value}"`]);
30
+ };
31
+ }
32
+ }) : (() => null);
33
+
34
+ //#endregion
35
+ export { TODOSliceComponent };
36
+ //# sourceMappingURL=TODOSliceComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TODOSliceComponent.js","names":[],"sources":["../../../src/SliceZone/TODOSliceComponent.ts"],"sourcesContent":["import { DEV } from \"esm-env\"\nimport { computed, defineComponent, h, watchEffect } from \"vue\"\nimport type { PropType } from \"vue\"\n\nimport type { SliceComponentType, SliceLike } from \"./types\"\n\n/**\n * This Slice component can be used as a reminder to provide a proper\n * implementation.\n *\n * This is also the default Vue component rendered when a component mapping\n * cannot be found in `<SliceZone />`.\n */\n// oxlint-disable-next-line explicit-module-boundary-types\nexport const TODOSliceComponent = DEV\n\t? /*#__PURE__*/ (defineComponent({\n\t\t\tname: \"TODOSliceComponent\",\n\t\t\tprops: {\n\t\t\t\tslice: {\n\t\t\t\t\ttype: Object as PropType<SliceLike>,\n\t\t\t\t\trequired: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsetup(props) {\n\t\t\t\tconst type = computed(() => {\n\t\t\t\t\treturn \"slice_type\" in props.slice\n\t\t\t\t\t\t? props.slice.slice_type\n\t\t\t\t\t\t: props.slice.type\n\t\t\t\t})\n\n\t\t\t\twatchEffect(() => {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`[SliceZone] Could not find a component for Slice type \"${type.value}\"`,\n\t\t\t\t\t\tprops.slice,\n\t\t\t\t\t)\n\t\t\t\t})\n\n\t\t\t\treturn () => {\n\t\t\t\t\treturn h(\n\t\t\t\t\t\t\"section\",\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"data-slice-zone-todo-component\": \"\",\n\t\t\t\t\t\t\t\"data-slice-type\": type.value,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t[`Could not find a component for Slice type \"${type.value}\"`],\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t},\n\t\t}) as SliceComponentType)\n\t: ((() => null) as SliceComponentType)\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,qBAAqB,MAChB,gCAAgB;CAC/B,MAAM;CACN,OAAO,EACN,OAAO;EACN,MAAM;EACN,UAAU;EACV,EACD;CACD,MAAM,OAAO;EACZ,MAAM,OAAO,eAAe;AAC3B,UAAO,gBAAgB,MAAM,QAC1B,MAAM,MAAM,aACZ,MAAM,MAAM;IACd;AAEF,oBAAkB;AACjB,WAAQ,KACP,0DAA0D,KAAK,MAAM,IACrE,MAAM,MACN;IACA;AAEF,eAAa;AACZ,UAAO,EACN,WACA;IACC,kCAAkC;IAClC,mBAAmB,KAAK;IACxB,EACD,CAAC,8CAA8C,KAAK,MAAM,GAAG,CAC7D;;;CAGH,CAAC,UACO"}
@@ -0,0 +1,50 @@
1
+ let vue = require("vue");
2
+
3
+ //#region src/SliceZone/defineSliceZoneComponents.ts
4
+ /**
5
+ * Gets an optimized record of Slice types mapped to Vue components. Each
6
+ * components will be rendered for each instance of their Slice type.
7
+ *
8
+ * @remarks
9
+ * This is essentially an helper function to ensure {@link markRaw} is correctly
10
+ * applied on each components, improving performances.
11
+ *
12
+ * @example
13
+ *
14
+ * ```javascript
15
+ * // Defining a slice components
16
+ * import { defineSliceZoneComponents } from "@prismicio/vue";
17
+ *
18
+ * export default {
19
+ * data() {
20
+ * components: defineSliceZoneComponents({
21
+ * foo: Foo,
22
+ * bar: defineAsyncComponent(
23
+ * () => new Promise((res) => res(Bar)),
24
+ * ),
25
+ * baz: "Baz",
26
+ * }),
27
+ * }
28
+ * };
29
+ * ```
30
+ *
31
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
32
+ * @typeParam TContext - Arbitrary data made available to all Slice components
33
+ *
34
+ * @param components - {@link SliceZoneComponents}
35
+ *
36
+ * @returns A new optimized record of {@link SliceZoneComponents}
37
+ */
38
+ const defineSliceZoneComponents = (components) => {
39
+ const result = {};
40
+ let type;
41
+ for (type in components) {
42
+ const component = components[type];
43
+ result[type] = typeof component === "string" ? component : (0, vue.markRaw)(component);
44
+ }
45
+ return result;
46
+ };
47
+
48
+ //#endregion
49
+ exports.defineSliceZoneComponents = defineSliceZoneComponents;
50
+ //# sourceMappingURL=defineSliceZoneComponents.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineSliceZoneComponents.cjs","names":["type: keyof typeof components"],"sources":["../../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n} from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n *\n * @example\n *\n * ```javascript\n * // Defining a slice components\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n *\n * @param components - {@link SliceZoneComponents}\n *\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,EAAE;CAEjB,IAAIA;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,6BAEA,UAIA;;AAGL,QAAO"}
@@ -1,4 +1,7 @@
1
- import type { SliceLike, SliceZoneComponents } from "./types";
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
- export declare const defineSliceZoneComponents: <TSlice extends SliceLike = any, TContext = unknown>(components: SliceZoneComponents<TSlice, TContext>) => SliceZoneComponents<TSlice, TContext>;
39
+ declare const defineSliceZoneComponents: <TSlice extends SliceLike = any, TContext = unknown>(components: SliceZoneComponents<TSlice, TContext>) => SliceZoneComponents<TSlice, TContext>;
40
+ //#endregion
41
+ export { defineSliceZoneComponents };
42
+ //# sourceMappingURL=defineSliceZoneComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineSliceZoneComponents.d.ts","names":[],"sources":["../../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":[],"mappings":";;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,2CAEG,iDAGH,oBAAoB,QAAQ,cACtC,oBAAoB,QAAQ"}
@@ -0,0 +1,50 @@
1
+ import { markRaw } from "vue";
2
+
3
+ //#region src/SliceZone/defineSliceZoneComponents.ts
4
+ /**
5
+ * Gets an optimized record of Slice types mapped to Vue components. Each
6
+ * components will be rendered for each instance of their Slice type.
7
+ *
8
+ * @remarks
9
+ * This is essentially an helper function to ensure {@link markRaw} is correctly
10
+ * applied on each components, improving performances.
11
+ *
12
+ * @example
13
+ *
14
+ * ```javascript
15
+ * // Defining a slice components
16
+ * import { defineSliceZoneComponents } from "@prismicio/vue";
17
+ *
18
+ * export default {
19
+ * data() {
20
+ * components: defineSliceZoneComponents({
21
+ * foo: Foo,
22
+ * bar: defineAsyncComponent(
23
+ * () => new Promise((res) => res(Bar)),
24
+ * ),
25
+ * baz: "Baz",
26
+ * }),
27
+ * }
28
+ * };
29
+ * ```
30
+ *
31
+ * @typeParam TSlice - The type(s) of slices in the Slice Zone
32
+ * @typeParam TContext - Arbitrary data made available to all Slice components
33
+ *
34
+ * @param components - {@link SliceZoneComponents}
35
+ *
36
+ * @returns A new optimized record of {@link SliceZoneComponents}
37
+ */
38
+ const defineSliceZoneComponents = (components) => {
39
+ const result = {};
40
+ let type;
41
+ for (type in components) {
42
+ const component = components[type];
43
+ result[type] = typeof component === "string" ? component : markRaw(component);
44
+ }
45
+ return result;
46
+ };
47
+
48
+ //#endregion
49
+ export { defineSliceZoneComponents };
50
+ //# sourceMappingURL=defineSliceZoneComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineSliceZoneComponents.js","names":["type: keyof typeof components"],"sources":["../../../src/SliceZone/defineSliceZoneComponents.ts"],"sourcesContent":["import { markRaw } from \"vue\"\n\nimport type {\n\tSliceComponentType,\n\tSliceLike,\n\tSliceZoneComponents,\n} from \"./types\"\n\n/**\n * Gets an optimized record of Slice types mapped to Vue components. Each\n * components will be rendered for each instance of their Slice type.\n *\n * @remarks\n * This is essentially an helper function to ensure {@link markRaw} is correctly\n * applied on each components, improving performances.\n *\n * @example\n *\n * ```javascript\n * // Defining a slice components\n * import { defineSliceZoneComponents } from \"@prismicio/vue\";\n *\n * export default {\n * data() {\n * components: defineSliceZoneComponents({\n * foo: Foo,\n * bar: defineAsyncComponent(\n * () => new Promise((res) => res(Bar)),\n * ),\n * baz: \"Baz\",\n * }),\n * }\n * };\n * ```\n *\n * @typeParam TSlice - The type(s) of slices in the Slice Zone\n * @typeParam TContext - Arbitrary data made available to all Slice components\n *\n * @param components - {@link SliceZoneComponents}\n *\n * @returns A new optimized record of {@link SliceZoneComponents}\n */\nexport const defineSliceZoneComponents = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\tcomponents: SliceZoneComponents<TSlice, TContext>,\n): SliceZoneComponents<TSlice, TContext> => {\n\tconst result = {} as SliceZoneComponents<TSlice, TContext>\n\n\tlet type: keyof typeof components\n\tfor (type in components) {\n\t\tconst component = components[type]\n\t\tresult[type] =\n\t\t\ttypeof component === \"string\"\n\t\t\t\t? component\n\t\t\t\t: markRaw(\n\t\t\t\t\t\tcomponent as SliceComponentType<\n\t\t\t\t\t\t\tExtract<TSlice, SliceLike<typeof type>>,\n\t\t\t\t\t\t\tTContext\n\t\t\t\t\t\t>,\n\t\t\t\t\t)\n\t}\n\n\treturn result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAa,6BAKZ,eAC2C;CAC3C,MAAM,SAAS,EAAE;CAEjB,IAAIA;AACJ,MAAK,QAAQ,YAAY;EACxB,MAAM,YAAY,WAAW;AAC7B,SAAO,QACN,OAAO,cAAc,WAClB,YACA,QACA,UAIA;;AAGL,QAAO"}
@@ -0,0 +1,60 @@
1
+
2
+ //#region src/SliceZone/getSliceComponentProps.ts
3
+ /**
4
+ * Gets native Vue props for a component rendering content from a Prismic Slice
5
+ * using the `<SliceZone />` component.
6
+ *
7
+ * Props are: `["slice", "index", "slices", "context"]`
8
+ *
9
+ * @example
10
+ *
11
+ * ```typescript
12
+ * // Defining a new slice component
13
+ * import { getSliceComponentProps } from "@prismicio/vue"
14
+ *
15
+ * defineProps(getSliceComponentProps())
16
+ * ```
17
+ *
18
+ * @example
19
+ *
20
+ * ```typescript
21
+ * // Defining a new slice component with visual hint
22
+ * import { getSliceComponentProps } from "@prismicio/vue"
23
+ *
24
+ * defineProps(
25
+ * getSliceComponentProps(["slice", "index", "slices", "context"]),
26
+ * )
27
+ * ```
28
+ *
29
+ * @typeParam TSlice - The Slice type
30
+ * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
31
+ * available to all Slice components
32
+ *
33
+ * @param propsHint - An optional array of prop names used for the sole purpose
34
+ * of having a visual hint of which props are made available to the slice,
35
+ * this parameters doesn't have any effect
36
+ *
37
+ * @returns Props object to use with `defineProps()`
38
+ */
39
+ const getSliceComponentProps = (propsHint) => ({
40
+ slice: {
41
+ type: Object,
42
+ required: true
43
+ },
44
+ index: {
45
+ type: Number,
46
+ required: true
47
+ },
48
+ slices: {
49
+ type: Array,
50
+ required: true
51
+ },
52
+ context: {
53
+ type: null,
54
+ required: true
55
+ }
56
+ });
57
+
58
+ //#endregion
59
+ exports.getSliceComponentProps = getSliceComponentProps;
60
+ //# sourceMappingURL=getSliceComponentProps.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSliceComponentProps.cjs","names":[],"sources":["../../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":["import type { PropType } from \"vue\"\n\nimport type { SliceComponentProps, SliceLike } from \"./types\"\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using\n * the `<SliceZone />` component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n */\ntype DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>\n\t\trequired: true\n\t}\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>\n\t\trequired: true\n\t}\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>\n\t\trequired: true\n\t}\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice\n * using the `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getSliceComponentProps())\n * ```\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component with visual hint\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(\n * \tgetSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n * )\n * ```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n *\n * @param propsHint - An optional array of prop names used for the sole purpose\n * of having a visual hint of which props are made available to the slice,\n * this parameters doesn't have any effect\n *\n * @returns Props object to use with `defineProps()`\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<\n\t\t\tSliceComponentProps<TSlice, TContext>[\"context\"]\n\t\t>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,QAAQ;EACP,MAAM;EACN,UAAU;EACV;CACD,SAAS;EACR,MAAM;EAGN,UAAU;EACV;CACD"}
@@ -1,5 +1,8 @@
1
- import type { PropType } from "vue";
2
- import type { SliceComponentProps, SliceLike } from "./types";
1
+ import { SliceComponentProps, SliceLike } from "./types.js";
2
+ import { PropType } from "vue";
3
+
4
+ //#region src/SliceZone/getSliceComponentProps.d.ts
5
+
3
6
  /**
4
7
  * Native Vue props for a component rendering content from a Prismic Slice using
5
8
  * the `<SliceZone />` component.
@@ -9,22 +12,22 @@ import type { SliceComponentProps, SliceLike } from "./types";
9
12
  * available to all Slice components
10
13
  */
11
14
  type DefineComponentSliceComponentProps<TSlice extends SliceLike = any, TContext = unknown> = {
12
- slice: {
13
- type: PropType<SliceComponentProps<TSlice, TContext>["slice"]>;
14
- required: true;
15
- };
16
- index: {
17
- type: PropType<SliceComponentProps<TSlice, TContext>["index"]>;
18
- required: true;
19
- };
20
- slices: {
21
- type: PropType<SliceComponentProps<TSlice, TContext>["slices"]>;
22
- required: true;
23
- };
24
- context: {
25
- type: PropType<SliceComponentProps<TSlice, TContext>["context"]>;
26
- required: true;
27
- };
15
+ slice: {
16
+ type: PropType<SliceComponentProps<TSlice, TContext>["slice"]>;
17
+ required: true;
18
+ };
19
+ index: {
20
+ type: PropType<SliceComponentProps<TSlice, TContext>["index"]>;
21
+ required: true;
22
+ };
23
+ slices: {
24
+ type: PropType<SliceComponentProps<TSlice, TContext>["slices"]>;
25
+ required: true;
26
+ };
27
+ context: {
28
+ type: PropType<SliceComponentProps<TSlice, TContext>["context"]>;
29
+ required: true;
30
+ };
28
31
  };
29
32
  /**
30
33
  * Gets native Vue props for a component rendering content from a Prismic Slice
@@ -62,5 +65,7 @@ type DefineComponentSliceComponentProps<TSlice extends SliceLike = any, TContext
62
65
  *
63
66
  * @returns Props object to use with `defineProps()`
64
67
  */
65
- export declare const getSliceComponentProps: <TSlice extends SliceLike = any, TContext = unknown>(propsHint?: ["slice", "index", "slices", "context"]) => DefineComponentSliceComponentProps<TSlice, TContext>;
66
- export {};
68
+ declare const getSliceComponentProps: <TSlice extends SliceLike = any, TContext = unknown>(propsHint?: ["slice", "index", "slices", "context"]) => DefineComponentSliceComponentProps<TSlice, TContext>;
69
+ //#endregion
70
+ export { getSliceComponentProps };
71
+ //# sourceMappingURL=getSliceComponentProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSliceComponentProps.d.ts","names":[],"sources":["../../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":[],"mappings":";;;;;;;AAE6D;;;;;;KAUxD,kCAUgC,CAAA,eARrB,SAQqB,GAAA,GAAA,EAAA,WAAA,OAAA,CAAA,GAAA;EAAQ,KAAA,EAAA;IAA5B,IAAA,EAJT,QAIS,CAJA,mBAIA,CAJoB,MAIpB,EAJ4B,QAI5B,CAAA,CAAA,OAAA,CAAA,CAAA;IAAT,QAAA,EAAA,IAAA;EAI6B,CAAA;EAAQ,KAAA,EAAA;IAA5B,IAAA,EAJT,QAIS,CAJA,mBAIA,CAJoB,MAIpB,EAJ4B,QAI5B,CAAA,CAAA,OAAA,CAAA,CAAA;IAAT,QAAA,EAAA,IAAA;EAI6B,CAAA;EAAQ,MAAA,EAAA;IAA5B,IAAA,EAJT,QAIS,CAJA,mBAIA,CAJoB,MAIpB,EAJ4B,QAI5B,CAAA,CAAA,QAAA,CAAA,CAAA;IAAT,QAAA,EAAA,IAAA;EAAQ,CAAA;EAyCH,OAAA,EAAA;IAEG,IAAA,EA3CR,QA2CQ,CA3CC,mBA2CD,CA3CqB,MA2CrB,EA3C6B,QA2C7B,CAAA,CAAA,SAAA,CAAA,CAAA;IAKsB,QAAA,EAAA,IAAA;EAAQ,CAAA;CAA3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAPU,wCAEG,6FAKb,mCAAmC,QAAQ"}
@@ -0,0 +1,59 @@
1
+ //#region src/SliceZone/getSliceComponentProps.ts
2
+ /**
3
+ * Gets native Vue props for a component rendering content from a Prismic Slice
4
+ * using the `<SliceZone />` component.
5
+ *
6
+ * Props are: `["slice", "index", "slices", "context"]`
7
+ *
8
+ * @example
9
+ *
10
+ * ```typescript
11
+ * // Defining a new slice component
12
+ * import { getSliceComponentProps } from "@prismicio/vue"
13
+ *
14
+ * defineProps(getSliceComponentProps())
15
+ * ```
16
+ *
17
+ * @example
18
+ *
19
+ * ```typescript
20
+ * // Defining a new slice component with visual hint
21
+ * import { getSliceComponentProps } from "@prismicio/vue"
22
+ *
23
+ * defineProps(
24
+ * getSliceComponentProps(["slice", "index", "slices", "context"]),
25
+ * )
26
+ * ```
27
+ *
28
+ * @typeParam TSlice - The Slice type
29
+ * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
30
+ * available to all Slice components
31
+ *
32
+ * @param propsHint - An optional array of prop names used for the sole purpose
33
+ * of having a visual hint of which props are made available to the slice,
34
+ * this parameters doesn't have any effect
35
+ *
36
+ * @returns Props object to use with `defineProps()`
37
+ */
38
+ const getSliceComponentProps = (propsHint) => ({
39
+ slice: {
40
+ type: Object,
41
+ required: true
42
+ },
43
+ index: {
44
+ type: Number,
45
+ required: true
46
+ },
47
+ slices: {
48
+ type: Array,
49
+ required: true
50
+ },
51
+ context: {
52
+ type: null,
53
+ required: true
54
+ }
55
+ });
56
+
57
+ //#endregion
58
+ export { getSliceComponentProps };
59
+ //# sourceMappingURL=getSliceComponentProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSliceComponentProps.js","names":[],"sources":["../../../src/SliceZone/getSliceComponentProps.ts"],"sourcesContent":["import type { PropType } from \"vue\"\n\nimport type { SliceComponentProps, SliceLike } from \"./types\"\n\n/**\n * Native Vue props for a component rendering content from a Prismic Slice using\n * the `<SliceZone />` component.\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n */\ntype DefineComponentSliceComponentProps<\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n> = {\n\tslice: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>\n\t\trequired: true\n\t}\n\tindex: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>\n\t\trequired: true\n\t}\n\tslices: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>\n\t\trequired: true\n\t}\n\tcontext: {\n\t\ttype: PropType<SliceComponentProps<TSlice, TContext>[\"context\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering content from a Prismic Slice\n * using the `<SliceZone />` component.\n *\n * Props are: `[\"slice\", \"index\", \"slices\", \"context\"]`\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(getSliceComponentProps())\n * ```\n *\n * @example\n *\n * ```typescript\n * // Defining a new slice component with visual hint\n * import { getSliceComponentProps } from \"@prismicio/vue\"\n *\n * defineProps(\n * \tgetSliceComponentProps([\"slice\", \"index\", \"slices\", \"context\"]),\n * )\n * ```\n *\n * @typeParam TSlice - The Slice type\n * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made\n * available to all Slice components\n *\n * @param propsHint - An optional array of prop names used for the sole purpose\n * of having a visual hint of which props are made available to the slice,\n * this parameters doesn't have any effect\n *\n * @returns Props object to use with `defineProps()`\n */\nexport const getSliceComponentProps = <\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTSlice extends SliceLike = any,\n\tTContext = unknown,\n>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tpropsHint?: [\"slice\", \"index\", \"slices\", \"context\"],\n): DefineComponentSliceComponentProps<TSlice, TContext> => ({\n\tslice: {\n\t\ttype: Object as PropType<SliceComponentProps<TSlice, TContext>[\"slice\"]>,\n\t\trequired: true,\n\t},\n\tindex: {\n\t\ttype: Number as PropType<SliceComponentProps<TSlice, TContext>[\"index\"]>,\n\t\trequired: true,\n\t},\n\tslices: {\n\t\ttype: Array as PropType<SliceComponentProps<TSlice, TContext>[\"slices\"]>,\n\t\trequired: true,\n\t},\n\tcontext: {\n\t\ttype: null as unknown as PropType<\n\t\t\tSliceComponentProps<TSlice, TContext>[\"context\"]\n\t\t>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,0BAMZ,eAC2D;CAC3D,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,OAAO;EACN,MAAM;EACN,UAAU;EACV;CACD,QAAQ;EACP,MAAM;EACN,UAAU;EACV;CACD,SAAS;EACR,MAAM;EAGN,UAAU;EACV;CACD"}
@@ -0,0 +1,4 @@
1
+ import { SliceComponentProps, SliceComponentType, SliceLike, SliceLikeGraphQL, SliceLikeRestV2, SliceZoneComponents, SliceZoneLike } from "./types.js";
2
+ import { TODOSliceComponent } from "./TODOSliceComponent.js";
3
+ import { getSliceComponentProps } from "./getSliceComponentProps.js";
4
+ import { defineSliceZoneComponents } from "./defineSliceZoneComponents.js";
@@ -1,5 +1,8 @@
1
- import type { Slice } from "@prismicio/client";
2
- import type { DefineComponent, FunctionalComponent, defineAsyncComponent } from "vue";
1
+ import { DefineComponent, FunctionalComponent, defineAsyncComponent } from "vue";
2
+ import { Slice } from "@prismicio/client";
3
+
4
+ //#region src/SliceZone/types.d.ts
5
+
3
6
  /**
4
7
  * Returns the type of a `SliceLike` type.
5
8
  *
@@ -12,15 +15,15 @@ type ExtractSliceType<TSlice extends SliceLike> = TSlice extends SliceLikeRestV2
12
15
  *
13
16
  * @typeParam SliceType - Type name of the Slice.
14
17
  */
15
- export type SliceLikeRestV2<TSliceType extends string = string> = Pick<Slice<TSliceType>, "id" | "slice_type">;
18
+ type SliceLikeRestV2<TSliceType extends string = string> = Pick<Slice<TSliceType>, "id" | "slice_type">;
16
19
  /**
17
20
  * The minimum required properties to represent a Prismic Slice from the Prismic
18
21
  * GraphQL API for the `unstable_mapSliceZone()` helper.
19
22
  *
20
23
  * @typeParam SliceType - Type name of the Slice.
21
24
  */
22
- export type SliceLikeGraphQL<TSliceType extends string = string> = {
23
- type: Slice<TSliceType>["slice_type"];
25
+ type SliceLikeGraphQL<TSliceType extends string = string> = {
26
+ type: Slice<TSliceType>["slice_type"];
24
27
  };
25
28
  /**
26
29
  * The minimum required properties to represent a Prismic Slice for the
@@ -31,14 +34,14 @@ export type SliceLikeGraphQL<TSliceType extends string = string> = {
31
34
  *
32
35
  * @typeParam TSliceType - Type name of the Slice
33
36
  */
34
- export type SliceLike<TSliceType extends string = string> = (SliceLikeRestV2<TSliceType> | SliceLikeGraphQL<TSliceType>) & {
35
- /**
36
- * If `true`, this Slice has been modified from its original value using a
37
- * mapper and `@prismicio/client`'s `mapSliceZone()`.
38
- *
39
- * @internal
40
- */
41
- __mapped?: true;
37
+ type SliceLike<TSliceType extends string = string> = (SliceLikeRestV2<TSliceType> | SliceLikeGraphQL<TSliceType>) & {
38
+ /**
39
+ * If `true`, this Slice has been modified from its original value using a
40
+ * mapper and `@prismicio/client`'s `mapSliceZone()`.
41
+ *
42
+ * @internal
43
+ */
44
+ __mapped?: true;
42
45
  };
43
46
  /**
44
47
  * A looser version of the `SliceZone` type from `@prismicio/client` using
@@ -49,7 +52,7 @@ export type SliceLike<TSliceType extends string = string> = (SliceLikeRestV2<TSl
49
52
  *
50
53
  * @typeParam TSlice - The type(s) of slices in the Slice Zone
51
54
  */
52
- export type SliceZoneLike<TSlice extends SliceLike = SliceLike> = readonly TSlice[];
55
+ type SliceZoneLike<TSlice extends SliceLike = SliceLike> = readonly TSlice[];
53
56
  /**
54
57
  * Vue props for a component rendering content from a Prismic Slice using the
55
58
  * `<SliceZone />` component.
@@ -58,24 +61,24 @@ export type SliceZoneLike<TSlice extends SliceLike = SliceLike> = readonly TSlic
58
61
  * @typeParam TContext - Arbitrary data passed to `<SliceZone />` and made
59
62
  * available to all Slice components
60
63
  */
61
- export type SliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
62
- /**
63
- * Slice data for this component.
64
- */
65
- slice: TSlice;
66
- /**
67
- * The index of the Slice in the Slice Zone.
68
- */
69
- index: number;
70
- /**
71
- * All Slices from the Slice Zone to which the Slice belongs.
72
- */
73
- slices: SliceZoneLike<TSlice extends SliceLikeGraphQL ? SliceLikeGraphQL : SliceLikeRestV2>;
74
- /**
75
- * Arbitrary data passed to `<SliceZone />` and made available to all Slice
76
- * components.
77
- */
78
- context: TContext;
64
+ type SliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
65
+ /**
66
+ * Slice data for this component.
67
+ */
68
+ slice: TSlice;
69
+ /**
70
+ * The index of the Slice in the Slice Zone.
71
+ */
72
+ index: number;
73
+ /**
74
+ * All Slices from the Slice Zone to which the Slice belongs.
75
+ */
76
+ slices: SliceZoneLike<TSlice extends SliceLikeGraphQL ? SliceLikeGraphQL : SliceLikeRestV2>;
77
+ /**
78
+ * Arbitrary data passed to `<SliceZone />` and made available to all Slice
79
+ * components.
80
+ */
81
+ context: TContext;
79
82
  };
80
83
  /**
81
84
  * A Vue component to be rendered for each instance of its Slice.
@@ -83,7 +86,7 @@ export type SliceComponentProps<TSlice extends SliceLike = SliceLike, TContext =
83
86
  * @typeParam TSlice - The type(s) of slices in the Slice Zone
84
87
  * @typeParam TContext - Arbitrary data made available to all Slice components
85
88
  */
86
- export type SliceComponentType<TSlice extends SliceLike = any, TContext = unknown> = DefineComponent<{}, {}, any> | ReturnType<typeof defineAsyncComponent> | DefineComponent<SliceComponentProps<TSlice, TContext>> | FunctionalComponent;
89
+ type SliceComponentType<TSlice extends SliceLike = any, TContext = unknown> = DefineComponent<{}, {}, any> | ReturnType<typeof defineAsyncComponent> | DefineComponent<SliceComponentProps<TSlice, TContext>> | FunctionalComponent;
87
90
  /**
88
91
  * A record of Slice types mapped to Vue components. Each components will be
89
92
  * rendered for each instance of their Slice type.
@@ -91,7 +94,7 @@ export type SliceComponentType<TSlice extends SliceLike = any, TContext = unknow
91
94
  * @typeParam TSlice - The type(s) of slices in the Slice Zone
92
95
  * @typeParam TContext - Arbitrary data made available to all Slice components
93
96
  */
94
- export type SliceZoneComponents<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
95
- [SliceType in ExtractSliceType<TSlice>]: SliceComponentType<Extract<TSlice, SliceLike<SliceType>> extends never ? SliceLike : Extract<TSlice, SliceLike<SliceType>>, TContext> | string;
96
- };
97
- export {};
97
+ type SliceZoneComponents<TSlice extends SliceLike = SliceLike, TContext = unknown> = { [SliceType in ExtractSliceType<TSlice>]: SliceComponentType<Extract<TSlice, SliceLike<SliceType>> extends never ? SliceLike : Extract<TSlice, SliceLike<SliceType>>, TContext> | string };
98
+ //#endregion
99
+ export { SliceComponentProps, SliceComponentType, SliceLike, SliceLikeGraphQL, SliceLikeRestV2, SliceZoneComponents, SliceZoneLike };
100
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/SliceZone/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKY;;;KAOP,gBAA4D,CAAA,eAA5B,SAA4B,CAAA,GAAf,MAAe,SAAA,eAAA,GAC9D,MAD8D,CAAA,YAAA,CAAA,GAE9D,MAF8D,SAE/C,gBAF+C,GAG7D,MAH6D,CAAA,MAAA,CAAA,GAAA,KAAA;;;;;;AAYjE;AACO,KADK,eACL,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAD2D,IAC3D,CAAN,KAAM,CAAA,UAAA,CAAA,EAAA,IAAA,GAAA,YAAA,CAAA;;;;AAUP;AAaA;;AACG,KAdS,gBAcT,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAAA;EACiB,IAAA,EAdb,KAca,CAdP,UAcO,CAAA,CAAA,YAAA,CAAA;CAAjB;;AAoBH;;;;;AAWA;;;AAOQ,KAxCI,SAwCJ,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAAA,CAvCL,eAuCK,CAvCW,UAuCX,CAAA,GAtCL,gBAsCK,CAtCY,UAsCZ,CAAA,CAAA,GAAA;EAeN;;;;;;EAOgB,QAAA,CAAA,EAAA,IAAA;AASlB,CAAA;;;;;;;;;;AAWsB,KA5DV,aA4DU,CAAA,eA5DmB,SA4DnB,GA5D+B,SA4D/B,CAAA,GAAA,SA3DZ,MA2DY,EAAA;AAStB;;;;;;;;AAgBK,KA1EO,mBA0EP,CAAA,eAzEW,SAyEX,GAzEuB,SAyEvB,EAAA,WAAA,OAAA,CAAA,GAAA;EACG;;;EACgB,KAAA,EArEhB,MAqEgB;EAAhB;;;EAHe,KAAA,EAAA,MAAA;;;;UApDd,cACP,eAAe,mBAAmB,mBAAmB;;;;;WAO7C;;;;;;;;KASE,kCAEI,uCAKb,+BAEA,kBAAkB,wBAClB,gBAAgB,oBAAoB,QAAQ,aAC5C;;;;;;;;KASS,mCACI,YAAY,iDAaZ,iBAAiB,UAC5B,mBACA,QAAQ,QAAQ,UAAU,4BACvB,YACA,QAAQ,QAAQ,UAAU,aAC7B"}