@templatical/editor 0.52.0 → 0.53.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 (400) hide show
  1. package/README.md +1 -1
  2. package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
  3. package/dist/{AiAltTextReview-DE8t8Rud.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
  4. package/dist/{AiChatPanel-7ftS7d40.js → AiChatPanel-DdhtfsmO.js} +223 -210
  5. package/dist/{AiPanels-CxGp6klr.js → AiPanels-HBx7xoJR.js} +6 -6
  6. package/dist/{AiRewriteMenu-DNI-5CUj.js → AiRewriteMenu-DPzSekZt.js} +78 -107
  7. package/dist/BlockIssueBadge-eIXZJ9M3.js +33 -0
  8. package/dist/BlockPreviewCanvas-DO-2TP_6.js +140 -0
  9. package/dist/{CloudHeaderExtras-CsgyNNV1.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
  10. package/dist/{CloudPanels-BDV4XQ_l.js → CloudPanels-i2kZdrdP.js} +44 -44
  11. package/dist/CollaborationNotices-DANsjl7c.js +65 -0
  12. package/dist/{CollaboratorBar-EeqqWcX6.js → CollaboratorBar-CbbAA0m1.js} +24 -24
  13. package/dist/CommentsPanel-CYW3LWis.js +16 -0
  14. package/dist/CommentsSidebar-CcF4ISMi.js +526 -0
  15. package/dist/{CountdownBlock-BT3ZTH1F.js → CountdownBlock-BMezkFbJ.js} +21 -21
  16. package/dist/CountdownToolbar-D3Lv74kU.js +258 -0
  17. package/dist/{IssuesPanel-BHFQ3wrP.js → IssuesPanel-BMAG9042.js} +141 -129
  18. package/dist/LanguageMenu-FlP_Jbup.js +403 -0
  19. package/dist/{LoadingTrack-DZA5AoP9.js → LoadingTrack-BG8cg9xi.js} +2 -2
  20. package/dist/LocaleNotices-DAnVszWu.js +46 -0
  21. package/dist/{LogicTagInsertButton-CSD9cfJB.js → LogicTagInsertButton-BjYs-UQX.js} +439 -430
  22. package/dist/{MediaEditModal-DQl5w44r.js → MediaEditModal-LnG-cF_S.js} +160 -160
  23. package/dist/{MediaPanels-BFWYuJot.js → MediaPanels-C2r5fiFo.js} +4 -4
  24. package/dist/{cdn/chunks/MergeTagInput-CFu9VXPS.js → MergeTagInput-BsnogCeY.js} +32 -34
  25. package/dist/{MergeTagModeToggle-DvD0ne7N.js → MergeTagModeToggle-DiufIQ-_.js} +49 -49
  26. package/dist/MergeTagTextarea-BweI-Xsi.js +126 -0
  27. package/dist/{ParagraphEditor-D-nqs82g.js → ParagraphEditor-qgBp5yIB.js} +286 -257
  28. package/dist/{RestoreVersionDialog-DqUPsLB9.js → RestoreVersionDialog-DdYUrFiK.js} +23 -23
  29. package/dist/{RichTextEditorContent-Xq9D0Zs3.js → RichTextEditorContent-C5MAzx3E.js} +54 -53
  30. package/dist/{SaveBlockDialog-DAPv70p4.js → SaveBlockDialog-eK6fjtTy.js} +86 -86
  31. package/dist/SavedBlocksBrowserModal-D2QHd2Yp.js +359 -0
  32. package/dist/{SavedBlocksPanels-ChbL9v9x.js → SavedBlocksPanels-Cl61f4Mf.js} +9 -9
  33. package/dist/{SavedBlocksPickBar-hRaiLNdu.js → SavedBlocksPickBar-CXP2dkeB.js} +15 -15
  34. package/dist/TemplateSettings-BKJrdZcH.js +294 -0
  35. package/dist/TestEmailModal-DQotJg6g.js +212 -0
  36. package/dist/{TestEmailPanel-COJQa2A9.js → TestEmailPanel-CwiTzJsh.js} +4 -4
  37. package/dist/TitleEditor-CzSvsPAn.js +202 -0
  38. package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
  39. package/dist/Toolbar-Cd75ci5W.js +3711 -0
  40. package/dist/{TplModal-9IndEYk5.js → TplModal-ZoXu40T9.js} +17 -17
  41. package/dist/{VersionHistoryMenu-BG5qayvg.js → VersionHistoryMenu-BvhN-Ofk.js} +39 -39
  42. package/dist/{VersionHistoryPanels-hPg7Q5-f.js → VersionHistoryPanels-DPWMnYbd.js} +5 -5
  43. package/dist/VersionPreviewBanner-CuJnasxH.js +37 -0
  44. package/dist/WrapperBlock-D4fPwO0t.js +44 -0
  45. package/dist/{blockTypeIcons-yt7SLzub.js → blockTypeIcons-BXMxu86H.js} +27 -26
  46. package/dist/bundle-stats.json +8 -8
  47. package/dist/{cdn/chunks/ca-CD-Kt1qz.js → ca-DOuIxWRv.js} +114 -2
  48. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js +107 -0
  49. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js.map +1 -0
  50. package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js → AiAltTextReview-Dtm3A2cD.js} +71 -69
  51. package/dist/cdn/chunks/AiAltTextReview-Dtm3A2cD.js.map +1 -0
  52. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js +487 -0
  53. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js.map +1 -0
  54. package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js → AiPanels-BV5D1itk.js} +11 -11
  55. package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js.map → AiPanels-BV5D1itk.js.map} +1 -1
  56. package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js → AiRewriteMenu-D3jkh6Xb.js} +80 -80
  57. package/dist/cdn/chunks/AiRewriteMenu-D3jkh6Xb.js.map +1 -0
  58. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js +34 -0
  59. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js.map +1 -0
  60. package/dist/cdn/chunks/BlockPreviewCanvas-RQFilqXC.js +142 -0
  61. package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js.map → BlockPreviewCanvas-RQFilqXC.js.map} +1 -1
  62. package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js → CloudHeaderExtras-BtqdN777.js} +4 -4
  63. package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
  64. package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js → CloudPanels-BSJ-Z5Hw.js} +43 -43
  65. package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js.map → CloudPanels-BSJ-Z5Hw.js.map} +1 -1
  66. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js +67 -0
  67. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js.map +1 -0
  68. package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js → CollaboratorBar-Bc9914Az.js} +16 -16
  69. package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js.map → CollaboratorBar-Bc9914Az.js.map} +1 -1
  70. package/dist/cdn/chunks/CommentsPanel-DbR9phAk.js +18 -0
  71. package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js.map → CommentsPanel-DbR9phAk.js.map} +1 -1
  72. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js +496 -0
  73. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js.map +1 -0
  74. package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js → CountdownBlock-CjMhMhnv.js} +26 -26
  75. package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
  76. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js +260 -0
  77. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js.map +1 -0
  78. package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js → IssuesPanel-CUmI4HMm.js} +132 -120
  79. package/dist/cdn/chunks/IssuesPanel-CUmI4HMm.js.map +1 -0
  80. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js +359 -0
  81. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js.map +1 -0
  82. package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js → LoadingTrack-DUYcDHOV.js} +2 -2
  83. package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
  84. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js +47 -0
  85. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js.map +1 -0
  86. package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js → LogicTagInsertButton-5Z3fFzjc.js} +465 -456
  87. package/dist/cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js.map +1 -0
  88. package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js → MediaEditModal-DDCIwr9U.js} +439 -439
  89. package/dist/cdn/chunks/MediaEditModal-DDCIwr9U.js.map +1 -0
  90. package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js → MediaPanels-Dz79oy8P.js} +5 -5
  91. package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js.map → MediaPanels-Dz79oy8P.js.map} +1 -1
  92. package/dist/cdn/chunks/MergeTagInput-CIWy-cXf.js +82 -0
  93. package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js.map → MergeTagInput-CIWy-cXf.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js → MergeTagModeToggle-BrP5GR-x.js} +50 -50
  95. package/dist/cdn/chunks/MergeTagModeToggle-BrP5GR-x.js.map +1 -0
  96. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js +128 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js +660 -0
  99. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js → RestoreVersionDialog-Crj1DBqC.js} +18 -18
  101. package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js.map → RestoreVersionDialog-Crj1DBqC.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js → RichTextEditorContent-rCCqFlwJ.js} +43 -43
  103. package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js.map → RichTextEditorContent-rCCqFlwJ.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js → SaveBlockDialog-C34RW1aM.js} +71 -71
  105. package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js.map → SaveBlockDialog-C34RW1aM.js.map} +1 -1
  106. package/dist/cdn/chunks/SavedBlocksBrowserModal-CJnwWPT-.js +356 -0
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B9XCjDfm.js.map → SavedBlocksBrowserModal-CJnwWPT-.js.map} +1 -1
  108. package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js → SavedBlocksPanels-CA2PqXIH.js} +9 -9
  109. package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js.map → SavedBlocksPanels-CA2PqXIH.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js → SavedBlocksPickBar-Dj3ortee.js} +16 -16
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js.map → SavedBlocksPickBar-Dj3ortee.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js +266 -0
  113. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js.map +1 -0
  114. package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js → TestEmailModal-BXeCtTjU.js} +81 -78
  115. package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js.map +1 -0
  116. package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js → TestEmailPanel-CpZcpB9D.js} +5 -5
  117. package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js.map → TestEmailPanel-CpZcpB9D.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js +202 -0
  119. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js.map +1 -0
  120. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js +45 -0
  121. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js.map +1 -0
  122. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js +3626 -0
  123. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js.map +1 -0
  124. package/dist/cdn/chunks/{TplModal-BDyeS69p.js → TplModal-DDDUDMYC.js} +19 -19
  125. package/dist/cdn/chunks/{TplModal-BDyeS69p.js.map → TplModal-DDDUDMYC.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js → VersionHistoryMenu-DSElv3Sv.js} +36 -36
  127. package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js.map → VersionHistoryMenu-DSElv3Sv.js.map} +1 -1
  128. package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js → VersionHistoryPanels-H2nuik1l.js} +6 -6
  129. package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js.map → VersionHistoryPanels-H2nuik1l.js.map} +1 -1
  130. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js +39 -0
  131. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js.map +1 -0
  132. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js +46 -0
  133. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js.map +1 -0
  134. package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js +21 -0
  135. package/dist/cdn/chunks/blockTypeIcons-DMgLcuI8.js.map +1 -0
  136. package/dist/{ca-CD-Kt1qz.js → cdn/chunks/ca-DOuIxWRv.js} +116 -0
  137. package/dist/cdn/chunks/ca-DOuIxWRv.js.map +1 -0
  138. package/dist/cdn/chunks/composables-D0UYam2P.js +3039 -0
  139. package/dist/cdn/chunks/composables-D0UYam2P.js.map +1 -0
  140. package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js → createCloudRuntime-BdsclY8_.js} +85 -83
  141. package/dist/cdn/chunks/createCloudRuntime-BdsclY8_.js.map +1 -0
  142. package/dist/{de-CeFJ6wbM.js → cdn/chunks/de-DaOUfYBX.js} +116 -0
  143. package/dist/cdn/chunks/de-DaOUfYBX.js.map +1 -0
  144. package/dist/{dist-CEdyyDn7.js → cdn/chunks/dist-BzXULHvI.js} +63 -61
  145. package/dist/cdn/chunks/{dist-C2epoAwW.js.map → dist-BzXULHvI.js.map} +1 -1
  146. package/dist/{dist-BA-jTQgw.js → cdn/chunks/dist-DqGgijFI.js} +108 -109
  147. package/dist/cdn/chunks/{dist-CONcGNwy.js.map → dist-DqGgijFI.js.map} +1 -1
  148. package/dist/cdn/chunks/{draggable-B8hTTYFO.js → draggable-DepKdldn.js} +1384 -1376
  149. package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
  150. package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js → editor-modal-CPbgthOv.js} +986 -986
  151. package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js.map → editor-modal-CPbgthOv.js.map} +1 -1
  152. package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
  153. package/dist/cdn/chunks/en-C0pHHMiR.js.map +1 -0
  154. package/dist/cdn/chunks/en-IYVryJRl.js +1 -0
  155. package/dist/{es-zDacbMhs.js → cdn/chunks/es-CxyEKr6n.js} +116 -0
  156. package/dist/cdn/chunks/es-CxyEKr6n.js.map +1 -0
  157. package/dist/cdn/chunks/{extensions-ClDhn88e.js → extensions-Uh9vuFfK.js} +57 -57
  158. package/dist/cdn/chunks/{extensions-ClDhn88e.js.map → extensions-Uh9vuFfK.js.map} +1 -1
  159. package/dist/{fr-CSgYtjOd.js → cdn/chunks/fr-CYbamiI6.js} +116 -0
  160. package/dist/cdn/chunks/fr-CYbamiI6.js.map +1 -0
  161. package/dist/cdn/chunks/{icons-HCBP93Ch.js → icons-CSSMtbGK.js} +187 -144
  162. package/dist/cdn/chunks/icons-CSSMtbGK.js.map +1 -0
  163. package/dist/{ja-B7H3ID8O.js → cdn/chunks/ja-DfaIAoGI.js} +116 -0
  164. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +1 -0
  165. package/dist/cdn/chunks/keys-CoQtCqNv.js +11 -0
  166. package/dist/cdn/chunks/keys-CoQtCqNv.js.map +1 -0
  167. package/dist/cdn/chunks/languageName-DEEOhDWI.js +12 -0
  168. package/dist/cdn/chunks/languageName-DEEOhDWI.js.map +1 -0
  169. package/dist/cdn/chunks/{liquid.browser-DkLBNrft.js → liquid.browser-rubac0VA.js} +782 -746
  170. package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
  171. package/dist/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
  172. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
  173. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js +290 -0
  174. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js.map +1 -0
  175. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
  176. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
  177. package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
  178. package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
  179. package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js → preRenderCustomBlocks-C8k7tw98.js} +5 -5
  180. package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js.map → preRenderCustomBlocks-C8k7tw98.js.map} +1 -1
  181. package/dist/cdn/chunks/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +115 -1
  182. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
  183. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js +61 -0
  184. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js.map +1 -0
  185. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js +2638 -0
  186. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js.map +1 -0
  187. package/dist/cdn/chunks/src-CACM3o--.js +2606 -0
  188. package/dist/cdn/chunks/src-CACM3o--.js.map +1 -0
  189. package/dist/cdn/chunks/{src-CUH_EI7k.js → src-Ddpm4HsS.js} +225 -259
  190. package/dist/cdn/chunks/src-Ddpm4HsS.js.map +1 -0
  191. package/dist/cdn/chunks/{src-BKpAis_q.js → src-DheBmnvF.js} +635 -478
  192. package/dist/cdn/chunks/src-DheBmnvF.js.map +1 -0
  193. package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
  194. package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
  195. package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
  196. package/dist/cdn/chunks/{tiptap-ChSZybTi.js → tiptap-Dipw_zOQ.js} +48 -48
  197. package/dist/cdn/chunks/{tiptap-ChSZybTi.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
  198. package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js → useCloudI18n-Cc5NZqiI.js} +3 -3
  199. package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
  200. package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
  201. package/dist/cdn/chunks/{useEditorRoot-BT3c9CXj.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
  202. package/dist/cdn/chunks/{useI18n-11iqzC6m.js → useI18n-BnJYydPv.js} +3 -3
  203. package/dist/cdn/chunks/{useI18n-11iqzC6m.js.map → useI18n-BnJYydPv.js.map} +1 -1
  204. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +33 -0
  205. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js.map +1 -0
  206. package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js → useLogicTag-B7RpqVFQ.js} +5 -5
  207. package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js.map → useLogicTag-B7RpqVFQ.js.map} +1 -1
  208. package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js → useMergeTag-C-32ETjj.js} +6 -6
  209. package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js.map → useMergeTag-C-32ETjj.js.map} +1 -1
  210. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
  211. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
  212. package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
  213. package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
  214. package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js → withCurrentFont-D33ZXoWp.js} +2 -2
  215. package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js.map → withCurrentFont-D33ZXoWp.js.map} +1 -1
  216. package/dist/cdn/editor.css +1 -1
  217. package/dist/cdn/editor.js +2503 -1809
  218. package/dist/cdn/editor.js.map +1 -1
  219. package/dist/{check-N3x4z_rH.js → check-ChQ0l8EQ.js} +1 -1
  220. package/dist/{chevron-down-gXu9qNwO.js → chevron-down-Bh6cp6PI.js} +1 -1
  221. package/dist/{chevron-right-rL0ayGk5.js → chevron-right-LUgdqdoW.js} +1 -1
  222. package/dist/{chevron-up-0ugh8HnW.js → chevron-up-XsDeJxQN.js} +1 -1
  223. package/dist/{circle-alert-B9Ls75B5.js → circle-alert-lODfDsrj.js} +1 -1
  224. package/dist/{clock-BqHBaCLm.js → clock-DrqFEZkT.js} +1 -1
  225. package/dist/composables-BOP3ERRP.js +4517 -0
  226. package/dist/{createCloudRuntime-B5VIdnwz.js → createCloudRuntime-DGV5a5Af.js} +47 -45
  227. package/dist/{createLucideIcon-BV7Gwz_Z.js → createLucideIcon-Dw5e5gVE.js} +16 -16
  228. package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
  229. package/dist/{cdn/chunks/dist-CONcGNwy.js → dist-0alKVRc_.js} +100 -99
  230. package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
  231. package/dist/dist-6DU0me3E.js +4 -0
  232. package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
  233. package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
  234. package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
  235. package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
  236. package/dist/{cdn/chunks/dist-C2epoAwW.js → dist-CX7skkvG.js} +29 -31
  237. package/dist/dist-CcOn7WCo.js +4 -0
  238. package/dist/dist-Cdkm20M6.js +2542 -0
  239. package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
  240. package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
  241. package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
  242. package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
  243. package/dist/{dist-DDN7yR-w.js → dist-fqSers8_.js} +131 -131
  244. package/dist/{editor-modal-Du9VI9q4.js → editor-modal-B_2EAOjN.js} +907 -906
  245. package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
  246. package/dist/en-DTtwco2Q.js +1 -0
  247. package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
  248. package/dist/{extensions-FRYhx7qa.js → extensions-DOLZkLzV.js} +173 -173
  249. package/dist/{eye-BKj9Tfnc.js → eye-DChfk0gi.js} +1 -1
  250. package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
  251. package/dist/{image-DNdvdTla.js → image--Hj2by1G.js} +1 -1
  252. package/dist/index.d.ts +182 -14
  253. package/dist/{info-Bx-kBkbH.js → info-BbXgy82f.js} +1 -1
  254. package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
  255. package/dist/keys-BCqskl51.js +9 -0
  256. package/dist/languageName-DEEOhDWI.js +10 -0
  257. package/dist/{link-D8-rYdIQ.js → link-C2_8yJno.js} +1 -1
  258. package/dist/{liquid.browser-D1RxawkY.js → liquid.browser-DUXEekoN.js} +781 -745
  259. package/dist/{list-BneisA27.js → list-DLGs2n0V.js} +1 -1
  260. package/dist/{loader-circle-DBEXphyx.js → loader-circle-BbDItE_O.js} +1 -1
  261. package/dist/{message-circle-Bg4xInCM.js → message-circle-NAModq0p.js} +1 -1
  262. package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
  263. package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
  264. package/dist/noticeTones-D7BPu-Le.js +14 -0
  265. package/dist/{package-B40Vkfsp.js → package-BuzsfRyH.js} +1 -1
  266. package/dist/{pencil-CYdAHTds.js → pencil-BTUUECH4.js} +1 -1
  267. package/dist/plural-CyxrJXL1.js +15 -0
  268. package/dist/plus-Dm7DN65T.js +13 -0
  269. package/dist/{preRenderCustomBlocks-AbZArwkR.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -4
  270. package/dist/{pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -0
  271. package/dist/{refresh-cw-Bb1FWrU0.js → refresh-cw-xMURqGWi.js} +2 -12
  272. package/dist/rotate-ccw-DqVcEIn5.js +13 -0
  273. package/dist/{runtime-dom.esm-bundler-CLGymEyk.js → runtime-dom.esm-bundler-DlHp8xgy.js} +167 -167
  274. package/dist/sanitizeHtml-mKgNUdME.js +962 -0
  275. package/dist/{search-BZEo08gi.js → search-Cfr3W44N.js} +1 -1
  276. package/dist/{send-DHtrnXQs.js → send-CH1SrvyB.js} +1 -1
  277. package/dist/{smartphone-dlN3vpA3.js → smartphone-pAkvzjdI.js} +1 -1
  278. package/dist/socialIcons-Dqr4DJOz.js +2705 -0
  279. package/dist/{sparkles-NOttoDnJ.js → sparkles-CRO0cCnp.js} +1 -1
  280. package/dist/{square-B1CJgdt2.js → square-CaQWMntx.js} +1 -1
  281. package/dist/style.css +1 -1
  282. package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
  283. package/dist/templatical-editor.js +2294 -1608
  284. package/dist/{text-align-start-zpoXmb-Z.js → text-align-start-BQ39AaRK.js} +1 -1
  285. package/dist/{trash-CGbk4Sgt.js → trash-BL5gEFHN.js} +1 -1
  286. package/dist/{triangle-alert-CKLMyGVp.js → triangle-alert-BYbKu7zZ.js} +1 -1
  287. package/dist/{upload-DQoackAn.js → upload-BhmL4Vqx.js} +1 -1
  288. package/dist/{useCloudI18n-DcLtxOQZ.js → useCloudI18n-Dh2iydo1.js} +4 -4
  289. package/dist/useEditorRoot-DY3mgcHm.js +7 -0
  290. package/dist/{useI18n-CeTm777E.js → useI18n-CgtvtF4C.js} +4 -4
  291. package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
  292. package/dist/{useLogicTag-DFDYJeMN.js → useLogicTag-BXXXQQmi.js} +4 -4
  293. package/dist/{useMergeTag-B46vACAG.js → useMergeTag-C9Okr87y.js} +5 -5
  294. package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
  295. package/dist/{useScrollToBlock-C-NzvjeO.js → useScrollToBlock-C0Kapxdh.js} +5 -5
  296. package/dist/{vue.runtime.esm-bundler-CrlI8j5R.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1247 -1239
  297. package/dist/withCurrentFont-DJiQqZzL.js +18 -0
  298. package/dist/{x-zcrnmcmU.js → x-B7NZYzhx.js} +1 -1
  299. package/package.json +23 -23
  300. package/dist/AiAltTextPopover-Cm11CsKH.js +0 -105
  301. package/dist/BlockIssueBadge-6Ri2FfX-.js +0 -33
  302. package/dist/BlockPreviewCanvas-Df9iz7sK.js +0 -140
  303. package/dist/CollaborationNotices-JQ3vQoqO.js +0 -75
  304. package/dist/CommentsPanel-BuftXc0U.js +0 -16
  305. package/dist/CommentsSidebar-Co3x4uH0.js +0 -499
  306. package/dist/CountdownToolbar-CrL4WKy9.js +0 -197
  307. package/dist/MergeTagInput-DE7kWwXx.js +0 -80
  308. package/dist/MergeTagTextarea-DVPQkiYY.js +0 -69
  309. package/dist/SavedBlocksBrowserModal-SRtN5h9q.js +0 -359
  310. package/dist/TemplateSettings-D0XcH32O.js +0 -236
  311. package/dist/TestEmailModal-Cb5t0yB2.js +0 -209
  312. package/dist/TitleEditor-BYk_9SpQ.js +0 -198
  313. package/dist/ToggleSwitch-poGWbduy.js +0 -36
  314. package/dist/Toolbar-Dku_pZni.js +0 -3145
  315. package/dist/VersionPreviewBanner-CSs7zum_.js +0 -37
  316. package/dist/WrapperBlock-DwjK_IdJ.js +0 -44
  317. package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js +0 -106
  318. package/dist/cdn/chunks/AiAltTextPopover-DjMoJCgU.js.map +0 -1
  319. package/dist/cdn/chunks/AiAltTextReview-BafAtBoA.js.map +0 -1
  320. package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js +0 -474
  321. package/dist/cdn/chunks/AiChatPanel-DXeZgc7D.js.map +0 -1
  322. package/dist/cdn/chunks/AiRewriteMenu-4F6vwhJ5.js.map +0 -1
  323. package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js +0 -34
  324. package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js.map +0 -1
  325. package/dist/cdn/chunks/BlockPreviewCanvas-Ny1X_mee.js +0 -142
  326. package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js +0 -77
  327. package/dist/cdn/chunks/CollaborationNotices-Hf8r08Sw.js.map +0 -1
  328. package/dist/cdn/chunks/CommentsPanel-CAiwilM2.js +0 -18
  329. package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js +0 -469
  330. package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js.map +0 -1
  331. package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js +0 -199
  332. package/dist/cdn/chunks/CountdownToolbar-CguFJdqn.js.map +0 -1
  333. package/dist/cdn/chunks/IssuesPanel-pr7_nuLI.js.map +0 -1
  334. package/dist/cdn/chunks/LogicTagInsertButton-B_ldj3TO.js.map +0 -1
  335. package/dist/cdn/chunks/MediaEditModal-CGfzcHwP.js.map +0 -1
  336. package/dist/cdn/chunks/MergeTagModeToggle-BFpK5dxg.js.map +0 -1
  337. package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js +0 -71
  338. package/dist/cdn/chunks/MergeTagTextarea-Zo0mYWbf.js.map +0 -1
  339. package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js +0 -631
  340. package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js.map +0 -1
  341. package/dist/cdn/chunks/SavedBlocksBrowserModal-B9XCjDfm.js +0 -356
  342. package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js +0 -208
  343. package/dist/cdn/chunks/TemplateSettings-jWpmuWDR.js.map +0 -1
  344. package/dist/cdn/chunks/TestEmailModal-DcwKhFnI.js.map +0 -1
  345. package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js +0 -198
  346. package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js.map +0 -1
  347. package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js +0 -38
  348. package/dist/cdn/chunks/ToggleSwitch-BDMugNES.js.map +0 -1
  349. package/dist/cdn/chunks/Toolbar-CnvfW72e.js +0 -3061
  350. package/dist/cdn/chunks/Toolbar-CnvfW72e.js.map +0 -1
  351. package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js +0 -39
  352. package/dist/cdn/chunks/VersionPreviewBanner-CZ--HOoa.js.map +0 -1
  353. package/dist/cdn/chunks/WrapperBlock-D3obNGab.js +0 -46
  354. package/dist/cdn/chunks/WrapperBlock-D3obNGab.js.map +0 -1
  355. package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js +0 -21
  356. package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js.map +0 -1
  357. package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
  358. package/dist/cdn/chunks/createCloudRuntime-D6niZ2Rc.js.map +0 -1
  359. package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
  360. package/dist/cdn/chunks/draggable-B8hTTYFO.js.map +0 -1
  361. package/dist/cdn/chunks/en-CKAXAo3Z.js +0 -1
  362. package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
  363. package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
  364. package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
  365. package/dist/cdn/chunks/icons-HCBP93Ch.js.map +0 -1
  366. package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
  367. package/dist/cdn/chunks/keys-BF9gazbd.js +0 -11
  368. package/dist/cdn/chunks/keys-BF9gazbd.js.map +0 -1
  369. package/dist/cdn/chunks/liquid.browser-DkLBNrft.js.map +0 -1
  370. package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
  371. package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js +0 -198
  372. package/dist/cdn/chunks/normalizeMergeTagMarkup-DpHCSESZ.js.map +0 -1
  373. package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
  374. package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js +0 -72
  375. package/dist/cdn/chunks/sanitizeHtml-B2h15u0_.js.map +0 -1
  376. package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js +0 -2008
  377. package/dist/cdn/chunks/socialIcons-rJoqO1TJ.js.map +0 -1
  378. package/dist/cdn/chunks/src-BKpAis_q.js.map +0 -1
  379. package/dist/cdn/chunks/src-C9DTvn1H.js +0 -1423
  380. package/dist/cdn/chunks/src-C9DTvn1H.js.map +0 -1
  381. package/dist/cdn/chunks/src-CUH_EI7k.js.map +0 -1
  382. package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
  383. package/dist/cdn/chunks/useEditorCore-CjaEV_01.js +0 -2534
  384. package/dist/cdn/chunks/useEditorCore-CjaEV_01.js.map +0 -1
  385. package/dist/cdn/chunks/useEditorRoot-BT3c9CXj.js +0 -9
  386. package/dist/cdn/chunks/usePopoverPosition-AnVIwiVv.js +0 -70
  387. package/dist/cdn/chunks/usePopoverPosition-AnVIwiVv.js.map +0 -1
  388. package/dist/cdn/chunks/useScrollToBlock-C0dawxGr.js.map +0 -1
  389. package/dist/dist-CzrLYq2s.js +0 -1363
  390. package/dist/dist-DyFArF_G.js +0 -4
  391. package/dist/dist-pA3ooG6N.js +0 -4
  392. package/dist/en-CyEE7FPY.js +0 -1
  393. package/dist/keys-DBjrQkYH.js +0 -9
  394. package/dist/normalizeMergeTagMarkup-IH8COHzd.js +0 -196
  395. package/dist/sanitizeHtml-CnOA1efV.js +0 -942
  396. package/dist/socialIcons-B_d52_eS.js +0 -2075
  397. package/dist/useEditorCore-DG9UvWUm.js +0 -4011
  398. package/dist/useEditorRoot-BKr6nNkC.js +0 -7
  399. package/dist/usePopoverPosition-C42kD7zt.js +0 -68
  400. package/dist/withCurrentFont-v_a4Oso8.js +0 -18
@@ -1,2534 +0,0 @@
1
- import { $ as e, A as t, C as n, D as r, F as i, I as a, J as o, L as s, M as c, P as l, S as u, T as d, U as f, V as p, W as m, X as h, _ as g, at as _, b as v, c as y, dt as b, g as x, h as S, it as C, j as w, l as T, lt as E, m as D, ot as O, p as k, q as A, s as j, t as M, tt as N, u as P, ut as F, x as I, z as L } from "./draggable-B8hTTYFO.js";
2
- import { $ as ee, B as R, Bt as z, E as B, F as V, Ft as H, G as te, Gt as ne, H as re, I as ie, J as U, Jt as W, K as ae, Kt as oe, L as se, Mt as ce, Nt as le, O as ue, Ot as de, P as fe, Q as pe, R as me, T as he, U as ge, Ut as _e, V as ve, Wt as ye, Y as be, a as xe, b as Se, c as Ce, d as we, f as Te, g as Ee, h as De, i as Oe, jt as ke, l as Ae, m as je, n as Me, nt as Ne, o as Pe, ot as Fe, p as Ie, q as Le, qt as Re, r as ze, rt as Be, t as Ve, tt as He, u as Ue, y as We, yt as Ge, z as Ke, zt as qe } from "./src-C9DTvn1H.js";
3
- import { C as Je, I as Ye, L as Xe, M as Ze, N as Qe, P as $e, R as et, S as tt, _ as nt, a as rt, b as it, d as at, g as ot, l as st, m as ct, n as lt, t as ut, v as dt, w as ft } from "./socialIcons-rJoqO1TJ.js";
4
- import { _ as pt, h as mt, v as ht, y as gt } from "./dist-C2epoAwW.js";
5
- import { a as _t, c as vt, i as yt } from "./dist-CONcGNwy.js";
6
- import { $ as G, A as bt, B as xt, C as St, D as Ct, E as wt, F as Tt, H as Et, I as Dt, J as Ot, K as kt, L as At, M as jt, N as Mt, O as K, P as Nt, Q as q, R as Pt, S as Ft, T as It, V as Lt, W as Rt, X as zt, Y as Bt, Z as Vt, _ as Ht, a as Ut, b as Wt, c as Gt, d as Kt, f as qt, g as J, h as Jt, j as Yt, k as Xt, l as Zt, m as Qt, n as $t, o as en, p as tn, q as nn, r as rn, s as an, v as Y, w as on, x as sn, y as cn, z as ln } from "./keys-BF9gazbd.js";
7
- import { t as X } from "./logger-CqQTfJGx.js";
8
- import { t as Z } from "./useI18n-11iqzC6m.js";
9
- import { i as un, r as dn, s as fn, t as pn } from "./usePopoverPosition-AnVIwiVv.js";
10
- import { r as mn, t as hn } from "./templateSettingsFields-cjlP-jdw.js";
11
- import { n as gn, t as _n } from "./sanitizeHtml-B2h15u0_.js";
12
- import { At as vn, Et as yn, Ht as bn, Ot as xn, V as Sn, Vt as Cn, X as wn, d as Tn, f as En, ht as Dn, k as On, nt as kn, o as An, vt as jn, xt as Mn, y as Nn } from "./icons-HCBP93Ch.js";
13
- import { t as Pn } from "./LoadingTrack-DfJ_C33G.js";
14
- import { t as Fn } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
15
- import { t as In } from "./useEditorRoot-BT3c9CXj.js";
16
- import "./useCloudI18n-RJXyVnIf.js";
17
- import { t as Ln } from "./useMergeTag-BFBBjnwh.js";
18
- import { t as Rn } from "./useLogicTag-vy5KGg5D.js";
19
- import { t as zn } from "./readableTextColor-BfZUGnVj.js";
20
- // src/utils/activeEditorTracker.ts
21
- var Bn = /* @__PURE__ */ new Set(), Q = 0, Vn = 0;
22
- function Hn() {
23
- let e = ++Vn;
24
- return Bn.add(e), Q === 0 && (Q = e), {
25
- id: e,
26
- isActive: () => Bn.size <= 1 || Q === e,
27
- claim: () => {
28
- Q = e;
29
- },
30
- dispose: () => {
31
- if (Bn.delete(e), Q === e) {
32
- let e = Array.from(Bn);
33
- Q = e[e.length - 1] ?? 0;
34
- }
35
- }
36
- };
37
- }
38
- // src/composables/usePreviewResolution.ts
39
- var Un = 500;
40
- function Wn(t) {
41
- let n = typeof t.resolvePreview == "function", r = e(null), i = e(!1), a = e(!1), o = 0, s = null;
42
- function c() {
43
- s !== null && (clearTimeout(s), s = null);
44
- }
45
- async function l() {
46
- let e = t.resolvePreview;
47
- if (!e) return;
48
- let n = ++o;
49
- i.value = !0;
50
- let s = {
51
- content: de(t.getContent()),
52
- ...t.getRecipient?.() === void 0 ? {} : { recipient: t.getRecipient() }
53
- };
54
- try {
55
- let t = await e(s);
56
- if (n !== o) return;
57
- if (!Ve(t)) {
58
- a.value = !0;
59
- return;
60
- }
61
- r.value = t, a.value = !1;
62
- } catch {
63
- if (n !== o) return;
64
- a.value = !0;
65
- } finally {
66
- n === o && (i.value = !1);
67
- }
68
- }
69
- function u() {
70
- n && (c(), r.value === null ? l() : s = setTimeout(() => {
71
- s = null, l();
72
- }, Un));
73
- }
74
- return p(() => [t.isActive(), t.getRecipient?.()], ([e]) => {
75
- e ? u() : (c(), o++, i.value = !1, r.value = null, a.value = !1);
76
- }, { immediate: !0 }), h(() => {
77
- c(), o++;
78
- }), {
79
- isConfigured: n,
80
- content: k(() => r.value ?? t.getContent()),
81
- isResolving: i,
82
- isInitialResolve: k(() => i.value && r.value === null),
83
- hasFailed: a,
84
- supersedesSamples: k(() => n)
85
- };
86
- }
87
- // src/composables/useMergeTagPicker.ts
88
- function Gn() {
89
- let t = e(!1), n = e([]), r = e(null), i = null;
90
- function a(e, a) {
91
- if (i) {
92
- let e = i;
93
- i = null, e(null);
94
- }
95
- return n.value = e, r.value = a?.current ?? null, t.value = !0, new Promise((e) => {
96
- i = e;
97
- });
98
- }
99
- function o(e) {
100
- let a = i;
101
- i = null, t.value = !1, n.value = [], r.value = null, a && a(e);
102
- }
103
- return A() && h(() => {
104
- if (i) {
105
- let e = i;
106
- i = null, e(null);
107
- }
108
- t.value = !1, n.value = [], r.value = null;
109
- }), {
110
- isOpen: t,
111
- tags: n,
112
- current: r,
113
- open: a,
114
- resolve: o
115
- };
116
- }
117
- // src/composables/useLogicTagPicker.ts
118
- function Kn() {
119
- let t = e(!1), n = e([]), r = e([]), i = null;
120
- function a(e, a) {
121
- if (i) {
122
- let e = i;
123
- i = null, e(null);
124
- }
125
- return n.value = e, r.value = a, t.value = !0, new Promise((e) => {
126
- i = e;
127
- });
128
- }
129
- function o(e) {
130
- let a = i;
131
- i = null, t.value = !1, n.value = [], r.value = [], a && a(e);
132
- }
133
- return A() && h(() => {
134
- if (i) {
135
- let e = i;
136
- i = null, e(null);
137
- }
138
- t.value = !1, n.value = [], r.value = [];
139
- }), {
140
- isOpen: t,
141
- tags: n,
142
- pairs: r,
143
- open: a,
144
- resolve: o
145
- };
146
- }
147
- // src/composables/useTemplateLint.ts
148
- function qn(e) {
149
- return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 && e.deliverability === !1 && e.compatibility === !1 : !1;
150
- }
151
- var Jn = !1;
152
- function Yn(t) {
153
- let n = e([]), r = e(0), i = e(-1), a = p(t.content, () => {
154
- r.value++;
155
- }, {
156
- deep: !0,
157
- flush: "sync"
158
- }), o = e(!1), s = e(!1), c = N(null), l = qn(t.options), u = null, d = !1;
159
- l || f();
160
- async function f() {
161
- try {
162
- let e = await import("./src-BKpAis_q.js");
163
- if (d) return;
164
- c.value = { lintTemplate: e.lintTemplate }, o.value = !0, m(), u = gt(t.content, m, {
165
- debounce: t.debounce ?? 500,
166
- deep: !0
167
- });
168
- } catch {
169
- if (d) return;
170
- s.value = !0, Jn || (Jn = !0, X.info("@templatical/quality isn't installed, so the Issues panel and its lint badges are off. Add @templatical/quality to your dependencies to turn them on."));
171
- }
172
- }
173
- function m() {
174
- if (!c.value) return;
175
- let e = c.value.lintTemplate(t.content.value, t.options);
176
- i.value = r.value, n.value = e;
177
- }
178
- let h = p(() => t.options, () => {
179
- c.value && m();
180
- }, { deep: !0 });
181
- function g(e) {
182
- e.fix && e.fix.apply({
183
- updateBlock: t.updateBlock,
184
- updateSettings: t.updateSettings,
185
- removeBlock: t.removeBlock
186
- });
187
- }
188
- function _() {
189
- d = !0, u?.(), a(), h();
190
- }
191
- return {
192
- issues: n,
193
- contentVersion: r,
194
- lintVersion: i,
195
- ready: o,
196
- unavailable: s,
197
- applyFix: g,
198
- destroy: _
199
- };
200
- }
201
- // src/composables/useKeyboardReorder.ts
202
- function Xn(t, n, r = []) {
203
- let i = e(null), a = e(""), o = null;
204
- function s(e) {
205
- let n = t.content.value.blocks, r = n.findIndex((t) => t.id === e);
206
- if (r !== -1) return {
207
- index: r,
208
- total: n.length
209
- };
210
- for (let t of n) {
211
- if (t.type !== "section") continue;
212
- let n = t;
213
- for (let t = 0; t < n.children.length; t++) {
214
- let r = n.children[t], i = r.findIndex((t) => t.id === e);
215
- if (i !== -1) return {
216
- index: i,
217
- total: r.length,
218
- sectionId: n.id,
219
- columnIndex: t
220
- };
221
- }
222
- }
223
- return null;
224
- }
225
- function c(e) {
226
- let i = s(e);
227
- if (!i) return "";
228
- let a = (i.sectionId ? l(i.sectionId, i.columnIndex ?? 0) : t.content.value.blocks)?.[i.index];
229
- return a ? dt(a, n.t, r) : "";
230
- }
231
- function l(e, n) {
232
- return t.content.value.blocks.find((t) => t.id === e && t.type === "section")?.children[n] ?? null;
233
- }
234
- function u(e) {
235
- a.value = "", queueMicrotask(() => {
236
- a.value = e;
237
- });
238
- }
239
- function d(e) {
240
- return i.value === e;
241
- }
242
- function f(e) {
243
- let t = s(e);
244
- t && (i.value = e, o = t, u(n.format(n.t.blockActions.lifted, {
245
- block: c(e),
246
- position: String(t.index + 1),
247
- total: String(t.total)
248
- })));
249
- }
250
- function p(e, r) {
251
- let i = s(e);
252
- if (!i) return;
253
- let a = i.index + r;
254
- a < 0 || a >= i.total || (t.moveBlock(e, a, i.sectionId, i.columnIndex), u(n.format(n.t.blockActions.moved, {
255
- block: c(e),
256
- position: String(a + 1),
257
- total: String(i.total)
258
- })));
259
- }
260
- function m(e) {
261
- p(e, -1);
262
- }
263
- function h(e) {
264
- p(e, 1);
265
- }
266
- function g(e) {
267
- let t = s(e);
268
- t && u(n.format(n.t.blockActions.dropped, {
269
- block: c(e),
270
- position: String(t.index + 1),
271
- total: String(t.total)
272
- })), i.value = null, o = null;
273
- }
274
- function _() {
275
- let e = i.value;
276
- if (e && o) {
277
- let r = s(e);
278
- r && (r && (r.sectionId !== o.sectionId || r.columnIndex !== o.columnIndex) || r && r.index !== o.index) && t.moveBlock(e, o.index, o.sectionId, o.columnIndex), u(n.format(n.t.blockActions.cancelled, {
279
- block: c(e),
280
- position: String(o.index + 1)
281
- }));
282
- }
283
- i.value = null, o = null;
284
- }
285
- return {
286
- liftedBlockId: i,
287
- announcement: a,
288
- isLifted: d,
289
- lift: f,
290
- cancel: _,
291
- moveUp: m,
292
- moveDown: h,
293
- drop: g
294
- };
295
- }
296
- // src/composables/useUiTheme.ts
297
- function Zn(e) {
298
- let t = vt("(prefers-color-scheme: dark)");
299
- return { resolvedTheme: k(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
300
- }
301
- // src/composables/useThemeStyles.ts
302
- var Qn = {
303
- bg: "--tpl-bg",
304
- bgElevated: "--tpl-bg-elevated",
305
- bgHover: "--tpl-bg-hover",
306
- bgActive: "--tpl-bg-active",
307
- border: "--tpl-border",
308
- borderLight: "--tpl-border-light",
309
- text: "--tpl-text",
310
- textMuted: "--tpl-text-muted",
311
- textDim: "--tpl-text-dim",
312
- primary: "--tpl-primary",
313
- primaryHover: "--tpl-primary-hover",
314
- primaryLight: "--tpl-primary-light",
315
- secondary: "--tpl-secondary",
316
- secondaryHover: "--tpl-secondary-hover",
317
- secondaryLight: "--tpl-secondary-light",
318
- success: "--tpl-success",
319
- successLight: "--tpl-success-light",
320
- warning: "--tpl-warning",
321
- warningLight: "--tpl-warning-light",
322
- danger: "--tpl-danger",
323
- dangerLight: "--tpl-danger-light",
324
- canvasBg: "--tpl-canvas-bg"
325
- };
326
- function $n({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
327
- return { themeStyles: k(() => {
328
- let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
329
- if (a) for (let [e, t] of Object.entries(Qn)) {
330
- let n = a[e];
331
- n && (r[t] = n);
332
- }
333
- return n && Object.assign(r, n()), r;
334
- }) };
335
- }
336
- // src/composables/useBlockRegistry.ts
337
- function er() {
338
- let e = N(/* @__PURE__ */ new Map());
339
- function t(t, n) {
340
- e.value.set(t, n), _(e);
341
- }
342
- function n(t, n) {
343
- let r = `custom:${t.type}`;
344
- e.value.set(r, {
345
- component: n,
346
- createBlock: () => se(t),
347
- definition: t
348
- }), _(e);
349
- }
350
- function r(t) {
351
- if (t.type === "custom") {
352
- let n = `custom:${t.customType}`;
353
- return e.value.get(n)?.component;
354
- }
355
- return e.value.get(t.type)?.component;
356
- }
357
- function i(t) {
358
- return e.value.get(t)?.createBlock();
359
- }
360
- function a(t) {
361
- let n = `custom:${t}`;
362
- return e.value.get(n)?.definition;
363
- }
364
- function o(e) {
365
- return `<div style="color: var(--tpl-text-muted); padding: 16px; text-align: center; border: 1px dashed var(--tpl-border); border-radius: var(--tpl-radius-sm); font-family: var(--tpl-font-family); font-size: 14px;">${e}</div>`;
366
- }
367
- async function s(e) {
368
- let t = a(e.customType);
369
- if (!t) return o("Block definition not found");
370
- try {
371
- return await pe(await import("./liquid.browser-DkLBNrft.js")).parseAndRender(t.template, e.fieldValues);
372
- } catch (t) {
373
- return X.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
374
- }
375
- }
376
- function c(t) {
377
- return e.value.has(t);
378
- }
379
- return {
380
- registerBuiltIn: t,
381
- registerCustom: n,
382
- getComponent: r,
383
- createBlock: i,
384
- getDefinition: a,
385
- renderCustomBlock: s,
386
- isRegistered: c
387
- };
388
- }
389
- // src/composables/useCustomBlockStylesheets.ts
390
- function tr(e, t) {
391
- return k(() => {
392
- let n = nr(e.value.blocks);
393
- if (n.size === 0) return [];
394
- let r = /* @__PURE__ */ new Set(), i = [];
395
- for (let e of n) {
396
- let n = t.getDefinition(e)?.stylesheet;
397
- if (!n) continue;
398
- let a = n.trim();
399
- a === "" || r.has(a) || (r.add(a), i.push(a));
400
- }
401
- return i;
402
- });
403
- }
404
- function nr(e) {
405
- let t = /* @__PURE__ */ new Set();
406
- return rr(e, t), t;
407
- }
408
- function rr(e, t) {
409
- for (let n of e) if (Fe(n)) t.add(n.customType);
410
- else if (n.type === "section") {
411
- let e = n.children;
412
- if (!e) continue;
413
- for (let n of e) rr(n, t);
414
- } else Ge(n) && rr(n.children, t);
415
- }
416
- // src/utils/registerBuiltInBlocks.ts
417
- var ir = [
418
- {
419
- type: "section",
420
- createBlock: ge
421
- },
422
- {
423
- type: "title",
424
- createBlock: U
425
- },
426
- {
427
- type: "paragraph",
428
- createBlock: re
429
- },
430
- {
431
- type: "image",
432
- createBlock: R
433
- },
434
- {
435
- type: "button",
436
- createBlock: V
437
- },
438
- {
439
- type: "divider",
440
- createBlock: me
441
- },
442
- {
443
- type: "video",
444
- createBlock: be
445
- },
446
- {
447
- type: "social",
448
- createBlock: te
449
- },
450
- {
451
- type: "menu",
452
- createBlock: ve
453
- },
454
- {
455
- type: "table",
456
- createBlock: Le
457
- },
458
- {
459
- type: "spacer",
460
- createBlock: ae
461
- },
462
- {
463
- type: "html",
464
- createBlock: Ke
465
- },
466
- {
467
- type: "countdown",
468
- createBlock: ie
469
- }
470
- ];
471
- function ar(e, t) {
472
- for (let n of ir) {
473
- let r = t[n.type];
474
- r && e.registerBuiltIn(n.type, {
475
- component: r,
476
- createBlock: n.createBlock
477
- });
478
- }
479
- }
480
- // src/utils/resolveHtmlBlockPreview.ts
481
- function or(e) {
482
- return typeof e == "boolean" ? e : e?.enabled ?? !1;
483
- }
484
- // src/utils/collectOffPaletteDefaults.ts
485
- function sr(e) {
486
- return typeof e == "object" && !!e && !Array.isArray(e);
487
- }
488
- function cr(e, t, n) {
489
- let r = new Set(e.map((e) => dn(e))), i = [], a = (e, t) => {
490
- for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(dn(o)) && i.push(`${t}.${n}: ${o}`) : sr(o) && a(o, `${t}.${n}`);
491
- }, o = t;
492
- for (let [e, t] of Object.entries(He)) {
493
- let n = o?.[e];
494
- a({
495
- ...t,
496
- ...sr(n) ? n : {}
497
- }, e);
498
- }
499
- return a({
500
- ...Ne,
501
- ...n ?? {}
502
- }, "template"), i;
503
- }
504
- // src/utils/localizedBlockDefaults.ts
505
- function lr(e) {
506
- return {
507
- title: { content: `<p>${e.blockDefaults.title}</p>` },
508
- paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
509
- button: { text: e.blockDefaults.button }
510
- };
511
- }
512
- // src/i18n/index.ts
513
- var ur = /* #__PURE__ */ Object.assign({
514
- "./locales/ca.ts": () => import("./ca-CD-Kt1qz.js"),
515
- "./locales/de.ts": () => import("./de-CeFJ6wbM.js"),
516
- "./locales/en.ts": () => import("./en-D14i5nFh.js"),
517
- "./locales/es.ts": () => import("./es-zDacbMhs.js"),
518
- "./locales/fr.ts": () => import("./fr-CSgYtjOd.js"),
519
- "./locales/ja.ts": () => import("./ja-B7H3ID8O.js"),
520
- "./locales/nl.ts": () => import("./nl-176ySmc5.js"),
521
- "./locales/pt-BR.ts": () => import("./pt-BR-dDlTwX18.js")
522
- }), dr = /* #__PURE__ */ Object.assign({
523
- "./locales/cloud/de.ts": () => import("./de-6M4JoHoD.js"),
524
- "./locales/cloud/en.ts": () => import("./en-FzUuJ8HW.js"),
525
- "./locales/cloud/pt-BR.ts": () => import("./pt-BR-Bp92Fc6J.js")
526
- });
527
- function fr(e) {
528
- return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
529
- }
530
- var pr = fr(ur), mr = fr(dr);
531
- function hr(e) {
532
- return e.trim().replace(/_/g, "-").toLowerCase();
533
- }
534
- function gr(e, t) {
535
- let n = hr(e);
536
- return t.find((e) => hr(e) === n);
537
- }
538
- function _r(e) {
539
- return hr(e).split("-")[0];
540
- }
541
- function vr(e, t) {
542
- return gr(e, t) ?? gr(_r(e), t);
543
- }
544
- function yr(e, t) {
545
- return vr(e, t) ?? "en";
546
- }
547
- async function br(e) {
548
- let t = ur[`./locales/${yr(e, pr)}.ts`];
549
- return (await t()).default;
550
- }
551
- async function xr(e) {
552
- let t = dr[`./locales/cloud/${yr(e, mr)}.ts`];
553
- return (await t()).default;
554
- }
555
- function Sr(e) {
556
- return vr(e, pr) !== void 0;
557
- }
558
- function Cr(e) {
559
- return vr(e, mr) !== void 0;
560
- }
561
- function wr() {
562
- return [...pr];
563
- }
564
- function Tr() {
565
- return [...mr];
566
- }
567
- // src/i18n/contentDefaults.ts
568
- var $ = {
569
- en: {
570
- video: "Video",
571
- days: "Days",
572
- hours: "Hours",
573
- minutes: "Minutes",
574
- seconds: "Seconds",
575
- expired: "This offer has expired"
576
- },
577
- de: {
578
- video: "Video",
579
- days: "Tage",
580
- hours: "Stunden",
581
- minutes: "Minuten",
582
- seconds: "Sekunden",
583
- expired: "Dieses Angebot ist abgelaufen"
584
- },
585
- es: {
586
- video: "Vídeo",
587
- days: "Días",
588
- hours: "Horas",
589
- minutes: "Minutos",
590
- seconds: "Segundos",
591
- expired: "Esta oferta ha expirado"
592
- },
593
- fr: {
594
- video: "Vidéo",
595
- days: "Jours",
596
- hours: "Heures",
597
- minutes: "Minutes",
598
- seconds: "Secondes",
599
- expired: "Cette offre a expiré"
600
- },
601
- nl: {
602
- video: "Video",
603
- days: "Dagen",
604
- hours: "Uren",
605
- minutes: "Minuten",
606
- seconds: "Seconden",
607
- expired: "Deze aanbieding is verlopen"
608
- },
609
- "pt-BR": {
610
- video: "Vídeo",
611
- days: "Dias",
612
- hours: "Horas",
613
- minutes: "Minutos",
614
- seconds: "Segundos",
615
- expired: "Esta oferta expirou"
616
- },
617
- ca: {
618
- video: "Vídeo",
619
- days: "Dies",
620
- hours: "Hores",
621
- minutes: "Minuts",
622
- seconds: "Segons",
623
- expired: "Aquesta oferta ha caducat"
624
- },
625
- ja: {
626
- video: "動画",
627
- days: "日",
628
- hours: "時間",
629
- minutes: "分",
630
- seconds: "秒",
631
- expired: "このオファーは終了しました"
632
- }
633
- }, Er = new Map(Object.keys($).map((e) => [e.toLowerCase(), e]));
634
- function Dr(e) {
635
- if (!e) return $.en;
636
- let t = e.trim().replace(/_/g, "-").toLowerCase(), n = Er.get(t);
637
- if (n) return $[n];
638
- let r = Er.get(_r(t));
639
- return r ? $[r] : $.en;
640
- }
641
- function Or(e) {
642
- let t = Dr(e);
643
- return {
644
- video: { alt: t.video },
645
- countdown: {
646
- labelDays: t.days,
647
- labelHours: t.hours,
648
- labelMinutes: t.minutes,
649
- labelSeconds: t.seconds,
650
- expiredMessage: t.expired
651
- }
652
- };
653
- }
654
- // src/utils/collectColorFieldIssues.ts
655
- function kr(e, t) {
656
- let n = [], r = (r, i) => {
657
- let a = nt(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
658
- if (a.invalidPresets.length > 0 && n.push({
659
- id: s("invalid-presets"),
660
- message: `${o}: presets skipped invalid entries: ${a.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).` + (a.presetsInherited ? " No valid entries are left, so the field inherits colors.presets." : "")
661
- }), a.emptyPresets && n.push({
662
- id: s("empty-presets"),
663
- message: `${o}: presets is empty — a field palette can only narrow the editor's, so an empty list is ignored and the field inherits colors.presets.`
664
- }), a.allowCustomIgnored && n.push({
665
- id: s("allow-custom-ignored"),
666
- message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
667
- }), !a.allowCustom && a.presets.length > 0) {
668
- let e = r.default ?? "", t = new Set(a.presets.map((e) => dn(e)));
669
- e !== "" && !t.has(dn(e)) && n.push({
670
- id: s("off-palette-default"),
671
- message: `${o} locks custom colours, but its default ${e} falls outside the field's presets: ${a.presets.join(", ")}. New blocks start on a colour the picker can't reselect — set the default from the same palette.`
672
- });
673
- }
674
- };
675
- for (let t of e.fields) if (t.type === "color") r(t, t.key);
676
- else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
677
- return n;
678
- }
679
- // src/utils/keyboardShortcuts.ts
680
- function Ar(e) {
681
- for (let t of e.composedPath()) {
682
- if (!(t instanceof HTMLElement)) continue;
683
- if (t.isContentEditable) return !0;
684
- let e = t.tagName;
685
- if (e === "INPUT" || e === "TEXTAREA" || e === "SELECT") return !0;
686
- }
687
- return !1;
688
- }
689
- function jr(e, t) {
690
- let n = e.metaKey || e.ctrlKey;
691
- if (n && e.key.toLowerCase() === "s") e.preventDefault(), t.onSave?.();
692
- else if (n && e.key.toLowerCase() === "z") {
693
- if (Ar(e)) return;
694
- e.preventDefault(), e.shiftKey ? t.history.redo() : t.history.undo();
695
- } else {
696
- if (t.isPicking?.() && !Ar(e)) {
697
- if (e.key === "Escape") {
698
- e.preventDefault(), t.onCancelPick?.();
699
- return;
700
- }
701
- if (e.key === "Enter") {
702
- e.preventDefault(), t.onConfirmPick?.();
703
- return;
704
- }
705
- if (e.key === "Delete" || e.key === "Backspace") {
706
- e.preventDefault();
707
- return;
708
- }
709
- }
710
- e.key === "Escape" ? t.selectBlock(null) : (e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !Ar(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
711
- }
712
- }
713
- // src/utils/blockComponentResolver.ts
714
- function Mr(e, t) {
715
- let n = { fontFamily: t(e.fontFamily) };
716
- return e.textColor && (n.color = e.textColor), e.linkColor && (n["--tpl-doc-link-color"] = e.linkColor), e.linkUnderline && (n["--tpl-doc-link-underline"] = "underline"), n;
717
- }
718
- function Nr(e, t, n) {
719
- if (t) {
720
- let n = t.getComponent(e);
721
- if (n) return n;
722
- }
723
- return n[e.type] ?? null;
724
- }
725
- var Pr = "--tpl-block-bg-layer", Fr = "tpl-has-bg-image";
726
- function Ir(e, t) {
727
- if (t === null) return {};
728
- let n = z(e);
729
- if (n === null) return {};
730
- let r = t?.trim(), i = r ? qe(r) : n.url;
731
- return {
732
- backgroundImage: `url("${i}")`,
733
- backgroundSize: n.size,
734
- backgroundPosition: n.position,
735
- backgroundRepeat: n.repeat,
736
- [Pr]: `url("${i}") ${n.position} / ${n.size} ${n.repeat}`
737
- };
738
- }
739
- function Lr(e) {
740
- return e && Pr in e ? Fr : void 0;
741
- }
742
- var Rr = {
743
- top: "flex-start",
744
- middle: "center",
745
- bottom: "flex-end"
746
- };
747
- function zr(e, t) {
748
- let n = typeof e.height == "number" ? { minHeight: `${e.height}px` } : t !== void 0 && e.aspectRatio !== null ? { minHeight: `${Br(t, e.aspectRatio)}px` } : { aspectRatio: `1 / ${e.aspectRatio ?? 1}` };
749
- return {
750
- display: "flex",
751
- flexDirection: "column",
752
- justifyContent: Rr[e.verticalAlign],
753
- boxSizing: "border-box",
754
- ...n
755
- };
756
- }
757
- function Br(e, t) {
758
- return Math.max(1, Math.round(Math.max(1, Math.round(e)) * t));
759
- }
760
- function Vr(e, t = {}) {
761
- if (e.type === "wrapper") return {};
762
- let { padding: n, backgroundColor: r } = e.styles, i = {
763
- padding: `${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`,
764
- backgroundColor: r || "transparent"
765
- };
766
- if ((e.type === "paragraph" || e.type === "title") && (i["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? ye.paragraphGap : ye.paragraphGap}px`), e.type === "section") {
767
- let n = W(e.borderRadius);
768
- n !== null && (i.borderRadius = n);
769
- let r = H(e);
770
- r?.applied && e.backgroundImage ? (Object.assign(i, zr(r, t.heroBoxWidth)), Object.assign(i, Ir({
771
- ...e.backgroundImage,
772
- size: "cover",
773
- repeat: !1
774
- }, t.backgroundImageUrl))) : (Object.assign(i, Ur(e.border)), Object.assign(i, Ir(e.backgroundImage, t.backgroundImageUrl)));
775
- }
776
- return i;
777
- }
778
- function Hr(e, t, n, r) {
779
- return e.type === "section" ? Vr(e, {
780
- backgroundImageUrl: tt(t, e.backgroundImage, n),
781
- heroBoxWidth: r
782
- }) : Vr(e);
783
- }
784
- function Ur(e) {
785
- let t = {};
786
- for (let [n, r] of Object.entries(Re(e))) t[n.replace(/-(\w)/g, (e, t) => t.toUpperCase())] = r;
787
- return t;
788
- }
789
- function Wr(e, t = {}) {
790
- if (e.type !== "section" || !e.wrapper) return null;
791
- let n = e.wrapper, r = {};
792
- n.backgroundColor && (r.backgroundColor = n.backgroundColor), n.padding && (r.padding = `${n.padding.top}px ${n.padding.right}px ${n.padding.bottom}px ${n.padding.left}px`);
793
- let i = W(n.borderRadius);
794
- return i !== null && (r.borderRadius = i), Object.assign(r, Ir(n.backgroundImage, t.backgroundImageUrl)), r;
795
- }
796
- function Gr(e, t = {}) {
797
- if (e.type !== "wrapper") return null;
798
- let n = {};
799
- if (e.styles.backgroundColor && (n.backgroundColor = e.styles.backgroundColor), e.styles.padding) {
800
- let t = e.styles.padding;
801
- n.padding = `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;
802
- }
803
- return e.borderRadius && e.borderRadius > 0 && (n.borderRadius = `${e.borderRadius}px`), Object.assign(n, Ir(e.backgroundImage, t.backgroundImageUrl)), n;
804
- }
805
- // src/utils/mergeTagLabelSegments.ts
806
- function Kr(e, t, n, r = !1) {
807
- if (!e) return [];
808
- let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
809
- for (; (s = i.exec(e)) !== null;) {
810
- s.index > o && a.push({
811
- type: "text",
812
- value: e.slice(o, s.index)
813
- });
814
- let i = s[0];
815
- if (we(i, n)) {
816
- let e = r ? Pe(i, t) : void 0;
817
- a.push(e === void 0 ? {
818
- type: "tag",
819
- value: xe(i, t)
820
- } : {
821
- type: "text",
822
- value: e
823
- });
824
- } else Ue(i, n) ? a.push({
825
- type: "tag",
826
- value: Oe(i, n)
827
- }) : a.push({
828
- type: "text",
829
- value: i
830
- });
831
- o = s.index + i.length;
832
- }
833
- return o < e.length && a.push({
834
- type: "text",
835
- value: e.slice(o)
836
- }), a;
837
- }
838
- // src/components/MergeTagPreviewText.vue
839
- var qr = n({
840
- name: "MergeTagPreviewText",
841
- props: { text: {
842
- type: String,
843
- required: !0
844
- } },
845
- setup(e) {
846
- let t = r(K, Tt), n = r(Nt, Me.liquid), i = r(q, null), a = k(() => Kr(e.text, t.value, n, i?.value ?? !1));
847
- return () => a.value.map((e, t) => e.type === "tag" ? d("span", {
848
- key: t,
849
- class: "tpl-merge-tag-label"
850
- }, e.value) : e.value);
851
- }
852
- }), Jr = ["href"], Yr = /* @__PURE__ */ n({
853
- __name: "ButtonBlock",
854
- props: {
855
- block: {},
856
- viewport: {}
857
- },
858
- setup(e) {
859
- let t = e, n = G(Y, "ButtonBlock"), r = k(() => {
860
- let e = {
861
- display: "inline-block",
862
- padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
863
- backgroundColor: t.block.backgroundColor,
864
- color: t.block.textColor,
865
- fontSize: `${t.block.fontSize}px`,
866
- fontWeight: "bold",
867
- textDecoration: "none",
868
- borderRadius: typeof t.block.borderRadius == "number" ? `${t.block.borderRadius}px` : W(t.block.borderRadius) ?? "0px",
869
- textAlign: "center"
870
- };
871
- return Object.assign(e, Ur(t.block.border)), t.block.fontFamily && (e.fontFamily = n.resolveFontFamily(t.block.fontFamily)), t.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof t.block.width == "number" && (e.width = `${t.block.width}px`, e.boxSizing = "border-box"), e;
872
- }), i = k(() => ({ textAlign: t.block.align ?? "center" }));
873
- return (t, n) => (l(), g("div", { style: F(i.value) }, [D("a", {
874
- href: e.block.url || "#",
875
- style: F(r.value),
876
- class: "tpl:cursor-default",
877
- onClick: n[0] ||= T(() => {}, ["prevent"])
878
- }, [I(qr, { text: e.block.text }, null, 8, ["text"])], 12, Jr)], 4));
879
- }
880
- }), Xr = ["innerHTML"], Zr = [
881
- "src",
882
- "width",
883
- "height"
884
- ], Qr = /* @__PURE__ */ n({
885
- __name: "CustomBlockIcon",
886
- props: {
887
- icon: {},
888
- size: {}
889
- },
890
- setup(e) {
891
- let t = e, n = k(() => t.size ?? 20), r = k(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), i = k(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/"))), a = k(() => r.value ? gn(t.icon ?? "") : "");
892
- return (t, o) => r.value ? (l(), g("span", {
893
- key: 0,
894
- class: "tpl:inline-flex tpl:items-center tpl:justify-center",
895
- style: F({
896
- width: `${n.value}px`,
897
- height: `${n.value}px`
898
- }),
899
- innerHTML: a.value
900
- }, null, 12, Xr)) : i.value ? (l(), g("img", {
901
- key: 1,
902
- src: e.icon,
903
- width: n.value,
904
- height: n.value,
905
- class: "tpl:inline-block",
906
- alt: ""
907
- }, null, 8, Zr)) : (l(), S(O(Cn), {
908
- key: 2,
909
- size: n.value,
910
- "stroke-width": 1.5
911
- }, null, 8, ["size"]));
912
- }
913
- }), $r = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
914
- function ei(e, t) {
915
- let n = In(), r = null, i = null, a = null;
916
- function o() {
917
- return e.value ? Array.from(e.value.querySelectorAll($r)).filter((e) => e.offsetParent !== null) : [];
918
- }
919
- function s(e) {
920
- if (e.key !== "Tab") return;
921
- let t = o();
922
- if (t.length === 0) return;
923
- let r = t[0], i = t[t.length - 1];
924
- e.shiftKey ? n.activeElement === r && (e.preventDefault(), i.focus()) : n.activeElement === i && (e.preventDefault(), r.focus());
925
- }
926
- function c() {
927
- let t = i !== null || a !== null;
928
- t && l({ restoreFocus: !1 }), t || (r = n.activeElement), a = requestAnimationFrame(() => {
929
- a = null;
930
- let t = o();
931
- t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
932
- }), i = _t(e, "keydown", s);
933
- }
934
- function l(e = {}) {
935
- let t = e.restoreFocus !== !1;
936
- a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), i?.(), i = null, t && r && r.focus && (r.focus(), r = null);
937
- }
938
- let u = p([t, e], ([e, t]) => {
939
- e && t ? c() : l();
940
- }, { flush: "post" });
941
- h(() => {
942
- u(), l();
943
- });
944
- }
945
- // src/composables/useEmoji.ts
946
- function ti() {
947
- let [e, t] = ht(!1), n = N([]), r = !1;
948
- h(() => {
949
- r = !0;
950
- }), p(e, async (e) => {
951
- if (e && n.value.length === 0) {
952
- let { emojiCategories: e } = await import("./emojiData-CBNuCfum.js");
953
- if (r) return;
954
- n.value = e;
955
- }
956
- });
957
- function i() {
958
- t();
959
- }
960
- function a() {
961
- e.value = !1;
962
- }
963
- return {
964
- categories: n,
965
- isOpen: e,
966
- toggle: i,
967
- close: a
968
- };
969
- }
970
- // src/composables/useFonts.ts
971
- var ni = [
972
- {
973
- value: "Arial",
974
- label: "Arial"
975
- },
976
- {
977
- value: "Helvetica",
978
- label: "Helvetica"
979
- },
980
- {
981
- value: "Georgia",
982
- label: "Georgia"
983
- },
984
- {
985
- value: "Times New Roman",
986
- label: "Times New Roman"
987
- },
988
- {
989
- value: "Verdana",
990
- label: "Verdana"
991
- },
992
- {
993
- value: "Trebuchet MS",
994
- label: "Trebuchet MS"
995
- },
996
- {
997
- value: "Courier New",
998
- label: "Courier New"
999
- }
1000
- ], ri = "Arial, sans-serif";
1001
- function ii(e) {
1002
- if (e === void 0 || e === !0) return [...ni];
1003
- if (e === !1) return [];
1004
- let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
1005
- for (let i of e) {
1006
- let e = i.toLowerCase(), a = ni.find((t) => t.value.toLowerCase() === e);
1007
- a ? n.has(a.value) || (n.add(a.value), t.push(a)) : r.has(e) || (r.add(e), X.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${ni.map((e) => e.value).join(", ")}.`));
1008
- }
1009
- return t;
1010
- }
1011
- function ai(t) {
1012
- let n = e(t?.customFonts ?? []), r = e(!1), i = ii(t?.builtIns), a = k(() => t?.defaultFallback ?? ri), o = k(() => {
1013
- let e = [...i], t = n.value.map((e) => ({
1014
- value: e.name,
1015
- label: e.name,
1016
- isCustom: !0
1017
- })), r = [...e, ...t];
1018
- return r.sort((e, t) => e.label.localeCompare(t.label)), r;
1019
- });
1020
- function s(e) {
1021
- return o.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
1022
- }
1023
- let c = t?.defaultFont ?? ri.split(",")[0].trim();
1024
- s(c) || X.warn(`config.fonts: new templates seed "${c}", which the font picker doesn't offer — authors can't reselect it. Either add it to fonts.builtIns, or set fonts.defaultFont to an offered font.`);
1025
- function l() {
1026
- if (t?.defaultFont && s(t.defaultFont)) {
1027
- let e = o.value.find((e) => e.label.toLowerCase() === t.defaultFont.toLowerCase() || e.value.toLowerCase().startsWith(t.defaultFont.toLowerCase()));
1028
- if (e) return e.value;
1029
- }
1030
- return ri;
1031
- }
1032
- let u = k(() => l());
1033
- function d(e) {
1034
- return We(e, {
1035
- customFonts: n.value,
1036
- defaultFallback: a.value
1037
- });
1038
- }
1039
- let f = [], p = !1;
1040
- async function m() {
1041
- if (n.value.length === 0) {
1042
- p || (r.value = !0);
1043
- return;
1044
- }
1045
- let e = n.value.map(async (e) => {
1046
- try {
1047
- if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
1048
- let t = document.createElement("link");
1049
- t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), f.push(t), await new Promise((n, r) => {
1050
- t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
1051
- });
1052
- } catch (t) {
1053
- X.warn(`Failed to load custom font "${e.name}":`, t);
1054
- }
1055
- });
1056
- await Promise.allSettled(e), !p && (r.value = !0);
1057
- }
1058
- function g() {
1059
- for (let e of f) e.remove();
1060
- f.length = 0;
1061
- }
1062
- return A() && h(() => {
1063
- p = !0, g();
1064
- }), {
1065
- fonts: o,
1066
- defaultFont: u,
1067
- defaultFallback: a,
1068
- customFonts: n,
1069
- isLoaded: r,
1070
- loadCustomFonts: m,
1071
- cleanupFontLinks: g,
1072
- resolveFontFamily: d,
1073
- getDefaultFont: l
1074
- };
1075
- }
1076
- // src/utils/mergeTagNodeSpec.ts
1077
- function oi(e, t, n) {
1078
- return Ue(e, n) ? {
1079
- type: "logicMergeTagNode",
1080
- attrs: {
1081
- value: e,
1082
- keyword: Oe(e, n)
1083
- }
1084
- } : {
1085
- type: "mergeTagNode",
1086
- attrs: {
1087
- label: t,
1088
- value: e
1089
- }
1090
- };
1091
- }
1092
- // src/utils/insertLogicTag.ts
1093
- function si(e) {
1094
- return "before" in e && "after" in e;
1095
- }
1096
- function ci(e, t, n) {
1097
- if (!si(t)) {
1098
- e.chain().focus().insertContent(oi(t.value, t.label, n)).run();
1099
- return;
1100
- }
1101
- let r = oi(t.before, t.label, n), i = oi(t.after, t.label, n), { from: a, to: o } = e.state.selection;
1102
- a === o ? e.chain().focus().insertContentAt(a, [r, i]).setTextSelection(a + 1).run() : e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
1103
- }
1104
- // src/utils/linkColorExtension.ts
1105
- function li(e) {
1106
- if (!e) return null;
1107
- let t = e.trim();
1108
- return /^#[0-9a-f]{3,8}$/i.test(t) || /^(rgb|rgba|hsl|hsla)\(\s*[0-9.,%/\s]+\)$/i.test(t) || /^[a-z]+$/i.test(t) ? t : null;
1109
- }
1110
- function ui(e) {
1111
- return e.extend({ addAttributes() {
1112
- return {
1113
- ...this.parent?.(),
1114
- color: {
1115
- default: null,
1116
- parseHTML: (e) => li(un(e.style.color)),
1117
- renderHTML: (e) => {
1118
- let t = li(e.color);
1119
- return t ? { style: `color: ${t}` } : {};
1120
- }
1121
- }
1122
- };
1123
- } });
1124
- }
1125
- // src/composables/useRichTextLinkDialog.ts
1126
- function di(t, n = Me.liquid) {
1127
- let r = e(!1), i = e(""), a = e(""), o = e(null);
1128
- ei(o, r);
1129
- function s() {
1130
- let e = t.value?.getAttributes("link") ?? {};
1131
- i.value = e.href || "", a.value = e.color || "", r.value = !0;
1132
- }
1133
- function c() {
1134
- if (i.value) {
1135
- let e = d(i.value);
1136
- if (e !== null) {
1137
- let n = li(a.value), r = t.value?.chain().focus().extendMarkRange("link").setLink({ href: e }).updateAttributes("link", { color: n });
1138
- n && typeof t.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
1139
- }
1140
- }
1141
- p();
1142
- }
1143
- let l = /^(?:\/|\.{1,2}\/|\?)/;
1144
- function u(e) {
1145
- return RegExp(`^(?:${n.value.source})`).test(e);
1146
- }
1147
- function d(e) {
1148
- let t = e.trim();
1149
- if (!t) return null;
1150
- if (t.startsWith("#")) return t;
1151
- if (t.startsWith("//")) return `https:${t}`;
1152
- if (l.test(t)) return t;
1153
- let n = B(t);
1154
- return n ? he.some((e) => e === n) ? t : null : u(t) ? t : `https://${t}`;
1155
- }
1156
- function f() {
1157
- t.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p();
1158
- }
1159
- function p() {
1160
- r.value = !1, i.value = "", a.value = "";
1161
- }
1162
- function m(e) {
1163
- e.key === "Enter" ? (e.preventDefault(), c()) : e.key === "Escape" && p();
1164
- }
1165
- return {
1166
- showLinkDialog: r,
1167
- linkUrl: i,
1168
- linkColor: a,
1169
- linkDialogRef: o,
1170
- openLinkDialog: s,
1171
- insertLink: c,
1172
- removeLink: f,
1173
- closeLinkDialog: p,
1174
- handleLinkKeydown: m
1175
- };
1176
- }
1177
- // src/composables/useRichTextEditor.ts
1178
- function fi(t) {
1179
- let n = r(J, null), { mergeTags: i, canRequestMergeTag: a, isRequesting: s, requestMergeTag: c, syntax: l, autocomplete: u } = Ln(), { canInsertLogicTag: d, isRequesting: f, requestLogicTag: m } = Rn(), h = r(Bt, null), g = (o(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = Ce(l), v = N(null), y = () => ee(n?.content?.value?.settings ?? { locale: "en" });
1180
- p(y, (e) => {
1181
- let t = v.value?.view.dom;
1182
- t && t.setAttribute("dir", e);
1183
- });
1184
- let { showLinkDialog: b, linkUrl: x, linkColor: S, linkDialogRef: C, openLinkDialog: T, insertLink: E, removeLink: D, closeLinkDialog: O, handleLinkKeydown: k } = di(v, l), { start: A, stop: j } = pt(() => v.value?.commands.focus("end"), 0, { immediate: !1 }), M = N(null), P = e(!0), F = e(null), I = !1, L = null;
1185
- async function R() {
1186
- F.value = null, P.value = !0;
1187
- try {
1188
- let { TiptapEditor: e, EC: r, extensions: a } = await t.loadExtensions({
1189
- mergeTags: i,
1190
- syntax: l,
1191
- triggerChar: _,
1192
- autocompleteEnabled: u,
1193
- suggestionEmptyText: g
1194
- });
1195
- if (I) return;
1196
- M.value = r;
1197
- let o = /* @__PURE__ */ new Map();
1198
- a.forEach((e, t) => o.set(e.name, t));
1199
- let s = new e({
1200
- extensions: a.filter((e, t) => o.get(e.name) === t),
1201
- content: t.blockContent(),
1202
- editable: !0,
1203
- editorProps: { attributes: { dir: y() } },
1204
- onUpdate: ({ editor: e }) => {
1205
- I || n && (L = e.getHTML(), n.updateBlock(t.blockId(), { content: L }));
1206
- }
1207
- });
1208
- if (I) {
1209
- s.destroy();
1210
- return;
1211
- }
1212
- v.value = s, P.value = !1, A();
1213
- } catch (e) {
1214
- if (I) return;
1215
- X.error(`[${t.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), F.value = e instanceof Error ? e.message : "Failed to load editor", P.value = !1;
1216
- }
1217
- }
1218
- function z() {
1219
- v.value?.destroy(), v.value = null, R();
1220
- }
1221
- R();
1222
- let B = p(() => t.blockContent(), (e) => {
1223
- v.value && e !== L && (L = e, v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 }));
1224
- });
1225
- function V(e) {
1226
- if (s.value || f.value) return;
1227
- let n = e.composedPath(), r = n.find((e) => e instanceof HTMLElement);
1228
- if (!r) return;
1229
- t.onClickOutsideSideEffect?.(r);
1230
- let i = n.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
1231
- r.closest(".tpl-text-editor-wrapper") || r.closest(".tpl-text-toolbar") || r.closest(".tpl-link-dialog") || i || t.onDone();
1232
- }
1233
- _t(document, "mousedown", V), w(() => {
1234
- I = !0, B(), j(), v.value?.destroy();
1235
- });
1236
- async function H() {
1237
- let e = await c();
1238
- I || (e && v.value ? v.value.chain().focus().insertMergeTag({
1239
- label: e.label,
1240
- value: e.value
1241
- }).run() : v.value?.commands.focus());
1242
- }
1243
- async function te() {
1244
- let e = await m();
1245
- I || (e && v.value ? ci(v.value, e, l) : v.value?.commands.focus());
1246
- }
1247
- return {
1248
- editor: v,
1249
- EditorContent: M,
1250
- isLoading: P,
1251
- initError: F,
1252
- retry: z,
1253
- showLinkDialog: b,
1254
- linkUrl: x,
1255
- linkColor: S,
1256
- linkDialogRef: C,
1257
- mergeTags: i,
1258
- canRequestMergeTag: a,
1259
- isRequestingMergeTag: s,
1260
- syntax: l,
1261
- canInsertLogicTag: d,
1262
- isRequestingLogicTag: f,
1263
- openLinkDialog: T,
1264
- insertLink: E,
1265
- removeLink: D,
1266
- closeLinkDialog: O,
1267
- handleLinkKeydown: k,
1268
- handleAddMergeTag: H,
1269
- handleAddLogicTag: te
1270
- };
1271
- }
1272
- // src/composables/useSmallScreenNotice.ts
1273
- var pi = "(max-width: 767px)";
1274
- function mi(e) {
1275
- let t = vt(pi);
1276
- return {
1277
- isSmallScreen: t,
1278
- showNotice: k(() => (C(e) ?? !0) && t.value)
1279
- };
1280
- }
1281
- // src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
1282
- var hi = { class: "tpl:w-full" }, gi = {
1283
- key: 0,
1284
- class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-warning)] tpl:bg-[var(--tpl-warning-light)]"
1285
- }, _i = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, vi = {
1286
- key: 1,
1287
- class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-danger-light)]"
1288
- }, yi = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, bi = {
1289
- key: 2,
1290
- class: "tpl:relative"
1291
- }, xi = ["innerHTML"], Si = {
1292
- key: 0,
1293
- class: "tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]",
1294
- style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
1295
- }, Ci = /* @__PURE__ */ n({
1296
- __name: "CustomBlock",
1297
- props: {
1298
- block: {},
1299
- viewport: {}
1300
- },
1301
- emits: ["fetchData"],
1302
- setup(t, { emit: n }) {
1303
- let i = t, a = n, { t: o } = Z(), s = r(an, null), u = e(""), d = k(() => _n(u.value)), f = e(!1), m = k(() => s?.getDefinition(i.block.customType)), h = k(() => !!m.value), _ = k(() => i.block), { isFetching: y, fetch: C, needsFetch: w, hasDataSource: E } = Qe({
1304
- definition: m,
1305
- block: _,
1306
- onUpdate: (e, t) => {
1307
- a("fetchData", {
1308
- fieldValues: e,
1309
- dataSourceFetched: t
1310
- });
1311
- }
1312
- }), A = r(K, Tt), j = r(q, null), M = k(() => {
1313
- if (!j?.value) return i.block;
1314
- let e = {};
1315
- for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ? Ee(n, A.value) : n;
1316
- return {
1317
- ...i.block,
1318
- fieldValues: e
1319
- };
1320
- });
1321
- async function N() {
1322
- if (s) {
1323
- f.value = !1;
1324
- try {
1325
- let e = await s.renderCustomBlock(M.value);
1326
- e.includes("Template render error:") && (f.value = !0), u.value = e;
1327
- } catch {
1328
- f.value = !0, u.value = "";
1329
- }
1330
- }
1331
- }
1332
- let P = mt(N, 150);
1333
- return c(() => {
1334
- N();
1335
- }), p(() => i.block.fieldValues, () => {
1336
- P();
1337
- }, { deep: !0 }), p(() => j?.value, () => {
1338
- P();
1339
- }), (e, t) => (l(), g("div", hi, [h.value ? f.value ? (l(), g("div", vi, [I(O(Tn), {
1340
- size: 24,
1341
- class: "tpl:text-[var(--tpl-danger)]"
1342
- }), D("span", yi, b(O(o).customBlocks.renderError), 1)])) : (l(), g("div", bi, [D("div", { innerHTML: d.value }, null, 8, xi), O(E) && O(w) ? (l(), g("div", Si, [O(y) ? (l(), S(Pn, {
1343
- key: 1,
1344
- class: "tpl:w-48"
1345
- })) : (l(), g("button", {
1346
- key: 0,
1347
- type: "button",
1348
- class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-[var(--tpl-shadow)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:shadow-[var(--tpl-shadow-md)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
1349
- onClick: t[0] ||= T((...e) => O(C) && O(C)(...e), ["stop"])
1350
- }, [m.value?.icon ? (l(), S(Qr, {
1351
- key: 0,
1352
- icon: m.value.icon,
1353
- size: 16
1354
- }, null, 8, ["icon"])) : x("", !0), v(" " + b(m.value?.dataSource?.label || O(o).customBlocks.dataSource.fetchButton), 1)]))])) : x("", !0)])) : (l(), g("div", gi, [I(O(Sn), {
1355
- size: 24,
1356
- class: "tpl:text-[var(--tpl-warning)]"
1357
- }), D("span", _i, b(O(o).customBlocks.definitionNotFound), 1)]))]));
1358
- }
1359
- }), wi = { class: "tpl:w-full" }, Ti = /* @__PURE__ */ n({
1360
- __name: "DividerBlock",
1361
- props: {
1362
- block: {},
1363
- viewport: {}
1364
- },
1365
- setup(e) {
1366
- let t = e, n = k(() => ({
1367
- borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
1368
- width: t.block.width === "full" ? "100%" : typeof t.block.width == "number" ? `${t.block.width}px` : t.block.width,
1369
- margin: t.block.width === "full" ? "0" : "0 auto"
1370
- }));
1371
- return (e, t) => (l(), g("div", wi, [D("hr", {
1372
- class: "tpl:m-0 tpl:border-none",
1373
- style: F(n.value)
1374
- }, null, 4)]));
1375
- }
1376
- }), Ei = { class: "tpl:w-full" }, Di = ["srcdoc", "title"], Oi = {
1377
- key: 1,
1378
- class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
1379
- }, ki = {
1380
- key: 0,
1381
- class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
1382
- }, Ai = {
1383
- key: 1,
1384
- class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
1385
- }, ji = /* @__PURE__ */ n({
1386
- __name: "HtmlBlock",
1387
- props: {
1388
- block: {},
1389
- viewport: {}
1390
- },
1391
- setup(t) {
1392
- let n = t, { t: i } = Z(), a = r(Wt, !1), o = k(() => n.block.content.trim().length > 0), s = k(() => a && o.value), c = r(K, Tt), u = r(q, null), d = k(() => u?.value ? Ee(n.block.content, c.value) : n.block.content), f = e(null), m = e(60), h = null;
1393
- function _() {
1394
- let e = f.value?.contentDocument;
1395
- e && (m.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
1396
- }
1397
- function v() {
1398
- h?.disconnect(), h = null, _();
1399
- let e = f.value?.contentDocument?.documentElement;
1400
- e && typeof ResizeObserver < "u" && (h = new ResizeObserver(() => _()), h.observe(e));
1401
- }
1402
- return p(s, (e) => {
1403
- e || (h?.disconnect(), h = null);
1404
- }), w(() => {
1405
- h?.disconnect(), h = null;
1406
- }), (e, t) => (l(), g("div", Ei, [s.value ? (l(), g("iframe", {
1407
- key: 0,
1408
- ref_key: "iframeRef",
1409
- ref: f,
1410
- srcdoc: d.value,
1411
- sandbox: "allow-same-origin",
1412
- title: O(i).html.preview,
1413
- class: "tpl:block tpl:w-full tpl:border-0",
1414
- style: F({ height: `${m.value}px` }),
1415
- onLoad: v
1416
- }, null, 44, Di)) : (l(), g("div", Oi, [I(O(vn), {
1417
- size: 24,
1418
- class: "tpl:text-[var(--tpl-text-dim)]"
1419
- }), o.value ? (l(), g("span", ki, b(O(i).html.preview), 1)) : (l(), g("span", Ai, b(O(i).html.empty), 1))]))]));
1420
- }
1421
- }), Mi = ["data-drop-enabled"], Ni = ["href"], Pi = ["src", "alt"], Fi = ["src", "alt"], Ii = {
1422
- class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
1423
- style: { opacity: "0.7" }
1424
- }, Li = ["href"], Ri = ["src", "alt"], zi = ["src", "alt"], Bi = {
1425
- key: 4,
1426
- class: "tpl:flex tpl:box-border tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
1427
- }, Vi = ["aria-label"], Hi = { key: 1 }, Ui = /* @__PURE__ */ n({
1428
- __name: "ImageBlock",
1429
- props: {
1430
- block: {},
1431
- viewport: {}
1432
- },
1433
- emits: ["update"],
1434
- setup(t, { emit: n }) {
1435
- let r = t, i = n, { t: a } = Z(), { syntax: o } = Ln(), s = k(() => ze(r.block.src, o));
1436
- function c(e) {
1437
- let t = {
1438
- src: e.url,
1439
- ...ct(ot(e.width, e.height))
1440
- };
1441
- e.alt && (t.alt = e.alt), i("update", t);
1442
- }
1443
- let u = e(), { canBrowse: d, dropEnabled: f, isUploading: p, showOverlay: m, openMediaBrowser: h } = st({
1444
- target: u,
1445
- blocked: s,
1446
- apply: c
1447
- }), _ = k(() => ({ textAlign: r.block.align })), y = k(() => {
1448
- let e = r.block.border, t = ["left", "right"].map((t) => oe(e?.[t]) === null ? 0 : e[t].width).reduce((e, t) => e + t, 0);
1449
- return t > 0 ? `calc(100% - ${t}px)` : "100%";
1450
- }), C = k(() => {
1451
- let e = r.block.align;
1452
- return {
1453
- maxWidth: "100%",
1454
- width: r.block.width === "full" ? y.value : `${r.block.width}px`,
1455
- height: r.block.height ? `${r.block.height}px` : void 0,
1456
- borderRadius: W(r.block.borderRadius) ?? void 0,
1457
- ...Ur(r.block.border),
1458
- display: "block",
1459
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
1460
- marginRight: e === "center" ? "auto" : void 0
1461
- };
1462
- }), w = ft(() => s.value ? void 0 : r.block.src), E = ft(() => s.value ? r.block.placeholderUrl : void 0);
1463
- return (e, n) => (l(), g("div", {
1464
- ref_key: "dropZoneRef",
1465
- ref: u,
1466
- "data-testid": "image-drop-zone",
1467
- "data-drop-enabled": O(f),
1468
- class: "tpl:relative tpl:w-full",
1469
- style: F(_.value)
1470
- }, [O(m) ? (l(), S(at, {
1471
- key: 0,
1472
- uploading: O(p),
1473
- size: "canvas"
1474
- }, null, 8, ["uploading"])) : x("", !0), t.block.src && s.value && t.block.placeholderUrl ? (l(), g(P, { key: 1 }, [t.block.linkUrl ? (l(), g("a", {
1475
- key: 0,
1476
- href: t.block.linkUrl,
1477
- target: "_blank",
1478
- rel: "noopener noreferrer",
1479
- onClick: n[0] ||= T(() => {}, ["prevent"])
1480
- }, [D("img", {
1481
- class: "tpl:border-0",
1482
- loading: "lazy",
1483
- src: O(E),
1484
- alt: t.block.alt || O(a).image.altTextPlaceholder,
1485
- style: F(C.value)
1486
- }, null, 12, Pi)], 8, Ni)) : (l(), g("img", {
1487
- key: 1,
1488
- class: "tpl:border-0",
1489
- src: O(E),
1490
- alt: t.block.alt,
1491
- style: F(C.value)
1492
- }, null, 12, Fi))], 64)) : t.block.src && s.value ? (l(), g("div", {
1493
- key: 2,
1494
- class: "tpl:!flex tpl:box-border tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
1495
- style: F([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, C.value])
1496
- }, [I(O(Dn), {
1497
- size: 32,
1498
- "stroke-width": 1.5,
1499
- class: "tpl:text-[var(--tpl-primary)]",
1500
- style: { opacity: "0.5" }
1501
- }), D("span", Ii, [I(qr, { text: t.block.src }, null, 8, ["text"])])], 4)) : t.block.src ? (l(), g(P, { key: 3 }, [t.block.linkUrl ? (l(), g("a", {
1502
- key: 0,
1503
- href: t.block.linkUrl,
1504
- target: "_blank",
1505
- rel: "noopener noreferrer",
1506
- onClick: n[1] ||= T(() => {}, ["prevent"])
1507
- }, [D("img", {
1508
- class: "tpl:border-0",
1509
- loading: "lazy",
1510
- src: O(w),
1511
- alt: t.block.alt || O(a).image.altTextPlaceholder,
1512
- style: F(C.value)
1513
- }, null, 12, Ri)], 8, Li)) : (l(), g("img", {
1514
- key: 1,
1515
- class: "tpl:border-0",
1516
- src: O(w),
1517
- alt: t.block.alt,
1518
- style: F(C.value)
1519
- }, null, 12, zi))], 64)) : (l(), g("div", Bi, [O(d) ? (l(), g("button", {
1520
- key: 0,
1521
- "aria-label": O(a).image.browseMedia,
1522
- class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
1523
- onClick: n[2] ||= T((...e) => O(h) && O(h)(...e), ["stop"])
1524
- }, [I(O(Dn), {
1525
- size: 14,
1526
- "stroke-width": 1.5
1527
- }), v(" " + b(O(a).image.browseMedia), 1)], 8, Vi)) : (l(), g("span", Hi, b(O(a).image.clickToAdd), 1))]))], 12, Mi));
1528
- }
1529
- }), Wi = { class: "tpl:w-full" }, Gi = ["href"], Ki = {
1530
- key: 1,
1531
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
1532
- }, qi = /* @__PURE__ */ n({
1533
- __name: "MenuBlock",
1534
- props: {
1535
- block: {},
1536
- viewport: {}
1537
- },
1538
- setup(e) {
1539
- let t = e, { t: n } = Z(), r = G(Y, "MenuBlock"), i = k(() => ({
1540
- display: "flex",
1541
- flexWrap: "wrap",
1542
- gap: `0 ${t.block.spacing}px`,
1543
- justifyContent: t.block.textAlign === "left" ? "flex-start" : t.block.textAlign === "right" ? "flex-end" : "center",
1544
- fontSize: `${t.block.fontSize}px`,
1545
- fontFamily: t.block.fontFamily ? r.resolveFontFamily(t.block.fontFamily) : "inherit",
1546
- alignItems: "center"
1547
- })), o = k(() => t.block.items.length > 0);
1548
- function s(e) {
1549
- return e || t.block.linkColor || t.block.color;
1550
- }
1551
- return (t, r) => (l(), g("div", Wi, [o.value ? (l(), g("div", {
1552
- key: 0,
1553
- style: F(i.value)
1554
- }, [(l(!0), g(P, null, a(e.block.items, (t, n) => (l(), g(P, { key: t.id }, [D("a", {
1555
- href: t.url || "#",
1556
- class: "tpl:cursor-default tpl:no-underline",
1557
- style: F({
1558
- color: s(t.color),
1559
- fontWeight: t.bold ? "bold" : "normal",
1560
- textDecoration: t.underline ? "underline" : "none"
1561
- }),
1562
- onClick: r[0] ||= T(() => {}, ["prevent"])
1563
- }, [I(qr, { text: t.text || "..." }, null, 8, ["text"])], 12, Gi), n < e.block.items.length - 1 ? (l(), g("span", {
1564
- key: 0,
1565
- style: F({
1566
- color: e.block.separatorColor,
1567
- padding: `0 ${e.block.spacing}px`
1568
- })
1569
- }, b(e.block.separator), 5)) : x("", !0)], 64))), 128))], 4)) : (l(), g("div", Ki, [I(O(wn), { size: 16 }), D("span", null, b(O(n).menu.addLinks), 1)]))]));
1570
- }
1571
- });
1572
- // src/composables/useEditableTextBlock.ts
1573
- function Ji(t) {
1574
- let n = r(K, Tt), i = r(q, null), { syntax: a } = Ln(), o = k(() => i?.value ? De(t(), n.value) : Ie(t(), n.value)), s = k(() => Se(_n(Te(o.value, a)))), c = e(!1), l = e(null), { top: u, left: d } = yt(l), { toLocal: f } = pn(), p = k(() => f({
1575
- top: u.value - 8,
1576
- left: d.value
1577
- }));
1578
- function m() {
1579
- c.value = !0;
1580
- }
1581
- function h() {
1582
- c.value = !1;
1583
- }
1584
- return {
1585
- isEditing: c,
1586
- blockRef: l,
1587
- toolbarPosition: p,
1588
- resolvedContent: s,
1589
- handleDoubleClick: m,
1590
- handleEditorDone: h
1591
- };
1592
- }
1593
- // src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
1594
- var Yi = ["innerHTML"], Xi = /* @__PURE__ */ n({
1595
- __name: "ParagraphBlock",
1596
- props: {
1597
- block: {},
1598
- viewport: {}
1599
- },
1600
- setup(e) {
1601
- let t = e, n = u(() => import("./ParagraphEditor-DsPLVAgm.js").then((e) => e.t)), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: s, handleEditorDone: c } = Ji(() => t.block.content);
1602
- return (t, u) => (l(), g("div", {
1603
- ref_key: "blockRef",
1604
- ref: i,
1605
- class: "tpl:min-h-[1em] tpl:w-full",
1606
- onDblclick: u[0] ||= (...e) => O(s) && O(s)(...e)
1607
- }, [O(r) ? (l(), S(O(n), {
1608
- key: 0,
1609
- block: e.block,
1610
- "toolbar-position": O(a),
1611
- onDone: O(c)
1612
- }, null, 8, [
1613
- "block",
1614
- "toolbar-position",
1615
- "onDone"
1616
- ])) : (l(), g("div", {
1617
- key: 1,
1618
- class: "tpl-text-content tpl:outline-none",
1619
- innerHTML: O(o)
1620
- }, null, 8, Yi))], 544));
1621
- }
1622
- }), Zi = [
1623
- "data-block-id",
1624
- "data-block-type",
1625
- "data-tpl-picked"
1626
- ], Qi = ["data-lock-holder"], $i = ["aria-label"], ea = [
1627
- "aria-label",
1628
- "aria-pressed",
1629
- "title"
1630
- ], ta = ["aria-label", "title"], na = ["aria-label", "title"], ra = ["aria-label", "title"], ia = {
1631
- key: 3,
1632
- class: "tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm"
1633
- }, aa = { class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, oa = {
1634
- key: 4,
1635
- class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
1636
- }, sa = ["aria-label", "title"], ca = {
1637
- key: 5,
1638
- class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
1639
- }, la = ["aria-label"], ua = /*#__PURE__*/ Fn(/* @__PURE__ */ n({
1640
- __name: "BlockWrapper",
1641
- props: {
1642
- block: {},
1643
- isSelected: { type: Boolean },
1644
- viewport: {},
1645
- previewMode: { type: Boolean },
1646
- nested: { type: Boolean },
1647
- picked: { type: Boolean }
1648
- },
1649
- emits: ["select"],
1650
- setup(n, { emit: i }) {
1651
- let a = u(() => import("./BlockIssueBadge-DIJDqqcY.js")), o = n, c = i, { t: d, format: f } = Z(), p = r(Ft, null), m = e(null), h = k(() => p?.liftedBlockId.value === o.block.id), _ = k(() => h.value ? f(d.blockActions.dragLifted, { block: o.block.type }) : d.blockActions.drag);
1652
- async function y() {
1653
- await t(), m.value?.focus();
1654
- }
1655
- function S(e) {
1656
- p && (e.key === " " || e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), h.value ? p.drop(o.block.id) : p.lift(o.block.id)) : h.value && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), p.cancel(), y()) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), p.moveUp(o.block.id), y()) : e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), p.moveDown(o.block.id), y())));
1657
- }
1658
- let C = k(() => !o.viewport || !o.block.visibility ? !1 : o.block.visibility[o.viewport] === !1), w = k(() => o.previewMode === !0 && C.value), A = k(() => o.viewport ? {
1659
- desktop: d.viewport.desktop,
1660
- mobile: d.viewport.mobile
1661
- }[o.viewport] ?? o.viewport : ""), j = k(() => !!o.block.displayCondition), M = r(Ut, null), N = r(qt, null), P = r(Zt, {}), L = k(() => P.savedBlocks?.isPicking.value === !0), ee = k(() => !o.nested && P.savedBlocks?.isAvailable.value === !0 && P.savedBlocks?.canCreate.value === !0), R = k(() => o.isSelected && !L.value), z = k(() => P.comments?.getBlockCount(o.block.id) ?? 0), B = k(() => P.collaboration?.lockOf(o.block.id) ?? null), V = k(() => B.value?.holder.type === "guest" ? d.collaboration.guest : B.value?.holder.name ?? ""), H = k(() => P.collaboration?.agentHighlightOf(o.block.id) ?? P.ai?.highlightOf(o.block.id) ?? null), te = Je(() => o.block.type === "section" ? o.block.backgroundImage : void 0), ne = Je(() => o.block.type === "section" ? o.block.wrapper?.backgroundImage : void 0), re = r(J, null), ie = r(St, void 0), U = k(() => Vr(o.block, {
1662
- backgroundImageUrl: te.value,
1663
- heroBoxWidth: rt(o.block, re?.content.value, ie)
1664
- })), W = k(() => Wr(o.block, { backgroundImageUrl: ne.value }));
1665
- function ae(e) {
1666
- o.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), c("select"));
1667
- }
1668
- function oe() {
1669
- M?.deleteBlock(o.block.id);
1670
- }
1671
- function se() {
1672
- M?.duplicateBlock(o.block);
1673
- }
1674
- function ce() {
1675
- P.savedBlocks?.startPicking(o.block.id);
1676
- }
1677
- function le() {
1678
- N?.toggleBlock(o.block.id);
1679
- }
1680
- return (e, t) => w.value ? x("", !0) : (l(), g("div", {
1681
- key: 0,
1682
- class: E(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
1683
- "tpl-block--selected": n.isSelected,
1684
- "tpl-block--picked": n.picked,
1685
- "tpl-block--idle": !n.isSelected && !n.picked,
1686
- "tpl-block--lifted": h.value
1687
- }]),
1688
- "data-block-id": n.block.id,
1689
- "data-block-type": n.block.type,
1690
- "data-tpl-picked": n.picked || void 0,
1691
- onClick: ae
1692
- }, [
1693
- I(O(a), { "block-id": n.block.id }, null, 8, ["block-id"]),
1694
- B.value ? (l(), g("div", {
1695
- key: 0,
1696
- "data-testid": "block-lock",
1697
- "data-lock-holder": B.value.holder.sessionId,
1698
- class: "tpl-block-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
1699
- style: F({
1700
- outline: `2px solid ${B.value.holder.color}`,
1701
- outlineOffset: "-1px"
1702
- })
1703
- }, [D("span", {
1704
- class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:-translate-x-1/2 tpl:-translate-y-full tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
1705
- style: F({
1706
- backgroundColor: B.value.holder.color,
1707
- color: O(zn)(B.value.holder.color)
1708
- })
1709
- }, b(O(f)(O(d).collaboration.editing, { name: V.value })), 5)], 12, Qi)) : x("", !0),
1710
- H.value === null ? x("", !0) : (l(), g("div", {
1711
- key: H.value,
1712
- "data-testid": "block-agent-highlight",
1713
- "aria-hidden": "true",
1714
- class: "tpl-block-agent-highlight tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm"
1715
- })),
1716
- R.value ? (l(), g("div", {
1717
- key: 2,
1718
- role: "toolbar",
1719
- "aria-label": O(d).blockActions.drag,
1720
- class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:-right-2 tpl:top-1/2 tpl:z-10 tpl:flex tpl:-translate-y-1/2 tpl:translate-x-full tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]"
1721
- }, [
1722
- D("button", {
1723
- ref_key: "dragButtonRef",
1724
- ref: m,
1725
- class: "tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:active:cursor-grabbing",
1726
- "aria-label": _.value,
1727
- "aria-pressed": h.value,
1728
- "aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
1729
- title: O(d).blockActions.drag,
1730
- onKeydown: S
1731
- }, [I(O(jn), {
1732
- size: 14,
1733
- "stroke-width": 1.5
1734
- })], 40, ea),
1735
- D("button", {
1736
- class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
1737
- "aria-label": O(d).blockActions.duplicate,
1738
- title: O(d).blockActions.duplicate,
1739
- onClick: T(se, ["stop"])
1740
- }, [I(O(xn), {
1741
- size: 14,
1742
- "stroke-width": 1.5
1743
- })], 8, ta),
1744
- ee.value ? (l(), g("button", {
1745
- key: 0,
1746
- class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
1747
- "aria-label": O(d).blockActions.saveAsBlock,
1748
- title: O(d).blockActions.saveAsBlock,
1749
- onClick: T(ce, ["stop"])
1750
- }, [I(O(bn), {
1751
- size: 14,
1752
- "stroke-width": 1.5
1753
- })], 8, na)) : x("", !0),
1754
- D("button", {
1755
- class: "tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
1756
- "aria-label": O(d).blockActions.delete,
1757
- title: O(d).blockActions.delete,
1758
- onClick: T(oe, ["stop"])
1759
- }, [I(O(En), {
1760
- size: 14,
1761
- "stroke-width": 1.5
1762
- })], 8, ra)
1763
- ], 8, $i)) : x("", !0),
1764
- C.value ? (l(), g("div", ia, [D("span", aa, [I(O(yn), {
1765
- size: 12,
1766
- "stroke-width": 1.5
1767
- }), v(" " + b(O(f)(O(d).blockActions.hiddenOnViewport, { viewport: A.value })), 1)])])) : x("", !0),
1768
- j.value && !C.value ? (l(), g("div", oa, [D("button", {
1769
- "data-testid": "condition-toggle",
1770
- class: "tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]",
1771
- "aria-label": O(d).blockActions.conditionToggle,
1772
- title: n.block.displayCondition?.label,
1773
- onClick: T(le, ["stop"])
1774
- }, [I(O(Mn), {
1775
- size: 12,
1776
- "stroke-width": 2
1777
- })], 8, sa)])) : x("", !0),
1778
- z.value > 0 && !C.value ? (l(), g("div", ca, [D("button", {
1779
- class: "tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:bg-[var(--tpl-chrome-primary-light)] tpl:text-[var(--tpl-primary)]",
1780
- "aria-label": O(f)(O(d).blockActions.comments, { count: String(z.value) }),
1781
- onClick: t[0] ||= T((e) => O(P).comments?.openForBlock(n.block.id), ["stop"])
1782
- }, [I(O(kn), {
1783
- size: 12,
1784
- "stroke-width": 2.5
1785
- }), v(" " + b(z.value), 1)], 8, la)])) : x("", !0),
1786
- W.value ? (l(), g("div", {
1787
- key: 6,
1788
- class: E(["tpl-section-wrapper tpl-email-surface", O(Lr)(W.value)]),
1789
- style: F(W.value)
1790
- }, [D("div", {
1791
- class: E(["tpl-block-content tpl-email-surface", O(Lr)(U.value)]),
1792
- style: F(U.value)
1793
- }, [s(e.$slots, "default", {}, void 0, !0)], 6)], 6)) : (l(), g("div", {
1794
- key: 7,
1795
- class: E(["tpl-block-content tpl-email-surface", O(Lr)(U.value)]),
1796
- style: F(U.value)
1797
- }, [s(e.$slots, "default", {}, void 0, !0)], 6))
1798
- ], 10, Zi));
1799
- }
1800
- }), [["__scopeId", "data-v-126b991e"]]);
1801
- // src/utils/unwrapParagraph.ts
1802
- function da(e) {
1803
- let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
1804
- return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
1805
- }
1806
- // src/components/blocks/TitleBlock.vue
1807
- var fa = /* @__PURE__ */ n({
1808
- __name: "TitleBlock",
1809
- props: {
1810
- block: {},
1811
- viewport: {}
1812
- },
1813
- setup(e) {
1814
- let t = e, n = u(() => import("./TitleEditor-R2lQw6WA.js")), r = G(Y, "TitleBlock"), { isEditing: i, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: d } = Ji(() => t.block.content), f = k(() => {
1815
- let e = {
1816
- fontSize: `${_e[t.block.level]}px`,
1817
- lineHeight: String(ne),
1818
- fontWeight: "700",
1819
- textAlign: t.block.textAlign
1820
- };
1821
- return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = r.resolveFontFamily(t.block.fontFamily)), e;
1822
- }), p = k(() => `h${t.block.level}`), m = k(() => da(s.value));
1823
- return (t, r) => (l(), g("div", {
1824
- ref_key: "blockRef",
1825
- ref: a,
1826
- class: "tpl:min-h-[1em] tpl:w-full",
1827
- style: F(f.value),
1828
- onDblclick: r[0] ||= (...e) => O(c) && O(c)(...e)
1829
- }, [O(i) ? (l(), S(O(n), {
1830
- key: 0,
1831
- block: e.block,
1832
- "toolbar-position": O(o),
1833
- onDone: O(d)
1834
- }, null, 8, [
1835
- "block",
1836
- "toolbar-position",
1837
- "onDone"
1838
- ])) : (l(), S(L(p.value), {
1839
- key: 1,
1840
- class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-[inherit] tpl:outline-none",
1841
- style: {
1842
- color: "inherit",
1843
- fontWeight: "inherit"
1844
- },
1845
- innerHTML: m.value
1846
- }, null, 8, ["innerHTML"]))], 36));
1847
- }
1848
- }), pa = "hero", ma = "#1f2937", ha = "#ffffff";
1849
- function ga(e, t) {
1850
- let n = fe("title", e);
1851
- n.color = ha, n.textAlign = "center";
1852
- let r = fe("paragraph", e);
1853
- r.content = `<p style="text-align: center"><span style="color: ${ha}">${_a(t)}</span></p>`;
1854
- let i = fe("button", e);
1855
- return i.align = "center", ge({
1856
- columns: "1",
1857
- children: [[
1858
- n,
1859
- r,
1860
- i
1861
- ]],
1862
- hero: {
1863
- height: "image",
1864
- verticalAlign: "middle"
1865
- },
1866
- styles: {
1867
- padding: {
1868
- top: 48,
1869
- right: 24,
1870
- bottom: 48,
1871
- left: 24
1872
- },
1873
- backgroundColor: ma
1874
- }
1875
- });
1876
- }
1877
- function _a(e) {
1878
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1879
- }
1880
- // src/utils/sectionColumnDrop.ts
1881
- var va = /* @__PURE__ */ new Set(["section", pa]);
1882
- function ya(e) {
1883
- return e.dataset.blockType !== "section" && !va.has(e.dataset.paletteType ?? "");
1884
- }
1885
- // src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
1886
- var ba = { class: "tpl:relative tpl:w-full" }, xa = {
1887
- key: 0,
1888
- "data-testid": "hero-image-hint",
1889
- class: "tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-full tpl:mb-2 tpl:flex tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
1890
- }, Sa = {
1891
- key: 0,
1892
- "data-testid": "section-drop-hint",
1893
- class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
1894
- }, Ca = /* @__PURE__ */ n({
1895
- __name: "SectionBlock",
1896
- props: {
1897
- block: {},
1898
- viewport: {}
1899
- },
1900
- setup(t) {
1901
- let n = {
1902
- title: fa,
1903
- paragraph: Xi,
1904
- image: Ui,
1905
- button: Yr,
1906
- divider: Ti,
1907
- custom: Ci
1908
- }, i = t, { t: o } = Z(), s = G(J, "SectionBlock"), c = r(qt, null), u = r(an, null), d = r(Zt, {}), p = r(rn, null);
1909
- function h(e) {
1910
- let t = d.savedBlocks;
1911
- t?.isPicking.value ? t.togglePick(i.block.id) : s.selectBlock(e);
1912
- }
1913
- let _ = k(() => {
1914
- switch (i.block.columns) {
1915
- case "2": return ["50%", "50%"];
1916
- case "3": return [
1917
- "33.33%",
1918
- "33.33%",
1919
- "33.33%"
1920
- ];
1921
- case "1-2": return ["33.33%", "66.67%"];
1922
- case "2-1": return ["66.67%", "33.33%"];
1923
- default: return ["100%"];
1924
- }
1925
- }), v = k(() => {
1926
- let e = _.value.length, t = [...i.block.children];
1927
- for (; t.length < e;) t.push([]);
1928
- return t.slice(0, e);
1929
- }), y = k(() => i.viewport === "mobile" && i.block.stackOnMobile !== !1);
1930
- function C(e) {
1931
- return v.value[e] || [];
1932
- }
1933
- function w(e) {
1934
- return p?.value === !1 || !c?.isHidden(e);
1935
- }
1936
- function T(e) {
1937
- return !C(e).some((e) => w(e.id));
1938
- }
1939
- let A = e(null);
1940
- function N(e) {
1941
- return s.state.previewMode ? !1 : T(e) ? !0 : A.value === e && C(e).filter((e) => w(e.id)).length <= 1;
1942
- }
1943
- let ee = k(() => {
1944
- if (s.state.previewMode) return !1;
1945
- let e = H(i.block);
1946
- return e !== null && !e.applied && e.reason === "image";
1947
- });
1948
- function R(e) {
1949
- return C(e).length === 0 && !s.state.previewMode;
1950
- }
1951
- function z(e) {
1952
- return C(e).length === 0 && s.state.previewMode;
1953
- }
1954
- function B(e, t) {
1955
- let n = t.map((e) => JSON.parse(JSON.stringify(e))), r = [...i.block.children];
1956
- for (; r.length <= e;) r.push([]);
1957
- r[e] = n, s.updateBlock(i.block.id, { children: r });
1958
- }
1959
- function V(e) {
1960
- return Nr(e, u, n);
1961
- }
1962
- function te(e, t) {
1963
- e.type === "custom" && s.updateBlock(e.id, {
1964
- fieldValues: t.fieldValues,
1965
- dataSourceFetched: t.dataSourceFetched
1966
- });
1967
- }
1968
- return (e, n) => (l(), g("div", ba, [ee.value ? (l(), g("div", xa, [D("span", null, b(O(o).section.heroAddImage), 1)])) : x("", !0), D("div", { class: E(["tpl:flex tpl:gap-0", { "tpl:flex-col": y.value }]) }, [(l(!0), g(P, null, a(v.value, (e, r) => (l(), g("div", {
1969
- key: r,
1970
- class: E(["tpl:relative tpl:flex tpl:flex-col tpl:rounded", R(r) ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
1971
- style: F({ width: y.value ? "100%" : _.value[r] })
1972
- }, [I(O(M), {
1973
- "model-value": C(r),
1974
- group: {
1975
- name: "blocks",
1976
- pull: !0,
1977
- put: (e, t, n) => O(ya)(n)
1978
- },
1979
- animation: 150,
1980
- "ghost-class": "tpl-ghost",
1981
- "drag-class": "tpl-dragging",
1982
- handle: ".tpl-block-btn",
1983
- "invert-swap": !0,
1984
- "inverted-swap-threshold": .65,
1985
- "empty-insert-threshold": 20,
1986
- "force-fallback": !0,
1987
- class: E(["tpl:grow", {
1988
- "tpl:min-h-[60px]": N(r),
1989
- "tpl:min-h-[34px]": z(r)
1990
- }]),
1991
- onStart: (e) => A.value = r,
1992
- onEnd: n[0] ||= (e) => A.value = null,
1993
- "onUpdate:modelValue": (e) => B(r, e)
1994
- }, {
1995
- default: f(() => [(l(!0), g(P, null, a(C(r), (e) => m((l(), g("div", { key: e.id }, [I(ua, {
1996
- block: e,
1997
- "is-selected": O(s).state.selectedBlockId === e.id,
1998
- viewport: t.viewport,
1999
- "preview-mode": O(s).state.previewMode,
2000
- nested: "",
2001
- onSelect: (t) => h(e.id)
2002
- }, {
2003
- default: f(() => [(l(), S(L(V(e)), {
2004
- block: e,
2005
- viewport: t.viewport,
2006
- onFetchData: (t) => te(e, t),
2007
- onUpdate: (t) => O(s).updateBlock(e.id, t)
2008
- }, null, 40, [
2009
- "block",
2010
- "viewport",
2011
- "onFetchData",
2012
- "onUpdate"
2013
- ]))]),
2014
- _: 2
2015
- }, 1032, [
2016
- "block",
2017
- "is-selected",
2018
- "viewport",
2019
- "preview-mode",
2020
- "onSelect"
2021
- ])])), [[j, w(e.id)]])), 128))]),
2022
- _: 2
2023
- }, 1032, [
2024
- "model-value",
2025
- "group",
2026
- "class",
2027
- "onStart",
2028
- "onUpdate:modelValue"
2029
- ]), R(r) ? (l(), g("div", Sa, [D("span", null, b(O(o).section.dropHere), 1)])) : x("", !0)], 6))), 128))], 2)]));
2030
- }
2031
- }), wa = ["width", "height"], Ta = [
2032
- "d",
2033
- "stroke",
2034
- "stroke-opacity",
2035
- "stroke-width"
2036
- ], Ea = ["d", "fill"], Da = /* @__PURE__ */ n({
2037
- __name: "SocialIconSvg",
2038
- props: {
2039
- platform: {},
2040
- iconStyle: {},
2041
- iconTone: {},
2042
- iconSize: {}
2043
- },
2044
- setup(e) {
2045
- let t = e, n = k(() => lt[t.platform]), r = k(() => ut[t.iconSize]), i = k(() => ke(t.platform, t.iconTone)), a = k(() => le(t.iconStyle, t.iconTone)), o = k(() => {
2046
- let e = {
2047
- display: "inline-flex",
2048
- alignItems: "center",
2049
- justifyContent: "center",
2050
- width: `${r.value}px`,
2051
- height: `${r.value}px`
2052
- }, n = i.value.fill;
2053
- switch (t.iconStyle) {
2054
- case "solid": return {
2055
- ...e,
2056
- backgroundColor: n,
2057
- borderRadius: "4px"
2058
- };
2059
- case "outlined": return {
2060
- ...e,
2061
- backgroundColor: "transparent",
2062
- border: `2px solid ${n}`,
2063
- borderRadius: "4px",
2064
- ...a.value && { boxShadow: u(a.value) }
2065
- };
2066
- case "rounded": return {
2067
- ...e,
2068
- backgroundColor: n,
2069
- borderRadius: "8px"
2070
- };
2071
- case "square": return {
2072
- ...e,
2073
- backgroundColor: n,
2074
- borderRadius: "0"
2075
- };
2076
- case "circle": return {
2077
- ...e,
2078
- backgroundColor: n,
2079
- borderRadius: "50%"
2080
- };
2081
- default: return e;
2082
- }
2083
- }), s = k(() => ce(t.iconStyle)), c = k(() => Math.floor(r.value * s.value));
2084
- function u(e) {
2085
- let t = `${e.width / 2 * r.value / 24}px`, n = Math.round(e.opacity * 255).toString(16).padStart(2, "0"), i = `${e.color}${n}`;
2086
- return `0 0 0 ${t} ${i}, inset 0 0 0 ${t} ${i}`;
2087
- }
2088
- let d = k(() => t.iconStyle === "outlined" || t.iconStyle === "plain" ? i.value.fill : i.value.onFill);
2089
- return (e, t) => (l(), g("span", { style: F(o.value) }, [(l(), g("svg", {
2090
- width: c.value,
2091
- height: c.value,
2092
- viewBox: "0 0 24 24",
2093
- overflow: "visible",
2094
- xmlns: "http://www.w3.org/2000/svg"
2095
- }, [a.value ? (l(), g("path", {
2096
- key: 0,
2097
- "data-testid": "social-icon-halo",
2098
- d: n.value.path,
2099
- fill: "none",
2100
- stroke: a.value.color,
2101
- "stroke-opacity": a.value.opacity,
2102
- "stroke-width": a.value.width / s.value,
2103
- "stroke-linejoin": "round"
2104
- }, null, 8, Ta)) : x("", !0), D("path", {
2105
- d: n.value.path,
2106
- fill: d.value
2107
- }, null, 8, Ea)], 8, wa))], 4));
2108
- }
2109
- }), Oa = { class: "tpl:w-full" }, ka = ["href"], Aa = {
2110
- key: 1,
2111
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
2112
- }, ja = /* @__PURE__ */ n({
2113
- __name: "SocialIconsBlock",
2114
- props: {
2115
- block: {},
2116
- viewport: {}
2117
- },
2118
- setup(e) {
2119
- let t = e, { t: n } = Z(), r = k(() => ({
2120
- display: "flex",
2121
- flexWrap: "wrap",
2122
- gap: `${t.block.spacing}px`,
2123
- justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
2124
- })), i = k(() => t.block.icons.length > 0);
2125
- return (t, o) => (l(), g("div", Oa, [i.value ? (l(), g("div", {
2126
- key: 0,
2127
- style: F(r.value)
2128
- }, [(l(!0), g(P, null, a(e.block.icons, (t) => (l(), g("a", {
2129
- key: t.id,
2130
- href: t.url || "#",
2131
- class: "tpl:cursor-default",
2132
- onClick: o[0] ||= T(() => {}, ["prevent"])
2133
- }, [I(Da, {
2134
- platform: t.platform,
2135
- "icon-style": e.block.iconStyle,
2136
- "icon-tone": e.block.iconTone,
2137
- "icon-size": e.block.iconSize
2138
- }, null, 8, [
2139
- "platform",
2140
- "icon-style",
2141
- "icon-tone",
2142
- "icon-size"
2143
- ])], 8, ka))), 128))], 4)) : (l(), g("div", Aa, [I(O(On), { size: 16 }), D("span", null, b(O(n).social.addIcons), 1)]))]));
2144
- }
2145
- }), Ma = { class: "tpl:w-full" }, Na = {
2146
- key: 0,
2147
- class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
2148
- style: {
2149
- "background-color": "var(--tpl-bg-hover)",
2150
- color: "var(--tpl-text-dim)"
2151
- }
2152
- }, Pa = /* @__PURE__ */ n({
2153
- __name: "SpacerBlock",
2154
- props: {
2155
- block: {},
2156
- viewport: {}
2157
- },
2158
- setup(e) {
2159
- let t = e, n = G(J, "SpacerBlock"), r = k(() => ({
2160
- height: `${t.block.height}px`,
2161
- minHeight: `${t.block.height}px`,
2162
- ...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
2163
- }));
2164
- return (t, i) => (l(), g("div", Ma, [D("div", {
2165
- style: F(r.value),
2166
- class: E(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:box-border tpl:border-y tpl:border-x-0 tpl:border-dashed": !O(n).state.previewMode }])
2167
- }, [O(n).state.previewMode ? x("", !0) : (l(), g("span", Na, b(e.block.height) + "px ", 1))], 6)]));
2168
- }
2169
- }), Fa = { class: "tpl:w-full" }, Ia = { key: 0 }, La = [
2170
- "aria-label",
2171
- "data-placeholder",
2172
- "onBlur"
2173
- ], Ra = [
2174
- "aria-label",
2175
- "data-placeholder",
2176
- "onBlur"
2177
- ], za = {
2178
- key: 1,
2179
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
2180
- }, Ba = /*#__PURE__*/ Fn(/* @__PURE__ */ n({
2181
- __name: "TableBlock",
2182
- props: {
2183
- block: {},
2184
- viewport: {}
2185
- },
2186
- setup(e) {
2187
- let t = {
2188
- mounted(e, t) {
2189
- e.textContent = t.value ?? "";
2190
- },
2191
- updated(e, t) {
2192
- t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
2193
- }
2194
- }, n = e, { t: r } = Z(), i = G(J, "TableBlock"), o = G(Y, "TableBlock"), s = k(() => n.block.rows.length > 0), c = k(() => {
2195
- let e = {
2196
- width: "100%",
2197
- borderCollapse: "collapse",
2198
- fontSize: `${n.block.fontSize}px`,
2199
- textAlign: n.block.textAlign,
2200
- fontFamily: n.block.fontFamily ? o.resolveFontFamily(n.block.fontFamily) : "inherit"
2201
- };
2202
- return n.block.color && (e.color = n.block.color), e;
2203
- }), u = k(() => ({
2204
- border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
2205
- padding: `${n.block.cellPadding}px`,
2206
- textAlign: n.block.textAlign
2207
- })), d = k(() => ({
2208
- ...u.value,
2209
- fontWeight: "bold",
2210
- backgroundColor: n.block.headerBackgroundColor || "transparent"
2211
- })), f = k(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), p = k(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
2212
- function h() {
2213
- i.selectBlock(n.block.id);
2214
- }
2215
- function _(e, t, r) {
2216
- let a = r.target.innerText.trim(), o = n.block.rows.map((n) => n.id === e ? {
2217
- ...n,
2218
- cells: n.cells.map((e) => e.id === t ? {
2219
- ...e,
2220
- content: a
2221
- } : e)
2222
- } : n);
2223
- i.updateBlock(n.block.id, { rows: o });
2224
- }
2225
- return (e, n) => (l(), g("div", Fa, [s.value ? (l(), g("table", {
2226
- key: 0,
2227
- style: F(c.value),
2228
- class: "tpl-table-editable"
2229
- }, [f.value ? (l(), g("thead", Ia, [D("tr", null, [(l(!0), g(P, null, a(f.value.cells, (e) => m((l(), g("th", {
2230
- key: e.id,
2231
- style: F(d.value),
2232
- "aria-label": O(r).table.cellPlaceholder,
2233
- contenteditable: "true",
2234
- "data-placeholder": O(r).table.cellPlaceholder,
2235
- onBlur: (t) => _(f.value.id, e.id, t),
2236
- onKeydown: n[0] ||= y(T((e) => e.target.blur(), ["prevent"]), ["enter"]),
2237
- onClick: T(h, ["stop"])
2238
- }, null, 44, La)), [[t, e.content]])), 128))])])) : x("", !0), D("tbody", null, [(l(!0), g(P, null, a(p.value, (e) => (l(), g("tr", { key: e.id }, [(l(!0), g(P, null, a(e.cells, (i) => m((l(), g("td", {
2239
- key: i.id,
2240
- style: F(u.value),
2241
- "aria-label": O(r).table.cellPlaceholder,
2242
- contenteditable: "true",
2243
- "data-placeholder": O(r).table.cellPlaceholder,
2244
- onBlur: (t) => _(e.id, i.id, t),
2245
- onKeydown: n[1] ||= y(T((e) => e.target.blur(), ["prevent"]), ["enter"]),
2246
- onClick: T(h, ["stop"])
2247
- }, null, 44, Ra)), [[t, i.content]])), 128))]))), 128))])], 4)) : (l(), g("div", za, [I(O(Nn), { size: 16 }), D("span", null, b(O(r).table.empty), 1)]))]));
2248
- }
2249
- }), [["__scopeId", "data-v-6751d456"]]), Va = /* @__PURE__ */ n({
2250
- __name: "VideoPlayButton",
2251
- props: { hoverEffect: {
2252
- type: Boolean,
2253
- default: !1
2254
- } },
2255
- setup(e) {
2256
- return (t, n) => (l(), g("div", { class: E(["tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30", e.hoverEffect && "tpl:transition-opacity tpl:group-hover:bg-black/40"]) }, [...n[0] ||= [D("div", { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[color-mix(in_srgb,var(--tpl-bg)_90%,transparent)] tpl:shadow-[var(--tpl-shadow-lg)]" }, [D("svg", {
2257
- class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
2258
- width: "28",
2259
- height: "28",
2260
- viewBox: "0 0 24 24",
2261
- fill: "currentColor"
2262
- }, [D("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
2263
- }
2264
- });
2265
- // src/utils/videoThumbnail.ts
2266
- function Ha(e) {
2267
- if (!e) return {
2268
- platform: "unknown",
2269
- videoId: null,
2270
- thumbnailUrl: null
2271
- };
2272
- for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/i, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/i]) {
2273
- let n = e.match(t);
2274
- if (n) {
2275
- let e = n[1];
2276
- return {
2277
- platform: "youtube",
2278
- videoId: e,
2279
- thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
2280
- };
2281
- }
2282
- }
2283
- let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
2284
- if (t) {
2285
- let e = t[1];
2286
- return {
2287
- platform: "vimeo",
2288
- videoId: e,
2289
- thumbnailUrl: `https://vumbnail.com/${e}.jpg`
2290
- };
2291
- }
2292
- return {
2293
- platform: "unknown",
2294
- videoId: null,
2295
- thumbnailUrl: null
2296
- };
2297
- }
2298
- function Ua(e, t) {
2299
- return t || Ha(e).thumbnailUrl;
2300
- }
2301
- // src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
2302
- var Wa = ["src", "alt"], Ga = {
2303
- class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
2304
- style: { opacity: "0.7" }
2305
- }, Ka = ["href"], qa = ["src", "alt"], Ja = ["src", "alt"], Ya = {
2306
- key: 3,
2307
- class: "tpl:flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
2308
- }, Xa = /* @__PURE__ */ n({
2309
- __name: "VideoBlock",
2310
- props: {
2311
- block: {},
2312
- viewport: {}
2313
- },
2314
- setup(e) {
2315
- let t = e, { t: n } = Z(), { syntax: r } = Ln(), i = k(() => ze(t.block.url, r) || ze(t.block.thumbnailUrl, r)), a = ft(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = ft(() => i.value ? t.block.placeholderUrl : void 0), s = k(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : Ua(t.block.url)), c = k(() => ({ textAlign: t.block.align })), u = k(() => {
2316
- let e = t.block.align;
2317
- return {
2318
- maxWidth: "100%",
2319
- width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
2320
- height: t.block.height ? `${t.block.height}px` : void 0,
2321
- display: "block",
2322
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
2323
- marginRight: e === "center" ? "auto" : void 0
2324
- };
2325
- }), d = k(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = k(() => ze(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
2326
- return (t, r) => (l(), g("div", {
2327
- class: "tpl:w-full",
2328
- style: F(c.value)
2329
- }, [i.value && e.block.placeholderUrl ? (l(), g("div", {
2330
- key: 0,
2331
- class: "tpl:relative tpl:inline-block",
2332
- style: F(u.value)
2333
- }, [D("img", {
2334
- class: "tpl:block tpl:w-full tpl:border-0",
2335
- src: O(o),
2336
- alt: e.block.alt,
2337
- style: F(d.value)
2338
- }, null, 12, Wa), I(Va)], 4)) : i.value ? (l(), g("div", {
2339
- key: 1,
2340
- class: "tpl:relative tpl:!flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
2341
- style: F([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
2342
- }, [I(O(An), {
2343
- size: 36,
2344
- "stroke-width": 1.5,
2345
- class: "tpl:text-[var(--tpl-primary)]",
2346
- style: { opacity: "0.5" }
2347
- }), D("span", Ga, [I(qr, { text: f.value }, null, 8, ["text"])])], 4)) : s.value ? (l(), g(P, { key: 2 }, [e.block.url ? (l(), g("a", {
2348
- key: 0,
2349
- href: e.block.url,
2350
- target: "_blank",
2351
- rel: "noopener noreferrer",
2352
- class: "tpl:group tpl:relative tpl:inline-block",
2353
- style: F(u.value),
2354
- onClick: r[0] ||= T(() => {}, ["prevent"])
2355
- }, [D("img", {
2356
- class: "tpl:block tpl:w-full tpl:border-0",
2357
- src: s.value,
2358
- alt: e.block.alt,
2359
- style: F(d.value)
2360
- }, null, 12, qa), I(Va, { "hover-effect": "" })], 12, Ka)) : (l(), g("div", {
2361
- key: 1,
2362
- class: "tpl:relative tpl:inline-block",
2363
- style: F(u.value)
2364
- }, [D("img", {
2365
- class: "tpl:block tpl:w-full tpl:border-0",
2366
- src: s.value,
2367
- alt: e.block.alt,
2368
- style: F(d.value)
2369
- }, null, 12, Ja), I(Va)], 4))], 64)) : (l(), g("div", Ya, [I(O(An), {
2370
- size: 40,
2371
- "stroke-width": 1.5,
2372
- class: "tpl:text-[var(--tpl-border-light)]"
2373
- }), D("span", null, b(O(n).video.addVideo), 1)]))], 4));
2374
- }
2375
- }), Za = {
2376
- section: Ca,
2377
- title: fa,
2378
- paragraph: Xi,
2379
- image: Ui,
2380
- button: Yr,
2381
- divider: Ti,
2382
- video: Xa,
2383
- social: ja,
2384
- menu: qi,
2385
- table: Ba,
2386
- spacer: Pa,
2387
- html: ji,
2388
- countdown: u(() => import("./CountdownBlock-Dyr5P0IP.js"))
2389
- };
2390
- function Qa(t) {
2391
- let { editor: n, config: r, translations: a, fontsManager: o } = t, { t: s, format: c } = Z(a), l = k(() => Be(Be(Be(lr(a), Or(n.content.value.settings?.locale)), ee(n.content.value.settings) === "rtl" ? {
2392
- title: { textAlign: "right" },
2393
- table: { textAlign: "right" }
2394
- } : {}), r.blockDefaults ?? {}));
2395
- n.setUiTheme(r.uiTheme ?? "auto");
2396
- let { resolvedTheme: u } = Zn(k(() => n.state.uiTheme)), d = e(r.theme ?? {}), { themeStyles: f } = $n({
2397
- themeOverrides: d,
2398
- resolvedTheme: u,
2399
- extraStyles: () => ({
2400
- "--tpl-drop-text": `"${a.canvas.dropHere}"`,
2401
- ...t.themeExtraStyles?.()
2402
- })
2403
- }), m = t.history ?? et({
2404
- content: n.content,
2405
- setContent: (e, t) => n.setContent(e, t)
2406
- });
2407
- t.history || Ze(n, m);
2408
- let g = Xe({
2409
- addBlock: n.addBlock,
2410
- removeBlock: n.removeBlock,
2411
- updateBlock: n.updateBlock,
2412
- selectBlock: n.selectBlock,
2413
- findBlockLocation: n.findBlockLocation,
2414
- blockDefaults: () => l.value
2415
- }), _ = $e(n), v = t.autoSaveOptions !== null && t.autoSaveOptions !== void 0 ? Ye({
2416
- content: n.content,
2417
- isDirty: () => n.state.isDirty,
2418
- ...t.autoSaveOptions
2419
- }) : null, y = null;
2420
- v && (y = p(m.isNavigating, (e) => {
2421
- e ? v.pause() : v.resume();
2422
- }));
2423
- let b = Xn(n, {
2424
- t: s,
2425
- format: c
2426
- }, r.customBlocks ?? []), x = fn(r.colors);
2427
- if (x.allowCustomIgnored && X.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), x.invalidPresets.length > 0 && X.warn(`config.colors.presets skipped invalid entries: ${x.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), x.allowCustom === !1) {
2428
- let e = cr(x.presets, r.blockDefaults, r.templateDefaults);
2429
- e.length > 0 && X.warn(`config.colors locks custom colours, but these block/template default colours fall outside colors.presets: ${e.join(", ")}. New blocks start on a colour the palette can't reselect — set blockDefaults / templateDefaults from the same palette.`);
2430
- }
2431
- let S = mn(r.templateSettings);
2432
- for (let e of S.unknown) X.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${hn.join(", ")}) — skipping it.`);
2433
- let C = er();
2434
- ar(C, Za);
2435
- let w = /* @__PURE__ */ new Set();
2436
- function T(e) {
2437
- for (let t of e) {
2438
- C.registerCustom(t, Ci);
2439
- for (let e of kr(t, x)) w.has(e.id) || (w.add(e.id), X.warn(e.message));
2440
- }
2441
- }
2442
- r.customBlocks?.length && T(r.customBlocks);
2443
- let E = Hn();
2444
- if (A() && h(E.dispose), t.containerEl) {
2445
- let e = t.containerEl;
2446
- _t(document, "pointerdown", (t) => {
2447
- let n = e.value;
2448
- n && (t.composedPath?.() ?? []).includes(n) && E.claim();
2449
- }, { capture: !0 });
2450
- }
2451
- function D() {
2452
- let e = t.capabilities?.templates;
2453
- e ? e.save() : v?.flush();
2454
- }
2455
- function O(e) {
2456
- E.isActive() && jr(e, {
2457
- history: m,
2458
- selectBlock: (e) => n.selectBlock(e),
2459
- getSelectedBlockId: () => n.state.selectedBlockId,
2460
- removeBlock: (e) => n.removeBlock(e),
2461
- onSave: D,
2462
- isPicking: () => t.capabilities?.savedBlocks?.isPicking.value === !0,
2463
- onConfirmPick: () => t.capabilities?.savedBlocks?.confirmPicking(),
2464
- onCancelPick: () => t.capabilities?.savedBlocks?.cancelPicking()
2465
- });
2466
- }
2467
- _t(document, "keydown", O);
2468
- let j = e(null), M = t.editorRoot ?? document;
2469
- i(Ht, M), i(xt, j), i(Bt, a), i(J, n), i(cn, m), i(Ut, g), i(qt, _), i(Y, o), i(Ot, f), i(Vt, u), i(en, l), i(zt, r.locale), i(an, C), i(tn, r.customBlocks ?? []), i(ln, r.paletteBlocks), i(Wt, or(r.htmlBlockPreview)), i(St, r.layout), i(Rt, r.sectionWrapper), i(Kt, x), i(nn, S.fields), i(Qt, tr(n.content, C));
2470
- let P = je(r.mergeTags?.syntax);
2471
- for (let e of ["opener", "closer"]) {
2472
- let t = P[e];
2473
- typeof t == "string" && t.trim() === "" && X.warn(`config.mergeTags.syntax.${e} is blank — ignoring it.`);
2474
- }
2475
- typeof P.opener != "string" && typeof P.closer == "string" && P.closer.trim() !== "" && Ce(P) === null && X.warn("config.mergeTags.syntax.closer has no effect without an opener — set opener to turn on autocomplete for this syntax.");
2476
- let F = N(r.mergeTags?.tags ?? []);
2477
- function I(e) {
2478
- Array.isArray(e) ? F.value = e : X.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
2479
- }
2480
- i(K, F), i(Nt, P), i(Pt, r.mergeTags?.onRequest ?? null), i(Xt, r.mergeTags?.autocomplete !== !1), i(Mt, r.mergeTags?.showRawValue !== !1);
2481
- let L = e(Ae(r.mergeTags?.tags ?? []));
2482
- i(jt, L);
2483
- let R = Wn({
2484
- resolvePreview: r.resolvePreview,
2485
- getContent: () => {
2486
- let e = n.content.value;
2487
- return r.layout && n.state.previewMode ? ue(r.layout, e) : e;
2488
- },
2489
- isActive: () => n.state.previewMode
2490
- });
2491
- i(Lt, R), i(Et, r.resolvePreview);
2492
- let z = k(() => !(n.state.previewMode && R.isConfigured));
2493
- i(rn, z);
2494
- let B = Gn();
2495
- i(bt, B), i(Yt, e(!1)), i(Ct, e(!1)), i(It, r.logicTags?.tags ?? []), i(on, r.logicTags?.pairs ?? []), i(Dt, r.logicTags?.onRequest ?? null), i(wt, Kn()), i(At, r.onRequestMedia ?? null), i(Gt, r.canDropMedia ?? null), i(sn, r.resolveImageUrl ? it(r.resolveImageUrl) : null), i(Jt, r.displayConditions?.conditions ?? []), i($t, r.displayConditions?.allowCustom ?? !1), i(Zt, t.capabilities ?? {}), i(Ft, b);
2496
- let V = qn(r.lint) ? null : Yn({
2497
- content: n.content,
2498
- options: r.lint ?? {},
2499
- updateBlock: n.updateBlock,
2500
- updateSettings: n.updateSettings,
2501
- removeBlock: n.removeBlock
2502
- });
2503
- i(kt, V);
2504
- function H() {
2505
- y?.(), V?.destroy(), v?.destroy(), m.destroy();
2506
- }
2507
- return {
2508
- t: s,
2509
- format: c,
2510
- editorRoot: M,
2511
- history: m,
2512
- blockActions: g,
2513
- conditionPreview: _,
2514
- autoSave: v,
2515
- resolvedTheme: u,
2516
- themeStyles: f,
2517
- themeOverrides: d,
2518
- registry: C,
2519
- keyboardReorder: b,
2520
- templateLint: V,
2521
- popoverRoot: j,
2522
- mergeTagSampleMode: L,
2523
- previewResolution: R,
2524
- appliesConditionFilter: z,
2525
- registerCustomBlocks: T,
2526
- setMergeTags: I,
2527
- mergeTags: F,
2528
- mergeTagSyntax: P,
2529
- destroy: H
2530
- };
2531
- }
2532
- export { Nr as A, Qr as C, Hr as D, Vr as E, Sr as F, xr as I, br as L, Tr as M, wr as N, Mr as O, Cr as P, Wn as R, ei as S, Lr as T, mi as _, ja as a, ai as b, ga as c, Xi as d, qi as f, Ci as g, Ti as h, Pa as i, _r as j, Gr as k, fa as l, ji as m, Xa as n, Ca as o, Ui as p, Ba as r, pa as s, Qa as t, ua as u, fi as v, Yr as w, ti as x, ui as y };
2533
-
2534
- //# sourceMappingURL=useEditorCore-CjaEV_01.js.map