@prismicio/vue 6.1.1 → 6.1.2-canary.e0abd9b

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 (225) hide show
  1. package/dist/PrismicImage.cjs +2 -4
  2. package/dist/PrismicImage.cjs.map +1 -1
  3. package/dist/PrismicImage.js +1 -2
  4. package/dist/PrismicImage.js.map +1 -1
  5. package/dist/PrismicImage.vue.d.cts +57 -85
  6. package/dist/PrismicImage.vue.d.cts.map +1 -1
  7. package/dist/PrismicImage.vue.d.ts +57 -85
  8. package/dist/PrismicImage.vue.d.ts.map +1 -1
  9. package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +2 -3
  10. package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  11. package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js +1 -2
  12. package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/PrismicLink.cjs +2 -4
  14. package/dist/PrismicLink.cjs.map +1 -1
  15. package/dist/PrismicLink.js +1 -2
  16. package/dist/PrismicLink.js.map +1 -1
  17. package/dist/PrismicLink.vue.d.cts +46 -58
  18. package/dist/PrismicLink.vue.d.cts.map +1 -1
  19. package/dist/PrismicLink.vue.d.ts +46 -58
  20. package/dist/PrismicLink.vue.d.ts.map +1 -1
  21. package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -4
  22. package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  23. package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js +1 -2
  24. package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/PrismicRichText/PrismicRichText.cjs +2 -4
  26. package/dist/PrismicRichText/PrismicRichText.cjs.map +1 -1
  27. package/dist/PrismicRichText/PrismicRichText.js +1 -2
  28. package/dist/PrismicRichText/PrismicRichText.js.map +1 -1
  29. package/dist/PrismicRichText/PrismicRichText.vue.d.cts +17 -21
  30. package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
  31. package/dist/PrismicRichText/PrismicRichText.vue.d.ts +17 -21
  32. package/dist/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
  33. package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +5 -6
  34. package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  35. package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +2 -3
  36. package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.cjs +2 -4
  38. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -1
  39. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.js +1 -2
  40. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -1
  41. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +5 -6
  42. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  43. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +3 -4
  44. package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/PrismicRichText/PrismicRichTextSerialize.cjs +2 -4
  46. package/dist/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -1
  47. package/dist/PrismicRichText/PrismicRichTextSerialize.js +1 -2
  48. package/dist/PrismicRichText/PrismicRichTextSerialize.js.map +1 -1
  49. package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +2 -3
  50. package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  51. package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +2 -3
  52. package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/PrismicRichText/getRichTextComponentProps.cjs +13 -18
  54. package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +1 -1
  55. package/dist/PrismicRichText/getRichTextComponentProps.d.cts +14 -19
  56. package/dist/PrismicRichText/getRichTextComponentProps.d.cts.map +1 -1
  57. package/dist/PrismicRichText/getRichTextComponentProps.d.ts +14 -19
  58. package/dist/PrismicRichText/getRichTextComponentProps.d.ts.map +1 -1
  59. package/dist/PrismicRichText/getRichTextComponentProps.js +13 -17
  60. package/dist/PrismicRichText/getRichTextComponentProps.js.map +1 -1
  61. package/dist/PrismicRichText/index.d.cts +2 -0
  62. package/dist/PrismicRichText/types.d.cts +1 -3
  63. package/dist/PrismicRichText/types.d.cts.map +1 -1
  64. package/dist/PrismicRichText/types.d.ts +1 -3
  65. package/dist/PrismicRichText/types.d.ts.map +1 -1
  66. package/dist/PrismicTable/PrismicTable.cjs +2 -4
  67. package/dist/PrismicTable/PrismicTable.cjs.map +1 -1
  68. package/dist/PrismicTable/PrismicTable.js +1 -2
  69. package/dist/PrismicTable/PrismicTable.js.map +1 -1
  70. package/dist/PrismicTable/PrismicTable.vue.d.cts +13 -16
  71. package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
  72. package/dist/PrismicTable/PrismicTable.vue.d.ts +13 -17
  73. package/dist/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
  74. package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +5 -6
  75. package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  76. package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +2 -3
  77. package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  78. package/dist/PrismicTable/PrismicTableDefaultComponents.cjs +2 -3
  79. package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
  80. package/dist/PrismicTable/PrismicTableDefaultComponents.js +1 -2
  81. package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
  82. package/dist/PrismicTable/PrismicTableRow.cjs +2 -4
  83. package/dist/PrismicTable/PrismicTableRow.cjs.map +1 -1
  84. package/dist/PrismicTable/PrismicTableRow.js +1 -2
  85. package/dist/PrismicTable/PrismicTableRow.js.map +1 -1
  86. package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +2 -3
  87. package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  88. package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +1 -2
  89. package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/PrismicTable/getTableComponentProps.cjs +49 -57
  91. package/dist/PrismicTable/getTableComponentProps.cjs.map +1 -1
  92. package/dist/PrismicTable/getTableComponentProps.d.cts +42 -48
  93. package/dist/PrismicTable/getTableComponentProps.d.cts.map +1 -1
  94. package/dist/PrismicTable/getTableComponentProps.d.ts +42 -48
  95. package/dist/PrismicTable/getTableComponentProps.d.ts.map +1 -1
  96. package/dist/PrismicTable/getTableComponentProps.js +44 -51
  97. package/dist/PrismicTable/getTableComponentProps.js.map +1 -1
  98. package/dist/PrismicTable/index.d.cts +2 -0
  99. package/dist/PrismicTable/types.d.cts +1 -3
  100. package/dist/PrismicTable/types.d.cts.map +1 -1
  101. package/dist/PrismicTable/types.d.ts +1 -3
  102. package/dist/PrismicTable/types.d.ts.map +1 -1
  103. package/dist/PrismicText.cjs +2 -4
  104. package/dist/PrismicText.cjs.map +1 -1
  105. package/dist/PrismicText.js +1 -2
  106. package/dist/PrismicText.js.map +1 -1
  107. package/dist/PrismicText.vue.d.cts +5 -6
  108. package/dist/PrismicText.vue.d.cts.map +1 -1
  109. package/dist/PrismicText.vue.d.ts +5 -6
  110. package/dist/PrismicText.vue.d.ts.map +1 -1
  111. package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs +2 -3
  112. package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  113. package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js +1 -2
  114. package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/SliceSimulator.cjs +2 -4
  116. package/dist/SliceSimulator.cjs.map +1 -1
  117. package/dist/SliceSimulator.js +1 -2
  118. package/dist/SliceSimulator.js.map +1 -1
  119. package/dist/SliceSimulator.vue.d.cts +13 -16
  120. package/dist/SliceSimulator.vue.d.cts.map +1 -1
  121. package/dist/SliceSimulator.vue.d.ts +13 -16
  122. package/dist/SliceSimulator.vue.d.ts.map +1 -1
  123. package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs +1 -2
  124. package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  125. package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js +1 -2
  126. package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/SliceZone/SliceZone.cjs +2 -4
  128. package/dist/SliceZone/SliceZone.cjs.map +1 -1
  129. package/dist/SliceZone/SliceZone.js +1 -2
  130. package/dist/SliceZone/SliceZone.js.map +1 -1
  131. package/dist/SliceZone/SliceZone.vue.d.cts +5 -13
  132. package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
  133. package/dist/SliceZone/SliceZone.vue.d.ts +5 -13
  134. package/dist/SliceZone/SliceZone.vue.d.ts.map +1 -1
  135. package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +2 -3
  136. package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  137. package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +1 -2
  138. package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
  139. package/dist/SliceZone/TODOSliceComponent.cjs +5 -8
  140. package/dist/SliceZone/TODOSliceComponent.cjs.map +1 -1
  141. package/dist/SliceZone/TODOSliceComponent.d.cts +3 -5
  142. package/dist/SliceZone/TODOSliceComponent.d.cts.map +1 -1
  143. package/dist/SliceZone/TODOSliceComponent.d.ts +3 -5
  144. package/dist/SliceZone/TODOSliceComponent.d.ts.map +1 -1
  145. package/dist/SliceZone/TODOSliceComponent.js +4 -6
  146. package/dist/SliceZone/TODOSliceComponent.js.map +1 -1
  147. package/dist/SliceZone/defineSliceZoneComponents.cjs +20 -25
  148. package/dist/SliceZone/defineSliceZoneComponents.cjs.map +1 -1
  149. package/dist/SliceZone/defineSliceZoneComponents.d.cts +19 -24
  150. package/dist/SliceZone/defineSliceZoneComponents.d.cts.map +1 -1
  151. package/dist/SliceZone/defineSliceZoneComponents.d.ts +19 -24
  152. package/dist/SliceZone/defineSliceZoneComponents.d.ts.map +1 -1
  153. package/dist/SliceZone/defineSliceZoneComponents.js +20 -25
  154. package/dist/SliceZone/defineSliceZoneComponents.js.map +1 -1
  155. package/dist/SliceZone/getSliceComponentProps.cjs +17 -25
  156. package/dist/SliceZone/getSliceComponentProps.cjs.map +1 -1
  157. package/dist/SliceZone/getSliceComponentProps.d.cts +20 -28
  158. package/dist/SliceZone/getSliceComponentProps.d.cts.map +1 -1
  159. package/dist/SliceZone/getSliceComponentProps.d.ts +20 -28
  160. package/dist/SliceZone/getSliceComponentProps.d.ts.map +1 -1
  161. package/dist/SliceZone/getSliceComponentProps.js +17 -24
  162. package/dist/SliceZone/getSliceComponentProps.js.map +1 -1
  163. package/dist/SliceZone/index.d.cts +4 -0
  164. package/dist/SliceZone/types.d.cts +21 -31
  165. package/dist/SliceZone/types.d.cts.map +1 -1
  166. package/dist/SliceZone/types.d.ts +21 -31
  167. package/dist/SliceZone/types.d.ts.map +1 -1
  168. package/dist/_virtual/_rolldown/runtime.cjs +13 -0
  169. package/dist/_virtual/_rolldown/runtime.js +13 -0
  170. package/dist/createPrismic.cjs +4 -6
  171. package/dist/createPrismic.cjs.map +1 -1
  172. package/dist/createPrismic.d.cts +11 -24
  173. package/dist/createPrismic.d.cts.map +1 -1
  174. package/dist/createPrismic.d.ts +11 -26
  175. package/dist/createPrismic.d.ts.map +1 -1
  176. package/dist/createPrismic.js +4 -6
  177. package/dist/createPrismic.js.map +1 -1
  178. package/dist/index.cjs +20 -20
  179. package/dist/index.d.ts +0 -3
  180. package/dist/index.js +1 -2
  181. package/dist/lib/devMsg.cjs +8 -11
  182. package/dist/lib/devMsg.cjs.map +1 -1
  183. package/dist/lib/devMsg.js +7 -10
  184. package/dist/lib/devMsg.js.map +1 -1
  185. package/dist/lib/isInternalURL.cjs +1 -3
  186. package/dist/lib/isInternalURL.cjs.map +1 -1
  187. package/dist/lib/isInternalURL.js +1 -2
  188. package/dist/lib/isInternalURL.js.map +1 -1
  189. package/dist/package.cjs +7 -8
  190. package/dist/package.js +2 -2
  191. package/dist/types.cjs +1 -2
  192. package/dist/types.cjs.map +1 -1
  193. package/dist/types.d.cts +2 -7
  194. package/dist/types.d.cts.map +1 -1
  195. package/dist/types.d.ts +2 -7
  196. package/dist/types.d.ts.map +1 -1
  197. package/dist/types.js +1 -1
  198. package/dist/types.js.map +1 -1
  199. package/package.json +33 -35
  200. package/src/PrismicImage.vue +15 -27
  201. package/src/PrismicLink.vue +10 -17
  202. package/src/PrismicRichText/PrismicRichText.vue +19 -32
  203. package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +4 -12
  204. package/src/PrismicRichText/PrismicRichTextSerialize.vue +1 -1
  205. package/src/PrismicRichText/getRichTextComponentProps.ts +17 -27
  206. package/src/PrismicRichText/types.ts +6 -10
  207. package/src/PrismicTable/PrismicTable.vue +19 -23
  208. package/src/PrismicTable/PrismicTableDefaultComponents.ts +1 -2
  209. package/src/PrismicTable/PrismicTableRow.vue +1 -2
  210. package/src/PrismicTable/getTableComponentProps.ts +42 -48
  211. package/src/PrismicTable/types.ts +7 -20
  212. package/src/PrismicText.vue +2 -2
  213. package/src/SliceSimulator.vue +18 -14
  214. package/src/SliceZone/SliceZone.vue +4 -16
  215. package/src/SliceZone/TODOSliceComponent.ts +4 -7
  216. package/src/SliceZone/defineSliceZoneComponents.ts +21 -32
  217. package/src/SliceZone/getSliceComponentProps.ts +21 -30
  218. package/src/SliceZone/types.ts +23 -37
  219. package/src/createPrismic.ts +7 -15
  220. package/src/index.ts +1 -5
  221. package/src/lib/devMsg.ts +6 -8
  222. package/src/lib/isInternalURL.ts +0 -1
  223. package/src/types.ts +1 -4
  224. package/dist/_virtual/rolldown_runtime.cjs +0 -19
  225. package/dist/_virtual/rolldown_runtime.js +0 -18
@@ -1,8 +1,6 @@
1
- const require_PrismicImage_vue_vue_type_script_setup_true_lang = require('./PrismicImage.vue_vue_type_script_setup_true_lang.cjs');
2
-
3
1
  //#region src/PrismicImage.vue
4
- var PrismicImage_default = require_PrismicImage_vue_vue_type_script_setup_true_lang.default;
5
-
2
+ var PrismicImage_default = require("./PrismicImage.vue_vue_type_script_setup_true_lang.cjs").default;
6
3
  //#endregion
7
4
  exports.default = PrismicImage_default;
5
+
8
6
  //# sourceMappingURL=PrismicImage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.cjs","names":[],"sources":["../src/PrismicImage.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ImageField, asImageSrc } from \"@prismicio/client\"\nimport {\n\tasImagePixelDensitySrcSet,\n\tasImageWidthSrcSet,\n\tisFilled,\n} from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { computed, watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicImage />`. */\nexport type PrismicImageProps = {\n\t/** The Prismic image field or thumbnail to render. */\n\tfield: ImageField | ImageField<string>\n\n\t/**\n\t * An object of Imgix URL API parameters to transform the image.\n\t *\n\t * See: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1]\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\"\n\n\t/**\n\t * Declare an image as decorative only if the image field does not have\n\t * alternative text by providing `fallbackAlt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\"\n\n\t/**\n\t * The width attribute of the image element.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width\n\t */\n\twidth?: number | string\n\n\t/**\n\t * The height attribute of the image element.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height\n\t */\n\theight?: number | string\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * Widths (in pixels) used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If omitted or set to `\"defaults\"`, the following widths will be used:\n\t\t\t * 640, 750, 828, 1080, 1200, 1920, 2048, 3840.\n\t\t\t *\n\t\t\t * If the image field contains responsive views, each responsive view can\n\t\t\t * be used as a width in the resulting `srcset` by passing `\"thumbnails\"`\n\t\t\t * as the `widths` prop.\n\t\t\t */\n\t\t\twidths?:\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\tpixelDensities?: never\n\t }\n\t| {\n\t\t\twidths?: never\n\t\t\t/**\n\t\t\t * Pixel densities used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following pixel\n\t\t\t * densities will be used: 1, 2, 3.\n\t\t\t */\n\t\t\tpixelDensities:\n\t\t\t\t| NonNullable<\n\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t }\n)\n\nconst props = defineProps<PrismicImageProps>()\ndefineOptions({ name: \"PrismicImage\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.alt === \"string\" && props.alt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"alt\" prop can only be used to declare an image as decorative by passing an empty string (alt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"alt\" prop or changing it to alt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (typeof props.fallbackAlt === \"string\" && props.fallbackAlt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"fallbackAlt\" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"fallbackAlt\" prop or changing it to fallbackAlt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (props.widths && props.pixelDensities) {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] Only one of \"widths\" or \"pixelDensities\" props can be provided. You can resolve this warning by removing either the \"widths\" or \"pixelDensities\" prop. \"widths\" will be used in this case.`,\n\t\t\t)\n\t\t}\n\t})\n}\n\nconst castInt = (input: string | number | undefined): number | undefined => {\n\tif (typeof input === \"number\" || typeof input === \"undefined\") {\n\t\treturn input\n\t} else {\n\t\tconst parsed = Number.parseInt(input)\n\n\t\tif (Number.isNaN(parsed)) {\n\t\t\treturn undefined\n\t\t} else {\n\t\t\treturn parsed\n\t\t}\n\t}\n}\n\nconst image = computed(() => {\n\tif (!isFilled.imageThumbnail(props.field)) {\n\t\treturn\n\t}\n\n\tlet src: string | undefined\n\tlet srcSet: string | undefined\n\tif (props.widths || !props.pixelDensities) {\n\t\tconst res = asImageWidthSrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\twidths: props.widths === \"defaults\" ? undefined : props.widths,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t} else if (props.pixelDensities) {\n\t\tconst res = asImagePixelDensitySrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\tpixelDensities:\n\t\t\t\tprops.pixelDensities === \"defaults\" ? undefined : props.pixelDensities,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t}\n\n\tconst ar = props.field.dimensions.width / props.field.dimensions.height\n\n\tconst castedWidth = castInt(props.width)\n\tconst castedHeight = castInt(props.height)\n\n\tlet resolvedWidth = castedWidth ?? props.field.dimensions.width\n\tlet resolvedHeight = castedHeight ?? props.field.dimensions.height\n\n\tif (castedWidth != null && castedHeight == null) {\n\t\tresolvedHeight = castedWidth / ar\n\t} else if (castedWidth == null && castedHeight != null) {\n\t\tresolvedWidth = castedHeight * ar\n\t}\n\n\treturn {\n\t\tsrc,\n\t\tsrcSet,\n\t\talt: props.alt ?? (props.field.alt || props.fallbackAlt),\n\t\twidth: Math.round(resolvedWidth),\n\t\theight: Math.round(resolvedHeight),\n\t}\n})\n</script>\n\n<template>\n\t<img\n\t\tv-if=\"image\"\n\t\t:src=\"image.src\"\n\t\t:srcset=\"image.srcSet\"\n\t\t:alt=\"image.alt\"\n\t\t:width=\"image.width\"\n\t\t:height=\"image.height\"\n\t/>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicImage.cjs","names":[],"sources":["../src/PrismicImage.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ImageField, asImageSrc } from \"@prismicio/client\"\nimport { asImagePixelDensitySrcSet, asImageWidthSrcSet, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { computed, watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicImage />`. */\nexport type PrismicImageProps = {\n\t/** The Prismic image field or thumbnail to render. */\n\tfield: ImageField | ImageField<string>\n\n\t/**\n\t * An object of Imgix URL API parameters to transform the image.\n\t *\n\t * See: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1]\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\"\n\n\t/**\n\t * Declare an image as decorative only if the image field does not have alternative text by\n\t * providing `fallbackAlt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\"\n\n\t/**\n\t * The width attribute of the image element.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width\n\t */\n\twidth?: number | string\n\n\t/**\n\t * The height attribute of the image element.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height\n\t */\n\theight?: number | string\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * Widths (in pixels) used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If omitted or set to `\"defaults\"`, the following widths will be used: 640, 750, 828, 1080,\n\t\t\t * 1200, 1920, 2048, 3840.\n\t\t\t *\n\t\t\t * If the image field contains responsive views, each responsive view can be used as a width\n\t\t\t * in the resulting `srcset` by passing `\"thumbnails\"` as the `widths` prop.\n\t\t\t */\n\t\t\twidths?:\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\tpixelDensities?: never\n\t }\n\t| {\n\t\t\twidths?: never\n\t\t\t/**\n\t\t\t * Pixel densities used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following pixel densities will be\n\t\t\t * used: 1, 2, 3.\n\t\t\t */\n\t\t\tpixelDensities:\n\t\t\t\t| NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t }\n)\n\nconst props = defineProps<PrismicImageProps>()\ndefineOptions({ name: \"PrismicImage\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.alt === \"string\" && props.alt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"alt\" prop can only be used to declare an image as decorative by passing an empty string (alt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"alt\" prop or changing it to alt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (typeof props.fallbackAlt === \"string\" && props.fallbackAlt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"fallbackAlt\" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"fallbackAlt\" prop or changing it to fallbackAlt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (props.widths && props.pixelDensities) {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] Only one of \"widths\" or \"pixelDensities\" props can be provided. You can resolve this warning by removing either the \"widths\" or \"pixelDensities\" prop. \"widths\" will be used in this case.`,\n\t\t\t)\n\t\t}\n\t})\n}\n\nconst castInt = (input: string | number | undefined): number | undefined => {\n\tif (typeof input === \"number\" || typeof input === \"undefined\") {\n\t\treturn input\n\t} else {\n\t\tconst parsed = Number.parseInt(input)\n\n\t\tif (Number.isNaN(parsed)) {\n\t\t\treturn undefined\n\t\t} else {\n\t\t\treturn parsed\n\t\t}\n\t}\n}\n\nconst image = computed(() => {\n\tif (!isFilled.imageThumbnail(props.field)) {\n\t\treturn\n\t}\n\n\tlet src: string | undefined\n\tlet srcSet: string | undefined\n\tif (props.widths || !props.pixelDensities) {\n\t\tconst res = asImageWidthSrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\twidths: props.widths === \"defaults\" ? undefined : props.widths,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t} else if (props.pixelDensities) {\n\t\tconst res = asImagePixelDensitySrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\tpixelDensities: props.pixelDensities === \"defaults\" ? undefined : props.pixelDensities,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t}\n\n\tconst ar = props.field.dimensions.width / props.field.dimensions.height\n\n\tconst castedWidth = castInt(props.width)\n\tconst castedHeight = castInt(props.height)\n\n\tlet resolvedWidth = castedWidth ?? props.field.dimensions.width\n\tlet resolvedHeight = castedHeight ?? props.field.dimensions.height\n\n\tif (castedWidth != null && castedHeight == null) {\n\t\tresolvedHeight = castedWidth / ar\n\t} else if (castedWidth == null && castedHeight != null) {\n\t\tresolvedWidth = castedHeight * ar\n\t}\n\n\treturn {\n\t\tsrc,\n\t\tsrcSet,\n\t\talt: props.alt ?? (props.field.alt || props.fallbackAlt),\n\t\twidth: Math.round(resolvedWidth),\n\t\theight: Math.round(resolvedHeight),\n\t}\n})\n</script>\n\n<template>\n\t<img\n\t\tv-if=\"image\"\n\t\t:src=\"image.src\"\n\t\t:srcset=\"image.srcSet\"\n\t\t:alt=\"image.alt\"\n\t\t:width=\"image.width\"\n\t\t:height=\"image.height\"\n\t/>\n</template>\n"],"mappings":""}
@@ -1,8 +1,7 @@
1
1
  import PrismicImage_vue_vue_type_script_setup_true_lang_default from "./PrismicImage.vue_vue_type_script_setup_true_lang.js";
2
-
3
2
  //#region src/PrismicImage.vue
4
3
  var PrismicImage_default = PrismicImage_vue_vue_type_script_setup_true_lang_default;
5
-
6
4
  //#endregion
7
5
  export { PrismicImage_default as default };
6
+
8
7
  //# sourceMappingURL=PrismicImage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.js","names":[],"sources":["../src/PrismicImage.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ImageField, asImageSrc } from \"@prismicio/client\"\nimport {\n\tasImagePixelDensitySrcSet,\n\tasImageWidthSrcSet,\n\tisFilled,\n} from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { computed, watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicImage />`. */\nexport type PrismicImageProps = {\n\t/** The Prismic image field or thumbnail to render. */\n\tfield: ImageField | ImageField<string>\n\n\t/**\n\t * An object of Imgix URL API parameters to transform the image.\n\t *\n\t * See: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1]\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\"\n\n\t/**\n\t * Declare an image as decorative only if the image field does not have\n\t * alternative text by providing `fallbackAlt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\"\n\n\t/**\n\t * The width attribute of the image element.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width\n\t */\n\twidth?: number | string\n\n\t/**\n\t * The height attribute of the image element.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height\n\t */\n\theight?: number | string\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * Widths (in pixels) used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If omitted or set to `\"defaults\"`, the following widths will be used:\n\t\t\t * 640, 750, 828, 1080, 1200, 1920, 2048, 3840.\n\t\t\t *\n\t\t\t * If the image field contains responsive views, each responsive view can\n\t\t\t * be used as a width in the resulting `srcset` by passing `\"thumbnails\"`\n\t\t\t * as the `widths` prop.\n\t\t\t */\n\t\t\twidths?:\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\tpixelDensities?: never\n\t }\n\t| {\n\t\t\twidths?: never\n\t\t\t/**\n\t\t\t * Pixel densities used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following pixel\n\t\t\t * densities will be used: 1, 2, 3.\n\t\t\t */\n\t\t\tpixelDensities:\n\t\t\t\t| NonNullable<\n\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t }\n)\n\nconst props = defineProps<PrismicImageProps>()\ndefineOptions({ name: \"PrismicImage\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.alt === \"string\" && props.alt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"alt\" prop can only be used to declare an image as decorative by passing an empty string (alt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"alt\" prop or changing it to alt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (typeof props.fallbackAlt === \"string\" && props.fallbackAlt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"fallbackAlt\" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"fallbackAlt\" prop or changing it to fallbackAlt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (props.widths && props.pixelDensities) {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] Only one of \"widths\" or \"pixelDensities\" props can be provided. You can resolve this warning by removing either the \"widths\" or \"pixelDensities\" prop. \"widths\" will be used in this case.`,\n\t\t\t)\n\t\t}\n\t})\n}\n\nconst castInt = (input: string | number | undefined): number | undefined => {\n\tif (typeof input === \"number\" || typeof input === \"undefined\") {\n\t\treturn input\n\t} else {\n\t\tconst parsed = Number.parseInt(input)\n\n\t\tif (Number.isNaN(parsed)) {\n\t\t\treturn undefined\n\t\t} else {\n\t\t\treturn parsed\n\t\t}\n\t}\n}\n\nconst image = computed(() => {\n\tif (!isFilled.imageThumbnail(props.field)) {\n\t\treturn\n\t}\n\n\tlet src: string | undefined\n\tlet srcSet: string | undefined\n\tif (props.widths || !props.pixelDensities) {\n\t\tconst res = asImageWidthSrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\twidths: props.widths === \"defaults\" ? undefined : props.widths,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t} else if (props.pixelDensities) {\n\t\tconst res = asImagePixelDensitySrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\tpixelDensities:\n\t\t\t\tprops.pixelDensities === \"defaults\" ? undefined : props.pixelDensities,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t}\n\n\tconst ar = props.field.dimensions.width / props.field.dimensions.height\n\n\tconst castedWidth = castInt(props.width)\n\tconst castedHeight = castInt(props.height)\n\n\tlet resolvedWidth = castedWidth ?? props.field.dimensions.width\n\tlet resolvedHeight = castedHeight ?? props.field.dimensions.height\n\n\tif (castedWidth != null && castedHeight == null) {\n\t\tresolvedHeight = castedWidth / ar\n\t} else if (castedWidth == null && castedHeight != null) {\n\t\tresolvedWidth = castedHeight * ar\n\t}\n\n\treturn {\n\t\tsrc,\n\t\tsrcSet,\n\t\talt: props.alt ?? (props.field.alt || props.fallbackAlt),\n\t\twidth: Math.round(resolvedWidth),\n\t\theight: Math.round(resolvedHeight),\n\t}\n})\n</script>\n\n<template>\n\t<img\n\t\tv-if=\"image\"\n\t\t:src=\"image.src\"\n\t\t:srcset=\"image.srcSet\"\n\t\t:alt=\"image.alt\"\n\t\t:width=\"image.width\"\n\t\t:height=\"image.height\"\n\t/>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicImage.js","names":[],"sources":["../src/PrismicImage.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ImageField, asImageSrc } from \"@prismicio/client\"\nimport { asImagePixelDensitySrcSet, asImageWidthSrcSet, isFilled } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { computed, watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicImage />`. */\nexport type PrismicImageProps = {\n\t/** The Prismic image field or thumbnail to render. */\n\tfield: ImageField | ImageField<string>\n\n\t/**\n\t * An object of Imgix URL API parameters to transform the image.\n\t *\n\t * See: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1]\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\"\n\n\t/**\n\t * Declare an image as decorative only if the image field does not have alternative text by\n\t * providing `fallbackAlt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\"\n\n\t/**\n\t * The width attribute of the image element.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width\n\t */\n\twidth?: number | string\n\n\t/**\n\t * The height attribute of the image element.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height\n\t */\n\theight?: number | string\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * Widths (in pixels) used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If omitted or set to `\"defaults\"`, the following widths will be used: 640, 750, 828, 1080,\n\t\t\t * 1200, 1920, 2048, 3840.\n\t\t\t *\n\t\t\t * If the image field contains responsive views, each responsive view can be used as a width\n\t\t\t * in the resulting `srcset` by passing `\"thumbnails\"` as the `widths` prop.\n\t\t\t */\n\t\t\twidths?:\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\tpixelDensities?: never\n\t }\n\t| {\n\t\t\twidths?: never\n\t\t\t/**\n\t\t\t * Pixel densities used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following pixel densities will be\n\t\t\t * used: 1, 2, 3.\n\t\t\t */\n\t\t\tpixelDensities:\n\t\t\t\t| NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t }\n)\n\nconst props = defineProps<PrismicImageProps>()\ndefineOptions({ name: \"PrismicImage\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.alt === \"string\" && props.alt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"alt\" prop can only be used to declare an image as decorative by passing an empty string (alt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"alt\" prop or changing it to alt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (typeof props.fallbackAlt === \"string\" && props.fallbackAlt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"fallbackAlt\" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"fallbackAlt\" prop or changing it to fallbackAlt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (props.widths && props.pixelDensities) {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] Only one of \"widths\" or \"pixelDensities\" props can be provided. You can resolve this warning by removing either the \"widths\" or \"pixelDensities\" prop. \"widths\" will be used in this case.`,\n\t\t\t)\n\t\t}\n\t})\n}\n\nconst castInt = (input: string | number | undefined): number | undefined => {\n\tif (typeof input === \"number\" || typeof input === \"undefined\") {\n\t\treturn input\n\t} else {\n\t\tconst parsed = Number.parseInt(input)\n\n\t\tif (Number.isNaN(parsed)) {\n\t\t\treturn undefined\n\t\t} else {\n\t\t\treturn parsed\n\t\t}\n\t}\n}\n\nconst image = computed(() => {\n\tif (!isFilled.imageThumbnail(props.field)) {\n\t\treturn\n\t}\n\n\tlet src: string | undefined\n\tlet srcSet: string | undefined\n\tif (props.widths || !props.pixelDensities) {\n\t\tconst res = asImageWidthSrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\twidths: props.widths === \"defaults\" ? undefined : props.widths,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t} else if (props.pixelDensities) {\n\t\tconst res = asImagePixelDensitySrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\tpixelDensities: props.pixelDensities === \"defaults\" ? undefined : props.pixelDensities,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t}\n\n\tconst ar = props.field.dimensions.width / props.field.dimensions.height\n\n\tconst castedWidth = castInt(props.width)\n\tconst castedHeight = castInt(props.height)\n\n\tlet resolvedWidth = castedWidth ?? props.field.dimensions.width\n\tlet resolvedHeight = castedHeight ?? props.field.dimensions.height\n\n\tif (castedWidth != null && castedHeight == null) {\n\t\tresolvedHeight = castedWidth / ar\n\t} else if (castedWidth == null && castedHeight != null) {\n\t\tresolvedWidth = castedHeight * ar\n\t}\n\n\treturn {\n\t\tsrc,\n\t\tsrcSet,\n\t\talt: props.alt ?? (props.field.alt || props.fallbackAlt),\n\t\twidth: Math.round(resolvedWidth),\n\t\theight: Math.round(resolvedHeight),\n\t}\n})\n</script>\n\n<template>\n\t<img\n\t\tv-if=\"image\"\n\t\t:src=\"image.src\"\n\t\t:srcset=\"image.srcSet\"\n\t\t:alt=\"image.alt\"\n\t\t:width=\"image.width\"\n\t\t:height=\"image.height\"\n\t/>\n</template>\n"],"mappings":""}
@@ -1,11 +1,10 @@
1
- import * as vue11 from "vue";
1
+ import * as _$vue from "vue";
2
2
  import { ImageField, asImagePixelDensitySrcSet, asImageSrc, asImageWidthSrcSet } from "@prismicio/client";
3
3
 
4
4
  //#region src/PrismicImage.vue.d.ts
5
5
  /** Props for `<PrismicImage />`. */
6
6
  type PrismicImageProps = {
7
- /** The Prismic image field or thumbnail to render. */
8
- field: ImageField | ImageField<string>;
7
+ /** The Prismic image field or thumbnail to render. */field: ImageField | ImageField<string>;
9
8
  /**
10
9
  * An object of Imgix URL API parameters to transform the image.
11
10
  *
@@ -15,42 +14,37 @@ type PrismicImageProps = {
15
14
  /**
16
15
  * Declare an image as decorative by providing `alt=""`.
17
16
  *
18
- * See:
19
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
17
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
20
18
  */
21
19
  alt?: "";
22
20
  /**
23
- * Declare an image as decorative only if the image field does not have
24
- * alternative text by providing `fallbackAlt=""`.
21
+ * Declare an image as decorative only if the image field does not have alternative text by
22
+ * providing `fallbackAlt=""`.
25
23
  *
26
- * See:
27
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
24
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
28
25
  */
29
26
  fallbackAlt?: "";
30
27
  /**
31
28
  * The width attribute of the image element.
32
29
  *
33
- * See:
34
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
30
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
35
31
  */
36
32
  width?: number | string;
37
33
  /**
38
34
  * The height attribute of the image element.
39
35
  *
40
- * See:
41
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
36
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
42
37
  */
43
38
  height?: number | string;
44
39
  } & ({
45
40
  /**
46
41
  * Widths (in pixels) used to build a `srcset` value for the image field.
47
42
  *
48
- * If omitted or set to `"defaults"`, the following widths will be used:
49
- * 640, 750, 828, 1080, 1200, 1920, 2048, 3840.
43
+ * If omitted or set to `"defaults"`, the following widths will be used: 640, 750, 828, 1080,
44
+ * 1200, 1920, 2048, 3840.
50
45
  *
51
- * If the image field contains responsive views, each responsive view can
52
- * be used as a width in the resulting `srcset` by passing `"thumbnails"`
53
- * as the `widths` prop.
46
+ * If the image field contains responsive views, each responsive view can be used as a width
47
+ * in the resulting `srcset` by passing `"thumbnails"` as the `widths` prop.
54
48
  */
55
49
  widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
56
50
  pixelDensities?: never;
@@ -59,14 +53,13 @@ type PrismicImageProps = {
59
53
  /**
60
54
  * Pixel densities used to build a `srcset` value for the image field.
61
55
  *
62
- * If a `pixelDensities` prop is passed `"defaults"`, the following pixel
63
- * densities will be used: 1, 2, 3.
56
+ * If a `pixelDensities` prop is passed `"defaults"`, the following pixel densities will be
57
+ * used: 1, 2, 3.
64
58
  */
65
59
  pixelDensities: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
66
60
  });
67
- declare const __VLS_export: vue11.DefineComponent<({
68
- /** The Prismic image field or thumbnail to render. */
69
- field: ImageField | ImageField<string>;
61
+ declare const __VLS_export: _$vue.DefineComponent<({
62
+ /** The Prismic image field or thumbnail to render. */field: ImageField | ImageField<string>;
70
63
  /**
71
64
  * An object of Imgix URL API parameters to transform the image.
72
65
  *
@@ -76,48 +69,42 @@ declare const __VLS_export: vue11.DefineComponent<({
76
69
  /**
77
70
  * Declare an image as decorative by providing `alt=""`.
78
71
  *
79
- * See:
80
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
72
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
81
73
  */
82
74
  alt?: "";
83
75
  /**
84
- * Declare an image as decorative only if the image field does not have
85
- * alternative text by providing `fallbackAlt=""`.
76
+ * Declare an image as decorative only if the image field does not have alternative text by
77
+ * providing `fallbackAlt=""`.
86
78
  *
87
- * See:
88
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
79
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
89
80
  */
90
81
  fallbackAlt?: "";
91
82
  /**
92
83
  * The width attribute of the image element.
93
84
  *
94
- * See:
95
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
85
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
96
86
  */
97
87
  width?: number | string;
98
88
  /**
99
89
  * The height attribute of the image element.
100
90
  *
101
- * See:
102
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
91
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
103
92
  */
104
93
  height?: number | string;
105
94
  } & {
106
95
  /**
107
96
  * Widths (in pixels) used to build a `srcset` value for the image field.
108
97
  *
109
- * If omitted or set to `"defaults"`, the following widths will be used:
110
- * 640, 750, 828, 1080, 1200, 1920, 2048, 3840.
98
+ * If omitted or set to `"defaults"`, the following widths will be used: 640, 750, 828, 1080,
99
+ * 1200, 1920, 2048, 3840.
111
100
  *
112
- * If the image field contains responsive views, each responsive view can
113
- * be used as a width in the resulting `srcset` by passing `"thumbnails"`
114
- * as the `widths` prop.
101
+ * If the image field contains responsive views, each responsive view can be used as a width
102
+ * in the resulting `srcset` by passing `"thumbnails"` as the `widths` prop.
115
103
  */
116
104
  widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
117
105
  pixelDensities?: never;
118
106
  }) | ({
119
- /** The Prismic image field or thumbnail to render. */
120
- field: ImageField | ImageField<string>;
107
+ /** The Prismic image field or thumbnail to render. */field: ImageField | ImageField<string>;
121
108
  /**
122
109
  * An object of Imgix URL API parameters to transform the image.
123
110
  *
@@ -127,30 +114,26 @@ declare const __VLS_export: vue11.DefineComponent<({
127
114
  /**
128
115
  * Declare an image as decorative by providing `alt=""`.
129
116
  *
130
- * See:
131
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
117
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
132
118
  */
133
119
  alt?: "";
134
120
  /**
135
- * Declare an image as decorative only if the image field does not have
136
- * alternative text by providing `fallbackAlt=""`.
121
+ * Declare an image as decorative only if the image field does not have alternative text by
122
+ * providing `fallbackAlt=""`.
137
123
  *
138
- * See:
139
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
124
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
140
125
  */
141
126
  fallbackAlt?: "";
142
127
  /**
143
128
  * The width attribute of the image element.
144
129
  *
145
- * See:
146
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
130
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
147
131
  */
148
132
  width?: number | string;
149
133
  /**
150
134
  * The height attribute of the image element.
151
135
  *
152
- * See:
153
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
136
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
154
137
  */
155
138
  height?: number | string;
156
139
  } & {
@@ -158,13 +141,12 @@ declare const __VLS_export: vue11.DefineComponent<({
158
141
  /**
159
142
  * Pixel densities used to build a `srcset` value for the image field.
160
143
  *
161
- * If a `pixelDensities` prop is passed `"defaults"`, the following pixel
162
- * densities will be used: 1, 2, 3.
144
+ * If a `pixelDensities` prop is passed `"defaults"`, the following pixel densities will be
145
+ * used: 1, 2, 3.
163
146
  */
164
147
  pixelDensities: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
165
- }), {}, {}, {}, {}, vue11.ComponentOptionsMixin, vue11.ComponentOptionsMixin, {}, string, vue11.PublicProps, Readonly<({
166
- /** The Prismic image field or thumbnail to render. */
167
- field: ImageField | ImageField<string>;
148
+ }), {}, {}, {}, {}, _$vue.ComponentOptionsMixin, _$vue.ComponentOptionsMixin, {}, string, _$vue.PublicProps, Readonly<({
149
+ /** The Prismic image field or thumbnail to render. */field: ImageField | ImageField<string>;
168
150
  /**
169
151
  * An object of Imgix URL API parameters to transform the image.
170
152
  *
@@ -174,48 +156,42 @@ declare const __VLS_export: vue11.DefineComponent<({
174
156
  /**
175
157
  * Declare an image as decorative by providing `alt=""`.
176
158
  *
177
- * See:
178
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
159
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
179
160
  */
180
161
  alt?: "";
181
162
  /**
182
- * Declare an image as decorative only if the image field does not have
183
- * alternative text by providing `fallbackAlt=""`.
163
+ * Declare an image as decorative only if the image field does not have alternative text by
164
+ * providing `fallbackAlt=""`.
184
165
  *
185
- * See:
186
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
166
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
187
167
  */
188
168
  fallbackAlt?: "";
189
169
  /**
190
170
  * The width attribute of the image element.
191
171
  *
192
- * See:
193
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
172
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
194
173
  */
195
174
  width?: number | string;
196
175
  /**
197
176
  * The height attribute of the image element.
198
177
  *
199
- * See:
200
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
178
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
201
179
  */
202
180
  height?: number | string;
203
181
  } & {
204
182
  /**
205
183
  * Widths (in pixels) used to build a `srcset` value for the image field.
206
184
  *
207
- * If omitted or set to `"defaults"`, the following widths will be used:
208
- * 640, 750, 828, 1080, 1200, 1920, 2048, 3840.
185
+ * If omitted or set to `"defaults"`, the following widths will be used: 640, 750, 828, 1080,
186
+ * 1200, 1920, 2048, 3840.
209
187
  *
210
- * If the image field contains responsive views, each responsive view can
211
- * be used as a width in the resulting `srcset` by passing `"thumbnails"`
212
- * as the `widths` prop.
188
+ * If the image field contains responsive views, each responsive view can be used as a width
189
+ * in the resulting `srcset` by passing `"thumbnails"` as the `widths` prop.
213
190
  */
214
191
  widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
215
192
  pixelDensities?: never;
216
193
  }) | ({
217
- /** The Prismic image field or thumbnail to render. */
218
- field: ImageField | ImageField<string>;
194
+ /** The Prismic image field or thumbnail to render. */field: ImageField | ImageField<string>;
219
195
  /**
220
196
  * An object of Imgix URL API parameters to transform the image.
221
197
  *
@@ -225,30 +201,26 @@ declare const __VLS_export: vue11.DefineComponent<({
225
201
  /**
226
202
  * Declare an image as decorative by providing `alt=""`.
227
203
  *
228
- * See:
229
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
204
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
230
205
  */
231
206
  alt?: "";
232
207
  /**
233
- * Declare an image as decorative only if the image field does not have
234
- * alternative text by providing `fallbackAlt=""`.
208
+ * Declare an image as decorative only if the image field does not have alternative text by
209
+ * providing `fallbackAlt=""`.
235
210
  *
236
- * See:
237
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
211
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
238
212
  */
239
213
  fallbackAlt?: "";
240
214
  /**
241
215
  * The width attribute of the image element.
242
216
  *
243
- * See:
244
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
217
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width
245
218
  */
246
219
  width?: number | string;
247
220
  /**
248
221
  * The height attribute of the image element.
249
222
  *
250
- * See:
251
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
223
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height
252
224
  */
253
225
  height?: number | string;
254
226
  } & {
@@ -256,11 +228,11 @@ declare const __VLS_export: vue11.DefineComponent<({
256
228
  /**
257
229
  * Pixel densities used to build a `srcset` value for the image field.
258
230
  *
259
- * If a `pixelDensities` prop is passed `"defaults"`, the following pixel
260
- * densities will be used: 1, 2, 3.
231
+ * If a `pixelDensities` prop is passed `"defaults"`, the following pixel densities will be
232
+ * used: 1, 2, 3.
261
233
  */
262
234
  pixelDensities: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
263
- })> & Readonly<{}>, {}, {}, {}, {}, string, vue11.ComponentProvideOptions, false, {}, any>;
235
+ })> & Readonly<{}>, {}, {}, {}, {}, string, _$vue.ComponentProvideOptions, false, {}, any>;
264
236
  declare const _default: typeof __VLS_export;
265
237
  //#endregion
266
238
  export { PrismicImageProps, _default };
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.vue.d.cts","names":[],"sources":["../src/PrismicImage.vue"],"sourcesContent":[],"mappings":";;;;;KAgNY,iBAAA;EAAA;EAEJ,KAAA,EAAA,UAAA,GAAa,UAAb,CAAA,MAAA,CAAA;EAAa;;;;;EAsDf,WAAA,CAAA,EA/CS,UA+CT,CAAA,OA/C2B,UA+C3B,CAAA,CAAA,CAAA,CAAA;EAekB;;;;AAIvB;;EAzEoB,GAAA,CAAA,EAAA,EAAA;EAOY;;;;;;;EAAA,WAAA,CAAA,EAAA,EAAA;EAAlB;;;;;;;EAPP;;;;;;EAsDF,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA;CAtDE,GAAA,CAAA;EAAa;;;;;;;;;;EAsMH,MAAA,CAAA,EAhJZ,WAgJY,CAhJA,UAgJA,CAAA,OAhJkB,kBAgJlB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,GAAA,YAAA,GAAA,UAAA;EAAA,cAGsB,CAAA,EAAA,KAAZ;;;;;;;;;kBArItB,YACA,kBAAkB;;cAiIlB,oBAAY;;SAtMV,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA+C3B,YAAY,kBAAkB;;;;SAtD5B,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6D3B,YACA,kBAAkB;oBADP,KAAA,CAAA,qBAAA;;SApET,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA+C3B,YAAY,kBAAkB;;;;SAtD5B,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6D3B,YACA,kBAAkB;;cAiIN,iBAGU"}
1
+ {"version":3,"file":"PrismicImage.vue.d.cts","names":[],"sources":["../src/PrismicImage.vue"],"mappings":";;;;;KAgMY,iBAAA;EAAA,sDAEX,KAAA,EAAO,UAAA,GAAa,UAAA;;;;;;EAOpB,WAAA,GAAc,UAAA,QAAkB,UAAA;EA0Cf;;;;;EAnCjB,GAAA;EAiDgB;;;;;;EAzChB,WAAA;EARA;;;;;EAeA,KAAA;EAoBiB;;;;;EAbjB,MAAA;AAAA;EA2BmC;;;AAGnC;;;;;;EAlBE,MAAA,GACG,WAAA,CAAY,UAAA,QAAkB,kBAAA;EAGjC,cAAA;AAAA;EAGA,MAAA;EAvDK;;;;;;EA8DL,cAAA,EACG,WAAA,CAAY,UAAA,QAAkB,yBAAA;AAAA;AAAA,cA+H9B,YAAA,QAAY,eAAA;+DA9LV,UAAA,GAAa,UAAA;EAAA;;;;;gBAON,UAAA,QAAkB,UAAA;EAPzB;;;;;;EA+DF;;;;;;;EA+HY;;;;;;EAvLe;;;;;;;EA0Cf;;;;;;;;;WAAZ,WAAA,CAAY,UAAA,QAAkB,kBAAA;;;+DAjD5B,UAAA,GAAa,UAAA;;;;;;gBAON,UAAA,QAAkB,UAAA;EAwD4B;;;;;;EAxD9C;;;;;;;EA0CT;;;;;;EAjDe;;;;;;;;;;;;;;kBA+Df,WAAA,CAAY,UAAA,QAAkB,yBAAA;AAAA,oBAAnB,KAAA,CAAA,qBAAA;+DA/DT,UAAA,GAAa,UAAA;EAiMmB;;;;;gBA1LzB,UAAA,QAAkB,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA0C3B,WAAA,CAAY,UAAA,QAAkB,kBAAA;;;+DAjD5B,UAAA,GAAa,UAAA;;;;;;gBAON,UAAA,QAAkB,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwD3B,WAAA,CAAY,UAAA,QAAkB,yBAAA;AAAA;+BAkIR,YAAA"}