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,479 @@
|
|
|
1
|
+
import { PreviewRenderer } from '../application/preview-renderer.js';
|
|
2
|
+
import { WorkspaceRouteController } from '../application/workspace-route-controller.js';
|
|
3
|
+
import { WikiLinkFileController } from '../application/wiki-link-file-controller.js';
|
|
4
|
+
import { WorkspacePreviewController } from '../application/workspace-preview-controller.js';
|
|
5
|
+
import { WorkspaceCoordinator } from '../application/workspace-coordinator.js';
|
|
6
|
+
import { WorkspaceStateStore } from '../application/workspace-state-store.js';
|
|
7
|
+
import { bindAppShellElements } from '../application/app-shell-elements.js';
|
|
8
|
+
import { chatFeature } from '../application/app-shell/chat-feature.js';
|
|
9
|
+
import { commentsFeature } from '../application/app-shell/comments-feature.js';
|
|
10
|
+
import { gitFeature } from '../application/app-shell/git-feature.js';
|
|
11
|
+
import { presenceFeature } from '../application/app-shell/presence-feature.js';
|
|
12
|
+
import { uiFeature } from '../application/app-shell/ui-feature.js';
|
|
13
|
+
import { workspaceFeature } from '../application/app-shell/workspace-feature.js';
|
|
14
|
+
import { LOBBY_CHAT_MESSAGE_MAX_LENGTH, LobbyPresence } from '../infrastructure/lobby-presence.js';
|
|
15
|
+
import { BrowserNavigationPort } from '../infrastructure/browser-navigation-port.js';
|
|
16
|
+
import { BrowserNotificationPort } from '../infrastructure/browser-notification-port.js';
|
|
17
|
+
import { BrowserPreferencesPort } from '../infrastructure/browser-preferences-port.js';
|
|
18
|
+
import { getRuntimeConfig } from '../infrastructure/runtime-config.js';
|
|
19
|
+
import { TabActivityLock } from '../infrastructure/tab-activity-lock.js';
|
|
20
|
+
import { vaultApiClient } from '../infrastructure/vault-api-client.js';
|
|
21
|
+
import { BacklinksPanel } from '../presentation/backlinks-panel.js';
|
|
22
|
+
import { CommentUiController } from '../presentation/comment-ui-controller.js';
|
|
23
|
+
import { ExcalidrawEmbedController } from '../presentation/excalidraw-embed-controller.js';
|
|
24
|
+
import { FileExplorerController } from '../presentation/file-explorer-controller.js';
|
|
25
|
+
import { GitDiffViewController } from '../presentation/git-diff-view-controller.js';
|
|
26
|
+
import { GitPanelController } from '../presentation/git-panel-controller.js';
|
|
27
|
+
import { LayoutController } from '../presentation/layout-controller.js';
|
|
28
|
+
import { OutlineController } from '../presentation/outline-controller.js';
|
|
29
|
+
import { ScrollSyncController } from '../presentation/scroll-sync-controller.js';
|
|
30
|
+
import { ThemeController } from '../presentation/theme-controller.js';
|
|
31
|
+
import { ToastController } from '../presentation/toast-controller.js';
|
|
32
|
+
import { VideoEmbedController } from '../presentation/video-embed-controller.js';
|
|
33
|
+
|
|
34
|
+
const APP_SHELL_FEATURES = Object.freeze({
|
|
35
|
+
chat: chatFeature,
|
|
36
|
+
comments: commentsFeature,
|
|
37
|
+
git: gitFeature,
|
|
38
|
+
presence: presenceFeature,
|
|
39
|
+
ui: uiFeature,
|
|
40
|
+
workspace: workspaceFeature,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
function installAppShellFeatures(appShell) {
|
|
44
|
+
const featureMethodOwners = {};
|
|
45
|
+
|
|
46
|
+
Object.entries(APP_SHELL_FEATURES).forEach(([featureName, feature]) => {
|
|
47
|
+
Object.entries(feature).forEach(([methodName, method]) => {
|
|
48
|
+
if (typeof method !== 'function') {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (Object.hasOwn(featureMethodOwners, methodName)) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
`CollabMdAppShell feature method "${methodName}" is declared by both "${featureMethodOwners[methodName]}" and "${featureName}".`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (methodName in appShell) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`CollabMdAppShell feature method "${methodName}" conflicts with an existing app shell member.`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Object.defineProperty(appShell, methodName, {
|
|
65
|
+
configurable: true,
|
|
66
|
+
enumerable: false,
|
|
67
|
+
value: method.bind(appShell),
|
|
68
|
+
writable: false,
|
|
69
|
+
});
|
|
70
|
+
featureMethodOwners[methodName] = featureName;
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
Object.defineProperty(appShell, 'featureMethodOwners', {
|
|
75
|
+
configurable: false,
|
|
76
|
+
enumerable: false,
|
|
77
|
+
value: Object.freeze(featureMethodOwners),
|
|
78
|
+
writable: false,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class CollabMdAppShell {
|
|
83
|
+
constructor() {
|
|
84
|
+
installAppShellFeatures(this);
|
|
85
|
+
this.elements = bindAppShellElements(document);
|
|
86
|
+
this.runtimeConfig = getRuntimeConfig();
|
|
87
|
+
this.stateStore = new WorkspaceStateStore();
|
|
88
|
+
this.navigation = new BrowserNavigationPort();
|
|
89
|
+
this.preferences = new BrowserPreferencesPort({
|
|
90
|
+
chatNotificationsKey: 'collabmd-chat-notifications-enabled',
|
|
91
|
+
lineWrappingKey: 'collabmd-editor-line-wrap',
|
|
92
|
+
sidebarVisibleKey: 'collabmd-sidebar-visible',
|
|
93
|
+
userNameKey: 'collabmd-user-name',
|
|
94
|
+
});
|
|
95
|
+
this.notifications = new BrowserNotificationPort();
|
|
96
|
+
this.vaultApiClient = vaultApiClient;
|
|
97
|
+
this._session = null;
|
|
98
|
+
this._hasPromptedForDisplayName = false;
|
|
99
|
+
this._backlinkRefreshTimer = null;
|
|
100
|
+
this._pendingPreviewLayoutSync = false;
|
|
101
|
+
this._previewHydrationPaused = false;
|
|
102
|
+
this._previewLayoutResizeObserver = null;
|
|
103
|
+
this._previewLayoutSyncTimer = null;
|
|
104
|
+
this.pendingGitResetPath = null;
|
|
105
|
+
this.chatTimeFormatter = new Intl.DateTimeFormat(undefined, { hour: 'numeric', minute: '2-digit' });
|
|
106
|
+
this.chatNotificationsEnabled = this.preferences.getChatNotificationsEnabled();
|
|
107
|
+
this.chatNotificationPermission = this.notifications.getPermission();
|
|
108
|
+
this.lobbyChatMessageMaxLength = LOBBY_CHAT_MESSAGE_MAX_LENGTH;
|
|
109
|
+
this.quickSwitcher = null;
|
|
110
|
+
this.quickSwitcherModulePromise = null;
|
|
111
|
+
this.fileExplorerReadyPromise = Promise.resolve();
|
|
112
|
+
this.mobileBreakpointQuery = window.matchMedia('(max-width: 768px)');
|
|
113
|
+
|
|
114
|
+
this.lobby = new LobbyPresence({
|
|
115
|
+
preferredUserName: this.getStoredUserName(),
|
|
116
|
+
onChange: (users) => this.updateGlobalUsers(users),
|
|
117
|
+
onChatChange: (messages, meta) => this.updateChatMessages(messages, meta),
|
|
118
|
+
onWorkspaceEvent: (event) => {
|
|
119
|
+
void this.handleIncomingWorkspaceEvent(event);
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
this.toastController = new ToastController(this.elements.toastContainer);
|
|
124
|
+
this.chatToastController = new ToastController(this.elements.chatToastContainer);
|
|
125
|
+
this.fileExplorer = new FileExplorerController({
|
|
126
|
+
onFileDelete: () => this.navigation.navigateToFile(null),
|
|
127
|
+
onFileSelect: (filePath) => this.handleFileSelection(filePath, { closeSidebarOnMobile: true }),
|
|
128
|
+
toastController: this.toastController,
|
|
129
|
+
});
|
|
130
|
+
this.gitPanel = new GitPanelController({
|
|
131
|
+
enabled: this.runtimeConfig.gitEnabled !== false,
|
|
132
|
+
onCommitStaged: () => this.openGitCommitDialog(),
|
|
133
|
+
onPullBranch: () => this.pullGitBranch(),
|
|
134
|
+
onPushBranch: () => this.pushGitBranch(),
|
|
135
|
+
onRepoChange: (isGitRepo, status) => this.handleGitRepoChange(isGitRepo, status),
|
|
136
|
+
onResetFile: (filePath, { scope }) => this.openGitResetDialog(filePath, { scope }),
|
|
137
|
+
onSelectDiff: (filePath, { scope }) => this.handleGitDiffSelection(filePath, { closeSidebarOnMobile: true, scope }),
|
|
138
|
+
onStageFile: (filePath, { scope }) => this.stageGitFile(filePath, { scope }),
|
|
139
|
+
onUnstageFile: (filePath, { scope }) => this.unstageGitFile(filePath, { scope }),
|
|
140
|
+
onViewAllDiff: () => this.handleGitDiffSelection(null, { closeSidebarOnMobile: true, scope: 'all' }),
|
|
141
|
+
searchInput: this.elements.gitSearchInput,
|
|
142
|
+
toastController: this.toastController,
|
|
143
|
+
});
|
|
144
|
+
this.outlineController = new OutlineController({
|
|
145
|
+
mobileBreakpointQuery: this.mobileBreakpointQuery,
|
|
146
|
+
onNavigateToHeading: ({ sourceLine }) => {
|
|
147
|
+
if (!Number.isFinite(sourceLine)) return;
|
|
148
|
+
this.scrollSyncController.suspendSync(250);
|
|
149
|
+
this.session?.scrollToLine(sourceLine, 0);
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
this.videoEmbed = new VideoEmbedController({
|
|
153
|
+
previewElement: this.elements.previewContent,
|
|
154
|
+
});
|
|
155
|
+
this.previewRenderer = new PreviewRenderer({
|
|
156
|
+
getContent: () => this.getPreviewSource(),
|
|
157
|
+
getFileList: () => this.fileExplorer.flatFiles,
|
|
158
|
+
onAfterRenderCommit: (_previewElement, stats) => {
|
|
159
|
+
this.videoEmbed.reconcileEmbeds(this.elements.previewContent);
|
|
160
|
+
this.videoEmbed.syncLayout();
|
|
161
|
+
this.excalidrawEmbed.reconcileEmbeds(this.elements.previewContent, { isLargeDocument: stats.isLargeDocument });
|
|
162
|
+
this.excalidrawEmbed.syncLayout();
|
|
163
|
+
this.scrollSyncController.setLargeDocumentMode(stats.isLargeDocument);
|
|
164
|
+
this.schedulePreviewLayoutSync({ delayMs: 0 });
|
|
165
|
+
this.refreshCommentUiLayout();
|
|
166
|
+
},
|
|
167
|
+
onBeforeRenderCommit: () => {
|
|
168
|
+
this.videoEmbed.detachForCommit();
|
|
169
|
+
this.excalidrawEmbed.detachForCommit();
|
|
170
|
+
},
|
|
171
|
+
onRenderComplete: () => {
|
|
172
|
+
this.videoEmbed.syncLayout();
|
|
173
|
+
this.excalidrawEmbed.syncLayout();
|
|
174
|
+
this.schedulePreviewLayoutSync({ delayMs: 0 });
|
|
175
|
+
this.refreshCommentUiLayout();
|
|
176
|
+
},
|
|
177
|
+
outlineController: this.outlineController,
|
|
178
|
+
previewContainer: this.elements.previewContainer,
|
|
179
|
+
previewElement: this.elements.previewContent,
|
|
180
|
+
});
|
|
181
|
+
this.themeController = new ThemeController({ onChange: (theme) => this.handleThemeChange(theme) });
|
|
182
|
+
this.layoutController = new LayoutController({
|
|
183
|
+
mobileBreakpointQuery: this.mobileBreakpointQuery,
|
|
184
|
+
onMeasureEditor: () => this.session?.requestMeasure(),
|
|
185
|
+
});
|
|
186
|
+
this.scrollSyncController = new ScrollSyncController({
|
|
187
|
+
getEditorLineNumber: () => this.session?.getTopVisibleLineNumber(0.35) ?? 1,
|
|
188
|
+
onEditorScrollActivityChange: (isActive) => this.handleEditorScrollActivityChange(isActive),
|
|
189
|
+
previewContainer: this.elements.previewContainer,
|
|
190
|
+
previewElement: this.elements.previewContent,
|
|
191
|
+
scrollEditorToLine: (lineNumber, viewportRatio) => this.session?.scrollToLine(lineNumber, viewportRatio),
|
|
192
|
+
});
|
|
193
|
+
this.backlinksPanel = new BacklinksPanel({
|
|
194
|
+
onFileSelect: (filePath) => this.handleFileSelection(filePath, { closeSidebarOnMobile: true }),
|
|
195
|
+
panelElement: this.elements.backlinksPanel,
|
|
196
|
+
});
|
|
197
|
+
this.excalidrawEmbed = new ExcalidrawEmbedController({
|
|
198
|
+
getLocalUser: () => this.lobby.getLocalUser(),
|
|
199
|
+
getTheme: () => this.themeController.getTheme(),
|
|
200
|
+
onOpenFile: (filePath) => filePath && this.navigation.navigateToFile(filePath),
|
|
201
|
+
previewContainer: this.elements.previewContainer,
|
|
202
|
+
previewElement: this.elements.previewContent,
|
|
203
|
+
toastController: this.toastController,
|
|
204
|
+
});
|
|
205
|
+
this.commentUi = new CommentUiController({
|
|
206
|
+
commentSelectionButton: this.elements.commentSelectionButton,
|
|
207
|
+
commentsDrawer: this.elements.commentsDrawer,
|
|
208
|
+
commentsDrawerEmpty: this.elements.commentsDrawerEmpty,
|
|
209
|
+
commentsDrawerList: this.elements.commentsDrawerList,
|
|
210
|
+
commentsToggleButton: this.elements.commentsToggleButton,
|
|
211
|
+
editorContainer: this.elements.editorContainer,
|
|
212
|
+
previewContainer: this.elements.previewContainer,
|
|
213
|
+
previewElement: this.elements.previewContent,
|
|
214
|
+
onCreateThread: ({ anchor, body }) => this.session?.createCommentThread({ anchor, body }),
|
|
215
|
+
onNavigateToLine: (lineNumber) => {
|
|
216
|
+
this.scrollSyncController.suspendSync(250);
|
|
217
|
+
this.session?.scrollToLine(lineNumber, 0.2);
|
|
218
|
+
},
|
|
219
|
+
onReplyToThread: (threadId, body) => this.session?.replyToCommentThread(threadId, body),
|
|
220
|
+
onResolveThread: (threadId) => this.session?.deleteCommentThread(threadId),
|
|
221
|
+
});
|
|
222
|
+
this.workspacePreviewController = new WorkspacePreviewController({
|
|
223
|
+
backlinksPanel: this.backlinksPanel,
|
|
224
|
+
elements: this.elements,
|
|
225
|
+
excalidrawEmbed: this.excalidrawEmbed,
|
|
226
|
+
getDisplayName: (filePath) => this.getDisplayName(filePath),
|
|
227
|
+
getSession: () => this.session,
|
|
228
|
+
isExcalidrawFile: (filePath) => this.isExcalidrawFile(filePath),
|
|
229
|
+
isMermaidFile: (filePath) => this.isMermaidFile(filePath),
|
|
230
|
+
isPlantUmlFile: (filePath) => this.isPlantUmlFile(filePath),
|
|
231
|
+
layoutController: this.layoutController,
|
|
232
|
+
outlineController: this.outlineController,
|
|
233
|
+
previewRenderer: this.previewRenderer,
|
|
234
|
+
schedulePreviewLayoutSync: (options) => this.schedulePreviewLayoutSync(options),
|
|
235
|
+
scrollSyncController: this.scrollSyncController,
|
|
236
|
+
videoEmbed: this.videoEmbed,
|
|
237
|
+
});
|
|
238
|
+
this.wikiLinkFileController = new WikiLinkFileController({
|
|
239
|
+
getFileList: () => this.fileExplorer.flatFiles,
|
|
240
|
+
navigation: this.navigation,
|
|
241
|
+
refreshExplorer: () => this.fileExplorer.refresh(),
|
|
242
|
+
toastController: this.toastController,
|
|
243
|
+
vaultApiClient: this.vaultApiClient,
|
|
244
|
+
});
|
|
245
|
+
this.gitDiffView = new GitDiffViewController({
|
|
246
|
+
onCommitStaged: () => this.openGitCommitDialog(),
|
|
247
|
+
onOpenFile: (filePath) => filePath && this.navigation.navigateToFile(filePath),
|
|
248
|
+
onStageFile: (filePath, { scope }) => this.stageGitFile(filePath, { scope }),
|
|
249
|
+
onUnstageFile: (filePath, { scope }) => this.unstageGitFile(filePath, { scope }),
|
|
250
|
+
toastController: this.toastController,
|
|
251
|
+
});
|
|
252
|
+
this.tabActivityLock = new TabActivityLock({
|
|
253
|
+
onActivated: ({ takeover }) => this.handleTabActivated({ takeover }),
|
|
254
|
+
onBlocked: () => this.handleTabBlocked({ reason: 'active-elsewhere' }),
|
|
255
|
+
onStolen: () => this.handleTabBlocked({ reason: 'taken-over' }),
|
|
256
|
+
});
|
|
257
|
+
this.workspaceCoordinator = new WorkspaceCoordinator({
|
|
258
|
+
attachEditorScroller: (scroller) => this.scrollSyncController.attachEditorScroller(scroller),
|
|
259
|
+
beginDocumentLoad: () => this.previewRenderer.beginDocumentLoad(),
|
|
260
|
+
cleanupAfterSessionDestroy: () => {
|
|
261
|
+
this.scrollSyncController.setLargeDocumentMode(false);
|
|
262
|
+
this.scrollSyncController.invalidatePreviewBlocks();
|
|
263
|
+
this.outlineController.cleanup();
|
|
264
|
+
this.followedCursorSignature = '';
|
|
265
|
+
clearTimeout(this._backlinkRefreshTimer);
|
|
266
|
+
},
|
|
267
|
+
createEditorSession: (EditorSession, options) => new EditorSession({
|
|
268
|
+
editorContainer: this.elements.editorContainer,
|
|
269
|
+
getFileList: options.getFileList,
|
|
270
|
+
initialTheme: options.theme,
|
|
271
|
+
lineInfoElement: this.elements.lineInfo,
|
|
272
|
+
lineWrappingEnabled: options.lineWrappingEnabled,
|
|
273
|
+
localUser: options.localUser,
|
|
274
|
+
onAwarenessChange: options.onAwarenessChange,
|
|
275
|
+
onCommentsChange: options.onCommentsChange,
|
|
276
|
+
onConnectionChange: options.onConnectionChange,
|
|
277
|
+
onContentChange: options.onContentChange,
|
|
278
|
+
onSelectionChange: options.onSelectionChange,
|
|
279
|
+
preferredUserName: options.preferredUserName,
|
|
280
|
+
}),
|
|
281
|
+
getDisplayName: (filePath) => this.getDisplayName(filePath),
|
|
282
|
+
getFileList: () => this.fileExplorer.flatFiles,
|
|
283
|
+
getLineWrappingEnabled: () => this.getStoredLineWrapping(),
|
|
284
|
+
getLocalUser: () => this.lobby.getLocalUser(),
|
|
285
|
+
getStoredUserName: () => this.getStoredUserName(),
|
|
286
|
+
getTheme: () => this.themeController.getTheme(),
|
|
287
|
+
isExcalidrawFile: (filePath) => this.isExcalidrawFile(filePath),
|
|
288
|
+
isMermaidFile: (filePath) => this.isMermaidFile(filePath),
|
|
289
|
+
isPlantUmlFile: (filePath) => this.isPlantUmlFile(filePath),
|
|
290
|
+
isTabActive: () => this.isTabActive,
|
|
291
|
+
loadEditorSessionClass: () => this.loadEditorSessionClass(),
|
|
292
|
+
loadBacklinks: (filePath) => this.backlinksPanel.load(filePath),
|
|
293
|
+
onBeforeFileOpen: () => {
|
|
294
|
+
this.session = null;
|
|
295
|
+
this.commentUi.attachSession(null);
|
|
296
|
+
this.layoutController.reset();
|
|
297
|
+
this.resetPreviewMode();
|
|
298
|
+
this.elements.emptyState?.classList.add('hidden');
|
|
299
|
+
this.elements.editorPage?.classList.remove('hidden');
|
|
300
|
+
this.elements.diffPage?.classList.add('hidden');
|
|
301
|
+
this.clearInitialFileBootstrap();
|
|
302
|
+
},
|
|
303
|
+
onConnectionChange: (state) => this.handleConnectionChange(state),
|
|
304
|
+
onContentChange: ({ isMermaid, isPlantUml }) => {
|
|
305
|
+
this.handleCommentEditorContentChange();
|
|
306
|
+
this.previewRenderer.queueRender();
|
|
307
|
+
if (!isMermaid && !isPlantUml) {
|
|
308
|
+
this.scheduleBacklinkRefresh();
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
onCommentsChange: (threads) => this.handleCommentThreadsChange(threads),
|
|
312
|
+
onFileAwarenessChange: (users) => this.updateFileAwareness(users),
|
|
313
|
+
onFileOpenError: () => {
|
|
314
|
+
this.showEditorLoadError();
|
|
315
|
+
this.syncWrapToggle();
|
|
316
|
+
this.toastController.show('Failed to initialize editor');
|
|
317
|
+
},
|
|
318
|
+
onFileOpenReady: () => {
|
|
319
|
+
this.hideEditorLoading();
|
|
320
|
+
},
|
|
321
|
+
onSelectionChange: (anchor) => this.handleCommentSelectionChange(anchor),
|
|
322
|
+
onSessionAssigned: (session) => {
|
|
323
|
+
this.session = session;
|
|
324
|
+
this.commentUi.attachSession(session);
|
|
325
|
+
},
|
|
326
|
+
onRenderExcalidrawPreview: (filePath) => this.renderExcalidrawFilePreview(filePath),
|
|
327
|
+
onSyncWrapToggle: () => this.syncWrapToggle(),
|
|
328
|
+
onUpdateActiveFile: (filePath) => this.fileExplorer.setActiveFile(filePath),
|
|
329
|
+
onUpdateCurrentFile: (filePath) => {
|
|
330
|
+
this.currentFilePath = filePath;
|
|
331
|
+
},
|
|
332
|
+
onUpdateLobbyCurrentFile: (filePath) => this.lobby.setCurrentFile(filePath),
|
|
333
|
+
onUpdateVisibleChrome: (filePath, { displayName }) => {
|
|
334
|
+
this.syncFileChrome(filePath);
|
|
335
|
+
this.syncCommentChrome(filePath);
|
|
336
|
+
if (this.elements.activeFileName) {
|
|
337
|
+
this.elements.activeFileName.textContent = displayName;
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
onViewModeReset: () => this.resetPreviewMode(),
|
|
341
|
+
renderPresence: () => this.renderPresence(),
|
|
342
|
+
scrollContainerForSession: (session) => session.getScrollContainer(),
|
|
343
|
+
showEditorLoading: () => this.showEditorLoading(),
|
|
344
|
+
stateStore: this.stateStore,
|
|
345
|
+
});
|
|
346
|
+
this.workspaceRouteController = new WorkspaceRouteController({
|
|
347
|
+
backlinksPanel: this.backlinksPanel,
|
|
348
|
+
clearInitialFileBootstrap: () => this.clearInitialFileBootstrap(),
|
|
349
|
+
closeSidebarOnMobile: () => this.closeSidebarOnMobile(),
|
|
350
|
+
elements: this.elements,
|
|
351
|
+
excalidrawEmbed: this.excalidrawEmbed,
|
|
352
|
+
fileExplorer: this.fileExplorer,
|
|
353
|
+
getIsTabActive: () => this.isTabActive,
|
|
354
|
+
getSessionLoadToken: () => this.sessionLoadToken,
|
|
355
|
+
gitDiffView: this.gitDiffView,
|
|
356
|
+
gitPanel: this.gitPanel,
|
|
357
|
+
layoutController: this.layoutController,
|
|
358
|
+
lobby: this.lobby,
|
|
359
|
+
navigation: this.navigation,
|
|
360
|
+
previewRenderer: this.previewRenderer,
|
|
361
|
+
renderAvatars: () => this.renderAvatars(),
|
|
362
|
+
renderPresence: () => this.renderPresence(),
|
|
363
|
+
resetPreviewMode: () => this.resetPreviewMode(),
|
|
364
|
+
scrollSyncController: this.scrollSyncController,
|
|
365
|
+
setCurrentFilePath: (value) => {
|
|
366
|
+
this.currentFilePath = value;
|
|
367
|
+
if (!value) {
|
|
368
|
+
this.commentUi.setCurrentFile(null, { supported: false });
|
|
369
|
+
this.handleCommentThreadsChange([]);
|
|
370
|
+
this.handleCommentSelectionChange(null);
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
setSession: (value) => {
|
|
374
|
+
this.session = value;
|
|
375
|
+
this.commentUi.attachSession(value);
|
|
376
|
+
},
|
|
377
|
+
setSessionLoadToken: (value) => {
|
|
378
|
+
this.sessionLoadToken = value;
|
|
379
|
+
},
|
|
380
|
+
setSidebarTab: (value) => this.setSidebarTab(value),
|
|
381
|
+
showGitDiff: (route) => this.showGitDiff(route),
|
|
382
|
+
syncMainChrome: (payload) => this.syncMainChrome(payload),
|
|
383
|
+
videoEmbed: this.videoEmbed,
|
|
384
|
+
workspaceCoordinator: this.workspaceCoordinator,
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
if (this.chatNotificationPermission !== 'granted') {
|
|
388
|
+
this.chatNotificationsEnabled = false;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
get session() { return this._session; }
|
|
393
|
+
set session(value) { this._session = value; }
|
|
394
|
+
get currentFilePath() { return this.stateStore.get('currentFilePath'); }
|
|
395
|
+
set currentFilePath(value) { this.stateStore.set('currentFilePath', value); }
|
|
396
|
+
get globalUsers() { return this.stateStore.get('globalUsers'); }
|
|
397
|
+
set globalUsers(value) { this.stateStore.set('globalUsers', value); }
|
|
398
|
+
get connectionState() { return this.stateStore.get('connectionState'); }
|
|
399
|
+
set connectionState(value) { this.stateStore.set('connectionState', value); }
|
|
400
|
+
get sessionLoadToken() { return this.stateStore.get('sessionLoadToken'); }
|
|
401
|
+
set sessionLoadToken(value) { this.stateStore.set('sessionLoadToken', value); }
|
|
402
|
+
get connectionHelpShown() { return this.stateStore.get('connectionHelpShown'); }
|
|
403
|
+
set connectionHelpShown(value) { this.stateStore.set('connectionHelpShown', value); }
|
|
404
|
+
get chatMessages() { return this.stateStore.get('chatMessages'); }
|
|
405
|
+
set chatMessages(value) { this.stateStore.set('chatMessages', value); }
|
|
406
|
+
get chatMessageIds() { return this.stateStore.get('chatMessageIds'); }
|
|
407
|
+
set chatMessageIds(value) { this.stateStore.set('chatMessageIds', value); }
|
|
408
|
+
get chatUnreadCount() { return this.stateStore.get('chatUnreadCount'); }
|
|
409
|
+
set chatUnreadCount(value) { this.stateStore.set('chatUnreadCount', value); }
|
|
410
|
+
get chatIsOpen() { return this.stateStore.get('chatIsOpen'); }
|
|
411
|
+
set chatIsOpen(value) { this.stateStore.set('chatIsOpen', value); }
|
|
412
|
+
get chatInitialSyncComplete() { return this.stateStore.get('chatInitialSyncComplete'); }
|
|
413
|
+
set chatInitialSyncComplete(value) { this.stateStore.set('chatInitialSyncComplete', value); }
|
|
414
|
+
get isTabActive() { return this.stateStore.get('isTabActive'); }
|
|
415
|
+
set isTabActive(value) { this.stateStore.set('isTabActive', value); }
|
|
416
|
+
get fileExplorerReady() { return this.stateStore.get('fileExplorerReady'); }
|
|
417
|
+
set fileExplorerReady(value) { this.stateStore.set('fileExplorerReady', value); }
|
|
418
|
+
get gitRepoAvailable() { return this.stateStore.get('gitRepoAvailable'); }
|
|
419
|
+
set gitRepoAvailable(value) { this.stateStore.set('gitRepoAvailable', value); }
|
|
420
|
+
get activeSidebarTab() { return this.stateStore.get('activeSidebarTab'); }
|
|
421
|
+
set activeSidebarTab(value) { this.stateStore.set('activeSidebarTab', value); }
|
|
422
|
+
get followedUserClientId() { return this.stateStore.get('followedUserClientId'); }
|
|
423
|
+
set followedUserClientId(value) { this.stateStore.set('followedUserClientId', value); }
|
|
424
|
+
get followedCursorSignature() { return this.stateStore.get('followedCursorSignature'); }
|
|
425
|
+
set followedCursorSignature(value) { this.stateStore.set('followedCursorSignature', value); }
|
|
426
|
+
|
|
427
|
+
loadEditorSessionClass() {
|
|
428
|
+
if (!this._editorSessionModulePromise) {
|
|
429
|
+
this._editorSessionModulePromise = import('../infrastructure/editor-session.js')
|
|
430
|
+
.then((module) => module.EditorSession);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return this._editorSessionModulePromise;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
scheduleEditorSessionPrewarm({ timeout = 1500 } = {}) {
|
|
437
|
+
if (this._editorSessionModulePromise || this._editorSessionPrewarmHandle) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
const runPrewarm = () => {
|
|
442
|
+
this._editorSessionPrewarmHandle = null;
|
|
443
|
+
void this.loadEditorSessionClass();
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
if (typeof window.requestIdleCallback === 'function') {
|
|
447
|
+
this._editorSessionPrewarmHandle = window.requestIdleCallback(runPrewarm, { timeout });
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
this._editorSessionPrewarmHandle = window.setTimeout(runPrewarm, 0);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
async ensureQuickSwitcher() {
|
|
455
|
+
if (this.quickSwitcher) {
|
|
456
|
+
return this.quickSwitcher;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (!this.quickSwitcherModulePromise) {
|
|
460
|
+
this.quickSwitcherModulePromise = import('../presentation/quick-switcher-controller.js')
|
|
461
|
+
.then((module) => module.QuickSwitcherController);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const QuickSwitcherController = await this.quickSwitcherModulePromise;
|
|
465
|
+
if (!this.quickSwitcher) {
|
|
466
|
+
this.quickSwitcher = new QuickSwitcherController({
|
|
467
|
+
getFileList: () => this.fileExplorer.flatFiles,
|
|
468
|
+
onFileSelect: (filePath) => this.handleFileSelection(filePath, { closeSidebarOnMobile: true }),
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
return this.quickSwitcher;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
async toggleQuickSwitcher() {
|
|
476
|
+
const quickSwitcher = await this.ensureQuickSwitcher();
|
|
477
|
+
quickSwitcher.toggle();
|
|
478
|
+
}
|
|
479
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const DIAGRAM_ACTION_ICONS = {
|
|
2
|
+
edit: `
|
|
3
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
4
|
+
<path d="M11.8 1.8a1.5 1.5 0 0 1 2.1 2.1l-7.2 7.2-3.2.9.9-3.2z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/>
|
|
5
|
+
<path d="M10.7 2.9l2.4 2.4" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/>
|
|
6
|
+
</svg>
|
|
7
|
+
`,
|
|
8
|
+
maximize: `
|
|
9
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
10
|
+
<path d="M6 2H2v4M10 2h4v4M14 10v4h-4M2 10v4h4" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/>
|
|
11
|
+
</svg>
|
|
12
|
+
`,
|
|
13
|
+
refresh: `
|
|
14
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
15
|
+
<path d="M13 4.5V1.8M13 1.8h-2.7M13 11.5v2.7M13 14.2h-2.7" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/>
|
|
16
|
+
<path d="M12.3 4.2A5.3 5.3 0 1 0 13 11.8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/>
|
|
17
|
+
</svg>
|
|
18
|
+
`,
|
|
19
|
+
restore: `
|
|
20
|
+
<svg viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
21
|
+
<path d="M6 5V2H2M10 5V2h4M10 11v3h4M6 11v3H2" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/>
|
|
22
|
+
<path d="M4.5 4.5h7v7h-7z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.4"/>
|
|
23
|
+
</svg>
|
|
24
|
+
`,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export function setDiagramActionButtonIcon(button, iconName) {
|
|
28
|
+
if (!(button instanceof HTMLElement)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const markup = DIAGRAM_ACTION_ICONS[iconName];
|
|
33
|
+
if (!markup) {
|
|
34
|
+
button.classList.remove('is-icon-only');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
button.classList.add('is-icon-only');
|
|
39
|
+
button.dataset.icon = iconName;
|
|
40
|
+
button.innerHTML = markup.trim();
|
|
41
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { normalizeUserName } from './excalidraw-scene.js';
|
|
2
|
+
|
|
3
|
+
export const USER_COLOR_PALETTE = [
|
|
4
|
+
'#ef4444', '#f97316', '#eab308', '#22c55e', '#06b6d4',
|
|
5
|
+
'#3b82f6', '#8b5cf6', '#ec4899', '#14b8a6', '#f59e0b',
|
|
6
|
+
'#6366f1', '#10b981', '#f43f5e', '#0ea5e9', '#a855f7',
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
export function hashString(value) {
|
|
10
|
+
let hash = 0;
|
|
11
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
12
|
+
hash = ((hash << 5) - hash) + value.charCodeAt(index);
|
|
13
|
+
hash |= 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return Math.abs(hash);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function generatePeerId() {
|
|
20
|
+
const bytes = new Uint8Array(8);
|
|
21
|
+
globalThis.crypto?.getRandomValues?.(bytes);
|
|
22
|
+
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function pickFallbackColor(seed) {
|
|
26
|
+
return USER_COLOR_PALETTE[hashString(seed) % USER_COLOR_PALETTE.length];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function ensureColorLight(color, colorLight) {
|
|
30
|
+
if (colorLight && /^#[0-9a-fA-F]{8}$/.test(colorLight)) {
|
|
31
|
+
return colorLight;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (/^#[0-9a-fA-F]{6}$/.test(color)) {
|
|
35
|
+
return `${color}33`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return '#0ea5e933';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function resolveLocalAwarenessUser({
|
|
42
|
+
params,
|
|
43
|
+
storedUserName,
|
|
44
|
+
generatePeerIdFn = generatePeerId,
|
|
45
|
+
}) {
|
|
46
|
+
const name = normalizeUserName(params.get('userName'))
|
|
47
|
+
|| normalizeUserName(storedUserName)
|
|
48
|
+
|| 'User';
|
|
49
|
+
const peerId = params.get('userPeerId') || generatePeerIdFn();
|
|
50
|
+
const color = params.get('userColor') || pickFallbackColor(`${name}-${peerId}`);
|
|
51
|
+
const colorLight = ensureColorLight(color, params.get('userColorLight'));
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
color,
|
|
55
|
+
colorLight,
|
|
56
|
+
name,
|
|
57
|
+
peerId,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function mergeAwarenessUserPatch({
|
|
62
|
+
currentUser,
|
|
63
|
+
nextUser = {},
|
|
64
|
+
generatePeerIdFn = generatePeerId,
|
|
65
|
+
}) {
|
|
66
|
+
const patchedName = normalizeUserName(nextUser.name) || currentUser?.name || 'User';
|
|
67
|
+
const patchedPeerId = nextUser.peerId || currentUser?.peerId || generatePeerIdFn();
|
|
68
|
+
const patchedColor = nextUser.color || currentUser?.color || pickFallbackColor(`${patchedName}-${patchedPeerId}`);
|
|
69
|
+
const patchedColorLight = ensureColorLight(
|
|
70
|
+
patchedColor,
|
|
71
|
+
nextUser.colorLight || currentUser?.colorLight,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
color: patchedColor,
|
|
76
|
+
colorLight: patchedColorLight,
|
|
77
|
+
name: patchedName,
|
|
78
|
+
peerId: patchedPeerId,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function normalizeCollaboratorViewport(viewport) {
|
|
83
|
+
if (!viewport || typeof viewport !== 'object') {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const scrollX = Number(viewport.scrollX);
|
|
88
|
+
const scrollY = Number(viewport.scrollY);
|
|
89
|
+
const zoom = Number(viewport.zoom);
|
|
90
|
+
if (!Number.isFinite(scrollX) || !Number.isFinite(scrollY) || !Number.isFinite(zoom) || zoom <= 0) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
scrollX,
|
|
96
|
+
scrollY,
|
|
97
|
+
zoom,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function buildCollaboratorsMap(awareness) {
|
|
102
|
+
const collaborators = new Map();
|
|
103
|
+
if (!awareness) {
|
|
104
|
+
return collaborators;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
awareness.getStates().forEach((state, clientId) => {
|
|
108
|
+
const user = state?.user;
|
|
109
|
+
if (!user) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const pointer = state.pointer && Number.isFinite(state.pointer.x) && Number.isFinite(state.pointer.y)
|
|
114
|
+
? {
|
|
115
|
+
x: state.pointer.x,
|
|
116
|
+
y: state.pointer.y,
|
|
117
|
+
tool: state.pointer.tool === 'laser' ? 'laser' : 'pointer',
|
|
118
|
+
}
|
|
119
|
+
: undefined;
|
|
120
|
+
const viewport = normalizeCollaboratorViewport(state.viewport);
|
|
121
|
+
|
|
122
|
+
collaborators.set(String(clientId), {
|
|
123
|
+
button: state.pointerButton === 'down' ? 'down' : 'up',
|
|
124
|
+
color: {
|
|
125
|
+
background: ensureColorLight(user.color || '#0ea5e9', user.colorLight),
|
|
126
|
+
stroke: user.color || '#0ea5e9',
|
|
127
|
+
},
|
|
128
|
+
id: user.peerId || String(clientId),
|
|
129
|
+
isCurrentUser: clientId === awareness.clientID,
|
|
130
|
+
pointer,
|
|
131
|
+
viewport,
|
|
132
|
+
selectedElementIds: state.selectedElementIds || undefined,
|
|
133
|
+
socketId: String(clientId),
|
|
134
|
+
username: user.name || 'User',
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
return collaborators;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function findCollaboratorByPeerId(collaborators, peerId) {
|
|
142
|
+
if (!(collaborators instanceof Map) || !peerId) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
for (const collaborator of collaborators.values()) {
|
|
147
|
+
if (collaborator?.id === peerId) {
|
|
148
|
+
return collaborator;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return null;
|
|
153
|
+
}
|