@aswin.dev/editor 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/README.md +3 -3
  2. package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-COL6Wm7p.js} +37 -37
  3. package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-DWGPVtvC.js} +68 -68
  4. package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-duUFSfDf.js} +22 -22
  5. package/dist/{BlockA11yBadge-CXDLqkcJ.js → BlockA11yBadge-Qs6HtXid.js} +12 -12
  6. package/dist/CloudEditor-CFldoCOb.js +1207 -0
  7. package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-Bw-lbt61.js} +21 -21
  8. package/dist/CommentsSidebar-BaD5F53-.js +436 -0
  9. package/dist/CountdownBlock-DaYGxKqo.js +92 -0
  10. package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
  11. package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-BSH7uNP_.js} +58 -58
  12. package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-Ba2pfF57.js} +2 -2
  13. package/dist/{ModuleBrowserModal-DrUFMTDx.js → ModuleBrowserModal-6phxZSKI.js} +80 -80
  14. package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
  15. package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-BpUzQOJt.js} +87 -87
  16. package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-DNSzAB-I.js} +182 -182
  17. package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-CrqPQdnk.js} +38 -38
  18. package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-zMQTpez7.js} +28 -28
  19. package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-Do-A5rYU.js} +45 -50
  20. package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-CS7o62zS.js} +75 -75
  21. package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-DGj_9V1u.js} +28 -28
  22. package/dist/{TitleEditor-fStSADI-.js → TitleEditor-C7IDnAoS.js} +68 -68
  23. package/dist/{TplModal-BwSfxIHf.js → TplModal-BAsVzcTb.js} +14 -14
  24. package/dist/{accessibility-e8JYu_zd.js → accessibility-BU09xZrQ.js} +1 -1
  25. package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-C6LDKvmd.js} +19 -5
  26. package/dist/bundle-stats.json +7 -7
  27. package/dist/{check-Da05j8yl.js → check-DJrpDKO_.js} +1 -1
  28. package/dist/{chevron-down-R2uY34iD.js → chevron-down-C5oBUhT8.js} +1 -1
  29. package/dist/chevron-right-BqCptpdp.js +10 -0
  30. package/dist/{circle-alert-DZuGWPX-.js → circle-alert-ZQQc98HC.js} +1 -1
  31. package/dist/{clock-CRp2sIub.js → clock-ik2pRJKG.js} +1 -1
  32. package/dist/{cloud-DEk_b4CR.js → cloud-6ZmAvF0j.js} +485 -427
  33. package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-ClREiSx3.js} +6 -6
  34. package/dist/{de-Brqvgr43.js → de-DWcgp-7T.js} +209 -1
  35. package/dist/{dist-BaQIYPsn.js → dist-BUzw1buG.js} +1 -1
  36. package/dist/{dist-DjviJBCi.js → dist-BZyY-SS4.js} +1 -1
  37. package/dist/{dist-D6uC2xhi.js → dist-BadNx4qo.js} +1 -1
  38. package/dist/{dist-aRzjfSRN.js → dist-BesOh2mk.js} +1 -1
  39. package/dist/{dist-D90y8dvT.js → dist-Bz3M4RXG.js} +3 -3
  40. package/dist/dist-C04s_fLA.js +563 -0
  41. package/dist/{dist-DDJIWTRY.js → dist-C3T2AKtB.js} +1 -1
  42. package/dist/{dist-BFawx6IS.js → dist-C9ckKEZL.js} +51 -51
  43. package/dist/{dist-us-RpCWN.js → dist-CBItRG-Z.js} +1 -1
  44. package/dist/{dist-wzMIGj-D.js → dist-COSzWQUs.js} +1 -1
  45. package/dist/dist-CivF9P8b.js +382 -0
  46. package/dist/{dist-Cp0zXPAD.js → dist-DtiDUrX-.js} +1 -1
  47. package/dist/{dist-KoBJjK1G.js → dist-Dzt5foyL.js} +1 -1
  48. package/dist/{en-WDVp87TE.js → en-Cxd4fhNm.js} +209 -1
  49. package/dist/{extensions-CUcl9Ok4.js → extensions-D__hOlV1.js} +106 -106
  50. package/dist/{image-up-MBZKKg9p.js → image-up-DT7gcJLN.js} +1 -1
  51. package/dist/index.d.ts +88 -11
  52. package/dist/{info-CJEC7piy.js → info-BSPGcsSM.js} +1 -1
  53. package/dist/keys-CvX8D-8C.js +10 -0
  54. package/dist/{loader-circle-DsY5Yg33.js → loader-circle-Balo8p3d.js} +1 -1
  55. package/dist/{message-circle-yElBbR2C.js → message-circle-B39qAHxs.js} +1 -1
  56. package/dist/pencil-BZJPNYWR.js +10 -0
  57. package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-DwDqGUM0.js} +1 -1
  58. package/dist/{scan-line-D0vcUekt.js → scan-line-CzfFJO1o.js} +1 -1
  59. package/dist/{send-DH4oDQqC.js → send-D2eSo4GH.js} +1 -1
  60. package/dist/{shield-check-CfJgs2Hd.js → shield-check-jkpgcC0-.js} +1 -1
  61. package/dist/{sparkles-CvRXGqFs.js → sparkles-Chm5CZfb.js} +1 -1
  62. package/dist/style.css +1 -1
  63. package/dist/styleConstants-34eUKPOZ.js +55 -0
  64. package/dist/styles-B4tjX5SP.js +5224 -0
  65. package/dist/templatical-editor.js +189 -126
  66. package/dist/{text-align-start-BT9VUDxK.js → text-align-start-CzBnJsW8.js} +1 -1
  67. package/dist/{trash-2-DbP2Y6t2.js → trash-2-CtK2apEH.js} +1 -1
  68. package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-KpDVNbpn.js} +1 -1
  69. package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-DOKSZql1.js} +2 -2
  70. package/dist/{useEditorCore-C6ost42Q.js → useEditorCore-wslttMH-.js} +2425 -2250
  71. package/dist/{useI18n-lb2DHDiu.js → useI18n-C2xQZ6K9.js} +2 -2
  72. package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-DX0XG5V9.js} +5 -5
  73. package/dist/{vue.runtime.esm-bundler-DpvJL-nX.js → vue.runtime.esm-bundler-CjauPXjj.js} +1 -1
  74. package/dist/{x-u2oVmjN_.js → x-BkaOMosX.js} +1 -1
  75. package/package.json +10 -10
  76. package/dist/CloudEditor-BCz1ZTYC.js +0 -1172
  77. package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
  78. package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
  79. package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
  80. package/dist/ModulePreviewCanvas-CHdOwV_4.js +0 -106
  81. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +0 -97
  82. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +0 -1
  83. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +0 -59
  84. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +0 -1
  85. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +0 -33
  86. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +0 -1
  87. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +0 -1143
  88. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +0 -1
  89. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +0 -51
  90. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +0 -1
  91. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +0 -93
  92. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +0 -1
  93. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
  94. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +0 -1
  95. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +0 -195
  96. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +0 -1
  97. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +0 -107
  98. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +0 -1
  99. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +0 -423
  100. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +0 -1
  101. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +0 -544
  102. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +0 -1
  103. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +0 -106
  104. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +0 -1
  105. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +0 -119
  106. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +0 -1
  107. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +0 -171
  108. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +0 -1
  109. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +0 -22
  110. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +0 -1
  111. package/dist/cdn/chunks/de-Ce-LbJ2J.js +0 -89
  112. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +0 -1
  113. package/dist/cdn/chunks/de-D8CnZxV9.js +0 -523
  114. package/dist/cdn/chunks/de-D8CnZxV9.js.map +0 -1
  115. package/dist/cdn/chunks/de-RQrZR56a.js +0 -209
  116. package/dist/cdn/chunks/de-RQrZR56a.js.map +0 -1
  117. package/dist/cdn/chunks/draggable-Bcb86AsV.js +0 -11572
  118. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +0 -1
  119. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +0 -19
  120. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +0 -1
  121. package/dist/cdn/chunks/en-8FHaQv4V.js +0 -523
  122. package/dist/cdn/chunks/en-8FHaQv4V.js.map +0 -1
  123. package/dist/cdn/chunks/en-Bl1ecfRF.js +0 -209
  124. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +0 -1
  125. package/dist/cdn/chunks/en-DiCWK5fG.js +0 -89
  126. package/dist/cdn/chunks/en-DiCWK5fG.js.map +0 -1
  127. package/dist/cdn/chunks/extensions-DIxF31tA.js +0 -598
  128. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +0 -1
  129. package/dist/cdn/chunks/features-DEMb13KS.js +0 -6814
  130. package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
  131. package/dist/cdn/chunks/icons-CsLTcirh.js +0 -700
  132. package/dist/cdn/chunks/icons-CsLTcirh.js.map +0 -1
  133. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +0 -3279
  134. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +0 -1
  135. package/dist/cdn/chunks/media-library-CVaNvhpM.js +0 -6014
  136. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +0 -1
  137. package/dist/cdn/chunks/pusher-CDbNlZBE.js +0 -2508
  138. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +0 -1
  139. package/dist/cdn/chunks/quality-BaBfc54_.js +0 -1456
  140. package/dist/cdn/chunks/quality-BaBfc54_.js.map +0 -1
  141. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +0 -32
  142. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +0 -1
  143. package/dist/cdn/chunks/renderer-CUxvx7ro.js +0 -548
  144. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +0 -1
  145. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +0 -20
  146. package/dist/cdn/chunks/src-CRaqN-p8.js +0 -497
  147. package/dist/cdn/chunks/src-CRaqN-p8.js.map +0 -1
  148. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +0 -57
  149. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +0 -1
  150. package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
  151. package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
  152. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +0 -14654
  153. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +0 -1
  154. package/dist/cdn/editor.css +0 -2
  155. package/dist/cdn/editor.js +0 -250
  156. package/dist/cdn/editor.js.map +0 -1
  157. package/dist/dist-B1IR0bpH.js +0 -326
  158. package/dist/dist-DJmnUmW9.js +0 -362
  159. package/dist/keys-ciNfSSGj.js +0 -10
  160. package/dist/styleConstants-fWzlIIwN.js +0 -55
  161. package/dist/styles-DEXEkBvg.js +0 -3176
  162. /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-BVAJ4lgT.js} +0 -0
  163. /package/dist/{de-DCaaCE5s.js → de-GOtR9DwW.js} +0 -0
  164. /package/dist/{dist-iLBdeBDR.js → dist-DXa1uAMh.js} +0 -0
  165. /package/dist/{emojiData-PQyVa4bU.js → emojiData-DrBuvEoP.js} +0 -0
  166. /package/dist/{en-DXCyK4-X.js → en-dFFQVzNn.js} +0 -0
  167. /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-BhhO8yCl.js} +0 -0
  168. /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-BvCyLQII.js} +0 -0
  169. /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-DVuzNX1y.js} +0 -0
@@ -1,1172 +0,0 @@
1
- import { A as e, Dt as t, H as n, M as r, Mt as i, N as a, Ot as o, P as s, Q as c, S as l, V as u, Y as d, _ as f, b as p, c as m, d as h, et as g, g as _, h as v, it as y, j as b, m as x, p as S, t as C, u as w, v as T, x as E, y as D, z as O } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
2
- import { t as k } from "./timeouts-BSGxjuUF.js";
3
- import { E as A, i as j } from "./dist-DJmnUmW9.js";
4
- import { P as M, S as ee, t as N } from "./useEditorCore-C6ost42Q.js";
5
- import { s as P, t as F } from "./dist-B1IR0bpH.js";
6
- import { C as te, c as I, i as L, l as R, n as z, u as ne, w as B, x as V } from "./keys-ciNfSSGj.js";
7
- import { t as H } from "./useI18n-lb2DHDiu.js";
8
- import { t as U } from "./createLucideIcon-C3pa2siy.js";
9
- import { t as W } from "./check-Da05j8yl.js";
10
- import { t as G } from "./circle-alert-DZuGWPX-.js";
11
- import { a as K, c as re, i as q, l as ie, n as J, o as ae, r as oe, s as se, t as ce } from "./styles-DEXEkBvg.js";
12
- import { t as Y } from "./clock-CRp2sIub.js";
13
- import { t as X } from "./loader-circle-DsY5Yg33.js";
14
- import { t as Z } from "./message-circle-yElBbR2C.js";
15
- import { t as le } from "./send-DH4oDQqC.js";
16
- import { t as ue } from "./sparkles-CvRXGqFs.js";
17
- import { t as de } from "./triangle-alert-aOXceTSe.js";
18
- import { t as fe } from "./_plugin-vue_export-helper-B0hnzhyu.js";
19
- import { n as Q } from "./useCloudI18n-BuIwR6OE.js";
20
- import { d as $ } from "./styleConstants-fWzlIIwN.js";
21
- import { _ as pe, a as me, c as he, d as ge, f as _e, g as ve, h as ye, l as be, m as xe, n as Se, o as Ce, p as we, r as Te, s as Ee, t as De, v as Oe, y as ke } from "./cloud-DEk_b4CR.js";
22
- var Ae = 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 je(e) {
39
- let { authManager: t, editor: n, history: r, conditionPreview: i, autoSave: a, onError: o } = e, s = g(null), l = c(null), u = c(null), f = !1;
40
- d(() => {
41
- f = !0;
42
- });
43
- let p = S(() => l.value !== null), m = S(() => s.value?.snapshots.value ?? []), h = S(() => s.value?.isLoading.value ?? !1), _ = S(() => s.value?.isRestoring.value ?? !1);
44
- function v() {
45
- n.state.template?.id && !s.value && (s.value = ve({
46
- authManager: t,
47
- templateId: n.state.template.id,
48
- onRestore: y,
49
- onError: o
50
- }), s.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 (!f) {
57
- if (l.value) {
58
- l.value = e, n.setContent(e.content, !1);
59
- return;
60
- }
61
- n.state.isDirty && n.hasTemplate() && (await n.createSnapshot(), f) || (u.value = structuredClone(n.content.value), a?.pause(), l.value = e, n.setContent(e.content, !1));
62
- }
63
- }
64
- async function x() {
65
- if (!(!l.value || !s.value)) try {
66
- if (await s.value.restoreSnapshot(l.value.id), f || (await s.value.loadSnapshots(), f)) return;
67
- } finally {
68
- f || (l.value = null, u.value = null, a?.resume());
69
- }
70
- }
71
- function C() {
72
- !l.value || !u.value || (n.setContent(u.value, !1), l.value = null, u.value = null, a?.resume());
73
- }
74
- async function w() {
75
- f || s.value && await s.value.loadSnapshots();
76
- }
77
- return {
78
- snapshotHistoryInstance: s,
79
- previewingSnapshot: l,
80
- contentBeforePreview: u,
81
- isPreviewingSnapshot: p,
82
- snapshotHistorySnapshots: m,
83
- snapshotHistoryIsLoading: h,
84
- snapshotHistoryIsRestoring: _,
85
- initSnapshotHistory: v,
86
- handleRestore: y,
87
- handleSnapshotNavigate: b,
88
- confirmRestoreSnapshot: x,
89
- cancelPreview: C,
90
- loadSnapshotHistory: w
91
- };
92
- }
93
- //#endregion
94
- //#region src/cloud/composables/useCloudPanelState.ts
95
- function Me() {
96
- let e = c(null), t = S({
97
- get: () => e.value === "ai-chat",
98
- set: (t) => e.value = t ? "ai-chat" : null
99
- }), n = S({
100
- get: () => e.value === "scoring",
101
- set: (t) => e.value = t ? "scoring" : null
102
- }), r = S({
103
- get: () => e.value === "design-reference",
104
- set: (t) => e.value = t ? "design-reference" : null
105
- }), i = S({
106
- get: () => e.value === "comments",
107
- set: (t) => e.value = t ? "comments" : null
108
- }), a = c(!1), o = c(!1), s = c(void 0), l = c(!1), u = c(null), d = S(() => e.value !== null), f = S(() => {
109
- let t = e.value;
110
- return t === "ai-chat" || t === "design-reference" || t === "scoring" ? t : null;
111
- }), p = S(() => l.value || e.value === "ai-chat" || e.value === "design-reference" || e.value === "scoring");
112
- function m() {
113
- l.value = !l.value;
114
- }
115
- function h(t) {
116
- l.value = !1, e.value = e.value === t ? null : t;
117
- }
118
- return F(u, () => {
119
- l.value = !1;
120
- }), {
121
- activePanel: e,
122
- aiChatOpen: t,
123
- scoringPanelOpen: n,
124
- designReferenceOpen: r,
125
- commentsOpen: i,
126
- testEmailModalOpen: a,
127
- mediaLibraryOpen: o,
128
- mediaLibraryAccept: s,
129
- aiMenuOpen: l,
130
- aiMenuRef: u,
131
- rightPanelOpen: d,
132
- activeAiFeature: f,
133
- aiButtonActive: p,
134
- toggleAiMenu: m,
135
- handleAiFeatureSelect: h
136
- };
137
- }
138
- //#endregion
139
- //#region src/cloud/composables/useCollabUndoWarning.ts
140
- function Ne(e) {
141
- let { isCollaborationEnabled: t, getCollaboratorCount: n, canUndo: r } = e, i = c(!1), a = c(!1), { start: o } = P(() => {
142
- a.value = !1;
143
- }, k, { immediate: !1 });
144
- function s() {
145
- i.value || !t.value || n() === 0 || !r.value || (i.value = !0, a.value = !0, o());
146
- }
147
- return {
148
- collabUndoWarningVisible: a,
149
- showCollabUndoWarning: s
150
- };
151
- }
152
- //#endregion
153
- //#region src/cloud/composables/useCloudFeatureFlags.ts
154
- function Pe(e) {
155
- let { planConfigInstance: t, aiConfig: n, editor: r } = e, i = S(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), a = S(() => t.hasFeature("test_email")), o = S(() => !!r.state.template?.id), s = S(() => t.hasFeature("white_label")), l = S(() => t.config.value?.limits.max_templates ?? null), u = S(() => t.config.value?.template_count ?? 0), d = c(!1), f = c("idle"), p = c(""), { start: m } = P(() => {
156
- f.value = "idle";
157
- }, 3e3, { immediate: !1 });
158
- return {
159
- canUseAiGeneration: i,
160
- canSendTestEmail: a,
161
- hasTemplateSaved: o,
162
- isWhiteLabeled: s,
163
- templateLimit: l,
164
- templateCount: u,
165
- isSaveExporting: d,
166
- saveStatus: f,
167
- saveErrorMessage: p,
168
- startSaveStatusClear: m
169
- };
170
- }
171
- //#endregion
172
- //#region src/cloud/composables/useCloudMediaLibrary.ts
173
- function Fe(e) {
174
- let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r } = e, i = null;
175
- async function a() {
176
- if (t) {
177
- let e = await t({ accept: ["images"] });
178
- return e ? {
179
- url: e.url,
180
- alt: e.alt_text || void 0
181
- } : null;
182
- }
183
- return i &&= (i(null), null), r.value = ["images"], n.value = !0, new Promise((e) => {
184
- i = (t) => {
185
- e(t);
186
- };
187
- });
188
- }
189
- function o(e) {
190
- n.value = !1, i?.({
191
- url: e.url,
192
- alt: e.alt_text || void 0
193
- }), i = null;
194
- }
195
- function s() {
196
- n.value = !1, i?.(null), i = null;
197
- }
198
- return d(() => {
199
- i &&= (i(null), null);
200
- }), {
201
- handleRequestMedia: a,
202
- handleMediaSelect: o,
203
- handleMediaLibraryClose: s
204
- };
205
- }
206
- //#endregion
207
- //#region src/cloud/composables/useCloudInitialization.ts
208
- function Ie(e) {
209
- let { config: t, translations: n, fontsManager: r, emit: i, getCommentsSidebar: o } = e, s = c(!0), l = c(!1), u = c(null), d = !1, f = { value: null }, p = null, m = null, h = new De({
210
- ...t.auth,
211
- onError: t.onError
212
- }), g = xe({
213
- authManager: h,
214
- onError: t.onError
215
- }), _ = c(/* @__PURE__ */ new Map()), v = ge({
216
- authManager: h,
217
- defaultFontFamily: t.fonts?.defaultFont,
218
- templateDefaults: t.templateDefaults,
219
- onError: t.onError,
220
- lockedBlocks: _
221
- }), y = ke({
222
- authManager: h,
223
- onError: t.onError
224
- });
225
- t.mcp?.enabled && we({
226
- editor: v,
227
- channel: y.channel,
228
- onOperation: t.mcp.onOperation
229
- });
230
- let b = null;
231
- t.collaboration?.enabled && (b = Ce({
232
- authManager: h,
233
- editor: v,
234
- channel: y.channel,
235
- onError: t.onError,
236
- onCollaboratorJoined: t.collaboration.onCollaboratorJoined,
237
- onCollaboratorLeft: t.collaboration.onCollaboratorLeft,
238
- onBlockLocked: t.collaboration.onBlockLocked,
239
- onBlockUnlocked: t.collaboration.onBlockUnlocked
240
- }), O(() => b.lockedBlocks.value, (e) => {
241
- _.value = e;
242
- }, { immediate: !0 }), Ee(v, b));
243
- let x = S(() => !!t.collaboration?.enabled && g.hasFeature("collaboration")), C = N({
244
- editor: v,
245
- config: {
246
- uiTheme: t.uiTheme,
247
- theme: void 0,
248
- blockDefaults: t.blockDefaults,
249
- customBlocks: [],
250
- mergeTags: t.mergeTags,
251
- displayConditions: t.displayConditions,
252
- onRequestMedia: null,
253
- accessibility: re(t),
254
- onSave: () => {
255
- f.value?.().catch((e) => {
256
- t.onError?.(e);
257
- });
258
- }
259
- },
260
- translations: n,
261
- fontsManager: r,
262
- historyOptions: b ? { isRemoteOperation: () => b._isProcessingRemoteOperation() } : void 0,
263
- autoSaveOptions: {
264
- onChange: async () => {
265
- v.hasTemplate() && (await v.createSnapshot(), p?.snapshotHistoryInstance.value?.loadSnapshots());
266
- },
267
- debounce: t.autoSaveDebounce ?? 5e3,
268
- enabled: () => t.autoSave !== !1 && g.hasFeature("auto_save")
269
- },
270
- themeExtraStyles: () => ({ "--tpl-drop-text": `"${n.canvas.dropHere}"` }),
271
- keyboardOptions: { onBeforeUndo: () => m?.showCollabUndoWarning() }
272
- }), w = Ne({
273
- isCollaborationEnabled: x,
274
- getCollaboratorCount: () => b?.collaborators.value.length ?? 0,
275
- canUndo: C.history.canUndo
276
- });
277
- m = w;
278
- let T = je({
279
- authManager: h,
280
- editor: v,
281
- history: C.history,
282
- conditionPreview: C.conditionPreview,
283
- autoSave: C.autoSave,
284
- onError: t.onError
285
- });
286
- p = T;
287
- let E = Me(), D = me(t.ai), k = Pe({
288
- planConfigInstance: g,
289
- aiConfig: D,
290
- editor: v
291
- }), A = Fe({
292
- onRequestMedia: t.onRequestMedia,
293
- mediaLibraryOpen: E.mediaLibraryOpen,
294
- mediaLibraryAccept: E.mediaLibraryAccept
295
- });
296
- ee({
297
- onBlockMove: v.moveBlock,
298
- onBlockAdd: v.addBlock
299
- });
300
- let j = _e({
301
- authManager: h,
302
- getFontsConfig: () => t.fonts,
303
- canUseCustomFonts: () => g.hasFeature("custom_fonts")
304
- }), P = Oe({
305
- authManager: h,
306
- getTemplateId: () => v.state.template?.id ?? null,
307
- save: () => v.save(),
308
- exportHtml: (e) => j.exportHtml(e),
309
- onError: t.onError,
310
- isAuthReady: l,
311
- onBeforeTestEmail: t.onBeforeTestEmail
312
- }), F = be({
313
- authManager: h,
314
- getTemplateId: () => v.state.template?.id ?? null,
315
- getSocketId: () => y.getSocketId(),
316
- onComment: t.onComment,
317
- onError: t.onError,
318
- isAuthReady: l,
319
- hasCommentingFeature: () => t.commenting !== !1 && g.hasFeature("commenting")
320
- });
321
- he({
322
- comments: F,
323
- channel: y.channel
324
- });
325
- let R = ye({
326
- authManager: h,
327
- onError: t.onError
328
- }), H = c(!1), U = c(null), W = c(!1), G = pe({
329
- authManager: h,
330
- getTemplateId: () => v.state.template?.id ?? null
331
- });
332
- function K(e) {
333
- E.commentsOpen.value = !0, queueMicrotask(() => {
334
- o()?.filterByBlock(e);
335
- });
336
- }
337
- a(V, A.handleRequestMedia), a(L, h), a(z, D), a(ne, F), a(te, R), a(B, G), a(I, {
338
- plan: g,
339
- ai: D,
340
- comments: {
341
- getBlockCount: (e) => F.commentCountByBlock.value.get(e) ?? 0,
342
- openForBlock: K
343
- },
344
- savedModules: {
345
- openSaveDialog: (e) => {
346
- U.value = e ?? null, H.value = !0;
347
- },
348
- openBrowser: () => {
349
- W.value = !0;
350
- },
351
- moduleCount: S(() => R.modules.value.length)
352
- }
353
- });
354
- function q(e) {
355
- g.hasFeature("theme_customization") && (C.themeOverrides.value = e);
356
- }
357
- function ie(e) {
358
- v.setUiTheme(e);
359
- }
360
- async function J() {
361
- s.value = !0, u.value = null;
362
- try {
363
- if (await h.initialize(), d) return;
364
- l.value = !0;
365
- let e = await Se({ authManager: h });
366
- if (d) return;
367
- if (!e.api.ok) throw Error("Health check failed: API is not reachable");
368
- if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
369
- if (e.websocket.ok || M.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await g.fetchConfig(), d) return;
370
- r.setCustomFontsEnabled(g.hasFeature("custom_fonts")), t.customBlocks?.length && g.hasFeature("custom_blocks") && C.registerCustomBlocks(t.customBlocks), t.theme && g.hasFeature("theme_customization") && (C.themeOverrides.value = t.theme), t.modules !== !1 && g.hasFeature("saved_modules") && R.loadModules(), i("ready");
371
- } catch (e) {
372
- if (d) return;
373
- let n = e instanceof Error ? e : Error("Initialization failed", { cause: e });
374
- u.value = n, t.onError?.(n);
375
- } finally {
376
- d || (s.value = !1);
377
- }
378
- }
379
- function ae() {
380
- d = !0, r.cleanupFontLinks(), y.disconnect(), C.destroy(), t.onUnmount?.();
381
- }
382
- return {
383
- isInitializing: s,
384
- isAuthReady: l,
385
- initError: u,
386
- isDestroyed: () => d,
387
- authManager: h,
388
- planConfigInstance: g,
389
- websocket: y,
390
- collaboration: b,
391
- isCollaborationEnabled: x,
392
- editor: v,
393
- core: C,
394
- aiConfig: D,
395
- featureFlags: k,
396
- mediaLib: A,
397
- exporter: j,
398
- testEmail: P,
399
- commentsInstance: F,
400
- savedModulesHeadless: R,
401
- scoringInstance: G,
402
- panelState: E,
403
- snapshotPreview: T,
404
- collabWarning: w,
405
- showSaveModuleDialog: H,
406
- showModuleBrowserModal: W,
407
- saveModulePreSelectedBlockId: U,
408
- onSaveHook: f,
409
- initialize: J,
410
- destroy: ae,
411
- setThemeOverrides: q,
412
- setUiTheme: ie,
413
- openCommentsForBlock: K
414
- };
415
- }
416
- //#endregion
417
- //#region src/utils/preRenderCustomBlocks.ts
418
- async function Le(e, t) {
419
- let n = async (e) => {
420
- if (A(e)) {
421
- let n = e;
422
- try {
423
- n.renderedHtml = await t.renderCustomBlock(n);
424
- } catch {
425
- n.renderedHtml = `<!-- Custom block render error: ${n.customType} -->`;
426
- }
427
- }
428
- if (e.type === "section" && "children" in e) {
429
- let t = e;
430
- for (let e of t.children) for (let t of e) await n(t);
431
- }
432
- };
433
- for (let t of e.blocks) await n(t);
434
- }
435
- //#endregion
436
- //#region src/cloud/composables/useCloudLifecycle.ts
437
- function Re(e) {
438
- let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
439
- function u() {
440
- return Te(i.config.value.websocket);
441
- }
442
- async function d(e) {
443
- let i = await n.create(e);
444
- return l() ? i : (t.onCreate?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
445
- }
446
- async function f(e) {
447
- let i = await n.load(e);
448
- return l() ? i : (t.onLoad?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
449
- }
450
- async function p() {
451
- c.isSaveExporting.value = !0, c.saveStatus.value = "idle";
452
- try {
453
- if (await Le(n.content.value, o.registry), l()) throw Error("Component unmounted during save");
454
- let e = await n.save();
455
- if (l()) throw Error("Component unmounted during save");
456
- a.initSnapshotHistory(), a.snapshotHistoryInstance.value?.loadSnapshots();
457
- let r = await s.exportHtml(e.id);
458
- if (l()) throw Error("Component unmounted during save");
459
- let i = {
460
- templateId: e.id,
461
- html: r.html,
462
- mjml: r.mjml,
463
- content: e.content
464
- };
465
- return t.onSave?.(i), c.saveStatus.value = "saved", c.startSaveStatusClear(), i;
466
- } catch (e) {
467
- throw l() || (c.saveStatus.value = "error", c.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
468
- } finally {
469
- l() || (c.isSaveExporting.value = !1);
470
- }
471
- }
472
- return {
473
- createTemplate: d,
474
- loadTemplate: f,
475
- saveTemplate: p
476
- };
477
- }
478
- //#endregion
479
- //#region src/cloud/composables/useCloudSaveGate.ts
480
- function ze(e) {
481
- let t = c(!1), n = null, r = S(() => e.planConfig.value?.accessibility?.blockOnError === !0), i = S(() => r.value ? e.issues.value.filter((e) => e.severity === "error") : []), a = S(() => i.value.length > 0);
482
- async function o(e) {
483
- return a.value ? (n = e, t.value = !0, !1) : (await e(), !0);
484
- }
485
- async function s() {
486
- let e = n;
487
- n = null, t.value = !1, e && await e();
488
- }
489
- function l() {
490
- n = null, t.value = !1;
491
- }
492
- return {
493
- shouldBlock: a,
494
- blockingIssues: i,
495
- modalOpen: t,
496
- tryRunSave: o,
497
- confirmAndSave: s,
498
- cancel: l
499
- };
500
- }
501
- //#endregion
502
- //#region src/cloud/components/CloudSaveGateModal.vue?vue&type=script&setup=true&lang.ts
503
- var Be = ["aria-label"], Ve = { 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)]" }, He = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ue = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, We = { class: "tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Ge = { 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" }, Ke = { class: "tpl:text-xs tpl:text-[var(--tpl-text)]" }, qe = { class: "tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, Je = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Ye = /* @__PURE__ */ l({
504
- __name: "CloudSaveGateModal",
505
- props: {
506
- open: { type: Boolean },
507
- issues: {}
508
- },
509
- emits: ["cancel", "confirm"],
510
- setup(e, { emit: t }) {
511
- let n = t, { t: a } = Q();
512
- return (t, o) => (r(), v(C, {
513
- "enter-active-class": "tpl:transition-opacity tpl:duration-150",
514
- "leave-active-class": "tpl:transition-opacity tpl:duration-150",
515
- "enter-from-class": "tpl:opacity-0",
516
- "leave-to-class": "tpl:opacity-0"
517
- }, {
518
- default: u(() => [e.open ? (r(), f("div", {
519
- key: 0,
520
- role: "dialog",
521
- "aria-modal": "true",
522
- "aria-label": y(a).saveGate.title,
523
- class: "tpl:fixed tpl:inset-0 tpl:z-50 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/40 tpl:p-6",
524
- onClick: o[2] ||= w((e) => n("cancel"), ["self"])
525
- }, [x("div", Ve, [
526
- x("header", He, [p(y(de), {
527
- size: 18,
528
- "stroke-width": 2,
529
- class: "tpl:text-[var(--tpl-warning)]"
530
- }), x("h2", Ue, i(y(a).saveGate.title), 1)]),
531
- x("p", We, i(y(a).saveGate.body), 1),
532
- x("ul", Ge, [(r(!0), f(h, null, s(e.issues, (e) => (r(), f("li", {
533
- key: `${e.ruleId}-${e.blockId ?? "template"}`,
534
- class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5"
535
- }, [x("span", Ke, i(e.message), 1), x("span", qe, i(e.ruleId), 1)]))), 128))]),
536
- x("footer", Je, [x("button", {
537
- type: "button",
538
- 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)]",
539
- onClick: o[0] ||= (e) => n("cancel")
540
- }, i(y(a).saveGate.cancel), 1), x("button", {
541
- type: "button",
542
- 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",
543
- onClick: o[1] ||= (e) => n("confirm")
544
- }, i(y(a).saveGate.confirm), 1)])
545
- ])], 8, Be)) : _("", !0)]),
546
- _: 1
547
- }));
548
- }
549
- }), Xe = {
550
- 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",
551
- style: {
552
- "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
553
- "backdrop-filter": "blur(12px)",
554
- "-webkit-backdrop-filter": "blur(12px)",
555
- "box-shadow": "var(--tpl-shadow-md)",
556
- "border-bottom": "1px solid var(--tpl-border)"
557
- }
558
- }, Ze = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, Qe = {
559
- key: 0,
560
- class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
561
- }, $e = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, et = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, tt = ["data-tooltip"], nt = {
562
- key: 1,
563
- "aria-live": "polite",
564
- class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
565
- }, rt = {
566
- key: 2,
567
- "aria-live": "polite",
568
- class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
569
- }, it = ["aria-label", "aria-expanded"], at = {
570
- key: 0,
571
- 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)]"
572
- }, ot = ["aria-expanded"], st = {
573
- key: 0,
574
- class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
575
- }, ct = ["disabled"], lt = ["disabled"], ut = /* @__PURE__ */ l({
576
- __name: "CloudHeader",
577
- props: {
578
- editor: {},
579
- core: {},
580
- featureFlags: {},
581
- panelState: {},
582
- snapshotPreview: {},
583
- commentsInstance: {},
584
- testEmail: {},
585
- websocket: {},
586
- collaboration: {},
587
- isCollaborationEnabled: { type: Boolean },
588
- isSaveDisabled: { type: Boolean },
589
- isSaving: { type: Boolean }
590
- },
591
- emits: ["save"],
592
- setup(e) {
593
- let n = E(() => import("./CollaboratorBar-DuPYW5iF.js")), a = E(() => import("./SnapshotHistory-BR3eV120.js")), s = E(() => import("./AiFeatureMenu-BLLKoOos.js")), { t: c, format: l } = Q();
594
- return (d, m) => (r(), f("header", Xe, [
595
- x("div", Ze, [e.featureFlags.templateLimit.value === null ? _("", !0) : (r(), f("span", Qe, i(y(l)(y(c).header.templatesUsed, {
596
- used: e.featureFlags.templateCount.value,
597
- max: e.featureFlags.templateLimit.value
598
- })), 1))]),
599
- x("div", $e, [
600
- p(q, {
601
- viewport: e.editor.state.viewport,
602
- onChange: e.editor.setViewport
603
- }, null, 8, ["viewport", "onChange"]),
604
- p(J, {
605
- "dark-mode": e.editor.state.darkMode,
606
- onChange: e.editor.setDarkMode
607
- }, null, 8, ["dark-mode", "onChange"]),
608
- p(oe, {
609
- "preview-mode": e.editor.state.previewMode,
610
- onChange: e.editor.setPreviewMode
611
- }, null, 8, ["preview-mode", "onChange"]),
612
- e.collaboration && e.isCollaborationEnabled ? (r(), v(y(n), {
613
- key: 0,
614
- collaborators: e.collaboration.collaborators.value,
615
- "is-connected": e.websocket.isConnected.value
616
- }, null, 8, ["collaborators", "is-connected"])) : _("", !0),
617
- e.snapshotPreview.snapshotHistoryInstance.value ? (r(), v(y(a), {
618
- key: 1,
619
- snapshots: e.snapshotPreview.snapshotHistorySnapshots.value,
620
- "is-loading": e.snapshotPreview.snapshotHistoryIsLoading.value,
621
- "is-restoring": e.snapshotPreview.snapshotHistoryIsRestoring.value,
622
- onLoad: e.snapshotPreview.loadSnapshotHistory,
623
- onNavigate: e.snapshotPreview.handleSnapshotNavigate
624
- }, null, 8, [
625
- "snapshots",
626
- "is-loading",
627
- "is-restoring",
628
- "onLoad",
629
- "onNavigate"
630
- ])) : _("", !0)
631
- ]),
632
- x("div", et, [
633
- e.featureFlags.saveStatus.value === "error" ? (r(), f("div", {
634
- key: 0,
635
- "aria-live": "assertive",
636
- class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
637
- "data-tooltip": e.featureFlags.saveErrorMessage.value
638
- }, [p(y(G), {
639
- size: 12,
640
- "stroke-width": 2.5
641
- }), D(" " + i(y(c).header.saveFailed), 1)], 8, tt)) : e.featureFlags.saveStatus.value === "saved" ? (r(), f("div", nt, [p(y(W), {
642
- size: 12,
643
- "stroke-width": 2.5
644
- }), D(" " + i(y(c).header.saved), 1)])) : e.editor.state.isDirty ? (r(), f("div", rt, [m[4] ||= x("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), D(" " + i(y(c).header.unsaved), 1)])) : _("", !0),
645
- e.commentsInstance.isEnabled.value && e.featureFlags.hasTemplateSaved.value ? (r(), f("button", {
646
- key: 3,
647
- "aria-label": e.commentsInstance.unresolvedCount.value > 0 ? `${y(c).comments.button} (${e.commentsInstance.unresolvedCount.value})` : y(c).comments.button,
648
- "aria-expanded": e.panelState.commentsOpen.value,
649
- class: t(y($)),
650
- style: o({
651
- backgroundColor: e.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
652
- color: e.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
653
- borderColor: "var(--tpl-primary)"
654
- }),
655
- onClick: m[0] ||= (t) => e.panelState.commentsOpen.value = !e.panelState.commentsOpen.value
656
- }, [
657
- p(y(Z), {
658
- size: 16,
659
- "stroke-width": 2
660
- }),
661
- D(" " + i(y(c).comments.button) + " ", 1),
662
- e.commentsInstance.unresolvedCount.value > 0 && !e.panelState.commentsOpen.value ? (r(), f("span", at, i(e.commentsInstance.unresolvedCount.value), 1)) : _("", !0)
663
- ], 14, it)) : _("", !0),
664
- e.featureFlags.canUseAiGeneration.value && e.featureFlags.hasTemplateSaved.value ? (r(), f("div", {
665
- key: 4,
666
- ref: (t) => e.panelState.aiMenuRef.value = t,
667
- class: "tpl:relative"
668
- }, [x("button", {
669
- "aria-expanded": e.panelState.aiMenuOpen.value,
670
- class: t(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", e.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
671
- onClick: m[1] ||= w((...t) => e.panelState.toggleAiMenu && e.panelState.toggleAiMenu(...t), ["stop"])
672
- }, [p(y(ue), {
673
- size: 16,
674
- "stroke-width": 2,
675
- class: "tpl-ai-btn-icon"
676
- }), D(" " + i(y(c).aiChat.button), 1)], 10, ot), p(C, {
677
- "enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
678
- "enter-from-class": "tpl:scale-95 tpl:opacity-0",
679
- "enter-to-class": "tpl:scale-100 tpl:opacity-100",
680
- "leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
681
- "leave-from-class": "tpl:scale-100 tpl:opacity-100",
682
- "leave-to-class": "tpl:scale-95 tpl:opacity-0"
683
- }, {
684
- default: u(() => [e.panelState.aiMenuOpen.value ? (r(), f("div", st, [p(y(s), {
685
- "active-feature": e.panelState.activeAiFeature.value,
686
- onSelect: e.panelState.handleAiFeatureSelect
687
- }, null, 8, ["active-feature", "onSelect"])])) : _("", !0)]),
688
- _: 1
689
- })], 512)) : _("", !0),
690
- e.testEmail.isEnabled.value && e.featureFlags.canSendTestEmail.value ? (r(), f("button", {
691
- key: 5,
692
- class: t(y($)),
693
- style: {
694
- "background-color": "transparent",
695
- color: "var(--tpl-primary)",
696
- "border-color": "var(--tpl-primary)"
697
- },
698
- disabled: e.testEmail.isSending.value || !e.featureFlags.hasTemplateSaved.value,
699
- onClick: m[2] ||= (t) => e.panelState.testEmailModalOpen.value = !0
700
- }, [e.testEmail.isSending.value ? (r(), v(y(X), {
701
- key: 1,
702
- class: "tpl-spinner",
703
- size: 16,
704
- "stroke-width": 2
705
- })) : (r(), v(y(le), {
706
- key: 0,
707
- size: 16,
708
- "stroke-width": 2
709
- })), D(" " + i(y(c).testEmail.button), 1)], 10, ct)) : _("", !0),
710
- x("button", {
711
- class: t(y($)),
712
- style: {
713
- "background-color": "transparent",
714
- color: "var(--tpl-primary)",
715
- "border-color": "var(--tpl-primary)"
716
- },
717
- disabled: e.isSaveDisabled,
718
- onClick: m[3] ||= (e) => d.$emit("save")
719
- }, [e.isSaving ? (r(), v(y(X), {
720
- key: 1,
721
- class: "tpl-spinner",
722
- size: 16,
723
- "stroke-width": 2
724
- })) : (r(), v(y(Ae), {
725
- key: 0,
726
- size: 16,
727
- "stroke-width": 2
728
- })), D(" " + i(e.isSaving ? y(c).header.saving : y(c).header.save), 1)], 10, lt)
729
- ])
730
- ]));
731
- }
732
- }), dt = /* @__PURE__ */ l({
733
- __name: "CloudPanels",
734
- props: {
735
- config: {},
736
- editor: {},
737
- core: {},
738
- panelState: {},
739
- planConfigInstance: {},
740
- testEmail: {},
741
- mediaLib: {},
742
- savedModulesHeadless: {},
743
- showSaveModuleDialog: { type: Boolean },
744
- saveModulePreSelectedBlockId: {},
745
- showModuleBrowserModal: { type: Boolean }
746
- },
747
- emits: [
748
- "update:showSaveModuleDialog",
749
- "update:saveModulePreSelectedBlockId",
750
- "update:showModuleBrowserModal",
751
- "send-test-email",
752
- "module-insert"
753
- ],
754
- setup(e, { expose: t, emit: n }) {
755
- let i = E(() => import("./AiChatSidebar-B3SJIKG_.js")), a = E(() => import("./CommentsSidebar-B1pvJdqF.js")), o = E(() => import("./DesignReferenceSidebar-B8V_F2yF.js")), s = E(() => import("./TemplateScoringPanel-4GTNHej5.js")), l = E(() => import("./TestEmailModal--ue5w9fT.js")), u = E(() => import("./SaveModuleDialog-FZ9lxY7_.js")), d = E(() => import("./ModuleBrowserModal-DrUFMTDx.js")), m = E(async () => (await import("@templatical/media-library")).MediaLibraryModal), g = n;
756
- function b(e, t, n) {
757
- t.history.record(), n.setContent(e), t.conditionPreview.reset();
758
- }
759
- function x(e, t) {
760
- g("module-insert", e, t);
761
- }
762
- let S = c(null);
763
- function C(e) {
764
- S.value?.filterByBlock(e);
765
- }
766
- return t({ filterCommentsByBlock: C }), (t, n) => (r(), f(h, null, [
767
- p(y(i), {
768
- visible: e.panelState.aiChatOpen.value,
769
- "on-apply": (t) => b(t, e.core, e.editor),
770
- onClose: n[0] ||= (t) => e.panelState.aiChatOpen.value = !1
771
- }, null, 8, ["visible", "on-apply"]),
772
- p(y(s), {
773
- visible: e.panelState.scoringPanelOpen.value,
774
- onClose: n[1] ||= (t) => e.panelState.scoringPanelOpen.value = !1
775
- }, null, 8, ["visible"]),
776
- p(y(o), {
777
- visible: e.panelState.designReferenceOpen.value,
778
- "has-existing-blocks": e.editor.content.value.blocks.length > 0,
779
- onClose: n[2] ||= (t) => e.panelState.designReferenceOpen.value = !1,
780
- onApply: n[3] ||= (t) => b(t, e.core, e.editor)
781
- }, null, 8, ["visible", "has-existing-blocks"]),
782
- p(y(a), {
783
- ref_key: "commentsSidebar",
784
- ref: S,
785
- visible: e.panelState.commentsOpen.value,
786
- onClose: n[4] ||= (t) => e.panelState.commentsOpen.value = !1
787
- }, null, 8, ["visible"]),
788
- p(y(l), {
789
- visible: e.panelState.testEmailModalOpen.value,
790
- "allowed-emails": e.testEmail.allowedEmails.value,
791
- "is-sending": e.testEmail.isSending.value,
792
- error: e.testEmail.error.value,
793
- onSend: n[5] ||= (e) => g("send-test-email", e),
794
- onClose: n[6] ||= (t) => e.panelState.testEmailModalOpen.value = !1
795
- }, null, 8, [
796
- "visible",
797
- "allowed-emails",
798
- "is-sending",
799
- "error"
800
- ]),
801
- e.planConfigInstance.hasFeature("saved_modules") && e.config.modules !== !1 ? (r(), v(y(u), {
802
- key: 0,
803
- visible: e.showSaveModuleDialog,
804
- "pre-selected-block-id": e.saveModulePreSelectedBlockId,
805
- onClose: n[7] ||= (e) => {
806
- g("update:showSaveModuleDialog", !1), g("update:saveModulePreSelectedBlockId", null);
807
- },
808
- onSaved: n[8] ||= (t) => e.savedModulesHeadless.loadModules()
809
- }, null, 8, ["visible", "pre-selected-block-id"])) : _("", !0),
810
- e.planConfigInstance.hasFeature("saved_modules") && e.config.modules !== !1 ? (r(), v(y(d), {
811
- key: 1,
812
- visible: e.showModuleBrowserModal,
813
- onClose: n[9] ||= (e) => g("update:showModuleBrowserModal", !1),
814
- onInsert: x
815
- }, null, 8, ["visible"])) : _("", !0),
816
- p(y(m), {
817
- visible: e.panelState.mediaLibraryOpen.value,
818
- accept: e.panelState.mediaLibraryAccept.value,
819
- onSelect: e.mediaLib.handleMediaSelect,
820
- onClose: e.mediaLib.handleMediaLibraryClose
821
- }, null, 8, [
822
- "visible",
823
- "accept",
824
- "onSelect",
825
- "onClose"
826
- ])
827
- ], 64));
828
- }
829
- }), ft = {
830
- key: 0,
831
- class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
832
- }, pt = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, mt = { 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)]" }, ht = /* @__PURE__ */ l({
833
- __name: "CloudLoadingOverlay",
834
- props: { visible: { type: Boolean } },
835
- setup(e) {
836
- return (t, n) => e.visible ? (r(), f("div", ft, [n[1] ||= T("<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), x("div", pt, [x("div", mt, [(r(), f(h, null, s(5, (e) => x("div", {
837
- key: e,
838
- class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
839
- })), 64))]), n[0] ||= T("<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)])])) : _("", !0);
840
- }
841
- }), gt = {
842
- key: 0,
843
- role: "alert",
844
- 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)]"
845
- }, _t = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, vt = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, yt = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, bt = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, xt = /* @__PURE__ */ l({
846
- __name: "CloudErrorOverlay",
847
- props: {
848
- error: {},
849
- visible: { type: Boolean }
850
- },
851
- emits: ["retry"],
852
- setup(e, { emit: t }) {
853
- let n = t, { t: a } = Q();
854
- function o(e) {
855
- return "isUnauthorized" in e && e.isUnauthorized ? a.error.authFailed : "isNotFound" in e && e.isNotFound ? a.error.templateNotFound : a.error.defaultMessage;
856
- }
857
- function s(e) {
858
- return "isNotFound" in e && !!e.isNotFound;
859
- }
860
- return (t, c) => e.visible && e.error ? (r(), f("div", gt, [
861
- x("div", _t, [p(y(G), {
862
- size: 32,
863
- "stroke-width": 1.5,
864
- class: "tpl:text-[var(--tpl-danger)]"
865
- })]),
866
- x("div", vt, [x("h2", yt, i(y(a).error.title), 1), x("p", bt, i(o(e.error)), 1)]),
867
- s(e.error) ? _("", !0) : (r(), f("button", {
868
- key: 0,
869
- 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)]",
870
- onClick: c[0] ||= (e) => n("retry")
871
- }, i(y(a).error.retry), 1))
872
- ])) : _("", !0);
873
- }
874
- }), St = {
875
- key: 0,
876
- 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)]"
877
- }, Ct = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, wt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Tt = /* @__PURE__ */ l({
878
- __name: "SnapshotPreviewBanner",
879
- props: { visible: { type: Boolean } },
880
- emits: ["cancel", "confirm"],
881
- setup(e, { emit: t }) {
882
- let n = t, { t: a } = Q();
883
- return (t, o) => e.visible ? (r(), f("div", St, [x("div", Ct, [p(y(Y), {
884
- size: 18,
885
- "stroke-width": 2,
886
- class: "tpl:text-[var(--tpl-primary)]"
887
- }), x("span", null, i(y(a).snapshotPreview.message), 1)]), x("div", wt, [x("button", {
888
- 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)]",
889
- style: { "background-color": "transparent" },
890
- onClick: o[0] ||= (e) => n("cancel")
891
- }, i(y(a).snapshotPreview.cancel), 1), x("button", {
892
- 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)]",
893
- onClick: o[1] ||= (e) => n("confirm")
894
- }, i(y(a).snapshotPreview.restore), 1)])])) : _("", !0);
895
- }
896
- }), Et = {
897
- key: 0,
898
- role: "status",
899
- "aria-live": "polite",
900
- 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",
901
- style: {
902
- "background-color": "var(--tpl-warning-light)",
903
- color: "var(--tpl-text)",
904
- border: "1px solid var(--tpl-warning)"
905
- }
906
- }, Dt = /* @__PURE__ */ l({
907
- __name: "CollabUndoToast",
908
- props: { visible: { type: Boolean } },
909
- setup(e) {
910
- let { t } = H();
911
- return (n, a) => e.visible ? (r(), f("div", Et, i(y(t).history.collabWarning), 1)) : _("", !0);
912
- }
913
- }), Ot = ["data-tpl-theme"], kt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, At = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, jt = ["aria-label"], Mt = /* @__PURE__ */ fe(/* @__PURE__ */ l({
914
- __name: "CloudEditor",
915
- props: {
916
- config: {},
917
- translations: {},
918
- cloudTranslations: {},
919
- fontsManager: {}
920
- },
921
- emits: ["ready"],
922
- setup(s, { expose: l, emit: d }) {
923
- let h = s;
924
- a(R, h.cloudTranslations);
925
- let g = d, S = c(null), w = Ie({
926
- config: h.config,
927
- translations: h.translations,
928
- fontsManager: h.fontsManager,
929
- emit: g,
930
- getCommentsSidebar: () => S.value ? { filterByBlock: S.value.filterCommentsByBlock } : null
931
- }), { isInitializing: T, isAuthReady: E, initError: O, planConfigInstance: k, websocket: A, collaboration: M, isCollaborationEnabled: ee, editor: N, core: P, featureFlags: F, mediaLib: te, exporter: I, testEmail: L, commentsInstance: z, savedModulesHeadless: ne, panelState: B, snapshotPreview: V, collabWarning: H, showSaveModuleDialog: U, showModuleBrowserModal: W, saveModulePreSelectedBlockId: G, setThemeOverrides: re, setUiTheme: q } = w;
932
- async function J(e) {
933
- try {
934
- await L.sendTestEmail(e), B.testEmailModalOpen.value = !1;
935
- } catch {}
936
- }
937
- function oe(e, t) {
938
- for (let n = 0; n < e.content.length; n++) {
939
- let r = j(e.content[n]), i = t === void 0 ? void 0 : t + n;
940
- N.addBlock(r, void 0, void 0, i);
941
- }
942
- W.value = !1;
943
- }
944
- let Y = Re({
945
- config: h.config,
946
- editor: N,
947
- websocket: A,
948
- planConfigInstance: k,
949
- snapshotPreview: V,
950
- core: P,
951
- exporter: I,
952
- featureFlags: F,
953
- isDestroyed: w.isDestroyed
954
- }), X = ze({
955
- issues: P.accessibilityLint ? P.accessibilityLint.issues : c([]),
956
- planConfig: k.config
957
- });
958
- async function Z() {
959
- await X.tryRunSave(() => Y.saveTemplate().catch((e) => h.config.onError?.(e)));
960
- }
961
- return w.onSaveHook.value = Z, e(() => {
962
- w.initialize();
963
- }), b(() => {
964
- w.destroy();
965
- }), l({
966
- getContent: () => N.content.value,
967
- setContent: (e) => N.setContent(e),
968
- setTheme: q,
969
- setThemeOverrides: re,
970
- create: Y.createTemplate,
971
- load: Y.loadTemplate,
972
- save: Y.saveTemplate,
973
- sendTestEmail: L.sendTestEmail
974
- }), (e, a) => (r(), f("div", {
975
- class: t(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": y(N).state.darkMode }]),
976
- "data-tpl-theme": y(P).resolvedTheme.value,
977
- style: o(y(P).themeStyles.value)
978
- }, [
979
- p(C, {
980
- "enter-active-class": "tpl:transition-opacity tpl:duration-200",
981
- "enter-from-class": "tpl:opacity-100",
982
- "enter-to-class": "tpl:opacity-100",
983
- "leave-active-class": "tpl:transition-opacity tpl:duration-300",
984
- "leave-from-class": "tpl:opacity-100",
985
- "leave-to-class": "tpl:opacity-0"
986
- }, {
987
- default: u(() => [p(ht, { visible: y(T) || y(N).state.isLoading }, null, 8, ["visible"])]),
988
- _: 1
989
- }),
990
- p(C, {
991
- "enter-active-class": "tpl:transition-opacity tpl:duration-200",
992
- "enter-from-class": "tpl:opacity-0",
993
- "enter-to-class": "tpl:opacity-100",
994
- "leave-active-class": "tpl:transition-opacity tpl:duration-300",
995
- "leave-from-class": "tpl:opacity-100",
996
- "leave-to-class": "tpl:opacity-0"
997
- }, {
998
- default: u(() => [p(xt, {
999
- error: y(O),
1000
- visible: !!y(O) && !y(T),
1001
- onRetry: y(w).initialize
1002
- }, null, 8, [
1003
- "error",
1004
- "visible",
1005
- "onRetry"
1006
- ])]),
1007
- _: 1
1008
- }),
1009
- p(ut, {
1010
- editor: y(N),
1011
- core: y(P),
1012
- "feature-flags": y(F),
1013
- "panel-state": y(B),
1014
- "snapshot-preview": y(V),
1015
- "comments-instance": y(z),
1016
- "test-email": y(L),
1017
- websocket: y(A),
1018
- collaboration: y(M),
1019
- "is-collaboration-enabled": y(ee),
1020
- "is-saving": y(N).state.isSaving || y(F).isSaveExporting.value,
1021
- "is-save-disabled": y(N).state.isSaving || y(F).isSaveExporting.value || !y(N).state.isDirty,
1022
- onSave: Z
1023
- }, null, 8, [
1024
- "editor",
1025
- "core",
1026
- "feature-flags",
1027
- "panel-state",
1028
- "snapshot-preview",
1029
- "comments-instance",
1030
- "test-email",
1031
- "websocket",
1032
- "collaboration",
1033
- "is-collaboration-enabled",
1034
- "is-saving",
1035
- "is-save-disabled"
1036
- ]),
1037
- p(Ye, {
1038
- open: y(X).modalOpen.value,
1039
- issues: y(X).blockingIssues.value,
1040
- onCancel: y(X).cancel,
1041
- onConfirm: y(X).confirmAndSave
1042
- }, null, 8, [
1043
- "open",
1044
- "issues",
1045
- "onCancel",
1046
- "onConfirm"
1047
- ]),
1048
- p(Tt, {
1049
- visible: y(V).isPreviewingSnapshot.value,
1050
- onCancel: y(V).cancelPreview,
1051
- onConfirm: y(V).confirmRestoreSnapshot
1052
- }, null, 8, [
1053
- "visible",
1054
- "onCancel",
1055
- "onConfirm"
1056
- ]),
1057
- p(C, {
1058
- "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
1059
- "enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
1060
- "enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
1061
- "leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
1062
- "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1063
- "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1064
- }, {
1065
- default: u(() => [p(Dt, { visible: y(H).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1066
- _: 1
1067
- }),
1068
- n(p(ae, null, null, 512), [[m, !y(N).state.previewMode]]),
1069
- x("div", {
1070
- class: t(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [y(N).state.previewMode ? "tpl:left-0 tpl:right-0" : y(B).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", y(V).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1071
- style: {
1072
- transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1073
- "background-color": "var(--tpl-canvas-bg)"
1074
- }
1075
- }, [x("div", kt, [p(C, { name: "tpl-restore-btn" }, {
1076
- default: u(() => [y(P).conditionPreview.hasHiddenBlocks.value ? (r(), f("button", {
1077
- key: 0,
1078
- 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",
1079
- style: {
1080
- "background-color": "var(--tpl-warning-light)",
1081
- color: "var(--tpl-warning)",
1082
- "border-color": "var(--tpl-warning)",
1083
- "backdrop-filter": "blur(8px)"
1084
- },
1085
- onClick: a[0] ||= (e) => y(P).conditionPreview.reset()
1086
- }, [p(y(ie), {
1087
- size: 13,
1088
- "stroke-width": 2
1089
- }), D(" " + i(y(P).t.blockSettings.restoreHiddenBlocks), 1)])) : _("", !0)]),
1090
- _: 1
1091
- })]), x("main", At, [p(se, {
1092
- viewport: y(N).state.viewport,
1093
- content: y(N).content.value,
1094
- "selected-block-id": y(N).state.selectedBlockId,
1095
- "dark-mode": y(N).state.darkMode,
1096
- "preview-mode": y(N).state.previewMode,
1097
- "locked-blocks": y(M)?.lockedBlocks.value ?? void 0,
1098
- onSelectBlock: y(N).selectBlock,
1099
- onOpenAiChat: a[1] ||= (e) => y(B).aiChatOpen.value = !0,
1100
- onOpenDesignReference: a[2] ||= (e) => y(B).designReferenceOpen.value = !0
1101
- }, null, 8, [
1102
- "viewport",
1103
- "content",
1104
- "selected-block-id",
1105
- "dark-mode",
1106
- "preview-mode",
1107
- "locked-blocks",
1108
- "onSelectBlock"
1109
- ])])], 2),
1110
- s.config.branding !== !1 && !y(F).isWhiteLabeled.value ? (r(), v(ce, {
1111
- key: 0,
1112
- "position-class": [y(N).state.previewMode ? "tpl:left-0 tpl:right-0" : y(B).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1113
- }, null, 8, ["position-class"])) : _("", !0),
1114
- x("div", {
1115
- class: "tpl-sr-only",
1116
- role: "status",
1117
- "aria-live": "polite",
1118
- "aria-atomic": "true",
1119
- "aria-label": y(P).t.landmarks.reorderAnnouncements
1120
- }, i(y(P).keyboardReorder.announcement.value), 9, jt),
1121
- n(p(K, {
1122
- "selected-block": y(N).selectedBlock.value,
1123
- settings: y(N).content.value.settings,
1124
- "shifted-left": y(B).rightPanelOpen.value,
1125
- onUpdateBlock: a[3] ||= (e) => y(N).updateBlock(y(N).selectedBlock.value.id, e),
1126
- onDeleteBlock: a[4] ||= (e) => y(P).blockActions.deleteBlock(y(N).selectedBlock.value.id),
1127
- onDuplicateBlock: a[5] ||= (e) => y(P).blockActions.duplicateBlock(y(N).selectedBlock.value),
1128
- onUpdateSettings: y(N).updateSettings
1129
- }, null, 8, [
1130
- "selected-block",
1131
- "settings",
1132
- "shifted-left",
1133
- "onUpdateSettings"
1134
- ]), [[m, !y(N).state.previewMode]]),
1135
- !y(T) && y(E) ? (r(), v(dt, {
1136
- key: 1,
1137
- ref_key: "cloudPanelsRef",
1138
- ref: S,
1139
- config: h.config,
1140
- editor: y(N),
1141
- core: y(P),
1142
- "panel-state": y(B),
1143
- "plan-config-instance": y(k),
1144
- "test-email": y(L),
1145
- "media-lib": y(te),
1146
- "saved-modules-headless": y(ne),
1147
- "show-save-module-dialog": y(U),
1148
- "save-module-pre-selected-block-id": y(G),
1149
- "show-module-browser-modal": y(W),
1150
- "onUpdate:showSaveModuleDialog": a[6] ||= (e) => U.value = e,
1151
- "onUpdate:saveModulePreSelectedBlockId": a[7] ||= (e) => G.value = e,
1152
- "onUpdate:showModuleBrowserModal": a[8] ||= (e) => W.value = e,
1153
- onSendTestEmail: J,
1154
- onModuleInsert: oe
1155
- }, null, 8, [
1156
- "config",
1157
- "editor",
1158
- "core",
1159
- "panel-state",
1160
- "plan-config-instance",
1161
- "test-email",
1162
- "media-lib",
1163
- "saved-modules-headless",
1164
- "show-save-module-dialog",
1165
- "save-module-pre-selected-block-id",
1166
- "show-module-browser-modal"
1167
- ])) : _("", !0)
1168
- ], 14, Ot));
1169
- }
1170
- }), [["__scopeId", "data-v-b332971f"]]);
1171
- //#endregion
1172
- export { Mt as default };