collabmd 0.1.54 → 0.1.55
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/bin/collabmd.js +19 -38
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-cMeDxAEL.js +1 -0
- package/dist/client/assets/{abnfDiagram-VCTEODGH-DxNxad6-.js → abnfDiagram-VCTEODGH-D2UdmYvj.js} +1 -1
- package/dist/client/assets/{abnfDiagram-O67JEVCF-Dwt6a0Ds.js → abnfDiagram-YUKMZFIV-DbmU4Q-X.js} +1 -1
- package/dist/client/assets/api-client-utils-C5ESDKMG.js +1 -0
- package/dist/client/assets/architecture-7GRP2DOG-BBwRXFv3.js +1 -1
- package/dist/client/assets/architecture-WOLXFQ4H-C0NxYiG7.js +1 -0
- package/dist/client/assets/{architectureDiagram-NJMV4G6O-D5CGiX3G.js → architectureDiagram-47P4ROYG-C7OjXK9S.js} +3 -3
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-C1uvg5id.js → architectureDiagram-5GKGNRK7-CSiUzzeN.js} +1 -1
- package/dist/client/assets/base-CaIEJUF9.css +1 -0
- package/dist/client/assets/{blockDiagram-BEXU5L5S-BgTM0var.js → blockDiagram-E7TT5TSB-DMG-YlZw.js} +3 -3
- package/dist/client/assets/{blockDiagram-I7D4REHJ-B2YonsoG.js → blockDiagram-I7D4REHJ-sXfAgK2w.js} +1 -1
- package/dist/client/assets/{browser-BKLM0ThC-BCLQGPD6-K2seJgRL.js → browser-BKLM0ThC-BCLQGPD6-CcMAHZXi.js} +1 -1
- package/dist/client/assets/{c4Diagram-7LVT6UL2-r4IwomZm.js → c4Diagram-7LVT6UL2-C88V_K-8.js} +1 -1
- package/dist/client/assets/{c4Diagram-YGBWAQC7-_xZPrNkB.js → c4Diagram-CRA5TL53-D3F9ElJv.js} +2 -2
- package/dist/client/assets/canvasEditor-BJkwGzO1.css +1 -0
- package/dist/client/assets/canvasEditor-sBK7KfrD.js +1 -0
- package/dist/client/assets/{chunk-6AZGARVD--pTGpDnx.js → chunk-24IY7LWP-flnn6SWX.js} +1 -1
- package/dist/client/assets/chunk-2BW5OAIV-CNFO1U_e.js +10 -0
- package/dist/client/assets/{chunk-2E4U76K2-CIQUuV9n.js → chunk-2E4U76K2-DEnS5IbF.js} +1 -1
- package/dist/client/assets/{chunk-5V3GS4D5-B5uC2oxu.js → chunk-3M4EKCLJ-D-sZGCtO.js} +1 -1
- package/dist/client/assets/chunk-3YJQHVM4-Ctp__8EK.js +2 -0
- package/dist/client/assets/{chunk-7PRAP22T-9uTvtc_-.js → chunk-4EA7E6EY-bU4wRJot.js} +1 -1
- package/dist/client/assets/{chunk-4HAMMTFA-q0ldNVvr.js → chunk-4HAMMTFA-CQy6Skzw.js} +1 -1
- package/dist/client/assets/{chunk-6K3QC6MW-JnuvEGV4.js → chunk-4S7OKTRW-BpUW13a3.js} +1 -1
- package/dist/client/assets/{chunk-ICYGCRZG-odvlDZyA.js → chunk-53FOQ5SW-5lPdGYP4.js} +1 -1
- package/dist/client/assets/{chunk-75Z2AOVW-DitkSoSG.js → chunk-75Z2AOVW-BRdhvVTZ.js} +1 -1
- package/dist/client/assets/{chunk-GWA4HPMP-CGmv2yIq.js → chunk-7TKQ45FW-rA2u-WUl.js} +1 -1
- package/dist/client/assets/{chunk-GTNCS2PH-ChgkzEIi.js → chunk-AW2ZBBNX-DL0KGAdi.js} +3 -3
- package/dist/client/assets/{chunk-747NJXEK-BjqqAsS9.js → chunk-BP2KR52E-DAQ1pzDV.js} +1 -1
- package/dist/client/assets/{chunk-CLGD4ZFX-BfYJtJm1.js → chunk-CLGD4ZFX-DJiSE0gD.js} +1 -1
- package/dist/client/assets/{chunk-5DYCD2WN-BKWCKnK-.js → chunk-DBDB3WZW-CXleNlok.js} +1 -1
- package/dist/client/assets/{chunk-DU6HZSFF-CWlP1Dk_.js → chunk-DU6HZSFF-C-18UZkS.js} +1 -1
- package/dist/client/assets/{chunk-MBY4JIJT-DTJ4UcAm.js → chunk-E2ZNV5FY-D_07zfWd.js} +3 -3
- package/dist/client/assets/chunk-EU5HNXII-CETVNUXF.js +213 -0
- package/dist/client/assets/{chunk-F27PBJKO-DPcsPcEs.js → chunk-F27PBJKO-_beIJos4.js} +1 -1
- package/dist/client/assets/{chunk-2ZTRR5NV-DcPRfelM.js → chunk-F6S3BTY2-DVWKCAHp.js} +1 -1
- package/dist/client/assets/{chunk-ISPTBLVO-BMsDq9Ha.js → chunk-FLFP27SU-CydzbSsY.js} +2 -2
- package/dist/client/assets/chunk-FVRAUYC3-C7b9SJ81.js +1 -0
- package/dist/client/assets/{chunk-GMAD6QVW-Bgk8qnty.js → chunk-GMAD6QVW-DnZH7DxV.js} +1 -1
- package/dist/client/assets/{chunk-GVQU2GXP-CQ8cl-Uu.js → chunk-GVQU2GXP-B0Vm415C.js} +1 -1
- package/dist/client/assets/chunk-H5A3YXKD-ChP7mNJq.js +41 -0
- package/dist/client/assets/{chunk-742MDFTN-D1nh6vNv.js → chunk-HJ2JQQFS-DQX7RePR.js} +1 -1
- package/dist/client/assets/{chunk-NETBCI7D-CmUwDWUZ.js → chunk-HTAEGDNF-C0PA_N-c.js} +1 -1
- package/dist/client/assets/{chunk-IMKFNOWR-CBqxfpcP.js → chunk-IMKFNOWR-DoO8IHzF.js} +1 -1
- package/dist/client/assets/{chunk-IH6LHLGP-BNevEHZK.js → chunk-KPI5JJXK-B2ld5-w4.js} +1 -1
- package/dist/client/assets/{chunk-WEXAMYUT-DDlVNp8J.js → chunk-KQW6MTUR-OQ4MyMr_.js} +1 -1
- package/dist/client/assets/{chunk-L3NEJ4N5-BflzkdTI.js → chunk-L3NEJ4N5-CvHossEU.js} +1 -1
- package/dist/client/assets/chunk-NGNAAXSQ-DqoPQk1a.js +136 -0
- package/dist/client/assets/{chunk-UA2S7LBM-DicYDjDM.js → chunk-NTY3LDVX-CVWLK_fh.js} +1 -1
- package/dist/client/assets/{chunk-UY3FDG6J-QT-rkt0y.js → chunk-OD3NTWWA-Dz9nCUGX.js} +1 -1
- package/dist/client/assets/{chunk-OSK3NFVY-DqeKV_pg.js → chunk-OSK3NFVY-C3JOcBao.js} +1 -1
- package/dist/client/assets/{chunk-P2QGCYS3-BA--DhpW.js → chunk-P2QGCYS3-Bfo8qS8r.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-V_NEc45n.js → chunk-POPQ4Y6H-sv6rCftH.js} +1 -1
- package/dist/client/assets/{chunk-PWAF6VOD-D_kLse-N.js → chunk-PWAF6VOD-B-AT-L2H.js} +1 -1
- package/dist/client/assets/{chunk-3Z5EZCMW-BAnA6eQ7.js → chunk-QNH66VMT-Cb9xxTwQ.js} +1 -1
- package/dist/client/assets/{chunk-SHT3W25Y-YM3S-A_M.js → chunk-SHT3W25Y-C1lu518T.js} +1 -1
- package/dist/client/assets/{chunk-GNY47TPC-CTrH5O5R.js → chunk-SVEVUXB4-BnM-LXop.js} +1 -1
- package/dist/client/assets/{chunk-SVP7TREG-DdNhDOmW.js → chunk-SVP7TREG-CKqt0syj.js} +1 -1
- package/dist/client/assets/{chunk-TICWLB2K-BGGgCr4x.js → chunk-TICWLB2K-D2ZnWAfF.js} +1 -1
- package/dist/client/assets/{chunk-TLUHSLCS-DCZhIDYA.js → chunk-TLUHSLCS-BMIhqv1X.js} +1 -1
- package/dist/client/assets/{chunk-6EIED4P4-DBVWq7Tz.js → chunk-TPMEZKFX-DIPHIqGb.js} +1 -1
- package/dist/client/assets/{chunk-6TQVIW2G-BSj0l_pu.js → chunk-VPELOWWC-DXayM28-.js} +1 -1
- package/dist/client/assets/chunk-VPRB5NB3-BqaJfj_v.js +127 -0
- package/dist/client/assets/{chunk-I5DQTOEV-aBZooNp1.js → chunk-VTWWFHGB-SZnJiyWY.js} +1 -1
- package/dist/client/assets/{chunk-KI3K4JFJ-FTtDwx3-.js → chunk-VZTHESGH-eHyXmK8W.js} +1 -1
- package/dist/client/assets/{chunk-7INBJB4K-CDmiHbaX.js → chunk-XC4XBNZT-D9oehSn8.js} +20 -20
- package/dist/client/assets/{chunk-XHIXRSVI-DN_fEwws.js → chunk-YK26KJH5-DVy3MGMd.js} +1 -1
- package/dist/client/assets/{chunk-6AEJRKK7-DTVZj5bY.js → chunk-Z6ETV63D-DOcrnz-P.js} +1 -1
- package/dist/client/assets/{chunk-OUJLGHUK-75UXlPjl.js → chunk-ZO67DCNQ-BAOMIkLF.js} +1 -1
- package/dist/client/assets/classDiagram-ZZMXUADV-BmETdFmC.js +1 -0
- package/dist/client/assets/{classDiagram-v2-NBCMYWYE-3TQORq33.js → classDiagram-v2-K4WV4PDN-eaadfJDB.js} +3 -3
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BmETdFmC.js +1 -0
- package/dist/client/assets/{comment-markdown-renderer-Bxi_JRSR.js → comment-markdown-renderer-CpBKaj7H.js} +1 -1
- package/dist/client/assets/comment-thread-store-DUQsWtnu.js +1 -0
- package/dist/client/assets/comment-threads-DnfkLVJA.js +4 -0
- package/dist/client/assets/comment-ui-shared-D_pgPUti.js +7 -0
- package/dist/client/assets/cynefin-EF2NZ3EQ-DVkJeZ8i.js +1 -0
- package/dist/client/assets/cynefin-OW5HDTMX-CF3N9j1_.js +1 -1
- package/dist/client/assets/{cynefinDiagram-VND7K2PF-DwfMZ3vk.js → cynefinDiagram-3GCD6N5R-DjpAsBHC.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-DTnLZaO7.js → cynefinDiagram-5FMLGOSQ-D2rFQG67.js} +1 -1
- package/dist/client/assets/dagre-C-rnJpZF.js +1 -0
- package/dist/client/assets/{dagre-GXQ25YYZ-Vtyx08Qh.js → dagre-GXQ25YYZ-Cku9eia9.js} +2 -2
- package/dist/client/assets/{dagre-6A5THRUB-DewyAGK6.js → dagre-W4DXFKR2-DOMOIsPd.js} +2 -2
- package/dist/client/assets/deferred-collab-C9aa9cvT.css +1 -0
- package/dist/client/assets/deferred-git-BPQ-UgrN.css +1 -0
- package/dist/client/assets/deferred-preview-B-RebLry.css +1 -0
- package/dist/client/assets/{diagram-22UHCM2B-DbZirFfl.js → diagram-2UJZ2QOL-D8WvnEyx.js} +6 -6
- package/dist/client/assets/{diagram-3UASUU5V-DmhdYv6_.js → diagram-OVF4WLC6-D8_escYE.js} +2 -2
- package/dist/client/assets/{diagram-CDSNMT55-D_qyS11R.js → diagram-PFPMY2P6-B1izZfrN.js} +3 -3
- package/dist/client/assets/{diagram-S7CK7UJ4-CGTzfo2f.js → diagram-S7CK7UJ4-BzicH2t-.js} +1 -1
- package/dist/client/assets/{diagram-MLGK6HIB-DIBG6Ivu.js → diagram-UMYRVEAY-Djf7WDjZ.js} +1 -1
- package/dist/client/assets/{diagram-UQ7AKVKN-CWZS8QtB.js → diagram-UQ7AKVKN-DqX4zTtr.js} +1 -1
- package/dist/client/assets/{diagram-VSXAHHWV-DaO1nOZF.js → diagram-VSXAHHWV-DnVbfI4Y.js} +1 -1
- package/dist/client/assets/{diagram-VX7I27RA-B54P6Cyf.js → diagram-VX7I27RA-D-Dj0TQC.js} +1 -1
- package/dist/client/assets/{diagram-MPIPVDR6-D9XsALDV.js → diagram-YEKJPTXX-B40bP3Yr.js} +2 -2
- package/dist/client/assets/{diagram-Z3DM3KII-Cl2EXiXp.js → diagram-Z3DM3KII-_iT7Uz5p.js} +1 -1
- package/dist/client/assets/diagram-ZIFT7M5P-BUUK0oNw.js +3 -0
- package/dist/client/assets/{direct-engine-DVLMOJWp-C-YL5NFb.js → direct-engine-DVLMOJWp-DWtWIifK.js} +1 -1
- package/dist/client/assets/dist-26Ce-5t4.js +1 -0
- package/dist/client/assets/dist-8MLNn-I6.js +1 -0
- package/dist/client/assets/dist-Amm5Pr1C.js +1 -0
- package/dist/client/assets/dist-BXXPaoUV.js +1 -0
- package/dist/client/assets/{dist-CoXN2D3R.js → dist-Bkb-_VdB.js} +1 -1
- package/dist/client/assets/dist-Bl4yuUS9.js +1 -0
- package/dist/client/assets/{dist-lw5TGjI6.js → dist-C2CGvCPd.js} +1 -1
- package/dist/client/assets/dist-C2niyEh0.js +1 -0
- package/dist/client/assets/{dist-DOHWxIty.js → dist-CFCSUmJk.js} +1 -1
- package/dist/client/assets/dist-CHUI56fT.js +6 -0
- package/dist/client/assets/dist-CJh3Qrid.js +13 -0
- package/dist/client/assets/{dist-Ch6Sr9KF.js → dist-CKxETpSC.js} +3 -3
- package/dist/client/assets/dist-CSHJthAI.js +2 -0
- package/dist/client/assets/dist-CbKnZGN4.js +1 -0
- package/dist/client/assets/{dist-KrdpB_GB.js → dist-Cik4RJXj.js} +1 -1
- package/dist/client/assets/{dist-uk11ih8u.js → dist-CqkAY6Ot.js} +2 -2
- package/dist/client/assets/dist-D2ql2LCd.js +1 -0
- package/dist/client/assets/{dist-BpAUe9sL.js → dist-D47MOYFN.js} +1 -1
- package/dist/client/assets/dist-DBhUaexM.js +1 -0
- package/dist/client/assets/dist-DJux6Vc5.js +1 -0
- package/dist/client/assets/{dist-9Eodxf4G.js → dist-DLNdMWPH.js} +1 -1
- package/dist/client/assets/dist-DPJj-Y3l.js +1 -0
- package/dist/client/assets/{dist-BSAZ-Hek.js → dist-DRYFMufe.js} +6 -6
- package/dist/client/assets/{dist-BrKhPlc9.js → dist-DTGcVSU8.js} +1 -1
- package/dist/client/assets/dist-DlOxjzWi.js +9 -0
- package/dist/client/assets/{dist-BT9gJXCb.js → dist-DogjjM_B.js} +1 -1
- package/dist/client/assets/dist-Dyv_RvyB.js +23 -0
- package/dist/client/assets/dist-FUFeH5Cx.js +1 -0
- package/dist/client/assets/dist-It70ktCU.js +1 -0
- package/dist/client/assets/dist-QMvcnJHf.js +1 -0
- package/dist/client/assets/dist-QN1K2czv.js +11 -0
- package/dist/client/assets/dist-W8ilOKl3.js +1 -0
- package/dist/client/assets/dist-_17-t9qP.js +1 -0
- package/dist/client/assets/{dist-DeCV9FU4.js → dist-uE774WWs.js} +1 -1
- package/dist/client/assets/document-formatter-DtXmKZcy.js +1 -0
- package/dist/client/assets/drawioEditor-DO6IOaJ1.js +9 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-PfC84FyI.js → ebnfDiagram-PWID7BFC-IemGPf9X.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-ZINNZB2B-DYvm_QtE.js → ebnfDiagram-VR2GEFS7-9fXqy1DI.js} +1 -1
- package/dist/client/assets/editor-session-CPsqXY_A.js +13 -0
- package/dist/client/assets/elk-IJKZMXRS-DsbrbBYg.js +27 -0
- package/dist/client/assets/embedded-editor-base-C44ZcCZv.css +1 -0
- package/dist/client/assets/{embedpdf-TkbBYowM.js → embedpdf-BfUI-3pv.js} +1 -1
- package/dist/client/assets/{embedpdf-cl9qiF45-itpgqvGY.js → embedpdf-cl9qiF45-CLMxJTMP.js} +2 -2
- package/dist/client/assets/en-7ZVUCEYH-C_VXKxxb.js +1 -0
- package/dist/client/assets/{erDiagram-OPXOYQCR-o8GRv8A_.js → erDiagram-O2IAPWRE-Cdadm-HN.js} +2 -2
- package/dist/client/assets/{erDiagram-RLTQ6QDP-C9cJl5NB.js → erDiagram-RLTQ6QDP-CGGmjm8t.js} +1 -1
- package/dist/client/assets/eventmodeling-K75KTNOO-BWBlZ5cR.js +1 -0
- package/dist/client/assets/eventmodeling-NTZA5JFV-CDy1bN6j.js +1 -1
- package/dist/client/assets/excalidraw-element-link-NQnskRkm.js +1 -0
- package/dist/client/assets/excalidraw-scene-DLlw4jyc.js +1 -0
- package/dist/client/assets/excalidrawEditor-DiKOIudt.css +1 -0
- package/dist/client/assets/excalidrawEditor-W2lZ5Mej.js +9 -0
- package/dist/client/assets/export-page-Bomh9oEr.js +46 -0
- package/dist/client/assets/exportDocument-BFIOECJ3.js +2 -0
- package/dist/client/assets/exportDocument-D0mONgQ4.css +1 -0
- package/dist/client/assets/file-kind-BGxTVHan.js +1 -0
- package/dist/client/assets/{file-search-BA8o_gs0.js → file-search-Dk2O14Vw.js} +1 -1
- package/dist/client/assets/flowDiagram-HODETNUW-DcVVYJUZ.js +1 -0
- package/dist/client/assets/flowDiagram-OXPTDLAJ-Dy6y46oF.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-x40PW0Ah.js → ganttDiagram-EL5Y4UJY-Duu4KnsU.js} +1 -1
- package/dist/client/assets/ganttDiagram-R7TSEDQI-BWy52pjn.js +292 -0
- package/dist/client/assets/gitGraph-4MIJSDKK-B-rpDYbz.js +1 -1
- package/dist/client/assets/gitGraph-VSP46ZUC-1499lQAI.js +1 -0
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-ahsNaZsp.js → gitGraphDiagram-WWUBYQGX-CaJ0vC1a.js} +1 -1
- package/dist/client/assets/gitGraphDiagram-XJZIOB7I-DJwp9ilx.js +106 -0
- package/dist/client/assets/graphlib-DS17s2tU.js +1 -0
- package/dist/client/assets/image-6XY3GD3F-DCWbu6d4.js +1 -0
- package/dist/client/assets/image-lightbox-controller-DAcXEXxT.js +184 -0
- package/dist/client/assets/index-CglpXOg7.css +1 -0
- package/dist/client/assets/index-D3WGkxfI.js +960 -0
- package/dist/client/assets/info-A6RAGUB7-BlutK7BT.js +1 -1
- package/dist/client/assets/info-OHQRW6UA-BDFQOo4H.js +1 -0
- package/dist/client/assets/{infoDiagram-27XIBGKW-MrZyptIy.js → infoDiagram-27XIBGKW-DBJh7QOu.js} +1 -1
- package/dist/client/assets/{infoDiagram-VRGFBTTK-KkUjDRAQ.js → infoDiagram-5W2HQ5XZ-DmWsqJ0w.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-Bnt9yM0O.js → ishikawaDiagram-5VMMS53U-CeEbSJem.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-OU5B5YK6-Di9BcpOY.js → ishikawaDiagram-K3B6WC7H-DH1NI35G.js} +2 -2
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-Bl0abK1r.js → journeyDiagram-3NMN7TZE-BoIEEr6U.js} +1 -1
- package/dist/client/assets/{journeyDiagram-ZHPQQLJL-J-sGrs9e.js → journeyDiagram-COXZFDF6-CnHV2f9V.js} +3 -3
- package/dist/client/assets/{kanban-definition-PNTS6WVX-5ZDV_yIa.js → kanban-definition-P3RFRI5V-Cxvn5ZAG.js} +4 -4
- package/dist/client/assets/{kanban-definition-UXKFOSKX-DMgUfNt0.js → kanban-definition-UXKFOSKX-BY16Tgbr.js} +1 -1
- package/dist/client/assets/keyboard-shortcuts-BWNCBJqw.js +1 -0
- package/dist/client/assets/lobby-presence-DNNXcuwR.js +1 -0
- package/dist/client/assets/{markdown-CZ1tYEW8.js → markdown-DU84620G.js} +1 -1
- package/dist/client/assets/markdown-headings-zYEUahfW.js +41 -0
- package/dist/client/assets/{markdown-math-CyyBVuDO.js → markdown-math-B96cnrz1.js} +11 -11
- package/dist/client/assets/{mermaid-parser.core-Bpogunsh.js → mermaid-parser.core-R-uwU5kf.js} +3 -3
- package/dist/client/assets/{mermaid-parser.core-DBy--Jc0.js → mermaid-parser.core-mE6t1qEO.js} +1 -1
- package/dist/client/assets/mermaid.core-D8Z6LN7O.js +10 -0
- package/dist/client/assets/{mindmap-definition-NLK3R4M7-ByVb-0vj.js → mindmap-definition-LZFPQGKD-DVfFenfJ.js} +3 -3
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-DBZN5_GH.js → mindmap-definition-YA3MSWOX-DtiE80UJ.js} +1 -1
- package/dist/client/assets/packet-AYTQ26CC-DvbY8dI6.js +1 -1
- package/dist/client/assets/packet-JDAUHWVQ-DJ9K2MA4.js +1 -0
- package/dist/client/assets/{pegDiagram-GJSIUBJH-aost1sSO.js → pegDiagram-BGZESJAR-DxfvEcwv.js} +1 -1
- package/dist/client/assets/{pegDiagram-XKGWAZYB-DRo8CZu3.js → pegDiagram-XKGWAZYB-CyozY-Kt.js} +1 -1
- package/dist/client/assets/pie-WAS4IAKB-DWSm9SSD.js +1 -1
- package/dist/client/assets/pie-XZMESJXO-CQIQasY-.js +1 -0
- package/dist/client/assets/{pieDiagram-5QR66LMP-BICdpEuz.js → pieDiagram-CAPJLFHJ-CRlMcrv3.js} +2 -2
- package/dist/client/assets/{pieDiagram-E7YTZNPT-CZThaHsc.js → pieDiagram-E7YTZNPT-BRdmTkDq.js} +1 -1
- package/dist/client/assets/preload-helper-CYtfOYgs.js +1 -0
- package/dist/client/assets/preview-render-compiler-D_aJv7Ew.js +3 -0
- package/dist/client/assets/{preview-render-worker-BA4VK_GY.js → preview-render-worker-dFNyrVyB.js} +46 -42
- package/dist/client/assets/prod-ItolaHmf.js +145 -0
- package/dist/client/assets/prod-rdly4JJQ.js +1 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-C5iowkl_.js → quadrantDiagram-AXDQQJYC-7QyPIXkF.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-O4NWA36T-Bgx5bF97.js → quadrantDiagram-GDMTTRAM-DE30uqTl.js} +3 -3
- package/dist/client/assets/quick-switcher-controller-DsK70I7K.js +1 -0
- package/dist/client/assets/radar-ABXABTNO-ByfpCXh9.js +1 -0
- package/dist/client/assets/radar-RG4KPBEZ-BfNQUEQy.js +1 -1
- package/dist/client/assets/railroad-74A4TZTK-BaQ6U6eJ.js +1 -1
- package/dist/client/assets/railroad-I3PHUGI6-CTUn9HhI.js +1 -0
- package/dist/client/assets/railroad-abnf-HS5TGJTU-BJ3KZw7J.js +1 -1
- package/dist/client/assets/railroad-abnf-LNEFI6M7-Ct-b-y0F.js +1 -0
- package/dist/client/assets/railroad-ebnf-DWYD2UWJ-BZMYMWOe.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-DA0sEq7w.js +1 -1
- package/dist/client/assets/railroad-peg-JR7BVNR7-Dj23PxYc.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-DCmlICzO.js +1 -1
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-BTt_rKjT.js → railroadDiagram-O6MQD6OU-BPk3RS2D.js} +1 -1
- package/dist/client/assets/{railroadDiagram-XR7U4H2S-DbVoNgSz.js → railroadDiagram-SM67HX2B-CZRXJ647.js} +1 -1
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-BkvazG7r.js → requirementDiagram-BXWQKSXE-BRwfym6z.js} +1 -1
- package/dist/client/assets/{requirementDiagram-PLB6GJNP-BT0j9C40.js → requirementDiagram-X7JNWC4A-BofCuLJA.js} +4 -4
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-C_IemB9h.js → sankeyDiagram-P5KCCOFB-D4LcrKpW.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-IPEJSGJF-X1BCUIrf.js → sankeyDiagram-UM26HJRW-CLKMDbej.js} +3 -3
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-CxFBgLGd.js → sequenceDiagram-WJ2MYXX4-DQjtv-Bs.js} +1 -1
- package/dist/client/assets/sequenceDiagram-ZO4K6R2Y-CDP_m6ma.js +169 -0
- package/dist/client/assets/sizeCapture-INFHLROL-3uHXrFqA.js +1 -0
- package/dist/client/assets/sizeCapture-INFHLROL-BMR1ovSU.js +1 -0
- package/dist/client/assets/src-D5mvpivG.js +2 -0
- package/dist/client/assets/{standalone-DbyFjvTU.js → standalone-D_lg5NC9.js} +1 -1
- package/dist/client/assets/{stateDiagram-D77RDMKH-BaSQ6Owj.js → stateDiagram-D77RDMKH-DSMvV-kF.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-ClmOOUsT.js +1 -0
- package/dist/client/assets/{stateDiagram-v2-GCMORJYK-CsVcfwVp.js → stateDiagram-v2-TBUQTH76-Dc5-FKzd.js} +2 -2
- package/dist/client/assets/{swimlanes-42K2YHIH-CALFEmiS.js → swimlanes-42K2YHIH-BUz31lO3.js} +1 -1
- package/dist/client/assets/{swimlanes-2SLR337P-CnYTVqRX.js → swimlanes-N4OXWK64-Dd3dFdPD.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-K3J5GTZL-Bz9gFdls.js +8 -0
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DoDs3zod.js +8 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-zse-5Dbm.js → timeline-definition-24CTP7MA-BvqCvSjy.js} +1 -1
- package/dist/client/assets/{timeline-definition-EJHVYXUP-BhqPlKkN.js → timeline-definition-YOQAKGHF-D2XWPSLs.js} +3 -3
- package/dist/client/assets/treeView-D4JQ5SDB-DcX7Bx0H.js +1 -0
- package/dist/client/assets/treeView-Q6P3EWNA-BvHOzbu9.js +1 -1
- package/dist/client/assets/treemap-SAJKECNS-BcCHmcAX.js +1 -0
- package/dist/client/assets/treemap-WGGIJYW6-oety7paS.js +1 -1
- package/dist/client/assets/usecaseDiagram-VIAY4XPW-CDe-IMjS.js +328 -0
- package/dist/client/assets/vault-api-client-DrRW0QwO.js +7 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-DgHr6cJD.js → vennDiagram-4TSXK5OY-BW6Qp12d.js} +1 -1
- package/dist/client/assets/{vennDiagram-UO4OBE2U-BRwLn2Q1.js → vennDiagram-BLWOH2XV-KxIPKpHi.js} +3 -3
- package/dist/client/assets/wardley-7MLQ67FV-DOahSwbZ.js +1 -0
- package/dist/client/assets/wardley-WFR3VGLG-BdwDpX_I.js +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-9A60XZis.js → wardleyDiagram-VM6X3IG4-BoCETVsK.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VNRHLVJA-B_tMcVFG.js → wardleyDiagram-YMQ3BMBF-BNYqEy7M.js} +4 -4
- package/dist/client/assets/{wiki-link-resolver-Dch88erO.js → wiki-link-resolver-BCdGUpdu.js} +1 -1
- package/dist/client/assets/{worker-engine-BCCrxWYm-CX0qJ_cG.js → worker-engine-BCCrxWYm-1fphds7O.js} +1 -1
- package/dist/client/assets/workspace-sync-client-C_P9wtjf.js +1 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-D00iy-wB.js → xychartDiagram-S5SC5T6Z-eB5Fu9P7.js} +1 -1
- package/dist/client/assets/xychartDiagram-TAQBALBS-Sv6aaptV.js +7 -0
- package/dist/client/assets/yjs-Jd9fna_Y.js +4 -0
- package/dist/client/assets/yjs-provider-reset-guard-Cqu0Z6xH.js +1 -0
- package/dist/client/canvas-editor.html +16 -0
- package/dist/client/drawio-editor.html +7 -6
- package/dist/client/excalidraw-editor.html +31 -30
- package/dist/client/export-document.html +4 -3
- package/dist/client/index.html +2 -2
- package/package.json +27 -29
- package/scripts/local-compose.mjs +101 -0
- package/src/client/app/canvas-editor.html +13 -0
- package/src/client/application/app-shell/git-feature.js +3 -2
- package/src/client/application/app-shell/ui-feature-identity.js +1 -0
- package/src/client/application/app-shell/ui-feature-shell.js +2 -0
- package/src/client/application/app-shell/ui-feature-tab-activity.js +4 -0
- package/src/client/application/app-shell/workspace-feature.js +8 -34
- package/src/client/application/diagram-chrome.js +8 -11
- package/src/client/application/diagram-preview-hydrator.js +5 -5
- package/src/client/application/mermaid-preview-hydrator.js +3 -2
- package/src/client/application/plantuml-preview-hydrator.js +6 -0
- package/src/client/application/preview-render-compiler.js +34 -98
- package/src/client/application/preview-render-executor.js +3 -0
- package/src/client/application/preview-render-worker.js +2 -0
- package/src/client/application/preview-renderer.js +9 -5
- package/src/client/application/workspace-coordinator.js +18 -10
- package/src/client/application/workspace-preview-controller.js +105 -158
- package/src/client/application/workspace-route-controller.js +29 -54
- package/src/client/bootstrap/canvas-markdown-preview.js +87 -0
- package/src/client/bootstrap/collabmd-app-shell.js +28 -13
- package/src/client/canvas-editor.js +143 -0
- package/src/client/domain/canvas-view.js +50 -0
- package/src/client/domain/excalidraw-scene.js +4 -49
- package/src/client/domain/highlight-runtime.js +0 -4
- package/src/client/domain/markdown-formatting.js +12 -94
- package/src/client/domain/markdown-headings.js +98 -0
- package/src/client/domain/wiki-link-completions.js +42 -10
- package/src/client/infrastructure/browser-preferences-port.js +27 -33
- package/src/client/infrastructure/canvas-room-client.js +210 -0
- package/src/client/infrastructure/canvas-text-editor.js +36 -0
- package/src/client/infrastructure/comment-thread-store.js +19 -77
- package/src/client/infrastructure/editor-view-adapter.js +0 -30
- package/src/client/infrastructure/excalidraw-room-client.js +22 -10
- package/src/client/infrastructure/hosted-api-client.js +4 -2
- package/src/client/infrastructure/vault-api-client.js +4 -4
- package/src/client/presentation/canvas-editor-view.js +1028 -0
- package/src/client/presentation/canvas-embed-controller.js +116 -0
- package/src/client/presentation/canvas-picker.js +111 -0
- package/src/client/presentation/drawio-embed-controller.js +1 -3
- package/src/client/presentation/excalidraw-embed-controller.js +10 -3
- package/src/client/presentation/file-action-controller.js +37 -0
- package/src/client/presentation/file-explorer-controller.js +1 -2
- package/src/client/presentation/file-explorer-view.js +7 -1
- package/src/client/presentation/file-icon-svg.js +1 -1
- package/src/client/presentation/file-tree-state.js +4 -1
- package/src/client/presentation/image-lightbox-controller.js +1 -5
- package/src/client/presentation/team-settings-controller.js +44 -10
- package/src/client/styles/components/actions.css +4 -16
- package/src/client/styles/components/surfaces.css +0 -7
- package/src/client/styles/features/comment-card.css +1 -2
- package/src/client/styles/features/comment-markdown.css +0 -18
- package/src/client/styles/features/diagram-preview.css +0 -18
- package/src/client/styles/features/git-branch.css +0 -4
- package/src/client/styles/foundation/themes.css +6 -0
- package/src/client/styles/foundation/utilities.css +1 -2
- package/src/client/styles/layout/editor-page.css +0 -13
- package/src/client/styles/layout/responsive.css +2 -7
- package/src/client/styles/layout/shell.css +13 -1
- package/src/client/styles/layout/view-modes.css +1 -0
- package/src/client/styles/surfaces/canvas-editor.css +239 -0
- package/src/domain/canvas-room-codec.js +359 -0
- package/src/domain/collabmd-content-capabilities.js +10 -1
- package/src/domain/comment-threads.js +49 -5
- package/src/domain/excalidraw-room-codec.js +23 -73
- package/src/domain/excalidraw-scene.js +48 -0
- package/src/domain/file-kind.js +13 -1
- package/src/server/application/workspace-reconciliation.js +0 -14
- package/src/server/domain/backlink-index.js +1 -36
- package/src/server/domain/bases/base-index-snapshot-store.js +41 -24
- package/src/server/domain/bases/base-query-service.js +1 -47
- package/src/server/domain/collaboration/collaboration-room.js +149 -15
- package/src/server/domain/collaboration/room-registry.js +7 -7
- package/src/server/domain/hosted-workspace.js +29 -2
- package/src/server/domain/plantuml-encoder.js +7 -43
- package/src/server/infrastructure/git/diff-service.js +1 -5
- package/src/server/infrastructure/git/history-service.js +18 -2
- package/src/server/infrastructure/git/untracked-files.js +1 -1
- package/src/server/infrastructure/http/create-git-api-command-handler.js +60 -149
- package/src/server/infrastructure/http/create-hosted-api-handler.js +5 -2
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +2 -2
- package/src/server/infrastructure/http/http-response.js +2 -36
- package/src/server/infrastructure/http/request-body.js +14 -49
- package/src/server/infrastructure/persistence/hosted-metadata-store.js +12 -3
- package/src/server/infrastructure/persistence/path-utils.js +8 -2
- package/src/server/infrastructure/persistence/vault-file-store.js +26 -60
- package/src/server/{infrastructure/git → shared}/image-mime.js +2 -2
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-kJfwukbn.js +0 -1
- package/dist/client/assets/_basePickBy-QJXUw_pr.js +0 -1
- package/dist/client/assets/_baseUniq-DR4vVjyC.js +0 -1
- package/dist/client/assets/architecture-7GRP2DOG-DJVtYNt-.js +0 -1
- package/dist/client/assets/browser-utils-S4QYY31r.js +0 -1
- package/dist/client/assets/chunk-3FUC2YCW-8tZlhTGX.js +0 -1
- package/dist/client/assets/chunk-7M6MHVWA-BDakkknV.js +0 -213
- package/dist/client/assets/chunk-FOHPRMQF-Dmmo5Kak.js +0 -161
- package/dist/client/assets/chunk-O7XYJQB3-D0_ZY2za.js +0 -126
- package/dist/client/assets/chunk-T5WUORNS-DD7KlyY6.js +0 -40
- package/dist/client/assets/chunk-Z7XXMR3K-P4Vaq8hD.js +0 -10
- package/dist/client/assets/chunk-ZIGJFQKS-b8OUHKK5.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-QLbh_Nkf.js +0 -1
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-QLbh_Nkf.js +0 -1
- package/dist/client/assets/comment-thread-store-CHvy8GF8.js +0 -1
- package/dist/client/assets/comment-threads-nJhK1yfc.js +0 -4
- package/dist/client/assets/cynefin-OW5HDTMX-e-Quc9Yl.js +0 -1
- package/dist/client/assets/dagre-D7FiCLLP.js +0 -1
- package/dist/client/assets/deferred-collab-D4cxEdad.css +0 -1
- package/dist/client/assets/deferred-git-BHKtkFYi.css +0 -1
- package/dist/client/assets/deferred-preview-BAXYgf4T.css +0 -1
- package/dist/client/assets/diagram-ATOU4E4O-B5uX-jVO.js +0 -3
- package/dist/client/assets/dist-B2ZNQifU.js +0 -1
- package/dist/client/assets/dist-B6QCMNze.js +0 -1
- package/dist/client/assets/dist-BIAv19LO.js +0 -1
- package/dist/client/assets/dist-BKYp1-dl.js +0 -13
- package/dist/client/assets/dist-BSTbcioM.js +0 -11
- package/dist/client/assets/dist-BTVg1m-V.js +0 -1
- package/dist/client/assets/dist-Bi9ZIYXq.js +0 -9
- package/dist/client/assets/dist-Bqo-XRVG.js +0 -1
- package/dist/client/assets/dist-CBsvKPcT.js +0 -1
- package/dist/client/assets/dist-CJBYh9Wy.js +0 -23
- package/dist/client/assets/dist-CRwfjtwz.js +0 -2
- package/dist/client/assets/dist-CX7Kc61C.js +0 -1
- package/dist/client/assets/dist-CYfPeupF.js +0 -1
- package/dist/client/assets/dist-CucpLxUY.js +0 -1
- package/dist/client/assets/dist-DHBMeCxC.js +0 -6
- package/dist/client/assets/dist-DLEg9d4u.js +0 -1
- package/dist/client/assets/dist-DYFBD-wW.js +0 -1
- package/dist/client/assets/dist-DugWGOjQ.js +0 -1
- package/dist/client/assets/dist-NNrRnB-f.js +0 -1
- package/dist/client/assets/dist-PUxZqhFe.js +0 -1
- package/dist/client/assets/dist-cYiJMWHJ.js +0 -1
- package/dist/client/assets/dist-iKC7go4m.js +0 -1
- package/dist/client/assets/document-formatter-6I63vstk.js +0 -1
- package/dist/client/assets/drawioEditor-DNTjsjzJ.js +0 -9
- package/dist/client/assets/editor-session-D8GGkJak.js +0 -14
- package/dist/client/assets/elk-276RUBZZ-B8LB3Pac.js +0 -27
- package/dist/client/assets/embedded-editor-base-elU0Avik.css +0 -1
- package/dist/client/assets/en-JTHJ2SIP-DBz9bRq4.js +0 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-Dxtv5D-P.js +0 -1
- package/dist/client/assets/excalidraw-element-link-BRZOTIeI.js +0 -7
- package/dist/client/assets/excalidraw-scene-6uROebca.js +0 -1
- package/dist/client/assets/excalidrawEditor-BCTFp_CV.css +0 -1
- package/dist/client/assets/excalidrawEditor-D0orhhku.js +0 -9
- package/dist/client/assets/export-page-CVJNMERq.js +0 -46
- package/dist/client/assets/exportDocument-Ba-n1X4U.css +0 -1
- package/dist/client/assets/exportDocument-DSshnmnZ.js +0 -2
- package/dist/client/assets/file-kind-BwMIcZbi.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-Bq4470NR.js +0 -1
- package/dist/client/assets/flowDiagram-KWPJA3E3-DQG9qGiU.js +0 -1
- package/dist/client/assets/ganttDiagram-FUAMR5RP-BQpsI7gQ.js +0 -292
- package/dist/client/assets/gitGraph-4MIJSDKK-ZaBIE4Lb.js +0 -1
- package/dist/client/assets/gitGraphDiagram-X574FWY7-wbs_2m9f.js +0 -106
- package/dist/client/assets/graphlib-C9Tl7QrK.js +0 -1
- package/dist/client/assets/image-I42VHMUI-B2-c_ifV.js +0 -1
- package/dist/client/assets/index-BCgNcVNs.css +0 -1
- package/dist/client/assets/index-BpmR5Qqk.js +0 -1140
- package/dist/client/assets/info-A6RAGUB7-BcGxhjED.js +0 -1
- package/dist/client/assets/lobby-presence-KJrYhMdN.js +0 -1
- package/dist/client/assets/mermaid.core-BeOUPE3Q.js +0 -10
- package/dist/client/assets/packet-AYTQ26CC-CqpSjTWl.js +0 -1
- package/dist/client/assets/pie-WAS4IAKB-Bg2eCNl5.js +0 -1
- package/dist/client/assets/preload-helper-BAlEavIC.js +0 -1
- package/dist/client/assets/preview-render-compiler-BmWQStaL.js +0 -43
- package/dist/client/assets/prod-CA0ie9yD.js +0 -145
- package/dist/client/assets/prod-yKJZ3E4s.js +0 -1
- package/dist/client/assets/quick-switcher-controller-B5vT9Vj5.js +0 -1
- package/dist/client/assets/radar-RG4KPBEZ-DxExotg6.js +0 -1
- package/dist/client/assets/railroad-74A4TZTK-FfHmeIQk.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-CLkdDRsJ.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-B162zvcG.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-CGs5GeJ5.js +0 -1
- package/dist/client/assets/sequenceDiagram-PO4LG4MO-B-2QfXhV.js +0 -169
- package/dist/client/assets/sizeCapture-INFHLROL-B0uUizjq.js +0 -1
- package/dist/client/assets/sizeCapture-INFHLROL-DrzwYt5z.js +0 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CLlwrdvU.js +0 -1
- package/dist/client/assets/swimlanesDiagram-TC7HE7FX-Bh4tmz27.js +0 -8
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-xhehUG9e.js +0 -8
- package/dist/client/assets/treeView-Q6P3EWNA-Cccy0ngL.js +0 -1
- package/dist/client/assets/treemap-WGGIJYW6-sMRCjCtX.js +0 -1
- package/dist/client/assets/usecaseDiagram-POWQR4AR-DR2LHQYs.js +0 -328
- package/dist/client/assets/vault-api-client-NS_EVHJ3.js +0 -7
- package/dist/client/assets/wardley-WFR3VGLG-Y7xty_3m.js +0 -1
- package/dist/client/assets/workspace-sync-client-BrMtf6zN.js +0 -1
- package/dist/client/assets/xychartDiagram-PMCCYNJV-fRpZ1MA5.js +0 -7
- package/dist/client/assets/yjs-B41tM6Sz.js +0 -4
- package/dist/client/assets/yjs-provider-reset-guard-DpntzUDR.js +0 -1
- package/scripts/local-plantuml-compose.mjs +0 -92
- package/scripts/local-structurizr-compose.mjs +0 -101
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { resolveVaultRelativePath } from '../../domain/vault-paths.js';
|
|
2
|
+
import { resolveWikiTargetPath } from '../../domain/wiki-link-resolver.js';
|
|
3
|
+
import { PreviewRenderer } from '../application/preview-renderer.js';
|
|
4
|
+
import { canvasFilePath } from '../domain/canvas-view.js';
|
|
5
|
+
import { BasesPreviewController } from '../presentation/bases-preview-controller.js';
|
|
6
|
+
import { DrawioEmbedController } from '../presentation/drawio-embed-controller.js';
|
|
7
|
+
import { ExcalidrawEmbedController } from '../presentation/excalidraw-embed-controller.js';
|
|
8
|
+
import { VideoEmbedController } from '../presentation/video-embed-controller.js';
|
|
9
|
+
|
|
10
|
+
export function createCanvasMarkdownPreview({
|
|
11
|
+
container, markdownText, sourceFilePath, subpath = '',
|
|
12
|
+
getFileList, getLocalUser, getTheme, onOpenFile, vaultApiClient,
|
|
13
|
+
}) {
|
|
14
|
+
const previewElement = document.createElement('div');
|
|
15
|
+
previewElement.className = 'preview-content canvas-markdown-preview';
|
|
16
|
+
container.append(previewElement);
|
|
17
|
+
const options = {
|
|
18
|
+
getActiveFilePath: () => sourceFilePath,
|
|
19
|
+
getLocalUser, getTheme, onOpenFile,
|
|
20
|
+
previewContainer: container.closest('.canvas-card-content'), previewElement, vaultApiClient,
|
|
21
|
+
};
|
|
22
|
+
const embeds = [
|
|
23
|
+
new VideoEmbedController(options), new BasesPreviewController(options),
|
|
24
|
+
new DrawioEmbedController(options), new ExcalidrawEmbedController(options),
|
|
25
|
+
];
|
|
26
|
+
const syncLayout = () => embeds.forEach((embed) => embed.syncLayout?.());
|
|
27
|
+
const renderer = new PreviewRenderer({
|
|
28
|
+
...options,
|
|
29
|
+
getContent: () => markdownText,
|
|
30
|
+
getFileList,
|
|
31
|
+
getSourceFilePath: () => sourceFilePath,
|
|
32
|
+
getSubpath: () => subpath,
|
|
33
|
+
getWikiLinkAutoCreate: () => false,
|
|
34
|
+
loadFileSource: async (path) => String((await vaultApiClient.readFile(path)).content ?? ''),
|
|
35
|
+
plantUmlRenderClient: vaultApiClient,
|
|
36
|
+
onBeforeRenderCommit: () => embeds.forEach((embed) => embed.detachForCommit?.()),
|
|
37
|
+
onAfterRenderCommit: (_element, stats) => {
|
|
38
|
+
embeds.forEach((embed) => embed.reconcileEmbeds(previewElement, stats));
|
|
39
|
+
previewElement.querySelectorAll('[data-task-checkbox]').forEach((input) => { input.disabled = true; });
|
|
40
|
+
},
|
|
41
|
+
onPreviewLayoutChange: syncLayout,
|
|
42
|
+
});
|
|
43
|
+
const resizeObserver = new ResizeObserver(syncLayout);
|
|
44
|
+
resizeObserver.observe(previewElement);
|
|
45
|
+
|
|
46
|
+
const onClick = (event) => {
|
|
47
|
+
const link = event.target.closest('a[href]');
|
|
48
|
+
if (!link) return;
|
|
49
|
+
const href = link.getAttribute('href') || '';
|
|
50
|
+
const wikiTarget = link.dataset.wikiTarget;
|
|
51
|
+
if (wikiTarget) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
const [target, anchor] = wikiTarget.split('#');
|
|
54
|
+
const path = resolveWikiTargetPath(target, getFileList());
|
|
55
|
+
if (path) onOpenFile(path, anchor ? `#${anchor}` : '');
|
|
56
|
+
} else if (href.startsWith('#')) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
let anchor;
|
|
59
|
+
try { anchor = decodeURIComponent(href.slice(1)); } catch { return; }
|
|
60
|
+
const heading = [...previewElement.querySelectorAll('[id]')].find((entry) => entry.id === anchor);
|
|
61
|
+
if (heading) heading.scrollIntoView({ block: 'nearest' });
|
|
62
|
+
else if (!anchor || anchor === 'top') options.previewContainer.scrollTo({ top: 0 });
|
|
63
|
+
else onOpenFile(sourceFilePath, href);
|
|
64
|
+
} else if (!/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(href)) {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
const [target, anchor] = href.split('#');
|
|
67
|
+
let path;
|
|
68
|
+
try { path = canvasFilePath(resolveVaultRelativePath(sourceFilePath, decodeURIComponent(target))); } catch { return; }
|
|
69
|
+
if (path) onOpenFile(path, anchor ? `#${anchor}` : '');
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
previewElement.addEventListener('click', onClick);
|
|
73
|
+
renderer.queueRender();
|
|
74
|
+
return {
|
|
75
|
+
applyTheme(theme) {
|
|
76
|
+
renderer.applyTheme(theme);
|
|
77
|
+
embeds.forEach((embed) => embed.updateTheme?.(theme));
|
|
78
|
+
},
|
|
79
|
+
destroy() {
|
|
80
|
+
resizeObserver.disconnect();
|
|
81
|
+
previewElement.removeEventListener('click', onClick);
|
|
82
|
+
renderer.destroy();
|
|
83
|
+
embeds.forEach((embed) => embed.destroy());
|
|
84
|
+
previewElement.remove();
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -53,6 +53,7 @@ import { FileExplorerController } from '../presentation/file-explorer-controller
|
|
|
53
53
|
import { FileHistoryViewController } from '../presentation/file-history-view-controller.js';
|
|
54
54
|
import { BasesPreviewController } from '../presentation/bases-preview-controller.js';
|
|
55
55
|
import { DrawioEmbedController } from '../presentation/drawio-embed-controller.js';
|
|
56
|
+
import { CanvasEmbedController } from '../presentation/canvas-embed-controller.js';
|
|
56
57
|
import { ExcalidrawEmbedController } from '../presentation/excalidraw-embed-controller.js';
|
|
57
58
|
import { GitDiffViewController } from '../presentation/git-diff-view-controller.js';
|
|
58
59
|
import { GitPanelController } from '../presentation/git-panel-controller.js';
|
|
@@ -122,14 +123,7 @@ export class CollabMdAppShell {
|
|
|
122
123
|
navigateToGitFilePreview,
|
|
123
124
|
navigateToGitHistory,
|
|
124
125
|
};
|
|
125
|
-
this.preferences = new BrowserPreferencesPort(
|
|
126
|
-
fileTreeShowExtensionsKey: 'collabmd-file-tree-show-extensions',
|
|
127
|
-
lineWrappingKey: 'collabmd-editor-line-wrap',
|
|
128
|
-
recentFilesKey: 'collabmd-recent-files',
|
|
129
|
-
vimModeKey: 'collabmd-editor-vim-mode',
|
|
130
|
-
sidebarVisibleKey: 'collabmd-sidebar-visible',
|
|
131
|
-
userNameKey: 'collabmd-user-name',
|
|
132
|
-
});
|
|
126
|
+
this.preferences = new BrowserPreferencesPort();
|
|
133
127
|
this.notifications = new BrowserNotificationPort();
|
|
134
128
|
this.gitApiClient = gitApiClient;
|
|
135
129
|
this.vaultApiClient = vaultApiClient;
|
|
@@ -137,10 +131,7 @@ export class CollabMdAppShell {
|
|
|
137
131
|
this._hasPromptedForDisplayName = false;
|
|
138
132
|
this._basePreviewRenderTimer = null;
|
|
139
133
|
this._backlinkRefreshTimer = null;
|
|
140
|
-
this._pendingPreviewLayoutSync = false;
|
|
141
|
-
this._previewHydrationPaused = false;
|
|
142
134
|
this._previewLayoutResizeObserver = null;
|
|
143
|
-
this._previewLayoutSyncTimer = null;
|
|
144
135
|
this._reloadPromptShown = false;
|
|
145
136
|
this._staticPreviewDocument = null;
|
|
146
137
|
this.pendingGitResetPath = null;
|
|
@@ -277,10 +268,11 @@ export class CollabMdAppShell {
|
|
|
277
268
|
vaultSwitcher: {
|
|
278
269
|
activeVaultId: getActiveVaultId(this.runtimeConfig),
|
|
279
270
|
vaults: this.runtimeConfig.vaults ?? [],
|
|
280
|
-
onVaultSelect: (vaultId) => {
|
|
271
|
+
onVaultSelect: async (vaultId) => {
|
|
281
272
|
if (!vaultId || vaultId === getActiveVaultId(this.runtimeConfig)) {
|
|
282
273
|
return;
|
|
283
274
|
}
|
|
275
|
+
if (!await this.workspaceRouteController.prepareActiveEmbedDisconnect()) return;
|
|
284
276
|
setActiveVaultId(vaultId);
|
|
285
277
|
const url = new URL(window.location.href);
|
|
286
278
|
url.searchParams.set('vault', vaultId);
|
|
@@ -430,6 +422,16 @@ export class CollabMdAppShell {
|
|
|
430
422
|
}),
|
|
431
423
|
panelElement: this.elements.backlinksPanel,
|
|
432
424
|
});
|
|
425
|
+
this.canvasEmbed = new CanvasEmbedController({
|
|
426
|
+
getLocalUser: () => this.lobby.getLocalUser(),
|
|
427
|
+
getTheme: () => this.themeController.getTheme(),
|
|
428
|
+
onAwarenessChange: (users) => this.updateFileAwareness(users),
|
|
429
|
+
onConnectionChange: (state) => this.handleConnectionChange(state),
|
|
430
|
+
onOpenFile: (filePath, options) => {
|
|
431
|
+
if (this.fileExplorer.flatFiles.includes(filePath)) this.navigation.navigateToFile(filePath, options);
|
|
432
|
+
},
|
|
433
|
+
toastController: this.toastController,
|
|
434
|
+
});
|
|
433
435
|
this.excalidrawEmbed = new ExcalidrawEmbedController({
|
|
434
436
|
getLocalUser: () => this.lobby.getLocalUser(),
|
|
435
437
|
getTheme: () => this.themeController.getTheme(),
|
|
@@ -500,6 +502,7 @@ export class CollabMdAppShell {
|
|
|
500
502
|
this.workspacePreviewController = new WorkspacePreviewController({
|
|
501
503
|
backlinksPanel: this.backlinksPanel,
|
|
502
504
|
basesPreview: this.basesPreview,
|
|
505
|
+
canvasEmbed: this.canvasEmbed,
|
|
503
506
|
drawioEmbed: this.drawioEmbed,
|
|
504
507
|
elements: this.elements,
|
|
505
508
|
excalidrawEmbed: this.excalidrawEmbed,
|
|
@@ -517,7 +520,6 @@ export class CollabMdAppShell {
|
|
|
517
520
|
outlineController: this.outlineController,
|
|
518
521
|
pdfPreview: this.pdfPreview,
|
|
519
522
|
previewRenderer: this.previewRenderer,
|
|
520
|
-
schedulePreviewLayoutSync: (options) => this.schedulePreviewLayoutSync(options),
|
|
521
523
|
scrollSyncController: this.scrollSyncController,
|
|
522
524
|
videoEmbed: this.videoEmbed,
|
|
523
525
|
});
|
|
@@ -575,6 +577,7 @@ export class CollabMdAppShell {
|
|
|
575
577
|
attachEditorScroller: (scroller) => this.scrollSyncController.attachEditorScroller(scroller),
|
|
576
578
|
beginDocumentLoad: () => this.previewRenderer.beginDocumentLoad(),
|
|
577
579
|
cleanupAfterSessionDestroy: () => {
|
|
580
|
+
this.canvasEmbed.unmount();
|
|
578
581
|
this.scrollSyncController.setLargeDocumentMode(false);
|
|
579
582
|
this.scrollSyncController.invalidatePreviewBlocks();
|
|
580
583
|
this.outlineController.cleanup();
|
|
@@ -606,6 +609,7 @@ export class CollabMdAppShell {
|
|
|
606
609
|
getStoredUserName: () => this.getStoredUserName(),
|
|
607
610
|
getTheme: () => this.themeController.getTheme(),
|
|
608
611
|
isBaseFile: (filePath) => this.isBaseFile(filePath),
|
|
612
|
+
isCanvasFile: (filePath) => this.isCanvasFile(filePath),
|
|
609
613
|
isDrawioFile: (filePath) => this.isDrawioFile(filePath),
|
|
610
614
|
isExcalidrawFile: (filePath) => this.isExcalidrawFile(filePath),
|
|
611
615
|
isImageFile: (filePath) => this.isImageFile(filePath),
|
|
@@ -673,6 +677,7 @@ export class CollabMdAppShell {
|
|
|
673
677
|
onCommentsChange: (threads) => this.handleCommentThreadsChange(threads),
|
|
674
678
|
onFileAwarenessChange: (users) => this.updateFileAwareness(users),
|
|
675
679
|
onFileOpenError: ({ code } = {}) => {
|
|
680
|
+
this.currentFilePath = null;
|
|
676
681
|
const notFound = code === 'not-found';
|
|
677
682
|
this.showEditorLoadError(notFound ? 'File not found' : 'Failed to load file');
|
|
678
683
|
this.syncWrapToggle();
|
|
@@ -693,6 +698,7 @@ export class CollabMdAppShell {
|
|
|
693
698
|
},
|
|
694
699
|
onRenderDrawioPreview: (filePath) => this.workspacePreviewController.renderDrawioFilePreview(filePath),
|
|
695
700
|
onRenderBasePreview: (filePath) => this.renderBaseFilePreview(filePath),
|
|
701
|
+
onRenderCanvasPreview: (filePath) => this.workspacePreviewController.renderCanvasFilePreview(filePath),
|
|
696
702
|
onRenderExcalidrawPreview: (filePath) => this.workspacePreviewController.renderExcalidrawFilePreview(filePath),
|
|
697
703
|
onRenderHtmlPreview: (options) => this.workspacePreviewController.renderHtmlFilePreview(options),
|
|
698
704
|
onRenderImagePreview: (filePath) => this.workspacePreviewController.renderImageFilePreview(filePath),
|
|
@@ -725,6 +731,7 @@ export class CollabMdAppShell {
|
|
|
725
731
|
});
|
|
726
732
|
this.workspaceRouteController = new WorkspaceRouteController({
|
|
727
733
|
backlinksPanel: this.backlinksPanel,
|
|
734
|
+
canvasEmbed: this.canvasEmbed,
|
|
728
735
|
clearInitialFileBootstrap: () => this.clearInitialFileBootstrap(),
|
|
729
736
|
clearStaticPreviewDocument: () => this.clearStaticPreviewDocument(),
|
|
730
737
|
closeSidebarOnMobile: () => this.closeSidebarOnMobile(),
|
|
@@ -776,6 +783,14 @@ export class CollabMdAppShell {
|
|
|
776
783
|
|
|
777
784
|
}
|
|
778
785
|
|
|
786
|
+
get currentFilePath() { return this._currentFilePath; }
|
|
787
|
+
set currentFilePath(value) {
|
|
788
|
+
this._currentFilePath = value;
|
|
789
|
+
document.title = value
|
|
790
|
+
? `${this.getDisplayName(value)} — CollabMD`
|
|
791
|
+
: 'CollabMD — Collaborative Markdown Vault';
|
|
792
|
+
}
|
|
793
|
+
|
|
779
794
|
get session() { return this._session; }
|
|
780
795
|
set session(value) {
|
|
781
796
|
this._session = value;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CANVAS_NODES_KEY,
|
|
3
|
+
addCanvasNode, addCanvasEdge, updateCanvasNode, updateCanvasEdge,
|
|
4
|
+
deleteCanvasNodes, deleteCanvasEdges, reorderCanvasNode, resolveCanvasExternalConflict,
|
|
5
|
+
} from '../domain/canvas-room-codec.js';
|
|
6
|
+
import { createRandomUser } from './domain/room.js';
|
|
7
|
+
import { createCanvasMarkdownPreview } from './bootstrap/canvas-markdown-preview.js';
|
|
8
|
+
import { canvasFilePath } from './domain/canvas-view.js';
|
|
9
|
+
import { getActiveVaultId, getClientRuntimeConfig, resolveApiUrl, resolveWsBaseUrl } from './domain/runtime-paths.js';
|
|
10
|
+
import { ensureClientAuthenticated } from './infrastructure/auth-client.js';
|
|
11
|
+
import { CanvasRoomClient } from './infrastructure/canvas-room-client.js';
|
|
12
|
+
import { createCanvasTextEditor } from './infrastructure/canvas-text-editor.js';
|
|
13
|
+
import { vaultApiClient } from './infrastructure/vault-api-client.js';
|
|
14
|
+
import { CanvasEditorView } from './presentation/canvas-editor-view.js';
|
|
15
|
+
import { flattenTree } from './presentation/file-tree-state.js';
|
|
16
|
+
import { ImageLightboxController } from './presentation/image-lightbox-controller.js';
|
|
17
|
+
import './styles/base.css';
|
|
18
|
+
import './styles/surfaces/embedded-editor-base.css';
|
|
19
|
+
import './styles/primitives/controls.css';
|
|
20
|
+
import './styles/components/actions.css';
|
|
21
|
+
import './styles/surfaces/canvas-editor.css';
|
|
22
|
+
|
|
23
|
+
const params = new URLSearchParams(window.location.search);
|
|
24
|
+
const filePath = canvasFilePath(params.get('file'));
|
|
25
|
+
const root = document.getElementById('root');
|
|
26
|
+
const post = (type, data = {}) => window.parent.postMessage({ type, filePath, ...data }, window.location.origin);
|
|
27
|
+
let client;
|
|
28
|
+
let view;
|
|
29
|
+
|
|
30
|
+
function updateTheme(theme) {
|
|
31
|
+
document.body.dataset.theme = theme === 'light' ? 'light' : 'dark';
|
|
32
|
+
document.documentElement.dataset.theme = document.body.dataset.theme;
|
|
33
|
+
document.documentElement.style.colorScheme = theme === 'light' ? 'light' : 'dark';
|
|
34
|
+
view?.applyTheme(document.body.dataset.theme);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function initialize() {
|
|
38
|
+
updateTheme(params.get('theme'));
|
|
39
|
+
await ensureClientAuthenticated();
|
|
40
|
+
if (!filePath || !/\.canvas$/i.test(filePath)) throw new Error('Choose a valid Canvas file from the Vault.');
|
|
41
|
+
const config = getClientRuntimeConfig();
|
|
42
|
+
const vaultId = params.get('vaultId') || getActiveVaultId(config);
|
|
43
|
+
if (vaultId) {
|
|
44
|
+
const vault = config.vaults?.find((entry) => entry.id === vaultId);
|
|
45
|
+
if (!vault) throw new Error('Vault unavailable');
|
|
46
|
+
// Keep this iframe's transport pinned to its Vault while the host switches tabs.
|
|
47
|
+
config.vaults = [vault];
|
|
48
|
+
config.activeVault = vaultId;
|
|
49
|
+
}
|
|
50
|
+
window.__COLLABMD_CONFIG__ = config;
|
|
51
|
+
const readFile = (path) => vaultApiClient.readFile(path, config);
|
|
52
|
+
let fileList = [];
|
|
53
|
+
const readTree = async () => {
|
|
54
|
+
const result = await vaultApiClient.readTree(config);
|
|
55
|
+
fileList = flattenTree(result.tree ?? []).files;
|
|
56
|
+
return result;
|
|
57
|
+
};
|
|
58
|
+
await readTree();
|
|
59
|
+
const onOpenFile = (path, subpath) => post('canvas-open-file', { filePath: path, subpath });
|
|
60
|
+
const user = createRandomUser(params.get('userName') || localStorage.getItem('collabmd-user-name'));
|
|
61
|
+
for (const [key, parameter] of [['color', 'userColor'], ['colorLight', 'userColorLight'], ['peerId', 'userPeerId']]) {
|
|
62
|
+
if (params.get(parameter)) user[key] = params.get(parameter);
|
|
63
|
+
}
|
|
64
|
+
client = new CanvasRoomClient({
|
|
65
|
+
filePath, user, readFile, wsBaseUrl: resolveWsBaseUrl(config),
|
|
66
|
+
onChange: (state) => view?.update(state),
|
|
67
|
+
onAwareness: (users) => { view?.renderPresence(users); post('canvas-awareness', { users }); },
|
|
68
|
+
onConnection: (state) => post('canvas-connection', { state }),
|
|
69
|
+
});
|
|
70
|
+
const action = (operation) => client.mutate(operation);
|
|
71
|
+
const actions = {
|
|
72
|
+
addNode: (node) => {
|
|
73
|
+
const id = crypto.randomUUID();
|
|
74
|
+
return action((doc) => {
|
|
75
|
+
addCanvasNode(doc, { ...node, id });
|
|
76
|
+
if (node.type === 'group') reorderCanvasNode(doc, id, 'back');
|
|
77
|
+
}) ? id : null;
|
|
78
|
+
},
|
|
79
|
+
addEdge: (edge) => action((doc) => addCanvasEdge(doc, { ...edge, id: crypto.randomUUID() })),
|
|
80
|
+
updateNode: (id, patch) => action((doc) => updateCanvasNode(doc, id, patch)),
|
|
81
|
+
updateEdge: (id, patch) => action((doc) => updateCanvasEdge(doc, id, patch)),
|
|
82
|
+
updateNodes: (patches, separateUndo = true) => client.mutate((doc) => {
|
|
83
|
+
patches.forEach(({ id, patch }) => updateCanvasNode(doc, id, patch));
|
|
84
|
+
}, { separateUndo }),
|
|
85
|
+
deleteNodes: (ids) => action((doc) => deleteCanvasNodes(doc, ids)),
|
|
86
|
+
deleteEdges: (ids) => action((doc) => deleteCanvasEdges(doc, ids)),
|
|
87
|
+
reorderNode: (id, direction) => action((doc) => reorderCanvasNode(doc, id, direction)),
|
|
88
|
+
presence: (field, value) => client.setPresence(field, value),
|
|
89
|
+
undo: () => client.undo(), redo: () => client.redo(),
|
|
90
|
+
stopUndoCapture: () => client.undoManager.stopCapturing(),
|
|
91
|
+
resolveConflict: (choice) => {
|
|
92
|
+
if (!client.provider?.synced) return;
|
|
93
|
+
view.closeTextEditor();
|
|
94
|
+
client.doc.transact(() => resolveCanvasExternalConflict(client.doc, choice), client.localOrigin);
|
|
95
|
+
client.undoManager.clear();
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
view = new CanvasEditorView({
|
|
99
|
+
root, actions, readFile, readTree, vaultId: vaultId || '',
|
|
100
|
+
createMarkdownPreview: (container, markdownText, sourceFilePath = filePath, subpath) => createCanvasMarkdownPreview({
|
|
101
|
+
container, markdownText, sourceFilePath, subpath,
|
|
102
|
+
getFileList: () => fileList,
|
|
103
|
+
getLocalUser: () => client.awareness.getLocalState()?.user ?? user,
|
|
104
|
+
getTheme: () => document.body.dataset.theme,
|
|
105
|
+
onOpenFile, vaultApiClient,
|
|
106
|
+
}),
|
|
107
|
+
getText: (id) => client.doc.getMap(CANVAS_NODES_KEY).get(id)?.get('text'),
|
|
108
|
+
attachmentUrl: (path) => resolveApiUrl(`/attachment?path=${encodeURIComponent(path)}`, config),
|
|
109
|
+
onOpenFile,
|
|
110
|
+
createTextEditor: (id, parent, onClose) => {
|
|
111
|
+
const text = client.doc.getMap(CANVAS_NODES_KEY).get(id)?.get('text');
|
|
112
|
+
if (!text || !client.canEdit) return null;
|
|
113
|
+
return createCanvasTextEditor({ parent, text, onClose, awareness: client.awareness, undoManager: client.undoManager });
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
const imageLightbox = new ImageLightboxController({ previewElement: root });
|
|
117
|
+
['stack-item-added', 'stack-item-popped', 'stack-cleared'].forEach((event) => client.undoManager.on(event, () => client.publish()));
|
|
118
|
+
window.addEventListener('message', async (event) => {
|
|
119
|
+
if (event.origin !== window.location.origin || event.source !== window.parent) return;
|
|
120
|
+
const message = event.data;
|
|
121
|
+
if (!message || typeof message !== 'object') return;
|
|
122
|
+
if (message.type === 'canvas-theme') updateTheme(message.theme);
|
|
123
|
+
if (message.type === 'canvas-user' && message.user) client.setUser(message.user);
|
|
124
|
+
if (message.type === 'canvas-prepare-disconnect' && message.filePath === filePath && typeof message.requestId === 'string') {
|
|
125
|
+
view.closeTextEditor();
|
|
126
|
+
const ready = await client.prepareDisconnect();
|
|
127
|
+
post(ready ? 'canvas-disconnect-ready' : 'canvas-disconnect-blocked', { requestId: message.requestId });
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
window.addEventListener('beforeunload', (event) => {
|
|
131
|
+
if (!client.hasPendingWrites) return;
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
event.returnValue = '';
|
|
134
|
+
});
|
|
135
|
+
window.addEventListener('pagehide', () => { imageLightbox.destroy(); view.destroy(); client.destroy(); });
|
|
136
|
+
post('canvas-ready');
|
|
137
|
+
await client.connect();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
initialize().catch(() => {
|
|
141
|
+
root.textContent = 'Unable to open this canvas. The file has not been changed.';
|
|
142
|
+
root.setAttribute('role', 'alert');
|
|
143
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export function canvasColor(value) {
|
|
2
|
+
if (/^[1-6]$/.test(value)) return `var(--canvas-color-${value})`;
|
|
3
|
+
return /^#[\da-f]{6}$/i.test(value) ? value : 'var(--color-border)';
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function canvasFilePath(value) {
|
|
7
|
+
const path = String(value ?? '').replace(/\\/g, '/');
|
|
8
|
+
if (!path || path.length > 4096 || /^[/]|[\0?#]|^[a-z][a-z\d+.-]*:/i.test(path)
|
|
9
|
+
|| path.split('/').some((part) => !part || part.startsWith('.'))) return null;
|
|
10
|
+
return path;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function canvasLinkUrl(value) {
|
|
14
|
+
try {
|
|
15
|
+
const url = new URL(value);
|
|
16
|
+
return ['https:', 'http:', 'mailto:'].includes(url.protocol) ? url.href : null;
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function connectionPoint(node, side) {
|
|
23
|
+
const center = { x: node.x + node.width / 2, y: node.y + node.height / 2 };
|
|
24
|
+
const directions = { top: [0, -1], right: [1, 0], bottom: [0, 1], left: [-1, 0] };
|
|
25
|
+
const [dx, dy] = directions[side];
|
|
26
|
+
return { x: center.x + dx * node.width / 2, y: center.y + dy * node.height / 2, dx, dy };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function canvasSideAtPoint(node, point) {
|
|
30
|
+
return [
|
|
31
|
+
['left', Math.abs(point.x - node.x)], ['right', Math.abs(point.x - node.x - node.width)],
|
|
32
|
+
['top', Math.abs(point.y - node.y)], ['bottom', Math.abs(point.y - node.y - node.height)],
|
|
33
|
+
].sort((a, b) => a[1] - b[1])[0][0];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function canvasEdgeGeometry(edge, nodes) {
|
|
37
|
+
const from = nodes.get(edge.fromNode);
|
|
38
|
+
const to = nodes.get(edge.toNode);
|
|
39
|
+
if (!from || !to) return null;
|
|
40
|
+
const dx = to.x + to.width / 2 - from.x - from.width / 2;
|
|
41
|
+
const dy = to.y + to.height / 2 - from.y - from.height / 2;
|
|
42
|
+
const horizontal = Math.abs(dx) >= Math.abs(dy);
|
|
43
|
+
const start = connectionPoint(from, edge.fromSide || (horizontal ? (dx >= 0 ? 'right' : 'left') : (dy >= 0 ? 'bottom' : 'top')));
|
|
44
|
+
const end = connectionPoint(to, edge.toSide || (horizontal ? (dx >= 0 ? 'left' : 'right') : (dy >= 0 ? 'top' : 'bottom')));
|
|
45
|
+
const distance = Math.max(40, Math.hypot(end.x - start.x, end.y - start.y) / 3);
|
|
46
|
+
return {
|
|
47
|
+
path: `M ${start.x} ${start.y} C ${start.x + start.dx * distance} ${start.y + start.dy * distance}, ${end.x + end.dx * distance} ${end.y + end.dy * distance}, ${end.x} ${end.y}`,
|
|
48
|
+
x: (start.x + end.x) / 2, y: (start.y + end.y) / 2,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -1,54 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
return mode === 'preview' ? 'preview' : 'edit';
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export function createEmptyScene() {
|
|
6
|
-
return {
|
|
7
|
-
type: 'excalidraw',
|
|
8
|
-
version: 2,
|
|
9
|
-
source: 'collabmd',
|
|
10
|
-
elements: [],
|
|
11
|
-
appState: {
|
|
12
|
-
gridSize: null,
|
|
13
|
-
viewBackgroundColor: '#ffffff',
|
|
14
|
-
},
|
|
15
|
-
files: {},
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function normalizeScene(raw) {
|
|
20
|
-
if (!raw || typeof raw !== 'object') {
|
|
21
|
-
return createEmptyScene();
|
|
22
|
-
}
|
|
1
|
+
import { normalizeScene } from '../../domain/excalidraw-scene.js';
|
|
23
2
|
|
|
24
|
-
|
|
25
|
-
type: 'excalidraw',
|
|
26
|
-
version: 2,
|
|
27
|
-
source: 'collabmd',
|
|
28
|
-
elements: Array.isArray(raw.elements) ? raw.elements : [],
|
|
29
|
-
appState: {
|
|
30
|
-
gridSize: raw.appState?.gridSize ?? null,
|
|
31
|
-
viewBackgroundColor: raw.appState?.viewBackgroundColor ?? '#ffffff',
|
|
32
|
-
},
|
|
33
|
-
files: raw.files && typeof raw.files === 'object' ? raw.files : {},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
3
|
+
export { createEmptyScene, normalizeScene, parseSceneJson, tryParseSceneJson } from '../../domain/excalidraw-scene.js';
|
|
36
4
|
|
|
37
|
-
export function
|
|
38
|
-
|
|
39
|
-
return parsed || createEmptyScene();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function tryParseSceneJson(rawJson) {
|
|
43
|
-
if (!rawJson) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
return normalizeScene(JSON.parse(rawJson));
|
|
49
|
-
} catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
5
|
+
export function normalizeDocumentMode(mode) {
|
|
6
|
+
return mode === 'preview' ? 'preview' : 'edit';
|
|
52
7
|
}
|
|
53
8
|
|
|
54
9
|
export function sceneToInitialData(parsedScene, { theme = 'dark' } = {}) {
|
|
@@ -44,10 +44,6 @@ const HIGHLIGHT_CACHE_LIMIT = 200;
|
|
|
44
44
|
const HIGHLIGHT_CACHE_MAX_SOURCE_CHARS = 20000;
|
|
45
45
|
const highlightCache = new Map();
|
|
46
46
|
|
|
47
|
-
export function getHighlightCacheSize() {
|
|
48
|
-
return highlightCache.size;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
47
|
export function highlightFence(source, language, { ignoreIllegals = false } = {}) {
|
|
52
48
|
const text = String(source);
|
|
53
49
|
const cacheable = text.length <= HIGHLIGHT_CACHE_MAX_SOURCE_CHARS;
|
|
@@ -8,9 +8,7 @@ const INLINE_PLACEHOLDERS = Object.freeze({
|
|
|
8
8
|
const LINK_LABEL_PLACEHOLDER = 'link text';
|
|
9
9
|
const LINK_URL_PLACEHOLDER = 'https://';
|
|
10
10
|
const IMAGE_ALT_PLACEHOLDER = 'alt text';
|
|
11
|
-
const IMAGE_URL_PLACEHOLDER = 'https://';
|
|
12
11
|
const VIDEO_LABEL_PLACEHOLDER = 'Video';
|
|
13
|
-
const VIDEO_URL_PLACEHOLDER = 'https://';
|
|
14
12
|
const CODE_BLOCK_PLACEHOLDER = 'code';
|
|
15
13
|
const TABLE_HEADERS = Object.freeze(['Column 1', 'Column 2']);
|
|
16
14
|
const TABLE_CELL_PLACEHOLDER = 'Value';
|
|
@@ -98,99 +96,19 @@ function looksLikeUrl(value) {
|
|
|
98
96
|
return /^https?:\/\//i.test(value.trim());
|
|
99
97
|
}
|
|
100
98
|
|
|
101
|
-
function formatLink(text, range) {
|
|
99
|
+
function formatLink(text, range, prefix, labelPlaceholder) {
|
|
102
100
|
const selected = text.slice(range.from, range.to);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
insert: `[${LINK_LABEL_PLACEHOLDER}](${selected})`,
|
|
109
|
-
to: range.to,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (selected.length > 0) {
|
|
114
|
-
const prefix = `[${selected}](`;
|
|
115
|
-
return {
|
|
116
|
-
anchor: range.from + prefix.length,
|
|
117
|
-
from: range.from,
|
|
118
|
-
head: range.from + prefix.length + LINK_URL_PLACEHOLDER.length,
|
|
119
|
-
insert: `${prefix}${LINK_URL_PLACEHOLDER})`,
|
|
120
|
-
to: range.to,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return {
|
|
125
|
-
anchor: range.from + 1,
|
|
126
|
-
from: range.from,
|
|
127
|
-
head: range.from + 1 + LINK_LABEL_PLACEHOLDER.length,
|
|
128
|
-
insert: `[${LINK_LABEL_PLACEHOLDER}](${LINK_URL_PLACEHOLDER})`,
|
|
129
|
-
to: range.to,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function formatImage(text, range) {
|
|
134
|
-
const selected = text.slice(range.from, range.to);
|
|
135
|
-
if (selected.length > 0 && looksLikeUrl(selected)) {
|
|
136
|
-
return {
|
|
137
|
-
anchor: range.from + 2,
|
|
138
|
-
from: range.from,
|
|
139
|
-
head: range.from + 2 + IMAGE_ALT_PLACEHOLDER.length,
|
|
140
|
-
insert: ``,
|
|
141
|
-
to: range.to,
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (selected.length > 0) {
|
|
146
|
-
const prefix = ``,
|
|
152
|
-
to: range.to,
|
|
153
|
-
};
|
|
154
|
-
}
|
|
101
|
+
const selectedIsUrl = looksLikeUrl(selected);
|
|
102
|
+
const selectUrl = selected.length > 0 && !selectedIsUrl;
|
|
103
|
+
const label = selectUrl ? selected : labelPlaceholder;
|
|
104
|
+
const url = selectedIsUrl ? selected : LINK_URL_PLACEHOLDER;
|
|
105
|
+
const anchor = range.from + prefix.length + (selectUrl ? label.length + 2 : 0);
|
|
155
106
|
|
|
156
107
|
return {
|
|
157
|
-
anchor
|
|
158
|
-
from: range.from,
|
|
159
|
-
head: range.from + 2 + IMAGE_ALT_PLACEHOLDER.length,
|
|
160
|
-
insert: ``,
|
|
161
|
-
to: range.to,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function formatVideo(text, range) {
|
|
166
|
-
const selected = text.slice(range.from, range.to);
|
|
167
|
-
|
|
168
|
-
if (selected.length > 0 && looksLikeUrl(selected)) {
|
|
169
|
-
return {
|
|
170
|
-
anchor: range.from + 2,
|
|
171
|
-
from: range.from,
|
|
172
|
-
head: range.from + 2 + VIDEO_LABEL_PLACEHOLDER.length,
|
|
173
|
-
insert: ``,
|
|
174
|
-
to: range.to,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
if (selected.length > 0) {
|
|
179
|
-
const prefix = ``,
|
|
185
|
-
to: range.to,
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return {
|
|
190
|
-
anchor: range.from + 2,
|
|
108
|
+
anchor,
|
|
191
109
|
from: range.from,
|
|
192
|
-
head:
|
|
193
|
-
insert:
|
|
110
|
+
head: anchor + (selectUrl ? url.length : label.length),
|
|
111
|
+
insert: `${prefix}${label}](${url})`,
|
|
194
112
|
to: range.to,
|
|
195
113
|
};
|
|
196
114
|
}
|
|
@@ -450,13 +368,13 @@ export function createMarkdownToolbarEdit(documentText, selectionRange, action)
|
|
|
450
368
|
edit = wrapInline(text, range, '`', INLINE_PLACEHOLDERS.code);
|
|
451
369
|
break;
|
|
452
370
|
case 'link':
|
|
453
|
-
edit = formatLink(text, range);
|
|
371
|
+
edit = formatLink(text, range, '[', LINK_LABEL_PLACEHOLDER);
|
|
454
372
|
break;
|
|
455
373
|
case 'image':
|
|
456
|
-
edit =
|
|
374
|
+
edit = formatLink(text, range, '![', IMAGE_ALT_PLACEHOLDER);
|
|
457
375
|
break;
|
|
458
376
|
case 'video':
|
|
459
|
-
edit =
|
|
377
|
+
edit = formatLink(text, range, '![', VIDEO_LABEL_PLACEHOLDER);
|
|
460
378
|
break;
|
|
461
379
|
case 'paragraph':
|
|
462
380
|
edit = formatParagraph(text, range);
|