@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/index.js CHANGED
@@ -1,331 +1,381 @@
1
- import { isRef as te, isReactive as ne, toRaw as oe, shallowRef as re, onMounted as D, onBeforeUnmount as H, ref as S, readonly as se, defineComponent as p, unref as C, renderSlot as N, createCommentVNode as T, provide as ae, inject as ce, computed as c, openBlock as r, createElementBlock as l, createElementVNode as f, createTextVNode as _, toValue as le, normalizeStyle as w, toDisplayString as x, mergeProps as $, Fragment as E, createBlock as v, resolveDynamicComponent as M, normalizeProps as R, getCurrentInstance as ie, renderList as h, normalizeClass as Y, watch as ue, createVNode as b, withCtx as B, resolveComponent as X } from "vue";
2
- import { UVEEventType as de, UVE_MODE as L, DotCMSUVEAction as K } from "@dotcms/types";
3
- import { getUVEState as A, initUVE as me, updateNavigation as pe, createUVESubscription as ve, sendMessageToUVE as W } from "@dotcms/uve";
4
- import { registerStyleEditorSchemas as fe, isDotAnalyticsActive as q, ANALYTICS_READY_EVENT as z, DEVELOPMENT_MODE as ye, EMPTY_CONTAINER_STYLE_REACT as Q, getDotContentletAttributes as _e, getAnalyticsContentletAttributes as ge, CUSTOM_NO_COMPONENT as Ce, getContainersData as Ee, getContentletsInContainer as ke, getDotContainerAttributes as De, combineClasses as Te, DOT_SECTION_ID_PREFIX as Me, __DEFAULT_TINYMCE_CONFIG__ as he, __BASE_TINYMCE_CONFIG_WITH_NO_DEFAULT__ as F, __TINYMCE_PATH_ON_DOTCMS__ as be, isValidBlocks as Ne } from "@dotcms/uve/internal";
5
- import Se from "@tinymce/tinymce-vue";
6
- import { __DOTCMS_UVE_EVENT__ as we, BlockEditorDefaultBlocks as $e } from "@dotcms/types/internal";
7
- function xe(e) {
8
- const t = /* @__PURE__ */ new WeakMap(), o = (s) => {
9
- const n = te(s) ? s.value : ne(s) ? oe(s) : s;
10
- if (n === null || typeof n != "object")
11
- return n;
12
- if (t.has(n))
13
- return t.get(n);
14
- if (Array.isArray(n)) {
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 t.set(n, d), n.forEach((y) => d.push(o(y))), d;
35
+ return e.set(o, d), o.forEach((p) => d.push(n(p))), d;
17
36
  }
18
- const a = Object.getPrototypeOf(n);
19
- if (a !== Object.prototype && a !== null)
20
- return n;
21
- const i = {};
22
- t.set(n, i);
23
- for (const d of Object.keys(n))
24
- i[d] = o(n[d]);
25
- return i;
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 o(e);
46
+ return n(t);
28
47
  }
29
- function Gt(e) {
30
- const t = re(e);
31
- let o, s;
32
- return D(() => {
33
- if (!A())
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 (!e) {
54
+ if (!s) {
36
55
  console.warn("[useEditableDotCMSPage]: No page response provided");
37
56
  return;
38
57
  }
39
- const n = xe(e), a = n?.pageAsset?.page?.pageURI;
40
- ({ destroyUVESubscriptions: o } = me(n)), a && pe(a), n.styleEditorSchemas?.length && fe(n.styleEditorSchemas);
41
- }), D(() => {
42
- ({ unsubscribe: s } = ve(
43
- de.CONTENT_CHANGES,
44
- (n) => {
45
- t.value = n;
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
- }), H(() => {
49
- o?.(), s?.();
50
- }), t;
74
+ }), K(() => {
75
+ n?.(), a?.();
76
+ }), e;
51
77
  }
52
- function Ae(e) {
53
- const t = S(!1);
54
- return D(() => {
55
- t.value = A()?.mode === e;
56
- }), se(t);
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 Ht = /* @__PURE__ */ p({
94
+ const Jt = /* @__PURE__ */ v({
59
95
  __name: "DotCMSShow",
60
96
  props: {
61
- when: { default: L.EDIT }
97
+ when: { default: P.EDIT }
62
98
  },
63
- setup(e) {
64
- const o = Ae(e.when);
65
- return (s, n) => C(o) ? N(s.$slots, "default", { key: 0 }) : T("", !0);
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
- }), J = /* @__PURE__ */ Symbol("DotCMSPageContext");
68
- function Ie(e) {
69
- ae(J, e);
103
+ }), re = /* @__PURE__ */ Symbol("DotCMSPageContext");
104
+ function Pe(t) {
105
+ de(re, t);
70
106
  }
71
- const Oe = {
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 I() {
79
- return ce(
80
- J,
81
- c(() => Oe)
115
+ function A() {
116
+ return ee(
117
+ re,
118
+ c(() => Ue)
82
119
  );
83
120
  }
84
- const Re = {
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
- }, Be = /* @__PURE__ */ p({
125
+ }, Fe = /* @__PURE__ */ v({
89
126
  __name: "ErrorMessage",
90
- setup(e) {
91
- const t = I(), o = c(() => t.value.isDevMode);
92
- return D(() => {
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
- }), (s, n) => o.value ? (r(), l("div", Re, [...n[0] || (n[0] = [
95
- f("p", { style: { margin: "0 0 0.5rem", color: "#666" } }, [
96
- _(" The "),
97
- f("code", null, "page"),
98
- _(" is missing the required "),
99
- f("code", null, "layout.body"),
100
- _(" property. ")
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
- f("p", { style: { margin: 0, color: "#666" } }, " Make sure the page asset is properly loaded and includes a layout configuration. ", -1)
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 Le() {
107
- const e = S(!1), t = () => {
108
- e.value = q();
142
+ }), Z = "contentlet-";
143
+ function Ge() {
144
+ const t = N(!1), e = () => {
145
+ t.value = Q();
109
146
  };
110
- return D(() => {
111
- e.value = q(), window.addEventListener(z, t);
112
- }), H(() => {
113
- window.removeEventListener(z, t);
114
- }), e;
147
+ return b(() => {
148
+ t.value = Q(), window.addEventListener(J, e);
149
+ }), K(() => {
150
+ window.removeEventListener(J, e);
151
+ }), t;
115
152
  }
116
- function Pe(e) {
117
- const t = A()?.mode;
118
- return t ? t === L.EDIT : e === ye;
153
+ function He(t) {
154
+ const e = x()?.mode;
155
+ return e ? e === P.EDIT : t === Ee;
119
156
  }
120
- function Ue(e) {
121
- return c(() => Pe(le(e)));
157
+ function Ye(t) {
158
+ return c(() => He(L(t)));
122
159
  }
123
- const Ve = /* @__PURE__ */ p({
160
+ const je = /* @__PURE__ */ v({
124
161
  __name: "ContainerNotFound",
125
162
  props: {
126
163
  identifier: {}
127
164
  },
128
- setup(e) {
129
- const t = e, o = I(), s = c(() => o.value.isDevMode);
130
- return D(() => {
131
- s.value && console.error(`Container with identifier ${t.identifier} not found`);
132
- }), (n, a) => s.value ? (r(), l("div", {
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(C(Q))
136
- }, " This container with identifier " + x(e.identifier) + " was not found. ", 5)) : T("", !0);
172
+ style: w(E(oe))
173
+ }, " This container with identifier " + O(t.identifier) + " was not found. ", 5)) : T("", !0);
137
174
  }
138
- }), Fe = /* @__PURE__ */ p({
175
+ }), Ke = /* @__PURE__ */ v({
139
176
  inheritAttrs: !1,
140
177
  __name: "EmptyContainer",
141
- setup(e) {
142
- const t = I(), o = c(() => t.value.isDevMode);
143
- return (s, n) => o.value ? (r(), l("div", $({ key: 0 }, s.$attrs, { style: C(Q) }), [...n[0] || (n[0] = [
144
- f("span", {
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 Ge(e) {
152
- const t = S(!1);
153
- return D(() => {
154
- const o = e()?.getBoundingClientRect().height ?? 0;
155
- t.value = o > 0;
156
- }), t;
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 He = "dotcms-contentlet", Ye = {
195
+ const qe = "dotcms-contentlet", ze = {
159
196
  key: 1,
160
197
  "data-testid": "no-component"
161
- }, je = /* @__PURE__ */ p({
198
+ }, Xe = /* @__PURE__ */ v({
162
199
  __name: "FallbackComponent",
163
200
  props: {
164
201
  contentlet: {},
165
202
  userNoComponent: {}
166
203
  },
167
- setup(e) {
168
- const t = e, o = I(), s = c(() => o.value.isDevMode), n = c(() => !!t.userNoComponent);
169
- return (a, i) => s.value ? (r(), l(E, { key: 0 }, [
170
- n.value ? (r(), v(M(e.userNoComponent), R($({ key: 0 }, e.contentlet)), null, 16)) : (r(), l("div", Ye, [
171
- i[0] || (i[0] = _(" No Component for ", -1)),
172
- f("strong", null, x(e.contentlet.contentType), 1),
173
- i[1] || (i[1] = _(". ", -1))
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
- }), Ke = /* @__PURE__ */ p({
214
+ }), Qe = /* @__PURE__ */ v({
178
215
  __name: "Contentlet",
179
216
  props: {
180
217
  contentlet: {},
181
218
  container: {}
182
219
  },
183
- setup(e) {
184
- const t = e, o = I(), s = c(() => o.value.isDevMode), n = ie(), a = Ge(
185
- () => n?.proxy?.$el
186
- ), i = c(() => o.value.isDevMode ? {
187
- ..._e(t.contentlet, t.container),
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
- } : o.value.isAnalyticsActive ? ge(t.contentlet) : {}), d = c(
190
- () => s.value ? { minHeight: a.value ? void 0 : "4rem" } : {}
191
- ), y = c(
192
- () => o.value.userComponents[t.contentlet?.contentType]
193
- ), u = c(
194
- () => o.value.userComponents[Ce]
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 (g, m) => (r(), l("div", $(i.value, {
197
- class: C(He),
237
+ return (m, g) => (r(), i("div", $(l.value, {
238
+ class: E(qe),
198
239
  style: d.value
199
240
  }), [
200
- y.value ? (r(), v(M(y.value), R($({ key: 0 }, e.contentlet)), null, 16)) : (r(), v(je, {
201
- key: 1,
202
- "user-no-component": u.value,
203
- contentlet: e.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
- }), We = /* @__PURE__ */ p({
248
+ }), Je = /* @__PURE__ */ v({
208
249
  __name: "Container",
209
250
  props: {
210
251
  container: {}
211
252
  },
212
- setup(e) {
213
- const t = e, o = I(), s = c(() => Ee(o.value.pageAsset, t.container)), n = c(
214
- () => ke(o.value.pageAsset, t.container)
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
- () => o.value.isDevMode ? JSON.stringify(s.value) : ""
257
+ () => n.value.isDevMode ? JSON.stringify(a.value) : ""
219
258
  );
220
- return (y, u) => s.value ? a.value ? (r(), v(Fe, R($({ key: 1 }, i.value)), null, 16)) : (r(), l("div", R($({ key: 2 }, i.value)), [
221
- (r(!0), l(E, null, h(n.value, (g) => (r(), v(Ke, {
222
- key: g.identifier,
223
- contentlet: g,
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(), v(Ve, {
265
+ ], 16)) : (r(), f(je, {
227
266
  key: 0,
228
- identifier: e.container.identifier
267
+ identifier: t.container.identifier
229
268
  }, null, 8, ["identifier"]));
230
269
  }
231
- }), qe = /* @__PURE__ */ p({
270
+ }), Ze = /* @__PURE__ */ v({
232
271
  __name: "Column",
233
272
  props: {
234
273
  column: {}
235
274
  },
236
- setup(e) {
237
- const t = e, o = c(() => ({
238
- gridColumnStart: t.column.leftOffset,
239
- gridColumnEnd: t.column.leftOffset + t.column.width
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 (s, n) => (r(), l("div", {
280
+ return (a, o) => (r(), i("div", {
242
281
  "data-dot": "column",
243
- style: w(o.value)
282
+ style: w(n.value)
244
283
  }, [
245
- f("div", {
246
- class: Y(e.column.styleClass)
284
+ y("div", {
285
+ class: W(t.column.styleClass)
247
286
  }, [
248
- (r(!0), l(E, null, h(e.column.containers, (a) => (r(), v(We, {
249
- key: `${a.identifier}-${a.uuid}`,
250
- container: a
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
- }), ze = ["id"], Xe = /* @__PURE__ */ p({
294
+ }), et = ["id"], tt = /* @__PURE__ */ v({
256
295
  __name: "Row",
257
296
  props: {
258
297
  row: {},
259
298
  index: {}
260
299
  },
261
- setup(e) {
262
- const t = e, o = c(() => Te(["dot-row-container", t.row.styleClass || ""])), s = c(() => `${Me}${t.index}`), n = {
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 (a, i) => (r(), l("div", {
268
- id: s.value,
269
- class: Y(o.value)
306
+ return (s, l) => (r(), i("div", {
307
+ id: a.value,
308
+ class: W(n.value)
270
309
  }, [
271
- f("div", {
310
+ y("div", {
272
311
  class: "dotcms-row",
273
312
  "data-dot-object": "row",
274
- style: n
313
+ style: o
275
314
  }, [
276
- (r(!0), l(E, null, h(e.row.columns, (d, y) => (r(), v(qe, {
277
- key: y,
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, ze));
320
+ ], 10, et));
282
321
  }
283
- }), Yt = /* @__PURE__ */ p({
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(e) {
291
- const t = e, o = Ue(() => t.mode), s = Le();
292
- Ie(
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: t.page,
295
- mode: t.mode,
296
- userComponents: t.components,
297
- isDevMode: o.value,
298
- isAnalyticsActive: s.value
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 n = c(() => t.page?.layout?.body?.rows);
302
- return (a, i) => n.value ? (r(!0), l(E, { key: 0 }, h(n.value, (d, y) => (r(), v(Xe, {
303
- key: y,
304
- row: d,
305
- index: y + 1
306
- }, null, 8, ["row", "index"]))), 128)) : (r(), v(Be, { key: 1 }));
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
- }), G = {
309
- ...he,
358
+ }), Y = {
359
+ ...we,
310
360
  licenseKey: "gpl"
311
361
  // Self-hosted GPL license.
312
- }, Qe = {
362
+ }, nt = {
313
363
  full: {
314
- ...G,
315
- ...F.full
364
+ ...Y,
365
+ ...H.full
316
366
  },
317
367
  plain: {
318
- ...G,
319
- ...F.plain
368
+ ...Y,
369
+ ...H.plain
320
370
  },
321
371
  minimal: {
322
- ...G,
323
- ...F.minimal
372
+ ...Y,
373
+ ...H.minimal
324
374
  }
325
- }, Je = ["innerHTML"], Ze = {
375
+ }, ot = ["innerHTML"], st = {
326
376
  key: 1,
327
377
  style: { outline: "2px solid #006ce7", borderRadius: "4px" }
328
- }, jt = /* @__PURE__ */ p({
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(e) {
337
- const t = e, o = S(null), s = S(""), n = S(!1), a = S(t.contentlet?.[t.fieldName] || ""), i = c(() => Qe[t.mode]);
338
- ue(
339
- () => [t.fieldName, t.contentlet],
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
- a.value = t.contentlet?.[t.fieldName] || "", o.value?.setContent(a.value, { format: t.format });
391
+ s.value = e.contentlet?.[e.fieldName] || "", n.value?.setContent(s.value, { format: e.format });
342
392
  }
343
393
  );
344
- const d = (m, k) => {
345
- o.value = k;
346
- }, y = (m) => {
394
+ const d = (m, g) => {
395
+ n.value = g;
396
+ }, p = (m) => {
347
397
  if (Number(
348
- t.contentlet.onNumberOfPages ?? 1
349
- ) <= 1 || o.value?.hasFocus())
398
+ e.contentlet.onNumberOfPages ?? 1
399
+ ) <= 1 || n.value?.hasFocus())
350
400
  return;
351
401
  m.stopPropagation(), m.preventDefault();
352
- const { inode: O, languageId: V } = t.contentlet;
353
- W({
354
- action: K.COPY_CONTENTLET_INLINE_EDITING,
402
+ const { inode: I, languageId: G } = e.contentlet;
403
+ X({
404
+ action: z.COPY_CONTENTLET_INLINE_EDITING,
355
405
  payload: {
356
- dataset: { inode: O, language: V, fieldName: t.fieldName }
406
+ dataset: { inode: I, language: G, fieldName: e.fieldName }
357
407
  }
358
408
  });
359
409
  }, u = () => {
360
- const m = o.value?.getContent({ format: t.format }) || "";
361
- if (!o.value?.isDirty() || m === a.value)
410
+ const m = n.value?.getContent({ format: e.format }) || "";
411
+ if (!n.value?.isDirty() || m === s.value)
362
412
  return;
363
- const { inode: k, languageId: O } = t.contentlet;
364
- W({
365
- action: K.UPDATE_CONTENTLET_INLINE_EDITING,
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: k, langId: O, fieldName: t.fieldName }
418
+ dataset: { inode: g, langId: I, fieldName: e.fieldName }
369
419
  }
370
420
  });
371
- }, g = ({ data: m }) => {
372
- const { name: k, payload: O } = m ?? {};
373
- if (k !== we.UVE_COPY_CONTENTLET_INLINE_EDITING_SUCCESS)
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: V, inode: Z, fieldName: ee } = O ?? {}, j = t.contentlet.inode;
376
- (j === V || j === Z) && ee === t.fieldName && o.value?.focus();
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 D(() => {
379
- const m = A();
380
- if (n.value = m?.mode === L.EDIT && !!m?.dotCMSHost?.length, !t.contentlet || !t.fieldName) {
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 !== L.EDIT) {
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 && (s.value = new URL(be, m.dotCMSHost).toString(), window.addEventListener("message", g));
391
- }), H(() => {
392
- window.removeEventListener("message", g);
393
- }), (m, k) => n.value ? (r(), l("div", Ze, [
394
- b(C(Se), {
395
- "tinymce-script-src": s.value,
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: i.value,
398
- "initial-value": a.value,
447
+ init: l.value,
448
+ "initial-value": s.value,
399
449
  onInit: d,
400
- onMousedown: y,
450
+ onMousedown: p,
401
451
  onFocusout: u
402
452
  }, null, 8, ["tinymce-script-src", "init", "initial-value"])
403
- ])) : (r(), l("span", {
453
+ ])) : (r(), i("span", {
404
454
  key: 0,
405
- innerHTML: a.value
406
- }, null, 8, Je));
455
+ innerHTML: s.value
456
+ }, null, 8, ot));
407
457
  }
408
- }), U = (e, t) => {
409
- const o = e.__vccOpts || e;
410
- for (const [s, n] of t)
411
- o[s] = n;
412
- return o;
413
- }, et = {};
414
- function tt(e, t) {
415
- return r(), l("ul", null, [
416
- N(e.$slots, "default")
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 nt = /* @__PURE__ */ U(et, [["render", tt]]), ot = ["data-language"], rt = /* @__PURE__ */ p({
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(e) {
425
- const t = e, o = c(() => t.node?.attrs?.language || "");
426
- return (s, n) => (r(), l("pre", { "data-language": o.value }, [
427
- f("code", null, [
428
- N(s.$slots, "default")
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, ot));
480
+ ], 8, lt));
431
481
  }
432
- }), st = /* @__PURE__ */ p({
482
+ }), ut = /* @__PURE__ */ v({
433
483
  __name: "NoComponentProvided",
434
484
  props: {
435
485
  contentType: {}
436
486
  },
437
- setup(e) {
438
- const t = {
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
- }, o = { color: "#c05621" };
447
- return (s, n) => (r(), l("div", {
496
+ }, n = { color: "#c05621" };
497
+ return (a, o) => (r(), i("div", {
448
498
  "data-testid": "no-component-provided",
449
- style: t
499
+ style: e
450
500
  }, [
451
- f("strong", { style: o }, "Dev Warning"),
452
- n[0] || (n[0] = _(": No component or custom renderer provided for content type ", -1)),
453
- f("strong", { style: o }, x(e.contentType || "Unknown"), 1),
454
- n[1] || (n[1] = _(". ", -1)),
455
- n[2] || (n[2] = f("br", null, null, -1)),
456
- n[3] || (n[3] = _(" Please refer to the ", -1)),
457
- f("a", {
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: o
462
- }, "Block Editor Custom Renderers Documentation"),
463
- n[4] || (n[4] = _(" for guidance. ", -1))
511
+ style: n
512
+ }, " Block Editor Custom Renderers Documentation "),
513
+ o[4] || (o[4] = C(" for guidance. ", -1))
464
514
  ]));
465
515
  }
466
- }), at = "[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.", ct = /* @__PURE__ */ p({
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(e) {
474
- const t = (d) => `[DotCMSBlockEditorRenderer]: No matching component found for content type: ${d}. Provide a custom renderer for this content type to fix this error.`, o = e, s = c(() => o.node.attrs?.data), n = c(() => s.value?.contentType ?? "Unknown Content Type"), a = c(() => o.customRenderers?.[n.value]), i = c(() => s.value ? o.isDevMode && !a.value ? "dev-warning" : a.value ? "render" : (console.warn(t(n.value)), "no-component") : (console.error(at), "no-data"));
475
- return (d, y) => i.value === "dev-warning" ? (r(), v(st, {
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": n.value
478
- }, null, 8, ["content-type"])) : i.value === "render" ? (r(), v(M(a.value), {
533
+ "content-type": o.value
534
+ }, null, 8, ["content-type"])) : l.value === "render" ? (r(), f(D(s.value), {
479
535
  key: 1,
480
- node: e.node
536
+ node: t.node
481
537
  }, null, 8, ["node"])) : T("", !0);
482
538
  }
483
- }), lt = ["alt", "src"], it = /* @__PURE__ */ p({
539
+ }), pt = ["alt", "src"], vt = /* @__PURE__ */ v({
484
540
  __name: "DotImage",
485
541
  props: {
486
542
  node: {}
487
543
  },
488
- setup(e) {
489
- const t = e, o = c(() => t.node.attrs ?? {}), s = c(() => {
490
- const { textWrap: a, textAlign: i } = o.value;
491
- return a === "left" ? { float: "left", width: "50%", margin: "0 1rem 1rem 0" } : a === "right" ? { float: "right", width: "50%", margin: "0 0 1rem 1rem" } : i ? { textAlign: i } : {};
492
- }), n = c(
493
- () => o.value.textWrap ? { maxWidth: "100%", height: "auto" } : void 0
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 (a, i) => (r(), l("figure", {
496
- style: w(s.value)
551
+ return (s, l) => (r(), i("figure", {
552
+ style: w(a.value)
497
553
  }, [
498
- f("img", {
499
- alt: o.value.alt,
500
- src: o.value.src,
501
- style: w(n.value)
502
- }, null, 12, lt)
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
- }), ut = ["width", "height", "poster"], dt = ["src", "type"], mt = /* @__PURE__ */ p({
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(e) {
511
- const t = e, o = c(() => t.node.attrs ?? {}), s = c(() => o.value.data?.thumbnail);
512
- return (n, a) => (r(), l("video", {
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: o.value.width,
516
- height: o.value.height,
517
- poster: s.value
571
+ width: n.value.width,
572
+ height: n.value.height,
573
+ poster: a.value
518
574
  }, [
519
- a[0] || (a[0] = f("track", {
575
+ s[0] || (s[0] = y("track", {
520
576
  default: "",
521
577
  kind: "captions",
522
578
  srclang: "en"
523
579
  }, null, -1)),
524
- f("source", {
525
- src: o.value.src,
526
- type: o.value.mimeType
527
- }, null, 8, dt),
528
- a[1] || (a[1] = _(" Your browser does not support the ", -1)),
529
- a[2] || (a[2] = f("code", null, "video", -1)),
530
- a[3] || (a[3] = _(" element. ", -1))
531
- ], 8, ut));
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
- }), pt = /* @__PURE__ */ p({
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(e) {
541
- const t = e, o = c(() => {
542
- const n = t.node.attrs?.columns;
543
- return Array.isArray(n) && n.length === 2 && n.every((a) => typeof a == "number" && Number.isFinite(a)) ? n : [6, 6];
544
- }), s = {
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 (n, a) => (r(), l("div", {
605
+ return (o, s) => (r(), i("div", {
550
606
  "data-type": "gridBlock",
551
607
  class: "grid-block",
552
- style: s
608
+ style: a
553
609
  }, [
554
- (r(!0), l(E, null, h(e.node.content ?? [], (i, d) => (r(), l("div", {
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 ${o.value[d] ?? 6}` })
614
+ style: w({ gridColumn: `span ${n.value[d] ?? 6}` })
559
615
  }, [
560
- b(P, {
561
- content: i.content,
562
- "custom-renderers": e.customRenderers,
563
- "is-dev-mode": e.isDevMode
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
- }), vt = /* @__PURE__ */ p({
624
+ }), Ct = /* @__PURE__ */ v({
569
625
  __name: "Heading",
570
626
  props: {
571
627
  node: {}
572
628
  },
573
- setup(e) {
574
- const t = e, o = c(() => `h${t.node?.attrs?.level || 1}`);
575
- return (s, n) => (r(), v(M(o.value), null, {
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
- N(s.$slots, "default")
633
+ S(a.$slots, "default")
578
634
  ]),
579
635
  _: 3
580
636
  }));
581
637
  }
582
- }), ft = {};
583
- function yt(e, t) {
584
- return r(), l("li", null, [
585
- N(e.$slots, "default")
638
+ }), Et = {};
639
+ function kt(t, e) {
640
+ return r(), i("li", null, [
641
+ S(t.$slots, "default")
586
642
  ]);
587
643
  }
588
- const _t = /* @__PURE__ */ U(ft, [["render", yt]]), gt = {};
589
- function Ct(e, t) {
590
- return r(), l("ol", null, [
591
- N(e.$slots, "default")
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 Et = /* @__PURE__ */ U(gt, [["render", Ct]]), kt = /* @__PURE__ */ p({
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(e) {
600
- const t = e, o = c(() => t.node?.attrs ?? {});
601
- return (s, n) => (r(), l("p", {
602
- style: w(o.value)
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
- N(s.$slots, "default")
660
+ S(a.$slots, "default")
605
661
  ], 4));
606
662
  }
607
- }), Dt = {};
608
- function Tt(e, t) {
609
- return r(), l("blockquote", null, [
610
- N(e.$slots, "default")
663
+ }), St = {};
664
+ function Nt(t, e) {
665
+ return r(), i("blockquote", null, [
666
+ S(t.$slots, "default")
611
667
  ]);
612
668
  }
613
- const Mt = /* @__PURE__ */ U(Dt, [["render", Tt]]), ht = ["aria-label", "aria-labelledby"], bt = { key: 0 }, Nt = ["colspan", "rowspan", "scope"], St = ["colspan", "rowspan"], wt = /* @__PURE__ */ p({
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(e) {
622
- const t = e, o = c(() => t.attrs?.caption || void 0), s = c(() => t.attrs?.ariaLabel || void 0), n = c(() => t.attrs?.ariaLabelledby || void 0), a = (d) => Number(d.attrs?.colspan || 1), i = (d) => Number(d.attrs?.rowspan || 1);
623
- return (d, y) => (r(), l("table", {
624
- "aria-label": s.value,
625
- "aria-labelledby": n.value
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
- o.value ? (r(), l("caption", bt, x(o.value), 1)) : T("", !0),
628
- f("tbody", null, [
629
- (r(!0), l(E, null, h(e.content, (u, g) => (r(), l("tr", {
630
- key: `row-${g}`
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), l(E, null, h(u.content ?? [], (m, k) => (r(), l(E, {
633
- key: `cell-${k}`
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(), l("th", {
691
+ m.type === "tableHeader" ? (r(), i("th", {
636
692
  key: 0,
637
- colspan: a(m),
638
- rowspan: i(m),
693
+ colspan: s(m),
694
+ rowspan: l(m),
639
695
  scope: m.attrs?.scope || void 0
640
696
  }, [
641
- b(P, {
697
+ h(U, {
642
698
  content: m.content ?? [],
643
- "custom-renderers": e.customRenderers,
644
- "is-dev-mode": e.isDevMode
699
+ "custom-renderers": t.customRenderers,
700
+ "is-dev-mode": t.isDevMode
645
701
  }, null, 8, ["content", "custom-renderers", "is-dev-mode"])
646
- ], 8, Nt)) : (r(), l("td", {
702
+ ], 8, xt)) : (r(), i("td", {
647
703
  key: 1,
648
- colspan: a(m),
649
- rowspan: i(m)
704
+ colspan: s(m),
705
+ rowspan: l(m)
650
706
  }, [
651
- b(P, {
707
+ h(U, {
652
708
  content: m.content ?? [],
653
- "custom-renderers": e.customRenderers,
654
- "is-dev-mode": e.isDevMode
709
+ "custom-renderers": t.customRenderers,
710
+ "is-dev-mode": t.isDevMode
655
711
  }, null, 8, ["content", "custom-renderers", "is-dev-mode"])
656
- ], 8, St))
712
+ ], 8, At))
657
713
  ], 64))), 128))
658
714
  ]))), 128))
659
715
  ])
660
- ], 8, ht));
716
+ ], 8, $t));
661
717
  }
662
- }), $t = /* @__PURE__ */ p({
718
+ }), Rt = /* @__PURE__ */ v({
663
719
  __name: "TextBlock",
664
720
  props: {
665
721
  text: {},
666
722
  marks: {}
667
723
  },
668
- setup(e) {
669
- const t = e, o = {
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
- }, s = c(() => t.marks ?? []), n = c(() => s.value[0]), a = c(() => s.value.slice(1)), i = c(() => n.value ? o[n.value.type] : void 0), d = c(() => n.value?.attrs ?? {});
678
- return (y, u) => {
679
- const g = X("TextBlock", !0);
680
- return i.value ? (r(), v(M(i.value), R($({ key: 0 }, d.value)), {
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
- b(g, {
683
- text: e.text,
684
- marks: a.value
738
+ h(_, {
739
+ text: t.text,
740
+ marks: s.value
685
741
  }, null, 8, ["text", "marks"])
686
742
  ]),
687
743
  _: 1
688
- }, 16)) : (r(), l(E, { key: 1 }, [
689
- _(x(e.text), 1)
744
+ }, 16)) : (r(), i(k, { key: 1 }, [
745
+ C(O(t.text), 1)
690
746
  ], 64));
691
747
  };
692
748
  }
693
- }), xt = /* @__PURE__ */ p({
749
+ }), Lt = /* @__PURE__ */ v({
694
750
  __name: "UnknownBlock",
695
751
  props: {
696
752
  node: {}
697
753
  },
698
- setup(e) {
699
- const t = e, o = {
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 D(() => {
709
- A() || console.warn(
710
- `[DotCMSBlockEditorRenderer]: Unknown block type "${t.node?.type}". No renderer was found for it.`
764
+ return b(() => {
765
+ x() || console.warn(
766
+ `[DotCMSBlockEditorRenderer]: Unknown block type "${e.node?.type}". No renderer was found for it.`
711
767
  );
712
- }), (s, n) => C(A)() ? (r(), l("div", {
768
+ }), (a, o) => E(x)() ? (r(), i("div", {
713
769
  key: 0,
714
770
  "data-testid": "unknown-block",
715
- style: o
771
+ style: n
716
772
  }, [
717
- n[0] || (n[0] = _(" Unknown block type: ", -1)),
718
- f("strong", null, x(e.node?.type), 1)
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
- }), At = { key: 4 }, It = { key: 5 }, P = /* @__PURE__ */ p({
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(e) {
729
- const t = $e, o = {
730
- [t.PARAGRAPH]: kt,
731
- [t.HEADING]: vt,
732
- [t.BULLET_LIST]: nt,
733
- [t.ORDERED_LIST]: Et,
734
- [t.LIST_ITEM]: _t,
735
- [t.BLOCK_QUOTE]: Mt,
736
- [t.CODE_BLOCK]: rt
737
- }, s = {
738
- [t.DOT_IMAGE]: it,
739
- [t.DOT_VIDEO]: mt
740
- }, n = (i) => o[i], a = (i) => s[i];
741
- return (i, d) => {
742
- const y = X("BlockEditorBlock", !0);
743
- return r(!0), l(E, null, h(e.content ?? [], (u, g) => (r(), l(E, {
744
- key: `${u.type}-${g}`
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
- e.customRenderers && e.customRenderers[u.type] ? (r(), v(M(e.customRenderers[u.type]), {
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
- b(y, {
807
+ h(p, {
752
808
  content: u.content,
753
- "custom-renderers": e.customRenderers,
754
- "is-dev-mode": e.isDevMode
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"])) : n(u.type) ? (r(), v(M(n(u.type)), {
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
- b(y, {
819
+ h(p, {
764
820
  content: u.content,
765
- "custom-renderers": e.customRenderers,
766
- "is-dev-mode": e.isDevMode
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 === C(t).TEXT ? (r(), v($t, {
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"])) : a(u.type) ? (r(), v(M(a(u.type)), {
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 === C(t).HARDBREAK ? (r(), l("br", At)) : u.type === C(t).HORIZONTAL_RULE ? (r(), l("hr", It)) : u.type === C(t).TABLE ? (r(), v(wt, {
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": e.customRenderers,
782
- "is-dev-mode": e.isDevMode
783
- }, null, 8, ["content", "attrs", "custom-renderers", "is-dev-mode"])) : u.type === C(t).GRID_BLOCK ? (r(), v(pt, {
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": e.customRenderers,
787
- "is-dev-mode": e.isDevMode
788
- }, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : u.type === C(t).DOT_CONTENT ? (r(), v(ct, {
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": e.customRenderers,
792
- "is-dev-mode": e.isDevMode
793
- }, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : (r(), v(xt, {
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
- }), Ot = {
856
+ }), Ut = {
801
857
  key: 0,
802
858
  "data-testid": "invalid-blocks-message"
803
- }, Kt = /* @__PURE__ */ p({
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(e) {
813
- const t = e, o = c(() => Ne(t.blocks)), s = c(() => {
814
- const n = o.value.error;
815
- return n && console.error(n), n;
816
- });
817
- return (n, a) => s.value && e.isDevMode ? (r(), l("div", Ot, x(s.value), 1)) : s.value ? T("", !0) : (r(), l("div", {
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: Y(e.className),
820
- style: w(e.style),
885
+ class: W(t.className),
886
+ style: w(t.style),
821
887
  "data-testid": "dot-block-editor-container"
822
888
  }, [
823
- b(P, {
824
- content: e.blocks?.content,
825
- "custom-renderers": e.customRenderers,
826
- "is-dev-mode": e.isDevMode
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
- J as DOTCMS_PAGE_CONTEXT,
833
- Kt as DotCMSBlockEditorRenderer,
834
- jt as DotCMSEditableText,
835
- Yt as DotCMSLayoutBody,
836
- Ht as DotCMSShow,
837
- Ie as provideDotCMSPageContext,
838
- xe as toPlain,
839
- I as useDotCMSPageContext,
840
- Ae as useDotCMSShowWhen,
841
- Gt as useEditableDotCMSPage
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
  };