@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,1279 +0,0 @@
1
- import { B as e, E as t, K as n, N as r, Q as i, S as a, W as o, X as s, Y as c, Z as l, at as u, b as d, ct as f, f as p, g as m, lt as h, ot as g, rt as _, u as v, ut as y, y as b } from "./draggable-DrsNwZuB.js";
2
- import { A as x, D as S, E as C, J as w, Nt as T, St as E, T as D, Y as O, Z as k, ct as A, gt as j, ht as M, i as N, j as P, r as F, t as I } from "./src-DYCDeBDM.js";
3
- import { r as L } from "./dist-MNQYSEWU.js";
4
- import { L as R, P as ee, c as te, x as ne } from "./keys-HI-INbkz.js";
5
- import { r as re } from "./timeouts-Cv2jvusx.js";
6
- import { t as ie } from "./useI18n-DUlyyIJJ.js";
7
- import { o as ae, s as oe } from "./usePopoverPosition-IbaW6-Ao.js";
8
- import { at as se, s as ce } from "./icons-aTYwH5-g.js";
9
- import { t as le } from "./useAliveFlag-DCB96vzR.js";
10
- //#region ../core/src/error-reporting.ts
11
- function z(e) {
12
- return e instanceof Error ? e : Error(String(e), { cause: e });
13
- }
14
- function B(e, t) {
15
- try {
16
- t();
17
- } catch (t) {
18
- e?.(z(t));
19
- }
20
- }
21
- //#endregion
22
- //#region ../core/src/editor.ts
23
- function V(e) {
24
- return e === "1" ? 1 : e === "3" ? 3 : 2;
25
- }
26
- function ue(e) {
27
- let t = e.content ?? k(e.defaultFontFamily, e.templateDefaults);
28
- C(t), S(t);
29
- let n = s({
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
- }), r = 0;
41
- function i() {
42
- n.isDirty = !0, r++;
43
- }
44
- let a = o({
45
- get: () => n.content,
46
- set: (e) => {
47
- n.content = e, i();
48
- }
49
- }), c = o(() => n.selectedBlockId ? u(n.content.blocks, n.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(n.content.blocks, e);
83
- if (!t) return null;
84
- let r = t.blocks.findIndex((t) => t.id === e);
85
- return r === -1 ? null : {
86
- targetSectionId: t.sectionId,
87
- columnIndex: t.columnIndex,
88
- index: r
89
- };
90
- }
91
- function h(e, t = !0) {
92
- C(e), S(e), n.content = e, t && i();
93
- }
94
- function g(e) {
95
- e && p(e) || (n.selectedBlockId = e);
96
- }
97
- function _(e) {
98
- n.viewport = e;
99
- }
100
- function v(e) {
101
- n.darkMode = e;
102
- }
103
- function y(e) {
104
- n.uiTheme = e;
105
- }
106
- function b(e) {
107
- n.previewMode = e, e && (n.selectedBlockId = null);
108
- }
109
- function x(e, t) {
110
- if (p(e)) return;
111
- let r = u(n.content.blocks, e);
112
- r && (Object.assign(r, t), i());
113
- }
114
- function w(e) {
115
- n.content.settings = {
116
- ...n.content.settings,
117
- ...e
118
- }, i();
119
- }
120
- function T(e, t, r = 0, a) {
121
- let o = {
122
- settings: n.content.settings,
123
- blocks: [e]
124
- };
125
- if (C(o), S(o), !(t && e.type === "section")) {
126
- if (t) {
127
- if (p(t)) return;
128
- let i = u(n.content.blocks, t);
129
- if (i && i.type === "section") {
130
- if (r < 0 || r >= V(i.columns)) return;
131
- i.children[r] = i.children[r] || [];
132
- let t = i.children[r];
133
- a !== void 0 && a < t.length ? t.splice(a, 0, e) : t.push(e);
134
- }
135
- } else a !== void 0 && a < n.content.blocks.length ? n.content.blocks.splice(a, 0, e) : n.content.blocks.push(e);
136
- i();
137
- }
138
- }
139
- function E(e) {
140
- if (p(e)) return;
141
- let t = f(n.content.blocks, e);
142
- if (t) {
143
- let r = t.blocks.findIndex((t) => t.id === e);
144
- if (r !== -1) {
145
- let [e] = t.blocks.splice(r, 1);
146
- if (n.selectedBlockId) {
147
- let t = /* @__PURE__ */ new Set();
148
- d(e, t), t.has(n.selectedBlockId) && (n.selectedBlockId = null);
149
- }
150
- i();
151
- }
152
- }
153
- }
154
- function D(e, t, r, a = 0) {
155
- if (p(e) || r && p(r)) return;
156
- let o = f(n.content.blocks, e);
157
- if (!o) return;
158
- let s = o.blocks.findIndex((t) => t.id === e);
159
- if (s === -1 || r && o.blocks[s].type === "section") return;
160
- let c;
161
- if (r) {
162
- let e = u(n.content.blocks, r);
163
- if (!e || e.type !== "section" || a < 0 || a >= V(e.columns)) return;
164
- e.children[a] = e.children[a] || [], c = e.children[a];
165
- } else c = n.content.blocks;
166
- let [l] = o.blocks.splice(s, 1);
167
- c.splice(t, 0, l), i();
168
- }
169
- function O() {
170
- i();
171
- }
172
- function A(e, t) {
173
- throw new I(`[Templatical] Templates: ${e} ${t}`);
174
- }
175
- function j(t) {
176
- B(e.onError, t);
177
- }
178
- function M(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 N(e) {
183
- n.template && (n.template = {
184
- ...n.template,
185
- name: e
186
- }, i());
187
- }
188
- async function P(t) {
189
- let i = M("create()"), { create: a } = i;
190
- typeof a != "function" && A("create()", "is disabled by the provider — its `create` is `false`.");
191
- let o;
192
- n.isLoading = !0;
193
- try {
194
- t?.content && (n.content = t.content);
195
- let e = r;
196
- o = await a(t?.name === void 0 ? { content: n.content } : {
197
- name: t.name,
198
- content: n.content
199
- }), n.template = o, r === e && (n.isDirty = !1);
200
- } catch (t) {
201
- throw e.onError?.(t), t;
202
- } finally {
203
- n.isLoading = !1;
204
- }
205
- return j(() => i.onCreated?.(o)), o;
206
- }
207
- async function F(t) {
208
- let r = M("load()"), i;
209
- n.isLoading = !0;
210
- try {
211
- i = await r.load(t), C(i.content), S(i.content), n.template = i, n.content = i.content, n.isDirty = !1;
212
- } catch (t) {
213
- throw e.onError?.(t), t;
214
- } finally {
215
- n.isLoading = !1;
216
- }
217
- return j(() => r.onLoaded?.(i)), i;
218
- }
219
- async function L(t = "api") {
220
- let i = M("save()"), { save: a } = i;
221
- typeof a != "function" && A("save()", "is disabled by the provider — its `save` is `false`.");
222
- let o = n.template;
223
- o || A("save()", "has no template loaded. Call create() or load() first.");
224
- let s = o.name === void 0 ? { content: n.content } : {
225
- name: o.name,
226
- content: n.content
227
- }, c;
228
- n.isSaving = !0;
229
- try {
230
- let e = r;
231
- if (c = await a(o.id, s), n.template?.id === o.id) {
232
- let e = n.template.name;
233
- n.template = e === o.name ? c : {
234
- ...c,
235
- name: e
236
- };
237
- }
238
- r === e && (n.isDirty = !1);
239
- } catch (t) {
240
- throw e.onError?.(t), t;
241
- } finally {
242
- n.isSaving = !1;
243
- }
244
- return j(() => i.onSaved?.(c, { trigger: t })), c;
245
- }
246
- function R() {
247
- return n.template?.id !== void 0;
248
- }
249
- return {
250
- state: l(n),
251
- content: a,
252
- selectedBlock: c,
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: w,
262
- addBlock: T,
263
- removeBlock: E,
264
- moveBlock: D,
265
- markDirty: O,
266
- findBlockLocation: m,
267
- setName: N,
268
- create: P,
269
- load: F,
270
- save: L,
271
- hasTemplate: R
272
- };
273
- }
274
- //#endregion
275
- //#region ../core/src/history.ts
276
- var de = 50, H = 300, fe = 1500;
277
- function pe(e) {
278
- let { content: t, setContent: n, isRemoteOperation: r, maxSize: a = de } = e, s = i([]), c = i([]), l = i(!1), u = null, d = null, f = o(() => s.value.length > 0), p = o(() => c.value.length > 0);
279
- function m() {
280
- return O(t.value);
281
- }
282
- function h(e) {
283
- s.value.push(e), s.value.length > a && s.value.splice(0, s.value.length - a);
284
- }
285
- function g() {
286
- d &&= (clearTimeout(d.timeoutId), null);
287
- }
288
- function _() {
289
- r?.() || (g(), h(m()), c.value = []);
290
- }
291
- function v(e) {
292
- r?.() || (d && d.blockId === e ? (clearTimeout(d.timeoutId), d.timeoutId = setTimeout(() => {
293
- d = null;
294
- }, H)) : (g(), h(m()), c.value = [], d = {
295
- blockId: e,
296
- timeoutId: setTimeout(() => {
297
- d = null;
298
- }, H)
299
- }));
300
- }
301
- function y() {
302
- l.value = !0, u && clearTimeout(u), u = setTimeout(() => {
303
- l.value = !1, u = null;
304
- }, fe);
305
- }
306
- function b() {
307
- if (s.value.length === 0) return;
308
- g();
309
- let e = s.value.pop();
310
- c.value.push(m()), n(e, !0), y();
311
- }
312
- function x() {
313
- if (c.value.length === 0) return;
314
- g();
315
- let e = c.value.pop();
316
- s.value.push(m()), n(e, !0), y();
317
- }
318
- function S() {
319
- s.value = [], c.value = [], g();
320
- }
321
- function C() {
322
- S(), u &&= (clearTimeout(u), null);
323
- }
324
- return {
325
- canUndo: f,
326
- canRedo: p,
327
- isNavigating: l,
328
- undo: b,
329
- redo: x,
330
- record: _,
331
- recordDebounced: v,
332
- clear: S,
333
- destroy: C
334
- };
335
- }
336
- //#endregion
337
- //#region ../core/src/block-actions.ts
338
- function me(e) {
339
- let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
340
- function o(n, r, a) {
341
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = P(n, o);
342
- return t(s, r, a), i(s.id), s;
343
- }
344
- function s(e, n, r) {
345
- let o = x(e);
346
- if (n !== void 0 || r !== void 0) t(o, n, r);
347
- else {
348
- let i = a?.(e.id) ?? null;
349
- i ? t(o, i.targetSectionId, i.columnIndex, i.index + 1) : t(o, n, r);
350
- }
351
- return i(o.id), o;
352
- }
353
- function c(e) {
354
- n(e);
355
- }
356
- function l(e, t, n) {
357
- r(e, { [t]: n });
358
- }
359
- return {
360
- createAndAddBlock: o,
361
- duplicateBlock: s,
362
- deleteBlock: c,
363
- updateBlockProperty: l
364
- };
365
- }
366
- //#endregion
367
- //#region ../core/src/auto-save.ts
368
- var U = 2e3;
369
- function he(e) {
370
- let { content: t, isDirty: n, onChange: r, debounce: i = U, enabled: a = !0 } = e, o = null, s = !1;
371
- function c() {
372
- return typeof a == "function" ? a() : a;
373
- }
374
- function l() {
375
- s = !0, d();
376
- }
377
- function u() {
378
- s = !1;
379
- }
380
- function d() {
381
- o &&= (clearTimeout(o), null);
382
- }
383
- function f() {
384
- d(), n() && r(JSON.parse(JSON.stringify(t.value)));
385
- }
386
- function p() {
387
- c() && !s && (d(), o = setTimeout(() => {
388
- o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
389
- }, i));
390
- }
391
- let m = g(t, () => {
392
- p();
393
- }, { deep: !0 });
394
- function h() {
395
- m(), d();
396
- }
397
- return {
398
- flush: f,
399
- cancel: d,
400
- pause: l,
401
- resume: u,
402
- destroy: h
403
- };
404
- }
405
- //#endregion
406
- //#region ../core/src/condition-preview.ts
407
- function ge(e) {
408
- let t = s(/* @__PURE__ */ new Set()), n = o(() => t.size > 0);
409
- function r(e) {
410
- return t.has(e);
411
- }
412
- function i(n) {
413
- t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
414
- }
415
- function a() {
416
- t.clear();
417
- }
418
- return {
419
- isHidden: r,
420
- toggleBlock: i,
421
- reset: a,
422
- hasHiddenBlocks: n
423
- };
424
- }
425
- //#endregion
426
- //#region ../core/src/data-source-fetch.ts
427
- function _e(e) {
428
- let t = i(!1), n = i(!1), r = o(() => !!e.definition.value?.dataSource), a = o(() => r.value && !e.block.value.dataSourceFetched);
429
- async function s() {
430
- let r = e.definition.value;
431
- if (r?.dataSource) {
432
- t.value = !0, n.value = !1;
433
- try {
434
- let t = await r.dataSource.onFetch({
435
- fieldValues: { ...e.block.value.fieldValues },
436
- blockId: e.block.value.id
437
- });
438
- if (t == null) return;
439
- let n = { ...e.block.value.fieldValues };
440
- for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
441
- e.onUpdate(n, !0);
442
- } catch (e) {
443
- console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
444
- } finally {
445
- t.value = !1;
446
- }
447
- }
448
- }
449
- return {
450
- isFetching: t,
451
- fetchError: n,
452
- fetch: s,
453
- hasDataSource: r,
454
- needsFetch: a
455
- };
456
- }
457
- //#endregion
458
- //#region ../core/src/history-interceptor.ts
459
- function ve(e, t) {
460
- let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
461
- e.addBlock = (r, i, a, o) => {
462
- i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
463
- }, e.removeBlock = (n) => {
464
- e.isBlockLocked(n) || (t.record(), r(n));
465
- }, e.moveBlock = (n, r, a, o) => {
466
- e.isBlockLocked(n) || a && e.isBlockLocked(a) || (t.record(), i(n, r, a, o));
467
- }, e.updateBlock = (n, r) => {
468
- e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r));
469
- }, e.updateSettings = (e) => {
470
- t.record(), o(e);
471
- };
472
- }
473
- //#endregion
474
- //#region ../core/src/saved-blocks.ts
475
- function ye(e) {
476
- let { provider: t } = e, n = i([]), r = i(!1), a = p(() => {
477
- let e = /* @__PURE__ */ new Set();
478
- for (let t of n.value) {
479
- let n = t.category?.trim();
480
- n && e.add(n);
481
- }
482
- return [...e].sort((e, t) => e.localeCompare(t));
483
- }), o = p(() => typeof t.create == "function"), s = p(() => typeof t.update == "function"), c = p(() => typeof t.delete == "function");
484
- function l(e) {
485
- return s.value && e.canUpdate !== !1;
486
- }
487
- function u(e) {
488
- return c.value && e.canDelete !== !1;
489
- }
490
- function d(e, t) {
491
- throw new I(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
492
- }
493
- function f(t) {
494
- B(e.onError, t);
495
- }
496
- async function m(i) {
497
- r.value = !0;
498
- try {
499
- n.value = await t.list(i);
500
- } catch (t) {
501
- throw e.onError?.(t), t;
502
- } finally {
503
- r.value = !1;
504
- }
505
- }
506
- async function h(r, i, a) {
507
- let { create: o } = t;
508
- typeof o != "function" && d("create", "disabled by the provider");
509
- try {
510
- let e = await o(a ? {
511
- name: r,
512
- content: i,
513
- category: a
514
- } : {
515
- name: r,
516
- content: i
517
- });
518
- return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
519
- } catch (t) {
520
- throw e.onError?.(t), t;
521
- }
522
- }
523
- async function g(r, i) {
524
- let { update: a } = t;
525
- typeof a != "function" && d("update", "disabled by the provider");
526
- let o = n.value.find((e) => e.id === r);
527
- o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
528
- try {
529
- let e = await a(r, i);
530
- return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
531
- } catch (t) {
532
- throw e.onError?.(t), t;
533
- }
534
- }
535
- async function _(r) {
536
- let { delete: i } = t;
537
- typeof i != "function" && d("delete", "disabled by the provider");
538
- let a = n.value.find((e) => e.id === r) ?? null;
539
- a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
540
- try {
541
- await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
542
- } catch (t) {
543
- throw e.onError?.(t), t;
544
- }
545
- }
546
- return {
547
- savedBlocks: n,
548
- isLoading: r,
549
- categories: a,
550
- canCreate: o,
551
- canUpdate: s,
552
- canDelete: c,
553
- canUpdateBlock: l,
554
- canDeleteBlock: u,
555
- load: m,
556
- create: h,
557
- update: g,
558
- remove: _
559
- };
560
- }
561
- //#endregion
562
- //#region ../core/src/saved-blocks-local.ts
563
- var be = "templatical:saved-blocks";
564
- function xe(e = {}) {
565
- let t = e.key ?? be;
566
- function n() {
567
- 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.");
568
- return localStorage;
569
- }
570
- function r() {
571
- let e = n().getItem(t);
572
- if (!e) return [];
573
- try {
574
- let t = JSON.parse(e);
575
- return Array.isArray(t) ? t : [];
576
- } catch {
577
- return [];
578
- }
579
- }
580
- function i(e) {
581
- n().setItem(t, JSON.stringify(e));
582
- }
583
- return {
584
- async list(e) {
585
- let t = r(), n = e?.search?.trim().toLowerCase(), i = e?.category?.trim();
586
- return t.filter((e) => !(n && !e.name.toLowerCase().includes(n) || i && e.category !== i));
587
- },
588
- async create(e) {
589
- let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
590
- id: w(),
591
- name: e.name,
592
- content: e.content,
593
- ...e.category ? { category: e.category } : {},
594
- createdAt: t,
595
- updatedAt: t
596
- };
597
- return i([n, ...r()]), n;
598
- },
599
- async update(e, t) {
600
- let n = r(), a = n.findIndex((t) => t.id === e);
601
- if (a === -1) throw Error(`[Templatical] Saved block not found: ${e}`);
602
- let o = {
603
- ...n[a],
604
- ...t,
605
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
606
- }, s = [...n];
607
- return s[a] = o, i(s), o;
608
- },
609
- async delete(e) {
610
- let t = r();
611
- if (!t.some((t) => t.id === e)) throw Error(`[Templatical] Saved block not found: ${e}`);
612
- i(t.filter((t) => t.id !== e));
613
- }
614
- };
615
- }
616
- //#endregion
617
- //#region ../core/src/media-local.ts
618
- var Se = "templatical:media", Ce = 50;
619
- function we(e = {}) {
620
- let t = e.key ?? Se;
621
- function n() {
622
- 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.");
623
- return localStorage;
624
- }
625
- function r() {
626
- let e = n().getItem(t);
627
- if (!e) return [];
628
- try {
629
- let t = JSON.parse(e);
630
- return Array.isArray(t) ? t : [];
631
- } catch {
632
- return [];
633
- }
634
- }
635
- function i(e) {
636
- n().setItem(t, JSON.stringify(e));
637
- }
638
- function a(e) {
639
- return typeof FileReader > "u" ? Promise.reject(/* @__PURE__ */ Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with FileReader.")) : new Promise((t, n) => {
640
- let r = new FileReader();
641
- r.onload = () => {
642
- typeof r.result == "string" ? t(r.result) : n(/* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
643
- }, r.onerror = () => {
644
- n(r.error ?? /* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
645
- }, r.readAsDataURL(e);
646
- });
647
- }
648
- return {
649
- async list(e) {
650
- let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
651
- let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
652
- return t.includes(n) || r.includes(n);
653
- }) : 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;
654
- return l < i.length && (c.nextCursor = String(l)), c;
655
- },
656
- async create(e) {
657
- let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
658
- id: w(),
659
- url: t,
660
- filename: e.filename || e.file.name,
661
- createdAt: n,
662
- updatedAt: n,
663
- size: e.file.size
664
- };
665
- 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;
666
- },
667
- async update(e, t) {
668
- let n = r(), a = n.findIndex((t) => t.id === e);
669
- if (a === -1) throw Error(`[Templatical] Media asset not found: ${e}`);
670
- let o = n[a], s = {
671
- ...o,
672
- ...t,
673
- id: o.id,
674
- url: o.url,
675
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
676
- }, c = [...n];
677
- return c[a] = s, i(c), s;
678
- },
679
- async delete(e) {
680
- let t = r();
681
- for (let n of e) if (!t.some((e) => e.id === n)) throw Error(`[Templatical] Media asset not found: ${n}`);
682
- let n = new Set(e);
683
- i(t.filter((e) => !n.has(e.id)));
684
- },
685
- folders: !1,
686
- replace: !1,
687
- importFromUrl: !1,
688
- checkUsage: !1,
689
- frequentlyUsed: !1,
690
- storage: !1
691
- };
692
- }
693
- //#endregion
694
- //#region ../core/src/version-history.ts
695
- function Te(e) {
696
- let { provider: t, getTemplateId: n } = e, r = i([]), a = i(!1), o = i(void 0), s = i(!1), c = /* @__PURE__ */ new Map(), l = p(() => typeof t.create == "function"), u = p(() => typeof t.restore == "function");
697
- function d(e) {
698
- let t = n();
699
- if (!t) throw new I(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
700
- return t;
701
- }
702
- function f(e) {
703
- throw new I(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
704
- }
705
- function m(t) {
706
- B(e.onError, t);
707
- }
708
- async function h(n) {
709
- let i = d("list");
710
- a.value = !0;
711
- try {
712
- let e = await t.list(i, n);
713
- r.value = e.versions, o.value = e.nextCursor;
714
- } catch (t) {
715
- throw e.onError?.(t), t;
716
- } finally {
717
- a.value = !1;
718
- }
719
- }
720
- function g(e) {
721
- return e.content ?? c.get(e.id) ?? null;
722
- }
723
- async function _(n) {
724
- let r = g(n);
725
- if (r) return r;
726
- let i = d("get");
727
- try {
728
- let e = await t.get(i, n.id);
729
- return c.set(n.id, e), e;
730
- } catch (t) {
731
- throw e.onError?.(t), t;
732
- }
733
- }
734
- async function v(n, i) {
735
- let { create: a } = t;
736
- typeof a != "function" && f("create");
737
- let o = d("create");
738
- try {
739
- let e = await a(o, n, i);
740
- return r.value = [e, ...r.value], m(() => t.onCreated?.(e)), e;
741
- } catch (t) {
742
- throw e.onError?.(t), t;
743
- }
744
- }
745
- async function y(n) {
746
- let { restore: r } = t;
747
- typeof r != "function" && f("restore");
748
- let i = d("restore"), a;
749
- s.value = !0;
750
- try {
751
- a = await r(i, n);
752
- } catch (t) {
753
- throw e.onError?.(t), t;
754
- } finally {
755
- s.value = !1;
756
- }
757
- return m(() => t.onRestored?.(a)), a;
758
- }
759
- return {
760
- nextCursor: o,
761
- versions: r,
762
- isLoading: a,
763
- isRestoring: s,
764
- canCreate: l,
765
- canRestore: u,
766
- load: h,
767
- peekContent: g,
768
- resolveContent: _,
769
- create: v,
770
- restore: y
771
- };
772
- }
773
- //#endregion
774
- //#region ../core/src/comments.ts
775
- function Ee(e) {
776
- let { provider: t, getTemplateId: n, getUser: r } = e, a = i([]), o = i(!1), s = i(!1), c = p(() => typeof t.create == "function"), l = p(() => typeof t.update == "function"), u = p(() => typeof t.delete == "function"), d = p(() => typeof t.setResolved == "function"), f = p(() => a.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = p(() => a.value.filter((e) => !e.resolvedAt).length), h = p(() => {
777
- let e = /* @__PURE__ */ new Map();
778
- for (let t of a.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
779
- return e;
780
- });
781
- function g(e) {
782
- let t = n();
783
- if (!t) throw new I(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
784
- return t;
785
- }
786
- function _(e) {
787
- let t = r();
788
- if (!t) throw new I(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
789
- return t;
790
- }
791
- function v(e) {
792
- throw new I(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
793
- }
794
- function y(e) {
795
- for (let t of a.value) {
796
- if (t.id === e) return t;
797
- for (let n of t.replies ?? []) if (n.id === e) return n;
798
- }
799
- return null;
800
- }
801
- function b(e) {
802
- let t = r();
803
- return t !== null && e.author.id === t.id;
804
- }
805
- function x(t) {
806
- let n = z(t);
807
- throw e.onError?.(n), n;
808
- }
809
- function S(t) {
810
- B(e.onError, t);
811
- }
812
- function C(e, t, n) {
813
- return [
814
- ...e.slice(0, t),
815
- n,
816
- ...e.slice(t + 1)
817
- ];
818
- }
819
- function w(e, t) {
820
- return e !== void 0 && JSON.stringify(e) === JSON.stringify(t);
821
- }
822
- function T(e) {
823
- if (e.parentId) {
824
- let t = !1, n = a.value.map((n) => {
825
- if (n.id !== e.parentId) return n;
826
- let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
827
- return i !== -1 && w(r[i], e) ? n : (t = !0, {
828
- ...n,
829
- replies: i === -1 ? [...r, e] : C(r, i, e)
830
- });
831
- });
832
- return t && (a.value = n), t;
833
- }
834
- let t = a.value.findIndex((t) => t.id === e.id);
835
- if (t === -1) return a.value = [...a.value, e], !0;
836
- let n = {
837
- ...e,
838
- replies: e.replies ?? a.value[t].replies
839
- };
840
- return !w(a.value[t], n) && (a.value = C(a.value, t, n), !0);
841
- }
842
- function E(e, t) {
843
- let n = y(e), r = t ?? n?.parentId ?? null;
844
- return r ? a.value = a.value.map((t) => t.id === r ? {
845
- ...t,
846
- replies: (t.replies ?? []).filter((t) => t.id !== e)
847
- } : t) : a.value = a.value.filter((t) => t.id !== e), n;
848
- }
849
- async function D(e) {
850
- let n = g("list");
851
- o.value = !0;
852
- try {
853
- a.value = await t.list(n, e);
854
- } catch (e) {
855
- x(e);
856
- } finally {
857
- o.value = !1;
858
- }
859
- }
860
- async function O(e) {
861
- let { create: n } = t;
862
- typeof n != "function" && v("create");
863
- let r = g("create");
864
- _("create"), s.value = !0;
865
- try {
866
- let i = await n(r, e);
867
- return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
868
- } catch (e) {
869
- x(e);
870
- } finally {
871
- s.value = !1;
872
- }
873
- }
874
- async function k(e, n) {
875
- let { update: r } = t;
876
- typeof r != "function" && v("update");
877
- let i = g("update");
878
- _("update"), s.value = !0;
879
- try {
880
- let a = await r(i, e, n);
881
- return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
882
- } catch (e) {
883
- x(e);
884
- } finally {
885
- s.value = !1;
886
- }
887
- }
888
- async function A(e) {
889
- let { delete: n } = t;
890
- typeof n != "function" && v("delete");
891
- let r = g("delete");
892
- _("delete");
893
- let i = y(e);
894
- s.value = !0;
895
- try {
896
- await n(r, e), E(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
897
- } catch (e) {
898
- x(e);
899
- } finally {
900
- s.value = !1;
901
- }
902
- }
903
- async function j(e, n) {
904
- let { setResolved: r } = t;
905
- typeof r != "function" && v("setResolved");
906
- let i = g("setResolved");
907
- _("setResolved"), s.value = !0;
908
- try {
909
- let a = await r(i, e, n);
910
- return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
911
- } catch (e) {
912
- x(e);
913
- } finally {
914
- s.value = !1;
915
- }
916
- }
917
- function M(e) {
918
- T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
919
- }
920
- function N(e) {
921
- T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
922
- }
923
- function P(e, n) {
924
- let r = E(e, n);
925
- r && S(() => t.onDeleted?.(r, { origin: "remote" }));
926
- }
927
- return {
928
- comments: a,
929
- isLoading: o,
930
- isSubmitting: s,
931
- canCreate: c,
932
- canUpdate: l,
933
- canDelete: u,
934
- canResolve: d,
935
- totalCount: f,
936
- unresolvedCount: m,
937
- commentCountByBlock: h,
938
- load: D,
939
- create: O,
940
- update: k,
941
- remove: A,
942
- setResolved: j,
943
- find: y,
944
- isOwn: b,
945
- applyRemoteCreate: M,
946
- applyRemoteUpdate: N,
947
- applyRemoteDelete: P
948
- };
949
- }
950
- function De(t) {
951
- let { comments: n, provider: r, getTemplateId: i } = t, { subscribe: a } = r;
952
- if (typeof a != "function") return;
953
- let o = null;
954
- function s() {
955
- o?.(), o = null;
956
- }
957
- e(() => i(), (e) => {
958
- s(), e && (o = a(e, (e) => {
959
- switch (e.type) {
960
- case "created":
961
- n.applyRemoteCreate(e.comment);
962
- break;
963
- case "updated":
964
- n.applyRemoteUpdate(e.comment);
965
- break;
966
- case "deleted": n.applyRemoteDelete(e.commentId, e.parentId);
967
- }
968
- }));
969
- }, { immediate: !0 }), c(s);
970
- }
971
- //#endregion
972
- //#region src/composables/useImageUrlResolver.ts
973
- function Oe(e) {
974
- let t = s(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
975
- function r(e) {
976
- return t.get(e);
977
- }
978
- function i(e) {
979
- return t.has(e) || n.has(e);
980
- }
981
- function a(r) {
982
- if (i(r)) return;
983
- let a;
984
- try {
985
- a = e(r);
986
- } catch {
987
- t.set(r, null);
988
- return;
989
- }
990
- a === null || typeof a == "string" ? t.set(r, a) : (n.add(r), Promise.resolve(a).then((e) => {
991
- t.set(r, typeof e == "string" ? e : null);
992
- }, () => {
993
- t.set(r, null);
994
- }).finally(() => n.delete(r)));
995
- }
996
- return {
997
- get: r,
998
- has: i,
999
- lookup: a
1000
- };
1001
- }
1002
- function W(r) {
1003
- let i = t(ne, null), a = p(r);
1004
- if (!i) return a;
1005
- let o;
1006
- function s() {
1007
- o !== void 0 && (clearTimeout(o), o = void 0);
1008
- }
1009
- n() && c(s);
1010
- let l = !0;
1011
- return e(a, (e) => {
1012
- s();
1013
- let t = l;
1014
- l = !1, e && !i.has(e) && (t ? i.lookup(e) : o = setTimeout(() => {
1015
- o = void 0, i.lookup(e);
1016
- }, 300));
1017
- }, { immediate: !0 }), p(() => {
1018
- let e = a.value;
1019
- if (!e) return e;
1020
- let t = i.get(e);
1021
- return typeof t == "string" && t.length > 0 ? t : e;
1022
- });
1023
- }
1024
- function ke(e, t) {
1025
- if (!e || !t) return t;
1026
- let n = e.get(t);
1027
- return typeof n == "string" && n.length > 0 ? n : t;
1028
- }
1029
- function G(e, t) {
1030
- return typeof e?.url == "string" && N(e.url, t);
1031
- }
1032
- function K(e, t) {
1033
- let n = e?.url;
1034
- if (typeof n == "string" && n.trim() !== "") return N(n, t) ? void 0 : n;
1035
- }
1036
- function Ae(e) {
1037
- let n = t(ee, F.liquid), r = W(() => K(e(), n));
1038
- return p(() => G(e(), n) ? null : r.value);
1039
- }
1040
- function je(e, t, n) {
1041
- return G(t, n) ? null : ke(e, K(t, n));
1042
- }
1043
- //#endregion
1044
- //#region src/utils/blockTypeLabels.ts
1045
- function q(e, t) {
1046
- return t.blocks[e] ?? e;
1047
- }
1048
- function Me(e, t, n = []) {
1049
- if (e.type !== "custom") return q(e.type, t);
1050
- let { customType: r } = e;
1051
- return n.find((e) => e.type === r)?.name ?? r;
1052
- }
1053
- //#endregion
1054
- //#region src/utils/resolveFieldColors.ts
1055
- function Ne(e, t) {
1056
- let n = oe({ presets: e.presets }, ae), r = n.presets.length === 0;
1057
- return {
1058
- presets: r ? t.presets : n.presets,
1059
- allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
1060
- invalidPresets: n.invalidPresets,
1061
- emptyPresets: e.presets !== void 0 && e.presets.length === 0,
1062
- presetsInherited: r,
1063
- allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
1064
- };
1065
- }
1066
- //#endregion
1067
- //#region src/utils/imageNaturalSize.ts
1068
- function J(e) {
1069
- return typeof e == "number" && Number.isFinite(e) && e > 0;
1070
- }
1071
- function Y(e, t) {
1072
- return J(e) && J(t) ? {
1073
- width: e,
1074
- height: t
1075
- } : null;
1076
- }
1077
- function Pe(e) {
1078
- return Y(e.naturalWidth, e.naturalHeight);
1079
- }
1080
- function Fe(e) {
1081
- return e ? {
1082
- naturalWidth: e.width,
1083
- naturalHeight: e.height
1084
- } : {
1085
- naturalWidth: void 0,
1086
- naturalHeight: void 0
1087
- };
1088
- }
1089
- function X(e, t) {
1090
- if (typeof Image > "u") return t(null), () => {};
1091
- let n = new Image(), r = () => {
1092
- n.onload = null, n.onerror = null;
1093
- };
1094
- return n.onload = () => {
1095
- r(), t(Y(n.naturalWidth, n.naturalHeight));
1096
- }, n.onerror = () => {
1097
- r(), t(null);
1098
- }, n.src = e, r;
1099
- }
1100
- function Ie(e) {
1101
- return new Promise((t) => {
1102
- let n = setTimeout(() => {
1103
- r(), t(null);
1104
- }, re), r = X(e, (e) => {
1105
- clearTimeout(n), t(e);
1106
- });
1107
- });
1108
- }
1109
- //#endregion
1110
- //#region src/components/MediaDropOverlay.vue
1111
- var Le = /* @__PURE__ */ a({
1112
- __name: "MediaDropOverlay",
1113
- props: {
1114
- uploading: { type: Boolean },
1115
- size: { default: "field" }
1116
- },
1117
- setup(e) {
1118
- let t = e, { t: n } = ie(), i = {
1119
- field: {
1120
- gap: "tpl:gap-1.5",
1121
- icon: 18,
1122
- veil: "90%"
1123
- },
1124
- canvas: {
1125
- gap: "tpl:gap-2",
1126
- icon: 20,
1127
- veil: "85%"
1128
- }
1129
- }, a = p(() => i[t.size]);
1130
- return (t, i) => (r(), m("div", {
1131
- class: f(["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)]", a.value.gap]),
1132
- style: h({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
1133
- }, [e.uploading ? (r(), m(v, { key: 0 }, [d(u(se), {
1134
- class: "tpl-spinner",
1135
- size: a.value.icon,
1136
- "stroke-width": 2
1137
- }, null, 8, ["size"]), b(" " + y(u(n).image.uploading), 1)], 64)) : (r(), m(v, { key: 1 }, [d(u(ce), {
1138
- size: a.value.icon,
1139
- "stroke-width": 1.5
1140
- }, null, 8, ["size"]), b(" " + y(u(n).image.dropToUpload), 1)], 64))], 6));
1141
- }
1142
- }), Re = "image/";
1143
- function ze(e) {
1144
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = L(t, {
1145
- preventDefaultForUnhandled: !0,
1146
- onDrop: (e) => {
1147
- if (!i()) return;
1148
- let t = (e ?? []).filter((e) => e.type.startsWith(Re));
1149
- t.length > 0 && n([t[0]]);
1150
- }
1151
- });
1152
- return { isOver: p(() => i() && a.value) };
1153
- }
1154
- //#endregion
1155
- //#region src/composables/useMediaDropField.ts
1156
- function Be(e) {
1157
- let { target: n, blocked: r, apply: a } = e, o = t(R, null), s = t(te, null), c = le();
1158
- async function l() {
1159
- let e = await o?.({ accept: ["images"] });
1160
- c.alive && e && a(e);
1161
- }
1162
- let u = i(!1), d = p(() => (s?.value ?? !!o) && !u.value && !_(r));
1163
- async function f(e) {
1164
- if (o) {
1165
- u.value = !0;
1166
- try {
1167
- let t = await o({
1168
- accept: ["images"],
1169
- files: e
1170
- });
1171
- if (!c.alive) return;
1172
- t && a(t);
1173
- } finally {
1174
- c.alive && (u.value = !1);
1175
- }
1176
- }
1177
- }
1178
- let { isOver: m } = ze({
1179
- target: n,
1180
- enabled: d,
1181
- onFiles: f
1182
- }), h = p(() => d.value && m.value || u.value);
1183
- return {
1184
- canBrowse: !!o,
1185
- dropEnabled: d,
1186
- isUploading: u,
1187
- showOverlay: h,
1188
- openMediaBrowser: l
1189
- };
1190
- }
1191
- function Ve(e, t = "desktop") {
1192
- return t === "mobile" ? 375 : e?.width ?? 600;
1193
- }
1194
- var He = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", Ue = {
1195
- 1: [100],
1196
- 2: [50, 50],
1197
- 3: [
1198
- 33.33,
1199
- 33.33,
1200
- 33.34
1201
- ],
1202
- "1-2": [33.33, 66.67],
1203
- "2-1": [66.67, 33.33]
1204
- };
1205
- function Z(e, t) {
1206
- let n = (e) => Math.trunc(e ?? 0), r = (e) => T(e) === null ? 0 : Math.trunc(e.width);
1207
- return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
1208
- }
1209
- function We(e, t) {
1210
- return Math.floor(e) - Z(t);
1211
- }
1212
- function Ge(e, t) {
1213
- let n = "border" in e ? e.border : void 0;
1214
- return Math.floor(t) - Z(e.styles.padding, n);
1215
- }
1216
- function* Q(e, t) {
1217
- for (let n of e) M(n) ? yield* Q(n.children, We(t, n.styles.padding)) : yield {
1218
- block: n,
1219
- bandWidth: A(n) && n.wrapper ? We(t, n.wrapper.padding) : t
1220
- };
1221
- }
1222
- function Ke(e, t) {
1223
- if (!t) return e;
1224
- try {
1225
- return D(t, e);
1226
- } catch {
1227
- return e;
1228
- }
1229
- }
1230
- function qe(e, t, n) {
1231
- let r = Ke(e, n);
1232
- for (let { block: e, bandWidth: n } of Q(r.blocks, r.settings.width)) if (A(e)) {
1233
- let r = E(e)?.applied ? void 0 : e.border, i = Math.floor(n) - Z(e.styles.padding, r), a = Ue[e.columns] ?? [100];
1234
- for (let n = 0; n < e.children.length; n++) {
1235
- let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
1236
- if (o) return Ge(o, r);
1237
- }
1238
- } else if (e.id === t) return Ge(e, n);
1239
- return null;
1240
- }
1241
- function $(e, t, n) {
1242
- let r = Ke(e, n);
1243
- for (let { block: e, bandWidth: n } of Q(r.blocks, r.settings.width)) if (e.id === t) return Math.floor(n);
1244
- return null;
1245
- }
1246
- function Je(e, t, n) {
1247
- if (!A(e)) return;
1248
- let r = E(e);
1249
- if (r?.applied && r.height === "image") return (t ? $(t, e.id, n) : null) ?? Ve(t?.settings);
1250
- }
1251
- //#endregion
1252
- //#region src/constants/socialIcons.ts
1253
- var Ye = j, Xe = {
1254
- small: 24,
1255
- medium: 32,
1256
- large: 48
1257
- }, Ze = [
1258
- "facebook",
1259
- "twitter",
1260
- "instagram",
1261
- "linkedin",
1262
- "youtube",
1263
- "tiktok",
1264
- "pinterest",
1265
- "email",
1266
- "website",
1267
- "whatsapp",
1268
- "telegram",
1269
- "discord",
1270
- "snapchat",
1271
- "reddit",
1272
- "github",
1273
- "dribbble",
1274
- "behance"
1275
- ];
1276
- //#endregion
1277
- export { ve as A, W as C, we as D, Te as E, me as F, pe as I, ue as L, ge as M, U as N, xe as O, he as P, Ae as S, Ee as T, Me as _, Je as a, K as b, Ve as c, X as d, Ie as f, Ne as g, Y as h, qe as i, _e as j, ye as k, Be as l, Pe as m, Ye as n, $ as o, Fe as p, Ze as r, He as s, Xe as t, Le as u, q as v, De as w, je as x, Oe as y };
1278
-
1279
- //# sourceMappingURL=socialIcons-C_lnkpG6.js.map