@templatical/editor 0.52.0 → 0.52.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/dist/{AiAltTextPopover-Cm11CsKH.js → AiAltTextPopover-DawbUywc.js} +13 -13
- package/dist/{AiAltTextReview-DE8t8Rud.js → AiAltTextReview-9ySsXOTU.js} +22 -22
- package/dist/{AiChatPanel-7ftS7d40.js → AiChatPanel-CupPhmsN.js} +137 -137
- package/dist/{AiPanels-CxGp6klr.js → AiPanels-DqT4PgQ0.js} +4 -4
- package/dist/{AiRewriteMenu-DNI-5CUj.js → AiRewriteMenu-28agTycW.js} +62 -62
- package/dist/BlockIssueBadge-BxpDy3u-.js +33 -0
- package/dist/{BlockPreviewCanvas-Df9iz7sK.js → BlockPreviewCanvas-B-4bmJ3t.js} +23 -23
- package/dist/{CloudHeaderExtras-CsgyNNV1.js → CloudHeaderExtras-QI82yF54.js} +3 -3
- package/dist/{CloudPanels-BDV4XQ_l.js → CloudPanels-BKJaLkUN.js} +50 -50
- package/dist/{CollaborationNotices-JQ3vQoqO.js → CollaborationNotices-CTw4JThq.js} +11 -11
- package/dist/{CollaboratorBar-EeqqWcX6.js → CollaboratorBar-CXQqN3VP.js} +15 -15
- package/dist/{CommentsPanel-BuftXc0U.js → CommentsPanel-DwwFuh1h.js} +2 -2
- package/dist/CommentsSidebar-9ZfiC2DO.js +500 -0
- package/dist/{CountdownBlock-BT3ZTH1F.js → CountdownBlock-CU2yTWtF.js} +20 -20
- package/dist/{CountdownToolbar-CrL4WKy9.js → CountdownToolbar-BqoYzf_6.js} +53 -53
- package/dist/IssuesPanel-4ykrf1ax.js +359 -0
- package/dist/{LoadingTrack-DZA5AoP9.js → LoadingTrack-DM4g6j7b.js} +1 -1
- package/dist/{LogicTagInsertButton-CSD9cfJB.js → LogicTagInsertButton-CfscnwCn.js} +234 -234
- package/dist/{MediaEditModal-DQl5w44r.js → MediaEditModal-Dy08GEwE.js} +446 -446
- package/dist/{MediaPanels-BFWYuJot.js → MediaPanels-BgEp7iCp.js} +2 -2
- package/dist/{MergeTagInput-DE7kWwXx.js → MergeTagInput-B9dtUthD.js} +11 -11
- package/dist/{MergeTagModeToggle-DvD0ne7N.js → MergeTagModeToggle-DxujhYJ4.js} +30 -30
- package/dist/{MergeTagTextarea-DVPQkiYY.js → MergeTagTextarea-CPFEjJZd.js} +11 -11
- package/dist/{ParagraphEditor-D-nqs82g.js → ParagraphEditor-CWXfurGh.js} +201 -201
- package/dist/{RestoreVersionDialog-DqUPsLB9.js → RestoreVersionDialog-C4s_JYCx.js} +14 -14
- package/dist/{RichTextEditorContent-Xq9D0Zs3.js → RichTextEditorContent-o6HmE8GR.js} +40 -39
- package/dist/{SaveBlockDialog-DAPv70p4.js → SaveBlockDialog-CWLrly6l.js} +56 -56
- package/dist/SavedBlocksBrowserModal-CE8n4EBS.js +359 -0
- package/dist/{SavedBlocksPanels-ChbL9v9x.js → SavedBlocksPanels-BE1N9rNZ.js} +6 -6
- package/dist/{SavedBlocksPickBar-hRaiLNdu.js → SavedBlocksPickBar-Dwl94xhP.js} +12 -12
- package/dist/{TemplateSettings-D0XcH32O.js → TemplateSettings-CS0f1Ues.js} +74 -74
- package/dist/{TestEmailModal-Cb5t0yB2.js → TestEmailModal-DBD0X5nV.js} +52 -52
- package/dist/{TestEmailPanel-COJQa2A9.js → TestEmailPanel-DaFjP9QK.js} +2 -2
- package/dist/{TitleEditor-BYk_9SpQ.js → TitleEditor-DSqtle77.js} +75 -75
- package/dist/{ToggleSwitch-poGWbduy.js → ToggleSwitch-JykPyD_8.js} +4 -4
- package/dist/{Toolbar-Dku_pZni.js → Toolbar-BZPFfKrf.js} +913 -913
- package/dist/{TplModal-9IndEYk5.js → TplModal-DLMssVlt.js} +15 -15
- package/dist/{VersionHistoryMenu-BG5qayvg.js → VersionHistoryMenu-BkbYUs0Q.js} +35 -35
- package/dist/{VersionHistoryPanels-hPg7Q5-f.js → VersionHistoryPanels-DP7HaYWv.js} +4 -4
- package/dist/{VersionPreviewBanner-CSs7zum_.js → VersionPreviewBanner-DECaBwLq.js} +9 -9
- package/dist/{WrapperBlock-DwjK_IdJ.js → WrapperBlock-BsJv_Fiw.js} +16 -16
- package/dist/{blockTypeIcons-yt7SLzub.js → blockTypeIcons-BHjlPnPf.js} +23 -22
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiAltTextPopover-DjMoJCgU.js → AiAltTextPopover-SEEjkd-I.js} +21 -21
- package/dist/cdn/chunks/{AiAltTextPopover-DjMoJCgU.js.map → AiAltTextPopover-SEEjkd-I.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js → AiAltTextReview-BGLLSKLm.js} +41 -41
- package/dist/cdn/chunks/{AiAltTextReview-BafAtBoA.js.map → AiAltTextReview-BGLLSKLm.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-DXeZgc7D.js → AiChatPanel-DKDAaBNi.js} +127 -127
- package/dist/cdn/chunks/{AiChatPanel-DXeZgc7D.js.map → AiChatPanel-DKDAaBNi.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js → AiPanels-0wBarZSH.js} +3 -3
- package/dist/cdn/chunks/{AiPanels-B4uAVRoO.js.map → AiPanels-0wBarZSH.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js → AiRewriteMenu-qf-cfEpy.js} +43 -43
- package/dist/cdn/chunks/{AiRewriteMenu-4F6vwhJ5.js.map → AiRewriteMenu-qf-cfEpy.js.map} +1 -1
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +34 -0
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +1 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js → BlockPreviewCanvas-DGBh6mqe.js} +20 -20
- package/dist/cdn/chunks/{BlockPreviewCanvas-Ny1X_mee.js.map → BlockPreviewCanvas-DGBh6mqe.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js → CloudHeaderExtras-BMNK_F9p.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-DtMORiLS.js.map → CloudHeaderExtras-BMNK_F9p.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js → CloudPanels-JMWIoVWh.js} +32 -32
- package/dist/cdn/chunks/{CloudPanels-BkmLc2Fl.js.map → CloudPanels-JMWIoVWh.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-Hf8r08Sw.js → CollaborationNotices-Bsf1rGW9.js} +12 -12
- package/dist/cdn/chunks/{CollaborationNotices-Hf8r08Sw.js.map → CollaborationNotices-Bsf1rGW9.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js → CollaboratorBar-CXByAoUz.js} +14 -14
- package/dist/cdn/chunks/{CollaboratorBar-II8eYtKu.js.map → CollaboratorBar-CXByAoUz.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js → CommentsPanel-DoJnKLXI.js} +3 -3
- package/dist/cdn/chunks/{CommentsPanel-CAiwilM2.js.map → CommentsPanel-DoJnKLXI.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-Dj8sDiLN.js → CommentsSidebar-CUtgvdBC.js} +100 -99
- package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js → CountdownBlock-BqRw147R.js} +18 -18
- package/dist/cdn/chunks/{CountdownBlock-Dyr5P0IP.js.map → CountdownBlock-BqRw147R.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CguFJdqn.js → CountdownToolbar-xobieKoU.js} +26 -26
- package/dist/cdn/chunks/{CountdownToolbar-CguFJdqn.js.map → CountdownToolbar-xobieKoU.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js → IssuesPanel-C7LfxaAY.js} +75 -75
- package/dist/cdn/chunks/{IssuesPanel-pr7_nuLI.js.map → IssuesPanel-C7LfxaAY.js.map} +1 -1
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js → LoadingTrack-CZuLTazv.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DfJ_C33G.js.map → LoadingTrack-CZuLTazv.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js → LogicTagInsertButton-BIi05UQu.js} +250 -250
- package/dist/cdn/chunks/{LogicTagInsertButton-B_ldj3TO.js.map → LogicTagInsertButton-BIi05UQu.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js → MediaEditModal-Cpcod6_U.js} +148 -148
- package/dist/cdn/chunks/{MediaEditModal-CGfzcHwP.js.map → MediaEditModal-Cpcod6_U.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js → MediaPanels-BIdcW_1f.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-D0BdxdqP.js.map → MediaPanels-BIdcW_1f.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js → MergeTagInput-BvWg8o5E.js} +32 -32
- package/dist/cdn/chunks/{MergeTagInput-CFu9VXPS.js.map → MergeTagInput-BvWg8o5E.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js → MergeTagModeToggle-BgKEVUtV.js} +27 -27
- package/dist/cdn/chunks/{MergeTagModeToggle-BFpK5dxg.js.map → MergeTagModeToggle-BgKEVUtV.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-Zo0mYWbf.js → MergeTagTextarea-tBz8McZf.js} +32 -32
- package/dist/cdn/chunks/{MergeTagTextarea-Zo0mYWbf.js.map → MergeTagTextarea-tBz8McZf.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DsPLVAgm.js → ParagraphEditor-B3Rj_cWF.js} +191 -191
- package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js → RestoreVersionDialog-CjOdD2xj.js} +19 -19
- package/dist/cdn/chunks/{RestoreVersionDialog-B866zFP0.js.map → RestoreVersionDialog-CjOdD2xj.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js → RichTextEditorContent-DNjR_sNN.js} +29 -29
- package/dist/cdn/chunks/{RichTextEditorContent-DaY63kye.js.map → RichTextEditorContent-DNjR_sNN.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js → SaveBlockDialog-CUhpawq0.js} +75 -75
- package/dist/cdn/chunks/{SaveBlockDialog-B7nftAAS.js.map → SaveBlockDialog-CUhpawq0.js.map} +1 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js +356 -0
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-B9XCjDfm.js.map → SavedBlocksBrowserModal-BPYcRoGa.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js → SavedBlocksPanels-C6--Bc81.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-C3nK90pz.js.map → SavedBlocksPanels-C6--Bc81.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js → SavedBlocksPickBar-DUavxpbU.js} +14 -14
- package/dist/cdn/chunks/{SavedBlocksPickBar-B166Mek9.js.map → SavedBlocksPickBar-DUavxpbU.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-jWpmuWDR.js → TemplateSettings-CKtI-dof.js} +69 -69
- package/dist/cdn/chunks/{TemplateSettings-jWpmuWDR.js.map → TemplateSettings-CKtI-dof.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js → TestEmailModal-CDQTgESD.js} +65 -65
- package/dist/cdn/chunks/{TestEmailModal-DcwKhFnI.js.map → TestEmailModal-CDQTgESD.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js → TestEmailPanel-CcUpEpAn.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-BDBAvAfI.js.map → TestEmailPanel-CcUpEpAn.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-R2lQw6WA.js → TitleEditor-Cob7RLyK.js} +70 -70
- package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +1 -0
- package/dist/cdn/chunks/{ToggleSwitch-BDMugNES.js → ToggleSwitch-J7Vwhvha.js} +5 -5
- package/dist/cdn/chunks/{ToggleSwitch-BDMugNES.js.map → ToggleSwitch-J7Vwhvha.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-CnvfW72e.js → Toolbar-CdpsvNOR.js} +893 -893
- package/dist/cdn/chunks/{Toolbar-CnvfW72e.js.map → Toolbar-CdpsvNOR.js.map} +1 -1
- package/dist/cdn/chunks/TplModal-CFPDgbwQ.js +51 -0
- package/dist/cdn/chunks/{TplModal-BDyeS69p.js.map → TplModal-CFPDgbwQ.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js → VersionHistoryMenu-BYlLRvRJ.js} +32 -32
- package/dist/cdn/chunks/{VersionHistoryMenu-CmpgUI4Q.js.map → VersionHistoryMenu-BYlLRvRJ.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js → VersionHistoryPanels-C6SOVoiT.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-DB_FZyyg.js.map → VersionHistoryPanels-C6SOVoiT.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-CZ--HOoa.js → VersionPreviewBanner-Dvg0ZfAW.js} +10 -10
- package/dist/cdn/chunks/{VersionPreviewBanner-CZ--HOoa.js.map → VersionPreviewBanner-Dvg0ZfAW.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-D3obNGab.js → WrapperBlock-C7Md56IT.js} +13 -13
- package/dist/cdn/chunks/{WrapperBlock-D3obNGab.js.map → WrapperBlock-C7Md56IT.js.map} +1 -1
- package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js +21 -0
- package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js → createCloudRuntime-Cth2JCEh.js} +36 -36
- package/dist/cdn/chunks/{createCloudRuntime-D6niZ2Rc.js.map → createCloudRuntime-Cth2JCEh.js.map} +1 -1
- package/dist/cdn/chunks/{dist-C2epoAwW.js → dist-8ym3y-pH.js} +43 -43
- package/dist/cdn/chunks/{dist-C2epoAwW.js.map → dist-8ym3y-pH.js.map} +1 -1
- package/dist/{dist-BA-jTQgw.js → cdn/chunks/dist-BMzNabtD.js} +106 -107
- package/dist/cdn/chunks/{dist-CONcGNwy.js.map → dist-BMzNabtD.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-B8hTTYFO.js → draggable-Du8AUMFT.js} +639 -636
- package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js → editor-modal-CyCe560f.js} +891 -891
- package/dist/cdn/chunks/{editor-modal-cvYkpbHD.js.map → editor-modal-CyCe560f.js.map} +1 -1
- package/dist/cdn/chunks/en-TIqv4ag3.js +1 -0
- package/dist/cdn/chunks/{extensions-ClDhn88e.js → extensions-CFF2KWy-.js} +55 -55
- package/dist/cdn/chunks/{extensions-ClDhn88e.js.map → extensions-CFF2KWy-.js.map} +1 -1
- package/dist/cdn/chunks/{icons-HCBP93Ch.js → icons-okSPsLOa.js} +99 -97
- package/dist/cdn/chunks/icons-okSPsLOa.js.map +1 -0
- package/dist/cdn/chunks/{keys-BF9gazbd.js → keys-CUj6UA38.js} +2 -2
- package/dist/cdn/chunks/{keys-BF9gazbd.js.map → keys-CUj6UA38.js.map} +1 -1
- package/dist/cdn/chunks/{liquid.browser-DkLBNrft.js → liquid.browser-rubac0VA.js} +782 -746
- package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-DpHCSESZ.js → normalizeMergeTagMarkup-C_KlfSW4.js} +2 -2
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-DpHCSESZ.js.map → normalizeMergeTagMarkup-C_KlfSW4.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js → preRenderCustomBlocks-BcXIz7oJ.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-D-dsBq5t.js.map → preRenderCustomBlocks-BcXIz7oJ.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-B2h15u0_.js → sanitizeHtml-CN85EDrO.js} +2 -2
- package/dist/cdn/chunks/{sanitizeHtml-B2h15u0_.js.map → sanitizeHtml-CN85EDrO.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-rJoqO1TJ.js → socialIcons-jsTDmkbb.js} +480 -480
- package/dist/cdn/chunks/{socialIcons-rJoqO1TJ.js.map → socialIcons-jsTDmkbb.js.map} +1 -1
- package/dist/cdn/chunks/{src-CUH_EI7k.js → src-C7bkofBL.js} +6 -6
- package/dist/cdn/chunks/{src-CUH_EI7k.js.map → src-C7bkofBL.js.map} +1 -1
- package/dist/cdn/chunks/{src-BKpAis_q.js → src-DEd87i_U.js} +2 -2
- package/dist/cdn/chunks/{src-BKpAis_q.js.map → src-DEd87i_U.js.map} +1 -1
- package/dist/cdn/chunks/{src-C9DTvn1H.js → src-DwWrYnUj.js} +3 -22
- package/dist/cdn/chunks/src-DwWrYnUj.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js → tiptap-CbiTlECY.js} +45 -45
- package/dist/cdn/chunks/{tiptap-ChSZybTi.js.map → tiptap-CbiTlECY.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js → useCloudI18n-DY8_-ETE.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-RJXyVnIf.js.map → useCloudI18n-DY8_-ETE.js.map} +1 -1
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +2582 -0
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +1 -0
- package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-BT3c9CXj.js.map → useEditorRoot-vjZJwKrV.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js → useI18n-D8pY4LTq.js} +3 -3
- package/dist/cdn/chunks/{useI18n-11iqzC6m.js.map → useI18n-D8pY4LTq.js.map} +1 -1
- package/dist/{useLogicTag-DFDYJeMN.js → cdn/chunks/useLogicTag-DBJDtpKA.js} +5 -3
- package/dist/cdn/chunks/{useLogicTag-vy5KGg5D.js.map → useLogicTag-DBJDtpKA.js.map} +1 -1
- package/dist/{useMergeTag-B46vACAG.js → cdn/chunks/useMergeTag-B-aG--s1.js} +7 -5
- package/dist/cdn/chunks/{useMergeTag-BFBBjnwh.js.map → useMergeTag-B-aG--s1.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-AnVIwiVv.js → usePopoverPosition-DSMtmu2W.js} +4 -4
- package/dist/cdn/chunks/{usePopoverPosition-AnVIwiVv.js.map → usePopoverPosition-DSMtmu2W.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js → useScrollToBlock-vjQ0fe-L.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-C0dawxGr.js.map → useScrollToBlock-vjQ0fe-L.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js → withCurrentFont-hZTvYBHO.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-C3CquBQN.js.map → withCurrentFont-hZTvYBHO.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1422 -1422
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-N3x4z_rH.js → check-BZ8o0eet.js} +1 -1
- package/dist/{chevron-down-gXu9qNwO.js → chevron-down-DfAAfILv.js} +1 -1
- package/dist/{chevron-right-rL0ayGk5.js → chevron-right-Bk4mGdr7.js} +1 -1
- package/dist/{chevron-up-0ugh8HnW.js → chevron-up-MhUf_azW.js} +1 -1
- package/dist/{circle-alert-B9Ls75B5.js → circle-alert-CShJwVFv.js} +1 -1
- package/dist/{clock-BqHBaCLm.js → clock-CTfD6OCt.js} +1 -1
- package/dist/{createCloudRuntime-B5VIdnwz.js → createCloudRuntime-DCgO4A1r.js} +24 -24
- package/dist/{createLucideIcon-BV7Gwz_Z.js → createLucideIcon-CvhTA2KG.js} +6 -6
- package/dist/{cdn/chunks/dist-CONcGNwy.js → dist-ByCWA2Tv.js} +100 -99
- package/dist/{dist-CzrLYq2s.js → dist-CKi_npZM.js} +2 -21
- package/dist/{dist-CEdyyDn7.js → dist-CVy-7PHQ.js} +54 -54
- package/dist/{dist-DDN7yR-w.js → dist-D6cMdrfG.js} +129 -129
- package/dist/{editor-modal-Du9VI9q4.js → editor-modal-zaZHcmlO.js} +812 -812
- package/dist/en-Db76vJbY.js +1 -0
- package/dist/{extensions-FRYhx7qa.js → extensions-fo_c-vqf.js} +32 -32
- package/dist/{eye-BKj9Tfnc.js → eye-7W4t5e0Q.js} +1 -1
- package/dist/{image-DNdvdTla.js → image-BDiRFzSd.js} +1 -1
- package/dist/{info-Bx-kBkbH.js → info-Cxi3-Kh9.js} +1 -1
- package/dist/{keys-DBjrQkYH.js → keys-BgRERHzu.js} +1 -1
- package/dist/{link-D8-rYdIQ.js → link-ju_2Cmir.js} +1 -1
- package/dist/{liquid.browser-D1RxawkY.js → liquid.browser-DUXEekoN.js} +781 -745
- package/dist/{list-BneisA27.js → list-DYZJf0aZ.js} +1 -1
- package/dist/{loader-circle-DBEXphyx.js → loader-circle-BZRD0a4I.js} +1 -1
- package/dist/{message-circle-Bg4xInCM.js → message-circle-DuEw4Zfx.js} +1 -1
- package/dist/{normalizeMergeTagMarkup-IH8COHzd.js → normalizeMergeTagMarkup-CELnOlgK.js} +1 -1
- package/dist/{package-B40Vkfsp.js → package-CePMr2kK.js} +1 -1
- package/dist/{pencil-CYdAHTds.js → pencil-D3aFCL7c.js} +1 -1
- package/dist/{preRenderCustomBlocks-AbZArwkR.js → preRenderCustomBlocks--_xc0XK3.js} +1 -1
- package/dist/{refresh-cw-Bb1FWrU0.js → refresh-cw-xnro7_Sk.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-CLGymEyk.js → runtime-dom.esm-bundler-BURR-bj5.js} +118 -118
- package/dist/{sanitizeHtml-CnOA1efV.js → sanitizeHtml-BzfzpYJY.js} +1 -1
- package/dist/{search-BZEo08gi.js → search-CDrstRBv.js} +1 -1
- package/dist/{send-DHtrnXQs.js → send-DROkPOaX.js} +1 -1
- package/dist/{smartphone-dlN3vpA3.js → smartphone-Bx6u_tjn.js} +1 -1
- package/dist/{socialIcons-B_d52_eS.js → socialIcons-D7MGsg0d.js} +366 -366
- package/dist/{sparkles-NOttoDnJ.js → sparkles-CdaTtvoz.js} +1 -1
- package/dist/{square-B1CJgdt2.js → square-BbCROH_f.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +1096 -1096
- package/dist/{text-align-start-zpoXmb-Z.js → text-align-start-CGacJ9Vw.js} +1 -1
- package/dist/{trash-CGbk4Sgt.js → trash-DxCd7zIy.js} +1 -1
- package/dist/{triangle-alert-CKLMyGVp.js → triangle-alert-7_oaitpf.js} +1 -1
- package/dist/{upload-DQoackAn.js → upload-DuFEOi_0.js} +1 -1
- package/dist/{useCloudI18n-DcLtxOQZ.js → useCloudI18n-DEMmUKuO.js} +2 -2
- package/dist/{useEditorCore-DG9UvWUm.js → useEditorCore-BSo2sSID.js} +1518 -1470
- package/dist/useEditorRoot-BMcoCLBx.js +7 -0
- package/dist/{useI18n-CeTm777E.js → useI18n-BBrHTdu8.js} +2 -2
- package/dist/{cdn/chunks/useLogicTag-vy5KGg5D.js → useLogicTag-ZPC39rfH.js} +3 -5
- package/dist/{cdn/chunks/useMergeTag-BFBBjnwh.js → useMergeTag-BQ4qqWpQ.js} +5 -7
- package/dist/{usePopoverPosition-C42kD7zt.js → usePopoverPosition-DV1PxL66.js} +3 -3
- package/dist/{useScrollToBlock-C-NzvjeO.js → useScrollToBlock-BSyAV4pk.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-CrlI8j5R.js → vue.runtime.esm-bundler-CnEeTfhs.js} +993 -990
- package/dist/{withCurrentFont-v_a4Oso8.js → withCurrentFont-B22FXAF5.js} +1 -1
- package/dist/{x-zcrnmcmU.js → x-BpfG7v9g.js} +1 -1
- package/package.json +10 -10
- package/dist/BlockIssueBadge-6Ri2FfX-.js +0 -33
- package/dist/CommentsSidebar-Co3x4uH0.js +0 -499
- package/dist/IssuesPanel-BHFQ3wrP.js +0 -359
- package/dist/SavedBlocksBrowserModal-SRtN5h9q.js +0 -359
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js +0 -34
- package/dist/cdn/chunks/BlockIssueBadge-DIJDqqcY.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-Dj8sDiLN.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-DsPLVAgm.js.map +0 -1
- package/dist/cdn/chunks/SavedBlocksBrowserModal-B9XCjDfm.js +0 -356
- package/dist/cdn/chunks/TitleEditor-R2lQw6WA.js.map +0 -1
- package/dist/cdn/chunks/TplModal-BDyeS69p.js +0 -51
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js +0 -21
- package/dist/cdn/chunks/blockTypeIcons-DFf7AyqI.js.map +0 -1
- package/dist/cdn/chunks/draggable-B8hTTYFO.js.map +0 -1
- package/dist/cdn/chunks/en-CKAXAo3Z.js +0 -1
- package/dist/cdn/chunks/icons-HCBP93Ch.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-DkLBNrft.js.map +0 -1
- package/dist/cdn/chunks/src-C9DTvn1H.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-CjaEV_01.js +0 -2534
- package/dist/cdn/chunks/useEditorCore-CjaEV_01.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-BT3c9CXj.js +0 -9
- package/dist/en-CyEE7FPY.js +0 -1
- package/dist/useEditorRoot-BKr6nNkC.js +0 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as e, C as t, D as n,
|
|
2
|
-
import { A as C, Ct as w, Dt as T, Et as E, Ft as D, Kt as O, N as k, O as A, Ot as j, P as M, St as N, Tt as P, Z as ee, et as F, ft as I, k as L, kt as R, n as z, r as B, wt as V, xt as H, yt as U } from "./src-
|
|
3
|
-
import { r as W } from "./dist-
|
|
4
|
-
import { L as G, P as te, c as ne, x as K } from "./keys-
|
|
5
|
-
import { t as re } from "./useI18n-
|
|
6
|
-
import { o as ie, s as q } from "./usePopoverPosition-
|
|
7
|
-
import { at as ae, s as oe } from "./icons-
|
|
1
|
+
import { $ as e, C as t, D as n, J as r, K as i, P as a, Q as o, V as s, Z as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, ft as h, j as g, nt as _, p as v, st as y, u as b, ut as x, x as S } from "./draggable-Du8AUMFT.js";
|
|
2
|
+
import { A as C, Ct as w, Dt as T, Et as E, Ft as D, Kt as O, N as k, O as A, Ot as j, P as M, St as N, Tt as P, Z as ee, et as F, ft as I, k as L, kt as R, n as z, r as B, wt as V, xt as H, yt as U } from "./src-DwWrYnUj.js";
|
|
3
|
+
import { r as W } from "./dist-BMzNabtD.js";
|
|
4
|
+
import { L as G, P as te, c as ne, x as K } from "./keys-CUj6UA38.js";
|
|
5
|
+
import { t as re } from "./useI18n-D8pY4LTq.js";
|
|
6
|
+
import { o as ie, s as q } from "./usePopoverPosition-DSMtmu2W.js";
|
|
7
|
+
import { at as ae, s as oe } from "./icons-okSPsLOa.js";
|
|
8
8
|
// ../core/src/error-reporting.ts
|
|
9
9
|
function se(e) {
|
|
10
10
|
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
@@ -20,7 +20,7 @@ function J(e, t) {
|
|
|
20
20
|
function ce(t) {
|
|
21
21
|
let n = t.content ?? F(t.defaultFontFamily, t.templateDefaults);
|
|
22
22
|
L(n), C(n);
|
|
23
|
-
let
|
|
23
|
+
let r = o({
|
|
24
24
|
template: null,
|
|
25
25
|
content: n,
|
|
26
26
|
selectedBlockId: null,
|
|
@@ -31,28 +31,28 @@ function ce(t) {
|
|
|
31
31
|
isSaving: !1,
|
|
32
32
|
isLoading: !1,
|
|
33
33
|
uiTheme: "auto"
|
|
34
|
-
}),
|
|
35
|
-
function
|
|
36
|
-
|
|
34
|
+
}), a = m(0), s = 0, c = 0;
|
|
35
|
+
function l() {
|
|
36
|
+
r.isDirty = !0, c++;
|
|
37
37
|
}
|
|
38
|
-
let
|
|
39
|
-
get: () =>
|
|
38
|
+
let u = i({
|
|
39
|
+
get: () => r.content,
|
|
40
40
|
set: (e) => {
|
|
41
|
-
|
|
41
|
+
r.content = e, l();
|
|
42
42
|
}
|
|
43
|
-
}),
|
|
44
|
-
function
|
|
43
|
+
}), d = i(() => r.selectedBlockId ? f(r.content.blocks, r.selectedBlockId) : null);
|
|
44
|
+
function f(e, t) {
|
|
45
45
|
for (let n of e) {
|
|
46
46
|
if (n.id === t) return n;
|
|
47
47
|
if (n.type === "section") for (let e of n.children) {
|
|
48
|
-
let n =
|
|
48
|
+
let n = f(e, t);
|
|
49
49
|
if (n) return n;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n)
|
|
54
|
+
function p(e, t) {
|
|
55
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) p(e, t);
|
|
56
56
|
}
|
|
57
57
|
function h(e, t, n = { blocks: e }) {
|
|
58
58
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -73,7 +73,7 @@ function ce(t) {
|
|
|
73
73
|
return t.lockedBlocks?.value.has(e) ?? !1;
|
|
74
74
|
}
|
|
75
75
|
function _(e) {
|
|
76
|
-
let t = h(
|
|
76
|
+
let t = h(r.content.blocks, e);
|
|
77
77
|
if (!t) return null;
|
|
78
78
|
let n = t.blocks.findIndex((t) => t.id === e);
|
|
79
79
|
return n === -1 ? null : {
|
|
@@ -83,85 +83,85 @@ function ce(t) {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
function v(e, t = !0) {
|
|
86
|
-
L(e), C(e),
|
|
86
|
+
L(e), C(e), r.content = e, t && l();
|
|
87
87
|
}
|
|
88
88
|
function y(e) {
|
|
89
|
-
e && g(e) || (
|
|
89
|
+
e && g(e) || (r.selectedBlockId = e);
|
|
90
90
|
}
|
|
91
91
|
function b(e) {
|
|
92
|
-
|
|
92
|
+
r.viewport = e;
|
|
93
93
|
}
|
|
94
94
|
function x(e) {
|
|
95
|
-
|
|
95
|
+
r.darkMode = e;
|
|
96
96
|
}
|
|
97
97
|
function S(e) {
|
|
98
|
-
|
|
98
|
+
r.uiTheme = e;
|
|
99
99
|
}
|
|
100
100
|
function w(e) {
|
|
101
|
-
|
|
101
|
+
r.previewMode = e, e && (r.selectedBlockId = null);
|
|
102
102
|
}
|
|
103
103
|
function T(e, t) {
|
|
104
104
|
if (g(e)) return;
|
|
105
|
-
let n =
|
|
106
|
-
n && (Object.assign(n, t),
|
|
105
|
+
let n = f(r.content.blocks, e);
|
|
106
|
+
n && (Object.assign(n, t), l());
|
|
107
107
|
}
|
|
108
108
|
function D(e) {
|
|
109
|
-
|
|
110
|
-
...
|
|
109
|
+
r.content.settings = {
|
|
110
|
+
...r.content.settings,
|
|
111
111
|
...e
|
|
112
|
-
},
|
|
112
|
+
}, l();
|
|
113
113
|
}
|
|
114
|
-
function O(e, t, n = 0,
|
|
114
|
+
function O(e, t, n = 0, i) {
|
|
115
115
|
let a = {
|
|
116
|
-
settings:
|
|
116
|
+
settings: r.content.settings,
|
|
117
117
|
blocks: [e]
|
|
118
118
|
};
|
|
119
119
|
if (L(a), C(a), !(t && e.type === "section")) {
|
|
120
120
|
if (t) {
|
|
121
121
|
if (g(t)) return;
|
|
122
|
-
let a =
|
|
122
|
+
let a = f(r.content.blocks, t);
|
|
123
123
|
if (a && a.type === "section") {
|
|
124
124
|
if (n < 0 || n >= E(a.columns)) return;
|
|
125
125
|
a.children[n] = a.children[n] || [];
|
|
126
126
|
let t = a.children[n];
|
|
127
|
-
|
|
127
|
+
i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
|
|
128
128
|
}
|
|
129
|
-
} else
|
|
130
|
-
|
|
129
|
+
} else i !== void 0 && i < r.content.blocks.length ? r.content.blocks.splice(i, 0, e) : r.content.blocks.push(e);
|
|
130
|
+
l();
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
function k(e) {
|
|
134
134
|
if (g(e)) return;
|
|
135
|
-
let t = h(
|
|
135
|
+
let t = h(r.content.blocks, e);
|
|
136
136
|
if (t) {
|
|
137
137
|
let n = t.blocks.findIndex((t) => t.id === e);
|
|
138
138
|
if (n !== -1) {
|
|
139
139
|
let [e] = t.blocks.splice(n, 1);
|
|
140
|
-
if (
|
|
140
|
+
if (r.selectedBlockId) {
|
|
141
141
|
let t = /* @__PURE__ */ new Set();
|
|
142
|
-
|
|
142
|
+
p(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
l();
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
function A(e, t, n,
|
|
148
|
+
function A(e, t, n, i = 0) {
|
|
149
149
|
if (g(e) || n && g(n)) return;
|
|
150
|
-
let a = h(
|
|
150
|
+
let a = h(r.content.blocks, e);
|
|
151
151
|
if (!a) return;
|
|
152
152
|
let o = a.blocks.findIndex((t) => t.id === e);
|
|
153
153
|
if (o === -1 || n && a.blocks[o].type === "section") return;
|
|
154
154
|
let s;
|
|
155
155
|
if (n) {
|
|
156
|
-
let e =
|
|
157
|
-
if (!e || e.type !== "section" ||
|
|
158
|
-
e.children[
|
|
159
|
-
} else s =
|
|
156
|
+
let e = f(r.content.blocks, n);
|
|
157
|
+
if (!e || e.type !== "section" || i < 0 || i >= E(e.columns)) return;
|
|
158
|
+
e.children[i] = e.children[i] || [], s = e.children[i];
|
|
159
|
+
} else s = r.content.blocks;
|
|
160
160
|
let [c] = a.blocks.splice(o, 1);
|
|
161
|
-
s.splice(t, 0, c),
|
|
161
|
+
s.splice(t, 0, c), l();
|
|
162
162
|
}
|
|
163
163
|
function j() {
|
|
164
|
-
|
|
164
|
+
l();
|
|
165
165
|
}
|
|
166
166
|
function M(e, t) {
|
|
167
167
|
throw new H(`[Templatical] Templates: ${e} ${t}`);
|
|
@@ -174,78 +174,78 @@ function ce(t) {
|
|
|
174
174
|
return n || M(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
175
175
|
}
|
|
176
176
|
function ee(e) {
|
|
177
|
-
|
|
178
|
-
...
|
|
177
|
+
r.template && (r.template = {
|
|
178
|
+
...r.template,
|
|
179
179
|
name: e
|
|
180
|
-
},
|
|
180
|
+
}, l());
|
|
181
181
|
}
|
|
182
182
|
async function I(e) {
|
|
183
|
-
let n = P("create()"), { create:
|
|
184
|
-
typeof
|
|
185
|
-
let
|
|
186
|
-
|
|
183
|
+
let n = P("create()"), { create: i } = n;
|
|
184
|
+
typeof i != "function" && M("create()", "is disabled by the provider — its `create` is `false`.");
|
|
185
|
+
let o, l = ++s;
|
|
186
|
+
r.isLoading = !0;
|
|
187
187
|
try {
|
|
188
|
-
e?.content && (
|
|
189
|
-
let t =
|
|
190
|
-
|
|
188
|
+
e?.content && (r.content = e.content);
|
|
189
|
+
let t = c;
|
|
190
|
+
o = await i(e?.name === void 0 ? { content: r.content } : {
|
|
191
191
|
name: e.name,
|
|
192
|
-
content:
|
|
193
|
-
}),
|
|
192
|
+
content: r.content
|
|
193
|
+
}), r.template = o, c === t && (r.isDirty = !1), a.value++;
|
|
194
194
|
} catch (e) {
|
|
195
195
|
throw t.onError?.(e), e;
|
|
196
196
|
} finally {
|
|
197
|
-
s ===
|
|
197
|
+
s === l && (r.isLoading = !1);
|
|
198
198
|
}
|
|
199
|
-
return N(() => n.onCreated?.(
|
|
199
|
+
return N(() => n.onCreated?.(o)), o;
|
|
200
200
|
}
|
|
201
201
|
async function R(e, n) {
|
|
202
|
-
let
|
|
203
|
-
|
|
202
|
+
let i = P("load()"), o, c = ++s;
|
|
203
|
+
r.isLoading = !0;
|
|
204
204
|
try {
|
|
205
|
-
if (
|
|
206
|
-
|
|
205
|
+
if (o = await i.load(e), L(o.content), C(o.content), n && !n()) return o;
|
|
206
|
+
r.template = o, r.content = o.content, r.isDirty = !1, a.value++;
|
|
207
207
|
} catch (e) {
|
|
208
208
|
throw t.onError?.(e), e;
|
|
209
209
|
} finally {
|
|
210
|
-
s === c && (
|
|
210
|
+
s === c && (r.isLoading = !1);
|
|
211
211
|
}
|
|
212
|
-
return N(() =>
|
|
212
|
+
return N(() => i.onLoaded?.(o)), o;
|
|
213
213
|
}
|
|
214
214
|
async function z(e = "api") {
|
|
215
|
-
let n = P("save()"), { save:
|
|
216
|
-
typeof
|
|
217
|
-
let a =
|
|
215
|
+
let n = P("save()"), { save: i } = n;
|
|
216
|
+
typeof i != "function" && M("save()", "is disabled by the provider — its `save` is `false`.");
|
|
217
|
+
let a = r.template;
|
|
218
218
|
a || M("save()", "has no template loaded. Call create() or load() first.");
|
|
219
|
-
let o = a.name === void 0 ? { content:
|
|
219
|
+
let o = a.name === void 0 ? { content: r.content } : {
|
|
220
220
|
name: a.name,
|
|
221
|
-
content:
|
|
221
|
+
content: r.content
|
|
222
222
|
}, s;
|
|
223
|
-
|
|
223
|
+
r.isSaving = !0;
|
|
224
224
|
try {
|
|
225
|
-
let e =
|
|
226
|
-
if (s = await
|
|
227
|
-
let e =
|
|
228
|
-
|
|
225
|
+
let e = c;
|
|
226
|
+
if (s = await i(a.id, o), r.template?.id === a.id) {
|
|
227
|
+
let e = r.template.name;
|
|
228
|
+
r.template = e === a.name ? s : {
|
|
229
229
|
...s,
|
|
230
230
|
name: e
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
-
|
|
233
|
+
c === e && (r.isDirty = !1);
|
|
234
234
|
} catch (e) {
|
|
235
235
|
throw t.onError?.(e), e;
|
|
236
236
|
} finally {
|
|
237
|
-
|
|
237
|
+
r.isSaving = !1;
|
|
238
238
|
}
|
|
239
239
|
return N(() => n.onSaved?.(s, { trigger: e })), s;
|
|
240
240
|
}
|
|
241
241
|
function B() {
|
|
242
|
-
return
|
|
242
|
+
return r.template?.id !== void 0;
|
|
243
243
|
}
|
|
244
244
|
return {
|
|
245
|
-
state:
|
|
246
|
-
loadVersion: a
|
|
247
|
-
content:
|
|
248
|
-
selectedBlock:
|
|
245
|
+
state: e(r),
|
|
246
|
+
loadVersion: e(a),
|
|
247
|
+
content: u,
|
|
248
|
+
selectedBlock: d,
|
|
249
249
|
isBlockLocked: g,
|
|
250
250
|
setContent: v,
|
|
251
251
|
selectBlock: y,
|
|
@@ -269,57 +269,57 @@ function ce(t) {
|
|
|
269
269
|
}
|
|
270
270
|
// ../core/src/history.ts
|
|
271
271
|
var le = 50, ue = 300, de = 1500;
|
|
272
|
-
function Y(
|
|
273
|
-
let { content:
|
|
274
|
-
function
|
|
275
|
-
return j(
|
|
272
|
+
function Y(e) {
|
|
273
|
+
let { content: t, setContent: n, maxSize: r = le } = e, a = m([]), o = m([]), s = m(!1), c = null, l = null, u = i(() => a.value.length > 0), d = i(() => o.value.length > 0);
|
|
274
|
+
function f() {
|
|
275
|
+
return j(t.value);
|
|
276
276
|
}
|
|
277
|
-
function
|
|
278
|
-
|
|
277
|
+
function p(e) {
|
|
278
|
+
a.value.push(e), a.value.length > r && a.value.splice(0, a.value.length - r);
|
|
279
279
|
}
|
|
280
280
|
function h() {
|
|
281
|
-
|
|
281
|
+
l &&= (clearTimeout(l.timeoutId), null);
|
|
282
282
|
}
|
|
283
283
|
function g() {
|
|
284
|
-
h(),
|
|
284
|
+
h(), p(f()), o.value = [];
|
|
285
285
|
}
|
|
286
286
|
function _(e) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}, ue)) : (h(),
|
|
287
|
+
l && l.blockId === e ? (clearTimeout(l.timeoutId), l.timeoutId = setTimeout(() => {
|
|
288
|
+
l = null;
|
|
289
|
+
}, ue)) : (h(), p(f()), o.value = [], l = {
|
|
290
290
|
blockId: e,
|
|
291
291
|
timeoutId: setTimeout(() => {
|
|
292
|
-
|
|
292
|
+
l = null;
|
|
293
293
|
}, ue)
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
function v() {
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
|
|
298
|
+
s.value = !1, c = null;
|
|
299
299
|
}, de);
|
|
300
300
|
}
|
|
301
301
|
function y() {
|
|
302
|
-
if (
|
|
302
|
+
if (a.value.length === 0) return;
|
|
303
303
|
h();
|
|
304
|
-
let e =
|
|
305
|
-
|
|
304
|
+
let e = a.value.pop();
|
|
305
|
+
o.value.push(f()), n(e, !0), v();
|
|
306
306
|
}
|
|
307
307
|
function b() {
|
|
308
|
-
if (
|
|
308
|
+
if (o.value.length === 0) return;
|
|
309
309
|
h();
|
|
310
|
-
let e =
|
|
311
|
-
|
|
310
|
+
let e = o.value.pop();
|
|
311
|
+
a.value.push(f()), n(e, !0), v();
|
|
312
312
|
}
|
|
313
313
|
function x() {
|
|
314
|
-
|
|
314
|
+
a.value = [], o.value = [], h();
|
|
315
315
|
}
|
|
316
316
|
function S() {
|
|
317
|
-
x(),
|
|
317
|
+
x(), c &&= (clearTimeout(c), null);
|
|
318
318
|
}
|
|
319
319
|
return {
|
|
320
|
-
canUndo:
|
|
321
|
-
canRedo:
|
|
322
|
-
isNavigating:
|
|
320
|
+
canUndo: u,
|
|
321
|
+
canRedo: d,
|
|
322
|
+
isNavigating: s,
|
|
323
323
|
undo: y,
|
|
324
324
|
redo: b,
|
|
325
325
|
record: g,
|
|
@@ -373,76 +373,76 @@ function X(e) {
|
|
|
373
373
|
function d() {
|
|
374
374
|
o &&= (clearTimeout(o), null);
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function p() {
|
|
377
377
|
d(), n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function m() {
|
|
380
380
|
c() && !s && (d(), o = setTimeout(() => {
|
|
381
381
|
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
382
382
|
}, i));
|
|
383
383
|
}
|
|
384
|
-
let
|
|
385
|
-
|
|
384
|
+
let h = f(t, () => {
|
|
385
|
+
m();
|
|
386
386
|
}, { deep: !0 });
|
|
387
|
-
function
|
|
388
|
-
|
|
387
|
+
function g() {
|
|
388
|
+
h(), d();
|
|
389
389
|
}
|
|
390
390
|
return {
|
|
391
|
-
flush:
|
|
391
|
+
flush: p,
|
|
392
392
|
cancel: d,
|
|
393
393
|
pause: l,
|
|
394
394
|
resume: u,
|
|
395
|
-
destroy:
|
|
395
|
+
destroy: g
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
398
|
// ../core/src/condition-preview.ts
|
|
399
399
|
function me(e) {
|
|
400
|
-
let t =
|
|
401
|
-
function
|
|
400
|
+
let t = o(/* @__PURE__ */ new Set()), n = i(() => t.size > 0);
|
|
401
|
+
function r(e) {
|
|
402
402
|
return t.has(e);
|
|
403
403
|
}
|
|
404
404
|
function a(n) {
|
|
405
405
|
t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function s() {
|
|
408
408
|
t.clear();
|
|
409
409
|
}
|
|
410
410
|
return {
|
|
411
|
-
isHidden:
|
|
411
|
+
isHidden: r,
|
|
412
412
|
toggleBlock: a,
|
|
413
|
-
reset:
|
|
413
|
+
reset: s,
|
|
414
414
|
hasHiddenBlocks: n
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
417
|
// ../core/src/data-source-fetch.ts
|
|
418
|
-
function he(
|
|
419
|
-
let
|
|
420
|
-
async function
|
|
421
|
-
let
|
|
422
|
-
if (
|
|
423
|
-
|
|
418
|
+
function he(e) {
|
|
419
|
+
let t = m(!1), n = m(!1), r = i(() => !!e.definition.value?.dataSource), a = i(() => r.value && !e.block.value.dataSourceFetched);
|
|
420
|
+
async function o() {
|
|
421
|
+
let r = e.definition.value;
|
|
422
|
+
if (r?.dataSource) {
|
|
423
|
+
t.value = !0, n.value = !1;
|
|
424
424
|
try {
|
|
425
|
-
let
|
|
426
|
-
fieldValues: { ...
|
|
427
|
-
blockId:
|
|
425
|
+
let t = await r.dataSource.onFetch({
|
|
426
|
+
fieldValues: { ...e.block.value.fieldValues },
|
|
427
|
+
blockId: e.block.value.id
|
|
428
428
|
});
|
|
429
|
-
if (
|
|
430
|
-
let
|
|
431
|
-
for (let e of Object.keys(
|
|
432
|
-
|
|
429
|
+
if (t == null) return;
|
|
430
|
+
let n = { ...e.block.value.fieldValues };
|
|
431
|
+
for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
|
|
432
|
+
e.onUpdate(n, !0);
|
|
433
433
|
} catch (e) {
|
|
434
|
-
console.warn("[Templatical] Data source fetch error:", e),
|
|
434
|
+
console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
|
|
435
435
|
} finally {
|
|
436
|
-
|
|
436
|
+
t.value = !1;
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
return {
|
|
441
|
-
isFetching:
|
|
442
|
-
fetchError:
|
|
443
|
-
fetch:
|
|
444
|
-
hasDataSource:
|
|
445
|
-
needsFetch:
|
|
441
|
+
isFetching: t,
|
|
442
|
+
fetchError: n,
|
|
443
|
+
fetch: o,
|
|
444
|
+
hasDataSource: r,
|
|
445
|
+
needsFetch: a
|
|
446
446
|
};
|
|
447
447
|
}
|
|
448
448
|
// ../core/src/history-interceptor.ts
|
|
@@ -652,13 +652,13 @@ function Ie(e) {
|
|
|
652
652
|
return n;
|
|
653
653
|
});
|
|
654
654
|
}
|
|
655
|
-
function Le(
|
|
656
|
-
let { provider:
|
|
657
|
-
function F(
|
|
658
|
-
|
|
655
|
+
function Le(e) {
|
|
656
|
+
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), a = e.maxUndo ?? ke, o = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", s = _([]), l = _(/* @__PURE__ */ new Map()), u = m(null), d = m(0), p = m(0), h = null, g = null, v = !1, y = !1, b = !1, x = null, S = 0, C = !1, E = [], D = null, O = null, k = Promise.resolve(), A = null, M = i(() => (g?.undo.length ?? 0) > 0), ee = i(() => (g?.redo.length ?? 0) > 0);
|
|
657
|
+
function F(t) {
|
|
658
|
+
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
659
659
|
}
|
|
660
|
-
function I(
|
|
661
|
-
n !==
|
|
660
|
+
function I(t, n = g) {
|
|
661
|
+
n !== g || C || e.onNotice?.(t);
|
|
662
662
|
}
|
|
663
663
|
function L() {
|
|
664
664
|
return {
|
|
@@ -666,34 +666,34 @@ function Le(t) {
|
|
|
666
666
|
blockId: e.blockId,
|
|
667
667
|
sessionId: e.holder.sessionId
|
|
668
668
|
})),
|
|
669
|
-
session:
|
|
669
|
+
session: n
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
672
|
function R() {
|
|
673
|
-
|
|
673
|
+
p.value++;
|
|
674
674
|
}
|
|
675
675
|
function z(e, t) {
|
|
676
676
|
e.push(t), e.length > a && e.splice(0, e.length - a);
|
|
677
677
|
}
|
|
678
678
|
function B(e) {
|
|
679
|
-
if (!
|
|
680
|
-
|
|
679
|
+
if (!h || v) return;
|
|
680
|
+
y = !0;
|
|
681
681
|
try {
|
|
682
|
-
let t =
|
|
682
|
+
let t = h.content.value, n = Te(t, e);
|
|
683
683
|
if (n.length > 0) try {
|
|
684
684
|
P(t, n);
|
|
685
685
|
} catch {
|
|
686
|
-
|
|
686
|
+
h.setContent(j(e), !1);
|
|
687
687
|
}
|
|
688
|
-
T(
|
|
688
|
+
T(h.content.value, e) || h.setContent(j(e), !1);
|
|
689
689
|
} finally {
|
|
690
|
-
|
|
690
|
+
y = !1;
|
|
691
691
|
}
|
|
692
|
-
let t =
|
|
693
|
-
t && !Pe(e.blocks, t) &&
|
|
692
|
+
let t = h.state.selectedBlockId;
|
|
693
|
+
t && !Pe(e.blocks, t) && h.selectBlock(null);
|
|
694
694
|
}
|
|
695
695
|
function H() {
|
|
696
|
-
|
|
696
|
+
y || b || (b = !0, queueMicrotask(() => {
|
|
697
697
|
b = !1, W(!1);
|
|
698
698
|
}));
|
|
699
699
|
}
|
|
@@ -701,9 +701,9 @@ function Le(t) {
|
|
|
701
701
|
x &&= (clearTimeout(x), null);
|
|
702
702
|
}
|
|
703
703
|
function W(e, t = !1) {
|
|
704
|
-
let n =
|
|
705
|
-
if (!
|
|
706
|
-
let r = Te(n.view,
|
|
704
|
+
let n = g;
|
|
705
|
+
if (!h || !n || v || y || h.state.isLoading && !t || h.state.template?.id !== n.templateId) return;
|
|
706
|
+
let r = Te(n.view, h.content.value);
|
|
707
707
|
if (r.length === 0) U();
|
|
708
708
|
else {
|
|
709
709
|
if (!e && Fe(r)) {
|
|
@@ -736,7 +736,7 @@ function Le(t) {
|
|
|
736
736
|
}), t.code === "invalid_operation" && F(t);
|
|
737
737
|
return;
|
|
738
738
|
}
|
|
739
|
-
let i =
|
|
739
|
+
let i = h.content.value;
|
|
740
740
|
if (!T(r, i)) {
|
|
741
741
|
F(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
|
|
742
742
|
op: "setContent",
|
|
@@ -776,23 +776,23 @@ function Le(t) {
|
|
|
776
776
|
let t = e.pending.find((e) => !e.sent);
|
|
777
777
|
t ? (t.sent = !0, e.inFlight = t, re(e, t, 0)) : J(e);
|
|
778
778
|
}
|
|
779
|
-
function re(e,
|
|
780
|
-
|
|
781
|
-
batchId:
|
|
779
|
+
function re(e, n, r) {
|
|
780
|
+
t.submit(e.templateId, {
|
|
781
|
+
batchId: n.batchId,
|
|
782
782
|
baseRevision: e.revision,
|
|
783
|
-
ops:
|
|
784
|
-
...
|
|
785
|
-
}).then(({ revision:
|
|
786
|
-
e.inFlight = null, ie(e,
|
|
787
|
-
}, (
|
|
788
|
-
if (je(
|
|
789
|
-
else if (Ne(
|
|
790
|
-
ce(e,
|
|
783
|
+
ops: n.ops,
|
|
784
|
+
...n.origin === "ai" ? { origin: "ai" } : {}
|
|
785
|
+
}).then(({ revision: t }) => {
|
|
786
|
+
e.inFlight = null, ie(e, n, t), K(e);
|
|
787
|
+
}, (t) => {
|
|
788
|
+
if (je(t) !== null) e.inFlight = null, se(e, n, t), K(e);
|
|
789
|
+
else if (Ne(t)) {
|
|
790
|
+
ce(e, t);
|
|
791
791
|
let i = Oe[Math.min(r, Oe.length - 1)];
|
|
792
792
|
setTimeout(() => {
|
|
793
|
-
C || re(e,
|
|
793
|
+
C || re(e, n, r + 1);
|
|
794
794
|
}, i);
|
|
795
|
-
} else e.inFlight = null, F(
|
|
795
|
+
} else e.inFlight = null, F(t), se(e, n, t), K(e);
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
798
|
function ie(e, t, n) {
|
|
@@ -829,7 +829,7 @@ function Le(t) {
|
|
|
829
829
|
code: r
|
|
830
830
|
}, e);
|
|
831
831
|
}
|
|
832
|
-
Y(e), e ===
|
|
832
|
+
Y(e), e === g && X();
|
|
833
833
|
}
|
|
834
834
|
function J(e) {
|
|
835
835
|
if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
|
|
@@ -843,43 +843,43 @@ function Le(t) {
|
|
|
843
843
|
let n = e.pending.find((e) => e.batchId === t.batchId);
|
|
844
844
|
n ? ie(e, n, t.revision) : (e.remote.set(t.revision, t), de(e));
|
|
845
845
|
}
|
|
846
|
-
function ue(
|
|
846
|
+
function ue(t, n) {
|
|
847
847
|
let r = n.ops;
|
|
848
|
-
if (
|
|
849
|
-
r =
|
|
848
|
+
if (e.normalizeRemoteOperations) try {
|
|
849
|
+
r = e.normalizeRemoteOperations(n.ops, t.confirmed);
|
|
850
850
|
} catch (e) {
|
|
851
851
|
F(e);
|
|
852
852
|
}
|
|
853
853
|
return Ie(r);
|
|
854
854
|
}
|
|
855
|
-
function de(
|
|
855
|
+
function de(t) {
|
|
856
856
|
let n = [], r = !1;
|
|
857
857
|
for (;;) {
|
|
858
|
-
let
|
|
858
|
+
let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
|
|
859
859
|
if (!i && !a) break;
|
|
860
860
|
try {
|
|
861
|
-
|
|
861
|
+
t.confirmed = V(t.confirmed, i ? ue(t, i) : a.ops);
|
|
862
862
|
} catch {
|
|
863
|
-
if (
|
|
864
|
-
|
|
863
|
+
if (t.recovering) {
|
|
864
|
+
t.remote.clear(), t.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
|
|
865
865
|
return;
|
|
866
866
|
}
|
|
867
|
-
me(
|
|
867
|
+
me(t);
|
|
868
868
|
return;
|
|
869
869
|
}
|
|
870
|
-
|
|
870
|
+
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), q(t, a));
|
|
871
871
|
}
|
|
872
|
-
if (
|
|
873
|
-
|
|
874
|
-
actor:
|
|
875
|
-
ops:
|
|
872
|
+
if (t === g && (d.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? fe(t) : pe(t), (n.length !== 0 || r) && (Y(t), t === g)) for (let t of n) try {
|
|
873
|
+
e.onRemoteChange?.({
|
|
874
|
+
actor: t.actor,
|
|
875
|
+
ops: t.ops
|
|
876
876
|
});
|
|
877
877
|
} catch (e) {
|
|
878
878
|
F(e);
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
function Y(e) {
|
|
882
|
-
e ===
|
|
882
|
+
e === g && G();
|
|
883
883
|
let t = e.confirmed;
|
|
884
884
|
for (let n = 0; n < e.pending.length; n++) {
|
|
885
885
|
let r = e.pending[n];
|
|
@@ -900,27 +900,27 @@ function Le(t) {
|
|
|
900
900
|
t = e.confirmed, n = -1;
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
|
-
e.view = t, J(e), e ===
|
|
903
|
+
e.view = t, J(e), e === g && B(t);
|
|
904
904
|
}
|
|
905
905
|
function fe(e) {
|
|
906
906
|
e.gapTimer ||= setTimeout(() => {
|
|
907
|
-
e.gapTimer = null, e ===
|
|
907
|
+
e.gapTimer = null, e === g && X();
|
|
908
908
|
}, Ee);
|
|
909
909
|
}
|
|
910
910
|
function pe(e) {
|
|
911
911
|
e.gapTimer &&= (clearTimeout(e.gapTimer), null);
|
|
912
912
|
}
|
|
913
913
|
function X() {
|
|
914
|
-
let e =
|
|
914
|
+
let e = g;
|
|
915
915
|
return e ? (e.catchingUp ||= (async () => {
|
|
916
916
|
try {
|
|
917
|
-
let
|
|
917
|
+
let n = await t.operationsAfter(e.templateId, e.revision);
|
|
918
918
|
if (e.retired) return;
|
|
919
|
-
if ("resync" in
|
|
919
|
+
if ("resync" in n) {
|
|
920
920
|
await me(e);
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
|
-
for (let
|
|
923
|
+
for (let t of n.batches) le(e, t);
|
|
924
924
|
} catch (e) {
|
|
925
925
|
F(e);
|
|
926
926
|
} finally {
|
|
@@ -928,31 +928,31 @@ function Le(t) {
|
|
|
928
928
|
}
|
|
929
929
|
})(), e.catchingUp) : Promise.resolve();
|
|
930
930
|
}
|
|
931
|
-
async function me(
|
|
932
|
-
|
|
931
|
+
async function me(t) {
|
|
932
|
+
t.recovering = !0;
|
|
933
933
|
try {
|
|
934
|
-
let n = await
|
|
935
|
-
if (
|
|
936
|
-
let r = n.revision ??
|
|
937
|
-
|
|
938
|
-
for (let [
|
|
939
|
-
|
|
934
|
+
let n = await e.loadTemplate(t.templateId);
|
|
935
|
+
if (t.retired) return;
|
|
936
|
+
let r = n.revision ?? t.revision;
|
|
937
|
+
t.confirmed = j(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
|
|
938
|
+
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), q(t, n));
|
|
939
|
+
t === g && (d.value = r), Y(t), de(t);
|
|
940
940
|
} catch (e) {
|
|
941
941
|
F(e);
|
|
942
942
|
} finally {
|
|
943
|
-
|
|
943
|
+
t.recovering = !1;
|
|
944
944
|
}
|
|
945
945
|
}
|
|
946
|
-
function he(
|
|
947
|
-
let n = () =>
|
|
946
|
+
function he(t) {
|
|
947
|
+
let n = () => t === g && !t.retired;
|
|
948
948
|
return {
|
|
949
|
-
onBatch: (
|
|
950
|
-
n() && le(
|
|
949
|
+
onBatch: (e) => {
|
|
950
|
+
n() && le(t, e);
|
|
951
951
|
},
|
|
952
952
|
onResync: (r, i) => {
|
|
953
|
-
if (!(!n() || r <=
|
|
953
|
+
if (!(!n() || r <= t.revision)) {
|
|
954
954
|
if (i) try {
|
|
955
|
-
|
|
955
|
+
e.onRemoteResync?.({
|
|
956
956
|
revision: r,
|
|
957
957
|
actor: i
|
|
958
958
|
});
|
|
@@ -971,14 +971,14 @@ function Le(t) {
|
|
|
971
971
|
onMembers: (e) => {
|
|
972
972
|
n() && Ce(e);
|
|
973
973
|
},
|
|
974
|
-
onConnectionChange: (
|
|
975
|
-
n() && ye(
|
|
974
|
+
onConnectionChange: (e) => {
|
|
975
|
+
n() && ye(t, e);
|
|
976
976
|
}
|
|
977
977
|
};
|
|
978
978
|
}
|
|
979
|
-
function ge(e,
|
|
980
|
-
|
|
981
|
-
e.retired || e !==
|
|
979
|
+
function ge(e, r) {
|
|
980
|
+
t.join(e.templateId, { sessionId: n }, he(e)).then((t) => {
|
|
981
|
+
e.retired || e !== g ? r || t.leave() : (e.leave = t.leave, Se(t.locks, !r), Ce(t.members), t.members.length > 0 && (u.value = "connected"), t.revision > e.revision && X(), r && Q());
|
|
982
982
|
}, (e) => F(e));
|
|
983
983
|
}
|
|
984
984
|
function _e(e) {
|
|
@@ -1000,7 +1000,7 @@ function Le(t) {
|
|
|
1000
1000
|
redo: [],
|
|
1001
1001
|
waiters: []
|
|
1002
1002
|
};
|
|
1003
|
-
|
|
1003
|
+
g = n, d.value = n.revision, R(), ge(n, !1), h?.state.selectedBlockId && Be(h.state.selectedBlockId), H();
|
|
1004
1004
|
}
|
|
1005
1005
|
function ve(e) {
|
|
1006
1006
|
e.retired = !0, pe(e), e.leave?.(), e.leave = null, ce(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
|
|
@@ -1010,12 +1010,12 @@ function Le(t) {
|
|
|
1010
1010
|
u.value = t, t === "connected" && n !== null && n !== "connected" && ge(e, !0);
|
|
1011
1011
|
}
|
|
1012
1012
|
function be(e) {
|
|
1013
|
-
|
|
1013
|
+
g && g.templateId === e?.id || (g &&= (U(), ve(g), null), s.value = [], l.value = /* @__PURE__ */ new Map(), u.value = null, D = null, Q(), R(), e && _e(e));
|
|
1014
1014
|
}
|
|
1015
1015
|
function xe(e) {
|
|
1016
|
-
if (e.holder.sessionId ===
|
|
1016
|
+
if (e.holder.sessionId === n) return;
|
|
1017
1017
|
let t = new Map([...l.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
|
|
1018
|
-
t.set(e.blockId, e), l.value = t,
|
|
1018
|
+
t.set(e.blockId, e), l.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), I({
|
|
1019
1019
|
type: "selectionRefused",
|
|
1020
1020
|
blockId: e.blockId,
|
|
1021
1021
|
holder: e.holder
|
|
@@ -1027,13 +1027,13 @@ function Le(t) {
|
|
|
1027
1027
|
n.delete(e), l.value = n;
|
|
1028
1028
|
}
|
|
1029
1029
|
function Se(e, t) {
|
|
1030
|
-
let
|
|
1031
|
-
for (let
|
|
1032
|
-
l.value =
|
|
1030
|
+
let r = t ? new Map(l.value) : /* @__PURE__ */ new Map();
|
|
1031
|
+
for (let i of e) i.holder.sessionId !== n && (t && r.has(i.blockId) || r.set(i.blockId, i));
|
|
1032
|
+
l.value = r;
|
|
1033
1033
|
}
|
|
1034
1034
|
function Ce(e) {
|
|
1035
|
-
let t = new Set(e.map((e) => e.sessionId)), n = new Set(
|
|
1036
|
-
if (
|
|
1035
|
+
let t = new Set(e.map((e) => e.sessionId)), n = new Set(s.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
|
|
1036
|
+
if (s.value = e, n.size === 0) return;
|
|
1037
1037
|
let r = new Map([...l.value].filter(([, e]) => !n.has(e.holder.sessionId)));
|
|
1038
1038
|
r.size !== l.value.size && (l.value = r);
|
|
1039
1039
|
}
|
|
@@ -1044,18 +1044,18 @@ function Le(t) {
|
|
|
1044
1044
|
o && we(async () => {
|
|
1045
1045
|
if (O && (D === null || O.templateId !== D.templateId)) {
|
|
1046
1046
|
let e = O;
|
|
1047
|
-
O = null, $(), await
|
|
1047
|
+
O = null, $(), await t.releaseLock(e.templateId, e.blockId);
|
|
1048
1048
|
}
|
|
1049
1049
|
let e = D;
|
|
1050
1050
|
if (!(!e || O?.templateId === e.templateId && O.blockId === e.blockId)) try {
|
|
1051
|
-
await
|
|
1052
|
-
} catch (
|
|
1051
|
+
await t.acquireLock(e.templateId, e.blockId), O = e, ze(), Le(e.blockId);
|
|
1052
|
+
} catch (n) {
|
|
1053
1053
|
if (O?.templateId === e.templateId) {
|
|
1054
1054
|
let e = O;
|
|
1055
|
-
O = null, $(), await
|
|
1055
|
+
O = null, $(), await t.releaseLock(e.templateId, e.blockId).catch(() => {});
|
|
1056
1056
|
}
|
|
1057
1057
|
if (D !== e) return;
|
|
1058
|
-
Re(e.blockId,
|
|
1058
|
+
Re(e.blockId, n);
|
|
1059
1059
|
}
|
|
1060
1060
|
});
|
|
1061
1061
|
}
|
|
@@ -1073,7 +1073,7 @@ function Le(t) {
|
|
|
1073
1073
|
blockId: e,
|
|
1074
1074
|
holder: n,
|
|
1075
1075
|
expiresAt: ""
|
|
1076
|
-
}) :
|
|
1076
|
+
}) : h?.state.selectedBlockId === e && h.selectBlock(null);
|
|
1077
1077
|
} else F(t), setTimeout(() => {
|
|
1078
1078
|
D?.blockId === e && Q();
|
|
1079
1079
|
}, Oe[0]);
|
|
@@ -1083,7 +1083,7 @@ function Le(t) {
|
|
|
1083
1083
|
we(async () => {
|
|
1084
1084
|
let e = O;
|
|
1085
1085
|
if (e) try {
|
|
1086
|
-
await
|
|
1086
|
+
await t.renewLock(e.templateId, e.blockId);
|
|
1087
1087
|
} catch (e) {
|
|
1088
1088
|
if (je(e) === "lock_lost") {
|
|
1089
1089
|
O = null, $(), Q();
|
|
@@ -1098,17 +1098,17 @@ function Le(t) {
|
|
|
1098
1098
|
A &&= (clearInterval(A), null);
|
|
1099
1099
|
}
|
|
1100
1100
|
function Be(e) {
|
|
1101
|
-
G(),
|
|
1102
|
-
templateId:
|
|
1101
|
+
G(), g && (D = e ? {
|
|
1102
|
+
templateId: g.templateId,
|
|
1103
1103
|
blockId: e
|
|
1104
1104
|
} : null, Q());
|
|
1105
1105
|
}
|
|
1106
1106
|
function Ve() {
|
|
1107
|
-
G(), O && o && (
|
|
1107
|
+
G(), O && o && (t.releaseLock(O.templateId, O.blockId).catch(() => {}), O = null, $()), g?.leave?.(), g && (g.leave = null);
|
|
1108
1108
|
}
|
|
1109
1109
|
function He(e) {
|
|
1110
|
-
let t =
|
|
1111
|
-
if (!t ||
|
|
1110
|
+
let t = g;
|
|
1111
|
+
if (!t || v) return;
|
|
1112
1112
|
G();
|
|
1113
1113
|
let n = (e === "undo" ? t.undo : t.redo).pop();
|
|
1114
1114
|
if (!n) return;
|
|
@@ -1125,11 +1125,11 @@ function Le(t) {
|
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
1127
|
let i = { ops: N(t.view, n.ops) };
|
|
1128
|
-
z(e === "undo" ? t.redo : t.undo, i), t.view = r, B(r),
|
|
1128
|
+
z(e === "undo" ? t.redo : t.undo, i), t.view = r, B(r), h?.markDirty(), ne(t, n.ops, e, i);
|
|
1129
1129
|
}
|
|
1130
1130
|
function Ue(e, t) {
|
|
1131
|
-
let n =
|
|
1132
|
-
if (!
|
|
1131
|
+
let n = g;
|
|
1132
|
+
if (!h || !n || v) return {
|
|
1133
1133
|
applied: !1,
|
|
1134
1134
|
error: new w("invalid_operation", 0, "No template is open for editing.")
|
|
1135
1135
|
};
|
|
@@ -1148,38 +1148,38 @@ function Le(t) {
|
|
|
1148
1148
|
return a && a.turn === t.turn ? (a.ops = [...i, ...a.ops], o = a) : (o = {
|
|
1149
1149
|
ops: i,
|
|
1150
1150
|
turn: t.turn
|
|
1151
|
-
}, z(n.undo, o)), n.redo = [], R(), n.view = r, B(r),
|
|
1151
|
+
}, z(n.undo, o)), n.redo = [], R(), n.view = r, B(r), h.markDirty(), ne(n, e, t.origin, o), {
|
|
1152
1152
|
applied: !0,
|
|
1153
1153
|
inverse: i
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
1156
|
function We(e) {
|
|
1157
|
-
|
|
1157
|
+
h = e, E.push(f(() => e.state.template, (e) => be(e), { immediate: !0 }), f(() => e.content.value, H, { deep: !0 }), f(() => e.state.selectedBlockId, Be), f(() => e.state.isLoading, (e) => e ? W(!0, !0) : H())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", G)), r() && c(Je);
|
|
1158
1158
|
}
|
|
1159
1159
|
function Ge() {
|
|
1160
1160
|
G();
|
|
1161
|
-
let e =
|
|
1161
|
+
let e = g;
|
|
1162
1162
|
return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
|
|
1163
1163
|
resolve: t,
|
|
1164
1164
|
reject: n
|
|
1165
1165
|
}));
|
|
1166
1166
|
}
|
|
1167
1167
|
function Ke() {
|
|
1168
|
-
G(),
|
|
1168
|
+
G(), v = !0;
|
|
1169
1169
|
}
|
|
1170
1170
|
function qe() {
|
|
1171
|
-
|
|
1171
|
+
v = !1, g && B(g.view);
|
|
1172
1172
|
}
|
|
1173
1173
|
function Je() {
|
|
1174
1174
|
if (!C) {
|
|
1175
1175
|
G();
|
|
1176
1176
|
for (let e of E.splice(0)) e();
|
|
1177
|
-
U(), Ve(), C = !0,
|
|
1177
|
+
U(), Ve(), C = !0, g && ve(g), g = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", G));
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
1180
|
return {
|
|
1181
|
-
sessionId:
|
|
1182
|
-
members:
|
|
1181
|
+
sessionId: n,
|
|
1182
|
+
members: s,
|
|
1183
1183
|
locks: l,
|
|
1184
1184
|
connection: u,
|
|
1185
1185
|
revision: d,
|
|
@@ -1189,103 +1189,103 @@ function Le(t) {
|
|
|
1189
1189
|
undo: () => He("undo"),
|
|
1190
1190
|
redo: () => He("redo"),
|
|
1191
1191
|
clearHistory: () => {
|
|
1192
|
-
|
|
1192
|
+
g && (g.undo = [], g.redo = [], R());
|
|
1193
1193
|
},
|
|
1194
1194
|
flush: G,
|
|
1195
1195
|
settle: Ge,
|
|
1196
1196
|
suspend: Ke,
|
|
1197
1197
|
resume: qe,
|
|
1198
1198
|
catchUp: X,
|
|
1199
|
-
hasConfirmedBlock: (e) =>
|
|
1199
|
+
hasConfirmedBlock: (e) => g ? Pe(g.confirmed.blocks, e) : !1,
|
|
1200
1200
|
applyOperations: Ue,
|
|
1201
1201
|
destroy: Je
|
|
1202
1202
|
};
|
|
1203
1203
|
}
|
|
1204
1204
|
// ../core/src/saved-blocks.ts
|
|
1205
|
-
function Re(
|
|
1206
|
-
let { provider:
|
|
1205
|
+
function Re(e) {
|
|
1206
|
+
let { provider: t } = e, n = m([]), r = m(!1), i = v(() => {
|
|
1207
1207
|
let e = /* @__PURE__ */ new Set();
|
|
1208
|
-
for (let t of
|
|
1208
|
+
for (let t of n.value) {
|
|
1209
1209
|
let n = t.category?.trim();
|
|
1210
1210
|
n && e.add(n);
|
|
1211
1211
|
}
|
|
1212
1212
|
return [...e].sort((e, t) => e.localeCompare(t));
|
|
1213
|
-
}),
|
|
1214
|
-
function
|
|
1215
|
-
return
|
|
1213
|
+
}), a = v(() => typeof t.create == "function"), o = v(() => typeof t.update == "function"), s = v(() => typeof t.delete == "function");
|
|
1214
|
+
function c(e) {
|
|
1215
|
+
return o.value && e.canUpdate !== !1;
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1218
|
-
return
|
|
1217
|
+
function l(e) {
|
|
1218
|
+
return s.value && e.canDelete !== !1;
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function u(e, t) {
|
|
1221
1221
|
throw new H(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
J(
|
|
1223
|
+
function d(t) {
|
|
1224
|
+
J(e.onError, t);
|
|
1225
1225
|
}
|
|
1226
|
-
async function
|
|
1227
|
-
|
|
1226
|
+
async function f(i) {
|
|
1227
|
+
r.value = !0;
|
|
1228
1228
|
try {
|
|
1229
|
-
|
|
1230
|
-
} catch (
|
|
1231
|
-
throw
|
|
1229
|
+
n.value = await t.list(i);
|
|
1230
|
+
} catch (t) {
|
|
1231
|
+
throw e.onError?.(t), t;
|
|
1232
1232
|
} finally {
|
|
1233
|
-
|
|
1233
|
+
r.value = !1;
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
async function
|
|
1237
|
-
let { create: o } =
|
|
1238
|
-
typeof o != "function" &&
|
|
1236
|
+
async function p(r, i, a) {
|
|
1237
|
+
let { create: o } = t;
|
|
1238
|
+
typeof o != "function" && u("create", "disabled by the provider");
|
|
1239
1239
|
try {
|
|
1240
|
-
let
|
|
1241
|
-
name:
|
|
1240
|
+
let e = await o(a ? {
|
|
1241
|
+
name: r,
|
|
1242
1242
|
content: i,
|
|
1243
1243
|
category: a
|
|
1244
1244
|
} : {
|
|
1245
|
-
name:
|
|
1245
|
+
name: r,
|
|
1246
1246
|
content: i
|
|
1247
1247
|
});
|
|
1248
|
-
return
|
|
1249
|
-
} catch (
|
|
1250
|
-
throw
|
|
1248
|
+
return n.value = [e, ...n.value], d(() => t.onCreated?.(e)), e;
|
|
1249
|
+
} catch (t) {
|
|
1250
|
+
throw e.onError?.(t), t;
|
|
1251
1251
|
}
|
|
1252
1252
|
}
|
|
1253
|
-
async function h(
|
|
1254
|
-
let { update: a } =
|
|
1255
|
-
typeof a != "function" &&
|
|
1256
|
-
let o =
|
|
1257
|
-
o && o.canUpdate === !1 &&
|
|
1253
|
+
async function h(r, i) {
|
|
1254
|
+
let { update: a } = t;
|
|
1255
|
+
typeof a != "function" && u("update", "disabled by the provider");
|
|
1256
|
+
let o = n.value.find((e) => e.id === r);
|
|
1257
|
+
o && o.canUpdate === !1 && u("update", `not permitted for entry "${r}"`);
|
|
1258
1258
|
try {
|
|
1259
|
-
let
|
|
1260
|
-
return
|
|
1261
|
-
} catch (
|
|
1262
|
-
throw
|
|
1259
|
+
let e = await a(r, i);
|
|
1260
|
+
return n.value = n.value.map((t) => t.id === r ? e : t), d(() => t.onUpdated?.(e)), e;
|
|
1261
|
+
} catch (t) {
|
|
1262
|
+
throw e.onError?.(t), t;
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
|
-
async function
|
|
1266
|
-
let { delete: i } =
|
|
1267
|
-
typeof i != "function" &&
|
|
1268
|
-
let a =
|
|
1269
|
-
a && a.canDelete === !1 &&
|
|
1265
|
+
async function g(r) {
|
|
1266
|
+
let { delete: i } = t;
|
|
1267
|
+
typeof i != "function" && u("delete", "disabled by the provider");
|
|
1268
|
+
let a = n.value.find((e) => e.id === r) ?? null;
|
|
1269
|
+
a && a.canDelete === !1 && u("delete", `not permitted for entry "${r}"`);
|
|
1270
1270
|
try {
|
|
1271
|
-
await i(
|
|
1272
|
-
} catch (
|
|
1273
|
-
throw
|
|
1271
|
+
await i(r), n.value = n.value.filter((e) => e.id !== r), a && d(() => t.onDeleted?.(a));
|
|
1272
|
+
} catch (t) {
|
|
1273
|
+
throw e.onError?.(t), t;
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
return {
|
|
1277
|
-
savedBlocks:
|
|
1278
|
-
isLoading:
|
|
1279
|
-
categories:
|
|
1280
|
-
canCreate:
|
|
1281
|
-
canUpdate:
|
|
1282
|
-
canDelete:
|
|
1283
|
-
canUpdateBlock:
|
|
1284
|
-
canDeleteBlock:
|
|
1285
|
-
load:
|
|
1286
|
-
create:
|
|
1277
|
+
savedBlocks: n,
|
|
1278
|
+
isLoading: r,
|
|
1279
|
+
categories: i,
|
|
1280
|
+
canCreate: a,
|
|
1281
|
+
canUpdate: o,
|
|
1282
|
+
canDelete: s,
|
|
1283
|
+
canUpdateBlock: c,
|
|
1284
|
+
canDeleteBlock: l,
|
|
1285
|
+
load: f,
|
|
1286
|
+
create: p,
|
|
1287
1287
|
update: h,
|
|
1288
|
-
remove:
|
|
1288
|
+
remove: g
|
|
1289
1289
|
};
|
|
1290
1290
|
}
|
|
1291
1291
|
// ../core/src/saved-blocks-local.ts
|
|
@@ -1419,121 +1419,121 @@ function He(e = {}) {
|
|
|
1419
1419
|
};
|
|
1420
1420
|
}
|
|
1421
1421
|
// ../core/src/version-history.ts
|
|
1422
|
-
function Ue(
|
|
1423
|
-
let { provider:
|
|
1424
|
-
function
|
|
1425
|
-
let t =
|
|
1422
|
+
function Ue(e) {
|
|
1423
|
+
let { provider: t, getTemplateId: n } = e, r = m([]), i = m(!1), a = m(void 0), o = m(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
|
|
1424
|
+
function u(e) {
|
|
1425
|
+
let t = n();
|
|
1426
1426
|
if (!t) throw new H(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
1427
1427
|
return t;
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1429
|
+
function d(e) {
|
|
1430
1430
|
throw new H(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1433
|
-
J(
|
|
1432
|
+
function f(t) {
|
|
1433
|
+
J(e.onError, t);
|
|
1434
1434
|
}
|
|
1435
|
-
async function
|
|
1436
|
-
let
|
|
1437
|
-
|
|
1435
|
+
async function p(n) {
|
|
1436
|
+
let o = u("list");
|
|
1437
|
+
i.value = !0;
|
|
1438
1438
|
try {
|
|
1439
|
-
let
|
|
1440
|
-
|
|
1441
|
-
} catch (
|
|
1442
|
-
throw
|
|
1439
|
+
let e = await t.list(o, n);
|
|
1440
|
+
r.value = e.versions, a.value = e.nextCursor;
|
|
1441
|
+
} catch (t) {
|
|
1442
|
+
throw e.onError?.(t), t;
|
|
1443
1443
|
} finally {
|
|
1444
|
-
|
|
1444
|
+
i.value = !1;
|
|
1445
1445
|
}
|
|
1446
1446
|
}
|
|
1447
1447
|
function h(e) {
|
|
1448
|
-
return e.content ??
|
|
1448
|
+
return e.content ?? s.get(e.id) ?? null;
|
|
1449
1449
|
}
|
|
1450
|
-
async function
|
|
1451
|
-
let r = h(
|
|
1450
|
+
async function g(n) {
|
|
1451
|
+
let r = h(n);
|
|
1452
1452
|
if (r) return r;
|
|
1453
|
-
let i =
|
|
1453
|
+
let i = u("get");
|
|
1454
1454
|
try {
|
|
1455
|
-
let
|
|
1456
|
-
return
|
|
1457
|
-
} catch (
|
|
1458
|
-
throw
|
|
1455
|
+
let e = await t.get(i, n.id);
|
|
1456
|
+
return s.set(n.id, e), e;
|
|
1457
|
+
} catch (t) {
|
|
1458
|
+
throw e.onError?.(t), t;
|
|
1459
1459
|
}
|
|
1460
1460
|
}
|
|
1461
|
-
async function
|
|
1462
|
-
let { create: a } =
|
|
1463
|
-
typeof a != "function" &&
|
|
1464
|
-
let o =
|
|
1461
|
+
async function _(n, i) {
|
|
1462
|
+
let { create: a } = t;
|
|
1463
|
+
typeof a != "function" && d("create");
|
|
1464
|
+
let o = u("create");
|
|
1465
1465
|
try {
|
|
1466
|
-
let
|
|
1467
|
-
return
|
|
1468
|
-
} catch (
|
|
1469
|
-
throw
|
|
1466
|
+
let e = await a(o, n, i);
|
|
1467
|
+
return r.value = [e, ...r.value], f(() => t.onCreated?.(e)), e;
|
|
1468
|
+
} catch (t) {
|
|
1469
|
+
throw e.onError?.(t), t;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
async function y(
|
|
1473
|
-
let { restore: r } =
|
|
1474
|
-
typeof r != "function" &&
|
|
1475
|
-
let i =
|
|
1476
|
-
|
|
1472
|
+
async function y(n) {
|
|
1473
|
+
let { restore: r } = t;
|
|
1474
|
+
typeof r != "function" && d("restore");
|
|
1475
|
+
let i = u("restore"), a;
|
|
1476
|
+
o.value = !0;
|
|
1477
1477
|
try {
|
|
1478
|
-
a = await r(i,
|
|
1479
|
-
} catch (
|
|
1480
|
-
throw
|
|
1478
|
+
a = await r(i, n);
|
|
1479
|
+
} catch (t) {
|
|
1480
|
+
throw e.onError?.(t), t;
|
|
1481
1481
|
} finally {
|
|
1482
|
-
|
|
1482
|
+
o.value = !1;
|
|
1483
1483
|
}
|
|
1484
|
-
return
|
|
1484
|
+
return f(() => t.onRestored?.(a)), a;
|
|
1485
1485
|
}
|
|
1486
1486
|
return {
|
|
1487
|
-
nextCursor:
|
|
1488
|
-
versions:
|
|
1489
|
-
isLoading:
|
|
1490
|
-
isRestoring:
|
|
1491
|
-
canCreate:
|
|
1492
|
-
canRestore:
|
|
1493
|
-
load:
|
|
1487
|
+
nextCursor: a,
|
|
1488
|
+
versions: r,
|
|
1489
|
+
isLoading: i,
|
|
1490
|
+
isRestoring: o,
|
|
1491
|
+
canCreate: c,
|
|
1492
|
+
canRestore: l,
|
|
1493
|
+
load: p,
|
|
1494
1494
|
peekContent: h,
|
|
1495
|
-
resolveContent:
|
|
1496
|
-
create:
|
|
1495
|
+
resolveContent: g,
|
|
1496
|
+
create: _,
|
|
1497
1497
|
restore: y
|
|
1498
1498
|
};
|
|
1499
1499
|
}
|
|
1500
1500
|
// ../core/src/comments.ts
|
|
1501
|
-
function We(
|
|
1502
|
-
let { provider:
|
|
1501
|
+
function We(e) {
|
|
1502
|
+
let { provider: t, getTemplateId: n, getUser: r } = e, i = m([]), a = m(!1), o = m(!1), s = v(() => typeof t.create == "function"), c = v(() => typeof t.update == "function"), l = v(() => typeof t.delete == "function"), u = v(() => typeof t.setResolved == "function"), d = v(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), f = v(() => i.value.filter((e) => !e.resolvedAt).length), p = v(() => {
|
|
1503
1503
|
let e = /* @__PURE__ */ new Map();
|
|
1504
|
-
for (let t of
|
|
1504
|
+
for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
1505
1505
|
return e;
|
|
1506
1506
|
});
|
|
1507
1507
|
function h(e) {
|
|
1508
|
-
let t =
|
|
1508
|
+
let t = n();
|
|
1509
1509
|
if (!t) throw new H(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
1510
1510
|
return t;
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1513
|
-
let t =
|
|
1512
|
+
function g(e) {
|
|
1513
|
+
let t = r();
|
|
1514
1514
|
if (!t) throw new H(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
1515
1515
|
return t;
|
|
1516
1516
|
}
|
|
1517
|
-
function
|
|
1517
|
+
function _(e) {
|
|
1518
1518
|
throw new H(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1519
1519
|
}
|
|
1520
1520
|
function y(e) {
|
|
1521
|
-
for (let t of
|
|
1521
|
+
for (let t of i.value) {
|
|
1522
1522
|
if (t.id === e) return t;
|
|
1523
1523
|
for (let n of t.replies ?? []) if (n.id === e) return n;
|
|
1524
1524
|
}
|
|
1525
1525
|
return null;
|
|
1526
1526
|
}
|
|
1527
1527
|
function b(e) {
|
|
1528
|
-
let t =
|
|
1528
|
+
let t = r();
|
|
1529
1529
|
return t !== null && e.author.id === t.id;
|
|
1530
1530
|
}
|
|
1531
|
-
function x(
|
|
1532
|
-
let n = se(
|
|
1533
|
-
throw
|
|
1531
|
+
function x(t) {
|
|
1532
|
+
let n = se(t);
|
|
1533
|
+
throw e.onError?.(n), n;
|
|
1534
1534
|
}
|
|
1535
|
-
function S(
|
|
1536
|
-
J(
|
|
1535
|
+
function S(t) {
|
|
1536
|
+
J(e.onError, t);
|
|
1537
1537
|
}
|
|
1538
1538
|
function C(e, t, n) {
|
|
1539
1539
|
return [
|
|
@@ -1547,7 +1547,7 @@ function We(t) {
|
|
|
1547
1547
|
}
|
|
1548
1548
|
function T(e) {
|
|
1549
1549
|
if (e.parentId) {
|
|
1550
|
-
let t = !1, n =
|
|
1550
|
+
let t = !1, n = i.value.map((n) => {
|
|
1551
1551
|
if (n.id !== e.parentId) return n;
|
|
1552
1552
|
let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
|
|
1553
1553
|
return i !== -1 && w(r[i], e) ? n : (t = !0, {
|
|
@@ -1555,112 +1555,112 @@ function We(t) {
|
|
|
1555
1555
|
replies: i === -1 ? [...r, e] : C(r, i, e)
|
|
1556
1556
|
});
|
|
1557
1557
|
});
|
|
1558
|
-
return t && (
|
|
1558
|
+
return t && (i.value = n), t;
|
|
1559
1559
|
}
|
|
1560
|
-
let t =
|
|
1561
|
-
if (t === -1) return
|
|
1560
|
+
let t = i.value.findIndex((t) => t.id === e.id);
|
|
1561
|
+
if (t === -1) return i.value = [...i.value, e], !0;
|
|
1562
1562
|
let n = {
|
|
1563
1563
|
...e,
|
|
1564
|
-
replies: e.replies ??
|
|
1564
|
+
replies: e.replies ?? i.value[t].replies
|
|
1565
1565
|
};
|
|
1566
|
-
return !w(
|
|
1566
|
+
return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
|
|
1567
1567
|
}
|
|
1568
1568
|
function E(e, t) {
|
|
1569
1569
|
let n = y(e), r = t ?? n?.parentId ?? null;
|
|
1570
|
-
return r ?
|
|
1570
|
+
return r ? i.value = i.value.map((t) => t.id === r ? {
|
|
1571
1571
|
...t,
|
|
1572
1572
|
replies: (t.replies ?? []).filter((t) => t.id !== e)
|
|
1573
|
-
} : t) :
|
|
1573
|
+
} : t) : i.value = i.value.filter((t) => t.id !== e), n;
|
|
1574
1574
|
}
|
|
1575
1575
|
async function D(e) {
|
|
1576
|
-
let
|
|
1577
|
-
|
|
1576
|
+
let n = h("list");
|
|
1577
|
+
a.value = !0;
|
|
1578
1578
|
try {
|
|
1579
|
-
|
|
1579
|
+
i.value = await t.list(n, e);
|
|
1580
1580
|
} catch (e) {
|
|
1581
1581
|
x(e);
|
|
1582
1582
|
} finally {
|
|
1583
|
-
|
|
1583
|
+
a.value = !1;
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
async function O(e) {
|
|
1587
|
-
let { create:
|
|
1588
|
-
typeof
|
|
1587
|
+
let { create: n } = t;
|
|
1588
|
+
typeof n != "function" && _("create");
|
|
1589
1589
|
let r = h("create");
|
|
1590
|
-
|
|
1590
|
+
g("create"), o.value = !0;
|
|
1591
1591
|
try {
|
|
1592
|
-
let i = await
|
|
1593
|
-
return T(i), S(() =>
|
|
1592
|
+
let i = await n(r, e);
|
|
1593
|
+
return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
|
|
1594
1594
|
} catch (e) {
|
|
1595
1595
|
x(e);
|
|
1596
1596
|
} finally {
|
|
1597
|
-
|
|
1597
|
+
o.value = !1;
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
|
-
async function k(e,
|
|
1601
|
-
let { update: r } =
|
|
1602
|
-
typeof r != "function" &&
|
|
1600
|
+
async function k(e, n) {
|
|
1601
|
+
let { update: r } = t;
|
|
1602
|
+
typeof r != "function" && _("update");
|
|
1603
1603
|
let i = h("update");
|
|
1604
|
-
|
|
1604
|
+
g("update"), o.value = !0;
|
|
1605
1605
|
try {
|
|
1606
|
-
let a = await r(i, e,
|
|
1607
|
-
return T(a), S(() =>
|
|
1606
|
+
let a = await r(i, e, n);
|
|
1607
|
+
return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
|
|
1608
1608
|
} catch (e) {
|
|
1609
1609
|
x(e);
|
|
1610
1610
|
} finally {
|
|
1611
|
-
|
|
1611
|
+
o.value = !1;
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
1614
|
async function A(e) {
|
|
1615
|
-
let { delete:
|
|
1616
|
-
typeof
|
|
1615
|
+
let { delete: n } = t;
|
|
1616
|
+
typeof n != "function" && _("delete");
|
|
1617
1617
|
let r = h("delete");
|
|
1618
|
-
|
|
1618
|
+
g("delete");
|
|
1619
1619
|
let i = y(e);
|
|
1620
|
-
|
|
1620
|
+
o.value = !0;
|
|
1621
1621
|
try {
|
|
1622
|
-
await
|
|
1622
|
+
await n(r, e), E(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
|
|
1623
1623
|
} catch (e) {
|
|
1624
1624
|
x(e);
|
|
1625
1625
|
} finally {
|
|
1626
|
-
|
|
1626
|
+
o.value = !1;
|
|
1627
1627
|
}
|
|
1628
1628
|
}
|
|
1629
|
-
async function j(e,
|
|
1630
|
-
let { setResolved: r } =
|
|
1631
|
-
typeof r != "function" &&
|
|
1629
|
+
async function j(e, n) {
|
|
1630
|
+
let { setResolved: r } = t;
|
|
1631
|
+
typeof r != "function" && _("setResolved");
|
|
1632
1632
|
let i = h("setResolved");
|
|
1633
|
-
|
|
1633
|
+
g("setResolved"), o.value = !0;
|
|
1634
1634
|
try {
|
|
1635
|
-
let a = await r(i, e,
|
|
1636
|
-
return T(a), S(() => (a.resolvedAt ?
|
|
1635
|
+
let a = await r(i, e, n);
|
|
1636
|
+
return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
|
|
1637
1637
|
} catch (e) {
|
|
1638
1638
|
x(e);
|
|
1639
1639
|
} finally {
|
|
1640
|
-
|
|
1640
|
+
o.value = !1;
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
function M(e) {
|
|
1644
|
-
T(e) && S(() =>
|
|
1644
|
+
T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
|
|
1645
1645
|
}
|
|
1646
1646
|
function N(e) {
|
|
1647
|
-
T(e) && S(() => (e.resolvedAt ?
|
|
1647
|
+
T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
1648
1648
|
}
|
|
1649
|
-
function P(e,
|
|
1650
|
-
let r = E(e,
|
|
1651
|
-
r && S(() =>
|
|
1649
|
+
function P(e, n) {
|
|
1650
|
+
let r = E(e, n);
|
|
1651
|
+
r && S(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
1652
1652
|
}
|
|
1653
1653
|
return {
|
|
1654
|
-
comments:
|
|
1655
|
-
isLoading:
|
|
1656
|
-
isSubmitting:
|
|
1657
|
-
canCreate:
|
|
1658
|
-
canUpdate:
|
|
1659
|
-
canDelete:
|
|
1660
|
-
canResolve:
|
|
1661
|
-
totalCount:
|
|
1662
|
-
unresolvedCount:
|
|
1663
|
-
commentCountByBlock:
|
|
1654
|
+
comments: i,
|
|
1655
|
+
isLoading: a,
|
|
1656
|
+
isSubmitting: o,
|
|
1657
|
+
canCreate: s,
|
|
1658
|
+
canUpdate: c,
|
|
1659
|
+
canDelete: l,
|
|
1660
|
+
canResolve: u,
|
|
1661
|
+
totalCount: d,
|
|
1662
|
+
unresolvedCount: f,
|
|
1663
|
+
commentCountByBlock: p,
|
|
1664
1664
|
load: D,
|
|
1665
1665
|
create: O,
|
|
1666
1666
|
update: k,
|
|
@@ -1677,11 +1677,11 @@ function Ge(e) {
|
|
|
1677
1677
|
let { comments: t, provider: n, getTemplateId: r } = e, { subscribe: i } = n;
|
|
1678
1678
|
if (typeof i != "function") return;
|
|
1679
1679
|
let a = null;
|
|
1680
|
-
function
|
|
1680
|
+
function o() {
|
|
1681
1681
|
a?.(), a = null;
|
|
1682
1682
|
}
|
|
1683
|
-
|
|
1684
|
-
|
|
1683
|
+
s(() => r(), (e) => {
|
|
1684
|
+
o(), e && (a = i(e, (e) => {
|
|
1685
1685
|
switch (e.type) {
|
|
1686
1686
|
case "created":
|
|
1687
1687
|
t.applyRemoteCreate(e.comment);
|
|
@@ -1692,13 +1692,13 @@ function Ge(e) {
|
|
|
1692
1692
|
case "deleted": t.applyRemoteDelete(e.commentId, e.parentId);
|
|
1693
1693
|
}
|
|
1694
1694
|
}));
|
|
1695
|
-
}, { immediate: !0 }),
|
|
1695
|
+
}, { immediate: !0 }), c(o);
|
|
1696
1696
|
}
|
|
1697
1697
|
// src/constants/timeouts.ts
|
|
1698
1698
|
var Ke = 1e4;
|
|
1699
1699
|
// src/composables/useImageUrlResolver.ts
|
|
1700
1700
|
function qe(e) {
|
|
1701
|
-
let t =
|
|
1701
|
+
let t = o(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
1702
1702
|
function r(e) {
|
|
1703
1703
|
return t.get(e);
|
|
1704
1704
|
}
|
|
@@ -1727,22 +1727,22 @@ function qe(e) {
|
|
|
1727
1727
|
};
|
|
1728
1728
|
}
|
|
1729
1729
|
function Je(e) {
|
|
1730
|
-
let t = n(K, null),
|
|
1731
|
-
if (!t) return
|
|
1732
|
-
let
|
|
1733
|
-
function
|
|
1734
|
-
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
let
|
|
1738
|
-
return
|
|
1739
|
-
|
|
1740
|
-
let n =
|
|
1741
|
-
|
|
1742
|
-
|
|
1730
|
+
let t = n(K, null), i = v(e);
|
|
1731
|
+
if (!t) return i;
|
|
1732
|
+
let a;
|
|
1733
|
+
function o() {
|
|
1734
|
+
a !== void 0 && (clearTimeout(a), a = void 0);
|
|
1735
|
+
}
|
|
1736
|
+
r() && c(o);
|
|
1737
|
+
let l = !0;
|
|
1738
|
+
return s(i, (e) => {
|
|
1739
|
+
o();
|
|
1740
|
+
let n = l;
|
|
1741
|
+
l = !1, e && !t.has(e) && (n ? t.lookup(e) : a = setTimeout(() => {
|
|
1742
|
+
a = void 0, t.lookup(e);
|
|
1743
1743
|
}, 300));
|
|
1744
|
-
}, { immediate: !0 }),
|
|
1745
|
-
let e =
|
|
1744
|
+
}, { immediate: !0 }), v(() => {
|
|
1745
|
+
let e = i.value;
|
|
1746
1746
|
if (!e) return e;
|
|
1747
1747
|
let n = t.get(e);
|
|
1748
1748
|
return typeof n == "string" && n.length > 0 ? n : e;
|
|
@@ -1762,7 +1762,7 @@ function Ze(e, t) {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
function Qe(e) {
|
|
1764
1764
|
let t = n(te, z.liquid), r = Je(() => Ze(e(), t));
|
|
1765
|
-
return
|
|
1765
|
+
return v(() => Xe(e(), t) ? null : r.value);
|
|
1766
1766
|
}
|
|
1767
1767
|
function $e(e, t, n) {
|
|
1768
1768
|
return Xe(t, n) ? null : Ye(e, Ze(t, n));
|
|
@@ -1849,31 +1849,31 @@ var lt = /* @__PURE__ */ t({
|
|
|
1849
1849
|
icon: 20,
|
|
1850
1850
|
veil: "85%"
|
|
1851
1851
|
}
|
|
1852
|
-
},
|
|
1853
|
-
return (t, r) => (
|
|
1854
|
-
class:
|
|
1855
|
-
style:
|
|
1856
|
-
}, [e.uploading ? (
|
|
1852
|
+
}, i = v(() => r[t.size]);
|
|
1853
|
+
return (t, r) => (a(), l("div", {
|
|
1854
|
+
class: x(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", i.value.gap]),
|
|
1855
|
+
style: p({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${i.value.veil}, transparent)` })
|
|
1856
|
+
}, [e.uploading ? (a(), l(b, { key: 0 }, [S(y(ae), {
|
|
1857
1857
|
class: "tpl-spinner",
|
|
1858
|
-
size:
|
|
1858
|
+
size: i.value.icon,
|
|
1859
1859
|
"stroke-width": 2
|
|
1860
|
-
}, null, 8, ["size"]),
|
|
1861
|
-
size:
|
|
1860
|
+
}, null, 8, ["size"]), d(" " + h(y(n).image.uploading), 1)], 64)) : (a(), l(b, { key: 1 }, [S(y(oe), {
|
|
1861
|
+
size: i.value.icon,
|
|
1862
1862
|
"stroke-width": 1.5
|
|
1863
|
-
}, null, 8, ["size"]),
|
|
1863
|
+
}, null, 8, ["size"]), d(" " + h(y(n).image.dropToUpload), 1)], 64))], 6));
|
|
1864
1864
|
}
|
|
1865
1865
|
});
|
|
1866
1866
|
// src/composables/useAliveFlag.ts
|
|
1867
1867
|
function ut() {
|
|
1868
1868
|
let e = { alive: !0 };
|
|
1869
|
-
return
|
|
1869
|
+
return g(() => {
|
|
1870
1870
|
e.alive = !1;
|
|
1871
1871
|
}), e;
|
|
1872
1872
|
}
|
|
1873
1873
|
// src/composables/useImageDrop.ts
|
|
1874
1874
|
var dt = "image/";
|
|
1875
1875
|
function ft(e) {
|
|
1876
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 ||
|
|
1876
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || u(r), { isOverDropZone: a } = W(t, {
|
|
1877
1877
|
preventDefaultForUnhandled: !0,
|
|
1878
1878
|
onDrop: (e) => {
|
|
1879
1879
|
if (!i()) return;
|
|
@@ -1881,42 +1881,42 @@ function ft(e) {
|
|
|
1881
1881
|
t.length > 0 && n([t[0]]);
|
|
1882
1882
|
}
|
|
1883
1883
|
});
|
|
1884
|
-
return { isOver:
|
|
1884
|
+
return { isOver: v(() => i() && a.value) };
|
|
1885
1885
|
}
|
|
1886
1886
|
// src/composables/useMediaDropField.ts
|
|
1887
|
-
function pt(
|
|
1888
|
-
let { target:
|
|
1889
|
-
async function
|
|
1890
|
-
let e = await
|
|
1891
|
-
|
|
1892
|
-
}
|
|
1893
|
-
let
|
|
1894
|
-
async function
|
|
1895
|
-
if (
|
|
1896
|
-
|
|
1887
|
+
function pt(e) {
|
|
1888
|
+
let { target: t, blocked: r, apply: i } = e, a = n(G, null), o = n(ne, null), s = ut();
|
|
1889
|
+
async function c() {
|
|
1890
|
+
let e = await a?.({ accept: ["images"] });
|
|
1891
|
+
s.alive && e && i(e);
|
|
1892
|
+
}
|
|
1893
|
+
let l = m(!1), d = v(() => (o?.value ?? !!a) && !l.value && !u(r));
|
|
1894
|
+
async function f(e) {
|
|
1895
|
+
if (a) {
|
|
1896
|
+
l.value = !0;
|
|
1897
1897
|
try {
|
|
1898
|
-
let t = await
|
|
1898
|
+
let t = await a({
|
|
1899
1899
|
accept: ["images"],
|
|
1900
1900
|
files: e
|
|
1901
1901
|
});
|
|
1902
|
-
if (!
|
|
1903
|
-
t &&
|
|
1902
|
+
if (!s.alive) return;
|
|
1903
|
+
t && i(t);
|
|
1904
1904
|
} finally {
|
|
1905
|
-
|
|
1905
|
+
s.alive && (l.value = !1);
|
|
1906
1906
|
}
|
|
1907
1907
|
}
|
|
1908
1908
|
}
|
|
1909
|
-
let { isOver:
|
|
1910
|
-
target:
|
|
1909
|
+
let { isOver: p } = ft({
|
|
1910
|
+
target: t,
|
|
1911
1911
|
enabled: d,
|
|
1912
|
-
onFiles:
|
|
1913
|
-
}), h =
|
|
1912
|
+
onFiles: f
|
|
1913
|
+
}), h = v(() => d.value && p.value || l.value);
|
|
1914
1914
|
return {
|
|
1915
|
-
canBrowse: !!
|
|
1915
|
+
canBrowse: !!a,
|
|
1916
1916
|
dropEnabled: d,
|
|
1917
|
-
isUploading:
|
|
1917
|
+
isUploading: l,
|
|
1918
1918
|
showOverlay: h,
|
|
1919
|
-
openMediaBrowser:
|
|
1919
|
+
openMediaBrowser: c
|
|
1920
1920
|
};
|
|
1921
1921
|
}
|
|
1922
1922
|
function mt(e, t = "desktop") {
|
|
@@ -2005,4 +2005,4 @@ var Tt = R, Et = {
|
|
|
2005
2005
|
];
|
|
2006
2006
|
export { Re as A, Qe as C, Ue as D, We as E, pe as F, X as I, fe as L, ge as M, he as N, He as O, me as P, Y as R, $e as S, Ge as T, nt as _, wt as a, qe as b, mt as c, lt as d, st as f, it as g, at as h, St as i, Le as j, $ as k, pt as l, ot as m, Tt as n, Ct as o, ct as p, Dt as r, ht as s, Et as t, ut as u, tt as v, Je as w, Ze as x, et as y, ce as z };
|
|
2007
2007
|
|
|
2008
|
-
//# sourceMappingURL=socialIcons-
|
|
2008
|
+
//# sourceMappingURL=socialIcons-jsTDmkbb.js.map
|