@prismicio/vue 5.3.0-pr.89.d0f4ac2 → 5.3.0-pr.89.ff3a515
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/README.md +8 -10
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +2 -2
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.cts +28 -22
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +3 -3
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.cts +15 -15
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/SliceZone/types.d.cts +2 -2
- package/dist/SliceZone/types.d.cts.map +1 -1
- package/dist/createPrismic.d.cts +23 -14
- package/dist/createPrismic.d.cts.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- 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.vue.d.ts.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +4 -4
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs.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.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +5 -5
- 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 +3 -3
- 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 +6 -6
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +5 -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 +4 -4
- 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.map +1 -1
- 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.map +1 -1
- 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 +28 -22
- 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 -5
- package/dist/src/PrismicTable/PrismicTable.vue.d.ts.map +1 -1
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.cjs +5 -5
- 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 +4 -4
- 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.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 -1
- package/dist/src/PrismicTable/types.d.ts +15 -15
- package/dist/src/PrismicTable/types.d.ts.map +1 -1
- package/dist/src/PrismicText.vue.d.ts.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +2 -2
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs.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.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/SliceZone/types.d.ts +2 -2
- package/dist/src/SliceZone/types.d.ts.map +1 -1
- package/dist/src/createPrismic.cjs +4 -3
- package/dist/src/createPrismic.cjs.map +1 -1
- package/dist/src/createPrismic.d.ts +23 -14
- package/dist/src/createPrismic.d.ts.map +1 -1
- package/dist/src/createPrismic.js +2 -1
- package/dist/src/createPrismic.js.map +1 -1
- package/dist/src/types.cjs +2 -2
- package/dist/src/types.cjs.map +1 -1
- package/dist/src/types.d.ts +5 -5
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +2 -2
- package/dist/src/types.js.map +1 -1
- package/dist/types.d.cts +5 -5
- package/dist/types.d.cts.map +1 -1
- package/package.json +11 -11
- package/src/PrismicLink.vue +4 -4
- package/src/PrismicRichText/PrismicRichText.vue +13 -13
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +2 -2
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +2 -2
- package/src/PrismicRichText/index.ts +1 -1
- package/src/PrismicRichText/types.ts +28 -32
- package/src/PrismicTable/PrismicTable.vue +12 -12
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +2 -2
- package/src/PrismicTable/PrismicTableRow.vue +4 -4
- package/src/PrismicTable/index.ts +1 -1
- package/src/PrismicTable/types.ts +27 -27
- package/src/SliceZone/SliceZone.vue +8 -1
- package/src/SliceZone/types.ts +3 -13
- package/src/createPrismic.ts +30 -18
- package/src/index.ts +2 -5
- package/src/types.ts +8 -23
package/README.md
CHANGED
|
@@ -15,11 +15,11 @@ Replace all on all files (README.md, CONTRIBUTING.md, bug_report.md, package.jso
|
|
|
15
15
|
|
|
16
16
|
<!-- Replacing link to Prismic with [Prismic][prismic] is useful here -->
|
|
17
17
|
|
|
18
|
-
[Vue][vue] plugin, components, and composables to fetch and present [Prismic][prismic] content.
|
|
18
|
+
[Vue][vue-docs] plugin, components, and composables to fetch and present [Prismic][prismic] content.
|
|
19
19
|
|
|
20
|
-
- 📝 Display content from Prismic like [
|
|
21
|
-
- 🍡 Render Prismic [
|
|
22
|
-
- 🎣 Fetch Prismic content
|
|
20
|
+
- 📝 Display content from Prismic like [rich text][prismic-rich-text] and [link][prismic-link] fields.
|
|
21
|
+
- 🍡 Render Prismic [slice zones][prismic-slices] declaratively with Vue components.
|
|
22
|
+
- 🎣 Fetch Prismic content throughout your Vue application.
|
|
23
23
|
|
|
24
24
|
## Install
|
|
25
25
|
|
|
@@ -70,14 +70,12 @@ For more clarity on this project and its structure you can also check out the de
|
|
|
70
70
|
<!-- Replace link with a more useful one if available -->
|
|
71
71
|
|
|
72
72
|
[prismic-docs]: https://prismic.io/docs/technical-reference/prismicio-vue/v5
|
|
73
|
+
[vue-docs]: https://vuejs.org
|
|
73
74
|
[changelog]: ./CHANGELOG.md
|
|
74
75
|
[contributing]: ./CONTRIBUTING.md
|
|
75
|
-
[
|
|
76
|
-
[prismic-
|
|
77
|
-
[prismic-
|
|
78
|
-
[prismic-slices]: https://prismic.io/docs/core-concepts/slices
|
|
79
|
-
[vue-composition]: https://v3.vuejs.org/guide/composition-api-introduction.html
|
|
80
|
-
[vue-options]: https://v3.vuejs.org/guide/introduction.html
|
|
76
|
+
[prismic-rich-text]: https://prismic.io/docs/fields/rich-text
|
|
77
|
+
[prismic-link]: https://prismic.io/docs/fields/link
|
|
78
|
+
[prismic-slices]: https://prismic.io/docs/slices
|
|
81
79
|
|
|
82
80
|
<!-- Replace link with a more useful one if available -->
|
|
83
81
|
|
|
@@ -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":";;;;;KAgNY,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;;;;;;;;;;EAsMH,MAAA,CAAA,EAhJZ,WAgJY,CAhJA,UAgJA,CAAA,OAhJkB,kBAgJlB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,GAAA,YAAA,GAAA,UAAA;EAAA,cAGsB,CAAA,EAAA,KAAZ;;;;;;;;;kBArItB,YACA,kBAAkB;;cAiIlB,oBAAY;;SAtMV,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;;cAiIN,iBAGU"}
|
|
@@ -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":";;;;;;KAyJY,gBAAA;EAAA;;;;;;;;AA8CX;EAkFI,YAAA,CAAA,EAtHW,oBAuHoB;EAK9B;;;;;EAhGI,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;;;;UA2FG,EA3FH,eA2FG;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;;;;;;;;;iBAjIW;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;oBAAe,KAAA,CAAA,qBAAA;;;;;;;;;;iBAjCZ;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;;cA8FP,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { RichTextComponents } from "./types.cjs";
|
|
3
3
|
import * as vue0 from "vue";
|
|
4
4
|
import { PropType } from "vue";
|
|
5
5
|
import { LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
@@ -33,7 +33,7 @@ type PrismicRichTextProps = {
|
|
|
33
33
|
* }
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
components?:
|
|
36
|
+
components?: RichTextComponents;
|
|
37
37
|
/**
|
|
38
38
|
* The value to be rendered when the field is empty. If a fallback is not
|
|
39
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":";;;;;;;;KAwKY,oBAAA;;EAAA,KAAA,EAEJ,aAFI,GAAoB,IAAA,GAAA,SAAA;EAExB;;;;;AAkCP;;;;EA6HmB,YAAA,CAAA,EApJJ,oBAoJI;EAGO;;;;;;;;;;;;;;EAIxB,UAAA,CAAA,EA3IW,kBA2IX;EADmC;;;;aApI1B;;cAwHN,YAAY,OAAA,eAAA,CAY4B,IAAA,CAZ5B,gBAAA,CAAA;EAAA,KAAA,EAAA;UAGU,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;oBAbe,IAAA,CAAA,qBAAA,qEAY4B,IAAA,CAAA;;UATlB,SAAS;;;UAGjB,SAAS;;;UAGX,SAAS;;;UAGW,SACnC;;;cAbe,iBAkBU"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, ComponentShorthand } from "../types.cjs";
|
|
2
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
|
|
@@ -9,31 +9,37 @@ import { LinkResolverFunction, RTAnyNode, RTEmNode, RTEmbedNode, RTHeading1Node,
|
|
|
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
|
-
heading1?:
|
|
14
|
-
heading2?:
|
|
15
|
-
heading3?:
|
|
16
|
-
heading4?:
|
|
17
|
-
heading5?:
|
|
18
|
-
heading6?:
|
|
19
|
-
paragraph?:
|
|
20
|
-
preformatted?:
|
|
21
|
-
strong?:
|
|
22
|
-
em?:
|
|
23
|
-
listItem?:
|
|
24
|
-
oListItem?:
|
|
25
|
-
list?:
|
|
26
|
-
oList?:
|
|
27
|
-
image?:
|
|
28
|
-
embed?:
|
|
29
|
-
hyperlink?:
|
|
30
|
-
label?:
|
|
31
|
-
span?:
|
|
12
|
+
type RichTextComponents = {
|
|
13
|
+
heading1?: RichTextComponent<RTHeading1Node> | ComponentShorthand;
|
|
14
|
+
heading2?: RichTextComponent<RTHeading2Node> | ComponentShorthand;
|
|
15
|
+
heading3?: RichTextComponent<RTHeading3Node> | ComponentShorthand;
|
|
16
|
+
heading4?: RichTextComponent<RTHeading4Node> | ComponentShorthand;
|
|
17
|
+
heading5?: RichTextComponent<RTHeading5Node> | ComponentShorthand;
|
|
18
|
+
heading6?: RichTextComponent<RTHeading6Node> | ComponentShorthand;
|
|
19
|
+
paragraph?: RichTextComponent<RTParagraphNode> | ComponentShorthand;
|
|
20
|
+
preformatted?: RichTextComponent<RTPreformattedNode> | ComponentShorthand;
|
|
21
|
+
strong?: RichTextComponent<RTStrongNode> | ComponentShorthand;
|
|
22
|
+
em?: RichTextComponent<RTEmNode> | ComponentShorthand;
|
|
23
|
+
listItem?: RichTextComponent<RTListItemNode> | ComponentShorthand;
|
|
24
|
+
oListItem?: RichTextComponent<RTOListItemNode> | ComponentShorthand;
|
|
25
|
+
list?: RichTextComponent<RTListNode> | ComponentShorthand;
|
|
26
|
+
oList?: RichTextComponent<RTOListNode> | ComponentShorthand;
|
|
27
|
+
image?: RichTextComponent<RTImageNode> | Omit<ComponentShorthand, "as">;
|
|
28
|
+
embed?: RichTextComponent<RTEmbedNode> | ComponentShorthand;
|
|
29
|
+
hyperlink?: RichTextComponent<RTLinkNode> | Omit<ComponentShorthand, "as">;
|
|
30
|
+
label?: RichTextComponent<RTLabelNode> | Omit<ComponentShorthand, "as">;
|
|
31
|
+
span?: RichTextComponent<RTSpanNode>;
|
|
32
32
|
};
|
|
33
33
|
/** Props for a component rendering nodes from a Prismic rich text field. */
|
|
34
34
|
type RichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {
|
|
35
35
|
node: TRTNode;
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* A Vue component rendering a node from a Prismic rich text field.
|
|
39
|
+
*
|
|
40
|
+
* @typeParam TRTNode - The type of rich text node(s) this component handles
|
|
41
|
+
*/
|
|
42
|
+
type RichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> = Component<RichTextComponentProps<TRTNode>>;
|
|
37
43
|
//#endregion
|
|
38
|
-
export { RichTextComponentProps,
|
|
44
|
+
export { RichTextComponentProps, RichTextComponents };
|
|
39
45
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAiCA;;;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAiCA;;;;AAE8B,KAFlB,kBAAA,GAEkB;EAAlB,QAAA,CAAA,EADA,iBACA,CADkB,cAClB,CAAA,GADoC,kBACpC;EAAoC,QAAA,CAAA,EAApC,iBAAoC,CAAlB,cAAkB,CAAA,GAAA,kBAAA;EAClB,QAAA,CAAA,EAAlB,iBAAkB,CAAA,cAAA,CAAA,GAAkB,kBAAlB;EAAlB,QAAA,CAAA,EACA,iBADA,CACkB,cADlB,CAAA,GACoC,kBADpC;EAAoC,QAAA,CAAA,EAEpC,iBAFoC,CAElB,cAFkB,CAAA,GAEA,kBAFA;EAClB,QAAA,CAAA,EAElB,iBAFkB,CAEA,cAFA,CAAA,GAEkB,kBAFlB;EAAlB,SAAA,CAAA,EAGC,iBAHD,CAGmB,eAHnB,CAAA,GAGsC,kBAHtC;EAAoC,YAAA,CAAA,EAK5C,iBAL4C,CAK1B,kBAL0B,CAAA,GAM5C,kBAN4C;EAClB,MAAA,CAAA,EAMpB,iBANoB,CAMF,YANE,CAAA,GAMc,kBANd;EAAlB,EAAA,CAAA,EAON,iBAPM,CAOY,QAPZ,CAAA,GAOwB,kBAPxB;EAAoC,QAAA,CAAA,EAQpC,iBARoC,CAQlB,cARkB,CAAA,GAQA,kBARA;EAClB,SAAA,CAAA,EAQjB,iBARiB,CAQC,eARD,CAAA,GAQoB,kBARpB;EAAlB,IAAA,CAAA,EASJ,iBATI,CASc,UATd,CAAA,GAS4B,kBAT5B;EAAoC,KAAA,CAAA,EAUvC,iBAVuC,CAUrB,WAVqB,CAAA,GAUN,kBAVM;EACjB,KAAA,CAAA,EAUtB,iBAVsB,CAUJ,WAVI,CAAA,GAUW,IAVX,CAUgB,kBAVhB,EAAA,IAAA,CAAA;EAAlB,KAAA,CAAA,EAWJ,iBAXI,CAWc,WAXd,CAAA,GAW6B,kBAX7B;EAAqC,SAAA,CAAA,EAa9C,iBAb8C,CAa5B,UAb4B,CAAA,GAc9C,IAd8C,CAczC,kBAdyC,EAAA,IAAA,CAAA;EAE5B,KAAA,CAAA,EAab,iBAba,CAaK,WAbL,CAAA,GAaoB,IAbpB,CAayB,kBAbzB,EAAA,IAAA,CAAA;EAAlB,IAAA,CAAA,EAcI,iBAdJ,CAcsB,UAdtB,CAAA;CACA;;AACM,KAgBE,sBAhBF,CAAA,gBAgByC,SAhBzC,GAgBqD,SAhBrD,CAAA,GAAA;EAAkC,IAAA,EAiBrC,OAjBqC;CACpB;;;;;;AAEO,KAsBnB,iBAtBmB,CAAA,gBAsBe,SAtBf,GAsB2B,SAtB3B,CAAA,GAuB9B,SAvB8B,CAuBpB,sBAvBoB,CAuBG,OAvBH,CAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "../types.cjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { RichTextComponents } from "../PrismicRichText/types.cjs";
|
|
3
|
+
import { TableComponents } from "./types.cjs";
|
|
4
4
|
import * as vue6 from "vue";
|
|
5
5
|
import { TableField } from "@prismicio/client";
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ type PrismicTableProps = {
|
|
|
23
23
|
* }
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
components?:
|
|
26
|
+
components?: TableComponents & RichTextComponents;
|
|
27
27
|
/**
|
|
28
28
|
* The value to be rendered when the field is empty. If a fallback is not
|
|
29
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":";;;;;;;;KAoIY,iBAAA;;EAAA,KAAA,EAEJ,UAFI,GAAiB,SAAA;EAErB;;;;;AAuBP;;;;;;;;;EA2JiB,UAAA,CAAA,EAlKJ,eAkKI,GAlKc,kBAkKd;EAAA;AAAA;;;aA5JN;;cA4JN,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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component, ComponentShorthand } from "../types.cjs";
|
|
2
2
|
import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, TableFieldHead, TableFieldHeadRow, TableFieldHeaderCell } from "@prismicio/client";
|
|
3
3
|
|
|
4
4
|
//#region src/PrismicTable/types.d.ts
|
|
@@ -9,26 +9,26 @@ import { TableField, TableFieldBody, TableFieldBodyRow, TableFieldDataCell, Tabl
|
|
|
9
9
|
*
|
|
10
10
|
* @see Templating Table fields from Prismic {@link https://prismic.io/docs/table}
|
|
11
11
|
*/
|
|
12
|
-
type
|
|
13
|
-
table?:
|
|
12
|
+
type TableComponents = {
|
|
13
|
+
table?: Component<{
|
|
14
14
|
table: TableField<"filled">;
|
|
15
|
-
}> | Omit<
|
|
16
|
-
thead?:
|
|
15
|
+
}> | Omit<ComponentShorthand, "as">;
|
|
16
|
+
thead?: Component<{
|
|
17
17
|
head: TableFieldHead;
|
|
18
|
-
}> | Omit<
|
|
19
|
-
tbody?:
|
|
18
|
+
}> | Omit<ComponentShorthand, "as">;
|
|
19
|
+
tbody?: Component<{
|
|
20
20
|
body: TableFieldBody;
|
|
21
|
-
}> | Omit<
|
|
22
|
-
tr?:
|
|
21
|
+
}> | Omit<ComponentShorthand, "as">;
|
|
22
|
+
tr?: Component<{
|
|
23
23
|
row: TableFieldBodyRow | TableFieldHeadRow;
|
|
24
|
-
}> | Omit<
|
|
25
|
-
th?:
|
|
24
|
+
}> | Omit<ComponentShorthand, "as">;
|
|
25
|
+
th?: Component<{
|
|
26
26
|
cell: TableFieldHeaderCell;
|
|
27
|
-
}> | Omit<
|
|
28
|
-
td?:
|
|
27
|
+
}> | Omit<ComponentShorthand, "as">;
|
|
28
|
+
td?: Component<{
|
|
29
29
|
cell: TableFieldDataCell;
|
|
30
|
-
}> | Omit<
|
|
30
|
+
}> | Omit<ComponentShorthand, "as">;
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
|
33
|
-
export {
|
|
33
|
+
export { TableComponents };
|
|
34
34
|
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;;;;AAGI,KAHQ,
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/PrismicTable/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;;;;AAGI,KAHQ,eAAA,GAGR;EAEkB,KAAA,CAAA,EAHlB,SAGkB,CAAA;IAAlB,KAAA,EAHmB,UAGnB,CAAA,QAAA,CAAA;EACK,CAAA,CAAA,GAHL,IAGK,CAHA,kBAGA,EAAA,IAAA,CAAA;EAAL,KAAA,CAAA,EADA,SACA,CAAA;IAEkB,IAAA,EAHA,cAGA;EAAlB,CAAA,CAAA,GAFA,IAEA,CAFK,kBAEL,EAAA,IAAA,CAAA;EACK,KAAA,CAAA,EADL,SACK,CAAA;IAAL,IAAA,EADkB,cAClB;EAEiB,CAAA,CAAA,GAFjB,IAEiB,CAFZ,kBAEY,EAAA,IAAA,CAAA;EAAoB,EAAA,CAAA,EAArC,SAAqC,CAAA;IAArC,GAAA,EAAiB,iBAAjB,GAAqC,iBAArC;EACK,CAAA,CAAA,GAAL,IAAK,CAAA,kBAAA,EAAA,IAAA,CAAA;EAAL,EAAA,CAAA,EAEA,SAFA,CAAA;IAEkB,IAAA,EAAA,oBAAA;EAAlB,CAAA,CAAA,GACA,IADA,CACK,kBADL,EAAA,IAAA,CAAA;EACK,EAAA,CAAA,EAEL,SAFK,CAAA;IAAL,IAAA,EAEkB,kBAFlB;EAEkB,CAAA,CAAA,GAClB,IADkB,CACb,kBADa,EAAA,IAAA,CAAA;CAAlB"}
|
|
@@ -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":";;;;;KAyDY,gBAAA;;EAAA,KAAA,EAEJ,aAFoB,GAAA,IAAA,GAAA,SAEpB;EAoDF;;;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceZone.vue.d.cts","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"SliceZone.vue.d.cts","names":[],"sources":["../../src/SliceZone/SliceZone.vue"],"sourcesContent":[],"mappings":";;;;;;;;AA+GA;;AAEoC,KAFxB,cAEwB,CAAA,WAAA,OAAA,CAAA,GAAA;EAAY;EAAvC,MAAA,EAAA,aAAA,CAAc,SAAd,GAAA,CAA2B,SAA3B,GAAuC,MAAvC,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,CAAA;EAGK;EAO8B,UAAA,CAAA,EAP9B,mBAO8B;EAAxB;;;AAInB;EAkFK,gBAEJ,CAAA,EAxFkB,kBAwFlB,CAAA,GAAA,EAxF0C,QAwF1C,CAAA;EAFgB;EAAA,OAAA,CAAA,EAnFP,QAmFO;CAAA;KAhFb,WAAA,GAAc,cAgFD;cAAZ,YAAY,EAAA,KAAA,CAAA,eAAA,CAAA,WAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,WAAA,EAAA,QAAA,CAAA,WAAA,CAAA,GAAA,QAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,MAAA,EAAA,KAAA,CAAA,uBAAA,EAAA,KAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA;cAAA,QAAA,EAAA,OAGU,YAHV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component } from "../types.cjs";
|
|
2
2
|
import { Slice } from "@prismicio/client";
|
|
3
3
|
|
|
4
4
|
//#region src/SliceZone/types.d.ts
|
|
@@ -80,7 +80,7 @@ type SliceComponentProps<TSlice extends SliceLike = SliceLike, TContext = unknow
|
|
|
80
80
|
* @typeParam TSlice - The type(s) of slices in the Slice Zone
|
|
81
81
|
* @typeParam TContext - Arbitrary data made available to all Slice components
|
|
82
82
|
*/
|
|
83
|
-
type SliceComponentType<TSlice extends SliceLike = any, TContext = unknown> =
|
|
83
|
+
type SliceComponentType<TSlice extends SliceLike = any, TContext = unknown> = Component<SliceComponentProps<TSlice, TContext>>;
|
|
84
84
|
/**
|
|
85
85
|
* A record of Slice types mapped to Vue components. Each components will be
|
|
86
86
|
* rendered for each instance of their Slice type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/SliceZone/types.ts"],"sourcesContent":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../../src/SliceZone/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAEyC;;;KAOpC,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;;;;;;;AAaA;;;AAciC,KAtErB,aAsEqB,CAAA,eAtEQ,SAsER,GAtEoB,SAsEpB,CAAA,GAAA,SArEvB,MAqEuB,EAAA;;;;;;;;;AAIT,KA/DZ,mBA+DY,CAAA,eA9DR,SA8DQ,GA9DI,SA8DJ,EAAA,WAAA,OAAA,CAAA,GAAA;EAAhB;EACH,KAAA,EA3DG,MA2DH;EAJA;EAAkB,KAAA,EAAA,MAAA;;UA7Cd,cACP,eAAe,mBAAmB,mBAAmB;;;;;WAO7C;;;;;;;;KASE,kCAEI,uCAEZ,UAAU,oBAAoB,QAAQ;;;;;;;;KAS9B,mCACI,YAAY,iDAaZ,iBAAiB,UAC5B,mBACA,QAAQ,QAAQ,UAAU,4BACvB,YACA,QAAQ,QAAQ,UAAU,aAC7B"}
|
package/dist/createPrismic.d.cts
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
import { ComponentOrTagName } from "./types.cjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { RichTextComponents } from "./PrismicRichText/types.cjs";
|
|
3
|
+
import { TableComponents } from "./PrismicTable/types.cjs";
|
|
4
4
|
import { App } from "vue";
|
|
5
|
-
import { CreateClient, isFilled } from "@prismicio/client";
|
|
5
|
+
import { CreateClient, LinkResolverFunction, isFilled } from "@prismicio/client";
|
|
6
6
|
|
|
7
7
|
//#region src/createPrismic.d.ts
|
|
8
8
|
/** Components configuration. */
|
|
9
9
|
type ComponentsConfig = {
|
|
10
|
+
/**
|
|
11
|
+
* The default link resolver used to resolve links.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://prismic.io/docs/routes}
|
|
14
|
+
*/
|
|
15
|
+
linkResolver?: LinkResolverFunction;
|
|
10
16
|
/** The default component rendered for internal URLs. */
|
|
11
17
|
linkInternalComponent?: ComponentOrTagName;
|
|
12
18
|
/** The default component rendered for external URLs. */
|
|
13
19
|
linkExternalComponent?: ComponentOrTagName;
|
|
14
20
|
/**
|
|
15
|
-
* The default components or shorthand definitions for
|
|
16
|
-
*
|
|
21
|
+
* The default components or shorthand definitions for rich text and table
|
|
22
|
+
* components.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link https://prismic.io/docs/fields/rich-text}
|
|
25
|
+
* @see {@link https://prismic.io/docs/fields/table}
|
|
17
26
|
*/
|
|
18
|
-
defaultComponents?:
|
|
27
|
+
defaultComponents?: RichTextComponents & TableComponents;
|
|
28
|
+
};
|
|
29
|
+
/** Prismic Vue plugin configuration. */
|
|
30
|
+
type PrismicPluginConfig = {
|
|
31
|
+
/** A Prismic client instance to inject into the Vue app. */
|
|
32
|
+
client: ReturnType<CreateClient>;
|
|
33
|
+
/** Components configuration. */
|
|
34
|
+
components?: ComponentsConfig;
|
|
19
35
|
};
|
|
20
36
|
/**
|
|
21
37
|
* Prismic Vue plugin interface accessible through `usePrismic()` and
|
|
@@ -27,17 +43,10 @@ type PrismicPlugin = {
|
|
|
27
43
|
/** Helpers to determine if a field is filled. */
|
|
28
44
|
isFilled: typeof isFilled;
|
|
29
45
|
/** @internal */
|
|
30
|
-
readonly
|
|
46
|
+
readonly components: ComponentsConfig;
|
|
31
47
|
/** @internal */
|
|
32
48
|
install: (app: App) => void;
|
|
33
49
|
};
|
|
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
50
|
/** Creates a Prismic Vue plugin instance that can be used by a Vue app. */
|
|
42
51
|
declare const createPrismic: (config: PrismicPluginConfig) => PrismicPlugin;
|
|
43
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPrismic.d.cts","names":[],"sources":["../src/createPrismic.ts"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"createPrismic.d.cts","names":[],"sources":["../src/createPrismic.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAQqD,KAOhD,gBAAA,GAAgB;EAML;;;;;EAeyC,YAAA,CAAA,EAfzC,oBAeyC;EAI7C;EAEQ,qBAAA,CAAA,EAlBK,kBAkBL;EAAX;EAGK,qBAAA,CAAA,EAlBW,kBAkBX;EAAgB;AAO9B;;;;;;EAWmB,iBAAA,CAAA,EA3BE,kBA2BF,GA3BuB,eA2BvB;AAInB,CAAA;AAqBA;AAEC,KAlDW,mBAAA,GAkDX;EAAA;QAKW,EArDH,UAqDgB,CArDL,YAqDK,CAAA;EAAA;EAAA,UAAA,CAAA,EAlDX,gBAkDW;;;;;;KA3Cb,aAAA;;UAEH,WAAW;;mBAGF;;uBAGI;;iBAGN;;;cAIH,wBAAyB,wBAAsB;;;;;;;;;;cAqB/C,kBAAiB;;;;cAOlB"}
|
package/dist/index.cjs
CHANGED
|
@@ -11,12 +11,12 @@ const require_SliceZone = require('./src/SliceZone/SliceZone.cjs');
|
|
|
11
11
|
const require_getSliceComponentProps = require('./src/SliceZone/getSliceComponentProps.cjs');
|
|
12
12
|
const require_defineSliceZoneComponents = require('./src/SliceZone/defineSliceZoneComponents.cjs');
|
|
13
13
|
|
|
14
|
-
exports.PrismicImage = require_PrismicImage
|
|
15
|
-
exports.PrismicLink = require_PrismicLink
|
|
16
|
-
exports.PrismicRichText = require_PrismicRichText
|
|
17
|
-
exports.PrismicTable = require_PrismicTable
|
|
18
|
-
exports.PrismicText = require_PrismicText
|
|
19
|
-
exports.SliceZone = require_SliceZone
|
|
14
|
+
exports.PrismicImage = require_PrismicImage;
|
|
15
|
+
exports.PrismicLink = require_PrismicLink;
|
|
16
|
+
exports.PrismicRichText = require_PrismicRichText;
|
|
17
|
+
exports.PrismicTable = require_PrismicTable;
|
|
18
|
+
exports.PrismicText = require_PrismicText;
|
|
19
|
+
exports.SliceZone = require_SliceZone;
|
|
20
20
|
exports.TODOSliceComponent = require_TODOSliceComponent.TODOSliceComponent;
|
|
21
21
|
exports.createPrismic = require_createPrismic.createPrismic;
|
|
22
22
|
exports.defineSliceZoneComponents = require_defineSliceZoneComponents.defineSliceZoneComponents;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RichTextComponentProps,
|
|
1
|
+
import { RichTextComponentProps, RichTextComponents } 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 {
|
|
4
|
+
import { TableComponents } from "./PrismicTable/types.cjs";
|
|
5
5
|
import { PrismicTableProps, _default as _default$3 } from "./PrismicTable/PrismicTable.vue.cjs";
|
|
6
6
|
import { getTableComponentProps_d_exports } from "./PrismicTable/getTableComponentProps.cjs";
|
|
7
7
|
import { PrismicImageProps, _default } from "./PrismicImage.vue.cjs";
|
|
@@ -13,4 +13,4 @@ import { TODOSliceComponent } from "./SliceZone/TODOSliceComponent.cjs";
|
|
|
13
13
|
import { getSliceComponentProps } from "./SliceZone/getSliceComponentProps.cjs";
|
|
14
14
|
import { defineSliceZoneComponents } from "./SliceZone/defineSliceZoneComponents.cjs";
|
|
15
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
|
|
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 RichTextComponents, type SliceComponentProps, type SliceComponentType, type SliceLike, type SliceLikeGraphQL, type SliceLikeRestV2, _default$5 as SliceZone, type SliceZoneComponents, type SliceZoneLike, type SliceZoneProps, TODOSliceComponent, type TableComponents, createPrismic, defineSliceZoneComponents, getRichTextComponentProps, getSliceComponentProps, getTableComponentProps_d_exports as getTableComponentProps, usePrismic };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RichTextComponentProps,
|
|
1
|
+
import { RichTextComponentProps, RichTextComponents } 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 {
|
|
5
|
+
import { TableComponents } from "./src/PrismicTable/types.js";
|
|
6
6
|
import { PrismicTableProps, _default as _default$3 } from "./src/PrismicTable/PrismicTable.vue.js";
|
|
7
7
|
import { getTableComponentProps_d_exports } from "./src/PrismicTable/getTableComponentProps.js";
|
|
8
8
|
import "./src/PrismicTable/index.js";
|
|
@@ -16,4 +16,4 @@ import { getSliceComponentProps } from "./src/SliceZone/getSliceComponentProps.j
|
|
|
16
16
|
import { defineSliceZoneComponents } from "./src/SliceZone/defineSliceZoneComponents.js";
|
|
17
17
|
import "./src/SliceZone/index.js";
|
|
18
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
|
|
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 RichTextComponents, type SliceComponentProps, type SliceComponentType, type SliceLike, type SliceLikeGraphQL, type SliceLikeRestV2, _default$5 as SliceZone, type SliceZoneComponents, type SliceZoneLike, type SliceZoneProps, TODOSliceComponent, type TableComponents, createPrismic, defineSliceZoneComponents, getRichTextComponentProps, getSliceComponentProps, getTableComponentProps_d_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":["
|
|
1
|
+
{"version":3,"file":"package.cjs","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
package/dist/package.js
CHANGED
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../package.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicImage.vue.d.ts","names":[],"sources":["../../src/PrismicImage.vue"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"PrismicImage.vue.d.ts","names":[],"sources":["../../src/PrismicImage.vue"],"sourcesContent":[],"mappings":";;;;;KAgNY,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;;;;;;;;;;EAsMH,MAAA,CAAA,EAhJZ,WAgJY,CAhJA,UAgJA,CAAA,OAhJkB,kBAgJlB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,GAAA,YAAA,GAAA,UAAA;EAAA,cAGsB,CAAA,EAAA,KAAA;;;;;;;;;kBArIlC,YACA,kBAAkB;;cAiIlB,oBAAY;;SAtMV,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;;cAiIN,iBAGU"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_devMsg = require('./lib/devMsg.cjs');
|
|
2
2
|
let vue = require("vue");
|
|
3
|
-
let
|
|
3
|
+
let _prismicio_client = require("@prismicio/client");
|
|
4
4
|
let esm_env = require("esm-env");
|
|
5
5
|
|
|
6
6
|
//#region src/PrismicImage.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -64,18 +64,18 @@ var PrismicImage_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
const image = (0, vue.computed)(() => {
|
|
67
|
-
if (!
|
|
67
|
+
if (!_prismicio_client.isFilled.imageThumbnail(props.field)) return;
|
|
68
68
|
let src;
|
|
69
69
|
let srcSet;
|
|
70
70
|
if (props.widths || !props.pixelDensities) {
|
|
71
|
-
const res = (0,
|
|
71
|
+
const res = (0, _prismicio_client.asImageWidthSrcSet)(props.field, {
|
|
72
72
|
...props.imgixParams,
|
|
73
73
|
widths: props.widths === "defaults" ? void 0 : props.widths
|
|
74
74
|
});
|
|
75
75
|
src = res.src;
|
|
76
76
|
srcSet = res.srcset;
|
|
77
77
|
} else if (props.pixelDensities) {
|
|
78
|
-
const res = (0,
|
|
78
|
+
const res = (0, _prismicio_client.asImagePixelDensitySrcSet)(props.field, {
|
|
79
79
|
...props.imgixParams,
|
|
80
80
|
pixelDensities: props.pixelDensities === "defaults" ? void 0 : props.pixelDensities
|
|
81
81
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicImage.vue_vue_type_script_setup_true_lang.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,QAAQ,YAAY,MAAM,QAAQ,GAClD,SAAQ,KACP,qQAAqQ,sBACpQ,8BACA,GACF;AAGD,OAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,gBAAgB,GAClE,SAAQ,KACP,qSAAqS,sBACpS,8BACA,GACF;AAGD,OAAI,MAAM,UAAU,MAAM,eACzB,SAAQ,KACP,4MACD;IAED;EAGF,MAAM,WAAW,UAA2D;AAC3E,OAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;QACD;IACN,MAAM,SAAS,OAAO,SAAS,MAAK;AAEpC,QAAI,OAAO,MAAM,OAAO,CACvB;QAEA,QAAO;;;EAKV,MAAM,gCAAuB;AAC5B,OAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"PrismicImage.vue_vue_type_script_setup_true_lang.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FA,MAAM,QAAQ;AAGd,MAAI,YACH,4BAAkB;AACjB,OAAI,OAAO,MAAM,QAAQ,YAAY,MAAM,QAAQ,GAClD,SAAQ,KACP,qQAAqQ,sBACpQ,8BACA,GACF;AAGD,OAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,gBAAgB,GAClE,SAAQ,KACP,qSAAqS,sBACpS,8BACA,GACF;AAGD,OAAI,MAAM,UAAU,MAAM,eACzB,SAAQ,KACP,4MACD;IAED;EAGF,MAAM,WAAW,UAA2D;AAC3E,OAAI,OAAO,UAAU,YAAY,OAAO,UAAU,YACjD,QAAO;QACD;IACN,MAAM,SAAS,OAAO,SAAS,MAAK;AAEpC,QAAI,OAAO,MAAM,OAAO,CACvB;QAEA,QAAO;;;EAKV,MAAM,gCAAuB;AAC5B,OAAI,CAAC,2BAAS,eAAe,MAAM,MAAM,CACxC;GAGD,IAAI;GACJ,IAAI;AACJ,OAAI,MAAM,UAAU,CAAC,MAAM,gBAAgB;IAC1C,MAAM,gDAAyB,MAAM,OAAO;KAC3C,GAAG,MAAM;KACT,QAAQ,MAAM,WAAW,aAAa,SAAY,MAAM;KACxD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;cACH,MAAM,gBAAgB;IAChC,MAAM,uDAAgC,MAAM,OAAO;KAClD,GAAG,MAAM;KACT,gBACC,MAAM,mBAAmB,aAAa,SAAY,MAAM;KACzD,CAAA;AAED,UAAM,IAAI;AACV,aAAS,IAAI;;GAGd,MAAM,KAAK,MAAM,MAAM,WAAW,QAAQ,MAAM,MAAM,WAAW;GAEjE,MAAM,cAAc,QAAQ,MAAM,MAAK;GACvC,MAAM,eAAe,QAAQ,MAAM,OAAM;GAEzC,IAAI,gBAAgB,eAAe,MAAM,MAAM,WAAW;GAC1D,IAAI,iBAAiB,gBAAgB,MAAM,MAAM,WAAW;AAE5D,OAAI,eAAe,QAAQ,gBAAgB,KAC1C,kBAAiB,cAAc;YACrB,eAAe,QAAQ,gBAAgB,KACjD,iBAAgB,eAAe;AAGhC,UAAO;IACN;IACA;IACA,KAAK,MAAM,QAAQ,MAAM,MAAM,OAAO,MAAM;IAC5C,OAAO,KAAK,MAAM,cAAc;IAChC,QAAQ,KAAK,MAAM,eAAe;IACnC;IACA;;UAKO,MAAA,2DAML,OAAA;;IALA,KAAK,MAAA,MAAM;IACX,QAAQ,MAAA,MAAM;IACd,KAAK,MAAA,MAAM;IACX,OAAO,MAAA,MAAM;IACb,QAAQ,MAAA,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.cjs","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport { usePrismic } from \"./createPrismic\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst {
|
|
1
|
+
{"version":3,"file":"PrismicLink.cjs","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport { usePrismic } from \"./createPrismic\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst { components } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver || components?.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent ||\n\t\t\t\tcomponents?.linkInternalComponent ||\n\t\t\t\tdefaultInternalComponent\n\t\t: props.externalComponent ||\n\t\t\t\tcomponents?.linkExternalComponent ||\n\t\t\t\tdefaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.js","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport { usePrismic } from \"./createPrismic\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst {
|
|
1
|
+
{"version":3,"file":"PrismicLink.js","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { AsLinkAttrsConfig } from \"@prismicio/client\"\nimport {\n\ttype LinkField,\n\ttype LinkResolverFunction,\n\ttype PrismicDocument,\n\tasLinkAttrs,\n} from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport { isInternalURL } from \"./lib/isInternalURL\"\n\nimport type { ComponentOrTagName } from \"./types\"\n\nimport { usePrismic } from \"./createPrismic\"\n\n/** The default component rendered for internal URLs. */\nconst defaultInternalComponent = \"router-link\"\n\n/** The default component rendered for external URLs. */\nconst defaultExternalComponent = \"a\"\n\n/** The default rel attribute rendered for external URLs. */\nconst defaultExternalRelAttribute = \"noreferrer\"\n\n/** Props for `<PrismicLink />`. */\nexport type PrismicLinkProps = {\n\t/**\n\t * The link resolver used to resolve links.\n\t *\n\t * @remarks\n\t * If your app uses route resolvers when querying for your Prismic\n\t * repository's content, a link resolver does not need to be provided.\n\t *\n\t * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * The `rel` attribute for the link. By default, `\"noreferrer\"` is provided if\n\t * the link's URL is external. This prop can be provided a function to use the\n\t * link's metadata to determine the `rel` value.\n\t */\n\trel?: string | AsLinkAttrsConfig[\"rel\"]\n\n\t/**\n\t * The component rendered for internal URLs.\n\t *\n\t * If your app uses a client-side router that requires a special Link\n\t * component, provide the Link component to this prop.\n\t *\n\t * @defaultValue `<RouterLink>`\n\t */\n\tinternalComponent?: ComponentOrTagName\n\n\t/**\n\t * The component rendered for external URLs.\n\t *\n\t * @defaultValue `<a>`\n\t */\n\texternalComponent?: ComponentOrTagName\n} & (\n\t| {\n\t\t\t/** The Prismic link field to render. */\n\t\t\tfield: LinkField\n\t\t\tdocument?: never\n\t }\n\t| {\n\t\t\t/** The Prismic document to render as a link. */\n\t\t\tdocument: PrismicDocument\n\t\t\tfield?: never\n\t }\n)\n\nconst props = defineProps<PrismicLinkProps>()\ndefineOptions({ name: \"PrismicLink\" })\n\nconst { components } = usePrismic()\n\nconst rawAttrs = computed(() => {\n\treturn asLinkAttrs(props.field || props.document, {\n\t\tlinkResolver: props.linkResolver || components?.linkResolver,\n\t\trel(args) {\n\t\t\tif (props.rel) {\n\t\t\t\treturn typeof props.rel === \"function\" ? props.rel(args) : props.rel\n\t\t\t}\n\n\t\t\treturn args.isExternal ? defaultExternalRelAttribute : undefined\n\t\t},\n\t})\n})\n\nconst component = computed(() => {\n\treturn isInternalURL(rawAttrs.value.href || \"\")\n\t\t? props.internalComponent ||\n\t\t\t\tcomponents?.linkInternalComponent ||\n\t\t\t\tdefaultInternalComponent\n\t\t: props.externalComponent ||\n\t\t\t\tcomponents?.linkExternalComponent ||\n\t\t\t\tdefaultExternalComponent\n})\n\n// Match Vue Router's `<RouterLink />` interface unless the component is an anchor tag.\nconst attrs = computed(() => {\n\treturn component.value === \"a\"\n\t\t? {\n\t\t\t\thref: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n\t\t: {\n\t\t\t\tto: rawAttrs.value.href,\n\t\t\t\ttarget: rawAttrs.value.target,\n\t\t\t\trel: rawAttrs.value.rel,\n\t\t\t}\n})\n</script>\n\n<template>\n\t<component :is=\"component\" v-bind=\"attrs\">\n\t\t<slot>\n\t\t\t{{ props.field && \"text\" in props.field ? props.field.text : undefined }}\n\t\t</slot>\n\t</component>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"PrismicLink.vue.d.ts","names":[],"sources":["../../src/PrismicLink.vue"],"sourcesContent":[],"mappings":";;;;;;KAyJY,gBAAA;EAAA;;;;;;;;AA8CX;EAkFI,YAAA,CAAA,EAtHW,oBAuHoB;EAK9B;;;;;EAhGI,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;;;;UA2FG,EA3FH,eA2FG;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;;;;;;;;;iBAjIW;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;oBAAe,KAAA,CAAA,qBAAA;;;;;;;;;;iBAjCZ;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;SAIX;;;;;;;;;;;;iBA5BM;;;;;;iBAOA;;;;;;;;;sBAUK;;;;;;sBAOA;;;YASR;;;cA8FP,cAAqB,uBAAuB,YAAY;cAApB,iBACd;KACvB,wBAAwB;;YAEnB"}
|