@aswin.dev/editor 0.7.1 → 0.7.3

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 (116) hide show
  1. package/LICENSE +56 -0
  2. package/dist/{AiChatSidebar-DWGPVtvC.js → AiChatSidebar-Dt5pvG5t.js} +37 -51
  3. package/dist/{AiFeatureMenu-duUFSfDf.js → AiFeatureMenu-BipxcGap.js} +1 -1
  4. package/dist/{CloudEditor-CFldoCOb.js → CloudEditor-CnUX0IOW.js} +283 -239
  5. package/dist/{CollaboratorBar-Bw-lbt61.js → CollaboratorBar-NaaZTjbs.js} +2 -2
  6. package/dist/{CommentsSidebar-BaD5F53-.js → CommentsSidebar-DE6ZsM4D.js} +9 -10
  7. package/dist/CountdownBlock-Ba3T-i2X.js +1536 -0
  8. package/dist/{CountdownToolbar-Dg4F8MTk.js → CountdownToolbar-CbhSp_uq.js} +1 -1
  9. package/dist/{DesignReferenceSidebar-BSH7uNP_.js → DesignReferenceSidebar-CZg97bbj.js} +1 -1
  10. package/dist/{ModuleBrowserModal-6phxZSKI.js → ModuleBrowserModal-D2EVdexc.js} +4 -4
  11. package/dist/{ModulePreviewCanvas-BW8L3eQX.js → ModulePreviewCanvas-P3N-nxkU.js} +52 -47
  12. package/dist/{NumberWithSuffix-BpUzQOJt.js → NumberWithSuffix-CihczoAd.js} +1 -1
  13. package/dist/{ParagraphEditor-DNSzAB-I.js → ParagraphEditor-BbRuKhWv.js} +7 -7
  14. package/dist/{SaveModuleDialog-zMQTpez7.js → SaveModuleDialog-DLZa3m3O.js} +2 -2
  15. package/dist/{SnapshotHistory-Do-A5rYU.js → SnapshotHistory-Csg1_jXi.js} +3 -3
  16. package/dist/{TestEmailModal-DGj_9V1u.js → TestEmailModal-m3okLbJz.js} +2 -2
  17. package/dist/{TitleEditor-C7IDnAoS.js → TitleEditor-CtJIS5ER.js} +2 -2
  18. package/dist/{TplModal-BAsVzcTb.js → TplModal-CQCrKeKP.js} +1 -1
  19. package/dist/{blockTypeIcons-C6LDKvmd.js → blockTypeIcons-Dah0pgt-.js} +50 -19
  20. package/dist/bundle-stats.json +8 -8
  21. package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js +97 -0
  22. package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js.map +1 -0
  23. package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js +59 -0
  24. package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js.map +1 -0
  25. package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js +33 -0
  26. package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js.map +1 -0
  27. package/dist/cdn/chunks/CloudEditor-56lVcdot.js +1220 -0
  28. package/dist/cdn/chunks/CloudEditor-56lVcdot.js.map +1 -0
  29. package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js +51 -0
  30. package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js.map +1 -0
  31. package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js +212 -0
  32. package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js.map +1 -0
  33. package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js +195 -0
  34. package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js.map +1 -0
  35. package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js +113 -0
  36. package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js.map +1 -0
  37. package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js +423 -0
  38. package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js.map +1 -0
  39. package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js +544 -0
  40. package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js.map +1 -0
  41. package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js +106 -0
  42. package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js.map +1 -0
  43. package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js +119 -0
  44. package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js.map +1 -0
  45. package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js +171 -0
  46. package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js.map +1 -0
  47. package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js +24 -0
  48. package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js.map +1 -0
  49. package/dist/cdn/chunks/de-B05yW8Gi.js +840 -0
  50. package/dist/cdn/chunks/de-B05yW8Gi.js.map +1 -0
  51. package/dist/cdn/chunks/de-BPHtelu7.js +209 -0
  52. package/dist/cdn/chunks/de-BPHtelu7.js.map +1 -0
  53. package/dist/cdn/chunks/de-BRDqJwJe.js +89 -0
  54. package/dist/cdn/chunks/de-BRDqJwJe.js.map +1 -0
  55. package/dist/cdn/chunks/draggable-C-1_gch3.js +11572 -0
  56. package/dist/cdn/chunks/draggable-C-1_gch3.js.map +1 -0
  57. package/dist/cdn/chunks/emojiData-DUHzsh4j.js +19 -0
  58. package/dist/cdn/chunks/emojiData-DUHzsh4j.js.map +1 -0
  59. package/dist/cdn/chunks/en-BII7695P.js +840 -0
  60. package/dist/cdn/chunks/en-BII7695P.js.map +1 -0
  61. package/dist/cdn/chunks/en-Cdj_Ikl1.js +89 -0
  62. package/dist/cdn/chunks/en-Cdj_Ikl1.js.map +1 -0
  63. package/dist/cdn/chunks/en-DejwuJhw.js +209 -0
  64. package/dist/cdn/chunks/en-DejwuJhw.js.map +1 -0
  65. package/dist/cdn/chunks/extensions-B0eT-yjf.js +598 -0
  66. package/dist/cdn/chunks/extensions-B0eT-yjf.js.map +1 -0
  67. package/dist/cdn/chunks/features-BrvE2Fzv.js +9677 -0
  68. package/dist/cdn/chunks/features-BrvE2Fzv.js.map +1 -0
  69. package/dist/cdn/chunks/icons-C7wtAD8p.js +1043 -0
  70. package/dist/cdn/chunks/icons-C7wtAD8p.js.map +1 -0
  71. package/dist/cdn/chunks/liquid.browser-CllF-us3.js +3279 -0
  72. package/dist/cdn/chunks/liquid.browser-CllF-us3.js.map +1 -0
  73. package/dist/cdn/chunks/media-library-Cl5XuaKy.js +6030 -0
  74. package/dist/cdn/chunks/media-library-Cl5XuaKy.js.map +1 -0
  75. package/dist/cdn/chunks/pusher-i7-OBujc.js +2508 -0
  76. package/dist/cdn/chunks/pusher-i7-OBujc.js.map +1 -0
  77. package/dist/cdn/chunks/quality-Va91a3N8.js +1456 -0
  78. package/dist/cdn/chunks/quality-Va91a3N8.js.map +1 -0
  79. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  80. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  81. package/dist/cdn/chunks/renderer-si0Zgxeb.js +642 -0
  82. package/dist/cdn/chunks/renderer-si0Zgxeb.js.map +1 -0
  83. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  84. package/dist/cdn/chunks/src-BLyYIbdZ.js +497 -0
  85. package/dist/cdn/chunks/src-BLyYIbdZ.js.map +1 -0
  86. package/dist/cdn/chunks/styleConstants-DfcU8u_r.js +57 -0
  87. package/dist/cdn/chunks/styleConstants-DfcU8u_r.js.map +1 -0
  88. package/dist/cdn/chunks/styles-C6BQLT9F.js +5807 -0
  89. package/dist/cdn/chunks/styles-C6BQLT9F.js.map +1 -0
  90. package/dist/cdn/chunks/tiptap-D8whBv5F.js +14654 -0
  91. package/dist/cdn/chunks/tiptap-D8whBv5F.js.map +1 -0
  92. package/dist/cdn/editor.css +2 -0
  93. package/dist/cdn/editor.js +367 -0
  94. package/dist/cdn/editor.js.map +1 -0
  95. package/dist/{cloud-6ZmAvF0j.js → cloud-BoS0J0vs.js} +1 -1
  96. package/dist/{de-DWcgp-7T.js → de-C74F9xK3.js} +112 -3
  97. package/dist/dist-C2grMquk.js +1261 -0
  98. package/dist/{dist-CivF9P8b.js → dist-Djgi0A6k.js} +92 -77
  99. package/dist/{en-Cxd4fhNm.js → en-B24jVTeO.js} +112 -3
  100. package/dist/{extensions-D__hOlV1.js → extensions-DsmjHqBF.js} +14 -14
  101. package/dist/index.d.ts +21 -10
  102. package/dist/{pencil-BZJPNYWR.js → pencil-Bpimrzzw.js} +5 -2
  103. package/dist/style.css +1 -1
  104. package/dist/styles-BMFMtR9R.js +6341 -0
  105. package/dist/templatical-editor.js +197 -139
  106. package/dist/undo-2-m1EUDbUg.js +16 -0
  107. package/dist/{useEditorCore-wslttMH-.js → useEditorCore-CtNAo0uy.js} +2154 -2025
  108. package/dist/useMergeTag-2vTcVpNo.js +34 -0
  109. package/package.json +12 -12
  110. package/dist/CountdownBlock-DaYGxKqo.js +0 -92
  111. package/dist/check-DJrpDKO_.js +0 -7
  112. package/dist/dist-C04s_fLA.js +0 -563
  113. package/dist/styles-B4tjX5SP.js +0 -5224
  114. package/dist/useMergeTag-DX0XG5V9.js +0 -34
  115. /package/dist/{clock-ik2pRJKG.js → clock-Ba4p3rJM.js} +0 -0
  116. /package/dist/{readableTextColor-DVuzNX1y.js → readableTextColor-C_9OpzBw.js} +0 -0
@@ -1,19 +1,25 @@
1
- import { At as e, C as t, Ft as n, M as r, N as i, P as a, T as o, U as s, W as c, _ as l, b as u, et as d, f, g as p, h as m, j as ee, jt as h, l as g, m as _, n as v, st as y, t as te, v as b, x } from "./vue.runtime.esm-bundler-CjauPXjj.js";
2
- import { r as S } from "./timeouts-BSGxjuUF.js";
3
- import { f as ne, r as re } from "./dist-C04s_fLA.js";
4
- import { L as C, S as w, t as ie, z as ae } from "./useEditorCore-wslttMH-.js";
5
- import { w as oe } from "./keys-CvX8D-8C.js";
6
- import { a as se, c as ce, d as le, f as ue, h as de, i as fe, l as pe, m as me, n as he, o as T, p as E, r as D, s as O, t as k, u as A } from "./styles-B4tjX5SP.js";
7
- import { t as j } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
1
+ import { At as e, C as t, Ft as n, M as r, N as i, P as a, T as o, U as s, W as c, _ as l, b as ee, et as u, f as te, g as d, h as f, j as ne, jt as p, l as m, m as h, n as g, st as _, t as re, v, x as y, y as ie } from "./vue.runtime.esm-bundler-CjauPXjj.js";
2
+ import { r as b } from "./timeouts-BSGxjuUF.js";
3
+ import { f as ae, r as x } from "./dist-C2grMquk.js";
4
+ import { B as oe, C as S, R as C, t as se } from "./useEditorCore-CtNAo0uy.js";
5
+ import { w } from "./keys-CvX8D-8C.js";
6
+ import { _ as T, a as ce, c as le, d as ue, f as de, g as fe, h as E, i as pe, l as me, m as D, n as he, o as O, p as k, r as A, s as j, t as M, u as N } from "./styles-BMFMtR9R.js";
7
+ import { t as P } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
8
8
  //#region src/Editor.vue?vue&type=script&setup=true&lang.ts
9
- var M = ["data-tpl-theme"], N = {
9
+ var F = ["data-tpl-theme"], I = {
10
10
  class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4 tpl:shadow-[var(--tpl-shadow-md)] tpl:border-b tpl:border-[var(--tpl-border)]",
11
11
  style: {
12
12
  "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
13
13
  "backdrop-filter": "blur(12px)",
14
14
  "-webkit-backdrop-filter": "blur(12px)"
15
15
  }
16
- }, P = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, F = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, I = { class: "tpl:flex tpl:justify-center tpl:p-8" }, L = ["aria-label"], R = /* @__PURE__ */ j(/* @__PURE__ */ t({
16
+ }, L = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, R = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, ge = {
17
+ key: 0,
18
+ class: "tpl:flex tpl:w-full tpl:flex-col tpl:gap-3 tpl:px-4 tpl:pt-4 tpl:pb-6"
19
+ }, _e = { class: "tpl-popup-browser-frame tpl:flex tpl:min-h-[calc(100vh-11rem)] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-xl tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-xl)]" }, ve = {
20
+ key: 1,
21
+ class: "tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3 tpl:p-8"
22
+ }, ye = ["aria-label"], z = /* @__PURE__ */ P(/* @__PURE__ */ t({
17
23
  __name: "Editor",
18
24
  props: {
19
25
  config: {},
@@ -21,109 +27,118 @@ var M = ["data-tpl-theme"], N = {
21
27
  fontsManager: {}
22
28
  },
23
29
  setup(t, { expose: o }) {
24
- let v = d(null), S = t, w = ae({
25
- content: S.config.content,
26
- templateDefaults: S.config.templateDefaults
27
- }), T = ie({
28
- editor: w,
30
+ let g = u(null), b = t, S = oe({
31
+ content: b.config.content,
32
+ templateDefaults: b.config.templateDefaults
33
+ }), O = se({
34
+ editor: S,
29
35
  config: {
30
- uiTheme: S.config.uiTheme,
31
- theme: S.config.theme,
32
- blockDefaults: S.config.blockDefaults,
33
- customBlocks: S.config.customBlocks,
34
- mergeTags: S.config.mergeTags,
35
- displayConditions: S.config.displayConditions,
36
- onRequestMedia: S.config.onRequestMedia,
37
- editorType: S.config.editorType,
38
- accessibility: me(S.config),
39
- onSave: S.config.onSave ? () => S.config.onSave(JSON.parse(JSON.stringify(w.state.content))) : void 0
36
+ uiTheme: b.config.uiTheme,
37
+ theme: b.config.theme,
38
+ blockDefaults: b.config.blockDefaults,
39
+ customBlocks: b.config.customBlocks,
40
+ mergeTags: b.config.mergeTags,
41
+ displayConditions: b.config.displayConditions,
42
+ onRequestMedia: b.config.onRequestMedia,
43
+ editorType: b.config.editorType,
44
+ accessibility: fe(b.config),
45
+ onSave: b.config.onSave ? () => b.config.onSave(JSON.parse(JSON.stringify(S.state.content))) : void 0
40
46
  },
41
- translations: S.translations,
42
- fontsManager: S.fontsManager,
43
- autoSaveOptions: S.config.onChange ? { onChange: () => S.config.onChange(JSON.parse(JSON.stringify(w.state.content))) } : null
47
+ translations: b.translations,
48
+ fontsManager: b.fontsManager,
49
+ autoSaveOptions: b.config.onChange ? { onChange: () => b.config.onChange(JSON.parse(JSON.stringify(S.state.content))) } : null
44
50
  });
45
- ee(async () => {
46
- if (await S.fontsManager.loadCustomFonts(), C(S.config.editorType) === "popup" && !w.content.value.settings.popup) {
47
- let e = ne();
48
- w.updateSettings({
51
+ ne(async () => {
52
+ if (await b.fontsManager.loadCustomFonts(), C(b.config.editorType) === "popup" && !S.content.value.settings.popup) {
53
+ let e = ae();
54
+ S.updateSettings({
49
55
  popup: e,
50
- width: re[e.design.sizePreset]
56
+ width: x[e.design.sizePreset]
51
57
  });
52
58
  }
53
59
  }), r(() => {
54
- S.fontsManager.cleanupFontLinks(), T.destroy();
60
+ b.fontsManager.cleanupFontLinks(), O.destroy();
55
61
  });
56
- let j = d("blocks");
57
- a(oe, j);
58
- let R = _(() => C(S.config.editorType) === "popup"), z = _(() => R.value && j.value === "displayRules"), B = _(() => R.value && j.value === "schedule"), V = _(() => j.value === "design"), H = _(() => R.value && (z.value || B.value || V.value)), U = _(() => {
59
- if (w.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
60
- if (!R.value) return ["tpl:left-12", "tpl:right-[320px]"];
62
+ let P = u("blocks");
63
+ a(w, P);
64
+ let z = h(() => C(b.config.editorType) === "popup"), B = h(() => z.value && P.value === "displayRules"), V = h(() => z.value && P.value === "schedule"), H = h(() => P.value === "design"), U = h(() => z.value && (B.value || V.value || H.value)), W = h(() => {
65
+ if (S.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
66
+ if (!z.value) return ["tpl:left-12", "tpl:right-[320px]"];
61
67
  let e;
62
- e = j.value === "blocks" ? "tpl:left-[272px]" : V.value ? "tpl:left-[392px]" : "tpl:left-[72px]";
63
- let t = H.value ? "tpl:right-0" : "tpl:right-[320px]";
68
+ e = P.value === "blocks" ? "tpl:left-[272px]" : H.value ? "tpl:left-[392px]" : "tpl:left-[72px]";
69
+ let t = U.value ? "tpl:right-0" : "tpl:right-[320px]";
64
70
  return [e, t];
65
- }), W = _(() => z.value || B.value);
71
+ }), G = h(() => B.value || V.value);
66
72
  return o({
67
- getContent: () => w.content.value,
68
- setContent: (e) => w.setContent(e),
69
- setTheme: (e) => w.setUiTheme(e),
70
- renderCustomBlock: T.registry.renderCustomBlock,
71
- startTour: (e) => v.value?.start(e),
72
- dismissTour: () => v.value?.dismiss(),
73
- resetTourDismissed: () => fe(S.config.tour),
74
- isTourDismissed: () => S.config.tour ? se(S.config.tour) : !0
75
- }), (r, a) => (i(), b("div", {
76
- class: e(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": y(w).state.darkMode }]),
77
- "data-tpl-theme": y(T).resolvedTheme.value,
78
- style: h(y(T).themeStyles.value)
73
+ getContent: () => S.content.value,
74
+ setContent: (e) => S.setContent(e),
75
+ setTheme: (e) => S.setUiTheme(e),
76
+ undo: () => O.history.undo(),
77
+ redo: () => O.history.redo(),
78
+ canUndo: () => O.history.canUndo.value,
79
+ canRedo: () => O.history.canRedo.value,
80
+ renderCustomBlock: O.registry.renderCustomBlock,
81
+ startTour: (e) => g.value?.start(e),
82
+ dismissTour: () => g.value?.dismiss(),
83
+ resetTourDismissed: () => pe(b.config.tour),
84
+ isTourDismissed: () => b.config.tour ? ce(b.config.tour) : !0
85
+ }), (r, a) => (i(), v("div", {
86
+ class: e(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": _(S).state.darkMode }]),
87
+ "data-tpl-theme": _(O).resolvedTheme.value,
88
+ style: p(_(O).themeStyles.value)
79
89
  }, [
80
- m("header", N, [
81
- a[5] ||= m("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
82
- m("div", P, [
83
- x(A, {
84
- viewport: y(w).state.viewport,
85
- onChange: y(w).setViewport
90
+ f("header", I, [
91
+ a[5] ||= f("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
92
+ f("div", L, [
93
+ y(ue),
94
+ y(N, {
95
+ viewport: _(S).state.viewport,
96
+ onChange: _(S).setViewport
86
97
  }, null, 8, ["viewport", "onChange"]),
87
- x(ce, {
88
- "dark-mode": y(w).state.darkMode,
89
- onChange: y(w).setDarkMode
98
+ y(le, {
99
+ "dark-mode": _(S).state.darkMode,
100
+ onChange: _(S).setDarkMode
90
101
  }, null, 8, ["dark-mode", "onChange"]),
91
- x(pe, {
92
- "preview-mode": y(w).state.previewMode,
93
- onChange: y(w).setPreviewMode
102
+ y(me, {
103
+ "preview-mode": _(S).state.previewMode,
104
+ onChange: _(S).setPreviewMode
94
105
  }, null, 8, ["preview-mode", "onChange"])
95
106
  ]),
96
- a[6] ||= m("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
107
+ a[6] ||= f("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
97
108
  ]),
98
- c(x(ue, null, null, 512), [[g, !y(w).state.previewMode]]),
99
- m("div", {
100
- class: e(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...U.value, "tpl:top-14"]]),
101
- style: h({
109
+ c(y(k, null, null, 512), [[m, !_(S).state.previewMode]]),
110
+ f("div", {
111
+ class: e(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...W.value, "tpl:top-14"]]),
112
+ style: p({
102
113
  transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
103
- backgroundColor: W.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
114
+ backgroundColor: G.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
104
115
  })
105
- }, [R.value && j.value === "displayRules" ? (i(), p(he, { key: 0 })) : R.value && j.value === "schedule" ? (i(), p(k, {
116
+ }, [z.value && P.value === "displayRules" ? (i(), d(he, { key: 0 })) : z.value && P.value === "schedule" ? (i(), d(M, {
106
117
  key: 1,
107
118
  layout: "standalone"
108
- })) : (i(), b(f, { key: 2 }, [m("div", F, [x(te, { name: "tpl-restore-btn" }, {
109
- default: s(() => [y(T).conditionPreview.hasHiddenBlocks.value ? (i(), b("button", {
119
+ })) : (i(), v(te, { key: 2 }, [f("div", R, [y(re, { name: "tpl-restore-btn" }, {
120
+ default: s(() => [_(O).conditionPreview.hasHiddenBlocks.value ? (i(), v("button", {
110
121
  key: 0,
111
122
  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 tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)] tpl:border-[var(--tpl-warning)]",
112
123
  style: { "backdrop-filter": "blur(8px)" },
113
- onClick: a[0] ||= (e) => y(T).conditionPreview.reset()
114
- }, [x(y(de), {
124
+ onClick: a[0] ||= (e) => _(O).conditionPreview.reset()
125
+ }, [y(_(T), {
115
126
  size: 13,
116
127
  "stroke-width": 2
117
- }), u(" " + n(y(T).t.blockSettings.restoreHiddenBlocks), 1)])) : l("", !0)]),
128
+ }), ee(" " + n(_(O).t.blockSettings.restoreHiddenBlocks), 1)])) : l("", !0)]),
118
129
  _: 1
119
- })]), m("div", I, [x(E, {
120
- viewport: y(w).state.viewport,
121
- content: y(w).content.value,
122
- "selected-block-id": y(w).state.selectedBlockId,
123
- "dark-mode": y(w).state.darkMode,
124
- "preview-mode": y(w).state.previewMode,
130
+ })]), z.value ? (i(), v("div", ge, [y(D, {
131
+ "preview-mode": _(S).state.previewMode,
132
+ "multi-page-canvas": t.config.multiPageCanvas ?? !1
133
+ }, null, 8, ["preview-mode", "multi-page-canvas"]), f("div", _e, [a[7] ||= ie("<div class=\"tpl-popup-browser-bar tpl:relative tpl:flex tpl:h-9 tpl:items-center tpl:gap-1.5 tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:px-3\" aria-hidden=\"true\" data-v-186f5453><span class=\"tpl:block tpl:size-3 tpl:rounded-full\" style=\"background-color:#ff5f57;\" data-v-186f5453></span><span class=\"tpl:block tpl:size-3 tpl:rounded-full\" style=\"background-color:#febc2e;\" data-v-186f5453></span><span class=\"tpl:block tpl:size-3 tpl:rounded-full\" style=\"background-color:#28c840;\" data-v-186f5453></span><div class=\"tpl:pointer-events-none tpl:absolute tpl:left-1/2 tpl:top-1/2 tpl:-translate-x-1/2 tpl:-translate-y-1/2 tpl:rounded-md tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-0.5 tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:tracking-tight\" data-v-186f5453> yourstore.com </div></div>", 1), y(E, {
134
+ class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col",
135
+ viewport: _(S).state.viewport,
136
+ content: _(S).content.value,
137
+ "selected-block-id": _(S).state.selectedBlockId,
138
+ "dark-mode": _(S).state.darkMode,
139
+ "preview-mode": _(S).state.previewMode,
125
140
  "multi-page-canvas": t.config.multiPageCanvas ?? !1,
126
- onSelectBlock: y(w).selectBlock
141
+ onSelectBlock: _(S).selectBlock
127
142
  }, null, 8, [
128
143
  "viewport",
129
144
  "content",
@@ -132,68 +147,87 @@ var M = ["data-tpl-theme"], N = {
132
147
  "preview-mode",
133
148
  "multi-page-canvas",
134
149
  "onSelectBlock"
135
- ])])], 64))], 6),
136
- t.config.branding === !1 ? l("", !0) : (i(), p(O, {
150
+ ])])])) : (i(), v("div", ve, [y(D, {
151
+ "preview-mode": _(S).state.previewMode,
152
+ "multi-page-canvas": t.config.multiPageCanvas ?? !1
153
+ }, null, 8, ["preview-mode", "multi-page-canvas"]), y(E, {
154
+ viewport: _(S).state.viewport,
155
+ content: _(S).content.value,
156
+ "selected-block-id": _(S).state.selectedBlockId,
157
+ "dark-mode": _(S).state.darkMode,
158
+ "preview-mode": _(S).state.previewMode,
159
+ "multi-page-canvas": t.config.multiPageCanvas ?? !1,
160
+ onSelectBlock: _(S).selectBlock
161
+ }, null, 8, [
162
+ "viewport",
163
+ "content",
164
+ "selected-block-id",
165
+ "dark-mode",
166
+ "preview-mode",
167
+ "multi-page-canvas",
168
+ "onSelectBlock"
169
+ ])]))], 64))], 6),
170
+ t.config.branding === !1 ? l("", !0) : (i(), d(j, {
137
171
  key: 0,
138
- "position-class": U.value
172
+ "position-class": W.value
139
173
  }, null, 8, ["position-class"])),
140
- m("div", {
174
+ f("div", {
141
175
  class: "tpl-sr-only",
142
176
  role: "status",
143
177
  "aria-live": "polite",
144
178
  "aria-atomic": "true",
145
- "aria-label": y(T).t.landmarks.reorderAnnouncements
146
- }, n(y(T).keyboardReorder.announcement.value), 9, L),
147
- c(x(le, {
148
- "selected-block": y(w).selectedBlock.value,
149
- settings: y(w).content.value.settings,
150
- onUpdateBlock: a[1] ||= (e) => y(w).updateBlock(y(w).state.selectedBlockId, e),
179
+ "aria-label": _(O).t.landmarks.reorderAnnouncements
180
+ }, n(_(O).keyboardReorder.announcement.value), 9, ye),
181
+ c(y(de, {
182
+ "selected-block": _(S).selectedBlock.value,
183
+ settings: _(S).content.value.settings,
184
+ onUpdateBlock: a[1] ||= (e) => _(S).updateBlock(_(S).state.selectedBlockId, e),
151
185
  onDeleteBlock: a[2] ||= () => {
152
- y(w).state.selectedBlockId && y(T).blockActions.deleteBlock(y(w).state.selectedBlockId);
186
+ _(S).state.selectedBlockId && _(O).blockActions.deleteBlock(_(S).state.selectedBlockId);
153
187
  },
154
188
  onDuplicateBlock: a[3] ||= () => {
155
- y(w).selectedBlock.value && y(T).blockActions.duplicateBlock(y(w).selectedBlock.value);
189
+ _(S).selectedBlock.value && _(O).blockActions.duplicateBlock(_(S).selectedBlock.value);
156
190
  },
157
- onUpdateSettings: a[4] ||= (e) => y(w).updateSettings(e)
158
- }, null, 8, ["selected-block", "settings"]), [[g, !y(w).state.previewMode && !H.value]]),
159
- t.config.tour ? (i(), p(D, {
191
+ onUpdateSettings: a[4] ||= (e) => _(S).updateSettings(e)
192
+ }, null, 8, ["selected-block", "settings"]), [[m, !_(S).state.previewMode && !U.value]]),
193
+ t.config.tour ? (i(), d(A, {
160
194
  key: 1,
161
195
  ref_key: "editorTourRef",
162
- ref: v,
196
+ ref: g,
163
197
  "tour-config": t.config.tour,
164
- "dark-mode": y(w).state.darkMode
198
+ "dark-mode": _(S).state.darkMode
165
199
  }, null, 8, ["tour-config", "dark-mode"])) : l("", !0)
166
- ], 14, M));
200
+ ], 14, F));
167
201
  }
168
- }), [["__scopeId", "data-v-8467ac4c"]]), z = /* @__PURE__ */ Object.assign({
169
- "./locales/de.ts": () => import("./de-DWcgp-7T.js"),
170
- "./locales/en.ts": () => import("./en-Cxd4fhNm.js")
171
- }), B = /* @__PURE__ */ Object.assign({
202
+ }), [["__scopeId", "data-v-186f5453"]]), B = /* @__PURE__ */ Object.assign({
203
+ "./locales/de.ts": () => import("./de-C74F9xK3.js"),
204
+ "./locales/en.ts": () => import("./en-B24jVTeO.js")
205
+ }), V = /* @__PURE__ */ Object.assign({
172
206
  "./locales/cloud/de.ts": () => import("./de-GOtR9DwW.js"),
173
207
  "./locales/cloud/en.ts": () => import("./en-dFFQVzNn.js")
174
208
  });
175
- function V(e) {
209
+ function H(e) {
176
210
  return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
177
211
  }
178
- var H = V(z), U = V(B);
179
- function W(e) {
212
+ var U = H(B), W = H(V);
213
+ function G(e) {
180
214
  return e.split("-")[0].toLowerCase();
181
215
  }
182
- function G(e, t) {
183
- let n = W(e);
216
+ function K(e, t) {
217
+ let n = G(e);
184
218
  return t.includes(n) ? n : "en";
185
219
  }
186
- async function K(e) {
187
- let t = z[`./locales/${G(e, H)}.ts`];
220
+ async function q(e) {
221
+ let t = B[`./locales/${K(e, U)}.ts`];
188
222
  return (await t()).default;
189
223
  }
190
- async function ge(e) {
191
- let t = B[`./locales/cloud/${G(e, U)}.ts`];
224
+ async function be(e) {
225
+ let t = V[`./locales/cloud/${K(e, W)}.ts`];
192
226
  return (await t()).default;
193
227
  }
194
228
  //#endregion
195
229
  //#region src/utils/toMjml.ts
196
- async function _e(e) {
230
+ async function xe(e) {
197
231
  let t;
198
232
  try {
199
233
  t = await import("@aswin.dev/renderer");
@@ -204,59 +238,71 @@ async function _e(e) {
204
238
  }
205
239
  //#endregion
206
240
  //#region src/index.ts
207
- var q = null, J = d(null);
208
- async function Y(e) {
241
+ var J = null, Y = u(null);
242
+ async function Se(e) {
209
243
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
210
244
  if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
211
- let n = await K(e.locale ?? "en"), r = w(e.fonts);
212
- q && Q(), q = v({ setup() {
213
- return () => o(R, {
245
+ let n = await q(e.locale ?? "en"), r = S(e.fonts);
246
+ J && Q(), J = g({ setup() {
247
+ return () => o(z, {
214
248
  config: e,
215
249
  translations: n,
216
250
  fontsManager: r,
217
- ref: J
251
+ ref: Y
218
252
  });
219
- } }), q.mount(t);
253
+ } }), J.mount(t);
220
254
  let i = {
221
255
  getContent() {
222
- return J.value ? JSON.parse(JSON.stringify(J.value.getContent())) : JSON.parse(JSON.stringify(e.content));
256
+ return Y.value ? JSON.parse(JSON.stringify(Y.value.getContent())) : JSON.parse(JSON.stringify(e.content));
223
257
  },
224
258
  setContent(t) {
225
- J.value && J.value.setContent(t), e.content = t;
259
+ Y.value && Y.value.setContent(t), e.content = t;
226
260
  },
227
261
  setTheme(e) {
228
- J.value && J.value.setTheme(e);
262
+ Y.value && Y.value.setTheme(e);
229
263
  },
230
264
  unmount: Q,
231
265
  startTour(e) {
232
- J.value?.startTour?.(e);
266
+ Y.value?.startTour?.(e);
233
267
  },
234
268
  dismissTour() {
235
- J.value?.dismissTour?.();
269
+ Y.value?.dismissTour?.();
236
270
  },
237
271
  resetTourDismissed() {
238
- J.value?.resetTourDismissed?.();
272
+ Y.value?.resetTourDismissed?.();
239
273
  },
240
274
  isTourDismissed() {
241
- return J.value?.isTourDismissed?.() ?? !0;
275
+ return Y.value?.isTourDismissed?.() ?? !0;
276
+ },
277
+ undo() {
278
+ Y.value?.undo?.();
279
+ },
280
+ redo() {
281
+ Y.value?.redo?.();
282
+ },
283
+ canUndo() {
284
+ return Y.value?.canUndo?.() ?? !1;
285
+ },
286
+ canRedo() {
287
+ return Y.value?.canRedo?.() ?? !1;
242
288
  },
243
289
  renderCustomBlock(e) {
244
- return J.value ? J.value.renderCustomBlock(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
290
+ return Y.value ? Y.value.renderCustomBlock(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
245
291
  },
246
- toMjml: () => _e(i)
292
+ toMjml: () => xe(i)
247
293
  };
248
294
  return i;
249
295
  }
250
- var X = null, Z = d(null);
251
- async function ve(e) {
296
+ var X = null, Z = u(null);
297
+ async function Ce(e) {
252
298
  let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
253
299
  if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
254
- let { default: n } = await import("./CloudEditor-CFldoCOb.js"), [r, i] = await Promise.all([K(e.locale ?? "en"), ge(e.locale ?? "en")]), a = w(e.fonts);
300
+ let { default: n } = await import("./CloudEditor-CnUX0IOW.js"), [r, i] = await Promise.all([q(e.locale ?? "en"), be(e.locale ?? "en")]), a = S(e.fonts);
255
301
  return X && $(), await new Promise((s, c) => {
256
302
  let l = setTimeout(() => {
257
303
  c(/* @__PURE__ */ Error("[Templatical] Cloud editor initialization timed out"));
258
- }, S);
259
- X = v({ setup() {
304
+ }, b);
305
+ X = g({ setup() {
260
306
  return () => o(n, {
261
307
  config: e,
262
308
  translations: r,
@@ -291,6 +337,18 @@ async function ve(e) {
291
337
  isTourDismissed() {
292
338
  return Z.value?.isTourDismissed?.() ?? !0;
293
339
  },
340
+ undo() {
341
+ Z.value?.undo?.();
342
+ },
343
+ redo() {
344
+ Z.value?.redo?.();
345
+ },
346
+ canUndo() {
347
+ return Z.value?.canUndo?.() ?? !1;
348
+ },
349
+ canRedo() {
350
+ return Z.value?.canRedo?.() ?? !1;
351
+ },
294
352
  create(e) {
295
353
  return Z.value ? Z.value.create(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Cloud editor not ready"));
296
354
  },
@@ -303,10 +361,10 @@ async function ve(e) {
303
361
  };
304
362
  }
305
363
  function Q() {
306
- q && (q.unmount(), q = null, J.value = null);
364
+ J && (J.unmount(), J = null, Y.value = null);
307
365
  }
308
366
  function $() {
309
367
  X && (X.unmount(), X = null, Z.value = null);
310
368
  }
311
369
  //#endregion
312
- export { T as DEFAULT_EDITOR_TOUR_STORAGE_KEY, Y as init, ve as initCloud, Q as unmount, w as useFonts };
370
+ export { O as DEFAULT_EDITOR_TOUR_STORAGE_KEY, Se as init, Ce as initCloud, Q as unmount, S as useFonts };
@@ -0,0 +1,16 @@
1
+ import { t as e } from "./createLucideIcon-ClREiSx3.js";
2
+ var t = e("redo-2", [["path", {
3
+ d: "m15 14 5-5-5-5",
4
+ key: "12vg1m"
5
+ }], ["path", {
6
+ d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
7
+ key: "6uklza"
8
+ }]]), n = e("undo-2", [["path", {
9
+ d: "M9 14 4 9l5-5",
10
+ key: "102s5s"
11
+ }], ["path", {
12
+ d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",
13
+ key: "f3b9sd"
14
+ }]]);
15
+ //#endregion
16
+ export { t as n, n as t };