@prismicio/vue 6.1.3 → 6.1.4-pr.98.764fac2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PrismicImage.cjs.map +1 -1
- package/dist/PrismicImage.js.map +1 -1
- package/dist/PrismicImage.vue.d.cts +14 -11
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicImage.vue.d.ts +14 -11
- package/dist/PrismicImage.vue.d.ts.map +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicLink.cjs.map +1 -1
- package/dist/PrismicLink.js.map +1 -1
- package/dist/PrismicLink.vue.d.cts +17 -13
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.ts +17 -13
- package/dist/PrismicLink.vue.d.ts.map +1 -1
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -3
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.cjs.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.js.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +8 -9
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts +7 -8
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.cjs +2 -2
- package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts +3 -4
- package/dist/PrismicRichText/getRichTextComponentProps.d.cts.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts +2 -3
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts.map +1 -1
- package/dist/PrismicRichText/getRichTextComponentProps.js +2 -2
- package/dist/PrismicRichText/getRichTextComponentProps.js.map +1 -1
- package/dist/PrismicRichText/index.d.cts +2 -1
- package/dist/PrismicRichText/index.d.ts +2 -1
- package/dist/PrismicRichText/types.d.cts +1 -2
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.ts +1 -2
- package/dist/PrismicRichText/types.d.ts.map +1 -1
- package/dist/PrismicTable/PrismicTable.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTable.js.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +6 -6
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.ts +6 -6
- package/dist/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.cjs +6 -6
- package/dist/PrismicTable/getTableComponentProps.cjs.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.d.cts +8 -10
- package/dist/PrismicTable/getTableComponentProps.d.cts.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.d.ts +7 -9
- package/dist/PrismicTable/getTableComponentProps.d.ts.map +1 -1
- package/dist/PrismicTable/getTableComponentProps.js +6 -6
- package/dist/PrismicTable/getTableComponentProps.js.map +1 -1
- package/dist/PrismicTable/index.d.cts +2 -1
- package/dist/PrismicTable/index.d.ts +2 -1
- package/dist/PrismicTable/types.d.cts +0 -1
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.ts +0 -1
- package/dist/PrismicTable/types.d.ts.map +1 -1
- package/dist/PrismicText.vue.d.cts +4 -5
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.ts +4 -5
- package/dist/PrismicText.vue.d.ts.map +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/SliceSimulator.vue.d.cts +14 -15
- package/dist/SliceSimulator.vue.d.cts.map +1 -1
- package/dist/SliceSimulator.vue.d.ts +14 -15
- package/dist/SliceSimulator.vue.d.ts.map +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/SliceSimulator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +9 -7
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.ts +9 -7
- package/dist/SliceZone/SliceZone.vue.d.ts.map +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.cjs.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.d.cts +0 -1
- package/dist/SliceZone/TODOSliceComponent.d.cts.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.d.ts +0 -1
- package/dist/SliceZone/TODOSliceComponent.d.ts.map +1 -1
- package/dist/SliceZone/TODOSliceComponent.js.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.cjs +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.cjs.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.d.cts +1 -2
- package/dist/SliceZone/defineSliceZoneComponents.d.cts.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.d.ts +1 -2
- package/dist/SliceZone/defineSliceZoneComponents.d.ts.map +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.js +1 -1
- package/dist/SliceZone/defineSliceZoneComponents.js.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.cjs +2 -2
- package/dist/SliceZone/getSliceComponentProps.cjs.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.d.cts +2 -3
- package/dist/SliceZone/getSliceComponentProps.d.cts.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.d.ts +2 -3
- package/dist/SliceZone/getSliceComponentProps.d.ts.map +1 -1
- package/dist/SliceZone/getSliceComponentProps.js +2 -2
- package/dist/SliceZone/getSliceComponentProps.js.map +1 -1
- package/dist/SliceZone/index.d.cts +2 -1
- package/dist/SliceZone/index.d.ts +2 -1
- package/dist/SliceZone/types.d.cts +8 -5
- package/dist/SliceZone/types.d.cts.map +1 -1
- package/dist/SliceZone/types.d.ts +8 -5
- package/dist/SliceZone/types.d.ts.map +1 -1
- package/dist/createPrismic.cjs +1 -1
- package/dist/createPrismic.cjs.map +1 -1
- package/dist/createPrismic.d.cts +18 -9
- package/dist/createPrismic.d.cts.map +1 -1
- package/dist/createPrismic.d.ts +17 -8
- package/dist/createPrismic.d.ts.map +1 -1
- package/dist/createPrismic.js +1 -1
- package/dist/createPrismic.js.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +10 -7
- package/dist/index.d.ts +10 -7
- package/dist/lib/devMsg.cjs +1 -1
- package/dist/lib/devMsg.cjs.map +1 -1
- package/dist/lib/devMsg.js +1 -1
- package/dist/lib/devMsg.js.map +1 -1
- package/dist/lib/isInternalURL.cjs.map +1 -1
- package/dist/lib/isInternalURL.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.js +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +3 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +17 -17
- package/src/PrismicImage.vue +1 -1
- package/src/PrismicLink.vue +2 -2
- package/src/PrismicRichText/PrismicRichText.vue +1 -1
- package/src/PrismicRichText/getRichTextComponentProps.ts +2 -2
- package/src/PrismicTable/PrismicTable.vue +1 -1
- package/src/PrismicTable/getTableComponentProps.ts +6 -6
- package/src/SliceZone/defineSliceZoneComponents.ts +1 -1
- package/src/SliceZone/getSliceComponentProps.ts +2 -2
- package/src/createPrismic.ts +1 -1
- package/src/lib/devMsg.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"./createPrismic\"\nimport { isInternalURL } from \"./lib/isInternalURL\"\nimport type { ComponentOrTagName } from \"./types\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if the link's URL is\n\t * external. This prop can be provided a function to use the link's metadata to determine the\n\t * `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link component, provide the Link\n\t * component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst { linkResolver, components } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver ||
|
|
1
|
+
{"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"./createPrismic\"\nimport { isInternalURL } from \"./lib/isInternalURL\"\nimport type { ComponentOrTagName } from \"./types\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if the link's URL is\n\t * external. This prop can be provided a function to use the link's metadata to determine the\n\t * `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link component, provide the Link\n\t * component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst { linkResolver: pluginLinkResolver, components } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver || pluginLinkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || components?.linkInternalComponent || defaultInternalComponent\n\t\t: props.externalComponent || components?.linkExternalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":";;;;;;AAeA,MAAM,2BAA2B;;AAGjC,MAAM,2BAA2B;;AAGjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDpC,MAAM,QAAQ;EAGd,MAAM,EAAE,cAAc,oBAAoB,eAAe,sBAAA,WAAW;EAEpE,MAAM,YAAA,GAAW,IAAA,SAAA,OAAe;GAC/B,QAAA,GAAO,kBAAA,YAAA,CAAY,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM,gBAAgB;IACpC,IAAI,MAAM;KACT,IAAI,MAAM,KACT,OAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,IAAI,IAAI,MAAM;KAGlE,OAAO,KAAK,aAAa,8BAA8B,KAAA;IACxD;GACD,CAAC;EACF,CAAC;EAED,MAAM,aAAA,GAAY,IAAA,SAAA,OAAe;GAChC,OAAO,sBAAA,cAAc,SAAS,MAAM,QAAQ,EAAE,IAC3C,MAAM,qBAAqB,YAAY,yBAAyB,2BAChE,MAAM,qBAAqB,YAAY,yBAAyB;EACpE,CAAC;EAGD,MAAM,SAAA,GAAQ,IAAA,SAAA,OAAe;GAC5B,OAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;GACrB,IACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;GACrB;EACH,CAAC;;GAIA,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAIY,IAAA,wBAAA,CAJI,UAAA,KAAS,IAAA,GAAA,IAAA,eAAA,EAAA,GAAA,IAAA,mBAAA,CAAU,MAAA,KAAK,CAAA,GAAA;IACvC,UAAA,GAAA,IAAA,QAAA,OAEO,EAAA,GAFP,IAAA,WAAA,CAEO,KAAA,QAAA,WAAA,CAAA,SAAA,EAAA,GADH,IAAA,gBAAA,EAAA,GAAA,IAAA,gBAAA,CAAA,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,KAAA,CAAS,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -9,7 +9,7 @@ const defaultInternalComponent = "router-link";
|
|
|
9
9
|
const defaultExternalComponent = "a";
|
|
10
10
|
/** The default rel attribute rendered for external URLs. */
|
|
11
11
|
const defaultExternalRelAttribute = "noreferrer";
|
|
12
|
-
var PrismicLink_vue_vue_type_script_setup_true_lang_default =
|
|
12
|
+
var PrismicLink_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
13
13
|
name: "PrismicLink",
|
|
14
14
|
__name: "PrismicLink",
|
|
15
15
|
props: {
|
|
@@ -40,10 +40,10 @@ var PrismicLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
40
40
|
},
|
|
41
41
|
setup(__props) {
|
|
42
42
|
const props = __props;
|
|
43
|
-
const { linkResolver, components } = usePrismic();
|
|
43
|
+
const { linkResolver: pluginLinkResolver, components } = usePrismic();
|
|
44
44
|
const rawAttrs = computed(() => {
|
|
45
45
|
return asLinkAttrs(props.field || props.document, {
|
|
46
|
-
linkResolver: props.linkResolver ||
|
|
46
|
+
linkResolver: props.linkResolver || pluginLinkResolver,
|
|
47
47
|
rel(args) {
|
|
48
48
|
if (props.rel) return typeof props.rel === "function" ? props.rel(args) : props.rel;
|
|
49
49
|
return args.isExternal ? defaultExternalRelAttribute : void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"./createPrismic\"\nimport { isInternalURL } from \"./lib/isInternalURL\"\nimport type { ComponentOrTagName } from \"./types\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if the link's URL is\n\t * external. This prop can be provided a function to use the link's metadata to determine the\n\t * `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link component, provide the Link\n\t * component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst { linkResolver, components } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver ||
|
|
1
|
+
{"version":3,"file":"PrismicLink.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"./createPrismic\"\nimport { isInternalURL } from \"./lib/isInternalURL\"\nimport type { ComponentOrTagName } from \"./types\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if the link's URL is\n\t * external. This prop can be provided a function to use the link's metadata to determine the\n\t * `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link component, provide the Link\n\t * component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst { linkResolver: pluginLinkResolver, components } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver || pluginLinkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent || components?.linkInternalComponent || defaultInternalComponent\n\t\t: props.externalComponent || components?.linkExternalComponent || defaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":";;;;;;AAeA,MAAM,2BAA2B;;AAGjC,MAAM,2BAA2B;;AAGjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDpC,MAAM,QAAQ;EAGd,MAAM,EAAE,cAAc,oBAAoB,eAAe,WAAW;EAEpE,MAAM,WAAW,eAAe;GAC/B,OAAO,YAAY,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM,gBAAgB;IACpC,IAAI,MAAM;KACT,IAAI,MAAM,KACT,OAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,IAAI,IAAI,MAAM;KAGlE,OAAO,KAAK,aAAa,8BAA8B,KAAA;IACxD;GACD,CAAC;EACF,CAAC;EAED,MAAM,YAAY,eAAe;GAChC,OAAO,cAAc,SAAS,MAAM,QAAQ,EAAE,IAC3C,MAAM,qBAAqB,YAAY,yBAAyB,2BAChE,MAAM,qBAAqB,YAAY,yBAAyB;EACpE,CAAC;EAGD,MAAM,QAAQ,eAAe;GAC5B,OAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;GACrB,IACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;GACrB;EACH,CAAC;;GAIA,OAAA,UAAA,GAAA,YAIY,wBAJI,UAAA,KAAS,GAAA,eAAA,mBAAU,MAAA,KAAK,CAAA,GAAA;IACvC,SAAA,cAEO,CAFP,WAEO,KAAA,QAAA,WAAA,CAAA,SAAA,CADH,gBAAA,gBAAA,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,KAAA,CAAS,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t
|
|
1
|
+
{"version":3,"file":"PrismicRichText.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t```javascript\n\t * \t;({\n\t * \t\theading1: Heading1,\n\t * \t\tparagraph: { class: \"prose\" },\n\t * \t\tstrong: { as: \"em\", class: \"font-bold\" }\n\t * \t})\n\t * \t```\n\t */\n\tcomponents?: RichTextComponents\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not given, `null` will be\n\t * rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<PrismicRichTextProps[\"fallback\"]>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst {\n\tcomponents: { richTextComponents },\n} = usePrismic()\n\nconst resolvedComponents = computed<RichTextComponents>(() => {\n\treturn { ...richTextComponents, ...props.components }\n})\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = resolvedComponents.value?.[type] as\n\t\t| RichTextComponent\n\t\t| ComponentShorthand\n\t\t| undefined\n\n\tif (isComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tlinkResolver: props.linkResolver,\n\t\tshorthand: maybeComponentOrShorthand,\n\t}\n}\n\nconst internalComponents = computed<InternalRichTextComponents>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t
|
|
1
|
+
{"version":3,"file":"PrismicRichText.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t```javascript\n\t * \t;({\n\t * \t\theading1: Heading1,\n\t * \t\tparagraph: { class: \"prose\" },\n\t * \t\tstrong: { as: \"em\", class: \"font-bold\" }\n\t * \t})\n\t * \t```\n\t */\n\tcomponents?: RichTextComponents\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not given, `null` will be\n\t * rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<PrismicRichTextProps[\"fallback\"]>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst {\n\tcomponents: { richTextComponents },\n} = usePrismic()\n\nconst resolvedComponents = computed<RichTextComponents>(() => {\n\treturn { ...richTextComponents, ...props.components }\n})\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = resolvedComponents.value?.[type] as\n\t\t| RichTextComponent\n\t\t| ComponentShorthand\n\t\t| undefined\n\n\tif (isComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tlinkResolver: props.linkResolver,\n\t\tshorthand: maybeComponentOrShorthand,\n\t}\n}\n\nconst internalComponents = computed<InternalRichTextComponents>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.cjs";
|
|
2
2
|
import { RichTextComponents } from "./types.cjs";
|
|
3
|
-
import * as _$vue from "vue";
|
|
4
|
-
import { PropType } from "vue";
|
|
5
3
|
import { LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
6
|
-
|
|
4
|
+
import { PropType } from "vue";
|
|
7
5
|
//#region src/PrismicRichText/PrismicRichText.vue.d.ts
|
|
8
6
|
/** Props for `<PrismicRichText />`. */
|
|
9
7
|
type PrismicRichTextProps = {
|
|
10
|
-
/** The Prismic rich text field to render. */
|
|
8
|
+
/** The Prismic rich text field to render. */
|
|
9
|
+
field: RichTextField | null | undefined;
|
|
11
10
|
/**
|
|
12
11
|
* The link resolver used to resolve links.
|
|
13
12
|
*
|
|
@@ -21,7 +20,7 @@ type PrismicRichTextProps = {
|
|
|
21
20
|
* An object that maps a rich text block type to a Vue component or a shorthand definition.
|
|
22
21
|
*
|
|
23
22
|
* @example
|
|
24
|
-
*
|
|
23
|
+
* ```javascript
|
|
25
24
|
* ;({
|
|
26
25
|
* heading1: Heading1,
|
|
27
26
|
* paragraph: { class: "prose" },
|
|
@@ -36,7 +35,7 @@ type PrismicRichTextProps = {
|
|
|
36
35
|
*/
|
|
37
36
|
fallback?: ComponentOrTagName;
|
|
38
37
|
};
|
|
39
|
-
declare const __VLS_export:
|
|
38
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
40
39
|
field: {
|
|
41
40
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
42
41
|
};
|
|
@@ -49,7 +48,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
49
48
|
fallback: {
|
|
50
49
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
51
50
|
};
|
|
52
|
-
}>, {}, {}, {}, {},
|
|
51
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
53
52
|
field: {
|
|
54
53
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
55
54
|
};
|
|
@@ -62,8 +61,8 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
62
61
|
fallback: {
|
|
63
62
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
64
63
|
};
|
|
65
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string,
|
|
64
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
65
|
declare const _default: typeof __VLS_export;
|
|
67
66
|
//#endregion
|
|
68
|
-
export { PrismicRichTextProps, _default };
|
|
67
|
+
export { PrismicRichTextProps, _default as default };
|
|
69
68
|
//# sourceMappingURL=PrismicRichText.vue.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.vue.d.cts","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicRichText.vue.d.cts","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"mappings":";;;;;;KAiJY;;EAEX,OAAO;;;;;;;;;EAUP,eAAe;;;;;;;;;;;;;EAcf,aAAa;;;;;EAMb,WAAW;;cAwHN,4BAAY,8BAAA;;IAGU,MAAA,SAAS;;;IAGjB,MAAA,SAAS;;;IAGX,MAAA,SAAS;;;IAGW,MAAA,SAAS;;;;IATnB,MAAA,SAAS;;;IAGjB,MAAA,SAAS;;;IAGX,MAAA,SAAS;;;IAGW,MAAA,SAAS;;MAG7C,oDAAA;cACmB,iBAAO"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.js";
|
|
2
2
|
import { RichTextComponents } from "./types.js";
|
|
3
|
-
import * as _$vue from "vue";
|
|
4
3
|
import { PropType } from "vue";
|
|
5
4
|
import { LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
6
|
-
|
|
7
5
|
//#region src/PrismicRichText/PrismicRichText.vue.d.ts
|
|
8
6
|
/** Props for `<PrismicRichText />`. */
|
|
9
7
|
type PrismicRichTextProps = {
|
|
10
|
-
/** The Prismic rich text field to render. */
|
|
8
|
+
/** The Prismic rich text field to render. */
|
|
9
|
+
field: RichTextField | null | undefined;
|
|
11
10
|
/**
|
|
12
11
|
* The link resolver used to resolve links.
|
|
13
12
|
*
|
|
@@ -21,7 +20,7 @@ type PrismicRichTextProps = {
|
|
|
21
20
|
* An object that maps a rich text block type to a Vue component or a shorthand definition.
|
|
22
21
|
*
|
|
23
22
|
* @example
|
|
24
|
-
*
|
|
23
|
+
* ```javascript
|
|
25
24
|
* ;({
|
|
26
25
|
* heading1: Heading1,
|
|
27
26
|
* paragraph: { class: "prose" },
|
|
@@ -36,7 +35,7 @@ type PrismicRichTextProps = {
|
|
|
36
35
|
*/
|
|
37
36
|
fallback?: ComponentOrTagName;
|
|
38
37
|
};
|
|
39
|
-
declare const __VLS_export:
|
|
38
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
40
39
|
field: {
|
|
41
40
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
42
41
|
};
|
|
@@ -49,7 +48,7 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
49
48
|
fallback: {
|
|
50
49
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
51
50
|
};
|
|
52
|
-
}>, {}, {}, {}, {},
|
|
51
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
53
52
|
field: {
|
|
54
53
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
55
54
|
};
|
|
@@ -62,8 +61,8 @@ declare const __VLS_export: _$vue.DefineComponent<_$vue.ExtractPropTypes<{
|
|
|
62
61
|
fallback: {
|
|
63
62
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
64
63
|
};
|
|
65
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string,
|
|
64
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
65
|
declare const _default: typeof __VLS_export;
|
|
67
66
|
//#endregion
|
|
68
|
-
export { PrismicRichTextProps, _default };
|
|
67
|
+
export { PrismicRichTextProps, _default as default };
|
|
69
68
|
//# sourceMappingURL=PrismicRichText.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.vue.d.ts","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicRichText.vue.d.ts","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"mappings":";;;;;;KAiJY;;EAEX,OAAO;;;;;;;;;EAUP,eAAe;;;;;;;;;;;;;EAcf,aAAa;;;;;EAMb,WAAW;;cAwHN,4BAAY,8BAAA;;IAGU,MAAA,SAAS;;;IAGjB,MAAA,SAAS;;;IAGX,MAAA,SAAS;;;IAGW,MAAA,SAAS;;;;IATnB,MAAA,SAAS;;;IAGjB,MAAA,SAAS;;;IAGX,MAAA,SAAS;;;IAGW,MAAA,SAAS;;MAG7C,oDAAA;cACmB,iBAAO"}
|
|
@@ -5,7 +5,7 @@ const require_PrismicRichTextSerialize = require("./PrismicRichTextSerialize.cjs
|
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _prismicio_client_richtext = require("@prismicio/client/richtext");
|
|
7
7
|
//#region src/PrismicRichText/PrismicRichText.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var PrismicRichText_vue_vue_type_script_setup_true_lang_default =
|
|
8
|
+
var PrismicRichText_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
9
9
|
name: "PrismicRichText",
|
|
10
10
|
__name: "PrismicRichText",
|
|
11
11
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t
|
|
1
|
+
{"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t```javascript\n\t * \t;({\n\t * \t\theading1: Heading1,\n\t * \t\tparagraph: { class: \"prose\" },\n\t * \t\tstrong: { as: \"em\", class: \"font-bold\" }\n\t * \t})\n\t * \t```\n\t */\n\tcomponents?: RichTextComponents\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not given, `null` will be\n\t * rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<PrismicRichTextProps[\"fallback\"]>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst {\n\tcomponents: { richTextComponents },\n} = usePrismic()\n\nconst resolvedComponents = computed<RichTextComponents>(() => {\n\treturn { ...richTextComponents, ...props.components }\n})\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = resolvedComponents.value?.[type] as\n\t\t| RichTextComponent\n\t\t| ComponentShorthand\n\t\t| undefined\n\n\tif (isComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tlinkResolver: props.linkResolver,\n\t\tshorthand: maybeComponentOrShorthand,\n\t}\n}\n\nconst internalComponents = computed<InternalRichTextComponents>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,QAAQ;EAgBd,MAAM,EACL,YAAY,EAAE,yBACX,sBAAA,WAAW;EAEf,MAAM,sBAAA,GAAqB,IAAA,SAAA,OAAmC;GAC7D,OAAO;IAAE,GAAG;IAAoB,GAAG,MAAM;GAAW;EACrD,CAAC;EAED,MAAM,YAAA,GAAW,IAAA,SAAA,OAAe;GAC/B,QAAA,GAAO,2BAAA,OAAA,CAAO,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC;EAClC,CAAC;EAED,SAAS,qBAAqB,MAAqC;GAClE,MAAM,4BAA4B,mBAAmB,QAAQ;GAK7D,IAAI,cAAA,YAAY,yBAAyB,GACxC,OAAO,EAAE,IAAI,0BAA0B;GAGxC,OAAO;IACN,IAAI,wCAAA;IACJ,cAAc,MAAM;IACpB,WAAW;GACZ;EACD;EAEA,MAAM,sBAAA,GAAqB,IAAA,SAAA,OAA2C;GACrE,OAAO;IACN,UAAU,qBAAqB,UAAU;IACzC,UAAU,qBAAqB,UAAU;IACzC,UAAU,qBAAqB,UAAU;IACzC,UAAU,qBAAqB,UAAU;IACzC,UAAU,qBAAqB,UAAU;IACzC,UAAU,qBAAqB,UAAU;IACzC,WAAW,qBAAqB,WAAW;IAC3C,cAAc,qBAAqB,cAAc;IACjD,QAAQ,qBAAqB,QAAQ;IACrC,IAAI,qBAAqB,IAAI;IAC7B,aAAa,qBAAqB,UAAU;IAC5C,eAAe,qBAAqB,WAAW;IAC/C,mBAAmB,qBAAqB,MAAM;IAC9C,qBAAqB,qBAAqB,OAAO;IACjD,OAAO,qBAAqB,OAAO;IACnC,OAAO,qBAAqB,OAAO;IACnC,WAAW,qBAAqB,WAAW;IAC3C,OAAO,qBAAqB,OAAO;IACnC,MAAM,qBAAqB,MAAM;GAClC;EACD,CAAC;;GAKO,OAAA,SAAA,MAAS,WAAA,GADhB,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAIE,iCAAA,SAAA;;IAFA,UAAU,SAAA;IACV,uBAAqB,mBAAA;GAED,GAAA,MAAA,GAAA,CAAA,YAAA,qBAAA,CAAA,KAAA,QAAA,aAAA,GAAtB,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAAiD,IAAA,wBAAA,CAAZ,QAAA,QAAQ,GAAA,EAAA,KAAA,EAAA,CAAA,MAAA,GAAA,IAAA,mBAAA,CAAA,QAAA,IAAA"}
|
|
@@ -5,7 +5,7 @@ import PrismicRichTextSerialize_default from "./PrismicRichTextSerialize.js";
|
|
|
5
5
|
import { computed, createBlock, createCommentVNode, defineComponent, openBlock, resolveDynamicComponent } from "vue";
|
|
6
6
|
import { asTree } from "@prismicio/client/richtext";
|
|
7
7
|
//#region src/PrismicRichText/PrismicRichText.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var PrismicRichText_vue_vue_type_script_setup_true_lang_default =
|
|
8
|
+
var PrismicRichText_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
9
9
|
name: "PrismicRichText",
|
|
10
10
|
__name: "PrismicRichText",
|
|
11
11
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t
|
|
1
|
+
{"version":3,"file":"PrismicRichText.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction, RichTextField, RichTextNodeType } from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport { usePrismic } from \"../createPrismic\"\nimport type { ComponentOrTagName, ComponentShorthand } from \"../types\"\nimport { isComponent } from \"../types\"\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\nimport type { InternalRichTextComponents, RichTextComponent, RichTextComponents } from \"./types\"\n\n/** Props for `<PrismicRichText />`. */\nexport type PrismicRichTextProps = {\n\t/** The Prismic rich text field to render. */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic repository's content, a link\n\t * resolver does not need to be provided.\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a shorthand definition.\n\t *\n\t * @example\n\t * \t```javascript\n\t * \t;({\n\t * \t\theading1: Heading1,\n\t * \t\tparagraph: { class: \"prose\" },\n\t * \t\tstrong: { as: \"em\", class: \"font-bold\" }\n\t * \t})\n\t * \t```\n\t */\n\tcomponents?: RichTextComponents\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not given, `null` will be\n\t * rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\n// We're forced to declare props using the JavaScript syntax because `@vue/compiler-sfc`\n// has limitations for inferring types from complex objects.\nconst props = defineProps({\n\tfield: {\n\t\ttype: Array as unknown as PropType<PrismicRichTextProps[\"field\"]>,\n\t},\n\tlinkResolver: {\n\t\ttype: Function as PropType<PrismicRichTextProps[\"linkResolver\"]>,\n\t},\n\tcomponents: {\n\t\ttype: Object as PropType<PrismicRichTextProps[\"components\"]>,\n\t},\n\tfallback: {\n\t\ttype: [String, Object, Function] as PropType<PrismicRichTextProps[\"fallback\"]>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst {\n\tcomponents: { richTextComponents },\n} = usePrismic()\n\nconst resolvedComponents = computed<RichTextComponents>(() => {\n\treturn { ...richTextComponents, ...props.components }\n})\n\nconst children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = resolvedComponents.value?.[type] as\n\t\t| RichTextComponent\n\t\t| ComponentShorthand\n\t\t| undefined\n\n\tif (isComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tlinkResolver: props.linkResolver,\n\t\tshorthand: maybeComponentOrShorthand,\n\t}\n}\n\nconst internalComponents = computed<InternalRichTextComponents>(() => {\n\treturn {\n\t\theading1: getInternalComponent(\"heading1\"),\n\t\theading2: getInternalComponent(\"heading2\"),\n\t\theading3: getInternalComponent(\"heading3\"),\n\t\theading4: getInternalComponent(\"heading4\"),\n\t\theading5: getInternalComponent(\"heading5\"),\n\t\theading6: getInternalComponent(\"heading6\"),\n\t\tparagraph: getInternalComponent(\"paragraph\"),\n\t\tpreformatted: getInternalComponent(\"preformatted\"),\n\t\tstrong: getInternalComponent(\"strong\"),\n\t\tem: getInternalComponent(\"em\"),\n\t\t\"list-item\": getInternalComponent(\"listItem\"),\n\t\t\"o-list-item\": getInternalComponent(\"oListItem\"),\n\t\t\"group-list-item\": getInternalComponent(\"list\"),\n\t\t\"group-o-list-item\": getInternalComponent(\"oList\"),\n\t\timage: getInternalComponent(\"image\"),\n\t\tembed: getInternalComponent(\"embed\"),\n\t\thyperlink: getInternalComponent(\"hyperlink\"),\n\t\tlabel: getInternalComponent(\"label\"),\n\t\tspan: getInternalComponent(\"span\"),\n\t}\n})\n</script>\n\n<template>\n\t<PrismicRichTextSerialize\n\t\tv-if=\"children.length\"\n\t\t:children=\"children\"\n\t\t:internal-components=\"internalComponents\"\n\t/>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAmDA,MAAM,QAAQ;EAgBd,MAAM,EACL,YAAY,EAAE,yBACX,WAAW;EAEf,M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.vue_vue_type_script_setup_true_lang.cjs
CHANGED
|
@@ -22,7 +22,7 @@ const _hoisted_11 = [
|
|
|
22
22
|
"innerHTML"
|
|
23
23
|
];
|
|
24
24
|
const _hoisted_12 = { key: 0 };
|
|
25
|
-
var PrismicRichTextDefaultComponent_vue_vue_type_script_setup_true_lang_default =
|
|
25
|
+
var PrismicRichTextDefaultComponent_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
26
26
|
name: "PrismicRichTextDefaultComponent",
|
|
27
27
|
__name: "PrismicRichTextDefaultComponent",
|
|
28
28
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport PrismicImage from \"../PrismicImage.vue\"\nimport PrismicLink from \"../PrismicLink.vue\"\nimport type { ComponentShorthand } from \"../types\"\nimport type { RichTextComponentProps } from \"./types\"\n\nconst props = defineProps<\n\tRichTextComponentProps & {\n\t\tlinkResolver?: LinkResolverFunction\n\t\tshorthand?: ComponentShorthand\n\t}\n>()\ndefineOptions({ name: \"PrismicRichTextDefaultComponent\" })\n\nconst as = computed(() => {\n\treturn props.node.type !== \"image\" &&\n\t\tprops.node.type !== \"hyperlink\" &&\n\t\tprops.node.type !== \"label\" &&\n\t\tprops.node.type !== \"span\"\n\t\t? props.shorthand?.as\n\t\t: undefined\n})\n\nconst attrs = computed(() => {\n\tconst { as, ...attrs } = props.shorthand ?? {}\n\n\treturn attrs\n})\n\nconst dir = computed(() => {\n\treturn \"direction\" in props.node && props.node.direction === \"rtl\" ? \"rtl\" : undefined\n})\n</script>\n\n<template>\n\t<component v-if=\"as\" :is=\"as\" :dir=\"dir\" v-bind=\"attrs\"><slot /></component>\n\t<h1 v-else-if=\"node.type === 'heading1'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h1>\n\t<h2 v-else-if=\"node.type === 'heading2'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h2>\n\t<h3 v-else-if=\"node.type === 'heading3'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h3>\n\t<h4 v-else-if=\"node.type === 'heading4'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h4>\n\t<h5 v-else-if=\"node.type === 'heading5'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h5>\n\t<h6 v-else-if=\"node.type === 'heading6'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h6>\n\t<p v-else-if=\"node.type === 'paragraph'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</p>\n\t<pre v-else-if=\"node.type === 'preformatted'\" v-bind=\"attrs\"><slot /></pre>\n\t<strong v-else-if=\"node.type === 'strong'\" v-bind=\"attrs\"><slot /></strong>\n\t<em v-else-if=\"node.type === 'em'\" v-bind=\"attrs\"><slot /></em>\n\t<li v-else-if=\"node.type === 'list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<li v-else-if=\"node.type === 'o-list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<ul v-else-if=\"node.type === 'group-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ul>\n\t<ol v-else-if=\"node.type === 'group-o-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ol>\n\t<p class=\"block-img\" v-else-if=\"node.type === 'image'\">\n\t\t<PrismicLink v-if=\"node.linkTo\" :field=\"node.linkTo\"\n\t\t\t><PrismicImage :field=\"node\" v-bind=\"attrs\"\n\t\t/></PrismicLink>\n\t\t<PrismicImage v-else :field=\"node\" v-bind=\"attrs\" />\n\t</p>\n\t<div\n\t\tv-else-if=\"node.type === 'embed'\"\n\t\t:data-oembed=\"node.oembed.embed_url\"\n\t\t:data-oembed-type=\"node.oembed.type\"\n\t\t:data-oembed-provider=\"node.oembed.provider_name\"\n\t\tv-html=\"node.oembed.html\"\n\t\tv-bind=\"attrs\"\n\t/>\n\t<PrismicLink\n\t\tv-else-if=\"node.type === 'hyperlink'\"\n\t\t:field=\"node.data\"\n\t\t:link-resolver=\"linkResolver\"\n\t\tv-bind=\"attrs\"\n\t\t><slot\n\t/></PrismicLink>\n\t<span v-else-if=\"node.type === 'label'\" :class=\"node.data.label\" v-bind=\"attrs\"><slot /></span>\n\t<template v-else v-for=\"(line, index) in node.text.split('\\n')\" :key=\"line\"\n\t\t><br v-if=\"index > 0\" />{{ line }}</template\n\t>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EAQd,MAAM,MAAA,
|
|
1
|
+
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport PrismicImage from \"../PrismicImage.vue\"\nimport PrismicLink from \"../PrismicLink.vue\"\nimport type { ComponentShorthand } from \"../types\"\nimport type { RichTextComponentProps } from \"./types\"\n\nconst props = defineProps<\n\tRichTextComponentProps & {\n\t\tlinkResolver?: LinkResolverFunction\n\t\tshorthand?: ComponentShorthand\n\t}\n>()\ndefineOptions({ name: \"PrismicRichTextDefaultComponent\" })\n\nconst as = computed(() => {\n\treturn props.node.type !== \"image\" &&\n\t\tprops.node.type !== \"hyperlink\" &&\n\t\tprops.node.type !== \"label\" &&\n\t\tprops.node.type !== \"span\"\n\t\t? props.shorthand?.as\n\t\t: undefined\n})\n\nconst attrs = computed(() => {\n\tconst { as, ...attrs } = props.shorthand ?? {}\n\n\treturn attrs\n})\n\nconst dir = computed(() => {\n\treturn \"direction\" in props.node && props.node.direction === \"rtl\" ? \"rtl\" : undefined\n})\n</script>\n\n<template>\n\t<component v-if=\"as\" :is=\"as\" :dir=\"dir\" v-bind=\"attrs\"><slot /></component>\n\t<h1 v-else-if=\"node.type === 'heading1'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h1>\n\t<h2 v-else-if=\"node.type === 'heading2'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h2>\n\t<h3 v-else-if=\"node.type === 'heading3'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h3>\n\t<h4 v-else-if=\"node.type === 'heading4'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h4>\n\t<h5 v-else-if=\"node.type === 'heading5'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h5>\n\t<h6 v-else-if=\"node.type === 'heading6'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h6>\n\t<p v-else-if=\"node.type === 'paragraph'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</p>\n\t<pre v-else-if=\"node.type === 'preformatted'\" v-bind=\"attrs\"><slot /></pre>\n\t<strong v-else-if=\"node.type === 'strong'\" v-bind=\"attrs\"><slot /></strong>\n\t<em v-else-if=\"node.type === 'em'\" v-bind=\"attrs\"><slot /></em>\n\t<li v-else-if=\"node.type === 'list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<li v-else-if=\"node.type === 'o-list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<ul v-else-if=\"node.type === 'group-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ul>\n\t<ol v-else-if=\"node.type === 'group-o-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ol>\n\t<p class=\"block-img\" v-else-if=\"node.type === 'image'\">\n\t\t<PrismicLink v-if=\"node.linkTo\" :field=\"node.linkTo\"\n\t\t\t><PrismicImage :field=\"node\" v-bind=\"attrs\"\n\t\t/></PrismicLink>\n\t\t<PrismicImage v-else :field=\"node\" v-bind=\"attrs\" />\n\t</p>\n\t<div\n\t\tv-else-if=\"node.type === 'embed'\"\n\t\t:data-oembed=\"node.oembed.embed_url\"\n\t\t:data-oembed-type=\"node.oembed.type\"\n\t\t:data-oembed-provider=\"node.oembed.provider_name\"\n\t\tv-html=\"node.oembed.html\"\n\t\tv-bind=\"attrs\"\n\t/>\n\t<PrismicLink\n\t\tv-else-if=\"node.type === 'hyperlink'\"\n\t\t:field=\"node.data\"\n\t\t:link-resolver=\"linkResolver\"\n\t\tv-bind=\"attrs\"\n\t\t><slot\n\t/></PrismicLink>\n\t<span v-else-if=\"node.type === 'label'\" :class=\"node.data.label\" v-bind=\"attrs\"><slot /></span>\n\t<template v-else v-for=\"(line, index) in node.text.split('\\n')\" :key=\"line\"\n\t\t><br v-if=\"index > 0\" />{{ line }}</template\n\t>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EAQd,MAAM,MAAA,GAAK,IAAA,SAAA,OAAe;GACzB,OAAO,MAAM,KAAK,SAAS,WAC1B,MAAM,KAAK,SAAS,eACpB,MAAM,KAAK,SAAS,WACpB,MAAM,KAAK,SAAS,SAClB,MAAM,WAAW,KACjB,KAAA;EACJ,CAAC;EAED,MAAM,SAAA,GAAQ,IAAA,SAAA,OAAe;GAC5B,MAAM,EAAE,IAAI,GAAG,UAAU,MAAM,aAAa,CAAC;GAE7C,OAAO;EACR,CAAC;EAED,MAAM,OAAA,GAAM,IAAA,SAAA,OAAe;GAC1B,OAAO,eAAe,MAAM,QAAQ,MAAM,KAAK,cAAc,QAAQ,QAAQ,KAAA;EAC9E,CAAC;;GAIiB,OAAA,GAAA,UAAA,GAAjB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A,QAAA,OACA,EAAA,GADA,IAAA,WAAA,CACA,KAAA,QAAA,SAAA,CAAA,CAAA;;GACe,GAAA,IAAA,CAAA,SAAA,eAAA,CAAA,KAAA,QAAA,KAAK,SAAI,YAAA,GAA1B,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,mBAAA,CAA+F,SAAA,GAA/F,IAAA,WAAA,CAA+F;;IAAtD,OAAO,QAAA,KAAK,KAAK;GAAe,GAAA,MAAA,KAAK,GAAA,EAAA,GAAE,IAAA,WAAA,CAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA,OAAA,GACxF,IAAA,UAAA,CAAA,IAAA,IAAA,GAAA,IAAA,mBAAA,CAEC,IAAA,UAAA,EAAA,KAAA,GAAA,IAAA,GAAA,IAAA,WAAA,CAFwC,QAAA,KAAK,KAAK,MAAK,IAAA,IAA/B,MAAM,UAAK;IAAkC,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,mBAAA,CAAA,IAAA,UAAA,EAAA,KAAA,KAAI,GAAA,CAC9D,QAAK,MAAA,GAAf,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,mBAAA,CAAuB,MAAA,WAAA,MAAA,GAAA,IAAA,mBAAA,CAAA,QAAA,IAAA,IAAA,GAAG,IAAA,gBAAA,EAAA,GAAA,IAAA,gBAAA,CAAA,IAAI,GAAA,CAAA,CAAA,GAAA,EAAA"}
|
package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -22,7 +22,7 @@ const _hoisted_11 = [
|
|
|
22
22
|
"innerHTML"
|
|
23
23
|
];
|
|
24
24
|
const _hoisted_12 = { key: 0 };
|
|
25
|
-
var PrismicRichTextDefaultComponent_vue_vue_type_script_setup_true_lang_default =
|
|
25
|
+
var PrismicRichTextDefaultComponent_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
26
26
|
name: "PrismicRichTextDefaultComponent",
|
|
27
27
|
__name: "PrismicRichTextDefaultComponent",
|
|
28
28
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport PrismicImage from \"../PrismicImage.vue\"\nimport PrismicLink from \"../PrismicLink.vue\"\nimport type { ComponentShorthand } from \"../types\"\nimport type { RichTextComponentProps } from \"./types\"\n\nconst props = defineProps<\n\tRichTextComponentProps & {\n\t\tlinkResolver?: LinkResolverFunction\n\t\tshorthand?: ComponentShorthand\n\t}\n>()\ndefineOptions({ name: \"PrismicRichTextDefaultComponent\" })\n\nconst as = computed(() => {\n\treturn props.node.type !== \"image\" &&\n\t\tprops.node.type !== \"hyperlink\" &&\n\t\tprops.node.type !== \"label\" &&\n\t\tprops.node.type !== \"span\"\n\t\t? props.shorthand?.as\n\t\t: undefined\n})\n\nconst attrs = computed(() => {\n\tconst { as, ...attrs } = props.shorthand ?? {}\n\n\treturn attrs\n})\n\nconst dir = computed(() => {\n\treturn \"direction\" in props.node && props.node.direction === \"rtl\" ? \"rtl\" : undefined\n})\n</script>\n\n<template>\n\t<component v-if=\"as\" :is=\"as\" :dir=\"dir\" v-bind=\"attrs\"><slot /></component>\n\t<h1 v-else-if=\"node.type === 'heading1'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h1>\n\t<h2 v-else-if=\"node.type === 'heading2'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h2>\n\t<h3 v-else-if=\"node.type === 'heading3'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h3>\n\t<h4 v-else-if=\"node.type === 'heading4'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h4>\n\t<h5 v-else-if=\"node.type === 'heading5'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h5>\n\t<h6 v-else-if=\"node.type === 'heading6'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h6>\n\t<p v-else-if=\"node.type === 'paragraph'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</p>\n\t<pre v-else-if=\"node.type === 'preformatted'\" v-bind=\"attrs\"><slot /></pre>\n\t<strong v-else-if=\"node.type === 'strong'\" v-bind=\"attrs\"><slot /></strong>\n\t<em v-else-if=\"node.type === 'em'\" v-bind=\"attrs\"><slot /></em>\n\t<li v-else-if=\"node.type === 'list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<li v-else-if=\"node.type === 'o-list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<ul v-else-if=\"node.type === 'group-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ul>\n\t<ol v-else-if=\"node.type === 'group-o-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ol>\n\t<p class=\"block-img\" v-else-if=\"node.type === 'image'\">\n\t\t<PrismicLink v-if=\"node.linkTo\" :field=\"node.linkTo\"\n\t\t\t><PrismicImage :field=\"node\" v-bind=\"attrs\"\n\t\t/></PrismicLink>\n\t\t<PrismicImage v-else :field=\"node\" v-bind=\"attrs\" />\n\t</p>\n\t<div\n\t\tv-else-if=\"node.type === 'embed'\"\n\t\t:data-oembed=\"node.oembed.embed_url\"\n\t\t:data-oembed-type=\"node.oembed.type\"\n\t\t:data-oembed-provider=\"node.oembed.provider_name\"\n\t\tv-html=\"node.oembed.html\"\n\t\tv-bind=\"attrs\"\n\t/>\n\t<PrismicLink\n\t\tv-else-if=\"node.type === 'hyperlink'\"\n\t\t:field=\"node.data\"\n\t\t:link-resolver=\"linkResolver\"\n\t\tv-bind=\"attrs\"\n\t\t><slot\n\t/></PrismicLink>\n\t<span v-else-if=\"node.type === 'label'\" :class=\"node.data.label\" v-bind=\"attrs\"><slot /></span>\n\t<template v-else v-for=\"(line, index) in node.text.split('\\n')\" :key=\"line\"\n\t\t><br v-if=\"index > 0\" />{{ line }}</template\n\t>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EAQd,MAAM,KAAK,eAAe;
|
|
1
|
+
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport PrismicImage from \"../PrismicImage.vue\"\nimport PrismicLink from \"../PrismicLink.vue\"\nimport type { ComponentShorthand } from \"../types\"\nimport type { RichTextComponentProps } from \"./types\"\n\nconst props = defineProps<\n\tRichTextComponentProps & {\n\t\tlinkResolver?: LinkResolverFunction\n\t\tshorthand?: ComponentShorthand\n\t}\n>()\ndefineOptions({ name: \"PrismicRichTextDefaultComponent\" })\n\nconst as = computed(() => {\n\treturn props.node.type !== \"image\" &&\n\t\tprops.node.type !== \"hyperlink\" &&\n\t\tprops.node.type !== \"label\" &&\n\t\tprops.node.type !== \"span\"\n\t\t? props.shorthand?.as\n\t\t: undefined\n})\n\nconst attrs = computed(() => {\n\tconst { as, ...attrs } = props.shorthand ?? {}\n\n\treturn attrs\n})\n\nconst dir = computed(() => {\n\treturn \"direction\" in props.node && props.node.direction === \"rtl\" ? \"rtl\" : undefined\n})\n</script>\n\n<template>\n\t<component v-if=\"as\" :is=\"as\" :dir=\"dir\" v-bind=\"attrs\"><slot /></component>\n\t<h1 v-else-if=\"node.type === 'heading1'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h1>\n\t<h2 v-else-if=\"node.type === 'heading2'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h2>\n\t<h3 v-else-if=\"node.type === 'heading3'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h3>\n\t<h4 v-else-if=\"node.type === 'heading4'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h4>\n\t<h5 v-else-if=\"node.type === 'heading5'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h5>\n\t<h6 v-else-if=\"node.type === 'heading6'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</h6>\n\t<p v-else-if=\"node.type === 'paragraph'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</p>\n\t<pre v-else-if=\"node.type === 'preformatted'\" v-bind=\"attrs\"><slot /></pre>\n\t<strong v-else-if=\"node.type === 'strong'\" v-bind=\"attrs\"><slot /></strong>\n\t<em v-else-if=\"node.type === 'em'\" v-bind=\"attrs\"><slot /></em>\n\t<li v-else-if=\"node.type === 'list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<li v-else-if=\"node.type === 'o-list-item'\" :dir=\"dir\" v-bind=\"attrs\">\n\t\t<slot />\n\t</li>\n\t<ul v-else-if=\"node.type === 'group-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ul>\n\t<ol v-else-if=\"node.type === 'group-o-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ol>\n\t<p class=\"block-img\" v-else-if=\"node.type === 'image'\">\n\t\t<PrismicLink v-if=\"node.linkTo\" :field=\"node.linkTo\"\n\t\t\t><PrismicImage :field=\"node\" v-bind=\"attrs\"\n\t\t/></PrismicLink>\n\t\t<PrismicImage v-else :field=\"node\" v-bind=\"attrs\" />\n\t</p>\n\t<div\n\t\tv-else-if=\"node.type === 'embed'\"\n\t\t:data-oembed=\"node.oembed.embed_url\"\n\t\t:data-oembed-type=\"node.oembed.type\"\n\t\t:data-oembed-provider=\"node.oembed.provider_name\"\n\t\tv-html=\"node.oembed.html\"\n\t\tv-bind=\"attrs\"\n\t/>\n\t<PrismicLink\n\t\tv-else-if=\"node.type === 'hyperlink'\"\n\t\t:field=\"node.data\"\n\t\t:link-resolver=\"linkResolver\"\n\t\tv-bind=\"attrs\"\n\t\t><slot\n\t/></PrismicLink>\n\t<span v-else-if=\"node.type === 'label'\" :class=\"node.data.label\" v-bind=\"attrs\"><slot /></span>\n\t<template v-else v-for=\"(line, index) in node.text.split('\\n')\" :key=\"line\"\n\t\t><br v-if=\"index > 0\" />{{ line }}</template\n\t>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,QAAQ;EAQd,MAAM,KAAK,eAAe;GACzB,OAAO,MAAM,KAAK,SAAS,WAC1B,MAAM,KAAK,SAAS,eACpB,MAAM,KAAK,SAAS,WACpB,MAAM,KAAK,SAAS,SAClB,MAAM,WAAW,KACjB,KAAA;EACJ,CAAC;EAED,MAAM,QAAQ,eAAe;GAC5B,MAAM,EAAE,IAAI,GAAG,UAAU,MAAM,aAAa,CAAC;GAE7C,OAAO;EACR,CAAC;EAED,MAAM,MAAM,eAAe;GAC1B,OAAO,eAAe,MAAM,QAAQ,MAAM,KAAK,cAAc,QAAQ,QAAQ,KAAA;EAC9E,CAAC;;GAIiB,OAAA,GAAA,SAAjB,UAAA,GAAA,YAA4E,wBAAlD,GAAA,KAAE,GAA5B,WAA4E;;IAA7C,KAAK,IAAA;GAAa,GAAA,MAAA,KAAK,GAAA;IAAE,SAAA,cAAQ,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;GACjD,GAAA,IAAA,CAAA,KAAA,CAAA,KAAA,QAAA,KAAK,SAAI,cAAxB,UAAA,GAAA,mBAEK,MAFL,WAEK;;IAFqC,KAAK,IAAA;GAAa,GAAA,MAAA,KAAK,GAAA,CAChE,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,IAAA,UAAA,KAEM,QAAA,KAAK,S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("vue");
|
|
2
2
|
//#region src/PrismicRichText/PrismicRichTextSerialize.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default =
|
|
3
|
+
var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
4
4
|
name: "PrismicRichTextSerialize",
|
|
5
5
|
__name: "PrismicRichTextSerialize",
|
|
6
6
|
props: {
|
package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { InternalRichTextComponents } from \"./types\"\n\ntype PrismicRichTextSerializeProps = {\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tinternalComponents: InternalRichTextComponents\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"child.key\"\n\t\t:is=\"internalComponents[child.type].is\"\n\t\t:node=\"child.node\"\n\t\t:link-resolver=\"internalComponents[child.type].linkResolver\"\n\t\t:shorthand=\"internalComponents[child.type].shorthand\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:internal-components=\"internalComponents\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;;;
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { InternalRichTextComponents } from \"./types\"\n\ntype PrismicRichTextSerializeProps = {\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tinternalComponents: InternalRichTextComponents\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"child.key\"\n\t\t:is=\"internalComponents[child.type].is\"\n\t\t:node=\"child.node\"\n\t\t:link-resolver=\"internalComponents[child.type].linkResolver\"\n\t\t:shorthand=\"internalComponents[child.type].shorthand\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:internal-components=\"internalComponents\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;;;GAKb,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,IAAA,GAAA,IAAA,mBAAA,CAWc,IAAA,UAAA,OAAA,GAAA,IAAA,WAAA,CAVG,MAAM,WAAf,UAAK;IADb,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAWc,IAAA,wBAAA,CARR,QAAA,mBAAmB,MAAM,KAAI,CAAE,EAAE,GAAA;KADrC,KAAK,MAAM;KAEX,MAAM,MAAM;KACZ,iBAAe,QAAA,mBAAmB,MAAM,KAAI,CAAE;KAC9C,WAAW,QAAA,mBAAmB,MAAM,KAAI,CAAE;;KAC1C,UAAA,GAAA,IAAA,QAAA,OAIA,CAHM,MAAM,SAAS,WAAA,GADrB,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAIA,qCAAA;;MAFC,UAAU,MAAM;MAChB,uBAAqB,QAAA"}
|
package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock, renderList, resolveComponent, resolveDynamicComponent, withCtx } from "vue";
|
|
2
2
|
//#region src/PrismicRichText/PrismicRichTextSerialize.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default =
|
|
3
|
+
var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
4
4
|
name: "PrismicRichTextSerialize",
|
|
5
5
|
__name: "PrismicRichTextSerialize",
|
|
6
6
|
props: {
|
package/dist/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { InternalRichTextComponents } from \"./types\"\n\ntype PrismicRichTextSerializeProps = {\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tinternalComponents: InternalRichTextComponents\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"child.key\"\n\t\t:is=\"internalComponents[child.type].is\"\n\t\t:node=\"child.node\"\n\t\t:link-resolver=\"internalComponents[child.type].linkResolver\"\n\t\t:shorthand=\"internalComponents[child.type].shorthand\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:internal-components=\"internalComponents\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;;;
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { InternalRichTextComponents } from \"./types\"\n\ntype PrismicRichTextSerializeProps = {\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tinternalComponents: InternalRichTextComponents\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"child.key\"\n\t\t:is=\"internalComponents[child.type].is\"\n\t\t:node=\"child.node\"\n\t\t:link-resolver=\"internalComponents[child.type].linkResolver\"\n\t\t:shorthand=\"internalComponents[child.type].shorthand\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:internal-components=\"internalComponents\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAUA,MAAM,QAAQ;;;GAKb,OAAA,UAAA,IAAA,GAAA,mBAWc,UAAA,MAAA,WAVG,MAAM,WAAf,UAAK;IADb,OAAA,UAAA,GAAA,YAWc,wBARR,QAAA,mBAAmB,MAAM,KAAI,CAAE,EAAE,GAAA;KADrC,KAAK,MAAM;KAEX,MAAM,MAAM;KACZ,iBAAe,QAAA,mBAAmB,MAAM,KAAI,CAAE;KAC9C,WAAW,QAAA,mBAAmB,MAAM,KAAI,CAAE;;KAC1C,SAAA,cAIA,CAHM,MAAM,SAAS,UADrB,UAAA,GAAA,YAIA,qCAAA;;MAFC,UAAU,MAAM;MAChB,uBAAqB,QAAA"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Props are: `["node"]`
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
*
|
|
9
|
+
* ```javascript
|
|
10
10
|
* // Defining a new rich text component
|
|
11
11
|
* import { getRichTextComponentProps } from "@prismicio/vue"
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
|
-
*
|
|
17
|
+
* ```typescript
|
|
18
18
|
* // Defining a new rich text component for a specific node type
|
|
19
19
|
* import { getRichTextComponentProps } from "@prismicio/vue"
|
|
20
20
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRichTextComponentProps.cjs","names":[],"sources":["../../src/PrismicRichText/getRichTextComponentProps.ts"],"sourcesContent":["import type { RTAnyNode } from \"@prismicio/client\"\nimport type { PropType } from \"vue\"\n\nimport type { RichTextComponentProps } from \"./types\"\n\n/**\n * Native Vue props for a component rendering nodes from a Prismic rich text field using the\n * `<PrismicRichText />` component.\n *\n * @typeParam TRTNode - The type of rich text node(s) this component handles\n */\ntype DefineComponentRichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {\n\tnode: {\n\t\ttype: PropType<RichTextComponentProps<TRTNode>[\"node\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering nodes from a Prismic rich text field using the\n * `<PrismicRichText />` component.\n *\n * Props are: `[\"node\"]`\n *\n * @example\n * \t
|
|
1
|
+
{"version":3,"file":"getRichTextComponentProps.cjs","names":[],"sources":["../../src/PrismicRichText/getRichTextComponentProps.ts"],"sourcesContent":["import type { RTAnyNode } from \"@prismicio/client\"\nimport type { PropType } from \"vue\"\n\nimport type { RichTextComponentProps } from \"./types\"\n\n/**\n * Native Vue props for a component rendering nodes from a Prismic rich text field using the\n * `<PrismicRichText />` component.\n *\n * @typeParam TRTNode - The type of rich text node(s) this component handles\n */\ntype DefineComponentRichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {\n\tnode: {\n\t\ttype: PropType<RichTextComponentProps<TRTNode>[\"node\"]>\n\t\trequired: true\n\t}\n}\n\n/**\n * Gets native Vue props for a component rendering nodes from a Prismic rich text field using the\n * `<PrismicRichText />` component.\n *\n * Props are: `[\"node\"]`\n *\n * @example\n * \t```javascript\n * \t// Defining a new rich text component\n * \timport { getRichTextComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getRichTextComponentProps())\n * \t```\n *\n * @example\n * \t```typescript\n * \t// Defining a new rich text component for a specific node type\n * \timport { getRichTextComponentProps } from \"@prismicio/vue\"\n *\n * \tdefineProps(getRichTextComponentProps(\"heading1\"))\n * \t```\n *\n * @typeParam TRTType - The type of rich text node(s) this component handles\n * @param type - The type of rich text node this component handles\n * @returns Props object to use with `defineProps()`\n */\nexport const getRichTextComponentProps = <TRTType extends RTAnyNode[\"type\"]>(\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\ttype?: TRTType,\n): DefineComponentRichTextComponentProps<Extract<RTAnyNode, { type: TRTType }>> => ({\n\tnode: {\n\t\ttype: Object as PropType<RichTextComponentProps<Extract<RTAnyNode, { type: TRTType }>>[\"node\"]>,\n\t\trequired: true,\n\t},\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAa,6BAEZ,UACmF,EACnF,MAAM;CACL,MAAM;CACN,UAAU;AACX,EACD"}
|