@prismicio/client 7.2.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/createClient.cjs +9 -1
- package/dist/createClient.cjs.map +1 -1
- package/dist/createClient.js +9 -1
- package/dist/createClient.js.map +1 -1
- package/dist/errors/ForbiddenError.cjs.map +1 -1
- package/dist/errors/ForbiddenError.d.ts +1 -1
- package/dist/errors/ForbiddenError.js.map +1 -1
- package/dist/errors/NotFoundError.cjs.map +1 -1
- package/dist/errors/NotFoundError.d.ts +1 -1
- package/dist/errors/NotFoundError.js.map +1 -1
- package/dist/errors/ParsingError.cjs.map +1 -1
- package/dist/errors/ParsingError.d.ts +1 -1
- package/dist/errors/ParsingError.js.map +1 -1
- package/dist/errors/RefExpiredError.cjs +7 -0
- package/dist/errors/RefExpiredError.cjs.map +1 -0
- package/dist/errors/RefExpiredError.d.ts +8 -0
- package/dist/errors/RefExpiredError.js +7 -0
- package/dist/errors/RefExpiredError.js.map +1 -0
- package/dist/errors/RefNotFoundError.cjs +7 -0
- package/dist/errors/RefNotFoundError.cjs.map +1 -0
- package/dist/errors/RefNotFoundError.d.ts +8 -0
- package/dist/errors/RefNotFoundError.js +7 -0
- package/dist/errors/RefNotFoundError.js.map +1 -0
- package/dist/helpers/asHTML.cjs +43 -50
- package/dist/helpers/asHTML.cjs.map +1 -1
- package/dist/helpers/asHTML.d.ts +31 -6
- package/dist/helpers/asHTML.js +42 -49
- package/dist/helpers/asHTML.js.map +1 -1
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +1 -1
- package/dist/helpers/asImageSrc.d.ts +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs +1 -1
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -1
- package/dist/helpers/asImageWidthSrcSet.d.ts +1 -1
- package/dist/helpers/asImageWidthSrcSet.js +1 -1
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +1 -1
- package/dist/helpers/asText.cjs +2 -2
- package/dist/helpers/asText.cjs.map +1 -1
- package/dist/helpers/asText.js +1 -1
- package/dist/helpers/asText.js.map +1 -1
- package/dist/helpers/isFilled.d.ts +10 -13
- package/dist/index.cjs +8 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +28 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/serializerHelpers.cjs +91 -35
- package/dist/lib/serializerHelpers.cjs.map +1 -1
- package/dist/lib/serializerHelpers.d.ts +8 -8
- package/dist/lib/serializerHelpers.js +91 -35
- package/dist/lib/serializerHelpers.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/richtext/asText.cjs +13 -0
- package/dist/richtext/asText.cjs.map +1 -0
- package/dist/richtext/asText.d.ts +12 -0
- package/dist/richtext/asText.js +13 -0
- package/dist/richtext/asText.js.map +1 -0
- package/dist/richtext/asTree.cjs +123 -0
- package/dist/richtext/asTree.cjs.map +1 -0
- package/dist/richtext/asTree.d.ts +14 -0
- package/dist/richtext/asTree.js +123 -0
- package/dist/richtext/asTree.js.map +1 -0
- package/dist/richtext/composeSerializers.cjs +17 -0
- package/dist/richtext/composeSerializers.cjs.map +1 -0
- package/dist/richtext/composeSerializers.d.ts +16 -0
- package/dist/richtext/composeSerializers.js +17 -0
- package/dist/richtext/composeSerializers.js.map +1 -0
- package/dist/richtext/index.d.ts +7 -0
- package/dist/richtext/serialize.cjs +19 -0
- package/dist/richtext/serialize.cjs.map +1 -0
- package/dist/richtext/serialize.d.ts +19 -0
- package/dist/richtext/serialize.js +19 -0
- package/dist/richtext/serialize.js.map +1 -0
- package/dist/richtext/types.cjs +11 -0
- package/dist/richtext/types.cjs.map +1 -0
- package/dist/richtext/types.d.ts +71 -0
- package/dist/richtext/types.js +11 -0
- package/dist/richtext/types.js.map +1 -0
- package/dist/richtext/wrapMapSerializer.cjs +24 -0
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.ts +15 -0
- package/dist/richtext/wrapMapSerializer.js +24 -0
- package/dist/richtext/wrapMapSerializer.js.map +1 -0
- package/dist/richtext.cjs +15 -0
- package/dist/richtext.cjs.map +1 -0
- package/dist/richtext.js +15 -0
- package/dist/richtext.js.map +1 -0
- package/dist/types/value/image.d.ts +9 -0
- package/dist/types/value/linkToMedia.d.ts +1 -0
- package/dist/types/value/richText.cjs.map +1 -1
- package/dist/types/value/richText.d.ts +7 -0
- package/dist/types/value/richText.js.map +1 -1
- package/dist/types/value/sharedSlice.d.ts +1 -1
- package/dist/types/value/slice.d.ts +1 -1
- package/package.json +34 -15
- package/src/createClient.ts +17 -4
- package/src/errors/ForbiddenError.ts +5 -3
- package/src/errors/NotFoundError.ts +3 -1
- package/src/errors/ParsingError.ts +3 -1
- package/src/errors/RefExpiredError.ts +14 -0
- package/src/errors/RefNotFoundError.ts +14 -0
- package/src/helpers/asHTML.ts +166 -76
- package/src/helpers/asImageWidthSrcSet.ts +2 -0
- package/src/helpers/asText.ts +2 -2
- package/src/index.ts +9 -4
- package/src/lib/serializerHelpers.ts +140 -67
- package/src/richtext/asText.ts +27 -0
- package/src/richtext/asTree.ts +211 -0
- package/src/richtext/composeSerializers.ts +36 -0
- package/src/richtext/index.ts +14 -0
- package/src/richtext/serialize.ts +54 -0
- package/src/richtext/types.ts +153 -0
- package/src/richtext/wrapMapSerializer.ts +46 -0
- package/src/types/value/image.ts +9 -0
- package/src/types/value/linkToMedia.ts +1 -0
- package/src/types/value/richText.ts +7 -0
- package/src/types/value/sharedSlice.ts +1 -1
- package/src/types/value/slice.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asText.cjs","sources":["../../../src/helpers/asText.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"asText.cjs","sources":["../../../src/helpers/asText.ts"],"sourcesContent":["import { RichTextField } from \"../types/value/richText\";\n\nimport { asText as baseAsText } from \"../richtext/asText\";\n\n/**\n * Configuration that determines the output of `asText()`.\n */\ntype AsTextConfig = {\n\t/**\n\t * Separator used to join each element.\n\t *\n\t * @defaultValue ` ` (a space)\n\t */\n\tseparator?: string;\n};\n\n// TODO: Remove when we remove support for deprecated tuple-style configuration.\n/**\n * @deprecated Use object-style configuration instead.\n */\ntype AsTextDeprecatedTupleConfig = [separator?: string];\n\n/**\n * The return type of `asText()`.\n */\ntype AsTextReturnType<Field extends RichTextField | null | undefined> =\n\tField extends RichTextField ? string : null;\n\nexport const asText: {\n\t/**\n\t * Serializes a rich text or title field to a plain text string.\n\t *\n\t * @param richTextField - A rich text or title field from Prismic\n\t * @param config - Configuration that determines the output of `asText()`\n\t *\n\t * @returns Plain text equivalent of the provided rich text or title field\n\t *\n\t * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\tconfig?: AsTextConfig,\n\t): AsTextReturnType<Field>;\n\n\t/**\n\t * Serializes a rich text or title field to a plain text string.\n\t *\n\t * @deprecated Use object-style configuration instead.\n\t *\n\t * @param richTextField - A rich text or title field from Prismic\n\t * @param separator - Separator used to join each element, defaults to a space\n\t *\n\t * @returns Plain text equivalent of the provided rich text or title field\n\t *\n\t * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\t...config: AsTextDeprecatedTupleConfig\n\t): AsTextReturnType<Field>;\n} = <Field extends RichTextField | null | undefined>(\n\trichTextField: Field,\n\t// TODO: Rename to `config` when we remove support for deprecated tuple-style configuration.\n\t...configObjectOrTuple: [config?: AsTextConfig] | AsTextDeprecatedTupleConfig\n): AsTextReturnType<Field> => {\n\tif (richTextField) {\n\t\t// TODO: Remove when we remove support for deprecated tuple-style configuration.\n\t\tconst [configObjectOrSeparator] = configObjectOrTuple;\n\t\tlet config: AsTextConfig;\n\t\tif (typeof configObjectOrSeparator === \"string\") {\n\t\t\tconfig = {\n\t\t\t\tseparator: configObjectOrSeparator,\n\t\t\t};\n\t\t} else {\n\t\t\tconfig = { ...configObjectOrSeparator };\n\t\t}\n\n\t\treturn baseAsText(\n\t\t\trichTextField,\n\t\t\tconfig.separator,\n\t\t) as AsTextReturnType<Field>;\n\t} else {\n\t\treturn null as AsTextReturnType<Field>;\n\t}\n};\n"],"names":["baseAsText"],"mappings":";;;AA4Ba,MAAA,SAgCT,CACH,kBAEG,wBACyB;AAC5B,MAAI,eAAe;AAEZ,UAAA,CAAC,uBAAuB,IAAI;AAC9B,QAAA;AACA,QAAA,OAAO,4BAA4B,UAAU;AACvC,eAAA;AAAA,QACR,WAAW;AAAA,MAAA;AAAA,WAEN;AACG,eAAA,EAAE,GAAG;IACd;AAEM,WAAAA,gBACN,eACA,OAAO,SAAS;AAAA,EAAA,OAEX;AACC,WAAA;AAAA,EACP;AACF;;"}
|
package/dist/helpers/asText.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asText.js","sources":["../../../src/helpers/asText.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"asText.js","sources":["../../../src/helpers/asText.ts"],"sourcesContent":["import { RichTextField } from \"../types/value/richText\";\n\nimport { asText as baseAsText } from \"../richtext/asText\";\n\n/**\n * Configuration that determines the output of `asText()`.\n */\ntype AsTextConfig = {\n\t/**\n\t * Separator used to join each element.\n\t *\n\t * @defaultValue ` ` (a space)\n\t */\n\tseparator?: string;\n};\n\n// TODO: Remove when we remove support for deprecated tuple-style configuration.\n/**\n * @deprecated Use object-style configuration instead.\n */\ntype AsTextDeprecatedTupleConfig = [separator?: string];\n\n/**\n * The return type of `asText()`.\n */\ntype AsTextReturnType<Field extends RichTextField | null | undefined> =\n\tField extends RichTextField ? string : null;\n\nexport const asText: {\n\t/**\n\t * Serializes a rich text or title field to a plain text string.\n\t *\n\t * @param richTextField - A rich text or title field from Prismic\n\t * @param config - Configuration that determines the output of `asText()`\n\t *\n\t * @returns Plain text equivalent of the provided rich text or title field\n\t *\n\t * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\tconfig?: AsTextConfig,\n\t): AsTextReturnType<Field>;\n\n\t/**\n\t * Serializes a rich text or title field to a plain text string.\n\t *\n\t * @deprecated Use object-style configuration instead.\n\t *\n\t * @param richTextField - A rich text or title field from Prismic\n\t * @param separator - Separator used to join each element, defaults to a space\n\t *\n\t * @returns Plain text equivalent of the provided rich text or title field\n\t *\n\t * @see Templating rich text and title fields from Prismic {@link https://prismic.io/docs/template-content-vanilla-javascript#rich-text-and-title}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\t...config: AsTextDeprecatedTupleConfig\n\t): AsTextReturnType<Field>;\n} = <Field extends RichTextField | null | undefined>(\n\trichTextField: Field,\n\t// TODO: Rename to `config` when we remove support for deprecated tuple-style configuration.\n\t...configObjectOrTuple: [config?: AsTextConfig] | AsTextDeprecatedTupleConfig\n): AsTextReturnType<Field> => {\n\tif (richTextField) {\n\t\t// TODO: Remove when we remove support for deprecated tuple-style configuration.\n\t\tconst [configObjectOrSeparator] = configObjectOrTuple;\n\t\tlet config: AsTextConfig;\n\t\tif (typeof configObjectOrSeparator === \"string\") {\n\t\t\tconfig = {\n\t\t\t\tseparator: configObjectOrSeparator,\n\t\t\t};\n\t\t} else {\n\t\t\tconfig = { ...configObjectOrSeparator };\n\t\t}\n\n\t\treturn baseAsText(\n\t\t\trichTextField,\n\t\t\tconfig.separator,\n\t\t) as AsTextReturnType<Field>;\n\t} else {\n\t\treturn null as AsTextReturnType<Field>;\n\t}\n};\n"],"names":["baseAsText"],"mappings":";AA4Ba,MAAA,SAgCT,CACH,kBAEG,wBACyB;AAC5B,MAAI,eAAe;AAEZ,UAAA,CAAC,uBAAuB,IAAI;AAC9B,QAAA;AACA,QAAA,OAAO,4BAA4B,UAAU;AACvC,eAAA;AAAA,QACR,WAAW;AAAA,MAAA;AAAA,WAEN;AACG,eAAA,EAAE,GAAG;IACd;AAEM,WAAAA,SACN,eACA,OAAO,SAAS;AAAA,EAAA,OAEX;AACC,WAAA;AAAA,EACP;AACF;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ColorField } from "../types/value/color";
|
|
2
2
|
import type { ContentRelationshipField } from "../types/value/contentRelationship";
|
|
3
3
|
import type { DateField } from "../types/value/date";
|
|
4
|
-
import type { AnyOEmbed } from "../types/value/embed";
|
|
4
|
+
import type { AnyOEmbed, EmbedField } from "../types/value/embed";
|
|
5
5
|
import type { GeoPointField } from "../types/value/geoPoint";
|
|
6
6
|
import type { GroupField } from "../types/value/group";
|
|
7
7
|
import type { ImageField, ImageFieldImage } from "../types/value/image";
|
|
@@ -51,7 +51,7 @@ export declare const imageThumbnail: (thumbnail: ImageFieldImage | null | undefi
|
|
|
51
51
|
*
|
|
52
52
|
* @returns `true` if `field` is filled, `false` otherwise.
|
|
53
53
|
*/
|
|
54
|
-
export declare const image: <ThumbnailNames extends string | null = never>(field:
|
|
54
|
+
export declare const image: <ThumbnailNames extends string | null = never>(field: ImageField<ThumbnailNames> | null | undefined) => field is import("../types/value/types").Simplify<import("../types/value/image").FilledImageFieldImage & Record<Extract<ThumbnailNames, string>, import("../types/value/image").FilledImageFieldImage>>;
|
|
55
55
|
/**
|
|
56
56
|
* Determines if a link field is filled.
|
|
57
57
|
*
|
|
@@ -59,7 +59,7 @@ export declare const image: <ThumbnailNames extends string | null = never>(field
|
|
|
59
59
|
*
|
|
60
60
|
* @returns `true` if `field` is filled, `false` otherwise.
|
|
61
61
|
*/
|
|
62
|
-
export declare const link: <TypeEnum = string, LangEnum = string, DataInterface extends unknown = unknown>(field:
|
|
62
|
+
export declare const link: <TypeEnum = string, LangEnum = string, DataInterface extends unknown = unknown>(field: LinkField<TypeEnum, LangEnum, DataInterface> | null | undefined) => field is import("../types/value/link").FilledLinkToWebField | import("../types/value/linkToMedia").FilledLinkToMediaField | import("../types/value/contentRelationship").FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface>;
|
|
63
63
|
/**
|
|
64
64
|
* Determines if a link to media field is filled.
|
|
65
65
|
*
|
|
@@ -75,7 +75,7 @@ export declare const linkToMedia: (field: LinkToMediaField | null | undefined) =
|
|
|
75
75
|
*
|
|
76
76
|
* @returns `true` if `field` is filled, `false` otherwise.
|
|
77
77
|
*/
|
|
78
|
-
export declare const contentRelationship: <TypeEnum = string, LangEnum = string, DataInterface extends unknown = unknown>(field:
|
|
78
|
+
export declare const contentRelationship: <TypeEnum = string, LangEnum = string, DataInterface extends unknown = unknown>(field: ContentRelationshipField<TypeEnum, LangEnum, DataInterface> | null | undefined) => field is import("../types/value/contentRelationship").FilledContentRelationshipField<TypeEnum, LangEnum, DataInterface>;
|
|
79
79
|
/**
|
|
80
80
|
* Determines if a date field is filled.
|
|
81
81
|
*
|
|
@@ -123,7 +123,7 @@ export declare const keyText: (field: KeyTextField | null | undefined) => field
|
|
|
123
123
|
*
|
|
124
124
|
* @returns `true` if `field` is filled, `false` otherwise.
|
|
125
125
|
*/
|
|
126
|
-
export declare const select: <Enum extends string>(field: Enum |
|
|
126
|
+
export declare const select: <Enum extends string>(field: SelectField<Enum> | undefined) => field is Enum;
|
|
127
127
|
/**
|
|
128
128
|
* Determines if an embed field is filled.
|
|
129
129
|
*
|
|
@@ -131,10 +131,7 @@ export declare const select: <Enum extends string>(field: Enum | null | undefine
|
|
|
131
131
|
*
|
|
132
132
|
* @returns `true` if `field` is filled, `false` otherwise.
|
|
133
133
|
*/
|
|
134
|
-
export declare const embed: <Field extends
|
|
135
|
-
embed_url: string;
|
|
136
|
-
html: string | null;
|
|
137
|
-
})>(field: Field | null | undefined) => field is Extract<Field, AnyOEmbed & {
|
|
134
|
+
export declare const embed: <Field extends EmbedField<AnyOEmbed>>(field: Field | null | undefined) => field is Extract<Field, AnyOEmbed & {
|
|
138
135
|
embed_url: string;
|
|
139
136
|
html: string | null;
|
|
140
137
|
}>;
|
|
@@ -156,11 +153,11 @@ export declare const geoPoint: (field: GeoPointField | null | undefined) => fiel
|
|
|
156
153
|
*
|
|
157
154
|
* @returns `true` if `field` is filled, `false` otherwise.
|
|
158
155
|
*/
|
|
159
|
-
export declare const integrationField: <Data extends Record<string, unknown>>(field: Data |
|
|
156
|
+
export declare const integrationField: <Data extends Record<string, unknown>>(field: IntegrationField<Data> | undefined) => field is Data;
|
|
160
157
|
/**
|
|
161
158
|
* @deprecated Renamed to `integrationField`.
|
|
162
159
|
*/
|
|
163
|
-
export declare const integrationFields: <Data extends Record<string, unknown>>(field: Data |
|
|
160
|
+
export declare const integrationFields: <Data extends Record<string, unknown>>(field: IntegrationField<Data> | undefined) => field is Data;
|
|
164
161
|
/**
|
|
165
162
|
* Determines if a Group has at least one item.
|
|
166
163
|
*
|
|
@@ -168,7 +165,7 @@ export declare const integrationFields: <Data extends Record<string, unknown>>(f
|
|
|
168
165
|
*
|
|
169
166
|
* @returns `true` if `group` contains at least one item, `false` otherwise.
|
|
170
167
|
*/
|
|
171
|
-
export declare const group: <Fields extends Record<string, AnyRegularField>>(group:
|
|
168
|
+
export declare const group: <Fields extends Record<string, AnyRegularField>>(group: GroupField<Fields> | null | undefined) => group is [Fields, ...Fields[]];
|
|
172
169
|
/**
|
|
173
170
|
* Determines if a Slice Zone has at least one Slice.
|
|
174
171
|
*
|
|
@@ -176,4 +173,4 @@ export declare const group: <Fields extends Record<string, AnyRegularField>>(gro
|
|
|
176
173
|
*
|
|
177
174
|
* @returns `true` if `slices` contains at least one Slice, `false` otherwise.
|
|
178
175
|
*/
|
|
179
|
-
export declare const sliceZone: <Slices extends Slice<string, Record<string, AnyRegularField>, Record<string, AnyRegularField>> | SharedSlice
|
|
176
|
+
export declare const sliceZone: <Slices extends Slice<string, Record<string, AnyRegularField>, Record<string, AnyRegularField>> | SharedSlice>(slices: SliceZone<Slices> | null | undefined) => slices is [Slices, ...Slices[]];
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const richText = require("./types/value/richText.cjs");
|
|
3
4
|
const filter = require("./filter.cjs");
|
|
4
5
|
const createClient = require("./createClient.cjs");
|
|
5
6
|
const getRepositoryEndpoint = require("./getRepositoryEndpoint.cjs");
|
|
@@ -21,12 +22,12 @@ const asImagePixelDensitySrcSet = require("./helpers/asImagePixelDensitySrcSet.c
|
|
|
21
22
|
const unstable_mapSliceZone = require("./helpers/unstable_mapSliceZone.cjs");
|
|
22
23
|
const isFilled = require("./helpers/isFilled.cjs");
|
|
23
24
|
const documentToLinkField = require("./helpers/documentToLinkField.cjs");
|
|
24
|
-
const richtext = require("@prismicio/richtext");
|
|
25
25
|
const PrismicError = require("./errors/PrismicError.cjs");
|
|
26
26
|
const ForbiddenError = require("./errors/ForbiddenError.cjs");
|
|
27
27
|
const NotFoundError = require("./errors/NotFoundError.cjs");
|
|
28
|
+
const RefNotFoundError = require("./errors/RefNotFoundError.cjs");
|
|
29
|
+
const RefExpiredError = require("./errors/RefExpiredError.cjs");
|
|
28
30
|
const ParsingError = require("./errors/ParsingError.cjs");
|
|
29
|
-
const richText = require("./types/value/richText.cjs");
|
|
30
31
|
const link = require("./types/value/link.cjs");
|
|
31
32
|
const embed = require("./types/value/embed.cjs");
|
|
32
33
|
const types = require("./types/model/types.cjs");
|
|
@@ -35,6 +36,8 @@ const sliceZone = require("./types/model/sliceZone.cjs");
|
|
|
35
36
|
const slice = require("./types/model/slice.cjs");
|
|
36
37
|
const types$1 = require("./types/webhook/types.cjs");
|
|
37
38
|
const predicate = filter.filter;
|
|
39
|
+
const Element = richText.RichTextNodeType;
|
|
40
|
+
exports.RichTextNodeType = richText.RichTextNodeType;
|
|
38
41
|
exports.filter = filter.filter;
|
|
39
42
|
exports.Client = createClient.Client;
|
|
40
43
|
exports.createClient = createClient.createClient;
|
|
@@ -57,15 +60,12 @@ exports.asImagePixelDensitySrcSet = asImagePixelDensitySrcSet.asImagePixelDensit
|
|
|
57
60
|
exports.unstable_mapSliceZone = unstable_mapSliceZone.unstable_mapSliceZone;
|
|
58
61
|
exports.isFilled = isFilled;
|
|
59
62
|
exports.documentToLinkField = documentToLinkField.documentToLinkField;
|
|
60
|
-
Object.defineProperty(exports, "Element", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: () => richtext.Element
|
|
63
|
-
});
|
|
64
63
|
exports.PrismicError = PrismicError.PrismicError;
|
|
65
64
|
exports.ForbiddenError = ForbiddenError.ForbiddenError;
|
|
66
65
|
exports.NotFoundError = NotFoundError.NotFoundError;
|
|
66
|
+
exports.RefNotFoundError = RefNotFoundError.RefNotFoundError;
|
|
67
|
+
exports.RefExpiredError = RefExpiredError.RefExpiredError;
|
|
67
68
|
exports.ParsingError = ParsingError.ParsingError;
|
|
68
|
-
exports.RichTextNodeType = richText.RichTextNodeType;
|
|
69
69
|
exports.LinkType = link.LinkType;
|
|
70
70
|
exports.OEmbedType = embed.OEmbedType;
|
|
71
71
|
exports.CustomTypeModelFieldType = types.CustomTypeModelFieldType;
|
|
@@ -73,5 +73,6 @@ exports.CustomTypeModelLinkSelectType = link$1.CustomTypeModelLinkSelectType;
|
|
|
73
73
|
exports.CustomTypeModelSliceType = sliceZone.CustomTypeModelSliceType;
|
|
74
74
|
exports.CustomTypeModelSliceDisplay = slice.CustomTypeModelSliceDisplay;
|
|
75
75
|
exports.WebhookType = types$1.WebhookType;
|
|
76
|
+
exports.Element = Element;
|
|
76
77
|
exports.predicate = predicate;
|
|
77
78
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["// Imports are used for deprecations.\nimport type { CustomTypeModelIntegrationField } from \"./types/model/integration\";\nimport type { IntegrationField } from \"./types/value/integration\";\n\nimport type {\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n} from \"./helpers/asHTML\";\n\nimport { filter } from \"./filter\";\n\n//=============================================================================\n// Client - Query content from Prismic.\n//=============================================================================\n\n// Primary Client API.\nexport { createClient, Client } from \"./createClient\";\n\n// API endpoint helpers.\nexport { getRepositoryEndpoint } from \"./getRepositoryEndpoint\";\nexport { getRepositoryName } from \"./getRepositoryName\";\nexport { getGraphQLEndpoint } from \"./getGraphQLEndpoint\";\nexport { isRepositoryName } from \"./isRepositoryName\";\nexport { isRepositoryEndpoint } from \"./isRepositoryEndpoint\";\nexport { buildQueryURL } from \"./buildQueryURL\";\n\n// Toolbar helpers.\nexport { getToolbarSrc } from \"./getToolbarSrc\";\n\n// Query filters API.\n/**\n * @deprecated Renamed to `filter`\n */\n// TODO: Remove when we remove support for deprecated `predicate` export.\nconst predicate = filter;\nexport { filter, predicate };\n\n// A collection of well-known cookie names shared between Prismic libraries and systems.\nexport * as cookie from \"./cookie\";\n\n// General types used to query content from Prismic. These are made public to allow users to better type their projects.\nexport type {\n\tAbortSignalLike,\n\tClientConfig,\n\tCreateClient,\n\tFetchLike,\n\tHttpRequestLike,\n\tRequestInitLike,\n\tResponseLike,\n} from \"./createClient\";\nexport type {\n\tBuildQueryURLArgs,\n\tOrdering,\n\tQueryParams,\n\tRoute,\n} from \"./buildQueryURL\";\n\n//=============================================================================\n// Helpers - Manipulate content from Prismic.\n//=============================================================================\n\n// Primary Helpers API.\nexport { asDate } from \"./helpers/asDate\";\nexport { asLink } from \"./helpers/asLink\";\nexport { asLinkAttrs } from \"./helpers/asLinkAttrs\";\nexport { asText } from \"./helpers/asText\";\nexport { asHTML } from \"./helpers/asHTML\";\nexport { asImageSrc } from \"./helpers/asImageSrc\";\nexport { asImageWidthSrcSet } from \"./helpers/asImageWidthSrcSet\";\nexport { asImagePixelDensitySrcSet } from \"./helpers/asImagePixelDensitySrcSet\";\nexport { unstable_mapSliceZone } from \"./helpers/unstable_mapSliceZone\";\nexport * as isFilled from \"./helpers/isFilled\";\n\n// Conversion helper.\nexport { documentToLinkField } from \"./helpers/documentToLinkField\";\n\n// RichText element types.\nexport { Element } from \"@prismicio/richtext\";\n\nexport type { LinkResolverFunction } from \"./helpers/asLink\";\nexport type { AsLinkAttrsConfig } from \"./helpers/asLinkAttrs\";\n\n/**\n * @deprecated Renamed to `HTMLRichTextMapSerializer`\n */\ntype HTMLMapSerializer = HTMLRichTextMapSerializer;\n/**\n * @deprecated Renamed to `HTMLRichTextFunctionSerializer`\n */\ntype HTMLFunctionSerializer = HTMLRichTextFunctionSerializer;\nexport type {\n\tHTMLRichTextMapSerializer,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLMapSerializer,\n\tHTMLFunctionSerializer,\n};\nexport type { HTMLRichTextSerializer } from \"./helpers/asHTML\";\n\n//=============================================================================\n// Errors - Custom errors for Prismic APIs.\n//=============================================================================\n\nexport { PrismicError } from \"./errors/PrismicError\";\nexport { ForbiddenError } from \"./errors/ForbiddenError\";\nexport { NotFoundError } from \"./errors/NotFoundError\";\nexport { ParsingError } from \"./errors/ParsingError\";\n\n//=============================================================================\n// Types - Types representing Prismic content, models, and API payloads.\n//=============================================================================\n\n// Values - Types representing Prismic content.\nexport { RichTextNodeType } from \"./types/value/richText\";\nexport { LinkType } from \"./types/value/link\";\nexport { OEmbedType } from \"./types/value/embed\";\n\nexport type {\n\tPrismicDocument,\n\tPrismicDocumentWithUID,\n\tPrismicDocumentWithoutUID,\n\tPrismicDocumentHeader,\n\tAlternateLanguage,\n} from \"./types/value/document\";\n\nexport type {\n\t// RichText & Title\n\tRichTextField,\n\t// RichText & Title (block nodes)\n\tRTTextNodeBase,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTListItemNode,\n\tRTOListItemNode,\n\t// RichText & Title (span nodes)\n\tRTSpanNodeBase,\n\tRTStrongNode,\n\tRTEmNode,\n\tRTLabelNode,\n\t// RichText & Title (media nodes)\n\tRTImageNode,\n\tRTEmbedNode,\n\t// RichText & Title (link nodes)\n\tRTLinkNode,\n\t// RichText & Title (serialization related nodes)\n\tRTListNode,\n\tRTOListNode,\n\tRTSpanNode,\n\t// RichText & Title (helpers)\n\tRTNode,\n\tRTTextNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTAnyNode,\n} from \"./types/value/richText\";\nexport type { TitleField } from \"./types/value/title\";\n\nexport type {\n\tImageField,\n\tImageFieldImage,\n\tFilledImageFieldImage,\n\tEmptyImageFieldImage,\n} from \"./types/value/image\";\n\nexport type {\n\tEmptyLinkField,\n\tLinkField,\n\tFilledLinkToWebField,\n} from \"./types/value/link\";\nexport type {\n\tContentRelationshipField,\n\tFilledContentRelationshipField,\n} from \"./types/value/contentRelationship\";\nexport type {\n\tLinkToMediaField,\n\tFilledLinkToMediaField,\n} from \"./types/value/linkToMedia\";\n\nexport type {\n\tOEmbedExtra,\n\tPhotoOEmbed,\n\tVideoOEmbed,\n\tLinkOEmbed,\n\tRichOEmbed,\n\tAnyOEmbed,\n\tEmbedField,\n} from \"./types/value/embed\";\n\nexport type { BooleanField } from \"./types/value/boolean\";\nexport type { ColorField } from \"./types/value/color\";\nexport type { DateField } from \"./types/value/date\";\nexport type { KeyTextField } from \"./types/value/keyText\";\nexport type { NumberField } from \"./types/value/number\";\nexport type { SelectField } from \"./types/value/select\";\nexport type { TimestampField } from \"./types/value/timestamp\";\nexport type { GeoPointField } from \"./types/value/geoPoint\";\n\n/**\n * @deprecated Renamed to `IntegrationField`\n */\n// TODO: Remove when we remove support for deprecated `IntegrationFields` export.\ntype IntegrationFields = IntegrationField;\nexport { IntegrationField, IntegrationFields };\n\nexport type { GroupField } from \"./types/value/group\";\n\nexport type { SliceZone } from \"./types/value/sliceZone\";\nexport type { Slice } from \"./types/value/slice\";\nexport type { SharedSlice } from \"./types/value/sharedSlice\";\nexport type { SharedSliceVariation } from \"./types/value/sharedSliceVariation\";\n\nexport type { FieldState, AnyRegularField } from \"./types/value/types\";\n\n// Models - Types representing Prismic content models.\nexport { CustomTypeModelFieldType } from \"./types/model/types\";\nexport { CustomTypeModelLinkSelectType } from \"./types/model/link\";\nexport { CustomTypeModelSliceType } from \"./types/model/sliceZone\";\nexport { CustomTypeModelSliceDisplay } from \"./types/model/slice\";\n\nexport type {\n\tCustomTypeModel,\n\tCustomTypeModelDefinition,\n\tCustomTypeModelTab,\n} from \"./types/model/customType\";\n\nexport type {\n\tCustomTypeModelRichTextField,\n\tCustomTypeModelRichTextMultiField,\n\tCustomTypeModelRichTextSingleField,\n} from \"./types/model/richText\";\nexport type { CustomTypeModelTitleField } from \"./types/model/title\";\n\nexport type {\n\tCustomTypeModelImageField,\n\tCustomTypeModelImageConstraint,\n\tCustomTypeModelImageThumbnail,\n} from \"./types/model/image\";\n\nexport type { CustomTypeModelContentRelationshipField } from \"./types/model/contentRelationship\";\nexport type { CustomTypeModelLinkField } from \"./types/model/link\";\nexport type { CustomTypeModelLinkToMediaField } from \"./types/model/linkToMedia\";\n\nexport type { CustomTypeModelEmbedField } from \"./types/model/embed\";\n\nexport type { CustomTypeModelBooleanField } from \"./types/model/boolean\";\nexport type { CustomTypeModelColorField } from \"./types/model/color\";\nexport type { CustomTypeModelDateField } from \"./types/model/date\";\nexport type { CustomTypeModelKeyTextField } from \"./types/model/keyText\";\nexport type { CustomTypeModelNumberField } from \"./types/model/number\";\nexport type { CustomTypeModelSelectField } from \"./types/model/select\";\nexport type { CustomTypeModelTimestampField } from \"./types/model/timestamp\";\nexport type { CustomTypeModelGeoPointField } from \"./types/model/geoPoint\";\n\n/**\n * @deprecated Renamed to `CustomTypeModelIntegrationField`.\n */\n// TODO: Remove when we remove support for deprecated `CustomTypeModelIntegrationField` export.\ntype CustomTypeModelIntegrationFieldsField = CustomTypeModelIntegrationField;\nexport {\n\tCustomTypeModelIntegrationField,\n\tCustomTypeModelIntegrationFieldsField,\n};\nexport type { CustomTypeModelGroupField } from \"./types/model/group\";\nexport type {\n\tCustomTypeModelSliceZoneField,\n\tCustomTypeModelSliceLabel,\n\tCustomTypeModelSharedSlice,\n} from \"./types/model/sliceZone\";\nexport type {\n\tCustomTypeModelSlice,\n\tCustomTypeModelLegacySlice,\n} from \"./types/model/slice\";\nexport type { SharedSliceModel } from \"./types/model/sharedSlice\";\nexport type { SharedSliceModelVariation } from \"./types/model/sharedSliceVariation\";\n\nexport type { CustomTypeModelUIDField } from \"./types/model/uid\";\n\nexport type { CustomTypeModelRangeField } from \"./types/model/range\";\nexport type { CustomTypeModelSeparatorField } from \"./types/model/separator\";\n\nexport type {\n\tCustomTypeModelField,\n\tCustomTypeModelFieldForGroup,\n} from \"./types/model/types\";\n\n// API - Types representing Prismic Rest API V2 responses.\nexport type { Query } from \"./types/api/query\";\n\nexport type { Ref } from \"./types/api/ref\";\n\nexport type { Release } from \"./types/api/release\";\n\nexport type {\n\tRepository,\n\tLanguage,\n\tForm,\n\tFormField,\n} from \"./types/api/repository\";\n\nexport type { Tags } from \"./types/api/tags\";\n\n// Webhook - Types representing Prismic webhooks.\nexport { WebhookType } from \"./types/webhook/types\";\n\nexport type { WebhookBody } from \"./types/webhook/types\";\n\nexport type { WebhookBodyAPIUpdate } from \"./types/webhook/apiUpdate\";\n\nexport type { WebhookBodyTestTrigger } from \"./types/webhook/testTrigger\";\n"],"names":["filter"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,YAAYA,OAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["// Imports are used for deprecations.\nimport type { CustomTypeModelIntegrationField } from \"./types/model/integration\";\nimport type { IntegrationField } from \"./types/value/integration\";\nimport { RichTextNodeType } from \"./types/value/richText\";\n\nimport type {\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n} from \"./helpers/asHTML\";\n\nimport { filter } from \"./filter\";\n\n//=============================================================================\n// Client - Query content from Prismic.\n//=============================================================================\n\n// Primary Client API.\nexport { createClient, Client } from \"./createClient\";\n\n// API endpoint helpers.\nexport { getRepositoryEndpoint } from \"./getRepositoryEndpoint\";\nexport { getRepositoryName } from \"./getRepositoryName\";\nexport { getGraphQLEndpoint } from \"./getGraphQLEndpoint\";\nexport { isRepositoryName } from \"./isRepositoryName\";\nexport { isRepositoryEndpoint } from \"./isRepositoryEndpoint\";\nexport { buildQueryURL } from \"./buildQueryURL\";\n\n// Toolbar helpers.\nexport { getToolbarSrc } from \"./getToolbarSrc\";\n\n// Query filters API.\n/**\n * @deprecated Renamed to `filter`\n */\n// TODO: Remove when we remove support for deprecated `predicate` export.\nconst predicate = filter;\nexport { filter, predicate };\n\n// A collection of well-known cookie names shared between Prismic libraries and systems.\nexport * as cookie from \"./cookie\";\n\n// General types used to query content from Prismic. These are made public to allow users to better type their projects.\nexport type {\n\tAbortSignalLike,\n\tClientConfig,\n\tCreateClient,\n\tFetchLike,\n\tHttpRequestLike,\n\tRequestInitLike,\n\tResponseLike,\n} from \"./createClient\";\nexport type {\n\tBuildQueryURLArgs,\n\tOrdering,\n\tQueryParams,\n\tRoute,\n} from \"./buildQueryURL\";\n\n//=============================================================================\n// Helpers - Manipulate content from Prismic.\n//=============================================================================\n\n// Primary Helpers API.\nexport { asDate } from \"./helpers/asDate\";\nexport { asLink } from \"./helpers/asLink\";\nexport { asLinkAttrs } from \"./helpers/asLinkAttrs\";\nexport { asText } from \"./helpers/asText\";\nexport { asHTML } from \"./helpers/asHTML\";\nexport { asImageSrc } from \"./helpers/asImageSrc\";\nexport { asImageWidthSrcSet } from \"./helpers/asImageWidthSrcSet\";\nexport { asImagePixelDensitySrcSet } from \"./helpers/asImagePixelDensitySrcSet\";\nexport { unstable_mapSliceZone } from \"./helpers/unstable_mapSliceZone\";\nexport * as isFilled from \"./helpers/isFilled\";\n\n// Conversion helper.\nexport { documentToLinkField } from \"./helpers/documentToLinkField\";\n\nexport type { LinkResolverFunction } from \"./helpers/asLink\";\nexport type { AsLinkAttrsConfig } from \"./helpers/asLinkAttrs\";\n\n/**\n * @deprecated Renamed to `HTMLRichTextMapSerializer`\n */\ntype HTMLMapSerializer = HTMLRichTextMapSerializer;\n/**\n * @deprecated Renamed to `HTMLRichTextFunctionSerializer`\n */\ntype HTMLFunctionSerializer = HTMLRichTextFunctionSerializer;\nexport type {\n\tHTMLRichTextMapSerializer,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLMapSerializer,\n\tHTMLFunctionSerializer,\n};\nexport type { HTMLRichTextSerializer } from \"./helpers/asHTML\";\n\n//=============================================================================\n// Errors - Custom errors for Prismic APIs.\n//=============================================================================\n\nexport { PrismicError } from \"./errors/PrismicError\";\nexport { ForbiddenError } from \"./errors/ForbiddenError\";\nexport { NotFoundError } from \"./errors/NotFoundError\";\nexport { RefNotFoundError } from \"./errors/RefNotFoundError\";\nexport { RefExpiredError } from \"./errors/RefExpiredError\";\nexport { ParsingError } from \"./errors/ParsingError\";\n\n//=============================================================================\n// Types - Types representing Prismic content, models, and API payloads.\n//=============================================================================\n\n// Values - Types representing Prismic content.\n/**\n * @deprecated Use {@link RichTextNodeType} instead.\n */\n// TODO: Remove in v8.\nconst Element = RichTextNodeType;\nexport { RichTextNodeType, Element };\nexport { LinkType } from \"./types/value/link\";\nexport { OEmbedType } from \"./types/value/embed\";\n\nexport type {\n\tPrismicDocument,\n\tPrismicDocumentWithUID,\n\tPrismicDocumentWithoutUID,\n\tPrismicDocumentHeader,\n\tAlternateLanguage,\n} from \"./types/value/document\";\n\nexport type {\n\t// RichText & Title\n\tRichTextField,\n\t// RichText & Title (block nodes)\n\tRTTextNodeBase,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTListItemNode,\n\tRTOListItemNode,\n\t// RichText & Title (span nodes)\n\tRTSpanNodeBase,\n\tRTStrongNode,\n\tRTEmNode,\n\tRTLabelNode,\n\t// RichText & Title (media nodes)\n\tRTImageNode,\n\tRTEmbedNode,\n\t// RichText & Title (link nodes)\n\tRTLinkNode,\n\t// RichText & Title (serialization related nodes)\n\tRTListNode,\n\tRTOListNode,\n\tRTSpanNode,\n\t// RichText & Title (helpers)\n\tRTNode,\n\tRTTextNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTAnyNode,\n} from \"./types/value/richText\";\nexport type { TitleField } from \"./types/value/title\";\n\nexport type {\n\tImageField,\n\tImageFieldImage,\n\tFilledImageFieldImage,\n\tEmptyImageFieldImage,\n} from \"./types/value/image\";\n\nexport type {\n\tEmptyLinkField,\n\tLinkField,\n\tFilledLinkToWebField,\n} from \"./types/value/link\";\nexport type {\n\tContentRelationshipField,\n\tFilledContentRelationshipField,\n} from \"./types/value/contentRelationship\";\nexport type {\n\tLinkToMediaField,\n\tFilledLinkToMediaField,\n} from \"./types/value/linkToMedia\";\n\nexport type {\n\tOEmbedExtra,\n\tPhotoOEmbed,\n\tVideoOEmbed,\n\tLinkOEmbed,\n\tRichOEmbed,\n\tAnyOEmbed,\n\tEmbedField,\n} from \"./types/value/embed\";\n\nexport type { BooleanField } from \"./types/value/boolean\";\nexport type { ColorField } from \"./types/value/color\";\nexport type { DateField } from \"./types/value/date\";\nexport type { KeyTextField } from \"./types/value/keyText\";\nexport type { NumberField } from \"./types/value/number\";\nexport type { SelectField } from \"./types/value/select\";\nexport type { TimestampField } from \"./types/value/timestamp\";\nexport type { GeoPointField } from \"./types/value/geoPoint\";\n\n/**\n * @deprecated Renamed to `IntegrationField`\n */\n// TODO: Remove when we remove support for deprecated `IntegrationFields` export.\ntype IntegrationFields = IntegrationField;\nexport { IntegrationField, IntegrationFields };\n\nexport type { GroupField } from \"./types/value/group\";\n\nexport type { SliceZone } from \"./types/value/sliceZone\";\nexport type { Slice } from \"./types/value/slice\";\nexport type { SharedSlice } from \"./types/value/sharedSlice\";\nexport type { SharedSliceVariation } from \"./types/value/sharedSliceVariation\";\n\nexport type { FieldState, AnyRegularField } from \"./types/value/types\";\n\n// Models - Types representing Prismic content models.\nexport { CustomTypeModelFieldType } from \"./types/model/types\";\nexport { CustomTypeModelLinkSelectType } from \"./types/model/link\";\nexport { CustomTypeModelSliceType } from \"./types/model/sliceZone\";\nexport { CustomTypeModelSliceDisplay } from \"./types/model/slice\";\n\nexport type {\n\tCustomTypeModel,\n\tCustomTypeModelDefinition,\n\tCustomTypeModelTab,\n} from \"./types/model/customType\";\n\nexport type {\n\tCustomTypeModelRichTextField,\n\tCustomTypeModelRichTextMultiField,\n\tCustomTypeModelRichTextSingleField,\n} from \"./types/model/richText\";\nexport type { CustomTypeModelTitleField } from \"./types/model/title\";\n\nexport type {\n\tCustomTypeModelImageField,\n\tCustomTypeModelImageConstraint,\n\tCustomTypeModelImageThumbnail,\n} from \"./types/model/image\";\n\nexport type { CustomTypeModelContentRelationshipField } from \"./types/model/contentRelationship\";\nexport type { CustomTypeModelLinkField } from \"./types/model/link\";\nexport type { CustomTypeModelLinkToMediaField } from \"./types/model/linkToMedia\";\n\nexport type { CustomTypeModelEmbedField } from \"./types/model/embed\";\n\nexport type { CustomTypeModelBooleanField } from \"./types/model/boolean\";\nexport type { CustomTypeModelColorField } from \"./types/model/color\";\nexport type { CustomTypeModelDateField } from \"./types/model/date\";\nexport type { CustomTypeModelKeyTextField } from \"./types/model/keyText\";\nexport type { CustomTypeModelNumberField } from \"./types/model/number\";\nexport type { CustomTypeModelSelectField } from \"./types/model/select\";\nexport type { CustomTypeModelTimestampField } from \"./types/model/timestamp\";\nexport type { CustomTypeModelGeoPointField } from \"./types/model/geoPoint\";\n\n/**\n * @deprecated Renamed to `CustomTypeModelIntegrationField`.\n */\n// TODO: Remove when we remove support for deprecated `CustomTypeModelIntegrationField` export.\ntype CustomTypeModelIntegrationFieldsField = CustomTypeModelIntegrationField;\nexport {\n\tCustomTypeModelIntegrationField,\n\tCustomTypeModelIntegrationFieldsField,\n};\nexport type { CustomTypeModelGroupField } from \"./types/model/group\";\nexport type {\n\tCustomTypeModelSliceZoneField,\n\tCustomTypeModelSliceLabel,\n\tCustomTypeModelSharedSlice,\n} from \"./types/model/sliceZone\";\nexport type {\n\tCustomTypeModelSlice,\n\tCustomTypeModelLegacySlice,\n} from \"./types/model/slice\";\nexport type { SharedSliceModel } from \"./types/model/sharedSlice\";\nexport type { SharedSliceModelVariation } from \"./types/model/sharedSliceVariation\";\n\nexport type { CustomTypeModelUIDField } from \"./types/model/uid\";\n\nexport type { CustomTypeModelRangeField } from \"./types/model/range\";\nexport type { CustomTypeModelSeparatorField } from \"./types/model/separator\";\n\nexport type {\n\tCustomTypeModelField,\n\tCustomTypeModelFieldForGroup,\n} from \"./types/model/types\";\n\n// API - Types representing Prismic Rest API V2 responses.\nexport type { Query } from \"./types/api/query\";\n\nexport type { Ref } from \"./types/api/ref\";\n\nexport type { Release } from \"./types/api/release\";\n\nexport type {\n\tRepository,\n\tLanguage,\n\tForm,\n\tFormField,\n} from \"./types/api/repository\";\n\nexport type { Tags } from \"./types/api/tags\";\n\n// Webhook - Types representing Prismic webhooks.\nexport { WebhookType } from \"./types/webhook/types\";\n\nexport type { WebhookBody } from \"./types/webhook/types\";\n\nexport type { WebhookBodyAPIUpdate } from \"./types/webhook/apiUpdate\";\n\nexport type { WebhookBodyTestTrigger } from \"./types/webhook/testTrigger\";\n"],"names":["filter","RichTextNodeType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,YAAYA,OAAA;AAiFlB,MAAM,UAAUC,SAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CustomTypeModelIntegrationField } from "./types/model/integration";
|
|
2
2
|
import type { IntegrationField } from "./types/value/integration";
|
|
3
|
+
import { RichTextNodeType } from "./types/value/richText";
|
|
3
4
|
import type { HTMLRichTextFunctionSerializer, HTMLRichTextMapSerializer } from "./helpers/asHTML";
|
|
4
5
|
import { filter } from "./filter";
|
|
5
6
|
export { createClient, Client } from "./createClient";
|
|
@@ -58,7 +59,6 @@ export { asImagePixelDensitySrcSet } from "./helpers/asImagePixelDensitySrcSet";
|
|
|
58
59
|
export { unstable_mapSliceZone } from "./helpers/unstable_mapSliceZone";
|
|
59
60
|
export * as isFilled from "./helpers/isFilled";
|
|
60
61
|
export { documentToLinkField } from "./helpers/documentToLinkField";
|
|
61
|
-
export { Element } from "@prismicio/richtext";
|
|
62
62
|
export type { LinkResolverFunction } from "./helpers/asLink";
|
|
63
63
|
export type { AsLinkAttrsConfig } from "./helpers/asLinkAttrs";
|
|
64
64
|
/**
|
|
@@ -74,8 +74,34 @@ export type { HTMLRichTextSerializer } from "./helpers/asHTML";
|
|
|
74
74
|
export { PrismicError } from "./errors/PrismicError";
|
|
75
75
|
export { ForbiddenError } from "./errors/ForbiddenError";
|
|
76
76
|
export { NotFoundError } from "./errors/NotFoundError";
|
|
77
|
+
export { RefNotFoundError } from "./errors/RefNotFoundError";
|
|
78
|
+
export { RefExpiredError } from "./errors/RefExpiredError";
|
|
77
79
|
export { ParsingError } from "./errors/ParsingError";
|
|
78
|
-
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated Use {@link RichTextNodeType} instead.
|
|
82
|
+
*/
|
|
83
|
+
declare const Element: {
|
|
84
|
+
readonly heading1: "heading1";
|
|
85
|
+
readonly heading2: "heading2";
|
|
86
|
+
readonly heading3: "heading3";
|
|
87
|
+
readonly heading4: "heading4";
|
|
88
|
+
readonly heading5: "heading5";
|
|
89
|
+
readonly heading6: "heading6";
|
|
90
|
+
readonly paragraph: "paragraph";
|
|
91
|
+
readonly preformatted: "preformatted";
|
|
92
|
+
readonly strong: "strong";
|
|
93
|
+
readonly em: "em";
|
|
94
|
+
readonly listItem: "list-item";
|
|
95
|
+
readonly oListItem: "o-list-item";
|
|
96
|
+
readonly list: "group-list-item";
|
|
97
|
+
readonly oList: "group-o-list-item";
|
|
98
|
+
readonly image: "image";
|
|
99
|
+
readonly embed: "embed";
|
|
100
|
+
readonly hyperlink: "hyperlink";
|
|
101
|
+
readonly label: "label";
|
|
102
|
+
readonly span: "span";
|
|
103
|
+
};
|
|
104
|
+
export { RichTextNodeType, Element };
|
|
79
105
|
export { LinkType } from "./types/value/link";
|
|
80
106
|
export { OEmbedType } from "./types/value/embed";
|
|
81
107
|
export type { PrismicDocument, PrismicDocumentWithUID, PrismicDocumentWithoutUID, PrismicDocumentHeader, AlternateLanguage, } from "./types/value/document";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RichTextNodeType } from "./types/value/richText.js";
|
|
1
2
|
import { filter } from "./filter.js";
|
|
2
3
|
import { Client, createClient } from "./createClient.js";
|
|
3
4
|
import { getRepositoryEndpoint } from "./getRepositoryEndpoint.js";
|
|
@@ -19,12 +20,12 @@ import { asImagePixelDensitySrcSet } from "./helpers/asImagePixelDensitySrcSet.j
|
|
|
19
20
|
import { unstable_mapSliceZone } from "./helpers/unstable_mapSliceZone.js";
|
|
20
21
|
import * as isFilled from "./helpers/isFilled.js";
|
|
21
22
|
import { documentToLinkField } from "./helpers/documentToLinkField.js";
|
|
22
|
-
import { Element } from "@prismicio/richtext";
|
|
23
23
|
import { PrismicError } from "./errors/PrismicError.js";
|
|
24
24
|
import { ForbiddenError } from "./errors/ForbiddenError.js";
|
|
25
25
|
import { NotFoundError } from "./errors/NotFoundError.js";
|
|
26
|
+
import { RefNotFoundError } from "./errors/RefNotFoundError.js";
|
|
27
|
+
import { RefExpiredError } from "./errors/RefExpiredError.js";
|
|
26
28
|
import { ParsingError } from "./errors/ParsingError.js";
|
|
27
|
-
import { RichTextNodeType } from "./types/value/richText.js";
|
|
28
29
|
import { LinkType } from "./types/value/link.js";
|
|
29
30
|
import { OEmbedType } from "./types/value/embed.js";
|
|
30
31
|
import { CustomTypeModelFieldType } from "./types/model/types.js";
|
|
@@ -33,6 +34,7 @@ import { CustomTypeModelSliceType } from "./types/model/sliceZone.js";
|
|
|
33
34
|
import { CustomTypeModelSliceDisplay } from "./types/model/slice.js";
|
|
34
35
|
import { WebhookType } from "./types/webhook/types.js";
|
|
35
36
|
const predicate = filter;
|
|
37
|
+
const Element = RichTextNodeType;
|
|
36
38
|
export {
|
|
37
39
|
Client,
|
|
38
40
|
CustomTypeModelFieldType,
|
|
@@ -46,6 +48,8 @@ export {
|
|
|
46
48
|
OEmbedType,
|
|
47
49
|
ParsingError,
|
|
48
50
|
PrismicError,
|
|
51
|
+
RefExpiredError,
|
|
52
|
+
RefNotFoundError,
|
|
49
53
|
RichTextNodeType,
|
|
50
54
|
WebhookType,
|
|
51
55
|
asDate,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["// Imports are used for deprecations.\nimport type { CustomTypeModelIntegrationField } from \"./types/model/integration\";\nimport type { IntegrationField } from \"./types/value/integration\";\n\nimport type {\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n} from \"./helpers/asHTML\";\n\nimport { filter } from \"./filter\";\n\n//=============================================================================\n// Client - Query content from Prismic.\n//=============================================================================\n\n// Primary Client API.\nexport { createClient, Client } from \"./createClient\";\n\n// API endpoint helpers.\nexport { getRepositoryEndpoint } from \"./getRepositoryEndpoint\";\nexport { getRepositoryName } from \"./getRepositoryName\";\nexport { getGraphQLEndpoint } from \"./getGraphQLEndpoint\";\nexport { isRepositoryName } from \"./isRepositoryName\";\nexport { isRepositoryEndpoint } from \"./isRepositoryEndpoint\";\nexport { buildQueryURL } from \"./buildQueryURL\";\n\n// Toolbar helpers.\nexport { getToolbarSrc } from \"./getToolbarSrc\";\n\n// Query filters API.\n/**\n * @deprecated Renamed to `filter`\n */\n// TODO: Remove when we remove support for deprecated `predicate` export.\nconst predicate = filter;\nexport { filter, predicate };\n\n// A collection of well-known cookie names shared between Prismic libraries and systems.\nexport * as cookie from \"./cookie\";\n\n// General types used to query content from Prismic. These are made public to allow users to better type their projects.\nexport type {\n\tAbortSignalLike,\n\tClientConfig,\n\tCreateClient,\n\tFetchLike,\n\tHttpRequestLike,\n\tRequestInitLike,\n\tResponseLike,\n} from \"./createClient\";\nexport type {\n\tBuildQueryURLArgs,\n\tOrdering,\n\tQueryParams,\n\tRoute,\n} from \"./buildQueryURL\";\n\n//=============================================================================\n// Helpers - Manipulate content from Prismic.\n//=============================================================================\n\n// Primary Helpers API.\nexport { asDate } from \"./helpers/asDate\";\nexport { asLink } from \"./helpers/asLink\";\nexport { asLinkAttrs } from \"./helpers/asLinkAttrs\";\nexport { asText } from \"./helpers/asText\";\nexport { asHTML } from \"./helpers/asHTML\";\nexport { asImageSrc } from \"./helpers/asImageSrc\";\nexport { asImageWidthSrcSet } from \"./helpers/asImageWidthSrcSet\";\nexport { asImagePixelDensitySrcSet } from \"./helpers/asImagePixelDensitySrcSet\";\nexport { unstable_mapSliceZone } from \"./helpers/unstable_mapSliceZone\";\nexport * as isFilled from \"./helpers/isFilled\";\n\n// Conversion helper.\nexport { documentToLinkField } from \"./helpers/documentToLinkField\";\n\n// RichText element types.\nexport { Element } from \"@prismicio/richtext\";\n\nexport type { LinkResolverFunction } from \"./helpers/asLink\";\nexport type { AsLinkAttrsConfig } from \"./helpers/asLinkAttrs\";\n\n/**\n * @deprecated Renamed to `HTMLRichTextMapSerializer`\n */\ntype HTMLMapSerializer = HTMLRichTextMapSerializer;\n/**\n * @deprecated Renamed to `HTMLRichTextFunctionSerializer`\n */\ntype HTMLFunctionSerializer = HTMLRichTextFunctionSerializer;\nexport type {\n\tHTMLRichTextMapSerializer,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLMapSerializer,\n\tHTMLFunctionSerializer,\n};\nexport type { HTMLRichTextSerializer } from \"./helpers/asHTML\";\n\n//=============================================================================\n// Errors - Custom errors for Prismic APIs.\n//=============================================================================\n\nexport { PrismicError } from \"./errors/PrismicError\";\nexport { ForbiddenError } from \"./errors/ForbiddenError\";\nexport { NotFoundError } from \"./errors/NotFoundError\";\nexport { ParsingError } from \"./errors/ParsingError\";\n\n//=============================================================================\n// Types - Types representing Prismic content, models, and API payloads.\n//=============================================================================\n\n// Values - Types representing Prismic content.\nexport { RichTextNodeType } from \"./types/value/richText\";\nexport { LinkType } from \"./types/value/link\";\nexport { OEmbedType } from \"./types/value/embed\";\n\nexport type {\n\tPrismicDocument,\n\tPrismicDocumentWithUID,\n\tPrismicDocumentWithoutUID,\n\tPrismicDocumentHeader,\n\tAlternateLanguage,\n} from \"./types/value/document\";\n\nexport type {\n\t// RichText & Title\n\tRichTextField,\n\t// RichText & Title (block nodes)\n\tRTTextNodeBase,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTListItemNode,\n\tRTOListItemNode,\n\t// RichText & Title (span nodes)\n\tRTSpanNodeBase,\n\tRTStrongNode,\n\tRTEmNode,\n\tRTLabelNode,\n\t// RichText & Title (media nodes)\n\tRTImageNode,\n\tRTEmbedNode,\n\t// RichText & Title (link nodes)\n\tRTLinkNode,\n\t// RichText & Title (serialization related nodes)\n\tRTListNode,\n\tRTOListNode,\n\tRTSpanNode,\n\t// RichText & Title (helpers)\n\tRTNode,\n\tRTTextNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTAnyNode,\n} from \"./types/value/richText\";\nexport type { TitleField } from \"./types/value/title\";\n\nexport type {\n\tImageField,\n\tImageFieldImage,\n\tFilledImageFieldImage,\n\tEmptyImageFieldImage,\n} from \"./types/value/image\";\n\nexport type {\n\tEmptyLinkField,\n\tLinkField,\n\tFilledLinkToWebField,\n} from \"./types/value/link\";\nexport type {\n\tContentRelationshipField,\n\tFilledContentRelationshipField,\n} from \"./types/value/contentRelationship\";\nexport type {\n\tLinkToMediaField,\n\tFilledLinkToMediaField,\n} from \"./types/value/linkToMedia\";\n\nexport type {\n\tOEmbedExtra,\n\tPhotoOEmbed,\n\tVideoOEmbed,\n\tLinkOEmbed,\n\tRichOEmbed,\n\tAnyOEmbed,\n\tEmbedField,\n} from \"./types/value/embed\";\n\nexport type { BooleanField } from \"./types/value/boolean\";\nexport type { ColorField } from \"./types/value/color\";\nexport type { DateField } from \"./types/value/date\";\nexport type { KeyTextField } from \"./types/value/keyText\";\nexport type { NumberField } from \"./types/value/number\";\nexport type { SelectField } from \"./types/value/select\";\nexport type { TimestampField } from \"./types/value/timestamp\";\nexport type { GeoPointField } from \"./types/value/geoPoint\";\n\n/**\n * @deprecated Renamed to `IntegrationField`\n */\n// TODO: Remove when we remove support for deprecated `IntegrationFields` export.\ntype IntegrationFields = IntegrationField;\nexport { IntegrationField, IntegrationFields };\n\nexport type { GroupField } from \"./types/value/group\";\n\nexport type { SliceZone } from \"./types/value/sliceZone\";\nexport type { Slice } from \"./types/value/slice\";\nexport type { SharedSlice } from \"./types/value/sharedSlice\";\nexport type { SharedSliceVariation } from \"./types/value/sharedSliceVariation\";\n\nexport type { FieldState, AnyRegularField } from \"./types/value/types\";\n\n// Models - Types representing Prismic content models.\nexport { CustomTypeModelFieldType } from \"./types/model/types\";\nexport { CustomTypeModelLinkSelectType } from \"./types/model/link\";\nexport { CustomTypeModelSliceType } from \"./types/model/sliceZone\";\nexport { CustomTypeModelSliceDisplay } from \"./types/model/slice\";\n\nexport type {\n\tCustomTypeModel,\n\tCustomTypeModelDefinition,\n\tCustomTypeModelTab,\n} from \"./types/model/customType\";\n\nexport type {\n\tCustomTypeModelRichTextField,\n\tCustomTypeModelRichTextMultiField,\n\tCustomTypeModelRichTextSingleField,\n} from \"./types/model/richText\";\nexport type { CustomTypeModelTitleField } from \"./types/model/title\";\n\nexport type {\n\tCustomTypeModelImageField,\n\tCustomTypeModelImageConstraint,\n\tCustomTypeModelImageThumbnail,\n} from \"./types/model/image\";\n\nexport type { CustomTypeModelContentRelationshipField } from \"./types/model/contentRelationship\";\nexport type { CustomTypeModelLinkField } from \"./types/model/link\";\nexport type { CustomTypeModelLinkToMediaField } from \"./types/model/linkToMedia\";\n\nexport type { CustomTypeModelEmbedField } from \"./types/model/embed\";\n\nexport type { CustomTypeModelBooleanField } from \"./types/model/boolean\";\nexport type { CustomTypeModelColorField } from \"./types/model/color\";\nexport type { CustomTypeModelDateField } from \"./types/model/date\";\nexport type { CustomTypeModelKeyTextField } from \"./types/model/keyText\";\nexport type { CustomTypeModelNumberField } from \"./types/model/number\";\nexport type { CustomTypeModelSelectField } from \"./types/model/select\";\nexport type { CustomTypeModelTimestampField } from \"./types/model/timestamp\";\nexport type { CustomTypeModelGeoPointField } from \"./types/model/geoPoint\";\n\n/**\n * @deprecated Renamed to `CustomTypeModelIntegrationField`.\n */\n// TODO: Remove when we remove support for deprecated `CustomTypeModelIntegrationField` export.\ntype CustomTypeModelIntegrationFieldsField = CustomTypeModelIntegrationField;\nexport {\n\tCustomTypeModelIntegrationField,\n\tCustomTypeModelIntegrationFieldsField,\n};\nexport type { CustomTypeModelGroupField } from \"./types/model/group\";\nexport type {\n\tCustomTypeModelSliceZoneField,\n\tCustomTypeModelSliceLabel,\n\tCustomTypeModelSharedSlice,\n} from \"./types/model/sliceZone\";\nexport type {\n\tCustomTypeModelSlice,\n\tCustomTypeModelLegacySlice,\n} from \"./types/model/slice\";\nexport type { SharedSliceModel } from \"./types/model/sharedSlice\";\nexport type { SharedSliceModelVariation } from \"./types/model/sharedSliceVariation\";\n\nexport type { CustomTypeModelUIDField } from \"./types/model/uid\";\n\nexport type { CustomTypeModelRangeField } from \"./types/model/range\";\nexport type { CustomTypeModelSeparatorField } from \"./types/model/separator\";\n\nexport type {\n\tCustomTypeModelField,\n\tCustomTypeModelFieldForGroup,\n} from \"./types/model/types\";\n\n// API - Types representing Prismic Rest API V2 responses.\nexport type { Query } from \"./types/api/query\";\n\nexport type { Ref } from \"./types/api/ref\";\n\nexport type { Release } from \"./types/api/release\";\n\nexport type {\n\tRepository,\n\tLanguage,\n\tForm,\n\tFormField,\n} from \"./types/api/repository\";\n\nexport type { Tags } from \"./types/api/tags\";\n\n// Webhook - Types representing Prismic webhooks.\nexport { WebhookType } from \"./types/webhook/types\";\n\nexport type { WebhookBody } from \"./types/webhook/types\";\n\nexport type { WebhookBodyAPIUpdate } from \"./types/webhook/apiUpdate\";\n\nexport type { WebhookBodyTestTrigger } from \"./types/webhook/testTrigger\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAM,YAAY;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["// Imports are used for deprecations.\nimport type { CustomTypeModelIntegrationField } from \"./types/model/integration\";\nimport type { IntegrationField } from \"./types/value/integration\";\nimport { RichTextNodeType } from \"./types/value/richText\";\n\nimport type {\n\tHTMLRichTextFunctionSerializer,\n\tHTMLRichTextMapSerializer,\n} from \"./helpers/asHTML\";\n\nimport { filter } from \"./filter\";\n\n//=============================================================================\n// Client - Query content from Prismic.\n//=============================================================================\n\n// Primary Client API.\nexport { createClient, Client } from \"./createClient\";\n\n// API endpoint helpers.\nexport { getRepositoryEndpoint } from \"./getRepositoryEndpoint\";\nexport { getRepositoryName } from \"./getRepositoryName\";\nexport { getGraphQLEndpoint } from \"./getGraphQLEndpoint\";\nexport { isRepositoryName } from \"./isRepositoryName\";\nexport { isRepositoryEndpoint } from \"./isRepositoryEndpoint\";\nexport { buildQueryURL } from \"./buildQueryURL\";\n\n// Toolbar helpers.\nexport { getToolbarSrc } from \"./getToolbarSrc\";\n\n// Query filters API.\n/**\n * @deprecated Renamed to `filter`\n */\n// TODO: Remove when we remove support for deprecated `predicate` export.\nconst predicate = filter;\nexport { filter, predicate };\n\n// A collection of well-known cookie names shared between Prismic libraries and systems.\nexport * as cookie from \"./cookie\";\n\n// General types used to query content from Prismic. These are made public to allow users to better type their projects.\nexport type {\n\tAbortSignalLike,\n\tClientConfig,\n\tCreateClient,\n\tFetchLike,\n\tHttpRequestLike,\n\tRequestInitLike,\n\tResponseLike,\n} from \"./createClient\";\nexport type {\n\tBuildQueryURLArgs,\n\tOrdering,\n\tQueryParams,\n\tRoute,\n} from \"./buildQueryURL\";\n\n//=============================================================================\n// Helpers - Manipulate content from Prismic.\n//=============================================================================\n\n// Primary Helpers API.\nexport { asDate } from \"./helpers/asDate\";\nexport { asLink } from \"./helpers/asLink\";\nexport { asLinkAttrs } from \"./helpers/asLinkAttrs\";\nexport { asText } from \"./helpers/asText\";\nexport { asHTML } from \"./helpers/asHTML\";\nexport { asImageSrc } from \"./helpers/asImageSrc\";\nexport { asImageWidthSrcSet } from \"./helpers/asImageWidthSrcSet\";\nexport { asImagePixelDensitySrcSet } from \"./helpers/asImagePixelDensitySrcSet\";\nexport { unstable_mapSliceZone } from \"./helpers/unstable_mapSliceZone\";\nexport * as isFilled from \"./helpers/isFilled\";\n\n// Conversion helper.\nexport { documentToLinkField } from \"./helpers/documentToLinkField\";\n\nexport type { LinkResolverFunction } from \"./helpers/asLink\";\nexport type { AsLinkAttrsConfig } from \"./helpers/asLinkAttrs\";\n\n/**\n * @deprecated Renamed to `HTMLRichTextMapSerializer`\n */\ntype HTMLMapSerializer = HTMLRichTextMapSerializer;\n/**\n * @deprecated Renamed to `HTMLRichTextFunctionSerializer`\n */\ntype HTMLFunctionSerializer = HTMLRichTextFunctionSerializer;\nexport type {\n\tHTMLRichTextMapSerializer,\n\tHTMLRichTextFunctionSerializer,\n\tHTMLMapSerializer,\n\tHTMLFunctionSerializer,\n};\nexport type { HTMLRichTextSerializer } from \"./helpers/asHTML\";\n\n//=============================================================================\n// Errors - Custom errors for Prismic APIs.\n//=============================================================================\n\nexport { PrismicError } from \"./errors/PrismicError\";\nexport { ForbiddenError } from \"./errors/ForbiddenError\";\nexport { NotFoundError } from \"./errors/NotFoundError\";\nexport { RefNotFoundError } from \"./errors/RefNotFoundError\";\nexport { RefExpiredError } from \"./errors/RefExpiredError\";\nexport { ParsingError } from \"./errors/ParsingError\";\n\n//=============================================================================\n// Types - Types representing Prismic content, models, and API payloads.\n//=============================================================================\n\n// Values - Types representing Prismic content.\n/**\n * @deprecated Use {@link RichTextNodeType} instead.\n */\n// TODO: Remove in v8.\nconst Element = RichTextNodeType;\nexport { RichTextNodeType, Element };\nexport { LinkType } from \"./types/value/link\";\nexport { OEmbedType } from \"./types/value/embed\";\n\nexport type {\n\tPrismicDocument,\n\tPrismicDocumentWithUID,\n\tPrismicDocumentWithoutUID,\n\tPrismicDocumentHeader,\n\tAlternateLanguage,\n} from \"./types/value/document\";\n\nexport type {\n\t// RichText & Title\n\tRichTextField,\n\t// RichText & Title (block nodes)\n\tRTTextNodeBase,\n\tRTHeading1Node,\n\tRTHeading2Node,\n\tRTHeading3Node,\n\tRTHeading4Node,\n\tRTHeading5Node,\n\tRTHeading6Node,\n\tRTParagraphNode,\n\tRTPreformattedNode,\n\tRTListItemNode,\n\tRTOListItemNode,\n\t// RichText & Title (span nodes)\n\tRTSpanNodeBase,\n\tRTStrongNode,\n\tRTEmNode,\n\tRTLabelNode,\n\t// RichText & Title (media nodes)\n\tRTImageNode,\n\tRTEmbedNode,\n\t// RichText & Title (link nodes)\n\tRTLinkNode,\n\t// RichText & Title (serialization related nodes)\n\tRTListNode,\n\tRTOListNode,\n\tRTSpanNode,\n\t// RichText & Title (helpers)\n\tRTNode,\n\tRTTextNode,\n\tRTBlockNode,\n\tRTInlineNode,\n\tRTAnyNode,\n} from \"./types/value/richText\";\nexport type { TitleField } from \"./types/value/title\";\n\nexport type {\n\tImageField,\n\tImageFieldImage,\n\tFilledImageFieldImage,\n\tEmptyImageFieldImage,\n} from \"./types/value/image\";\n\nexport type {\n\tEmptyLinkField,\n\tLinkField,\n\tFilledLinkToWebField,\n} from \"./types/value/link\";\nexport type {\n\tContentRelationshipField,\n\tFilledContentRelationshipField,\n} from \"./types/value/contentRelationship\";\nexport type {\n\tLinkToMediaField,\n\tFilledLinkToMediaField,\n} from \"./types/value/linkToMedia\";\n\nexport type {\n\tOEmbedExtra,\n\tPhotoOEmbed,\n\tVideoOEmbed,\n\tLinkOEmbed,\n\tRichOEmbed,\n\tAnyOEmbed,\n\tEmbedField,\n} from \"./types/value/embed\";\n\nexport type { BooleanField } from \"./types/value/boolean\";\nexport type { ColorField } from \"./types/value/color\";\nexport type { DateField } from \"./types/value/date\";\nexport type { KeyTextField } from \"./types/value/keyText\";\nexport type { NumberField } from \"./types/value/number\";\nexport type { SelectField } from \"./types/value/select\";\nexport type { TimestampField } from \"./types/value/timestamp\";\nexport type { GeoPointField } from \"./types/value/geoPoint\";\n\n/**\n * @deprecated Renamed to `IntegrationField`\n */\n// TODO: Remove when we remove support for deprecated `IntegrationFields` export.\ntype IntegrationFields = IntegrationField;\nexport { IntegrationField, IntegrationFields };\n\nexport type { GroupField } from \"./types/value/group\";\n\nexport type { SliceZone } from \"./types/value/sliceZone\";\nexport type { Slice } from \"./types/value/slice\";\nexport type { SharedSlice } from \"./types/value/sharedSlice\";\nexport type { SharedSliceVariation } from \"./types/value/sharedSliceVariation\";\n\nexport type { FieldState, AnyRegularField } from \"./types/value/types\";\n\n// Models - Types representing Prismic content models.\nexport { CustomTypeModelFieldType } from \"./types/model/types\";\nexport { CustomTypeModelLinkSelectType } from \"./types/model/link\";\nexport { CustomTypeModelSliceType } from \"./types/model/sliceZone\";\nexport { CustomTypeModelSliceDisplay } from \"./types/model/slice\";\n\nexport type {\n\tCustomTypeModel,\n\tCustomTypeModelDefinition,\n\tCustomTypeModelTab,\n} from \"./types/model/customType\";\n\nexport type {\n\tCustomTypeModelRichTextField,\n\tCustomTypeModelRichTextMultiField,\n\tCustomTypeModelRichTextSingleField,\n} from \"./types/model/richText\";\nexport type { CustomTypeModelTitleField } from \"./types/model/title\";\n\nexport type {\n\tCustomTypeModelImageField,\n\tCustomTypeModelImageConstraint,\n\tCustomTypeModelImageThumbnail,\n} from \"./types/model/image\";\n\nexport type { CustomTypeModelContentRelationshipField } from \"./types/model/contentRelationship\";\nexport type { CustomTypeModelLinkField } from \"./types/model/link\";\nexport type { CustomTypeModelLinkToMediaField } from \"./types/model/linkToMedia\";\n\nexport type { CustomTypeModelEmbedField } from \"./types/model/embed\";\n\nexport type { CustomTypeModelBooleanField } from \"./types/model/boolean\";\nexport type { CustomTypeModelColorField } from \"./types/model/color\";\nexport type { CustomTypeModelDateField } from \"./types/model/date\";\nexport type { CustomTypeModelKeyTextField } from \"./types/model/keyText\";\nexport type { CustomTypeModelNumberField } from \"./types/model/number\";\nexport type { CustomTypeModelSelectField } from \"./types/model/select\";\nexport type { CustomTypeModelTimestampField } from \"./types/model/timestamp\";\nexport type { CustomTypeModelGeoPointField } from \"./types/model/geoPoint\";\n\n/**\n * @deprecated Renamed to `CustomTypeModelIntegrationField`.\n */\n// TODO: Remove when we remove support for deprecated `CustomTypeModelIntegrationField` export.\ntype CustomTypeModelIntegrationFieldsField = CustomTypeModelIntegrationField;\nexport {\n\tCustomTypeModelIntegrationField,\n\tCustomTypeModelIntegrationFieldsField,\n};\nexport type { CustomTypeModelGroupField } from \"./types/model/group\";\nexport type {\n\tCustomTypeModelSliceZoneField,\n\tCustomTypeModelSliceLabel,\n\tCustomTypeModelSharedSlice,\n} from \"./types/model/sliceZone\";\nexport type {\n\tCustomTypeModelSlice,\n\tCustomTypeModelLegacySlice,\n} from \"./types/model/slice\";\nexport type { SharedSliceModel } from \"./types/model/sharedSlice\";\nexport type { SharedSliceModelVariation } from \"./types/model/sharedSliceVariation\";\n\nexport type { CustomTypeModelUIDField } from \"./types/model/uid\";\n\nexport type { CustomTypeModelRangeField } from \"./types/model/range\";\nexport type { CustomTypeModelSeparatorField } from \"./types/model/separator\";\n\nexport type {\n\tCustomTypeModelField,\n\tCustomTypeModelFieldForGroup,\n} from \"./types/model/types\";\n\n// API - Types representing Prismic Rest API V2 responses.\nexport type { Query } from \"./types/api/query\";\n\nexport type { Ref } from \"./types/api/ref\";\n\nexport type { Release } from \"./types/api/release\";\n\nexport type {\n\tRepository,\n\tLanguage,\n\tForm,\n\tFormField,\n} from \"./types/api/repository\";\n\nexport type { Tags } from \"./types/api/tags\";\n\n// Webhook - Types representing Prismic webhooks.\nexport { WebhookType } from \"./types/webhook/types\";\n\nexport type { WebhookBody } from \"./types/webhook/types\";\n\nexport type { WebhookBodyAPIUpdate } from \"./types/webhook/apiUpdate\";\n\nexport type { WebhookBodyTestTrigger } from \"./types/webhook/testTrigger\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,YAAY;AAiFlB,MAAM,UAAU;"}
|
|
@@ -1,50 +1,106 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const link = require("../types/value/link.cjs");
|
|
4
|
-
const richText = require("../types/value/richText.cjs");
|
|
5
4
|
const asLink = require("../helpers/asLink.cjs");
|
|
6
5
|
const escapeHTML = require("./escapeHTML.cjs");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return `<${tag}${getLabel(node)}>${children.join("")}</${tag}>`;
|
|
12
|
-
};
|
|
13
|
-
const serializePreFormatted = (node) => {
|
|
14
|
-
return `<pre${getLabel(node)}>${escapeHTML.escapeHTML(node.text)}</pre>`;
|
|
15
|
-
};
|
|
16
|
-
const serializeImage = (linkResolver, node) => {
|
|
17
|
-
let imageTag = `<img src="${node.url}" alt="${escapeHTML.escapeHTML(node.alt)}"${node.copyright ? ` copyright="${escapeHTML.escapeHTML(node.copyright)}"` : ""} />`;
|
|
18
|
-
if (node.linkTo) {
|
|
19
|
-
imageTag = serializeHyperlink(linkResolver, {
|
|
20
|
-
type: richText.RichTextNodeType.hyperlink,
|
|
21
|
-
data: node.linkTo,
|
|
22
|
-
start: 0,
|
|
23
|
-
end: 0
|
|
24
|
-
}, [imageTag]);
|
|
6
|
+
const formatAttributes = (node, attributes) => {
|
|
7
|
+
const _attributes = { ...attributes };
|
|
8
|
+
if ("data" in node && "label" in node.data && node.data.label) {
|
|
9
|
+
_attributes.class = _attributes.class ? `${_attributes.class} ${node.data.label}` : node.data.label;
|
|
25
10
|
}
|
|
26
|
-
|
|
11
|
+
const result = [];
|
|
12
|
+
for (const key in _attributes) {
|
|
13
|
+
const value = _attributes[key];
|
|
14
|
+
if (value) {
|
|
15
|
+
if (typeof value === "boolean") {
|
|
16
|
+
result.push(key);
|
|
17
|
+
} else {
|
|
18
|
+
result.push(`${key}="${escapeHTML.escapeHTML(value)}"`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (result.length) {
|
|
23
|
+
result.unshift("");
|
|
24
|
+
}
|
|
25
|
+
return result.join(" ");
|
|
27
26
|
};
|
|
28
|
-
const
|
|
29
|
-
return
|
|
27
|
+
const getGeneralAttributes = (serializerOrShorthand) => {
|
|
28
|
+
return serializerOrShorthand && typeof serializerOrShorthand !== "function" ? serializerOrShorthand : {};
|
|
30
29
|
};
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
const serializeStandardTag = (tag, serializerOrShorthand) => {
|
|
31
|
+
const generalAttributes = getGeneralAttributes(serializerOrShorthand);
|
|
32
|
+
return ({ node, children }) => {
|
|
33
|
+
return `<${tag}${formatAttributes(node, generalAttributes)}>${children}</${tag}>`;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const serializePreFormatted = (serializerOrShorthand) => {
|
|
37
|
+
const generalAttributes = getGeneralAttributes(serializerOrShorthand);
|
|
38
|
+
return ({ node }) => {
|
|
39
|
+
return `<pre${formatAttributes(node, generalAttributes)}>${escapeHTML.escapeHTML(node.text)}</pre>`;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const serializeImage = (linkResolver, serializerOrShorthand) => {
|
|
43
|
+
const generalAttributes = getGeneralAttributes(serializerOrShorthand);
|
|
44
|
+
return ({ node }) => {
|
|
45
|
+
const attributes = {
|
|
46
|
+
...generalAttributes,
|
|
47
|
+
src: node.url,
|
|
48
|
+
alt: node.alt,
|
|
49
|
+
copyright: node.copyright
|
|
50
|
+
};
|
|
51
|
+
let imageTag = `<img${formatAttributes(node, attributes)} />`;
|
|
52
|
+
if (node.linkTo) {
|
|
53
|
+
imageTag = serializeHyperlink(linkResolver)({
|
|
54
|
+
type: "hyperlink",
|
|
55
|
+
node: {
|
|
56
|
+
type: "hyperlink",
|
|
57
|
+
data: node.linkTo,
|
|
58
|
+
start: 0,
|
|
59
|
+
end: 0
|
|
60
|
+
},
|
|
61
|
+
text: "",
|
|
62
|
+
children: imageTag,
|
|
63
|
+
key: ""
|
|
64
|
+
});
|
|
38
65
|
}
|
|
39
|
-
|
|
40
|
-
|
|
66
|
+
return `<p class="block-img">${imageTag}</p>`;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
const serializeEmbed = (serializerOrShorthand) => {
|
|
70
|
+
const generalAttributes = getGeneralAttributes(serializerOrShorthand);
|
|
71
|
+
return ({ node }) => {
|
|
72
|
+
const attributes = {
|
|
73
|
+
...generalAttributes,
|
|
74
|
+
["data-oembed"]: node.oembed.embed_url,
|
|
75
|
+
["data-oembed-type"]: node.oembed.type,
|
|
76
|
+
["data-oembed-provider"]: node.oembed.provider_name
|
|
77
|
+
};
|
|
78
|
+
return `<div${formatAttributes(node, attributes)}>${node.oembed.html}</div>`;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const serializeHyperlink = (linkResolver, serializerOrShorthand) => {
|
|
82
|
+
const generalAttributes = getGeneralAttributes(serializerOrShorthand);
|
|
83
|
+
return ({ node, children }) => {
|
|
84
|
+
const attributes = {
|
|
85
|
+
...generalAttributes
|
|
86
|
+
};
|
|
87
|
+
if (node.data.link_type === link.LinkType.Web) {
|
|
88
|
+
attributes.href = node.data.url;
|
|
89
|
+
attributes.target = node.data.target;
|
|
90
|
+
attributes.rel = "noopener noreferrer";
|
|
91
|
+
} else if (node.data.link_type === link.LinkType.Document) {
|
|
92
|
+
attributes.href = asLink.asLink(node.data, { linkResolver });
|
|
93
|
+
} else if (node.data.link_type === link.LinkType.Media) {
|
|
94
|
+
attributes.href = node.data.url;
|
|
41
95
|
}
|
|
42
|
-
|
|
96
|
+
return `<a${formatAttributes(node, attributes)}>${children}</a>`;
|
|
97
|
+
};
|
|
43
98
|
};
|
|
44
|
-
const serializeSpan = (
|
|
45
|
-
return
|
|
99
|
+
const serializeSpan = () => {
|
|
100
|
+
return ({ text }) => {
|
|
101
|
+
return text ? escapeHTML.escapeHTML(text).replace(/\n/g, "<br />") : "";
|
|
102
|
+
};
|
|
46
103
|
};
|
|
47
|
-
exports.getLabel = getLabel;
|
|
48
104
|
exports.serializeEmbed = serializeEmbed;
|
|
49
105
|
exports.serializeHyperlink = serializeHyperlink;
|
|
50
106
|
exports.serializeImage = serializeImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializerHelpers.cjs","sources":["../../../src/lib/serializerHelpers.ts"],"sourcesContent":["import { LinkType } from \"../types/value/link\";\nimport {\
|
|
1
|
+
{"version":3,"file":"serializerHelpers.cjs","sources":["../../../src/lib/serializerHelpers.ts"],"sourcesContent":["import type { RichTextMapSerializer } from \"../richtext/types\";\nimport { LinkType } from \"../types/value/link\";\nimport { RTAnyNode } from \"../types/value/richText\";\n\nimport {\n\tHTMLRichTextMapSerializer,\n\tHTMLStrictRichTextMapSerializer,\n} from \"../helpers/asHTML\";\nimport { LinkResolverFunction, asLink } from \"../helpers/asLink\";\n\nimport { escapeHTML } from \"./escapeHTML\";\n\ntype Attributes = Record<string, string | boolean | null | undefined>;\nconst formatAttributes = (node: RTAnyNode, attributes: Attributes): string => {\n\tconst _attributes = { ...attributes };\n\n\t// Add label to attributes\n\tif (\"data\" in node && \"label\" in node.data && node.data.label) {\n\t\t_attributes.class = _attributes.class\n\t\t\t? `${_attributes.class} ${node.data.label}`\n\t\t\t: node.data.label;\n\t}\n\n\tconst result = [];\n\n\tfor (const key in _attributes) {\n\t\tconst value = _attributes[key];\n\n\t\tif (value) {\n\t\t\tif (typeof value === \"boolean\") {\n\t\t\t\tresult.push(key);\n\t\t\t} else {\n\t\t\t\tresult.push(`${key}=\"${escapeHTML(value)}\"`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add a space at the beginning if there's any result\n\tif (result.length) {\n\t\tresult.unshift(\"\");\n\t}\n\n\treturn result.join(\" \");\n};\n\nconst getGeneralAttributes = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[keyof HTMLRichTextMapSerializer],\n): Attributes => {\n\treturn serializerOrShorthand && typeof serializerOrShorthand !== \"function\"\n\t\t? serializerOrShorthand\n\t\t: {};\n};\n\nexport const serializeStandardTag = <\n\tBlockType extends keyof RichTextMapSerializer<string>,\n>(\n\ttag: string,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[BlockType],\n): NonNullable<HTMLStrictRichTextMapSerializer[BlockType]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand);\n\n\treturn (({ node, children }) => {\n\t\treturn `<${tag}${formatAttributes(\n\t\t\tnode,\n\t\t\tgeneralAttributes,\n\t\t)}>${children}</${tag}>`;\n\t}) as NonNullable<HTMLStrictRichTextMapSerializer[BlockType]>;\n};\n\nexport const serializePreFormatted = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"preformatted\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"preformatted\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand);\n\n\treturn ({ node }) => {\n\t\treturn `<pre${formatAttributes(node, generalAttributes)}>${escapeHTML(\n\t\t\tnode.text,\n\t\t)}</pre>`;\n\t};\n};\n\nexport const serializeImage = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"image\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"image\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand);\n\n\treturn ({ node }) => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t\tsrc: node.url,\n\t\t\talt: node.alt,\n\t\t\tcopyright: node.copyright,\n\t\t};\n\n\t\tlet imageTag = `<img${formatAttributes(node, attributes)} />`;\n\n\t\t// If the image has a link, we wrap it with an anchor tag\n\t\tif (node.linkTo) {\n\t\t\timageTag = serializeHyperlink(linkResolver)({\n\t\t\t\ttype: \"hyperlink\",\n\t\t\t\tnode: {\n\t\t\t\t\ttype: \"hyperlink\",\n\t\t\t\t\tdata: node.linkTo,\n\t\t\t\t\tstart: 0,\n\t\t\t\t\tend: 0,\n\t\t\t\t},\n\t\t\t\ttext: \"\",\n\t\t\t\tchildren: imageTag,\n\t\t\t\tkey: \"\",\n\t\t\t})!;\n\t\t}\n\n\t\treturn `<p class=\"block-img\">${imageTag}</p>`;\n\t};\n};\n\nexport const serializeEmbed = (\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"embed\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"embed\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand);\n\n\treturn ({ node }) => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t\t[\"data-oembed\"]: node.oembed.embed_url,\n\t\t\t[\"data-oembed-type\"]: node.oembed.type,\n\t\t\t[\"data-oembed-provider\"]: node.oembed.provider_name,\n\t\t};\n\n\t\treturn `<div${formatAttributes(node, attributes)}>${\n\t\t\tnode.oembed.html\n\t\t}</div>`;\n\t};\n};\n\nexport const serializeHyperlink = (\n\tlinkResolver:\n\t\t| LinkResolverFunction<string | null | undefined>\n\t\t| undefined\n\t\t| null,\n\tserializerOrShorthand?: HTMLRichTextMapSerializer[\"hyperlink\"],\n): NonNullable<HTMLStrictRichTextMapSerializer[\"hyperlink\"]> => {\n\tconst generalAttributes = getGeneralAttributes(serializerOrShorthand);\n\n\treturn ({ node, children }): string => {\n\t\tconst attributes = {\n\t\t\t...generalAttributes,\n\t\t};\n\n\t\tif (node.data.link_type === LinkType.Web) {\n\t\t\tattributes.href = node.data.url;\n\t\t\tattributes.target = node.data.target;\n\t\t\tattributes.rel = \"noopener noreferrer\";\n\t\t} else if (node.data.link_type === LinkType.Document) {\n\t\t\tattributes.href = asLink(node.data, { linkResolver });\n\t\t} else if (node.data.link_type === LinkType.Media) {\n\t\t\tattributes.href = node.data.url;\n\t\t}\n\n\t\treturn `<a${formatAttributes(node, attributes)}>${children}</a>`;\n\t};\n};\n\nexport const serializeSpan = (): NonNullable<\n\tHTMLStrictRichTextMapSerializer[\"span\"]\n> => {\n\treturn ({ text }): string => {\n\t\treturn text ? escapeHTML(text).replace(/\\n/g, \"<br />\") : \"\";\n\t};\n};\n"],"names":["escapeHTML","LinkType","asLink"],"mappings":";;;;;AAaA,MAAM,mBAAmB,CAAC,MAAiB,eAAkC;AACtE,QAAA,cAAc,EAAE,GAAG;AAGzB,MAAI,UAAU,QAAQ,WAAW,KAAK,QAAQ,KAAK,KAAK,OAAO;AAC9D,gBAAY,QAAQ,YAAY,QAC7B,GAAG,YAAY,KAAK,IAAI,KAAK,KAAK,KAAK,KACvC,KAAK,KAAK;AAAA,EACb;AAED,QAAM,SAAS,CAAA;AAEf,aAAW,OAAO,aAAa;AACxB,UAAA,QAAQ,YAAY,GAAG;AAE7B,QAAI,OAAO;AACN,UAAA,OAAO,UAAU,WAAW;AAC/B,eAAO,KAAK,GAAG;AAAA,MAAA,OACT;AACN,eAAO,KAAK,GAAG,GAAG,KAAKA,WAAAA,WAAW,KAAK,CAAC,GAAG;AAAA,MAC3C;AAAA,IACD;AAAA,EACD;AAGD,MAAI,OAAO,QAAQ;AAClB,WAAO,QAAQ,EAAE;AAAA,EACjB;AAEM,SAAA,OAAO,KAAK,GAAG;AACvB;AAEA,MAAM,uBAAuB,CAC5B,0BACe;AACf,SAAO,yBAAyB,OAAO,0BAA0B,aAC9D,wBACA,CAAA;AACJ;AAEa,MAAA,uBAAuB,CAGnC,KACA,0BAC4D;AACtD,QAAA,oBAAoB,qBAAqB,qBAAqB;AAEpE,SAAQ,CAAC,EAAE,MAAM,eAAc;AACvB,WAAA,IAAI,GAAG,GAAG,iBAChB,MACA,iBAAiB,CACjB,IAAI,QAAQ,KAAK,GAAG;AAAA,EAAA;AAEvB;AAEa,MAAA,wBAAwB,CACpC,0BACiE;AAC3D,QAAA,oBAAoB,qBAAqB,qBAAqB;AAE7D,SAAA,CAAC,EAAE,WAAU;AACZ,WAAA,OAAO,iBAAiB,MAAM,iBAAiB,CAAC,IAAIA,WAAAA,WAC1D,KAAK,IAAI,CACT;AAAA,EAAA;AAEH;AAEa,MAAA,iBAAiB,CAC7B,cAIA,0BAC0D;AACpD,QAAA,oBAAoB,qBAAqB,qBAAqB;AAE7D,SAAA,CAAC,EAAE,WAAU;AACnB,UAAM,aAAa;AAAA,MAClB,GAAG;AAAA,MACH,KAAK,KAAK;AAAA,MACV,KAAK,KAAK;AAAA,MACV,WAAW,KAAK;AAAA,IAAA;AAGjB,QAAI,WAAW,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAGxD,QAAI,KAAK,QAAQ;AACL,iBAAA,mBAAmB,YAAY,EAAE;AAAA,QAC3C,MAAM;AAAA,QACN,MAAM;AAAA,UACL,MAAM;AAAA,UACN,MAAM,KAAK;AAAA,UACX,OAAO;AAAA,UACP,KAAK;AAAA,QACL;AAAA,QACD,MAAM;AAAA,QACN,UAAU;AAAA,QACV,KAAK;AAAA,MAAA,CACL;AAAA,IACD;AAED,WAAO,wBAAwB,QAAQ;AAAA,EAAA;AAEzC;AAEa,MAAA,iBAAiB,CAC7B,0BAC0D;AACpD,QAAA,oBAAoB,qBAAqB,qBAAqB;AAE7D,SAAA,CAAC,EAAE,WAAU;AACnB,UAAM,aAAa;AAAA,MAClB,GAAG;AAAA,MACH,CAAC,aAAa,GAAG,KAAK,OAAO;AAAA,MAC7B,CAAC,kBAAkB,GAAG,KAAK,OAAO;AAAA,MAClC,CAAC,sBAAsB,GAAG,KAAK,OAAO;AAAA,IAAA;AAGhC,WAAA,OAAO,iBAAiB,MAAM,UAAU,CAAC,IAC/C,KAAK,OAAO,IACb;AAAA,EAAA;AAEF;AAEa,MAAA,qBAAqB,CACjC,cAIA,0BAC8D;AACxD,QAAA,oBAAoB,qBAAqB,qBAAqB;AAEpE,SAAO,CAAC,EAAE,MAAM,eAAsB;AACrC,UAAM,aAAa;AAAA,MAClB,GAAG;AAAA,IAAA;AAGJ,QAAI,KAAK,KAAK,cAAcC,KAAAA,SAAS,KAAK;AAC9B,iBAAA,OAAO,KAAK,KAAK;AACjB,iBAAA,SAAS,KAAK,KAAK;AAC9B,iBAAW,MAAM;AAAA,IACP,WAAA,KAAK,KAAK,cAAcA,KAAAA,SAAS,UAAU;AACrD,iBAAW,OAAOC,cAAO,KAAK,MAAM,EAAE,cAAc;AAAA,IAC1C,WAAA,KAAK,KAAK,cAAcD,KAAAA,SAAS,OAAO;AACvC,iBAAA,OAAO,KAAK,KAAK;AAAA,IAC5B;AAED,WAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC,IAAI,QAAQ;AAAA,EAAA;AAE5D;AAEO,MAAM,gBAAgB,MAEzB;AACI,SAAA,CAAC,EAAE,WAAkB;AAC3B,WAAO,OAAOD,WAAW,WAAA,IAAI,EAAE,QAAQ,OAAO,QAAQ,IAAI;AAAA,EAAA;AAE5D;;;;;;;"}
|