@prismicio/vue 4.3.1 → 5.0.0-alpha.1
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 +4 -4
- package/dist/PrismicEmbed.vue.cjs +25 -0
- package/dist/PrismicEmbed.vue.cjs.map +1 -0
- package/dist/PrismicEmbed.vue.d.ts +19 -0
- package/dist/PrismicEmbed.vue.js +26 -0
- package/dist/PrismicEmbed.vue.js.map +1 -0
- package/dist/PrismicEmbed.vue2.cjs +4 -0
- package/dist/PrismicEmbed.vue2.cjs.map +1 -0
- package/dist/PrismicEmbed.vue2.js +5 -0
- package/dist/PrismicEmbed.vue2.js.map +1 -0
- package/dist/PrismicImage.vue.cjs +84 -0
- package/dist/PrismicImage.vue.cjs.map +1 -0
- package/dist/PrismicImage.vue.d.ts +224 -0
- package/dist/PrismicImage.vue.js +85 -0
- package/dist/PrismicImage.vue.js.map +1 -0
- package/dist/PrismicImage.vue2.cjs +4 -0
- package/dist/PrismicImage.vue2.cjs.map +1 -0
- package/dist/PrismicImage.vue2.js +5 -0
- package/dist/PrismicImage.vue2.js.map +1 -0
- package/dist/PrismicLink.vue.cjs +100 -0
- package/dist/PrismicLink.vue.cjs.map +1 -0
- package/dist/PrismicLink.vue.d.ts +279 -0
- package/dist/PrismicLink.vue.js +101 -0
- package/dist/PrismicLink.vue.js.map +1 -0
- package/dist/PrismicLink.vue2.cjs +4 -0
- package/dist/PrismicLink.vue2.cjs.map +1 -0
- package/dist/PrismicLink.vue2.js +5 -0
- package/dist/PrismicLink.vue2.js.map +1 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs +90 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.cjs.map +1 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.d.ts +8 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js +91 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue.js.map +1 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.cjs +4 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.cjs.map +1 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.js +5 -0
- package/dist/PrismicRichText/DeprecatedPrismicRichText.vue2.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue.cjs +85 -0
- package/dist/PrismicRichText/PrismicRichText.vue.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue.d.ts +57 -0
- package/dist/PrismicRichText/PrismicRichText.vue.js +86 -0
- package/dist/PrismicRichText/PrismicRichText.vue.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue2.cjs +4 -0
- package/dist/PrismicRichText/PrismicRichText.vue2.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichText.vue2.js +5 -0
- package/dist/PrismicRichText/PrismicRichText.vue2.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.cjs +133 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.d.ts +37 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.js +134 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.cjs +4 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.js +5 -0
- package/dist/PrismicRichText/PrismicRichTextDefaultComponent.vue2.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.cjs +47 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.d.ts +10 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.js +48 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue.js.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.cjs +4 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.cjs.map +1 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.js +5 -0
- package/dist/PrismicRichText/PrismicRichTextSerialize.vue2.js.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.cjs +10 -0
- package/dist/PrismicRichText/getRichTextComponentProps.cjs.map +1 -0
- package/dist/PrismicRichText/getRichTextComponentProps.d.ts +49 -0
- package/dist/PrismicRichText/getRichTextComponentProps.js +10 -0
- package/dist/PrismicRichText/getRichTextComponentProps.js.map +1 -0
- package/dist/PrismicRichText/index.d.ts +2 -0
- package/dist/PrismicRichText/types.d.ts +22 -0
- package/dist/PrismicText.vue.cjs +43 -0
- package/dist/PrismicText.vue.cjs.map +1 -0
- package/dist/PrismicText.vue.d.ts +31 -0
- package/dist/PrismicText.vue.js +44 -0
- package/dist/PrismicText.vue.js.map +1 -0
- package/dist/PrismicText.vue2.cjs +4 -0
- package/dist/PrismicText.vue2.cjs.map +1 -0
- package/dist/PrismicText.vue2.js +5 -0
- package/dist/PrismicText.vue2.js.map +1 -0
- package/dist/SliceZone/SliceZone.vue.cjs +63 -0
- package/dist/SliceZone/SliceZone.vue.cjs.map +1 -0
- package/dist/SliceZone/SliceZone.vue.d.ts +41 -0
- package/dist/SliceZone/SliceZone.vue.js +64 -0
- package/dist/SliceZone/SliceZone.vue.js.map +1 -0
- package/dist/SliceZone/SliceZone.vue2.cjs +4 -0
- package/dist/SliceZone/SliceZone.vue2.cjs.map +1 -0
- package/dist/SliceZone/SliceZone.vue2.js +5 -0
- package/dist/SliceZone/SliceZone.vue2.js.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.cjs +29 -0
- package/dist/SliceZone/TODOSliceComponent.cjs.map +1 -0
- package/dist/SliceZone/TODOSliceComponent.d.ts +9 -0
- package/dist/SliceZone/TODOSliceComponent.js +29 -0
- package/dist/SliceZone/TODOSliceComponent.js.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.cjs +14 -0
- package/dist/SliceZone/defineSliceZoneComponents.cjs.map +1 -0
- package/dist/SliceZone/defineSliceZoneComponents.d.ts +36 -0
- package/dist/SliceZone/defineSliceZoneComponents.js +14 -0
- package/dist/SliceZone/defineSliceZoneComponents.js.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.cjs +22 -0
- package/dist/SliceZone/getSliceComponentProps.cjs.map +1 -0
- package/dist/SliceZone/getSliceComponentProps.d.ts +66 -0
- package/dist/SliceZone/getSliceComponentProps.js +22 -0
- package/dist/SliceZone/getSliceComponentProps.js.map +1 -0
- package/dist/SliceZone/index.d.ts +4 -0
- package/dist/SliceZone/types.d.ts +97 -0
- package/dist/createPrismic.cjs +17 -50
- package/dist/createPrismic.cjs.map +1 -1
- package/dist/createPrismic.d.ts +10 -0
- package/dist/createPrismic.js +16 -27
- package/dist/createPrismic.js.map +1 -1
- package/dist/index.cjs +21 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +19 -9
- package/dist/index.js +19 -38
- package/dist/index.js.map +1 -1
- package/dist/lib/Wrapper.vue.cjs +20 -0
- package/dist/lib/Wrapper.vue.cjs.map +1 -0
- package/dist/lib/Wrapper.vue.d.ts +28 -0
- package/dist/lib/Wrapper.vue.js +21 -0
- package/dist/lib/Wrapper.vue.js.map +1 -0
- package/dist/lib/Wrapper.vue2.cjs +4 -0
- package/dist/lib/Wrapper.vue2.cjs.map +1 -0
- package/dist/lib/Wrapper.vue2.js +5 -0
- package/dist/lib/Wrapper.vue2.js.map +1 -0
- package/dist/lib/devMsg.cjs +8 -0
- package/dist/lib/devMsg.cjs.map +1 -0
- package/dist/lib/devMsg.d.ts +16 -0
- package/dist/lib/devMsg.js +8 -0
- package/dist/lib/devMsg.js.map +1 -0
- package/dist/package.json.cjs +5 -0
- package/dist/package.json.cjs.map +1 -0
- package/dist/package.json.js +5 -0
- package/dist/package.json.js.map +1 -0
- package/dist/types.d.ts +32 -56
- package/dist/usePrismic.cjs +3 -2
- package/dist/usePrismic.cjs.map +1 -1
- package/dist/usePrismic.d.ts +8 -0
- package/dist/usePrismic.js +2 -1
- package/dist/usePrismic.js.map +1 -1
- package/package.json +21 -23
- package/src/PrismicEmbed.vue +42 -0
- package/src/PrismicImage.vue +160 -0
- package/src/PrismicLink.vue +191 -0
- package/src/PrismicRichText/DeprecatedPrismicRichText.vue +130 -0
- package/src/PrismicRichText/PrismicRichText.vue +157 -0
- package/src/PrismicRichText/PrismicRichTextDefaultComponent.vue +63 -0
- package/src/PrismicRichText/PrismicRichTextSerialize.vue +52 -0
- package/src/PrismicRichText/getRichTextComponentProps.ts +63 -0
- package/src/PrismicRichText/index.ts +3 -0
- package/src/PrismicRichText/types.ts +37 -0
- package/src/PrismicText.vue +63 -0
- package/src/SliceZone/SliceZone.vue +113 -0
- package/src/SliceZone/TODOSliceComponent.ts +49 -0
- package/src/SliceZone/defineSliceZoneComponents.ts +67 -0
- package/src/SliceZone/getSliceComponentProps.ts +98 -0
- package/src/SliceZone/index.ts +13 -0
- package/src/SliceZone/types.ts +163 -0
- package/src/createPrismic.ts +28 -33
- package/src/index.ts +32 -57
- package/src/lib/Wrapper.vue +22 -0
- package/src/lib/devMsg.ts +20 -0
- package/src/types.ts +39 -66
- package/src/usePrismic.ts +8 -1
- package/dist/components/PrismicEmbed.cjs +0 -36
- package/dist/components/PrismicEmbed.cjs.map +0 -1
- package/dist/components/PrismicEmbed.d.ts +0 -59
- package/dist/components/PrismicEmbed.js +0 -36
- package/dist/components/PrismicEmbed.js.map +0 -1
- package/dist/components/PrismicImage.cjs +0 -122
- package/dist/components/PrismicImage.cjs.map +0 -1
- package/dist/components/PrismicImage.d.ts +0 -165
- package/dist/components/PrismicImage.js +0 -122
- package/dist/components/PrismicImage.js.map +0 -1
- package/dist/components/PrismicLink.cjs +0 -120
- package/dist/components/PrismicLink.cjs.map +0 -1
- package/dist/components/PrismicLink.d.ts +0 -198
- package/dist/components/PrismicLink.js +0 -120
- package/dist/components/PrismicLink.js.map +0 -1
- package/dist/components/PrismicRichText.cjs +0 -108
- package/dist/components/PrismicRichText.cjs.map +0 -1
- package/dist/components/PrismicRichText.d.ts +0 -161
- package/dist/components/PrismicRichText.js +0 -108
- package/dist/components/PrismicRichText.js.map +0 -1
- package/dist/components/PrismicText.cjs +0 -57
- package/dist/components/PrismicText.cjs.map +0 -1
- package/dist/components/PrismicText.d.ts +0 -119
- package/dist/components/PrismicText.js +0 -57
- package/dist/components/PrismicText.js.map +0 -1
- package/dist/components/SliceZone.cjs +0 -156
- package/dist/components/SliceZone.cjs.map +0 -1
- package/dist/components/SliceZone.d.ts +0 -377
- package/dist/components/SliceZone.js +0 -156
- package/dist/components/SliceZone.js.map +0 -1
- package/dist/components/index.d.ts +0 -12
- package/dist/composables.cjs +0 -40
- package/dist/composables.cjs.map +0 -1
- package/dist/composables.d.ts +0 -348
- package/dist/composables.js +0 -40
- package/dist/composables.js.map +0 -1
- package/dist/globalExtensions.d.ts +0 -11
- package/dist/injectionSymbols.cjs +0 -5
- package/dist/injectionSymbols.cjs.map +0 -1
- package/dist/injectionSymbols.d.ts +0 -9
- package/dist/injectionSymbols.js +0 -5
- package/dist/injectionSymbols.js.map +0 -1
- package/dist/lib/__PRODUCTION__.cjs +0 -8
- package/dist/lib/__PRODUCTION__.cjs.map +0 -1
- package/dist/lib/__PRODUCTION__.d.ts +0 -7
- package/dist/lib/__PRODUCTION__.js +0 -8
- package/dist/lib/__PRODUCTION__.js.map +0 -1
- package/dist/lib/getSlots.cjs +0 -21
- package/dist/lib/getSlots.cjs.map +0 -1
- package/dist/lib/getSlots.d.ts +0 -14
- package/dist/lib/getSlots.js +0 -21
- package/dist/lib/getSlots.js.map +0 -1
- package/dist/lib/simplyResolveComponent.cjs +0 -8
- package/dist/lib/simplyResolveComponent.cjs.map +0 -1
- package/dist/lib/simplyResolveComponent.d.ts +0 -12
- package/dist/lib/simplyResolveComponent.js +0 -8
- package/dist/lib/simplyResolveComponent.js.map +0 -1
- package/dist/useStatefulPrismicClientMethod.cjs +0 -39
- package/dist/useStatefulPrismicClientMethod.cjs.map +0 -1
- package/dist/useStatefulPrismicClientMethod.d.ts +0 -65
- package/dist/useStatefulPrismicClientMethod.js +0 -39
- package/dist/useStatefulPrismicClientMethod.js.map +0 -1
- package/src/components/PrismicEmbed.ts +0 -90
- package/src/components/PrismicImage.ts +0 -307
- package/src/components/PrismicLink.ts +0 -324
- package/src/components/PrismicRichText.ts +0 -283
- package/src/components/PrismicText.ts +0 -165
- package/src/components/SliceZone.ts +0 -617
- package/src/components/index.ts +0 -42
- package/src/composables.ts +0 -492
- package/src/globalExtensions.ts +0 -12
- package/src/injectionSymbols.ts +0 -17
- package/src/lib/__PRODUCTION__.ts +0 -12
- package/src/lib/getSlots.ts +0 -43
- package/src/lib/simplyResolveComponent.ts +0 -18
- package/src/useStatefulPrismicClientMethod.ts +0 -158
- package/vetur/attributes.json +0 -113
- package/vetur/tags.json +0 -60
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { asLink } from "@prismicio/client";
|
|
2
|
-
import { computed, unref, defineComponent, reactive, h } from "vue";
|
|
3
|
-
import { getSlots } from "../lib/getSlots.js";
|
|
4
|
-
import { isInternalURL } from "../lib/isInternalURL.js";
|
|
5
|
-
import { simplyResolveComponent } from "../lib/simplyResolveComponent.js";
|
|
6
|
-
import { usePrismic } from "../usePrismic.js";
|
|
7
|
-
const defaultInternalComponent = "router-link";
|
|
8
|
-
const defaultExternalComponent = "a";
|
|
9
|
-
const defaultBlankTargetRelAttribute = "noopener noreferrer";
|
|
10
|
-
const usePrismicLink = (props) => {
|
|
11
|
-
const { options } = usePrismic();
|
|
12
|
-
const type = computed(() => {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
const internalComponent = unref(props.internalComponent) || ((_a = options.components) == null ? void 0 : _a.linkInternalComponent) || defaultInternalComponent;
|
|
15
|
-
const externalComponent = unref(props.externalComponent) || ((_b = options.components) == null ? void 0 : _b.linkExternalComponent) || defaultExternalComponent;
|
|
16
|
-
return href.value && isInternalURL(href.value) && !target.value ? internalComponent : externalComponent;
|
|
17
|
-
});
|
|
18
|
-
const href = computed(() => {
|
|
19
|
-
const field = unref(props.field);
|
|
20
|
-
const linkResolver = unref(props.linkResolver) ?? options.linkResolver;
|
|
21
|
-
return asLink(field, linkResolver) ?? "";
|
|
22
|
-
});
|
|
23
|
-
const target = computed(() => {
|
|
24
|
-
const field = unref(props.field);
|
|
25
|
-
const target2 = unref(props.target);
|
|
26
|
-
if (typeof target2 !== "undefined") {
|
|
27
|
-
return target2;
|
|
28
|
-
} else {
|
|
29
|
-
return field && "target" in field && field.target ? field.target : null;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const rel = computed(() => {
|
|
33
|
-
var _a;
|
|
34
|
-
const rel2 = unref(props.rel);
|
|
35
|
-
if (typeof rel2 !== "undefined") {
|
|
36
|
-
return rel2;
|
|
37
|
-
} else if (target.value === "_blank") {
|
|
38
|
-
const blankTargetRelAttribute = unref(props.blankTargetRelAttribute);
|
|
39
|
-
if (typeof blankTargetRelAttribute !== "undefined") {
|
|
40
|
-
return blankTargetRelAttribute;
|
|
41
|
-
} else {
|
|
42
|
-
return typeof ((_a = options.components) == null ? void 0 : _a.linkBlankTargetRelAttribute) !== "undefined" ? options.components.linkBlankTargetRelAttribute : defaultBlankTargetRelAttribute;
|
|
43
|
-
}
|
|
44
|
-
} else {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const text = computed(() => {
|
|
49
|
-
const field = unref(props.field);
|
|
50
|
-
return field && "text" in field ? field.text : void 0;
|
|
51
|
-
});
|
|
52
|
-
return {
|
|
53
|
-
type,
|
|
54
|
-
href,
|
|
55
|
-
target,
|
|
56
|
-
rel,
|
|
57
|
-
text
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
const PrismicLinkImpl = /* @__PURE__ */ defineComponent({
|
|
61
|
-
name: "PrismicLink",
|
|
62
|
-
props: {
|
|
63
|
-
field: {
|
|
64
|
-
type: Object,
|
|
65
|
-
required: true
|
|
66
|
-
},
|
|
67
|
-
linkResolver: {
|
|
68
|
-
type: Function,
|
|
69
|
-
default: void 0,
|
|
70
|
-
required: false
|
|
71
|
-
},
|
|
72
|
-
target: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: void 0,
|
|
75
|
-
required: false
|
|
76
|
-
},
|
|
77
|
-
rel: {
|
|
78
|
-
type: String,
|
|
79
|
-
default: void 0,
|
|
80
|
-
required: false
|
|
81
|
-
},
|
|
82
|
-
blankTargetRelAttribute: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: void 0,
|
|
85
|
-
required: false
|
|
86
|
-
},
|
|
87
|
-
internalComponent: {
|
|
88
|
-
type: [String, Object, Function],
|
|
89
|
-
default: void 0,
|
|
90
|
-
required: false
|
|
91
|
-
},
|
|
92
|
-
externalComponent: {
|
|
93
|
-
type: [String, Object, Function],
|
|
94
|
-
default: void 0,
|
|
95
|
-
required: false
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
setup(props, { slots }) {
|
|
99
|
-
if (!props.field) {
|
|
100
|
-
return () => null;
|
|
101
|
-
}
|
|
102
|
-
const { type, href, target, rel, text } = usePrismicLink(props);
|
|
103
|
-
return () => {
|
|
104
|
-
const parent = type.value === "a" ? "a" : simplyResolveComponent(type.value);
|
|
105
|
-
const computedSlots = getSlots(parent, slots, reactive({ href: href.value, text: text.value }), text.value);
|
|
106
|
-
if (typeof parent === "string") {
|
|
107
|
-
return h(parent, { href: href.value, target: target.value, rel: rel.value }, computedSlots);
|
|
108
|
-
} else {
|
|
109
|
-
return h(parent, { to: href.value, target: target.value, rel: rel.value }, computedSlots);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
const PrismicLink = PrismicLinkImpl;
|
|
115
|
-
export {
|
|
116
|
-
PrismicLink,
|
|
117
|
-
PrismicLinkImpl,
|
|
118
|
-
usePrismicLink
|
|
119
|
-
};
|
|
120
|
-
//# sourceMappingURL=PrismicLink.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicLink.js","sources":["../../../src/components/PrismicLink.ts"],"sourcesContent":["import type {\n\tLinkField,\n\tLinkResolverFunction,\n\tPrismicDocument,\n} from \"@prismicio/client\"\nimport { asLink } from \"@prismicio/client\"\nimport type {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tComputedRef,\n\tConcreteComponent,\n\tDefineComponent,\n\tPropType,\n\tRaw,\n\tVNodeProps,\n} from \"vue\"\nimport { computed, defineComponent, h, reactive, unref } from \"vue\"\n\nimport { getSlots } from \"../lib/getSlots\"\nimport { isInternalURL } from \"../lib/isInternalURL\"\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\"\n\nimport type { VueUseOptions } from \"../types\"\n\nimport { usePrismic } from \"../usePrismic\"\n\n/**\n * The default component rendered for internal URLs.\n */\nconst defaultInternalComponent = \"router-link\"\n\n/**\n * The default component rendered for external URLs.\n */\nconst defaultExternalComponent = \"a\"\n\n/**\n * The default rel attribute rendered for blank target URLs.\n */\nconst defaultBlankTargetRelAttribute = \"noopener noreferrer\"\n\n/**\n * Props for `<PrismicLink />`.\n */\nexport type PrismicLinkProps = {\n\t/**\n\t * The Prismic link field or document to render.\n\t */\n\tfield: LinkField | PrismicDocument\n\n\t/**\n\t * A link resolver function used to resolve links when not using the route\n\t * resolver parameter with `@prismicio/client`.\n\t *\n\t * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.\n\t *\n\t * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An explicit `target` attribute to apply to the rendered link.\n\t */\n\ttarget?: string | null\n\n\t/**\n\t * An explicit `rel` attribute to apply to the rendered link.\n\t */\n\trel?: string | null\n\n\t/**\n\t * Value of the `rel` attribute to use on links rendered with\n\t * `target=\"_blank\"`.\n\t *\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `\"noopener noreferrer\"` otherwise.\n\t */\n\tblankTargetRelAttribute?: string | null\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * internal links.\n\t *\n\t * @remarks\n\t * HTML tag names will be rendered using the anchor tag interface (`href`,\n\t * `target`, and `rel` attributes).\n\t * @remarks\n\t * Components will be rendered using Vue Router {@link RouterLink} interface\n\t * (`to` props).\n\t *\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, {@link RouterLink} otherwise.\n\t */\n\tinternalComponent?: string | ConcreteComponent | Raw<DefineComponent>\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to render\n\t * external links.\n\t *\n\t * @remarks\n\t * HTML tag names will be rendered using the anchor tag interface (`href`,\n\t * `target`, and `rel` attributes).\n\t * @remarks\n\t * Components will be rendered using Vue Router {@link RouterLink} interface\n\t * (`to` props).\n\t *\n\t * @defaultValue The one provided to `@prismicio/vue` plugin if configured, `\"a\"` otherwise.\n\t */\n\texternalComponent?: string | ConcreteComponent | Raw<DefineComponent>\n}\n\n/**\n * Options for {@link usePrismicLink}.\n */\nexport type UsePrismicLinkOptions = VueUseOptions<PrismicLinkProps>\n\n/**\n * Return type of {@link usePrismicLink}.\n */\nexport type UsePrismicLinkReturnType = {\n\t/**\n\t * Suggested component to render for provided link field.\n\t */\n\ttype: ComputedRef<string | ConcreteComponent | Raw<DefineComponent>>\n\n\t/**\n\t * Resolved anchor `href` value.\n\t */\n\thref: ComputedRef<string>\n\n\t/**\n\t * Resolved anchor `target` value.\n\t */\n\ttarget: ComputedRef<string | null>\n\n\t/**\n\t * Resolved anchor `rel` value.\n\t */\n\trel: ComputedRef<string | null>\n\n\t/**\n\t * Resolved link text.\n\t */\n\ttext: ComputedRef<string | undefined>\n}\n\n/**\n * A low level composable that returns resolved information about a Prismic link\n * field.\n *\n * @param props - {@link UsePrismicLinkOptions}\n *\n * @returns - Resolved link information {@link UsePrismicLinkReturnType}\n */\nexport const usePrismicLink = (\n\tprops: UsePrismicLinkOptions,\n): UsePrismicLinkReturnType => {\n\tconst { options } = usePrismic()\n\n\tconst type = computed(() => {\n\t\tconst internalComponent =\n\t\t\tunref(props.internalComponent) ||\n\t\t\toptions.components?.linkInternalComponent ||\n\t\t\tdefaultInternalComponent\n\n\t\tconst externalComponent =\n\t\t\tunref(props.externalComponent) ||\n\t\t\toptions.components?.linkExternalComponent ||\n\t\t\tdefaultExternalComponent\n\n\t\treturn href.value && isInternalURL(href.value) && !target.value\n\t\t\t? internalComponent\n\t\t\t: externalComponent\n\t})\n\tconst href = computed(() => {\n\t\tconst field = unref(props.field)\n\t\tconst linkResolver = unref(props.linkResolver) ?? options.linkResolver\n\n\t\treturn asLink(field, linkResolver) ?? \"\"\n\t})\n\tconst target = computed(() => {\n\t\tconst field = unref(props.field)\n\t\tconst target = unref(props.target)\n\n\t\tif (typeof target !== \"undefined\") {\n\t\t\treturn target\n\t\t} else {\n\t\t\treturn field && \"target\" in field && field.target ? field.target : null\n\t\t}\n\t})\n\tconst rel = computed(() => {\n\t\tconst rel = unref(props.rel)\n\n\t\tif (typeof rel !== \"undefined\") {\n\t\t\treturn rel\n\t\t} else if (target.value === \"_blank\") {\n\t\t\tconst blankTargetRelAttribute = unref(props.blankTargetRelAttribute)\n\n\t\t\tif (typeof blankTargetRelAttribute !== \"undefined\") {\n\t\t\t\treturn blankTargetRelAttribute\n\t\t\t} else {\n\t\t\t\treturn typeof options.components?.linkBlankTargetRelAttribute !==\n\t\t\t\t\t\"undefined\"\n\t\t\t\t\t? options.components.linkBlankTargetRelAttribute\n\t\t\t\t\t: defaultBlankTargetRelAttribute\n\t\t\t}\n\t\t} else {\n\t\t\treturn null\n\t\t}\n\t})\n\n\tconst text = computed(() => {\n\t\tconst field = unref(props.field)\n\n\t\treturn field && \"text\" in field ? field.text : undefined\n\t})\n\n\treturn {\n\t\ttype,\n\t\thref,\n\t\ttarget,\n\t\trel,\n\t\ttext,\n\t}\n}\n\n/**\n * `<PrismicLink />` implementation.\n *\n * @internal\n */\nexport const PrismicLinkImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicLink\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Object as PropType<LinkField | PrismicDocument>,\n\t\t\trequired: true,\n\t\t},\n\t\tlinkResolver: {\n\t\t\ttype: Function as PropType<LinkResolverFunction>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\ttarget: {\n\t\t\ttype: String as PropType<string | null>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\trel: {\n\t\t\ttype: String as PropType<string | null>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tblankTargetRelAttribute: {\n\t\t\ttype: String as PropType<string | null>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tinternalComponent: {\n\t\t\ttype: [String, Object, Function] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\texternalComponent: {\n\t\t\ttype: [String, Object, Function] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props, { slots }) {\n\t\t// Prevent fatal if user didn't check for field, throws `Invalid prop` warn\n\t\tif (!props.field) {\n\t\t\treturn () => null\n\t\t}\n\n\t\tconst { type, href, target, rel, text } = usePrismicLink(props)\n\n\t\treturn () => {\n\t\t\tconst parent =\n\t\t\t\ttype.value === \"a\" ? \"a\" : simplyResolveComponent(type.value)\n\t\t\tconst computedSlots = getSlots(\n\t\t\t\tparent,\n\t\t\t\tslots,\n\t\t\t\treactive({ href: href.value, text: text.value }),\n\t\t\t\ttext.value,\n\t\t\t)\n\n\t\t\tif (typeof parent === \"string\") {\n\t\t\t\t// Fitting anchor tag interface\n\t\t\t\treturn h(\n\t\t\t\t\tparent,\n\t\t\t\t\t{ href: href.value, target: target.value, rel: rel.value },\n\t\t\t\t\tcomputedSlots,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\t// Fitting Vue Router Link interface\n\t\t\t\treturn h(\n\t\t\t\t\tparent,\n\t\t\t\t\t{ to: href.value, target: target.value, rel: rel.value },\n\t\t\t\t\tcomputedSlots,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t},\n})\n\n// export the public type for h/tsx inference\n// also to avoid inline import() in generated d.ts files\n/**\n * Component to render a Prismic link field.\n *\n * @see Component props {@link PrismicLinkProps}\n * @see Templating link fields {@link https://prismic.io/docs/technologies/vue-template-content#links-and-content-relationships}\n */\nexport const PrismicLink = PrismicLinkImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicLinkProps\n\t}\n}\n"],"names":["target","rel"],"mappings":"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"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const client = require("@prismicio/client");
|
|
4
|
-
const vue = require("vue");
|
|
5
|
-
const vueRouter = require("vue-router");
|
|
6
|
-
const isInternalURL = require("../lib/isInternalURL.cjs");
|
|
7
|
-
const simplyResolveComponent = require("../lib/simplyResolveComponent.cjs");
|
|
8
|
-
const usePrismic = require("../usePrismic.cjs");
|
|
9
|
-
const defaultWrapper = "div";
|
|
10
|
-
const usePrismicRichText = (props) => {
|
|
11
|
-
const { options } = usePrismic.usePrismic();
|
|
12
|
-
const html = vue.computed(() => {
|
|
13
|
-
const field = vue.unref(props.field);
|
|
14
|
-
if (!client.isFilled.richText(field)) {
|
|
15
|
-
return vue.unref(props.fallback) ?? "";
|
|
16
|
-
}
|
|
17
|
-
const linkResolver = vue.unref(props.linkResolver) ?? options.linkResolver;
|
|
18
|
-
const serializer = vue.unref(props.serializer) ?? vue.unref(props.htmlSerializer) ?? options.richTextSerializer ?? options.htmlSerializer;
|
|
19
|
-
return client.asHTML(vue.unref(field), linkResolver, serializer);
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
html
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
const PrismicRichTextImpl = /* @__PURE__ */ vue.defineComponent({
|
|
26
|
-
name: "PrismicRichText",
|
|
27
|
-
props: {
|
|
28
|
-
field: {
|
|
29
|
-
type: Array,
|
|
30
|
-
default: void 0,
|
|
31
|
-
required: false
|
|
32
|
-
},
|
|
33
|
-
linkResolver: {
|
|
34
|
-
type: Function,
|
|
35
|
-
default: void 0,
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
serializer: {
|
|
39
|
-
type: [Function, Object],
|
|
40
|
-
default: void 0,
|
|
41
|
-
required: false
|
|
42
|
-
},
|
|
43
|
-
htmlSerializer: {
|
|
44
|
-
type: [Function, Object],
|
|
45
|
-
default: void 0,
|
|
46
|
-
required: false
|
|
47
|
-
},
|
|
48
|
-
wrapper: {
|
|
49
|
-
type: [String, Object, Function],
|
|
50
|
-
default: void 0,
|
|
51
|
-
required: false
|
|
52
|
-
},
|
|
53
|
-
fallback: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: void 0,
|
|
56
|
-
required: false
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
setup(props) {
|
|
60
|
-
const { html } = usePrismicRichText(props);
|
|
61
|
-
const root = vue.ref(null);
|
|
62
|
-
const maybeRouter = vue.inject(vueRouter.routerKey, null);
|
|
63
|
-
if (maybeRouter) {
|
|
64
|
-
let links = [];
|
|
65
|
-
const navigate = function(event) {
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
maybeRouter.push(this.href);
|
|
68
|
-
};
|
|
69
|
-
const addListeners = () => {
|
|
70
|
-
const node = root.value && "$el" in root.value ? root.value.$el : root.value;
|
|
71
|
-
if (node && "querySelectorAll" in node) {
|
|
72
|
-
links = Array.from(node.querySelectorAll("a")).map((element) => {
|
|
73
|
-
const href = element.getAttribute("href");
|
|
74
|
-
if (href && isInternalURL.isInternalURL(href)) {
|
|
75
|
-
const listener = navigate.bind({ href });
|
|
76
|
-
element.addEventListener("click", listener);
|
|
77
|
-
return { element, listener };
|
|
78
|
-
} else {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
}).filter((link) => link);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
const removeListeners = () => {
|
|
85
|
-
links.forEach(({ element, listener }) => element.removeEventListener("click", listener));
|
|
86
|
-
links = [];
|
|
87
|
-
};
|
|
88
|
-
vue.watch(html, () => {
|
|
89
|
-
removeListeners();
|
|
90
|
-
vue.nextTick(addListeners);
|
|
91
|
-
}, { immediate: true });
|
|
92
|
-
vue.onBeforeUnmount(() => {
|
|
93
|
-
removeListeners();
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
return () => {
|
|
97
|
-
return vue.h(simplyResolveComponent.simplyResolveComponent(props.wrapper || defaultWrapper), {
|
|
98
|
-
innerHTML: html.value,
|
|
99
|
-
ref: root
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const PrismicRichText = PrismicRichTextImpl;
|
|
105
|
-
exports.PrismicRichText = PrismicRichText;
|
|
106
|
-
exports.PrismicRichTextImpl = PrismicRichTextImpl;
|
|
107
|
-
exports.usePrismicRichText = usePrismicRichText;
|
|
108
|
-
//# sourceMappingURL=PrismicRichText.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.cjs","sources":["../../../src/components/PrismicRichText.ts"],"sourcesContent":["import type {\n\tHTMLFunctionSerializer,\n\tHTMLMapSerializer,\n\tLinkResolverFunction,\n\tRichTextField,\n} from \"@prismicio/client\"\nimport { asHTML, isFilled } from \"@prismicio/client\"\nimport type {\n\tAllowedComponentProps,\n\tComponent,\n\tComponentCustomProps,\n\tComputedRef,\n\tConcreteComponent,\n\tDefineComponent,\n\tPropType,\n\tRaw,\n\tVNodeProps,\n} from \"vue\"\nimport {\n\tcomputed,\n\tdefineComponent,\n\th,\n\tinject,\n\tnextTick,\n\tonBeforeUnmount,\n\tref,\n\tunref,\n\twatch,\n} from \"vue\"\nimport { routerKey } from \"vue-router\"\n\nimport { isInternalURL } from \"../lib/isInternalURL\"\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\"\n\nimport type { VueUseOptions } from \"../types\"\n\nimport { usePrismic } from \"../usePrismic\"\n\n/**\n * The default component rendered to wrap the HTML output.\n */\nconst defaultWrapper = \"div\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic rich text or title field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * A link resolver function used to resolve link when not using the route\n\t * resolver parameter with `@prismicio/client`.\n\t *\n\t * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.\n\t *\n\t * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An HTML serializer to customize the way rich text fields are rendered.\n\t *\n\t * @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.\n\t *\n\t * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\tserializer?: HTMLFunctionSerializer | HTMLMapSerializer\n\n\t/**\n\t * An HTML serializer to customize the way rich text fields are rendered.\n\t *\n\t * @deprecated Use `serializer` instead.\n\t *\n\t * @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.\n\t *\n\t * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\thtmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the\n\t * output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent | Raw<DefineComponent>\n\n\t/**\n\t * The HTML value to be rendered when the field is empty. If a fallback is not\n\t * given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n}\n\n/**\n * Options for {@link usePrismicRichText}.\n */\nexport type UsePrismicRichTextOptions = VueUseOptions<\n\tOmit<PrismicRichTextProps, \"wrapper\">\n>\n\n/**\n * Return type of {@link usePrismicRichText}.\n */\nexport type UsePrismicRichTextReturnType = {\n\t/**\n\t * Serialized rich text field as HTML.\n\t */\n\thtml: ComputedRef<string>\n}\n\n/**\n * A low level composable that returns a serialized rich text field as HTML.\n *\n * @param props - {@link UsePrismicRichTextOptions}\n *\n * @returns - Serialized rich text field as HTML\n * {@link UsePrismicRichTextReturnType}\n */\nexport const usePrismicRichText = (\n\tprops: UsePrismicRichTextOptions,\n): UsePrismicRichTextReturnType => {\n\tconst { options } = usePrismic()\n\n\tconst html = computed(() => {\n\t\tconst field = unref(props.field)\n\n\t\tif (!isFilled.richText(field)) {\n\t\t\treturn unref(props.fallback) ?? \"\"\n\t\t}\n\n\t\tconst linkResolver = unref(props.linkResolver) ?? options.linkResolver\n\t\tconst serializer =\n\t\t\tunref(props.serializer) ??\n\t\t\tunref(props.htmlSerializer) ??\n\t\t\toptions.richTextSerializer ??\n\t\t\toptions.htmlSerializer\n\n\t\treturn asHTML(unref(field), linkResolver, serializer)\n\t})\n\n\treturn {\n\t\thtml,\n\t}\n}\n\n/**\n * `<PrismicRichText />` implementation.\n *\n * @internal\n */\nexport const PrismicRichTextImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicRichText\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Array as unknown as PropType<RichTextField | null | undefined>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tlinkResolver: {\n\t\t\ttype: Function as PropType<LinkResolverFunction>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tserializer: {\n\t\t\ttype: [Function, Object] as PropType<\n\t\t\t\tHTMLFunctionSerializer | HTMLMapSerializer\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\thtmlSerializer: {\n\t\t\ttype: [Function, Object] as PropType<\n\t\t\t\tHTMLFunctionSerializer | HTMLMapSerializer\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twrapper: {\n\t\t\ttype: [String, Object, Function] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tfallback: {\n\t\t\ttype: String as PropType<string>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\tconst { html } = usePrismicRichText(props)\n\n\t\tconst root = ref<HTMLElement | Comment | Component | null>(null)\n\n\t\tconst maybeRouter = inject(routerKey, null)\n\t\tif (maybeRouter) {\n\t\t\ttype InternalLink = {\n\t\t\t\telement: HTMLAnchorElement\n\t\t\t\tlistener: EventListener\n\t\t\t}\n\t\t\tlet links: InternalLink[] = []\n\n\t\t\tconst navigate: EventListener = function (\n\t\t\t\tthis: { href: string },\n\t\t\t\tevent: Event,\n\t\t\t) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tmaybeRouter.push(this.href)\n\t\t\t}\n\n\t\t\tconst addListeners = () => {\n\t\t\t\tconst node: HTMLElement | Comment | null =\n\t\t\t\t\troot.value && \"$el\" in root.value ? root.value.$el : root.value\n\t\t\t\tif (node && \"querySelectorAll\" in node) {\n\t\t\t\t\t// Get all internal link tags and add listeners on them\n\t\t\t\t\tlinks = Array.from(node.querySelectorAll(\"a\"))\n\t\t\t\t\t\t.map((element) => {\n\t\t\t\t\t\t\tconst href = element.getAttribute(\"href\")\n\n\t\t\t\t\t\t\tif (href && isInternalURL(href)) {\n\t\t\t\t\t\t\t\tconst listener = navigate.bind({ href })\n\t\t\t\t\t\t\t\telement.addEventListener(\"click\", listener)\n\n\t\t\t\t\t\t\t\treturn { element, listener }\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter((link): link is InternalLink => link as boolean)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst removeListeners = () => {\n\t\t\t\tlinks.forEach(({ element, listener }) =>\n\t\t\t\t\telement.removeEventListener(\"click\", listener),\n\t\t\t\t)\n\t\t\t\tlinks = []\n\t\t\t}\n\n\t\t\twatch(\n\t\t\t\thtml,\n\t\t\t\t() => {\n\t\t\t\t\tremoveListeners()\n\t\t\t\t\tnextTick(addListeners)\n\t\t\t\t},\n\t\t\t\t{ immediate: true },\n\t\t\t)\n\n\t\t\tonBeforeUnmount(() => {\n\t\t\t\tremoveListeners()\n\t\t\t})\n\t\t}\n\n\t\treturn () => {\n\t\t\treturn h(simplyResolveComponent(props.wrapper || defaultWrapper), {\n\t\t\t\tinnerHTML: html.value,\n\t\t\t\tref: root,\n\t\t\t})\n\t\t}\n\t},\n})\n\n// export the public type for h/tsx inference\n// also to avoid inline import() in generated d.ts files\n/**\n * Component to render a Prismic rich text field as HTML.\n *\n * @see Component props {@link PrismicRichTextProps}\n * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}\n */\nexport const PrismicRichText = PrismicRichTextImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicRichTextProps\n\t}\n}\n"],"names":["usePrismic","computed","unref","isFilled","asHTML","defineComponent","ref","inject","routerKey","isInternalURL","watch","nextTick","onBeforeUnmount","h","simplyResolveComponent"],"mappings":"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"}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import type { HTMLFunctionSerializer, HTMLMapSerializer, LinkResolverFunction, RichTextField } from "@prismicio/client";
|
|
2
|
-
import type { AllowedComponentProps, ComponentCustomProps, ComputedRef, ConcreteComponent, DefineComponent, PropType, Raw, VNodeProps } from "vue";
|
|
3
|
-
import type { VueUseOptions } from "../types";
|
|
4
|
-
/**
|
|
5
|
-
* Props for `<PrismicRichText />`.
|
|
6
|
-
*/
|
|
7
|
-
export type PrismicRichTextProps = {
|
|
8
|
-
/**
|
|
9
|
-
* The Prismic rich text or title field to render.
|
|
10
|
-
*/
|
|
11
|
-
field: RichTextField | null | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* A link resolver function used to resolve link when not using the route
|
|
14
|
-
* resolver parameter with `@prismicio/client`.
|
|
15
|
-
*
|
|
16
|
-
* @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.
|
|
17
|
-
*
|
|
18
|
-
* @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}
|
|
19
|
-
*/
|
|
20
|
-
linkResolver?: LinkResolverFunction;
|
|
21
|
-
/**
|
|
22
|
-
* An HTML serializer to customize the way rich text fields are rendered.
|
|
23
|
-
*
|
|
24
|
-
* @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
|
|
25
|
-
*
|
|
26
|
-
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
27
|
-
*/
|
|
28
|
-
serializer?: HTMLFunctionSerializer | HTMLMapSerializer;
|
|
29
|
-
/**
|
|
30
|
-
* An HTML serializer to customize the way rich text fields are rendered.
|
|
31
|
-
*
|
|
32
|
-
* @deprecated Use `serializer` instead.
|
|
33
|
-
*
|
|
34
|
-
* @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.
|
|
35
|
-
*
|
|
36
|
-
* @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}
|
|
37
|
-
*/
|
|
38
|
-
htmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer;
|
|
39
|
-
/**
|
|
40
|
-
* An HTML tag name, a component, or a functional component used to wrap the
|
|
41
|
-
* output.
|
|
42
|
-
*
|
|
43
|
-
* @defaultValue `"div"`
|
|
44
|
-
*/
|
|
45
|
-
wrapper?: string | ConcreteComponent | Raw<DefineComponent>;
|
|
46
|
-
/**
|
|
47
|
-
* The HTML value to be rendered when the field is empty. If a fallback is not
|
|
48
|
-
* given, `""` (nothing) will be rendered.
|
|
49
|
-
*/
|
|
50
|
-
fallback?: string;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Options for {@link usePrismicRichText}.
|
|
54
|
-
*/
|
|
55
|
-
export type UsePrismicRichTextOptions = VueUseOptions<Omit<PrismicRichTextProps, "wrapper">>;
|
|
56
|
-
/**
|
|
57
|
-
* Return type of {@link usePrismicRichText}.
|
|
58
|
-
*/
|
|
59
|
-
export type UsePrismicRichTextReturnType = {
|
|
60
|
-
/**
|
|
61
|
-
* Serialized rich text field as HTML.
|
|
62
|
-
*/
|
|
63
|
-
html: ComputedRef<string>;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* A low level composable that returns a serialized rich text field as HTML.
|
|
67
|
-
*
|
|
68
|
-
* @param props - {@link UsePrismicRichTextOptions}
|
|
69
|
-
*
|
|
70
|
-
* @returns - Serialized rich text field as HTML
|
|
71
|
-
* {@link UsePrismicRichTextReturnType}
|
|
72
|
-
*/
|
|
73
|
-
export declare const usePrismicRichText: (props: UsePrismicRichTextOptions) => UsePrismicRichTextReturnType;
|
|
74
|
-
/**
|
|
75
|
-
* `<PrismicRichText />` implementation.
|
|
76
|
-
*
|
|
77
|
-
* @internal
|
|
78
|
-
*/
|
|
79
|
-
export declare const PrismicRichTextImpl: DefineComponent<import("vue").ExtractPropTypes<{
|
|
80
|
-
field: {
|
|
81
|
-
type: PropType<RichTextField | null | undefined>;
|
|
82
|
-
default: undefined;
|
|
83
|
-
required: false;
|
|
84
|
-
};
|
|
85
|
-
linkResolver: {
|
|
86
|
-
type: PropType<LinkResolverFunction>;
|
|
87
|
-
default: undefined;
|
|
88
|
-
required: false;
|
|
89
|
-
};
|
|
90
|
-
serializer: {
|
|
91
|
-
type: PropType<HTMLFunctionSerializer | HTMLMapSerializer>;
|
|
92
|
-
default: undefined;
|
|
93
|
-
required: false;
|
|
94
|
-
};
|
|
95
|
-
htmlSerializer: {
|
|
96
|
-
type: PropType<HTMLFunctionSerializer | HTMLMapSerializer>;
|
|
97
|
-
default: undefined;
|
|
98
|
-
required: false;
|
|
99
|
-
};
|
|
100
|
-
wrapper: {
|
|
101
|
-
type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
|
|
102
|
-
default: undefined;
|
|
103
|
-
required: false;
|
|
104
|
-
};
|
|
105
|
-
fallback: {
|
|
106
|
-
type: PropType<string>;
|
|
107
|
-
default: undefined;
|
|
108
|
-
required: false;
|
|
109
|
-
};
|
|
110
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
111
|
-
[key: string]: any;
|
|
112
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
113
|
-
field: {
|
|
114
|
-
type: PropType<RichTextField | null | undefined>;
|
|
115
|
-
default: undefined;
|
|
116
|
-
required: false;
|
|
117
|
-
};
|
|
118
|
-
linkResolver: {
|
|
119
|
-
type: PropType<LinkResolverFunction>;
|
|
120
|
-
default: undefined;
|
|
121
|
-
required: false;
|
|
122
|
-
};
|
|
123
|
-
serializer: {
|
|
124
|
-
type: PropType<HTMLFunctionSerializer | HTMLMapSerializer>;
|
|
125
|
-
default: undefined;
|
|
126
|
-
required: false;
|
|
127
|
-
};
|
|
128
|
-
htmlSerializer: {
|
|
129
|
-
type: PropType<HTMLFunctionSerializer | HTMLMapSerializer>;
|
|
130
|
-
default: undefined;
|
|
131
|
-
required: false;
|
|
132
|
-
};
|
|
133
|
-
wrapper: {
|
|
134
|
-
type: PropType<string | ConcreteComponent | Raw<DefineComponent>>;
|
|
135
|
-
default: undefined;
|
|
136
|
-
required: false;
|
|
137
|
-
};
|
|
138
|
-
fallback: {
|
|
139
|
-
type: PropType<string>;
|
|
140
|
-
default: undefined;
|
|
141
|
-
required: false;
|
|
142
|
-
};
|
|
143
|
-
}>> & Readonly<{}>, {
|
|
144
|
-
wrapper: string | ConcreteComponent | Raw<DefineComponent>;
|
|
145
|
-
field: RichTextField | null | undefined;
|
|
146
|
-
linkResolver: LinkResolverFunction;
|
|
147
|
-
fallback: string;
|
|
148
|
-
serializer: import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer;
|
|
149
|
-
htmlSerializer: import("@prismicio/client").HTMLRichTextFunctionSerializer | import("@prismicio/client").HTMLRichTextMapSerializer;
|
|
150
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
151
|
-
/**
|
|
152
|
-
* Component to render a Prismic rich text field as HTML.
|
|
153
|
-
*
|
|
154
|
-
* @see Component props {@link PrismicRichTextProps}
|
|
155
|
-
* @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}
|
|
156
|
-
*/
|
|
157
|
-
export declare const PrismicRichText: {
|
|
158
|
-
new (): {
|
|
159
|
-
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & PrismicRichTextProps;
|
|
160
|
-
};
|
|
161
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { isFilled, asHTML } from "@prismicio/client";
|
|
2
|
-
import { computed, unref, defineComponent, ref, inject, watch, nextTick, onBeforeUnmount, h } from "vue";
|
|
3
|
-
import { routerKey } from "vue-router";
|
|
4
|
-
import { isInternalURL } from "../lib/isInternalURL.js";
|
|
5
|
-
import { simplyResolveComponent } from "../lib/simplyResolveComponent.js";
|
|
6
|
-
import { usePrismic } from "../usePrismic.js";
|
|
7
|
-
const defaultWrapper = "div";
|
|
8
|
-
const usePrismicRichText = (props) => {
|
|
9
|
-
const { options } = usePrismic();
|
|
10
|
-
const html = computed(() => {
|
|
11
|
-
const field = unref(props.field);
|
|
12
|
-
if (!isFilled.richText(field)) {
|
|
13
|
-
return unref(props.fallback) ?? "";
|
|
14
|
-
}
|
|
15
|
-
const linkResolver = unref(props.linkResolver) ?? options.linkResolver;
|
|
16
|
-
const serializer = unref(props.serializer) ?? unref(props.htmlSerializer) ?? options.richTextSerializer ?? options.htmlSerializer;
|
|
17
|
-
return asHTML(unref(field), linkResolver, serializer);
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
html
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const PrismicRichTextImpl = /* @__PURE__ */ defineComponent({
|
|
24
|
-
name: "PrismicRichText",
|
|
25
|
-
props: {
|
|
26
|
-
field: {
|
|
27
|
-
type: Array,
|
|
28
|
-
default: void 0,
|
|
29
|
-
required: false
|
|
30
|
-
},
|
|
31
|
-
linkResolver: {
|
|
32
|
-
type: Function,
|
|
33
|
-
default: void 0,
|
|
34
|
-
required: false
|
|
35
|
-
},
|
|
36
|
-
serializer: {
|
|
37
|
-
type: [Function, Object],
|
|
38
|
-
default: void 0,
|
|
39
|
-
required: false
|
|
40
|
-
},
|
|
41
|
-
htmlSerializer: {
|
|
42
|
-
type: [Function, Object],
|
|
43
|
-
default: void 0,
|
|
44
|
-
required: false
|
|
45
|
-
},
|
|
46
|
-
wrapper: {
|
|
47
|
-
type: [String, Object, Function],
|
|
48
|
-
default: void 0,
|
|
49
|
-
required: false
|
|
50
|
-
},
|
|
51
|
-
fallback: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: void 0,
|
|
54
|
-
required: false
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
setup(props) {
|
|
58
|
-
const { html } = usePrismicRichText(props);
|
|
59
|
-
const root = ref(null);
|
|
60
|
-
const maybeRouter = inject(routerKey, null);
|
|
61
|
-
if (maybeRouter) {
|
|
62
|
-
let links = [];
|
|
63
|
-
const navigate = function(event) {
|
|
64
|
-
event.preventDefault();
|
|
65
|
-
maybeRouter.push(this.href);
|
|
66
|
-
};
|
|
67
|
-
const addListeners = () => {
|
|
68
|
-
const node = root.value && "$el" in root.value ? root.value.$el : root.value;
|
|
69
|
-
if (node && "querySelectorAll" in node) {
|
|
70
|
-
links = Array.from(node.querySelectorAll("a")).map((element) => {
|
|
71
|
-
const href = element.getAttribute("href");
|
|
72
|
-
if (href && isInternalURL(href)) {
|
|
73
|
-
const listener = navigate.bind({ href });
|
|
74
|
-
element.addEventListener("click", listener);
|
|
75
|
-
return { element, listener };
|
|
76
|
-
} else {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}).filter((link) => link);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const removeListeners = () => {
|
|
83
|
-
links.forEach(({ element, listener }) => element.removeEventListener("click", listener));
|
|
84
|
-
links = [];
|
|
85
|
-
};
|
|
86
|
-
watch(html, () => {
|
|
87
|
-
removeListeners();
|
|
88
|
-
nextTick(addListeners);
|
|
89
|
-
}, { immediate: true });
|
|
90
|
-
onBeforeUnmount(() => {
|
|
91
|
-
removeListeners();
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return () => {
|
|
95
|
-
return h(simplyResolveComponent(props.wrapper || defaultWrapper), {
|
|
96
|
-
innerHTML: html.value,
|
|
97
|
-
ref: root
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
const PrismicRichText = PrismicRichTextImpl;
|
|
103
|
-
export {
|
|
104
|
-
PrismicRichText,
|
|
105
|
-
PrismicRichTextImpl,
|
|
106
|
-
usePrismicRichText
|
|
107
|
-
};
|
|
108
|
-
//# sourceMappingURL=PrismicRichText.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicRichText.js","sources":["../../../src/components/PrismicRichText.ts"],"sourcesContent":["import type {\n\tHTMLFunctionSerializer,\n\tHTMLMapSerializer,\n\tLinkResolverFunction,\n\tRichTextField,\n} from \"@prismicio/client\"\nimport { asHTML, isFilled } from \"@prismicio/client\"\nimport type {\n\tAllowedComponentProps,\n\tComponent,\n\tComponentCustomProps,\n\tComputedRef,\n\tConcreteComponent,\n\tDefineComponent,\n\tPropType,\n\tRaw,\n\tVNodeProps,\n} from \"vue\"\nimport {\n\tcomputed,\n\tdefineComponent,\n\th,\n\tinject,\n\tnextTick,\n\tonBeforeUnmount,\n\tref,\n\tunref,\n\twatch,\n} from \"vue\"\nimport { routerKey } from \"vue-router\"\n\nimport { isInternalURL } from \"../lib/isInternalURL\"\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\"\n\nimport type { VueUseOptions } from \"../types\"\n\nimport { usePrismic } from \"../usePrismic\"\n\n/**\n * The default component rendered to wrap the HTML output.\n */\nconst defaultWrapper = \"div\"\n\n/**\n * Props for `<PrismicRichText />`.\n */\nexport type PrismicRichTextProps = {\n\t/**\n\t * The Prismic rich text or title field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * A link resolver function used to resolve link when not using the route\n\t * resolver parameter with `@prismicio/client`.\n\t *\n\t * @defaultValue The link resolver provided to `@prismicio/vue` plugin if configured.\n\t *\n\t * @see Link resolver documentation {@link https://prismic.io/docs/core-concepts/link-resolver-route-resolver#link-resolver}\n\t */\n\tlinkResolver?: LinkResolverFunction\n\n\t/**\n\t * An HTML serializer to customize the way rich text fields are rendered.\n\t *\n\t * @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.\n\t *\n\t * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\tserializer?: HTMLFunctionSerializer | HTMLMapSerializer\n\n\t/**\n\t * An HTML serializer to customize the way rich text fields are rendered.\n\t *\n\t * @deprecated Use `serializer` instead.\n\t *\n\t * @defaultValue The HTML serializer provided to `@prismicio/vue` plugin if configured.\n\t *\n\t * @see HTML serializer documentation {@link https://prismic.io/docs/core-concepts/html-serializer}\n\t */\n\thtmlSerializer?: HTMLFunctionSerializer | HTMLMapSerializer\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the\n\t * output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent | Raw<DefineComponent>\n\n\t/**\n\t * The HTML value to be rendered when the field is empty. If a fallback is not\n\t * given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n}\n\n/**\n * Options for {@link usePrismicRichText}.\n */\nexport type UsePrismicRichTextOptions = VueUseOptions<\n\tOmit<PrismicRichTextProps, \"wrapper\">\n>\n\n/**\n * Return type of {@link usePrismicRichText}.\n */\nexport type UsePrismicRichTextReturnType = {\n\t/**\n\t * Serialized rich text field as HTML.\n\t */\n\thtml: ComputedRef<string>\n}\n\n/**\n * A low level composable that returns a serialized rich text field as HTML.\n *\n * @param props - {@link UsePrismicRichTextOptions}\n *\n * @returns - Serialized rich text field as HTML\n * {@link UsePrismicRichTextReturnType}\n */\nexport const usePrismicRichText = (\n\tprops: UsePrismicRichTextOptions,\n): UsePrismicRichTextReturnType => {\n\tconst { options } = usePrismic()\n\n\tconst html = computed(() => {\n\t\tconst field = unref(props.field)\n\n\t\tif (!isFilled.richText(field)) {\n\t\t\treturn unref(props.fallback) ?? \"\"\n\t\t}\n\n\t\tconst linkResolver = unref(props.linkResolver) ?? options.linkResolver\n\t\tconst serializer =\n\t\t\tunref(props.serializer) ??\n\t\t\tunref(props.htmlSerializer) ??\n\t\t\toptions.richTextSerializer ??\n\t\t\toptions.htmlSerializer\n\n\t\treturn asHTML(unref(field), linkResolver, serializer)\n\t})\n\n\treturn {\n\t\thtml,\n\t}\n}\n\n/**\n * `<PrismicRichText />` implementation.\n *\n * @internal\n */\nexport const PrismicRichTextImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicRichText\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Array as unknown as PropType<RichTextField | null | undefined>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tlinkResolver: {\n\t\t\ttype: Function as PropType<LinkResolverFunction>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tserializer: {\n\t\t\ttype: [Function, Object] as PropType<\n\t\t\t\tHTMLFunctionSerializer | HTMLMapSerializer\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\thtmlSerializer: {\n\t\t\ttype: [Function, Object] as PropType<\n\t\t\t\tHTMLFunctionSerializer | HTMLMapSerializer\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twrapper: {\n\t\t\ttype: [String, Object, Function] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tfallback: {\n\t\t\ttype: String as PropType<string>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\tconst { html } = usePrismicRichText(props)\n\n\t\tconst root = ref<HTMLElement | Comment | Component | null>(null)\n\n\t\tconst maybeRouter = inject(routerKey, null)\n\t\tif (maybeRouter) {\n\t\t\ttype InternalLink = {\n\t\t\t\telement: HTMLAnchorElement\n\t\t\t\tlistener: EventListener\n\t\t\t}\n\t\t\tlet links: InternalLink[] = []\n\n\t\t\tconst navigate: EventListener = function (\n\t\t\t\tthis: { href: string },\n\t\t\t\tevent: Event,\n\t\t\t) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tmaybeRouter.push(this.href)\n\t\t\t}\n\n\t\t\tconst addListeners = () => {\n\t\t\t\tconst node: HTMLElement | Comment | null =\n\t\t\t\t\troot.value && \"$el\" in root.value ? root.value.$el : root.value\n\t\t\t\tif (node && \"querySelectorAll\" in node) {\n\t\t\t\t\t// Get all internal link tags and add listeners on them\n\t\t\t\t\tlinks = Array.from(node.querySelectorAll(\"a\"))\n\t\t\t\t\t\t.map((element) => {\n\t\t\t\t\t\t\tconst href = element.getAttribute(\"href\")\n\n\t\t\t\t\t\t\tif (href && isInternalURL(href)) {\n\t\t\t\t\t\t\t\tconst listener = navigate.bind({ href })\n\t\t\t\t\t\t\t\telement.addEventListener(\"click\", listener)\n\n\t\t\t\t\t\t\t\treturn { element, listener }\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter((link): link is InternalLink => link as boolean)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst removeListeners = () => {\n\t\t\t\tlinks.forEach(({ element, listener }) =>\n\t\t\t\t\telement.removeEventListener(\"click\", listener),\n\t\t\t\t)\n\t\t\t\tlinks = []\n\t\t\t}\n\n\t\t\twatch(\n\t\t\t\thtml,\n\t\t\t\t() => {\n\t\t\t\t\tremoveListeners()\n\t\t\t\t\tnextTick(addListeners)\n\t\t\t\t},\n\t\t\t\t{ immediate: true },\n\t\t\t)\n\n\t\t\tonBeforeUnmount(() => {\n\t\t\t\tremoveListeners()\n\t\t\t})\n\t\t}\n\n\t\treturn () => {\n\t\t\treturn h(simplyResolveComponent(props.wrapper || defaultWrapper), {\n\t\t\t\tinnerHTML: html.value,\n\t\t\t\tref: root,\n\t\t\t})\n\t\t}\n\t},\n})\n\n// export the public type for h/tsx inference\n// also to avoid inline import() in generated d.ts files\n/**\n * Component to render a Prismic rich text field as HTML.\n *\n * @see Component props {@link PrismicRichTextProps}\n * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}\n */\nexport const PrismicRichText = PrismicRichTextImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicRichTextProps\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAyCA,MAAM,iBAAiB;AAiFV,MAAA,qBAAqB,CACjC,UACiC;AAC3B,QAAA,EAAE,QAAO,IAAK;AAEd,QAAA,OAAO,SAAS,MAAK;AACpB,UAAA,QAAQ,MAAM,MAAM,KAAK;AAE/B,QAAI,CAAC,SAAS,SAAS,KAAK,GAAG;AACvB,aAAA,MAAM,MAAM,QAAQ,KAAK;AAAA,IAAA;AAGjC,UAAM,eAAe,MAAM,MAAM,YAAY,KAAK,QAAQ;AACpD,UAAA,aACL,MAAM,MAAM,UAAU,KACtB,MAAM,MAAM,cAAc,KAC1B,QAAQ,sBACR,QAAQ;AAET,WAAO,OAAO,MAAM,KAAK,GAAG,cAAc,UAAU;AAAA,EAAA,CACpD;AAEM,SAAA;AAAA,IACN;AAAA;AAEF;AAOO,MAAM,sBAAoD,gCAAA;AAAA,EAChE,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,cAAc;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,YAAY;AAAA,MACX,MAAM,CAAC,UAAU,MAAM;AAAA,MAGvB,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,gBAAgB;AAAA,MACf,MAAM,CAAC,UAAU,MAAM;AAAA,MAGvB,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,SAAS;AAAA,MACR,MAAM,CAAC,QAAQ,QAAQ,QAAQ;AAAA,MAG/B,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,UAAU;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IAAA;AAAA,EAEX;AAAA,EACD,MAAM,OAAK;AACV,UAAM,EAAE,KAAA,IAAS,mBAAmB,KAAK;AAEnC,UAAA,OAAO,IAA8C,IAAI;AAEzD,UAAA,cAAc,OAAO,WAAW,IAAI;AAC1C,QAAI,aAAa;AAKhB,UAAI,QAAwB,CAAA;AAEtB,YAAA,WAA0B,SAE/B,OAAY;AAEZ,cAAM,eAAc;AACR,oBAAA,KAAK,KAAK,IAAI;AAAA,MAC3B;AAEA,YAAM,eAAe,MAAK;AACnB,cAAA,OACL,KAAK,SAAS,SAAS,KAAK,QAAQ,KAAK,MAAM,MAAM,KAAK;AACvD,YAAA,QAAQ,sBAAsB,MAAM;AAE/B,kBAAA,MAAM,KAAK,KAAK,iBAAiB,GAAG,CAAC,EAC3C,IAAI,CAAC,YAAW;AACV,kBAAA,OAAO,QAAQ,aAAa,MAAM;AAEpC,gBAAA,QAAQ,cAAc,IAAI,GAAG;AAChC,oBAAM,WAAW,SAAS,KAAK,EAAE,MAAM;AAC/B,sBAAA,iBAAiB,SAAS,QAAQ;AAEnC,qBAAA,EAAE,SAAS;mBACZ;AACC,qBAAA;AAAA,YAAA;AAAA,UAER,CAAA,EACA,OAAO,CAAC,SAA+B,IAAe;AAAA,QAAA;AAAA,MAE1D;AAEA,YAAM,kBAAkB,MAAK;AACtB,cAAA,QAAQ,CAAC,EAAE,SAAS,eACzB,QAAQ,oBAAoB,SAAS,QAAQ,CAAC;AAE/C,gBAAQ;MACT;AAEA,YACC,MACA,MAAK;;AAEJ,iBAAS,YAAY;AAAA,MAAA,GAEtB,EAAE,WAAW,MAAM;AAGpB,sBAAgB,MAAK;;OAEpB;AAAA,IAAA;AAGF,WAAO,MAAK;AACX,aAAO,EAAE,uBAAuB,MAAM,WAAW,cAAc,GAAG;AAAA,QACjE,WAAW,KAAK;AAAA,QAChB,KAAK;AAAA,MAAA,CACL;AAAA,IACF;AAAA,EAAA;AAED,CAAA;AAUM,MAAM,kBAAkB;"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const client = require("@prismicio/client");
|
|
4
|
-
const vue = require("vue");
|
|
5
|
-
const simplyResolveComponent = require("../lib/simplyResolveComponent.cjs");
|
|
6
|
-
const defaultWrapper = "div";
|
|
7
|
-
const usePrismicText = (props) => {
|
|
8
|
-
const text = vue.computed(() => {
|
|
9
|
-
const field = vue.unref(props.field);
|
|
10
|
-
if (!client.isFilled.richText(field)) {
|
|
11
|
-
return vue.unref(props.fallback) ?? "";
|
|
12
|
-
}
|
|
13
|
-
return client.asText(vue.unref(field), vue.unref(props.separator));
|
|
14
|
-
});
|
|
15
|
-
return {
|
|
16
|
-
text
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
const PrismicTextImpl = /* @__PURE__ */ vue.defineComponent({
|
|
20
|
-
name: "PrismicText",
|
|
21
|
-
props: {
|
|
22
|
-
field: {
|
|
23
|
-
type: Array,
|
|
24
|
-
default: void 0,
|
|
25
|
-
required: false
|
|
26
|
-
},
|
|
27
|
-
separator: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: void 0,
|
|
30
|
-
required: false
|
|
31
|
-
},
|
|
32
|
-
wrapper: {
|
|
33
|
-
type: [String, Object, Function],
|
|
34
|
-
default: void 0,
|
|
35
|
-
required: false
|
|
36
|
-
},
|
|
37
|
-
fallback: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: void 0,
|
|
40
|
-
required: false
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
setup(props) {
|
|
44
|
-
const { text } = usePrismicText(props);
|
|
45
|
-
return () => {
|
|
46
|
-
const parent = simplyResolveComponent.simplyResolveComponent(props.wrapper || defaultWrapper);
|
|
47
|
-
return vue.h(parent, null, {
|
|
48
|
-
default: () => text.value
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const PrismicText = PrismicTextImpl;
|
|
54
|
-
exports.PrismicText = PrismicText;
|
|
55
|
-
exports.PrismicTextImpl = PrismicTextImpl;
|
|
56
|
-
exports.usePrismicText = usePrismicText;
|
|
57
|
-
//# sourceMappingURL=PrismicText.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PrismicText.cjs","sources":["../../../src/components/PrismicText.ts"],"sourcesContent":["import type { RichTextField } from \"@prismicio/client\"\nimport { asText, isFilled } from \"@prismicio/client\"\nimport type {\n\tAllowedComponentProps,\n\tComponentCustomProps,\n\tComputedRef,\n\tConcreteComponent,\n\tDefineComponent,\n\tPropType,\n\tRaw,\n\tVNode,\n\tVNodeProps,\n} from \"vue\"\nimport { computed, defineComponent, h, unref } from \"vue\"\n\nimport { simplyResolveComponent } from \"../lib/simplyResolveComponent\"\n\nimport type { VueUseOptions } from \"../types\"\n\n/**\n * The default component rendered to wrap the text output.\n */\nconst defaultWrapper = \"div\"\n/**\n * Props for `<PrismicText />`.\n */\nexport type PrismicTextProps = {\n\t/**\n\t * The Prismic rich text or title field to render.\n\t */\n\tfield: RichTextField | null | undefined\n\n\t/**\n\t * Separator used to join each element.\n\t *\n\t * @defaultValue `\" \"` (a space)\n\t */\n\tseparator?: string\n\n\t/**\n\t * An HTML tag name, a component, or a functional component used to wrap the\n\t * output.\n\t *\n\t * @defaultValue `\"div\"`\n\t */\n\twrapper?: string | ConcreteComponent | Raw<DefineComponent>\n\n\t/**\n\t * The string value to be rendered when the field is empty. If a fallback is\n\t * not given, `\"\"` (nothing) will be rendered.\n\t */\n\tfallback?: string\n}\n\n/**\n * Options for {@link usePrismicText}.\n */\nexport type UsePrismicTextOptions = VueUseOptions<\n\tOmit<PrismicTextProps, \"wrapper\">\n>\n\n/**\n * Return type of {@link usePrismicText}.\n */\nexport type UsePrismicTextReturnType = {\n\t/**\n\t * Serialized rich text field as plain text.\n\t */\n\ttext: ComputedRef<string>\n}\n\n/**\n * A low level composable that returns a serialized rich text field as plain\n * text.\n *\n * @param props - {@link UsePrismicTextOptions}\n *\n * @returns - Serialized rich text field as plain text\n * {@link UsePrismicTextReturnType}\n */\nexport const usePrismicText = (\n\tprops: UsePrismicTextOptions,\n): UsePrismicTextReturnType => {\n\tconst text = computed(() => {\n\t\tconst field = unref(props.field)\n\n\t\tif (!isFilled.richText(field)) {\n\t\t\treturn unref(props.fallback) ?? \"\"\n\t\t}\n\n\t\treturn asText(unref(field), unref(props.separator))\n\t})\n\n\treturn {\n\t\ttext,\n\t}\n}\n\n/**\n * `<PrismicText />` implementation.\n *\n * @internal\n */\nexport const PrismicTextImpl = /*#__PURE__*/ defineComponent({\n\tname: \"PrismicText\",\n\tprops: {\n\t\tfield: {\n\t\t\ttype: Array as unknown as PropType<RichTextField | null | undefined>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tseparator: {\n\t\t\ttype: String as PropType<string>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\twrapper: {\n\t\t\ttype: [String, Object, Function] as PropType<\n\t\t\t\tstring | ConcreteComponent | Raw<DefineComponent>\n\t\t\t>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t\tfallback: {\n\t\t\ttype: String as PropType<string>,\n\t\t\tdefault: undefined,\n\t\t\trequired: false,\n\t\t},\n\t},\n\tsetup(props) {\n\t\tconst { text } = usePrismicText(props)\n\n\t\treturn () => {\n\t\t\tconst parent = simplyResolveComponent(props.wrapper || defaultWrapper)\n\n\t\t\t// This works but is absurd\n\t\t\t// if (typeof parent === \"string\") {\n\t\t\t// \treturn h(parent, null, { default: () => text.value });\n\t\t\t// } else {\n\t\t\t// \treturn h(parent, null, { default: () => text.value });\n\t\t\t// }\n\n\t\t\treturn h(parent as VNode, null, {\n\t\t\t\tdefault: () => text.value,\n\t\t\t})\n\t\t}\n\t},\n})\n\n// export the public type for h/tsx inference\n// also to avoid inline import() in generated d.ts files\n/**\n * Component to render a Prismic rich text field as plain text.\n *\n * @see Component props {@link PrismicTextProps}\n * @see Templating rich text and title fields {@link https://prismic.io/docs/technologies/vue-template-content#rich-text-and-titles}\n */\nexport const PrismicText = PrismicTextImpl as unknown as {\n\tnew (): {\n\t\t$props: AllowedComponentProps &\n\t\t\tComponentCustomProps &\n\t\t\tVNodeProps &\n\t\t\tPrismicTextProps\n\t}\n}\n"],"names":["computed","unref","isFilled","asText","defineComponent","simplyResolveComponent","h"],"mappings":";;;;;AAsBA,MAAM,iBAAiB;AA0DV,MAAA,iBAAiB,CAC7B,UAC6B;AACvB,QAAA,OAAOA,IAAAA,SAAS,MAAK;AACpB,UAAA,QAAQC,IAAAA,MAAM,MAAM,KAAK;AAE/B,QAAI,CAACC,OAAA,SAAS,SAAS,KAAK,GAAG;AACvB,aAAAD,UAAM,MAAM,QAAQ,KAAK;AAAA,IAAA;AAGjC,WAAOE,OAAAA,OAAOF,IAAAA,MAAM,KAAK,GAAGA,IAAAA,MAAM,MAAM,SAAS,CAAC;AAAA,EAAA,CAClD;AAEM,SAAA;AAAA,IACN;AAAA;AAEF;AAOO,MAAM,kBAAgDG,oBAAAA,gBAAA;AAAA,EAC5D,MAAM;AAAA,EACN,OAAO;AAAA,IACN,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,WAAW;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,SAAS;AAAA,MACR,MAAM,CAAC,QAAQ,QAAQ,QAAQ;AAAA,MAG/B,SAAS;AAAA,MACT,UAAU;AAAA,IACV;AAAA,IACD,UAAU;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IAAA;AAAA,EAEX;AAAA,EACD,MAAM,OAAK;AACV,UAAM,EAAE,KAAA,IAAS,eAAe,KAAK;AAErC,WAAO,MAAK;AACX,YAAM,SAASC,uBAAA,uBAAuB,MAAM,WAAW,cAAc;AAS9D,aAAAC,IAAA,EAAE,QAAiB,MAAM;AAAA,QAC/B,SAAS,MAAM,KAAK;AAAA,MAAA,CACpB;AAAA,IACF;AAAA,EAAA;AAED,CAAA;AAUM,MAAM,cAAc;;;;"}
|