@templatical/editor 0.52.1 → 0.54.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 (397) hide show
  1. package/README.md +1 -1
  2. package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
  3. package/dist/{AiAltTextReview-9ySsXOTU.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
  4. package/dist/AiChatPanel-C8SeEJRP.js +561 -0
  5. package/dist/{AiPanels-DqT4PgQ0.js → AiPanels-CR6zphjP.js} +6 -6
  6. package/dist/{AiRewriteMenu-28agTycW.js → AiRewriteMenu-CIHUnPud.js} +76 -105
  7. package/dist/BlockIssueBadge-DaPTq1RE.js +33 -0
  8. package/dist/BlockPreviewCanvas-B70RSavL.js +140 -0
  9. package/dist/{CloudHeaderExtras-QI82yF54.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
  10. package/dist/{CloudPanels-BKJaLkUN.js → CloudPanels-VpSQiLLL.js} +53 -53
  11. package/dist/CollaborationNotices-Cnx0XHzZ.js +65 -0
  12. package/dist/{CollaboratorBar-CXQqN3VP.js → CollaboratorBar-BaBoNhwB.js} +24 -24
  13. package/dist/CommentsPanel-Ck3QmqiC.js +16 -0
  14. package/dist/CommentsSidebar-CHknhOar.js +526 -0
  15. package/dist/{CountdownBlock-CU2yTWtF.js → CountdownBlock-BMezkFbJ.js} +15 -15
  16. package/dist/CountdownToolbar-CM4XNEuO.js +258 -0
  17. package/dist/IssuesPanel-1wGV0wiy.js +371 -0
  18. package/dist/LanguageMenu-d2GlX67r.js +403 -0
  19. package/dist/{LoadingTrack-DM4g6j7b.js → LoadingTrack-BG8cg9xi.js} +2 -2
  20. package/dist/LocaleNotices-WzsYtBRs.js +46 -0
  21. package/dist/LogicTagInsertButton-DgTJ6Lvx.js +1096 -0
  22. package/dist/{MediaEditModal-Dy08GEwE.js → MediaEditModal-C3U9Mi31.js} +451 -451
  23. package/dist/{MediaPanels-BgEp7iCp.js → MediaPanels-CGmk9ufe.js} +4 -4
  24. package/dist/{MergeTagInput-B9dtUthD.js → MergeTagInput-B_51YcQO.js} +30 -30
  25. package/dist/{MergeTagModeToggle-DxujhYJ4.js → MergeTagModeToggle-D3Q2z317.js} +49 -49
  26. package/dist/MergeTagTextarea-DZz1L9DE.js +126 -0
  27. package/dist/ParagraphEditor-CI68PYDL.js +825 -0
  28. package/dist/{RestoreVersionDialog-C4s_JYCx.js → RestoreVersionDialog-DcuhpOIz.js} +23 -23
  29. package/dist/{RichTextEditorContent-o6HmE8GR.js → RichTextEditorContent-Dstovi0m.js} +47 -47
  30. package/dist/{SaveBlockDialog-CWLrly6l.js → SaveBlockDialog-vuwvoi-d.js} +86 -86
  31. package/dist/{cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js → SavedBlocksBrowserModal-DUJm0dOv.js} +135 -132
  32. package/dist/{SavedBlocksPanels-BE1N9rNZ.js → SavedBlocksPanels-BiMXQ5lY.js} +9 -9
  33. package/dist/{SavedBlocksPickBar-Dwl94xhP.js → SavedBlocksPickBar-CAstZfG7.js} +15 -15
  34. package/dist/TemplateSettings-Baar78_s.js +294 -0
  35. package/dist/TestEmailModal-Bl_GHdrN.js +212 -0
  36. package/dist/{TestEmailPanel-DaFjP9QK.js → TestEmailPanel-CpTBF7B5.js} +4 -4
  37. package/dist/TitleEditor-DkbEDAZB.js +202 -0
  38. package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
  39. package/dist/Toolbar-bOZ_eq7X.js +3711 -0
  40. package/dist/{TplModal-DLMssVlt.js → TplModal-wk2gLa7_.js} +17 -17
  41. package/dist/{VersionHistoryMenu-BkbYUs0Q.js → VersionHistoryMenu-BnP0EyLl.js} +39 -39
  42. package/dist/{VersionHistoryPanels-DP7HaYWv.js → VersionHistoryPanels-Cq2rFKIX.js} +5 -5
  43. package/dist/VersionPreviewBanner-BPP939cD.js +37 -0
  44. package/dist/WrapperBlock-cWT_nZgQ.js +44 -0
  45. package/dist/{blockTypeIcons-BHjlPnPf.js → blockTypeIcons-BUyPZ7Su.js} +7 -7
  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-Cnc_kUmb.js +107 -0
  49. package/dist/cdn/chunks/AiAltTextPopover-Cnc_kUmb.js.map +1 -0
  50. package/dist/cdn/chunks/{AiAltTextReview-BGLLSKLm.js → AiAltTextReview-DPeSY-7r.js} +70 -68
  51. package/dist/cdn/chunks/AiAltTextReview-DPeSY-7r.js.map +1 -0
  52. package/dist/cdn/chunks/AiChatPanel-By8Uo1nH.js +487 -0
  53. package/dist/cdn/chunks/AiChatPanel-By8Uo1nH.js.map +1 -0
  54. package/dist/cdn/chunks/{AiPanels-0wBarZSH.js → AiPanels-BblCSkQy.js} +11 -11
  55. package/dist/cdn/chunks/{AiPanels-0wBarZSH.js.map → AiPanels-BblCSkQy.js.map} +1 -1
  56. package/dist/cdn/chunks/{AiRewriteMenu-qf-cfEpy.js → AiRewriteMenu-C4btyN4W.js} +79 -79
  57. package/dist/cdn/chunks/AiRewriteMenu-C4btyN4W.js.map +1 -0
  58. package/dist/cdn/chunks/BlockIssueBadge-D3Plo_wt.js +34 -0
  59. package/dist/cdn/chunks/BlockIssueBadge-D3Plo_wt.js.map +1 -0
  60. package/dist/cdn/chunks/BlockPreviewCanvas-CTKmBPsq.js +142 -0
  61. package/dist/cdn/chunks/{BlockPreviewCanvas-DGBh6mqe.js.map → BlockPreviewCanvas-CTKmBPsq.js.map} +1 -1
  62. package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js → CloudHeaderExtras-BtqdN777.js} +4 -4
  63. package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
  64. package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js → CloudPanels-COU26R83.js} +45 -45
  65. package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js.map → CloudPanels-COU26R83.js.map} +1 -1
  66. package/dist/cdn/chunks/CollaborationNotices-DraFUhyo.js +67 -0
  67. package/dist/cdn/chunks/CollaborationNotices-DraFUhyo.js.map +1 -0
  68. package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js → CollaboratorBar-0OEH3hrj.js} +17 -17
  69. package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js.map → CollaboratorBar-0OEH3hrj.js.map} +1 -1
  70. package/dist/cdn/chunks/CommentsPanel-tZZswofV.js +18 -0
  71. package/dist/cdn/chunks/{CommentsPanel-DoJnKLXI.js.map → CommentsPanel-tZZswofV.js.map} +1 -1
  72. package/dist/cdn/chunks/CommentsSidebar-7Hfl3Hdj.js +496 -0
  73. package/dist/cdn/chunks/CommentsSidebar-7Hfl3Hdj.js.map +1 -0
  74. package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js → CountdownBlock-CjMhMhnv.js} +22 -22
  75. package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
  76. package/dist/cdn/chunks/CountdownToolbar-CNgsNL5-.js +260 -0
  77. package/dist/cdn/chunks/CountdownToolbar-CNgsNL5-.js.map +1 -0
  78. package/dist/cdn/chunks/{IssuesPanel-C7LfxaAY.js → IssuesPanel-Duic0mIs.js} +133 -121
  79. package/dist/cdn/chunks/IssuesPanel-Duic0mIs.js.map +1 -0
  80. package/dist/cdn/chunks/LanguageMenu-B1Aue_lf.js +359 -0
  81. package/dist/cdn/chunks/LanguageMenu-B1Aue_lf.js.map +1 -0
  82. package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js → LoadingTrack-DUYcDHOV.js} +2 -2
  83. package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
  84. package/dist/cdn/chunks/LocaleNotices-8J2DRWeg.js +47 -0
  85. package/dist/cdn/chunks/LocaleNotices-8J2DRWeg.js.map +1 -0
  86. package/dist/{LogicTagInsertButton-CfscnwCn.js → cdn/chunks/LogicTagInsertButton-Bhvi0nWz.js} +422 -449
  87. package/dist/cdn/chunks/LogicTagInsertButton-Bhvi0nWz.js.map +1 -0
  88. package/dist/cdn/chunks/{MediaEditModal-Cpcod6_U.js → MediaEditModal-Dz972UFx.js} +421 -421
  89. package/dist/cdn/chunks/MediaEditModal-Dz972UFx.js.map +1 -0
  90. package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js → MediaPanels-C6Hqtp1H.js} +5 -5
  91. package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js.map → MediaPanels-C6Hqtp1H.js.map} +1 -1
  92. package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js → MergeTagInput-CrhZm-AW.js} +28 -28
  93. package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js.map → MergeTagInput-CrhZm-AW.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-BgKEVUtV.js → MergeTagModeToggle-CWVtXLYa.js} +52 -52
  95. package/dist/cdn/chunks/MergeTagModeToggle-CWVtXLYa.js.map +1 -0
  96. package/dist/cdn/chunks/MergeTagTextarea-hTIBwX0F.js +128 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-hTIBwX0F.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-B2UU1Q5I.js +660 -0
  99. package/dist/cdn/chunks/ParagraphEditor-B2UU1Q5I.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js → RestoreVersionDialog-C1Y5Ewo_.js} +22 -22
  101. package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js.map → RestoreVersionDialog-C1Y5Ewo_.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js → RichTextEditorContent-up4AqL7D.js} +44 -44
  103. package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js.map → RichTextEditorContent-up4AqL7D.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js → SaveBlockDialog-B9lwEP_T.js} +77 -77
  105. package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js.map → SaveBlockDialog-B9lwEP_T.js.map} +1 -1
  106. package/dist/{SavedBlocksBrowserModal-CE8n4EBS.js → cdn/chunks/SavedBlocksBrowserModal-fAeHUyxb.js} +103 -106
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BPYcRoGa.js.map → SavedBlocksBrowserModal-fAeHUyxb.js.map} +1 -1
  108. package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js → SavedBlocksPanels-DRDTLDyZ.js} +9 -9
  109. package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js.map → SavedBlocksPanels-DRDTLDyZ.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js → SavedBlocksPickBar-B6b5z-o3.js} +16 -16
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js.map → SavedBlocksPickBar-B6b5z-o3.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-CWUpUKJb.js +266 -0
  113. package/dist/cdn/chunks/TemplateSettings-CWUpUKJb.js.map +1 -0
  114. package/dist/cdn/chunks/TestEmailModal-DQxnW5Q5.js +212 -0
  115. package/dist/cdn/chunks/TestEmailModal-DQxnW5Q5.js.map +1 -0
  116. package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js → TestEmailPanel-BcO_-16H.js} +5 -5
  117. package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js.map → TestEmailPanel-BcO_-16H.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-pmycpmTd.js +202 -0
  119. package/dist/cdn/chunks/TitleEditor-pmycpmTd.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-BlWVQRcA.js +3626 -0
  123. package/dist/cdn/chunks/Toolbar-BlWVQRcA.js.map +1 -0
  124. package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js → TplModal-ClSSGX7a.js} +20 -20
  125. package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js.map → TplModal-ClSSGX7a.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js → VersionHistoryMenu-CZury5gU.js} +33 -33
  127. package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js.map → VersionHistoryMenu-CZury5gU.js.map} +1 -1
  128. package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js → VersionHistoryPanels-B8GPBKMq.js} +6 -6
  129. package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js.map → VersionHistoryPanels-B8GPBKMq.js.map} +1 -1
  130. package/dist/cdn/chunks/VersionPreviewBanner-C4Ji8nu4.js +39 -0
  131. package/dist/cdn/chunks/VersionPreviewBanner-C4Ji8nu4.js.map +1 -0
  132. package/dist/cdn/chunks/WrapperBlock-BoUflYwY.js +46 -0
  133. package/dist/cdn/chunks/WrapperBlock-BoUflYwY.js.map +1 -0
  134. package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js → blockTypeIcons-Cc6RJ27V.js} +5 -5
  135. package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js.map → blockTypeIcons-Cc6RJ27V.js.map} +1 -1
  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-C1KU4ZHw.js +3039 -0
  139. package/dist/cdn/chunks/composables-C1KU4ZHw.js.map +1 -0
  140. package/dist/cdn/chunks/{createCloudRuntime-Cth2JCEh.js → createCloudRuntime-C2Zs5F1O.js} +75 -73
  141. package/dist/cdn/chunks/createCloudRuntime-C2Zs5F1O.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/cdn/chunks/{dist-8ym3y-pH.js → dist-BzXULHvI.js} +48 -48
  145. package/dist/cdn/chunks/{dist-8ym3y-pH.js.map → dist-BzXULHvI.js.map} +1 -1
  146. package/dist/cdn/chunks/{dist-BMzNabtD.js → dist-DqGgijFI.js} +114 -114
  147. package/dist/cdn/chunks/{dist-BMzNabtD.js.map → dist-DqGgijFI.js.map} +1 -1
  148. package/dist/cdn/chunks/{draggable-Du8AUMFT.js → draggable-DepKdldn.js} +1491 -1486
  149. package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
  150. package/dist/cdn/chunks/{editor-modal-CyCe560f.js → editor-modal-erQEOHZN.js} +781 -781
  151. package/dist/cdn/chunks/{editor-modal-CyCe560f.js.map → editor-modal-erQEOHZN.js.map} +1 -1
  152. package/dist/cdn/chunks/en-B6tLGRHq.js +1 -0
  153. package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
  154. package/dist/cdn/chunks/en-C0pHHMiR.js.map +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-CFF2KWy-.js → extensions-DcMKZpzh.js} +59 -59
  158. package/dist/cdn/chunks/{extensions-CFF2KWy-.js.map → extensions-DcMKZpzh.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-okSPsLOa.js → icons-Da9GKjPx.js} +188 -147
  162. package/dist/cdn/chunks/icons-Da9GKjPx.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/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
  170. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
  171. package/dist/cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js +290 -0
  172. package/dist/cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js.map +1 -0
  173. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
  174. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
  175. package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
  176. package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
  177. package/dist/{preRenderCustomBlocks--_xc0XK3.js → cdn/chunks/preRenderCustomBlocks-f7GEKdvw.js} +5 -3
  178. package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js.map → preRenderCustomBlocks-f7GEKdvw.js.map} +1 -1
  179. package/dist/{pt-BR-dDlTwX18.js → cdn/chunks/pt-BR-CY5Ye7eP.js} +116 -0
  180. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
  181. package/dist/cdn/chunks/sanitizeHtml-WTfz9lZd.js +61 -0
  182. package/dist/cdn/chunks/sanitizeHtml-WTfz9lZd.js.map +1 -0
  183. package/dist/cdn/chunks/socialIcons-DeCYorUT.js +2638 -0
  184. package/dist/cdn/chunks/socialIcons-DeCYorUT.js.map +1 -0
  185. package/dist/cdn/chunks/{src-DEd87i_U.js → src-A_cKeTM_.js} +618 -461
  186. package/dist/cdn/chunks/src-A_cKeTM_.js.map +1 -0
  187. package/dist/cdn/chunks/src-BQUv2CYU.js +2606 -0
  188. package/dist/cdn/chunks/src-BQUv2CYU.js.map +1 -0
  189. package/dist/cdn/chunks/src-BWX_xVxO.js +671 -0
  190. package/dist/cdn/chunks/src-BWX_xVxO.js.map +1 -0
  191. package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
  192. package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
  193. package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
  194. package/dist/cdn/chunks/{tiptap-CbiTlECY.js → tiptap-Dipw_zOQ.js} +40 -40
  195. package/dist/cdn/chunks/{tiptap-CbiTlECY.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
  196. package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js → useCloudI18n-Cc5NZqiI.js} +3 -3
  197. package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
  198. package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
  199. package/dist/cdn/chunks/{useEditorRoot-vjZJwKrV.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
  200. package/dist/cdn/chunks/{useI18n-D8pY4LTq.js → useI18n-BnJYydPv.js} +3 -3
  201. package/dist/cdn/chunks/{useI18n-D8pY4LTq.js.map → useI18n-BnJYydPv.js.map} +1 -1
  202. package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js +33 -0
  203. package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js.map +1 -0
  204. package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js → useLogicTag-DtYe8HIq.js} +5 -5
  205. package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js.map → useLogicTag-DtYe8HIq.js.map} +1 -1
  206. package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js → useMergeTag-B8ULmsnp.js} +6 -6
  207. package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js.map → useMergeTag-B8ULmsnp.js.map} +1 -1
  208. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
  209. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
  210. package/dist/cdn/chunks/{useScrollToBlock-vjQ0fe-L.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
  211. package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
  212. package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js → withCurrentFont-MK8ga9q9.js} +2 -2
  213. package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js.map → withCurrentFont-MK8ga9q9.js.map} +1 -1
  214. package/dist/cdn/editor.css +1 -1
  215. package/dist/cdn/editor.js +2189 -1495
  216. package/dist/cdn/editor.js.map +1 -1
  217. package/dist/{check-BZ8o0eet.js → check-XMnOOIEC.js} +1 -1
  218. package/dist/{chevron-down-DfAAfILv.js → chevron-down-DmamTEWQ.js} +1 -1
  219. package/dist/{chevron-right-Bk4mGdr7.js → chevron-right-BEFXOH27.js} +1 -1
  220. package/dist/{chevron-up-MhUf_azW.js → chevron-up-Dw7woXj8.js} +1 -1
  221. package/dist/{circle-alert-CShJwVFv.js → circle-alert-BTKC9vkq.js} +1 -1
  222. package/dist/{clock-CTfD6OCt.js → clock-BVT5u2uG.js} +1 -1
  223. package/dist/composables-CMIrGXJ1.js +4517 -0
  224. package/dist/{createCloudRuntime-DCgO4A1r.js → createCloudRuntime-DGV5a5Af.js} +54 -52
  225. package/dist/{createLucideIcon-CvhTA2KG.js → createLucideIcon-CgDE3xAR.js} +16 -16
  226. package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
  227. package/dist/{dist-ByCWA2Tv.js → dist-0alKVRc_.js} +101 -101
  228. package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
  229. package/dist/dist-6DU0me3E.js +4 -0
  230. package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
  231. package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
  232. package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
  233. package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
  234. package/dist/{dist-CVy-7PHQ.js → dist-CX7skkvG.js} +48 -48
  235. package/dist/dist-CcOn7WCo.js +4 -0
  236. package/dist/dist-Cdkm20M6.js +2542 -0
  237. package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
  238. package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
  239. package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
  240. package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
  241. package/dist/{dist-D6cMdrfG.js → dist-fqSers8_.js} +55 -55
  242. package/dist/{editor-modal-zaZHcmlO.js → editor-modal-BeX6otLk.js} +953 -952
  243. package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
  244. package/dist/en-Do0SU6tR.js +1 -0
  245. package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
  246. package/dist/{extensions-fo_c-vqf.js → extensions-BJ184osp.js} +173 -173
  247. package/dist/{eye-7W4t5e0Q.js → eye-ByMgHeA_.js} +1 -1
  248. package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
  249. package/dist/{image-BDiRFzSd.js → image-Ch8tR35K.js} +1 -1
  250. package/dist/index.d.ts +182 -14
  251. package/dist/{info-Cxi3-Kh9.js → info-DzSD-Wpk.js} +1 -1
  252. package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
  253. package/dist/keys-BCqskl51.js +9 -0
  254. package/dist/languageName-DEEOhDWI.js +10 -0
  255. package/dist/{link-ju_2Cmir.js → link-oDn9AR2w.js} +1 -1
  256. package/dist/{list-DYZJf0aZ.js → list-C5t07dp8.js} +1 -1
  257. package/dist/{loader-circle-BZRD0a4I.js → loader-circle-k6xvKgUB.js} +1 -1
  258. package/dist/{message-circle-DuEw4Zfx.js → message-circle-C23R6OJR.js} +1 -1
  259. package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
  260. package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
  261. package/dist/noticeTones-D7BPu-Le.js +14 -0
  262. package/dist/{package-CePMr2kK.js → package-C90eQ7NU.js} +1 -1
  263. package/dist/{pencil-D3aFCL7c.js → pencil-BK7GrQuA.js} +1 -1
  264. package/dist/plural-CyxrJXL1.js +15 -0
  265. package/dist/plus-Cr0Mis63.js +13 -0
  266. package/dist/{cdn/chunks/preRenderCustomBlocks-BcXIz7oJ.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -6
  267. package/dist/{cdn/chunks/pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -2
  268. package/dist/{refresh-cw-xnro7_Sk.js → refresh-cw-_ZLOIEvA.js} +2 -12
  269. package/dist/rotate-ccw-CB5wsHwv.js +13 -0
  270. package/dist/{runtime-dom.esm-bundler-BURR-bj5.js → runtime-dom.esm-bundler-DlHp8xgy.js} +154 -154
  271. package/dist/sanitizeHtml-2rjV0r-6.js +962 -0
  272. package/dist/{search-CDrstRBv.js → search-BmrQNox8.js} +1 -1
  273. package/dist/{send-DROkPOaX.js → send-blAsIBBg.js} +1 -1
  274. package/dist/{smartphone-Bx6u_tjn.js → smartphone-BPpWYrwV.js} +1 -1
  275. package/dist/socialIcons-TFiOkpoU.js +2705 -0
  276. package/dist/{sparkles-CdaTtvoz.js → sparkles-OqIxrNp-.js} +1 -1
  277. package/dist/{square-BbCROH_f.js → square-BP-V7iT-.js} +1 -1
  278. package/dist/style.css +1 -1
  279. package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
  280. package/dist/templatical-editor.js +2438 -1752
  281. package/dist/{text-align-start-CGacJ9Vw.js → text-align-start-4mwX2o-F.js} +13 -13
  282. package/dist/{trash-DxCd7zIy.js → trash-B99WixTA.js} +1 -1
  283. package/dist/{triangle-alert-7_oaitpf.js → triangle-alert-CHMiDkHa.js} +1 -1
  284. package/dist/{upload-DuFEOi_0.js → upload-Cp8o-hrN.js} +1 -1
  285. package/dist/{useCloudI18n-DEMmUKuO.js → useCloudI18n-Dh2iydo1.js} +4 -4
  286. package/dist/useEditorRoot-DY3mgcHm.js +7 -0
  287. package/dist/{useI18n-BBrHTdu8.js → useI18n-CgtvtF4C.js} +4 -4
  288. package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
  289. package/dist/{useLogicTag-ZPC39rfH.js → useLogicTag-BXXXQQmi.js} +4 -4
  290. package/dist/{useMergeTag-BQ4qqWpQ.js → useMergeTag-C9Okr87y.js} +5 -5
  291. package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
  292. package/dist/{useScrollToBlock-BSyAV4pk.js → useScrollToBlock-B35ObCGK.js} +5 -5
  293. package/dist/{vue.runtime.esm-bundler-CnEeTfhs.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1373 -1368
  294. package/dist/withCurrentFont-DJiQqZzL.js +18 -0
  295. package/dist/{x-BpfG7v9g.js → x-BIBStNMS.js} +1 -1
  296. package/package.json +21 -21
  297. package/dist/AiAltTextPopover-DawbUywc.js +0 -105
  298. package/dist/AiChatPanel-CupPhmsN.js +0 -548
  299. package/dist/BlockIssueBadge-BxpDy3u-.js +0 -33
  300. package/dist/BlockPreviewCanvas-B-4bmJ3t.js +0 -140
  301. package/dist/CollaborationNotices-CTw4JThq.js +0 -75
  302. package/dist/CommentsPanel-DwwFuh1h.js +0 -16
  303. package/dist/CommentsSidebar-9ZfiC2DO.js +0 -500
  304. package/dist/CountdownToolbar-BqoYzf_6.js +0 -197
  305. package/dist/IssuesPanel-4ykrf1ax.js +0 -359
  306. package/dist/MergeTagTextarea-CPFEjJZd.js +0 -69
  307. package/dist/ParagraphEditor-CWXfurGh.js +0 -796
  308. package/dist/TemplateSettings-CS0f1Ues.js +0 -236
  309. package/dist/TestEmailModal-DBD0X5nV.js +0 -209
  310. package/dist/TitleEditor-DSqtle77.js +0 -198
  311. package/dist/ToggleSwitch-JykPyD_8.js +0 -36
  312. package/dist/Toolbar-BZPFfKrf.js +0 -3145
  313. package/dist/VersionPreviewBanner-DECaBwLq.js +0 -37
  314. package/dist/WrapperBlock-BsJv_Fiw.js +0 -44
  315. package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js +0 -106
  316. package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js.map +0 -1
  317. package/dist/cdn/chunks/AiAltTextReview-BGLLSKLm.js.map +0 -1
  318. package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js +0 -474
  319. package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js.map +0 -1
  320. package/dist/cdn/chunks/AiRewriteMenu-qf-cfEpy.js.map +0 -1
  321. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +0 -34
  322. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +0 -1
  323. package/dist/cdn/chunks/BlockPreviewCanvas-DGBh6mqe.js +0 -142
  324. package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js +0 -77
  325. package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js.map +0 -1
  326. package/dist/cdn/chunks/CommentsPanel-DoJnKLXI.js +0 -18
  327. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js +0 -470
  328. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +0 -1
  329. package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js +0 -199
  330. package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js.map +0 -1
  331. package/dist/cdn/chunks/IssuesPanel-C7LfxaAY.js.map +0 -1
  332. package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js +0 -1051
  333. package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js.map +0 -1
  334. package/dist/cdn/chunks/MediaEditModal-Cpcod6_U.js.map +0 -1
  335. package/dist/cdn/chunks/MergeTagModeToggle-BgKEVUtV.js.map +0 -1
  336. package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js +0 -71
  337. package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js.map +0 -1
  338. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js +0 -631
  339. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +0 -1
  340. package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js +0 -208
  341. package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js.map +0 -1
  342. package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js +0 -209
  343. package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js.map +0 -1
  344. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js +0 -198
  345. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +0 -1
  346. package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js +0 -38
  347. package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js.map +0 -1
  348. package/dist/cdn/chunks/Toolbar-CdpsvNOR.js +0 -3061
  349. package/dist/cdn/chunks/Toolbar-CdpsvNOR.js.map +0 -1
  350. package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js +0 -39
  351. package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js.map +0 -1
  352. package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js +0 -46
  353. package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js.map +0 -1
  354. package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
  355. package/dist/cdn/chunks/createCloudRuntime-Cth2JCEh.js.map +0 -1
  356. package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
  357. package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +0 -1
  358. package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
  359. package/dist/cdn/chunks/en-TIqv4ag3.js +0 -1
  360. package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
  361. package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
  362. package/dist/cdn/chunks/icons-okSPsLOa.js.map +0 -1
  363. package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
  364. package/dist/cdn/chunks/keys-CUj6UA38.js +0 -11
  365. package/dist/cdn/chunks/keys-CUj6UA38.js.map +0 -1
  366. package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
  367. package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js +0 -198
  368. package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js.map +0 -1
  369. package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
  370. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js +0 -72
  371. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js.map +0 -1
  372. package/dist/cdn/chunks/socialIcons-jsTDmkbb.js +0 -2008
  373. package/dist/cdn/chunks/socialIcons-jsTDmkbb.js.map +0 -1
  374. package/dist/cdn/chunks/src-C7bkofBL.js +0 -647
  375. package/dist/cdn/chunks/src-C7bkofBL.js.map +0 -1
  376. package/dist/cdn/chunks/src-DEd87i_U.js.map +0 -1
  377. package/dist/cdn/chunks/src-DwWrYnUj.js +0 -1404
  378. package/dist/cdn/chunks/src-DwWrYnUj.js.map +0 -1
  379. package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
  380. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +0 -2582
  381. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +0 -1
  382. package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +0 -9
  383. package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js +0 -70
  384. package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js.map +0 -1
  385. package/dist/cdn/chunks/useScrollToBlock-vjQ0fe-L.js.map +0 -1
  386. package/dist/dist-CKi_npZM.js +0 -1344
  387. package/dist/dist-DyFArF_G.js +0 -4
  388. package/dist/dist-pA3ooG6N.js +0 -4
  389. package/dist/en-Db76vJbY.js +0 -1
  390. package/dist/keys-BgRERHzu.js +0 -9
  391. package/dist/normalizeMergeTagMarkup-CELnOlgK.js +0 -196
  392. package/dist/sanitizeHtml-BzfzpYJY.js +0 -942
  393. package/dist/socialIcons-D7MGsg0d.js +0 -2075
  394. package/dist/useEditorCore-BSo2sSID.js +0 -4059
  395. package/dist/useEditorRoot-BMcoCLBx.js +0 -7
  396. package/dist/usePopoverPosition-DV1PxL66.js +0 -68
  397. package/dist/withCurrentFont-B22FXAF5.js +0 -18
@@ -1,2582 +0,0 @@
1
- import { A as e, C as t, D as n, F as r, G 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, Y as h, Z as g, _, at as v, b as y, c as b, dt as x, et as S, ft as C, g as w, h as T, j as E, l as D, m as O, nt as k, ot as A, p as j, s as M, st as N, t as P, u as F, ut as I, x as L, z as R } from "./draggable-Du8AUMFT.js";
2
- import { $ as ee, B as z, Bt as B, E as V, F as H, Ft as U, G as te, Gt as ne, H as re, I as ie, J as ae, Jt as W, K as G, Kt as oe, L as se, Mt as ce, Nt as le, O as ue, Ot as de, P as K, Q as fe, R as pe, T as me, U as he, Ut as ge, V as _e, Wt as ve, Y as ye, a as be, b as xe, c as Se, d as Ce, f as we, g as Te, h as Ee, i as De, jt as Oe, l as ke, m as Ae, n as je, nt as Me, o as Ne, ot as Pe, p as Fe, q as Ie, qt as Le, r as Re, rt as ze, t as Be, tt as Ve, u as He, y as Ue, yt as We, z as Ge, zt as Ke } from "./src-DwWrYnUj.js";
3
- import { C as qe, I as Je, L as Ye, M as Xe, N as Ze, P as Qe, R as $e, S as et, _ as tt, a as nt, b as rt, d as it, g as at, l as ot, m as st, n as ct, t as lt, v as ut, w as dt } from "./socialIcons-jsTDmkbb.js";
4
- import { _ as ft, h as pt, v as mt, y as ht } from "./dist-8ym3y-pH.js";
5
- import { a as q, c as gt, i as _t, l as vt } from "./dist-BMzNabtD.js";
6
- import { $ as J, A as yt, B as bt, C as xt, D as St, E as Ct, F as wt, H as Tt, I as Et, J as Dt, K as Ot, L as kt, M as At, N as jt, O as Y, P as Mt, Q as Nt, 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 X, 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 on, w as sn, x as cn, y as ln, z as un } from "./keys-CUj6UA38.js";
7
- import { t as Z } from "./logger-CqQTfJGx.js";
8
- import { t as Q } from "./useI18n-D8pY4LTq.js";
9
- import { i as dn, r as fn, s as pn, t as mn } from "./usePopoverPosition-DSMtmu2W.js";
10
- import { r as hn, t as gn } from "./templateSettingsFields-cjlP-jdw.js";
11
- import { n as _n, t as vn } from "./sanitizeHtml-CN85EDrO.js";
12
- import { Ht as yn, Ot as bn, St as xn, Ut as Sn, V as Cn, X as wn, _t as Tn, d as En, f as Dn, jt as On, k as kn, kt as An, nt as jn, o as Mn, y as Nn, yt as Pn } from "./icons-okSPsLOa.js";
13
- import { t as Fn } from "./LoadingTrack-CZuLTazv.js";
14
- import { t as In } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
15
- import { t as Ln } from "./useEditorRoot-vjZJwKrV.js";
16
- import "./useCloudI18n-DY8_-ETE.js";
17
- import { t as Rn } from "./useMergeTag-B-aG--s1.js";
18
- import { t as zn } from "./useLogicTag-DBJDtpKA.js";
19
- import { t as Bn } from "./readableTextColor-BfZUGnVj.js";
20
- // src/utils/activeEditorTracker.ts
21
- var Vn = /* @__PURE__ */ new Set(), $ = 0, Hn = 0;
22
- function Un() {
23
- let e = ++Hn;
24
- return Vn.add(e), $ === 0 && ($ = e), {
25
- id: e,
26
- isActive: () => Vn.size <= 1 || $ === e,
27
- claim: () => {
28
- $ = e;
29
- },
30
- dispose: () => {
31
- if (Vn.delete(e), $ === e) {
32
- let e = Array.from(Vn);
33
- $ = e[e.length - 1] ?? 0;
34
- }
35
- }
36
- };
37
- }
38
- // src/composables/usePreviewResolution.ts
39
- var Wn = 500;
40
- function Gn(e) {
41
- let t = typeof e.resolvePreview == "function", n = S(null), r = S(!1), i = S(!1), a = 0, o = null;
42
- function s() {
43
- o !== null && (clearTimeout(o), o = null);
44
- }
45
- async function c() {
46
- let t = e.resolvePreview;
47
- if (!t) return;
48
- let o = ++a;
49
- r.value = !0;
50
- let s = {
51
- content: de(e.getContent()),
52
- ...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
53
- };
54
- try {
55
- let e = await t(s);
56
- if (o !== a) return;
57
- if (!Be(e)) {
58
- i.value = !0;
59
- return;
60
- }
61
- n.value = e, i.value = !1;
62
- } catch {
63
- if (o !== a) return;
64
- i.value = !0;
65
- } finally {
66
- o === a && (r.value = !1);
67
- }
68
- }
69
- function l() {
70
- t && (s(), n.value === null ? c() : o = setTimeout(() => {
71
- o = null, c();
72
- }, Wn));
73
- }
74
- return p(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
75
- e ? l() : (s(), a++, r.value = !1, n.value = null, i.value = !1);
76
- }, { immediate: !0 }), g(() => {
77
- s(), a++;
78
- }), {
79
- isConfigured: t,
80
- content: j(() => n.value ?? e.getContent()),
81
- isResolving: r,
82
- isInitialResolve: j(() => r.value && n.value === null),
83
- hasFailed: i,
84
- supersedesSamples: j(() => t)
85
- };
86
- }
87
- // src/composables/useMergeTagPicker.ts
88
- function Kn() {
89
- let e = S(!1), t = S([]), n = S(null), r = null;
90
- function i(i, a) {
91
- if (r) {
92
- let e = r;
93
- r = null, e(null);
94
- }
95
- return t.value = i, n.value = a?.current ?? null, e.value = !0, new Promise((e) => {
96
- r = e;
97
- });
98
- }
99
- function a(i) {
100
- let a = r;
101
- r = null, e.value = !1, t.value = [], n.value = null, a && a(i);
102
- }
103
- return o() && g(() => {
104
- if (r) {
105
- let e = r;
106
- r = null, e(null);
107
- }
108
- e.value = !1, t.value = [], n.value = null;
109
- }), {
110
- isOpen: e,
111
- tags: t,
112
- current: n,
113
- open: i,
114
- resolve: a
115
- };
116
- }
117
- // src/composables/useLogicTagPicker.ts
118
- function qn() {
119
- let e = S(!1), t = S([]), n = S([]), r = null;
120
- function i(i, a) {
121
- if (r) {
122
- let e = r;
123
- r = null, e(null);
124
- }
125
- return t.value = i, n.value = a, e.value = !0, new Promise((e) => {
126
- r = e;
127
- });
128
- }
129
- function a(i) {
130
- let a = r;
131
- r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
132
- }
133
- return o() && g(() => {
134
- if (r) {
135
- let e = r;
136
- r = null, e(null);
137
- }
138
- e.value = !1, t.value = [], n.value = [];
139
- }), {
140
- isOpen: e,
141
- tags: t,
142
- pairs: n,
143
- open: i,
144
- resolve: a
145
- };
146
- }
147
- // src/composables/useTemplateLint.ts
148
- function Jn(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 Yn = !1;
152
- function Xn(e) {
153
- let t = S([]), n = S(0), r = S(-1), i = p(e.content, () => {
154
- n.value++;
155
- }, {
156
- deep: !0,
157
- flush: "sync"
158
- }), a = S(!1), o = S(!1), s = k(null), c = Jn(e.options), l = null, u = !1;
159
- c || d();
160
- async function d() {
161
- try {
162
- let t = await import("./src-DEd87i_U.js");
163
- if (u) return;
164
- s.value = { lintTemplate: t.lintTemplate }, a.value = !0, f(), l = ht(e.content, f, {
165
- debounce: e.debounce ?? 500,
166
- deep: !0
167
- });
168
- } catch {
169
- if (u) return;
170
- o.value = !0, Yn || (Yn = !0, Z.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 f() {
174
- if (!s.value) return;
175
- let i = s.value.lintTemplate(e.content.value, e.options);
176
- r.value = n.value, t.value = i;
177
- }
178
- let m = p(() => e.options, () => {
179
- s.value && f();
180
- }, { deep: !0 });
181
- function h(t) {
182
- t.fix && t.fix.apply({
183
- updateBlock: e.updateBlock,
184
- updateSettings: e.updateSettings,
185
- removeBlock: e.removeBlock
186
- });
187
- }
188
- function g() {
189
- u = !0, l?.(), i(), m();
190
- }
191
- return {
192
- issues: t,
193
- contentVersion: n,
194
- lintVersion: r,
195
- ready: a,
196
- unavailable: o,
197
- applyFix: h,
198
- destroy: g
199
- };
200
- }
201
- // src/composables/useKeyboardReorder.ts
202
- function Zn(e, t, n = []) {
203
- let r = S(null), i = S(""), a = null;
204
- function o(t) {
205
- let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
206
- if (r !== -1) return {
207
- index: r,
208
- total: n.length
209
- };
210
- for (let e of n) {
211
- if (e.type !== "section") continue;
212
- let n = e;
213
- for (let e = 0; e < n.children.length; e++) {
214
- let r = n.children[e], i = r.findIndex((e) => e.id === t);
215
- if (i !== -1) return {
216
- index: i,
217
- total: r.length,
218
- sectionId: n.id,
219
- columnIndex: e
220
- };
221
- }
222
- }
223
- return null;
224
- }
225
- function s(r) {
226
- let i = o(r);
227
- if (!i) return "";
228
- let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
229
- return a ? ut(a, t.t, n) : "";
230
- }
231
- function c(t, n) {
232
- return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
233
- }
234
- function l(e) {
235
- i.value = "", queueMicrotask(() => {
236
- i.value = e;
237
- });
238
- }
239
- function u(e) {
240
- return r.value === e;
241
- }
242
- function d(e) {
243
- let n = o(e);
244
- n && (r.value = e, a = n, l(t.format(t.t.blockActions.lifted, {
245
- block: s(e),
246
- position: String(n.index + 1),
247
- total: String(n.total)
248
- })));
249
- }
250
- function f(n, r) {
251
- let i = o(n);
252
- if (!i) return;
253
- let a = i.index + r;
254
- a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex), l(t.format(t.t.blockActions.moved, {
255
- block: s(n),
256
- position: String(a + 1),
257
- total: String(i.total)
258
- })));
259
- }
260
- function p(e) {
261
- f(e, -1);
262
- }
263
- function m(e) {
264
- f(e, 1);
265
- }
266
- function h(e) {
267
- let n = o(e);
268
- n && l(t.format(t.t.blockActions.dropped, {
269
- block: s(e),
270
- position: String(n.index + 1),
271
- total: String(n.total)
272
- })), r.value = null, a = null;
273
- }
274
- function g() {
275
- let n = r.value;
276
- if (n && a) {
277
- let r = o(n);
278
- r && (r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex) || r && r.index !== a.index) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex), l(t.format(t.t.blockActions.cancelled, {
279
- block: s(n),
280
- position: String(a.index + 1)
281
- }));
282
- }
283
- r.value = null, a = null;
284
- }
285
- return {
286
- liftedBlockId: r,
287
- announcement: i,
288
- isLifted: u,
289
- lift: d,
290
- cancel: g,
291
- moveUp: p,
292
- moveDown: m,
293
- drop: h
294
- };
295
- }
296
- // src/composables/useUiTheme.ts
297
- function Qn(e) {
298
- let t = gt("(prefers-color-scheme: dark)");
299
- return { resolvedTheme: j(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
300
- }
301
- // src/composables/useThemeStyles.ts
302
- var $n = {
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 er({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
327
- return { themeStyles: j(() => {
328
- let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
329
- if (a) for (let [e, t] of Object.entries($n)) {
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 tr() {
338
- let e = k(/* @__PURE__ */ new Map());
339
- function t(t, n) {
340
- e.value.set(t, n), A(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
- }), A(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 fe(await import("./liquid.browser-rubac0VA.js")).parseAndRender(t.template, e.fieldValues);
372
- } catch (t) {
373
- return Z.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 nr(e, t) {
391
- return j(() => {
392
- let n = rr(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 rr(e) {
405
- let t = /* @__PURE__ */ new Set();
406
- return ir(e, t), t;
407
- }
408
- function ir(e, t) {
409
- for (let n of e) if (Pe(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) ir(n, t);
414
- } else We(n) && ir(n.children, t);
415
- }
416
- // src/utils/registerBuiltInBlocks.ts
417
- var ar = [
418
- {
419
- type: "section",
420
- createBlock: he
421
- },
422
- {
423
- type: "title",
424
- createBlock: ae
425
- },
426
- {
427
- type: "paragraph",
428
- createBlock: re
429
- },
430
- {
431
- type: "image",
432
- createBlock: z
433
- },
434
- {
435
- type: "button",
436
- createBlock: H
437
- },
438
- {
439
- type: "divider",
440
- createBlock: pe
441
- },
442
- {
443
- type: "video",
444
- createBlock: ye
445
- },
446
- {
447
- type: "social",
448
- createBlock: te
449
- },
450
- {
451
- type: "menu",
452
- createBlock: _e
453
- },
454
- {
455
- type: "table",
456
- createBlock: Ie
457
- },
458
- {
459
- type: "spacer",
460
- createBlock: G
461
- },
462
- {
463
- type: "html",
464
- createBlock: Ge
465
- },
466
- {
467
- type: "countdown",
468
- createBlock: ie
469
- }
470
- ];
471
- function or(e, t) {
472
- for (let n of ar) {
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 sr(e) {
482
- return typeof e == "boolean" ? e : e?.enabled ?? !1;
483
- }
484
- // src/utils/collectOffPaletteDefaults.ts
485
- function cr(e) {
486
- return typeof e == "object" && !!e && !Array.isArray(e);
487
- }
488
- function lr(e, t, n) {
489
- let r = new Set(e.map((e) => fn(e))), i = [], a = (e, t) => {
490
- for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(fn(o)) && i.push(`${t}.${n}: ${o}`) : cr(o) && a(o, `${t}.${n}`);
491
- }, o = t;
492
- for (let [e, t] of Object.entries(Ve)) {
493
- let n = o?.[e];
494
- a({
495
- ...t,
496
- ...cr(n) ? n : {}
497
- }, e);
498
- }
499
- return a({
500
- ...Me,
501
- ...n ?? {}
502
- }, "template"), i;
503
- }
504
- // src/utils/localizedBlockDefaults.ts
505
- function ur(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 dr = /* #__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
- }), fr = /* #__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 pr(e) {
528
- return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
529
- }
530
- var mr = pr(dr), hr = pr(fr);
531
- function gr(e) {
532
- return e.trim().replace(/_/g, "-").toLowerCase();
533
- }
534
- function _r(e, t) {
535
- let n = gr(e);
536
- return t.find((e) => gr(e) === n);
537
- }
538
- function vr(e) {
539
- return gr(e).split("-")[0];
540
- }
541
- function yr(e, t) {
542
- return _r(e, t) ?? _r(vr(e), t);
543
- }
544
- function br(e, t) {
545
- return yr(e, t) ?? "en";
546
- }
547
- async function xr(e) {
548
- let t = dr[`./locales/${br(e, mr)}.ts`];
549
- return (await t()).default;
550
- }
551
- async function Sr(e) {
552
- let t = fr[`./locales/cloud/${br(e, hr)}.ts`];
553
- return (await t()).default;
554
- }
555
- function Cr(e) {
556
- return yr(e, mr) !== void 0;
557
- }
558
- function wr(e) {
559
- return yr(e, hr) !== void 0;
560
- }
561
- function Tr() {
562
- return [...mr];
563
- }
564
- function Er() {
565
- return [...hr];
566
- }
567
- // src/i18n/contentDefaults.ts
568
- var Dr = {
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
- }, Or = new Map(Object.keys(Dr).map((e) => [e.toLowerCase(), e]));
634
- function kr(e) {
635
- if (!e) return Dr.en;
636
- let t = e.trim().replace(/_/g, "-").toLowerCase(), n = Or.get(t);
637
- if (n) return Dr[n];
638
- let r = Or.get(vr(t));
639
- return r ? Dr[r] : Dr.en;
640
- }
641
- function Ar(e) {
642
- let t = kr(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 jr(e, t) {
656
- let n = [], r = (r, i) => {
657
- let a = tt(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) => fn(e)));
669
- e !== "" && !t.has(fn(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 Mr(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 Nr(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 (Mr(e)) return;
694
- e.preventDefault(), e.shiftKey ? t.history.redo() : t.history.undo();
695
- } else {
696
- if (t.isPicking?.() && !Mr(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() && !Mr(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
711
- }
712
- }
713
- // src/utils/blockComponentResolver.ts
714
- function Pr(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 Fr(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 Ir = "--tpl-block-bg-layer", Lr = "tpl-has-bg-image";
726
- function Rr(e, t) {
727
- if (t === null) return {};
728
- let n = B(e);
729
- if (n === null) return {};
730
- let r = t?.trim(), i = r ? Ke(r) : n.url;
731
- return {
732
- backgroundImage: `url("${i}")`,
733
- backgroundSize: n.size,
734
- backgroundPosition: n.position,
735
- backgroundRepeat: n.repeat,
736
- [Ir]: `url("${i}") ${n.position} / ${n.size} ${n.repeat}`
737
- };
738
- }
739
- function zr(e) {
740
- return e && Ir in e ? Lr : void 0;
741
- }
742
- var Br = {
743
- top: "flex-start",
744
- middle: "center",
745
- bottom: "flex-end"
746
- };
747
- function Vr(e, t) {
748
- let n = typeof e.height == "number" ? { minHeight: `${e.height}px` } : t !== void 0 && e.aspectRatio !== null ? { minHeight: `${Hr(t, e.aspectRatio)}px` } : { aspectRatio: `1 / ${e.aspectRatio ?? 1}` };
749
- return {
750
- display: "flex",
751
- flexDirection: "column",
752
- justifyContent: Br[e.verticalAlign],
753
- boxSizing: "border-box",
754
- ...n
755
- };
756
- }
757
- function Hr(e, t) {
758
- return Math.max(1, Math.round(Math.max(1, Math.round(e)) * t));
759
- }
760
- function Ur(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 ?? ve.paragraphGap : ve.paragraphGap}px`), e.type === "section") {
767
- let n = W(e.borderRadius);
768
- n !== null && (i.borderRadius = n);
769
- let r = U(e);
770
- r?.applied && e.backgroundImage ? (Object.assign(i, Vr(r, t.heroBoxWidth)), Object.assign(i, Rr({
771
- ...e.backgroundImage,
772
- size: "cover",
773
- repeat: !1
774
- }, t.backgroundImageUrl))) : (Object.assign(i, Gr(e.border)), Object.assign(i, Rr(e.backgroundImage, t.backgroundImageUrl)));
775
- }
776
- return i;
777
- }
778
- function Wr(e, t, n, r) {
779
- return e.type === "section" ? Ur(e, {
780
- backgroundImageUrl: et(t, e.backgroundImage, n),
781
- heroBoxWidth: r
782
- }) : Ur(e);
783
- }
784
- function Gr(e) {
785
- let t = {};
786
- for (let [n, r] of Object.entries(Le(e))) t[n.replace(/-(\w)/g, (e, t) => t.toUpperCase())] = r;
787
- return t;
788
- }
789
- function Kr(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, Rr(n.backgroundImage, t.backgroundImageUrl)), r;
795
- }
796
- function qr(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, Rr(e.backgroundImage, t.backgroundImageUrl)), n;
804
- }
805
- // src/utils/mergeTagLabelSegments.ts
806
- function Jr(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 (Ce(i, n)) {
816
- let e = r ? Ne(i, t) : void 0;
817
- a.push(e === void 0 ? {
818
- type: "tag",
819
- value: be(i, t)
820
- } : {
821
- type: "text",
822
- value: e
823
- });
824
- } else He(i, n) ? a.push({
825
- type: "tag",
826
- value: De(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 Yr = t({
840
- name: "MergeTagPreviewText",
841
- props: { text: {
842
- type: String,
843
- required: !0
844
- } },
845
- setup(e) {
846
- let t = n(Y, wt), r = n(Mt, je.liquid), i = n(Nt, null), a = j(() => Jr(e.text, t.value, r, 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
- }), Xr = ["href"], Zr = /* @__PURE__ */ t({
853
- __name: "ButtonBlock",
854
- props: {
855
- block: {},
856
- viewport: {}
857
- },
858
- setup(e) {
859
- let t = e, n = J(on, "ButtonBlock"), r = j(() => {
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, Gr(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 = j(() => ({ textAlign: t.block.align ?? "center" }));
873
- return (t, n) => (l(), _("div", { style: x(i.value) }, [O("a", {
874
- href: e.block.url || "#",
875
- style: x(r.value),
876
- class: "tpl:cursor-default",
877
- onClick: n[0] ||= D(() => {}, ["prevent"])
878
- }, [L(Yr, { text: e.block.text }, null, 8, ["text"])], 12, Xr)], 4));
879
- }
880
- }), Qr = ["innerHTML"], $r = [
881
- "src",
882
- "width",
883
- "height"
884
- ], ei = /* @__PURE__ */ t({
885
- __name: "CustomBlockIcon",
886
- props: {
887
- icon: {},
888
- size: {}
889
- },
890
- setup(e) {
891
- let t = e, n = j(() => t.size ?? 20), r = j(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), i = j(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/"))), a = j(() => r.value ? _n(t.icon ?? "") : "");
892
- return (t, o) => r.value ? (l(), _("span", {
893
- key: 0,
894
- class: "tpl:inline-flex tpl:items-center tpl:justify-center",
895
- style: x({
896
- width: `${n.value}px`,
897
- height: `${n.value}px`
898
- }),
899
- innerHTML: a.value
900
- }, null, 12, Qr)) : i.value ? (l(), _("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, $r)) : (l(), T(N(yn), {
908
- key: 2,
909
- size: n.value,
910
- "stroke-width": 1.5
911
- }, null, 8, ["size"]));
912
- }
913
- }), ti = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
914
- function ni(e, t) {
915
- let n = Ln(), r = null, i = null, a = null;
916
- function o() {
917
- return e.value ? Array.from(e.value.querySelectorAll(ti)).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 = q(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
- g(() => {
942
- u(), l();
943
- });
944
- }
945
- // src/composables/useEmoji.ts
946
- function ri() {
947
- let [e, t] = mt(!1), n = k([]), r = !1;
948
- g(() => {
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 ii = [
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
- ], ai = "Arial, sans-serif";
1001
- function oi(e) {
1002
- if (e === void 0 || e === !0) return [...ii];
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 = ii.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), Z.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${ii.map((e) => e.value).join(", ")}.`));
1008
- }
1009
- return t;
1010
- }
1011
- function si(e) {
1012
- let t = S(e?.customFonts ?? []), n = S(!1), r = oi(e?.builtIns), i = j(() => e?.defaultFallback ?? ai), a = j(() => {
1013
- let e = [...r], n = t.value.map((e) => ({
1014
- value: e.name,
1015
- label: e.name,
1016
- isCustom: !0
1017
- })), i = [...e, ...n];
1018
- return i.sort((e, t) => e.label.localeCompare(t.label)), i;
1019
- });
1020
- function s(e) {
1021
- return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
1022
- }
1023
- let c = e?.defaultFont ?? ai.split(",")[0].trim();
1024
- s(c) || Z.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 (e?.defaultFont && s(e.defaultFont)) {
1027
- let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
1028
- if (t) return t.value;
1029
- }
1030
- return ai;
1031
- }
1032
- let u = j(() => l());
1033
- function d(e) {
1034
- return Ue(e, {
1035
- customFonts: t.value,
1036
- defaultFallback: i.value
1037
- });
1038
- }
1039
- let f = [], p = !1;
1040
- async function m() {
1041
- if (t.value.length === 0) {
1042
- p || (n.value = !0);
1043
- return;
1044
- }
1045
- let e = t.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
- Z.warn(`Failed to load custom font "${e.name}":`, t);
1054
- }
1055
- });
1056
- await Promise.allSettled(e), !p && (n.value = !0);
1057
- }
1058
- function h() {
1059
- for (let e of f) e.remove();
1060
- f.length = 0;
1061
- }
1062
- return o() && g(() => {
1063
- p = !0, h();
1064
- }), {
1065
- fonts: a,
1066
- defaultFont: u,
1067
- defaultFallback: i,
1068
- customFonts: t,
1069
- isLoaded: n,
1070
- loadCustomFonts: m,
1071
- cleanupFontLinks: h,
1072
- resolveFontFamily: d,
1073
- getDefaultFont: l
1074
- };
1075
- }
1076
- // src/utils/mergeTagNodeSpec.ts
1077
- function ci(e, t, n) {
1078
- return He(e, n) ? {
1079
- type: "logicMergeTagNode",
1080
- attrs: {
1081
- value: e,
1082
- keyword: De(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 li(e) {
1094
- return "before" in e && "after" in e;
1095
- }
1096
- function ui(e, t, n) {
1097
- if (!li(t)) {
1098
- e.chain().focus().insertContent(ci(t.value, t.label, n)).run();
1099
- return;
1100
- }
1101
- let r = ci(t.before, t.label, n), i = ci(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 di(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 fi(e) {
1111
- return e.extend({ addAttributes() {
1112
- return {
1113
- ...this.parent?.(),
1114
- color: {
1115
- default: null,
1116
- parseHTML: (e) => di(dn(e.style.color)),
1117
- renderHTML: (e) => {
1118
- let t = di(e.color);
1119
- return t ? { style: `color: ${t}` } : {};
1120
- }
1121
- }
1122
- };
1123
- } });
1124
- }
1125
- // src/composables/useRichTextLinkDialog.ts
1126
- function pi(e, t = je.liquid) {
1127
- let n = S(!1), r = S(""), i = S(""), a = S(null);
1128
- ni(a, n);
1129
- function o() {
1130
- let t = e.value?.getAttributes("link") ?? {};
1131
- r.value = t.href || "", i.value = t.color || "", n.value = !0;
1132
- }
1133
- function s() {
1134
- if (r.value) {
1135
- let t = u(r.value);
1136
- if (t !== null) {
1137
- let n = di(i.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
1138
- n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
1139
- }
1140
- }
1141
- f();
1142
- }
1143
- let c = /^(?:\/|\.{1,2}\/|\?)/;
1144
- function l(e) {
1145
- return RegExp(`^(?:${t.value.source})`).test(e);
1146
- }
1147
- function u(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 (c.test(t)) return t;
1153
- let n = V(t);
1154
- return n ? me.some((e) => e === n) ? t : null : l(t) ? t : `https://${t}`;
1155
- }
1156
- function d() {
1157
- e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), f();
1158
- }
1159
- function f() {
1160
- n.value = !1, r.value = "", i.value = "";
1161
- }
1162
- function p(e) {
1163
- e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" && f();
1164
- }
1165
- return {
1166
- showLinkDialog: n,
1167
- linkUrl: r,
1168
- linkColor: i,
1169
- linkDialogRef: a,
1170
- openLinkDialog: o,
1171
- insertLink: s,
1172
- removeLink: d,
1173
- closeLinkDialog: f,
1174
- handleLinkKeydown: p
1175
- };
1176
- }
1177
- // src/composables/useRichTextEditor.ts
1178
- function mi(e) {
1179
- let t = n(X, null), { mergeTags: r, canRequestMergeTag: i, isRequesting: a, requestMergeTag: o, syntax: s, autocomplete: c } = Rn(), { canInsertLogicTag: l, isRequesting: u, requestLogicTag: d } = zn(), f = n(Bt, null), m = (h(f) ? f.value : f)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", g = Se(s), _ = k(null), v = () => ee(t?.content?.value?.settings ?? { locale: "en" });
1180
- p(v, (e) => {
1181
- let t = _.value?.view.dom;
1182
- t && t.setAttribute("dir", e);
1183
- });
1184
- let { showLinkDialog: y, linkUrl: b, linkColor: x, linkDialogRef: C, openLinkDialog: w, insertLink: T, removeLink: D, closeLinkDialog: O, handleLinkKeydown: A } = pi(_, s), { start: j, stop: M } = ft(() => _.value?.commands.focus("end"), 0, { immediate: !1 }), N = k(null), P = S(!0), F = S(null), I = !1, L = null;
1185
- async function R() {
1186
- F.value = null, P.value = !0;
1187
- try {
1188
- let { TiptapEditor: n, EC: i, extensions: a } = await e.loadExtensions({
1189
- mergeTags: r,
1190
- syntax: s,
1191
- triggerChar: g,
1192
- autocompleteEnabled: c,
1193
- suggestionEmptyText: m
1194
- });
1195
- if (I) return;
1196
- N.value = i;
1197
- let o = /* @__PURE__ */ new Map();
1198
- a.forEach((e, t) => o.set(e.name, t));
1199
- let l = new n({
1200
- extensions: a.filter((e, t) => o.get(e.name) === t),
1201
- content: e.blockContent(),
1202
- editable: !0,
1203
- editorProps: { attributes: { dir: v() } },
1204
- onUpdate: ({ editor: n }) => {
1205
- I || t && (L = n.getHTML(), t.updateBlock(e.blockId(), { content: L }));
1206
- }
1207
- });
1208
- if (I) {
1209
- l.destroy();
1210
- return;
1211
- }
1212
- _.value = l, P.value = !1, j();
1213
- } catch (t) {
1214
- if (I) return;
1215
- Z.error(`[${e.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, t), F.value = t instanceof Error ? t.message : "Failed to load editor", P.value = !1;
1216
- }
1217
- }
1218
- function z() {
1219
- _.value?.destroy(), _.value = null, R();
1220
- }
1221
- R();
1222
- let B = p(() => e.blockContent(), (e) => {
1223
- _.value && e !== L && (L = e, _.value.getHTML() !== e && _.value.commands.setContent(e, { emitUpdate: !1 }));
1224
- });
1225
- function V(t) {
1226
- if (a.value || u.value) return;
1227
- let n = t.composedPath(), r = n.find((e) => e instanceof HTMLElement);
1228
- if (!r) return;
1229
- e.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 || e.onDone();
1232
- }
1233
- q(document, "mousedown", V), E(() => {
1234
- I = !0, B(), M(), _.value?.destroy();
1235
- });
1236
- async function H() {
1237
- let e = await o();
1238
- I || (e && _.value ? _.value.chain().focus().insertMergeTag({
1239
- label: e.label,
1240
- value: e.value
1241
- }).run() : _.value?.commands.focus());
1242
- }
1243
- async function U() {
1244
- let e = await d();
1245
- I || (e && _.value ? ui(_.value, e, s) : _.value?.commands.focus());
1246
- }
1247
- return {
1248
- editor: _,
1249
- EditorContent: N,
1250
- isLoading: P,
1251
- initError: F,
1252
- retry: z,
1253
- showLinkDialog: y,
1254
- linkUrl: b,
1255
- linkColor: x,
1256
- linkDialogRef: C,
1257
- mergeTags: r,
1258
- canRequestMergeTag: i,
1259
- isRequestingMergeTag: a,
1260
- syntax: s,
1261
- canInsertLogicTag: l,
1262
- isRequestingLogicTag: u,
1263
- openLinkDialog: w,
1264
- insertLink: T,
1265
- removeLink: D,
1266
- closeLinkDialog: O,
1267
- handleLinkKeydown: A,
1268
- handleAddMergeTag: H,
1269
- handleAddLogicTag: U
1270
- };
1271
- }
1272
- // src/composables/useSmallScreenNotice.ts
1273
- var hi = "(max-width: 767px)";
1274
- function gi(e) {
1275
- let t = gt(hi);
1276
- return {
1277
- isSmallScreen: t,
1278
- showNotice: j(() => (v(e) ?? !0) && t.value)
1279
- };
1280
- }
1281
- // src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
1282
- var _i = { class: "tpl:w-full" }, vi = {
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
- }, yi = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, bi = {
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
- }, xi = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Si = {
1289
- key: 2,
1290
- class: "tpl:relative"
1291
- }, Ci = ["innerHTML"], wi = {
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
- }, Ti = /* @__PURE__ */ t({
1296
- __name: "CustomBlock",
1297
- props: {
1298
- block: {},
1299
- viewport: {}
1300
- },
1301
- emits: ["fetchData"],
1302
- setup(e, { emit: t }) {
1303
- let r = e, i = t, { t: a } = Q(), o = n(an, null), s = S(""), u = j(() => vn(s.value)), d = S(!1), f = j(() => o?.getDefinition(r.block.customType)), m = j(() => !!f.value), h = j(() => r.block), { isFetching: g, fetch: v, needsFetch: b, hasDataSource: x } = Ze({
1304
- definition: f,
1305
- block: h,
1306
- onUpdate: (e, t) => {
1307
- i("fetchData", {
1308
- fieldValues: e,
1309
- dataSourceFetched: t
1310
- });
1311
- }
1312
- }), E = n(Y, wt), k = n(Nt, null), A = j(() => {
1313
- if (!k?.value) return r.block;
1314
- let e = {};
1315
- for (let [t, n] of Object.entries(r.block.fieldValues)) e[t] = typeof n == "string" ? Te(n, E.value) : n;
1316
- return {
1317
- ...r.block,
1318
- fieldValues: e
1319
- };
1320
- });
1321
- async function M() {
1322
- if (o) {
1323
- d.value = !1;
1324
- try {
1325
- let e = await o.renderCustomBlock(A.value);
1326
- e.includes("Template render error:") && (d.value = !0), s.value = e;
1327
- } catch {
1328
- d.value = !0, s.value = "";
1329
- }
1330
- }
1331
- }
1332
- let P = pt(M, 150);
1333
- return c(() => {
1334
- M();
1335
- }), p(() => r.block.fieldValues, () => {
1336
- P();
1337
- }, { deep: !0 }), p(() => k?.value, () => {
1338
- P();
1339
- }), (e, t) => (l(), _("div", _i, [m.value ? d.value ? (l(), _("div", bi, [L(N(En), {
1340
- size: 24,
1341
- class: "tpl:text-[var(--tpl-danger)]"
1342
- }), O("span", xi, C(N(a).customBlocks.renderError), 1)])) : (l(), _("div", Si, [O("div", { innerHTML: u.value }, null, 8, Ci), N(x) && N(b) ? (l(), _("div", wi, [N(g) ? (l(), T(Fn, {
1343
- key: 1,
1344
- class: "tpl:w-48"
1345
- })) : (l(), _("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] ||= D((...e) => N(v) && N(v)(...e), ["stop"])
1350
- }, [f.value?.icon ? (l(), T(ei, {
1351
- key: 0,
1352
- icon: f.value.icon,
1353
- size: 16
1354
- }, null, 8, ["icon"])) : w("", !0), y(" " + C(f.value?.dataSource?.label || N(a).customBlocks.dataSource.fetchButton), 1)]))])) : w("", !0)])) : (l(), _("div", vi, [L(N(Cn), {
1355
- size: 24,
1356
- class: "tpl:text-[var(--tpl-warning)]"
1357
- }), O("span", yi, C(N(a).customBlocks.definitionNotFound), 1)]))]));
1358
- }
1359
- }), Ei = { class: "tpl:w-full" }, Di = /* @__PURE__ */ t({
1360
- __name: "DividerBlock",
1361
- props: {
1362
- block: {},
1363
- viewport: {}
1364
- },
1365
- setup(e) {
1366
- let t = e, n = j(() => ({
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(), _("div", Ei, [O("hr", {
1372
- class: "tpl:m-0 tpl:border-none",
1373
- style: x(n.value)
1374
- }, null, 4)]));
1375
- }
1376
- }), Oi = { class: "tpl:w-full" }, ki = ["srcdoc", "title"], Ai = {
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
- }, ji = {
1380
- key: 0,
1381
- class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
1382
- }, Mi = {
1383
- key: 1,
1384
- class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
1385
- }, Ni = /* @__PURE__ */ t({
1386
- __name: "HtmlBlock",
1387
- props: {
1388
- block: {},
1389
- viewport: {}
1390
- },
1391
- setup(e) {
1392
- let t = e, { t: r } = Q(), i = n(Wt, !1), a = j(() => t.block.content.trim().length > 0), o = j(() => i && a.value), s = n(Y, wt), c = n(Nt, null), u = j(() => c?.value ? Te(t.block.content, s.value) : t.block.content), d = S(null), f = S(60), m = null;
1393
- function h() {
1394
- let e = d.value?.contentDocument;
1395
- e && (f.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
1396
- }
1397
- function g() {
1398
- m?.disconnect(), m = null, h();
1399
- let e = d.value?.contentDocument?.documentElement;
1400
- e && typeof ResizeObserver < "u" && (m = new ResizeObserver(() => h()), m.observe(e));
1401
- }
1402
- return p(o, (e) => {
1403
- e || (m?.disconnect(), m = null);
1404
- }), E(() => {
1405
- m?.disconnect(), m = null;
1406
- }), (e, t) => (l(), _("div", Oi, [o.value ? (l(), _("iframe", {
1407
- key: 0,
1408
- ref_key: "iframeRef",
1409
- ref: d,
1410
- srcdoc: u.value,
1411
- sandbox: "allow-same-origin",
1412
- title: N(r).html.preview,
1413
- class: "tpl:block tpl:w-full tpl:border-0",
1414
- style: x({ height: `${f.value}px` }),
1415
- onLoad: g
1416
- }, null, 44, ki)) : (l(), _("div", Ai, [L(N(On), {
1417
- size: 24,
1418
- class: "tpl:text-[var(--tpl-text-dim)]"
1419
- }), a.value ? (l(), _("span", ji, C(N(r).html.preview), 1)) : (l(), _("span", Mi, C(N(r).html.empty), 1))]))]));
1420
- }
1421
- }), Pi = ["data-drop-enabled"], Fi = ["href"], Ii = ["src", "alt"], Li = ["src", "alt"], Ri = {
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
- }, zi = ["href"], Bi = ["src", "alt"], Vi = ["src", "alt"], Hi = {
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
- }, Ui = ["aria-label"], Wi = { key: 1 }, Gi = /* @__PURE__ */ t({
1428
- __name: "ImageBlock",
1429
- props: {
1430
- block: {},
1431
- viewport: {}
1432
- },
1433
- emits: ["update"],
1434
- setup(e, { emit: t }) {
1435
- let n = e, r = t, { t: i } = Q(), { syntax: a } = Rn(), o = j(() => Re(n.block.src, a));
1436
- function s(e) {
1437
- let t = {
1438
- src: e.url,
1439
- ...st(at(e.width, e.height))
1440
- };
1441
- e.alt && (t.alt = e.alt), r("update", t);
1442
- }
1443
- let c = S(), { canBrowse: u, dropEnabled: d, isUploading: f, showOverlay: p, openMediaBrowser: m } = ot({
1444
- target: c,
1445
- blocked: o,
1446
- apply: s
1447
- }), h = j(() => ({ textAlign: n.block.align })), g = j(() => {
1448
- let e = n.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
- }), v = j(() => {
1451
- let e = n.block.align;
1452
- return {
1453
- maxWidth: "100%",
1454
- width: n.block.width === "full" ? g.value : `${n.block.width}px`,
1455
- height: n.block.height ? `${n.block.height}px` : void 0,
1456
- borderRadius: W(n.block.borderRadius) ?? void 0,
1457
- ...Gr(n.block.border),
1458
- display: "block",
1459
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
1460
- marginRight: e === "center" ? "auto" : void 0
1461
- };
1462
- }), b = dt(() => o.value ? void 0 : n.block.src), E = dt(() => o.value ? n.block.placeholderUrl : void 0);
1463
- return (t, n) => (l(), _("div", {
1464
- ref_key: "dropZoneRef",
1465
- ref: c,
1466
- "data-testid": "image-drop-zone",
1467
- "data-drop-enabled": N(d),
1468
- class: "tpl:relative tpl:w-full",
1469
- style: x(h.value)
1470
- }, [N(p) ? (l(), T(it, {
1471
- key: 0,
1472
- uploading: N(f),
1473
- size: "canvas"
1474
- }, null, 8, ["uploading"])) : w("", !0), e.block.src && o.value && e.block.placeholderUrl ? (l(), _(F, { key: 1 }, [e.block.linkUrl ? (l(), _("a", {
1475
- key: 0,
1476
- href: e.block.linkUrl,
1477
- target: "_blank",
1478
- rel: "noopener noreferrer",
1479
- onClick: n[0] ||= D(() => {}, ["prevent"])
1480
- }, [O("img", {
1481
- class: "tpl:border-0",
1482
- loading: "lazy",
1483
- src: N(E),
1484
- alt: e.block.alt || N(i).image.altTextPlaceholder,
1485
- style: x(v.value)
1486
- }, null, 12, Ii)], 8, Fi)) : (l(), _("img", {
1487
- key: 1,
1488
- class: "tpl:border-0",
1489
- src: N(E),
1490
- alt: e.block.alt,
1491
- style: x(v.value)
1492
- }, null, 12, Li))], 64)) : e.block.src && o.value ? (l(), _("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: x([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, v.value])
1496
- }, [L(N(Tn), {
1497
- size: 32,
1498
- "stroke-width": 1.5,
1499
- class: "tpl:text-[var(--tpl-primary)]",
1500
- style: { opacity: "0.5" }
1501
- }), O("span", Ri, [L(Yr, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (l(), _(F, { key: 3 }, [e.block.linkUrl ? (l(), _("a", {
1502
- key: 0,
1503
- href: e.block.linkUrl,
1504
- target: "_blank",
1505
- rel: "noopener noreferrer",
1506
- onClick: n[1] ||= D(() => {}, ["prevent"])
1507
- }, [O("img", {
1508
- class: "tpl:border-0",
1509
- loading: "lazy",
1510
- src: N(b),
1511
- alt: e.block.alt || N(i).image.altTextPlaceholder,
1512
- style: x(v.value)
1513
- }, null, 12, Bi)], 8, zi)) : (l(), _("img", {
1514
- key: 1,
1515
- class: "tpl:border-0",
1516
- src: N(b),
1517
- alt: e.block.alt,
1518
- style: x(v.value)
1519
- }, null, 12, Vi))], 64)) : (l(), _("div", Hi, [N(u) ? (l(), _("button", {
1520
- key: 0,
1521
- "aria-label": N(i).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] ||= D((...e) => N(m) && N(m)(...e), ["stop"])
1524
- }, [L(N(Tn), {
1525
- size: 14,
1526
- "stroke-width": 1.5
1527
- }), y(" " + C(N(i).image.browseMedia), 1)], 8, Ui)) : (l(), _("span", Wi, C(N(i).image.clickToAdd), 1))]))], 12, Pi));
1528
- }
1529
- }), Ki = { class: "tpl:w-full" }, qi = ["href"], Ji = {
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
- }, Yi = /* @__PURE__ */ t({
1533
- __name: "MenuBlock",
1534
- props: {
1535
- block: {},
1536
- viewport: {}
1537
- },
1538
- setup(e) {
1539
- let t = e, { t: n } = Q(), r = J(on, "MenuBlock"), i = j(() => ({
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 = j(() => t.block.items.length > 0);
1548
- function s(e) {
1549
- return e || t.block.linkColor || t.block.color;
1550
- }
1551
- return (t, r) => (l(), _("div", Ki, [o.value ? (l(), _("div", {
1552
- key: 0,
1553
- style: x(i.value)
1554
- }, [(l(!0), _(F, null, a(e.block.items, (t, n) => (l(), _(F, { key: t.id }, [O("a", {
1555
- href: t.url || "#",
1556
- class: "tpl:cursor-default tpl:no-underline",
1557
- style: x({
1558
- color: s(t.color),
1559
- fontWeight: t.bold ? "bold" : "normal",
1560
- textDecoration: t.underline ? "underline" : "none"
1561
- }),
1562
- onClick: r[0] ||= D(() => {}, ["prevent"])
1563
- }, [L(Yr, { text: t.text || "..." }, null, 8, ["text"])], 12, qi), n < e.block.items.length - 1 ? (l(), _("span", {
1564
- key: 0,
1565
- style: x({
1566
- color: e.block.separatorColor,
1567
- padding: `0 ${e.block.spacing}px`
1568
- })
1569
- }, C(e.block.separator), 5)) : w("", !0)], 64))), 128))], 4)) : (l(), _("div", Ji, [L(N(wn), { size: 16 }), O("span", null, C(N(n).menu.addLinks), 1)]))]));
1570
- }
1571
- });
1572
- // src/composables/useEditableTextBlock.ts
1573
- function Xi(e) {
1574
- let t = n(Y, wt), r = n(Nt, null), { syntax: i } = Rn(), a = j(() => r?.value ? Ee(e(), t.value) : Fe(e(), t.value)), o = j(() => xe(vn(we(a.value, i)))), s = S(!1), c = S(null), { top: l, left: u } = _t(c), { toLocal: d } = mn(), f = j(() => d({
1575
- top: l.value - 8,
1576
- left: u.value
1577
- }));
1578
- function p() {
1579
- s.value = !0;
1580
- }
1581
- function m() {
1582
- s.value = !1;
1583
- }
1584
- return {
1585
- isEditing: s,
1586
- blockRef: c,
1587
- toolbarPosition: f,
1588
- resolvedContent: o,
1589
- handleDoubleClick: p,
1590
- handleEditorDone: m
1591
- };
1592
- }
1593
- // src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
1594
- var Zi = ["innerHTML"], Qi = /* @__PURE__ */ t({
1595
- __name: "ParagraphBlock",
1596
- props: {
1597
- block: {},
1598
- viewport: {}
1599
- },
1600
- setup(e) {
1601
- let t = e, n = u(() => import("./ParagraphEditor-B3Rj_cWF.js").then((e) => e.t)), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: s, handleEditorDone: c } = Xi(() => t.block.content);
1602
- return (t, u) => (l(), _("div", {
1603
- ref_key: "blockRef",
1604
- ref: i,
1605
- class: "tpl:min-h-[1em] tpl:w-full",
1606
- onDblclick: u[0] ||= (...e) => N(s) && N(s)(...e)
1607
- }, [N(r) ? (l(), T(N(n), {
1608
- key: 0,
1609
- block: e.block,
1610
- "toolbar-position": N(a),
1611
- onDone: N(c)
1612
- }, null, 8, [
1613
- "block",
1614
- "toolbar-position",
1615
- "onDone"
1616
- ])) : (l(), _("div", {
1617
- key: 1,
1618
- class: "tpl-text-content tpl:outline-none",
1619
- innerHTML: N(o)
1620
- }, null, 8, Zi))], 544));
1621
- }
1622
- }), $i = [
1623
- "data-block-id",
1624
- "data-block-type",
1625
- "data-tpl-picked"
1626
- ], ea = ["aria-label"], ta = ["data-lock-holder"], na = ["aria-label"], ra = [
1627
- "aria-label",
1628
- "aria-pressed",
1629
- "title"
1630
- ], ia = ["aria-label", "title"], aa = ["aria-label", "title"], oa = ["aria-label", "title"], sa = {
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
- }, ca = { 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)]" }, la = {
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
- }, ua = ["aria-label", "title"], da = /*#__PURE__*/ In(/* @__PURE__ */ t({
1637
- __name: "BlockWrapper",
1638
- props: {
1639
- block: {},
1640
- isSelected: { type: Boolean },
1641
- viewport: {},
1642
- previewMode: { type: Boolean },
1643
- nested: { type: Boolean },
1644
- picked: { type: Boolean }
1645
- },
1646
- emits: ["select"],
1647
- setup(t, { emit: r }) {
1648
- let i = u(() => import("./BlockIssueBadge-jdf91-nk.js")), a = t, o = r, { t: c, format: d } = Q(), p = n(Ft, null), m = S(null), h = j(() => p?.liftedBlockId.value === a.block.id), g = j(() => h.value ? d(c.blockActions.dragLifted, { block: a.block.type }) : c.blockActions.drag);
1649
- async function v() {
1650
- await e(), m.value?.focus();
1651
- }
1652
- function b(e) {
1653
- p && (e.key === " " || e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), h.value ? p.drop(a.block.id) : p.lift(a.block.id)) : h.value && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), p.cancel(), v()) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), p.moveUp(a.block.id), v()) : e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), p.moveDown(a.block.id), v())));
1654
- }
1655
- let T = j(() => !a.viewport || !a.block.visibility ? !1 : a.block.visibility[a.viewport] === !1), E = j(() => a.previewMode === !0 && T.value), k = j(() => a.viewport ? {
1656
- desktop: c.viewport.desktop,
1657
- mobile: c.viewport.mobile
1658
- }[a.viewport] ?? a.viewport : ""), A = j(() => !!a.block.displayCondition), M = n(Ut, null), P = n(qt, null), F = n(Zt, {}), R = j(() => F.savedBlocks?.isPicking.value === !0), ee = j(() => !a.nested && F.savedBlocks?.isAvailable.value === !0 && F.savedBlocks?.canCreate.value === !0), z = j(() => a.isSelected && !R.value), B = j(() => F.comments?.getBlockCount(a.block.id) ?? 0), V = S(null), H = S(null), U = S(null), te = S(null), ne = S({
1659
- left: "calc(100% + 8px)",
1660
- top: "50%"
1661
- }), re = S(!1), ie = j(() => H.value ?? te.value), ae = j(() => ie.value?.closest(".tpl-body"));
1662
- function W() {
1663
- let t = re.value, n = H.value, r = te.value, i = V.value;
1664
- if (!n && !r || !i?.offsetWidth) return;
1665
- let a = i.getBoundingClientRect(), o = a.width / i.offsetWidth || 1, s = ae.value, c = s ? (s.getBoundingClientRect().left - a.left) / o + s.clientLeft : -Infinity, l = s ? c + s.clientWidth : Infinity;
1666
- if (r?.offsetWidth) {
1667
- let n = i.offsetWidth + 4 + r.offsetWidth + 4 <= l;
1668
- if (t === n) {
1669
- re.value = !n, e(W);
1670
- return;
1671
- }
1672
- }
1673
- if (!n?.offsetWidth) return;
1674
- let u = Math.max(c + 4, Math.min(i.offsetWidth + 8, l - n.offsetWidth - 4)), d = U.value, f = Math.max(28, d?.offsetHeight ? d.offsetTop + d.offsetHeight + 4 : 0), p = Math.max(f + n.offsetHeight / 2, i.offsetHeight / 2), m = u < i.offsetWidth && p + n.offsetHeight / 2 <= i.offsetHeight + 8 ? `${p}px` : "50%";
1675
- if (u >= i.offsetWidth && r?.offsetWidth && !t) {
1676
- let e = (r.getBoundingClientRect().bottom - a.top) / o + 4 + n.offsetHeight / 2;
1677
- e > i.offsetHeight / 2 && (m = `${e}px`);
1678
- }
1679
- if (u < i.offsetWidth && m === "50%") {
1680
- let e = d?.getBoundingClientRect();
1681
- if (e?.width) {
1682
- let t = (e.left - a.left) / o - n.offsetWidth - 8;
1683
- u = Math.max(c + 4, Math.min(t, l - n.offsetWidth - 4));
1684
- }
1685
- }
1686
- (ne.value.left !== `${u}px` || ne.value.top !== m) && (ne.value = {
1687
- left: `${u}px`,
1688
- top: m
1689
- });
1690
- }
1691
- f(W), vt(j(() => ie.value ? [
1692
- V.value,
1693
- H.value,
1694
- U.value,
1695
- te.value,
1696
- ae.value
1697
- ].filter((e) => !!e) : []), W), q(ae, "scroll", W, { passive: !0 });
1698
- let G = j(() => F.collaboration?.lockOf(a.block.id) ?? null), oe = j(() => G.value?.holder.type === "guest" ? c.collaboration.guest : G.value?.holder.name ?? ""), se = j(() => F.collaboration?.agentHighlightOf(a.block.id) ?? F.ai?.highlightOf(a.block.id) ?? null), ce = qe(() => a.block.type === "section" ? a.block.backgroundImage : void 0), le = qe(() => a.block.type === "section" ? a.block.wrapper?.backgroundImage : void 0), ue = n(X, null), de = n(xt, void 0), K = j(() => Ur(a.block, {
1699
- backgroundImageUrl: ce.value,
1700
- heroBoxWidth: nt(a.block, ue?.content.value, de)
1701
- })), fe = j(() => Kr(a.block, { backgroundImageUrl: le.value }));
1702
- function pe(e) {
1703
- a.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
1704
- }
1705
- function me() {
1706
- M?.deleteBlock(a.block.id);
1707
- }
1708
- function he() {
1709
- M?.duplicateBlock(a.block);
1710
- }
1711
- function ge() {
1712
- F.savedBlocks?.startPicking(a.block.id);
1713
- }
1714
- function _e() {
1715
- P?.toggleBlock(a.block.id);
1716
- }
1717
- return (e, n) => E.value ? w("", !0) : (l(), _("div", {
1718
- key: 0,
1719
- ref_key: "blockElement",
1720
- ref: V,
1721
- class: I(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
1722
- "tpl-block--selected": t.isSelected,
1723
- "tpl-block--picked": t.picked,
1724
- "tpl-block--idle": !t.isSelected && !t.picked,
1725
- "tpl-block--lifted": h.value
1726
- }]),
1727
- "data-block-id": t.block.id,
1728
- "data-block-type": t.block.type,
1729
- "data-tpl-picked": t.picked || void 0,
1730
- onClick: pe
1731
- }, [
1732
- O("div", {
1733
- ref_key: "badgesElement",
1734
- ref: U,
1735
- class: "tpl-block-badges tpl:absolute tpl:top-1 tpl:right-1 tpl:z-10 tpl:flex tpl:gap-1"
1736
- }, [B.value > 0 && !T.value ? (l(), _("button", {
1737
- key: 0,
1738
- ref_key: "commentElement",
1739
- ref: te,
1740
- class: I(["tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:shrink-0 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)]", re.value ? void 0 : "tpl:absolute tpl:-top-2 tpl:left-full tpl:ml-2"]),
1741
- "aria-label": N(d)(N(c).blockActions.comments, { count: String(B.value) }),
1742
- onClick: n[0] ||= D((e) => N(F).comments?.openForBlock(t.block.id), ["stop"])
1743
- }, [L(N(jn), {
1744
- size: 12,
1745
- "stroke-width": 2.5
1746
- }), y(" " + C(B.value), 1)], 10, ea)) : w("", !0), L(N(i), { "block-id": t.block.id }, null, 8, ["block-id"])], 512),
1747
- G.value ? (l(), _("div", {
1748
- key: 0,
1749
- "data-testid": "block-lock",
1750
- "data-lock-holder": G.value.holder.sessionId,
1751
- class: "tpl-block-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
1752
- style: x({
1753
- outline: `2px solid ${G.value.holder.color}`,
1754
- outlineOffset: "-1px"
1755
- })
1756
- }, [O("span", {
1757
- 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",
1758
- style: x({
1759
- backgroundColor: G.value.holder.color,
1760
- color: N(Bn)(G.value.holder.color)
1761
- })
1762
- }, C(N(d)(N(c).collaboration.editing, { name: oe.value })), 5)], 12, ta)) : w("", !0),
1763
- se.value === null ? w("", !0) : (l(), _("div", {
1764
- key: se.value,
1765
- "data-testid": "block-agent-highlight",
1766
- "aria-hidden": "true",
1767
- class: "tpl-block-agent-highlight tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm"
1768
- })),
1769
- z.value ? (l(), _("div", {
1770
- key: 2,
1771
- ref_key: "actionsElement",
1772
- ref: H,
1773
- style: x(ne.value),
1774
- role: "toolbar",
1775
- "aria-label": N(c).blockActions.drag,
1776
- class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:top-1/2 tpl:z-20 tpl:flex tpl:-translate-y-1/2 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)]"
1777
- }, [
1778
- O("button", {
1779
- ref_key: "dragButtonRef",
1780
- ref: m,
1781
- 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",
1782
- "aria-label": g.value,
1783
- "aria-pressed": h.value,
1784
- "aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
1785
- title: N(c).blockActions.drag,
1786
- onKeydown: b
1787
- }, [L(N(Pn), {
1788
- size: 14,
1789
- "stroke-width": 1.5
1790
- })], 40, ra),
1791
- O("button", {
1792
- 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",
1793
- "aria-label": N(c).blockActions.duplicate,
1794
- title: N(c).blockActions.duplicate,
1795
- onClick: D(he, ["stop"])
1796
- }, [L(N(An), {
1797
- size: 14,
1798
- "stroke-width": 1.5
1799
- })], 8, ia),
1800
- ee.value ? (l(), _("button", {
1801
- key: 0,
1802
- 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",
1803
- "aria-label": N(c).blockActions.saveAsBlock,
1804
- title: N(c).blockActions.saveAsBlock,
1805
- onClick: D(ge, ["stop"])
1806
- }, [L(N(Sn), {
1807
- size: 14,
1808
- "stroke-width": 1.5
1809
- })], 8, aa)) : w("", !0),
1810
- O("button", {
1811
- 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",
1812
- "aria-label": N(c).blockActions.delete,
1813
- title: N(c).blockActions.delete,
1814
- onClick: D(me, ["stop"])
1815
- }, [L(N(Dn), {
1816
- size: 14,
1817
- "stroke-width": 1.5
1818
- })], 8, oa)
1819
- ], 12, na)) : w("", !0),
1820
- T.value ? (l(), _("div", sa, [O("span", ca, [L(N(bn), {
1821
- size: 12,
1822
- "stroke-width": 1.5
1823
- }), y(" " + C(N(d)(N(c).blockActions.hiddenOnViewport, { viewport: k.value })), 1)])])) : w("", !0),
1824
- A.value && !T.value ? (l(), _("div", la, [O("button", {
1825
- "data-testid": "condition-toggle",
1826
- 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)]",
1827
- "aria-label": N(c).blockActions.conditionToggle,
1828
- title: t.block.displayCondition?.label,
1829
- onClick: D(_e, ["stop"])
1830
- }, [L(N(xn), {
1831
- size: 12,
1832
- "stroke-width": 2
1833
- })], 8, ua)])) : w("", !0),
1834
- fe.value ? (l(), _("div", {
1835
- key: 5,
1836
- class: I(["tpl-section-wrapper tpl-email-surface", N(zr)(fe.value)]),
1837
- style: x(fe.value)
1838
- }, [O("div", {
1839
- class: I(["tpl-block-content tpl-email-surface", N(zr)(K.value)]),
1840
- style: x(K.value)
1841
- }, [s(e.$slots, "default", {}, void 0, !0)], 6)], 6)) : (l(), _("div", {
1842
- key: 6,
1843
- class: I(["tpl-block-content tpl-email-surface", N(zr)(K.value)]),
1844
- style: x(K.value)
1845
- }, [s(e.$slots, "default", {}, void 0, !0)], 6))
1846
- ], 10, $i));
1847
- }
1848
- }), [["__scopeId", "data-v-f3a7bfbf"]]);
1849
- // src/utils/unwrapParagraph.ts
1850
- function fa(e) {
1851
- let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
1852
- return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
1853
- }
1854
- // src/components/blocks/TitleBlock.vue
1855
- var pa = /* @__PURE__ */ t({
1856
- __name: "TitleBlock",
1857
- props: {
1858
- block: {},
1859
- viewport: {}
1860
- },
1861
- setup(e) {
1862
- let t = e, n = u(() => import("./TitleEditor-Cob7RLyK.js")), r = J(on, "TitleBlock"), { isEditing: i, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: d } = Xi(() => t.block.content), f = j(() => {
1863
- let e = {
1864
- fontSize: `${ge[t.block.level]}px`,
1865
- lineHeight: String(ne),
1866
- fontWeight: "700",
1867
- textAlign: t.block.textAlign
1868
- };
1869
- return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = r.resolveFontFamily(t.block.fontFamily)), e;
1870
- }), p = j(() => `h${t.block.level}`), m = j(() => fa(s.value));
1871
- return (t, r) => (l(), _("div", {
1872
- ref_key: "blockRef",
1873
- ref: a,
1874
- class: "tpl:min-h-[1em] tpl:w-full",
1875
- style: x(f.value),
1876
- onDblclick: r[0] ||= (...e) => N(c) && N(c)(...e)
1877
- }, [N(i) ? (l(), T(N(n), {
1878
- key: 0,
1879
- block: e.block,
1880
- "toolbar-position": N(o),
1881
- onDone: N(d)
1882
- }, null, 8, [
1883
- "block",
1884
- "toolbar-position",
1885
- "onDone"
1886
- ])) : (l(), T(R(p.value), {
1887
- key: 1,
1888
- class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-[inherit] tpl:outline-none",
1889
- style: {
1890
- color: "inherit",
1891
- fontWeight: "inherit"
1892
- },
1893
- innerHTML: m.value
1894
- }, null, 8, ["innerHTML"]))], 36));
1895
- }
1896
- }), ma = "hero", ha = "#1f2937", ga = "#ffffff";
1897
- function _a(e, t) {
1898
- let n = K("title", e);
1899
- n.color = ga, n.textAlign = "center";
1900
- let r = K("paragraph", e);
1901
- r.content = `<p style="text-align: center"><span style="color: ${ga}">${va(t)}</span></p>`;
1902
- let i = K("button", e);
1903
- return i.align = "center", he({
1904
- columns: "1",
1905
- children: [[
1906
- n,
1907
- r,
1908
- i
1909
- ]],
1910
- hero: {
1911
- height: "image",
1912
- verticalAlign: "middle"
1913
- },
1914
- styles: {
1915
- padding: {
1916
- top: 48,
1917
- right: 24,
1918
- bottom: 48,
1919
- left: 24
1920
- },
1921
- backgroundColor: ha
1922
- }
1923
- });
1924
- }
1925
- function va(e) {
1926
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1927
- }
1928
- // src/utils/sectionColumnDrop.ts
1929
- var ya = /* @__PURE__ */ new Set(["section", ma]);
1930
- function ba(e) {
1931
- return e.dataset.blockType !== "section" && !ya.has(e.dataset.paletteType ?? "");
1932
- }
1933
- // src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
1934
- var xa = { class: "tpl:relative tpl:w-full" }, Sa = {
1935
- key: 0,
1936
- "data-testid": "hero-image-hint",
1937
- 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)]"
1938
- }, Ca = {
1939
- key: 0,
1940
- "data-testid": "section-drop-hint",
1941
- 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)]"
1942
- }, wa = /* @__PURE__ */ t({
1943
- __name: "SectionBlock",
1944
- props: {
1945
- block: {},
1946
- viewport: {}
1947
- },
1948
- setup(e) {
1949
- let t = {
1950
- title: pa,
1951
- paragraph: Qi,
1952
- image: Gi,
1953
- button: Zr,
1954
- divider: Di,
1955
- custom: Ti
1956
- }, r = e, { t: o } = Q(), s = J(X, "SectionBlock"), c = n(qt, null), u = n(an, null), d = n(Zt, {}), f = n(rn, null);
1957
- function p(e) {
1958
- let t = d.savedBlocks;
1959
- t?.isPicking.value ? t.togglePick(r.block.id) : s.selectBlock(e);
1960
- }
1961
- let h = j(() => {
1962
- switch (r.block.columns) {
1963
- case "2": return ["50%", "50%"];
1964
- case "3": return [
1965
- "33.33%",
1966
- "33.33%",
1967
- "33.33%"
1968
- ];
1969
- case "1-2": return ["33.33%", "66.67%"];
1970
- case "2-1": return ["66.67%", "33.33%"];
1971
- default: return ["100%"];
1972
- }
1973
- }), g = j(() => {
1974
- let e = h.value.length, t = [...r.block.children];
1975
- for (; t.length < e;) t.push([]);
1976
- return t.slice(0, e);
1977
- }), v = j(() => r.viewport === "mobile" && r.block.stackOnMobile !== !1);
1978
- function y(e) {
1979
- return g.value[e] || [];
1980
- }
1981
- function b(e) {
1982
- return f?.value === !1 || !c?.isHidden(e);
1983
- }
1984
- function E(e) {
1985
- return !y(e).some((e) => b(e.id));
1986
- }
1987
- let D = S(null);
1988
- function k(e) {
1989
- return s.state.previewMode ? !1 : E(e) ? !0 : D.value === e && y(e).filter((e) => b(e.id)).length <= 1;
1990
- }
1991
- let A = j(() => {
1992
- if (s.state.previewMode) return !1;
1993
- let e = U(r.block);
1994
- return e !== null && !e.applied && e.reason === "image";
1995
- });
1996
- function ee(e) {
1997
- return y(e).length === 0 && !s.state.previewMode;
1998
- }
1999
- function z(e) {
2000
- return y(e).length === 0 && s.state.previewMode;
2001
- }
2002
- function B(e, t) {
2003
- let n = t.map((e) => JSON.parse(JSON.stringify(e))), i = [...r.block.children];
2004
- for (; i.length <= e;) i.push([]);
2005
- i[e] = n, s.updateBlock(r.block.id, { children: i });
2006
- }
2007
- function V(e) {
2008
- return Fr(e, u, t);
2009
- }
2010
- function H(e, t) {
2011
- e.type === "custom" && s.updateBlock(e.id, {
2012
- fieldValues: t.fieldValues,
2013
- dataSourceFetched: t.dataSourceFetched
2014
- });
2015
- }
2016
- return (t, n) => (l(), _("div", xa, [A.value ? (l(), _("div", Sa, [O("span", null, C(N(o).section.heroAddImage), 1)])) : w("", !0), O("div", { class: I(["tpl:flex tpl:gap-0", { "tpl:flex-col": v.value }]) }, [(l(!0), _(F, null, a(g.value, (t, r) => (l(), _("div", {
2017
- key: r,
2018
- class: I(["tpl:relative tpl:flex tpl:flex-col tpl:rounded", ee(r) ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
2019
- style: x({ width: v.value ? "100%" : h.value[r] })
2020
- }, [L(N(P), {
2021
- "model-value": y(r),
2022
- group: {
2023
- name: "blocks",
2024
- pull: !0,
2025
- put: (e, t, n) => N(ba)(n)
2026
- },
2027
- animation: 150,
2028
- "ghost-class": "tpl-ghost",
2029
- "drag-class": "tpl-dragging",
2030
- handle: ".tpl-block-btn",
2031
- "invert-swap": !0,
2032
- "inverted-swap-threshold": .65,
2033
- "empty-insert-threshold": 20,
2034
- "force-fallback": !0,
2035
- class: I(["tpl:grow", {
2036
- "tpl:min-h-[60px]": k(r),
2037
- "tpl:min-h-[34px]": z(r)
2038
- }]),
2039
- onStart: (e) => D.value = r,
2040
- onEnd: n[0] ||= (e) => D.value = null,
2041
- "onUpdate:modelValue": (e) => B(r, e)
2042
- }, {
2043
- default: m(() => [(l(!0), _(F, null, a(y(r), (t) => i((l(), _("div", { key: t.id }, [L(da, {
2044
- block: t,
2045
- "is-selected": N(s).state.selectedBlockId === t.id,
2046
- viewport: e.viewport,
2047
- "preview-mode": N(s).state.previewMode,
2048
- nested: "",
2049
- onSelect: (e) => p(t.id)
2050
- }, {
2051
- default: m(() => [(l(), T(R(V(t)), {
2052
- block: t,
2053
- viewport: e.viewport,
2054
- onFetchData: (e) => H(t, e),
2055
- onUpdate: (e) => N(s).updateBlock(t.id, e)
2056
- }, null, 40, [
2057
- "block",
2058
- "viewport",
2059
- "onFetchData",
2060
- "onUpdate"
2061
- ]))]),
2062
- _: 2
2063
- }, 1032, [
2064
- "block",
2065
- "is-selected",
2066
- "viewport",
2067
- "preview-mode",
2068
- "onSelect"
2069
- ])])), [[M, b(t.id)]])), 128))]),
2070
- _: 2
2071
- }, 1032, [
2072
- "model-value",
2073
- "group",
2074
- "class",
2075
- "onStart",
2076
- "onUpdate:modelValue"
2077
- ]), ee(r) ? (l(), _("div", Ca, [O("span", null, C(N(o).section.dropHere), 1)])) : w("", !0)], 6))), 128))], 2)]));
2078
- }
2079
- }), Ta = ["width", "height"], Ea = [
2080
- "d",
2081
- "stroke",
2082
- "stroke-opacity",
2083
- "stroke-width"
2084
- ], Da = ["d", "fill"], Oa = /* @__PURE__ */ t({
2085
- __name: "SocialIconSvg",
2086
- props: {
2087
- platform: {},
2088
- iconStyle: {},
2089
- iconTone: {},
2090
- iconSize: {}
2091
- },
2092
- setup(e) {
2093
- let t = e, n = j(() => ct[t.platform]), r = j(() => lt[t.iconSize]), i = j(() => Oe(t.platform, t.iconTone)), a = j(() => le(t.iconStyle, t.iconTone)), o = j(() => {
2094
- let e = {
2095
- display: "inline-flex",
2096
- alignItems: "center",
2097
- justifyContent: "center",
2098
- width: `${r.value}px`,
2099
- height: `${r.value}px`
2100
- }, n = i.value.fill;
2101
- switch (t.iconStyle) {
2102
- case "solid": return {
2103
- ...e,
2104
- backgroundColor: n,
2105
- borderRadius: "4px"
2106
- };
2107
- case "outlined": return {
2108
- ...e,
2109
- backgroundColor: "transparent",
2110
- border: `2px solid ${n}`,
2111
- borderRadius: "4px",
2112
- ...a.value && { boxShadow: u(a.value) }
2113
- };
2114
- case "rounded": return {
2115
- ...e,
2116
- backgroundColor: n,
2117
- borderRadius: "8px"
2118
- };
2119
- case "square": return {
2120
- ...e,
2121
- backgroundColor: n,
2122
- borderRadius: "0"
2123
- };
2124
- case "circle": return {
2125
- ...e,
2126
- backgroundColor: n,
2127
- borderRadius: "50%"
2128
- };
2129
- default: return e;
2130
- }
2131
- }), s = j(() => ce(t.iconStyle)), c = j(() => Math.floor(r.value * s.value));
2132
- function u(e) {
2133
- let t = `${e.width / 2 * r.value / 24}px`, n = Math.round(e.opacity * 255).toString(16).padStart(2, "0"), i = `${e.color}${n}`;
2134
- return `0 0 0 ${t} ${i}, inset 0 0 0 ${t} ${i}`;
2135
- }
2136
- let d = j(() => t.iconStyle === "outlined" || t.iconStyle === "plain" ? i.value.fill : i.value.onFill);
2137
- return (e, t) => (l(), _("span", { style: x(o.value) }, [(l(), _("svg", {
2138
- width: c.value,
2139
- height: c.value,
2140
- viewBox: "0 0 24 24",
2141
- overflow: "visible",
2142
- xmlns: "http://www.w3.org/2000/svg"
2143
- }, [a.value ? (l(), _("path", {
2144
- key: 0,
2145
- "data-testid": "social-icon-halo",
2146
- d: n.value.path,
2147
- fill: "none",
2148
- stroke: a.value.color,
2149
- "stroke-opacity": a.value.opacity,
2150
- "stroke-width": a.value.width / s.value,
2151
- "stroke-linejoin": "round"
2152
- }, null, 8, Ea)) : w("", !0), O("path", {
2153
- d: n.value.path,
2154
- fill: d.value
2155
- }, null, 8, Da)], 8, Ta))], 4));
2156
- }
2157
- }), ka = { class: "tpl:w-full" }, Aa = ["href"], ja = {
2158
- key: 1,
2159
- 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)]"
2160
- }, Ma = /* @__PURE__ */ t({
2161
- __name: "SocialIconsBlock",
2162
- props: {
2163
- block: {},
2164
- viewport: {}
2165
- },
2166
- setup(e) {
2167
- let t = e, { t: n } = Q(), r = j(() => ({
2168
- display: "flex",
2169
- flexWrap: "wrap",
2170
- gap: `${t.block.spacing}px`,
2171
- justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
2172
- })), i = j(() => t.block.icons.length > 0);
2173
- return (t, o) => (l(), _("div", ka, [i.value ? (l(), _("div", {
2174
- key: 0,
2175
- style: x(r.value)
2176
- }, [(l(!0), _(F, null, a(e.block.icons, (t) => (l(), _("a", {
2177
- key: t.id,
2178
- href: t.url || "#",
2179
- class: "tpl:cursor-default",
2180
- onClick: o[0] ||= D(() => {}, ["prevent"])
2181
- }, [L(Oa, {
2182
- platform: t.platform,
2183
- "icon-style": e.block.iconStyle,
2184
- "icon-tone": e.block.iconTone,
2185
- "icon-size": e.block.iconSize
2186
- }, null, 8, [
2187
- "platform",
2188
- "icon-style",
2189
- "icon-tone",
2190
- "icon-size"
2191
- ])], 8, Aa))), 128))], 4)) : (l(), _("div", ja, [L(N(kn), { size: 16 }), O("span", null, C(N(n).social.addIcons), 1)]))]));
2192
- }
2193
- }), Na = { class: "tpl:w-full" }, Pa = {
2194
- key: 0,
2195
- class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
2196
- style: {
2197
- "background-color": "var(--tpl-bg-hover)",
2198
- color: "var(--tpl-text-dim)"
2199
- }
2200
- }, Fa = /* @__PURE__ */ t({
2201
- __name: "SpacerBlock",
2202
- props: {
2203
- block: {},
2204
- viewport: {}
2205
- },
2206
- setup(e) {
2207
- let t = e, n = J(X, "SpacerBlock"), r = j(() => ({
2208
- height: `${t.block.height}px`,
2209
- minHeight: `${t.block.height}px`,
2210
- ...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
2211
- }));
2212
- return (t, i) => (l(), _("div", Na, [O("div", {
2213
- style: x(r.value),
2214
- class: I(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:box-border tpl:border-y tpl:border-x-0 tpl:border-dashed": !N(n).state.previewMode }])
2215
- }, [N(n).state.previewMode ? w("", !0) : (l(), _("span", Pa, C(e.block.height) + "px ", 1))], 6)]));
2216
- }
2217
- }), Ia = { class: "tpl:w-full" }, La = { key: 0 }, Ra = [
2218
- "aria-label",
2219
- "data-placeholder",
2220
- "onBlur"
2221
- ], za = [
2222
- "aria-label",
2223
- "data-placeholder",
2224
- "onBlur"
2225
- ], Ba = {
2226
- key: 1,
2227
- 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)]"
2228
- }, Va = /*#__PURE__*/ In(/* @__PURE__ */ t({
2229
- __name: "TableBlock",
2230
- props: {
2231
- block: {},
2232
- viewport: {}
2233
- },
2234
- setup(e) {
2235
- let t = {
2236
- mounted(e, t) {
2237
- e.textContent = t.value ?? "";
2238
- },
2239
- updated(e, t) {
2240
- t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
2241
- }
2242
- }, n = e, { t: r } = Q(), o = J(X, "TableBlock"), s = J(on, "TableBlock"), c = j(() => n.block.rows.length > 0), u = j(() => {
2243
- let e = {
2244
- width: "100%",
2245
- borderCollapse: "collapse",
2246
- fontSize: `${n.block.fontSize}px`,
2247
- textAlign: n.block.textAlign,
2248
- fontFamily: n.block.fontFamily ? s.resolveFontFamily(n.block.fontFamily) : "inherit"
2249
- };
2250
- return n.block.color && (e.color = n.block.color), e;
2251
- }), d = j(() => ({
2252
- border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
2253
- padding: `${n.block.cellPadding}px`,
2254
- textAlign: n.block.textAlign
2255
- })), f = j(() => ({
2256
- ...d.value,
2257
- fontWeight: "bold",
2258
- backgroundColor: n.block.headerBackgroundColor || "transparent"
2259
- })), p = j(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), m = j(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
2260
- function h() {
2261
- o.selectBlock(n.block.id);
2262
- }
2263
- function g(e, t, r) {
2264
- let i = r.target.innerText.trim(), a = n.block.rows.map((n) => n.id === e ? {
2265
- ...n,
2266
- cells: n.cells.map((e) => e.id === t ? {
2267
- ...e,
2268
- content: i
2269
- } : e)
2270
- } : n);
2271
- o.updateBlock(n.block.id, { rows: a });
2272
- }
2273
- return (e, n) => (l(), _("div", Ia, [c.value ? (l(), _("table", {
2274
- key: 0,
2275
- style: x(u.value),
2276
- class: "tpl-table-editable"
2277
- }, [p.value ? (l(), _("thead", La, [O("tr", null, [(l(!0), _(F, null, a(p.value.cells, (e) => i((l(), _("th", {
2278
- key: e.id,
2279
- style: x(f.value),
2280
- "aria-label": N(r).table.cellPlaceholder,
2281
- contenteditable: "true",
2282
- "data-placeholder": N(r).table.cellPlaceholder,
2283
- onBlur: (t) => g(p.value.id, e.id, t),
2284
- onKeydown: n[0] ||= b(D((e) => e.target.blur(), ["prevent"]), ["enter"]),
2285
- onClick: D(h, ["stop"])
2286
- }, null, 44, Ra)), [[t, e.content]])), 128))])])) : w("", !0), O("tbody", null, [(l(!0), _(F, null, a(m.value, (e) => (l(), _("tr", { key: e.id }, [(l(!0), _(F, null, a(e.cells, (a) => i((l(), _("td", {
2287
- key: a.id,
2288
- style: x(d.value),
2289
- "aria-label": N(r).table.cellPlaceholder,
2290
- contenteditable: "true",
2291
- "data-placeholder": N(r).table.cellPlaceholder,
2292
- onBlur: (t) => g(e.id, a.id, t),
2293
- onKeydown: n[1] ||= b(D((e) => e.target.blur(), ["prevent"]), ["enter"]),
2294
- onClick: D(h, ["stop"])
2295
- }, null, 44, za)), [[t, a.content]])), 128))]))), 128))])], 4)) : (l(), _("div", Ba, [L(N(Nn), { size: 16 }), O("span", null, C(N(r).table.empty), 1)]))]));
2296
- }
2297
- }), [["__scopeId", "data-v-6751d456"]]), Ha = /* @__PURE__ */ t({
2298
- __name: "VideoPlayButton",
2299
- props: { hoverEffect: {
2300
- type: Boolean,
2301
- default: !1
2302
- } },
2303
- setup(e) {
2304
- return (t, n) => (l(), _("div", { class: I(["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] ||= [O("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)]" }, [O("svg", {
2305
- class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
2306
- width: "28",
2307
- height: "28",
2308
- viewBox: "0 0 24 24",
2309
- fill: "currentColor"
2310
- }, [O("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
2311
- }
2312
- });
2313
- // src/utils/videoThumbnail.ts
2314
- function Ua(e) {
2315
- if (!e) return {
2316
- platform: "unknown",
2317
- videoId: null,
2318
- thumbnailUrl: null
2319
- };
2320
- 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]) {
2321
- let n = e.match(t);
2322
- if (n) {
2323
- let e = n[1];
2324
- return {
2325
- platform: "youtube",
2326
- videoId: e,
2327
- thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
2328
- };
2329
- }
2330
- }
2331
- let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
2332
- if (t) {
2333
- let e = t[1];
2334
- return {
2335
- platform: "vimeo",
2336
- videoId: e,
2337
- thumbnailUrl: `https://vumbnail.com/${e}.jpg`
2338
- };
2339
- }
2340
- return {
2341
- platform: "unknown",
2342
- videoId: null,
2343
- thumbnailUrl: null
2344
- };
2345
- }
2346
- function Wa(e, t) {
2347
- return t || Ua(e).thumbnailUrl;
2348
- }
2349
- // src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
2350
- var Ga = ["src", "alt"], Ka = {
2351
- class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
2352
- style: { opacity: "0.7" }
2353
- }, qa = ["href"], Ja = ["src", "alt"], Ya = ["src", "alt"], Xa = {
2354
- key: 3,
2355
- 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)]"
2356
- }, Za = /* @__PURE__ */ t({
2357
- __name: "VideoBlock",
2358
- props: {
2359
- block: {},
2360
- viewport: {}
2361
- },
2362
- setup(e) {
2363
- let t = e, { t: n } = Q(), { syntax: r } = Rn(), i = j(() => Re(t.block.url, r) || Re(t.block.thumbnailUrl, r)), a = dt(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = dt(() => i.value ? t.block.placeholderUrl : void 0), s = j(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : Wa(t.block.url)), c = j(() => ({ textAlign: t.block.align })), u = j(() => {
2364
- let e = t.block.align;
2365
- return {
2366
- maxWidth: "100%",
2367
- width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
2368
- height: t.block.height ? `${t.block.height}px` : void 0,
2369
- display: "block",
2370
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
2371
- marginRight: e === "center" ? "auto" : void 0
2372
- };
2373
- }), d = j(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = j(() => Re(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
2374
- return (t, r) => (l(), _("div", {
2375
- class: "tpl:w-full",
2376
- style: x(c.value)
2377
- }, [i.value && e.block.placeholderUrl ? (l(), _("div", {
2378
- key: 0,
2379
- class: "tpl:relative tpl:inline-block",
2380
- style: x(u.value)
2381
- }, [O("img", {
2382
- class: "tpl:block tpl:w-full tpl:border-0",
2383
- src: N(o),
2384
- alt: e.block.alt,
2385
- style: x(d.value)
2386
- }, null, 12, Ga), L(Ha)], 4)) : i.value ? (l(), _("div", {
2387
- key: 1,
2388
- 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)]",
2389
- style: x([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
2390
- }, [L(N(Mn), {
2391
- size: 36,
2392
- "stroke-width": 1.5,
2393
- class: "tpl:text-[var(--tpl-primary)]",
2394
- style: { opacity: "0.5" }
2395
- }), O("span", Ka, [L(Yr, { text: f.value }, null, 8, ["text"])])], 4)) : s.value ? (l(), _(F, { key: 2 }, [e.block.url ? (l(), _("a", {
2396
- key: 0,
2397
- href: e.block.url,
2398
- target: "_blank",
2399
- rel: "noopener noreferrer",
2400
- class: "tpl:group tpl:relative tpl:inline-block",
2401
- style: x(u.value),
2402
- onClick: r[0] ||= D(() => {}, ["prevent"])
2403
- }, [O("img", {
2404
- class: "tpl:block tpl:w-full tpl:border-0",
2405
- src: s.value,
2406
- alt: e.block.alt,
2407
- style: x(d.value)
2408
- }, null, 12, Ja), L(Ha, { "hover-effect": "" })], 12, qa)) : (l(), _("div", {
2409
- key: 1,
2410
- class: "tpl:relative tpl:inline-block",
2411
- style: x(u.value)
2412
- }, [O("img", {
2413
- class: "tpl:block tpl:w-full tpl:border-0",
2414
- src: s.value,
2415
- alt: e.block.alt,
2416
- style: x(d.value)
2417
- }, null, 12, Ya), L(Ha)], 4))], 64)) : (l(), _("div", Xa, [L(N(Mn), {
2418
- size: 40,
2419
- "stroke-width": 1.5,
2420
- class: "tpl:text-[var(--tpl-border-light)]"
2421
- }), O("span", null, C(N(n).video.addVideo), 1)]))], 4));
2422
- }
2423
- }), Qa = {
2424
- section: wa,
2425
- title: pa,
2426
- paragraph: Qi,
2427
- image: Gi,
2428
- button: Zr,
2429
- divider: Di,
2430
- video: Za,
2431
- social: Ma,
2432
- menu: Yi,
2433
- table: Va,
2434
- spacer: Fa,
2435
- html: Ni,
2436
- countdown: u(() => import("./CountdownBlock-BqRw147R.js"))
2437
- };
2438
- function $a(e) {
2439
- let { editor: t, config: n, translations: i, fontsManager: a } = e, { t: s, format: c } = Q(i), l = j(() => ze(ze(ze(ur(i), Ar(t.content.value.settings?.locale)), ee(t.content.value.settings) === "rtl" ? {
2440
- title: { textAlign: "right" },
2441
- table: { textAlign: "right" }
2442
- } : {}), n.blockDefaults ?? {}));
2443
- t.setUiTheme(n.uiTheme ?? "auto");
2444
- let { resolvedTheme: u } = Qn(j(() => t.state.uiTheme)), d = S(n.theme ?? {}), { themeStyles: f } = er({
2445
- themeOverrides: d,
2446
- resolvedTheme: u,
2447
- extraStyles: () => ({
2448
- "--tpl-drop-text": `"${i.canvas.dropHere}"`,
2449
- ...e.themeExtraStyles?.()
2450
- })
2451
- }), m = e.history ?? $e({
2452
- content: t.content,
2453
- setContent: (e, n) => t.setContent(e, n)
2454
- });
2455
- e.history || Xe(t, m);
2456
- let h = Ye({
2457
- addBlock: t.addBlock,
2458
- removeBlock: t.removeBlock,
2459
- updateBlock: t.updateBlock,
2460
- selectBlock: t.selectBlock,
2461
- findBlockLocation: t.findBlockLocation,
2462
- blockDefaults: () => l.value
2463
- }), _ = Qe(t), v = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? Je({
2464
- content: t.content,
2465
- isDirty: () => t.state.isDirty,
2466
- ...e.autoSaveOptions
2467
- }) : null, y = null;
2468
- v && (y = p(m.isNavigating, (e) => {
2469
- e ? v.pause() : v.resume();
2470
- }));
2471
- let b = Zn(t, {
2472
- t: s,
2473
- format: c
2474
- }, n.customBlocks ?? []), x = pn(n.colors);
2475
- if (x.allowCustomIgnored && Z.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 && Z.warn(`config.colors.presets skipped invalid entries: ${x.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), x.allowCustom === !1) {
2476
- let e = lr(x.presets, n.blockDefaults, n.templateDefaults);
2477
- e.length > 0 && Z.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.`);
2478
- }
2479
- let C = hn(n.templateSettings);
2480
- for (let e of C.unknown) Z.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${gn.join(", ")}) — skipping it.`);
2481
- let w = tr();
2482
- or(w, Qa);
2483
- let T = /* @__PURE__ */ new Set();
2484
- function E(e) {
2485
- for (let t of e) {
2486
- w.registerCustom(t, Ti);
2487
- for (let e of jr(t, x)) T.has(e.id) || (T.add(e.id), Z.warn(e.message));
2488
- }
2489
- }
2490
- n.customBlocks?.length && E(n.customBlocks);
2491
- let D = Un();
2492
- if (o() && g(D.dispose), e.containerEl) {
2493
- let t = e.containerEl;
2494
- q(document, "pointerdown", (e) => {
2495
- let n = t.value;
2496
- n && (e.composedPath?.() ?? []).includes(n) && D.claim();
2497
- }, { capture: !0 });
2498
- }
2499
- function O() {
2500
- let t = e.capabilities?.templates;
2501
- t ? t.save() : v?.flush();
2502
- }
2503
- function A(n) {
2504
- D.isActive() && Nr(n, {
2505
- history: m,
2506
- selectBlock: (e) => t.selectBlock(e),
2507
- getSelectedBlockId: () => t.state.selectedBlockId,
2508
- removeBlock: (e) => t.removeBlock(e),
2509
- onSave: O,
2510
- isPicking: () => e.capabilities?.savedBlocks?.isPicking.value === !0,
2511
- onConfirmPick: () => e.capabilities?.savedBlocks?.confirmPicking(),
2512
- onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
2513
- });
2514
- }
2515
- q(document, "keydown", A);
2516
- let M = S(null), N = e.editorRoot ?? document;
2517
- r(Ht, N), r(bt, M), r(Bt, i), r(X, t), r(ln, m), r(Ut, h), r(qt, _), r(on, a), r(Dt, f), r(Vt, u), r(en, l), r(zt, n.locale), r(an, w), r(tn, n.customBlocks ?? []), r(un, n.paletteBlocks), r(Wt, sr(n.htmlBlockPreview)), r(xt, n.layout), r(Rt, n.sectionWrapper), r(Kt, x), r(nn, C.fields), r(Qt, nr(t.content, w));
2518
- let P = Ae(n.mergeTags?.syntax);
2519
- for (let e of ["opener", "closer"]) {
2520
- let t = P[e];
2521
- typeof t == "string" && t.trim() === "" && Z.warn(`config.mergeTags.syntax.${e} is blank — ignoring it.`);
2522
- }
2523
- typeof P.opener != "string" && typeof P.closer == "string" && P.closer.trim() !== "" && Se(P) === null && Z.warn("config.mergeTags.syntax.closer has no effect without an opener — set opener to turn on autocomplete for this syntax.");
2524
- let F = k(n.mergeTags?.tags ?? []);
2525
- function I(e) {
2526
- Array.isArray(e) ? F.value = e : Z.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
2527
- }
2528
- r(Y, F), r(Mt, P), r(Pt, n.mergeTags?.onRequest ?? null), r(Xt, n.mergeTags?.autocomplete !== !1), r(jt, n.mergeTags?.showRawValue !== !1);
2529
- let L = S(ke(n.mergeTags?.tags ?? []));
2530
- r(At, L);
2531
- let R = Gn({
2532
- resolvePreview: n.resolvePreview,
2533
- getContent: () => {
2534
- let e = t.content.value;
2535
- return n.layout && t.state.previewMode ? ue(n.layout, e) : e;
2536
- },
2537
- isActive: () => t.state.previewMode
2538
- });
2539
- r(Lt, R), r(Tt, n.resolvePreview);
2540
- let z = j(() => !(t.state.previewMode && R.isConfigured));
2541
- r(rn, z);
2542
- let B = Kn();
2543
- r(yt, B), r(Yt, S(!1)), r(St, S(!1)), r(It, n.logicTags?.tags ?? []), r(sn, n.logicTags?.pairs ?? []), r(Et, n.logicTags?.onRequest ?? null), r(Ct, qn()), r(kt, n.onRequestMedia ?? null), r(Gt, n.canDropMedia ?? null), r(cn, n.resolveImageUrl ? rt(n.resolveImageUrl) : null), r(Jt, n.displayConditions?.conditions ?? []), r($t, n.displayConditions?.allowCustom ?? !1), r(Zt, e.capabilities ?? {}), r(Ft, b);
2544
- let V = Jn(n.lint) ? null : Xn({
2545
- content: t.content,
2546
- options: n.lint ?? {},
2547
- updateBlock: t.updateBlock,
2548
- updateSettings: t.updateSettings,
2549
- removeBlock: t.removeBlock
2550
- });
2551
- r(Ot, V);
2552
- function H() {
2553
- y?.(), V?.destroy(), v?.destroy(), m.destroy();
2554
- }
2555
- return {
2556
- t: s,
2557
- format: c,
2558
- editorRoot: N,
2559
- history: m,
2560
- blockActions: h,
2561
- conditionPreview: _,
2562
- autoSave: v,
2563
- resolvedTheme: u,
2564
- themeStyles: f,
2565
- themeOverrides: d,
2566
- registry: w,
2567
- keyboardReorder: b,
2568
- templateLint: V,
2569
- popoverRoot: M,
2570
- mergeTagSampleMode: L,
2571
- previewResolution: R,
2572
- appliesConditionFilter: z,
2573
- registerCustomBlocks: E,
2574
- setMergeTags: I,
2575
- mergeTags: F,
2576
- mergeTagSyntax: P,
2577
- destroy: H
2578
- };
2579
- }
2580
- export { Fr as A, ei as C, Wr as D, Ur as E, Cr as F, Sr as I, xr as L, Er as M, Tr as N, Pr as O, wr as P, Gn as R, ni as S, zr as T, gi as _, Ma as a, si as b, _a as c, Qi as d, Yi as f, Ti as g, Di as h, Fa as i, vr as j, qr as k, pa as l, Ni as m, Za as n, wa as o, Gi as p, Va as r, ma as s, $a as t, da as u, mi as v, Zr as w, ri as x, fi as y };
2581
-
2582
- //# sourceMappingURL=useEditorCore-BrY66C2y.js.map