collabmd 0.1.18
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/LICENSE +21 -0
- package/README.md +453 -0
- package/bin/collabmd.js +241 -0
- package/docker-compose.yml +43 -0
- package/package.json +93 -0
- package/public/assets/css/base.css +1 -0
- package/public/assets/css/style.css +1 -0
- package/public/assets/js/assets/Assistant-Bold-ZDZZ6JHA.woff2 +0 -0
- package/public/assets/js/assets/Assistant-Medium-DZ25RZU3.woff2 +0 -0
- package/public/assets/js/assets/Assistant-Regular-PLF2XOGW.woff2 +0 -0
- package/public/assets/js/assets/Assistant-SemiBold-CZ5MX6FK.woff2 +0 -0
- package/public/assets/js/chunks/CodeMirrorEditor-UCMRAMCV-MAKZFDBE.js +12 -0
- package/public/assets/js/chunks/apl-C5P5JBDI.js +1 -0
- package/public/assets/js/chunks/ar-SA-NXDWD63E-MF6HMEA4.js +8 -0
- package/public/assets/js/chunks/architecture-PBZL5I3N-55LDZ5WS.js +1 -0
- package/public/assets/js/chunks/architectureDiagram-2XIMDMQ5-2VP562X7.js +36 -0
- package/public/assets/js/chunks/asciiarmor-3NCLLELT.js +1 -0
- package/public/assets/js/chunks/asn1-KF4WXU3M.js +1 -0
- package/public/assets/js/chunks/asterisk-EA3VIN65.js +1 -0
- package/public/assets/js/chunks/az-AZ-MXSORGZV-AIGO4TNU.js +1 -0
- package/public/assets/js/chunks/bg-BG-O6MV2KSF-X6AVO2AF.js +5 -0
- package/public/assets/js/chunks/blockDiagram-WCTKOSBZ-KM56WWDE.js +132 -0
- package/public/assets/js/chunks/bn-BD-T2VJNT7N-7OMHRIGC.js +3 -0
- package/public/assets/js/chunks/bn-IN-MMW2ORAC-EPKMNKG7.js +3 -0
- package/public/assets/js/chunks/brainfuck-A3CTQVFD.js +1 -0
- package/public/assets/js/chunks/c4Diagram-IC4MRINW-KX6UEGQZ.js +10 -0
- package/public/assets/js/chunks/ca-ES-MKBCGNOG-U44SUUTN.js +8 -0
- package/public/assets/js/chunks/chunk-2NTQWLZD.js +25 -0
- package/public/assets/js/chunks/chunk-2YRP2AWD.js +1 -0
- package/public/assets/js/chunks/chunk-3BUCGSSJ.js +1 -0
- package/public/assets/js/chunks/chunk-47L7JGE3.js +1 -0
- package/public/assets/js/chunks/chunk-4BCHPULB.js +1 -0
- package/public/assets/js/chunks/chunk-4NKM6YFO.js +161 -0
- package/public/assets/js/chunks/chunk-4WGMPBK5.js +1 -0
- package/public/assets/js/chunks/chunk-55WF6Y2Q.js +1 -0
- package/public/assets/js/chunks/chunk-775E65SU.js +1 -0
- package/public/assets/js/chunks/chunk-AJRGTECU.js +70 -0
- package/public/assets/js/chunks/chunk-B2J3PHGY.js +1 -0
- package/public/assets/js/chunks/chunk-B4JKB3BC.js +1 -0
- package/public/assets/js/chunks/chunk-BBHPYU2R.js +1 -0
- package/public/assets/js/chunks/chunk-CGVY4PKT.js +13 -0
- package/public/assets/js/chunks/chunk-CVTRX3TE.js +220 -0
- package/public/assets/js/chunks/chunk-DW6KK6VF.js +1 -0
- package/public/assets/js/chunks/chunk-E2HMNOQL.js +189 -0
- package/public/assets/js/chunks/chunk-EPTJZP5H.js +7 -0
- package/public/assets/js/chunks/chunk-G7NUGGE7.js +13 -0
- package/public/assets/js/chunks/chunk-GI7LBIBP.js +1 -0
- package/public/assets/js/chunks/chunk-GXRL27M7.js +1 -0
- package/public/assets/js/chunks/chunk-H6EYDHRW.js +1 -0
- package/public/assets/js/chunks/chunk-HOCBCDA5.js +1 -0
- package/public/assets/js/chunks/chunk-HS2CUOC6.js +1 -0
- package/public/assets/js/chunks/chunk-HUAS4BYI.js +12 -0
- package/public/assets/js/chunks/chunk-HVNNEPP5.js +2 -0
- package/public/assets/js/chunks/chunk-I2GVZI7W.js +38 -0
- package/public/assets/js/chunks/chunk-I6PVWGBN.js +14 -0
- package/public/assets/js/chunks/chunk-IR2DOYV4.js +7 -0
- package/public/assets/js/chunks/chunk-IZ3V3F2A.js +1 -0
- package/public/assets/js/chunks/chunk-KPAQHIOI.js +1 -0
- package/public/assets/js/chunks/chunk-M3EW4V74.js +1 -0
- package/public/assets/js/chunks/chunk-MK3AFU3C.js +90 -0
- package/public/assets/js/chunks/chunk-NM6J3ND7.js +1 -0
- package/public/assets/js/chunks/chunk-NO7UPWTU.js +1 -0
- package/public/assets/js/chunks/chunk-OG2TNZEU.js +9 -0
- package/public/assets/js/chunks/chunk-OHGDMMWM.js +1 -0
- package/public/assets/js/chunks/chunk-OOT2HALX.js +1 -0
- package/public/assets/js/chunks/chunk-OQLLZFFN.js +1 -0
- package/public/assets/js/chunks/chunk-PF6TP4EI.js +1 -0
- package/public/assets/js/chunks/chunk-PMOZMECZ.js +85 -0
- package/public/assets/js/chunks/chunk-QBGS6DJR.js +1 -0
- package/public/assets/js/chunks/chunk-QF3ZQ6UQ.js +1 -0
- package/public/assets/js/chunks/chunk-QFXMAUW4.js +1 -0
- package/public/assets/js/chunks/chunk-QSTBGTWJ.js +1 -0
- package/public/assets/js/chunks/chunk-QYKIT2IH.js +41 -0
- package/public/assets/js/chunks/chunk-S75BI2UQ.js +1 -0
- package/public/assets/js/chunks/chunk-SKEZZ3H6.js +1 -0
- package/public/assets/js/chunks/chunk-SO6QBCB6.js +1 -0
- package/public/assets/js/chunks/chunk-SR3U53EQ.js +1 -0
- package/public/assets/js/chunks/chunk-TFP6LRYJ.js +53 -0
- package/public/assets/js/chunks/chunk-U6APNHAF.js +15 -0
- package/public/assets/js/chunks/chunk-VOODXHXA.js +1 -0
- package/public/assets/js/chunks/chunk-W7WJUTSA.js +3 -0
- package/public/assets/js/chunks/chunk-WNXFO2F2.js +1 -0
- package/public/assets/js/chunks/chunk-X6EEYWV4.js +6 -0
- package/public/assets/js/chunks/chunk-YVW3ZETS.js +1 -0
- package/public/assets/js/chunks/chunk-ZR2QRTBG.js +339 -0
- package/public/assets/js/chunks/chunk-ZZJX4LQ2.js +1 -0
- package/public/assets/js/chunks/classDiagram-VBA2DB6C-IYW4O2RM.js +1 -0
- package/public/assets/js/chunks/classDiagram-v2-RAHNMMFH-DNKVN2WD.js +1 -0
- package/public/assets/js/chunks/clike-RTBH33GE.js +1 -0
- package/public/assets/js/chunks/clojure-BR2VJ2JI.js +1 -0
- package/public/assets/js/chunks/cmake-2HEWVFEE.js +1 -0
- package/public/assets/js/chunks/cobol-V6EIK6DN.js +1 -0
- package/public/assets/js/chunks/coffeescript-JW3ZOGMD.js +1 -0
- package/public/assets/js/chunks/commonlisp-UCWSIHYK.js +1 -0
- package/public/assets/js/chunks/cose-bilkent-S5V4N54A-QVYRFFNC.js +1 -0
- package/public/assets/js/chunks/crystal-GR4VLC3M.js +1 -0
- package/public/assets/js/chunks/cs-CZ-V77HGUP7-OLBAKFG5.js +7 -0
- package/public/assets/js/chunks/css-C5DVWGB4.js +1 -0
- package/public/assets/js/chunks/cypher-K7FZM5GC.js +1 -0
- package/public/assets/js/chunks/d-CF3QNNH5.js +1 -0
- package/public/assets/js/chunks/da-DK-I5RFNTM4-QJIG2SEZ.js +2 -0
- package/public/assets/js/chunks/dagre-KLK3FWXG-KVNBUDOY.js +4 -0
- package/public/assets/js/chunks/de-CH-WLRDEVBV-4MMJDMVD.js +7 -0
- package/public/assets/js/chunks/de-DE-DTI4WUSC-ML7C46TT.js +7 -0
- package/public/assets/js/chunks/diagram-E7M64L7V-ZP33VRUC.js +24 -0
- package/public/assets/js/chunks/diagram-IFDJBPK2-ZG35YWOD.js +43 -0
- package/public/assets/js/chunks/diagram-P4PSJMXO-ZGIGM7D2.js +24 -0
- package/public/assets/js/chunks/diff-KOMSZU7O.js +1 -0
- package/public/assets/js/chunks/dist-7RQKSOUX.js +7 -0
- package/public/assets/js/chunks/dist-ARWGZ6MN.js +1 -0
- package/public/assets/js/chunks/dist-DPBSGC3Y.js +2 -0
- package/public/assets/js/chunks/dist-E36PJE5M.js +1 -0
- package/public/assets/js/chunks/dist-E5NM7OBW.js +1 -0
- package/public/assets/js/chunks/dist-ERADYPEK.js +1 -0
- package/public/assets/js/chunks/dist-F43RIHBZ.js +1 -0
- package/public/assets/js/chunks/dist-HAB5NIXI.js +1 -0
- package/public/assets/js/chunks/dist-HG23OLRA.js +1 -0
- package/public/assets/js/chunks/dist-IEJXBSDJ.js +1 -0
- package/public/assets/js/chunks/dist-IQA4KVJK.js +1 -0
- package/public/assets/js/chunks/dist-OIQTNVT2.js +3 -0
- package/public/assets/js/chunks/dist-PMZJ734S.js +1 -0
- package/public/assets/js/chunks/dist-RCQFQRLD.js +1 -0
- package/public/assets/js/chunks/dist-RQLC4GVI.js +1 -0
- package/public/assets/js/chunks/dist-RSJGLSKC.js +1 -0
- package/public/assets/js/chunks/dist-SGNQZVVX.js +1 -0
- package/public/assets/js/chunks/dist-VCFTF7Z6.js +1 -0
- package/public/assets/js/chunks/dist-VTO23SHH.js +1 -0
- package/public/assets/js/chunks/dist-XOODBV4L.js +1 -0
- package/public/assets/js/chunks/dist-ZFZNCRZY.js +1 -0
- package/public/assets/js/chunks/dockerfile-XCIKYOSI.js +1 -0
- package/public/assets/js/chunks/dtd-3XFH7W6Z.js +1 -0
- package/public/assets/js/chunks/dylan-3UWPKVOR.js +1 -0
- package/public/assets/js/chunks/ebnf-OLHTL3VN.js +1 -0
- package/public/assets/js/chunks/ecl-43LZ3ZRM.js +1 -0
- package/public/assets/js/chunks/editor-session-IHFTYG5D.js +22 -0
- package/public/assets/js/chunks/eiffel-ISPO2UJF.js +1 -0
- package/public/assets/js/chunks/el-GR-ZXDJ2OS4-WSCEIO6J.js +7 -0
- package/public/assets/js/chunks/elm-CLK576PK.js +1 -0
- package/public/assets/js/chunks/en-CTDJDZ6K-IC3QAUOI.js +1 -0
- package/public/assets/js/chunks/erDiagram-INFDFZHY-ZMS6H2TH.js +70 -0
- package/public/assets/js/chunks/erlang-AVQXQFOT.js +1 -0
- package/public/assets/js/chunks/es-ES-DYQHAD43-XGB5X5IM.js +7 -0
- package/public/assets/js/chunks/eu-ES-QDSYU5Y3-LA3JTIJ2.js +7 -0
- package/public/assets/js/chunks/excalidraw-mermaid-stub-NYXTOJ4H.js +1 -0
- package/public/assets/js/chunks/fa-IR-26LZG4PM-PFALMEDX.js +9 -0
- package/public/assets/js/chunks/factor-CRTVBD6Q.js +1 -0
- package/public/assets/js/chunks/fcl-FX24LKTH.js +1 -0
- package/public/assets/js/chunks/fi-FI-6YS4KDE4-ES5MV6P4.js +6 -0
- package/public/assets/js/chunks/flowDiagram-PKNHOUZH-QD4L5IE5.js +162 -0
- package/public/assets/js/chunks/forth-YKDKCTVS.js +1 -0
- package/public/assets/js/chunks/fortran-UJWC6SLU.js +1 -0
- package/public/assets/js/chunks/fr-FR-BRLLPTZC-VMFE22YV.js +12 -0
- package/public/assets/js/chunks/ganttDiagram-A5KZAMGK-VTMTQESP.js +292 -0
- package/public/assets/js/chunks/gas-MYEMWGRE.js +1 -0
- package/public/assets/js/chunks/gherkin-JWHAU2YG.js +1 -0
- package/public/assets/js/chunks/gitGraph-HDMCJU4V-YPHS74XX.js +1 -0
- package/public/assets/js/chunks/gitGraphDiagram-K3NZZRJ6-Z3EZ634T.js +65 -0
- package/public/assets/js/chunks/gl-ES-OKUZTLYG-GPT42ZHV.js +6 -0
- package/public/assets/js/chunks/groovy-QZIZQIAK.js +1 -0
- package/public/assets/js/chunks/haskell-JR3G7YNW.js +1 -0
- package/public/assets/js/chunks/haxe-TVLAIYEN.js +1 -0
- package/public/assets/js/chunks/he-IL-26MGYIU7-VQ5XQYYY.js +8 -0
- package/public/assets/js/chunks/hi-IN-Q4ZOGTP2-2Z766MXA.js +3 -0
- package/public/assets/js/chunks/http-YXQRE77G.js +1 -0
- package/public/assets/js/chunks/hu-HU-P2OXPSN5-6XDVPGTE.js +3 -0
- package/public/assets/js/chunks/id-ID-2EIKXYN6-J5GWSY2S.js +8 -0
- package/public/assets/js/chunks/idl-RAQGJ6LJ.js +1 -0
- package/public/assets/js/chunks/image-32MOCVDX-JN2EUMQG.js +1 -0
- package/public/assets/js/chunks/image-blob-reduce.esm-K5OWL55S.js +13 -0
- package/public/assets/js/chunks/info-3K5VOQVL-CXJSPNNP.js +1 -0
- package/public/assets/js/chunks/infoDiagram-LFFYTUFH-WQ34MUJA.js +2 -0
- package/public/assets/js/chunks/ishikawaDiagram-PHBUUO56-4IARWKJK.js +70 -0
- package/public/assets/js/chunks/it-IT-4CFKVXI2-NMBWUWFF.js +12 -0
- package/public/assets/js/chunks/ja-JP-MAND2Z4V-GQZYXXOC.js +7 -0
- package/public/assets/js/chunks/javascript-NM7KDJUE.js +1 -0
- package/public/assets/js/chunks/journeyDiagram-4ABVD52K-FJ4LF4SX.js +139 -0
- package/public/assets/js/chunks/julia-LG3BH25B.js +1 -0
- package/public/assets/js/chunks/kaa-HQRTCXTJ-7D6PAKDJ.js +1 -0
- package/public/assets/js/chunks/kab-KAB-JKIKKTGH-TNKFXNAX.js +4 -0
- package/public/assets/js/chunks/kanban-definition-K7BYSVSG-TY4EVYI3.js +89 -0
- package/public/assets/js/chunks/katex-5YJCUCFD.js +261 -0
- package/public/assets/js/chunks/kk-KZ-HXQ63ZFC-T4HCMWED.js +1 -0
- package/public/assets/js/chunks/km-KH-PKL3LSGX-HTLHEJV6.js +7 -0
- package/public/assets/js/chunks/ko-KR-KXLREZX3-QMR52QVI.js +5 -0
- package/public/assets/js/chunks/ku-TR-MJ4IER3X-K5CNY4UO.js +6 -0
- package/public/assets/js/chunks/livescript-4CVWVI4M.js +1 -0
- package/public/assets/js/chunks/lt-LT-H6WFQ6FJ-IW25FAGX.js +3 -0
- package/public/assets/js/chunks/lua-VWGE7DQ7.js +1 -0
- package/public/assets/js/chunks/lv-LV-GOCK6SJW-KTDFW5OH.js +4 -0
- package/public/assets/js/chunks/mathematica-D7APQSEU.js +1 -0
- package/public/assets/js/chunks/mbox-BN3XQBYX.js +1 -0
- package/public/assets/js/chunks/mermaid-runtime-BIFNJ2CT.js +18 -0
- package/public/assets/js/chunks/mindmap-definition-YRQLILUH-5B565RNP.js +68 -0
- package/public/assets/js/chunks/mirc-565WBI76.js +1 -0
- package/public/assets/js/chunks/mllike-VV3KS46B.js +1 -0
- package/public/assets/js/chunks/modelica-EGX44FZV.js +1 -0
- package/public/assets/js/chunks/mr-IN-IXVLDMEQ-PHM5DT7Q.js +9 -0
- package/public/assets/js/chunks/mscgen-GFGTHENT.js +1 -0
- package/public/assets/js/chunks/mumps-POZYWSMI.js +1 -0
- package/public/assets/js/chunks/my-MM-YG6MYTTD-ZHLCMEVA.js +1 -0
- package/public/assets/js/chunks/nb-NO-XGWJISD2-KSDFG6YU.js +8 -0
- package/public/assets/js/chunks/nginx-JUBX55EU.js +1 -0
- package/public/assets/js/chunks/nl-NL-XVDVCPNC-KVF3ZO2R.js +13 -0
- package/public/assets/js/chunks/nn-NO-EMX5MJX5-34QKSHNR.js +4 -0
- package/public/assets/js/chunks/nsis-RC4CREGM.js +1 -0
- package/public/assets/js/chunks/ntriples-4WK6CNVE.js +1 -0
- package/public/assets/js/chunks/oc-FR-ROEINTVO-5GP4AOYO.js +4 -0
- package/public/assets/js/chunks/octave-GOKFN2V7.js +1 -0
- package/public/assets/js/chunks/oz-OQUMNC63.js +1 -0
- package/public/assets/js/chunks/pa-IN-ZYN6SUDY-MVL7O44W.js +4 -0
- package/public/assets/js/chunks/packet-RMMSAZCW-D7XTR5TT.js +1 -0
- package/public/assets/js/chunks/pascal-BBWQWWWD.js +1 -0
- package/public/assets/js/chunks/percentages-5DKR754L-DG7W23CV.js +1 -0
- package/public/assets/js/chunks/perl-KTPJTTAM.js +1 -0
- package/public/assets/js/chunks/pica-6G3NROWT.js +17 -0
- package/public/assets/js/chunks/pie-UPGHQEXC-KGC3O6LN.js +1 -0
- package/public/assets/js/chunks/pieDiagram-SKSYHLDU-KWKRDEZS.js +30 -0
- package/public/assets/js/chunks/pig-IJMBS4FZ.js +1 -0
- package/public/assets/js/chunks/pl-PL-6VTG7PHC-VADRWSX4.js +12 -0
- package/public/assets/js/chunks/powershell-6YGCBHDP.js +1 -0
- package/public/assets/js/chunks/preview-render-compiler-WD3A76I6.js +25 -0
- package/public/assets/js/chunks/properties-5QTD3364.js +1 -0
- package/public/assets/js/chunks/protobuf-LTRWBIK3.js +1 -0
- package/public/assets/js/chunks/pt-BR-5YFKRR5G-HHF4UPO4.js +6 -0
- package/public/assets/js/chunks/pt-PT-GEIXXZ67-TUTAUZJK.js +8 -0
- package/public/assets/js/chunks/pug-U4PV3WLG.js +1 -0
- package/public/assets/js/chunks/puppet-WGYJPR3Y.js +1 -0
- package/public/assets/js/chunks/python-6YGH4S47.js +1 -0
- package/public/assets/js/chunks/q-VIG4IJLI.js +1 -0
- package/public/assets/js/chunks/quadrantDiagram-337W2JSQ-GWQRUFHQ.js +7 -0
- package/public/assets/js/chunks/quick-switcher-controller-JYDIJVAJ.js +5 -0
- package/public/assets/js/chunks/r-NVPCXGTR.js +1 -0
- package/public/assets/js/chunks/radar-KQ55EAFF-OPO64DRI.js +1 -0
- package/public/assets/js/chunks/requirementDiagram-Z7DCOOCP-ASW7IPJL.js +73 -0
- package/public/assets/js/chunks/ro-RO-E2P6TFZI-RJFCULYF.js +12 -0
- package/public/assets/js/chunks/roundRect-Z3DX3W5S.js +1 -0
- package/public/assets/js/chunks/rpm-UEA257HD.js +1 -0
- package/public/assets/js/chunks/ru-RU-YBIIY43T-BF27TNVK.js +10 -0
- package/public/assets/js/chunks/ruby-KPQRAJGE.js +1 -0
- package/public/assets/js/chunks/sankeyDiagram-WA2Y5GQK-W6BBWCLW.js +10 -0
- package/public/assets/js/chunks/sas-L7VATVH5.js +1 -0
- package/public/assets/js/chunks/scheme-T2NOWR3P.js +1 -0
- package/public/assets/js/chunks/sequenceDiagram-2WXFIKYE-H4G3ISLN.js +145 -0
- package/public/assets/js/chunks/shell-DLVDUNFA.js +1 -0
- package/public/assets/js/chunks/si-LK-673C2CI2-IOFGU4U2.js +1 -0
- package/public/assets/js/chunks/sieve-BKBZYDBU.js +1 -0
- package/public/assets/js/chunks/sk-SK-CKZHQ4AP-6O5JGN26.js +7 -0
- package/public/assets/js/chunks/sl-SI-557H2GWM-2NEHLV7W.js +6 -0
- package/public/assets/js/chunks/smalltalk-WRJQKJSD.js +1 -0
- package/public/assets/js/chunks/solr-66B3BIDL.js +1 -0
- package/public/assets/js/chunks/sparql-S25Z47JG.js +1 -0
- package/public/assets/js/chunks/spreadsheet-B272EF7Y.js +1 -0
- package/public/assets/js/chunks/sql-BPLIIUYC.js +1 -0
- package/public/assets/js/chunks/stateDiagram-RAJIS63D-OF5XXRUS.js +1 -0
- package/public/assets/js/chunks/stateDiagram-v2-FVOUBMTO-IV2CSQSQ.js +1 -0
- package/public/assets/js/chunks/stex-4IJY64QX.js +1 -0
- package/public/assets/js/chunks/stylus-PJUHLGPT.js +1 -0
- package/public/assets/js/chunks/subset-shared.chunk-4NMWHS4D.js +1 -0
- package/public/assets/js/chunks/subset-worker.chunk-NTLP7Y66.js +1 -0
- package/public/assets/js/chunks/sv-SE-XOPKKDWS-Q2L6KGFV.js +8 -0
- package/public/assets/js/chunks/swift-UYHTO4SX.js +1 -0
- package/public/assets/js/chunks/ta-IN-XBH7DQI3-ISSUGZAK.js +6 -0
- package/public/assets/js/chunks/tcl-OQ5J3VO2.js +1 -0
- package/public/assets/js/chunks/textile-NOGVBEYF.js +1 -0
- package/public/assets/js/chunks/th-TH-TOCWH3R4-TABEAMJA.js +1 -0
- package/public/assets/js/chunks/tiddlywiki-SYTK4QUE.js +1 -0
- package/public/assets/js/chunks/tiki-P7K4ZLOM.js +1 -0
- package/public/assets/js/chunks/timeline-definition-YZTLITO2-HBCANIUC.js +61 -0
- package/public/assets/js/chunks/toml-AUZYRP36.js +1 -0
- package/public/assets/js/chunks/tr-TR-GXW6CYY5-5NQRN52Y.js +4 -0
- package/public/assets/js/chunks/treemap-KZPCXAKY-WYMCT5F7.js +1 -0
- package/public/assets/js/chunks/troff-XFYJNQOJ.js +1 -0
- package/public/assets/js/chunks/ttcn-AK2IXWU6.js +1 -0
- package/public/assets/js/chunks/ttcn-cfg-3IDPIYPU.js +1 -0
- package/public/assets/js/chunks/turtle-OIDMF46P.js +1 -0
- package/public/assets/js/chunks/uk-UA-IJKTNUDG-2IIL3TO5.js +6 -0
- package/public/assets/js/chunks/uz-UZ-TBZZEA4V-X22KVKBP.js +1 -0
- package/public/assets/js/chunks/vb-J6K4XVA2.js +1 -0
- package/public/assets/js/chunks/vbscript-FM7DDZZE.js +1 -0
- package/public/assets/js/chunks/velocity-6KZFEOFD.js +1 -0
- package/public/assets/js/chunks/vennDiagram-LZ73GAT5-EBRF3MZR.js +34 -0
- package/public/assets/js/chunks/verilog-EWWQPMNN.js +1 -0
- package/public/assets/js/chunks/vhdl-CJ3M4IHI.js +1 -0
- package/public/assets/js/chunks/vi-VN-MULSGNVB-TENM65C7.js +7 -0
- package/public/assets/js/chunks/webidl-XVBHXCRV.js +1 -0
- package/public/assets/js/chunks/xquery-7WZOZ4UK.js +1 -0
- package/public/assets/js/chunks/xychartDiagram-JWTSCODW-WIFVRQPR.js +7 -0
- package/public/assets/js/chunks/yacas-MZ2ZZPF3.js +1 -0
- package/public/assets/js/chunks/z80-I447CBF7.js +1 -0
- package/public/assets/js/chunks/zh-CN-MVX3E32U-S5VA2BA5.js +11 -0
- package/public/assets/js/chunks/zh-HK-JNU5RLIE-A4VUKZFV.js +1 -0
- package/public/assets/js/chunks/zh-TW-LENVCA6T-KFB6KHMM.js +9 -0
- package/public/assets/js/excalidraw-editor-7ORML5YA.css +1 -0
- package/public/assets/js/excalidraw-editor-LKW2AZBU.js +347 -0
- package/public/assets/js/excalidraw-editor.css +1 -0
- package/public/assets/js/excalidraw-editor.js +1 -0
- package/public/assets/js/main.js +354 -0
- package/public/assets/js/preview-render-worker.js +30 -0
- package/public/assets/vendor/highlight/github-dark.min.css +10 -0
- package/public/assets/vendor/highlight/github.min.css +10 -0
- package/public/excalidraw-editor.html +31 -0
- package/public/index.html +549 -0
- package/scripts/cloudflare-tunnel.mjs +145 -0
- package/scripts/local-plantuml-compose.mjs +92 -0
- package/server.js +1 -0
- package/src/client/application/app-shell/chat-feature.js +363 -0
- package/src/client/application/app-shell/comments-feature.js +33 -0
- package/src/client/application/app-shell/git-feature.js +394 -0
- package/src/client/application/app-shell/presence-feature.js +229 -0
- package/src/client/application/app-shell/ui-feature.js +535 -0
- package/src/client/application/app-shell/workspace-feature.js +132 -0
- package/src/client/application/app-shell-elements.js +78 -0
- package/src/client/application/diagram-preview-hydrator.js +382 -0
- package/src/client/application/file-open-lifecycle.js +26 -0
- package/src/client/application/mermaid-preview-hydrator.js +570 -0
- package/src/client/application/plantuml-preview-hydrator.js +563 -0
- package/src/client/application/preview-diagram-utils.js +223 -0
- package/src/client/application/preview-render-compiler.js +426 -0
- package/src/client/application/preview-render-executor.js +153 -0
- package/src/client/application/preview-render-profile.js +63 -0
- package/src/client/application/preview-render-scheduler.js +73 -0
- package/src/client/application/preview-render-worker.js +19 -0
- package/src/client/application/preview-renderer.js +452 -0
- package/src/client/application/wiki-link-file-controller.js +58 -0
- package/src/client/application/workspace-chrome-controller.js +84 -0
- package/src/client/application/workspace-coordinator.js +238 -0
- package/src/client/application/workspace-preview-controller.js +237 -0
- package/src/client/application/workspace-route-controller.js +170 -0
- package/src/client/application/workspace-state-store.js +46 -0
- package/src/client/bootstrap/collabmd-app-shell.js +479 -0
- package/src/client/domain/diagram-action-icons.js +41 -0
- package/src/client/domain/excalidraw-collaboration.js +153 -0
- package/src/client/domain/excalidraw-scene.js +87 -0
- package/src/client/domain/markdown-formatting.js +370 -0
- package/src/client/domain/plantuml-language.js +226 -0
- package/src/client/domain/room.js +49 -0
- package/src/client/domain/runtime-paths.js +136 -0
- package/src/client/domain/vault-api-client.js +1 -0
- package/src/client/domain/vault-paths.js +80 -0
- package/src/client/domain/vault-utils.js +49 -0
- package/src/client/domain/wiki-link-completions.js +78 -0
- package/src/client/excalidraw-editor.js +630 -0
- package/src/client/excalidraw-mermaid-stub.js +7 -0
- package/src/client/infrastructure/auth-client.js +383 -0
- package/src/client/infrastructure/browser-navigation-port.js +19 -0
- package/src/client/infrastructure/browser-notification-port.js +40 -0
- package/src/client/infrastructure/browser-preferences-port.js +79 -0
- package/src/client/infrastructure/comment-thread-store.js +293 -0
- package/src/client/infrastructure/editor-collaboration-client.js +240 -0
- package/src/client/infrastructure/editor-session.js +255 -0
- package/src/client/infrastructure/editor-view-adapter.js +578 -0
- package/src/client/infrastructure/excalidraw-room-client.js +651 -0
- package/src/client/infrastructure/lobby-presence.js +304 -0
- package/src/client/infrastructure/runtime-config.js +65 -0
- package/src/client/infrastructure/tab-activity-lock.js +193 -0
- package/src/client/infrastructure/vault-api-client.js +61 -0
- package/src/client/infrastructure/yjs-provider-reset-guard.js +19 -0
- package/src/client/main.js +16 -0
- package/src/client/mermaid-runtime.js +3 -0
- package/src/client/presentation/backlinks-panel.js +188 -0
- package/src/client/presentation/comment-ui-controller.js +1235 -0
- package/src/client/presentation/comments-panel.js +531 -0
- package/src/client/presentation/excalidraw-embed-controller.js +968 -0
- package/src/client/presentation/excalidraw-embed-reconciler.js +37 -0
- package/src/client/presentation/file-action-controller.js +596 -0
- package/src/client/presentation/file-explorer-controller.js +81 -0
- package/src/client/presentation/file-explorer-view.js +256 -0
- package/src/client/presentation/file-tree-state.js +77 -0
- package/src/client/presentation/git-diff-view-controller.js +656 -0
- package/src/client/presentation/git-panel-controller.js +516 -0
- package/src/client/presentation/layout-controller.js +222 -0
- package/src/client/presentation/outline-controller.js +239 -0
- package/src/client/presentation/quick-switcher-controller.js +300 -0
- package/src/client/presentation/scroll-sync-controller.js +500 -0
- package/src/client/presentation/theme-controller.js +64 -0
- package/src/client/presentation/toast-controller.js +21 -0
- package/src/client/presentation/video-embed-controller.js +264 -0
- package/src/client/styles/base.css +58 -0
- package/src/client/styles/style.css +4245 -0
- package/src/domain/comment-threads.js +233 -0
- package/src/domain/excalidraw-room-codec.js +427 -0
- package/src/domain/file-kind.js +104 -0
- package/src/domain/wiki-link-resolver.js +75 -0
- package/src/server/auth/create-auth-service.js +272 -0
- package/src/server/auth/session-cookie.js +125 -0
- package/src/server/config/env.js +186 -0
- package/src/server/create-app-server.js +143 -0
- package/src/server/domain/backlink-index.js +291 -0
- package/src/server/domain/collaboration/collaboration-document-store.js +155 -0
- package/src/server/domain/collaboration/collaboration-room.js +603 -0
- package/src/server/domain/collaboration/protocol.js +2 -0
- package/src/server/domain/collaboration/room-client-state-store.js +28 -0
- package/src/server/domain/collaboration/room-persistence-controller.js +80 -0
- package/src/server/domain/collaboration/room-registry.js +94 -0
- package/src/server/domain/git-service.js +1 -0
- package/src/server/domain/plantuml-encoder.js +49 -0
- package/src/server/domain/plantuml-renderer.js +1 -0
- package/src/server/index.js +72 -0
- package/src/server/infrastructure/git/command-runner.js +48 -0
- package/src/server/infrastructure/git/concurrency.js +19 -0
- package/src/server/infrastructure/git/diff-service.js +389 -0
- package/src/server/infrastructure/git/errors.js +5 -0
- package/src/server/infrastructure/git/git-service.js +216 -0
- package/src/server/infrastructure/git/parsers.js +401 -0
- package/src/server/infrastructure/git/path-utils.js +65 -0
- package/src/server/infrastructure/git/responses.js +108 -0
- package/src/server/infrastructure/git/status-service.js +99 -0
- package/src/server/infrastructure/git/untracked-files.js +101 -0
- package/src/server/infrastructure/http/create-auth-api-handler.js +48 -0
- package/src/server/infrastructure/http/create-esm-proxy-handler.js +130 -0
- package/src/server/infrastructure/http/create-git-api-command-handler.js +170 -0
- package/src/server/infrastructure/http/create-git-api-handler.js +40 -0
- package/src/server/infrastructure/http/create-git-api-query-handler.js +62 -0
- package/src/server/infrastructure/http/create-plantuml-api-handler.js +43 -0
- package/src/server/infrastructure/http/create-request-handler.js +138 -0
- package/src/server/infrastructure/http/create-static-handler.js +167 -0
- package/src/server/infrastructure/http/create-vault-api-command-handler.js +161 -0
- package/src/server/infrastructure/http/create-vault-api-handler.js +43 -0
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +82 -0
- package/src/server/infrastructure/http/http-errors.js +13 -0
- package/src/server/infrastructure/http/http-response.js +167 -0
- package/src/server/infrastructure/http/request-body.js +56 -0
- package/src/server/infrastructure/persistence/path-utils.js +90 -0
- package/src/server/infrastructure/persistence/sidecar-store.js +150 -0
- package/src/server/infrastructure/persistence/vault-content-adapter.js +49 -0
- package/src/server/infrastructure/persistence/vault-file-store.js +435 -0
- package/src/server/infrastructure/plantuml/plantuml-renderer.js +56 -0
- package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +194 -0
- package/src/server/infrastructure/websocket/client-socket-session.js +151 -0
- package/src/server/startup/git-remote-bootstrap.js +435 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
import { clamp } from '../domain/vault-utils.js';
|
|
2
|
+
import { setDiagramActionButtonIcon } from '../domain/diagram-action-icons.js';
|
|
3
|
+
import { DiagramPreviewHydrator } from './diagram-preview-hydrator.js';
|
|
4
|
+
import {
|
|
5
|
+
createMermaidPlaceholderCard,
|
|
6
|
+
createMermaidPlaceholderCardWithMessage,
|
|
7
|
+
easeOutCubic,
|
|
8
|
+
getFrameViewportSize,
|
|
9
|
+
MERMAID_BATCH_SIZE,
|
|
10
|
+
MERMAID_ZOOM,
|
|
11
|
+
normalizeMermaidSvg,
|
|
12
|
+
} from './preview-diagram-utils.js';
|
|
13
|
+
|
|
14
|
+
export class MermaidPreviewHydrator extends DiagramPreviewHydrator {
|
|
15
|
+
constructor(renderer) {
|
|
16
|
+
super(renderer, {
|
|
17
|
+
batchSize: MERMAID_BATCH_SIZE,
|
|
18
|
+
datasetKeys: {
|
|
19
|
+
hydrated: 'mermaidHydrated',
|
|
20
|
+
instanceId: 'mermaidInstanceId',
|
|
21
|
+
key: 'mermaidKey',
|
|
22
|
+
label: 'mermaidLabel',
|
|
23
|
+
queued: 'mermaidQueued',
|
|
24
|
+
sourceHash: 'mermaidSourceHash',
|
|
25
|
+
sourceLine: 'sourceLine',
|
|
26
|
+
sourceLineEnd: 'sourceLineEnd',
|
|
27
|
+
target: 'mermaidTarget',
|
|
28
|
+
},
|
|
29
|
+
filePathLabel: 'Mermaid',
|
|
30
|
+
shellClassName: 'mermaid-shell',
|
|
31
|
+
sourceClassName: 'mermaid-source',
|
|
32
|
+
});
|
|
33
|
+
this.renderer = renderer;
|
|
34
|
+
this.currentTheme = document.documentElement?.dataset.theme === 'light' ? 'light' : 'dark';
|
|
35
|
+
this.loader = null;
|
|
36
|
+
this.runtime = null;
|
|
37
|
+
this.shellRefits = new WeakMap();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
applyTheme(theme) {
|
|
41
|
+
this.currentTheme = theme;
|
|
42
|
+
const mermaid = this.runtime;
|
|
43
|
+
if (!mermaid) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.configureMermaid(mermaid);
|
|
48
|
+
this.resetHydratedShells();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
configureMermaid(mermaid) {
|
|
52
|
+
mermaid.initialize({
|
|
53
|
+
startOnLoad: false,
|
|
54
|
+
flowchart: {
|
|
55
|
+
defaultRenderer: 'dagre-wrapper',
|
|
56
|
+
useMaxWidth: true,
|
|
57
|
+
},
|
|
58
|
+
class: {
|
|
59
|
+
defaultRenderer: 'dagre-wrapper',
|
|
60
|
+
useMaxWidth: true,
|
|
61
|
+
},
|
|
62
|
+
theme: this.currentTheme === 'dark' ? 'dark' : 'default',
|
|
63
|
+
themeVariables: this.currentTheme === 'dark' ? {
|
|
64
|
+
background: '#161822',
|
|
65
|
+
clusterBkg: '#1a1c28',
|
|
66
|
+
edgeLabelBackground: '#161822',
|
|
67
|
+
lineColor: '#8b8ba0',
|
|
68
|
+
mainBkg: '#1c1e2c',
|
|
69
|
+
nodeBorder: '#383a50',
|
|
70
|
+
primaryBorderColor: '#383a50',
|
|
71
|
+
primaryColor: '#818cf8',
|
|
72
|
+
primaryTextColor: '#e2e2ea',
|
|
73
|
+
secondaryColor: '#1c1e2c',
|
|
74
|
+
tertiaryColor: '#161822',
|
|
75
|
+
titleColor: '#e2e2ea',
|
|
76
|
+
} : {},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
ensureMermaid() {
|
|
81
|
+
if (this.runtime) {
|
|
82
|
+
this.configureMermaid(this.runtime);
|
|
83
|
+
return Promise.resolve(this.runtime);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (this.loader) {
|
|
87
|
+
return this.loader;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this.loader = import('../mermaid-runtime.js')
|
|
91
|
+
.then((module) => {
|
|
92
|
+
const mermaid = module?.default;
|
|
93
|
+
if (!mermaid) {
|
|
94
|
+
throw new Error('Mermaid runtime failed to initialize');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this.runtime = mermaid;
|
|
98
|
+
this.configureMermaid(mermaid);
|
|
99
|
+
return mermaid;
|
|
100
|
+
})
|
|
101
|
+
.catch((error) => {
|
|
102
|
+
this.loader = null;
|
|
103
|
+
this.runtime = null;
|
|
104
|
+
throw new Error(error instanceof Error ? error.message : 'Failed to load Mermaid runtime');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return this.loader;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
handleReconcile({ restoredMaximizedShell }) {
|
|
111
|
+
if (restoredMaximizedShell) {
|
|
112
|
+
document.body.classList.add('mermaid-maximized-open');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async prepareHydrationBatch() {
|
|
117
|
+
return this.ensureMermaid();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
handlePrepareHydrationBatchError(_shells, error) {
|
|
121
|
+
console.warn('[preview] Mermaid runtime failed to load:', error);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async hydrateShell(shell, mermaid) {
|
|
125
|
+
if (!mermaid || !shell?.isConnected || this.isShellHydrated(shell)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
let sourceNode = shell.querySelector('.mermaid-source');
|
|
130
|
+
if (!sourceNode) {
|
|
131
|
+
sourceNode = document.createElement('span');
|
|
132
|
+
sourceNode.className = 'mermaid-source';
|
|
133
|
+
sourceNode.hidden = true;
|
|
134
|
+
shell.appendChild(sourceNode);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let source = sourceNode.textContent ?? '';
|
|
138
|
+
try {
|
|
139
|
+
if (!source.trim() && shell.dataset.mermaidTarget) {
|
|
140
|
+
source = await this.fetchSource(shell.dataset.mermaidTarget);
|
|
141
|
+
if (!shell.isConnected) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
sourceNode.textContent = source;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (!source.trim()) {
|
|
148
|
+
throw new Error(shell.dataset.mermaidTarget ? 'Mermaid file is empty' : 'Mermaid source is empty');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
source = this.prepareSource(source);
|
|
152
|
+
|
|
153
|
+
shell.querySelector('.mermaid-placeholder-card')?.remove();
|
|
154
|
+
|
|
155
|
+
const diagram = document.createElement('div');
|
|
156
|
+
diagram.className = 'mermaid mermaid-render-node';
|
|
157
|
+
diagram.id = shell.dataset.mermaidKey || `mermaid-${Date.now()}`;
|
|
158
|
+
const sourceLine = shell.getAttribute('data-source-line');
|
|
159
|
+
const sourceLineEnd = shell.getAttribute('data-source-line-end');
|
|
160
|
+
if (sourceLine) {
|
|
161
|
+
diagram.setAttribute('data-source-line', sourceLine);
|
|
162
|
+
}
|
|
163
|
+
if (sourceLineEnd) {
|
|
164
|
+
diagram.setAttribute('data-source-line-end', sourceLineEnd);
|
|
165
|
+
}
|
|
166
|
+
diagram.textContent = source;
|
|
167
|
+
shell.appendChild(diagram);
|
|
168
|
+
|
|
169
|
+
await mermaid.run({ nodes: [diagram] });
|
|
170
|
+
if (!diagram.isConnected || shell !== diagram.parentElement) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
this.enhanceDiagram(shell, diagram);
|
|
175
|
+
this.markShellHydrated(shell);
|
|
176
|
+
} catch (error) {
|
|
177
|
+
console.warn('[preview] Mermaid render failed:', error);
|
|
178
|
+
shell.querySelector(':scope > .mermaid-toolbar')?.remove();
|
|
179
|
+
shell.querySelector(':scope > .mermaid-frame')?.remove();
|
|
180
|
+
shell.querySelector(':scope > .mermaid-render-node')?.remove();
|
|
181
|
+
if (!shell.querySelector('.mermaid-placeholder-card')) {
|
|
182
|
+
sourceNode?.after(createMermaidPlaceholderCardWithMessage(shell.dataset.mermaidKey || 'mermaid', {
|
|
183
|
+
label: shell.dataset.mermaidLabel || 'Mermaid diagram',
|
|
184
|
+
message: error instanceof Error ? error.message : 'Render failed',
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
prepareSource(source) {
|
|
191
|
+
let text = String(source ?? '');
|
|
192
|
+
|
|
193
|
+
if (!/%%\{[\s\S]*?\binit\s*:/m.test(text)) {
|
|
194
|
+
const initConfig = this.getPreviewInitConfig(text);
|
|
195
|
+
if (initConfig) {
|
|
196
|
+
text = `%%{init: ${JSON.stringify(initConfig)}}%%\n${text}`;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (!/^\s*gantt\b/m.test(text) || /\btodayMarker\b/.test(text)) {
|
|
201
|
+
return text;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const lines = text.split('\n');
|
|
205
|
+
const ganttLineIndex = lines.findIndex((line) => /^\s*gantt\b/.test(line));
|
|
206
|
+
if (ganttLineIndex === -1) {
|
|
207
|
+
return text;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
lines.splice(ganttLineIndex + 1, 0, ' todayMarker off');
|
|
211
|
+
return lines.join('\n');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
getPreviewInitConfig(source) {
|
|
215
|
+
if (/^\s*stateDiagram(?:-v2)?\b/m.test(source)) {
|
|
216
|
+
return {
|
|
217
|
+
htmlLabels: false,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (/^\s*classDiagram\b/m.test(source)) {
|
|
222
|
+
return {
|
|
223
|
+
htmlLabels: false,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (/^\s*gantt\b/m.test(source)) {
|
|
228
|
+
return {
|
|
229
|
+
htmlLabels: false,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
resetHydratedShells() {
|
|
237
|
+
const previewElement = this.renderer.previewElement;
|
|
238
|
+
if (!previewElement) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const hydratedShells = Array.from(previewElement.querySelectorAll('.mermaid-shell[data-mermaid-hydrated="true"]'));
|
|
243
|
+
if (hydratedShells.length === 0) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
hydratedShells.forEach((shell) => {
|
|
248
|
+
this.shellRefits.delete(shell);
|
|
249
|
+
shell.removeAttribute('data-mermaid-hydrated');
|
|
250
|
+
shell.querySelector(':scope > .mermaid-toolbar')?.remove();
|
|
251
|
+
shell.querySelector(':scope > .mermaid-frame')?.remove();
|
|
252
|
+
shell.querySelector(':scope > .mermaid-render-node')?.remove();
|
|
253
|
+
if (!shell.querySelector('.mermaid-placeholder-card')) {
|
|
254
|
+
shell.querySelector('.mermaid-source')?.after(createMermaidPlaceholderCard(shell.dataset.mermaidKey || 'mermaid'));
|
|
255
|
+
}
|
|
256
|
+
this.enqueueShell(shell, { prioritize: true });
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
enhanceDiagram(shell, renderedDiagram) {
|
|
261
|
+
const svg = renderedDiagram.querySelector('svg');
|
|
262
|
+
if (!svg) {
|
|
263
|
+
renderedDiagram.remove();
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const toolbar = document.createElement('div');
|
|
268
|
+
toolbar.className = 'mermaid-toolbar diagram-preview-toolbar';
|
|
269
|
+
|
|
270
|
+
const decreaseButton = this.createZoomButton('−', 'Zoom out');
|
|
271
|
+
const increaseButton = this.createZoomButton('+', 'Zoom in');
|
|
272
|
+
const resetButton = this.createZoomButton('Reset', 'Reset zoom');
|
|
273
|
+
const maximizeButton = this.createZoomButton('Max', 'Maximize diagram');
|
|
274
|
+
maximizeButton.classList.add('mermaid-maximize-btn');
|
|
275
|
+
setDiagramActionButtonIcon(maximizeButton, 'maximize');
|
|
276
|
+
const zoomLabel = document.createElement('span');
|
|
277
|
+
zoomLabel.className = 'mermaid-zoom-label diagram-preview-zoom-label';
|
|
278
|
+
zoomLabel.setAttribute('aria-live', 'polite');
|
|
279
|
+
|
|
280
|
+
toolbar.append(decreaseButton, zoomLabel, resetButton, increaseButton, maximizeButton);
|
|
281
|
+
|
|
282
|
+
const frame = document.createElement('div');
|
|
283
|
+
frame.className = 'mermaid-frame diagram-preview-frame';
|
|
284
|
+
|
|
285
|
+
const { width: baseWidth, height: baseHeight } = normalizeMermaidSvg(svg);
|
|
286
|
+
let currentZoom = MERMAID_ZOOM.default;
|
|
287
|
+
let defaultZoom = 1;
|
|
288
|
+
let zoomAnimationFrameId = null;
|
|
289
|
+
let resetZoomFrameId = null;
|
|
290
|
+
let hasManualZoom = false;
|
|
291
|
+
let lastAutoFitViewportWidth = 0;
|
|
292
|
+
let isPanning = false;
|
|
293
|
+
let activePointerId = null;
|
|
294
|
+
let panStartX = 0;
|
|
295
|
+
let panStartY = 0;
|
|
296
|
+
let panStartScrollLeft = 0;
|
|
297
|
+
let panStartScrollTop = 0;
|
|
298
|
+
|
|
299
|
+
svg.style.display = 'block';
|
|
300
|
+
svg.style.margin = '0 auto';
|
|
301
|
+
svg.style.maxWidth = 'none';
|
|
302
|
+
|
|
303
|
+
const calculateDefaultZoom = () => {
|
|
304
|
+
const viewport = getFrameViewportSize(frame);
|
|
305
|
+
if (!Number.isFinite(baseWidth) || baseWidth <= 0 || viewport.width <= 0) {
|
|
306
|
+
return MERMAID_ZOOM.default;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const fittedZoom = viewport.width / baseWidth;
|
|
310
|
+
if (!Number.isFinite(fittedZoom) || fittedZoom <= 0) {
|
|
311
|
+
return MERMAID_ZOOM.default;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
return clamp(fittedZoom, MERMAID_ZOOM.min, MERMAID_ZOOM.max);
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
const applyZoom = (nextZoom) => {
|
|
318
|
+
currentZoom = clamp(nextZoom, MERMAID_ZOOM.min, MERMAID_ZOOM.max);
|
|
319
|
+
svg.style.width = `${baseWidth * currentZoom}px`;
|
|
320
|
+
svg.style.height = `${baseHeight * currentZoom}px`;
|
|
321
|
+
|
|
322
|
+
zoomLabel.textContent = `${Math.round(currentZoom * 100)}%`;
|
|
323
|
+
|
|
324
|
+
decreaseButton.disabled = currentZoom <= MERMAID_ZOOM.min;
|
|
325
|
+
increaseButton.disabled = currentZoom >= MERMAID_ZOOM.max;
|
|
326
|
+
|
|
327
|
+
const viewport = getFrameViewportSize(frame);
|
|
328
|
+
const isPannable = (baseWidth * currentZoom) > viewport.width || (baseHeight * currentZoom) > viewport.height;
|
|
329
|
+
frame.classList.toggle('is-pannable', isPannable);
|
|
330
|
+
svg.style.margin = isPannable ? '0' : '0 auto';
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
const getViewportCenter = () => ({
|
|
334
|
+
x: frame.scrollLeft + (frame.clientWidth / 2),
|
|
335
|
+
y: frame.scrollTop + (frame.clientHeight / 2),
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
const restoreViewportCenter = (previousZoom, nextZoom, center) => {
|
|
339
|
+
if (previousZoom === 0) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const scale = nextZoom / previousZoom;
|
|
344
|
+
frame.scrollLeft = (center.x * scale) - (frame.clientWidth / 2);
|
|
345
|
+
frame.scrollTop = (center.y * scale) - (frame.clientHeight / 2);
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const animateZoomTo = (nextZoom) => {
|
|
349
|
+
const targetZoom = clamp(nextZoom, MERMAID_ZOOM.min, MERMAID_ZOOM.max);
|
|
350
|
+
const startZoom = currentZoom;
|
|
351
|
+
|
|
352
|
+
if (targetZoom === startZoom) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
const center = getViewportCenter();
|
|
357
|
+
const startedAt = performance.now();
|
|
358
|
+
|
|
359
|
+
if (zoomAnimationFrameId) {
|
|
360
|
+
cancelAnimationFrame(zoomAnimationFrameId);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const tick = (now) => {
|
|
364
|
+
const progress = clamp((now - startedAt) / MERMAID_ZOOM.animationDurationMs, 0, 1);
|
|
365
|
+
const easedProgress = easeOutCubic(progress);
|
|
366
|
+
const animatedZoom = startZoom + ((targetZoom - startZoom) * easedProgress);
|
|
367
|
+
|
|
368
|
+
applyZoom(animatedZoom);
|
|
369
|
+
restoreViewportCenter(startZoom, animatedZoom, center);
|
|
370
|
+
|
|
371
|
+
if (progress < 1) {
|
|
372
|
+
zoomAnimationFrameId = requestAnimationFrame(tick);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
zoomAnimationFrameId = null;
|
|
377
|
+
applyZoom(targetZoom);
|
|
378
|
+
restoreViewportCenter(startZoom, targetZoom, center);
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
zoomAnimationFrameId = requestAnimationFrame(tick);
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
const zoomBy = (delta) => {
|
|
385
|
+
hasManualZoom = true;
|
|
386
|
+
animateZoomTo(currentZoom + delta);
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
const resetZoomToFit = ({ animate = false } = {}) => {
|
|
390
|
+
defaultZoom = calculateDefaultZoom();
|
|
391
|
+
hasManualZoom = false;
|
|
392
|
+
lastAutoFitViewportWidth = getFrameViewportSize(frame).width;
|
|
393
|
+
|
|
394
|
+
if (animate && Math.abs(defaultZoom - currentZoom) > 0.001) {
|
|
395
|
+
animateZoomTo(defaultZoom);
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
if (zoomAnimationFrameId) {
|
|
400
|
+
cancelAnimationFrame(zoomAnimationFrameId);
|
|
401
|
+
zoomAnimationFrameId = null;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
applyZoom(defaultZoom);
|
|
405
|
+
frame.scrollLeft = 0;
|
|
406
|
+
frame.scrollTop = 0;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
const scheduleResetZoomToFit = ({ force = false } = {}) => {
|
|
410
|
+
if (resetZoomFrameId) {
|
|
411
|
+
cancelAnimationFrame(resetZoomFrameId);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
resetZoomFrameId = requestAnimationFrame(() => {
|
|
415
|
+
resetZoomFrameId = null;
|
|
416
|
+
if (!shell.isConnected) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const viewportWidth = getFrameViewportSize(frame).width;
|
|
421
|
+
const viewportChanged = Math.abs(viewportWidth - lastAutoFitViewportWidth) > 1;
|
|
422
|
+
if (!force && hasManualZoom) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
if (!force && lastAutoFitViewportWidth > 0 && !viewportChanged) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
resetZoomToFit();
|
|
430
|
+
});
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
this.shellRefits.set(shell, scheduleResetZoomToFit);
|
|
434
|
+
|
|
435
|
+
decreaseButton.addEventListener('click', () => zoomBy(-MERMAID_ZOOM.step));
|
|
436
|
+
increaseButton.addEventListener('click', () => zoomBy(MERMAID_ZOOM.step));
|
|
437
|
+
resetButton.addEventListener('click', () => {
|
|
438
|
+
resetZoomToFit({ animate: true });
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
const syncMaximizeButtonState = () => {
|
|
442
|
+
const isMaximized = shell.classList.contains('is-maximized');
|
|
443
|
+
setDiagramActionButtonIcon(maximizeButton, isMaximized ? 'restore' : 'maximize');
|
|
444
|
+
const label = isMaximized ? 'Restore diagram size' : 'Maximize diagram';
|
|
445
|
+
maximizeButton.setAttribute('aria-label', label);
|
|
446
|
+
maximizeButton.title = label;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
const setMaximizedState = (shouldMaximize) => {
|
|
450
|
+
const previewElement = this.renderer.previewElement;
|
|
451
|
+
if (shouldMaximize) {
|
|
452
|
+
const activeContainer = previewElement.querySelector('.mermaid-shell.is-maximized');
|
|
453
|
+
if (activeContainer && activeContainer !== shell) {
|
|
454
|
+
activeContainer.classList.remove('is-maximized');
|
|
455
|
+
this.shellRefits.get(activeContainer)?.();
|
|
456
|
+
const activeButton = activeContainer.querySelector('.mermaid-maximize-btn');
|
|
457
|
+
if (activeButton) {
|
|
458
|
+
setDiagramActionButtonIcon(activeButton, 'maximize');
|
|
459
|
+
activeButton.setAttribute('aria-label', 'Maximize diagram');
|
|
460
|
+
activeButton.title = 'Maximize diagram';
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
shell.classList.add('is-maximized');
|
|
464
|
+
document.body.classList.add('mermaid-maximized-open');
|
|
465
|
+
syncMaximizeButtonState();
|
|
466
|
+
scheduleResetZoomToFit({ force: true });
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
shell.classList.remove('is-maximized');
|
|
471
|
+
if (!previewElement.querySelector('.mermaid-shell.is-maximized')) {
|
|
472
|
+
document.body.classList.remove('mermaid-maximized-open');
|
|
473
|
+
}
|
|
474
|
+
syncMaximizeButtonState();
|
|
475
|
+
scheduleResetZoomToFit({ force: true });
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
syncMaximizeButtonState();
|
|
479
|
+
maximizeButton.addEventListener('click', () => {
|
|
480
|
+
setMaximizedState(!shell.classList.contains('is-maximized'));
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
const stopPanning = () => {
|
|
484
|
+
if (!isPanning) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
isPanning = false;
|
|
489
|
+
frame.classList.remove('is-dragging');
|
|
490
|
+
|
|
491
|
+
if (activePointerId !== null && typeof frame.releasePointerCapture === 'function') {
|
|
492
|
+
try {
|
|
493
|
+
frame.releasePointerCapture(activePointerId);
|
|
494
|
+
} catch {
|
|
495
|
+
// Ignore capture release issues during drag end.
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
activePointerId = null;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
frame.addEventListener('pointerdown', (event) => {
|
|
503
|
+
if (event.button !== 0 || !frame.classList.contains('is-pannable')) {
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if (zoomAnimationFrameId) {
|
|
508
|
+
cancelAnimationFrame(zoomAnimationFrameId);
|
|
509
|
+
zoomAnimationFrameId = null;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
isPanning = true;
|
|
513
|
+
activePointerId = event.pointerId;
|
|
514
|
+
panStartX = event.clientX;
|
|
515
|
+
panStartY = event.clientY;
|
|
516
|
+
panStartScrollLeft = frame.scrollLeft;
|
|
517
|
+
panStartScrollTop = frame.scrollTop;
|
|
518
|
+
|
|
519
|
+
frame.classList.add('is-dragging');
|
|
520
|
+
frame.setPointerCapture?.(event.pointerId);
|
|
521
|
+
event.preventDefault();
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
frame.addEventListener('pointermove', (event) => {
|
|
525
|
+
if (!isPanning) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
frame.scrollLeft = panStartScrollLeft - (event.clientX - panStartX);
|
|
530
|
+
frame.scrollTop = panStartScrollTop - (event.clientY - panStartY);
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
frame.addEventListener('pointerup', stopPanning);
|
|
534
|
+
frame.addEventListener('pointercancel', stopPanning);
|
|
535
|
+
frame.addEventListener('lostpointercapture', stopPanning);
|
|
536
|
+
|
|
537
|
+
frame.appendChild(svg);
|
|
538
|
+
const sourceNode = shell.querySelector('.mermaid-source');
|
|
539
|
+
renderedDiagram.remove();
|
|
540
|
+
shell.replaceChildren();
|
|
541
|
+
if (sourceNode) {
|
|
542
|
+
sourceNode.hidden = true;
|
|
543
|
+
shell.appendChild(sourceNode);
|
|
544
|
+
}
|
|
545
|
+
shell.append(toolbar, frame);
|
|
546
|
+
|
|
547
|
+
scheduleResetZoomToFit({ force: true });
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
scheduleActiveRefit() {
|
|
551
|
+
const previewElement = this.renderer.previewElement;
|
|
552
|
+
if (!previewElement) {
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
Array.from(previewElement.querySelectorAll('.mermaid-shell[data-mermaid-hydrated="true"]')).forEach((shell) => {
|
|
557
|
+
this.shellRefits.get(shell)?.();
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
createZoomButton(label, ariaLabel) {
|
|
562
|
+
const button = document.createElement('button');
|
|
563
|
+
button.type = 'button';
|
|
564
|
+
button.className = 'mermaid-zoom-btn diagram-preview-action-btn';
|
|
565
|
+
button.setAttribute('aria-label', ariaLabel);
|
|
566
|
+
button.title = ariaLabel;
|
|
567
|
+
button.textContent = label;
|
|
568
|
+
return button;
|
|
569
|
+
}
|
|
570
|
+
}
|