@prismicio/next 2.2.2 → 2.2.3-canary.1abb259

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 (178) hide show
  1. package/dist/PrismicNextImage.cjs +16 -20
  2. package/dist/PrismicNextImage.cjs.map +1 -1
  3. package/dist/PrismicNextImage.d.cts +14 -23
  4. package/dist/PrismicNextImage.d.cts.map +1 -0
  5. package/dist/PrismicNextImage.d.ts +14 -23
  6. package/dist/PrismicNextImage.d.ts.map +1 -0
  7. package/dist/PrismicNextImage.js +11 -15
  8. package/dist/PrismicNextImage.js.map +1 -1
  9. package/dist/PrismicNextLink.cjs +7 -8
  10. package/dist/PrismicNextLink.cjs.map +1 -1
  11. package/dist/PrismicNextLink.d.cts +10 -10
  12. package/dist/PrismicNextLink.d.cts.map +1 -0
  13. package/dist/PrismicNextLink.d.ts +10 -10
  14. package/dist/PrismicNextLink.d.ts.map +1 -0
  15. package/dist/PrismicNextLink.js +3 -4
  16. package/dist/PrismicNextLink.js.map +1 -1
  17. package/dist/PrismicPreview.cjs +13 -15
  18. package/dist/PrismicPreview.cjs.map +1 -1
  19. package/dist/PrismicPreview.d.cts +12 -14
  20. package/dist/PrismicPreview.d.cts.map +1 -0
  21. package/dist/PrismicPreview.d.ts +12 -14
  22. package/dist/PrismicPreview.d.ts.map +1 -0
  23. package/dist/PrismicPreview.js +8 -10
  24. package/dist/PrismicPreview.js.map +1 -1
  25. package/dist/PrismicPreviewClient.cjs +5 -9
  26. package/dist/PrismicPreviewClient.cjs.map +1 -1
  27. package/dist/PrismicPreviewClient.js +6 -10
  28. package/dist/PrismicPreviewClient.js.map +1 -1
  29. package/dist/SliceSimulator.cjs +6 -8
  30. package/dist/SliceSimulator.cjs.map +1 -1
  31. package/dist/SliceSimulator.d.cts +3 -6
  32. package/dist/SliceSimulator.d.cts.map +1 -0
  33. package/dist/SliceSimulator.d.ts +3 -6
  34. package/dist/SliceSimulator.d.ts.map +1 -0
  35. package/dist/SliceSimulator.js +4 -6
  36. package/dist/SliceSimulator.js.map +1 -1
  37. package/dist/SliceSimulatorWrapper.cjs +3 -7
  38. package/dist/SliceSimulatorWrapper.cjs.map +1 -1
  39. package/dist/SliceSimulatorWrapper.js +2 -6
  40. package/dist/SliceSimulatorWrapper.js.map +1 -1
  41. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +8 -14
  42. package/dist/createLocaleRedirect.cjs +2 -3
  43. package/dist/createLocaleRedirect.cjs.map +1 -1
  44. package/dist/createLocaleRedirect.d.cts.map +1 -0
  45. package/dist/createLocaleRedirect.d.ts.map +1 -0
  46. package/dist/createLocaleRedirect.js +1 -2
  47. package/dist/createLocaleRedirect.js.map +1 -1
  48. package/dist/enableAutoPreviews.cjs +4 -6
  49. package/dist/enableAutoPreviews.cjs.map +1 -1
  50. package/dist/enableAutoPreviews.d.cts +2 -4
  51. package/dist/enableAutoPreviews.d.cts.map +1 -0
  52. package/dist/enableAutoPreviews.d.ts +2 -4
  53. package/dist/enableAutoPreviews.d.ts.map +1 -0
  54. package/dist/enableAutoPreviews.js +3 -5
  55. package/dist/enableAutoPreviews.js.map +1 -1
  56. package/dist/exitPreview.cjs +11 -13
  57. package/dist/exitPreview.cjs.map +1 -1
  58. package/dist/exitPreview.d.cts +9 -10
  59. package/dist/exitPreview.d.cts.map +1 -0
  60. package/dist/exitPreview.d.ts +9 -10
  61. package/dist/exitPreview.d.ts.map +1 -0
  62. package/dist/exitPreview.js +11 -12
  63. package/dist/exitPreview.js.map +1 -1
  64. package/dist/getSlices.cjs +2 -3
  65. package/dist/getSlices.cjs.map +1 -1
  66. package/dist/getSlices.d.cts.map +1 -0
  67. package/dist/getSlices.d.ts.map +1 -0
  68. package/dist/getSlices.js +1 -2
  69. package/dist/getSlices.js.map +1 -1
  70. package/dist/imgixLoader.cjs +4 -5
  71. package/dist/imgixLoader.cjs.map +1 -1
  72. package/dist/imgixLoader.d.cts +3 -4
  73. package/dist/imgixLoader.d.cts.map +1 -0
  74. package/dist/imgixLoader.d.ts +3 -4
  75. package/dist/imgixLoader.d.ts.map +1 -0
  76. package/dist/imgixLoader.js +3 -4
  77. package/dist/imgixLoader.js.map +1 -1
  78. package/dist/index.cjs +12 -12
  79. package/dist/index.js +1 -2
  80. package/dist/lib/devMsg.cjs +8 -11
  81. package/dist/lib/devMsg.cjs.map +1 -1
  82. package/dist/lib/devMsg.js +7 -10
  83. package/dist/lib/devMsg.js.map +1 -1
  84. package/dist/lib/resolveDefaultExport.cjs +9 -14
  85. package/dist/lib/resolveDefaultExport.cjs.map +1 -1
  86. package/dist/lib/resolveDefaultExport.js +9 -13
  87. package/dist/lib/resolveDefaultExport.js.map +1 -1
  88. package/dist/package.cjs +7 -8
  89. package/dist/package.js +2 -2
  90. package/dist/pages/PrismicPreview.cjs +12 -14
  91. package/dist/pages/PrismicPreview.cjs.map +1 -1
  92. package/dist/pages/PrismicPreview.d.cts +12 -14
  93. package/dist/pages/PrismicPreview.d.cts.map +1 -0
  94. package/dist/pages/PrismicPreview.d.ts +12 -14
  95. package/dist/pages/PrismicPreview.d.ts.map +1 -0
  96. package/dist/pages/PrismicPreview.js +8 -10
  97. package/dist/pages/PrismicPreview.js.map +1 -1
  98. package/dist/pages/SliceSimulator.cjs +5 -6
  99. package/dist/pages/SliceSimulator.cjs.map +1 -1
  100. package/dist/pages/SliceSimulator.d.cts +10 -13
  101. package/dist/pages/SliceSimulator.d.cts.map +1 -0
  102. package/dist/pages/SliceSimulator.d.ts +10 -13
  103. package/dist/pages/SliceSimulator.d.ts.map +1 -0
  104. package/dist/pages/SliceSimulator.js +3 -4
  105. package/dist/pages/SliceSimulator.js.map +1 -1
  106. package/dist/pages/enableAutoPreviews.cjs +4 -5
  107. package/dist/pages/enableAutoPreviews.cjs.map +1 -1
  108. package/dist/pages/enableAutoPreviews.d.cts +6 -8
  109. package/dist/pages/enableAutoPreviews.d.cts.map +1 -0
  110. package/dist/pages/enableAutoPreviews.d.ts +6 -8
  111. package/dist/pages/enableAutoPreviews.d.ts.map +1 -0
  112. package/dist/pages/enableAutoPreviews.js +4 -4
  113. package/dist/pages/enableAutoPreviews.js.map +1 -1
  114. package/dist/pages/exitPreview.cjs +10 -12
  115. package/dist/pages/exitPreview.cjs.map +1 -1
  116. package/dist/pages/exitPreview.d.cts +9 -10
  117. package/dist/pages/exitPreview.d.cts.map +1 -0
  118. package/dist/pages/exitPreview.d.ts +9 -10
  119. package/dist/pages/exitPreview.d.ts.map +1 -0
  120. package/dist/pages/exitPreview.js +10 -11
  121. package/dist/pages/exitPreview.js.map +1 -1
  122. package/dist/pages/redirectToPreviewURL.cjs +1 -2
  123. package/dist/pages/redirectToPreviewURL.cjs.map +1 -1
  124. package/dist/pages/redirectToPreviewURL.d.cts +8 -11
  125. package/dist/pages/redirectToPreviewURL.d.cts.map +1 -0
  126. package/dist/pages/redirectToPreviewURL.d.ts +8 -11
  127. package/dist/pages/redirectToPreviewURL.d.ts.map +1 -0
  128. package/dist/pages/redirectToPreviewURL.js +1 -1
  129. package/dist/pages/redirectToPreviewURL.js.map +1 -1
  130. package/dist/pages/setPreviewData.cjs +2 -3
  131. package/dist/pages/setPreviewData.cjs.map +1 -1
  132. package/dist/pages/setPreviewData.d.cts.map +1 -0
  133. package/dist/pages/setPreviewData.d.ts.map +1 -0
  134. package/dist/pages/setPreviewData.js +1 -2
  135. package/dist/pages/setPreviewData.js.map +1 -1
  136. package/dist/pages/types.d.cts +3 -9
  137. package/dist/pages/types.d.cts.map +1 -0
  138. package/dist/pages/types.d.ts +3 -9
  139. package/dist/pages/types.d.ts.map +1 -0
  140. package/dist/pages.cjs +12 -12
  141. package/dist/pages.js +1 -2
  142. package/dist/redirectToPreviewURL.cjs +3 -4
  143. package/dist/redirectToPreviewURL.cjs.map +1 -1
  144. package/dist/redirectToPreviewURL.d.cts +4 -7
  145. package/dist/redirectToPreviewURL.d.cts.map +1 -0
  146. package/dist/redirectToPreviewURL.d.ts +4 -7
  147. package/dist/redirectToPreviewURL.d.ts.map +1 -0
  148. package/dist/redirectToPreviewURL.js +2 -3
  149. package/dist/redirectToPreviewURL.js.map +1 -1
  150. package/dist/types.d.cts +1 -2
  151. package/dist/types.d.cts.map +1 -0
  152. package/dist/types.d.ts +1 -2
  153. package/dist/types.d.ts.map +1 -0
  154. package/package.json +34 -36
  155. package/src/PrismicNextImage.tsx +113 -134
  156. package/src/PrismicNextLink.tsx +43 -45
  157. package/src/PrismicPreview.tsx +28 -29
  158. package/src/PrismicPreviewClient.tsx +42 -44
  159. package/src/SliceSimulator.tsx +38 -43
  160. package/src/SliceSimulatorWrapper.tsx +15 -25
  161. package/src/createLocaleRedirect.ts +3 -3
  162. package/src/enableAutoPreviews.ts +15 -16
  163. package/src/exitPreview.ts +12 -13
  164. package/src/getSlices.ts +6 -10
  165. package/src/imgixLoader.ts +10 -10
  166. package/src/index.ts +18 -21
  167. package/src/lib/devMsg.ts +9 -11
  168. package/src/lib/resolveDefaultExport.ts +9 -13
  169. package/src/pages/PrismicPreview.tsx +47 -51
  170. package/src/pages/SliceSimulator.tsx +35 -37
  171. package/src/pages/enableAutoPreviews.ts +17 -17
  172. package/src/pages/exitPreview.ts +17 -18
  173. package/src/pages/index.ts +20 -23
  174. package/src/pages/redirectToPreviewURL.ts +22 -33
  175. package/src/pages/setPreviewData.ts +7 -7
  176. package/src/pages/types.ts +16 -20
  177. package/src/redirectToPreviewURL.ts +21 -30
  178. package/src/types.ts +12 -13
@@ -1,16 +1,14 @@
1
1
  "use client";
2
-
3
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
4
- const require_resolveDefaultExport = require('./lib/resolveDefaultExport.cjs');
5
- const require_devMsg = require('./lib/devMsg.cjs');
6
- const require_imgixLoader = require('./imgixLoader.cjs');
2
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
3
+ const require_resolveDefaultExport = require("./lib/resolveDefaultExport.cjs");
4
+ const require_imgixLoader = require("./imgixLoader.cjs");
5
+ const require_devMsg = require("./lib/devMsg.cjs");
7
6
  let _prismicio_client = require("@prismicio/client");
8
7
  let react = require("react");
9
8
  let react_jsx_runtime = require("react/jsx-runtime");
10
- let next_image = require("next/image");
11
- next_image = require_rolldown_runtime.__toESM(next_image);
12
9
  let imgix_url_builder = require("imgix-url-builder");
13
-
10
+ let next_image_js = require("next/image.js");
11
+ next_image_js = require_runtime.__toESM(next_image_js);
14
12
  //#region src/PrismicNextImage.tsx
15
13
  const castInt = (input) => {
16
14
  if (typeof input === "number" || typeof input === "undefined") return input;
@@ -21,22 +19,20 @@ const castInt = (input) => {
21
19
  }
22
20
  };
23
21
  /**
24
- * React component that renders an image from a Prismic Image field or one of
25
- * its thumbnails using `next/image`. It will automatically set the `alt`
26
- * attribute using the Image field's `alt` property.
22
+ * React component that renders an image from a Prismic Image field or one of its thumbnails using
23
+ * `next/image`. It will automatically set the `alt` attribute using the Image field's `alt`
24
+ * property.
27
25
  *
28
- * It uses an Imgix URL-based loader by default. A custom loader can be provided
29
- * with the `loader` prop. If you would like to use the Next.js Image
30
- * Optimization API instead, set `loader={undefined}`.
26
+ * It uses an Imgix URL-based loader by default. A custom loader can be provided with the `loader`
27
+ * prop. If you would like to use the Next.js Image Optimization API instead, set
28
+ * `loader={undefined}`.
31
29
  *
32
30
  * @param props - Props for the component.
33
- *
34
31
  * @returns A responsive image component using `next/image` for the given Image
35
- * field.
36
- *
32
+ * field.
37
33
  * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image
38
34
  */
39
- const PrismicNextImage = (0, react.forwardRef)(function PrismicNextImage$1({ field, imgixParams = {}, alt, fallbackAlt, fill, width, height, fallback = null, loader = require_imgixLoader.imgixLoader, ...restProps }, ref) {
35
+ const PrismicNextImage = (0, react.forwardRef)(function PrismicNextImage({ field, imgixParams = {}, alt, fallbackAlt, fill, width, height, fallback = null, loader = require_imgixLoader.imgixLoader, ...restProps }, ref) {
40
36
  if (process.env.NODE_ENV === "development") {
41
37
  if (typeof alt === "string" && alt !== "") console.warn(`[PrismicNextImage] 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 ${require_devMsg.devMsg("alt-must-be-an-empty-string")}`);
42
38
  if (typeof fallbackAlt === "string" && fallbackAlt !== "") console.warn(`[PrismicNextImage] 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 ${require_devMsg.devMsg("alt-must-be-an-empty-string")}`);
@@ -54,7 +50,7 @@ const PrismicNextImage = (0, react.forwardRef)(function PrismicNextImage$1({ fie
54
50
  else if (castedWidth == null && castedHeight != null) resolvedWidth = castedHeight * ar;
55
51
  const resolvedAlt = alt ?? (field.alt || fallbackAlt);
56
52
  if (process.env.NODE_ENV === "development" && typeof resolvedAlt !== "string") console.error(`[PrismicNextImage] The following image is missing an "alt" property. Please add Alternative Text to the image in Prismic. To mark the image as decorative instead, add one of \`alt=""\` or \`fallbackAlt=""\`.`, src);
57
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_resolveDefaultExport.resolveDefaultExport(next_image.default), {
53
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_resolveDefaultExport.resolveDefaultExport(next_image_js.default), {
58
54
  ref,
59
55
  src,
60
56
  width: fill ? void 0 : resolvedWidth,
@@ -65,7 +61,7 @@ const PrismicNextImage = (0, react.forwardRef)(function PrismicNextImage$1({ fie
65
61
  ...restProps
66
62
  });
67
63
  });
68
-
69
64
  //#endregion
70
65
  exports.PrismicNextImage = PrismicNextImage;
66
+
71
67
  //# sourceMappingURL=PrismicNextImage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicNextImage.cjs","names":["PrismicNextImage","imgixLoader","devMsg","isFilled","resolveDefaultExport","Image"],"sources":["../src/PrismicNextImage.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n\tForwardRefExoticComponent,\n\tPropsWithoutRef,\n\tRefAttributes} from \"react\";\nimport {\n\tforwardRef\n} from \"react\";\nimport type { ImageProps } from \"next/image\";\nimport Image from \"next/image\";\nimport type { ImgixURLParams } from \"imgix-url-builder\";\nimport { buildURL } from \"imgix-url-builder\";\nimport type { ImageFieldImage} from \"@prismicio/client\";\nimport { isFilled } from \"@prismicio/client\";\n\nimport { devMsg } from \"./lib/devMsg\";\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\";\n\nimport { imgixLoader } from \"./imgixLoader\";\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\nexport type PrismicNextImageProps = Omit<\n\tImageProps,\n\t\"src\" | \"alt\" | \"loader\"\n> & {\n\t/** The Prismic Image field or thumbnail to render. */\n\tfield: 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?: { [P in keyof ImgixURLParams]: ImgixURLParams[P] | null };\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 * Rendered when the field is empty. If a fallback is not given, `null` will\n\t * be rendered.\n\t */\n\tfallback?: React.ReactNode;\n\n\tloader?: ImageProps[\"loader\"] | null;\n};\n\n/**\n * React component that renders an image from a Prismic Image field or one of\n * its thumbnails using `next/image`. It will automatically set the `alt`\n * attribute using the Image field's `alt` property.\n *\n * It uses an Imgix URL-based loader by default. A custom loader can be provided\n * with the `loader` prop. If you would like to use the Next.js Image\n * Optimization API instead, set `loader={undefined}`.\n *\n * @param props - Props for the component.\n *\n * @returns A responsive image component using `next/image` for the given Image\n * field.\n *\n * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image\n */\n// The type annotation is necessary to avoid a type reference issue.\nexport const PrismicNextImage: ForwardRefExoticComponent<\n\tPropsWithoutRef<PrismicNextImageProps> & RefAttributes<HTMLImageElement>\n> = forwardRef<HTMLImageElement, PrismicNextImageProps>(\n\tfunction PrismicNextImage(\n\t\t{\n\t\t\tfield,\n\t\t\timgixParams = {},\n\t\t\talt,\n\t\t\tfallbackAlt,\n\t\t\tfill,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tfallback = null,\n\t\t\tloader = imgixLoader,\n\t\t\t...restProps\n\t\t},\n\t\tref,\n\t) {\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tif (typeof alt === \"string\" && alt !== \"\") {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicNextImage] 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\t\"alt-must-be-an-empty-string\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (typeof fallbackAlt === \"string\" && fallbackAlt !== \"\") {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicNextImage] 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\t\"alt-must-be-an-empty-string\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!isFilled.imageThumbnail(field)) {\n\t\t\treturn <>{fallback}</>;\n\t\t}\n\n\t\tconst resolvedImgixParams = imgixParams;\n\t\tfor (const x in imgixParams) {\n\t\t\tif (resolvedImgixParams[x as keyof typeof resolvedImgixParams] === null) {\n\t\t\t\tresolvedImgixParams[x as keyof typeof resolvedImgixParams] = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst src = buildURL(field.url, imgixParams as ImgixURLParams);\n\n\t\tconst ar = field.dimensions.width / field.dimensions.height;\n\n\t\tconst castedWidth = castInt(width);\n\t\tconst castedHeight = castInt(height);\n\n\t\tlet resolvedWidth = castedWidth ?? field.dimensions.width;\n\t\tlet resolvedHeight = castedHeight ?? field.dimensions.height;\n\n\t\tif (castedWidth != null && castedHeight == null) {\n\t\t\tresolvedHeight = castedWidth / ar;\n\t\t} else if (castedWidth == null && castedHeight != null) {\n\t\t\tresolvedWidth = castedHeight * ar;\n\t\t}\n\n\t\t// A non-null assertion is required since we can't statically\n\t\t// know if an alt attribute is available.\n\t\tconst resolvedAlt = (alt ?? (field.alt || fallbackAlt))!;\n\n\t\tif (\n\t\t\tprocess.env.NODE_ENV === \"development\" &&\n\t\t\ttypeof resolvedAlt !== \"string\"\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[PrismicNextImage] The following image is missing an \"alt\" property. Please add Alternative Text to the image in Prismic. To mark the image as decorative instead, add one of \\`alt=\"\"\\` or \\`fallbackAlt=\"\"\\`.`,\n\t\t\t\tsrc,\n\t\t\t);\n\t\t}\n\n\t\tconst ResolvedImage = resolveDefaultExport(Image);\n\n\t\treturn (\n\t\t\t<ResolvedImage\n\t\t\t\tref={ref}\n\t\t\t\tsrc={src}\n\t\t\t\twidth={fill ? undefined : resolvedWidth}\n\t\t\t\theight={fill ? undefined : resolvedHeight}\n\t\t\t\talt={resolvedAlt}\n\t\t\t\tfill={fill}\n\t\t\t\tloader={loader === null ? undefined : loader}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAM,WAAW,UAA2D;AAC3E,KAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;MACD;EACN,MAAM,SAAS,OAAO,SAAS,MAAM;AAErC,MAAI,OAAO,MAAM,OAAO,CACvB;MAEA,QAAO;;;;;;;;;;;;;;;;;;;AA8DV,MAAa,yCAGZ,SAASA,mBACR,EACC,OACA,cAAc,EAAE,EAChB,KACA,aACA,MACA,OACA,QACA,WAAW,MACX,SAASC,iCACT,GAAG,aAEJ,KACC;AACD,KAAI,QAAQ,IAAI,aAAa,eAAe;AAC3C,MAAI,OAAO,QAAQ,YAAY,QAAQ,GACtC,SAAQ,KACP,yQAAyQC,sBACxQ,8BACA,GACD;AAGF,MAAI,OAAO,gBAAgB,YAAY,gBAAgB,GACtD,SAAQ,KACP,ySAAySA,sBACxS,8BACA,GACD;;AAIH,KAAI,CAACC,2BAAS,eAAe,MAAM,CAClC,QAAO,mFAAG,WAAY;CAGvB,MAAM,sBAAsB;AAC5B,MAAK,MAAM,KAAK,YACf,KAAI,oBAAoB,OAA2C,KAClE,qBAAoB,KAAyC;CAI/D,MAAM,sCAAe,MAAM,KAAK,YAA8B;CAE9D,MAAM,KAAK,MAAM,WAAW,QAAQ,MAAM,WAAW;CAErD,MAAM,cAAc,QAAQ,MAAM;CAClC,MAAM,eAAe,QAAQ,OAAO;CAEpC,IAAI,gBAAgB,eAAe,MAAM,WAAW;CACpD,IAAI,iBAAiB,gBAAgB,MAAM,WAAW;AAEtD,KAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;UACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;CAKhC,MAAM,cAAe,QAAQ,MAAM,OAAO;AAE1C,KACC,QAAQ,IAAI,aAAa,iBACzB,OAAO,gBAAgB,SAEvB,SAAQ,MACP,mNACA,IACA;AAKF,QACC,2CAHqBC,kDAAqBC,mBAAM;EAI1C;EACA;EACL,OAAO,OAAO,SAAY;EAC1B,QAAQ,OAAO,SAAY;EAC3B,KAAK;EACC;EACN,QAAQ,WAAW,OAAO,SAAY;EACtC,GAAI;GACH;EAGJ"}
1
+ {"version":3,"file":"PrismicNextImage.cjs","names":["imgixLoader","devMsg","isFilled","resolveDefaultExport","Image"],"sources":["../src/PrismicNextImage.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ImageFieldImage } from \"@prismicio/client\"\nimport { isFilled } from \"@prismicio/client\"\nimport type { ImgixURLParams } from \"imgix-url-builder\"\nimport { buildURL } from \"imgix-url-builder\"\nimport type { ImageProps } from \"next/image\"\nimport Image from \"next/image\"\nimport type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from \"react\"\nimport { forwardRef } from \"react\"\n\nimport { imgixLoader } from \"./imgixLoader\"\nimport { devMsg } from \"./lib/devMsg\"\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\"\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\nexport type PrismicNextImageProps = Omit<ImageProps, \"src\" | \"alt\" | \"loader\"> & {\n\t/** The Prismic Image field or thumbnail to render. */\n\tfield: 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?: { [P in keyof ImgixURLParams]: ImgixURLParams[P] | null }\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\"\n\n\t/**\n\t * Declare an image as decorative only if the Image field does not have alternative text by\n\t * providing `fallbackAlt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\"\n\n\t/** Rendered when the field is empty. If a fallback is not given, `null` will be rendered. */\n\tfallback?: React.ReactNode\n\n\tloader?: ImageProps[\"loader\"] | null\n}\n\n/**\n * React component that renders an image from a Prismic Image field or one of its thumbnails using\n * `next/image`. It will automatically set the `alt` attribute using the Image field's `alt`\n * property.\n *\n * It uses an Imgix URL-based loader by default. A custom loader can be provided with the `loader`\n * prop. If you would like to use the Next.js Image Optimization API instead, set\n * `loader={undefined}`.\n *\n * @param props - Props for the component.\n * @returns A responsive image component using `next/image` for the given Image\n * field.\n * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image\n */\n// The type annotation is necessary to avoid a type reference issue.\nexport const PrismicNextImage: ForwardRefExoticComponent<\n\tPropsWithoutRef<PrismicNextImageProps> & RefAttributes<HTMLImageElement>\n> = forwardRef<HTMLImageElement, PrismicNextImageProps>(function PrismicNextImage(\n\t{\n\t\tfield,\n\t\timgixParams = {},\n\t\talt,\n\t\tfallbackAlt,\n\t\tfill,\n\t\twidth,\n\t\theight,\n\t\tfallback = null,\n\t\tloader = imgixLoader,\n\t\t...restProps\n\t},\n\tref,\n) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (typeof alt === \"string\" && alt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicNextImage] 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`[PrismicNextImage] 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\t}\n\n\tif (!isFilled.imageThumbnail(field)) {\n\t\treturn <>{fallback}</>\n\t}\n\n\tconst resolvedImgixParams = imgixParams\n\tfor (const x in imgixParams) {\n\t\tif (resolvedImgixParams[x as keyof typeof resolvedImgixParams] === null) {\n\t\t\tresolvedImgixParams[x as keyof typeof resolvedImgixParams] = undefined\n\t\t}\n\t}\n\n\tconst src = buildURL(field.url, imgixParams as ImgixURLParams)\n\n\tconst ar = field.dimensions.width / field.dimensions.height\n\n\tconst castedWidth = castInt(width)\n\tconst castedHeight = castInt(height)\n\n\tlet resolvedWidth = castedWidth ?? field.dimensions.width\n\tlet resolvedHeight = castedHeight ?? 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\t// A non-null assertion is required since we can't statically\n\t// know if an alt attribute is available.\n\tconst resolvedAlt = (alt ?? (field.alt || fallbackAlt))!\n\n\tif (process.env.NODE_ENV === \"development\" && typeof resolvedAlt !== \"string\") {\n\t\tconsole.error(\n\t\t\t`[PrismicNextImage] The following image is missing an \"alt\" property. Please add Alternative Text to the image in Prismic. To mark the image as decorative instead, add one of \\`alt=\"\"\\` or \\`fallbackAlt=\"\"\\`.`,\n\t\t\tsrc,\n\t\t)\n\t}\n\n\tconst ResolvedImage = resolveDefaultExport(Image)\n\n\treturn (\n\t\t<ResolvedImage\n\t\t\tref={ref}\n\t\t\tsrc={src}\n\t\t\twidth={fill ? undefined : resolvedWidth}\n\t\t\theight={fill ? undefined : resolvedHeight}\n\t\t\talt={resolvedAlt}\n\t\t\tfill={fill}\n\t\t\tloader={loader === null ? undefined : loader}\n\t\t\t{...restProps}\n\t\t/>\n\t)\n})\n"],"mappings":";;;;;;;;;;;;AAeA,MAAM,WAAW,UAA2D;AAC3E,KAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;MACD;EACN,MAAM,SAAS,OAAO,SAAS,MAAM;AAErC,MAAI,OAAO,MAAM,OAAO,CACvB;MAEA,QAAO;;;;;;;;;;;;;;;;;AAoDV,MAAa,oBAAA,GAAA,MAAA,YAE2C,SAAS,iBAChE,EACC,OACA,cAAc,EAAE,EAChB,KACA,aACA,MACA,OACA,QACA,WAAW,MACX,SAASA,oBAAAA,aACT,GAAG,aAEJ,KACC;AACD,KAAI,QAAQ,IAAI,aAAa,eAAe;AAC3C,MAAI,OAAO,QAAQ,YAAY,QAAQ,GACtC,SAAQ,KACP,yQAAyQC,eAAAA,OACxQ,8BACA,GACD;AAGF,MAAI,OAAO,gBAAgB,YAAY,gBAAgB,GACtD,SAAQ,KACP,ySAAySA,eAAAA,OACxS,8BACA,GACD;;AAIH,KAAI,CAACC,kBAAAA,SAAS,eAAe,MAAM,CAClC,QAAO,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAAG,UAAY,CAAA;CAGvB,MAAM,sBAAsB;AAC5B,MAAK,MAAM,KAAK,YACf,KAAI,oBAAoB,OAA2C,KAClE,qBAAoB,KAAyC,KAAA;CAI/D,MAAM,OAAA,GAAA,kBAAA,UAAe,MAAM,KAAK,YAA8B;CAE9D,MAAM,KAAK,MAAM,WAAW,QAAQ,MAAM,WAAW;CAErD,MAAM,cAAc,QAAQ,MAAM;CAClC,MAAM,eAAe,QAAQ,OAAO;CAEpC,IAAI,gBAAgB,eAAe,MAAM,WAAW;CACpD,IAAI,iBAAiB,gBAAgB,MAAM,WAAW;AAEtD,KAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;UACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;CAKhC,MAAM,cAAe,QAAQ,MAAM,OAAO;AAE1C,KAAI,QAAQ,IAAI,aAAa,iBAAiB,OAAO,gBAAgB,SACpE,SAAQ,MACP,mNACA,IACA;AAKF,QACC,iBAAA,GAAA,kBAAA,KAHqBC,6BAAAA,qBAAqBC,cAAAA,QAAM,EAGhD;EACM;EACA;EACL,OAAO,OAAO,KAAA,IAAY;EAC1B,QAAQ,OAAO,KAAA,IAAY;EAC3B,KAAK;EACC;EACN,QAAQ,WAAW,OAAO,KAAA,IAAY;EACtC,GAAI;EACH,CAAA;EAEF"}
@@ -1,12 +1,11 @@
1
1
  import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
2
2
  import { ImageFieldImage } from "@prismicio/client";
3
- import { ImageProps } from "next/image";
4
3
  import { ImgixURLParams } from "imgix-url-builder";
4
+ import { ImageProps } from "next/image.js";
5
5
 
6
6
  //#region src/PrismicNextImage.d.ts
7
7
  type PrismicNextImageProps = Omit<ImageProps, "src" | "alt" | "loader"> & {
8
- /** The Prismic Image field or thumbnail to render. */
9
- field: ImageFieldImage | null | undefined;
8
+ /** The Prismic Image field or thumbnail to render. */field: ImageFieldImage | null | undefined;
10
9
  /**
11
10
  * An object of Imgix URL API parameters to transform the image.
12
11
  *
@@ -16,39 +15,31 @@ type PrismicNextImageProps = Omit<ImageProps, "src" | "alt" | "loader"> & {
16
15
  /**
17
16
  * Declare an image as decorative by providing `alt=""`.
18
17
  *
19
- * See:
20
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
18
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
21
19
  */
22
20
  alt?: "";
23
21
  /**
24
- * Declare an image as decorative only if the Image field does not have
25
- * alternative text by providing `fallbackAlt=""`.
22
+ * Declare an image as decorative only if the Image field does not have alternative text by
23
+ * providing `fallbackAlt=""`.
26
24
  *
27
- * See:
28
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
29
- */
30
- fallbackAlt?: "";
31
- /**
32
- * Rendered when the field is empty. If a fallback is not given, `null` will
33
- * be rendered.
25
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
34
26
  */
27
+ fallbackAlt?: ""; /** Rendered when the field is empty. If a fallback is not given, `null` will be rendered. */
35
28
  fallback?: React.ReactNode;
36
29
  loader?: ImageProps["loader"] | null;
37
30
  };
38
31
  /**
39
- * React component that renders an image from a Prismic Image field or one of
40
- * its thumbnails using `next/image`. It will automatically set the `alt`
41
- * attribute using the Image field's `alt` property.
32
+ * React component that renders an image from a Prismic Image field or one of its thumbnails using
33
+ * `next/image`. It will automatically set the `alt` attribute using the Image field's `alt`
34
+ * property.
42
35
  *
43
- * It uses an Imgix URL-based loader by default. A custom loader can be provided
44
- * with the `loader` prop. If you would like to use the Next.js Image
45
- * Optimization API instead, set `loader={undefined}`.
36
+ * It uses an Imgix URL-based loader by default. A custom loader can be provided with the `loader`
37
+ * prop. If you would like to use the Next.js Image Optimization API instead, set
38
+ * `loader={undefined}`.
46
39
  *
47
40
  * @param props - Props for the component.
48
- *
49
41
  * @returns A responsive image component using `next/image` for the given Image
50
- * field.
51
- *
42
+ * field.
52
43
  * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image
53
44
  */
54
45
  declare const PrismicNextImage: ForwardRefExoticComponent<PropsWithoutRef<PrismicNextImageProps> & RefAttributes<HTMLImageElement>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrismicNextImage.d.cts","names":[],"sources":["../src/PrismicNextImage.tsx"],"mappings":";;;;;;KA6BY,qBAAA,GAAwB,IAAA,CAAK,UAAA;wDAExC,KAAA,EAAO,eAAA;EAFyB;;;;;EAShC,WAAA,iBAA4B,cAAA,GAAiB,cAAA,CAAe,CAAA;EAkBjD;;;;;EAXX,GAAA;EAdA;;;;;;EAsBA,WAAA,OARA;EAWA,QAAA,GAAW,KAAA,CAAM,SAAA;EAEjB,MAAA,GAAS,UAAA;AAAA;;;;;;AAkBV;;;;;;;;;cAAa,gBAAA,EAAkB,yBAAA,CAC9B,eAAA,CAAgB,qBAAA,IAAyB,aAAA,CAAc,gBAAA"}
@@ -1,12 +1,11 @@
1
1
  import { ImageFieldImage } from "@prismicio/client";
2
2
  import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from "react";
3
- import { ImageProps } from "next/image";
4
3
  import { ImgixURLParams } from "imgix-url-builder";
4
+ import { ImageProps } from "next/image.js";
5
5
 
6
6
  //#region src/PrismicNextImage.d.ts
7
7
  type PrismicNextImageProps = Omit<ImageProps, "src" | "alt" | "loader"> & {
8
- /** The Prismic Image field or thumbnail to render. */
9
- field: ImageFieldImage | null | undefined;
8
+ /** The Prismic Image field or thumbnail to render. */field: ImageFieldImage | null | undefined;
10
9
  /**
11
10
  * An object of Imgix URL API parameters to transform the image.
12
11
  *
@@ -16,39 +15,31 @@ type PrismicNextImageProps = Omit<ImageProps, "src" | "alt" | "loader"> & {
16
15
  /**
17
16
  * Declare an image as decorative by providing `alt=""`.
18
17
  *
19
- * See:
20
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
18
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
21
19
  */
22
20
  alt?: "";
23
21
  /**
24
- * Declare an image as decorative only if the Image field does not have
25
- * alternative text by providing `fallbackAlt=""`.
22
+ * Declare an image as decorative only if the Image field does not have alternative text by
23
+ * providing `fallbackAlt=""`.
26
24
  *
27
- * See:
28
- * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
29
- */
30
- fallbackAlt?: "";
31
- /**
32
- * Rendered when the field is empty. If a fallback is not given, `null` will
33
- * be rendered.
25
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
34
26
  */
27
+ fallbackAlt?: ""; /** Rendered when the field is empty. If a fallback is not given, `null` will be rendered. */
35
28
  fallback?: React.ReactNode;
36
29
  loader?: ImageProps["loader"] | null;
37
30
  };
38
31
  /**
39
- * React component that renders an image from a Prismic Image field or one of
40
- * its thumbnails using `next/image`. It will automatically set the `alt`
41
- * attribute using the Image field's `alt` property.
32
+ * React component that renders an image from a Prismic Image field or one of its thumbnails using
33
+ * `next/image`. It will automatically set the `alt` attribute using the Image field's `alt`
34
+ * property.
42
35
  *
43
- * It uses an Imgix URL-based loader by default. A custom loader can be provided
44
- * with the `loader` prop. If you would like to use the Next.js Image
45
- * Optimization API instead, set `loader={undefined}`.
36
+ * It uses an Imgix URL-based loader by default. A custom loader can be provided with the `loader`
37
+ * prop. If you would like to use the Next.js Image Optimization API instead, set
38
+ * `loader={undefined}`.
46
39
  *
47
40
  * @param props - Props for the component.
48
- *
49
41
  * @returns A responsive image component using `next/image` for the given Image
50
- * field.
51
- *
42
+ * field.
52
43
  * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image
53
44
  */
54
45
  declare const PrismicNextImage: ForwardRefExoticComponent<PropsWithoutRef<PrismicNextImageProps> & RefAttributes<HTMLImageElement>>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrismicNextImage.d.ts","names":[],"sources":["../src/PrismicNextImage.tsx"],"mappings":";;;;;;KA6BY,qBAAA,GAAwB,IAAA,CAAK,UAAA;wDAExC,KAAA,EAAO,eAAA;EAFyB;;;;;EAShC,WAAA,iBAA4B,cAAA,GAAiB,cAAA,CAAe,CAAA;EAkBjD;;;;;EAXX,GAAA;EAdA;;;;;;EAsBA,WAAA,OARA;EAWA,QAAA,GAAW,KAAA,CAAM,SAAA;EAEjB,MAAA,GAAS,UAAA;AAAA;;;;;;AAkBV;;;;;;;;;cAAa,gBAAA,EAAkB,yBAAA,CAC9B,eAAA,CAAgB,qBAAA,IAAyB,aAAA,CAAc,gBAAA"}
@@ -1,14 +1,12 @@
1
1
  "use client";
2
-
3
2
  import { resolveDefaultExport } from "./lib/resolveDefaultExport.js";
4
- import { devMsg } from "./lib/devMsg.js";
5
3
  import { imgixLoader } from "./imgixLoader.js";
4
+ import { devMsg } from "./lib/devMsg.js";
6
5
  import { isFilled } from "@prismicio/client";
7
6
  import { forwardRef } from "react";
8
7
  import { Fragment, jsx } from "react/jsx-runtime";
9
- import Image from "next/image";
10
8
  import { buildURL } from "imgix-url-builder";
11
-
9
+ import Image from "next/image.js";
12
10
  //#region src/PrismicNextImage.tsx
13
11
  const castInt = (input) => {
14
12
  if (typeof input === "number" || typeof input === "undefined") return input;
@@ -19,22 +17,20 @@ const castInt = (input) => {
19
17
  }
20
18
  };
21
19
  /**
22
- * React component that renders an image from a Prismic Image field or one of
23
- * its thumbnails using `next/image`. It will automatically set the `alt`
24
- * attribute using the Image field's `alt` property.
20
+ * React component that renders an image from a Prismic Image field or one of its thumbnails using
21
+ * `next/image`. It will automatically set the `alt` attribute using the Image field's `alt`
22
+ * property.
25
23
  *
26
- * It uses an Imgix URL-based loader by default. A custom loader can be provided
27
- * with the `loader` prop. If you would like to use the Next.js Image
28
- * Optimization API instead, set `loader={undefined}`.
24
+ * It uses an Imgix URL-based loader by default. A custom loader can be provided with the `loader`
25
+ * prop. If you would like to use the Next.js Image Optimization API instead, set
26
+ * `loader={undefined}`.
29
27
  *
30
28
  * @param props - Props for the component.
31
- *
32
29
  * @returns A responsive image component using `next/image` for the given Image
33
- * field.
34
- *
30
+ * field.
35
31
  * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image
36
32
  */
37
- const PrismicNextImage = forwardRef(function PrismicNextImage$1({ field, imgixParams = {}, alt, fallbackAlt, fill, width, height, fallback = null, loader = imgixLoader, ...restProps }, ref) {
33
+ const PrismicNextImage = forwardRef(function PrismicNextImage({ field, imgixParams = {}, alt, fallbackAlt, fill, width, height, fallback = null, loader = imgixLoader, ...restProps }, ref) {
38
34
  if (process.env.NODE_ENV === "development") {
39
35
  if (typeof alt === "string" && alt !== "") console.warn(`[PrismicNextImage] 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("alt-must-be-an-empty-string")}`);
40
36
  if (typeof fallbackAlt === "string" && fallbackAlt !== "") console.warn(`[PrismicNextImage] 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("alt-must-be-an-empty-string")}`);
@@ -63,7 +59,7 @@ const PrismicNextImage = forwardRef(function PrismicNextImage$1({ field, imgixPa
63
59
  ...restProps
64
60
  });
65
61
  });
66
-
67
62
  //#endregion
68
63
  export { PrismicNextImage };
64
+
69
65
  //# sourceMappingURL=PrismicNextImage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicNextImage.js","names":["PrismicNextImage"],"sources":["../src/PrismicNextImage.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n\tForwardRefExoticComponent,\n\tPropsWithoutRef,\n\tRefAttributes} from \"react\";\nimport {\n\tforwardRef\n} from \"react\";\nimport type { ImageProps } from \"next/image\";\nimport Image from \"next/image\";\nimport type { ImgixURLParams } from \"imgix-url-builder\";\nimport { buildURL } from \"imgix-url-builder\";\nimport type { ImageFieldImage} from \"@prismicio/client\";\nimport { isFilled } from \"@prismicio/client\";\n\nimport { devMsg } from \"./lib/devMsg\";\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\";\n\nimport { imgixLoader } from \"./imgixLoader\";\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\nexport type PrismicNextImageProps = Omit<\n\tImageProps,\n\t\"src\" | \"alt\" | \"loader\"\n> & {\n\t/** The Prismic Image field or thumbnail to render. */\n\tfield: 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?: { [P in keyof ImgixURLParams]: ImgixURLParams[P] | null };\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 * Rendered when the field is empty. If a fallback is not given, `null` will\n\t * be rendered.\n\t */\n\tfallback?: React.ReactNode;\n\n\tloader?: ImageProps[\"loader\"] | null;\n};\n\n/**\n * React component that renders an image from a Prismic Image field or one of\n * its thumbnails using `next/image`. It will automatically set the `alt`\n * attribute using the Image field's `alt` property.\n *\n * It uses an Imgix URL-based loader by default. A custom loader can be provided\n * with the `loader` prop. If you would like to use the Next.js Image\n * Optimization API instead, set `loader={undefined}`.\n *\n * @param props - Props for the component.\n *\n * @returns A responsive image component using `next/image` for the given Image\n * field.\n *\n * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image\n */\n// The type annotation is necessary to avoid a type reference issue.\nexport const PrismicNextImage: ForwardRefExoticComponent<\n\tPropsWithoutRef<PrismicNextImageProps> & RefAttributes<HTMLImageElement>\n> = forwardRef<HTMLImageElement, PrismicNextImageProps>(\n\tfunction PrismicNextImage(\n\t\t{\n\t\t\tfield,\n\t\t\timgixParams = {},\n\t\t\talt,\n\t\t\tfallbackAlt,\n\t\t\tfill,\n\t\t\twidth,\n\t\t\theight,\n\t\t\tfallback = null,\n\t\t\tloader = imgixLoader,\n\t\t\t...restProps\n\t\t},\n\t\tref,\n\t) {\n\t\tif (process.env.NODE_ENV === \"development\") {\n\t\t\tif (typeof alt === \"string\" && alt !== \"\") {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicNextImage] 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\t\"alt-must-be-an-empty-string\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (typeof fallbackAlt === \"string\" && fallbackAlt !== \"\") {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicNextImage] 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\t\"alt-must-be-an-empty-string\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!isFilled.imageThumbnail(field)) {\n\t\t\treturn <>{fallback}</>;\n\t\t}\n\n\t\tconst resolvedImgixParams = imgixParams;\n\t\tfor (const x in imgixParams) {\n\t\t\tif (resolvedImgixParams[x as keyof typeof resolvedImgixParams] === null) {\n\t\t\t\tresolvedImgixParams[x as keyof typeof resolvedImgixParams] = undefined;\n\t\t\t}\n\t\t}\n\n\t\tconst src = buildURL(field.url, imgixParams as ImgixURLParams);\n\n\t\tconst ar = field.dimensions.width / field.dimensions.height;\n\n\t\tconst castedWidth = castInt(width);\n\t\tconst castedHeight = castInt(height);\n\n\t\tlet resolvedWidth = castedWidth ?? field.dimensions.width;\n\t\tlet resolvedHeight = castedHeight ?? field.dimensions.height;\n\n\t\tif (castedWidth != null && castedHeight == null) {\n\t\t\tresolvedHeight = castedWidth / ar;\n\t\t} else if (castedWidth == null && castedHeight != null) {\n\t\t\tresolvedWidth = castedHeight * ar;\n\t\t}\n\n\t\t// A non-null assertion is required since we can't statically\n\t\t// know if an alt attribute is available.\n\t\tconst resolvedAlt = (alt ?? (field.alt || fallbackAlt))!;\n\n\t\tif (\n\t\t\tprocess.env.NODE_ENV === \"development\" &&\n\t\t\ttypeof resolvedAlt !== \"string\"\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[PrismicNextImage] The following image is missing an \"alt\" property. Please add Alternative Text to the image in Prismic. To mark the image as decorative instead, add one of \\`alt=\"\"\\` or \\`fallbackAlt=\"\"\\`.`,\n\t\t\t\tsrc,\n\t\t\t);\n\t\t}\n\n\t\tconst ResolvedImage = resolveDefaultExport(Image);\n\n\t\treturn (\n\t\t\t<ResolvedImage\n\t\t\t\tref={ref}\n\t\t\t\tsrc={src}\n\t\t\t\twidth={fill ? undefined : resolvedWidth}\n\t\t\t\theight={fill ? undefined : resolvedHeight}\n\t\t\t\talt={resolvedAlt}\n\t\t\t\tfill={fill}\n\t\t\t\tloader={loader === null ? undefined : loader}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,WAAW,UAA2D;AAC3E,KAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;MACD;EACN,MAAM,SAAS,OAAO,SAAS,MAAM;AAErC,MAAI,OAAO,MAAM,OAAO,CACvB;MAEA,QAAO;;;;;;;;;;;;;;;;;;;AA8DV,MAAa,mBAET,WACH,SAASA,mBACR,EACC,OACA,cAAc,EAAE,EAChB,KACA,aACA,MACA,OACA,QACA,WAAW,MACX,SAAS,aACT,GAAG,aAEJ,KACC;AACD,KAAI,QAAQ,IAAI,aAAa,eAAe;AAC3C,MAAI,OAAO,QAAQ,YAAY,QAAQ,GACtC,SAAQ,KACP,yQAAyQ,OACxQ,8BACA,GACD;AAGF,MAAI,OAAO,gBAAgB,YAAY,gBAAgB,GACtD,SAAQ,KACP,ySAAyS,OACxS,8BACA,GACD;;AAIH,KAAI,CAAC,SAAS,eAAe,MAAM,CAClC,QAAO,0CAAG,WAAY;CAGvB,MAAM,sBAAsB;AAC5B,MAAK,MAAM,KAAK,YACf,KAAI,oBAAoB,OAA2C,KAClE,qBAAoB,KAAyC;CAI/D,MAAM,MAAM,SAAS,MAAM,KAAK,YAA8B;CAE9D,MAAM,KAAK,MAAM,WAAW,QAAQ,MAAM,WAAW;CAErD,MAAM,cAAc,QAAQ,MAAM;CAClC,MAAM,eAAe,QAAQ,OAAO;CAEpC,IAAI,gBAAgB,eAAe,MAAM,WAAW;CACpD,IAAI,iBAAiB,gBAAgB,MAAM,WAAW;AAEtD,KAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;UACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;CAKhC,MAAM,cAAe,QAAQ,MAAM,OAAO;AAE1C,KACC,QAAQ,IAAI,aAAa,iBACzB,OAAO,gBAAgB,SAEvB,SAAQ,MACP,mNACA,IACA;AAKF,QACC,oBAHqB,qBAAqB,MAAM;EAI1C;EACA;EACL,OAAO,OAAO,SAAY;EAC1B,QAAQ,OAAO,SAAY;EAC3B,KAAK;EACC;EACN,QAAQ,WAAW,OAAO,SAAY;EACtC,GAAI;GACH;EAGJ"}
1
+ {"version":3,"file":"PrismicNextImage.js","names":[],"sources":["../src/PrismicNextImage.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ImageFieldImage } from \"@prismicio/client\"\nimport { isFilled } from \"@prismicio/client\"\nimport type { ImgixURLParams } from \"imgix-url-builder\"\nimport { buildURL } from \"imgix-url-builder\"\nimport type { ImageProps } from \"next/image\"\nimport Image from \"next/image\"\nimport type { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from \"react\"\nimport { forwardRef } from \"react\"\n\nimport { imgixLoader } from \"./imgixLoader\"\nimport { devMsg } from \"./lib/devMsg\"\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\"\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\nexport type PrismicNextImageProps = Omit<ImageProps, \"src\" | \"alt\" | \"loader\"> & {\n\t/** The Prismic Image field or thumbnail to render. */\n\tfield: 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?: { [P in keyof ImgixURLParams]: ImgixURLParams[P] | null }\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\"\n\n\t/**\n\t * Declare an image as decorative only if the Image field does not have alternative text by\n\t * providing `fallbackAlt=\"\"`.\n\t *\n\t * See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\"\n\n\t/** Rendered when the field is empty. If a fallback is not given, `null` will be rendered. */\n\tfallback?: React.ReactNode\n\n\tloader?: ImageProps[\"loader\"] | null\n}\n\n/**\n * React component that renders an image from a Prismic Image field or one of its thumbnails using\n * `next/image`. It will automatically set the `alt` attribute using the Image field's `alt`\n * property.\n *\n * It uses an Imgix URL-based loader by default. A custom loader can be provided with the `loader`\n * prop. If you would like to use the Next.js Image Optimization API instead, set\n * `loader={undefined}`.\n *\n * @param props - Props for the component.\n * @returns A responsive image component using `next/image` for the given Image\n * field.\n * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image\n */\n// The type annotation is necessary to avoid a type reference issue.\nexport const PrismicNextImage: ForwardRefExoticComponent<\n\tPropsWithoutRef<PrismicNextImageProps> & RefAttributes<HTMLImageElement>\n> = forwardRef<HTMLImageElement, PrismicNextImageProps>(function PrismicNextImage(\n\t{\n\t\tfield,\n\t\timgixParams = {},\n\t\talt,\n\t\tfallbackAlt,\n\t\tfill,\n\t\twidth,\n\t\theight,\n\t\tfallback = null,\n\t\tloader = imgixLoader,\n\t\t...restProps\n\t},\n\tref,\n) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (typeof alt === \"string\" && alt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicNextImage] 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`[PrismicNextImage] 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\t}\n\n\tif (!isFilled.imageThumbnail(field)) {\n\t\treturn <>{fallback}</>\n\t}\n\n\tconst resolvedImgixParams = imgixParams\n\tfor (const x in imgixParams) {\n\t\tif (resolvedImgixParams[x as keyof typeof resolvedImgixParams] === null) {\n\t\t\tresolvedImgixParams[x as keyof typeof resolvedImgixParams] = undefined\n\t\t}\n\t}\n\n\tconst src = buildURL(field.url, imgixParams as ImgixURLParams)\n\n\tconst ar = field.dimensions.width / field.dimensions.height\n\n\tconst castedWidth = castInt(width)\n\tconst castedHeight = castInt(height)\n\n\tlet resolvedWidth = castedWidth ?? field.dimensions.width\n\tlet resolvedHeight = castedHeight ?? 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\t// A non-null assertion is required since we can't statically\n\t// know if an alt attribute is available.\n\tconst resolvedAlt = (alt ?? (field.alt || fallbackAlt))!\n\n\tif (process.env.NODE_ENV === \"development\" && typeof resolvedAlt !== \"string\") {\n\t\tconsole.error(\n\t\t\t`[PrismicNextImage] The following image is missing an \"alt\" property. Please add Alternative Text to the image in Prismic. To mark the image as decorative instead, add one of \\`alt=\"\"\\` or \\`fallbackAlt=\"\"\\`.`,\n\t\t\tsrc,\n\t\t)\n\t}\n\n\tconst ResolvedImage = resolveDefaultExport(Image)\n\n\treturn (\n\t\t<ResolvedImage\n\t\t\tref={ref}\n\t\t\tsrc={src}\n\t\t\twidth={fill ? undefined : resolvedWidth}\n\t\t\theight={fill ? undefined : resolvedHeight}\n\t\t\talt={resolvedAlt}\n\t\t\tfill={fill}\n\t\t\tloader={loader === null ? undefined : loader}\n\t\t\t{...restProps}\n\t\t/>\n\t)\n})\n"],"mappings":";;;;;;;;;;AAeA,MAAM,WAAW,UAA2D;AAC3E,KAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;MACD;EACN,MAAM,SAAS,OAAO,SAAS,MAAM;AAErC,MAAI,OAAO,MAAM,OAAO,CACvB;MAEA,QAAO;;;;;;;;;;;;;;;;;AAoDV,MAAa,mBAET,WAAoD,SAAS,iBAChE,EACC,OACA,cAAc,EAAE,EAChB,KACA,aACA,MACA,OACA,QACA,WAAW,MACX,SAAS,aACT,GAAG,aAEJ,KACC;AACD,KAAI,QAAQ,IAAI,aAAa,eAAe;AAC3C,MAAI,OAAO,QAAQ,YAAY,QAAQ,GACtC,SAAQ,KACP,yQAAyQ,OACxQ,8BACA,GACD;AAGF,MAAI,OAAO,gBAAgB,YAAY,gBAAgB,GACtD,SAAQ,KACP,ySAAyS,OACxS,8BACA,GACD;;AAIH,KAAI,CAAC,SAAS,eAAe,MAAM,CAClC,QAAO,oBAAA,UAAA,EAAA,UAAG,UAAY,CAAA;CAGvB,MAAM,sBAAsB;AAC5B,MAAK,MAAM,KAAK,YACf,KAAI,oBAAoB,OAA2C,KAClE,qBAAoB,KAAyC,KAAA;CAI/D,MAAM,MAAM,SAAS,MAAM,KAAK,YAA8B;CAE9D,MAAM,KAAK,MAAM,WAAW,QAAQ,MAAM,WAAW;CAErD,MAAM,cAAc,QAAQ,MAAM;CAClC,MAAM,eAAe,QAAQ,OAAO;CAEpC,IAAI,gBAAgB,eAAe,MAAM,WAAW;CACpD,IAAI,iBAAiB,gBAAgB,MAAM,WAAW;AAEtD,KAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;UACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;CAKhC,MAAM,cAAe,QAAQ,MAAM,OAAO;AAE1C,KAAI,QAAQ,IAAI,aAAa,iBAAiB,OAAO,gBAAgB,SACpE,SAAQ,MACP,mNACA,IACA;AAKF,QACC,oBAHqB,qBAAqB,MAAM,EAGhD;EACM;EACA;EACL,OAAO,OAAO,KAAA,IAAY;EAC1B,QAAQ,OAAO,KAAA,IAAY;EAC3B,KAAK;EACC;EACN,QAAQ,WAAW,OAAO,KAAA,IAAY;EACtC,GAAI;EACH,CAAA;EAEF"}
@@ -1,13 +1,12 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
- const require_resolveDefaultExport = require('./lib/resolveDefaultExport.cjs');
1
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
+ const require_resolveDefaultExport = require("./lib/resolveDefaultExport.cjs");
3
3
  let _prismicio_client = require("@prismicio/client");
4
4
  let react = require("react");
5
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
- let next_link = require("next/link");
7
- next_link = require_rolldown_runtime.__toESM(next_link);
8
-
6
+ let next_link_js = require("next/link.js");
7
+ next_link_js = require_runtime.__toESM(next_link_js);
9
8
  //#region src/PrismicNextLink.tsx
10
- const PrismicNextLink = (0, react.forwardRef)(function PrismicNextLink$1(props, ref) {
9
+ const PrismicNextLink = (0, react.forwardRef)(function PrismicNextLink(props, ref) {
11
10
  const { field, document, linkResolver, children, ...restProps } = props;
12
11
  const { href: computedHref, rel: computedRel, ...attrs } = (0, _prismicio_client.asLinkAttrs)(field ?? document, {
13
12
  linkResolver,
@@ -16,7 +15,7 @@ const PrismicNextLink = (0, react.forwardRef)(function PrismicNextLink$1(props,
16
15
  const href = ("href" in restProps ? restProps.href : computedHref) || "";
17
16
  let rel = computedRel;
18
17
  if ("rel" in restProps && typeof restProps.rel !== "function") rel = restProps.rel;
19
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_resolveDefaultExport.resolveDefaultExport(next_link.default), {
18
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_resolveDefaultExport.resolveDefaultExport(next_link_js.default), {
20
19
  ref,
21
20
  ...attrs,
22
21
  ...restProps,
@@ -25,7 +24,7 @@ const PrismicNextLink = (0, react.forwardRef)(function PrismicNextLink$1(props,
25
24
  children: "children" in props ? children : field?.text
26
25
  });
27
26
  });
28
-
29
27
  //#endregion
30
28
  exports.PrismicNextLink = PrismicNextLink;
29
+
31
30
  //# sourceMappingURL=PrismicNextLink.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicNextLink.cjs","names":["PrismicNextLink","resolveDefaultExport","Link"],"sources":["../src/PrismicNextLink.tsx"],"sourcesContent":["import type { ComponentProps} from \"react\";\nimport { forwardRef } from \"react\";\nimport Link from \"next/link\";\nimport type {\n\tAsLinkAttrsConfig,\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument} from \"@prismicio/client\";\nimport {\n\tasLinkAttrs,\n} from \"@prismicio/client\";\n\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\";\n\nexport type PrismicNextLinkProps = Omit<\n\tComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: LinkResolverFunction;\n\trel?: string | AsLinkAttrsConfig[\"rel\"];\n} & (\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t\t\thref?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never;\n\t\t\t\tdocument: PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never;\n\t\t\t\tdocument?: never;\n\t\t\t\thref: ComponentProps<typeof Link>[\"href\"];\n\t\t }\n\t);\n\nexport const PrismicNextLink = forwardRef<\n\tHTMLAnchorElement,\n\tPrismicNextLinkProps\n>(function PrismicNextLink(props, ref) {\n\tconst { field, document, linkResolver, children, ...restProps } = props;\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = asLinkAttrs(field ?? document, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\tlet rel = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst ResolvedLink = resolveDefaultExport(Link);\n\n\treturn (\n\t\t<ResolvedLink ref={ref} {...attrs} {...restProps} href={href} rel={rel}>\n\t\t\t{\"children\" in props ? children : field?.text}\n\t\t</ResolvedLink>\n\t);\n});\n"],"mappings":";;;;;;;;;AAsCA,MAAa,wCAGX,SAASA,kBAAgB,OAAO,KAAK;CACtC,MAAM,EAAE,OAAO,UAAU,cAAc,UAAU,GAAG,cAAc;CAClE,MAAM,EACL,MAAM,cACN,KAAK,aACL,GAAG,6CACY,SAAS,UAAU;EAClC;EACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM;EAC3D,CAAC;CAEF,MAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;CAEtE,IAAI,MAAM;AACV,KAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,WAClD,OAAM,UAAU;AAKjB,QACC,2CAHoBC,kDAAqBC,kBAAK;EAG3B;EAAK,GAAI;EAAO,GAAI;EAAiB;EAAW;YACjE,cAAc,QAAQ,WAAW,OAAO;GAC3B;EAEf"}
1
+ {"version":3,"file":"PrismicNextLink.cjs","names":["resolveDefaultExport","Link"],"sources":["../src/PrismicNextLink.tsx"],"sourcesContent":["import type {\n\tAsLinkAttrsConfig,\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument,\n} from \"@prismicio/client\"\nimport { asLinkAttrs } from \"@prismicio/client\"\nimport Link from \"next/link\"\nimport type { ComponentProps } from \"react\"\nimport { forwardRef } from \"react\"\n\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\"\n\nexport type PrismicNextLinkProps = Omit<\n\tComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: LinkResolverFunction\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n} & (\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined\n\t\t\t\tdocument?: never\n\t\t\t\thref?: never\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never\n\t\t\t\tdocument: PrismicDocument | null | undefined\n\t\t\t\thref?: never\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never\n\t\t\t\tdocument?: never\n\t\t\t\thref: ComponentProps<typeof Link>[\"href\"]\n\t\t }\n\t)\n\nexport const PrismicNextLink = forwardRef<HTMLAnchorElement, PrismicNextLinkProps>(\n\tfunction PrismicNextLink(props, ref) {\n\t\tconst { field, document, linkResolver, children, ...restProps } = props\n\t\tconst {\n\t\t\thref: computedHref,\n\t\t\trel: computedRel,\n\t\t\t...attrs\n\t\t} = asLinkAttrs(field ?? document, {\n\t\t\tlinkResolver,\n\t\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t\t})\n\n\t\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\"\n\n\t\tlet rel = computedRel\n\t\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\t\trel = restProps.rel\n\t\t}\n\n\t\tconst ResolvedLink = resolveDefaultExport(Link)\n\n\t\treturn (\n\t\t\t<ResolvedLink ref={ref} {...attrs} {...restProps} href={href} rel={rel}>\n\t\t\t\t{\"children\" in props ? children : field?.text}\n\t\t\t</ResolvedLink>\n\t\t)\n\t},\n)\n"],"mappings":";;;;;;;;AAqCA,MAAa,mBAAA,GAAA,MAAA,YACZ,SAAS,gBAAgB,OAAO,KAAK;CACpC,MAAM,EAAE,OAAO,UAAU,cAAc,UAAU,GAAG,cAAc;CAClE,MAAM,EACL,MAAM,cACN,KAAK,aACL,GAAG,WAAA,GAAA,kBAAA,aACY,SAAS,UAAU;EAClC;EACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM,KAAA;EAC3D,CAAC;CAEF,MAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;CAEtE,IAAI,MAAM;AACV,KAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,WAClD,OAAM,UAAU;AAKjB,QACC,iBAAA,GAAA,kBAAA,KAHoBA,6BAAAA,qBAAqBC,aAAAA,QAAK,EAG9C;EAAmB;EAAK,GAAI;EAAO,GAAI;EAAiB;EAAW;YACjE,cAAc,QAAQ,WAAW,OAAO;EAC3B,CAAA;EAGjB"}
@@ -1,7 +1,7 @@
1
- import * as react0 from "react";
1
+ import * as _$react from "react";
2
2
  import { ComponentProps } from "react";
3
- import * as next_link0 from "next/link";
4
- import Link from "next/link";
3
+ import * as _$next_link0 from "next/link.js";
4
+ import Link from "next/link.js";
5
5
  import { AsLinkAttrsConfig, LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client";
6
6
 
7
7
  //#region src/PrismicNextLink.d.ts
@@ -21,34 +21,34 @@ type PrismicNextLinkProps = Omit<ComponentProps<typeof Link>, "field" | "documen
21
21
  document?: never;
22
22
  href: ComponentProps<typeof Link>["href"];
23
23
  });
24
- declare const PrismicNextLink: react0.ForwardRefExoticComponent<(Omit<Omit<Omit<react0.AnchorHTMLAttributes<HTMLAnchorElement>, keyof next_link0.LinkProps<any>> & next_link0.LinkProps<any> & {
24
+ declare const PrismicNextLink: _$react.ForwardRefExoticComponent<(Omit<Omit<Omit<_$react.AnchorHTMLAttributes<HTMLAnchorElement>, keyof _$next_link0.LinkProps<any>> & _$next_link0.LinkProps<any> & {
25
25
  children?: React.ReactNode | undefined;
26
- } & react0.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
26
+ } & _$react.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
27
27
  linkResolver?: LinkResolverFunction;
28
28
  rel?: string | AsLinkAttrsConfig["rel"];
29
29
  } & {
30
30
  field: LinkField | null | undefined;
31
31
  document?: never;
32
32
  href?: never;
33
- }, "ref"> | Omit<Omit<Omit<react0.AnchorHTMLAttributes<HTMLAnchorElement>, keyof next_link0.LinkProps<any>> & next_link0.LinkProps<any> & {
33
+ }, "ref"> | Omit<Omit<Omit<_$react.AnchorHTMLAttributes<HTMLAnchorElement>, keyof _$next_link0.LinkProps<any>> & _$next_link0.LinkProps<any> & {
34
34
  children?: React.ReactNode | undefined;
35
- } & react0.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
35
+ } & _$react.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
36
36
  linkResolver?: LinkResolverFunction;
37
37
  rel?: string | AsLinkAttrsConfig["rel"];
38
38
  } & {
39
39
  field?: never;
40
40
  document: PrismicDocument | null | undefined;
41
41
  href?: never;
42
- }, "ref"> | Omit<Omit<Omit<react0.AnchorHTMLAttributes<HTMLAnchorElement>, keyof next_link0.LinkProps<any>> & next_link0.LinkProps<any> & {
42
+ }, "ref"> | Omit<Omit<Omit<_$react.AnchorHTMLAttributes<HTMLAnchorElement>, keyof _$next_link0.LinkProps<any>> & _$next_link0.LinkProps<any> & {
43
43
  children?: React.ReactNode | undefined;
44
- } & react0.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
44
+ } & _$react.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
45
45
  linkResolver?: LinkResolverFunction;
46
46
  rel?: string | AsLinkAttrsConfig["rel"];
47
47
  } & {
48
48
  field?: never;
49
49
  document?: never;
50
50
  href: ComponentProps<typeof Link>["href"];
51
- }, "ref">) & react0.RefAttributes<HTMLAnchorElement>>;
51
+ }, "ref">) & _$react.RefAttributes<HTMLAnchorElement>>;
52
52
  //#endregion
53
53
  export { PrismicNextLink, PrismicNextLinkProps };
54
54
  //# sourceMappingURL=PrismicNextLink.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrismicNextLink.d.cts","names":[],"sources":["../src/PrismicNextLink.tsx"],"mappings":";;;;;;;KAaY,oBAAA,GAAuB,IAAA,CAClC,cAAA,QAAsB,IAAA;EAGtB,YAAA,GAAe,oBAAA;EACf,GAAA,YAAe,iBAAA;AAAA;EAGZ,KAAA,EAAO,SAAA;EACP,QAAA;EACA,IAAA;AAAA;EAGA,KAAA;EACA,QAAA,EAAU,eAAA;EACV,IAAA;AAAA;EAGA,KAAA;EACA,QAAA;EACA,IAAA,EAAM,cAAA,QAAsB,IAAA;AAAA;AAAA,cAInB,eAAA,UAAe,yBAAA,EAAA,IAAA,CAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,iBAAA,SAAA,YAAA,CAAA,SAAA,SAAA,YAAA,CAAA,SAAA;;;iBApBZ,oBAAA;iBACA,iBAAA;AAAA;SAGL,SAAA;;;;;;iBAJK,oBAAA;iBACA,iBAAA;AAAA;;YASF,eAAA;;;;;iBAVE,oBAAA;iBACA,iBAAA;AAAA;;;QAeN,cAAA,QAAsB,IAAA;AAAA"}
@@ -1,8 +1,8 @@
1
1
  import { AsLinkAttrsConfig, LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client";
2
- import * as react0 from "react";
2
+ import * as _$react from "react";
3
3
  import { ComponentProps } from "react";
4
- import * as next_link0 from "next/link";
5
- import Link from "next/link";
4
+ import * as _$next_link0 from "next/link.js";
5
+ import Link from "next/link.js";
6
6
 
7
7
  //#region src/PrismicNextLink.d.ts
8
8
  type PrismicNextLinkProps = Omit<ComponentProps<typeof Link>, "field" | "document" | "href" | "rel"> & {
@@ -21,34 +21,34 @@ type PrismicNextLinkProps = Omit<ComponentProps<typeof Link>, "field" | "documen
21
21
  document?: never;
22
22
  href: ComponentProps<typeof Link>["href"];
23
23
  });
24
- declare const PrismicNextLink: react0.ForwardRefExoticComponent<(Omit<Omit<Omit<react0.AnchorHTMLAttributes<HTMLAnchorElement>, keyof next_link0.LinkProps<any>> & next_link0.LinkProps<any> & {
24
+ declare const PrismicNextLink: _$react.ForwardRefExoticComponent<(Omit<Omit<Omit<_$react.AnchorHTMLAttributes<HTMLAnchorElement>, keyof _$next_link0.LinkProps<any>> & _$next_link0.LinkProps<any> & {
25
25
  children?: React.ReactNode | undefined;
26
- } & react0.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
26
+ } & _$react.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
27
27
  linkResolver?: LinkResolverFunction;
28
28
  rel?: string | AsLinkAttrsConfig["rel"];
29
29
  } & {
30
30
  field: LinkField | null | undefined;
31
31
  document?: never;
32
32
  href?: never;
33
- }, "ref"> | Omit<Omit<Omit<react0.AnchorHTMLAttributes<HTMLAnchorElement>, keyof next_link0.LinkProps<any>> & next_link0.LinkProps<any> & {
33
+ }, "ref"> | Omit<Omit<Omit<_$react.AnchorHTMLAttributes<HTMLAnchorElement>, keyof _$next_link0.LinkProps<any>> & _$next_link0.LinkProps<any> & {
34
34
  children?: React.ReactNode | undefined;
35
- } & react0.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
35
+ } & _$react.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
36
36
  linkResolver?: LinkResolverFunction;
37
37
  rel?: string | AsLinkAttrsConfig["rel"];
38
38
  } & {
39
39
  field?: never;
40
40
  document: PrismicDocument | null | undefined;
41
41
  href?: never;
42
- }, "ref"> | Omit<Omit<Omit<react0.AnchorHTMLAttributes<HTMLAnchorElement>, keyof next_link0.LinkProps<any>> & next_link0.LinkProps<any> & {
42
+ }, "ref"> | Omit<Omit<Omit<_$react.AnchorHTMLAttributes<HTMLAnchorElement>, keyof _$next_link0.LinkProps<any>> & _$next_link0.LinkProps<any> & {
43
43
  children?: React.ReactNode | undefined;
44
- } & react0.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
44
+ } & _$react.RefAttributes<HTMLAnchorElement>, "href" | "rel" | "field" | "document"> & {
45
45
  linkResolver?: LinkResolverFunction;
46
46
  rel?: string | AsLinkAttrsConfig["rel"];
47
47
  } & {
48
48
  field?: never;
49
49
  document?: never;
50
50
  href: ComponentProps<typeof Link>["href"];
51
- }, "ref">) & react0.RefAttributes<HTMLAnchorElement>>;
51
+ }, "ref">) & _$react.RefAttributes<HTMLAnchorElement>>;
52
52
  //#endregion
53
53
  export { PrismicNextLink, PrismicNextLinkProps };
54
54
  //# sourceMappingURL=PrismicNextLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrismicNextLink.d.ts","names":[],"sources":["../src/PrismicNextLink.tsx"],"mappings":";;;;;;;KAaY,oBAAA,GAAuB,IAAA,CAClC,cAAA,QAAsB,IAAA;EAGtB,YAAA,GAAe,oBAAA;EACf,GAAA,YAAe,iBAAA;AAAA;EAGZ,KAAA,EAAO,SAAA;EACP,QAAA;EACA,IAAA;AAAA;EAGA,KAAA;EACA,QAAA,EAAU,eAAA;EACV,IAAA;AAAA;EAGA,KAAA;EACA,QAAA;EACA,IAAA,EAAM,cAAA,QAAsB,IAAA;AAAA;AAAA,cAInB,eAAA,UAAe,yBAAA,EAAA,IAAA,CAAA,IAAA,CAAA,IAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,iBAAA,SAAA,YAAA,CAAA,SAAA,SAAA,YAAA,CAAA,SAAA;;;iBApBZ,oBAAA;iBACA,iBAAA;AAAA;SAGL,SAAA;;;;;;iBAJK,oBAAA;iBACA,iBAAA;AAAA;;YASF,eAAA;;;;;iBAVE,oBAAA;iBACA,iBAAA;AAAA;;;QAeN,cAAA,QAAsB,IAAA;AAAA"}
@@ -2,10 +2,9 @@ import { resolveDefaultExport } from "./lib/resolveDefaultExport.js";
2
2
  import { asLinkAttrs } from "@prismicio/client";
3
3
  import { forwardRef } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import Link from "next/link";
6
-
5
+ import Link from "next/link.js";
7
6
  //#region src/PrismicNextLink.tsx
8
- const PrismicNextLink = forwardRef(function PrismicNextLink$1(props, ref) {
7
+ const PrismicNextLink = forwardRef(function PrismicNextLink(props, ref) {
9
8
  const { field, document, linkResolver, children, ...restProps } = props;
10
9
  const { href: computedHref, rel: computedRel, ...attrs } = asLinkAttrs(field ?? document, {
11
10
  linkResolver,
@@ -23,7 +22,7 @@ const PrismicNextLink = forwardRef(function PrismicNextLink$1(props, ref) {
23
22
  children: "children" in props ? children : field?.text
24
23
  });
25
24
  });
26
-
27
25
  //#endregion
28
26
  export { PrismicNextLink };
27
+
29
28
  //# sourceMappingURL=PrismicNextLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicNextLink.js","names":["PrismicNextLink"],"sources":["../src/PrismicNextLink.tsx"],"sourcesContent":["import type { ComponentProps} from \"react\";\nimport { forwardRef } from \"react\";\nimport Link from \"next/link\";\nimport type {\n\tAsLinkAttrsConfig,\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument} from \"@prismicio/client\";\nimport {\n\tasLinkAttrs,\n} from \"@prismicio/client\";\n\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\";\n\nexport type PrismicNextLinkProps = Omit<\n\tComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: LinkResolverFunction;\n\trel?: string | AsLinkAttrsConfig[\"rel\"];\n} & (\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t\t\thref?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never;\n\t\t\t\tdocument: PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never;\n\t\t\t\tdocument?: never;\n\t\t\t\thref: ComponentProps<typeof Link>[\"href\"];\n\t\t }\n\t);\n\nexport const PrismicNextLink = forwardRef<\n\tHTMLAnchorElement,\n\tPrismicNextLinkProps\n>(function PrismicNextLink(props, ref) {\n\tconst { field, document, linkResolver, children, ...restProps } = props;\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = asLinkAttrs(field ?? document, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\tlet rel = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst ResolvedLink = resolveDefaultExport(Link);\n\n\treturn (\n\t\t<ResolvedLink ref={ref} {...attrs} {...restProps} href={href} rel={rel}>\n\t\t\t{\"children\" in props ? children : field?.text}\n\t\t</ResolvedLink>\n\t);\n});\n"],"mappings":";;;;;;;AAsCA,MAAa,kBAAkB,WAG7B,SAASA,kBAAgB,OAAO,KAAK;CACtC,MAAM,EAAE,OAAO,UAAU,cAAc,UAAU,GAAG,cAAc;CAClE,MAAM,EACL,MAAM,cACN,KAAK,aACL,GAAG,UACA,YAAY,SAAS,UAAU;EAClC;EACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM;EAC3D,CAAC;CAEF,MAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;CAEtE,IAAI,MAAM;AACV,KAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,WAClD,OAAM,UAAU;AAKjB,QACC,oBAHoB,qBAAqB,KAAK;EAG3B;EAAK,GAAI;EAAO,GAAI;EAAiB;EAAW;YACjE,cAAc,QAAQ,WAAW,OAAO;GAC3B;EAEf"}
1
+ {"version":3,"file":"PrismicNextLink.js","names":[],"sources":["../src/PrismicNextLink.tsx"],"sourcesContent":["import type {\n\tAsLinkAttrsConfig,\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument,\n} from \"@prismicio/client\"\nimport { asLinkAttrs } from \"@prismicio/client\"\nimport Link from \"next/link\"\nimport type { ComponentProps } from \"react\"\nimport { forwardRef } from \"react\"\n\nimport { resolveDefaultExport } from \"./lib/resolveDefaultExport\"\n\nexport type PrismicNextLinkProps = Omit<\n\tComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: LinkResolverFunction\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n} & (\n\t\t| {\n\t\t\t\tfield: LinkField | null | undefined\n\t\t\t\tdocument?: never\n\t\t\t\thref?: never\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never\n\t\t\t\tdocument: PrismicDocument | null | undefined\n\t\t\t\thref?: never\n\t\t }\n\t\t| {\n\t\t\t\tfield?: never\n\t\t\t\tdocument?: never\n\t\t\t\thref: ComponentProps<typeof Link>[\"href\"]\n\t\t }\n\t)\n\nexport const PrismicNextLink = forwardRef<HTMLAnchorElement, PrismicNextLinkProps>(\n\tfunction PrismicNextLink(props, ref) {\n\t\tconst { field, document, linkResolver, children, ...restProps } = props\n\t\tconst {\n\t\t\thref: computedHref,\n\t\t\trel: computedRel,\n\t\t\t...attrs\n\t\t} = asLinkAttrs(field ?? document, {\n\t\t\tlinkResolver,\n\t\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t\t})\n\n\t\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\"\n\n\t\tlet rel = computedRel\n\t\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\t\trel = restProps.rel\n\t\t}\n\n\t\tconst ResolvedLink = resolveDefaultExport(Link)\n\n\t\treturn (\n\t\t\t<ResolvedLink ref={ref} {...attrs} {...restProps} href={href} rel={rel}>\n\t\t\t\t{\"children\" in props ? children : field?.text}\n\t\t\t</ResolvedLink>\n\t\t)\n\t},\n)\n"],"mappings":";;;;;;AAqCA,MAAa,kBAAkB,WAC9B,SAAS,gBAAgB,OAAO,KAAK;CACpC,MAAM,EAAE,OAAO,UAAU,cAAc,UAAU,GAAG,cAAc;CAClE,MAAM,EACL,MAAM,cACN,KAAK,aACL,GAAG,UACA,YAAY,SAAS,UAAU;EAClC;EACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM,KAAA;EAC3D,CAAC;CAEF,MAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;CAEtE,IAAI,MAAM;AACV,KAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,WAClD,OAAM,UAAU;AAKjB,QACC,oBAHoB,qBAAqB,KAAK,EAG9C;EAAmB;EAAK,GAAI;EAAO,GAAI;EAAiB;EAAW;YACjE,cAAc,QAAQ,WAAW,OAAO;EAC3B,CAAA;EAGjB"}