@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,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Ot as C, S as w, St as T, U as E, X as D, Y as O, _ as k, b as A, f as j, ft as M, g as N, it as P, k as F, l as I, m as L, p as R, ut as z, v as ee, vt as B, w as V, x as te, y as H } from "./dist-
|
|
3
|
-
import { r as U } from "./dist-
|
|
4
|
-
import { L as W, P as ne, c as re, x as G } from "./keys-
|
|
5
|
-
import { t as ie } from "./useI18n-
|
|
6
|
-
import { o as ae, s as K } from "./usePopoverPosition-
|
|
7
|
-
import { t as q } from "./createLucideIcon-
|
|
8
|
-
import { t as oe } from "./upload-
|
|
9
|
-
import { t as se } from "./loader-circle-
|
|
1
|
+
import { $ as e, C as t, K as n, Mt as r, Nt as i, O as a, Q as o, W as s, X as c, Z as l, _ as u, at as d, c as f, ct as p, f as m, g as h, j as g, jt as _, r as v, st as y, tt as b, y as x, z as S } from "./vue.runtime.esm-bundler-CnEeTfhs.js";
|
|
2
|
+
import { Ot as C, S as w, St as T, U as E, X as D, Y as O, _ as k, b as A, f as j, ft as M, g as N, it as P, k as F, l as I, m as L, p as R, ut as z, v as ee, vt as B, w as V, x as te, y as H } from "./dist-CKi_npZM.js";
|
|
3
|
+
import { r as U } from "./dist-ByCWA2Tv.js";
|
|
4
|
+
import { L as W, P as ne, c as re, x as G } from "./keys-BgRERHzu.js";
|
|
5
|
+
import { t as ie } from "./useI18n-BBrHTdu8.js";
|
|
6
|
+
import { o as ae, s as K } from "./usePopoverPosition-DV1PxL66.js";
|
|
7
|
+
import { t as q } from "./createLucideIcon-CvhTA2KG.js";
|
|
8
|
+
import { t as oe } from "./upload-DuFEOi_0.js";
|
|
9
|
+
import { t as se } from "./loader-circle-BZRD0a4I.js";
|
|
10
10
|
// ../core/dist/index.js
|
|
11
11
|
function J(e) {
|
|
12
12
|
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
@@ -18,12 +18,12 @@ function Y(e, t) {
|
|
|
18
18
|
e?.(J(t));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function ce(
|
|
22
|
-
let
|
|
23
|
-
H(
|
|
24
|
-
let
|
|
21
|
+
function ce(t) {
|
|
22
|
+
let n = t.content ?? F(t.defaultFontFamily, t.templateDefaults);
|
|
23
|
+
H(n), A(n);
|
|
24
|
+
let r = l({
|
|
25
25
|
template: null,
|
|
26
|
-
content:
|
|
26
|
+
content: n,
|
|
27
27
|
selectedBlockId: null,
|
|
28
28
|
viewport: "desktop",
|
|
29
29
|
darkMode: !1,
|
|
@@ -32,16 +32,16 @@ function ce(e) {
|
|
|
32
32
|
isSaving: !1,
|
|
33
33
|
isLoading: !1,
|
|
34
34
|
uiTheme: "auto"
|
|
35
|
-
}),
|
|
35
|
+
}), i = e(0), a = 0, c = 0;
|
|
36
36
|
function u() {
|
|
37
|
-
|
|
37
|
+
r.isDirty = !0, c++;
|
|
38
38
|
}
|
|
39
|
-
let d =
|
|
40
|
-
get: () =>
|
|
39
|
+
let d = s({
|
|
40
|
+
get: () => r.content,
|
|
41
41
|
set: (e) => {
|
|
42
|
-
|
|
42
|
+
r.content = e, u();
|
|
43
43
|
}
|
|
44
|
-
}), f =
|
|
44
|
+
}), f = s(() => r.selectedBlockId ? p(r.content.blocks, r.selectedBlockId) : null);
|
|
45
45
|
function p(e, t) {
|
|
46
46
|
for (let n of e) {
|
|
47
47
|
if (n.id === t) return n;
|
|
@@ -70,94 +70,94 @@ function ce(e) {
|
|
|
70
70
|
}
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
|
-
function g(
|
|
74
|
-
return
|
|
73
|
+
function g(e) {
|
|
74
|
+
return t.lockedBlocks?.value.has(e) ?? !1;
|
|
75
75
|
}
|
|
76
76
|
function _(e) {
|
|
77
|
-
let t = h(
|
|
77
|
+
let t = h(r.content.blocks, e);
|
|
78
78
|
if (!t) return null;
|
|
79
|
-
let
|
|
80
|
-
return
|
|
79
|
+
let n = t.blocks.findIndex((t) => t.id === e);
|
|
80
|
+
return n === -1 ? null : {
|
|
81
81
|
targetSectionId: t.sectionId,
|
|
82
82
|
columnIndex: t.columnIndex,
|
|
83
|
-
index:
|
|
83
|
+
index: n
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
function v(e, t = !0) {
|
|
87
|
-
H(e), A(e),
|
|
87
|
+
H(e), A(e), r.content = e, t && u();
|
|
88
88
|
}
|
|
89
89
|
function y(e) {
|
|
90
|
-
e && g(e) || (
|
|
90
|
+
e && g(e) || (r.selectedBlockId = e);
|
|
91
91
|
}
|
|
92
92
|
function b(e) {
|
|
93
|
-
|
|
93
|
+
r.viewport = e;
|
|
94
94
|
}
|
|
95
95
|
function x(e) {
|
|
96
|
-
|
|
96
|
+
r.darkMode = e;
|
|
97
97
|
}
|
|
98
98
|
function S(e) {
|
|
99
|
-
|
|
99
|
+
r.uiTheme = e;
|
|
100
100
|
}
|
|
101
101
|
function C(e) {
|
|
102
|
-
|
|
102
|
+
r.previewMode = e, e && (r.selectedBlockId = null);
|
|
103
103
|
}
|
|
104
104
|
function w(e, t) {
|
|
105
105
|
if (g(e)) return;
|
|
106
|
-
let
|
|
107
|
-
|
|
106
|
+
let n = p(r.content.blocks, e);
|
|
107
|
+
n && (Object.assign(n, t), u());
|
|
108
108
|
}
|
|
109
109
|
function T(e) {
|
|
110
|
-
|
|
111
|
-
...
|
|
110
|
+
r.content.settings = {
|
|
111
|
+
...r.content.settings,
|
|
112
112
|
...e
|
|
113
113
|
}, u();
|
|
114
114
|
}
|
|
115
|
-
function E(e, t,
|
|
115
|
+
function E(e, t, n = 0, i) {
|
|
116
116
|
let a = {
|
|
117
|
-
settings:
|
|
117
|
+
settings: r.content.settings,
|
|
118
118
|
blocks: [e]
|
|
119
119
|
};
|
|
120
120
|
if (H(a), A(a), !(t && e.type === "section")) {
|
|
121
121
|
if (t) {
|
|
122
122
|
if (g(t)) return;
|
|
123
|
-
let a = p(
|
|
123
|
+
let a = p(r.content.blocks, t);
|
|
124
124
|
if (a && a.type === "section") {
|
|
125
|
-
if (
|
|
126
|
-
a.children[
|
|
127
|
-
let t = a.children[
|
|
125
|
+
if (n < 0 || n >= D(a.columns)) return;
|
|
126
|
+
a.children[n] = a.children[n] || [];
|
|
127
|
+
let t = a.children[n];
|
|
128
128
|
i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
|
|
129
129
|
}
|
|
130
|
-
} else i !== void 0 && i <
|
|
130
|
+
} else i !== void 0 && i < r.content.blocks.length ? r.content.blocks.splice(i, 0, e) : r.content.blocks.push(e);
|
|
131
131
|
u();
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
function O(e) {
|
|
135
135
|
if (g(e)) return;
|
|
136
|
-
let t = h(
|
|
136
|
+
let t = h(r.content.blocks, e);
|
|
137
137
|
if (t) {
|
|
138
|
-
let
|
|
139
|
-
if (
|
|
140
|
-
let [e] = t.blocks.splice(
|
|
141
|
-
if (
|
|
138
|
+
let n = t.blocks.findIndex((t) => t.id === e);
|
|
139
|
+
if (n !== -1) {
|
|
140
|
+
let [e] = t.blocks.splice(n, 1);
|
|
141
|
+
if (r.selectedBlockId) {
|
|
142
142
|
let t = /* @__PURE__ */ new Set();
|
|
143
|
-
m(e, t), t.has(
|
|
143
|
+
m(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
|
|
144
144
|
}
|
|
145
145
|
u();
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
function k(e, t,
|
|
150
|
-
if (g(e) ||
|
|
151
|
-
let a = h(
|
|
149
|
+
function k(e, t, n, i = 0) {
|
|
150
|
+
if (g(e) || n && g(n)) return;
|
|
151
|
+
let a = h(r.content.blocks, e);
|
|
152
152
|
if (!a) return;
|
|
153
153
|
let o = a.blocks.findIndex((t) => t.id === e);
|
|
154
|
-
if (o === -1 ||
|
|
154
|
+
if (o === -1 || n && a.blocks[o].type === "section") return;
|
|
155
155
|
let s;
|
|
156
|
-
if (
|
|
157
|
-
let e = p(
|
|
156
|
+
if (n) {
|
|
157
|
+
let e = p(r.content.blocks, n);
|
|
158
158
|
if (!e || e.type !== "section" || i < 0 || i >= D(e.columns)) return;
|
|
159
159
|
e.children[i] = e.children[i] || [], s = e.children[i];
|
|
160
|
-
} else s =
|
|
160
|
+
} else s = r.content.blocks;
|
|
161
161
|
let [c] = a.blocks.splice(o, 1);
|
|
162
162
|
s.splice(t, 0, c), u();
|
|
163
163
|
}
|
|
@@ -167,84 +167,84 @@ function ce(e) {
|
|
|
167
167
|
function M(e, t) {
|
|
168
168
|
throw new L(`[Templatical] Templates: ${e} ${t}`);
|
|
169
169
|
}
|
|
170
|
-
function N(
|
|
171
|
-
Y(
|
|
170
|
+
function N(e) {
|
|
171
|
+
Y(t.onError, e);
|
|
172
172
|
}
|
|
173
|
-
function P(
|
|
174
|
-
let { templates: n } =
|
|
175
|
-
return n || M(
|
|
173
|
+
function P(e) {
|
|
174
|
+
let { templates: n } = t;
|
|
175
|
+
return n || M(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
176
176
|
}
|
|
177
177
|
function I(e) {
|
|
178
|
-
|
|
179
|
-
...
|
|
178
|
+
r.template && (r.template = {
|
|
179
|
+
...r.template,
|
|
180
180
|
name: e
|
|
181
181
|
}, u());
|
|
182
182
|
}
|
|
183
|
-
async function R(
|
|
184
|
-
let
|
|
183
|
+
async function R(e) {
|
|
184
|
+
let n = P("create()"), { create: o } = n;
|
|
185
185
|
typeof o != "function" && M("create()", "is disabled by the provider — its `create` is `false`.");
|
|
186
|
-
let s, l = ++
|
|
187
|
-
|
|
186
|
+
let s, l = ++a;
|
|
187
|
+
r.isLoading = !0;
|
|
188
188
|
try {
|
|
189
|
-
|
|
190
|
-
let
|
|
191
|
-
s = await o(
|
|
192
|
-
name:
|
|
193
|
-
content:
|
|
194
|
-
}),
|
|
195
|
-
} catch (
|
|
196
|
-
throw
|
|
189
|
+
e?.content && (r.content = e.content);
|
|
190
|
+
let t = c;
|
|
191
|
+
s = await o(e?.name === void 0 ? { content: r.content } : {
|
|
192
|
+
name: e.name,
|
|
193
|
+
content: r.content
|
|
194
|
+
}), r.template = s, c === t && (r.isDirty = !1), i.value++;
|
|
195
|
+
} catch (e) {
|
|
196
|
+
throw t.onError?.(e), e;
|
|
197
197
|
} finally {
|
|
198
|
-
|
|
198
|
+
a === l && (r.isLoading = !1);
|
|
199
199
|
}
|
|
200
|
-
return N(() =>
|
|
200
|
+
return N(() => n.onCreated?.(s)), s;
|
|
201
201
|
}
|
|
202
|
-
async function z(
|
|
203
|
-
let o = P("load()"), s, c = ++
|
|
204
|
-
|
|
202
|
+
async function z(e, n) {
|
|
203
|
+
let o = P("load()"), s, c = ++a;
|
|
204
|
+
r.isLoading = !0;
|
|
205
205
|
try {
|
|
206
|
-
if (s = await o.load(
|
|
207
|
-
|
|
208
|
-
} catch (
|
|
209
|
-
throw
|
|
206
|
+
if (s = await o.load(e), H(s.content), A(s.content), n && !n()) return s;
|
|
207
|
+
r.template = s, r.content = s.content, r.isDirty = !1, i.value++;
|
|
208
|
+
} catch (e) {
|
|
209
|
+
throw t.onError?.(e), e;
|
|
210
210
|
} finally {
|
|
211
|
-
|
|
211
|
+
a === c && (r.isLoading = !1);
|
|
212
212
|
}
|
|
213
213
|
return N(() => o.onLoaded?.(s)), s;
|
|
214
214
|
}
|
|
215
|
-
async function ee(
|
|
216
|
-
let
|
|
215
|
+
async function ee(e = "api") {
|
|
216
|
+
let n = P("save()"), { save: i } = n;
|
|
217
217
|
typeof i != "function" && M("save()", "is disabled by the provider — its `save` is `false`.");
|
|
218
|
-
let a =
|
|
218
|
+
let a = r.template;
|
|
219
219
|
a || M("save()", "has no template loaded. Call create() or load() first.");
|
|
220
|
-
let o = a.name === void 0 ? { content:
|
|
220
|
+
let o = a.name === void 0 ? { content: r.content } : {
|
|
221
221
|
name: a.name,
|
|
222
|
-
content:
|
|
222
|
+
content: r.content
|
|
223
223
|
}, s;
|
|
224
|
-
|
|
224
|
+
r.isSaving = !0;
|
|
225
225
|
try {
|
|
226
226
|
let e = c;
|
|
227
|
-
if (s = await i(a.id, o),
|
|
228
|
-
let e =
|
|
229
|
-
|
|
227
|
+
if (s = await i(a.id, o), r.template?.id === a.id) {
|
|
228
|
+
let e = r.template.name;
|
|
229
|
+
r.template = e === a.name ? s : {
|
|
230
230
|
...s,
|
|
231
231
|
name: e
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
c === e && (
|
|
235
|
-
} catch (
|
|
236
|
-
throw
|
|
234
|
+
c === e && (r.isDirty = !1);
|
|
235
|
+
} catch (e) {
|
|
236
|
+
throw t.onError?.(e), e;
|
|
237
237
|
} finally {
|
|
238
|
-
|
|
238
|
+
r.isSaving = !1;
|
|
239
239
|
}
|
|
240
|
-
return N(() =>
|
|
240
|
+
return N(() => n.onSaved?.(s, { trigger: e })), s;
|
|
241
241
|
}
|
|
242
242
|
function B() {
|
|
243
|
-
return
|
|
243
|
+
return r.template?.id !== void 0;
|
|
244
244
|
}
|
|
245
245
|
return {
|
|
246
|
-
state:
|
|
247
|
-
loadVersion:
|
|
246
|
+
state: o(r),
|
|
247
|
+
loadVersion: o(i),
|
|
248
248
|
content: d,
|
|
249
249
|
selectedBlock: f,
|
|
250
250
|
isBlockLocked: g,
|
|
@@ -269,24 +269,24 @@ function ce(e) {
|
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
271
|
var le = 50, ue = 300, de = 1500;
|
|
272
|
-
function fe(
|
|
273
|
-
let { content:
|
|
272
|
+
function fe(t) {
|
|
273
|
+
let { content: n, setContent: r, maxSize: i = le } = t, a = e([]), o = e([]), c = e(!1), l = null, u = null, d = s(() => a.value.length > 0), f = s(() => o.value.length > 0);
|
|
274
274
|
function p() {
|
|
275
|
-
return T(
|
|
275
|
+
return T(n.value);
|
|
276
276
|
}
|
|
277
277
|
function m(e) {
|
|
278
|
-
|
|
278
|
+
a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
|
|
279
279
|
}
|
|
280
280
|
function h() {
|
|
281
281
|
u &&= (clearTimeout(u.timeoutId), null);
|
|
282
282
|
}
|
|
283
283
|
function g() {
|
|
284
|
-
h(), m(p()),
|
|
284
|
+
h(), m(p()), o.value = [];
|
|
285
285
|
}
|
|
286
286
|
function _(e) {
|
|
287
287
|
u && u.blockId === e ? (clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
|
|
288
288
|
u = null;
|
|
289
|
-
}, ue)) : (h(), m(p()),
|
|
289
|
+
}, ue)) : (h(), m(p()), o.value = [], u = {
|
|
290
290
|
blockId: e,
|
|
291
291
|
timeoutId: setTimeout(() => {
|
|
292
292
|
u = null;
|
|
@@ -299,19 +299,19 @@ function fe(e) {
|
|
|
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(p()), r(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(p()), r(e, !0), v();
|
|
312
312
|
}
|
|
313
313
|
function x() {
|
|
314
|
-
|
|
314
|
+
a.value = [], o.value = [], h();
|
|
315
315
|
}
|
|
316
316
|
function S() {
|
|
317
317
|
x(), l &&= (clearTimeout(l), null);
|
|
@@ -374,27 +374,27 @@ function me(e) {
|
|
|
374
374
|
function f() {
|
|
375
375
|
d(), n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function m() {
|
|
378
378
|
c() && !s && (d(), o = setTimeout(() => {
|
|
379
379
|
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
380
380
|
}, i));
|
|
381
381
|
}
|
|
382
|
-
let
|
|
383
|
-
|
|
382
|
+
let h = p(t, () => {
|
|
383
|
+
m();
|
|
384
384
|
}, { deep: !0 });
|
|
385
|
-
function
|
|
386
|
-
|
|
385
|
+
function g() {
|
|
386
|
+
h(), d();
|
|
387
387
|
}
|
|
388
388
|
return {
|
|
389
389
|
flush: f,
|
|
390
390
|
cancel: d,
|
|
391
391
|
pause: l,
|
|
392
392
|
resume: u,
|
|
393
|
-
destroy:
|
|
393
|
+
destroy: g
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
396
|
function he(e) {
|
|
397
|
-
let t =
|
|
397
|
+
let t = l(/* @__PURE__ */ new Set()), n = s(() => t.size > 0);
|
|
398
398
|
function r(e) {
|
|
399
399
|
return t.has(e);
|
|
400
400
|
}
|
|
@@ -411,34 +411,34 @@ function he(e) {
|
|
|
411
411
|
hasHiddenBlocks: n
|
|
412
412
|
};
|
|
413
413
|
}
|
|
414
|
-
function ge(
|
|
415
|
-
let
|
|
416
|
-
async function
|
|
417
|
-
let
|
|
418
|
-
if (
|
|
419
|
-
|
|
414
|
+
function ge(t) {
|
|
415
|
+
let n = e(!1), r = e(!1), i = s(() => !!t.definition.value?.dataSource), a = s(() => i.value && !t.block.value.dataSourceFetched);
|
|
416
|
+
async function o() {
|
|
417
|
+
let e = t.definition.value;
|
|
418
|
+
if (e?.dataSource) {
|
|
419
|
+
n.value = !0, r.value = !1;
|
|
420
420
|
try {
|
|
421
|
-
let
|
|
422
|
-
fieldValues: { ...
|
|
423
|
-
blockId:
|
|
421
|
+
let n = await e.dataSource.onFetch({
|
|
422
|
+
fieldValues: { ...t.block.value.fieldValues },
|
|
423
|
+
blockId: t.block.value.id
|
|
424
424
|
});
|
|
425
|
-
if (
|
|
426
|
-
let
|
|
427
|
-
for (let e of Object.keys(
|
|
428
|
-
|
|
425
|
+
if (n == null) return;
|
|
426
|
+
let r = { ...t.block.value.fieldValues };
|
|
427
|
+
for (let e of Object.keys(r)) e in n && (r[e] = n[e]);
|
|
428
|
+
t.onUpdate(r, !0);
|
|
429
429
|
} catch (e) {
|
|
430
|
-
console.warn("[Templatical] Data source fetch error:", e),
|
|
430
|
+
console.warn("[Templatical] Data source fetch error:", e), r.value = !0;
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
n.value = !1;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
return {
|
|
437
|
-
isFetching:
|
|
438
|
-
fetchError:
|
|
439
|
-
fetch:
|
|
440
|
-
hasDataSource:
|
|
441
|
-
needsFetch:
|
|
437
|
+
isFetching: n,
|
|
438
|
+
fetchError: r,
|
|
439
|
+
fetch: o,
|
|
440
|
+
hasDataSource: i,
|
|
441
|
+
needsFetch: a
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
function _e(e, t) {
|
|
@@ -646,13 +646,13 @@ function Le(e) {
|
|
|
646
646
|
return n;
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
|
-
function Re(
|
|
650
|
-
let { provider:
|
|
651
|
-
function F(
|
|
652
|
-
|
|
649
|
+
function Re(t) {
|
|
650
|
+
let { provider: r } = t, i = t.sessionId ?? crypto.randomUUID(), a = t.maxUndo ?? ke, o = typeof r.acquireLock == "function" && typeof r.renewLock == "function" && typeof r.releaseLock == "function", l = b([]), u = b(/* @__PURE__ */ new Map()), d = e(null), f = e(0), m = e(0), h = null, g = null, _ = !1, v = !1, y = !1, x = null, S = 0, C = !1, w = [], D = null, O = null, A = Promise.resolve(), j = null, M = s(() => (m.value, (g?.undo.length ?? 0) > 0)), N = s(() => (m.value, (g?.redo.length ?? 0) > 0));
|
|
651
|
+
function F(e) {
|
|
652
|
+
t.onError?.(e instanceof Error ? e : Error(String(e)));
|
|
653
653
|
}
|
|
654
|
-
function L(
|
|
655
|
-
n !== g || C ||
|
|
654
|
+
function L(e, n = g) {
|
|
655
|
+
n !== g || C || t.onNotice?.(e);
|
|
656
656
|
}
|
|
657
657
|
function R() {
|
|
658
658
|
return {
|
|
@@ -660,14 +660,14 @@ function Re(e) {
|
|
|
660
660
|
blockId: e.blockId,
|
|
661
661
|
sessionId: e.holder.sessionId
|
|
662
662
|
})),
|
|
663
|
-
session:
|
|
663
|
+
session: i
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
666
|
function z() {
|
|
667
667
|
m.value++;
|
|
668
668
|
}
|
|
669
669
|
function B(e, t) {
|
|
670
|
-
e.push(t), e.length >
|
|
670
|
+
e.push(t), e.length > a && e.splice(0, e.length - a);
|
|
671
671
|
}
|
|
672
672
|
function V(e) {
|
|
673
673
|
if (!h || _) return;
|
|
@@ -770,23 +770,23 @@ function Re(e) {
|
|
|
770
770
|
let t = e.pending.find((e) => !e.sent);
|
|
771
771
|
t ? (t.sent = !0, e.inFlight = t, ie(e, t, 0)) : J(e);
|
|
772
772
|
}
|
|
773
|
-
function ie(e,
|
|
774
|
-
|
|
775
|
-
batchId:
|
|
773
|
+
function ie(e, t, n) {
|
|
774
|
+
r.submit(e.templateId, {
|
|
775
|
+
batchId: t.batchId,
|
|
776
776
|
baseRevision: e.revision,
|
|
777
|
-
ops:
|
|
778
|
-
...
|
|
779
|
-
}).then(({ revision:
|
|
780
|
-
e.inFlight = null, ae(e,
|
|
781
|
-
}, (
|
|
782
|
-
if (Me(
|
|
783
|
-
else if (Pe(
|
|
784
|
-
Y(e,
|
|
785
|
-
let i = Oe[Math.min(
|
|
777
|
+
ops: t.ops,
|
|
778
|
+
...t.origin === "ai" ? { origin: "ai" } : {}
|
|
779
|
+
}).then(({ revision: n }) => {
|
|
780
|
+
e.inFlight = null, ae(e, t, n), G(e);
|
|
781
|
+
}, (r) => {
|
|
782
|
+
if (Me(r) !== null) e.inFlight = null, se(e, t, r), G(e);
|
|
783
|
+
else if (Pe(r)) {
|
|
784
|
+
Y(e, r);
|
|
785
|
+
let i = Oe[Math.min(n, Oe.length - 1)];
|
|
786
786
|
setTimeout(() => {
|
|
787
|
-
C || ie(e,
|
|
787
|
+
C || ie(e, t, n + 1);
|
|
788
788
|
}, i);
|
|
789
|
-
} else e.inFlight = null, F(
|
|
789
|
+
} else e.inFlight = null, F(r), se(e, t, r), G(e);
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
function ae(e, t, n) {
|
|
@@ -837,36 +837,36 @@ function Re(e) {
|
|
|
837
837
|
let n = e.pending.find((e) => e.batchId === t.batchId);
|
|
838
838
|
n ? ae(e, n, t.revision) : (e.remote.set(t.revision, t), ue(e));
|
|
839
839
|
}
|
|
840
|
-
function le(
|
|
840
|
+
function le(e, n) {
|
|
841
841
|
let r = n.ops;
|
|
842
|
-
if (
|
|
843
|
-
r =
|
|
842
|
+
if (t.normalizeRemoteOperations) try {
|
|
843
|
+
r = t.normalizeRemoteOperations(n.ops, e.confirmed);
|
|
844
844
|
} catch (e) {
|
|
845
845
|
F(e);
|
|
846
846
|
}
|
|
847
847
|
return Le(r);
|
|
848
848
|
}
|
|
849
|
-
function ue(
|
|
849
|
+
function ue(e) {
|
|
850
850
|
let n = [], r = !1;
|
|
851
851
|
for (;;) {
|
|
852
|
-
let
|
|
852
|
+
let t = e.revision + 1, i = e.remote.get(t), a = e.own.get(t);
|
|
853
853
|
if (!i && !a) break;
|
|
854
854
|
try {
|
|
855
|
-
|
|
855
|
+
e.confirmed = k(e.confirmed, i ? le(e, i) : a.ops);
|
|
856
856
|
} catch {
|
|
857
|
-
if (
|
|
858
|
-
|
|
857
|
+
if (e.recovering) {
|
|
858
|
+
e.remote.clear(), e.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
|
|
859
859
|
return;
|
|
860
860
|
}
|
|
861
|
-
me(
|
|
861
|
+
me(e);
|
|
862
862
|
return;
|
|
863
863
|
}
|
|
864
|
-
|
|
864
|
+
e.revision = t, i ? (e.remote.delete(t), n.push(i)) : (e.own.delete(t), a.group.dropped && (r = !0), K(e, a));
|
|
865
865
|
}
|
|
866
|
-
if (
|
|
867
|
-
|
|
868
|
-
actor:
|
|
869
|
-
ops:
|
|
866
|
+
if (e === g && (f.value = e.revision), e.remote.size > 0 || e.own.size > 0 ? fe(e) : pe(e), (n.length !== 0 || r) && (de(e), e === g)) for (let e of n) try {
|
|
867
|
+
t.onRemoteChange?.({
|
|
868
|
+
actor: e.actor,
|
|
869
|
+
ops: e.ops
|
|
870
870
|
});
|
|
871
871
|
} catch (e) {
|
|
872
872
|
F(e);
|
|
@@ -908,13 +908,13 @@ function Re(e) {
|
|
|
908
908
|
let e = g;
|
|
909
909
|
return e ? (e.catchingUp ||= (async () => {
|
|
910
910
|
try {
|
|
911
|
-
let
|
|
911
|
+
let t = await r.operationsAfter(e.templateId, e.revision);
|
|
912
912
|
if (e.retired) return;
|
|
913
|
-
if ("resync" in
|
|
913
|
+
if ("resync" in t) {
|
|
914
914
|
await me(e);
|
|
915
915
|
return;
|
|
916
916
|
}
|
|
917
|
-
for (let
|
|
917
|
+
for (let n of t.batches) ce(e, n);
|
|
918
918
|
} catch (e) {
|
|
919
919
|
F(e);
|
|
920
920
|
} finally {
|
|
@@ -922,31 +922,31 @@ function Re(e) {
|
|
|
922
922
|
}
|
|
923
923
|
})(), e.catchingUp) : Promise.resolve();
|
|
924
924
|
}
|
|
925
|
-
async function me(
|
|
926
|
-
|
|
925
|
+
async function me(e) {
|
|
926
|
+
e.recovering = !0;
|
|
927
927
|
try {
|
|
928
|
-
let n = await
|
|
929
|
-
if (
|
|
930
|
-
let r = n.revision ??
|
|
931
|
-
|
|
932
|
-
for (let [
|
|
933
|
-
|
|
928
|
+
let n = await t.loadTemplate(e.templateId);
|
|
929
|
+
if (e.retired) return;
|
|
930
|
+
let r = n.revision ?? e.revision;
|
|
931
|
+
e.confirmed = T(n.content), e.revision = r, e.remote = new Map([...e.remote].filter(([e]) => e > r));
|
|
932
|
+
for (let [t, n] of [...e.own]) t <= r && (e.own.delete(t), K(e, n));
|
|
933
|
+
e === g && (f.value = r), de(e), ue(e);
|
|
934
934
|
} catch (e) {
|
|
935
935
|
F(e);
|
|
936
936
|
} finally {
|
|
937
|
-
|
|
937
|
+
e.recovering = !1;
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
|
-
function he(
|
|
941
|
-
let n = () =>
|
|
940
|
+
function he(e) {
|
|
941
|
+
let n = () => e === g && !e.retired;
|
|
942
942
|
return {
|
|
943
|
-
onBatch: (
|
|
944
|
-
n() && ce(
|
|
943
|
+
onBatch: (t) => {
|
|
944
|
+
n() && ce(e, t);
|
|
945
945
|
},
|
|
946
946
|
onResync: (r, i) => {
|
|
947
|
-
if (!(!n() || r <=
|
|
947
|
+
if (!(!n() || r <= e.revision)) {
|
|
948
948
|
if (i) try {
|
|
949
|
-
|
|
949
|
+
t.onRemoteResync?.({
|
|
950
950
|
revision: r,
|
|
951
951
|
actor: i
|
|
952
952
|
});
|
|
@@ -965,14 +965,14 @@ function Re(e) {
|
|
|
965
965
|
onMembers: (e) => {
|
|
966
966
|
n() && Ce(e);
|
|
967
967
|
},
|
|
968
|
-
onConnectionChange: (
|
|
969
|
-
n() && ye(
|
|
968
|
+
onConnectionChange: (t) => {
|
|
969
|
+
n() && ye(e, t);
|
|
970
970
|
}
|
|
971
971
|
};
|
|
972
972
|
}
|
|
973
|
-
function ge(e,
|
|
974
|
-
|
|
975
|
-
e.retired || e !== g ?
|
|
973
|
+
function ge(e, t) {
|
|
974
|
+
r.join(e.templateId, { sessionId: i }, he(e)).then((n) => {
|
|
975
|
+
e.retired || e !== g ? t || n.leave() : (e.leave = n.leave, Z(n.locks, !t), Ce(n.members), n.members.length > 0 && (d.value = "connected"), n.revision > e.revision && X(), t && Q());
|
|
976
976
|
}, (e) => F(e));
|
|
977
977
|
}
|
|
978
978
|
function _e(e) {
|
|
@@ -994,7 +994,7 @@ function Re(e) {
|
|
|
994
994
|
redo: [],
|
|
995
995
|
waiters: []
|
|
996
996
|
};
|
|
997
|
-
g = n,
|
|
997
|
+
g = n, f.value = n.revision, z(), ge(n, !1), h?.state.selectedBlockId && Be(h.state.selectedBlockId), te();
|
|
998
998
|
}
|
|
999
999
|
function ve(e) {
|
|
1000
1000
|
e.retired = !0, pe(e), e.leave?.(), e.leave = null, Y(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
|
|
@@ -1007,7 +1007,7 @@ function Re(e) {
|
|
|
1007
1007
|
g && g.templateId === e?.id || (g &&= (H(), ve(g), null), l.value = [], u.value = /* @__PURE__ */ new Map(), d.value = null, D = null, Q(), z(), e && _e(e));
|
|
1008
1008
|
}
|
|
1009
1009
|
function xe(e) {
|
|
1010
|
-
if (e.holder.sessionId ===
|
|
1010
|
+
if (e.holder.sessionId === i) return;
|
|
1011
1011
|
let t = new Map([...u.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
|
|
1012
1012
|
t.set(e.blockId, e), u.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), L({
|
|
1013
1013
|
type: "selectionRefused",
|
|
@@ -1022,7 +1022,7 @@ function Re(e) {
|
|
|
1022
1022
|
}
|
|
1023
1023
|
function Z(e, t) {
|
|
1024
1024
|
let n = t ? new Map(u.value) : /* @__PURE__ */ new Map();
|
|
1025
|
-
for (let
|
|
1025
|
+
for (let r of e) r.holder.sessionId !== i && (t && n.has(r.blockId) || n.set(r.blockId, r));
|
|
1026
1026
|
u.value = n;
|
|
1027
1027
|
}
|
|
1028
1028
|
function Ce(e) {
|
|
@@ -1035,21 +1035,21 @@ function Re(e) {
|
|
|
1035
1035
|
A = A.then(e).catch(F);
|
|
1036
1036
|
}
|
|
1037
1037
|
function Q() {
|
|
1038
|
-
|
|
1038
|
+
o && we(async () => {
|
|
1039
1039
|
if (O && (D === null || O.templateId !== D.templateId)) {
|
|
1040
1040
|
let e = O;
|
|
1041
|
-
O = null, $(), await
|
|
1041
|
+
O = null, $(), await r.releaseLock(e.templateId, e.blockId);
|
|
1042
1042
|
}
|
|
1043
1043
|
let e = D;
|
|
1044
1044
|
if (!(!e || O?.templateId === e.templateId && O.blockId === e.blockId)) try {
|
|
1045
|
-
await
|
|
1046
|
-
} catch (
|
|
1045
|
+
await r.acquireLock(e.templateId, e.blockId), O = e, ze(), je(e.blockId);
|
|
1046
|
+
} catch (t) {
|
|
1047
1047
|
if (O?.templateId === e.templateId) {
|
|
1048
1048
|
let e = O;
|
|
1049
|
-
O = null, $(), await
|
|
1049
|
+
O = null, $(), await r.releaseLock(e.templateId, e.blockId).catch(() => {});
|
|
1050
1050
|
}
|
|
1051
1051
|
if (D !== e) return;
|
|
1052
|
-
Re(e.blockId,
|
|
1052
|
+
Re(e.blockId, t);
|
|
1053
1053
|
}
|
|
1054
1054
|
});
|
|
1055
1055
|
}
|
|
@@ -1077,7 +1077,7 @@ function Re(e) {
|
|
|
1077
1077
|
we(async () => {
|
|
1078
1078
|
let e = O;
|
|
1079
1079
|
if (e) try {
|
|
1080
|
-
await
|
|
1080
|
+
await r.renewLock(e.templateId, e.blockId);
|
|
1081
1081
|
} catch (e) {
|
|
1082
1082
|
if (Me(e) === "lock_lost") {
|
|
1083
1083
|
O = null, $(), Q();
|
|
@@ -1098,7 +1098,7 @@ function Re(e) {
|
|
|
1098
1098
|
} : null, Q());
|
|
1099
1099
|
}
|
|
1100
1100
|
function Ve() {
|
|
1101
|
-
W(), O &&
|
|
1101
|
+
W(), O && o && (r.releaseLock(O.templateId, O.blockId).catch(() => {}), O = null, $()), g?.leave?.(), g && (g.leave = null);
|
|
1102
1102
|
}
|
|
1103
1103
|
function He(e) {
|
|
1104
1104
|
let t = g;
|
|
@@ -1148,7 +1148,7 @@ function Re(e) {
|
|
|
1148
1148
|
};
|
|
1149
1149
|
}
|
|
1150
1150
|
function We(e) {
|
|
1151
|
-
h = e, w.push(
|
|
1151
|
+
h = e, w.push(p(() => e.state.template, (e) => be(e), { immediate: !0 }), p(() => e.content.value, te, { deep: !0 }), p(() => e.state.selectedBlockId, Be), p(() => e.state.isLoading, (e) => e ? U(!0, !0) : te())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", W)), n() && c(Je);
|
|
1152
1152
|
}
|
|
1153
1153
|
function Ge() {
|
|
1154
1154
|
W();
|
|
@@ -1172,11 +1172,11 @@ function Re(e) {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
1174
|
return {
|
|
1175
|
-
sessionId:
|
|
1175
|
+
sessionId: i,
|
|
1176
1176
|
members: l,
|
|
1177
1177
|
locks: u,
|
|
1178
1178
|
connection: d,
|
|
1179
|
-
revision:
|
|
1179
|
+
revision: f,
|
|
1180
1180
|
canUndo: M,
|
|
1181
1181
|
canRedo: N,
|
|
1182
1182
|
attach: We,
|
|
@@ -1195,81 +1195,81 @@ function Re(e) {
|
|
|
1195
1195
|
destroy: Je
|
|
1196
1196
|
};
|
|
1197
1197
|
}
|
|
1198
|
-
function ze(
|
|
1199
|
-
let { provider:
|
|
1198
|
+
function ze(t) {
|
|
1199
|
+
let { provider: n } = t, r = e([]), i = e(!1), a = f(() => {
|
|
1200
1200
|
let e = /* @__PURE__ */ new Set();
|
|
1201
|
-
for (let t of
|
|
1201
|
+
for (let t of r.value) {
|
|
1202
1202
|
let n = t.category?.trim();
|
|
1203
1203
|
n && e.add(n);
|
|
1204
1204
|
}
|
|
1205
1205
|
return [...e].sort((e, t) => e.localeCompare(t));
|
|
1206
|
-
}), o =
|
|
1206
|
+
}), o = f(() => typeof n.create == "function"), s = f(() => typeof n.update == "function"), c = f(() => typeof n.delete == "function");
|
|
1207
1207
|
function l(e) {
|
|
1208
1208
|
return s.value && e.canUpdate !== !1;
|
|
1209
1209
|
}
|
|
1210
1210
|
function u(e) {
|
|
1211
1211
|
return c.value && e.canDelete !== !1;
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function d(e, t) {
|
|
1214
1214
|
throw new L(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1215
1215
|
}
|
|
1216
|
-
function p(
|
|
1217
|
-
Y(
|
|
1216
|
+
function p(e) {
|
|
1217
|
+
Y(t.onError, e);
|
|
1218
1218
|
}
|
|
1219
|
-
async function m(
|
|
1220
|
-
|
|
1219
|
+
async function m(e) {
|
|
1220
|
+
i.value = !0;
|
|
1221
1221
|
try {
|
|
1222
|
-
|
|
1223
|
-
} catch (
|
|
1224
|
-
throw
|
|
1222
|
+
r.value = await n.list(e);
|
|
1223
|
+
} catch (e) {
|
|
1224
|
+
throw t.onError?.(e), e;
|
|
1225
1225
|
} finally {
|
|
1226
|
-
|
|
1226
|
+
i.value = !1;
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
async function h(
|
|
1230
|
-
let { create: o } =
|
|
1231
|
-
typeof o != "function" &&
|
|
1229
|
+
async function h(e, i, a) {
|
|
1230
|
+
let { create: o } = n;
|
|
1231
|
+
typeof o != "function" && d("create", "disabled by the provider");
|
|
1232
1232
|
try {
|
|
1233
|
-
let
|
|
1234
|
-
name:
|
|
1233
|
+
let t = await o(a ? {
|
|
1234
|
+
name: e,
|
|
1235
1235
|
content: i,
|
|
1236
1236
|
category: a
|
|
1237
1237
|
} : {
|
|
1238
|
-
name:
|
|
1238
|
+
name: e,
|
|
1239
1239
|
content: i
|
|
1240
1240
|
});
|
|
1241
|
-
return
|
|
1242
|
-
} catch (
|
|
1243
|
-
throw
|
|
1241
|
+
return r.value = [t, ...r.value], p(() => n.onCreated?.(t)), t;
|
|
1242
|
+
} catch (e) {
|
|
1243
|
+
throw t.onError?.(e), e;
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
|
-
async function g(
|
|
1247
|
-
let { update: a } =
|
|
1248
|
-
typeof a != "function" &&
|
|
1249
|
-
let o =
|
|
1250
|
-
o && o.canUpdate === !1 &&
|
|
1246
|
+
async function g(e, i) {
|
|
1247
|
+
let { update: a } = n;
|
|
1248
|
+
typeof a != "function" && d("update", "disabled by the provider");
|
|
1249
|
+
let o = r.value.find((t) => t.id === e);
|
|
1250
|
+
o && o.canUpdate === !1 && d("update", `not permitted for entry "${e}"`);
|
|
1251
1251
|
try {
|
|
1252
|
-
let
|
|
1253
|
-
return
|
|
1254
|
-
} catch (
|
|
1255
|
-
throw
|
|
1252
|
+
let t = await a(e, i);
|
|
1253
|
+
return r.value = r.value.map((n) => n.id === e ? t : n), p(() => n.onUpdated?.(t)), t;
|
|
1254
|
+
} catch (e) {
|
|
1255
|
+
throw t.onError?.(e), e;
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
async function _(
|
|
1259
|
-
let { delete: i } =
|
|
1260
|
-
typeof i != "function" &&
|
|
1261
|
-
let a =
|
|
1262
|
-
a && a.canDelete === !1 &&
|
|
1258
|
+
async function _(e) {
|
|
1259
|
+
let { delete: i } = n;
|
|
1260
|
+
typeof i != "function" && d("delete", "disabled by the provider");
|
|
1261
|
+
let a = r.value.find((t) => t.id === e) ?? null;
|
|
1262
|
+
a && a.canDelete === !1 && d("delete", `not permitted for entry "${e}"`);
|
|
1263
1263
|
try {
|
|
1264
|
-
await i(
|
|
1265
|
-
} catch (
|
|
1266
|
-
throw
|
|
1264
|
+
await i(e), r.value = r.value.filter((t) => t.id !== e), a && p(() => n.onDeleted?.(a));
|
|
1265
|
+
} catch (e) {
|
|
1266
|
+
throw t.onError?.(e), e;
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
return {
|
|
1270
|
-
savedBlocks:
|
|
1271
|
-
isLoading:
|
|
1272
|
-
categories:
|
|
1270
|
+
savedBlocks: r,
|
|
1271
|
+
isLoading: i,
|
|
1272
|
+
categories: a,
|
|
1273
1273
|
canCreate: o,
|
|
1274
1274
|
canUpdate: s,
|
|
1275
1275
|
canDelete: c,
|
|
@@ -1409,74 +1409,74 @@ function Ue(e = {}) {
|
|
|
1409
1409
|
storage: !1
|
|
1410
1410
|
};
|
|
1411
1411
|
}
|
|
1412
|
-
function We(
|
|
1413
|
-
let { provider:
|
|
1414
|
-
function
|
|
1415
|
-
let t =
|
|
1412
|
+
function We(t) {
|
|
1413
|
+
let { provider: n, getTemplateId: r } = t, i = e([]), a = e(!1), o = e(void 0), s = e(!1), c = /* @__PURE__ */ new Map(), l = f(() => typeof n.create == "function"), u = f(() => typeof n.restore == "function");
|
|
1414
|
+
function d(e) {
|
|
1415
|
+
let t = r();
|
|
1416
1416
|
if (!t) throw new L(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
1417
1417
|
return t;
|
|
1418
1418
|
}
|
|
1419
1419
|
function p(e) {
|
|
1420
1420
|
throw new L(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1421
1421
|
}
|
|
1422
|
-
function m(
|
|
1423
|
-
Y(
|
|
1422
|
+
function m(e) {
|
|
1423
|
+
Y(t.onError, e);
|
|
1424
1424
|
}
|
|
1425
|
-
async function h(
|
|
1426
|
-
let
|
|
1427
|
-
|
|
1425
|
+
async function h(e) {
|
|
1426
|
+
let r = d("list");
|
|
1427
|
+
a.value = !0;
|
|
1428
1428
|
try {
|
|
1429
|
-
let
|
|
1430
|
-
|
|
1431
|
-
} catch (
|
|
1432
|
-
throw
|
|
1429
|
+
let t = await n.list(r, e);
|
|
1430
|
+
i.value = t.versions, o.value = t.nextCursor;
|
|
1431
|
+
} catch (e) {
|
|
1432
|
+
throw t.onError?.(e), e;
|
|
1433
1433
|
} finally {
|
|
1434
|
-
|
|
1434
|
+
a.value = !1;
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
1437
|
function g(e) {
|
|
1438
1438
|
return e.content ?? c.get(e.id) ?? null;
|
|
1439
1439
|
}
|
|
1440
|
-
async function _(
|
|
1441
|
-
let r = g(
|
|
1440
|
+
async function _(e) {
|
|
1441
|
+
let r = g(e);
|
|
1442
1442
|
if (r) return r;
|
|
1443
|
-
let i =
|
|
1443
|
+
let i = d("get");
|
|
1444
1444
|
try {
|
|
1445
|
-
let
|
|
1446
|
-
return c.set(
|
|
1447
|
-
} catch (
|
|
1448
|
-
throw
|
|
1445
|
+
let t = await n.get(i, e.id);
|
|
1446
|
+
return c.set(e.id, t), t;
|
|
1447
|
+
} catch (e) {
|
|
1448
|
+
throw t.onError?.(e), e;
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
|
-
async function v(
|
|
1452
|
-
let { create: a } =
|
|
1451
|
+
async function v(e, r) {
|
|
1452
|
+
let { create: a } = n;
|
|
1453
1453
|
typeof a != "function" && p("create");
|
|
1454
|
-
let o =
|
|
1454
|
+
let o = d("create");
|
|
1455
1455
|
try {
|
|
1456
|
-
let
|
|
1457
|
-
return
|
|
1458
|
-
} catch (
|
|
1459
|
-
throw
|
|
1456
|
+
let t = await a(o, e, r);
|
|
1457
|
+
return i.value = [t, ...i.value], m(() => n.onCreated?.(t)), t;
|
|
1458
|
+
} catch (e) {
|
|
1459
|
+
throw t.onError?.(e), e;
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
async function y(
|
|
1463
|
-
let { restore: r } =
|
|
1462
|
+
async function y(e) {
|
|
1463
|
+
let { restore: r } = n;
|
|
1464
1464
|
typeof r != "function" && p("restore");
|
|
1465
|
-
let i =
|
|
1465
|
+
let i = d("restore"), a;
|
|
1466
1466
|
s.value = !0;
|
|
1467
1467
|
try {
|
|
1468
|
-
a = await r(i,
|
|
1469
|
-
} catch (
|
|
1470
|
-
throw
|
|
1468
|
+
a = await r(i, e);
|
|
1469
|
+
} catch (e) {
|
|
1470
|
+
throw t.onError?.(e), e;
|
|
1471
1471
|
} finally {
|
|
1472
1472
|
s.value = !1;
|
|
1473
1473
|
}
|
|
1474
|
-
return m(() =>
|
|
1474
|
+
return m(() => n.onRestored?.(a)), a;
|
|
1475
1475
|
}
|
|
1476
1476
|
return {
|
|
1477
1477
|
nextCursor: o,
|
|
1478
|
-
versions:
|
|
1479
|
-
isLoading:
|
|
1478
|
+
versions: i,
|
|
1479
|
+
isLoading: a,
|
|
1480
1480
|
isRestoring: s,
|
|
1481
1481
|
canCreate: l,
|
|
1482
1482
|
canRestore: u,
|
|
@@ -1487,19 +1487,19 @@ function We(e) {
|
|
|
1487
1487
|
restore: y
|
|
1488
1488
|
};
|
|
1489
1489
|
}
|
|
1490
|
-
function Ge(
|
|
1491
|
-
let { provider:
|
|
1490
|
+
function Ge(t) {
|
|
1491
|
+
let { provider: n, getTemplateId: r, getUser: i } = t, a = e([]), o = e(!1), s = e(!1), c = f(() => typeof n.create == "function"), l = f(() => typeof n.update == "function"), u = f(() => typeof n.delete == "function"), d = f(() => typeof n.setResolved == "function"), p = f(() => a.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = f(() => a.value.filter((e) => !e.resolvedAt).length), h = f(() => {
|
|
1492
1492
|
let e = /* @__PURE__ */ new Map();
|
|
1493
|
-
for (let t of
|
|
1493
|
+
for (let t of a.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
1494
1494
|
return e;
|
|
1495
1495
|
});
|
|
1496
1496
|
function g(e) {
|
|
1497
|
-
let t =
|
|
1497
|
+
let t = r();
|
|
1498
1498
|
if (!t) throw new L(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
1499
1499
|
return t;
|
|
1500
1500
|
}
|
|
1501
1501
|
function _(e) {
|
|
1502
|
-
let t =
|
|
1502
|
+
let t = i();
|
|
1503
1503
|
if (!t) throw new L(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
1504
1504
|
return t;
|
|
1505
1505
|
}
|
|
@@ -1507,22 +1507,22 @@ function Ge(e) {
|
|
|
1507
1507
|
throw new L(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1508
1508
|
}
|
|
1509
1509
|
function y(e) {
|
|
1510
|
-
for (let t of
|
|
1510
|
+
for (let t of a.value) {
|
|
1511
1511
|
if (t.id === e) return t;
|
|
1512
1512
|
for (let n of t.replies ?? []) if (n.id === e) return n;
|
|
1513
1513
|
}
|
|
1514
1514
|
return null;
|
|
1515
1515
|
}
|
|
1516
1516
|
function b(e) {
|
|
1517
|
-
let t =
|
|
1517
|
+
let t = i();
|
|
1518
1518
|
return t !== null && e.author.id === t.id;
|
|
1519
1519
|
}
|
|
1520
|
-
function x(
|
|
1521
|
-
let n = J(
|
|
1522
|
-
throw
|
|
1520
|
+
function x(e) {
|
|
1521
|
+
let n = J(e);
|
|
1522
|
+
throw t.onError?.(n), n;
|
|
1523
1523
|
}
|
|
1524
|
-
function S(
|
|
1525
|
-
Y(
|
|
1524
|
+
function S(e) {
|
|
1525
|
+
Y(t.onError, e);
|
|
1526
1526
|
}
|
|
1527
1527
|
function C(e, t, n) {
|
|
1528
1528
|
return [
|
|
@@ -1536,7 +1536,7 @@ function Ge(e) {
|
|
|
1536
1536
|
}
|
|
1537
1537
|
function T(e) {
|
|
1538
1538
|
if (e.parentId) {
|
|
1539
|
-
let t = !1, n =
|
|
1539
|
+
let t = !1, n = a.value.map((n) => {
|
|
1540
1540
|
if (n.id !== e.parentId) return n;
|
|
1541
1541
|
let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
|
|
1542
1542
|
return i !== -1 && w(r[i], e) ? n : (t = !0, {
|
|
@@ -1544,28 +1544,28 @@ function Ge(e) {
|
|
|
1544
1544
|
replies: i === -1 ? [...r, e] : C(r, i, e)
|
|
1545
1545
|
});
|
|
1546
1546
|
});
|
|
1547
|
-
return t && (
|
|
1547
|
+
return t && (a.value = n), t;
|
|
1548
1548
|
}
|
|
1549
|
-
let t =
|
|
1550
|
-
if (t === -1) return
|
|
1549
|
+
let t = a.value.findIndex((t) => t.id === e.id);
|
|
1550
|
+
if (t === -1) return a.value = [...a.value, e], !0;
|
|
1551
1551
|
let n = {
|
|
1552
1552
|
...e,
|
|
1553
|
-
replies: e.replies ??
|
|
1553
|
+
replies: e.replies ?? a.value[t].replies
|
|
1554
1554
|
};
|
|
1555
|
-
return !w(
|
|
1555
|
+
return !w(a.value[t], n) && (a.value = C(a.value, t, n), !0);
|
|
1556
1556
|
}
|
|
1557
1557
|
function E(e, t) {
|
|
1558
1558
|
let n = y(e), r = t ?? n?.parentId ?? null;
|
|
1559
|
-
return r ?
|
|
1559
|
+
return r ? a.value = a.value.map((t) => t.id === r ? {
|
|
1560
1560
|
...t,
|
|
1561
1561
|
replies: (t.replies ?? []).filter((t) => t.id !== e)
|
|
1562
|
-
} : t) :
|
|
1562
|
+
} : t) : a.value = a.value.filter((t) => t.id !== e), n;
|
|
1563
1563
|
}
|
|
1564
1564
|
async function D(e) {
|
|
1565
|
-
let
|
|
1565
|
+
let t = g("list");
|
|
1566
1566
|
o.value = !0;
|
|
1567
1567
|
try {
|
|
1568
|
-
|
|
1568
|
+
a.value = await n.list(t, e);
|
|
1569
1569
|
} catch (e) {
|
|
1570
1570
|
x(e);
|
|
1571
1571
|
} finally {
|
|
@@ -1573,27 +1573,27 @@ function Ge(e) {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
1575
|
async function O(e) {
|
|
1576
|
-
let { create:
|
|
1577
|
-
typeof
|
|
1576
|
+
let { create: t } = n;
|
|
1577
|
+
typeof t != "function" && v("create");
|
|
1578
1578
|
let r = g("create");
|
|
1579
1579
|
_("create"), s.value = !0;
|
|
1580
1580
|
try {
|
|
1581
|
-
let i = await
|
|
1582
|
-
return T(i), S(() =>
|
|
1581
|
+
let i = await t(r, e);
|
|
1582
|
+
return T(i), S(() => n.onCreated?.(i, { origin: "local" })), i;
|
|
1583
1583
|
} catch (e) {
|
|
1584
1584
|
x(e);
|
|
1585
1585
|
} finally {
|
|
1586
1586
|
s.value = !1;
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
async function k(e,
|
|
1590
|
-
let { update: r } =
|
|
1589
|
+
async function k(e, t) {
|
|
1590
|
+
let { update: r } = n;
|
|
1591
1591
|
typeof r != "function" && v("update");
|
|
1592
1592
|
let i = g("update");
|
|
1593
1593
|
_("update"), s.value = !0;
|
|
1594
1594
|
try {
|
|
1595
|
-
let a = await r(i, e,
|
|
1596
|
-
return T(a), S(() =>
|
|
1595
|
+
let a = await r(i, e, t);
|
|
1596
|
+
return T(a), S(() => n.onUpdated?.(a, { origin: "local" })), a;
|
|
1597
1597
|
} catch (e) {
|
|
1598
1598
|
x(e);
|
|
1599
1599
|
} finally {
|
|
@@ -1601,28 +1601,28 @@ function Ge(e) {
|
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
1603
|
async function A(e) {
|
|
1604
|
-
let { delete:
|
|
1605
|
-
typeof
|
|
1604
|
+
let { delete: t } = n;
|
|
1605
|
+
typeof t != "function" && v("delete");
|
|
1606
1606
|
let r = g("delete");
|
|
1607
1607
|
_("delete");
|
|
1608
1608
|
let i = y(e);
|
|
1609
1609
|
s.value = !0;
|
|
1610
1610
|
try {
|
|
1611
|
-
await
|
|
1611
|
+
await t(r, e), E(e), i && S(() => n.onDeleted?.(i, { origin: "local" }));
|
|
1612
1612
|
} catch (e) {
|
|
1613
1613
|
x(e);
|
|
1614
1614
|
} finally {
|
|
1615
1615
|
s.value = !1;
|
|
1616
1616
|
}
|
|
1617
1617
|
}
|
|
1618
|
-
async function j(e,
|
|
1619
|
-
let { setResolved: r } =
|
|
1618
|
+
async function j(e, t) {
|
|
1619
|
+
let { setResolved: r } = n;
|
|
1620
1620
|
typeof r != "function" && v("setResolved");
|
|
1621
1621
|
let i = g("setResolved");
|
|
1622
1622
|
_("setResolved"), s.value = !0;
|
|
1623
1623
|
try {
|
|
1624
|
-
let a = await r(i, e,
|
|
1625
|
-
return T(a), S(() => (a.resolvedAt ?
|
|
1624
|
+
let a = await r(i, e, t);
|
|
1625
|
+
return T(a), S(() => (a.resolvedAt ? n.onResolved : n.onUnresolved)?.(a, { origin: "local" })), a;
|
|
1626
1626
|
} catch (e) {
|
|
1627
1627
|
x(e);
|
|
1628
1628
|
} finally {
|
|
@@ -1630,23 +1630,23 @@ function Ge(e) {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
}
|
|
1632
1632
|
function M(e) {
|
|
1633
|
-
T(e) && S(() =>
|
|
1633
|
+
T(e) && S(() => n.onCreated?.(e, { origin: "remote" }));
|
|
1634
1634
|
}
|
|
1635
1635
|
function N(e) {
|
|
1636
|
-
T(e) && S(() => (e.resolvedAt ?
|
|
1636
|
+
T(e) && S(() => (e.resolvedAt ? n.onResolved : n.onUpdated)?.(e, { origin: "remote" }));
|
|
1637
1637
|
}
|
|
1638
|
-
function P(e,
|
|
1639
|
-
let r = E(e,
|
|
1640
|
-
r && S(() =>
|
|
1638
|
+
function P(e, t) {
|
|
1639
|
+
let r = E(e, t);
|
|
1640
|
+
r && S(() => n.onDeleted?.(r, { origin: "remote" }));
|
|
1641
1641
|
}
|
|
1642
1642
|
return {
|
|
1643
|
-
comments:
|
|
1643
|
+
comments: a,
|
|
1644
1644
|
isLoading: o,
|
|
1645
1645
|
isSubmitting: s,
|
|
1646
1646
|
canCreate: c,
|
|
1647
1647
|
canUpdate: l,
|
|
1648
1648
|
canDelete: u,
|
|
1649
|
-
canResolve:
|
|
1649
|
+
canResolve: d,
|
|
1650
1650
|
totalCount: p,
|
|
1651
1651
|
unresolvedCount: m,
|
|
1652
1652
|
commentCountByBlock: h,
|
|
@@ -1687,7 +1687,7 @@ function Ke(e) {
|
|
|
1687
1687
|
var qe = 1e4;
|
|
1688
1688
|
// src/composables/useImageUrlResolver.ts
|
|
1689
1689
|
function Je(e) {
|
|
1690
|
-
let t =
|
|
1690
|
+
let t = l(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
1691
1691
|
function r(e) {
|
|
1692
1692
|
return t.get(e);
|
|
1693
1693
|
}
|
|
@@ -1716,7 +1716,7 @@ function Je(e) {
|
|
|
1716
1716
|
};
|
|
1717
1717
|
}
|
|
1718
1718
|
function Ye(e) {
|
|
1719
|
-
let r = t(G, null), i =
|
|
1719
|
+
let r = t(G, null), i = f(e);
|
|
1720
1720
|
if (!r) return i;
|
|
1721
1721
|
let a;
|
|
1722
1722
|
function o() {
|
|
@@ -1730,7 +1730,7 @@ function Ye(e) {
|
|
|
1730
1730
|
s = !1, e && !r.has(e) && (t ? r.lookup(e) : a = setTimeout(() => {
|
|
1731
1731
|
a = void 0, r.lookup(e);
|
|
1732
1732
|
}, 300));
|
|
1733
|
-
}, { immediate: !0 }),
|
|
1733
|
+
}, { immediate: !0 }), f(() => {
|
|
1734
1734
|
let e = i.value;
|
|
1735
1735
|
if (!e) return e;
|
|
1736
1736
|
let t = r.get(e);
|
|
@@ -1751,7 +1751,7 @@ function Qe(e, t) {
|
|
|
1751
1751
|
}
|
|
1752
1752
|
function $e(e) {
|
|
1753
1753
|
let n = t(ne, R.liquid), r = Ye(() => Qe(e(), n));
|
|
1754
|
-
return
|
|
1754
|
+
return f(() => Ze(e(), n) ? null : r.value);
|
|
1755
1755
|
}
|
|
1756
1756
|
function et(e, t, n) {
|
|
1757
1757
|
return Ze(t, n) ? null : Xe(e, Qe(t, n));
|
|
@@ -1906,8 +1906,8 @@ var mt = /* @__PURE__ */ x({
|
|
|
1906
1906
|
uploading: { type: Boolean },
|
|
1907
1907
|
size: { default: "field" }
|
|
1908
1908
|
},
|
|
1909
|
-
setup(
|
|
1910
|
-
let
|
|
1909
|
+
setup(e) {
|
|
1910
|
+
let t = e, { t: n } = ie(), a = {
|
|
1911
1911
|
field: {
|
|
1912
1912
|
gap: "tpl:gap-1.5",
|
|
1913
1913
|
icon: 18,
|
|
@@ -1918,31 +1918,31 @@ var mt = /* @__PURE__ */ x({
|
|
|
1918
1918
|
icon: 20,
|
|
1919
1919
|
veil: "85%"
|
|
1920
1920
|
}
|
|
1921
|
-
}, o =
|
|
1922
|
-
return (
|
|
1923
|
-
class:
|
|
1924
|
-
style:
|
|
1925
|
-
}, [
|
|
1921
|
+
}, o = f(() => a[t.size]);
|
|
1922
|
+
return (t, a) => (g(), m("div", {
|
|
1923
|
+
class: _(["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)]", o.value.gap]),
|
|
1924
|
+
style: r({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${o.value.veil}, transparent)` })
|
|
1925
|
+
}, [e.uploading ? (g(), m(v, { key: 0 }, [u(y(se), {
|
|
1926
1926
|
class: "tpl-spinner",
|
|
1927
1927
|
size: o.value.icon,
|
|
1928
1928
|
"stroke-width": 2
|
|
1929
|
-
}, null, 8, ["size"]),
|
|
1929
|
+
}, null, 8, ["size"]), h(" " + i(y(n).image.uploading), 1)], 64)) : (g(), m(v, { key: 1 }, [u(y(oe), {
|
|
1930
1930
|
size: o.value.icon,
|
|
1931
1931
|
"stroke-width": 1.5
|
|
1932
|
-
}, null, 8, ["size"]),
|
|
1932
|
+
}, null, 8, ["size"]), h(" " + i(y(n).image.dropToUpload), 1)], 64))], 6));
|
|
1933
1933
|
}
|
|
1934
1934
|
});
|
|
1935
1935
|
// src/composables/useAliveFlag.ts
|
|
1936
1936
|
function ht() {
|
|
1937
1937
|
let e = { alive: !0 };
|
|
1938
|
-
return
|
|
1938
|
+
return a(() => {
|
|
1939
1939
|
e.alive = !1;
|
|
1940
1940
|
}), e;
|
|
1941
1941
|
}
|
|
1942
1942
|
// src/composables/useImageDrop.ts
|
|
1943
1943
|
var gt = "image/";
|
|
1944
1944
|
function _t(e) {
|
|
1945
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 ||
|
|
1945
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || d(r), { isOverDropZone: a } = U(t, {
|
|
1946
1946
|
preventDefaultForUnhandled: !0,
|
|
1947
1947
|
onDrop: (e) => {
|
|
1948
1948
|
if (!i()) return;
|
|
@@ -1950,17 +1950,17 @@ function _t(e) {
|
|
|
1950
1950
|
t.length > 0 && n([t[0]]);
|
|
1951
1951
|
}
|
|
1952
1952
|
});
|
|
1953
|
-
return { isOver:
|
|
1953
|
+
return { isOver: f(() => i() && a.value) };
|
|
1954
1954
|
}
|
|
1955
1955
|
// src/composables/useMediaDropField.ts
|
|
1956
|
-
function vt(
|
|
1957
|
-
let { target:
|
|
1956
|
+
function vt(n) {
|
|
1957
|
+
let { target: r, blocked: i, apply: a } = n, o = t(W, null), s = t(re, null), c = ht();
|
|
1958
1958
|
async function l() {
|
|
1959
1959
|
let e = await o?.({ accept: ["images"] });
|
|
1960
|
-
c.alive && e &&
|
|
1960
|
+
c.alive && e && a(e);
|
|
1961
1961
|
}
|
|
1962
|
-
let u =
|
|
1963
|
-
async function
|
|
1962
|
+
let u = e(!1), p = f(() => (s?.value ?? !!o) && !u.value && !d(i));
|
|
1963
|
+
async function m(e) {
|
|
1964
1964
|
if (o) {
|
|
1965
1965
|
u.value = !0;
|
|
1966
1966
|
try {
|
|
@@ -1969,20 +1969,20 @@ function vt(e) {
|
|
|
1969
1969
|
files: e
|
|
1970
1970
|
});
|
|
1971
1971
|
if (!c.alive) return;
|
|
1972
|
-
t &&
|
|
1972
|
+
t && a(t);
|
|
1973
1973
|
} finally {
|
|
1974
1974
|
c.alive && (u.value = !1);
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
1977
|
}
|
|
1978
|
-
let { isOver:
|
|
1979
|
-
target:
|
|
1980
|
-
enabled:
|
|
1981
|
-
onFiles:
|
|
1982
|
-
}), g =
|
|
1978
|
+
let { isOver: h } = _t({
|
|
1979
|
+
target: r,
|
|
1980
|
+
enabled: p,
|
|
1981
|
+
onFiles: m
|
|
1982
|
+
}), g = f(() => p.value && h.value || u.value);
|
|
1983
1983
|
return {
|
|
1984
1984
|
canBrowse: !!o,
|
|
1985
|
-
dropEnabled:
|
|
1985
|
+
dropEnabled: p,
|
|
1986
1986
|
isUploading: u,
|
|
1987
1987
|
showOverlay: g,
|
|
1988
1988
|
openMediaBrowser: l
|