@templatical/editor 0.55.0 → 0.56.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/{AiAltTextPopover-D5QosKvB.js → AiAltTextPopover-DdsvhE78.js} +4 -4
- package/dist/{AiAltTextReview-D1W_lrI_.js → AiAltTextReview-P6to1_0t.js} +3 -3
- package/dist/{AiChatPanel-C8SeEJRP.js → AiChatPanel-BSlmzMRC.js} +10 -10
- package/dist/{AiPanels-CR6zphjP.js → AiPanels-DAsnX-a3.js} +1 -1
- package/dist/{AiRewriteMenu-BwztoMov.js → AiRewriteMenu-DIISOR6U.js} +11 -11
- package/dist/{BlockIssueBadge-DaPTq1RE.js → BlockIssueBadge-Bmtc50BQ.js} +4 -4
- package/dist/BlockPreviewCanvas-BYIzNn-9.js +154 -0
- package/dist/{CloudHeaderExtras-XpjJjn3o.js → CloudHeaderExtras-Cqhw-jMz.js} +1 -1
- package/dist/{CloudPanels-Baoaj6Xf.js → CloudPanels-w34W8_BP.js} +4 -4
- package/dist/{CollaborationNotices-Cnx0XHzZ.js → CollaborationNotices-HTbCebjV.js} +2 -2
- package/dist/{CollaboratorBar-BaBoNhwB.js → CollaboratorBar-CLQjksX-.js} +2 -2
- package/dist/{CommentsPanel-Ck3QmqiC.js → CommentsPanel-C5qG17Ki.js} +1 -1
- package/dist/{CommentsSidebar-CHknhOar.js → CommentsSidebar-C7CWcUYZ.js} +12 -12
- package/dist/{CountdownBlock-BMezkFbJ.js → CountdownBlock-BTXcCvjZ.js} +2 -2
- package/dist/{CountdownToolbar-CA_gDIdZ.js → CountdownToolbar-CP-pkntQ.js} +5 -5
- package/dist/{IssuesPanel-nmFhWG1p.js → IssuesPanel-CiiNBzH0.js} +12 -12
- package/dist/{LanguageMenu-DcABUYop.js → LanguageMenu-B981Av-6.js} +15 -15
- package/dist/{LocaleNotices-WzsYtBRs.js → LocaleNotices-CTCZ7BYv.js} +4 -4
- package/dist/{LogicTagInsertButton-qZ82VMFx.js → LogicTagInsertButton-DEOPc4RC.js} +23 -23
- package/dist/{MediaEditModal-C3U9Mi31.js → MediaEditModal-DJsPLTwP.js} +1 -1
- package/dist/{MediaPanels-CGmk9ufe.js → MediaPanels-D2WD2aE2.js} +1 -1
- package/dist/{MergeTagInput-JJeZbFkD.js → MergeTagInput-C9icdxw7.js} +1 -1
- package/dist/{MergeTagModeToggle-DDucd1eC.js → MergeTagModeToggle-DXvb80OE.js} +6 -6
- package/dist/{MergeTagTextarea-dQ2LRrNB.js → MergeTagTextarea-CrAcmT3A.js} +5 -5
- package/dist/{ParagraphEditor-VXYwGoz_.js → ParagraphEditor-BWBQ3jKz.js} +55 -55
- package/dist/{RestoreVersionDialog-BibNvAaJ.js → RestoreVersionDialog-CqAp16yQ.js} +4 -4
- package/dist/{RichTextEditorContent-CU5EOlM_.js → RichTextEditorContent-xbBjVPVQ.js} +8 -8
- package/dist/{SaveBlockDialog-S9aFi0cy.js → SaveBlockDialog-pebNJBTc.js} +9 -9
- package/dist/{SavedBlocksBrowserModal-DIdn6B0J.js → SavedBlocksBrowserModal-CvagMcv7.js} +11 -11
- package/dist/{SavedBlocksPanels-Cme2M6u8.js → SavedBlocksPanels-B9AAVBDm.js} +1 -1
- package/dist/{SavedBlocksPickBar-BDmA7r3m.js → SavedBlocksPickBar-BIANWe3i.js} +3 -3
- package/dist/{TemplateSettings-C_LHLm5M.js → TemplateSettings-ORq4PbCN.js} +12 -12
- package/dist/{TestEmailModal-CLIRn7eL.js → TestEmailModal-DRjCpcPl.js} +11 -11
- package/dist/{TestEmailPanel-frdtjC8h.js → TestEmailPanel-H0v8El__.js} +1 -1
- package/dist/{TitleEditor-D5kC56Jl.js → TitleEditor-CEGbJXeU.js} +11 -11
- package/dist/{Toolbar-D904Yw_R.js → Toolbar-XT-uGA9J.js} +937 -703
- package/dist/{TplModal-BBdotDf1.js → TplModal-7NQq5-VW.js} +4 -4
- package/dist/{VersionHistoryMenu-BnP0EyLl.js → VersionHistoryMenu-C8BE3Pr-.js} +7 -7
- package/dist/{VersionHistoryPanels-DhagEgOk.js → VersionHistoryPanels-CuKuOSJG.js} +1 -1
- package/dist/{VersionPreviewBanner-BPP939cD.js → VersionPreviewBanner-BVFBkveR.js} +2 -2
- package/dist/WrapperBlock-Bdw-072t.js +56 -0
- package/dist/{blockTypeIcons-CoRQV_hP.js → blockTypeIcons-CGplGmmr.js} +3 -3
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-DIkMxYCN.js → ca-BJn8lcJx.js} +8 -0
- package/dist/cdn/chunks/{AiAltTextPopover-CUGOPuRo.js → AiAltTextPopover-x999Gimz.js} +5 -5
- package/dist/cdn/chunks/{AiAltTextPopover-CUGOPuRo.js.map → AiAltTextPopover-x999Gimz.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-B9vm_L-8.js → AiAltTextReview-DjnFz1wO.js} +4 -4
- package/dist/cdn/chunks/{AiAltTextReview-B9vm_L-8.js.map → AiAltTextReview-DjnFz1wO.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js → AiChatPanel-DKDu9cs7.js} +4 -4
- package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js.map → AiChatPanel-DKDu9cs7.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-BblCSkQy.js → AiPanels-jMLVaiKx.js} +2 -2
- package/dist/cdn/chunks/{AiPanels-BblCSkQy.js.map → AiPanels-jMLVaiKx.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-BvV_7tNZ.js → AiRewriteMenu-s79rmHFy.js} +9 -9
- package/dist/cdn/chunks/{AiRewriteMenu-BvV_7tNZ.js.map → AiRewriteMenu-s79rmHFy.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js → BlockIssueBadge-Bnmq_M4G.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js.map → BlockIssueBadge-Bnmq_M4G.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-Dr-xGq6v.js → BlockPreviewCanvas-B3HkuENF.js} +46 -32
- package/dist/cdn/chunks/BlockPreviewCanvas-B3HkuENF.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js → CloudHeaderExtras-uUJYJFJ6.js} +2 -2
- package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js.map → CloudHeaderExtras-uUJYJFJ6.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-CQ0vNgsH.js → CloudPanels-DQnlH_YJ.js} +4 -4
- package/dist/cdn/chunks/{CloudPanels-CQ0vNgsH.js.map → CloudPanels-DQnlH_YJ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js → CollaborationNotices-CHqUGhOZ.js} +3 -3
- package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js.map → CollaborationNotices-CHqUGhOZ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js → CollaboratorBar-C1ZI2xwa.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js.map → CollaboratorBar-C1ZI2xwa.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js → CommentsPanel-EtdTzTmq.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js.map → CommentsPanel-EtdTzTmq.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js → CommentsSidebar-Qmj049QX.js} +4 -4
- package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js.map → CommentsSidebar-Qmj049QX.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js → CountdownBlock-DyGsh92b.js} +3 -3
- package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js.map → CountdownBlock-DyGsh92b.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BxW-J7DX.js → CountdownToolbar-Ddj2erNm.js} +6 -6
- package/dist/cdn/chunks/{CountdownToolbar-BxW-J7DX.js.map → CountdownToolbar-Ddj2erNm.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BoHeIjvw.js → IssuesPanel-DnSnEh1X.js} +8 -8
- package/dist/cdn/chunks/{IssuesPanel-BoHeIjvw.js.map → IssuesPanel-DnSnEh1X.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-BnYN5N1h.js → LanguageMenu-C2I_yTL5.js} +110 -110
- package/dist/cdn/chunks/{LanguageMenu-BnYN5N1h.js.map → LanguageMenu-C2I_yTL5.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js → LocaleNotices-Dr9LRCAg.js} +4 -4
- package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js.map → LocaleNotices-Dr9LRCAg.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-Bt2PXbQ0.js → LogicTagInsertButton-BdzE9-l7.js} +29 -29
- package/dist/cdn/chunks/LogicTagInsertButton-BdzE9-l7.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js → MediaEditModal-CMJFXu_o.js} +2 -2
- package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js.map → MediaEditModal-CMJFXu_o.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js → MediaPanels-C790ZXuY.js} +2 -2
- package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js.map → MediaPanels-C790ZXuY.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-BELdMRni.js → MergeTagInput-CmrX8Md6.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-BELdMRni.js.map → MergeTagInput-CmrX8Md6.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-DKfMDIEF.js → MergeTagModeToggle-D7maMGIM.js} +5 -5
- package/dist/cdn/chunks/{MergeTagModeToggle-DKfMDIEF.js.map → MergeTagModeToggle-D7maMGIM.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-w6xen3Xh.js → MergeTagTextarea-KOnd2teB.js} +6 -6
- package/dist/cdn/chunks/{MergeTagTextarea-w6xen3Xh.js.map → MergeTagTextarea-KOnd2teB.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-Cal9hY3U.js → ParagraphEditor-I9lbKaPk.js} +19 -19
- package/dist/cdn/chunks/{ParagraphEditor-Cal9hY3U.js.map → ParagraphEditor-I9lbKaPk.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-f_ulmASY.js → RestoreVersionDialog-DqbULAbc.js} +4 -4
- package/dist/cdn/chunks/{RestoreVersionDialog-f_ulmASY.js.map → RestoreVersionDialog-DqbULAbc.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-C_v0kS4A.js → RichTextEditorContent-_O22z0pn.js} +8 -8
- package/dist/cdn/chunks/{RichTextEditorContent-C_v0kS4A.js.map → RichTextEditorContent-_O22z0pn.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-C6N9RFls.js → SaveBlockDialog-CClRLXgF.js} +8 -8
- package/dist/cdn/chunks/{SaveBlockDialog-C6N9RFls.js.map → SaveBlockDialog-CClRLXgF.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Bl2sl09D.js → SavedBlocksBrowserModal-BIaxaxw9.js} +8 -8
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-Bl2sl09D.js.map → SavedBlocksBrowserModal-BIaxaxw9.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-DqVcmEUK.js → SavedBlocksPanels-Dfu9N6YW.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-DqVcmEUK.js.map → SavedBlocksPanels-Dfu9N6YW.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-DE-J1JVL.js → SavedBlocksPickBar-DiMW_dbJ.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksPickBar-DE-J1JVL.js.map → SavedBlocksPickBar-DiMW_dbJ.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-CpoKZ8oV.js → TemplateSettings-JMUo0LIV.js} +10 -10
- package/dist/cdn/chunks/{TemplateSettings-CpoKZ8oV.js.map → TemplateSettings-JMUo0LIV.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DI3z__Bd.js → TestEmailModal-D52VtwBZ.js} +11 -11
- package/dist/cdn/chunks/{TestEmailModal-DI3z__Bd.js.map → TestEmailModal-D52VtwBZ.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-Cp5d2YGn.js → TestEmailPanel-D9ezVDHd.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-Cp5d2YGn.js.map → TestEmailPanel-D9ezVDHd.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C2syRLdZ.js → TitleEditor-D04vvbUc.js} +9 -9
- package/dist/cdn/chunks/{TitleEditor-C2syRLdZ.js.map → TitleEditor-D04vvbUc.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-NEE8qxYh.js → Toolbar-C_Hfsher.js} +1173 -939
- package/dist/cdn/chunks/Toolbar-C_Hfsher.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-B1MgvtX8.js → TplModal-d6fEZGJ5.js} +5 -5
- package/dist/cdn/chunks/{TplModal-B1MgvtX8.js.map → TplModal-d6fEZGJ5.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js → VersionHistoryMenu-C8ucm43v.js} +7 -7
- package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js.map → VersionHistoryMenu-C8ucm43v.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-Cefd8i_e.js → VersionHistoryPanels-BAdzmhvH.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-Cefd8i_e.js.map → VersionHistoryPanels-BAdzmhvH.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js → VersionPreviewBanner-BWuovbFc.js} +3 -3
- package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js.map → VersionPreviewBanner-BWuovbFc.js.map} +1 -1
- package/dist/cdn/chunks/WrapperBlock-TXDSDXUP.js +58 -0
- package/dist/cdn/chunks/WrapperBlock-TXDSDXUP.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js → blockTypeIcons-CzYA5DF9.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js.map → blockTypeIcons-CzYA5DF9.js.map} +1 -1
- package/dist/cdn/chunks/{ca-DIkMxYCN.js → ca-BJn8lcJx.js} +9 -1
- package/dist/cdn/chunks/ca-BJn8lcJx.js.map +1 -0
- package/dist/cdn/chunks/{composables-nyxwrM27.js → composables-CsfQlmcf.js} +543 -503
- package/dist/cdn/chunks/composables-CsfQlmcf.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-DJkDGKQ_.js → createCloudRuntime-PpIFCDfj.js} +4 -4
- package/dist/cdn/chunks/{createCloudRuntime-DJkDGKQ_.js.map → createCloudRuntime-PpIFCDfj.js.map} +1 -1
- package/dist/{de-Cc6Ue0UD.js → cdn/chunks/de-BLFp3nWx.js} +10 -0
- package/dist/cdn/chunks/de-BLFp3nWx.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-erQEOHZN.js → editor-modal-B8UE9V8B.js} +90 -90
- package/dist/cdn/chunks/{editor-modal-erQEOHZN.js.map → editor-modal-B8UE9V8B.js.map} +1 -1
- package/dist/cdn/chunks/en-CVxNoHww.js +1 -0
- package/dist/cdn/chunks/{en-BX4FujAQ.js → en-DGGQJGbm.js} +9 -1
- package/dist/cdn/chunks/en-DGGQJGbm.js.map +1 -0
- package/dist/cdn/chunks/{es-Do5b-MKU.js → es-DTY9qgLv.js} +9 -1
- package/dist/cdn/chunks/es-DTY9qgLv.js.map +1 -0
- package/dist/cdn/chunks/{extensions-BcwkOjVq.js → extensions-BM6ZSnsQ.js} +70 -70
- package/dist/cdn/chunks/extensions-BM6ZSnsQ.js.map +1 -0
- package/dist/{fr-S1n2Ebzp.js → cdn/chunks/fr-L4FqO9Gp.js} +10 -0
- package/dist/cdn/chunks/{fr-S1n2Ebzp.js.map → fr-L4FqO9Gp.js.map} +1 -1
- package/dist/cdn/chunks/{icons-Da9GKjPx.js → icons-DHExFLlT.js} +43 -43
- package/dist/cdn/chunks/{icons-Da9GKjPx.js.map → icons-DHExFLlT.js.map} +1 -1
- package/dist/cdn/chunks/{ja-DLwcq4bA.js → ja-6uOXkh4v.js} +9 -1
- package/dist/cdn/chunks/ja-6uOXkh4v.js.map +1 -0
- package/dist/cdn/chunks/{keys-CoQtCqNv.js → keys-BUmIvYy3.js} +4 -4
- package/dist/cdn/chunks/keys-BUmIvYy3.js.map +1 -0
- package/dist/{nl-0JSWaZpT.js → cdn/chunks/nl-DCxuxwNq.js} +10 -0
- package/dist/cdn/chunks/nl-DCxuxwNq.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-BrGw5jxk.js → normalizeMergeTagMarkup-aWjkotui.js} +67 -67
- package/dist/cdn/chunks/normalizeMergeTagMarkup-aWjkotui.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-Cj0XYwuh.js → preRenderCustomBlocks-Dn6dFUwx.js} +4 -4
- package/dist/cdn/chunks/{preRenderCustomBlocks-Cj0XYwuh.js.map → preRenderCustomBlocks-Dn6dFUwx.js.map} +1 -1
- package/dist/{pt-BR-D3VlIMDZ.js → cdn/chunks/pt-BR-CBkcrebr.js} +10 -0
- package/dist/cdn/chunks/pt-BR-CBkcrebr.js.map +1 -0
- package/dist/cdn/chunks/{sanitizeHtml-GxJCxKcP.js → sanitizeHtml-DJI7vvET.js} +2 -2
- package/dist/cdn/chunks/{sanitizeHtml-GxJCxKcP.js.map → sanitizeHtml-DJI7vvET.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-B5zrrV8-.js → socialIcons-Qw9rHc8C.js} +354 -341
- package/dist/cdn/chunks/{socialIcons-B5zrrV8-.js.map → socialIcons-Qw9rHc8C.js.map} +1 -1
- package/dist/cdn/chunks/src-Bfj1jHnn.js +710 -0
- package/dist/cdn/chunks/src-Bfj1jHnn.js.map +1 -0
- package/dist/cdn/chunks/{src-Diw9SLIe.js → src-C9JWWxAk.js} +419 -423
- package/dist/cdn/chunks/src-C9JWWxAk.js.map +1 -0
- package/dist/cdn/chunks/{src-v47QHNmB.js → src-mXG-Of9A.js} +669 -662
- package/dist/cdn/chunks/src-mXG-Of9A.js.map +1 -0
- package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js → useCloudI18n-Xsih9yRH.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js.map → useCloudI18n-Xsih9yRH.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js → useEditorRoot-Beau2Z_T.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js.map → useEditorRoot-Beau2Z_T.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-BnJYydPv.js → useI18n-D8s7HtTn.js} +2 -2
- package/dist/cdn/chunks/{useI18n-BnJYydPv.js.map → useI18n-D8s7HtTn.js.map} +1 -1
- package/dist/cdn/chunks/{useLocalizedDisplay-DekV8qar.js → useLocalizedDisplay-Bgg4qpev.js} +6 -6
- package/dist/cdn/chunks/{useLocalizedDisplay-DekV8qar.js.map → useLocalizedDisplay-Bgg4qpev.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-Cbp3I7UN.js → useLogicTag-DLvWzWsp.js} +4 -4
- package/dist/cdn/chunks/{useLogicTag-Cbp3I7UN.js.map → useLogicTag-DLvWzWsp.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-1lrpNyR5.js → useMergeTag-B4FHCGGm.js} +5 -5
- package/dist/cdn/chunks/{useMergeTag-1lrpNyR5.js.map → useMergeTag-B4FHCGGm.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js → usePopoverPosition-esO6wjvU.js} +5 -5
- package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js.map → usePopoverPosition-esO6wjvU.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js → useScrollToBlock-CJuUu7Xj.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js.map → useScrollToBlock-CJuUu7Xj.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-DZfmiv8V.js → withCurrentFont-QqBilClC.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-DZfmiv8V.js.map → withCurrentFont-QqBilClC.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +793 -796
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-XMnOOIEC.js → check-CcuCoJDh.js} +1 -1
- package/dist/{chevron-down-DmamTEWQ.js → chevron-down-BfYIbFbC.js} +1 -1
- package/dist/{chevron-right-BEFXOH27.js → chevron-right-DyjFqY35.js} +1 -1
- package/dist/{chevron-up-Dw7woXj8.js → chevron-up-BHEIxuS-.js} +1 -1
- package/dist/{circle-alert-BTKC9vkq.js → circle-alert-Tq7kAh9S.js} +1 -1
- package/dist/{clock-BVT5u2uG.js → clock-Df0ZiXwQ.js} +1 -1
- package/dist/{composables-DPgNn9GZ.js → composables-CRX6rncm.js} +978 -938
- package/dist/{createCloudRuntime-Bw8TLmQ8.js → createCloudRuntime-DplyIlsy.js} +3 -3
- package/dist/{createLucideIcon-CgDE3xAR.js → createLucideIcon-CfBdtoUw.js} +5 -5
- package/dist/{cdn/chunks/de-Cc6Ue0UD.js → de-BLFp3nWx.js} +8 -2
- package/dist/{dist-CBdk1Vcb.js → dist-BMUUt3zJ.js} +284 -277
- package/dist/{editor-modal-BeX6otLk.js → editor-modal-D9HT9bD6.js} +15 -15
- package/dist/{en-BX4FujAQ.js → en-DGGQJGbm.js} +8 -0
- package/dist/en-De3uAutQ.js +1 -0
- package/dist/{es-Do5b-MKU.js → es-DTY9qgLv.js} +8 -0
- package/dist/{extensions-QFAARrjF.js → extensions-Cm6K4SRX.js} +285 -285
- package/dist/{eye-ByMgHeA_.js → eye-B3psrAqd.js} +1 -1
- package/dist/{cdn/chunks/fr-S1n2Ebzp.js → fr-L4FqO9Gp.js} +8 -2
- package/dist/{image-Ch8tR35K.js → image-C3yuPDxx.js} +1 -1
- package/dist/index.d.ts +60 -12
- package/dist/{info-DzSD-Wpk.js → info-DKja7A68.js} +1 -1
- package/dist/{ja-DLwcq4bA.js → ja-6uOXkh4v.js} +8 -0
- package/dist/{keys-BCqskl51.js → keys-w_VRjoMu.js} +3 -3
- package/dist/{link-oDn9AR2w.js → link-DhzPI4Hn.js} +1 -1
- package/dist/{list-C5t07dp8.js → list-DVGn7Ik2.js} +1 -1
- package/dist/{loader-circle-k6xvKgUB.js → loader-circle-DqKWsMHO.js} +1 -1
- package/dist/{message-circle-C23R6OJR.js → message-circle-C4TonoBs.js} +1 -1
- package/dist/{cdn/chunks/nl-0JSWaZpT.js → nl-DCxuxwNq.js} +8 -2
- package/dist/{normalizeMergeTagMarkup-BS0nRvhq.js → normalizeMergeTagMarkup-Da9JAgx7.js} +75 -75
- package/dist/{package-C90eQ7NU.js → package-9OkiEO4S.js} +1 -1
- package/dist/{pencil-BK7GrQuA.js → pencil-M9vkOB7C.js} +1 -1
- package/dist/{plus-Cr0Mis63.js → plus-DxZiv9YC.js} +1 -1
- package/dist/{preRenderCustomBlocks-CiKvKd8V.js → preRenderCustomBlocks-CdqSp2P7.js} +4 -4
- package/dist/{cdn/chunks/pt-BR-D3VlIMDZ.js → pt-BR-CBkcrebr.js} +8 -2
- package/dist/{refresh-cw-_ZLOIEvA.js → refresh-cw-UY8_sdFG.js} +1 -1
- package/dist/{rotate-ccw-CB5wsHwv.js → rotate-ccw-BFTGCpHn.js} +1 -1
- package/dist/{sanitizeHtml-USjTyALR.js → sanitizeHtml-wBibnBF4.js} +6 -6
- package/dist/{search-BmrQNox8.js → search-RuGJnMEn.js} +1 -1
- package/dist/{send-blAsIBBg.js → send-DGB1ar02.js} +1 -1
- package/dist/{smartphone-BPpWYrwV.js → smartphone-CVA29CU_.js} +1 -1
- package/dist/{socialIcons-NvIg5ahU.js → socialIcons-CJD6OsI7.js} +427 -414
- package/dist/{sparkles-OqIxrNp-.js → sparkles-IHfEwEcd.js} +1 -1
- package/dist/{square-BP-V7iT-.js → square-_Cl44UU6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +851 -854
- package/dist/{text-align-start-4mwX2o-F.js → text-align-start-Dqk2Xt_Q.js} +13 -13
- package/dist/{trash-B99WixTA.js → trash-Cr7rD5Hh.js} +1 -1
- package/dist/{triangle-alert-CHMiDkHa.js → triangle-alert-CKcpwtUj.js} +1 -1
- package/dist/{upload-Cp8o-hrN.js → upload-DR9pqVON.js} +1 -1
- package/dist/{useCloudI18n-Dh2iydo1.js → useCloudI18n-BczJoFf4.js} +1 -1
- package/dist/{useEditorRoot-DY3mgcHm.js → useEditorRoot-BcXKhM_8.js} +1 -1
- package/dist/{useI18n-CgtvtF4C.js → useI18n-zeWYtWSv.js} +1 -1
- package/dist/useLocalizedDisplay-Cbhx208c.js +31 -0
- package/dist/{useLogicTag-D8zgkXfb.js → useLogicTag-DLkYos2Q.js} +3 -3
- package/dist/{useMergeTag-k7Kr0nMd.js → useMergeTag-IoWOO679.js} +5 -5
- package/dist/{usePopoverPosition-VDQjyX_A.js → usePopoverPosition-Br3zt_MQ.js} +4 -4
- package/dist/{useScrollToBlock-B35ObCGK.js → useScrollToBlock-BfOzc1Z6.js} +2 -2
- package/dist/{withCurrentFont-Bzeg_gfH.js → withCurrentFont-m_PHcOD0.js} +1 -1
- package/dist/{x-BIBStNMS.js → x-DZSFHafL.js} +1 -1
- package/package.json +10 -10
- package/dist/BlockPreviewCanvas-C23A6FRm.js +0 -140
- package/dist/WrapperBlock-BAT3T0Cz.js +0 -44
- package/dist/cdn/chunks/BlockPreviewCanvas-Dr-xGq6v.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-DFY-7YSs.js +0 -46
- package/dist/cdn/chunks/WrapperBlock-DFY-7YSs.js.map +0 -1
- package/dist/cdn/chunks/ca-DIkMxYCN.js.map +0 -1
- package/dist/cdn/chunks/composables-nyxwrM27.js.map +0 -1
- package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +0 -1
- package/dist/cdn/chunks/en-B6tLGRHq.js +0 -1
- package/dist/cdn/chunks/en-BX4FujAQ.js.map +0 -1
- package/dist/cdn/chunks/es-Do5b-MKU.js.map +0 -1
- package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +0 -1
- package/dist/cdn/chunks/ja-DLwcq4bA.js.map +0 -1
- package/dist/cdn/chunks/keys-CoQtCqNv.js.map +0 -1
- package/dist/cdn/chunks/nl-0JSWaZpT.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +0 -1
- package/dist/cdn/chunks/src-Diw9SLIe.js.map +0 -1
- package/dist/cdn/chunks/src-UR3AQocX.js +0 -683
- package/dist/cdn/chunks/src-UR3AQocX.js.map +0 -1
- package/dist/cdn/chunks/src-v47QHNmB.js.map +0 -1
- package/dist/en-Do0SU6tR.js +0 -1
- package/dist/useLocalizedDisplay-LdjosX4w.js +0 -31
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { $ as e, B as t, Ft as n, G as r, M as i, Mt as a, Pt as o, Q as s, Y as c, Z as l, _ as u, c as d, ct as f, et as p, f as m, g as h, it as g, k as _, lt as v, nt as y, ot as b, q as x, r as S, w as C, y as w } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { B as
|
|
7
|
-
import { t as
|
|
8
|
-
import { r as
|
|
9
|
-
import { i as
|
|
2
|
+
import { $t as T, C as E, Ct as D, Dt as O, E as k, Et as A, Ft as j, Gt as M, Ht as ee, I as te, It as ne, Lt as N, Nt as P, O as F, Ot as I, Q as L, T as R, U as re, _ as z, an as ie, ct as B, d as V, g as H, gt as ae, h as U, j as oe, k as se, m as W, nn as ce, qt as G, st as le, tt as K, vt as ue, w as de, wt as fe, x as pe } from "./dist-BMUUt3zJ.js";
|
|
3
|
+
import { t as q } from "./createLucideIcon-CfBdtoUw.js";
|
|
4
|
+
import { t as J } from "./upload-DR9pqVON.js";
|
|
5
|
+
import { t as me } from "./loader-circle-DqKWsMHO.js";
|
|
6
|
+
import { B as he, C as ge, W as _e, u as ve } from "./keys-w_VRjoMu.js";
|
|
7
|
+
import { t as ye } from "./useI18n-zeWYtWSv.js";
|
|
8
|
+
import { r as be } from "./dist-0alKVRc_.js";
|
|
9
|
+
import { i as Y, r as xe } from "./usePopoverPosition-Br3zt_MQ.js";
|
|
10
10
|
// ../core/dist/index.js
|
|
11
|
-
var
|
|
11
|
+
var X = (e) => typeof e == "object" && !!e && !Array.isArray(e), Se = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => X(e) && typeof e.id == "string"), Ce = /* @__PURE__ */ new Set([
|
|
12
12
|
"id",
|
|
13
13
|
"type",
|
|
14
14
|
"children",
|
|
@@ -16,51 +16,51 @@ var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Arr
|
|
|
16
16
|
"l10n",
|
|
17
17
|
"renderedHtml"
|
|
18
18
|
]);
|
|
19
|
-
function
|
|
19
|
+
function we(e, t, n) {
|
|
20
20
|
let r = /* @__PURE__ */ new Set();
|
|
21
21
|
for (let i of n) {
|
|
22
|
-
if (!
|
|
23
|
-
let n = i.split("."), a = n.pop(), o = n.join("."), s =
|
|
22
|
+
if (!D(i)) continue;
|
|
23
|
+
let n = i.split("."), a = n.pop(), o = n.join("."), s = N(e, i), c = t;
|
|
24
24
|
for (let [t, i] of n.entries()) {
|
|
25
25
|
let a = n.slice(0, t + 1).join(".");
|
|
26
|
-
s !== void 0 &&
|
|
26
|
+
s !== void 0 && X(c) && N(c, i) === void 0 && X(N(e, a)) && (c[i] = {}, r.add(a)), c = N(c, i);
|
|
27
27
|
}
|
|
28
28
|
if (Array.isArray(c)) {
|
|
29
|
-
let e = c.findIndex((e) =>
|
|
29
|
+
let e = c.findIndex((e) => X(e) && e.id === a);
|
|
30
30
|
if (e < 0) continue;
|
|
31
|
-
s === void 0 ? c.splice(e, 1) : c[e] =
|
|
32
|
-
} else
|
|
31
|
+
s === void 0 ? c.splice(e, 1) : c[e] = G(s);
|
|
32
|
+
} else X(c) && (s === void 0 ? delete c[a] : c[a] = G(s), o && Object.keys(c).length === 0 && N(e, o) === void 0 && we(e, t, [o]));
|
|
33
33
|
}
|
|
34
34
|
return r;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (
|
|
38
|
-
else if (i &&
|
|
36
|
+
function Te(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
|
|
37
|
+
if (X(e) && X(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !Ce.has(o)) && Te(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
|
|
38
|
+
else if (i && Se(e) && Se(t)) for (let o of t) {
|
|
39
39
|
if (o.id.includes(".")) continue;
|
|
40
40
|
let t = e.find((e) => e.id === o.id);
|
|
41
|
-
t &&
|
|
41
|
+
t && Te(t, o, `${n}.${o.id}`, r, i, a);
|
|
42
42
|
}
|
|
43
|
-
else
|
|
43
|
+
else L(e, t) || r.set(n, t);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
|
|
46
46
|
let a = /* @__PURE__ */ new Map();
|
|
47
|
-
|
|
48
|
-
let o = new Set(e.type === "custom" ?
|
|
49
|
-
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) :
|
|
47
|
+
Te(e, t, "", a, e.type !== "custom", i);
|
|
48
|
+
let o = new Set(e.type === "custom" ? ie(e, r) : []), s = {}, c = {};
|
|
49
|
+
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : O(e.type, t)) && typeof r == "string" && N(e, t) !== void 0) {
|
|
50
50
|
let i = n?.text?.[t];
|
|
51
51
|
s[t] = i && i.value === r ? i : {
|
|
52
52
|
value: r,
|
|
53
|
-
sourceHash:
|
|
53
|
+
sourceHash: T(String(N(e, t) ?? ""))
|
|
54
54
|
};
|
|
55
55
|
} else c[t] = r === void 0 ? null : r;
|
|
56
56
|
let l = {};
|
|
57
57
|
return Object.keys(s).length && (l.text = s), Object.keys(c).length && (l.set = c), n?.hidden && (l.hidden = !0), l;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function De(e, t, n) {
|
|
60
60
|
let r = !1;
|
|
61
61
|
function i(e, t, n, a) {
|
|
62
|
-
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) =>
|
|
63
|
-
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) =>
|
|
62
|
+
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => X(e) && typeof e.id == "string");
|
|
63
|
+
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) => G(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
|
|
64
64
|
let r = e[n].find((e) => e.id === t.id);
|
|
65
65
|
r && i(r, t, a);
|
|
66
66
|
}
|
|
@@ -68,51 +68,51 @@ function Oe(e, t, n) {
|
|
|
68
68
|
let a = e, o = t;
|
|
69
69
|
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") {
|
|
70
70
|
let i = (e) => e.map((e) => e.map((e) => e.id));
|
|
71
|
-
(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) =>
|
|
71
|
+
(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) => G(n(e.id) ?? e))));
|
|
72
72
|
}
|
|
73
73
|
return r;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Oe(e, t, n) {
|
|
76
76
|
let r = (e) => {
|
|
77
77
|
let { locale: t, locales: n, l10n: r, ...i } = e;
|
|
78
78
|
return i;
|
|
79
79
|
}, i = /* @__PURE__ */ new Map();
|
|
80
|
-
|
|
80
|
+
Te(r(e), r(t), "", i);
|
|
81
81
|
let a = {};
|
|
82
|
-
for (let [t, r] of i) if (
|
|
82
|
+
for (let [t, r] of i) if (W.includes(t) && typeof r == "string" && N(e, t) !== void 0) {
|
|
83
83
|
let i = n?.text?.[t];
|
|
84
84
|
(a.text ??= {})[t] = i?.value === r ? i : {
|
|
85
85
|
value: r,
|
|
86
|
-
sourceHash:
|
|
86
|
+
sourceHash: T(String(N(e, t) ?? ""))
|
|
87
87
|
};
|
|
88
88
|
} else (a.set ??= {})[t] = r === void 0 ? null : r;
|
|
89
89
|
return a;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
let o =
|
|
91
|
+
function ke(e, t, n, r, i, a = []) {
|
|
92
|
+
let o = G(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
|
|
93
93
|
...Object.keys(t.text ?? {}),
|
|
94
94
|
...Object.keys(t.set ?? {}),
|
|
95
95
|
...Object.keys(n.text ?? {}),
|
|
96
96
|
...Object.keys(n.set ?? {})
|
|
97
|
-
])].filter((e) => !
|
|
97
|
+
])].filter((e) => !L(t.text?.[e], n.text?.[e]) || !L(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
|
|
98
98
|
for (let e of c) {
|
|
99
|
-
let t =
|
|
100
|
-
if (
|
|
101
|
-
else if (n.length &&
|
|
99
|
+
let t = N(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && L(N(r, t), N(i, t)));
|
|
100
|
+
if (L(t, N(r, e))) delete o.set[e];
|
|
101
|
+
else if (n.length && X(N(r, e)) && X(t)) {
|
|
102
102
|
delete o.set[e];
|
|
103
103
|
let i = (e, t, a) => {
|
|
104
104
|
if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
|
|
105
|
-
if (
|
|
106
|
-
else if (
|
|
107
|
-
else
|
|
105
|
+
if (X(t) && X(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
|
|
106
|
+
else if (X(r) && r.type !== "custom" && Se(t) && Se(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
|
|
107
|
+
else X(r) && typeof r.type == "string" && A(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : G(a));
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
i(e,
|
|
111
|
-
} else o.set[e] = t === void 0 ? null :
|
|
110
|
+
i(e, N(r, e), t);
|
|
111
|
+
} else o.set[e] = t === void 0 ? null : G(t);
|
|
112
112
|
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) {
|
|
113
113
|
if (!n.startsWith(`${e}.`)) continue;
|
|
114
114
|
let r = t === "text" ? o.text[n].value : o.set[n] ?? void 0;
|
|
115
|
-
|
|
115
|
+
L(r, N(i, n)) || delete o[t][n];
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
for (let e of s) if (!c.includes(e)) {
|
|
@@ -121,7 +121,7 @@ function Ae(e, t, n, r, i, a = []) {
|
|
|
121
121
|
}
|
|
122
122
|
return o.text && !Object.keys(o.text).length && delete o.text, o.set && !Object.keys(o.set).length && delete o.set, o;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ae(e) {
|
|
125
125
|
return [
|
|
126
126
|
"addBlock",
|
|
127
127
|
"removeBlock",
|
|
@@ -129,7 +129,7 @@ function je(e) {
|
|
|
129
129
|
"duplicateBlock"
|
|
130
130
|
].includes(e);
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function je(e, t, n) {
|
|
133
133
|
if (e.canEdit && !e.canEdit()) return !1;
|
|
134
134
|
let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
|
|
135
135
|
if (!r && e.findBlock && !o) return !1;
|
|
@@ -148,24 +148,24 @@ function Me(e, t, n) {
|
|
|
148
148
|
if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
|
|
149
149
|
if (e.findBlock) {
|
|
150
150
|
let t = e.findBlock(l);
|
|
151
|
-
if (t?.type !== "section" || u < 0 || u >=
|
|
151
|
+
if (t?.type !== "section" || u < 0 || u >= B(t.columns)) return !1;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
|
|
155
155
|
}
|
|
156
|
-
var
|
|
157
|
-
function
|
|
158
|
-
|
|
159
|
-
for (let n of Object.values(e)) typeof n == "function" &&
|
|
156
|
+
var Me = /* @__PURE__ */ new WeakMap();
|
|
157
|
+
function Ne(e, t) {
|
|
158
|
+
Me.set(e, t);
|
|
159
|
+
for (let n of Object.values(e)) typeof n == "function" && Me.set(n, t);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
let n =
|
|
163
|
-
n &&
|
|
161
|
+
function Z(e, t) {
|
|
162
|
+
let n = Me.get(e);
|
|
163
|
+
n && Me.set(t, n);
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
let r = Reflect.get(e, t), i =
|
|
165
|
+
function Q(e, t, n) {
|
|
166
|
+
let r = Reflect.get(e, t), i = Me.get(e) ?? (typeof r == "function" ? Me.get(r) : void 0);
|
|
167
167
|
if (i) return i(t, n);
|
|
168
|
-
if (!
|
|
168
|
+
if (!Ae(t)) return !0;
|
|
169
169
|
let a = Reflect.get(e, "isBlockLocked");
|
|
170
170
|
if (typeof a != "function") return !0;
|
|
171
171
|
let o = { isBlockLocked: (t, n) => a.call(e, t, n) }, s = Reflect.get(e, "content");
|
|
@@ -178,20 +178,20 @@ function Z(e, t, n) {
|
|
|
178
178
|
let n = Reflect.get(e, t);
|
|
179
179
|
typeof n == "function" && (o[t] = n.bind(e));
|
|
180
180
|
}
|
|
181
|
-
return
|
|
181
|
+
return je(o, t, n);
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function Pe(e) {
|
|
184
184
|
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
185
185
|
}
|
|
186
186
|
function Fe(e, t) {
|
|
187
187
|
try {
|
|
188
188
|
t();
|
|
189
189
|
} catch (t) {
|
|
190
|
-
e?.(
|
|
190
|
+
e?.(Pe(t));
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
function Ie(t) {
|
|
194
|
-
let n = t.content ??
|
|
194
|
+
let n = t.content ?? te(t.defaultFontFamily, t.templateDefaults);
|
|
195
195
|
R(n), k(n);
|
|
196
196
|
let i = s({
|
|
197
197
|
template: null,
|
|
@@ -207,11 +207,11 @@ function Ie(t) {
|
|
|
207
207
|
uiTheme: "auto"
|
|
208
208
|
}), a = g(i, "activeLocale"), o = [];
|
|
209
209
|
function c(e) {
|
|
210
|
-
let t =
|
|
211
|
-
if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new
|
|
210
|
+
let t = K(i.content);
|
|
211
|
+
if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new z(`This template has no "${e}" version.`, void 0, "unknown_locale");
|
|
212
212
|
a.value = e;
|
|
213
213
|
}
|
|
214
|
-
v(() => a.value ??
|
|
214
|
+
v(() => a.value ?? K(i.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
|
|
215
215
|
a.value && !i.content.settings.locales?.includes(a.value) && c(null);
|
|
216
216
|
});
|
|
217
217
|
function l() {
|
|
@@ -221,20 +221,20 @@ function Ie(t) {
|
|
|
221
221
|
o = e;
|
|
222
222
|
}
|
|
223
223
|
function d(e) {
|
|
224
|
-
return
|
|
224
|
+
return re(i.content, e, o);
|
|
225
225
|
}
|
|
226
226
|
function f(e, n) {
|
|
227
227
|
if (!l()) return null;
|
|
228
|
-
if (e === "addLocale" && (!
|
|
229
|
-
let r =
|
|
230
|
-
return
|
|
228
|
+
if (e === "addLocale" && (!ue(n) || t.localization && !t.localization.locales.includes(n))) throw new z(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
|
|
229
|
+
let r = G(i.content);
|
|
230
|
+
return de(r, [{
|
|
231
231
|
op: e,
|
|
232
232
|
locale: n
|
|
233
|
-
}]),
|
|
233
|
+
}]), L(r, i.content) ? null : r;
|
|
234
234
|
}
|
|
235
235
|
function m(e, t) {
|
|
236
236
|
let n = f(e, t);
|
|
237
|
-
n && (i.content = n,
|
|
237
|
+
n && (i.content = n, A());
|
|
238
238
|
}
|
|
239
239
|
function h(e) {
|
|
240
240
|
m("addLocale", e);
|
|
@@ -251,24 +251,24 @@ function Ie(t) {
|
|
|
251
251
|
}
|
|
252
252
|
function b(e, t) {
|
|
253
253
|
let [n, r] = t;
|
|
254
|
-
if (!a.value || !l() ||
|
|
255
|
-
let s =
|
|
254
|
+
if (!a.value || !l() || V(n)) return null;
|
|
255
|
+
let s = I(i.content.blocks, n);
|
|
256
256
|
if (!s) return null;
|
|
257
|
-
let c = s.l10n?.[a.value], u =
|
|
257
|
+
let c = s.l10n?.[a.value], u = P(s, a.value, K(i.content)), d = Ee(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? we(s, u, r) : void 0, p = e === "resetLocaleFields" ? ke(c, d, Ee(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : G(c ?? {});
|
|
258
258
|
if (e === "setBlockHidden") r ? p.hidden = !0 : delete p.hidden;
|
|
259
259
|
else if (e === "resetLocaleFields") r || (delete p.text, delete p.set, delete p.hidden);
|
|
260
260
|
else for (let e of r) {
|
|
261
261
|
let t = p.text?.[e];
|
|
262
|
-
t && (t.sourceHash =
|
|
262
|
+
t && (t.sourceHash = T(String(N(s, e) ?? "")));
|
|
263
263
|
}
|
|
264
|
-
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set,
|
|
264
|
+
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, L(c ?? {}, p) ? null : {
|
|
265
265
|
block: s,
|
|
266
266
|
layer: p
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
function x(e, t) {
|
|
270
270
|
let n = b(e, t);
|
|
271
|
-
n && (y(n.block, n.layer),
|
|
271
|
+
n && (y(n.block, n.layer), A());
|
|
272
272
|
}
|
|
273
273
|
function S(e, t) {
|
|
274
274
|
x("setBlockHidden", [e, t]);
|
|
@@ -279,35 +279,35 @@ function Ie(t) {
|
|
|
279
279
|
function w(e, t) {
|
|
280
280
|
x("keepTranslations", [e, t]);
|
|
281
281
|
}
|
|
282
|
-
let
|
|
283
|
-
function
|
|
284
|
-
i.isDirty = !0,
|
|
282
|
+
let E = p(0), D = 0, O = 0;
|
|
283
|
+
function A() {
|
|
284
|
+
i.isDirty = !0, O++;
|
|
285
285
|
}
|
|
286
286
|
let ee = r({
|
|
287
287
|
get: () => i.content,
|
|
288
288
|
set: (e) => {
|
|
289
|
-
i.content = e,
|
|
289
|
+
i.content = e, A();
|
|
290
290
|
}
|
|
291
|
-
}),
|
|
292
|
-
function
|
|
291
|
+
}), F = r(() => i.selectedBlockId ? I(i.content.blocks, i.selectedBlockId) : null);
|
|
292
|
+
function I(e, t) {
|
|
293
293
|
for (let n of e) {
|
|
294
294
|
if (n.id === t) return n;
|
|
295
295
|
if (n.type === "section") for (let e of n.children) {
|
|
296
|
-
let n =
|
|
296
|
+
let n = I(e, t);
|
|
297
297
|
if (n) return n;
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
return null;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n)
|
|
302
|
+
function ie(e, t) {
|
|
303
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) ie(e, t);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function B(e, t, n = { blocks: e }) {
|
|
306
306
|
for (let r = 0; r < e.length; r++) {
|
|
307
307
|
let i = e[r];
|
|
308
308
|
if (i.id === t) return n;
|
|
309
309
|
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
310
|
-
let n =
|
|
310
|
+
let n = B(i.children[e], t, {
|
|
311
311
|
blocks: i.children[e],
|
|
312
312
|
sectionId: i.id,
|
|
313
313
|
columnIndex: e
|
|
@@ -317,7 +317,7 @@ function Ie(t) {
|
|
|
317
317
|
}
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function V(e, n = !1) {
|
|
321
321
|
let r = a.value ?? t.lockLocale?.value ?? null;
|
|
322
322
|
for (let [i, a] of t.lockedBlocks?.value ?? []) {
|
|
323
323
|
let o = a;
|
|
@@ -327,8 +327,8 @@ function Ie(t) {
|
|
|
327
327
|
}
|
|
328
328
|
return !1;
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
let t =
|
|
330
|
+
function H(e) {
|
|
331
|
+
let t = B(i.content.blocks, e);
|
|
332
332
|
if (!t) return null;
|
|
333
333
|
let n = t.blocks.findIndex((t) => t.id === e);
|
|
334
334
|
return n === -1 ? null : {
|
|
@@ -338,201 +338,201 @@ function Ie(t) {
|
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
340
|
function ae(e, t = !0) {
|
|
341
|
-
R(e), k(e), i.content = e, t &&
|
|
341
|
+
R(e), k(e), i.content = e, t && A();
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
e &&
|
|
343
|
+
function U(e) {
|
|
344
|
+
e && V(e) || (i.selectedBlockId = e);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function oe(e) {
|
|
347
347
|
i.viewport = e;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function se(e) {
|
|
350
350
|
i.darkMode = e;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function W(e) {
|
|
353
353
|
i.uiTheme = e;
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function ce(e) {
|
|
356
356
|
i.previewMode = e, e && (i.selectedBlockId = null);
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function le(e, t) {
|
|
359
359
|
if (!l()) return !1;
|
|
360
|
-
let n =
|
|
360
|
+
let n = I(i.content.blocks, e);
|
|
361
361
|
if (!n) return !1;
|
|
362
|
-
if ("l10n" in t) throw new
|
|
362
|
+
if ("l10n" in t) throw new z("l10n is immutable in updateBlock.", void 0, "invalid_operation");
|
|
363
363
|
let r = {
|
|
364
364
|
...n,
|
|
365
365
|
...t
|
|
366
366
|
};
|
|
367
|
-
return !
|
|
367
|
+
return !V(e, De(G(n), r, (e) => I(i.content.blocks, e)));
|
|
368
368
|
}
|
|
369
369
|
function fe(e, n) {
|
|
370
|
-
if (!
|
|
371
|
-
let r =
|
|
370
|
+
if (!le(e, n)) return;
|
|
371
|
+
let r = I(i.content.blocks, e);
|
|
372
372
|
if (!r) return;
|
|
373
373
|
let s = a.value;
|
|
374
374
|
if (s) {
|
|
375
|
-
let a =
|
|
375
|
+
let a = P(r, s, K(i.content)), c = {
|
|
376
376
|
...a,
|
|
377
377
|
...n
|
|
378
|
-
}, l =
|
|
379
|
-
if (
|
|
378
|
+
}, l = G(r), u = De(l, c, (e) => I(i.content.blocks, e));
|
|
379
|
+
if (V(e, u)) return;
|
|
380
380
|
u && t.onStructureChange?.();
|
|
381
|
-
let d =
|
|
382
|
-
delete r.l10n, Object.assign(r, d), y(r,
|
|
381
|
+
let d = j(l);
|
|
382
|
+
delete r.l10n, Object.assign(r, d), y(r, ke(r.l10n?.[s], Ee(r, a, r.l10n?.[s], o), Ee(r, c, r.l10n?.[s], o), r, c));
|
|
383
383
|
} else {
|
|
384
|
-
if (
|
|
385
|
-
let t =
|
|
384
|
+
if (V(e, "children" in n || "columns" in n)) return;
|
|
385
|
+
let t = j({
|
|
386
386
|
...r,
|
|
387
387
|
...n
|
|
388
388
|
});
|
|
389
389
|
delete r.l10n, Object.assign(r, t);
|
|
390
390
|
}
|
|
391
|
-
|
|
391
|
+
A();
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
if ("locales" in e || "l10n" in e) throw new
|
|
395
|
-
if ("locale" in e && e.locale !==
|
|
393
|
+
function pe(e) {
|
|
394
|
+
if ("locales" in e || "l10n" in e) throw new z("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
|
|
395
|
+
if ("locale" in e && e.locale !== K(i.content) && i.content.settings.locales?.length) throw new z("The default locale can't change while language versions exist.", void 0, "invalid_operation");
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function q(e) {
|
|
398
398
|
if (!l()) return;
|
|
399
|
-
|
|
399
|
+
pe(e);
|
|
400
400
|
let t = a.value;
|
|
401
|
-
if (!t) i.content.settings =
|
|
401
|
+
if (!t) i.content.settings = ne({
|
|
402
402
|
...i.content.settings,
|
|
403
403
|
...e
|
|
404
404
|
});
|
|
405
405
|
else {
|
|
406
|
-
let n = i.content.settings, r =
|
|
406
|
+
let n = i.content.settings, r = M(i.content, t).settings, a = {
|
|
407
407
|
...r,
|
|
408
408
|
locale: n.locale,
|
|
409
409
|
...e
|
|
410
|
-
}, o = n.l10n?.[t], s =
|
|
410
|
+
}, o = n.l10n?.[t], s = ke(o, Oe(n, r, o), Oe(n, a, o), n, a);
|
|
411
411
|
Object.keys(s).length ? n.l10n = {
|
|
412
412
|
...n.l10n,
|
|
413
413
|
[t]: s
|
|
414
414
|
} : n.l10n && (delete n.l10n[t], Object.keys(n.l10n).length || delete n.l10n);
|
|
415
415
|
}
|
|
416
|
-
|
|
416
|
+
A();
|
|
417
417
|
}
|
|
418
|
-
let
|
|
418
|
+
let J = {
|
|
419
419
|
canEdit: l,
|
|
420
420
|
content: () => i.content,
|
|
421
|
-
findBlock: (e) =>
|
|
422
|
-
findBlockLocation:
|
|
423
|
-
isBlockLocked:
|
|
421
|
+
findBlock: (e) => I(i.content.blocks, e),
|
|
422
|
+
findBlockLocation: H,
|
|
423
|
+
isBlockLocked: V
|
|
424
424
|
};
|
|
425
|
-
function
|
|
426
|
-
if (
|
|
425
|
+
function me(e, n, r = 0, o) {
|
|
426
|
+
if (je(J, "addBlock", [
|
|
427
427
|
e,
|
|
428
428
|
n,
|
|
429
429
|
r,
|
|
430
430
|
o
|
|
431
431
|
])) {
|
|
432
432
|
if (n) {
|
|
433
|
-
let t =
|
|
433
|
+
let t = I(i.content.blocks, n);
|
|
434
434
|
if (t && t.type === "section") {
|
|
435
435
|
t.children[r] = t.children[r] || [];
|
|
436
436
|
let n = t.children[r];
|
|
437
437
|
o !== void 0 && o < n.length ? n.splice(o, 0, e) : n.push(e);
|
|
438
438
|
}
|
|
439
439
|
} else o !== void 0 && o < i.content.blocks.length ? i.content.blocks.splice(o, 0, e) : i.content.blocks.push(e);
|
|
440
|
-
a.value && t.onStructureChange?.(),
|
|
440
|
+
a.value && t.onStructureChange?.(), A();
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
function
|
|
444
|
-
if (!
|
|
445
|
-
let n =
|
|
443
|
+
function he(e) {
|
|
444
|
+
if (!je(J, "removeBlock", [e])) return;
|
|
445
|
+
let n = B(i.content.blocks, e);
|
|
446
446
|
if (n) {
|
|
447
447
|
let r = n.blocks.findIndex((t) => t.id === e);
|
|
448
448
|
if (r !== -1) {
|
|
449
449
|
let [e] = n.blocks.splice(r, 1);
|
|
450
450
|
if (i.selectedBlockId) {
|
|
451
451
|
let t = /* @__PURE__ */ new Set();
|
|
452
|
-
|
|
452
|
+
ie(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
|
|
453
453
|
}
|
|
454
|
-
a.value && t.onStructureChange?.(),
|
|
454
|
+
a.value && t.onStructureChange?.(), A();
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
if (!
|
|
458
|
+
function ge(e, n, r, o = 0) {
|
|
459
|
+
if (!je(J, "moveBlock", [
|
|
460
460
|
e,
|
|
461
461
|
n,
|
|
462
462
|
r,
|
|
463
463
|
o
|
|
464
464
|
])) return;
|
|
465
|
-
let s =
|
|
465
|
+
let s = B(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
|
|
466
466
|
if (r) {
|
|
467
|
-
let e =
|
|
467
|
+
let e = I(i.content.blocks, r);
|
|
468
468
|
e.children[o] = e.children[o] || [], l = e.children[o];
|
|
469
469
|
} else l = i.content.blocks;
|
|
470
470
|
let [u] = s.blocks.splice(c, 1);
|
|
471
|
-
l.splice(n, 0, u), a.value && t.onStructureChange?.(),
|
|
471
|
+
l.splice(n, 0, u), a.value && t.onStructureChange?.(), A();
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
473
|
+
function _e() {
|
|
474
|
+
A();
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
throw new
|
|
476
|
+
function ve(e, t) {
|
|
477
|
+
throw new z(`[Templatical] Templates: ${e} ${t}`);
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function ye(e) {
|
|
480
480
|
Fe(t.onError, e);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function be(e) {
|
|
483
483
|
let { templates: n } = t;
|
|
484
|
-
return n ||
|
|
484
|
+
return n || ve(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function Y(e) {
|
|
487
487
|
i.template && (i.template = {
|
|
488
488
|
...i.template,
|
|
489
489
|
name: e
|
|
490
|
-
},
|
|
490
|
+
}, A());
|
|
491
491
|
}
|
|
492
|
-
async function
|
|
493
|
-
let n =
|
|
494
|
-
typeof r != "function" &&
|
|
495
|
-
let a, o = ++
|
|
492
|
+
async function xe(e) {
|
|
493
|
+
let n = be("create()"), { create: r } = n;
|
|
494
|
+
typeof r != "function" && ve("create()", "is disabled by the provider — its `create` is `false`.");
|
|
495
|
+
let a, o = ++D;
|
|
496
496
|
i.isLoading = !0;
|
|
497
497
|
try {
|
|
498
498
|
e?.content && (i.content = e.content);
|
|
499
|
-
let t =
|
|
499
|
+
let t = O;
|
|
500
500
|
a = await r(e?.name === void 0 ? { content: i.content } : {
|
|
501
501
|
name: e.name,
|
|
502
502
|
content: i.content
|
|
503
|
-
}), i.template = a,
|
|
503
|
+
}), i.template = a, O === t && (i.isDirty = !1), E.value++;
|
|
504
504
|
} catch (e) {
|
|
505
505
|
throw t.onError?.(e), e;
|
|
506
506
|
} finally {
|
|
507
|
-
|
|
507
|
+
D === o && (i.isLoading = !1);
|
|
508
508
|
}
|
|
509
|
-
return
|
|
509
|
+
return ye(() => n.onCreated?.(a)), a;
|
|
510
510
|
}
|
|
511
|
-
async function
|
|
512
|
-
let r =
|
|
511
|
+
async function X(e, n) {
|
|
512
|
+
let r = be("load()"), a, o = ++D;
|
|
513
513
|
i.isLoading = !0;
|
|
514
514
|
try {
|
|
515
515
|
if (a = await r.load(e), R(a.content), k(a.content), n && !n()) return a;
|
|
516
|
-
i.template = a, i.content = a.content, i.isDirty = !1,
|
|
516
|
+
i.template = a, i.content = a.content, i.isDirty = !1, E.value++;
|
|
517
517
|
} catch (e) {
|
|
518
518
|
throw t.onError?.(e), e;
|
|
519
519
|
} finally {
|
|
520
|
-
|
|
520
|
+
D === o && (i.isLoading = !1);
|
|
521
521
|
}
|
|
522
|
-
return
|
|
522
|
+
return ye(() => r.onLoaded?.(a)), a;
|
|
523
523
|
}
|
|
524
|
-
async function
|
|
525
|
-
let n =
|
|
526
|
-
typeof r != "function" &&
|
|
524
|
+
async function Se(e = "api") {
|
|
525
|
+
let n = be("save()"), { save: r } = n;
|
|
526
|
+
typeof r != "function" && ve("save()", "is disabled by the provider — its `save` is `false`.");
|
|
527
527
|
let a = i.template;
|
|
528
|
-
a ||
|
|
528
|
+
a || ve("save()", "has no template loaded. Call create() or load() first.");
|
|
529
529
|
let o = a.name === void 0 ? { content: i.content } : {
|
|
530
530
|
name: a.name,
|
|
531
531
|
content: i.content
|
|
532
532
|
}, s;
|
|
533
533
|
i.isSaving = !0;
|
|
534
534
|
try {
|
|
535
|
-
let e =
|
|
535
|
+
let e = O;
|
|
536
536
|
if (s = await r(a.id, o), i.template?.id === a.id) {
|
|
537
537
|
let e = i.template.name;
|
|
538
538
|
i.template = e === a.name ? s : {
|
|
@@ -540,22 +540,22 @@ function Ie(t) {
|
|
|
540
540
|
name: e
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
|
|
543
|
+
O === e && (i.isDirty = !1);
|
|
544
544
|
} catch (e) {
|
|
545
545
|
throw t.onError?.(e), e;
|
|
546
546
|
} finally {
|
|
547
547
|
i.isSaving = !1;
|
|
548
548
|
}
|
|
549
|
-
return
|
|
549
|
+
return ye(() => n.onSaved?.(s, { trigger: e })), s;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Ce() {
|
|
552
552
|
return i.template?.id !== void 0;
|
|
553
553
|
}
|
|
554
|
-
let
|
|
554
|
+
let Te = {
|
|
555
555
|
state: e(i),
|
|
556
|
-
loadVersion: e(
|
|
556
|
+
loadVersion: e(E),
|
|
557
557
|
content: ee,
|
|
558
|
-
selectedBlock:
|
|
558
|
+
selectedBlock: F,
|
|
559
559
|
activeLocale: a,
|
|
560
560
|
setActiveLocale: c,
|
|
561
561
|
addLocale: h,
|
|
@@ -565,33 +565,33 @@ function Ie(t) {
|
|
|
565
565
|
keepTranslations: w,
|
|
566
566
|
setCustomBlockDefinitions: u,
|
|
567
567
|
createSetDefaultLocaleOperation: d,
|
|
568
|
-
isBlockLocked:
|
|
568
|
+
isBlockLocked: V,
|
|
569
569
|
setContent: ae,
|
|
570
|
-
selectBlock:
|
|
571
|
-
setViewport:
|
|
572
|
-
setDarkMode:
|
|
573
|
-
setUiTheme:
|
|
574
|
-
setPreviewMode:
|
|
570
|
+
selectBlock: U,
|
|
571
|
+
setViewport: oe,
|
|
572
|
+
setDarkMode: se,
|
|
573
|
+
setUiTheme: W,
|
|
574
|
+
setPreviewMode: ce,
|
|
575
575
|
updateBlock: fe,
|
|
576
|
-
updateSettings:
|
|
577
|
-
addBlock:
|
|
578
|
-
removeBlock:
|
|
579
|
-
moveBlock:
|
|
580
|
-
markDirty:
|
|
581
|
-
findBlockLocation:
|
|
582
|
-
setName:
|
|
583
|
-
create:
|
|
584
|
-
load:
|
|
585
|
-
save:
|
|
586
|
-
hasTemplate:
|
|
576
|
+
updateSettings: q,
|
|
577
|
+
addBlock: me,
|
|
578
|
+
removeBlock: he,
|
|
579
|
+
moveBlock: ge,
|
|
580
|
+
markDirty: _e,
|
|
581
|
+
findBlockLocation: H,
|
|
582
|
+
setName: Y,
|
|
583
|
+
create: xe,
|
|
584
|
+
load: X,
|
|
585
|
+
save: Se,
|
|
586
|
+
hasTemplate: Ce
|
|
587
587
|
};
|
|
588
|
-
return
|
|
588
|
+
return Ne(Te, (e, t) => Ae(e) ? je(J, e, t) : l() ? e === "updateBlock" ? le(t[0], t[1]) : (e === "updateSettings" && pe(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), Te;
|
|
589
589
|
}
|
|
590
590
|
var Le = 50, Re = 300, ze = 1500;
|
|
591
591
|
function Be(e) {
|
|
592
592
|
let { content: t, setContent: n, maxSize: i = Le } = e, a = p([]), o = p([]), s = p(!1), c = null, l = null, u = r(() => a.value.length > 0), d = r(() => o.value.length > 0);
|
|
593
593
|
function f() {
|
|
594
|
-
return
|
|
594
|
+
return G(t.value);
|
|
595
595
|
}
|
|
596
596
|
function m(e) {
|
|
597
597
|
a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
|
|
@@ -651,12 +651,12 @@ function Be(e) {
|
|
|
651
651
|
function Ve(e) {
|
|
652
652
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
653
653
|
function o(n, r, a) {
|
|
654
|
-
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s =
|
|
654
|
+
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = oe(n, o);
|
|
655
655
|
return t(s, r, a), i(s.id), s;
|
|
656
656
|
}
|
|
657
657
|
function s(e, n, r) {
|
|
658
|
-
let o =
|
|
659
|
-
if (!
|
|
658
|
+
let o = F(e);
|
|
659
|
+
if (!Q(t, "duplicateBlock", [
|
|
660
660
|
e,
|
|
661
661
|
n,
|
|
662
662
|
r
|
|
@@ -777,31 +777,31 @@ function Ke(e, t) {
|
|
|
777
777
|
]) {
|
|
778
778
|
let r = e[n];
|
|
779
779
|
r && (Object.assign(e, { [n]: (...i) => {
|
|
780
|
-
|
|
781
|
-
} }),
|
|
780
|
+
Q(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
|
|
781
|
+
} }), Z(r, e[n]));
|
|
782
782
|
}
|
|
783
783
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
784
784
|
e.addBlock = (r, i, a, o) => {
|
|
785
|
-
|
|
785
|
+
Q(e, "addBlock", [
|
|
786
786
|
r,
|
|
787
787
|
i,
|
|
788
788
|
a,
|
|
789
789
|
o
|
|
790
790
|
]) && (t.record(), n(r, i, a, o));
|
|
791
791
|
}, e.removeBlock = (n) => {
|
|
792
|
-
|
|
792
|
+
Q(e, "removeBlock", [n]) && (t.record(), r(n));
|
|
793
793
|
}, e.moveBlock = (n, r, a, o) => {
|
|
794
|
-
|
|
794
|
+
Q(e, "moveBlock", [
|
|
795
795
|
n,
|
|
796
796
|
r,
|
|
797
797
|
a,
|
|
798
798
|
o
|
|
799
799
|
]) && (t.record(), i(n, r, a, o));
|
|
800
|
-
},
|
|
801
|
-
|
|
800
|
+
}, Z(n, e.addBlock), Z(r, e.removeBlock), Z(i, e.moveBlock), e.updateBlock = (n, r) => {
|
|
801
|
+
Q(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
|
|
802
802
|
}, e.updateSettings = (n) => {
|
|
803
|
-
|
|
804
|
-
},
|
|
803
|
+
Q(e, "updateSettings", [n]) && (t.record(), o(n));
|
|
804
|
+
}, Z(a, e.updateBlock), Z(o, e.updateSettings);
|
|
805
805
|
}
|
|
806
806
|
var qe = "root", Je = /* @__PURE__ */ new Set([
|
|
807
807
|
"id",
|
|
@@ -855,7 +855,7 @@ function tt(e) {
|
|
|
855
855
|
}
|
|
856
856
|
function nt(e, t, n) {
|
|
857
857
|
let r = {}, i = [];
|
|
858
|
-
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 ||
|
|
858
|
+
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || L(e[i], t[i]) || (r[i] = G(t[i]));
|
|
859
859
|
for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
|
|
860
860
|
return {
|
|
861
861
|
set: r,
|
|
@@ -874,7 +874,7 @@ function rt(e = {}, t = {}) {
|
|
|
874
874
|
function it(e, t) {
|
|
875
875
|
if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
|
|
876
876
|
op: "setContent",
|
|
877
|
-
content:
|
|
877
|
+
content: G(t)
|
|
878
878
|
}];
|
|
879
879
|
let n = et(e.blocks), r = et(t.blocks), i = [], a = (e) => {
|
|
880
880
|
let t = r.get(e), i = n.get(e);
|
|
@@ -892,8 +892,8 @@ function it(e, t) {
|
|
|
892
892
|
};
|
|
893
893
|
for (let t of e.blocks) u(t, "kept");
|
|
894
894
|
let d = (e) => n.has(e) && !c.has(e), f = (e) => {
|
|
895
|
-
let t =
|
|
896
|
-
return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) =>
|
|
895
|
+
let t = G(e);
|
|
896
|
+
return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => G(e)) : e)), t;
|
|
897
897
|
}, p = (e, t, r) => {
|
|
898
898
|
let a = Qe(e), o = [], s = [];
|
|
899
899
|
t.forEach((e, t) => {
|
|
@@ -1032,32 +1032,32 @@ function ct(e, t, n) {
|
|
|
1032
1032
|
Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
|
|
1033
1033
|
}
|
|
1034
1034
|
function lt(e) {
|
|
1035
|
-
let t =
|
|
1035
|
+
let t = G(e);
|
|
1036
1036
|
return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(lt))), t;
|
|
1037
1037
|
}
|
|
1038
1038
|
function ut(e, t, n, r) {
|
|
1039
|
-
let i =
|
|
1039
|
+
let i = M(e, t), a = G(e), o = G(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
|
|
1040
1040
|
for (let [i, a] of $(n)) c.set(i, {
|
|
1041
|
-
initial:
|
|
1041
|
+
initial: P(a, t, K(e)),
|
|
1042
1042
|
added: r,
|
|
1043
1043
|
changed: !1
|
|
1044
1044
|
});
|
|
1045
1045
|
};
|
|
1046
1046
|
l(i.blocks, !1);
|
|
1047
1047
|
let u = [], d = (e, t, n) => {
|
|
1048
|
-
if (t.some((e) => e?.op === "setDefaultLocale")) throw new
|
|
1049
|
-
if (t.some((e) => e?.op === "setContent")) throw new
|
|
1048
|
+
if (t.some((e) => e?.op === "setDefaultLocale")) throw new V("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
|
|
1049
|
+
if (t.some((e) => e?.op === "setContent")) throw new V("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
|
|
1050
1050
|
try {
|
|
1051
1051
|
return E(e, t);
|
|
1052
1052
|
} catch (e) {
|
|
1053
|
-
throw e instanceof
|
|
1053
|
+
throw e instanceof V ? new V(e.code, n, e.message, e.blockId) : e;
|
|
1054
1054
|
}
|
|
1055
1055
|
}, f = (e, t) => {
|
|
1056
1056
|
a = d(a, e, t), u.push(...e);
|
|
1057
1057
|
}, p = (e, n) => {
|
|
1058
1058
|
let o = c.get(e);
|
|
1059
1059
|
if (!o?.changed) return;
|
|
1060
|
-
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u =
|
|
1060
|
+
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = G(a), d = at(u, ot(u, e).parent), p = G(s);
|
|
1061
1061
|
if (o.added) p = lt(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
|
|
1062
1062
|
else {
|
|
1063
1063
|
let e = p.type === "section" ? {
|
|
@@ -1065,9 +1065,9 @@ function ut(e, t, n, r) {
|
|
|
1065
1065
|
children: p.children,
|
|
1066
1066
|
columns: p.columns
|
|
1067
1067
|
} : l;
|
|
1068
|
-
|
|
1068
|
+
De(p, e, (e) => $(a.blocks).get(e) ?? null), p = j(p);
|
|
1069
1069
|
let n = p.l10n?.[t];
|
|
1070
|
-
ct(p, t,
|
|
1070
|
+
ct(p, t, ke(n, Ee(p, o.initial, n, r), Ee(p, l, n, r), p, l));
|
|
1071
1071
|
}
|
|
1072
1072
|
d[d.findIndex((t) => t.id === e)] = p, f(it(a, u), n), o.changed = !1;
|
|
1073
1073
|
}, m = (e, t, n) => {
|
|
@@ -1088,7 +1088,7 @@ function ut(e, t, n, r) {
|
|
|
1088
1088
|
op: "updateBlock",
|
|
1089
1089
|
blockId: e.blockId,
|
|
1090
1090
|
set: { columns: i.columns },
|
|
1091
|
-
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e,
|
|
1091
|
+
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, N(u, e) ?? null])) } : {}
|
|
1092
1092
|
}], n);
|
|
1093
1093
|
};
|
|
1094
1094
|
n.forEach((e, t) => {
|
|
@@ -1133,8 +1133,8 @@ function ut(e, t, n, r) {
|
|
|
1133
1133
|
});
|
|
1134
1134
|
for (let e of c.keys()) p(e, n.length - 1);
|
|
1135
1135
|
if (s) {
|
|
1136
|
-
let e =
|
|
1137
|
-
ct(e.settings, t,
|
|
1136
|
+
let e = G(a), r = e.settings.l10n?.[t];
|
|
1137
|
+
ct(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
|
|
1138
1138
|
}
|
|
1139
1139
|
return u;
|
|
1140
1140
|
}
|
|
@@ -1190,12 +1190,12 @@ function Ct(e) {
|
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
1192
|
function wt(e) {
|
|
1193
|
-
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, D = null, O = 0,
|
|
1193
|
+
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, D = null, O = 0, k = !1, A = [], j = null, M = null, ee = Promise.resolve(), te = null, ne = r(() => (g.value, (b?.undo.length ?? 0) > 0)), N = r(() => (g.value, (b?.redo.length ?? 0) > 0));
|
|
1194
1194
|
function P(t) {
|
|
1195
1195
|
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
1196
1196
|
}
|
|
1197
1197
|
function F(t, n = b) {
|
|
1198
|
-
n !== b ||
|
|
1198
|
+
n !== b || k || e.onNotice?.(t);
|
|
1199
1199
|
}
|
|
1200
1200
|
function I() {
|
|
1201
1201
|
return {
|
|
@@ -1207,10 +1207,10 @@ function wt(e) {
|
|
|
1207
1207
|
session: n
|
|
1208
1208
|
};
|
|
1209
1209
|
}
|
|
1210
|
-
function
|
|
1210
|
+
function R() {
|
|
1211
1211
|
g.value++;
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function re(e, t) {
|
|
1214
1214
|
e.push(t), e.length > i && e.splice(0, e.length - i);
|
|
1215
1215
|
}
|
|
1216
1216
|
function z(e) {
|
|
@@ -1219,30 +1219,30 @@ function wt(e) {
|
|
|
1219
1219
|
try {
|
|
1220
1220
|
let t = _.content.value, n = it(t, e);
|
|
1221
1221
|
if (n.length > 0) try {
|
|
1222
|
-
|
|
1222
|
+
de(t, n);
|
|
1223
1223
|
} catch {
|
|
1224
|
-
_.setContent(
|
|
1224
|
+
_.setContent(G(e), !1);
|
|
1225
1225
|
}
|
|
1226
|
-
|
|
1226
|
+
L(_.content.value, e) || _.setContent(G(e), !1);
|
|
1227
1227
|
} finally {
|
|
1228
1228
|
C = !1;
|
|
1229
1229
|
}
|
|
1230
1230
|
let t = _.state.selectedBlockId;
|
|
1231
1231
|
t && !xt(e.blocks, t) && _.selectBlock(null);
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function ie() {
|
|
1234
1234
|
C || T || (T = !0, queueMicrotask(() => {
|
|
1235
1235
|
T = !1, H(!1);
|
|
1236
1236
|
}));
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1238
|
+
function B() {
|
|
1239
1239
|
D &&= (clearTimeout(D), null);
|
|
1240
1240
|
}
|
|
1241
1241
|
function H(e, t = !1) {
|
|
1242
1242
|
let n = b;
|
|
1243
1243
|
if (!_ || !n || S || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
|
|
1244
1244
|
let r = it(n.view, _.content.value);
|
|
1245
|
-
if (r.length === 0)
|
|
1245
|
+
if (r.length === 0) B();
|
|
1246
1246
|
else {
|
|
1247
1247
|
if (!e && St(r)) {
|
|
1248
1248
|
let e = Date.now();
|
|
@@ -1253,20 +1253,20 @@ function wt(e) {
|
|
|
1253
1253
|
return;
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
|
-
|
|
1256
|
+
B(), oe(n, r);
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
1259
|
function U() {
|
|
1260
1260
|
H(!0);
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function oe(e, t) {
|
|
1263
1263
|
let n = t, r;
|
|
1264
1264
|
try {
|
|
1265
1265
|
r = E(e.view, n, I());
|
|
1266
1266
|
} catch (n) {
|
|
1267
|
-
if (!(n instanceof
|
|
1267
|
+
if (!(n instanceof V)) throw n;
|
|
1268
1268
|
z(e.view);
|
|
1269
|
-
let r = n.blockId === void 0 ? void 0 :
|
|
1269
|
+
let r = n.blockId === void 0 ? void 0 : ke(n.blockId).find((e) => {
|
|
1270
1270
|
let r = t[n.opIndex];
|
|
1271
1271
|
return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
|
|
1272
1272
|
})?.holder;
|
|
@@ -1278,15 +1278,15 @@ function wt(e) {
|
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
1280
1280
|
let i = _.content.value;
|
|
1281
|
-
if (!
|
|
1281
|
+
if (!L(r, i)) {
|
|
1282
1282
|
P(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
|
|
1283
1283
|
op: "setContent",
|
|
1284
|
-
content:
|
|
1284
|
+
content: G(i)
|
|
1285
1285
|
}];
|
|
1286
1286
|
try {
|
|
1287
1287
|
r = E(e.view, n, I());
|
|
1288
1288
|
} catch (t) {
|
|
1289
|
-
if (!(t instanceof
|
|
1289
|
+
if (!(t instanceof V)) throw t;
|
|
1290
1290
|
z(e.view), F({
|
|
1291
1291
|
type: "editRefused",
|
|
1292
1292
|
code: t.code
|
|
@@ -1294,12 +1294,12 @@ function wt(e) {
|
|
|
1294
1294
|
return;
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
|
-
let a = _t({ ops:
|
|
1298
|
-
|
|
1297
|
+
let a = _t({ ops: ae(e.view, n) }, r);
|
|
1298
|
+
re(e.undo, a), e.redo = [], R();
|
|
1299
1299
|
let o = e.view;
|
|
1300
|
-
e.view = r,
|
|
1300
|
+
e.view = r, se(e, n, "edit", a, o);
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1302
|
+
function se(e, t, n, r, i) {
|
|
1303
1303
|
let a = { dropped: !1 }, o = 0, s = i;
|
|
1304
1304
|
do {
|
|
1305
1305
|
let i = t.slice(o, o + ht);
|
|
@@ -1318,12 +1318,12 @@ function wt(e) {
|
|
|
1318
1318
|
s = null;
|
|
1319
1319
|
}
|
|
1320
1320
|
} while (o < t.length);
|
|
1321
|
-
|
|
1321
|
+
W(e);
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function W(e) {
|
|
1324
1324
|
if (e.inFlight || w) return;
|
|
1325
1325
|
let t = e.pending.find((e) => !e.sent);
|
|
1326
|
-
t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) :
|
|
1326
|
+
t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : q(e);
|
|
1327
1327
|
}
|
|
1328
1328
|
function ce(e, n, r) {
|
|
1329
1329
|
t.submit(e.templateId, {
|
|
@@ -1332,39 +1332,39 @@ function wt(e) {
|
|
|
1332
1332
|
ops: n.ops,
|
|
1333
1333
|
...n.origin === "ai" ? { origin: "ai" } : {}
|
|
1334
1334
|
}).then(({ revision: t }) => {
|
|
1335
|
-
e.inFlight = null, le(e, n, t),
|
|
1335
|
+
e.inFlight = null, le(e, n, t), W(e);
|
|
1336
1336
|
}, (t) => {
|
|
1337
|
-
if (vt(t) !== null) e.inFlight = null,
|
|
1337
|
+
if (vt(t) !== null) e.inFlight = null, pe(e, n, t), W(e);
|
|
1338
1338
|
else if (bt(t)) {
|
|
1339
|
-
|
|
1339
|
+
J(e, t);
|
|
1340
1340
|
let i = pt[Math.min(r, pt.length - 1)];
|
|
1341
1341
|
setTimeout(() => {
|
|
1342
|
-
|
|
1342
|
+
k || ce(e, n, r + 1);
|
|
1343
1343
|
}, i);
|
|
1344
|
-
} else e.inFlight = null, P(t),
|
|
1344
|
+
} else e.inFlight = null, P(t), pe(e, n, t), W(e);
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
1347
|
function le(e, t, n) {
|
|
1348
|
-
t.revision === null && (t.revision = n, n <= e.revision ? (
|
|
1348
|
+
t.revision === null && (t.revision = n, n <= e.revision ? (K(e, t), _e(e)) : (e.own.set(n, t), ge(e)));
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1351
|
-
e.pending = e.pending.filter((e) => e !== t),
|
|
1350
|
+
function K(e, t) {
|
|
1351
|
+
e.pending = e.pending.filter((e) => e !== t), q(e);
|
|
1352
1352
|
}
|
|
1353
|
-
function
|
|
1353
|
+
function ue(e, t) {
|
|
1354
1354
|
if (t.entry) {
|
|
1355
1355
|
for (let n of [e.undo, e.redo]) {
|
|
1356
1356
|
let e = n.indexOf(t.entry);
|
|
1357
1357
|
e !== -1 && n.splice(e, 1);
|
|
1358
1358
|
}
|
|
1359
|
-
|
|
1359
|
+
R();
|
|
1360
1360
|
}
|
|
1361
1361
|
}
|
|
1362
1362
|
function fe(e, t) {
|
|
1363
1363
|
let n = !t.group.dropped;
|
|
1364
|
-
return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n &&
|
|
1364
|
+
return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && ue(e, t), q(e), n;
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1367
|
-
if (
|
|
1366
|
+
function pe(e, t, n) {
|
|
1367
|
+
if (K(e, t), fe(e, t)) {
|
|
1368
1368
|
let r = vt(n) ?? "invalid_operation";
|
|
1369
1369
|
if (t.origin === "edit" || t.origin === "ai") {
|
|
1370
1370
|
let t = yt(n);
|
|
@@ -1378,21 +1378,21 @@ function wt(e) {
|
|
|
1378
1378
|
code: r
|
|
1379
1379
|
}, e);
|
|
1380
1380
|
}
|
|
1381
|
-
|
|
1381
|
+
_e(e), e === b && Y();
|
|
1382
1382
|
}
|
|
1383
|
-
function
|
|
1383
|
+
function q(e) {
|
|
1384
1384
|
if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function J(e, t) {
|
|
1387
1387
|
let n = t instanceof Error ? t : Error(String(t));
|
|
1388
1388
|
for (let t of e.waiters.splice(0)) t.reject(n);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function me(e, t) {
|
|
1391
1391
|
if (t.revision <= e.revision) return;
|
|
1392
1392
|
let n = e.pending.find((e) => e.batchId === t.batchId);
|
|
1393
|
-
n ? le(e, n, t.revision) : (e.remote.set(t.revision, t),
|
|
1393
|
+
n ? le(e, n, t.revision) : (e.remote.set(t.revision, t), ge(e));
|
|
1394
1394
|
}
|
|
1395
|
-
function
|
|
1395
|
+
function he(t, n) {
|
|
1396
1396
|
let r = n.ops;
|
|
1397
1397
|
if (e.normalizeRemoteOperations) try {
|
|
1398
1398
|
r = e.normalizeRemoteOperations(n.ops, t.confirmed);
|
|
@@ -1401,24 +1401,24 @@ function wt(e) {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
return Ct(r);
|
|
1403
1403
|
}
|
|
1404
|
-
function
|
|
1404
|
+
function ge(t) {
|
|
1405
1405
|
let n = [], r = !1;
|
|
1406
1406
|
for (;;) {
|
|
1407
1407
|
let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
|
|
1408
1408
|
if (!i && !a) break;
|
|
1409
1409
|
try {
|
|
1410
|
-
t.confirmed = E(t.confirmed, i ?
|
|
1410
|
+
t.confirmed = E(t.confirmed, i ? he(t, i) : a.ops);
|
|
1411
1411
|
} catch {
|
|
1412
1412
|
if (t.recovering) {
|
|
1413
1413
|
t.remote.clear(), t.own.clear(), P(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
|
|
1414
1414
|
return;
|
|
1415
1415
|
}
|
|
1416
|
-
|
|
1416
|
+
xe(t);
|
|
1417
1417
|
return;
|
|
1418
1418
|
}
|
|
1419
|
-
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0),
|
|
1419
|
+
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), K(t, a));
|
|
1420
1420
|
}
|
|
1421
|
-
if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ?
|
|
1421
|
+
if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? ye(t) : be(t), (n.length !== 0 || r) && (_e(t), t === b)) for (let t of n) try {
|
|
1422
1422
|
e.onRemoteChange?.({
|
|
1423
1423
|
actor: t.actor,
|
|
1424
1424
|
ops: t.ops,
|
|
@@ -1428,27 +1428,27 @@ function wt(e) {
|
|
|
1428
1428
|
P(e);
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
|
-
function
|
|
1431
|
+
function _e(e) {
|
|
1432
1432
|
let t = !w;
|
|
1433
1433
|
w = !0;
|
|
1434
1434
|
try {
|
|
1435
|
-
|
|
1435
|
+
ve(e);
|
|
1436
1436
|
} finally {
|
|
1437
1437
|
t && (w = !1);
|
|
1438
1438
|
}
|
|
1439
|
-
t &&
|
|
1439
|
+
t && W(e);
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function ve(e) {
|
|
1442
1442
|
e === b && U();
|
|
1443
1443
|
let t = e.confirmed;
|
|
1444
1444
|
for (let n = 0; n < e.pending.length; n++) {
|
|
1445
1445
|
let r = e.pending[n], i;
|
|
1446
|
-
if (r.base && !
|
|
1446
|
+
if (r.base && !L(r.base, t)) i = "precondition_failed";
|
|
1447
1447
|
else try {
|
|
1448
1448
|
t = E(t, r.ops);
|
|
1449
1449
|
continue;
|
|
1450
1450
|
} catch (e) {
|
|
1451
|
-
i = e instanceof
|
|
1451
|
+
i = e instanceof V ? e.code : "invalid_operation";
|
|
1452
1452
|
}
|
|
1453
1453
|
r.sent || (fe(e, r) && F(r.origin === "edit" || r.origin === "ai" ? {
|
|
1454
1454
|
type: "editRefused",
|
|
@@ -1458,27 +1458,27 @@ function wt(e) {
|
|
|
1458
1458
|
code: i
|
|
1459
1459
|
}, e), t = e.confirmed, n = -1);
|
|
1460
1460
|
}
|
|
1461
|
-
e.view = t,
|
|
1461
|
+
e.view = t, q(e), e === b && z(t);
|
|
1462
1462
|
}
|
|
1463
|
-
function
|
|
1463
|
+
function ye(e) {
|
|
1464
1464
|
e.gapTimer ||= setTimeout(() => {
|
|
1465
|
-
e.gapTimer = null, e === b &&
|
|
1465
|
+
e.gapTimer = null, e === b && Y();
|
|
1466
1466
|
}, dt);
|
|
1467
1467
|
}
|
|
1468
|
-
function
|
|
1468
|
+
function be(e) {
|
|
1469
1469
|
e.gapTimer &&= (clearTimeout(e.gapTimer), null);
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1471
|
+
function Y() {
|
|
1472
1472
|
let e = b;
|
|
1473
1473
|
return e ? (e.catchingUp ||= (async () => {
|
|
1474
1474
|
try {
|
|
1475
1475
|
let n = await t.operationsAfter(e.templateId, e.revision);
|
|
1476
1476
|
if (e.retired) return;
|
|
1477
1477
|
if ("resync" in n) {
|
|
1478
|
-
await
|
|
1478
|
+
await xe(e);
|
|
1479
1479
|
return;
|
|
1480
1480
|
}
|
|
1481
|
-
for (let t of n.batches)
|
|
1481
|
+
for (let t of n.batches) me(e, t);
|
|
1482
1482
|
} catch (e) {
|
|
1483
1483
|
P(e);
|
|
1484
1484
|
} finally {
|
|
@@ -1486,26 +1486,26 @@ function wt(e) {
|
|
|
1486
1486
|
}
|
|
1487
1487
|
})(), e.catchingUp) : Promise.resolve();
|
|
1488
1488
|
}
|
|
1489
|
-
async function
|
|
1489
|
+
async function xe(t) {
|
|
1490
1490
|
t.recovering = !0;
|
|
1491
1491
|
try {
|
|
1492
1492
|
let n = await e.loadTemplate(t.templateId);
|
|
1493
1493
|
if (t.retired) return;
|
|
1494
1494
|
let r = n.revision ?? t.revision;
|
|
1495
|
-
t.confirmed =
|
|
1496
|
-
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e),
|
|
1497
|
-
t === b && (h.value = r),
|
|
1495
|
+
t.confirmed = G(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
|
|
1496
|
+
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), K(t, n));
|
|
1497
|
+
t === b && (h.value = r), _e(t), ge(t);
|
|
1498
1498
|
} catch (e) {
|
|
1499
1499
|
P(e);
|
|
1500
1500
|
} finally {
|
|
1501
1501
|
t.recovering = !1;
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
1504
|
-
function
|
|
1504
|
+
function X(t) {
|
|
1505
1505
|
let n = () => t === b && !t.retired;
|
|
1506
1506
|
return {
|
|
1507
1507
|
onBatch: (e) => {
|
|
1508
|
-
n() &&
|
|
1508
|
+
n() && me(t, e);
|
|
1509
1509
|
},
|
|
1510
1510
|
onResync: (r, i) => {
|
|
1511
1511
|
if (!(!n() || r <= t.revision)) {
|
|
@@ -1517,36 +1517,36 @@ function wt(e) {
|
|
|
1517
1517
|
} catch (e) {
|
|
1518
1518
|
P(e);
|
|
1519
1519
|
}
|
|
1520
|
-
|
|
1520
|
+
Y();
|
|
1521
1521
|
}
|
|
1522
1522
|
},
|
|
1523
1523
|
onLock: (e) => {
|
|
1524
|
-
n() &&
|
|
1524
|
+
n() && je(e);
|
|
1525
1525
|
},
|
|
1526
1526
|
onUnlock: (e, t, r) => {
|
|
1527
|
-
n() &&
|
|
1527
|
+
n() && Me(e, t, r);
|
|
1528
1528
|
},
|
|
1529
1529
|
onMembers: (e) => {
|
|
1530
|
-
n() &&
|
|
1530
|
+
n() && Z(e);
|
|
1531
1531
|
},
|
|
1532
1532
|
onConnectionChange: (e) => {
|
|
1533
|
-
n() &&
|
|
1533
|
+
n() && Te(t, e);
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1537
|
+
function Se(e, r) {
|
|
1538
1538
|
let i = d;
|
|
1539
|
-
t.join(e.templateId, { sessionId: n },
|
|
1540
|
-
e.retired || e !== b ? r || t.leave() : (e.leave = t.leave,
|
|
1539
|
+
t.join(e.templateId, { sessionId: n }, X(e)).then((t) => {
|
|
1540
|
+
e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && Y(), r && Pe());
|
|
1541
1541
|
}, (e) => P(e));
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1544
|
-
let t =
|
|
1543
|
+
function Ce(e) {
|
|
1544
|
+
let t = G(e.content), n = {
|
|
1545
1545
|
templateId: e.id,
|
|
1546
1546
|
confirmed: t,
|
|
1547
1547
|
revision: e.revision ?? 0,
|
|
1548
1548
|
pending: [],
|
|
1549
|
-
view:
|
|
1549
|
+
view: G(t),
|
|
1550
1550
|
remote: /* @__PURE__ */ new Map(),
|
|
1551
1551
|
own: /* @__PURE__ */ new Map(),
|
|
1552
1552
|
inFlight: null,
|
|
@@ -1559,108 +1559,108 @@ function wt(e) {
|
|
|
1559
1559
|
redo: [],
|
|
1560
1560
|
waiters: []
|
|
1561
1561
|
};
|
|
1562
|
-
b = n, h.value = n.revision,
|
|
1562
|
+
b = n, h.value = n.revision, R(), Se(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), ie();
|
|
1563
1563
|
}
|
|
1564
|
-
function
|
|
1565
|
-
e.retired = !0,
|
|
1564
|
+
function we(e) {
|
|
1565
|
+
e.retired = !0, be(e), e.leave?.(), e.leave = null, J(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function Te(e, t) {
|
|
1568
1568
|
let n = m.value;
|
|
1569
|
-
m.value = t, t === "connected" && n !== null && n !== "connected" &&
|
|
1569
|
+
m.value = t, t === "connected" && n !== null && n !== "connected" && Se(e, !0);
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1572
|
-
b && b.templateId === e?.id || (b &&= (
|
|
1571
|
+
function Ee(e) {
|
|
1572
|
+
b && b.templateId === e?.id || (b &&= (B(), we(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, j = null, Pe(), R(), e && Ce(e));
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1574
|
+
function De(e, t) {
|
|
1575
1575
|
return `${e}\u0000${t ?? ""}`;
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function Oe(e, t, n) {
|
|
1578
1578
|
return e.blockId === t && (n == null || e.locale == null || e.locale === n);
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function ke(e) {
|
|
1581
1581
|
return [...s.value.values()].filter((t) => t.blockId === e);
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1583
|
+
function Ae(e) {
|
|
1584
1584
|
e !== f.value && (U(), f.value = e, ze(_?.state.selectedBlockId ?? null));
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function je(e, t = !1) {
|
|
1587
1587
|
if (e.holder.sessionId === n) return;
|
|
1588
1588
|
t ? c.add(e) : u.set(e, ++d);
|
|
1589
1589
|
let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
|
|
1590
|
-
r.set(
|
|
1590
|
+
r.set(De(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), F({
|
|
1591
1591
|
type: "selectionRefused",
|
|
1592
1592
|
blockId: e.blockId,
|
|
1593
1593
|
holder: e.holder
|
|
1594
1594
|
}));
|
|
1595
1595
|
}
|
|
1596
|
-
function
|
|
1597
|
-
let r =
|
|
1596
|
+
function Me(e, t, n) {
|
|
1597
|
+
let r = De(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && c.has(i))));
|
|
1598
1598
|
i.size !== s.value.size && (s.value = i);
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1600
|
+
function Ne(e, t, r) {
|
|
1601
1601
|
let i = new Map([...s.value].filter(([, e]) => !c.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
|
|
1602
|
-
for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId ||
|
|
1602
|
+
for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Oe(e, t.blockId, t.locale))) {
|
|
1603
1603
|
for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
|
|
1604
|
-
i.set(
|
|
1604
|
+
i.set(De(t.blockId, t.locale), t);
|
|
1605
1605
|
}
|
|
1606
1606
|
s.value = i;
|
|
1607
1607
|
}
|
|
1608
|
-
function
|
|
1608
|
+
function Z(e) {
|
|
1609
1609
|
let t = new Set(e.map((e) => e.sessionId)), n = new Set(o.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
|
|
1610
1610
|
if (o.value = e, n.size === 0) return;
|
|
1611
1611
|
let r = new Map([...s.value].filter(([, e]) => !n.has(e.holder.sessionId)));
|
|
1612
1612
|
r.size !== s.value.size && (s.value = r);
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1615
|
-
|
|
1614
|
+
function Q(e) {
|
|
1615
|
+
ee = ee.then(e).catch(P);
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1618
|
-
a &&
|
|
1619
|
-
if (
|
|
1620
|
-
let e =
|
|
1621
|
-
|
|
1617
|
+
function Pe() {
|
|
1618
|
+
a && Q(async () => {
|
|
1619
|
+
if (M && (j === null || M.templateId !== j.templateId || M.locale !== j.locale)) {
|
|
1620
|
+
let e = M;
|
|
1621
|
+
M = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
|
|
1622
1622
|
}
|
|
1623
|
-
let e =
|
|
1624
|
-
if (!(!e ||
|
|
1623
|
+
let e = j;
|
|
1624
|
+
if (!(!e || M?.templateId === e.templateId && M.blockId === e.blockId && M.locale === e.locale)) try {
|
|
1625
1625
|
let n = await t.acquireLock(e.templateId, e.blockId, e.locale);
|
|
1626
|
-
|
|
1626
|
+
M = e, Le(), Fe(n.blockId, n.locale ?? null);
|
|
1627
1627
|
} catch (n) {
|
|
1628
|
-
if (
|
|
1629
|
-
let e =
|
|
1630
|
-
|
|
1628
|
+
if (M?.templateId === e.templateId) {
|
|
1629
|
+
let e = M;
|
|
1630
|
+
M = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
|
|
1631
1631
|
}
|
|
1632
|
-
if (
|
|
1632
|
+
if (j !== e) return;
|
|
1633
1633
|
Ie(e.blockId, n);
|
|
1634
1634
|
}
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
1637
|
function Fe(e, t) {
|
|
1638
|
-
let n = new Map([...s.value].filter(([, n]) => !
|
|
1638
|
+
let n = new Map([...s.value].filter(([, n]) => !Oe(n, e, t)));
|
|
1639
1639
|
n.size !== s.value.size && (s.value = n);
|
|
1640
1640
|
}
|
|
1641
1641
|
function Ie(e, t) {
|
|
1642
1642
|
let n = vt(t);
|
|
1643
1643
|
if (n === "lock_held" || n === "block_missing") {
|
|
1644
|
-
|
|
1644
|
+
j = null;
|
|
1645
1645
|
let n = yt(t);
|
|
1646
|
-
n ?
|
|
1646
|
+
n ? je({
|
|
1647
1647
|
blockId: e,
|
|
1648
1648
|
holder: n,
|
|
1649
1649
|
expiresAt: ""
|
|
1650
1650
|
}, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
|
|
1651
1651
|
} else P(t), setTimeout(() => {
|
|
1652
|
-
|
|
1652
|
+
j?.blockId === e && Pe();
|
|
1653
1653
|
}, pt[0]);
|
|
1654
1654
|
}
|
|
1655
1655
|
function Le() {
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
let e =
|
|
1656
|
+
te ||= setInterval(() => {
|
|
1657
|
+
Q(async () => {
|
|
1658
|
+
let e = M;
|
|
1659
1659
|
if (e) try {
|
|
1660
1660
|
await t.renewLock(e.templateId, e.blockId, e.locale);
|
|
1661
1661
|
} catch (e) {
|
|
1662
1662
|
if (vt(e) === "lock_lost") {
|
|
1663
|
-
|
|
1663
|
+
M = null, Re(), Pe();
|
|
1664
1664
|
return;
|
|
1665
1665
|
}
|
|
1666
1666
|
P(e);
|
|
@@ -1669,17 +1669,17 @@ function wt(e) {
|
|
|
1669
1669
|
}, ft);
|
|
1670
1670
|
}
|
|
1671
1671
|
function Re() {
|
|
1672
|
-
|
|
1672
|
+
te &&= (clearInterval(te), null);
|
|
1673
1673
|
}
|
|
1674
1674
|
function ze(e) {
|
|
1675
|
-
U(), b && (
|
|
1675
|
+
U(), b && (j = e ? {
|
|
1676
1676
|
templateId: b.templateId,
|
|
1677
1677
|
blockId: e,
|
|
1678
1678
|
locale: f.value
|
|
1679
|
-
} : null,
|
|
1679
|
+
} : null, Pe());
|
|
1680
1680
|
}
|
|
1681
1681
|
function Be() {
|
|
1682
|
-
U(),
|
|
1682
|
+
U(), M && a && (t.releaseLock(M.templateId, M.blockId, M.locale).catch(() => {}), M = null, Re()), b?.leave?.(), b && (b.leave = null);
|
|
1683
1683
|
}
|
|
1684
1684
|
function Ve(e) {
|
|
1685
1685
|
let t = b;
|
|
@@ -1687,7 +1687,7 @@ function wt(e) {
|
|
|
1687
1687
|
U();
|
|
1688
1688
|
let n = (e === "undo" ? t.undo : t.redo).pop();
|
|
1689
1689
|
if (!n) return;
|
|
1690
|
-
if (
|
|
1690
|
+
if (R(), n.view && !L(n.view, t.view)) {
|
|
1691
1691
|
F({
|
|
1692
1692
|
type: "undoSkipped",
|
|
1693
1693
|
code: "precondition_failed"
|
|
@@ -1698,28 +1698,28 @@ function wt(e) {
|
|
|
1698
1698
|
try {
|
|
1699
1699
|
r = E(t.view, n.ops, I());
|
|
1700
1700
|
} catch (e) {
|
|
1701
|
-
if (!(e instanceof
|
|
1701
|
+
if (!(e instanceof V)) throw e;
|
|
1702
1702
|
F({
|
|
1703
1703
|
type: "undoSkipped",
|
|
1704
1704
|
code: e.code
|
|
1705
1705
|
});
|
|
1706
1706
|
return;
|
|
1707
1707
|
}
|
|
1708
|
-
let i = _t({ ops:
|
|
1709
|
-
|
|
1708
|
+
let i = _t({ ops: ae(t.view, n.ops) }, r);
|
|
1709
|
+
re(e === "undo" ? t.redo : t.undo, i);
|
|
1710
1710
|
let a = t.view;
|
|
1711
|
-
t.view = r, z(r), _?.markDirty(),
|
|
1711
|
+
t.view = r, z(r), _?.markDirty(), se(t, n.ops, e, i, a);
|
|
1712
1712
|
}
|
|
1713
1713
|
function He(e, t) {
|
|
1714
1714
|
let n = b;
|
|
1715
1715
|
if (!_ || !n || S) return {
|
|
1716
1716
|
applied: !1,
|
|
1717
|
-
error: new
|
|
1717
|
+
error: new V("invalid_operation", 0, "No template is open for editing.")
|
|
1718
1718
|
};
|
|
1719
1719
|
if (t.origin === void 0) try {
|
|
1720
1720
|
E(_.content.value, e, I());
|
|
1721
1721
|
} catch (e) {
|
|
1722
|
-
if (e instanceof
|
|
1722
|
+
if (e instanceof V) return {
|
|
1723
1723
|
applied: !1,
|
|
1724
1724
|
error: e
|
|
1725
1725
|
};
|
|
@@ -1728,9 +1728,9 @@ function wt(e) {
|
|
|
1728
1728
|
U();
|
|
1729
1729
|
let r, i;
|
|
1730
1730
|
try {
|
|
1731
|
-
r = E(n.view, e, I()), i =
|
|
1731
|
+
r = E(n.view, e, I()), i = ae(n.view, e);
|
|
1732
1732
|
} catch (e) {
|
|
1733
|
-
if (e instanceof
|
|
1733
|
+
if (e instanceof V) return {
|
|
1734
1734
|
applied: !1,
|
|
1735
1735
|
error: e
|
|
1736
1736
|
};
|
|
@@ -1738,15 +1738,15 @@ function wt(e) {
|
|
|
1738
1738
|
}
|
|
1739
1739
|
let a = n.undo.at(-1), o;
|
|
1740
1740
|
if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
|
|
1741
|
-
let e = a.view !== void 0 && !
|
|
1741
|
+
let e = a.view !== void 0 && !L(a.view, n.view);
|
|
1742
1742
|
a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
|
|
1743
1743
|
} else o = _t({
|
|
1744
1744
|
ops: i,
|
|
1745
1745
|
...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
|
|
1746
|
-
}, r),
|
|
1747
|
-
n.redo = [],
|
|
1746
|
+
}, r), re(n.undo, o);
|
|
1747
|
+
n.redo = [], R();
|
|
1748
1748
|
let s = n.view;
|
|
1749
|
-
return n.view = r, z(r), _.markDirty(),
|
|
1749
|
+
return n.view = r, z(r), _.markDirty(), se(n, e, t.origin ?? "edit", o, s), {
|
|
1750
1750
|
applied: !0,
|
|
1751
1751
|
inverse: i
|
|
1752
1752
|
};
|
|
@@ -1757,25 +1757,25 @@ function wt(e) {
|
|
|
1757
1757
|
if (t.moveBlock && t.findBlockLocation) {
|
|
1758
1758
|
let n = t.moveBlock, r = (...r) => {
|
|
1759
1759
|
let i = b, a = i && !S && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
|
|
1760
|
-
if (a && H(!0), n(...r), !a ||
|
|
1760
|
+
if (a && H(!0), n(...r), !a || L(i.view, e.content.value)) return;
|
|
1761
1761
|
let o = t.findBlockLocation(r[0]);
|
|
1762
1762
|
if (!o) return;
|
|
1763
1763
|
let s = o.targetSectionId ? {
|
|
1764
1764
|
sectionId: o.targetSectionId,
|
|
1765
1765
|
column: o.columnIndex ?? 0
|
|
1766
1766
|
} : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0, l = s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks;
|
|
1767
|
-
|
|
1767
|
+
oe(i, [{
|
|
1768
1768
|
op: "moveBlock",
|
|
1769
1769
|
blockId: r[0],
|
|
1770
1770
|
parent: s,
|
|
1771
1771
|
after: l[o.index - 1]?.id ?? null
|
|
1772
1772
|
}]);
|
|
1773
1773
|
};
|
|
1774
|
-
t.moveBlock = r,
|
|
1774
|
+
t.moveBlock = r, A.push(() => {
|
|
1775
1775
|
t.moveBlock === r && (t.moveBlock = n);
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
|
-
|
|
1778
|
+
A.push(v(() => e.state.template, (e) => Ee(e), { immediate: !0 }), v(() => e.content.value, ie, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? H(!0, !0) : ie())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", U)), x() && l(qe);
|
|
1779
1779
|
}
|
|
1780
1780
|
function We() {
|
|
1781
1781
|
U();
|
|
@@ -1792,34 +1792,34 @@ function wt(e) {
|
|
|
1792
1792
|
S = !1, b && z(b.view);
|
|
1793
1793
|
}
|
|
1794
1794
|
function qe() {
|
|
1795
|
-
if (!
|
|
1795
|
+
if (!k) {
|
|
1796
1796
|
U();
|
|
1797
|
-
for (let e of
|
|
1798
|
-
|
|
1797
|
+
for (let e of A.splice(0)) e();
|
|
1798
|
+
B(), Be(), k = !0, b && we(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", U));
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
1801
1801
|
return {
|
|
1802
1802
|
sessionId: n,
|
|
1803
1803
|
members: o,
|
|
1804
1804
|
locks: s,
|
|
1805
|
-
locksOf:
|
|
1805
|
+
locksOf: ke,
|
|
1806
1806
|
lockLocale: f,
|
|
1807
|
-
setLockLocale:
|
|
1807
|
+
setLockLocale: Ae,
|
|
1808
1808
|
connection: m,
|
|
1809
1809
|
revision: h,
|
|
1810
|
-
canUndo:
|
|
1811
|
-
canRedo:
|
|
1810
|
+
canUndo: ne,
|
|
1811
|
+
canRedo: N,
|
|
1812
1812
|
attach: Ue,
|
|
1813
1813
|
undo: () => Ve("undo"),
|
|
1814
1814
|
redo: () => Ve("redo"),
|
|
1815
1815
|
clearHistory: () => {
|
|
1816
|
-
b && (b.undo = [], b.redo = [],
|
|
1816
|
+
b && (b.undo = [], b.redo = [], R());
|
|
1817
1817
|
},
|
|
1818
1818
|
flush: U,
|
|
1819
1819
|
settle: We,
|
|
1820
1820
|
suspend: Ge,
|
|
1821
1821
|
resume: Ke,
|
|
1822
|
-
catchUp:
|
|
1822
|
+
catchUp: Y,
|
|
1823
1823
|
hasConfirmedBlock: (e) => b ? xt(b.confirmed.blocks, e) : !1,
|
|
1824
1824
|
applyOperations: He,
|
|
1825
1825
|
destroy: qe
|
|
@@ -1841,7 +1841,7 @@ function Tt(e) {
|
|
|
1841
1841
|
return s.value && e.canDelete !== !1;
|
|
1842
1842
|
}
|
|
1843
1843
|
function u(e, t) {
|
|
1844
|
-
throw new
|
|
1844
|
+
throw new z(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1845
1845
|
}
|
|
1846
1846
|
function f(t) {
|
|
1847
1847
|
Fe(e.onError, t);
|
|
@@ -1938,7 +1938,7 @@ function Dt(e = {}) {
|
|
|
1938
1938
|
},
|
|
1939
1939
|
async create(e) {
|
|
1940
1940
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1941
|
-
id:
|
|
1941
|
+
id: le(),
|
|
1942
1942
|
name: e.name,
|
|
1943
1943
|
content: e.content,
|
|
1944
1944
|
...e.category ? { category: e.category } : {},
|
|
@@ -2004,7 +2004,7 @@ function At(e = {}) {
|
|
|
2004
2004
|
},
|
|
2005
2005
|
async create(e) {
|
|
2006
2006
|
let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
2007
|
-
id:
|
|
2007
|
+
id: le(),
|
|
2008
2008
|
url: t,
|
|
2009
2009
|
filename: e.filename || e.file.name,
|
|
2010
2010
|
createdAt: n,
|
|
@@ -2043,11 +2043,11 @@ function jt(e) {
|
|
|
2043
2043
|
let { provider: t, getTemplateId: n } = e, r = p([]), i = p(!1), a = p(void 0), o = p(!1), s = /* @__PURE__ */ new Map(), c = d(() => typeof t.create == "function"), l = d(() => typeof t.restore == "function");
|
|
2044
2044
|
function u(e) {
|
|
2045
2045
|
let t = n();
|
|
2046
|
-
if (!t) throw new
|
|
2046
|
+
if (!t) throw new z(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
2047
2047
|
return t;
|
|
2048
2048
|
}
|
|
2049
2049
|
function f(e) {
|
|
2050
|
-
throw new
|
|
2050
|
+
throw new z(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2051
2051
|
}
|
|
2052
2052
|
function m(t) {
|
|
2053
2053
|
Fe(e.onError, t);
|
|
@@ -2125,16 +2125,16 @@ function Mt(e) {
|
|
|
2125
2125
|
});
|
|
2126
2126
|
function g(e) {
|
|
2127
2127
|
let t = n();
|
|
2128
|
-
if (!t) throw new
|
|
2128
|
+
if (!t) throw new z(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
2129
2129
|
return t;
|
|
2130
2130
|
}
|
|
2131
2131
|
function _(e) {
|
|
2132
2132
|
let t = r();
|
|
2133
|
-
if (!t) throw new
|
|
2133
|
+
if (!t) throw new z(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
2134
2134
|
return t;
|
|
2135
2135
|
}
|
|
2136
2136
|
function v(e) {
|
|
2137
|
-
throw new
|
|
2137
|
+
throw new z(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2138
2138
|
}
|
|
2139
2139
|
function y(e) {
|
|
2140
2140
|
for (let t of i.value) {
|
|
@@ -2148,7 +2148,7 @@ function Mt(e) {
|
|
|
2148
2148
|
return t !== null && e.author.id === t.id;
|
|
2149
2149
|
}
|
|
2150
2150
|
function x(t) {
|
|
2151
|
-
let n =
|
|
2151
|
+
let n = Pe(t);
|
|
2152
2152
|
throw e.onError?.(n), n;
|
|
2153
2153
|
}
|
|
2154
2154
|
function S(t) {
|
|
@@ -2216,7 +2216,7 @@ function Mt(e) {
|
|
|
2216
2216
|
o.value = !1;
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
2219
|
-
async function
|
|
2219
|
+
async function k(e, n) {
|
|
2220
2220
|
let { update: r } = t;
|
|
2221
2221
|
typeof r != "function" && v("update");
|
|
2222
2222
|
let i = g("update");
|
|
@@ -2230,7 +2230,7 @@ function Mt(e) {
|
|
|
2230
2230
|
o.value = !1;
|
|
2231
2231
|
}
|
|
2232
2232
|
}
|
|
2233
|
-
async function
|
|
2233
|
+
async function A(e) {
|
|
2234
2234
|
let { delete: n } = t;
|
|
2235
2235
|
typeof n != "function" && v("delete");
|
|
2236
2236
|
let r = g("delete");
|
|
@@ -2245,7 +2245,7 @@ function Mt(e) {
|
|
|
2245
2245
|
o.value = !1;
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
|
-
async function
|
|
2248
|
+
async function j(e, n) {
|
|
2249
2249
|
let { setResolved: r } = t;
|
|
2250
2250
|
typeof r != "function" && v("setResolved");
|
|
2251
2251
|
let i = g("setResolved");
|
|
@@ -2259,13 +2259,13 @@ function Mt(e) {
|
|
|
2259
2259
|
o.value = !1;
|
|
2260
2260
|
}
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2262
|
+
function M(e) {
|
|
2263
2263
|
T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
|
|
2264
2264
|
}
|
|
2265
|
-
function
|
|
2265
|
+
function ee(e) {
|
|
2266
2266
|
T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
2267
2267
|
}
|
|
2268
|
-
function
|
|
2268
|
+
function te(e, n) {
|
|
2269
2269
|
let r = E(e, n);
|
|
2270
2270
|
r && S(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
2271
2271
|
}
|
|
@@ -2282,14 +2282,14 @@ function Mt(e) {
|
|
|
2282
2282
|
commentCountByBlock: h,
|
|
2283
2283
|
load: D,
|
|
2284
2284
|
create: O,
|
|
2285
|
-
update:
|
|
2286
|
-
remove:
|
|
2287
|
-
setResolved:
|
|
2285
|
+
update: k,
|
|
2286
|
+
remove: A,
|
|
2287
|
+
setResolved: j,
|
|
2288
2288
|
find: y,
|
|
2289
2289
|
isOwn: b,
|
|
2290
|
-
applyRemoteCreate:
|
|
2291
|
-
applyRemoteUpdate:
|
|
2292
|
-
applyRemoteDelete:
|
|
2290
|
+
applyRemoteCreate: M,
|
|
2291
|
+
applyRemoteUpdate: ee,
|
|
2292
|
+
applyRemoteDelete: te
|
|
2293
2293
|
};
|
|
2294
2294
|
}
|
|
2295
2295
|
function Nt(e) {
|
|
@@ -2313,7 +2313,7 @@ function Nt(e) {
|
|
|
2313
2313
|
}));
|
|
2314
2314
|
}, { immediate: !0 }), l(s);
|
|
2315
2315
|
}
|
|
2316
|
-
var Pt =
|
|
2316
|
+
var Pt = q({
|
|
2317
2317
|
name: "code",
|
|
2318
2318
|
size: 24,
|
|
2319
2319
|
node: [["path", {
|
|
@@ -2323,14 +2323,14 @@ var Pt = K({
|
|
|
2323
2323
|
d: "m8 6-6 6 6 6",
|
|
2324
2324
|
key: "ppft3o"
|
|
2325
2325
|
}]]
|
|
2326
|
-
}), Ft =
|
|
2326
|
+
}), Ft = q({
|
|
2327
2327
|
name: "navigation",
|
|
2328
2328
|
size: 24,
|
|
2329
2329
|
node: [["polygon", {
|
|
2330
2330
|
points: "3 11 22 2 13 21 11 13 3 11",
|
|
2331
2331
|
key: "1ltx0t"
|
|
2332
2332
|
}]]
|
|
2333
|
-
}), It =
|
|
2333
|
+
}), It = q({
|
|
2334
2334
|
name: "share-2",
|
|
2335
2335
|
size: 24,
|
|
2336
2336
|
node: [
|
|
@@ -2367,7 +2367,7 @@ var Pt = K({
|
|
|
2367
2367
|
key: "1n3mei"
|
|
2368
2368
|
}]
|
|
2369
2369
|
]
|
|
2370
|
-
}), Lt =
|
|
2370
|
+
}), Lt = q({
|
|
2371
2371
|
name: "table",
|
|
2372
2372
|
size: 24,
|
|
2373
2373
|
node: [
|
|
@@ -2424,7 +2424,7 @@ function zt(e) {
|
|
|
2424
2424
|
};
|
|
2425
2425
|
}
|
|
2426
2426
|
function Bt(e) {
|
|
2427
|
-
let n = C(
|
|
2427
|
+
let n = C(ge, null), r = d(e);
|
|
2428
2428
|
if (!n) return r;
|
|
2429
2429
|
let i;
|
|
2430
2430
|
function a() {
|
|
@@ -2451,14 +2451,14 @@ function Vt(e, t) {
|
|
|
2451
2451
|
return typeof n == "string" && n.length > 0 ? n : t;
|
|
2452
2452
|
}
|
|
2453
2453
|
function Ht(e, t) {
|
|
2454
|
-
return typeof e?.url == "string" &&
|
|
2454
|
+
return typeof e?.url == "string" && se(e.url, t);
|
|
2455
2455
|
}
|
|
2456
2456
|
function Ut(e, t) {
|
|
2457
2457
|
let n = e?.url;
|
|
2458
|
-
if (typeof n == "string" && n.trim() !== "") return
|
|
2458
|
+
if (typeof n == "string" && n.trim() !== "") return se(n, t) ? void 0 : n;
|
|
2459
2459
|
}
|
|
2460
2460
|
function Wt(e) {
|
|
2461
|
-
let t = C(
|
|
2461
|
+
let t = C(he, H.liquid), n = Bt(() => Ut(e(), t));
|
|
2462
2462
|
return d(() => Ht(e(), t) ? null : n.value);
|
|
2463
2463
|
}
|
|
2464
2464
|
function Gt(e, t, n) {
|
|
@@ -2475,7 +2475,7 @@ function qt(e, t, n = []) {
|
|
|
2475
2475
|
}
|
|
2476
2476
|
// src/utils/resolveFieldColors.ts
|
|
2477
2477
|
function Jt(e, t) {
|
|
2478
|
-
let n =
|
|
2478
|
+
let n = Y({ presets: e.presets }, xe), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
|
|
2479
2479
|
return {
|
|
2480
2480
|
presets: r ? t.presets : n.presets,
|
|
2481
2481
|
allowCustom: t.allowCustom !== !1 && i,
|
|
@@ -2535,7 +2535,7 @@ var tn = /* @__PURE__ */ w({
|
|
|
2535
2535
|
size: { default: "field" }
|
|
2536
2536
|
},
|
|
2537
2537
|
setup(e) {
|
|
2538
|
-
let t = e, { t: r } =
|
|
2538
|
+
let t = e, { t: r } = ye(), s = {
|
|
2539
2539
|
field: {
|
|
2540
2540
|
gap: "tpl:gap-1.5",
|
|
2541
2541
|
icon: 18,
|
|
@@ -2550,11 +2550,11 @@ var tn = /* @__PURE__ */ w({
|
|
|
2550
2550
|
return (t, s) => (i(), m("div", {
|
|
2551
2551
|
class: a(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", c.value.gap]),
|
|
2552
2552
|
style: o({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${c.value.veil}, transparent)` })
|
|
2553
|
-
}, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(
|
|
2553
|
+
}, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(me), {
|
|
2554
2554
|
class: "tpl-spinner",
|
|
2555
2555
|
size: c.value.icon,
|
|
2556
2556
|
"stroke-width": 2
|
|
2557
|
-
}, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(
|
|
2557
|
+
}, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(J), {
|
|
2558
2558
|
size: c.value.icon,
|
|
2559
2559
|
"stroke-width": 1.5
|
|
2560
2560
|
}, null, 8, ["size"]), h(" " + n(f(r).image.dropToUpload), 1)], 64))], 6));
|
|
@@ -2570,7 +2570,7 @@ function nn() {
|
|
|
2570
2570
|
// src/composables/useImageDrop.ts
|
|
2571
2571
|
var rn = "image/";
|
|
2572
2572
|
function an(e) {
|
|
2573
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } =
|
|
2573
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = be(t, {
|
|
2574
2574
|
preventDefaultForUnhandled: !0,
|
|
2575
2575
|
onDrop: (e) => {
|
|
2576
2576
|
if (!i()) return;
|
|
@@ -2582,7 +2582,7 @@ function an(e) {
|
|
|
2582
2582
|
}
|
|
2583
2583
|
// src/composables/useMediaDropField.ts
|
|
2584
2584
|
function on(e) {
|
|
2585
|
-
let { target: t, blocked: n, apply: r } = e, i = C(
|
|
2585
|
+
let { target: t, blocked: n, apply: r } = e, i = C(_e, null), a = C(ve, null), o = nn();
|
|
2586
2586
|
async function s() {
|
|
2587
2587
|
let e = await i?.({ accept: ["images"] });
|
|
2588
2588
|
o.alive && e && r(e);
|
|
@@ -2627,11 +2627,24 @@ var cn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", ln = {
|
|
|
2627
2627
|
33.33,
|
|
2628
2628
|
33.34
|
|
2629
2629
|
],
|
|
2630
|
+
4: [
|
|
2631
|
+
25,
|
|
2632
|
+
25,
|
|
2633
|
+
25,
|
|
2634
|
+
25
|
|
2635
|
+
],
|
|
2630
2636
|
"1-2": [33.33, 66.67],
|
|
2631
|
-
"2-1": [66.67, 33.33]
|
|
2637
|
+
"2-1": [66.67, 33.33],
|
|
2638
|
+
"1-3": [25, 75],
|
|
2639
|
+
"3-1": [75, 25],
|
|
2640
|
+
"1-2-1": [
|
|
2641
|
+
25,
|
|
2642
|
+
50,
|
|
2643
|
+
25
|
|
2644
|
+
]
|
|
2632
2645
|
};
|
|
2633
2646
|
function un(e, t) {
|
|
2634
|
-
let n = (e) => Math.trunc(e ?? 0), r = (e) =>
|
|
2647
|
+
let n = (e) => Math.trunc(e ?? 0), r = (e) => ce(e) === null ? 0 : Math.trunc(e.width);
|
|
2635
2648
|
return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
|
|
2636
2649
|
}
|
|
2637
2650
|
function dn(e, t) {
|
|
@@ -2642,23 +2655,23 @@ function fn(e, t) {
|
|
|
2642
2655
|
return Math.floor(t) - un(e.styles.padding, n);
|
|
2643
2656
|
}
|
|
2644
2657
|
function* pn(e, t) {
|
|
2645
|
-
for (let n of e)
|
|
2658
|
+
for (let n of e) I(n) ? yield* pn(n.children, dn(t, n.styles.padding)) : yield {
|
|
2646
2659
|
block: n,
|
|
2647
|
-
bandWidth:
|
|
2660
|
+
bandWidth: fe(n) && n.wrapper ? dn(t, n.wrapper.padding) : t
|
|
2648
2661
|
};
|
|
2649
2662
|
}
|
|
2650
|
-
function mn(e, t, n =
|
|
2663
|
+
function mn(e, t, n = K(e)) {
|
|
2651
2664
|
if (!t) return e;
|
|
2652
2665
|
try {
|
|
2653
|
-
return
|
|
2666
|
+
return pe(M(t, n, { missing: "default" }), e);
|
|
2654
2667
|
} catch {
|
|
2655
2668
|
return e;
|
|
2656
2669
|
}
|
|
2657
2670
|
}
|
|
2658
2671
|
function hn(e, t, n, r) {
|
|
2659
2672
|
let i = mn(e, n, r);
|
|
2660
|
-
for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (
|
|
2661
|
-
let r =
|
|
2673
|
+
for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (fe(e)) {
|
|
2674
|
+
let r = ee(e)?.applied ? void 0 : e.border, i = Math.floor(n) - un(e.styles.padding, r), a = ln[e.columns] ?? [100];
|
|
2662
2675
|
for (let n = 0; n < e.children.length; n++) {
|
|
2663
2676
|
let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
|
|
2664
2677
|
if (o) return fn(o, r);
|
|
@@ -2672,14 +2685,14 @@ function gn(e, t, n, r) {
|
|
|
2672
2685
|
return null;
|
|
2673
2686
|
}
|
|
2674
2687
|
function _n(e) {
|
|
2675
|
-
let t =
|
|
2688
|
+
let t = fe(e) ? ee(e) : null;
|
|
2676
2689
|
return !!t?.applied && t.height === "image";
|
|
2677
2690
|
}
|
|
2678
2691
|
function vn(e, t, n, r) {
|
|
2679
2692
|
if (_n(e)) return (t ? gn(t, e.id, n, r) : null) ?? sn(t?.settings);
|
|
2680
2693
|
}
|
|
2681
2694
|
// src/constants/socialIcons.ts
|
|
2682
|
-
var yn =
|
|
2695
|
+
var yn = U, bn = {
|
|
2683
2696
|
small: 24,
|
|
2684
2697
|
medium: 32,
|
|
2685
2698
|
large: 48
|