@templatical/editor 0.48.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +4 -2
  2. package/dist/AiAltTextPopover-BZQ95GXL.js +106 -0
  3. package/dist/AiAltTextReview-DoBEudnE.js +206 -0
  4. package/dist/AiChatPanel-Bs6sES3b.js +550 -0
  5. package/dist/AiHeaderMenu-BEaTazx4.js +36 -0
  6. package/dist/AiPanels-CfN7A-ZA.js +33 -0
  7. package/dist/AiRewriteMenu-C3ZfDDYy.js +276 -0
  8. package/dist/{BlockIssueBadge-BShkuJis.js → BlockIssueBadge-CKwZ1Vgn.js} +11 -11
  9. package/dist/{BlockPreviewCanvas-tzAtDkXH.js → BlockPreviewCanvas-BXNLLLYi.js} +33 -33
  10. package/dist/CloudHeaderExtras-CsJMEiyN.js +23 -0
  11. package/dist/CloudPanels-B4F5m7vy.js +168 -0
  12. package/dist/CollaborationNotices-CNuDp7Y2.js +76 -0
  13. package/dist/CollaboratorBar-BtHPiuHq.js +123 -0
  14. package/dist/{CommentsPanel-DiWzYtnZ.js → CommentsPanel-CyCM-BvT.js} +4 -4
  15. package/dist/CommentsSidebar-Ca3DyFOX.js +500 -0
  16. package/dist/{cdn/chunks/CountdownBlock-Dasj191h.js → CountdownBlock-DR4Xm2-T.js} +24 -26
  17. package/dist/{CountdownToolbar-C4y3Ft7H.js → CountdownToolbar-CEIMPojJ.js} +56 -56
  18. package/dist/IssuesPanel-C8nMUccy.js +360 -0
  19. package/dist/{LoadingTrack-6XsqodoY.js → LoadingTrack-B0RKQWq3.js} +2 -2
  20. package/dist/{LogicTagInsertButton-B1_Wy0AN.js → LogicTagInsertButton-CqfU52CO.js} +272 -267
  21. package/dist/{cdn/chunks/MediaEditModal-zXfcArr4.js → MediaEditModal-DHtkZ4OU.js} +202 -186
  22. package/dist/{MediaPanels-9mDBv4aL.js → MediaPanels-CGcOB2pR.js} +4 -4
  23. package/dist/{MergeTagInput-fOewuF27.js → MergeTagInput-YnEkorTZ.js} +26 -26
  24. package/dist/{MergeTagModeToggle-BXamLcv7.js → MergeTagModeToggle-Dhb1DAcQ.js} +40 -40
  25. package/dist/MergeTagTextarea-e4lnwtqZ.js +70 -0
  26. package/dist/ParagraphEditor-B6NK0ytw.js +799 -0
  27. package/dist/{RestoreVersionDialog-BEKXx9xk.js → RestoreVersionDialog-Bq_IGOLJ.js} +22 -22
  28. package/dist/{RichTextEditorContent-D7kp7iig.js → RichTextEditorContent-AOM6fylS.js} +48 -48
  29. package/dist/{SaveBlockDialog-SJu0lecx.js → SaveBlockDialog-C8GngfQx.js} +88 -88
  30. package/dist/{cdn/chunks/SavedBlocksBrowserModal-CtnB58p_.js → SavedBlocksBrowserModal-wnkvxpm_.js} +102 -99
  31. package/dist/{SavedBlocksPanels-Dr5Fxx9Z.js → SavedBlocksPanels-C2s3q0pJ.js} +9 -9
  32. package/dist/{SavedBlocksPickBar-DnEWBZJy.js → SavedBlocksPickBar-BjcTiV87.js} +14 -14
  33. package/dist/TemplateSettings-BVBWpiDU.js +237 -0
  34. package/dist/{TestEmailModal-CbRY8HQx.js → TestEmailModal-SyhO9bn3.js} +57 -57
  35. package/dist/{TestEmailPanel-NAOmt3xi.js → TestEmailPanel-BDd2Rtav.js} +4 -4
  36. package/dist/{TitleEditor-Cc3DHbuN.js → TitleEditor-pxD53y_l.js} +75 -75
  37. package/dist/ToggleSwitch-D51U9cmR.js +37 -0
  38. package/dist/Toolbar-CZSPZYbj.js +3153 -0
  39. package/dist/{TplModal-Bz4-IZ9R.js → TplModal-DCzBzicE.js} +19 -19
  40. package/dist/{VersionHistoryMenu-CjV1d1zk.js → VersionHistoryMenu-BQeWPT85.js} +35 -35
  41. package/dist/{VersionHistoryPanels-BtwxrKJn.js → VersionHistoryPanels-BBm7YbRQ.js} +5 -5
  42. package/dist/{VersionPreviewBanner-BLAei1kj.js → VersionPreviewBanner-DUGF0tUJ.js} +10 -10
  43. package/dist/WrapperBlock-BO619LAb.js +45 -0
  44. package/dist/aiErrors-D5UOoYOt.js +41 -0
  45. package/dist/aiImageContext-BH4Ss1h3.js +48 -0
  46. package/dist/aiRewritePreview-DLGM05Ge.js +44 -0
  47. package/dist/{blockTypeIcons-CEDZytqP.js → blockTypeIcons-NzaYvAI4.js} +15 -14
  48. package/dist/bundle-stats.json +8 -8
  49. package/dist/{cdn/chunks/ca-CbNzJM3I.js → ca-C7mTzW1r.js} +147 -8
  50. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js +107 -0
  51. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js.map +1 -0
  52. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js +207 -0
  53. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js.map +1 -0
  54. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js +476 -0
  55. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js.map +1 -0
  56. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js +37 -0
  57. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js.map +1 -0
  58. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js +34 -0
  59. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js.map +1 -0
  60. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js +208 -0
  61. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js.map +1 -0
  62. package/dist/cdn/chunks/{BlockIssueBadge-C7sdnkrF.js → BlockIssueBadge-DAn2vsMJ.js} +13 -13
  63. package/dist/cdn/chunks/{BlockIssueBadge-C7sdnkrF.js.map → BlockIssueBadge-DAn2vsMJ.js.map} +1 -1
  64. package/dist/cdn/chunks/{BlockPreviewCanvas-vK5tBazr.js → BlockPreviewCanvas-D0--EQkP.js} +39 -39
  65. package/dist/cdn/chunks/{BlockPreviewCanvas-vK5tBazr.js.map → BlockPreviewCanvas-D0--EQkP.js.map} +1 -1
  66. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js +25 -0
  67. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js.map +1 -0
  68. package/dist/cdn/chunks/{CloudPanels-awqHfJqC.js → CloudPanels-C3jsxo_f.js} +52 -100
  69. package/dist/cdn/chunks/CloudPanels-C3jsxo_f.js.map +1 -0
  70. package/dist/cdn/chunks/CollaborationNotices-DjRI8gvs.js +78 -0
  71. package/dist/cdn/chunks/CollaborationNotices-DjRI8gvs.js.map +1 -0
  72. package/dist/cdn/chunks/CollaboratorBar-Dfzm6A9A.js +72 -0
  73. package/dist/cdn/chunks/CollaboratorBar-Dfzm6A9A.js.map +1 -0
  74. package/dist/cdn/chunks/CommentsPanel-CSO79OeX.js +20 -0
  75. package/dist/cdn/chunks/{CommentsPanel-CbzxwsyI.js.map → CommentsPanel-CSO79OeX.js.map} +1 -1
  76. package/dist/cdn/chunks/CommentsSidebar-CCvplq1Z.js +470 -0
  77. package/dist/cdn/chunks/{CommentsSidebar-DWPHZuQm.js.map → CommentsSidebar-CCvplq1Z.js.map} +1 -1
  78. package/dist/{CountdownBlock-zx39Dyby.js → cdn/chunks/CountdownBlock-C6USdwk3.js} +19 -17
  79. package/dist/cdn/chunks/{CountdownBlock-Dasj191h.js.map → CountdownBlock-C6USdwk3.js.map} +1 -1
  80. package/dist/cdn/chunks/{CountdownToolbar-Cqg8FUH-.js → CountdownToolbar-Cjud2Tos.js} +71 -71
  81. package/dist/cdn/chunks/{CountdownToolbar-Cqg8FUH-.js.map → CountdownToolbar-Cjud2Tos.js.map} +1 -1
  82. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js +340 -0
  83. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js.map +1 -0
  84. package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js → LoadingTrack-BIcL4NiY.js} +2 -2
  85. package/dist/cdn/chunks/{LoadingTrack-DbH97JR9.js.map → LoadingTrack-BIcL4NiY.js.map} +1 -1
  86. package/dist/cdn/chunks/{LogicTagInsertButton-BMB9vShs.js → LogicTagInsertButton-CsL2JDOG.js} +374 -369
  87. package/dist/cdn/chunks/LogicTagInsertButton-CsL2JDOG.js.map +1 -0
  88. package/dist/{MediaEditModal-ByOvznRC.js → cdn/chunks/MediaEditModal-BuHCiyMu.js} +544 -560
  89. package/dist/cdn/chunks/MediaEditModal-BuHCiyMu.js.map +1 -0
  90. package/dist/cdn/chunks/MediaPanels-DAgUf_T1.js +45 -0
  91. package/dist/cdn/chunks/{MediaPanels-Cp4XB_dH.js.map → MediaPanels-DAgUf_T1.js.map} +1 -1
  92. package/dist/cdn/chunks/{MergeTagInput-DLqrA9co.js → MergeTagInput-C8U-7LxL.js} +34 -34
  93. package/dist/cdn/chunks/{MergeTagInput-DLqrA9co.js.map → MergeTagInput-C8U-7LxL.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-BRiJzzn5.js → MergeTagModeToggle-Mm-p0A52.js} +41 -41
  95. package/dist/cdn/chunks/{MergeTagModeToggle-BRiJzzn5.js.map → MergeTagModeToggle-Mm-p0A52.js.map} +1 -1
  96. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js +72 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js +634 -0
  99. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-BgR6RXSb.js → RestoreVersionDialog-CdA5osuA.js} +26 -26
  101. package/dist/cdn/chunks/{RestoreVersionDialog-BgR6RXSb.js.map → RestoreVersionDialog-CdA5osuA.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-C4DMAn0g.js → RichTextEditorContent-Q1d2xqBT.js} +46 -46
  103. package/dist/cdn/chunks/{RichTextEditorContent-C4DMAn0g.js.map → RichTextEditorContent-Q1d2xqBT.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-BaIsQd09.js → SaveBlockDialog-CijargAy.js} +78 -78
  105. package/dist/cdn/chunks/{SaveBlockDialog-BaIsQd09.js.map → SaveBlockDialog-CijargAy.js.map} +1 -1
  106. package/dist/cdn/chunks/SavedBlocksBrowserModal-DtOz_X5S.js +357 -0
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-CtnB58p_.js.map → SavedBlocksBrowserModal-DtOz_X5S.js.map} +1 -1
  108. package/dist/cdn/chunks/SavedBlocksPanels-BowyED5h.js +38 -0
  109. package/dist/cdn/chunks/{SavedBlocksPanels-BhEOMzEQ.js.map → SavedBlocksPanels-BowyED5h.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-CcdqTEIp.js → SavedBlocksPickBar-BPRaJBv3.js} +19 -19
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-CcdqTEIp.js.map → SavedBlocksPickBar-BPRaJBv3.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-ByZeBO34.js +209 -0
  113. package/dist/cdn/chunks/{TemplateSettings-BkkWTDHD.js.map → TemplateSettings-ByZeBO34.js.map} +1 -1
  114. package/dist/cdn/chunks/{TestEmailModal-V5mwHsUV.js → TestEmailModal-BUVTj3Ic.js} +54 -54
  115. package/dist/cdn/chunks/{TestEmailModal-V5mwHsUV.js.map → TestEmailModal-BUVTj3Ic.js.map} +1 -1
  116. package/dist/cdn/chunks/TestEmailPanel-BxutYoWg.js +35 -0
  117. package/dist/cdn/chunks/{TestEmailPanel-DxrKuctP.js.map → TestEmailPanel-BxutYoWg.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Ccv6uoTz.js +199 -0
  119. package/dist/cdn/chunks/{TitleEditor-CsZiG3TT.js.map → TitleEditor-Ccv6uoTz.js.map} +1 -1
  120. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js +39 -0
  121. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js.map +1 -0
  122. package/dist/cdn/chunks/{Toolbar-C_x2TfFk.js → Toolbar-DoprRgTn.js} +1097 -1101
  123. package/dist/cdn/chunks/Toolbar-DoprRgTn.js.map +1 -0
  124. package/dist/cdn/chunks/{TplModal-DC_eodTV.js → TplModal-BXQzmsJX.js} +21 -21
  125. package/dist/cdn/chunks/{TplModal-DC_eodTV.js.map → TplModal-BXQzmsJX.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-DXnM5Df2.js → VersionHistoryMenu-BF2fNCvq.js} +41 -41
  127. package/dist/cdn/chunks/{VersionHistoryMenu-DXnM5Df2.js.map → VersionHistoryMenu-BF2fNCvq.js.map} +1 -1
  128. package/dist/cdn/chunks/VersionHistoryPanels-Dal0Uk69.js +48 -0
  129. package/dist/cdn/chunks/{VersionHistoryPanels-DXSqmaLS.js.map → VersionHistoryPanels-Dal0Uk69.js.map} +1 -1
  130. package/dist/cdn/chunks/{VersionPreviewBanner-DKyN6BhO.js → VersionPreviewBanner-BaGcn-b1.js} +13 -13
  131. package/dist/cdn/chunks/{VersionPreviewBanner-DKyN6BhO.js.map → VersionPreviewBanner-BaGcn-b1.js.map} +1 -1
  132. package/dist/cdn/chunks/WrapperBlock-DkQJtLz0.js +47 -0
  133. package/dist/cdn/chunks/{WrapperBlock-gG_Bleug.js.map → WrapperBlock-DkQJtLz0.js.map} +1 -1
  134. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js +43 -0
  135. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js.map +1 -0
  136. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js +50 -0
  137. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js.map +1 -0
  138. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js +46 -0
  139. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js.map +1 -0
  140. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js +22 -0
  141. package/dist/cdn/chunks/{blockTypeIcons-HrMJDfVg.js.map → blockTypeIcons-ikZAmd6U.js.map} +1 -1
  142. package/dist/{ca-CbNzJM3I.js → cdn/chunks/ca-C7mTzW1r.js} +149 -6
  143. package/dist/cdn/chunks/ca-C7mTzW1r.js.map +1 -0
  144. package/dist/cdn/chunks/createCloudRuntime-DpBWhrv3.js +1408 -0
  145. package/dist/cdn/chunks/createCloudRuntime-DpBWhrv3.js.map +1 -0
  146. package/dist/cdn/chunks/de-DBOTcDj2.js +22 -0
  147. package/dist/cdn/chunks/de-DBOTcDj2.js.map +1 -0
  148. package/dist/{de-DMquBpZM.js → cdn/chunks/de-DNuYQTmS.js} +149 -6
  149. package/dist/cdn/chunks/de-DNuYQTmS.js.map +1 -0
  150. package/dist/{dist-CUWI-IvA.js → cdn/chunks/dist-Bo8Thh8v.js} +60 -58
  151. package/dist/cdn/chunks/{dist-CjL6JHML.js.map → dist-Bo8Thh8v.js.map} +1 -1
  152. package/dist/cdn/chunks/dist-S-rLGqax.js +406 -0
  153. package/dist/cdn/chunks/{dist-MNQYSEWU.js.map → dist-S-rLGqax.js.map} +1 -1
  154. package/dist/cdn/chunks/{draggable-DrsNwZuB.js → draggable-DZ0gwUJ6.js} +1359 -1266
  155. package/dist/cdn/chunks/draggable-DZ0gwUJ6.js.map +1 -0
  156. package/dist/cdn/chunks/{editor-modal-vEEmZ8Tu.js → editor-modal-CI6EfeMd.js} +881 -881
  157. package/dist/cdn/chunks/{editor-modal-vEEmZ8Tu.js.map → editor-modal-CI6EfeMd.js.map} +1 -1
  158. package/dist/cdn/chunks/en-CDhWRrF_.js +22 -0
  159. package/dist/cdn/chunks/en-CDhWRrF_.js.map +1 -0
  160. package/dist/{en-C8Mp71sO.js → cdn/chunks/en-CW71OK66.js} +149 -6
  161. package/dist/cdn/chunks/en-CW71OK66.js.map +1 -0
  162. package/dist/cdn/chunks/en-ifvu6oPv.js +1 -0
  163. package/dist/{es-Byq4tthI.js → cdn/chunks/es-DdK7zQfi.js} +149 -6
  164. package/dist/cdn/chunks/es-DdK7zQfi.js.map +1 -0
  165. package/dist/cdn/chunks/{extensions-hJ9VqzDc.js → extensions-taJTZlLK.js} +71 -71
  166. package/dist/cdn/chunks/{extensions-hJ9VqzDc.js.map → extensions-taJTZlLK.js.map} +1 -1
  167. package/dist/{fr-B3j35HEw.js → cdn/chunks/fr-Dz5Bgb7-.js} +149 -6
  168. package/dist/cdn/chunks/fr-Dz5Bgb7-.js.map +1 -0
  169. package/dist/cdn/chunks/{icons-aTYwH5-g.js → icons-DNX6StSs.js} +183 -150
  170. package/dist/cdn/chunks/icons-DNX6StSs.js.map +1 -0
  171. package/dist/{ja-D7txAuGS.js → cdn/chunks/ja-Di-zJiT8.js} +149 -6
  172. package/dist/cdn/chunks/ja-Di-zJiT8.js.map +1 -0
  173. package/dist/cdn/chunks/keys-BTpmg2Tt.js +12 -0
  174. package/dist/cdn/chunks/keys-BTpmg2Tt.js.map +1 -0
  175. package/dist/{logger-BBlvSn6q.js → cdn/chunks/logger-Tj0RPskW.js} +7 -1
  176. package/dist/cdn/chunks/logger-Tj0RPskW.js.map +1 -0
  177. package/dist/{nl-ClJ3BY3F.js → cdn/chunks/nl-CvVuHYFL.js} +149 -6
  178. package/dist/cdn/chunks/nl-CvVuHYFL.js.map +1 -0
  179. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js +199 -0
  180. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js.map +1 -0
  181. package/dist/cdn/chunks/{preRenderCustomBlocks-ByfuSjtL.js → preRenderCustomBlocks-Dc-QLntG.js} +4 -4
  182. package/dist/cdn/chunks/{preRenderCustomBlocks-ByfuSjtL.js.map → preRenderCustomBlocks-Dc-QLntG.js.map} +1 -1
  183. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js +22 -0
  184. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js.map +1 -0
  185. package/dist/{pt-BR-DibcXcmv.js → cdn/chunks/pt-BR-ZhO4vgyq.js} +149 -6
  186. package/dist/cdn/chunks/pt-BR-ZhO4vgyq.js.map +1 -0
  187. package/dist/cdn/chunks/{pusher-C8DeiO2X.js → pusher-Cs4GGEtd.js} +2 -2
  188. package/dist/cdn/chunks/pusher-Cs4GGEtd.js.map +1 -0
  189. package/dist/cdn/chunks/{rolldown-runtime-B0aSnxlc.js → rolldown-runtime-Y_bBpyJl.js} +1 -1
  190. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js +62 -0
  191. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js.map +1 -0
  192. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js +2032 -0
  193. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js.map +1 -0
  194. package/dist/cdn/chunks/{src-DYCDeBDM.js → src-BNFnxfrA.js} +694 -329
  195. package/dist/cdn/chunks/src-BNFnxfrA.js.map +1 -0
  196. package/dist/cdn/chunks/{src-dZ4D_tuP.js → src-BcTUmgLe.js} +181 -181
  197. package/dist/cdn/chunks/src-BcTUmgLe.js.map +1 -0
  198. package/dist/cdn/chunks/src-Bs_yxk3h.js +4392 -0
  199. package/dist/cdn/chunks/src-Bs_yxk3h.js.map +1 -0
  200. package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +2 -4
  201. package/dist/cdn/chunks/{styleConstants-D1Jz-TFU.js.map → styleConstants-v1dNKgJf.js.map} +1 -1
  202. package/dist/cdn/chunks/{tiptap-BPigZk5G.js → tiptap-CtVrAViq.js} +44 -44
  203. package/dist/cdn/chunks/tiptap-CtVrAViq.js.map +1 -0
  204. package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js → useCloudI18n-AVXhzbhQ.js} +4 -4
  205. package/dist/cdn/chunks/{useCloudI18n-BBF4waXO.js.map → useCloudI18n-AVXhzbhQ.js.map} +1 -1
  206. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js +2586 -0
  207. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js.map +1 -0
  208. package/dist/cdn/chunks/useEditorRoot-CR5GjJD6.js +10 -0
  209. package/dist/cdn/chunks/{useEditorRoot-CTc6O8al.js.map → useEditorRoot-CR5GjJD6.js.map} +1 -1
  210. package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js → useI18n-CbVubQhM.js} +3 -3
  211. package/dist/cdn/chunks/{useI18n-DUlyyIJJ.js.map → useI18n-CbVubQhM.js.map} +1 -1
  212. package/dist/cdn/chunks/{useLogicTag-HsyUCQtl.js → useLogicTag-B49Nc53Y.js} +5 -5
  213. package/dist/cdn/chunks/{useLogicTag-HsyUCQtl.js.map → useLogicTag-B49Nc53Y.js.map} +1 -1
  214. package/dist/cdn/chunks/{useMergeTag-Dg9pE85U.js → useMergeTag-B0KryMj8.js} +7 -7
  215. package/dist/cdn/chunks/{useMergeTag-Dg9pE85U.js.map → useMergeTag-B0KryMj8.js.map} +1 -1
  216. package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js → usePopoverPosition-C829ps5i.js} +4 -4
  217. package/dist/cdn/chunks/{usePopoverPosition-IbaW6-Ao.js.map → usePopoverPosition-C829ps5i.js.map} +1 -1
  218. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js +51 -0
  219. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js.map +1 -0
  220. package/dist/cdn/chunks/{withCurrentFont-oLcATrQ8.js → withCurrentFont-DFPXeVfG.js} +2 -2
  221. package/dist/cdn/chunks/{withCurrentFont-oLcATrQ8.js.map → withCurrentFont-DFPXeVfG.js.map} +1 -1
  222. package/dist/cdn/editor.css +1 -1
  223. package/dist/cdn/editor.js +2235 -1311
  224. package/dist/cdn/editor.js.map +1 -1
  225. package/dist/{check-ClwqRMgv.js → check-yYsp5Xpk.js} +1 -1
  226. package/dist/{chevron-down-te6qn-zE.js → chevron-down-DTmD06_j.js} +1 -1
  227. package/dist/{chevron-right-W2hbH1FM.js → chevron-right-BSeYZOxc.js} +1 -1
  228. package/dist/{chevron-up-Bf5Zo7o4.js → chevron-up-BOApwrxi.js} +1 -1
  229. package/dist/{circle-alert-CIEGV5DN.js → circle-alert-BMszY8im.js} +1 -1
  230. package/dist/{clock-Y4cx0gkJ.js → clock-HADxnl6-.js} +1 -1
  231. package/dist/createCloudRuntime-DVQI_ReU.js +1379 -0
  232. package/dist/{createLucideIcon-CYHXK9hn.js → createLucideIcon-0lYYH3EW.js} +6 -6
  233. package/dist/de-DBOTcDj2.js +20 -0
  234. package/dist/{cdn/chunks/de-DMquBpZM.js → de-DNuYQTmS.js} +147 -8
  235. package/dist/{cdn/chunks/dist-CjL6JHML.js → dist-C7EtxNCb.js} +49 -51
  236. package/dist/{dist-DuufrR8O.js → dist-C_dV9QAx.js} +130 -130
  237. package/dist/{cdn/chunks/dist-MNQYSEWU.js → dist-DI4_YSnG.js} +111 -110
  238. package/dist/{dist-tsmnQugO.js → dist-DtOF3bDW.js} +648 -294
  239. package/dist/{editor-modal-AlVLkU91.js → editor-modal-Bzhl-PgI.js} +832 -834
  240. package/dist/en-CDhWRrF_.js +20 -0
  241. package/dist/{cdn/chunks/en-C8Mp71sO.js → en-CW71OK66.js} +147 -8
  242. package/dist/en-DwV15ltA.js +1 -0
  243. package/dist/{cdn/chunks/es-Byq4tthI.js → es-DdK7zQfi.js} +147 -8
  244. package/dist/{extensions-pjO8VGkM.js → extensions-CdyweA50.js} +54 -54
  245. package/dist/{eye-Ddnz8nnm.js → eye-DWkSvYpj.js} +1 -1
  246. package/dist/{cdn/chunks/fr-B3j35HEw.js → fr-Dz5Bgb7-.js} +147 -8
  247. package/dist/image-DesWjcZ4.js +28 -0
  248. package/dist/index.d.ts +640 -48
  249. package/dist/{info-DXLmzoeY.js → info-ClWJGoZy.js} +1 -1
  250. package/dist/{cdn/chunks/ja-D7txAuGS.js → ja-Di-zJiT8.js} +147 -8
  251. package/dist/keys-Zd9KWRD1.js +10 -0
  252. package/dist/{link-Cel46wgo.js → link-BqRicFTA.js} +1 -1
  253. package/dist/{list-Cl0GwiV9.js → list-bojQr9bn.js} +1 -1
  254. package/dist/{loader-circle-uAwpvfys.js → loader-circle-B2B8LbUu.js} +1 -1
  255. package/dist/{cdn/chunks/logger-ByvdoAwq.js → logger-k9Nbj3Cp.js} +5 -3
  256. package/dist/{message-circle-DWU1pTM_.js → message-circle-BEuiNsyZ.js} +1 -1
  257. package/dist/{cdn/chunks/nl-ClJ3BY3F.js → nl-CvVuHYFL.js} +147 -8
  258. package/dist/normalizeMergeTagMarkup-P6SUBuPv.js +197 -0
  259. package/dist/{package-CbyG_yU_.js → package-DCROB4aM.js} +1 -1
  260. package/dist/{pencil-BzoDcwKu.js → pencil-CEotCKbf.js} +1 -1
  261. package/dist/{preRenderCustomBlocks-DMP5RuHl.js → preRenderCustomBlocks-D8rr61_z.js} +3 -3
  262. package/dist/pt-BR-CHM-ZKvE.js +20 -0
  263. package/dist/{cdn/chunks/pt-BR-DibcXcmv.js → pt-BR-ZhO4vgyq.js} +147 -8
  264. package/dist/{refresh-cw-9WinWixo.js → refresh-cw-C6M2mHNC.js} +12 -2
  265. package/dist/{runtime-dom.esm-bundler-lFF-QG3j.js → runtime-dom.esm-bundler-B8WCZWUm.js} +134 -134
  266. package/dist/sanitizeRichTextHtml-DeISfLFr.js +60 -0
  267. package/dist/{search-CqgGq1gG.js → search-Cy99zPYf.js} +1 -1
  268. package/dist/{send-Ceo3c9Db.js → send-BDLJFsf3.js} +1 -1
  269. package/dist/{smartphone-CcLaCpGK.js → smartphone-CVvQaNA4.js} +1 -1
  270. package/dist/socialIcons-Dd-jRiVe.js +2086 -0
  271. package/dist/{sparkles-Do9XjAuT.js → sparkles-Ce0Qz0ox.js} +1 -1
  272. package/dist/square-BWlolnXe.js +15 -0
  273. package/dist/style.css +1 -1
  274. package/dist/{styleConstants-D1Jz-TFU.js → styleConstants-v1dNKgJf.js} +1 -3
  275. package/dist/templatical-editor.js +2272 -1327
  276. package/dist/{text-align-start-DvzC0HQA.js → text-align-start-D1V5gPTy.js} +1 -1
  277. package/dist/{trash-vlINTx32.js → trash-CZfiUFmw.js} +1 -1
  278. package/dist/{triangle-alert-MRYSJ9T2.js → triangle-alert-CFDzyFC7.js} +1 -1
  279. package/dist/upload-BJfvdIrD.js +36 -0
  280. package/dist/{useCloudI18n-Nwqo7pI_.js → useCloudI18n-Dcjua65H.js} +5 -5
  281. package/dist/{useEditorCore-PvErWWsp.js → useEditorCore-BTLeAVlM.js} +1534 -1549
  282. package/dist/{useEditorRoot-BD3piYtD.js → useEditorRoot-DUy67lJu.js} +2 -2
  283. package/dist/{useI18n-CxVEpurs.js → useI18n-BdoY7xDE.js} +4 -4
  284. package/dist/{useLogicTag-BHn67tDd.js → useLogicTag-DKLZ1T9H.js} +3 -3
  285. package/dist/{useMergeTag-CRkm5Ig6.js → useMergeTag-Bhdx7AKk.js} +5 -5
  286. package/dist/{usePopoverPosition-CwnH1o5g.js → usePopoverPosition-BZea45XK.js} +2 -2
  287. package/dist/useScrollToBlock-FmNMALM_.js +74 -0
  288. package/dist/{vue.runtime.esm-bundler-CAzmrXdD.js → vue.runtime.esm-bundler-DgFJ6GPG.js} +1182 -1087
  289. package/dist/{withCurrentFont-CxRGeHO3.js → withCurrentFont-BATJHNve.js} +1 -1
  290. package/dist/{x-Cd6SFw8r.js → x-CZ0Js0hA.js} +1 -1
  291. package/package.json +17 -15
  292. package/dist/AiChatSidebar-DxPHFNoT.js +0 -230
  293. package/dist/AiFeatureMenu-C8GVqu1d.js +0 -57
  294. package/dist/CloudHeaderExtras-CUSftQdm.js +0 -59
  295. package/dist/CloudPanels-Dgw7tb4R.js +0 -216
  296. package/dist/CollaboratorBar-5rfopCPx.js +0 -103
  297. package/dist/CommentsSidebar-BOqj16Al.js +0 -500
  298. package/dist/DesignReferenceSidebar-BWAi3eQQ.js +0 -279
  299. package/dist/IssuesPanel-C-x3I012.js +0 -117
  300. package/dist/ParagraphEditor-BVjOwwHx.js +0 -797
  301. package/dist/SavedBlocksBrowserModal-DbmIS5uK.js +0 -360
  302. package/dist/TemplateScoringPanel-ynbGl-sr.js +0 -273
  303. package/dist/TemplateSettings-Bi01S3H3.js +0 -246
  304. package/dist/ToggleSwitch-Ozc7YU38.js +0 -102
  305. package/dist/Toolbar-B-2lO0I8.js +0 -3156
  306. package/dist/WrapperBlock-D0qgNqjD.js +0 -45
  307. package/dist/cdn/chunks/AiChatSidebar-Dk0rJBQN.js +0 -205
  308. package/dist/cdn/chunks/AiChatSidebar-Dk0rJBQN.js.map +0 -1
  309. package/dist/cdn/chunks/AiFeatureMenu-B7b0w8ZS.js +0 -57
  310. package/dist/cdn/chunks/AiFeatureMenu-B7b0w8ZS.js.map +0 -1
  311. package/dist/cdn/chunks/CloudHeaderExtras-B4fhuwc_.js +0 -60
  312. package/dist/cdn/chunks/CloudHeaderExtras-B4fhuwc_.js.map +0 -1
  313. package/dist/cdn/chunks/CloudPanels-awqHfJqC.js.map +0 -1
  314. package/dist/cdn/chunks/CollaboratorBar-CS0ivqkr.js +0 -52
  315. package/dist/cdn/chunks/CollaboratorBar-CS0ivqkr.js.map +0 -1
  316. package/dist/cdn/chunks/CommentsPanel-CbzxwsyI.js +0 -20
  317. package/dist/cdn/chunks/CommentsSidebar-DWPHZuQm.js +0 -470
  318. package/dist/cdn/chunks/DesignReferenceSidebar-BW9cHnA9.js +0 -229
  319. package/dist/cdn/chunks/DesignReferenceSidebar-BW9cHnA9.js.map +0 -1
  320. package/dist/cdn/chunks/IssuesPanel-cXf9ywA4.js +0 -100
  321. package/dist/cdn/chunks/IssuesPanel-cXf9ywA4.js.map +0 -1
  322. package/dist/cdn/chunks/LogicTagInsertButton-BMB9vShs.js.map +0 -1
  323. package/dist/cdn/chunks/MediaEditModal-zXfcArr4.js.map +0 -1
  324. package/dist/cdn/chunks/MediaPanels-Cp4XB_dH.js +0 -45
  325. package/dist/cdn/chunks/ParagraphEditor-D4aq9eeC.js +0 -632
  326. package/dist/cdn/chunks/ParagraphEditor-D4aq9eeC.js.map +0 -1
  327. package/dist/cdn/chunks/SavedBlocksPanels-BhEOMzEQ.js +0 -38
  328. package/dist/cdn/chunks/TemplateScoringPanel-BrWqJCSP.js +0 -237
  329. package/dist/cdn/chunks/TemplateScoringPanel-BrWqJCSP.js.map +0 -1
  330. package/dist/cdn/chunks/TemplateSettings-BkkWTDHD.js +0 -208
  331. package/dist/cdn/chunks/TestEmailPanel-DxrKuctP.js +0 -35
  332. package/dist/cdn/chunks/TitleEditor-CsZiG3TT.js +0 -199
  333. package/dist/cdn/chunks/ToggleSwitch-BB-bQADJ.js +0 -104
  334. package/dist/cdn/chunks/ToggleSwitch-BB-bQADJ.js.map +0 -1
  335. package/dist/cdn/chunks/Toolbar-C_x2TfFk.js.map +0 -1
  336. package/dist/cdn/chunks/VersionHistoryPanels-DXSqmaLS.js +0 -48
  337. package/dist/cdn/chunks/WrapperBlock-gG_Bleug.js +0 -47
  338. package/dist/cdn/chunks/blockTypeIcons-HrMJDfVg.js +0 -22
  339. package/dist/cdn/chunks/ca-CbNzJM3I.js.map +0 -1
  340. package/dist/cdn/chunks/cloud-BHClP3e2.js +0 -1736
  341. package/dist/cdn/chunks/cloud-BHClP3e2.js.map +0 -1
  342. package/dist/cdn/chunks/createCloudRuntime-Vd0N4elZ.js +0 -400
  343. package/dist/cdn/chunks/createCloudRuntime-Vd0N4elZ.js.map +0 -1
  344. package/dist/cdn/chunks/de-DMquBpZM.js.map +0 -1
  345. package/dist/cdn/chunks/de-mMY5yQJu.js +0 -93
  346. package/dist/cdn/chunks/de-mMY5yQJu.js.map +0 -1
  347. package/dist/cdn/chunks/draggable-DrsNwZuB.js.map +0 -1
  348. package/dist/cdn/chunks/en-C8Mp71sO.js.map +0 -1
  349. package/dist/cdn/chunks/en-ChVeGQBY.js +0 -93
  350. package/dist/cdn/chunks/en-ChVeGQBY.js.map +0 -1
  351. package/dist/cdn/chunks/en-eWpiXyZu.js +0 -1
  352. package/dist/cdn/chunks/es-Byq4tthI.js.map +0 -1
  353. package/dist/cdn/chunks/fr-B3j35HEw.js.map +0 -1
  354. package/dist/cdn/chunks/icons-aTYwH5-g.js.map +0 -1
  355. package/dist/cdn/chunks/ja-D7txAuGS.js.map +0 -1
  356. package/dist/cdn/chunks/keys-HI-INbkz.js +0 -12
  357. package/dist/cdn/chunks/keys-HI-INbkz.js.map +0 -1
  358. package/dist/cdn/chunks/logger-ByvdoAwq.js.map +0 -1
  359. package/dist/cdn/chunks/nl-ClJ3BY3F.js.map +0 -1
  360. package/dist/cdn/chunks/pt-BR-CoCwRUi0.js +0 -93
  361. package/dist/cdn/chunks/pt-BR-CoCwRUi0.js.map +0 -1
  362. package/dist/cdn/chunks/pt-BR-DibcXcmv.js.map +0 -1
  363. package/dist/cdn/chunks/pusher-C8DeiO2X.js.map +0 -1
  364. package/dist/cdn/chunks/socialIcons-C_lnkpG6.js +0 -1279
  365. package/dist/cdn/chunks/socialIcons-C_lnkpG6.js.map +0 -1
  366. package/dist/cdn/chunks/src-DYCDeBDM.js.map +0 -1
  367. package/dist/cdn/chunks/src-DlFlC9Tt.js +0 -1272
  368. package/dist/cdn/chunks/src-DlFlC9Tt.js.map +0 -1
  369. package/dist/cdn/chunks/src-dZ4D_tuP.js.map +0 -1
  370. package/dist/cdn/chunks/timeouts-Cv2jvusx.js +0 -6
  371. package/dist/cdn/chunks/timeouts-Cv2jvusx.js.map +0 -1
  372. package/dist/cdn/chunks/tiptap-BPigZk5G.js.map +0 -1
  373. package/dist/cdn/chunks/useAliveFlag-DCB96vzR.js +0 -12
  374. package/dist/cdn/chunks/useAliveFlag-DCB96vzR.js.map +0 -1
  375. package/dist/cdn/chunks/useEditorCore-Bb2UcB20.js +0 -2602
  376. package/dist/cdn/chunks/useEditorCore-Bb2UcB20.js.map +0 -1
  377. package/dist/cdn/chunks/useEditorRoot-CTc6O8al.js +0 -10
  378. package/dist/cdn/chunks/useScrollToBlock-uUa601I4.js +0 -21
  379. package/dist/cdn/chunks/useScrollToBlock-uUa601I4.js.map +0 -1
  380. package/dist/cloud-B5xwm_4X.js +0 -1689
  381. package/dist/copy-BEcsAlfB.js +0 -19
  382. package/dist/createCloudRuntime-zNPkF6T9.js +0 -398
  383. package/dist/de-mMY5yQJu.js +0 -91
  384. package/dist/dist-DAAJogrx.js +0 -407
  385. package/dist/en-B0FUfNwz.js +0 -1
  386. package/dist/en-ChVeGQBY.js +0 -91
  387. package/dist/image-up-CM_HC0Dx.js +0 -27
  388. package/dist/keys-BKFq19a2.js +0 -10
  389. package/dist/plus-8cDvoCjZ.js +0 -14
  390. package/dist/pt-BR-CoCwRUi0.js +0 -91
  391. package/dist/shield-check-uDAwur5D.js +0 -14
  392. package/dist/socialIcons-PTiwhLoC.js +0 -1359
  393. package/dist/timeouts-Cv2jvusx.js +0 -4
  394. package/dist/upload-CtNOI6J2.js +0 -21
  395. package/dist/useAliveFlag-Dd06mRxe.js +0 -10
  396. package/dist/useScrollToBlock-CXmcHQQN.js +0 -47
@@ -1,1359 +0,0 @@
1
- import { A as e, At as t, H as n, J as r, R as i, S as a, W as o, X as s, Y as c, Z as l, at as u, d, g as f, h as p, jt as m, kt as h, ot as g, r as _, rt as v, s as y, v as b } from "./vue.runtime.esm-bundler-CAzmrXdD.js";
2
- import { $ as x, C as S, V as C, _ as w, _t as T, d as E, dt as D, g as O, h as k, l as A, m as j, p as M, st as N, tt as P, u as F, y as I } from "./dist-tsmnQugO.js";
3
- import { r as L } from "./dist-DAAJogrx.js";
4
- import { L as R, P as ee, c as te, x as ne } from "./keys-BKFq19a2.js";
5
- import { r as re } from "./timeouts-Cv2jvusx.js";
6
- import { t as ie } from "./useI18n-CxVEpurs.js";
7
- import { o as ae, s as oe } from "./usePopoverPosition-CwnH1o5g.js";
8
- import { t as z } from "./createLucideIcon-CYHXK9hn.js";
9
- import { t as se } from "./loader-circle-uAwpvfys.js";
10
- import { t as ce } from "./upload-CtNOI6J2.js";
11
- import { t as le } from "./useAliveFlag-Dd06mRxe.js";
12
- //#region ../core/dist/index.js
13
- function B(e) {
14
- return e instanceof Error ? e : Error(String(e), { cause: e });
15
- }
16
- function V(e, t) {
17
- try {
18
- t();
19
- } catch (t) {
20
- e?.(B(t));
21
- }
22
- }
23
- function H(e) {
24
- return e === "1" ? 1 : e === "3" ? 3 : 2;
25
- }
26
- function ue(e) {
27
- let t = e.content ?? S(e.defaultFontFamily, e.templateDefaults);
28
- j(t), k(t);
29
- let r = c({
30
- template: null,
31
- content: t,
32
- selectedBlockId: null,
33
- viewport: "desktop",
34
- darkMode: !1,
35
- previewMode: !1,
36
- isDirty: !1,
37
- isSaving: !1,
38
- isLoading: !1,
39
- uiTheme: "auto"
40
- }), i = 0;
41
- function a() {
42
- r.isDirty = !0, i++;
43
- }
44
- let o = n({
45
- get: () => r.content,
46
- set: (e) => {
47
- r.content = e, a();
48
- }
49
- }), l = n(() => r.selectedBlockId ? u(r.content.blocks, r.selectedBlockId) : null);
50
- function u(e, t) {
51
- for (let n of e) {
52
- if (n.id === t) return n;
53
- if (n.type === "section") for (let e of n.children) {
54
- let n = u(e, t);
55
- if (n) return n;
56
- }
57
- }
58
- return null;
59
- }
60
- function d(e, t) {
61
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) d(e, t);
62
- }
63
- function f(e, t, n = { blocks: e }) {
64
- for (let r = 0; r < e.length; r++) {
65
- let i = e[r];
66
- if (i.id === t) return n;
67
- if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
68
- let n = f(i.children[e], t, {
69
- blocks: i.children[e],
70
- sectionId: i.id,
71
- columnIndex: e
72
- });
73
- if (n) return n;
74
- }
75
- }
76
- return null;
77
- }
78
- function p(t) {
79
- return e.lockedBlocks?.value.has(t) ?? !1;
80
- }
81
- function m(e) {
82
- let t = f(r.content.blocks, e);
83
- if (!t) return null;
84
- let n = t.blocks.findIndex((t) => t.id === e);
85
- return n === -1 ? null : {
86
- targetSectionId: t.sectionId,
87
- columnIndex: t.columnIndex,
88
- index: n
89
- };
90
- }
91
- function h(e, t = !0) {
92
- j(e), k(e), r.content = e, t && a();
93
- }
94
- function g(e) {
95
- e && p(e) || (r.selectedBlockId = e);
96
- }
97
- function _(e) {
98
- r.viewport = e;
99
- }
100
- function v(e) {
101
- r.darkMode = e;
102
- }
103
- function y(e) {
104
- r.uiTheme = e;
105
- }
106
- function b(e) {
107
- r.previewMode = e, e && (r.selectedBlockId = null);
108
- }
109
- function x(e, t) {
110
- if (p(e)) return;
111
- let n = u(r.content.blocks, e);
112
- n && (Object.assign(n, t), a());
113
- }
114
- function C(e) {
115
- r.content.settings = {
116
- ...r.content.settings,
117
- ...e
118
- }, a();
119
- }
120
- function w(e, t, n = 0, i) {
121
- let o = {
122
- settings: r.content.settings,
123
- blocks: [e]
124
- };
125
- if (j(o), k(o), !(t && e.type === "section")) {
126
- if (t) {
127
- if (p(t)) return;
128
- let a = u(r.content.blocks, t);
129
- if (a && a.type === "section") {
130
- if (n < 0 || n >= H(a.columns)) return;
131
- a.children[n] = a.children[n] || [];
132
- let t = a.children[n];
133
- i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
134
- }
135
- } else i !== void 0 && i < r.content.blocks.length ? r.content.blocks.splice(i, 0, e) : r.content.blocks.push(e);
136
- a();
137
- }
138
- }
139
- function T(e) {
140
- if (p(e)) return;
141
- let t = f(r.content.blocks, e);
142
- if (t) {
143
- let n = t.blocks.findIndex((t) => t.id === e);
144
- if (n !== -1) {
145
- let [e] = t.blocks.splice(n, 1);
146
- if (r.selectedBlockId) {
147
- let t = /* @__PURE__ */ new Set();
148
- d(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
149
- }
150
- a();
151
- }
152
- }
153
- }
154
- function D(e, t, n, i = 0) {
155
- if (p(e) || n && p(n)) return;
156
- let o = f(r.content.blocks, e);
157
- if (!o) return;
158
- let s = o.blocks.findIndex((t) => t.id === e);
159
- if (s === -1 || n && o.blocks[s].type === "section") return;
160
- let c;
161
- if (n) {
162
- let e = u(r.content.blocks, n);
163
- if (!e || e.type !== "section" || i < 0 || i >= H(e.columns)) return;
164
- e.children[i] = e.children[i] || [], c = e.children[i];
165
- } else c = r.content.blocks;
166
- let [l] = o.blocks.splice(s, 1);
167
- c.splice(t, 0, l), a();
168
- }
169
- function O() {
170
- a();
171
- }
172
- function A(e, t) {
173
- throw new E(`[Templatical] Templates: ${e} ${t}`);
174
- }
175
- function M(t) {
176
- V(e.onError, t);
177
- }
178
- function N(t) {
179
- let { templates: n } = e;
180
- return n || A(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
181
- }
182
- function P(e) {
183
- r.template && (r.template = {
184
- ...r.template,
185
- name: e
186
- }, a());
187
- }
188
- async function F(t) {
189
- let n = N("create()"), { create: a } = n;
190
- typeof a != "function" && A("create()", "is disabled by the provider — its `create` is `false`.");
191
- let o;
192
- r.isLoading = !0;
193
- try {
194
- t?.content && (r.content = t.content);
195
- let e = i;
196
- o = await a(t?.name === void 0 ? { content: r.content } : {
197
- name: t.name,
198
- content: r.content
199
- }), r.template = o, i === e && (r.isDirty = !1);
200
- } catch (t) {
201
- throw e.onError?.(t), t;
202
- } finally {
203
- r.isLoading = !1;
204
- }
205
- return M(() => n.onCreated?.(o)), o;
206
- }
207
- async function I(t) {
208
- let n = N("load()"), i;
209
- r.isLoading = !0;
210
- try {
211
- i = await n.load(t), j(i.content), k(i.content), r.template = i, r.content = i.content, r.isDirty = !1;
212
- } catch (t) {
213
- throw e.onError?.(t), t;
214
- } finally {
215
- r.isLoading = !1;
216
- }
217
- return M(() => n.onLoaded?.(i)), i;
218
- }
219
- async function L(t = "api") {
220
- let n = N("save()"), { save: a } = n;
221
- typeof a != "function" && A("save()", "is disabled by the provider — its `save` is `false`.");
222
- let o = r.template;
223
- o || A("save()", "has no template loaded. Call create() or load() first.");
224
- let s = o.name === void 0 ? { content: r.content } : {
225
- name: o.name,
226
- content: r.content
227
- }, c;
228
- r.isSaving = !0;
229
- try {
230
- let e = i;
231
- if (c = await a(o.id, s), r.template?.id === o.id) {
232
- let e = r.template.name;
233
- r.template = e === o.name ? c : {
234
- ...c,
235
- name: e
236
- };
237
- }
238
- i === e && (r.isDirty = !1);
239
- } catch (t) {
240
- throw e.onError?.(t), t;
241
- } finally {
242
- r.isSaving = !1;
243
- }
244
- return M(() => n.onSaved?.(c, { trigger: t })), c;
245
- }
246
- function R() {
247
- return r.template?.id !== void 0;
248
- }
249
- return {
250
- state: s(r),
251
- content: o,
252
- selectedBlock: l,
253
- isBlockLocked: p,
254
- setContent: h,
255
- selectBlock: g,
256
- setViewport: _,
257
- setDarkMode: v,
258
- setUiTheme: y,
259
- setPreviewMode: b,
260
- updateBlock: x,
261
- updateSettings: C,
262
- addBlock: w,
263
- removeBlock: T,
264
- moveBlock: D,
265
- markDirty: O,
266
- findBlockLocation: m,
267
- setName: P,
268
- create: F,
269
- load: I,
270
- save: L,
271
- hasTemplate: R
272
- };
273
- }
274
- var de = 50, U = 300, fe = 1500;
275
- function pe(e) {
276
- let { content: t, setContent: r, isRemoteOperation: i, maxSize: a = de } = e, o = l([]), s = l([]), c = l(!1), u = null, d = null, f = n(() => o.value.length > 0), p = n(() => s.value.length > 0);
277
- function m() {
278
- return D(t.value);
279
- }
280
- function h(e) {
281
- o.value.push(e), o.value.length > a && o.value.splice(0, o.value.length - a);
282
- }
283
- function g() {
284
- d &&= (clearTimeout(d.timeoutId), null);
285
- }
286
- function _() {
287
- i?.() || (g(), h(m()), s.value = []);
288
- }
289
- function v(e) {
290
- i?.() || (d && d.blockId === e ? (clearTimeout(d.timeoutId), d.timeoutId = setTimeout(() => {
291
- d = null;
292
- }, U)) : (g(), h(m()), s.value = [], d = {
293
- blockId: e,
294
- timeoutId: setTimeout(() => {
295
- d = null;
296
- }, U)
297
- }));
298
- }
299
- function y() {
300
- c.value = !0, u && clearTimeout(u), u = setTimeout(() => {
301
- c.value = !1, u = null;
302
- }, fe);
303
- }
304
- function b() {
305
- if (o.value.length === 0) return;
306
- g();
307
- let e = o.value.pop();
308
- s.value.push(m()), r(e, !0), y();
309
- }
310
- function x() {
311
- if (s.value.length === 0) return;
312
- g();
313
- let e = s.value.pop();
314
- o.value.push(m()), r(e, !0), y();
315
- }
316
- function S() {
317
- o.value = [], s.value = [], g();
318
- }
319
- function C() {
320
- S(), u &&= (clearTimeout(u), null);
321
- }
322
- return {
323
- canUndo: f,
324
- canRedo: p,
325
- isNavigating: c,
326
- undo: b,
327
- redo: x,
328
- record: _,
329
- recordDebounced: v,
330
- clear: S,
331
- destroy: C
332
- };
333
- }
334
- function me(e) {
335
- let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
336
- function o(n, r, a) {
337
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = I(n, o);
338
- return t(s, r, a), i(s.id), s;
339
- }
340
- function s(e, n, r) {
341
- let o = O(e);
342
- if (n !== void 0 || r !== void 0) t(o, n, r);
343
- else {
344
- let i = a?.(e.id) ?? null;
345
- i ? t(o, i.targetSectionId, i.columnIndex, i.index + 1) : t(o, n, r);
346
- }
347
- return i(o.id), o;
348
- }
349
- function c(e) {
350
- n(e);
351
- }
352
- function l(e, t, n) {
353
- r(e, { [t]: n });
354
- }
355
- return {
356
- createAndAddBlock: o,
357
- duplicateBlock: s,
358
- deleteBlock: c,
359
- updateBlockProperty: l
360
- };
361
- }
362
- var W = 2e3;
363
- function he(e) {
364
- let { content: t, isDirty: n, onChange: r, debounce: i = W, enabled: a = !0 } = e, o = null, s = !1;
365
- function c() {
366
- return typeof a == "function" ? a() : a;
367
- }
368
- function l() {
369
- s = !0, d();
370
- }
371
- function u() {
372
- s = !1;
373
- }
374
- function d() {
375
- o &&= (clearTimeout(o), null);
376
- }
377
- function f() {
378
- d(), n() && r(JSON.parse(JSON.stringify(t.value)));
379
- }
380
- function p() {
381
- c() && !s && (d(), o = setTimeout(() => {
382
- o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
383
- }, i));
384
- }
385
- let m = g(t, () => {
386
- p();
387
- }, { deep: !0 });
388
- function h() {
389
- m(), d();
390
- }
391
- return {
392
- flush: f,
393
- cancel: d,
394
- pause: l,
395
- resume: u,
396
- destroy: h
397
- };
398
- }
399
- function ge(e) {
400
- let t = c(/* @__PURE__ */ new Set()), r = n(() => t.size > 0);
401
- function i(e) {
402
- return t.has(e);
403
- }
404
- function a(n) {
405
- t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
406
- }
407
- function o() {
408
- t.clear();
409
- }
410
- return {
411
- isHidden: i,
412
- toggleBlock: a,
413
- reset: o,
414
- hasHiddenBlocks: r
415
- };
416
- }
417
- function _e(e) {
418
- let t = l(!1), r = l(!1), i = n(() => !!e.definition.value?.dataSource), a = n(() => i.value && !e.block.value.dataSourceFetched);
419
- async function o() {
420
- let n = e.definition.value;
421
- if (n?.dataSource) {
422
- t.value = !0, r.value = !1;
423
- try {
424
- let t = await n.dataSource.onFetch({
425
- fieldValues: { ...e.block.value.fieldValues },
426
- blockId: e.block.value.id
427
- });
428
- if (t == null) return;
429
- let r = { ...e.block.value.fieldValues };
430
- for (let e of Object.keys(r)) e in t && (r[e] = t[e]);
431
- e.onUpdate(r, !0);
432
- } catch (e) {
433
- console.warn("[Templatical] Data source fetch error:", e), r.value = !0;
434
- } finally {
435
- t.value = !1;
436
- }
437
- }
438
- }
439
- return {
440
- isFetching: t,
441
- fetchError: r,
442
- fetch: o,
443
- hasDataSource: i,
444
- needsFetch: a
445
- };
446
- }
447
- function ve(e, t) {
448
- let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
449
- e.addBlock = (r, i, a, o) => {
450
- i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
451
- }, e.removeBlock = (n) => {
452
- e.isBlockLocked(n) || (t.record(), r(n));
453
- }, e.moveBlock = (n, r, a, o) => {
454
- e.isBlockLocked(n) || a && e.isBlockLocked(a) || (t.record(), i(n, r, a, o));
455
- }, e.updateBlock = (n, r) => {
456
- e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r));
457
- }, e.updateSettings = (e) => {
458
- t.record(), o(e);
459
- };
460
- }
461
- function ye(e) {
462
- let { provider: t } = e, n = l([]), r = l(!1), i = y(() => {
463
- let e = /* @__PURE__ */ new Set();
464
- for (let t of n.value) {
465
- let n = t.category?.trim();
466
- n && e.add(n);
467
- }
468
- return [...e].sort((e, t) => e.localeCompare(t));
469
- }), a = y(() => typeof t.create == "function"), o = y(() => typeof t.update == "function"), s = y(() => typeof t.delete == "function");
470
- function c(e) {
471
- return o.value && e.canUpdate !== !1;
472
- }
473
- function u(e) {
474
- return s.value && e.canDelete !== !1;
475
- }
476
- function d(e, t) {
477
- throw new E(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
478
- }
479
- function f(t) {
480
- V(e.onError, t);
481
- }
482
- async function p(i) {
483
- r.value = !0;
484
- try {
485
- n.value = await t.list(i);
486
- } catch (t) {
487
- throw e.onError?.(t), t;
488
- } finally {
489
- r.value = !1;
490
- }
491
- }
492
- async function m(r, i, a) {
493
- let { create: o } = t;
494
- typeof o != "function" && d("create", "disabled by the provider");
495
- try {
496
- let e = await o(a ? {
497
- name: r,
498
- content: i,
499
- category: a
500
- } : {
501
- name: r,
502
- content: i
503
- });
504
- return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
505
- } catch (t) {
506
- throw e.onError?.(t), t;
507
- }
508
- }
509
- async function h(r, i) {
510
- let { update: a } = t;
511
- typeof a != "function" && d("update", "disabled by the provider");
512
- let o = n.value.find((e) => e.id === r);
513
- o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
514
- try {
515
- let e = await a(r, i);
516
- return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
517
- } catch (t) {
518
- throw e.onError?.(t), t;
519
- }
520
- }
521
- async function g(r) {
522
- let { delete: i } = t;
523
- typeof i != "function" && d("delete", "disabled by the provider");
524
- let a = n.value.find((e) => e.id === r) ?? null;
525
- a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
526
- try {
527
- await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
528
- } catch (t) {
529
- throw e.onError?.(t), t;
530
- }
531
- }
532
- return {
533
- savedBlocks: n,
534
- isLoading: r,
535
- categories: i,
536
- canCreate: a,
537
- canUpdate: o,
538
- canDelete: s,
539
- canUpdateBlock: c,
540
- canDeleteBlock: u,
541
- load: p,
542
- create: m,
543
- update: h,
544
- remove: g
545
- };
546
- }
547
- var be = "templatical:saved-blocks";
548
- function xe(e = {}) {
549
- let t = e.key ?? be;
550
- function n() {
551
- if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
552
- return localStorage;
553
- }
554
- function r() {
555
- let e = n().getItem(t);
556
- if (!e) return [];
557
- try {
558
- let t = JSON.parse(e);
559
- return Array.isArray(t) ? t : [];
560
- } catch {
561
- return [];
562
- }
563
- }
564
- function i(e) {
565
- n().setItem(t, JSON.stringify(e));
566
- }
567
- return {
568
- async list(e) {
569
- let t = r(), n = e?.search?.trim().toLowerCase(), i = e?.category?.trim();
570
- return t.filter((e) => !(n && !e.name.toLowerCase().includes(n) || i && e.category !== i));
571
- },
572
- async create(e) {
573
- let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
574
- id: C(),
575
- name: e.name,
576
- content: e.content,
577
- ...e.category ? { category: e.category } : {},
578
- createdAt: t,
579
- updatedAt: t
580
- };
581
- return i([n, ...r()]), n;
582
- },
583
- async update(e, t) {
584
- let n = r(), a = n.findIndex((t) => t.id === e);
585
- if (a === -1) throw Error(`[Templatical] Saved block not found: ${e}`);
586
- let o = {
587
- ...n[a],
588
- ...t,
589
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
590
- }, s = [...n];
591
- return s[a] = o, i(s), o;
592
- },
593
- async delete(e) {
594
- let t = r();
595
- if (!t.some((t) => t.id === e)) throw Error(`[Templatical] Saved block not found: ${e}`);
596
- i(t.filter((t) => t.id !== e));
597
- }
598
- };
599
- }
600
- var Se = "templatical:media", Ce = 50;
601
- function we(e = {}) {
602
- let t = e.key ?? Se;
603
- function n() {
604
- if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
605
- return localStorage;
606
- }
607
- function r() {
608
- let e = n().getItem(t);
609
- if (!e) return [];
610
- try {
611
- let t = JSON.parse(e);
612
- return Array.isArray(t) ? t : [];
613
- } catch {
614
- return [];
615
- }
616
- }
617
- function i(e) {
618
- n().setItem(t, JSON.stringify(e));
619
- }
620
- function a(e) {
621
- return typeof FileReader > "u" ? Promise.reject(/* @__PURE__ */ Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with FileReader.")) : new Promise((t, n) => {
622
- let r = new FileReader();
623
- r.onload = () => {
624
- typeof r.result == "string" ? t(r.result) : n(/* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
625
- }, r.onerror = () => {
626
- n(r.error ?? /* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
627
- }, r.readAsDataURL(e);
628
- });
629
- }
630
- return {
631
- async list(e) {
632
- let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
633
- let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
634
- return t.includes(n) || r.includes(n);
635
- }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + Ce), c = { items: s }, l = o + s.length;
636
- return l < i.length && (c.nextCursor = String(l)), c;
637
- },
638
- async create(e) {
639
- let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
640
- id: C(),
641
- url: t,
642
- filename: e.filename || e.file.name,
643
- createdAt: n,
644
- updatedAt: n,
645
- size: e.file.size
646
- };
647
- return e.alt !== void 0 && (o.alt = e.alt), e.file.type && (o.mimeType = e.file.type), e.folderId !== void 0 && (o.folderId = e.folderId), i([o, ...r()]), o;
648
- },
649
- async update(e, t) {
650
- let n = r(), a = n.findIndex((t) => t.id === e);
651
- if (a === -1) throw Error(`[Templatical] Media asset not found: ${e}`);
652
- let o = n[a], s = {
653
- ...o,
654
- ...t,
655
- id: o.id,
656
- url: o.url,
657
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
658
- }, c = [...n];
659
- return c[a] = s, i(c), s;
660
- },
661
- async delete(e) {
662
- let t = r();
663
- for (let n of e) if (!t.some((e) => e.id === n)) throw Error(`[Templatical] Media asset not found: ${n}`);
664
- let n = new Set(e);
665
- i(t.filter((e) => !n.has(e.id)));
666
- },
667
- folders: !1,
668
- replace: !1,
669
- importFromUrl: !1,
670
- checkUsage: !1,
671
- frequentlyUsed: !1,
672
- storage: !1
673
- };
674
- }
675
- function Te(e) {
676
- let { provider: t, getTemplateId: n } = e, r = l([]), i = l(!1), a = l(void 0), o = l(!1), s = /* @__PURE__ */ new Map(), c = y(() => typeof t.create == "function"), u = y(() => typeof t.restore == "function");
677
- function d(e) {
678
- let t = n();
679
- if (!t) throw new E(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
680
- return t;
681
- }
682
- function f(e) {
683
- throw new E(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
684
- }
685
- function p(t) {
686
- V(e.onError, t);
687
- }
688
- async function m(n) {
689
- let o = d("list");
690
- i.value = !0;
691
- try {
692
- let e = await t.list(o, n);
693
- r.value = e.versions, a.value = e.nextCursor;
694
- } catch (t) {
695
- throw e.onError?.(t), t;
696
- } finally {
697
- i.value = !1;
698
- }
699
- }
700
- function h(e) {
701
- return e.content ?? s.get(e.id) ?? null;
702
- }
703
- async function g(n) {
704
- let r = h(n);
705
- if (r) return r;
706
- let i = d("get");
707
- try {
708
- let e = await t.get(i, n.id);
709
- return s.set(n.id, e), e;
710
- } catch (t) {
711
- throw e.onError?.(t), t;
712
- }
713
- }
714
- async function _(n, i) {
715
- let { create: a } = t;
716
- typeof a != "function" && f("create");
717
- let o = d("create");
718
- try {
719
- let e = await a(o, n, i);
720
- return r.value = [e, ...r.value], p(() => t.onCreated?.(e)), e;
721
- } catch (t) {
722
- throw e.onError?.(t), t;
723
- }
724
- }
725
- async function v(n) {
726
- let { restore: r } = t;
727
- typeof r != "function" && f("restore");
728
- let i = d("restore"), a;
729
- o.value = !0;
730
- try {
731
- a = await r(i, n);
732
- } catch (t) {
733
- throw e.onError?.(t), t;
734
- } finally {
735
- o.value = !1;
736
- }
737
- return p(() => t.onRestored?.(a)), a;
738
- }
739
- return {
740
- nextCursor: a,
741
- versions: r,
742
- isLoading: i,
743
- isRestoring: o,
744
- canCreate: c,
745
- canRestore: u,
746
- load: m,
747
- peekContent: h,
748
- resolveContent: g,
749
- create: _,
750
- restore: v
751
- };
752
- }
753
- function Ee(e) {
754
- let { provider: t, getTemplateId: n, getUser: r } = e, i = l([]), a = l(!1), o = l(!1), s = y(() => typeof t.create == "function"), c = y(() => typeof t.update == "function"), u = y(() => typeof t.delete == "function"), d = y(() => typeof t.setResolved == "function"), f = y(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = y(() => i.value.filter((e) => !e.resolvedAt).length), m = y(() => {
755
- let e = /* @__PURE__ */ new Map();
756
- for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
757
- return e;
758
- });
759
- function h(e) {
760
- let t = n();
761
- if (!t) throw new E(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
762
- return t;
763
- }
764
- function g(e) {
765
- let t = r();
766
- if (!t) throw new E(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
767
- return t;
768
- }
769
- function _(e) {
770
- throw new E(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
771
- }
772
- function v(e) {
773
- for (let t of i.value) {
774
- if (t.id === e) return t;
775
- for (let n of t.replies ?? []) if (n.id === e) return n;
776
- }
777
- return null;
778
- }
779
- function b(e) {
780
- let t = r();
781
- return t !== null && e.author.id === t.id;
782
- }
783
- function x(t) {
784
- let n = B(t);
785
- throw e.onError?.(n), n;
786
- }
787
- function S(t) {
788
- V(e.onError, t);
789
- }
790
- function C(e, t, n) {
791
- return [
792
- ...e.slice(0, t),
793
- n,
794
- ...e.slice(t + 1)
795
- ];
796
- }
797
- function w(e, t) {
798
- return e !== void 0 && JSON.stringify(e) === JSON.stringify(t);
799
- }
800
- function T(e) {
801
- if (e.parentId) {
802
- let t = !1, n = i.value.map((n) => {
803
- if (n.id !== e.parentId) return n;
804
- let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
805
- return i !== -1 && w(r[i], e) ? n : (t = !0, {
806
- ...n,
807
- replies: i === -1 ? [...r, e] : C(r, i, e)
808
- });
809
- });
810
- return t && (i.value = n), t;
811
- }
812
- let t = i.value.findIndex((t) => t.id === e.id);
813
- if (t === -1) return i.value = [...i.value, e], !0;
814
- let n = {
815
- ...e,
816
- replies: e.replies ?? i.value[t].replies
817
- };
818
- return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
819
- }
820
- function D(e, t) {
821
- let n = v(e), r = t ?? n?.parentId ?? null;
822
- return r ? i.value = i.value.map((t) => t.id === r ? {
823
- ...t,
824
- replies: (t.replies ?? []).filter((t) => t.id !== e)
825
- } : t) : i.value = i.value.filter((t) => t.id !== e), n;
826
- }
827
- async function O(e) {
828
- let n = h("list");
829
- a.value = !0;
830
- try {
831
- i.value = await t.list(n, e);
832
- } catch (e) {
833
- x(e);
834
- } finally {
835
- a.value = !1;
836
- }
837
- }
838
- async function k(e) {
839
- let { create: n } = t;
840
- typeof n != "function" && _("create");
841
- let r = h("create");
842
- g("create"), o.value = !0;
843
- try {
844
- let i = await n(r, e);
845
- return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
846
- } catch (e) {
847
- x(e);
848
- } finally {
849
- o.value = !1;
850
- }
851
- }
852
- async function A(e, n) {
853
- let { update: r } = t;
854
- typeof r != "function" && _("update");
855
- let i = h("update");
856
- g("update"), o.value = !0;
857
- try {
858
- let a = await r(i, e, n);
859
- return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
860
- } catch (e) {
861
- x(e);
862
- } finally {
863
- o.value = !1;
864
- }
865
- }
866
- async function j(e) {
867
- let { delete: n } = t;
868
- typeof n != "function" && _("delete");
869
- let r = h("delete");
870
- g("delete");
871
- let i = v(e);
872
- o.value = !0;
873
- try {
874
- await n(r, e), D(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
875
- } catch (e) {
876
- x(e);
877
- } finally {
878
- o.value = !1;
879
- }
880
- }
881
- async function M(e, n) {
882
- let { setResolved: r } = t;
883
- typeof r != "function" && _("setResolved");
884
- let i = h("setResolved");
885
- g("setResolved"), o.value = !0;
886
- try {
887
- let a = await r(i, e, n);
888
- return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
889
- } catch (e) {
890
- x(e);
891
- } finally {
892
- o.value = !1;
893
- }
894
- }
895
- function N(e) {
896
- T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
897
- }
898
- function P(e) {
899
- T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
900
- }
901
- function F(e, n) {
902
- let r = D(e, n);
903
- r && S(() => t.onDeleted?.(r, { origin: "remote" }));
904
- }
905
- return {
906
- comments: i,
907
- isLoading: a,
908
- isSubmitting: o,
909
- canCreate: s,
910
- canUpdate: c,
911
- canDelete: u,
912
- canResolve: d,
913
- totalCount: f,
914
- unresolvedCount: p,
915
- commentCountByBlock: m,
916
- load: O,
917
- create: k,
918
- update: A,
919
- remove: j,
920
- setResolved: M,
921
- find: v,
922
- isOwn: b,
923
- applyRemoteCreate: N,
924
- applyRemoteUpdate: P,
925
- applyRemoteDelete: F
926
- };
927
- }
928
- function De(e) {
929
- let { comments: t, provider: n, getTemplateId: a } = e, { subscribe: o } = n;
930
- if (typeof o != "function") return;
931
- let s = null;
932
- function c() {
933
- s?.(), s = null;
934
- }
935
- i(() => a(), (e) => {
936
- c(), e && (s = o(e, (e) => {
937
- switch (e.type) {
938
- case "created":
939
- t.applyRemoteCreate(e.comment);
940
- break;
941
- case "updated":
942
- t.applyRemoteUpdate(e.comment);
943
- break;
944
- case "deleted": t.applyRemoteDelete(e.commentId, e.parentId);
945
- }
946
- }));
947
- }, { immediate: !0 }), r(c);
948
- }
949
- //#endregion
950
- //#region src/composables/useImageUrlResolver.ts
951
- function Oe(e) {
952
- let t = c(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
953
- function r(e) {
954
- return t.get(e);
955
- }
956
- function i(e) {
957
- return t.has(e) || n.has(e);
958
- }
959
- function a(r) {
960
- if (i(r)) return;
961
- let a;
962
- try {
963
- a = e(r);
964
- } catch {
965
- t.set(r, null);
966
- return;
967
- }
968
- a === null || typeof a == "string" ? t.set(r, a) : (n.add(r), Promise.resolve(a).then((e) => {
969
- t.set(r, typeof e == "string" ? e : null);
970
- }, () => {
971
- t.set(r, null);
972
- }).finally(() => n.delete(r)));
973
- }
974
- return {
975
- get: r,
976
- has: i,
977
- lookup: a
978
- };
979
- }
980
- function G(e) {
981
- let t = a(ne, null), n = y(e);
982
- if (!t) return n;
983
- let s;
984
- function c() {
985
- s !== void 0 && (clearTimeout(s), s = void 0);
986
- }
987
- o() && r(c);
988
- let l = !0;
989
- return i(n, (e) => {
990
- c();
991
- let n = l;
992
- l = !1, e && !t.has(e) && (n ? t.lookup(e) : s = setTimeout(() => {
993
- s = void 0, t.lookup(e);
994
- }, 300));
995
- }, { immediate: !0 }), y(() => {
996
- let e = n.value;
997
- if (!e) return e;
998
- let r = t.get(e);
999
- return typeof r == "string" && r.length > 0 ? r : e;
1000
- });
1001
- }
1002
- function ke(e, t) {
1003
- if (!e || !t) return t;
1004
- let n = e.get(t);
1005
- return typeof n == "string" && n.length > 0 ? n : t;
1006
- }
1007
- function K(e, t) {
1008
- return typeof e?.url == "string" && w(e.url, t);
1009
- }
1010
- function q(e, t) {
1011
- let n = e?.url;
1012
- if (typeof n == "string" && n.trim() !== "") return w(n, t) ? void 0 : n;
1013
- }
1014
- function Ae(e) {
1015
- let t = a(ee, F.liquid), n = G(() => q(e(), t));
1016
- return y(() => K(e(), t) ? null : n.value);
1017
- }
1018
- function je(e, t, n) {
1019
- return K(t, n) ? null : ke(e, q(t, n));
1020
- }
1021
- //#endregion
1022
- //#region src/utils/blockTypeLabels.ts
1023
- function J(e, t) {
1024
- return t.blocks[e] ?? e;
1025
- }
1026
- function Me(e, t, n = []) {
1027
- if (e.type !== "custom") return J(e.type, t);
1028
- let { customType: r } = e;
1029
- return n.find((e) => e.type === r)?.name ?? r;
1030
- }
1031
- //#endregion
1032
- //#region src/utils/resolveFieldColors.ts
1033
- function Ne(e, t) {
1034
- let n = oe({ presets: e.presets }, ae), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
1035
- return {
1036
- presets: r ? t.presets : n.presets,
1037
- allowCustom: t.allowCustom !== !1 && i,
1038
- invalidPresets: n.invalidPresets,
1039
- emptyPresets: e.presets !== void 0 && e.presets.length === 0,
1040
- presetsInherited: r,
1041
- allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
1042
- };
1043
- }
1044
- var Pe = z({
1045
- name: "code",
1046
- size: 24,
1047
- node: [["path", {
1048
- d: "m16 18 6-6-6-6",
1049
- key: "eg8j8"
1050
- }], ["path", {
1051
- d: "m8 6-6 6 6 6",
1052
- key: "ppft3o"
1053
- }]]
1054
- }), Fe = z({
1055
- name: "image",
1056
- size: 24,
1057
- node: [
1058
- ["rect", {
1059
- width: "18",
1060
- height: "18",
1061
- x: "3",
1062
- y: "3",
1063
- rx: "2",
1064
- ry: "2",
1065
- key: "1m3agn"
1066
- }],
1067
- ["circle", {
1068
- cx: "9",
1069
- cy: "9",
1070
- r: "2",
1071
- key: "af1f0g"
1072
- }],
1073
- ["path", {
1074
- d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
1075
- key: "1xmnt7"
1076
- }]
1077
- ]
1078
- }), Ie = z({
1079
- name: "navigation",
1080
- size: 24,
1081
- node: [["polygon", {
1082
- points: "3 11 22 2 13 21 11 13 3 11",
1083
- key: "1ltx0t"
1084
- }]]
1085
- }), Le = z({
1086
- name: "share-2",
1087
- size: 24,
1088
- node: [
1089
- ["circle", {
1090
- cx: "18",
1091
- cy: "5",
1092
- r: "3",
1093
- key: "gq8acd"
1094
- }],
1095
- ["circle", {
1096
- cx: "6",
1097
- cy: "12",
1098
- r: "3",
1099
- key: "w7nqdw"
1100
- }],
1101
- ["circle", {
1102
- cx: "18",
1103
- cy: "19",
1104
- r: "3",
1105
- key: "1xt0gg"
1106
- }],
1107
- ["line", {
1108
- x1: "8.59",
1109
- x2: "15.42",
1110
- y1: "13.51",
1111
- y2: "17.49",
1112
- key: "47mynk"
1113
- }],
1114
- ["line", {
1115
- x1: "15.41",
1116
- x2: "8.59",
1117
- y1: "6.51",
1118
- y2: "10.49",
1119
- key: "1n3mei"
1120
- }]
1121
- ]
1122
- }), Re = z({
1123
- name: "table",
1124
- size: 24,
1125
- node: [
1126
- ["path", {
1127
- d: "M12 3v18",
1128
- key: "108xh3"
1129
- }],
1130
- ["rect", {
1131
- width: "18",
1132
- height: "18",
1133
- x: "3",
1134
- y: "3",
1135
- rx: "2",
1136
- key: "afitv7"
1137
- }],
1138
- ["path", {
1139
- d: "M3 9h18",
1140
- key: "1pudct"
1141
- }],
1142
- ["path", {
1143
- d: "M3 15h18",
1144
- key: "5xshup"
1145
- }]
1146
- ]
1147
- });
1148
- //#endregion
1149
- //#region src/utils/imageNaturalSize.ts
1150
- function ze(e) {
1151
- return typeof e == "number" && Number.isFinite(e) && e > 0;
1152
- }
1153
- function Y(e, t) {
1154
- return ze(e) && ze(t) ? {
1155
- width: e,
1156
- height: t
1157
- } : null;
1158
- }
1159
- function Be(e) {
1160
- return Y(e.naturalWidth, e.naturalHeight);
1161
- }
1162
- function Ve(e) {
1163
- return e ? {
1164
- naturalWidth: e.width,
1165
- naturalHeight: e.height
1166
- } : {
1167
- naturalWidth: void 0,
1168
- naturalHeight: void 0
1169
- };
1170
- }
1171
- function He(e, t) {
1172
- if (typeof Image > "u") return t(null), () => {};
1173
- let n = new Image(), r = () => {
1174
- n.onload = null, n.onerror = null;
1175
- };
1176
- return n.onload = () => {
1177
- r(), t(Y(n.naturalWidth, n.naturalHeight));
1178
- }, n.onerror = () => {
1179
- r(), t(null);
1180
- }, n.src = e, r;
1181
- }
1182
- function Ue(e) {
1183
- return new Promise((t) => {
1184
- let n = setTimeout(() => {
1185
- r(), t(null);
1186
- }, re), r = He(e, (e) => {
1187
- clearTimeout(n), t(e);
1188
- });
1189
- });
1190
- }
1191
- //#endregion
1192
- //#region src/components/MediaDropOverlay.vue
1193
- var We = /* @__PURE__ */ b({
1194
- __name: "MediaDropOverlay",
1195
- props: {
1196
- uploading: { type: Boolean },
1197
- size: { default: "field" }
1198
- },
1199
- setup(n) {
1200
- let r = n, { t: i } = ie(), a = {
1201
- field: {
1202
- gap: "tpl:gap-1.5",
1203
- icon: 18,
1204
- veil: "90%"
1205
- },
1206
- canvas: {
1207
- gap: "tpl:gap-2",
1208
- icon: 20,
1209
- veil: "85%"
1210
- }
1211
- }, o = y(() => a[r.size]);
1212
- return (r, a) => (e(), d("div", {
1213
- class: h(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", o.value.gap]),
1214
- style: t({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${o.value.veil}, transparent)` })
1215
- }, [n.uploading ? (e(), d(_, { key: 0 }, [f(u(se), {
1216
- class: "tpl-spinner",
1217
- size: o.value.icon,
1218
- "stroke-width": 2
1219
- }, null, 8, ["size"]), p(" " + m(u(i).image.uploading), 1)], 64)) : (e(), d(_, { key: 1 }, [f(u(ce), {
1220
- size: o.value.icon,
1221
- "stroke-width": 1.5
1222
- }, null, 8, ["size"]), p(" " + m(u(i).image.dropToUpload), 1)], 64))], 6));
1223
- }
1224
- }), Ge = "image/";
1225
- function Ke(e) {
1226
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || v(r), { isOverDropZone: a } = L(t, {
1227
- preventDefaultForUnhandled: !0,
1228
- onDrop: (e) => {
1229
- if (!i()) return;
1230
- let t = (e ?? []).filter((e) => e.type.startsWith(Ge));
1231
- t.length > 0 && n([t[0]]);
1232
- }
1233
- });
1234
- return { isOver: y(() => i() && a.value) };
1235
- }
1236
- //#endregion
1237
- //#region src/composables/useMediaDropField.ts
1238
- function qe(e) {
1239
- let { target: t, blocked: n, apply: r } = e, i = a(R, null), o = a(te, null), s = le();
1240
- async function c() {
1241
- let e = await i?.({ accept: ["images"] });
1242
- s.alive && e && r(e);
1243
- }
1244
- let u = l(!1), d = y(() => (o?.value ?? !!i) && !u.value && !v(n));
1245
- async function f(e) {
1246
- if (i) {
1247
- u.value = !0;
1248
- try {
1249
- let t = await i({
1250
- accept: ["images"],
1251
- files: e
1252
- });
1253
- if (!s.alive) return;
1254
- t && r(t);
1255
- } finally {
1256
- s.alive && (u.value = !1);
1257
- }
1258
- }
1259
- }
1260
- let { isOver: p } = Ke({
1261
- target: t,
1262
- enabled: d,
1263
- onFiles: f
1264
- }), m = y(() => d.value && p.value || u.value);
1265
- return {
1266
- canBrowse: !!i,
1267
- dropEnabled: d,
1268
- isUploading: u,
1269
- showOverlay: m,
1270
- openMediaBrowser: c
1271
- };
1272
- }
1273
- function Je(e, t = "desktop") {
1274
- return t === "mobile" ? 375 : e?.width ?? 600;
1275
- }
1276
- var Ye = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", Xe = {
1277
- 1: [100],
1278
- 2: [50, 50],
1279
- 3: [
1280
- 33.33,
1281
- 33.33,
1282
- 33.34
1283
- ],
1284
- "1-2": [33.33, 66.67],
1285
- "2-1": [66.67, 33.33]
1286
- };
1287
- function X(e, t) {
1288
- let n = (e) => Math.trunc(e ?? 0), r = (e) => T(e) === null ? 0 : Math.trunc(e.width);
1289
- return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
1290
- }
1291
- function Z(e, t) {
1292
- return Math.floor(e) - X(t);
1293
- }
1294
- function Ze(e, t) {
1295
- let n = "border" in e ? e.border : void 0;
1296
- return Math.floor(t) - X(e.styles.padding, n);
1297
- }
1298
- function* Q(e, t) {
1299
- for (let n of e) P(n) ? yield* Q(n.children, Z(t, n.styles.padding)) : yield {
1300
- block: n,
1301
- bandWidth: x(n) && n.wrapper ? Z(t, n.wrapper.padding) : t
1302
- };
1303
- }
1304
- function Qe(e, t) {
1305
- if (!t) return e;
1306
- try {
1307
- return M(t, e);
1308
- } catch {
1309
- return e;
1310
- }
1311
- }
1312
- function $e(e, t, n) {
1313
- let r = Qe(e, n);
1314
- for (let { block: e, bandWidth: n } of Q(r.blocks, r.settings.width)) if (x(e)) {
1315
- let r = N(e)?.applied ? void 0 : e.border, i = Math.floor(n) - X(e.styles.padding, r), a = Xe[e.columns] ?? [100];
1316
- for (let n = 0; n < e.children.length; n++) {
1317
- let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
1318
- if (o) return Ze(o, r);
1319
- }
1320
- } else if (e.id === t) return Ze(e, n);
1321
- return null;
1322
- }
1323
- function $(e, t, n) {
1324
- let r = Qe(e, n);
1325
- for (let { block: e, bandWidth: n } of Q(r.blocks, r.settings.width)) if (e.id === t) return Math.floor(n);
1326
- return null;
1327
- }
1328
- function et(e, t, n) {
1329
- if (!x(e)) return;
1330
- let r = N(e);
1331
- if (r?.applied && r.height === "image") return (t ? $(t, e.id, n) : null) ?? Je(t?.settings);
1332
- }
1333
- //#endregion
1334
- //#region src/constants/socialIcons.ts
1335
- var tt = A, nt = {
1336
- small: 24,
1337
- medium: 32,
1338
- large: 48
1339
- }, rt = [
1340
- "facebook",
1341
- "twitter",
1342
- "instagram",
1343
- "linkedin",
1344
- "youtube",
1345
- "tiktok",
1346
- "pinterest",
1347
- "email",
1348
- "website",
1349
- "whatsapp",
1350
- "telegram",
1351
- "discord",
1352
- "snapchat",
1353
- "reddit",
1354
- "github",
1355
- "dribbble",
1356
- "behance"
1357
- ];
1358
- //#endregion
1359
- export { we as A, ve as B, J as C, Ae as D, je as E, Ee as F, Te as H, ge as I, _e as L, he as M, me as N, G as O, De as P, ue as R, Me as S, q as T, ye as V, Le as _, et as a, Pe as b, Je as c, He as d, Ue as f, Re as g, Y as h, $e as i, xe as j, W as k, qe as l, Be as m, tt as n, $ as o, Ve as p, rt as r, Ye as s, nt as t, We as u, Ie as v, Oe as w, Ne as x, Fe as y, pe as z };