collabmd 0.1.48 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -608
- package/bin/collabmd.js +39 -20
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-Crf9Y3Q6.js +1 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-PuinKbSQ.js +1 -0
- package/dist/client/assets/ar-SA-5WIASEJP-Di7OimCN.js +10 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-I39sYjHI.js → architectureDiagram-5GKGNRK7-46hPkrZv.js} +3 -3
- package/dist/client/assets/az-AZ-V5EUQD6C-C19OGTT_.js +1 -0
- package/dist/client/assets/bg-BG-EXASCMTR-BIt0xWyb.js +5 -0
- package/dist/client/assets/{blockDiagram-NRAW4CY4-C6DtJy5Y.js → blockDiagram-I7D4REHJ-C1S5Bzf8.js} +4 -4
- package/dist/client/assets/bn-BD-U4SYNFCO-CdNaPy4Q.js +3 -0
- package/dist/client/assets/bn-IN-HKDJIITE-CdNaPy4Q.js +3 -0
- package/dist/client/assets/{browser-BKLM0ThC-IxjwuOIz-BBqQnUEb.js → browser-BKLM0ThC-IxjwuOIz-DyJcVMFR.js} +1 -1
- package/dist/client/assets/browser-utils-DbXSMI-6.js +1 -0
- package/dist/client/assets/{c4Diagram-UCG6FXSJ-CtWtxS9_.js → c4Diagram-7LVT6UL2-VAk1HPmz.js} +1 -1
- package/dist/client/assets/ca-ES-2KGUU5XB-C9t-c0cH.js +8 -0
- package/dist/client/assets/channel-jwdhnPiV.js +1 -0
- package/dist/client/assets/chunk-2E4U76K2-Ba8Wf22k.js +1 -0
- package/dist/client/assets/{chunk-TEH6E4GO-DVayPj-q.js → chunk-4HAMMTFA-Ht-73lsT.js} +20 -20
- package/dist/client/assets/chunk-5XKZK2GL-D4UAZSOJ.js +1 -0
- package/dist/client/assets/{chunk-75Z2AOVW-CdFSaPjz.js → chunk-75Z2AOVW-B2cZexqK.js} +1 -1
- package/dist/client/assets/{chunk-CLGD4ZFX-DQLgbQrv.js → chunk-CLGD4ZFX-Cmtx89ht.js} +1 -1
- package/dist/client/assets/chunk-DU6HZSFF-C6d6PJfE.js +127 -0
- package/dist/client/assets/{chunk-F27PBJKO-CNHIFhjo.js → chunk-F27PBJKO-Dg3H6KLL.js} +1 -1
- package/dist/client/assets/{chunk-GMAD6QVW-CbcBqPM5.js → chunk-GMAD6QVW-DUfjx_d5.js} +1 -1
- package/dist/client/assets/{chunk-OBVCFTLP-BJR7u1jh.js → chunk-GVQU2GXP-D1l7oRGR.js} +1 -1
- package/dist/client/assets/{chunk-G27WJ6UU-D9-eg537.js → chunk-IMKFNOWR-3F6NhHUP.js} +2 -2
- package/dist/client/assets/{chunk-JQ64N6SF-DSFNH4bh.js → chunk-L3NEJ4N5-BmCVn4y-.js} +1 -1
- package/dist/client/assets/chunk-OSK3NFVY-CWHXAmfx.js +10 -0
- package/dist/client/assets/{chunk-P2QGCYS3-BRpqY32H.js → chunk-P2QGCYS3-Du8EtwOa.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-Cb4SlVZF.js → chunk-POPQ4Y6H-B5yJIrZE.js} +1 -1
- package/dist/client/assets/{chunk-PWAF6VOD-Cz8IwBB5.js → chunk-PWAF6VOD-B3gML4ps.js} +1 -1
- package/dist/client/assets/{chunk-RHFEMEQ7-CWY8cf4H.js → chunk-SHT3W25Y-BKaI8jZO.js} +5 -5
- package/dist/client/assets/{chunk-SVP7TREG-CyHOmcac.js → chunk-SVP7TREG-XlsB_ZMZ.js} +1 -1
- package/dist/client/assets/{chunk-LCL6LL3I-DmDkVukh.js → chunk-TICWLB2K-Cpp2z8yK.js} +4 -4
- package/dist/client/assets/chunk-TLUHSLCS-Yl7B0Vrz.js +1 -0
- package/dist/client/assets/chunk-ZNVOA63L-BmCQjhx-.js +40 -0
- package/dist/client/assets/{chunk-FLYJHZSQ-Be7lKF17.js → chunk-ZPMXAHWN-Dt0TxJa6.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-BRw9vo8U.js +1 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BRw9vo8U.js +1 -0
- package/dist/client/assets/comment-markdown-renderer-B9_vPc3F.js +1 -0
- package/dist/client/assets/comment-thread-store-NNHqRVsX.js +1 -0
- package/dist/client/assets/comment-threads-nJhK1yfc.js +4 -0
- package/dist/client/assets/cs-CZ-VUCGPRML-BfCoYAgj.js +7 -0
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CdTPi2yO.js → cynefinDiagram-5FMLGOSQ-BRoCEoZM.js} +1 -1
- package/dist/client/assets/da-DK-NNDP2IVP-DBw9ZNTR.js +2 -0
- package/dist/client/assets/{dagre-3AP2YEHR-5gtJtd0O.js → dagre-GXQ25YYZ-BSfKCfy7.js} +2 -2
- package/dist/client/assets/de-CH-I7RAVIZN-DYW18Vsr.js +11 -0
- package/dist/client/assets/de-DE-WBQ3DQLR-DYW18Vsr.js +11 -0
- package/dist/client/assets/deferred-collab-rBe4nuQ2.css +1 -0
- package/dist/client/assets/deferred-git-BHKtkFYi.css +1 -0
- package/dist/client/assets/deferred-preview-pe7Iwwx3.css +1 -0
- package/dist/client/assets/{diagram-S7CK7UJ4-BudWz9WU.js → diagram-S7CK7UJ4-D7KaM9yj.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-3v4rbH-s.js → diagram-UQ7AKVKN-JevUZuYi.js} +1 -1
- package/dist/client/assets/diagram-VSXAHHWV-B3-U-Q2E.js +3 -0
- package/dist/client/assets/{diagram-VX7I27RA-C_-rj0sw.js → diagram-VX7I27RA-pSD4HMh1.js} +1 -1
- package/dist/client/assets/{diagram-Z3DM3KII-B4yxavgj.js → diagram-Z3DM3KII-D8r1_CIb.js} +1 -1
- package/dist/client/assets/{direct-engine-DdrQKpgq-CtKfQzCt.js → direct-engine-DdrQKpgq-B5zIoeQw.js} +1 -1
- package/dist/client/assets/dist-B3HdUPsK.js +1 -0
- package/dist/client/assets/{dist-Tw-Fxpeb.js → dist-B7XMN9AT.js} +1 -1
- package/dist/client/assets/dist-BIRygGYH.js +1 -0
- package/dist/client/assets/dist-BPyOlNLY.js +2 -0
- package/dist/client/assets/{dist-D5wCC32z.js → dist-BR81yxMt.js} +1 -1
- package/dist/client/assets/{dist-Bw3VIE_v.js → dist-B_B4XLmq.js} +1 -1
- package/dist/client/assets/dist-Bdy9ZRzd.js +9 -0
- package/dist/client/assets/{dist-netZOQtD.js → dist-Bfxzlnrf.js} +1 -1
- package/dist/client/assets/{dist-CietwTVS.js → dist-Bx3QkS-3.js} +1 -1
- package/dist/client/assets/{dist-mj2Ht75J.js → dist-By7ieqAf.js} +1 -1
- package/dist/client/assets/dist-ByhQbe-x.js +1 -0
- package/dist/client/assets/{dist-CdmKGRGr.js → dist-BzFSJM0U.js} +1 -1
- package/dist/client/assets/dist-C5NkYKAa.js +1 -0
- package/dist/client/assets/{dist-D3fehAZ2.js → dist-CELhfKzh.js} +1 -1
- package/dist/client/assets/dist-CEirJSxk.js +1 -0
- package/dist/client/assets/dist-CO0-4CuV.js +39 -0
- package/dist/client/assets/dist-CRnJ0D9h.js +1 -0
- package/dist/client/assets/{dist-DDUn5zTz.js → dist-CbDyXgCo.js} +1 -1
- package/dist/client/assets/{dist-BeajGMhO.js → dist-CqXVyYoH.js} +1 -1
- package/dist/client/assets/{dist-LQ4kDCKz.js → dist-CrWzIWEE.js} +1 -1
- package/dist/client/assets/dist-CyNrloSI.js +1 -0
- package/dist/client/assets/dist-D60_kdpQ.js +1 -0
- package/dist/client/assets/{dist-DuH3ZrHo.js → dist-DCpIH3-_.js} +1 -1
- package/dist/client/assets/{dist-BPHLJ09L.js → dist-DJAMplZI.js} +2 -2
- package/dist/client/assets/{dist-DGEbEfw4.js → dist-DVXzbeDx.js} +1 -1
- package/dist/client/assets/{dist-C5NgpdG5.js → dist-Drv_wZYC.js} +1 -1
- package/dist/client/assets/{dist-DVy5woUy.js → dist-EWJYvBK1.js} +1 -1
- package/dist/client/assets/dist-Hdhj3L3t.js +1 -0
- package/dist/client/assets/{dist-B_yQaEv_.js → dist-gRRhmB-2.js} +3 -3
- package/dist/client/assets/dist-kWb2d1CH.js +1 -0
- package/dist/client/assets/dist-kiD2GIsD.js +13 -0
- package/dist/client/assets/dist-l-56SowH.js +19 -0
- package/dist/client/assets/{dist-BK9QvQrc.js → dist-nxQErAaK.js} +2 -2
- package/dist/client/assets/dist-sLzRQQk7.js +1 -0
- package/dist/client/assets/{document-formatter-Dxl_a8XO.js → document-formatter-Qdiq9uJs.js} +1 -2
- package/dist/client/assets/drawioEditor-CHf1vtdQ.js +9 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-UJ0Fz5ci.js +1 -0
- package/dist/client/assets/editor-session-4Bn81iWm.js +14 -0
- package/dist/client/assets/el-GR-TYQHVGXW-Dx82YYAS.js +7 -0
- package/dist/client/assets/embedded-editor-base-jK221GC8.css +1 -0
- package/dist/client/assets/{embedpdf-DA4bA119-BPqZxwjc.js → embedpdf-DA4bA119-E8wZ11J2.js} +2 -3
- package/dist/client/assets/{embedpdf-BmE13ZZ0.js → embedpdf-LUXDBD3-.js} +1 -1
- package/dist/client/assets/{en-SJ2YIMFF-CJBL3nkq.js → en-2RFA324Y-BsuNJTcL.js} +1 -1
- package/dist/client/assets/{erDiagram-SSCWMZ5O-C-iy6VkX.js → erDiagram-RLTQ6QDP-CWrH1UJ9.js} +2 -2
- package/dist/client/assets/es-ES-JEUOREKJ-Rx0NUQDl.js +12 -0
- package/dist/client/assets/eu-ES-SO5DEEAN-CDYm-BcK.js +8 -0
- package/dist/client/assets/excalidraw-element-link-iA6zo0_f.js +7 -0
- package/dist/client/assets/{excalidraw-scene-BOben2gr.js → excalidraw-scene-6uROebca.js} +1 -1
- package/dist/client/assets/{excalidraw-editor-BbSbI80a.css → excalidrawEditor-DDE0n1Pk.css} +1 -1
- package/dist/client/assets/excalidrawEditor-WIuguTz7.js +9 -0
- package/dist/client/assets/export-page-AN-wI5p4.js +56 -0
- package/dist/client/assets/exportDocument-B7IagJhQ.css +1 -0
- package/dist/client/assets/exportDocument-B9xNKpQe.js +2 -0
- package/dist/client/assets/fa-IR-FIYUE2GQ-C865Nx3X.js +9 -0
- package/dist/client/assets/fi-FI-REAEF6HQ-BIpjJqIb.js +6 -0
- package/dist/client/assets/flowDiagram-HODETNUW-kb1lUSBo.js +1 -0
- package/dist/client/assets/fr-FR-SUCL7J6B-DGAKE8jH.js +12 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DtKHAbez.js → ganttDiagram-EL5Y4UJY-BBNzDfaV.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-oue8fQ5o.js → gitGraphDiagram-WWUBYQGX-Csf0Dm_1.js} +1 -1
- package/dist/client/assets/gl-ES-KHCSOGVH-DWKh0CMu.js +6 -0
- package/dist/client/assets/he-IL-JYXVXV2Q-zqbcM-4g.js +9 -0
- package/dist/client/assets/hi-IN-BU52H3BO-CY8v6eG9.js +3 -0
- package/dist/client/assets/highlight-theme-CzNkO-IJ.js +1 -0
- package/dist/client/assets/hu-HU-OWADXDQ3-CEl6Udfh.js +3 -0
- package/dist/client/assets/id-ID-EOMR5R3I-CGQwUjoL.js +8 -0
- package/dist/client/assets/image-2QKV3NAF-BUbX0y5Y.js +1 -0
- package/dist/client/assets/index-BAmZnTFV.css +1 -0
- package/dist/client/assets/index-mWiw418b.js +1111 -0
- package/dist/client/assets/{infoDiagram-RXCK75RN-BMzo6KIn.js → infoDiagram-27XIBGKW-Bzy6kCbb.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BIM3h287.js → ishikawaDiagram-5VMMS53U-CRy9vIS5.js} +1 -1
- package/dist/client/assets/it-IT-FC2VTM3L-KTijNcUe.js +12 -0
- package/dist/client/assets/ja-JP-JBNTKYP4-BflWlGhw.js +12 -0
- package/dist/client/assets/{journeyDiagram-EYS64GPL-mF6Lh8O-.js → journeyDiagram-3NMN7TZE-D4ZR_s9J.js} +2 -2
- package/dist/client/assets/kaa-TC3VIB7V-B-xtZfy0.js +1 -0
- package/dist/client/assets/kab-KAB-UOUDSQKM-BmO0O4Y4.js +4 -0
- package/dist/client/assets/{kanban-definition-3QL26DDD-DLN2NyoR.js → kanban-definition-UXKFOSKX-CIDTmu5g.js} +4 -4
- package/dist/client/assets/kk-KZ-P5H2X7YS-CSQFB8IN.js +1 -0
- package/dist/client/assets/{km-KH-PCWDKPHP-DSmy5shj.js → km-KH-IHMV2US7-BxrjuEzr.js} +4 -4
- package/dist/client/assets/ko-KR-ZTMANIDF-BnNRXd5J.js +5 -0
- package/dist/client/assets/ku-TR-GPJTRB5G-BZM7f2aT.js +6 -0
- package/dist/client/assets/{line-BfTWJmgf.js → line-DSWLHgpx.js} +1 -1
- package/dist/client/assets/lobby-presence-Rdjnc0_0.js +1 -0
- package/dist/client/assets/lt-LT-V3XDOK3P-MVQBOHmF.js +3 -0
- package/dist/client/assets/lv-LV-DVQ3FADO-CrenwAhS.js +4 -0
- package/dist/client/assets/markdown-it-CocJWnjv.js +13 -0
- package/dist/client/assets/mermaid-parser.core-DrdLA3p0.js +3 -0
- package/dist/client/assets/mermaid.core-C_FK-7n4.js +1 -0
- package/dist/client/assets/mermaid.core-D0cMM4Rl.js +10 -0
- package/dist/client/assets/{mindmap-definition-FBJOCRG2-CRyHaHTk.js → mindmap-definition-YA3MSWOX-DO8NB9VH.js} +8 -8
- package/dist/client/assets/mr-IN-VZ6HH5FE-B-PHPglH.js +9 -0
- package/dist/client/assets/my-MM-XYKWHRK6-Be5sYp5q.js +1 -0
- package/dist/client/assets/nb-NO-UNO2GGZJ-BvSKGdja.js +8 -0
- package/dist/client/assets/nl-NL-76EFHT4P-C2yNx1Cj.js +13 -0
- package/dist/client/assets/nn-NO-CFKD7ABE-4NsqlDRP.js +4 -0
- package/dist/client/assets/oc-FR-YBJTCJ3J-B4OTQsWW.js +4 -0
- package/dist/client/assets/pa-IN-SNOXSMRV-CKj_sOG7.js +4 -0
- package/dist/client/assets/pegDiagram-XKGWAZYB-DS6Ab21R.js +1 -0
- package/dist/client/assets/percentages-Q7USCRWZ-DWE6uvTs.js +1 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-B5OZPb88.js → pieDiagram-E7YTZNPT-BbFe6Tgs.js} +1 -1
- package/dist/client/assets/pl-PL-BSY6YFZ3-CFuzA6L0.js +12 -0
- package/dist/client/assets/preload-helper-CtT0-S4g.js +1 -0
- package/dist/client/assets/preview-render-compiler-C_7J7eia.js +43 -0
- package/dist/client/assets/preview-render-compiler-DzJ1KR_M.js +1 -0
- package/dist/client/assets/preview-render-worker-1DoIDllV.js +59 -0
- package/dist/client/assets/prod-D5TxmmoB.js +1 -0
- package/dist/client/assets/prod-pbFU4TaM.js +145 -0
- package/dist/client/assets/pt-BR-CZDV62R3-CkPMtyNx.js +10 -0
- package/dist/client/assets/pt-PT-JO57XJJW-CBSnfGtF.js +12 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Drrw14YH.js → quadrantDiagram-AXDQQJYC-fJE7iAxt.js} +1 -1
- package/dist/client/assets/quick-switcher-De4PjZFC.css +1 -0
- package/dist/client/assets/quick-switcher-controller-CUajuy78.js +1 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-CUQKqbCK.js +1 -0
- package/dist/client/assets/{requirementDiagram-EFPCY7ZU-CRZG6mRB.js → requirementDiagram-BXWQKSXE-Balm0WW8.js} +2 -2
- package/dist/client/assets/ro-RO-UZ5ICYYN-BOuntc_r.js +12 -0
- package/dist/client/assets/room-DX7lIfnu.js +1 -0
- package/dist/client/assets/ru-RU-AN7JPREC-D-ow3SNR.js +10 -0
- package/dist/client/assets/runtime-config-BFVdhnJu.js +1 -0
- package/dist/client/assets/runtime-paths-Cn0snt_9.js +1 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DvarEJpo.js → sankeyDiagram-P5KCCOFB-CcbMqrlQ.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-B4oWlb-w.js → sequenceDiagram-WJ2MYXX4-BL1j3Sn-.js} +6 -6
- package/dist/client/assets/si-LK-7CBLD6QQ-c91EepX0.js +1 -0
- package/dist/client/assets/sk-SK-SWR6DKBI-D5vFMIL6.js +7 -0
- package/dist/client/assets/sl-SI-JRML4FIH-D53L_0S2.js +6 -0
- package/dist/client/assets/{stateDiagram-HBIQ2CUA-qbHIIqRZ.js → stateDiagram-D77RDMKH-DNi924hh.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-C62JEwak.js +1 -0
- package/dist/client/assets/sv-SE-4ZPKFFXF-DT-G7RCI.js +12 -0
- package/dist/client/assets/{swimlanes-XN3QIQJK-xB6CtUGj.js → swimlanes-42K2YHIH-ColgjSH4.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B9UZhEj4.js +8 -0
- package/dist/client/assets/ta-IN-V6NHHU6Z-D5jy7_AE.js +6 -0
- package/dist/client/assets/th-TH-P7CTMGDK-6sy0NO7K.js +1 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-Lj_yTNlY.js → timeline-definition-24CTP7MA-7pch5JAr.js} +1 -1
- package/dist/client/assets/tr-TR-GUFYG22B-ClVaf8h1.js +4 -0
- package/dist/client/assets/uk-UA-K6SV5NFQ-BLTTtyNB.js +6 -0
- package/dist/client/assets/uz-UZ-TVKTZO2G-Bm02Eg3D.js +1 -0
- package/dist/client/assets/vault-api-client-QjZ_T03l.js +7 -0
- package/dist/client/assets/vault-utils-Bct69Xw2.js +1 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-BekRp5Y0.js → vennDiagram-4TSXK5OY-C5taziCX.js} +1 -1
- package/dist/client/assets/vi-VN-7FKFXJNO-CL3WPhmG.js +7 -0
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-kdnV_Hdm.js → wardleyDiagram-VM6X3IG4-BbSlUwuM.js} +1 -1
- package/dist/client/assets/wiki-link-resolver-C2P_WmTV.js +1 -0
- package/dist/client/assets/{worker-engine-m0rlHn8R-S8mpn_O0.js → worker-engine-m0rlHn8R-eSDcDGEI.js} +1 -1
- package/dist/client/assets/workspace-change-CVA9dVmy.js +1 -0
- package/dist/client/assets/workspace-sync-client-D4nblH_2.js +1 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DufGwNSB.js → xychartDiagram-S5SC5T6Z-D06X1arY.js} +1 -1
- package/dist/client/assets/yjs-B41tM6Sz.js +4 -0
- package/dist/client/assets/yjs-provider-reset-guard-R43MnLNc.js +1 -0
- package/dist/client/assets/zh-CN-AOKVLNNK-DGidDH2b.js +11 -0
- package/dist/client/assets/zh-HK-CDKPF5DC-CRcNR3rk.js +1 -0
- package/dist/client/assets/zh-TW-ZVGYESGW-C7Qji1y6.js +13 -0
- package/dist/client/drawio-editor.html +12 -5
- package/dist/client/excalidraw-editor.html +46 -5
- package/dist/client/export-document.html +6 -8
- package/dist/client/index.html +79 -43
- package/package.json +39 -36
- package/src/client/app/drawio-editor.html +3 -3
- package/src/client/app/excalidraw-editor.html +3 -3
- package/src/client/app/export-document.html +2 -2
- package/src/client/app/index.html +77 -37
- package/src/client/app/main-entry.js +13 -17
- package/src/client/application/app-shell/chat-feature.js +7 -22
- package/src/client/application/app-shell/comments-feature.js +6 -0
- package/src/client/application/app-shell/git-feature.js +23 -5
- package/src/client/application/app-shell/presence-feature.js +8 -25
- package/src/client/application/app-shell/ui-feature-shell.js +172 -149
- package/src/client/application/app-shell/ui-feature-sidebar.js +43 -7
- package/src/client/application/app-shell/ui-feature-tab-activity.js +27 -9
- package/src/client/application/app-shell/ui-feature-toolbar.js +16 -129
- package/src/client/application/app-shell-elements.js +9 -0
- package/src/client/application/highlight-theme.js +16 -0
- package/src/client/application/preview-render-compiler.js +44 -107
- package/src/client/application/preview-render-executor.js +0 -26
- package/src/client/application/preview-render-scheduler.js +8 -24
- package/src/client/application/preview-renderer.js +26 -9
- package/src/client/application/webmcp-diagram-renderer.js +47 -0
- package/src/client/application/workspace-coordinator.js +23 -22
- package/src/client/application/workspace-route-controller.js +7 -0
- package/src/client/bootstrap/collabmd-app-shell.js +148 -35
- package/src/client/bootstrap/lazy-collab-clients.js +90 -0
- package/src/client/domain/excalidraw-element-link.js +73 -0
- package/src/client/domain/excalidraw-scene-reconcile.js +5 -2
- package/src/client/domain/excalidraw-scene.js +21 -0
- package/src/client/domain/hash-routes.js +13 -0
- package/src/client/domain/highlight-runtime.js +47 -0
- package/src/client/domain/lobby-chat.js +2 -0
- package/src/client/domain/room.js +1 -5
- package/src/client/domain/runtime-paths.js +61 -7
- package/src/client/domain/vault-utils.js +11 -0
- package/src/client/excalidraw-editor.js +155 -14
- package/src/client/export/export-host.js +3 -1
- package/src/client/export/export-pipeline.js +4 -17
- package/src/client/infrastructure/agent-connection-api-client.js +23 -0
- package/src/client/infrastructure/auth-client.js +4 -15
- package/src/client/infrastructure/browser-preferences-port.js +16 -0
- package/src/client/infrastructure/editor-session.js +11 -0
- package/src/client/infrastructure/editor-view-adapter.js +56 -8
- package/src/client/infrastructure/excalidraw-room-client.js +89 -2
- package/src/client/infrastructure/git-api-client.js +39 -33
- package/src/client/infrastructure/hosted-api-client.js +60 -0
- package/src/client/infrastructure/lobby-presence.js +4 -7
- package/src/client/infrastructure/runtime-config.js +14 -2
- package/src/client/infrastructure/tab-activity-lock.js +2 -5
- package/src/client/infrastructure/vault-api-client.js +33 -26
- package/src/client/infrastructure/webmcp-tool-registry.js +297 -0
- package/src/client/infrastructure/workspace-sync-client.js +6 -4
- package/src/client/presentation/agent-connection-controller.js +255 -0
- package/src/client/presentation/backlinks-panel.js +3 -0
- package/src/client/presentation/bases-preview-controller.js +27 -18
- package/src/client/presentation/comment-markdown-renderer.js +2 -14
- package/src/client/presentation/comment-overview-controller.js +1 -2
- package/src/client/presentation/comment-ui/comment-ui-card.js +4 -2
- package/src/client/presentation/comment-ui/comment-ui-shared.js +5 -2
- package/src/client/presentation/create-menu-presenter.js +19 -16
- package/src/client/presentation/excalidraw-embed-controller.js +164 -4
- package/src/client/presentation/file-explorer-controller.js +3 -0
- package/src/client/presentation/file-explorer-view.js +338 -182
- package/src/client/presentation/file-history-view-controller.js +13 -11
- package/src/client/presentation/git-diff-view-controller.js +35 -43
- package/src/client/presentation/git-panel-controller.js +78 -28
- package/src/client/presentation/hosted-workspace-gate-controller.js +180 -0
- package/src/client/presentation/image-lightbox-controller.js +20 -16
- package/src/client/presentation/layout-controller.js +13 -2
- package/src/client/presentation/quick-switcher-controller.js +20 -78
- package/src/client/presentation/quick-switcher-text-search.js +10 -14
- package/src/client/presentation/team-settings-controller.js +228 -0
- package/src/client/styles/components/navigation.css +1 -2
- package/src/client/styles/deferred-collab.css +5 -0
- package/src/client/styles/deferred-git.css +7 -0
- package/src/client/styles/deferred-preview.css +6 -0
- package/src/client/styles/features/agent-connection.css +202 -0
- package/src/client/styles/features/collaboration-chat.css +8 -1
- package/src/client/styles/features/collaboration-dialogs.css +16 -1
- package/src/client/styles/features/collaboration-presence.css +17 -4
- package/src/client/styles/features/diagram-preview.css +0 -15
- package/src/client/styles/features/diff-toolbar.css +1 -1
- package/src/client/styles/features/media-lightbox.css +12 -3
- package/src/client/styles/features/outline.css +4 -2
- package/src/client/styles/features/preview-markdown.css +25 -11
- package/src/client/styles/features/quick-switcher.css +20 -11
- package/src/client/styles/features/team-settings.css +162 -0
- package/src/client/styles/foundation/themes.css +2 -0
- package/src/client/styles/foundation/tokens.css +2 -2
- package/src/client/styles/layout/editor-page.css +25 -24
- package/src/client/styles/layout/overlays.css +16 -0
- package/src/client/styles/layout/responsive.css +7 -25
- package/src/client/styles/layout/shell.css +21 -1
- package/src/client/styles/layout/sidebar.css +99 -7
- package/src/client/styles/primitives/controls.css +21 -54
- package/src/client/styles/style.css +4 -19
- package/src/domain/agent-tool-definitions.js +872 -0
- package/src/domain/collabmd-content-capabilities.js +149 -0
- package/src/domain/collaboration-protocol.js +2 -0
- package/src/domain/comment-threads.js +3 -5
- package/src/domain/diagram-source.js +50 -0
- package/src/domain/editable-content-revision.js +10 -0
- package/src/domain/editable-text.js +3 -0
- package/src/domain/exact-text-edits.js +69 -0
- package/src/domain/excalidraw-agent-scene.js +624 -0
- package/src/domain/excalidraw-agent-verification.js +554 -0
- package/src/domain/excalidraw-room-codec.js +13 -6
- package/src/domain/literal-text-search.js +13 -0
- package/src/domain/video-embed.js +76 -0
- package/src/server/application/agent-connection-service.js +178 -0
- package/src/server/application/agent-content-service.js +841 -0
- package/src/server/application/workspace-reconciliation.js +5 -7
- package/src/server/config/env.js +147 -6
- package/src/server/create-app-server.js +47 -141
- package/src/server/domain/bases/base-query-service.js +1 -5
- package/src/server/domain/collaboration/collaboration-room.js +121 -25
- package/src/server/domain/collaboration/protocol.js +4 -0
- package/src/server/domain/hosted-workspace.js +31 -1
- package/src/server/domain/markdown-reference-extractor.js +15 -1
- package/src/server/domain/ripgrep-search-service.js +68 -21
- package/src/server/infrastructure/git/git-service.js +19 -1
- package/src/server/infrastructure/git/history-service.js +1 -1
- package/src/server/infrastructure/git/local-exclude.js +37 -0
- package/src/server/infrastructure/git/parsers.js +19 -17
- package/src/server/infrastructure/git/path-utils.js +0 -16
- package/src/server/infrastructure/git/status-service.js +1 -1
- package/src/server/infrastructure/git/untracked-files.js +12 -21
- package/src/server/infrastructure/http/create-agent-api-handler.js +171 -0
- package/src/server/infrastructure/http/create-git-api-command-handler.js +32 -0
- package/src/server/infrastructure/http/create-hosted-api-handler.js +5 -0
- package/src/server/infrastructure/http/create-request-handler.js +123 -26
- package/src/server/infrastructure/http/create-static-handler.js +9 -0
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +15 -2
- package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +200 -0
- package/src/server/infrastructure/persistence/agent-connection-store.js +120 -0
- package/src/server/infrastructure/persistence/pull-backup-store.js +2 -27
- package/src/server/infrastructure/persistence/sidecar-store.js +12 -5
- package/src/server/infrastructure/persistence/vault-file-store.js +11 -5
- package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +48 -22
- package/src/server/shared/agent-tool-image.js +22 -0
- package/src/server/shared/agent-tool-rate-limiter.js +27 -0
- package/src/server/startup/git-remote-bootstrap.js +58 -79
- package/src/server/vault-registry.js +251 -0
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BPH4FJkv.js +0 -1
- package/dist/client/assets/abnfDiagram-VCTEODGH-BNDLzJ7L.js +0 -1
- package/dist/client/assets/ar-SA-PQUY64WN-xjXgbW6d.js +0 -10
- package/dist/client/assets/az-AZ-OXJXL76K-4JkO4Pca.js +0 -1
- package/dist/client/assets/base-CaIEJUF9.css +0 -1
- package/dist/client/assets/bg-BG-W2GKIJDF-DnkH_o81.js +0 -5
- package/dist/client/assets/bn-BD-TGL7M4PJ-CG4JkmtP.js +0 -3
- package/dist/client/assets/bn-IN-BKETKYEH-CG4JkmtP.js +0 -3
- package/dist/client/assets/browser-utils--H_DkyEF.js +0 -1
- package/dist/client/assets/ca-ES-LD5SCRVV-U6_TVMX9.js +0 -8
- package/dist/client/assets/channel-CaoKA_We.js +0 -1
- package/dist/client/assets/chunk-7XWMRXBY-CfMzEq80.js +0 -1
- package/dist/client/assets/chunk-CKBBP62Z-DG26UiBv.js +0 -2
- package/dist/client/assets/chunk-DSNCTWBM-8xkug7fQ.js +0 -2
- package/dist/client/assets/chunk-DU6HZSFF-COXDzJK1.js +0 -127
- package/dist/client/assets/chunk-R7TYR2AO-CTd0Yj98.js +0 -10
- package/dist/client/assets/chunk-RM4UPSZO-CWRwxNWJ.js +0 -41
- package/dist/client/assets/classDiagram-DTDB5LWJ-7fEmn0zV.js +0 -1
- package/dist/client/assets/classDiagram-v2-JRS7N3AN-7fEmn0zV.js +0 -1
- package/dist/client/assets/comment-thread-store-CdcwrObc.js +0 -1
- package/dist/client/assets/comment-threads-9J6Em-_y.js +0 -4
- package/dist/client/assets/comment-ui-shared-DuoyznXW.js +0 -7
- package/dist/client/assets/cs-CZ-OFPU5DBV-BmFAIhqX.js +0 -7
- package/dist/client/assets/da-DK-FRDJFYWF-H387Jw8B.js +0 -2
- package/dist/client/assets/de-CH-ZG7H3QK3-C_groygo.js +0 -11
- package/dist/client/assets/de-DE-SIJYH4IH-C_groygo.js +0 -11
- package/dist/client/assets/diagram-VSXAHHWV-CQRVEZR7.js +0 -3
- package/dist/client/assets/dist-73RPdcyU.js +0 -1
- package/dist/client/assets/dist-BJ1bJs33.js +0 -1
- package/dist/client/assets/dist-ByrG2qBA.js +0 -1
- package/dist/client/assets/dist-CH-sQu3r.js +0 -1
- package/dist/client/assets/dist-CKS_-are.js +0 -1
- package/dist/client/assets/dist-D37Hyu3h.js +0 -9
- package/dist/client/assets/dist-DZAAWTG-.js +0 -1
- package/dist/client/assets/dist-Dir5dDKZ.js +0 -1
- package/dist/client/assets/dist-Dl_tpDSr.js +0 -1
- package/dist/client/assets/dist-DutPuFmC.js +0 -1
- package/dist/client/assets/dist-RKBTaQMb.js +0 -13
- package/dist/client/assets/dist-eBx8q6Sy.js +0 -1
- package/dist/client/assets/drawio-editor-BVaNNtYp.js +0 -9
- package/dist/client/assets/drawioEditor-BkIBlXx0.js +0 -2
- package/dist/client/assets/ebnfDiagram-PWID7BFC-OXa8VEp1.js +0 -1
- package/dist/client/assets/editor-session-DMyVdHLj.js +0 -54
- package/dist/client/assets/el-GR-IEE2CGI2-BkT6YT54.js +0 -7
- package/dist/client/assets/embedded-editor-base-B3l6Xy65.css +0 -1
- package/dist/client/assets/es-ES-TVVPWKV5-CpPKJXTM.js +0 -12
- package/dist/client/assets/eu-ES-CGBMFQDT-Bu3N2493.js +0 -8
- package/dist/client/assets/excalidraw-editor-BjYaNEMY.js +0 -9
- package/dist/client/assets/excalidraw-mermaid-stub-BNckbX2n.js +0 -1
- package/dist/client/assets/excalidraw-mermaid-stub-DE5FTiZB.js +0 -1
- package/dist/client/assets/excalidrawEditor-ChqF_d82.js +0 -2
- package/dist/client/assets/export-page-Dyu0XCbu.js +0 -57
- package/dist/client/assets/exportDocument-CJBx4Xjx.css +0 -1
- package/dist/client/assets/exportDocument-Dgvfa2Sd.js +0 -2
- package/dist/client/assets/fa-IR-IE6XAPR4-BEvLCORD.js +0 -9
- package/dist/client/assets/fi-FI-P7TKNHRM-DI0q8iSX.js +0 -6
- package/dist/client/assets/file-icon-svg-Y_kpF957.js +0 -1
- package/dist/client/assets/flowDiagram-A5DVABFB-CiW1eN8C.js +0 -1
- package/dist/client/assets/fr-FR-QI2XZNT7-y8kXd8LA.js +0 -12
- package/dist/client/assets/gl-ES-TLYCNOZZ-Br-Fhff-.js +0 -6
- package/dist/client/assets/he-IL-ZX43XLGP-qKQq6V9X.js +0 -9
- package/dist/client/assets/hi-IN-UTYRMTUF-DOUcwrDO.js +0 -3
- package/dist/client/assets/hu-HU-AJOSEBW6-FqTyvHlD.js +0 -3
- package/dist/client/assets/id-ID-ETLTVG6C-CQqh3CLS.js +0 -8
- package/dist/client/assets/image-ZVKINSPA-0zXSnE7M.js +0 -1
- package/dist/client/assets/index-CSNIMyOP.css +0 -1
- package/dist/client/assets/index-DG3N2Ps-.js +0 -2
- package/dist/client/assets/it-IT-B4B6TP6L-V-yK3SZz.js +0 -12
- package/dist/client/assets/ja-JP-IYKVURR5-BQKBXRpX.js +0 -12
- package/dist/client/assets/kaa-SE2BUIKX-CZ5kfwPg.js +0 -1
- package/dist/client/assets/kab-KAB-Y3GLKXLR-Do7GWfuN.js +0 -4
- package/dist/client/assets/kk-KZ-ABWUFVOH-BpqVciQz.js +0 -1
- package/dist/client/assets/ko-KR-7JQDXKGM-N42lep78.js +0 -5
- package/dist/client/assets/ku-TR-NAH2Q5B7-K8LLl9fk.js +0 -6
- package/dist/client/assets/lt-LT-VQFYRSNQ-BmOd0ALn.js +0 -3
- package/dist/client/assets/lv-LV-T62VSYUM-B22WdPhp.js +0 -4
- package/dist/client/assets/main-D0wCxpVn.js +0 -903
- package/dist/client/assets/mermaid-parser.core-Bl0efOMt.js +0 -4
- package/dist/client/assets/mermaid.core-BJRLUQZE.js +0 -11
- package/dist/client/assets/modulepreload-polyfill-P2Xu9kJm.js +0 -1
- package/dist/client/assets/mr-IN-V4FHLCJE-XX069tpm.js +0 -9
- package/dist/client/assets/my-MM-E3SQ6E54-cst_-5SB.js +0 -1
- package/dist/client/assets/nb-NO-MLNOFN5H-Bu2URWko.js +0 -8
- package/dist/client/assets/nl-NL-D5L3ZV4M-BqrV0btt.js +0 -13
- package/dist/client/assets/nn-NO-NNHDGPKB-DK-xZaWM.js +0 -4
- package/dist/client/assets/oc-FR-DWCRF55G-BZ5Po5R6.js +0 -4
- package/dist/client/assets/pa-IN-3JSAY44M-BZQSjKrS.js +0 -4
- package/dist/client/assets/pegDiagram-XKGWAZYB-B31fKPR2.js +0 -1
- package/dist/client/assets/percentages-ETZPVQEE-DFxFqXgH.js +0 -1
- package/dist/client/assets/pl-PL-ACURYKP3-qcEOSfCk.js +0 -12
- package/dist/client/assets/preload-helper-HclGiUj8.js +0 -1
- package/dist/client/assets/preview-render-compiler-CrJIooVD.js +0 -35
- package/dist/client/assets/preview-render-compiler-O0JxBVNF.js +0 -1
- package/dist/client/assets/preview-render-profile-B4RWYWHt.js +0 -1
- package/dist/client/assets/preview-render-worker-_QTxqKvP.js +0 -60
- package/dist/client/assets/prod-BiYPMR1i.js +0 -177
- package/dist/client/assets/prod-VxdGZ5Ly.js +0 -1
- package/dist/client/assets/pt-BR-LOX7MLGD-DLueHSyZ.js +0 -10
- package/dist/client/assets/pt-PT-CZ2U2RFQ-BJ-GAEm6.js +0 -12
- package/dist/client/assets/quick-switcher-controller-CaEjEtq_.js +0 -1
- package/dist/client/assets/railroadDiagram-O6MQD6OU-BPifP0MB.js +0 -1
- package/dist/client/assets/ro-RO-2HECL2X6-CJUvKAf0.js +0 -12
- package/dist/client/assets/ru-RU-HAYNXO46-BWSlvTrt.js +0 -10
- package/dist/client/assets/runtime-config-BLrEKVO1.js +0 -1
- package/dist/client/assets/si-LK-W5KNS4H6-DGGCsn7k.js +0 -1
- package/dist/client/assets/sk-SK-7K2CFGDV-CY4uTYgQ.js +0 -7
- package/dist/client/assets/sl-SI-OXV2QZWW-2-weqaBY.js +0 -6
- package/dist/client/assets/stateDiagram-v2-4QOOHH4V-B--gjrit.js +0 -1
- package/dist/client/assets/sv-SE-JTOBZRGL-9-IUtVkO.js +0 -12
- package/dist/client/assets/swimlanesDiagram-VK2B7HYN-DO8XNXEg.js +0 -8
- package/dist/client/assets/ta-IN-KFAVKXGT-gHO6Q_DH.js +0 -6
- package/dist/client/assets/th-TH-VDMSCPDL-BvJuw6PJ.js +0 -1
- package/dist/client/assets/tr-TR-CEZ6GX45-CG6UU3Su.js +0 -4
- package/dist/client/assets/uk-UA-Q3H3OXQC-CSuIg_DY.js +0 -6
- package/dist/client/assets/uz-UZ-NGCSWWPX-mom7rxSP.js +0 -1
- package/dist/client/assets/vault-api-client-BkwdFjx0.js +0 -6
- package/dist/client/assets/vault-utils-DvoSftJT.js +0 -22
- package/dist/client/assets/vi-VN-P3NDEVPS-BB0Fu9ck.js +0 -7
- package/dist/client/assets/yjs-provider-reset-guard-DE0vINDP.js +0 -4
- package/dist/client/assets/zh-CN-SS3O57GA-Bj8wsiMe.js +0 -11
- package/dist/client/assets/zh-HK-LWJT3VCF-DOTquTCh.js +0 -1
- package/dist/client/assets/zh-TW-VJXC72RT-B48PRo-l.js +0 -13
- package/src/client/app/drawio-editor-entry.js +0 -1
- package/src/client/app/excalidraw-editor-entry.js +0 -1
- package/src/client/excalidraw-mermaid-stub.js +0 -7
- package/src/client/main.js +0 -16
- /package/dist/client/assets/{vault-api-client-C3mlS_4N.css → auth-gate-C3mlS_4N.css} +0 -0
- /package/dist/client/assets/{drawio-editor-UQQ8XHou.css → drawioEditor-UQQ8XHou.css} +0 -0
- /package/dist/client/assets/{base-BYODPHdS.js → github.min-DBihDoic.js} +0 -0
- /package/dist/client/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
import markdownIt from 'markdown-it';
|
|
2
|
-
import hljs from 'highlight.js';
|
|
3
2
|
|
|
4
3
|
import { isImageAttachmentFilePath } from '../../domain/file-kind.js';
|
|
5
4
|
import { resolveVaultRelativePath } from '../../domain/vault-paths.js';
|
|
6
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
createWikiTargetIndex,
|
|
7
|
+
resolveWikiTargetWithIndex,
|
|
8
|
+
} from '../../domain/wiki-link-resolver.js';
|
|
9
|
+
import { classifyPublicVideoEmbed } from '../../domain/video-embed.js';
|
|
10
|
+
import { highlightFence } from '../domain/highlight-runtime.js';
|
|
7
11
|
import { escapeHtml } from '../domain/vault-utils.js';
|
|
8
12
|
import { extractYamlFrontmatter } from '../../domain/yaml-frontmatter.js';
|
|
9
13
|
import { renderFrontmatterBlock } from './markdown-frontmatter.js';
|
|
10
14
|
import { analyzeMarkdownComplexity } from './preview-render-profile.js';
|
|
11
15
|
|
|
12
|
-
hljs.registerAliases(['cql', 'mariadb', 'mssql', 'mysql', 'plsql', 'sqlite'], { languageName: 'sql' });
|
|
13
|
-
hljs.registerAliases(['ecmascript', 'node'], { languageName: 'javascript' });
|
|
14
|
-
|
|
15
|
-
const DIRECT_VIDEO_MIME_TYPES = Object.freeze({
|
|
16
|
-
'.mp4': 'video/mp4',
|
|
17
|
-
'.ogg': 'video/ogg',
|
|
18
|
-
'.webm': 'video/webm',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const YOUTUBE_HOSTS = new Set([
|
|
22
|
-
'youtube.com',
|
|
23
|
-
'www.youtube.com',
|
|
24
|
-
'm.youtube.com',
|
|
25
|
-
'youtu.be',
|
|
26
|
-
'www.youtu.be',
|
|
27
|
-
'youtube-nocookie.com',
|
|
28
|
-
'www.youtube-nocookie.com',
|
|
29
|
-
]);
|
|
30
16
|
|
|
31
17
|
function renderToken(renderer, tokens, index, options, env, self) {
|
|
32
18
|
return renderer?.(tokens, index, options, env, self) ?? self.renderToken(tokens, index, options);
|
|
@@ -192,78 +178,6 @@ function createBaseFileEmbedPlaceholder({ embedKey, label, target, viewName = ''
|
|
|
192
178
|
return `<span class="bases-embed-placeholder diagram-preview-shell" data-base-key="${escapeHtml(embedKey)}" data-base-path="${escapeHtml(target)}" data-base-label="${escapeHtml(label)}"${viewAttribute}${sourceFileAttribute}><span class="diagram-preview-placeholder-card"><span class="diagram-preview-placeholder-copy"><strong>${escapeHtml(label)}</strong><span>Loads query results when preview renders</span></span></span></span>`;
|
|
193
179
|
}
|
|
194
180
|
|
|
195
|
-
function getDirectVideoMimeType(pathname = '') {
|
|
196
|
-
const match = pathname.toLowerCase().match(/\.(mp4|ogg|webm)$/i);
|
|
197
|
-
if (!match) {
|
|
198
|
-
return null;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return DIRECT_VIDEO_MIME_TYPES[`.${match[1].toLowerCase()}`] || null;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function normalizeYouTubeVideoId(candidate = '') {
|
|
205
|
-
const normalized = String(candidate || '').trim();
|
|
206
|
-
return /^[A-Za-z0-9_-]{11}$/.test(normalized) ? normalized : null;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function getCanonicalYouTubeEmbedUrl(url) {
|
|
210
|
-
const host = url.hostname.toLowerCase();
|
|
211
|
-
let videoId = null;
|
|
212
|
-
|
|
213
|
-
if (host === 'youtu.be' || host === 'www.youtu.be') {
|
|
214
|
-
videoId = normalizeYouTubeVideoId(url.pathname.split('/').filter(Boolean)[0] || '');
|
|
215
|
-
} else if (host.includes('youtube') || host.includes('youtube-nocookie')) {
|
|
216
|
-
if (url.pathname === '/watch') {
|
|
217
|
-
videoId = normalizeYouTubeVideoId(url.searchParams.get('v') || '');
|
|
218
|
-
} else if (url.pathname.startsWith('/embed/')) {
|
|
219
|
-
videoId = normalizeYouTubeVideoId(url.pathname.split('/').filter(Boolean)[1] || '');
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (!videoId) {
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return `https://www.youtube-nocookie.com/embed/${videoId}`;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function classifyPublicVideoEmbed(source = '') {
|
|
231
|
-
let url;
|
|
232
|
-
|
|
233
|
-
try {
|
|
234
|
-
url = new URL(String(source || '').trim());
|
|
235
|
-
} catch {
|
|
236
|
-
return null;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if (url.protocol !== 'https:') {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const host = url.hostname.toLowerCase();
|
|
244
|
-
if (YOUTUBE_HOSTS.has(host)) {
|
|
245
|
-
const embedUrl = getCanonicalYouTubeEmbedUrl(url);
|
|
246
|
-
if (!embedUrl) {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return {
|
|
251
|
-
embedUrl,
|
|
252
|
-
type: 'youtube',
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
const mimeType = getDirectVideoMimeType(url.pathname);
|
|
257
|
-
if (!mimeType) {
|
|
258
|
-
return null;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return {
|
|
262
|
-
mimeType,
|
|
263
|
-
sourceUrl: url.toString(),
|
|
264
|
-
type: 'direct-video',
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
181
|
|
|
268
182
|
function createVideoEmbedPlaceholder({
|
|
269
183
|
embedKey,
|
|
@@ -335,6 +249,20 @@ function resolveLocalAttachmentUrl(source = '', {
|
|
|
335
249
|
return `${attachmentApiPath}?path=${encodeURIComponent(resolvedPath)}`;
|
|
336
250
|
}
|
|
337
251
|
|
|
252
|
+
function resolveWikiImageAttachmentPath(target = '', sourceFilePath = '') {
|
|
253
|
+
const trimmed = String(target ?? '').trim().replace(/^\/+/u, '');
|
|
254
|
+
if (!trimmed) {
|
|
255
|
+
return '';
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (trimmed.startsWith('../') || trimmed.startsWith('./')) {
|
|
259
|
+
const resolved = resolveVaultRelativePath(sourceFilePath, trimmed);
|
|
260
|
+
return isImageAttachmentFilePath(resolved) ? resolved : '';
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return isImageAttachmentFilePath(trimmed) ? trimmed : '';
|
|
264
|
+
}
|
|
265
|
+
|
|
338
266
|
function removeTokenAttr(token, name) {
|
|
339
267
|
const attributeIndex = token.attrIndex(name);
|
|
340
268
|
if (attributeIndex >= 0) {
|
|
@@ -343,16 +271,17 @@ function removeTokenAttr(token, name) {
|
|
|
343
271
|
}
|
|
344
272
|
|
|
345
273
|
function renderInlineWikiText(content, {
|
|
274
|
+
attachmentApiPath = '/api/attachment',
|
|
346
275
|
baseEmbedCounts,
|
|
347
276
|
drawioEmbedCounts,
|
|
348
277
|
excalidrawEmbedCounts,
|
|
349
|
-
|
|
278
|
+
wikiTargetIndex,
|
|
350
279
|
mermaidEmbedCounts,
|
|
351
280
|
plantUmlEmbedCounts,
|
|
352
281
|
sourceFilePath = '',
|
|
353
282
|
wikiLinkAutoCreate = true,
|
|
354
283
|
}) {
|
|
355
|
-
const regex = /!\[\[([^\]|#]+\.(?:base|excalidraw|drawio|mmd|mermaid|puml|plantuml))(?:#([^\]|]+))?(?:\|([^\]]+))?\]\]|\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/gi;
|
|
284
|
+
const regex = /!\[\[([^\]|#]+\.(?:base|excalidraw|drawio|mmd|mermaid|puml|plantuml|png|jpe?g|webp|gif|svg))(?:#([^\]|]+))?(?:\|([^\]]+))?\]\]|\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/gi;
|
|
356
285
|
let lastIndex = 0;
|
|
357
286
|
let html = '';
|
|
358
287
|
let match;
|
|
@@ -401,6 +330,12 @@ function renderInlineWikiText(content, {
|
|
|
401
330
|
label: normalizePreviewTypography(label.replace(/\.(?:mmd|mermaid)$/i, '')),
|
|
402
331
|
target,
|
|
403
332
|
});
|
|
333
|
+
} else if (isImageAttachmentFilePath(target)) {
|
|
334
|
+
const resolvedPath = resolveWikiImageAttachmentPath(target, sourceFilePath);
|
|
335
|
+
const alt = normalizePreviewTypography(label.replace(/\.(?:png|jpe?g|webp|gif|svg)$/i, ''));
|
|
336
|
+
html += resolvedPath
|
|
337
|
+
? `<img src="${escapeHtml(`${attachmentApiPath}?path=${encodeURIComponent(resolvedPath)}`)}" alt="${escapeHtml(alt)}" loading="lazy" decoding="async">`
|
|
338
|
+
: `<a class="wiki-link wiki-link-new" href="#" data-wiki-target="${escapeHtml(target)}" title="${escapeHtml(`Missing "${target}"`)}">${escapePreviewText(label)}</a>`;
|
|
404
339
|
} else {
|
|
405
340
|
const occurrenceIndex = plantUmlEmbedCounts.get(target) ?? 0;
|
|
406
341
|
plantUmlEmbedCounts.set(target, occurrenceIndex + 1);
|
|
@@ -413,7 +348,7 @@ function renderInlineWikiText(content, {
|
|
|
413
348
|
} else {
|
|
414
349
|
const target = match[4].trim();
|
|
415
350
|
const display = (match[5] || match[4]).trim();
|
|
416
|
-
const resolved =
|
|
351
|
+
const resolved = resolveWikiTargetWithIndex(target, wikiTargetIndex);
|
|
417
352
|
const classes = resolved ? 'wiki-link' : 'wiki-link wiki-link-new';
|
|
418
353
|
const title = resolved
|
|
419
354
|
? normalizePreviewTypography(display)
|
|
@@ -445,11 +380,7 @@ function createMarkdownRenderer(fileList = [], {
|
|
|
445
380
|
}
|
|
446
381
|
|
|
447
382
|
try {
|
|
448
|
-
|
|
449
|
-
return hljs.highlight(source, { language }).value;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
return hljs.highlightAuto(source).value;
|
|
383
|
+
return highlightFence(source, language);
|
|
453
384
|
} catch {
|
|
454
385
|
return '';
|
|
455
386
|
}
|
|
@@ -488,6 +419,7 @@ function createMarkdownRenderer(fileList = [], {
|
|
|
488
419
|
const plantUmlCounts = new Map();
|
|
489
420
|
const plantUmlEmbedCounts = new Map();
|
|
490
421
|
const videoEmbedCounts = new Map();
|
|
422
|
+
const wikiTargetIndex = createWikiTargetIndex(fileList);
|
|
491
423
|
|
|
492
424
|
const fallbackFence = markdown.renderer.rules.fence;
|
|
493
425
|
const fallbackImage = markdown.renderer.rules.image;
|
|
@@ -566,36 +498,39 @@ function createMarkdownRenderer(fileList = [], {
|
|
|
566
498
|
const content = tokens[index].content;
|
|
567
499
|
|
|
568
500
|
if (content.startsWith('[x] ') || content.startsWith('[X] ')) {
|
|
569
|
-
return `<input type="checkbox" checked data-task-checkbox="true"> ${renderInlineWikiText(content.slice(4), {
|
|
501
|
+
return `<label class="task-list-label"><input type="checkbox" checked data-task-checkbox="true"> ${renderInlineWikiText(content.slice(4), {
|
|
502
|
+
attachmentApiPath,
|
|
570
503
|
baseEmbedCounts: baseCounts,
|
|
571
504
|
drawioEmbedCounts,
|
|
572
505
|
excalidrawEmbedCounts,
|
|
573
|
-
|
|
506
|
+
wikiTargetIndex,
|
|
574
507
|
mermaidEmbedCounts,
|
|
575
508
|
plantUmlEmbedCounts,
|
|
576
509
|
sourceFilePath,
|
|
577
510
|
wikiLinkAutoCreate,
|
|
578
|
-
})}
|
|
511
|
+
})}</label>`;
|
|
579
512
|
}
|
|
580
513
|
|
|
581
514
|
if (content.startsWith('[ ] ')) {
|
|
582
|
-
return `<input type="checkbox" data-task-checkbox="true"> ${renderInlineWikiText(content.slice(4), {
|
|
515
|
+
return `<label class="task-list-label"><input type="checkbox" data-task-checkbox="true"> ${renderInlineWikiText(content.slice(4), {
|
|
516
|
+
attachmentApiPath,
|
|
583
517
|
baseEmbedCounts: baseCounts,
|
|
584
518
|
drawioEmbedCounts,
|
|
585
519
|
excalidrawEmbedCounts,
|
|
586
|
-
|
|
520
|
+
wikiTargetIndex,
|
|
587
521
|
mermaidEmbedCounts,
|
|
588
522
|
plantUmlEmbedCounts,
|
|
589
523
|
sourceFilePath,
|
|
590
524
|
wikiLinkAutoCreate,
|
|
591
|
-
})}
|
|
525
|
+
})}</label>`;
|
|
592
526
|
}
|
|
593
527
|
|
|
594
528
|
return renderInlineWikiText(content, {
|
|
529
|
+
attachmentApiPath,
|
|
595
530
|
baseEmbedCounts: baseCounts,
|
|
596
531
|
drawioEmbedCounts,
|
|
597
532
|
excalidrawEmbedCounts,
|
|
598
|
-
|
|
533
|
+
wikiTargetIndex,
|
|
599
534
|
mermaidEmbedCounts,
|
|
600
535
|
plantUmlEmbedCounts,
|
|
601
536
|
sourceFilePath,
|
|
@@ -631,6 +566,8 @@ function createMarkdownRenderer(fileList = [], {
|
|
|
631
566
|
return renderedVideo;
|
|
632
567
|
}
|
|
633
568
|
|
|
569
|
+
token.attrSet('loading', 'lazy');
|
|
570
|
+
token.attrSet('decoding', 'async');
|
|
634
571
|
return renderToken(fallbackImage, tokens, index, options, env, self);
|
|
635
572
|
};
|
|
636
573
|
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cancelIdleRender,
|
|
3
|
-
IDLE_RENDER_TIMEOUT_MS,
|
|
4
|
-
requestIdleRender,
|
|
5
|
-
} from './preview-diagram-utils.js';
|
|
6
1
|
|
|
7
2
|
function createPreviewWorker() {
|
|
8
3
|
return new Worker(new URL('./preview-render-worker.js', import.meta.url), { type: 'module' });
|
|
@@ -11,28 +6,21 @@ function createPreviewWorker() {
|
|
|
11
6
|
export class PreviewRenderExecutor {
|
|
12
7
|
constructor({
|
|
13
8
|
attachmentApiPath = '/api/attachment',
|
|
14
|
-
cancelIdleRenderFn = cancelIdleRender,
|
|
15
9
|
compilePreviewDocumentLoader = () => import('./preview-render-compiler.js'),
|
|
16
10
|
createWorkerFn = createPreviewWorker,
|
|
17
11
|
getFileList,
|
|
18
12
|
getSourceFilePath = null,
|
|
19
13
|
getWikiLinkAutoCreate = null,
|
|
20
|
-
idleTimeoutMs = IDLE_RENDER_TIMEOUT_MS,
|
|
21
|
-
requestIdleRenderFn = requestIdleRender,
|
|
22
14
|
} = {}) {
|
|
23
15
|
this.attachmentApiPath = attachmentApiPath;
|
|
24
|
-
this.cancelIdleRenderFn = cancelIdleRenderFn;
|
|
25
16
|
this.compilePreviewDocumentLoader = compilePreviewDocumentLoader;
|
|
26
17
|
this.createWorkerFn = createWorkerFn;
|
|
27
18
|
this.getFileList = getFileList;
|
|
28
19
|
this.getSourceFilePath = getSourceFilePath;
|
|
29
20
|
this.getWikiLinkAutoCreate = getWikiLinkAutoCreate;
|
|
30
|
-
this.idleTimeoutMs = idleTimeoutMs;
|
|
31
|
-
this.requestIdleRenderFn = requestIdleRenderFn;
|
|
32
21
|
this.worker = null;
|
|
33
22
|
this.workerDisabled = false;
|
|
34
23
|
this.workerJob = null;
|
|
35
|
-
this.workerPrewarmId = null;
|
|
36
24
|
|
|
37
25
|
this.handleWorkerMessage = (event) => {
|
|
38
26
|
if (!this.workerJob || event.data?.renderVersion !== this.workerJob.renderVersion) {
|
|
@@ -68,16 +56,6 @@ export class PreviewRenderExecutor {
|
|
|
68
56
|
return this.workerJob !== null;
|
|
69
57
|
}
|
|
70
58
|
|
|
71
|
-
schedulePrewarm({ timeout = this.idleTimeoutMs } = {}) {
|
|
72
|
-
if (this.workerDisabled || this.worker || this.workerPrewarmId !== null) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
this.workerPrewarmId = this.requestIdleRenderFn(() => {
|
|
77
|
-
this.workerPrewarmId = null;
|
|
78
|
-
this.ensureWorker();
|
|
79
|
-
}, timeout);
|
|
80
|
-
}
|
|
81
59
|
|
|
82
60
|
ensureWorker() {
|
|
83
61
|
if (this.workerDisabled) {
|
|
@@ -163,10 +141,6 @@ export class PreviewRenderExecutor {
|
|
|
163
141
|
}
|
|
164
142
|
|
|
165
143
|
destroy(reason = 'Preview renderer destroyed') {
|
|
166
|
-
if (this.workerPrewarmId !== null) {
|
|
167
|
-
this.cancelIdleRenderFn(this.workerPrewarmId);
|
|
168
|
-
}
|
|
169
|
-
this.workerPrewarmId = null;
|
|
170
144
|
this.reset(reason);
|
|
171
145
|
}
|
|
172
146
|
}
|
|
@@ -6,24 +6,8 @@ import {
|
|
|
6
6
|
import { getRenderProfile } from './preview-render-profile.js';
|
|
7
7
|
|
|
8
8
|
export class PreviewRenderScheduler {
|
|
9
|
-
constructor({
|
|
10
|
-
cancelAnimationFrameFn = (frameId) => cancelAnimationFrame(frameId),
|
|
11
|
-
cancelIdleRenderFn = cancelIdleRender,
|
|
12
|
-
clearTimeoutFn = (timeoutId) => clearTimeout(timeoutId),
|
|
13
|
-
getRenderProfileFn = getRenderProfile,
|
|
14
|
-
idleTimeoutMs = IDLE_RENDER_TIMEOUT_MS,
|
|
15
|
-
requestAnimationFrameFn = (callback) => requestAnimationFrame(callback),
|
|
16
|
-
requestIdleRenderFn = requestIdleRender,
|
|
17
|
-
setTimeoutFn = (callback, delay) => setTimeout(callback, delay),
|
|
18
|
-
} = {}) {
|
|
19
|
-
this.cancelAnimationFrameFn = cancelAnimationFrameFn;
|
|
20
|
-
this.cancelIdleRenderFn = cancelIdleRenderFn;
|
|
21
|
-
this.clearTimeoutFn = clearTimeoutFn;
|
|
9
|
+
constructor({ getRenderProfileFn = getRenderProfile } = {}) {
|
|
22
10
|
this.getRenderProfileFn = getRenderProfileFn;
|
|
23
|
-
this.idleTimeoutMs = idleTimeoutMs;
|
|
24
|
-
this.requestAnimationFrameFn = requestAnimationFrameFn;
|
|
25
|
-
this.requestIdleRenderFn = requestIdleRenderFn;
|
|
26
|
-
this.setTimeoutFn = setTimeoutFn;
|
|
27
11
|
this.frameId = null;
|
|
28
12
|
this.idleId = null;
|
|
29
13
|
this.timeoutId = null;
|
|
@@ -34,7 +18,7 @@ export class PreviewRenderScheduler {
|
|
|
34
18
|
this.cancel();
|
|
35
19
|
|
|
36
20
|
const scheduleFrame = () => {
|
|
37
|
-
this.frameId =
|
|
21
|
+
this.frameId = requestAnimationFrame(() => {
|
|
38
22
|
this.frameId = null;
|
|
39
23
|
this.timeoutId = null;
|
|
40
24
|
onRenderRequested?.(markdownText, renderVersion);
|
|
@@ -43,25 +27,25 @@ export class PreviewRenderScheduler {
|
|
|
43
27
|
|
|
44
28
|
const scheduleRender = () => {
|
|
45
29
|
if (renderProfile.deferUntilIdle) {
|
|
46
|
-
this.idleId =
|
|
30
|
+
this.idleId = requestIdleRender(() => {
|
|
47
31
|
this.idleId = null;
|
|
48
32
|
scheduleFrame();
|
|
49
|
-
},
|
|
33
|
+
}, IDLE_RENDER_TIMEOUT_MS);
|
|
50
34
|
return;
|
|
51
35
|
}
|
|
52
36
|
|
|
53
37
|
scheduleFrame();
|
|
54
38
|
};
|
|
55
39
|
|
|
56
|
-
this.timeoutId =
|
|
40
|
+
this.timeoutId = setTimeout(scheduleRender, renderProfile.debounceMs);
|
|
57
41
|
}
|
|
58
42
|
|
|
59
43
|
cancel() {
|
|
60
|
-
|
|
44
|
+
clearTimeout(this.timeoutId);
|
|
61
45
|
if (this.frameId) {
|
|
62
|
-
|
|
46
|
+
cancelAnimationFrame(this.frameId);
|
|
63
47
|
}
|
|
64
|
-
|
|
48
|
+
cancelIdleRender(this.idleId);
|
|
65
49
|
this.frameId = null;
|
|
66
50
|
this.idleId = null;
|
|
67
51
|
this.timeoutId = null;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { MermaidPreviewHydrator } from './mermaid-preview-hydrator.js';
|
|
2
2
|
import { PlantUmlPreviewHydrator } from './plantuml-preview-hydrator.js';
|
|
3
3
|
import { DiagramChrome } from './diagram-chrome.js';
|
|
4
|
-
import { IDLE_RENDER_TIMEOUT_MS } from './preview-diagram-utils.js';
|
|
5
4
|
import { PreviewRenderExecutor } from './preview-render-executor.js';
|
|
6
|
-
import {
|
|
5
|
+
import { isLargeDocumentStats } from './preview-render-profile.js';
|
|
7
6
|
import { PreviewRenderScheduler } from './preview-render-scheduler.js';
|
|
8
7
|
import { resolveApiUrl } from '../domain/runtime-paths.js';
|
|
9
|
-
|
|
10
8
|
export class PreviewRenderer {
|
|
11
9
|
constructor({
|
|
12
10
|
getContent,
|
|
13
11
|
getFileList,
|
|
12
|
+
getPreviewVisible = null,
|
|
14
13
|
getSourceFilePath,
|
|
14
|
+
getTheme = null,
|
|
15
15
|
getWikiLinkAutoCreate = null,
|
|
16
16
|
loadFileSource = null,
|
|
17
17
|
onAfterRenderCommit,
|
|
@@ -26,7 +26,9 @@ export class PreviewRenderer {
|
|
|
26
26
|
}) {
|
|
27
27
|
this.getContent = getContent;
|
|
28
28
|
this.getFileList = getFileList;
|
|
29
|
+
this.getPreviewVisible = getPreviewVisible;
|
|
29
30
|
this.getSourceFilePath = getSourceFilePath;
|
|
31
|
+
this.getTheme = getTheme;
|
|
30
32
|
this.getWikiLinkAutoCreate = getWikiLinkAutoCreate;
|
|
31
33
|
this.loadFileSource = loadFileSource;
|
|
32
34
|
this.onAfterRenderCommit = onAfterRenderCommit;
|
|
@@ -47,6 +49,7 @@ export class PreviewRenderer {
|
|
|
47
49
|
this.isLargeDocument = false;
|
|
48
50
|
this.hydrationPaused = false;
|
|
49
51
|
this.frontmatterCollapsed = false;
|
|
52
|
+
this.previewRenderStale = false;
|
|
50
53
|
|
|
51
54
|
this.handlePreviewClick = (event) => {
|
|
52
55
|
const frontmatterToggle = event.target.closest('.frontmatter-toggle');
|
|
@@ -105,13 +108,12 @@ export class PreviewRenderer {
|
|
|
105
108
|
loadFileSource,
|
|
106
109
|
renderClient: plantUmlRenderClient,
|
|
107
110
|
});
|
|
108
|
-
this.renderScheduler = new PreviewRenderScheduler(
|
|
111
|
+
this.renderScheduler = new PreviewRenderScheduler();
|
|
109
112
|
this.renderExecutor = new PreviewRenderExecutor({
|
|
110
113
|
attachmentApiPath: resolveApiUrl('/attachment'),
|
|
111
114
|
getFileList: () => this.getFileList?.() ?? [],
|
|
112
115
|
getSourceFilePath: () => this.getSourceFilePath?.() ?? '',
|
|
113
116
|
getWikiLinkAutoCreate: () => this.getWikiLinkAutoCreate?.() ?? true,
|
|
114
|
-
idleTimeoutMs: IDLE_RENDER_TIMEOUT_MS,
|
|
115
117
|
});
|
|
116
118
|
|
|
117
119
|
this.previewElement?.addEventListener('click', this.handlePreviewClick);
|
|
@@ -204,8 +206,25 @@ export class PreviewRenderer {
|
|
|
204
206
|
}
|
|
205
207
|
this.mermaidHydrator.applyTheme(theme);
|
|
206
208
|
}
|
|
209
|
+
markStale() {
|
|
210
|
+
this.previewRenderStale = true;
|
|
211
|
+
this.renderScheduler.cancel();
|
|
212
|
+
}
|
|
207
213
|
|
|
208
214
|
queueRender() {
|
|
215
|
+
if (!(this.getPreviewVisible?.() ?? true)) {
|
|
216
|
+
this.markStale();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
this.previewRenderStale = false;
|
|
221
|
+
this._deferredPreviewStylesPromise ??= Promise.all([
|
|
222
|
+
import('./highlight-theme.js').then(({ ensureHighlightThemeStylesheet }) => {
|
|
223
|
+
ensureHighlightThemeStylesheet();
|
|
224
|
+
this.applyTheme(this.getTheme?.() ?? 'dark');
|
|
225
|
+
}),
|
|
226
|
+
import('../styles/deferred-preview.css'),
|
|
227
|
+
]);
|
|
209
228
|
const markdownText = this.getContent();
|
|
210
229
|
this.renderScheduler.cancel();
|
|
211
230
|
this.mermaidHydrator.markPending();
|
|
@@ -215,12 +234,13 @@ export class PreviewRenderer {
|
|
|
215
234
|
this.renderScheduler.queue({
|
|
216
235
|
markdownText,
|
|
217
236
|
onRenderRequested: (queuedText, renderVersion) => {
|
|
218
|
-
void this.render(queuedText, renderVersion);
|
|
237
|
+
void this._deferredPreviewStylesPromise.then(() => this.render(queuedText, renderVersion));
|
|
219
238
|
},
|
|
220
239
|
renderVersion: scheduledVersion,
|
|
221
240
|
});
|
|
222
241
|
}
|
|
223
242
|
|
|
243
|
+
|
|
224
244
|
async render(markdownText = this.getContent(), renderVersion = this.pendingRenderVersion) {
|
|
225
245
|
if (!this.previewElement) {
|
|
226
246
|
return;
|
|
@@ -291,9 +311,6 @@ export class PreviewRenderer {
|
|
|
291
311
|
this.updateHydrationPhase();
|
|
292
312
|
}
|
|
293
313
|
|
|
294
|
-
scheduleWorkerPrewarm({ timeout = IDLE_RENDER_TIMEOUT_MS } = {}) {
|
|
295
|
-
this.renderExecutor.schedulePrewarm({ timeout });
|
|
296
|
-
}
|
|
297
314
|
|
|
298
315
|
commitBaseRender({ html, stats }, renderVersion) {
|
|
299
316
|
this.activeRenderVersion = renderVersion;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { resolveRenderableDiagram } from '../../domain/diagram-source.js';
|
|
2
|
+
import {
|
|
3
|
+
rasterizeSvgMarkupToPngBlob,
|
|
4
|
+
renderMermaidExportSvgMarkup,
|
|
5
|
+
} from './diagram-preview-export.js';
|
|
6
|
+
|
|
7
|
+
export async function renderWebMcpDiagram(input = {}, {
|
|
8
|
+
callTool,
|
|
9
|
+
getMermaid,
|
|
10
|
+
signal,
|
|
11
|
+
} = {}) {
|
|
12
|
+
const requestedStartLine = Number.parseInt(input.startLine, 10);
|
|
13
|
+
const read = await callTool('read_document', {
|
|
14
|
+
lineCount: 500,
|
|
15
|
+
path: input.path,
|
|
16
|
+
startLine: Number.isInteger(requestedStartLine) ? requestedStartLine : 1,
|
|
17
|
+
}, { signal });
|
|
18
|
+
const diagram = resolveRenderableDiagram(read.content, input.path, {
|
|
19
|
+
contentStartLine: read.startLine,
|
|
20
|
+
startLine: input.startLine,
|
|
21
|
+
});
|
|
22
|
+
if (!diagram || diagram.kind !== 'mermaid') {
|
|
23
|
+
return callTool('render_diagram', input, { signal });
|
|
24
|
+
}
|
|
25
|
+
if (read.kind === 'mermaid' && read.truncated) {
|
|
26
|
+
throw new Error('Mermaid source exceeds the WebMCP read limit');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const svg = await renderMermaidExportSvgMarkup(await getMermaid(), diagram.source);
|
|
30
|
+
const format = input.format ?? 'png';
|
|
31
|
+
const mimeType = format === 'svg' ? 'image/svg+xml' : 'image/png';
|
|
32
|
+
const bytes = format === 'svg'
|
|
33
|
+
? new TextEncoder().encode(svg)
|
|
34
|
+
: new Uint8Array(await (await rasterizeSvgMarkupToPngBlob(svg)).arrayBuffer());
|
|
35
|
+
return {
|
|
36
|
+
endLine: diagram.endLine,
|
|
37
|
+
format,
|
|
38
|
+
image: { data: bytes.toBase64(), encoding: 'base64', mimeType },
|
|
39
|
+
kind: diagram.kind,
|
|
40
|
+
mimeType,
|
|
41
|
+
path: read.path,
|
|
42
|
+
renderer: 'mermaid-browser',
|
|
43
|
+
revision: read.revision,
|
|
44
|
+
startLine: diagram.startLine,
|
|
45
|
+
warnings: [],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -21,6 +21,7 @@ export class WorkspaceCoordinator {
|
|
|
21
21
|
createEditorSession,
|
|
22
22
|
getDisplayName,
|
|
23
23
|
getFileList,
|
|
24
|
+
getVaultFileList = getFileList,
|
|
24
25
|
getLineWrappingEnabled,
|
|
25
26
|
getVimModeEnabled,
|
|
26
27
|
getLocalUser,
|
|
@@ -74,6 +75,7 @@ export class WorkspaceCoordinator {
|
|
|
74
75
|
this.createEditorSession = createEditorSession;
|
|
75
76
|
this.getDisplayName = getDisplayName;
|
|
76
77
|
this.getFileList = getFileList;
|
|
78
|
+
this.getVaultFileList = getVaultFileList;
|
|
77
79
|
this.getLineWrappingEnabled = getLineWrappingEnabled;
|
|
78
80
|
this.getVimModeEnabled = getVimModeEnabled ?? (() => false);
|
|
79
81
|
this.getLocalUser = getLocalUser;
|
|
@@ -208,7 +210,7 @@ export class WorkspaceCoordinator {
|
|
|
208
210
|
return false;
|
|
209
211
|
}
|
|
210
212
|
|
|
211
|
-
if (!filePath || !this.
|
|
213
|
+
if (!filePath || !this.getVaultFileList().includes(filePath)) {
|
|
212
214
|
this.cleanupSession();
|
|
213
215
|
this.stateStore.sessionLoadToken += 1;
|
|
214
216
|
this.onFileOpenError({ code: 'not-found', filePath });
|
|
@@ -267,6 +269,26 @@ export class WorkspaceCoordinator {
|
|
|
267
269
|
});
|
|
268
270
|
return true;
|
|
269
271
|
}
|
|
272
|
+
let fileOpenReady = false;
|
|
273
|
+
let liveSyncComplete = false;
|
|
274
|
+
const bootstrapPromise = this.loadBootstrapContent
|
|
275
|
+
? (async () => {
|
|
276
|
+
this.reportFileOpenMetric('bootstrap_fetch_started', loadToken);
|
|
277
|
+
try {
|
|
278
|
+
const content = await this.loadBootstrapContent(filePath);
|
|
279
|
+
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
280
|
+
found: content !== null,
|
|
281
|
+
});
|
|
282
|
+
return content;
|
|
283
|
+
} catch (error) {
|
|
284
|
+
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
285
|
+
error: error.message,
|
|
286
|
+
found: false,
|
|
287
|
+
});
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
})()
|
|
291
|
+
: Promise.resolve(null);
|
|
270
292
|
|
|
271
293
|
const EditorSession = await this.loadEditorSessionClass();
|
|
272
294
|
const session = this.createEditorSession(EditorSession, {
|
|
@@ -301,10 +323,7 @@ export class WorkspaceCoordinator {
|
|
|
301
323
|
this.onSessionAssigned?.(session);
|
|
302
324
|
|
|
303
325
|
try {
|
|
304
|
-
let fileOpenReady = false;
|
|
305
326
|
let fileOpenFinalized = false;
|
|
306
|
-
let liveSyncComplete = false;
|
|
307
|
-
|
|
308
327
|
const readySession = async (reason) => {
|
|
309
328
|
if (fileOpenReady || loadToken !== this.stateStore.sessionLoadToken) {
|
|
310
329
|
return;
|
|
@@ -333,24 +352,6 @@ export class WorkspaceCoordinator {
|
|
|
333
352
|
});
|
|
334
353
|
};
|
|
335
354
|
|
|
336
|
-
const bootstrapPromise = this.loadBootstrapContent
|
|
337
|
-
? (async () => {
|
|
338
|
-
this.reportFileOpenMetric('bootstrap_fetch_started', loadToken);
|
|
339
|
-
try {
|
|
340
|
-
const content = await this.loadBootstrapContent(filePath);
|
|
341
|
-
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
342
|
-
found: content !== null,
|
|
343
|
-
});
|
|
344
|
-
return content;
|
|
345
|
-
} catch (error) {
|
|
346
|
-
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
347
|
-
error: error.message,
|
|
348
|
-
found: false,
|
|
349
|
-
});
|
|
350
|
-
return null;
|
|
351
|
-
}
|
|
352
|
-
})()
|
|
353
|
-
: Promise.resolve(null);
|
|
354
355
|
|
|
355
356
|
const initializePromise = session.initialize(filePath);
|
|
356
357
|
const liveSyncPromise = (async () => {
|
|
@@ -143,6 +143,13 @@ export class WorkspaceRouteController {
|
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
this.revealEditorMatch(route);
|
|
146
|
+
if (route.elementId) {
|
|
147
|
+
this.excalidrawEmbed?.openElement(
|
|
148
|
+
route.filePath,
|
|
149
|
+
route.elementId,
|
|
150
|
+
route.elementType,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
146
153
|
this.requestPreviewRouteAnchor?.(route.anchor ?? null, route.filePath);
|
|
147
154
|
}
|
|
148
155
|
|