@templatical/editor 0.12.0 → 0.13.0

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.
Files changed (93) hide show
  1. package/dist/{AiChatSidebar-CXH7l1Ar.js → AiChatSidebar-B0-U5-sb.js} +3 -3
  2. package/dist/{AiFeatureMenu-BKbUUc1D.js → AiFeatureMenu-DxDwLS8B.js} +1 -1
  3. package/dist/{CloudEditor-F5YV5hE3.js → CloudEditor-DaEfipBn.js} +190 -158
  4. package/dist/{CollaboratorBar-ACUA7lBJ.js → CollaboratorBar-DgwjisX2.js} +1 -1
  5. package/dist/{CountdownBlock-C-6o19qS.js → CountdownBlock-DO9fziwf.js} +1 -1
  6. package/dist/{CountdownToolbar-CDy9_2Yj.js → CountdownToolbar-BeII06yJ.js} +1 -1
  7. package/dist/{DesignReferenceSidebar-0dTsBW08.js → DesignReferenceSidebar-BgPDbOsl.js} +19 -31
  8. package/dist/{ModuleBrowserModal-Bz9hSjMS.js → ModuleBrowserModal-DsZRr87F.js} +4 -4
  9. package/dist/{ModulePreviewCanvas-CpaumPMS.js → ModulePreviewCanvas-Dni9kK4j.js} +19 -19
  10. package/dist/{NumberWithSuffix-Cd7bz1Wk.js → NumberWithSuffix-D3fdj0iO.js} +101 -79
  11. package/dist/{ParagraphEditor-BqRFV_Y-.js → ParagraphEditor-CZ-cmhX3.js} +7 -7
  12. package/dist/{SaveModuleDialog-DmfvH5D0.js → SaveModuleDialog-C38VqN2T.js} +2 -2
  13. package/dist/{SnapshotHistory-C052o-8U.js → SnapshotHistory-ByloTpwh.js} +2 -2
  14. package/dist/{TemplateScoringPanel-CUs8XmIi.js → TemplateScoringPanel-CUxiPtEf.js} +1 -1
  15. package/dist/{TestEmailModal-BIIxRWUt.js → TestEmailModal-BvZBMBad.js} +2 -2
  16. package/dist/{TitleEditor-FMh54Cx5.js → TitleEditor-DbNOcvhR.js} +1 -1
  17. package/dist/{TplModal-utMtXzSO.js → TplModal-BYb-X5Bj.js} +1 -1
  18. package/dist/{blockTypeIcons-C6UGDmrC.js → blockTypeIcons-CyAom3iI.js} +4 -4
  19. package/dist/bundle-stats.json +8 -8
  20. package/dist/cdn/chunks/{AiFeatureMenu-4NhCFeTh.js → AiFeatureMenu-BSoy-SoF.js} +7 -7
  21. package/dist/cdn/chunks/{AiFeatureMenu-4NhCFeTh.js.map → AiFeatureMenu-BSoy-SoF.js.map} +1 -1
  22. package/dist/cdn/chunks/{BlockIssueBadge-BYKThwhE.js → BlockIssueBadge-BQDUuJxy.js} +4 -4
  23. package/dist/cdn/chunks/{BlockIssueBadge-BYKThwhE.js.map → BlockIssueBadge-BQDUuJxy.js.map} +1 -1
  24. package/dist/cdn/chunks/{CloudEditor-OO8hWAVp.js → CloudEditor-BZuzsQOZ.js} +231 -199
  25. package/dist/cdn/chunks/CloudEditor-BZuzsQOZ.js.map +1 -0
  26. package/dist/cdn/chunks/{CollaboratorBar-Dn5gXNDt.js → CollaboratorBar-DUpSrtDr.js} +3 -3
  27. package/dist/cdn/chunks/{CollaboratorBar-Dn5gXNDt.js.map → CollaboratorBar-DUpSrtDr.js.map} +1 -1
  28. package/dist/cdn/chunks/{CountdownBlock-hYoJdVOt.js → CountdownBlock-DChGTAsH.js} +2 -2
  29. package/dist/cdn/chunks/{CountdownBlock-hYoJdVOt.js.map → CountdownBlock-DChGTAsH.js.map} +1 -1
  30. package/dist/cdn/chunks/{CountdownToolbar-BXjDFRHI.js → CountdownToolbar-C6gX2SJr.js} +3 -3
  31. package/dist/cdn/chunks/CountdownToolbar-C6gX2SJr.js.map +1 -0
  32. package/dist/cdn/chunks/{IssuesPanel-_5fEnivU.js → IssuesPanel-Bo1uhdSe.js} +6 -6
  33. package/dist/cdn/chunks/{IssuesPanel-_5fEnivU.js.map → IssuesPanel-Bo1uhdSe.js.map} +1 -1
  34. package/dist/cdn/chunks/{ModuleBrowserModal-DtCksAeW.js → ModuleBrowserModal-a-tZRCcD.js} +8 -8
  35. package/dist/cdn/chunks/{ModuleBrowserModal-DtCksAeW.js.map → ModuleBrowserModal-a-tZRCcD.js.map} +1 -1
  36. package/dist/cdn/chunks/{ModulePreviewCanvas-CCOvabZd.js → ModulePreviewCanvas-Bm6k0Op0.js} +24 -24
  37. package/dist/cdn/chunks/{ModulePreviewCanvas-CCOvabZd.js.map → ModulePreviewCanvas-Bm6k0Op0.js.map} +1 -1
  38. package/dist/cdn/chunks/{NumberWithSuffix-ZuJ2ePB0.js → NumberWithSuffix-HTbuD3VJ.js} +139 -118
  39. package/dist/cdn/chunks/NumberWithSuffix-HTbuD3VJ.js.map +1 -0
  40. package/dist/cdn/chunks/{ParagraphEditor-BnhnFOW1.js → ParagraphEditor-pGrfSccu.js} +13 -13
  41. package/dist/cdn/chunks/{ParagraphEditor-BnhnFOW1.js.map → ParagraphEditor-pGrfSccu.js.map} +1 -1
  42. package/dist/cdn/chunks/{RichTextEditorContent-DV2yknp8.js → RichTextEditorContent-D7XZix_1.js} +4 -4
  43. package/dist/cdn/chunks/{RichTextEditorContent-DV2yknp8.js.map → RichTextEditorContent-D7XZix_1.js.map} +1 -1
  44. package/dist/cdn/chunks/{SaveModuleDialog-CCX5U7VA.js → SaveModuleDialog-C9PQ9x6j.js} +4 -4
  45. package/dist/cdn/chunks/{SaveModuleDialog-CCX5U7VA.js.map → SaveModuleDialog-C9PQ9x6j.js.map} +1 -1
  46. package/dist/cdn/chunks/{TitleEditor-CQqklX0D.js → TitleEditor-BvFbL16O.js} +7 -7
  47. package/dist/cdn/chunks/{TitleEditor-CQqklX0D.js.map → TitleEditor-BvFbL16O.js.map} +1 -1
  48. package/dist/cdn/chunks/{blockTypeIcons-CpGPHppB.js → blockTypeIcons-Kd1MT0u8.js} +7 -7
  49. package/dist/cdn/chunks/{blockTypeIcons-CpGPHppB.js.map → blockTypeIcons-Kd1MT0u8.js.map} +1 -1
  50. package/dist/cdn/chunks/{de-DpBN9H7-.js → de-C2wOXoxs.js} +6 -2
  51. package/dist/cdn/chunks/de-C2wOXoxs.js.map +1 -0
  52. package/dist/cdn/chunks/{en-BhHtdIiU.js → en-dR7zfNC3.js} +6 -2
  53. package/dist/cdn/chunks/en-dR7zfNC3.js.map +1 -0
  54. package/dist/cdn/chunks/{extensions-Ds9GnMcd.js → extensions-CuUjSmuA.js} +23 -23
  55. package/dist/cdn/chunks/{extensions-Ds9GnMcd.js.map → extensions-CuUjSmuA.js.map} +1 -1
  56. package/dist/cdn/chunks/{features-DxWz_Enw.js → features-DU6lA8l1.js} +471 -420
  57. package/dist/cdn/chunks/features-DU6lA8l1.js.map +1 -0
  58. package/dist/cdn/chunks/{icons-BflGUmFY.js → icons-BjHUZZyJ.js} +2 -2
  59. package/dist/cdn/chunks/{icons-BflGUmFY.js.map → icons-BjHUZZyJ.js.map} +1 -1
  60. package/dist/cdn/chunks/{media-library-C479-QcE.js → media-library-Byelliig.js} +575 -575
  61. package/dist/cdn/chunks/media-library-Byelliig.js.map +1 -0
  62. package/dist/{pt-BR-Bth5a93y.js → cdn/chunks/pt-BR-BZ86xqK6.js} +7 -1
  63. package/dist/cdn/chunks/pt-BR-BZ86xqK6.js.map +1 -0
  64. package/dist/cdn/chunks/{quality-BL_pEvFP.js → quality-DNnYAntR.js} +83 -83
  65. package/dist/cdn/chunks/{quality-BL_pEvFP.js.map → quality-DNnYAntR.js.map} +1 -1
  66. package/dist/cdn/chunks/{renderer-DwPomkBw.js → renderer-CZKO-Tav.js} +19 -19
  67. package/dist/cdn/chunks/{renderer-DwPomkBw.js.map → renderer-CZKO-Tav.js.map} +1 -1
  68. package/dist/cdn/chunks/{src-DzvOWQ9S.js → src-DsqSXXjk.js} +53 -53
  69. package/dist/cdn/chunks/{src-DzvOWQ9S.js.map → src-DsqSXXjk.js.map} +1 -1
  70. package/dist/cdn/chunks/{styles-D45rgVq8.js → styles-DiAdtiz9.js} +865 -785
  71. package/dist/cdn/chunks/styles-DiAdtiz9.js.map +1 -0
  72. package/dist/cdn/editor.css +1 -1
  73. package/dist/cdn/editor.js +124 -122
  74. package/dist/cdn/editor.js.map +1 -1
  75. package/dist/{de-DpBN9H7-.js → de-C2wOXoxs.js} +5 -1
  76. package/dist/{dist-DJ9aD8yA.js → dist-Cgry6fNv.js} +53 -4
  77. package/dist/{en-BhHtdIiU.js → en-dR7zfNC3.js} +5 -1
  78. package/dist/{cdn/chunks/pt-BR-Bth5a93y.js → pt-BR-BZ86xqK6.js} +5 -3
  79. package/dist/style.css +1 -1
  80. package/dist/{styles-Dp4mJuCM.js → styles-D0RCAWhB.js} +866 -784
  81. package/dist/templatical-editor.js +94 -92
  82. package/dist/upload-BF7sxd1_.js +17 -0
  83. package/dist/{useEditorCore-D7dQFRkw.js → useEditorCore-DKYZ7aKk.js} +788 -735
  84. package/package.json +7 -7
  85. package/dist/cdn/chunks/CloudEditor-OO8hWAVp.js.map +0 -1
  86. package/dist/cdn/chunks/CountdownToolbar-BXjDFRHI.js.map +0 -1
  87. package/dist/cdn/chunks/NumberWithSuffix-ZuJ2ePB0.js.map +0 -1
  88. package/dist/cdn/chunks/de-DpBN9H7-.js.map +0 -1
  89. package/dist/cdn/chunks/en-BhHtdIiU.js.map +0 -1
  90. package/dist/cdn/chunks/features-DxWz_Enw.js.map +0 -1
  91. package/dist/cdn/chunks/media-library-C479-QcE.js.map +0 -1
  92. package/dist/cdn/chunks/pt-BR-Bth5a93y.js.map +0 -1
  93. package/dist/cdn/chunks/styles-D45rgVq8.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { $ as e, A as t, H as n, J as r, M as i, N as a, P as o, V as s, Z as c, _ as l, b as u, ct as d, f, g as p, h as m, it as h, j as g, l as _, m as v, n as y, ot as b, p as x, s as S, st as C, u as w, v as T, x as E, y as D, z as O } from "./draggable-Bci-fq8y.js";
2
- import { A as k, An as A, At as j, Ct as M, Dt as N, E as P, Et as F, Ft as I, Ht as L, It as R, J as z, Nt as ee, Ot as B, Qt as te, Rt as ne, S as V, Un as H, Ut as U, Vt as W, Z as G, _ as K, b as re, c as ie, d as ae, dt as q, en as oe, f as J, g as Y, h as X, hn as Z, ht as se, kt as ce, l as le, m as ue, on as de, p as fe, rt as pe, s as me, tn as he, tt as Q, u as ge, v as _e, wn as ve, x as ye, y as be } from "./features-DxWz_Enw.js";
3
- import { _ as xe, v as Se } from "./icons-BflGUmFY.js";
4
- import { a as Ce, c as we, d as Te, i as Ee, l as De, n as Oe, o as ke, r as Ae, s as je, t as Me, u as Ne } from "./styles-D45rgVq8.js";
5
- import { d as $ } from "./styleConstants-lGobwiLH.js";
2
+ import { $t as ee, A as k, At as A, Dt as j, E as M, Ht as te, It as N, Lt as P, Ot as F, Pt as ne, Q as re, S as I, Tn as L, Ut as R, Wn as z, Wt as ie, Y as B, _ as V, b as H, c as ae, d as U, f as W, ft as G, g as oe, gn as K, gt as q, h as se, it as J, jn as Y, jt as X, kt as Z, l as Q, m as ce, nn as le, nt as $, p as ue, s as de, sn as fe, tn as pe, u as me, v as he, wt as ge, x as _e, y as ve, zt as ye } from "./features-DU6lA8l1.js";
3
+ import { _ as be, v as xe } from "./icons-BjHUZZyJ.js";
4
+ import { a as Se, c as Ce, d as we, i as Te, l as Ee, n as De, o as Oe, r as ke, s as Ae, t as je, u as Me } from "./styles-DiAdtiz9.js";
5
+ import { d as Ne } from "./styleConstants-lGobwiLH.js";
6
6
  //#region src/cloud/composables/useSnapshotPreview.ts
7
7
  function Pe(t) {
8
8
  let { authManager: n, editor: i, history: a, conditionPreview: o, autoSave: s, onError: l } = t, u = e(null), d = c(null), p = c(null), m = !1;
@@ -11,7 +11,7 @@ function Pe(t) {
11
11
  });
12
12
  let h = f(() => d.value !== null), g = f(() => u.value?.snapshots.value ?? []), _ = f(() => u.value?.isLoading.value ?? !1), v = f(() => u.value?.isRestoring.value ?? !1);
13
13
  function y() {
14
- i.state.template?.id && !u.value && (u.value = J({
14
+ i.state.template?.id && !u.value && (u.value = W({
15
15
  authManager: n,
16
16
  templateId: i.state.template.id,
17
17
  onRestore: b,
@@ -86,7 +86,7 @@ function Fe() {
86
86
  function g(t) {
87
87
  l.value = !1, e.value = e.value === t ? null : t;
88
88
  }
89
- return de(u, () => {
89
+ return fe(u, () => {
90
90
  l.value = !1;
91
91
  }), {
92
92
  activePanel: e,
@@ -109,9 +109,9 @@ function Fe() {
109
109
  //#endregion
110
110
  //#region src/cloud/composables/useCollabUndoWarning.ts
111
111
  function Ie(e) {
112
- let { isCollaborationEnabled: t, getCollaboratorCount: n, canUndo: r } = e, i = c(!1), a = c(!1), { start: o } = Z(() => {
112
+ let { isCollaborationEnabled: t, getCollaboratorCount: n, canUndo: r } = e, i = c(!1), a = c(!1), { start: o } = K(() => {
113
113
  a.value = !1;
114
- }, H, { immediate: !1 });
114
+ }, z, { immediate: !1 });
115
115
  function s() {
116
116
  i.value || !t.value || n() === 0 || !r.value || (i.value = !0, a.value = !0, o());
117
117
  }
@@ -123,7 +123,7 @@ function Ie(e) {
123
123
  //#endregion
124
124
  //#region src/cloud/composables/useCloudFeatureFlags.ts
125
125
  function Le(e) {
126
- let { planConfigInstance: t, aiConfig: n, editor: r } = e, i = f(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), a = f(() => t.hasFeature("test_email")), o = f(() => !!r.state.template?.id), s = f(() => t.hasFeature("white_label")), l = f(() => t.config.value?.limits.max_templates ?? null), u = f(() => t.config.value?.template_count ?? 0), d = c(!1), p = c("idle"), m = c(""), { start: h } = Z(() => {
126
+ let { planConfigInstance: t, aiConfig: n, editor: r } = e, i = f(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), a = f(() => t.hasFeature("test_email")), o = f(() => !!r.state.template?.id), s = f(() => t.hasFeature("white_label")), l = f(() => t.config.value?.limits.max_templates ?? null), u = f(() => t.config.value?.template_count ?? 0), d = c(!1), p = c("idle"), m = c(""), { start: h } = K(() => {
127
127
  p.value = "idle";
128
128
  }, 3e3, { immediate: !1 });
129
129
  return {
@@ -142,64 +142,91 @@ function Le(e) {
142
142
  //#endregion
143
143
  //#region src/cloud/composables/useCloudMediaLibrary.ts
144
144
  function Re(e) {
145
- let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: i } = e, a = null;
146
- async function o() {
145
+ let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: i, authManager: a, getMediaConfig: o, onError: s } = e, c = null;
146
+ function l(e) {
147
+ return {
148
+ url: e.url,
149
+ alt: e.alt_text || void 0
150
+ };
151
+ }
152
+ async function u(e) {
153
+ let r = e?.accept ?? ["images"];
154
+ if (e?.files?.length) {
155
+ if (t) {
156
+ let n = await t({
157
+ accept: r,
158
+ files: e.files
159
+ });
160
+ return n ? l(n) : null;
161
+ }
162
+ return d(e.files[0]);
163
+ }
147
164
  if (t) {
148
- let e = await t({ accept: ["images"] });
149
- return e ? {
150
- url: e.url,
151
- alt: e.alt_text || void 0
152
- } : null;
165
+ let e = await t({ accept: r });
166
+ return e ? l(e) : null;
153
167
  }
154
- return a &&= (a(null), null), i.value = ["images"], n.value = !0, new Promise((e) => {
155
- a = (t) => {
168
+ return c &&= (c(null), null), i.value = r, n.value = !0, new Promise((e) => {
169
+ c = (t) => {
156
170
  e(t);
157
171
  };
158
172
  });
159
173
  }
160
- function s(e) {
161
- n.value = !1, a?.({
162
- url: e.url,
163
- alt: e.alt_text || void 0
164
- }), a = null;
174
+ async function d(e) {
175
+ let t = f(e);
176
+ if (t) return s?.(t), null;
177
+ try {
178
+ let { MediaApiClient: t } = await import("./src-DsqSXXjk.js");
179
+ return l(await new t(a).uploadMedia(e));
180
+ } catch (e) {
181
+ return s?.(e), null;
182
+ }
183
+ }
184
+ function f(e) {
185
+ let t = o?.() ?? null;
186
+ if (!t) return null;
187
+ let n = t.categories?.images?.mime_types ?? [];
188
+ return n.length > 0 && !n.includes(e.type) ? /* @__PURE__ */ Error(`Unsupported image type: ${e.type || "unknown"}. Accepted: ${n.join(", ")}.`) : t.max_file_size > 0 && e.size > t.max_file_size ? /* @__PURE__ */ Error(`Image is too large (${e.size} bytes). Maximum allowed is ${t.max_file_size} bytes.`) : null;
189
+ }
190
+ function p(e) {
191
+ n.value = !1, c?.(l(e)), c = null;
165
192
  }
166
- function c() {
167
- n.value = !1, a?.(null), a = null;
193
+ function m() {
194
+ n.value = !1, c?.(null), c = null;
168
195
  }
169
196
  return r(() => {
170
- a &&= (a(null), null);
197
+ c &&= (c(null), null);
171
198
  }), {
172
- handleRequestMedia: o,
173
- handleMediaSelect: s,
174
- handleMediaLibraryClose: c
199
+ handleRequestMedia: u,
200
+ handleMediaSelect: p,
201
+ handleMediaLibraryClose: m
175
202
  };
176
203
  }
177
204
  //#endregion
178
205
  //#region src/cloud/composables/useCloudInitialization.ts
179
206
  function ze(e) {
180
- let { config: t, translations: n, fontsManager: r, emit: i, getCommentsSidebar: o } = e, s = c(!0), l = c(!1), u = c(null), d = !1, p = { value: null }, m = null, h = null, g = new P({
207
+ let { config: t, translations: n, fontsManager: r, emit: i, getCommentsSidebar: o } = e, s = c(!0), l = c(!1), u = c(null), d = !1, p = { value: null }, m = null, h = null, g = new M({
181
208
  ...t.auth,
182
209
  onError: t.onError
183
- }), _ = le({
210
+ }), _ = Q({
184
211
  authManager: g,
185
212
  onError: t.onError
186
- }), v = c(/* @__PURE__ */ new Map()), y = ye({
213
+ }), v = c(/* @__PURE__ */ new Map()), y = _e({
187
214
  authManager: g,
188
215
  defaultFontFamily: t.fonts?.defaultFont,
189
216
  templateDefaults: t.templateDefaults,
190
217
  onError: t.onError,
191
218
  lockedBlocks: v
192
- }), b = ue({
219
+ }), b = ce({
193
220
  authManager: g,
194
221
  onError: t.onError
195
222
  });
196
- t.mcp?.enabled && me({
223
+ t.mcp?.enabled && de({
197
224
  editor: y,
198
225
  channel: b.channel,
199
226
  onOperation: t.mcp.onOperation
200
227
  });
201
228
  let x = null;
202
- t.collaboration?.enabled && (x = Y({
229
+ t.collaboration?.enabled && (x = oe({
203
230
  authManager: g,
204
231
  editor: y,
205
232
  channel: b.channel,
@@ -210,7 +237,7 @@ function ze(e) {
210
237
  onBlockUnlocked: t.collaboration.onBlockUnlocked
211
238
  }), O(() => x.lockedBlocks.value, (e) => {
212
239
  v.value = e;
213
- }, { immediate: !0 }), X(y, x));
240
+ }, { immediate: !0 }), se(y, x));
214
241
  let S = f(() => !!t.collaboration?.enabled && _.hasFeature("collaboration")), C = k({
215
242
  editor: y,
216
243
  config: {
@@ -222,7 +249,7 @@ function ze(e) {
222
249
  mergeTags: t.mergeTags,
223
250
  displayConditions: t.displayConditions,
224
251
  onRequestMedia: null,
225
- lint: Te(t),
252
+ lint: we(t),
226
253
  onSave: () => {
227
254
  p.value?.().catch((e) => {
228
255
  t.onError?.(e);
@@ -258,32 +285,35 @@ function ze(e) {
258
285
  onError: t.onError
259
286
  });
260
287
  m = T;
261
- let E = Fe(), D = re(t.ai), A = Le({
288
+ let E = Fe(), D = H(t.ai), A = Le({
262
289
  planConfigInstance: _,
263
290
  aiConfig: D,
264
291
  editor: y
265
292
  }), j = Re({
266
293
  onRequestMedia: t.onRequestMedia,
267
294
  mediaLibraryOpen: E.mediaLibraryOpen,
268
- mediaLibraryAccept: E.mediaLibraryAccept
295
+ mediaLibraryAccept: E.mediaLibraryAccept,
296
+ authManager: g,
297
+ getMediaConfig: () => _.config.value?.media ?? null,
298
+ onError: t.onError
269
299
  });
270
- G({
300
+ re({
271
301
  onBlockMove: y.moveBlock,
272
302
  onBlockAdd: y.addBlock
273
303
  });
274
- let M = ge({
304
+ let N = me({
275
305
  authManager: g,
276
306
  getFontsConfig: () => t.fonts,
277
307
  canUseCustomFonts: () => _.hasFeature("custom_fonts")
278
- }), N = ae({
308
+ }), F = U({
279
309
  authManager: g,
280
310
  getTemplateId: () => y.state.template?.id ?? null,
281
311
  save: () => y.save(),
282
- exportHtml: (e) => M.exportHtml(e),
312
+ exportHtml: (e) => N.exportHtml(e),
283
313
  onError: t.onError,
284
314
  isAuthReady: l,
285
315
  onBeforeTestEmail: t.onBeforeTestEmail
286
- }), F = _e({
316
+ }), I = he({
287
317
  authManager: g,
288
318
  getTemplateId: () => y.state.template?.id ?? null,
289
319
  getSocketId: () => b.getSocketId(),
@@ -292,56 +322,56 @@ function ze(e) {
292
322
  isAuthReady: l,
293
323
  hasCommentingFeature: () => t.commenting !== !1 && _.hasFeature("commenting")
294
324
  });
295
- K({
296
- comments: F,
325
+ V({
326
+ comments: I,
297
327
  channel: b.channel
298
328
  });
299
- let I = fe({
329
+ let L = ue({
300
330
  authManager: g,
301
331
  onError: t.onError
302
- }), L = c(!1), z = c(null), B = c(!1), V = be({
332
+ }), R = c(!1), z = c(null), B = c(!1), W = ve({
303
333
  authManager: g,
304
334
  getTemplateId: () => y.state.template?.id ?? null
305
335
  });
306
- function H(e) {
336
+ function G(e) {
307
337
  E.commentsOpen.value = !0, queueMicrotask(() => {
308
338
  o()?.filterByBlock(e);
309
339
  });
310
340
  }
311
- a(te, j.handleRequestMedia), a(ne, g), a(R, D), a(U, F), a(oe, I), a(he, V), a(W, {
341
+ a(ee, j.handleRequestMedia), a(ye, g), a(P, D), a(ie, I), a(pe, L), a(le, W), a(te, {
312
342
  plan: _,
313
343
  ai: D,
314
344
  comments: {
315
- getBlockCount: (e) => F.commentCountByBlock.value.get(e) ?? 0,
316
- openForBlock: H
345
+ getBlockCount: (e) => I.commentCountByBlock.value.get(e) ?? 0,
346
+ openForBlock: G
317
347
  },
318
348
  savedModules: {
319
349
  openSaveDialog: (e) => {
320
- z.value = e ?? null, L.value = !0;
350
+ z.value = e ?? null, R.value = !0;
321
351
  },
322
352
  openBrowser: () => {
323
353
  B.value = !0;
324
354
  },
325
- moduleCount: f(() => I.modules.value.length)
355
+ moduleCount: f(() => L.modules.value.length)
326
356
  }
327
357
  });
328
- function q(e) {
358
+ function K(e) {
329
359
  _.hasFeature("theme_customization") && (C.themeOverrides.value = e);
330
360
  }
331
- function J(e) {
361
+ function q(e) {
332
362
  y.setUiTheme(e);
333
363
  }
334
- async function Z() {
364
+ async function J() {
335
365
  s.value = !0, u.value = null;
336
366
  try {
337
367
  if (await g.initialize(), d) return;
338
368
  l.value = !0;
339
- let e = await ie({ authManager: g });
369
+ let e = await ae({ authManager: g });
340
370
  if (d) return;
341
371
  if (!e.api.ok) throw Error("Health check failed: API is not reachable");
342
372
  if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
343
- if (e.websocket.ok || ee.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await _.fetchConfig(), d) return;
344
- r.setCustomFontsEnabled(_.hasFeature("custom_fonts")), t.customBlocks?.length && _.hasFeature("custom_blocks") && C.registerCustomBlocks(t.customBlocks), t.theme && _.hasFeature("theme_customization") && (C.themeOverrides.value = t.theme), t.modules !== !1 && _.hasFeature("saved_modules") && I.loadModules(), i("ready");
373
+ if (e.websocket.ok || ne.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await _.fetchConfig(), d) return;
374
+ r.setCustomFontsEnabled(_.hasFeature("custom_fonts")), t.customBlocks?.length && _.hasFeature("custom_blocks") && C.registerCustomBlocks(t.customBlocks), t.theme && _.hasFeature("theme_customization") && (C.themeOverrides.value = t.theme), t.modules !== !1 && _.hasFeature("saved_modules") && L.loadModules(), i("ready");
345
375
  } catch (e) {
346
376
  if (d) return;
347
377
  let n = e instanceof Error ? e : Error("Initialization failed", { cause: e });
@@ -350,7 +380,7 @@ function ze(e) {
350
380
  d || (s.value = !1);
351
381
  }
352
382
  }
353
- function se() {
383
+ function Y() {
354
384
  d = !0, r.cleanupFontLinks(), b.disconnect(), C.destroy(), t.onUnmount?.();
355
385
  }
356
386
  return {
@@ -368,30 +398,30 @@ function ze(e) {
368
398
  aiConfig: D,
369
399
  featureFlags: A,
370
400
  mediaLib: j,
371
- exporter: M,
372
- testEmail: N,
373
- commentsInstance: F,
374
- savedModulesHeadless: I,
375
- scoringInstance: V,
401
+ exporter: N,
402
+ testEmail: F,
403
+ commentsInstance: I,
404
+ savedModulesHeadless: L,
405
+ scoringInstance: W,
376
406
  panelState: E,
377
407
  snapshotPreview: T,
378
408
  collabWarning: w,
379
- showSaveModuleDialog: L,
409
+ showSaveModuleDialog: R,
380
410
  showModuleBrowserModal: B,
381
411
  saveModulePreSelectedBlockId: z,
382
412
  onSaveHook: p,
383
- initialize: Z,
384
- destroy: se,
385
- setThemeOverrides: q,
386
- setUiTheme: J,
387
- openCommentsForBlock: H
413
+ initialize: J,
414
+ destroy: Y,
415
+ setThemeOverrides: K,
416
+ setUiTheme: q,
417
+ openCommentsForBlock: G
388
418
  };
389
419
  }
390
420
  //#endregion
391
421
  //#region src/utils/preRenderCustomBlocks.ts
392
422
  async function Be(e, t) {
393
423
  let n = async (e) => {
394
- if (A(e)) {
424
+ if (Y(e)) {
395
425
  let n = e;
396
426
  try {
397
427
  n.renderedHtml = await t.renderCustomBlock(n);
@@ -411,7 +441,7 @@ async function Be(e, t) {
411
441
  function Ve(e) {
412
442
  let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
413
443
  function u() {
414
- return V(i.config.value.websocket);
444
+ return I(i.config.value.websocket);
415
445
  }
416
446
  async function d(e) {
417
447
  let i = await n.create(e);
@@ -482,7 +512,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
482
512
  },
483
513
  emits: ["cancel", "confirm"],
484
514
  setup(e, { emit: t }) {
485
- let n = t, { t: r } = Q();
515
+ let n = t, { t: r } = $();
486
516
  return (t, a) => (i(), v(y, {
487
517
  "enter-active-class": "tpl:transition-opacity tpl:duration-150",
488
518
  "leave-active-class": "tpl:transition-opacity tpl:duration-150",
@@ -497,7 +527,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
497
527
  class: "tpl:fixed tpl:inset-0 tpl:z-50 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/40 tpl:p-6",
498
528
  onClick: a[2] ||= _((e) => n("cancel"), ["self"])
499
529
  }, [x("div", We, [
500
- x("header", Ge, [D(h(N), {
530
+ x("header", Ge, [D(h(F), {
501
531
  size: 18,
502
532
  "stroke-width": 2,
503
533
  class: "tpl:text-[var(--tpl-warning)]"
@@ -564,22 +594,22 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
564
594
  },
565
595
  emits: ["save"],
566
596
  setup(e) {
567
- let t = u(() => import("./CollaboratorBar-Dn5gXNDt.js")), n = u(() => import("./features-DxWz_Enw.js").then((e) => e.r)), r = u(() => import("./AiFeatureMenu-4NhCFeTh.js")), { t: a, format: o } = Q();
597
+ let t = u(() => import("./CollaboratorBar-DUpSrtDr.js")), n = u(() => import("./features-DU6lA8l1.js").then((e) => e.r)), r = u(() => import("./AiFeatureMenu-BSoy-SoF.js")), { t: a, format: o } = $();
568
598
  return (c, l) => (i(), p("header", $e, [
569
599
  x("div", et, [e.featureFlags.templateLimit.value === null ? m("", !0) : (i(), p("span", tt, d(h(o)(h(a).header.templatesUsed, {
570
600
  used: e.featureFlags.templateCount.value,
571
601
  max: e.featureFlags.templateLimit.value
572
602
  })), 1))]),
573
603
  x("div", nt, [
574
- D(Ce, {
604
+ D(Se, {
575
605
  viewport: e.editor.state.viewport,
576
606
  onChange: e.editor.setViewport
577
607
  }, null, 8, ["viewport", "onChange"]),
578
- D(Ae, {
608
+ D(ke, {
579
609
  "dark-mode": e.editor.state.darkMode,
580
610
  onChange: e.editor.setDarkMode
581
611
  }, null, 8, ["dark-mode", "onChange"]),
582
- D(Ee, {
612
+ D(Te, {
583
613
  "preview-mode": e.editor.state.previewMode,
584
614
  onChange: e.editor.setPreviewMode
585
615
  }, null, 8, ["preview-mode", "onChange"]),
@@ -609,10 +639,10 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
609
639
  "aria-live": "assertive",
610
640
  class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
611
641
  "data-tooltip": e.featureFlags.saveErrorMessage.value
612
- }, [D(h(j), {
642
+ }, [D(h(X), {
613
643
  size: 12,
614
644
  "stroke-width": 2.5
615
- }), T(" " + d(h(a).header.saveFailed), 1)], 8, it)) : e.featureFlags.saveStatus.value === "saved" ? (i(), p("div", at, [D(h(F), {
645
+ }), T(" " + d(h(a).header.saveFailed), 1)], 8, it)) : e.featureFlags.saveStatus.value === "saved" ? (i(), p("div", at, [D(h(j), {
616
646
  size: 12,
617
647
  "stroke-width": 2.5
618
648
  }), T(" " + d(h(a).header.saved), 1)])) : e.editor.state.isDirty ? (i(), p("div", ot, [l[4] ||= x("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), T(" " + d(h(a).header.unsaved), 1)])) : m("", !0),
@@ -620,7 +650,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
620
650
  key: 3,
621
651
  "aria-label": e.commentsInstance.unresolvedCount.value > 0 ? `${h(a).comments.button} (${e.commentsInstance.unresolvedCount.value})` : h(a).comments.button,
622
652
  "aria-expanded": e.panelState.commentsOpen.value,
623
- class: b(h($)),
653
+ class: b(h(Ne)),
624
654
  style: C({
625
655
  backgroundColor: e.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
626
656
  color: e.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
@@ -628,7 +658,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
628
658
  }),
629
659
  onClick: l[0] ||= (t) => e.panelState.commentsOpen.value = !e.panelState.commentsOpen.value
630
660
  }, [
631
- D(h(se), {
661
+ D(h(q), {
632
662
  size: 16,
633
663
  "stroke-width": 2
634
664
  }),
@@ -643,7 +673,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
643
673
  "aria-expanded": e.panelState.aiMenuOpen.value,
644
674
  class: b(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", e.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
645
675
  onClick: l[1] ||= _((...t) => e.panelState.toggleAiMenu && e.panelState.toggleAiMenu(...t), ["stop"])
646
- }, [D(h(B), {
676
+ }, [D(h(Z), {
647
677
  size: 16,
648
678
  "stroke-width": 2,
649
679
  class: "tpl-ai-btn-icon"
@@ -663,7 +693,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
663
693
  })], 512)) : m("", !0),
664
694
  e.testEmail.isEnabled.value && e.featureFlags.canSendTestEmail.value ? (i(), p("button", {
665
695
  key: 5,
666
- class: b(h($)),
696
+ class: b(h(Ne)),
667
697
  style: {
668
698
  "background-color": "transparent",
669
699
  color: "var(--tpl-primary)",
@@ -671,18 +701,18 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
671
701
  },
672
702
  disabled: e.testEmail.isSending.value || !e.featureFlags.hasTemplateSaved.value,
673
703
  onClick: l[2] ||= (t) => e.panelState.testEmailModalOpen.value = !0
674
- }, [e.testEmail.isSending.value ? (i(), v(h(ce), {
704
+ }, [e.testEmail.isSending.value ? (i(), v(h(A), {
675
705
  key: 1,
676
706
  class: "tpl-spinner",
677
707
  size: 16,
678
708
  "stroke-width": 2
679
- })) : (i(), v(h(q), {
709
+ })) : (i(), v(h(G), {
680
710
  key: 0,
681
711
  size: 16,
682
712
  "stroke-width": 2
683
713
  })), T(" " + d(h(a).testEmail.button), 1)], 10, dt)) : m("", !0),
684
714
  x("button", {
685
- class: b(h($)),
715
+ class: b(h(Ne)),
686
716
  style: {
687
717
  "background-color": "transparent",
688
718
  color: "var(--tpl-primary)",
@@ -690,12 +720,12 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
690
720
  },
691
721
  disabled: e.isSaveDisabled,
692
722
  onClick: l[3] ||= (e) => c.$emit("save")
693
- }, [e.isSaving ? (i(), v(h(ce), {
723
+ }, [e.isSaving ? (i(), v(h(A), {
694
724
  key: 1,
695
725
  class: "tpl-spinner",
696
726
  size: 16,
697
727
  "stroke-width": 2
698
- })) : (i(), v(h(xe), {
728
+ })) : (i(), v(h(be), {
699
729
  key: 0,
700
730
  size: 16,
701
731
  "stroke-width": 2
@@ -726,9 +756,9 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
726
756
  "module-insert"
727
757
  ],
728
758
  setup(e, { expose: t, emit: n }) {
729
- let r = u(() => import("./features-DxWz_Enw.js").then((e) => e.o)), a = u(() => import("./features-DxWz_Enw.js").then((e) => e.a)), o = u(() => import("./features-DxWz_Enw.js").then((e) => e.i)), s = u(() => import("./features-DxWz_Enw.js").then((e) => e.n)), l = u(() => import("./features-DxWz_Enw.js").then((e) => e.t)), d = u(() => import("./SaveModuleDialog-CCX5U7VA.js")), f = u(() => import("./ModuleBrowserModal-DtCksAeW.js")), g = u(async () => {
759
+ let r = u(() => import("./features-DU6lA8l1.js").then((e) => e.o)), a = u(() => import("./features-DU6lA8l1.js").then((e) => e.a)), o = u(() => import("./features-DU6lA8l1.js").then((e) => e.i)), s = u(() => import("./features-DU6lA8l1.js").then((e) => e.n)), l = u(() => import("./features-DU6lA8l1.js").then((e) => e.t)), d = u(() => import("./SaveModuleDialog-C9PQ9x6j.js")), f = u(() => import("./ModuleBrowserModal-a-tZRCcD.js")), g = u(async () => {
730
760
  try {
731
- return (await import("./src-DzvOWQ9S.js")).MediaLibraryModal;
761
+ return (await import("./src-DsqSXXjk.js")).MediaLibraryModal;
732
762
  } catch {
733
763
  throw Error("[Templatical] Cloud media library requires the optional peer dependency '@templatical/media-library'. Please install it.");
734
764
  }
@@ -832,7 +862,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
832
862
  },
833
863
  emits: ["retry"],
834
864
  setup(e, { emit: t }) {
835
- let n = t, { t: r } = Q();
865
+ let n = t, { t: r } = $();
836
866
  function a(e) {
837
867
  return "isUnauthorized" in e && e.isUnauthorized ? r.error.authFailed : "isNotFound" in e && e.isNotFound ? r.error.templateNotFound : r.error.defaultMessage;
838
868
  }
@@ -840,7 +870,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
840
870
  return "isNotFound" in e && !!e.isNotFound;
841
871
  }
842
872
  return (t, s) => e.visible && e.error ? (i(), p("div", yt, [
843
- x("div", bt, [D(h(j), {
873
+ x("div", bt, [D(h(X), {
844
874
  size: 32,
845
875
  "stroke-width": 1.5,
846
876
  class: "tpl:text-[var(--tpl-danger)]"
@@ -861,8 +891,8 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
861
891
  props: { visible: { type: Boolean } },
862
892
  emits: ["cancel", "confirm"],
863
893
  setup(e, { emit: t }) {
864
- let n = t, { t: r } = Q();
865
- return (t, a) => e.visible ? (i(), p("div", Tt, [x("div", Et, [D(h(M), {
894
+ let n = t, { t: r } = $();
895
+ return (t, a) => e.visible ? (i(), p("div", Tt, [x("div", Et, [D(h(ge), {
866
896
  size: 18,
867
897
  "stroke-width": 2,
868
898
  class: "tpl:text-[var(--tpl-primary)]"
@@ -889,10 +919,10 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
889
919
  __name: "CollabUndoToast",
890
920
  props: { visible: { type: Boolean } },
891
921
  setup(e) {
892
- let { t } = I();
922
+ let { t } = N();
893
923
  return (n, r) => e.visible ? (i(), p("div", kt, d(h(t).history.collabWarning), 1)) : m("", !0);
894
924
  }
895
- }), jt = ["data-tpl-theme"], Mt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, Nt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, Pt = ["aria-label"], Ft = /*#__PURE__*/ pe(/* @__PURE__ */ E({
925
+ }), jt = ["data-tpl-theme"], Mt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, Nt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, Pt = ["aria-label"], Ft = /*#__PURE__*/ J(/* @__PURE__ */ E({
896
926
  __name: "CloudEditor",
897
927
  props: {
898
928
  config: {},
@@ -904,71 +934,73 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
904
934
  emits: ["ready"],
905
935
  setup(e, { expose: r, emit: o }) {
906
936
  let l = e;
907
- a(L, l.cloudTranslations);
908
- let u = o, f = c(null), _ = c(null), w = ze({
937
+ a(R, l.cloudTranslations);
938
+ let u = o, f = c(null), w = c(null), E = ze({
909
939
  config: l.config,
910
940
  translations: l.translations,
911
941
  fontsManager: l.fontsManager,
912
942
  emit: u,
913
943
  getCommentsSidebar: () => f.value ? { filterByBlock: f.value.filterCommentsByBlock } : null,
914
944
  editorRoot: l.shadowRoot,
915
- containerEl: _
916
- }), { isInitializing: E, isAuthReady: O, initError: k, planConfigInstance: A, websocket: j, collaboration: M, isCollaborationEnabled: N, editor: P, core: F, featureFlags: I, mediaLib: R, exporter: ee, testEmail: B, commentsInstance: te, savedModulesHeadless: ne, panelState: V, snapshotPreview: H, collabWarning: U, showSaveModuleDialog: W, showModuleBrowserModal: G, saveModulePreSelectedBlockId: K, setThemeOverrides: re, setUiTheme: ie } = w, { showNotice: ae } = z(() => l.config.smallScreenNotice);
917
- async function q(e) {
945
+ containerEl: w
946
+ }), { isInitializing: O, isAuthReady: ee, initError: k, planConfigInstance: A, websocket: j, collaboration: M, isCollaborationEnabled: te, editor: N, core: P, featureFlags: F, mediaLib: ne, exporter: re, testEmail: I, commentsInstance: z, savedModulesHeadless: ie, panelState: V, snapshotPreview: H, collabWarning: ae, showSaveModuleDialog: U, showModuleBrowserModal: W, saveModulePreSelectedBlockId: G, setThemeOverrides: oe, setUiTheme: K } = E, { showNotice: q } = B(() => l.config.smallScreenNotice);
947
+ async function se(e) {
918
948
  try {
919
- await B.sendTestEmail(e), V.testEmailModalOpen.value = !1;
949
+ await I.sendTestEmail(e), V.testEmailModalOpen.value = !1;
920
950
  } catch {}
921
951
  }
922
- async function oe() {
952
+ async function J() {
923
953
  try {
924
954
  await H.confirmRestoreSnapshot();
925
955
  } catch {}
926
956
  }
927
- function J(e, t) {
957
+ function Y(e, t) {
928
958
  for (let n = 0; n < e.content.length; n++) {
929
- let r = ve(e.content[n]), i = t === void 0 ? void 0 : t + n;
930
- P.addBlock(r, void 0, void 0, i);
959
+ let r = L(e.content[n]), i = t === void 0 ? void 0 : t + n;
960
+ N.addBlock(r, void 0, void 0, i);
931
961
  }
932
- G.value = !1;
962
+ W.value = !1;
933
963
  }
934
- let Y = Ve({
964
+ let X = Ve({
935
965
  config: l.config,
936
- editor: P,
966
+ editor: N,
937
967
  websocket: j,
938
968
  planConfigInstance: A,
939
969
  snapshotPreview: H,
940
- core: F,
941
- exporter: ee,
942
- featureFlags: I,
943
- isDestroyed: w.isDestroyed
944
- }), X = He({
945
- issues: F.templateLint ? F.templateLint.issues : c([]),
970
+ core: P,
971
+ exporter: re,
972
+ featureFlags: F,
973
+ isDestroyed: E.isDestroyed
974
+ }), Z = He({
975
+ issues: P.templateLint ? P.templateLint.issues : c([]),
946
976
  planConfig: A.config
947
977
  });
948
- async function Z() {
949
- await X.tryRunSave(() => Y.saveTemplate().catch((e) => l.config.onError?.(e)));
978
+ async function Q() {
979
+ await Z.tryRunSave(() => X.saveTemplate().catch((e) => l.config.onError?.(e)));
950
980
  }
951
- return w.onSaveHook.value = Z, t(() => {
952
- w.initialize();
981
+ return E.onSaveHook.value = Q, t(() => {
982
+ E.initialize();
953
983
  }), g(() => {
954
- w.destroy();
984
+ E.destroy();
955
985
  }), r({
956
- getContent: () => P.content.value,
957
- setContent: (e) => P.setContent(e),
958
- setTheme: ie,
959
- setThemeOverrides: re,
960
- create: Y.createTemplate,
961
- load: Y.loadTemplate,
962
- save: Y.saveTemplate,
963
- sendTestEmail: B.sendTestEmail
986
+ getContent: () => N.content.value,
987
+ setContent: (e) => N.setContent(e),
988
+ setTheme: K,
989
+ setThemeOverrides: oe,
990
+ create: X.createTemplate,
991
+ load: X.loadTemplate,
992
+ save: X.saveTemplate,
993
+ sendTestEmail: I.sendTestEmail
964
994
  }), (t, r) => (i(), p("div", {
965
995
  ref_key: "rootEl",
966
- ref: _,
967
- class: b(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": h(P).state.darkMode }]),
968
- "data-tpl-theme": h(F).resolvedTheme.value,
969
- style: C(h(F).themeStyles.value)
996
+ ref: w,
997
+ class: b(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": h(N).state.darkMode }]),
998
+ "data-tpl-theme": h(P).resolvedTheme.value,
999
+ style: C(h(P).themeStyles.value),
1000
+ onDragover: r[9] ||= _(() => {}, ["prevent"]),
1001
+ onDrop: r[10] ||= _(() => {}, ["prevent"])
970
1002
  }, [
971
- D(De),
1003
+ D(Ee),
972
1004
  D(y, {
973
1005
  "enter-active-class": "tpl:transition-opacity tpl:duration-200",
974
1006
  "enter-from-class": "tpl:opacity-100",
@@ -977,7 +1009,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
977
1009
  "leave-from-class": "tpl:opacity-100",
978
1010
  "leave-to-class": "tpl:opacity-0"
979
1011
  }, {
980
- default: s(() => [D(vt, { visible: h(E) || h(P).state.isLoading }, null, 8, ["visible"])]),
1012
+ default: s(() => [D(vt, { visible: h(O) || h(N).state.isLoading }, null, 8, ["visible"])]),
981
1013
  _: 1
982
1014
  }),
983
1015
  D(y, {
@@ -990,8 +1022,8 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
990
1022
  }, {
991
1023
  default: s(() => [D(wt, {
992
1024
  error: h(k),
993
- visible: !!h(k) && !h(E),
994
- onRetry: h(w).initialize
1025
+ visible: !!h(k) && !h(O),
1026
+ onRetry: h(E).initialize
995
1027
  }, null, 8, [
996
1028
  "error",
997
1029
  "visible",
@@ -1000,19 +1032,19 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1000
1032
  _: 1
1001
1033
  }),
1002
1034
  D(pt, {
1003
- editor: h(P),
1004
- core: h(F),
1005
- "feature-flags": h(I),
1035
+ editor: h(N),
1036
+ core: h(P),
1037
+ "feature-flags": h(F),
1006
1038
  "panel-state": h(V),
1007
1039
  "snapshot-preview": h(H),
1008
- "comments-instance": h(te),
1009
- "test-email": h(B),
1040
+ "comments-instance": h(z),
1041
+ "test-email": h(I),
1010
1042
  websocket: h(j),
1011
1043
  collaboration: h(M),
1012
- "is-collaboration-enabled": h(N),
1013
- "is-saving": h(P).state.isSaving || h(I).isSaveExporting.value,
1014
- "is-save-disabled": h(P).state.isSaving || h(I).isSaveExporting.value || !h(P).state.isDirty,
1015
- onSave: Z
1044
+ "is-collaboration-enabled": h(te),
1045
+ "is-saving": h(N).state.isSaving || h(F).isSaveExporting.value,
1046
+ "is-save-disabled": h(N).state.isSaving || h(F).isSaveExporting.value || !h(N).state.isDirty,
1047
+ onSave: Q
1016
1048
  }, null, 8, [
1017
1049
  "editor",
1018
1050
  "core",
@@ -1028,10 +1060,10 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1028
1060
  "is-save-disabled"
1029
1061
  ]),
1030
1062
  D(Qe, {
1031
- open: h(X).modalOpen.value,
1032
- issues: h(X).blockingIssues.value,
1033
- onCancel: h(X).cancel,
1034
- onConfirm: h(X).confirmAndSave
1063
+ open: h(Z).modalOpen.value,
1064
+ issues: h(Z).blockingIssues.value,
1065
+ onCancel: h(Z).cancel,
1066
+ onConfirm: h(Z).confirmAndSave
1035
1067
  }, null, 8, [
1036
1068
  "open",
1037
1069
  "issues",
@@ -1041,7 +1073,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1041
1073
  D(Ot, {
1042
1074
  visible: h(H).isPreviewingSnapshot.value,
1043
1075
  onCancel: h(H).cancelPreview,
1044
- onConfirm: oe
1076
+ onConfirm: J
1045
1077
  }, null, 8, ["visible", "onCancel"]),
1046
1078
  D(y, {
1047
1079
  "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
@@ -1051,18 +1083,18 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1051
1083
  "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1052
1084
  "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1053
1085
  }, {
1054
- default: s(() => [D(At, { visible: h(U).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1086
+ default: s(() => [D(At, { visible: h(ae).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1055
1087
  _: 1
1056
1088
  }),
1057
- n(D(we, null, null, 512), [[S, !h(P).state.previewMode]]),
1089
+ n(D(Ce, null, null, 512), [[S, !h(N).state.previewMode]]),
1058
1090
  x("div", {
1059
- class: b(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [h(P).state.previewMode ? "tpl:left-0 tpl:right-0" : h(V).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", h(H).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1091
+ class: b(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [h(N).state.previewMode ? "tpl:left-0 tpl:right-0" : h(V).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", h(H).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1060
1092
  style: {
1061
1093
  transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1062
1094
  "background-color": "var(--tpl-canvas-bg)"
1063
1095
  }
1064
1096
  }, [x("div", Mt, [D(y, { name: "tpl-restore-btn" }, {
1065
- default: s(() => [h(F).conditionPreview.hasHiddenBlocks.value ? (i(), p("button", {
1097
+ default: s(() => [h(P).conditionPreview.hasHiddenBlocks.value ? (i(), p("button", {
1066
1098
  key: 0,
1067
1099
  class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",
1068
1100
  style: {
@@ -1071,20 +1103,20 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1071
1103
  "border-color": "var(--tpl-warning)",
1072
1104
  "backdrop-filter": "blur(8px)"
1073
1105
  },
1074
- onClick: r[0] ||= (e) => h(F).conditionPreview.reset()
1075
- }, [D(h(Se), {
1106
+ onClick: r[0] ||= (e) => h(P).conditionPreview.reset()
1107
+ }, [D(h(xe), {
1076
1108
  size: 13,
1077
1109
  "stroke-width": 2
1078
- }), T(" " + d(h(F).t.blockSettings.restoreHiddenBlocks), 1)])) : m("", !0)]),
1110
+ }), T(" " + d(h(P).t.blockSettings.restoreHiddenBlocks), 1)])) : m("", !0)]),
1079
1111
  _: 1
1080
- })]), x("main", Nt, [D(Ne, {
1081
- viewport: h(P).state.viewport,
1082
- content: h(P).content.value,
1083
- "selected-block-id": h(P).state.selectedBlockId,
1084
- "dark-mode": h(P).state.darkMode,
1085
- "preview-mode": h(P).state.previewMode,
1112
+ })]), x("main", Nt, [D(Me, {
1113
+ viewport: h(N).state.viewport,
1114
+ content: h(N).content.value,
1115
+ "selected-block-id": h(N).state.selectedBlockId,
1116
+ "dark-mode": h(N).state.darkMode,
1117
+ "preview-mode": h(N).state.previewMode,
1086
1118
  "locked-blocks": h(M)?.lockedBlocks.value ?? void 0,
1087
- onSelectBlock: h(P).selectBlock,
1119
+ onSelectBlock: h(N).selectBlock,
1088
1120
  onOpenAiChat: r[1] ||= (e) => h(V).aiChatOpen.value = !0,
1089
1121
  onOpenDesignReference: r[2] ||= (e) => h(V).designReferenceOpen.value = !0
1090
1122
  }, null, 8, [
@@ -1096,51 +1128,51 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1096
1128
  "locked-blocks",
1097
1129
  "onSelectBlock"
1098
1130
  ])])], 2),
1099
- e.config.branding !== !1 && !h(I).isWhiteLabeled.value ? (i(), v(Oe, {
1131
+ e.config.branding !== !1 && !h(F).isWhiteLabeled.value ? (i(), v(De, {
1100
1132
  key: 0,
1101
- "position-class": [h(P).state.previewMode ? "tpl:left-0 tpl:right-0" : h(V).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1133
+ "position-class": [h(N).state.previewMode ? "tpl:left-0 tpl:right-0" : h(V).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1102
1134
  }, null, 8, ["position-class"])) : m("", !0),
1103
1135
  x("div", {
1104
1136
  class: "tpl-sr-only",
1105
1137
  role: "status",
1106
1138
  "aria-live": "polite",
1107
1139
  "aria-atomic": "true",
1108
- "aria-label": h(F).t.landmarks.reorderAnnouncements
1109
- }, d(h(F).keyboardReorder.announcement.value), 9, Pt),
1110
- n(D(je, {
1111
- "selected-block": h(P).selectedBlock.value,
1112
- settings: h(P).content.value.settings,
1140
+ "aria-label": h(P).t.landmarks.reorderAnnouncements
1141
+ }, d(h(P).keyboardReorder.announcement.value), 9, Pt),
1142
+ n(D(Ae, {
1143
+ "selected-block": h(N).selectedBlock.value,
1144
+ settings: h(N).content.value.settings,
1113
1145
  "shifted-left": h(V).rightPanelOpen.value,
1114
- onUpdateBlock: r[3] ||= (e) => h(P).updateBlock(h(P).selectedBlock.value.id, e),
1115
- onDeleteBlock: r[4] ||= (e) => h(F).blockActions.deleteBlock(h(P).selectedBlock.value.id),
1116
- onDuplicateBlock: r[5] ||= (e) => h(F).blockActions.duplicateBlock(h(P).selectedBlock.value),
1117
- onUpdateSettings: h(P).updateSettings
1146
+ onUpdateBlock: r[3] ||= (e) => h(N).updateBlock(h(N).selectedBlock.value.id, e),
1147
+ onDeleteBlock: r[4] ||= (e) => h(P).blockActions.deleteBlock(h(N).selectedBlock.value.id),
1148
+ onDuplicateBlock: r[5] ||= (e) => h(P).blockActions.duplicateBlock(h(N).selectedBlock.value),
1149
+ onUpdateSettings: h(N).updateSettings
1118
1150
  }, null, 8, [
1119
1151
  "selected-block",
1120
1152
  "settings",
1121
1153
  "shifted-left",
1122
1154
  "onUpdateSettings"
1123
- ]), [[S, !h(P).state.previewMode]]),
1124
- !h(E) && h(O) ? (i(), v(mt, {
1155
+ ]), [[S, !h(N).state.previewMode]]),
1156
+ !h(O) && h(ee) ? (i(), v(mt, {
1125
1157
  key: 1,
1126
1158
  ref_key: "cloudPanelsRef",
1127
1159
  ref: f,
1128
1160
  config: l.config,
1129
- editor: h(P),
1130
- core: h(F),
1161
+ editor: h(N),
1162
+ core: h(P),
1131
1163
  "panel-state": h(V),
1132
1164
  "plan-config-instance": h(A),
1133
- "test-email": h(B),
1134
- "media-lib": h(R),
1135
- "saved-modules-headless": h(ne),
1136
- "show-save-module-dialog": h(W),
1137
- "save-module-pre-selected-block-id": h(K),
1138
- "show-module-browser-modal": h(G),
1139
- "onUpdate:showSaveModuleDialog": r[6] ||= (e) => W.value = e,
1140
- "onUpdate:saveModulePreSelectedBlockId": r[7] ||= (e) => K.value = e,
1141
- "onUpdate:showModuleBrowserModal": r[8] ||= (e) => G.value = e,
1142
- onSendTestEmail: q,
1143
- onModuleInsert: J
1165
+ "test-email": h(I),
1166
+ "media-lib": h(ne),
1167
+ "saved-modules-headless": h(ie),
1168
+ "show-save-module-dialog": h(U),
1169
+ "save-module-pre-selected-block-id": h(G),
1170
+ "show-module-browser-modal": h(W),
1171
+ "onUpdate:showSaveModuleDialog": r[6] ||= (e) => U.value = e,
1172
+ "onUpdate:saveModulePreSelectedBlockId": r[7] ||= (e) => G.value = e,
1173
+ "onUpdate:showModuleBrowserModal": r[8] ||= (e) => W.value = e,
1174
+ onSendTestEmail: se,
1175
+ onModuleInsert: Y
1144
1176
  }, null, 8, [
1145
1177
  "config",
1146
1178
  "editor",
@@ -1155,15 +1187,15 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1155
1187
  "show-module-browser-modal"
1156
1188
  ])) : m("", !0),
1157
1189
  x("div", {
1158
- ref: (e) => h(F).popoverRoot.value = e,
1190
+ ref: (e) => h(P).popoverRoot.value = e,
1159
1191
  class: "tpl-popover-root"
1160
1192
  }, null, 512),
1161
- D(Me),
1162
- h(ae) ? (i(), v(ke, { key: 2 })) : m("", !0)
1163
- ], 14, jt));
1193
+ D(je),
1194
+ h(q) ? (i(), v(Oe, { key: 2 })) : m("", !0)
1195
+ ], 46, jt));
1164
1196
  }
1165
- }), [["__scopeId", "data-v-df1ba3f4"]]);
1197
+ }), [["__scopeId", "data-v-8c4fa160"]]);
1166
1198
  //#endregion
1167
1199
  export { Ft as default };
1168
1200
 
1169
- //# sourceMappingURL=CloudEditor-OO8hWAVp.js.map
1201
+ //# sourceMappingURL=CloudEditor-BZuzsQOZ.js.map