@prismicio/client 7.0.0-alpha.1 → 7.0.0-alpha.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/helpers/asLinkAttrs.cjs.map +1 -1
- package/dist/helpers/asLinkAttrs.d.ts +1 -1
- package/dist/helpers/asLinkAttrs.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
- package/src/helpers/asLinkAttrs.ts +1 -1
- package/src/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asLinkAttrs.cjs","sources":["../../../src/helpers/asLinkAttrs.ts"],"sourcesContent":["import { isInternalURL } from \"../lib/isInternalURL\";\n\nimport type { FilledContentRelationshipField } from \"../types/value/contentRelationship\";\nimport type { PrismicDocument } from \"../types/value/document\";\nimport { FilledLinkToWebField, LinkField } from \"../types/value/link\";\nimport type { FilledLinkToMediaField } from \"../types/value/linkToMedia\";\n\nimport { AsLinkReturnType, LinkResolverFunction, asLink } from \"./asLink\";\nimport { link as isFilledLink } from \"./isFilled\";\n\ntype AsLinkAttrsConfigRelArgs<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = {\n\thref:\n\t\t| NonNullable<AsLinkReturnType<LinkResolverFunctionReturnType, Field>>\n\t\t| undefined;\n\tisExternal: boolean;\n\ttarget?: string;\n};\n\
|
|
1
|
+
{"version":3,"file":"asLinkAttrs.cjs","sources":["../../../src/helpers/asLinkAttrs.ts"],"sourcesContent":["import { isInternalURL } from \"../lib/isInternalURL\";\n\nimport type { FilledContentRelationshipField } from \"../types/value/contentRelationship\";\nimport type { PrismicDocument } from \"../types/value/document\";\nimport { FilledLinkToWebField, LinkField } from \"../types/value/link\";\nimport type { FilledLinkToMediaField } from \"../types/value/linkToMedia\";\n\nimport { AsLinkReturnType, LinkResolverFunction, asLink } from \"./asLink\";\nimport { link as isFilledLink } from \"./isFilled\";\n\ntype AsLinkAttrsConfigRelArgs<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = {\n\thref:\n\t\t| NonNullable<AsLinkReturnType<LinkResolverFunctionReturnType, Field>>\n\t\t| undefined;\n\tisExternal: boolean;\n\ttarget?: string;\n};\n\nexport type AsLinkAttrsConfig<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = {\n\tlinkResolver?: LinkResolverFunction<LinkResolverFunctionReturnType>;\n\trel?: (\n\t\targs: AsLinkAttrsConfigRelArgs<LinkResolverFunctionReturnType, Field>,\n\t) => string | undefined | void;\n};\n\n/**\n * The return type of `asLinkAttrs()`.\n */\ntype AsLinkAttrsReturnType<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = Field extends\n\t| FilledLinkToWebField\n\t| FilledLinkToMediaField\n\t| FilledContentRelationshipField\n\t| PrismicDocument\n\t? {\n\t\t\thref:\n\t\t\t\t| NonNullable<AsLinkReturnType<LinkResolverFunctionReturnType, Field>>\n\t\t\t\t| undefined;\n\t\t\ttarget?: string;\n\t\t\trel?: string;\n\t }\n\t: {\n\t\t\thref?: undefined;\n\t\t\ttarget?: undefined;\n\t\t\trel?: undefined;\n\t };\n\n/**\n * Resolves any type of Link field or Prismic document to a set of link attributes. The attributes are designed to be passed to link HTML elements, like `<a>`.\n *\n * If a resolved URL is external (i.e. starts with a protocol like `https://`), `rel` is returned as `\"noreferrer\"`.\n *\n * @typeParam LinkResolverFunctionReturnType - Link Resolver function return\n * type\n * @typeParam Field - Link field or Prismic document to resolve to link attributes\n * @param linkFieldOrDocument - Any kind of Link field or a document to resolve\n * @param config - Configuration that determines the output of `asLinkAttrs()`\n *\n * @returns Resolved set of link attributes or, if the provided Link field or document is empty, and empty object\n * @see Prismic Link Resolver documentation: {@link https://prismic.io/docs/route-resolver#link-resolver}\n * @see Prismic API `routes` options documentation: {@link https://prismic.io/docs/route-resolver}\n */\nexport const asLinkAttrs = <\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n>(\n\tlinkFieldOrDocument: Field,\n\tconfig: AsLinkAttrsConfig<LinkResolverFunctionReturnType> = {},\n): AsLinkAttrsReturnType<LinkResolverFunctionReturnType> => {\n\tif (\n\t\tlinkFieldOrDocument &&\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t// @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n\t\t(\"link_type\" in linkFieldOrDocument\n\t\t\t? isFilledLink(linkFieldOrDocument)\n\t\t\t: linkFieldOrDocument)\n\t) {\n\t\tconst target =\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n\t\t\t\"target\" in linkFieldOrDocument ? linkFieldOrDocument.target : undefined;\n\n\t\tconst rawHref = asLink(linkFieldOrDocument, config.linkResolver);\n\t\tconst href =\n\t\t\trawHref == null ? undefined : (rawHref as NonNullable<typeof rawHref>);\n\n\t\tconst isExternal = typeof href === \"string\" ? !isInternalURL(href) : false;\n\n\t\tconst rel = config.rel\n\t\t\t? config.rel({ href, isExternal, target })\n\t\t\t: isExternal\n\t\t\t? \"noreferrer\"\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\thref,\n\t\t\ttarget,\n\t\t\trel: rel == null ? undefined : rel,\n\t\t};\n\t}\n\n\treturn {};\n};\n"],"names":["isFilledLink","asLink","isInternalURL"],"mappings":";;;;;AAkFO,MAAM,cAAc,CAQ1B,qBACA,SAA4D,OACF;AAEzD,MAAA;AAAA;AAAA,GAGC,eAAe,sBACbA,SAAAA,KAAa,mBAAmB,IAChC,sBACF;AACK,UAAA;AAAA;AAAA;AAAA,MAGL,YAAY,sBAAsB,oBAAoB,SAAS;AAAA;AAEhE,UAAM,UAAUC,OAAA,OAAO,qBAAqB,OAAO,YAAY;AACzD,UAAA,OACL,WAAW,OAAO,SAAa;AAEhC,UAAM,aAAa,OAAO,SAAS,WAAW,CAACC,4BAAc,IAAI,IAAI;AAErE,UAAM,MAAM,OAAO,MAChB,OAAO,IAAI,EAAE,MAAM,YAAY,OAAM,CAAE,IACvC,aACA,eACA;AAEI,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,KAAK,OAAO,OAAO,SAAY;AAAA,IAAA;AAAA,EAEhC;AAED,SAAO;AACR;;"}
|
|
@@ -8,7 +8,7 @@ type AsLinkAttrsConfigRelArgs<LinkResolverFunctionReturnType = ReturnType<LinkRe
|
|
|
8
8
|
isExternal: boolean;
|
|
9
9
|
target?: string;
|
|
10
10
|
};
|
|
11
|
-
type AsLinkAttrsConfig<LinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>, Field extends LinkField | PrismicDocument | null | undefined = LinkField | PrismicDocument | null | undefined> = {
|
|
11
|
+
export type AsLinkAttrsConfig<LinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>, Field extends LinkField | PrismicDocument | null | undefined = LinkField | PrismicDocument | null | undefined> = {
|
|
12
12
|
linkResolver?: LinkResolverFunction<LinkResolverFunctionReturnType>;
|
|
13
13
|
rel?: (args: AsLinkAttrsConfigRelArgs<LinkResolverFunctionReturnType, Field>) => string | undefined | void;
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asLinkAttrs.js","sources":["../../../src/helpers/asLinkAttrs.ts"],"sourcesContent":["import { isInternalURL } from \"../lib/isInternalURL\";\n\nimport type { FilledContentRelationshipField } from \"../types/value/contentRelationship\";\nimport type { PrismicDocument } from \"../types/value/document\";\nimport { FilledLinkToWebField, LinkField } from \"../types/value/link\";\nimport type { FilledLinkToMediaField } from \"../types/value/linkToMedia\";\n\nimport { AsLinkReturnType, LinkResolverFunction, asLink } from \"./asLink\";\nimport { link as isFilledLink } from \"./isFilled\";\n\ntype AsLinkAttrsConfigRelArgs<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = {\n\thref:\n\t\t| NonNullable<AsLinkReturnType<LinkResolverFunctionReturnType, Field>>\n\t\t| undefined;\n\tisExternal: boolean;\n\ttarget?: string;\n};\n\
|
|
1
|
+
{"version":3,"file":"asLinkAttrs.js","sources":["../../../src/helpers/asLinkAttrs.ts"],"sourcesContent":["import { isInternalURL } from \"../lib/isInternalURL\";\n\nimport type { FilledContentRelationshipField } from \"../types/value/contentRelationship\";\nimport type { PrismicDocument } from \"../types/value/document\";\nimport { FilledLinkToWebField, LinkField } from \"../types/value/link\";\nimport type { FilledLinkToMediaField } from \"../types/value/linkToMedia\";\n\nimport { AsLinkReturnType, LinkResolverFunction, asLink } from \"./asLink\";\nimport { link as isFilledLink } from \"./isFilled\";\n\ntype AsLinkAttrsConfigRelArgs<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = {\n\thref:\n\t\t| NonNullable<AsLinkReturnType<LinkResolverFunctionReturnType, Field>>\n\t\t| undefined;\n\tisExternal: boolean;\n\ttarget?: string;\n};\n\nexport type AsLinkAttrsConfig<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = {\n\tlinkResolver?: LinkResolverFunction<LinkResolverFunctionReturnType>;\n\trel?: (\n\t\targs: AsLinkAttrsConfigRelArgs<LinkResolverFunctionReturnType, Field>,\n\t) => string | undefined | void;\n};\n\n/**\n * The return type of `asLinkAttrs()`.\n */\ntype AsLinkAttrsReturnType<\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n> = Field extends\n\t| FilledLinkToWebField\n\t| FilledLinkToMediaField\n\t| FilledContentRelationshipField\n\t| PrismicDocument\n\t? {\n\t\t\thref:\n\t\t\t\t| NonNullable<AsLinkReturnType<LinkResolverFunctionReturnType, Field>>\n\t\t\t\t| undefined;\n\t\t\ttarget?: string;\n\t\t\trel?: string;\n\t }\n\t: {\n\t\t\thref?: undefined;\n\t\t\ttarget?: undefined;\n\t\t\trel?: undefined;\n\t };\n\n/**\n * Resolves any type of Link field or Prismic document to a set of link attributes. The attributes are designed to be passed to link HTML elements, like `<a>`.\n *\n * If a resolved URL is external (i.e. starts with a protocol like `https://`), `rel` is returned as `\"noreferrer\"`.\n *\n * @typeParam LinkResolverFunctionReturnType - Link Resolver function return\n * type\n * @typeParam Field - Link field or Prismic document to resolve to link attributes\n * @param linkFieldOrDocument - Any kind of Link field or a document to resolve\n * @param config - Configuration that determines the output of `asLinkAttrs()`\n *\n * @returns Resolved set of link attributes or, if the provided Link field or document is empty, and empty object\n * @see Prismic Link Resolver documentation: {@link https://prismic.io/docs/route-resolver#link-resolver}\n * @see Prismic API `routes` options documentation: {@link https://prismic.io/docs/route-resolver}\n */\nexport const asLinkAttrs = <\n\tLinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,\n\tField extends LinkField | PrismicDocument | null | undefined =\n\t\t| LinkField\n\t\t| PrismicDocument\n\t\t| null\n\t\t| undefined,\n>(\n\tlinkFieldOrDocument: Field,\n\tconfig: AsLinkAttrsConfig<LinkResolverFunctionReturnType> = {},\n): AsLinkAttrsReturnType<LinkResolverFunctionReturnType> => {\n\tif (\n\t\tlinkFieldOrDocument &&\n\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t// @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n\t\t(\"link_type\" in linkFieldOrDocument\n\t\t\t? isFilledLink(linkFieldOrDocument)\n\t\t\t: linkFieldOrDocument)\n\t) {\n\t\tconst target =\n\t\t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t// @ts-ignore - Bug in TypeScript 4.9: https://github.com/microsoft/TypeScript/issues/51501\n\t\t\t\"target\" in linkFieldOrDocument ? linkFieldOrDocument.target : undefined;\n\n\t\tconst rawHref = asLink(linkFieldOrDocument, config.linkResolver);\n\t\tconst href =\n\t\t\trawHref == null ? undefined : (rawHref as NonNullable<typeof rawHref>);\n\n\t\tconst isExternal = typeof href === \"string\" ? !isInternalURL(href) : false;\n\n\t\tconst rel = config.rel\n\t\t\t? config.rel({ href, isExternal, target })\n\t\t\t: isExternal\n\t\t\t? \"noreferrer\"\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\thref,\n\t\t\ttarget,\n\t\t\trel: rel == null ? undefined : rel,\n\t\t};\n\t}\n\n\treturn {};\n};\n"],"names":["isFilledLink"],"mappings":";;;AAkFO,MAAM,cAAc,CAQ1B,qBACA,SAA4D,OACF;AAEzD,MAAA;AAAA;AAAA,GAGC,eAAe,sBACbA,KAAa,mBAAmB,IAChC,sBACF;AACK,UAAA;AAAA;AAAA;AAAA,MAGL,YAAY,sBAAsB,oBAAoB,SAAS;AAAA;AAEhE,UAAM,UAAU,OAAO,qBAAqB,OAAO,YAAY;AACzD,UAAA,OACL,WAAW,OAAO,SAAa;AAEhC,UAAM,aAAa,OAAO,SAAS,WAAW,CAAC,cAAc,IAAI,IAAI;AAErE,UAAM,MAAM,OAAO,MAChB,OAAO,IAAI,EAAE,MAAM,YAAY,OAAM,CAAE,IACvC,aACA,eACA;AAEI,WAAA;AAAA,MACN;AAAA,MACA;AAAA,MACA,KAAK,OAAO,OAAO,SAAY;AAAA,IAAA;AAAA,EAEhC;AAED,SAAO;AACR;"}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["// Use for deprecations.\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 * 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\";\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\nexport type { IntegrationFields } from \"./types/value/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\nexport type { CustomTypeModelIntegrationFieldsField } from \"./types/model/integrationFields\";\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAYA,OAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/index.ts"],"sourcesContent":["// Use for deprecations.\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 * 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\nexport type { IntegrationFields } from \"./types/value/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\nexport type { CustomTypeModelIntegrationFieldsField } from \"./types/model/integrationFields\";\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAYA,OAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export * as isFilled from "./helpers/isFilled";
|
|
|
57
57
|
export { documentToLinkField } from "./helpers/documentToLinkField";
|
|
58
58
|
export { Element } from "@prismicio/richtext";
|
|
59
59
|
export type { LinkResolverFunction } from "./helpers/asLink";
|
|
60
|
+
export type { AsLinkAttrsConfig } from "./helpers/asLinkAttrs";
|
|
60
61
|
/**
|
|
61
62
|
* @deprecated Renamed to `HTMLRichTextMapSerializer`
|
|
62
63
|
*/
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["// Use for deprecations.\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 * 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\";\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\nexport type { IntegrationFields } from \"./types/value/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\nexport type { CustomTypeModelIntegrationFieldsField } from \"./types/model/integrationFields\";\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAY;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["// Use for deprecations.\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 * 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\nexport type { IntegrationFields } from \"./types/value/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\nexport type { CustomTypeModelIntegrationFieldsField } from \"./types/model/integrationFields\";\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,YAAY;"}
|
package/dist/package.json.cjs
CHANGED
package/dist/package.json.js
CHANGED
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ type AsLinkAttrsConfigRelArgs<
|
|
|
23
23
|
target?: string;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
type AsLinkAttrsConfig<
|
|
26
|
+
export type AsLinkAttrsConfig<
|
|
27
27
|
LinkResolverFunctionReturnType = ReturnType<LinkResolverFunction>,
|
|
28
28
|
Field extends LinkField | PrismicDocument | null | undefined =
|
|
29
29
|
| LinkField
|
package/src/index.ts
CHANGED
|
@@ -74,6 +74,7 @@ export { documentToLinkField } from "./helpers/documentToLinkField";
|
|
|
74
74
|
export { Element } from "@prismicio/richtext";
|
|
75
75
|
|
|
76
76
|
export type { LinkResolverFunction } from "./helpers/asLink";
|
|
77
|
+
export type { AsLinkAttrsConfig } from "./helpers/asLinkAttrs";
|
|
77
78
|
|
|
78
79
|
/**
|
|
79
80
|
* @deprecated Renamed to `HTMLRichTextMapSerializer`
|