@dotcms/vue 26.7.21-1 → 26.7.27-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,12 +1,12 @@
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";
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 p, unref as E, renderSlot as S, createCommentVNode as T, provide as de, openBlock as r, createElementBlock as i, createElementVNode as y, createTextVNode as g, 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
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";
3
+ import { UVEEventType as fe, UVE_MODE as U, DotCMSUVEAction as z } from "@dotcms/types";
4
+ import { createUVESubscription as ye, getUVEState as A, initUVE as _e, updateNavigation as ge, sendMessageToUVE as X } from "@dotcms/uve";
5
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";
6
+ import Ae from "@tinymce/tinymce-vue";
7
+ import { __DOTCMS_UVE_EVENT__ as xe, BlockEditorDefaultBlocks as Ie } from "@dotcms/types/internal";
8
8
  const se = /* @__PURE__ */ Symbol("DotCMSClient");
9
- function qt(t) {
9
+ function Qt(t) {
10
10
  const e = ve(t);
11
11
  return {
12
12
  client: e,
@@ -15,7 +15,7 @@ function qt(t) {
15
15
  }
16
16
  };
17
17
  }
18
- function zt() {
18
+ function Jt() {
19
19
  const t = ee(se, null);
20
20
  if (!t)
21
21
  throw new Error(
@@ -32,7 +32,7 @@ function Re(t) {
32
32
  return e.get(o);
33
33
  if (Array.isArray(o)) {
34
34
  const d = [];
35
- return e.set(o, d), o.forEach((p) => d.push(n(p))), d;
35
+ return e.set(o, d), o.forEach((v) => d.push(n(v))), d;
36
36
  }
37
37
  const s = Object.getPrototypeOf(o);
38
38
  if (s !== Object.prototype && s !== null)
@@ -45,11 +45,11 @@ function Re(t) {
45
45
  };
46
46
  return n(t);
47
47
  }
48
- function Xt(t) {
48
+ function Zt(t) {
49
49
  const e = ue(L(t));
50
50
  let n, a;
51
51
  const o = (s) => {
52
- if (n?.(), n = void 0, !x())
52
+ if (n?.(), n = void 0, !A())
53
53
  return;
54
54
  if (!s) {
55
55
  console.warn("[useEditableDotCMSPage]: No page response provided");
@@ -79,32 +79,32 @@ function Le(t) {
79
79
  const e = N(!1);
80
80
  return b(() => {
81
81
  e.value = !0;
82
- }), c(() => e.value ? x()?.mode === L(t) : !1);
82
+ }), c(() => e.value ? A()?.mode === L(t) : !1);
83
83
  }
84
84
  const Be = /^https?:\/\//;
85
- function Qt(t = "") {
85
+ function en(t = "") {
86
86
  const e = t ? new URL(t).origin : "";
87
87
  return (n, a = {}) => {
88
88
  if (Be.test(n))
89
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}`;
90
+ const { width: o, quality: s = 50, languageId: l = "1" } = a, d = n.includes("/dA/") ? n : `/dA/${n}`, v = o ? `/${o}w` : "";
91
+ return `${e}${d}${v}/${s}q?language_id=${l}`;
92
92
  };
93
93
  }
94
- const Jt = /* @__PURE__ */ v({
94
+ const tn = /* @__PURE__ */ p({
95
95
  __name: "DotCMSShow",
96
96
  props: {
97
- when: { default: P.EDIT }
97
+ when: { default: U.EDIT }
98
98
  },
99
99
  setup(t) {
100
100
  const e = t, n = Le(() => e.when);
101
101
  return (a, o) => E(n) ? S(a.$slots, "default", { key: 0 }) : T("", !0);
102
102
  }
103
103
  }), re = /* @__PURE__ */ Symbol("DotCMSPageContext");
104
- function Pe(t) {
104
+ function Ue(t) {
105
105
  de(re, t);
106
106
  }
107
- const Ue = {
107
+ const Pe = {
108
108
  pageAsset: {},
109
109
  mode: "production",
110
110
  userComponents: {},
@@ -112,29 +112,29 @@ const Ue = {
112
112
  isAnalyticsActive: !1,
113
113
  slots: {}
114
114
  };
115
- function A() {
115
+ function x() {
116
116
  return ee(
117
117
  re,
118
- c(() => Ue)
118
+ c(() => Pe)
119
119
  );
120
120
  }
121
121
  const Ve = {
122
122
  key: 0,
123
123
  "data-testid": "error-message",
124
124
  style: { padding: "1rem", border: "1px solid #e0e0e0", borderRadius: "4px" }
125
- }, Fe = /* @__PURE__ */ v({
125
+ }, Fe = /* @__PURE__ */ p({
126
126
  __name: "ErrorMessage",
127
127
  setup(t) {
128
- const e = A(), n = c(() => e.value.isDevMode);
128
+ const e = x(), n = c(() => e.value.isDevMode);
129
129
  return b(() => {
130
130
  console.warn("Missing required layout.body property in page");
131
131
  }), (a, o) => n.value ? (r(), i("div", Ve, [...o[0] || (o[0] = [
132
132
  y("p", { style: { margin: "0 0 0.5rem", color: "#666" } }, [
133
- C(" The "),
133
+ g(" The "),
134
134
  y("code", null, "page"),
135
- C(" is missing the required "),
135
+ g(" is missing the required "),
136
136
  y("code", null, "layout.body"),
137
- C(" property. ")
137
+ g(" property. ")
138
138
  ], -1),
139
139
  y("p", { style: { margin: 0, color: "#666" } }, " Make sure the page asset is properly loaded and includes a layout configuration. ", -1)
140
140
  ])])) : T("", !0);
@@ -151,19 +151,19 @@ function Ge() {
151
151
  }), t;
152
152
  }
153
153
  function He(t) {
154
- const e = x()?.mode;
155
- return e ? e === P.EDIT : t === Ee;
154
+ const e = A()?.mode;
155
+ return e ? e === U.EDIT : t === Ee;
156
156
  }
157
157
  function Ye(t) {
158
158
  return c(() => He(L(t)));
159
159
  }
160
- const je = /* @__PURE__ */ v({
160
+ const je = /* @__PURE__ */ p({
161
161
  __name: "ContainerNotFound",
162
162
  props: {
163
163
  identifier: {}
164
164
  },
165
165
  setup(t) {
166
- const e = t, n = A(), a = c(() => n.value.isDevMode);
166
+ const e = t, n = x(), a = c(() => n.value.isDevMode);
167
167
  return b(() => {
168
168
  a.value && console.error(`Container with identifier ${e.identifier} not found`);
169
169
  }), (o, s) => a.value ? (r(), i("div", {
@@ -172,11 +172,11 @@ const je = /* @__PURE__ */ v({
172
172
  style: w(E(oe))
173
173
  }, " This container with identifier " + O(t.identifier) + " was not found. ", 5)) : T("", !0);
174
174
  }
175
- }), Ke = /* @__PURE__ */ v({
175
+ }), Ke = /* @__PURE__ */ p({
176
176
  inheritAttrs: !1,
177
177
  __name: "EmptyContainer",
178
178
  setup(t) {
179
- const e = A(), n = c(() => e.value.isDevMode);
179
+ const e = x(), n = c(() => e.value.isDevMode);
180
180
  return (a, o) => n.value ? (r(), i("div", $({ key: 0 }, a.$attrs, { style: E(oe) }), [...o[0] || (o[0] = [
181
181
  y("span", {
182
182
  "data-testid": "empty-container-message",
@@ -195,68 +195,68 @@ function We(t) {
195
195
  const qe = "dotcms-contentlet", ze = {
196
196
  key: 1,
197
197
  "data-testid": "no-component"
198
- }, Xe = /* @__PURE__ */ v({
198
+ }, Xe = /* @__PURE__ */ p({
199
199
  __name: "FallbackComponent",
200
200
  props: {
201
201
  contentlet: {},
202
202
  userNoComponent: {}
203
203
  },
204
204
  setup(t) {
205
- const e = t, n = A(), a = c(() => n.value.isDevMode), o = c(() => !!e.userNoComponent);
205
+ const e = t, n = x(), a = c(() => n.value.isDevMode), o = c(() => !!e.userNoComponent);
206
206
  return (s, l) => a.value ? (r(), i(k, { key: 0 }, [
207
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)),
208
+ l[0] || (l[0] = g(" No Component for ", -1)),
209
209
  y("strong", null, O(t.contentlet.contentType), 1),
210
- l[1] || (l[1] = C(" . ", -1))
210
+ l[1] || (l[1] = g(" . ", -1))
211
211
  ]))
212
212
  ], 64)) : T("", !0);
213
213
  }
214
- }), Qe = /* @__PURE__ */ v({
214
+ }), Qe = /* @__PURE__ */ p({
215
215
  __name: "Contentlet",
216
216
  props: {
217
217
  contentlet: {},
218
218
  container: {}
219
219
  },
220
220
  setup(t) {
221
- const e = t, n = A(), a = c(() => n.value.isDevMode), o = me(), s = We(
221
+ const e = t, n = x(), a = c(() => n.value.isDevMode), o = me(), s = We(
222
222
  () => o?.proxy?.$el
223
223
  ), l = c(() => n.value.isDevMode ? {
224
224
  ...ke(e.contentlet, e.container),
225
225
  "data-dot-object": "contentlet"
226
226
  } : n.value.isAnalyticsActive ? De(e.contentlet) : {}), d = c(
227
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 });
228
+ ), v = c(() => {
229
+ const m = e.contentlet?.identifier, C = m ? n.value.slots?.[m] : void 0;
230
+ if (C)
231
+ return () => C({ contentlet: e.contentlet });
232
232
  }), u = c(
233
233
  () => n.value.userComponents[e.contentlet?.contentType]
234
234
  ), _ = c(
235
235
  () => n.value.userComponents[Te]
236
236
  );
237
- return (m, g) => (r(), i("div", $(l.value, {
237
+ return (m, C) => (r(), i("div", $(l.value, {
238
238
  class: E(qe),
239
239
  style: d.value
240
240
  }), [
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, {
241
+ v.value ? (r(), f(D(v.value), { key: 0 })) : u.value ? (r(), f(D(u.value), R($({ key: 1 }, t.contentlet)), null, 16)) : (r(), f(Xe, {
242
242
  key: 2,
243
243
  "user-no-component": _.value,
244
244
  contentlet: t.contentlet
245
245
  }, null, 8, ["user-no-component", "contentlet"]))
246
246
  ], 16));
247
247
  }
248
- }), Je = /* @__PURE__ */ v({
248
+ }), Je = /* @__PURE__ */ p({
249
249
  __name: "Container",
250
250
  props: {
251
251
  container: {}
252
252
  },
253
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(
254
+ const e = t, n = x(), 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
255
  () => n.value.isDevMode && a.value ? be(a.value) : {}
256
256
  ), d = c(
257
257
  () => n.value.isDevMode ? JSON.stringify(a.value) : ""
258
258
  );
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)), [
259
+ return (v, u) => a.value ? s.value ? (r(), f(Ke, R($({ key: 1 }, l.value)), null, 16)) : (r(), i("div", R($({ key: 2 }, l.value)), [
260
260
  (r(!0), i(k, null, M(o.value, (_) => (r(), f(Qe, {
261
261
  key: _.identifier,
262
262
  contentlet: _,
@@ -267,7 +267,7 @@ const qe = "dotcms-contentlet", ze = {
267
267
  identifier: t.container.identifier
268
268
  }, null, 8, ["identifier"]));
269
269
  }
270
- }), Ze = /* @__PURE__ */ v({
270
+ }), Ze = /* @__PURE__ */ p({
271
271
  __name: "Column",
272
272
  props: {
273
273
  column: {}
@@ -291,7 +291,7 @@ const qe = "dotcms-contentlet", ze = {
291
291
  ], 2)
292
292
  ], 4));
293
293
  }
294
- }), et = ["id"], tt = /* @__PURE__ */ v({
294
+ }), et = ["id"], tt = /* @__PURE__ */ p({
295
295
  __name: "Row",
296
296
  props: {
297
297
  row: {},
@@ -312,14 +312,14 @@ const qe = "dotcms-contentlet", ze = {
312
312
  "data-dot-object": "row",
313
313
  style: o
314
314
  }, [
315
- (r(!0), i(k, null, M(t.row.columns, (d, p) => (r(), f(Ze, {
316
- key: p,
315
+ (r(!0), i(k, null, M(t.row.columns, (d, v) => (r(), f(Ze, {
316
+ key: v,
317
317
  column: d
318
318
  }, null, 8, ["column"]))), 128))
319
319
  ])
320
320
  ], 10, et));
321
321
  }
322
- }), Zt = /* @__PURE__ */ v({
322
+ }), nn = /* @__PURE__ */ p({
323
323
  __name: "DotCMSLayoutBody",
324
324
  props: {
325
325
  page: {},
@@ -328,17 +328,17 @@ const qe = "dotcms-contentlet", ze = {
328
328
  },
329
329
  setup(t) {
330
330
  const e = t, n = Ye(() => e.mode), a = Ge(), o = c(() => {
331
- const p = {};
331
+ const v = {};
332
332
  for (const u of Object.keys(e.components))
333
- p[u] = j(e.components[u]);
334
- return te(p);
333
+ v[u] = j(e.components[u]);
334
+ return te(v);
335
335
  }), s = pe(), l = c(() => {
336
- const p = {}, u = Object.entries(s);
336
+ const v = {}, u = Object.entries(s);
337
337
  for (const [_, m] of u)
338
- m && _.startsWith(Z) && (p[_.slice(Z.length)] = m);
339
- return p;
338
+ m && _.startsWith(Z) && (v[_.slice(Z.length)] = m);
339
+ return v;
340
340
  });
341
- Pe(
341
+ Ue(
342
342
  c(() => ({
343
343
  pageAsset: e.page,
344
344
  mode: e.mode,
@@ -349,7 +349,7 @@ const qe = "dotcms-contentlet", ze = {
349
349
  }))
350
350
  );
351
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, {
352
+ return (v, u) => d.value ? (r(!0), i(k, { key: 0 }, M(d.value, (_, m) => (r(), f(tt, {
353
353
  key: m,
354
354
  row: _,
355
355
  index: m + 1
@@ -375,7 +375,7 @@ const qe = "dotcms-contentlet", ze = {
375
375
  }, ot = ["innerHTML"], st = {
376
376
  key: 1,
377
377
  style: { outline: "2px solid #006ce7", borderRadius: "4px" }
378
- }, en = /* @__PURE__ */ v({
378
+ }, on = /* @__PURE__ */ p({
379
379
  __name: "DotCMSEditableText",
380
380
  props: {
381
381
  contentlet: {},
@@ -391,9 +391,9 @@ const qe = "dotcms-contentlet", ze = {
391
391
  s.value = e.contentlet?.[e.fieldName] || "", n.value?.setContent(s.value, { format: e.format });
392
392
  }
393
393
  );
394
- const d = (m, g) => {
395
- n.value = g;
396
- }, p = (m) => {
394
+ const d = (m, C) => {
395
+ n.value = C;
396
+ }, v = (m) => {
397
397
  if (Number(
398
398
  e.contentlet.onNumberOfPages ?? 1
399
399
  ) <= 1 || n.value?.hasFocus())
@@ -410,44 +410,44 @@ const qe = "dotcms-contentlet", ze = {
410
410
  const m = n.value?.getContent({ format: e.format }) || "";
411
411
  if (!n.value?.isDirty() || m === s.value)
412
412
  return;
413
- const { inode: g, languageId: I } = e.contentlet;
413
+ const { inode: C, languageId: I } = e.contentlet;
414
414
  X({
415
415
  action: z.UPDATE_CONTENTLET_INLINE_EDITING,
416
416
  payload: {
417
417
  content: m,
418
- dataset: { inode: g, langId: I, fieldName: e.fieldName }
418
+ dataset: { inode: C, langId: I, fieldName: e.fieldName }
419
419
  }
420
420
  });
421
421
  }, _ = ({ data: m }) => {
422
- const { name: g, payload: I } = m ?? {};
423
- if (g !== Ae.UVE_COPY_CONTENTLET_INLINE_EDITING_SUCCESS)
422
+ const { name: C, payload: I } = m ?? {};
423
+ if (C !== xe.UVE_COPY_CONTENTLET_INLINE_EDITING_SUCCESS)
424
424
  return;
425
425
  const { oldInode: G, inode: ae, fieldName: ce } = I ?? {}, q = e.contentlet.inode;
426
426
  (q === G || q === ae) && ce === e.fieldName && n.value?.focus();
427
427
  };
428
428
  return b(() => {
429
- const m = x();
430
- if (o.value = m?.mode === P.EDIT && !!m?.dotCMSHost?.length, !e.contentlet || !e.fieldName) {
429
+ const m = A();
430
+ if (o.value = m?.mode === U.EDIT && !!m?.dotCMSHost?.length, !e.contentlet || !e.fieldName) {
431
431
  console.error(
432
432
  "[DotCMSEditableText]: contentlet or fieldName is missing. Ensure all needed props are passed to view and edit the content."
433
433
  );
434
434
  return;
435
435
  }
436
- if (m && m.mode !== P.EDIT) {
436
+ if (m && m.mode !== U.EDIT) {
437
437
  console.warn("[DotCMSEditableText]: TinyMCE is not available in the current mode");
438
438
  return;
439
439
  }
440
440
  m?.dotCMSHost && (a.value = new URL($e, m.dotCMSHost).toString(), window.addEventListener("message", _));
441
441
  }), K(() => {
442
442
  window.removeEventListener("message", _);
443
- }), (m, g) => o.value ? (r(), i("div", st, [
444
- h(E(xe), {
443
+ }), (m, C) => o.value ? (r(), i("div", st, [
444
+ h(E(Ae), {
445
445
  "tinymce-script-src": a.value,
446
446
  inline: !0,
447
447
  init: l.value,
448
448
  "initial-value": s.value,
449
449
  onInit: d,
450
- onMousedown: p,
450
+ onMousedown: v,
451
451
  onFocusout: u
452
452
  }, null, 8, ["tinymce-script-src", "init", "initial-value"])
453
453
  ])) : (r(), i("span", {
@@ -466,7 +466,7 @@ function at(t, e) {
466
466
  S(t.$slots, "default")
467
467
  ]);
468
468
  }
469
- const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it = /* @__PURE__ */ v({
469
+ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it = /* @__PURE__ */ p({
470
470
  __name: "CodeBlock",
471
471
  props: {
472
472
  node: {}
@@ -479,7 +479,27 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
479
479
  ])
480
480
  ], 8, lt));
481
481
  }
482
- }), ut = /* @__PURE__ */ v({
482
+ }), ut = {
483
+ controls: "",
484
+ preload: "metadata"
485
+ }, dt = ["src", "type"], mt = /* @__PURE__ */ p({
486
+ __name: "DotAudio",
487
+ props: {
488
+ node: {}
489
+ },
490
+ setup(t) {
491
+ const e = t, n = c(() => e.node.attrs ?? {});
492
+ return (a, o) => (r(), i("audio", ut, [
493
+ y("source", {
494
+ src: n.value.src,
495
+ type: n.value.mimeType
496
+ }, null, 8, dt),
497
+ o[0] || (o[0] = g(" Your browser does not support the ", -1)),
498
+ o[1] || (o[1] = y("code", null, "audio", -1)),
499
+ o[2] || (o[2] = g(" element. ", -1))
500
+ ]));
501
+ }
502
+ }), pt = /* @__PURE__ */ p({
483
503
  __name: "NoComponentProvided",
484
504
  props: {
485
505
  contentType: {}
@@ -499,21 +519,21 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
499
519
  style: e
500
520
  }, [
501
521
  y("strong", { style: n }, "Dev Warning"),
502
- o[0] || (o[0] = C(" : No component or custom renderer provided for content type ", -1)),
522
+ o[0] || (o[0] = g(" : No component or custom renderer provided for content type ", -1)),
503
523
  y("strong", { style: n }, O(t.contentType || "Unknown"), 1),
504
- o[1] || (o[1] = C(" . ", -1)),
524
+ o[1] || (o[1] = g(" . ", -1)),
505
525
  o[2] || (o[2] = y("br", null, null, -1)),
506
- o[3] || (o[3] = C(" Please refer to the ", -1)),
526
+ o[3] || (o[3] = g(" Please refer to the ", -1)),
507
527
  y("a", {
508
528
  href: "https://dev.dotcms.com/docs/block-editor",
509
529
  target: "_blank",
510
530
  rel: "noopener noreferrer",
511
531
  style: n
512
532
  }, " Block Editor Custom Renderers Documentation "),
513
- o[4] || (o[4] = C(" for guidance. ", -1))
533
+ o[4] || (o[4] = g(" for guidance. ", -1))
514
534
  ]));
515
535
  }
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({
536
+ }), vt = "[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.", ft = /* @__PURE__ */ p({
517
537
  __name: "DotContent",
518
538
  props: {
519
539
  node: {},
@@ -525,10 +545,10 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
525
545
  return V(
526
546
  l,
527
547
  (d) => {
528
- d === "no-data" ? console.error(dt) : d === "no-component" && console.warn(e(o.value));
548
+ d === "no-data" ? console.error(vt) : d === "no-component" && console.warn(e(o.value));
529
549
  },
530
550
  { immediate: !0 }
531
- ), (d, p) => l.value === "dev-warning" ? (r(), f(ut, {
551
+ ), (d, v) => l.value === "dev-warning" ? (r(), f(pt, {
532
552
  key: 0,
533
553
  "content-type": o.value
534
554
  }, null, 8, ["content-type"])) : l.value === "render" ? (r(), f(D(s.value), {
@@ -536,7 +556,7 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
536
556
  node: t.node
537
557
  }, null, 8, ["node"])) : T("", !0);
538
558
  }
539
- }), pt = ["alt", "src"], vt = /* @__PURE__ */ v({
559
+ }), yt = ["alt", "src"], _t = /* @__PURE__ */ p({
540
560
  __name: "DotImage",
541
561
  props: {
542
562
  node: {}
@@ -555,10 +575,10 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
555
575
  alt: n.value.alt,
556
576
  src: n.value.src,
557
577
  style: w(o.value)
558
- }, null, 12, pt)
578
+ }, null, 12, yt)
559
579
  ], 4));
560
580
  }
561
- }), ft = ["width", "height", "poster"], yt = ["src", "type"], _t = /* @__PURE__ */ v({
581
+ }), gt = ["width", "height", "poster"], Ct = ["src", "type"], Et = /* @__PURE__ */ p({
562
582
  __name: "DotVideo",
563
583
  props: {
564
584
  node: {}
@@ -580,13 +600,13 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
580
600
  y("source", {
581
601
  src: n.value.src,
582
602
  type: n.value.mimeType
583
- }, null, 8, yt),
584
- s[1] || (s[1] = C(" Your browser does not support the ", -1)),
603
+ }, null, 8, Ct),
604
+ s[1] || (s[1] = g(" Your browser does not support the ", -1)),
585
605
  s[2] || (s[2] = y("code", null, "video", -1)),
586
- s[3] || (s[3] = C(" element. ", -1))
587
- ], 8, ft));
606
+ s[3] || (s[3] = g(" element. ", -1))
607
+ ], 8, gt));
588
608
  }
589
- }), gt = /* @__PURE__ */ v({
609
+ }), kt = /* @__PURE__ */ p({
590
610
  __name: "GridBlock",
591
611
  props: {
592
612
  node: {},
@@ -613,7 +633,7 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
613
633
  class: "grid-block__column",
614
634
  style: w({ gridColumn: `span ${n.value[d] ?? 6}` })
615
635
  }, [
616
- h(U, {
636
+ h(P, {
617
637
  content: l.content,
618
638
  "custom-renderers": t.customRenderers,
619
639
  "is-dev-mode": t.isDevMode
@@ -621,7 +641,7 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
621
641
  ], 4))), 128))
622
642
  ]));
623
643
  }
624
- }), Ct = /* @__PURE__ */ v({
644
+ }), Dt = /* @__PURE__ */ p({
625
645
  __name: "Heading",
626
646
  props: {
627
647
  node: {}
@@ -635,19 +655,19 @@ const ct = /* @__PURE__ */ F(rt, [["render", at]]), lt = ["data-language"], it =
635
655
  _: 3
636
656
  }));
637
657
  }
638
- }), Et = {};
639
- function kt(t, e) {
658
+ }), Tt = {};
659
+ function Mt(t, e) {
640
660
  return r(), i("li", null, [
641
661
  S(t.$slots, "default")
642
662
  ]);
643
663
  }
644
- const Dt = /* @__PURE__ */ F(Et, [["render", kt]]), Tt = {};
645
- function Mt(t, e) {
664
+ const ht = /* @__PURE__ */ F(Tt, [["render", Mt]]), bt = {};
665
+ function St(t, e) {
646
666
  return r(), i("ol", null, [
647
667
  S(t.$slots, "default")
648
668
  ]);
649
669
  }
650
- const ht = /* @__PURE__ */ F(Tt, [["render", Mt]]), bt = /* @__PURE__ */ v({
670
+ const Nt = /* @__PURE__ */ F(bt, [["render", St]]), wt = /* @__PURE__ */ p({
651
671
  __name: "Paragraph",
652
672
  props: {
653
673
  node: {}
@@ -660,13 +680,13 @@ const ht = /* @__PURE__ */ F(Tt, [["render", Mt]]), bt = /* @__PURE__ */ v({
660
680
  S(a.$slots, "default")
661
681
  ], 4));
662
682
  }
663
- }), St = {};
664
- function Nt(t, e) {
683
+ }), $t = {};
684
+ function Ot(t, e) {
665
685
  return r(), i("blockquote", null, [
666
686
  S(t.$slots, "default")
667
687
  ]);
668
688
  }
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({
689
+ const At = /* @__PURE__ */ F($t, [["render", Ot]]), xt = ["aria-label", "aria-labelledby"], It = { key: 0 }, Rt = ["colspan", "rowspan", "scope"], Lt = ["colspan", "rowspan"], Bt = /* @__PURE__ */ p({
670
690
  __name: "TableRenderer",
671
691
  props: {
672
692
  content: {},
@@ -676,17 +696,17 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
676
696
  },
677
697
  setup(t) {
678
698
  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", {
699
+ return (d, v) => (r(), i("table", {
680
700
  "aria-label": a.value,
681
701
  "aria-labelledby": o.value
682
702
  }, [
683
- n.value ? (r(), i("caption", Ot, O(n.value), 1)) : T("", !0),
703
+ n.value ? (r(), i("caption", It, O(n.value), 1)) : T("", !0),
684
704
  y("tbody", null, [
685
705
  (r(!0), i(k, null, M(t.content, (u, _) => (r(), i("tr", {
686
706
  key: `row-${_}`
687
707
  }, [
688
- (r(!0), i(k, null, M(u.content ?? [], (m, g) => (r(), i(k, {
689
- key: `cell-${g}`
708
+ (r(!0), i(k, null, M(u.content ?? [], (m, C) => (r(), i(k, {
709
+ key: `cell-${C}`
690
710
  }, [
691
711
  m.type === "tableHeader" ? (r(), i("th", {
692
712
  key: 0,
@@ -694,28 +714,28 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
694
714
  rowspan: l(m),
695
715
  scope: m.attrs?.scope || void 0
696
716
  }, [
697
- h(U, {
717
+ h(P, {
698
718
  content: m.content ?? [],
699
719
  "custom-renderers": t.customRenderers,
700
720
  "is-dev-mode": t.isDevMode
701
721
  }, null, 8, ["content", "custom-renderers", "is-dev-mode"])
702
- ], 8, xt)) : (r(), i("td", {
722
+ ], 8, Rt)) : (r(), i("td", {
703
723
  key: 1,
704
724
  colspan: s(m),
705
725
  rowspan: l(m)
706
726
  }, [
707
- h(U, {
727
+ h(P, {
708
728
  content: m.content ?? [],
709
729
  "custom-renderers": t.customRenderers,
710
730
  "is-dev-mode": t.isDevMode
711
731
  }, null, 8, ["content", "custom-renderers", "is-dev-mode"])
712
- ], 8, At))
732
+ ], 8, Lt))
713
733
  ], 64))), 128))
714
734
  ]))), 128))
715
735
  ])
716
- ], 8, $t));
736
+ ], 8, xt));
717
737
  }
718
- }), Rt = /* @__PURE__ */ v({
738
+ }), Ut = /* @__PURE__ */ p({
719
739
  __name: "TextBlock",
720
740
  props: {
721
741
  text: {},
@@ -731,7 +751,7 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
731
751
  subscript: "sub",
732
752
  link: "a"
733
753
  }, 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) => {
754
+ return (v, u) => {
735
755
  const _ = ne("TextBlock", !0);
736
756
  return l.value ? (r(), f(D(l.value), R($({ key: 0 }, d.value)), {
737
757
  default: B(() => [
@@ -742,11 +762,11 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
742
762
  ]),
743
763
  _: 1
744
764
  }, 16)) : (r(), i(k, { key: 1 }, [
745
- C(O(t.text), 1)
765
+ g(O(t.text), 1)
746
766
  ], 64));
747
767
  };
748
768
  }
749
- }), Lt = /* @__PURE__ */ v({
769
+ }), Pt = /* @__PURE__ */ p({
750
770
  __name: "UnknownBlock",
751
771
  props: {
752
772
  node: {}
@@ -762,19 +782,19 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
762
782
  border: "1px solid #fc8181"
763
783
  };
764
784
  return b(() => {
765
- x() || console.warn(
785
+ A() || console.warn(
766
786
  `[DotCMSBlockEditorRenderer]: Unknown block type "${e.node?.type}". No renderer was found for it.`
767
787
  );
768
- }), (a, o) => E(x)() ? (r(), i("div", {
788
+ }), (a, o) => E(A)() ? (r(), i("div", {
769
789
  key: 0,
770
790
  "data-testid": "unknown-block",
771
791
  style: n
772
792
  }, [
773
- o[0] || (o[0] = C(" Unknown block type: ", -1)),
793
+ o[0] || (o[0] = g(" Unknown block type: ", -1)),
774
794
  y("strong", null, O(t.node?.type), 1)
775
795
  ])) : T("", !0);
776
796
  }
777
- }), Bt = { key: 4 }, Pt = { key: 5 }, U = /* @__PURE__ */ v({
797
+ }), Vt = { key: 4 }, Ft = { key: 5 }, P = /* @__PURE__ */ p({
778
798
  __name: "BlockEditorBlock",
779
799
  props: {
780
800
  content: {},
@@ -783,19 +803,20 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
783
803
  },
784
804
  setup(t) {
785
805
  const e = Ie, n = {
786
- [e.PARAGRAPH]: bt,
787
- [e.HEADING]: Ct,
806
+ [e.PARAGRAPH]: wt,
807
+ [e.HEADING]: Dt,
788
808
  [e.BULLET_LIST]: ct,
789
- [e.ORDERED_LIST]: ht,
790
- [e.LIST_ITEM]: Dt,
791
- [e.BLOCK_QUOTE]: wt,
809
+ [e.ORDERED_LIST]: Nt,
810
+ [e.LIST_ITEM]: ht,
811
+ [e.BLOCK_QUOTE]: At,
792
812
  [e.CODE_BLOCK]: it
793
813
  }, a = {
794
- [e.DOT_IMAGE]: vt,
795
- [e.DOT_VIDEO]: _t
814
+ [e.DOT_IMAGE]: _t,
815
+ [e.DOT_VIDEO]: Et,
816
+ [e.DOT_AUDIO]: mt
796
817
  }, o = (l) => n[l], s = (l) => a[l];
797
818
  return (l, d) => {
798
- const p = ne("BlockEditorBlock", !0);
819
+ const v = ne("BlockEditorBlock", !0);
799
820
  return r(!0), i(k, null, M(t.content ?? [], (u, _) => (r(), i(k, {
800
821
  key: `${u.type}-${_}`
801
822
  }, [
@@ -804,7 +825,7 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
804
825
  node: u
805
826
  }, {
806
827
  default: B(() => [
807
- h(p, {
828
+ h(v, {
808
829
  content: u.content,
809
830
  "custom-renderers": t.customRenderers,
810
831
  "is-dev-mode": t.isDevMode
@@ -816,47 +837,47 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
816
837
  node: u
817
838
  }, {
818
839
  default: B(() => [
819
- h(p, {
840
+ h(v, {
820
841
  content: u.content,
821
842
  "custom-renderers": t.customRenderers,
822
843
  "is-dev-mode": t.isDevMode
823
844
  }, null, 8, ["content", "custom-renderers", "is-dev-mode"])
824
845
  ]),
825
846
  _: 2
826
- }, 1032, ["node"])) : u.type === E(e).TEXT ? (r(), f(Rt, {
847
+ }, 1032, ["node"])) : u.type === E(e).TEXT ? (r(), f(Ut, {
827
848
  key: 2,
828
849
  text: u.text,
829
850
  marks: u.marks
830
851
  }, null, 8, ["text", "marks"])) : s(u.type) ? (r(), f(D(s(u.type)), {
831
852
  key: 3,
832
853
  node: u
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, {
854
+ }, null, 8, ["node"])) : u.type === E(e).HARDBREAK ? (r(), i("br", Vt)) : u.type === E(e).HORIZONTAL_RULE ? (r(), i("hr", Ft)) : u.type === E(e).TABLE ? (r(), f(Bt, {
834
855
  key: 6,
835
856
  content: u.content ?? [],
836
857
  attrs: u.attrs,
837
858
  "custom-renderers": t.customRenderers,
838
859
  "is-dev-mode": t.isDevMode
839
- }, null, 8, ["content", "attrs", "custom-renderers", "is-dev-mode"])) : u.type === E(e).GRID_BLOCK ? (r(), f(gt, {
860
+ }, null, 8, ["content", "attrs", "custom-renderers", "is-dev-mode"])) : u.type === E(e).GRID_BLOCK ? (r(), f(kt, {
840
861
  key: 7,
841
862
  node: u,
842
863
  "custom-renderers": t.customRenderers,
843
864
  "is-dev-mode": t.isDevMode
844
- }, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : u.type === E(e).DOT_CONTENT ? (r(), f(mt, {
865
+ }, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : u.type === E(e).DOT_CONTENT ? (r(), f(ft, {
845
866
  key: 8,
846
867
  node: u,
847
868
  "custom-renderers": t.customRenderers,
848
869
  "is-dev-mode": t.isDevMode
849
- }, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : (r(), f(Lt, {
870
+ }, null, 8, ["node", "custom-renderers", "is-dev-mode"])) : (r(), f(Pt, {
850
871
  key: 9,
851
872
  node: u
852
873
  }, null, 8, ["node"]))
853
874
  ], 64))), 128);
854
875
  };
855
876
  }
856
- }), Ut = {
877
+ }), Gt = {
857
878
  key: 0,
858
879
  "data-testid": "invalid-blocks-message"
859
- }, tn = /* @__PURE__ */ v({
880
+ }, sn = /* @__PURE__ */ p({
860
881
  __name: "DotCMSBlockEditorRenderer",
861
882
  props: {
862
883
  blocks: {},
@@ -880,13 +901,13 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
880
901
  s && console.error(s);
881
902
  },
882
903
  { immediate: !0 }
883
- ), (s, l) => o.value && t.isDevMode ? (r(), i("div", Ut, O(o.value), 1)) : o.value ? T("", !0) : (r(), i("div", {
904
+ ), (s, l) => o.value && t.isDevMode ? (r(), i("div", Gt, O(o.value), 1)) : o.value ? T("", !0) : (r(), i("div", {
884
905
  key: 1,
885
906
  class: W(t.className),
886
907
  style: w(t.style),
887
908
  "data-testid": "dot-block-editor-container"
888
909
  }, [
889
- h(U, {
910
+ h(P, {
890
911
  content: t.blocks?.content,
891
912
  "custom-renderers": n.value,
892
913
  "is-dev-mode": t.isDevMode
@@ -897,16 +918,16 @@ const wt = /* @__PURE__ */ F(St, [["render", Nt]]), $t = ["aria-label", "aria-la
897
918
  export {
898
919
  se as DOTCMS_CLIENT,
899
920
  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,
921
+ sn as DotCMSBlockEditorRenderer,
922
+ on as DotCMSEditableText,
923
+ nn as DotCMSLayoutBody,
924
+ tn as DotCMSShow,
925
+ en as createDotCMSImageLoader,
926
+ Qt as createDotCMSVue,
927
+ Ue as provideDotCMSPageContext,
907
928
  Re as toPlain,
908
- zt as useDotCMSClient,
909
- A as useDotCMSPageContext,
929
+ Jt as useDotCMSClient,
930
+ x as useDotCMSPageContext,
910
931
  Le as useDotCMSShowWhen,
911
- Xt as useEditableDotCMSPage
932
+ Zt as useEditableDotCMSPage
912
933
  };
@@ -0,0 +1,7 @@
1
+ import { BlockEditorNode } from '@dotcms/types';
2
+ /** Renders a dotCMS audio block. Mirrors DotVideo without poster/width/height. */
3
+ type __VLS_Props = {
4
+ node: BlockEditorNode;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLAudioElement>;
7
+ export default _default;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dotcms/vue",
3
- "version": "26.07.21-01",
3
+ "version": "26.07.27-01",
4
4
  "peerDependencies": {
5
5
  "vue": ">=3.4"
6
6
  },
7
7
  "dependencies": {
8
- "@dotcms/uve": "26.07.21-01",
9
- "@dotcms/client": "26.07.21-01",
8
+ "@dotcms/uve": "26.07.27-01",
9
+ "@dotcms/client": "26.07.27-01",
10
10
  "@tinymce/tinymce-vue": "^6.1.0"
11
11
  },
12
12
  "devDependencies": {