@prismicio/vue 5.3.0-pr.85.0e554a8 → 5.3.0-pr.86.81afa1a
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 +4 -4
- package/dist/PrismicImage.vue.d.cts.map +1 -1
- package/dist/PrismicLink.vue.d.cts +24 -104
- package/dist/PrismicLink.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts +27 -32
- package/dist/PrismicRichText/PrismicRichText.vue.d.cts.map +1 -1
- package/dist/PrismicRichText/types.d.cts +15 -2
- package/dist/PrismicRichText/types.d.cts.map +1 -1
- package/dist/PrismicTable/PrismicTable.vue.d.cts +8 -8
- package/dist/PrismicTable/PrismicTable.vue.d.cts.map +1 -1
- package/dist/PrismicTable/types.d.cts +7 -6
- package/dist/PrismicTable/types.d.cts.map +1 -1
- package/dist/PrismicText.vue.d.cts +2 -10
- package/dist/PrismicText.vue.d.cts.map +1 -1
- package/dist/SliceZone/SliceZone.vue.d.cts +2 -10
- package/dist/SliceZone/SliceZone.vue.d.cts.map +1 -1
- package/dist/index.cjs +3 -10
- package/dist/index.d.cts +9 -13
- package/dist/index.d.ts +11 -15
- package/dist/index.js +3 -6
- 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 +4 -4
- package/dist/src/PrismicImage.vue.d.ts.map +1 -1
- package/dist/src/PrismicImage.vue_vue_type_script_setup_true_lang.cjs +2 -4
- 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 +2 -4
- 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 +24 -104
- package/dist/src/PrismicLink.vue.d.ts.map +1 -1
- package/dist/src/PrismicLink.vue_vue_type_script_setup_true_lang.cjs +3 -6
- 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 -6
- 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 +31 -36
- package/dist/src/PrismicRichText/PrismicRichText.vue.d.ts.map +1 -1
- package/dist/src/PrismicRichText/PrismicRichText.vue_vue_type_script_setup_true_lang.cjs +19 -52
- 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 +20 -53
- 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 +75 -35
- 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 +76 -36
- 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 +29 -8
- 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 +30 -9
- package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicRichText/types.d.ts +15 -2
- 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 +9 -9
- 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 +5 -5
- package/dist/src/PrismicTable/PrismicTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.cjs.map +1 -1
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js +36 -18
- package/dist/src/PrismicTable/PrismicTableDefaultComponents.js.map +1 -1
- package/dist/src/PrismicTable/types.d.ts +7 -6
- package/dist/src/PrismicTable/types.d.ts.map +1 -1
- package/dist/src/PrismicText.cjs.map +1 -1
- package/dist/src/PrismicText.js.map +1 -1
- package/dist/src/PrismicText.vue.d.ts +2 -10
- package/dist/src/PrismicText.vue.d.ts.map +1 -1
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.cjs +1 -12
- 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 +3 -14
- package/dist/src/PrismicText.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.cjs.map +1 -1
- package/dist/src/SliceZone/SliceZone.js.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue.d.ts +2 -10
- package/dist/src/SliceZone/SliceZone.vue.d.ts.map +1 -1
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.cjs +5 -17
- 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 +6 -18
- package/dist/src/SliceZone/SliceZone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/src/types.d.ts +2 -352
- package/dist/src/types.d.ts.map +1 -1
- package/dist/types.d.cts +2 -352
- package/dist/types.d.cts.map +1 -1
- package/package.json +6 -5
- package/src/PrismicImage.vue +2 -11
- package/src/PrismicLink.vue +9 -34
- package/src/PrismicRichText/PrismicRichText.vue +31 -101
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +46 -20
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +31 -10
- package/src/PrismicRichText/types.ts +16 -1
- package/src/PrismicTable/PrismicTable.vue +7 -7
- package/src/PrismicTable/PrismicTableDefaultComponents.ts +39 -20
- package/src/PrismicTable/types.ts +16 -6
- package/src/PrismicText.vue +2 -15
- package/src/SliceZone/SliceZone.vue +9 -27
- package/src/index.ts +13 -21
- package/src/types.ts +1 -439
- package/dist/PrismicEmbed.vue.d.cts +0 -25
- package/dist/PrismicEmbed.vue.d.cts.map +0 -1
- package/dist/createPrismic.d.cts +0 -29
- package/dist/createPrismic.d.cts.map +0 -1
- package/dist/src/PrismicEmbed.cjs +0 -8
- package/dist/src/PrismicEmbed.cjs.map +0 -1
- package/dist/src/PrismicEmbed.js +0 -8
- package/dist/src/PrismicEmbed.js.map +0 -1
- package/dist/src/PrismicEmbed.vue.d.ts +0 -25
- package/dist/src/PrismicEmbed.vue.d.ts.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js +0 -42
- package/dist/src/PrismicEmbed.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js +0 -8
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.js.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js +0 -92
- package/dist/src/PrismicRichText/DeprecatedPrismicRichText.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/createPrismic.cjs +0 -85
- package/dist/src/createPrismic.cjs.map +0 -1
- package/dist/src/createPrismic.d.ts +0 -29
- package/dist/src/createPrismic.d.ts.map +0 -1
- package/dist/src/createPrismic.js +0 -85
- package/dist/src/createPrismic.js.map +0 -1
- package/dist/src/lib/Wrapper.cjs +0 -8
- package/dist/src/lib/Wrapper.cjs.map +0 -1
- package/dist/src/lib/Wrapper.js +0 -8
- package/dist/src/lib/Wrapper.js.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.cjs.map +0 -1
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js +0 -22
- package/dist/src/lib/Wrapper.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/src/usePrismic.cjs +0 -38
- package/dist/src/usePrismic.cjs.map +0 -1
- package/dist/src/usePrismic.d.ts +0 -36
- package/dist/src/usePrismic.d.ts.map +0 -1
- package/dist/src/usePrismic.js +0 -37
- package/dist/src/usePrismic.js.map +0 -1
- package/dist/usePrismic.d.cts +0 -36
- package/dist/usePrismic.d.cts.map +0 -1
- package/src/PrismicEmbed.vue +0 -42
- package/src/PrismicRichText/DeprecatedPrismicRichText.vue +0 -146
- package/src/createPrismic.ts +0 -154
- package/src/usePrismic.ts +0 -36
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import PrismicEmbed_default from "../PrismicEmbed.js";
|
|
2
1
|
import PrismicImage_default from "../PrismicImage.js";
|
|
3
2
|
import PrismicLink_default from "../PrismicLink.js";
|
|
4
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent,
|
|
3
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, mergeProps, normalizeProps, openBlock, renderList, renderSlot, resolveDynamicComponent, toDisplayString, withCtx } from "vue";
|
|
5
4
|
|
|
6
5
|
//#region src/PrismicRichText/PrismicRichTextDefaultComponent.vue?vue&type=script&setup=true&lang.ts
|
|
7
6
|
const _hoisted_1 = ["dir"];
|
|
@@ -11,18 +10,19 @@ const _hoisted_4 = ["dir"];
|
|
|
11
10
|
const _hoisted_5 = ["dir"];
|
|
12
11
|
const _hoisted_6 = ["dir"];
|
|
13
12
|
const _hoisted_7 = ["dir"];
|
|
14
|
-
const _hoisted_8 =
|
|
15
|
-
const _hoisted_9 =
|
|
16
|
-
const _hoisted_10 = {
|
|
17
|
-
|
|
18
|
-
const _hoisted_12 = ["dir"];
|
|
19
|
-
const _hoisted_13 = { key: 12 };
|
|
20
|
-
const _hoisted_14 = { key: 13 };
|
|
21
|
-
const _hoisted_15 = {
|
|
22
|
-
key: 14,
|
|
13
|
+
const _hoisted_8 = ["dir"];
|
|
14
|
+
const _hoisted_9 = ["dir"];
|
|
15
|
+
const _hoisted_10 = {
|
|
16
|
+
key: 15,
|
|
23
17
|
class: "block-img"
|
|
24
18
|
};
|
|
25
|
-
const
|
|
19
|
+
const _hoisted_11 = [
|
|
20
|
+
"data-oembed",
|
|
21
|
+
"data-oembed-type",
|
|
22
|
+
"data-oembed-provider",
|
|
23
|
+
"innerHTML"
|
|
24
|
+
];
|
|
25
|
+
const _hoisted_12 = { key: 0 };
|
|
26
26
|
var PrismicRichTextDefaultComponent_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
27
27
|
name: "PrismicRichTextDefaultComponent",
|
|
28
28
|
__name: "PrismicRichTextDefaultComponent",
|
|
@@ -34,65 +34,105 @@ var PrismicRichTextDefaultComponent_vue_vue_type_script_setup_true_lang_default
|
|
|
34
34
|
linkResolver: {
|
|
35
35
|
type: Function,
|
|
36
36
|
required: false
|
|
37
|
+
},
|
|
38
|
+
internalLinkComponent: {
|
|
39
|
+
type: null,
|
|
40
|
+
required: false
|
|
41
|
+
},
|
|
42
|
+
externalLinkComponent: {
|
|
43
|
+
type: null,
|
|
44
|
+
required: false
|
|
45
|
+
},
|
|
46
|
+
shorthand: {
|
|
47
|
+
type: Object,
|
|
48
|
+
required: false
|
|
37
49
|
}
|
|
38
50
|
},
|
|
39
51
|
setup(__props) {
|
|
40
52
|
const props = __props;
|
|
53
|
+
const as = computed(() => {
|
|
54
|
+
return props.node.type !== "image" && props.node.type !== "span" ? props.shorthand?.as : void 0;
|
|
55
|
+
});
|
|
56
|
+
const attrs = computed(() => {
|
|
57
|
+
return props.shorthand?.attrs ?? {};
|
|
58
|
+
});
|
|
41
59
|
const dir = computed(() => {
|
|
42
60
|
return "direction" in props.node && props.node.direction === "rtl" ? "rtl" : void 0;
|
|
43
61
|
});
|
|
44
62
|
return (_ctx, _cache) => {
|
|
45
|
-
return
|
|
63
|
+
return as.value ? (openBlock(), createBlock(resolveDynamicComponent(as.value), mergeProps({
|
|
46
64
|
key: 0,
|
|
47
65
|
dir: dir.value
|
|
48
|
-
},
|
|
66
|
+
}, attrs.value), {
|
|
67
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
68
|
+
_: 3
|
|
69
|
+
}, 16, ["dir"])) : __props.node.type === "heading1" ? (openBlock(), createElementBlock("h1", mergeProps({
|
|
49
70
|
key: 1,
|
|
50
71
|
dir: dir.value
|
|
51
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
72
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_1)) : __props.node.type === "heading2" ? (openBlock(), createElementBlock("h2", mergeProps({
|
|
52
73
|
key: 2,
|
|
53
74
|
dir: dir.value
|
|
54
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
75
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_2)) : __props.node.type === "heading3" ? (openBlock(), createElementBlock("h3", mergeProps({
|
|
55
76
|
key: 3,
|
|
56
77
|
dir: dir.value
|
|
57
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
78
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_3)) : __props.node.type === "heading4" ? (openBlock(), createElementBlock("h4", mergeProps({
|
|
58
79
|
key: 4,
|
|
59
80
|
dir: dir.value
|
|
60
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
81
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_4)) : __props.node.type === "heading5" ? (openBlock(), createElementBlock("h5", mergeProps({
|
|
61
82
|
key: 5,
|
|
62
83
|
dir: dir.value
|
|
63
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
84
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_5)) : __props.node.type === "heading6" ? (openBlock(), createElementBlock("h6", mergeProps({
|
|
64
85
|
key: 6,
|
|
65
86
|
dir: dir.value
|
|
66
|
-
},
|
|
67
|
-
key:
|
|
87
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_6)) : __props.node.type === "paragraph" ? (openBlock(), createElementBlock("p", mergeProps({
|
|
88
|
+
key: 7,
|
|
68
89
|
dir: dir.value
|
|
69
|
-
}, [renderSlot(_ctx.$slots, "default")], 8,
|
|
90
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_7)) : __props.node.type === "preformatted" ? (openBlock(), createElementBlock("pre", normalizeProps(mergeProps({ key: 8 }, attrs.value)), [renderSlot(_ctx.$slots, "default")], 16)) : __props.node.type === "strong" ? (openBlock(), createElementBlock("strong", normalizeProps(mergeProps({ key: 9 }, attrs.value)), [renderSlot(_ctx.$slots, "default")], 16)) : __props.node.type === "em" ? (openBlock(), createElementBlock("em", normalizeProps(mergeProps({ key: 10 }, attrs.value)), [renderSlot(_ctx.$slots, "default")], 16)) : __props.node.type === "list-item" ? (openBlock(), createElementBlock("li", mergeProps({
|
|
70
91
|
key: 11,
|
|
71
92
|
dir: dir.value
|
|
72
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
93
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_8)) : __props.node.type === "o-list-item" ? (openBlock(), createElementBlock("li", mergeProps({
|
|
94
|
+
key: 12,
|
|
95
|
+
dir: dir.value
|
|
96
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16, _hoisted_9)) : __props.node.type === "group-list-item" ? (openBlock(), createElementBlock("ul", normalizeProps(mergeProps({ key: 13 }, attrs.value)), [renderSlot(_ctx.$slots, "default")], 16)) : __props.node.type === "group-o-list-item" ? (openBlock(), createElementBlock("ol", normalizeProps(mergeProps({ key: 14 }, attrs.value)), [renderSlot(_ctx.$slots, "default")], 16)) : __props.node.type === "image" ? (openBlock(), createElementBlock("p", _hoisted_10, [__props.node.linkTo ? (openBlock(), createBlock(PrismicLink_default, {
|
|
73
97
|
key: 0,
|
|
74
|
-
field: __props.node.linkTo
|
|
98
|
+
field: __props.node.linkTo,
|
|
99
|
+
"internal-component": __props.internalLinkComponent,
|
|
100
|
+
"external-component": __props.externalLinkComponent
|
|
75
101
|
}, {
|
|
76
102
|
default: withCtx(() => [createVNode(PrismicImage_default, { field: __props.node }, null, 8, ["field"])]),
|
|
77
103
|
_: 1
|
|
78
|
-
}, 8, [
|
|
104
|
+
}, 8, [
|
|
105
|
+
"field",
|
|
106
|
+
"internal-component",
|
|
107
|
+
"external-component"
|
|
108
|
+
])) : (openBlock(), createBlock(PrismicImage_default, mergeProps({
|
|
79
109
|
key: 1,
|
|
80
110
|
field: __props.node
|
|
81
|
-
}, null,
|
|
82
|
-
key: 15,
|
|
83
|
-
field: __props.node.oembed
|
|
84
|
-
}, null, 8, ["field"])) : __props.node.type === "hyperlink" ? (openBlock(), createBlock(PrismicLink_default, {
|
|
111
|
+
}, attrs.value), null, 16, ["field"]))])) : __props.node.type === "embed" ? (openBlock(), createElementBlock("div", mergeProps({
|
|
85
112
|
key: 16,
|
|
113
|
+
"data-oembed": __props.node.oembed.embed_url,
|
|
114
|
+
"data-oembed-type": __props.node.oembed.type,
|
|
115
|
+
"data-oembed-provider": __props.node.oembed.provider_name,
|
|
116
|
+
innerHTML: __props.node.oembed.html
|
|
117
|
+
}, attrs.value), null, 16, _hoisted_11)) : __props.node.type === "hyperlink" ? (openBlock(), createBlock(PrismicLink_default, mergeProps({
|
|
118
|
+
key: 17,
|
|
86
119
|
field: __props.node.data,
|
|
87
|
-
"link-resolver": __props.linkResolver
|
|
88
|
-
|
|
120
|
+
"link-resolver": __props.linkResolver,
|
|
121
|
+
"internal-component": __props.internalLinkComponent,
|
|
122
|
+
"external-component": __props.externalLinkComponent
|
|
123
|
+
}, attrs.value), {
|
|
89
124
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
90
125
|
_: 3
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
126
|
+
}, 16, [
|
|
127
|
+
"field",
|
|
128
|
+
"link-resolver",
|
|
129
|
+
"internal-component",
|
|
130
|
+
"external-component"
|
|
131
|
+
])) : __props.node.type === "label" ? (openBlock(), createElementBlock("span", mergeProps({
|
|
132
|
+
key: 18,
|
|
133
|
+
class: __props.node.data.label
|
|
134
|
+
}, attrs.value), [renderSlot(_ctx.$slots, "default")], 16)) : (openBlock(true), createElementBlock(Fragment, { key: 19 }, renderList(__props.node.text.split("\n"), (line, index) => {
|
|
135
|
+
return openBlock(), createElementBlock(Fragment, { key: line }, [index > 0 ? (openBlock(), createElementBlock("br", _hoisted_12)) : createCommentVNode("v-if", true), createTextVNode(toDisplayString(line), 1)], 64);
|
|
96
136
|
}), 128));
|
|
97
137
|
};
|
|
98
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type {
|
|
1
|
+
{"version":3,"file":"PrismicRichTextDefaultComponent.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextDefaultComponent.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { RichTextComponentProps, VueShorthand } from \"./types\"\n\nimport PrismicImage from \"../PrismicImage.vue\"\nimport PrismicLink from \"../PrismicLink.vue\"\n\nconst props = defineProps<\n\tRichTextComponentProps & {\n\t\tlinkResolver?: LinkResolverFunction\n\t\tinternalLinkComponent?: ComponentOrTagName\n\t\texternalLinkComponent?: ComponentOrTagName\n\t\tshorthand?: VueShorthand\n\t}\n>()\ndefineOptions({ name: \"PrismicRichTextDefaultComponent\" })\n\nconst as = computed(() => {\n\treturn props.node.type !== \"image\" && props.node.type !== \"span\" ? props.shorthand?.as : undefined\n})\n\nconst attrs = computed(() => {\n\treturn props.shorthand?.attrs ?? {}\n})\n\nconst dir = computed(() => {\n\treturn \"direction\" in props.node && props.node.direction === \"rtl\"\n\t\t? \"rtl\"\n\t\t: undefined\n})\n</script>\n\n<template>\n\t<component v-if=\"as\" :is=\"as\" :dir=\"dir\" v-bind=\"attrs\"><slot /></component>\n\t<h1 v-else-if=\"node.type === 'heading1'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h1>\n\t<h2 v-else-if=\"node.type === 'heading2'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h2>\n\t<h3 v-else-if=\"node.type === 'heading3'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h3>\n\t<h4 v-else-if=\"node.type === 'heading4'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h4>\n\t<h5 v-else-if=\"node.type === 'heading5'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h5>\n\t<h6 v-else-if=\"node.type === 'heading6'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></h6>\n\t<p v-else-if=\"node.type === 'paragraph'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></p>\n\t<pre v-else-if=\"node.type === 'preformatted'\" v-bind=\"attrs\"><slot /></pre>\n\t<strong v-else-if=\"node.type === 'strong'\" v-bind=\"attrs\"><slot /></strong>\n\t<em v-else-if=\"node.type === 'em'\" v-bind=\"attrs\"><slot /></em>\n\t<li v-else-if=\"node.type === 'list-item'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></li>\n\t<li v-else-if=\"node.type === 'o-list-item'\" :dir=\"dir\" v-bind=\"attrs\"><slot /></li>\n\t<ul v-else-if=\"node.type === 'group-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ul>\n\t<ol v-else-if=\"node.type === 'group-o-list-item'\" v-bind=\"attrs\">\n\t\t<slot />\n\t</ol>\n\t<p class=\"block-img\" v-else-if=\"node.type === 'image'\">\n\t\t<PrismicLink\n\t\t\tv-if=\"node.linkTo\"\n\t\t\t:field=\"node.linkTo\"\n\t\t\t:internal-component=\"internalLinkComponent\"\n\t\t\t:external-component=\"externalLinkComponent\"\n\t\t\t><PrismicImage :field=\"node\"\n\t\t/></PrismicLink>\n\t\t<PrismicImage v-else :field=\"node\" v-bind=\"attrs\" />\n\t</p>\n\t<div\n\t\tv-else-if=\"node.type === 'embed'\"\n\t\t:data-oembed=\"node.oembed.embed_url\"\n\t\t:data-oembed-type=\"node.oembed.type\"\n\t\t:data-oembed-provider=\"node.oembed.provider_name\"\n\t\tv-html=\"node.oembed.html\"\n\t\tv-bind=\"attrs\"\n\t/>\n\t<PrismicLink\n\t\tv-else-if=\"node.type === 'hyperlink'\"\n\t\t:field=\"node.data\"\n\t\t:link-resolver=\"linkResolver\"\n\t\t:internal-component=\"internalLinkComponent\"\n\t\t:external-component=\"externalLinkComponent\"\n\t\tv-bind=\"attrs\"\n\t\t><slot\n\t/></PrismicLink>\n\t<span v-else-if=\"node.type === 'label'\" :class=\"node.data.label\" v-bind=\"attrs\"\n\t\t><slot\n\t/></span>\n\t<template v-else v-for=\"(line, index) in node.text.split('\\n')\" :key=\"line\"\n\t\t><br v-if=\"index > 0\" />{{ line }}</template\n\t>\n</template>\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name))\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name))\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":""}
|
package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs
CHANGED
|
@@ -17,6 +17,14 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
17
17
|
linkResolver: {
|
|
18
18
|
type: Function,
|
|
19
19
|
required: false
|
|
20
|
+
},
|
|
21
|
+
internalLinkComponent: {
|
|
22
|
+
type: null,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
externalLinkComponent: {
|
|
26
|
+
type: null,
|
|
27
|
+
required: false
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
setup(__props) {
|
|
@@ -28,28 +36,41 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
28
36
|
};
|
|
29
37
|
const props = __props;
|
|
30
38
|
function getComponent(child) {
|
|
31
|
-
|
|
39
|
+
const maybeComponentOrShorthand = props.components?.[CHILD_TYPE_RENAMES[child.type] || child.type];
|
|
40
|
+
if (typeof maybeComponentOrShorthand === "function" || typeof maybeComponentOrShorthand === "object" && (typeof maybeComponentOrShorthand.render === "function" || typeof maybeComponentOrShorthand.setup === "function" || !!maybeComponentOrShorthand.__file || !!maybeComponentOrShorthand.__name)) return { is: maybeComponentOrShorthand };
|
|
41
|
+
return {
|
|
42
|
+
is: require_PrismicRichTextDefaultComponent.default,
|
|
43
|
+
props: {
|
|
44
|
+
linkResolver: props.linkResolver,
|
|
45
|
+
internalLinkComponent: props.internalLinkComponent,
|
|
46
|
+
externalLinkComponent: props.externalLinkComponent,
|
|
47
|
+
shorthand: maybeComponentOrShorthand
|
|
48
|
+
}
|
|
49
|
+
};
|
|
32
50
|
}
|
|
33
51
|
return (_ctx, _cache) => {
|
|
34
52
|
const _component_PrismicRichTextSerialize = (0, vue.resolveComponent)("PrismicRichTextSerialize", true);
|
|
35
53
|
return (0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(props.children, (child) => {
|
|
36
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(getComponent(child)), {
|
|
54
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(getComponent(child).is), (0, vue.mergeProps)({
|
|
37
55
|
key: JSON.stringify(child),
|
|
38
|
-
node: child.node
|
|
39
|
-
|
|
40
|
-
}, {
|
|
56
|
+
node: child.node
|
|
57
|
+
}, { ref_for: true }, getComponent(child).props), {
|
|
41
58
|
default: (0, vue.withCtx)(() => [child.children.length ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_PrismicRichTextSerialize, {
|
|
42
59
|
key: 0,
|
|
43
60
|
children: child.children,
|
|
44
61
|
components: __props.components,
|
|
45
|
-
"link-resolver": __props.linkResolver
|
|
62
|
+
"link-resolver": __props.linkResolver,
|
|
63
|
+
"internal-link-component": __props.internalLinkComponent,
|
|
64
|
+
"external-link-component": __props.externalLinkComponent
|
|
46
65
|
}, null, 8, [
|
|
47
66
|
"children",
|
|
48
67
|
"components",
|
|
49
|
-
"link-resolver"
|
|
68
|
+
"link-resolver",
|
|
69
|
+
"internal-link-component",
|
|
70
|
+
"external-link-component"
|
|
50
71
|
])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
51
72
|
_: 2
|
|
52
|
-
},
|
|
73
|
+
}, 1040, ["node"]);
|
|
53
74
|
}), 128);
|
|
54
75
|
};
|
|
55
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.cjs","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name))\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,qBAAqB;GAC1B,aAAa;GACb,eAAe;GACf,mBAAmB;GACnB,qBAAqB;GACrB;EAUD,MAAM,QAAQ;EAGd,SAAS,aAAa,OAAsD;GAC3E,MAAM,4BACL,MAAM,aACL,mBAAmB,MAAM,SACvB,MAAM;AAGV,OACC,OAAO,8BAA8B,cACpC,OAAO,8BAA8B,aACpC,OAAO,0BAA0B,WAAW,cAC5C,OAAO,0BAA0B,UAAU,cAC3C,CAAC,CAAC,0BAA0B,UAC5B,CAAC,CAAC,0BAA0B,QAE9B,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,uBAAuB,MAAM;KAC7B,uBAAuB,MAAM;KAC7B,WAAW;KACX;IACF;;;;gEAkBc,cAAA,0BAZG,MAAM,WAAf,UAAK;uFAEP,aAAa,MAAK,CAAE,GAAE,sBAUd;KAXZ,KAAK,KAAK,UAAU,MAAK;KAEzB,MAAM,MAAM;0BACL,aAAa,MAAK,CAAE,MAAK,EAAA;qCAQhC,CANM,MAAM,SAAS,qDAMrB,qCAAA;;MALC,UAAU,MAAM;MAChB,YAAY,QAAA;MACZ,iBAAe,QAAA;MACf,2BAAyB,QAAA;MACzB,2BAAyB,QAAA"}
|
package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PrismicRichTextDefaultComponent_default from "./PrismicRichTextDefaultComponent.js";
|
|
2
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, defineComponent, openBlock, renderList, resolveComponent, resolveDynamicComponent, withCtx } from "vue";
|
|
2
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveComponent, resolveDynamicComponent, withCtx } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/PrismicRichText/PrismicRichTextSerialize.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -17,6 +17,14 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
17
17
|
linkResolver: {
|
|
18
18
|
type: Function,
|
|
19
19
|
required: false
|
|
20
|
+
},
|
|
21
|
+
internalLinkComponent: {
|
|
22
|
+
type: null,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
externalLinkComponent: {
|
|
26
|
+
type: null,
|
|
27
|
+
required: false
|
|
20
28
|
}
|
|
21
29
|
},
|
|
22
30
|
setup(__props) {
|
|
@@ -28,28 +36,41 @@ var PrismicRichTextSerialize_vue_vue_type_script_setup_true_lang_default = /* @_
|
|
|
28
36
|
};
|
|
29
37
|
const props = __props;
|
|
30
38
|
function getComponent(child) {
|
|
31
|
-
|
|
39
|
+
const maybeComponentOrShorthand = props.components?.[CHILD_TYPE_RENAMES[child.type] || child.type];
|
|
40
|
+
if (typeof maybeComponentOrShorthand === "function" || typeof maybeComponentOrShorthand === "object" && (typeof maybeComponentOrShorthand.render === "function" || typeof maybeComponentOrShorthand.setup === "function" || !!maybeComponentOrShorthand.__file || !!maybeComponentOrShorthand.__name)) return { is: maybeComponentOrShorthand };
|
|
41
|
+
return {
|
|
42
|
+
is: PrismicRichTextDefaultComponent_default,
|
|
43
|
+
props: {
|
|
44
|
+
linkResolver: props.linkResolver,
|
|
45
|
+
internalLinkComponent: props.internalLinkComponent,
|
|
46
|
+
externalLinkComponent: props.externalLinkComponent,
|
|
47
|
+
shorthand: maybeComponentOrShorthand
|
|
48
|
+
}
|
|
49
|
+
};
|
|
32
50
|
}
|
|
33
51
|
return (_ctx, _cache) => {
|
|
34
52
|
const _component_PrismicRichTextSerialize = resolveComponent("PrismicRichTextSerialize", true);
|
|
35
53
|
return openBlock(true), createElementBlock(Fragment, null, renderList(props.children, (child) => {
|
|
36
|
-
return openBlock(), createBlock(resolveDynamicComponent(getComponent(child)), {
|
|
54
|
+
return openBlock(), createBlock(resolveDynamicComponent(getComponent(child).is), mergeProps({
|
|
37
55
|
key: JSON.stringify(child),
|
|
38
|
-
node: child.node
|
|
39
|
-
|
|
40
|
-
}, {
|
|
56
|
+
node: child.node
|
|
57
|
+
}, { ref_for: true }, getComponent(child).props), {
|
|
41
58
|
default: withCtx(() => [child.children.length ? (openBlock(), createBlock(_component_PrismicRichTextSerialize, {
|
|
42
59
|
key: 0,
|
|
43
60
|
children: child.children,
|
|
44
61
|
components: __props.components,
|
|
45
|
-
"link-resolver": __props.linkResolver
|
|
62
|
+
"link-resolver": __props.linkResolver,
|
|
63
|
+
"internal-link-component": __props.internalLinkComponent,
|
|
64
|
+
"external-link-component": __props.externalLinkComponent
|
|
46
65
|
}, null, 8, [
|
|
47
66
|
"children",
|
|
48
67
|
"components",
|
|
49
|
-
"link-resolver"
|
|
68
|
+
"link-resolver",
|
|
69
|
+
"internal-link-component",
|
|
70
|
+
"external-link-component"
|
|
50
71
|
])) : createCommentVNode("v-if", true)]),
|
|
51
72
|
_: 2
|
|
52
|
-
},
|
|
73
|
+
}, 1040, ["node"]);
|
|
53
74
|
}), 128);
|
|
54
75
|
};
|
|
55
76
|
}
|
package/dist/src/PrismicRichText/PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { VueRichTextSerializer } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\
|
|
1
|
+
{"version":3,"file":"PrismicRichTextSerialize.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/PrismicRichText/PrismicRichTextSerialize.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { LinkResolverFunction } from \"@prismicio/client\"\nimport type { asTree } from \"@prismicio/client/richtext\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueRichTextSerializer, VueShorthand } from \"./types\"\n\nimport PrismicRichTextDefaultComponent from \"./PrismicRichTextDefaultComponent.vue\"\n\nconst CHILD_TYPE_RENAMES = {\n\t\"list-item\": \"listItem\",\n\t\"o-list-item\": \"oListItem\",\n\t\"group-list-item\": \"list\",\n\t\"group-o-list-item\": \"oList\",\n} as const\n\ntype PrismicRichTextSerializeProps = {\n\tcomponents?: VueRichTextSerializer\n\tchildren: ReturnType<typeof asTree>[\"children\"]\n\tlinkResolver?: LinkResolverFunction\n\tinternalLinkComponent?: ComponentOrTagName\n\texternalLinkComponent?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicRichTextSerializeProps>()\ndefineOptions({ name: \"PrismicRichTextSerialize\" })\n\nfunction getComponent(child: ReturnType<typeof asTree>[\"children\"][number]) {\n\tconst maybeComponentOrShorthand =\n\t\tprops.components?.[\n\t\t\tCHILD_TYPE_RENAMES[child.type as keyof typeof CHILD_TYPE_RENAMES] ||\n\t\t\t\t(child.type as keyof typeof props.components)\n\t\t]\n\n\tif (\n\t\ttypeof maybeComponentOrShorthand === \"function\" ||\n\t\t(typeof maybeComponentOrShorthand === \"object\" &&\n\t\t\t(typeof maybeComponentOrShorthand.render === \"function\" ||\n\t\t\t\ttypeof maybeComponentOrShorthand.setup === \"function\" ||\n\t\t\t\t!!maybeComponentOrShorthand.__file ||\n\t\t\t\t!!maybeComponentOrShorthand.__name))\n\t) {\n\t\treturn { is: maybeComponentOrShorthand }\n\t}\n\n\treturn {\n\t\tis: PrismicRichTextDefaultComponent,\n\t\tprops: {\n\t\t\tlinkResolver: props.linkResolver,\n\t\t\tinternalLinkComponent: props.internalLinkComponent,\n\t\t\texternalLinkComponent: props.externalLinkComponent,\n\t\t\tshorthand: maybeComponentOrShorthand,\n\t\t},\n\t}\n}\n</script>\n\n<template>\n\t<component\n\t\tv-for=\"child in props.children\"\n\t\t:key=\"JSON.stringify(child)\"\n\t\t:is=\"getComponent(child).is\"\n\t\t:node=\"child.node\"\n\t\tv-bind=\"getComponent(child).props\"\n\t\t><PrismicRichTextSerialize\n\t\t\tv-if=\"child.children.length\"\n\t\t\t:children=\"child.children\"\n\t\t\t:components=\"components\"\n\t\t\t:link-resolver=\"linkResolver\"\n\t\t\t:internal-link-component=\"internalLinkComponent\"\n\t\t\t:external-link-component=\"externalLinkComponent\"\n\t/></component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,qBAAqB;GAC1B,aAAa;GACb,eAAe;GACf,mBAAmB;GACnB,qBAAqB;GACrB;EAUD,MAAM,QAAQ;EAGd,SAAS,aAAa,OAAsD;GAC3E,MAAM,4BACL,MAAM,aACL,mBAAmB,MAAM,SACvB,MAAM;AAGV,OACC,OAAO,8BAA8B,cACpC,OAAO,8BAA8B,aACpC,OAAO,0BAA0B,WAAW,cAC5C,OAAO,0BAA0B,UAAU,cAC3C,CAAC,CAAC,0BAA0B,UAC5B,CAAC,CAAC,0BAA0B,QAE9B,QAAO,EAAE,IAAI,2BAA0B;AAGxC,UAAO;IACN,IAAI;IACJ,OAAO;KACN,cAAc,MAAM;KACpB,uBAAuB,MAAM;KAC7B,uBAAuB,MAAM;KAC7B,WAAW;KACX;IACF;;;;2BAKA,mBAac,UAAA,MAAA,WAZG,MAAM,WAAf,UAAK;wBADb,YAac,wBAVR,aAAa,MAAK,CAAE,GAAE,EAH5B,WAac;KAXZ,KAAK,KAAK,UAAU,MAAK;KAEzB,MAAM,MAAM;0BACL,aAAa,MAAK,CAAE,MAAK,EAAA;4BAQhC,CANM,MAAM,SAAS,uBADrB,YAOA,qCAAA;;MALC,UAAU,MAAM;MAChB,YAAY,QAAA;MACZ,iBAAe,QAAA;MACf,2BAAyB,QAAA;MACzB,2BAAyB,QAAA"}
|
|
@@ -9,7 +9,7 @@ import { RTAnyNode, RichTextNodeType } from "@prismicio/client";
|
|
|
9
9
|
*
|
|
10
10
|
* @see Templating Rich Text and title fields from Prismic {@link https://prismic.io/docs/rich-text}
|
|
11
11
|
*/
|
|
12
|
-
type VueRichTextSerializer = Partial<Record<keyof typeof RichTextNodeType, VueRichTextComponent>>;
|
|
12
|
+
type VueRichTextSerializer = Partial<Record<keyof typeof RichTextNodeType, VueRichTextComponent | VueShorthand>>;
|
|
13
13
|
/**
|
|
14
14
|
* Props for a component rendering nodes from a Prismic rich text field.
|
|
15
15
|
*/
|
|
@@ -22,6 +22,19 @@ type RichTextComponentProps<TRTNode extends RTAnyNode = RTAnyNode> = {
|
|
|
22
22
|
* @typeParam TRTNode - The type of rich text node(s) this component handles
|
|
23
23
|
*/
|
|
24
24
|
type VueRichTextComponent<TRTNode extends RTAnyNode = RTAnyNode> = DefineComponent<{}, {}, any> | ReturnType<typeof defineAsyncComponent> | DefineComponent<RichTextComponentProps<TRTNode>> | FunctionalComponent<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
|
+
};
|
|
25
38
|
//#endregion
|
|
26
|
-
export { RichTextComponentProps, VueRichTextSerializer };
|
|
39
|
+
export { RichTextComponentProps, VueRichTextSerializer, VueShorthand };
|
|
27
40
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/PrismicRichText/types.ts"],"sourcesContent":[],"mappings":";;;;;;;AAaA;;;;AACC,KADW,qBAAA,GAAwB,OACnC,CAAA,MAAA,CAAA,MAAA,OAAoB,gBAApB,EAAsC,oBAAtC,GAA6D,YAA7D,CAAA,CAAA;;;AAMD;AAAmD,KAAvC,sBAAuC,CAAA,gBAAA,SAAA,GAAY,SAAZ,CAAA,GAAA;EAAY,IAAA,EACxD,OADwD;CACxD;;AACN;;;;KAOI,oBAKgB,CAAA,gBALqB,SAKrB,GALiC,SAKjC,CAAA,GAFlB,eAEkB,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA,CAAA,GAAlB,UAAkB,CAAA,OAAA,oBAAA,CAAA,GAClB,eADkB,CACF,sBADE,CACqB,OADrB,CAAA,CAAA,GAElB,mBAFkB,CAEE,sBAFF,CAEyB,OAFzB,CAAA,CAAA;;;;AAClB,KAMS,YAAA,GANT;EAC2C;;;EAAxB,EAAA,CAAA,EAAA,MAAA;EAKV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.cjs","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nconst mergedComponents = computed(() => ({\n\t...defaultTableComponents,\n\t...props.components,\n}))\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"mergedComponents.table\"\n\t\t:table=\"field\"\n\t\tv-bind=\"$attrs\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"mergedComponents.thead\"\n\t\t\t:head=\"field.head\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t\t<component :is=\"mergedComponents.tbody\" :body=\"field.body\">\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.js","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nconst mergedComponents = computed(() => ({\n\t...defaultTableComponents,\n\t...props.components,\n}))\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"mergedComponents.table\"\n\t\t:table=\"field\"\n\t\tv-bind=\"$attrs\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"mergedComponents.thead\"\n\t\t\t:head=\"field.head\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t\t<component :is=\"mergedComponents.tbody\" :body=\"field.body\">\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":""}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { VueRichTextSerializer } from "../PrismicRichText/types.js";
|
|
2
1
|
import { ComponentOrTagName } from "../types.js";
|
|
3
|
-
import {
|
|
2
|
+
import { VueRichTextSerializer } from "../PrismicRichText/types.js";
|
|
4
3
|
import "../PrismicRichText/index.js";
|
|
5
|
-
import
|
|
4
|
+
import { VueTableComponents } from "./types.js";
|
|
5
|
+
import * as vue26 from "vue";
|
|
6
6
|
import { TableField } from "@prismicio/client";
|
|
7
7
|
|
|
8
8
|
//#region src/PrismicTable/PrismicTable.vue.d.ts
|
|
@@ -14,11 +14,6 @@ type PrismicTableProps = {
|
|
|
14
14
|
* The Prismic table field to render.
|
|
15
15
|
*/
|
|
16
16
|
field: TableField | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* The value to be rendered when the field is empty. If a fallback is not
|
|
19
|
-
* given, `null` (nothing) will be rendered.
|
|
20
|
-
*/
|
|
21
|
-
fallback?: ComponentOrTagName;
|
|
22
17
|
/**
|
|
23
18
|
* An object that maps a table block type to a Vue component.
|
|
24
19
|
*
|
|
@@ -31,8 +26,13 @@ type PrismicTableProps = {
|
|
|
31
26
|
* ```
|
|
32
27
|
*/
|
|
33
28
|
components?: VueTableComponents & VueRichTextSerializer;
|
|
29
|
+
/**
|
|
30
|
+
* The value to be rendered when the field is empty. If a fallback is not
|
|
31
|
+
* given, `null` (nothing) will be rendered.
|
|
32
|
+
*/
|
|
33
|
+
fallback?: ComponentOrTagName;
|
|
34
34
|
};
|
|
35
|
-
declare const __VLS_export:
|
|
35
|
+
declare const __VLS_export: vue26.DefineComponent<PrismicTableProps, {}, {}, {}, {}, vue26.ComponentOptionsMixin, vue26.ComponentOptionsMixin, {}, string, vue26.PublicProps, Readonly<PrismicTableProps> & Readonly<{}>, {}, {}, {}, {}, string, vue26.ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
declare const _default: typeof __VLS_export;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { PrismicTableProps, _default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAgGY,iBAAA;EAAA;;;
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue.d.ts","names":[],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAgGY,iBAAA;EAAA;;;EAiBuB,KAAA,EAb3B,UAa2B,GAAA,SAAA;EAMvB;;AACX;;;;;;;;;EAqHiB,UAAA,CAAA,EA5HJ,kBA4HI,GA5HiB,qBA4HjB;EAAA;AAAA;;;aAtHN;;cAsHN,cAAY,KAAA,CAAA,gBAAA,mCAAA,KAAA,CAAA,qBAAA,EAAA,KAAA,CAAA,qBAAA,cAAA,KAAA,CAAA,WAAA,EAAA,SAAA,qBAAA,sCAAA,KAAA,CAAA,uBAAA;cAAA,iBAGU"}
|
|
@@ -12,13 +12,13 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
12
12
|
type: null,
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
|
-
fallback: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
},
|
|
19
15
|
components: {
|
|
20
16
|
type: Object,
|
|
21
17
|
required: false
|
|
18
|
+
},
|
|
19
|
+
fallback: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
setup(__props) {
|
|
@@ -55,7 +55,7 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (
|
|
|
55
55
|
_: 1
|
|
56
56
|
}, 8, ["body"]))]),
|
|
57
57
|
_: 1
|
|
58
|
-
}, 16, ["table"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 }));
|
|
58
|
+
}, 16, ["table"])) : __props.fallback ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.fallback), { key: 1 })) : (0, vue.createCommentVNode)("v-if", true);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"PrismicTable.vue_vue_type_script_setup_true_lang.cjs","names":["$attrs"],"sources":["../../../src/PrismicTable/PrismicTable.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { type TableField, isFilled } from \"@prismicio/client\"\nimport { computed } from \"vue\"\n\nimport type { ComponentOrTagName } from \"../types\"\nimport type { VueTableComponents } from \"./types\"\n\nimport type { VueRichTextSerializer } from \"../PrismicRichText\"\n\nimport { defaultTableComponents } from \"./PrismicTableDefaultComponents\"\nimport PrismicTableRow from \"./PrismicTableRow.vue\"\n\n/**\n * Props for `<PrismicTable />`.\n */\nexport type PrismicTableProps = {\n\t/**\n\t * The Prismic table field to render.\n\t */\n\tfield: TableField | undefined\n\n\t/**\n\t * An object that maps a table block type to a Vue component.\n\t *\n\t * @example\n\t *\n\t * ```javascript\n\t * {\n\t * table: Table,\n\t * }\n\t * ```\n\t */\n\tcomponents?: VueTableComponents & VueRichTextSerializer\n\n\t/**\n\t * The value to be rendered when the field is empty. If a fallback is not\n\t * given, `null` (nothing) will be rendered.\n\t */\n\tfallback?: ComponentOrTagName\n}\n\nconst props = defineProps<PrismicTableProps>()\ndefineOptions({ name: \"PrismicTable\" })\n\nconst mergedComponents = computed(() => ({\n\t...defaultTableComponents,\n\t...props.components,\n}))\n</script>\n\n<template>\n\t<component\n\t\tv-if=\"isFilled.table(field)\"\n\t\t:is=\"mergedComponents.table\"\n\t\t:table=\"field\"\n\t\tv-bind=\"$attrs\"\n\t>\n\t\t<component\n\t\t\tv-if=\"field.head\"\n\t\t\t:is=\"mergedComponents.thead\"\n\t\t\t:head=\"field.head\"\n\t\t>\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.head.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t\t<component :is=\"mergedComponents.tbody\" :body=\"field.body\">\n\t\t\t<PrismicTableRow\n\t\t\t\tv-for=\"row in field.body.rows\"\n\t\t\t\t:key=\"row.key\"\n\t\t\t\t:row=\"row\"\n\t\t\t\t:components=\"mergedComponents\"\n\t\t\t/>\n\t\t</component>\n\t</component>\n\t<component v-else-if=\"fallback\" :is=\"fallback\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,QAAQ;EAGd,MAAM,4CAAmC;GACxC,GAAG;GACH,GAAG,MAAM;GACT,EAAC;;yBAKM,4BAAQ,CAAC,MAAM,QAAA,MAAK,gFACrB,iBAAA,MAAiB,MAAK,sBAwBhB;;IAvBV,OAAO,QAAA;MACAA,KAAAA,OAAM,EAAA;oCAaF,CAVL,QAAA,MAAM,oFACP,iBAAA,MAAiB,MAAK,EAAA;;KAC1B,MAAM,QAAA,MAAM;;qCAGkB,wDAI7B,cAAA,0BAJa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAIT,iCAAA;OAHA,KAAK,IAAI;OACJ;OACL,YAAY,iBAAA;;;;+IAGC,iBAAA,MAAiB,MAAK,EAAA,EAAG,MAAM,QAAA,MAAM;qCAErB,wDAI7B,cAAA,0BAJa,QAAA,MAAM,KAAK,OAAlB,QAAG;wDAIT,iCAAA;OAHA,KAAK,IAAI;OACJ;OACL,YAAY,iBAAA;;;;;;wBAIM,QAAA,wFAAe,QAAA,SAAQ,EAAA,EAAA,KAAA,GAAA,CAAA"}
|
|
@@ -12,13 +12,13 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
12
12
|
type: null,
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
|
-
fallback: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
},
|
|
19
15
|
components: {
|
|
20
16
|
type: Object,
|
|
21
17
|
required: false
|
|
18
|
+
},
|
|
19
|
+
fallback: {
|
|
20
|
+
type: null,
|
|
21
|
+
required: false
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
setup(__props) {
|
|
@@ -55,7 +55,7 @@ var PrismicTable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
55
55
|
_: 1
|
|
56
56
|
}, 8, ["body"]))]),
|
|
57
57
|
_: 1
|
|
58
|
-
}, 16, ["table"])) : (openBlock(), createBlock(resolveDynamicComponent(__props.fallback), { key: 1 }));
|
|
58
|
+
}, 16, ["table"])) : __props.fallback ? (openBlock(), createBlock(resolveDynamicComponent(__props.fallback), { key: 1 })) : createCommentVNode("v-if", true);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
});
|