@prismicio/vue 5.3.0-pr.86.81afa1a → 5.3.0-pr.88.72388e2
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 +30 -58
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts +60 -52
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +18 -41
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.cts +3 -3
- package/dist/PrismicRichText/types.d.cts.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/types.d.cts +1 -2
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.cts +3 -5
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +5 -16
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -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 +30 -58
- 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 +60 -52
- package/dist/src/PrismicLink.vue.d.ts.map +1 -1
- 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.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 +22 -45
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +39 -22
- 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 +39 -22
- 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 +6 -26
- 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 +6 -26
- 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 +7 -48
- 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 +7 -48
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/types.d.ts +3 -3
- 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 +6 -6
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +43 -15
- 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 +44 -16
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- 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 +13 -10
- 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 +14 -11
- package/dist/src/PrismicTable/PrismicTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/types.d.ts +1 -2
- 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 +3 -5
- 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 +5 -16
- 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/types.cjs +9 -0
- package/dist/src/types.cjs.map +1 -0
- package/dist/src/types.d.ts +3 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +8 -0
- package/dist/src/types.js.map +1 -0
- package/dist/types.d.cts +3 -2
- package/dist/types.d.cts.map +1 -1
- package/package.json +1 -1
- package/src/PrismicImage.vue +8 -16
- package/src/PrismicLink.vue +12 -12
- package/src/PrismicRichText/PrismicRichText.vue +69 -49
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +38 -22
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +5 -51
- package/src/PrismicRichText/types.ts +17 -13
- package/src/PrismicTable/PrismicTable.vue +44 -17
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +14 -8
- package/src/PrismicTable/PrismicTableRow.vue +17 -24
- package/src/PrismicTable/types.ts +14 -11
- package/src/PrismicText.vue +1 -3
- package/src/SliceZone/SliceZone.vue +3 -14
- package/src/types.ts +31 -1
- package/src/lib/Wrapper.vue +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "./types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as vue9 from "vue";
|
|
3
3
|
import { AsLinkAttrsConfig, LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client";
|
|
4
4
|
|
|
5
5
|
//#region src/PrismicLink.vue.d.ts
|
|
@@ -9,12 +9,13 @@ import { AsLinkAttrsConfig, LinkField, LinkResolverFunction, PrismicDocument } f
|
|
|
9
9
|
*/
|
|
10
10
|
type PrismicLinkProps = {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* resolver parameter with `@prismicio/client`.
|
|
12
|
+
* The link resolver used to resolve links.
|
|
14
13
|
*
|
|
15
|
-
* @
|
|
14
|
+
* @remarks
|
|
15
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
16
|
+
* repository's content, a link resolver does not need to be provided.
|
|
16
17
|
*
|
|
17
|
-
* @see
|
|
18
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
18
19
|
*/
|
|
19
20
|
linkResolver?: LinkResolverFunction;
|
|
20
21
|
/**
|
|
@@ -24,27 +25,26 @@ type PrismicLinkProps = {
|
|
|
24
25
|
*/
|
|
25
26
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
26
27
|
/**
|
|
27
|
-
* The
|
|
28
|
+
* The component rendered for internal URLs.
|
|
29
|
+
*
|
|
30
|
+
* If your app uses a client-side router that requires a special Link
|
|
31
|
+
* component, provide the Link component to this prop.
|
|
28
32
|
*
|
|
29
33
|
* @defaultValue `<RouterLink>`
|
|
30
34
|
*/
|
|
31
35
|
internalComponent?: ComponentOrTagName;
|
|
32
36
|
/**
|
|
33
|
-
* The
|
|
37
|
+
* The component rendered for external URLs.
|
|
34
38
|
*
|
|
35
39
|
* @defaultValue `<a>`
|
|
36
40
|
*/
|
|
37
41
|
externalComponent?: ComponentOrTagName;
|
|
38
42
|
} & ({
|
|
39
|
-
/**
|
|
40
|
-
* The Prismic link field to render.
|
|
41
|
-
*/
|
|
43
|
+
/** The Prismic link field to render. */
|
|
42
44
|
field: LinkField;
|
|
43
45
|
document?: never;
|
|
44
46
|
} | {
|
|
45
|
-
/**
|
|
46
|
-
* The Prismic document to render as a link.
|
|
47
|
-
*/
|
|
47
|
+
/** The Prismic document to render as a link. */
|
|
48
48
|
document: PrismicDocument;
|
|
49
49
|
field?: never;
|
|
50
50
|
});
|
|
@@ -52,14 +52,15 @@ declare var __VLS_8: {};
|
|
|
52
52
|
type __VLS_Slots = {} & {
|
|
53
53
|
default?: (props: typeof __VLS_8) => any;
|
|
54
54
|
};
|
|
55
|
-
declare const __VLS_base:
|
|
55
|
+
declare const __VLS_base: vue9.DefineComponent<({
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
58
|
-
* resolver parameter with `@prismicio/client`.
|
|
57
|
+
* The link resolver used to resolve links.
|
|
59
58
|
*
|
|
60
|
-
* @
|
|
59
|
+
* @remarks
|
|
60
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
61
|
+
* repository's content, a link resolver does not need to be provided.
|
|
61
62
|
*
|
|
62
|
-
* @see
|
|
63
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
63
64
|
*/
|
|
64
65
|
linkResolver?: LinkResolverFunction;
|
|
65
66
|
/**
|
|
@@ -69,31 +70,33 @@ declare const __VLS_base: vue4.DefineComponent<({
|
|
|
69
70
|
*/
|
|
70
71
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
71
72
|
/**
|
|
72
|
-
* The
|
|
73
|
+
* The component rendered for internal URLs.
|
|
74
|
+
*
|
|
75
|
+
* If your app uses a client-side router that requires a special Link
|
|
76
|
+
* component, provide the Link component to this prop.
|
|
73
77
|
*
|
|
74
78
|
* @defaultValue `<RouterLink>`
|
|
75
79
|
*/
|
|
76
80
|
internalComponent?: ComponentOrTagName;
|
|
77
81
|
/**
|
|
78
|
-
* The
|
|
82
|
+
* The component rendered for external URLs.
|
|
79
83
|
*
|
|
80
84
|
* @defaultValue `<a>`
|
|
81
85
|
*/
|
|
82
86
|
externalComponent?: ComponentOrTagName;
|
|
83
87
|
} & {
|
|
84
|
-
/**
|
|
85
|
-
* The Prismic link field to render.
|
|
86
|
-
*/
|
|
88
|
+
/** The Prismic link field to render. */
|
|
87
89
|
field: LinkField;
|
|
88
90
|
document?: never;
|
|
89
91
|
}) | ({
|
|
90
92
|
/**
|
|
91
|
-
*
|
|
92
|
-
* resolver parameter with `@prismicio/client`.
|
|
93
|
+
* The link resolver used to resolve links.
|
|
93
94
|
*
|
|
94
|
-
* @
|
|
95
|
+
* @remarks
|
|
96
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
97
|
+
* repository's content, a link resolver does not need to be provided.
|
|
95
98
|
*
|
|
96
|
-
* @see
|
|
99
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
97
100
|
*/
|
|
98
101
|
linkResolver?: LinkResolverFunction;
|
|
99
102
|
/**
|
|
@@ -103,31 +106,33 @@ declare const __VLS_base: vue4.DefineComponent<({
|
|
|
103
106
|
*/
|
|
104
107
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
105
108
|
/**
|
|
106
|
-
* The
|
|
109
|
+
* The component rendered for internal URLs.
|
|
110
|
+
*
|
|
111
|
+
* If your app uses a client-side router that requires a special Link
|
|
112
|
+
* component, provide the Link component to this prop.
|
|
107
113
|
*
|
|
108
114
|
* @defaultValue `<RouterLink>`
|
|
109
115
|
*/
|
|
110
116
|
internalComponent?: ComponentOrTagName;
|
|
111
117
|
/**
|
|
112
|
-
* The
|
|
118
|
+
* The component rendered for external URLs.
|
|
113
119
|
*
|
|
114
120
|
* @defaultValue `<a>`
|
|
115
121
|
*/
|
|
116
122
|
externalComponent?: ComponentOrTagName;
|
|
117
123
|
} & {
|
|
118
|
-
/**
|
|
119
|
-
* The Prismic document to render as a link.
|
|
120
|
-
*/
|
|
124
|
+
/** The Prismic document to render as a link. */
|
|
121
125
|
document: PrismicDocument;
|
|
122
126
|
field?: never;
|
|
123
|
-
}), {}, {}, {}, {},
|
|
127
|
+
}), {}, {}, {}, {}, vue9.ComponentOptionsMixin, vue9.ComponentOptionsMixin, {}, string, vue9.PublicProps, Readonly<({
|
|
124
128
|
/**
|
|
125
|
-
*
|
|
126
|
-
* resolver parameter with `@prismicio/client`.
|
|
129
|
+
* The link resolver used to resolve links.
|
|
127
130
|
*
|
|
128
|
-
* @
|
|
131
|
+
* @remarks
|
|
132
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
133
|
+
* repository's content, a link resolver does not need to be provided.
|
|
129
134
|
*
|
|
130
|
-
* @see
|
|
135
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
131
136
|
*/
|
|
132
137
|
linkResolver?: LinkResolverFunction;
|
|
133
138
|
/**
|
|
@@ -137,31 +142,33 @@ declare const __VLS_base: vue4.DefineComponent<({
|
|
|
137
142
|
*/
|
|
138
143
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
139
144
|
/**
|
|
140
|
-
* The
|
|
145
|
+
* The component rendered for internal URLs.
|
|
146
|
+
*
|
|
147
|
+
* If your app uses a client-side router that requires a special Link
|
|
148
|
+
* component, provide the Link component to this prop.
|
|
141
149
|
*
|
|
142
150
|
* @defaultValue `<RouterLink>`
|
|
143
151
|
*/
|
|
144
152
|
internalComponent?: ComponentOrTagName;
|
|
145
153
|
/**
|
|
146
|
-
* The
|
|
154
|
+
* The component rendered for external URLs.
|
|
147
155
|
*
|
|
148
156
|
* @defaultValue `<a>`
|
|
149
157
|
*/
|
|
150
158
|
externalComponent?: ComponentOrTagName;
|
|
151
159
|
} & {
|
|
152
|
-
/**
|
|
153
|
-
* The Prismic link field to render.
|
|
154
|
-
*/
|
|
160
|
+
/** The Prismic link field to render. */
|
|
155
161
|
field: LinkField;
|
|
156
162
|
document?: never;
|
|
157
163
|
}) | ({
|
|
158
164
|
/**
|
|
159
|
-
*
|
|
160
|
-
* resolver parameter with `@prismicio/client`.
|
|
165
|
+
* The link resolver used to resolve links.
|
|
161
166
|
*
|
|
162
|
-
* @
|
|
167
|
+
* @remarks
|
|
168
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
169
|
+
* repository's content, a link resolver does not need to be provided.
|
|
163
170
|
*
|
|
164
|
-
* @see
|
|
171
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
165
172
|
*/
|
|
166
173
|
linkResolver?: LinkResolverFunction;
|
|
167
174
|
/**
|
|
@@ -171,24 +178,25 @@ declare const __VLS_base: vue4.DefineComponent<({
|
|
|
171
178
|
*/
|
|
172
179
|
rel?: string | AsLinkAttrsConfig["rel"];
|
|
173
180
|
/**
|
|
174
|
-
* The
|
|
181
|
+
* The component rendered for internal URLs.
|
|
182
|
+
*
|
|
183
|
+
* If your app uses a client-side router that requires a special Link
|
|
184
|
+
* component, provide the Link component to this prop.
|
|
175
185
|
*
|
|
176
186
|
* @defaultValue `<RouterLink>`
|
|
177
187
|
*/
|
|
178
188
|
internalComponent?: ComponentOrTagName;
|
|
179
189
|
/**
|
|
180
|
-
* The
|
|
190
|
+
* The component rendered for external URLs.
|
|
181
191
|
*
|
|
182
192
|
* @defaultValue `<a>`
|
|
183
193
|
*/
|
|
184
194
|
externalComponent?: ComponentOrTagName;
|
|
185
195
|
} & {
|
|
186
|
-
/**
|
|
187
|
-
* The Prismic document to render as a link.
|
|
188
|
-
*/
|
|
196
|
+
/** The Prismic document to render as a link. */
|
|
189
197
|
document: PrismicDocument;
|
|
190
198
|
field?: never;
|
|
191
|
-
})> & Readonly<{}>, {}, {}, {}, {}, string,
|
|
199
|
+
})> & Readonly<{}>, {}, {}, {}, {}, string, vue9.ComponentProvideOptions, false, {}, any>;
|
|
192
200
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
193
201
|
declare const _default: typeof __VLS_export;
|
|
194
202
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":";;;;;;;;AA8JA;
|
|
1
|
+
{"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":";;;;;;;;AA8JA;AAUgB,KAVJ,gBAAA,GAUI;EAOA;;;;;;AA6Bf;AA0EqB;AAEc;EAhHpB,YAAA,CAAA,EAAA,oBAAA;EAOA;;;;;EAAA,GAAA,CAAA,EAAA,MAAA,GAAA,iBAAA,CAAA,KAAA,CAAA;EAUK;;;;;;;;EAAA,iBAAA,CAAA,EAAA,kBAAA;EAOA;;;;;EAAA,iBAAA,CAAA,EAAA,kBAAA;CASR,GAAA,CAAA;;SALH;;;EAyFM;EAGV,QAAA,EAvFO,eAuF6D;EAAxB,KAAA,CAAA,EAAA,KAAA;CAAY,CAAA;YAV1D,OAUuB,EAAA,CAAA,CAAA;KATtB,WAAA,GASqC,CAAA,CAAA,GAAA;EAAA,OAAA,CAAA,EAAA,CACF,KAAA,EAAA,OATX,OASD,EAAA,GAAY,GAAA;AAAxC,CAAA;cAJM,iBAAU;;;;;;;;;;iBArHA;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;oBAAe,IAAA,CAAA,qBAAA;;;;;;;;;;iBAjCZ;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;;cAuFP,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
|
|
@@ -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/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t *
|
|
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/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\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 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 || defaultInternalComponent\n\t\t: props.externalComponent || 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":";;;;;;;;AAiBA,MAAM,2BAA2B;;;;AAKjC,MAAM,2BAA2B;;;;AAKjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDpC,MAAM,QAAQ;EAGd,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,qBAAqB,2BAC3B,MAAM,qBAAqB;IAC9B;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 +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/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t *
|
|
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/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for external URLs.\n */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\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 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 || defaultInternalComponent\n\t\t: props.externalComponent || 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":";;;;;;;;AAiBA,MAAM,2BAA2B;;;;AAKjC,MAAM,2BAA2B;;;;AAKjC,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDpC,MAAM,QAAQ;EAGd,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,qBAAqB,2BAC3B,MAAM,qBAAqB;IAC9B;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 {\n\
|
|
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, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\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 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?: VueRichTextSerializer\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 children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\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 {\n\
|
|
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, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\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 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?: VueRichTextSerializer\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 children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\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,6 +1,6 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.js";
|
|
2
2
|
import { VueRichTextSerializer } from "./types.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as vue24 from "vue";
|
|
4
4
|
import { PropType } from "vue";
|
|
5
5
|
import { LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
6
6
|
|
|
@@ -9,88 +9,65 @@ import { LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
|
9
9
|
* Props for `<PrismicRichText />`.
|
|
10
10
|
*/
|
|
11
11
|
type PrismicRichTextProps = {
|
|
12
|
+
/** The Prismic rich text field to render. */
|
|
13
|
+
field: RichTextField | null | undefined;
|
|
12
14
|
/**
|
|
13
|
-
* The
|
|
15
|
+
* The link resolver used to resolve links.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* If your app uses route resolvers when querying for your Prismic
|
|
19
|
+
* repository's content, a link resolver does not need to be provided.
|
|
20
|
+
*
|
|
21
|
+
* @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}
|
|
14
22
|
*/
|
|
15
|
-
|
|
23
|
+
linkResolver?: LinkResolverFunction;
|
|
16
24
|
/**
|
|
17
|
-
* An object that maps a rich text block type to a Vue component.
|
|
25
|
+
* An object that maps a rich text block type to a Vue component or a shorthand definition.
|
|
18
26
|
*
|
|
19
27
|
* @example
|
|
20
28
|
*
|
|
21
29
|
* ```javascript
|
|
22
30
|
* {
|
|
23
31
|
* heading1: Heading1,
|
|
32
|
+
* paragraph: { class: 'prose'},
|
|
33
|
+
* strong: { as: 'em', class: 'font-bold' },
|
|
24
34
|
* }
|
|
25
35
|
* ```
|
|
26
36
|
*/
|
|
27
37
|
components?: VueRichTextSerializer;
|
|
28
|
-
/**
|
|
29
|
-
* A link resolver function used to resolve link when not using the route
|
|
30
|
-
* resolver parameter with `@prismicio/client`.
|
|
31
|
-
*
|
|
32
|
-
* @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
|
|
33
|
-
*
|
|
34
|
-
* @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
|
|
35
|
-
*/
|
|
36
|
-
linkResolver?: LinkResolverFunction;
|
|
37
|
-
/**
|
|
38
|
-
* The Vue component rendered for links when the URL is internal.
|
|
39
|
-
*
|
|
40
|
-
* @defaultValue `<RouterLink>`
|
|
41
|
-
*/
|
|
42
|
-
internalLinkComponent?: ComponentOrTagName;
|
|
43
|
-
/**
|
|
44
|
-
* The Vue component rendered for links when the URL is external.
|
|
45
|
-
*
|
|
46
|
-
* @defaultValue `<a>`
|
|
47
|
-
*/
|
|
48
|
-
externalLinkComponent?: ComponentOrTagName;
|
|
49
38
|
/**
|
|
50
39
|
* The value to be rendered when the field is empty. If a fallback is not
|
|
51
|
-
* given, `null`
|
|
40
|
+
* given, `null` will be rendered.
|
|
52
41
|
*/
|
|
53
42
|
fallback?: ComponentOrTagName;
|
|
54
43
|
};
|
|
55
|
-
declare const __VLS_export:
|
|
44
|
+
declare const __VLS_export: vue24.DefineComponent<vue24.ExtractPropTypes<{
|
|
56
45
|
field: {
|
|
57
46
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
58
47
|
};
|
|
59
|
-
components: {
|
|
60
|
-
type: PropType<PrismicRichTextProps["components"]>;
|
|
61
|
-
};
|
|
62
48
|
linkResolver: {
|
|
63
49
|
type: PropType<PrismicRichTextProps["linkResolver"]>;
|
|
64
50
|
};
|
|
65
|
-
|
|
66
|
-
type: PropType<PrismicRichTextProps["
|
|
67
|
-
};
|
|
68
|
-
externalLinkComponent: {
|
|
69
|
-
type: PropType<PrismicRichTextProps["externalLinkComponent"]>;
|
|
51
|
+
components: {
|
|
52
|
+
type: PropType<PrismicRichTextProps["components"]>;
|
|
70
53
|
};
|
|
71
54
|
fallback: {
|
|
72
55
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
73
56
|
};
|
|
74
|
-
}>, {}, {}, {}, {},
|
|
57
|
+
}>, {}, {}, {}, {}, vue24.ComponentOptionsMixin, vue24.ComponentOptionsMixin, {}, string, vue24.PublicProps, Readonly<vue24.ExtractPropTypes<{
|
|
75
58
|
field: {
|
|
76
59
|
type: PropType<PrismicRichTextProps["field"]>;
|
|
77
60
|
};
|
|
78
|
-
components: {
|
|
79
|
-
type: PropType<PrismicRichTextProps["components"]>;
|
|
80
|
-
};
|
|
81
61
|
linkResolver: {
|
|
82
62
|
type: PropType<PrismicRichTextProps["linkResolver"]>;
|
|
83
63
|
};
|
|
84
|
-
|
|
85
|
-
type: PropType<PrismicRichTextProps["
|
|
86
|
-
};
|
|
87
|
-
externalLinkComponent: {
|
|
88
|
-
type: PropType<PrismicRichTextProps["externalLinkComponent"]>;
|
|
64
|
+
components: {
|
|
65
|
+
type: PropType<PrismicRichTextProps["components"]>;
|
|
89
66
|
};
|
|
90
67
|
fallback: {
|
|
91
68
|
type: PropType<PrismicRichTextProps["fallback"]>;
|
|
92
69
|
};
|
|
93
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string,
|
|
70
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue24.ComponentProvideOptions, true, {}, any>;
|
|
94
71
|
declare const _default: typeof __VLS_export;
|
|
95
72
|
//#endregion
|
|
96
73
|
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":";;;;;;;;;;AA6JY,KAAA,oBAAA,GAAoB;EAExB;EAWQ,KAAA,EAXR,aAWQ,GAAA,IAAA,GAAA,SAAA;EAeF;;;AAOb;;;;;;EAwHiB,YAAA,CAAA,EA9IF,oBA8IE;EAIf;;;;;;;;;;;;;EADmC,UAAA,CAAA,EAlIxB,qBAkIwB;EAAQ;;;;UAZ5B,CAAA,EAhHN,kBAgHM;CAAA;AAAA,cAAZ,YAkBkC,QAlBtB,eAkBsB,CANM,KAAA,CAZ5B,gBAkBsB,CAAA;;UAfZ,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;oBAbe,KAAA,CAAA,qBAAA,uEAY4B,KAAA,CAAA;;UATlB,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;;cAbe,iBAkBU"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const require_types = require('../types.cjs');
|
|
2
|
+
const require_PrismicRichTextDefaultComponent = require('./PrismicRichTextDefaultComponent.cjs');
|
|
1
3
|
const require_PrismicRichTextSerialize = require('./PrismicRichTextSerialize.cjs');
|
|
2
4
|
let vue = require("vue");
|
|
3
5
|
let __prismicio_client_richtext = require("@prismicio/client/richtext");
|
|
@@ -8,18 +10,8 @@ var PrismicRichText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
8
10
|
__name: "PrismicRichText",
|
|
9
11
|
props: {
|
|
10
12
|
field: { type: Array },
|
|
11
|
-
components: { type: Object },
|
|
12
13
|
linkResolver: { type: Function },
|
|
13
|
-
|
|
14
|
-
String,
|
|
15
|
-
Object,
|
|
16
|
-
Function
|
|
17
|
-
] },
|
|
18
|
-
externalLinkComponent: { type: [
|
|
19
|
-
String,
|
|
20
|
-
Object,
|
|
21
|
-
Function
|
|
22
|
-
] },
|
|
14
|
+
components: { type: Object },
|
|
23
15
|
fallback: { type: [
|
|
24
16
|
String,
|
|
25
17
|
Object,
|
|
@@ -31,21 +23,46 @@ var PrismicRichText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
31
23
|
const children = (0, vue.computed)(() => {
|
|
32
24
|
return (0, __prismicio_client_richtext.asTree)(props.field || []).children;
|
|
33
25
|
});
|
|
26
|
+
function getInternalComponent(type) {
|
|
27
|
+
const maybeComponentOrShorthand = props.components?.[type];
|
|
28
|
+
if (require_types.isVueComponent(maybeComponentOrShorthand)) return { is: maybeComponentOrShorthand };
|
|
29
|
+
return {
|
|
30
|
+
is: require_PrismicRichTextDefaultComponent.default,
|
|
31
|
+
props: {
|
|
32
|
+
linkResolver: props.linkResolver,
|
|
33
|
+
shorthand: maybeComponentOrShorthand
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const internalComponents = (0, vue.computed)(() => {
|
|
38
|
+
return {
|
|
39
|
+
heading1: getInternalComponent("heading1"),
|
|
40
|
+
heading2: getInternalComponent("heading2"),
|
|
41
|
+
heading3: getInternalComponent("heading3"),
|
|
42
|
+
heading4: getInternalComponent("heading4"),
|
|
43
|
+
heading5: getInternalComponent("heading5"),
|
|
44
|
+
heading6: getInternalComponent("heading6"),
|
|
45
|
+
paragraph: getInternalComponent("paragraph"),
|
|
46
|
+
preformatted: getInternalComponent("preformatted"),
|
|
47
|
+
strong: getInternalComponent("strong"),
|
|
48
|
+
em: getInternalComponent("em"),
|
|
49
|
+
"list-item": getInternalComponent("listItem"),
|
|
50
|
+
"o-list-item": getInternalComponent("oListItem"),
|
|
51
|
+
"group-list-item": getInternalComponent("list"),
|
|
52
|
+
"group-o-list-item": getInternalComponent("oList"),
|
|
53
|
+
image: getInternalComponent("image"),
|
|
54
|
+
embed: getInternalComponent("embed"),
|
|
55
|
+
hyperlink: getInternalComponent("hyperlink"),
|
|
56
|
+
label: getInternalComponent("label"),
|
|
57
|
+
span: getInternalComponent("span")
|
|
58
|
+
};
|
|
59
|
+
});
|
|
34
60
|
return (_ctx, _cache) => {
|
|
35
61
|
return children.value.length ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_PrismicRichTextSerialize.default, {
|
|
36
62
|
key: 0,
|
|
37
63
|
children: children.value,
|
|
38
|
-
components:
|
|
39
|
-
|
|
40
|
-
"internal-link-component": __props.internalLinkComponent,
|
|
41
|
-
"external-link-component": __props.externalLinkComponent
|
|
42
|
-
}, null, 8, [
|
|
43
|
-
"children",
|
|
44
|
-
"components",
|
|
45
|
-
"link-resolver",
|
|
46
|
-
"internal-link-component",
|
|
47
|
-
"external-link-component"
|
|
48
|
-
])) : __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 })) : (0, vue.createCommentVNode)("v-if", true);
|
|
64
|
+
"internal-components": internalComponents.value
|
|
65
|
+
}, null, 8, ["children", "internal-components"])) : __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 })) : (0, vue.createCommentVNode)("v-if", true);
|
|
49
66
|
};
|
|
50
67
|
}
|
|
51
68
|
});
|
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 {\n\
|
|
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, isVueComponent } from \"../types\"\nimport type {\n\tInternalVueRichTextComponent,\n\tVueRichTextSerializer,\n\tVueShorthand,\n} from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\nimport PrismicRichTextSerialize from \"./PrismicRichTextSerialize.vue\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\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 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?: VueRichTextSerializer\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 children = computed(() => {\n\treturn asTree(props.field || []).children\n})\n\nfunction getInternalComponent(type: keyof typeof RichTextNodeType) {\n\tconst maybeComponentOrShorthand = props.components?.[type]\n\n\tif (isVueComponent(maybeComponentOrShorthand)) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tshorthand: maybeComponentOrShorthand as VueShorthand,\n\t\t},\n\t}\n}\n\nconst internalComponents = computed<InternalVueRichTextComponent>(() => {\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":";;;;;;;;;;;;;;;;;;;;;EA8DA,MAAM,QAAQ;EAkBd,MAAM,mCAA0B;AAC/B,kDAAc,MAAM,SAAS,EAAE,CAAC,CAAC;IACjC;EAED,SAAS,qBAAqB,MAAqC;GAClE,MAAM,4BAA4B,MAAM,aAAa;AAErD,OAAI,6BAAe,0BAA0B,CAC5C,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,WAAW;KACX;IACF;;EAGD,MAAM,6CAAkE;AACvE,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"}
|