@prismicio/vue 5.3.0-canary.4c3e4ab → 5.3.0-canary.87748cc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/PrismicImage.vue.d.cts +20 -27
  2. package/dist/PrismicImage.vue.d.cts.map +1 -1
  3. package/dist/PrismicLink.vue.d.cts +6 -18
  4. package/dist/PrismicLink.vue.d.cts.map +1 -1
  5. package/dist/PrismicRichText/PrismicRichText.vue.d.cts +6 -9
  6. package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
  7. package/dist/PrismicTable/PrismicTable.vue.d.cts +4 -7
  8. package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
  9. package/dist/PrismicText.vue.d.cts +1 -3
  10. package/dist/PrismicText.vue.d.cts.map +1 -1
  11. package/dist/SliceZone/SliceZone.vue.d.cts +3 -9
  12. package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
  13. package/dist/package.cjs +1 -1
  14. package/dist/package.cjs.map +1 -1
  15. package/dist/package.js +1 -1
  16. package/dist/package.js.map +1 -1
  17. package/dist/src/PrismicImage.cjs.map +1 -1
  18. package/dist/src/PrismicImage.js.map +1 -1
  19. package/dist/src/PrismicImage.vue.d.ts +20 -27
  20. package/dist/src/PrismicImage.vue.d.ts.map +1 -1
  21. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  22. package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/src/PrismicLink.cjs.map +1 -1
  24. package/dist/src/PrismicLink.js.map +1 -1
  25. package/dist/src/PrismicLink.vue.d.ts +6 -18
  26. package/dist/src/PrismicLink.vue.d.ts.map +1 -1
  27. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  28. package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  29. package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -1
  30. package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -1
  31. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +2 -5
  32. package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
  33. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  34. package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -1
  36. package/dist/src/PrismicTable/PrismicTable.js.map +1 -1
  37. package/dist/src/PrismicTable/PrismicTable.vue.d.ts +2 -5
  38. package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
  39. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  40. package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/src/PrismicText.cjs.map +1 -1
  42. package/dist/src/PrismicText.js.map +1 -1
  43. package/dist/src/PrismicText.vue.d.ts +1 -3
  44. package/dist/src/PrismicText.vue.d.ts.map +1 -1
  45. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  46. package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
  47. package/dist/src/SliceZone/SliceZone.cjs.map +1 -1
  48. package/dist/src/SliceZone/SliceZone.js.map +1 -1
  49. package/dist/src/SliceZone/SliceZone.vue.d.ts +3 -9
  50. package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -1
  51. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
  52. package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/package.json +1 -1
  54. package/src/PrismicImage.vue +6 -7
  55. package/src/PrismicLink.vue +2 -6
  56. package/src/PrismicRichText/PrismicRichText.vue +2 -5
  57. package/src/PrismicTable/PrismicTable.vue +2 -5
  58. package/src/PrismicText.vue +1 -3
  59. package/src/SliceZone/SliceZone.vue +3 -9
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.vue_vue_type_script_setup_true_lang.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/**\n * Props for `<PrismicImage />`.\n */\nexport type PrismicImageProps = {\n\t/**\n\t * The Prismic image field or thumbnail to render.\n\t */\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,QAAQ,YAAY,MAAM,QAAQ,GAClD,SAAQ,KACP,qQAAqQ,sBACpQ,8BACA,GACF;AAGD,OAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,gBAAgB,GAClE,SAAQ,KACP,qSAAqS,sBACpS,8BACA,GACF;AAGD,OAAI,MAAM,UAAU,MAAM,eACzB,SAAQ,KACP,4MACD;IAED;EAGF,MAAM,WAAW,UAA2D;AAC3E,OAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;QACD;IACN,MAAM,SAAS,OAAO,SAAS,MAAK;AAEpC,QAAI,OAAO,MAAM,OAAO,CACvB;QAEA,QAAO;;;EAKV,MAAM,gCAAuB;AAC5B,OAAI,CAAC,4BAAS,eAAe,MAAM,MAAM,CACxC;GAGD,IAAI;GACJ,IAAI;AACJ,OAAI,MAAM,UAAU,CAAC,MAAM,gBAAgB;IAC1C,MAAM,iDAAyB,MAAM,OAAO;KAC3C,GAAG,MAAM;KACT,QAAQ,MAAM,WAAW,aAAa,SAAY,MAAM;KACxD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;cACH,MAAM,gBAAgB;IAChC,MAAM,wDAAgC,MAAM,OAAO;KAClD,GAAG,MAAM;KACT,gBACC,MAAM,mBAAmB,aAAa,SAAY,MAAM;KACzD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;;GAGd,MAAM,KAAK,MAAM,MAAM,WAAW,QAAQ,MAAM,MAAM,WAAW;GAEjE,MAAM,cAAc,QAAQ,MAAM,MAAK;GACvC,MAAM,eAAe,QAAQ,MAAM,OAAM;GAEzC,IAAI,gBAAgB,eAAe,MAAM,MAAM,WAAW;GAC1D,IAAI,iBAAiB,gBAAgB,MAAM,MAAM,WAAW;AAE5D,OAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;YACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;AAGhC,UAAO;IACN;IACA;IACA,KAAK,MAAM,QAAQ,MAAM,MAAM,OAAO,MAAM;IAC5C,OAAO,KAAK,MAAM,cAAc;IAChC,QAAQ,KAAK,MAAM,eAAe;IACnC;IACA;;UAKO,MAAA,2DAML,OAAA;;IALA,KAAK,MAAA,MAAM;IACX,QAAQ,MAAA,MAAM;IACd,KAAK,MAAA,MAAM;IACX,OAAO,MAAA,MAAM;IACb,QAAQ,MAAA,MAAM"}
1
+ {"version":3,"file":"PrismicImage.vue_vue_type_script_setup_true_lang.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/**\n * Props for `<PrismicImage />`.\n */\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\n\t\t\t * 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\n\t\t\t * can be used as a width in the resulting `srcset` by passing\n\t\t\t * `\"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\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6FA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,QAAQ,YAAY,MAAM,QAAQ,GAClD,SAAQ,KACP,qQAAqQ,sBACpQ,8BACA,GACF;AAGD,OAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,gBAAgB,GAClE,SAAQ,KACP,qSAAqS,sBACpS,8BACA,GACF;AAGD,OAAI,MAAM,UAAU,MAAM,eACzB,SAAQ,KACP,4MACD;IAED;EAGF,MAAM,WAAW,UAA2D;AAC3E,OAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;QACD;IACN,MAAM,SAAS,OAAO,SAAS,MAAK;AAEpC,QAAI,OAAO,MAAM,OAAO,CACvB;QAEA,QAAO;;;EAKV,MAAM,gCAAuB;AAC5B,OAAI,CAAC,4BAAS,eAAe,MAAM,MAAM,CACxC;GAGD,IAAI;GACJ,IAAI;AACJ,OAAI,MAAM,UAAU,CAAC,MAAM,gBAAgB;IAC1C,MAAM,iDAAyB,MAAM,OAAO;KAC3C,GAAG,MAAM;KACT,QAAQ,MAAM,WAAW,aAAa,SAAY,MAAM;KACxD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;cACH,MAAM,gBAAgB;IAChC,MAAM,wDAAgC,MAAM,OAAO;KAClD,GAAG,MAAM;KACT,gBACC,MAAM,mBAAmB,aAAa,SAAY,MAAM;KACzD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;;GAGd,MAAM,KAAK,MAAM,MAAM,WAAW,QAAQ,MAAM,MAAM,WAAW;GAEjE,MAAM,cAAc,QAAQ,MAAM,MAAK;GACvC,MAAM,eAAe,QAAQ,MAAM,OAAM;GAEzC,IAAI,gBAAgB,eAAe,MAAM,MAAM,WAAW;GAC1D,IAAI,iBAAiB,gBAAgB,MAAM,MAAM,WAAW;AAE5D,OAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;YACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;AAGhC,UAAO;IACN;IACA;IACA,KAAK,MAAM,QAAQ,MAAM,MAAM,OAAO,MAAM;IAC5C,OAAO,KAAK,MAAM,cAAc;IAChC,QAAQ,KAAK,MAAM,eAAe;IACnC;IACA;;UAKO,MAAA,2DAML,OAAA;;IALA,KAAK,MAAA,MAAM;IACX,QAAQ,MAAA,MAAM;IACd,KAAK,MAAA,MAAM;IACX,OAAO,MAAA,MAAM;IACb,QAAQ,MAAA,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.vue_vue_type_script_setup_true_lang.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/**\n * Props for `<PrismicImage />`.\n */\nexport type PrismicImageProps = {\n\t/**\n\t * The Prismic image field or thumbnail to render.\n\t */\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,QAAQ,YAAY,MAAM,QAAQ,GAClD,SAAQ,KACP,qQAAqQ,OACpQ,8BACA,GACF;AAGD,OAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,gBAAgB,GAClE,SAAQ,KACP,qSAAqS,OACpS,8BACA,GACF;AAGD,OAAI,MAAM,UAAU,MAAM,eACzB,SAAQ,KACP,4MACD;IAED;EAGF,MAAM,WAAW,UAA2D;AAC3E,OAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;QACD;IACN,MAAM,SAAS,OAAO,SAAS,MAAK;AAEpC,QAAI,OAAO,MAAM,OAAO,CACvB;QAEA,QAAO;;;EAKV,MAAM,QAAQ,eAAe;AAC5B,OAAI,CAAC,SAAS,eAAe,MAAM,MAAM,CACxC;GAGD,IAAI;GACJ,IAAI;AACJ,OAAI,MAAM,UAAU,CAAC,MAAM,gBAAgB;IAC1C,MAAM,MAAM,mBAAmB,MAAM,OAAO;KAC3C,GAAG,MAAM;KACT,QAAQ,MAAM,WAAW,aAAa,SAAY,MAAM;KACxD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;cACH,MAAM,gBAAgB;IAChC,MAAM,MAAM,0BAA0B,MAAM,OAAO;KAClD,GAAG,MAAM;KACT,gBACC,MAAM,mBAAmB,aAAa,SAAY,MAAM;KACzD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;;GAGd,MAAM,KAAK,MAAM,MAAM,WAAW,QAAQ,MAAM,MAAM,WAAW;GAEjE,MAAM,cAAc,QAAQ,MAAM,MAAK;GACvC,MAAM,eAAe,QAAQ,MAAM,OAAM;GAEzC,IAAI,gBAAgB,eAAe,MAAM,MAAM,WAAW;GAC1D,IAAI,iBAAiB,gBAAgB,MAAM,MAAM,WAAW;AAE5D,OAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;YACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;AAGhC,UAAO;IACN;IACA;IACA,KAAK,MAAM,QAAQ,MAAM,MAAM,OAAO,MAAM;IAC5C,OAAO,KAAK,MAAM,cAAc;IAChC,QAAQ,KAAK,MAAM,eAAe;IACnC;IACA;;UAKO,MAAA,sBADP,mBAOE,OAAA;;IALA,KAAK,MAAA,MAAM;IACX,QAAQ,MAAA,MAAM;IACd,KAAK,MAAA,MAAM;IACX,OAAO,MAAA,MAAM;IACb,QAAQ,MAAA,MAAM"}
1
+ {"version":3,"file":"PrismicImage.vue_vue_type_script_setup_true_lang.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/**\n * Props for `<PrismicImage />`.\n */\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\n\t\t\t * 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\n\t\t\t * can be used as a width in the resulting `srcset` by passing\n\t\t\t * `\"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\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6FA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,QAAQ,YAAY,MAAM,QAAQ,GAClD,SAAQ,KACP,qQAAqQ,OACpQ,8BACA,GACF;AAGD,OAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,gBAAgB,GAClE,SAAQ,KACP,qSAAqS,OACpS,8BACA,GACF;AAGD,OAAI,MAAM,UAAU,MAAM,eACzB,SAAQ,KACP,4MACD;IAED;EAGF,MAAM,WAAW,UAA2D;AAC3E,OAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;QACD;IACN,MAAM,SAAS,OAAO,SAAS,MAAK;AAEpC,QAAI,OAAO,MAAM,OAAO,CACvB;QAEA,QAAO;;;EAKV,MAAM,QAAQ,eAAe;AAC5B,OAAI,CAAC,SAAS,eAAe,MAAM,MAAM,CACxC;GAGD,IAAI;GACJ,IAAI;AACJ,OAAI,MAAM,UAAU,CAAC,MAAM,gBAAgB;IAC1C,MAAM,MAAM,mBAAmB,MAAM,OAAO;KAC3C,GAAG,MAAM;KACT,QAAQ,MAAM,WAAW,aAAa,SAAY,MAAM;KACxD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;cACH,MAAM,gBAAgB;IAChC,MAAM,MAAM,0BAA0B,MAAM,OAAO;KAClD,GAAG,MAAM;KACT,gBACC,MAAM,mBAAmB,aAAa,SAAY,MAAM;KACzD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;;GAGd,MAAM,KAAK,MAAM,MAAM,WAAW,QAAQ,MAAM,MAAM,WAAW;GAEjE,MAAM,cAAc,QAAQ,MAAM,MAAK;GACvC,MAAM,eAAe,QAAQ,MAAM,OAAM;GAEzC,IAAI,gBAAgB,eAAe,MAAM,MAAM,WAAW;GAC1D,IAAI,iBAAiB,gBAAgB,MAAM,MAAM,WAAW;AAE5D,OAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;YACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;AAGhC,UAAO;IACN;IACA;IACA,KAAK,MAAM,QAAQ,MAAM,MAAM,OAAO,MAAM;IAC5C,OAAO,KAAK,MAAM,cAAc;IAChC,QAAQ,KAAK,MAAM,eAAe;IACnC;IACA;;UAKO,MAAA,sBADP,mBAOE,OAAA;;IALA,KAAK,MAAA,MAAM;IACX,QAAQ,MAAA,MAAM;IACd,KAAK,MAAA,MAAM;IACX,OAAO,MAAA,MAAM;IACb,QAAQ,MAAA,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.cjs","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic link field to render.\n\t\t\t */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic document to render as a link.\n\t\t\t */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicLink.cjs","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.js","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic link field to render.\n\t\t\t */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic document to render as a link.\n\t\t\t */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicLink.js","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":""}
@@ -40,15 +40,11 @@ type PrismicLinkProps = {
40
40
  */
41
41
  externalComponent?: ComponentOrTagName;
42
42
  } & ({
43
- /**
44
- * The Prismic link field to render.
45
- */
43
+ /** The Prismic link field to render. */
46
44
  field: LinkField;
47
45
  document?: never;
48
46
  } | {
49
- /**
50
- * The Prismic document to render as a link.
51
- */
47
+ /** The Prismic document to render as a link. */
52
48
  document: PrismicDocument;
53
49
  field?: never;
54
50
  });
@@ -89,9 +85,7 @@ declare const __VLS_base: vue16.DefineComponent<({
89
85
  */
90
86
  externalComponent?: ComponentOrTagName;
91
87
  } & {
92
- /**
93
- * The Prismic link field to render.
94
- */
88
+ /** The Prismic link field to render. */
95
89
  field: LinkField;
96
90
  document?: never;
97
91
  }) | ({
@@ -127,9 +121,7 @@ declare const __VLS_base: vue16.DefineComponent<({
127
121
  */
128
122
  externalComponent?: ComponentOrTagName;
129
123
  } & {
130
- /**
131
- * The Prismic document to render as a link.
132
- */
124
+ /** The Prismic document to render as a link. */
133
125
  document: PrismicDocument;
134
126
  field?: never;
135
127
  }), {}, {}, {}, {}, vue16.ComponentOptionsMixin, vue16.ComponentOptionsMixin, {}, string, vue16.PublicProps, Readonly<({
@@ -165,9 +157,7 @@ declare const __VLS_base: vue16.DefineComponent<({
165
157
  */
166
158
  externalComponent?: ComponentOrTagName;
167
159
  } & {
168
- /**
169
- * The Prismic link field to render.
170
- */
160
+ /** The Prismic link field to render. */
171
161
  field: LinkField;
172
162
  document?: never;
173
163
  }) | ({
@@ -203,9 +193,7 @@ declare const __VLS_base: vue16.DefineComponent<({
203
193
  */
204
194
  externalComponent?: ComponentOrTagName;
205
195
  } & {
206
- /**
207
- * The Prismic document to render as a link.
208
- */
196
+ /** The Prismic document to render as a link. */
209
197
  document: PrismicDocument;
210
198
  field?: never;
211
199
  })> & Readonly<{}>, {}, {}, {}, {}, string, vue16.ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":";;;;;;;;AAkKA;AAUgB,KAVJ,gBAAA,GAUI;EAOA;;;;;;AAiCf;AA0EqB;AAEc;EApHpB,YAAA,CAAA,EAAA,oBAAA;EAOA;;;;;EAAA,GAAA,CAAA,EAAA,MAAA,GAAA,iBAAA,CAAA,KAAA,CAAA;EAUK;;;;;;;;EAAA,iBAAA,CAAA,EAAA,kBAAA;EAOA;;;;;EAAA,iBAAA,CAAA,EAAA,kBAAA;CAaR,GAAA,CAAA;;;;OAoFG,EA3FN,SA2FM;EAAA,QAAA,CAAA,EAAA,KAAA;AAAA,CAAA,GAGV;EAA4C;;;EAAR,QAAA,EAvF7B,eAuF6B;EAAA,KAAA,CAAA,EAAA,KACF;AAAxC,CAAA,CAAA;YAXI;KACC,WAAA;2BACwB;;cAKvB,kBAAU;;;;;;;;;;iBAzHA;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;;;SAMX;;;;;;;;;;;;iBA9BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;;;YAaR;;oBAAe,KAAA,CAAA,qBAAA;;;;;;;;;;iBArCZ;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;;;SAMX;;;;;;;;;;;;iBA9BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;;;YAaR;;;cAuFP,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
1
+ {"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":";;;;;;;;AA8JA;AAUgB,KAVJ,gBAAA,GAUI;EAOA;;;;;;AA6Bf;AA0EqB;AAEc;EAhHpB,YAAA,CAAA,EAAA,oBAAA;EAOA;;;;;EAAA,GAAA,CAAA,EAAA,MAAA,GAAA,iBAAA,CAAA,KAAA,CAAA;EAUK;;;;;;;;EAAA,iBAAA,CAAA,EAAA,kBAAA;EAOA;;;;;EAAA,iBAAA,CAAA,EAAA,kBAAA;CASR,GAAA,CAAA;;SALH;;;EAyFM;EAGV,QAAA,EAvFO,eAuF6D;EAAxB,KAAA,CAAA,EAAA,KAAA;CAAY,CAAA;YAV1D,OAUuB,EAAA,CAAA,CAAA;KATtB,WAAA,GASqC,CAAA,CAAA,GAAA;EAAA,OAAA,CAAA,EAAA,CACF,KAAA,EAAA,OATX,OASD,EAAA,GAAY,GAAA;AAAxC,CAAA;cAJM,kBAAU;;;;;;;;;;iBArHA;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;oBAAe,KAAA,CAAA,qBAAA;;;;;;;;;;iBAjCZ;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;;cAuFP,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic link field to render.\n\t\t\t */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic document to render as a link.\n\t\t\t */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;AAiBA,MAAM,2BAA2B;;;;AAKjC,MAAM,2BAA2B;;;;AAKjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDpC,MAAM,QAAQ;EAGd,MAAM,mCAA0B;AAC/B,8CAAmB,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM;IACpB,IAAI,MAAM;AACT,SAAI,MAAM,IACT,QAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,KAAK,GAAG,MAAM;AAGlE,YAAO,KAAK,aAAa,8BAA8B;;IAExD,CAAA;IACD;EAED,MAAM,oCAA2B;AAChC,UAAO,oCAAc,SAAS,MAAM,QAAQ,GAAE,GAC3C,MAAM,qBAAqB,2BAC3B,MAAM,qBAAqB;IAC9B;EAGD,MAAM,gCAAuB;AAC5B,UAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB,GACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB;IACF;;sFAIgB,UAAA,MAAS,sDAAU,MAAA,MAAK,CAAA,EAAA;oCAGhC,qBAAA,KAAA,QAAA,WAAA,EAAA,QAAA,mDADH,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,OAAS,EAAA,EAAA"}
1
+ {"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;AAiBA,MAAM,2BAA2B;;;;AAKjC,MAAM,2BAA2B;;;;AAKjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDpC,MAAM,QAAQ;EAGd,MAAM,mCAA0B;AAC/B,8CAAmB,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM;IACpB,IAAI,MAAM;AACT,SAAI,MAAM,IACT,QAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,KAAK,GAAG,MAAM;AAGlE,YAAO,KAAK,aAAa,8BAA8B;;IAExD,CAAA;IACD;EAED,MAAM,oCAA2B;AAChC,UAAO,oCAAc,SAAS,MAAM,QAAQ,GAAE,GAC3C,MAAM,qBAAqB,2BAC3B,MAAM,qBAAqB;IAC9B;EAGD,MAAM,gCAAuB;AAC5B,UAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB,GACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB;IACF;;sFAIgB,UAAA,MAAS,sDAAU,MAAA,MAAK,CAAA,EAAA;oCAGhC,qBAAA,KAAA,QAAA,WAAA,EAAA,QAAA,mDADH,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,OAAS,EAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic link field to render.\n\t\t\t */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Prismic document to render as a link.\n\t\t\t */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;AAiBA,MAAM,2BAA2B;;;;AAKjC,MAAM,2BAA2B;;;;AAKjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDpC,MAAM,QAAQ;EAGd,MAAM,WAAW,eAAe;AAC/B,UAAO,YAAY,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM;IACpB,IAAI,MAAM;AACT,SAAI,MAAM,IACT,QAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,KAAK,GAAG,MAAM;AAGlE,YAAO,KAAK,aAAa,8BAA8B;;IAExD,CAAA;IACD;EAED,MAAM,YAAY,eAAe;AAChC,UAAO,cAAc,SAAS,MAAM,QAAQ,GAAE,GAC3C,MAAM,qBAAqB,2BAC3B,MAAM,qBAAqB;IAC9B;EAGD,MAAM,QAAQ,eAAe;AAC5B,UAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB,GACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB;IACF;;uBAIA,YAIY,wBAJI,UAAA,MAAS,EAAA,eAAA,mBAAU,MAAA,MAAK,CAAA,EAAA;2BAGhC,CAFP,WAEO,KAAA,QAAA,WAAA,EAAA,QAAA,iCADH,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,OAAS,EAAA,EAAA"}
1
+ {"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || defaultInternalComponent\n\t\t: props.externalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":";;;;;;;;AAiBA,MAAM,2BAA2B;;;;AAKjC,MAAM,2BAA2B;;;;AAKjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDpC,MAAM,QAAQ;EAGd,MAAM,WAAW,eAAe;AAC/B,UAAO,YAAY,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM;IACpB,IAAI,MAAM;AACT,SAAI,MAAM,IACT,QAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,KAAK,GAAG,MAAM;AAGlE,YAAO,KAAK,aAAa,8BAA8B;;IAExD,CAAA;IACD;EAED,MAAM,YAAY,eAAe;AAChC,UAAO,cAAc,SAAS,MAAM,QAAQ,GAAE,GAC3C,MAAM,qBAAqB,2BAC3B,MAAM,qBAAqB;IAC9B;EAGD,MAAM,QAAQ,eAAe;AAC5B,UAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB,GACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB;IACF;;uBAIA,YAIY,wBAJI,UAAA,MAAS,EAAA,eAAA,mBAAU,MAAA,MAAK,CAAA,EAAA;2BAGhC,CAFP,WAEO,KAAA,QAAA,WAAA,EAAA,QAAA,iCADH,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,OAAS,EAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicRichText.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a\n\t * shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicRichText.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicRichText.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a\n\t * shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicRichText.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
@@ -9,9 +9,7 @@ import { LinkResolverFunction, RichTextField } from "@prismicio/client";
9
9
  * Props for `<PrismicRichText />`.
10
10
  */
11
11
  type PrismicRichTextProps = {
12
- /**
13
- * The Prismic rich text field to render.
14
- */
12
+ /** The Prismic rich text field to render. */
15
13
  field: RichTextField | null | undefined;
16
14
  /**
17
15
  * The link resolver used to resolve links.
@@ -24,8 +22,7 @@ type PrismicRichTextProps = {
24
22
  */
25
23
  linkResolver?: LinkResolverFunction;
26
24
  /**
27
- * An object that maps a rich text block type to a Vue component or a
28
- * shorthand definition.
25
+ * An object that maps a rich text block type to a Vue component or a shorthand definition.
29
26
  *
30
27
  * @example
31
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicRichText.vue.d.ts","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;AAgKY,KAAA,oBAAA,GAAoB;EAIxB;;;EAiCI,KAAA,EAjCJ,aAiCI,GAAA,IAAA,GAAA,SAAA;EAAkB;AAC7B;;;;;;;;EA2HqC,YAAA,CAAA,EAlJtB,oBAkJsB;EAAQ;;;;;;;;;;;;;;eAlIhC;;;;AAsHI;aAhHN;;cAgHN,mBAAY,gBAY4B,IAAA,CAZ5B;;UAGU,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;oBAbe,IAAA,CAAA,qBAAA,qEAY4B,IAAA,CAAA;;UATlB,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;;cAbe,iBAkBU"}
1
+ {"version":3,"file":"PrismicRichText.vue.d.ts","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;AA6JY,KAAA,oBAAA,GAAoB;EAExB;EAWQ,KAAA,EAXR,aAWQ,GAAA,IAAA,GAAA,SAAA;EAeF;;;AAOb;;;;;;EAwHiB,YAAA,CAAA,EA9IF,oBA8IE;EAIf;;;;;;;;;;;;;EADmC,UAAA,CAAA,EAlIxB,qBAkIwB;EAAQ;;;;UAZ5B,CAAA,EAhHN,kBAgHM;CAAA;AAAA,cAAZ,YAkBsB,OAlBV,eAkBsB,CANM,IAAA,CAZ5B,gBAkBsB,CAAA;;UAfZ,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;oBAbe,IAAA,CAAA,qBAAA,qEAY4B,IAAA,CAAA;;UATlB,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;;cAbe,iBAkBU"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a\n\t * shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAiEA,MAAM,QAAQ;EAkBd,MAAM,mCAA0B;AAC/B,kDAAc,MAAM,SAAS,EAAE,CAAC,CAAC;IACjC;EAED,SAAS,qBAAqB,MAAqC;GAClE,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,WAAW;KACX;IACF;;EAGD,MAAM,6CAAkE;AACvE,UAAO;IACN,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,WAAW,qBAAqB,YAAY;IAC5C,cAAc,qBAAqB,eAAe;IAClD,QAAQ,qBAAqB,SAAS;IACtC,IAAI,qBAAqB,KAAK;IAC9B,aAAa,qBAAqB,WAAW;IAC7C,eAAe,qBAAqB,YAAY;IAChD,mBAAmB,qBAAqB,OAAO;IAC/C,qBAAqB,qBAAqB,QAAQ;IAClD,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,WAAW,qBAAqB,YAAY;IAC5C,OAAO,qBAAqB,QAAQ;IACpC,MAAM,qBAAqB,OAAO;IACnC;IACA;;UAKO,SAAA,MAAS,qDAGd,0CAAA;;IAFA,UAAU,SAAA;IACV,uBAAqB,mBAAA;uDAED,QAAA,wFAAe,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EA8DA,MAAM,QAAQ;EAkBd,MAAM,mCAA0B;AAC/B,kDAAc,MAAM,SAAS,EAAE,CAAC,CAAC;IACjC;EAED,SAAS,qBAAqB,MAAqC;GAClE,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,WAAW;KACX;IACF;;EAGD,MAAM,6CAAkE;AACvE,UAAO;IACN,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,WAAW,qBAAqB,YAAY;IAC5C,cAAc,qBAAqB,eAAe;IAClD,QAAQ,qBAAqB,SAAS;IACtC,IAAI,qBAAqB,KAAK;IAC9B,aAAa,qBAAqB,WAAW;IAC7C,eAAe,qBAAqB,YAAY;IAChD,mBAAmB,qBAAqB,OAAO;IAC/C,qBAAqB,qBAAqB,QAAQ;IAClD,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,WAAW,qBAAqB,YAAY;IAC5C,OAAO,qBAAqB,QAAQ;IACpC,MAAM,qBAAqB,OAAO;IACnC;IACA;;UAKO,SAAA,MAAS,qDAGd,0CAAA;;IAFA,UAAU,SAAA;IACV,uBAAqB,mBAAA;uDAED,QAAA,wFAAe,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a\n\t * shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAiEA,MAAM,QAAQ;EAkBd,MAAM,WAAW,eAAe;AAC/B,UAAO,OAAO,MAAM,SAAS,EAAE,CAAC,CAAC;IACjC;EAED,SAAS,qBAAqB,MAAqC;GAClE,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,eAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,WAAW;KACX;IACF;;EAGD,MAAM,qBAAqB,eAA6C;AACvE,UAAO;IACN,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,WAAW,qBAAqB,YAAY;IAC5C,cAAc,qBAAqB,eAAe;IAClD,QAAQ,qBAAqB,SAAS;IACtC,IAAI,qBAAqB,KAAK;IAC9B,aAAa,qBAAqB,WAAW;IAC7C,eAAe,qBAAqB,YAAY;IAChD,mBAAmB,qBAAqB,OAAO;IAC/C,qBAAqB,qBAAqB,QAAQ;IAClD,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,WAAW,qBAAqB,YAAY;IAC5C,OAAO,qBAAqB,QAAQ;IACpC,MAAM,qBAAqB,OAAO;IACnC;IACA;;UAKO,SAAA,MAAS,uBADhB,YAIE,kCAAA;;IAFA,UAAU,SAAA;IACV,uBAAqB,mBAAA;uDAED,QAAA,yBAAtB,YAAiD,wBAAZ,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EA8DA,MAAM,QAAQ;EAkBd,MAAM,WAAW,eAAe;AAC/B,UAAO,OAAO,MAAM,SAAS,EAAE,CAAC,CAAC;IACjC;EAED,SAAS,qBAAqB,MAAqC;GAClE,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,eAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,WAAW;KACX;IACF;;EAGD,MAAM,qBAAqB,eAA6C;AACvE,UAAO;IACN,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,WAAW,qBAAqB,YAAY;IAC5C,cAAc,qBAAqB,eAAe;IAClD,QAAQ,qBAAqB,SAAS;IACtC,IAAI,qBAAqB,KAAK;IAC9B,aAAa,qBAAqB,WAAW;IAC7C,eAAe,qBAAqB,YAAY;IAChD,mBAAmB,qBAAqB,OAAO;IAC/C,qBAAqB,qBAAqB,QAAQ;IAClD,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,WAAW,qBAAqB,YAAY;IAC5C,OAAO,qBAAqB,QAAQ;IACpC,MAAM,qBAAqB,OAAO;IACnC;IACA;;UAKO,SAAA,MAAS,uBADhB,YAIE,kCAAA;;IAFA,UAAU,SAAA;IACV,uBAAqB,mBAAA;uDAED,QAAA,yBAAtB,YAAiD,wBAAZ,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand\n\t * definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand\n\t * definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":""}
@@ -10,13 +10,10 @@ import { TableField } from "@prismicio/client";
10
10
  * Props for `<PrismicTable />`.
11
11
  */
12
12
  type PrismicTableProps = {
13
- /**
14
- * The Prismic table field to render.
15
- */
13
+ /** The Prismic table field to render. */
16
14
  field: TableField | undefined;
17
15
  /**
18
- * An object that maps a table block type to a Vue component or a shorthand
19
- * definition.
16
+ * An object that maps a table block type to a Vue component or a shorthand definition.
20
17
  *
21
18
  * @example
22
19
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KA+HY,iBAAA;EAAA;;;EAoBuB,KAAA,EAhB3B,UAgB2B,GAAA,SAAA;EAMvB;;AACX;;;;;;;;;;;AAkJiB;eAzJJ,qBAAqB;;;;;aAMvB;;cAmJN,cAAY,IAAA,CAAA,gBAAA,mCAAA,IAAA,CAAA,qBAAA,EAAA,IAAA,CAAA,qBAAA,cAAA,IAAA,CAAA,WAAA,EAAA,SAAA,qBAAA,sCAAA,IAAA,CAAA,uBAAA;cAAA,iBAGU"}
1
+ {"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KA4HY,iBAAA;EAAA;EAEJ,KAAA,EAAA,UAAA,GAAA,SAAA;EAeM;;;;AAOb;;;;;;;;;EAkJiB,UAAA,CAAA,EAzJJ,kBAyJI,GAzJiB,qBAyJjB;EAAA;AAAA;;;aAnJN;;cAmJN,cAAY,IAAA,CAAA,gBAAA,mCAAA,IAAA,CAAA,qBAAA,EAAA,IAAA,CAAA,qBAAA,cAAA,IAAA,CAAA,WAAA,EAAA,SAAA,qBAAA,sCAAA,IAAA,CAAA,uBAAA;cAAA,iBAGU"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand\n\t * definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,6DAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,0CAA6D;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;yBAKO,4BAAQ,CAAC,MAAM,QAAA,MAAK,gFACrB,gBAAA,MAAgB,MAAM,GAAE,sBA+BlB;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;oCAe3C,CAZL,QAAA,MAAM,oFACP,gBAAA,MAAgB,MAAM,GAAE,sBAWlB;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;gJAIT,gBAAA,MAAgB,MAAM,GAAE,sBAWlB,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,wFAAe,QAAA,SAAQ,8CAAA,EAAA,KAAA,GAAA,EAAUA,KAAAA,OAAM,CAAA,EAAA,MAAA,GAAA"}
1
+ {"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,6DAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,0CAA6D;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;yBAKO,4BAAQ,CAAC,MAAM,QAAA,MAAK,gFACrB,gBAAA,MAAgB,MAAM,GAAE,sBA+BlB;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;oCAe3C,CAZL,QAAA,MAAM,oFACP,gBAAA,MAAgB,MAAM,GAAE,sBAWlB;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;gJAIT,gBAAA,MAAgB,MAAM,GAAE,sBAWlB,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;qCAGR,wDAK7B,cAAA,0BALa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAKT,iCAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,wFAAe,QAAA,SAAQ,8CAAA,EAAA,KAAA,GAAA,EAAUA,KAAAA,OAAM,CAAA,EAAA,MAAA,GAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand\n\t * definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,eAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,uBAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,kBAAkB,eAA2C;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;UAKO,MAAA,SAAQ,CAAC,MAAM,QAAA,MAAK,iBAD3B,YAiCY,wBA/BN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAiCY;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;2BAe3C,CAZL,QAAA,MAAM,qBADb,YAaY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAaY;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;wEAGf,YAYY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAD9B,WAYY,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,yBAAtB,YAAiE,wBAA5B,QAAA,SAAQ,EAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAAUA,KAAAA,OAAM,CAAA,EAAA,MAAA,GAAA"}
1
+ {"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.js","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { VueShorthand } from \"../PrismicRichText/types\"\nimport { type ComponentOrTagName, isVueComponent } from \"../types\"\nimport type { InternalVueTableComponents, VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/** The Prismic table field to render. */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * thead: { class: 'bg-black text-white' },\n\t * th: { as: 'td', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nfunction getInternalComponent(type: keyof VueTableComponents) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: defaultTableComponents[type],\n\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t}\n}\n\nconst tableComponents = computed<InternalVueTableComponents>(() => {\n\treturn {\n\t\ttable: getInternalComponent(\"table\"),\n\t\tthead: getInternalComponent(\"thead\"),\n\t\ttbody: getInternalComponent(\"tbody\"),\n\t\ttr: getInternalComponent(\"tr\"),\n\t\tth: getInternalComponent(\"th\"),\n\t\ttd: getInternalComponent(\"td\"),\n\t}\n})\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"tableComponents.table.is\"\n\t\t:table=\"field\"\n\t\tv-bind=\"{ ...$attrs, ...tableComponents.table.shorthand }\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"tableComponents.thead.is\"\n\t\t\t:head=\"field.head\"\n\t\t\tv-bind=\"tableComponents.thead.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t\t<component\n\t\t\t:is=\"tableComponents.tbody.is\"\n\t\t\t:body=\"field.body\"\n\t\t\tv-bind=\"tableComponents.tbody.shorthand\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:internalTableComponents=\"tableComponents\"\n\t\t\t\t:components=\"components\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" v-bind=\"$attrs\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,QAAQ;EAGd,SAAS,qBAAqB,MAAgC;GAC7D,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,eAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI,uBAAuB;IAC3B,WAAW;IACZ;;EAGD,MAAM,kBAAkB,eAA2C;AAClE,UAAO;IACN,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC9B,IAAI,qBAAqB,KAAK;IAC/B;IACA;;UAKO,MAAA,SAAQ,CAAC,MAAM,QAAA,MAAK,iBAD3B,YAiCY,wBA/BN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAiCY;;IA9BV,OAAO,QAAA;;OACKA,KAAAA;IAAM,GAAK,gBAAA,MAAgB,MAAM;IAAS,CAAA,EAAA;2BAe3C,CAZL,QAAA,MAAM,qBADb,YAaY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAF9B,WAaY;;KAVV,MAAM,QAAA,MAAM;OACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;wEAGf,YAYY,wBAXN,gBAAA,MAAgB,MAAM,GAAE,EAD9B,WAYY,EAVV,MAAM,QAAA,MAAM,QACL,gBAAA,MAAgB,MAAM,UAAS,EAAA;4BAGR,mBAD/B,mBAME,UAAA,MAAA,WALa,QAAA,MAAM,KAAK,OAAlB,QAAG;0BADX,YAME,yBAAA;OAJA,KAAK,IAAI;OACJ;OACL,yBAAyB,gBAAA;OACzB,YAAY,QAAA;;;;;;;;;;wBAIM,QAAA,yBAAtB,YAAiE,wBAA5B,QAAA,SAAQ,EAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAAUA,KAAAA,OAAM,CAAA,EAAA,MAAA,GAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicText.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"PrismicText.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":""}
@@ -6,9 +6,7 @@ import { RichTextField } from "@prismicio/client";
6
6
  * Props for `<PrismicText />`.
7
7
  */
8
8
  type PrismicTextProps = {
9
- /**
10
- * The Prismic rich text field to render.
11
- */
9
+ /** The Prismic rich text field to render. */
12
10
  field: RichTextField | null | undefined;
13
11
  /**
14
12
  * The string value to be rendered when the field is empty. If a fallback is
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;;;AA8DY,KAAA,gBAAA,GAAgB;EAuDtB;;;EAAY,KAAA,EAnDV,aAmDU,GAAA,IAAA,GAAA,SAAA;EAAA;;;;EAAA,QAAA,CAAA,EAAA,MAAA;EAAA;;AAAA;;;;;cAAZ,cAAY,KAAA,CAAA,gBAAA,kCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
1
+ {"version":3,"file":"PrismicText.vue.d.ts","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;;;AA4DY,KAAA,gBAAA,GAAgB;EAqDtB;EAAY,KAAA,EAnDV,aAmDU,GAAA,IAAA,GAAA,SAAA;EAAA;;;;EAAA,QAAA,CAAA,EAAA,MAAA;EAAA;;;;AAAA;;;cAAZ,cAAY,KAAA,CAAA,gBAAA,kCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA+BA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,sBACnR,yDACA,GACF;KAEC,EAAE,CAAA;;kDAKF,0BAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}
1
+ {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,sBACnR,yDACA,GACF;KAEC,EAAE,CAAA;;kDAKF,0BAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA+BA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,OACnR,yDACA,GACF;KAEC,EAAE,CAAA;;0BAKF,MAAA,OAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}
1
+ {"version":3,"file":"PrismicText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { RichTextField } from \"@prismicio/client\"\nimport { asText } from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n\n\t/**\n\t * The separator used between blocks.\n\t *\n\t * @defaultValue `\" \"` (a whitespace)\n\t */\n\tseparator?: string\n}\n\nconst props = defineProps<PrismicTextProps>()\ndefineOptions({ name: \"PrismicText\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.field === \"string\") {\n\t\t\tthrow new Error(\n\t\t\t\t`[PrismicText] The \"field\" prop only accepts a Rich Text or title field's value but was provided a different type of field instead (e.g. a Key Text or Select field). You can resolve this error by rendering the field value inline without <PrismicText>. For more details, see ${devMsg(\n\t\t\t\t\t\"prismictext-works-only-with-rich-text-and-title-fields\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\t}, {})\n}\n</script>\n\n<template>\n\t{{ asText(field) || fallback || \"\" }}\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;AAGd,MAAI,IACH,mBAAkB;AACjB,OAAI,OAAO,MAAM,UAAU,SAC1B,OAAM,IAAI,MACT,oRAAoR,OACnR,yDACA,GACF;KAEC,EAAE,CAAA;;0BAKF,MAAA,OAAM,CAAC,QAAA,MAAK,IAAK,QAAA,YAAQ,GAAA"}