@templatical/editor 0.59.0 → 0.59.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiAltTextPopover-CwyKz_9U.js → AiAltTextPopover-BhWHOOKX.js} +3 -3
- package/dist/{AiAltTextReview-DNFnR1PN.js → AiAltTextReview-CmW7pLmo.js} +3 -3
- package/dist/{AiChatPanel-DWWVvJIP.js → AiChatPanel-CV0mCtad.js} +2 -2
- package/dist/{AiPanels-CESbBB63.js → AiPanels-C8M7q_vM.js} +1 -1
- package/dist/{AiRewriteMenu-CjXiI-n4.js → AiRewriteMenu-DC2ZLH5L.js} +7 -7
- package/dist/{BlockIssueBadge-3k568_Od.js → BlockIssueBadge-B8sl9BM1.js} +2 -2
- package/dist/{BlockPreviewCanvas-3FzYSsPm.js → BlockPreviewCanvas-yhOQAQhJ.js} +22 -18
- package/dist/{CloudHeaderExtras-xrHubAHL.js → CloudHeaderExtras-DC_oNrxz.js} +1 -1
- package/dist/{CloudPanels-CSFN-eLV.js → CloudPanels-CD0lsL0R.js} +2 -2
- package/dist/{CollaborationNotices-D9GQ477K.js → CollaborationNotices-DrMrP73M.js} +1 -1
- package/dist/{CollaboratorBar-DsRjAaqd.js → CollaboratorBar-TsK872uC.js} +1 -1
- package/dist/{CommentsPanel-lb-IFzjl.js → CommentsPanel-BX8JVrXU.js} +1 -1
- package/dist/{CommentsSidebar-CVVTCWBH.js → CommentsSidebar-BUlseNwL.js} +2 -2
- package/dist/{CountdownBlock-CSEq79Nc.js → CountdownBlock-AYPypmcX.js} +2 -2
- package/dist/{CountdownToolbar-BV9yQi9k.js → CountdownToolbar-dx3FVRjh.js} +5 -5
- package/dist/{IssuesPanel-pxcWAQJM.js → IssuesPanel-BwnvXxBC.js} +5 -5
- package/dist/{LanguageMenu-CEKRbNhA.js → LanguageMenu-Cf5bKocE.js} +5 -5
- package/dist/{LocaleNotices-j4aMFfmc.js → LocaleNotices-CGEp0pQ8.js} +2 -2
- package/dist/{LogicTagInsertButton-BDIsyl3C.js → LogicTagInsertButton-BdDe-vrZ.js} +8 -8
- package/dist/{MergeTagInput-De1yWoc2.js → MergeTagInput-CTTi-eB0.js} +1 -1
- package/dist/{MergeTagModeToggle-CL96pI1E.js → MergeTagModeToggle-Bd0svGQm.js} +3 -3
- package/dist/{MergeTagTextarea-DDyV8U44.js → MergeTagTextarea-DiahMV-3.js} +4 -4
- package/dist/{ParagraphEditor-Vz90-hhN.js → ParagraphEditor-Db1cmj8Y.js} +11 -11
- package/dist/{RestoreVersionDialog-BgrtpVl1.js → RestoreVersionDialog-DA1Z0q9Z.js} +2 -2
- package/dist/{RichTextEditorContent-C2Yj1-ZA.js → RichTextEditorContent-CyO6e4ZG.js} +6 -6
- package/dist/{SaveBlockDialog-DRvLFKWJ.js → SaveBlockDialog-D7SaFxa_.js} +6 -6
- package/dist/{SavedBlocksBrowserModal-Dw0uF-NT.js → SavedBlocksBrowserModal-B5r3LWWG.js} +6 -6
- package/dist/{SavedBlocksPanels-BReNi8sg.js → SavedBlocksPanels-BH2f7jm-.js} +1 -1
- package/dist/{SavedBlocksPickBar-BQX4g7OE.js → SavedBlocksPickBar-B24TScw0.js} +2 -2
- package/dist/{TemplateSettings-CBCaybvd.js → TemplateSettings-CuN9Vkl_.js} +8 -8
- package/dist/{TestEmailModal-BiCUiRFo.js → TestEmailModal-C4DAaohi.js} +12 -9
- package/dist/{TestEmailPanel-Bfr-sGrI.js → TestEmailPanel-DoMcVJSE.js} +1 -1
- package/dist/{TitleEditor-B8thQPgg.js → TitleEditor-b5Pr_m9j.js} +8 -8
- package/dist/{Toolbar-FIYSw3Us.js → Toolbar-BOf7Y862.js} +14 -14
- package/dist/{TplModal-BIqO0owX.js → TplModal-DAcXzBJh.js} +4 -4
- package/dist/{VersionHistoryMenu-6jMve6By.js → VersionHistoryMenu-TbIGteNi.js} +2 -2
- package/dist/{VersionHistoryPanels-C91mfsMA.js → VersionHistoryPanels-Ia6ipOqG.js} +1 -1
- package/dist/{VersionPreviewBanner-Bq8z1SUc.js → VersionPreviewBanner-CRfu6quf.js} +1 -1
- package/dist/{WrapperBlock-BAqgP8hm.js → WrapperBlock-BZenrXM6.js} +4 -4
- package/dist/{blockTypeIcons-VX_8UQ21.js → blockTypeIcons-DdYZy8yG.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiAltTextPopover-Dj-VLU88.js → AiAltTextPopover-CcX_OMUU.js} +4 -4
- package/dist/cdn/chunks/{AiAltTextPopover-Dj-VLU88.js.map → AiAltTextPopover-CcX_OMUU.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-tVkJPOk6.js → AiAltTextReview-Dmm3h0jd.js} +4 -4
- package/dist/cdn/chunks/{AiAltTextReview-tVkJPOk6.js.map → AiAltTextReview-Dmm3h0jd.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-CYPvHQGQ.js → AiChatPanel-DV23DJ-2.js} +3 -3
- package/dist/cdn/chunks/{AiChatPanel-CYPvHQGQ.js.map → AiChatPanel-DV23DJ-2.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-ChTLCmMS.js → AiPanels-CxhOpMAp.js} +2 -2
- package/dist/cdn/chunks/{AiPanels-ChTLCmMS.js.map → AiPanels-CxhOpMAp.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-99qbfCZI.js → AiRewriteMenu-87-O514r.js} +8 -8
- package/dist/cdn/chunks/{AiRewriteMenu-99qbfCZI.js.map → AiRewriteMenu-87-O514r.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-BKO4Mr8f.js → BlockIssueBadge-Dp06vQd3.js} +3 -3
- package/dist/cdn/chunks/{BlockIssueBadge-BKO4Mr8f.js.map → BlockIssueBadge-Dp06vQd3.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-BF0yCTKP.js → BlockPreviewCanvas-DQGzUvZ5.js} +23 -19
- package/dist/cdn/chunks/BlockPreviewCanvas-DQGzUvZ5.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-O_K3jmgO.js → CloudHeaderExtras-Cd-ePldd.js} +2 -2
- package/dist/cdn/chunks/{CloudHeaderExtras-O_K3jmgO.js.map → CloudHeaderExtras-Cd-ePldd.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-gV2WFHQk.js → CloudPanels-D8fchoYt.js} +3 -3
- package/dist/cdn/chunks/{CloudPanels-gV2WFHQk.js.map → CloudPanels-D8fchoYt.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-CwAoa-73.js → CollaborationNotices-DNEs3g9B.js} +2 -2
- package/dist/cdn/chunks/{CollaborationNotices-CwAoa-73.js.map → CollaborationNotices-DNEs3g9B.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-DdQQwtwd.js → CollaboratorBar-CN6XAlbn.js} +2 -2
- package/dist/cdn/chunks/{CollaboratorBar-DdQQwtwd.js.map → CollaboratorBar-CN6XAlbn.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-C8AKtxiG.js → CommentsPanel-CxZ1kFcK.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-C8AKtxiG.js.map → CommentsPanel-CxZ1kFcK.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-FxY0RHSq.js → CommentsSidebar-DCr2mV8b.js} +3 -3
- package/dist/cdn/chunks/{CommentsSidebar-FxY0RHSq.js.map → CommentsSidebar-DCr2mV8b.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-DGgnPUlu.js → CountdownBlock--hlKE2aj.js} +3 -3
- package/dist/cdn/chunks/{CountdownBlock-DGgnPUlu.js.map → CountdownBlock--hlKE2aj.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-9PtYUgCW.js → CountdownToolbar-CUTbVPPV.js} +6 -6
- package/dist/cdn/chunks/{CountdownToolbar-9PtYUgCW.js.map → CountdownToolbar-CUTbVPPV.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Co-ffgWa.js → IssuesPanel-BhcSzwuL.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-Co-ffgWa.js.map → IssuesPanel-BhcSzwuL.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-fL4DRGGQ.js → LanguageMenu-6wGhkyFT.js} +99 -99
- package/dist/cdn/chunks/{LanguageMenu-fL4DRGGQ.js.map → LanguageMenu-6wGhkyFT.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-BVDJ7kyj.js → LocaleNotices-Br92Xueo.js} +3 -3
- package/dist/cdn/chunks/{LocaleNotices-BVDJ7kyj.js.map → LocaleNotices-Br92Xueo.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-DPYA8LJW.js → LogicTagInsertButton-r2EVUtDU.js} +9 -9
- package/dist/cdn/chunks/{LogicTagInsertButton-DPYA8LJW.js.map → LogicTagInsertButton-r2EVUtDU.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-Cxfjq3tx.js → MergeTagInput-Dh3N6CEV.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-Cxfjq3tx.js.map → MergeTagInput-Dh3N6CEV.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BmNGV3yc.js → MergeTagModeToggle-D6u3hMrI.js} +4 -4
- package/dist/cdn/chunks/{MergeTagModeToggle-BmNGV3yc.js.map → MergeTagModeToggle-D6u3hMrI.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-DmwrPAss.js → MergeTagTextarea-BpVtpiNL.js} +8 -8
- package/dist/cdn/chunks/{MergeTagTextarea-DmwrPAss.js.map → MergeTagTextarea-BpVtpiNL.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-A_OEuQ1Q.js → ParagraphEditor-DGJmPAC1.js} +12 -12
- package/dist/cdn/chunks/{ParagraphEditor-A_OEuQ1Q.js.map → ParagraphEditor-DGJmPAC1.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-Ca_lUsk4.js → RestoreVersionDialog-D5qeCa0F.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-Ca_lUsk4.js.map → RestoreVersionDialog-D5qeCa0F.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-Dq4TROOg.js → RichTextEditorContent-DyGiXKKI.js} +7 -7
- package/dist/cdn/chunks/{RichTextEditorContent-Dq4TROOg.js.map → RichTextEditorContent-DyGiXKKI.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-BXRCqrZX.js → SaveBlockDialog-B0TJYxd8.js} +7 -7
- package/dist/cdn/chunks/{SaveBlockDialog-BXRCqrZX.js.map → SaveBlockDialog-B0TJYxd8.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-DdaBcSOI.js → SavedBlocksBrowserModal-D8Ly7LrA.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-DdaBcSOI.js.map → SavedBlocksBrowserModal-D8Ly7LrA.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-BcVFZDKI.js → SavedBlocksPanels-Co1cbWR8.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-BcVFZDKI.js.map → SavedBlocksPanels-Co1cbWR8.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-o66PhlTo.js → SavedBlocksPickBar-DNtVbpm-.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-o66PhlTo.js.map → SavedBlocksPickBar-DNtVbpm-.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-uoiUkd2l.js → TemplateSettings-BRc878ZF.js} +9 -9
- package/dist/cdn/chunks/{TemplateSettings-uoiUkd2l.js.map → TemplateSettings-BRc878ZF.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-WOC7bmF_.js → TestEmailModal-CIui7VfS.js} +13 -10
- package/dist/cdn/chunks/TestEmailModal-CIui7VfS.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailPanel-DUWH9xsZ.js → TestEmailPanel-vKvruW_r.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-DUWH9xsZ.js.map → TestEmailPanel-vKvruW_r.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-EHW0lgG4.js → TitleEditor-BI-9Nnj3.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-EHW0lgG4.js.map → TitleEditor-BI-9Nnj3.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-BzAuH2G4.js → Toolbar-CYnnArxv.js} +418 -418
- package/dist/cdn/chunks/{Toolbar-BzAuH2G4.js.map → Toolbar-CYnnArxv.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-B9DVglkN.js → TplModal-B3nZeGWK.js} +5 -5
- package/dist/cdn/chunks/{TplModal-B9DVglkN.js.map → TplModal-B3nZeGWK.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-DDqYMqC2.js → VersionHistoryMenu-CMGfAKuV.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryMenu-DDqYMqC2.js.map → VersionHistoryMenu-CMGfAKuV.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-DO-kcL28.js → VersionHistoryPanels-Bb2ouQg7.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-DO-kcL28.js.map → VersionHistoryPanels-Bb2ouQg7.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-CYT5QUoc.js → VersionPreviewBanner-573UP-g4.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-CYT5QUoc.js.map → VersionPreviewBanner-573UP-g4.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-CyD_pW18.js → WrapperBlock-DVu632LD.js} +5 -5
- package/dist/cdn/chunks/{WrapperBlock-CyD_pW18.js.map → WrapperBlock-DVu632LD.js.map} +1 -1
- package/dist/cdn/chunks/{composables-CN9j_FH4.js → composables-DY3anqHO.js} +574 -571
- package/dist/cdn/chunks/composables-DY3anqHO.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D8zeR9D2.js → createCloudRuntime-B5numxlW.js} +4 -4
- package/dist/cdn/chunks/{createCloudRuntime-D8zeR9D2.js.map → createCloudRuntime-B5numxlW.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-BYJPv1sA.js → extensions-BWVlr8Ga.js} +5 -5
- package/dist/cdn/chunks/{extensions-BYJPv1sA.js.map → extensions-BWVlr8Ga.js.map} +1 -1
- package/dist/cdn/chunks/keys-ywH4jHJ2.js +11 -0
- package/dist/cdn/chunks/keys-ywH4jHJ2.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-nDyYIXvL.js → normalizeMergeTagMarkup-Dw3rFvyd.js} +40 -40
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-nDyYIXvL.js.map → normalizeMergeTagMarkup-Dw3rFvyd.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-CxwYcAQe.js → preRenderCustomBlocks-BGtb8Xbp.js} +4 -4
- package/dist/cdn/chunks/{preRenderCustomBlocks-CxwYcAQe.js.map → preRenderCustomBlocks-BGtb8Xbp.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-5T_KaDcp.js → sanitizeHtml-CLRY8s2s.js} +2 -2
- package/dist/cdn/chunks/{sanitizeHtml-5T_KaDcp.js.map → sanitizeHtml-CLRY8s2s.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-bvQ57o1m.js → socialIcons-kYhdXJ9P.js} +255 -255
- package/dist/cdn/chunks/{socialIcons-bvQ57o1m.js.map → socialIcons-kYhdXJ9P.js.map} +1 -1
- package/dist/cdn/chunks/{src-BXrhjqCv.js → src-B7X7x_ST.js} +154 -154
- package/dist/cdn/chunks/{src-BXrhjqCv.js.map → src-B7X7x_ST.js.map} +1 -1
- package/dist/cdn/chunks/{src-BRyzUujm.js → src-BmzzkUf7.js} +539 -539
- package/dist/cdn/chunks/{src-BRyzUujm.js.map → src-BmzzkUf7.js.map} +1 -1
- package/dist/cdn/chunks/{src-CVHGPKSW.js → src-DY2kMjoD.js} +593 -589
- package/dist/cdn/chunks/src-DY2kMjoD.js.map +1 -0
- package/dist/cdn/chunks/{useCloudI18n-CWgySYuJ.js → useCloudI18n-BTV9uu3c.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-CWgySYuJ.js.map → useCloudI18n-BTV9uu3c.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorRoot-BA4vV7sK.js → useEditorRoot-D0Lp2x4_.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-BA4vV7sK.js.map → useEditorRoot-D0Lp2x4_.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-JsIdvX-i.js → useI18n-DPg6rPbu.js} +2 -2
- package/dist/cdn/chunks/{useI18n-JsIdvX-i.js.map → useI18n-DPg6rPbu.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-B5wMJLru.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-7iwZ1UhB.js.map → useLocalizedDisplay-B5wMJLru.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-C10Wef7d.js → useLogicTag-0wkSxy3z.js} +3 -3
- package/dist/cdn/chunks/{useLogicTag-C10Wef7d.js.map → useLogicTag-0wkSxy3z.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-Dd26TcvH.js → useMergeTag-y3bX8M_6.js} +3 -3
- package/dist/cdn/chunks/{useMergeTag-Dd26TcvH.js.map → useMergeTag-y3bX8M_6.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-DWRQRT2P.js → usePopoverPosition-CBp9uwjV.js} +2 -2
- package/dist/cdn/chunks/{usePopoverPosition-DWRQRT2P.js.map → usePopoverPosition-CBp9uwjV.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-CArjwH-u.js → useScrollToBlock-32EnuMwu.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-CArjwH-u.js.map → useScrollToBlock-32EnuMwu.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-BaeBoPQZ.js → withCurrentFont-B42BKo9N.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-BaeBoPQZ.js.map → withCurrentFont-B42BKo9N.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +600 -600
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{composables-DbqKYIRE.js → composables-CFTH0Nqb.js} +867 -864
- package/dist/{createCloudRuntime-DiUnYjKr.js → createCloudRuntime-BvWlm_38.js} +3 -3
- package/dist/{dist-BTjObRcv.js → dist-CMo4K5So.js} +277 -273
- package/dist/{extensions-CAuXwpbI.js → extensions-BPVackEE.js} +4 -4
- package/dist/index.d.ts +29 -7
- package/dist/keys-B4DimcgX.js +9 -0
- package/dist/{normalizeMergeTagMarkup-fgoVMKAc.js → normalizeMergeTagMarkup-PQqrbfmt.js} +1 -1
- package/dist/{preRenderCustomBlocks-CgPtlLGL.js → preRenderCustomBlocks-Dg5GBNi2.js} +1 -1
- package/dist/{sanitizeHtml-D2wueiEe.js → sanitizeHtml-DVdfdxOz.js} +1 -1
- package/dist/{socialIcons-RKdTgJip.js → socialIcons-DBHv_ntg.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +563 -563
- package/dist/{useCloudI18n-nMZ9f_4b.js → useCloudI18n-BnuOL1YS.js} +1 -1
- package/dist/{useEditorRoot-DpssP9rX.js → useEditorRoot-DWfC2CVC.js} +1 -1
- package/dist/{useI18n-C2p-qHeb.js → useI18n-Cx9W7OWb.js} +1 -1
- package/dist/{useLocalizedDisplay-9RqT2y_Y.js → useLocalizedDisplay-CbFM0cCV.js} +1 -1
- package/dist/{useLogicTag-59fmujI7.js → useLogicTag-CVOj0VUv.js} +2 -2
- package/dist/{useMergeTag-M1vauWet.js → useMergeTag-Bams_kam.js} +2 -2
- package/dist/{usePopoverPosition-L9MOHBM-.js → usePopoverPosition-DF0ZYH7g.js} +1 -1
- package/dist/{useScrollToBlock-BMF0Dt5l.js → useScrollToBlock-CwUQ_nKz.js} +1 -1
- package/dist/{withCurrentFont-BXZ7g-K6.js → withCurrentFont-y0O5kOLW.js} +1 -1
- package/package.json +7 -7
- package/dist/cdn/chunks/BlockPreviewCanvas-BF0yCTKP.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-WOC7bmF_.js.map +0 -1
- package/dist/cdn/chunks/composables-CN9j_FH4.js.map +0 -1
- package/dist/cdn/chunks/keys-DNv3xXxI.js +0 -11
- package/dist/cdn/chunks/keys-DNv3xXxI.js.map +0 -1
- package/dist/cdn/chunks/src-CVHGPKSW.js.map +0 -1
- package/dist/cdn/chunks/useLocalizedDisplay-7iwZ1UhB.js +0 -33
- package/dist/keys-BeQy64On.js +0 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $ as e, C as t, F as n, H as r, M as i, O as a, Q as o, X as s, Y as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, lt as h, mt as g, ot as _, p as v, pt as y, q as b, rt as x, tt as S, u as C, x as w } from "./draggable-IRVFEZ-b.js";
|
|
2
|
-
import { $t as T, Bt as E,
|
|
2
|
+
import { $t as T, Bt as E, Ft as D, Gt as O, H as k, I as A, It as j, Kt as M, Lt as ee, Mt as N, Pt as P, Qt as te, Rt as F, Tt as I, Ut as L, Vt as R, W as z, Wt as ne, Xt as B, Zt as re, an as V, en as H, fn as ie, h as U, in as W, m as G, nn as K, on as ae, p as oe, pt as se, qt as ce, rn as q, tn as le, v as ue, wn as de, y as fe, zt as pe } from "./src-DY2kMjoD.js";
|
|
3
3
|
import { at as me, s as he } from "./icons-C7vjUBLn.js";
|
|
4
|
-
import { B as ge, C as _e, W as ve, u as ye } from "./keys-
|
|
5
|
-
import { t as be } from "./useI18n-
|
|
4
|
+
import { B as ge, C as _e, W as ve, u as ye } from "./keys-ywH4jHJ2.js";
|
|
5
|
+
import { t as be } from "./useI18n-DPg6rPbu.js";
|
|
6
6
|
import { r as xe } from "./dist-zu1jwYIS.js";
|
|
7
|
-
import { i as J, r as Se } from "./usePopoverPosition-
|
|
7
|
+
import { i as J, r as Se } from "./usePopoverPosition-CBp9uwjV.js";
|
|
8
8
|
// ../core/src/localized-edit.ts
|
|
9
9
|
var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => Y(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
|
|
10
10
|
"id",
|
|
@@ -17,17 +17,17 @@ var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Arr
|
|
|
17
17
|
function Te(e, t, n) {
|
|
18
18
|
let r = /* @__PURE__ */ new Set();
|
|
19
19
|
for (let i of n) {
|
|
20
|
-
if (!
|
|
21
|
-
let n = i.split("."), a = n.pop(), o = n.join("."), s =
|
|
20
|
+
if (!O(i)) continue;
|
|
21
|
+
let n = i.split("."), a = n.pop(), o = n.join("."), s = T(e, i), c = t;
|
|
22
22
|
for (let [t, i] of n.entries()) {
|
|
23
23
|
let a = n.slice(0, t + 1).join(".");
|
|
24
|
-
s !== void 0 && Y(c) &&
|
|
24
|
+
s !== void 0 && Y(c) && T(c, i) === void 0 && Y(T(e, a)) && (c[i] = {}, r.add(a)), c = T(c, i);
|
|
25
25
|
}
|
|
26
26
|
if (Array.isArray(c)) {
|
|
27
27
|
let e = c.findIndex((e) => Y(e) && e.id === a);
|
|
28
28
|
if (e < 0) continue;
|
|
29
|
-
s === void 0 ? c.splice(e, 1) : c[e] =
|
|
30
|
-
} else Y(c) && (s === void 0 ? delete c[a] : c[a] =
|
|
29
|
+
s === void 0 ? c.splice(e, 1) : c[e] = V(s);
|
|
30
|
+
} else Y(c) && (s === void 0 ? delete c[a] : c[a] = V(s), o && Object.keys(c).length === 0 && T(e, o) === void 0 && Te(e, t, [o]));
|
|
31
31
|
}
|
|
32
32
|
return r;
|
|
33
33
|
}
|
|
@@ -38,17 +38,17 @@ function Ee(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
|
|
|
38
38
|
let t = e.find((e) => e.id === o.id);
|
|
39
39
|
t && Ee(t, o, `${n}.${o.id}`, r, i, a);
|
|
40
40
|
}
|
|
41
|
-
else
|
|
41
|
+
else W(e, t) || r.set(n, t);
|
|
42
42
|
}
|
|
43
43
|
function De(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
|
|
44
44
|
let a = /* @__PURE__ */ new Map();
|
|
45
45
|
Ee(e, t, "", a, e.type !== "custom", i);
|
|
46
|
-
let o = new Set(e.type === "custom" ?
|
|
47
|
-
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) :
|
|
46
|
+
let o = new Set(e.type === "custom" ? K(e, r) : []), s = {}, c = {};
|
|
47
|
+
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : ce(e.type, t)) && typeof r == "string" && T(e, t) !== void 0) {
|
|
48
48
|
let i = n?.text?.[t];
|
|
49
49
|
s[t] = i && i.value === r ? i : {
|
|
50
50
|
value: r,
|
|
51
|
-
sourceHash:
|
|
51
|
+
sourceHash: le(String(T(e, t) ?? ""))
|
|
52
52
|
};
|
|
53
53
|
} else c[t] = r === void 0 ? null : r;
|
|
54
54
|
let l = {};
|
|
@@ -58,7 +58,7 @@ function Oe(e, t, n) {
|
|
|
58
58
|
let r = !1;
|
|
59
59
|
function i(e, t, n, a) {
|
|
60
60
|
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => Y(e) && typeof e.id == "string");
|
|
61
|
-
if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) =>
|
|
61
|
+
if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => V(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
|
|
62
62
|
let r = e[n].find((e) => e.id === t.id);
|
|
63
63
|
r && i(r, t, a);
|
|
64
64
|
}
|
|
@@ -66,7 +66,7 @@ function Oe(e, t, n) {
|
|
|
66
66
|
let a = e, o = t;
|
|
67
67
|
if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
|
|
68
68
|
let i = (e) => e.map((e) => e.map((e) => e.id));
|
|
69
|
-
(e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) =>
|
|
69
|
+
(e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => V(n(e.id) ?? e))));
|
|
70
70
|
}
|
|
71
71
|
return r;
|
|
72
72
|
}
|
|
@@ -77,37 +77,37 @@ function ke(e, t, n) {
|
|
|
77
77
|
}, i = /* @__PURE__ */ new Map();
|
|
78
78
|
Ee(r(e), r(t), "", i);
|
|
79
79
|
let a = {};
|
|
80
|
-
for (let [t, r] of i) if (
|
|
80
|
+
for (let [t, r] of i) if (R.includes(t) && typeof r == "string" && T(e, t) !== void 0) {
|
|
81
81
|
let i = n?.text?.[t];
|
|
82
82
|
(a.text ??= {})[t] = i?.value === r ? i : {
|
|
83
83
|
value: r,
|
|
84
|
-
sourceHash:
|
|
84
|
+
sourceHash: le(String(T(e, t) ?? ""))
|
|
85
85
|
};
|
|
86
86
|
} else (a.set ??= {})[t] = r === void 0 ? null : r;
|
|
87
87
|
return a;
|
|
88
88
|
}
|
|
89
89
|
function Ae(e, t, n, r, i, a = []) {
|
|
90
|
-
let o =
|
|
90
|
+
let o = V(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
|
|
91
91
|
...Object.keys(t.text ?? {}),
|
|
92
92
|
...Object.keys(t.set ?? {}),
|
|
93
93
|
...Object.keys(n.text ?? {}),
|
|
94
94
|
...Object.keys(n.set ?? {})
|
|
95
|
-
])].filter((e) => !
|
|
95
|
+
])].filter((e) => !W(t.text?.[e], n.text?.[e]) || !W(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
|
|
96
96
|
for (let e of c) {
|
|
97
|
-
let t =
|
|
98
|
-
if (
|
|
99
|
-
else if (n.length && Y(
|
|
97
|
+
let t = T(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && W(T(r, t), T(i, t)));
|
|
98
|
+
if (W(t, T(r, e))) delete o.set[e];
|
|
99
|
+
else if (n.length && Y(T(r, e)) && Y(t)) {
|
|
100
100
|
delete o.set[e];
|
|
101
101
|
let i = (e, t, a) => {
|
|
102
102
|
if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
|
|
103
103
|
if (Y(t) && Y(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
|
|
104
104
|
else if (Y(r) && r.type !== "custom" && Ce(t) && Ce(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
|
|
105
|
-
else Y(r) && typeof r.type == "string" &&
|
|
105
|
+
else Y(r) && typeof r.type == "string" && M(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : V(a));
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
i(e,
|
|
109
|
-
} else o.set[e] = t === void 0 ? null :
|
|
110
|
-
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (
|
|
108
|
+
i(e, T(r, e), t);
|
|
109
|
+
} else o.set[e] = t === void 0 ? null : V(t);
|
|
110
|
+
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (W(t === "text" ? o.text[n].value : o.set[n] ?? void 0, T(i, n)) || delete o[t][n]);
|
|
111
111
|
}
|
|
112
112
|
for (let e of s) if (!c.includes(e)) {
|
|
113
113
|
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) (n === e || n.startsWith(`${e}.`)) && delete o[t][n];
|
|
@@ -129,13 +129,13 @@ function Me(e, t, n) {
|
|
|
129
129
|
let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
|
|
130
130
|
if (!r && e.findBlock && !o) return !1;
|
|
131
131
|
let s = r ? null : e.findBlockLocation?.(a);
|
|
132
|
-
if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || !r && o &&
|
|
132
|
+
if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || !r && o && F(o).some((t) => t !== a && e.isBlockLocked(t, !0)) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
|
|
133
133
|
if (r && e.content) {
|
|
134
134
|
let t = {
|
|
135
135
|
...e.content(),
|
|
136
136
|
blocks: [o]
|
|
137
137
|
};
|
|
138
|
-
G(t),
|
|
138
|
+
G(t), U(t);
|
|
139
139
|
}
|
|
140
140
|
if (t === "removeBlock") return !0;
|
|
141
141
|
let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
|
|
@@ -143,7 +143,7 @@ function Me(e, t, n) {
|
|
|
143
143
|
if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
|
|
144
144
|
if (e.findBlock) {
|
|
145
145
|
let t = e.findBlock(l);
|
|
146
|
-
if (t?.type !== "section" || u < 0 || u >=
|
|
146
|
+
if (t?.type !== "section" || u < 0 || u >= E(t.columns)) return !1;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
|
|
@@ -188,8 +188,8 @@ function Q(e, t) {
|
|
|
188
188
|
}
|
|
189
189
|
// ../core/src/editor.ts
|
|
190
190
|
function Ie(t) {
|
|
191
|
-
let n = t.content ??
|
|
192
|
-
G(n),
|
|
191
|
+
let n = t.content ?? se(t.defaultFontFamily, t.templateDefaults);
|
|
192
|
+
G(n), U(n);
|
|
193
193
|
let r = e({
|
|
194
194
|
template: null,
|
|
195
195
|
content: n,
|
|
@@ -204,11 +204,11 @@ function Ie(t) {
|
|
|
204
204
|
uiTheme: "auto"
|
|
205
205
|
}), i = u(r, "activeLocale"), a = [];
|
|
206
206
|
function o(e) {
|
|
207
|
-
let t =
|
|
208
|
-
if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new
|
|
207
|
+
let t = L(r.content);
|
|
208
|
+
if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new q(`This template has no "${e}" version.`, void 0, "unknown_locale");
|
|
209
209
|
i.value = e;
|
|
210
210
|
}
|
|
211
|
-
h(() => i.value ??
|
|
211
|
+
h(() => i.value ?? L(r.content), (e) => Q(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
|
|
212
212
|
i.value && !r.content.settings.locales?.includes(i.value) && o(null);
|
|
213
213
|
});
|
|
214
214
|
function s() {
|
|
@@ -218,16 +218,16 @@ function Ie(t) {
|
|
|
218
218
|
a = e;
|
|
219
219
|
}
|
|
220
220
|
function l(e) {
|
|
221
|
-
return
|
|
221
|
+
return pe(r.content, e, a);
|
|
222
222
|
}
|
|
223
223
|
function d(e, n) {
|
|
224
224
|
if (!s()) return null;
|
|
225
|
-
if (e === "addLocale" && (!
|
|
226
|
-
let i =
|
|
225
|
+
if (e === "addLocale" && (!ne(n) || t.localization && !t.localization.locales.includes(n))) throw new q(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
|
|
226
|
+
let i = V(r.content);
|
|
227
227
|
return ee(i, [{
|
|
228
228
|
op: e,
|
|
229
229
|
locale: n
|
|
230
|
-
}]),
|
|
230
|
+
}]), W(i, r.content) ? null : i;
|
|
231
231
|
}
|
|
232
232
|
function f(e, t) {
|
|
233
233
|
let n = d(e, t);
|
|
@@ -248,17 +248,17 @@ function Ie(t) {
|
|
|
248
248
|
}
|
|
249
249
|
function v(e, t) {
|
|
250
250
|
let [n, o] = t;
|
|
251
|
-
if (!i.value || !s() ||
|
|
252
|
-
let c =
|
|
251
|
+
if (!i.value || !s() || I(n)) return null;
|
|
252
|
+
let c = N(r.content.blocks, n);
|
|
253
253
|
if (!c) return null;
|
|
254
|
-
let l = c.l10n?.[i.value], u =
|
|
254
|
+
let l = c.l10n?.[i.value], u = B(c, i.value, L(r.content)), d = De(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Te(c, u, o) : void 0, p = e === "resetLocaleFields" ? Ae(l, d, De(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : V(l ?? {});
|
|
255
255
|
if (e === "setBlockHidden") o ? p.hidden = !0 : delete p.hidden;
|
|
256
256
|
else if (e === "resetLocaleFields") o || (delete p.text, delete p.set, delete p.hidden);
|
|
257
257
|
else for (let e of o) {
|
|
258
258
|
let t = p.text?.[e];
|
|
259
|
-
t && (t.sourceHash =
|
|
259
|
+
t && (t.sourceHash = le(String(T(c, e) ?? "")));
|
|
260
260
|
}
|
|
261
|
-
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set,
|
|
261
|
+
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, W(l ?? {}, p) ? null : {
|
|
262
262
|
block: c,
|
|
263
263
|
layer: p
|
|
264
264
|
};
|
|
@@ -280,28 +280,28 @@ function Ie(t) {
|
|
|
280
280
|
function A() {
|
|
281
281
|
r.isDirty = !0, k++;
|
|
282
282
|
}
|
|
283
|
-
let
|
|
283
|
+
let j = b({
|
|
284
284
|
get: () => r.content,
|
|
285
285
|
set: (e) => {
|
|
286
286
|
r.content = e, A();
|
|
287
287
|
}
|
|
288
|
-
}),
|
|
289
|
-
function
|
|
288
|
+
}), M = b(() => r.selectedBlockId ? N(r.content.blocks, r.selectedBlockId) : null);
|
|
289
|
+
function N(e, t) {
|
|
290
290
|
for (let n of e) {
|
|
291
291
|
if (n.id === t) return n;
|
|
292
292
|
if (n.type === "section") for (let e of n.children) {
|
|
293
|
-
let n =
|
|
293
|
+
let n = N(e, t);
|
|
294
294
|
if (n) return n;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
return null;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function P(e, t, n = { blocks: e }) {
|
|
300
300
|
for (let r = 0; r < e.length; r++) {
|
|
301
301
|
let i = e[r];
|
|
302
302
|
if (i.id === t) return n;
|
|
303
303
|
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
304
|
-
let n =
|
|
304
|
+
let n = P(i.children[e], t, {
|
|
305
305
|
blocks: i.children[e],
|
|
306
306
|
sectionId: i.id,
|
|
307
307
|
columnIndex: e
|
|
@@ -311,7 +311,7 @@ function Ie(t) {
|
|
|
311
311
|
}
|
|
312
312
|
return null;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function I(e, n = !1) {
|
|
315
315
|
let r = i.value ?? t.lockLocale?.value ?? null;
|
|
316
316
|
for (let [i, a] of t.lockedBlocks?.value ?? []) {
|
|
317
317
|
let o = a;
|
|
@@ -321,8 +321,8 @@ function Ie(t) {
|
|
|
321
321
|
}
|
|
322
322
|
return !1;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
let t =
|
|
324
|
+
function R(e) {
|
|
325
|
+
let t = P(r.content.blocks, e);
|
|
326
326
|
if (!t) return null;
|
|
327
327
|
let n = t.blocks.findIndex((t) => t.id === e);
|
|
328
328
|
return n === -1 ? null : {
|
|
@@ -331,63 +331,63 @@ function Ie(t) {
|
|
|
331
331
|
index: n
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
G(e),
|
|
334
|
+
function z(e, t = !0) {
|
|
335
|
+
G(e), U(e), r.content = e, t && A();
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
e &&
|
|
337
|
+
function ie(e) {
|
|
338
|
+
e && I(e) || (r.selectedBlockId = e);
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function K(e) {
|
|
341
341
|
r.viewport = e;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function ae(e) {
|
|
344
344
|
r.darkMode = e;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function oe(e) {
|
|
347
347
|
r.uiTheme = e;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function ce(e) {
|
|
350
350
|
r.previewMode = e, e && (r.selectedBlockId = null);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function ue(e, t) {
|
|
353
353
|
if (!s()) return !1;
|
|
354
|
-
let n =
|
|
354
|
+
let n = N(r.content.blocks, e);
|
|
355
355
|
if (!n) return !1;
|
|
356
|
-
if ("l10n" in t) throw new
|
|
356
|
+
if ("l10n" in t) throw new q("l10n is immutable in updateBlock.", void 0, "invalid_operation");
|
|
357
357
|
let a = {
|
|
358
358
|
...n,
|
|
359
359
|
...t
|
|
360
|
-
}, o =
|
|
360
|
+
}, o = V(n), c = Oe(o, a, (e) => N(r.content.blocks, e)), l = "children" in t, u = c || l || a.type !== n.type;
|
|
361
361
|
if (l && a.type === "section" && Array.isArray(a.children)) {
|
|
362
|
-
let e = new Set(
|
|
363
|
-
for (let n of a.children) for (let i of n) for (let n of
|
|
364
|
-
if (t.has(n) ||
|
|
362
|
+
let e = new Set(F(n).slice(1)), t = /* @__PURE__ */ new Set();
|
|
363
|
+
for (let n of a.children) for (let i of n) for (let n of F(i)) {
|
|
364
|
+
if (t.has(n) || I(n, !0) || N(r.content.blocks, n) !== null && !e.has(n)) return !1;
|
|
365
365
|
t.add(n);
|
|
366
366
|
}
|
|
367
367
|
if (i.value) {
|
|
368
|
-
let e =
|
|
368
|
+
let e = F(o);
|
|
369
369
|
if (new Set(e).size !== e.length) return !1;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
return !
|
|
372
|
+
return !I(e, u || "columns" in t) && (!u || !F(n).some((t) => t !== e && I(t, !0)));
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
if (!
|
|
376
|
-
let o =
|
|
374
|
+
function de(e, n) {
|
|
375
|
+
if (!ue(e, n)) return;
|
|
376
|
+
let o = N(r.content.blocks, e);
|
|
377
377
|
if (!o) return;
|
|
378
378
|
let s = i.value;
|
|
379
379
|
if (s) {
|
|
380
|
-
let i =
|
|
380
|
+
let i = B(o, s, L(r.content)), c = {
|
|
381
381
|
...i,
|
|
382
382
|
...n
|
|
383
|
-
}, l =
|
|
384
|
-
if (
|
|
383
|
+
}, l = V(o), u = Oe(l, c, (e) => N(r.content.blocks, e));
|
|
384
|
+
if (I(e, u)) return;
|
|
385
385
|
u && t.onStructureChange?.();
|
|
386
|
-
let d =
|
|
386
|
+
let d = re(l);
|
|
387
387
|
delete o.l10n, Object.assign(o, d), _(o, Ae(o.l10n?.[s], De(o, i, o.l10n?.[s], a), De(o, c, o.l10n?.[s], a), o, c));
|
|
388
388
|
} else {
|
|
389
|
-
if (
|
|
390
|
-
let t =
|
|
389
|
+
if (I(e, "children" in n || "columns" in n)) return;
|
|
390
|
+
let t = re({
|
|
391
391
|
...o,
|
|
392
392
|
...n
|
|
393
393
|
});
|
|
@@ -395,20 +395,20 @@ function Ie(t) {
|
|
|
395
395
|
}
|
|
396
396
|
A();
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
if ("locales" in e || "l10n" in e) throw new
|
|
400
|
-
if ("locale" in e && e.locale !==
|
|
398
|
+
function fe(e) {
|
|
399
|
+
if ("locales" in e || "l10n" in e) throw new q("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
|
|
400
|
+
if ("locale" in e && e.locale !== L(r.content) && r.content.settings.locales?.length) throw new q("The default locale can't change while language versions exist.", void 0, "invalid_operation");
|
|
401
401
|
}
|
|
402
402
|
function me(e) {
|
|
403
403
|
if (!s()) return;
|
|
404
|
-
|
|
404
|
+
fe(e);
|
|
405
405
|
let t = i.value;
|
|
406
|
-
if (!t) r.content.settings =
|
|
406
|
+
if (!t) r.content.settings = te({
|
|
407
407
|
...r.content.settings,
|
|
408
408
|
...e
|
|
409
409
|
});
|
|
410
410
|
else {
|
|
411
|
-
let n = r.content.settings, i =
|
|
411
|
+
let n = r.content.settings, i = H(r.content, t).settings, a = {
|
|
412
412
|
...i,
|
|
413
413
|
locale: n.locale,
|
|
414
414
|
...e
|
|
@@ -423,9 +423,9 @@ function Ie(t) {
|
|
|
423
423
|
let he = {
|
|
424
424
|
canEdit: s,
|
|
425
425
|
content: () => r.content,
|
|
426
|
-
findBlock: (e) =>
|
|
427
|
-
findBlockLocation:
|
|
428
|
-
isBlockLocked:
|
|
426
|
+
findBlock: (e) => N(r.content.blocks, e),
|
|
427
|
+
findBlockLocation: R,
|
|
428
|
+
isBlockLocked: I
|
|
429
429
|
};
|
|
430
430
|
function ge(e, n, a = 0, o) {
|
|
431
431
|
if (Me(he, "addBlock", [
|
|
@@ -435,7 +435,7 @@ function Ie(t) {
|
|
|
435
435
|
o
|
|
436
436
|
])) {
|
|
437
437
|
if (n) {
|
|
438
|
-
let t =
|
|
438
|
+
let t = N(r.content.blocks, n);
|
|
439
439
|
if (t && t.type === "section") {
|
|
440
440
|
t.children[a] = t.children[a] || [];
|
|
441
441
|
let n = t.children[a];
|
|
@@ -447,12 +447,12 @@ function Ie(t) {
|
|
|
447
447
|
}
|
|
448
448
|
function _e(e) {
|
|
449
449
|
if (!Me(he, "removeBlock", [e])) return;
|
|
450
|
-
let n =
|
|
450
|
+
let n = P(r.content.blocks, e);
|
|
451
451
|
if (n) {
|
|
452
452
|
let a = n.blocks.findIndex((t) => t.id === e);
|
|
453
453
|
if (a !== -1) {
|
|
454
454
|
let [e] = n.blocks.splice(a, 1);
|
|
455
|
-
r.selectedBlockId && new Set(
|
|
455
|
+
r.selectedBlockId && new Set(F(e)).has(r.selectedBlockId) && (r.selectedBlockId = null), i.value && t.onStructureChange?.(), A();
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
}
|
|
@@ -463,9 +463,9 @@ function Ie(t) {
|
|
|
463
463
|
a,
|
|
464
464
|
o
|
|
465
465
|
])) return;
|
|
466
|
-
let s =
|
|
466
|
+
let s = P(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
|
|
467
467
|
if (a) {
|
|
468
|
-
let e =
|
|
468
|
+
let e = N(r.content.blocks, a);
|
|
469
469
|
e.children[o] = e.children[o] || [], l = e.children[o];
|
|
470
470
|
} else l = r.content.blocks;
|
|
471
471
|
let [u] = s.blocks.splice(c, 1);
|
|
@@ -475,7 +475,7 @@ function Ie(t) {
|
|
|
475
475
|
A();
|
|
476
476
|
}
|
|
477
477
|
function be(e, t) {
|
|
478
|
-
throw new
|
|
478
|
+
throw new q(`[Templatical] Templates: ${e} ${t}`);
|
|
479
479
|
}
|
|
480
480
|
function xe(e) {
|
|
481
481
|
Q(t.onError, e);
|
|
@@ -513,7 +513,7 @@ function Ie(t) {
|
|
|
513
513
|
let i = J("load()"), a, o = ++O;
|
|
514
514
|
r.isLoading = !0;
|
|
515
515
|
try {
|
|
516
|
-
if (a = await i.load(e), G(a.content),
|
|
516
|
+
if (a = await i.load(e), G(a.content), U(a.content), n && !n()) return a;
|
|
517
517
|
r.template = a, r.content = a.content, D.value++, r.isDirty = !1, E.value++;
|
|
518
518
|
} catch (e) {
|
|
519
519
|
throw t.onError?.(e), e;
|
|
@@ -556,8 +556,8 @@ function Ie(t) {
|
|
|
556
556
|
state: m(r),
|
|
557
557
|
loadVersion: m(E),
|
|
558
558
|
contentReplaced: m(D),
|
|
559
|
-
content:
|
|
560
|
-
selectedBlock:
|
|
559
|
+
content: j,
|
|
560
|
+
selectedBlock: M,
|
|
561
561
|
activeLocale: i,
|
|
562
562
|
setActiveLocale: o,
|
|
563
563
|
addLocale: p,
|
|
@@ -567,34 +567,34 @@ function Ie(t) {
|
|
|
567
567
|
keepTranslations: w,
|
|
568
568
|
setCustomBlockDefinitions: c,
|
|
569
569
|
createSetDefaultLocaleOperation: l,
|
|
570
|
-
isBlockLocked:
|
|
571
|
-
setContent:
|
|
572
|
-
selectBlock:
|
|
573
|
-
setViewport:
|
|
574
|
-
setDarkMode:
|
|
575
|
-
setUiTheme:
|
|
576
|
-
setPreviewMode:
|
|
577
|
-
updateBlock:
|
|
570
|
+
isBlockLocked: I,
|
|
571
|
+
setContent: z,
|
|
572
|
+
selectBlock: ie,
|
|
573
|
+
setViewport: K,
|
|
574
|
+
setDarkMode: ae,
|
|
575
|
+
setUiTheme: oe,
|
|
576
|
+
setPreviewMode: ce,
|
|
577
|
+
updateBlock: de,
|
|
578
578
|
updateSettings: me,
|
|
579
579
|
addBlock: ge,
|
|
580
580
|
removeBlock: _e,
|
|
581
581
|
moveBlock: ve,
|
|
582
582
|
markDirty: ye,
|
|
583
|
-
findBlockLocation:
|
|
583
|
+
findBlockLocation: R,
|
|
584
584
|
setName: Se,
|
|
585
585
|
create: Y,
|
|
586
586
|
load: Ce,
|
|
587
587
|
save: we,
|
|
588
588
|
hasTemplate: Ee
|
|
589
589
|
};
|
|
590
|
-
return Ne(X, (e, t) => je(e) ? Me(he, e, t) : s() ? e === "updateBlock" ?
|
|
590
|
+
return Ne(X, (e, t) => je(e) ? Me(he, e, t) : s() ? e === "updateBlock" ? ue(t[0], t[1]) : (e === "updateSettings" && fe(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
|
|
591
591
|
}
|
|
592
592
|
// ../core/src/history.ts
|
|
593
593
|
var Le = 50, Re = 300, ze = 1500;
|
|
594
594
|
function Be(e) {
|
|
595
595
|
let { content: t, setContent: n, maxSize: r = Le } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
|
|
596
596
|
function d() {
|
|
597
|
-
return
|
|
597
|
+
return V(t.value);
|
|
598
598
|
}
|
|
599
599
|
function f(e) {
|
|
600
600
|
i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
|
|
@@ -869,7 +869,7 @@ function tt(e) {
|
|
|
869
869
|
}
|
|
870
870
|
function nt(e, t, n) {
|
|
871
871
|
let r = {}, i = [];
|
|
872
|
-
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 ||
|
|
872
|
+
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || W(e[i], t[i]) || (r[i] = V(t[i]));
|
|
873
873
|
for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
|
|
874
874
|
return {
|
|
875
875
|
set: r,
|
|
@@ -888,7 +888,7 @@ function rt(e = {}, t = {}) {
|
|
|
888
888
|
function it(e, t) {
|
|
889
889
|
if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
|
|
890
890
|
op: "setContent",
|
|
891
|
-
content:
|
|
891
|
+
content: V(t)
|
|
892
892
|
}];
|
|
893
893
|
let n = et(e.blocks), r = et(t.blocks), i = [], a = new Set(t.settings.locales ?? []), o = new Set(e.settings.locales ?? []), s = (e) => {
|
|
894
894
|
let t = r.get(e), i = n.get(e);
|
|
@@ -906,7 +906,7 @@ function it(e, t) {
|
|
|
906
906
|
};
|
|
907
907
|
for (let t of e.blocks) p(t, "kept");
|
|
908
908
|
let m = (e) => n.has(e) && !d.has(e), h = (e) => {
|
|
909
|
-
let t =
|
|
909
|
+
let t = V(e);
|
|
910
910
|
return t.type === "section" ? t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !m(e.id)).map(h) : e) : t.type === "wrapper" && e.type === "wrapper" && (t.children = e.children.filter((e) => !m(e.id)).map(h)), t;
|
|
911
911
|
}, g = (e, t, r) => {
|
|
912
912
|
let a = Qe(e), o = [], s = [];
|
|
@@ -1089,39 +1089,39 @@ function ct(e, t, n) {
|
|
|
1089
1089
|
Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
|
|
1090
1090
|
}
|
|
1091
1091
|
function lt(e) {
|
|
1092
|
-
let t =
|
|
1092
|
+
let t = V(e);
|
|
1093
1093
|
return delete t.l10n, t.type === "section" ? t.children = t.children.map((e) => e.map(lt)) : t.type === "wrapper" && (t.children = t.children.map(lt)), t;
|
|
1094
1094
|
}
|
|
1095
1095
|
function ut(e, t, n, r) {
|
|
1096
|
-
let i =
|
|
1096
|
+
let i = H(e, t), a = V(e), o = V(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
|
|
1097
1097
|
for (let [i, a] of $(n)) c.set(i, {
|
|
1098
|
-
initial:
|
|
1098
|
+
initial: B(a, t, L(e)),
|
|
1099
1099
|
added: r,
|
|
1100
1100
|
changed: !1
|
|
1101
1101
|
});
|
|
1102
1102
|
};
|
|
1103
1103
|
l(i.blocks, !1);
|
|
1104
1104
|
let u = [], d = (e, t, n) => {
|
|
1105
|
-
if (t.some((e) => e?.op === "setDefaultLocale")) throw new
|
|
1106
|
-
if (t.some((e) => e?.op === "setContent")) throw new
|
|
1105
|
+
if (t.some((e) => e?.op === "setDefaultLocale")) throw new D("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
|
|
1106
|
+
if (t.some((e) => e?.op === "setContent")) throw new D("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
|
|
1107
1107
|
try {
|
|
1108
|
-
return
|
|
1108
|
+
return j(e, t);
|
|
1109
1109
|
} catch (e) {
|
|
1110
|
-
throw e instanceof
|
|
1110
|
+
throw e instanceof D ? new D(e.code, n, e.message, e.blockId) : e;
|
|
1111
1111
|
}
|
|
1112
1112
|
}, f = (e, t) => {
|
|
1113
1113
|
a = d(a, e, t), u.push(...e);
|
|
1114
1114
|
}, p = (e, n) => {
|
|
1115
1115
|
let o = c.get(e);
|
|
1116
1116
|
if (!o?.changed) return;
|
|
1117
|
-
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u =
|
|
1117
|
+
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = V(a), d = at(u, ot(u, e).parent), p = V(s);
|
|
1118
1118
|
if (o.added) p = lt(l), p.type === "section" && s.type === "section" ? (p.children = s.children, p.columns = s.columns) : p.type === "wrapper" && s.type === "wrapper" && (p.children = s.children);
|
|
1119
1119
|
else {
|
|
1120
1120
|
Oe(p, p.type === "section" ? {
|
|
1121
1121
|
...l,
|
|
1122
1122
|
children: p.children,
|
|
1123
1123
|
columns: p.columns
|
|
1124
|
-
} : l, (e) => $(a.blocks).get(e) ?? null), p =
|
|
1124
|
+
} : l, (e) => $(a.blocks).get(e) ?? null), p = re(p);
|
|
1125
1125
|
let e = p.l10n?.[t];
|
|
1126
1126
|
ct(p, t, Ae(e, De(p, o.initial, e, r), De(p, l, e, r), p, l));
|
|
1127
1127
|
}
|
|
@@ -1144,7 +1144,7 @@ function ut(e, t, n, r) {
|
|
|
1144
1144
|
op: "updateBlock",
|
|
1145
1145
|
blockId: e.blockId,
|
|
1146
1146
|
set: { columns: i.columns },
|
|
1147
|
-
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e,
|
|
1147
|
+
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, T(u, e) ?? null])) } : {}
|
|
1148
1148
|
}], n);
|
|
1149
1149
|
};
|
|
1150
1150
|
n.forEach((e, t) => {
|
|
@@ -1189,7 +1189,7 @@ function ut(e, t, n, r) {
|
|
|
1189
1189
|
});
|
|
1190
1190
|
for (let e of c.keys()) p(e, n.length - 1);
|
|
1191
1191
|
if (s) {
|
|
1192
|
-
let e =
|
|
1192
|
+
let e = V(a), r = e.settings.l10n?.[t];
|
|
1193
1193
|
ct(e.settings, t, Ae(r, ke(e.settings, o, r), ke(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
|
|
1194
1194
|
}
|
|
1195
1195
|
return u;
|
|
@@ -1246,14 +1246,14 @@ function Ct(e) {
|
|
|
1246
1246
|
});
|
|
1247
1247
|
}
|
|
1248
1248
|
function wt(e) {
|
|
1249
|
-
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? mt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, E = null,
|
|
1250
|
-
function
|
|
1249
|
+
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? mt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, E = null, O = 0, k = !1, A = [], M = null, N = null, te = Promise.resolve(), F = null, I = b(() => (v?.undo.length ?? 0) > 0), L = b(() => (v?.redo.length ?? 0) > 0);
|
|
1250
|
+
function R(t) {
|
|
1251
1251
|
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function z(t, n = v) {
|
|
1254
1254
|
n !== v || k || e.onNotice?.(t);
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function ne() {
|
|
1257
1257
|
return {
|
|
1258
1258
|
locks: [...s.value.values()].map((e) => ({
|
|
1259
1259
|
blockId: e.blockId,
|
|
@@ -1269,7 +1269,7 @@ function wt(e) {
|
|
|
1269
1269
|
function re(e, t) {
|
|
1270
1270
|
e.push(t), e.length > r && e.splice(0, e.length - r);
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1272
|
+
function H(e) {
|
|
1273
1273
|
if (!_ || y) return;
|
|
1274
1274
|
C = !0;
|
|
1275
1275
|
try {
|
|
@@ -1277,9 +1277,9 @@ function wt(e) {
|
|
|
1277
1277
|
if (n.length > 0) try {
|
|
1278
1278
|
ee(t, n);
|
|
1279
1279
|
} catch {
|
|
1280
|
-
_.setContent(
|
|
1280
|
+
_.setContent(V(e), !1);
|
|
1281
1281
|
}
|
|
1282
|
-
|
|
1282
|
+
W(_.content.value, e) || _.setContent(V(e), !1);
|
|
1283
1283
|
} finally {
|
|
1284
1284
|
C = !1;
|
|
1285
1285
|
}
|
|
@@ -1288,62 +1288,62 @@ function wt(e) {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
function ie() {
|
|
1290
1290
|
C || T || (T = !0, queueMicrotask(() => {
|
|
1291
|
-
T = !1,
|
|
1291
|
+
T = !1, G(!1);
|
|
1292
1292
|
}));
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function U() {
|
|
1295
1295
|
E &&= (clearTimeout(E), null);
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function G(e, t = !1) {
|
|
1298
1298
|
let n = v;
|
|
1299
1299
|
if (!_ || !n || y || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
|
|
1300
1300
|
let r = it(n.view, _.content.value);
|
|
1301
|
-
if (r.length === 0)
|
|
1301
|
+
if (r.length === 0) U();
|
|
1302
1302
|
else {
|
|
1303
1303
|
if (!e && St(r)) {
|
|
1304
1304
|
let e = Date.now();
|
|
1305
|
-
if (E === null && (
|
|
1305
|
+
if (E === null && (O = e), e - O < 1e3) {
|
|
1306
1306
|
E && clearTimeout(E), E = setTimeout(() => {
|
|
1307
|
-
E = null,
|
|
1307
|
+
E = null, G(!0);
|
|
1308
1308
|
}, 300);
|
|
1309
1309
|
return;
|
|
1310
1310
|
}
|
|
1311
1311
|
}
|
|
1312
|
-
|
|
1312
|
+
U(), ae(n, r);
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1316
|
-
|
|
1315
|
+
function K() {
|
|
1316
|
+
G(!0);
|
|
1317
1317
|
}
|
|
1318
|
-
function
|
|
1318
|
+
function ae(e, t) {
|
|
1319
1319
|
let n = t, r;
|
|
1320
1320
|
try {
|
|
1321
|
-
r =
|
|
1321
|
+
r = j(e.view, n, ne());
|
|
1322
1322
|
} catch (n) {
|
|
1323
|
-
if (!(n instanceof
|
|
1324
|
-
|
|
1323
|
+
if (!(n instanceof D)) throw n;
|
|
1324
|
+
H(e.view);
|
|
1325
1325
|
let r = n.blockId === void 0 ? void 0 : je(n.blockId).find((e) => {
|
|
1326
1326
|
let r = t[n.opIndex];
|
|
1327
1327
|
return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
|
|
1328
1328
|
})?.holder;
|
|
1329
|
-
|
|
1329
|
+
z({
|
|
1330
1330
|
type: "editRefused",
|
|
1331
1331
|
code: n.code,
|
|
1332
1332
|
...r ? { holder: r } : {}
|
|
1333
|
-
}), n.code === "invalid_operation" &&
|
|
1333
|
+
}), n.code === "invalid_operation" && R(n);
|
|
1334
1334
|
return;
|
|
1335
1335
|
}
|
|
1336
1336
|
let i = _.content.value;
|
|
1337
|
-
if (!
|
|
1338
|
-
|
|
1337
|
+
if (!W(r, i)) {
|
|
1338
|
+
R(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
|
|
1339
1339
|
op: "setContent",
|
|
1340
|
-
content:
|
|
1340
|
+
content: V(i)
|
|
1341
1341
|
}];
|
|
1342
1342
|
try {
|
|
1343
|
-
r =
|
|
1343
|
+
r = j(e.view, n, ne());
|
|
1344
1344
|
} catch (t) {
|
|
1345
|
-
if (!(t instanceof
|
|
1346
|
-
|
|
1345
|
+
if (!(t instanceof D)) throw t;
|
|
1346
|
+
H(e.view), z({
|
|
1347
1347
|
type: "editRefused",
|
|
1348
1348
|
code: t.code
|
|
1349
1349
|
});
|
|
@@ -1353,9 +1353,9 @@ function wt(e) {
|
|
|
1353
1353
|
let a = _t({ ops: P(e.view, n) }, r);
|
|
1354
1354
|
re(e.undo, a), e.redo = [], B();
|
|
1355
1355
|
let o = e.view;
|
|
1356
|
-
e.view = r,
|
|
1356
|
+
e.view = r, oe(e, n, "edit", a, o);
|
|
1357
1357
|
}
|
|
1358
|
-
function
|
|
1358
|
+
function oe(e, t, n, r, i) {
|
|
1359
1359
|
let a = { dropped: !1 }, o = 0, s = i;
|
|
1360
1360
|
do {
|
|
1361
1361
|
let i = t.slice(o, o + ht);
|
|
@@ -1369,38 +1369,38 @@ function wt(e) {
|
|
|
1369
1369
|
revision: null,
|
|
1370
1370
|
...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
|
|
1371
1371
|
}), o += ht, s && t.slice(o).some((e) => e.op === "setContent")) try {
|
|
1372
|
-
s =
|
|
1372
|
+
s = j(s, i);
|
|
1373
1373
|
} catch {
|
|
1374
1374
|
s = null;
|
|
1375
1375
|
}
|
|
1376
1376
|
} while (o < t.length);
|
|
1377
|
-
|
|
1377
|
+
se(e);
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1379
|
+
function se(e) {
|
|
1380
1380
|
if (e.inFlight || w) return;
|
|
1381
1381
|
let t = e.pending.find((e) => !e.sent);
|
|
1382
|
-
t ? (t.sent = !0, e.inFlight = t,
|
|
1382
|
+
t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : pe(e);
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function ce(e, n, r) {
|
|
1385
1385
|
t.submit(e.templateId, {
|
|
1386
1386
|
batchId: n.batchId,
|
|
1387
1387
|
baseRevision: n.baseRevision ??= e.revision,
|
|
1388
1388
|
ops: n.ops,
|
|
1389
1389
|
...n.origin === "ai" ? { origin: "ai" } : {}
|
|
1390
1390
|
}).then(({ revision: t }) => {
|
|
1391
|
-
e.inFlight = null,
|
|
1391
|
+
e.inFlight = null, q(e, n, t), se(e);
|
|
1392
1392
|
}, (t) => {
|
|
1393
|
-
if (vt(t) !== null) e.inFlight = null, fe(e, n, t),
|
|
1393
|
+
if (vt(t) !== null) e.inFlight = null, fe(e, n, t), se(e);
|
|
1394
1394
|
else if (bt(t)) {
|
|
1395
1395
|
me(e, t);
|
|
1396
1396
|
let i = pt[Math.min(r, pt.length - 1)];
|
|
1397
1397
|
setTimeout(() => {
|
|
1398
|
-
k ||
|
|
1398
|
+
k || ce(e, n, r + 1);
|
|
1399
1399
|
}, i);
|
|
1400
|
-
} else e.inFlight = null,
|
|
1400
|
+
} else e.inFlight = null, R(t), fe(e, n, t), se(e);
|
|
1401
1401
|
});
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function q(e, t, n) {
|
|
1404
1404
|
t.revision === null && (t.revision = n, n <= e.revision ? (le(e, t), ve(e)) : (e.own.set(n, t), _e(e)));
|
|
1405
1405
|
}
|
|
1406
1406
|
function le(e, t) {
|
|
@@ -1424,12 +1424,12 @@ function wt(e) {
|
|
|
1424
1424
|
let r = vt(n) ?? "invalid_operation";
|
|
1425
1425
|
if (t.origin === "edit" || t.origin === "ai") {
|
|
1426
1426
|
let t = yt(n);
|
|
1427
|
-
|
|
1427
|
+
z({
|
|
1428
1428
|
type: "editRefused",
|
|
1429
1429
|
code: r,
|
|
1430
1430
|
...t ? { holder: t } : {}
|
|
1431
1431
|
}, e);
|
|
1432
|
-
} else
|
|
1432
|
+
} else z({
|
|
1433
1433
|
type: "undoSkipped",
|
|
1434
1434
|
code: r
|
|
1435
1435
|
}, e);
|
|
@@ -1446,14 +1446,14 @@ function wt(e) {
|
|
|
1446
1446
|
function he(e, t) {
|
|
1447
1447
|
if (t.revision <= e.revision) return;
|
|
1448
1448
|
let n = e.pending.find((e) => e.batchId === t.batchId);
|
|
1449
|
-
n ?
|
|
1449
|
+
n ? q(e, n, t.revision) : (e.remote.set(t.revision, t), _e(e));
|
|
1450
1450
|
}
|
|
1451
1451
|
function ge(t, n) {
|
|
1452
1452
|
let r = n.ops;
|
|
1453
1453
|
if (e.normalizeRemoteOperations) try {
|
|
1454
1454
|
r = e.normalizeRemoteOperations(n.ops, t.confirmed);
|
|
1455
1455
|
} catch (e) {
|
|
1456
|
-
|
|
1456
|
+
R(e);
|
|
1457
1457
|
}
|
|
1458
1458
|
return Ct(r);
|
|
1459
1459
|
}
|
|
@@ -1463,10 +1463,10 @@ function wt(e) {
|
|
|
1463
1463
|
let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
|
|
1464
1464
|
if (!i && !a) break;
|
|
1465
1465
|
try {
|
|
1466
|
-
t.confirmed =
|
|
1466
|
+
t.confirmed = j(t.confirmed, i ? ge(t, i) : a.ops);
|
|
1467
1467
|
} catch {
|
|
1468
1468
|
if (t.recovering) {
|
|
1469
|
-
t.remote.clear(), t.own.clear(),
|
|
1469
|
+
t.remote.clear(), t.own.clear(), R(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
|
|
1470
1470
|
return;
|
|
1471
1471
|
}
|
|
1472
1472
|
Se(t);
|
|
@@ -1481,7 +1481,7 @@ function wt(e) {
|
|
|
1481
1481
|
locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
|
|
1482
1482
|
});
|
|
1483
1483
|
} catch (e) {
|
|
1484
|
-
|
|
1484
|
+
R(e);
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
function ve(e) {
|
|
@@ -1492,21 +1492,21 @@ function wt(e) {
|
|
|
1492
1492
|
} finally {
|
|
1493
1493
|
t && (w = !1);
|
|
1494
1494
|
}
|
|
1495
|
-
t &&
|
|
1495
|
+
t && se(e);
|
|
1496
1496
|
}
|
|
1497
1497
|
function ye(e) {
|
|
1498
|
-
e === v &&
|
|
1498
|
+
e === v && K();
|
|
1499
1499
|
let t = e.confirmed;
|
|
1500
1500
|
for (let n = 0; n < e.pending.length; n++) {
|
|
1501
1501
|
let r = e.pending[n], i;
|
|
1502
|
-
if (r.base && !
|
|
1502
|
+
if (r.base && !W(r.base, t)) i = "precondition_failed";
|
|
1503
1503
|
else try {
|
|
1504
|
-
t =
|
|
1504
|
+
t = j(t, r.ops);
|
|
1505
1505
|
continue;
|
|
1506
1506
|
} catch (e) {
|
|
1507
|
-
i = e instanceof
|
|
1507
|
+
i = e instanceof D ? e.code : "invalid_operation";
|
|
1508
1508
|
}
|
|
1509
|
-
r.sent || (de(e, r) &&
|
|
1509
|
+
r.sent || (de(e, r) && z(r.origin === "edit" || r.origin === "ai" ? {
|
|
1510
1510
|
type: "editRefused",
|
|
1511
1511
|
code: i
|
|
1512
1512
|
} : {
|
|
@@ -1514,7 +1514,7 @@ function wt(e) {
|
|
|
1514
1514
|
code: i
|
|
1515
1515
|
}, e), t = e.confirmed, n = -1);
|
|
1516
1516
|
}
|
|
1517
|
-
e.view = t, pe(e), e === v &&
|
|
1517
|
+
e.view = t, pe(e), e === v && H(t);
|
|
1518
1518
|
}
|
|
1519
1519
|
function be(e) {
|
|
1520
1520
|
e.gapTimer ||= setTimeout(() => {
|
|
@@ -1536,7 +1536,7 @@ function wt(e) {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
for (let t of n.batches) he(e, t);
|
|
1538
1538
|
} catch (e) {
|
|
1539
|
-
|
|
1539
|
+
R(e);
|
|
1540
1540
|
} finally {
|
|
1541
1541
|
e.catchingUp = null;
|
|
1542
1542
|
}
|
|
@@ -1549,14 +1549,14 @@ function wt(e) {
|
|
|
1549
1549
|
if (t.retired) return;
|
|
1550
1550
|
Y(t, n);
|
|
1551
1551
|
} catch (e) {
|
|
1552
|
-
|
|
1552
|
+
R(e);
|
|
1553
1553
|
} finally {
|
|
1554
1554
|
t.recovering = !1;
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
1557
|
function Y(e, t) {
|
|
1558
1558
|
let n = t.revision ?? e.revision;
|
|
1559
|
-
e.confirmed =
|
|
1559
|
+
e.confirmed = V(t.content), e.revision = n, e.remote = new Map([...e.remote].filter(([e]) => e > n));
|
|
1560
1560
|
for (let [t, r] of [...e.own]) t <= n && (e.own.delete(t), le(e, r));
|
|
1561
1561
|
e === v && (m.value = n), ve(e), _e(e);
|
|
1562
1562
|
}
|
|
@@ -1574,7 +1574,7 @@ function wt(e) {
|
|
|
1574
1574
|
actor: i
|
|
1575
1575
|
});
|
|
1576
1576
|
} catch (e) {
|
|
1577
|
-
|
|
1577
|
+
R(e);
|
|
1578
1578
|
}
|
|
1579
1579
|
J();
|
|
1580
1580
|
}
|
|
@@ -1597,15 +1597,15 @@ function wt(e) {
|
|
|
1597
1597
|
let i = d;
|
|
1598
1598
|
t.join(e.templateId, { sessionId: n }, Ce(e)).then((t) => {
|
|
1599
1599
|
e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Pe(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && J(), r && Q());
|
|
1600
|
-
}, (e) =>
|
|
1600
|
+
}, (e) => R(e));
|
|
1601
1601
|
}
|
|
1602
1602
|
function Te(e, t) {
|
|
1603
|
-
let n =
|
|
1603
|
+
let n = V(e.content), r = {
|
|
1604
1604
|
templateId: e.id,
|
|
1605
1605
|
confirmed: n,
|
|
1606
1606
|
revision: e.revision ?? 0,
|
|
1607
1607
|
pending: [],
|
|
1608
|
-
view:
|
|
1608
|
+
view: V(n),
|
|
1609
1609
|
remote: /* @__PURE__ */ new Map(),
|
|
1610
1610
|
own: /* @__PURE__ */ new Map(),
|
|
1611
1611
|
inFlight: null,
|
|
@@ -1628,7 +1628,7 @@ function wt(e) {
|
|
|
1628
1628
|
p.value = t, t === "connected" && n !== null && n !== "connected" && we(e, !0);
|
|
1629
1629
|
}
|
|
1630
1630
|
function Oe(e, t) {
|
|
1631
|
-
v && v.templateId === e?.id || (v &&= (
|
|
1631
|
+
v && v.templateId === e?.id || (v &&= (U(), Ee(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, M = null, Q(), B(), e && Te(e, t));
|
|
1632
1632
|
}
|
|
1633
1633
|
function ke(e, t) {
|
|
1634
1634
|
return `${e}\u0000${t ?? ""}`;
|
|
@@ -1640,13 +1640,13 @@ function wt(e) {
|
|
|
1640
1640
|
return [...s.value.values()].filter((t) => t.blockId === e);
|
|
1641
1641
|
}
|
|
1642
1642
|
function Me(e) {
|
|
1643
|
-
e !== f.value && (
|
|
1643
|
+
e !== f.value && (K(), f.value = e, Be(_?.state.selectedBlockId ?? null));
|
|
1644
1644
|
}
|
|
1645
1645
|
function X(e, t = !1) {
|
|
1646
1646
|
if (e.holder.sessionId === n) return;
|
|
1647
1647
|
t ? l.add(e) : u.set(e, ++d);
|
|
1648
1648
|
let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
|
|
1649
|
-
r.set(ke(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null),
|
|
1649
|
+
r.set(ke(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), z({
|
|
1650
1650
|
type: "selectionRefused",
|
|
1651
1651
|
blockId: e.blockId,
|
|
1652
1652
|
holder: e.holder
|
|
@@ -1671,24 +1671,24 @@ function wt(e) {
|
|
|
1671
1671
|
r.size !== s.value.size && (s.value = r);
|
|
1672
1672
|
}
|
|
1673
1673
|
function Fe(e) {
|
|
1674
|
-
te = te.then(e).catch(
|
|
1674
|
+
te = te.then(e).catch(R);
|
|
1675
1675
|
}
|
|
1676
1676
|
function Q() {
|
|
1677
1677
|
i && Fe(async () => {
|
|
1678
|
-
if (
|
|
1679
|
-
let e =
|
|
1680
|
-
|
|
1678
|
+
if (N && (M === null || N.templateId !== M.templateId || N.locale !== M.locale)) {
|
|
1679
|
+
let e = N;
|
|
1680
|
+
N = null, ze(), await t.releaseLock(e.templateId, e.blockId, e.locale);
|
|
1681
1681
|
}
|
|
1682
|
-
let e =
|
|
1683
|
-
if (!(!e ||
|
|
1682
|
+
let e = M;
|
|
1683
|
+
if (!(!e || N?.templateId === e.templateId && N.blockId === e.blockId && N.locale === e.locale)) try {
|
|
1684
1684
|
let n = await t.acquireLock(e.templateId, e.blockId, e.locale);
|
|
1685
|
-
|
|
1685
|
+
N = e, Re(), Ie(n.blockId, n.locale ?? null);
|
|
1686
1686
|
} catch (n) {
|
|
1687
|
-
if (
|
|
1688
|
-
let e =
|
|
1689
|
-
|
|
1687
|
+
if (N?.templateId === e.templateId) {
|
|
1688
|
+
let e = N;
|
|
1689
|
+
N = null, ze(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
|
|
1690
1690
|
}
|
|
1691
|
-
if (
|
|
1691
|
+
if (M !== e) return;
|
|
1692
1692
|
Le(e.blockId, n);
|
|
1693
1693
|
}
|
|
1694
1694
|
});
|
|
@@ -1700,45 +1700,45 @@ function wt(e) {
|
|
|
1700
1700
|
function Le(e, t) {
|
|
1701
1701
|
let n = vt(t);
|
|
1702
1702
|
if (n === "lock_held" || n === "block_missing") {
|
|
1703
|
-
|
|
1703
|
+
M = null;
|
|
1704
1704
|
let n = yt(t);
|
|
1705
1705
|
n ? X({
|
|
1706
1706
|
blockId: e,
|
|
1707
1707
|
holder: n,
|
|
1708
1708
|
expiresAt: ""
|
|
1709
1709
|
}, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
|
|
1710
|
-
} else
|
|
1711
|
-
|
|
1710
|
+
} else R(t), setTimeout(() => {
|
|
1711
|
+
M?.blockId === e && Q();
|
|
1712
1712
|
}, pt[0]);
|
|
1713
1713
|
}
|
|
1714
1714
|
function Re() {
|
|
1715
|
-
|
|
1715
|
+
F ||= setInterval(() => {
|
|
1716
1716
|
Fe(async () => {
|
|
1717
|
-
let e =
|
|
1717
|
+
let e = N;
|
|
1718
1718
|
if (e) try {
|
|
1719
1719
|
await t.renewLock(e.templateId, e.blockId, e.locale);
|
|
1720
1720
|
} catch (e) {
|
|
1721
1721
|
if (vt(e) === "lock_lost") {
|
|
1722
|
-
|
|
1722
|
+
N = null, ze(), Q();
|
|
1723
1723
|
return;
|
|
1724
1724
|
}
|
|
1725
|
-
|
|
1725
|
+
R(e);
|
|
1726
1726
|
}
|
|
1727
1727
|
});
|
|
1728
1728
|
}, ft);
|
|
1729
1729
|
}
|
|
1730
1730
|
function ze() {
|
|
1731
|
-
|
|
1731
|
+
F &&= (clearInterval(F), null);
|
|
1732
1732
|
}
|
|
1733
1733
|
function Be(e) {
|
|
1734
|
-
|
|
1734
|
+
K(), v && (M = e ? {
|
|
1735
1735
|
templateId: v.templateId,
|
|
1736
1736
|
blockId: e,
|
|
1737
1737
|
locale: f.value
|
|
1738
1738
|
} : null, Q());
|
|
1739
1739
|
}
|
|
1740
1740
|
function Ve() {
|
|
1741
|
-
|
|
1741
|
+
K(), N && i && (t.releaseLock(N.templateId, N.blockId, N.locale).catch(() => {}), N = null, ze()), v?.leave?.(), v && (v.leave = null);
|
|
1742
1742
|
}
|
|
1743
1743
|
function He() {
|
|
1744
1744
|
v && (v.undo = [], v.redo = [], B());
|
|
@@ -1746,11 +1746,11 @@ function wt(e) {
|
|
|
1746
1746
|
function Ue(e) {
|
|
1747
1747
|
let t = v;
|
|
1748
1748
|
if (!t || y) return;
|
|
1749
|
-
|
|
1749
|
+
K();
|
|
1750
1750
|
let n = (e === "undo" ? t.undo : t.redo).pop();
|
|
1751
1751
|
if (!n) return;
|
|
1752
|
-
if (B(), n.view && !
|
|
1753
|
-
|
|
1752
|
+
if (B(), n.view && !W(n.view, t.view)) {
|
|
1753
|
+
z({
|
|
1754
1754
|
type: "undoSkipped",
|
|
1755
1755
|
code: "precondition_failed"
|
|
1756
1756
|
});
|
|
@@ -1758,10 +1758,10 @@ function wt(e) {
|
|
|
1758
1758
|
}
|
|
1759
1759
|
let r;
|
|
1760
1760
|
try {
|
|
1761
|
-
r =
|
|
1761
|
+
r = j(t.view, n.ops, ne());
|
|
1762
1762
|
} catch (e) {
|
|
1763
|
-
if (!(e instanceof
|
|
1764
|
-
|
|
1763
|
+
if (!(e instanceof D)) throw e;
|
|
1764
|
+
z({
|
|
1765
1765
|
type: "undoSkipped",
|
|
1766
1766
|
code: e.code
|
|
1767
1767
|
});
|
|
@@ -1770,29 +1770,29 @@ function wt(e) {
|
|
|
1770
1770
|
let i = _t({ ops: P(t.view, n.ops) }, r);
|
|
1771
1771
|
re(e === "undo" ? t.redo : t.undo, i);
|
|
1772
1772
|
let a = t.view;
|
|
1773
|
-
t.view = r,
|
|
1773
|
+
t.view = r, H(r), _?.markDirty(), oe(t, n.ops, e, i, a);
|
|
1774
1774
|
}
|
|
1775
1775
|
function We(e, t) {
|
|
1776
1776
|
let n = v;
|
|
1777
1777
|
if (!_ || !n || y) return {
|
|
1778
1778
|
applied: !1,
|
|
1779
|
-
error: new
|
|
1779
|
+
error: new D("invalid_operation", 0, "No template is open for editing.")
|
|
1780
1780
|
};
|
|
1781
1781
|
if (t.origin === void 0) try {
|
|
1782
|
-
|
|
1782
|
+
j(_.content.value, e, ne());
|
|
1783
1783
|
} catch (e) {
|
|
1784
|
-
if (e instanceof
|
|
1784
|
+
if (e instanceof D) return {
|
|
1785
1785
|
applied: !1,
|
|
1786
1786
|
error: e
|
|
1787
1787
|
};
|
|
1788
1788
|
throw e;
|
|
1789
1789
|
}
|
|
1790
|
-
|
|
1790
|
+
K();
|
|
1791
1791
|
let r, i;
|
|
1792
1792
|
try {
|
|
1793
|
-
r =
|
|
1793
|
+
r = j(n.view, e, ne()), i = P(n.view, e);
|
|
1794
1794
|
} catch (e) {
|
|
1795
|
-
if (e instanceof
|
|
1795
|
+
if (e instanceof D) return {
|
|
1796
1796
|
applied: !1,
|
|
1797
1797
|
error: e
|
|
1798
1798
|
};
|
|
@@ -1800,7 +1800,7 @@ function wt(e) {
|
|
|
1800
1800
|
}
|
|
1801
1801
|
let a = n.undo.at(-1), o;
|
|
1802
1802
|
if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
|
|
1803
|
-
let e = a.view !== void 0 && !
|
|
1803
|
+
let e = a.view !== void 0 && !W(a.view, n.view);
|
|
1804
1804
|
a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
|
|
1805
1805
|
} else o = _t({
|
|
1806
1806
|
ops: i,
|
|
@@ -1808,7 +1808,7 @@ function wt(e) {
|
|
|
1808
1808
|
}, r), re(n.undo, o);
|
|
1809
1809
|
n.redo = [], B();
|
|
1810
1810
|
let s = n.view;
|
|
1811
|
-
return n.view = r,
|
|
1811
|
+
return n.view = r, H(r), _.markDirty(), oe(n, e, t.origin ?? "edit", o, s), {
|
|
1812
1812
|
applied: !0,
|
|
1813
1813
|
inverse: i
|
|
1814
1814
|
};
|
|
@@ -1819,14 +1819,14 @@ function wt(e) {
|
|
|
1819
1819
|
if (n.moveBlock && n.findBlockLocation) {
|
|
1820
1820
|
let t = n.moveBlock, r = (...r) => {
|
|
1821
1821
|
let i = v, a = i && !y && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
|
|
1822
|
-
if (a &&
|
|
1822
|
+
if (a && G(!0), t(...r), !a || W(i.view, e.content.value)) return;
|
|
1823
1823
|
let o = n.findBlockLocation(r[0]);
|
|
1824
1824
|
if (!o) return;
|
|
1825
1825
|
let s = o.targetSectionId ? {
|
|
1826
1826
|
sectionId: o.targetSectionId,
|
|
1827
1827
|
column: o.columnIndex ?? 0
|
|
1828
1828
|
} : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0;
|
|
1829
|
-
|
|
1829
|
+
ae(i, [{
|
|
1830
1830
|
op: "moveBlock",
|
|
1831
1831
|
blockId: r[0],
|
|
1832
1832
|
parent: s,
|
|
@@ -1839,7 +1839,7 @@ function wt(e) {
|
|
|
1839
1839
|
}
|
|
1840
1840
|
A.push(h(() => e.state.template, (t) => {
|
|
1841
1841
|
e.loadVersion && e.contentReplaced && e.state.isLoading || Oe(t);
|
|
1842
|
-
}, { immediate: !0 }), h(() => e.content.value, ie, { deep: !0 }), h(() => e.state.selectedBlockId, Be), h(() => e.state.isLoading, (e) => e ?
|
|
1842
|
+
}, { immediate: !0 }), h(() => e.content.value, ie, { deep: !0 }), h(() => e.state.selectedBlockId, Be), h(() => e.state.isLoading, (e) => e ? G(!0, !0) : ie()));
|
|
1843
1843
|
let r = e.contentReplaced, i = e.loadVersion;
|
|
1844
1844
|
r && i && A.push(h(r, He), h(i, () => {
|
|
1845
1845
|
let n = r.value !== t;
|
|
@@ -1849,10 +1849,10 @@ function wt(e) {
|
|
|
1849
1849
|
undo: v.undo,
|
|
1850
1850
|
redo: v.redo
|
|
1851
1851
|
} : void 0);
|
|
1852
|
-
})), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur",
|
|
1852
|
+
})), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", K)), c() && o(Ye);
|
|
1853
1853
|
}
|
|
1854
1854
|
function Ke() {
|
|
1855
|
-
|
|
1855
|
+
K();
|
|
1856
1856
|
let e = v;
|
|
1857
1857
|
return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
|
|
1858
1858
|
resolve: t,
|
|
@@ -1860,16 +1860,16 @@ function wt(e) {
|
|
|
1860
1860
|
}));
|
|
1861
1861
|
}
|
|
1862
1862
|
function qe() {
|
|
1863
|
-
|
|
1863
|
+
K(), y = !0;
|
|
1864
1864
|
}
|
|
1865
1865
|
function Je() {
|
|
1866
|
-
y = !1, v &&
|
|
1866
|
+
y = !1, v && H(v.view);
|
|
1867
1867
|
}
|
|
1868
1868
|
function Ye() {
|
|
1869
1869
|
if (!k) {
|
|
1870
|
-
|
|
1870
|
+
K();
|
|
1871
1871
|
for (let e of A.splice(0)) e();
|
|
1872
|
-
|
|
1872
|
+
U(), Ve(), k = !0, v && Ee(v), v = null, ze(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", K));
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
1875
|
return {
|
|
@@ -1882,12 +1882,12 @@ function wt(e) {
|
|
|
1882
1882
|
connection: p,
|
|
1883
1883
|
revision: m,
|
|
1884
1884
|
canUndo: I,
|
|
1885
|
-
canRedo:
|
|
1885
|
+
canRedo: L,
|
|
1886
1886
|
attach: Ge,
|
|
1887
1887
|
undo: () => Ue("undo"),
|
|
1888
1888
|
redo: () => Ue("redo"),
|
|
1889
1889
|
clearHistory: He,
|
|
1890
|
-
flush:
|
|
1890
|
+
flush: K,
|
|
1891
1891
|
settle: Ke,
|
|
1892
1892
|
suspend: qe,
|
|
1893
1893
|
resume: Je,
|
|
@@ -1914,7 +1914,7 @@ function Tt(e) {
|
|
|
1914
1914
|
return s.value && e.canDelete !== !1;
|
|
1915
1915
|
}
|
|
1916
1916
|
function u(e, t) {
|
|
1917
|
-
throw new
|
|
1917
|
+
throw new q(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1918
1918
|
}
|
|
1919
1919
|
function d(t) {
|
|
1920
1920
|
Q(e.onError, t);
|
|
@@ -2012,7 +2012,7 @@ function Dt(e = {}) {
|
|
|
2012
2012
|
},
|
|
2013
2013
|
async create(e) {
|
|
2014
2014
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
2015
|
-
id:
|
|
2015
|
+
id: A(),
|
|
2016
2016
|
name: e.name,
|
|
2017
2017
|
content: e.content,
|
|
2018
2018
|
...e.category ? { category: e.category } : {},
|
|
@@ -2079,7 +2079,7 @@ function At(e = {}) {
|
|
|
2079
2079
|
},
|
|
2080
2080
|
async create(e) {
|
|
2081
2081
|
let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
2082
|
-
id:
|
|
2082
|
+
id: A(),
|
|
2083
2083
|
url: t,
|
|
2084
2084
|
filename: e.filename || e.file.name,
|
|
2085
2085
|
createdAt: n,
|
|
@@ -2119,11 +2119,11 @@ function jt(e) {
|
|
|
2119
2119
|
let { provider: t, getTemplateId: n } = e, r = S([]), i = S(!1), a = S(void 0), o = S(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
|
|
2120
2120
|
function u(e) {
|
|
2121
2121
|
let t = n();
|
|
2122
|
-
if (!t) throw new
|
|
2122
|
+
if (!t) throw new q(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
2123
2123
|
return t;
|
|
2124
2124
|
}
|
|
2125
2125
|
function d(e) {
|
|
2126
|
-
throw new
|
|
2126
|
+
throw new q(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2127
2127
|
}
|
|
2128
2128
|
function f(t) {
|
|
2129
2129
|
Q(e.onError, t);
|
|
@@ -2202,16 +2202,16 @@ function Mt(e) {
|
|
|
2202
2202
|
});
|
|
2203
2203
|
function m(e) {
|
|
2204
2204
|
let t = n();
|
|
2205
|
-
if (!t) throw new
|
|
2205
|
+
if (!t) throw new q(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
2206
2206
|
return t;
|
|
2207
2207
|
}
|
|
2208
2208
|
function h(e) {
|
|
2209
2209
|
let t = r();
|
|
2210
|
-
if (!t) throw new
|
|
2210
|
+
if (!t) throw new q(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
2211
2211
|
return t;
|
|
2212
2212
|
}
|
|
2213
2213
|
function g(e) {
|
|
2214
|
-
throw new
|
|
2214
|
+
throw new q(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2215
2215
|
}
|
|
2216
2216
|
function _(e) {
|
|
2217
2217
|
for (let t of i.value) {
|
|
@@ -2342,7 +2342,7 @@ function Mt(e) {
|
|
|
2342
2342
|
function ee(e) {
|
|
2343
2343
|
T(e) && x(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
2344
2344
|
}
|
|
2345
|
-
function
|
|
2345
|
+
function N(e, n) {
|
|
2346
2346
|
let r = E(e, n);
|
|
2347
2347
|
r && x(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
2348
2348
|
}
|
|
@@ -2366,7 +2366,7 @@ function Mt(e) {
|
|
|
2366
2366
|
isOwn: y,
|
|
2367
2367
|
applyRemoteCreate: M,
|
|
2368
2368
|
applyRemoteUpdate: ee,
|
|
2369
|
-
applyRemoteDelete:
|
|
2369
|
+
applyRemoteDelete: N
|
|
2370
2370
|
};
|
|
2371
2371
|
}
|
|
2372
2372
|
function Nt(e) {
|
|
@@ -2450,14 +2450,14 @@ function Lt(e, t) {
|
|
|
2450
2450
|
return typeof n == "string" && n.length > 0 ? n : t;
|
|
2451
2451
|
}
|
|
2452
2452
|
function Rt(e, t) {
|
|
2453
|
-
return typeof e?.url == "string" &&
|
|
2453
|
+
return typeof e?.url == "string" && z(e.url, t);
|
|
2454
2454
|
}
|
|
2455
2455
|
function zt(e, t) {
|
|
2456
2456
|
let n = e?.url;
|
|
2457
|
-
if (typeof n == "string" && n.trim() !== "") return
|
|
2457
|
+
if (typeof n == "string" && n.trim() !== "") return z(n, t) ? void 0 : n;
|
|
2458
2458
|
}
|
|
2459
2459
|
function Bt(e) {
|
|
2460
|
-
let t = a(ge,
|
|
2460
|
+
let t = a(ge, k.liquid), n = It(() => zt(e(), t));
|
|
2461
2461
|
return v(() => Rt(e(), t) ? null : n.value);
|
|
2462
2462
|
}
|
|
2463
2463
|
function Vt(e, t, n) {
|
|
@@ -2643,7 +2643,7 @@ var rn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", an = {
|
|
|
2643
2643
|
]
|
|
2644
2644
|
};
|
|
2645
2645
|
function on(e, t) {
|
|
2646
|
-
let n = (e) => Math.trunc(e ?? 0), r = (e) =>
|
|
2646
|
+
let n = (e) => Math.trunc(e ?? 0), r = (e) => de(e) === null ? 0 : Math.trunc(e.width);
|
|
2647
2647
|
return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
|
|
2648
2648
|
}
|
|
2649
2649
|
function sn(e, t) {
|
|
@@ -2654,23 +2654,23 @@ function cn(e, t) {
|
|
|
2654
2654
|
return Math.floor(t) - on(e.styles.padding, n);
|
|
2655
2655
|
}
|
|
2656
2656
|
function* ln(e, t) {
|
|
2657
|
-
for (let n of e)
|
|
2657
|
+
for (let n of e) N(n) ? yield* ln(n.children, sn(t, n.styles.padding)) : yield {
|
|
2658
2658
|
block: n,
|
|
2659
|
-
bandWidth:
|
|
2659
|
+
bandWidth: I(n) && n.wrapper ? sn(t, n.wrapper.padding) : t
|
|
2660
2660
|
};
|
|
2661
2661
|
}
|
|
2662
|
-
function un(e, t, n =
|
|
2662
|
+
function un(e, t, n = L(e)) {
|
|
2663
2663
|
if (!t) return e;
|
|
2664
2664
|
try {
|
|
2665
|
-
return
|
|
2665
|
+
return oe(H(t, n, { missing: "default" }), e);
|
|
2666
2666
|
} catch {
|
|
2667
2667
|
return e;
|
|
2668
2668
|
}
|
|
2669
2669
|
}
|
|
2670
2670
|
function dn(e, t, n, r) {
|
|
2671
2671
|
let i = un(e, n, r);
|
|
2672
|
-
for (let { block: e, bandWidth: n } of ln(i.blocks, i.settings.width)) if (
|
|
2673
|
-
let r =
|
|
2672
|
+
for (let { block: e, bandWidth: n } of ln(i.blocks, i.settings.width)) if (I(e)) {
|
|
2673
|
+
let r = ie(e)?.applied ? void 0 : e.border, i = Math.floor(n) - on(e.styles.padding, r), a = an[e.columns] ?? [100];
|
|
2674
2674
|
for (let n = 0; n < e.children.length; n++) {
|
|
2675
2675
|
let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
|
|
2676
2676
|
if (o) return cn(o, r);
|
|
@@ -2684,14 +2684,14 @@ function fn(e, t, n, r) {
|
|
|
2684
2684
|
return null;
|
|
2685
2685
|
}
|
|
2686
2686
|
function pn(e) {
|
|
2687
|
-
let t =
|
|
2687
|
+
let t = I(e) ? ie(e) : null;
|
|
2688
2688
|
return !!t?.applied && t.height === "image";
|
|
2689
2689
|
}
|
|
2690
2690
|
function mn(e, t, n, r) {
|
|
2691
2691
|
if (pn(e)) return (t ? fn(t, e.id, n, r) : null) ?? nn(t?.settings);
|
|
2692
2692
|
}
|
|
2693
2693
|
// src/constants/socialIcons.ts
|
|
2694
|
-
var hn =
|
|
2694
|
+
var hn = ae, gn = {
|
|
2695
2695
|
small: 24,
|
|
2696
2696
|
medium: 32,
|
|
2697
2697
|
large: 48
|
|
@@ -2717,4 +2717,4 @@ var hn = ie, gn = {
|
|
|
2717
2717
|
];
|
|
2718
2718
|
export { Dt as A, Be as B, Vt as C, Mt as D, Nt as E, Ge as F, We as I, He as L, wt as M, ut as N, jt as O, Ke as P, Ue as R, zt as S, It as T, Ie as V, Kt as _, pn as a, Ht as b, rn as c, Qt as d, Zt as f, qt as g, Jt as h, dn as i, Tt as j, At as k, nn as l, Xt as m, hn as n, mn as o, Yt as p, _n as r, fn as s, gn as t, tn as u, Wt as v, Bt as w, Ft as x, Ut as y, Ve as z };
|
|
2719
2719
|
|
|
2720
|
-
//# sourceMappingURL=socialIcons-
|
|
2720
|
+
//# sourceMappingURL=socialIcons-kYhdXJ9P.js.map
|