@prismicio/react 2.5.2 → 2.6.0-alpha.0

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 (82) hide show
  1. package/dist/PrismicImage.cjs +7 -11
  2. package/dist/PrismicImage.cjs.map +1 -1
  3. package/dist/PrismicImage.d.ts +14 -15
  4. package/dist/PrismicImage.js +6 -10
  5. package/dist/PrismicImage.js.map +1 -1
  6. package/dist/PrismicLink.cjs +4 -66
  7. package/dist/PrismicLink.cjs.map +1 -1
  8. package/dist/PrismicLink.d.ts +5 -104
  9. package/dist/PrismicLink.js +4 -65
  10. package/dist/PrismicLink.js.map +1 -1
  11. package/dist/PrismicProvider.cjs.map +1 -1
  12. package/dist/PrismicProvider.d.ts +8 -9
  13. package/dist/PrismicProvider.js.map +1 -1
  14. package/dist/PrismicRichText.cjs +4 -71
  15. package/dist/PrismicRichText.cjs.map +1 -1
  16. package/dist/PrismicRichText.d.ts +4 -116
  17. package/dist/PrismicRichText.js +5 -70
  18. package/dist/PrismicRichText.js.map +1 -1
  19. package/dist/PrismicText.cjs +4 -4
  20. package/dist/PrismicText.cjs.map +1 -1
  21. package/dist/PrismicText.d.ts +2 -2
  22. package/dist/PrismicText.js +3 -3
  23. package/dist/PrismicText.js.map +1 -1
  24. package/dist/PrismicToolbar.cjs +6 -4
  25. package/dist/PrismicToolbar.cjs.map +1 -1
  26. package/dist/PrismicToolbar.d.ts +3 -1
  27. package/dist/PrismicToolbar.js +6 -4
  28. package/dist/PrismicToolbar.js.map +1 -1
  29. package/dist/SliceZone.cjs +4 -17
  30. package/dist/SliceZone.cjs.map +1 -1
  31. package/dist/SliceZone.d.ts +4 -65
  32. package/dist/SliceZone.js +4 -17
  33. package/dist/SliceZone.js.map +1 -1
  34. package/dist/index.cjs +0 -2
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.ts +2 -27
  37. package/dist/index.js +1 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/package.json.cjs +1 -1
  40. package/dist/package.json.js +1 -1
  41. package/dist/react-server/PrismicLink.cjs +59 -0
  42. package/dist/react-server/PrismicLink.cjs.map +1 -0
  43. package/dist/react-server/PrismicLink.d.ts +72 -0
  44. package/dist/react-server/PrismicLink.js +42 -0
  45. package/dist/react-server/PrismicLink.js.map +1 -0
  46. package/dist/react-server/PrismicRichText.cjs +92 -0
  47. package/dist/react-server/PrismicRichText.cjs.map +1 -0
  48. package/dist/react-server/PrismicRichText.d.ts +104 -0
  49. package/dist/react-server/PrismicRichText.js +73 -0
  50. package/dist/react-server/PrismicRichText.js.map +1 -0
  51. package/dist/react-server/index.d.ts +4 -0
  52. package/dist/react-server/unsupported.cjs +97 -0
  53. package/dist/react-server/unsupported.cjs.map +1 -0
  54. package/dist/react-server/unsupported.d.ts +22 -0
  55. package/dist/react-server/unsupported.js +97 -0
  56. package/dist/react-server/unsupported.js.map +1 -0
  57. package/dist/react-server.cjs +44 -0
  58. package/dist/react-server.cjs.map +1 -0
  59. package/dist/react-server.js +41 -0
  60. package/dist/react-server.js.map +1 -0
  61. package/dist/useStatefulPrismicClientMethod.cjs +6 -0
  62. package/dist/useStatefulPrismicClientMethod.cjs.map +1 -1
  63. package/dist/useStatefulPrismicClientMethod.d.ts +1 -1
  64. package/dist/useStatefulPrismicClientMethod.js +6 -0
  65. package/dist/useStatefulPrismicClientMethod.js.map +1 -1
  66. package/package.json +42 -47
  67. package/src/PrismicImage.tsx +30 -37
  68. package/src/PrismicLink.tsx +29 -258
  69. package/src/PrismicProvider.tsx +9 -8
  70. package/src/PrismicRichText.tsx +28 -275
  71. package/src/PrismicText.tsx +4 -5
  72. package/src/PrismicToolbar.tsx +7 -6
  73. package/src/SliceZone.tsx +8 -129
  74. package/src/index.ts +1 -9
  75. package/src/react-server/PrismicLink.tsx +179 -0
  76. package/src/react-server/PrismicRichText.tsx +267 -0
  77. package/src/react-server/index.ts +38 -0
  78. package/src/react-server/unsupported.ts +98 -0
  79. package/dist/lib/pascalCase.cjs +0 -10
  80. package/dist/lib/pascalCase.cjs.map +0 -1
  81. package/dist/lib/pascalCase.js +0 -10
  82. package/dist/lib/pascalCase.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const prismicH = require("@prismicio/helpers");
5
+ const prismic = require("@prismicio/client");
6
6
  const __PRODUCTION__ = require("./lib/__PRODUCTION__.cjs");
7
7
  const devMsg = require("./lib/devMsg.cjs");
8
8
  function _interopNamespaceDefault(e) {
@@ -22,8 +22,8 @@ function _interopNamespaceDefault(e) {
22
22
  return Object.freeze(n);
23
23
  }
24
24
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
25
- const prismicH__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismicH);
26
- const _PrismicImage = (props, ref) => {
25
+ const prismic__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismic);
26
+ const PrismicImage = React__namespace.forwardRef(function PrismicImage2(props, ref) {
27
27
  const { field, alt, fallbackAlt, imgixParams, widths, pixelDensities, ...restProps } = props;
28
28
  if (!__PRODUCTION__.__PRODUCTION__) {
29
29
  if (typeof alt === "string" && props.alt !== "") {
@@ -36,18 +36,18 @@ const _PrismicImage = (props, ref) => {
36
36
  console.warn(`[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.`);
37
37
  }
38
38
  }
39
- if (prismicH__namespace.isFilled.imageThumbnail(field)) {
39
+ if (prismic__namespace.isFilled.imageThumbnail(field)) {
40
40
  let src;
41
41
  let srcSet;
42
42
  if (widths || !pixelDensities) {
43
- const res = prismicH__namespace.asImageWidthSrcSet(field, {
43
+ const res = prismic__namespace.asImageWidthSrcSet(field, {
44
44
  ...imgixParams,
45
45
  widths: widths === "defaults" ? void 0 : widths
46
46
  });
47
47
  src = res.src;
48
48
  srcSet = res.srcset;
49
49
  } else if (pixelDensities) {
50
- const res = prismicH__namespace.asImagePixelDensitySrcSet(field, {
50
+ const res = prismic__namespace.asImagePixelDensitySrcSet(field, {
51
51
  ...imgixParams,
52
52
  pixelDensities: pixelDensities === "defaults" ? void 0 : pixelDensities
53
53
  });
@@ -58,10 +58,6 @@ const _PrismicImage = (props, ref) => {
58
58
  } else {
59
59
  return null;
60
60
  }
61
- };
62
- if (!__PRODUCTION__.__PRODUCTION__) {
63
- _PrismicImage.displayName = "PrismicImage";
64
- }
65
- const PrismicImage = React__namespace.forwardRef(_PrismicImage);
61
+ });
66
62
  exports.PrismicImage = PrismicImage;
67
63
  //# sourceMappingURL=PrismicImage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.cjs","sources":["../../src/PrismicImage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { devMsg } from \"./lib/devMsg\";\n\n/**\n * Props for `<PrismicImage>`.\n */\nexport type PrismicImageProps = Omit<\n\tReact.DetailedHTMLProps<\n\t\tReact.ImgHTMLAttributes<HTMLImageElement>,\n\t\tHTMLImageElement\n\t>,\n\t\"src\" | \"srcset\" | \"alt\"\n> & {\n\t/**\n\t * The Prismic Image field or thumbnail to render.\n\t */\n\tfield: prismicT.ImageFieldImage | null | undefined;\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 prismicH.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\t| {\n\t\t\t\t/**\n\t\t\t\t * Widths used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `widths` prop is not given or `\"defaults\"` is passed, the\n\t\t\t\t * following widths will be used: 640, 750, 828, 1080, 1200, 1920, 2048,\n\t\t\t\t * 3840.\n\t\t\t\t *\n\t\t\t\t * If the Image field contains responsive views, each responsive view\n\t\t\t\t * can be used as a width in the resulting `srcset` by passing\n\t\t\t\t * `\"thumbnails\"` as the `widths` prop.\n\t\t\t\t */\n\t\t\t\twidths?:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismicH.asImageWidthSrcSet>[1]\n\t\t\t\t\t >[\"widths\"]\n\t\t\t\t\t| \"defaults\";\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\tpixelDensities?: never;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\twidths?: never;\n\t\t\t\t/**\n\t\t\t\t * Pixel densities used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following\n\t\t\t\t * pixel densities will be used: 1, 2, 3.\n\t\t\t\t */\n\t\t\t\tpixelDensities:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismicH.asImagePixelDensitySrcSet>[1]\n\t\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t\t| \"defaults\";\n\t\t }\n\t);\n\nconst _PrismicImage = (\n\tprops: PrismicImageProps,\n\tref: React.ForwardedRef<HTMLImageElement>,\n): JSX.Element | null => {\n\tconst {\n\t\tfield,\n\t\talt,\n\t\tfallbackAlt,\n\t\timgixParams,\n\t\twidths,\n\t\tpixelDensities,\n\t\t...restProps\n\t} = props;\n\n\tif (!__PRODUCTION__) {\n\t\tif (typeof 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 fallbackAlt === \"string\" && 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 (widths && 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\tif (prismicH.isFilled.imageThumbnail(field)) {\n\t\tlet src: string | undefined;\n\t\tlet srcSet: string | undefined;\n\n\t\tif (widths || !pixelDensities) {\n\t\t\tconst res = prismicH.asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths: widths === \"defaults\" ? undefined : widths,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t} else if (pixelDensities) {\n\t\t\tconst res = prismicH.asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\" ? undefined : pixelDensities,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t}\n\n\t\treturn (\n\t\t\t<img\n\t\t\t\tref={ref}\n\t\t\t\tsrc={src}\n\t\t\t\tsrcSet={srcSet}\n\t\t\t\talt={alt ?? (field.alt || fallbackAlt)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn null;\n\t}\n};\n\nif (!__PRODUCTION__) {\n\t_PrismicImage.displayName = \"PrismicImage\";\n}\n\n/**\n * React component that renders an image from a Prismic Image field or one of\n * its thumbnails. It will automatically set the `alt` attribute using the Image\n * field's `alt` property.\n *\n * By default, a widths-based srcset will be used to support responsive images.\n * This ensures only the smallest image needed for a browser is downloaded.\n *\n * To use a pixel-density-based srcset, use the `pixelDensities` prop. Default\n * pixel densities can be used by using `pixelDensities=\"defaults\"`.\n *\n * **Note**: If you are using a framework that has a native image component,\n * such as Next.js and Gatsby, prefer using those image components instead. They\n * can provide deeper framework integration than `<PrismicImage>`.\n *\n * @param props - Props for the component.\n *\n * @returns A responsive image component for the given Image field.\n */\nexport const PrismicImage = React.forwardRef(_PrismicImage);\n"],"names":["__PRODUCTION__","devMsg","prismicH","jsx","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,MAAM,gBAAgB,CACrB,OACA,QACuB;AACjB,QAAA,EACL,OACA,KACA,aACA,aACA,QACA,mBACG,UACA,IAAA;AAEJ,MAAI,CAACA,eAAAA,gBAAgB;AACpB,QAAI,OAAO,QAAQ,YAAY,MAAM,QAAQ,IAAI;AAChD,cAAQ,KACP,qQAAqQC,OACpQ,OAAA,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,OAAO,gBAAgB,YAAY,gBAAgB,IAAI;AAC1D,cAAQ,KACP,qSAAqSA,OACpS,OAAA,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,UAAU,gBAAgB;AAC7B,cAAQ,KACP,2MAA2M;AAAA,IAE5M;AAAA,EACD;AAED,MAAIC,oBAAS,SAAS,eAAe,KAAK,GAAG;AACxC,QAAA;AACA,QAAA;AAEA,QAAA,UAAU,CAAC,gBAAgB;AACxB,YAAA,MAAMA,oBAAS,mBAAmB,OAAO;AAAA,QAC9C,GAAG;AAAA,QACH,QAAQ,WAAW,aAAa,SAAY;AAAA,MAAA,CAC5C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,eACH,gBAAgB;AACpB,YAAA,MAAMA,oBAAS,0BAA0B,OAAO;AAAA,QACrD,GAAG;AAAA,QACH,gBACC,mBAAmB,aAAa,SAAY;AAAA,MAAA,CAC7C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,IACb;AAGA,WAAAC,2BAAA,IAAC,OACA,EAAA,KACA,KACA,QACA,KAAK,QAAQ,MAAM,OAAO,cAC1B,GAAI,UAAU,CAAA;AAAA,EAAA,OAGV;AACC,WAAA;AAAA,EACP;AACF;AAEA,IAAI,CAACH,+BAAgB;AACpB,gBAAc,cAAc;AAC5B;AAqBY,MAAA,eAAeI,iBAAM,WAAW,aAAa;;"}
1
+ {"version":3,"file":"PrismicImage.cjs","sources":["../../src/PrismicImage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as prismic from \"@prismicio/client\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { devMsg } from \"./lib/devMsg\";\n\n/**\n * Props for `<PrismicImage>`.\n */\nexport type PrismicImageProps = Omit<\n\tReact.DetailedHTMLProps<\n\t\tReact.ImgHTMLAttributes<HTMLImageElement>,\n\t\tHTMLImageElement\n\t>,\n\t\"src\" | \"srcset\" | \"alt\"\n> & {\n\t/**\n\t * The Prismic Image field or thumbnail to render.\n\t */\n\tfield: prismic.ImageFieldImage | null | undefined;\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 prismic.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\t| {\n\t\t\t\t/**\n\t\t\t\t * Widths used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `widths` prop is not given or `\"defaults\"` is passed, the\n\t\t\t\t * following widths will be used: 640, 750, 828, 1080, 1200, 1920, 2048,\n\t\t\t\t * 3840.\n\t\t\t\t *\n\t\t\t\t * If the Image field contains responsive views, each responsive view\n\t\t\t\t * can be used as a width in the resulting `srcset` by passing\n\t\t\t\t * `\"thumbnails\"` as the `widths` prop.\n\t\t\t\t */\n\t\t\t\twidths?:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismic.asImageWidthSrcSet>[1]\n\t\t\t\t\t >[\"widths\"]\n\t\t\t\t\t| \"defaults\";\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\tpixelDensities?: never;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\twidths?: never;\n\t\t\t\t/**\n\t\t\t\t * Pixel densities used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following\n\t\t\t\t * pixel densities will be used: 1, 2, 3.\n\t\t\t\t */\n\t\t\t\tpixelDensities:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismic.asImagePixelDensitySrcSet>[1]\n\t\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t\t| \"defaults\";\n\t\t }\n\t);\n\n/**\n * React component that renders an image from a Prismic Image field or one of\n * its thumbnails. It will automatically set the `alt` attribute using the Image\n * field's `alt` property.\n *\n * By default, a widths-based srcset will be used to support responsive images.\n * This ensures only the smallest image needed for a browser is downloaded.\n *\n * To use a pixel-density-based srcset, use the `pixelDensities` prop. Default\n * pixel densities can be used by using `pixelDensities=\"defaults\"`.\n *\n * **Note**: If you are using a framework that has a native image component,\n * such as Next.js and Gatsby, prefer using those image components instead. They\n * can provide deeper framework integration than `<PrismicImage>`.\n *\n * @param props - Props for the component.\n *\n * @returns A responsive image component for the given Image field.\n */\nexport const PrismicImage = React.forwardRef(function PrismicImage(\n\tprops: PrismicImageProps,\n\tref: React.ForwardedRef<HTMLImageElement>,\n): JSX.Element | null {\n\tconst {\n\t\tfield,\n\t\talt,\n\t\tfallbackAlt,\n\t\timgixParams,\n\t\twidths,\n\t\tpixelDensities,\n\t\t...restProps\n\t} = props;\n\n\tif (!__PRODUCTION__) {\n\t\tif (typeof 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 fallbackAlt === \"string\" && 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 (widths && 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\tif (prismic.isFilled.imageThumbnail(field)) {\n\t\tlet src: string | undefined;\n\t\tlet srcSet: string | undefined;\n\n\t\tif (widths || !pixelDensities) {\n\t\t\tconst res = prismic.asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths: widths === \"defaults\" ? undefined : widths,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t} else if (pixelDensities) {\n\t\t\tconst res = prismic.asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\" ? undefined : pixelDensities,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t}\n\n\t\treturn (\n\t\t\t<img\n\t\t\t\tref={ref}\n\t\t\t\tsrc={src}\n\t\t\t\tsrcSet={srcSet}\n\t\t\t\talt={alt ?? (field.alt || fallbackAlt)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn null;\n\t}\n});\n"],"names":["React","PrismicImage","__PRODUCTION__","devMsg","prismic","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyGO,MAAM,eAAeA,iBAAM,WAAW,SAASC,cACrD,OACA,KAAyC;AAEnC,QAAA,EACL,OACA,KACA,aACA,aACA,QACA,gBACA,GAAG,UACA,IAAA;AAEJ,MAAI,CAACC,eAAAA,gBAAgB;AACpB,QAAI,OAAO,QAAQ,YAAY,MAAM,QAAQ,IAAI;AAChD,cAAQ,KACP,qQAAqQC,OACpQ,OAAA,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,OAAO,gBAAgB,YAAY,gBAAgB,IAAI;AAC1D,cAAQ,KACP,qSAAqSA,OACpS,OAAA,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,UAAU,gBAAgB;AAC7B,cAAQ,KACP,2MAA2M;AAAA,IAE5M;AAAA,EACD;AAED,MAAIC,mBAAQ,SAAS,eAAe,KAAK,GAAG;AACvC,QAAA;AACA,QAAA;AAEA,QAAA,UAAU,CAAC,gBAAgB;AACxB,YAAA,MAAMA,mBAAQ,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,QACH,QAAQ,WAAW,aAAa,SAAY;AAAA,MAAA,CAC5C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,eACH,gBAAgB;AACpB,YAAA,MAAMA,mBAAQ,0BAA0B,OAAO;AAAA,QACpD,GAAG;AAAA,QACH,gBACC,mBAAmB,aAAa,SAAY;AAAA,MAAA,CAC7C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,IACb;AAGA,WAAAC,2BAAA,IAAC,OACA,EAAA,KACA,KACA,QACA,KAAK,QAAQ,MAAM,OAAO,cAC1B,GAAI,UAAU,CAAA;AAAA,EAAA,OAGV;AACC,WAAA;AAAA,EACP;AACF,CAAC;;"}
@@ -1,6 +1,5 @@
1
1
  import * as React from "react";
2
- import * as prismicT from "@prismicio/types";
3
- import * as prismicH from "@prismicio/helpers";
2
+ import * as prismic from "@prismicio/client";
4
3
  /**
5
4
  * Props for `<PrismicImage>`.
6
5
  */
@@ -8,13 +7,13 @@ export type PrismicImageProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttrib
8
7
  /**
9
8
  * The Prismic Image field or thumbnail to render.
10
9
  */
11
- field: prismicT.ImageFieldImage | null | undefined;
10
+ field: prismic.ImageFieldImage | null | undefined;
12
11
  /**
13
12
  * An object of Imgix URL API parameters to transform the image.
14
13
  *
15
14
  * See: https://docs.imgix.com/apis/rendering
16
15
  */
17
- imgixParams?: Parameters<typeof prismicH.asImageSrc>[1];
16
+ imgixParams?: Parameters<typeof prismic.asImageSrc>[1];
18
17
  /**
19
18
  * Declare an image as decorative by providing `alt=""`.
20
19
  *
@@ -42,7 +41,7 @@ export type PrismicImageProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttrib
42
41
  * can be used as a width in the resulting `srcset` by passing
43
42
  * `"thumbnails"` as the `widths` prop.
44
43
  */
45
- widths?: NonNullable<Parameters<typeof prismicH.asImageWidthSrcSet>[1]>["widths"] | "defaults";
44
+ widths?: NonNullable<Parameters<typeof prismic.asImageWidthSrcSet>[1]>["widths"] | "defaults";
46
45
  /**
47
46
  * Not used when the `widths` prop is used.
48
47
  */
@@ -58,7 +57,7 @@ export type PrismicImageProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttrib
58
57
  * If a `pixelDensities` prop is passed `"defaults"`, the following
59
58
  * pixel densities will be used: 1, 2, 3.
60
59
  */
61
- pixelDensities: NonNullable<Parameters<typeof prismicH.asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
60
+ pixelDensities: NonNullable<Parameters<typeof prismic.asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
62
61
  });
63
62
  /**
64
63
  * React component that renders an image from a Prismic Image field or one of
@@ -79,17 +78,17 @@ export type PrismicImageProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttrib
79
78
  *
80
79
  * @returns A responsive image component for the given Image field.
81
80
  */
82
- export declare const PrismicImage: React.ForwardRefExoticComponent<(Pick<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "alt" | "srcset"> & {
81
+ export declare const PrismicImage: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "alt" | "srcset"> & {
83
82
  /**
84
83
  * The Prismic Image field or thumbnail to render.
85
84
  */
86
- field: prismicT.ImageFieldImage | null | undefined;
85
+ field: prismic.ImageFieldImage | null | undefined;
87
86
  /**
88
87
  * An object of Imgix URL API parameters to transform the image.
89
88
  *
90
89
  * See: https://docs.imgix.com/apis/rendering
91
90
  */
92
- imgixParams?: Parameters<typeof prismicH.asImageSrc>[1];
91
+ imgixParams?: Parameters<typeof prismic.asImageSrc>[1];
93
92
  /**
94
93
  * Declare an image as decorative by providing `alt=""`.
95
94
  *
@@ -117,22 +116,22 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Pick<Omit<Re
117
116
  * can be used as a width in the resulting `srcset` by passing
118
117
  * `"thumbnails"` as the `widths` prop.
119
118
  */
120
- widths?: NonNullable<Parameters<typeof prismicH.asImageWidthSrcSet>[1]>["widths"] | "defaults";
119
+ widths?: NonNullable<Parameters<typeof prismic.asImageWidthSrcSet>[1]>["widths"] | "defaults";
121
120
  /**
122
121
  * Not used when the `widths` prop is used.
123
122
  */
124
123
  pixelDensities?: undefined;
125
- }, "alt" | "crossOrigin" | "decoding" | "height" | "loading" | "referrerPolicy" | "sizes" | "srcSet" | "useMap" | "width" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "widths" | "pixelDensities" | "field" | "imgixParams" | "fallbackAlt"> | Pick<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "alt" | "srcset"> & {
124
+ }, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "alt" | "srcset"> & {
126
125
  /**
127
126
  * The Prismic Image field or thumbnail to render.
128
127
  */
129
- field: prismicT.ImageFieldImage | null | undefined;
128
+ field: prismic.ImageFieldImage | null | undefined;
130
129
  /**
131
130
  * An object of Imgix URL API parameters to transform the image.
132
131
  *
133
132
  * See: https://docs.imgix.com/apis/rendering
134
133
  */
135
- imgixParams?: Parameters<typeof prismicH.asImageSrc>[1];
134
+ imgixParams?: Parameters<typeof prismic.asImageSrc>[1];
136
135
  /**
137
136
  * Declare an image as decorative by providing `alt=""`.
138
137
  *
@@ -159,5 +158,5 @@ export declare const PrismicImage: React.ForwardRefExoticComponent<(Pick<Omit<Re
159
158
  * If a `pixelDensities` prop is passed `"defaults"`, the following
160
159
  * pixel densities will be used: 1, 2, 3.
161
160
  */
162
- pixelDensities: NonNullable<Parameters<typeof prismicH.asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
163
- }, "alt" | "crossOrigin" | "decoding" | "height" | "loading" | "referrerPolicy" | "sizes" | "srcSet" | "useMap" | "width" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "widths" | "pixelDensities" | "field" | "imgixParams" | "fallbackAlt">) & React.RefAttributes<HTMLImageElement>>;
161
+ pixelDensities: NonNullable<Parameters<typeof prismic.asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
162
+ }, "ref">) & React.RefAttributes<HTMLImageElement>>;
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import * as prismicH from "@prismicio/helpers";
3
+ import * as prismic from "@prismicio/client";
4
4
  import { __PRODUCTION__ } from "./lib/__PRODUCTION__.js";
5
5
  import { devMsg } from "./lib/devMsg.js";
6
- const _PrismicImage = (props, ref) => {
6
+ const PrismicImage = React.forwardRef(function PrismicImage2(props, ref) {
7
7
  const { field, alt, fallbackAlt, imgixParams, widths, pixelDensities, ...restProps } = props;
8
8
  if (!__PRODUCTION__) {
9
9
  if (typeof alt === "string" && props.alt !== "") {
@@ -16,18 +16,18 @@ const _PrismicImage = (props, ref) => {
16
16
  console.warn(`[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.`);
17
17
  }
18
18
  }
19
- if (prismicH.isFilled.imageThumbnail(field)) {
19
+ if (prismic.isFilled.imageThumbnail(field)) {
20
20
  let src;
21
21
  let srcSet;
22
22
  if (widths || !pixelDensities) {
23
- const res = prismicH.asImageWidthSrcSet(field, {
23
+ const res = prismic.asImageWidthSrcSet(field, {
24
24
  ...imgixParams,
25
25
  widths: widths === "defaults" ? void 0 : widths
26
26
  });
27
27
  src = res.src;
28
28
  srcSet = res.srcset;
29
29
  } else if (pixelDensities) {
30
- const res = prismicH.asImagePixelDensitySrcSet(field, {
30
+ const res = prismic.asImagePixelDensitySrcSet(field, {
31
31
  ...imgixParams,
32
32
  pixelDensities: pixelDensities === "defaults" ? void 0 : pixelDensities
33
33
  });
@@ -38,11 +38,7 @@ const _PrismicImage = (props, ref) => {
38
38
  } else {
39
39
  return null;
40
40
  }
41
- };
42
- if (!__PRODUCTION__) {
43
- _PrismicImage.displayName = "PrismicImage";
44
- }
45
- const PrismicImage = React.forwardRef(_PrismicImage);
41
+ });
46
42
  export {
47
43
  PrismicImage
48
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicImage.js","sources":["../../src/PrismicImage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as prismicT from \"@prismicio/types\";\nimport * as prismicH from \"@prismicio/helpers\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { devMsg } from \"./lib/devMsg\";\n\n/**\n * Props for `<PrismicImage>`.\n */\nexport type PrismicImageProps = Omit<\n\tReact.DetailedHTMLProps<\n\t\tReact.ImgHTMLAttributes<HTMLImageElement>,\n\t\tHTMLImageElement\n\t>,\n\t\"src\" | \"srcset\" | \"alt\"\n> & {\n\t/**\n\t * The Prismic Image field or thumbnail to render.\n\t */\n\tfield: prismicT.ImageFieldImage | null | undefined;\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 prismicH.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\t| {\n\t\t\t\t/**\n\t\t\t\t * Widths used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `widths` prop is not given or `\"defaults\"` is passed, the\n\t\t\t\t * following widths will be used: 640, 750, 828, 1080, 1200, 1920, 2048,\n\t\t\t\t * 3840.\n\t\t\t\t *\n\t\t\t\t * If the Image field contains responsive views, each responsive view\n\t\t\t\t * can be used as a width in the resulting `srcset` by passing\n\t\t\t\t * `\"thumbnails\"` as the `widths` prop.\n\t\t\t\t */\n\t\t\t\twidths?:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismicH.asImageWidthSrcSet>[1]\n\t\t\t\t\t >[\"widths\"]\n\t\t\t\t\t| \"defaults\";\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\tpixelDensities?: never;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\twidths?: never;\n\t\t\t\t/**\n\t\t\t\t * Pixel densities used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following\n\t\t\t\t * pixel densities will be used: 1, 2, 3.\n\t\t\t\t */\n\t\t\t\tpixelDensities:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismicH.asImagePixelDensitySrcSet>[1]\n\t\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t\t| \"defaults\";\n\t\t }\n\t);\n\nconst _PrismicImage = (\n\tprops: PrismicImageProps,\n\tref: React.ForwardedRef<HTMLImageElement>,\n): JSX.Element | null => {\n\tconst {\n\t\tfield,\n\t\talt,\n\t\tfallbackAlt,\n\t\timgixParams,\n\t\twidths,\n\t\tpixelDensities,\n\t\t...restProps\n\t} = props;\n\n\tif (!__PRODUCTION__) {\n\t\tif (typeof 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 fallbackAlt === \"string\" && 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 (widths && 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\tif (prismicH.isFilled.imageThumbnail(field)) {\n\t\tlet src: string | undefined;\n\t\tlet srcSet: string | undefined;\n\n\t\tif (widths || !pixelDensities) {\n\t\t\tconst res = prismicH.asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths: widths === \"defaults\" ? undefined : widths,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t} else if (pixelDensities) {\n\t\t\tconst res = prismicH.asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\" ? undefined : pixelDensities,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t}\n\n\t\treturn (\n\t\t\t<img\n\t\t\t\tref={ref}\n\t\t\t\tsrc={src}\n\t\t\t\tsrcSet={srcSet}\n\t\t\t\talt={alt ?? (field.alt || fallbackAlt)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn null;\n\t}\n};\n\nif (!__PRODUCTION__) {\n\t_PrismicImage.displayName = \"PrismicImage\";\n}\n\n/**\n * React component that renders an image from a Prismic Image field or one of\n * its thumbnails. It will automatically set the `alt` attribute using the Image\n * field's `alt` property.\n *\n * By default, a widths-based srcset will be used to support responsive images.\n * This ensures only the smallest image needed for a browser is downloaded.\n *\n * To use a pixel-density-based srcset, use the `pixelDensities` prop. Default\n * pixel densities can be used by using `pixelDensities=\"defaults\"`.\n *\n * **Note**: If you are using a framework that has a native image component,\n * such as Next.js and Gatsby, prefer using those image components instead. They\n * can provide deeper framework integration than `<PrismicImage>`.\n *\n * @param props - Props for the component.\n *\n * @returns A responsive image component for the given Image field.\n */\nexport const PrismicImage = React.forwardRef(_PrismicImage);\n"],"names":[],"mappings":";;;;;AAuFA,MAAM,gBAAgB,CACrB,OACA,QACuB;AACjB,QAAA,EACL,OACA,KACA,aACA,aACA,QACA,mBACG,UACA,IAAA;AAEJ,MAAI,CAAC,gBAAgB;AACpB,QAAI,OAAO,QAAQ,YAAY,MAAM,QAAQ,IAAI;AAChD,cAAQ,KACP,qQAAqQ,OACpQ,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,OAAO,gBAAgB,YAAY,gBAAgB,IAAI;AAC1D,cAAQ,KACP,qSAAqS,OACpS,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,UAAU,gBAAgB;AAC7B,cAAQ,KACP,2MAA2M;AAAA,IAE5M;AAAA,EACD;AAED,MAAI,SAAS,SAAS,eAAe,KAAK,GAAG;AACxC,QAAA;AACA,QAAA;AAEA,QAAA,UAAU,CAAC,gBAAgB;AACxB,YAAA,MAAM,SAAS,mBAAmB,OAAO;AAAA,QAC9C,GAAG;AAAA,QACH,QAAQ,WAAW,aAAa,SAAY;AAAA,MAAA,CAC5C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,eACH,gBAAgB;AACpB,YAAA,MAAM,SAAS,0BAA0B,OAAO;AAAA,QACrD,GAAG;AAAA,QACH,gBACC,mBAAmB,aAAa,SAAY;AAAA,MAAA,CAC7C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,IACb;AAGA,WAAA,oBAAC,OACA,EAAA,KACA,KACA,QACA,KAAK,QAAQ,MAAM,OAAO,cAC1B,GAAI,UAAU,CAAA;AAAA,EAAA,OAGV;AACC,WAAA;AAAA,EACP;AACF;AAEA,IAAI,CAAC,gBAAgB;AACpB,gBAAc,cAAc;AAC5B;AAqBY,MAAA,eAAe,MAAM,WAAW,aAAa;"}
1
+ {"version":3,"file":"PrismicImage.js","sources":["../../src/PrismicImage.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as prismic from \"@prismicio/client\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { devMsg } from \"./lib/devMsg\";\n\n/**\n * Props for `<PrismicImage>`.\n */\nexport type PrismicImageProps = Omit<\n\tReact.DetailedHTMLProps<\n\t\tReact.ImgHTMLAttributes<HTMLImageElement>,\n\t\tHTMLImageElement\n\t>,\n\t\"src\" | \"srcset\" | \"alt\"\n> & {\n\t/**\n\t * The Prismic Image field or thumbnail to render.\n\t */\n\tfield: prismic.ImageFieldImage | null | undefined;\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 prismic.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\t| {\n\t\t\t\t/**\n\t\t\t\t * Widths used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `widths` prop is not given or `\"defaults\"` is passed, the\n\t\t\t\t * following widths will be used: 640, 750, 828, 1080, 1200, 1920, 2048,\n\t\t\t\t * 3840.\n\t\t\t\t *\n\t\t\t\t * If the Image field contains responsive views, each responsive view\n\t\t\t\t * can be used as a width in the resulting `srcset` by passing\n\t\t\t\t * `\"thumbnails\"` as the `widths` prop.\n\t\t\t\t */\n\t\t\t\twidths?:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismic.asImageWidthSrcSet>[1]\n\t\t\t\t\t >[\"widths\"]\n\t\t\t\t\t| \"defaults\";\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\tpixelDensities?: never;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Not used when the `widths` prop is used.\n\t\t\t\t */\n\t\t\t\twidths?: never;\n\t\t\t\t/**\n\t\t\t\t * Pixel densities used to build a `srcset` value for the Image field.\n\t\t\t\t *\n\t\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following\n\t\t\t\t * pixel densities will be used: 1, 2, 3.\n\t\t\t\t */\n\t\t\t\tpixelDensities:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof prismic.asImagePixelDensitySrcSet>[1]\n\t\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t\t| \"defaults\";\n\t\t }\n\t);\n\n/**\n * React component that renders an image from a Prismic Image field or one of\n * its thumbnails. It will automatically set the `alt` attribute using the Image\n * field's `alt` property.\n *\n * By default, a widths-based srcset will be used to support responsive images.\n * This ensures only the smallest image needed for a browser is downloaded.\n *\n * To use a pixel-density-based srcset, use the `pixelDensities` prop. Default\n * pixel densities can be used by using `pixelDensities=\"defaults\"`.\n *\n * **Note**: If you are using a framework that has a native image component,\n * such as Next.js and Gatsby, prefer using those image components instead. They\n * can provide deeper framework integration than `<PrismicImage>`.\n *\n * @param props - Props for the component.\n *\n * @returns A responsive image component for the given Image field.\n */\nexport const PrismicImage = React.forwardRef(function PrismicImage(\n\tprops: PrismicImageProps,\n\tref: React.ForwardedRef<HTMLImageElement>,\n): JSX.Element | null {\n\tconst {\n\t\tfield,\n\t\talt,\n\t\tfallbackAlt,\n\t\timgixParams,\n\t\twidths,\n\t\tpixelDensities,\n\t\t...restProps\n\t} = props;\n\n\tif (!__PRODUCTION__) {\n\t\tif (typeof 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 fallbackAlt === \"string\" && 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 (widths && 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\tif (prismic.isFilled.imageThumbnail(field)) {\n\t\tlet src: string | undefined;\n\t\tlet srcSet: string | undefined;\n\n\t\tif (widths || !pixelDensities) {\n\t\t\tconst res = prismic.asImageWidthSrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\twidths: widths === \"defaults\" ? undefined : widths,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t} else if (pixelDensities) {\n\t\t\tconst res = prismic.asImagePixelDensitySrcSet(field, {\n\t\t\t\t...imgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\" ? undefined : pixelDensities,\n\t\t\t});\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t}\n\n\t\treturn (\n\t\t\t<img\n\t\t\t\tref={ref}\n\t\t\t\tsrc={src}\n\t\t\t\tsrcSet={srcSet}\n\t\t\t\talt={alt ?? (field.alt || fallbackAlt)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn null;\n\t}\n});\n"],"names":["PrismicImage"],"mappings":";;;;;AAyGO,MAAM,eAAe,MAAM,WAAW,SAASA,cACrD,OACA,KAAyC;AAEnC,QAAA,EACL,OACA,KACA,aACA,aACA,QACA,gBACA,GAAG,UACA,IAAA;AAEJ,MAAI,CAAC,gBAAgB;AACpB,QAAI,OAAO,QAAQ,YAAY,MAAM,QAAQ,IAAI;AAChD,cAAQ,KACP,qQAAqQ,OACpQ,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,OAAO,gBAAgB,YAAY,gBAAgB,IAAI;AAC1D,cAAQ,KACP,qSAAqS,OACpS,6BAA6B,GAC3B;AAAA,IAEJ;AAED,QAAI,UAAU,gBAAgB;AAC7B,cAAQ,KACP,2MAA2M;AAAA,IAE5M;AAAA,EACD;AAED,MAAI,QAAQ,SAAS,eAAe,KAAK,GAAG;AACvC,QAAA;AACA,QAAA;AAEA,QAAA,UAAU,CAAC,gBAAgB;AACxB,YAAA,MAAM,QAAQ,mBAAmB,OAAO;AAAA,QAC7C,GAAG;AAAA,QACH,QAAQ,WAAW,aAAa,SAAY;AAAA,MAAA,CAC5C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,eACH,gBAAgB;AACpB,YAAA,MAAM,QAAQ,0BAA0B,OAAO;AAAA,QACpD,GAAG;AAAA,QACH,gBACC,mBAAmB,aAAa,SAAY;AAAA,MAAA,CAC7C;AAED,YAAM,IAAI;AACV,eAAS,IAAI;AAAA,IACb;AAGA,WAAA,oBAAC,OACA,EAAA,KACA,KACA,QACA,KAAK,QAAQ,MAAM,OAAO,cAC1B,GAAI,UAAU,CAAA;AAAA,EAAA,OAGV;AACC,WAAA;AAAA,EACP;AACF,CAAC;"}
@@ -2,10 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const prismicH = require("@prismicio/helpers");
6
- const __PRODUCTION__ = require("./lib/__PRODUCTION__.cjs");
7
- const devMsg = require("./lib/devMsg.cjs");
8
- const isInternalURL = require("./lib/isInternalURL.cjs");
5
+ const PrismicLink$1 = require("./react-server/PrismicLink.cjs");
9
6
  const usePrismicContext = require("./usePrismicContext.cjs");
10
7
  function _interopNamespaceDefault(e) {
11
8
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -24,68 +21,9 @@ function _interopNamespaceDefault(e) {
24
21
  return Object.freeze(n);
25
22
  }
26
23
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
27
- const prismicH__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismicH);
28
- const defaultInternalComponent = "a";
29
- const defaultExternalComponent = "a";
30
- const _PrismicLink = (props, ref) => {
24
+ const PrismicLink = React__namespace.forwardRef(function PrismicLink2(props, ref) {
31
25
  const context = usePrismicContext.usePrismicContext();
32
- if (!__PRODUCTION__.__PRODUCTION__) {
33
- if ("field" in props && props.field) {
34
- if (!props.field.link_type) {
35
- console.error(`[PrismicLink] This "field" prop value caused an error to be thrown.
36
- `, props.field);
37
- throw new Error(`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg.devMsg("missing-link-properties")}`);
38
- } else if (Object.keys(props.field).length > 1 && !("url" in props.field || "uid" in props.field || "id" in props.field)) {
39
- console.warn(`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg.devMsg("missing-link-properties")}`, props.field);
40
- }
41
- } else if ("document" in props && props.document) {
42
- if (!("url" in props.document || "id" in props.document)) {
43
- console.warn(`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg.devMsg("missing-link-properties")}`, props.document);
44
- }
45
- }
46
- }
47
- const linkResolver = props.linkResolver || context.linkResolver;
48
- let href;
49
- if ("href" in props) {
50
- href = props.href;
51
- } else if ("document" in props && props.document) {
52
- href = prismicH__namespace.asLink(props.document, linkResolver);
53
- } else if ("field" in props && props.field) {
54
- href = prismicH__namespace.asLink(props.field, linkResolver);
55
- }
56
- const isInternal = href && isInternalURL.isInternalURL(href);
57
- const target = props.target || "field" in props && props.field && "target" in props.field && props.field.target || void 0;
58
- const rel = props.rel || (target === "_blank" ? "noopener noreferrer" : void 0);
59
- const InternalComponent = props.internalComponent || context.internalLinkComponent || defaultInternalComponent;
60
- const ExternalComponent = props.externalComponent || context.externalLinkComponent || defaultExternalComponent;
61
- const Component = isInternal ? InternalComponent : ExternalComponent;
62
- const passthroughProps = Object.assign({}, props);
63
- delete passthroughProps.linkResolver;
64
- delete passthroughProps.internalComponent;
65
- delete passthroughProps.externalComponent;
66
- delete passthroughProps.rel;
67
- delete passthroughProps.target;
68
- if ("field" in passthroughProps) {
69
- delete passthroughProps.field;
70
- } else if ("document" in passthroughProps) {
71
- delete passthroughProps.document;
72
- } else if ("href" in passthroughProps) {
73
- delete passthroughProps.href;
74
- }
75
- return href ? /* @__PURE__ */ jsxRuntime.jsx(
76
- Component,
77
- {
78
- ...passthroughProps,
79
- ref,
80
- href,
81
- target,
82
- rel
83
- }
84
- ) : null;
85
- };
86
- if (!__PRODUCTION__.__PRODUCTION__) {
87
- _PrismicLink.displayName = "PrismicLink";
88
- }
89
- const PrismicLink = React__namespace.forwardRef(_PrismicLink);
26
+ return /* @__PURE__ */ jsxRuntime.jsx(PrismicLink$1.PrismicLink, { ref, linkResolver: context.linkResolver, internalComponent: context.internalLinkComponent, externalComponent: context.externalLinkComponent, ...props });
27
+ });
90
28
  exports.PrismicLink = PrismicLink;
91
29
  //# sourceMappingURL=PrismicLink.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicLink.cjs","sources":["../../src/PrismicLink.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as prismicH from \"@prismicio/helpers\";\nimport * as prismicT from \"@prismicio/types\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { devMsg } from \"./lib/devMsg\";\nimport { isInternalURL } from \"./lib/isInternalURL\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\n/**\n * Props provided to a component when rendered with `<PrismicLink>`.\n */\nexport interface LinkProps {\n\t/**\n\t * The URL to link.\n\t */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Props for `<PrismicLink>`.\n */\nexport type PrismicLinkProps<\n\tInternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent,\n\tExternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tLinkResolverFunction extends prismicH.LinkResolverFunction<any> = prismicH.LinkResolverFunction,\n> = Omit<\n\tReact.ComponentPropsWithoutRef<InternalComponent> &\n\t\tReact.ComponentPropsWithoutRef<ExternalComponent>,\n\tkeyof LinkProps\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 * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\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\tinternalComponent?: InternalComponent;\n\n\t/**\n\t * The component rendered for external URLs. Defaults to `<a>`.\n\t */\n\texternalComponent?: ExternalComponent;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: string | null;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string | null;\n\n\t/**\n\t * Children for the component. *\n\t */\n\tchildren?: React.ReactNode;\n} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic Link field containing the URL or document to link.\n\t\t\t\t *\n\t\t\t\t * @see Learn about Prismic Link fields {@link https://prismic.io/docs/core-concepts/link-content-relationship}\n\t\t\t\t */\n\t\t\t\tfield: prismicT.LinkField | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The Prismic document to link.\n\t\t\t\t */\n\t\t\t\tdocument: prismicT.PrismicDocument | null | undefined;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * The URL to link.\n\t\t\t\t */\n\t\t\t\thref: string | null | undefined;\n\t\t }\n\t);\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"a\";\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\";\n\nconst _PrismicLink = <\n\tInternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent,\n\tExternalComponent extends React.ElementType<LinkProps> = typeof defaultExternalComponent,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tLinkResolverFunction extends prismicH.LinkResolverFunction<any> = prismicH.LinkResolverFunction,\n>(\n\tprops: PrismicLinkProps<\n\t\tInternalComponent,\n\t\tExternalComponent,\n\t\tLinkResolverFunction\n\t>,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tref: React.Ref<any>,\n): JSX.Element | null => {\n\tconst context = usePrismicContext();\n\n\tif (!__PRODUCTION__) {\n\t\tif (\"field\" in props && props.field) {\n\t\t\tif (!props.field.link_type) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`[PrismicLink] This \"field\" prop value caused an error to be thrown.\\n`,\n\t\t\t\t\tprops.field,\n\t\t\t\t);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tObject.keys(props.field).length > 1 &&\n\t\t\t\t!(\"url\" in props.field || \"uid\" in props.field || \"id\" in props.field)\n\t\t\t) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tprops.field,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (\"document\" in props && props.document) {\n\t\t\tif (!(\"url\" in props.document || \"id\" in props.document)) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tprops.document,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst linkResolver = props.linkResolver || context.linkResolver;\n\n\tlet href: string | null | undefined;\n\tif (\"href\" in props) {\n\t\thref = props.href;\n\t} else if (\"document\" in props && props.document) {\n\t\thref = prismicH.asLink(props.document, linkResolver);\n\t} else if (\"field\" in props && props.field) {\n\t\thref = prismicH.asLink(props.field, linkResolver);\n\t}\n\n\tconst isInternal = href && isInternalURL(href);\n\n\tconst target =\n\t\tprops.target ||\n\t\t(\"field\" in props &&\n\t\t\tprops.field &&\n\t\t\t\"target\" in props.field &&\n\t\t\tprops.field.target) ||\n\t\tundefined;\n\n\tconst rel =\n\t\tprops.rel || (target === \"_blank\" ? \"noopener noreferrer\" : undefined);\n\n\tconst InternalComponent: React.ElementType<LinkProps> =\n\t\tprops.internalComponent ||\n\t\tcontext.internalLinkComponent ||\n\t\tdefaultInternalComponent;\n\n\tconst ExternalComponent: React.ElementType<LinkProps> =\n\t\tprops.externalComponent ||\n\t\tcontext.externalLinkComponent ||\n\t\tdefaultExternalComponent;\n\n\tconst Component = isInternal ? InternalComponent : ExternalComponent;\n\n\tconst passthroughProps: typeof props = Object.assign({}, props);\n\tdelete passthroughProps.linkResolver;\n\tdelete passthroughProps.internalComponent;\n\tdelete passthroughProps.externalComponent;\n\tdelete passthroughProps.rel;\n\tdelete passthroughProps.target;\n\tif (\"field\" in passthroughProps) {\n\t\tdelete passthroughProps.field;\n\t} else if (\"document\" in passthroughProps) {\n\t\tdelete passthroughProps.document;\n\t} else if (\"href\" in passthroughProps) {\n\t\tdelete passthroughProps.href;\n\t}\n\n\treturn href ? (\n\t\t<Component\n\t\t\t// @ts-expect-error - Expression produces a union type\n\t\t\t// that is too complex to represent. This most likely\n\t\t\t// happens due to the polymorphic nature of this\n\t\t\t// component, passing of \"extra\" props, and ref\n\t\t\t// forwarding support.\n\t\t\t{...passthroughProps}\n\t\t\tref={ref}\n\t\t\thref={href}\n\t\t\ttarget={target}\n\t\t\trel={rel}\n\t\t/>\n\t) : null;\n};\n\nif (!__PRODUCTION__) {\n\t_PrismicLink.displayName = \"PrismicLink\";\n}\n\n/**\n * React component that renders a link from a Prismic Link field.\n *\n * Different components can be rendered depending on whether the link is\n * internal or external. This is helpful when integrating with client-side\n * routers, such as a router-specific Link component.\n *\n * If a link is configured to open in a new window using `target=\"_blank\"`,\n * `rel=\"noopener noreferrer\"` is set by default.\n *\n * @param props - Props for the component.\n *\n * @returns The internal or external link component depending on whether the\n * link is internal or external.\n */\nexport const PrismicLink = React.forwardRef(_PrismicLink) as <\n\tInternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent,\n\tExternalComponent extends React.ElementType<LinkProps> = typeof defaultExternalComponent,\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tLinkResolverFunction extends prismicH.LinkResolverFunction<any> = prismicH.LinkResolverFunction,\n>(\n\tprops: PrismicLinkProps<\n\t\tInternalComponent,\n\t\tExternalComponent,\n\t\tLinkResolverFunction\n\t> & { ref?: React.Ref<Element> },\n) => JSX.Element | null;\n"],"names":["usePrismicContext","__PRODUCTION__","devMsg","prismicH","isInternalURL","jsx","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA,MAAM,2BAA2B;AAKjC,MAAM,2BAA2B;AAEjC,MAAM,eAAe,CAMpB,OAMA,QACuB;AACvB,QAAM,UAAUA,kBAAAA;AAEhB,MAAI,CAACC,eAAAA,gBAAgB;AAChB,QAAA,WAAW,SAAS,MAAM,OAAO;AAChC,UAAA,CAAC,MAAM,MAAM,WAAW;AAC3B,gBAAQ,MACP;AAAA,GACA,MAAM,KAAK;AAEZ,cAAM,IAAI,MACT,8IAA8IC,OAAA,OAC7I,yBAAyB,GACvB;AAAA,MAAA,WAGJ,OAAO,KAAK,MAAM,KAAK,EAAE,SAAS,KAClC,EAAE,SAAS,MAAM,SAAS,SAAS,MAAM,SAAS,QAAQ,MAAM,QAC/D;AACD,gBAAQ,KACP,uJAAuJA,OAAA,OACtJ,yBAAyB,KAE1B,MAAM,KAAK;AAAA,MAEZ;AAAA,IACS,WAAA,cAAc,SAAS,MAAM,UAAU;AACjD,UAAI,EAAE,SAAS,MAAM,YAAY,QAAQ,MAAM,WAAW;AACzD,gBAAQ,KACP,0JAA0JA,OAAA,OACzJ,yBAAyB,KAE1B,MAAM,QAAQ;AAAA,MAEf;AAAA,IACD;AAAA,EACD;AAEK,QAAA,eAAe,MAAM,gBAAgB,QAAQ;AAE/C,MAAA;AACJ,MAAI,UAAU,OAAO;AACpB,WAAO,MAAM;AAAA,EACH,WAAA,cAAc,SAAS,MAAM,UAAU;AACjD,WAAOC,oBAAS,OAAO,MAAM,UAAU,YAAY;AAAA,EACzC,WAAA,WAAW,SAAS,MAAM,OAAO;AAC3C,WAAOA,oBAAS,OAAO,MAAM,OAAO,YAAY;AAAA,EAChD;AAEK,QAAA,aAAa,QAAQC,cAAA,cAAc,IAAI;AAE7C,QAAM,SACL,MAAM,UACL,WAAW,SACX,MAAM,SACN,YAAY,MAAM,SAClB,MAAM,MAAM,UACb;AAED,QAAM,MACL,MAAM,QAAQ,WAAW,WAAW,wBAAwB;AAE7D,QAAM,oBACL,MAAM,qBACN,QAAQ,yBACR;AAED,QAAM,oBACL,MAAM,qBACN,QAAQ,yBACR;AAEK,QAAA,YAAY,aAAa,oBAAoB;AAEnD,QAAM,mBAAiC,OAAO,OAAO,IAAI,KAAK;AAC9D,SAAO,iBAAiB;AACxB,SAAO,iBAAiB;AACxB,SAAO,iBAAiB;AACxB,SAAO,iBAAiB;AACxB,SAAO,iBAAiB;AACxB,MAAI,WAAW,kBAAkB;AAChC,WAAO,iBAAiB;AAAA,EAAA,WACd,cAAc,kBAAkB;AAC1C,WAAO,iBAAiB;AAAA,EAAA,WACd,UAAU,kBAAkB;AACtC,WAAO,iBAAiB;AAAA,EACxB;AAED,SAAO,OACNC,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MAMA,GAAI;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAEE,IAAA;AACL;AAEA,IAAI,CAACJ,+BAAgB;AACpB,eAAa,cAAc;AAC3B;AAiBY,MAAA,cAAcK,iBAAM,WAAW,YAAY;;"}
1
+ {"version":3,"file":"PrismicLink.cjs","sources":["../../src/PrismicLink.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport {\n\tPrismicLink as ServerPrismicLink,\n\tLinkProps,\n\tPrismicLinkProps,\n\tdefaultComponent,\n} from \"./react-server/PrismicLink\";\n\nimport { usePrismicContext } from \"./usePrismicContext\";\n\nexport { LinkProps, PrismicLinkProps };\n\nexport const PrismicLink = React.forwardRef(function PrismicLink<\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,\n\tref: React.ForwardedRef<Element>,\n) {\n\tconst context = usePrismicContext();\n\n\treturn (\n\t\t<ServerPrismicLink\n\t\t\tref={ref}\n\t\t\tlinkResolver={context.linkResolver}\n\t\t\tinternalComponent={context.internalLinkComponent}\n\t\t\texternalComponent={context.externalLinkComponent}\n\t\t\t{...props}\n\t\t/>\n\t);\n}) as <\n\tInternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = React.ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {\n\t\tref?: React.ForwardedRef<Element>;\n\t},\n) => JSX.Element;\n"],"names":["React","PrismicLink","usePrismicContext","jsx","ServerPrismicLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAeO,MAAM,cAAcA,iBAAM,WAAW,SAASC,aAIpD,OACA,KAAgC;AAEhC,QAAM,UAAUC,kBAAAA;AAEhB,SACEC,2BAAAA,IAAAC,cAAAA,aAAA,EACA,KACA,cAAc,QAAQ,cACtB,mBAAmB,QAAQ,uBAC3B,mBAAmB,QAAQ,uBAC3B,GAAI,MAAM,CAAA;AAGb,CAAC;;"}
@@ -1,105 +1,6 @@
1
1
  import * as React from "react";
2
- import * as prismicH from "@prismicio/helpers";
3
- import * as prismicT from "@prismicio/types";
4
- /**
5
- * Props provided to a component when rendered with `<PrismicLink>`.
6
- */
7
- export interface LinkProps {
8
- /**
9
- * The URL to link.
10
- */
11
- href: string;
12
- /**
13
- * The `target` attribute for anchor elements. If the Prismic field is
14
- * configured to open in a new window, this prop defaults to `_blank`.
15
- */
16
- target?: string;
17
- /**
18
- * The `rel` attribute for anchor elements. If the `target` prop is set to
19
- * `"_blank"`, this prop defaults to `"noopener noreferrer"`.
20
- */
21
- rel?: string;
22
- /**
23
- * Children for the component. *
24
- */
25
- children?: React.ReactNode;
26
- }
27
- /**
28
- * Props for `<PrismicLink>`.
29
- */
30
- export type PrismicLinkProps<InternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent, ExternalComponent extends React.ElementType<LinkProps> = typeof defaultInternalComponent, LinkResolverFunction extends prismicH.LinkResolverFunction<any> = prismicH.LinkResolverFunction> = Omit<React.ComponentPropsWithoutRef<InternalComponent> & React.ComponentPropsWithoutRef<ExternalComponent>, keyof LinkProps> & {
31
- /**
32
- * The Link Resolver used to resolve links.
33
- *
34
- * @remarks
35
- * If your app uses Route Resolvers when querying for your Prismic
36
- * repository's content, a Link Resolver does not need to be provided.
37
- * @see Learn about Link Resolvers and Route Resolvers {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver}
38
- */
39
- linkResolver?: LinkResolverFunction;
40
- /**
41
- * The component rendered for internal URLs. Defaults to `<a>`.
42
- *
43
- * If your app uses a client-side router that requires a special Link
44
- * component, provide the Link component to this prop.
45
- */
46
- internalComponent?: InternalComponent;
47
- /**
48
- * The component rendered for external URLs. Defaults to `<a>`.
49
- */
50
- externalComponent?: ExternalComponent;
51
- /**
52
- * The `target` attribute for anchor elements. If the Prismic field is
53
- * configured to open in a new window, this prop defaults to `_blank`.
54
- */
55
- target?: string | null;
56
- /**
57
- * The `rel` attribute for anchor elements. If the `target` prop is set to
58
- * `"_blank"`, this prop defaults to `"noopener noreferrer"`.
59
- */
60
- rel?: string | null;
61
- /**
62
- * Children for the component. *
63
- */
64
- children?: React.ReactNode;
65
- } & ({
66
- /**
67
- * The Prismic Link field containing the URL or document to link.
68
- *
69
- * @see Learn about Prismic Link fields {@link https://prismic.io/docs/core-concepts/link-content-relationship}
70
- */
71
- field: prismicT.LinkField | null | undefined;
72
- } | {
73
- /**
74
- * The Prismic document to link.
75
- */
76
- document: prismicT.PrismicDocument | null | undefined;
77
- } | {
78
- /**
79
- * The URL to link.
80
- */
81
- href: string | null | undefined;
82
- });
83
- /**
84
- * The default component rendered for internal URLs.
85
- */
86
- declare const defaultInternalComponent = "a";
87
- /**
88
- * React component that renders a link from a Prismic Link field.
89
- *
90
- * Different components can be rendered depending on whether the link is
91
- * internal or external. This is helpful when integrating with client-side
92
- * routers, such as a router-specific Link component.
93
- *
94
- * If a link is configured to open in a new window using `target="_blank"`,
95
- * `rel="noopener noreferrer"` is set by default.
96
- *
97
- * @param props - Props for the component.
98
- *
99
- * @returns The internal or external link component depending on whether the
100
- * link is internal or external.
101
- */
102
- export declare const PrismicLink: <InternalComponent extends React.ElementType<LinkProps> = "a", ExternalComponent extends React.ElementType<LinkProps> = "a", LinkResolverFunction extends prismicH.LinkResolverFunction<any> = prismicH.LinkResolverFunction<string>>(props: PrismicLinkProps<InternalComponent, ExternalComponent, LinkResolverFunction> & {
103
- ref?: React.Ref<Element> | undefined;
104
- }) => JSX.Element | null;
105
- export {};
2
+ import { LinkProps, PrismicLinkProps } from "./react-server/PrismicLink";
3
+ export { LinkProps, PrismicLinkProps };
4
+ export declare const PrismicLink: <InternalComponentProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, ExternalComponentProps = React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>>(props: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {
5
+ ref?: React.ForwardedRef<Element> | undefined;
6
+ }) => JSX.Element;
@@ -1,72 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import * as prismicH from "@prismicio/helpers";
4
- import { __PRODUCTION__ } from "./lib/__PRODUCTION__.js";
5
- import { devMsg } from "./lib/devMsg.js";
6
- import { isInternalURL } from "./lib/isInternalURL.js";
3
+ import { PrismicLink as PrismicLink$1 } from "./react-server/PrismicLink.js";
7
4
  import { usePrismicContext } from "./usePrismicContext.js";
8
- const defaultInternalComponent = "a";
9
- const defaultExternalComponent = "a";
10
- const _PrismicLink = (props, ref) => {
5
+ const PrismicLink = React.forwardRef(function PrismicLink2(props, ref) {
11
6
  const context = usePrismicContext();
12
- if (!__PRODUCTION__) {
13
- if ("field" in props && props.field) {
14
- if (!props.field.link_type) {
15
- console.error(`[PrismicLink] This "field" prop value caused an error to be thrown.
16
- `, props.field);
17
- throw new Error(`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg("missing-link-properties")}`);
18
- } else if (Object.keys(props.field).length > 1 && !("url" in props.field || "uid" in props.field || "id" in props.field)) {
19
- console.warn(`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg("missing-link-properties")}`, props.field);
20
- }
21
- } else if ("document" in props && props.document) {
22
- if (!("url" in props.document || "id" in props.document)) {
23
- console.warn(`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg("missing-link-properties")}`, props.document);
24
- }
25
- }
26
- }
27
- const linkResolver = props.linkResolver || context.linkResolver;
28
- let href;
29
- if ("href" in props) {
30
- href = props.href;
31
- } else if ("document" in props && props.document) {
32
- href = prismicH.asLink(props.document, linkResolver);
33
- } else if ("field" in props && props.field) {
34
- href = prismicH.asLink(props.field, linkResolver);
35
- }
36
- const isInternal = href && isInternalURL(href);
37
- const target = props.target || "field" in props && props.field && "target" in props.field && props.field.target || void 0;
38
- const rel = props.rel || (target === "_blank" ? "noopener noreferrer" : void 0);
39
- const InternalComponent = props.internalComponent || context.internalLinkComponent || defaultInternalComponent;
40
- const ExternalComponent = props.externalComponent || context.externalLinkComponent || defaultExternalComponent;
41
- const Component = isInternal ? InternalComponent : ExternalComponent;
42
- const passthroughProps = Object.assign({}, props);
43
- delete passthroughProps.linkResolver;
44
- delete passthroughProps.internalComponent;
45
- delete passthroughProps.externalComponent;
46
- delete passthroughProps.rel;
47
- delete passthroughProps.target;
48
- if ("field" in passthroughProps) {
49
- delete passthroughProps.field;
50
- } else if ("document" in passthroughProps) {
51
- delete passthroughProps.document;
52
- } else if ("href" in passthroughProps) {
53
- delete passthroughProps.href;
54
- }
55
- return href ? /* @__PURE__ */ jsx(
56
- Component,
57
- {
58
- ...passthroughProps,
59
- ref,
60
- href,
61
- target,
62
- rel
63
- }
64
- ) : null;
65
- };
66
- if (!__PRODUCTION__) {
67
- _PrismicLink.displayName = "PrismicLink";
68
- }
69
- const PrismicLink = React.forwardRef(_PrismicLink);
7
+ return /* @__PURE__ */ jsx(PrismicLink$1, { ref, linkResolver: context.linkResolver, internalComponent: context.internalLinkComponent, externalComponent: context.externalLinkComponent, ...props });
8
+ });
70
9
  export {
71
10
  PrismicLink
72
11
  };