@templatical/editor 0.21.1 → 0.21.2

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.
@@ -363,36 +363,36 @@ function Be(e) {
363
363
  comments: I,
364
364
  channel: b.channel
365
365
  });
366
- let z = le({
367
- provider: Te(h),
366
+ let z = typeof t.savedBlocks == "object" && t.savedBlocks !== null ? t.savedBlocks : null, U = le({
367
+ provider: z ?? Te(h),
368
368
  editor: y,
369
369
  onError: t.onError,
370
- isAvailable: () => t.savedBlocks !== !1 && g.hasFeature("saved_modules")
371
- }), U = _e({
370
+ isAvailable: z ? () => !0 : () => t.savedBlocks !== !1 && g.hasFeature("saved_modules")
371
+ }), W = _e({
372
372
  authManager: h,
373
373
  getTemplateId: () => y.state.template?.id ?? null
374
374
  });
375
- function W(e) {
375
+ function G(e) {
376
376
  D.commentsOpen.value = !0, queueMicrotask(() => {
377
377
  o()?.filterByBlock(e);
378
378
  });
379
379
  }
380
- _(L, A.handleRequestMedia), _(B, h), _(H, O), _(ee, I), _(R, U), _(V, {
380
+ _(L, A.handleRequestMedia), _(B, h), _(H, O), _(ee, I), _(R, W), _(V, {
381
381
  plan: g,
382
382
  ai: O,
383
383
  comments: {
384
384
  getBlockCount: (e) => I.commentCountByBlock.value.get(e) ?? 0,
385
- openForBlock: W
385
+ openForBlock: G
386
386
  },
387
- savedBlocks: z.capability
387
+ savedBlocks: U.capability
388
388
  });
389
- function G(e) {
389
+ function K(e) {
390
390
  g.hasFeature("theme_customization") && (w.themeOverrides.value = e);
391
391
  }
392
- function K(e) {
392
+ function q(e) {
393
393
  y.setUiTheme(e);
394
394
  }
395
- async function q() {
395
+ async function te() {
396
396
  s.value = !0, l.value = null;
397
397
  try {
398
398
  if (await h.initialize(), d) return;
@@ -411,7 +411,7 @@ function Be(e) {
411
411
  d || (s.value = !1);
412
412
  }
413
413
  }
414
- function te() {
414
+ function ne() {
415
415
  d = !0, r.cleanupFontLinks(), b.disconnect(), w.destroy(), t.onUnmount?.();
416
416
  }
417
417
  return {
@@ -432,17 +432,17 @@ function Be(e) {
432
432
  exporter: P,
433
433
  testEmail: F,
434
434
  commentsInstance: I,
435
- savedBlocks: z,
436
- scoringInstance: U,
435
+ savedBlocks: U,
436
+ scoringInstance: W,
437
437
  panelState: D,
438
438
  snapshotPreview: E,
439
439
  collabWarning: T,
440
440
  onSaveHook: f,
441
- initialize: q,
442
- destroy: te,
443
- setThemeOverrides: G,
444
- setUiTheme: K,
445
- openCommentsForBlock: W
441
+ initialize: te,
442
+ destroy: ne,
443
+ setThemeOverrides: K,
444
+ setUiTheme: q,
445
+ openCommentsForBlock: G
446
446
  };
447
447
  }
448
448
  //#endregion
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.21.1",
3
- "initialGzipBytes": 286973,
2
+ "version": "0.21.2",
3
+ "initialGzipBytes": 286975,
4
4
  "initialRawBytes": 1033853,
5
5
  "initialFileCount": 38,
6
- "lazyGzipBytes": 190248,
7
- "lazyRawBytes": 624400,
6
+ "lazyGzipBytes": 190290,
7
+ "lazyRawBytes": 624509,
8
8
  "lazyFileCount": 52,
9
- "generatedAt": "2026-07-29T19:31:48.705Z"
9
+ "generatedAt": "2026-07-30T09:39:43.642Z"
10
10
  }
@@ -4,9 +4,9 @@ import { F as A } from "./src-BKI1x1k7.js";
4
4
  import { T as j, b as M, j as N, t as P } from "./useEditorCore-BA6mspzD.js";
5
5
  import { _ as F } from "./dist-CiBEt0VR.js";
6
6
  import { t as I } from "./dist-CxTt8FRE.js";
7
- import { A as L, F as R, c as z, r as B, s as V, t as H, u as U } from "./keys-D7kUmfpE.js";
8
- import { t as W } from "./useI18n-8Wd7G-cq.js";
9
- import { At as G, Dt as K, F as ee, Ft as q, P as J, et as te, j as ne, rt as Y, u as re, w as ie } from "./icons-CYWw8Xfp.js";
7
+ import { A as L, F as R, c as z, r as B, s as V, t as H, u as ee } from "./keys-D7kUmfpE.js";
8
+ import { t as U } from "./useI18n-8Wd7G-cq.js";
9
+ import { At as W, Dt as G, F as te, Ft as K, P as q, et as J, j as ne, rt as Y, u as re, w as ie } from "./icons-CYWw8Xfp.js";
10
10
  import { t as ae } from "./_plugin-vue_export-helper-B3ysoDQm.js";
11
11
  import { n as X } from "./useCloudI18n-BjNENqkM.js";
12
12
  import { a as Z, c as oe, d as se, f as Q, i as ce, l as le, n as ue, o as de, p as fe, r as pe, s as me, t as he, u as ge } from "./styles-DMOEiSX9.js";
@@ -339,11 +339,11 @@ function ze(e) {
339
339
  comments: I,
340
340
  channel: b.channel
341
341
  });
342
- let z = fe({
343
- provider: Ae(g),
342
+ let z = typeof t.savedBlocks == "object" && t.savedBlocks !== null ? t.savedBlocks : null, U = fe({
343
+ provider: z ?? Ae(g),
344
344
  editor: y,
345
345
  onError: t.onError,
346
- isAvailable: () => t.savedBlocks !== !1 && _.hasFeature("saved_modules")
346
+ isAvailable: z ? () => !0 : () => t.savedBlocks !== !1 && _.hasFeature("saved_modules")
347
347
  }), W = Ee({
348
348
  authManager: g,
349
349
  getTemplateId: () => y.state.template?.id ?? null
@@ -353,19 +353,19 @@ function ze(e) {
353
353
  o()?.filterByBlock(e);
354
354
  });
355
355
  }
356
- a(L, A.handleRequestMedia), a(B, g), a(H, D), a(U, I), a(R, W), a(V, {
356
+ a(L, A.handleRequestMedia), a(B, g), a(H, D), a(ee, I), a(R, W), a(V, {
357
357
  plan: _,
358
358
  ai: D,
359
359
  comments: {
360
360
  getBlockCount: (e) => I.commentCountByBlock.value.get(e) ?? 0,
361
361
  openForBlock: G
362
362
  },
363
- savedBlocks: z.capability
363
+ savedBlocks: U.capability
364
364
  });
365
- function K(e) {
365
+ function te(e) {
366
366
  _.hasFeature("theme_customization") && (C.themeOverrides.value = e);
367
367
  }
368
- function ee(e) {
368
+ function K(e) {
369
369
  y.setUiTheme(e);
370
370
  }
371
371
  async function q() {
@@ -408,7 +408,7 @@ function ze(e) {
408
408
  exporter: M,
409
409
  testEmail: F,
410
410
  commentsInstance: I,
411
- savedBlocks: z,
411
+ savedBlocks: U,
412
412
  scoringInstance: W,
413
413
  panelState: E,
414
414
  snapshotPreview: T,
@@ -416,8 +416,8 @@ function ze(e) {
416
416
  onSaveHook: p,
417
417
  initialize: q,
418
418
  destroy: J,
419
- setThemeOverrides: K,
420
- setUiTheme: ee,
419
+ setThemeOverrides: te,
420
+ setUiTheme: K,
421
421
  openCommentsForBlock: G
422
422
  };
423
423
  }
@@ -643,10 +643,10 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
643
643
  "aria-live": "assertive",
644
644
  class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
645
645
  "data-tooltip": e.featureFlags.saveErrorMessage.value
646
- }, [D(h(G), {
646
+ }, [D(h(W), {
647
647
  size: 12,
648
648
  "stroke-width": 2.5
649
- }), T(" " + d(h(a).header.saveFailed), 1)], 8, it)) : e.featureFlags.saveStatus.value === "saved" ? (i(), p("div", at, [D(h(q), {
649
+ }), T(" " + d(h(a).header.saveFailed), 1)], 8, it)) : e.featureFlags.saveStatus.value === "saved" ? (i(), p("div", at, [D(h(K), {
650
650
  size: 12,
651
651
  "stroke-width": 2.5
652
652
  }), 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),
@@ -662,7 +662,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
662
662
  }),
663
663
  onClick: l[0] ||= (t) => e.panelState.commentsOpen.value = !e.panelState.commentsOpen.value
664
664
  }, [
665
- D(h(te), {
665
+ D(h(J), {
666
666
  size: 16,
667
667
  "stroke-width": 2
668
668
  }),
@@ -729,7 +729,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
729
729
  class: "tpl-spinner",
730
730
  size: 16,
731
731
  "stroke-width": 2
732
- })) : (i(), v(h(J), {
732
+ })) : (i(), v(h(q), {
733
733
  key: 0,
734
734
  size: 16,
735
735
  "stroke-width": 2
@@ -846,7 +846,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
846
846
  return "isNotFound" in e && !!e.isNotFound;
847
847
  }
848
848
  return (t, s) => e.visible && e.error ? (i(), p("div", yt, [
849
- x("div", bt, [D(h(G), {
849
+ x("div", bt, [D(h(W), {
850
850
  size: 32,
851
851
  "stroke-width": 1.5,
852
852
  class: "tpl:text-[var(--tpl-danger)]"
@@ -868,7 +868,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
868
868
  emits: ["cancel", "confirm"],
869
869
  setup(e, { emit: t }) {
870
870
  let n = t, { t: r } = X();
871
- return (t, a) => e.visible ? (i(), p("div", Tt, [x("div", Et, [D(h(K), {
871
+ return (t, a) => e.visible ? (i(), p("div", Tt, [x("div", Et, [D(h(G), {
872
872
  size: 18,
873
873
  "stroke-width": 2,
874
874
  class: "tpl:text-[var(--tpl-primary)]"
@@ -895,7 +895,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
895
895
  __name: "CollabUndoToast",
896
896
  props: { visible: { type: Boolean } },
897
897
  setup(e) {
898
- let { t } = W();
898
+ let { t } = U();
899
899
  return (n, r) => e.visible ? (i(), p("div", kt, d(h(t).history.collabWarning), 1)) : m("", !0);
900
900
  }
901
901
  }), 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__*/ ae(/* @__PURE__ */ E({
@@ -919,15 +919,15 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
919
919
  getCommentsSidebar: () => E.value ? { filterByBlock: E.value.filterCommentsByBlock } : null,
920
920
  editorRoot: f.shadowRoot,
921
921
  containerEl: O
922
- }), { isInitializing: A, isAuthReady: j, initError: N, planConfigInstance: P, websocket: F, collaboration: I, isCollaborationEnabled: L, editor: R, core: B, featureFlags: V, mediaLib: H, exporter: U, testEmail: W, commentsInstance: G, savedBlocks: K, panelState: q, snapshotPreview: J, collabWarning: te, setThemeOverrides: ne, setUiTheme: Y } = k, { showNotice: re } = M(() => f.config.smallScreenNotice);
922
+ }), { isInitializing: A, isAuthReady: j, initError: N, planConfigInstance: P, websocket: F, collaboration: I, isCollaborationEnabled: L, editor: R, core: B, featureFlags: V, mediaLib: H, exporter: ee, testEmail: U, commentsInstance: W, savedBlocks: G, panelState: K, snapshotPreview: q, collabWarning: J, setThemeOverrides: ne, setUiTheme: Y } = k, { showNotice: re } = M(() => f.config.smallScreenNotice);
923
923
  async function ie(e) {
924
924
  try {
925
- await W.sendTestEmail(e), q.testEmailModalOpen.value = !1;
925
+ await U.sendTestEmail(e), K.testEmailModalOpen.value = !1;
926
926
  } catch {}
927
927
  }
928
928
  async function ae() {
929
929
  try {
930
- await J.confirmRestoreSnapshot();
930
+ await q.confirmRestoreSnapshot();
931
931
  } catch {}
932
932
  }
933
933
  let X = Ve({
@@ -935,9 +935,9 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
935
935
  editor: R,
936
936
  websocket: F,
937
937
  planConfigInstance: P,
938
- snapshotPreview: J,
938
+ snapshotPreview: q,
939
939
  core: B,
940
- exporter: U,
940
+ exporter: ee,
941
941
  featureFlags: V,
942
942
  isDestroyed: k.isDestroyed
943
943
  }), Z = He({
@@ -959,7 +959,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
959
959
  create: X.createTemplate,
960
960
  load: X.loadTemplate,
961
961
  save: X.saveTemplate,
962
- sendTestEmail: W.sendTestEmail
962
+ sendTestEmail: U.sendTestEmail
963
963
  }), (t, r) => (i(), p("div", {
964
964
  ref_key: "rootEl",
965
965
  ref: O,
@@ -1004,10 +1004,10 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1004
1004
  editor: h(R),
1005
1005
  core: h(B),
1006
1006
  "feature-flags": h(V),
1007
- "panel-state": h(q),
1008
- "snapshot-preview": h(J),
1009
- "comments-instance": h(G),
1010
- "test-email": h(W),
1007
+ "panel-state": h(K),
1008
+ "snapshot-preview": h(q),
1009
+ "comments-instance": h(W),
1010
+ "test-email": h(U),
1011
1011
  websocket: h(F),
1012
1012
  collaboration: h(I),
1013
1013
  "is-collaboration-enabled": h(L),
@@ -1040,8 +1040,8 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1040
1040
  "onConfirm"
1041
1041
  ]),
1042
1042
  D(Ot, {
1043
- visible: h(J).isPreviewingSnapshot.value,
1044
- onCancel: h(J).cancelPreview,
1043
+ visible: h(q).isPreviewingSnapshot.value,
1044
+ onCancel: h(q).cancelPreview,
1045
1045
  onConfirm: ae
1046
1046
  }, null, 8, ["visible", "onCancel"]),
1047
1047
  D(y, {
@@ -1052,12 +1052,12 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1052
1052
  "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1053
1053
  "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1054
1054
  }, {
1055
- default: s(() => [D(At, { visible: h(te).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1055
+ default: s(() => [D(At, { visible: h(J).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1056
1056
  _: 1
1057
1057
  }),
1058
1058
  n(D(le, null, null, 512), [[S, !h(R).state.previewMode]]),
1059
1059
  x("div", {
1060
- class: b(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [h(R).state.previewMode ? "tpl:left-0 tpl:right-0" : h(q).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", h(J).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1060
+ class: b(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [h(R).state.previewMode ? "tpl:left-0 tpl:right-0" : h(K).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", h(q).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1061
1061
  style: {
1062
1062
  transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1063
1063
  "background-color": "var(--tpl-canvas-bg)"
@@ -1073,7 +1073,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1073
1073
  "backdrop-filter": "blur(8px)"
1074
1074
  },
1075
1075
  onClick: r[0] ||= (e) => h(B).conditionPreview.reset()
1076
- }, [D(h(ee), {
1076
+ }, [D(h(te), {
1077
1077
  size: 13,
1078
1078
  "stroke-width": 2
1079
1079
  }), T(" " + d(h(B).t.blockSettings.restoreHiddenBlocks), 1)])) : m("", !0)]),
@@ -1086,8 +1086,8 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1086
1086
  "preview-mode": h(R).state.previewMode,
1087
1087
  "locked-blocks": h(I)?.lockedBlocks.value ?? void 0,
1088
1088
  onSelectBlock: h(R).selectBlock,
1089
- onOpenAiChat: r[1] ||= (e) => h(q).aiChatOpen.value = !0,
1090
- onOpenDesignReference: r[2] ||= (e) => h(q).designReferenceOpen.value = !0
1089
+ onOpenAiChat: r[1] ||= (e) => h(K).aiChatOpen.value = !0,
1090
+ onOpenDesignReference: r[2] ||= (e) => h(K).designReferenceOpen.value = !0
1091
1091
  }, null, 8, [
1092
1092
  "viewport",
1093
1093
  "content",
@@ -1099,7 +1099,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1099
1099
  ])])], 2),
1100
1100
  e.config.branding !== !1 && !h(V).isWhiteLabeled.value ? (i(), v(pe, {
1101
1101
  key: 0,
1102
- "position-class": [h(R).state.previewMode ? "tpl:left-0 tpl:right-0" : h(q).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1102
+ "position-class": [h(R).state.previewMode ? "tpl:left-0 tpl:right-0" : h(K).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1103
1103
  }, null, 8, ["position-class"])) : m("", !0),
1104
1104
  x("div", {
1105
1105
  class: "tpl-sr-only",
@@ -1111,7 +1111,7 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1111
1111
  n(D(oe, {
1112
1112
  "selected-block": h(R).selectedBlock.value,
1113
1113
  settings: h(R).content.value.settings,
1114
- "shifted-left": h(q).rightPanelOpen.value,
1114
+ "shifted-left": h(K).rightPanelOpen.value,
1115
1115
  onUpdateBlock: r[3] ||= (e) => h(R).updateBlock(h(R).selectedBlock.value.id, e),
1116
1116
  onDeleteBlock: r[4] ||= (e) => h(B).blockActions.deleteBlock(h(R).selectedBlock.value.id),
1117
1117
  onDuplicateBlock: r[5] ||= (e) => h(B).blockActions.duplicateBlock(h(R).selectedBlock.value),
@@ -1129,9 +1129,9 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1129
1129
  config: f.config,
1130
1130
  editor: h(R),
1131
1131
  core: h(B),
1132
- "panel-state": h(q),
1132
+ "panel-state": h(K),
1133
1133
  "plan-config-instance": h(P),
1134
- "test-email": h(W),
1134
+ "test-email": h(U),
1135
1135
  "media-lib": h(H),
1136
1136
  onSendTestEmail: ie
1137
1137
  }, null, 8, [
@@ -1143,9 +1143,9 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1143
1143
  "test-email",
1144
1144
  "media-lib"
1145
1145
  ])) : m("", !0),
1146
- h(K).isAvailable.value ? (i(), v(h(l), {
1146
+ h(G).isAvailable.value ? (i(), v(h(l), {
1147
1147
  key: 2,
1148
- feature: h(K)
1148
+ feature: h(G)
1149
1149
  }, null, 8, ["feature"])) : m("", !0),
1150
1150
  x("div", {
1151
1151
  ref: (e) => h(B).popoverRoot.value = e,
@@ -1160,4 +1160,4 @@ var Ue = ["aria-label"], We = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl
1160
1160
  //#endregion
1161
1161
  export { Ft as default };
1162
1162
 
1163
- //# sourceMappingURL=CloudEditor-B3hqbwfP.js.map
1163
+ //# sourceMappingURL=CloudEditor-C0Y4RD4c.js.map