@templatical/editor 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatPanel-DdhtfsmO.js → AiChatPanel-C8SeEJRP.js} +8 -8
- package/dist/{AiPanels-HBx7xoJR.js → AiPanels-CR6zphjP.js} +1 -1
- package/dist/{AiRewriteMenu-DPzSekZt.js → AiRewriteMenu-CIHUnPud.js} +6 -6
- package/dist/{BlockIssueBadge-eIXZJ9M3.js → BlockIssueBadge-DaPTq1RE.js} +2 -2
- package/dist/{BlockPreviewCanvas-DO-2TP_6.js → BlockPreviewCanvas-B70RSavL.js} +3 -3
- package/dist/{CloudPanels-i2kZdrdP.js → CloudPanels-VpSQiLLL.js} +3 -3
- package/dist/{CollaborationNotices-DANsjl7c.js → CollaborationNotices-Cnx0XHzZ.js} +1 -1
- package/dist/{CollaboratorBar-CbbAA0m1.js → CollaboratorBar-BaBoNhwB.js} +1 -1
- package/dist/{CommentsPanel-CYW3LWis.js → CommentsPanel-Ck3QmqiC.js} +1 -1
- package/dist/{CommentsSidebar-CcF4ISMi.js → CommentsSidebar-CHknhOar.js} +10 -10
- package/dist/{CountdownToolbar-D3Lv74kU.js → CountdownToolbar-CM4XNEuO.js} +3 -3
- package/dist/{IssuesPanel-BMAG9042.js → IssuesPanel-1wGV0wiy.js} +8 -8
- package/dist/{LanguageMenu-FlP_Jbup.js → LanguageMenu-d2GlX67r.js} +8 -8
- package/dist/{LocaleNotices-DAnVszWu.js → LocaleNotices-WzsYtBRs.js} +2 -2
- package/dist/{LogicTagInsertButton-BjYs-UQX.js → LogicTagInsertButton-DgTJ6Lvx.js} +3 -3
- package/dist/{MediaEditModal-LnG-cF_S.js → MediaEditModal-C3U9Mi31.js} +1 -1
- package/dist/{MediaPanels-C2r5fiFo.js → MediaPanels-CGmk9ufe.js} +1 -1
- package/dist/{MergeTagInput-BsnogCeY.js → MergeTagInput-B_51YcQO.js} +1 -1
- package/dist/{MergeTagModeToggle-DiufIQ-_.js → MergeTagModeToggle-D3Q2z317.js} +3 -3
- package/dist/{MergeTagTextarea-BweI-Xsi.js → MergeTagTextarea-DZz1L9DE.js} +2 -2
- package/dist/{ParagraphEditor-qgBp5yIB.js → ParagraphEditor-CI68PYDL.js} +12 -12
- package/dist/{RestoreVersionDialog-DdYUrFiK.js → RestoreVersionDialog-DcuhpOIz.js} +3 -3
- package/dist/{RichTextEditorContent-C5MAzx3E.js → RichTextEditorContent-Dstovi0m.js} +4 -4
- package/dist/{SaveBlockDialog-eK6fjtTy.js → SaveBlockDialog-vuwvoi-d.js} +7 -7
- package/dist/{SavedBlocksBrowserModal-D2QHd2Yp.js → SavedBlocksBrowserModal-DUJm0dOv.js} +9 -9
- package/dist/{SavedBlocksPanels-Cl61f4Mf.js → SavedBlocksPanels-BiMXQ5lY.js} +1 -1
- package/dist/{SavedBlocksPickBar-CXP2dkeB.js → SavedBlocksPickBar-CAstZfG7.js} +2 -2
- package/dist/{TemplateSettings-BKJrdZcH.js → TemplateSettings-Baar78_s.js} +6 -6
- package/dist/{TestEmailModal-DQotJg6g.js → TestEmailModal-Bl_GHdrN.js} +6 -6
- package/dist/{TestEmailPanel-CwiTzJsh.js → TestEmailPanel-CpTBF7B5.js} +1 -1
- package/dist/{TitleEditor-CzSvsPAn.js → TitleEditor-DkbEDAZB.js} +6 -6
- package/dist/{Toolbar-Cd75ci5W.js → Toolbar-bOZ_eq7X.js} +27 -27
- package/dist/{TplModal-ZoXu40T9.js → TplModal-wk2gLa7_.js} +1 -1
- package/dist/{VersionHistoryMenu-BvhN-Ofk.js → VersionHistoryMenu-BnP0EyLl.js} +5 -5
- package/dist/{VersionHistoryPanels-DPWMnYbd.js → VersionHistoryPanels-Cq2rFKIX.js} +1 -1
- package/dist/{VersionPreviewBanner-CuJnasxH.js → VersionPreviewBanner-BPP939cD.js} +1 -1
- package/dist/{WrapperBlock-D4fPwO0t.js → WrapperBlock-cWT_nZgQ.js} +2 -2
- package/dist/{blockTypeIcons-BXMxu86H.js → blockTypeIcons-BUyPZ7Su.js} +3 -3
- package/dist/bundle-stats.json +4 -4
- package/dist/cdn/chunks/{AiAltTextPopover-ByZ0FEqI.js → AiAltTextPopover-Cnc_kUmb.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextPopover-ByZ0FEqI.js.map → AiAltTextPopover-Cnc_kUmb.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-Dtm3A2cD.js → AiAltTextReview-DPeSY-7r.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextReview-Dtm3A2cD.js.map → AiAltTextReview-DPeSY-7r.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-DciEt27y.js → AiChatPanel-By8Uo1nH.js} +2 -2
- package/dist/cdn/chunks/{AiChatPanel-DciEt27y.js.map → AiChatPanel-By8Uo1nH.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-BV5D1itk.js → AiPanels-BblCSkQy.js} +2 -2
- package/dist/cdn/chunks/{AiPanels-BV5D1itk.js.map → AiPanels-BblCSkQy.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-D3jkh6Xb.js → AiRewriteMenu-C4btyN4W.js} +6 -6
- package/dist/cdn/chunks/{AiRewriteMenu-D3jkh6Xb.js.map → AiRewriteMenu-C4btyN4W.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DyEgBZtR.js → BlockIssueBadge-D3Plo_wt.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-DyEgBZtR.js.map → BlockIssueBadge-D3Plo_wt.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-RQFilqXC.js → BlockPreviewCanvas-CTKmBPsq.js} +7 -7
- package/dist/cdn/chunks/{BlockPreviewCanvas-RQFilqXC.js.map → BlockPreviewCanvas-CTKmBPsq.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BSJ-Z5Hw.js → CloudPanels-COU26R83.js} +3 -3
- package/dist/cdn/chunks/{CloudPanels-BSJ-Z5Hw.js.map → CloudPanels-COU26R83.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-BS7xrlPE.js → CollaborationNotices-DraFUhyo.js} +2 -2
- package/dist/cdn/chunks/{CollaborationNotices-BS7xrlPE.js.map → CollaborationNotices-DraFUhyo.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-Bc9914Az.js → CollaboratorBar-0OEH3hrj.js} +2 -2
- package/dist/cdn/chunks/{CollaboratorBar-Bc9914Az.js.map → CollaboratorBar-0OEH3hrj.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-DbR9phAk.js → CommentsPanel-tZZswofV.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-DbR9phAk.js.map → CommentsPanel-tZZswofV.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-BD4--XP2.js → CommentsSidebar-7Hfl3Hdj.js} +2 -2
- package/dist/cdn/chunks/{CommentsSidebar-BD4--XP2.js.map → CommentsSidebar-7Hfl3Hdj.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DxwYBw-d.js → CountdownToolbar-CNgsNL5-.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-DxwYBw-d.js.map → CountdownToolbar-CNgsNL5-.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CUmI4HMm.js → IssuesPanel-Duic0mIs.js} +4 -4
- package/dist/cdn/chunks/{IssuesPanel-CUmI4HMm.js.map → IssuesPanel-Duic0mIs.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-3ydCozQJ.js → LanguageMenu-B1Aue_lf.js} +11 -11
- package/dist/cdn/chunks/{LanguageMenu-3ydCozQJ.js.map → LanguageMenu-B1Aue_lf.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-BfoH6gST.js → LocaleNotices-8J2DRWeg.js} +2 -2
- package/dist/cdn/chunks/{LocaleNotices-BfoH6gST.js.map → LocaleNotices-8J2DRWeg.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-5Z3fFzjc.js → LogicTagInsertButton-Bhvi0nWz.js} +5 -5
- package/dist/cdn/chunks/{LogicTagInsertButton-5Z3fFzjc.js.map → LogicTagInsertButton-Bhvi0nWz.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-DDCIwr9U.js → MediaEditModal-Dz972UFx.js} +2 -2
- package/dist/cdn/chunks/{MediaEditModal-DDCIwr9U.js.map → MediaEditModal-Dz972UFx.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-Dz79oy8P.js → MediaPanels-C6Hqtp1H.js} +2 -2
- package/dist/cdn/chunks/{MediaPanels-Dz79oy8P.js.map → MediaPanels-C6Hqtp1H.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-CIWy-cXf.js → MergeTagInput-CrhZm-AW.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-CIWy-cXf.js.map → MergeTagInput-CrhZm-AW.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BrP5GR-x.js → MergeTagModeToggle-CWVtXLYa.js} +3 -3
- package/dist/cdn/chunks/{MergeTagModeToggle-BrP5GR-x.js.map → MergeTagModeToggle-CWVtXLYa.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-D3nNDlhV.js → MergeTagTextarea-hTIBwX0F.js} +7 -7
- package/dist/cdn/chunks/{MergeTagTextarea-D3nNDlhV.js.map → MergeTagTextarea-hTIBwX0F.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DDolH_Pf.js → ParagraphEditor-B2UU1Q5I.js} +15 -15
- package/dist/cdn/chunks/{ParagraphEditor-DDolH_Pf.js.map → ParagraphEditor-B2UU1Q5I.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-Crj1DBqC.js → RestoreVersionDialog-C1Y5Ewo_.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-Crj1DBqC.js.map → RestoreVersionDialog-C1Y5Ewo_.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-rCCqFlwJ.js → RichTextEditorContent-up4AqL7D.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-rCCqFlwJ.js.map → RichTextEditorContent-up4AqL7D.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-C34RW1aM.js → SaveBlockDialog-B9lwEP_T.js} +6 -6
- package/dist/cdn/chunks/{SaveBlockDialog-C34RW1aM.js.map → SaveBlockDialog-B9lwEP_T.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CJnwWPT-.js → SavedBlocksBrowserModal-fAeHUyxb.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CJnwWPT-.js.map → SavedBlocksBrowserModal-fAeHUyxb.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-CA2PqXIH.js → SavedBlocksPanels-DRDTLDyZ.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-CA2PqXIH.js.map → SavedBlocksPanels-DRDTLDyZ.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-Dj3ortee.js → SavedBlocksPickBar-B6b5z-o3.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-Dj3ortee.js.map → SavedBlocksPickBar-B6b5z-o3.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-sW0ZlDl1.js → TemplateSettings-CWUpUKJb.js} +6 -6
- package/dist/cdn/chunks/{TemplateSettings-sW0ZlDl1.js.map → TemplateSettings-CWUpUKJb.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-BXeCtTjU.js → TestEmailModal-DQxnW5Q5.js} +7 -7
- package/dist/cdn/chunks/{TestEmailModal-BXeCtTjU.js.map → TestEmailModal-DQxnW5Q5.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CpZcpB9D.js → TestEmailPanel-BcO_-16H.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CpZcpB9D.js.map → TestEmailPanel-BcO_-16H.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-Bv3SmSO6.js → TitleEditor-pmycpmTd.js} +5 -5
- package/dist/cdn/chunks/{TitleEditor-Bv3SmSO6.js.map → TitleEditor-pmycpmTd.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-BJKpJ2Mg.js → Toolbar-BlWVQRcA.js} +571 -571
- package/dist/cdn/chunks/{Toolbar-BJKpJ2Mg.js.map → Toolbar-BlWVQRcA.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-DDDUDMYC.js → TplModal-ClSSGX7a.js} +2 -2
- package/dist/cdn/chunks/{TplModal-DDDUDMYC.js.map → TplModal-ClSSGX7a.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-DSElv3Sv.js → VersionHistoryMenu-CZury5gU.js} +4 -4
- package/dist/cdn/chunks/{VersionHistoryMenu-DSElv3Sv.js.map → VersionHistoryMenu-CZury5gU.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-H2nuik1l.js → VersionHistoryPanels-B8GPBKMq.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-H2nuik1l.js.map → VersionHistoryPanels-B8GPBKMq.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-Whwxh55w.js → VersionPreviewBanner-C4Ji8nu4.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-Whwxh55w.js.map → VersionPreviewBanner-C4Ji8nu4.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-jTqsuLnS.js → WrapperBlock-BoUflYwY.js} +4 -4
- package/dist/cdn/chunks/{WrapperBlock-jTqsuLnS.js.map → WrapperBlock-BoUflYwY.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-DMgLcuI8.js → blockTypeIcons-Cc6RJ27V.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-DMgLcuI8.js.map → blockTypeIcons-Cc6RJ27V.js.map} +1 -1
- package/dist/cdn/chunks/{composables-D0UYam2P.js → composables-C1KU4ZHw.js} +117 -117
- package/dist/cdn/chunks/{composables-D0UYam2P.js.map → composables-C1KU4ZHw.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-BdsclY8_.js → createCloudRuntime-C2Zs5F1O.js} +3 -3
- package/dist/cdn/chunks/{createCloudRuntime-BdsclY8_.js.map → createCloudRuntime-C2Zs5F1O.js.map} +1 -1
- package/dist/cdn/chunks/{editor-modal-CPbgthOv.js → editor-modal-erQEOHZN.js} +90 -90
- package/dist/cdn/chunks/{editor-modal-CPbgthOv.js.map → editor-modal-erQEOHZN.js.map} +1 -1
- package/dist/cdn/chunks/en-B6tLGRHq.js +1 -0
- package/dist/cdn/chunks/{extensions-Uh9vuFfK.js → extensions-DcMKZpzh.js} +4 -4
- package/dist/cdn/chunks/{extensions-Uh9vuFfK.js.map → extensions-DcMKZpzh.js.map} +1 -1
- package/dist/cdn/chunks/{icons-CSSMtbGK.js → icons-Da9GKjPx.js} +42 -42
- package/dist/cdn/chunks/{icons-CSSMtbGK.js.map → icons-Da9GKjPx.js.map} +1 -1
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-oGhwVscw.js → normalizeMergeTagMarkup-cC32Ox6A.js} +23 -23
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-oGhwVscw.js.map → normalizeMergeTagMarkup-cC32Ox6A.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-C8k7tw98.js → preRenderCustomBlocks-f7GEKdvw.js} +4 -4
- package/dist/cdn/chunks/{preRenderCustomBlocks-C8k7tw98.js.map → preRenderCustomBlocks-f7GEKdvw.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-DYklmvgX.js → sanitizeHtml-WTfz9lZd.js} +2 -2
- package/dist/cdn/chunks/{sanitizeHtml-DYklmvgX.js.map → sanitizeHtml-WTfz9lZd.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-BAiuHyJs.js → socialIcons-DeCYorUT.js} +493 -493
- package/dist/cdn/chunks/{socialIcons-BAiuHyJs.js.map → socialIcons-DeCYorUT.js.map} +1 -1
- package/dist/cdn/chunks/{src-DheBmnvF.js → src-A_cKeTM_.js} +263 -263
- package/dist/cdn/chunks/{src-DheBmnvF.js.map → src-A_cKeTM_.js.map} +1 -1
- package/dist/cdn/chunks/{src-CACM3o--.js → src-BQUv2CYU.js} +152 -152
- package/dist/cdn/chunks/{src-CACM3o--.js.map → src-BQUv2CYU.js.map} +1 -1
- package/dist/cdn/chunks/{src-Ddpm4HsS.js → src-BWX_xVxO.js} +237 -179
- package/dist/cdn/chunks/src-BWX_xVxO.js.map +1 -0
- package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-yXbRKNrs.js.map → useLocalizedDisplay-aGfnO90D.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-B7RpqVFQ.js → useLogicTag-DtYe8HIq.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-B7RpqVFQ.js.map → useLogicTag-DtYe8HIq.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-C-32ETjj.js → useMergeTag-B8ULmsnp.js} +2 -2
- package/dist/cdn/chunks/{useMergeTag-C-32ETjj.js.map → useMergeTag-B8ULmsnp.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-D33ZXoWp.js → withCurrentFont-MK8ga9q9.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-D33ZXoWp.js.map → withCurrentFont-MK8ga9q9.js.map} +1 -1
- package/dist/cdn/editor.js +262 -262
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-ChQ0l8EQ.js → check-XMnOOIEC.js} +1 -1
- package/dist/{chevron-down-Bh6cp6PI.js → chevron-down-DmamTEWQ.js} +1 -1
- package/dist/{chevron-right-LUgdqdoW.js → chevron-right-BEFXOH27.js} +1 -1
- package/dist/{chevron-up-XsDeJxQN.js → chevron-up-Dw7woXj8.js} +1 -1
- package/dist/{circle-alert-lODfDsrj.js → circle-alert-BTKC9vkq.js} +1 -1
- package/dist/{clock-DrqFEZkT.js → clock-BVT5u2uG.js} +1 -1
- package/dist/{composables-BOP3ERRP.js → composables-CMIrGXJ1.js} +13 -13
- package/dist/{createLucideIcon-Dw5e5gVE.js → createLucideIcon-CgDE3xAR.js} +5 -5
- package/dist/{editor-modal-B_2EAOjN.js → editor-modal-BeX6otLk.js} +15 -15
- package/dist/en-Do0SU6tR.js +1 -0
- package/dist/{extensions-DOLZkLzV.js → extensions-BJ184osp.js} +1 -1
- package/dist/{eye-DChfk0gi.js → eye-ByMgHeA_.js} +1 -1
- package/dist/{image--Hj2by1G.js → image-Ch8tR35K.js} +1 -1
- package/dist/{info-BbXgy82f.js → info-DzSD-Wpk.js} +1 -1
- package/dist/{link-C2_8yJno.js → link-oDn9AR2w.js} +1 -1
- package/dist/{list-DLGs2n0V.js → list-C5t07dp8.js} +1 -1
- package/dist/{loader-circle-BbDItE_O.js → loader-circle-k6xvKgUB.js} +1 -1
- package/dist/{message-circle-NAModq0p.js → message-circle-C23R6OJR.js} +1 -1
- package/dist/{package-BuzsfRyH.js → package-C90eQ7NU.js} +1 -1
- package/dist/{pencil-BTUUECH4.js → pencil-BK7GrQuA.js} +1 -1
- package/dist/{plus-Dm7DN65T.js → plus-Cr0Mis63.js} +1 -1
- package/dist/{refresh-cw-xMURqGWi.js → refresh-cw-_ZLOIEvA.js} +1 -1
- package/dist/{rotate-ccw-DqVcEIn5.js → rotate-ccw-CB5wsHwv.js} +1 -1
- package/dist/{sanitizeHtml-mKgNUdME.js → sanitizeHtml-2rjV0r-6.js} +1 -1
- package/dist/{search-Cfr3W44N.js → search-BmrQNox8.js} +1 -1
- package/dist/{send-CH1SrvyB.js → send-blAsIBBg.js} +1 -1
- package/dist/{smartphone-pAkvzjdI.js → smartphone-BPpWYrwV.js} +1 -1
- package/dist/{socialIcons-Dqr4DJOz.js → socialIcons-TFiOkpoU.js} +3 -3
- package/dist/{sparkles-CRO0cCnp.js → sparkles-OqIxrNp-.js} +1 -1
- package/dist/{square-CaQWMntx.js → square-BP-V7iT-.js} +1 -1
- package/dist/templatical-editor.js +29 -29
- package/dist/{text-align-start-BQ39AaRK.js → text-align-start-4mwX2o-F.js} +13 -13
- package/dist/{trash-BL5gEFHN.js → trash-B99WixTA.js} +1 -1
- package/dist/{triangle-alert-BYbKu7zZ.js → triangle-alert-CHMiDkHa.js} +1 -1
- package/dist/{upload-BhmL4Vqx.js → upload-Cp8o-hrN.js} +1 -1
- package/dist/{useScrollToBlock-C0Kapxdh.js → useScrollToBlock-B35ObCGK.js} +1 -1
- package/dist/{x-B7NZYzhx.js → x-BIBStNMS.js} +1 -1
- package/package.json +8 -8
- package/dist/cdn/chunks/en-IYVryJRl.js +0 -1
- package/dist/cdn/chunks/src-Ddpm4HsS.js.map +0 -1
- package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +0 -33
- package/dist/en-DTtwco2Q.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $ as e, C as t, F as n, H as r, M as i, O as a, Q as o, X as s, Y as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, lt as h, mt as g, ot as _, p as v, pt as y, q as b, rt as x, tt as S, u as C, x as w } from "./draggable-DepKdldn.js";
|
|
2
|
-
import { $t as T, A as E, At as D, Bt as O,
|
|
3
|
-
import { at as ge, s as
|
|
4
|
-
import { B as
|
|
5
|
-
import { t as
|
|
6
|
-
import { r as
|
|
7
|
-
import { i as
|
|
2
|
+
import { $t as T, A as E, At as D, Bt as O, Ft as k, Gt as A, Ht as j, It as M, Jt as N, Kt as ee, Mt as P, N as F, Nt as te, O as ne, Ot as re, P as I, Pt as L, Qt as R, Rt as z, Vt as ie, Xt as B, Yt as ae, Z as oe, Zt as V, en as H, jt as U, k as W, lt as se, n as ce, qt as le, r as ue, sn as de, tn as fe, vn as pe, xt as me, zt as he } from "./src-BQUv2CYU.js";
|
|
3
|
+
import { at as ge, s as _e } from "./icons-Da9GKjPx.js";
|
|
4
|
+
import { B as ve, C as ye, U as be, u as xe } from "./keys-CoQtCqNv.js";
|
|
5
|
+
import { t as Se } from "./useI18n-BnJYydPv.js";
|
|
6
|
+
import { r as Ce } from "./dist-DqGgijFI.js";
|
|
7
|
+
import { i as we, r as Te } from "./usePopoverPosition-BWAXWeBv.js";
|
|
8
8
|
// ../core/src/localized-edit.ts
|
|
9
|
-
var
|
|
9
|
+
var G = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ee = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => G(e) && typeof e.id == "string"), De = /* @__PURE__ */ new Set([
|
|
10
10
|
"id",
|
|
11
11
|
"type",
|
|
12
12
|
"children",
|
|
@@ -14,51 +14,51 @@ var q = (e) => typeof e == "object" && !!e && !Array.isArray(e), we = (e) => Arr
|
|
|
14
14
|
"l10n",
|
|
15
15
|
"renderedHtml"
|
|
16
16
|
]);
|
|
17
|
-
function
|
|
17
|
+
function Oe(e, t, n) {
|
|
18
18
|
let r = /* @__PURE__ */ new Set();
|
|
19
19
|
for (let i of n) {
|
|
20
|
-
if (!
|
|
21
|
-
let n = i.split("."), a = n.pop(), o = n.join("."), s =
|
|
20
|
+
if (!O(i)) continue;
|
|
21
|
+
let n = i.split("."), a = n.pop(), o = n.join("."), s = N(e, i), c = t;
|
|
22
22
|
for (let [t, i] of n.entries()) {
|
|
23
23
|
let a = n.slice(0, t + 1).join(".");
|
|
24
|
-
s !== void 0 &&
|
|
24
|
+
s !== void 0 && G(c) && N(c, i) === void 0 && G(N(e, a)) && (c[i] = {}, r.add(a)), c = N(c, i);
|
|
25
25
|
}
|
|
26
26
|
if (Array.isArray(c)) {
|
|
27
|
-
let e = c.findIndex((e) =>
|
|
27
|
+
let e = c.findIndex((e) => G(e) && e.id === a);
|
|
28
28
|
if (e < 0) continue;
|
|
29
|
-
s === void 0 ? c.splice(e, 1) : c[e] =
|
|
30
|
-
} else
|
|
29
|
+
s === void 0 ? c.splice(e, 1) : c[e] = H(s);
|
|
30
|
+
} else G(c) && (s === void 0 ? delete c[a] : c[a] = H(s), o && Object.keys(c).length === 0 && N(e, o) === void 0 && Oe(e, t, [o]));
|
|
31
31
|
}
|
|
32
32
|
return r;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (
|
|
36
|
-
else if (i &&
|
|
34
|
+
function K(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
|
|
35
|
+
if (G(e) && G(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !De.has(o)) && K(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
|
|
36
|
+
else if (i && Ee(e) && Ee(t)) for (let o of t) {
|
|
37
37
|
if (o.id.includes(".")) continue;
|
|
38
38
|
let t = e.find((e) => e.id === o.id);
|
|
39
|
-
t &&
|
|
39
|
+
t && K(t, o, `${n}.${o.id}`, r, i, a);
|
|
40
40
|
}
|
|
41
|
-
else
|
|
41
|
+
else T(e, t) || r.set(n, t);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function q(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
|
|
44
44
|
let a = /* @__PURE__ */ new Map();
|
|
45
|
-
|
|
46
|
-
let o = new Set(e.type === "custom" ?
|
|
47
|
-
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) :
|
|
45
|
+
K(e, t, "", a, e.type !== "custom", i);
|
|
46
|
+
let o = new Set(e.type === "custom" ? V(e, r) : []), s = {}, c = {};
|
|
47
|
+
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : j(e.type, t)) && typeof r == "string" && N(e, t) !== void 0) {
|
|
48
48
|
let i = n?.text?.[t];
|
|
49
49
|
s[t] = i && i.value === r ? i : {
|
|
50
50
|
value: r,
|
|
51
|
-
sourceHash:
|
|
51
|
+
sourceHash: B(String(N(e, t) ?? ""))
|
|
52
52
|
};
|
|
53
53
|
} else c[t] = r === void 0 ? null : r;
|
|
54
54
|
let l = {};
|
|
55
55
|
return Object.keys(s).length && (l.text = s), Object.keys(c).length && (l.set = c), n?.hidden && (l.hidden = !0), l;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function ke(e, t, n) {
|
|
58
58
|
let r = !1;
|
|
59
59
|
function i(e, t, n, a) {
|
|
60
|
-
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) =>
|
|
61
|
-
if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) =>
|
|
60
|
+
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => G(e) && typeof e.id == "string");
|
|
61
|
+
if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => H(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
|
|
62
62
|
let r = e[n].find((e) => e.id === t.id);
|
|
63
63
|
r && i(r, t, a);
|
|
64
64
|
}
|
|
@@ -66,48 +66,48 @@ function Oe(e, t, n) {
|
|
|
66
66
|
let a = e, o = t;
|
|
67
67
|
if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
|
|
68
68
|
let i = (e) => e.map((e) => e.map((e) => e.id));
|
|
69
|
-
(e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) =>
|
|
69
|
+
(e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => H(n(e.id) ?? e))));
|
|
70
70
|
}
|
|
71
71
|
return r;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function J(e, t, n) {
|
|
74
74
|
let r = (e) => {
|
|
75
75
|
let { locale: t, locales: n, l10n: r, ...i } = e;
|
|
76
76
|
return i;
|
|
77
77
|
}, i = /* @__PURE__ */ new Map();
|
|
78
|
-
|
|
78
|
+
K(r(e), r(t), "", i);
|
|
79
79
|
let a = {};
|
|
80
|
-
for (let [t, r] of i) if (
|
|
80
|
+
for (let [t, r] of i) if (M.includes(t) && typeof r == "string" && N(e, t) !== void 0) {
|
|
81
81
|
let i = n?.text?.[t];
|
|
82
82
|
(a.text ??= {})[t] = i?.value === r ? i : {
|
|
83
83
|
value: r,
|
|
84
|
-
sourceHash:
|
|
84
|
+
sourceHash: B(String(N(e, t) ?? ""))
|
|
85
85
|
};
|
|
86
86
|
} else (a.set ??= {})[t] = r === void 0 ? null : r;
|
|
87
87
|
return a;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
let o =
|
|
89
|
+
function Y(e, t, n, r, i, a = []) {
|
|
90
|
+
let o = H(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
|
|
91
91
|
...Object.keys(t.text ?? {}),
|
|
92
92
|
...Object.keys(t.set ?? {}),
|
|
93
93
|
...Object.keys(n.text ?? {}),
|
|
94
94
|
...Object.keys(n.set ?? {})
|
|
95
|
-
])].filter((e) => !
|
|
95
|
+
])].filter((e) => !T(t.text?.[e], n.text?.[e]) || !T(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
|
|
96
96
|
for (let e of c) {
|
|
97
|
-
let t =
|
|
98
|
-
if (
|
|
99
|
-
else if (n.length &&
|
|
97
|
+
let t = N(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && T(N(r, t), N(i, t)));
|
|
98
|
+
if (T(t, N(r, e))) delete o.set[e];
|
|
99
|
+
else if (n.length && G(N(r, e)) && G(t)) {
|
|
100
100
|
delete o.set[e];
|
|
101
101
|
let i = (e, t, a) => {
|
|
102
102
|
if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
|
|
103
|
-
if (
|
|
104
|
-
else if (
|
|
105
|
-
else
|
|
103
|
+
if (G(t) && G(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
|
|
104
|
+
else if (G(r) && r.type !== "custom" && Ee(t) && Ee(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
|
|
105
|
+
else G(r) && typeof r.type == "string" && ie(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : H(a));
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
i(e,
|
|
109
|
-
} else o.set[e] = t === void 0 ? null :
|
|
110
|
-
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (
|
|
108
|
+
i(e, N(r, e), t);
|
|
109
|
+
} else o.set[e] = t === void 0 ? null : H(t);
|
|
110
|
+
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (T(t === "text" ? o.text[n].value : o.set[n] ?? void 0, N(i, n)) || delete o[t][n]);
|
|
111
111
|
}
|
|
112
112
|
for (let e of s) if (!c.includes(e)) {
|
|
113
113
|
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) (n === e || n.startsWith(`${e}.`)) && delete o[t][n];
|
|
@@ -116,7 +116,7 @@ function Ae(e, t, n, r, i, a = []) {
|
|
|
116
116
|
return o.text && !Object.keys(o.text).length && delete o.text, o.set && !Object.keys(o.set).length && delete o.set, o;
|
|
117
117
|
}
|
|
118
118
|
// ../core/src/mutation-guard.ts
|
|
119
|
-
function
|
|
119
|
+
function Ae(e) {
|
|
120
120
|
return [
|
|
121
121
|
"addBlock",
|
|
122
122
|
"removeBlock",
|
|
@@ -124,7 +124,7 @@ function je(e) {
|
|
|
124
124
|
"duplicateBlock"
|
|
125
125
|
].includes(e);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function je(e, t, n) {
|
|
128
128
|
if (e.canEdit && !e.canEdit()) return !1;
|
|
129
129
|
let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
|
|
130
130
|
if (!r && e.findBlock && !o) return !1;
|
|
@@ -135,7 +135,7 @@ function Me(e, t, n) {
|
|
|
135
135
|
...e.content(),
|
|
136
136
|
blocks: [o]
|
|
137
137
|
};
|
|
138
|
-
|
|
138
|
+
W(t), E(t);
|
|
139
139
|
}
|
|
140
140
|
if (t === "removeBlock") return !0;
|
|
141
141
|
let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
|
|
@@ -143,24 +143,24 @@ function Me(e, t, n) {
|
|
|
143
143
|
if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
|
|
144
144
|
if (e.findBlock) {
|
|
145
145
|
let t = e.findBlock(l);
|
|
146
|
-
if (t?.type !== "section" || u < 0 || u >=
|
|
146
|
+
if (t?.type !== "section" || u < 0 || u >= k(t.columns)) return !1;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
function
|
|
153
|
-
|
|
154
|
-
for (let n of Object.values(e)) typeof n == "function" &&
|
|
151
|
+
var X = /* @__PURE__ */ new WeakMap();
|
|
152
|
+
function Me(e, t) {
|
|
153
|
+
X.set(e, t);
|
|
154
|
+
for (let n of Object.values(e)) typeof n == "function" && X.set(n, t);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
let n =
|
|
158
|
-
n &&
|
|
156
|
+
function Ne(e, t) {
|
|
157
|
+
let n = X.get(e);
|
|
158
|
+
n && X.set(t, n);
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
let r = Reflect.get(e, t), i =
|
|
160
|
+
function Z(e, t, n) {
|
|
161
|
+
let r = Reflect.get(e, t), i = X.get(e) ?? (typeof r == "function" ? X.get(r) : void 0);
|
|
162
162
|
if (i) return i(t, n);
|
|
163
|
-
if (!
|
|
163
|
+
if (!Ae(t)) return !0;
|
|
164
164
|
let a = Reflect.get(e, "isBlockLocked");
|
|
165
165
|
if (typeof a != "function") return !0;
|
|
166
166
|
let o = { isBlockLocked: (t, n) => a.call(e, t, n) }, c = Reflect.get(e, "content");
|
|
@@ -173,23 +173,23 @@ function X(e, t, n) {
|
|
|
173
173
|
let n = Reflect.get(e, t);
|
|
174
174
|
typeof n == "function" && (o[t] = n.bind(e));
|
|
175
175
|
}
|
|
176
|
-
return
|
|
176
|
+
return je(o, t, n);
|
|
177
177
|
}
|
|
178
178
|
// ../core/src/error-reporting.ts
|
|
179
|
-
function
|
|
179
|
+
function Pe(e) {
|
|
180
180
|
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Q(e, t) {
|
|
183
183
|
try {
|
|
184
184
|
t();
|
|
185
185
|
} catch (t) {
|
|
186
|
-
e?.(
|
|
186
|
+
e?.(Pe(t));
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
// ../core/src/editor.ts
|
|
190
|
-
function
|
|
191
|
-
let n = t.content ??
|
|
192
|
-
|
|
190
|
+
function Fe(t) {
|
|
191
|
+
let n = t.content ?? se(t.defaultFontFamily, t.templateDefaults);
|
|
192
|
+
W(n), E(n);
|
|
193
193
|
let r = e({
|
|
194
194
|
template: null,
|
|
195
195
|
content: n,
|
|
@@ -204,11 +204,11 @@ function Ie(t) {
|
|
|
204
204
|
uiTheme: "auto"
|
|
205
205
|
}), i = u(r, "activeLocale"), a = [];
|
|
206
206
|
function o(e) {
|
|
207
|
-
let t =
|
|
208
|
-
if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new
|
|
207
|
+
let t = z(r.content);
|
|
208
|
+
if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new R(`This template has no "${e}" version.`, void 0, "unknown_locale");
|
|
209
209
|
i.value = e;
|
|
210
210
|
}
|
|
211
|
-
h(() => i.value ??
|
|
211
|
+
h(() => i.value ?? z(r.content), (e) => Q(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
|
|
212
212
|
i.value && !r.content.settings.locales?.includes(i.value) && o(null);
|
|
213
213
|
});
|
|
214
214
|
function s() {
|
|
@@ -218,20 +218,20 @@ function Ie(t) {
|
|
|
218
218
|
a = e;
|
|
219
219
|
}
|
|
220
220
|
function l(e) {
|
|
221
|
-
return
|
|
221
|
+
return L(r.content, e, a);
|
|
222
222
|
}
|
|
223
223
|
function d(e, n) {
|
|
224
224
|
if (!s()) return null;
|
|
225
|
-
if (e === "addLocale" && (!
|
|
226
|
-
let i =
|
|
225
|
+
if (e === "addLocale" && (!he(n) || t.localization && !t.localization.locales.includes(n))) throw new R(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
|
|
226
|
+
let i = H(r.content);
|
|
227
227
|
return te(i, [{
|
|
228
228
|
op: e,
|
|
229
229
|
locale: n
|
|
230
|
-
}]),
|
|
230
|
+
}]), T(i, r.content) ? null : i;
|
|
231
231
|
}
|
|
232
232
|
function f(e, t) {
|
|
233
233
|
let n = d(e, t);
|
|
234
|
-
n && (r.content = n,
|
|
234
|
+
n && (r.content = n, j());
|
|
235
235
|
}
|
|
236
236
|
function p(e) {
|
|
237
237
|
f("addLocale", e);
|
|
@@ -248,24 +248,24 @@ function Ie(t) {
|
|
|
248
248
|
}
|
|
249
249
|
function v(e, t) {
|
|
250
250
|
let [n, o] = t;
|
|
251
|
-
if (!i.value || !s() ||
|
|
252
|
-
let c =
|
|
251
|
+
if (!i.value || !s() || I(n)) return null;
|
|
252
|
+
let c = F(r.content.blocks, n);
|
|
253
253
|
if (!c) return null;
|
|
254
|
-
let l = c.l10n?.[i.value], u =
|
|
254
|
+
let l = c.l10n?.[i.value], u = A(c, i.value, z(r.content)), d = q(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Oe(c, u, o) : void 0, p = e === "resetLocaleFields" ? Y(l, d, q(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : H(l ?? {});
|
|
255
255
|
if (e === "setBlockHidden") o ? p.hidden = !0 : delete p.hidden;
|
|
256
256
|
else if (e === "resetLocaleFields") o || (delete p.text, delete p.set, delete p.hidden);
|
|
257
257
|
else for (let e of o) {
|
|
258
258
|
let t = p.text?.[e];
|
|
259
|
-
t && (t.sourceHash =
|
|
259
|
+
t && (t.sourceHash = B(String(N(c, e) ?? "")));
|
|
260
260
|
}
|
|
261
|
-
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set,
|
|
261
|
+
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, T(l ?? {}, p) ? null : {
|
|
262
262
|
block: c,
|
|
263
263
|
layer: p
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
266
|
function y(e, t) {
|
|
267
267
|
let n = v(e, t);
|
|
268
|
-
n && (_(n.block, n.layer),
|
|
268
|
+
n && (_(n.block, n.layer), j());
|
|
269
269
|
}
|
|
270
270
|
function x(e, t) {
|
|
271
271
|
y("setBlockHidden", [e, t]);
|
|
@@ -277,34 +277,34 @@ function Ie(t) {
|
|
|
277
277
|
y("keepTranslations", [e, t]);
|
|
278
278
|
}
|
|
279
279
|
let D = S(0), O = 0, k = 0;
|
|
280
|
-
function
|
|
280
|
+
function j() {
|
|
281
281
|
r.isDirty = !0, k++;
|
|
282
282
|
}
|
|
283
|
-
let
|
|
283
|
+
let M = b({
|
|
284
284
|
get: () => r.content,
|
|
285
285
|
set: (e) => {
|
|
286
|
-
r.content = e,
|
|
286
|
+
r.content = e, j();
|
|
287
287
|
}
|
|
288
|
-
}),
|
|
289
|
-
function
|
|
288
|
+
}), P = b(() => r.selectedBlockId ? F(r.content.blocks, r.selectedBlockId) : null);
|
|
289
|
+
function F(e, t) {
|
|
290
290
|
for (let n of e) {
|
|
291
291
|
if (n.id === t) return n;
|
|
292
292
|
if (n.type === "section") for (let e of n.children) {
|
|
293
|
-
let n =
|
|
293
|
+
let n = F(e, t);
|
|
294
294
|
if (n) return n;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
return null;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n)
|
|
299
|
+
function ne(e, t) {
|
|
300
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) ne(e, t);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function re(e, t, n = { blocks: e }) {
|
|
303
303
|
for (let r = 0; r < e.length; r++) {
|
|
304
304
|
let i = e[r];
|
|
305
305
|
if (i.id === t) return n;
|
|
306
306
|
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
307
|
-
let n =
|
|
307
|
+
let n = re(i.children[e], t, {
|
|
308
308
|
blocks: i.children[e],
|
|
309
309
|
sectionId: i.id,
|
|
310
310
|
columnIndex: e
|
|
@@ -314,7 +314,7 @@ function Ie(t) {
|
|
|
314
314
|
}
|
|
315
315
|
return null;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function I(e, n = !1) {
|
|
318
318
|
let r = i.value ?? t.lockLocale?.value ?? null;
|
|
319
319
|
for (let [i, a] of t.lockedBlocks?.value ?? []) {
|
|
320
320
|
let o = a;
|
|
@@ -324,8 +324,8 @@ function Ie(t) {
|
|
|
324
324
|
}
|
|
325
325
|
return !1;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
let t =
|
|
327
|
+
function ie(e) {
|
|
328
|
+
let t = re(r.content.blocks, e);
|
|
329
329
|
if (!t) return null;
|
|
330
330
|
let n = t.blocks.findIndex((t) => t.id === e);
|
|
331
331
|
return n === -1 ? null : {
|
|
@@ -334,161 +334,161 @@ function Ie(t) {
|
|
|
334
334
|
index: n
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
337
|
+
function oe(e, t = !0) {
|
|
338
|
+
W(e), E(e), r.content = e, t && j();
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
e &&
|
|
340
|
+
function V(e) {
|
|
341
|
+
e && I(e) || (r.selectedBlockId = e);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function U(e) {
|
|
344
344
|
r.viewport = e;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function ce(e) {
|
|
347
347
|
r.darkMode = e;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function ue(e) {
|
|
350
350
|
r.uiTheme = e;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function de(e) {
|
|
353
353
|
r.previewMode = e, e && (r.selectedBlockId = null);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function fe(e, t) {
|
|
356
356
|
if (!s()) return !1;
|
|
357
|
-
let n =
|
|
357
|
+
let n = F(r.content.blocks, e);
|
|
358
358
|
if (!n) return !1;
|
|
359
|
-
if ("l10n" in t) throw new
|
|
359
|
+
if ("l10n" in t) throw new R("l10n is immutable in updateBlock.", void 0, "invalid_operation");
|
|
360
360
|
let i = {
|
|
361
361
|
...n,
|
|
362
362
|
...t
|
|
363
363
|
};
|
|
364
|
-
return !
|
|
364
|
+
return !I(e, ke(H(n), i, (e) => F(r.content.blocks, e)));
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
if (!
|
|
368
|
-
let o =
|
|
366
|
+
function pe(e, n) {
|
|
367
|
+
if (!fe(e, n)) return;
|
|
368
|
+
let o = F(r.content.blocks, e);
|
|
369
369
|
if (!o) return;
|
|
370
370
|
let s = i.value;
|
|
371
371
|
if (s) {
|
|
372
|
-
let i =
|
|
372
|
+
let i = A(o, s, z(r.content)), c = {
|
|
373
373
|
...i,
|
|
374
374
|
...n
|
|
375
|
-
}, l =
|
|
376
|
-
if (
|
|
375
|
+
}, l = H(o), u = ke(l, c, (e) => F(r.content.blocks, e));
|
|
376
|
+
if (I(e, u)) return;
|
|
377
377
|
u && t.onStructureChange?.();
|
|
378
378
|
let d = ee(l);
|
|
379
|
-
delete o.l10n, Object.assign(o, d), _(o,
|
|
379
|
+
delete o.l10n, Object.assign(o, d), _(o, Y(o.l10n?.[s], q(o, i, o.l10n?.[s], a), q(o, c, o.l10n?.[s], a), o, c));
|
|
380
380
|
} else {
|
|
381
|
-
if (
|
|
381
|
+
if (I(e, "children" in n || "columns" in n)) return;
|
|
382
382
|
let t = ee({
|
|
383
383
|
...o,
|
|
384
384
|
...n
|
|
385
385
|
});
|
|
386
386
|
delete o.l10n, Object.assign(o, t);
|
|
387
387
|
}
|
|
388
|
-
|
|
388
|
+
j();
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
if ("locales" in e || "l10n" in e) throw new
|
|
392
|
-
if ("locale" in e && e.locale !==
|
|
390
|
+
function me(e) {
|
|
391
|
+
if ("locales" in e || "l10n" in e) throw new R("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
|
|
392
|
+
if ("locale" in e && e.locale !== z(r.content) && r.content.settings.locales?.length) throw new R("The default locale can't change while language versions exist.", void 0, "invalid_operation");
|
|
393
393
|
}
|
|
394
394
|
function ge(e) {
|
|
395
395
|
if (!s()) return;
|
|
396
|
-
|
|
396
|
+
me(e);
|
|
397
397
|
let t = i.value;
|
|
398
|
-
if (!t) r.content.settings =
|
|
398
|
+
if (!t) r.content.settings = le({
|
|
399
399
|
...r.content.settings,
|
|
400
400
|
...e
|
|
401
401
|
});
|
|
402
402
|
else {
|
|
403
|
-
let n = r.content.settings, i =
|
|
403
|
+
let n = r.content.settings, i = ae(r.content, t).settings, a = {
|
|
404
404
|
...i,
|
|
405
405
|
locale: n.locale,
|
|
406
406
|
...e
|
|
407
|
-
}, o = n.l10n?.[t], s =
|
|
407
|
+
}, o = n.l10n?.[t], s = Y(o, J(n, i, o), J(n, a, o), n, a);
|
|
408
408
|
Object.keys(s).length ? n.l10n = {
|
|
409
409
|
...n.l10n,
|
|
410
410
|
[t]: s
|
|
411
411
|
} : n.l10n && (delete n.l10n[t], Object.keys(n.l10n).length || delete n.l10n);
|
|
412
412
|
}
|
|
413
|
-
|
|
413
|
+
j();
|
|
414
414
|
}
|
|
415
|
-
let
|
|
415
|
+
let _e = {
|
|
416
416
|
canEdit: s,
|
|
417
417
|
content: () => r.content,
|
|
418
|
-
findBlock: (e) =>
|
|
419
|
-
findBlockLocation:
|
|
420
|
-
isBlockLocked:
|
|
418
|
+
findBlock: (e) => F(r.content.blocks, e),
|
|
419
|
+
findBlockLocation: ie,
|
|
420
|
+
isBlockLocked: I
|
|
421
421
|
};
|
|
422
|
-
function
|
|
423
|
-
if (
|
|
422
|
+
function ve(e, n, a = 0, o) {
|
|
423
|
+
if (je(_e, "addBlock", [
|
|
424
424
|
e,
|
|
425
425
|
n,
|
|
426
426
|
a,
|
|
427
427
|
o
|
|
428
428
|
])) {
|
|
429
429
|
if (n) {
|
|
430
|
-
let t =
|
|
430
|
+
let t = F(r.content.blocks, n);
|
|
431
431
|
if (t && t.type === "section") {
|
|
432
432
|
t.children[a] = t.children[a] || [];
|
|
433
433
|
let n = t.children[a];
|
|
434
434
|
o !== void 0 && o < n.length ? n.splice(o, 0, e) : n.push(e);
|
|
435
435
|
}
|
|
436
436
|
} else o !== void 0 && o < r.content.blocks.length ? r.content.blocks.splice(o, 0, e) : r.content.blocks.push(e);
|
|
437
|
-
i.value && t.onStructureChange?.(),
|
|
437
|
+
i.value && t.onStructureChange?.(), j();
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
if (!
|
|
442
|
-
let n =
|
|
440
|
+
function ye(e) {
|
|
441
|
+
if (!je(_e, "removeBlock", [e])) return;
|
|
442
|
+
let n = re(r.content.blocks, e);
|
|
443
443
|
if (n) {
|
|
444
444
|
let a = n.blocks.findIndex((t) => t.id === e);
|
|
445
445
|
if (a !== -1) {
|
|
446
446
|
let [e] = n.blocks.splice(a, 1);
|
|
447
447
|
if (r.selectedBlockId) {
|
|
448
448
|
let t = /* @__PURE__ */ new Set();
|
|
449
|
-
|
|
449
|
+
ne(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
|
|
450
450
|
}
|
|
451
|
-
i.value && t.onStructureChange?.(),
|
|
451
|
+
i.value && t.onStructureChange?.(), j();
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
if (!
|
|
455
|
+
function be(e, n, a, o = 0) {
|
|
456
|
+
if (!je(_e, "moveBlock", [
|
|
457
457
|
e,
|
|
458
458
|
n,
|
|
459
459
|
a,
|
|
460
460
|
o
|
|
461
461
|
])) return;
|
|
462
|
-
let s =
|
|
462
|
+
let s = re(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
|
|
463
463
|
if (a) {
|
|
464
|
-
let e =
|
|
464
|
+
let e = F(r.content.blocks, a);
|
|
465
465
|
e.children[o] = e.children[o] || [], l = e.children[o];
|
|
466
466
|
} else l = r.content.blocks;
|
|
467
467
|
let [u] = s.blocks.splice(c, 1);
|
|
468
|
-
l.splice(n, 0, u), i.value && t.onStructureChange?.(),
|
|
469
|
-
}
|
|
470
|
-
function be() {
|
|
471
|
-
A();
|
|
468
|
+
l.splice(n, 0, u), i.value && t.onStructureChange?.(), j();
|
|
472
469
|
}
|
|
473
|
-
function xe(
|
|
474
|
-
|
|
470
|
+
function xe() {
|
|
471
|
+
j();
|
|
475
472
|
}
|
|
476
|
-
function Se(e) {
|
|
477
|
-
|
|
473
|
+
function Se(e, t) {
|
|
474
|
+
throw new R(`[Templatical] Templates: ${e} ${t}`);
|
|
478
475
|
}
|
|
479
476
|
function Ce(e) {
|
|
477
|
+
Q(t.onError, e);
|
|
478
|
+
}
|
|
479
|
+
function we(e) {
|
|
480
480
|
let { templates: n } = t;
|
|
481
|
-
return n ||
|
|
481
|
+
return n || Se(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function Te(e) {
|
|
484
484
|
r.template && (r.template = {
|
|
485
485
|
...r.template,
|
|
486
486
|
name: e
|
|
487
|
-
},
|
|
487
|
+
}, j());
|
|
488
488
|
}
|
|
489
|
-
async function
|
|
490
|
-
let n =
|
|
491
|
-
typeof i != "function" &&
|
|
489
|
+
async function G(e) {
|
|
490
|
+
let n = we("create()"), { create: i } = n;
|
|
491
|
+
typeof i != "function" && Se("create()", "is disabled by the provider — its `create` is `false`.");
|
|
492
492
|
let a, o = ++O;
|
|
493
493
|
r.isLoading = !0;
|
|
494
494
|
try {
|
|
@@ -503,26 +503,26 @@ function Ie(t) {
|
|
|
503
503
|
} finally {
|
|
504
504
|
O === o && (r.isLoading = !1);
|
|
505
505
|
}
|
|
506
|
-
return
|
|
506
|
+
return Ce(() => n.onCreated?.(a)), a;
|
|
507
507
|
}
|
|
508
|
-
async function
|
|
509
|
-
let i =
|
|
508
|
+
async function Ee(e, n) {
|
|
509
|
+
let i = we("load()"), a, o = ++O;
|
|
510
510
|
r.isLoading = !0;
|
|
511
511
|
try {
|
|
512
|
-
if (a = await i.load(e),
|
|
512
|
+
if (a = await i.load(e), W(a.content), E(a.content), n && !n()) return a;
|
|
513
513
|
r.template = a, r.content = a.content, r.isDirty = !1, D.value++;
|
|
514
514
|
} catch (e) {
|
|
515
515
|
throw t.onError?.(e), e;
|
|
516
516
|
} finally {
|
|
517
517
|
O === o && (r.isLoading = !1);
|
|
518
518
|
}
|
|
519
|
-
return
|
|
519
|
+
return Ce(() => i.onLoaded?.(a)), a;
|
|
520
520
|
}
|
|
521
|
-
async function
|
|
522
|
-
let n =
|
|
523
|
-
typeof i != "function" &&
|
|
521
|
+
async function De(e = "api") {
|
|
522
|
+
let n = we("save()"), { save: i } = n;
|
|
523
|
+
typeof i != "function" && Se("save()", "is disabled by the provider — its `save` is `false`.");
|
|
524
524
|
let a = r.template;
|
|
525
|
-
a ||
|
|
525
|
+
a || Se("save()", "has no template loaded. Call create() or load() first.");
|
|
526
526
|
let o = a.name === void 0 ? { content: r.content } : {
|
|
527
527
|
name: a.name,
|
|
528
528
|
content: r.content
|
|
@@ -543,16 +543,16 @@ function Ie(t) {
|
|
|
543
543
|
} finally {
|
|
544
544
|
r.isSaving = !1;
|
|
545
545
|
}
|
|
546
|
-
return
|
|
546
|
+
return Ce(() => n.onSaved?.(s, { trigger: e })), s;
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function K() {
|
|
549
549
|
return r.template?.id !== void 0;
|
|
550
550
|
}
|
|
551
|
-
let
|
|
551
|
+
let X = {
|
|
552
552
|
state: m(r),
|
|
553
553
|
loadVersion: m(D),
|
|
554
|
-
content:
|
|
555
|
-
selectedBlock:
|
|
554
|
+
content: M,
|
|
555
|
+
selectedBlock: P,
|
|
556
556
|
activeLocale: i,
|
|
557
557
|
setActiveLocale: o,
|
|
558
558
|
addLocale: p,
|
|
@@ -562,34 +562,34 @@ function Ie(t) {
|
|
|
562
562
|
keepTranslations: w,
|
|
563
563
|
setCustomBlockDefinitions: c,
|
|
564
564
|
createSetDefaultLocaleOperation: l,
|
|
565
|
-
isBlockLocked:
|
|
566
|
-
setContent:
|
|
567
|
-
selectBlock:
|
|
568
|
-
setViewport:
|
|
569
|
-
setDarkMode:
|
|
570
|
-
setUiTheme:
|
|
571
|
-
setPreviewMode:
|
|
572
|
-
updateBlock:
|
|
565
|
+
isBlockLocked: I,
|
|
566
|
+
setContent: oe,
|
|
567
|
+
selectBlock: V,
|
|
568
|
+
setViewport: U,
|
|
569
|
+
setDarkMode: ce,
|
|
570
|
+
setUiTheme: ue,
|
|
571
|
+
setPreviewMode: de,
|
|
572
|
+
updateBlock: pe,
|
|
573
573
|
updateSettings: ge,
|
|
574
|
-
addBlock:
|
|
575
|
-
removeBlock:
|
|
576
|
-
moveBlock:
|
|
577
|
-
markDirty:
|
|
578
|
-
findBlockLocation:
|
|
579
|
-
setName:
|
|
580
|
-
create:
|
|
581
|
-
load:
|
|
582
|
-
save:
|
|
583
|
-
hasTemplate:
|
|
574
|
+
addBlock: ve,
|
|
575
|
+
removeBlock: ye,
|
|
576
|
+
moveBlock: be,
|
|
577
|
+
markDirty: xe,
|
|
578
|
+
findBlockLocation: ie,
|
|
579
|
+
setName: Te,
|
|
580
|
+
create: G,
|
|
581
|
+
load: Ee,
|
|
582
|
+
save: De,
|
|
583
|
+
hasTemplate: K
|
|
584
584
|
};
|
|
585
|
-
return
|
|
585
|
+
return Me(X, (e, t) => Ae(e) ? je(_e, e, t) : s() ? e === "updateBlock" ? fe(t[0], t[1]) : (e === "updateSettings" && me(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
|
|
586
586
|
}
|
|
587
587
|
// ../core/src/history.ts
|
|
588
|
-
var
|
|
589
|
-
function
|
|
590
|
-
let { content: t, setContent: n, maxSize: r =
|
|
588
|
+
var Ie = 50, Le = 300, Re = 1500;
|
|
589
|
+
function ze(e) {
|
|
590
|
+
let { content: t, setContent: n, maxSize: r = Ie } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
|
|
591
591
|
function d() {
|
|
592
|
-
return
|
|
592
|
+
return H(t.value);
|
|
593
593
|
}
|
|
594
594
|
function f(e) {
|
|
595
595
|
i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
|
|
@@ -603,17 +603,17 @@ function Be(e) {
|
|
|
603
603
|
function h(e) {
|
|
604
604
|
c && c.blockId === e ? (clearTimeout(c.timeoutId), c.timeoutId = setTimeout(() => {
|
|
605
605
|
c = null;
|
|
606
|
-
},
|
|
606
|
+
}, Le)) : (p(), f(d()), a.value = [], c = {
|
|
607
607
|
blockId: e,
|
|
608
608
|
timeoutId: setTimeout(() => {
|
|
609
609
|
c = null;
|
|
610
|
-
},
|
|
610
|
+
}, Le)
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
613
|
function g() {
|
|
614
614
|
o.value = !0, s && clearTimeout(s), s = setTimeout(() => {
|
|
615
615
|
o.value = !1, s = null;
|
|
616
|
-
},
|
|
616
|
+
}, Re);
|
|
617
617
|
}
|
|
618
618
|
function _() {
|
|
619
619
|
if (i.value.length === 0) return;
|
|
@@ -647,15 +647,15 @@ function Be(e) {
|
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
649
|
// ../core/src/block-actions.ts
|
|
650
|
-
function
|
|
650
|
+
function Be(e) {
|
|
651
651
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
652
652
|
function o(n, r, a) {
|
|
653
|
-
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s =
|
|
653
|
+
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = I(n, o);
|
|
654
654
|
return t(s, r, a), i(s.id), s;
|
|
655
655
|
}
|
|
656
656
|
function s(e, n, r) {
|
|
657
|
-
let o =
|
|
658
|
-
if (!
|
|
657
|
+
let o = F(e);
|
|
658
|
+
if (!Z(t, "duplicateBlock", [
|
|
659
659
|
e,
|
|
660
660
|
n,
|
|
661
661
|
r
|
|
@@ -681,9 +681,9 @@ function Ve(e) {
|
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
683
|
// ../core/src/auto-save.ts
|
|
684
|
-
var
|
|
685
|
-
function
|
|
686
|
-
let { content: t, isDirty: n, onChange: r, debounce: i =
|
|
684
|
+
var Ve = 2e3;
|
|
685
|
+
function He(e) {
|
|
686
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = Ve, enabled: a = !0 } = e, o = null, s = !1;
|
|
687
687
|
function c() {
|
|
688
688
|
return typeof a == "function" ? a() : a;
|
|
689
689
|
}
|
|
@@ -719,7 +719,7 @@ function Ue(e) {
|
|
|
719
719
|
};
|
|
720
720
|
}
|
|
721
721
|
// ../core/src/condition-preview.ts
|
|
722
|
-
function
|
|
722
|
+
function Ue(t) {
|
|
723
723
|
let n = e(/* @__PURE__ */ new Set()), r = b(() => n.size > 0);
|
|
724
724
|
function i(e) {
|
|
725
725
|
return n.has(e);
|
|
@@ -738,7 +738,7 @@ function We(t) {
|
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
740
|
// ../core/src/data-source-fetch.ts
|
|
741
|
-
function
|
|
741
|
+
function We(e) {
|
|
742
742
|
let t = S(!1), n = S(!1), r = b(() => !!e.definition.value?.dataSource), i = b(() => r.value && !e.block.value.dataSourceFetched);
|
|
743
743
|
async function a() {
|
|
744
744
|
let r = e.definition.value;
|
|
@@ -769,7 +769,7 @@ function Ge(e) {
|
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
771
|
// ../core/src/history-interceptor.ts
|
|
772
|
-
function
|
|
772
|
+
function Ge(e, t) {
|
|
773
773
|
e.activeLocale && h(e.activeLocale, () => t.flushDebounce?.());
|
|
774
774
|
for (let n of [
|
|
775
775
|
"addLocale",
|
|
@@ -780,49 +780,49 @@ function Ke(e, t) {
|
|
|
780
780
|
]) {
|
|
781
781
|
let r = e[n];
|
|
782
782
|
r && (Object.assign(e, { [n]: (...i) => {
|
|
783
|
-
|
|
784
|
-
} }),
|
|
783
|
+
Z(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
|
|
784
|
+
} }), Ne(r, e[n]));
|
|
785
785
|
}
|
|
786
786
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
787
787
|
e.addBlock = (r, i, a, o) => {
|
|
788
|
-
|
|
788
|
+
Z(e, "addBlock", [
|
|
789
789
|
r,
|
|
790
790
|
i,
|
|
791
791
|
a,
|
|
792
792
|
o
|
|
793
793
|
]) && (t.record(), n(r, i, a, o));
|
|
794
794
|
}, e.removeBlock = (n) => {
|
|
795
|
-
|
|
795
|
+
Z(e, "removeBlock", [n]) && (t.record(), r(n));
|
|
796
796
|
}, e.moveBlock = (n, r, a, o) => {
|
|
797
|
-
|
|
797
|
+
Z(e, "moveBlock", [
|
|
798
798
|
n,
|
|
799
799
|
r,
|
|
800
800
|
a,
|
|
801
801
|
o
|
|
802
802
|
]) && (t.record(), i(n, r, a, o));
|
|
803
|
-
},
|
|
804
|
-
|
|
803
|
+
}, Ne(n, e.addBlock), Ne(r, e.removeBlock), Ne(i, e.moveBlock), e.updateBlock = (n, r) => {
|
|
804
|
+
Z(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
|
|
805
805
|
}, e.updateSettings = (n) => {
|
|
806
|
-
|
|
807
|
-
},
|
|
806
|
+
Z(e, "updateSettings", [n]) && (t.record(), o(n));
|
|
807
|
+
}, Ne(a, e.updateBlock), Ne(o, e.updateSettings);
|
|
808
808
|
}
|
|
809
809
|
// ../core/src/diff-content.ts
|
|
810
|
-
var
|
|
810
|
+
var Ke = "root", qe = /* @__PURE__ */ new Set([
|
|
811
811
|
"id",
|
|
812
812
|
"type",
|
|
813
813
|
"children",
|
|
814
814
|
"l10n"
|
|
815
|
-
]),
|
|
815
|
+
]), Je = /* @__PURE__ */ new Set([
|
|
816
816
|
"id",
|
|
817
817
|
"type",
|
|
818
818
|
"children",
|
|
819
819
|
"columns",
|
|
820
820
|
"l10n"
|
|
821
|
-
]),
|
|
822
|
-
function
|
|
823
|
-
return e === null ?
|
|
821
|
+
]), Ye = /* @__PURE__ */ new Set(), Xe = /* @__PURE__ */ new Set(["locales", "l10n"]);
|
|
822
|
+
function Ze(e) {
|
|
823
|
+
return e === null ? Ke : JSON.stringify([e.sectionId, e.column]);
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function Qe(e) {
|
|
826
826
|
let t = e.children;
|
|
827
827
|
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
828
828
|
}
|
|
@@ -831,9 +831,9 @@ function $e(e) {
|
|
|
831
831
|
e.forEach((e, i) => {
|
|
832
832
|
t.has(e.id) || t.set(e.id, {
|
|
833
833
|
block: e,
|
|
834
|
-
key:
|
|
834
|
+
key: Ze(r),
|
|
835
835
|
index: i
|
|
836
|
-
}),
|
|
836
|
+
}), Qe(e).forEach((t, r) => {
|
|
837
837
|
Array.isArray(t) && n(t, {
|
|
838
838
|
sectionId: e.id,
|
|
839
839
|
column: r
|
|
@@ -859,7 +859,7 @@ function et(e) {
|
|
|
859
859
|
}
|
|
860
860
|
function tt(e, t, n) {
|
|
861
861
|
let r = {}, i = [];
|
|
862
|
-
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 ||
|
|
862
|
+
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || T(e[i], t[i]) || (r[i] = H(t[i]));
|
|
863
863
|
for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
|
|
864
864
|
return {
|
|
865
865
|
set: r,
|
|
@@ -867,7 +867,7 @@ function tt(e, t, n) {
|
|
|
867
867
|
};
|
|
868
868
|
}
|
|
869
869
|
function nt(e = {}, t = {}) {
|
|
870
|
-
let n = tt(e.text ?? {}, t.text ?? {},
|
|
870
|
+
let n = tt(e.text ?? {}, t.text ?? {}, Ye), r = tt(e.set ?? {}, t.set ?? {}, Ye), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
|
|
871
871
|
return {
|
|
872
872
|
...Object.keys(n.set).length > 0 ? { text: n.set } : {},
|
|
873
873
|
...Object.keys(r.set).length > 0 ? { set: r.set } : {},
|
|
@@ -878,12 +878,12 @@ function nt(e = {}, t = {}) {
|
|
|
878
878
|
function rt(e, t) {
|
|
879
879
|
if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
|
|
880
880
|
op: "setContent",
|
|
881
|
-
content:
|
|
881
|
+
content: H(t)
|
|
882
882
|
}];
|
|
883
883
|
let n = $e(e.blocks), r = $e(t.blocks), i = [], a = (e) => {
|
|
884
884
|
let t = r.get(e), i = n.get(e);
|
|
885
885
|
return t !== void 0 && i !== void 0 && t.block.type !== i.block.type;
|
|
886
|
-
}, o = (e) => r.has(e.id) && !a(e.id), s = (e) =>
|
|
886
|
+
}, o = (e) => r.has(e.id) && !a(e.id), s = (e) => Qe(e).some((e) => Array.isArray(e) && e.some((e) => o(e) || !a(e.id) && s(e))), c = /* @__PURE__ */ new Set(), l = [], u = (e, t) => {
|
|
887
887
|
let n = "kept";
|
|
888
888
|
t === "dropped" ? (c.add(e.id), n = "dropped") : a(e.id) ? (i.push({
|
|
889
889
|
op: "deleteBlock",
|
|
@@ -892,14 +892,14 @@ function rt(e, t) {
|
|
|
892
892
|
op: "deleteBlock",
|
|
893
893
|
blockId: e.id
|
|
894
894
|
}), c.add(e.id), n = "dropped"));
|
|
895
|
-
for (let t of
|
|
895
|
+
for (let t of Qe(e)) if (Array.isArray(t)) for (let e of t) u(e, n);
|
|
896
896
|
};
|
|
897
897
|
for (let t of e.blocks) u(t, "kept");
|
|
898
898
|
let d = (e) => n.has(e) && !c.has(e), f = (e) => {
|
|
899
|
-
let t =
|
|
900
|
-
return t.type === "section" && (t.children =
|
|
899
|
+
let t = H(e);
|
|
900
|
+
return t.type === "section" && (t.children = Qe(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => H(e)) : e)), t;
|
|
901
901
|
}, p = (e, t, r) => {
|
|
902
|
-
let a =
|
|
902
|
+
let a = Ze(e), o = [], s = [];
|
|
903
903
|
t.forEach((e, t) => {
|
|
904
904
|
let r = n.get(e.id);
|
|
905
905
|
d(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
|
|
@@ -925,7 +925,7 @@ function rt(e, t) {
|
|
|
925
925
|
let m = t.blocks.filter((e) => e.type === "section"), h = /* @__PURE__ */ new Set(), g = (e) => {
|
|
926
926
|
for (let t of m) {
|
|
927
927
|
if (!d(t.id)) continue;
|
|
928
|
-
let r =
|
|
928
|
+
let r = Qe(n.get(t.id).block).length, a = Qe(t).length;
|
|
929
929
|
(e ? a > r : a < r) && (i.push({
|
|
930
930
|
op: "updateBlock",
|
|
931
931
|
blockId: t.id,
|
|
@@ -936,7 +936,7 @@ function rt(e, t) {
|
|
|
936
936
|
g(!0);
|
|
937
937
|
for (let e of m) {
|
|
938
938
|
let t = !d(e.id);
|
|
939
|
-
|
|
939
|
+
Qe(e).forEach((n, r) => {
|
|
940
940
|
Array.isArray(n) && p({
|
|
941
941
|
sectionId: e.id,
|
|
942
942
|
column: r
|
|
@@ -950,7 +950,7 @@ function rt(e, t) {
|
|
|
950
950
|
});
|
|
951
951
|
for (let [e, t] of r) {
|
|
952
952
|
if (!d(e)) continue;
|
|
953
|
-
let { set: r, unset: a } = tt(n.get(e).block, t.block, h.has(e) ?
|
|
953
|
+
let { set: r, unset: a } = tt(n.get(e).block, t.block, h.has(e) ? Je : qe);
|
|
954
954
|
(Object.keys(r).length !== 0 || a.length !== 0) && i.push({
|
|
955
955
|
op: "updateBlock",
|
|
956
956
|
blockId: e,
|
|
@@ -958,7 +958,7 @@ function rt(e, t) {
|
|
|
958
958
|
...a.length > 0 ? { unset: a } : {}
|
|
959
959
|
});
|
|
960
960
|
}
|
|
961
|
-
let _ = tt(e.settings, t.settings,
|
|
961
|
+
let _ = tt(e.settings, t.settings, Xe);
|
|
962
962
|
(Object.keys(_.set).length > 0 || _.unset.length > 0) && i.push({
|
|
963
963
|
op: "updateSettings",
|
|
964
964
|
...Object.keys(_.set).length > 0 ? { set: _.set } : {},
|
|
@@ -1037,41 +1037,41 @@ function st(e, t, n) {
|
|
|
1037
1037
|
Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
|
|
1038
1038
|
}
|
|
1039
1039
|
function ct(e) {
|
|
1040
|
-
let t =
|
|
1040
|
+
let t = H(e);
|
|
1041
1041
|
return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(ct))), t;
|
|
1042
1042
|
}
|
|
1043
1043
|
function lt(e, t, n, r) {
|
|
1044
|
-
let i =
|
|
1044
|
+
let i = ae(e, t), a = H(e), o = H(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
|
|
1045
1045
|
for (let [i, a] of $(n)) c.set(i, {
|
|
1046
|
-
initial:
|
|
1046
|
+
initial: A(a, t, z(e)),
|
|
1047
1047
|
added: r,
|
|
1048
1048
|
changed: !1
|
|
1049
1049
|
});
|
|
1050
1050
|
};
|
|
1051
1051
|
l(i.blocks, !1);
|
|
1052
1052
|
let u = [], d = (e, t, n) => {
|
|
1053
|
-
if (t.some((e) => e?.op === "setDefaultLocale")) throw new
|
|
1054
|
-
if (t.some((e) => e?.op === "setContent")) throw new
|
|
1053
|
+
if (t.some((e) => e?.op === "setDefaultLocale")) throw new U("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
|
|
1054
|
+
if (t.some((e) => e?.op === "setContent")) throw new U("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
|
|
1055
1055
|
try {
|
|
1056
|
-
return
|
|
1056
|
+
return P(e, t);
|
|
1057
1057
|
} catch (e) {
|
|
1058
|
-
throw e instanceof
|
|
1058
|
+
throw e instanceof U ? new U(e.code, n, e.message, e.blockId) : e;
|
|
1059
1059
|
}
|
|
1060
1060
|
}, f = (e, t) => {
|
|
1061
1061
|
a = d(a, e, t), u.push(...e);
|
|
1062
1062
|
}, p = (e, n) => {
|
|
1063
1063
|
let o = c.get(e);
|
|
1064
1064
|
if (!o?.changed) return;
|
|
1065
|
-
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u =
|
|
1065
|
+
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = H(a), d = it(u, at(u, e).parent), p = H(s);
|
|
1066
1066
|
if (o.added) p = ct(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
|
|
1067
1067
|
else {
|
|
1068
|
-
|
|
1068
|
+
ke(p, p.type === "section" ? {
|
|
1069
1069
|
...l,
|
|
1070
1070
|
children: p.children,
|
|
1071
1071
|
columns: p.columns
|
|
1072
1072
|
} : l, (e) => $(a.blocks).get(e) ?? null), p = ee(p);
|
|
1073
1073
|
let e = p.l10n?.[t];
|
|
1074
|
-
st(p, t,
|
|
1074
|
+
st(p, t, Y(e, q(p, o.initial, e, r), q(p, l, e, r), p, l));
|
|
1075
1075
|
}
|
|
1076
1076
|
d[d.findIndex((t) => t.id === e)] = p, f(rt(a, u), n), o.changed = !1;
|
|
1077
1077
|
}, m = (e, t, n) => {
|
|
@@ -1092,7 +1092,7 @@ function lt(e, t, n, r) {
|
|
|
1092
1092
|
op: "updateBlock",
|
|
1093
1093
|
blockId: e.blockId,
|
|
1094
1094
|
set: { columns: i.columns },
|
|
1095
|
-
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e,
|
|
1095
|
+
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, N(u, e) ?? null])) } : {}
|
|
1096
1096
|
}], n);
|
|
1097
1097
|
};
|
|
1098
1098
|
n.forEach((e, t) => {
|
|
@@ -1137,8 +1137,8 @@ function lt(e, t, n, r) {
|
|
|
1137
1137
|
});
|
|
1138
1138
|
for (let e of c.keys()) p(e, n.length - 1);
|
|
1139
1139
|
if (s) {
|
|
1140
|
-
let e =
|
|
1141
|
-
st(e.settings, t,
|
|
1140
|
+
let e = H(a), r = e.settings.l10n?.[t];
|
|
1141
|
+
st(e.settings, t, Y(r, J(e.settings, o, r), J(e.settings, i.settings, r), e.settings, i.settings)), f(rt(a, e), n.length - 1);
|
|
1142
1142
|
}
|
|
1143
1143
|
return u;
|
|
1144
1144
|
}
|
|
@@ -1194,14 +1194,14 @@ function St(e) {
|
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
1196
1196
|
function Ct(e) {
|
|
1197
|
-
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? pt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, E = !1, O = null, k = 0, A = !1,
|
|
1198
|
-
function
|
|
1197
|
+
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? pt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, E = !1, O = null, k = 0, A = !1, j = [], M = null, N = null, ee = Promise.resolve(), F = null, ne = b(() => (v?.undo.length ?? 0) > 0), re = b(() => (v?.redo.length ?? 0) > 0);
|
|
1198
|
+
function I(t) {
|
|
1199
1199
|
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function L(t, n = v) {
|
|
1202
1202
|
n !== v || A || e.onNotice?.(t);
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function R() {
|
|
1205
1205
|
return {
|
|
1206
1206
|
locks: [...s.value.values()].map((e) => ({
|
|
1207
1207
|
blockId: e.blockId,
|
|
@@ -1211,13 +1211,13 @@ function Ct(e) {
|
|
|
1211
1211
|
session: n
|
|
1212
1212
|
};
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function z() {
|
|
1215
1215
|
g.value++;
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1217
|
+
function ie(e, t) {
|
|
1218
1218
|
e.push(t), e.length > r && e.splice(0, e.length - r);
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function B(e) {
|
|
1221
1221
|
if (!_ || y) return;
|
|
1222
1222
|
C = !0;
|
|
1223
1223
|
try {
|
|
@@ -1225,85 +1225,85 @@ function Ct(e) {
|
|
|
1225
1225
|
if (n.length > 0) try {
|
|
1226
1226
|
te(t, n);
|
|
1227
1227
|
} catch {
|
|
1228
|
-
_.setContent(
|
|
1228
|
+
_.setContent(H(e), !1);
|
|
1229
1229
|
}
|
|
1230
|
-
|
|
1230
|
+
T(_.content.value, e) || _.setContent(H(e), !1);
|
|
1231
1231
|
} finally {
|
|
1232
1232
|
C = !1;
|
|
1233
1233
|
}
|
|
1234
1234
|
let t = _.state.selectedBlockId;
|
|
1235
1235
|
t && !bt(e.blocks, t) && _.selectBlock(null);
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function ae() {
|
|
1238
1238
|
C || E || (E = !0, queueMicrotask(() => {
|
|
1239
|
-
E = !1,
|
|
1239
|
+
E = !1, V(!1);
|
|
1240
1240
|
}));
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function oe() {
|
|
1243
1243
|
O &&= (clearTimeout(O), null);
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function V(e, t = !1) {
|
|
1246
1246
|
let n = v;
|
|
1247
1247
|
if (!_ || !n || y || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
|
|
1248
1248
|
let r = rt(n.view, _.content.value);
|
|
1249
|
-
if (r.length === 0)
|
|
1249
|
+
if (r.length === 0) oe();
|
|
1250
1250
|
else {
|
|
1251
1251
|
if (!e && xt(r)) {
|
|
1252
1252
|
let e = Date.now();
|
|
1253
1253
|
if (O === null && (k = e), e - k < 1e3) {
|
|
1254
1254
|
O && clearTimeout(O), O = setTimeout(() => {
|
|
1255
|
-
O = null,
|
|
1255
|
+
O = null, V(!0);
|
|
1256
1256
|
}, 300);
|
|
1257
1257
|
return;
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
|
|
1260
|
+
oe(), se(n, r);
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
1263
|
-
function
|
|
1264
|
-
|
|
1263
|
+
function W() {
|
|
1264
|
+
V(!0);
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function se(e, t) {
|
|
1267
1267
|
let n = t, r;
|
|
1268
1268
|
try {
|
|
1269
|
-
r =
|
|
1269
|
+
r = P(e.view, n, R());
|
|
1270
1270
|
} catch (n) {
|
|
1271
|
-
if (!(n instanceof
|
|
1272
|
-
|
|
1273
|
-
let r = n.blockId === void 0 ? void 0 :
|
|
1271
|
+
if (!(n instanceof U)) throw n;
|
|
1272
|
+
B(e.view);
|
|
1273
|
+
let r = n.blockId === void 0 ? void 0 : Ae(n.blockId).find((e) => {
|
|
1274
1274
|
let r = t[n.opIndex];
|
|
1275
1275
|
return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
|
|
1276
1276
|
})?.holder;
|
|
1277
|
-
|
|
1277
|
+
L({
|
|
1278
1278
|
type: "editRefused",
|
|
1279
1279
|
code: n.code,
|
|
1280
1280
|
...r ? { holder: r } : {}
|
|
1281
|
-
}), n.code === "invalid_operation" &&
|
|
1281
|
+
}), n.code === "invalid_operation" && I(n);
|
|
1282
1282
|
return;
|
|
1283
1283
|
}
|
|
1284
1284
|
let i = _.content.value;
|
|
1285
|
-
if (!
|
|
1286
|
-
|
|
1285
|
+
if (!T(r, i)) {
|
|
1286
|
+
I(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
|
|
1287
1287
|
op: "setContent",
|
|
1288
|
-
content:
|
|
1288
|
+
content: H(i)
|
|
1289
1289
|
}];
|
|
1290
1290
|
try {
|
|
1291
|
-
r =
|
|
1291
|
+
r = P(e.view, n, R());
|
|
1292
1292
|
} catch (t) {
|
|
1293
|
-
if (!(t instanceof
|
|
1294
|
-
|
|
1293
|
+
if (!(t instanceof U)) throw t;
|
|
1294
|
+
B(e.view), L({
|
|
1295
1295
|
type: "editRefused",
|
|
1296
1296
|
code: t.code
|
|
1297
1297
|
});
|
|
1298
1298
|
return;
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
|
-
let a = gt({ ops:
|
|
1302
|
-
|
|
1301
|
+
let a = gt({ ops: D(e.view, n) }, r);
|
|
1302
|
+
ie(e.undo, a), e.redo = [], z();
|
|
1303
1303
|
let o = e.view;
|
|
1304
|
-
e.view = r,
|
|
1304
|
+
e.view = r, ce(e, n, "edit", a, o);
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function ce(e, t, n, r, i) {
|
|
1307
1307
|
let a = { dropped: !1 }, o = 0, s = i;
|
|
1308
1308
|
do {
|
|
1309
1309
|
let i = t.slice(o, o + mt);
|
|
@@ -1317,144 +1317,144 @@ function Ct(e) {
|
|
|
1317
1317
|
revision: null,
|
|
1318
1318
|
...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
|
|
1319
1319
|
}), o += mt, s && t.slice(o).some((e) => e.op === "setContent")) try {
|
|
1320
|
-
s =
|
|
1320
|
+
s = P(s, i);
|
|
1321
1321
|
} catch {
|
|
1322
1322
|
s = null;
|
|
1323
1323
|
}
|
|
1324
1324
|
} while (o < t.length);
|
|
1325
|
-
|
|
1325
|
+
le(e);
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function le(e) {
|
|
1328
1328
|
if (e.inFlight || w) return;
|
|
1329
1329
|
let t = e.pending.find((e) => !e.sent);
|
|
1330
|
-
t ? (t.sent = !0, e.inFlight = t,
|
|
1330
|
+
t ? (t.sent = !0, e.inFlight = t, ue(e, t, 0)) : ge(e);
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1332
|
+
function ue(e, n, r) {
|
|
1333
1333
|
t.submit(e.templateId, {
|
|
1334
1334
|
batchId: n.batchId,
|
|
1335
1335
|
baseRevision: n.baseRevision ??= e.revision,
|
|
1336
1336
|
ops: n.ops,
|
|
1337
1337
|
...n.origin === "ai" ? { origin: "ai" } : {}
|
|
1338
1338
|
}).then(({ revision: t }) => {
|
|
1339
|
-
e.inFlight = null,
|
|
1339
|
+
e.inFlight = null, de(e, n, t), le(e);
|
|
1340
1340
|
}, (t) => {
|
|
1341
|
-
if (_t(t) !== null) e.inFlight = null, he(e, n, t),
|
|
1341
|
+
if (_t(t) !== null) e.inFlight = null, he(e, n, t), le(e);
|
|
1342
1342
|
else if (yt(t)) {
|
|
1343
|
-
|
|
1343
|
+
_e(e, t);
|
|
1344
1344
|
let i = ft[Math.min(r, ft.length - 1)];
|
|
1345
1345
|
setTimeout(() => {
|
|
1346
|
-
A ||
|
|
1346
|
+
A || ue(e, n, r + 1);
|
|
1347
1347
|
}, i);
|
|
1348
|
-
} else e.inFlight = null,
|
|
1348
|
+
} else e.inFlight = null, I(t), he(e, n, t), le(e);
|
|
1349
1349
|
});
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1352
|
-
t.revision === null && (t.revision = n, n <= e.revision ? (
|
|
1351
|
+
function de(e, t, n) {
|
|
1352
|
+
t.revision === null && (t.revision = n, n <= e.revision ? (fe(e, t), xe(e)) : (e.own.set(n, t), be(e)));
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1354
|
+
function fe(e, t) {
|
|
1355
1355
|
e.pending = e.pending.filter((e) => e !== t), ge(e);
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function pe(e, t) {
|
|
1358
1358
|
if (t.entry) {
|
|
1359
1359
|
for (let n of [e.undo, e.redo]) {
|
|
1360
1360
|
let e = n.indexOf(t.entry);
|
|
1361
1361
|
e !== -1 && n.splice(e, 1);
|
|
1362
1362
|
}
|
|
1363
|
-
|
|
1363
|
+
z();
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
function me(e, t) {
|
|
1367
1367
|
let n = !t.group.dropped;
|
|
1368
|
-
return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n &&
|
|
1368
|
+
return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && pe(e, t), ge(e), n;
|
|
1369
1369
|
}
|
|
1370
1370
|
function he(e, t, n) {
|
|
1371
|
-
if (
|
|
1371
|
+
if (fe(e, t), me(e, t)) {
|
|
1372
1372
|
let r = _t(n) ?? "invalid_operation";
|
|
1373
1373
|
if (t.origin === "edit" || t.origin === "ai") {
|
|
1374
1374
|
let t = vt(n);
|
|
1375
|
-
|
|
1375
|
+
L({
|
|
1376
1376
|
type: "editRefused",
|
|
1377
1377
|
code: r,
|
|
1378
1378
|
...t ? { holder: t } : {}
|
|
1379
1379
|
}, e);
|
|
1380
|
-
} else
|
|
1380
|
+
} else L({
|
|
1381
1381
|
type: "undoSkipped",
|
|
1382
1382
|
code: r
|
|
1383
1383
|
}, e);
|
|
1384
1384
|
}
|
|
1385
|
-
|
|
1385
|
+
xe(e), e === v && Te();
|
|
1386
1386
|
}
|
|
1387
1387
|
function ge(e) {
|
|
1388
1388
|
if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function _e(e, t) {
|
|
1391
1391
|
let n = t instanceof Error ? t : Error(String(t));
|
|
1392
1392
|
for (let t of e.waiters.splice(0)) t.reject(n);
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function ve(e, t) {
|
|
1395
1395
|
if (t.revision <= e.revision) return;
|
|
1396
1396
|
let n = e.pending.find((e) => e.batchId === t.batchId);
|
|
1397
|
-
n ?
|
|
1397
|
+
n ? de(e, n, t.revision) : (e.remote.set(t.revision, t), be(e));
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function ye(t, n) {
|
|
1400
1400
|
let r = n.ops;
|
|
1401
1401
|
if (e.normalizeRemoteOperations) try {
|
|
1402
1402
|
r = e.normalizeRemoteOperations(n.ops, t.confirmed);
|
|
1403
1403
|
} catch (e) {
|
|
1404
|
-
|
|
1404
|
+
I(e);
|
|
1405
1405
|
}
|
|
1406
1406
|
return St(r);
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function be(t) {
|
|
1409
1409
|
let n = [], r = !1;
|
|
1410
1410
|
for (;;) {
|
|
1411
1411
|
let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
|
|
1412
1412
|
if (!i && !a) break;
|
|
1413
1413
|
try {
|
|
1414
|
-
t.confirmed =
|
|
1414
|
+
t.confirmed = P(t.confirmed, i ? ye(t, i) : a.ops);
|
|
1415
1415
|
} catch {
|
|
1416
1416
|
if (t.recovering) {
|
|
1417
|
-
t.remote.clear(), t.own.clear(),
|
|
1417
|
+
t.remote.clear(), t.own.clear(), I(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
|
|
1418
1418
|
return;
|
|
1419
1419
|
}
|
|
1420
|
-
|
|
1420
|
+
G(t);
|
|
1421
1421
|
return;
|
|
1422
1422
|
}
|
|
1423
|
-
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0),
|
|
1423
|
+
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), fe(t, a));
|
|
1424
1424
|
}
|
|
1425
|
-
if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ?
|
|
1425
|
+
if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? Ce(t) : we(t), (n.length !== 0 || r) && (xe(t), t === v)) for (let t of n) try {
|
|
1426
1426
|
e.onRemoteChange?.({
|
|
1427
1427
|
actor: t.actor,
|
|
1428
1428
|
ops: t.ops,
|
|
1429
1429
|
locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
|
|
1430
1430
|
});
|
|
1431
1431
|
} catch (e) {
|
|
1432
|
-
|
|
1432
|
+
I(e);
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function xe(e) {
|
|
1436
1436
|
let t = !w;
|
|
1437
1437
|
w = !0;
|
|
1438
1438
|
try {
|
|
1439
|
-
|
|
1439
|
+
Se(e);
|
|
1440
1440
|
} finally {
|
|
1441
1441
|
t && (w = !1);
|
|
1442
1442
|
}
|
|
1443
|
-
t &&
|
|
1443
|
+
t && le(e);
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1446
|
-
e === v &&
|
|
1445
|
+
function Se(e) {
|
|
1446
|
+
e === v && W();
|
|
1447
1447
|
let t = e.confirmed;
|
|
1448
1448
|
for (let n = 0; n < e.pending.length; n++) {
|
|
1449
1449
|
let r = e.pending[n], i;
|
|
1450
|
-
if (r.base && !
|
|
1450
|
+
if (r.base && !T(r.base, t)) i = "precondition_failed";
|
|
1451
1451
|
else try {
|
|
1452
|
-
t =
|
|
1452
|
+
t = P(t, r.ops);
|
|
1453
1453
|
continue;
|
|
1454
1454
|
} catch (e) {
|
|
1455
|
-
i = e instanceof
|
|
1455
|
+
i = e instanceof U ? e.code : "invalid_operation";
|
|
1456
1456
|
}
|
|
1457
|
-
r.sent || (me(e, r) &&
|
|
1457
|
+
r.sent || (me(e, r) && L(r.origin === "edit" || r.origin === "ai" ? {
|
|
1458
1458
|
type: "editRefused",
|
|
1459
1459
|
code: i
|
|
1460
1460
|
} : {
|
|
@@ -1462,54 +1462,54 @@ function Ct(e) {
|
|
|
1462
1462
|
code: i
|
|
1463
1463
|
}, e), t = e.confirmed, n = -1);
|
|
1464
1464
|
}
|
|
1465
|
-
e.view = t, ge(e), e === v &&
|
|
1465
|
+
e.view = t, ge(e), e === v && B(t);
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function Ce(e) {
|
|
1468
1468
|
e.gapTimer ||= setTimeout(() => {
|
|
1469
|
-
e.gapTimer = null, e === v &&
|
|
1469
|
+
e.gapTimer = null, e === v && Te();
|
|
1470
1470
|
}, ut);
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function we(e) {
|
|
1473
1473
|
e.gapTimer &&= (clearTimeout(e.gapTimer), null);
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function Te() {
|
|
1476
1476
|
let e = v;
|
|
1477
1477
|
return e ? (e.catchingUp ||= (async () => {
|
|
1478
1478
|
try {
|
|
1479
1479
|
let n = await t.operationsAfter(e.templateId, e.revision);
|
|
1480
1480
|
if (e.retired) return;
|
|
1481
1481
|
if ("resync" in n) {
|
|
1482
|
-
await
|
|
1482
|
+
await G(e);
|
|
1483
1483
|
return;
|
|
1484
1484
|
}
|
|
1485
|
-
for (let t of n.batches)
|
|
1485
|
+
for (let t of n.batches) ve(e, t);
|
|
1486
1486
|
} catch (e) {
|
|
1487
|
-
|
|
1487
|
+
I(e);
|
|
1488
1488
|
} finally {
|
|
1489
1489
|
e.catchingUp = null;
|
|
1490
1490
|
}
|
|
1491
1491
|
})(), e.catchingUp) : Promise.resolve();
|
|
1492
1492
|
}
|
|
1493
|
-
async function
|
|
1493
|
+
async function G(t) {
|
|
1494
1494
|
t.recovering = !0;
|
|
1495
1495
|
try {
|
|
1496
1496
|
let n = await e.loadTemplate(t.templateId);
|
|
1497
1497
|
if (t.retired) return;
|
|
1498
1498
|
let r = n.revision ?? t.revision;
|
|
1499
|
-
t.confirmed =
|
|
1500
|
-
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e),
|
|
1501
|
-
t === v && (m.value = r),
|
|
1499
|
+
t.confirmed = H(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
|
|
1500
|
+
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), fe(t, n));
|
|
1501
|
+
t === v && (m.value = r), xe(t), be(t);
|
|
1502
1502
|
} catch (e) {
|
|
1503
|
-
|
|
1503
|
+
I(e);
|
|
1504
1504
|
} finally {
|
|
1505
1505
|
t.recovering = !1;
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function Ee(t) {
|
|
1509
1509
|
let n = () => t === v && !t.retired;
|
|
1510
1510
|
return {
|
|
1511
1511
|
onBatch: (e) => {
|
|
1512
|
-
n() &&
|
|
1512
|
+
n() && ve(t, e);
|
|
1513
1513
|
},
|
|
1514
1514
|
onResync: (r, i) => {
|
|
1515
1515
|
if (!(!n() || r <= t.revision)) {
|
|
@@ -1519,38 +1519,38 @@ function Ct(e) {
|
|
|
1519
1519
|
actor: i
|
|
1520
1520
|
});
|
|
1521
1521
|
} catch (e) {
|
|
1522
|
-
|
|
1522
|
+
I(e);
|
|
1523
1523
|
}
|
|
1524
|
-
|
|
1524
|
+
Te();
|
|
1525
1525
|
}
|
|
1526
1526
|
},
|
|
1527
1527
|
onLock: (e) => {
|
|
1528
|
-
n() &&
|
|
1528
|
+
n() && X(e);
|
|
1529
1529
|
},
|
|
1530
1530
|
onUnlock: (e, t, r) => {
|
|
1531
|
-
n() &&
|
|
1531
|
+
n() && Me(e, t, r);
|
|
1532
1532
|
},
|
|
1533
1533
|
onMembers: (e) => {
|
|
1534
|
-
n() &&
|
|
1534
|
+
n() && Z(e);
|
|
1535
1535
|
},
|
|
1536
1536
|
onConnectionChange: (e) => {
|
|
1537
|
-
n() &&
|
|
1537
|
+
n() && q(t, e);
|
|
1538
1538
|
}
|
|
1539
1539
|
};
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1541
|
+
function De(e, r) {
|
|
1542
1542
|
let i = d;
|
|
1543
|
-
t.join(e.templateId, { sessionId: n },
|
|
1544
|
-
e.retired || e !== v ? r || t.leave() : (e.leave = t.leave,
|
|
1545
|
-
}, (e) =>
|
|
1543
|
+
t.join(e.templateId, { sessionId: n }, Ee(e)).then((t) => {
|
|
1544
|
+
e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && Te(), r && Q());
|
|
1545
|
+
}, (e) => I(e));
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1548
|
-
let t =
|
|
1547
|
+
function Oe(e) {
|
|
1548
|
+
let t = H(e.content), n = {
|
|
1549
1549
|
templateId: e.id,
|
|
1550
1550
|
confirmed: t,
|
|
1551
1551
|
revision: e.revision ?? 0,
|
|
1552
1552
|
pending: [],
|
|
1553
|
-
view:
|
|
1553
|
+
view: H(t),
|
|
1554
1554
|
remote: /* @__PURE__ */ new Map(),
|
|
1555
1555
|
own: /* @__PURE__ */ new Map(),
|
|
1556
1556
|
inFlight: null,
|
|
@@ -1563,136 +1563,136 @@ function Ct(e) {
|
|
|
1563
1563
|
redo: [],
|
|
1564
1564
|
waiters: []
|
|
1565
1565
|
};
|
|
1566
|
-
v = n, m.value = n.revision,
|
|
1566
|
+
v = n, m.value = n.revision, z(), De(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), ae();
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1569
|
-
e.retired = !0,
|
|
1568
|
+
function K(e) {
|
|
1569
|
+
e.retired = !0, we(e), e.leave?.(), e.leave = null, _e(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1571
|
+
function q(e, t) {
|
|
1572
1572
|
let n = p.value;
|
|
1573
|
-
p.value = t, t === "connected" && n !== null && n !== "connected" &&
|
|
1573
|
+
p.value = t, t === "connected" && n !== null && n !== "connected" && De(e, !0);
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
v && v.templateId === e?.id || (v &&= (
|
|
1575
|
+
function ke(e) {
|
|
1576
|
+
v && v.templateId === e?.id || (v &&= (oe(), K(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, M = null, Q(), z(), e && Oe(e));
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1578
|
+
function J(e, t) {
|
|
1579
1579
|
return `${e}\u0000${t ?? ""}`;
|
|
1580
1580
|
}
|
|
1581
|
-
function
|
|
1581
|
+
function Y(e, t, n) {
|
|
1582
1582
|
return e.blockId === t && (n == null || e.locale == null || e.locale === n);
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function Ae(e) {
|
|
1585
1585
|
return [...s.value.values()].filter((t) => t.blockId === e);
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1588
|
-
e !== f.value && (
|
|
1587
|
+
function je(e) {
|
|
1588
|
+
e !== f.value && (W(), f.value = e, ze(_?.state.selectedBlockId ?? null));
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function X(e, t = !1) {
|
|
1591
1591
|
if (e.holder.sessionId === n) return;
|
|
1592
1592
|
t ? l.add(e) : u.set(e, ++d);
|
|
1593
1593
|
let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
|
|
1594
|
-
r.set(
|
|
1594
|
+
r.set(J(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), L({
|
|
1595
1595
|
type: "selectionRefused",
|
|
1596
1596
|
blockId: e.blockId,
|
|
1597
1597
|
holder: e.holder
|
|
1598
1598
|
}));
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1601
|
-
let r =
|
|
1600
|
+
function Me(e, t, n) {
|
|
1601
|
+
let r = J(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && l.has(i))));
|
|
1602
1602
|
i.size !== s.value.size && (s.value = i);
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1604
|
+
function Ne(e, t, r) {
|
|
1605
1605
|
let i = new Map([...s.value].filter(([, e]) => !l.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
|
|
1606
|
-
for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId ||
|
|
1606
|
+
for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Y(e, t.blockId, t.locale))) {
|
|
1607
1607
|
for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
|
|
1608
|
-
i.set(
|
|
1608
|
+
i.set(J(t.blockId, t.locale), t);
|
|
1609
1609
|
}
|
|
1610
1610
|
s.value = i;
|
|
1611
1611
|
}
|
|
1612
|
-
function
|
|
1612
|
+
function Z(e) {
|
|
1613
1613
|
let t = new Set(e.map((e) => e.sessionId)), n = new Set(a.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
|
|
1614
1614
|
if (a.value = e, n.size === 0) return;
|
|
1615
1615
|
let r = new Map([...s.value].filter(([, e]) => !n.has(e.holder.sessionId)));
|
|
1616
1616
|
r.size !== s.value.size && (s.value = r);
|
|
1617
1617
|
}
|
|
1618
|
-
function
|
|
1619
|
-
|
|
1618
|
+
function Pe(e) {
|
|
1619
|
+
ee = ee.then(e).catch(I);
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1622
|
-
i &&
|
|
1623
|
-
if (
|
|
1624
|
-
let e =
|
|
1625
|
-
|
|
1621
|
+
function Q() {
|
|
1622
|
+
i && Pe(async () => {
|
|
1623
|
+
if (N && (M === null || N.templateId !== M.templateId || N.locale !== M.locale)) {
|
|
1624
|
+
let e = N;
|
|
1625
|
+
N = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
|
|
1626
1626
|
}
|
|
1627
|
-
let e =
|
|
1628
|
-
if (!(!e ||
|
|
1627
|
+
let e = M;
|
|
1628
|
+
if (!(!e || N?.templateId === e.templateId && N.blockId === e.blockId && N.locale === e.locale)) try {
|
|
1629
1629
|
let n = await t.acquireLock(e.templateId, e.blockId, e.locale);
|
|
1630
|
-
|
|
1630
|
+
N = e, Le(), Fe(n.blockId, n.locale ?? null);
|
|
1631
1631
|
} catch (n) {
|
|
1632
|
-
if (
|
|
1633
|
-
let e =
|
|
1634
|
-
|
|
1632
|
+
if (N?.templateId === e.templateId) {
|
|
1633
|
+
let e = N;
|
|
1634
|
+
N = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
|
|
1635
1635
|
}
|
|
1636
|
-
if (
|
|
1637
|
-
|
|
1636
|
+
if (M !== e) return;
|
|
1637
|
+
Ie(e.blockId, n);
|
|
1638
1638
|
}
|
|
1639
1639
|
});
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1642
|
-
let n = new Map([...s.value].filter(([, n]) => !
|
|
1641
|
+
function Fe(e, t) {
|
|
1642
|
+
let n = new Map([...s.value].filter(([, n]) => !Y(n, e, t)));
|
|
1643
1643
|
n.size !== s.value.size && (s.value = n);
|
|
1644
1644
|
}
|
|
1645
|
-
function
|
|
1645
|
+
function Ie(e, t) {
|
|
1646
1646
|
let n = _t(t);
|
|
1647
1647
|
if (n === "lock_held" || n === "block_missing") {
|
|
1648
|
-
|
|
1648
|
+
M = null;
|
|
1649
1649
|
let n = vt(t);
|
|
1650
|
-
n ?
|
|
1650
|
+
n ? X({
|
|
1651
1651
|
blockId: e,
|
|
1652
1652
|
holder: n,
|
|
1653
1653
|
expiresAt: ""
|
|
1654
1654
|
}, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
|
|
1655
|
-
} else
|
|
1656
|
-
|
|
1655
|
+
} else I(t), setTimeout(() => {
|
|
1656
|
+
M?.blockId === e && Q();
|
|
1657
1657
|
}, ft[0]);
|
|
1658
1658
|
}
|
|
1659
|
-
function
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
let e =
|
|
1659
|
+
function Le() {
|
|
1660
|
+
F ||= setInterval(() => {
|
|
1661
|
+
Pe(async () => {
|
|
1662
|
+
let e = N;
|
|
1663
1663
|
if (e) try {
|
|
1664
1664
|
await t.renewLock(e.templateId, e.blockId, e.locale);
|
|
1665
1665
|
} catch (e) {
|
|
1666
1666
|
if (_t(e) === "lock_lost") {
|
|
1667
|
-
|
|
1667
|
+
N = null, Re(), Q();
|
|
1668
1668
|
return;
|
|
1669
1669
|
}
|
|
1670
|
-
|
|
1670
|
+
I(e);
|
|
1671
1671
|
}
|
|
1672
1672
|
});
|
|
1673
1673
|
}, dt);
|
|
1674
1674
|
}
|
|
1675
|
-
function
|
|
1676
|
-
|
|
1675
|
+
function Re() {
|
|
1676
|
+
F &&= (clearInterval(F), null);
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1679
|
-
|
|
1678
|
+
function ze(e) {
|
|
1679
|
+
W(), v && (M = e ? {
|
|
1680
1680
|
templateId: v.templateId,
|
|
1681
1681
|
blockId: e,
|
|
1682
1682
|
locale: f.value
|
|
1683
|
-
} : null,
|
|
1683
|
+
} : null, Q());
|
|
1684
1684
|
}
|
|
1685
|
-
function
|
|
1686
|
-
|
|
1685
|
+
function Be() {
|
|
1686
|
+
W(), N && i && (t.releaseLock(N.templateId, N.blockId, N.locale).catch(() => {}), N = null, Re()), v?.leave?.(), v && (v.leave = null);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1688
|
+
function Ve(e) {
|
|
1689
1689
|
let t = v;
|
|
1690
1690
|
if (!t || y) return;
|
|
1691
|
-
|
|
1691
|
+
W();
|
|
1692
1692
|
let n = (e === "undo" ? t.undo : t.redo).pop();
|
|
1693
1693
|
if (!n) return;
|
|
1694
|
-
if (
|
|
1695
|
-
|
|
1694
|
+
if (z(), n.view && !T(n.view, t.view)) {
|
|
1695
|
+
L({
|
|
1696
1696
|
type: "undoSkipped",
|
|
1697
1697
|
code: "precondition_failed"
|
|
1698
1698
|
});
|
|
@@ -1700,41 +1700,41 @@ function Ct(e) {
|
|
|
1700
1700
|
}
|
|
1701
1701
|
let r;
|
|
1702
1702
|
try {
|
|
1703
|
-
r =
|
|
1703
|
+
r = P(t.view, n.ops, R());
|
|
1704
1704
|
} catch (e) {
|
|
1705
|
-
if (!(e instanceof
|
|
1706
|
-
|
|
1705
|
+
if (!(e instanceof U)) throw e;
|
|
1706
|
+
L({
|
|
1707
1707
|
type: "undoSkipped",
|
|
1708
1708
|
code: e.code
|
|
1709
1709
|
});
|
|
1710
1710
|
return;
|
|
1711
1711
|
}
|
|
1712
|
-
let i = gt({ ops:
|
|
1713
|
-
|
|
1712
|
+
let i = gt({ ops: D(t.view, n.ops) }, r);
|
|
1713
|
+
ie(e === "undo" ? t.redo : t.undo, i);
|
|
1714
1714
|
let a = t.view;
|
|
1715
|
-
t.view = r,
|
|
1715
|
+
t.view = r, B(r), _?.markDirty(), ce(t, n.ops, e, i, a);
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function He(e, t) {
|
|
1718
1718
|
let n = v;
|
|
1719
1719
|
if (!_ || !n || y) return {
|
|
1720
1720
|
applied: !1,
|
|
1721
|
-
error: new
|
|
1721
|
+
error: new U("invalid_operation", 0, "No template is open for editing.")
|
|
1722
1722
|
};
|
|
1723
1723
|
if (t.origin === void 0) try {
|
|
1724
|
-
|
|
1724
|
+
P(_.content.value, e, R());
|
|
1725
1725
|
} catch (e) {
|
|
1726
|
-
if (e instanceof
|
|
1726
|
+
if (e instanceof U) return {
|
|
1727
1727
|
applied: !1,
|
|
1728
1728
|
error: e
|
|
1729
1729
|
};
|
|
1730
1730
|
throw e;
|
|
1731
1731
|
}
|
|
1732
|
-
|
|
1732
|
+
W();
|
|
1733
1733
|
let r, i;
|
|
1734
1734
|
try {
|
|
1735
|
-
r =
|
|
1735
|
+
r = P(n.view, e, R()), i = D(n.view, e);
|
|
1736
1736
|
} catch (e) {
|
|
1737
|
-
if (e instanceof
|
|
1737
|
+
if (e instanceof U) return {
|
|
1738
1738
|
applied: !1,
|
|
1739
1739
|
error: e
|
|
1740
1740
|
};
|
|
@@ -1742,91 +1742,91 @@ function Ct(e) {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
let a = n.undo.at(-1), o;
|
|
1744
1744
|
if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
|
|
1745
|
-
let e = a.view !== void 0 && !
|
|
1745
|
+
let e = a.view !== void 0 && !T(a.view, n.view);
|
|
1746
1746
|
a.ops = [...i, ...a.ops], o = e ? a : gt(a, r);
|
|
1747
1747
|
} else o = gt({
|
|
1748
1748
|
ops: i,
|
|
1749
1749
|
...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
|
|
1750
|
-
}, r),
|
|
1751
|
-
n.redo = [],
|
|
1750
|
+
}, r), ie(n.undo, o);
|
|
1751
|
+
n.redo = [], z();
|
|
1752
1752
|
let s = n.view;
|
|
1753
|
-
return n.view = r,
|
|
1753
|
+
return n.view = r, B(r), _.markDirty(), ce(n, e, t.origin ?? "edit", o, s), {
|
|
1754
1754
|
applied: !0,
|
|
1755
1755
|
inverse: i
|
|
1756
1756
|
};
|
|
1757
1757
|
}
|
|
1758
|
-
function
|
|
1758
|
+
function Ue(e) {
|
|
1759
1759
|
_ = e;
|
|
1760
1760
|
let t = e;
|
|
1761
1761
|
if (t.moveBlock && t.findBlockLocation) {
|
|
1762
1762
|
let n = t.moveBlock, r = (...r) => {
|
|
1763
1763
|
let i = v, a = i && !y && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
|
|
1764
|
-
if (a &&
|
|
1764
|
+
if (a && V(!0), n(...r), !a || T(i.view, e.content.value)) return;
|
|
1765
1765
|
let o = t.findBlockLocation(r[0]);
|
|
1766
1766
|
if (!o) return;
|
|
1767
1767
|
let s = o.targetSectionId ? {
|
|
1768
1768
|
sectionId: o.targetSectionId,
|
|
1769
1769
|
column: o.columnIndex ?? 0
|
|
1770
1770
|
} : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0;
|
|
1771
|
-
|
|
1771
|
+
se(i, [{
|
|
1772
1772
|
op: "moveBlock",
|
|
1773
1773
|
blockId: r[0],
|
|
1774
1774
|
parent: s,
|
|
1775
1775
|
after: (s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks)[o.index - 1]?.id ?? null
|
|
1776
1776
|
}]);
|
|
1777
1777
|
};
|
|
1778
|
-
t.moveBlock = r,
|
|
1778
|
+
t.moveBlock = r, j.push(() => {
|
|
1779
1779
|
t.moveBlock === r && (t.moveBlock = n);
|
|
1780
1780
|
});
|
|
1781
1781
|
}
|
|
1782
|
-
|
|
1782
|
+
j.push(h(() => e.state.template, (e) => ke(e), { immediate: !0 }), h(() => e.content.value, ae, { deep: !0 }), h(() => e.state.selectedBlockId, ze), h(() => e.state.isLoading, (e) => e ? V(!0, !0) : ae())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", W)), c() && o(qe);
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1785
|
-
|
|
1784
|
+
function We() {
|
|
1785
|
+
W();
|
|
1786
1786
|
let e = v;
|
|
1787
1787
|
return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
|
|
1788
1788
|
resolve: t,
|
|
1789
1789
|
reject: n
|
|
1790
1790
|
}));
|
|
1791
1791
|
}
|
|
1792
|
+
function Ge() {
|
|
1793
|
+
W(), y = !0;
|
|
1794
|
+
}
|
|
1792
1795
|
function Ke() {
|
|
1793
|
-
|
|
1796
|
+
y = !1, v && B(v.view);
|
|
1794
1797
|
}
|
|
1795
1798
|
function qe() {
|
|
1796
|
-
y = !1, v && R(v.view);
|
|
1797
|
-
}
|
|
1798
|
-
function Je() {
|
|
1799
1799
|
if (!A) {
|
|
1800
|
-
|
|
1801
|
-
for (let e of
|
|
1802
|
-
|
|
1800
|
+
W();
|
|
1801
|
+
for (let e of j.splice(0)) e();
|
|
1802
|
+
oe(), Be(), A = !0, v && K(v), v = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", W));
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
return {
|
|
1806
1806
|
sessionId: n,
|
|
1807
1807
|
members: a,
|
|
1808
1808
|
locks: s,
|
|
1809
|
-
locksOf:
|
|
1809
|
+
locksOf: Ae,
|
|
1810
1810
|
lockLocale: f,
|
|
1811
|
-
setLockLocale:
|
|
1811
|
+
setLockLocale: je,
|
|
1812
1812
|
connection: p,
|
|
1813
1813
|
revision: m,
|
|
1814
|
-
canUndo:
|
|
1815
|
-
canRedo:
|
|
1816
|
-
attach:
|
|
1817
|
-
undo: () =>
|
|
1818
|
-
redo: () =>
|
|
1814
|
+
canUndo: ne,
|
|
1815
|
+
canRedo: re,
|
|
1816
|
+
attach: Ue,
|
|
1817
|
+
undo: () => Ve("undo"),
|
|
1818
|
+
redo: () => Ve("redo"),
|
|
1819
1819
|
clearHistory: () => {
|
|
1820
|
-
v && (v.undo = [], v.redo = [],
|
|
1820
|
+
v && (v.undo = [], v.redo = [], z());
|
|
1821
1821
|
},
|
|
1822
|
-
flush:
|
|
1823
|
-
settle:
|
|
1824
|
-
suspend:
|
|
1825
|
-
resume:
|
|
1826
|
-
catchUp:
|
|
1822
|
+
flush: W,
|
|
1823
|
+
settle: We,
|
|
1824
|
+
suspend: Ge,
|
|
1825
|
+
resume: Ke,
|
|
1826
|
+
catchUp: Te,
|
|
1827
1827
|
hasConfirmedBlock: (e) => v ? bt(v.confirmed.blocks, e) : !1,
|
|
1828
|
-
applyOperations:
|
|
1829
|
-
destroy:
|
|
1828
|
+
applyOperations: He,
|
|
1829
|
+
destroy: qe
|
|
1830
1830
|
};
|
|
1831
1831
|
}
|
|
1832
1832
|
// ../core/src/saved-blocks.ts
|
|
@@ -1846,10 +1846,10 @@ function wt(e) {
|
|
|
1846
1846
|
return s.value && e.canDelete !== !1;
|
|
1847
1847
|
}
|
|
1848
1848
|
function u(e, t) {
|
|
1849
|
-
throw new
|
|
1849
|
+
throw new R(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1850
1850
|
}
|
|
1851
1851
|
function d(t) {
|
|
1852
|
-
|
|
1852
|
+
Q(e.onError, t);
|
|
1853
1853
|
}
|
|
1854
1854
|
async function f(i) {
|
|
1855
1855
|
r.value = !0;
|
|
@@ -1944,7 +1944,7 @@ function Et(e = {}) {
|
|
|
1944
1944
|
},
|
|
1945
1945
|
async create(e) {
|
|
1946
1946
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1947
|
-
id:
|
|
1947
|
+
id: oe(),
|
|
1948
1948
|
name: e.name,
|
|
1949
1949
|
content: e.content,
|
|
1950
1950
|
...e.category ? { category: e.category } : {},
|
|
@@ -2011,7 +2011,7 @@ function kt(e = {}) {
|
|
|
2011
2011
|
},
|
|
2012
2012
|
async create(e) {
|
|
2013
2013
|
let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
2014
|
-
id:
|
|
2014
|
+
id: oe(),
|
|
2015
2015
|
url: t,
|
|
2016
2016
|
filename: e.filename || e.file.name,
|
|
2017
2017
|
createdAt: n,
|
|
@@ -2051,14 +2051,14 @@ function At(e) {
|
|
|
2051
2051
|
let { provider: t, getTemplateId: n } = e, r = S([]), i = S(!1), a = S(void 0), o = S(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
|
|
2052
2052
|
function u(e) {
|
|
2053
2053
|
let t = n();
|
|
2054
|
-
if (!t) throw new
|
|
2054
|
+
if (!t) throw new R(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
2055
2055
|
return t;
|
|
2056
2056
|
}
|
|
2057
2057
|
function d(e) {
|
|
2058
|
-
throw new
|
|
2058
|
+
throw new R(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2059
2059
|
}
|
|
2060
2060
|
function f(t) {
|
|
2061
|
-
|
|
2061
|
+
Q(e.onError, t);
|
|
2062
2062
|
}
|
|
2063
2063
|
async function p(n) {
|
|
2064
2064
|
let o = u("list");
|
|
@@ -2134,16 +2134,16 @@ function jt(e) {
|
|
|
2134
2134
|
});
|
|
2135
2135
|
function m(e) {
|
|
2136
2136
|
let t = n();
|
|
2137
|
-
if (!t) throw new
|
|
2137
|
+
if (!t) throw new R(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
2138
2138
|
return t;
|
|
2139
2139
|
}
|
|
2140
2140
|
function h(e) {
|
|
2141
2141
|
let t = r();
|
|
2142
|
-
if (!t) throw new
|
|
2142
|
+
if (!t) throw new R(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
2143
2143
|
return t;
|
|
2144
2144
|
}
|
|
2145
2145
|
function g(e) {
|
|
2146
|
-
throw new
|
|
2146
|
+
throw new R(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2147
2147
|
}
|
|
2148
2148
|
function _(e) {
|
|
2149
2149
|
for (let t of i.value) {
|
|
@@ -2157,11 +2157,11 @@ function jt(e) {
|
|
|
2157
2157
|
return t !== null && e.author.id === t.id;
|
|
2158
2158
|
}
|
|
2159
2159
|
function b(t) {
|
|
2160
|
-
let n =
|
|
2160
|
+
let n = Pe(t);
|
|
2161
2161
|
throw e.onError?.(n), n;
|
|
2162
2162
|
}
|
|
2163
2163
|
function x(t) {
|
|
2164
|
-
|
|
2164
|
+
Q(e.onError, t);
|
|
2165
2165
|
}
|
|
2166
2166
|
function C(e, t, n) {
|
|
2167
2167
|
return [
|
|
@@ -2254,7 +2254,7 @@ function jt(e) {
|
|
|
2254
2254
|
o.value = !1;
|
|
2255
2255
|
}
|
|
2256
2256
|
}
|
|
2257
|
-
async function
|
|
2257
|
+
async function j(e, n) {
|
|
2258
2258
|
let { setResolved: r } = t;
|
|
2259
2259
|
typeof r != "function" && g("setResolved");
|
|
2260
2260
|
let i = m("setResolved");
|
|
@@ -2268,13 +2268,13 @@ function jt(e) {
|
|
|
2268
2268
|
o.value = !1;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function M(e) {
|
|
2272
2272
|
T(e) && x(() => t.onCreated?.(e, { origin: "remote" }));
|
|
2273
2273
|
}
|
|
2274
|
-
function
|
|
2274
|
+
function N(e) {
|
|
2275
2275
|
T(e) && x(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function ee(e, n) {
|
|
2278
2278
|
let r = E(e, n);
|
|
2279
2279
|
r && x(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
2280
2280
|
}
|
|
@@ -2293,12 +2293,12 @@ function jt(e) {
|
|
|
2293
2293
|
create: O,
|
|
2294
2294
|
update: k,
|
|
2295
2295
|
remove: A,
|
|
2296
|
-
setResolved:
|
|
2296
|
+
setResolved: j,
|
|
2297
2297
|
find: _,
|
|
2298
2298
|
isOwn: y,
|
|
2299
|
-
applyRemoteCreate:
|
|
2300
|
-
applyRemoteUpdate:
|
|
2301
|
-
applyRemoteDelete:
|
|
2299
|
+
applyRemoteCreate: M,
|
|
2300
|
+
applyRemoteUpdate: N,
|
|
2301
|
+
applyRemoteDelete: ee
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
function Mt(e) {
|
|
@@ -2355,7 +2355,7 @@ function Pt(t) {
|
|
|
2355
2355
|
};
|
|
2356
2356
|
}
|
|
2357
2357
|
function Ft(e) {
|
|
2358
|
-
let t = a(
|
|
2358
|
+
let t = a(ye, null), n = v(e);
|
|
2359
2359
|
if (!t) return n;
|
|
2360
2360
|
let i;
|
|
2361
2361
|
function s() {
|
|
@@ -2382,14 +2382,14 @@ function It(e, t) {
|
|
|
2382
2382
|
return typeof n == "string" && n.length > 0 ? n : t;
|
|
2383
2383
|
}
|
|
2384
2384
|
function Lt(e, t) {
|
|
2385
|
-
return typeof e?.url == "string" &&
|
|
2385
|
+
return typeof e?.url == "string" && ue(e.url, t);
|
|
2386
2386
|
}
|
|
2387
2387
|
function Rt(e, t) {
|
|
2388
2388
|
let n = e?.url;
|
|
2389
|
-
if (typeof n == "string" && n.trim() !== "") return
|
|
2389
|
+
if (typeof n == "string" && n.trim() !== "") return ue(n, t) ? void 0 : n;
|
|
2390
2390
|
}
|
|
2391
2391
|
function zt(e) {
|
|
2392
|
-
let t = a(
|
|
2392
|
+
let t = a(ve, ce.liquid), n = Ft(() => Rt(e(), t));
|
|
2393
2393
|
return v(() => Lt(e(), t) ? null : n.value);
|
|
2394
2394
|
}
|
|
2395
2395
|
function Bt(e, t, n) {
|
|
@@ -2406,7 +2406,7 @@ function Ht(e, t, n = []) {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
// src/utils/resolveFieldColors.ts
|
|
2408
2408
|
function Ut(e, t) {
|
|
2409
|
-
let n =
|
|
2409
|
+
let n = we({ presets: e.presets }, Te), r = n.presets.length === 0;
|
|
2410
2410
|
return {
|
|
2411
2411
|
presets: r ? t.presets : n.presets,
|
|
2412
2412
|
allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
|
|
@@ -2466,7 +2466,7 @@ var Xt = /* @__PURE__ */ t({
|
|
|
2466
2466
|
size: { default: "field" }
|
|
2467
2467
|
},
|
|
2468
2468
|
setup(e) {
|
|
2469
|
-
let t = e, { t: r } =
|
|
2469
|
+
let t = e, { t: r } = Se(), i = {
|
|
2470
2470
|
field: {
|
|
2471
2471
|
gap: "tpl:gap-1.5",
|
|
2472
2472
|
icon: 18,
|
|
@@ -2485,7 +2485,7 @@ var Xt = /* @__PURE__ */ t({
|
|
|
2485
2485
|
class: "tpl-spinner",
|
|
2486
2486
|
size: a.value.icon,
|
|
2487
2487
|
"stroke-width": 2
|
|
2488
|
-
}, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(
|
|
2488
|
+
}, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(_e), {
|
|
2489
2489
|
size: a.value.icon,
|
|
2490
2490
|
"stroke-width": 1.5
|
|
2491
2491
|
}, null, 8, ["size"]), d(" " + g(f(r).image.dropToUpload), 1)], 64))], 6));
|
|
@@ -2501,7 +2501,7 @@ function Zt() {
|
|
|
2501
2501
|
// src/composables/useImageDrop.ts
|
|
2502
2502
|
var Qt = "image/";
|
|
2503
2503
|
function $t(e) {
|
|
2504
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } =
|
|
2504
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = Ce(t, {
|
|
2505
2505
|
preventDefaultForUnhandled: !0,
|
|
2506
2506
|
onDrop: (e) => {
|
|
2507
2507
|
if (!i()) return;
|
|
@@ -2513,7 +2513,7 @@ function $t(e) {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
// src/composables/useMediaDropField.ts
|
|
2515
2515
|
function en(e) {
|
|
2516
|
-
let { target: t, blocked: n, apply: r } = e, i = a(
|
|
2516
|
+
let { target: t, blocked: n, apply: r } = e, i = a(be, null), o = a(xe, null), s = Zt();
|
|
2517
2517
|
async function c() {
|
|
2518
2518
|
let e = await i?.({ accept: ["images"] });
|
|
2519
2519
|
s.alive && e && r(e);
|
|
@@ -2562,7 +2562,7 @@ var nn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", rn = {
|
|
|
2562
2562
|
"2-1": [66.67, 33.33]
|
|
2563
2563
|
};
|
|
2564
2564
|
function an(e, t) {
|
|
2565
|
-
let n = (e) => Math.trunc(e ?? 0), r = (e) =>
|
|
2565
|
+
let n = (e) => Math.trunc(e ?? 0), r = (e) => pe(e) === null ? 0 : Math.trunc(e.width);
|
|
2566
2566
|
return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
|
|
2567
2567
|
}
|
|
2568
2568
|
function on(e, t) {
|
|
@@ -2573,23 +2573,23 @@ function sn(e, t) {
|
|
|
2573
2573
|
return Math.floor(t) - an(e.styles.padding, n);
|
|
2574
2574
|
}
|
|
2575
2575
|
function* cn(e, t) {
|
|
2576
|
-
for (let n of e)
|
|
2576
|
+
for (let n of e) re(n) ? yield* cn(n.children, on(t, n.styles.padding)) : yield {
|
|
2577
2577
|
block: n,
|
|
2578
|
-
bandWidth:
|
|
2578
|
+
bandWidth: me(n) && n.wrapper ? on(t, n.wrapper.padding) : t
|
|
2579
2579
|
};
|
|
2580
2580
|
}
|
|
2581
|
-
function ln(e, t, n =
|
|
2581
|
+
function ln(e, t, n = z(e)) {
|
|
2582
2582
|
if (!t) return e;
|
|
2583
2583
|
try {
|
|
2584
|
-
return
|
|
2584
|
+
return ne(ae(t, n, { missing: "default" }), e);
|
|
2585
2585
|
} catch {
|
|
2586
2586
|
return e;
|
|
2587
2587
|
}
|
|
2588
2588
|
}
|
|
2589
2589
|
function un(e, t, n, r) {
|
|
2590
2590
|
let i = ln(e, n, r);
|
|
2591
|
-
for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (
|
|
2592
|
-
let r =
|
|
2591
|
+
for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (me(e)) {
|
|
2592
|
+
let r = de(e)?.applied ? void 0 : e.border, i = Math.floor(n) - an(e.styles.padding, r), a = rn[e.columns] ?? [100];
|
|
2593
2593
|
for (let n = 0; n < e.children.length; n++) {
|
|
2594
2594
|
let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
|
|
2595
2595
|
if (o) return sn(o, r);
|
|
@@ -2603,14 +2603,14 @@ function dn(e, t, n, r) {
|
|
|
2603
2603
|
return null;
|
|
2604
2604
|
}
|
|
2605
2605
|
function fn(e) {
|
|
2606
|
-
let t =
|
|
2606
|
+
let t = me(e) ? de(e) : null;
|
|
2607
2607
|
return !!t?.applied && t.height === "image";
|
|
2608
2608
|
}
|
|
2609
2609
|
function pn(e, t, n, r) {
|
|
2610
2610
|
if (fn(e)) return (t ? dn(t, e.id, n, r) : null) ?? tn(t?.settings);
|
|
2611
2611
|
}
|
|
2612
2612
|
// src/constants/socialIcons.ts
|
|
2613
|
-
var mn =
|
|
2613
|
+
var mn = fe, hn = {
|
|
2614
2614
|
small: 24,
|
|
2615
2615
|
medium: 32,
|
|
2616
2616
|
large: 48
|
|
@@ -2633,6 +2633,6 @@ var mn = ue, hn = {
|
|
|
2633
2633
|
"dribbble",
|
|
2634
2634
|
"behance"
|
|
2635
2635
|
];
|
|
2636
|
-
export { Et as A,
|
|
2636
|
+
export { Et as A, ze as B, Bt as C, jt as D, Mt as E, We as F, Ue as I, Ve as L, Ct as M, lt as N, At as O, Ge as P, He as R, Rt as S, Ft as T, Fe as V, Gt as _, fn as a, Vt as b, nn as c, Zt as d, Xt as f, Kt as g, qt as h, un as i, wt as j, kt as k, tn as l, Yt as m, mn as n, pn as o, Jt as p, gn as r, dn as s, hn as t, en as u, Ut as v, zt as w, Pt as x, Ht as y, Be as z };
|
|
2637
2637
|
|
|
2638
|
-
//# sourceMappingURL=socialIcons-
|
|
2638
|
+
//# sourceMappingURL=socialIcons-DeCYorUT.js.map
|