@prismicio/react 3.2.2-pr.241.0f293b1 → 3.2.2-pr.241.fab3732
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.
- package/dist/PrismicImage.d.ts +60 -58
- package/dist/PrismicImage.d.ts.map +1 -0
- package/dist/PrismicImage.js +54 -47
- package/dist/PrismicImage.js.map +1 -1
- package/dist/PrismicLink.d.ts +63 -67
- package/dist/PrismicLink.d.ts.map +1 -0
- package/dist/PrismicLink.js +59 -40
- package/dist/PrismicLink.js.map +1 -1
- package/dist/PrismicRichText.d.ts +69 -63
- package/dist/PrismicRichText.d.ts.map +1 -0
- package/dist/PrismicRichText.js +125 -71
- package/dist/PrismicRichText.js.map +1 -1
- package/dist/PrismicTable.d.ts +53 -49
- package/dist/PrismicTable.d.ts.map +1 -0
- package/dist/PrismicTable.js +68 -21
- package/dist/PrismicTable.js.map +1 -1
- package/dist/PrismicText.d.ts +16 -11
- package/dist/PrismicText.d.ts.map +1 -0
- package/dist/PrismicText.js +30 -23
- package/dist/PrismicText.js.map +1 -1
- package/dist/PrismicToolbar.d.ts +12 -7
- package/dist/PrismicToolbar.d.ts.map +1 -0
- package/dist/PrismicToolbar.js +32 -19
- package/dist/PrismicToolbar.js.map +1 -1
- package/dist/SliceZone.d.ts +52 -47
- package/dist/SliceZone.d.ts.map +1 -0
- package/dist/SliceZone.js +54 -27
- package/dist/SliceZone.js.map +1 -1
- package/dist/index.d.ts +9 -15
- package/dist/index.js +4 -14
- package/dist/lib/devMsg.js +23 -6
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/package.js +6 -0
- package/dist/package.js.map +1 -0
- package/package.json +19 -39
- package/src/PrismicImage.tsx +3 -3
- package/src/PrismicLink.tsx +5 -5
- package/src/PrismicRichText.tsx +15 -17
- package/src/PrismicTable.tsx +9 -9
- package/src/PrismicText.tsx +2 -2
- package/src/PrismicToolbar.tsx +1 -1
- package/src/SliceZone.tsx +2 -2
- package/src/lib/devMsg.ts +1 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/devMsg.d.ts +0 -16
- package/dist/package.json.js +0 -5
- package/dist/package.json.js.map +0 -1
package/dist/PrismicImage.d.ts
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentProps, FC, ReactNode } from "react";
|
|
2
|
+
import { ImageFieldImage, asImagePixelDensitySrcSet, asImageWidthSrcSet } from "@prismicio/client";
|
|
3
|
+
|
|
4
|
+
//#region src/PrismicImage.d.ts
|
|
3
5
|
type ImgixURLParams = Omit<NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>, "widths"> & Omit<NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>, "pixelDensities">;
|
|
4
6
|
/** Props for `<PrismicImage>`. */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
fallback?: ReactNode;
|
|
7
|
+
type PrismicImageProps = Omit<ComponentProps<"img">, "src" | "srcset" | "alt"> & {
|
|
8
|
+
/** The Prismic image field or thumbnail to render. */
|
|
9
|
+
field: ImageFieldImage | null | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* An object of Imgix URL API parameters to transform the image.
|
|
12
|
+
*
|
|
13
|
+
* See: https://docs.imgix.com/apis/rendering
|
|
14
|
+
*/
|
|
15
|
+
imgixParams?: { [P in keyof ImgixURLParams]: ImgixURLParams[P] | null };
|
|
16
|
+
/**
|
|
17
|
+
* Declare an image as decorative by providing `alt=""`.
|
|
18
|
+
*
|
|
19
|
+
* See:
|
|
20
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
|
|
21
|
+
*/
|
|
22
|
+
alt?: "";
|
|
23
|
+
/**
|
|
24
|
+
* Declare an image as decorative only if the image field does not have
|
|
25
|
+
* alternative text by providing `fallbackAlt=""`.
|
|
26
|
+
*
|
|
27
|
+
* See:
|
|
28
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images
|
|
29
|
+
*/
|
|
30
|
+
fallbackAlt?: "";
|
|
31
|
+
/**
|
|
32
|
+
* The value to be rendered when the field is empty. If a fallback is not
|
|
33
|
+
* given, `null` will be rendered.
|
|
34
|
+
*/
|
|
35
|
+
fallback?: ReactNode;
|
|
36
36
|
} & ({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Widths (in pixels) used to build a `srcset` value for the image
|
|
39
|
+
* field.
|
|
40
|
+
*
|
|
41
|
+
* If omitted or set to `"defaults"`, the following widths will be used:
|
|
42
|
+
* 640, 750, 828, 1080, 1200, 1920, 2048, 3840.
|
|
43
|
+
*
|
|
44
|
+
* If the image field contains responsive views, each responsive view
|
|
45
|
+
* can be used as a width in the resulting `srcset` by passing
|
|
46
|
+
* `"thumbnails"` as the `widths` prop.
|
|
47
|
+
*/
|
|
48
|
+
widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "defaults";
|
|
49
|
+
/** Not used when the `widths` prop is used. */
|
|
50
|
+
pixelDensities?: never;
|
|
51
51
|
} | {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
/** Not used when the `widths` prop is used. */
|
|
53
|
+
widths?: never;
|
|
54
|
+
/**
|
|
55
|
+
* Pixel densities used to build a `srcset` value for the image field.
|
|
56
|
+
*
|
|
57
|
+
* If a `pixelDensities` prop is passed `"defaults"`, the following
|
|
58
|
+
* pixel densities will be used: 1, 2, 3.
|
|
59
|
+
*/
|
|
60
|
+
pixelDensities: NonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>["pixelDensities"] | "defaults";
|
|
61
61
|
});
|
|
62
62
|
/**
|
|
63
63
|
* Renders an optimized image from a Prismic image field.
|
|
@@ -70,5 +70,7 @@ export type PrismicImageProps = Omit<ComponentProps<"img">, "src" | "srcset" | "
|
|
|
70
70
|
*
|
|
71
71
|
* @see Learn how to optimize images with imgix, use responsive images, and use framework-specific image components: {@link https://prismic.io/docs/fields/image}
|
|
72
72
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
declare const PrismicImage: FC<PrismicImageProps>;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { PrismicImage, PrismicImageProps };
|
|
76
|
+
//# sourceMappingURL=PrismicImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicImage.d.ts","names":[],"sources":["../src/PrismicImage.tsx"],"sourcesContent":[],"mappings":";;;;KAiBK,cAAA,GAAiB,KACrB,YAAY,kBAAkB,qCAG9B,KACC,YAAY,kBAAkB;;AAL3B,KAUO,iBAAA,GAAoB,IAVb,CAWlB,cAXkB,CAAA,KAAA,CAAA,EAAA,KAAA,GAAA,QAAA,GAAA,KAAA,CAAA,GAAA;EACY;EAAlB,KAAA,EAcL,eAdK,GAAA,IAAA,GAAA,SAAA;EAAZ;;;;;EAGA,WAAA,CAAA,EAAA,QAAI,MAkBwB,cAlBxB,GAkByC,cAlBzC,CAkBwD,CAlBxD,CAAA,GAAA,IAAA,EAMO;EACX;;;;;;EAkCW,GAAA,CAAA,EAAA,EAAA;EAeyB;;;;;;;EAiCxB,WAAA,CAAA,EAAA,EAmFZ;;;;;aAnIW;;;;;;;;;;;;;WAeL,YAAY,kBAAkB;;;;;;;;;;;;kBAe9B,YACA,kBAAkB;;;;;;;;;;;;;cAiBZ,cAAc,GAAG"}
|
package/dist/PrismicImage.js
CHANGED
|
@@ -1,50 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { devMsg } from "./lib/devMsg.js";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { asImagePixelDensitySrcSet, asImageWidthSrcSet, isFilled } from "@prismicio/client";
|
|
4
4
|
import { DEV } from "esm-env";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
5
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/PrismicImage.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Renders an optimized image from a Prismic image field.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PrismicImage field={slice.primary.photo} />;
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @see Learn how to optimize images with imgix, use responsive images, and use framework-specific image components: {@link https://prismic.io/docs/fields/image}
|
|
18
|
+
*/
|
|
19
|
+
const PrismicImage = forwardRef(function PrismicImage$1(props, ref) {
|
|
20
|
+
const { field, alt, fallbackAlt, imgixParams = {}, widths, pixelDensities, fallback, ...restProps } = props;
|
|
21
|
+
if (DEV) {
|
|
22
|
+
if (typeof alt === "string" && alt !== "") console.warn(`[PrismicImage] The "alt" prop can only be used to declare an image as decorative by passing an empty string (alt="") but was provided a non-empty string. You can resolve this warning by removing the "alt" prop or changing it to alt="". For more details, see ${devMsg("alt-must-be-an-empty-string")}`);
|
|
23
|
+
if (typeof fallbackAlt === "string" && fallbackAlt !== "") console.warn(`[PrismicImage] The "fallbackAlt" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt="") but was provided a non-empty string. You can resolve this warning by removing the "fallbackAlt" prop or changing it to fallbackAlt="". For more details, see ${devMsg("alt-must-be-an-empty-string")}`);
|
|
24
|
+
if (widths && pixelDensities) console.warn(`[PrismicImage] Only one of "widths" or "pixelDensities" props can be provided. You can resolve this warning by removing either the "widths" or "pixelDensities" prop. "widths" will be used in this case.`);
|
|
25
|
+
}
|
|
26
|
+
if (!isFilled.imageThumbnail(field)) return /* @__PURE__ */ jsx(Fragment$1, { children: fallback });
|
|
27
|
+
const resolvedImgixParams = imgixParams;
|
|
28
|
+
for (const x in imgixParams) if (resolvedImgixParams[x] === null) resolvedImgixParams[x] = void 0;
|
|
29
|
+
let src;
|
|
30
|
+
let srcSet;
|
|
31
|
+
if (widths || !pixelDensities) {
|
|
32
|
+
const res = asImageWidthSrcSet(field, {
|
|
33
|
+
...resolvedImgixParams,
|
|
34
|
+
widths: widths === "defaults" ? void 0 : widths
|
|
35
|
+
});
|
|
36
|
+
src = res.src;
|
|
37
|
+
srcSet = res.srcset;
|
|
38
|
+
} else if (pixelDensities) {
|
|
39
|
+
const res = asImagePixelDensitySrcSet(field, {
|
|
40
|
+
...resolvedImgixParams,
|
|
41
|
+
pixelDensities: pixelDensities === "defaults" ? void 0 : pixelDensities
|
|
42
|
+
});
|
|
43
|
+
src = res.src;
|
|
44
|
+
srcSet = res.srcset;
|
|
45
|
+
}
|
|
46
|
+
return /* @__PURE__ */ jsx("img", {
|
|
47
|
+
ref,
|
|
48
|
+
src,
|
|
49
|
+
srcSet,
|
|
50
|
+
alt: alt ?? (field.alt || fallbackAlt),
|
|
51
|
+
...restProps
|
|
52
|
+
});
|
|
46
53
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=PrismicImage.js.map
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { PrismicImage };
|
|
57
|
+
//# sourceMappingURL=PrismicImage.js.map
|
package/dist/PrismicImage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicImage.js","sources":["../src/PrismicImage.tsx"],"sourcesContent":["import {\n\
|
|
1
|
+
{"version":3,"file":"PrismicImage.js","names":["PrismicImage"],"sources":["../src/PrismicImage.tsx"],"sourcesContent":["import {\n\ttype ForwardedRef,\n\tforwardRef,\n\ttype ComponentProps,\n\ttype FC,\n\ttype ReactNode,\n} from \"react\";\nimport {\n\ttype ImageFieldImage,\n\tasImagePixelDensitySrcSet,\n\tasImageWidthSrcSet,\n\tisFilled,\n} from \"@prismicio/client\";\nimport { DEV } from \"esm-env\";\n\nimport { devMsg } from \"./lib/devMsg.js\";\n\ntype ImgixURLParams = Omit<\n\tNonNullable<Parameters<typeof asImageWidthSrcSet>[1]>,\n\t\"widths\"\n> &\n\tOmit<\n\t\tNonNullable<Parameters<typeof asImagePixelDensitySrcSet>[1]>,\n\t\t\"pixelDensities\"\n\t>;\n\n/** Props for `<PrismicImage>`. */\nexport type PrismicImageProps = Omit<\n\tComponentProps<\"img\">,\n\t\"src\" | \"srcset\" | \"alt\"\n> & {\n\t/** The Prismic image field or thumbnail to render. */\n\tfield: ImageFieldImage | null | undefined;\n\n\t/**\n\t * An object of Imgix URL API parameters to transform the image.\n\t *\n\t * See: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: { [P in keyof ImgixURLParams]: ImgixURLParams[P] | null };\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\";\n\n\t/**\n\t * Declare an image as decorative only if the image field does not have\n\t * alternative text by providing `fallbackAlt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\";\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: ReactNode;\n} & (\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * Widths (in pixels) used to build a `srcset` value for the image\n\t\t\t\t * field.\n\t\t\t\t *\n\t\t\t\t * If omitted or set to `\"defaults\"`, the following widths will be used:\n\t\t\t\t * 640, 750, 828, 1080, 1200, 1920, 2048, 3840.\n\t\t\t\t *\n\t\t\t\t * If the image field contains responsive views, each responsive view\n\t\t\t\t * can be used as a width in the resulting `srcset` by passing\n\t\t\t\t * `\"thumbnails\"` as the `widths` prop.\n\t\t\t\t */\n\t\t\t\twidths?:\n\t\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t\t| \"defaults\";\n\t\t\t\t/** Not used when the `widths` prop is used. */\n\t\t\t\tpixelDensities?: never;\n\t\t }\n\t\t| {\n\t\t\t\t/** Not used when the `widths` prop is used. */\n\t\t\t\twidths?: never;\n\t\t\t\t/**\n\t\t\t\t * Pixel densities used to build a `srcset` value for the image field.\n\t\t\t\t *\n\t\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following\n\t\t\t\t * pixel densities will be used: 1, 2, 3.\n\t\t\t\t */\n\t\t\t\tpixelDensities:\n\t\t\t\t\t| NonNullable<\n\t\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t\t| \"defaults\";\n\t\t }\n\t);\n\n/**\n * Renders an optimized image from a Prismic image field.\n *\n * @example\n *\n * ```tsx\n * <PrismicImage field={slice.primary.photo} />;\n * ```\n *\n * @see Learn how to optimize images with imgix, use responsive images, and use framework-specific image components: {@link https://prismic.io/docs/fields/image}\n */\nexport const PrismicImage: FC<PrismicImageProps> = forwardRef(\n\tfunction PrismicImage(\n\t\tprops: PrismicImageProps,\n\t\tref: ForwardedRef<HTMLImageElement>,\n\t) {\n\t\tconst {\n\t\t\tfield,\n\t\t\talt,\n\t\t\tfallbackAlt,\n\t\t\timgixParams = {},\n\t\t\twidths,\n\t\t\tpixelDensities,\n\t\t\tfallback,\n\t\t\t...restProps\n\t\t} = props;\n\n\t\tif (DEV) {\n\t\t\tif (typeof alt === \"string\" && alt !== \"\") {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicImage] The \"alt\" prop can only be used to declare an image as decorative by passing an empty string (alt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"alt\" prop or changing it to alt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (typeof fallbackAlt === \"string\" && fallbackAlt !== \"\") {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicImage] The \"fallbackAlt\" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"fallbackAlt\" prop or changing it to fallbackAlt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (widths && pixelDensities) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicImage] Only one of \"widths\" or \"pixelDensities\" props can be provided. You can resolve this warning by removing either the \"widths\" or \"pixelDensities\" prop. \"widths\" will be used in this case.`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (!isFilled.imageThumbnail(field)) {\n\t\t\treturn <>{fallback}</>;\n\t\t}\n\n\t\tconst resolvedImgixParams = imgixParams;\n\t\tfor (const x in imgixParams) {\n\t\t\tif (resolvedImgixParams[x as keyof typeof resolvedImgixParams] === null) {\n\t\t\t\tresolvedImgixParams[x as keyof typeof resolvedImgixParams] = undefined;\n\t\t\t}\n\t\t}\n\n\t\tlet src: string | undefined;\n\t\tlet srcSet: string | undefined;\n\n\t\tif (widths || !pixelDensities) {\n\t\t\tconst res = asImageWidthSrcSet(field, {\n\t\t\t\t...resolvedImgixParams,\n\t\t\t\twidths: widths === \"defaults\" ? undefined : widths,\n\t\t\t} as ImgixURLParams);\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t} else if (pixelDensities) {\n\t\t\tconst res = asImagePixelDensitySrcSet(field, {\n\t\t\t\t...resolvedImgixParams,\n\t\t\t\tpixelDensities:\n\t\t\t\t\tpixelDensities === \"defaults\" ? undefined : pixelDensities,\n\t\t\t} as ImgixURLParams);\n\n\t\t\tsrc = res.src;\n\t\t\tsrcSet = res.srcset;\n\t\t}\n\n\t\treturn (\n\t\t\t<img\n\t\t\t\tref={ref}\n\t\t\t\tsrc={src}\n\t\t\t\tsrcSet={srcSet}\n\t\t\t\talt={alt ?? (field.alt || fallbackAlt)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t},\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;AA8GA,MAAa,eAAsC,WAClD,SAASA,eACR,OACA,KACC;CACD,MAAM,EACL,OACA,KACA,aACA,cAAc,EAAE,EAChB,QACA,gBACA,UACA,GAAG,cACA;AAEJ,KAAI,KAAK;AACR,MAAI,OAAO,QAAQ,YAAY,QAAQ,GACtC,SAAQ,KACP,qQAAqQ,OACpQ,8BACA,GACD;AAGF,MAAI,OAAO,gBAAgB,YAAY,gBAAgB,GACtD,SAAQ,KACP,qSAAqS,OACpS,8BACA,GACD;AAGF,MAAI,UAAU,eACb,SAAQ,KACP,4MACA;;AAIH,KAAI,CAAC,SAAS,eAAe,MAAM,CAClC,QAAO,4CAAG,WAAY;CAGvB,MAAM,sBAAsB;AAC5B,MAAK,MAAM,KAAK,YACf,KAAI,oBAAoB,OAA2C,KAClE,qBAAoB,KAAyC;CAI/D,IAAI;CACJ,IAAI;AAEJ,KAAI,UAAU,CAAC,gBAAgB;EAC9B,MAAM,MAAM,mBAAmB,OAAO;GACrC,GAAG;GACH,QAAQ,WAAW,aAAa,SAAY;GAC5C,CAAmB;AAEpB,QAAM,IAAI;AACV,WAAS,IAAI;YACH,gBAAgB;EAC1B,MAAM,MAAM,0BAA0B,OAAO;GAC5C,GAAG;GACH,gBACC,mBAAmB,aAAa,SAAY;GAC7C,CAAmB;AAEpB,QAAM,IAAI;AACV,WAAS,IAAI;;AAGd,QACC,oBAAC;EACK;EACA;EACG;EACR,KAAK,QAAQ,MAAM,OAAO;EAC1B,GAAI;GACH;EAGJ"}
|
package/dist/PrismicLink.d.ts
CHANGED
|
@@ -1,67 +1,69 @@
|
|
|
1
1
|
import { ComponentProps, ComponentType, ForwardedRef, HTMLAttributeAnchorTarget, ReactNode } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { AsLinkAttrsConfig, LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client";
|
|
3
|
+
|
|
4
|
+
//#region src/PrismicLink.d.ts
|
|
3
5
|
/** The default component rendered for internal and external links. */
|
|
4
6
|
declare const defaultComponent = "a";
|
|
5
7
|
/** Props provided to a component when rendered with `<PrismicLink>`. */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
interface LinkProps {
|
|
9
|
+
/** The URL to link. */
|
|
10
|
+
href: string;
|
|
11
|
+
/**
|
|
12
|
+
* The `target` attribute for anchor elements. If the Prismic field is
|
|
13
|
+
* configured to open in a new window, this prop defaults to `_blank`.
|
|
14
|
+
*/
|
|
15
|
+
target?: HTMLAttributeAnchorTarget;
|
|
16
|
+
/**
|
|
17
|
+
* The `rel` attribute for anchor elements. If the `target` prop is set to
|
|
18
|
+
* `"_blank"`, this prop defaults to `"noopener noreferrer"`.
|
|
19
|
+
*/
|
|
20
|
+
rel?: string;
|
|
21
|
+
/** Children for the component. */
|
|
22
|
+
children?: ReactNode;
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
24
|
+
type PrismicLinkProps<InternalComponentProps = ComponentProps<typeof defaultComponent>, ExternalComponentProps = ComponentProps<typeof defaultComponent>> = Omit<InternalComponentProps & ExternalComponentProps, "rel" | "href" | "children"> & {
|
|
25
|
+
/**
|
|
26
|
+
* The `rel` attribute for the link. By default, `"noreferrer"` is provided if
|
|
27
|
+
* the link's URL is external. This prop can be provided a function to use the
|
|
28
|
+
* link's metadata to determine the `rel` value.
|
|
29
|
+
*/
|
|
30
|
+
rel?: string | AsLinkAttrsConfig["rel"];
|
|
31
|
+
/**
|
|
32
|
+
* The link resolver used to resolve links.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
36
|
+
* repository's content, a link resolver does not need to be provided.
|
|
37
|
+
*
|
|
38
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
39
|
+
*/
|
|
40
|
+
linkResolver?: LinkResolverFunction;
|
|
41
|
+
/**
|
|
42
|
+
* The component rendered for internal URLs. Defaults to `<a>`.
|
|
43
|
+
*
|
|
44
|
+
* If your app uses a client-side router that requires a special Link
|
|
45
|
+
* component, provide the Link component to this prop.
|
|
46
|
+
*/
|
|
47
|
+
internalComponent?: ComponentType<InternalComponentProps>;
|
|
48
|
+
/** The component rendered for external URLs. Defaults to `<a>`. */
|
|
49
|
+
externalComponent?: ComponentType<ExternalComponentProps>;
|
|
50
|
+
/**
|
|
51
|
+
* The children to render for the link. If no children are provided, the
|
|
52
|
+
* link's `text` property will be used.
|
|
53
|
+
*/
|
|
54
|
+
children?: ReactNode;
|
|
53
55
|
} & ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
document: PrismicDocument | null | undefined;
|
|
57
|
+
href?: never;
|
|
58
|
+
field?: never;
|
|
57
59
|
} | {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
field: LinkField | null | undefined;
|
|
61
|
+
href?: never;
|
|
62
|
+
document?: never;
|
|
61
63
|
} | {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
href: LinkProps["href"];
|
|
65
|
+
field?: LinkField | null | undefined;
|
|
66
|
+
document?: never;
|
|
65
67
|
});
|
|
66
68
|
/**
|
|
67
69
|
* Renders a link from a Prismic link field or page.
|
|
@@ -74,15 +76,9 @@ export type PrismicLinkProps<InternalComponentProps = ComponentProps<typeof defa
|
|
|
74
76
|
*
|
|
75
77
|
* @see Learn how to display links and use variants for styling: {@link https://prismic.io/docs/fields/link}
|
|
76
78
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
declare const PrismicLink: <InternalComponentProps = ComponentProps<typeof defaultComponent>, ExternalComponentProps = ComponentProps<typeof defaultComponent>>(props: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {
|
|
80
|
+
ref?: ForwardedRef<Element>;
|
|
79
81
|
}) => ReactNode;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
* @param url - The URL to check if internal or external.
|
|
84
|
-
*
|
|
85
|
-
* @returns `true` if `url` is internal, `false` otherwise.
|
|
86
|
-
*/
|
|
87
|
-
export declare function isInternalURL(url: string): boolean;
|
|
88
|
-
export {};
|
|
82
|
+
//#endregion
|
|
83
|
+
export { LinkProps, PrismicLink, PrismicLinkProps };
|
|
84
|
+
//# sourceMappingURL=PrismicLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrismicLink.d.ts","names":[],"sources":["../src/PrismicLink.tsx"],"sourcesContent":[],"mappings":";;;;;cAoBM,gBAAA;AANqB;AASV,UAAA,SAAA,CAQP;EAYE;EACoC,IAAA,EAAA,MAAA;EAAtB;;;;EAGA,MAAA,CAAA,EAhBhB,yBAgBgB;EADtB;;;;EA4BiB,GAAA,CAAA,EAAA,MAAA;EAGc;EAAd,QAAA,CAAA,EArCT,SAqCS;;AASP,KA3CF,gBA2CE,CAAA,yBA1CY,cA0CZ,CAAA,OA1CkC,gBA0ClC,CAAA,EAAA,yBAzCY,cAyCZ,CAAA,OAzCkC,gBAyClC,CAAA,CAAA,GAxCV,IAwCU,CAvCb,sBAuCa,GAvCY,sBAuCZ,EAAA,KAAA,GAAA,MAAA,GAAA,UAAA,CAAA,GAAA;EAKH;;;;AAsBX;EAsFgD,GAAA,CAAA,EAAA,MAAA,GAhJhC,iBAgJgC,CAAA,KAAA,CAAA;EAAtB;;;;;;;;;EAMZ,YAAA,CAAA,EA3IE,oBA2IF;;;;;;;sBAnIO,cAAc;;sBAGd,cAAc;;;;;aAMvB;;YAGE;;;;SAKH;;;;QAKD;UACE;;;;;;;;;;;;;;cAgBC,uCAsFa,sBAAsB,4CACtB,sBAAsB,0BAExC,iBAAiB,wBAAwB;QACzC,aAAa;MAEhB"}
|
package/dist/PrismicLink.js
CHANGED
|
@@ -1,47 +1,66 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { devMsg } from "./lib/devMsg.js";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { asLinkAttrs } from "@prismicio/client";
|
|
4
4
|
import { DEV } from "esm-env";
|
|
5
|
-
import {
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/PrismicLink.tsx
|
|
8
|
+
/** The default component rendered for internal and external links. */
|
|
6
9
|
const defaultComponent = "a";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Renders a link from a Prismic link field or page.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <PrismicLink field={slice.primary.link}>Click here</PrismicLink>;
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @see Learn how to display links and use variants for styling: {@link https://prismic.io/docs/fields/link}
|
|
20
|
+
*/
|
|
21
|
+
const PrismicLink = forwardRef(function PrismicLink$1(props, ref) {
|
|
22
|
+
const { field, document: doc, linkResolver, internalComponent, externalComponent, children, ...restProps } = props;
|
|
23
|
+
if (DEV) {
|
|
24
|
+
if (field) {
|
|
25
|
+
if (!field.link_type) {
|
|
26
|
+
console.error(`[PrismicLink] This "field" prop value caused an error to be thrown.\n`, field);
|
|
27
|
+
throw new Error(`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg("missing-link-properties")}`);
|
|
28
|
+
} else if (("text" in field ? Object.keys(field).length > 2 : Object.keys(field).length > 1) && !("url" in field || "uid" in field || "id" in field)) console.warn(`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg("missing-link-properties")}`, field);
|
|
29
|
+
} else if (doc) {
|
|
30
|
+
if (!("url" in doc || "id" in doc)) console.warn(`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg("missing-link-properties")}`, doc);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const { href: computedHref, rel: computedRel, ...attrs } = asLinkAttrs(field ?? doc, {
|
|
34
|
+
linkResolver,
|
|
35
|
+
rel: typeof restProps.rel === "function" ? restProps.rel : void 0
|
|
36
|
+
});
|
|
37
|
+
let rel = computedRel;
|
|
38
|
+
if ("rel" in restProps && typeof restProps.rel !== "function") rel = restProps.rel;
|
|
39
|
+
const href = ("href" in restProps ? restProps.href : computedHref) || "";
|
|
40
|
+
const InternalComponent = internalComponent || defaultComponent;
|
|
41
|
+
const ExternalComponent = externalComponent || defaultComponent;
|
|
42
|
+
return /* @__PURE__ */ jsx(href ? isInternalURL(href) ? InternalComponent : ExternalComponent : InternalComponent, {
|
|
43
|
+
ref,
|
|
44
|
+
...attrs,
|
|
45
|
+
...restProps,
|
|
46
|
+
href,
|
|
47
|
+
rel,
|
|
48
|
+
children: "children" in props ? children : field?.text
|
|
49
|
+
});
|
|
37
50
|
});
|
|
51
|
+
/**
|
|
52
|
+
* Determines if a URL is internal or external.
|
|
53
|
+
*
|
|
54
|
+
* @param url - The URL to check if internal or external.
|
|
55
|
+
*
|
|
56
|
+
* @returns `true` if `url` is internal, `false` otherwise.
|
|
57
|
+
*/
|
|
38
58
|
function isInternalURL(url) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
59
|
+
const isInternal = /^(\/(?!\/)|#)/.test(url);
|
|
60
|
+
const isSpecialLink = !isInternal && !/^https?:\/\//.test(url);
|
|
61
|
+
return isInternal && !isSpecialLink;
|
|
42
62
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=PrismicLink.js.map
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { PrismicLink };
|
|
66
|
+
//# sourceMappingURL=PrismicLink.js.map
|
package/dist/PrismicLink.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.js","sources":["../src/PrismicLink.tsx"],"sourcesContent":["import {\n\
|
|
1
|
+
{"version":3,"file":"PrismicLink.js","names":["PrismicLink"],"sources":["../src/PrismicLink.tsx"],"sourcesContent":["import {\n\ttype ComponentProps,\n\ttype ComponentType,\n\ttype ForwardedRef,\n\ttype HTMLAttributeAnchorTarget,\n\ttype ReactNode,\n\tforwardRef,\n} from \"react\";\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n\ttype AsLinkAttrsConfig,\n} from \"@prismicio/client\";\nimport { DEV } from \"esm-env\";\n\nimport { devMsg } from \"./lib/devMsg.js\";\n\n/** The default component rendered for internal and external links. */\nconst defaultComponent = \"a\";\n\n/** Props provided to a component when rendered with `<PrismicLink>`. */\nexport interface LinkProps {\n\t/** The URL to link. */\n\thref: string;\n\n\t/**\n\t * The `target` attribute for anchor elements. If the Prismic field is\n\t * configured to open in a new window, this prop defaults to `_blank`.\n\t */\n\ttarget?: HTMLAttributeAnchorTarget;\n\n\t/**\n\t * The `rel` attribute for anchor elements. If the `target` prop is set to\n\t * `\"_blank\"`, this prop defaults to `\"noopener noreferrer\"`.\n\t */\n\trel?: string;\n\n\t/** Children for the component. */\n\tchildren?: ReactNode;\n}\n\nexport type PrismicLinkProps<\n\tInternalComponentProps = ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = ComponentProps<typeof defaultComponent>,\n> = Omit<\n\tInternalComponentProps & ExternalComponentProps,\n\t\"rel\" | \"href\" | \"children\"\n> & {\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"];\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction;\n\n\t/**\n\t * The component rendered for internal URLs. Defaults to `<a>`.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t */\n\tinternalComponent?: ComponentType<InternalComponentProps>;\n\n\t/** The component rendered for external URLs. Defaults to `<a>`. */\n\texternalComponent?: ComponentType<ExternalComponentProps>;\n\n\t/**\n\t * The children to render for the link. If no children are provided, the\n\t * link's `text` property will be used.\n\t */\n\tchildren?: ReactNode;\n} & (\n\t\t| {\n\t\t\t\tdocument: 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: 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?: LinkField | null | undefined;\n\t\t\t\tdocument?: never;\n\t\t }\n\t);\n\n/**\n * Renders a link from a Prismic link field or page.\n *\n * @example\n *\n * ```tsx\n * <PrismicLink field={slice.primary.link}>Click here</PrismicLink>;\n * ```\n *\n * @see Learn how to display links and use variants for styling: {@link https://prismic.io/docs/fields/link}\n */\nexport const PrismicLink = forwardRef(function PrismicLink<\n\tInternalComponentProps = ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,\n\tref: ForwardedRef<Element>,\n) {\n\tconst {\n\t\tfield,\n\t\tdocument: doc,\n\t\tlinkResolver,\n\t\tinternalComponent,\n\t\texternalComponent,\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tif (DEV) {\n\t\tif (field) {\n\t\t\tif (!field.link_type) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t`[PrismicLink] This \"field\" prop value caused an error to be thrown.\\n`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link will not render. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\t(\"text\" in field\n\t\t\t\t\t? Object.keys(field).length > 2\n\t\t\t\t\t: Object.keys(field).length > 1) &&\n\t\t\t\t!(\"url\" in field || \"uid\" in field || \"id\" in field)\n\t\t\t) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided field is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tfield,\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (doc) {\n\t\t\tif (!(\"url\" in doc || \"id\" in doc)) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[PrismicLink] The provided document is missing required properties to properly render a link. The link may not render correctly. For more details, see ${devMsg(\n\t\t\t\t\t\t\"missing-link-properties\",\n\t\t\t\t\t)}`,\n\t\t\t\t\tdoc,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst {\n\t\thref: computedHref,\n\t\trel: computedRel,\n\t\t...attrs\n\t} = asLinkAttrs(field ?? doc, {\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\tconst InternalComponent = (internalComponent ||\n\t\tdefaultComponent) as ComponentType<LinkProps>;\n\tconst ExternalComponent = (externalComponent ||\n\t\tdefaultComponent) as ComponentType<LinkProps>;\n\tconst Component = href\n\t\t? isInternalURL(href)\n\t\t\t? InternalComponent\n\t\t\t: ExternalComponent\n\t\t: InternalComponent;\n\n\treturn (\n\t\t<Component ref={ref} {...attrs} {...restProps} href={href} rel={rel}>\n\t\t\t{\"children\" in props ? children : field?.text}\n\t\t</Component>\n\t);\n}) as <\n\tInternalComponentProps = ComponentProps<typeof defaultComponent>,\n\tExternalComponentProps = ComponentProps<typeof defaultComponent>,\n>(\n\tprops: PrismicLinkProps<InternalComponentProps, ExternalComponentProps> & {\n\t\tref?: ForwardedRef<Element>;\n\t},\n) => ReactNode;\n\n/**\n * Determines if a URL is internal or external.\n *\n * @param url - The URL to check if internal or external.\n *\n * @returns `true` if `url` is internal, `false` otherwise.\n */\n// TODO: This does not detect all relative URLs as internal such as `about` or `./about`. This function assumes relative URLs start with a \"/\" or \"#\"`.\nexport function isInternalURL(url: string): boolean {\n\tconst isInternal = /^(\\/(?!\\/)|#)/.test(url);\n\tconst isSpecialLink = !isInternal && !/^https?:\\/\\//.test(url);\n\n\treturn isInternal && !isSpecialLink;\n}\n"],"mappings":";;;;;;;;AAoBA,MAAM,mBAAmB;;;;;;;;;;;;AA6FzB,MAAa,cAAc,WAAW,SAASA,cAI9C,OACA,KACC;CACD,MAAM,EACL,OACA,UAAU,KACV,cACA,mBACA,mBACA,UACA,GAAG,cACA;AAEJ,KAAI,KACH;MAAI,OACH;OAAI,CAAC,MAAM,WAAW;AACrB,YAAQ,MACP,yEACA,MACA;AACD,UAAM,IAAI,MACT,8IAA8I,OAC7I,0BACA,GACD;eAEA,UAAU,QACR,OAAO,KAAK,MAAM,CAAC,SAAS,IAC5B,OAAO,KAAK,MAAM,CAAC,SAAS,MAC/B,EAAE,SAAS,SAAS,SAAS,SAAS,QAAQ,OAE9C,SAAQ,KACP,uJAAuJ,OACtJ,0BACA,IACD,MACA;aAEQ,KACV;OAAI,EAAE,SAAS,OAAO,QAAQ,KAC7B,SAAQ,KACP,0JAA0J,OACzJ,0BACA,IACD,IACA;;;CAKJ,MAAM,EACL,MAAM,cACN,KAAK,aACL,GAAG,UACA,YAAY,SAAS,KAAK;EAC7B;EACA,KAAK,OAAO,UAAU,QAAQ,aAAa,UAAU,MAAM;EAC3D,CAAC;CAEF,IAAI,MAA0B;AAC9B,KAAI,SAAS,aAAa,OAAO,UAAU,QAAQ,WAClD,OAAM,UAAU;CAGjB,MAAM,QAAQ,UAAU,YAAY,UAAU,OAAO,iBAAiB;CAEtE,MAAM,oBAAqB,qBAC1B;CACD,MAAM,oBAAqB,qBAC1B;AAOD,QACC,oBAPiB,OACf,cAAc,KAAK,GAClB,oBACA,oBACD;EAGc;EAAK,GAAI;EAAO,GAAI;EAAiB;EAAW;YAC9D,cAAc,QAAQ,WAAW,OAAO;GAC9B;EAEZ;;;;;;;;AAiBF,SAAgB,cAAc,KAAsB;CACnD,MAAM,aAAa,gBAAgB,KAAK,IAAI;CAC5C,MAAM,gBAAgB,CAAC,cAAc,CAAC,eAAe,KAAK,IAAI;AAE9D,QAAO,cAAc,CAAC"}
|