@prismicio/next 1.1.0-alpha.0 → 1.1.0-alpha.1

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 (53) hide show
  1. package/dist/PrismicNextImage.cjs +2 -19
  2. package/dist/PrismicNextImage.cjs.map +1 -1
  3. package/dist/PrismicNextImage.js +2 -2
  4. package/dist/PrismicNextLink.cjs +3 -4
  5. package/dist/PrismicNextLink.cjs.map +1 -1
  6. package/dist/PrismicNextLink.d.ts +13 -13
  7. package/dist/PrismicNextLink.js +3 -3
  8. package/dist/PrismicNextLink.js.map +1 -1
  9. package/dist/_node_modules/@prismicio/client/dist/cookie.cjs +5 -0
  10. package/dist/_node_modules/@prismicio/client/dist/cookie.cjs.map +1 -0
  11. package/dist/_node_modules/@prismicio/client/dist/cookie.js +5 -0
  12. package/dist/_node_modules/@prismicio/client/dist/cookie.js.map +1 -0
  13. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs +38 -0
  14. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.cjs.map +1 -0
  15. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js +38 -0
  16. package/dist/_node_modules/@prismicio/client/dist/helpers/asLink.js.map +1 -0
  17. package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.cjs +28 -0
  18. package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.cjs.map +1 -0
  19. package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js +28 -0
  20. package/dist/_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js.map +1 -0
  21. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs +26 -0
  22. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.cjs.map +1 -0
  23. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js +26 -0
  24. package/dist/_node_modules/@prismicio/client/dist/helpers/documentToLinkField.js.map +1 -0
  25. package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.cjs +14 -0
  26. package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.cjs.map +1 -0
  27. package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.js +14 -0
  28. package/dist/_node_modules/@prismicio/client/dist/helpers/isFilled.js.map +1 -0
  29. package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.cjs +9 -0
  30. package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.cjs.map +1 -0
  31. package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.js +9 -0
  32. package/dist/_node_modules/@prismicio/client/dist/lib/isInternalURL.js.map +1 -0
  33. package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs +10 -0
  34. package/dist/_node_modules/@prismicio/client/dist/types/value/link.cjs.map +1 -0
  35. package/dist/_node_modules/@prismicio/client/dist/types/value/link.js +10 -0
  36. package/dist/_node_modules/@prismicio/client/dist/types/value/link.js.map +1 -0
  37. package/dist/lib/getPrismicPreviewCookie.cjs +4 -21
  38. package/dist/lib/getPrismicPreviewCookie.cjs.map +1 -1
  39. package/dist/lib/getPrismicPreviewCookie.js +2 -2
  40. package/dist/lib/getPrismicPreviewCookie.js.map +1 -1
  41. package/dist/package.json.cjs +1 -1
  42. package/dist/package.json.js +1 -1
  43. package/dist/react-server/unsupported.cjs +6 -6
  44. package/dist/react-server/unsupported.cjs.map +1 -1
  45. package/dist/react-server/unsupported.js +6 -6
  46. package/dist/react-server/unsupported.js.map +1 -1
  47. package/dist/setPreviewData.cjs +2 -19
  48. package/dist/setPreviewData.cjs.map +1 -1
  49. package/dist/setPreviewData.js +2 -2
  50. package/dist/setPreviewData.js.map +1 -1
  51. package/package.json +2 -2
  52. package/src/PrismicNextLink.tsx +10 -10
  53. package/src/react-server/unsupported.ts +6 -6
@@ -5,27 +5,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
5
  const jsxRuntime = require("react/jsx-runtime");
6
6
  const Image = require("next/image");
7
7
  const imgixUrlBuilder = require("imgix-url-builder");
8
- const prismic = require("@prismicio/client");
9
8
  const __PRODUCTION__ = require("./lib/__PRODUCTION__.cjs");
10
9
  const devMsg = require("./lib/devMsg.cjs");
11
10
  const imgixLoader = require("./imgixLoader.cjs");
12
- function _interopNamespaceDefault(e) {
13
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
14
- if (e) {
15
- for (const k in e) {
16
- if (k !== "default") {
17
- const d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: () => e[k]
21
- });
22
- }
23
- }
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
- const prismic__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismic);
11
+ const isFilled = require('./_node_modules/@prismicio/client/dist/helpers/isFilled.cjs');
29
12
  const castInt = (input) => {
30
13
  if (typeof input === "number" || typeof input === "undefined") {
31
14
  return input;
@@ -47,7 +30,7 @@ const PrismicNextImage = ({ field, imgixParams = {}, alt, fallbackAlt, fill, wid
47
30
  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.devMsg("alt-must-be-an-empty-string")}`);
48
31
  }
49
32
  }
50
- if (prismic__namespace.isFilled.imageThumbnail(field)) {
33
+ if (isFilled.imageThumbnail(field)) {
51
34
  const src = imgixUrlBuilder.buildURL(field.url, imgixParams);
52
35
  const ar = field.dimensions.width / field.dimensions.height;
53
36
  const castedWidth = castInt(width);
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicNextImage.cjs","sources":["../../src/PrismicNextImage.tsx"],"sourcesContent":["\"use client\";\n\nimport Image, { ImageProps } from \"next/image\";\nimport { buildURL, ImgixURLParams } from \"imgix-url-builder\";\nimport * as prismic from \"@prismicio/client\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { devMsg } from \"./lib/devMsg\";\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<ImageProps, \"src\" | \"alt\"> & {\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?: ImgixURLParams;\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\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 * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image\n */\nexport const PrismicNextImage = ({\n\tfield,\n\timgixParams = {},\n\talt,\n\tfallbackAlt,\n\tfill,\n\twidth,\n\theight,\n\tfallback = null,\n\t...restProps\n}: PrismicNextImageProps): JSX.Element => {\n\tif (!__PRODUCTION__) {\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 (prismic.isFilled.imageThumbnail(field)) {\n\t\tconst src = buildURL(field.url, imgixParams);\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\treturn (\n\t\t\t<Image\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\t// A non-null assertion is required since we\n\t\t\t\t// can't statically know if an alt attribute is\n\t\t\t\t// available.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\talt={(alt ?? (field.alt || fallbackAlt))!}\n\t\t\t\tfill={fill}\n\t\t\t\tloader={imgixLoader}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn <>{fallback}</>;\n\t}\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA;AACC;AACQ;AAAA;AAED;AAEF;AACI;AAAA;AAEA;AAAA;AACP;AAEH;AAsDO;AAWN;AACC;AACC;AAGI;AAIL;AACC;AAGI;AAEJ;AAGF;AACC;AAEA;AAEM;AACA;AAEF;AACA;AAEA;AACH;AAA+B;AAE/B;AAA+B;AAGhC;AACO;AACL;AAC0B;AACC;AAAA;AAAA;AAAA;AAAA;AAKA;AAC3B;AACQ;AACJ;AACH;AAGH;AAAkB;AAEpB;;"}
1
+ {"version":3,"file":"PrismicNextImage.cjs","sources":["../../src/PrismicNextImage.tsx"],"sourcesContent":["\"use client\";\n\nimport Image, { ImageProps } from \"next/image\";\nimport { buildURL, ImgixURLParams } from \"imgix-url-builder\";\nimport * as prismic from \"@prismicio/client\";\n\nimport { __PRODUCTION__ } from \"./lib/__PRODUCTION__\";\nimport { devMsg } from \"./lib/devMsg\";\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<ImageProps, \"src\" | \"alt\"> & {\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?: ImgixURLParams;\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\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 * @see To learn more about `next/image`, see: https://nextjs.org/docs/api-reference/next/image\n */\nexport const PrismicNextImage = ({\n\tfield,\n\timgixParams = {},\n\talt,\n\tfallbackAlt,\n\tfill,\n\twidth,\n\theight,\n\tfallback = null,\n\t...restProps\n}: PrismicNextImageProps): JSX.Element => {\n\tif (!__PRODUCTION__) {\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 (prismic.isFilled.imageThumbnail(field)) {\n\t\tconst src = buildURL(field.url, imgixParams);\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\treturn (\n\t\t\t<Image\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\t// A non-null assertion is required since we\n\t\t\t\t// can't statically know if an alt attribute is\n\t\t\t\t// available.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\talt={(alt ?? (field.alt || fallbackAlt))!}\n\t\t\t\tfill={fill}\n\t\t\t\tloader={imgixLoader}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn <>{fallback}</>;\n\t}\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAWA;AACC;AACQ;AAAA;AAED;AAEF;AACI;AAAA;AAEA;AAAA;AACP;AAEH;AAsDO;AAWN;AACC;AACC;AAGI;AAIL;AACC;AAGI;AAEJ;AAGF;AACC;AAEA;AAEM;AACA;AAEF;AACA;AAEA;AACH;AAA+B;AAE/B;AAA+B;AAGhC;AACO;AACL;AAC0B;AACC;AAAA;AAAA;AAAA;AAAA;AAKA;AAC3B;AACQ;AACJ;AACH;AAGH;AAAkB;AAEpB;;"}
@@ -3,10 +3,10 @@
3
3
  import { jsx, Fragment } from "react/jsx-runtime";
4
4
  import Image from "next/image";
5
5
  import { buildURL } from "imgix-url-builder";
6
- import * as prismic from "@prismicio/client";
7
6
  import { __PRODUCTION__ } from "./lib/__PRODUCTION__.js";
8
7
  import { devMsg } from "./lib/devMsg.js";
9
8
  import { imgixLoader } from "./imgixLoader.js";
9
+ import { imageThumbnail } from './_node_modules/@prismicio/client/dist/helpers/isFilled.js';
10
10
  const castInt = (input) => {
11
11
  if (typeof input === "number" || typeof input === "undefined") {
12
12
  return input;
@@ -28,7 +28,7 @@ const PrismicNextImage = ({ field, imgixParams = {}, alt, fallbackAlt, fill, wid
28
28
  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")}`);
29
29
  }
30
30
  }
31
- if (prismic.isFilled.imageThumbnail(field)) {
31
+ if (imageThumbnail(field)) {
32
32
  const src = buildURL(field.url, imgixParams);
33
33
  const ar = field.dimensions.width / field.dimensions.height;
34
34
  const castedWidth = castInt(width);
@@ -4,8 +4,8 @@
4
4
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
5
5
  const jsxRuntime = require("react/jsx-runtime");
6
6
  const React = require("react");
7
- const prismic = require("@prismicio/client");
8
7
  const Link = require("next/link");
8
+ const asLinkAttrs = require('./_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.cjs');
9
9
  function _interopNamespaceDefault(e) {
10
10
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
11
11
  if (e) {
@@ -23,17 +23,16 @@ function _interopNamespaceDefault(e) {
23
23
  return Object.freeze(n);
24
24
  }
25
25
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
26
- const prismic__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismic);
27
26
  const PrismicNextLink = React__namespace.forwardRef(function PrismicNextLink2({ field, document, linkResolver, ...restProps }, ref) {
28
- const { href: computedHref, rel: computedRel, ...attrs } = prismic__namespace.asLinkAttrs(field ?? document, {
27
+ const { href: computedHref, rel: computedRel, ...attrs } = asLinkAttrs.asLinkAttrs(field ?? document, {
29
28
  linkResolver,
30
29
  rel: typeof restProps.rel === "function" ? restProps.rel : void 0
31
30
  });
31
+ const href = ("href" in restProps ? restProps.href : computedHref) || "";
32
32
  let rel = computedRel;
33
33
  if ("rel" in restProps && typeof restProps.rel !== "function") {
34
34
  rel = restProps.rel;
35
35
  }
36
- const href = ("href" in restProps ? restProps.href : computedHref) || "";
37
36
  return jsxRuntime.jsx(Link, { ref, ...attrs, ...restProps, href, rel });
38
37
  });
39
38
  exports.PrismicNextLink = PrismicNextLink;
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicNextLink.cjs","sources":["../../src/PrismicNextLink.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as prismic from \"@prismicio/client\";\nimport Link, { LinkProps } from \"next/link\";\n\nexport type PrismicNextLinkProps = Omit<\n\tReact.ComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: prismic.LinkResolverFunction;\n\trel?: string | prismic.AsLinkAttrsConfig[\"rel\"];\n} & (\n\t\t| {\n\t\t\t\tdocument: prismic.PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tfield?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield: prismic.LinkField | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tdocument?: never;\n\t\t }\n\t\t| {\n\t\t\t\thref: LinkProps[\"href\"];\n\t\t\t\tfield?: prismic.LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t }\n\t);\n\nexport const PrismicNextLink = React.forwardRef<\n\tHTMLAnchorElement,\n\tPrismicNextLinkProps\n>(function PrismicNextLink(\n\t{ field, document, linkResolver, ...restProps },\n\tref,\n): JSX.Element | null {\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = prismic.asLinkAttrs(field ?? document, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tlet rel: string | undefined = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\treturn <Link ref={ref} {...attrs} {...restProps} href={href} rel={rel} />;\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO;AAOA;AAIqC;AAC1C;AAC2D;AAG5D;AACA;AACC;AAAgB;AAGjB;AAEO;AACR;;"}
1
+ {"version":3,"file":"PrismicNextLink.cjs","sources":["../../src/PrismicNextLink.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as prismic from \"@prismicio/client\";\nimport Link from \"next/link\";\n\nexport type PrismicNextLinkProps = Omit<\n\tReact.ComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: prismic.LinkResolverFunction;\n\trel?: string | prismic.AsLinkAttrsConfig[\"rel\"];\n} & (\n\t\t| {\n\t\t\t\tfield: prismic.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: prismic.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: React.ComponentProps<typeof Link>[\"href\"];\n\t\t }\n\t);\n\nexport const PrismicNextLink = React.forwardRef<\n\tHTMLAnchorElement,\n\tPrismicNextLinkProps\n>(function PrismicNextLink(\n\t{ field, document, linkResolver, ...restProps },\n\tref,\n): JSX.Element | null {\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = prismic.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\treturn <Link ref={ref} {...attrs} {...restProps} href={href} rel={rel} />;\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8BO;AAOA;AAIqC;AAC1C;AAC2D;AAG5D;AAEA;AACA;AACC;AAAgB;AAGV;AACR;;"}
@@ -1,22 +1,22 @@
1
1
  /// <reference types="node" />
2
2
  import * as React from "react";
3
3
  import * as prismic from "@prismicio/client";
4
- import Link, { LinkProps } from "next/link";
4
+ import Link from "next/link";
5
5
  export type PrismicNextLinkProps = Omit<React.ComponentProps<typeof Link>, "field" | "document" | "href" | "rel"> & {
6
6
  linkResolver?: prismic.LinkResolverFunction;
7
7
  rel?: string | prismic.AsLinkAttrsConfig["rel"];
8
8
  } & ({
9
- document: prismic.PrismicDocument | null | undefined;
9
+ field: prismic.LinkField | null | undefined;
10
+ document?: never;
10
11
  href?: never;
11
- field?: never;
12
12
  } | {
13
- field: prismic.LinkField | null | undefined;
13
+ field?: never;
14
+ document: prismic.PrismicDocument | null | undefined;
14
15
  href?: never;
15
- document?: never;
16
16
  } | {
17
- href: LinkProps["href"];
18
- field?: prismic.LinkField | null | undefined;
17
+ field?: never;
19
18
  document?: never;
19
+ href: React.ComponentProps<typeof Link>["href"];
20
20
  });
21
21
  export declare const PrismicNextLink: React.ForwardRefExoticComponent<(Pick<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
22
22
  href: string | import("url").UrlObject;
@@ -50,9 +50,9 @@ export declare const PrismicNextLink: React.ForwardRefExoticComponent<(Pick<Omit
50
50
  linkResolver?: prismic.LinkResolverFunction | undefined;
51
51
  rel?: string | prismic.AsLinkAttrsConfig["rel"];
52
52
  } & {
53
- document: prismic.PrismicDocument | null | undefined;
53
+ field: prismic.LinkField | null | undefined;
54
+ document?: undefined;
54
55
  href?: undefined;
55
- field?: undefined;
56
56
  }, "key" | "referrerPolicy" | "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" | "field" | "replace" | "document" | "href" | "as" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "linkResolver"> | Pick<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
57
57
  href: string | import("url").UrlObject;
58
58
  as?: (string | import("url").UrlObject) | undefined;
@@ -85,9 +85,9 @@ export declare const PrismicNextLink: React.ForwardRefExoticComponent<(Pick<Omit
85
85
  linkResolver?: prismic.LinkResolverFunction | undefined;
86
86
  rel?: string | prismic.AsLinkAttrsConfig["rel"];
87
87
  } & {
88
- field: prismic.LinkField | null | undefined;
88
+ field?: undefined;
89
+ document: prismic.PrismicDocument | null | undefined;
89
90
  href?: undefined;
90
- document?: undefined;
91
91
  }, "key" | "referrerPolicy" | "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" | "field" | "replace" | "document" | "href" | "as" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "linkResolver"> | Pick<Omit<Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
92
92
  href: string | import("url").UrlObject;
93
93
  as?: (string | import("url").UrlObject) | undefined;
@@ -120,7 +120,7 @@ export declare const PrismicNextLink: React.ForwardRefExoticComponent<(Pick<Omit
120
120
  linkResolver?: prismic.LinkResolverFunction | undefined;
121
121
  rel?: string | prismic.AsLinkAttrsConfig["rel"];
122
122
  } & {
123
- href: LinkProps["href"];
124
- field?: prismic.LinkField | null | undefined;
123
+ field?: undefined;
125
124
  document?: undefined;
125
+ href: React.ComponentProps<typeof Link>["href"];
126
126
  }, "key" | "referrerPolicy" | "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" | "field" | "replace" | "document" | "href" | "as" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "linkResolver">) & React.RefAttributes<HTMLAnchorElement>>;
@@ -2,18 +2,18 @@
2
2
  'use client';
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import * as React from "react";
5
- import * as prismic from "@prismicio/client";
6
5
  import Link from "next/link";
6
+ import { asLinkAttrs } from './_node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js';
7
7
  const PrismicNextLink = React.forwardRef(function PrismicNextLink2({ field, document, linkResolver, ...restProps }, ref) {
8
- const { href: computedHref, rel: computedRel, ...attrs } = prismic.asLinkAttrs(field ?? document, {
8
+ const { href: computedHref, rel: computedRel, ...attrs } = asLinkAttrs(field ?? document, {
9
9
  linkResolver,
10
10
  rel: typeof restProps.rel === "function" ? restProps.rel : void 0
11
11
  });
12
+ const href = ("href" in restProps ? restProps.href : computedHref) || "";
12
13
  let rel = computedRel;
13
14
  if ("rel" in restProps && typeof restProps.rel !== "function") {
14
15
  rel = restProps.rel;
15
16
  }
16
- const href = ("href" in restProps ? restProps.href : computedHref) || "";
17
17
  return jsx(Link, { ref, ...attrs, ...restProps, href, rel });
18
18
  });
19
19
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicNextLink.js","sources":["../../src/PrismicNextLink.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as prismic from \"@prismicio/client\";\nimport Link, { LinkProps } from \"next/link\";\n\nexport type PrismicNextLinkProps = Omit<\n\tReact.ComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: prismic.LinkResolverFunction;\n\trel?: string | prismic.AsLinkAttrsConfig[\"rel\"];\n} & (\n\t\t| {\n\t\t\t\tdocument: prismic.PrismicDocument | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tfield?: never;\n\t\t }\n\t\t| {\n\t\t\t\tfield: prismic.LinkField | null | undefined;\n\t\t\t\thref?: never;\n\t\t\t\tdocument?: never;\n\t\t }\n\t\t| {\n\t\t\t\thref: LinkProps[\"href\"];\n\t\t\t\tfield?: prismic.LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t }\n\t);\n\nexport const PrismicNextLink = React.forwardRef<\n\tHTMLAnchorElement,\n\tPrismicNextLinkProps\n>(function PrismicNextLink(\n\t{ field, document, linkResolver, ...restProps },\n\tref,\n): JSX.Element | null {\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = prismic.asLinkAttrs(field ?? document, {\n\t\tlinkResolver,\n\t\trel: typeof restProps.rel === \"function\" ? restProps.rel : undefined,\n\t});\n\n\tlet rel: string | undefined = computedRel;\n\tif (\"rel\" in restProps && typeof restProps.rel !== \"function\") {\n\t\trel = restProps.rel;\n\t}\n\n\tconst href = (\"href\" in restProps ? restProps.href : computedHref) || \"\";\n\n\treturn <Link ref={ref} {...attrs} {...restProps} href={href} rel={rel} />;\n});\n"],"names":[],"mappings":";;;;;;AA8BO;AAOA;AAIqC;AAC1C;AAC2D;AAG5D;AACA;AACC;AAAgB;AAGjB;AAEO;AACR;;;;"}
1
+ {"version":3,"file":"PrismicNextLink.js","sources":["../../src/PrismicNextLink.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as prismic from \"@prismicio/client\";\nimport Link from \"next/link\";\n\nexport type PrismicNextLinkProps = Omit<\n\tReact.ComponentProps<typeof Link>,\n\t\"field\" | \"document\" | \"href\" | \"rel\"\n> & {\n\tlinkResolver?: prismic.LinkResolverFunction;\n\trel?: string | prismic.AsLinkAttrsConfig[\"rel\"];\n} & (\n\t\t| {\n\t\t\t\tfield: prismic.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: prismic.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: React.ComponentProps<typeof Link>[\"href\"];\n\t\t }\n\t);\n\nexport const PrismicNextLink = React.forwardRef<\n\tHTMLAnchorElement,\n\tPrismicNextLinkProps\n>(function PrismicNextLink(\n\t{ field, document, linkResolver, ...restProps },\n\tref,\n): JSX.Element | null {\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = prismic.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\treturn <Link ref={ref} {...attrs} {...restProps} href={href} rel={rel} />;\n});\n"],"names":[],"mappings":";;;;;;AA8BO;AAOA;AAIqC;AAC1C;AAC2D;AAG5D;AAEA;AACA;AACC;AAAgB;AAGV;AACR;;;;"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const preview = "io.prismic.preview";
4
+ exports.preview = preview;
5
+ //# sourceMappingURL=cookie.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookie.cjs","sources":["../../../../../node_modules/@prismicio/client/dist/cookie.js"],"sourcesContent":["const preview = \"io.prismic.preview\";\nexport {\n preview\n};\n//# sourceMappingURL=cookie.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,UAAU;;","x_google_ignoreList":[0]}
@@ -0,0 +1,5 @@
1
+ const preview = "io.prismic.preview";
2
+ export {
3
+ preview
4
+ };
5
+ //# sourceMappingURL=cookie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookie.js","sources":["../../../../../node_modules/@prismicio/client/dist/cookie.js"],"sourcesContent":["const preview = \"io.prismic.preview\";\nexport {\n preview\n};\n//# sourceMappingURL=cookie.js.map\n"],"names":[],"mappings":"AAAK,MAAC,UAAU;","x_google_ignoreList":[0]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const link = require("../types/value/link.cjs");
4
+ const documentToLinkField = require("./documentToLinkField.cjs");
5
+ const asLink = (linkFieldOrDocument, linkResolver) => {
6
+ if (!linkFieldOrDocument) {
7
+ return null;
8
+ }
9
+ const linkField = (
10
+ // prettier-ignore
11
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
13
+ // TODO: Remove the `prettier-ignore` comment when this bug is fixed.
14
+ "link_type" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField.documentToLinkField(linkFieldOrDocument)
15
+ );
16
+ switch (linkField.link_type) {
17
+ case link.LinkType.Media:
18
+ case link.LinkType.Web:
19
+ return "url" in linkField ? linkField.url : null;
20
+ case link.LinkType.Document: {
21
+ if ("id" in linkField && linkResolver) {
22
+ const resolvedURL = linkResolver(linkField);
23
+ if (resolvedURL != null) {
24
+ return resolvedURL;
25
+ }
26
+ }
27
+ if ("url" in linkField && linkField.url) {
28
+ return linkField.url;
29
+ }
30
+ return null;
31
+ }
32
+ case link.LinkType.Any:
33
+ default:
34
+ return null;
35
+ }
36
+ };
37
+ exports.asLink = asLink;
38
+ //# sourceMappingURL=asLink.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLink.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asLink.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nimport { documentToLinkField } from \"./documentToLinkField.js\";\nconst asLink = (linkFieldOrDocument, linkResolver) => {\n if (!linkFieldOrDocument) {\n return null;\n }\n const linkField = (\n // prettier-ignore\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n // TODO: Remove the `prettier-ignore` comment when this bug is fixed.\n \"link_type\" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField(linkFieldOrDocument)\n );\n switch (linkField.link_type) {\n case LinkType.Media:\n case LinkType.Web:\n return \"url\" in linkField ? linkField.url : null;\n case LinkType.Document: {\n if (\"id\" in linkField && linkResolver) {\n const resolvedURL = linkResolver(linkField);\n if (resolvedURL != null) {\n return resolvedURL;\n }\n }\n if (\"url\" in linkField && linkField.url) {\n return linkField.url;\n }\n return null;\n }\n case LinkType.Any:\n default:\n return null;\n }\n};\nexport {\n asLink\n};\n//# sourceMappingURL=asLink.js.map\n"],"names":["documentToLinkField","LinkType"],"mappings":";;;;AAEK,MAAC,SAAS,CAAC,qBAAqB,iBAAiB;AACpD,MAAI,CAAC,qBAAqB;AACxB,WAAO;AAAA,EACR;AACD,QAAM;AAAA;AAAA;AAAA;AAAA;AAAA,IAKJ,eAAe,sBAAsB,sBAAsBA,oBAAAA,oBAAoB,mBAAmB;AAAA;AAEpG,UAAQ,UAAU,WAAS;AAAA,IACzB,KAAKC,KAAAA,SAAS;AAAA,IACd,KAAKA,KAAQ,SAAC;AACZ,aAAO,SAAS,YAAY,UAAU,MAAM;AAAA,IAC9C,KAAKA,KAAAA,SAAS,UAAU;AACtB,UAAI,QAAQ,aAAa,cAAc;AACrC,cAAM,cAAc,aAAa,SAAS;AAC1C,YAAI,eAAe,MAAM;AACvB,iBAAO;AAAA,QACR;AAAA,MACF;AACD,UAAI,SAAS,aAAa,UAAU,KAAK;AACvC,eAAO,UAAU;AAAA,MAClB;AACD,aAAO;AAAA,IACR;AAAA,IACD,KAAKA,KAAAA,SAAS;AAAA,IACd;AACE,aAAO;AAAA,EACV;AACH;;","x_google_ignoreList":[0]}
@@ -0,0 +1,38 @@
1
+ import { LinkType } from "../types/value/link.js";
2
+ import { documentToLinkField } from "./documentToLinkField.js";
3
+ const asLink = (linkFieldOrDocument, linkResolver) => {
4
+ if (!linkFieldOrDocument) {
5
+ return null;
6
+ }
7
+ const linkField = (
8
+ // prettier-ignore
9
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
11
+ // TODO: Remove the `prettier-ignore` comment when this bug is fixed.
12
+ "link_type" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField(linkFieldOrDocument)
13
+ );
14
+ switch (linkField.link_type) {
15
+ case LinkType.Media:
16
+ case LinkType.Web:
17
+ return "url" in linkField ? linkField.url : null;
18
+ case LinkType.Document: {
19
+ if ("id" in linkField && linkResolver) {
20
+ const resolvedURL = linkResolver(linkField);
21
+ if (resolvedURL != null) {
22
+ return resolvedURL;
23
+ }
24
+ }
25
+ if ("url" in linkField && linkField.url) {
26
+ return linkField.url;
27
+ }
28
+ return null;
29
+ }
30
+ case LinkType.Any:
31
+ default:
32
+ return null;
33
+ }
34
+ };
35
+ export {
36
+ asLink
37
+ };
38
+ //# sourceMappingURL=asLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLink.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asLink.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nimport { documentToLinkField } from \"./documentToLinkField.js\";\nconst asLink = (linkFieldOrDocument, linkResolver) => {\n if (!linkFieldOrDocument) {\n return null;\n }\n const linkField = (\n // prettier-ignore\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n // TODO: Remove the `prettier-ignore` comment when this bug is fixed.\n \"link_type\" in linkFieldOrDocument ? linkFieldOrDocument : documentToLinkField(linkFieldOrDocument)\n );\n switch (linkField.link_type) {\n case LinkType.Media:\n case LinkType.Web:\n return \"url\" in linkField ? linkField.url : null;\n case LinkType.Document: {\n if (\"id\" in linkField && linkResolver) {\n const resolvedURL = linkResolver(linkField);\n if (resolvedURL != null) {\n return resolvedURL;\n }\n }\n if (\"url\" in linkField && linkField.url) {\n return linkField.url;\n }\n return null;\n }\n case LinkType.Any:\n default:\n return null;\n }\n};\nexport {\n asLink\n};\n//# sourceMappingURL=asLink.js.map\n"],"names":[],"mappings":";;AAEK,MAAC,SAAS,CAAC,qBAAqB,iBAAiB;AACpD,MAAI,CAAC,qBAAqB;AACxB,WAAO;AAAA,EACR;AACD,QAAM;AAAA;AAAA;AAAA;AAAA;AAAA,IAKJ,eAAe,sBAAsB,sBAAsB,oBAAoB,mBAAmB;AAAA;AAEpG,UAAQ,UAAU,WAAS;AAAA,IACzB,KAAK,SAAS;AAAA,IACd,KAAK,SAAS;AACZ,aAAO,SAAS,YAAY,UAAU,MAAM;AAAA,IAC9C,KAAK,SAAS,UAAU;AACtB,UAAI,QAAQ,aAAa,cAAc;AACrC,cAAM,cAAc,aAAa,SAAS;AAC1C,YAAI,eAAe,MAAM;AACvB,iBAAO;AAAA,QACR;AAAA,MACF;AACD,UAAI,SAAS,aAAa,UAAU,KAAK;AACvC,eAAO,UAAU;AAAA,MAClB;AACD,aAAO;AAAA,IACR;AAAA,IACD,KAAK,SAAS;AAAA,IACd;AACE,aAAO;AAAA,EACV;AACH;","x_google_ignoreList":[0]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const isInternalURL = require("../lib/isInternalURL.cjs");
4
+ const asLink = require("./asLink.cjs");
5
+ const isFilled = require("./isFilled.cjs");
6
+ const asLinkAttrs = (linkFieldOrDocument, config = {}) => {
7
+ if (linkFieldOrDocument && // eslint-disable-next-line @typescript-eslint/ban-ts-comment
8
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
9
+ ("link_type" in linkFieldOrDocument ? isFilled.link(linkFieldOrDocument) : linkFieldOrDocument)) {
10
+ const target = (
11
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
12
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
13
+ "target" in linkFieldOrDocument ? linkFieldOrDocument.target : void 0
14
+ );
15
+ const rawHref = asLink.asLink(linkFieldOrDocument, config.linkResolver);
16
+ const href = rawHref == null ? void 0 : rawHref;
17
+ const isExternal = typeof href === "string" ? !isInternalURL.isInternalURL(href) : false;
18
+ const rel = config.rel ? config.rel({ href, isExternal, target }) : isExternal ? "noreferrer" : void 0;
19
+ return {
20
+ href,
21
+ target,
22
+ rel: rel == null ? void 0 : rel
23
+ };
24
+ }
25
+ return {};
26
+ };
27
+ exports.asLinkAttrs = asLinkAttrs;
28
+ //# sourceMappingURL=asLinkAttrs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLinkAttrs.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js"],"sourcesContent":["import { isInternalURL } from \"../lib/isInternalURL.js\";\nimport { asLink } from \"./asLink.js\";\nimport { link } from \"./isFilled.js\";\nconst asLinkAttrs = (linkFieldOrDocument, config = {}) => {\n if (linkFieldOrDocument && // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n (\"link_type\" in linkFieldOrDocument ? link(linkFieldOrDocument) : linkFieldOrDocument)) {\n const target = (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n \"target\" in linkFieldOrDocument ? linkFieldOrDocument.target : void 0\n );\n const rawHref = asLink(linkFieldOrDocument, config.linkResolver);\n const href = rawHref == null ? void 0 : rawHref;\n const isExternal = typeof href === \"string\" ? !isInternalURL(href) : false;\n const rel = config.rel ? config.rel({ href, isExternal, target }) : isExternal ? \"noreferrer\" : void 0;\n return {\n href,\n target,\n rel: rel == null ? void 0 : rel\n };\n }\n return {};\n};\nexport {\n asLinkAttrs\n};\n//# sourceMappingURL=asLinkAttrs.js.map\n"],"names":["link","asLink","isInternalURL"],"mappings":";;;;;AAGK,MAAC,cAAc,CAAC,qBAAqB,SAAS,OAAO;AACxD,MAAI;AAAA;AAAA,GAEH,eAAe,sBAAsBA,SAAAA,KAAK,mBAAmB,IAAI,sBAAsB;AACtF,UAAM;AAAA;AAAA;AAAA,MAGJ,YAAY,sBAAsB,oBAAoB,SAAS;AAAA;AAEjE,UAAM,UAAUC,OAAM,OAAC,qBAAqB,OAAO,YAAY;AAC/D,UAAM,OAAO,WAAW,OAAO,SAAS;AACxC,UAAM,aAAa,OAAO,SAAS,WAAW,CAACC,4BAAc,IAAI,IAAI;AACrE,UAAM,MAAM,OAAO,MAAM,OAAO,IAAI,EAAE,MAAM,YAAY,OAAM,CAAE,IAAI,aAAa,eAAe;AAChG,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,KAAK,OAAO,OAAO,SAAS;AAAA,IAClC;AAAA,EACG;AACD,SAAO;AACT;;","x_google_ignoreList":[0]}
@@ -0,0 +1,28 @@
1
+ import { isInternalURL } from "../lib/isInternalURL.js";
2
+ import { asLink } from "./asLink.js";
3
+ import { link } from "./isFilled.js";
4
+ const asLinkAttrs = (linkFieldOrDocument, config = {}) => {
5
+ if (linkFieldOrDocument && // eslint-disable-next-line @typescript-eslint/ban-ts-comment
6
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
7
+ ("link_type" in linkFieldOrDocument ? link(linkFieldOrDocument) : linkFieldOrDocument)) {
8
+ const target = (
9
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
+ // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501
11
+ "target" in linkFieldOrDocument ? linkFieldOrDocument.target : void 0
12
+ );
13
+ const rawHref = asLink(linkFieldOrDocument, config.linkResolver);
14
+ const href = rawHref == null ? void 0 : rawHref;
15
+ const isExternal = typeof href === "string" ? !isInternalURL(href) : false;
16
+ const rel = config.rel ? config.rel({ href, isExternal, target }) : isExternal ? "noreferrer" : void 0;
17
+ return {
18
+ href,
19
+ target,
20
+ rel: rel == null ? void 0 : rel
21
+ };
22
+ }
23
+ return {};
24
+ };
25
+ export {
26
+ asLinkAttrs
27
+ };
28
+ //# sourceMappingURL=asLinkAttrs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asLinkAttrs.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/asLinkAttrs.js"],"sourcesContent":["import { isInternalURL } from \"../lib/isInternalURL.js\";\nimport { asLink } from \"./asLink.js\";\nimport { link } from \"./isFilled.js\";\nconst asLinkAttrs = (linkFieldOrDocument, config = {}) => {\n if (linkFieldOrDocument && // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n (\"link_type\" in linkFieldOrDocument ? link(linkFieldOrDocument) : linkFieldOrDocument)) {\n const target = (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n \"target\" in linkFieldOrDocument ? linkFieldOrDocument.target : void 0\n );\n const rawHref = asLink(linkFieldOrDocument, config.linkResolver);\n const href = rawHref == null ? void 0 : rawHref;\n const isExternal = typeof href === \"string\" ? !isInternalURL(href) : false;\n const rel = config.rel ? config.rel({ href, isExternal, target }) : isExternal ? \"noreferrer\" : void 0;\n return {\n href,\n target,\n rel: rel == null ? void 0 : rel\n };\n }\n return {};\n};\nexport {\n asLinkAttrs\n};\n//# sourceMappingURL=asLinkAttrs.js.map\n"],"names":[],"mappings":";;;AAGK,MAAC,cAAc,CAAC,qBAAqB,SAAS,OAAO;AACxD,MAAI;AAAA;AAAA,GAEH,eAAe,sBAAsB,KAAK,mBAAmB,IAAI,sBAAsB;AACtF,UAAM;AAAA;AAAA;AAAA,MAGJ,YAAY,sBAAsB,oBAAoB,SAAS;AAAA;AAEjE,UAAM,UAAU,OAAO,qBAAqB,OAAO,YAAY;AAC/D,UAAM,OAAO,WAAW,OAAO,SAAS;AACxC,UAAM,aAAa,OAAO,SAAS,WAAW,CAAC,cAAc,IAAI,IAAI;AACrE,UAAM,MAAM,OAAO,MAAM,OAAO,IAAI,EAAE,MAAM,YAAY,OAAM,CAAE,IAAI,aAAa,eAAe;AAChG,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,KAAK,OAAO,OAAO,SAAS;AAAA,IAClC;AAAA,EACG;AACD,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const link = require("../types/value/link.cjs");
4
+ const documentToLinkField = (prismicDocument) => {
5
+ var _a;
6
+ return {
7
+ link_type: link.LinkType.Document,
8
+ id: prismicDocument.id,
9
+ uid: prismicDocument.uid || void 0,
10
+ type: prismicDocument.type,
11
+ tags: prismicDocument.tags,
12
+ lang: prismicDocument.lang,
13
+ url: prismicDocument.url == null ? void 0 : prismicDocument.url,
14
+ slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],
15
+ // The REST API does not include a `data` property if the data
16
+ // object is empty.
17
+ //
18
+ // A presence check for `prismicDocument.data` is done to
19
+ // support partial documents. While `documentToLinkField` is
20
+ // not typed to accept partial documents, passing a partial
21
+ // document can happen in untyped projects.
22
+ ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}
23
+ };
24
+ };
25
+ exports.documentToLinkField = documentToLinkField;
26
+ //# sourceMappingURL=documentToLinkField.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentToLinkField.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":["LinkType"],"mappings":";;;AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAWA,KAAQ,SAAC;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;;","x_google_ignoreList":[0]}
@@ -0,0 +1,26 @@
1
+ import { LinkType } from "../types/value/link.js";
2
+ const documentToLinkField = (prismicDocument) => {
3
+ var _a;
4
+ return {
5
+ link_type: LinkType.Document,
6
+ id: prismicDocument.id,
7
+ uid: prismicDocument.uid || void 0,
8
+ type: prismicDocument.type,
9
+ tags: prismicDocument.tags,
10
+ lang: prismicDocument.lang,
11
+ url: prismicDocument.url == null ? void 0 : prismicDocument.url,
12
+ slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],
13
+ // The REST API does not include a `data` property if the data
14
+ // object is empty.
15
+ //
16
+ // A presence check for `prismicDocument.data` is done to
17
+ // support partial documents. While `documentToLinkField` is
18
+ // not typed to accept partial documents, passing a partial
19
+ // document can happen in untyped projects.
20
+ ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}
21
+ };
22
+ };
23
+ export {
24
+ documentToLinkField
25
+ };
26
+ //# sourceMappingURL=documentToLinkField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documentToLinkField.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/documentToLinkField.js"],"sourcesContent":["import { LinkType } from \"../types/value/link.js\";\nconst documentToLinkField = (prismicDocument) => {\n var _a;\n return {\n link_type: LinkType.Document,\n id: prismicDocument.id,\n uid: prismicDocument.uid || void 0,\n type: prismicDocument.type,\n tags: prismicDocument.tags,\n lang: prismicDocument.lang,\n url: prismicDocument.url == null ? void 0 : prismicDocument.url,\n slug: (_a = prismicDocument.slugs) == null ? void 0 : _a[0],\n // The REST API does not include a `data` property if the data\n // object is empty.\n //\n // A presence check for `prismicDocument.data` is done to\n // support partial documents. While `documentToLinkField` is\n // not typed to accept partial documents, passing a partial\n // document can happen in untyped projects.\n ...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}\n };\n};\nexport {\n documentToLinkField\n};\n//# sourceMappingURL=documentToLinkField.js.map\n"],"names":[],"mappings":";AACK,MAAC,sBAAsB,CAAC,oBAAoB;AAC/C,MAAI;AACJ,SAAO;AAAA,IACL,WAAW,SAAS;AAAA,IACpB,IAAI,gBAAgB;AAAA,IACpB,KAAK,gBAAgB,OAAO;AAAA,IAC5B,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,MAAM,gBAAgB;AAAA,IACtB,KAAK,gBAAgB,OAAO,OAAO,SAAS,gBAAgB;AAAA,IAC5D,OAAO,KAAK,gBAAgB,UAAU,OAAO,SAAS,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQ1D,GAAG,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,IAAI,EAAE,SAAS,IAAI,EAAE,MAAM,gBAAgB,KAAM,IAAG,CAAE;AAAA,EACjH;AACA;","x_google_ignoreList":[0]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const isNonNullish = (input) => {
4
+ return input != null;
5
+ };
6
+ const imageThumbnail = (thumbnail) => {
7
+ return isNonNullish(thumbnail) && !!thumbnail.url;
8
+ };
9
+ const link = (field) => {
10
+ return isNonNullish(field) && ("id" in field || "url" in field);
11
+ };
12
+ exports.imageThumbnail = imageThumbnail;
13
+ exports.link = link;
14
+ //# sourceMappingURL=isFilled.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFilled.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/isFilled.js"],"sourcesContent":["const isNonNullish = (input) => {\n return input != null;\n};\nconst isNonEmptyArray = (input) => {\n return !!input.length;\n};\nconst richText = (field) => {\n if (!isNonNullish(field)) {\n return false;\n } else if (field.length === 1 && \"text\" in field[0]) {\n return !!field[0].text;\n } else {\n return !!field.length;\n }\n};\nconst title = richText;\nconst imageThumbnail = (thumbnail) => {\n return isNonNullish(thumbnail) && !!thumbnail.url;\n};\nconst image = imageThumbnail;\nconst link = (field) => {\n return isNonNullish(field) && (\"id\" in field || \"url\" in field);\n};\nconst linkToMedia = link;\nconst contentRelationship = link;\nconst date = isNonNullish;\nconst timestamp = isNonNullish;\nconst color = isNonNullish;\nconst number = isNonNullish;\nconst keyText = (field) => {\n return isNonNullish(keyText) && !!field;\n};\nconst select = isNonNullish;\nconst embed = (field) => {\n return isNonNullish(field) && !!field.embed_url;\n};\nconst geoPoint = (field) => {\n return isNonNullish(field) && \"longitude\" in field;\n};\nconst integrationFields = isNonNullish;\nconst group = (group2) => {\n return isNonNullish(group2) && isNonEmptyArray(group2);\n};\nconst sliceZone = (slices) => {\n return isNonNullish(slices) && isNonEmptyArray(slices);\n};\nexport {\n color,\n contentRelationship,\n date,\n embed,\n geoPoint,\n group,\n image,\n imageThumbnail,\n integrationFields,\n keyText,\n link,\n linkToMedia,\n number,\n richText,\n select,\n sliceZone,\n timestamp,\n title\n};\n//# sourceMappingURL=isFilled.js.map\n"],"names":[],"mappings":";;AAAA,MAAM,eAAe,CAAC,UAAU;AAC9B,SAAO,SAAS;AAClB;AAcK,MAAC,iBAAiB,CAAC,cAAc;AACpC,SAAO,aAAa,SAAS,KAAK,CAAC,CAAC,UAAU;AAChD;AAEK,MAAC,OAAO,CAAC,UAAU;AACtB,SAAO,aAAa,KAAK,MAAM,QAAQ,SAAS,SAAS;AAC3D;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,14 @@
1
+ const isNonNullish = (input) => {
2
+ return input != null;
3
+ };
4
+ const imageThumbnail = (thumbnail) => {
5
+ return isNonNullish(thumbnail) && !!thumbnail.url;
6
+ };
7
+ const link = (field) => {
8
+ return isNonNullish(field) && ("id" in field || "url" in field);
9
+ };
10
+ export {
11
+ imageThumbnail,
12
+ link
13
+ };
14
+ //# sourceMappingURL=isFilled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isFilled.js","sources":["../../../../../../node_modules/@prismicio/client/dist/helpers/isFilled.js"],"sourcesContent":["const isNonNullish = (input) => {\n return input != null;\n};\nconst isNonEmptyArray = (input) => {\n return !!input.length;\n};\nconst richText = (field) => {\n if (!isNonNullish(field)) {\n return false;\n } else if (field.length === 1 && \"text\" in field[0]) {\n return !!field[0].text;\n } else {\n return !!field.length;\n }\n};\nconst title = richText;\nconst imageThumbnail = (thumbnail) => {\n return isNonNullish(thumbnail) && !!thumbnail.url;\n};\nconst image = imageThumbnail;\nconst link = (field) => {\n return isNonNullish(field) && (\"id\" in field || \"url\" in field);\n};\nconst linkToMedia = link;\nconst contentRelationship = link;\nconst date = isNonNullish;\nconst timestamp = isNonNullish;\nconst color = isNonNullish;\nconst number = isNonNullish;\nconst keyText = (field) => {\n return isNonNullish(keyText) && !!field;\n};\nconst select = isNonNullish;\nconst embed = (field) => {\n return isNonNullish(field) && !!field.embed_url;\n};\nconst geoPoint = (field) => {\n return isNonNullish(field) && \"longitude\" in field;\n};\nconst integrationFields = isNonNullish;\nconst group = (group2) => {\n return isNonNullish(group2) && isNonEmptyArray(group2);\n};\nconst sliceZone = (slices) => {\n return isNonNullish(slices) && isNonEmptyArray(slices);\n};\nexport {\n color,\n contentRelationship,\n date,\n embed,\n geoPoint,\n group,\n image,\n imageThumbnail,\n integrationFields,\n keyText,\n link,\n linkToMedia,\n number,\n richText,\n select,\n sliceZone,\n timestamp,\n title\n};\n//# sourceMappingURL=isFilled.js.map\n"],"names":[],"mappings":"AAAA,MAAM,eAAe,CAAC,UAAU;AAC9B,SAAO,SAAS;AAClB;AAcK,MAAC,iBAAiB,CAAC,cAAc;AACpC,SAAO,aAAa,SAAS,KAAK,CAAC,CAAC,UAAU;AAChD;AAEK,MAAC,OAAO,CAAC,UAAU;AACtB,SAAO,aAAa,KAAK,MAAM,QAAQ,SAAS,SAAS;AAC3D;","x_google_ignoreList":[0]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const isInternalURL = (url) => {
4
+ const isInternal = /^(\/(?!\/)|#)/.test(url);
5
+ const isSpecialLink = !isInternal && !/^https?:\/\//.test(url);
6
+ return isInternal && !isSpecialLink;
7
+ };
8
+ exports.isInternalURL = isInternalURL;
9
+ //# sourceMappingURL=isInternalURL.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInternalURL.cjs","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/isInternalURL.js"],"sourcesContent":["const isInternalURL = (url) => {\n const isInternal = /^(\\/(?!\\/)|#)/.test(url);\n const isSpecialLink = !isInternal && !/^https?:\\/\\//.test(url);\n return isInternal && !isSpecialLink;\n};\nexport {\n isInternalURL\n};\n//# sourceMappingURL=isInternalURL.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,gBAAgB,CAAC,QAAQ;AAC7B,QAAM,aAAa,gBAAgB,KAAK,GAAG;AAC3C,QAAM,gBAAgB,CAAC,cAAc,CAAC,eAAe,KAAK,GAAG;AAC7D,SAAO,cAAc,CAAC;AACxB;;","x_google_ignoreList":[0]}
@@ -0,0 +1,9 @@
1
+ const isInternalURL = (url) => {
2
+ const isInternal = /^(\/(?!\/)|#)/.test(url);
3
+ const isSpecialLink = !isInternal && !/^https?:\/\//.test(url);
4
+ return isInternal && !isSpecialLink;
5
+ };
6
+ export {
7
+ isInternalURL
8
+ };
9
+ //# sourceMappingURL=isInternalURL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInternalURL.js","sources":["../../../../../../node_modules/@prismicio/client/dist/lib/isInternalURL.js"],"sourcesContent":["const isInternalURL = (url) => {\n const isInternal = /^(\\/(?!\\/)|#)/.test(url);\n const isSpecialLink = !isInternal && !/^https?:\\/\\//.test(url);\n return isInternal && !isSpecialLink;\n};\nexport {\n isInternalURL\n};\n//# sourceMappingURL=isInternalURL.js.map\n"],"names":[],"mappings":"AAAK,MAAC,gBAAgB,CAAC,QAAQ;AAC7B,QAAM,aAAa,gBAAgB,KAAK,GAAG;AAC3C,QAAM,gBAAgB,CAAC,cAAc,CAAC,eAAe,KAAK,GAAG;AAC7D,SAAO,cAAc,CAAC;AACxB;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const LinkType = {
4
+ Any: "Any",
5
+ Document: "Document",
6
+ Media: "Media",
7
+ Web: "Web"
8
+ };
9
+ exports.LinkType = LinkType;
10
+ //# sourceMappingURL=link.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.cjs","sources":["../../../../../../../node_modules/@prismicio/client/dist/types/value/link.js"],"sourcesContent":["const LinkType = {\n Any: \"Any\",\n Document: \"Document\",\n Media: \"Media\",\n Web: \"Web\"\n};\nexport {\n LinkType\n};\n//# sourceMappingURL=link.js.map\n"],"names":[],"mappings":";;AAAK,MAAC,WAAW;AAAA,EACf,KAAK;AAAA,EACL,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AACP;;","x_google_ignoreList":[0]}
@@ -0,0 +1,10 @@
1
+ const LinkType = {
2
+ Any: "Any",
3
+ Document: "Document",
4
+ Media: "Media",
5
+ Web: "Web"
6
+ };
7
+ export {
8
+ LinkType
9
+ };
10
+ //# sourceMappingURL=link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.js","sources":["../../../../../../../node_modules/@prismicio/client/dist/types/value/link.js"],"sourcesContent":["const LinkType = {\n Any: \"Any\",\n Document: \"Document\",\n Media: \"Media\",\n Web: \"Web\"\n};\nexport {\n LinkType\n};\n//# sourceMappingURL=link.js.map\n"],"names":[],"mappings":"AAAK,MAAC,WAAW;AAAA,EACf,KAAK;AAAA,EACL,UAAU;AAAA,EACV,OAAO;AAAA,EACP,KAAK;AACP;","x_google_ignoreList":[0]}
@@ -1,33 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const prismic = require("@prismicio/client");
4
- function _interopNamespaceDefault(e) {
5
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
6
- if (e) {
7
- for (const k in e) {
8
- if (k !== "default") {
9
- const d = Object.getOwnPropertyDescriptor(e, k);
10
- Object.defineProperty(n, k, d.get ? d : {
11
- enumerable: true,
12
- get: () => e[k]
13
- });
14
- }
15
- }
16
- }
17
- n.default = e;
18
- return Object.freeze(n);
19
- }
20
- const prismic__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismic);
3
+ const cookie = require('./../_node_modules/@prismicio/client/dist/cookie.cjs');
21
4
  const readValue = (value) => {
22
5
  return value.replace(/%3B/g, ";");
23
6
  };
24
7
  const getPrismicPreviewCookie = (cookieJar) => {
25
8
  const cookies = cookieJar.split("; ");
26
9
  let value;
27
- for (const cookie of cookies) {
28
- const parts = cookie.split("=");
10
+ for (const cookie$1 of cookies) {
11
+ const parts = cookie$1.split("=");
29
12
  const name = readValue(parts[0]).replace(/%3D/g, "=");
30
- if (name === prismic__namespace.cookie.preview) {
13
+ if (name === cookie.preview) {
31
14
  value = readValue(parts.slice(1).join("="));
32
15
  continue;
33
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getPrismicPreviewCookie.cjs","sources":["../../../src/lib/getPrismicPreviewCookie.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\n\nconst readValue = (value: string): string => {\n\treturn value.replace(/%3B/g, \";\");\n};\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the\n * cookie.\n *\n * @returns The value of the cookie, if it exists.\n */\nexport const getPrismicPreviewCookie = (\n\tcookieJar: string,\n): string | undefined => {\n\tconst cookies = cookieJar.split(\"; \");\n\n\tlet value: string | undefined;\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\");\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\");\n\n\t\tif (name === prismic.cookie.preview) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"));\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn value;\n};\n"],"names":["prismic"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,MAAM,YAAY,CAAC,UAAyB;AACpC,SAAA,MAAM,QAAQ,QAAQ,GAAG;AACjC;AAUa,MAAA,0BAA0B,CACtC,cACuB;AACjB,QAAA,UAAU,UAAU,MAAM,IAAI;AAEhC,MAAA;AAEJ,aAAW,UAAU,SAAS;AACvB,UAAA,QAAQ,OAAO,MAAM,GAAG;AACxB,UAAA,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,QAAQ,QAAQ,GAAG;AAEhD,QAAA,SAASA,mBAAQ,OAAO,SAAS;AACpC,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACA;AAAA,EACD;AAEM,SAAA;AACR;;"}
1
+ {"version":3,"file":"getPrismicPreviewCookie.cjs","sources":["../../../src/lib/getPrismicPreviewCookie.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\n\nconst readValue = (value: string): string => {\n\treturn value.replace(/%3B/g, \";\");\n};\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the\n * cookie.\n *\n * @returns The value of the cookie, if it exists.\n */\nexport const getPrismicPreviewCookie = (\n\tcookieJar: string,\n): string | undefined => {\n\tconst cookies = cookieJar.split(\"; \");\n\n\tlet value: string | undefined;\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\");\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\");\n\n\t\tif (name === prismic.cookie.preview) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"));\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn value;\n};\n"],"names":["cookie","prismic.cookie.preview"],"mappings":";;;AAEA,MAAM,YAAY,CAAC,UAAyB;AACpC,SAAA,MAAM,QAAQ,QAAQ,GAAG;AACjC;AAUa,MAAA,0BAA0B,CACtC,cACuB;AACjB,QAAA,UAAU,UAAU,MAAM,IAAI;AAEhC,MAAA;AAEJ,aAAWA,YAAU,SAAS;AACvB,UAAA,QAAQA,SAAO,MAAM,GAAG;AACxB,UAAA,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,QAAQ,QAAQ,GAAG;AAEhD,QAAA,SAASC,OAAAA,SAAwB;AACpC,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACA;AAAA,EACD;AAEM,SAAA;AACR;;"}
@@ -1,4 +1,4 @@
1
- import * as prismic from "@prismicio/client";
1
+ import { preview } from './../_node_modules/@prismicio/client/dist/cookie.js';
2
2
  const readValue = (value) => {
3
3
  return value.replace(/%3B/g, ";");
4
4
  };
@@ -8,7 +8,7 @@ const getPrismicPreviewCookie = (cookieJar) => {
8
8
  for (const cookie of cookies) {
9
9
  const parts = cookie.split("=");
10
10
  const name = readValue(parts[0]).replace(/%3D/g, "=");
11
- if (name === prismic.cookie.preview) {
11
+ if (name === preview) {
12
12
  value = readValue(parts.slice(1).join("="));
13
13
  continue;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getPrismicPreviewCookie.js","sources":["../../../src/lib/getPrismicPreviewCookie.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\n\nconst readValue = (value: string): string => {\n\treturn value.replace(/%3B/g, \";\");\n};\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the\n * cookie.\n *\n * @returns The value of the cookie, if it exists.\n */\nexport const getPrismicPreviewCookie = (\n\tcookieJar: string,\n): string | undefined => {\n\tconst cookies = cookieJar.split(\"; \");\n\n\tlet value: string | undefined;\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\");\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\");\n\n\t\tif (name === prismic.cookie.preview) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"));\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn value;\n};\n"],"names":[],"mappings":";AAEA,MAAM,YAAY,CAAC,UAAyB;AACpC,SAAA,MAAM,QAAQ,QAAQ,GAAG;AACjC;AAUa,MAAA,0BAA0B,CACtC,cACuB;AACjB,QAAA,UAAU,UAAU,MAAM,IAAI;AAEhC,MAAA;AAEJ,aAAW,UAAU,SAAS;AACvB,UAAA,QAAQ,OAAO,MAAM,GAAG;AACxB,UAAA,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,QAAQ,QAAQ,GAAG;AAEhD,QAAA,SAAS,QAAQ,OAAO,SAAS;AACpC,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACA;AAAA,EACD;AAEM,SAAA;AACR;"}
1
+ {"version":3,"file":"getPrismicPreviewCookie.js","sources":["../../../src/lib/getPrismicPreviewCookie.ts"],"sourcesContent":["import * as prismic from \"@prismicio/client\";\n\nconst readValue = (value: string): string => {\n\treturn value.replace(/%3B/g, \";\");\n};\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the\n * cookie.\n *\n * @returns The value of the cookie, if it exists.\n */\nexport const getPrismicPreviewCookie = (\n\tcookieJar: string,\n): string | undefined => {\n\tconst cookies = cookieJar.split(\"; \");\n\n\tlet value: string | undefined;\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\");\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\");\n\n\t\tif (name === prismic.cookie.preview) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"));\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn value;\n};\n"],"names":["prismic.cookie.preview"],"mappings":";AAEA,MAAM,YAAY,CAAC,UAAyB;AACpC,SAAA,MAAM,QAAQ,QAAQ,GAAG;AACjC;AAUa,MAAA,0BAA0B,CACtC,cACuB;AACjB,QAAA,UAAU,UAAU,MAAM,IAAI;AAEhC,MAAA;AAEJ,aAAW,UAAU,SAAS;AACvB,UAAA,QAAQ,OAAO,MAAM,GAAG;AACxB,UAAA,OAAO,UAAU,MAAM,CAAC,CAAC,EAAE,QAAQ,QAAQ,GAAG;AAEhD,QAAA,SAASA,SAAwB;AACpC,cAAQ,UAAU,MAAM,MAAM,CAAC,EAAE,KAAK,GAAG,CAAC;AAC1C;AAAA,IACA;AAAA,EACD;AAEM,SAAA;AACR;"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "1.1.0-alpha.0";
3
+ const version = "1.1.0-alpha.1";
4
4
  exports.version = version;
5
5
  //# sourceMappingURL=package.json.cjs.map
@@ -1,4 +1,4 @@
1
- const version = "1.1.0-alpha.0";
1
+ const version = "1.1.0-alpha.1";
2
2
  export {
3
3
  version
4
4
  };
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- function buildErrorMessage(fnName) {
3
+ function buildIncompatiblePreviewModeError(fnName) {
4
4
  return `${fnName} is currently incompatible with App Router. Preview Mode is not supported in App Router at this time. Please remove all uses of ${fnName}.`;
5
5
  }
6
6
  function PrismicPreview() {
7
- throw new Error(buildErrorMessage("<PrismicPreview>"));
7
+ throw new Error(buildIncompatiblePreviewModeError("<PrismicPreview>"));
8
8
  }
9
9
  function enableAutoPreviews() {
10
- throw new Error(buildErrorMessage("enableAutoPreviews()"));
10
+ throw new Error(buildIncompatiblePreviewModeError("enableAutoPreviews()"));
11
11
  }
12
12
  function exitPreview() {
13
- throw new Error(buildErrorMessage("exitPreview()"));
13
+ throw new Error(buildIncompatiblePreviewModeError("exitPreview()"));
14
14
  }
15
15
  function redirectToPreviewURL() {
16
- throw new Error(buildErrorMessage("redirectToPreviewURL()"));
16
+ throw new Error(buildIncompatiblePreviewModeError("redirectToPreviewURL()"));
17
17
  }
18
18
  function setPreviewData() {
19
- throw new Error(buildErrorMessage("setPreviewData()"));
19
+ throw new Error(buildIncompatiblePreviewModeError("setPreviewData()"));
20
20
  }
21
21
  exports.PrismicPreview = PrismicPreview;
22
22
  exports.enableAutoPreviews = enableAutoPreviews;
@@ -1 +1 @@
1
- {"version":3,"file":"unsupported.cjs","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction buildErrorMessage(fnName: string) {\n\treturn `${fnName} is currently incompatible with App Router. Preview Mode is not supported in App Router at this time. Please remove all uses of ${fnName}.`;\n}\n\nexport function PrismicPreview(): JSX.Element {\n\tthrow new Error(buildErrorMessage(\"<PrismicPreview>\"));\n}\n\nexport function enableAutoPreviews() {\n\tthrow new Error(buildErrorMessage(\"enableAutoPreviews()\"));\n}\n\nexport function exitPreview() {\n\tthrow new Error(buildErrorMessage(\"exitPreview()\"));\n}\n\nexport function redirectToPreviewURL() {\n\tthrow new Error(buildErrorMessage(\"redirectToPreviewURL()\"));\n}\n\nexport function setPreviewData() {\n\tthrow new Error(buildErrorMessage(\"setPreviewData()\"));\n}\n"],"names":[],"mappings":";;AAGA,SAAS,kBAAkB,QAAc;AACxC,SAAO,GAAG,yIAAyI;AACpJ;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kBAAkB,kBAAkB,CAAC;AACtD;SAEgB,qBAAkB;AACjC,QAAM,IAAI,MAAM,kBAAkB,sBAAsB,CAAC;AAC1D;SAEgB,cAAW;AAC1B,QAAM,IAAI,MAAM,kBAAkB,eAAe,CAAC;AACnD;SAEgB,uBAAoB;AACnC,QAAM,IAAI,MAAM,kBAAkB,wBAAwB,CAAC;AAC5D;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kBAAkB,kBAAkB,CAAC;AACtD;;;;;;"}
1
+ {"version":3,"file":"unsupported.cjs","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction buildIncompatiblePreviewModeError(fnName: string) {\n\treturn `${fnName} is currently incompatible with App Router. Preview Mode is not supported in App Router at this time. Please remove all uses of ${fnName}.`;\n}\n\nexport function PrismicPreview(): JSX.Element {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"<PrismicPreview>\"));\n}\n\nexport function enableAutoPreviews() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"enableAutoPreviews()\"));\n}\n\nexport function exitPreview() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"exitPreview()\"));\n}\n\nexport function redirectToPreviewURL() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"redirectToPreviewURL()\"));\n}\n\nexport function setPreviewData() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"setPreviewData()\"));\n}\n"],"names":[],"mappings":";;AAGA,SAAS,kCAAkC,QAAc;AACxD,SAAO,GAAG,yIAAyI;AACpJ;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kCAAkC,kBAAkB,CAAC;AACtE;SAEgB,qBAAkB;AACjC,QAAM,IAAI,MAAM,kCAAkC,sBAAsB,CAAC;AAC1E;SAEgB,cAAW;AAC1B,QAAM,IAAI,MAAM,kCAAkC,eAAe,CAAC;AACnE;SAEgB,uBAAoB;AACnC,QAAM,IAAI,MAAM,kCAAkC,wBAAwB,CAAC;AAC5E;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kCAAkC,kBAAkB,CAAC;AACtE;;;;;;"}
@@ -1,20 +1,20 @@
1
- function buildErrorMessage(fnName) {
1
+ function buildIncompatiblePreviewModeError(fnName) {
2
2
  return `${fnName} is currently incompatible with App Router. Preview Mode is not supported in App Router at this time. Please remove all uses of ${fnName}.`;
3
3
  }
4
4
  function PrismicPreview() {
5
- throw new Error(buildErrorMessage("<PrismicPreview>"));
5
+ throw new Error(buildIncompatiblePreviewModeError("<PrismicPreview>"));
6
6
  }
7
7
  function enableAutoPreviews() {
8
- throw new Error(buildErrorMessage("enableAutoPreviews()"));
8
+ throw new Error(buildIncompatiblePreviewModeError("enableAutoPreviews()"));
9
9
  }
10
10
  function exitPreview() {
11
- throw new Error(buildErrorMessage("exitPreview()"));
11
+ throw new Error(buildIncompatiblePreviewModeError("exitPreview()"));
12
12
  }
13
13
  function redirectToPreviewURL() {
14
- throw new Error(buildErrorMessage("redirectToPreviewURL()"));
14
+ throw new Error(buildIncompatiblePreviewModeError("redirectToPreviewURL()"));
15
15
  }
16
16
  function setPreviewData() {
17
- throw new Error(buildErrorMessage("setPreviewData()"));
17
+ throw new Error(buildIncompatiblePreviewModeError("setPreviewData()"));
18
18
  }
19
19
  export {
20
20
  PrismicPreview,
@@ -1 +1 @@
1
- {"version":3,"file":"unsupported.js","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction buildErrorMessage(fnName: string) {\n\treturn `${fnName} is currently incompatible with App Router. Preview Mode is not supported in App Router at this time. Please remove all uses of ${fnName}.`;\n}\n\nexport function PrismicPreview(): JSX.Element {\n\tthrow new Error(buildErrorMessage(\"<PrismicPreview>\"));\n}\n\nexport function enableAutoPreviews() {\n\tthrow new Error(buildErrorMessage(\"enableAutoPreviews()\"));\n}\n\nexport function exitPreview() {\n\tthrow new Error(buildErrorMessage(\"exitPreview()\"));\n}\n\nexport function redirectToPreviewURL() {\n\tthrow new Error(buildErrorMessage(\"redirectToPreviewURL()\"));\n}\n\nexport function setPreviewData() {\n\tthrow new Error(buildErrorMessage(\"setPreviewData()\"));\n}\n"],"names":[],"mappings":"AAGA,SAAS,kBAAkB,QAAc;AACxC,SAAO,GAAG,yIAAyI;AACpJ;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kBAAkB,kBAAkB,CAAC;AACtD;SAEgB,qBAAkB;AACjC,QAAM,IAAI,MAAM,kBAAkB,sBAAsB,CAAC;AAC1D;SAEgB,cAAW;AAC1B,QAAM,IAAI,MAAM,kBAAkB,eAAe,CAAC;AACnD;SAEgB,uBAAoB;AACnC,QAAM,IAAI,MAAM,kBAAkB,wBAAwB,CAAC;AAC5D;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kBAAkB,kBAAkB,CAAC;AACtD;"}
1
+ {"version":3,"file":"unsupported.js","sources":["../../../src/react-server/unsupported.ts"],"sourcesContent":["// Exports in this file are unsupported in the react-server environment.\n// All environments should export the same functions to maintian API compatability.\n\nfunction buildIncompatiblePreviewModeError(fnName: string) {\n\treturn `${fnName} is currently incompatible with App Router. Preview Mode is not supported in App Router at this time. Please remove all uses of ${fnName}.`;\n}\n\nexport function PrismicPreview(): JSX.Element {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"<PrismicPreview>\"));\n}\n\nexport function enableAutoPreviews() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"enableAutoPreviews()\"));\n}\n\nexport function exitPreview() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"exitPreview()\"));\n}\n\nexport function redirectToPreviewURL() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"redirectToPreviewURL()\"));\n}\n\nexport function setPreviewData() {\n\tthrow new Error(buildIncompatiblePreviewModeError(\"setPreviewData()\"));\n}\n"],"names":[],"mappings":"AAGA,SAAS,kCAAkC,QAAc;AACxD,SAAO,GAAG,yIAAyI;AACpJ;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kCAAkC,kBAAkB,CAAC;AACtE;SAEgB,qBAAkB;AACjC,QAAM,IAAI,MAAM,kCAAkC,sBAAsB,CAAC;AAC1E;SAEgB,cAAW;AAC1B,QAAM,IAAI,MAAM,kCAAkC,eAAe,CAAC;AACnE;SAEgB,uBAAoB;AACnC,QAAM,IAAI,MAAM,kCAAkC,wBAAwB,CAAC;AAC5E;SAEgB,iBAAc;AAC7B,QAAM,IAAI,MAAM,kCAAkC,kBAAkB,CAAC;AACtE;"}
@@ -1,25 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const prismic = require("@prismicio/client");
4
- function _interopNamespaceDefault(e) {
5
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
6
- if (e) {
7
- for (const k in e) {
8
- if (k !== "default") {
9
- const d = Object.getOwnPropertyDescriptor(e, k);
10
- Object.defineProperty(n, k, d.get ? d : {
11
- enumerable: true,
12
- get: () => e[k]
13
- });
14
- }
15
- }
16
- }
17
- n.default = e;
18
- return Object.freeze(n);
19
- }
20
- const prismic__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismic);
3
+ const cookie = require('./_node_modules/@prismicio/client/dist/cookie.cjs');
21
4
  function setPreviewData({ req, res }) {
22
- const ref = req.query.token || req.cookies[prismic__namespace.cookie.preview];
5
+ const ref = req.query.token || req.cookies[cookie.preview];
23
6
  if (ref) {
24
7
  res.setPreviewData({ ref });
25
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setPreviewData.cjs","sources":["../../src/setPreviewData.ts"],"sourcesContent":["import { NextApiResponse, NextApiRequest } from \"next\";\nimport * as prismic from \"@prismicio/client\";\n\n/**\n * Configuration for `setPreviewData`.\n */\nexport type SetPreviewDataConfig = {\n\t/**\n\t * The `req` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\treq: {\n\t\tquery: NextApiRequest[\"query\"];\n\t\tcookies: NextApiRequest[\"cookies\"];\n\t};\n\n\t/**\n\t * The `res` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\tres: {\n\t\tsetPreviewData: NextApiResponse[\"setPreviewData\"];\n\t};\n};\n\n/**\n * Set Prismic preview data for Next.js's Preview Mode.\n */\nexport function setPreviewData({ req, res }: SetPreviewDataConfig): void {\n\tconst ref = req.query.token || req.cookies[prismic.cookie.preview];\n\n\tif (ref) {\n\t\tres.setPreviewData({ ref });\n\t}\n}\n"],"names":["prismic"],"mappings":";;;;;;;;;;;;;;;;;;;;SAgCgB,eAAe,EAAE,KAAK,OAA2B;AAC1D,QAAA,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQA,mBAAQ,OAAO,OAAO;AAEjE,MAAI,KAAK;AACJ,QAAA,eAAe,EAAE,IAAA,CAAK;AAAA,EAC1B;AACF;;"}
1
+ {"version":3,"file":"setPreviewData.cjs","sources":["../../src/setPreviewData.ts"],"sourcesContent":["import { NextApiResponse, NextApiRequest } from \"next\";\nimport * as prismic from \"@prismicio/client\";\n\n/**\n * Configuration for `setPreviewData`.\n */\nexport type SetPreviewDataConfig = {\n\t/**\n\t * The `req` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\treq: {\n\t\tquery: NextApiRequest[\"query\"];\n\t\tcookies: NextApiRequest[\"cookies\"];\n\t};\n\n\t/**\n\t * The `res` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\tres: {\n\t\tsetPreviewData: NextApiResponse[\"setPreviewData\"];\n\t};\n};\n\n/**\n * Set Prismic preview data for Next.js's Preview Mode.\n */\nexport function setPreviewData({ req, res }: SetPreviewDataConfig): void {\n\tconst ref = req.query.token || req.cookies[prismic.cookie.preview];\n\n\tif (ref) {\n\t\tres.setPreviewData({ ref });\n\t}\n}\n"],"names":["prismic.cookie.preview"],"mappings":";;;SAgCgB,eAAe,EAAE,KAAK,OAA2B;AAC1D,QAAA,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQA,OAAAA,OAAsB;AAEjE,MAAI,KAAK;AACJ,QAAA,eAAe,EAAE,IAAA,CAAK;AAAA,EAC1B;AACF;;"}
@@ -1,6 +1,6 @@
1
- import * as prismic from "@prismicio/client";
1
+ import { preview } from './_node_modules/@prismicio/client/dist/cookie.js';
2
2
  function setPreviewData({ req, res }) {
3
- const ref = req.query.token || req.cookies[prismic.cookie.preview];
3
+ const ref = req.query.token || req.cookies[preview];
4
4
  if (ref) {
5
5
  res.setPreviewData({ ref });
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setPreviewData.js","sources":["../../src/setPreviewData.ts"],"sourcesContent":["import { NextApiResponse, NextApiRequest } from \"next\";\nimport * as prismic from \"@prismicio/client\";\n\n/**\n * Configuration for `setPreviewData`.\n */\nexport type SetPreviewDataConfig = {\n\t/**\n\t * The `req` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\treq: {\n\t\tquery: NextApiRequest[\"query\"];\n\t\tcookies: NextApiRequest[\"cookies\"];\n\t};\n\n\t/**\n\t * The `res` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\tres: {\n\t\tsetPreviewData: NextApiResponse[\"setPreviewData\"];\n\t};\n};\n\n/**\n * Set Prismic preview data for Next.js's Preview Mode.\n */\nexport function setPreviewData({ req, res }: SetPreviewDataConfig): void {\n\tconst ref = req.query.token || req.cookies[prismic.cookie.preview];\n\n\tif (ref) {\n\t\tres.setPreviewData({ ref });\n\t}\n}\n"],"names":[],"mappings":";SAgCgB,eAAe,EAAE,KAAK,OAA2B;AAC1D,QAAA,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQ,QAAQ,OAAO,OAAO;AAEjE,MAAI,KAAK;AACJ,QAAA,eAAe,EAAE,IAAA,CAAK;AAAA,EAC1B;AACF;"}
1
+ {"version":3,"file":"setPreviewData.js","sources":["../../src/setPreviewData.ts"],"sourcesContent":["import { NextApiResponse, NextApiRequest } from \"next\";\nimport * as prismic from \"@prismicio/client\";\n\n/**\n * Configuration for `setPreviewData`.\n */\nexport type SetPreviewDataConfig = {\n\t/**\n\t * The `req` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\treq: {\n\t\tquery: NextApiRequest[\"query\"];\n\t\tcookies: NextApiRequest[\"cookies\"];\n\t};\n\n\t/**\n\t * The `res` object from a Next.js API route. This is given as a parameter to\n\t * the API route.\n\t *\n\t * @see Next.js API route docs: {@link https://nextjs.org/docs/api-routes/introduction}\n\t */\n\tres: {\n\t\tsetPreviewData: NextApiResponse[\"setPreviewData\"];\n\t};\n};\n\n/**\n * Set Prismic preview data for Next.js's Preview Mode.\n */\nexport function setPreviewData({ req, res }: SetPreviewDataConfig): void {\n\tconst ref = req.query.token || req.cookies[prismic.cookie.preview];\n\n\tif (ref) {\n\t\tres.setPreviewData({ ref });\n\t}\n}\n"],"names":["prismic.cookie.preview"],"mappings":";SAgCgB,eAAe,EAAE,KAAK,OAA2B;AAC1D,QAAA,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQA,OAAsB;AAEjE,MAAI,KAAK;AACJ,QAAA,eAAe,EAAE,IAAA,CAAK;AAAA,EAC1B;AACF;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/next",
3
- "version": "1.1.0-alpha.0",
3
+ "version": "1.1.0-alpha.1",
4
4
  "description": "Helpers to integrate Prismic into Next.js apps",
5
5
  "keywords": [
6
6
  "typescript",
@@ -52,10 +52,10 @@
52
52
  "test": "npm run lint && npm run types && npm run unit && npm run build && npm run size"
53
53
  },
54
54
  "dependencies": {
55
- "@prismicio/client": "^7.0.0-alpha.2",
56
55
  "imgix-url-builder": "^0.0.3"
57
56
  },
58
57
  "devDependencies": {
58
+ "@prismicio/client": "^7.0.0-alpha.3",
59
59
  "@prismicio/mock": "^0.2.0",
60
60
  "@size-limit/preset-small-lib": "^8.2.4",
61
61
  "@types/react-test-renderer": "^18.0.0",
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from "react";
4
4
  import * as prismic from "@prismicio/client";
5
- import Link, { LinkProps } from "next/link";
5
+ import Link from "next/link";
6
6
 
7
7
  export type PrismicNextLinkProps = Omit<
8
8
  React.ComponentProps<typeof Link>,
@@ -12,19 +12,19 @@ export type PrismicNextLinkProps = Omit<
12
12
  rel?: string | prismic.AsLinkAttrsConfig["rel"];
13
13
  } & (
14
14
  | {
15
- document: prismic.PrismicDocument | null | undefined;
15
+ field: prismic.LinkField | null | undefined;
16
+ document?: never;
16
17
  href?: never;
17
- field?: never;
18
18
  }
19
19
  | {
20
- field: prismic.LinkField | null | undefined;
20
+ field?: never;
21
+ document: prismic.PrismicDocument | null | undefined;
21
22
  href?: never;
22
- document?: never;
23
23
  }
24
24
  | {
25
- href: LinkProps["href"];
26
- field?: prismic.LinkField | null | undefined;
25
+ field?: never;
27
26
  document?: never;
27
+ href: React.ComponentProps<typeof Link>["href"];
28
28
  }
29
29
  );
30
30
 
@@ -44,12 +44,12 @@ export const PrismicNextLink = React.forwardRef<
44
44
  rel: typeof restProps.rel === "function" ? restProps.rel : undefined,
45
45
  });
46
46
 
47
- let rel: string | undefined = computedRel;
47
+ const href = ("href" in restProps ? restProps.href : computedHref) || "";
48
+
49
+ let rel = computedRel;
48
50
  if ("rel" in restProps && typeof restProps.rel !== "function") {
49
51
  rel = restProps.rel;
50
52
  }
51
53
 
52
- const href = ("href" in restProps ? restProps.href : computedHref) || "";
53
-
54
54
  return <Link ref={ref} {...attrs} {...restProps} href={href} rel={rel} />;
55
55
  });
@@ -1,26 +1,26 @@
1
1
  // Exports in this file are unsupported in the react-server environment.
2
2
  // All environments should export the same functions to maintian API compatability.
3
3
 
4
- function buildErrorMessage(fnName: string) {
4
+ function buildIncompatiblePreviewModeError(fnName: string) {
5
5
  return `${fnName} is currently incompatible with App Router. Preview Mode is not supported in App Router at this time. Please remove all uses of ${fnName}.`;
6
6
  }
7
7
 
8
8
  export function PrismicPreview(): JSX.Element {
9
- throw new Error(buildErrorMessage("<PrismicPreview>"));
9
+ throw new Error(buildIncompatiblePreviewModeError("<PrismicPreview>"));
10
10
  }
11
11
 
12
12
  export function enableAutoPreviews() {
13
- throw new Error(buildErrorMessage("enableAutoPreviews()"));
13
+ throw new Error(buildIncompatiblePreviewModeError("enableAutoPreviews()"));
14
14
  }
15
15
 
16
16
  export function exitPreview() {
17
- throw new Error(buildErrorMessage("exitPreview()"));
17
+ throw new Error(buildIncompatiblePreviewModeError("exitPreview()"));
18
18
  }
19
19
 
20
20
  export function redirectToPreviewURL() {
21
- throw new Error(buildErrorMessage("redirectToPreviewURL()"));
21
+ throw new Error(buildIncompatiblePreviewModeError("redirectToPreviewURL()"));
22
22
  }
23
23
 
24
24
  export function setPreviewData() {
25
- throw new Error(buildErrorMessage("setPreviewData()"));
25
+ throw new Error(buildIncompatiblePreviewModeError("setPreviewData()"));
26
26
  }