@templatical/editor 0.13.0 → 0.15.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 (178) hide show
  1. package/dist/{AiChatSidebar-B0-U5-sb.js → AiChatSidebar-BIKvYREk.js} +57 -56
  2. package/dist/{AiFeatureMenu-DxDwLS8B.js → AiFeatureMenu-QbD82crt.js} +23 -23
  3. package/dist/{BlockIssueBadge-C-EPqWsh.js → BlockIssueBadge-B3xVgMTh.js} +11 -11
  4. package/dist/CloudEditor-DptuSf7A.js +1234 -0
  5. package/dist/{CollaboratorBar-DgwjisX2.js → CollaboratorBar-DrA_K69w.js} +20 -20
  6. package/dist/{CommentsSidebar-CpRLN40c.js → CommentsSidebar-D_tSGvTX.js} +158 -157
  7. package/dist/CountdownBlock-apiYUhkQ.js +92 -0
  8. package/dist/CountdownToolbar-CS0axcjz.js +210 -0
  9. package/dist/{DesignReferenceSidebar-BgPDbOsl.js → DesignReferenceSidebar-DWYK9nTk.js} +58 -57
  10. package/dist/{IssuesPanel-I0z6k6-H.js → IssuesPanel-CR1MPaDE.js} +40 -40
  11. package/dist/{LoadingTrack-C7mGWPHS.js → LoadingTrack-DsecR8Rw.js} +1 -1
  12. package/dist/MergeTagSuggestion-CH2SUxBo.js +1327 -0
  13. package/dist/ModuleBrowserModal-D45rBj5C.js +202 -0
  14. package/dist/{ModulePreviewCanvas-Dni9kK4j.js → ModulePreviewCanvas-BiQ6B2-l.js} +29 -29
  15. package/dist/{NumberWithSuffix-D3fdj0iO.js → NumberWithSuffix-CrA6quxx.js} +143 -142
  16. package/dist/ParagraphEditor-1NaUJpZO.js +721 -0
  17. package/dist/{RichTextEditorContent-Q5altsx1.js → RichTextEditorContent-BqLHIZY7.js} +45 -44
  18. package/dist/{SaveModuleDialog-C38VqN2T.js → SaveModuleDialog-B0sPOTgO.js} +38 -37
  19. package/dist/{SnapshotHistory-ByloTpwh.js → SnapshotHistory-DslVzmSb.js} +34 -33
  20. package/dist/{TemplateScoringPanel-CUxiPtEf.js → TemplateScoringPanel-CZ62rGHz.js} +83 -82
  21. package/dist/{TestEmailModal-BvZBMBad.js → TestEmailModal-DWGniJVu.js} +22 -21
  22. package/dist/TitleEditor-D4t_gZZJ.js +193 -0
  23. package/dist/{TplModal-BYb-X5Bj.js → TplModal-Br2VG6cn.js} +14 -13
  24. package/dist/{blockTypeIcons-CyAom3iI.js → blockTypeIcons-CXhCS5WV.js} +5 -5
  25. package/dist/bundle-stats.json +8 -8
  26. package/dist/cdn/chunks/{AiFeatureMenu-BSoy-SoF.js → AiFeatureMenu-3Slo_LGA.js} +8 -8
  27. package/dist/cdn/chunks/{AiFeatureMenu-BSoy-SoF.js.map → AiFeatureMenu-3Slo_LGA.js.map} +1 -1
  28. package/dist/cdn/chunks/{BlockIssueBadge-BQDUuJxy.js → BlockIssueBadge-BxwEiiF3.js} +5 -5
  29. package/dist/cdn/chunks/{BlockIssueBadge-BQDUuJxy.js.map → BlockIssueBadge-BxwEiiF3.js.map} +1 -1
  30. package/dist/cdn/chunks/{CloudEditor-BZuzsQOZ.js → CloudEditor-DFIFWD9G.js} +163 -161
  31. package/dist/cdn/chunks/CloudEditor-DFIFWD9G.js.map +1 -0
  32. package/dist/cdn/chunks/{CollaboratorBar-DUpSrtDr.js → CollaboratorBar-Cu3vuN66.js} +4 -4
  33. package/dist/cdn/chunks/{CollaboratorBar-DUpSrtDr.js.map → CollaboratorBar-Cu3vuN66.js.map} +1 -1
  34. package/dist/cdn/chunks/{CountdownBlock-DChGTAsH.js → CountdownBlock-BEVAJQtQ.js} +3 -3
  35. package/dist/cdn/chunks/{CountdownBlock-DChGTAsH.js.map → CountdownBlock-BEVAJQtQ.js.map} +1 -1
  36. package/dist/cdn/chunks/{CountdownToolbar-C6gX2SJr.js → CountdownToolbar-CI2sQZv5.js} +4 -4
  37. package/dist/cdn/chunks/{CountdownToolbar-C6gX2SJr.js.map → CountdownToolbar-CI2sQZv5.js.map} +1 -1
  38. package/dist/cdn/chunks/{IssuesPanel-Bo1uhdSe.js → IssuesPanel-BdeDoTcn.js} +11 -11
  39. package/dist/cdn/chunks/{IssuesPanel-Bo1uhdSe.js.map → IssuesPanel-BdeDoTcn.js.map} +1 -1
  40. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js +213 -0
  41. package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js.map +1 -0
  42. package/dist/cdn/chunks/{ModuleBrowserModal-a-tZRCcD.js → ModuleBrowserModal-Dz-I5zfj.js} +11 -8
  43. package/dist/cdn/chunks/{ModuleBrowserModal-a-tZRCcD.js.map → ModuleBrowserModal-Dz-I5zfj.js.map} +1 -1
  44. package/dist/cdn/chunks/{ModulePreviewCanvas-Bm6k0Op0.js → ModulePreviewCanvas-BfinyuAN.js} +21 -21
  45. package/dist/cdn/chunks/{ModulePreviewCanvas-Bm6k0Op0.js.map → ModulePreviewCanvas-BfinyuAN.js.map} +1 -1
  46. package/dist/cdn/chunks/{NumberWithSuffix-HTbuD3VJ.js → NumberWithSuffix-CDjEa08X.js} +4 -4
  47. package/dist/cdn/chunks/{NumberWithSuffix-HTbuD3VJ.js.map → NumberWithSuffix-CDjEa08X.js.map} +1 -1
  48. package/dist/cdn/chunks/{ParagraphEditor-pGrfSccu.js → ParagraphEditor-B3fG0vge.js} +130 -110
  49. package/dist/cdn/chunks/ParagraphEditor-B3fG0vge.js.map +1 -0
  50. package/dist/cdn/chunks/{RichTextEditorContent-D7XZix_1.js → RichTextEditorContent-C6YPCp9j.js} +4 -4
  51. package/dist/cdn/chunks/{RichTextEditorContent-D7XZix_1.js.map → RichTextEditorContent-C6YPCp9j.js.map} +1 -1
  52. package/dist/cdn/chunks/{SaveModuleDialog-C9PQ9x6j.js → SaveModuleDialog-C6UIIVAM.js} +6 -6
  53. package/dist/cdn/chunks/{SaveModuleDialog-C9PQ9x6j.js.map → SaveModuleDialog-C6UIIVAM.js.map} +1 -1
  54. package/dist/cdn/chunks/{TitleEditor-BvFbL16O.js → TitleEditor-BiZbLYF1.js} +62 -46
  55. package/dist/cdn/chunks/TitleEditor-BiZbLYF1.js.map +1 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BernVG06.js +22 -0
  57. package/dist/cdn/chunks/{blockTypeIcons-Kd1MT0u8.js.map → blockTypeIcons-BernVG06.js.map} +1 -1
  58. package/dist/{de-C2wOXoxs.js → cdn/chunks/de-LsV0u1tP.js} +19 -1
  59. package/dist/cdn/chunks/de-LsV0u1tP.js.map +1 -0
  60. package/dist/cdn/chunks/{draggable-Bci-fq8y.js → draggable-kG-D5Xsm.js} +19 -10
  61. package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +1 -0
  62. package/dist/cdn/chunks/{en-dR7zfNC3.js → en-Bb8X1bOs.js} +18 -2
  63. package/dist/cdn/chunks/en-Bb8X1bOs.js.map +1 -0
  64. package/dist/cdn/chunks/extensions-Drp8UDc6.js +421 -0
  65. package/dist/cdn/chunks/extensions-Drp8UDc6.js.map +1 -0
  66. package/dist/cdn/chunks/{features-DU6lA8l1.js → features-Dpczf9Su.js} +1171 -994
  67. package/dist/cdn/chunks/features-Dpczf9Su.js.map +1 -0
  68. package/dist/cdn/chunks/{icons-BjHUZZyJ.js → icons-CuxnJiGQ.js} +170 -164
  69. package/dist/cdn/chunks/icons-CuxnJiGQ.js.map +1 -0
  70. package/dist/cdn/chunks/{liquid.browser-DKKBzRQu.js → liquid.browser-BJOEu6Cg.js} +693 -678
  71. package/dist/cdn/chunks/liquid.browser-BJOEu6Cg.js.map +1 -0
  72. package/dist/cdn/chunks/{media-library-Byelliig.js → media-library-CiYl_BO7.js} +556 -554
  73. package/dist/cdn/chunks/{media-library-Byelliig.js.map → media-library-CiYl_BO7.js.map} +1 -1
  74. package/dist/cdn/chunks/{pt-BR-BZ86xqK6.js → pt-BR-BwJY_cvb.js} +18 -2
  75. package/dist/cdn/chunks/pt-BR-BwJY_cvb.js.map +1 -0
  76. package/dist/cdn/chunks/{pusher-BICWUP2j.js → pusher-CIwiKF8H.js} +9 -6
  77. package/dist/cdn/chunks/{pusher-BICWUP2j.js.map → pusher-CIwiKF8H.js.map} +1 -1
  78. package/dist/cdn/chunks/quality-CNjGxBG0.js +2176 -0
  79. package/dist/cdn/chunks/{quality-DNnYAntR.js.map → quality-CNjGxBG0.js.map} +1 -1
  80. package/dist/cdn/chunks/{renderer-CZKO-Tav.js → renderer-CFkg8h-K.js} +40 -31
  81. package/dist/cdn/chunks/renderer-CFkg8h-K.js.map +1 -0
  82. package/dist/cdn/chunks/{src-DsqSXXjk.js → src-DRpKu4Dy.js} +11 -11
  83. package/dist/cdn/chunks/{src-DsqSXXjk.js.map → src-DRpKu4Dy.js.map} +1 -1
  84. package/dist/cdn/chunks/styles-B7wryV0l.js +3943 -0
  85. package/dist/cdn/chunks/styles-B7wryV0l.js.map +1 -0
  86. package/dist/cdn/chunks/{tiptap-CwScfbsM.js → tiptap-DF9PEiqH.js} +5429 -5373
  87. package/dist/cdn/chunks/tiptap-DF9PEiqH.js.map +1 -0
  88. package/dist/cdn/editor.css +1 -1
  89. package/dist/cdn/editor.js +117 -115
  90. package/dist/cdn/editor.js.map +1 -1
  91. package/dist/{check-BRzXxFHr.js → check-rl7ok6uJ.js} +1 -1
  92. package/dist/{chevron-down-DmEgzmYT.js → chevron-down-BKe__NOD.js} +1 -1
  93. package/dist/{circle-alert-BStvZr3O.js → circle-alert-C8xmpMsK.js} +1 -1
  94. package/dist/{clock-Blwp_1R6.js → clock-BW4JuDCN.js} +1 -1
  95. package/dist/{cloud-_olro76D.js → cloud-BQusL53H.js} +208 -208
  96. package/dist/createLucideIcon-Dx-EjR9r.js +43 -0
  97. package/dist/{cdn/chunks/de-C2wOXoxs.js → de-LsV0u1tP.js} +17 -3
  98. package/dist/{dist-BlG7k25W.js → dist-B5Sov3sS.js} +7 -7
  99. package/dist/dist-BEWiuOMi.js +251 -0
  100. package/dist/{dist-b7Ak-CuM.js → dist-BFmE-7hB.js} +2 -2
  101. package/dist/{dist-o73iaGqy.js → dist-BMoa33wT.js} +2 -2
  102. package/dist/{dist-BctFrpeA.js → dist-BibU4HNl.js} +74 -65
  103. package/dist/{dist-D6x1cQeh.js → dist-BsCGIDSt.js} +103 -102
  104. package/dist/dist-CNLKj9wa.js +5 -0
  105. package/dist/{dist-DULfKmTh.js → dist-CNXDNYQn.js} +729 -695
  106. package/dist/{dist-412xXefB.js → dist-COG3IdPK.js} +3 -3
  107. package/dist/{dist-Cz79qrLL.js → dist-CQZxDvFw.js} +3 -3
  108. package/dist/{dist-BwgjpLfr.js → dist-CRsjOQM-.js} +2 -2
  109. package/dist/dist-CTT6WYJ6.js +134 -0
  110. package/dist/dist-Cqa6aeAJ.js +5 -0
  111. package/dist/{dist-BCQZZUE9.js → dist-SXJJ2v41.js} +2 -2
  112. package/dist/{dist-DhKTdU52.js → dist-itdjZraK.js} +1445 -1420
  113. package/dist/{en-dR7zfNC3.js → en-Bb8X1bOs.js} +17 -1
  114. package/dist/extensions-DwaZAqm6.js +423 -0
  115. package/dist/{image-up-BFPbw_Zq.js → image-up-BwBCmQ4P.js} +1 -1
  116. package/dist/index.d.ts +17 -0
  117. package/dist/{info-B_qLEBN2.js → info-TCn7uWR5.js} +1 -1
  118. package/dist/keys-Cv8-8GsD.js +10 -0
  119. package/dist/{liquid.browser-CVjP5Mex.js → liquid.browser-DZLtv26k.js} +692 -677
  120. package/dist/{list-checks-CGg7JxPm.js → list-checks-CSrOWNgq.js} +1 -1
  121. package/dist/{loader-circle-CDF8eR_Q.js → loader-circle-BLmicnPG.js} +1 -1
  122. package/dist/{message-circle-C3cHsCJl.js → message-circle-C9hHMQCI.js} +1 -1
  123. package/dist/{pt-BR-BZ86xqK6.js → pt-BR-BwJY_cvb.js} +17 -1
  124. package/dist/{refresh-cw-Butml7Q4.js → refresh-cw-D1JQ1LNa.js} +1 -1
  125. package/dist/runtime-dom.esm-bundler-BzuoCyNp.js +523 -0
  126. package/dist/scan-line-DgijVq9y.js +31 -0
  127. package/dist/{send-k7npFJNO.js → send-DjPdq69F.js} +1 -1
  128. package/dist/{shield-check-CV6GbmCu.js → shield-check-Bqluu8FS.js} +1 -1
  129. package/dist/{sparkles-C965Xop4.js → sparkles-M4azPVSP.js} +1 -1
  130. package/dist/style.css +1 -1
  131. package/dist/styles-D7fQ7f_1.js +4164 -0
  132. package/dist/templatical-editor.js +155 -152
  133. package/dist/{text-align-start-Bxnps8fH.js → text-align-start-CMya5pCQ.js} +11 -11
  134. package/dist/{trash-2-DpGb7fIt.js → trash-2-C-81rkLS.js} +1 -1
  135. package/dist/{triangle-alert-BKYElAwz.js → triangle-alert-BuRWnynk.js} +1 -1
  136. package/dist/{upload-BF7sxd1_.js → upload-CWBIoLd4.js} +1 -1
  137. package/dist/{useAliveFlag-BinvbqQR.js → useAliveFlag-CECL_OUb.js} +1 -1
  138. package/dist/{useCloudI18n-L3H2XvdW.js → useCloudI18n-AKCy98qD.js} +2 -2
  139. package/dist/{useEditorCore-DKYZ7aKk.js → useEditorCore-vcWLdnjN.js} +1480 -1310
  140. package/dist/{useI18n-CTs_bP9d.js → useI18n-C-TDeJBt.js} +2 -2
  141. package/dist/{useMergeTag-e3RSY-s3.js → useMergeTag-DSrBY0-2.js} +6 -6
  142. package/dist/usePopoverRoot-DKUDnr55.js +8 -0
  143. package/dist/{vue.runtime.esm-bundler-B2k01iQh.js → vue.runtime.esm-bundler-l0XAqiyv.js} +639 -1151
  144. package/dist/{x-CGjkjdKK.js → x-CQSvXnGR.js} +1 -1
  145. package/package.json +27 -27
  146. package/dist/CloudEditor-DaEfipBn.js +0 -1230
  147. package/dist/CountdownBlock-DO9fziwf.js +0 -92
  148. package/dist/CountdownToolbar-BeII06yJ.js +0 -210
  149. package/dist/ModuleBrowserModal-DsZRr87F.js +0 -198
  150. package/dist/ParagraphEditor-CZ-cmhX3.js +0 -700
  151. package/dist/TitleEditor-DbNOcvhR.js +0 -177
  152. package/dist/cdn/chunks/CloudEditor-BZuzsQOZ.js.map +0 -1
  153. package/dist/cdn/chunks/ParagraphEditor-pGrfSccu.js.map +0 -1
  154. package/dist/cdn/chunks/TitleEditor-BvFbL16O.js.map +0 -1
  155. package/dist/cdn/chunks/blockTypeIcons-Kd1MT0u8.js +0 -22
  156. package/dist/cdn/chunks/de-C2wOXoxs.js.map +0 -1
  157. package/dist/cdn/chunks/draggable-Bci-fq8y.js.map +0 -1
  158. package/dist/cdn/chunks/en-dR7zfNC3.js.map +0 -1
  159. package/dist/cdn/chunks/extensions-CuUjSmuA.js +0 -605
  160. package/dist/cdn/chunks/extensions-CuUjSmuA.js.map +0 -1
  161. package/dist/cdn/chunks/features-DU6lA8l1.js.map +0 -1
  162. package/dist/cdn/chunks/icons-BjHUZZyJ.js.map +0 -1
  163. package/dist/cdn/chunks/liquid.browser-DKKBzRQu.js.map +0 -1
  164. package/dist/cdn/chunks/pt-BR-BZ86xqK6.js.map +0 -1
  165. package/dist/cdn/chunks/quality-DNnYAntR.js +0 -2176
  166. package/dist/cdn/chunks/renderer-CZKO-Tav.js.map +0 -1
  167. package/dist/cdn/chunks/styles-DiAdtiz9.js +0 -3428
  168. package/dist/cdn/chunks/styles-DiAdtiz9.js.map +0 -1
  169. package/dist/cdn/chunks/tiptap-CwScfbsM.js.map +0 -1
  170. package/dist/createLucideIcon-CmPAC-gt.js +0 -43
  171. package/dist/dist-BNEdeWub.js +0 -5
  172. package/dist/dist-Cgry6fNv.js +0 -382
  173. package/dist/dist-u0iIJH3V.js +0 -5
  174. package/dist/extensions-XPlNAKIL.js +0 -1720
  175. package/dist/keys-mFiJ5N0_.js +0 -10
  176. package/dist/scan-line-XYEqim_E.js +0 -25
  177. package/dist/styles-D0RCAWhB.js +0 -3647
  178. package/dist/usePopoverRoot-DVh7NY1q.js +0 -8
@@ -1,1230 +0,0 @@
1
- import { A as e, B as t, L as n, M as r, O as i, Q as a, X as o, _ as s, at as c, b as l, c as u, d, f, g as p, h as m, j as h, k as g, l as _, m as v, o as y, ot as b, p as x, q as S, rt as C, st as w, t as T, v as E, y as D, z as O } from "./vue.runtime.esm-bundler-B2k01iQh.js";
2
- import { t as k } from "./timeouts-Bmi_yePw.js";
3
- import { D as A, a as j } from "./dist-BctFrpeA.js";
4
- import { C as M, F as N, b as P, t as F } from "./useEditorCore-DKYZ7aKk.js";
5
- import { l as I, t as L } from "./dist-Cgry6fNv.js";
6
- import { C as R, D as z, O as ee, c as B, l as te, r as V, s as ne, t as re } from "./keys-mFiJ5N0_.js";
7
- import { t as H } from "./useI18n-CTs_bP9d.js";
8
- import { t as U } from "./createLucideIcon-CmPAC-gt.js";
9
- import { t as W } from "./circle-alert-BStvZr3O.js";
10
- import { t as G } from "./loader-circle-CDF8eR_Q.js";
11
- import { a as K, c as ie, d as q, f as ae, i as J, l as oe, n as se, o as ce, r as le, s as ue, t as de, u as fe } from "./styles-D0RCAWhB.js";
12
- import { t as pe } from "./sparkles-C965Xop4.js";
13
- import { t as me } from "./triangle-alert-BKYElAwz.js";
14
- import { t as he } from "./check-BRzXxFHr.js";
15
- import { t as ge } from "./clock-Blwp_1R6.js";
16
- import { t as Y } from "./message-circle-C3cHsCJl.js";
17
- import { t as X } from "./send-k7npFJNO.js";
18
- import { t as Z } from "./_plugin-vue_export-helper-B3ysoDQm.js";
19
- import { n as Q } from "./useCloudI18n-L3H2XvdW.js";
20
- import { d as $ } from "./styleConstants-lGobwiLH.js";
21
- import { _ as _e, a as ve, c as ye, d as be, f as xe, g as Se, h as Ce, l as we, m as Te, n as Ee, o as De, p as Oe, r as ke, s as Ae, t as je, v as Me, y as Ne } from "./cloud-_olro76D.js";
22
- var Pe = U("save", [
23
- ["path", {
24
- d: "M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",
25
- key: "1c8476"
26
- }],
27
- ["path", {
28
- d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",
29
- key: "1ydtos"
30
- }],
31
- ["path", {
32
- d: "M7 3v4a1 1 0 0 0 1 1h7",
33
- key: "t51u73"
34
- }]
35
- ]);
36
- //#endregion
37
- //#region src/cloud/composables/useSnapshotPreview.ts
38
- function Fe(e) {
39
- let { authManager: t, editor: n, history: r, conditionPreview: i, autoSave: s, onError: c } = e, l = a(null), u = o(null), f = o(null), p = !1;
40
- S(() => {
41
- p = !0;
42
- });
43
- let m = d(() => u.value !== null), h = d(() => l.value?.snapshots.value ?? []), g = d(() => l.value?.isLoading.value ?? !1), _ = d(() => l.value?.isRestoring.value ?? !1);
44
- function v() {
45
- n.state.template?.id && !l.value && (l.value = Se({
46
- authManager: t,
47
- templateId: n.state.template.id,
48
- onRestore: y,
49
- onError: c
50
- }), l.value.loadSnapshots());
51
- }
52
- function y(e) {
53
- n.setContent(e.content, !1), r.clear(), i.reset();
54
- }
55
- async function b(e) {
56
- if (!p) {
57
- if (u.value) {
58
- u.value = e, n.setContent(e.content, !1);
59
- return;
60
- }
61
- n.state.isDirty && n.hasTemplate() && (await n.createSnapshot(), p) || (f.value = structuredClone(n.content.value), s?.pause(), u.value = e, n.setContent(e.content, !1));
62
- }
63
- }
64
- async function x() {
65
- if (!(!u.value || !l.value)) try {
66
- if (await l.value.restoreSnapshot(u.value.id), p || (await l.value.loadSnapshots(), p)) return;
67
- } catch (e) {
68
- throw !p && f.value && n.setContent(f.value, !1), e;
69
- } finally {
70
- p || (u.value = null, f.value = null, s?.resume());
71
- }
72
- }
73
- function C() {
74
- !u.value || !f.value || (n.setContent(f.value, !1), u.value = null, f.value = null, s?.resume());
75
- }
76
- async function w() {
77
- p || l.value && await l.value.loadSnapshots();
78
- }
79
- return {
80
- snapshotHistoryInstance: l,
81
- previewingSnapshot: u,
82
- contentBeforePreview: f,
83
- isPreviewingSnapshot: m,
84
- snapshotHistorySnapshots: h,
85
- snapshotHistoryIsLoading: g,
86
- snapshotHistoryIsRestoring: _,
87
- initSnapshotHistory: v,
88
- handleRestore: y,
89
- handleSnapshotNavigate: b,
90
- confirmRestoreSnapshot: x,
91
- cancelPreview: C,
92
- loadSnapshotHistory: w
93
- };
94
- }
95
- //#endregion
96
- //#region src/cloud/composables/useCloudPanelState.ts
97
- function Ie() {
98
- let e = o(null), t = d({
99
- get: () => e.value === "ai-chat",
100
- set: (t) => e.value = t ? "ai-chat" : null
101
- }), n = d({
102
- get: () => e.value === "scoring",
103
- set: (t) => e.value = t ? "scoring" : null
104
- }), r = d({
105
- get: () => e.value === "design-reference",
106
- set: (t) => e.value = t ? "design-reference" : null
107
- }), i = d({
108
- get: () => e.value === "comments",
109
- set: (t) => e.value = t ? "comments" : null
110
- }), a = o(!1), s = o(!1), c = o(void 0), l = o(!1), u = o(null), f = d(() => e.value !== null), p = d(() => {
111
- let t = e.value;
112
- return t === "ai-chat" || t === "design-reference" || t === "scoring" ? t : null;
113
- }), m = d(() => l.value || e.value === "ai-chat" || e.value === "design-reference" || e.value === "scoring");
114
- function h() {
115
- l.value = !l.value;
116
- }
117
- function g(t) {
118
- l.value = !1, e.value = e.value === t ? null : t;
119
- }
120
- return L(u, () => {
121
- l.value = !1;
122
- }), {
123
- activePanel: e,
124
- aiChatOpen: t,
125
- scoringPanelOpen: n,
126
- designReferenceOpen: r,
127
- commentsOpen: i,
128
- testEmailModalOpen: a,
129
- mediaLibraryOpen: s,
130
- mediaLibraryAccept: c,
131
- aiMenuOpen: l,
132
- aiMenuRef: u,
133
- rightPanelOpen: f,
134
- activeAiFeature: p,
135
- aiButtonActive: m,
136
- toggleAiMenu: h,
137
- handleAiFeatureSelect: g
138
- };
139
- }
140
- //#endregion
141
- //#region src/cloud/composables/useCollabUndoWarning.ts
142
- function Le(e) {
143
- let { isCollaborationEnabled: t, getCollaboratorCount: n, canUndo: r } = e, i = o(!1), a = o(!1), { start: s } = I(() => {
144
- a.value = !1;
145
- }, k, { immediate: !1 });
146
- function c() {
147
- i.value || !t.value || n() === 0 || !r.value || (i.value = !0, a.value = !0, s());
148
- }
149
- return {
150
- collabUndoWarningVisible: a,
151
- showCollabUndoWarning: c
152
- };
153
- }
154
- //#endregion
155
- //#region src/cloud/composables/useCloudFeatureFlags.ts
156
- function Re(e) {
157
- let { planConfigInstance: t, aiConfig: n, editor: r } = e, i = d(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), a = d(() => t.hasFeature("test_email")), s = d(() => !!r.state.template?.id), c = d(() => t.hasFeature("white_label")), l = d(() => t.config.value?.limits.max_templates ?? null), u = d(() => t.config.value?.template_count ?? 0), f = o(!1), p = o("idle"), m = o(""), { start: h } = I(() => {
158
- p.value = "idle";
159
- }, 3e3, { immediate: !1 });
160
- return {
161
- canUseAiGeneration: i,
162
- canSendTestEmail: a,
163
- hasTemplateSaved: s,
164
- isWhiteLabeled: c,
165
- templateLimit: l,
166
- templateCount: u,
167
- isSaveExporting: f,
168
- saveStatus: p,
169
- saveErrorMessage: m,
170
- startSaveStatusClear: h
171
- };
172
- }
173
- //#endregion
174
- //#region src/cloud/composables/useCloudMediaLibrary.ts
175
- function ze(e) {
176
- let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r, authManager: i, getMediaConfig: a, onError: o } = e, s = null;
177
- function c(e) {
178
- return {
179
- url: e.url,
180
- alt: e.alt_text || void 0
181
- };
182
- }
183
- async function l(e) {
184
- let i = e?.accept ?? ["images"];
185
- if (e?.files?.length) {
186
- if (t) {
187
- let n = await t({
188
- accept: i,
189
- files: e.files
190
- });
191
- return n ? c(n) : null;
192
- }
193
- return u(e.files[0]);
194
- }
195
- if (t) {
196
- let e = await t({ accept: i });
197
- return e ? c(e) : null;
198
- }
199
- return s &&= (s(null), null), r.value = i, n.value = !0, new Promise((e) => {
200
- s = (t) => {
201
- e(t);
202
- };
203
- });
204
- }
205
- async function u(e) {
206
- let t = d(e);
207
- if (t) return o?.(t), null;
208
- try {
209
- let { MediaApiClient: t } = await import("@templatical/media-library");
210
- return c(await new t(i).uploadMedia(e));
211
- } catch (e) {
212
- return o?.(e), null;
213
- }
214
- }
215
- function d(e) {
216
- let t = a?.() ?? null;
217
- if (!t) return null;
218
- let n = t.categories?.images?.mime_types ?? [];
219
- 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;
220
- }
221
- function f(e) {
222
- n.value = !1, s?.(c(e)), s = null;
223
- }
224
- function p() {
225
- n.value = !1, s?.(null), s = null;
226
- }
227
- return S(() => {
228
- s &&= (s(null), null);
229
- }), {
230
- handleRequestMedia: l,
231
- handleMediaSelect: f,
232
- handleMediaLibraryClose: p
233
- };
234
- }
235
- //#endregion
236
- //#region src/cloud/composables/useCloudInitialization.ts
237
- function Be(e) {
238
- let { config: t, translations: r, fontsManager: i, emit: a, getCommentsSidebar: s } = e, c = o(!0), l = o(!1), u = o(null), f = !1, p = { value: null }, m = null, g = null, _ = new je({
239
- ...t.auth,
240
- onError: t.onError
241
- }), v = Te({
242
- authManager: _,
243
- onError: t.onError
244
- }), y = o(/* @__PURE__ */ new Map()), b = be({
245
- authManager: _,
246
- defaultFontFamily: t.fonts?.defaultFont,
247
- templateDefaults: t.templateDefaults,
248
- onError: t.onError,
249
- lockedBlocks: y
250
- }), x = Ne({
251
- authManager: _,
252
- onError: t.onError
253
- });
254
- t.mcp?.enabled && Oe({
255
- editor: b,
256
- channel: x.channel,
257
- onOperation: t.mcp.onOperation
258
- });
259
- let S = null;
260
- t.collaboration?.enabled && (S = De({
261
- authManager: _,
262
- editor: b,
263
- channel: x.channel,
264
- onError: t.onError,
265
- onCollaboratorJoined: t.collaboration.onCollaboratorJoined,
266
- onCollaboratorLeft: t.collaboration.onCollaboratorLeft,
267
- onBlockLocked: t.collaboration.onBlockLocked,
268
- onBlockUnlocked: t.collaboration.onBlockUnlocked
269
- }), n(() => S.lockedBlocks.value, (e) => {
270
- y.value = e;
271
- }, { immediate: !0 }), Ae(b, S));
272
- let C = d(() => !!t.collaboration?.enabled && v.hasFeature("collaboration")), w = F({
273
- editor: b,
274
- config: {
275
- uiTheme: t.uiTheme,
276
- theme: void 0,
277
- blockDefaults: t.blockDefaults,
278
- customBlocks: [],
279
- paletteBlocks: t.paletteBlocks,
280
- mergeTags: t.mergeTags,
281
- displayConditions: t.displayConditions,
282
- onRequestMedia: null,
283
- lint: q(t),
284
- onSave: () => {
285
- p.value?.().catch((e) => {
286
- t.onError?.(e);
287
- });
288
- }
289
- },
290
- translations: r,
291
- fontsManager: i,
292
- historyOptions: S ? { isRemoteOperation: () => S._isProcessingRemoteOperation() } : void 0,
293
- autoSaveOptions: {
294
- onChange: async () => {
295
- b.hasTemplate() && (await b.createSnapshot(), m?.snapshotHistoryInstance.value?.loadSnapshots());
296
- },
297
- debounce: t.autoSaveDebounce ?? 5e3,
298
- enabled: () => t.autoSave !== !1 && v.hasFeature("auto_save")
299
- },
300
- themeExtraStyles: () => ({ "--tpl-drop-text": `"${r.canvas.dropHere}"` }),
301
- keyboardOptions: { onBeforeUndo: () => g?.showCollabUndoWarning() },
302
- editorRoot: e.editorRoot,
303
- containerEl: e.containerEl
304
- }), T = Le({
305
- isCollaborationEnabled: C,
306
- getCollaboratorCount: () => S?.collaborators.value.length ?? 0,
307
- canUndo: w.history.canUndo
308
- });
309
- g = T;
310
- let E = Fe({
311
- authManager: _,
312
- editor: b,
313
- history: w.history,
314
- conditionPreview: w.conditionPreview,
315
- autoSave: w.autoSave,
316
- onError: t.onError
317
- });
318
- m = E;
319
- let D = Ie(), O = ve(t.ai), k = Re({
320
- planConfigInstance: v,
321
- aiConfig: O,
322
- editor: b
323
- }), A = ze({
324
- onRequestMedia: t.onRequestMedia,
325
- mediaLibraryOpen: D.mediaLibraryOpen,
326
- mediaLibraryAccept: D.mediaLibraryAccept,
327
- authManager: _,
328
- getMediaConfig: () => v.config.value?.media ?? null,
329
- onError: t.onError
330
- });
331
- M({
332
- onBlockMove: b.moveBlock,
333
- onBlockAdd: b.addBlock
334
- });
335
- let j = xe({
336
- authManager: _,
337
- getFontsConfig: () => t.fonts,
338
- canUseCustomFonts: () => v.hasFeature("custom_fonts")
339
- }), P = Me({
340
- authManager: _,
341
- getTemplateId: () => b.state.template?.id ?? null,
342
- save: () => b.save(),
343
- exportHtml: (e) => j.exportHtml(e),
344
- onError: t.onError,
345
- isAuthReady: l,
346
- onBeforeTestEmail: t.onBeforeTestEmail
347
- }), I = we({
348
- authManager: _,
349
- getTemplateId: () => b.state.template?.id ?? null,
350
- getSocketId: () => x.getSocketId(),
351
- onComment: t.onComment,
352
- onError: t.onError,
353
- isAuthReady: l,
354
- hasCommentingFeature: () => t.commenting !== !1 && v.hasFeature("commenting")
355
- });
356
- ye({
357
- comments: I,
358
- channel: x.channel
359
- });
360
- let L = Ce({
361
- authManager: _,
362
- onError: t.onError
363
- }), B = o(!1), H = o(null), U = o(!1), W = _e({
364
- authManager: _,
365
- getTemplateId: () => b.state.template?.id ?? null
366
- });
367
- function G(e) {
368
- D.commentsOpen.value = !0, queueMicrotask(() => {
369
- s()?.filterByBlock(e);
370
- });
371
- }
372
- h(R, A.handleRequestMedia), h(V, _), h(re, O), h(te, I), h(z, L), h(ee, W), h(ne, {
373
- plan: v,
374
- ai: O,
375
- comments: {
376
- getBlockCount: (e) => I.commentCountByBlock.value.get(e) ?? 0,
377
- openForBlock: G
378
- },
379
- savedModules: {
380
- openSaveDialog: (e) => {
381
- H.value = e ?? null, B.value = !0;
382
- },
383
- openBrowser: () => {
384
- U.value = !0;
385
- },
386
- moduleCount: d(() => L.modules.value.length)
387
- }
388
- });
389
- function K(e) {
390
- v.hasFeature("theme_customization") && (w.themeOverrides.value = e);
391
- }
392
- function ie(e) {
393
- b.setUiTheme(e);
394
- }
395
- async function ae() {
396
- c.value = !0, u.value = null;
397
- try {
398
- if (await _.initialize(), f) return;
399
- l.value = !0;
400
- let e = await Ee({ authManager: _ });
401
- if (f) return;
402
- if (!e.api.ok) throw Error("Health check failed: API is not reachable");
403
- if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
404
- if (e.websocket.ok || N.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await v.fetchConfig(), f) return;
405
- i.setCustomFontsEnabled(v.hasFeature("custom_fonts")), t.customBlocks?.length && v.hasFeature("custom_blocks") && w.registerCustomBlocks(t.customBlocks), t.theme && v.hasFeature("theme_customization") && (w.themeOverrides.value = t.theme), t.modules !== !1 && v.hasFeature("saved_modules") && L.loadModules(), a("ready");
406
- } catch (e) {
407
- if (f) return;
408
- let n = e instanceof Error ? e : Error("Initialization failed", { cause: e });
409
- u.value = n, t.onError?.(n);
410
- } finally {
411
- f || (c.value = !1);
412
- }
413
- }
414
- function J() {
415
- f = !0, i.cleanupFontLinks(), x.disconnect(), w.destroy(), t.onUnmount?.();
416
- }
417
- return {
418
- isInitializing: c,
419
- isAuthReady: l,
420
- initError: u,
421
- isDestroyed: () => f,
422
- authManager: _,
423
- planConfigInstance: v,
424
- websocket: x,
425
- collaboration: S,
426
- isCollaborationEnabled: C,
427
- editor: b,
428
- core: w,
429
- aiConfig: O,
430
- featureFlags: k,
431
- mediaLib: A,
432
- exporter: j,
433
- testEmail: P,
434
- commentsInstance: I,
435
- savedModulesHeadless: L,
436
- scoringInstance: W,
437
- panelState: D,
438
- snapshotPreview: E,
439
- collabWarning: T,
440
- showSaveModuleDialog: B,
441
- showModuleBrowserModal: U,
442
- saveModulePreSelectedBlockId: H,
443
- onSaveHook: p,
444
- initialize: ae,
445
- destroy: J,
446
- setThemeOverrides: K,
447
- setUiTheme: ie,
448
- openCommentsForBlock: G
449
- };
450
- }
451
- //#endregion
452
- //#region src/utils/preRenderCustomBlocks.ts
453
- async function Ve(e, t) {
454
- let n = async (e) => {
455
- if (A(e)) {
456
- let n = e;
457
- try {
458
- n.renderedHtml = await t.renderCustomBlock(n);
459
- } catch {
460
- n.renderedHtml = `<!-- Custom block render error: ${n.customType} -->`;
461
- }
462
- }
463
- if (e.type === "section" && "children" in e) {
464
- let t = e;
465
- for (let e of t.children) for (let t of e) await n(t);
466
- }
467
- };
468
- for (let t of e.blocks) await n(t);
469
- }
470
- //#endregion
471
- //#region src/cloud/composables/useCloudLifecycle.ts
472
- function He(e) {
473
- let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
474
- function u() {
475
- return ke(i.config.value.websocket);
476
- }
477
- async function d(e) {
478
- let i = await n.create(e);
479
- return l() ? i : (t.onCreate?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
480
- }
481
- async function f(e) {
482
- let i = await n.load(e);
483
- return l() ? i : (t.onLoad?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
484
- }
485
- async function p() {
486
- c.isSaveExporting.value = !0, c.saveStatus.value = "idle";
487
- try {
488
- if (await Ve(n.content.value, o.registry), l()) throw Error("Component unmounted during save");
489
- let e = await n.save();
490
- if (l()) throw Error("Component unmounted during save");
491
- a.initSnapshotHistory(), a.snapshotHistoryInstance.value?.loadSnapshots();
492
- let r = await s.exportHtml(e.id);
493
- if (l()) throw Error("Component unmounted during save");
494
- let i = {
495
- templateId: e.id,
496
- html: r.html,
497
- mjml: r.mjml,
498
- content: e.content
499
- };
500
- return t.onSave?.(i), c.saveStatus.value = "saved", c.startSaveStatusClear(), i;
501
- } catch (e) {
502
- throw l() || (c.saveStatus.value = "error", c.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
503
- } finally {
504
- l() || (c.isSaveExporting.value = !1);
505
- }
506
- }
507
- return {
508
- createTemplate: d,
509
- loadTemplate: f,
510
- saveTemplate: p
511
- };
512
- }
513
- //#endregion
514
- //#region src/cloud/composables/useCloudSaveGate.ts
515
- function Ue(e) {
516
- let t = o(!1), n = null, r = d(() => e.planConfig.value?.accessibility?.blockOnError === !0), i = d(() => r.value ? e.issues.value.filter((e) => e.severity === "error") : []), a = d(() => i.value.length > 0);
517
- async function s(e) {
518
- return a.value ? (n = e, t.value = !0, !1) : (await e(), !0);
519
- }
520
- async function c() {
521
- let e = n;
522
- n = null, t.value = !1, e && await e();
523
- }
524
- function l() {
525
- n = null, t.value = !1;
526
- }
527
- return {
528
- shouldBlock: a,
529
- blockingIssues: i,
530
- modalOpen: t,
531
- tryRunSave: s,
532
- confirmAndSave: c,
533
- cancel: l
534
- };
535
- }
536
- //#endregion
537
- //#region src/cloud/components/CloudSaveGateModal.vue?vue&type=script&setup=true&lang.ts
538
- var We = ["aria-label"], Ge = { class: "tpl:flex tpl:max-h-[80vh] tpl:w-full tpl:max-w-md tpl:flex-col tpl:gap-4 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-5 tpl:shadow-[var(--tpl-shadow-md)]" }, Ke = { class: "tpl:flex tpl:items-center tpl:gap-2" }, qe = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Je = { class: "tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Ye = { class: "tpl:m-0 tpl:flex tpl:max-h-64 tpl:list-none tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2" }, Xe = { class: "tpl:text-xs tpl:text-[var(--tpl-text)]" }, Ze = { class: "tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, Qe = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, $e = /* @__PURE__ */ l({
539
- __name: "CloudSaveGateModal",
540
- props: {
541
- open: { type: Boolean },
542
- issues: {}
543
- },
544
- emits: ["cancel", "confirm"],
545
- setup(t, { emit: n }) {
546
- let i = n, { t: a } = Q();
547
- return (n, o) => (e(), x(T, {
548
- "enter-active-class": "tpl:transition-opacity tpl:duration-150",
549
- "leave-active-class": "tpl:transition-opacity tpl:duration-150",
550
- "enter-from-class": "tpl:opacity-0",
551
- "leave-to-class": "tpl:opacity-0"
552
- }, {
553
- default: O(() => [t.open ? (e(), m("div", {
554
- key: 0,
555
- role: "dialog",
556
- "aria-modal": "true",
557
- "aria-label": C(a).saveGate.title,
558
- class: "tpl:fixed tpl:inset-0 tpl:z-50 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/40 tpl:p-6",
559
- onClick: o[2] ||= u((e) => i("cancel"), ["self"])
560
- }, [f("div", Ge, [
561
- f("header", Ke, [E(C(me), {
562
- size: 18,
563
- "stroke-width": 2,
564
- class: "tpl:text-[var(--tpl-warning)]"
565
- }), f("h2", qe, w(C(a).saveGate.title), 1)]),
566
- f("p", Je, w(C(a).saveGate.body), 1),
567
- f("ul", Ye, [(e(!0), m(_, null, r(t.issues, (t) => (e(), m("li", {
568
- key: `${t.ruleId}-${t.blockId ?? "template"}`,
569
- class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5"
570
- }, [f("span", Xe, w(t.message), 1), f("span", Ze, w(t.ruleId), 1)]))), 128))]),
571
- f("footer", Qe, [f("button", {
572
- type: "button",
573
- class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]",
574
- onClick: o[0] ||= (e) => i("cancel")
575
- }, w(C(a).saveGate.cancel), 1), f("button", {
576
- type: "button",
577
- class: "tpl:rounded-md tpl:bg-[var(--tpl-danger)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-white",
578
- onClick: o[1] ||= (e) => i("confirm")
579
- }, w(C(a).saveGate.confirm), 1)])
580
- ])], 8, We)) : v("", !0)]),
581
- _: 1
582
- }));
583
- }
584
- }), et = {
585
- 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",
586
- style: {
587
- "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
588
- "backdrop-filter": "blur(12px)",
589
- "-webkit-backdrop-filter": "blur(12px)",
590
- "box-shadow": "var(--tpl-shadow-md)",
591
- "border-bottom": "1px solid var(--tpl-border)"
592
- }
593
- }, tt = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, nt = {
594
- key: 0,
595
- class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
596
- }, rt = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, it = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, at = ["data-tooltip"], ot = {
597
- key: 1,
598
- "aria-live": "polite",
599
- class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
600
- }, st = {
601
- key: 2,
602
- "aria-live": "polite",
603
- class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
604
- }, ct = ["aria-label", "aria-expanded"], lt = {
605
- key: 0,
606
- class: "tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
607
- }, ut = ["aria-expanded"], dt = {
608
- key: 0,
609
- class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
610
- }, ft = ["disabled"], pt = ["disabled"], mt = /* @__PURE__ */ l({
611
- __name: "CloudHeader",
612
- props: {
613
- editor: {},
614
- core: {},
615
- featureFlags: {},
616
- panelState: {},
617
- snapshotPreview: {},
618
- commentsInstance: {},
619
- testEmail: {},
620
- websocket: {},
621
- collaboration: {},
622
- isCollaborationEnabled: { type: Boolean },
623
- isSaveDisabled: { type: Boolean },
624
- isSaving: { type: Boolean }
625
- },
626
- emits: ["save"],
627
- setup(t) {
628
- let n = D(() => import("./CollaboratorBar-DgwjisX2.js")), r = D(() => import("./SnapshotHistory-ByloTpwh.js")), i = D(() => import("./AiFeatureMenu-DxDwLS8B.js")), { t: a, format: o } = Q();
629
- return (l, d) => (e(), m("header", et, [
630
- f("div", tt, [t.featureFlags.templateLimit.value === null ? v("", !0) : (e(), m("span", nt, w(C(o)(C(a).header.templatesUsed, {
631
- used: t.featureFlags.templateCount.value,
632
- max: t.featureFlags.templateLimit.value
633
- })), 1))]),
634
- f("div", rt, [
635
- E(K, {
636
- viewport: t.editor.state.viewport,
637
- onChange: t.editor.setViewport
638
- }, null, 8, ["viewport", "onChange"]),
639
- E(le, {
640
- "dark-mode": t.editor.state.darkMode,
641
- onChange: t.editor.setDarkMode
642
- }, null, 8, ["dark-mode", "onChange"]),
643
- E(J, {
644
- "preview-mode": t.editor.state.previewMode,
645
- onChange: t.editor.setPreviewMode
646
- }, null, 8, ["preview-mode", "onChange"]),
647
- t.collaboration && t.isCollaborationEnabled ? (e(), x(C(n), {
648
- key: 0,
649
- collaborators: t.collaboration.collaborators.value,
650
- "is-connected": t.websocket.isConnected.value
651
- }, null, 8, ["collaborators", "is-connected"])) : v("", !0),
652
- t.snapshotPreview.snapshotHistoryInstance.value ? (e(), x(C(r), {
653
- key: 1,
654
- snapshots: t.snapshotPreview.snapshotHistorySnapshots.value,
655
- "is-loading": t.snapshotPreview.snapshotHistoryIsLoading.value,
656
- "is-restoring": t.snapshotPreview.snapshotHistoryIsRestoring.value,
657
- onLoad: t.snapshotPreview.loadSnapshotHistory,
658
- onNavigate: t.snapshotPreview.handleSnapshotNavigate
659
- }, null, 8, [
660
- "snapshots",
661
- "is-loading",
662
- "is-restoring",
663
- "onLoad",
664
- "onNavigate"
665
- ])) : v("", !0)
666
- ]),
667
- f("div", it, [
668
- t.featureFlags.saveStatus.value === "error" ? (e(), m("div", {
669
- key: 0,
670
- "aria-live": "assertive",
671
- class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
672
- "data-tooltip": t.featureFlags.saveErrorMessage.value
673
- }, [E(C(W), {
674
- size: 12,
675
- "stroke-width": 2.5
676
- }), s(" " + w(C(a).header.saveFailed), 1)], 8, at)) : t.featureFlags.saveStatus.value === "saved" ? (e(), m("div", ot, [E(C(he), {
677
- size: 12,
678
- "stroke-width": 2.5
679
- }), s(" " + w(C(a).header.saved), 1)])) : t.editor.state.isDirty ? (e(), m("div", st, [d[4] ||= f("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), s(" " + w(C(a).header.unsaved), 1)])) : v("", !0),
680
- t.commentsInstance.isEnabled.value && t.featureFlags.hasTemplateSaved.value ? (e(), m("button", {
681
- key: 3,
682
- "aria-label": t.commentsInstance.unresolvedCount.value > 0 ? `${C(a).comments.button} (${t.commentsInstance.unresolvedCount.value})` : C(a).comments.button,
683
- "aria-expanded": t.panelState.commentsOpen.value,
684
- class: c(C($)),
685
- style: b({
686
- backgroundColor: t.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
687
- color: t.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
688
- borderColor: "var(--tpl-primary)"
689
- }),
690
- onClick: d[0] ||= (e) => t.panelState.commentsOpen.value = !t.panelState.commentsOpen.value
691
- }, [
692
- E(C(Y), {
693
- size: 16,
694
- "stroke-width": 2
695
- }),
696
- s(" " + w(C(a).comments.button) + " ", 1),
697
- t.commentsInstance.unresolvedCount.value > 0 && !t.panelState.commentsOpen.value ? (e(), m("span", lt, w(t.commentsInstance.unresolvedCount.value), 1)) : v("", !0)
698
- ], 14, ct)) : v("", !0),
699
- t.featureFlags.canUseAiGeneration.value && t.featureFlags.hasTemplateSaved.value ? (e(), m("div", {
700
- key: 4,
701
- ref: (e) => t.panelState.aiMenuRef.value = e,
702
- class: "tpl:relative"
703
- }, [f("button", {
704
- "aria-expanded": t.panelState.aiMenuOpen.value,
705
- class: c(["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", t.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
706
- onClick: d[1] ||= u((...e) => t.panelState.toggleAiMenu && t.panelState.toggleAiMenu(...e), ["stop"])
707
- }, [E(C(pe), {
708
- size: 16,
709
- "stroke-width": 2,
710
- class: "tpl-ai-btn-icon"
711
- }), s(" " + w(C(a).aiChat.button), 1)], 10, ut), E(T, {
712
- "enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
713
- "enter-from-class": "tpl:scale-95 tpl:opacity-0",
714
- "enter-to-class": "tpl:scale-100 tpl:opacity-100",
715
- "leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
716
- "leave-from-class": "tpl:scale-100 tpl:opacity-100",
717
- "leave-to-class": "tpl:scale-95 tpl:opacity-0"
718
- }, {
719
- default: O(() => [t.panelState.aiMenuOpen.value ? (e(), m("div", dt, [E(C(i), {
720
- "active-feature": t.panelState.activeAiFeature.value,
721
- onSelect: t.panelState.handleAiFeatureSelect
722
- }, null, 8, ["active-feature", "onSelect"])])) : v("", !0)]),
723
- _: 1
724
- })], 512)) : v("", !0),
725
- t.testEmail.isEnabled.value && t.featureFlags.canSendTestEmail.value ? (e(), m("button", {
726
- key: 5,
727
- class: c(C($)),
728
- style: {
729
- "background-color": "transparent",
730
- color: "var(--tpl-primary)",
731
- "border-color": "var(--tpl-primary)"
732
- },
733
- disabled: t.testEmail.isSending.value || !t.featureFlags.hasTemplateSaved.value,
734
- onClick: d[2] ||= (e) => t.panelState.testEmailModalOpen.value = !0
735
- }, [t.testEmail.isSending.value ? (e(), x(C(G), {
736
- key: 1,
737
- class: "tpl-spinner",
738
- size: 16,
739
- "stroke-width": 2
740
- })) : (e(), x(C(X), {
741
- key: 0,
742
- size: 16,
743
- "stroke-width": 2
744
- })), s(" " + w(C(a).testEmail.button), 1)], 10, ft)) : v("", !0),
745
- f("button", {
746
- class: c(C($)),
747
- style: {
748
- "background-color": "transparent",
749
- color: "var(--tpl-primary)",
750
- "border-color": "var(--tpl-primary)"
751
- },
752
- disabled: t.isSaveDisabled,
753
- onClick: d[3] ||= (e) => l.$emit("save")
754
- }, [t.isSaving ? (e(), x(C(G), {
755
- key: 1,
756
- class: "tpl-spinner",
757
- size: 16,
758
- "stroke-width": 2
759
- })) : (e(), x(C(Pe), {
760
- key: 0,
761
- size: 16,
762
- "stroke-width": 2
763
- })), s(" " + w(t.isSaving ? C(a).header.saving : C(a).header.save), 1)], 10, pt)
764
- ])
765
- ]));
766
- }
767
- }), ht = /* @__PURE__ */ l({
768
- __name: "CloudPanels",
769
- props: {
770
- config: {},
771
- editor: {},
772
- core: {},
773
- panelState: {},
774
- planConfigInstance: {},
775
- testEmail: {},
776
- mediaLib: {},
777
- savedModulesHeadless: {},
778
- showSaveModuleDialog: { type: Boolean },
779
- saveModulePreSelectedBlockId: {},
780
- showModuleBrowserModal: { type: Boolean }
781
- },
782
- emits: [
783
- "update:showSaveModuleDialog",
784
- "update:saveModulePreSelectedBlockId",
785
- "update:showModuleBrowserModal",
786
- "send-test-email",
787
- "module-insert"
788
- ],
789
- setup(t, { expose: n, emit: r }) {
790
- let i = D(() => import("./AiChatSidebar-B0-U5-sb.js")), a = D(() => import("./CommentsSidebar-CpRLN40c.js")), s = D(() => import("./DesignReferenceSidebar-BgPDbOsl.js")), c = D(() => import("./TemplateScoringPanel-CUxiPtEf.js")), l = D(() => import("./TestEmailModal-BvZBMBad.js")), u = D(() => import("./SaveModuleDialog-C38VqN2T.js")), d = D(() => import("./ModuleBrowserModal-DsZRr87F.js")), f = D(async () => {
791
- try {
792
- return (await import("@templatical/media-library")).MediaLibraryModal;
793
- } catch {
794
- throw Error("[Templatical] Cloud media library requires the optional peer dependency '@templatical/media-library'. Please install it.");
795
- }
796
- }), p = r;
797
- function h(e, t, n) {
798
- t.history.record(), n.setContent(e), t.conditionPreview.reset();
799
- }
800
- function g(e, t) {
801
- p("module-insert", e, t);
802
- }
803
- let y = o(null);
804
- function b(e) {
805
- y.value?.filterByBlock(e);
806
- }
807
- return n({ filterCommentsByBlock: b }), (n, r) => (e(), m(_, null, [
808
- E(C(i), {
809
- visible: t.panelState.aiChatOpen.value,
810
- "on-apply": (e) => h(e, t.core, t.editor),
811
- onClose: r[0] ||= (e) => t.panelState.aiChatOpen.value = !1
812
- }, null, 8, ["visible", "on-apply"]),
813
- E(C(c), {
814
- visible: t.panelState.scoringPanelOpen.value,
815
- onClose: r[1] ||= (e) => t.panelState.scoringPanelOpen.value = !1
816
- }, null, 8, ["visible"]),
817
- E(C(s), {
818
- visible: t.panelState.designReferenceOpen.value,
819
- "has-existing-blocks": t.editor.content.value.blocks.length > 0,
820
- onClose: r[2] ||= (e) => t.panelState.designReferenceOpen.value = !1,
821
- onApply: r[3] ||= (e) => h(e, t.core, t.editor)
822
- }, null, 8, ["visible", "has-existing-blocks"]),
823
- E(C(a), {
824
- ref_key: "commentsSidebar",
825
- ref: y,
826
- visible: t.panelState.commentsOpen.value,
827
- onClose: r[4] ||= (e) => t.panelState.commentsOpen.value = !1
828
- }, null, 8, ["visible"]),
829
- E(C(l), {
830
- visible: t.panelState.testEmailModalOpen.value,
831
- "allowed-emails": t.testEmail.allowedEmails.value,
832
- "is-sending": t.testEmail.isSending.value,
833
- error: t.testEmail.error.value,
834
- onSend: r[5] ||= (e) => p("send-test-email", e),
835
- onClose: r[6] ||= (e) => t.panelState.testEmailModalOpen.value = !1
836
- }, null, 8, [
837
- "visible",
838
- "allowed-emails",
839
- "is-sending",
840
- "error"
841
- ]),
842
- t.planConfigInstance.hasFeature("saved_modules") && t.config.modules !== !1 ? (e(), x(C(u), {
843
- key: 0,
844
- visible: t.showSaveModuleDialog,
845
- "pre-selected-block-id": t.saveModulePreSelectedBlockId,
846
- onClose: r[7] ||= (e) => {
847
- p("update:showSaveModuleDialog", !1), p("update:saveModulePreSelectedBlockId", null);
848
- },
849
- onSaved: r[8] ||= (e) => t.savedModulesHeadless.loadModules()
850
- }, null, 8, ["visible", "pre-selected-block-id"])) : v("", !0),
851
- t.planConfigInstance.hasFeature("saved_modules") && t.config.modules !== !1 ? (e(), x(C(d), {
852
- key: 1,
853
- visible: t.showModuleBrowserModal,
854
- onClose: r[9] ||= (e) => p("update:showModuleBrowserModal", !1),
855
- onInsert: g
856
- }, null, 8, ["visible"])) : v("", !0),
857
- E(C(f), {
858
- visible: t.panelState.mediaLibraryOpen.value,
859
- accept: t.panelState.mediaLibraryAccept.value,
860
- "popover-target": t.core.popoverRoot.value,
861
- onSelect: t.mediaLib.handleMediaSelect,
862
- onClose: t.mediaLib.handleMediaLibraryClose
863
- }, null, 8, [
864
- "visible",
865
- "accept",
866
- "popover-target",
867
- "onSelect",
868
- "onClose"
869
- ])
870
- ], 64));
871
- }
872
- }), gt = {
873
- key: 0,
874
- class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
875
- }, _t = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, vt = { class: "tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]" }, yt = /* @__PURE__ */ l({
876
- __name: "CloudLoadingOverlay",
877
- props: { visible: { type: Boolean } },
878
- setup(t) {
879
- return (n, i) => t.visible ? (e(), m("div", gt, [i[1] ||= p("<div class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl:flex tpl:gap-3\"><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div></div>", 1), f("div", _t, [f("div", vt, [(e(), m(_, null, r(5, (e) => f("div", {
880
- key: e,
881
- class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
882
- })), 64))]), i[0] ||= p("<div class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"><div class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div></div><div class=\"tpl:py-4\"><div class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div></div><div class=\"tpl:flex tpl:justify-center tpl:py-4\"><div class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"></div></div></div></div><div class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div></div>", 2)])])) : v("", !0);
883
- }
884
- }), bt = {
885
- key: 0,
886
- role: "alert",
887
- class: "tpl-error tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]"
888
- }, xt = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, St = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, Ct = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, wt = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Tt = /* @__PURE__ */ l({
889
- __name: "CloudErrorOverlay",
890
- props: {
891
- error: {},
892
- visible: { type: Boolean }
893
- },
894
- emits: ["retry"],
895
- setup(t, { emit: n }) {
896
- let r = n, { t: i } = Q();
897
- function a(e) {
898
- return "isUnauthorized" in e && e.isUnauthorized ? i.error.authFailed : "isNotFound" in e && e.isNotFound ? i.error.templateNotFound : i.error.defaultMessage;
899
- }
900
- function o(e) {
901
- return "isNotFound" in e && !!e.isNotFound;
902
- }
903
- return (n, s) => t.visible && t.error ? (e(), m("div", bt, [
904
- f("div", xt, [E(C(W), {
905
- size: 32,
906
- "stroke-width": 1.5,
907
- class: "tpl:text-[var(--tpl-danger)]"
908
- })]),
909
- f("div", St, [f("h2", Ct, w(C(i).error.title), 1), f("p", wt, w(a(t.error)), 1)]),
910
- o(t.error) ? v("", !0) : (e(), m("button", {
911
- key: 0,
912
- class: "tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
913
- onClick: s[0] ||= (e) => r("retry")
914
- }, w(C(i).error.retry), 1))
915
- ])) : v("", !0);
916
- }
917
- }), Et = {
918
- key: 0,
919
- class: "tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3 tpl:bg-[var(--tpl-primary-light)] tpl:border-b tpl:border-[var(--tpl-primary)]"
920
- }, Dt = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, Ot = { class: "tpl:flex tpl:items-center tpl:gap-2" }, kt = /* @__PURE__ */ l({
921
- __name: "SnapshotPreviewBanner",
922
- props: { visible: { type: Boolean } },
923
- emits: ["cancel", "confirm"],
924
- setup(t, { emit: n }) {
925
- let r = n, { t: i } = Q();
926
- return (n, a) => t.visible ? (e(), m("div", Et, [f("div", Dt, [E(C(ge), {
927
- size: 18,
928
- "stroke-width": 2,
929
- class: "tpl:text-[var(--tpl-primary)]"
930
- }), f("span", null, w(C(i).snapshotPreview.message), 1)]), f("div", Ot, [f("button", {
931
- class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
932
- style: { "background-color": "transparent" },
933
- onClick: a[0] ||= (e) => r("cancel")
934
- }, w(C(i).snapshotPreview.cancel), 1), f("button", {
935
- class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
936
- onClick: a[1] ||= (e) => r("confirm")
937
- }, w(C(i).snapshotPreview.restore), 1)])])) : v("", !0);
938
- }
939
- }), At = {
940
- key: 0,
941
- role: "status",
942
- "aria-live": "polite",
943
- class: "tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-toast tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg",
944
- style: {
945
- "background-color": "var(--tpl-warning-light)",
946
- color: "var(--tpl-text)",
947
- border: "1px solid var(--tpl-warning)"
948
- }
949
- }, jt = /* @__PURE__ */ l({
950
- __name: "CollabUndoToast",
951
- props: { visible: { type: Boolean } },
952
- setup(t) {
953
- let { t: n } = H();
954
- return (r, i) => t.visible ? (e(), m("div", At, w(C(n).history.collabWarning), 1)) : v("", !0);
955
- }
956
- }), Mt = ["data-tpl-theme"], Nt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, Pt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, Ft = ["aria-label"], It = /*#__PURE__*/ Z(/* @__PURE__ */ l({
957
- __name: "CloudEditor",
958
- props: {
959
- config: {},
960
- translations: {},
961
- cloudTranslations: {},
962
- fontsManager: {},
963
- shadowRoot: {}
964
- },
965
- emits: ["ready"],
966
- setup(n, { expose: r, emit: a }) {
967
- let l = n;
968
- h(B, l.cloudTranslations);
969
- let d = a, p = o(null), _ = o(null), S = Be({
970
- config: l.config,
971
- translations: l.translations,
972
- fontsManager: l.fontsManager,
973
- emit: d,
974
- getCommentsSidebar: () => p.value ? { filterByBlock: p.value.filterCommentsByBlock } : null,
975
- editorRoot: l.shadowRoot,
976
- containerEl: _
977
- }), { isInitializing: D, isAuthReady: k, initError: A, planConfigInstance: M, websocket: N, collaboration: F, isCollaborationEnabled: I, editor: L, core: R, featureFlags: z, mediaLib: ee, exporter: te, testEmail: V, commentsInstance: ne, savedModulesHeadless: re, panelState: H, snapshotPreview: U, collabWarning: W, showSaveModuleDialog: G, showModuleBrowserModal: K, saveModulePreSelectedBlockId: q, setThemeOverrides: J, setUiTheme: le } = S, { showNotice: pe } = P(() => l.config.smallScreenNotice);
978
- async function me(e) {
979
- try {
980
- await V.sendTestEmail(e), H.testEmailModalOpen.value = !1;
981
- } catch {}
982
- }
983
- async function he() {
984
- try {
985
- await U.confirmRestoreSnapshot();
986
- } catch {}
987
- }
988
- function ge(e, t) {
989
- for (let n = 0; n < e.content.length; n++) {
990
- let r = j(e.content[n]), i = t === void 0 ? void 0 : t + n;
991
- L.addBlock(r, void 0, void 0, i);
992
- }
993
- K.value = !1;
994
- }
995
- let Y = He({
996
- config: l.config,
997
- editor: L,
998
- websocket: N,
999
- planConfigInstance: M,
1000
- snapshotPreview: U,
1001
- core: R,
1002
- exporter: te,
1003
- featureFlags: z,
1004
- isDestroyed: S.isDestroyed
1005
- }), X = Ue({
1006
- issues: R.templateLint ? R.templateLint.issues : o([]),
1007
- planConfig: M.config
1008
- });
1009
- async function Z() {
1010
- await X.tryRunSave(() => Y.saveTemplate().catch((e) => l.config.onError?.(e)));
1011
- }
1012
- return S.onSaveHook.value = Z, i(() => {
1013
- S.initialize();
1014
- }), g(() => {
1015
- S.destroy();
1016
- }), r({
1017
- getContent: () => L.content.value,
1018
- setContent: (e) => L.setContent(e),
1019
- setTheme: le,
1020
- setThemeOverrides: J,
1021
- create: Y.createTemplate,
1022
- load: Y.loadTemplate,
1023
- save: Y.saveTemplate,
1024
- sendTestEmail: V.sendTestEmail
1025
- }), (r, i) => (e(), m("div", {
1026
- ref_key: "rootEl",
1027
- ref: _,
1028
- class: c(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": C(L).state.darkMode }]),
1029
- "data-tpl-theme": C(R).resolvedTheme.value,
1030
- style: b(C(R).themeStyles.value),
1031
- onDragover: i[9] ||= u(() => {}, ["prevent"]),
1032
- onDrop: i[10] ||= u(() => {}, ["prevent"])
1033
- }, [
1034
- E(oe),
1035
- E(T, {
1036
- "enter-active-class": "tpl:transition-opacity tpl:duration-200",
1037
- "enter-from-class": "tpl:opacity-100",
1038
- "enter-to-class": "tpl:opacity-100",
1039
- "leave-active-class": "tpl:transition-opacity tpl:duration-300",
1040
- "leave-from-class": "tpl:opacity-100",
1041
- "leave-to-class": "tpl:opacity-0"
1042
- }, {
1043
- default: O(() => [E(yt, { visible: C(D) || C(L).state.isLoading }, null, 8, ["visible"])]),
1044
- _: 1
1045
- }),
1046
- E(T, {
1047
- "enter-active-class": "tpl:transition-opacity tpl:duration-200",
1048
- "enter-from-class": "tpl:opacity-0",
1049
- "enter-to-class": "tpl:opacity-100",
1050
- "leave-active-class": "tpl:transition-opacity tpl:duration-300",
1051
- "leave-from-class": "tpl:opacity-100",
1052
- "leave-to-class": "tpl:opacity-0"
1053
- }, {
1054
- default: O(() => [E(Tt, {
1055
- error: C(A),
1056
- visible: !!C(A) && !C(D),
1057
- onRetry: C(S).initialize
1058
- }, null, 8, [
1059
- "error",
1060
- "visible",
1061
- "onRetry"
1062
- ])]),
1063
- _: 1
1064
- }),
1065
- E(mt, {
1066
- editor: C(L),
1067
- core: C(R),
1068
- "feature-flags": C(z),
1069
- "panel-state": C(H),
1070
- "snapshot-preview": C(U),
1071
- "comments-instance": C(ne),
1072
- "test-email": C(V),
1073
- websocket: C(N),
1074
- collaboration: C(F),
1075
- "is-collaboration-enabled": C(I),
1076
- "is-saving": C(L).state.isSaving || C(z).isSaveExporting.value,
1077
- "is-save-disabled": C(L).state.isSaving || C(z).isSaveExporting.value || !C(L).state.isDirty,
1078
- onSave: Z
1079
- }, null, 8, [
1080
- "editor",
1081
- "core",
1082
- "feature-flags",
1083
- "panel-state",
1084
- "snapshot-preview",
1085
- "comments-instance",
1086
- "test-email",
1087
- "websocket",
1088
- "collaboration",
1089
- "is-collaboration-enabled",
1090
- "is-saving",
1091
- "is-save-disabled"
1092
- ]),
1093
- E($e, {
1094
- open: C(X).modalOpen.value,
1095
- issues: C(X).blockingIssues.value,
1096
- onCancel: C(X).cancel,
1097
- onConfirm: C(X).confirmAndSave
1098
- }, null, 8, [
1099
- "open",
1100
- "issues",
1101
- "onCancel",
1102
- "onConfirm"
1103
- ]),
1104
- E(kt, {
1105
- visible: C(U).isPreviewingSnapshot.value,
1106
- onCancel: C(U).cancelPreview,
1107
- onConfirm: he
1108
- }, null, 8, ["visible", "onCancel"]),
1109
- E(T, {
1110
- "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
1111
- "enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
1112
- "enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
1113
- "leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
1114
- "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1115
- "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1116
- }, {
1117
- default: O(() => [E(jt, { visible: C(W).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1118
- _: 1
1119
- }),
1120
- t(E(ie, null, null, 512), [[y, !C(L).state.previewMode]]),
1121
- f("div", {
1122
- class: c(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [C(L).state.previewMode ? "tpl:left-0 tpl:right-0" : C(H).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", C(U).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1123
- style: {
1124
- transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1125
- "background-color": "var(--tpl-canvas-bg)"
1126
- }
1127
- }, [f("div", Nt, [E(T, { name: "tpl-restore-btn" }, {
1128
- default: O(() => [C(R).conditionPreview.hasHiddenBlocks.value ? (e(), m("button", {
1129
- key: 0,
1130
- 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",
1131
- style: {
1132
- "background-color": "var(--tpl-warning-light)",
1133
- color: "var(--tpl-warning)",
1134
- "border-color": "var(--tpl-warning)",
1135
- "backdrop-filter": "blur(8px)"
1136
- },
1137
- onClick: i[0] ||= (e) => C(R).conditionPreview.reset()
1138
- }, [E(C(ae), {
1139
- size: 13,
1140
- "stroke-width": 2
1141
- }), s(" " + w(C(R).t.blockSettings.restoreHiddenBlocks), 1)])) : v("", !0)]),
1142
- _: 1
1143
- })]), f("main", Pt, [E(fe, {
1144
- viewport: C(L).state.viewport,
1145
- content: C(L).content.value,
1146
- "selected-block-id": C(L).state.selectedBlockId,
1147
- "dark-mode": C(L).state.darkMode,
1148
- "preview-mode": C(L).state.previewMode,
1149
- "locked-blocks": C(F)?.lockedBlocks.value ?? void 0,
1150
- onSelectBlock: C(L).selectBlock,
1151
- onOpenAiChat: i[1] ||= (e) => C(H).aiChatOpen.value = !0,
1152
- onOpenDesignReference: i[2] ||= (e) => C(H).designReferenceOpen.value = !0
1153
- }, null, 8, [
1154
- "viewport",
1155
- "content",
1156
- "selected-block-id",
1157
- "dark-mode",
1158
- "preview-mode",
1159
- "locked-blocks",
1160
- "onSelectBlock"
1161
- ])])], 2),
1162
- n.config.branding !== !1 && !C(z).isWhiteLabeled.value ? (e(), x(se, {
1163
- key: 0,
1164
- "position-class": [C(L).state.previewMode ? "tpl:left-0 tpl:right-0" : C(H).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1165
- }, null, 8, ["position-class"])) : v("", !0),
1166
- f("div", {
1167
- class: "tpl-sr-only",
1168
- role: "status",
1169
- "aria-live": "polite",
1170
- "aria-atomic": "true",
1171
- "aria-label": C(R).t.landmarks.reorderAnnouncements
1172
- }, w(C(R).keyboardReorder.announcement.value), 9, Ft),
1173
- t(E(ue, {
1174
- "selected-block": C(L).selectedBlock.value,
1175
- settings: C(L).content.value.settings,
1176
- "shifted-left": C(H).rightPanelOpen.value,
1177
- onUpdateBlock: i[3] ||= (e) => C(L).updateBlock(C(L).selectedBlock.value.id, e),
1178
- onDeleteBlock: i[4] ||= (e) => C(R).blockActions.deleteBlock(C(L).selectedBlock.value.id),
1179
- onDuplicateBlock: i[5] ||= (e) => C(R).blockActions.duplicateBlock(C(L).selectedBlock.value),
1180
- onUpdateSettings: C(L).updateSettings
1181
- }, null, 8, [
1182
- "selected-block",
1183
- "settings",
1184
- "shifted-left",
1185
- "onUpdateSettings"
1186
- ]), [[y, !C(L).state.previewMode]]),
1187
- !C(D) && C(k) ? (e(), x(ht, {
1188
- key: 1,
1189
- ref_key: "cloudPanelsRef",
1190
- ref: p,
1191
- config: l.config,
1192
- editor: C(L),
1193
- core: C(R),
1194
- "panel-state": C(H),
1195
- "plan-config-instance": C(M),
1196
- "test-email": C(V),
1197
- "media-lib": C(ee),
1198
- "saved-modules-headless": C(re),
1199
- "show-save-module-dialog": C(G),
1200
- "save-module-pre-selected-block-id": C(q),
1201
- "show-module-browser-modal": C(K),
1202
- "onUpdate:showSaveModuleDialog": i[6] ||= (e) => G.value = e,
1203
- "onUpdate:saveModulePreSelectedBlockId": i[7] ||= (e) => q.value = e,
1204
- "onUpdate:showModuleBrowserModal": i[8] ||= (e) => K.value = e,
1205
- onSendTestEmail: me,
1206
- onModuleInsert: ge
1207
- }, null, 8, [
1208
- "config",
1209
- "editor",
1210
- "core",
1211
- "panel-state",
1212
- "plan-config-instance",
1213
- "test-email",
1214
- "media-lib",
1215
- "saved-modules-headless",
1216
- "show-save-module-dialog",
1217
- "save-module-pre-selected-block-id",
1218
- "show-module-browser-modal"
1219
- ])) : v("", !0),
1220
- f("div", {
1221
- ref: (e) => C(R).popoverRoot.value = e,
1222
- class: "tpl-popover-root"
1223
- }, null, 512),
1224
- E(de),
1225
- C(pe) ? (e(), x(ce, { key: 2 })) : v("", !0)
1226
- ], 46, Mt));
1227
- }
1228
- }), [["__scopeId", "data-v-8c4fa160"]]);
1229
- //#endregion
1230
- export { It as default };