@templatical/editor 0.56.1 → 0.57.1
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/README.md +1 -1
- package/dist/{AiAltTextPopover-CpZ7UeAZ.js → AiAltTextPopover-BiZHthAB.js} +5 -5
- package/dist/{AiAltTextReview-LYxvn7Qe.js → AiAltTextReview-BwhROHiF.js} +6 -6
- package/dist/{AiChatPanel-Cy05P-iO.js → AiChatPanel-Cros4ZCM.js} +22 -25
- package/dist/AiPanels-D_CdHqFZ.js +26 -0
- package/dist/{AiRewriteMenu-DgqJHnza.js → AiRewriteMenu-6b8GNj64.js} +53 -53
- package/dist/{BlockIssueBadge-CxHJmuOh.js → BlockIssueBadge-i2cZy5PB.js} +5 -5
- package/dist/{BlockPreviewCanvas-DEmNZkEG.js → BlockPreviewCanvas-BAYIy-QJ.js} +27 -27
- package/dist/{CloudHeaderExtras-Cqhw-jMz.js → CloudHeaderExtras-CJsXi4Ku.js} +2 -2
- package/dist/{CloudPanels-Bmlf05Il.js → CloudPanels-Cb54vtYC.js} +6 -6
- package/dist/{CollaborationNotices-C27GCMvK.js → CollaborationNotices-DkYX-ose.js} +3 -3
- package/dist/{CollaboratorBar-CLQjksX-.js → CollaboratorBar-xDweDvB6.js} +3 -3
- package/dist/CommentsPanel-t3w16YUl.js +23 -0
- package/dist/CommentsSidebar-B3M90RY_.js +516 -0
- package/dist/{CountdownBlock-D8dqjm3F.js → CountdownBlock-BrR2uqM3.js} +4 -4
- package/dist/{CountdownToolbar-IjpCOjCd.js → CountdownToolbar-CTbJPh8B.js} +7 -7
- package/dist/{IssuesPanel-uwuzeMSW.js → IssuesPanel-BUKc8lld.js} +13 -13
- package/dist/{LanguageMenu-C-eQ0lFy.js → LanguageMenu-DruJAMET.js} +16 -16
- package/dist/{LoadingTrack-BG8cg9xi.js → LoadingTrack-c4SeD16s.js} +1 -1
- package/dist/{LocaleNotices-CDK_9D7P.js → LocaleNotices-D6zk-QCL.js} +5 -5
- package/dist/{LogicTagInsertButton-BSolF7Fd.js → LogicTagInsertButton-Ci7V0Exe.js} +65 -65
- package/dist/{MediaEditModal-C8yc9dxt.js → MediaEditModal-BxbwZxnf.js} +4 -4
- package/dist/{MediaPanels-FI4I8asn.js → MediaPanels-BiUxsTMM.js} +2 -2
- package/dist/{MergeTagInput-B1nl2ZMT.js → MergeTagInput-BA89v7KJ.js} +2 -2
- package/dist/{MergeTagModeToggle-DXvb80OE.js → MergeTagModeToggle-De_FNmcG.js} +7 -7
- package/dist/{MergeTagTextarea-DJlf3VbS.js → MergeTagTextarea-BRMB24Dg.js} +9 -9
- package/dist/{ParagraphEditor-Dqco128s.js → ParagraphEditor-DYqh0kEa.js} +51 -51
- package/dist/{RestoreVersionDialog-hqLCuGV5.js → RestoreVersionDialog-CRkyFafq.js} +5 -5
- package/dist/{RichTextEditorContent-xIEF0Y3Z.js → RichTextEditorContent-WeCqqCy3.js} +10 -10
- package/dist/{SaveBlockDialog-CQlCP_XC.js → SaveBlockDialog-D992yyO4.js} +15 -15
- package/dist/{SavedBlocksBrowserModal-BXA32Fx6.js → SavedBlocksBrowserModal-tH74h2Tz.js} +13 -13
- package/dist/{SavedBlocksPanels-BKUzbamj.js → SavedBlocksPanels-BuzEwYfp.js} +2 -2
- package/dist/{SavedBlocksPickBar-BlvF-4UF.js → SavedBlocksPickBar-DbULBPsI.js} +4 -4
- package/dist/{TemplateSettings-CYFtR8zv.js → TemplateSettings-eMBAy_wd.js} +14 -14
- package/dist/{TestEmailModal-BbaL17HO.js → TestEmailModal-hb9iopaZ.js} +13 -13
- package/dist/{TestEmailPanel-DhB1CSpg.js → TestEmailPanel-DbeZjj0u.js} +2 -2
- package/dist/{TitleEditor-3BRl8u5l.js → TitleEditor-CisDioGi.js} +14 -14
- package/dist/{ToggleSwitch-R3wCCYE6.js → ToggleSwitch-BIPdFWUr.js} +1 -1
- package/dist/{Toolbar-pzNIakGM.js → Toolbar-BUVRjylH.js} +218 -218
- package/dist/{TplModal-WNuWhHZm.js → TplModal-BPPP-uM6.js} +6 -6
- package/dist/{VersionHistoryMenu--T-Qp_mH.js → VersionHistoryMenu-Cd2IaHgT.js} +10 -10
- package/dist/{VersionHistoryPanels-BPubvYIE.js → VersionHistoryPanels-BNONrE-8.js} +2 -2
- package/dist/{VersionPreviewBanner-ClL3Wkln.js → VersionPreviewBanner-lkAf7tc8.js} +3 -3
- package/dist/{WrapperBlock-CjfCPceb.js → WrapperBlock-B3UAv5kv.js} +5 -5
- package/dist/{blockTypeIcons-12OMwVyN.js → blockTypeIcons-BPPpqFc2.js} +3 -3
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js → AiAltTextPopover-CafZSF50.js} +5 -5
- package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js.map → AiAltTextPopover-CafZSF50.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js → AiAltTextReview-BJcaqyp5.js} +6 -6
- package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js.map → AiAltTextReview-BJcaqyp5.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-C2gpq4kP.js → AiChatPanel-DNCUpV8n.js} +15 -18
- package/dist/cdn/chunks/AiChatPanel-DNCUpV8n.js.map +1 -0
- package/dist/cdn/chunks/AiPanels-IV0VEkBL.js +27 -0
- package/dist/cdn/chunks/AiPanels-IV0VEkBL.js.map +1 -0
- package/dist/cdn/chunks/{AiRewriteMenu-CnkyjPEu.js → AiRewriteMenu-DFUZWA7e.js} +58 -58
- package/dist/cdn/chunks/AiRewriteMenu-DFUZWA7e.js.map +1 -0
- package/dist/cdn/chunks/{BlockIssueBadge-DncZ-HDf.js → BlockIssueBadge-DIlFDDwh.js} +5 -5
- package/dist/cdn/chunks/BlockIssueBadge-DIlFDDwh.js.map +1 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-CCSEzL46.js → BlockPreviewCanvas-D0VhkzY8.js} +28 -28
- package/dist/cdn/chunks/BlockPreviewCanvas-D0VhkzY8.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js → CloudHeaderExtras-CazfMn6A.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js.map → CloudHeaderExtras-CazfMn6A.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-CRztnw4M.js → CloudPanels-BiU1MD-4.js} +5 -5
- package/dist/cdn/chunks/CloudPanels-BiU1MD-4.js.map +1 -0
- package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js → CollaborationNotices-DGA8XRZJ.js} +4 -4
- package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js.map → CollaborationNotices-DGA8XRZJ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js → CollaboratorBar-BWL1Shc1.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js.map → CollaboratorBar-BWL1Shc1.js.map} +1 -1
- package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js +24 -0
- package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js.map +1 -0
- package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js +486 -0
- package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js → CountdownBlock-Do6oItNW.js} +5 -5
- package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js.map → CountdownBlock-Do6oItNW.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js → CountdownToolbar-CH8UK01N.js} +8 -8
- package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js.map → CountdownToolbar-CH8UK01N.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CrplCzo8.js → IssuesPanel-3NPqHXJx.js} +9 -9
- package/dist/cdn/chunks/IssuesPanel-3NPqHXJx.js.map +1 -0
- package/dist/cdn/chunks/{LanguageMenu-B6MNInCL.js → LanguageMenu-75uu4P2d.js} +105 -105
- package/dist/cdn/chunks/LanguageMenu-75uu4P2d.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js → LoadingTrack-o-89hApJ.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js.map → LoadingTrack-o-89hApJ.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js → LocaleNotices-CUN5K5QJ.js} +5 -5
- package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js.map → LocaleNotices-CUN5K5QJ.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js → LogicTagInsertButton-C5L73hYh.js} +12 -12
- package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js.map → LogicTagInsertButton-C5L73hYh.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js → MediaEditModal-BHTMNHx0.js} +4 -4
- package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js.map → MediaEditModal-BHTMNHx0.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js → MediaPanels-BlianNRh.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js.map → MediaPanels-BlianNRh.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js → MergeTagInput-D8cbnnZu.js} +3 -3
- package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js.map → MergeTagInput-D8cbnnZu.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js → MergeTagModeToggle-D-RhwBsO.js} +6 -6
- package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js.map → MergeTagModeToggle-D-RhwBsO.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js → MergeTagTextarea-CAJIi2FE.js} +7 -7
- package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js.map → MergeTagTextarea-CAJIi2FE.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js → ParagraphEditor-sRPXZDzp.js} +30 -30
- package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js.map → ParagraphEditor-sRPXZDzp.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-CPrrWTsT.js → RestoreVersionDialog-CJK-14PX.js} +5 -5
- package/dist/cdn/chunks/RestoreVersionDialog-CJK-14PX.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js → RichTextEditorContent-DU0wtA_j.js} +9 -9
- package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js.map → RichTextEditorContent-DU0wtA_j.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js → SaveBlockDialog-C8hY9xA-.js} +13 -13
- package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js.map → SaveBlockDialog-C8hY9xA-.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js → SavedBlocksBrowserModal-B3nFAgAa.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js.map → SavedBlocksBrowserModal-B3nFAgAa.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js → SavedBlocksPanels-CQenugHO.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js.map → SavedBlocksPanels-CQenugHO.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js → SavedBlocksPickBar-DzUP4IYv.js} +5 -5
- package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js.map → SavedBlocksPickBar-DzUP4IYv.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js → TemplateSettings-DnOwyN_1.js} +12 -12
- package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js.map → TemplateSettings-DnOwyN_1.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js → TestEmailModal-BFqmfOZ1.js} +10 -10
- package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js.map → TestEmailModal-BFqmfOZ1.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js → TestEmailPanel-DFOhhaa9.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js.map → TestEmailPanel-DFOhhaa9.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js → TitleEditor-ChPXTB9T.js} +13 -13
- package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js.map → TitleEditor-ChPXTB9T.js.map} +1 -1
- package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js → ToggleSwitch-C0w0srN_.js} +2 -2
- package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js.map → ToggleSwitch-C0w0srN_.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-VH07SzX7.js → Toolbar-bbO5WoKo.js} +302 -302
- package/dist/cdn/chunks/Toolbar-bbO5WoKo.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DMe6J811.js → TplModal-Bg97XHIJ.js} +6 -6
- package/dist/cdn/chunks/{TplModal-DMe6J811.js.map → TplModal-Bg97XHIJ.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js → VersionHistoryMenu-BNPxnWiO.js} +9 -9
- package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js.map → VersionHistoryMenu-BNPxnWiO.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js → VersionHistoryPanels-CyyRXWPU.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js.map → VersionHistoryPanels-CyyRXWPU.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js → VersionPreviewBanner-BldFvgxJ.js} +4 -4
- package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js.map → VersionPreviewBanner-BldFvgxJ.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js → WrapperBlock-ZBCf7Y8u.js} +6 -6
- package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js.map → WrapperBlock-ZBCf7Y8u.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js → blockTypeIcons-19xd5ZPi.js} +6 -6
- package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js.map → blockTypeIcons-19xd5ZPi.js.map} +1 -1
- package/dist/cdn/chunks/{composables-D3lsO7Io.js → composables-CMBZad02.js} +750 -730
- package/dist/cdn/chunks/composables-CMBZad02.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-CE79GB1H.js → createCloudRuntime-BHGFjpek.js} +157 -143
- package/dist/cdn/chunks/createCloudRuntime-BHGFjpek.js.map +1 -0
- package/dist/cdn/chunks/da-CYWJkrTg.js +97 -0
- package/dist/cdn/chunks/da-CYWJkrTg.js.map +1 -0
- package/dist/cdn/chunks/da-qQzj0QGy.js +950 -0
- package/dist/cdn/chunks/da-qQzj0QGy.js.map +1 -0
- package/dist/cdn/chunks/{dist-BzXULHvI.js → dist-BtWMy7UQ.js} +3 -3
- package/dist/cdn/chunks/{dist-BzXULHvI.js.map → dist-BtWMy7UQ.js.map} +1 -1
- package/dist/cdn/chunks/{dist-Cf1pSluo.js → dist-zu1jwYIS.js} +4 -4
- package/dist/cdn/chunks/{dist-Cf1pSluo.js.map → dist-zu1jwYIS.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-DepKdldn.js → draggable-IRVFEZ-b.js} +1535 -1500
- package/dist/cdn/chunks/draggable-IRVFEZ-b.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-CN69NlOK.js → editor-modal-CarOiAYJ.js} +77 -76
- package/dist/cdn/chunks/{editor-modal-CN69NlOK.js.map → editor-modal-CarOiAYJ.js.map} +1 -1
- package/dist/cdn/chunks/en-B4s_0ryk.js +1 -0
- package/dist/cdn/chunks/{extensions-8dlM-fU4.js → extensions-Beg0g2wm.js} +7 -7
- package/dist/cdn/chunks/{extensions-8dlM-fU4.js.map → extensions-Beg0g2wm.js.map} +1 -1
- package/dist/cdn/chunks/{icons-DHExFLlT.js → icons-Cl4oR2mf.js} +73 -73
- package/dist/cdn/chunks/icons-Cl4oR2mf.js.map +1 -0
- package/dist/cdn/chunks/keys-BQqbBUag.js +11 -0
- package/dist/cdn/chunks/keys-BQqbBUag.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js → normalizeMergeTagMarkup-B8yU4usU.js} +55 -55
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js.map → normalizeMergeTagMarkup-B8yU4usU.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js → preRenderCustomBlocks-CPHm2GOQ.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js.map → preRenderCustomBlocks-CPHm2GOQ.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-B3njfkSy.js → sanitizeHtml-B7LC0gKK.js} +22 -11
- package/dist/cdn/chunks/sanitizeHtml-B7LC0gKK.js.map +1 -0
- package/dist/cdn/chunks/{socialIcons-BFgc3qqJ.js → socialIcons-D9D02_y5.js} +575 -524
- package/dist/cdn/chunks/socialIcons-D9D02_y5.js.map +1 -0
- package/dist/cdn/chunks/{src-C9JWWxAk.js → src-BCrSqaj8.js} +108 -95
- package/dist/cdn/chunks/src-BCrSqaj8.js.map +1 -0
- package/dist/cdn/chunks/{src-GgKlXNxy.js → src-BO4aXl_Y.js} +232 -228
- package/dist/cdn/chunks/src-BO4aXl_Y.js.map +1 -0
- package/dist/cdn/chunks/{src-mXG-Of9A.js → src-DeywvttP.js} +812 -780
- package/dist/cdn/chunks/src-DeywvttP.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C940SvId.js → tiptap-BPiZqxCt.js} +40 -31
- package/dist/cdn/chunks/tiptap-BPiZqxCt.js.map +1 -0
- package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js → useCloudI18n-Dr4S2TRW.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js.map → useCloudI18n-Dr4S2TRW.js.map} +1 -1
- package/dist/cdn/chunks/useEditorRoot-B_kf_k-g.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-Beau2Z_T.js.map → useEditorRoot-B_kf_k-g.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-D8s7HtTn.js → useI18n-CSf-ZpcM.js} +3 -3
- package/dist/cdn/chunks/{useI18n-D8s7HtTn.js.map → useI18n-CSf-ZpcM.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-oykFcYrW.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-Bgg4qpev.js.map → useLocalizedDisplay-oykFcYrW.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js → useLogicTag-D_qg9qqO.js} +4 -4
- package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js.map → useLogicTag-D_qg9qqO.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js → useMergeTag-VLnVHtxV.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js.map → useMergeTag-VLnVHtxV.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js → usePopoverPosition-BJFFi8x6.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js.map → usePopoverPosition-BJFFi8x6.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js → useScrollToBlock-MI4PP5lk.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js.map → useScrollToBlock-MI4PP5lk.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js → withCurrentFont-m6TtR0dC.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js.map → withCurrentFont-m6TtR0dC.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +685 -663
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-CcuCoJDh.js → check-C7ua4TAK.js} +1 -1
- package/dist/{chevron-down-BfYIbFbC.js → chevron-down-DftQrAkI.js} +1 -1
- package/dist/{chevron-right-DyjFqY35.js → chevron-right-B-DULGbg.js} +1 -1
- package/dist/{chevron-up-BHEIxuS-.js → chevron-up-CeYsyD8c.js} +1 -1
- package/dist/{circle-alert-Tq7kAh9S.js → circle-exclamation-point-DHjORV_I.js} +3 -3
- package/dist/{clock-Df0ZiXwQ.js → clock-CajOtLEZ.js} +1 -1
- package/dist/{composables-DreAt_0A.js → composables-Cq7rsxRc.js} +1123 -1103
- package/dist/{createCloudRuntime-CL4tUlDC.js → createCloudRuntime-CHsFF8DI.js} +42 -28
- package/dist/{createLucideIcon-CfBdtoUw.js → createLucideIcon-D-mELTSY.js} +6 -6
- package/dist/da-CYWJkrTg.js +95 -0
- package/dist/da-qQzj0QGy.js +948 -0
- package/dist/{dist-CX7skkvG.js → dist-A328tG0Z.js} +2 -2
- package/dist/{dist-BjzK1g4Z.js → dist-B15BvV94.js} +2 -2
- package/dist/{dist-DDytHU_6.js → dist-B3G4Yvpd.js} +3 -3
- package/dist/{dist-CiYotUR8.js → dist-B6ptxfPo.js} +3 -3
- package/dist/{dist-0GWMyHtM.js → dist-BmV-2uBJ.js} +2 -2
- package/dist/{dist-CCLRTtJP.js → dist-BxKFi2h_.js} +5 -5
- package/dist/{dist-BMUUt3zJ.js → dist-C0hVefGI.js} +791 -759
- package/dist/{dist-CsknfjrZ.js → dist-CMBOqk9I.js} +7 -7
- package/dist/{dist-ZrT0vAB6.js → dist-CXTsTO5h.js} +2 -2
- package/dist/{dist-Dq9VnANT.js → dist-D5BUcCjv.js} +2 -2
- package/dist/dist-D9cbSSSx.js +4 -0
- package/dist/{dist-BsumKKh9.js → dist-DAdrn64r.js} +2 -2
- package/dist/{dist-C3avsUq9.js → dist-DENg3ORe.js} +31 -22
- package/dist/{dist-Cr1CLCmx.js → dist-DI_8rB1X.js} +2 -2
- package/dist/dist-ELLEk-lS.js +4 -0
- package/dist/{editor-modal-BD32TXws.js → editor-modal-CgsaLpwB.js} +20 -19
- package/dist/en-DBLcB-CW.js +1 -0
- package/dist/{extensions-DKxHlSd7.js → extensions-BSXjPQEc.js} +21 -21
- package/dist/{eye-B3psrAqd.js → eye-fe5sKF_K.js} +1 -1
- package/dist/{image-C3yuPDxx.js → image-CUC7SZiW.js} +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/{info-DKja7A68.js → info-DDbLU4pT.js} +1 -1
- package/dist/keys-D9oKZN1h.js +9 -0
- package/dist/{link-DhzPI4Hn.js → link-C2icj0iH.js} +1 -1
- package/dist/{list-DVGn7Ik2.js → list-KYC_Jb5A.js} +1 -1
- package/dist/{loader-circle-DqKWsMHO.js → loader-circle-DmyagWpc.js} +1 -1
- package/dist/{message-circle-C4TonoBs.js → message-circle-ijyWn6UJ.js} +1 -1
- package/dist/{normalizeMergeTagMarkup-Da9JAgx7.js → normalizeMergeTagMarkup-CBLCQe02.js} +82 -82
- package/dist/{package-9OkiEO4S.js → package-CKYm_jQY.js} +1 -1
- package/dist/{pencil-M9vkOB7C.js → pencil-C2TRSR-Y.js} +1 -1
- package/dist/{plus-DxZiv9YC.js → plus-CotJVDxb.js} +1 -1
- package/dist/{preRenderCustomBlocks-CdqSp2P7.js → preRenderCustomBlocks-e2OlY4aU.js} +3 -3
- package/dist/{refresh-cw-UY8_sdFG.js → refresh-cw-CuCRV6D5.js} +1 -1
- package/dist/{rotate-ccw-BFTGCpHn.js → rotate-ccw-BlnQ3y6R.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-DlHp8xgy.js → runtime-dom.esm-bundler-nN-jsqr1.js} +20 -20
- package/dist/{sanitizeHtml-wBibnBF4.js → sanitizeHtml-Dfn-fH17.js} +25 -14
- package/dist/{search-RuGJnMEn.js → search-Dxw6oFrZ.js} +1 -1
- package/dist/{send-DGB1ar02.js → send-C-blQBZ9.js} +1 -1
- package/dist/{smartphone-CVA29CU_.js → smartphone-rLz4X-Dd.js} +1 -1
- package/dist/{socialIcons-oo4uL16Y.js → socialIcons-BZRLo0eT.js} +600 -549
- package/dist/{sparkles-IHfEwEcd.js → sparkles-JWQlUiSn.js} +1 -1
- package/dist/{square-_Cl44UU6.js → square-DshDy1Il.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +748 -726
- package/dist/{text-align-start-Dqk2Xt_Q.js → text-align-start-CyasaQtr.js} +13 -13
- package/dist/{trash-Cr7rD5Hh.js → trash-B1lZp2Tv.js} +1 -1
- package/dist/{triangle-alert-CKcpwtUj.js → triangle-exclamation-point-BhJvBEoT.js} +3 -3
- package/dist/{upload-DR9pqVON.js → upload-CNK8JX38.js} +1 -1
- package/dist/{useCloudI18n-BczJoFf4.js → useCloudI18n-HhCZYRV6.js} +2 -2
- package/dist/useEditorRoot-B0Njczhx.js +7 -0
- package/dist/{useI18n-zeWYtWSv.js → useI18n-CM9vKbYc.js} +2 -2
- package/dist/{cdn/chunks/useLocalizedDisplay-Bgg4qpev.js → useLocalizedDisplay-B7tlQF4g.js} +2 -4
- package/dist/{useLogicTag-B4Zpk3eo.js → useLogicTag-k_y-4o4W.js} +3 -3
- package/dist/{useMergeTag-B5qlq8px.js → useMergeTag-BiZ6XOdL.js} +3 -3
- package/dist/{usePopoverPosition-Br3zt_MQ.js → usePopoverPosition-CVRzzLkC.js} +2 -2
- package/dist/{useScrollToBlock-BfOzc1Z6.js → useScrollToBlock-vf_KD0FM.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-BJXc_Mri.js → vue.runtime.esm-bundler-BE5V8ADU.js} +414 -362
- package/dist/{withCurrentFont-m_PHcOD0.js → withCurrentFont-CPhRujet.js} +1 -1
- package/dist/{x-DZSFHafL.js → x-DbLX5Qdm.js} +1 -1
- package/package.json +23 -23
- package/dist/AiPanels-CwKmXzyr.js +0 -31
- package/dist/CommentsPanel-B5NqPMmY.js +0 -16
- package/dist/CommentsSidebar-BDrcrDxS.js +0 -526
- package/dist/cdn/chunks/AiChatPanel-C2gpq4kP.js.map +0 -1
- package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js +0 -32
- package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js.map +0 -1
- package/dist/cdn/chunks/AiRewriteMenu-CnkyjPEu.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-DncZ-HDf.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-CRztnw4M.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js +0 -18
- package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js +0 -496
- package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-CrplCzo8.js.map +0 -1
- package/dist/cdn/chunks/LanguageMenu-B6MNInCL.js.map +0 -1
- package/dist/cdn/chunks/RestoreVersionDialog-CPrrWTsT.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-VH07SzX7.js.map +0 -1
- package/dist/cdn/chunks/composables-D3lsO7Io.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-CE79GB1H.js.map +0 -1
- package/dist/cdn/chunks/draggable-DepKdldn.js.map +0 -1
- package/dist/cdn/chunks/en-Bcz4gS9U.js +0 -1
- package/dist/cdn/chunks/icons-DHExFLlT.js.map +0 -1
- package/dist/cdn/chunks/keys-BUmIvYy3.js +0 -11
- package/dist/cdn/chunks/keys-BUmIvYy3.js.map +0 -1
- package/dist/cdn/chunks/sanitizeHtml-B3njfkSy.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-BFgc3qqJ.js.map +0 -1
- package/dist/cdn/chunks/src-C9JWWxAk.js.map +0 -1
- package/dist/cdn/chunks/src-GgKlXNxy.js.map +0 -1
- package/dist/cdn/chunks/src-mXG-Of9A.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C940SvId.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-Beau2Z_T.js +0 -9
- package/dist/dist-B_0FPmoy.js +0 -4
- package/dist/dist-DKV9m4Uu.js +0 -4
- package/dist/en-Dgs_-NBw.js +0 -1
- package/dist/keys-w_VRjoMu.js +0 -9
- package/dist/useEditorRoot-BcXKhM_8.js +0 -7
- package/dist/useLocalizedDisplay-Cbhx208c.js +0 -31
|
@@ -45,25 +45,25 @@ var s = {
|
|
|
45
45
|
2: 28,
|
|
46
46
|
3: 22,
|
|
47
47
|
4: 18
|
|
48
|
-
}, c = 1.3, l = {
|
|
48
|
+
}, c = 1.3, l = 1.2, u = {
|
|
49
49
|
paragraphGap: 8,
|
|
50
50
|
listMarginY: 8,
|
|
51
51
|
listPaddingLeft: 24,
|
|
52
52
|
listItemMarginY: 4
|
|
53
|
-
},
|
|
53
|
+
}, d = [
|
|
54
54
|
"cover",
|
|
55
55
|
"contain",
|
|
56
56
|
"auto"
|
|
57
|
-
],
|
|
57
|
+
], f = [
|
|
58
58
|
"left",
|
|
59
59
|
"center",
|
|
60
60
|
"right"
|
|
61
|
-
],
|
|
61
|
+
], p = [
|
|
62
62
|
"top",
|
|
63
63
|
"center",
|
|
64
64
|
"bottom"
|
|
65
65
|
];
|
|
66
|
-
function
|
|
66
|
+
function ee(e) {
|
|
67
67
|
return {
|
|
68
68
|
url: e,
|
|
69
69
|
size: "cover",
|
|
@@ -74,7 +74,7 @@ function p(e) {
|
|
|
74
74
|
repeat: !1
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function te(e) {
|
|
78
78
|
let t = "";
|
|
79
79
|
for (let n of e) {
|
|
80
80
|
let e = n.charCodeAt(0);
|
|
@@ -82,36 +82,36 @@ function m(e) {
|
|
|
82
82
|
}
|
|
83
83
|
return t;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ne(e) {
|
|
86
86
|
let t = typeof e?.url == "string" ? e.url.trim() : "";
|
|
87
87
|
if (!e || !t) return null;
|
|
88
|
-
let n =
|
|
88
|
+
let n = d.includes(e.size) ? e.size : "cover", r = e.position, i = r && f.includes(r.x) ? r.x : "center", a = r && p.includes(r.y) ? r.y : "center";
|
|
89
89
|
return {
|
|
90
|
-
url:
|
|
90
|
+
url: te(t),
|
|
91
91
|
size: n,
|
|
92
92
|
position: `${i} ${a}`,
|
|
93
93
|
repeat: e.repeat ? "repeat" : "no-repeat"
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
// ../types/src/hero.ts
|
|
97
|
-
var
|
|
97
|
+
var re = [
|
|
98
98
|
"top",
|
|
99
99
|
"middle",
|
|
100
100
|
"bottom"
|
|
101
101
|
];
|
|
102
|
-
function
|
|
102
|
+
function ie(e) {
|
|
103
103
|
let t = e.hero;
|
|
104
104
|
if (!t || typeof t != "object") return null;
|
|
105
105
|
if (e.columns !== "1") return {
|
|
106
106
|
applied: !1,
|
|
107
107
|
reason: "columns"
|
|
108
108
|
};
|
|
109
|
-
let n =
|
|
109
|
+
let n = ne(e.backgroundImage);
|
|
110
110
|
if (n === null) return {
|
|
111
111
|
applied: !1,
|
|
112
112
|
reason: "image"
|
|
113
113
|
};
|
|
114
|
-
let r =
|
|
114
|
+
let r = oe(e.backgroundImage), i = ae(t.height) ? Math.round(t.height) : "image";
|
|
115
115
|
return i === "image" && r === null ? {
|
|
116
116
|
applied: !1,
|
|
117
117
|
reason: "size"
|
|
@@ -119,19 +119,19 @@ function ne(e) {
|
|
|
119
119
|
applied: !0,
|
|
120
120
|
image: n,
|
|
121
121
|
height: i,
|
|
122
|
-
verticalAlign:
|
|
122
|
+
verticalAlign: re.includes(t.verticalAlign) ? t.verticalAlign : "middle",
|
|
123
123
|
aspectRatio: r
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function ae(e) {
|
|
127
127
|
return typeof e == "number" && Number.isFinite(e) && e >= 1;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function oe(e) {
|
|
130
130
|
let t = e?.naturalWidth, n = e?.naturalHeight;
|
|
131
131
|
return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
|
|
132
132
|
}
|
|
133
133
|
// ../types/src/social.ts
|
|
134
|
-
var
|
|
134
|
+
var se = {
|
|
135
135
|
facebook: {
|
|
136
136
|
color: "#1877F2",
|
|
137
137
|
path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
|
|
@@ -204,36 +204,36 @@ var ae = {
|
|
|
204
204
|
color: "#1769FF",
|
|
205
205
|
path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, ce = {
|
|
208
208
|
dark: "#1f1f1f",
|
|
209
209
|
light: "#ffffff"
|
|
210
210
|
};
|
|
211
|
-
function
|
|
211
|
+
function le(e) {
|
|
212
212
|
return e === "dark" || e === "light" ? e : void 0;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
let n =
|
|
214
|
+
function ue(e, t) {
|
|
215
|
+
let n = le(t);
|
|
216
216
|
return {
|
|
217
|
-
fill: n ?
|
|
218
|
-
onFill: n === "light" ?
|
|
217
|
+
fill: n ? ce[n] : se[e].color,
|
|
218
|
+
onFill: n === "light" ? ce.dark : "#ffffff"
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
|
-
function
|
|
222
|
-
let n =
|
|
221
|
+
function de(e, t) {
|
|
222
|
+
let n = le(t);
|
|
223
223
|
return n ? `${e}-${n}` : e;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
if (
|
|
227
|
-
color:
|
|
225
|
+
function fe(e, t) {
|
|
226
|
+
if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
|
|
227
|
+
color: ce.light,
|
|
228
228
|
opacity: .6,
|
|
229
229
|
width: 1.4
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function pe(e) {
|
|
233
233
|
return e === "plain" ? .84 : .6;
|
|
234
234
|
}
|
|
235
235
|
// ../types/src/element-ids.ts
|
|
236
|
-
function
|
|
236
|
+
function me(e) {
|
|
237
237
|
let t = [], n = (e, n) => {
|
|
238
238
|
typeof e == "string" && /[./]/.test(e) && t.push({
|
|
239
239
|
path: n,
|
|
@@ -252,7 +252,7 @@ function fe(e) {
|
|
|
252
252
|
return r(e.blocks, "blocks"), t;
|
|
253
253
|
}
|
|
254
254
|
// ../types/src/clone.ts
|
|
255
|
-
function
|
|
255
|
+
function m(e) {
|
|
256
256
|
let t = [];
|
|
257
257
|
return JSON.parse(JSON.stringify(e, function(e, n) {
|
|
258
258
|
if (typeof n != "object" || !n) return n;
|
|
@@ -261,22 +261,22 @@ function h(e) {
|
|
|
261
261
|
}));
|
|
262
262
|
}
|
|
263
263
|
// ../types/src/deep-equal.ts
|
|
264
|
-
function
|
|
264
|
+
function he(e) {
|
|
265
265
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function h(e, t) {
|
|
268
268
|
if (e === t) return !0;
|
|
269
|
-
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) =>
|
|
270
|
-
if (
|
|
271
|
-
if (!
|
|
269
|
+
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => h(e, t[n]));
|
|
270
|
+
if (he(e)) {
|
|
271
|
+
if (!he(t)) return !1;
|
|
272
272
|
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
273
|
-
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !
|
|
273
|
+
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !h(e[r], t[r])) return !1;
|
|
274
274
|
return !0;
|
|
275
275
|
}
|
|
276
276
|
return !1;
|
|
277
277
|
}
|
|
278
278
|
// ../types/src/config.ts
|
|
279
|
-
var
|
|
279
|
+
var ge = class extends Error {
|
|
280
280
|
statusCode;
|
|
281
281
|
code;
|
|
282
282
|
constructor(e, t, n, r) {
|
|
@@ -291,7 +291,7 @@ var me = class extends Error {
|
|
|
291
291
|
get isServerError() {
|
|
292
292
|
return this.statusCode !== void 0 && this.statusCode >= 500;
|
|
293
293
|
}
|
|
294
|
-
},
|
|
294
|
+
}, _e = {
|
|
295
295
|
title: ["content"],
|
|
296
296
|
paragraph: ["content"],
|
|
297
297
|
html: ["content"],
|
|
@@ -308,58 +308,58 @@ var me = class extends Error {
|
|
|
308
308
|
"expiredMessage"
|
|
309
309
|
],
|
|
310
310
|
custom: ["fieldValues.*"]
|
|
311
|
-
},
|
|
312
|
-
function
|
|
311
|
+
}, g = ["preheaderText"];
|
|
312
|
+
function ve(e) {
|
|
313
313
|
return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function _(e) {
|
|
316
316
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
317
317
|
}
|
|
318
|
-
var
|
|
318
|
+
var ye = /* @__PURE__ */ new Set([
|
|
319
319
|
"__proto__",
|
|
320
320
|
"constructor",
|
|
321
321
|
"prototype"
|
|
322
322
|
]);
|
|
323
|
-
function
|
|
324
|
-
return e.split(".").every((e) => e !== "" && !
|
|
323
|
+
function v(e) {
|
|
324
|
+
return e.split(".").every((e) => e !== "" && !ye.has(e));
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
if (!
|
|
326
|
+
function be(e, t) {
|
|
327
|
+
if (!ye.has(t)) return Array.isArray(e) ? e.find((e) => _(e) && e.id === t) : _(e) && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
328
328
|
}
|
|
329
|
-
function
|
|
330
|
-
return t.split(".").reduce(
|
|
329
|
+
function y(e, t) {
|
|
330
|
+
return t.split(".").reduce(be, e);
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
let t =
|
|
332
|
+
function xe(e) {
|
|
333
|
+
let t = m(e);
|
|
334
334
|
for (let [n, r] of Object.entries(t.l10n ?? {})) {
|
|
335
335
|
for (let t of ["text", "set"]) {
|
|
336
336
|
for (let n of Object.keys(r[t] ?? {})) {
|
|
337
|
-
let i = n.includes(".") ?
|
|
338
|
-
|
|
337
|
+
let i = n.includes(".") ? y(e, n.slice(0, n.lastIndexOf("."))) : e;
|
|
338
|
+
v(n) && (t !== "text" && _(i) || y(e, n) !== void 0) || delete r[t][n];
|
|
339
339
|
}
|
|
340
340
|
r[t] && !Object.keys(r[t]).length && delete r[t];
|
|
341
341
|
}
|
|
342
342
|
Object.keys(r).length || delete t.l10n[n];
|
|
343
343
|
}
|
|
344
|
-
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n,
|
|
344
|
+
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
let t =
|
|
346
|
+
function b(e) {
|
|
347
|
+
let t = xe(e);
|
|
348
348
|
if (t.type === "wrapper") {
|
|
349
|
-
let e = t.children.map(
|
|
349
|
+
let e = t.children.map(b);
|
|
350
350
|
return e.some((e, n) => e !== t.children[n]) ? {
|
|
351
351
|
...t,
|
|
352
352
|
children: e
|
|
353
353
|
} : t;
|
|
354
354
|
}
|
|
355
355
|
if (t.type !== "section") return t;
|
|
356
|
-
let n = t.children.map((e) => e.map(
|
|
356
|
+
let n = t.children.map((e) => e.map(b));
|
|
357
357
|
return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
|
|
358
358
|
...t,
|
|
359
359
|
children: n
|
|
360
360
|
} : t;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Se(e, t, n) {
|
|
363
363
|
if (e.type === "custom") return !1;
|
|
364
364
|
if (e.type === "section") return t === "columns";
|
|
365
365
|
let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
|
|
@@ -372,44 +372,44 @@ function xe(e, t, n) {
|
|
|
372
372
|
let o = a.split(".").length;
|
|
373
373
|
if (i[o] === "id") return !0;
|
|
374
374
|
if (i.length !== o) return !1;
|
|
375
|
-
let s =
|
|
376
|
-
if (!
|
|
375
|
+
let s = y(e, a);
|
|
376
|
+
if (!_(s) || !_(n) || s.id !== n.id) return !0;
|
|
377
377
|
if (e.type === "table" && o === 2) {
|
|
378
|
-
let e = (e) => Array.isArray(e) ? e.map((e) =>
|
|
379
|
-
return !
|
|
378
|
+
let e = (e) => Array.isArray(e) ? e.map((e) => _(e) ? e.id : void 0) : null;
|
|
379
|
+
return !h(e(s.cells), e(n.cells));
|
|
380
380
|
}
|
|
381
381
|
return !1;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
383
|
+
function Ce(e) {
|
|
384
|
+
return xe(e);
|
|
385
385
|
}
|
|
386
386
|
function x(e, t, n) {
|
|
387
|
-
if (!
|
|
388
|
-
let r = t.split("."), i = r.pop(), a = r.reduce(
|
|
387
|
+
if (!v(t)) return !1;
|
|
388
|
+
let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
|
|
389
389
|
if (Array.isArray(a)) {
|
|
390
|
-
let e = a.findIndex((e) =>
|
|
391
|
-
return e < 0 ? !1 : (a[e] =
|
|
390
|
+
let e = a.findIndex((e) => _(e) && e.id === i);
|
|
391
|
+
return e < 0 ? !1 : (a[e] = m(n), !0);
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function we(e, t) {
|
|
396
396
|
let [n, ...r] = t.split(".");
|
|
397
397
|
if (n === void 0) return [""];
|
|
398
398
|
let i = [];
|
|
399
399
|
if (n === "*") {
|
|
400
400
|
let t = Array.isArray(e) ? e : [];
|
|
401
|
-
for (let e of t) if (
|
|
401
|
+
for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ? we(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
|
|
402
402
|
return i;
|
|
403
403
|
}
|
|
404
|
-
let a =
|
|
404
|
+
let a = _(e) ? e[n] : void 0;
|
|
405
405
|
if (r.length === 0) return a === void 0 ? [] : [n];
|
|
406
|
-
for (let e of
|
|
406
|
+
for (let e of we(a, r.join("."))) i.push(`${n}.${e}`);
|
|
407
407
|
return i;
|
|
408
408
|
}
|
|
409
409
|
function S(e, t = []) {
|
|
410
410
|
if (e.type === "custom") {
|
|
411
411
|
let n = t.find((t) => t.type === e.customType), r = new Set((n?.fields ?? []).filter((e) => e.type === "text" || e.type === "textarea").map((e) => e.key)), i = e.fieldValues;
|
|
412
|
-
return
|
|
412
|
+
return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
|
|
413
413
|
}
|
|
414
414
|
let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
|
|
415
415
|
...e,
|
|
@@ -421,10 +421,10 @@ function S(e, t = []) {
|
|
|
421
421
|
cells: e.cells.filter(n)
|
|
422
422
|
}))
|
|
423
423
|
} : e;
|
|
424
|
-
return (
|
|
424
|
+
return (_e[e.type] ?? []).flatMap((e) => we(r, e));
|
|
425
425
|
}
|
|
426
|
-
function
|
|
427
|
-
return (
|
|
426
|
+
function Te(e, t) {
|
|
427
|
+
return (_e[e] ?? []).some((e) => {
|
|
428
428
|
let n = e.split("."), r = t.split(".");
|
|
429
429
|
return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
|
|
430
430
|
});
|
|
@@ -434,67 +434,76 @@ function C(e) {
|
|
|
434
434
|
for (let n of new TextEncoder().encode(e)) t ^= n, t = Math.imul(t, 16777619) >>> 0;
|
|
435
435
|
return t.toString(16).padStart(8, "0");
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function Ee(e) {
|
|
438
438
|
let { l10n: t, ...n } = e;
|
|
439
439
|
return n;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function De(e = {}) {
|
|
442
442
|
return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
446
|
-
if (t === n) return i;
|
|
447
|
-
let a = r.l10n?.[t];
|
|
448
|
-
if (!a) return i;
|
|
449
|
-
for (let [e, t] of w(a.set)) x(i, e, t);
|
|
450
|
-
for (let [t, n] of Object.entries(a.text ?? {})) b(e, t) !== void 0 && x(i, t, n.value);
|
|
451
|
-
return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete i.renderedHtml, i;
|
|
444
|
+
function Oe(e, t, n) {
|
|
445
|
+
return ke(e, m(Ee(e)), t, n);
|
|
452
446
|
}
|
|
453
|
-
function
|
|
447
|
+
function ke(e, t, n, r) {
|
|
448
|
+
let i = e;
|
|
449
|
+
if (n === r) return t;
|
|
450
|
+
let a = i.l10n?.[n];
|
|
451
|
+
if (!a) return t;
|
|
452
|
+
for (let [e, n] of De(a.set)) x(t, e, n);
|
|
453
|
+
for (let [n, r] of Object.entries(a.text ?? {})) y(e, n) !== void 0 && x(t, n, r.value);
|
|
454
|
+
return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete t.renderedHtml, t;
|
|
455
|
+
}
|
|
456
|
+
function Ae(e, t, n) {
|
|
457
|
+
let r = e;
|
|
458
|
+
if (r.type !== "section" && r.type !== "wrapper" || !Array.isArray(r.children)) return Oe(e, t, n);
|
|
459
|
+
let { children: i, ...a } = Ee(r), o = m(a);
|
|
460
|
+
return o.children = i, ke(e, o, t, n);
|
|
461
|
+
}
|
|
462
|
+
function je(e, t) {
|
|
454
463
|
return e.l10n?.[t]?.hidden === !0;
|
|
455
464
|
}
|
|
456
|
-
function
|
|
465
|
+
function Me(e) {
|
|
457
466
|
let { locales: t, l10n: n, ...r } = e;
|
|
458
467
|
return r;
|
|
459
468
|
}
|
|
460
|
-
function
|
|
469
|
+
function w(e) {
|
|
461
470
|
return e.settings?.locale ?? "en";
|
|
462
471
|
}
|
|
463
|
-
function
|
|
464
|
-
let r =
|
|
472
|
+
function Ne(e, t, n) {
|
|
473
|
+
let r = w(e);
|
|
465
474
|
if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
|
|
466
475
|
if (n?.missing === "default") t = r;
|
|
467
|
-
else throw new
|
|
476
|
+
else throw new ge(`This template has no "${t}" version.`, void 0, "unknown_locale");
|
|
468
477
|
}
|
|
469
478
|
let i = (e) => e.flatMap((e) => {
|
|
470
|
-
if (t !== r &&
|
|
471
|
-
let n =
|
|
472
|
-
return
|
|
473
|
-
}), a =
|
|
479
|
+
if (t !== r && je(e, t)) return [];
|
|
480
|
+
let n = e.l10n?.[t], a = [...Object.keys(n?.set ?? {}), ...Object.keys(n?.text ?? {})].some((e) => e.startsWith("children.")) ? Oe(e, t, r) : Ae(e, t, r);
|
|
481
|
+
return a.type === "section" && Array.isArray(a.children) ? a.children = a.children.map((e) => i(e)) : a.type === "wrapper" && Array.isArray(a.children) && (a.children = i(a.children)), [a];
|
|
482
|
+
}), a = m(Me(e.settings)), o = e.settings?.l10n?.[t];
|
|
474
483
|
if (t !== r && o) {
|
|
475
|
-
for (let [e, t] of
|
|
476
|
-
for (let [t, n] of Object.entries(o.text ?? {}))
|
|
484
|
+
for (let [e, t] of De(o.set)) x(a, e, t);
|
|
485
|
+
for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 && x(a, t, n.value);
|
|
477
486
|
}
|
|
478
487
|
return a.locale = t, {
|
|
479
488
|
blocks: i(e.blocks),
|
|
480
489
|
settings: a
|
|
481
490
|
};
|
|
482
491
|
}
|
|
483
|
-
function
|
|
492
|
+
function Pe(e, t, n = []) {
|
|
484
493
|
let r = {
|
|
485
494
|
translated: [],
|
|
486
495
|
missing: [],
|
|
487
496
|
stale: []
|
|
488
497
|
}, i = (e, t, n, i) => {
|
|
489
498
|
for (let a of n) {
|
|
490
|
-
let n =
|
|
499
|
+
let n = y(t, a);
|
|
491
500
|
if (typeof n != "string") continue;
|
|
492
501
|
let o = i?.[a];
|
|
493
502
|
(o || n !== "") && (o ? o.sourceHash === C(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
|
|
494
503
|
}
|
|
495
504
|
}, a = (e) => {
|
|
496
505
|
for (let r of e) {
|
|
497
|
-
if (
|
|
506
|
+
if (je(r, t)) continue;
|
|
498
507
|
let e = r.l10n?.[t];
|
|
499
508
|
i(r.id, r, S(r, n), e?.text);
|
|
500
509
|
let o = r.children;
|
|
@@ -502,37 +511,37 @@ function Ae(e, t, n = []) {
|
|
|
502
511
|
else r.type === "wrapper" && Array.isArray(o) && a(o);
|
|
503
512
|
}
|
|
504
513
|
};
|
|
505
|
-
return a(e.blocks), i("settings", e.settings, [...
|
|
514
|
+
return a(e.blocks), i("settings", e.settings, [...g], e.settings?.l10n?.[t]?.text), r;
|
|
506
515
|
}
|
|
507
|
-
function
|
|
508
|
-
if (t ===
|
|
516
|
+
function Fe(e, t) {
|
|
517
|
+
if (t === w(e) || !e.settings.locales?.includes(t)) return [];
|
|
509
518
|
let n = [], r = (e) => {
|
|
510
|
-
for (let i of e)
|
|
519
|
+
for (let i of e) je(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
|
|
511
520
|
};
|
|
512
521
|
return r(e.blocks), n;
|
|
513
522
|
}
|
|
514
|
-
function
|
|
515
|
-
if (t ===
|
|
523
|
+
function Ie(e, t, n = []) {
|
|
524
|
+
if (t === w(e) || !e.settings.locales?.includes(t)) return [];
|
|
516
525
|
let r = [], i = (e, n, i) => {
|
|
517
|
-
r.push(...
|
|
526
|
+
r.push(...Le(n, t, i).map((t) => `${e}/${t}`));
|
|
518
527
|
}, a = (e) => {
|
|
519
528
|
for (let t of e) i(t.id, t, S(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
|
|
520
529
|
};
|
|
521
|
-
return a(e.blocks), i("settings", e.settings,
|
|
530
|
+
return a(e.blocks), i("settings", e.settings, g), r;
|
|
522
531
|
}
|
|
523
|
-
function
|
|
532
|
+
function Le(e, t, n) {
|
|
524
533
|
let r = e.l10n?.[t];
|
|
525
534
|
return n.filter((t) => {
|
|
526
|
-
let n =
|
|
527
|
-
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") ||
|
|
535
|
+
let n = y(e, t);
|
|
536
|
+
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || y(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
|
|
528
537
|
});
|
|
529
538
|
}
|
|
530
|
-
function
|
|
531
|
-
let r =
|
|
532
|
-
let a =
|
|
539
|
+
function Re(e, t, n = {}) {
|
|
540
|
+
let r = w(e), i = (e, n, i) => {
|
|
541
|
+
let a = Le(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
|
|
533
542
|
delete c.l10n;
|
|
534
|
-
for (let [e, t] of
|
|
535
|
-
for (let [t, n] of Object.entries(s.text ?? {}))
|
|
543
|
+
for (let [e, t] of De(s.set)) x(c, e, t);
|
|
544
|
+
for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && x(c, t, n.value);
|
|
536
545
|
delete o[t];
|
|
537
546
|
let l = {}, u = /* @__PURE__ */ new Set([
|
|
538
547
|
...Object.keys(s.set ?? {}),
|
|
@@ -540,22 +549,22 @@ function Pe(e, t, n = {}) {
|
|
|
540
549
|
...a
|
|
541
550
|
]);
|
|
542
551
|
for (let t of u) {
|
|
543
|
-
let r =
|
|
544
|
-
|
|
552
|
+
let r = y(e, t), i = y(c, t);
|
|
553
|
+
h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
|
|
545
554
|
value: r,
|
|
546
555
|
sourceHash: C(r)
|
|
547
556
|
}) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
|
|
548
557
|
value: r,
|
|
549
558
|
sourceHash: C(i)
|
|
550
|
-
} : (l.set ??= {})[t] = r === void 0 ? null :
|
|
559
|
+
} : (l.set ??= {})[t] = r === void 0 ? null : m(r);
|
|
551
560
|
}
|
|
552
561
|
let d = (e, t) => {
|
|
553
562
|
let n = /* @__PURE__ */ new Set();
|
|
554
563
|
for (let t of Object.keys(e.set ?? {})) {
|
|
555
564
|
let e = t.split(".");
|
|
556
565
|
for (; e.length > 1;) {
|
|
557
|
-
let t =
|
|
558
|
-
if (
|
|
566
|
+
let t = y(c, e.slice(0, -1).join("."));
|
|
567
|
+
if (_(t) || Array.isArray(t) && y(c, e.join(".")) !== void 0) break;
|
|
559
568
|
e.pop();
|
|
560
569
|
}
|
|
561
570
|
let r = e.join(".");
|
|
@@ -563,20 +572,20 @@ function Pe(e, t, n = {}) {
|
|
|
563
572
|
}
|
|
564
573
|
for (let r of n) {
|
|
565
574
|
for (let t of ["text", "set"]) for (let n of Object.keys(e[t] ?? {})) (n === r || n.startsWith(`${r}.`)) && delete e[t][n];
|
|
566
|
-
let n =
|
|
567
|
-
(e.set ??= {})[r] = n === void 0 ? null :
|
|
575
|
+
let n = y(t, r);
|
|
576
|
+
(e.set ??= {})[r] = n === void 0 ? null : m(n);
|
|
568
577
|
}
|
|
569
578
|
e.text && !Object.keys(e.text).length && delete e.text;
|
|
570
579
|
};
|
|
571
580
|
for (let t of Object.values(o)) {
|
|
572
|
-
let n =
|
|
573
|
-
for (let [e, r] of
|
|
574
|
-
for (let [r, i] of Object.entries(t.text ?? {}))
|
|
581
|
+
let n = m(e);
|
|
582
|
+
for (let [e, r] of De(t.set)) x(n, e, r);
|
|
583
|
+
for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && x(n, r, i.value);
|
|
575
584
|
for (let [n, r] of Object.entries(t.text ?? {})) {
|
|
576
|
-
let i =
|
|
585
|
+
let i = y(c, n);
|
|
577
586
|
if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
|
|
578
587
|
else {
|
|
579
|
-
let t =
|
|
588
|
+
let t = y(e, n);
|
|
580
589
|
typeof t == "string" && r.sourceHash === C(t) && (r.sourceHash = C(i));
|
|
581
590
|
}
|
|
582
591
|
}
|
|
@@ -584,20 +593,21 @@ function Pe(e, t, n = {}) {
|
|
|
584
593
|
}
|
|
585
594
|
return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
|
|
586
595
|
}, a = (e) => e.map((e) => {
|
|
587
|
-
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) :
|
|
588
|
-
return e.type === "custom" && r.type === "custom" && !
|
|
589
|
-
}), o = i(e.settings, (e) =>
|
|
596
|
+
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : Te(e.type, n), t);
|
|
597
|
+
return e.type === "custom" && r.type === "custom" && !h(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
|
|
598
|
+
}), o = i(e.settings, (e) => g.includes(e), g);
|
|
590
599
|
return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
|
|
591
600
|
blocks: a(e.blocks),
|
|
592
601
|
settings: o
|
|
593
602
|
};
|
|
594
603
|
}
|
|
595
604
|
// ../types/src/operations.ts
|
|
596
|
-
|
|
597
|
-
|
|
605
|
+
var ze = "Sections with a wrapper cannot be placed inside wrappers.";
|
|
606
|
+
function Be(e, t, n = []) {
|
|
607
|
+
let r = Object.fromEntries(I(e.blocks).flatMap((e) => {
|
|
598
608
|
if (e.type !== "custom") return [];
|
|
599
|
-
let t = S(e, n).filter((t) => typeof
|
|
600
|
-
return t.length &&
|
|
609
|
+
let t = S(e, n).filter((t) => typeof y(e, t) == "string");
|
|
610
|
+
return t.length && Ke.has(e.id) && D("invalid_operation", 0, qe), t.length ? [[e.id, t]] : [];
|
|
601
611
|
}));
|
|
602
612
|
return {
|
|
603
613
|
op: "setDefaultLocale",
|
|
@@ -605,7 +615,7 @@ function Fe(e, t, n = []) {
|
|
|
605
615
|
...Object.keys(r).length ? { customTextFields: r } : {}
|
|
606
616
|
};
|
|
607
617
|
}
|
|
608
|
-
var
|
|
618
|
+
var T = class extends Error {
|
|
609
619
|
code;
|
|
610
620
|
opIndex;
|
|
611
621
|
blockId;
|
|
@@ -613,173 +623,174 @@ var E = class extends Error {
|
|
|
613
623
|
super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
|
|
614
624
|
}
|
|
615
625
|
};
|
|
616
|
-
function
|
|
626
|
+
function Ve(e) {
|
|
617
627
|
return e === "1" ? 1 : e === "3" || e === "1-2-1" ? 3 : e === "4" ? 4 : 2;
|
|
618
628
|
}
|
|
619
|
-
function
|
|
620
|
-
let r =
|
|
621
|
-
return
|
|
629
|
+
function He(e, t, n = {}) {
|
|
630
|
+
let r = m(e);
|
|
631
|
+
return E(r, t, n), r;
|
|
622
632
|
}
|
|
623
|
-
function
|
|
633
|
+
function E(e, t, n = {}) {
|
|
624
634
|
let r = {
|
|
625
635
|
locks: n.locks ?? [],
|
|
626
636
|
session: n.session ?? null
|
|
627
637
|
};
|
|
628
|
-
t.forEach((t, n) =>
|
|
638
|
+
t.forEach((t, n) => ut(e, t, n, r));
|
|
629
639
|
}
|
|
630
|
-
var
|
|
640
|
+
var Ue = /* @__PURE__ */ new Set([
|
|
631
641
|
"id",
|
|
632
642
|
"type",
|
|
633
643
|
"children",
|
|
634
644
|
"l10n"
|
|
635
|
-
]),
|
|
645
|
+
]), We = /* @__PURE__ */ new Set(["locales", "l10n"]), Ge = /* @__PURE__ */ new Set([
|
|
636
646
|
"locale",
|
|
637
647
|
"locales",
|
|
638
648
|
"l10n"
|
|
639
|
-
]),
|
|
649
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
640
650
|
"__proto__",
|
|
641
651
|
"constructor",
|
|
642
652
|
"prototype"
|
|
643
|
-
]),
|
|
644
|
-
function
|
|
645
|
-
throw new
|
|
653
|
+
]), qe = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
|
|
654
|
+
function D(e, t, n, r) {
|
|
655
|
+
throw new T(e, t, n, r);
|
|
646
656
|
}
|
|
647
|
-
function
|
|
657
|
+
function O(e) {
|
|
648
658
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
649
659
|
}
|
|
650
|
-
function
|
|
660
|
+
function k(e) {
|
|
651
661
|
return e.type === "section";
|
|
652
662
|
}
|
|
653
|
-
function
|
|
663
|
+
function A(e) {
|
|
654
664
|
return Array.isArray(e.blocks) ? e.blocks : [];
|
|
655
665
|
}
|
|
656
|
-
function
|
|
666
|
+
function Je(e) {
|
|
657
667
|
let t = e.children;
|
|
658
668
|
return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
|
|
659
669
|
}
|
|
660
|
-
function
|
|
661
|
-
let n =
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
if (!k(r)) continue;
|
|
665
|
-
if (r.id === t) return {
|
|
670
|
+
function* Ye(e, t) {
|
|
671
|
+
for (let n = 0; n < e.length; n++) {
|
|
672
|
+
let r = e[n];
|
|
673
|
+
if (O(r) && (yield {
|
|
666
674
|
block: r,
|
|
667
|
-
list:
|
|
668
|
-
index:
|
|
669
|
-
parent:
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
let a = n[i];
|
|
677
|
-
if (k(a) && a.id === t) return {
|
|
678
|
-
block: a,
|
|
679
|
-
list: n,
|
|
680
|
-
index: i,
|
|
681
|
-
parent: {
|
|
682
|
-
sectionId: r.id,
|
|
683
|
-
column: e
|
|
684
|
-
}
|
|
685
|
-
};
|
|
686
|
-
}
|
|
675
|
+
list: e,
|
|
676
|
+
index: n,
|
|
677
|
+
parent: t
|
|
678
|
+
}, typeof r.id == "string")) {
|
|
679
|
+
if (k(r)) for (let [e, t] of Je(r).entries()) yield* Ye(t, {
|
|
680
|
+
sectionId: r.id,
|
|
681
|
+
column: e
|
|
682
|
+
});
|
|
683
|
+
else r.type === "wrapper" && Array.isArray(r.children) && (yield* Ye(r.children, { wrapperId: r.id }));
|
|
687
684
|
}
|
|
688
685
|
}
|
|
686
|
+
}
|
|
687
|
+
function j(e, t) {
|
|
688
|
+
for (let n of Ye(A(e), null)) if (n.block.id === t) return n;
|
|
689
689
|
return null;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function M(e) {
|
|
692
|
+
if (!O(e)) return [];
|
|
692
693
|
let t = typeof e.id == "string" ? [e.id] : [];
|
|
693
|
-
if (
|
|
694
|
+
if (k(e)) for (let n of Je(e)) for (let e of Xe(n)) t.push(e);
|
|
695
|
+
else if (e.type === "wrapper" && Array.isArray(e.children)) for (let n of Xe(e.children)) t.push(n);
|
|
694
696
|
return t;
|
|
695
697
|
}
|
|
696
|
-
function
|
|
697
|
-
return e.flatMap(
|
|
698
|
+
function Xe(e) {
|
|
699
|
+
return e.flatMap(M);
|
|
698
700
|
}
|
|
699
|
-
function
|
|
700
|
-
return typeof e.blockId != "string" || e.blockId === "" ?
|
|
701
|
+
function N(e, t) {
|
|
702
|
+
return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
|
|
701
703
|
}
|
|
702
|
-
function
|
|
704
|
+
function Ze(e, t) {
|
|
703
705
|
let n = e.parent;
|
|
704
|
-
return n === null ? null :
|
|
706
|
+
return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
|
|
705
707
|
sectionId: n.sectionId,
|
|
706
708
|
column: n.column
|
|
707
|
-
} : O("invalid_operation", t, "parent must be null
|
|
709
|
+
} : O(n) && typeof n.wrapperId == "string" && n.wrapperId !== "" && !Object.hasOwn(n, "sectionId") && !Object.hasOwn(n, "column") ? { wrapperId: n.wrapperId } : D("invalid_operation", t, "parent must be null, { \"sectionId\", \"column\" }, or { \"wrapperId\" }.");
|
|
708
710
|
}
|
|
709
|
-
function
|
|
711
|
+
function Qe(e, t) {
|
|
710
712
|
let n = e.after;
|
|
711
|
-
return n === null ? null : typeof n == "string" && n !== "" ? n :
|
|
713
|
+
return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
|
|
712
714
|
}
|
|
713
|
-
function
|
|
715
|
+
function P(e, t) {
|
|
714
716
|
let n = e.expect;
|
|
715
|
-
return n == null ? null :
|
|
717
|
+
return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
|
|
716
718
|
}
|
|
717
|
-
function
|
|
719
|
+
function $e(e, t, n) {
|
|
718
720
|
let r = e.set ?? null, i = e.unset ?? [];
|
|
719
|
-
(r === null ||
|
|
721
|
+
(r === null || O(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || D("invalid_operation", t, "set must be an object and unset a list of keys.");
|
|
720
722
|
let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
|
|
721
|
-
o.length === 0 && i.length === 0 &&
|
|
722
|
-
for (let e of [...o, ...i]) n.has(e) &&
|
|
723
|
+
o.length === 0 && i.length === 0 && D("invalid_operation", t, "Set or unset at least one key.");
|
|
724
|
+
for (let e of [...o, ...i]) n.has(e) && D("invalid_operation", t, `"${e}" can't be set or unset.`);
|
|
723
725
|
let s = i.find((e) => o.includes(e));
|
|
724
|
-
return s !== void 0 &&
|
|
726
|
+
return s !== void 0 && D("invalid_operation", t, `"${s}" is both set and unset.`), {
|
|
725
727
|
set: Object.fromEntries(o.map((e) => [e, a[e]])),
|
|
726
728
|
unset: i
|
|
727
729
|
};
|
|
728
730
|
}
|
|
729
|
-
function
|
|
730
|
-
if (
|
|
731
|
-
|
|
731
|
+
function et(e, t, n) {
|
|
732
|
+
if (O(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || D("invalid_operation", t, "A block needs a non-empty string id and a string type."), e.type === "wrapper") {
|
|
733
|
+
n !== "root" && D("invalid_operation", t, n === "column" ? "Wrappers can only be placed at the top level." : "Wrappers cannot be placed inside wrappers."), Array.isArray(e.children) || D("invalid_operation", t, "A wrapper needs children: a list of blocks.");
|
|
734
|
+
for (let n of e.children) et(n, t, "wrapper");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
if (!k(e)) return;
|
|
738
|
+
n === "column" && D("invalid_operation", t, "Sections can only be placed at the top level."), n === "wrapper" && e.wrapper && D("invalid_operation", t, ze);
|
|
732
739
|
let r = e.children;
|
|
733
|
-
Array.isArray(r) && r.every((e) => Array.isArray(e)) ||
|
|
734
|
-
for (let e of r) for (let n of e)
|
|
740
|
+
Array.isArray(r) && r.every((e) => Array.isArray(e)) || D("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
|
|
741
|
+
for (let e of r) for (let n of e) et(n, t, "column");
|
|
735
742
|
}
|
|
736
|
-
function
|
|
743
|
+
function F(e, t) {
|
|
737
744
|
return e.session === null || t.sessionId !== e.session;
|
|
738
745
|
}
|
|
739
|
-
function
|
|
740
|
-
let r = e.locks.find((n) => t.includes(n.blockId) &&
|
|
741
|
-
r &&
|
|
746
|
+
function tt(e, t, n) {
|
|
747
|
+
let r = e.locks.find((n) => t.includes(n.blockId) && F(e, n));
|
|
748
|
+
r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
|
|
742
749
|
}
|
|
743
|
-
function
|
|
744
|
-
e.locks.find((r) =>
|
|
750
|
+
function nt(e, t, n, r) {
|
|
751
|
+
e.locks.find((r) => F(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && D("lock_held", r, `Block "${t}" is being edited in another session.`, t);
|
|
745
752
|
}
|
|
746
|
-
function
|
|
747
|
-
for (let [i, a] of Object.entries(t)) a !== void 0 && (
|
|
753
|
+
function rt(e, t, n, r) {
|
|
754
|
+
for (let [i, a] of Object.entries(t)) a !== void 0 && (h(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || D("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
|
|
748
755
|
}
|
|
749
|
-
function
|
|
756
|
+
function it(e, t, n) {
|
|
750
757
|
if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
|
|
758
|
+
if ("wrapperId" in t) {
|
|
759
|
+
let r = j(e, t.wrapperId);
|
|
760
|
+
return r ? r.block.type === "wrapper" ? Array.isArray(r.block.children) ? r.block.children : D("invalid_operation", n, `Wrapper "${t.wrapperId}" has no children list.`) : D("invalid_operation", n, `Block "${t.wrapperId}" isn't a wrapper.`) : D("block_missing", n, `No wrapper with id "${t.wrapperId}".`, t.wrapperId);
|
|
761
|
+
}
|
|
751
762
|
let r = j(e, t.sectionId);
|
|
752
|
-
if (!r) return
|
|
753
|
-
if (!
|
|
763
|
+
if (!r) return D("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
|
|
764
|
+
if (!k(r.block)) return D("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
|
|
754
765
|
let i = r.block.children;
|
|
755
|
-
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ?
|
|
766
|
+
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? D("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
|
|
756
767
|
}
|
|
757
|
-
function
|
|
768
|
+
function at(e, t, n) {
|
|
758
769
|
if (t === null) return 0;
|
|
759
|
-
let r = e.findIndex((e) =>
|
|
760
|
-
return r === -1 ?
|
|
770
|
+
let r = e.findIndex((e) => O(e) && e.id === t);
|
|
771
|
+
return r === -1 ? D("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
|
|
761
772
|
}
|
|
762
|
-
function
|
|
763
|
-
let i =
|
|
773
|
+
function ot(e, t, n, r) {
|
|
774
|
+
let i = Ve(t), a = Array.isArray(e.children) ? e.children : [];
|
|
764
775
|
for (let e = i; e < a.length; e++) {
|
|
765
776
|
let t = a[e];
|
|
766
|
-
Array.isArray(t) && t.length > 0 &&
|
|
777
|
+
Array.isArray(t) && t.length > 0 && D("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
|
|
767
778
|
}
|
|
768
779
|
let o = a.slice(0, i);
|
|
769
780
|
for (; o.length < i;) o.push([]);
|
|
770
781
|
e.children = o;
|
|
771
782
|
}
|
|
772
|
-
function
|
|
783
|
+
function st(e, t, n) {
|
|
773
784
|
for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
|
|
774
|
-
value:
|
|
785
|
+
value: m(r),
|
|
775
786
|
writable: !0,
|
|
776
787
|
enumerable: !0,
|
|
777
788
|
configurable: !0
|
|
778
|
-
}) : e[n] =
|
|
789
|
+
}) : e[n] = m(r);
|
|
779
790
|
for (let t of n) delete e[t];
|
|
780
791
|
}
|
|
781
|
-
function
|
|
782
|
-
return
|
|
792
|
+
function ct(e) {
|
|
793
|
+
return me(e).map((t) => {
|
|
783
794
|
let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
|
|
784
795
|
return {
|
|
785
796
|
id: t.id,
|
|
@@ -787,114 +798,114 @@ function at(e) {
|
|
|
787
798
|
};
|
|
788
799
|
});
|
|
789
800
|
}
|
|
790
|
-
function
|
|
791
|
-
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ?
|
|
792
|
-
a &&
|
|
801
|
+
function lt(e, t, n) {
|
|
802
|
+
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? ct(n).map(r) : []), a = ct(e).find((e) => !i.has(r(e)));
|
|
803
|
+
a && D("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
|
|
793
804
|
}
|
|
794
|
-
function
|
|
805
|
+
function ut(e, t, n, r) {
|
|
795
806
|
let i = t;
|
|
796
|
-
switch (
|
|
797
|
-
case "addBlock": return
|
|
798
|
-
case "moveBlock": return
|
|
799
|
-
case "deleteBlock": return
|
|
800
|
-
case "updateBlock": return
|
|
801
|
-
case "updateSettings": return
|
|
802
|
-
case "setContent": return
|
|
803
|
-
case "setDefaultLocale": return
|
|
804
|
-
case "addLocale": return
|
|
805
|
-
case "removeLocale": return
|
|
806
|
-
case "updateBlockLocale": return
|
|
807
|
-
case "updateSettingsLocale": return
|
|
808
|
-
default:
|
|
807
|
+
switch (O(i) && typeof i.op == "string" || D("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
|
|
808
|
+
case "addBlock": return dt(e, i, n);
|
|
809
|
+
case "moveBlock": return ft(e, i, n, r);
|
|
810
|
+
case "deleteBlock": return pt(e, i, n, r);
|
|
811
|
+
case "updateBlock": return mt(e, i, n, r);
|
|
812
|
+
case "updateSettings": return ht(e, i, n);
|
|
813
|
+
case "setContent": return At(e, i, n, r);
|
|
814
|
+
case "setDefaultLocale": return jt(e, i, n, r);
|
|
815
|
+
case "addLocale": return vt(e, i, n);
|
|
816
|
+
case "removeLocale": return bt(e, i, n);
|
|
817
|
+
case "updateBlockLocale": return Ot(e, i, n, r);
|
|
818
|
+
case "updateSettingsLocale": return kt(e, i, n);
|
|
819
|
+
default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
|
|
809
820
|
}
|
|
810
821
|
}
|
|
811
|
-
function
|
|
812
|
-
let r =
|
|
813
|
-
|
|
822
|
+
function dt(e, t, n) {
|
|
823
|
+
let r = Ze(t, n), i = Qe(t, n), a = t.block;
|
|
824
|
+
et(a, n, r === null ? "root" : "wrapperId" in r ? "wrapper" : "column"), lt({
|
|
814
825
|
blocks: [a],
|
|
815
826
|
settings: e.settings
|
|
816
827
|
}, n);
|
|
817
|
-
let o = new Set(
|
|
818
|
-
for (let e of
|
|
819
|
-
let c =
|
|
820
|
-
|
|
821
|
-
}
|
|
822
|
-
function
|
|
823
|
-
let i =
|
|
824
|
-
if (!
|
|
825
|
-
if (
|
|
826
|
-
let e =
|
|
827
|
-
|
|
828
|
+
let o = new Set(Xe(A(e))), s = /* @__PURE__ */ new Set();
|
|
829
|
+
for (let e of M(a)) (o.has(e) || s.has(e)) && D("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
|
|
830
|
+
let c = it(e, r, n), l = at(c, i, n);
|
|
831
|
+
Dt(e, a, r, n, !0), c.splice(l, 0, m(a));
|
|
832
|
+
}
|
|
833
|
+
function ft(e, t, n, r) {
|
|
834
|
+
let i = N(t, n), a = Ze(t, n), o = Qe(t, n), s = P(t, n), c = s && s.parent !== void 0 ? Ze({ parent: s.parent }, n) : null, l = j(e, i);
|
|
835
|
+
if (!l) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
836
|
+
if (tt(r, M(l.block), n), s) {
|
|
837
|
+
let e = l.index > 0 ? l.list[l.index - 1] : null, t = O(e) ? e.id ?? null : null;
|
|
838
|
+
h(l.parent, c) && h(t, s.after ?? null) || D("precondition_failed", n, `Block "${i}" has moved since.`, i);
|
|
828
839
|
}
|
|
829
|
-
A(
|
|
830
|
-
let
|
|
831
|
-
|
|
832
|
-
}
|
|
833
|
-
function
|
|
834
|
-
let i =
|
|
835
|
-
if (!o) return
|
|
836
|
-
|
|
837
|
-
}
|
|
838
|
-
function
|
|
839
|
-
let i =
|
|
840
|
-
if (!c) return
|
|
841
|
-
let l = c.block, u =
|
|
842
|
-
u && o.includes("columns") &&
|
|
840
|
+
a !== null && ("wrapperId" in a ? a.wrapperId : a.sectionId) === i && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), a !== null && M(l.block).includes("wrapperId" in a ? a.wrapperId : a.sectionId) && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), k(l.block) && a !== null && "sectionId" in a && D("invalid_operation", n, "Sections can only be placed at the top level."), k(l.block) && l.block.wrapper && a !== null && "wrapperId" in a && D("invalid_operation", n, ze), l.block.type === "wrapper" && a !== null && D("invalid_operation", n, "wrapperId" in a ? "Wrappers cannot be placed inside wrappers." : "Wrappers can only be placed at the top level."), o === i && D("invalid_operation", n, "A block can't be placed after itself.");
|
|
841
|
+
let u = it(e, a, n);
|
|
842
|
+
at(u.filter((e) => e !== l.block), o, n), Dt(e, l.block, a, n, !1), l.list.splice(l.index, 1), u.splice(at(u, o, n), 0, l.block);
|
|
843
|
+
}
|
|
844
|
+
function pt(e, t, n, r) {
|
|
845
|
+
let i = N(t, n), a = P(t, n), o = j(e, i);
|
|
846
|
+
if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
847
|
+
tt(r, M(o.block), n), a && !h(o.block, a.block ?? null) && D("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
|
|
848
|
+
}
|
|
849
|
+
function mt(e, t, n, r) {
|
|
850
|
+
let i = N(t, n), { set: a, unset: o } = $e(t, n, Ue), s = P(t, n), c = j(e, i);
|
|
851
|
+
if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
852
|
+
let l = c.block, u = k(l);
|
|
853
|
+
u && o.includes("columns") && D("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), tt(r, [i], n), s && rt(l, s, n, i), u && c.parent !== null && "wrapperId" in c.parent && a.wrapper && D("invalid_operation", n, ze);
|
|
843
854
|
let d = { ...l };
|
|
844
|
-
|
|
855
|
+
st(d, a, o), lt({
|
|
845
856
|
blocks: [d],
|
|
846
857
|
settings: e.settings
|
|
847
858
|
}, n, {
|
|
848
859
|
blocks: [l],
|
|
849
860
|
settings: e.settings
|
|
850
|
-
}), u && Object.hasOwn(a, "columns") &&
|
|
851
|
-
let f =
|
|
852
|
-
|
|
861
|
+
}), u && Object.hasOwn(a, "columns") && ot(l, a.columns, n, i), st(l, a, o);
|
|
862
|
+
let f = b(l);
|
|
863
|
+
h(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), (u || l.type === "wrapper") && !h(l.children, f.children) && (l.children = f.children);
|
|
853
864
|
}
|
|
854
|
-
function
|
|
855
|
-
let { set: r, unset: i } =
|
|
856
|
-
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) &&
|
|
865
|
+
function ht(e, t, n) {
|
|
866
|
+
let { set: r, unset: i } = $e(t, n, We), a = P(t, n);
|
|
867
|
+
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && D("invalid_operation", n, "The default locale can't change while language versions exist."), O(e.settings) || (e.settings = {});
|
|
857
868
|
let o = e.settings;
|
|
858
|
-
a &&
|
|
859
|
-
let s =
|
|
860
|
-
|
|
869
|
+
a && rt(o, a, n), st(o, r, i);
|
|
870
|
+
let s = Ce(e.settings);
|
|
871
|
+
h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
|
|
861
872
|
}
|
|
862
|
-
function
|
|
873
|
+
function gt(e, t) {
|
|
863
874
|
let n = e.locale;
|
|
864
|
-
return
|
|
875
|
+
return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
|
|
865
876
|
}
|
|
866
|
-
function
|
|
867
|
-
let r =
|
|
868
|
-
return e.settings.locales?.includes(r) ||
|
|
877
|
+
function _t(e, t, n) {
|
|
878
|
+
let r = gt(t, n);
|
|
879
|
+
return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
|
|
869
880
|
}
|
|
870
|
-
function
|
|
871
|
-
let r =
|
|
872
|
-
(
|
|
881
|
+
function vt(e, t, n) {
|
|
882
|
+
let r = gt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
|
|
883
|
+
(w(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && D("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
|
|
873
884
|
}
|
|
874
|
-
function
|
|
875
|
-
return e.flatMap((e) =>
|
|
885
|
+
function I(e) {
|
|
886
|
+
return e.flatMap((e) => O(e) ? [e, ...k(e) ? Je(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
|
|
876
887
|
}
|
|
877
|
-
function
|
|
888
|
+
function yt(e, t) {
|
|
878
889
|
let n = e.l10n;
|
|
879
|
-
return
|
|
880
|
-
}
|
|
881
|
-
function
|
|
882
|
-
let r =
|
|
883
|
-
i && (!
|
|
884
|
-
let a = e.settings, o =
|
|
885
|
-
!i ||
|
|
886
|
-
for (let e of [...o, a])
|
|
890
|
+
return O(n) && O(n[t]) ? n[t] : {};
|
|
891
|
+
}
|
|
892
|
+
function bt(e, t, n) {
|
|
893
|
+
let r = _t(e, t, n), i = P(t, n);
|
|
894
|
+
i && (!O(i.blocks) || i.settings !== void 0 && !O(i.settings)) && D("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
|
|
895
|
+
let a = e.settings, o = I(A(e)), s = Object.fromEntries(o.flatMap((e) => O(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
|
|
896
|
+
!i || h(s, i.blocks) && h(O(a.l10n) ? a.l10n[r] : void 0, i.settings) || D("precondition_failed", n, `Locale "${r}" has changed since.`);
|
|
897
|
+
for (let e of [...o, a]) O(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
|
|
887
898
|
e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
|
|
888
899
|
}
|
|
889
|
-
function
|
|
890
|
-
(e.text === void 0 || ((e) =>
|
|
900
|
+
function xt(e, t, n) {
|
|
901
|
+
(e.text === void 0 || ((e) => O(e) && Object.values(e).every((e) => O(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || O(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && v(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
|
|
891
902
|
"text",
|
|
892
903
|
"set",
|
|
893
904
|
"unset",
|
|
894
905
|
...n ? [] : ["hidden"]
|
|
895
|
-
].some((t) => e[t] !== void 0) ||
|
|
896
|
-
let r =
|
|
897
|
-
return r && (r.text !== void 0 && !
|
|
906
|
+
].some((t) => e[t] !== void 0) || D("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
|
|
907
|
+
let r = P(e, t);
|
|
908
|
+
return r && (r.text !== void 0 && !O(r.text) || r.set !== void 0 && !O(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && D("invalid_operation", t, "The locale layer expect is malformed."), {
|
|
898
909
|
text: e.text ?? {},
|
|
899
910
|
set: e.set ?? {},
|
|
900
911
|
unset: e.unset ?? [],
|
|
@@ -902,83 +913,88 @@ function vt(e, t, n) {
|
|
|
902
913
|
expect: r
|
|
903
914
|
};
|
|
904
915
|
}
|
|
905
|
-
function
|
|
906
|
-
for (let i of Object.keys(t.text))
|
|
916
|
+
function St(e, t, n, r) {
|
|
917
|
+
for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : Te(String(e.type), i)) && y(e, i) !== void 0 || D("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
|
|
907
918
|
for (let i of Object.keys(t.set)) {
|
|
908
|
-
let a = i.split("."), o = r ?
|
|
909
|
-
(!
|
|
919
|
+
let a = i.split("."), o = r ? Ge : Ue, s = a.length === 1 ? e : y(e, a.slice(0, -1).join("."));
|
|
920
|
+
(!v(i) || o.has(a[0]) || !r && Se(e, i, t.set[i]) || y(e, i) === void 0 && !O(s)) && D("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
|
|
910
921
|
}
|
|
911
922
|
}
|
|
912
|
-
function
|
|
923
|
+
function Ct(e, t, n, r) {
|
|
913
924
|
if (t) {
|
|
914
|
-
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {}))
|
|
915
|
-
t.hidden !== void 0 && !
|
|
925
|
+
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || D("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
|
|
926
|
+
t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && D("precondition_failed", n, "The locale's hidden state has changed since.", r);
|
|
916
927
|
}
|
|
917
928
|
}
|
|
918
|
-
function
|
|
919
|
-
|
|
929
|
+
function wt(e, t, n) {
|
|
930
|
+
O(e.l10n) || (e.l10n = {});
|
|
920
931
|
let r = e.l10n;
|
|
921
|
-
|
|
932
|
+
O(r[t]) || (r[t] = {});
|
|
922
933
|
let i = r[t];
|
|
923
934
|
for (let e of n.unset) i.text && delete i.text[e], i.set && delete i.set[e];
|
|
924
|
-
for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] =
|
|
925
|
-
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] =
|
|
935
|
+
for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = m(t), i.set && delete i.set[e];
|
|
936
|
+
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = m(t), i.text && delete i.text[e];
|
|
926
937
|
n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
|
|
927
938
|
}
|
|
928
|
-
function
|
|
929
|
-
return
|
|
939
|
+
function L(e) {
|
|
940
|
+
return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
|
|
930
941
|
}
|
|
931
|
-
function
|
|
932
|
-
return
|
|
942
|
+
function Tt(e) {
|
|
943
|
+
return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
|
|
933
944
|
}
|
|
934
|
-
function
|
|
935
|
-
return !
|
|
945
|
+
function Et(e) {
|
|
946
|
+
return !O(e) || !L(e) ? !1 : Tt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Et) : Et(e));
|
|
936
947
|
}
|
|
937
|
-
function
|
|
938
|
-
if (!
|
|
939
|
-
let a = n
|
|
940
|
-
(a !== null
|
|
948
|
+
function Dt(e, t, n, r, i) {
|
|
949
|
+
if (!L(t)) return;
|
|
950
|
+
let a = n, o = !1;
|
|
951
|
+
for (; a !== null;) {
|
|
952
|
+
let t = j(e, "wrapperId" in a ? a.wrapperId : a.sectionId);
|
|
953
|
+
if (!t) break;
|
|
954
|
+
Tt(t.block) && (o = !0), a = t.parent;
|
|
955
|
+
}
|
|
956
|
+
(o || i && Et(t)) && D("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", O(t) && typeof t.id == "string" ? t.id : void 0);
|
|
941
957
|
}
|
|
942
|
-
function
|
|
943
|
-
let i =
|
|
944
|
-
s ||
|
|
958
|
+
function Ot(e, t, n, r) {
|
|
959
|
+
let i = _t(e, t, n), a = N(t, n), o = xt(t, n, !1), s = I(A(e)).find((e) => e.id === a);
|
|
960
|
+
s || D("block_missing", n, `No block with id "${a}".`, a), St(s, o, n, !1), nt(r, a, i, n), Ct(yt(s, i), o.expect, n, a), o.hidden === !0 && L(s) && D("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), wt(s, i, o);
|
|
945
961
|
}
|
|
946
|
-
function
|
|
947
|
-
let r =
|
|
948
|
-
|
|
962
|
+
function kt(e, t, n) {
|
|
963
|
+
let r = _t(e, t, n), i = xt(t, n, !0), a = e.settings;
|
|
964
|
+
St(a, i, n, !0), Ct(yt(a, r), i.expect, n), wt(a, r, i);
|
|
949
965
|
}
|
|
950
|
-
function
|
|
966
|
+
function At(e, t, n, r) {
|
|
951
967
|
let i = t.content;
|
|
952
|
-
if (!
|
|
953
|
-
|
|
954
|
-
let a = r.locks.find((e) =>
|
|
955
|
-
a &&
|
|
956
|
-
}
|
|
957
|
-
function
|
|
958
|
-
let i =
|
|
959
|
-
e.settings.locales?.includes(i) ||
|
|
960
|
-
let a =
|
|
961
|
-
a.length &&
|
|
962
|
-
let o = r.locks.find((e) =>
|
|
963
|
-
o &&
|
|
968
|
+
if (!O(i) || !Array.isArray(i.blocks) || !O(i.settings)) return D("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
|
|
969
|
+
lt(i, n, e);
|
|
970
|
+
let a = r.locks.find((e) => F(r, e));
|
|
971
|
+
a && D("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
|
|
972
|
+
}
|
|
973
|
+
function jt(e, t, n, r) {
|
|
974
|
+
let i = gt(t, n);
|
|
975
|
+
e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
|
|
976
|
+
let a = Fe(e, i);
|
|
977
|
+
a.length && D("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
|
|
978
|
+
let o = r.locks.find((e) => F(r, e));
|
|
979
|
+
o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
|
|
964
980
|
let s = t.customTextFields;
|
|
965
981
|
if (s !== void 0) {
|
|
966
|
-
let t =
|
|
967
|
-
(!
|
|
968
|
-
if (
|
|
982
|
+
let t = I(e.blocks);
|
|
983
|
+
(!O(s) || Object.getOwnPropertyNames(s).some((e) => {
|
|
984
|
+
if (Ke.has(e)) return !0;
|
|
969
985
|
let n = s[e], r = t.find((t) => t.id === e);
|
|
970
|
-
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !
|
|
971
|
-
})) &&
|
|
986
|
+
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !Te("custom", e) || typeof y(r, e) != "string");
|
|
987
|
+
})) && D("invalid_operation", n, qe);
|
|
972
988
|
}
|
|
973
|
-
let c =
|
|
989
|
+
let c = Re(e, i, t.customTextFields);
|
|
974
990
|
e.blocks = c.blocks, e.settings = c.settings;
|
|
975
991
|
}
|
|
976
992
|
// ../types/src/invert-operations.ts
|
|
977
|
-
function
|
|
993
|
+
function Mt(e) {
|
|
978
994
|
let t = e.children;
|
|
979
995
|
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
980
996
|
}
|
|
981
|
-
function
|
|
997
|
+
function Nt(e, t, n = null) {
|
|
982
998
|
for (let r = 0; r < e.length; r++) {
|
|
983
999
|
let i = e[r];
|
|
984
1000
|
if (i.id === t) return {
|
|
@@ -986,30 +1002,34 @@ function At(e, t, n = null) {
|
|
|
986
1002
|
parent: n,
|
|
987
1003
|
after: r > 0 ? e[r - 1].id : null
|
|
988
1004
|
};
|
|
989
|
-
let a =
|
|
1005
|
+
let a = Mt(i);
|
|
990
1006
|
for (let e = 0; e < a.length; e++) {
|
|
991
1007
|
if (!Array.isArray(a[e])) continue;
|
|
992
|
-
let n =
|
|
1008
|
+
let n = Nt(a[e], t, {
|
|
993
1009
|
sectionId: i.id,
|
|
994
1010
|
column: e
|
|
995
1011
|
});
|
|
996
1012
|
if (n) return n;
|
|
997
1013
|
}
|
|
1014
|
+
if (i.type === "wrapper" && Array.isArray(i.children)) {
|
|
1015
|
+
let e = Nt(i.children, t, { wrapperId: i.id });
|
|
1016
|
+
if (e) return e;
|
|
1017
|
+
}
|
|
998
1018
|
}
|
|
999
1019
|
return null;
|
|
1000
1020
|
}
|
|
1001
|
-
function
|
|
1002
|
-
let r =
|
|
1003
|
-
if (!r) throw new
|
|
1021
|
+
function Pt(e, t, n) {
|
|
1022
|
+
let r = Nt(e.blocks, t);
|
|
1023
|
+
if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
|
|
1004
1024
|
return r;
|
|
1005
1025
|
}
|
|
1006
|
-
function
|
|
1026
|
+
function Ft(e, t, n) {
|
|
1007
1027
|
let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
|
|
1008
1028
|
for (let n of o) {
|
|
1009
1029
|
let o = e[n];
|
|
1010
|
-
o === void 0 ? i.push(n) : r[n] =
|
|
1030
|
+
o === void 0 ? i.push(n) : r[n] = m(o);
|
|
1011
1031
|
let s = t && n in t ? t[n] : void 0;
|
|
1012
|
-
a[n] = s === void 0 ? null :
|
|
1032
|
+
a[n] = s === void 0 ? null : m(s);
|
|
1013
1033
|
}
|
|
1014
1034
|
return {
|
|
1015
1035
|
set: r,
|
|
@@ -1017,13 +1037,13 @@ function Mt(e, t, n) {
|
|
|
1017
1037
|
expect: a
|
|
1018
1038
|
};
|
|
1019
1039
|
}
|
|
1020
|
-
function
|
|
1040
|
+
function R(e, t) {
|
|
1021
1041
|
return e.l10n?.[t] ?? {};
|
|
1022
1042
|
}
|
|
1023
|
-
function
|
|
1043
|
+
function z(e, t, n, r) {
|
|
1024
1044
|
let i = {}, a = {}, o = {};
|
|
1025
1045
|
n.length && (o.text = {}, o.set = {});
|
|
1026
|
-
for (let r of n) e.text?.[r] !== void 0 && (i[r] =
|
|
1046
|
+
for (let r of n) e.text?.[r] !== void 0 && (i[r] = m(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = m(e.set[r])), o.text[r] = m(t.text?.[r] ?? null), o.set[r] = m(t.set?.[r] ?? null);
|
|
1027
1047
|
return r && (o.hidden = t.hidden === !0), {
|
|
1028
1048
|
unset: n,
|
|
1029
1049
|
...Object.keys(i).length ? { text: i } : {},
|
|
@@ -1032,21 +1052,21 @@ function L(e, t, n, r) {
|
|
|
1032
1052
|
expect: o
|
|
1033
1053
|
};
|
|
1034
1054
|
}
|
|
1035
|
-
function
|
|
1036
|
-
let { unset: t, ...n } =
|
|
1055
|
+
function It(e) {
|
|
1056
|
+
let { unset: t, ...n } = z(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
|
|
1037
1057
|
return n;
|
|
1038
1058
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return e.flatMap((e) => [e, ...e.type === "wrapper" ?
|
|
1059
|
+
function B(e) {
|
|
1060
|
+
return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) : Mt(e).flatMap(B)]);
|
|
1041
1061
|
}
|
|
1042
|
-
function
|
|
1043
|
-
let n =
|
|
1044
|
-
|
|
1062
|
+
function Lt(e, t) {
|
|
1063
|
+
let n = m(e);
|
|
1064
|
+
E(n, [t]);
|
|
1045
1065
|
let r = [], i = (e, t, n) => {
|
|
1046
1066
|
for (let [i, a] of Object.entries(e.l10n ?? {})) {
|
|
1047
1067
|
let e = t.l10n?.[i] ?? {}, o = [.../* @__PURE__ */ new Set([...Object.keys(a.text ?? {}).filter((t) => !Object.hasOwn(e.text ?? {}, t)), ...Object.keys(a.set ?? {}).filter((t) => !Object.hasOwn(e.set ?? {}, t))])];
|
|
1048
1068
|
if (!o.length) continue;
|
|
1049
|
-
let s =
|
|
1069
|
+
let s = z(a, e, o, !1);
|
|
1050
1070
|
r.push(n === void 0 ? {
|
|
1051
1071
|
op: "updateSettingsLocale",
|
|
1052
1072
|
locale: i,
|
|
@@ -1061,32 +1081,32 @@ function Pt(e, t) {
|
|
|
1061
1081
|
};
|
|
1062
1082
|
if (t.op === "updateSettings") i(e.settings, n.settings);
|
|
1063
1083
|
else {
|
|
1064
|
-
let t = new Map(
|
|
1065
|
-
for (let n of
|
|
1084
|
+
let t = new Map(B(n.blocks).map((e) => [e.id, e]));
|
|
1085
|
+
for (let n of B(e.blocks)) {
|
|
1066
1086
|
let e = t.get(n.id);
|
|
1067
1087
|
e && i(n, e, n.id);
|
|
1068
1088
|
}
|
|
1069
1089
|
}
|
|
1070
1090
|
return r;
|
|
1071
1091
|
}
|
|
1072
|
-
function
|
|
1092
|
+
function Rt(e, t, n) {
|
|
1073
1093
|
switch (t.op) {
|
|
1074
1094
|
case "addBlock": return {
|
|
1075
1095
|
op: "deleteBlock",
|
|
1076
1096
|
blockId: t.block.id,
|
|
1077
|
-
expect: { block:
|
|
1097
|
+
expect: { block: m(t.block) }
|
|
1078
1098
|
};
|
|
1079
1099
|
case "deleteBlock": {
|
|
1080
|
-
let r =
|
|
1100
|
+
let r = Pt(e, t.blockId, n);
|
|
1081
1101
|
return {
|
|
1082
1102
|
op: "addBlock",
|
|
1083
|
-
block:
|
|
1103
|
+
block: m(r.block),
|
|
1084
1104
|
parent: r.parent,
|
|
1085
1105
|
after: r.after
|
|
1086
1106
|
};
|
|
1087
1107
|
}
|
|
1088
1108
|
case "moveBlock": {
|
|
1089
|
-
let r =
|
|
1109
|
+
let r = Pt(e, t.blockId, n);
|
|
1090
1110
|
return {
|
|
1091
1111
|
op: "moveBlock",
|
|
1092
1112
|
blockId: t.blockId,
|
|
@@ -1099,23 +1119,23 @@ function Ft(e, t, n) {
|
|
|
1099
1119
|
};
|
|
1100
1120
|
}
|
|
1101
1121
|
case "updateBlock": {
|
|
1102
|
-
let r =
|
|
1122
|
+
let r = Pt(e, t.blockId, n).block, { set: i, unset: a, expect: o } = Ft(r, t.set, t.unset);
|
|
1103
1123
|
return [{
|
|
1104
1124
|
op: "updateBlock",
|
|
1105
1125
|
blockId: t.blockId,
|
|
1106
1126
|
...Object.keys(i).length > 0 ? { set: i } : {},
|
|
1107
1127
|
...a.length > 0 ? { unset: a } : {},
|
|
1108
1128
|
expect: o
|
|
1109
|
-
}, ...
|
|
1129
|
+
}, ...Lt(e, t)];
|
|
1110
1130
|
}
|
|
1111
1131
|
case "updateSettings": {
|
|
1112
|
-
let { set: n, unset: r, expect: i } =
|
|
1132
|
+
let { set: n, unset: r, expect: i } = Ft(e.settings, t.set, t.unset);
|
|
1113
1133
|
return [{
|
|
1114
1134
|
op: "updateSettings",
|
|
1115
1135
|
...Object.keys(n).length > 0 ? { set: n } : {},
|
|
1116
1136
|
...r.length > 0 ? { unset: r } : {},
|
|
1117
1137
|
expect: i
|
|
1118
|
-
}, ...
|
|
1138
|
+
}, ...Lt(e, t)];
|
|
1119
1139
|
}
|
|
1120
1140
|
case "addLocale": return {
|
|
1121
1141
|
op: "removeLocale",
|
|
@@ -1128,18 +1148,18 @@ function Ft(e, t, n) {
|
|
|
1128
1148
|
locale: t.locale,
|
|
1129
1149
|
position: e.settings.locales?.indexOf(t.locale)
|
|
1130
1150
|
}];
|
|
1131
|
-
for (let r of
|
|
1151
|
+
for (let r of B(e.blocks)) {
|
|
1132
1152
|
let e = r.l10n?.[t.locale];
|
|
1133
1153
|
e && n.push({
|
|
1134
1154
|
op: "updateBlockLocale",
|
|
1135
1155
|
blockId: r.id,
|
|
1136
1156
|
locale: t.locale,
|
|
1137
|
-
...
|
|
1157
|
+
...It(e)
|
|
1138
1158
|
});
|
|
1139
1159
|
}
|
|
1140
1160
|
let r = e.settings.l10n?.[t.locale];
|
|
1141
1161
|
if (r) {
|
|
1142
|
-
let { hidden: e, ...i } =
|
|
1162
|
+
let { hidden: e, ...i } = It(r);
|
|
1143
1163
|
n.push({
|
|
1144
1164
|
op: "updateSettingsLocale",
|
|
1145
1165
|
locale: t.locale,
|
|
@@ -1150,23 +1170,23 @@ function Ft(e, t, n) {
|
|
|
1150
1170
|
}
|
|
1151
1171
|
case "updateBlockLocale":
|
|
1152
1172
|
case "updateSettingsLocale": {
|
|
1153
|
-
let n =
|
|
1154
|
-
|
|
1173
|
+
let n = m(e);
|
|
1174
|
+
E(n, [t]);
|
|
1155
1175
|
let r = [.../* @__PURE__ */ new Set([
|
|
1156
1176
|
...Object.keys(t.text ?? {}),
|
|
1157
1177
|
...Object.keys(t.set ?? {}),
|
|
1158
1178
|
...t.unset ?? []
|
|
1159
1179
|
])];
|
|
1160
1180
|
if (t.op === "updateBlockLocale") {
|
|
1161
|
-
let i =
|
|
1181
|
+
let i = B(e.blocks).find((e) => e.id === t.blockId), a = B(n.blocks).find((e) => e.id === t.blockId);
|
|
1162
1182
|
return {
|
|
1163
1183
|
op: "updateBlockLocale",
|
|
1164
1184
|
blockId: t.blockId,
|
|
1165
1185
|
locale: t.locale,
|
|
1166
|
-
...
|
|
1186
|
+
...z(R(i, t.locale), R(a, t.locale), r, t.hidden !== void 0)
|
|
1167
1187
|
};
|
|
1168
1188
|
}
|
|
1169
|
-
let { hidden: i, ...a } =
|
|
1189
|
+
let { hidden: i, ...a } = z(R(e.settings, t.locale), R(n.settings, t.locale), r, !1);
|
|
1170
1190
|
return {
|
|
1171
1191
|
op: "updateSettingsLocale",
|
|
1172
1192
|
locale: t.locale,
|
|
@@ -1177,95 +1197,95 @@ function Ft(e, t, n) {
|
|
|
1177
1197
|
case "setContent": return {
|
|
1178
1198
|
op: "setContent",
|
|
1179
1199
|
content: {
|
|
1180
|
-
blocks:
|
|
1181
|
-
settings:
|
|
1200
|
+
blocks: m(e.blocks),
|
|
1201
|
+
settings: m(e.settings)
|
|
1182
1202
|
}
|
|
1183
1203
|
};
|
|
1184
1204
|
}
|
|
1185
1205
|
}
|
|
1186
|
-
function
|
|
1187
|
-
let n =
|
|
1206
|
+
function zt(e, t) {
|
|
1207
|
+
let n = m(e), r = [];
|
|
1188
1208
|
return t.forEach((e, t) => {
|
|
1189
1209
|
try {
|
|
1190
|
-
let i =
|
|
1191
|
-
r.push(...Array.isArray(i) ? [...i].reverse() : [i]),
|
|
1210
|
+
let i = Rt(n, e, t);
|
|
1211
|
+
r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
|
|
1192
1212
|
} catch (e) {
|
|
1193
|
-
throw e instanceof
|
|
1213
|
+
throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
|
|
1194
1214
|
}
|
|
1195
1215
|
}), r.reverse();
|
|
1196
1216
|
}
|
|
1197
1217
|
// ../types/src/collaboration.ts
|
|
1198
|
-
function
|
|
1218
|
+
function Bt(e) {
|
|
1199
1219
|
return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
|
|
1200
1220
|
}
|
|
1201
|
-
var
|
|
1221
|
+
var Vt = class extends ge {
|
|
1202
1222
|
opIndex;
|
|
1203
1223
|
holder;
|
|
1204
1224
|
holders;
|
|
1205
1225
|
constructor(e, t) {
|
|
1206
|
-
super(e, t.status ??
|
|
1226
|
+
super(e, t.status ?? Bt(t.code), t.code), this.name = "CollaborationConflict", t.opIndex !== void 0 && (this.opIndex = t.opIndex), t.holder !== void 0 && (this.holder = t.holder), t.holders !== void 0 && (this.holders = t.holders);
|
|
1207
1227
|
}
|
|
1208
1228
|
};
|
|
1209
1229
|
// ../types/src/guards.ts
|
|
1210
|
-
function
|
|
1230
|
+
function Ht(e) {
|
|
1211
1231
|
return e.type === "section";
|
|
1212
1232
|
}
|
|
1213
|
-
function
|
|
1233
|
+
function Ut(e) {
|
|
1214
1234
|
return e.type === "title";
|
|
1215
1235
|
}
|
|
1216
|
-
function
|
|
1236
|
+
function Wt(e) {
|
|
1217
1237
|
return e.type === "paragraph";
|
|
1218
1238
|
}
|
|
1219
|
-
function
|
|
1239
|
+
function Gt(e) {
|
|
1220
1240
|
return e.type === "image";
|
|
1221
1241
|
}
|
|
1222
|
-
function
|
|
1242
|
+
function Kt(e) {
|
|
1223
1243
|
return e.type === "button";
|
|
1224
1244
|
}
|
|
1225
|
-
function
|
|
1245
|
+
function qt(e) {
|
|
1226
1246
|
return e.type === "divider";
|
|
1227
1247
|
}
|
|
1228
|
-
function
|
|
1248
|
+
function Jt(e) {
|
|
1229
1249
|
return e.type === "video";
|
|
1230
1250
|
}
|
|
1231
|
-
function
|
|
1251
|
+
function Yt(e) {
|
|
1232
1252
|
return e.type === "social";
|
|
1233
1253
|
}
|
|
1234
|
-
function
|
|
1254
|
+
function Xt(e) {
|
|
1235
1255
|
return e.type === "spacer";
|
|
1236
1256
|
}
|
|
1237
|
-
function
|
|
1257
|
+
function Zt(e) {
|
|
1238
1258
|
return e.type === "html";
|
|
1239
1259
|
}
|
|
1240
|
-
function
|
|
1260
|
+
function Qt(e) {
|
|
1241
1261
|
return e.type === "menu";
|
|
1242
1262
|
}
|
|
1243
|
-
function
|
|
1263
|
+
function $t(e) {
|
|
1244
1264
|
return e.type === "table";
|
|
1245
1265
|
}
|
|
1246
|
-
function
|
|
1266
|
+
function en(e) {
|
|
1247
1267
|
return e.type === "countdown";
|
|
1248
1268
|
}
|
|
1249
|
-
function
|
|
1269
|
+
function tn(e) {
|
|
1250
1270
|
return e.type === "custom";
|
|
1251
1271
|
}
|
|
1252
|
-
function
|
|
1272
|
+
function V(e) {
|
|
1253
1273
|
return e.type === "slot";
|
|
1254
1274
|
}
|
|
1255
|
-
function
|
|
1275
|
+
function H(e) {
|
|
1256
1276
|
return e.type === "wrapper";
|
|
1257
1277
|
}
|
|
1258
1278
|
// ../types/src/defaults.ts
|
|
1259
|
-
var
|
|
1279
|
+
var nn = {
|
|
1260
1280
|
content: "<p>Enter your title</p>",
|
|
1261
1281
|
level: 2,
|
|
1262
1282
|
textAlign: "left"
|
|
1263
|
-
},
|
|
1283
|
+
}, rn = { content: "<p>Enter your text here</p>" }, an = {
|
|
1264
1284
|
src: "",
|
|
1265
1285
|
alt: "",
|
|
1266
1286
|
width: "full",
|
|
1267
1287
|
align: "center"
|
|
1268
|
-
},
|
|
1288
|
+
}, on = {
|
|
1269
1289
|
text: "Click Here",
|
|
1270
1290
|
url: "",
|
|
1271
1291
|
backgroundColor: "#333333",
|
|
@@ -1279,36 +1299,36 @@ var $t = {
|
|
|
1279
1299
|
left: 24
|
|
1280
1300
|
},
|
|
1281
1301
|
align: "center"
|
|
1282
|
-
},
|
|
1302
|
+
}, sn = {
|
|
1283
1303
|
lineStyle: "solid",
|
|
1284
1304
|
color: "#e0e0e0",
|
|
1285
1305
|
thickness: 1,
|
|
1286
1306
|
width: "full"
|
|
1287
|
-
},
|
|
1307
|
+
}, cn = { columns: "1" }, ln = {
|
|
1288
1308
|
url: "",
|
|
1289
1309
|
thumbnailUrl: "",
|
|
1290
1310
|
alt: "Video",
|
|
1291
1311
|
width: "full",
|
|
1292
1312
|
align: "center"
|
|
1293
|
-
},
|
|
1313
|
+
}, un = {
|
|
1294
1314
|
iconStyle: "solid",
|
|
1295
1315
|
iconSize: "medium",
|
|
1296
1316
|
spacing: 10,
|
|
1297
1317
|
align: "center"
|
|
1298
|
-
},
|
|
1318
|
+
}, dn = { height: 24 }, fn = { content: "" }, pn = {
|
|
1299
1319
|
fontSize: 15,
|
|
1300
1320
|
textAlign: "center",
|
|
1301
1321
|
separator: "|",
|
|
1302
1322
|
separatorColor: "#e0e0e0",
|
|
1303
1323
|
spacing: 10
|
|
1304
|
-
},
|
|
1324
|
+
}, mn = {
|
|
1305
1325
|
hasHeaderRow: !0,
|
|
1306
1326
|
borderColor: "#e0e0e0",
|
|
1307
1327
|
borderWidth: 1,
|
|
1308
1328
|
cellPadding: 8,
|
|
1309
1329
|
fontSize: 15,
|
|
1310
1330
|
textAlign: "left"
|
|
1311
|
-
},
|
|
1331
|
+
}, hn = {
|
|
1312
1332
|
targetDate: "",
|
|
1313
1333
|
timezone: "UTC",
|
|
1314
1334
|
showDays: !0,
|
|
@@ -1328,21 +1348,21 @@ var $t = {
|
|
|
1328
1348
|
expiredMessage: "This offer has expired",
|
|
1329
1349
|
expiredImageUrl: "",
|
|
1330
1350
|
hideOnExpiry: !1
|
|
1331
|
-
},
|
|
1332
|
-
title:
|
|
1333
|
-
paragraph:
|
|
1334
|
-
image:
|
|
1335
|
-
button:
|
|
1336
|
-
divider:
|
|
1337
|
-
section:
|
|
1338
|
-
video:
|
|
1339
|
-
social:
|
|
1340
|
-
spacer:
|
|
1341
|
-
html:
|
|
1342
|
-
menu:
|
|
1343
|
-
table:
|
|
1344
|
-
countdown:
|
|
1345
|
-
},
|
|
1351
|
+
}, gn = {
|
|
1352
|
+
title: nn,
|
|
1353
|
+
paragraph: rn,
|
|
1354
|
+
image: an,
|
|
1355
|
+
button: on,
|
|
1356
|
+
divider: sn,
|
|
1357
|
+
section: cn,
|
|
1358
|
+
video: ln,
|
|
1359
|
+
social: un,
|
|
1360
|
+
spacer: dn,
|
|
1361
|
+
html: fn,
|
|
1362
|
+
menu: pn,
|
|
1363
|
+
table: mn,
|
|
1364
|
+
countdown: hn
|
|
1365
|
+
}, _n = {
|
|
1346
1366
|
width: 600,
|
|
1347
1367
|
backgroundColor: "#ffffff",
|
|
1348
1368
|
textColor: "#1a1a1a",
|
|
@@ -1350,30 +1370,30 @@ var $t = {
|
|
|
1350
1370
|
fontFamily: "Arial",
|
|
1351
1371
|
locale: "en"
|
|
1352
1372
|
};
|
|
1353
|
-
function
|
|
1373
|
+
function vn(e) {
|
|
1354
1374
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
1355
1375
|
}
|
|
1356
|
-
function
|
|
1376
|
+
function yn(e, t) {
|
|
1357
1377
|
let n = { ...e };
|
|
1358
1378
|
for (let r of Object.keys(t)) {
|
|
1359
1379
|
let i = e[r], a = t[r];
|
|
1360
|
-
a !== void 0 && (n[r] =
|
|
1380
|
+
a !== void 0 && (n[r] = vn(i) && vn(a) ? yn(i, a) : a);
|
|
1361
1381
|
}
|
|
1362
1382
|
return n;
|
|
1363
1383
|
}
|
|
1364
1384
|
// ../types/src/template.ts
|
|
1365
|
-
function
|
|
1385
|
+
function bn(e = "Arial", t) {
|
|
1366
1386
|
return {
|
|
1367
1387
|
blocks: [],
|
|
1368
1388
|
settings: {
|
|
1369
|
-
...
|
|
1389
|
+
..._n,
|
|
1370
1390
|
fontFamily: e,
|
|
1371
1391
|
...t
|
|
1372
1392
|
}
|
|
1373
1393
|
};
|
|
1374
1394
|
}
|
|
1375
1395
|
// ../types/src/direction.ts
|
|
1376
|
-
var
|
|
1396
|
+
var xn = [
|
|
1377
1397
|
"ar",
|
|
1378
1398
|
"he",
|
|
1379
1399
|
"iw",
|
|
@@ -1387,24 +1407,24 @@ var vn = [
|
|
|
1387
1407
|
"ckb",
|
|
1388
1408
|
"ks"
|
|
1389
1409
|
];
|
|
1390
|
-
function
|
|
1410
|
+
function Sn(e) {
|
|
1391
1411
|
let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
|
|
1392
|
-
return !!t &&
|
|
1412
|
+
return !!t && xn.includes(t);
|
|
1393
1413
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return e.direction === "ltr" || e.direction === "rtl" ? e.direction :
|
|
1414
|
+
function Cn(e) {
|
|
1415
|
+
return e.direction === "ltr" || e.direction === "rtl" ? e.direction : Sn(e.locale) ? "rtl" : "ltr";
|
|
1396
1416
|
}
|
|
1397
1417
|
// ../types/src/translation.ts
|
|
1398
|
-
var
|
|
1399
|
-
function
|
|
1418
|
+
var wn = 2e4, Tn = /* @__PURE__ */ new Set(["\"", "'"]);
|
|
1419
|
+
function En(e, t) {
|
|
1400
1420
|
let n = null, r = "tag";
|
|
1401
1421
|
for (let i = t; i < e.length; i++) {
|
|
1402
1422
|
let t = e[i];
|
|
1403
1423
|
if (n !== null) t === n && (n = null);
|
|
1404
1424
|
else {
|
|
1405
1425
|
if (r === "beforeValue") {
|
|
1406
|
-
if (
|
|
1407
|
-
if (
|
|
1426
|
+
if (U(t)) continue;
|
|
1427
|
+
if (Tn.has(t)) {
|
|
1408
1428
|
n = t, r = "tag";
|
|
1409
1429
|
continue;
|
|
1410
1430
|
}
|
|
@@ -1412,19 +1432,19 @@ function V(e, t) {
|
|
|
1412
1432
|
}
|
|
1413
1433
|
if (r === "unquotedValue") {
|
|
1414
1434
|
if (t === ">") return i;
|
|
1415
|
-
|
|
1435
|
+
U(t) && (r = "tag");
|
|
1416
1436
|
} else if (t === "=") r = "beforeValue";
|
|
1417
1437
|
else if (t === ">") return i;
|
|
1418
1438
|
}
|
|
1419
1439
|
}
|
|
1420
1440
|
return -1;
|
|
1421
1441
|
}
|
|
1422
|
-
function
|
|
1442
|
+
function Dn(e, t) {
|
|
1423
1443
|
let n = null;
|
|
1424
1444
|
for (let r = t; r < e.length; r++) {
|
|
1425
1445
|
let t = e[r];
|
|
1426
1446
|
if (n !== null) t === n && (n = null);
|
|
1427
|
-
else if (
|
|
1447
|
+
else if (Tn.has(t)) n = t;
|
|
1428
1448
|
else if (t === ">") return {
|
|
1429
1449
|
end: r,
|
|
1430
1450
|
nextSpan: -1
|
|
@@ -1439,13 +1459,13 @@ function Cn(e, t) {
|
|
|
1439
1459
|
nextSpan: -1
|
|
1440
1460
|
};
|
|
1441
1461
|
}
|
|
1442
|
-
function
|
|
1462
|
+
function On(e) {
|
|
1443
1463
|
return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
|
|
1444
1464
|
}
|
|
1445
|
-
function
|
|
1465
|
+
function U(e) {
|
|
1446
1466
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
1447
1467
|
}
|
|
1448
|
-
var
|
|
1468
|
+
var kn = {
|
|
1449
1469
|
AMP: "&",
|
|
1450
1470
|
COPY: "©",
|
|
1451
1471
|
GT: ">",
|
|
@@ -1706,54 +1726,54 @@ var Tn = {
|
|
|
1706
1726
|
zwj: "",
|
|
1707
1727
|
zwnj: ""
|
|
1708
1728
|
};
|
|
1709
|
-
function
|
|
1729
|
+
function W(e) {
|
|
1710
1730
|
return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
|
|
1711
1731
|
if (t[0] === "#") {
|
|
1712
1732
|
let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
|
|
1713
1733
|
return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
|
|
1714
1734
|
}
|
|
1715
|
-
return Object.hasOwn(
|
|
1735
|
+
return Object.hasOwn(kn, t) ? kn[t] : e;
|
|
1716
1736
|
}) : e;
|
|
1717
1737
|
}
|
|
1718
|
-
function
|
|
1738
|
+
function An(e, t) {
|
|
1719
1739
|
let n = t.toLowerCase(), r = 0;
|
|
1720
1740
|
for (; r < e.length;) {
|
|
1721
|
-
for (; r < e.length && (
|
|
1741
|
+
for (; r < e.length && (U(e[r]) || e[r] === "/");) r++;
|
|
1722
1742
|
if (r >= e.length) break;
|
|
1723
1743
|
let t = r;
|
|
1724
|
-
for (; r < e.length &&
|
|
1744
|
+
for (; r < e.length && On(e[r]);) r++;
|
|
1725
1745
|
let i = e.substring(t, r).toLowerCase();
|
|
1726
1746
|
if (i === "") {
|
|
1727
1747
|
r++;
|
|
1728
1748
|
continue;
|
|
1729
1749
|
}
|
|
1730
|
-
for (; r < e.length &&
|
|
1750
|
+
for (; r < e.length && U(e[r]);) r++;
|
|
1731
1751
|
if (e[r] !== "=") continue;
|
|
1732
|
-
for (r++; r < e.length &&
|
|
1752
|
+
for (r++; r < e.length && U(e[r]);) r++;
|
|
1733
1753
|
let a = e[r];
|
|
1734
|
-
if (
|
|
1754
|
+
if (Tn.has(a)) {
|
|
1735
1755
|
let t = r + 1, o = e.indexOf(a, t);
|
|
1736
1756
|
if (o === -1) return null;
|
|
1737
|
-
if (i === n) return
|
|
1757
|
+
if (i === n) return W(e.substring(t, o));
|
|
1738
1758
|
r = o + 1;
|
|
1739
1759
|
continue;
|
|
1740
1760
|
}
|
|
1741
1761
|
let o = r;
|
|
1742
|
-
for (; r < e.length && !
|
|
1743
|
-
if (i === n) return
|
|
1762
|
+
for (; r < e.length && !U(e[r]) && e[r] !== ">";) r++;
|
|
1763
|
+
if (i === n) return W(e.substring(o, r));
|
|
1744
1764
|
}
|
|
1745
1765
|
return null;
|
|
1746
1766
|
}
|
|
1747
1767
|
// ../types/src/merge-tag-html.ts
|
|
1748
|
-
function
|
|
1749
|
-
return
|
|
1768
|
+
function jn(e) {
|
|
1769
|
+
return Pn(e, (e) => e, !1);
|
|
1750
1770
|
}
|
|
1751
|
-
function
|
|
1752
|
-
return
|
|
1771
|
+
function Mn(e, t) {
|
|
1772
|
+
return Pn(e, t, !0);
|
|
1753
1773
|
}
|
|
1754
|
-
function
|
|
1774
|
+
function Nn(e) {
|
|
1755
1775
|
let t = [];
|
|
1756
|
-
return
|
|
1776
|
+
return Pn(e, (n, r, i) => {
|
|
1757
1777
|
let a = e.slice(r, i);
|
|
1758
1778
|
return t.push({
|
|
1759
1779
|
start: r,
|
|
@@ -1762,7 +1782,7 @@ function kn(e) {
|
|
|
1762
1782
|
}), a;
|
|
1763
1783
|
}, !0), t;
|
|
1764
1784
|
}
|
|
1765
|
-
function
|
|
1785
|
+
function Pn(e, t, n) {
|
|
1766
1786
|
let r = "", i = 0;
|
|
1767
1787
|
for (; i < e.length;) {
|
|
1768
1788
|
let a = e.indexOf("<span", i);
|
|
@@ -1775,7 +1795,7 @@ function An(e, t, n) {
|
|
|
1775
1795
|
r += e.substring(i, a + 5), i = a + 5;
|
|
1776
1796
|
continue;
|
|
1777
1797
|
}
|
|
1778
|
-
let { end: s, nextSpan: c } =
|
|
1798
|
+
let { end: s, nextSpan: c } = Dn(e, a + 5);
|
|
1779
1799
|
if (c !== -1) {
|
|
1780
1800
|
r += e.substring(i, c), i = c;
|
|
1781
1801
|
continue;
|
|
@@ -1784,12 +1804,12 @@ function An(e, t, n) {
|
|
|
1784
1804
|
r += e.substring(i);
|
|
1785
1805
|
break;
|
|
1786
1806
|
}
|
|
1787
|
-
let l = e.substring(a + 5, s), u =
|
|
1807
|
+
let l = e.substring(a + 5, s), u = In(l, "data-merge-tag") ?? In(l, "data-logic-merge-tag");
|
|
1788
1808
|
if (u === null) {
|
|
1789
1809
|
r += e.substring(i, s + 1), i = s + 1;
|
|
1790
1810
|
continue;
|
|
1791
1811
|
}
|
|
1792
|
-
let d =
|
|
1812
|
+
let d = Fn(e, s + 1, n);
|
|
1793
1813
|
if (d === -1) {
|
|
1794
1814
|
r += e.substring(i);
|
|
1795
1815
|
break;
|
|
@@ -1798,7 +1818,7 @@ function An(e, t, n) {
|
|
|
1798
1818
|
}
|
|
1799
1819
|
return r;
|
|
1800
1820
|
}
|
|
1801
|
-
function
|
|
1821
|
+
function Fn(e, t, n) {
|
|
1802
1822
|
if (!n) {
|
|
1803
1823
|
let n = e.indexOf("</span>", t);
|
|
1804
1824
|
return n === -1 ? -1 : n + 7;
|
|
@@ -1807,7 +1827,7 @@ function jn(e, t, n) {
|
|
|
1807
1827
|
for (; i < e.length;) {
|
|
1808
1828
|
let t = e.indexOf("<", i);
|
|
1809
1829
|
if (t === -1) return -1;
|
|
1810
|
-
let n =
|
|
1830
|
+
let n = En(e, t + 1);
|
|
1811
1831
|
if (n === -1) return -1;
|
|
1812
1832
|
let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
|
|
1813
1833
|
if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
|
|
@@ -1815,11 +1835,11 @@ function jn(e, t, n) {
|
|
|
1815
1835
|
}
|
|
1816
1836
|
return -1;
|
|
1817
1837
|
}
|
|
1818
|
-
function
|
|
1819
|
-
return
|
|
1838
|
+
function In(e, t) {
|
|
1839
|
+
return An(e, t);
|
|
1820
1840
|
}
|
|
1821
1841
|
// ../types/src/merge-tags.ts
|
|
1822
|
-
var
|
|
1842
|
+
var G = {
|
|
1823
1843
|
liquid: {
|
|
1824
1844
|
value: /\{\{.+?\}\}/g,
|
|
1825
1845
|
logic: /\{%-?\s*(\w+).*?-?%\}/g,
|
|
@@ -1845,13 +1865,13 @@ var W = {
|
|
|
1845
1865
|
closer: "=%%"
|
|
1846
1866
|
}
|
|
1847
1867
|
};
|
|
1848
|
-
function
|
|
1849
|
-
return Object.keys(
|
|
1850
|
-
let n =
|
|
1868
|
+
function K(e) {
|
|
1869
|
+
return Object.keys(G).find((t) => {
|
|
1870
|
+
let n = G[t];
|
|
1851
1871
|
return (e.value === n.value || e.value.source === n.value.source && e.value.flags.replace(/[gy]/g, "") === n.value.flags.replace(/[gy]/g, "")) && (e.logic === n.logic || e.logic.source === n.logic.source && e.logic.flags.replace(/[gy]/g, "") === n.logic.flags.replace(/[gy]/g, ""));
|
|
1852
1872
|
});
|
|
1853
1873
|
}
|
|
1854
|
-
function
|
|
1874
|
+
function Ln(e, t, n) {
|
|
1855
1875
|
for (let r = n; r < e.length; r++) {
|
|
1856
1876
|
let n = e.charCodeAt(r);
|
|
1857
1877
|
if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
|
|
@@ -1868,8 +1888,8 @@ function Nn(e, t, n) {
|
|
|
1868
1888
|
lineBreak: -1
|
|
1869
1889
|
};
|
|
1870
1890
|
}
|
|
1871
|
-
function
|
|
1872
|
-
let a =
|
|
1891
|
+
function q(e, t, n, r = 0, i = Infinity) {
|
|
1892
|
+
let a = K(t);
|
|
1873
1893
|
if (!a) {
|
|
1874
1894
|
let a = t[n], o = new RegExp(a.source, a.flags.replace(/[gy]/g, "") + "g");
|
|
1875
1895
|
return o.lastIndex = r, [...e.matchAll(o)].slice(0, i).map((e) => ({
|
|
@@ -1893,7 +1913,7 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1893
1913
|
let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
|
|
1894
1914
|
close: e.startsWith(c, r) ? r : -1,
|
|
1895
1915
|
lineBreak: -1
|
|
1896
|
-
} :
|
|
1916
|
+
} : Ln(e, c, Math.max(r, t + s.length + +(n === "value")));
|
|
1897
1917
|
if (i.lineBreak >= 0) {
|
|
1898
1918
|
let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
|
|
1899
1919
|
p = o > t ? o : r + 1;
|
|
@@ -1915,8 +1935,8 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1915
1935
|
}
|
|
1916
1936
|
return f;
|
|
1917
1937
|
}
|
|
1918
|
-
function
|
|
1919
|
-
let n =
|
|
1938
|
+
function Rn(e, t) {
|
|
1939
|
+
let n = K(t);
|
|
1920
1940
|
if (!n) {
|
|
1921
1941
|
let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
|
|
1922
1942
|
return [...e.matchAll(n)].map((e) => ({
|
|
@@ -1924,7 +1944,7 @@ function Pn(e, t) {
|
|
|
1924
1944
|
value: e[0]
|
|
1925
1945
|
}));
|
|
1926
1946
|
}
|
|
1927
|
-
if (n === "handlebars") return
|
|
1947
|
+
if (n === "handlebars") return q(e, t, "value");
|
|
1928
1948
|
if (n === "mailchimp") {
|
|
1929
1949
|
let n = [], r = new RegExp(t.value.source, "y"), i = new RegExp(t.logic.source, "y"), a = /\*\|\w+[:|]/y, o = 0;
|
|
1930
1950
|
for (; o < e.length;) {
|
|
@@ -1943,7 +1963,7 @@ function Pn(e, t) {
|
|
|
1943
1963
|
o = t + 2;
|
|
1944
1964
|
continue;
|
|
1945
1965
|
}
|
|
1946
|
-
let c =
|
|
1966
|
+
let c = Ln(e, "|*", a.lastIndex);
|
|
1947
1967
|
if (c.lineBreak >= 0) {
|
|
1948
1968
|
o = c.lineBreak + 1;
|
|
1949
1969
|
continue;
|
|
@@ -1958,78 +1978,78 @@ function Pn(e, t) {
|
|
|
1958
1978
|
}
|
|
1959
1979
|
return n;
|
|
1960
1980
|
}
|
|
1961
|
-
let r = [], i = 0, a =
|
|
1981
|
+
let r = [], i = 0, a = q(e, t, "value", i, 1)[0], o = q(e, t, "logic", i, 1)[0];
|
|
1962
1982
|
for (; a || o;) {
|
|
1963
1983
|
let n = !o || a && a.index <= o.index ? a : o;
|
|
1964
|
-
r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a =
|
|
1984
|
+
r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a = q(e, t, "value", i, 1)[0]), (n === o || o && o.index < i) && (o = q(e, t, "logic", i, 1)[0]);
|
|
1965
1985
|
}
|
|
1966
1986
|
return r;
|
|
1967
1987
|
}
|
|
1968
|
-
function
|
|
1988
|
+
function zn(e) {
|
|
1969
1989
|
return typeof e == "string" && e.trim() !== "" ? e : null;
|
|
1970
1990
|
}
|
|
1971
|
-
function
|
|
1972
|
-
return Object.values(
|
|
1991
|
+
function Bn(e) {
|
|
1992
|
+
return Object.values(G).find((t) => t.value.source === e.value.source) ?? null;
|
|
1973
1993
|
}
|
|
1974
|
-
function
|
|
1975
|
-
return
|
|
1994
|
+
function Vn(e) {
|
|
1995
|
+
return zn(e.opener) ?? Bn(e)?.opener ?? null;
|
|
1976
1996
|
}
|
|
1977
|
-
function
|
|
1978
|
-
return
|
|
1997
|
+
function Hn(e) {
|
|
1998
|
+
return zn(e.closer) ?? Bn(e)?.closer ?? null;
|
|
1979
1999
|
}
|
|
1980
|
-
function
|
|
1981
|
-
return e ? typeof e == "string" ?
|
|
2000
|
+
function Un(e) {
|
|
2001
|
+
return e ? typeof e == "string" ? G[e] ?? G.liquid : e : G.liquid;
|
|
1982
2002
|
}
|
|
1983
|
-
function
|
|
2003
|
+
function Wn(e) {
|
|
1984
2004
|
let t = e.source, n = e.flags.replace("g", "");
|
|
1985
2005
|
return RegExp(`^${t}$`, n);
|
|
1986
2006
|
}
|
|
1987
|
-
function
|
|
2007
|
+
function Gn(e, t) {
|
|
1988
2008
|
let n = e?.trim() || "";
|
|
1989
|
-
return !
|
|
2009
|
+
return !Wn(t.logic).test(n) && Wn(t.value).test(n);
|
|
1990
2010
|
}
|
|
1991
|
-
function
|
|
2011
|
+
function Kn(e, t) {
|
|
1992
2012
|
let n = t.find((t) => t.value === e);
|
|
1993
2013
|
return n ? n.label : e;
|
|
1994
2014
|
}
|
|
1995
|
-
function
|
|
1996
|
-
return
|
|
2015
|
+
function qn(e, t) {
|
|
2016
|
+
return rr(e, "data-merge-tag", (e) => Kn(e, t));
|
|
1997
2017
|
}
|
|
1998
|
-
function
|
|
2018
|
+
function Jn(e, t) {
|
|
1999
2019
|
return t.find((t) => t.value === e)?.sample;
|
|
2000
2020
|
}
|
|
2001
|
-
function
|
|
2002
|
-
return
|
|
2021
|
+
function Yn(e, t) {
|
|
2022
|
+
return rr(e, "data-merge-tag", (e) => Qn(Jn(e, t) ?? Kn(e, t)), { unwrap: (e) => Jn(e, t) !== void 0 });
|
|
2003
2023
|
}
|
|
2004
|
-
function
|
|
2024
|
+
function Xn(e) {
|
|
2005
2025
|
return e.some((e) => e.sample !== void 0);
|
|
2006
2026
|
}
|
|
2007
|
-
function
|
|
2027
|
+
function Zn(e, t) {
|
|
2008
2028
|
if (!e) return e;
|
|
2009
2029
|
let n = e;
|
|
2010
2030
|
for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
|
|
2011
2031
|
return n;
|
|
2012
2032
|
}
|
|
2013
|
-
function
|
|
2033
|
+
function Qn(e) {
|
|
2014
2034
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2015
2035
|
}
|
|
2016
|
-
function
|
|
2036
|
+
function $n(e, t) {
|
|
2017
2037
|
if (!e) return !1;
|
|
2018
|
-
if (
|
|
2038
|
+
if (K(t)) return q(e, t, "value", 0, 1).length > 0 || q(e, t, "logic", 0, 1).length > 0;
|
|
2019
2039
|
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
2020
2040
|
return n.test(e) || r.test(e);
|
|
2021
2041
|
}
|
|
2022
|
-
function
|
|
2023
|
-
return
|
|
2042
|
+
function er(e, t) {
|
|
2043
|
+
return Wn(t.logic).test(e?.trim() || "");
|
|
2024
2044
|
}
|
|
2025
|
-
function
|
|
2045
|
+
function tr(e, t) {
|
|
2026
2046
|
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
2027
2047
|
return r && r[1] ? r[1].toUpperCase() : e;
|
|
2028
2048
|
}
|
|
2029
|
-
function
|
|
2030
|
-
return
|
|
2049
|
+
function nr(e, t) {
|
|
2050
|
+
return rr(e, "data-logic-merge-tag", (e) => tr(e, t));
|
|
2031
2051
|
}
|
|
2032
|
-
function
|
|
2052
|
+
function rr(e, t, n, r) {
|
|
2033
2053
|
let i = "", a = 0;
|
|
2034
2054
|
for (; a < e.length;) {
|
|
2035
2055
|
let o = e.indexOf("<span", a);
|
|
@@ -2042,7 +2062,7 @@ function $n(e, t, n, r) {
|
|
|
2042
2062
|
i += e.substring(a, o + 5), a = o + 5;
|
|
2043
2063
|
continue;
|
|
2044
2064
|
}
|
|
2045
|
-
let { end: c, nextSpan: l } =
|
|
2065
|
+
let { end: c, nextSpan: l } = Dn(e, o + 5);
|
|
2046
2066
|
if (l !== -1) {
|
|
2047
2067
|
i += e.substring(a, l), a = l;
|
|
2048
2068
|
continue;
|
|
@@ -2051,7 +2071,7 @@ function $n(e, t, n, r) {
|
|
|
2051
2071
|
i += e.substring(a);
|
|
2052
2072
|
break;
|
|
2053
2073
|
}
|
|
2054
|
-
let u =
|
|
2074
|
+
let u = An(e.substring(o + 5, c), t);
|
|
2055
2075
|
if (u === null) {
|
|
2056
2076
|
i += e.substring(a, c + 1), a = c + 1;
|
|
2057
2077
|
continue;
|
|
@@ -2067,14 +2087,14 @@ function $n(e, t, n, r) {
|
|
|
2067
2087
|
return i;
|
|
2068
2088
|
}
|
|
2069
2089
|
// ../types/src/locale-strings.ts
|
|
2070
|
-
var
|
|
2090
|
+
var ir = {
|
|
2071
2091
|
title: ["content"],
|
|
2072
2092
|
paragraph: ["content"]
|
|
2073
2093
|
};
|
|
2074
|
-
function
|
|
2094
|
+
function ar(e) {
|
|
2075
2095
|
let t = [], n = /<[a-z][\w:-]*\b/gi;
|
|
2076
2096
|
for (; n.exec(e);) {
|
|
2077
|
-
let r =
|
|
2097
|
+
let r = En(e, n.lastIndex);
|
|
2078
2098
|
if (r < 0) break;
|
|
2079
2099
|
let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
|
|
2080
2100
|
for (let e; e = o.exec(a);) {
|
|
@@ -2088,46 +2108,50 @@ function tr(e) {
|
|
|
2088
2108
|
}
|
|
2089
2109
|
return t;
|
|
2090
2110
|
}
|
|
2091
|
-
function
|
|
2092
|
-
let r = n === "html" ?
|
|
2111
|
+
function or(e, t, n) {
|
|
2112
|
+
let r = n === "html" ? Nn(e) : [], i = n === "html" ? ar(e) : [], a = r.map((e) => ({
|
|
2093
2113
|
...e,
|
|
2094
2114
|
attribute: !1
|
|
2095
|
-
})), o = 0, s =
|
|
2096
|
-
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) =>
|
|
2115
|
+
})), o = 0, s = K(t) !== void 0, c = (n, r) => {
|
|
2116
|
+
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => q(c, t, e, 0, 1)[0]) : [void 0, void 0], d = s ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
|
|
2097
2117
|
for (; f < c.length;) {
|
|
2098
|
-
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e) => {
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2118
|
+
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e, t) => {
|
|
2119
|
+
let n = u[t];
|
|
2120
|
+
if (n === void 0 || n !== null && n.index < f) {
|
|
2121
|
+
e.lastIndex = f;
|
|
2122
|
+
let n = e.exec(c);
|
|
2123
|
+
for (; n && n[0].length === 0;) e.lastIndex = n.index + 1, n = e.exec(c);
|
|
2124
|
+
u[t] = n ? {
|
|
2125
|
+
index: n.index,
|
|
2126
|
+
value: n[0]
|
|
2127
|
+
} : null;
|
|
2128
|
+
}
|
|
2129
|
+
return u[t] ? [u[t]] : [];
|
|
2106
2130
|
});
|
|
2107
2131
|
e.sort((e, t) => e.index - t.index || e.value.length - t.value.length);
|
|
2108
2132
|
let r = e[0];
|
|
2109
2133
|
if (!r) break;
|
|
2110
|
-
let p = n + r.index,
|
|
2134
|
+
let p = n + r.index, ee = p + r.value.length;
|
|
2111
2135
|
for (; i[o]?.end <= p;) o++;
|
|
2112
2136
|
if (a.push({
|
|
2113
2137
|
start: p,
|
|
2114
|
-
end:
|
|
2138
|
+
end: ee,
|
|
2115
2139
|
markup: r.value,
|
|
2116
|
-
attribute: i[o] !== void 0 && p >= i[o].start &&
|
|
2117
|
-
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] =
|
|
2140
|
+
attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
|
|
2141
|
+
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = q(c, t, l[e], f, 1)[0]);
|
|
2118
2142
|
}
|
|
2119
2143
|
}, l = 0;
|
|
2120
2144
|
for (let e of r) c(l, e.start), l = e.end;
|
|
2121
2145
|
return c(l, e.length), a.sort((e, t) => e.start - t.start);
|
|
2122
2146
|
}
|
|
2123
|
-
function
|
|
2147
|
+
function sr(e) {
|
|
2124
2148
|
if (!e.includes("&")) return { text: e };
|
|
2125
2149
|
let t = "", n = [0], r = 0, i = (i) => {
|
|
2126
2150
|
for (t += e.slice(r, i); r < i;) n.push(++r);
|
|
2127
2151
|
};
|
|
2128
2152
|
for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
|
|
2129
2153
|
i(a.index);
|
|
2130
|
-
let e =
|
|
2154
|
+
let e = W(a[0]);
|
|
2131
2155
|
t += e;
|
|
2132
2156
|
for (let t = 1; t < e.length; t++) n.push(-1);
|
|
2133
2157
|
r = a.index + a[0].length, n.push(r);
|
|
@@ -2137,17 +2161,17 @@ function rr(e) {
|
|
|
2137
2161
|
offsets: n
|
|
2138
2162
|
};
|
|
2139
2163
|
}
|
|
2140
|
-
var
|
|
2141
|
-
function
|
|
2142
|
-
let t = JSON.stringify(e), n =
|
|
2164
|
+
var J = /* @__PURE__ */ new Map(), cr = 32;
|
|
2165
|
+
function lr(e) {
|
|
2166
|
+
let t = JSON.stringify(e), n = J.get(t);
|
|
2143
2167
|
if (n === void 0) {
|
|
2144
2168
|
let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2145
|
-
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null,
|
|
2169
|
+
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, J.size >= cr && J.delete(J.keys().next().value), J.set(t, n);
|
|
2146
2170
|
}
|
|
2147
2171
|
return n;
|
|
2148
2172
|
}
|
|
2149
|
-
function
|
|
2150
|
-
let r = n.length ?
|
|
2173
|
+
function ur(e, t, n) {
|
|
2174
|
+
let r = n.length ? lr(n) : null;
|
|
2151
2175
|
if (!r) return [];
|
|
2152
2176
|
let i = [];
|
|
2153
2177
|
if (t === "text") i.push({
|
|
@@ -2156,7 +2180,7 @@ function or(e, t, n) {
|
|
|
2156
2180
|
attribute: !1
|
|
2157
2181
|
});
|
|
2158
2182
|
else {
|
|
2159
|
-
i.push(...
|
|
2183
|
+
i.push(...ar(e).map((e) => ({
|
|
2160
2184
|
...e,
|
|
2161
2185
|
attribute: !0
|
|
2162
2186
|
})));
|
|
@@ -2167,7 +2191,7 @@ function or(e, t, n) {
|
|
|
2167
2191
|
end: r.index,
|
|
2168
2192
|
attribute: !1
|
|
2169
2193
|
});
|
|
2170
|
-
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) :
|
|
2194
|
+
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : En(e, t.lastIndex);
|
|
2171
2195
|
if (a < 0) return [];
|
|
2172
2196
|
n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
|
|
2173
2197
|
}
|
|
@@ -2180,7 +2204,7 @@ function or(e, t, n) {
|
|
|
2180
2204
|
let a = [];
|
|
2181
2205
|
for (let n of i) {
|
|
2182
2206
|
r.lastIndex = 0;
|
|
2183
|
-
let i = e.slice(n.start, n.end), o = t === "html" ?
|
|
2207
|
+
let i = e.slice(n.start, n.end), o = t === "html" ? sr(i) : {
|
|
2184
2208
|
text: i,
|
|
2185
2209
|
offsets: void 0
|
|
2186
2210
|
};
|
|
@@ -2199,51 +2223,51 @@ function or(e, t, n) {
|
|
|
2199
2223
|
}
|
|
2200
2224
|
return a;
|
|
2201
2225
|
}
|
|
2202
|
-
function
|
|
2203
|
-
let i =
|
|
2226
|
+
function dr(e, t, n, r) {
|
|
2227
|
+
let i = or(e, t, n), a = ur(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
|
|
2204
2228
|
return [...i, ...a].sort((e, t) => e.start - t.start);
|
|
2205
2229
|
}
|
|
2206
|
-
function
|
|
2230
|
+
function fr(e, t, n) {
|
|
2207
2231
|
let r = "", i = 0;
|
|
2208
2232
|
return t.forEach((t, a) => {
|
|
2209
2233
|
r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
|
|
2210
2234
|
}), r + e.slice(i);
|
|
2211
2235
|
}
|
|
2212
|
-
function
|
|
2213
|
-
let i =
|
|
2236
|
+
function pr(e, t, n, r) {
|
|
2237
|
+
let i = dr(e, t, n, r);
|
|
2214
2238
|
return {
|
|
2215
|
-
text:
|
|
2239
|
+
text: fr(e, i, i.map((e, t) => t + 1)),
|
|
2216
2240
|
tokens: i.map((e) => e.markup)
|
|
2217
2241
|
};
|
|
2218
2242
|
}
|
|
2219
|
-
function
|
|
2243
|
+
function mr(e, t) {
|
|
2220
2244
|
let n = /* @__PURE__ */ new Set(), r = !0, i = e.replace(/<x id="(\d+)"\s*\/>|<x id="(\d+)"><\/x>|__x(\d+)__/g, (e, i, a, o) => {
|
|
2221
2245
|
let s = Number(i ?? a ?? o);
|
|
2222
2246
|
return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
|
|
2223
2247
|
});
|
|
2224
2248
|
return r && n.size === t.length ? i : null;
|
|
2225
2249
|
}
|
|
2226
|
-
function
|
|
2227
|
-
let a =
|
|
2250
|
+
function hr(e, t, n, r, i) {
|
|
2251
|
+
let a = dr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
2228
2252
|
let n = t.findIndex((t, n) => !o.has(n) && e(t));
|
|
2229
2253
|
return n >= 0 && o.add(n), n;
|
|
2230
2254
|
}, c = a.map((e) => s((t) => t === e.markup));
|
|
2231
2255
|
return a.forEach((e, t) => {
|
|
2232
|
-
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) =>
|
|
2233
|
-
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null :
|
|
2256
|
+
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => W(t) === e.term));
|
|
2257
|
+
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : fr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
|
|
2234
2258
|
}
|
|
2235
|
-
function
|
|
2259
|
+
function gr(e, t, n = []) {
|
|
2236
2260
|
let r = /* @__PURE__ */ new Map();
|
|
2237
|
-
if (t ===
|
|
2261
|
+
if (t === w(e) || !e.settings.locales?.includes(t)) return r;
|
|
2238
2262
|
let i = (e, n, i, a) => {
|
|
2239
2263
|
let o = n.l10n?.[t];
|
|
2240
2264
|
for (let t of i) {
|
|
2241
|
-
let i =
|
|
2265
|
+
let i = y(n, t);
|
|
2242
2266
|
typeof i != "string" || i === "" || Object.keys(o?.set ?? {}).some((e) => e === t || t.startsWith(`${e}.`)) || r.set(`${e.kind === "block" ? e.blockId : "settings"}/${t}`, {
|
|
2243
2267
|
target: e,
|
|
2244
2268
|
path: t,
|
|
2245
2269
|
source: i,
|
|
2246
|
-
format: a &&
|
|
2270
|
+
format: a && ir[a]?.includes(t) ? "html" : "text",
|
|
2247
2271
|
text: o?.text?.[t]
|
|
2248
2272
|
});
|
|
2249
2273
|
}
|
|
@@ -2256,13 +2280,13 @@ function fr(e, t, n = []) {
|
|
|
2256
2280
|
else r.type === "wrapper" && a(r.children);
|
|
2257
2281
|
}
|
|
2258
2282
|
};
|
|
2259
|
-
return a(e.blocks), i({ kind: "settings" }, e.settings,
|
|
2283
|
+
return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
|
|
2260
2284
|
}
|
|
2261
|
-
function
|
|
2262
|
-
let r = n.only === "all" ? null :
|
|
2263
|
-
for (let [r, s] of
|
|
2285
|
+
function _r(e, t, n) {
|
|
2286
|
+
let r = n.only === "all" ? null : Pe(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
|
|
2287
|
+
for (let [r, s] of gr(e, t, n.definitions)) {
|
|
2264
2288
|
if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
|
|
2265
|
-
let e =
|
|
2289
|
+
let e = pr(s.source, n.syntax, s.format, n), t = s.text ? hr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
|
|
2266
2290
|
a.push({
|
|
2267
2291
|
id: r,
|
|
2268
2292
|
format: s.format,
|
|
@@ -2276,8 +2300,8 @@ function pr(e, t, n) {
|
|
|
2276
2300
|
tokens: o
|
|
2277
2301
|
};
|
|
2278
2302
|
}
|
|
2279
|
-
function
|
|
2280
|
-
let i =
|
|
2303
|
+
function vr(e, t, n, r) {
|
|
2304
|
+
let i = gr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
|
|
2281
2305
|
for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
|
|
2282
2306
|
else t.type === "wrapper" && o(t.children);
|
|
2283
2307
|
};
|
|
@@ -2289,12 +2313,12 @@ function mr(e, t, n, r) {
|
|
|
2289
2313
|
let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
|
|
2290
2314
|
l.push({
|
|
2291
2315
|
id: t.id,
|
|
2292
|
-
reason: n < 0 || !i.some((e) => e &&
|
|
2316
|
+
reason: n < 0 || !i.some((e) => e && y(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
|
|
2293
2317
|
});
|
|
2294
2318
|
continue;
|
|
2295
2319
|
}
|
|
2296
|
-
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ?
|
|
2297
|
-
if (!o || u === null ||
|
|
2320
|
+
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? mr(t.text, o) : null;
|
|
2321
|
+
if (!o || u === null || hr(u, o, r.syntax, n.format, r) === null) {
|
|
2298
2322
|
l.push({
|
|
2299
2323
|
id: t.id,
|
|
2300
2324
|
reason: "tags_changed"
|
|
@@ -2324,26 +2348,29 @@ function mr(e, t, n, r) {
|
|
|
2324
2348
|
};
|
|
2325
2349
|
}
|
|
2326
2350
|
// ../types/src/custom-block-liquid.ts
|
|
2327
|
-
|
|
2351
|
+
var yr = 1e7, br = 2e3;
|
|
2352
|
+
function xr(e) {
|
|
2328
2353
|
return new e.Liquid({
|
|
2329
2354
|
strictVariables: !1,
|
|
2330
2355
|
strictFilters: !1,
|
|
2331
2356
|
outputEscape: "escape",
|
|
2357
|
+
memoryLimit: yr,
|
|
2358
|
+
renderLimit: br,
|
|
2332
2359
|
templates: {}
|
|
2333
2360
|
});
|
|
2334
2361
|
}
|
|
2335
2362
|
// ../types/src/factory.ts
|
|
2336
|
-
function
|
|
2337
|
-
let n =
|
|
2338
|
-
return !t || Object.keys(t).length === 0 ? n :
|
|
2363
|
+
function Y(e, t) {
|
|
2364
|
+
let n = m(e);
|
|
2365
|
+
return !t || Object.keys(t).length === 0 ? n : yn(n, t);
|
|
2339
2366
|
}
|
|
2340
|
-
function
|
|
2341
|
-
return e === void 0 ? void 0 :
|
|
2367
|
+
function X(e) {
|
|
2368
|
+
return e === void 0 ? void 0 : m(e);
|
|
2342
2369
|
}
|
|
2343
|
-
function
|
|
2370
|
+
function Z() {
|
|
2344
2371
|
return crypto.randomUUID();
|
|
2345
2372
|
}
|
|
2346
|
-
function
|
|
2373
|
+
function Sr(e = 0) {
|
|
2347
2374
|
return {
|
|
2348
2375
|
top: e,
|
|
2349
2376
|
right: e,
|
|
@@ -2351,135 +2378,135 @@ function gr(e = 0) {
|
|
|
2351
2378
|
left: e
|
|
2352
2379
|
};
|
|
2353
2380
|
}
|
|
2354
|
-
function
|
|
2355
|
-
return { padding:
|
|
2381
|
+
function Q(e = 10) {
|
|
2382
|
+
return { padding: Sr(e) };
|
|
2356
2383
|
}
|
|
2357
|
-
function
|
|
2358
|
-
return
|
|
2359
|
-
id:
|
|
2384
|
+
function Cr(e = {}) {
|
|
2385
|
+
return Y({
|
|
2386
|
+
id: Z(),
|
|
2360
2387
|
type: "title",
|
|
2361
|
-
|
|
2362
|
-
styles:
|
|
2388
|
+
...nn,
|
|
2389
|
+
styles: Q()
|
|
2363
2390
|
}, e);
|
|
2364
2391
|
}
|
|
2365
|
-
function
|
|
2366
|
-
return
|
|
2367
|
-
id:
|
|
2392
|
+
function wr(e = {}) {
|
|
2393
|
+
return Y({
|
|
2394
|
+
id: Z(),
|
|
2368
2395
|
type: "paragraph",
|
|
2369
|
-
...
|
|
2370
|
-
styles:
|
|
2396
|
+
...rn,
|
|
2397
|
+
styles: Q()
|
|
2371
2398
|
}, e);
|
|
2372
2399
|
}
|
|
2373
|
-
function
|
|
2374
|
-
return
|
|
2375
|
-
id:
|
|
2400
|
+
function Tr(e = {}) {
|
|
2401
|
+
return Y({
|
|
2402
|
+
id: Z(),
|
|
2376
2403
|
type: "image",
|
|
2377
|
-
...
|
|
2378
|
-
styles:
|
|
2404
|
+
...an,
|
|
2405
|
+
styles: Q()
|
|
2379
2406
|
}, e);
|
|
2380
2407
|
}
|
|
2381
|
-
function
|
|
2382
|
-
return
|
|
2383
|
-
id:
|
|
2408
|
+
function Er(e = {}) {
|
|
2409
|
+
return Y({
|
|
2410
|
+
id: Z(),
|
|
2384
2411
|
type: "button",
|
|
2385
|
-
...
|
|
2386
|
-
styles:
|
|
2412
|
+
...on,
|
|
2413
|
+
styles: Q()
|
|
2387
2414
|
}, e);
|
|
2388
2415
|
}
|
|
2389
|
-
function
|
|
2390
|
-
return
|
|
2391
|
-
id:
|
|
2416
|
+
function Dr(e = {}) {
|
|
2417
|
+
return Y({
|
|
2418
|
+
id: Z(),
|
|
2392
2419
|
type: "divider",
|
|
2393
|
-
...
|
|
2394
|
-
styles:
|
|
2420
|
+
...sn,
|
|
2421
|
+
styles: Q(20)
|
|
2395
2422
|
}, e);
|
|
2396
2423
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return
|
|
2399
|
-
id:
|
|
2424
|
+
function Or(e = {}) {
|
|
2425
|
+
return Y({
|
|
2426
|
+
id: Z(),
|
|
2400
2427
|
type: "section",
|
|
2401
|
-
...
|
|
2428
|
+
...cn,
|
|
2402
2429
|
children: [[]],
|
|
2403
|
-
styles:
|
|
2430
|
+
styles: Q(20)
|
|
2404
2431
|
}, e);
|
|
2405
2432
|
}
|
|
2406
|
-
function
|
|
2407
|
-
return
|
|
2408
|
-
id:
|
|
2433
|
+
function kr(e = {}) {
|
|
2434
|
+
return Y({
|
|
2435
|
+
id: Z(),
|
|
2409
2436
|
type: "video",
|
|
2410
|
-
...
|
|
2411
|
-
styles:
|
|
2437
|
+
...ln,
|
|
2438
|
+
styles: Q()
|
|
2412
2439
|
}, e);
|
|
2413
2440
|
}
|
|
2414
|
-
function
|
|
2415
|
-
return
|
|
2416
|
-
id:
|
|
2441
|
+
function Ar(e = {}) {
|
|
2442
|
+
return Y({
|
|
2443
|
+
id: Z(),
|
|
2417
2444
|
type: "social",
|
|
2418
2445
|
icons: [],
|
|
2419
|
-
...
|
|
2420
|
-
styles:
|
|
2446
|
+
...un,
|
|
2447
|
+
styles: Q()
|
|
2421
2448
|
}, e);
|
|
2422
2449
|
}
|
|
2423
|
-
function
|
|
2424
|
-
return
|
|
2425
|
-
id:
|
|
2450
|
+
function jr(e = {}) {
|
|
2451
|
+
return Y({
|
|
2452
|
+
id: Z(),
|
|
2426
2453
|
type: "spacer",
|
|
2427
|
-
...
|
|
2428
|
-
styles:
|
|
2454
|
+
...dn,
|
|
2455
|
+
styles: Q(0)
|
|
2429
2456
|
}, e);
|
|
2430
2457
|
}
|
|
2431
|
-
function
|
|
2432
|
-
return
|
|
2433
|
-
id:
|
|
2458
|
+
function Mr(e = {}) {
|
|
2459
|
+
return Y({
|
|
2460
|
+
id: Z(),
|
|
2434
2461
|
type: "html",
|
|
2435
|
-
...
|
|
2436
|
-
styles:
|
|
2462
|
+
...fn,
|
|
2463
|
+
styles: Q()
|
|
2437
2464
|
}, e);
|
|
2438
2465
|
}
|
|
2439
|
-
function
|
|
2440
|
-
return
|
|
2441
|
-
id:
|
|
2466
|
+
function Nr(e = {}) {
|
|
2467
|
+
return Y({
|
|
2468
|
+
id: Z(),
|
|
2442
2469
|
type: "menu",
|
|
2443
2470
|
items: [],
|
|
2444
|
-
...
|
|
2445
|
-
styles:
|
|
2471
|
+
...pn,
|
|
2472
|
+
styles: Q()
|
|
2446
2473
|
}, e);
|
|
2447
2474
|
}
|
|
2448
|
-
function
|
|
2475
|
+
function Pr(e, t) {
|
|
2449
2476
|
return Array.from({ length: t }, () => ({
|
|
2450
|
-
id:
|
|
2477
|
+
id: Z(),
|
|
2451
2478
|
cells: Array.from({ length: e }, () => ({
|
|
2452
|
-
id:
|
|
2479
|
+
id: Z(),
|
|
2453
2480
|
content: ""
|
|
2454
2481
|
}))
|
|
2455
2482
|
}));
|
|
2456
2483
|
}
|
|
2457
|
-
function
|
|
2458
|
-
return
|
|
2459
|
-
id:
|
|
2484
|
+
function Fr(e = {}) {
|
|
2485
|
+
return Y({
|
|
2486
|
+
id: Z(),
|
|
2460
2487
|
type: "table",
|
|
2461
|
-
rows:
|
|
2462
|
-
...
|
|
2463
|
-
styles:
|
|
2488
|
+
rows: Pr(3, 3),
|
|
2489
|
+
...mn,
|
|
2490
|
+
styles: Q()
|
|
2464
2491
|
}, e);
|
|
2465
2492
|
}
|
|
2466
|
-
function
|
|
2467
|
-
return
|
|
2468
|
-
id:
|
|
2493
|
+
function Ir(e = {}) {
|
|
2494
|
+
return Y({
|
|
2495
|
+
id: Z(),
|
|
2469
2496
|
type: "countdown",
|
|
2470
|
-
...
|
|
2471
|
-
styles:
|
|
2497
|
+
...hn,
|
|
2498
|
+
styles: Q()
|
|
2472
2499
|
}, e);
|
|
2473
2500
|
}
|
|
2474
|
-
function
|
|
2501
|
+
function Lr(e) {
|
|
2475
2502
|
return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
|
|
2476
2503
|
}
|
|
2477
|
-
function
|
|
2504
|
+
function Rr(e) {
|
|
2478
2505
|
let t = {};
|
|
2479
|
-
for (let n of e.fields) t[n.key] =
|
|
2480
|
-
let n =
|
|
2506
|
+
for (let n of e.fields) t[n.key] = X(Lr(n));
|
|
2507
|
+
let n = Y(Q(), X(e.defaultStyles));
|
|
2481
2508
|
return {
|
|
2482
|
-
id:
|
|
2509
|
+
id: Z(),
|
|
2483
2510
|
type: "custom",
|
|
2484
2511
|
customType: e.type,
|
|
2485
2512
|
fieldValues: t,
|
|
@@ -2487,42 +2514,42 @@ function Mr(e) {
|
|
|
2487
2514
|
...e.dataSource ? { dataSourceFetched: !1 } : {}
|
|
2488
2515
|
};
|
|
2489
2516
|
}
|
|
2490
|
-
function
|
|
2517
|
+
function zr() {
|
|
2491
2518
|
return {
|
|
2492
|
-
id:
|
|
2519
|
+
id: Z(),
|
|
2493
2520
|
type: "slot",
|
|
2494
|
-
styles:
|
|
2521
|
+
styles: Q(0)
|
|
2495
2522
|
};
|
|
2496
2523
|
}
|
|
2497
|
-
function
|
|
2498
|
-
return
|
|
2499
|
-
id:
|
|
2524
|
+
function Br(e = {}) {
|
|
2525
|
+
return Y({
|
|
2526
|
+
id: Z(),
|
|
2500
2527
|
type: "wrapper",
|
|
2501
2528
|
children: [],
|
|
2502
|
-
styles:
|
|
2529
|
+
styles: Q(0)
|
|
2503
2530
|
}, e);
|
|
2504
2531
|
}
|
|
2505
|
-
function
|
|
2532
|
+
function Vr(e, t) {
|
|
2506
2533
|
switch (e) {
|
|
2507
|
-
case "section": return
|
|
2508
|
-
case "title": return
|
|
2509
|
-
case "paragraph": return
|
|
2510
|
-
case "image": return
|
|
2511
|
-
case "button": return
|
|
2512
|
-
case "divider": return
|
|
2513
|
-
case "video": return
|
|
2514
|
-
case "social": return
|
|
2515
|
-
case "spacer": return
|
|
2516
|
-
case "html": return
|
|
2517
|
-
case "menu": return
|
|
2518
|
-
case "table": return
|
|
2519
|
-
case "countdown": return
|
|
2534
|
+
case "section": return Or(X(t?.section));
|
|
2535
|
+
case "title": return Cr(X(t?.title));
|
|
2536
|
+
case "paragraph": return wr(X(t?.paragraph));
|
|
2537
|
+
case "image": return Tr(X(t?.image));
|
|
2538
|
+
case "button": return Er(X(t?.button));
|
|
2539
|
+
case "divider": return Dr(X(t?.divider));
|
|
2540
|
+
case "video": return kr(X(t?.video));
|
|
2541
|
+
case "social": return Ar(X(t?.social));
|
|
2542
|
+
case "spacer": return jr(X(t?.spacer));
|
|
2543
|
+
case "html": return Mr(X(t?.html));
|
|
2544
|
+
case "menu": return Nr(X(t?.menu));
|
|
2545
|
+
case "table": return Fr(X(t?.table));
|
|
2546
|
+
case "countdown": return Ir(X(t?.countdown));
|
|
2520
2547
|
case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
|
|
2521
2548
|
case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
|
|
2522
2549
|
default: throw Error(`Unknown block type: ${e}`);
|
|
2523
2550
|
}
|
|
2524
2551
|
}
|
|
2525
|
-
function
|
|
2552
|
+
function Hr(e, t) {
|
|
2526
2553
|
let n = e.l10n;
|
|
2527
2554
|
if (!n || t.size === 0) return;
|
|
2528
2555
|
let r = (n) => {
|
|
@@ -2537,101 +2564,106 @@ function Ir(e, t) {
|
|
|
2537
2564
|
n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
|
|
2538
2565
|
}
|
|
2539
2566
|
}
|
|
2540
|
-
function
|
|
2541
|
-
let t = JSON.parse(JSON.stringify(e))
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2567
|
+
function Ur(e) {
|
|
2568
|
+
let t = JSON.parse(JSON.stringify(e)), n = (e) => {
|
|
2569
|
+
e.id = Z();
|
|
2570
|
+
let t = /* @__PURE__ */ new Map(), r = (e, n) => {
|
|
2571
|
+
let r = e.id;
|
|
2572
|
+
e.id = Z();
|
|
2573
|
+
let i = t.get(n);
|
|
2574
|
+
return i || (i = /* @__PURE__ */ new Map(), t.set(n, i)), i.set(r, e.id), r;
|
|
2575
|
+
};
|
|
2576
|
+
if (e.type === "table") for (let t of e.rows) {
|
|
2577
|
+
let e = r(t, "rows");
|
|
2578
|
+
for (let n of t.cells) r(n, `rows.${e}.cells`);
|
|
2579
|
+
}
|
|
2580
|
+
if (e.type === "menu") for (let t of e.items) r(t, "items");
|
|
2581
|
+
if (e.type === "social") for (let t of e.icons) r(t, "icons");
|
|
2582
|
+
if (e.type === "section") for (let t of e.children) for (let e of t) n(e);
|
|
2583
|
+
if (e.type === "wrapper") for (let t of e.children) n(t);
|
|
2584
|
+
Hr(e, t);
|
|
2548
2585
|
};
|
|
2549
|
-
|
|
2550
|
-
let t = r(e, "rows");
|
|
2551
|
-
for (let n of e.cells) r(n, `rows.${t}.cells`);
|
|
2552
|
-
}
|
|
2553
|
-
if (t.type === "menu") for (let e of t.items) r(e, "items");
|
|
2554
|
-
if (t.type === "social") for (let e of t.icons) r(e, "icons");
|
|
2555
|
-
return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Ir(t, n), t;
|
|
2586
|
+
return n(t), t;
|
|
2556
2587
|
}
|
|
2557
2588
|
// ../types/src/layout.ts
|
|
2558
|
-
var
|
|
2559
|
-
function $(e, t, n = null, r = !1) {
|
|
2560
|
-
for (let
|
|
2561
|
-
else
|
|
2589
|
+
var Wr = "[Templatical] layout: must contain exactly one slot block", Gr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Kr = "[Templatical] layout: a wrapper cannot contain a wrapper", qr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Jr = "[Templatical] slot is not a valid content block", Yr = "[Templatical] layout: a wrapper cannot contain a section with its own wrapper (section.wrapper)", Xr = "[Templatical] wrapper is not a valid content block";
|
|
2590
|
+
function $(e, t, n = null, r = !1, i = !1) {
|
|
2591
|
+
for (let a of e) if (t(a, n, r, i), Ht(a)) for (let e of a.children) $(e, t, a, !0, i);
|
|
2592
|
+
else H(a) && $(a.children, t, a, r, !0);
|
|
2562
2593
|
}
|
|
2563
|
-
function
|
|
2594
|
+
function Zr(e) {
|
|
2564
2595
|
let t = 0;
|
|
2565
|
-
if ($(e.blocks, (e, n, r) => {
|
|
2566
|
-
if (
|
|
2567
|
-
if (
|
|
2568
|
-
|
|
2569
|
-
if (
|
|
2596
|
+
if ($(e.blocks, (e, n, r, i) => {
|
|
2597
|
+
if (i && Ht(e) && e.wrapper) throw Error(Yr);
|
|
2598
|
+
if (V(e) && (t += 1, r)) throw Error(Gr);
|
|
2599
|
+
if (H(e)) {
|
|
2600
|
+
if (r) throw Error(Gr);
|
|
2601
|
+
if (e.children.some(H)) throw Error(Kr);
|
|
2570
2602
|
}
|
|
2571
|
-
}), t !== 1) throw Error(
|
|
2603
|
+
}), t !== 1) throw Error(Wr);
|
|
2572
2604
|
}
|
|
2573
|
-
function
|
|
2605
|
+
function Qr(e) {
|
|
2574
2606
|
$(e.blocks, (e) => {
|
|
2575
|
-
if (
|
|
2607
|
+
if (V(e)) throw Error(Jr);
|
|
2576
2608
|
});
|
|
2577
2609
|
}
|
|
2578
|
-
function
|
|
2610
|
+
function $r(e) {
|
|
2579
2611
|
$(e.blocks, (e) => {
|
|
2580
|
-
if (
|
|
2612
|
+
if (H(e)) throw Error(Xr);
|
|
2581
2613
|
});
|
|
2582
2614
|
}
|
|
2583
|
-
function
|
|
2615
|
+
function ei(e) {
|
|
2584
2616
|
let t = !1;
|
|
2585
2617
|
return $(e.blocks, (e, n) => {
|
|
2586
|
-
|
|
2618
|
+
V(e) && n !== null && H(n) && (t = !0);
|
|
2587
2619
|
}), t;
|
|
2588
2620
|
}
|
|
2589
|
-
function
|
|
2590
|
-
if (
|
|
2591
|
-
if (
|
|
2592
|
-
let t =
|
|
2621
|
+
function ti(e) {
|
|
2622
|
+
if (V(e)) return e;
|
|
2623
|
+
if (H(e)) {
|
|
2624
|
+
let t = Ur({
|
|
2593
2625
|
...e,
|
|
2594
2626
|
children: []
|
|
2595
2627
|
});
|
|
2596
|
-
return t.children = e.children.map(
|
|
2628
|
+
return t.children = e.children.map(ti), t;
|
|
2597
2629
|
}
|
|
2598
|
-
return
|
|
2630
|
+
return Ur(e);
|
|
2599
2631
|
}
|
|
2600
|
-
function
|
|
2632
|
+
function ni(e) {
|
|
2601
2633
|
for (let t = 0; t < e.length; t++) {
|
|
2602
2634
|
let n = e[t];
|
|
2603
|
-
if (
|
|
2635
|
+
if (V(n)) return {
|
|
2604
2636
|
parent: e,
|
|
2605
2637
|
index: t
|
|
2606
2638
|
};
|
|
2607
|
-
if (
|
|
2608
|
-
let e =
|
|
2639
|
+
if (H(n)) {
|
|
2640
|
+
let e = ni(n.children);
|
|
2609
2641
|
if (e) return e;
|
|
2610
2642
|
}
|
|
2611
2643
|
}
|
|
2612
2644
|
return null;
|
|
2613
2645
|
}
|
|
2614
|
-
function
|
|
2615
|
-
for (let t of e) if (
|
|
2646
|
+
function ri(e) {
|
|
2647
|
+
for (let t of e) if (Ht(t)) {
|
|
2616
2648
|
if (t.wrapper) return !0;
|
|
2617
|
-
for (let e of t.children) if (
|
|
2649
|
+
for (let e of t.children) if (ri(e)) return !0;
|
|
2618
2650
|
}
|
|
2619
2651
|
return !1;
|
|
2620
2652
|
}
|
|
2621
|
-
function
|
|
2622
|
-
if (
|
|
2623
|
-
let n = e.blocks.map(
|
|
2624
|
-
if (!r) throw Error(
|
|
2625
|
-
return r.parent.splice(r.index, 1, ...
|
|
2653
|
+
function ii(e, t) {
|
|
2654
|
+
if (Zr(e), Qr(t), $r(t), ei(e) && ri(t.blocks)) throw Error(qr);
|
|
2655
|
+
let n = e.blocks.map(ti), r = ni(n);
|
|
2656
|
+
if (!r) throw Error(Wr);
|
|
2657
|
+
return r.parent.splice(r.index, 1, ...m(t.blocks)), {
|
|
2626
2658
|
blocks: n,
|
|
2627
2659
|
settings: {
|
|
2628
|
-
...
|
|
2660
|
+
...m(t.settings),
|
|
2629
2661
|
backgroundColor: e.settings.backgroundColor
|
|
2630
2662
|
}
|
|
2631
2663
|
};
|
|
2632
2664
|
}
|
|
2633
2665
|
// ../types/src/url-policy.ts
|
|
2634
|
-
var
|
|
2666
|
+
var ai = Object.freeze([
|
|
2635
2667
|
"http",
|
|
2636
2668
|
"https",
|
|
2637
2669
|
"mailto",
|
|
@@ -2641,44 +2673,44 @@ var Zr = Object.freeze([
|
|
|
2641
2673
|
"sms",
|
|
2642
2674
|
"xmpp",
|
|
2643
2675
|
"cid"
|
|
2644
|
-
]),
|
|
2676
|
+
]), oi = Object.freeze([
|
|
2645
2677
|
"javascript",
|
|
2646
2678
|
"data",
|
|
2647
2679
|
"vbscript"
|
|
2648
2680
|
]);
|
|
2649
|
-
function
|
|
2681
|
+
function si(e) {
|
|
2650
2682
|
return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2651
2683
|
}
|
|
2652
|
-
function
|
|
2653
|
-
let t = /^([a-z][a-z0-9+.-]*):/i.exec(
|
|
2684
|
+
function ci(e) {
|
|
2685
|
+
let t = /^([a-z][a-z0-9+.-]*):/i.exec(si(e));
|
|
2654
2686
|
return t ? t[1].toLowerCase() : null;
|
|
2655
2687
|
}
|
|
2656
|
-
var
|
|
2688
|
+
var li = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ui = Object.freeze([
|
|
2657
2689
|
"href",
|
|
2658
2690
|
"xlink:href",
|
|
2659
2691
|
"background",
|
|
2660
2692
|
"poster",
|
|
2661
2693
|
"src"
|
|
2662
|
-
]),
|
|
2694
|
+
]), di = Object.freeze([
|
|
2663
2695
|
"srcdoc",
|
|
2664
2696
|
"ping",
|
|
2665
2697
|
"formaction",
|
|
2666
2698
|
"action"
|
|
2667
2699
|
]);
|
|
2668
|
-
function
|
|
2669
|
-
let n =
|
|
2670
|
-
return r === null ||
|
|
2700
|
+
function fi(e, t) {
|
|
2701
|
+
let n = si(e), r = ci(n);
|
|
2702
|
+
return r === null || ai.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && li.test(n);
|
|
2671
2703
|
}
|
|
2672
2704
|
// ../types/src/rich-text.ts
|
|
2673
|
-
var
|
|
2674
|
-
function
|
|
2675
|
-
return e.replace(
|
|
2705
|
+
var pi = /<\/?p\b[^<>]*>/gi, mi = /<p\b([^<>]*)>\s*<\/p>/gi;
|
|
2706
|
+
function hi(e) {
|
|
2707
|
+
return e.replace(pi, "").trim() === "";
|
|
2676
2708
|
}
|
|
2677
|
-
function
|
|
2678
|
-
return
|
|
2709
|
+
function gi(e) {
|
|
2710
|
+
return hi(e) ? e : e.replace(mi, "<p$1> </p>");
|
|
2679
2711
|
}
|
|
2680
2712
|
// ../types/src/fonts.ts
|
|
2681
|
-
var
|
|
2713
|
+
var _i = {
|
|
2682
2714
|
arial: "Arial, sans-serif",
|
|
2683
2715
|
helvetica: "Helvetica, sans-serif",
|
|
2684
2716
|
georgia: "Georgia, serif",
|
|
@@ -2687,13 +2719,13 @@ var li = {
|
|
|
2687
2719
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
2688
2720
|
"courier new": "'Courier New', monospace",
|
|
2689
2721
|
tahoma: "Tahoma, sans-serif"
|
|
2690
|
-
},
|
|
2722
|
+
}, vi = /* @__PURE__ */ new Set([
|
|
2691
2723
|
"inherit",
|
|
2692
2724
|
"initial",
|
|
2693
2725
|
"unset",
|
|
2694
2726
|
"revert",
|
|
2695
2727
|
"revert-layer"
|
|
2696
|
-
]),
|
|
2728
|
+
]), yi = /* @__PURE__ */ new Set([
|
|
2697
2729
|
"serif",
|
|
2698
2730
|
"sans-serif",
|
|
2699
2731
|
"monospace",
|
|
@@ -2708,14 +2740,14 @@ var li = {
|
|
|
2708
2740
|
"math",
|
|
2709
2741
|
"fangsong"
|
|
2710
2742
|
]);
|
|
2711
|
-
function
|
|
2743
|
+
function bi(e) {
|
|
2712
2744
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
2713
2745
|
}
|
|
2714
|
-
function
|
|
2746
|
+
function xi(e) {
|
|
2715
2747
|
if (typeof e != "string") return [];
|
|
2716
2748
|
let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
|
|
2717
2749
|
for (;;) {
|
|
2718
|
-
for (; r < t.length &&
|
|
2750
|
+
for (; r < t.length && bi(t[r]);) r++;
|
|
2719
2751
|
if (r >= t.length) return [];
|
|
2720
2752
|
let e = t[r];
|
|
2721
2753
|
if (e === "\"" || e === "'") {
|
|
@@ -2732,7 +2764,7 @@ function pi(e) {
|
|
|
2732
2764
|
}
|
|
2733
2765
|
}
|
|
2734
2766
|
if (!o) return [];
|
|
2735
|
-
for (; a < t.length &&
|
|
2767
|
+
for (; a < t.length && bi(t[a]);) a++;
|
|
2736
2768
|
if (a < t.length && t[a] !== ",") return [];
|
|
2737
2769
|
n.push({
|
|
2738
2770
|
name: i,
|
|
@@ -2740,7 +2772,7 @@ function pi(e) {
|
|
|
2740
2772
|
}), r = a;
|
|
2741
2773
|
} else {
|
|
2742
2774
|
let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
|
|
2743
|
-
if (a === "" || a.includes("\"") || a.includes("'") ||
|
|
2775
|
+
if (a === "" || a.includes("\"") || a.includes("'") || vi.has(a.toLowerCase())) return [];
|
|
2744
2776
|
n.push({
|
|
2745
2777
|
name: a,
|
|
2746
2778
|
quoted: !1
|
|
@@ -2750,27 +2782,27 @@ function pi(e) {
|
|
|
2750
2782
|
r++;
|
|
2751
2783
|
}
|
|
2752
2784
|
}
|
|
2753
|
-
function
|
|
2785
|
+
function Si(e) {
|
|
2754
2786
|
return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
2755
2787
|
}
|
|
2756
|
-
function
|
|
2757
|
-
return !e.quoted &&
|
|
2788
|
+
function Ci(e) {
|
|
2789
|
+
return !e.quoted && yi.has(e.name.toLowerCase());
|
|
2758
2790
|
}
|
|
2759
|
-
function
|
|
2760
|
-
return
|
|
2791
|
+
function wi(e) {
|
|
2792
|
+
return xi(e)[0]?.name ?? "";
|
|
2761
2793
|
}
|
|
2762
|
-
function
|
|
2763
|
-
let n = (e) => `${
|
|
2794
|
+
function Ti(e, t) {
|
|
2795
|
+
let n = (e) => `${Si(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
|
|
2764
2796
|
if (i) return n(i);
|
|
2765
|
-
let a =
|
|
2797
|
+
let a = xi(e);
|
|
2766
2798
|
if (a.length !== 1) return e;
|
|
2767
2799
|
let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
|
|
2768
|
-
return c ? n(c) :
|
|
2800
|
+
return c ? n(c) : _i[s] || (Ci(o) ? e : `${Si(o.name)}, ${t.defaultFallback}`);
|
|
2769
2801
|
}
|
|
2770
2802
|
// ../types/src/preview-resolution.ts
|
|
2771
|
-
function
|
|
2803
|
+
function Ei(e) {
|
|
2772
2804
|
return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
|
|
2773
2805
|
}
|
|
2774
|
-
export {
|
|
2806
|
+
export { nr as $, Ne as $t, Ar as A, Jt as At, _r as B, g as Bt, Dr as C, n as Cn, Wt as Ct, wr as D, Xt as Dt, Nr as E, t as En, Yt as Et, Br as F, He as Ft, tr as G, Se as Gt, G as H, w as Ht, Z as I, E as It, Hn as J, Fe as Jt, Kn as K, Te as Kt, xr as L, M as Lt, Fr as M, Vt as Mt, Cr as N, zt as Nt, Or as O, $t as Ot, kr as P, T as Pt, Gn as Q, y as Qt, ir as R, Be as Rt, Rr as S, c as Sn, Qt as St, Tr as T, o as Tn, V as Tt, K as U, ve as Ut, mr as V, Ie as Vt, $n as W, v as Wt, Xn as X, b as Xt, Vn as Y, Oe as Yt, er as Z, Ce as Zt, Zr as _, i as _n, en as _t, gi as a, se as an, Zn as at, Er as b, s as bn, Zt as bt, di as c, pe as cn, W as ct, ci as d, ie as dn, Cn as dt, C as en, qn as et, fi as f, f as fn, bn as ft, ei as g, ne as gn, Kt as gt, $r as h, te as hn, yn as ht, Ti as i, m as in, Yn as it, jr as j, H as jt, zr as k, Ut as kt, ui as l, fe as ln, En as lt, Qr as m, ee as mn, _n as mt, wi as n, ge as nn, Rn as nt, hi as o, de as on, jn as ot, ii as p, p as pn, gn as pt, Jn as q, Pe as qt, xi as r, h as rn, q as rt, oi as s, ue as sn, Mn as st, Ei as t, S as tn, Un as tt, ai as u, oe as un, wn as ut, Ur as v, e as vn, tn as vt, Mr as w, r as wn, Ht as wt, Ir as x, u as xn, Gt as xt, Vr as y, l as yn, qt as yt, vr as z, Ve as zt };
|
|
2775
2807
|
|
|
2776
|
-
//# sourceMappingURL=src-
|
|
2808
|
+
//# sourceMappingURL=src-DeywvttP.js.map
|