@templatical/editor 0.26.3 → 0.27.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 (287) hide show
  1. package/README.md +3 -1
  2. package/dist/{AiChatSidebar-CMBz6Wix.js → AiChatSidebar-iVJDzqjr.js} +60 -60
  3. package/dist/AiFeatureMenu-DrLGc2H2.js +57 -0
  4. package/dist/{BlockIssueBadge-Buk3_6QF.js → BlockIssueBadge-BHysq7XQ.js} +11 -11
  5. package/dist/BlockPreviewCanvas-2WASf5A4.js +121 -0
  6. package/dist/CloudHeaderExtras-DWApyc4P.js +59 -0
  7. package/dist/CloudPanels-DvOhGdRj.js +232 -0
  8. package/dist/{CollaboratorBar-BGwbg9aN.js → CollaboratorBar-C6MC0UCk.js} +21 -21
  9. package/dist/ColorPicker-Di8L5TLQ.js +501 -0
  10. package/dist/CommentsPanel-D5wQB1Kf.js +18 -0
  11. package/dist/CommentsSidebar-BoTIxpLE.js +481 -0
  12. package/dist/{cdn/chunks/CountdownBlock-vLTkTI9e.js → CountdownBlock-BFX8iU90.js} +19 -21
  13. package/dist/{cdn/chunks/CountdownToolbar-DPjcgcVR.js → CountdownToolbar-d9QM4m5x.js} +52 -53
  14. package/dist/{DesignReferenceSidebar-Bx96XFmK.js → DesignReferenceSidebar-DKsx2TiL.js} +72 -71
  15. package/dist/{IssuesPanel-Do7RLXsP.js → IssuesPanel-flKKwKpM.js} +38 -38
  16. package/dist/{LoadingTrack-BexpNuTV.js → LoadingTrack-C2T8ixEL.js} +3 -3
  17. package/dist/{MergeTagModeToggle-P-UguQHc.js → MergeTagModeToggle-PKCoKAoF.js} +43 -43
  18. package/dist/{MergeTagSuggestion-BJ43ihWR.js → MergeTagSuggestion-DGha0WRp.js} +46 -46
  19. package/dist/{cdn/chunks/NumberWithSuffix-BXrRdfq1.js → NumberWithSuffix-D9mPtMJB.js} +42 -44
  20. package/dist/{ParagraphEditor-6WN5jmXr.js → ParagraphEditor-iwTjkjtx.js} +200 -198
  21. package/dist/RestoreVersionDialog-DyMPGfsr.js +86 -0
  22. package/dist/{RichTextEditorContent-fbYJXAio.js → RichTextEditorContent-BVXG9oF4.js} +44 -44
  23. package/dist/SaveBlockDialog-BMCAIfK9.js +266 -0
  24. package/dist/{SavedBlocksBrowserModal-GMrajvfV.js → SavedBlocksBrowserModal-p5ma1qay.js} +116 -115
  25. package/dist/{cdn/chunks/SavedBlocksPanels-CUtYoi5Z.js → SavedBlocksPanels-BsiSstsZ.js} +9 -11
  26. package/dist/{SavedBlocksPickBar-Dk_IaMO9.js → SavedBlocksPickBar-fU4Mjm-8.js} +17 -17
  27. package/dist/{TemplateScoringPanel-BZUsb3FD.js → TemplateScoringPanel-Bv_bBsJi.js} +87 -87
  28. package/dist/TestEmailModal-EFYcrmTk.js +206 -0
  29. package/dist/{cdn/chunks/TestEmailPanel-B8y7JabA.js → TestEmailPanel-ljriUqs1.js} +4 -6
  30. package/dist/TitleEditor-BqRW7HTz.js +198 -0
  31. package/dist/TplModal-CTC9-w6B.js +49 -0
  32. package/dist/VersionHistoryMenu-Cq4rH56t.js +155 -0
  33. package/dist/VersionHistoryPanels-GkxkBiSi.js +46 -0
  34. package/dist/VersionPreviewBanner-BdtTu9mI.js +38 -0
  35. package/dist/{blockTypeIcons-C7wRSaT3.js → blockTypeIcons-CIrMr1SJ.js} +6 -6
  36. package/dist/bundle-stats.json +8 -8
  37. package/dist/{ca-D1zgI9fQ.js → ca-CEuJ6IRr.js} +73 -106
  38. package/dist/cdn/chunks/{AiChatSidebar-CQ8KUmNB.js → AiChatSidebar-DTUoBH5a.js} +54 -54
  39. package/dist/cdn/chunks/AiChatSidebar-DTUoBH5a.js.map +1 -0
  40. package/dist/cdn/chunks/AiFeatureMenu-BQz9Kczt.js +57 -0
  41. package/dist/cdn/chunks/AiFeatureMenu-BQz9Kczt.js.map +1 -0
  42. package/dist/cdn/chunks/{BlockIssueBadge-BEEY9o2o.js → BlockIssueBadge-UzSSOM_2.js} +13 -13
  43. package/dist/cdn/chunks/{BlockIssueBadge-BEEY9o2o.js.map → BlockIssueBadge-UzSSOM_2.js.map} +1 -1
  44. package/dist/cdn/chunks/{BlockPreviewCanvas-msj619wT.js → BlockPreviewCanvas-40ocpXDD.js} +42 -42
  45. package/dist/cdn/chunks/{BlockPreviewCanvas-msj619wT.js.map → BlockPreviewCanvas-40ocpXDD.js.map} +1 -1
  46. package/dist/cdn/chunks/CloudHeaderExtras-F_ySlW1S.js +60 -0
  47. package/dist/cdn/chunks/CloudHeaderExtras-F_ySlW1S.js.map +1 -0
  48. package/dist/cdn/chunks/CloudPanels-C34bcHpc.js +232 -0
  49. package/dist/cdn/chunks/CloudPanels-C34bcHpc.js.map +1 -0
  50. package/dist/cdn/chunks/{CollaboratorBar-G_sZDZXw.js → CollaboratorBar-WBtrPPnM.js} +22 -22
  51. package/dist/cdn/chunks/CollaboratorBar-WBtrPPnM.js.map +1 -0
  52. package/dist/cdn/chunks/ColorPicker-CxKYd_8N.js +502 -0
  53. package/dist/cdn/chunks/ColorPicker-CxKYd_8N.js.map +1 -0
  54. package/dist/cdn/chunks/CommentsPanel-jzZ2X0P4.js +20 -0
  55. package/dist/cdn/chunks/CommentsPanel-jzZ2X0P4.js.map +1 -0
  56. package/dist/cdn/chunks/CommentsSidebar-Dxke-vUP.js +460 -0
  57. package/dist/cdn/chunks/CommentsSidebar-Dxke-vUP.js.map +1 -0
  58. package/dist/{CountdownBlock-DuyvGcr8.js → cdn/chunks/CountdownBlock-BYSrJWxg.js} +25 -23
  59. package/dist/cdn/chunks/{CountdownBlock-vLTkTI9e.js.map → CountdownBlock-BYSrJWxg.js.map} +1 -1
  60. package/dist/{CountdownToolbar-CBE9wRaV.js → cdn/chunks/CountdownToolbar-pVbkPNVo.js} +66 -63
  61. package/dist/cdn/chunks/{CountdownToolbar-DPjcgcVR.js.map → CountdownToolbar-pVbkPNVo.js.map} +1 -1
  62. package/dist/cdn/chunks/{DesignReferenceSidebar-B-HFXV0W.js → DesignReferenceSidebar-sZWciECR.js} +64 -64
  63. package/dist/cdn/chunks/DesignReferenceSidebar-sZWciECR.js.map +1 -0
  64. package/dist/cdn/chunks/{IssuesPanel-DKTS4QVb.js → IssuesPanel-CHtetM9i.js} +36 -36
  65. package/dist/cdn/chunks/IssuesPanel-CHtetM9i.js.map +1 -0
  66. package/dist/cdn/chunks/{LoadingTrack-C52ZGL5q.js → LoadingTrack-Dp_QZvAK.js} +3 -3
  67. package/dist/cdn/chunks/{LoadingTrack-C52ZGL5q.js.map → LoadingTrack-Dp_QZvAK.js.map} +1 -1
  68. package/dist/cdn/chunks/{MergeTagModeToggle-DQ79SqQc.js → MergeTagModeToggle-ZwW-5EeN.js} +39 -39
  69. package/dist/cdn/chunks/{MergeTagModeToggle-DQ79SqQc.js.map → MergeTagModeToggle-ZwW-5EeN.js.map} +1 -1
  70. package/dist/cdn/chunks/{MergeTagSuggestion-Dn8dExNa.js → MergeTagSuggestion-DhllqTA3.js} +47 -47
  71. package/dist/cdn/chunks/MergeTagSuggestion-DhllqTA3.js.map +1 -0
  72. package/dist/{NumberWithSuffix-D37ZWiZh.js → cdn/chunks/NumberWithSuffix-mm6AfIv4.js} +37 -35
  73. package/dist/cdn/chunks/NumberWithSuffix-mm6AfIv4.js.map +1 -0
  74. package/dist/cdn/chunks/{ParagraphEditor-CZ5Z6AgG.js → ParagraphEditor-BBcIQQK2.js} +234 -233
  75. package/dist/cdn/chunks/ParagraphEditor-BBcIQQK2.js.map +1 -0
  76. package/dist/cdn/chunks/RestoreVersionDialog-DNUZHFa_.js +87 -0
  77. package/dist/cdn/chunks/RestoreVersionDialog-DNUZHFa_.js.map +1 -0
  78. package/dist/cdn/chunks/{RichTextEditorContent-DtL49Jpo.js → RichTextEditorContent-Cl-acKAD.js} +44 -44
  79. package/dist/cdn/chunks/RichTextEditorContent-Cl-acKAD.js.map +1 -0
  80. package/dist/cdn/chunks/SaveBlockDialog-BXTZ729e.js +265 -0
  81. package/dist/cdn/chunks/SaveBlockDialog-BXTZ729e.js.map +1 -0
  82. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BkQXEUE2.js → SavedBlocksBrowserModal-BqGNBpRR.js} +114 -113
  83. package/dist/cdn/chunks/SavedBlocksBrowserModal-BqGNBpRR.js.map +1 -0
  84. package/dist/{SavedBlocksPanels-DEPmNhi6.js → cdn/chunks/SavedBlocksPanels-nbK0UQTp.js} +11 -9
  85. package/dist/cdn/chunks/{SavedBlocksPanels-CUtYoi5Z.js.map → SavedBlocksPanels-nbK0UQTp.js.map} +1 -1
  86. package/dist/cdn/chunks/{SavedBlocksPickBar-C80qJykl.js → SavedBlocksPickBar-B9mbw3Gk.js} +17 -17
  87. package/dist/cdn/chunks/SavedBlocksPickBar-B9mbw3Gk.js.map +1 -0
  88. package/dist/cdn/chunks/{TemplateScoringPanel-NucRtAP0.js → TemplateScoringPanel-Xdkp2EMY.js} +81 -81
  89. package/dist/cdn/chunks/TemplateScoringPanel-Xdkp2EMY.js.map +1 -0
  90. package/dist/cdn/chunks/TestEmailModal-DE6fi3he.js +206 -0
  91. package/dist/cdn/chunks/TestEmailModal-DE6fi3he.js.map +1 -0
  92. package/dist/{TestEmailPanel-DubocPxf.js → cdn/chunks/TestEmailPanel-CAjQDXle.js} +6 -4
  93. package/dist/cdn/chunks/{TestEmailPanel-B8y7JabA.js.map → TestEmailPanel-CAjQDXle.js.map} +1 -1
  94. package/dist/cdn/chunks/{TitleEditor-C8WDXf4P.js → TitleEditor-BP0ewaWF.js} +83 -83
  95. package/dist/cdn/chunks/TitleEditor-BP0ewaWF.js.map +1 -0
  96. package/dist/cdn/chunks/TplModal-C4kJduTr.js +50 -0
  97. package/dist/cdn/chunks/TplModal-C4kJduTr.js.map +1 -0
  98. package/dist/cdn/chunks/VersionHistoryMenu-_MAj3qZj.js +148 -0
  99. package/dist/cdn/chunks/VersionHistoryMenu-_MAj3qZj.js.map +1 -0
  100. package/dist/cdn/chunks/VersionHistoryPanels-DMq2PRee.js +48 -0
  101. package/dist/cdn/chunks/VersionHistoryPanels-DMq2PRee.js.map +1 -0
  102. package/dist/cdn/chunks/VersionPreviewBanner-04CL1SGY.js +40 -0
  103. package/dist/cdn/chunks/VersionPreviewBanner-04CL1SGY.js.map +1 -0
  104. package/dist/cdn/chunks/{blockTypeIcons-FXlMM3PL.js → blockTypeIcons-hX_W4dqo.js} +2 -2
  105. package/dist/cdn/chunks/{blockTypeIcons-FXlMM3PL.js.map → blockTypeIcons-hX_W4dqo.js.map} +1 -1
  106. package/dist/cdn/chunks/{ca-D1zgI9fQ.js → ca-CEuJ6IRr.js} +74 -107
  107. package/dist/cdn/chunks/ca-CEuJ6IRr.js.map +1 -0
  108. package/dist/{cloud-qINCmQbn.js → cdn/chunks/cloud-BA0OpRh-.js} +400 -609
  109. package/dist/cdn/chunks/cloud-BA0OpRh-.js.map +1 -0
  110. package/dist/cdn/chunks/createCloudRuntime-gXA8_QRU.js +344 -0
  111. package/dist/cdn/chunks/createCloudRuntime-gXA8_QRU.js.map +1 -0
  112. package/dist/{de-uVoSP1xF.js → cdn/chunks/de-BytZwgn6.js} +4 -88
  113. package/dist/cdn/chunks/de-BytZwgn6.js.map +1 -0
  114. package/dist/{de-DHra3lvx.js → cdn/chunks/de-aRxhZF_K.js} +75 -106
  115. package/dist/cdn/chunks/de-aRxhZF_K.js.map +1 -0
  116. package/dist/cdn/chunks/{dist-B2HKGHnc.js → dist-CM8TB0VD.js} +136 -136
  117. package/dist/cdn/chunks/{dist-B2HKGHnc.js.map → dist-CM8TB0VD.js.map} +1 -1
  118. package/dist/cdn/chunks/{dist-C6z8AjBC.js → dist-CYLJiSiH.js} +63 -63
  119. package/dist/cdn/chunks/{dist-C6z8AjBC.js.map → dist-CYLJiSiH.js.map} +1 -1
  120. package/dist/cdn/chunks/{draggable-DCs9qL-b.js → draggable-BfpsXFg7.js} +916 -905
  121. package/dist/cdn/chunks/{draggable-DCs9qL-b.js.map → draggable-BfpsXFg7.js.map} +1 -1
  122. package/dist/cdn/chunks/{en-DE_y1YWU.js → en-BCgVx9zM.js} +4 -3
  123. package/dist/cdn/chunks/{en-DE_y1YWU.js.map → en-BCgVx9zM.js.map} +1 -1
  124. package/dist/{en-DlqX2YWZ.js → cdn/chunks/en-BX4V_7YO.js} +75 -106
  125. package/dist/cdn/chunks/en-BX4V_7YO.js.map +1 -0
  126. package/dist/{en-CjhsJxb-.js → cdn/chunks/en-DyOSV0lY.js} +4 -88
  127. package/dist/cdn/chunks/en-DyOSV0lY.js.map +1 -0
  128. package/dist/{es-Cuss2snv.js → cdn/chunks/es-CA9uQ-5x.js} +75 -106
  129. package/dist/cdn/chunks/es-CA9uQ-5x.js.map +1 -0
  130. package/dist/cdn/chunks/{extensions-qhcN3RMT.js → extensions-CMcVw2uu.js} +53 -53
  131. package/dist/cdn/chunks/{extensions-qhcN3RMT.js.map → extensions-CMcVw2uu.js.map} +1 -1
  132. package/dist/{fr-Cm85vB2g.js → cdn/chunks/fr-iBuE60Ap.js} +75 -106
  133. package/dist/cdn/chunks/fr-iBuE60Ap.js.map +1 -0
  134. package/dist/cdn/chunks/{icons-CvYN6zrM.js → icons-C36Ha5VU.js} +11 -11
  135. package/dist/cdn/chunks/{icons-CvYN6zrM.js.map → icons-C36Ha5VU.js.map} +1 -1
  136. package/dist/{keys-fwF3qZax.js → cdn/chunks/keys-CbQuRX85.js} +6 -4
  137. package/dist/cdn/chunks/keys-CbQuRX85.js.map +1 -0
  138. package/dist/cdn/chunks/logger-ByvdoAwq.js +23 -0
  139. package/dist/cdn/chunks/logger-ByvdoAwq.js.map +1 -0
  140. package/dist/{nl-dmiIX7oT.js → cdn/chunks/nl-Btw4ojNo.js} +75 -106
  141. package/dist/cdn/chunks/nl-Btw4ojNo.js.map +1 -0
  142. package/dist/cdn/chunks/preRenderCustomBlocks-CbA3RcAy.js +23 -0
  143. package/dist/cdn/chunks/preRenderCustomBlocks-CbA3RcAy.js.map +1 -0
  144. package/dist/{pt-BR-CTzHTqJD.js → cdn/chunks/pt-BR-C1WLSGDh.js} +4 -88
  145. package/dist/cdn/chunks/pt-BR-C1WLSGDh.js.map +1 -0
  146. package/dist/{pt-BR-CaIG-7EM.js → cdn/chunks/pt-BR-GjVsCqbN.js} +75 -106
  147. package/dist/cdn/chunks/pt-BR-GjVsCqbN.js.map +1 -0
  148. package/dist/cdn/chunks/src-B_QJduQD.js.map +1 -1
  149. package/dist/cdn/chunks/{src-xkGep9eN.js → src-CoHDh8Ua.js} +1485 -1483
  150. package/dist/cdn/chunks/src-CoHDh8Ua.js.map +1 -0
  151. package/dist/cdn/chunks/{src-BwbnXShT.js → src-Ct4Fsx3t.js} +148 -134
  152. package/dist/cdn/chunks/src-Ct4Fsx3t.js.map +1 -0
  153. package/dist/cdn/chunks/styleConstants-9oK5kn21.js +59 -0
  154. package/dist/cdn/chunks/styleConstants-9oK5kn21.js.map +1 -0
  155. package/dist/cdn/chunks/timeouts-DHPZQ0G3.js +6 -0
  156. package/dist/cdn/chunks/timeouts-DHPZQ0G3.js.map +1 -0
  157. package/dist/cdn/chunks/{tiptap-C44S1Cmh.js → tiptap-DmpGap5g.js} +40 -40
  158. package/dist/cdn/chunks/{tiptap-C44S1Cmh.js.map → tiptap-DmpGap5g.js.map} +1 -1
  159. package/dist/cdn/chunks/{useAliveFlag-Dxwgo6P4.js → useAliveFlag-Dtm174fG.js} +2 -2
  160. package/dist/cdn/chunks/{useAliveFlag-Dxwgo6P4.js.map → useAliveFlag-Dtm174fG.js.map} +1 -1
  161. package/dist/cdn/chunks/{useCloudI18n-8wkJtuJD.js → useCloudI18n-NVa1aeY8.js} +5 -5
  162. package/dist/cdn/chunks/{useCloudI18n-8wkJtuJD.js.map → useCloudI18n-NVa1aeY8.js.map} +1 -1
  163. package/dist/cdn/chunks/{useEditorCore-CcgxY-Gy.js → useEditorCore-DC8gmfs6.js} +1434 -1147
  164. package/dist/cdn/chunks/useEditorCore-DC8gmfs6.js.map +1 -0
  165. package/dist/cdn/chunks/{useI18n-UMs0F71x.js → useI18n-DVWCJJFH.js} +5 -5
  166. package/dist/cdn/chunks/{useI18n-UMs0F71x.js.map → useI18n-DVWCJJFH.js.map} +1 -1
  167. package/dist/cdn/chunks/{useMergeTag-JmXOtpln.js → useMergeTag-BfZBRPQp.js} +4 -4
  168. package/dist/cdn/chunks/{useMergeTag-JmXOtpln.js.map → useMergeTag-BfZBRPQp.js.map} +1 -1
  169. package/dist/cdn/chunks/{usePopoverPosition-cf8Y-ynK.js → usePopoverPosition-BC-HA7TK.js} +3 -3
  170. package/dist/cdn/chunks/{usePopoverPosition-cf8Y-ynK.js.map → usePopoverPosition-BC-HA7TK.js.map} +1 -1
  171. package/dist/cdn/editor.css +1 -1
  172. package/dist/cdn/editor.js +5119 -284
  173. package/dist/cdn/editor.js.map +1 -1
  174. package/dist/{check-On4TSac-.js → check-DZbmkMQe.js} +1 -1
  175. package/dist/{chevron-down-69EiBGoB.js → chevron-down-nYScOLeZ.js} +1 -1
  176. package/dist/{chevron-up-Dh3MG1Dw.js → chevron-up-CpYpDLnc.js} +1 -1
  177. package/dist/{circle-alert-cilwzafX.js → circle-alert-CuuK6thq.js} +1 -1
  178. package/dist/{clock-Dt0APH92.js → clock-DxkrtqOr.js} +1 -1
  179. package/dist/cloud-BAefVBb_.js +1444 -0
  180. package/dist/createCloudRuntime-Bt8W-ajI.js +342 -0
  181. package/dist/{createLucideIcon-C8WzBYCv.js → createLucideIcon-L-wQXW_R.js} +9 -9
  182. package/dist/{cdn/chunks/de-uVoSP1xF.js → de-BytZwgn6.js} +2 -90
  183. package/dist/{cdn/chunks/de-DHra3lvx.js → de-aRxhZF_K.js} +73 -108
  184. package/dist/dist-B5iReTtK.js +251 -0
  185. package/dist/{dist-Cl8J0IES.js → dist-Ck9roB6K.js} +42 -42
  186. package/dist/{dist-BpKxrUi2.js → dist-CqcGTIiX.js} +46 -46
  187. package/dist/{cdn/chunks/en-DlqX2YWZ.js → en-BX4V_7YO.js} +73 -108
  188. package/dist/{cdn/chunks/en-CjhsJxb-.js → en-DyOSV0lY.js} +2 -90
  189. package/dist/{cdn/chunks/es-Cuss2snv.js → es-CA9uQ-5x.js} +73 -108
  190. package/dist/{extensions-Cwg9S-0f.js → extensions-CX87G4aL.js} +42 -42
  191. package/dist/{cdn/chunks/fr-Cm85vB2g.js → fr-iBuE60Ap.js} +73 -108
  192. package/dist/{image-up-Ceggh_R3.js → image-up-DouZRGVt.js} +1 -1
  193. package/dist/index.d.ts +499 -23
  194. package/dist/{info-DO5odBcZ.js → info-puX5V6Iq.js} +1 -1
  195. package/dist/{cdn/chunks/keys-Cmc2Yl3D.js → keys-BxixS0TN.js} +4 -6
  196. package/dist/{list-checks-BSkPKbuI.js → list-checks-jw-ZlvWY.js} +1 -1
  197. package/dist/{loader-circle-bO7o7_HD.js → loader-circle-DqTxB7Kr.js} +1 -1
  198. package/dist/logger-BBlvSn6q.js +21 -0
  199. package/dist/{message-circle-BEkAk65X.js → message-circle-BZ7YpB22.js} +1 -1
  200. package/dist/{cdn/chunks/nl-dmiIX7oT.js → nl-Btw4ojNo.js} +73 -108
  201. package/dist/{pencil-t6m0EtKL.js → pencil-DmbRhTJu.js} +1 -1
  202. package/dist/preRenderCustomBlocks-BebjKtmw.js +21 -0
  203. package/dist/{cdn/chunks/pt-BR-CTzHTqJD.js → pt-BR-C1WLSGDh.js} +2 -90
  204. package/dist/{cdn/chunks/pt-BR-CaIG-7EM.js → pt-BR-GjVsCqbN.js} +73 -108
  205. package/dist/{refresh-cw-CkOYVzK5.js → refresh-cw-OK_O-cL0.js} +1 -1
  206. package/dist/{runtime-dom.esm-bundler-CepEmvwF.js → runtime-dom.esm-bundler-BgKXIPLV.js} +144 -144
  207. package/dist/{scan-line-DwSVj25O.js → scan-line-DyaSTsJ5.js} +1 -1
  208. package/dist/{send-CWsWN8PQ.js → send-B-wasJJC.js} +1 -1
  209. package/dist/{shield-check-qje8Kufw.js → shield-check-DUIyRrTo.js} +1 -1
  210. package/dist/{sparkles-DumaWRW-.js → sparkles-DYEMATWC.js} +1 -1
  211. package/dist/style.css +1 -1
  212. package/dist/styleConstants-9oK5kn21.js +57 -0
  213. package/dist/templatical-editor.js +5319 -289
  214. package/dist/{text-align-start-Ir8Ah4mT.js → text-align-start-CzjLeBLe.js} +1 -1
  215. package/dist/timeouts-DHPZQ0G3.js +4 -0
  216. package/dist/{trash-2-CklAFCmO.js → trash-2-C0shEPry.js} +1 -1
  217. package/dist/{triangle-alert-BBi4n93g.js → triangle-alert-Fw0ce8oQ.js} +1 -1
  218. package/dist/{upload-sVqqppuv.js → upload-D69C2CBx.js} +3 -4
  219. package/dist/{useAliveFlag-cvyBxHp7.js → useAliveFlag-BGIAZii_.js} +1 -1
  220. package/dist/{useCloudI18n-DKVm6PCa.js → useCloudI18n-CAZTZ9_a.js} +2 -2
  221. package/dist/{useEditorCore-P4UkhcyS.js → useEditorCore-CFLzobo_.js} +1604 -1320
  222. package/dist/{useI18n-DoVKdCTH.js → useI18n-BfXff_Sy.js} +2 -2
  223. package/dist/{useMergeTag-CYZk7dZD.js → useMergeTag-Dd4I7kge.js} +3 -3
  224. package/dist/usePopoverPosition-CxhCX3SQ.js +59 -0
  225. package/dist/{vue.runtime.esm-bundler-D1diBMsm.js → vue.runtime.esm-bundler-DzEsDRtY.js} +447 -436
  226. package/dist/{x-Mby7KlhS.js → x-BjTlFqRv.js} +1 -1
  227. package/package.json +8 -8
  228. package/dist/AiFeatureMenu-Cy-PVrNT.js +0 -63
  229. package/dist/BlockPreviewCanvas-BZKslwGI.js +0 -121
  230. package/dist/CloudEditor-CPRkQCRa.js +0 -1188
  231. package/dist/ColorPicker-ClETsjA3.js +0 -550
  232. package/dist/CommentsSidebar-CdRCCSDD.js +0 -435
  233. package/dist/SaveBlockDialog-21vDlEBS.js +0 -265
  234. package/dist/SnapshotHistory-Cb4WW2gf.js +0 -128
  235. package/dist/TestEmailModal-BHDKmd6B.js +0 -205
  236. package/dist/TitleEditor-Cy4B3UNe.js +0 -198
  237. package/dist/TplModal-Dv9zgSWI.js +0 -49
  238. package/dist/cdn/chunks/AiChatSidebar-CQ8KUmNB.js.map +0 -1
  239. package/dist/cdn/chunks/AiFeatureMenu-Cb9gaRBn.js +0 -63
  240. package/dist/cdn/chunks/AiFeatureMenu-Cb9gaRBn.js.map +0 -1
  241. package/dist/cdn/chunks/CloudEditor-DbyEsIxu.js +0 -1166
  242. package/dist/cdn/chunks/CloudEditor-DbyEsIxu.js.map +0 -1
  243. package/dist/cdn/chunks/CollaboratorBar-G_sZDZXw.js.map +0 -1
  244. package/dist/cdn/chunks/ColorPicker-W_UyiVGc.js +0 -552
  245. package/dist/cdn/chunks/ColorPicker-W_UyiVGc.js.map +0 -1
  246. package/dist/cdn/chunks/CommentsSidebar-BLRZRSSC.js +0 -412
  247. package/dist/cdn/chunks/CommentsSidebar-BLRZRSSC.js.map +0 -1
  248. package/dist/cdn/chunks/DesignReferenceSidebar-B-HFXV0W.js.map +0 -1
  249. package/dist/cdn/chunks/IssuesPanel-DKTS4QVb.js.map +0 -1
  250. package/dist/cdn/chunks/MergeTagSuggestion-Dn8dExNa.js.map +0 -1
  251. package/dist/cdn/chunks/NumberWithSuffix-BXrRdfq1.js.map +0 -1
  252. package/dist/cdn/chunks/ParagraphEditor-CZ5Z6AgG.js.map +0 -1
  253. package/dist/cdn/chunks/RichTextEditorContent-DtL49Jpo.js.map +0 -1
  254. package/dist/cdn/chunks/SaveBlockDialog-CVIVZEuy.js +0 -264
  255. package/dist/cdn/chunks/SaveBlockDialog-CVIVZEuy.js.map +0 -1
  256. package/dist/cdn/chunks/SavedBlocksBrowserModal-BkQXEUE2.js.map +0 -1
  257. package/dist/cdn/chunks/SavedBlocksPickBar-C80qJykl.js.map +0 -1
  258. package/dist/cdn/chunks/SnapshotHistory-DFinMrg_.js +0 -121
  259. package/dist/cdn/chunks/SnapshotHistory-DFinMrg_.js.map +0 -1
  260. package/dist/cdn/chunks/TemplateScoringPanel-NucRtAP0.js.map +0 -1
  261. package/dist/cdn/chunks/TestEmailModal-IxS-QjeH.js +0 -205
  262. package/dist/cdn/chunks/TestEmailModal-IxS-QjeH.js.map +0 -1
  263. package/dist/cdn/chunks/TitleEditor-C8WDXf4P.js.map +0 -1
  264. package/dist/cdn/chunks/TplModal-Ce0QuHyo.js +0 -50
  265. package/dist/cdn/chunks/TplModal-Ce0QuHyo.js.map +0 -1
  266. package/dist/cdn/chunks/ca-D1zgI9fQ.js.map +0 -1
  267. package/dist/cdn/chunks/cloud-DcC8bPwn.js +0 -1787
  268. package/dist/cdn/chunks/cloud-DcC8bPwn.js.map +0 -1
  269. package/dist/cdn/chunks/de-DHra3lvx.js.map +0 -1
  270. package/dist/cdn/chunks/de-uVoSP1xF.js.map +0 -1
  271. package/dist/cdn/chunks/en-CjhsJxb-.js.map +0 -1
  272. package/dist/cdn/chunks/en-DlqX2YWZ.js.map +0 -1
  273. package/dist/cdn/chunks/es-Cuss2snv.js.map +0 -1
  274. package/dist/cdn/chunks/fr-Cm85vB2g.js.map +0 -1
  275. package/dist/cdn/chunks/keys-Cmc2Yl3D.js.map +0 -1
  276. package/dist/cdn/chunks/nl-dmiIX7oT.js.map +0 -1
  277. package/dist/cdn/chunks/pt-BR-CTzHTqJD.js.map +0 -1
  278. package/dist/cdn/chunks/pt-BR-CaIG-7EM.js.map +0 -1
  279. package/dist/cdn/chunks/src-BwbnXShT.js.map +0 -1
  280. package/dist/cdn/chunks/src-xkGep9eN.js.map +0 -1
  281. package/dist/cdn/chunks/styles-DLAfU4Uf.js +0 -4140
  282. package/dist/cdn/chunks/styles-DLAfU4Uf.js.map +0 -1
  283. package/dist/cdn/chunks/timeouts-SsLMC4a3.js +0 -6
  284. package/dist/cdn/chunks/timeouts-SsLMC4a3.js.map +0 -1
  285. package/dist/cdn/chunks/useEditorCore-CcgxY-Gy.js.map +0 -1
  286. package/dist/styles-Dx__pP9O.js +0 -4318
  287. package/dist/usePopoverPosition-C0dPEF4X.js +0 -308
@@ -1,1188 +0,0 @@
1
- import { A as e, D as t, Dt as n, E as r, Et as i, I as a, K as o, O as s, Ot as c, R as l, Y as u, Z as d, _ as f, c as p, d as m, g as h, h as g, k as _, l as v, m as y, nt as b, p as x, r as S, s as C, u as w, z as T } from "./vue.runtime.esm-bundler-D1diBMsm.js";
2
- import { c as E, o as D, t as O } from "./runtime-dom.esm-bundler-CepEmvwF.js";
3
- import { n as k } from "./upload-sVqqppuv.js";
4
- import { M as A } from "./dist-B1kLn1rs.js";
5
- import { E as j, V as M, t as N, x as P } from "./useEditorCore-P4UkhcyS.js";
6
- import { m as F } from "./dist-BpKxrUi2.js";
7
- import { s as I } from "./usePopoverPosition-C0dPEF4X.js";
8
- import { M as L, c as ee, d as R, i as z, l as B, t as V, z as te } from "./keys-fwF3qZax.js";
9
- import { t as H } from "./useI18n-DoVKdCTH.js";
10
- import { t as U } from "./createLucideIcon-C8WzBYCv.js";
11
- import { t as W } from "./check-On4TSac-.js";
12
- import { t as G } from "./circle-alert-cilwzafX.js";
13
- import { a as K, c as ne, d as q, f as re, h as ie, i as J, l as ae, m as oe, n as se, o as ce, p as le, r as ue, s as de, t as fe, u as pe } from "./styles-Dx__pP9O.js";
14
- import { t as me } from "./clock-Dt0APH92.js";
15
- import { t as Y } from "./loader-circle-bO7o7_HD.js";
16
- import { t as X } from "./message-circle-BEkAk65X.js";
17
- import { n as Z, t as he } from "./MergeTagModeToggle-P-UguQHc.js";
18
- import { t as ge } from "./send-CWsWN8PQ.js";
19
- import { t as _e } from "./sparkles-DumaWRW-.js";
20
- import { t as ve } from "./triangle-alert-BBi4n93g.js";
21
- import { t as ye } from "./_plugin-vue_export-helper-B3ysoDQm.js";
22
- import { n as Q } from "./useCloudI18n-DKVm6PCa.js";
23
- import { d as $ } from "./ColorPicker-ClETsjA3.js";
24
- import { _ as be, a as xe, b as Se, c as Ce, d as we, g as Te, h as Ee, i as De, l as Oe, m as ke, n as Ae, p as je, r as Me, s as Ne, t as Pe, u as Fe, v as Ie, y as Le } from "./cloud-qINCmQbn.js";
25
- var Re = U("save", [
26
- ["path", {
27
- 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",
28
- key: "1c8476"
29
- }],
30
- ["path", {
31
- d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",
32
- key: "1ydtos"
33
- }],
34
- ["path", {
35
- d: "M7 3v4a1 1 0 0 0 1 1h7",
36
- key: "t51u73"
37
- }]
38
- ]);
39
- //#endregion
40
- //#region src/cloud/composables/useSnapshotPreview.ts
41
- function ze(e) {
42
- let { authManager: t, editor: n, history: r, conditionPreview: i, autoSave: a, onError: s } = e, c = d(null), l = u(null), f = u(null), p = !1;
43
- o(() => {
44
- p = !0;
45
- });
46
- let m = C(() => l.value !== null), h = C(() => c.value?.snapshots.value ?? []), g = C(() => c.value?.isLoading.value ?? !1), _ = C(() => c.value?.isRestoring.value ?? !1);
47
- function v() {
48
- n.state.template?.id && !c.value && (c.value = be({
49
- authManager: t,
50
- templateId: n.state.template.id,
51
- onRestore: y,
52
- onError: s
53
- }), c.value.loadSnapshots());
54
- }
55
- function y(e) {
56
- n.setContent(e.content, !1), r.clear(), i.reset();
57
- }
58
- async function b(e) {
59
- if (!p) {
60
- if (l.value) {
61
- l.value = e, n.setContent(e.content, !1);
62
- return;
63
- }
64
- n.state.isDirty && n.hasTemplate() && (await n.createSnapshot(), p) || (f.value = structuredClone(n.content.value), a?.pause(), l.value = e, n.setContent(e.content, !1));
65
- }
66
- }
67
- async function x() {
68
- if (!(!l.value || !c.value)) try {
69
- if (await c.value.restoreSnapshot(l.value.id), p || (await c.value.loadSnapshots(), p)) return;
70
- } catch (e) {
71
- throw !p && f.value && n.setContent(f.value, !1), e;
72
- } finally {
73
- p || (l.value = null, f.value = null, a?.resume());
74
- }
75
- }
76
- function S() {
77
- !l.value || !f.value || (n.setContent(f.value, !1), l.value = null, f.value = null, a?.resume());
78
- }
79
- async function w() {
80
- p || c.value && await c.value.loadSnapshots();
81
- }
82
- return {
83
- snapshotHistoryInstance: c,
84
- previewingSnapshot: l,
85
- contentBeforePreview: f,
86
- isPreviewingSnapshot: m,
87
- snapshotHistorySnapshots: h,
88
- snapshotHistoryIsLoading: g,
89
- snapshotHistoryIsRestoring: _,
90
- initSnapshotHistory: v,
91
- handleRestore: y,
92
- handleSnapshotNavigate: b,
93
- confirmRestoreSnapshot: x,
94
- cancelPreview: S,
95
- loadSnapshotHistory: w
96
- };
97
- }
98
- //#endregion
99
- //#region src/cloud/composables/useCloudPanelState.ts
100
- function Be() {
101
- let e = u(null), t = C({
102
- get: () => e.value === "ai-chat",
103
- set: (t) => e.value = t ? "ai-chat" : null
104
- }), n = C({
105
- get: () => e.value === "scoring",
106
- set: (t) => e.value = t ? "scoring" : null
107
- }), r = C({
108
- get: () => e.value === "design-reference",
109
- set: (t) => e.value = t ? "design-reference" : null
110
- }), i = C({
111
- get: () => e.value === "comments",
112
- set: (t) => e.value = t ? "comments" : null
113
- }), a = u(!1), o = u(void 0), s = u(!1), c = u(null), l = C(() => e.value !== null), d = C(() => {
114
- let t = e.value;
115
- return t === "ai-chat" || t === "design-reference" || t === "scoring" ? t : null;
116
- }), f = C(() => s.value || e.value === "ai-chat" || e.value === "design-reference" || e.value === "scoring");
117
- function p() {
118
- s.value = !s.value;
119
- }
120
- function m(t) {
121
- s.value = !1, e.value = e.value === t ? null : t;
122
- }
123
- return I(c, () => {
124
- s.value = !1;
125
- }), {
126
- activePanel: e,
127
- aiChatOpen: t,
128
- scoringPanelOpen: n,
129
- designReferenceOpen: r,
130
- commentsOpen: i,
131
- mediaLibraryOpen: a,
132
- mediaLibraryAccept: o,
133
- aiMenuOpen: s,
134
- aiMenuRef: c,
135
- rightPanelOpen: l,
136
- activeAiFeature: d,
137
- aiButtonActive: f,
138
- toggleAiMenu: p,
139
- handleAiFeatureSelect: m
140
- };
141
- }
142
- //#endregion
143
- //#region src/cloud/composables/useCollabUndoWarning.ts
144
- function Ve(e) {
145
- let { isCollaborationEnabled: t, getCollaboratorCount: n, canUndo: r } = e, i = u(!1), a = u(!1), { start: o } = F(() => {
146
- a.value = !1;
147
- }, k, { immediate: !1 });
148
- function s() {
149
- i.value || !t.value || n() === 0 || !r.value || (i.value = !0, a.value = !0, o());
150
- }
151
- return {
152
- collabUndoWarningVisible: a,
153
- showCollabUndoWarning: s
154
- };
155
- }
156
- //#endregion
157
- //#region src/cloud/composables/useCloudFeatureFlags.ts
158
- function He(e) {
159
- let { planConfigInstance: t, aiConfig: n, editor: r } = e, i = C(() => t.hasFeature("ai_generation") && n.hasAnyMenuFeature.value), a = C(() => t.hasFeature("test_email")), o = C(() => !!r.state.template?.id), s = C(() => t.hasFeature("white_label")), c = C(() => t.config.value?.limits.max_templates ?? null), l = C(() => t.config.value?.template_count ?? 0), d = u(!1), f = u("idle"), p = u(""), { start: m } = F(() => {
160
- f.value = "idle";
161
- }, 3e3, { immediate: !1 });
162
- return {
163
- canUseAiGeneration: i,
164
- canSendTestEmail: a,
165
- hasTemplateSaved: o,
166
- isWhiteLabeled: s,
167
- templateLimit: c,
168
- templateCount: l,
169
- isSaveExporting: d,
170
- saveStatus: f,
171
- saveErrorMessage: p,
172
- startSaveStatusClear: m
173
- };
174
- }
175
- //#endregion
176
- //#region src/cloud/composables/useCloudMediaLibrary.ts
177
- function Ue(e) {
178
- let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r, authManager: i, getMediaConfig: a, onError: s } = e, c = null;
179
- function l(e) {
180
- return {
181
- url: e.url,
182
- alt: e.alt_text || void 0
183
- };
184
- }
185
- async function u(e) {
186
- let i = e?.accept ?? ["images"];
187
- if (e?.files?.length) {
188
- if (t) {
189
- let n = await t({
190
- accept: i,
191
- files: e.files
192
- });
193
- return n ? l(n) : null;
194
- }
195
- return d(e.files[0]);
196
- }
197
- if (t) {
198
- let e = await t({ accept: i });
199
- return e ? l(e) : null;
200
- }
201
- return c &&= (c(null), null), r.value = i, n.value = !0, new Promise((e) => {
202
- c = (t) => {
203
- e(t);
204
- };
205
- });
206
- }
207
- async function d(e) {
208
- let t = f(e);
209
- if (t) return s?.(t), null;
210
- try {
211
- let { MediaApiClient: t } = await import("@templatical/media-library");
212
- return l(await new t(i).uploadMedia(e));
213
- } catch (e) {
214
- return s?.(e), null;
215
- }
216
- }
217
- function f(e) {
218
- let t = a?.() ?? null;
219
- if (!t) return null;
220
- let n = t.categories?.images?.mime_types ?? [];
221
- 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;
222
- }
223
- function p(e) {
224
- n.value = !1, c?.(l(e)), c = null;
225
- }
226
- function m() {
227
- n.value = !1, c?.(null), c = null;
228
- }
229
- return o(() => {
230
- c &&= (c(null), null);
231
- }), {
232
- handleRequestMedia: u,
233
- handleMediaSelect: p,
234
- handleMediaLibraryClose: m
235
- };
236
- }
237
- //#endregion
238
- //#region src/cloud/composables/useCloudInitialization.ts
239
- function We(e) {
240
- let { config: t, translations: n, fontsManager: r, emit: i, getCommentsSidebar: o } = e, s = u(!0), c = u(!1), l = u(null), d = !1, f = { value: null }, p = null, m = null, h = new Pe({
241
- ...t.auth,
242
- onError: t.onError
243
- }), g = Te({
244
- authManager: h,
245
- onError: t.onError
246
- }), v = u(/* @__PURE__ */ new Map()), y = je({
247
- authManager: h,
248
- defaultFontFamily: t.fonts?.defaultFont,
249
- templateDefaults: t.templateDefaults,
250
- onError: t.onError,
251
- lockedBlocks: v
252
- }), b = Se({
253
- authManager: h,
254
- onError: t.onError
255
- });
256
- t.mcp?.enabled && Ee({
257
- editor: y,
258
- channel: b.channel,
259
- onOperation: t.mcp.onOperation
260
- });
261
- let x = null;
262
- t.collaboration?.enabled && (x = Ce({
263
- authManager: h,
264
- editor: y,
265
- channel: b.channel,
266
- onError: t.onError,
267
- onCollaboratorJoined: t.collaboration.onCollaboratorJoined,
268
- onCollaboratorLeft: t.collaboration.onCollaboratorLeft,
269
- onBlockLocked: t.collaboration.onBlockLocked,
270
- onBlockUnlocked: t.collaboration.onBlockUnlocked
271
- }), a(() => x.lockedBlocks.value, (e) => {
272
- v.value = e;
273
- }, { immediate: !0 }), Oe(y, x));
274
- let S = C(() => !!t.collaboration?.enabled && g.hasFeature("collaboration")), w = N({
275
- editor: y,
276
- config: {
277
- uiTheme: t.uiTheme,
278
- theme: void 0,
279
- blockDefaults: t.blockDefaults,
280
- templateDefaults: t.templateDefaults,
281
- customBlocks: [],
282
- paletteBlocks: t.paletteBlocks,
283
- htmlBlockPreview: t.htmlBlockPreview,
284
- colors: t.colors,
285
- mergeTags: t.mergeTags,
286
- logicTags: t.logicTags,
287
- displayConditions: t.displayConditions,
288
- onRequestMedia: null,
289
- resolvePreview: t.resolvePreview,
290
- lint: q(t),
291
- onSave: () => {
292
- f.value?.().catch((e) => {
293
- t.onError?.(e);
294
- });
295
- }
296
- },
297
- translations: n,
298
- fontsManager: r,
299
- historyOptions: x ? { isRemoteOperation: () => x._isProcessingRemoteOperation() } : void 0,
300
- autoSaveOptions: {
301
- onChange: async () => {
302
- y.hasTemplate() && (await y.createSnapshot(), p?.snapshotHistoryInstance.value?.loadSnapshots());
303
- },
304
- debounce: t.autoSaveDebounce ?? 5e3,
305
- enabled: () => t.autoSave !== !1 && g.hasFeature("auto_save")
306
- },
307
- themeExtraStyles: () => ({ "--tpl-drop-text": `"${n.canvas.dropHere}"` }),
308
- keyboardOptions: { onBeforeUndo: () => m?.showCollabUndoWarning() },
309
- editorRoot: e.editorRoot,
310
- containerEl: e.containerEl
311
- }), T = Ve({
312
- isCollaborationEnabled: S,
313
- getCollaboratorCount: () => x?.collaborators.value.length ?? 0,
314
- canUndo: w.history.canUndo
315
- });
316
- m = T;
317
- let E = ze({
318
- authManager: h,
319
- editor: y,
320
- history: w.history,
321
- conditionPreview: w.conditionPreview,
322
- autoSave: w.autoSave,
323
- onError: t.onError
324
- });
325
- p = E;
326
- let D = Be(), O = Ne(t.ai), k = He({
327
- planConfigInstance: g,
328
- aiConfig: O,
329
- editor: y
330
- }), A = Ue({
331
- onRequestMedia: t.onRequestMedia,
332
- mediaLibraryOpen: D.mediaLibraryOpen,
333
- mediaLibraryAccept: D.mediaLibraryAccept,
334
- authManager: h,
335
- getMediaConfig: () => g.config.value?.media ?? null,
336
- onError: t.onError
337
- });
338
- j({
339
- onBlockMove: y.moveBlock,
340
- onBlockAdd: y.addBlock
341
- });
342
- let P = ke({
343
- authManager: h,
344
- getFontsConfig: () => t.fonts,
345
- canUseCustomFonts: () => g.hasFeature("custom_fonts")
346
- }), F = Le({
347
- authManager: h,
348
- isAuthReady: c
349
- }), I = t.testEmail ?? null, B = re({
350
- provider: I ?? Me({
351
- authManager: h,
352
- getTemplateId: () => y.state.template?.id ?? null,
353
- save: () => y.save(),
354
- exportHtml: (e) => P.exportHtml(e),
355
- allowedEmails: F.allowedEmails,
356
- getSignature: F.getSignature,
357
- onBeforeTestEmail: t.onBeforeTestEmail
358
- }),
359
- getContent: () => y.content.value,
360
- renderMjml: () => le({
361
- getContent: () => y.content.value,
362
- renderCustomBlock: w.registry.renderCustomBlock,
363
- getCustomBlockStylesheet: (e) => w.registry.getDefinition(e)?.stylesheet
364
- }),
365
- onError: t.onError,
366
- isAvailable: I ? () => !0 : () => F.isEnabled.value && k.canSendTestEmail.value && k.hasTemplateSaved.value
367
- }), H = we({
368
- authManager: h,
369
- getTemplateId: () => y.state.template?.id ?? null,
370
- getSocketId: () => b.getSocketId(),
371
- onComment: t.onComment,
372
- onError: t.onError,
373
- isAuthReady: c,
374
- hasCommentingFeature: () => t.commenting !== !1 && g.hasFeature("commenting")
375
- });
376
- Fe({
377
- comments: H,
378
- channel: b.channel
379
- });
380
- let U = typeof t.savedBlocks == "object" && t.savedBlocks !== null ? t.savedBlocks : null, W = oe({
381
- provider: U ?? Ae(h),
382
- editor: y,
383
- onError: t.onError,
384
- isAvailable: U ? () => !0 : () => t.savedBlocks !== !1 && g.hasFeature("saved_modules")
385
- }), G = Ie({
386
- authManager: h,
387
- getTemplateId: () => y.state.template?.id ?? null
388
- });
389
- function K(e) {
390
- D.commentsOpen.value = !0, queueMicrotask(() => {
391
- o()?.filterByBlock(e);
392
- });
393
- }
394
- _(L, A.handleRequestMedia), _(z, h), _(V, O), _(R, H), _(te, G), _(ee, {
395
- plan: g,
396
- ai: O,
397
- comments: {
398
- getBlockCount: (e) => H.commentCountByBlock.value.get(e) ?? 0,
399
- openForBlock: K
400
- },
401
- savedBlocks: W.capability,
402
- testEmail: B.capability
403
- });
404
- function ne(e) {
405
- g.hasFeature("theme_customization") && (w.themeOverrides.value = e);
406
- }
407
- function ie(e) {
408
- y.setUiTheme(e);
409
- }
410
- async function J() {
411
- s.value = !0, l.value = null;
412
- try {
413
- if (await h.initialize(), d) return;
414
- c.value = !0;
415
- let e = await De({ authManager: h });
416
- if (d) return;
417
- if (!e.api.ok) throw Error("Health check failed: API is not reachable");
418
- if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
419
- 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;
420
- r.setCustomFontsEnabled(g.hasFeature("custom_fonts")), t.customBlocks?.length && g.hasFeature("custom_blocks") && w.registerCustomBlocks(t.customBlocks), t.theme && g.hasFeature("theme_customization") && (w.themeOverrides.value = t.theme), i("ready");
421
- } catch (e) {
422
- if (d) return;
423
- let n = e instanceof Error ? e : Error("Initialization failed", { cause: e });
424
- l.value = n, t.onError?.(n);
425
- } finally {
426
- d || (s.value = !1);
427
- }
428
- }
429
- function ae() {
430
- d = !0, r.cleanupFontLinks(), b.disconnect(), w.destroy(), t.onUnmount?.();
431
- }
432
- return {
433
- isInitializing: s,
434
- isAuthReady: c,
435
- initError: l,
436
- isDestroyed: () => d,
437
- authManager: h,
438
- planConfigInstance: g,
439
- websocket: b,
440
- collaboration: x,
441
- isCollaborationEnabled: S,
442
- editor: y,
443
- core: w,
444
- aiConfig: O,
445
- featureFlags: k,
446
- mediaLib: A,
447
- exporter: P,
448
- testEmail: B,
449
- commentsInstance: H,
450
- savedBlocks: W,
451
- scoringInstance: G,
452
- panelState: D,
453
- snapshotPreview: E,
454
- collabWarning: T,
455
- onSaveHook: f,
456
- initialize: J,
457
- destroy: ae,
458
- setThemeOverrides: ne,
459
- setUiTheme: ie,
460
- openCommentsForBlock: K
461
- };
462
- }
463
- //#endregion
464
- //#region src/utils/preRenderCustomBlocks.ts
465
- async function Ge(e, t) {
466
- let n = async (e) => {
467
- if (A(e)) {
468
- let n = e;
469
- try {
470
- n.renderedHtml = await t.renderCustomBlock(n);
471
- } catch {
472
- n.renderedHtml = `<!-- Custom block render error: ${n.customType} -->`;
473
- }
474
- }
475
- if (e.type === "section" && "children" in e) {
476
- let t = e;
477
- for (let e of t.children) for (let t of e) await n(t);
478
- }
479
- };
480
- for (let t of e.blocks) await n(t);
481
- }
482
- //#endregion
483
- //#region src/cloud/composables/useCloudLifecycle.ts
484
- function Ke(e) {
485
- let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
486
- function u() {
487
- return xe(i.config.value.websocket);
488
- }
489
- async function d(e) {
490
- let i = await n.create(e);
491
- return l() ? i : (t.onCreate?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
492
- }
493
- async function f(e) {
494
- let i = await n.load(e);
495
- return l() ? i : (t.onLoad?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
496
- }
497
- async function p() {
498
- c.isSaveExporting.value = !0, c.saveStatus.value = "idle";
499
- try {
500
- if (await Ge(n.content.value, o.registry), l()) throw Error("Component unmounted during save");
501
- let e = await n.save();
502
- if (l()) throw Error("Component unmounted during save");
503
- a.initSnapshotHistory(), a.snapshotHistoryInstance.value?.loadSnapshots();
504
- let r = await s.exportHtml(e.id);
505
- if (l()) throw Error("Component unmounted during save");
506
- let i = {
507
- templateId: e.id,
508
- html: r.html,
509
- mjml: r.mjml,
510
- content: e.content
511
- };
512
- return t.onSave?.(i), c.saveStatus.value = "saved", c.startSaveStatusClear(), i;
513
- } catch (e) {
514
- throw l() || (c.saveStatus.value = "error", c.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
515
- } finally {
516
- l() || (c.isSaveExporting.value = !1);
517
- }
518
- }
519
- return {
520
- createTemplate: d,
521
- loadTemplate: f,
522
- saveTemplate: p
523
- };
524
- }
525
- //#endregion
526
- //#region src/cloud/composables/useCloudSaveGate.ts
527
- function qe(e) {
528
- let t = u(!1), n = null, r = C(() => e.planConfig.value?.accessibility?.blockOnError === !0), i = C(() => r.value ? e.issues.value.filter((e) => e.severity === "error") : []), a = C(() => i.value.length > 0);
529
- async function o(e) {
530
- return a.value ? (n = e, t.value = !0, !1) : (await e(), !0);
531
- }
532
- async function s() {
533
- let e = n;
534
- n = null, t.value = !1, e && await e();
535
- }
536
- function c() {
537
- n = null, t.value = !1;
538
- }
539
- return {
540
- shouldBlock: a,
541
- blockingIssues: i,
542
- modalOpen: t,
543
- tryRunSave: o,
544
- confirmAndSave: s,
545
- cancel: c
546
- };
547
- }
548
- //#endregion
549
- //#region src/cloud/components/CloudSaveGateModal.vue?vue&type=script&setup=true&lang.ts
550
- var Je = ["aria-label"], Ye = { 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)]" }, Xe = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ze = { class: "tpl:m-0 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Qe = { class: "tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, $e = { 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" }, et = { class: "tpl:text-xs tpl:text-[var(--tpl-text)]" }, tt = { class: "tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]" }, nt = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, rt = /* @__PURE__ */ f({
551
- __name: "CloudSaveGateModal",
552
- props: {
553
- open: { type: Boolean },
554
- issues: {}
555
- },
556
- emits: ["cancel", "confirm"],
557
- setup(t, { emit: n }) {
558
- let r = n, { t: i } = Q();
559
- return (n, a) => (s(), v(O, {
560
- "enter-active-class": "tpl:transition-opacity tpl:duration-150",
561
- "leave-active-class": "tpl:transition-opacity tpl:duration-150",
562
- "enter-from-class": "tpl:opacity-0",
563
- "leave-to-class": "tpl:opacity-0"
564
- }, {
565
- default: l(() => [t.open ? (s(), m("div", {
566
- key: 0,
567
- role: "dialog",
568
- "aria-modal": "true",
569
- "aria-label": b(i).saveGate.title,
570
- class: "tpl:fixed tpl:inset-0 tpl:z-50 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/40 tpl:p-6",
571
- onClick: a[2] ||= E((e) => r("cancel"), ["self"])
572
- }, [p("div", Ye, [
573
- p("header", Xe, [g(b(ve), {
574
- size: 18,
575
- "stroke-width": 2,
576
- class: "tpl:text-[var(--tpl-warning)]"
577
- }), p("h2", Ze, c(b(i).saveGate.title), 1)]),
578
- p("p", Qe, c(b(i).saveGate.body), 1),
579
- p("ul", $e, [(s(!0), m(S, null, e(t.issues, (e) => (s(), m("li", {
580
- key: `${e.ruleId}-${e.blockId ?? "template"}`,
581
- class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:rounded tpl:px-2 tpl:py-1.5"
582
- }, [p("span", et, c(e.message), 1), p("span", tt, c(e.ruleId), 1)]))), 128))]),
583
- p("footer", nt, [p("button", {
584
- type: "button",
585
- 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)]",
586
- onClick: a[0] ||= (e) => r("cancel")
587
- }, c(b(i).saveGate.cancel), 1), p("button", {
588
- type: "button",
589
- 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",
590
- onClick: a[1] ||= (e) => r("confirm")
591
- }, c(b(i).saveGate.confirm), 1)])
592
- ])], 8, Je)) : w("", !0)]),
593
- _: 1
594
- }));
595
- }
596
- }), it = {
597
- 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",
598
- style: {
599
- "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
600
- "backdrop-filter": "blur(12px)",
601
- "-webkit-backdrop-filter": "blur(12px)",
602
- "box-shadow": "var(--tpl-shadow-md)",
603
- "border-bottom": "1px solid var(--tpl-border)"
604
- }
605
- }, at = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, ot = {
606
- key: 0,
607
- class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
608
- }, st = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, ct = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, lt = ["data-tooltip"], ut = {
609
- key: 1,
610
- "aria-live": "polite",
611
- class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
612
- }, dt = {
613
- key: 2,
614
- "aria-live": "polite",
615
- class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
616
- }, ft = ["aria-label", "aria-expanded"], pt = {
617
- key: 0,
618
- 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)]"
619
- }, mt = ["aria-expanded"], ht = {
620
- key: 0,
621
- class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
622
- }, gt = ["disabled"], _t = ["disabled"], vt = /* @__PURE__ */ f({
623
- __name: "CloudHeader",
624
- props: {
625
- editor: {},
626
- core: {},
627
- featureFlags: {},
628
- panelState: {},
629
- snapshotPreview: {},
630
- commentsInstance: {},
631
- testEmail: {},
632
- websocket: {},
633
- collaboration: {},
634
- isCollaborationEnabled: { type: Boolean },
635
- isSaveDisabled: { type: Boolean },
636
- isSaving: { type: Boolean }
637
- },
638
- emits: ["save"],
639
- setup(e) {
640
- let t = h(() => import("./CollaboratorBar-BGwbg9aN.js")), r = h(() => import("./SnapshotHistory-Cb4WW2gf.js")), a = h(() => import("./AiFeatureMenu-Cy-PVrNT.js")), { t: o } = H(), { t: u, format: d } = Q();
641
- return (f, h) => (s(), m("header", it, [
642
- p("div", at, [e.featureFlags.templateLimit.value === null ? w("", !0) : (s(), m("span", ot, c(b(d)(b(u).header.templatesUsed, {
643
- used: e.featureFlags.templateCount.value,
644
- max: e.featureFlags.templateLimit.value
645
- })), 1))]),
646
- p("div", st, [
647
- g(Z, {
648
- viewport: e.editor.state.viewport,
649
- onChange: e.editor.setViewport
650
- }, null, 8, ["viewport", "onChange"]),
651
- g(J, {
652
- "dark-mode": e.editor.state.darkMode,
653
- onChange: e.editor.setDarkMode
654
- }, null, 8, ["dark-mode", "onChange"]),
655
- g(K, {
656
- "preview-mode": e.editor.state.previewMode,
657
- onChange: e.editor.setPreviewMode
658
- }, null, 8, ["preview-mode", "onChange"]),
659
- e.editor.state.previewMode && !e.core.previewResolution.supersedesSamples.value ? (s(), v(he, {
660
- key: 0,
661
- "sample-mode": e.core.mergeTagSampleMode.value,
662
- onChange: h[0] ||= (t) => e.core.mergeTagSampleMode.value = t
663
- }, null, 8, ["sample-mode"])) : w("", !0),
664
- e.collaboration && e.isCollaborationEnabled ? (s(), v(b(t), {
665
- key: 1,
666
- collaborators: e.collaboration.collaborators.value,
667
- "is-connected": e.websocket.isConnected.value
668
- }, null, 8, ["collaborators", "is-connected"])) : w("", !0),
669
- e.snapshotPreview.snapshotHistoryInstance.value ? (s(), v(b(r), {
670
- key: 2,
671
- snapshots: e.snapshotPreview.snapshotHistorySnapshots.value,
672
- "is-loading": e.snapshotPreview.snapshotHistoryIsLoading.value,
673
- "is-restoring": e.snapshotPreview.snapshotHistoryIsRestoring.value,
674
- onLoad: e.snapshotPreview.loadSnapshotHistory,
675
- onNavigate: e.snapshotPreview.handleSnapshotNavigate
676
- }, null, 8, [
677
- "snapshots",
678
- "is-loading",
679
- "is-restoring",
680
- "onLoad",
681
- "onNavigate"
682
- ])) : w("", !0)
683
- ]),
684
- p("div", ct, [
685
- e.featureFlags.saveStatus.value === "error" ? (s(), m("div", {
686
- key: 0,
687
- "aria-live": "assertive",
688
- class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
689
- "data-tooltip": e.featureFlags.saveErrorMessage.value
690
- }, [g(b(G), {
691
- size: 12,
692
- "stroke-width": 2.5
693
- }), y(" " + c(b(u).header.saveFailed), 1)], 8, lt)) : e.featureFlags.saveStatus.value === "saved" ? (s(), m("div", ut, [g(b(W), {
694
- size: 12,
695
- "stroke-width": 2.5
696
- }), y(" " + c(b(u).header.saved), 1)])) : e.editor.state.isDirty ? (s(), m("div", dt, [h[5] ||= p("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), y(" " + c(b(u).header.unsaved), 1)])) : w("", !0),
697
- e.commentsInstance.isEnabled.value && e.featureFlags.hasTemplateSaved.value ? (s(), m("button", {
698
- key: 3,
699
- "aria-label": e.commentsInstance.unresolvedCount.value > 0 ? `${b(u).comments.button} (${e.commentsInstance.unresolvedCount.value})` : b(u).comments.button,
700
- "aria-expanded": e.panelState.commentsOpen.value,
701
- class: i(b($)),
702
- style: n({
703
- backgroundColor: e.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
704
- color: e.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
705
- borderColor: "var(--tpl-primary)"
706
- }),
707
- onClick: h[1] ||= (t) => e.panelState.commentsOpen.value = !e.panelState.commentsOpen.value
708
- }, [
709
- g(b(X), {
710
- size: 16,
711
- "stroke-width": 2
712
- }),
713
- y(" " + c(b(u).comments.button) + " ", 1),
714
- e.commentsInstance.unresolvedCount.value > 0 && !e.panelState.commentsOpen.value ? (s(), m("span", pt, c(e.commentsInstance.unresolvedCount.value), 1)) : w("", !0)
715
- ], 14, ft)) : w("", !0),
716
- e.featureFlags.canUseAiGeneration.value && e.featureFlags.hasTemplateSaved.value ? (s(), m("div", {
717
- key: 4,
718
- ref: (t) => e.panelState.aiMenuRef.value = t,
719
- class: "tpl:relative"
720
- }, [p("button", {
721
- "aria-expanded": e.panelState.aiMenuOpen.value,
722
- class: i(["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"]),
723
- onClick: h[2] ||= E((...t) => e.panelState.toggleAiMenu && e.panelState.toggleAiMenu(...t), ["stop"])
724
- }, [g(b(_e), {
725
- size: 16,
726
- "stroke-width": 2,
727
- class: "tpl-ai-btn-icon"
728
- }), y(" " + c(b(u).aiChat.button), 1)], 10, mt), g(O, {
729
- "enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
730
- "enter-from-class": "tpl:scale-95 tpl:opacity-0",
731
- "enter-to-class": "tpl:scale-100 tpl:opacity-100",
732
- "leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
733
- "leave-from-class": "tpl:scale-100 tpl:opacity-100",
734
- "leave-to-class": "tpl:scale-95 tpl:opacity-0"
735
- }, {
736
- default: l(() => [e.panelState.aiMenuOpen.value ? (s(), m("div", ht, [g(b(a), {
737
- "active-feature": e.panelState.activeAiFeature.value,
738
- onSelect: e.panelState.handleAiFeatureSelect
739
- }, null, 8, ["active-feature", "onSelect"])])) : w("", !0)]),
740
- _: 1
741
- })], 512)) : w("", !0),
742
- e.testEmail.isAvailable.value ? (s(), m("button", {
743
- key: 5,
744
- class: i(b($)),
745
- "data-testid": "test-email-trigger",
746
- style: {
747
- "background-color": "transparent",
748
- color: "var(--tpl-primary)",
749
- "border-color": "var(--tpl-primary)"
750
- },
751
- disabled: e.testEmail.isSending.value,
752
- onClick: h[3] ||= (t) => e.testEmail.open()
753
- }, [e.testEmail.isSending.value ? (s(), v(b(Y), {
754
- key: 1,
755
- class: "tpl-spinner",
756
- size: 16,
757
- "stroke-width": 2
758
- })) : (s(), v(b(ge), {
759
- key: 0,
760
- size: 16,
761
- "stroke-width": 2
762
- })), y(" " + c(b(o).testEmail.button), 1)], 10, gt)) : w("", !0),
763
- p("button", {
764
- class: i(b($)),
765
- style: {
766
- "background-color": "transparent",
767
- color: "var(--tpl-primary)",
768
- "border-color": "var(--tpl-primary)"
769
- },
770
- disabled: e.isSaveDisabled,
771
- onClick: h[4] ||= (e) => f.$emit("save")
772
- }, [e.isSaving ? (s(), v(b(Y), {
773
- key: 1,
774
- class: "tpl-spinner",
775
- size: 16,
776
- "stroke-width": 2
777
- })) : (s(), v(b(Re), {
778
- key: 0,
779
- size: 16,
780
- "stroke-width": 2
781
- })), y(" " + c(e.isSaving ? b(u).header.saving : b(u).header.save), 1)], 10, _t)
782
- ])
783
- ]));
784
- }
785
- }), yt = /* @__PURE__ */ f({
786
- __name: "CloudPanels",
787
- props: {
788
- config: {},
789
- editor: {},
790
- core: {},
791
- panelState: {},
792
- planConfigInstance: {},
793
- mediaLib: {}
794
- },
795
- setup(e, { expose: t }) {
796
- let n = h(() => import("./AiChatSidebar-CMBz6Wix.js")), r = h(() => import("./CommentsSidebar-CdRCCSDD.js")), i = h(() => import("./DesignReferenceSidebar-Bx96XFmK.js")), a = h(() => import("./TemplateScoringPanel-BZUsb3FD.js")), o = h(async () => {
797
- try {
798
- return (await import("@templatical/media-library")).MediaLibraryModal;
799
- } catch {
800
- throw Error("[Templatical] Cloud media library requires the optional peer dependency '@templatical/media-library'. Please install it.");
801
- }
802
- });
803
- function c(e, t, n) {
804
- t.history.record(), n.setContent(e), t.conditionPreview.reset();
805
- }
806
- let l = u(null);
807
- function d(e) {
808
- l.value?.filterByBlock(e);
809
- }
810
- return t({ filterCommentsByBlock: d }), (t, u) => (s(), m(S, null, [
811
- g(b(n), {
812
- visible: e.panelState.aiChatOpen.value,
813
- "on-apply": (t) => c(t, e.core, e.editor),
814
- onClose: u[0] ||= (t) => e.panelState.aiChatOpen.value = !1
815
- }, null, 8, ["visible", "on-apply"]),
816
- g(b(a), {
817
- visible: e.panelState.scoringPanelOpen.value,
818
- onClose: u[1] ||= (t) => e.panelState.scoringPanelOpen.value = !1
819
- }, null, 8, ["visible"]),
820
- g(b(i), {
821
- visible: e.panelState.designReferenceOpen.value,
822
- "has-existing-blocks": e.editor.content.value.blocks.length > 0,
823
- onClose: u[2] ||= (t) => e.panelState.designReferenceOpen.value = !1,
824
- onApply: u[3] ||= (t) => c(t, e.core, e.editor)
825
- }, null, 8, ["visible", "has-existing-blocks"]),
826
- g(b(r), {
827
- ref_key: "commentsSidebar",
828
- ref: l,
829
- visible: e.panelState.commentsOpen.value,
830
- onClose: u[4] ||= (t) => e.panelState.commentsOpen.value = !1
831
- }, null, 8, ["visible"]),
832
- g(b(o), {
833
- visible: e.panelState.mediaLibraryOpen.value,
834
- accept: e.panelState.mediaLibraryAccept.value,
835
- "popover-target": e.core.popoverRoot.value,
836
- onSelect: e.mediaLib.handleMediaSelect,
837
- onClose: e.mediaLib.handleMediaLibraryClose
838
- }, null, 8, [
839
- "visible",
840
- "accept",
841
- "popover-target",
842
- "onSelect",
843
- "onClose"
844
- ])
845
- ], 64));
846
- }
847
- }), bt = {
848
- key: 0,
849
- class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
850
- }, xt = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, St = { 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)]" }, Ct = /* @__PURE__ */ f({
851
- __name: "CloudLoadingOverlay",
852
- props: { visible: { type: Boolean } },
853
- setup(t) {
854
- return (n, r) => t.visible ? (s(), m("div", bt, [r[1] ||= x("<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), p("div", xt, [p("div", St, [(s(), m(S, null, e(5, (e) => p("div", {
855
- key: e,
856
- class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
857
- })), 64))]), r[0] ||= x("<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)])])) : w("", !0);
858
- }
859
- }), wt = {
860
- key: 0,
861
- role: "alert",
862
- 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)]"
863
- }, Tt = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, Et = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, Dt = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ot = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, kt = /* @__PURE__ */ f({
864
- __name: "CloudErrorOverlay",
865
- props: {
866
- error: {},
867
- visible: { type: Boolean }
868
- },
869
- emits: ["retry"],
870
- setup(e, { emit: t }) {
871
- let n = t, { t: r } = Q();
872
- function i(e) {
873
- return "isUnauthorized" in e && e.isUnauthorized ? r.error.authFailed : "isNotFound" in e && e.isNotFound ? r.error.templateNotFound : r.error.defaultMessage;
874
- }
875
- function a(e) {
876
- return "isNotFound" in e && !!e.isNotFound;
877
- }
878
- return (t, o) => e.visible && e.error ? (s(), m("div", wt, [
879
- p("div", Tt, [g(b(G), {
880
- size: 32,
881
- "stroke-width": 1.5,
882
- class: "tpl:text-[var(--tpl-danger)]"
883
- })]),
884
- p("div", Et, [p("h2", Dt, c(b(r).error.title), 1), p("p", Ot, c(i(e.error)), 1)]),
885
- a(e.error) ? w("", !0) : (s(), m("button", {
886
- key: 0,
887
- 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)]",
888
- onClick: o[0] ||= (e) => n("retry")
889
- }, c(b(r).error.retry), 1))
890
- ])) : w("", !0);
891
- }
892
- }), At = {
893
- key: 0,
894
- 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)]"
895
- }, jt = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, Mt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Nt = /* @__PURE__ */ f({
896
- __name: "SnapshotPreviewBanner",
897
- props: { visible: { type: Boolean } },
898
- emits: ["cancel", "confirm"],
899
- setup(e, { emit: t }) {
900
- let n = t, { t: r } = Q();
901
- return (t, i) => e.visible ? (s(), m("div", At, [p("div", jt, [g(b(me), {
902
- size: 18,
903
- "stroke-width": 2,
904
- class: "tpl:text-[var(--tpl-primary)]"
905
- }), p("span", null, c(b(r).snapshotPreview.message), 1)]), p("div", Mt, [p("button", {
906
- 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)]",
907
- style: { "background-color": "transparent" },
908
- onClick: i[0] ||= (e) => n("cancel")
909
- }, c(b(r).snapshotPreview.cancel), 1), p("button", {
910
- 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)]",
911
- onClick: i[1] ||= (e) => n("confirm")
912
- }, c(b(r).snapshotPreview.restore), 1)])])) : w("", !0);
913
- }
914
- }), Pt = {
915
- key: 0,
916
- role: "status",
917
- "aria-live": "polite",
918
- 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",
919
- style: {
920
- "background-color": "var(--tpl-warning-light)",
921
- color: "var(--tpl-text)",
922
- border: "1px solid var(--tpl-warning)"
923
- }
924
- }, Ft = /* @__PURE__ */ f({
925
- __name: "CollabUndoToast",
926
- props: { visible: { type: Boolean } },
927
- setup(e) {
928
- let { t } = H();
929
- return (n, r) => e.visible ? (s(), m("div", Pt, c(b(t).history.collabWarning), 1)) : w("", !0);
930
- }
931
- }), It = ["data-tpl-theme"], Lt = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, Rt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, zt = ["aria-label"], Bt = /*#__PURE__*/ ye(/* @__PURE__ */ f({
932
- __name: "CloudEditor",
933
- props: {
934
- config: {},
935
- translations: {},
936
- cloudTranslations: {},
937
- fontsManager: {},
938
- shadowRoot: {}
939
- },
940
- emits: ["ready"],
941
- setup(e, { expose: a, emit: o }) {
942
- let d = h(() => import("./SavedBlocksPanels-DEPmNhi6.js")), f = h(() => import("./TestEmailPanel-DubocPxf.js")), x = e;
943
- _(B, x.cloudTranslations);
944
- let S = o, C = u(null), k = u(null), A = We({
945
- config: x.config,
946
- translations: x.translations,
947
- fontsManager: x.fontsManager,
948
- emit: S,
949
- getCommentsSidebar: () => C.value ? { filterByBlock: C.value.filterCommentsByBlock } : null,
950
- editorRoot: x.shadowRoot,
951
- containerEl: k
952
- }), { isInitializing: j, isAuthReady: M, initError: N, planConfigInstance: F, websocket: I, collaboration: L, isCollaborationEnabled: ee, editor: R, core: z, featureFlags: V, mediaLib: te, exporter: H, testEmail: U, commentsInstance: W, savedBlocks: G, panelState: K, snapshotPreview: q, collabWarning: re, setThemeOverrides: J, setUiTheme: oe } = A, { showNotice: le } = P(() => x.config.smallScreenNotice);
953
- async function me() {
954
- try {
955
- await q.confirmRestoreSnapshot();
956
- } catch {}
957
- }
958
- let Y = Ke({
959
- config: x.config,
960
- editor: R,
961
- websocket: I,
962
- planConfigInstance: F,
963
- snapshotPreview: q,
964
- core: z,
965
- exporter: H,
966
- featureFlags: V,
967
- isDestroyed: A.isDestroyed
968
- }), X = qe({
969
- issues: z.templateLint ? z.templateLint.issues : u([]),
970
- planConfig: F.config
971
- });
972
- async function Z() {
973
- await X.tryRunSave(() => Y.saveTemplate().catch((e) => x.config.onError?.(e)));
974
- }
975
- return A.onSaveHook.value = Z, r(() => {
976
- A.initialize();
977
- }), t(() => {
978
- A.destroy();
979
- }), a({
980
- getContent: () => R.content.value,
981
- setContent: (e) => R.setContent(e),
982
- setTheme: oe,
983
- setThemeOverrides: J,
984
- create: Y.createTemplate,
985
- load: Y.loadTemplate,
986
- save: Y.saveTemplate,
987
- sendTestEmail: (e) => U.send(e)
988
- }), (t, r) => (s(), m("div", {
989
- ref_key: "rootEl",
990
- ref: k,
991
- class: i(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": b(R).state.darkMode }]),
992
- "data-tpl-theme": b(z).resolvedTheme.value,
993
- style: n(b(z).themeStyles.value),
994
- onDragover: r[6] ||= E(() => {}, ["prevent"]),
995
- onDrop: r[7] ||= E(() => {}, ["prevent"])
996
- }, [
997
- g(ae),
998
- g(O, {
999
- "enter-active-class": "tpl:transition-opacity tpl:duration-200",
1000
- "enter-from-class": "tpl:opacity-100",
1001
- "enter-to-class": "tpl:opacity-100",
1002
- "leave-active-class": "tpl:transition-opacity tpl:duration-300",
1003
- "leave-from-class": "tpl:opacity-100",
1004
- "leave-to-class": "tpl:opacity-0"
1005
- }, {
1006
- default: l(() => [g(Ct, { visible: b(j) || b(R).state.isLoading }, null, 8, ["visible"])]),
1007
- _: 1
1008
- }),
1009
- g(O, {
1010
- "enter-active-class": "tpl:transition-opacity tpl:duration-200",
1011
- "enter-from-class": "tpl:opacity-0",
1012
- "enter-to-class": "tpl:opacity-100",
1013
- "leave-active-class": "tpl:transition-opacity tpl:duration-300",
1014
- "leave-from-class": "tpl:opacity-100",
1015
- "leave-to-class": "tpl:opacity-0"
1016
- }, {
1017
- default: l(() => [g(kt, {
1018
- error: b(N),
1019
- visible: !!b(N) && !b(j),
1020
- onRetry: b(A).initialize
1021
- }, null, 8, [
1022
- "error",
1023
- "visible",
1024
- "onRetry"
1025
- ])]),
1026
- _: 1
1027
- }),
1028
- g(vt, {
1029
- editor: b(R),
1030
- core: b(z),
1031
- "feature-flags": b(V),
1032
- "panel-state": b(K),
1033
- "snapshot-preview": b(q),
1034
- "comments-instance": b(W),
1035
- "test-email": b(U),
1036
- websocket: b(I),
1037
- collaboration: b(L),
1038
- "is-collaboration-enabled": b(ee),
1039
- "is-saving": b(R).state.isSaving || b(V).isSaveExporting.value,
1040
- "is-save-disabled": b(R).state.isSaving || b(V).isSaveExporting.value || !b(R).state.isDirty,
1041
- onSave: Z
1042
- }, null, 8, [
1043
- "editor",
1044
- "core",
1045
- "feature-flags",
1046
- "panel-state",
1047
- "snapshot-preview",
1048
- "comments-instance",
1049
- "test-email",
1050
- "websocket",
1051
- "collaboration",
1052
- "is-collaboration-enabled",
1053
- "is-saving",
1054
- "is-save-disabled"
1055
- ]),
1056
- g(rt, {
1057
- open: b(X).modalOpen.value,
1058
- issues: b(X).blockingIssues.value,
1059
- onCancel: b(X).cancel,
1060
- onConfirm: b(X).confirmAndSave
1061
- }, null, 8, [
1062
- "open",
1063
- "issues",
1064
- "onCancel",
1065
- "onConfirm"
1066
- ]),
1067
- g(Nt, {
1068
- visible: b(q).isPreviewingSnapshot.value,
1069
- onCancel: b(q).cancelPreview,
1070
- onConfirm: me
1071
- }, null, 8, ["visible", "onCancel"]),
1072
- g(O, {
1073
- "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
1074
- "enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
1075
- "enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
1076
- "leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
1077
- "leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
1078
- "leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
1079
- }, {
1080
- default: l(() => [g(Ft, { visible: b(re).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
1081
- _: 1
1082
- }),
1083
- T(g(ne, null, null, 512), [[D, !b(R).state.previewMode]]),
1084
- p("div", {
1085
- class: i(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [b(R).state.previewMode ? "tpl:left-0 tpl:right-0" : b(K).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", b(q).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
1086
- style: {
1087
- transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
1088
- "background-color": "var(--tpl-canvas-bg)"
1089
- }
1090
- }, [p("div", Lt, [g(O, { name: "tpl-restore-btn" }, {
1091
- default: l(() => [b(z).conditionPreview.hasHiddenBlocks.value && b(z).appliesConditionFilter.value ? (s(), m("button", {
1092
- key: 0,
1093
- 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",
1094
- style: {
1095
- "background-color": "var(--tpl-warning-light)",
1096
- color: "var(--tpl-warning)",
1097
- "border-color": "var(--tpl-warning)",
1098
- "backdrop-filter": "blur(8px)"
1099
- },
1100
- "data-testid": "restore-hidden-blocks",
1101
- onClick: r[0] ||= (e) => b(z).conditionPreview.reset()
1102
- }, [g(b(ie), {
1103
- size: 13,
1104
- "stroke-width": 2
1105
- }), y(" " + c(b(z).t.blockSettings.restoreHiddenBlocks), 1)])) : w("", !0)]),
1106
- _: 1
1107
- })]), p("main", Rt, [g(pe, {
1108
- viewport: b(R).state.viewport,
1109
- content: b(z).previewResolution.content.value,
1110
- "selected-block-id": b(R).state.selectedBlockId,
1111
- "dark-mode": b(R).state.darkMode,
1112
- "preview-mode": b(R).state.previewMode,
1113
- "locked-blocks": b(L)?.lockedBlocks.value ?? void 0,
1114
- onSelectBlock: b(R).selectBlock,
1115
- onOpenAiChat: r[1] ||= (e) => b(K).aiChatOpen.value = !0,
1116
- onOpenDesignReference: r[2] ||= (e) => b(K).designReferenceOpen.value = !0
1117
- }, null, 8, [
1118
- "viewport",
1119
- "content",
1120
- "selected-block-id",
1121
- "dark-mode",
1122
- "preview-mode",
1123
- "locked-blocks",
1124
- "onSelectBlock"
1125
- ])])], 2),
1126
- e.config.branding !== !1 && !b(V).isWhiteLabeled.value ? (s(), v(ue, {
1127
- key: 0,
1128
- "position-class": [b(R).state.previewMode ? "tpl:left-0 tpl:right-0" : b(K).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
1129
- }, null, 8, ["position-class"])) : w("", !0),
1130
- p("div", {
1131
- class: "tpl-sr-only",
1132
- role: "status",
1133
- "aria-live": "polite",
1134
- "aria-atomic": "true",
1135
- "aria-label": b(z).t.landmarks.reorderAnnouncements
1136
- }, c(b(z).keyboardReorder.announcement.value), 9, zt),
1137
- T(g(de, {
1138
- "selected-block": b(R).selectedBlock.value,
1139
- settings: b(R).content.value.settings,
1140
- "shifted-left": b(K).rightPanelOpen.value,
1141
- onUpdateBlock: r[3] ||= (e) => b(R).updateBlock(b(R).selectedBlock.value.id, e),
1142
- onDeleteBlock: r[4] ||= (e) => b(z).blockActions.deleteBlock(b(R).selectedBlock.value.id),
1143
- onDuplicateBlock: r[5] ||= (e) => b(z).blockActions.duplicateBlock(b(R).selectedBlock.value),
1144
- onUpdateSettings: b(R).updateSettings
1145
- }, null, 8, [
1146
- "selected-block",
1147
- "settings",
1148
- "shifted-left",
1149
- "onUpdateSettings"
1150
- ]), [[D, !b(R).state.previewMode]]),
1151
- !b(j) && b(M) ? (s(), v(yt, {
1152
- key: 1,
1153
- ref_key: "cloudPanelsRef",
1154
- ref: C,
1155
- config: x.config,
1156
- editor: b(R),
1157
- core: b(z),
1158
- "panel-state": b(K),
1159
- "plan-config-instance": b(F),
1160
- "media-lib": b(te)
1161
- }, null, 8, [
1162
- "config",
1163
- "editor",
1164
- "core",
1165
- "panel-state",
1166
- "plan-config-instance",
1167
- "media-lib"
1168
- ])) : w("", !0),
1169
- b(G).isAvailable.value ? (s(), v(b(d), {
1170
- key: 2,
1171
- feature: b(G)
1172
- }, null, 8, ["feature"])) : w("", !0),
1173
- b(U).isAvailable.value ? (s(), v(b(f), {
1174
- key: 3,
1175
- feature: b(U)
1176
- }, null, 8, ["feature"])) : w("", !0),
1177
- p("div", {
1178
- ref: (e) => b(z).popoverRoot.value = e,
1179
- class: "tpl-popover-root"
1180
- }, null, 512),
1181
- g(se),
1182
- g(fe),
1183
- b(le) ? (s(), v(ce, { key: 4 })) : w("", !0)
1184
- ], 46, It));
1185
- }
1186
- }), [["__scopeId", "data-v-16786f1a"]]);
1187
- //#endregion
1188
- export { Bt as default };