@prismicio/vue 5.3.0-pr.88.72388e2 → 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 +13 -19
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts +1 -4
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +5 -6
- 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 +5 -6
- 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 +1 -3
- package/dist/PrismicText.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 +17 -23
- 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 +5 -8
- 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 +9 -10
- 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 +5 -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 +17 -9
- 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 +17 -9
- 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 +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.vue.d.ts +2 -2
- 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 -8
- package/src/PrismicLink.vue +14 -14
- package/src/PrismicRichText/PrismicRichText.vue +24 -15
- 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 +27 -19
- 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 +1 -3
- 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
|
@@ -2,10 +2,7 @@ import * as vue11 from "vue";
|
|
|
2
2
|
import { ImageField, asImagePixelDensitySrcSet, asImageSrc, asImageWidthSrcSet } from "@prismicio/client";
|
|
3
3
|
|
|
4
4
|
//#region src/PrismicImage.vue.d.ts
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Props for `<PrismicImage />`.
|
|
8
|
-
*/
|
|
5
|
+
/** Props for `<PrismicImage />`. */
|
|
9
6
|
type PrismicImageProps = {
|
|
10
7
|
/** The Prismic image field or thumbnail to render. */
|
|
11
8
|
field: ImageField | ImageField<string>;
|
|
@@ -46,15 +43,14 @@ type PrismicImageProps = {
|
|
|
46
43
|
height?: number | string;
|
|
47
44
|
} & ({
|
|
48
45
|
/**
|
|
49
|
-
* Widths (in pixels) used to build a `srcset` value for the image
|
|
50
|
-
* field.
|
|
46
|
+
* Widths (in pixels) used to build a `srcset` value for the image field.
|
|
51
47
|
*
|
|
52
48
|
* If omitted or set to `"defaults"`, the following widths will be used:
|
|
53
49
|
* 640, 750, 828, 1080, 1200, 1920, 2048, 3840.
|
|
54
50
|
*
|
|
55
|
-
* If the image field contains responsive views, each responsive view
|
|
56
|
-
*
|
|
57
|
-
*
|
|
51
|
+
* If the image field contains responsive views, each responsive view can
|
|
52
|
+
* be used as a width in the resulting `srcset` by passing `"thumbnails"`
|
|
53
|
+
* as the `widths` prop.
|
|
58
54
|
*/
|
|
59
55
|
widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
|
|
60
56
|
pixelDensities?: never;
|
|
@@ -108,15 +104,14 @@ declare const __VLS_export: vue11.DefineComponent<({
|
|
|
108
104
|
height?: number | string;
|
|
109
105
|
} & {
|
|
110
106
|
/**
|
|
111
|
-
* Widths (in pixels) used to build a `srcset` value for the image
|
|
112
|
-
* field.
|
|
107
|
+
* Widths (in pixels) used to build a `srcset` value for the image field.
|
|
113
108
|
*
|
|
114
109
|
* If omitted or set to `"defaults"`, the following widths will be used:
|
|
115
110
|
* 640, 750, 828, 1080, 1200, 1920, 2048, 3840.
|
|
116
111
|
*
|
|
117
|
-
* If the image field contains responsive views, each responsive view
|
|
118
|
-
*
|
|
119
|
-
*
|
|
112
|
+
* If the image field contains responsive views, each responsive view can
|
|
113
|
+
* be used as a width in the resulting `srcset` by passing `"thumbnails"`
|
|
114
|
+
* as the `widths` prop.
|
|
120
115
|
*/
|
|
121
116
|
widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
|
|
122
117
|
pixelDensities?: never;
|
|
@@ -207,15 +202,14 @@ declare const __VLS_export: vue11.DefineComponent<({
|
|
|
207
202
|
height?: number | string;
|
|
208
203
|
} & {
|
|
209
204
|
/**
|
|
210
|
-
* Widths (in pixels) used to build a `srcset` value for the image
|
|
211
|
-
* field.
|
|
205
|
+
* Widths (in pixels) used to build a `srcset` value for the image field.
|
|
212
206
|
*
|
|
213
207
|
* If omitted or set to `"defaults"`, the following widths will be used:
|
|
214
208
|
* 640, 750, 828, 1080, 1200, 1920, 2048, 3840.
|
|
215
209
|
*
|
|
216
|
-
* If the image field contains responsive views, each responsive view
|
|
217
|
-
*
|
|
218
|
-
*
|
|
210
|
+
* If the image field contains responsive views, each responsive view can
|
|
211
|
+
* be used as a width in the resulting `srcset` by passing `"thumbnails"`
|
|
212
|
+
* as the `widths` prop.
|
|
219
213
|
*/
|
|
220
214
|
widths?: NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>["widths"] | "thumbnails" | "defaults";
|
|
221
215
|
pixelDensities?: never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicImage.vue.d.cts","names":[],"sources":["../src/PrismicImage.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicImage.vue.d.cts","names":[],"sources":["../src/PrismicImage.vue"],"sourcesContent":[],"mappings":";;;;;KA+MY,iBAAA;EAAA;EAEJ,KAAA,EAAA,UAAA,GAAa,UAAb,CAAA,MAAA,CAAA;EAAa;;;;;EAsDf,WAAA,CAAA,EA/CS,UA+CT,CAAA,OA/C2B,UA+C3B,CAAA,CAAA,CAAA,CAAA;EAekB;;;;AAIvB;;EAzEoB,GAAA,CAAA,EAAA,EAAA;EAOY;;;;;;;EAAA,WAAA,CAAA,EAAA,EAAA;EAAlB;;;;;;;EAPP;;;;;;EAsDF,MAAA,CAAA,EAAA,MAAA,GAAA,MAAA;CAtDE,GAAA,CAAA;EAAa;;;;;;;;;;EAqMH,MAAA,CAAA,EA/IZ,WA+IY,CA/IA,UA+IA,CAAA,OA/IkB,kBA+IlB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,GAAA,YAAA,GAAA,UAAA;EAAA,cAGsB,CAAA,EAAA,KAAA;;;;;;;;;kBApIlC,YACA,kBAAkB;;cAgIlB,oBAAY;;SArMV,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA+C3B,YAAY,kBAAkB;;;;SAtD5B,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6D3B,YACA,kBAAkB;oBADP,KAAA,CAAA,qBAAA;;SApET,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA+C3B,YAAY,kBAAkB;;;;SAtD5B,aAAa;;;;;;gBAON,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6D3B,YACA,kBAAkB;;cAgIN,iBAGU"}
|
|
@@ -3,10 +3,7 @@ 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
9
|
* The link resolver used to resolve links.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.vue.d.cts","names":[],"sources":["../src/PrismicLink.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicLink.vue.d.cts","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,13 +1,11 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { VueRichTextComponents } from "./types.cjs";
|
|
3
3
|
import * as vue0 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
10
|
/** The Prismic rich text field to render. */
|
|
13
11
|
field: RichTextField | null | undefined;
|
|
@@ -22,7 +20,8 @@ type PrismicRichTextProps = {
|
|
|
22
20
|
*/
|
|
23
21
|
linkResolver?: LinkResolverFunction;
|
|
24
22
|
/**
|
|
25
|
-
* An object that maps a rich text block type to a Vue component or a
|
|
23
|
+
* An object that maps a rich text block type to a Vue component or a
|
|
24
|
+
* shorthand definition.
|
|
26
25
|
*
|
|
27
26
|
* @example
|
|
28
27
|
*
|
|
@@ -34,7 +33,7 @@ type PrismicRichTextProps = {
|
|
|
34
33
|
* }
|
|
35
34
|
* ```
|
|
36
35
|
*/
|
|
37
|
-
components?:
|
|
36
|
+
components?: VueRichTextComponents;
|
|
38
37
|
/**
|
|
39
38
|
* The value to be rendered when the field is empty. If a fallback is not
|
|
40
39
|
* given, `null` will be rendered.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.vue.d.cts","names":[],"sources":["../../src/PrismicRichText/PrismicRichText.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicRichText.vue.d.cts","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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LinkResolverFunction, RTAnyNode,
|
|
1
|
+
import { VueComponentShorthand } from "../types.cjs";
|
|
2
|
+
import { LinkResolverFunction, RTAnyNode, RTEmNode, RTEmbedNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTImageNode, RTLabelNode, RTLinkNode, RTListItemNode, RTListNode, RTOListItemNode, RTOListNode, RTParagraphNode, RTPreformattedNode, RTSpanNode, RTStrongNode } from "@prismicio/client";
|
|
3
3
|
|
|
4
4
|
//#region src/PrismicRichText/types.d.ts
|
|
5
5
|
|
|
@@ -9,32 +9,31 @@ import { LinkResolverFunction, RTAnyNode, RichTextNodeType } from "@prismicio/cl
|
|
|
9
9
|
*
|
|
10
10
|
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/rich-text}
|
|
11
11
|
*/
|
|
12
|
-
type
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
type VueRichTextComponents = {
|
|
13
|
+
heading1?: RichTextComponentProps<RTHeading1Node> | VueComponentShorthand;
|
|
14
|
+
heading2?: RichTextComponentProps<RTHeading2Node> | VueComponentShorthand;
|
|
15
|
+
heading3?: RichTextComponentProps<RTHeading3Node> | VueComponentShorthand;
|
|
16
|
+
heading4?: RichTextComponentProps<RTHeading4Node> | VueComponentShorthand;
|
|
17
|
+
heading5?: RichTextComponentProps<RTHeading5Node> | VueComponentShorthand;
|
|
18
|
+
heading6?: RichTextComponentProps<RTHeading6Node> | VueComponentShorthand;
|
|
19
|
+
paragraph?: RichTextComponentProps<RTParagraphNode> | VueComponentShorthand;
|
|
20
|
+
preformatted?: RichTextComponentProps<RTPreformattedNode> | VueComponentShorthand;
|
|
21
|
+
strong?: RichTextComponentProps<RTStrongNode> | VueComponentShorthand;
|
|
22
|
+
em?: RichTextComponentProps<RTEmNode> | VueComponentShorthand;
|
|
23
|
+
listItem?: RichTextComponentProps<RTListItemNode> | VueComponentShorthand;
|
|
24
|
+
oListItem?: RichTextComponentProps<RTOListItemNode> | VueComponentShorthand;
|
|
25
|
+
list?: RichTextComponentProps<RTListNode> | VueComponentShorthand;
|
|
26
|
+
oList?: RichTextComponentProps<RTOListNode> | VueComponentShorthand;
|
|
27
|
+
image?: RichTextComponentProps<RTImageNode> | Omit<VueComponentShorthand, "as">;
|
|
28
|
+
embed?: RichTextComponentProps<RTEmbedNode> | VueComponentShorthand;
|
|
29
|
+
hyperlink?: RichTextComponentProps<RTLinkNode> | Omit<VueComponentShorthand, "as">;
|
|
30
|
+
label?: RichTextComponentProps<RTLabelNode> | Omit<VueComponentShorthand, "as">;
|
|
31
|
+
span?: RichTextComponentProps<RTSpanNode>;
|
|
32
|
+
};
|
|
33
|
+
/** Props for a component rendering nodes from a Prismic rich text field. */
|
|
16
34
|
type RichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {
|
|
17
35
|
node: TRTNode;
|
|
18
36
|
};
|
|
19
|
-
/**
|
|
20
|
-
* A Vue component rendering a node from a Prismic rich text field.
|
|
21
|
-
*
|
|
22
|
-
* @typeParam TRTNode - The type of rich text node(s) this component handles
|
|
23
|
-
*/
|
|
24
|
-
type VueRichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> = VueComponent<RichTextComponentProps<TRTNode>>;
|
|
25
|
-
/**
|
|
26
|
-
* A shorthand definition for {@link VueRichTextSerializer} component types.
|
|
27
|
-
*/
|
|
28
|
-
type VueShorthand = {
|
|
29
|
-
/**
|
|
30
|
-
* The HTML element type rendered for this node type.
|
|
31
|
-
*/
|
|
32
|
-
as?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Other attributes to apply to the element type.
|
|
35
|
-
*/
|
|
36
|
-
[Attribute: string]: string | boolean | null | undefined;
|
|
37
|
-
};
|
|
38
37
|
//#endregion
|
|
39
|
-
export { RichTextComponentProps,
|
|
38
|
+
export { RichTextComponentProps, VueRichTextComponents };
|
|
40
39
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAiCA;;;;AAEmC,KAFvB,qBAAA,GAEuB;EAAvB,QAAA,CAAA,EADA,sBACA,CADuB,cACvB,CAAA,GADyC,qBACzC;EAAyC,QAAA,CAAA,EAAzC,sBAAyC,CAAlB,cAAkB,CAAA,GAAA,qBAAA;EAClB,QAAA,CAAA,EAAvB,sBAAuB,CAAA,cAAA,CAAA,GAAkB,qBAAlB;EAAvB,QAAA,CAAA,EACA,sBADA,CACuB,cADvB,CAAA,GACyC,qBADzC;EAAyC,QAAA,CAAA,EAEzC,sBAFyC,CAElB,cAFkB,CAAA,GAEA,qBAFA;EAClB,QAAA,CAAA,EAEvB,sBAFuB,CAEA,cAFA,CAAA,GAEkB,qBAFlB;EAAvB,SAAA,CAAA,EAGC,sBAHD,CAGwB,eAHxB,CAAA,GAG2C,qBAH3C;EAAyC,YAAA,CAAA,EAKjD,sBALiD,CAK1B,kBAL0B,CAAA,GAMjD,qBANiD;EAClB,MAAA,CAAA,EAMzB,sBANyB,CAMF,YANE,CAAA,GAMc,qBANd;EAAvB,EAAA,CAAA,EAON,sBAPM,CAOiB,QAPjB,CAAA,GAO6B,qBAP7B;EAAyC,QAAA,CAAA,EAQzC,sBARyC,CAQlB,cARkB,CAAA,GAQA,qBARA;EAClB,SAAA,CAAA,EAQtB,sBARsB,CAQC,eARD,CAAA,GAQoB,qBARpB;EAAvB,IAAA,CAAA,EASJ,sBATI,CASmB,UATnB,CAAA,GASiC,qBATjC;EAAyC,KAAA,CAAA,EAU5C,sBAV4C,CAUrB,WAVqB,CAAA,GAUN,qBAVM;EACjB,KAAA,CAAA,EAWhC,sBAXgC,CAWT,WAXS,CAAA,GAYhC,IAZgC,CAY3B,qBAZ2B,EAAA,IAAA,CAAA;EAAvB,KAAA,CAAA,EAaJ,sBAbI,CAamB,WAbnB,CAAA,GAakC,qBAblC;EAA0C,SAAA,CAAA,EAenD,sBAfmD,CAe5B,UAf4B,CAAA,GAgBnD,IAhBmD,CAgB9C,qBAhB8C,EAAA,IAAA,CAAA;EAE5B,KAAA,CAAA,EAgBvB,sBAhBuB,CAgBA,WAhBA,CAAA,GAiBvB,IAjBuB,CAiBlB,qBAjBkB,EAAA,IAAA,CAAA;EAAvB,IAAA,CAAA,EAkBI,sBAlBJ,CAkB2B,UAlB3B,CAAA;CACA;;AACM,KAoBE,sBApBF,CAAA,gBAoByC,SApBzC,GAoBqD,SApBrD,CAAA,GAAA;EAAuC,IAAA,EAqB1C,OArB0C;CACpB"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { VueRichTextComponents } from "../PrismicRichText/types.cjs";
|
|
3
3
|
import { VueTableComponents } from "./types.cjs";
|
|
4
4
|
import * as vue6 from "vue";
|
|
5
5
|
import { TableField } from "@prismicio/client";
|
|
6
6
|
|
|
7
7
|
//#region src/PrismicTable/PrismicTable.vue.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Props for `<PrismicTable />`.
|
|
10
|
-
*/
|
|
8
|
+
/** Props for `<PrismicTable />`. */
|
|
11
9
|
type PrismicTableProps = {
|
|
12
10
|
/** The Prismic table field to render. */
|
|
13
11
|
field: TableField | undefined;
|
|
14
12
|
/**
|
|
15
|
-
* An object that maps a table block type to a Vue component or a shorthand
|
|
13
|
+
* An object that maps a table block type to a Vue component or a shorthand
|
|
14
|
+
* definition.
|
|
16
15
|
*
|
|
17
16
|
* @example
|
|
18
17
|
*
|
|
@@ -24,7 +23,7 @@ type PrismicTableProps = {
|
|
|
24
23
|
* }
|
|
25
24
|
* ```
|
|
26
25
|
*/
|
|
27
|
-
components?: VueTableComponents &
|
|
26
|
+
components?: VueTableComponents & VueRichTextComponents;
|
|
28
27
|
/**
|
|
29
28
|
* The value to be rendered when the field is empty. If a fallback is not
|
|
30
29
|
* given, `null` (nothing) will be rendered.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue.d.cts","names":[],"sources":["../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue.d.cts","names":[],"sources":["../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;KAmIY,iBAAA;;EAAA,KAAA,EAEJ,UAFI,GAAiB,SAAA;EAErB;;;;;AAuBP;;;;;;;;;EA0JiB,UAAA,CAAA,EAjKJ,kBAiKI,GAjKiB,qBAiKjB;EAAA;AAAA;;;aA3JN;;cA2JN,cAAY,IAAA,CAAA,gBAAA,mCAAA,IAAA,CAAA,qBAAA,EAAA,IAAA,CAAA,qBAAA,cAAA,IAAA,CAAA,WAAA,EAAA,SAAA,qBAAA,sCAAA,IAAA,CAAA,uBAAA;cAAA,iBAGU"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { VueComponent } from "../types.cjs";
|
|
2
|
-
import { VueShorthand } from "../PrismicRichText/types.cjs";
|
|
1
|
+
import { VueComponent, VueComponentShorthand } from "../types.cjs";
|
|
3
2
|
import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, TableFieldHead, TableFieldHeadRow, TableFieldHeaderCell } from "@prismicio/client";
|
|
4
3
|
|
|
5
4
|
//#region src/PrismicTable/types.d.ts
|
|
@@ -13,22 +12,22 @@ import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, Tabl
|
|
|
13
12
|
type VueTableComponents = {
|
|
14
13
|
table?: VueComponent<{
|
|
15
14
|
table: TableField<"filled">;
|
|
16
|
-
}> |
|
|
15
|
+
}> | Omit<VueComponentShorthand, "as">;
|
|
17
16
|
thead?: VueComponent<{
|
|
18
17
|
head: TableFieldHead;
|
|
19
|
-
}> |
|
|
18
|
+
}> | Omit<VueComponentShorthand, "as">;
|
|
20
19
|
tbody?: VueComponent<{
|
|
21
20
|
body: TableFieldBody;
|
|
22
|
-
}> |
|
|
21
|
+
}> | Omit<VueComponentShorthand, "as">;
|
|
23
22
|
tr?: VueComponent<{
|
|
24
23
|
row: TableFieldBodyRow | TableFieldHeadRow;
|
|
25
|
-
}> |
|
|
24
|
+
}> | Omit<VueComponentShorthand, "as">;
|
|
26
25
|
th?: VueComponent<{
|
|
27
26
|
cell: TableFieldHeaderCell;
|
|
28
|
-
}> |
|
|
27
|
+
}> | Omit<VueComponentShorthand, "as">;
|
|
29
28
|
td?: VueComponent<{
|
|
30
29
|
cell: TableFieldDataCell;
|
|
31
|
-
}> |
|
|
30
|
+
}> | Omit<VueComponentShorthand, "as">;
|
|
32
31
|
};
|
|
33
32
|
//#endregion
|
|
34
33
|
export { VueTableComponents };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;;;;AAGI,KAHQ,kBAAA,GAGR;EAEqB,KAAA,CAAA,EAHrB,YAGqB,CAAA;IAArB,KAAA,EAHsB,UAGtB,CAAA,QAAA,CAAA;EACK,CAAA,CAAA,GAHL,IAGK,CAHA,qBAGA,EAAA,IAAA,CAAA;EAAL,KAAA,CAAA,EADA,YACA,CAAA;IAEqB,IAAA,EAHA,cAGA;EAArB,CAAA,CAAA,GAFA,IAEA,CAFK,qBAEL,EAAA,IAAA,CAAA;EACK,KAAA,CAAA,EADL,YACK,CAAA;IAAL,IAAA,EADqB,cACrB;EAEoB,CAAA,CAAA,GAFpB,IAEoB,CAFf,qBAEe,EAAA,IAAA,CAAA;EAAoB,EAAA,CAAA,EAAxC,YAAwC,CAAA;IAAxC,GAAA,EAAoB,iBAApB,GAAwC,iBAAxC;EACK,CAAA,CAAA,GAAL,IAAK,CAAA,qBAAA,EAAA,IAAA,CAAA;EAAL,EAAA,CAAA,EAEA,YAFA,CAAA;IAEqB,IAAA,EAAA,oBAAA;EAArB,CAAA,CAAA,GACA,IADA,CACK,qBADL,EAAA,IAAA,CAAA;EACK,EAAA,CAAA,EAEL,YAFK,CAAA;IAAL,IAAA,EAEqB,kBAFrB;EAEqB,CAAA,CAAA,GACrB,IADqB,CAChB,qBADgB,EAAA,IAAA,CAAA;CAArB"}
|
|
@@ -2,9 +2,7 @@ import * as vue21 from "vue";
|
|
|
2
2
|
import { RichTextField } from "@prismicio/client";
|
|
3
3
|
|
|
4
4
|
//#region src/PrismicText.vue.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Props for `<PrismicText />`.
|
|
7
|
-
*/
|
|
5
|
+
/** Props for `<PrismicText />`. */
|
|
8
6
|
type PrismicTextProps = {
|
|
9
7
|
/** The Prismic rich text field to render. */
|
|
10
8
|
field: RichTextField | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicText.vue.d.cts","names":[],"sources":["../src/PrismicText.vue"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrismicText.vue.d.cts","names":[],"sources":["../src/PrismicText.vue"],"sourcesContent":[],"mappings":";;;;;KAwDY,gBAAA;;EAAA,KAAA,EAEJ,aAFoB,GAAA,IAAA,GAAA,SAEpB;EAmDF;;;;EAAY,QAAA,CAAA,EAAA,MAAA;EAAA;;;;;EAAA,SAAA,CAAA,EAAA,MAAA;AAAA,CAAA;cAAZ,cAAY,KAAA,CAAA,gBAAA,kCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,oBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
|
|
@@ -62,17 +62,11 @@ type SliceZoneLike<TSlice extends SliceLike = SliceLike> = readonly TSlice[];
|
|
|
62
62
|
* available to all Slice components
|
|
63
63
|
*/
|
|
64
64
|
type SliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknown> = {
|
|
65
|
-
/**
|
|
66
|
-
* Slice data for this component.
|
|
67
|
-
*/
|
|
65
|
+
/** Slice data for this component. */
|
|
68
66
|
slice: TSlice;
|
|
69
|
-
/**
|
|
70
|
-
* The index of the Slice in the Slice Zone.
|
|
71
|
-
*/
|
|
67
|
+
/** The index of the Slice in the Slice Zone. */
|
|
72
68
|
index: number;
|
|
73
|
-
/**
|
|
74
|
-
* All Slices from the Slice Zone to which the Slice belongs.
|
|
75
|
-
*/
|
|
69
|
+
/** All Slices from the Slice Zone to which the Slice belongs. */
|
|
76
70
|
slices: SliceZoneLike<TSlice extends SliceLikeGraphQL ? SliceLikeGraphQL : SliceLikeRestV2>;
|
|
77
71
|
/**
|
|
78
72
|
* Arbitrary data passed to `<SliceZone />` and made available to all Slice
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/SliceZone/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKY;;;KAOP,gBAA4D,CAAA,eAA5B,SAA4B,CAAA,GAAf,MAAe,SAAA,eAAA,GAC9D,MAD8D,CAAA,YAAA,CAAA,GAE9D,MAF8D,SAE/C,gBAF+C,GAG7D,MAH6D,CAAA,MAAA,CAAA,GAAA,KAAA;;;;;;AAYjE;AACO,KADK,eACL,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAD2D,IAC3D,CAAN,KAAM,CAAA,UAAA,CAAA,EAAA,IAAA,GAAA,YAAA,CAAA;;;;AAUP;AAaA;;AACG,KAdS,gBAcT,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAAA;EACiB,IAAA,EAdb,KAca,CAdP,UAcO,CAAA,CAAA,YAAA,CAAA;CAAjB;;AAoBH;;;;;AAWA;;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/SliceZone/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAKY;;;KAOP,gBAA4D,CAAA,eAA5B,SAA4B,CAAA,GAAf,MAAe,SAAA,eAAA,GAC9D,MAD8D,CAAA,YAAA,CAAA,GAE9D,MAF8D,SAE/C,gBAF+C,GAG7D,MAH6D,CAAA,MAAA,CAAA,GAAA,KAAA;;;;;;AAYjE;AACO,KADK,eACL,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAD2D,IAC3D,CAAN,KAAM,CAAA,UAAA,CAAA,EAAA,IAAA,GAAA,YAAA,CAAA;;;;AAUP;AAaA;;AACG,KAdS,gBAcT,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAAA;EACiB,IAAA,EAdb,KAca,CAdP,UAcO,CAAA,CAAA,YAAA,CAAA;CAAjB;;AAoBH;;;;;AAWA;;;AAKQ,KAtCI,SAsCJ,CAAA,mBAAA,MAAA,GAAA,MAAA,CAAA,GAAA,CArCL,eAqCK,CArCW,UAqCX,CAAA,GApCL,gBAoCK,CApCY,UAoCZ,CAAA,CAAA,GAAA;EAWN;;;;;;EAOgB,QAAA,CAAA,EAAA,IAAA;AASlB,CAAA;;;;;;;;;;AAWsB,KAtDV,aAsDU,CAAA,eAtDmB,SAsDnB,GAtD+B,SAsD/B,CAAA,GAAA,SArDZ,MAqDY,EAAA;AAStB;;;;;;;;AAgBK,KApEO,mBAoEP,CAAA,eAnEW,SAmEX,GAnEuB,SAmEvB,EAAA,WAAA,OAAA,CAAA,GAAA;EACG;EACQ,KAAA,EAjER,MAiEQ;EAAkB;EAAV,KAAA,EAAA,MAAA;EAAhB;EACH,MAAA,EAxDI,aAwDJ,CAvDH,MAuDG,SAvDY,gBAuDZ,GAvD+B,gBAuD/B,GAvDkD,eAuDlD,CAAA;EAJA;;;;WA5CK;;;;;;;;KASE,kCAEI,uCAKb,+BAEA,kBAAkB,wBAClB,gBAAgB,oBAAoB,QAAQ,aAC5C;;;;;;;;KASS,mCACI,YAAY,iDAaZ,iBAAiB,UAC5B,mBACA,QAAQ,QAAQ,UAAU,4BACvB,YACA,QAAQ,QAAQ,UAAU,aAC7B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ComponentOrTagName } from "./types.cjs";
|
|
2
|
+
import { VueRichTextComponents } from "./PrismicRichText/types.cjs";
|
|
3
|
+
import { VueTableComponents } from "./PrismicTable/types.cjs";
|
|
4
|
+
import { App } from "vue";
|
|
5
|
+
import { CreateClient, isFilled } from "@prismicio/client";
|
|
6
|
+
|
|
7
|
+
//#region src/createPrismic.d.ts
|
|
8
|
+
/** Components configuration. */
|
|
9
|
+
type ComponentsConfig = {
|
|
10
|
+
/** The default component rendered for internal URLs. */
|
|
11
|
+
linkInternalComponent?: ComponentOrTagName;
|
|
12
|
+
/** The default component rendered for external URLs. */
|
|
13
|
+
linkExternalComponent?: ComponentOrTagName;
|
|
14
|
+
/**
|
|
15
|
+
* The default components or shorthand definitions for Rich Text and Table
|
|
16
|
+
* fields.
|
|
17
|
+
*/
|
|
18
|
+
defaultComponents?: VueRichTextComponents & VueTableComponents;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Prismic Vue plugin interface accessible through `usePrismic()` and
|
|
22
|
+
* `$prismic`.
|
|
23
|
+
*/
|
|
24
|
+
type PrismicPlugin = {
|
|
25
|
+
/** A Prismic client that can be used to query content from a repository. */
|
|
26
|
+
client: ReturnType<CreateClient>;
|
|
27
|
+
/** Helpers to determine if a field is filled. */
|
|
28
|
+
isFilled: typeof isFilled;
|
|
29
|
+
/** @internal */
|
|
30
|
+
readonly componentsConfig?: ComponentsConfig;
|
|
31
|
+
/** @internal */
|
|
32
|
+
install: (app: App) => void;
|
|
33
|
+
};
|
|
34
|
+
/** Prismic Vue plugin configuration. */
|
|
35
|
+
type PrismicPluginConfig = {
|
|
36
|
+
/** A Prismic client instance to inject into the Vue app. */
|
|
37
|
+
client: ReturnType<CreateClient>;
|
|
38
|
+
/** Components configuration. */
|
|
39
|
+
componentsConfig?: ComponentsConfig;
|
|
40
|
+
};
|
|
41
|
+
/** Creates a Prismic Vue plugin instance that can be used by a Vue app. */
|
|
42
|
+
declare const createPrismic: (config: PrismicPluginConfig) => PrismicPlugin;
|
|
43
|
+
/**
|
|
44
|
+
* Access the Prismic Vue plugin interface.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
*
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const { client, isFilled } = usePrismic()
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare const usePrismic: () => PrismicPlugin;
|
|
53
|
+
declare module "vue" {
|
|
54
|
+
interface ComponentCustomProperties {
|
|
55
|
+
/** The Prismic Vue plugin interface. */
|
|
56
|
+
$prismic: PrismicPlugin;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { PrismicPlugin, PrismicPluginConfig, createPrismic, usePrismic };
|
|
61
|
+
//# sourceMappingURL=createPrismic.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPrismic.d.cts","names":[],"sources":["../src/createPrismic.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAOwD,KAOnD,gBAAA,GAAgB;EAEI;EAGA,qBAAA,CAAA,EAHA,kBAGA;EAMJ;EAAwB,qBAAA,CAAA,EANpB,kBAMoB;EAAkB;AAO/D;;;EAKkB,iBAAA,CAAA,EAZG,qBAYH,GAZ2B,kBAY3B;CAGW;;;AAO7B;;AAES,KAjBG,aAAA,GAiBH;EAGW;EAAgB,MAAA,EAlB3B,UAkB2B,CAlBhB,YAkBgB,CAAA;EAIvB;EAoBA,QAAA,EAAA,OAvCK,QAuCY;EAE7B;EAAA,SAAA,gBAAA,CAAA,EAtC4B,gBAsC5B;;EAKwB,OAAA,EAAA,CAAA,GAAA,EAxCT,GAwCS,EAAA,GAAA,IAAA;CAAA;;KApCb,mBAAA;;UAEH,WAAW;;qBAGA;;;cAIP,wBAAyB,wBAAsB;;;;;;;;;;cAoB/C,kBAAiB;;;;cAOlB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const require_createPrismic = require('./src/createPrismic.cjs');
|
|
1
2
|
const require_PrismicImage = require('./src/PrismicImage.cjs');
|
|
2
3
|
const require_PrismicLink = require('./src/PrismicLink.cjs');
|
|
3
4
|
const require_PrismicRichText = require('./src/PrismicRichText/PrismicRichText.cjs');
|
|
@@ -17,6 +18,7 @@ exports.PrismicTable = require_PrismicTable.default;
|
|
|
17
18
|
exports.PrismicText = require_PrismicText.default;
|
|
18
19
|
exports.SliceZone = require_SliceZone.default;
|
|
19
20
|
exports.TODOSliceComponent = require_TODOSliceComponent.TODOSliceComponent;
|
|
21
|
+
exports.createPrismic = require_createPrismic.createPrismic;
|
|
20
22
|
exports.defineSliceZoneComponents = require_defineSliceZoneComponents.defineSliceZoneComponents;
|
|
21
23
|
exports.getRichTextComponentProps = require_getRichTextComponentProps.getRichTextComponentProps;
|
|
22
24
|
exports.getSliceComponentProps = require_getSliceComponentProps.getSliceComponentProps;
|
|
@@ -25,4 +27,5 @@ Object.defineProperty(exports, 'getTableComponentProps', {
|
|
|
25
27
|
get: function () {
|
|
26
28
|
return require_getTableComponentProps.getTableComponentProps_exports;
|
|
27
29
|
}
|
|
28
|
-
});
|
|
30
|
+
});
|
|
31
|
+
exports.usePrismic = require_createPrismic.usePrismic;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { RichTextComponentProps,
|
|
1
|
+
import { RichTextComponentProps, VueRichTextComponents } from "./PrismicRichText/types.cjs";
|
|
2
2
|
import { PrismicRichTextProps, _default as _default$2 } from "./PrismicRichText/PrismicRichText.vue.cjs";
|
|
3
3
|
import { getRichTextComponentProps } from "./PrismicRichText/getRichTextComponentProps.cjs";
|
|
4
|
+
import { VueTableComponents } from "./PrismicTable/types.cjs";
|
|
4
5
|
import { PrismicTableProps, _default as _default$3 } from "./PrismicTable/PrismicTable.vue.cjs";
|
|
5
6
|
import { getTableComponentProps_d_exports } from "./PrismicTable/getTableComponentProps.cjs";
|
|
6
7
|
import { PrismicImageProps, _default } from "./PrismicImage.vue.cjs";
|
|
@@ -11,4 +12,5 @@ import { SliceZoneProps, _default as _default$5 } from "./SliceZone/SliceZone.vu
|
|
|
11
12
|
import { TODOSliceComponent } from "./SliceZone/TODOSliceComponent.cjs";
|
|
12
13
|
import { getSliceComponentProps } from "./SliceZone/getSliceComponentProps.cjs";
|
|
13
14
|
import { defineSliceZoneComponents } from "./SliceZone/defineSliceZoneComponents.cjs";
|
|
14
|
-
|
|
15
|
+
import { PrismicPlugin, PrismicPluginConfig, createPrismic, usePrismic } from "./createPrismic.cjs";
|
|
16
|
+
export { _default as PrismicImage, type PrismicImageProps, _default$1 as PrismicLink, type PrismicLinkProps, type PrismicPlugin, type PrismicPluginConfig, _default$2 as PrismicRichText, type PrismicRichTextProps, _default$3 as PrismicTable, type PrismicTableProps, _default$4 as PrismicText, type PrismicTextProps, type RichTextComponentProps, type SliceComponentProps, type SliceComponentType, type SliceLike, type SliceLikeGraphQL, type SliceLikeRestV2, _default$5 as SliceZone, type SliceZoneComponents, type SliceZoneLike, type SliceZoneProps, TODOSliceComponent, type VueRichTextComponents, type VueTableComponents, createPrismic, defineSliceZoneComponents, getRichTextComponentProps, getSliceComponentProps, getTableComponentProps_d_exports as getTableComponentProps, usePrismic };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { RichTextComponentProps,
|
|
1
|
+
import { RichTextComponentProps, VueRichTextComponents } from "./src/PrismicRichText/types.js";
|
|
2
2
|
import { PrismicRichTextProps, _default as _default$2 } from "./src/PrismicRichText/PrismicRichText.vue.js";
|
|
3
3
|
import { getRichTextComponentProps } from "./src/PrismicRichText/getRichTextComponentProps.js";
|
|
4
4
|
import "./src/PrismicRichText/index.js";
|
|
5
|
+
import { VueTableComponents } from "./src/PrismicTable/types.js";
|
|
5
6
|
import { PrismicTableProps, _default as _default$3 } from "./src/PrismicTable/PrismicTable.vue.js";
|
|
6
7
|
import { getTableComponentProps_d_exports } from "./src/PrismicTable/getTableComponentProps.js";
|
|
7
8
|
import "./src/PrismicTable/index.js";
|
|
@@ -14,4 +15,5 @@ import { TODOSliceComponent } from "./src/SliceZone/TODOSliceComponent.js";
|
|
|
14
15
|
import { getSliceComponentProps } from "./src/SliceZone/getSliceComponentProps.js";
|
|
15
16
|
import { defineSliceZoneComponents } from "./src/SliceZone/defineSliceZoneComponents.js";
|
|
16
17
|
import "./src/SliceZone/index.js";
|
|
17
|
-
|
|
18
|
+
import { PrismicPlugin, PrismicPluginConfig, createPrismic, usePrismic } from "./src/createPrismic.js";
|
|
19
|
+
export { _default as PrismicImage, type PrismicImageProps, _default$1 as PrismicLink, type PrismicLinkProps, type PrismicPlugin, type PrismicPluginConfig, _default$2 as PrismicRichText, type PrismicRichTextProps, _default$3 as PrismicTable, type PrismicTableProps, _default$4 as PrismicText, type PrismicTextProps, type RichTextComponentProps, type SliceComponentProps, type SliceComponentType, type SliceLike, type SliceLikeGraphQL, type SliceLikeRestV2, _default$5 as SliceZone, type SliceZoneComponents, type SliceZoneLike, type SliceZoneProps, TODOSliceComponent, type VueRichTextComponents, type VueTableComponents, createPrismic, defineSliceZoneComponents, getRichTextComponentProps, getSliceComponentProps, getTableComponentProps_d_exports as getTableComponentProps, usePrismic };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createPrismic, usePrismic } from "./src/createPrismic.js";
|
|
1
2
|
import PrismicImage_default from "./src/PrismicImage.js";
|
|
2
3
|
import PrismicLink_default from "./src/PrismicLink.js";
|
|
3
4
|
import PrismicRichText_default from "./src/PrismicRichText/PrismicRichText.js";
|
|
@@ -10,4 +11,4 @@ import SliceZone_default from "./src/SliceZone/SliceZone.js";
|
|
|
10
11
|
import { getSliceComponentProps } from "./src/SliceZone/getSliceComponentProps.js";
|
|
11
12
|
import { defineSliceZoneComponents } from "./src/SliceZone/defineSliceZoneComponents.js";
|
|
12
13
|
|
|
13
|
-
export { PrismicImage_default as PrismicImage, PrismicLink_default as PrismicLink, PrismicRichText_default as PrismicRichText, PrismicTable_default as PrismicTable, PrismicText_default as PrismicText, SliceZone_default as SliceZone, TODOSliceComponent, defineSliceZoneComponents, getRichTextComponentProps, getSliceComponentProps, getTableComponentProps_exports as getTableComponentProps };
|
|
14
|
+
export { PrismicImage_default as PrismicImage, PrismicLink_default as PrismicLink, PrismicRichText_default as PrismicRichText, PrismicTable_default as PrismicTable, PrismicText_default as PrismicText, SliceZone_default as SliceZone, TODOSliceComponent, createPrismic, defineSliceZoneComponents, getRichTextComponentProps, getSliceComponentProps, getTableComponentProps_exports as getTableComponentProps, usePrismic };
|
package/dist/package.cjs
CHANGED
package/dist/package.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/vue\",\n\t\"version\": \"5.3.0-pr.
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/vue\",\n\t\"version\": \"5.3.0-pr.89.d0f4ac2\",\n\t\"description\": \"Vue plugin, components, and composables to fetch and present Prismic content\",\n\t\"keywords\": [\n\t\t\"typescript\",\n\t\t\"prismic\",\n\t\t\"vue\",\n\t\t\"plugin\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"ssh://git@github.com/prismicio/prismic-vue.git\"\n\t},\n\t\"license\": \"Apache-2.0\",\n\t\"author\": \"Prismic <contact@prismic.io> (https://prismic.io)\",\n\t\"sideEffects\": false,\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"require\": \"./dist/index.cjs\",\n\t\t\t\"import\": \"./dist/index.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.cts\",\n\t\"files\": [\n\t\t\"./dist\",\n\t\t\"./src\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"format\": \"prettier --write .\",\n\t\t\"prepare\": \"npm run build\",\n\t\t\"lint\": \"oxlint --deny-warnings\",\n\t\t\"types\": \"vue-tsc --noEmit\",\n\t\t\"unit\": \"vitest run --coverage\",\n\t\t\"unit:watch\": \"vitest watch\",\n\t\t\"test\": \"npm run lint && npm run types && npm run unit && npm run build\"\n\t},\n\t\"dependencies\": {\n\t\t\"esm-env\": \"^1.2.2\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@prismicio/client\": \"^7.21.0\",\n\t\t\"@prismicio/mock\": \"^0.7.1\",\n\t\t\"@trivago/prettier-plugin-sort-imports\": \"^6.0.0\",\n\t\t\"@types/jsdom-global\": \"^3.0.7\",\n\t\t\"@vitejs/plugin-vue\": \"^6.0.2\",\n\t\t\"@vitest/coverage-v8\": \"^4.0.15\",\n\t\t\"@vue/test-utils\": \"^2.4.6\",\n\t\t\"jsdom\": \"^27.3.0\",\n\t\t\"jsdom-global\": \"^3.0.2\",\n\t\t\"oxlint\": \"1.32.0\",\n\t\t\"prettier\": \"^3.7.4\",\n\t\t\"prettier-plugin-jsdoc\": \"^1.8.0\",\n\t\t\"tsdown\": \"0.17.2\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"vite\": \"^7.2.7\",\n\t\t\"vitest\": \"^4.0.15\",\n\t\t\"vue\": \"^3.5.25\",\n\t\t\"vue-router\": \"^4.6.3\",\n\t\t\"vue-tsc\": \"^3.1.8\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"@prismicio/client\": \"^7\",\n\t\t\"vue\": \"^3\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=20\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t}\n}\n"],"mappings":";;cAEY"}
|
package/dist/package.js
CHANGED
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/vue\",\n\t\"version\": \"5.3.0-pr.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@prismicio/vue\",\n\t\"version\": \"5.3.0-pr.89.d0f4ac2\",\n\t\"description\": \"Vue plugin, components, and composables to fetch and present Prismic content\",\n\t\"keywords\": [\n\t\t\"typescript\",\n\t\t\"prismic\",\n\t\t\"vue\",\n\t\t\"plugin\"\n\t],\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"ssh://git@github.com/prismicio/prismic-vue.git\"\n\t},\n\t\"license\": \"Apache-2.0\",\n\t\"author\": \"Prismic <contact@prismic.io> (https://prismic.io)\",\n\t\"sideEffects\": false,\n\t\"type\": \"module\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"require\": \"./dist/index.cjs\",\n\t\t\t\"import\": \"./dist/index.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\"\n\t},\n\t\"main\": \"./dist/index.cjs\",\n\t\"module\": \"./dist/index.js\",\n\t\"types\": \"./dist/index.d.cts\",\n\t\"files\": [\n\t\t\"./dist\",\n\t\t\"./src\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"format\": \"prettier --write .\",\n\t\t\"prepare\": \"npm run build\",\n\t\t\"lint\": \"oxlint --deny-warnings\",\n\t\t\"types\": \"vue-tsc --noEmit\",\n\t\t\"unit\": \"vitest run --coverage\",\n\t\t\"unit:watch\": \"vitest watch\",\n\t\t\"test\": \"npm run lint && npm run types && npm run unit && npm run build\"\n\t},\n\t\"dependencies\": {\n\t\t\"esm-env\": \"^1.2.2\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@prismicio/client\": \"^7.21.0\",\n\t\t\"@prismicio/mock\": \"^0.7.1\",\n\t\t\"@trivago/prettier-plugin-sort-imports\": \"^6.0.0\",\n\t\t\"@types/jsdom-global\": \"^3.0.7\",\n\t\t\"@vitejs/plugin-vue\": \"^6.0.2\",\n\t\t\"@vitest/coverage-v8\": \"^4.0.15\",\n\t\t\"@vue/test-utils\": \"^2.4.6\",\n\t\t\"jsdom\": \"^27.3.0\",\n\t\t\"jsdom-global\": \"^3.0.2\",\n\t\t\"oxlint\": \"1.32.0\",\n\t\t\"prettier\": \"^3.7.4\",\n\t\t\"prettier-plugin-jsdoc\": \"^1.8.0\",\n\t\t\"tsdown\": \"0.17.2\",\n\t\t\"typescript\": \"^5.9.3\",\n\t\t\"vite\": \"^7.2.7\",\n\t\t\"vitest\": \"^4.0.15\",\n\t\t\"vue\": \"^3.5.25\",\n\t\t\"vue-router\": \"^4.6.3\",\n\t\t\"vue-tsc\": \"^3.1.8\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"@prismicio/client\": \"^7\",\n\t\t\"vue\": \"^3\"\n\t},\n\t\"engines\": {\n\t\t\"node\": \">=20\"\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t}\n}\n"],"mappings":";cAEY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicImage.cjs","names":[],"sources":["../../src/PrismicImage.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ImageField, asImageSrc } from \"@prismicio/client\"\nimport {\n\tasImagePixelDensitySrcSet,\n\tasImageWidthSrcSet,\n\tisFilled,\n} from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { computed, watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n
|
|
1
|
+
{"version":3,"file":"PrismicImage.cjs","names":[],"sources":["../../src/PrismicImage.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ImageField, asImageSrc } from \"@prismicio/client\"\nimport {\n\tasImagePixelDensitySrcSet,\n\tasImageWidthSrcSet,\n\tisFilled,\n} from \"@prismicio/client\"\nimport { DEV } from \"esm-env\"\nimport { computed, watchEffect } from \"vue\"\n\nimport { devMsg } from \"./lib/devMsg\"\n\n/** Props for `<PrismicImage />`. */\nexport type PrismicImageProps = {\n\t/** The Prismic image field or thumbnail to render. */\n\tfield: ImageField | ImageField<string>\n\n\t/**\n\t * An object of Imgix URL API parameters to transform the image.\n\t *\n\t * See: https://docs.imgix.com/apis/rendering\n\t */\n\timgixParams?: Parameters<typeof asImageSrc>[1]\n\n\t/**\n\t * Declare an image as decorative by providing `alt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\talt?: \"\"\n\n\t/**\n\t * Declare an image as decorative only if the image field does not have\n\t * alternative text by providing `fallbackAlt=\"\"`.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/alt#decorative_images\n\t */\n\tfallbackAlt?: \"\"\n\n\t/**\n\t * The width attribute of the image element.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/width\n\t */\n\twidth?: number | string\n\n\t/**\n\t * The height attribute of the image element.\n\t *\n\t * See:\n\t * https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/height\n\t */\n\theight?: number | string\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * Widths (in pixels) used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If omitted or set to `\"defaults\"`, the following widths will be used:\n\t\t\t * 640, 750, 828, 1080, 1200, 1920, 2048, 3840.\n\t\t\t *\n\t\t\t * If the image field contains responsive views, each responsive view can\n\t\t\t * be used as a width in the resulting `srcset` by passing `\"thumbnails\"`\n\t\t\t * as the `widths` prop.\n\t\t\t */\n\t\t\twidths?:\n\t\t\t\t| NonNullable<Parameters<typeof asImageWidthSrcSet>[1]>[\"widths\"]\n\t\t\t\t| \"thumbnails\"\n\t\t\t\t| \"defaults\"\n\t\t\tpixelDensities?: never\n\t }\n\t| {\n\t\t\twidths?: never\n\t\t\t/**\n\t\t\t * Pixel densities used to build a `srcset` value for the image field.\n\t\t\t *\n\t\t\t * If a `pixelDensities` prop is passed `\"defaults\"`, the following pixel\n\t\t\t * densities will be used: 1, 2, 3.\n\t\t\t */\n\t\t\tpixelDensities:\n\t\t\t\t| NonNullable<\n\t\t\t\t\t\tParameters<typeof asImagePixelDensitySrcSet>[1]\n\t\t\t\t >[\"pixelDensities\"]\n\t\t\t\t| \"defaults\"\n\t }\n)\n\nconst props = defineProps<PrismicImageProps>()\ndefineOptions({ name: \"PrismicImage\" })\n\nif (DEV) {\n\twatchEffect(() => {\n\t\tif (typeof props.alt === \"string\" && props.alt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"alt\" prop can only be used to declare an image as decorative by passing an empty string (alt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"alt\" prop or changing it to alt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (typeof props.fallbackAlt === \"string\" && props.fallbackAlt !== \"\") {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] The \"fallbackAlt\" prop can only be used to declare an image as decorative by passing an empty string (fallbackAlt=\"\") but was provided a non-empty string. You can resolve this warning by removing the \"fallbackAlt\" prop or changing it to fallbackAlt=\"\". For more details, see ${devMsg(\n\t\t\t\t\t\"alt-must-be-an-empty-string\",\n\t\t\t\t)}`,\n\t\t\t)\n\t\t}\n\n\t\tif (props.widths && props.pixelDensities) {\n\t\t\tconsole.warn(\n\t\t\t\t`[PrismicImage] Only one of \"widths\" or \"pixelDensities\" props can be provided. You can resolve this warning by removing either the \"widths\" or \"pixelDensities\" prop. \"widths\" will be used in this case.`,\n\t\t\t)\n\t\t}\n\t})\n}\n\nconst castInt = (input: string | number | undefined): number | undefined => {\n\tif (typeof input === \"number\" || typeof input === \"undefined\") {\n\t\treturn input\n\t} else {\n\t\tconst parsed = Number.parseInt(input)\n\n\t\tif (Number.isNaN(parsed)) {\n\t\t\treturn undefined\n\t\t} else {\n\t\t\treturn parsed\n\t\t}\n\t}\n}\n\nconst image = computed(() => {\n\tif (!isFilled.imageThumbnail(props.field)) {\n\t\treturn\n\t}\n\n\tlet src: string | undefined\n\tlet srcSet: string | undefined\n\tif (props.widths || !props.pixelDensities) {\n\t\tconst res = asImageWidthSrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\twidths: props.widths === \"defaults\" ? undefined : props.widths,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t} else if (props.pixelDensities) {\n\t\tconst res = asImagePixelDensitySrcSet(props.field, {\n\t\t\t...props.imgixParams,\n\t\t\tpixelDensities:\n\t\t\t\tprops.pixelDensities === \"defaults\" ? undefined : props.pixelDensities,\n\t\t})\n\n\t\tsrc = res.src\n\t\tsrcSet = res.srcset\n\t}\n\n\tconst ar = props.field.dimensions.width / props.field.dimensions.height\n\n\tconst castedWidth = castInt(props.width)\n\tconst castedHeight = castInt(props.height)\n\n\tlet resolvedWidth = castedWidth ?? props.field.dimensions.width\n\tlet resolvedHeight = castedHeight ?? props.field.dimensions.height\n\n\tif (castedWidth != null && castedHeight == null) {\n\t\tresolvedHeight = castedWidth / ar\n\t} else if (castedWidth == null && castedHeight != null) {\n\t\tresolvedWidth = castedHeight * ar\n\t}\n\n\treturn {\n\t\tsrc,\n\t\tsrcSet,\n\t\talt: props.alt ?? (props.field.alt || props.fallbackAlt),\n\t\twidth: Math.round(resolvedWidth),\n\t\theight: Math.round(resolvedHeight),\n\t}\n})\n</script>\n\n<template>\n\t<img\n\t\tv-if=\"image\"\n\t\t:src=\"image.src\"\n\t\t:srcset=\"image.srcSet\"\n\t\t:alt=\"image.alt\"\n\t\t:width=\"image.width\"\n\t\t:height=\"image.height\"\n\t/>\n</template>\n"],"mappings":""}
|