@templatical/editor 0.28.1 → 0.29.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 (161) hide show
  1. package/dist/{AiChatSidebar-mZyf81xG.js → AiChatSidebar-KeS30iRG.js} +7 -7
  2. package/dist/{AiFeatureMenu-wpL2vbbd.js → AiFeatureMenu-CCdTgCy7.js} +4 -4
  3. package/dist/{BlockIssueBadge-CavnyR3o.js → BlockIssueBadge-DQ6jBV1T.js} +2 -2
  4. package/dist/{BlockPreviewCanvas-C4M7JT4x.js → BlockPreviewCanvas-MgXVXOG_.js} +1 -1
  5. package/dist/{CloudHeaderExtras-fH0cB-Ru.js → CloudHeaderExtras-L_b51XVJ.js} +2 -2
  6. package/dist/{CloudPanels-Davlnzfd.js → CloudPanels-XUtScYFl.js} +3 -3
  7. package/dist/{CollaboratorBar-BvQZriPA.js → CollaboratorBar-Cx5klY7H.js} +2 -2
  8. package/dist/{ColorPicker-OLSFZBBZ.js → ColorPicker-DjfecH79.js} +1 -1
  9. package/dist/{CommentsPanel-B4_63eIS.js → CommentsPanel-5QxgkKF-.js} +1 -1
  10. package/dist/{CommentsSidebar-BkBHMXez.js → CommentsSidebar-CScszOsC.js} +10 -10
  11. package/dist/{CountdownToolbar-D8FsDIfa.js → CountdownToolbar-CiBrLbq0.js} +1 -1
  12. package/dist/{DesignReferenceSidebar-Dp44REBY.js → DesignReferenceSidebar-B1__DJJI.js} +5 -5
  13. package/dist/{IssuesPanel-C1v3dmoB.js → IssuesPanel-CkuV9Fjp.js} +5 -5
  14. package/dist/{MergeTagModeToggle-CZN0Pr1o.js → MergeTagModeToggle-oX-n91fH.js} +2 -2
  15. package/dist/{MergeTagSuggestion-a7Tk8tBB.js → MergeTagSuggestion-BUozNVtA.js} +55 -39
  16. package/dist/{ParagraphEditor-CGxsm0Mx.js → ParagraphEditor-BVlMj-YW.js} +19 -19
  17. package/dist/{RestoreVersionDialog-BLW8wC1J.js → RestoreVersionDialog-CZRLWoqP.js} +3 -3
  18. package/dist/{RichTextEditorContent-COBy_Q9j.js → RichTextEditorContent-BN6RBSZG.js} +3 -3
  19. package/dist/{SaveBlockDialog-KWQaS1_q.js → SaveBlockDialog-KNQVLcUG.js} +6 -6
  20. package/dist/{SavedBlocksBrowserModal-Cg8yP_EN.js → SavedBlocksBrowserModal-D7qatvfw.js} +7 -7
  21. package/dist/{SavedBlocksPanels-bept0JjA.js → SavedBlocksPanels-bizAFdNK.js} +1 -1
  22. package/dist/{SavedBlocksPickBar-Z-YRd488.js → SavedBlocksPickBar-BXUSoa38.js} +2 -2
  23. package/dist/{TemplateScoringPanel-5zp1qOSl.js → TemplateScoringPanel-Dm83xt9R.js} +10 -10
  24. package/dist/{TestEmailModal-DtJabfkS.js → TestEmailModal-DAdO9Gmo.js} +6 -6
  25. package/dist/{TestEmailPanel-CtFxt5q7.js → TestEmailPanel-DORs6xk0.js} +1 -1
  26. package/dist/{TitleEditor-BfWPus_C.js → TitleEditor-B_aWxZER.js} +8 -8
  27. package/dist/{TplModal-DBlMd7h9.js → TplModal-7623HR5x.js} +1 -1
  28. package/dist/{VersionHistoryMenu-Cg4UKxKc.js → VersionHistoryMenu-D7lgozpw.js} +4 -4
  29. package/dist/{VersionHistoryPanels-BKjbNEOM.js → VersionHistoryPanels-Dor0p1Ur.js} +1 -1
  30. package/dist/{VersionPreviewBanner-B0thyJ8F.js → VersionPreviewBanner-CQt2il1L.js} +1 -1
  31. package/dist/{blockTypeIcons-CQMkcHo9.js → blockTypeIcons-Di4AsjQx.js} +2 -2
  32. package/dist/bundle-stats.json +6 -6
  33. package/dist/cdn/chunks/{AiChatSidebar-BQATQ3Tr.js → AiChatSidebar-Cwr9eqTh.js} +2 -2
  34. package/dist/cdn/chunks/{AiChatSidebar-BQATQ3Tr.js.map → AiChatSidebar-Cwr9eqTh.js.map} +1 -1
  35. package/dist/cdn/chunks/{AiFeatureMenu-cNoZ0xl_.js → AiFeatureMenu-CT2QiHmi.js} +3 -3
  36. package/dist/cdn/chunks/{AiFeatureMenu-cNoZ0xl_.js.map → AiFeatureMenu-CT2QiHmi.js.map} +1 -1
  37. package/dist/cdn/chunks/{BlockIssueBadge-CH_3vFw4.js → BlockIssueBadge-CXlXn9Sm.js} +2 -2
  38. package/dist/cdn/chunks/{BlockIssueBadge-CH_3vFw4.js.map → BlockIssueBadge-CXlXn9Sm.js.map} +1 -1
  39. package/dist/cdn/chunks/{BlockPreviewCanvas-BXVC8-Zj.js → BlockPreviewCanvas-BisO3JEy.js} +2 -2
  40. package/dist/cdn/chunks/{BlockPreviewCanvas-BXVC8-Zj.js.map → BlockPreviewCanvas-BisO3JEy.js.map} +1 -1
  41. package/dist/cdn/chunks/{CloudHeaderExtras-CUAM2ADe.js → CloudHeaderExtras-MRCYqip8.js} +3 -3
  42. package/dist/cdn/chunks/{CloudHeaderExtras-CUAM2ADe.js.map → CloudHeaderExtras-MRCYqip8.js.map} +1 -1
  43. package/dist/cdn/chunks/{CloudPanels-DMnnSIkX.js → CloudPanels-Bb9qSwKJ.js} +4 -4
  44. package/dist/cdn/chunks/{CloudPanels-DMnnSIkX.js.map → CloudPanels-Bb9qSwKJ.js.map} +1 -1
  45. package/dist/cdn/chunks/{CollaboratorBar-C6sorNRi.js → CollaboratorBar-CG13kDHu.js} +3 -3
  46. package/dist/cdn/chunks/{CollaboratorBar-C6sorNRi.js.map → CollaboratorBar-CG13kDHu.js.map} +1 -1
  47. package/dist/cdn/chunks/{ColorPicker-q1V7ggWI.js → ColorPicker-UpN24AsB.js} +2 -2
  48. package/dist/cdn/chunks/{ColorPicker-q1V7ggWI.js.map → ColorPicker-UpN24AsB.js.map} +1 -1
  49. package/dist/cdn/chunks/{CommentsPanel-ExfxJZM3.js → CommentsPanel-CIcIXzOB.js} +2 -2
  50. package/dist/cdn/chunks/{CommentsPanel-ExfxJZM3.js.map → CommentsPanel-CIcIXzOB.js.map} +1 -1
  51. package/dist/cdn/chunks/{CommentsSidebar-CzALURMJ.js → CommentsSidebar-CB5Z8xNz.js} +2 -2
  52. package/dist/cdn/chunks/{CommentsSidebar-CzALURMJ.js.map → CommentsSidebar-CB5Z8xNz.js.map} +1 -1
  53. package/dist/cdn/chunks/{CountdownToolbar-CkbWSrAH.js → CountdownToolbar-B1L0IK1T.js} +2 -2
  54. package/dist/cdn/chunks/{CountdownToolbar-CkbWSrAH.js.map → CountdownToolbar-B1L0IK1T.js.map} +1 -1
  55. package/dist/cdn/chunks/{DesignReferenceSidebar-COh0Rx_A.js → DesignReferenceSidebar-BwsfOFsc.js} +2 -2
  56. package/dist/cdn/chunks/{DesignReferenceSidebar-COh0Rx_A.js.map → DesignReferenceSidebar-BwsfOFsc.js.map} +1 -1
  57. package/dist/cdn/chunks/{IssuesPanel-C1NG0xRI.js → IssuesPanel-3nTCyKgK.js} +2 -2
  58. package/dist/cdn/chunks/{IssuesPanel-C1NG0xRI.js.map → IssuesPanel-3nTCyKgK.js.map} +1 -1
  59. package/dist/cdn/chunks/{MergeTagModeToggle-B1yXCp3D.js → MergeTagModeToggle-BUNsRKs6.js} +2 -2
  60. package/dist/cdn/chunks/{MergeTagModeToggle-B1yXCp3D.js.map → MergeTagModeToggle-BUNsRKs6.js.map} +1 -1
  61. package/dist/cdn/chunks/{MergeTagSuggestion-DqYR3jPA.js → MergeTagSuggestion-Dt6I8bZi.js} +2 -2
  62. package/dist/cdn/chunks/{MergeTagSuggestion-DqYR3jPA.js.map → MergeTagSuggestion-Dt6I8bZi.js.map} +1 -1
  63. package/dist/cdn/chunks/{ParagraphEditor-DPM1hUKo.js → ParagraphEditor-BtzkHfv2.js} +17 -17
  64. package/dist/cdn/chunks/{ParagraphEditor-DPM1hUKo.js.map → ParagraphEditor-BtzkHfv2.js.map} +1 -1
  65. package/dist/cdn/chunks/{RestoreVersionDialog-Dz0bX5ZZ.js → RestoreVersionDialog-DNoo-EBT.js} +3 -3
  66. package/dist/cdn/chunks/{RestoreVersionDialog-Dz0bX5ZZ.js.map → RestoreVersionDialog-DNoo-EBT.js.map} +1 -1
  67. package/dist/cdn/chunks/{RichTextEditorContent-nkyIRAyN.js → RichTextEditorContent-BQATmyd9.js} +3 -3
  68. package/dist/cdn/chunks/{RichTextEditorContent-nkyIRAyN.js.map → RichTextEditorContent-BQATmyd9.js.map} +1 -1
  69. package/dist/cdn/chunks/{SaveBlockDialog-DYr5yKqy.js → SaveBlockDialog-DB37Vmqt.js} +5 -5
  70. package/dist/cdn/chunks/{SaveBlockDialog-DYr5yKqy.js.map → SaveBlockDialog-DB37Vmqt.js.map} +1 -1
  71. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BUJjcHkw.js → SavedBlocksBrowserModal-CTU2rGWQ.js} +6 -6
  72. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BUJjcHkw.js.map → SavedBlocksBrowserModal-CTU2rGWQ.js.map} +1 -1
  73. package/dist/cdn/chunks/{SavedBlocksPanels-DFgvmsbj.js → SavedBlocksPanels-B9h9wI6d.js} +2 -2
  74. package/dist/cdn/chunks/{SavedBlocksPanels-DFgvmsbj.js.map → SavedBlocksPanels-B9h9wI6d.js.map} +1 -1
  75. package/dist/cdn/chunks/{SavedBlocksPickBar-Brg8US_n.js → SavedBlocksPickBar-CTY5WZum.js} +3 -3
  76. package/dist/cdn/chunks/{SavedBlocksPickBar-Brg8US_n.js.map → SavedBlocksPickBar-CTY5WZum.js.map} +1 -1
  77. package/dist/cdn/chunks/{TemplateScoringPanel-DO86BvdQ.js → TemplateScoringPanel-DZ0cpe_D.js} +7 -7
  78. package/dist/cdn/chunks/{TemplateScoringPanel-DO86BvdQ.js.map → TemplateScoringPanel-DZ0cpe_D.js.map} +1 -1
  79. package/dist/cdn/chunks/{TestEmailModal-DRCcdGvX.js → TestEmailModal-Dqx1RyDE.js} +6 -6
  80. package/dist/cdn/chunks/{TestEmailModal-DRCcdGvX.js.map → TestEmailModal-Dqx1RyDE.js.map} +1 -1
  81. package/dist/cdn/chunks/{TestEmailPanel-BZU5HX2c.js → TestEmailPanel-DrcQhnON.js} +2 -2
  82. package/dist/cdn/chunks/{TestEmailPanel-BZU5HX2c.js.map → TestEmailPanel-DrcQhnON.js.map} +1 -1
  83. package/dist/cdn/chunks/{TitleEditor-CLkXt5RZ.js → TitleEditor-CSeDvWVn.js} +8 -8
  84. package/dist/cdn/chunks/{TitleEditor-CLkXt5RZ.js.map → TitleEditor-CSeDvWVn.js.map} +1 -1
  85. package/dist/cdn/chunks/{TplModal-BhfPoZ_W.js → TplModal-BNBLwBxJ.js} +2 -2
  86. package/dist/cdn/chunks/{TplModal-BhfPoZ_W.js.map → TplModal-BNBLwBxJ.js.map} +1 -1
  87. package/dist/cdn/chunks/{VersionHistoryMenu-_DyRYBRP.js → VersionHistoryMenu-cZlb0sMi.js} +2 -2
  88. package/dist/cdn/chunks/{VersionHistoryMenu-_DyRYBRP.js.map → VersionHistoryMenu-cZlb0sMi.js.map} +1 -1
  89. package/dist/cdn/chunks/{VersionHistoryPanels-DGfOOcKV.js → VersionHistoryPanels-DgrjTK3z.js} +2 -2
  90. package/dist/cdn/chunks/{VersionHistoryPanels-DGfOOcKV.js.map → VersionHistoryPanels-DgrjTK3z.js.map} +1 -1
  91. package/dist/cdn/chunks/{VersionPreviewBanner-FbBmgknN.js → VersionPreviewBanner-BNq7PRun.js} +2 -2
  92. package/dist/cdn/chunks/{VersionPreviewBanner-FbBmgknN.js.map → VersionPreviewBanner-BNq7PRun.js.map} +1 -1
  93. package/dist/cdn/chunks/{blockTypeIcons-o4ammRlm.js → blockTypeIcons-BNGmmzB_.js} +2 -2
  94. package/dist/cdn/chunks/{blockTypeIcons-o4ammRlm.js.map → blockTypeIcons-BNGmmzB_.js.map} +1 -1
  95. package/dist/cdn/chunks/createCloudRuntime-B_HRgFxU.js +443 -0
  96. package/dist/cdn/chunks/createCloudRuntime-B_HRgFxU.js.map +1 -0
  97. package/dist/cdn/chunks/en-BZlZVGwM.js +2 -0
  98. package/dist/cdn/chunks/{extensions-qSqWdFko.js → extensions-Deqilwp8.js} +3 -3
  99. package/dist/cdn/chunks/{extensions-qSqWdFko.js.map → extensions-Deqilwp8.js.map} +1 -1
  100. package/dist/cdn/chunks/{icons-MeYdeH4P.js → icons-C2kP4vOJ.js} +17 -17
  101. package/dist/cdn/chunks/{icons-MeYdeH4P.js.map → icons-C2kP4vOJ.js.map} +1 -1
  102. package/dist/cdn/chunks/{src-2QDLdUyx.js → src-CgIXdQlX.js} +3 -3
  103. package/dist/cdn/chunks/{src-2QDLdUyx.js.map → src-CgIXdQlX.js.map} +1 -1
  104. package/dist/cdn/chunks/{src-BxHH_6Yr.js → src-CnQgwcsc.js} +2 -2
  105. package/dist/cdn/chunks/{src-BxHH_6Yr.js.map → src-CnQgwcsc.js.map} +1 -1
  106. package/dist/cdn/chunks/{tiptap-DgH_wKK_.js → tiptap-DOw5Yb4H.js} +3276 -3229
  107. package/dist/cdn/chunks/tiptap-DOw5Yb4H.js.map +1 -0
  108. package/dist/cdn/chunks/{useEditorCore-2ZVOY0Rh.js → useEditorCore-Dq5gdn5i.js} +435 -411
  109. package/dist/cdn/chunks/useEditorCore-Dq5gdn5i.js.map +1 -0
  110. package/dist/cdn/editor.css +1 -1
  111. package/dist/cdn/editor.js +1360 -1353
  112. package/dist/cdn/editor.js.map +1 -1
  113. package/dist/{check-CLfibuQc.js → check-Cv96tY88.js} +1 -1
  114. package/dist/{chevron-down-DamTR8ta.js → chevron-down-BwEyjSjd.js} +1 -1
  115. package/dist/{chevron-up-CrV_Ksg-.js → chevron-up-C6Ye-Nzc.js} +1 -1
  116. package/dist/{circle-alert-BLy-e34e.js → circle-alert-BLt_gkcU.js} +1 -1
  117. package/dist/{clock-DQI6aaFT.js → clock-D-2BI0Co.js} +1 -1
  118. package/dist/createCloudRuntime-CWPQ7puE.js +441 -0
  119. package/dist/{createLucideIcon-Cbl3Ma_H.js → createLucideIcon-DGRWivCX.js} +2 -2
  120. package/dist/{dist-CgXIMxZc.js → dist-BG2cHdqw.js} +2 -2
  121. package/dist/{dist-CclsUQ7r.js → dist-BIFUEhwQ.js} +2 -2
  122. package/dist/{dist-DUn6jY0n.js → dist-BUh4MT4D.js} +2111 -2086
  123. package/dist/{dist-7Lr_A7Va.js → dist-BpHkLruF.js} +5 -4
  124. package/dist/{dist-C145btxT.js → dist-BtPhkQ2u.js} +154 -162
  125. package/dist/{dist-CQQNoHxz.js → dist-Btz6cFCI.js} +4 -4
  126. package/dist/dist-CCfNhI54.js +5 -0
  127. package/dist/{dist-D4Jb08yv.js → dist-CHp21juN.js} +2 -2
  128. package/dist/dist-CMcNDUcw.js +5 -0
  129. package/dist/{dist-CLc1cpN2.js → dist-DAR13YWM.js} +6 -5
  130. package/dist/{dist-Dx-KOuOj.js → dist-DQ_4a0hb.js} +2 -2
  131. package/dist/{dist-Dz7KUOSg.js → dist-q3Puexqv.js} +2 -2
  132. package/dist/{extensions-PJK0gLCL.js → extensions-BlYe3NFn.js} +3 -3
  133. package/dist/{image-up-BVOMy_Fs.js → image-up-KRq0lcdU.js} +1 -1
  134. package/dist/index.d.ts +146 -117
  135. package/dist/{info-BKMKasyT.js → info-DbmE2JAo.js} +1 -1
  136. package/dist/{loader-circle-CSGh8n8A.js → loader-circle-dSap9DfQ.js} +1 -1
  137. package/dist/{message-circle-C6q2Fm_W.js → message-circle-qSKKLbac.js} +1 -1
  138. package/dist/{pencil-DaTN0HKw.js → pencil-DMP8vL2F.js} +1 -1
  139. package/dist/{refresh-cw-Cu4wRQwT.js → refresh-cw-WXtBeMva.js} +1 -1
  140. package/dist/{scan-line-O_o657Gv.js → scan-line-BTrngVuN.js} +1 -1
  141. package/dist/{send-GS3soauT.js → send-CLa8Cxmh.js} +1 -1
  142. package/dist/{shield-check-B2TzT3Wp.js → shield-check-42WZrKQu.js} +1 -1
  143. package/dist/{sparkles-CNENcXZl.js → sparkles-DcOb0umz.js} +1 -1
  144. package/dist/style.css +1 -1
  145. package/dist/templatical-editor.js +723 -716
  146. package/dist/{text-align-start-D0-k8RUf.js → text-align-start-zoZhXJ2T.js} +1 -1
  147. package/dist/{trash-2-BE-qGIpG.js → trash-2-Capv4cSE.js} +1 -1
  148. package/dist/{triangle-alert-DNM2_dyh.js → triangle-alert-CnJUGX-6.js} +1 -1
  149. package/dist/{upload-Cv2Jx-yM.js → upload-Bc0ZTywl.js} +1 -1
  150. package/dist/{useEditorCore-DM8vzMZQ.js → useEditorCore-CIjO_NM9.js} +1094 -1072
  151. package/dist/{useScrollToBlock-C2LYXENK.js → useScrollToBlock-C2-9xCr7.js} +1 -1
  152. package/dist/{x-DUPrT6Aa.js → x-CvPZ3OAd.js} +1 -1
  153. package/package.json +22 -22
  154. package/dist/cdn/chunks/createCloudRuntime-C-u7oIGa.js +0 -344
  155. package/dist/cdn/chunks/createCloudRuntime-C-u7oIGa.js.map +0 -1
  156. package/dist/cdn/chunks/en-C6FKrw69.js +0 -2
  157. package/dist/cdn/chunks/tiptap-DgH_wKK_.js.map +0 -1
  158. package/dist/cdn/chunks/useEditorCore-2ZVOY0Rh.js.map +0 -1
  159. package/dist/createCloudRuntime-BrgMP9gS.js +0 -342
  160. package/dist/dist-D-ulkdvF.js +0 -5
  161. package/dist/dist-Kf9u4ULN.js +0 -5
@@ -1,342 +0,0 @@
1
- import { A as e, L as t, X as n, q as r, s as i } from "./vue.runtime.esm-bundler-CdH_W9qX.js";
2
- import { m as a } from "./dist-WE11SQGe.js";
3
- import { t as o } from "./dist-CkSgS-K9.js";
4
- import { R as s, i as c, l, t as u } from "./keys-CAor2T5q.js";
5
- import { t as d } from "./timeouts-DHPZQ0G3.js";
6
- import { t as f } from "./logger-BBlvSn6q.js";
7
- import { t as p } from "./preRenderCustomBlocks-BebjKtmw.js";
8
- import { S as m, _ as h, a as g, b as _, c as v, d as y, h as b, i as ee, l as x, m as te, n as ne, o as S, p as C, r as w, s as re, t as ie, u as ae, v as oe, x as T, y as se } from "./cloud-DXFUA8H_.js";
9
- //#region src/cloud/composables/useCloudFeatureFlags.ts
10
- function ce(e) {
11
- let { planConfigInstance: t, aiConfig: n, getTemplateId: r } = e;
12
- return {
13
- canUseAiGeneration: i(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value),
14
- canSendTestEmail: i(() => t.hasFeature("test_email")),
15
- hasTemplateSaved: i(() => r() !== null),
16
- templateLimit: i(() => t.config.value?.limits.max_templates ?? null),
17
- templateCount: i(() => t.config.value?.template_count ?? 0)
18
- };
19
- }
20
- //#endregion
21
- //#region src/cloud/composables/useCloudMediaLibrary.ts
22
- function E(e) {
23
- let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: i, authManager: a, getMediaConfig: o, onError: s } = e, c = null;
24
- function l(e) {
25
- return {
26
- url: e.url,
27
- alt: e.alt_text || void 0
28
- };
29
- }
30
- async function u(e) {
31
- let r = e?.accept ?? ["images"];
32
- if (e?.files?.length) {
33
- if (t) {
34
- let n = await t({
35
- accept: r,
36
- files: e.files
37
- });
38
- return n ? l(n) : null;
39
- }
40
- return d(e.files[0]);
41
- }
42
- if (t) {
43
- let e = await t({ accept: r });
44
- return e ? l(e) : null;
45
- }
46
- return c &&= (c(null), null), i.value = r, n.value = !0, new Promise((e) => {
47
- c = (t) => {
48
- e(t);
49
- };
50
- });
51
- }
52
- async function d(e) {
53
- let t = f(e);
54
- if (t) return s?.(t), null;
55
- try {
56
- let { MediaApiClient: t } = await import("@templatical/media-library");
57
- return l(await new t(a).uploadMedia(e));
58
- } catch (e) {
59
- return s?.(e), null;
60
- }
61
- }
62
- function f(e) {
63
- let t = o?.() ?? null;
64
- if (!t) return null;
65
- let n = t.categories?.images?.mime_types ?? [];
66
- 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;
67
- }
68
- function p(e) {
69
- n.value = !1, c?.(l(e)), c = null;
70
- }
71
- function m() {
72
- n.value = !1, c?.(null), c = null;
73
- }
74
- return r(() => {
75
- c &&= (c(null), null);
76
- }), {
77
- handleRequestMedia: u,
78
- handleMediaSelect: p,
79
- handleMediaLibraryClose: m
80
- };
81
- }
82
- //#endregion
83
- //#region src/cloud/composables/useCloudPanelState.ts
84
- function D() {
85
- let e = n(null), t = i({
86
- get: () => e.value === "ai-chat",
87
- set: (t) => e.value = t ? "ai-chat" : null
88
- }), r = i({
89
- get: () => e.value === "scoring",
90
- set: (t) => e.value = t ? "scoring" : null
91
- }), a = i({
92
- get: () => e.value === "design-reference",
93
- set: (t) => e.value = t ? "design-reference" : null
94
- }), s = i({
95
- get: () => e.value === "comments",
96
- set: (t) => e.value = t ? "comments" : null
97
- }), c = n(!1), l = n(void 0), u = n(!1), d = n(null), f = i(() => e.value !== null), p = i(() => {
98
- let t = e.value;
99
- return t === "ai-chat" || t === "design-reference" || t === "scoring" ? t : null;
100
- }), m = i(() => u.value || e.value === "ai-chat" || e.value === "design-reference" || e.value === "scoring");
101
- function h() {
102
- u.value = !u.value;
103
- }
104
- function g(t) {
105
- u.value = !1, e.value = e.value === t ? null : t;
106
- }
107
- return o(d, () => {
108
- u.value = !1;
109
- }), {
110
- activePanel: e,
111
- aiChatOpen: t,
112
- scoringPanelOpen: r,
113
- designReferenceOpen: a,
114
- commentsOpen: s,
115
- mediaLibraryOpen: c,
116
- mediaLibraryAccept: l,
117
- aiMenuOpen: u,
118
- aiMenuRef: d,
119
- rightPanelOpen: f,
120
- activeAiFeature: p,
121
- aiButtonActive: m,
122
- toggleAiMenu: h,
123
- handleAiFeatureSelect: g
124
- };
125
- }
126
- //#endregion
127
- //#region src/cloud/composables/useCloudSaveGate.ts
128
- function O(e) {
129
- let t = n(!1), r = null, a = i(() => e.planConfig.value?.accessibility?.blockOnError === !0), o = i(() => a.value ? e.issues.value.filter((e) => e.severity === "error") : []), s = i(() => o.value.length > 0);
130
- async function c(e) {
131
- return s.value ? (r = e, t.value = !0, !1) : (await e(), !0);
132
- }
133
- async function l(e) {
134
- return !s.value && (await e(), !0);
135
- }
136
- async function u() {
137
- let e = r;
138
- r = null, t.value = !1, e && await e();
139
- }
140
- function d() {
141
- r = null, t.value = !1;
142
- }
143
- return {
144
- shouldBlock: s,
145
- blockingIssues: o,
146
- modalOpen: t,
147
- tryRunSave: c,
148
- runUnlessBlocked: l,
149
- confirmAndSave: u,
150
- cancel: d
151
- };
152
- }
153
- //#endregion
154
- //#region src/cloud/composables/useCollabUndoWarning.ts
155
- function le(e) {
156
- let { isCollaborationEnabled: t, getCollaboratorCount: r, canUndo: i } = e, o = n(!1), s = n(!1), { start: c } = a(() => {
157
- s.value = !1;
158
- }, d, { immediate: !1 });
159
- function l() {
160
- o.value || !t.value || r() === 0 || !i.value || (o.value = !0, s.value = !0, c());
161
- }
162
- return {
163
- collabUndoWarningVisible: s,
164
- showCollabUndoWarning: l
165
- };
166
- }
167
- //#endregion
168
- //#region src/cloud/collectSavedBlockIds.ts
169
- function ue(e) {
170
- let t = /* @__PURE__ */ new Set(), n = e?.content?.blocks;
171
- if (!n) return t;
172
- for (let e of n) if (t.add(e.id), e.type === "section" && e.children) for (let n of e.children) for (let e of n) t.add(e.id);
173
- return t;
174
- }
175
- //#endregion
176
- //#region src/cloud/createCloudRuntime.ts
177
- async function k(r) {
178
- let { config: a, cloudTranslations: o } = r, d = null, k = null, A = null, j = null, M = null, N = null, P = null, F = n(null), I = n(/* @__PURE__ */ new Map()), L = n(null);
179
- function R() {
180
- if (!d) throw Error("[Templatical] The Cloud editor is not mounted yet.");
181
- return d;
182
- }
183
- function z() {
184
- return d?.state.template?.id ?? null;
185
- }
186
- let B = new ie({
187
- ...a.auth,
188
- onError: (e) => {
189
- v(e) && (F.value = e), a.onError?.(e);
190
- }
191
- }), V = se({
192
- authManager: B,
193
- onError: a.onError
194
- });
195
- await B.initialize();
196
- let H = await x({ authManager: B });
197
- if (!H.api.ok) throw Error("Health check failed: API is not reachable");
198
- if (!H.auth.ok) throw Error(`Health check failed: authentication error${H.auth.error ? ` - ${H.auth.error}` : ""}`);
199
- H.websocket.ok || f.warn("WebSocket health check failed:", H.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await V.fetchConfig(), F.value = null, a.templates && f.warn("initCloud does not accept a `templates` provider — the template id is the join key for collaboration, version history, comments, AI rewrite, scoring and the server-side export, so an id Cloud never issued would degrade all six. The supplied provider is ignored. Use init() to bring your own."), a.versionHistory && f.warn("initCloud does not accept a `versionHistory` provider — a version is keyed to a template id Cloud issued, so Cloud owns its history. The supplied provider is ignored. Use init() to bring your own."), a.comments && f.warn("initCloud does not accept a `comments` provider — a comment is keyed to a template id Cloud issued, and its author is signed by the auth token, so Cloud owns the conversation. The supplied provider is ignored. Use init() to bring your own."), a.render && f.warn("initCloud does not accept a `render` provider — Cloud renders server-side for test email, sends and exports, so a supplied renderer would change only what you preview and export, never what Cloud delivers. The supplied provider is ignored. For your own MJML, call renderToMjml(editor.getContent()) from @templatical/renderer.");
200
- function U(e) {
201
- let t = V.config.value?.websocket;
202
- !A || !t || A.connect(e.id, y(t));
203
- }
204
- let W = g(B), G = W.create, K = W.save, de = {
205
- load: async (e) => {
206
- let t = await W.load(e);
207
- return U(t), a.onLoad?.(t), t;
208
- },
209
- create: typeof G == "function" ? async (e) => {
210
- let t = await G(e);
211
- return U(t), a.onCreate?.(t), t;
212
- } : !1,
213
- save: typeof K == "function" ? async (e, t) => (k && d && await p(d.content.value, k.registry), K(e, t)) : !1
214
- }, fe = w({
215
- authManager: B,
216
- getTemplateId: z,
217
- save: () => R().save()
218
- }), pe = re(B), me = ne({
219
- authManager: B,
220
- channel: L,
221
- getSocketId: () => A?.getSocketId() ?? null
222
- }), he = B.userConfig ? {
223
- id: B.userConfig.id,
224
- name: B.userConfig.name
225
- } : void 0, q = typeof a.savedBlocks == "object" && a.savedBlocks !== null ? a.savedBlocks : null, J = a.savedBlocks === !1 ? void 0 : q ?? ee(B), Y = T({
226
- authManager: B,
227
- isAuthReady: n(!0)
228
- }), ge = h({ authManager: B }), X = a.testEmail ?? null, _e = X ?? S({
229
- authManager: B,
230
- getTemplateId: z,
231
- save: () => R().save(),
232
- exportHtml: (e) => ge.exportHtml(e, ae(a.fonts)),
233
- allowedEmails: Y.allowedEmails,
234
- getSignature: Y.getSignature,
235
- onBeforeTestEmail: a.onBeforeTestEmail
236
- }), Z = C(a.ai), ve = _({
237
- authManager: B,
238
- getTemplateId: z
239
- }), Q = ce({
240
- planConfigInstance: V,
241
- aiConfig: Z,
242
- getTemplateId: z
243
- }), $ = i(() => !!a.collaboration?.enabled && V.hasFeature("collaboration"));
244
- function ye(n) {
245
- let r = n.editor;
246
- d = r, e(l, o), e(c, B), e(u, Z), e(s, ve);
247
- let i = m({
248
- authManager: B,
249
- onError: a.onError
250
- });
251
- A = i, t(i.channel, (e) => {
252
- L.value = e;
253
- }, { immediate: !0 }), a.mcp?.enabled && oe({
254
- editor: r,
255
- channel: i.channel,
256
- onOperation: a.mcp.onOperation
257
- }), a.collaboration?.enabled && (M = te({
258
- authManager: B,
259
- editor: r,
260
- channel: i.channel,
261
- onError: a.onError,
262
- onCollaboratorJoined: a.collaboration.onCollaboratorJoined,
263
- onCollaboratorLeft: a.collaboration.onCollaboratorLeft,
264
- onBlockLocked: a.collaboration.onBlockLocked,
265
- onBlockUnlocked: a.collaboration.onBlockUnlocked
266
- }), t(() => M.lockedBlocks.value, (e) => {
267
- I.value = e;
268
- }, { immediate: !0 }), b(r, M));
269
- let f = D(), p = E({
270
- onRequestMedia: a.onRequestMedia,
271
- mediaLibraryOpen: f.mediaLibraryOpen,
272
- mediaLibraryAccept: f.mediaLibraryAccept,
273
- authManager: B,
274
- getMediaConfig: () => V.config.value?.media ?? null,
275
- onError: a.onError
276
- });
277
- return j = p, {
278
- websocket: i,
279
- panelState: f,
280
- mediaLib: p,
281
- mediaBrowser: {
282
- authManager: B,
283
- projectId: B.projectId,
284
- planConfig: V
285
- },
286
- featureFlags: Q,
287
- collaboration: M,
288
- isCollaborationEnabled: $
289
- };
290
- }
291
- function be(e) {
292
- let { core: t, capabilities: r } = e;
293
- return k = t, P = O({
294
- issues: t.templateLint ? t.templateLint.issues : n([]),
295
- planConfig: V.config
296
- }), N = le({
297
- isCollaborationEnabled: $,
298
- getCollaboratorCount: () => M?.collaborators.value.length ?? 0,
299
- canUndo: t.history.canUndo
300
- }), r.plan = V, r.ai = Z, a.customBlocks?.length && t.registerCustomBlocks(a.customBlocks), a.theme && (t.themeOverrides.value = a.theme), {
301
- saveGate: P,
302
- collabWarning: N,
303
- sessionError: F,
304
- retry: async () => {
305
- try {
306
- await B.initialize(), F.value = null;
307
- } catch (e) {
308
- F.value = e instanceof Error ? e : /* @__PURE__ */ Error("Authentication failed");
309
- }
310
- }
311
- };
312
- }
313
- return {
314
- runtime: {
315
- lockedBlocks: I,
316
- onRequestMedia: (e) => j ? j.handleRequestMedia(e) : Promise.resolve(null),
317
- isSavedBlocksAvailable: q ? () => !0 : () => a.savedBlocks !== !1 && V.hasFeature("saved_modules"),
318
- isTestEmailAvailable: X ? () => !0 : () => Y.isEnabled.value && Q.canSendTestEmail.value && Q.hasTemplateSaved.value,
319
- isCommentsAvailable: () => a.commenting !== !1 && V.hasFeature("commenting") && Q.hasTemplateSaved.value,
320
- isBlockSaved: (e) => ue(d?.state.template ?? null).has(e),
321
- getSaveGate: () => P,
322
- isRemoteOperation: () => M?._isProcessingRemoteOperation() ?? !1,
323
- onBeforeUndo: () => N?.showCollabUndoWarning(),
324
- attach: ye,
325
- ready: be,
326
- destroy() {
327
- A?.disconnect(), a.onUnmount?.();
328
- }
329
- },
330
- providers: {
331
- templates: de,
332
- render: fe,
333
- versionHistory: pe,
334
- ...J ? { savedBlocks: J } : {},
335
- testEmail: _e,
336
- comments: me
337
- },
338
- user: he
339
- };
340
- }
341
- //#endregion
342
- export { k as bootstrapCloud };
@@ -1,5 +0,0 @@
1
- import { Color as e } from "./dist-CLc1cpN2.js";
2
- //#region ../../node_modules/.pnpm/@tiptap+extension-color@3.30.2_@tiptap+extension-text-style@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__/node_modules/@tiptap/extension-color/dist/index.js
3
- var t = e;
4
- //#endregion
5
- export { e as Color, t as default };
@@ -1,5 +0,0 @@
1
- import { FontFamily as e } from "./dist-CLc1cpN2.js";
2
- //#region ../../node_modules/.pnpm/@tiptap+extension-font-family@3.30.2_@tiptap+extension-text-style@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__/node_modules/@tiptap/extension-font-family/dist/index.js
3
- var t = e;
4
- //#endregion
5
- export { e as FontFamily, t as default };