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