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