@templatical/editor 0.48.0 → 0.50.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 (396) hide show
  1. package/README.md +4 -2
  2. package/dist/AiAltTextPopover-BZQ95GXL.js +106 -0
  3. package/dist/AiAltTextReview-DoBEudnE.js +206 -0
  4. package/dist/AiChatPanel-Bs6sES3b.js +550 -0
  5. package/dist/AiHeaderMenu-BEaTazx4.js +36 -0
  6. package/dist/AiPanels-CfN7A-ZA.js +33 -0
  7. package/dist/AiRewriteMenu-C3ZfDDYy.js +276 -0
  8. package/dist/{BlockIssueBadge-BShkuJis.js → BlockIssueBadge-CKwZ1Vgn.js} +11 -11
  9. package/dist/{BlockPreviewCanvas-tzAtDkXH.js → BlockPreviewCanvas-BXNLLLYi.js} +33 -33
  10. package/dist/CloudHeaderExtras-CsJMEiyN.js +23 -0
  11. package/dist/CloudPanels-B4F5m7vy.js +168 -0
  12. package/dist/CollaborationNotices-CNuDp7Y2.js +76 -0
  13. package/dist/CollaboratorBar-BtHPiuHq.js +123 -0
  14. package/dist/{CommentsPanel-DiWzYtnZ.js → CommentsPanel-CyCM-BvT.js} +4 -4
  15. package/dist/CommentsSidebar-Ca3DyFOX.js +500 -0
  16. package/dist/{cdn/chunks/CountdownBlock-Dasj191h.js → CountdownBlock-DR4Xm2-T.js} +24 -26
  17. package/dist/{CountdownToolbar-C4y3Ft7H.js → CountdownToolbar-CEIMPojJ.js} +56 -56
  18. package/dist/IssuesPanel-C8nMUccy.js +360 -0
  19. package/dist/{LoadingTrack-6XsqodoY.js → LoadingTrack-B0RKQWq3.js} +2 -2
  20. package/dist/{LogicTagInsertButton-B1_Wy0AN.js → LogicTagInsertButton-CqfU52CO.js} +272 -267
  21. package/dist/{cdn/chunks/MediaEditModal-zXfcArr4.js → MediaEditModal-DHtkZ4OU.js} +202 -186
  22. package/dist/{MediaPanels-9mDBv4aL.js → MediaPanels-CGcOB2pR.js} +4 -4
  23. package/dist/{MergeTagInput-fOewuF27.js → MergeTagInput-YnEkorTZ.js} +26 -26
  24. package/dist/{MergeTagModeToggle-BXamLcv7.js → MergeTagModeToggle-Dhb1DAcQ.js} +40 -40
  25. package/dist/MergeTagTextarea-e4lnwtqZ.js +70 -0
  26. package/dist/ParagraphEditor-B6NK0ytw.js +799 -0
  27. package/dist/{RestoreVersionDialog-BEKXx9xk.js → RestoreVersionDialog-Bq_IGOLJ.js} +22 -22
  28. package/dist/{RichTextEditorContent-D7kp7iig.js → RichTextEditorContent-AOM6fylS.js} +48 -48
  29. package/dist/{SaveBlockDialog-SJu0lecx.js → SaveBlockDialog-C8GngfQx.js} +88 -88
  30. package/dist/{cdn/chunks/SavedBlocksBrowserModal-CtnB58p_.js → SavedBlocksBrowserModal-wnkvxpm_.js} +102 -99
  31. package/dist/{SavedBlocksPanels-Dr5Fxx9Z.js → SavedBlocksPanels-C2s3q0pJ.js} +9 -9
  32. package/dist/{SavedBlocksPickBar-DnEWBZJy.js → SavedBlocksPickBar-BjcTiV87.js} +14 -14
  33. package/dist/TemplateSettings-BVBWpiDU.js +237 -0
  34. package/dist/{TestEmailModal-CbRY8HQx.js → TestEmailModal-SyhO9bn3.js} +57 -57
  35. package/dist/{TestEmailPanel-NAOmt3xi.js → TestEmailPanel-BDd2Rtav.js} +4 -4
  36. package/dist/{TitleEditor-Cc3DHbuN.js → TitleEditor-pxD53y_l.js} +75 -75
  37. package/dist/ToggleSwitch-D51U9cmR.js +37 -0
  38. package/dist/Toolbar-CZSPZYbj.js +3153 -0
  39. package/dist/{TplModal-Bz4-IZ9R.js → TplModal-DCzBzicE.js} +19 -19
  40. package/dist/{VersionHistoryMenu-CjV1d1zk.js → VersionHistoryMenu-BQeWPT85.js} +35 -35
  41. package/dist/{VersionHistoryPanels-BtwxrKJn.js → VersionHistoryPanels-BBm7YbRQ.js} +5 -5
  42. package/dist/{VersionPreviewBanner-BLAei1kj.js → VersionPreviewBanner-DUGF0tUJ.js} +10 -10
  43. package/dist/WrapperBlock-BO619LAb.js +45 -0
  44. package/dist/aiErrors-D5UOoYOt.js +41 -0
  45. package/dist/aiImageContext-BH4Ss1h3.js +48 -0
  46. package/dist/aiRewritePreview-DLGM05Ge.js +44 -0
  47. package/dist/{blockTypeIcons-CEDZytqP.js → blockTypeIcons-NzaYvAI4.js} +15 -14
  48. package/dist/bundle-stats.json +8 -8
  49. package/dist/{cdn/chunks/ca-CbNzJM3I.js → ca-C7mTzW1r.js} +147 -8
  50. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js +107 -0
  51. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js.map +1 -0
  52. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js +207 -0
  53. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js.map +1 -0
  54. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js +476 -0
  55. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js.map +1 -0
  56. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js +37 -0
  57. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js.map +1 -0
  58. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js +34 -0
  59. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js.map +1 -0
  60. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js +208 -0
  61. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js.map +1 -0
  62. package/dist/cdn/chunks/{BlockIssueBadge-C7sdnkrF.js → BlockIssueBadge-DAn2vsMJ.js} +13 -13
  63. package/dist/cdn/chunks/{BlockIssueBadge-C7sdnkrF.js.map → BlockIssueBadge-DAn2vsMJ.js.map} +1 -1
  64. package/dist/cdn/chunks/{BlockPreviewCanvas-vK5tBazr.js → BlockPreviewCanvas-D0--EQkP.js} +39 -39
  65. package/dist/cdn/chunks/{BlockPreviewCanvas-vK5tBazr.js.map → BlockPreviewCanvas-D0--EQkP.js.map} +1 -1
  66. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js +25 -0
  67. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js.map +1 -0
  68. package/dist/cdn/chunks/{CloudPanels-awqHfJqC.js → CloudPanels-C3jsxo_f.js} +52 -100
  69. package/dist/cdn/chunks/CloudPanels-C3jsxo_f.js.map +1 -0
  70. package/dist/cdn/chunks/CollaborationNotices-DjRI8gvs.js +78 -0
  71. package/dist/cdn/chunks/CollaborationNotices-DjRI8gvs.js.map +1 -0
  72. package/dist/cdn/chunks/CollaboratorBar-Dfzm6A9A.js +72 -0
  73. package/dist/cdn/chunks/CollaboratorBar-Dfzm6A9A.js.map +1 -0
  74. package/dist/cdn/chunks/CommentsPanel-CSO79OeX.js +20 -0
  75. package/dist/cdn/chunks/{CommentsPanel-CbzxwsyI.js.map → CommentsPanel-CSO79OeX.js.map} +1 -1
  76. package/dist/cdn/chunks/CommentsSidebar-CCvplq1Z.js +470 -0
  77. package/dist/cdn/chunks/{CommentsSidebar-DWPHZuQm.js.map → CommentsSidebar-CCvplq1Z.js.map} +1 -1
  78. package/dist/{CountdownBlock-zx39Dyby.js → cdn/chunks/CountdownBlock-C6USdwk3.js} +19 -17
  79. package/dist/cdn/chunks/{CountdownBlock-Dasj191h.js.map → CountdownBlock-C6USdwk3.js.map} +1 -1
  80. package/dist/cdn/chunks/{CountdownToolbar-Cqg8FUH-.js → CountdownToolbar-Cjud2Tos.js} +71 -71
  81. package/dist/cdn/chunks/{CountdownToolbar-Cqg8FUH-.js.map → CountdownToolbar-Cjud2Tos.js.map} +1 -1
  82. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js +340 -0
  83. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js.map +1 -0
  84. package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js → LoadingTrack-BIcL4NiY.js} +2 -2
  85. package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js.map → LoadingTrack-BIcL4NiY.js.map} +1 -1
  86. package/dist/cdn/chunks/{LogicTagInsertButton-BMB9vShs.js → LogicTagInsertButton-CsL2JDOG.js} +374 -369
  87. package/dist/cdn/chunks/LogicTagInsertButton-CsL2JDOG.js.map +1 -0
  88. package/dist/{MediaEditModal-ByOvznRC.js → cdn/chunks/MediaEditModal-BuHCiyMu.js} +544 -560
  89. package/dist/cdn/chunks/MediaEditModal-BuHCiyMu.js.map +1 -0
  90. package/dist/cdn/chunks/MediaPanels-DAgUf_T1.js +45 -0
  91. package/dist/cdn/chunks/{MediaPanels-Cp4XB_dH.js.map → MediaPanels-DAgUf_T1.js.map} +1 -1
  92. package/dist/cdn/chunks/{MergeTagInput-DLqrA9co.js → MergeTagInput-C8U-7LxL.js} +34 -34
  93. package/dist/cdn/chunks/{MergeTagInput-DLqrA9co.js.map → MergeTagInput-C8U-7LxL.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-BRiJzzn5.js → MergeTagModeToggle-Mm-p0A52.js} +41 -41
  95. package/dist/cdn/chunks/{MergeTagModeToggle-BRiJzzn5.js.map → MergeTagModeToggle-Mm-p0A52.js.map} +1 -1
  96. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js +72 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js +634 -0
  99. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-BgR6RXSb.js → RestoreVersionDialog-CdA5osuA.js} +26 -26
  101. package/dist/cdn/chunks/{RestoreVersionDialog-BgR6RXSb.js.map → RestoreVersionDialog-CdA5osuA.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-C4DMAn0g.js → RichTextEditorContent-Q1d2xqBT.js} +46 -46
  103. package/dist/cdn/chunks/{RichTextEditorContent-C4DMAn0g.js.map → RichTextEditorContent-Q1d2xqBT.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-BaIsQd09.js → SaveBlockDialog-CijargAy.js} +78 -78
  105. package/dist/cdn/chunks/{SaveBlockDialog-BaIsQd09.js.map → SaveBlockDialog-CijargAy.js.map} +1 -1
  106. package/dist/cdn/chunks/SavedBlocksBrowserModal-DtOz_X5S.js +357 -0
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-CtnB58p_.js.map → SavedBlocksBrowserModal-DtOz_X5S.js.map} +1 -1
  108. package/dist/cdn/chunks/SavedBlocksPanels-BowyED5h.js +38 -0
  109. package/dist/cdn/chunks/{SavedBlocksPanels-BhEOMzEQ.js.map → SavedBlocksPanels-BowyED5h.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-CcdqTEIp.js → SavedBlocksPickBar-BPRaJBv3.js} +19 -19
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-CcdqTEIp.js.map → SavedBlocksPickBar-BPRaJBv3.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-ByZeBO34.js +209 -0
  113. package/dist/cdn/chunks/{TemplateSettings-BkkWTDHD.js.map → TemplateSettings-ByZeBO34.js.map} +1 -1
  114. package/dist/cdn/chunks/{TestEmailModal-V5mwHsUV.js → TestEmailModal-BUVTj3Ic.js} +54 -54
  115. package/dist/cdn/chunks/{TestEmailModal-V5mwHsUV.js.map → TestEmailModal-BUVTj3Ic.js.map} +1 -1
  116. package/dist/cdn/chunks/TestEmailPanel-BxutYoWg.js +35 -0
  117. package/dist/cdn/chunks/{TestEmailPanel-DxrKuctP.js.map → TestEmailPanel-BxutYoWg.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Ccv6uoTz.js +199 -0
  119. package/dist/cdn/chunks/{TitleEditor-CsZiG3TT.js.map → TitleEditor-Ccv6uoTz.js.map} +1 -1
  120. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js +39 -0
  121. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js.map +1 -0
  122. package/dist/cdn/chunks/{Toolbar-C_x2TfFk.js → Toolbar-DoprRgTn.js} +1097 -1101
  123. package/dist/cdn/chunks/Toolbar-DoprRgTn.js.map +1 -0
  124. package/dist/cdn/chunks/{TplModal-DC_eodTV.js → TplModal-BXQzmsJX.js} +21 -21
  125. package/dist/cdn/chunks/{TplModal-DC_eodTV.js.map → TplModal-BXQzmsJX.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-DXnM5Df2.js → VersionHistoryMenu-BF2fNCvq.js} +41 -41
  127. package/dist/cdn/chunks/{VersionHistoryMenu-DXnM5Df2.js.map → VersionHistoryMenu-BF2fNCvq.js.map} +1 -1
  128. package/dist/cdn/chunks/VersionHistoryPanels-Dal0Uk69.js +48 -0
  129. package/dist/cdn/chunks/{VersionHistoryPanels-DXSqmaLS.js.map → VersionHistoryPanels-Dal0Uk69.js.map} +1 -1
  130. package/dist/cdn/chunks/{VersionPreviewBanner-DKyN6BhO.js → VersionPreviewBanner-BaGcn-b1.js} +13 -13
  131. package/dist/cdn/chunks/{VersionPreviewBanner-DKyN6BhO.js.map → VersionPreviewBanner-BaGcn-b1.js.map} +1 -1
  132. package/dist/cdn/chunks/WrapperBlock-DkQJtLz0.js +47 -0
  133. package/dist/cdn/chunks/{WrapperBlock-gG_Bleug.js.map → WrapperBlock-DkQJtLz0.js.map} +1 -1
  134. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js +43 -0
  135. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js.map +1 -0
  136. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js +50 -0
  137. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js.map +1 -0
  138. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js +46 -0
  139. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js.map +1 -0
  140. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js +22 -0
  141. package/dist/cdn/chunks/{blockTypeIcons-HrMJDfVg.js.map → blockTypeIcons-ikZAmd6U.js.map} +1 -1
  142. package/dist/{ca-CbNzJM3I.js → cdn/chunks/ca-C7mTzW1r.js} +149 -6
  143. package/dist/cdn/chunks/ca-C7mTzW1r.js.map +1 -0
  144. package/dist/cdn/chunks/createCloudRuntime-DpBWhrv3.js +1408 -0
  145. package/dist/cdn/chunks/createCloudRuntime-DpBWhrv3.js.map +1 -0
  146. package/dist/cdn/chunks/de-DBOTcDj2.js +22 -0
  147. package/dist/cdn/chunks/de-DBOTcDj2.js.map +1 -0
  148. package/dist/{de-DMquBpZM.js → cdn/chunks/de-DNuYQTmS.js} +149 -6
  149. package/dist/cdn/chunks/de-DNuYQTmS.js.map +1 -0
  150. package/dist/{dist-CUWI-IvA.js → cdn/chunks/dist-Bo8Thh8v.js} +60 -58
  151. package/dist/cdn/chunks/{dist-CjL6JHML.js.map → dist-Bo8Thh8v.js.map} +1 -1
  152. package/dist/cdn/chunks/dist-S-rLGqax.js +406 -0
  153. package/dist/cdn/chunks/{dist-MNQYSEWU.js.map → dist-S-rLGqax.js.map} +1 -1
  154. package/dist/cdn/chunks/{draggable-DrsNwZuB.js → draggable-DZ0gwUJ6.js} +1359 -1266
  155. package/dist/cdn/chunks/draggable-DZ0gwUJ6.js.map +1 -0
  156. package/dist/cdn/chunks/{editor-modal-vEEmZ8Tu.js → editor-modal-CI6EfeMd.js} +881 -881
  157. package/dist/cdn/chunks/{editor-modal-vEEmZ8Tu.js.map → editor-modal-CI6EfeMd.js.map} +1 -1
  158. package/dist/cdn/chunks/en-CDhWRrF_.js +22 -0
  159. package/dist/cdn/chunks/en-CDhWRrF_.js.map +1 -0
  160. package/dist/{en-C8Mp71sO.js → cdn/chunks/en-CW71OK66.js} +149 -6
  161. package/dist/cdn/chunks/en-CW71OK66.js.map +1 -0
  162. package/dist/cdn/chunks/en-ifvu6oPv.js +1 -0
  163. package/dist/{es-Byq4tthI.js → cdn/chunks/es-DdK7zQfi.js} +149 -6
  164. package/dist/cdn/chunks/es-DdK7zQfi.js.map +1 -0
  165. package/dist/cdn/chunks/{extensions-hJ9VqzDc.js → extensions-taJTZlLK.js} +71 -71
  166. package/dist/cdn/chunks/{extensions-hJ9VqzDc.js.map → extensions-taJTZlLK.js.map} +1 -1
  167. package/dist/{fr-B3j35HEw.js → cdn/chunks/fr-Dz5Bgb7-.js} +149 -6
  168. package/dist/cdn/chunks/fr-Dz5Bgb7-.js.map +1 -0
  169. package/dist/cdn/chunks/{icons-aTYwH5-g.js → icons-DNX6StSs.js} +183 -150
  170. package/dist/cdn/chunks/icons-DNX6StSs.js.map +1 -0
  171. package/dist/{ja-D7txAuGS.js → cdn/chunks/ja-Di-zJiT8.js} +149 -6
  172. package/dist/cdn/chunks/ja-Di-zJiT8.js.map +1 -0
  173. package/dist/cdn/chunks/keys-BTpmg2Tt.js +12 -0
  174. package/dist/cdn/chunks/keys-BTpmg2Tt.js.map +1 -0
  175. package/dist/{logger-BBlvSn6q.js → cdn/chunks/logger-Tj0RPskW.js} +7 -1
  176. package/dist/cdn/chunks/logger-Tj0RPskW.js.map +1 -0
  177. package/dist/{nl-ClJ3BY3F.js → cdn/chunks/nl-CvVuHYFL.js} +149 -6
  178. package/dist/cdn/chunks/nl-CvVuHYFL.js.map +1 -0
  179. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js +199 -0
  180. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js.map +1 -0
  181. package/dist/cdn/chunks/{preRenderCustomBlocks-ByfuSjtL.js → preRenderCustomBlocks-Dc-QLntG.js} +4 -4
  182. package/dist/cdn/chunks/{preRenderCustomBlocks-ByfuSjtL.js.map → preRenderCustomBlocks-Dc-QLntG.js.map} +1 -1
  183. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js +22 -0
  184. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js.map +1 -0
  185. package/dist/{pt-BR-DibcXcmv.js → cdn/chunks/pt-BR-ZhO4vgyq.js} +149 -6
  186. package/dist/cdn/chunks/pt-BR-ZhO4vgyq.js.map +1 -0
  187. package/dist/cdn/chunks/{pusher-C8DeiO2X.js → pusher-Cs4GGEtd.js} +2 -2
  188. package/dist/cdn/chunks/pusher-Cs4GGEtd.js.map +1 -0
  189. package/dist/cdn/chunks/{rolldown-runtime-B0aSnxlc.js → rolldown-runtime-Y_bBpyJl.js} +1 -1
  190. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js +62 -0
  191. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js.map +1 -0
  192. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js +2032 -0
  193. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js.map +1 -0
  194. package/dist/cdn/chunks/{src-DYCDeBDM.js → src-BNFnxfrA.js} +694 -329
  195. package/dist/cdn/chunks/src-BNFnxfrA.js.map +1 -0
  196. package/dist/cdn/chunks/{src-dZ4D_tuP.js → src-BcTUmgLe.js} +181 -181
  197. package/dist/cdn/chunks/src-BcTUmgLe.js.map +1 -0
  198. package/dist/cdn/chunks/src-Bs_yxk3h.js +4392 -0
  199. package/dist/cdn/chunks/src-Bs_yxk3h.js.map +1 -0
  200. package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +2 -4
  201. package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js.map → styleConstants-v1dNKgJf.js.map} +1 -1
  202. package/dist/cdn/chunks/{tiptap-BPigZk5G.js → tiptap-CtVrAViq.js} +44 -44
  203. package/dist/cdn/chunks/tiptap-CtVrAViq.js.map +1 -0
  204. package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js → useCloudI18n-AVXhzbhQ.js} +4 -4
  205. package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js.map → useCloudI18n-AVXhzbhQ.js.map} +1 -1
  206. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js +2586 -0
  207. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js.map +1 -0
  208. package/dist/cdn/chunks/useEditorRoot-CR5GjJD6.js +10 -0
  209. package/dist/cdn/chunks/{useEditorRoot-CTc6O8al.js.map → useEditorRoot-CR5GjJD6.js.map} +1 -1
  210. package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js → useI18n-CbVubQhM.js} +3 -3
  211. package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js.map → useI18n-CbVubQhM.js.map} +1 -1
  212. package/dist/cdn/chunks/{useLogicTag-HsyUCQtl.js → useLogicTag-B49Nc53Y.js} +5 -5
  213. package/dist/cdn/chunks/{useLogicTag-HsyUCQtl.js.map → useLogicTag-B49Nc53Y.js.map} +1 -1
  214. package/dist/cdn/chunks/{useMergeTag-Dg9pE85U.js → useMergeTag-B0KryMj8.js} +7 -7
  215. package/dist/cdn/chunks/{useMergeTag-Dg9pE85U.js.map → useMergeTag-B0KryMj8.js.map} +1 -1
  216. package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js → usePopoverPosition-C829ps5i.js} +4 -4
  217. package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js.map → usePopoverPosition-C829ps5i.js.map} +1 -1
  218. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js +51 -0
  219. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js.map +1 -0
  220. package/dist/cdn/chunks/{withCurrentFont-oLcATrQ8.js → withCurrentFont-DFPXeVfG.js} +2 -2
  221. package/dist/cdn/chunks/{withCurrentFont-oLcATrQ8.js.map → withCurrentFont-DFPXeVfG.js.map} +1 -1
  222. package/dist/cdn/editor.css +1 -1
  223. package/dist/cdn/editor.js +2235 -1311
  224. package/dist/cdn/editor.js.map +1 -1
  225. package/dist/{check-ClwqRMgv.js → check-yYsp5Xpk.js} +1 -1
  226. package/dist/{chevron-down-te6qn-zE.js → chevron-down-DTmD06_j.js} +1 -1
  227. package/dist/{chevron-right-W2hbH1FM.js → chevron-right-BSeYZOxc.js} +1 -1
  228. package/dist/{chevron-up-Bf5Zo7o4.js → chevron-up-BOApwrxi.js} +1 -1
  229. package/dist/{circle-alert-CIEGV5DN.js → circle-alert-BMszY8im.js} +1 -1
  230. package/dist/{clock-Y4cx0gkJ.js → clock-HADxnl6-.js} +1 -1
  231. package/dist/createCloudRuntime-DVQI_ReU.js +1379 -0
  232. package/dist/{createLucideIcon-CYHXK9hn.js → createLucideIcon-0lYYH3EW.js} +6 -6
  233. package/dist/de-DBOTcDj2.js +20 -0
  234. package/dist/{cdn/chunks/de-DMquBpZM.js → de-DNuYQTmS.js} +147 -8
  235. package/dist/{cdn/chunks/dist-CjL6JHML.js → dist-C7EtxNCb.js} +49 -51
  236. package/dist/{dist-DuufrR8O.js → dist-C_dV9QAx.js} +130 -130
  237. package/dist/{cdn/chunks/dist-MNQYSEWU.js → dist-DI4_YSnG.js} +111 -110
  238. package/dist/{dist-tsmnQugO.js → dist-DtOF3bDW.js} +648 -294
  239. package/dist/{editor-modal-AlVLkU91.js → editor-modal-Bzhl-PgI.js} +832 -834
  240. package/dist/en-CDhWRrF_.js +20 -0
  241. package/dist/{cdn/chunks/en-C8Mp71sO.js → en-CW71OK66.js} +147 -8
  242. package/dist/en-DwV15ltA.js +1 -0
  243. package/dist/{cdn/chunks/es-Byq4tthI.js → es-DdK7zQfi.js} +147 -8
  244. package/dist/{extensions-pjO8VGkM.js → extensions-CdyweA50.js} +54 -54
  245. package/dist/{eye-Ddnz8nnm.js → eye-DWkSvYpj.js} +1 -1
  246. package/dist/{cdn/chunks/fr-B3j35HEw.js → fr-Dz5Bgb7-.js} +147 -8
  247. package/dist/image-DesWjcZ4.js +28 -0
  248. package/dist/index.d.ts +640 -48
  249. package/dist/{info-DXLmzoeY.js → info-ClWJGoZy.js} +1 -1
  250. package/dist/{cdn/chunks/ja-D7txAuGS.js → ja-Di-zJiT8.js} +147 -8
  251. package/dist/keys-Zd9KWRD1.js +10 -0
  252. package/dist/{link-Cel46wgo.js → link-BqRicFTA.js} +1 -1
  253. package/dist/{list-Cl0GwiV9.js → list-bojQr9bn.js} +1 -1
  254. package/dist/{loader-circle-uAwpvfys.js → loader-circle-B2B8LbUu.js} +1 -1
  255. package/dist/{cdn/chunks/logger-ByvdoAwq.js → logger-k9Nbj3Cp.js} +5 -3
  256. package/dist/{message-circle-DWU1pTM_.js → message-circle-BEuiNsyZ.js} +1 -1
  257. package/dist/{cdn/chunks/nl-ClJ3BY3F.js → nl-CvVuHYFL.js} +147 -8
  258. package/dist/normalizeMergeTagMarkup-P6SUBuPv.js +197 -0
  259. package/dist/{package-CbyG_yU_.js → package-DCROB4aM.js} +1 -1
  260. package/dist/{pencil-BzoDcwKu.js → pencil-CEotCKbf.js} +1 -1
  261. package/dist/{preRenderCustomBlocks-DMP5RuHl.js → preRenderCustomBlocks-D8rr61_z.js} +3 -3
  262. package/dist/pt-BR-CHM-ZKvE.js +20 -0
  263. package/dist/{cdn/chunks/pt-BR-DibcXcmv.js → pt-BR-ZhO4vgyq.js} +147 -8
  264. package/dist/{refresh-cw-9WinWixo.js → refresh-cw-C6M2mHNC.js} +12 -2
  265. package/dist/{runtime-dom.esm-bundler-lFF-QG3j.js → runtime-dom.esm-bundler-B8WCZWUm.js} +134 -134
  266. package/dist/sanitizeRichTextHtml-DeISfLFr.js +60 -0
  267. package/dist/{search-CqgGq1gG.js → search-Cy99zPYf.js} +1 -1
  268. package/dist/{send-Ceo3c9Db.js → send-BDLJFsf3.js} +1 -1
  269. package/dist/{smartphone-CcLaCpGK.js → smartphone-CVvQaNA4.js} +1 -1
  270. package/dist/socialIcons-Dd-jRiVe.js +2086 -0
  271. package/dist/{sparkles-Do9XjAuT.js → sparkles-Ce0Qz0ox.js} +1 -1
  272. package/dist/square-BWlolnXe.js +15 -0
  273. package/dist/style.css +1 -1
  274. package/dist/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +1 -3
  275. package/dist/templatical-editor.js +2272 -1327
  276. package/dist/{text-align-start-DvzC0HQA.js → text-align-start-D1V5gPTy.js} +1 -1
  277. package/dist/{trash-vlINTx32.js → trash-CZfiUFmw.js} +1 -1
  278. package/dist/{triangle-alert-MRYSJ9T2.js → triangle-alert-CFDzyFC7.js} +1 -1
  279. package/dist/upload-BJfvdIrD.js +36 -0
  280. package/dist/{useCloudI18n-Nwqo7pI_.js → useCloudI18n-Dcjua65H.js} +5 -5
  281. package/dist/{useEditorCore-PvErWWsp.js → useEditorCore-BTLeAVlM.js} +1534 -1549
  282. package/dist/{useEditorRoot-BD3piYtD.js → useEditorRoot-DUy67lJu.js} +2 -2
  283. package/dist/{useI18n-CxVEpurs.js → useI18n-BdoY7xDE.js} +4 -4
  284. package/dist/{useLogicTag-BHn67tDd.js → useLogicTag-DKLZ1T9H.js} +3 -3
  285. package/dist/{useMergeTag-CRkm5Ig6.js → useMergeTag-Bhdx7AKk.js} +5 -5
  286. package/dist/{usePopoverPosition-CwnH1o5g.js → usePopoverPosition-BZea45XK.js} +2 -2
  287. package/dist/useScrollToBlock-FmNMALM_.js +74 -0
  288. package/dist/{vue.runtime.esm-bundler-CAzmrXdD.js → vue.runtime.esm-bundler-DgFJ6GPG.js} +1182 -1087
  289. package/dist/{withCurrentFont-CxRGeHO3.js → withCurrentFont-BATJHNve.js} +1 -1
  290. package/dist/{x-Cd6SFw8r.js → x-CZ0Js0hA.js} +1 -1
  291. package/package.json +17 -15
  292. package/dist/AiChatSidebar-DxPHFNoT.js +0 -230
  293. package/dist/AiFeatureMenu-C8GVqu1d.js +0 -57
  294. package/dist/CloudHeaderExtras-CUSftQdm.js +0 -59
  295. package/dist/CloudPanels-Dgw7tb4R.js +0 -216
  296. package/dist/CollaboratorBar-5rfopCPx.js +0 -103
  297. package/dist/CommentsSidebar-BOqj16Al.js +0 -500
  298. package/dist/DesignReferenceSidebar-BWAi3eQQ.js +0 -279
  299. package/dist/IssuesPanel-C-x3I012.js +0 -117
  300. package/dist/ParagraphEditor-BVjOwwHx.js +0 -797
  301. package/dist/SavedBlocksBrowserModal-DbmIS5uK.js +0 -360
  302. package/dist/TemplateScoringPanel-ynbGl-sr.js +0 -273
  303. package/dist/TemplateSettings-Bi01S3H3.js +0 -246
  304. package/dist/ToggleSwitch-Ozc7YU38.js +0 -102
  305. package/dist/Toolbar-B-2lO0I8.js +0 -3156
  306. package/dist/WrapperBlock-D0qgNqjD.js +0 -45
  307. package/dist/cdn/chunks/AiChatSidebar-Dk0rJBQN.js +0 -205
  308. package/dist/cdn/chunks/AiChatSidebar-Dk0rJBQN.js.map +0 -1
  309. package/dist/cdn/chunks/AiFeatureMenu-B7b0w8ZS.js +0 -57
  310. package/dist/cdn/chunks/AiFeatureMenu-B7b0w8ZS.js.map +0 -1
  311. package/dist/cdn/chunks/CloudHeaderExtras-B4fhuwc_.js +0 -60
  312. package/dist/cdn/chunks/CloudHeaderExtras-B4fhuwc_.js.map +0 -1
  313. package/dist/cdn/chunks/CloudPanels-awqHfJqC.js.map +0 -1
  314. package/dist/cdn/chunks/CollaboratorBar-CS0ivqkr.js +0 -52
  315. package/dist/cdn/chunks/CollaboratorBar-CS0ivqkr.js.map +0 -1
  316. package/dist/cdn/chunks/CommentsPanel-CbzxwsyI.js +0 -20
  317. package/dist/cdn/chunks/CommentsSidebar-DWPHZuQm.js +0 -470
  318. package/dist/cdn/chunks/DesignReferenceSidebar-BW9cHnA9.js +0 -229
  319. package/dist/cdn/chunks/DesignReferenceSidebar-BW9cHnA9.js.map +0 -1
  320. package/dist/cdn/chunks/IssuesPanel-cXf9ywA4.js +0 -100
  321. package/dist/cdn/chunks/IssuesPanel-cXf9ywA4.js.map +0 -1
  322. package/dist/cdn/chunks/LogicTagInsertButton-BMB9vShs.js.map +0 -1
  323. package/dist/cdn/chunks/MediaEditModal-zXfcArr4.js.map +0 -1
  324. package/dist/cdn/chunks/MediaPanels-Cp4XB_dH.js +0 -45
  325. package/dist/cdn/chunks/ParagraphEditor-D4aq9eeC.js +0 -632
  326. package/dist/cdn/chunks/ParagraphEditor-D4aq9eeC.js.map +0 -1
  327. package/dist/cdn/chunks/SavedBlocksPanels-BhEOMzEQ.js +0 -38
  328. package/dist/cdn/chunks/TemplateScoringPanel-BrWqJCSP.js +0 -237
  329. package/dist/cdn/chunks/TemplateScoringPanel-BrWqJCSP.js.map +0 -1
  330. package/dist/cdn/chunks/TemplateSettings-BkkWTDHD.js +0 -208
  331. package/dist/cdn/chunks/TestEmailPanel-DxrKuctP.js +0 -35
  332. package/dist/cdn/chunks/TitleEditor-CsZiG3TT.js +0 -199
  333. package/dist/cdn/chunks/ToggleSwitch-BB-bQADJ.js +0 -104
  334. package/dist/cdn/chunks/ToggleSwitch-BB-bQADJ.js.map +0 -1
  335. package/dist/cdn/chunks/Toolbar-C_x2TfFk.js.map +0 -1
  336. package/dist/cdn/chunks/VersionHistoryPanels-DXSqmaLS.js +0 -48
  337. package/dist/cdn/chunks/WrapperBlock-gG_Bleug.js +0 -47
  338. package/dist/cdn/chunks/blockTypeIcons-HrMJDfVg.js +0 -22
  339. package/dist/cdn/chunks/ca-CbNzJM3I.js.map +0 -1
  340. package/dist/cdn/chunks/cloud-BHClP3e2.js +0 -1736
  341. package/dist/cdn/chunks/cloud-BHClP3e2.js.map +0 -1
  342. package/dist/cdn/chunks/createCloudRuntime-Vd0N4elZ.js +0 -400
  343. package/dist/cdn/chunks/createCloudRuntime-Vd0N4elZ.js.map +0 -1
  344. package/dist/cdn/chunks/de-DMquBpZM.js.map +0 -1
  345. package/dist/cdn/chunks/de-mMY5yQJu.js +0 -93
  346. package/dist/cdn/chunks/de-mMY5yQJu.js.map +0 -1
  347. package/dist/cdn/chunks/draggable-DrsNwZuB.js.map +0 -1
  348. package/dist/cdn/chunks/en-C8Mp71sO.js.map +0 -1
  349. package/dist/cdn/chunks/en-ChVeGQBY.js +0 -93
  350. package/dist/cdn/chunks/en-ChVeGQBY.js.map +0 -1
  351. package/dist/cdn/chunks/en-eWpiXyZu.js +0 -1
  352. package/dist/cdn/chunks/es-Byq4tthI.js.map +0 -1
  353. package/dist/cdn/chunks/fr-B3j35HEw.js.map +0 -1
  354. package/dist/cdn/chunks/icons-aTYwH5-g.js.map +0 -1
  355. package/dist/cdn/chunks/ja-D7txAuGS.js.map +0 -1
  356. package/dist/cdn/chunks/keys-HI-INbkz.js +0 -12
  357. package/dist/cdn/chunks/keys-HI-INbkz.js.map +0 -1
  358. package/dist/cdn/chunks/logger-ByvdoAwq.js.map +0 -1
  359. package/dist/cdn/chunks/nl-ClJ3BY3F.js.map +0 -1
  360. package/dist/cdn/chunks/pt-BR-CoCwRUi0.js +0 -93
  361. package/dist/cdn/chunks/pt-BR-CoCwRUi0.js.map +0 -1
  362. package/dist/cdn/chunks/pt-BR-DibcXcmv.js.map +0 -1
  363. package/dist/cdn/chunks/pusher-C8DeiO2X.js.map +0 -1
  364. package/dist/cdn/chunks/socialIcons-C_lnkpG6.js +0 -1279
  365. package/dist/cdn/chunks/socialIcons-C_lnkpG6.js.map +0 -1
  366. package/dist/cdn/chunks/src-DYCDeBDM.js.map +0 -1
  367. package/dist/cdn/chunks/src-DlFlC9Tt.js +0 -1272
  368. package/dist/cdn/chunks/src-DlFlC9Tt.js.map +0 -1
  369. package/dist/cdn/chunks/src-dZ4D_tuP.js.map +0 -1
  370. package/dist/cdn/chunks/timeouts-Cv2jvusx.js +0 -6
  371. package/dist/cdn/chunks/timeouts-Cv2jvusx.js.map +0 -1
  372. package/dist/cdn/chunks/tiptap-BPigZk5G.js.map +0 -1
  373. package/dist/cdn/chunks/useAliveFlag-DCB96vzR.js +0 -12
  374. package/dist/cdn/chunks/useAliveFlag-DCB96vzR.js.map +0 -1
  375. package/dist/cdn/chunks/useEditorCore-Bb2UcB20.js +0 -2602
  376. package/dist/cdn/chunks/useEditorCore-Bb2UcB20.js.map +0 -1
  377. package/dist/cdn/chunks/useEditorRoot-CTc6O8al.js +0 -10
  378. package/dist/cdn/chunks/useScrollToBlock-uUa601I4.js +0 -21
  379. package/dist/cdn/chunks/useScrollToBlock-uUa601I4.js.map +0 -1
  380. package/dist/cloud-B5xwm_4X.js +0 -1689
  381. package/dist/copy-BEcsAlfB.js +0 -19
  382. package/dist/createCloudRuntime-zNPkF6T9.js +0 -398
  383. package/dist/de-mMY5yQJu.js +0 -91
  384. package/dist/dist-DAAJogrx.js +0 -407
  385. package/dist/en-B0FUfNwz.js +0 -1
  386. package/dist/en-ChVeGQBY.js +0 -91
  387. package/dist/image-up-CM_HC0Dx.js +0 -27
  388. package/dist/keys-BKFq19a2.js +0 -10
  389. package/dist/plus-8cDvoCjZ.js +0 -14
  390. package/dist/pt-BR-CoCwRUi0.js +0 -91
  391. package/dist/shield-check-uDAwur5D.js +0 -14
  392. package/dist/socialIcons-PTiwhLoC.js +0 -1359
  393. package/dist/timeouts-Cv2jvusx.js +0 -4
  394. package/dist/upload-CtNOI6J2.js +0 -21
  395. package/dist/useAliveFlag-Dd06mRxe.js +0 -10
  396. package/dist/useScrollToBlock-CXmcHQQN.js +0 -47
@@ -1,2602 +0,0 @@
1
- import { A as e, B as t, E as n, F as r, H as i, I as a, K as o, N as s, P as c, Q as l, R as u, S as d, U as f, Y as p, at as m, b as h, c as g, ct as _, et as v, f as y, g as b, h as x, it as S, j as C, k as w, l as T, lt as E, m as D, p as O, q as k, rt as A, s as j, t as M, u as N, ut as P, w as F, x as I, y as L } from "./draggable-DrsNwZuB.js";
2
- import { $ as R, At as z, B, Dt as V, Et as H, F as ee, Ft as U, G as W, H as te, I as ne, K as re, L as ie, M as ae, Mt as oe, N as se, Nt as ce, P as le, Pt as ue, Q as de, R as fe, St as pe, T as me, U as he, W as ge, X as _e, Y as ve, _ as ye, a as be, b as xe, bt as Se, d as Ce, et as we, f as Te, g as Ee, h as De, ht as Oe, i as ke, j as Ae, jt as je, l as Me, m as Ne, n as Pe, nt as Fe, o as Ie, p as Le, r as Re, s as ze, u as Be, vt as Ve, x as He, yt as Ue, z as We } from "./src-DYCDeBDM.js";
3
- import { A as Ge, C as G, F as Ke, I as qe, M as Je, P as Ye, S as Xe, _ as Ze, a as Qe, g as $e, h as et, j as tt, l as nt, n as rt, p as it, t as at, u as ot, x as st, y as ct } from "./socialIcons-C_lnkpG6.js";
4
- import { _ as lt, h as ut, v as dt, y as ft } from "./dist-CjL6JHML.js";
5
- import { a as pt, c as mt, i as ht } from "./dist-MNQYSEWU.js";
6
- import { $ as K, A as gt, B as _t, C as vt, D as yt, E as bt, F as xt, G as St, H as Ct, I as wt, J as Tt, K as Et, L as Dt, M as Ot, N as kt, O as q, P as At, Q as jt, R as Mt, S as Nt, T as Pt, V as Ft, X as It, Y as Lt, Z as Rt, _ as zt, a as Bt, b as Vt, c as Ht, d as Ut, f as Wt, g as J, h as Gt, j as Kt, k as qt, l as Jt, m as Yt, n as Xt, o as Zt, p as Qt, q as $t, r as en, s as tn, v as Y, w as nn, x as rn, y as an, z as on } from "./keys-HI-INbkz.js";
7
- import { t as X } from "./useI18n-DUlyyIJJ.js";
8
- import { t as Z } from "./logger-ByvdoAwq.js";
9
- import { i as sn, r as cn, s as ln, t as un } from "./usePopoverPosition-IbaW6-Ao.js";
10
- import { r as dn, t as fn } from "./templateSettingsFields-YCFVBVYh.js";
11
- import { At as pn, Et as mn, Ht as hn, Ot as gn, U as _n, Vt as vn, Z as yn, _t as bn, bt as xn, d as Sn, f as Cn, j as wn, mt as Tn, nt as En, o as Dn, y as On } from "./icons-aTYwH5-g.js";
12
- import { t as kn } from "./LoadingTrack-DbH97JR9.js";
13
- import { t as An } from "./_plugin-vue_export-helper-B3ysoDQm.js";
14
- import { t as jn } from "./useEditorRoot-CTc6O8al.js";
15
- import "./useCloudI18n-BBF4waXO.js";
16
- import { t as Mn } from "./useMergeTag-Dg9pE85U.js";
17
- import { t as Nn } from "./useLogicTag-HsyUCQtl.js";
18
- //#region src/utils/activeEditorTracker.ts
19
- var Pn = /* @__PURE__ */ new Set(), Q = 0, Fn = 0;
20
- function In() {
21
- let e = ++Fn;
22
- return Pn.add(e), Q === 0 && (Q = e), {
23
- id: e,
24
- isActive: () => Pn.size <= 1 || Q === e,
25
- claim: () => {
26
- Q = e;
27
- },
28
- dispose: () => {
29
- if (Pn.delete(e), Q === e) {
30
- let e = Array.from(Pn);
31
- Q = e[e.length - 1] ?? 0;
32
- }
33
- }
34
- };
35
- }
36
- //#endregion
37
- //#region src/composables/usePreviewResolution.ts
38
- var Ln = 500;
39
- function Rn(e) {
40
- let n = typeof e.resolvePreview == "function", r = l(null), i = l(!1), a = l(!1), o = 0, s = null;
41
- function c() {
42
- s !== null && (clearTimeout(s), s = null);
43
- }
44
- async function u() {
45
- let t = e.resolvePreview;
46
- if (!t) return;
47
- let n = ++o;
48
- i.value = !0;
49
- let s = {
50
- content: ve(e.getContent()),
51
- ...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
52
- };
53
- try {
54
- let e = await t(s);
55
- if (n !== o) return;
56
- if (!Pe(e)) {
57
- a.value = !0;
58
- return;
59
- }
60
- r.value = e, a.value = !1;
61
- } catch {
62
- if (n !== o) return;
63
- a.value = !0;
64
- } finally {
65
- n === o && (i.value = !1);
66
- }
67
- }
68
- function d() {
69
- n && (c(), r.value === null ? u() : s = setTimeout(() => {
70
- s = null, u();
71
- }, Ln));
72
- }
73
- return t(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
74
- e ? d() : (c(), o++, i.value = !1, r.value = null, a.value = !1);
75
- }, { immediate: !0 }), p(() => {
76
- c(), o++;
77
- }), {
78
- isConfigured: n,
79
- content: y(() => r.value ?? e.getContent()),
80
- isResolving: i,
81
- isInitialResolve: y(() => i.value && r.value === null),
82
- hasFailed: a,
83
- supersedesSamples: y(() => n)
84
- };
85
- }
86
- //#endregion
87
- //#region src/composables/useMergeTagPicker.ts
88
- function zn() {
89
- let e = l(!1), t = l([]), n = l(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() && p(() => {
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
- //#endregion
118
- //#region src/composables/useLogicTagPicker.ts
119
- function Bn() {
120
- let e = l(!1), t = l([]), n = l([]), r = null;
121
- function i(i, a) {
122
- if (r) {
123
- let e = r;
124
- r = null, e(null);
125
- }
126
- return t.value = i, n.value = a, e.value = !0, new Promise((e) => {
127
- r = e;
128
- });
129
- }
130
- function a(i) {
131
- let a = r;
132
- r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
133
- }
134
- return o() && p(() => {
135
- if (r) {
136
- let e = r;
137
- r = null, e(null);
138
- }
139
- e.value = !1, t.value = [], n.value = [];
140
- }), {
141
- isOpen: e,
142
- tags: t,
143
- pairs: n,
144
- open: i,
145
- resolve: a
146
- };
147
- }
148
- //#endregion
149
- //#region src/composables/useTemplateLint.ts
150
- function Vn(e) {
151
- return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
152
- }
153
- function Hn(e) {
154
- let n = l([]), r = l(!1), i = l(!1), a = v(null), o = Vn(e.options), s = null, c = !1;
155
- o || u();
156
- async function u() {
157
- try {
158
- let t = await import("./src-DlFlC9Tt.js");
159
- if (c) return;
160
- a.value = { lintTemplate: t.lintTemplate }, r.value = !0, d(), s = ft(e.content, d, {
161
- debounce: e.debounce ?? 500,
162
- deep: !0
163
- });
164
- } catch {
165
- if (c) return;
166
- i.value = !0;
167
- }
168
- }
169
- function d() {
170
- a.value && (n.value = a.value.lintTemplate(e.content.value, e.options));
171
- }
172
- let f = t(() => e.options, () => {
173
- a.value && d();
174
- }, { deep: !0 });
175
- function p(t) {
176
- t.fix && t.fix.apply({
177
- updateBlock: e.updateBlock,
178
- updateSettings: e.updateSettings,
179
- removeBlock: e.removeBlock
180
- });
181
- }
182
- function m() {
183
- c = !0, s?.(), f();
184
- }
185
- return {
186
- issues: n,
187
- ready: r,
188
- unavailable: i,
189
- applyFix: p,
190
- destroy: m
191
- };
192
- }
193
- //#endregion
194
- //#region src/composables/useKeyboardReorder.ts
195
- function Un(e, t, n = []) {
196
- let r = l(null), i = l(""), a = null;
197
- function o(t) {
198
- let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
199
- if (r !== -1) return {
200
- index: r,
201
- total: n.length
202
- };
203
- for (let e of n) {
204
- if (e.type !== "section") continue;
205
- let n = e;
206
- for (let e = 0; e < n.children.length; e++) {
207
- let r = n.children[e], i = r.findIndex((e) => e.id === t);
208
- if (i !== -1) return {
209
- index: i,
210
- total: r.length,
211
- sectionId: n.id,
212
- columnIndex: e
213
- };
214
- }
215
- }
216
- return null;
217
- }
218
- function s(r) {
219
- let i = o(r);
220
- if (!i) return "";
221
- let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
222
- return a ? Ze(a, t.t, n) : "";
223
- }
224
- function c(t, n) {
225
- return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
226
- }
227
- function u(e) {
228
- i.value = "", queueMicrotask(() => {
229
- i.value = e;
230
- });
231
- }
232
- function d(e) {
233
- return r.value === e;
234
- }
235
- function f(e) {
236
- let n = o(e);
237
- n && (r.value = e, a = n, u(t.format(t.t.blockActions.lifted, {
238
- block: s(e),
239
- position: String(n.index + 1),
240
- total: String(n.total)
241
- })));
242
- }
243
- function p(n, r) {
244
- let i = o(n);
245
- if (!i) return;
246
- let a = i.index + r;
247
- a < 0 || a >= i.total || (e.moveBlock(n, a, i.sectionId, i.columnIndex), u(t.format(t.t.blockActions.moved, {
248
- block: s(n),
249
- position: String(a + 1),
250
- total: String(i.total)
251
- })));
252
- }
253
- function m(e) {
254
- p(e, -1);
255
- }
256
- function h(e) {
257
- p(e, 1);
258
- }
259
- function g(e) {
260
- let n = o(e);
261
- n && u(t.format(t.t.blockActions.dropped, {
262
- block: s(e),
263
- position: String(n.index + 1),
264
- total: String(n.total)
265
- })), r.value = null, a = null;
266
- }
267
- function _() {
268
- let n = r.value;
269
- if (n && a) {
270
- let r = o(n);
271
- r && (r && (r.sectionId !== a.sectionId || r.columnIndex !== a.columnIndex) || r && r.index !== a.index) && e.moveBlock(n, a.index, a.sectionId, a.columnIndex), u(t.format(t.t.blockActions.cancelled, {
272
- block: s(n),
273
- position: String(a.index + 1)
274
- }));
275
- }
276
- r.value = null, a = null;
277
- }
278
- return {
279
- liftedBlockId: r,
280
- announcement: i,
281
- isLifted: d,
282
- lift: f,
283
- cancel: _,
284
- moveUp: m,
285
- moveDown: h,
286
- drop: g
287
- };
288
- }
289
- //#endregion
290
- //#region src/composables/useUiTheme.ts
291
- function Wn(e) {
292
- let t = mt("(prefers-color-scheme: dark)");
293
- return { resolvedTheme: y(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
294
- }
295
- //#endregion
296
- //#region src/composables/useThemeStyles.ts
297
- var Gn = {
298
- bg: "--tpl-bg",
299
- bgElevated: "--tpl-bg-elevated",
300
- bgHover: "--tpl-bg-hover",
301
- bgActive: "--tpl-bg-active",
302
- border: "--tpl-border",
303
- borderLight: "--tpl-border-light",
304
- text: "--tpl-text",
305
- textMuted: "--tpl-text-muted",
306
- textDim: "--tpl-text-dim",
307
- primary: "--tpl-primary",
308
- primaryHover: "--tpl-primary-hover",
309
- primaryLight: "--tpl-primary-light",
310
- secondary: "--tpl-secondary",
311
- secondaryHover: "--tpl-secondary-hover",
312
- secondaryLight: "--tpl-secondary-light",
313
- success: "--tpl-success",
314
- successLight: "--tpl-success-light",
315
- warning: "--tpl-warning",
316
- warningLight: "--tpl-warning-light",
317
- danger: "--tpl-danger",
318
- dangerLight: "--tpl-danger-light",
319
- canvasBg: "--tpl-canvas-bg"
320
- };
321
- function Kn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
322
- return { themeStyles: y(() => {
323
- let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
324
- if (a) for (let [e, t] of Object.entries(Gn)) {
325
- let n = a[e];
326
- n && (r[t] = n);
327
- }
328
- return n && Object.assign(r, n()), r;
329
- }) };
330
- }
331
- //#endregion
332
- //#region src/composables/useBlockRegistry.ts
333
- function qn() {
334
- let e = v(/* @__PURE__ */ new Map());
335
- function t(t, n) {
336
- e.value.set(t, n), S(e);
337
- }
338
- function n(t, n) {
339
- let r = `custom:${t.type}`;
340
- e.value.set(r, {
341
- component: n,
342
- createBlock: () => le(t),
343
- definition: t
344
- }), S(e);
345
- }
346
- function r(t) {
347
- if (t.type === "custom") {
348
- let n = `custom:${t.customType}`;
349
- return e.value.get(n)?.component;
350
- }
351
- return e.value.get(t.type)?.component;
352
- }
353
- function i(t) {
354
- return e.value.get(t)?.createBlock();
355
- }
356
- function a(t) {
357
- let n = `custom:${t}`;
358
- return e.value.get(n)?.definition;
359
- }
360
- function o(e) {
361
- 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>`;
362
- }
363
- async function s(e) {
364
- let t = a(e.customType);
365
- if (!t) return o("Block definition not found");
366
- try {
367
- let { Liquid: n } = await import("./liquid.browser-Bbt17cVz.js");
368
- return await new n({
369
- strictVariables: !1,
370
- strictFilters: !1
371
- }).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
- //#endregion
390
- //#region src/composables/useCustomBlockStylesheets.ts
391
- function Jn(e, t) {
392
- return y(() => {
393
- let n = Yn(e.value.blocks);
394
- if (n.size === 0) return [];
395
- let r = /* @__PURE__ */ new Set(), i = [];
396
- for (let e of n) {
397
- let n = t.getDefinition(e)?.stylesheet;
398
- if (!n) continue;
399
- let a = n.trim();
400
- a === "" || r.has(a) || (r.add(a), i.push(a));
401
- }
402
- return i;
403
- });
404
- }
405
- function Yn(e) {
406
- let t = /* @__PURE__ */ new Set();
407
- return Xn(e, t), t;
408
- }
409
- function Xn(e, t) {
410
- for (let n of e) if (Fe(n)) t.add(n.customType);
411
- else if (n.type === "section") {
412
- let e = n.children;
413
- if (!e) continue;
414
- for (let n of e) Xn(n, t);
415
- } else Oe(n) && Xn(n.children, t);
416
- }
417
- //#endregion
418
- //#region src/utils/registerBuiltInBlocks.ts
419
- var Zn = [
420
- {
421
- type: "section",
422
- createBlock: B
423
- },
424
- {
425
- type: "title",
426
- createBlock: W
427
- },
428
- {
429
- type: "paragraph",
430
- createBlock: We
431
- },
432
- {
433
- type: "image",
434
- createBlock: ie
435
- },
436
- {
437
- type: "button",
438
- createBlock: ae
439
- },
440
- {
441
- type: "divider",
442
- createBlock: ee
443
- },
444
- {
445
- type: "video",
446
- createBlock: re
447
- },
448
- {
449
- type: "social",
450
- createBlock: te
451
- },
452
- {
453
- type: "menu",
454
- createBlock: fe
455
- },
456
- {
457
- type: "table",
458
- createBlock: ge
459
- },
460
- {
461
- type: "spacer",
462
- createBlock: he
463
- },
464
- {
465
- type: "html",
466
- createBlock: ne
467
- },
468
- {
469
- type: "countdown",
470
- createBlock: se
471
- }
472
- ];
473
- function Qn(e, t) {
474
- for (let n of Zn) {
475
- let r = t[n.type];
476
- r && e.registerBuiltIn(n.type, {
477
- component: r,
478
- createBlock: n.createBlock
479
- });
480
- }
481
- }
482
- //#endregion
483
- //#region src/utils/resolveHtmlBlockPreview.ts
484
- function $n(e) {
485
- return typeof e == "boolean" ? e : e?.enabled ?? !1;
486
- }
487
- //#endregion
488
- //#region src/utils/collectOffPaletteDefaults.ts
489
- function er(e) {
490
- return typeof e == "object" && !!e && !Array.isArray(e);
491
- }
492
- function tr(e, t, n) {
493
- let r = new Set(e.map((e) => cn(e))), i = [], a = (e, t) => {
494
- for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(cn(o)) && i.push(`${t}.${n}: ${o}`) : er(o) && a(o, `${t}.${n}`);
495
- }, o = t;
496
- for (let [e, t] of Object.entries(de)) {
497
- let n = o?.[e];
498
- a({
499
- ...t,
500
- ...er(n) ? n : {}
501
- }, e);
502
- }
503
- return a({
504
- ...R,
505
- ...n ?? {}
506
- }, "template"), i;
507
- }
508
- //#endregion
509
- //#region src/utils/localizedBlockDefaults.ts
510
- function nr(e) {
511
- return {
512
- title: { content: `<p>${e.blockDefaults.title}</p>` },
513
- paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
514
- button: { text: e.blockDefaults.button }
515
- };
516
- }
517
- //#endregion
518
- //#region src/i18n/index.ts
519
- var rr = /* #__PURE__ */ Object.assign({
520
- "./locales/ca.ts": () => import("./ca-CbNzJM3I.js"),
521
- "./locales/de.ts": () => import("./de-DMquBpZM.js"),
522
- "./locales/en.ts": () => import("./en-C8Mp71sO.js"),
523
- "./locales/es.ts": () => import("./es-Byq4tthI.js"),
524
- "./locales/fr.ts": () => import("./fr-B3j35HEw.js"),
525
- "./locales/ja.ts": () => import("./ja-D7txAuGS.js"),
526
- "./locales/nl.ts": () => import("./nl-ClJ3BY3F.js"),
527
- "./locales/pt-BR.ts": () => import("./pt-BR-DibcXcmv.js")
528
- }), ir = /* #__PURE__ */ Object.assign({
529
- "./locales/cloud/de.ts": () => import("./de-mMY5yQJu.js"),
530
- "./locales/cloud/en.ts": () => import("./en-ChVeGQBY.js"),
531
- "./locales/cloud/pt-BR.ts": () => import("./pt-BR-CoCwRUi0.js")
532
- });
533
- function ar(e) {
534
- return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
535
- }
536
- var or = ar(rr), sr = ar(ir);
537
- function cr(e) {
538
- return e.trim().replace(/_/g, "-").toLowerCase();
539
- }
540
- function lr(e, t) {
541
- let n = cr(e);
542
- return t.find((e) => cr(e) === n);
543
- }
544
- function ur(e) {
545
- return cr(e).split("-")[0];
546
- }
547
- function dr(e, t) {
548
- return lr(e, t) ?? lr(ur(e), t);
549
- }
550
- function fr(e, t) {
551
- return dr(e, t) ?? "en";
552
- }
553
- async function pr(e) {
554
- let t = rr[`./locales/${fr(e, or)}.ts`];
555
- return (await t()).default;
556
- }
557
- async function mr(e) {
558
- let t = ir[`./locales/cloud/${fr(e, sr)}.ts`];
559
- return (await t()).default;
560
- }
561
- function hr(e) {
562
- return dr(e, or) !== void 0;
563
- }
564
- function gr(e) {
565
- return dr(e, sr) !== void 0;
566
- }
567
- function _r() {
568
- return [...or];
569
- }
570
- function vr() {
571
- return [...sr];
572
- }
573
- //#endregion
574
- //#region src/i18n/contentDefaults.ts
575
- var $ = {
576
- en: {
577
- video: "Video",
578
- days: "Days",
579
- hours: "Hours",
580
- minutes: "Minutes",
581
- seconds: "Seconds",
582
- expired: "This offer has expired"
583
- },
584
- de: {
585
- video: "Video",
586
- days: "Tage",
587
- hours: "Stunden",
588
- minutes: "Minuten",
589
- seconds: "Sekunden",
590
- expired: "Dieses Angebot ist abgelaufen"
591
- },
592
- es: {
593
- video: "Vídeo",
594
- days: "Días",
595
- hours: "Horas",
596
- minutes: "Minutos",
597
- seconds: "Segundos",
598
- expired: "Esta oferta ha expirado"
599
- },
600
- fr: {
601
- video: "Vidéo",
602
- days: "Jours",
603
- hours: "Heures",
604
- minutes: "Minutes",
605
- seconds: "Secondes",
606
- expired: "Cette offre a expiré"
607
- },
608
- nl: {
609
- video: "Video",
610
- days: "Dagen",
611
- hours: "Uren",
612
- minutes: "Minuten",
613
- seconds: "Seconden",
614
- expired: "Deze aanbieding is verlopen"
615
- },
616
- "pt-BR": {
617
- video: "Vídeo",
618
- days: "Dias",
619
- hours: "Horas",
620
- minutes: "Minutos",
621
- seconds: "Segundos",
622
- expired: "Esta oferta expirou"
623
- },
624
- ca: {
625
- video: "Vídeo",
626
- days: "Dies",
627
- hours: "Hores",
628
- minutes: "Minuts",
629
- seconds: "Segons",
630
- expired: "Aquesta oferta ha caducat"
631
- },
632
- ja: {
633
- video: "動画",
634
- days: "日",
635
- hours: "時間",
636
- minutes: "分",
637
- seconds: "秒",
638
- expired: "このオファーは終了しました"
639
- }
640
- }, yr = new Map(Object.keys($).map((e) => [e.toLowerCase(), e]));
641
- function br(e) {
642
- if (!e) return $.en;
643
- let t = e.trim().replace(/_/g, "-").toLowerCase(), n = yr.get(t);
644
- if (n) return $[n];
645
- let r = yr.get(ur(t));
646
- return r ? $[r] : $.en;
647
- }
648
- function xr(e) {
649
- let t = br(e);
650
- return {
651
- video: { alt: t.video },
652
- countdown: {
653
- labelDays: t.days,
654
- labelHours: t.hours,
655
- labelMinutes: t.minutes,
656
- labelSeconds: t.seconds,
657
- expiredMessage: t.expired
658
- }
659
- };
660
- }
661
- //#endregion
662
- //#region src/utils/collectColorFieldIssues.ts
663
- function Sr(e, t) {
664
- let n = [], r = (r, i) => {
665
- let a = $e(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
666
- if (a.invalidPresets.length > 0 && n.push({
667
- id: s("invalid-presets"),
668
- 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." : "")
669
- }), a.emptyPresets && n.push({
670
- id: s("empty-presets"),
671
- 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.`
672
- }), a.allowCustomIgnored && n.push({
673
- id: s("allow-custom-ignored"),
674
- message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
675
- }), !a.allowCustom && a.presets.length > 0) {
676
- let e = r.default ?? "", t = new Set(a.presets.map((e) => cn(e)));
677
- e !== "" && !t.has(cn(e)) && n.push({
678
- id: s("off-palette-default"),
679
- 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.`
680
- });
681
- }
682
- };
683
- for (let t of e.fields) if (t.type === "color") r(t, t.key);
684
- else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
685
- return n;
686
- }
687
- //#endregion
688
- //#region src/utils/keyboardShortcuts.ts
689
- function Cr(e) {
690
- for (let t of e.composedPath()) {
691
- if (!(t instanceof HTMLElement)) continue;
692
- if (t.isContentEditable) return !0;
693
- let e = t.tagName;
694
- if (e === "INPUT" || e === "TEXTAREA" || e === "SELECT") return !0;
695
- }
696
- return !1;
697
- }
698
- function wr(e, t) {
699
- let n = e.metaKey || e.ctrlKey;
700
- if (n && e.key.toLowerCase() === "s") e.preventDefault(), t.onSave?.();
701
- else if (n && e.key.toLowerCase() === "z") {
702
- if (Cr(e)) return;
703
- e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
704
- } else {
705
- if (t.isPicking?.() && !Cr(e)) {
706
- if (e.key === "Escape") {
707
- e.preventDefault(), t.onCancelPick?.();
708
- return;
709
- }
710
- if (e.key === "Enter") {
711
- e.preventDefault(), t.onConfirmPick?.();
712
- return;
713
- }
714
- if (e.key === "Delete" || e.key === "Backspace") {
715
- e.preventDefault();
716
- return;
717
- }
718
- }
719
- e.key === "Escape" ? t.selectBlock(null) : (e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !Cr(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
720
- }
721
- }
722
- //#endregion
723
- //#region src/utils/blockComponentResolver.ts
724
- function Tr(e, t) {
725
- let n = { fontFamily: t(e.fontFamily) };
726
- 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;
727
- }
728
- function Er(e, t, n) {
729
- if (t) {
730
- let n = t.getComponent(e);
731
- if (n) return n;
732
- }
733
- return n[e.type] ?? null;
734
- }
735
- var Dr = "--tpl-block-bg-layer", Or = "tpl-has-bg-image";
736
- function kr(e, t) {
737
- if (t === null) return {};
738
- let n = V(e);
739
- if (n === null) return {};
740
- let r = t?.trim(), i = r ? H(r) : n.url;
741
- return {
742
- backgroundImage: `url("${i}")`,
743
- backgroundSize: n.size,
744
- backgroundPosition: n.position,
745
- backgroundRepeat: n.repeat,
746
- [Dr]: `url("${i}") ${n.position} / ${n.size} ${n.repeat}`
747
- };
748
- }
749
- function Ar(e) {
750
- return e && Dr in e ? Or : void 0;
751
- }
752
- var jr = {
753
- top: "flex-start",
754
- middle: "center",
755
- bottom: "flex-end"
756
- };
757
- function Mr(e, t) {
758
- let n = typeof e.height == "number" ? { minHeight: `${e.height}px` } : t !== void 0 && e.aspectRatio !== null ? { minHeight: `${Nr(t, e.aspectRatio)}px` } : { aspectRatio: `1 / ${e.aspectRatio ?? 1}` };
759
- return {
760
- display: "flex",
761
- flexDirection: "column",
762
- justifyContent: jr[e.verticalAlign],
763
- boxSizing: "border-box",
764
- ...n
765
- };
766
- }
767
- function Nr(e, t) {
768
- return Math.max(1, Math.round(Math.max(1, Math.round(e)) * t));
769
- }
770
- function Pr(e, t = {}) {
771
- if (e.type === "wrapper") return {};
772
- let { padding: n, backgroundColor: r } = e.styles, i = {
773
- padding: `${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`,
774
- backgroundColor: r || "transparent"
775
- };
776
- if ((e.type === "paragraph" || e.type === "title") && (i["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? je.paragraphGap : je.paragraphGap}px`), e.type === "section") {
777
- let n = U(e.borderRadius);
778
- n !== null && (i.borderRadius = n);
779
- let r = pe(e);
780
- r?.applied && e.backgroundImage ? (Object.assign(i, Mr(r, t.heroBoxWidth)), Object.assign(i, kr({
781
- ...e.backgroundImage,
782
- size: "cover",
783
- repeat: !1
784
- }, t.backgroundImageUrl))) : (Object.assign(i, Ir(e.border)), Object.assign(i, kr(e.backgroundImage, t.backgroundImageUrl)));
785
- }
786
- return i;
787
- }
788
- function Fr(e, t, n, r) {
789
- return e.type === "section" ? Pr(e, {
790
- backgroundImageUrl: st(t, e.backgroundImage, n),
791
- heroBoxWidth: r
792
- }) : Pr(e);
793
- }
794
- function Ir(e) {
795
- let t = {};
796
- for (let [n, r] of Object.entries(ue(e))) t[n.replace(/-(\w)/g, (e, t) => t.toUpperCase())] = r;
797
- return t;
798
- }
799
- function Lr(e, t = {}) {
800
- if (e.type !== "section" || !e.wrapper) return null;
801
- let n = e.wrapper, r = {};
802
- 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`);
803
- let i = U(n.borderRadius);
804
- return i !== null && (r.borderRadius = i), Object.assign(r, kr(n.backgroundImage, t.backgroundImageUrl)), r;
805
- }
806
- function Rr(e, t = {}) {
807
- if (e.type !== "wrapper") return null;
808
- let n = {};
809
- if (e.styles.backgroundColor && (n.backgroundColor = e.styles.backgroundColor), e.styles.padding) {
810
- let t = e.styles.padding;
811
- n.padding = `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;
812
- }
813
- return e.borderRadius && e.borderRadius > 0 && (n.borderRadius = `${e.borderRadius}px`), Object.assign(n, kr(e.backgroundImage, t.backgroundImageUrl)), n;
814
- }
815
- //#endregion
816
- //#region src/utils/mergeTagLabelSegments.ts
817
- function zr(e, t, n, r = !1) {
818
- if (!e) return [];
819
- let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
820
- for (; (s = i.exec(e)) !== null;) {
821
- s.index > o && a.push({
822
- type: "text",
823
- value: e.slice(o, s.index)
824
- });
825
- let i = s[0];
826
- if (Te(i, n)) {
827
- let e = r ? ze(i, t) : void 0;
828
- a.push(e === void 0 ? {
829
- type: "tag",
830
- value: Ie(i, t)
831
- } : {
832
- type: "text",
833
- value: e
834
- });
835
- } else Ce(i, n) ? a.push({
836
- type: "tag",
837
- value: be(i, n)
838
- }) : a.push({
839
- type: "text",
840
- value: i
841
- });
842
- o = s.index + i.length;
843
- }
844
- return o < e.length && a.push({
845
- type: "text",
846
- value: e.slice(o)
847
- }), a;
848
- }
849
- //#endregion
850
- //#region src/components/MergeTagPreviewText.vue
851
- var Br = d({
852
- name: "MergeTagPreviewText",
853
- props: { text: {
854
- type: String,
855
- required: !0
856
- } },
857
- setup(e) {
858
- let t = n(q, xt), r = n(At, Re.liquid), i = n(jt, null), a = y(() => zr(e.text, t.value, r, i?.value ?? !1));
859
- return () => a.value.map((e, t) => e.type === "tag" ? F("span", {
860
- key: t,
861
- class: "tpl-merge-tag-label"
862
- }, e.value) : e.value);
863
- }
864
- }), Vr = ["href"], Hr = /* @__PURE__ */ d({
865
- __name: "ButtonBlock",
866
- props: {
867
- block: {},
868
- viewport: {}
869
- },
870
- setup(e) {
871
- let t = e, n = K(Y, "ButtonBlock"), r = y(() => {
872
- let e = {
873
- display: "inline-block",
874
- padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
875
- backgroundColor: t.block.backgroundColor,
876
- color: t.block.textColor,
877
- fontSize: `${t.block.fontSize}px`,
878
- fontWeight: "bold",
879
- textDecoration: "none",
880
- borderRadius: typeof t.block.borderRadius == "number" ? `${t.block.borderRadius}px` : U(t.block.borderRadius) ?? "0px",
881
- textAlign: "center"
882
- };
883
- return Object.assign(e, Ir(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;
884
- }), i = y(() => ({ textAlign: t.block.align ?? "center" }));
885
- return (t, n) => (s(), b("div", { style: E(i.value) }, [O("a", {
886
- href: e.block.url || "#",
887
- style: E(r.value),
888
- class: "tpl:cursor-default",
889
- onClick: n[0] ||= T(() => {}, ["prevent"])
890
- }, [h(Br, { text: e.block.text }, null, 8, ["text"])], 12, Vr)], 4));
891
- }
892
- }), Ur = ["innerHTML"], Wr = [
893
- "src",
894
- "width",
895
- "height"
896
- ], Gr = /* @__PURE__ */ d({
897
- __name: "CustomBlockIcon",
898
- props: {
899
- icon: {},
900
- size: {}
901
- },
902
- setup(e) {
903
- let t = e, n = y(() => t.size ?? 20), r = y(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), i = y(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/")));
904
- return (t, a) => r.value ? (s(), b("span", {
905
- key: 0,
906
- class: "tpl:inline-flex tpl:items-center tpl:justify-center",
907
- style: E({
908
- width: `${n.value}px`,
909
- height: `${n.value}px`
910
- }),
911
- innerHTML: e.icon
912
- }, null, 12, Ur)) : i.value ? (s(), b("img", {
913
- key: 1,
914
- src: e.icon,
915
- width: n.value,
916
- height: n.value,
917
- class: "tpl:inline-block",
918
- alt: ""
919
- }, null, 8, Wr)) : (s(), D(m(vn), {
920
- key: 2,
921
- size: n.value,
922
- "stroke-width": 1.5
923
- }, null, 8, ["size"]));
924
- }
925
- }), Kr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
926
- function qr(e, n) {
927
- let r = jn(), i = null, a = null, o = null;
928
- function s() {
929
- return e.value ? Array.from(e.value.querySelectorAll(Kr)).filter((e) => e.offsetParent !== null) : [];
930
- }
931
- function c(e) {
932
- if (e.key !== "Tab") return;
933
- let t = s();
934
- if (t.length === 0) return;
935
- let n = t[0], i = t[t.length - 1];
936
- e.shiftKey ? r.activeElement === n && (e.preventDefault(), i.focus()) : r.activeElement === i && (e.preventDefault(), n.focus());
937
- }
938
- function l() {
939
- let t = a !== null || o !== null;
940
- t && u({ restoreFocus: !1 }), t || (i = r.activeElement), o = requestAnimationFrame(() => {
941
- o = null;
942
- let t = s();
943
- t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
944
- }), a = pt(e, "keydown", c);
945
- }
946
- function u(e = {}) {
947
- let t = e.restoreFocus !== !1;
948
- o !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(o), o = null), a?.(), a = null, t && i && i.focus && (i.focus(), i = null);
949
- }
950
- let d = t([n, e], ([e, t]) => {
951
- e && t ? l() : u();
952
- }, { flush: "post" });
953
- p(() => {
954
- d(), u();
955
- });
956
- }
957
- //#endregion
958
- //#region src/composables/useEmoji.ts
959
- function Jr() {
960
- let [e, n] = dt(!1), r = v([]), i = !1;
961
- p(() => {
962
- i = !0;
963
- }), t(e, async (e) => {
964
- if (e && r.value.length === 0) {
965
- let { emojiCategories: e } = await import("./emojiData-6m0DBh7O.js");
966
- if (i) return;
967
- r.value = e;
968
- }
969
- });
970
- function a() {
971
- n();
972
- }
973
- function o() {
974
- e.value = !1;
975
- }
976
- return {
977
- categories: r,
978
- isOpen: e,
979
- toggle: a,
980
- close: o
981
- };
982
- }
983
- //#endregion
984
- //#region src/composables/useFonts.ts
985
- var Yr = [
986
- {
987
- value: "Arial",
988
- label: "Arial"
989
- },
990
- {
991
- value: "Helvetica",
992
- label: "Helvetica"
993
- },
994
- {
995
- value: "Georgia",
996
- label: "Georgia"
997
- },
998
- {
999
- value: "Times New Roman",
1000
- label: "Times New Roman"
1001
- },
1002
- {
1003
- value: "Verdana",
1004
- label: "Verdana"
1005
- },
1006
- {
1007
- value: "Trebuchet MS",
1008
- label: "Trebuchet MS"
1009
- },
1010
- {
1011
- value: "Courier New",
1012
- label: "Courier New"
1013
- }
1014
- ], Xr = "Arial, sans-serif";
1015
- function Zr(e) {
1016
- if (e === void 0 || e === !0) return [...Yr];
1017
- if (e === !1) return [];
1018
- let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
1019
- for (let i of e) {
1020
- let e = i.toLowerCase(), a = Yr.find((t) => t.value.toLowerCase() === e);
1021
- 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: ${Yr.map((e) => e.value).join(", ")}.`));
1022
- }
1023
- return t;
1024
- }
1025
- function Qr(e) {
1026
- let t = l(e?.customFonts ?? []), n = l(!1), r = Zr(e?.builtIns), i = y(() => e?.defaultFallback ?? Xr), a = y(() => {
1027
- let e = [...r], n = t.value.map((e) => ({
1028
- value: e.name,
1029
- label: e.name,
1030
- isCustom: !0
1031
- })), i = [...e, ...n];
1032
- return i.sort((e, t) => e.label.localeCompare(t.label)), i;
1033
- });
1034
- function s(e) {
1035
- return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
1036
- }
1037
- let c = e?.defaultFont ?? Xr.split(",")[0].trim();
1038
- 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.`);
1039
- function u() {
1040
- if (e?.defaultFont && s(e.defaultFont)) {
1041
- let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
1042
- if (t) return t.value;
1043
- }
1044
- return Xr;
1045
- }
1046
- let d = y(() => u());
1047
- function f(e) {
1048
- return xe(e, {
1049
- customFonts: t.value,
1050
- defaultFallback: i.value
1051
- });
1052
- }
1053
- let m = [], h = !1;
1054
- async function g() {
1055
- if (t.value.length === 0) {
1056
- h || (n.value = !0);
1057
- return;
1058
- }
1059
- let e = t.value.map(async (e) => {
1060
- try {
1061
- if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
1062
- let t = document.createElement("link");
1063
- t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), m.push(t), await new Promise((n, r) => {
1064
- t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
1065
- });
1066
- } catch (t) {
1067
- Z.warn(`Failed to load custom font "${e.name}":`, t);
1068
- }
1069
- });
1070
- await Promise.allSettled(e), !h && (n.value = !0);
1071
- }
1072
- function _() {
1073
- for (let e of m) e.remove();
1074
- m.length = 0;
1075
- }
1076
- return o() && p(() => {
1077
- h = !0, _();
1078
- }), {
1079
- fonts: a,
1080
- defaultFont: d,
1081
- defaultFallback: i,
1082
- customFonts: t,
1083
- isLoaded: n,
1084
- loadCustomFonts: g,
1085
- cleanupFontLinks: _,
1086
- resolveFontFamily: f,
1087
- getDefaultFont: u
1088
- };
1089
- }
1090
- //#endregion
1091
- //#region src/utils/mergeTagNodeSpec.ts
1092
- function $r(e, t, n) {
1093
- return Ce(e, n) ? {
1094
- type: "logicMergeTagNode",
1095
- attrs: {
1096
- value: e,
1097
- keyword: be(e, n)
1098
- }
1099
- } : {
1100
- type: "mergeTagNode",
1101
- attrs: {
1102
- label: t,
1103
- value: e
1104
- }
1105
- };
1106
- }
1107
- //#endregion
1108
- //#region src/utils/insertLogicTag.ts
1109
- function ei(e) {
1110
- return "before" in e && "after" in e;
1111
- }
1112
- function ti(e, t, n) {
1113
- if (!ei(t)) {
1114
- e.chain().focus().insertContent($r(t.value, t.label, n)).run();
1115
- return;
1116
- }
1117
- let r = $r(t.before, t.label, n), i = $r(t.after, t.label, n), { from: a, to: o } = e.state.selection;
1118
- a === o ? e.chain().focus().insertContentAt(a, [r, i]).setTextSelection(a + 1).run() : e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
1119
- }
1120
- //#endregion
1121
- //#region src/utils/linkColorExtension.ts
1122
- function ni(e) {
1123
- if (!e) return null;
1124
- let t = e.trim();
1125
- 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;
1126
- }
1127
- function ri(e) {
1128
- return e.extend({ addAttributes() {
1129
- return {
1130
- ...this.parent?.(),
1131
- color: {
1132
- default: null,
1133
- parseHTML: (e) => ni(sn(e.style.color)),
1134
- renderHTML: (e) => {
1135
- let t = ni(e.color);
1136
- return t ? { style: `color: ${t}` } : {};
1137
- }
1138
- }
1139
- };
1140
- } });
1141
- }
1142
- //#endregion
1143
- //#region src/composables/useRichTextLinkDialog.ts
1144
- function ii(e, t = Re.liquid) {
1145
- let n = l(!1), r = l(""), i = l(""), a = l(null);
1146
- qr(a, n);
1147
- function o() {
1148
- let t = e.value?.getAttributes("link") ?? {};
1149
- r.value = t.href || "", i.value = t.color || "", n.value = !0;
1150
- }
1151
- function s() {
1152
- if (r.value) {
1153
- let t = f(r.value);
1154
- if (t !== null) {
1155
- let n = ni(i.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
1156
- n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
1157
- }
1158
- }
1159
- m();
1160
- }
1161
- let c = /* @__PURE__ */ new Set([
1162
- "http",
1163
- "https",
1164
- "mailto",
1165
- "tel",
1166
- "ftp",
1167
- "ftps",
1168
- "sms",
1169
- "xmpp",
1170
- "cid"
1171
- ]), u = /^(?:\/|\.{1,2}\/|\?)/;
1172
- function d(e) {
1173
- return RegExp(`^(?:${t.value.source})`).test(e);
1174
- }
1175
- function f(e) {
1176
- let t = e.trim();
1177
- if (!t) return null;
1178
- if (t.startsWith("#")) return t;
1179
- if (t.startsWith("//")) return `https:${t}`;
1180
- if (u.test(t)) return t;
1181
- let n = /^([a-z][a-z0-9+.-]*):/i.exec(t);
1182
- return n ? c.has(n[1].toLowerCase()) ? t : null : d(t) ? t : `https://${t}`;
1183
- }
1184
- function p() {
1185
- e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), m();
1186
- }
1187
- function m() {
1188
- n.value = !1, r.value = "", i.value = "";
1189
- }
1190
- function h(e) {
1191
- e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" && m();
1192
- }
1193
- return {
1194
- showLinkDialog: n,
1195
- linkUrl: r,
1196
- linkColor: i,
1197
- linkDialogRef: a,
1198
- openLinkDialog: o,
1199
- insertLink: s,
1200
- removeLink: p,
1201
- closeLinkDialog: m,
1202
- handleLinkKeydown: h
1203
- };
1204
- }
1205
- //#endregion
1206
- //#region src/composables/useRichTextEditor.ts
1207
- function ai(r) {
1208
- let i = n(J, null), { mergeTags: a, canRequestMergeTag: o, isRequesting: s, requestMergeTag: c, syntax: u, autocomplete: d } = Mn(), { canInsertLogicTag: f, isRequesting: p, requestLogicTag: m } = Nn(), h = n(Lt, null), g = (k(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = Me(u), y = v(null), b = () => _e(i?.content?.value?.settings ?? { locale: "en" });
1209
- t(b, (e) => {
1210
- let t = y.value?.view.dom;
1211
- t && t.setAttribute("dir", e);
1212
- });
1213
- let { showLinkDialog: x, linkUrl: S, linkColor: C, linkDialogRef: w, openLinkDialog: T, insertLink: E, removeLink: D, closeLinkDialog: O, handleLinkKeydown: A } = ii(y, u), { start: j, stop: M } = lt(() => y.value?.commands.focus("end"), 0, { immediate: !1 }), N = v(null), P = l(!0), F = l(null), I = !1, L = null;
1214
- async function R() {
1215
- F.value = null, P.value = !0;
1216
- try {
1217
- let { TiptapEditor: e, EC: t, extensions: n } = await r.loadExtensions({
1218
- mergeTags: a,
1219
- syntax: u,
1220
- triggerChar: _,
1221
- autocompleteEnabled: d,
1222
- suggestionEmptyText: g
1223
- });
1224
- if (I) return;
1225
- N.value = t;
1226
- let o = /* @__PURE__ */ new Map();
1227
- n.forEach((e, t) => o.set(e.name, t));
1228
- let s = new e({
1229
- extensions: n.filter((e, t) => o.get(e.name) === t),
1230
- content: r.blockContent(),
1231
- editable: !0,
1232
- editorProps: { attributes: { dir: b() } },
1233
- onUpdate: ({ editor: e }) => {
1234
- I || i && (L = e.getHTML(), i.updateBlock(r.blockId(), { content: L }));
1235
- }
1236
- });
1237
- if (I) {
1238
- s.destroy();
1239
- return;
1240
- }
1241
- y.value = s, P.value = !1, j();
1242
- } catch (e) {
1243
- if (I) return;
1244
- Z.error(`[${r.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), F.value = e instanceof Error ? e.message : "Failed to load editor", P.value = !1;
1245
- }
1246
- }
1247
- function z() {
1248
- y.value?.destroy(), y.value = null, R();
1249
- }
1250
- R();
1251
- let B = t(() => r.blockContent(), (e) => {
1252
- y.value && e !== L && (L = e, y.value.getHTML() !== e && y.value.commands.setContent(e, { emitUpdate: !1 }));
1253
- });
1254
- function V(e) {
1255
- if (s.value || p.value) return;
1256
- let t = e.composedPath(), n = t.find((e) => e instanceof HTMLElement);
1257
- if (!n) return;
1258
- r.onClickOutsideSideEffect?.(n);
1259
- let i = t.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
1260
- n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog") || i || r.onDone();
1261
- }
1262
- pt(document, "mousedown", V), e(() => {
1263
- I = !0, B(), M(), y.value?.destroy();
1264
- });
1265
- async function H() {
1266
- let e = await c();
1267
- I || (e && y.value ? y.value.chain().focus().insertMergeTag({
1268
- label: e.label,
1269
- value: e.value
1270
- }).run() : y.value?.commands.focus());
1271
- }
1272
- async function ee() {
1273
- let e = await m();
1274
- I || (e && y.value ? ti(y.value, e, u) : y.value?.commands.focus());
1275
- }
1276
- return {
1277
- editor: y,
1278
- EditorContent: N,
1279
- isLoading: P,
1280
- initError: F,
1281
- retry: z,
1282
- showLinkDialog: x,
1283
- linkUrl: S,
1284
- linkColor: C,
1285
- linkDialogRef: w,
1286
- mergeTags: a,
1287
- canRequestMergeTag: o,
1288
- isRequestingMergeTag: s,
1289
- syntax: u,
1290
- canInsertLogicTag: f,
1291
- isRequestingLogicTag: p,
1292
- openLinkDialog: T,
1293
- insertLink: E,
1294
- removeLink: D,
1295
- closeLinkDialog: O,
1296
- handleLinkKeydown: A,
1297
- handleAddMergeTag: H,
1298
- handleAddLogicTag: ee
1299
- };
1300
- }
1301
- //#endregion
1302
- //#region src/composables/useSmallScreenNotice.ts
1303
- var oi = "(max-width: 767px)";
1304
- function si(e) {
1305
- let t = mt(oi);
1306
- return {
1307
- isSmallScreen: t,
1308
- showNotice: y(() => (A(e) ?? !0) && t.value)
1309
- };
1310
- }
1311
- //#endregion
1312
- //#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
1313
- var ci = { class: "tpl:w-full" }, li = {
1314
- key: 0,
1315
- 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)]"
1316
- }, ui = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, di = {
1317
- key: 1,
1318
- 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)]"
1319
- }, fi = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, pi = {
1320
- key: 2,
1321
- class: "tpl:relative"
1322
- }, mi = ["innerHTML"], hi = {
1323
- key: 0,
1324
- 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]",
1325
- style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
1326
- }, gi = /* @__PURE__ */ d({
1327
- __name: "CustomBlock",
1328
- props: {
1329
- block: {},
1330
- viewport: {}
1331
- },
1332
- emits: ["fetchData"],
1333
- setup(e, { emit: r }) {
1334
- let i = e, a = r, { t: o } = X(), c = n(tn, null), u = l(""), d = l(!1), f = y(() => c?.getDefinition(i.block.customType)), p = y(() => !!f.value), g = y(() => i.block), { isFetching: _, fetch: v, needsFetch: S, hasDataSource: w } = tt({
1335
- definition: f,
1336
- block: g,
1337
- onUpdate: (e, t) => {
1338
- a("fetchData", {
1339
- fieldValues: e,
1340
- dataSourceFetched: t
1341
- });
1342
- }
1343
- }), E = n(q, xt), k = n(jt, null), A = y(() => {
1344
- if (!k?.value) return i.block;
1345
- let e = {};
1346
- for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ? ye(n, E.value) : n;
1347
- return {
1348
- ...i.block,
1349
- fieldValues: e
1350
- };
1351
- });
1352
- async function j() {
1353
- if (c) {
1354
- d.value = !1;
1355
- try {
1356
- let e = await c.renderCustomBlock(A.value);
1357
- e.includes("Template render error:") && (d.value = !0), u.value = e;
1358
- } catch {
1359
- d.value = !0, u.value = "";
1360
- }
1361
- }
1362
- }
1363
- let M = ut(j, 150);
1364
- return C(() => {
1365
- j();
1366
- }), t(() => i.block.fieldValues, () => {
1367
- M();
1368
- }, { deep: !0 }), t(() => k?.value, () => {
1369
- M();
1370
- }), (e, t) => (s(), b("div", ci, [p.value ? d.value ? (s(), b("div", di, [h(m(Sn), {
1371
- size: 24,
1372
- class: "tpl:text-[var(--tpl-danger)]"
1373
- }), O("span", fi, P(m(o).customBlocks.renderError), 1)])) : (s(), b("div", pi, [O("div", { innerHTML: u.value }, null, 8, mi), m(w) && m(S) ? (s(), b("div", hi, [m(_) ? (s(), D(kn, {
1374
- key: 1,
1375
- class: "tpl:w-48"
1376
- })) : (s(), b("button", {
1377
- key: 0,
1378
- type: "button",
1379
- 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)]",
1380
- onClick: t[0] ||= T((...e) => m(v) && m(v)(...e), ["stop"])
1381
- }, [f.value?.icon ? (s(), D(Gr, {
1382
- key: 0,
1383
- icon: f.value.icon,
1384
- size: 16
1385
- }, null, 8, ["icon"])) : x("", !0), L(" " + P(f.value?.dataSource?.label || m(o).customBlocks.dataSource.fetchButton), 1)]))])) : x("", !0)])) : (s(), b("div", li, [h(m(_n), {
1386
- size: 24,
1387
- class: "tpl:text-[var(--tpl-warning)]"
1388
- }), O("span", ui, P(m(o).customBlocks.definitionNotFound), 1)]))]));
1389
- }
1390
- }), _i = { class: "tpl:w-full" }, vi = /* @__PURE__ */ d({
1391
- __name: "DividerBlock",
1392
- props: {
1393
- block: {},
1394
- viewport: {}
1395
- },
1396
- setup(e) {
1397
- let t = e, n = y(() => ({
1398
- borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
1399
- width: t.block.width === "full" ? "100%" : typeof t.block.width == "number" ? `${t.block.width}px` : t.block.width,
1400
- margin: t.block.width === "full" ? "0" : "0 auto"
1401
- }));
1402
- return (e, t) => (s(), b("div", _i, [O("hr", {
1403
- class: "tpl:m-0 tpl:border-none",
1404
- style: E(n.value)
1405
- }, null, 4)]));
1406
- }
1407
- }), yi = { class: "tpl:w-full" }, bi = ["srcdoc", "title"], xi = {
1408
- key: 1,
1409
- 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)]"
1410
- }, Si = {
1411
- key: 0,
1412
- class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
1413
- }, Ci = {
1414
- key: 1,
1415
- class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
1416
- }, wi = /* @__PURE__ */ d({
1417
- __name: "HtmlBlock",
1418
- props: {
1419
- block: {},
1420
- viewport: {}
1421
- },
1422
- setup(r) {
1423
- let i = r, { t: a } = X(), o = n(Vt, !1), c = y(() => i.block.content.trim().length > 0), u = y(() => o && c.value), d = n(q, xt), f = n(jt, null), p = y(() => f?.value ? ye(i.block.content, d.value) : i.block.content), g = l(null), _ = l(60), v = null;
1424
- function x() {
1425
- let e = g.value?.contentDocument;
1426
- e && (_.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
1427
- }
1428
- function S() {
1429
- v?.disconnect(), v = null, x();
1430
- let e = g.value?.contentDocument?.documentElement;
1431
- e && typeof ResizeObserver < "u" && (v = new ResizeObserver(() => x()), v.observe(e));
1432
- }
1433
- return t(u, (e) => {
1434
- e || (v?.disconnect(), v = null);
1435
- }), e(() => {
1436
- v?.disconnect(), v = null;
1437
- }), (e, t) => (s(), b("div", yi, [u.value ? (s(), b("iframe", {
1438
- key: 0,
1439
- ref_key: "iframeRef",
1440
- ref: g,
1441
- srcdoc: p.value,
1442
- sandbox: "allow-same-origin",
1443
- title: m(a).html.preview,
1444
- class: "tpl:block tpl:w-full tpl:border-0",
1445
- style: E({ height: `${_.value}px` }),
1446
- onLoad: S
1447
- }, null, 44, bi)) : (s(), b("div", xi, [h(m(pn), {
1448
- size: 24,
1449
- class: "tpl:text-[var(--tpl-text-dim)]"
1450
- }), c.value ? (s(), b("span", Si, P(m(a).html.preview), 1)) : (s(), b("span", Ci, P(m(a).html.empty), 1))]))]));
1451
- }
1452
- }), Ti = ["data-drop-enabled"], Ei = ["href"], Di = ["src", "alt"], Oi = ["src", "alt"], ki = {
1453
- class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
1454
- style: { opacity: "0.7" }
1455
- }, Ai = ["href"], ji = ["src", "alt"], Mi = ["src", "alt"], Ni = {
1456
- key: 4,
1457
- 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)]"
1458
- }, Pi = ["aria-label"], Fi = { key: 1 }, Ii = /* @__PURE__ */ d({
1459
- __name: "ImageBlock",
1460
- props: {
1461
- block: {},
1462
- viewport: {}
1463
- },
1464
- emits: ["update"],
1465
- setup(e, { emit: t }) {
1466
- let n = e, r = t, { t: i } = X(), { syntax: a } = Mn(), o = y(() => ke(n.block.src, a));
1467
- function c(e) {
1468
- let t = {
1469
- src: e.url,
1470
- ...it(et(e.width, e.height))
1471
- };
1472
- e.alt && (t.alt = e.alt), r("update", t);
1473
- }
1474
- let u = l(), { canBrowse: d, dropEnabled: f, isUploading: p, showOverlay: g, openMediaBrowser: _ } = nt({
1475
- target: u,
1476
- blocked: o,
1477
- apply: c
1478
- }), v = y(() => ({ textAlign: n.block.align })), S = y(() => {
1479
- let e = n.block.border, t = ["left", "right"].map((t) => ce(e?.[t]) === null ? 0 : e[t].width).reduce((e, t) => e + t, 0);
1480
- return t > 0 ? `calc(100% - ${t}px)` : "100%";
1481
- }), C = y(() => {
1482
- let e = n.block.align;
1483
- return {
1484
- maxWidth: "100%",
1485
- width: n.block.width === "full" ? S.value : `${n.block.width}px`,
1486
- height: n.block.height ? `${n.block.height}px` : void 0,
1487
- borderRadius: U(n.block.borderRadius) ?? void 0,
1488
- ...Ir(n.block.border),
1489
- display: "block",
1490
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
1491
- marginRight: e === "center" ? "auto" : void 0
1492
- };
1493
- }), w = G(() => o.value ? void 0 : n.block.src), k = G(() => o.value ? n.block.placeholderUrl : void 0);
1494
- return (t, n) => (s(), b("div", {
1495
- ref_key: "dropZoneRef",
1496
- ref: u,
1497
- "data-testid": "image-drop-zone",
1498
- "data-drop-enabled": m(f),
1499
- class: "tpl:relative tpl:w-full",
1500
- style: E(v.value)
1501
- }, [m(g) ? (s(), D(ot, {
1502
- key: 0,
1503
- uploading: m(p),
1504
- size: "canvas"
1505
- }, null, 8, ["uploading"])) : x("", !0), e.block.src && o.value && e.block.placeholderUrl ? (s(), b(N, { key: 1 }, [e.block.linkUrl ? (s(), b("a", {
1506
- key: 0,
1507
- href: e.block.linkUrl,
1508
- target: "_blank",
1509
- rel: "noopener noreferrer",
1510
- onClick: n[0] ||= T(() => {}, ["prevent"])
1511
- }, [O("img", {
1512
- class: "tpl:border-0",
1513
- loading: "lazy",
1514
- src: m(k),
1515
- alt: e.block.alt || m(i).image.altTextPlaceholder,
1516
- style: E(C.value)
1517
- }, null, 12, Di)], 8, Ei)) : (s(), b("img", {
1518
- key: 1,
1519
- class: "tpl:border-0",
1520
- src: m(k),
1521
- alt: e.block.alt,
1522
- style: E(C.value)
1523
- }, null, 12, Oi))], 64)) : e.block.src && o.value ? (s(), b("div", {
1524
- key: 2,
1525
- 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)]",
1526
- style: E([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, C.value])
1527
- }, [h(m(Tn), {
1528
- size: 32,
1529
- "stroke-width": 1.5,
1530
- class: "tpl:text-[var(--tpl-primary)]",
1531
- style: { opacity: "0.5" }
1532
- }), O("span", ki, [h(Br, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (s(), b(N, { key: 3 }, [e.block.linkUrl ? (s(), b("a", {
1533
- key: 0,
1534
- href: e.block.linkUrl,
1535
- target: "_blank",
1536
- rel: "noopener noreferrer",
1537
- onClick: n[1] ||= T(() => {}, ["prevent"])
1538
- }, [O("img", {
1539
- class: "tpl:border-0",
1540
- loading: "lazy",
1541
- src: m(w),
1542
- alt: e.block.alt || m(i).image.altTextPlaceholder,
1543
- style: E(C.value)
1544
- }, null, 12, ji)], 8, Ai)) : (s(), b("img", {
1545
- key: 1,
1546
- class: "tpl:border-0",
1547
- src: m(w),
1548
- alt: e.block.alt,
1549
- style: E(C.value)
1550
- }, null, 12, Mi))], 64)) : (s(), b("div", Ni, [m(d) ? (s(), b("button", {
1551
- key: 0,
1552
- "aria-label": m(i).image.browseMedia,
1553
- 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)]",
1554
- onClick: n[2] ||= T((...e) => m(_) && m(_)(...e), ["stop"])
1555
- }, [h(m(Tn), {
1556
- size: 14,
1557
- "stroke-width": 1.5
1558
- }), L(" " + P(m(i).image.browseMedia), 1)], 8, Pi)) : (s(), b("span", Fi, P(m(i).image.clickToAdd), 1))]))], 12, Ti));
1559
- }
1560
- }), Li = { class: "tpl:w-full" }, Ri = ["href"], zi = {
1561
- key: 1,
1562
- 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)]"
1563
- }, Bi = /* @__PURE__ */ d({
1564
- __name: "MenuBlock",
1565
- props: {
1566
- block: {},
1567
- viewport: {}
1568
- },
1569
- setup(e) {
1570
- let t = e, { t: n } = X(), i = K(Y, "MenuBlock"), a = y(() => ({
1571
- display: "flex",
1572
- flexWrap: "wrap",
1573
- gap: `0 ${t.block.spacing}px`,
1574
- justifyContent: t.block.textAlign === "left" ? "flex-start" : t.block.textAlign === "right" ? "flex-end" : "center",
1575
- fontSize: `${t.block.fontSize}px`,
1576
- fontFamily: t.block.fontFamily ? i.resolveFontFamily(t.block.fontFamily) : "inherit",
1577
- alignItems: "center"
1578
- })), o = y(() => t.block.items.length > 0);
1579
- function c(e) {
1580
- return e || t.block.linkColor || t.block.color;
1581
- }
1582
- return (t, i) => (s(), b("div", Li, [o.value ? (s(), b("div", {
1583
- key: 0,
1584
- style: E(a.value)
1585
- }, [(s(!0), b(N, null, r(e.block.items, (t, n) => (s(), b(N, { key: t.id }, [O("a", {
1586
- href: t.url || "#",
1587
- class: "tpl:cursor-default tpl:no-underline",
1588
- style: E({
1589
- color: c(t.color),
1590
- fontWeight: t.bold ? "bold" : "normal",
1591
- textDecoration: t.underline ? "underline" : "none"
1592
- }),
1593
- onClick: i[0] ||= T(() => {}, ["prevent"])
1594
- }, [h(Br, { text: t.text || "..." }, null, 8, ["text"])], 12, Ri), n < e.block.items.length - 1 ? (s(), b("span", {
1595
- key: 0,
1596
- style: E({
1597
- color: e.block.separatorColor,
1598
- padding: `0 ${e.block.spacing}px`
1599
- })
1600
- }, P(e.block.separator), 5)) : x("", !0)], 64))), 128))], 4)) : (s(), b("div", zi, [h(m(yn), { size: 16 }), O("span", null, P(m(n).menu.addLinks), 1)]))]));
1601
- }
1602
- }), Vi = /* @__PURE__ */ new Set([
1603
- "http",
1604
- "https",
1605
- "mailto",
1606
- "tel",
1607
- "ftp",
1608
- "ftps",
1609
- "sms",
1610
- "xmpp",
1611
- "cid"
1612
- ]), Hi = /* @__PURE__ */ new Set([
1613
- "SCRIPT",
1614
- "STYLE",
1615
- "IFRAME",
1616
- "OBJECT",
1617
- "EMBED",
1618
- "LINK",
1619
- "META",
1620
- "BASE",
1621
- "FORM"
1622
- ]), Ui = /* @__PURE__ */ new Set([
1623
- "href",
1624
- "xlink:href",
1625
- "formaction",
1626
- "action",
1627
- "ping",
1628
- "background",
1629
- "poster"
1630
- ]);
1631
- function Wi(e, t) {
1632
- let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
1633
- if (!n || n.startsWith("#")) return !0;
1634
- let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
1635
- if (!r) return !0;
1636
- let i = r[1].toLowerCase();
1637
- return Vi.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
1638
- }
1639
- function Gi(e) {
1640
- if (Hi.has(e.tagName)) {
1641
- e.remove();
1642
- return;
1643
- }
1644
- let t = [];
1645
- for (let n = 0; n < e.attributes.length; n++) t.push(e.attributes[n].name);
1646
- for (let n of t) {
1647
- let t = n.toLowerCase();
1648
- t.startsWith("on") ? e.removeAttribute(n) : Ui.has(t) ? Wi(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n) : t === "src" ? Wi(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n) : t === "srcdoc" && e.removeAttribute(n);
1649
- }
1650
- let n = Array.from(e.children);
1651
- for (let e of n) Gi(e);
1652
- }
1653
- function Ki(e) {
1654
- if (typeof DOMParser > "u") return e;
1655
- let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
1656
- for (let e of n) Gi(e);
1657
- return t.innerHTML;
1658
- }
1659
- //#endregion
1660
- //#region src/composables/useEditableTextBlock.ts
1661
- function qi(e) {
1662
- let t = n(q, xt), r = n(jt, null), { syntax: i } = Mn(), a = y(() => r?.value ? Ee(e(), t.value) : Ne(e(), t.value)), o = y(() => He(Ki(Le(a.value, i)))), s = l(!1), c = l(null), { top: u, left: d } = ht(c), { toLocal: f } = un(), p = y(() => f({
1663
- top: u.value - 8,
1664
- left: d.value
1665
- }));
1666
- function m() {
1667
- s.value = !0;
1668
- }
1669
- function h() {
1670
- s.value = !1;
1671
- }
1672
- return {
1673
- isEditing: s,
1674
- blockRef: c,
1675
- toolbarPosition: p,
1676
- resolvedContent: o,
1677
- handleDoubleClick: m,
1678
- handleEditorDone: h
1679
- };
1680
- }
1681
- //#endregion
1682
- //#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
1683
- var Ji = ["innerHTML"], Yi = /* @__PURE__ */ d({
1684
- __name: "ParagraphBlock",
1685
- props: {
1686
- block: {},
1687
- viewport: {}
1688
- },
1689
- setup(e) {
1690
- let t = e, n = I(() => import("./ParagraphEditor-D4aq9eeC.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = qi(() => t.block.content);
1691
- return (t, u) => (s(), b("div", {
1692
- ref_key: "blockRef",
1693
- ref: i,
1694
- class: "tpl:min-h-[1em] tpl:w-full",
1695
- onDblclick: u[0] ||= (...e) => m(c) && m(c)(...e)
1696
- }, [m(r) ? (s(), D(m(n), {
1697
- key: 0,
1698
- block: e.block,
1699
- "toolbar-position": m(a),
1700
- onDone: m(l)
1701
- }, null, 8, [
1702
- "block",
1703
- "toolbar-position",
1704
- "onDone"
1705
- ])) : (s(), b("div", {
1706
- key: 1,
1707
- class: "tpl-text-content tpl:outline-none",
1708
- innerHTML: m(o)
1709
- }, null, 8, Ji))], 544));
1710
- }
1711
- }), Xi = [
1712
- "data-block-id",
1713
- "data-block-type",
1714
- "data-tpl-picked"
1715
- ], Zi = ["aria-label"], Qi = [
1716
- "aria-label",
1717
- "aria-pressed",
1718
- "title"
1719
- ], $i = ["aria-label", "title"], ea = ["aria-label", "title"], ta = ["aria-label", "title"], na = {
1720
- key: 1,
1721
- 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"
1722
- }, ra = { 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)]" }, ia = {
1723
- key: 2,
1724
- class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
1725
- }, aa = ["aria-label", "title"], oa = {
1726
- key: 3,
1727
- class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
1728
- }, sa = ["aria-label"], ca = /*#__PURE__*/ An(/* @__PURE__ */ d({
1729
- __name: "BlockWrapper",
1730
- props: {
1731
- block: {},
1732
- isSelected: { type: Boolean },
1733
- viewport: {},
1734
- previewMode: { type: Boolean },
1735
- nested: { type: Boolean },
1736
- picked: { type: Boolean }
1737
- },
1738
- emits: ["select"],
1739
- setup(e, { emit: t }) {
1740
- let r = I(() => import("./BlockIssueBadge-C7sdnkrF.js")), i = e, o = t, { t: c, format: u } = X(), d = n(Nt, null), f = l(null), p = y(() => d?.liftedBlockId.value === i.block.id), g = y(() => p.value ? u(c.blockActions.dragLifted, { block: i.block.type }) : c.blockActions.drag);
1741
- async function v() {
1742
- await w(), f.value?.focus();
1743
- }
1744
- function S(e) {
1745
- d && (e.key === " " || e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), p.value ? d.drop(i.block.id) : d.lift(i.block.id)) : p.value && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), d.cancel(), v()) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), d.moveUp(i.block.id), v()) : e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), d.moveDown(i.block.id), v())));
1746
- }
1747
- let C = y(() => !i.viewport || !i.block.visibility ? !1 : i.block.visibility[i.viewport] === !1), D = y(() => i.previewMode === !0 && C.value), k = y(() => i.viewport ? {
1748
- desktop: c.viewport.desktop,
1749
- mobile: c.viewport.mobile
1750
- }[i.viewport] ?? i.viewport : ""), A = y(() => !!i.block.displayCondition), j = n(Bt, null), M = n(Wt, null), N = n(Jt, {}), F = y(() => N.savedBlocks?.isPicking.value === !0), R = y(() => !i.nested && N.savedBlocks?.isAvailable.value === !0 && N.savedBlocks?.canCreate.value === !0), z = y(() => i.isSelected && !F.value), B = y(() => N.comments?.getBlockCount(i.block.id) ?? 0), V = Xe(() => i.block.type === "section" ? i.block.backgroundImage : void 0), H = Xe(() => i.block.type === "section" ? i.block.wrapper?.backgroundImage : void 0), ee = n(J, null), U = n(vt, void 0), W = y(() => Pr(i.block, {
1751
- backgroundImageUrl: V.value,
1752
- heroBoxWidth: Qe(i.block, ee?.content.value, U)
1753
- })), te = y(() => Lr(i.block, { backgroundImageUrl: H.value }));
1754
- function ne(e) {
1755
- i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
1756
- }
1757
- function re() {
1758
- j?.deleteBlock(i.block.id);
1759
- }
1760
- function ie() {
1761
- j?.duplicateBlock(i.block);
1762
- }
1763
- function ae() {
1764
- N.savedBlocks?.startPicking(i.block.id);
1765
- }
1766
- function oe() {
1767
- M?.toggleBlock(i.block.id);
1768
- }
1769
- return (t, n) => D.value ? x("", !0) : (s(), b("div", {
1770
- key: 0,
1771
- class: _(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
1772
- "tpl-block--selected": e.isSelected,
1773
- "tpl-block--picked": e.picked,
1774
- "tpl-block--idle": !e.isSelected && !e.picked,
1775
- "tpl-block--lifted": p.value
1776
- }]),
1777
- "data-block-id": e.block.id,
1778
- "data-block-type": e.block.type,
1779
- "data-tpl-picked": e.picked || void 0,
1780
- onClick: ne
1781
- }, [
1782
- h(m(r), { "block-id": e.block.id }, null, 8, ["block-id"]),
1783
- z.value ? (s(), b("div", {
1784
- key: 0,
1785
- role: "toolbar",
1786
- "aria-label": m(c).blockActions.drag,
1787
- class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:-right-2 tpl:top-1/2 tpl:z-10 tpl:flex tpl:-translate-y-1/2 tpl:translate-x-full tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]"
1788
- }, [
1789
- O("button", {
1790
- ref_key: "dragButtonRef",
1791
- ref: f,
1792
- 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",
1793
- "aria-label": g.value,
1794
- "aria-pressed": p.value,
1795
- "aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
1796
- title: m(c).blockActions.drag,
1797
- onKeydown: S
1798
- }, [h(m(bn), {
1799
- size: 14,
1800
- "stroke-width": 1.5
1801
- })], 40, Qi),
1802
- O("button", {
1803
- 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",
1804
- "aria-label": m(c).blockActions.duplicate,
1805
- title: m(c).blockActions.duplicate,
1806
- onClick: T(ie, ["stop"])
1807
- }, [h(m(gn), {
1808
- size: 14,
1809
- "stroke-width": 1.5
1810
- })], 8, $i),
1811
- R.value ? (s(), b("button", {
1812
- key: 0,
1813
- 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",
1814
- "aria-label": m(c).blockActions.saveAsBlock,
1815
- title: m(c).blockActions.saveAsBlock,
1816
- onClick: T(ae, ["stop"])
1817
- }, [h(m(hn), {
1818
- size: 14,
1819
- "stroke-width": 1.5
1820
- })], 8, ea)) : x("", !0),
1821
- O("button", {
1822
- 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",
1823
- "aria-label": m(c).blockActions.delete,
1824
- title: m(c).blockActions.delete,
1825
- onClick: T(re, ["stop"])
1826
- }, [h(m(Cn), {
1827
- size: 14,
1828
- "stroke-width": 1.5
1829
- })], 8, ta)
1830
- ], 8, Zi)) : x("", !0),
1831
- C.value ? (s(), b("div", na, [O("span", ra, [h(m(mn), {
1832
- size: 12,
1833
- "stroke-width": 1.5
1834
- }), L(" " + P(m(u)(m(c).blockActions.hiddenOnViewport, { viewport: k.value })), 1)])])) : x("", !0),
1835
- A.value && !C.value ? (s(), b("div", ia, [O("button", {
1836
- "data-testid": "condition-toggle",
1837
- 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)]",
1838
- "aria-label": m(c).blockActions.conditionToggle,
1839
- title: e.block.displayCondition?.label,
1840
- onClick: T(oe, ["stop"])
1841
- }, [h(m(xn), {
1842
- size: 12,
1843
- "stroke-width": 2
1844
- })], 8, aa)])) : x("", !0),
1845
- B.value > 0 && !C.value ? (s(), b("div", oa, [O("button", {
1846
- class: "tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:bg-[var(--tpl-chrome-primary-light)] tpl:text-[var(--tpl-primary)]",
1847
- "aria-label": m(u)(m(c).blockActions.comments, { count: String(B.value) }),
1848
- onClick: n[0] ||= T((t) => m(N).comments?.openForBlock(e.block.id), ["stop"])
1849
- }, [h(m(En), {
1850
- size: 12,
1851
- "stroke-width": 2.5
1852
- }), L(" " + P(B.value), 1)], 8, sa)])) : x("", !0),
1853
- te.value ? (s(), b("div", {
1854
- key: 4,
1855
- class: _(["tpl-section-wrapper tpl-email-surface", m(Ar)(te.value)]),
1856
- style: E(te.value)
1857
- }, [O("div", {
1858
- class: _(["tpl-block-content tpl-email-surface", m(Ar)(W.value)]),
1859
- style: E(W.value)
1860
- }, [a(t.$slots, "default", {}, void 0, !0)], 6)], 6)) : (s(), b("div", {
1861
- key: 5,
1862
- class: _(["tpl-block-content tpl-email-surface", m(Ar)(W.value)]),
1863
- style: E(W.value)
1864
- }, [a(t.$slots, "default", {}, void 0, !0)], 6))
1865
- ], 10, Xi));
1866
- }
1867
- }), [["__scopeId", "data-v-254ef206"]]);
1868
- //#endregion
1869
- //#region src/utils/unwrapParagraph.ts
1870
- function la(e) {
1871
- let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
1872
- return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
1873
- }
1874
- //#endregion
1875
- //#region src/components/blocks/TitleBlock.vue
1876
- var ua = /* @__PURE__ */ d({
1877
- __name: "TitleBlock",
1878
- props: {
1879
- block: {},
1880
- viewport: {}
1881
- },
1882
- setup(e) {
1883
- let t = e, n = I(() => import("./TitleEditor-CsZiG3TT.js")), r = K(Y, "TitleBlock"), { isEditing: i, blockRef: a, toolbarPosition: o, resolvedContent: c, handleDoubleClick: l, handleEditorDone: d } = qi(() => t.block.content), f = y(() => {
1884
- let e = {
1885
- fontSize: `${z[t.block.level]}px`,
1886
- lineHeight: String(oe),
1887
- fontWeight: "700",
1888
- textAlign: t.block.textAlign
1889
- };
1890
- return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = r.resolveFontFamily(t.block.fontFamily)), e;
1891
- }), p = y(() => `h${t.block.level}`), h = y(() => la(c.value));
1892
- return (t, r) => (s(), b("div", {
1893
- ref_key: "blockRef",
1894
- ref: a,
1895
- class: "tpl:min-h-[1em] tpl:w-full",
1896
- style: E(f.value),
1897
- onDblclick: r[0] ||= (...e) => m(l) && m(l)(...e)
1898
- }, [m(i) ? (s(), D(m(n), {
1899
- key: 0,
1900
- block: e.block,
1901
- "toolbar-position": m(o),
1902
- onDone: m(d)
1903
- }, null, 8, [
1904
- "block",
1905
- "toolbar-position",
1906
- "onDone"
1907
- ])) : (s(), D(u(p.value), {
1908
- key: 1,
1909
- class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-[inherit] tpl:outline-none",
1910
- style: {
1911
- color: "inherit",
1912
- fontWeight: "inherit"
1913
- },
1914
- innerHTML: h.value
1915
- }, null, 8, ["innerHTML"]))], 36));
1916
- }
1917
- }), da = "hero", fa = "#1f2937", pa = "#ffffff";
1918
- function ma(e, t) {
1919
- let n = Ae("title", e);
1920
- n.color = pa, n.textAlign = "center";
1921
- let r = Ae("paragraph", e);
1922
- r.content = `<p style="text-align: center"><span style="color: ${pa}">${ha(t)}</span></p>`;
1923
- let i = Ae("button", e);
1924
- return i.align = "center", B({
1925
- columns: "1",
1926
- children: [[
1927
- n,
1928
- r,
1929
- i
1930
- ]],
1931
- hero: {
1932
- height: "image",
1933
- verticalAlign: "middle"
1934
- },
1935
- styles: {
1936
- padding: {
1937
- top: 48,
1938
- right: 24,
1939
- bottom: 48,
1940
- left: 24
1941
- },
1942
- backgroundColor: fa
1943
- }
1944
- });
1945
- }
1946
- function ha(e) {
1947
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1948
- }
1949
- //#endregion
1950
- //#region src/utils/sectionColumnDrop.ts
1951
- var ga = /* @__PURE__ */ new Set(["section", da]);
1952
- function _a(e) {
1953
- return e.dataset.blockType !== "section" && !ga.has(e.dataset.paletteType ?? "");
1954
- }
1955
- //#endregion
1956
- //#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
1957
- var va = { class: "tpl:relative tpl:w-full" }, ya = {
1958
- key: 0,
1959
- "data-testid": "hero-image-hint",
1960
- 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)]"
1961
- }, ba = {
1962
- key: 0,
1963
- "data-testid": "section-drop-hint",
1964
- 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)]"
1965
- }, xa = /* @__PURE__ */ d({
1966
- __name: "SectionBlock",
1967
- props: {
1968
- block: {},
1969
- viewport: {}
1970
- },
1971
- setup(e) {
1972
- let t = {
1973
- title: ua,
1974
- paragraph: Yi,
1975
- image: Ii,
1976
- button: Hr,
1977
- divider: vi,
1978
- custom: gi
1979
- }, a = e, { t: o } = X(), c = K(J, "SectionBlock"), d = n(Wt, null), p = n(tn, null), g = n(Jt, {}), v = n(en, null);
1980
- function S(e) {
1981
- let t = g.savedBlocks;
1982
- t?.isPicking.value ? t.togglePick(a.block.id) : c.selectBlock(e);
1983
- }
1984
- let C = y(() => {
1985
- switch (a.block.columns) {
1986
- case "2": return ["50%", "50%"];
1987
- case "3": return [
1988
- "33.33%",
1989
- "33.33%",
1990
- "33.33%"
1991
- ];
1992
- case "1-2": return ["33.33%", "66.67%"];
1993
- case "2-1": return ["66.67%", "33.33%"];
1994
- default: return ["100%"];
1995
- }
1996
- }), w = y(() => {
1997
- let e = C.value.length, t = [...a.block.children];
1998
- for (; t.length < e;) t.push([]);
1999
- return t.slice(0, e);
2000
- }), T = y(() => a.viewport === "mobile" && a.block.stackOnMobile !== !1);
2001
- function k(e) {
2002
- return w.value[e] || [];
2003
- }
2004
- function A(e) {
2005
- return v?.value === !1 || !d?.isHidden(e);
2006
- }
2007
- function F(e) {
2008
- return !k(e).some((e) => A(e.id));
2009
- }
2010
- let I = l(null);
2011
- function L(e) {
2012
- return c.state.previewMode ? !1 : F(e) ? !0 : I.value === e && k(e).filter((e) => A(e.id)).length <= 1;
2013
- }
2014
- let R = y(() => {
2015
- if (c.state.previewMode) return !1;
2016
- let e = pe(a.block);
2017
- return e !== null && !e.applied && e.reason === "image";
2018
- });
2019
- function z(e) {
2020
- return k(e).length === 0 && !c.state.previewMode;
2021
- }
2022
- function B(e) {
2023
- return k(e).length === 0 && c.state.previewMode;
2024
- }
2025
- function V(e, t) {
2026
- let n = t.map((e) => JSON.parse(JSON.stringify(e))), r = [...a.block.children];
2027
- for (; r.length <= e;) r.push([]);
2028
- r[e] = n, c.updateBlock(a.block.id, { children: r });
2029
- }
2030
- function H(e) {
2031
- return Er(e, p, t);
2032
- }
2033
- function ee(e, t) {
2034
- e.type === "custom" && c.updateBlock(e.id, {
2035
- fieldValues: t.fieldValues,
2036
- dataSourceFetched: t.dataSourceFetched
2037
- });
2038
- }
2039
- return (t, n) => (s(), b("div", va, [R.value ? (s(), b("div", ya, [O("span", null, P(m(o).section.heroAddImage), 1)])) : x("", !0), O("div", { class: _(["tpl:flex tpl:gap-0", { "tpl:flex-col": T.value }]) }, [(s(!0), b(N, null, r(w.value, (t, a) => (s(), b("div", {
2040
- key: a,
2041
- class: _(["tpl:relative tpl:flex tpl:flex-col tpl:rounded", z(a) ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
2042
- style: E({ width: T.value ? "100%" : C.value[a] })
2043
- }, [h(m(M), {
2044
- "model-value": k(a),
2045
- group: {
2046
- name: "blocks",
2047
- pull: !0,
2048
- put: (e, t, n) => m(_a)(n)
2049
- },
2050
- animation: 150,
2051
- "ghost-class": "tpl-ghost",
2052
- "drag-class": "tpl-dragging",
2053
- handle: ".tpl-block-btn",
2054
- "invert-swap": !0,
2055
- "inverted-swap-threshold": .65,
2056
- "empty-insert-threshold": 20,
2057
- "force-fallback": !0,
2058
- class: _(["tpl:grow", {
2059
- "tpl:min-h-[60px]": L(a),
2060
- "tpl:min-h-[34px]": B(a)
2061
- }]),
2062
- onStart: (e) => I.value = a,
2063
- onEnd: n[0] ||= (e) => I.value = null,
2064
- "onUpdate:modelValue": (e) => V(a, e)
2065
- }, {
2066
- default: i(() => [(s(!0), b(N, null, r(k(a), (t) => f((s(), b("div", { key: t.id }, [h(ca, {
2067
- block: t,
2068
- "is-selected": m(c).state.selectedBlockId === t.id,
2069
- viewport: e.viewport,
2070
- "preview-mode": m(c).state.previewMode,
2071
- nested: "",
2072
- onSelect: (e) => S(t.id)
2073
- }, {
2074
- default: i(() => [(s(), D(u(H(t)), {
2075
- block: t,
2076
- viewport: e.viewport,
2077
- onFetchData: (e) => ee(t, e),
2078
- onUpdate: (e) => m(c).updateBlock(t.id, e)
2079
- }, null, 40, [
2080
- "block",
2081
- "viewport",
2082
- "onFetchData",
2083
- "onUpdate"
2084
- ]))]),
2085
- _: 2
2086
- }, 1032, [
2087
- "block",
2088
- "is-selected",
2089
- "viewport",
2090
- "preview-mode",
2091
- "onSelect"
2092
- ])])), [[j, A(t.id)]])), 128))]),
2093
- _: 2
2094
- }, 1032, [
2095
- "model-value",
2096
- "group",
2097
- "class",
2098
- "onStart",
2099
- "onUpdate:modelValue"
2100
- ]), z(a) ? (s(), b("div", ba, [O("span", null, P(m(o).section.dropHere), 1)])) : x("", !0)], 6))), 128))], 2)]));
2101
- }
2102
- }), Sa = ["width", "height"], Ca = [
2103
- "d",
2104
- "stroke",
2105
- "stroke-opacity",
2106
- "stroke-width"
2107
- ], wa = ["d", "fill"], Ta = /* @__PURE__ */ d({
2108
- __name: "SocialIconSvg",
2109
- props: {
2110
- platform: {},
2111
- iconStyle: {},
2112
- iconTone: {},
2113
- iconSize: {}
2114
- },
2115
- setup(e) {
2116
- let t = e, n = y(() => rt[t.platform]), r = y(() => at[t.iconSize]), i = y(() => Ve(t.platform, t.iconTone)), a = y(() => Se(t.iconStyle, t.iconTone)), o = y(() => {
2117
- let e = {
2118
- display: "inline-flex",
2119
- alignItems: "center",
2120
- justifyContent: "center",
2121
- width: `${r.value}px`,
2122
- height: `${r.value}px`
2123
- }, n = i.value.fill;
2124
- switch (t.iconStyle) {
2125
- case "solid": return {
2126
- ...e,
2127
- backgroundColor: n,
2128
- borderRadius: "4px"
2129
- };
2130
- case "outlined": return {
2131
- ...e,
2132
- backgroundColor: "transparent",
2133
- border: `2px solid ${n}`,
2134
- borderRadius: "4px",
2135
- ...a.value && { boxShadow: u(a.value) }
2136
- };
2137
- case "rounded": return {
2138
- ...e,
2139
- backgroundColor: n,
2140
- borderRadius: "8px"
2141
- };
2142
- case "square": return {
2143
- ...e,
2144
- backgroundColor: n,
2145
- borderRadius: "0"
2146
- };
2147
- case "circle": return {
2148
- ...e,
2149
- backgroundColor: n,
2150
- borderRadius: "50%"
2151
- };
2152
- default: return e;
2153
- }
2154
- }), c = y(() => Ue(t.iconStyle)), l = y(() => Math.floor(r.value * c.value));
2155
- function u(e) {
2156
- let t = `${e.width / 2 * r.value / 24}px`, n = Math.round(e.opacity * 255).toString(16).padStart(2, "0"), i = `${e.color}${n}`;
2157
- return `0 0 0 ${t} ${i}, inset 0 0 0 ${t} ${i}`;
2158
- }
2159
- let d = y(() => t.iconStyle === "outlined" || t.iconStyle === "plain" ? i.value.fill : i.value.onFill);
2160
- return (e, t) => (s(), b("span", { style: E(o.value) }, [(s(), b("svg", {
2161
- width: l.value,
2162
- height: l.value,
2163
- viewBox: "0 0 24 24",
2164
- overflow: "visible",
2165
- xmlns: "http://www.w3.org/2000/svg"
2166
- }, [a.value ? (s(), b("path", {
2167
- key: 0,
2168
- "data-testid": "social-icon-halo",
2169
- d: n.value.path,
2170
- fill: "none",
2171
- stroke: a.value.color,
2172
- "stroke-opacity": a.value.opacity,
2173
- "stroke-width": a.value.width / c.value,
2174
- "stroke-linejoin": "round"
2175
- }, null, 8, Ca)) : x("", !0), O("path", {
2176
- d: n.value.path,
2177
- fill: d.value
2178
- }, null, 8, wa)], 8, Sa))], 4));
2179
- }
2180
- }), Ea = { class: "tpl:w-full" }, Da = ["href"], Oa = {
2181
- key: 1,
2182
- 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)]"
2183
- }, ka = /* @__PURE__ */ d({
2184
- __name: "SocialIconsBlock",
2185
- props: {
2186
- block: {},
2187
- viewport: {}
2188
- },
2189
- setup(e) {
2190
- let t = e, { t: n } = X(), i = y(() => ({
2191
- display: "flex",
2192
- flexWrap: "wrap",
2193
- gap: `${t.block.spacing}px`,
2194
- justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
2195
- })), a = y(() => t.block.icons.length > 0);
2196
- return (t, o) => (s(), b("div", Ea, [a.value ? (s(), b("div", {
2197
- key: 0,
2198
- style: E(i.value)
2199
- }, [(s(!0), b(N, null, r(e.block.icons, (t) => (s(), b("a", {
2200
- key: t.id,
2201
- href: t.url || "#",
2202
- class: "tpl:cursor-default",
2203
- onClick: o[0] ||= T(() => {}, ["prevent"])
2204
- }, [h(Ta, {
2205
- platform: t.platform,
2206
- "icon-style": e.block.iconStyle,
2207
- "icon-tone": e.block.iconTone,
2208
- "icon-size": e.block.iconSize
2209
- }, null, 8, [
2210
- "platform",
2211
- "icon-style",
2212
- "icon-tone",
2213
- "icon-size"
2214
- ])], 8, Da))), 128))], 4)) : (s(), b("div", Oa, [h(m(wn), { size: 16 }), O("span", null, P(m(n).social.addIcons), 1)]))]));
2215
- }
2216
- }), Aa = { class: "tpl:w-full" }, ja = {
2217
- key: 0,
2218
- class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
2219
- style: {
2220
- "background-color": "var(--tpl-bg-hover)",
2221
- color: "var(--tpl-text-dim)"
2222
- }
2223
- }, Ma = /* @__PURE__ */ d({
2224
- __name: "SpacerBlock",
2225
- props: {
2226
- block: {},
2227
- viewport: {}
2228
- },
2229
- setup(e) {
2230
- let t = e, n = K(J, "SpacerBlock"), r = y(() => ({
2231
- height: `${t.block.height}px`,
2232
- minHeight: `${t.block.height}px`,
2233
- ...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
2234
- }));
2235
- return (t, i) => (s(), b("div", Aa, [O("div", {
2236
- style: E(r.value),
2237
- class: _(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:box-border tpl:border-y tpl:border-x-0 tpl:border-dashed": !m(n).state.previewMode }])
2238
- }, [m(n).state.previewMode ? x("", !0) : (s(), b("span", ja, P(e.block.height) + "px ", 1))], 6)]));
2239
- }
2240
- }), Na = { class: "tpl:w-full" }, Pa = { key: 0 }, Fa = [
2241
- "aria-label",
2242
- "data-placeholder",
2243
- "onBlur"
2244
- ], Ia = [
2245
- "aria-label",
2246
- "data-placeholder",
2247
- "onBlur"
2248
- ], La = {
2249
- key: 1,
2250
- 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)]"
2251
- }, Ra = /*#__PURE__*/ An(/* @__PURE__ */ d({
2252
- __name: "TableBlock",
2253
- props: {
2254
- block: {},
2255
- viewport: {}
2256
- },
2257
- setup(e) {
2258
- let t = {
2259
- mounted(e, t) {
2260
- e.textContent = t.value ?? "";
2261
- },
2262
- updated(e, t) {
2263
- t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
2264
- }
2265
- }, n = e, { t: i } = X(), a = K(J, "TableBlock"), o = K(Y, "TableBlock"), c = y(() => n.block.rows.length > 0), l = y(() => {
2266
- let e = {
2267
- width: "100%",
2268
- borderCollapse: "collapse",
2269
- fontSize: `${n.block.fontSize}px`,
2270
- textAlign: n.block.textAlign,
2271
- fontFamily: n.block.fontFamily ? o.resolveFontFamily(n.block.fontFamily) : "inherit"
2272
- };
2273
- return n.block.color && (e.color = n.block.color), e;
2274
- }), u = y(() => ({
2275
- border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
2276
- padding: `${n.block.cellPadding}px`,
2277
- textAlign: n.block.textAlign
2278
- })), d = y(() => ({
2279
- ...u.value,
2280
- fontWeight: "bold",
2281
- backgroundColor: n.block.headerBackgroundColor || "transparent"
2282
- })), p = y(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), _ = y(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
2283
- function v() {
2284
- a.selectBlock(n.block.id);
2285
- }
2286
- function S(e, t, r) {
2287
- let i = r.target.innerText.trim(), o = n.block.rows.map((n) => n.id === e ? {
2288
- ...n,
2289
- cells: n.cells.map((e) => e.id === t ? {
2290
- ...e,
2291
- content: i
2292
- } : e)
2293
- } : n);
2294
- a.updateBlock(n.block.id, { rows: o });
2295
- }
2296
- return (e, n) => (s(), b("div", Na, [c.value ? (s(), b("table", {
2297
- key: 0,
2298
- style: E(l.value),
2299
- class: "tpl-table-editable"
2300
- }, [p.value ? (s(), b("thead", Pa, [O("tr", null, [(s(!0), b(N, null, r(p.value.cells, (e) => f((s(), b("th", {
2301
- key: e.id,
2302
- style: E(d.value),
2303
- "aria-label": m(i).table.cellPlaceholder,
2304
- contenteditable: "true",
2305
- "data-placeholder": m(i).table.cellPlaceholder,
2306
- onBlur: (t) => S(p.value.id, e.id, t),
2307
- onKeydown: n[0] ||= g(T((e) => e.target.blur(), ["prevent"]), ["enter"]),
2308
- onClick: T(v, ["stop"])
2309
- }, null, 44, Fa)), [[t, e.content]])), 128))])])) : x("", !0), O("tbody", null, [(s(!0), b(N, null, r(_.value, (e) => (s(), b("tr", { key: e.id }, [(s(!0), b(N, null, r(e.cells, (r) => f((s(), b("td", {
2310
- key: r.id,
2311
- style: E(u.value),
2312
- "aria-label": m(i).table.cellPlaceholder,
2313
- contenteditable: "true",
2314
- "data-placeholder": m(i).table.cellPlaceholder,
2315
- onBlur: (t) => S(e.id, r.id, t),
2316
- onKeydown: n[1] ||= g(T((e) => e.target.blur(), ["prevent"]), ["enter"]),
2317
- onClick: T(v, ["stop"])
2318
- }, null, 44, Ia)), [[t, r.content]])), 128))]))), 128))])], 4)) : (s(), b("div", La, [h(m(On), { size: 16 }), O("span", null, P(m(i).table.empty), 1)]))]));
2319
- }
2320
- }), [["__scopeId", "data-v-6751d456"]]), za = /* @__PURE__ */ d({
2321
- __name: "VideoPlayButton",
2322
- props: { hoverEffect: {
2323
- type: Boolean,
2324
- default: !1
2325
- } },
2326
- setup(e) {
2327
- return (t, n) => (s(), b("div", { class: _(["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", {
2328
- class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
2329
- width: "28",
2330
- height: "28",
2331
- viewBox: "0 0 24 24",
2332
- fill: "currentColor"
2333
- }, [O("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
2334
- }
2335
- });
2336
- //#endregion
2337
- //#region src/utils/videoThumbnail.ts
2338
- function Ba(e) {
2339
- if (!e) return {
2340
- platform: "unknown",
2341
- videoId: null,
2342
- thumbnailUrl: null
2343
- };
2344
- 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]) {
2345
- let n = e.match(t);
2346
- if (n) {
2347
- let e = n[1];
2348
- return {
2349
- platform: "youtube",
2350
- videoId: e,
2351
- thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
2352
- };
2353
- }
2354
- }
2355
- let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
2356
- if (t) {
2357
- let e = t[1];
2358
- return {
2359
- platform: "vimeo",
2360
- videoId: e,
2361
- thumbnailUrl: `https://vumbnail.com/${e}.jpg`
2362
- };
2363
- }
2364
- return {
2365
- platform: "unknown",
2366
- videoId: null,
2367
- thumbnailUrl: null
2368
- };
2369
- }
2370
- function Va(e, t) {
2371
- return t || Ba(e).thumbnailUrl;
2372
- }
2373
- //#endregion
2374
- //#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
2375
- var Ha = ["src", "alt"], Ua = {
2376
- class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
2377
- style: { opacity: "0.7" }
2378
- }, Wa = ["href"], Ga = ["src", "alt"], Ka = ["src", "alt"], qa = {
2379
- key: 3,
2380
- 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)]"
2381
- }, Ja = /* @__PURE__ */ d({
2382
- __name: "VideoBlock",
2383
- props: {
2384
- block: {},
2385
- viewport: {}
2386
- },
2387
- setup(e) {
2388
- let t = e, { t: n } = X(), { syntax: r } = Mn(), i = y(() => ke(t.block.url, r) || ke(t.block.thumbnailUrl, r)), a = G(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = G(() => i.value ? t.block.placeholderUrl : void 0), c = y(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : Va(t.block.url)), l = y(() => ({ textAlign: t.block.align })), u = y(() => {
2389
- let e = t.block.align;
2390
- return {
2391
- maxWidth: "100%",
2392
- width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
2393
- height: t.block.height ? `${t.block.height}px` : void 0,
2394
- display: "block",
2395
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
2396
- marginRight: e === "center" ? "auto" : void 0
2397
- };
2398
- }), d = y(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = y(() => ke(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
2399
- return (t, r) => (s(), b("div", {
2400
- class: "tpl:w-full",
2401
- style: E(l.value)
2402
- }, [i.value && e.block.placeholderUrl ? (s(), b("div", {
2403
- key: 0,
2404
- class: "tpl:relative tpl:inline-block",
2405
- style: E(u.value)
2406
- }, [O("img", {
2407
- class: "tpl:block tpl:w-full tpl:border-0",
2408
- src: m(o),
2409
- alt: e.block.alt,
2410
- style: E(d.value)
2411
- }, null, 12, Ha), h(za)], 4)) : i.value ? (s(), b("div", {
2412
- key: 1,
2413
- 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)]",
2414
- style: E([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
2415
- }, [h(m(Dn), {
2416
- size: 36,
2417
- "stroke-width": 1.5,
2418
- class: "tpl:text-[var(--tpl-primary)]",
2419
- style: { opacity: "0.5" }
2420
- }), O("span", Ua, [h(Br, { text: f.value }, null, 8, ["text"])])], 4)) : c.value ? (s(), b(N, { key: 2 }, [e.block.url ? (s(), b("a", {
2421
- key: 0,
2422
- href: e.block.url,
2423
- target: "_blank",
2424
- rel: "noopener noreferrer",
2425
- class: "tpl:group tpl:relative tpl:inline-block",
2426
- style: E(u.value),
2427
- onClick: r[0] ||= T(() => {}, ["prevent"])
2428
- }, [O("img", {
2429
- class: "tpl:block tpl:w-full tpl:border-0",
2430
- src: c.value,
2431
- alt: e.block.alt,
2432
- style: E(d.value)
2433
- }, null, 12, Ga), h(za, { "hover-effect": "" })], 12, Wa)) : (s(), b("div", {
2434
- key: 1,
2435
- class: "tpl:relative tpl:inline-block",
2436
- style: E(u.value)
2437
- }, [O("img", {
2438
- class: "tpl:block tpl:w-full tpl:border-0",
2439
- src: c.value,
2440
- alt: e.block.alt,
2441
- style: E(d.value)
2442
- }, null, 12, Ka), h(za)], 4))], 64)) : (s(), b("div", qa, [h(m(Dn), {
2443
- size: 40,
2444
- "stroke-width": 1.5,
2445
- class: "tpl:text-[var(--tpl-border-light)]"
2446
- }), O("span", null, P(m(n).video.addVideo), 1)]))], 4));
2447
- }
2448
- }), Ya = {
2449
- section: xa,
2450
- title: ua,
2451
- paragraph: Yi,
2452
- image: Ii,
2453
- button: Hr,
2454
- divider: vi,
2455
- video: Ja,
2456
- social: ka,
2457
- menu: Bi,
2458
- table: Ra,
2459
- spacer: Ma,
2460
- html: wi,
2461
- countdown: I(() => import("./CountdownBlock-Dasj191h.js"))
2462
- };
2463
- function Xa(e) {
2464
- let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } = X(i), d = y(() => we(we(we(nr(i), xr(n.content.value.settings?.locale)), _e(n.content.value.settings) === "rtl" ? {
2465
- title: { textAlign: "right" },
2466
- table: { textAlign: "right" }
2467
- } : {}), r.blockDefaults ?? {}));
2468
- n.setUiTheme(r.uiTheme ?? "auto");
2469
- let { resolvedTheme: f } = Wn(y(() => n.state.uiTheme)), m = l(r.theme ?? {}), { themeStyles: h } = Kn({
2470
- themeOverrides: m,
2471
- resolvedTheme: f,
2472
- extraStyles: () => ({
2473
- "--tpl-drop-text": `"${i.canvas.dropHere}"`,
2474
- ...e.themeExtraStyles?.()
2475
- })
2476
- }), g = qe({
2477
- content: n.content,
2478
- setContent: (e, t) => n.setContent(e, t),
2479
- ...e.historyOptions
2480
- });
2481
- Ge(n, g);
2482
- let _ = Ke({
2483
- addBlock: n.addBlock,
2484
- removeBlock: n.removeBlock,
2485
- updateBlock: n.updateBlock,
2486
- selectBlock: n.selectBlock,
2487
- findBlockLocation: n.findBlockLocation,
2488
- blockDefaults: () => d.value
2489
- }), b = Je(n), x = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? Ye({
2490
- content: n.content,
2491
- isDirty: () => n.state.isDirty,
2492
- ...e.autoSaveOptions
2493
- }) : null, S = null;
2494
- x && (S = t(g.isNavigating, (e) => {
2495
- e ? x.pause() : x.resume();
2496
- }));
2497
- let C = Un(n, {
2498
- t: s,
2499
- format: u
2500
- }, r.customBlocks ?? []), w = ln(r.colors);
2501
- if (w.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."), w.invalidPresets.length > 0 && Z.warn(`config.colors.presets skipped invalid entries: ${w.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), w.allowCustom === !1) {
2502
- let e = tr(w.presets, r.blockDefaults, r.templateDefaults);
2503
- 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.`);
2504
- }
2505
- let T = dn(r.templateSettings);
2506
- for (let e of T.unknown) Z.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${fn.join(", ")}) — skipping it.`);
2507
- let E = qn();
2508
- Qn(E, Ya);
2509
- let D = /* @__PURE__ */ new Set();
2510
- function O(e) {
2511
- for (let t of e) {
2512
- E.registerCustom(t, gi);
2513
- for (let e of Sr(t, w)) D.has(e.id) || (D.add(e.id), Z.warn(e.message));
2514
- }
2515
- }
2516
- r.customBlocks?.length && O(r.customBlocks);
2517
- let k = In();
2518
- if (o() && p(k.dispose), e.containerEl) {
2519
- let t = e.containerEl;
2520
- pt(document, "pointerdown", (e) => {
2521
- let n = t.value;
2522
- n && (e.composedPath?.() ?? []).includes(n) && k.claim();
2523
- }, { capture: !0 });
2524
- }
2525
- function A() {
2526
- let t = e.capabilities?.templates;
2527
- t ? t.save() : x?.flush();
2528
- }
2529
- function j(t) {
2530
- k.isActive() && wr(t, {
2531
- history: g,
2532
- selectBlock: (e) => n.selectBlock(e),
2533
- getSelectedBlockId: () => n.state.selectedBlockId,
2534
- removeBlock: (e) => n.removeBlock(e),
2535
- onSave: A,
2536
- onBeforeUndo: e.keyboardOptions?.onBeforeUndo,
2537
- isPicking: () => e.capabilities?.savedBlocks?.isPicking.value === !0,
2538
- onConfirmPick: () => e.capabilities?.savedBlocks?.confirmPicking(),
2539
- onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
2540
- });
2541
- }
2542
- pt(document, "keydown", j);
2543
- let M = l(null), N = e.editorRoot ?? document;
2544
- c(zt, N), c(_t, M), c(Lt, i), c(J, n), c(an, g), c(Bt, _), c(Wt, b), c(Y, a), c(Tt, h), c(Rt, f), c(Zt, d), c(It, r.locale), c(tn, E), c(Qt, r.customBlocks ?? []), c(on, r.paletteBlocks), c(Vt, $n(r.htmlBlockPreview)), c(vt, r.layout), c(St, r.sectionWrapper), c(Ut, w), c($t, T.fields), c(Yt, Jn(n.content, E));
2545
- let P = De(r.mergeTags?.syntax), F = v(r.mergeTags?.tags ?? []);
2546
- function I(e) {
2547
- Array.isArray(e) ? F.value = e : Z.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
2548
- }
2549
- c(q, F), c(At, P), c(Mt, r.mergeTags?.onRequest ?? null), c(qt, r.mergeTags?.autocomplete !== !1), c(kt, r.mergeTags?.showRawValue !== !1);
2550
- let L = l(Be(r.mergeTags?.tags ?? []));
2551
- c(Ot, L);
2552
- let R = Rn({
2553
- resolvePreview: r.resolvePreview,
2554
- getContent: () => {
2555
- let e = n.content.value;
2556
- return r.layout && n.state.previewMode ? me(r.layout, e) : e;
2557
- },
2558
- isActive: () => n.state.previewMode
2559
- });
2560
- c(Ft, R), c(Ct, r.resolvePreview);
2561
- let z = y(() => !(n.state.previewMode && R.isConfigured));
2562
- c(en, z);
2563
- let B = zn();
2564
- c(gt, B), c(Kt, l(!1)), c(yt, l(!1)), c(Pt, r.logicTags?.tags ?? []), c(nn, r.logicTags?.pairs ?? []), c(wt, r.logicTags?.onRequest ?? null), c(bt, Bn()), c(Dt, r.onRequestMedia ?? null), c(Ht, r.canDropMedia ?? null), c(rn, r.resolveImageUrl ? ct(r.resolveImageUrl) : null), c(Gt, r.displayConditions?.conditions ?? []), c(Xt, r.displayConditions?.allowCustom ?? !1), c(Jt, e.capabilities ?? {}), c(Nt, C);
2565
- let V = Vn(r.lint) ? null : Hn({
2566
- content: n.content,
2567
- options: r.lint ?? {},
2568
- updateBlock: n.updateBlock,
2569
- updateSettings: n.updateSettings,
2570
- removeBlock: n.removeBlock
2571
- });
2572
- c(Et, V);
2573
- function H() {
2574
- S?.(), V?.destroy(), x?.destroy(), g.destroy();
2575
- }
2576
- return {
2577
- t: s,
2578
- format: u,
2579
- editorRoot: N,
2580
- history: g,
2581
- blockActions: _,
2582
- conditionPreview: b,
2583
- autoSave: x,
2584
- resolvedTheme: f,
2585
- themeStyles: h,
2586
- themeOverrides: m,
2587
- registry: E,
2588
- keyboardReorder: C,
2589
- templateLint: V,
2590
- popoverRoot: M,
2591
- mergeTagSampleMode: L,
2592
- previewResolution: R,
2593
- appliesConditionFilter: z,
2594
- registerCustomBlocks: O,
2595
- setMergeTags: I,
2596
- destroy: H
2597
- };
2598
- }
2599
- //#endregion
2600
- export { Er as A, Gr as C, Fr as D, Pr as E, hr as F, mr as I, pr as L, vr as M, _r as N, Tr as O, gr as P, Rn as R, qr as S, Ar as T, si as _, ka as a, Qr as b, ma as c, Yi as d, Bi as f, gi as g, vi as h, Ma as i, ur as j, Rr as k, ua as l, wi as m, Ja as n, xa as o, Ii as p, Ra as r, da as s, Xa as t, ca as u, ai as v, Hr as w, Jr as x, ri as y };
2601
-
2602
- //# sourceMappingURL=useEditorCore-Bb2UcB20.js.map