@prismicio/vue 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/PrismicEmbed.d.ts +63 -57
- package/dist/components/PrismicImage.d.ts +161 -161
- package/dist/components/PrismicLink.d.ts +190 -190
- package/dist/components/PrismicRichText.d.ts +159 -159
- package/dist/components/PrismicText.d.ts +117 -117
- package/dist/components/SliceZone.cjs +28 -14
- package/dist/components/SliceZone.cjs.map +1 -1
- package/dist/components/SliceZone.d.ts +371 -366
- package/dist/components/SliceZone.js +28 -14
- package/dist/components/SliceZone.js.map +1 -1
- package/dist/components/index.d.ts +12 -12
- package/dist/composables.d.ts +384 -384
- package/dist/createPrismic.d.ts +12 -12
- package/dist/globalExtensions.d.ts +11 -11
- package/dist/index.d.ts +10 -10
- package/dist/injectionSymbols.d.ts +9 -9
- package/dist/lib/__PRODUCTION__.d.ts +7 -7
- package/dist/lib/getSlots.d.ts +14 -14
- package/dist/lib/isInternalURL.d.ts +8 -8
- package/dist/lib/simplyResolveComponent.d.ts +12 -12
- package/dist/types.d.ts +384 -384
- package/dist/usePrismic.d.ts +22 -22
- package/dist/useStatefulPrismicClientMethod.d.ts +64 -64
- package/package.json +17 -17
- package/src/components/SliceZone.ts +76 -34
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
import { HTMLFunctionSerializer, HTMLMapSerializer, LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
2
|
-
import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
|
|
3
|
-
import { VueUseOptions } from "../types";
|
|
4
|
-
/**
|
|
5
|
-
* Props for `<PrismicRichText />`.
|
|
6
|
-
*/
|
|
7
|
-
export type PrismicRichTextProps = {
|
|
8
|
-
/**
|
|
9
|
-
* The Prismic rich text or title field to render.
|
|
10
|
-
*/
|
|
11
|
-
field: RichTextField | null | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* A link resolver function used to resolve link when not using the route
|
|
14
|
-
* resolver parameter with `@prismicio/client`.
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
|
|
17
|
-
*
|
|
18
|
-
* @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
|
|
19
|
-
*/
|
|
20
|
-
linkResolver?: LinkResolverFunction;
|
|
21
|
-
/**
|
|
22
|
-
* An HTML serializer to customize the way rich text fields are rendered.
|
|
23
|
-
*
|
|
24
|
-
* @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
|
|
25
|
-
*
|
|
26
|
-
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
27
|
-
*/
|
|
28
|
-
serializer?: HTMLFunctionSerializer | HTMLMapSerializer;
|
|
29
|
-
/**
|
|
30
|
-
* An HTML serializer to customize the way rich text fields are rendered.
|
|
31
|
-
*
|
|
32
|
-
* @deprecated Use `serializer` instead.
|
|
33
|
-
*
|
|
34
|
-
* @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
|
|
35
|
-
*
|
|
36
|
-
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
37
|
-
*/
|
|
38
|
-
htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
|
|
39
|
-
/**
|
|
40
|
-
* An HTML tag name, a component, or a functional component used to wrap the
|
|
41
|
-
* output.
|
|
42
|
-
*
|
|
43
|
-
* @defaultValue `"div"`
|
|
44
|
-
*/
|
|
45
|
-
wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
46
|
-
/**
|
|
47
|
-
* The HTML value to be rendered when the field is empty. If a fallback is not
|
|
48
|
-
* given, `""` (nothing) will be rendered.
|
|
49
|
-
*/
|
|
50
|
-
fallback?: string;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Options for {@link usePrismicRichText}.
|
|
54
|
-
*/
|
|
55
|
-
export type UsePrismicRichTextOptions = VueUseOptions<Omit<PrismicRichTextProps, "wrapper">>;
|
|
56
|
-
/**
|
|
57
|
-
* Return type of {@link usePrismicRichText}.
|
|
58
|
-
*/
|
|
59
|
-
export type UsePrismicRichTextReturnType = {
|
|
60
|
-
/**
|
|
61
|
-
* Serialized rich text field as HTML.
|
|
62
|
-
*/
|
|
63
|
-
html: ComputedRef<string>;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* A low level composable that returns a serialized rich text field as HTML.
|
|
67
|
-
*
|
|
68
|
-
* @param props - {@link UsePrismicRichTextOptions}
|
|
69
|
-
*
|
|
70
|
-
* @returns - Serialized rich text field as HTML
|
|
71
|
-
* {@link UsePrismicRichTextReturnType}
|
|
72
|
-
*/
|
|
73
|
-
export declare const usePrismicRichText: (props: UsePrismicRichTextOptions) => UsePrismicRichTextReturnType;
|
|
74
|
-
/**
|
|
75
|
-
* `<PrismicRichText />` implementation.
|
|
76
|
-
*
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export declare const PrismicRichTextImpl: DefineComponent<{
|
|
80
|
-
field: {
|
|
81
|
-
type: PropType<
|
|
82
|
-
default: undefined;
|
|
83
|
-
required: false;
|
|
84
|
-
};
|
|
85
|
-
linkResolver: {
|
|
86
|
-
type: PropType<LinkResolverFunction
|
|
87
|
-
default: undefined;
|
|
88
|
-
required: false;
|
|
89
|
-
};
|
|
90
|
-
serializer: {
|
|
91
|
-
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
92
|
-
default: undefined;
|
|
93
|
-
required: false;
|
|
94
|
-
};
|
|
95
|
-
htmlSerializer: {
|
|
96
|
-
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
97
|
-
default: undefined;
|
|
98
|
-
required: false;
|
|
99
|
-
};
|
|
100
|
-
wrapper: {
|
|
101
|
-
type: PropType<string | ConcreteComponent | Raw<DefineComponent
|
|
102
|
-
default: undefined;
|
|
103
|
-
required: false;
|
|
104
|
-
};
|
|
105
|
-
fallback: {
|
|
106
|
-
type: PropType<string>;
|
|
107
|
-
default: undefined;
|
|
108
|
-
required: false;
|
|
109
|
-
};
|
|
110
|
-
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
111
|
-
[key: string]: any;
|
|
112
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string,
|
|
113
|
-
field: {
|
|
114
|
-
type: PropType<
|
|
115
|
-
default: undefined;
|
|
116
|
-
required: false;
|
|
117
|
-
};
|
|
118
|
-
linkResolver: {
|
|
119
|
-
type: PropType<LinkResolverFunction
|
|
120
|
-
default: undefined;
|
|
121
|
-
required: false;
|
|
122
|
-
};
|
|
123
|
-
serializer: {
|
|
124
|
-
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
125
|
-
default: undefined;
|
|
126
|
-
required: false;
|
|
127
|
-
};
|
|
128
|
-
htmlSerializer: {
|
|
129
|
-
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
130
|
-
default: undefined;
|
|
131
|
-
required: false;
|
|
132
|
-
};
|
|
133
|
-
wrapper: {
|
|
134
|
-
type: PropType<string | ConcreteComponent | Raw<DefineComponent
|
|
135
|
-
default: undefined;
|
|
136
|
-
required: false;
|
|
137
|
-
};
|
|
138
|
-
fallback: {
|
|
139
|
-
type: PropType<string>;
|
|
140
|
-
default: undefined;
|
|
141
|
-
required: false;
|
|
142
|
-
};
|
|
143
|
-
}>>, {
|
|
144
|
-
wrapper: string | ConcreteComponent | Raw<DefineComponent
|
|
145
|
-
field:
|
|
146
|
-
linkResolver: LinkResolverFunction
|
|
147
|
-
fallback: string;
|
|
148
|
-
serializer: import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer;
|
|
149
|
-
htmlSerializer: import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer;
|
|
150
|
-
}, {}>;
|
|
151
|
-
/**
|
|
152
|
-
* Component to render a Prismic rich text field as HTML.
|
|
153
|
-
*
|
|
154
|
-
* @see Component props {@link PrismicRichTextProps}
|
|
155
|
-
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
156
|
-
*/
|
|
157
|
-
export declare const PrismicRichText: new () => {
|
|
158
|
-
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicRichTextProps;
|
|
159
|
-
};
|
|
1
|
+
import { HTMLFunctionSerializer, HTMLMapSerializer, LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
2
|
+
import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
|
|
3
|
+
import { VueUseOptions } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Props for `<PrismicRichText />`.
|
|
6
|
+
*/
|
|
7
|
+
export declare type PrismicRichTextProps = {
|
|
8
|
+
/**
|
|
9
|
+
* The Prismic rich text or title field to render.
|
|
10
|
+
*/
|
|
11
|
+
field: RichTextField | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* A link resolver function used to resolve link when not using the route
|
|
14
|
+
* resolver parameter with `@prismicio/client`.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
|
|
17
|
+
*
|
|
18
|
+
* @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
|
|
19
|
+
*/
|
|
20
|
+
linkResolver?: LinkResolverFunction;
|
|
21
|
+
/**
|
|
22
|
+
* An HTML serializer to customize the way rich text fields are rendered.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
|
|
25
|
+
*
|
|
26
|
+
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
27
|
+
*/
|
|
28
|
+
serializer?: HTMLFunctionSerializer | HTMLMapSerializer;
|
|
29
|
+
/**
|
|
30
|
+
* An HTML serializer to customize the way rich text fields are rendered.
|
|
31
|
+
*
|
|
32
|
+
* @deprecated Use `serializer` instead.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
|
|
35
|
+
*
|
|
36
|
+
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
37
|
+
*/
|
|
38
|
+
htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
|
|
39
|
+
/**
|
|
40
|
+
* An HTML tag name, a component, or a functional component used to wrap the
|
|
41
|
+
* output.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue `"div"`
|
|
44
|
+
*/
|
|
45
|
+
wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
46
|
+
/**
|
|
47
|
+
* The HTML value to be rendered when the field is empty. If a fallback is not
|
|
48
|
+
* given, `""` (nothing) will be rendered.
|
|
49
|
+
*/
|
|
50
|
+
fallback?: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Options for {@link usePrismicRichText}.
|
|
54
|
+
*/
|
|
55
|
+
export declare type UsePrismicRichTextOptions = VueUseOptions<Omit<PrismicRichTextProps, "wrapper">>;
|
|
56
|
+
/**
|
|
57
|
+
* Return type of {@link usePrismicRichText}.
|
|
58
|
+
*/
|
|
59
|
+
export declare type UsePrismicRichTextReturnType = {
|
|
60
|
+
/**
|
|
61
|
+
* Serialized rich text field as HTML.
|
|
62
|
+
*/
|
|
63
|
+
html: ComputedRef<string>;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A low level composable that returns a serialized rich text field as HTML.
|
|
67
|
+
*
|
|
68
|
+
* @param props - {@link UsePrismicRichTextOptions}
|
|
69
|
+
*
|
|
70
|
+
* @returns - Serialized rich text field as HTML
|
|
71
|
+
* {@link UsePrismicRichTextReturnType}
|
|
72
|
+
*/
|
|
73
|
+
export declare const usePrismicRichText: (props: UsePrismicRichTextOptions) => UsePrismicRichTextReturnType;
|
|
74
|
+
/**
|
|
75
|
+
* `<PrismicRichText />` implementation.
|
|
76
|
+
*
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export declare const PrismicRichTextImpl: DefineComponent<{
|
|
80
|
+
field: {
|
|
81
|
+
type: PropType<[] | [import("@prismicio/client").RTNode, ...import("@prismicio/client").RTNode[]] | null | undefined>;
|
|
82
|
+
default: undefined;
|
|
83
|
+
required: false;
|
|
84
|
+
};
|
|
85
|
+
linkResolver: {
|
|
86
|
+
type: PropType<LinkResolverFunction<string | null | undefined>>;
|
|
87
|
+
default: undefined;
|
|
88
|
+
required: false;
|
|
89
|
+
};
|
|
90
|
+
serializer: {
|
|
91
|
+
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
92
|
+
default: undefined;
|
|
93
|
+
required: false;
|
|
94
|
+
};
|
|
95
|
+
htmlSerializer: {
|
|
96
|
+
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
97
|
+
default: undefined;
|
|
98
|
+
required: false;
|
|
99
|
+
};
|
|
100
|
+
wrapper: {
|
|
101
|
+
type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
|
|
102
|
+
default: undefined;
|
|
103
|
+
required: false;
|
|
104
|
+
};
|
|
105
|
+
fallback: {
|
|
106
|
+
type: PropType<string>;
|
|
107
|
+
default: undefined;
|
|
108
|
+
required: false;
|
|
109
|
+
};
|
|
110
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
111
|
+
[key: string]: any;
|
|
112
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
113
|
+
field: {
|
|
114
|
+
type: PropType<[] | [import("@prismicio/client").RTNode, ...import("@prismicio/client").RTNode[]] | null | undefined>;
|
|
115
|
+
default: undefined;
|
|
116
|
+
required: false;
|
|
117
|
+
};
|
|
118
|
+
linkResolver: {
|
|
119
|
+
type: PropType<LinkResolverFunction<string | null | undefined>>;
|
|
120
|
+
default: undefined;
|
|
121
|
+
required: false;
|
|
122
|
+
};
|
|
123
|
+
serializer: {
|
|
124
|
+
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
125
|
+
default: undefined;
|
|
126
|
+
required: false;
|
|
127
|
+
};
|
|
128
|
+
htmlSerializer: {
|
|
129
|
+
type: PropType<import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer>;
|
|
130
|
+
default: undefined;
|
|
131
|
+
required: false;
|
|
132
|
+
};
|
|
133
|
+
wrapper: {
|
|
134
|
+
type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
|
|
135
|
+
default: undefined;
|
|
136
|
+
required: false;
|
|
137
|
+
};
|
|
138
|
+
fallback: {
|
|
139
|
+
type: PropType<string>;
|
|
140
|
+
default: undefined;
|
|
141
|
+
required: false;
|
|
142
|
+
};
|
|
143
|
+
}>>, {
|
|
144
|
+
wrapper: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
|
|
145
|
+
field: [] | [import("@prismicio/client").RTNode, ...import("@prismicio/client").RTNode[]] | null | undefined;
|
|
146
|
+
linkResolver: LinkResolverFunction<string | null | undefined>;
|
|
147
|
+
fallback: string;
|
|
148
|
+
serializer: import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer;
|
|
149
|
+
htmlSerializer: import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer;
|
|
150
|
+
}, {}>;
|
|
151
|
+
/**
|
|
152
|
+
* Component to render a Prismic rich text field as HTML.
|
|
153
|
+
*
|
|
154
|
+
* @see Component props {@link PrismicRichTextProps}
|
|
155
|
+
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
156
|
+
*/
|
|
157
|
+
export declare const PrismicRichText: new () => {
|
|
158
|
+
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicRichTextProps;
|
|
159
|
+
};
|
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
import { RichTextField } from "@prismicio/client";
|
|
2
|
-
import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNode, VNodeProps } from "vue";
|
|
3
|
-
import { VueUseOptions } from "../types";
|
|
4
|
-
/**
|
|
5
|
-
* Props for `<PrismicText />`.
|
|
6
|
-
*/
|
|
7
|
-
export type PrismicTextProps = {
|
|
8
|
-
/**
|
|
9
|
-
* The Prismic rich text or title field to render.
|
|
10
|
-
*/
|
|
11
|
-
field: RichTextField | null | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Separator used to join each element.
|
|
14
|
-
*
|
|
15
|
-
* @defaultValue `" "` (a space)
|
|
16
|
-
*/
|
|
17
|
-
separator?: string;
|
|
18
|
-
/**
|
|
19
|
-
* An HTML tag name, a component, or a functional component used to wrap the
|
|
20
|
-
* output.
|
|
21
|
-
*
|
|
22
|
-
* @defaultValue `"div"`
|
|
23
|
-
*/
|
|
24
|
-
wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
25
|
-
/**
|
|
26
|
-
* The string value to be rendered when the field is empty. If a fallback is
|
|
27
|
-
* not given, `""` (nothing) will be rendered.
|
|
28
|
-
*/
|
|
29
|
-
fallback?: string;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Options for {@link usePrismicText}.
|
|
33
|
-
*/
|
|
34
|
-
export type UsePrismicTextOptions = VueUseOptions<Omit<PrismicTextProps, "wrapper">>;
|
|
35
|
-
/**
|
|
36
|
-
* Return type of {@link usePrismicText}.
|
|
37
|
-
*/
|
|
38
|
-
export type UsePrismicTextReturnType = {
|
|
39
|
-
/**
|
|
40
|
-
* Serialized rich text field as plain text.
|
|
41
|
-
*/
|
|
42
|
-
text: ComputedRef<string>;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* A low level composable that returns a serialized rich text field as plain
|
|
46
|
-
* text.
|
|
47
|
-
*
|
|
48
|
-
* @param props - {@link UsePrismicTextOptions}
|
|
49
|
-
*
|
|
50
|
-
* @returns - Serialized rich text field as plain text
|
|
51
|
-
* {@link UsePrismicTextReturnType}
|
|
52
|
-
*/
|
|
53
|
-
export declare const usePrismicText: (props: UsePrismicTextOptions) => UsePrismicTextReturnType;
|
|
54
|
-
/**
|
|
55
|
-
* `<PrismicText />` implementation.
|
|
56
|
-
*
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
export declare const PrismicTextImpl: DefineComponent<{
|
|
60
|
-
field: {
|
|
61
|
-
type: PropType<
|
|
62
|
-
default: undefined;
|
|
63
|
-
required: false;
|
|
64
|
-
};
|
|
65
|
-
separator: {
|
|
66
|
-
type: PropType<string>;
|
|
67
|
-
default: undefined;
|
|
68
|
-
required: false;
|
|
69
|
-
};
|
|
70
|
-
wrapper: {
|
|
71
|
-
type: PropType<string | ConcreteComponent | Raw<DefineComponent
|
|
72
|
-
default: undefined;
|
|
73
|
-
required: false;
|
|
74
|
-
};
|
|
75
|
-
fallback: {
|
|
76
|
-
type: PropType<string>;
|
|
77
|
-
default: undefined;
|
|
78
|
-
required: false;
|
|
79
|
-
};
|
|
80
|
-
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string,
|
|
83
|
-
field: {
|
|
84
|
-
type: PropType<
|
|
85
|
-
default: undefined;
|
|
86
|
-
required: false;
|
|
87
|
-
};
|
|
88
|
-
separator: {
|
|
89
|
-
type: PropType<string>;
|
|
90
|
-
default: undefined;
|
|
91
|
-
required: false;
|
|
92
|
-
};
|
|
93
|
-
wrapper: {
|
|
94
|
-
type: PropType<string | ConcreteComponent | Raw<DefineComponent
|
|
95
|
-
default: undefined;
|
|
96
|
-
required: false;
|
|
97
|
-
};
|
|
98
|
-
fallback: {
|
|
99
|
-
type: PropType<string>;
|
|
100
|
-
default: undefined;
|
|
101
|
-
required: false;
|
|
102
|
-
};
|
|
103
|
-
}>>, {
|
|
104
|
-
wrapper: string | ConcreteComponent | Raw<DefineComponent
|
|
105
|
-
field:
|
|
106
|
-
separator: string;
|
|
107
|
-
fallback: string;
|
|
108
|
-
}, {}>;
|
|
109
|
-
/**
|
|
110
|
-
* Component to render a Prismic rich text field as plain text.
|
|
111
|
-
*
|
|
112
|
-
* @see Component props {@link PrismicTextProps}
|
|
113
|
-
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
114
|
-
*/
|
|
115
|
-
export declare const PrismicText: new () => {
|
|
116
|
-
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicTextProps;
|
|
117
|
-
};
|
|
1
|
+
import { RichTextField } from "@prismicio/client";
|
|
2
|
+
import { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNode, VNodeProps } from "vue";
|
|
3
|
+
import { VueUseOptions } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Props for `<PrismicText />`.
|
|
6
|
+
*/
|
|
7
|
+
export declare type PrismicTextProps = {
|
|
8
|
+
/**
|
|
9
|
+
* The Prismic rich text or title field to render.
|
|
10
|
+
*/
|
|
11
|
+
field: RichTextField | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Separator used to join each element.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue `" "` (a space)
|
|
16
|
+
*/
|
|
17
|
+
separator?: string;
|
|
18
|
+
/**
|
|
19
|
+
* An HTML tag name, a component, or a functional component used to wrap the
|
|
20
|
+
* output.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue `"div"`
|
|
23
|
+
*/
|
|
24
|
+
wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
25
|
+
/**
|
|
26
|
+
* The string value to be rendered when the field is empty. If a fallback is
|
|
27
|
+
* not given, `""` (nothing) will be rendered.
|
|
28
|
+
*/
|
|
29
|
+
fallback?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Options for {@link usePrismicText}.
|
|
33
|
+
*/
|
|
34
|
+
export declare type UsePrismicTextOptions = VueUseOptions<Omit<PrismicTextProps, "wrapper">>;
|
|
35
|
+
/**
|
|
36
|
+
* Return type of {@link usePrismicText}.
|
|
37
|
+
*/
|
|
38
|
+
export declare type UsePrismicTextReturnType = {
|
|
39
|
+
/**
|
|
40
|
+
* Serialized rich text field as plain text.
|
|
41
|
+
*/
|
|
42
|
+
text: ComputedRef<string>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A low level composable that returns a serialized rich text field as plain
|
|
46
|
+
* text.
|
|
47
|
+
*
|
|
48
|
+
* @param props - {@link UsePrismicTextOptions}
|
|
49
|
+
*
|
|
50
|
+
* @returns - Serialized rich text field as plain text
|
|
51
|
+
* {@link UsePrismicTextReturnType}
|
|
52
|
+
*/
|
|
53
|
+
export declare const usePrismicText: (props: UsePrismicTextOptions) => UsePrismicTextReturnType;
|
|
54
|
+
/**
|
|
55
|
+
* `<PrismicText />` implementation.
|
|
56
|
+
*
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export declare const PrismicTextImpl: DefineComponent<{
|
|
60
|
+
field: {
|
|
61
|
+
type: PropType<[] | [import("@prismicio/client").RTNode, ...import("@prismicio/client").RTNode[]] | null | undefined>;
|
|
62
|
+
default: undefined;
|
|
63
|
+
required: false;
|
|
64
|
+
};
|
|
65
|
+
separator: {
|
|
66
|
+
type: PropType<string>;
|
|
67
|
+
default: undefined;
|
|
68
|
+
required: false;
|
|
69
|
+
};
|
|
70
|
+
wrapper: {
|
|
71
|
+
type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
|
|
72
|
+
default: undefined;
|
|
73
|
+
required: false;
|
|
74
|
+
};
|
|
75
|
+
fallback: {
|
|
76
|
+
type: PropType<string>;
|
|
77
|
+
default: undefined;
|
|
78
|
+
required: false;
|
|
79
|
+
};
|
|
80
|
+
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
|
+
field: {
|
|
84
|
+
type: PropType<[] | [import("@prismicio/client").RTNode, ...import("@prismicio/client").RTNode[]] | null | undefined>;
|
|
85
|
+
default: undefined;
|
|
86
|
+
required: false;
|
|
87
|
+
};
|
|
88
|
+
separator: {
|
|
89
|
+
type: PropType<string>;
|
|
90
|
+
default: undefined;
|
|
91
|
+
required: false;
|
|
92
|
+
};
|
|
93
|
+
wrapper: {
|
|
94
|
+
type: PropType<string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>>;
|
|
95
|
+
default: undefined;
|
|
96
|
+
required: false;
|
|
97
|
+
};
|
|
98
|
+
fallback: {
|
|
99
|
+
type: PropType<string>;
|
|
100
|
+
default: undefined;
|
|
101
|
+
required: false;
|
|
102
|
+
};
|
|
103
|
+
}>>, {
|
|
104
|
+
wrapper: string | ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions, {}, any> | Raw<DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
|
|
105
|
+
field: [] | [import("@prismicio/client").RTNode, ...import("@prismicio/client").RTNode[]] | null | undefined;
|
|
106
|
+
separator: string;
|
|
107
|
+
fallback: string;
|
|
108
|
+
}, {}>;
|
|
109
|
+
/**
|
|
110
|
+
* Component to render a Prismic rich text field as plain text.
|
|
111
|
+
*
|
|
112
|
+
* @see Component props {@link PrismicTextProps}
|
|
113
|
+
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
114
|
+
*/
|
|
115
|
+
export declare const PrismicText: new () => {
|
|
116
|
+
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicTextProps;
|
|
117
|
+
};
|
|
@@ -24,17 +24,20 @@ const getSliceComponentProps = (propsHint) => ({
|
|
|
24
24
|
});
|
|
25
25
|
const TODOSliceComponent = __PRODUCTION__.__PRODUCTION__ ? () => null : /* @__PURE__ */ vue.defineComponent({
|
|
26
26
|
name: "TODOSliceComponent",
|
|
27
|
-
props:
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
props: [],
|
|
28
|
+
inheritAttrs: false,
|
|
29
|
+
setup(_props, { attrs }) {
|
|
30
|
+
const type = vue.computed(() => attrs.slice && typeof attrs.slice === "object" ? "slice_type" in attrs.slice ? attrs.slice.slice_type : "type" in attrs.slice ? attrs.slice.type : null : null);
|
|
30
31
|
vue.watchEffect(() => {
|
|
31
|
-
console.warn(`[SliceZone] Could not find a component for Slice type "${type.value}"`,
|
|
32
|
+
type.value ? console.warn(`[SliceZone] Could not find a component for Slice type "${type.value}"`, attrs.slice) : console.warn("[SliceZone] Could not find a component for mapped Slice", attrs);
|
|
32
33
|
});
|
|
33
34
|
return () => {
|
|
34
35
|
return vue.h("section", {
|
|
35
36
|
"data-slice-zone-todo-component": "",
|
|
36
|
-
"data-slice-type": type.value
|
|
37
|
-
}, [
|
|
37
|
+
"data-slice-type": type.value ? type.value : null
|
|
38
|
+
}, [
|
|
39
|
+
type.value ? `Could not find a component for Slice type "${type.value}"` : "Could not find a component for mapped Slice"
|
|
40
|
+
]);
|
|
38
41
|
};
|
|
39
42
|
}
|
|
40
43
|
});
|
|
@@ -84,6 +87,11 @@ const SliceZoneImpl = /* @__PURE__ */ vue.defineComponent({
|
|
|
84
87
|
if (!props.slices) {
|
|
85
88
|
return () => null;
|
|
86
89
|
}
|
|
90
|
+
if (!__PRODUCTION__.__PRODUCTION__) {
|
|
91
|
+
if (props.resolver) {
|
|
92
|
+
console.warn("The `resolver` prop is deprecated. Please replace it with a components map using the `components` prop.");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
87
95
|
const { options } = usePrismic.usePrismic();
|
|
88
96
|
const renderedSlices = vue.computed(() => {
|
|
89
97
|
return props.slices.map((slice, index) => {
|
|
@@ -100,14 +108,20 @@ const SliceZoneImpl = /* @__PURE__ */ vue.defineComponent({
|
|
|
100
108
|
component = resolvedComponent;
|
|
101
109
|
}
|
|
102
110
|
}
|
|
103
|
-
const key = "id" in slice && slice.id ? slice.id : `${index}-${JSON.stringify(slice)}`;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
slice
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
const key = "id" in slice && typeof slice.id === "string" ? slice.id : `${index}-${JSON.stringify(slice)}`;
|
|
112
|
+
let p;
|
|
113
|
+
if (slice.__mapped) {
|
|
114
|
+
const { __mapped, ...mappedProps } = slice;
|
|
115
|
+
p = { key, ...mappedProps };
|
|
116
|
+
} else {
|
|
117
|
+
p = {
|
|
118
|
+
key,
|
|
119
|
+
slice,
|
|
120
|
+
index,
|
|
121
|
+
context: props.context,
|
|
122
|
+
slices: props.slices
|
|
123
|
+
};
|
|
124
|
+
}
|
|
111
125
|
return vue.h(simplyResolveComponent.simplyResolveComponent(component), p);
|
|
112
126
|
});
|
|
113
127
|
});
|