@dotcms/vue 1.5.5 → 1.7.0-next.37
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 +154 -6
- package/index.d.ts +4 -0
- package/index.js +521 -451
- package/lib/client/dotcms-client.plugin.d.ts +79 -0
- package/lib/components/DotCMSLayoutBody/types.d.ts +8 -0
- package/lib/composables/useDotCMSShowWhen.d.ts +6 -4
- package/lib/composables/useEditableDotCMSPage.d.ts +6 -3
- package/lib/contexts/dotcms-page.context.d.ts +23 -10
- package/lib/utils/imageLoader.d.ts +54 -0
- package/package.json +45 -45
package/index.js
CHANGED
|
@@ -1,331 +1,381 @@
|
|
|
1
|
-
import { isRef as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import Se from "@
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { inject as ee, isRef as le, isReactive as ie, toRaw as j, shallowRef as ue, toValue as L, watch as V, onMounted as b, onBeforeUnmount as K, ref as N, computed as c, defineComponent as v, unref as E, renderSlot as S, createCommentVNode as T, provide as de, openBlock as r, createElementBlock as i, createElementVNode as y, createTextVNode as C, normalizeStyle as w, toDisplayString as O, mergeProps as $, Fragment as k, createBlock as f, resolveDynamicComponent as D, normalizeProps as R, getCurrentInstance as me, renderList as M, normalizeClass as W, markRaw as te, useSlots as pe, createVNode as h, withCtx as B, resolveComponent as ne } from "vue";
|
|
2
|
+
import { createDotCMSClient as ve } from "@dotcms/client";
|
|
3
|
+
import { UVEEventType as fe, UVE_MODE as P, DotCMSUVEAction as z } from "@dotcms/types";
|
|
4
|
+
import { createUVESubscription as ye, getUVEState as x, initUVE as _e, updateNavigation as ge, sendMessageToUVE as X } from "@dotcms/uve";
|
|
5
|
+
import { registerStyleEditorSchemas as Ce, isDotAnalyticsActive as Q, ANALYTICS_READY_EVENT as J, DEVELOPMENT_MODE as Ee, EMPTY_CONTAINER_STYLE_REACT as oe, getDotContentletAttributes as ke, getAnalyticsContentletAttributes as De, CUSTOM_NO_COMPONENT as Te, getContainersData as Me, getContentletsInContainer as he, getDotContainerAttributes as be, combineClasses as Se, DOT_SECTION_ID_PREFIX as Ne, __DEFAULT_TINYMCE_CONFIG__ as we, __BASE_TINYMCE_CONFIG_WITH_NO_DEFAULT__ as H, __TINYMCE_PATH_ON_DOTCMS__ as $e, isValidBlocks as Oe } from "@dotcms/uve/internal";
|
|
6
|
+
import xe from "@tinymce/tinymce-vue";
|
|
7
|
+
import { __DOTCMS_UVE_EVENT__ as Ae, BlockEditorDefaultBlocks as Ie } from "@dotcms/types/internal";
|
|
8
|
+
const se = /* @__PURE__ */ Symbol("DotCMSClient");
|
|
9
|
+
function qt(t) {
|
|
10
|
+
const e = ve(t);
|
|
11
|
+
return {
|
|
12
|
+
client: e,
|
|
13
|
+
install(n) {
|
|
14
|
+
n.provide(se, e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function zt() {
|
|
19
|
+
const t = ee(se, null);
|
|
20
|
+
if (!t)
|
|
21
|
+
throw new Error(
|
|
22
|
+
"[useDotCMSClient] No dotCMS client found. Did you install the plugin with `app.use(createDotCMSVue({ ... }))`?"
|
|
23
|
+
);
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
function Re(t) {
|
|
27
|
+
const e = /* @__PURE__ */ new WeakMap(), n = (a) => {
|
|
28
|
+
const o = le(a) ? a.value : ie(a) ? j(a) : a;
|
|
29
|
+
if (o === null || typeof o != "object")
|
|
30
|
+
return o;
|
|
31
|
+
if (e.has(o))
|
|
32
|
+
return e.get(o);
|
|
33
|
+
if (Array.isArray(o)) {
|
|
15
34
|
const d = [];
|
|
16
|
-
return
|
|
35
|
+
return e.set(o, d), o.forEach((p) => d.push(n(p))), d;
|
|
17
36
|
}
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
for (const d of Object.keys(
|
|
24
|
-
|
|
25
|
-
return
|
|
37
|
+
const s = Object.getPrototypeOf(o);
|
|
38
|
+
if (s !== Object.prototype && s !== null)
|
|
39
|
+
return o;
|
|
40
|
+
const l = {};
|
|
41
|
+
e.set(o, l);
|
|
42
|
+
for (const d of Object.keys(o))
|
|
43
|
+
l[d] = n(o[d]);
|
|
44
|
+
return l;
|
|
26
45
|
};
|
|
27
|
-
return
|
|
46
|
+
return n(t);
|
|
28
47
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
if (!
|
|
48
|
+
function Xt(t) {
|
|
49
|
+
const e = ue(L(t));
|
|
50
|
+
let n, a;
|
|
51
|
+
const o = (s) => {
|
|
52
|
+
if (n?.(), n = void 0, !x())
|
|
34
53
|
return;
|
|
35
|
-
if (!
|
|
54
|
+
if (!s) {
|
|
36
55
|
console.warn("[useEditableDotCMSPage]: No page response provided");
|
|
37
56
|
return;
|
|
38
57
|
}
|
|
39
|
-
const
|
|
40
|
-
({ destroyUVESubscriptions:
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
const l = Re(s), d = l?.pageAsset?.page?.pageURI;
|
|
59
|
+
({ destroyUVESubscriptions: n } = _e(l)), d && ge(d), l.styleEditorSchemas?.length && Ce(l.styleEditorSchemas);
|
|
60
|
+
};
|
|
61
|
+
return V(
|
|
62
|
+
() => L(t),
|
|
63
|
+
(s) => {
|
|
64
|
+
e.value = s, o(s);
|
|
65
|
+
},
|
|
66
|
+
{ immediate: !0 }
|
|
67
|
+
), b(() => {
|
|
68
|
+
({ unsubscribe: a } = ye(
|
|
69
|
+
fe.CONTENT_CHANGES,
|
|
70
|
+
(s) => {
|
|
71
|
+
e.value = s;
|
|
46
72
|
}
|
|
47
73
|
));
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
}),
|
|
74
|
+
}), K(() => {
|
|
75
|
+
n?.(), a?.();
|
|
76
|
+
}), e;
|
|
51
77
|
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
}),
|
|
78
|
+
function Le(t) {
|
|
79
|
+
const e = N(!1);
|
|
80
|
+
return b(() => {
|
|
81
|
+
e.value = !0;
|
|
82
|
+
}), c(() => e.value ? x()?.mode === L(t) : !1);
|
|
83
|
+
}
|
|
84
|
+
const Be = /^https?:\/\//;
|
|
85
|
+
function Qt(t = "") {
|
|
86
|
+
const e = t ? new URL(t).origin : "";
|
|
87
|
+
return (n, a = {}) => {
|
|
88
|
+
if (Be.test(n))
|
|
89
|
+
return n;
|
|
90
|
+
const { width: o, quality: s = 50, languageId: l = "1" } = a, d = n.includes("/dA/") ? n : `/dA/${n}`, p = o ? `/${o}w` : "";
|
|
91
|
+
return `${e}${d}${p}/${s}q?language_id=${l}`;
|
|
92
|
+
};
|
|
57
93
|
}
|
|
58
|
-
const
|
|
94
|
+
const Jt = /* @__PURE__ */ v({
|
|
59
95
|
__name: "DotCMSShow",
|
|
60
96
|
props: {
|
|
61
|
-
when: { default:
|
|
97
|
+
when: { default: P.EDIT }
|
|
62
98
|
},
|
|
63
|
-
setup(
|
|
64
|
-
const
|
|
65
|
-
return (
|
|
99
|
+
setup(t) {
|
|
100
|
+
const e = t, n = Le(() => e.when);
|
|
101
|
+
return (a, o) => E(n) ? S(a.$slots, "default", { key: 0 }) : T("", !0);
|
|
66
102
|
}
|
|
67
|
-
}),
|
|
68
|
-
function
|
|
69
|
-
|
|
103
|
+
}), re = /* @__PURE__ */ Symbol("DotCMSPageContext");
|
|
104
|
+
function Pe(t) {
|
|
105
|
+
de(re, t);
|
|
70
106
|
}
|
|
71
|
-
const
|
|
107
|
+
const Ue = {
|
|
72
108
|
pageAsset: {},
|
|
73
109
|
mode: "production",
|
|
74
110
|
userComponents: {},
|
|
75
111
|
isDevMode: !1,
|
|
76
|
-
isAnalyticsActive: !1
|
|
112
|
+
isAnalyticsActive: !1,
|
|
113
|
+
slots: {}
|
|
77
114
|
};
|
|
78
|
-
function
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
c(() =>
|
|
115
|
+
function A() {
|
|
116
|
+
return ee(
|
|
117
|
+
re,
|
|
118
|
+
c(() => Ue)
|
|
82
119
|
);
|
|
83
120
|
}
|
|
84
|
-
const
|
|
121
|
+
const Ve = {
|
|
85
122
|
key: 0,
|
|
86
123
|
"data-testid": "error-message",
|
|
87
124
|
style: { padding: "1rem", border: "1px solid #e0e0e0", borderRadius: "4px" }
|
|
88
|
-
},
|
|
125
|
+
}, Fe = /* @__PURE__ */ v({
|
|
89
126
|
__name: "ErrorMessage",
|
|
90
|
-
setup(
|
|
91
|
-
const
|
|
92
|
-
return
|
|
127
|
+
setup(t) {
|
|
128
|
+
const e = A(), n = c(() => e.value.isDevMode);
|
|
129
|
+
return b(() => {
|
|
93
130
|
console.warn("Missing required layout.body property in page");
|
|
94
|
-
}), (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
131
|
+
}), (a, o) => n.value ? (r(), i("div", Ve, [...o[0] || (o[0] = [
|
|
132
|
+
y("p", { style: { margin: "0 0 0.5rem", color: "#666" } }, [
|
|
133
|
+
C(" The "),
|
|
134
|
+
y("code", null, "page"),
|
|
135
|
+
C(" is missing the required "),
|
|
136
|
+
y("code", null, "layout.body"),
|
|
137
|
+
C(" property. ")
|
|
101
138
|
], -1),
|
|
102
|
-
|
|
139
|
+
y("p", { style: { margin: 0, color: "#666" } }, " Make sure the page asset is properly loaded and includes a layout configuration. ", -1)
|
|
103
140
|
])])) : T("", !0);
|
|
104
141
|
}
|
|
105
|
-
});
|
|
106
|
-
function
|
|
107
|
-
const
|
|
108
|
-
|
|
142
|
+
}), Z = "contentlet-";
|
|
143
|
+
function Ge() {
|
|
144
|
+
const t = N(!1), e = () => {
|
|
145
|
+
t.value = Q();
|
|
109
146
|
};
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
}),
|
|
113
|
-
window.removeEventListener(
|
|
114
|
-
}),
|
|
147
|
+
return b(() => {
|
|
148
|
+
t.value = Q(), window.addEventListener(J, e);
|
|
149
|
+
}), K(() => {
|
|
150
|
+
window.removeEventListener(J, e);
|
|
151
|
+
}), t;
|
|
115
152
|
}
|
|
116
|
-
function
|
|
117
|
-
const
|
|
118
|
-
return
|
|
153
|
+
function He(t) {
|
|
154
|
+
const e = x()?.mode;
|
|
155
|
+
return e ? e === P.EDIT : t === Ee;
|
|
119
156
|
}
|
|
120
|
-
function
|
|
121
|
-
return c(() =>
|
|
157
|
+
function Ye(t) {
|
|
158
|
+
return c(() => He(L(t)));
|
|
122
159
|
}
|
|
123
|
-
const
|
|
160
|
+
const je = /* @__PURE__ */ v({
|
|
124
161
|
__name: "ContainerNotFound",
|
|
125
162
|
props: {
|
|
126
163
|
identifier: {}
|
|
127
164
|
},
|
|
128
|
-
setup(
|
|
129
|
-
const
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
}), (
|
|
165
|
+
setup(t) {
|
|
166
|
+
const e = t, n = A(), a = c(() => n.value.isDevMode);
|
|
167
|
+
return b(() => {
|
|
168
|
+
a.value && console.error(`Container with identifier ${e.identifier} not found`);
|
|
169
|
+
}), (o, s) => a.value ? (r(), i("div", {
|
|
133
170
|
key: 0,
|
|
134
171
|
"data-testid": "container-not-found",
|
|
135
|
-
style: w(
|
|
136
|
-
}, " This container with identifier " +
|
|
172
|
+
style: w(E(oe))
|
|
173
|
+
}, " This container with identifier " + O(t.identifier) + " was not found. ", 5)) : T("", !0);
|
|
137
174
|
}
|
|
138
|
-
}),
|
|
175
|
+
}), Ke = /* @__PURE__ */ v({
|
|
139
176
|
inheritAttrs: !1,
|
|
140
177
|
__name: "EmptyContainer",
|
|
141
|
-
setup(
|
|
142
|
-
const
|
|
143
|
-
return (
|
|
144
|
-
|
|
178
|
+
setup(t) {
|
|
179
|
+
const e = A(), n = c(() => e.value.isDevMode);
|
|
180
|
+
return (a, o) => n.value ? (r(), i("div", $({ key: 0 }, a.$attrs, { style: E(oe) }), [...o[0] || (o[0] = [
|
|
181
|
+
y("span", {
|
|
145
182
|
"data-testid": "empty-container-message",
|
|
146
183
|
"data-dot-object": "empty-content"
|
|
147
184
|
}, " This container is empty. ", -1)
|
|
148
185
|
])], 16)) : T("", !0);
|
|
149
186
|
}
|
|
150
187
|
});
|
|
151
|
-
function
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
}),
|
|
188
|
+
function We(t) {
|
|
189
|
+
const e = N(!1);
|
|
190
|
+
return b(() => {
|
|
191
|
+
const n = t()?.getBoundingClientRect().height ?? 0;
|
|
192
|
+
e.value = n > 0;
|
|
193
|
+
}), e;
|
|
157
194
|
}
|
|
158
|
-
const
|
|
195
|
+
const qe = "dotcms-contentlet", ze = {
|
|
159
196
|
key: 1,
|
|
160
197
|
"data-testid": "no-component"
|
|
161
|
-
},
|
|
198
|
+
}, Xe = /* @__PURE__ */ v({
|
|
162
199
|
__name: "FallbackComponent",
|
|
163
200
|
props: {
|
|
164
201
|
contentlet: {},
|
|
165
202
|
userNoComponent: {}
|
|
166
203
|
},
|
|
167
|
-
setup(
|
|
168
|
-
const
|
|
169
|
-
return (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
204
|
+
setup(t) {
|
|
205
|
+
const e = t, n = A(), a = c(() => n.value.isDevMode), o = c(() => !!e.userNoComponent);
|
|
206
|
+
return (s, l) => a.value ? (r(), i(k, { key: 0 }, [
|
|
207
|
+
o.value ? (r(), f(D(t.userNoComponent), R($({ key: 0 }, t.contentlet)), null, 16)) : (r(), i("div", ze, [
|
|
208
|
+
l[0] || (l[0] = C(" No Component for ", -1)),
|
|
209
|
+
y("strong", null, O(t.contentlet.contentType), 1),
|
|
210
|
+
l[1] || (l[1] = C(" . ", -1))
|
|
174
211
|
]))
|
|
175
212
|
], 64)) : T("", !0);
|
|
176
213
|
}
|
|
177
|
-
}),
|
|
214
|
+
}), Qe = /* @__PURE__ */ v({
|
|
178
215
|
__name: "Contentlet",
|
|
179
216
|
props: {
|
|
180
217
|
contentlet: {},
|
|
181
218
|
container: {}
|
|
182
219
|
},
|
|
183
|
-
setup(
|
|
184
|
-
const
|
|
185
|
-
() =>
|
|
186
|
-
),
|
|
187
|
-
...
|
|
220
|
+
setup(t) {
|
|
221
|
+
const e = t, n = A(), a = c(() => n.value.isDevMode), o = me(), s = We(
|
|
222
|
+
() => o?.proxy?.$el
|
|
223
|
+
), l = c(() => n.value.isDevMode ? {
|
|
224
|
+
...ke(e.contentlet, e.container),
|
|
188
225
|
"data-dot-object": "contentlet"
|
|
189
|
-
} :
|
|
190
|
-
() =>
|
|
191
|
-
),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
226
|
+
} : n.value.isAnalyticsActive ? De(e.contentlet) : {}), d = c(
|
|
227
|
+
() => a.value ? { minHeight: s.value ? void 0 : "4rem" } : {}
|
|
228
|
+
), p = c(() => {
|
|
229
|
+
const m = e.contentlet?.identifier, g = m ? n.value.slots?.[m] : void 0;
|
|
230
|
+
if (g)
|
|
231
|
+
return () => g({ contentlet: e.contentlet });
|
|
232
|
+
}), u = c(
|
|
233
|
+
() => n.value.userComponents[e.contentlet?.contentType]
|
|
234
|
+
), _ = c(
|
|
235
|
+
() => n.value.userComponents[Te]
|
|
195
236
|
);
|
|
196
|
-
return (
|
|
197
|
-
class:
|
|
237
|
+
return (m, g) => (r(), i("div", $(l.value, {
|
|
238
|
+
class: E(qe),
|
|
198
239
|
style: d.value
|
|
199
240
|
}), [
|
|
200
|
-
|
|
201
|
-
key:
|
|
202
|
-
"user-no-component":
|
|
203
|
-
contentlet:
|
|
241
|
+
p.value ? (r(), f(D(p.value), { key: 0 })) : u.value ? (r(), f(D(u.value), R($({ key: 1 }, t.contentlet)), null, 16)) : (r(), f(Xe, {
|
|
242
|
+
key: 2,
|
|
243
|
+
"user-no-component": _.value,
|
|
244
|
+
contentlet: t.contentlet
|
|
204
245
|
}, null, 8, ["user-no-component", "contentlet"]))
|
|
205
246
|
], 16));
|
|
206
247
|
}
|
|
207
|
-
}),
|
|
248
|
+
}), Je = /* @__PURE__ */ v({
|
|
208
249
|
__name: "Container",
|
|
209
250
|
props: {
|
|
210
251
|
container: {}
|
|
211
252
|
},
|
|
212
|
-
setup(
|
|
213
|
-
const
|
|
214
|
-
() =>
|
|
215
|
-
), a = c(() => n.value.length === 0), i = c(
|
|
216
|
-
() => o.value.isDevMode && s.value ? De(s.value) : {}
|
|
253
|
+
setup(t) {
|
|
254
|
+
const e = t, n = A(), a = c(() => Me(n.value.pageAsset, e.container)), o = c(() => he(n.value.pageAsset, e.container)), s = c(() => o.value.length === 0), l = c(
|
|
255
|
+
() => n.value.isDevMode && a.value ? be(a.value) : {}
|
|
217
256
|
), d = c(
|
|
218
|
-
() =>
|
|
257
|
+
() => n.value.isDevMode ? JSON.stringify(a.value) : ""
|
|
219
258
|
);
|
|
220
|
-
return (
|
|
221
|
-
(r(!0),
|
|
222
|
-
key:
|
|
223
|
-
contentlet:
|
|
259
|
+
return (p, u) => a.value ? s.value ? (r(), f(Ke, R($({ key: 1 }, l.value)), null, 16)) : (r(), i("div", R($({ key: 2 }, l.value)), [
|
|
260
|
+
(r(!0), i(k, null, M(o.value, (_) => (r(), f(Qe, {
|
|
261
|
+
key: _.identifier,
|
|
262
|
+
contentlet: _,
|
|
224
263
|
container: d.value
|
|
225
264
|
}, null, 8, ["contentlet", "container"]))), 128))
|
|
226
|
-
], 16)) : (r(),
|
|
265
|
+
], 16)) : (r(), f(je, {
|
|
227
266
|
key: 0,
|
|
228
|
-
identifier:
|
|
267
|
+
identifier: t.container.identifier
|
|
229
268
|
}, null, 8, ["identifier"]));
|
|
230
269
|
}
|
|
231
|
-
}),
|
|
270
|
+
}), Ze = /* @__PURE__ */ v({
|
|
232
271
|
__name: "Column",
|
|
233
272
|
props: {
|
|
234
273
|
column: {}
|
|
235
274
|
},
|
|
236
|
-
setup(
|
|
237
|
-
const
|
|
238
|
-
gridColumnStart:
|
|
239
|
-
gridColumnEnd:
|
|
275
|
+
setup(t) {
|
|
276
|
+
const e = t, n = c(() => ({
|
|
277
|
+
gridColumnStart: e.column.leftOffset,
|
|
278
|
+
gridColumnEnd: e.column.leftOffset + e.column.width
|
|
240
279
|
}));
|
|
241
|
-
return (
|
|
280
|
+
return (a, o) => (r(), i("div", {
|
|
242
281
|
"data-dot": "column",
|
|
243
|
-
style: w(
|
|
282
|
+
style: w(n.value)
|
|
244
283
|
}, [
|
|
245
|
-
|
|
246
|
-
class:
|
|
284
|
+
y("div", {
|
|
285
|
+
class: W(t.column.styleClass)
|
|
247
286
|
}, [
|
|
248
|
-
(r(!0),
|
|
249
|
-
key: `${
|
|
250
|
-
container:
|
|
287
|
+
(r(!0), i(k, null, M(t.column.containers, (s) => (r(), f(Je, {
|
|
288
|
+
key: `${s.identifier}-${s.uuid}`,
|
|
289
|
+
container: s
|
|
251
290
|
}, null, 8, ["container"]))), 128))
|
|
252
291
|
], 2)
|
|
253
292
|
], 4));
|
|
254
293
|
}
|
|
255
|
-
}),
|
|
294
|
+
}), et = ["id"], tt = /* @__PURE__ */ v({
|
|
256
295
|
__name: "Row",
|
|
257
296
|
props: {
|
|
258
297
|
row: {},
|
|
259
298
|
index: {}
|
|
260
299
|
},
|
|
261
|
-
setup(
|
|
262
|
-
const
|
|
300
|
+
setup(t) {
|
|
301
|
+
const e = t, n = c(() => Se(["dot-row-container", e.row.styleClass || ""])), a = c(() => `${Ne}${e.index}`), o = {
|
|
263
302
|
display: "grid",
|
|
264
303
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
265
304
|
gap: "1rem"
|
|
266
305
|
};
|
|
267
|
-
return (
|
|
268
|
-
id:
|
|
269
|
-
class:
|
|
306
|
+
return (s, l) => (r(), i("div", {
|
|
307
|
+
id: a.value,
|
|
308
|
+
class: W(n.value)
|
|
270
309
|
}, [
|
|
271
|
-
|
|
310
|
+
y("div", {
|
|
272
311
|
class: "dotcms-row",
|
|
273
312
|
"data-dot-object": "row",
|
|
274
|
-
style:
|
|
313
|
+
style: o
|
|
275
314
|
}, [
|
|
276
|
-
(r(!0),
|
|
277
|
-
key:
|
|
315
|
+
(r(!0), i(k, null, M(t.row.columns, (d, p) => (r(), f(Ze, {
|
|
316
|
+
key: p,
|
|
278
317
|
column: d
|
|
279
318
|
}, null, 8, ["column"]))), 128))
|
|
280
319
|
])
|
|
281
|
-
], 10,
|
|
320
|
+
], 10, et));
|
|
282
321
|
}
|
|
283
|
-
}),
|
|
322
|
+
}), Zt = /* @__PURE__ */ v({
|
|
284
323
|
__name: "DotCMSLayoutBody",
|
|
285
324
|
props: {
|
|
286
325
|
page: {},
|
|
287
326
|
components: {},
|
|
288
327
|
mode: { default: "production" }
|
|
289
328
|
},
|
|
290
|
-
setup(
|
|
291
|
-
const
|
|
292
|
-
|
|
329
|
+
setup(t) {
|
|
330
|
+
const e = t, n = Ye(() => e.mode), a = Ge(), o = c(() => {
|
|
331
|
+
const p = {};
|
|
332
|
+
for (const u of Object.keys(e.components))
|
|
333
|
+
p[u] = j(e.components[u]);
|
|
334
|
+
return te(p);
|
|
335
|
+
}), s = pe(), l = c(() => {
|
|
336
|
+
const p = {}, u = Object.entries(s);
|
|
337
|
+
for (const [_, m] of u)
|
|
338
|
+
m && _.startsWith(Z) && (p[_.slice(Z.length)] = m);
|
|
339
|
+
return p;
|
|
340
|
+
});
|
|
341
|
+
Pe(
|
|
293
342
|
c(() => ({
|
|
294
|
-
pageAsset:
|
|
295
|
-
mode:
|
|
296
|
-
userComponents:
|
|
297
|
-
isDevMode:
|
|
298
|
-
isAnalyticsActive:
|
|
343
|
+
pageAsset: e.page,
|
|
344
|
+
mode: e.mode,
|
|
345
|
+
userComponents: o.value,
|
|
346
|
+
isDevMode: n.value,
|
|
347
|
+
isAnalyticsActive: a.value,
|
|
348
|
+
slots: l.value
|
|
299
349
|
}))
|
|
300
350
|
);
|
|
301
|
-
const
|
|
302
|
-
return (
|
|
303
|
-
key:
|
|
304
|
-
row:
|
|
305
|
-
index:
|
|
306
|
-
}, null, 8, ["row", "index"]))), 128)) : (r(),
|
|
351
|
+
const d = c(() => e.page?.layout?.body?.rows);
|
|
352
|
+
return (p, u) => d.value ? (r(!0), i(k, { key: 0 }, M(d.value, (_, m) => (r(), f(tt, {
|
|
353
|
+
key: m,
|
|
354
|
+
row: _,
|
|
355
|
+
index: m + 1
|
|
356
|
+
}, null, 8, ["row", "index"]))), 128)) : (r(), f(Fe, { key: 1 }));
|
|
307
357
|
}
|
|
308
|
-
}),
|
|
309
|
-
...
|
|
358
|
+
}), Y = {
|
|
359
|
+
...we,
|
|
310
360
|
licenseKey: "gpl"
|
|
311
361
|
// Self-hosted GPL license.
|
|
312
|
-
},
|
|
362
|
+
}, nt = {
|
|
313
363
|
full: {
|
|
314
|
-
...
|
|
315
|
-
...
|
|
364
|
+
...Y,
|
|
365
|
+
...H.full
|
|
316
366
|
},
|
|
317
367
|
plain: {
|
|
318
|
-
...
|
|
319
|
-
...
|
|
368
|
+
...Y,
|
|
369
|
+
...H.plain
|
|
320
370
|
},
|
|
321
371
|
minimal: {
|
|
322
|
-
...
|
|
323
|
-
...
|
|
372
|
+
...Y,
|
|
373
|
+
...H.minimal
|
|
324
374
|
}
|
|
325
|
-
},
|
|
375
|
+
}, ot = ["innerHTML"], st = {
|
|
326
376
|
key: 1,
|
|
327
377
|
style: { outline: "2px solid #006ce7", borderRadius: "4px" }
|
|
328
|
-
},
|
|
378
|
+
}, en = /* @__PURE__ */ v({
|
|
329
379
|
__name: "DotCMSEditableText",
|
|
330
380
|
props: {
|
|
331
381
|
contentlet: {},
|
|
@@ -333,109 +383,109 @@ const He = "dotcms-contentlet", Ye = {
|
|
|
333
383
|
format: { default: "text" },
|
|
334
384
|
mode: { default: "plain" }
|
|
335
385
|
},
|
|
336
|
-
setup(
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
() => [
|
|
386
|
+
setup(t) {
|
|
387
|
+
const e = t, n = N(null), a = N(""), o = N(!1), s = N(e.contentlet?.[e.fieldName] || ""), l = c(() => nt[e.mode]);
|
|
388
|
+
V(
|
|
389
|
+
() => [e.fieldName, e.contentlet],
|
|
340
390
|
() => {
|
|
341
|
-
|
|
391
|
+
s.value = e.contentlet?.[e.fieldName] || "", n.value?.setContent(s.value, { format: e.format });
|
|
342
392
|
}
|
|
343
393
|
);
|
|
344
|
-
const d = (m,
|
|
345
|
-
|
|
346
|
-
},
|
|
394
|
+
const d = (m, g) => {
|
|
395
|
+
n.value = g;
|
|
396
|
+
}, p = (m) => {
|
|
347
397
|
if (Number(
|
|
348
|
-
|
|
349
|
-
) <= 1 ||
|
|
398
|
+
e.contentlet.onNumberOfPages ?? 1
|
|
399
|
+
) <= 1 || n.value?.hasFocus())
|
|
350
400
|
return;
|
|
351
401
|
m.stopPropagation(), m.preventDefault();
|
|
352
|
-
const { inode:
|
|
353
|
-
|
|
354
|
-
action:
|
|
402
|
+
const { inode: I, languageId: G } = e.contentlet;
|
|
403
|
+
X({
|
|
404
|
+
action: z.COPY_CONTENTLET_INLINE_EDITING,
|
|
355
405
|
payload: {
|
|
356
|
-
dataset: { inode:
|
|
406
|
+
dataset: { inode: I, language: G, fieldName: e.fieldName }
|
|
357
407
|
}
|
|
358
408
|
});
|
|
359
409
|
}, u = () => {
|
|
360
|
-
const m =
|
|
361
|
-
if (!
|
|
410
|
+
const m = n.value?.getContent({ format: e.format }) || "";
|
|
411
|
+
if (!n.value?.isDirty() || m === s.value)
|
|
362
412
|
return;
|
|
363
|
-
const { inode:
|
|
364
|
-
|
|
365
|
-
action:
|
|
413
|
+
const { inode: g, languageId: I } = e.contentlet;
|
|
414
|
+
X({
|
|
415
|
+
action: z.UPDATE_CONTENTLET_INLINE_EDITING,
|
|
366
416
|
payload: {
|
|
367
417
|
content: m,
|
|
368
|
-
dataset: { inode:
|
|
418
|
+
dataset: { inode: g, langId: I, fieldName: e.fieldName }
|
|
369
419
|
}
|
|
370
420
|
});
|
|
371
|
-
},
|
|
372
|
-
const { name:
|
|
373
|
-
if (
|
|
421
|
+
}, _ = ({ data: m }) => {
|
|
422
|
+
const { name: g, payload: I } = m ?? {};
|
|
423
|
+
if (g !== Ae.UVE_COPY_CONTENTLET_INLINE_EDITING_SUCCESS)
|
|
374
424
|
return;
|
|
375
|
-
const { oldInode:
|
|
376
|
-
(
|
|
425
|
+
const { oldInode: G, inode: ae, fieldName: ce } = I ?? {}, q = e.contentlet.inode;
|
|
426
|
+
(q === G || q === ae) && ce === e.fieldName && n.value?.focus();
|
|
377
427
|
};
|
|
378
|
-
return
|
|
379
|
-
const m =
|
|
380
|
-
if (
|
|
428
|
+
return b(() => {
|
|
429
|
+
const m = x();
|
|
430
|
+
if (o.value = m?.mode === P.EDIT && !!m?.dotCMSHost?.length, !e.contentlet || !e.fieldName) {
|
|
381
431
|
console.error(
|
|
382
432
|
"[DotCMSEditableText]: contentlet or fieldName is missing. Ensure all needed props are passed to view and edit the content."
|
|
383
433
|
);
|
|
384
434
|
return;
|
|
385
435
|
}
|
|
386
|
-
if (m && m.mode !==
|
|
436
|
+
if (m && m.mode !== P.EDIT) {
|
|
387
437
|
console.warn("[DotCMSEditableText]: TinyMCE is not available in the current mode");
|
|
388
438
|
return;
|
|
389
439
|
}
|
|
390
|
-
m?.dotCMSHost && (
|
|
391
|
-
}),
|
|
392
|
-
window.removeEventListener("message",
|
|
393
|
-
}), (m,
|
|
394
|
-
|
|
395
|
-
"tinymce-script-src":
|
|
440
|
+
m?.dotCMSHost && (a.value = new URL($e, m.dotCMSHost).toString(), window.addEventListener("message", _));
|
|
441
|
+
}), K(() => {
|
|
442
|
+
window.removeEventListener("message", _);
|
|
443
|
+
}), (m, g) => o.value ? (r(), i("div", st, [
|
|
444
|
+
h(E(xe), {
|
|
445
|
+
"tinymce-script-src": a.value,
|
|
396
446
|
inline: !0,
|
|
397
|
-
init:
|
|
398
|
-
"initial-value":
|
|
447
|
+
init: l.value,
|
|
448
|
+
"initial-value": s.value,
|
|
399
449
|
onInit: d,
|
|
400
|
-
onMousedown:
|
|
450
|
+
onMousedown: p,
|
|
401
451
|
onFocusout: u
|
|
402
452
|
}, null, 8, ["tinymce-script-src", "init", "initial-value"])
|
|
403
|
-
])) : (r(),
|
|
453
|
+
])) : (r(), i("span", {
|
|
404
454
|
key: 0,
|
|
405
|
-
innerHTML:
|
|
406
|
-
}, null, 8,
|
|
455
|
+
innerHTML: s.value
|
|
456
|
+
}, null, 8, ot));
|
|
407
457
|
}
|
|
408
|
-
}),
|
|
409
|
-
const
|
|
410
|
-
for (const [
|
|
411
|
-
|
|
412
|
-
return
|
|
413
|
-
},
|
|
414
|
-
function
|
|
415
|
-
return r(),
|
|
416
|
-
|
|
458
|
+
}), F = (t, e) => {
|
|
459
|
+
const n = t.__vccOpts || t;
|
|
460
|
+
for (const [a, o] of e)
|
|
461
|
+
n[a] = o;
|
|
462
|
+
return n;
|
|
463
|
+
}, rt = {};
|
|
464
|
+
function at(t, e) {
|
|
465
|
+
return r(), i("ul", null, [
|
|
466
|
+
S(t.$slots, "default")
|
|
417
467
|
]);
|
|
418
468
|
}
|
|
419
|
-
const
|
|
469
|
+
const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it = /* @__PURE__ */ v({
|
|
420
470
|
__name: "CodeBlock",
|
|
421
471
|
props: {
|
|
422
472
|
node: {}
|
|
423
473
|
},
|
|
424
|
-
setup(
|
|
425
|
-
const
|
|
426
|
-
return (
|
|
427
|
-
|
|
428
|
-
|
|
474
|
+
setup(t) {
|
|
475
|
+
const e = t, n = c(() => e.node?.attrs?.language || "");
|
|
476
|
+
return (a, o) => (r(), i("pre", { "data-language": n.value }, [
|
|
477
|
+
y("code", null, [
|
|
478
|
+
S(a.$slots, "default")
|
|
429
479
|
])
|
|
430
|
-
], 8,
|
|
480
|
+
], 8, lt));
|
|
431
481
|
}
|
|
432
|
-
}),
|
|
482
|
+
}), ut = /* @__PURE__ */ v({
|
|
433
483
|
__name: "NoComponentProvided",
|
|
434
484
|
props: {
|
|
435
485
|
contentType: {}
|
|
436
486
|
},
|
|
437
|
-
setup(
|
|
438
|
-
const
|
|
487
|
+
setup(t) {
|
|
488
|
+
const e = {
|
|
439
489
|
backgroundColor: "#fffaf0",
|
|
440
490
|
color: "#333",
|
|
441
491
|
padding: "1rem",
|
|
@@ -443,174 +493,180 @@ const nt = /* @__PURE__ */ U(et, [["render", tt]]), ot = ["data-language"], rt =
|
|
|
443
493
|
marginBottom: "1rem",
|
|
444
494
|
marginTop: "1rem",
|
|
445
495
|
border: "1px solid #ed8936"
|
|
446
|
-
},
|
|
447
|
-
return (
|
|
496
|
+
}, n = { color: "#c05621" };
|
|
497
|
+
return (a, o) => (r(), i("div", {
|
|
448
498
|
"data-testid": "no-component-provided",
|
|
449
|
-
style:
|
|
499
|
+
style: e
|
|
450
500
|
}, [
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
501
|
+
y("strong", { style: n }, "Dev Warning"),
|
|
502
|
+
o[0] || (o[0] = C(" : No component or custom renderer provided for content type ", -1)),
|
|
503
|
+
y("strong", { style: n }, O(t.contentType || "Unknown"), 1),
|
|
504
|
+
o[1] || (o[1] = C(" . ", -1)),
|
|
505
|
+
o[2] || (o[2] = y("br", null, null, -1)),
|
|
506
|
+
o[3] || (o[3] = C(" Please refer to the ", -1)),
|
|
507
|
+
y("a", {
|
|
458
508
|
href: "https://dev.dotcms.com/docs/block-editor",
|
|
459
509
|
target: "_blank",
|
|
460
510
|
rel: "noopener noreferrer",
|
|
461
|
-
style:
|
|
462
|
-
}, "Block Editor Custom Renderers Documentation"),
|
|
463
|
-
|
|
511
|
+
style: n
|
|
512
|
+
}, " Block Editor Custom Renderers Documentation "),
|
|
513
|
+
o[4] || (o[4] = C(" for guidance. ", -1))
|
|
464
514
|
]));
|
|
465
515
|
}
|
|
466
|
-
}),
|
|
516
|
+
}), dt = "[DotCMSBlockEditorRenderer]: No data provided for Contentlet Block. Try to add a contentlet to the block editor. If the error persists, please contact the DotCMS support team.", mt = /* @__PURE__ */ v({
|
|
467
517
|
__name: "DotContent",
|
|
468
518
|
props: {
|
|
469
519
|
node: {},
|
|
470
520
|
customRenderers: {},
|
|
471
521
|
isDevMode: { type: Boolean }
|
|
472
522
|
},
|
|
473
|
-
setup(
|
|
474
|
-
const
|
|
475
|
-
return (
|
|
523
|
+
setup(t) {
|
|
524
|
+
const e = (d) => `[DotCMSBlockEditorRenderer]: No matching component found for content type: ${d}. Provide a custom renderer for this content type to fix this error.`, n = t, a = c(() => n.node.attrs?.data), o = c(() => a.value?.contentType ?? "Unknown Content Type"), s = c(() => n.customRenderers?.[o.value]), l = c(() => a.value ? n.isDevMode && !s.value ? "dev-warning" : s.value ? "render" : "no-component" : "no-data");
|
|
525
|
+
return V(
|
|
526
|
+
l,
|
|
527
|
+
(d) => {
|
|
528
|
+
d === "no-data" ? console.error(dt) : d === "no-component" && console.warn(e(o.value));
|
|
529
|
+
},
|
|
530
|
+
{ immediate: !0 }
|
|
531
|
+
), (d, p) => l.value === "dev-warning" ? (r(), f(ut, {
|
|
476
532
|
key: 0,
|
|
477
|
-
"content-type":
|
|
478
|
-
}, null, 8, ["content-type"])) :
|
|
533
|
+
"content-type": o.value
|
|
534
|
+
}, null, 8, ["content-type"])) : l.value === "render" ? (r(), f(D(s.value), {
|
|
479
535
|
key: 1,
|
|
480
|
-
node:
|
|
536
|
+
node: t.node
|
|
481
537
|
}, null, 8, ["node"])) : T("", !0);
|
|
482
538
|
}
|
|
483
|
-
}),
|
|
539
|
+
}), pt = ["alt", "src"], vt = /* @__PURE__ */ v({
|
|
484
540
|
__name: "DotImage",
|
|
485
541
|
props: {
|
|
486
542
|
node: {}
|
|
487
543
|
},
|
|
488
|
-
setup(
|
|
489
|
-
const
|
|
490
|
-
const { textWrap:
|
|
491
|
-
return
|
|
492
|
-
}),
|
|
493
|
-
() =>
|
|
544
|
+
setup(t) {
|
|
545
|
+
const e = t, n = c(() => e.node.attrs ?? {}), a = c(() => {
|
|
546
|
+
const { textWrap: s, textAlign: l } = n.value;
|
|
547
|
+
return s === "left" ? { float: "left", width: "50%", margin: "0 1rem 1rem 0" } : s === "right" ? { float: "right", width: "50%", margin: "0 0 1rem 1rem" } : l ? { textAlign: l } : {};
|
|
548
|
+
}), o = c(
|
|
549
|
+
() => n.value.textWrap ? { maxWidth: "100%", height: "auto" } : void 0
|
|
494
550
|
);
|
|
495
|
-
return (
|
|
496
|
-
style: w(
|
|
551
|
+
return (s, l) => (r(), i("figure", {
|
|
552
|
+
style: w(a.value)
|
|
497
553
|
}, [
|
|
498
|
-
|
|
499
|
-
alt:
|
|
500
|
-
src:
|
|
501
|
-
style: w(
|
|
502
|
-
}, null, 12,
|
|
554
|
+
y("img", {
|
|
555
|
+
alt: n.value.alt,
|
|
556
|
+
src: n.value.src,
|
|
557
|
+
style: w(o.value)
|
|
558
|
+
}, null, 12, pt)
|
|
503
559
|
], 4));
|
|
504
560
|
}
|
|
505
|
-
}),
|
|
561
|
+
}), ft = ["width", "height", "poster"], yt = ["src", "type"], _t = /* @__PURE__ */ v({
|
|
506
562
|
__name: "DotVideo",
|
|
507
563
|
props: {
|
|
508
564
|
node: {}
|
|
509
565
|
},
|
|
510
|
-
setup(
|
|
511
|
-
const
|
|
512
|
-
return (
|
|
566
|
+
setup(t) {
|
|
567
|
+
const e = t, n = c(() => e.node.attrs ?? {}), a = c(() => n.value.data?.thumbnail);
|
|
568
|
+
return (o, s) => (r(), i("video", {
|
|
513
569
|
controls: "",
|
|
514
570
|
preload: "metadata",
|
|
515
|
-
width:
|
|
516
|
-
height:
|
|
517
|
-
poster:
|
|
571
|
+
width: n.value.width,
|
|
572
|
+
height: n.value.height,
|
|
573
|
+
poster: a.value
|
|
518
574
|
}, [
|
|
519
|
-
|
|
575
|
+
s[0] || (s[0] = y("track", {
|
|
520
576
|
default: "",
|
|
521
577
|
kind: "captions",
|
|
522
578
|
srclang: "en"
|
|
523
579
|
}, null, -1)),
|
|
524
|
-
|
|
525
|
-
src:
|
|
526
|
-
type:
|
|
527
|
-
}, null, 8,
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
], 8,
|
|
580
|
+
y("source", {
|
|
581
|
+
src: n.value.src,
|
|
582
|
+
type: n.value.mimeType
|
|
583
|
+
}, null, 8, yt),
|
|
584
|
+
s[1] || (s[1] = C(" Your browser does not support the ", -1)),
|
|
585
|
+
s[2] || (s[2] = y("code", null, "video", -1)),
|
|
586
|
+
s[3] || (s[3] = C(" element. ", -1))
|
|
587
|
+
], 8, ft));
|
|
532
588
|
}
|
|
533
|
-
}),
|
|
589
|
+
}), gt = /* @__PURE__ */ v({
|
|
534
590
|
__name: "GridBlock",
|
|
535
591
|
props: {
|
|
536
592
|
node: {},
|
|
537
593
|
customRenderers: {},
|
|
538
594
|
isDevMode: { type: Boolean }
|
|
539
595
|
},
|
|
540
|
-
setup(
|
|
541
|
-
const
|
|
542
|
-
const
|
|
543
|
-
return Array.isArray(
|
|
544
|
-
}),
|
|
596
|
+
setup(t) {
|
|
597
|
+
const e = t, n = c(() => {
|
|
598
|
+
const o = e.node.attrs?.columns;
|
|
599
|
+
return Array.isArray(o) && o.length === 2 && o.every((s) => typeof s == "number" && Number.isFinite(s)) ? o : [6, 6];
|
|
600
|
+
}), a = {
|
|
545
601
|
display: "grid",
|
|
546
602
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
547
603
|
gap: "1rem"
|
|
548
604
|
};
|
|
549
|
-
return (
|
|
605
|
+
return (o, s) => (r(), i("div", {
|
|
550
606
|
"data-type": "gridBlock",
|
|
551
607
|
class: "grid-block",
|
|
552
|
-
style:
|
|
608
|
+
style: a
|
|
553
609
|
}, [
|
|
554
|
-
(r(!0),
|
|
610
|
+
(r(!0), i(k, null, M(t.node.content ?? [], (l, d) => (r(), i("div", {
|
|
555
611
|
key: `gridColumn-${d}`,
|
|
556
612
|
"data-type": "gridColumn",
|
|
557
613
|
class: "grid-block__column",
|
|
558
|
-
style: w({ gridColumn: `span ${
|
|
614
|
+
style: w({ gridColumn: `span ${n.value[d] ?? 6}` })
|
|
559
615
|
}, [
|
|
560
|
-
|
|
561
|
-
content:
|
|
562
|
-
"custom-renderers":
|
|
563
|
-
"is-dev-mode":
|
|
616
|
+
h(U, {
|
|
617
|
+
content: l.content,
|
|
618
|
+
"custom-renderers": t.customRenderers,
|
|
619
|
+
"is-dev-mode": t.isDevMode
|
|
564
620
|
}, null, 8, ["content", "custom-renderers", "is-dev-mode"])
|
|
565
621
|
], 4))), 128))
|
|
566
622
|
]));
|
|
567
623
|
}
|
|
568
|
-
}),
|
|
624
|
+
}), Ct = /* @__PURE__ */ v({
|
|
569
625
|
__name: "Heading",
|
|
570
626
|
props: {
|
|
571
627
|
node: {}
|
|
572
628
|
},
|
|
573
|
-
setup(
|
|
574
|
-
const
|
|
575
|
-
return (
|
|
629
|
+
setup(t) {
|
|
630
|
+
const e = t, n = c(() => `h${e.node?.attrs?.level || 1}`);
|
|
631
|
+
return (a, o) => (r(), f(D(n.value), null, {
|
|
576
632
|
default: B(() => [
|
|
577
|
-
|
|
633
|
+
S(a.$slots, "default")
|
|
578
634
|
]),
|
|
579
635
|
_: 3
|
|
580
636
|
}));
|
|
581
637
|
}
|
|
582
|
-
}),
|
|
583
|
-
function
|
|
584
|
-
return r(),
|
|
585
|
-
|
|
638
|
+
}), Et = {};
|
|
639
|
+
function kt(t, e) {
|
|
640
|
+
return r(), i("li", null, [
|
|
641
|
+
S(t.$slots, "default")
|
|
586
642
|
]);
|
|
587
643
|
}
|
|
588
|
-
const
|
|
589
|
-
function
|
|
590
|
-
return r(),
|
|
591
|
-
|
|
644
|
+
const Dt = /* @__PURE__ */ F(Et, [["render", kt]]), Tt = {};
|
|
645
|
+
function Mt(t, e) {
|
|
646
|
+
return r(), i("ol", null, [
|
|
647
|
+
S(t.$slots, "default")
|
|
592
648
|
]);
|
|
593
649
|
}
|
|
594
|
-
const
|
|
650
|
+
const ht = /* @__PURE__ */ F(Tt, [["render", Mt]]), bt = /* @__PURE__ */ v({
|
|
595
651
|
__name: "Paragraph",
|
|
596
652
|
props: {
|
|
597
653
|
node: {}
|
|
598
654
|
},
|
|
599
|
-
setup(
|
|
600
|
-
const
|
|
601
|
-
return (
|
|
602
|
-
style: w(
|
|
655
|
+
setup(t) {
|
|
656
|
+
const e = t, n = c(() => e.node?.attrs ?? {});
|
|
657
|
+
return (a, o) => (r(), i("p", {
|
|
658
|
+
style: w(n.value)
|
|
603
659
|
}, [
|
|
604
|
-
|
|
660
|
+
S(a.$slots, "default")
|
|
605
661
|
], 4));
|
|
606
662
|
}
|
|
607
|
-
}),
|
|
608
|
-
function
|
|
609
|
-
return r(),
|
|
610
|
-
|
|
663
|
+
}), St = {};
|
|
664
|
+
function Nt(t, e) {
|
|
665
|
+
return r(), i("blockquote", null, [
|
|
666
|
+
S(t.$slots, "default")
|
|
611
667
|
]);
|
|
612
668
|
}
|
|
613
|
-
const
|
|
669
|
+
const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-labelledby"], Ot = { key: 0 }, xt = ["colspan", "rowspan", "scope"], At = ["colspan", "rowspan"], It = /* @__PURE__ */ v({
|
|
614
670
|
__name: "TableRenderer",
|
|
615
671
|
props: {
|
|
616
672
|
content: {},
|
|
@@ -618,55 +674,55 @@ const Mt = /* @__PURE__ */ U(Dt, [["render", Tt]]), ht = ["aria-label", "aria-la
|
|
|
618
674
|
customRenderers: {},
|
|
619
675
|
isDevMode: { type: Boolean }
|
|
620
676
|
},
|
|
621
|
-
setup(
|
|
622
|
-
const
|
|
623
|
-
return (d,
|
|
624
|
-
"aria-label":
|
|
625
|
-
"aria-labelledby":
|
|
677
|
+
setup(t) {
|
|
678
|
+
const e = t, n = c(() => e.attrs?.caption || void 0), a = c(() => e.attrs?.ariaLabel || void 0), o = c(() => e.attrs?.ariaLabelledby || void 0), s = (d) => Number(d.attrs?.colspan || 1), l = (d) => Number(d.attrs?.rowspan || 1);
|
|
679
|
+
return (d, p) => (r(), i("table", {
|
|
680
|
+
"aria-label": a.value,
|
|
681
|
+
"aria-labelledby": o.value
|
|
626
682
|
}, [
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
(r(!0),
|
|
630
|
-
key: `row-${
|
|
683
|
+
n.value ? (r(), i("caption", Ot, O(n.value), 1)) : T("", !0),
|
|
684
|
+
y("tbody", null, [
|
|
685
|
+
(r(!0), i(k, null, M(t.content, (u, _) => (r(), i("tr", {
|
|
686
|
+
key: `row-${_}`
|
|
631
687
|
}, [
|
|
632
|
-
(r(!0),
|
|
633
|
-
key: `cell-${
|
|
688
|
+
(r(!0), i(k, null, M(u.content ?? [], (m, g) => (r(), i(k, {
|
|
689
|
+
key: `cell-${g}`
|
|
634
690
|
}, [
|
|
635
|
-
m.type === "tableHeader" ? (r(),
|
|
691
|
+
m.type === "tableHeader" ? (r(), i("th", {
|
|
636
692
|
key: 0,
|
|
637
|
-
colspan:
|
|
638
|
-
rowspan:
|
|
693
|
+
colspan: s(m),
|
|
694
|
+
rowspan: l(m),
|
|
639
695
|
scope: m.attrs?.scope || void 0
|
|
640
696
|
}, [
|
|
641
|
-
|
|
697
|
+
h(U, {
|
|
642
698
|
content: m.content ?? [],
|
|
643
|
-
"custom-renderers":
|
|
644
|
-
"is-dev-mode":
|
|
699
|
+
"custom-renderers": t.customRenderers,
|
|
700
|
+
"is-dev-mode": t.isDevMode
|
|
645
701
|
}, null, 8, ["content", "custom-renderers", "is-dev-mode"])
|
|
646
|
-
], 8,
|
|
702
|
+
], 8, xt)) : (r(), i("td", {
|
|
647
703
|
key: 1,
|
|
648
|
-
colspan:
|
|
649
|
-
rowspan:
|
|
704
|
+
colspan: s(m),
|
|
705
|
+
rowspan: l(m)
|
|
650
706
|
}, [
|
|
651
|
-
|
|
707
|
+
h(U, {
|
|
652
708
|
content: m.content ?? [],
|
|
653
|
-
"custom-renderers":
|
|
654
|
-
"is-dev-mode":
|
|
709
|
+
"custom-renderers": t.customRenderers,
|
|
710
|
+
"is-dev-mode": t.isDevMode
|
|
655
711
|
}, null, 8, ["content", "custom-renderers", "is-dev-mode"])
|
|
656
|
-
], 8,
|
|
712
|
+
], 8, At))
|
|
657
713
|
], 64))), 128))
|
|
658
714
|
]))), 128))
|
|
659
715
|
])
|
|
660
|
-
], 8,
|
|
716
|
+
], 8, $t));
|
|
661
717
|
}
|
|
662
|
-
}),
|
|
718
|
+
}), Rt = /* @__PURE__ */ v({
|
|
663
719
|
__name: "TextBlock",
|
|
664
720
|
props: {
|
|
665
721
|
text: {},
|
|
666
722
|
marks: {}
|
|
667
723
|
},
|
|
668
|
-
setup(
|
|
669
|
-
const
|
|
724
|
+
setup(t) {
|
|
725
|
+
const e = t, n = {
|
|
670
726
|
bold: "strong",
|
|
671
727
|
italic: "em",
|
|
672
728
|
strike: "s",
|
|
@@ -674,29 +730,29 @@ const Mt = /* @__PURE__ */ U(Dt, [["render", Tt]]), ht = ["aria-label", "aria-la
|
|
|
674
730
|
superscript: "sup",
|
|
675
731
|
subscript: "sub",
|
|
676
732
|
link: "a"
|
|
677
|
-
},
|
|
678
|
-
return (
|
|
679
|
-
const
|
|
680
|
-
return
|
|
733
|
+
}, a = c(() => e.marks ?? []), o = c(() => a.value[0]), s = c(() => a.value.slice(1)), l = c(() => o.value ? n[o.value.type] : void 0), d = c(() => o.value?.attrs ?? {});
|
|
734
|
+
return (p, u) => {
|
|
735
|
+
const _ = ne("TextBlock", !0);
|
|
736
|
+
return l.value ? (r(), f(D(l.value), R($({ key: 0 }, d.value)), {
|
|
681
737
|
default: B(() => [
|
|
682
|
-
|
|
683
|
-
text:
|
|
684
|
-
marks:
|
|
738
|
+
h(_, {
|
|
739
|
+
text: t.text,
|
|
740
|
+
marks: s.value
|
|
685
741
|
}, null, 8, ["text", "marks"])
|
|
686
742
|
]),
|
|
687
743
|
_: 1
|
|
688
|
-
}, 16)) : (r(),
|
|
689
|
-
|
|
744
|
+
}, 16)) : (r(), i(k, { key: 1 }, [
|
|
745
|
+
C(O(t.text), 1)
|
|
690
746
|
], 64));
|
|
691
747
|
};
|
|
692
748
|
}
|
|
693
|
-
}),
|
|
749
|
+
}), Lt = /* @__PURE__ */ v({
|
|
694
750
|
__name: "UnknownBlock",
|
|
695
751
|
props: {
|
|
696
752
|
node: {}
|
|
697
753
|
},
|
|
698
|
-
setup(
|
|
699
|
-
const
|
|
754
|
+
setup(t) {
|
|
755
|
+
const e = t, n = {
|
|
700
756
|
backgroundColor: "#fff5f5",
|
|
701
757
|
color: "#333",
|
|
702
758
|
padding: "1rem",
|
|
@@ -705,102 +761,102 @@ const Mt = /* @__PURE__ */ U(Dt, [["render", Tt]]), ht = ["aria-label", "aria-la
|
|
|
705
761
|
marginTop: "1rem",
|
|
706
762
|
border: "1px solid #fc8181"
|
|
707
763
|
};
|
|
708
|
-
return
|
|
709
|
-
|
|
710
|
-
`[DotCMSBlockEditorRenderer]: Unknown block type "${
|
|
764
|
+
return b(() => {
|
|
765
|
+
x() || console.warn(
|
|
766
|
+
`[DotCMSBlockEditorRenderer]: Unknown block type "${e.node?.type}". No renderer was found for it.`
|
|
711
767
|
);
|
|
712
|
-
}), (
|
|
768
|
+
}), (a, o) => E(x)() ? (r(), i("div", {
|
|
713
769
|
key: 0,
|
|
714
770
|
"data-testid": "unknown-block",
|
|
715
|
-
style:
|
|
771
|
+
style: n
|
|
716
772
|
}, [
|
|
717
|
-
|
|
718
|
-
|
|
773
|
+
o[0] || (o[0] = C(" Unknown block type: ", -1)),
|
|
774
|
+
y("strong", null, O(t.node?.type), 1)
|
|
719
775
|
])) : T("", !0);
|
|
720
776
|
}
|
|
721
|
-
}),
|
|
777
|
+
}), Bt = { key: 4 }, Pt = { key: 5 }, U = /* @__PURE__ */ v({
|
|
722
778
|
__name: "BlockEditorBlock",
|
|
723
779
|
props: {
|
|
724
780
|
content: {},
|
|
725
781
|
customRenderers: {},
|
|
726
782
|
isDevMode: { type: Boolean }
|
|
727
783
|
},
|
|
728
|
-
setup(
|
|
729
|
-
const
|
|
730
|
-
[
|
|
731
|
-
[
|
|
732
|
-
[
|
|
733
|
-
[
|
|
734
|
-
[
|
|
735
|
-
[
|
|
736
|
-
[
|
|
737
|
-
},
|
|
738
|
-
[
|
|
739
|
-
[
|
|
740
|
-
},
|
|
741
|
-
return (
|
|
742
|
-
const
|
|
743
|
-
return r(!0),
|
|
744
|
-
key: `${u.type}-${
|
|
784
|
+
setup(t) {
|
|
785
|
+
const e = Ie, n = {
|
|
786
|
+
[e.PARAGRAPH]: bt,
|
|
787
|
+
[e.HEADING]: Ct,
|
|
788
|
+
[e.BULLET_LIST]: ct,
|
|
789
|
+
[e.ORDERED_LIST]: ht,
|
|
790
|
+
[e.LIST_ITEM]: Dt,
|
|
791
|
+
[e.BLOCK_QUOTE]: wt,
|
|
792
|
+
[e.CODE_BLOCK]: it
|
|
793
|
+
}, a = {
|
|
794
|
+
[e.DOT_IMAGE]: vt,
|
|
795
|
+
[e.DOT_VIDEO]: _t
|
|
796
|
+
}, o = (l) => n[l], s = (l) => a[l];
|
|
797
|
+
return (l, d) => {
|
|
798
|
+
const p = ne("BlockEditorBlock", !0);
|
|
799
|
+
return r(!0), i(k, null, M(t.content ?? [], (u, _) => (r(), i(k, {
|
|
800
|
+
key: `${u.type}-${_}`
|
|
745
801
|
}, [
|
|
746
|
-
|
|
802
|
+
t.customRenderers && t.customRenderers[u.type] ? (r(), f(D(t.customRenderers[u.type]), {
|
|
747
803
|
key: 0,
|
|
748
804
|
node: u
|
|
749
805
|
}, {
|
|
750
806
|
default: B(() => [
|
|
751
|
-
|
|
807
|
+
h(p, {
|
|
752
808
|
content: u.content,
|
|
753
|
-
"custom-renderers":
|
|
754
|
-
"is-dev-mode":
|
|
809
|
+
"custom-renderers": t.customRenderers,
|
|
810
|
+
"is-dev-mode": t.isDevMode
|
|
755
811
|
}, null, 8, ["content", "custom-renderers", "is-dev-mode"])
|
|
756
812
|
]),
|
|
757
813
|
_: 2
|
|
758
|
-
}, 1032, ["node"])) :
|
|
814
|
+
}, 1032, ["node"])) : o(u.type) ? (r(), f(D(o(u.type)), {
|
|
759
815
|
key: 1,
|
|
760
816
|
node: u
|
|
761
817
|
}, {
|
|
762
818
|
default: B(() => [
|
|
763
|
-
|
|
819
|
+
h(p, {
|
|
764
820
|
content: u.content,
|
|
765
|
-
"custom-renderers":
|
|
766
|
-
"is-dev-mode":
|
|
821
|
+
"custom-renderers": t.customRenderers,
|
|
822
|
+
"is-dev-mode": t.isDevMode
|
|
767
823
|
}, null, 8, ["content", "custom-renderers", "is-dev-mode"])
|
|
768
824
|
]),
|
|
769
825
|
_: 2
|
|
770
|
-
}, 1032, ["node"])) : u.type ===
|
|
826
|
+
}, 1032, ["node"])) : u.type === E(e).TEXT ? (r(), f(Rt, {
|
|
771
827
|
key: 2,
|
|
772
828
|
text: u.text,
|
|
773
829
|
marks: u.marks
|
|
774
|
-
}, null, 8, ["text", "marks"])) :
|
|
830
|
+
}, null, 8, ["text", "marks"])) : s(u.type) ? (r(), f(D(s(u.type)), {
|
|
775
831
|
key: 3,
|
|
776
832
|
node: u
|
|
777
|
-
}, null, 8, ["node"])) : u.type ===
|
|
833
|
+
}, null, 8, ["node"])) : u.type === E(e).HARDBREAK ? (r(), i("br", Bt)) : u.type === E(e).HORIZONTAL_RULE ? (r(), i("hr", Pt)) : u.type === E(e).TABLE ? (r(), f(It, {
|
|
778
834
|
key: 6,
|
|
779
835
|
content: u.content ?? [],
|
|
780
836
|
attrs: u.attrs,
|
|
781
|
-
"custom-renderers":
|
|
782
|
-
"is-dev-mode":
|
|
783
|
-
}, null, 8, ["content", "attrs", "custom-renderers", "is-dev-mode"])) : u.type ===
|
|
837
|
+
"custom-renderers": t.customRenderers,
|
|
838
|
+
"is-dev-mode": t.isDevMode
|
|
839
|
+
}, null, 8, ["content", "attrs", "custom-renderers", "is-dev-mode"])) : u.type === E(e).GRID_BLOCK ? (r(), f(gt, {
|
|
784
840
|
key: 7,
|
|
785
841
|
node: u,
|
|
786
|
-
"custom-renderers":
|
|
787
|
-
"is-dev-mode":
|
|
788
|
-
}, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : u.type ===
|
|
842
|
+
"custom-renderers": t.customRenderers,
|
|
843
|
+
"is-dev-mode": t.isDevMode
|
|
844
|
+
}, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : u.type === E(e).DOT_CONTENT ? (r(), f(mt, {
|
|
789
845
|
key: 8,
|
|
790
846
|
node: u,
|
|
791
|
-
"custom-renderers":
|
|
792
|
-
"is-dev-mode":
|
|
793
|
-
}, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : (r(),
|
|
847
|
+
"custom-renderers": t.customRenderers,
|
|
848
|
+
"is-dev-mode": t.isDevMode
|
|
849
|
+
}, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : (r(), f(Lt, {
|
|
794
850
|
key: 9,
|
|
795
851
|
node: u
|
|
796
852
|
}, null, 8, ["node"]))
|
|
797
853
|
], 64))), 128);
|
|
798
854
|
};
|
|
799
855
|
}
|
|
800
|
-
}),
|
|
856
|
+
}), Ut = {
|
|
801
857
|
key: 0,
|
|
802
858
|
"data-testid": "invalid-blocks-message"
|
|
803
|
-
},
|
|
859
|
+
}, tn = /* @__PURE__ */ v({
|
|
804
860
|
__name: "DotCMSBlockEditorRenderer",
|
|
805
861
|
props: {
|
|
806
862
|
blocks: {},
|
|
@@ -809,34 +865,48 @@ const Mt = /* @__PURE__ */ U(Dt, [["render", Tt]]), ht = ["aria-label", "aria-la
|
|
|
809
865
|
customRenderers: {},
|
|
810
866
|
isDevMode: { type: Boolean, default: !1 }
|
|
811
867
|
},
|
|
812
|
-
setup(
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
868
|
+
setup(t) {
|
|
869
|
+
const e = t, n = c(() => {
|
|
870
|
+
if (!e.customRenderers)
|
|
871
|
+
return;
|
|
872
|
+
const s = {};
|
|
873
|
+
for (const l of Object.keys(e.customRenderers))
|
|
874
|
+
s[l] = j(e.customRenderers[l]);
|
|
875
|
+
return te(s);
|
|
876
|
+
}), a = c(() => Oe(e.blocks)), o = c(() => a.value.error);
|
|
877
|
+
return V(
|
|
878
|
+
o,
|
|
879
|
+
(s) => {
|
|
880
|
+
s && console.error(s);
|
|
881
|
+
},
|
|
882
|
+
{ immediate: !0 }
|
|
883
|
+
), (s, l) => o.value && t.isDevMode ? (r(), i("div", Ut, O(o.value), 1)) : o.value ? T("", !0) : (r(), i("div", {
|
|
818
884
|
key: 1,
|
|
819
|
-
class:
|
|
820
|
-
style: w(
|
|
885
|
+
class: W(t.className),
|
|
886
|
+
style: w(t.style),
|
|
821
887
|
"data-testid": "dot-block-editor-container"
|
|
822
888
|
}, [
|
|
823
|
-
|
|
824
|
-
content:
|
|
825
|
-
"custom-renderers":
|
|
826
|
-
"is-dev-mode":
|
|
889
|
+
h(U, {
|
|
890
|
+
content: t.blocks?.content,
|
|
891
|
+
"custom-renderers": n.value,
|
|
892
|
+
"is-dev-mode": t.isDevMode
|
|
827
893
|
}, null, 8, ["content", "custom-renderers", "is-dev-mode"])
|
|
828
894
|
], 6));
|
|
829
895
|
}
|
|
830
896
|
});
|
|
831
897
|
export {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
898
|
+
se as DOTCMS_CLIENT,
|
|
899
|
+
re as DOTCMS_PAGE_CONTEXT,
|
|
900
|
+
tn as DotCMSBlockEditorRenderer,
|
|
901
|
+
en as DotCMSEditableText,
|
|
902
|
+
Zt as DotCMSLayoutBody,
|
|
903
|
+
Jt as DotCMSShow,
|
|
904
|
+
Qt as createDotCMSImageLoader,
|
|
905
|
+
qt as createDotCMSVue,
|
|
906
|
+
Pe as provideDotCMSPageContext,
|
|
907
|
+
Re as toPlain,
|
|
908
|
+
zt as useDotCMSClient,
|
|
909
|
+
A as useDotCMSPageContext,
|
|
910
|
+
Le as useDotCMSShowWhen,
|
|
911
|
+
Xt as useEditableDotCMSPage
|
|
842
912
|
};
|