@prismicio/vue 5.3.0-pr.88.ee9acb6 → 5.3.0-pr.89.d0f4ac2
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.vue.d.cts +15 -49
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts +57 -52
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +14 -14
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.cts +25 -26
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +8 -9
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.cts +7 -8
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.cts +2 -6
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +3 -14
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/SliceZone/types.d.cts +3 -9
- package/dist/SliceZone/types.d.cts.map +1 -1
- package/dist/createPrismic.d.cts +61 -0
- package/dist/createPrismic.d.cts.map +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/src/PrismicImage.cjs.map +1 -1
- package/dist/src/PrismicImage.js.map +1 -1
- package/dist/src/PrismicImage.vue.d.ts +15 -49
- package/dist/src/PrismicImage.vue.d.ts.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicLink.cjs.map +1 -1
- package/dist/src/PrismicLink.js.map +1 -1
- package/dist/src/PrismicLink.vue.d.ts +57 -52
- package/dist/src/PrismicLink.vue.d.ts.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +6 -10
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js +6 -10
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts +18 -18
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +11 -5
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js +11 -5
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/src/PrismicRichText/PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.js.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs +10 -4
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js +11 -5
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/index.d.ts +1 -1
- package/dist/src/PrismicRichText/types.d.ts +25 -26
- package/dist/src/PrismicRichText/types.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts +10 -11
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +18 -10
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js +19 -11
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +12 -30
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +12 -30
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/index.d.ts +1 -0
- package/dist/src/PrismicTable/types.d.ts +7 -8
- package/dist/src/PrismicTable/types.d.ts.map +1 -1
- package/dist/src/PrismicText.cjs.map +1 -1
- package/dist/src/PrismicText.js.map +1 -1
- package/dist/src/PrismicText.vue.d.ts +2 -6
- package/dist/src/PrismicText.vue.d.ts.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue.d.ts +3 -14
- package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/SliceZone/types.d.ts +3 -9
- package/dist/src/SliceZone/types.d.ts.map +1 -1
- package/dist/src/createPrismic.cjs +33 -0
- package/dist/src/createPrismic.cjs.map +1 -0
- package/dist/src/createPrismic.d.ts +63 -0
- package/dist/src/createPrismic.d.ts.map +1 -0
- package/dist/src/createPrismic.js +32 -0
- package/dist/src/createPrismic.js.map +1 -0
- package/dist/src/lib/isInternalURL.cjs +2 -6
- package/dist/src/lib/isInternalURL.cjs.map +1 -1
- package/dist/src/lib/isInternalURL.js +2 -6
- package/dist/src/lib/isInternalURL.js.map +1 -1
- package/dist/src/types.cjs.map +1 -1
- package/dist/src/types.d.ts +11 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/types.d.cts +11 -1
- package/dist/types.d.cts.map +1 -1
- package/package.json +1 -3
- package/src/PrismicImage.vue +5 -16
- package/src/PrismicLink.vue +26 -26
- package/src/PrismicRichText/PrismicRichText.vue +33 -23
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +8 -4
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +4 -3
- package/src/PrismicRichText/index.ts +1 -1
- package/src/PrismicRichText/types.ts +57 -29
- package/src/PrismicTable/PrismicTable.vue +31 -23
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +14 -39
- package/src/PrismicTable/PrismicTableRow.vue +2 -2
- package/src/PrismicTable/index.ts +2 -0
- package/src/PrismicTable/types.ts +41 -23
- package/src/PrismicText.vue +2 -6
- package/src/SliceZone/SliceZone.vue +3 -14
- package/src/SliceZone/types.ts +3 -9
- package/src/createPrismic.ts +86 -0
- package/src/index.ts +5 -1
- package/src/lib/isInternalURL.ts +2 -6
- package/src/types.ts +13 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.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 { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n
|
|
1
|
+
{"version":3,"file":"PrismicLink.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 { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport { usePrismic } from \"./createPrismic\"\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\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\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 { componentsConfig } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\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 ||\n\t\t\t\tcomponentsConfig?.linkInternalComponent ||\n\t\t\t\tdefaultInternalComponent\n\t\t: props.externalComponent ||\n\t\t\t\tcomponentsConfig?.linkExternalComponent ||\n\t\t\t\tdefaultExternalComponent\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":""}
|
|
@@ -3,18 +3,16 @@ import * as vue16 from "vue";
|
|
|
3
3
|
import { AsLinkAttrsConfig, LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client";
|
|
4
4
|
|
|
5
5
|
//#region src/PrismicLink.vue.d.ts
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Props for `<PrismicLink />`.
|
|
9
|
-
*/
|
|
6
|
+
/** Props for `<PrismicLink />`. */
|
|
10
7
|
type PrismicLinkProps = {
|
|
11
8
|
/**
|
|
12
|
-
*
|
|
13
|
-
* resolver parameter with `@prismicio/client`.
|
|
9
|
+
* The link resolver used to resolve links.
|
|
14
10
|
*
|
|
15
|
-
* @
|
|
11
|
+
* @remarks
|
|
12
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
13
|
+
* repository's content, a link resolver does not need to be provided.
|
|
16
14
|
*
|
|
17
|
-
* @see
|
|
15
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
18
16
|
*/
|
|
19
17
|
linkResolver?: LinkResolverFunction;
|
|
20
18
|
/**
|
|
@@ -24,27 +22,26 @@ type PrismicLinkProps = {
|
|
|
24
22
|
*/
|
|
25
23
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
26
24
|
/**
|
|
27
|
-
* The
|
|
25
|
+
* The component rendered for internal URLs.
|
|
26
|
+
*
|
|
27
|
+
* If your app uses a client-side router that requires a special Link
|
|
28
|
+
* component, provide the Link component to this prop.
|
|
28
29
|
*
|
|
29
30
|
* @defaultValue `<RouterLink>`
|
|
30
31
|
*/
|
|
31
32
|
internalComponent?: ComponentOrTagName;
|
|
32
33
|
/**
|
|
33
|
-
* The
|
|
34
|
+
* The component rendered for external URLs.
|
|
34
35
|
*
|
|
35
36
|
* @defaultValue `<a>`
|
|
36
37
|
*/
|
|
37
38
|
externalComponent?: ComponentOrTagName;
|
|
38
39
|
} & ({
|
|
39
|
-
/**
|
|
40
|
-
* The Prismic link field to render.
|
|
41
|
-
*/
|
|
40
|
+
/** The Prismic link field to render. */
|
|
42
41
|
field: LinkField;
|
|
43
42
|
document?: never;
|
|
44
43
|
} | {
|
|
45
|
-
/**
|
|
46
|
-
* The Prismic document to render as a link.
|
|
47
|
-
*/
|
|
44
|
+
/** The Prismic document to render as a link. */
|
|
48
45
|
document: PrismicDocument;
|
|
49
46
|
field?: never;
|
|
50
47
|
});
|
|
@@ -54,12 +51,13 @@ type __VLS_Slots = {} & {
|
|
|
54
51
|
};
|
|
55
52
|
declare const __VLS_base: vue16.DefineComponent<({
|
|
56
53
|
/**
|
|
57
|
-
*
|
|
58
|
-
* resolver parameter with `@prismicio/client`.
|
|
54
|
+
* The link resolver used to resolve links.
|
|
59
55
|
*
|
|
60
|
-
* @
|
|
56
|
+
* @remarks
|
|
57
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
58
|
+
* repository's content, a link resolver does not need to be provided.
|
|
61
59
|
*
|
|
62
|
-
* @see
|
|
60
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
63
61
|
*/
|
|
64
62
|
linkResolver?: LinkResolverFunction;
|
|
65
63
|
/**
|
|
@@ -69,31 +67,33 @@ declare const __VLS_base: vue16.DefineComponent<({
|
|
|
69
67
|
*/
|
|
70
68
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
71
69
|
/**
|
|
72
|
-
* The
|
|
70
|
+
* The component rendered for internal URLs.
|
|
71
|
+
*
|
|
72
|
+
* If your app uses a client-side router that requires a special Link
|
|
73
|
+
* component, provide the Link component to this prop.
|
|
73
74
|
*
|
|
74
75
|
* @defaultValue `<RouterLink>`
|
|
75
76
|
*/
|
|
76
77
|
internalComponent?: ComponentOrTagName;
|
|
77
78
|
/**
|
|
78
|
-
* The
|
|
79
|
+
* The component rendered for external URLs.
|
|
79
80
|
*
|
|
80
81
|
* @defaultValue `<a>`
|
|
81
82
|
*/
|
|
82
83
|
externalComponent?: ComponentOrTagName;
|
|
83
84
|
} & {
|
|
84
|
-
/**
|
|
85
|
-
* The Prismic link field to render.
|
|
86
|
-
*/
|
|
85
|
+
/** The Prismic link field to render. */
|
|
87
86
|
field: LinkField;
|
|
88
87
|
document?: never;
|
|
89
88
|
}) | ({
|
|
90
89
|
/**
|
|
91
|
-
*
|
|
92
|
-
* resolver parameter with `@prismicio/client`.
|
|
90
|
+
* The link resolver used to resolve links.
|
|
93
91
|
*
|
|
94
|
-
* @
|
|
92
|
+
* @remarks
|
|
93
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
94
|
+
* repository's content, a link resolver does not need to be provided.
|
|
95
95
|
*
|
|
96
|
-
* @see
|
|
96
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
97
97
|
*/
|
|
98
98
|
linkResolver?: LinkResolverFunction;
|
|
99
99
|
/**
|
|
@@ -103,31 +103,33 @@ declare const __VLS_base: vue16.DefineComponent<({
|
|
|
103
103
|
*/
|
|
104
104
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
105
105
|
/**
|
|
106
|
-
* The
|
|
106
|
+
* The component rendered for internal URLs.
|
|
107
|
+
*
|
|
108
|
+
* If your app uses a client-side router that requires a special Link
|
|
109
|
+
* component, provide the Link component to this prop.
|
|
107
110
|
*
|
|
108
111
|
* @defaultValue `<RouterLink>`
|
|
109
112
|
*/
|
|
110
113
|
internalComponent?: ComponentOrTagName;
|
|
111
114
|
/**
|
|
112
|
-
* The
|
|
115
|
+
* The component rendered for external URLs.
|
|
113
116
|
*
|
|
114
117
|
* @defaultValue `<a>`
|
|
115
118
|
*/
|
|
116
119
|
externalComponent?: ComponentOrTagName;
|
|
117
120
|
} & {
|
|
118
|
-
/**
|
|
119
|
-
* The Prismic document to render as a link.
|
|
120
|
-
*/
|
|
121
|
+
/** The Prismic document to render as a link. */
|
|
121
122
|
document: PrismicDocument;
|
|
122
123
|
field?: never;
|
|
123
124
|
}), {}, {}, {}, {}, vue16.ComponentOptionsMixin, vue16.ComponentOptionsMixin, {}, string, vue16.PublicProps, Readonly<({
|
|
124
125
|
/**
|
|
125
|
-
*
|
|
126
|
-
* resolver parameter with `@prismicio/client`.
|
|
126
|
+
* The link resolver used to resolve links.
|
|
127
127
|
*
|
|
128
|
-
* @
|
|
128
|
+
* @remarks
|
|
129
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
130
|
+
* repository's content, a link resolver does not need to be provided.
|
|
129
131
|
*
|
|
130
|
-
* @see
|
|
132
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
131
133
|
*/
|
|
132
134
|
linkResolver?: LinkResolverFunction;
|
|
133
135
|
/**
|
|
@@ -137,31 +139,33 @@ declare const __VLS_base: vue16.DefineComponent<({
|
|
|
137
139
|
*/
|
|
138
140
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
139
141
|
/**
|
|
140
|
-
* The
|
|
142
|
+
* The component rendered for internal URLs.
|
|
143
|
+
*
|
|
144
|
+
* If your app uses a client-side router that requires a special Link
|
|
145
|
+
* component, provide the Link component to this prop.
|
|
141
146
|
*
|
|
142
147
|
* @defaultValue `<RouterLink>`
|
|
143
148
|
*/
|
|
144
149
|
internalComponent?: ComponentOrTagName;
|
|
145
150
|
/**
|
|
146
|
-
* The
|
|
151
|
+
* The component rendered for external URLs.
|
|
147
152
|
*
|
|
148
153
|
* @defaultValue `<a>`
|
|
149
154
|
*/
|
|
150
155
|
externalComponent?: ComponentOrTagName;
|
|
151
156
|
} & {
|
|
152
|
-
/**
|
|
153
|
-
* The Prismic link field to render.
|
|
154
|
-
*/
|
|
157
|
+
/** The Prismic link field to render. */
|
|
155
158
|
field: LinkField;
|
|
156
159
|
document?: never;
|
|
157
160
|
}) | ({
|
|
158
161
|
/**
|
|
159
|
-
*
|
|
160
|
-
* resolver parameter with `@prismicio/client`.
|
|
162
|
+
* The link resolver used to resolve links.
|
|
161
163
|
*
|
|
162
|
-
* @
|
|
164
|
+
* @remarks
|
|
165
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
166
|
+
* repository's content, a link resolver does not need to be provided.
|
|
163
167
|
*
|
|
164
|
-
* @see
|
|
168
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
165
169
|
*/
|
|
166
170
|
linkResolver?: LinkResolverFunction;
|
|
167
171
|
/**
|
|
@@ -171,21 +175,22 @@ declare const __VLS_base: vue16.DefineComponent<({
|
|
|
171
175
|
*/
|
|
172
176
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
173
177
|
/**
|
|
174
|
-
* The
|
|
178
|
+
* The component rendered for internal URLs.
|
|
179
|
+
*
|
|
180
|
+
* If your app uses a client-side router that requires a special Link
|
|
181
|
+
* component, provide the Link component to this prop.
|
|
175
182
|
*
|
|
176
183
|
* @defaultValue `<RouterLink>`
|
|
177
184
|
*/
|
|
178
185
|
internalComponent?: ComponentOrTagName;
|
|
179
186
|
/**
|
|
180
|
-
* The
|
|
187
|
+
* The component rendered for external URLs.
|
|
181
188
|
*
|
|
182
189
|
* @defaultValue `<a>`
|
|
183
190
|
*/
|
|
184
191
|
externalComponent?: ComponentOrTagName;
|
|
185
192
|
} & {
|
|
186
|
-
/**
|
|
187
|
-
* The Prismic document to render as a link.
|
|
188
|
-
*/
|
|
193
|
+
/** The Prismic document to render as a link. */
|
|
189
194
|
document: PrismicDocument;
|
|
190
195
|
field?: never;
|
|
191
196
|
})> & Readonly<{}>, {}, {}, {}, {}, string, vue16.ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":";;;;;;KAwJY,gBAAA;EAAA;;;;;;;;AA8CX;EAiFI,YAAA,CAAA,EArHW,oBAsHoB;EAK9B;;;;;EA/FI,GAAA,CAAA,EAAA,MAAA,GArBM,iBAqBN,CAAA,KAAA,CAAA;EA5BM;;;;;;;;EAAA,iBAAA,CAAA,EAiBK,kBAjBL;EAOA;;;;;EAAA,iBAAA,CAAA,EAiBK,kBAjBL;CAUK,GAAA,CAAA;EAOA;EASR,KAAA,EALH,SAKG;;;;UA0FG,EA1FH,eA0FG;EAAA,KAAA,CAAA,EAAA,KAAA;AAAA,CAAA,CAAA;YAPZ,OAU8C,EAAA,CAAA,CAAA;KAT7C,WAAA,GASyD,CAAA,CAAA,GAAA;EAAnC,OAAA,CAAA,EAAA,CAAA,KAAA,EAAA,OARE,OAQF,EAAA,GAAA,GAAA;CAAe;AAAA,cAHpC,UAIkC,QAJxB,eAIwB,CAAA,CAAA;EACnC;;;;;;;;;iBAhIW;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;oBAAe,KAAA,CAAA,qBAAA;;;;;;;;;;iBAjCZ;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;;cA6FP,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
const require_createPrismic = require('./createPrismic.cjs');
|
|
1
2
|
const require_isInternalURL = require('./lib/isInternalURL.cjs');
|
|
2
3
|
let vue = require("vue");
|
|
3
4
|
let __prismicio_client = require("@prismicio/client");
|
|
4
5
|
|
|
5
6
|
//#region src/PrismicLink.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
/**
|
|
7
|
-
* The default component rendered for internal URLs.
|
|
8
|
-
*/
|
|
7
|
+
/** The default component rendered for internal URLs. */
|
|
9
8
|
const defaultInternalComponent = "router-link";
|
|
10
|
-
/**
|
|
11
|
-
* The default component rendered for external URLs.
|
|
12
|
-
*/
|
|
9
|
+
/** The default component rendered for external URLs. */
|
|
13
10
|
const defaultExternalComponent = "a";
|
|
14
|
-
/**
|
|
15
|
-
* The default rel attribute rendered for external URLs.
|
|
16
|
-
*/
|
|
11
|
+
/** The default rel attribute rendered for external URLs. */
|
|
17
12
|
const defaultExternalRelAttribute = "noreferrer";
|
|
18
13
|
var PrismicLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
19
14
|
name: "PrismicLink",
|
|
@@ -46,6 +41,7 @@ var PrismicLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0
|
|
|
46
41
|
},
|
|
47
42
|
setup(__props) {
|
|
48
43
|
const props = __props;
|
|
44
|
+
const { componentsConfig } = require_createPrismic.usePrismic();
|
|
49
45
|
const rawAttrs = (0, vue.computed)(() => {
|
|
50
46
|
return (0, __prismicio_client.asLinkAttrs)(props.field || props.document, {
|
|
51
47
|
linkResolver: props.linkResolver,
|
|
@@ -56,7 +52,7 @@ var PrismicLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0
|
|
|
56
52
|
});
|
|
57
53
|
});
|
|
58
54
|
const component = (0, vue.computed)(() => {
|
|
59
|
-
return require_isInternalURL.isInternalURL(rawAttrs.value.href || "") ? props.internalComponent || defaultInternalComponent : props.externalComponent || defaultExternalComponent;
|
|
55
|
+
return require_isInternalURL.isInternalURL(rawAttrs.value.href || "") ? props.internalComponent || componentsConfig?.linkInternalComponent || defaultInternalComponent : props.externalComponent || componentsConfig?.linkExternalComponent || defaultExternalComponent;
|
|
60
56
|
});
|
|
61
57
|
const attrs = (0, vue.computed)(() => {
|
|
62
58
|
return component.value === "a" ? {
|
|
@@ -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 { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n
|
|
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 { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport { usePrismic } from \"./createPrismic\"\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\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\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 { componentsConfig } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\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 ||\n\t\t\t\tcomponentsConfig?.linkInternalComponent ||\n\t\t\t\tdefaultInternalComponent\n\t\t: props.externalComponent ||\n\t\t\t\tcomponentsConfig?.linkExternalComponent ||\n\t\t\t\tdefaultExternalComponent\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":";;;;;;;AAiBA,MAAM,2BAA2B;;AAGjC,MAAM,2BAA2B;;AAGjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDpC,MAAM,QAAQ;EAGd,MAAM,EAAE,qBAAqB,kCAAW;EAExC,MAAM,mCAA0B;AAC/B,8CAAmB,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM;IACpB,IAAI,MAAM;AACT,SAAI,MAAM,IACT,QAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,KAAK,GAAG,MAAM;AAGlE,YAAO,KAAK,aAAa,8BAA8B;;IAExD,CAAA;IACD;EAED,MAAM,oCAA2B;AAChC,UAAO,oCAAc,SAAS,MAAM,QAAQ,GAAE,GAC3C,MAAM,qBACN,kBAAkB,yBAClB,2BACA,MAAM,qBACN,kBAAkB,yBAClB;IACH;EAGD,MAAM,gCAAuB;AAC5B,UAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB,GACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB;IACF;;sFAIgB,UAAA,MAAS,sDAAU,MAAA,MAAK,CAAA,EAAA;oCAGhC,qBAAA,KAAA,QAAA,WAAA,EAAA,QAAA,mDADH,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,OAAS,EAAA,EAAA"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
import { usePrismic } from "./createPrismic.js";
|
|
1
2
|
import { isInternalURL } from "./lib/isInternalURL.js";
|
|
2
3
|
import { computed, createBlock, createTextVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
|
|
3
4
|
import { asLinkAttrs } from "@prismicio/client";
|
|
4
5
|
|
|
5
6
|
//#region src/PrismicLink.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
/**
|
|
7
|
-
* The default component rendered for internal URLs.
|
|
8
|
-
*/
|
|
7
|
+
/** The default component rendered for internal URLs. */
|
|
9
8
|
const defaultInternalComponent = "router-link";
|
|
10
|
-
/**
|
|
11
|
-
* The default component rendered for external URLs.
|
|
12
|
-
*/
|
|
9
|
+
/** The default component rendered for external URLs. */
|
|
13
10
|
const defaultExternalComponent = "a";
|
|
14
|
-
/**
|
|
15
|
-
* The default rel attribute rendered for external URLs.
|
|
16
|
-
*/
|
|
11
|
+
/** The default rel attribute rendered for external URLs. */
|
|
17
12
|
const defaultExternalRelAttribute = "noreferrer";
|
|
18
13
|
var PrismicLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
19
14
|
name: "PrismicLink",
|
|
@@ -46,6 +41,7 @@ var PrismicLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
46
41
|
},
|
|
47
42
|
setup(__props) {
|
|
48
43
|
const props = __props;
|
|
44
|
+
const { componentsConfig } = usePrismic();
|
|
49
45
|
const rawAttrs = computed(() => {
|
|
50
46
|
return asLinkAttrs(props.field || props.document, {
|
|
51
47
|
linkResolver: props.linkResolver,
|
|
@@ -56,7 +52,7 @@ var PrismicLink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
56
52
|
});
|
|
57
53
|
});
|
|
58
54
|
const component = computed(() => {
|
|
59
|
-
return isInternalURL(rawAttrs.value.href || "") ? props.internalComponent || defaultInternalComponent : props.externalComponent || defaultExternalComponent;
|
|
55
|
+
return isInternalURL(rawAttrs.value.href || "") ? props.internalComponent || componentsConfig?.linkInternalComponent || defaultInternalComponent : props.externalComponent || componentsConfig?.linkExternalComponent || defaultExternalComponent;
|
|
60
56
|
});
|
|
61
57
|
const attrs = computed(() => {
|
|
62
58
|
return component.value === "a" ? {
|
|
@@ -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 { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\n
|
|
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 { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport { usePrismic } from \"./createPrismic\"\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\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\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 { componentsConfig } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver,\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 ||\n\t\t\t\tcomponentsConfig?.linkInternalComponent ||\n\t\t\t\tdefaultInternalComponent\n\t\t: props.externalComponent ||\n\t\t\t\tcomponentsConfig?.linkExternalComponent ||\n\t\t\t\tdefaultExternalComponent\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":";;;;;;;AAiBA,MAAM,2BAA2B;;AAGjC,MAAM,2BAA2B;;AAGjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmDpC,MAAM,QAAQ;EAGd,MAAM,EAAE,qBAAqB,YAAW;EAExC,MAAM,WAAW,eAAe;AAC/B,UAAO,YAAY,MAAM,SAAS,MAAM,UAAU;IACjD,cAAc,MAAM;IACpB,IAAI,MAAM;AACT,SAAI,MAAM,IACT,QAAO,OAAO,MAAM,QAAQ,aAAa,MAAM,IAAI,KAAK,GAAG,MAAM;AAGlE,YAAO,KAAK,aAAa,8BAA8B;;IAExD,CAAA;IACD;EAED,MAAM,YAAY,eAAe;AAChC,UAAO,cAAc,SAAS,MAAM,QAAQ,GAAE,GAC3C,MAAM,qBACN,kBAAkB,yBAClB,2BACA,MAAM,qBACN,kBAAkB,yBAClB;IACH;EAGD,MAAM,QAAQ,eAAe;AAC5B,UAAO,UAAU,UAAU,MACxB;IACA,MAAM,SAAS,MAAM;IACrB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB,GACC;IACA,IAAI,SAAS,MAAM;IACnB,QAAQ,SAAS,MAAM;IACvB,KAAK,SAAS,MAAM;IACrB;IACF;;uBAIA,YAIY,wBAJI,UAAA,MAAS,EAAA,eAAA,mBAAU,MAAA,MAAK,CAAA,EAAA;2BAGhC,CAFP,WAEO,KAAA,QAAA,WAAA,EAAA,QAAA,iCADH,MAAM,SAAK,UAAc,MAAM,QAAQ,MAAM,MAAM,OAAO,OAAS,EAAA,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport {
|
|
1
|
+
{"version":3,"file":"PrismicRichText.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName, VueComponentShorthand } from \"../types\"\nimport { isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponents,\n\tVueRichTextComponent,\n\tVueRichTextComponents,\n} from \"./types\"\n\nimport { usePrismic } from \"../createPrismic\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\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\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a\n\t * shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextComponents\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: 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<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst { componentsConfig } = usePrismic()\n\nconst resolvedComponents = computed<VueRichTextComponents>(() => {\n\treturn { ...componentsConfig?.defaultComponents, ...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| VueRichTextComponent\n\t\t| VueComponentShorthand\n\t\t| undefined\n\n\tif (isVueComponent(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<InternalVueRichTextComponents>(() => {\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 {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport {
|
|
1
|
+
{"version":3,"file":"PrismicRichText.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName, VueComponentShorthand } from \"../types\"\nimport { isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponents,\n\tVueRichTextComponent,\n\tVueRichTextComponents,\n} from \"./types\"\n\nimport { usePrismic } from \"../createPrismic\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\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\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a\n\t * shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextComponents\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: 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<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst { componentsConfig } = usePrismic()\n\nconst resolvedComponents = computed<VueRichTextComponents>(() => {\n\treturn { ...componentsConfig?.defaultComponents, ...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| VueRichTextComponent\n\t\t| VueComponentShorthand\n\t\t| undefined\n\n\tif (isVueComponent(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<InternalVueRichTextComponents>(() => {\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,46 +1,46 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.js";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
2
|
+
import { VueRichTextComponents } from "./types.js";
|
|
3
|
+
import * as vue4 from "vue";
|
|
4
4
|
import { PropType } from "vue";
|
|
5
5
|
import { LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
6
6
|
|
|
7
7
|
//#region src/PrismicRichText/PrismicRichText.vue.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Props for `<PrismicRichText />`.
|
|
10
|
-
*/
|
|
8
|
+
/** Props for `<PrismicRichText />`. */
|
|
11
9
|
type PrismicRichTextProps = {
|
|
12
|
-
/**
|
|
13
|
-
* The Prismic rich text or title field to render.
|
|
14
|
-
*/
|
|
10
|
+
/** The Prismic rich text field to render. */
|
|
15
11
|
field: RichTextField | null | undefined;
|
|
16
12
|
/**
|
|
17
|
-
*
|
|
18
|
-
* resolver parameter with `@prismicio/client`.
|
|
13
|
+
* The link resolver used to resolve links.
|
|
19
14
|
*
|
|
20
|
-
* @
|
|
15
|
+
* @remarks
|
|
16
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
17
|
+
* repository's content, a link resolver does not need to be provided.
|
|
21
18
|
*
|
|
22
|
-
* @see
|
|
19
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
23
20
|
*/
|
|
24
21
|
linkResolver?: LinkResolverFunction;
|
|
25
22
|
/**
|
|
26
|
-
* An object that maps a rich text block type to a Vue component
|
|
23
|
+
* An object that maps a rich text block type to a Vue component or a
|
|
24
|
+
* shorthand definition.
|
|
27
25
|
*
|
|
28
26
|
* @example
|
|
29
27
|
*
|
|
30
28
|
* ```javascript
|
|
31
29
|
* {
|
|
32
30
|
* heading1: Heading1,
|
|
31
|
+
* paragraph: { class: 'prose'},
|
|
32
|
+
* strong: { as: 'em', class: 'font-bold' },
|
|
33
33
|
* }
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
components?:
|
|
36
|
+
components?: VueRichTextComponents;
|
|
37
37
|
/**
|
|
38
38
|
* The value to be rendered when the field is empty. If a fallback is not
|
|
39
|
-
* given, `null`
|
|
39
|
+
* given, `null` will be rendered.
|
|
40
40
|
*/
|
|
41
41
|
fallback?: ComponentOrTagName;
|
|
42
42
|
};
|
|
43
|
-
declare const __VLS_export:
|
|
43
|
+
declare const __VLS_export: vue4.DefineComponent<vue4.ExtractPropTypes<{
|
|
44
44
|
field: {
|
|
45
45
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
46
46
|
};
|
|
@@ -53,7 +53,7 @@ declare const __VLS_export: vue0.DefineComponent<vue0.ExtractPropTypes<{
|
|
|
53
53
|
fallback: {
|
|
54
54
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
55
55
|
};
|
|
56
|
-
}>, {}, {}, {}, {},
|
|
56
|
+
}>, {}, {}, {}, {}, vue4.ComponentOptionsMixin, vue4.ComponentOptionsMixin, {}, string, vue4.PublicProps, Readonly<vue4.ExtractPropTypes<{
|
|
57
57
|
field: {
|
|
58
58
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
59
59
|
};
|
|
@@ -66,7 +66,7 @@ declare const __VLS_export: vue0.DefineComponent<vue0.ExtractPropTypes<{
|
|
|
66
66
|
fallback: {
|
|
67
67
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
68
68
|
};
|
|
69
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string,
|
|
69
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue4.ComponentProvideOptions, true, {}, any>;
|
|
70
70
|
declare const _default: typeof __VLS_export;
|
|
71
71
|
//#endregion
|
|
72
72
|
export { PrismicRichTextProps, _default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.vue.d.ts","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicRichText.vue.d.ts","names":[],"sources":["../../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":[],"mappings":";;;;;;;;KAuKY,oBAAA;;EAAA,KAAA,EAEJ,aAFI,GAAoB,IAAA,GAAA,SAAA;EAExB;;;;;AAkCP;;;;EA4HmB,YAAA,CAAA,EAnJJ,oBAmJI;EAGO;;;;;;;;;;;;;;EAIxB,UAAA,CAAA,EA1IW,qBA0IX;EADmC;;;;aAnI1B;;cAuHN,YAAY,OAAA,eAAA,CAY4B,IAAA,CAZ5B,gBAAA,CAAA;EAAA,KAAA,EAAA;UAGU,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;oBAbe,IAAA,CAAA,qBAAA,qEAY4B,IAAA,CAAA;;UATlB,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;;cAbe,iBAkBU"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_types = require('../types.cjs');
|
|
2
|
+
const require_createPrismic = require('../createPrismic.cjs');
|
|
2
3
|
const require_PrismicRichTextDefaultComponent = require('./PrismicRichTextDefaultComponent.cjs');
|
|
3
4
|
const require_PrismicRichTextSerialize = require('./PrismicRichTextSerialize.cjs');
|
|
4
5
|
let vue = require("vue");
|
|
@@ -20,18 +21,23 @@ var PrismicRichText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
20
21
|
},
|
|
21
22
|
setup(__props) {
|
|
22
23
|
const props = __props;
|
|
24
|
+
const { componentsConfig } = require_createPrismic.usePrismic();
|
|
25
|
+
const resolvedComponents = (0, vue.computed)(() => {
|
|
26
|
+
return {
|
|
27
|
+
...componentsConfig?.defaultComponents,
|
|
28
|
+
...props.components
|
|
29
|
+
};
|
|
30
|
+
});
|
|
23
31
|
const children = (0, vue.computed)(() => {
|
|
24
32
|
return (0, __prismicio_client_richtext.asTree)(props.field || []).children;
|
|
25
33
|
});
|
|
26
34
|
function getInternalComponent(type) {
|
|
27
|
-
const maybeComponentOrShorthand =
|
|
35
|
+
const maybeComponentOrShorthand = resolvedComponents.value?.[type];
|
|
28
36
|
if (require_types.isVueComponent(maybeComponentOrShorthand)) return { is: maybeComponentOrShorthand };
|
|
29
37
|
return {
|
|
30
38
|
is: require_PrismicRichTextDefaultComponent.default,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
shorthand: maybeComponentOrShorthand
|
|
34
|
-
}
|
|
39
|
+
linkResolver: props.linkResolver,
|
|
40
|
+
shorthand: maybeComponentOrShorthand
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
const internalComponents = (0, vue.computed)(() => {
|
package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map
CHANGED
|
@@ -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 {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport {
|
|
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 {\n\tLinkResolverFunction,\n\tRichTextField,\n\tRichTextNodeType,\n} from \"@prismicio/client\"\nimport { asTree } from \"@prismicio/client/richtext\"\nimport type { PropType } from \"vue\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName, VueComponentShorthand } from \"../types\"\nimport { isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponents,\n\tVueRichTextComponent,\n\tVueRichTextComponents,\n} from \"./types\"\n\nimport { usePrismic } from \"../createPrismic\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\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\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An object that maps a rich text block type to a Vue component or a\n\t * shorthand definition.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * heading1: Heading1,\n\t * paragraph: { class: 'prose'},\n\t * strong: { as: 'em', class: 'font-bold' },\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueRichTextComponents\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` will be rendered.\n\t */\n\tfallback?: 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<\n\t\t\tPrismicRichTextProps[\"fallback\"]\n\t\t>,\n\t},\n})\ndefineOptions({ name: \"PrismicRichText\" })\n\nconst { componentsConfig } = usePrismic()\n\nconst resolvedComponents = computed<VueRichTextComponents>(() => {\n\treturn { ...componentsConfig?.defaultComponents, ...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| VueRichTextComponent\n\t\t| VueComponentShorthand\n\t\t| undefined\n\n\tif (isVueComponent(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<InternalVueRichTextComponents>(() => {\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":";;;;;;;;;;;;;;;;;;;;;;EAgEA,MAAM,QAAQ;EAkBd,MAAM,EAAE,qBAAqB,kCAAW;EAExC,MAAM,6CAA2D;AAChE,UAAO;IAAE,GAAG,kBAAkB;IAAmB,GAAG,MAAM;IAAW;IACrE;EAED,MAAM,mCAA0B;AAC/B,kDAAc,MAAM,SAAS,EAAE,CAAC,CAAC;IACjC;EAED,SAAS,qBAAqB,MAAqC;GAClE,MAAM,4BAA4B,mBAAmB,QAAQ;AAK7D,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,cAAc,MAAM;IACpB,WAAW;IACZ;;EAGD,MAAM,6CAAmE;AACxE,UAAO;IACN,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,UAAU,qBAAqB,WAAW;IAC1C,WAAW,qBAAqB,YAAY;IAC5C,cAAc,qBAAqB,eAAe;IAClD,QAAQ,qBAAqB,SAAS;IACtC,IAAI,qBAAqB,KAAK;IAC9B,aAAa,qBAAqB,WAAW;IAC7C,eAAe,qBAAqB,YAAY;IAChD,mBAAmB,qBAAqB,OAAO;IAC/C,qBAAqB,qBAAqB,QAAQ;IAClD,OAAO,qBAAqB,QAAQ;IACpC,OAAO,qBAAqB,QAAQ;IACpC,WAAW,qBAAqB,YAAY;IAC5C,OAAO,qBAAqB,QAAQ;IACpC,MAAM,qBAAqB,OAAO;IACnC;IACA;;UAKO,SAAA,MAAS,qDAGd,0CAAA;;IAFA,UAAU,SAAA;IACV,uBAAqB,mBAAA;uDAED,QAAA,wFAAe,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
|