@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,12 +1,12 @@
|
|
|
1
1
|
import { $ as e, C as t, F as n, H as r, M as i, O as a, Q as o, X as s, Y as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, lt as h, mt as g, ot as _, p as v, pt as y, q as b, rt as x, tt as S, u as C, x as w } from "./draggable-DepKdldn.js";
|
|
2
|
-
import { $t as T,
|
|
3
|
-
import { at as
|
|
4
|
-
import { B as
|
|
5
|
-
import { t as
|
|
6
|
-
import { r as
|
|
7
|
-
import { i as
|
|
2
|
+
import { $t as T, Ft as E, Gt as D, H as O, Ht as ee, I as k, It as te, Jt as A, Lt as j, Nt as ne, Pt as M, Qt as re, Rt as N, Ut as ie, Vt as P, W as F, Wt as I, Xt as ae, Yt as L, Zt as R, en as z, ft as oe, h as B, in as se, jt as V, m as ce, nn as H, p as le, rn as U, tn as W, un as ue, v as de, wt as G, xn as fe, y as pe, zt as me } from "./src-mXG-Of9A.js";
|
|
3
|
+
import { at as he, s as K } from "./icons-DHExFLlT.js";
|
|
4
|
+
import { B as ge, C as _e, W as ve, u as ye } from "./keys-BUmIvYy3.js";
|
|
5
|
+
import { t as be } from "./useI18n-D8s7HtTn.js";
|
|
6
|
+
import { r as xe } from "./dist-DqGgijFI.js";
|
|
7
|
+
import { i as Se, r as q } from "./usePopoverPosition-esO6wjvU.js";
|
|
8
8
|
// ../core/src/localized-edit.ts
|
|
9
|
-
var
|
|
9
|
+
var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => J(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
|
|
10
10
|
"id",
|
|
11
11
|
"type",
|
|
12
12
|
"children",
|
|
@@ -14,41 +14,41 @@ var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), Se = (e) => Arr
|
|
|
14
14
|
"l10n",
|
|
15
15
|
"renderedHtml"
|
|
16
16
|
]);
|
|
17
|
-
function
|
|
17
|
+
function Te(e, t, n) {
|
|
18
18
|
let r = /* @__PURE__ */ new Set();
|
|
19
19
|
for (let i of n) {
|
|
20
|
-
if (!
|
|
21
|
-
let n = i.split("."), a = n.pop(), o = n.join("."), s =
|
|
20
|
+
if (!ie(i)) continue;
|
|
21
|
+
let n = i.split("."), a = n.pop(), o = n.join("."), s = R(e, i), c = t;
|
|
22
22
|
for (let [t, i] of n.entries()) {
|
|
23
23
|
let a = n.slice(0, t + 1).join(".");
|
|
24
|
-
s !== void 0 &&
|
|
24
|
+
s !== void 0 && J(c) && R(c, i) === void 0 && J(R(e, a)) && (c[i] = {}, r.add(a)), c = R(c, i);
|
|
25
25
|
}
|
|
26
26
|
if (Array.isArray(c)) {
|
|
27
|
-
let e = c.findIndex((e) =>
|
|
27
|
+
let e = c.findIndex((e) => J(e) && e.id === a);
|
|
28
28
|
if (e < 0) continue;
|
|
29
|
-
s === void 0 ? c.splice(e, 1) : c[e] =
|
|
30
|
-
} else
|
|
29
|
+
s === void 0 ? c.splice(e, 1) : c[e] = U(s);
|
|
30
|
+
} else J(c) && (s === void 0 ? delete c[a] : c[a] = U(s), o && Object.keys(c).length === 0 && R(e, o) === void 0 && Te(e, t, [o]));
|
|
31
31
|
}
|
|
32
32
|
return r;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (
|
|
36
|
-
else if (i &&
|
|
34
|
+
function Y(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
|
|
35
|
+
if (J(e) && J(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !we.has(o)) && Y(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
|
|
36
|
+
else if (i && Ce(e) && Ce(t)) for (let o of t) {
|
|
37
37
|
if (o.id.includes(".")) continue;
|
|
38
38
|
let t = e.find((e) => e.id === o.id);
|
|
39
|
-
t &&
|
|
39
|
+
t && Y(t, o, `${n}.${o.id}`, r, i, a);
|
|
40
40
|
}
|
|
41
|
-
else
|
|
41
|
+
else H(e, t) || r.set(n, t);
|
|
42
42
|
}
|
|
43
43
|
function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
|
|
44
44
|
let a = /* @__PURE__ */ new Map();
|
|
45
|
-
|
|
46
|
-
let o = new Set(e.type === "custom" ?
|
|
47
|
-
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) :
|
|
45
|
+
Y(e, t, "", a, e.type !== "custom", i);
|
|
46
|
+
let o = new Set(e.type === "custom" ? z(e, r) : []), s = {}, c = {};
|
|
47
|
+
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : D(e.type, t)) && typeof r == "string" && R(e, t) !== void 0) {
|
|
48
48
|
let i = n?.text?.[t];
|
|
49
49
|
s[t] = i && i.value === r ? i : {
|
|
50
50
|
value: r,
|
|
51
|
-
sourceHash:
|
|
51
|
+
sourceHash: T(String(R(e, t) ?? ""))
|
|
52
52
|
};
|
|
53
53
|
} else c[t] = r === void 0 ? null : r;
|
|
54
54
|
let l = {};
|
|
@@ -57,8 +57,8 @@ function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
|
|
|
57
57
|
function De(e, t, n) {
|
|
58
58
|
let r = !1;
|
|
59
59
|
function i(e, t, n, a) {
|
|
60
|
-
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) =>
|
|
61
|
-
if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) =>
|
|
60
|
+
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => J(e) && typeof e.id == "string");
|
|
61
|
+
if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => U(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
|
|
62
62
|
let r = e[n].find((e) => e.id === t.id);
|
|
63
63
|
r && i(r, t, a);
|
|
64
64
|
}
|
|
@@ -66,7 +66,7 @@ function De(e, t, n) {
|
|
|
66
66
|
let a = e, o = t;
|
|
67
67
|
if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
|
|
68
68
|
let i = (e) => e.map((e) => e.map((e) => e.id));
|
|
69
|
-
(e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) =>
|
|
69
|
+
(e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => U(n(e.id) ?? e))));
|
|
70
70
|
}
|
|
71
71
|
return r;
|
|
72
72
|
}
|
|
@@ -75,39 +75,39 @@ function Oe(e, t, n) {
|
|
|
75
75
|
let { locale: t, locales: n, l10n: r, ...i } = e;
|
|
76
76
|
return i;
|
|
77
77
|
}, i = /* @__PURE__ */ new Map();
|
|
78
|
-
|
|
78
|
+
Y(r(e), r(t), "", i);
|
|
79
79
|
let a = {};
|
|
80
|
-
for (let [t, r] of i) if (
|
|
80
|
+
for (let [t, r] of i) if (me.includes(t) && typeof r == "string" && R(e, t) !== void 0) {
|
|
81
81
|
let i = n?.text?.[t];
|
|
82
82
|
(a.text ??= {})[t] = i?.value === r ? i : {
|
|
83
83
|
value: r,
|
|
84
|
-
sourceHash:
|
|
84
|
+
sourceHash: T(String(R(e, t) ?? ""))
|
|
85
85
|
};
|
|
86
86
|
} else (a.set ??= {})[t] = r === void 0 ? null : r;
|
|
87
87
|
return a;
|
|
88
88
|
}
|
|
89
89
|
function ke(e, t, n, r, i, a = []) {
|
|
90
|
-
let o =
|
|
90
|
+
let o = U(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
|
|
91
91
|
...Object.keys(t.text ?? {}),
|
|
92
92
|
...Object.keys(t.set ?? {}),
|
|
93
93
|
...Object.keys(n.text ?? {}),
|
|
94
94
|
...Object.keys(n.set ?? {})
|
|
95
|
-
])].filter((e) => !
|
|
95
|
+
])].filter((e) => !H(t.text?.[e], n.text?.[e]) || !H(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
|
|
96
96
|
for (let e of c) {
|
|
97
|
-
let t =
|
|
98
|
-
if (
|
|
99
|
-
else if (n.length &&
|
|
97
|
+
let t = R(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && H(R(r, t), R(i, t)));
|
|
98
|
+
if (H(t, R(r, e))) delete o.set[e];
|
|
99
|
+
else if (n.length && J(R(r, e)) && J(t)) {
|
|
100
100
|
delete o.set[e];
|
|
101
101
|
let i = (e, t, a) => {
|
|
102
102
|
if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
|
|
103
|
-
if (
|
|
104
|
-
else if (
|
|
105
|
-
else
|
|
103
|
+
if (J(t) && J(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
|
|
104
|
+
else if (J(r) && r.type !== "custom" && Ce(t) && Ce(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
|
|
105
|
+
else J(r) && typeof r.type == "string" && I(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : U(a));
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
i(e,
|
|
109
|
-
} else o.set[e] = t === void 0 ? null :
|
|
110
|
-
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (
|
|
108
|
+
i(e, R(r, e), t);
|
|
109
|
+
} else o.set[e] = t === void 0 ? null : U(t);
|
|
110
|
+
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (H(t === "text" ? o.text[n].value : o.set[n] ?? void 0, R(i, n)) || delete o[t][n]);
|
|
111
111
|
}
|
|
112
112
|
for (let e of s) if (!c.includes(e)) {
|
|
113
113
|
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) (n === e || n.startsWith(`${e}.`)) && delete o[t][n];
|
|
@@ -135,7 +135,7 @@ function je(e, t, n) {
|
|
|
135
135
|
...e.content(),
|
|
136
136
|
blocks: [o]
|
|
137
137
|
};
|
|
138
|
-
ce(t),
|
|
138
|
+
ce(t), B(t);
|
|
139
139
|
}
|
|
140
140
|
if (t === "removeBlock") return !0;
|
|
141
141
|
let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
|
|
@@ -188,8 +188,8 @@ function Q(e, t) {
|
|
|
188
188
|
}
|
|
189
189
|
// ../core/src/editor.ts
|
|
190
190
|
function Fe(t) {
|
|
191
|
-
let n = t.content ??
|
|
192
|
-
ce(n),
|
|
191
|
+
let n = t.content ?? oe(t.defaultFontFamily, t.templateDefaults);
|
|
192
|
+
ce(n), B(n);
|
|
193
193
|
let r = e({
|
|
194
194
|
template: null,
|
|
195
195
|
content: n,
|
|
@@ -204,11 +204,11 @@ function Fe(t) {
|
|
|
204
204
|
uiTheme: "auto"
|
|
205
205
|
}), i = u(r, "activeLocale"), a = [];
|
|
206
206
|
function o(e) {
|
|
207
|
-
let t =
|
|
208
|
-
if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new
|
|
207
|
+
let t = P(r.content);
|
|
208
|
+
if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new W(`This template has no "${e}" version.`, void 0, "unknown_locale");
|
|
209
209
|
i.value = e;
|
|
210
210
|
}
|
|
211
|
-
h(() => i.value ??
|
|
211
|
+
h(() => i.value ?? P(r.content), (e) => Q(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
|
|
212
212
|
i.value && !r.content.settings.locales?.includes(i.value) && o(null);
|
|
213
213
|
});
|
|
214
214
|
function s() {
|
|
@@ -218,16 +218,16 @@ function Fe(t) {
|
|
|
218
218
|
a = e;
|
|
219
219
|
}
|
|
220
220
|
function l(e) {
|
|
221
|
-
return
|
|
221
|
+
return j(r.content, e, a);
|
|
222
222
|
}
|
|
223
223
|
function d(e, n) {
|
|
224
224
|
if (!s()) return null;
|
|
225
|
-
if (e === "addLocale" && (!
|
|
226
|
-
let i =
|
|
227
|
-
return
|
|
225
|
+
if (e === "addLocale" && (!ee(n) || t.localization && !t.localization.locales.includes(n))) throw new W(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
|
|
226
|
+
let i = U(r.content);
|
|
227
|
+
return te(i, [{
|
|
228
228
|
op: e,
|
|
229
229
|
locale: n
|
|
230
|
-
}]),
|
|
230
|
+
}]), H(i, r.content) ? null : i;
|
|
231
231
|
}
|
|
232
232
|
function f(e, t) {
|
|
233
233
|
let n = d(e, t);
|
|
@@ -248,17 +248,17 @@ function Fe(t) {
|
|
|
248
248
|
}
|
|
249
249
|
function v(e, t) {
|
|
250
250
|
let [n, o] = t;
|
|
251
|
-
if (!i.value || !s() ||
|
|
251
|
+
if (!i.value || !s() || I(n)) return null;
|
|
252
252
|
let c = N(r.content.blocks, n);
|
|
253
253
|
if (!c) return null;
|
|
254
|
-
let l = c.l10n?.[i.value], u =
|
|
254
|
+
let l = c.l10n?.[i.value], u = A(c, i.value, P(r.content)), d = Ee(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Te(c, u, o) : void 0, p = e === "resetLocaleFields" ? ke(l, d, Ee(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : U(l ?? {});
|
|
255
255
|
if (e === "setBlockHidden") o ? p.hidden = !0 : delete p.hidden;
|
|
256
256
|
else if (e === "resetLocaleFields") o || (delete p.text, delete p.set, delete p.hidden);
|
|
257
257
|
else for (let e of o) {
|
|
258
258
|
let t = p.text?.[e];
|
|
259
|
-
t && (t.sourceHash =
|
|
259
|
+
t && (t.sourceHash = T(String(R(c, e) ?? "")));
|
|
260
260
|
}
|
|
261
|
-
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set,
|
|
261
|
+
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, H(l ?? {}, p) ? null : {
|
|
262
262
|
block: c,
|
|
263
263
|
layer: p
|
|
264
264
|
};
|
|
@@ -276,16 +276,16 @@ function Fe(t) {
|
|
|
276
276
|
function w(e, t) {
|
|
277
277
|
y("keepTranslations", [e, t]);
|
|
278
278
|
}
|
|
279
|
-
let
|
|
279
|
+
let E = S(0), D = 0, O = 0;
|
|
280
280
|
function k() {
|
|
281
281
|
r.isDirty = !0, O++;
|
|
282
282
|
}
|
|
283
|
-
let
|
|
283
|
+
let ne = b({
|
|
284
284
|
get: () => r.content,
|
|
285
285
|
set: (e) => {
|
|
286
286
|
r.content = e, k();
|
|
287
287
|
}
|
|
288
|
-
}),
|
|
288
|
+
}), M = b(() => r.selectedBlockId ? N(r.content.blocks, r.selectedBlockId) : null);
|
|
289
289
|
function N(e, t) {
|
|
290
290
|
for (let n of e) {
|
|
291
291
|
if (n.id === t) return n;
|
|
@@ -296,15 +296,15 @@ function Fe(t) {
|
|
|
296
296
|
}
|
|
297
297
|
return null;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n)
|
|
299
|
+
function ie(e, t) {
|
|
300
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) ie(e, t);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function F(e, t, n = { blocks: e }) {
|
|
303
303
|
for (let r = 0; r < e.length; r++) {
|
|
304
304
|
let i = e[r];
|
|
305
305
|
if (i.id === t) return n;
|
|
306
306
|
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
307
|
-
let n =
|
|
307
|
+
let n = F(i.children[e], t, {
|
|
308
308
|
blocks: i.children[e],
|
|
309
309
|
sectionId: i.id,
|
|
310
310
|
columnIndex: e
|
|
@@ -314,7 +314,7 @@ function Fe(t) {
|
|
|
314
314
|
}
|
|
315
315
|
return null;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function I(e, n = !1) {
|
|
318
318
|
let r = i.value ?? t.lockLocale?.value ?? null;
|
|
319
319
|
for (let [i, a] of t.lockedBlocks?.value ?? []) {
|
|
320
320
|
let o = a;
|
|
@@ -324,8 +324,8 @@ function Fe(t) {
|
|
|
324
324
|
}
|
|
325
325
|
return !1;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
let t =
|
|
327
|
+
function z(e) {
|
|
328
|
+
let t = F(r.content.blocks, e);
|
|
329
329
|
if (!t) return null;
|
|
330
330
|
let n = t.blocks.findIndex((t) => t.id === e);
|
|
331
331
|
return n === -1 ? null : {
|
|
@@ -334,52 +334,52 @@ function Fe(t) {
|
|
|
334
334
|
index: n
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
ce(e),
|
|
337
|
+
function se(e, t = !0) {
|
|
338
|
+
ce(e), B(e), r.content = e, t && k();
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
e &&
|
|
340
|
+
function V(e) {
|
|
341
|
+
e && I(e) || (r.selectedBlockId = e);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function le(e) {
|
|
344
344
|
r.viewport = e;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function ue(e) {
|
|
347
347
|
r.darkMode = e;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function de(e) {
|
|
350
350
|
r.uiTheme = e;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function G(e) {
|
|
353
353
|
r.previewMode = e, e && (r.selectedBlockId = null);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function fe(e, t) {
|
|
356
356
|
if (!s()) return !1;
|
|
357
357
|
let n = N(r.content.blocks, e);
|
|
358
358
|
if (!n) return !1;
|
|
359
|
-
if ("l10n" in t) throw new
|
|
359
|
+
if ("l10n" in t) throw new W("l10n is immutable in updateBlock.", void 0, "invalid_operation");
|
|
360
360
|
let i = {
|
|
361
361
|
...n,
|
|
362
362
|
...t
|
|
363
363
|
};
|
|
364
|
-
return !
|
|
364
|
+
return !I(e, De(U(n), i, (e) => N(r.content.blocks, e)));
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
if (!
|
|
366
|
+
function pe(e, n) {
|
|
367
|
+
if (!fe(e, n)) return;
|
|
368
368
|
let o = N(r.content.blocks, e);
|
|
369
369
|
if (!o) return;
|
|
370
370
|
let s = i.value;
|
|
371
371
|
if (s) {
|
|
372
|
-
let i =
|
|
372
|
+
let i = A(o, s, P(r.content)), c = {
|
|
373
373
|
...i,
|
|
374
374
|
...n
|
|
375
|
-
}, l =
|
|
376
|
-
if (
|
|
375
|
+
}, l = U(o), u = De(l, c, (e) => N(r.content.blocks, e));
|
|
376
|
+
if (I(e, u)) return;
|
|
377
377
|
u && t.onStructureChange?.();
|
|
378
|
-
let d =
|
|
378
|
+
let d = L(l);
|
|
379
379
|
delete o.l10n, Object.assign(o, d), _(o, ke(o.l10n?.[s], Ee(o, i, o.l10n?.[s], a), Ee(o, c, o.l10n?.[s], a), o, c));
|
|
380
380
|
} else {
|
|
381
|
-
if (
|
|
382
|
-
let t =
|
|
381
|
+
if (I(e, "children" in n || "columns" in n)) return;
|
|
382
|
+
let t = L({
|
|
383
383
|
...o,
|
|
384
384
|
...n
|
|
385
385
|
});
|
|
@@ -387,20 +387,20 @@ function Fe(t) {
|
|
|
387
387
|
}
|
|
388
388
|
k();
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
if ("locales" in e || "l10n" in e) throw new
|
|
392
|
-
if ("locale" in e && e.locale !==
|
|
390
|
+
function me(e) {
|
|
391
|
+
if ("locales" in e || "l10n" in e) throw new W("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
|
|
392
|
+
if ("locale" in e && e.locale !== P(r.content) && r.content.settings.locales?.length) throw new W("The default locale can't change while language versions exist.", void 0, "invalid_operation");
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function he(e) {
|
|
395
395
|
if (!s()) return;
|
|
396
|
-
|
|
396
|
+
me(e);
|
|
397
397
|
let t = i.value;
|
|
398
398
|
if (!t) r.content.settings = ae({
|
|
399
399
|
...r.content.settings,
|
|
400
400
|
...e
|
|
401
401
|
});
|
|
402
402
|
else {
|
|
403
|
-
let n = r.content.settings, i =
|
|
403
|
+
let n = r.content.settings, i = re(r.content, t).settings, a = {
|
|
404
404
|
...i,
|
|
405
405
|
locale: n.locale,
|
|
406
406
|
...e
|
|
@@ -412,15 +412,15 @@ function Fe(t) {
|
|
|
412
412
|
}
|
|
413
413
|
k();
|
|
414
414
|
}
|
|
415
|
-
let
|
|
415
|
+
let K = {
|
|
416
416
|
canEdit: s,
|
|
417
417
|
content: () => r.content,
|
|
418
418
|
findBlock: (e) => N(r.content.blocks, e),
|
|
419
|
-
findBlockLocation:
|
|
420
|
-
isBlockLocked:
|
|
419
|
+
findBlockLocation: z,
|
|
420
|
+
isBlockLocked: I
|
|
421
421
|
};
|
|
422
|
-
function
|
|
423
|
-
if (je(
|
|
422
|
+
function ge(e, n, a = 0, o) {
|
|
423
|
+
if (je(K, "addBlock", [
|
|
424
424
|
e,
|
|
425
425
|
n,
|
|
426
426
|
a,
|
|
@@ -437,29 +437,29 @@ function Fe(t) {
|
|
|
437
437
|
i.value && t.onStructureChange?.(), k();
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
if (!je(
|
|
442
|
-
let n =
|
|
440
|
+
function _e(e) {
|
|
441
|
+
if (!je(K, "removeBlock", [e])) return;
|
|
442
|
+
let n = F(r.content.blocks, e);
|
|
443
443
|
if (n) {
|
|
444
444
|
let a = n.blocks.findIndex((t) => t.id === e);
|
|
445
445
|
if (a !== -1) {
|
|
446
446
|
let [e] = n.blocks.splice(a, 1);
|
|
447
447
|
if (r.selectedBlockId) {
|
|
448
448
|
let t = /* @__PURE__ */ new Set();
|
|
449
|
-
|
|
449
|
+
ie(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
|
|
450
450
|
}
|
|
451
451
|
i.value && t.onStructureChange?.(), k();
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
if (!je(
|
|
455
|
+
function ve(e, n, a, o = 0) {
|
|
456
|
+
if (!je(K, "moveBlock", [
|
|
457
457
|
e,
|
|
458
458
|
n,
|
|
459
459
|
a,
|
|
460
460
|
o
|
|
461
461
|
])) return;
|
|
462
|
-
let s =
|
|
462
|
+
let s = F(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
|
|
463
463
|
if (a) {
|
|
464
464
|
let e = N(r.content.blocks, a);
|
|
465
465
|
e.children[o] = e.children[o] || [], l = e.children[o];
|
|
@@ -467,29 +467,29 @@ function Fe(t) {
|
|
|
467
467
|
let [u] = s.blocks.splice(c, 1);
|
|
468
468
|
l.splice(n, 0, u), i.value && t.onStructureChange?.(), k();
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function ye() {
|
|
471
471
|
k();
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
throw new
|
|
473
|
+
function be(e, t) {
|
|
474
|
+
throw new W(`[Templatical] Templates: ${e} ${t}`);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function xe(e) {
|
|
477
477
|
Q(t.onError, e);
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Se(e) {
|
|
480
480
|
let { templates: n } = t;
|
|
481
|
-
return n ||
|
|
481
|
+
return n || be(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function q(e) {
|
|
484
484
|
r.template && (r.template = {
|
|
485
485
|
...r.template,
|
|
486
486
|
name: e
|
|
487
487
|
}, k());
|
|
488
488
|
}
|
|
489
|
-
async function
|
|
490
|
-
let n =
|
|
491
|
-
typeof i != "function" &&
|
|
492
|
-
let a, o = ++
|
|
489
|
+
async function J(e) {
|
|
490
|
+
let n = Se("create()"), { create: i } = n;
|
|
491
|
+
typeof i != "function" && be("create()", "is disabled by the provider — its `create` is `false`.");
|
|
492
|
+
let a, o = ++D;
|
|
493
493
|
r.isLoading = !0;
|
|
494
494
|
try {
|
|
495
495
|
e?.content && (r.content = e.content);
|
|
@@ -497,32 +497,32 @@ function Fe(t) {
|
|
|
497
497
|
a = await i(e?.name === void 0 ? { content: r.content } : {
|
|
498
498
|
name: e.name,
|
|
499
499
|
content: r.content
|
|
500
|
-
}), r.template = a, O === t && (r.isDirty = !1),
|
|
500
|
+
}), r.template = a, O === t && (r.isDirty = !1), E.value++;
|
|
501
501
|
} catch (e) {
|
|
502
502
|
throw t.onError?.(e), e;
|
|
503
503
|
} finally {
|
|
504
|
-
|
|
504
|
+
D === o && (r.isLoading = !1);
|
|
505
505
|
}
|
|
506
|
-
return
|
|
506
|
+
return xe(() => n.onCreated?.(a)), a;
|
|
507
507
|
}
|
|
508
|
-
async function
|
|
509
|
-
let i =
|
|
508
|
+
async function Ce(e, n) {
|
|
509
|
+
let i = Se("load()"), a, o = ++D;
|
|
510
510
|
r.isLoading = !0;
|
|
511
511
|
try {
|
|
512
|
-
if (a = await i.load(e), ce(a.content),
|
|
513
|
-
r.template = a, r.content = a.content, r.isDirty = !1,
|
|
512
|
+
if (a = await i.load(e), ce(a.content), B(a.content), n && !n()) return a;
|
|
513
|
+
r.template = a, r.content = a.content, r.isDirty = !1, E.value++;
|
|
514
514
|
} catch (e) {
|
|
515
515
|
throw t.onError?.(e), e;
|
|
516
516
|
} finally {
|
|
517
|
-
|
|
517
|
+
D === o && (r.isLoading = !1);
|
|
518
518
|
}
|
|
519
|
-
return
|
|
519
|
+
return xe(() => i.onLoaded?.(a)), a;
|
|
520
520
|
}
|
|
521
|
-
async function
|
|
522
|
-
let n =
|
|
523
|
-
typeof i != "function" &&
|
|
521
|
+
async function we(e = "api") {
|
|
522
|
+
let n = Se("save()"), { save: i } = n;
|
|
523
|
+
typeof i != "function" && be("save()", "is disabled by the provider — its `save` is `false`.");
|
|
524
524
|
let a = r.template;
|
|
525
|
-
a ||
|
|
525
|
+
a || be("save()", "has no template loaded. Call create() or load() first.");
|
|
526
526
|
let o = a.name === void 0 ? { content: r.content } : {
|
|
527
527
|
name: a.name,
|
|
528
528
|
content: r.content
|
|
@@ -543,16 +543,16 @@ function Fe(t) {
|
|
|
543
543
|
} finally {
|
|
544
544
|
r.isSaving = !1;
|
|
545
545
|
}
|
|
546
|
-
return
|
|
546
|
+
return xe(() => n.onSaved?.(s, { trigger: e })), s;
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function Y() {
|
|
549
549
|
return r.template?.id !== void 0;
|
|
550
550
|
}
|
|
551
551
|
let X = {
|
|
552
552
|
state: m(r),
|
|
553
|
-
loadVersion: m(
|
|
554
|
-
content:
|
|
555
|
-
selectedBlock:
|
|
553
|
+
loadVersion: m(E),
|
|
554
|
+
content: ne,
|
|
555
|
+
selectedBlock: M,
|
|
556
556
|
activeLocale: i,
|
|
557
557
|
setActiveLocale: o,
|
|
558
558
|
addLocale: p,
|
|
@@ -562,34 +562,34 @@ function Fe(t) {
|
|
|
562
562
|
keepTranslations: w,
|
|
563
563
|
setCustomBlockDefinitions: c,
|
|
564
564
|
createSetDefaultLocaleOperation: l,
|
|
565
|
-
isBlockLocked:
|
|
566
|
-
setContent:
|
|
567
|
-
selectBlock:
|
|
568
|
-
setViewport:
|
|
569
|
-
setDarkMode:
|
|
570
|
-
setUiTheme:
|
|
571
|
-
setPreviewMode:
|
|
572
|
-
updateBlock:
|
|
573
|
-
updateSettings:
|
|
574
|
-
addBlock:
|
|
575
|
-
removeBlock:
|
|
576
|
-
moveBlock:
|
|
577
|
-
markDirty:
|
|
578
|
-
findBlockLocation:
|
|
579
|
-
setName:
|
|
580
|
-
create:
|
|
581
|
-
load:
|
|
582
|
-
save:
|
|
583
|
-
hasTemplate:
|
|
565
|
+
isBlockLocked: I,
|
|
566
|
+
setContent: se,
|
|
567
|
+
selectBlock: V,
|
|
568
|
+
setViewport: le,
|
|
569
|
+
setDarkMode: ue,
|
|
570
|
+
setUiTheme: de,
|
|
571
|
+
setPreviewMode: G,
|
|
572
|
+
updateBlock: pe,
|
|
573
|
+
updateSettings: he,
|
|
574
|
+
addBlock: ge,
|
|
575
|
+
removeBlock: _e,
|
|
576
|
+
moveBlock: ve,
|
|
577
|
+
markDirty: ye,
|
|
578
|
+
findBlockLocation: z,
|
|
579
|
+
setName: q,
|
|
580
|
+
create: J,
|
|
581
|
+
load: Ce,
|
|
582
|
+
save: we,
|
|
583
|
+
hasTemplate: Y
|
|
584
584
|
};
|
|
585
|
-
return Me(X, (e, t) => Ae(e) ? je(
|
|
585
|
+
return Me(X, (e, t) => Ae(e) ? je(K, e, t) : s() ? e === "updateBlock" ? fe(t[0], t[1]) : (e === "updateSettings" && me(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
|
|
586
586
|
}
|
|
587
587
|
// ../core/src/history.ts
|
|
588
588
|
var Ie = 50, Le = 300, Re = 1500;
|
|
589
589
|
function ze(e) {
|
|
590
590
|
let { content: t, setContent: n, maxSize: r = Ie } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
|
|
591
591
|
function d() {
|
|
592
|
-
return
|
|
592
|
+
return U(t.value);
|
|
593
593
|
}
|
|
594
594
|
function f(e) {
|
|
595
595
|
i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
|
|
@@ -650,7 +650,7 @@ function ze(e) {
|
|
|
650
650
|
function Be(e) {
|
|
651
651
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
652
652
|
function o(n, r, a) {
|
|
653
|
-
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s =
|
|
653
|
+
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = pe(n, o);
|
|
654
654
|
return t(s, r, a), i(s.id), s;
|
|
655
655
|
}
|
|
656
656
|
function s(e, n, r) {
|
|
@@ -859,7 +859,7 @@ function et(e) {
|
|
|
859
859
|
}
|
|
860
860
|
function tt(e, t, n) {
|
|
861
861
|
let r = {}, i = [];
|
|
862
|
-
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 ||
|
|
862
|
+
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || H(e[i], t[i]) || (r[i] = U(t[i]));
|
|
863
863
|
for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
|
|
864
864
|
return {
|
|
865
865
|
set: r,
|
|
@@ -878,7 +878,7 @@ function nt(e = {}, t = {}) {
|
|
|
878
878
|
function rt(e, t) {
|
|
879
879
|
if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
|
|
880
880
|
op: "setContent",
|
|
881
|
-
content:
|
|
881
|
+
content: U(t)
|
|
882
882
|
}];
|
|
883
883
|
let n = $e(e.blocks), r = $e(t.blocks), i = [], a = (e) => {
|
|
884
884
|
let t = r.get(e), i = n.get(e);
|
|
@@ -896,8 +896,8 @@ function rt(e, t) {
|
|
|
896
896
|
};
|
|
897
897
|
for (let t of e.blocks) u(t, "kept");
|
|
898
898
|
let d = (e) => n.has(e) && !c.has(e), f = (e) => {
|
|
899
|
-
let t =
|
|
900
|
-
return t.type === "section" && (t.children = Qe(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) =>
|
|
899
|
+
let t = U(e);
|
|
900
|
+
return t.type === "section" && (t.children = Qe(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => U(e)) : e)), t;
|
|
901
901
|
}, p = (e, t, r) => {
|
|
902
902
|
let a = Ze(e), o = [], s = [];
|
|
903
903
|
t.forEach((e, t) => {
|
|
@@ -1037,39 +1037,39 @@ function st(e, t, n) {
|
|
|
1037
1037
|
Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
|
|
1038
1038
|
}
|
|
1039
1039
|
function ct(e) {
|
|
1040
|
-
let t =
|
|
1040
|
+
let t = U(e);
|
|
1041
1041
|
return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(ct))), t;
|
|
1042
1042
|
}
|
|
1043
1043
|
function lt(e, t, n, r) {
|
|
1044
|
-
let i =
|
|
1044
|
+
let i = re(e, t), a = U(e), o = U(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
|
|
1045
1045
|
for (let [i, a] of $(n)) c.set(i, {
|
|
1046
|
-
initial:
|
|
1046
|
+
initial: A(a, t, P(e)),
|
|
1047
1047
|
added: r,
|
|
1048
1048
|
changed: !1
|
|
1049
1049
|
});
|
|
1050
1050
|
};
|
|
1051
1051
|
l(i.blocks, !1);
|
|
1052
1052
|
let u = [], d = (e, t, n) => {
|
|
1053
|
-
if (t.some((e) => e?.op === "setDefaultLocale")) throw new
|
|
1054
|
-
if (t.some((e) => e?.op === "setContent")) throw new
|
|
1053
|
+
if (t.some((e) => e?.op === "setDefaultLocale")) throw new M("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
|
|
1054
|
+
if (t.some((e) => e?.op === "setContent")) throw new M("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
|
|
1055
1055
|
try {
|
|
1056
|
-
return
|
|
1056
|
+
return E(e, t);
|
|
1057
1057
|
} catch (e) {
|
|
1058
|
-
throw e instanceof
|
|
1058
|
+
throw e instanceof M ? new M(e.code, n, e.message, e.blockId) : e;
|
|
1059
1059
|
}
|
|
1060
1060
|
}, f = (e, t) => {
|
|
1061
1061
|
a = d(a, e, t), u.push(...e);
|
|
1062
1062
|
}, p = (e, n) => {
|
|
1063
1063
|
let o = c.get(e);
|
|
1064
1064
|
if (!o?.changed) return;
|
|
1065
|
-
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u =
|
|
1065
|
+
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = U(a), d = it(u, at(u, e).parent), p = U(s);
|
|
1066
1066
|
if (o.added) p = ct(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
|
|
1067
1067
|
else {
|
|
1068
1068
|
De(p, p.type === "section" ? {
|
|
1069
1069
|
...l,
|
|
1070
1070
|
children: p.children,
|
|
1071
1071
|
columns: p.columns
|
|
1072
|
-
} : l, (e) => $(a.blocks).get(e) ?? null), p =
|
|
1072
|
+
} : l, (e) => $(a.blocks).get(e) ?? null), p = L(p);
|
|
1073
1073
|
let e = p.l10n?.[t];
|
|
1074
1074
|
st(p, t, ke(e, Ee(p, o.initial, e, r), Ee(p, l, e, r), p, l));
|
|
1075
1075
|
}
|
|
@@ -1092,7 +1092,7 @@ function lt(e, t, n, r) {
|
|
|
1092
1092
|
op: "updateBlock",
|
|
1093
1093
|
blockId: e.blockId,
|
|
1094
1094
|
set: { columns: i.columns },
|
|
1095
|
-
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e,
|
|
1095
|
+
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, R(u, e) ?? null])) } : {}
|
|
1096
1096
|
}], n);
|
|
1097
1097
|
};
|
|
1098
1098
|
n.forEach((e, t) => {
|
|
@@ -1137,7 +1137,7 @@ function lt(e, t, n, r) {
|
|
|
1137
1137
|
});
|
|
1138
1138
|
for (let e of c.keys()) p(e, n.length - 1);
|
|
1139
1139
|
if (s) {
|
|
1140
|
-
let e =
|
|
1140
|
+
let e = U(a), r = e.settings.l10n?.[t];
|
|
1141
1141
|
st(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(rt(a, e), n.length - 1);
|
|
1142
1142
|
}
|
|
1143
1143
|
return u;
|
|
@@ -1194,14 +1194,14 @@ function St(e) {
|
|
|
1194
1194
|
});
|
|
1195
1195
|
}
|
|
1196
1196
|
function Ct(e) {
|
|
1197
|
-
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? pt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1,
|
|
1198
|
-
function
|
|
1197
|
+
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? pt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, D = null, O = 0, ee = !1, k = [], A = null, j = null, re = Promise.resolve(), N = null, ie = b(() => (v?.undo.length ?? 0) > 0), P = b(() => (v?.redo.length ?? 0) > 0);
|
|
1198
|
+
function F(t) {
|
|
1199
1199
|
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1202
|
-
n !== v ||
|
|
1201
|
+
function I(t, n = v) {
|
|
1202
|
+
n !== v || ee || e.onNotice?.(t);
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function ae() {
|
|
1205
1205
|
return {
|
|
1206
1206
|
locks: [...s.value.values()].map((e) => ({
|
|
1207
1207
|
blockId: e.blockId,
|
|
@@ -1211,87 +1211,87 @@ function Ct(e) {
|
|
|
1211
1211
|
session: n
|
|
1212
1212
|
};
|
|
1213
1213
|
}
|
|
1214
|
-
function
|
|
1214
|
+
function L() {
|
|
1215
1215
|
g.value++;
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1217
|
+
function R(e, t) {
|
|
1218
1218
|
e.push(t), e.length > r && e.splice(0, e.length - r);
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function z(e) {
|
|
1221
1221
|
if (!_ || y) return;
|
|
1222
1222
|
C = !0;
|
|
1223
1223
|
try {
|
|
1224
1224
|
let t = _.content.value, n = rt(t, e);
|
|
1225
1225
|
if (n.length > 0) try {
|
|
1226
|
-
|
|
1226
|
+
te(t, n);
|
|
1227
1227
|
} catch {
|
|
1228
|
-
_.setContent(
|
|
1228
|
+
_.setContent(U(e), !1);
|
|
1229
1229
|
}
|
|
1230
|
-
|
|
1230
|
+
H(_.content.value, e) || _.setContent(U(e), !1);
|
|
1231
1231
|
} finally {
|
|
1232
1232
|
C = !1;
|
|
1233
1233
|
}
|
|
1234
1234
|
let t = _.state.selectedBlockId;
|
|
1235
1235
|
t && !bt(e.blocks, t) && _.selectBlock(null);
|
|
1236
1236
|
}
|
|
1237
|
-
function
|
|
1237
|
+
function oe() {
|
|
1238
1238
|
C || T || (T = !0, queueMicrotask(() => {
|
|
1239
1239
|
T = !1, se(!1);
|
|
1240
1240
|
}));
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1243
|
-
|
|
1242
|
+
function B() {
|
|
1243
|
+
D &&= (clearTimeout(D), null);
|
|
1244
1244
|
}
|
|
1245
1245
|
function se(e, t = !1) {
|
|
1246
1246
|
let n = v;
|
|
1247
1247
|
if (!_ || !n || y || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
|
|
1248
1248
|
let r = rt(n.view, _.content.value);
|
|
1249
|
-
if (r.length === 0)
|
|
1249
|
+
if (r.length === 0) B();
|
|
1250
1250
|
else {
|
|
1251
1251
|
if (!e && xt(r)) {
|
|
1252
1252
|
let e = Date.now();
|
|
1253
|
-
if (
|
|
1254
|
-
|
|
1255
|
-
|
|
1253
|
+
if (D === null && (O = e), e - O < 1e3) {
|
|
1254
|
+
D && clearTimeout(D), D = setTimeout(() => {
|
|
1255
|
+
D = null, se(!0);
|
|
1256
1256
|
}, 300);
|
|
1257
1257
|
return;
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
|
|
1260
|
+
B(), ce(n, r);
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
1263
1263
|
function V() {
|
|
1264
1264
|
se(!0);
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function ce(e, t) {
|
|
1267
1267
|
let n = t, r;
|
|
1268
1268
|
try {
|
|
1269
|
-
r =
|
|
1269
|
+
r = E(e.view, n, ae());
|
|
1270
1270
|
} catch (n) {
|
|
1271
|
-
if (!(n instanceof
|
|
1272
|
-
|
|
1271
|
+
if (!(n instanceof M)) throw n;
|
|
1272
|
+
z(e.view);
|
|
1273
1273
|
let r = n.blockId === void 0 ? void 0 : Ae(n.blockId).find((e) => {
|
|
1274
1274
|
let r = t[n.opIndex];
|
|
1275
1275
|
return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
|
|
1276
1276
|
})?.holder;
|
|
1277
|
-
|
|
1277
|
+
I({
|
|
1278
1278
|
type: "editRefused",
|
|
1279
1279
|
code: n.code,
|
|
1280
1280
|
...r ? { holder: r } : {}
|
|
1281
|
-
}), n.code === "invalid_operation" &&
|
|
1281
|
+
}), n.code === "invalid_operation" && F(n);
|
|
1282
1282
|
return;
|
|
1283
1283
|
}
|
|
1284
1284
|
let i = _.content.value;
|
|
1285
|
-
if (!
|
|
1286
|
-
|
|
1285
|
+
if (!H(r, i)) {
|
|
1286
|
+
F(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
|
|
1287
1287
|
op: "setContent",
|
|
1288
|
-
content:
|
|
1288
|
+
content: U(i)
|
|
1289
1289
|
}];
|
|
1290
1290
|
try {
|
|
1291
|
-
r =
|
|
1291
|
+
r = E(e.view, n, ae());
|
|
1292
1292
|
} catch (t) {
|
|
1293
|
-
if (!(t instanceof
|
|
1294
|
-
|
|
1293
|
+
if (!(t instanceof M)) throw t;
|
|
1294
|
+
z(e.view), I({
|
|
1295
1295
|
type: "editRefused",
|
|
1296
1296
|
code: t.code
|
|
1297
1297
|
});
|
|
@@ -1299,11 +1299,11 @@ function Ct(e) {
|
|
|
1299
1299
|
}
|
|
1300
1300
|
}
|
|
1301
1301
|
let a = gt({ ops: ne(e.view, n) }, r);
|
|
1302
|
-
|
|
1302
|
+
R(e.undo, a), e.redo = [], L();
|
|
1303
1303
|
let o = e.view;
|
|
1304
|
-
e.view = r,
|
|
1304
|
+
e.view = r, le(e, n, "edit", a, o);
|
|
1305
1305
|
}
|
|
1306
|
-
function
|
|
1306
|
+
function le(e, t, n, r, i) {
|
|
1307
1307
|
let a = { dropped: !1 }, o = 0, s = i;
|
|
1308
1308
|
do {
|
|
1309
1309
|
let i = t.slice(o, o + mt);
|
|
@@ -1317,7 +1317,7 @@ function Ct(e) {
|
|
|
1317
1317
|
revision: null,
|
|
1318
1318
|
...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
|
|
1319
1319
|
}), o += mt, s && t.slice(o).some((e) => e.op === "setContent")) try {
|
|
1320
|
-
s =
|
|
1320
|
+
s = E(s, i);
|
|
1321
1321
|
} catch {
|
|
1322
1322
|
s = null;
|
|
1323
1323
|
}
|
|
@@ -1327,134 +1327,134 @@ function Ct(e) {
|
|
|
1327
1327
|
function W(e) {
|
|
1328
1328
|
if (e.inFlight || w) return;
|
|
1329
1329
|
let t = e.pending.find((e) => !e.sent);
|
|
1330
|
-
t ? (t.sent = !0, e.inFlight = t,
|
|
1330
|
+
t ? (t.sent = !0, e.inFlight = t, ue(e, t, 0)) : he(e);
|
|
1331
1331
|
}
|
|
1332
|
-
function
|
|
1332
|
+
function ue(e, n, r) {
|
|
1333
1333
|
t.submit(e.templateId, {
|
|
1334
1334
|
batchId: n.batchId,
|
|
1335
1335
|
baseRevision: n.baseRevision ??= e.revision,
|
|
1336
1336
|
ops: n.ops,
|
|
1337
1337
|
...n.origin === "ai" ? { origin: "ai" } : {}
|
|
1338
1338
|
}).then(({ revision: t }) => {
|
|
1339
|
-
e.inFlight = null,
|
|
1339
|
+
e.inFlight = null, de(e, n, t), W(e);
|
|
1340
1340
|
}, (t) => {
|
|
1341
|
-
if (_t(t) !== null) e.inFlight = null,
|
|
1341
|
+
if (_t(t) !== null) e.inFlight = null, me(e, n, t), W(e);
|
|
1342
1342
|
else if (yt(t)) {
|
|
1343
|
-
|
|
1343
|
+
K(e, t);
|
|
1344
1344
|
let i = ft[Math.min(r, ft.length - 1)];
|
|
1345
1345
|
setTimeout(() => {
|
|
1346
|
-
|
|
1346
|
+
ee || ue(e, n, r + 1);
|
|
1347
1347
|
}, i);
|
|
1348
|
-
} else e.inFlight = null,
|
|
1348
|
+
} else e.inFlight = null, F(t), me(e, n, t), W(e);
|
|
1349
1349
|
});
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1352
|
-
t.revision === null && (t.revision = n, n <= e.revision ? (
|
|
1351
|
+
function de(e, t, n) {
|
|
1352
|
+
t.revision === null && (t.revision = n, n <= e.revision ? (G(e, t), ye(e)) : (e.own.set(n, t), ve(e)));
|
|
1353
1353
|
}
|
|
1354
|
-
function
|
|
1355
|
-
e.pending = e.pending.filter((e) => e !== t),
|
|
1354
|
+
function G(e, t) {
|
|
1355
|
+
e.pending = e.pending.filter((e) => e !== t), he(e);
|
|
1356
1356
|
}
|
|
1357
|
-
function
|
|
1357
|
+
function fe(e, t) {
|
|
1358
1358
|
if (t.entry) {
|
|
1359
1359
|
for (let n of [e.undo, e.redo]) {
|
|
1360
1360
|
let e = n.indexOf(t.entry);
|
|
1361
1361
|
e !== -1 && n.splice(e, 1);
|
|
1362
1362
|
}
|
|
1363
|
-
|
|
1363
|
+
L();
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
|
-
function
|
|
1366
|
+
function pe(e, t) {
|
|
1367
1367
|
let n = !t.group.dropped;
|
|
1368
|
-
return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n &&
|
|
1368
|
+
return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && fe(e, t), he(e), n;
|
|
1369
1369
|
}
|
|
1370
|
-
function
|
|
1371
|
-
if (
|
|
1370
|
+
function me(e, t, n) {
|
|
1371
|
+
if (G(e, t), pe(e, t)) {
|
|
1372
1372
|
let r = _t(n) ?? "invalid_operation";
|
|
1373
1373
|
if (t.origin === "edit" || t.origin === "ai") {
|
|
1374
1374
|
let t = vt(n);
|
|
1375
|
-
|
|
1375
|
+
I({
|
|
1376
1376
|
type: "editRefused",
|
|
1377
1377
|
code: r,
|
|
1378
1378
|
...t ? { holder: t } : {}
|
|
1379
1379
|
}, e);
|
|
1380
|
-
} else
|
|
1380
|
+
} else I({
|
|
1381
1381
|
type: "undoSkipped",
|
|
1382
1382
|
code: r
|
|
1383
1383
|
}, e);
|
|
1384
1384
|
}
|
|
1385
|
-
|
|
1385
|
+
ye(e), e === v && q();
|
|
1386
1386
|
}
|
|
1387
|
-
function
|
|
1387
|
+
function he(e) {
|
|
1388
1388
|
if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function K(e, t) {
|
|
1391
1391
|
let n = t instanceof Error ? t : Error(String(t));
|
|
1392
1392
|
for (let t of e.waiters.splice(0)) t.reject(n);
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function ge(e, t) {
|
|
1395
1395
|
if (t.revision <= e.revision) return;
|
|
1396
1396
|
let n = e.pending.find((e) => e.batchId === t.batchId);
|
|
1397
|
-
n ?
|
|
1397
|
+
n ? de(e, n, t.revision) : (e.remote.set(t.revision, t), ve(e));
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function _e(t, n) {
|
|
1400
1400
|
let r = n.ops;
|
|
1401
1401
|
if (e.normalizeRemoteOperations) try {
|
|
1402
1402
|
r = e.normalizeRemoteOperations(n.ops, t.confirmed);
|
|
1403
1403
|
} catch (e) {
|
|
1404
|
-
|
|
1404
|
+
F(e);
|
|
1405
1405
|
}
|
|
1406
1406
|
return St(r);
|
|
1407
1407
|
}
|
|
1408
|
-
function
|
|
1408
|
+
function ve(t) {
|
|
1409
1409
|
let n = [], r = !1;
|
|
1410
1410
|
for (;;) {
|
|
1411
1411
|
let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
|
|
1412
1412
|
if (!i && !a) break;
|
|
1413
1413
|
try {
|
|
1414
|
-
t.confirmed =
|
|
1414
|
+
t.confirmed = E(t.confirmed, i ? _e(t, i) : a.ops);
|
|
1415
1415
|
} catch {
|
|
1416
1416
|
if (t.recovering) {
|
|
1417
|
-
t.remote.clear(), t.own.clear(),
|
|
1417
|
+
t.remote.clear(), t.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
|
|
1418
1418
|
return;
|
|
1419
1419
|
}
|
|
1420
|
-
|
|
1420
|
+
J(t);
|
|
1421
1421
|
return;
|
|
1422
1422
|
}
|
|
1423
|
-
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0),
|
|
1423
|
+
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), G(t, a));
|
|
1424
1424
|
}
|
|
1425
|
-
if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ?
|
|
1425
|
+
if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? xe(t) : Se(t), (n.length !== 0 || r) && (ye(t), t === v)) for (let t of n) try {
|
|
1426
1426
|
e.onRemoteChange?.({
|
|
1427
1427
|
actor: t.actor,
|
|
1428
1428
|
ops: t.ops,
|
|
1429
1429
|
locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
|
|
1430
1430
|
});
|
|
1431
1431
|
} catch (e) {
|
|
1432
|
-
|
|
1432
|
+
F(e);
|
|
1433
1433
|
}
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1435
|
+
function ye(e) {
|
|
1436
1436
|
let t = !w;
|
|
1437
1437
|
w = !0;
|
|
1438
1438
|
try {
|
|
1439
|
-
|
|
1439
|
+
be(e);
|
|
1440
1440
|
} finally {
|
|
1441
1441
|
t && (w = !1);
|
|
1442
1442
|
}
|
|
1443
1443
|
t && W(e);
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1445
|
+
function be(e) {
|
|
1446
1446
|
e === v && V();
|
|
1447
1447
|
let t = e.confirmed;
|
|
1448
1448
|
for (let n = 0; n < e.pending.length; n++) {
|
|
1449
1449
|
let r = e.pending[n], i;
|
|
1450
|
-
if (r.base && !
|
|
1450
|
+
if (r.base && !H(r.base, t)) i = "precondition_failed";
|
|
1451
1451
|
else try {
|
|
1452
|
-
t =
|
|
1452
|
+
t = E(t, r.ops);
|
|
1453
1453
|
continue;
|
|
1454
1454
|
} catch (e) {
|
|
1455
|
-
i = e instanceof
|
|
1455
|
+
i = e instanceof M ? e.code : "invalid_operation";
|
|
1456
1456
|
}
|
|
1457
|
-
r.sent || (
|
|
1457
|
+
r.sent || (pe(e, r) && I(r.origin === "edit" || r.origin === "ai" ? {
|
|
1458
1458
|
type: "editRefused",
|
|
1459
1459
|
code: i
|
|
1460
1460
|
} : {
|
|
@@ -1462,54 +1462,54 @@ function Ct(e) {
|
|
|
1462
1462
|
code: i
|
|
1463
1463
|
}, e), t = e.confirmed, n = -1);
|
|
1464
1464
|
}
|
|
1465
|
-
e.view = t,
|
|
1465
|
+
e.view = t, he(e), e === v && z(t);
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function xe(e) {
|
|
1468
1468
|
e.gapTimer ||= setTimeout(() => {
|
|
1469
|
-
e.gapTimer = null, e === v &&
|
|
1469
|
+
e.gapTimer = null, e === v && q();
|
|
1470
1470
|
}, ut);
|
|
1471
1471
|
}
|
|
1472
|
-
function
|
|
1472
|
+
function Se(e) {
|
|
1473
1473
|
e.gapTimer &&= (clearTimeout(e.gapTimer), null);
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1475
|
+
function q() {
|
|
1476
1476
|
let e = v;
|
|
1477
1477
|
return e ? (e.catchingUp ||= (async () => {
|
|
1478
1478
|
try {
|
|
1479
1479
|
let n = await t.operationsAfter(e.templateId, e.revision);
|
|
1480
1480
|
if (e.retired) return;
|
|
1481
1481
|
if ("resync" in n) {
|
|
1482
|
-
await
|
|
1482
|
+
await J(e);
|
|
1483
1483
|
return;
|
|
1484
1484
|
}
|
|
1485
|
-
for (let t of n.batches)
|
|
1485
|
+
for (let t of n.batches) ge(e, t);
|
|
1486
1486
|
} catch (e) {
|
|
1487
|
-
|
|
1487
|
+
F(e);
|
|
1488
1488
|
} finally {
|
|
1489
1489
|
e.catchingUp = null;
|
|
1490
1490
|
}
|
|
1491
1491
|
})(), e.catchingUp) : Promise.resolve();
|
|
1492
1492
|
}
|
|
1493
|
-
async function
|
|
1493
|
+
async function J(t) {
|
|
1494
1494
|
t.recovering = !0;
|
|
1495
1495
|
try {
|
|
1496
1496
|
let n = await e.loadTemplate(t.templateId);
|
|
1497
1497
|
if (t.retired) return;
|
|
1498
1498
|
let r = n.revision ?? t.revision;
|
|
1499
|
-
t.confirmed =
|
|
1500
|
-
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e),
|
|
1501
|
-
t === v && (m.value = r),
|
|
1499
|
+
t.confirmed = U(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
|
|
1500
|
+
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), G(t, n));
|
|
1501
|
+
t === v && (m.value = r), ye(t), ve(t);
|
|
1502
1502
|
} catch (e) {
|
|
1503
|
-
|
|
1503
|
+
F(e);
|
|
1504
1504
|
} finally {
|
|
1505
1505
|
t.recovering = !1;
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function Ce(t) {
|
|
1509
1509
|
let n = () => t === v && !t.retired;
|
|
1510
1510
|
return {
|
|
1511
1511
|
onBatch: (e) => {
|
|
1512
|
-
n() &&
|
|
1512
|
+
n() && ge(t, e);
|
|
1513
1513
|
},
|
|
1514
1514
|
onResync: (r, i) => {
|
|
1515
1515
|
if (!(!n() || r <= t.revision)) {
|
|
@@ -1519,9 +1519,9 @@ function Ct(e) {
|
|
|
1519
1519
|
actor: i
|
|
1520
1520
|
});
|
|
1521
1521
|
} catch (e) {
|
|
1522
|
-
|
|
1522
|
+
F(e);
|
|
1523
1523
|
}
|
|
1524
|
-
|
|
1524
|
+
q();
|
|
1525
1525
|
}
|
|
1526
1526
|
},
|
|
1527
1527
|
onLock: (e) => {
|
|
@@ -1538,19 +1538,19 @@ function Ct(e) {
|
|
|
1538
1538
|
}
|
|
1539
1539
|
};
|
|
1540
1540
|
}
|
|
1541
|
-
function
|
|
1541
|
+
function we(e, r) {
|
|
1542
1542
|
let i = d;
|
|
1543
|
-
t.join(e.templateId, { sessionId: n },
|
|
1544
|
-
e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision &&
|
|
1545
|
-
}, (e) =>
|
|
1543
|
+
t.join(e.templateId, { sessionId: n }, Ce(e)).then((t) => {
|
|
1544
|
+
e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && q(), r && Q());
|
|
1545
|
+
}, (e) => F(e));
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1548
|
-
let t =
|
|
1547
|
+
function Te(e) {
|
|
1548
|
+
let t = U(e.content), n = {
|
|
1549
1549
|
templateId: e.id,
|
|
1550
1550
|
confirmed: t,
|
|
1551
1551
|
revision: e.revision ?? 0,
|
|
1552
1552
|
pending: [],
|
|
1553
|
-
view:
|
|
1553
|
+
view: U(t),
|
|
1554
1554
|
remote: /* @__PURE__ */ new Map(),
|
|
1555
1555
|
own: /* @__PURE__ */ new Map(),
|
|
1556
1556
|
inFlight: null,
|
|
@@ -1563,17 +1563,17 @@ function Ct(e) {
|
|
|
1563
1563
|
redo: [],
|
|
1564
1564
|
waiters: []
|
|
1565
1565
|
};
|
|
1566
|
-
v = n, m.value = n.revision,
|
|
1566
|
+
v = n, m.value = n.revision, L(), we(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), oe();
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1569
|
-
e.retired = !0,
|
|
1568
|
+
function Y(e) {
|
|
1569
|
+
e.retired = !0, Se(e), e.leave?.(), e.leave = null, K(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
|
|
1570
1570
|
}
|
|
1571
1571
|
function Ee(e, t) {
|
|
1572
1572
|
let n = p.value;
|
|
1573
|
-
p.value = t, t === "connected" && n !== null && n !== "connected" &&
|
|
1573
|
+
p.value = t, t === "connected" && n !== null && n !== "connected" && we(e, !0);
|
|
1574
1574
|
}
|
|
1575
1575
|
function De(e) {
|
|
1576
|
-
v && v.templateId === e?.id || (v &&= (
|
|
1576
|
+
v && v.templateId === e?.id || (v &&= (B(), Y(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, A = null, Q(), L(), e && Te(e));
|
|
1577
1577
|
}
|
|
1578
1578
|
function Oe(e, t) {
|
|
1579
1579
|
return `${e}\u0000${t ?? ""}`;
|
|
@@ -1591,7 +1591,7 @@ function Ct(e) {
|
|
|
1591
1591
|
if (e.holder.sessionId === n) return;
|
|
1592
1592
|
t ? l.add(e) : u.set(e, ++d);
|
|
1593
1593
|
let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
|
|
1594
|
-
r.set(Oe(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null),
|
|
1594
|
+
r.set(Oe(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), I({
|
|
1595
1595
|
type: "selectionRefused",
|
|
1596
1596
|
blockId: e.blockId,
|
|
1597
1597
|
holder: e.holder
|
|
@@ -1616,7 +1616,7 @@ function Ct(e) {
|
|
|
1616
1616
|
r.size !== s.value.size && (s.value = r);
|
|
1617
1617
|
}
|
|
1618
1618
|
function Pe(e) {
|
|
1619
|
-
|
|
1619
|
+
re = re.then(e).catch(F);
|
|
1620
1620
|
}
|
|
1621
1621
|
function Q() {
|
|
1622
1622
|
i && Pe(async () => {
|
|
@@ -1652,12 +1652,12 @@ function Ct(e) {
|
|
|
1652
1652
|
holder: n,
|
|
1653
1653
|
expiresAt: ""
|
|
1654
1654
|
}, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
|
|
1655
|
-
} else
|
|
1655
|
+
} else F(t), setTimeout(() => {
|
|
1656
1656
|
A?.blockId === e && Q();
|
|
1657
1657
|
}, ft[0]);
|
|
1658
1658
|
}
|
|
1659
1659
|
function Le() {
|
|
1660
|
-
|
|
1660
|
+
N ||= setInterval(() => {
|
|
1661
1661
|
Pe(async () => {
|
|
1662
1662
|
let e = j;
|
|
1663
1663
|
if (e) try {
|
|
@@ -1667,13 +1667,13 @@ function Ct(e) {
|
|
|
1667
1667
|
j = null, Re(), Q();
|
|
1668
1668
|
return;
|
|
1669
1669
|
}
|
|
1670
|
-
|
|
1670
|
+
F(e);
|
|
1671
1671
|
}
|
|
1672
1672
|
});
|
|
1673
1673
|
}, dt);
|
|
1674
1674
|
}
|
|
1675
1675
|
function Re() {
|
|
1676
|
-
|
|
1676
|
+
N &&= (clearInterval(N), null);
|
|
1677
1677
|
}
|
|
1678
1678
|
function ze(e) {
|
|
1679
1679
|
V(), v && (A = e ? {
|
|
@@ -1691,8 +1691,8 @@ function Ct(e) {
|
|
|
1691
1691
|
V();
|
|
1692
1692
|
let n = (e === "undo" ? t.undo : t.redo).pop();
|
|
1693
1693
|
if (!n) return;
|
|
1694
|
-
if (
|
|
1695
|
-
|
|
1694
|
+
if (L(), n.view && !H(n.view, t.view)) {
|
|
1695
|
+
I({
|
|
1696
1696
|
type: "undoSkipped",
|
|
1697
1697
|
code: "precondition_failed"
|
|
1698
1698
|
});
|
|
@@ -1700,30 +1700,30 @@ function Ct(e) {
|
|
|
1700
1700
|
}
|
|
1701
1701
|
let r;
|
|
1702
1702
|
try {
|
|
1703
|
-
r =
|
|
1703
|
+
r = E(t.view, n.ops, ae());
|
|
1704
1704
|
} catch (e) {
|
|
1705
|
-
if (!(e instanceof
|
|
1706
|
-
|
|
1705
|
+
if (!(e instanceof M)) throw e;
|
|
1706
|
+
I({
|
|
1707
1707
|
type: "undoSkipped",
|
|
1708
1708
|
code: e.code
|
|
1709
1709
|
});
|
|
1710
1710
|
return;
|
|
1711
1711
|
}
|
|
1712
1712
|
let i = gt({ ops: ne(t.view, n.ops) }, r);
|
|
1713
|
-
|
|
1713
|
+
R(e === "undo" ? t.redo : t.undo, i);
|
|
1714
1714
|
let a = t.view;
|
|
1715
|
-
t.view = r,
|
|
1715
|
+
t.view = r, z(r), _?.markDirty(), le(t, n.ops, e, i, a);
|
|
1716
1716
|
}
|
|
1717
1717
|
function He(e, t) {
|
|
1718
1718
|
let n = v;
|
|
1719
1719
|
if (!_ || !n || y) return {
|
|
1720
1720
|
applied: !1,
|
|
1721
|
-
error: new
|
|
1721
|
+
error: new M("invalid_operation", 0, "No template is open for editing.")
|
|
1722
1722
|
};
|
|
1723
1723
|
if (t.origin === void 0) try {
|
|
1724
|
-
|
|
1724
|
+
E(_.content.value, e, ae());
|
|
1725
1725
|
} catch (e) {
|
|
1726
|
-
if (e instanceof
|
|
1726
|
+
if (e instanceof M) return {
|
|
1727
1727
|
applied: !1,
|
|
1728
1728
|
error: e
|
|
1729
1729
|
};
|
|
@@ -1732,9 +1732,9 @@ function Ct(e) {
|
|
|
1732
1732
|
V();
|
|
1733
1733
|
let r, i;
|
|
1734
1734
|
try {
|
|
1735
|
-
r =
|
|
1735
|
+
r = E(n.view, e, ae()), i = ne(n.view, e);
|
|
1736
1736
|
} catch (e) {
|
|
1737
|
-
if (e instanceof
|
|
1737
|
+
if (e instanceof M) return {
|
|
1738
1738
|
applied: !1,
|
|
1739
1739
|
error: e
|
|
1740
1740
|
};
|
|
@@ -1742,15 +1742,15 @@ function Ct(e) {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
let a = n.undo.at(-1), o;
|
|
1744
1744
|
if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
|
|
1745
|
-
let e = a.view !== void 0 && !
|
|
1745
|
+
let e = a.view !== void 0 && !H(a.view, n.view);
|
|
1746
1746
|
a.ops = [...i, ...a.ops], o = e ? a : gt(a, r);
|
|
1747
1747
|
} else o = gt({
|
|
1748
1748
|
ops: i,
|
|
1749
1749
|
...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
|
|
1750
|
-
}, r),
|
|
1751
|
-
n.redo = [],
|
|
1750
|
+
}, r), R(n.undo, o);
|
|
1751
|
+
n.redo = [], L();
|
|
1752
1752
|
let s = n.view;
|
|
1753
|
-
return n.view = r,
|
|
1753
|
+
return n.view = r, z(r), _.markDirty(), le(n, e, t.origin ?? "edit", o, s), {
|
|
1754
1754
|
applied: !0,
|
|
1755
1755
|
inverse: i
|
|
1756
1756
|
};
|
|
@@ -1761,14 +1761,14 @@ function Ct(e) {
|
|
|
1761
1761
|
if (t.moveBlock && t.findBlockLocation) {
|
|
1762
1762
|
let n = t.moveBlock, r = (...r) => {
|
|
1763
1763
|
let i = v, a = i && !y && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
|
|
1764
|
-
if (a && se(!0), n(...r), !a ||
|
|
1764
|
+
if (a && se(!0), n(...r), !a || H(i.view, e.content.value)) return;
|
|
1765
1765
|
let o = t.findBlockLocation(r[0]);
|
|
1766
1766
|
if (!o) return;
|
|
1767
1767
|
let s = o.targetSectionId ? {
|
|
1768
1768
|
sectionId: o.targetSectionId,
|
|
1769
1769
|
column: o.columnIndex ?? 0
|
|
1770
1770
|
} : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0;
|
|
1771
|
-
|
|
1771
|
+
ce(i, [{
|
|
1772
1772
|
op: "moveBlock",
|
|
1773
1773
|
blockId: r[0],
|
|
1774
1774
|
parent: s,
|
|
@@ -1779,7 +1779,7 @@ function Ct(e) {
|
|
|
1779
1779
|
t.moveBlock === r && (t.moveBlock = n);
|
|
1780
1780
|
});
|
|
1781
1781
|
}
|
|
1782
|
-
k.push(h(() => e.state.template, (e) => De(e), { immediate: !0 }), h(() => e.content.value,
|
|
1782
|
+
k.push(h(() => e.state.template, (e) => De(e), { immediate: !0 }), h(() => e.content.value, oe, { deep: !0 }), h(() => e.state.selectedBlockId, ze), h(() => e.state.isLoading, (e) => e ? se(!0, !0) : oe())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", V)), c() && o(qe);
|
|
1783
1783
|
}
|
|
1784
1784
|
function We() {
|
|
1785
1785
|
V();
|
|
@@ -1793,13 +1793,13 @@ function Ct(e) {
|
|
|
1793
1793
|
V(), y = !0;
|
|
1794
1794
|
}
|
|
1795
1795
|
function Ke() {
|
|
1796
|
-
y = !1, v &&
|
|
1796
|
+
y = !1, v && z(v.view);
|
|
1797
1797
|
}
|
|
1798
1798
|
function qe() {
|
|
1799
|
-
if (!
|
|
1799
|
+
if (!ee) {
|
|
1800
1800
|
V();
|
|
1801
1801
|
for (let e of k.splice(0)) e();
|
|
1802
|
-
|
|
1802
|
+
B(), Be(), ee = !0, v && Y(v), v = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", V));
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
return {
|
|
@@ -1811,19 +1811,19 @@ function Ct(e) {
|
|
|
1811
1811
|
setLockLocale: je,
|
|
1812
1812
|
connection: p,
|
|
1813
1813
|
revision: m,
|
|
1814
|
-
canUndo:
|
|
1815
|
-
canRedo:
|
|
1814
|
+
canUndo: ie,
|
|
1815
|
+
canRedo: P,
|
|
1816
1816
|
attach: Ue,
|
|
1817
1817
|
undo: () => Ve("undo"),
|
|
1818
1818
|
redo: () => Ve("redo"),
|
|
1819
1819
|
clearHistory: () => {
|
|
1820
|
-
v && (v.undo = [], v.redo = [],
|
|
1820
|
+
v && (v.undo = [], v.redo = [], L());
|
|
1821
1821
|
},
|
|
1822
1822
|
flush: V,
|
|
1823
1823
|
settle: We,
|
|
1824
1824
|
suspend: Ge,
|
|
1825
1825
|
resume: Ke,
|
|
1826
|
-
catchUp:
|
|
1826
|
+
catchUp: q,
|
|
1827
1827
|
hasConfirmedBlock: (e) => v ? bt(v.confirmed.blocks, e) : !1,
|
|
1828
1828
|
applyOperations: He,
|
|
1829
1829
|
destroy: qe
|
|
@@ -1846,7 +1846,7 @@ function wt(e) {
|
|
|
1846
1846
|
return s.value && e.canDelete !== !1;
|
|
1847
1847
|
}
|
|
1848
1848
|
function u(e, t) {
|
|
1849
|
-
throw new
|
|
1849
|
+
throw new W(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1850
1850
|
}
|
|
1851
1851
|
function d(t) {
|
|
1852
1852
|
Q(e.onError, t);
|
|
@@ -1944,7 +1944,7 @@ function Et(e = {}) {
|
|
|
1944
1944
|
},
|
|
1945
1945
|
async create(e) {
|
|
1946
1946
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1947
|
-
id:
|
|
1947
|
+
id: k(),
|
|
1948
1948
|
name: e.name,
|
|
1949
1949
|
content: e.content,
|
|
1950
1950
|
...e.category ? { category: e.category } : {},
|
|
@@ -2011,7 +2011,7 @@ function kt(e = {}) {
|
|
|
2011
2011
|
},
|
|
2012
2012
|
async create(e) {
|
|
2013
2013
|
let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
2014
|
-
id:
|
|
2014
|
+
id: k(),
|
|
2015
2015
|
url: t,
|
|
2016
2016
|
filename: e.filename || e.file.name,
|
|
2017
2017
|
createdAt: n,
|
|
@@ -2051,11 +2051,11 @@ function At(e) {
|
|
|
2051
2051
|
let { provider: t, getTemplateId: n } = e, r = S([]), i = S(!1), a = S(void 0), o = S(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
|
|
2052
2052
|
function u(e) {
|
|
2053
2053
|
let t = n();
|
|
2054
|
-
if (!t) throw new
|
|
2054
|
+
if (!t) throw new W(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
2055
2055
|
return t;
|
|
2056
2056
|
}
|
|
2057
2057
|
function d(e) {
|
|
2058
|
-
throw new
|
|
2058
|
+
throw new W(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2059
2059
|
}
|
|
2060
2060
|
function f(t) {
|
|
2061
2061
|
Q(e.onError, t);
|
|
@@ -2134,16 +2134,16 @@ function jt(e) {
|
|
|
2134
2134
|
});
|
|
2135
2135
|
function m(e) {
|
|
2136
2136
|
let t = n();
|
|
2137
|
-
if (!t) throw new
|
|
2137
|
+
if (!t) throw new W(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
2138
2138
|
return t;
|
|
2139
2139
|
}
|
|
2140
2140
|
function h(e) {
|
|
2141
2141
|
let t = r();
|
|
2142
|
-
if (!t) throw new
|
|
2142
|
+
if (!t) throw new W(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
2143
2143
|
return t;
|
|
2144
2144
|
}
|
|
2145
2145
|
function g(e) {
|
|
2146
|
-
throw new
|
|
2146
|
+
throw new W(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2147
2147
|
}
|
|
2148
2148
|
function _(e) {
|
|
2149
2149
|
for (let t of i.value) {
|
|
@@ -2254,7 +2254,7 @@ function jt(e) {
|
|
|
2254
2254
|
o.value = !1;
|
|
2255
2255
|
}
|
|
2256
2256
|
}
|
|
2257
|
-
async function
|
|
2257
|
+
async function te(e, n) {
|
|
2258
2258
|
let { setResolved: r } = t;
|
|
2259
2259
|
typeof r != "function" && g("setResolved");
|
|
2260
2260
|
let i = m("setResolved");
|
|
@@ -2268,13 +2268,13 @@ function jt(e) {
|
|
|
2268
2268
|
o.value = !1;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function A(e) {
|
|
2272
2272
|
T(e) && x(() => t.onCreated?.(e, { origin: "remote" }));
|
|
2273
2273
|
}
|
|
2274
|
-
function
|
|
2274
|
+
function j(e) {
|
|
2275
2275
|
T(e) && x(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function ne(e, n) {
|
|
2278
2278
|
let r = E(e, n);
|
|
2279
2279
|
r && x(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
2280
2280
|
}
|
|
@@ -2293,12 +2293,12 @@ function jt(e) {
|
|
|
2293
2293
|
create: O,
|
|
2294
2294
|
update: ee,
|
|
2295
2295
|
remove: k,
|
|
2296
|
-
setResolved:
|
|
2296
|
+
setResolved: te,
|
|
2297
2297
|
find: _,
|
|
2298
2298
|
isOwn: y,
|
|
2299
|
-
applyRemoteCreate:
|
|
2300
|
-
applyRemoteUpdate:
|
|
2301
|
-
applyRemoteDelete:
|
|
2299
|
+
applyRemoteCreate: A,
|
|
2300
|
+
applyRemoteUpdate: j,
|
|
2301
|
+
applyRemoteDelete: ne
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
function Mt(e) {
|
|
@@ -2355,7 +2355,7 @@ function Pt(t) {
|
|
|
2355
2355
|
};
|
|
2356
2356
|
}
|
|
2357
2357
|
function Ft(e) {
|
|
2358
|
-
let t = a(
|
|
2358
|
+
let t = a(_e, null), n = v(e);
|
|
2359
2359
|
if (!t) return n;
|
|
2360
2360
|
let i;
|
|
2361
2361
|
function s() {
|
|
@@ -2382,14 +2382,14 @@ function It(e, t) {
|
|
|
2382
2382
|
return typeof n == "string" && n.length > 0 ? n : t;
|
|
2383
2383
|
}
|
|
2384
2384
|
function Lt(e, t) {
|
|
2385
|
-
return typeof e?.url == "string" &&
|
|
2385
|
+
return typeof e?.url == "string" && F(e.url, t);
|
|
2386
2386
|
}
|
|
2387
2387
|
function Rt(e, t) {
|
|
2388
2388
|
let n = e?.url;
|
|
2389
|
-
if (typeof n == "string" && n.trim() !== "") return
|
|
2389
|
+
if (typeof n == "string" && n.trim() !== "") return F(n, t) ? void 0 : n;
|
|
2390
2390
|
}
|
|
2391
2391
|
function zt(e) {
|
|
2392
|
-
let t = a(
|
|
2392
|
+
let t = a(ge, O.liquid), n = Ft(() => Rt(e(), t));
|
|
2393
2393
|
return v(() => Lt(e(), t) ? null : n.value);
|
|
2394
2394
|
}
|
|
2395
2395
|
function Bt(e, t, n) {
|
|
@@ -2406,7 +2406,7 @@ function Ht(e, t, n = []) {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
// src/utils/resolveFieldColors.ts
|
|
2408
2408
|
function Ut(e, t) {
|
|
2409
|
-
let n =
|
|
2409
|
+
let n = Se({ presets: e.presets }, q), r = n.presets.length === 0;
|
|
2410
2410
|
return {
|
|
2411
2411
|
presets: r ? t.presets : n.presets,
|
|
2412
2412
|
allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
|
|
@@ -2466,7 +2466,7 @@ var Xt = /* @__PURE__ */ t({
|
|
|
2466
2466
|
size: { default: "field" }
|
|
2467
2467
|
},
|
|
2468
2468
|
setup(e) {
|
|
2469
|
-
let t = e, { t: r } =
|
|
2469
|
+
let t = e, { t: r } = be(), i = {
|
|
2470
2470
|
field: {
|
|
2471
2471
|
gap: "tpl:gap-1.5",
|
|
2472
2472
|
icon: 18,
|
|
@@ -2481,11 +2481,11 @@ var Xt = /* @__PURE__ */ t({
|
|
|
2481
2481
|
return (t, i) => (n(), l("div", {
|
|
2482
2482
|
class: p(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", a.value.gap]),
|
|
2483
2483
|
style: y({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
|
|
2484
|
-
}, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(
|
|
2484
|
+
}, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(he), {
|
|
2485
2485
|
class: "tpl-spinner",
|
|
2486
2486
|
size: a.value.icon,
|
|
2487
2487
|
"stroke-width": 2
|
|
2488
|
-
}, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(
|
|
2488
|
+
}, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(K), {
|
|
2489
2489
|
size: a.value.icon,
|
|
2490
2490
|
"stroke-width": 1.5
|
|
2491
2491
|
}, null, 8, ["size"]), d(" " + g(f(r).image.dropToUpload), 1)], 64))], 6));
|
|
@@ -2501,7 +2501,7 @@ function Zt() {
|
|
|
2501
2501
|
// src/composables/useImageDrop.ts
|
|
2502
2502
|
var Qt = "image/";
|
|
2503
2503
|
function $t(e) {
|
|
2504
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } =
|
|
2504
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = xe(t, {
|
|
2505
2505
|
preventDefaultForUnhandled: !0,
|
|
2506
2506
|
onDrop: (e) => {
|
|
2507
2507
|
if (!i()) return;
|
|
@@ -2513,7 +2513,7 @@ function $t(e) {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
// src/composables/useMediaDropField.ts
|
|
2515
2515
|
function en(e) {
|
|
2516
|
-
let { target: t, blocked: n, apply: r } = e, i = a(
|
|
2516
|
+
let { target: t, blocked: n, apply: r } = e, i = a(ve, null), o = a(ye, null), s = Zt();
|
|
2517
2517
|
async function c() {
|
|
2518
2518
|
let e = await i?.({ accept: ["images"] });
|
|
2519
2519
|
s.alive && e && r(e);
|
|
@@ -2558,11 +2558,24 @@ var nn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", rn = {
|
|
|
2558
2558
|
33.33,
|
|
2559
2559
|
33.34
|
|
2560
2560
|
],
|
|
2561
|
+
4: [
|
|
2562
|
+
25,
|
|
2563
|
+
25,
|
|
2564
|
+
25,
|
|
2565
|
+
25
|
|
2566
|
+
],
|
|
2561
2567
|
"1-2": [33.33, 66.67],
|
|
2562
|
-
"2-1": [66.67, 33.33]
|
|
2568
|
+
"2-1": [66.67, 33.33],
|
|
2569
|
+
"1-3": [25, 75],
|
|
2570
|
+
"3-1": [75, 25],
|
|
2571
|
+
"1-2-1": [
|
|
2572
|
+
25,
|
|
2573
|
+
50,
|
|
2574
|
+
25
|
|
2575
|
+
]
|
|
2563
2576
|
};
|
|
2564
2577
|
function an(e, t) {
|
|
2565
|
-
let n = (e) => Math.trunc(e ?? 0), r = (e) =>
|
|
2578
|
+
let n = (e) => Math.trunc(e ?? 0), r = (e) => fe(e) === null ? 0 : Math.trunc(e.width);
|
|
2566
2579
|
return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
|
|
2567
2580
|
}
|
|
2568
2581
|
function on(e, t) {
|
|
@@ -2573,23 +2586,23 @@ function sn(e, t) {
|
|
|
2573
2586
|
return Math.floor(t) - an(e.styles.padding, n);
|
|
2574
2587
|
}
|
|
2575
2588
|
function* cn(e, t) {
|
|
2576
|
-
for (let n of e)
|
|
2589
|
+
for (let n of e) V(n) ? yield* cn(n.children, on(t, n.styles.padding)) : yield {
|
|
2577
2590
|
block: n,
|
|
2578
|
-
bandWidth:
|
|
2591
|
+
bandWidth: G(n) && n.wrapper ? on(t, n.wrapper.padding) : t
|
|
2579
2592
|
};
|
|
2580
2593
|
}
|
|
2581
|
-
function ln(e, t, n =
|
|
2594
|
+
function ln(e, t, n = P(e)) {
|
|
2582
2595
|
if (!t) return e;
|
|
2583
2596
|
try {
|
|
2584
|
-
return le(
|
|
2597
|
+
return le(re(t, n, { missing: "default" }), e);
|
|
2585
2598
|
} catch {
|
|
2586
2599
|
return e;
|
|
2587
2600
|
}
|
|
2588
2601
|
}
|
|
2589
2602
|
function un(e, t, n, r) {
|
|
2590
2603
|
let i = ln(e, n, r);
|
|
2591
|
-
for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (
|
|
2592
|
-
let r =
|
|
2604
|
+
for (let { block: e, bandWidth: n } of cn(i.blocks, i.settings.width)) if (G(e)) {
|
|
2605
|
+
let r = ue(e)?.applied ? void 0 : e.border, i = Math.floor(n) - an(e.styles.padding, r), a = rn[e.columns] ?? [100];
|
|
2593
2606
|
for (let n = 0; n < e.children.length; n++) {
|
|
2594
2607
|
let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
|
|
2595
2608
|
if (o) return sn(o, r);
|
|
@@ -2603,14 +2616,14 @@ function dn(e, t, n, r) {
|
|
|
2603
2616
|
return null;
|
|
2604
2617
|
}
|
|
2605
2618
|
function fn(e) {
|
|
2606
|
-
let t =
|
|
2619
|
+
let t = G(e) ? ue(e) : null;
|
|
2607
2620
|
return !!t?.applied && t.height === "image";
|
|
2608
2621
|
}
|
|
2609
2622
|
function pn(e, t, n, r) {
|
|
2610
2623
|
if (fn(e)) return (t ? dn(t, e.id, n, r) : null) ?? tn(t?.settings);
|
|
2611
2624
|
}
|
|
2612
2625
|
// src/constants/socialIcons.ts
|
|
2613
|
-
var mn =
|
|
2626
|
+
var mn = se, hn = {
|
|
2614
2627
|
small: 24,
|
|
2615
2628
|
medium: 32,
|
|
2616
2629
|
large: 48
|
|
@@ -2636,4 +2649,4 @@ var mn = ue, hn = {
|
|
|
2636
2649
|
];
|
|
2637
2650
|
export { Et as A, ze as B, Bt as C, jt as D, Mt as E, We as F, Ue as I, Ve as L, Ct as M, lt as N, At as O, Ge as P, He as R, Rt as S, Ft as T, Fe as V, Gt as _, fn as a, Vt as b, nn as c, Zt as d, Xt as f, Kt as g, qt as h, un as i, wt as j, kt as k, tn as l, Yt as m, mn as n, pn as o, Jt as p, gn as r, dn as s, hn as t, en as u, Ut as v, zt as w, Pt as x, Ht as y, Be as z };
|
|
2638
2651
|
|
|
2639
|
-
//# sourceMappingURL=socialIcons-
|
|
2652
|
+
//# sourceMappingURL=socialIcons-Qw9rHc8C.js.map
|