collabmd 0.1.21 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -12
- package/bin/collabmd.js +3 -2
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BHWNpLuY.js +1 -0
- package/dist/client/assets/_basePickBy-CJWegqog.js +1 -0
- package/dist/client/assets/_baseUniq-CFKN1k1n.js +1 -0
- package/dist/client/assets/apl-khHl8vBy.js +1 -0
- package/dist/client/assets/ar-SA-NXDWD63E-DND5MLpM.js +8 -0
- package/dist/client/assets/arc-D1SV2GW0.js +1 -0
- package/dist/client/assets/architecture-PBZL5I3N-0dui3p7-.js +1 -0
- package/dist/client/assets/architectureDiagram-2XIMDMQ5-DXpDe6lq.js +36 -0
- package/dist/client/assets/array-BTHl6o_K.js +1 -0
- package/dist/client/assets/asciiarmor-7xnRhA8w.js +1 -0
- package/dist/client/assets/asn1-_x-T1mFB.js +1 -0
- package/dist/client/assets/asterisk-Ct2NwVUw.js +1 -0
- package/dist/client/assets/az-AZ-MXSORGZV-ILYw2sYr.js +1 -0
- package/dist/client/assets/bg-BG-O6MV2KSF-DmfoZHM8.js +5 -0
- package/dist/client/assets/blockDiagram-WCTKOSBZ-DlJn0Rs1.js +132 -0
- package/dist/client/assets/bn-BD-T2VJNT7N-uYQx1Wph.js +3 -0
- package/dist/client/assets/bn-IN-MMW2ORAC-CmlBLY7g.js +3 -0
- package/dist/client/assets/brainfuck-CAmdgqDN.js +1 -0
- package/dist/client/assets/c4Diagram-IC4MRINW-C6S9MOEW.js +10 -0
- package/dist/client/assets/ca-ES-MKBCGNOG-DWiYvMvF.js +8 -0
- package/dist/client/assets/channel-CVwYcdlk.js +1 -0
- package/dist/client/assets/chunk-27N2SPOM-RxZ2_zJJ.js +34 -0
- package/dist/client/assets/chunk-3PELD44J-BvOh9EJp.js +1 -0
- package/dist/client/assets/chunk-4BX2VUAB-LBTVcC6-.js +1 -0
- package/dist/client/assets/chunk-55IACEB6-T5nuDI6U.js +1 -0
- package/dist/client/assets/chunk-7E7YKBS2-CBNUsbS7.js +1 -0
- package/dist/client/assets/chunk-7R4GIKGN-Dh9p1sbP.js +80 -0
- package/{public/assets/js/chunks/chunk-IR2DOYV4.js → dist/client/assets/chunk-A66AFZZU-D0IDIehU.js} +2 -2
- package/dist/client/assets/chunk-C72U2L5F-DLNOvzEI.js +1 -0
- package/dist/client/assets/chunk-Cq_f4orQ.js +1 -0
- package/dist/client/assets/chunk-EGIJ26TM-BkBsHEWn.js +1 -0
- package/dist/client/assets/chunk-ETSVUAFD-BnK5BhxL.js +12 -0
- package/{public/assets/js/chunks/chunk-U6APNHAF.js → dist/client/assets/chunk-FMBD7UC4-BoiIqhkb.js} +2 -2
- package/dist/client/assets/chunk-GEFDOKGD-CIg-LRSp.js +2 -0
- package/dist/client/assets/chunk-GLR3WWYH-CqGMuOti.js +2 -0
- package/dist/client/assets/chunk-HHEYEP7N-Czb3OX2v.js +1 -0
- package/dist/client/assets/chunk-JSJVCQXG-C6-G93S3.js +1 -0
- package/dist/client/assets/chunk-KX2RTZJC-CJlt0Rne.js +1 -0
- package/dist/client/assets/chunk-KYZI473N-C-ObF5L3.js +53 -0
- package/dist/client/assets/chunk-L3YUKLVL-BzkNNFii.js +1 -0
- package/dist/client/assets/chunk-MX3YWQON-bjcMtEei.js +1 -0
- package/dist/client/assets/chunk-NQ4KR5QH-DY9oh8PD.js +220 -0
- package/dist/client/assets/chunk-O4XLMI2P-CVfnFXq8.js +7 -0
- package/dist/client/assets/chunk-OZEHJAEY-DyD-ywvu.js +1 -0
- package/dist/client/assets/chunk-PQ6SQG4A-BOJs3QbF.js +1 -0
- package/dist/client/assets/chunk-PU5JKC2W-1nkyDxBh.js +70 -0
- package/dist/client/assets/chunk-QZHKN3VN-DU7fMcaP.js +1 -0
- package/dist/client/assets/chunk-R5LLSJPH-D9t4mFiL.js +1 -0
- package/dist/client/assets/chunk-SRAX5OIU-B-Zdxy2r.js +1 -0
- package/dist/client/assets/chunk-WL4C6EOR-Bs95uEnp.js +189 -0
- package/dist/client/assets/chunk-XIRO2GV7-CtwY16Jh.js +1 -0
- package/dist/client/assets/chunk-XPW4576I-CvxG514V.js +32 -0
- package/dist/client/assets/chunk-XZSTWKYB-BNB3Mgw3.js +94 -0
- package/dist/client/assets/chunk-YBOYWFTD-MIDp82ug.js +1 -0
- package/dist/client/assets/chunk-Z5NKEFVG-CIMf1Se5.js +22 -0
- package/dist/client/assets/classDiagram-VBA2DB6C-CBSmkOe7.js +1 -0
- package/dist/client/assets/classDiagram-v2-RAHNMMFH-CJarRy94.js +1 -0
- package/dist/client/assets/clike-BJcwKCE7.js +1 -0
- package/dist/client/assets/clojure-uSRILJfc.js +1 -0
- package/dist/client/assets/clone-CMmi3x0H.js +1 -0
- package/dist/client/assets/cmake-j5-7WxMz.js +1 -0
- package/dist/client/assets/cobol-cnURuZ43.js +1 -0
- package/dist/client/assets/coffeescript-iQD116iO.js +1 -0
- package/dist/client/assets/commonlisp-DGzExN9H.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-BKEY00wk.js +1 -0
- package/dist/client/assets/crystal-CnjkM1-q.js +1 -0
- package/dist/client/assets/cs-CZ-V77HGUP7-sLBAF2Iw.js +7 -0
- package/dist/client/assets/css-C-Nv0c9S.js +1 -0
- package/dist/client/assets/cypher-hxitpny2.js +1 -0
- package/dist/client/assets/cytoscape.esm-0xzpJ66h.js +321 -0
- package/dist/client/assets/d-BtdAWoTB.js +1 -0
- package/dist/client/assets/da-DK-I5RFNTM4-B__PLwca.js +2 -0
- package/dist/client/assets/dagre-Cm2w_QpZ.js +1 -0
- package/dist/client/assets/dagre-KLK3FWXG-BddfhbwG.js +4 -0
- package/dist/client/assets/de-CH-WLRDEVBV-D61DKw_9.js +7 -0
- package/dist/client/assets/de-DE-DTI4WUSC-Ba3fBYEU.js +7 -0
- package/dist/client/assets/defaultLocale-PG3Gbk8q.js +1 -0
- package/dist/client/assets/diagram-E7M64L7V-BoyJ8kpo.js +24 -0
- package/dist/client/assets/diagram-IFDJBPK2-DLWembLL.js +43 -0
- package/dist/client/assets/diagram-P4PSJMXO-CPmPa0OC.js +24 -0
- package/dist/client/assets/diff-f_ZkWiYS.js +1 -0
- package/dist/client/assets/dist-BATDm5JF.js +1 -0
- package/dist/client/assets/dist-BDDCA7hC.js +1 -0
- package/dist/client/assets/dist-BEs40fGb.js +1 -0
- package/dist/client/assets/dist-BPyPcaZr.js +1 -0
- package/dist/client/assets/dist-BiNL3fhN.js +1 -0
- package/dist/client/assets/dist-BpEcA20b.js +2 -0
- package/dist/client/assets/dist-BtROnx4-.js +1 -0
- package/dist/client/assets/dist-CCxn5Mk-.js +13 -0
- package/dist/client/assets/dist-CKdaLumK.js +1 -0
- package/dist/client/assets/dist-CNcGnl0T.js +1 -0
- package/dist/client/assets/dist-CPzoLjNz.js +1 -0
- package/dist/client/assets/dist-CQzPpOiH.js +1 -0
- package/dist/client/assets/dist-Cje3pdZH.js +9 -0
- package/dist/client/assets/dist-CnKD4Y92.js +1 -0
- package/dist/client/assets/dist-CxPc5kI6.js +1 -0
- package/dist/client/assets/dist-Czv7DXcw.js +23 -0
- package/dist/client/assets/dist-D4ebIlQB.js +6 -0
- package/dist/client/assets/dist-D7S1mzwR.js +1 -0
- package/dist/client/assets/dist-DFIisyRk.js +1 -0
- package/dist/client/assets/dist-DGbPPlZ8.js +1 -0
- package/dist/client/assets/dist-DL-EaOiC.js +1 -0
- package/dist/client/assets/dist-DhkKj77m.js +1 -0
- package/dist/client/assets/dist-DnpxzfoU.js +1 -0
- package/dist/client/assets/dist-Dy9oGocr.js +11 -0
- package/dist/client/assets/dist-Le-AVwIk.js +1 -0
- package/dist/client/assets/dist-StJm6K24.js +1 -0
- package/dist/client/assets/dist-gCWIHDgw.js +1 -0
- package/dist/client/assets/dist-mDBaykBY.js +1 -0
- package/dist/client/assets/dist-tyxqXzyB.js +1 -0
- package/dist/client/assets/dist-vL71uaef.js +1 -0
- package/dist/client/assets/dockerfile-BmylqEVx.js +1 -0
- package/dist/client/assets/dtd-B6xdyNDx.js +1 -0
- package/dist/client/assets/dylan-BzUoKQTn.js +1 -0
- package/dist/client/assets/ebnf-BlTaNq16.js +1 -0
- package/dist/client/assets/ecl-CffPaRqR.js +1 -0
- package/dist/client/assets/editor-session-DsM3VgQv.js +16 -0
- package/dist/client/assets/eiffel-B66P6crR.js +1 -0
- package/dist/client/assets/el-GR-ZXDJ2OS4-CpEbk42T.js +7 -0
- package/dist/client/assets/elm-DIwllOLv.js +1 -0
- package/dist/client/assets/en-CTDJDZ6K-C36Iqh9O.js +1 -0
- package/dist/client/assets/erDiagram-INFDFZHY-Dwg_AhU2.js +70 -0
- package/dist/client/assets/erlang-DwYA67QU.js +1 -0
- package/dist/client/assets/es-ES-DYQHAD43-Ba-6t0Wr.js +7 -0
- package/dist/client/assets/eu-ES-QDSYU5Y3-CYzUKQ2_.js +7 -0
- package/dist/client/assets/excalidraw-editor-Cs5p0lBn.js +182 -0
- package/dist/client/assets/excalidraw-editor-D8O7A69r.css +1 -0
- package/dist/client/assets/excalidraw-mermaid-stub-BtCKxPxK.js +1 -0
- package/dist/client/assets/excalidraw-mermaid-stub-C1ZaaI05.js +1 -0
- package/dist/client/assets/excalidrawEditor-wgJb2hmP.js +2 -0
- package/dist/client/assets/fa-IR-26LZG4PM-CxLc7ohL.js +9 -0
- package/dist/client/assets/factor-Cc9mS1OI.js +1 -0
- package/dist/client/assets/fcl-DD6dBrvI.js +1 -0
- package/dist/client/assets/fi-FI-6YS4KDE4-DtYLOEJY.js +6 -0
- package/dist/client/assets/flowDiagram-PKNHOUZH-BIJd4wAz.js +162 -0
- package/dist/client/assets/forth-DFLLMv-i.js +1 -0
- package/dist/client/assets/fortran-CNZVMQdQ.js +1 -0
- package/dist/client/assets/fr-FR-BRLLPTZC-9O_U5gdi.js +12 -0
- package/dist/client/assets/ganttDiagram-A5KZAMGK-BiMwicnp.js +292 -0
- package/dist/client/assets/gas-DyiCLKEJ.js +1 -0
- package/dist/client/assets/gherkin-CHgE7bAJ.js +1 -0
- package/dist/client/assets/gitGraph-HDMCJU4V-iPo6Lz4k.js +1 -0
- package/dist/client/assets/gitGraphDiagram-K3NZZRJ6-lk_paRel.js +65 -0
- package/dist/client/assets/github-dark.min-Z5exjX_n.css +1 -0
- package/dist/client/assets/github.min-D2BCvnWf.css +1 -0
- package/dist/client/assets/gl-ES-OKUZTLYG-Bb7TO64O.js +6 -0
- package/dist/client/assets/graphlib-B2nPo9Z4.js +1 -0
- package/dist/client/assets/groovy-BZc3It91.js +1 -0
- package/dist/client/assets/haskell-DJ4hTi3A.js +1 -0
- package/dist/client/assets/haxe-sJjg_lHN.js +1 -0
- package/dist/client/assets/he-IL-26MGYIU7-CQW1igm9.js +8 -0
- package/dist/client/assets/hi-IN-Q4ZOGTP2-BM91ENLs.js +3 -0
- package/dist/client/assets/http-DwAi3Ho1.js +1 -0
- package/dist/client/assets/hu-HU-P2OXPSN5-HiGbsUwM.js +3 -0
- package/dist/client/assets/id-ID-2EIKXYN6-DEG8vRZ2.js +8 -0
- package/dist/client/assets/idl-CCIDRFwr.js +1 -0
- package/dist/client/assets/image-32MOCVDX-viHDtJGM.js +1 -0
- package/dist/client/assets/image-blob-reduce.esm-D4wBfumB.js +2 -0
- package/dist/client/assets/index-B6m_KATZ.css +1 -0
- package/dist/client/assets/index-D20GlrKF.js +2 -0
- package/dist/client/assets/info-3K5VOQVL-DePZHLA4.js +1 -0
- package/dist/client/assets/infoDiagram-LFFYTUFH-CiAT_kJZ.js +2 -0
- package/dist/client/assets/init-Bb7Vx0CW.js +1 -0
- package/dist/client/assets/isArrayLikeObject-DxEG9mY7.js +1 -0
- package/dist/client/assets/isEmpty-DGNCKhlT.js +1 -0
- package/dist/client/assets/ishikawaDiagram-PHBUUO56-CE3HierS.js +70 -0
- package/dist/client/assets/it-IT-4CFKVXI2-DSrGqCKD.js +12 -0
- package/dist/client/assets/ja-JP-MAND2Z4V-OFpEymIv.js +7 -0
- package/dist/client/assets/javascript-BlUxwA0O.js +1 -0
- package/dist/client/assets/javascript-DcX_cm1u.js +1 -0
- package/dist/client/assets/journeyDiagram-4ABVD52K-CzoczPjW.js +139 -0
- package/dist/client/assets/jsx-runtime-DRYOYO9I.js +1 -0
- package/dist/client/assets/julia-BU0qBb1w.js +1 -0
- package/dist/client/assets/kaa-HQRTCXTJ-CpOJ_vn4.js +1 -0
- package/dist/client/assets/kab-KAB-JKIKKTGH-CNPzzJH6.js +4 -0
- package/dist/client/assets/kanban-definition-K7BYSVSG-Cr6iNYl4.js +89 -0
- package/dist/client/assets/katex-DoaSnJ5T.js +261 -0
- package/dist/client/assets/kk-KZ-HXQ63ZFC-CgtjU5JI.js +1 -0
- package/dist/client/assets/km-KH-PKL3LSGX-BAJh8UnF.js +7 -0
- package/dist/client/assets/ko-KR-KXLREZX3-BshOksBX.js +5 -0
- package/dist/client/assets/ku-TR-MJ4IER3X-Bi3YtiD-.js +6 -0
- package/dist/client/assets/line-D2NTyhqv.js +1 -0
- package/dist/client/assets/linear-DntNI0Uj.js +1 -0
- package/dist/client/assets/livescript-uk34VDGK.js +1 -0
- package/dist/client/assets/lt-LT-H6WFQ6FJ-DQ2W0g7h.js +3 -0
- package/dist/client/assets/lua-ClQGOv84.js +1 -0
- package/dist/client/assets/lv-LV-GOCK6SJW-DeqTo8T7.js +4 -0
- package/dist/client/assets/main-DONXLDrC.js +599 -0
- package/dist/client/assets/math-DQo53qzt.js +1 -0
- package/dist/client/assets/mathematica-BDmKpvRN.js +1 -0
- package/dist/client/assets/mbox-T5kA6jAQ.js +1 -0
- package/dist/client/assets/mermaid-parser.core-Bh2Ta9ou.js +4 -0
- package/dist/client/assets/mermaid-runtime-CLtta79D.js +11 -0
- package/dist/client/assets/mindmap-definition-YRQLILUH-DufPyQO8.js +68 -0
- package/dist/client/assets/mirc-DRRKKkcJ.js +1 -0
- package/dist/client/assets/mllike-iZXopbca.js +1 -0
- package/dist/client/assets/modelica-DP8T2DKM.js +1 -0
- package/dist/client/assets/mr-IN-IXVLDMEQ-CnH5Wjc7.js +9 -0
- package/dist/client/assets/mscgen-DXIRw2qg.js +1 -0
- package/dist/client/assets/mumps-BKUS05-y.js +1 -0
- package/dist/client/assets/my-MM-YG6MYTTD-BefEpouO.js +1 -0
- package/dist/client/assets/nb-NO-XGWJISD2-CNRrlrPY.js +8 -0
- package/dist/client/assets/nginx-CzYOtr2G.js +1 -0
- package/dist/client/assets/nl-NL-XVDVCPNC-CuLTw3kL.js +13 -0
- package/dist/client/assets/nn-NO-EMX5MJX5-NHFRnQkl.js +4 -0
- package/dist/client/assets/nsis-YyYYKQIB.js +1 -0
- package/dist/client/assets/ntriples-ZgZuaYbW.js +1 -0
- package/dist/client/assets/oc-FR-ROEINTVO-8kCbAtcr.js +4 -0
- package/dist/client/assets/octave-CnOndUN3.js +1 -0
- package/dist/client/assets/ordinal-BuNU9EgZ.js +1 -0
- package/dist/client/assets/oz-DjW322Rn.js +1 -0
- package/dist/client/assets/pa-IN-ZYN6SUDY-Dh8USSIe.js +4 -0
- package/dist/client/assets/packet-RMMSAZCW-BVw0pEk-.js +1 -0
- package/dist/client/assets/pascal-BdeW5uRX.js +1 -0
- package/dist/client/assets/path-BxyPWlyM.js +1 -0
- package/dist/client/assets/percentages-5DKR754L-RQFE76Sg.js +1 -0
- package/dist/client/assets/perl-_CDvIe1D.js +1 -0
- package/dist/client/assets/pica-BG8AR4mo.js +2 -0
- package/dist/client/assets/pie-UPGHQEXC-ChUWa5qF.js +1 -0
- package/dist/client/assets/pieDiagram-SKSYHLDU--YidSJxi.js +30 -0
- package/dist/client/assets/pig-inWo_B4W.js +1 -0
- package/dist/client/assets/pl-PL-6VTG7PHC-BMbgP62B.js +12 -0
- package/dist/client/assets/powershell-CO5KWJsy.js +1 -0
- package/dist/client/assets/preload-helper-Chd9yIcd.js +1 -0
- package/dist/client/assets/preview-render-compiler-CWBdv5tw.js +1 -0
- package/dist/client/assets/preview-render-profile-BjrQVCWD.js +23 -0
- package/dist/client/assets/preview-render-worker-DbMTa0Y6.js +23 -0
- package/dist/client/assets/properties-CjVp4a6M.js +1 -0
- package/dist/client/assets/protobuf-DybFT2KT.js +1 -0
- package/dist/client/assets/pt-BR-5YFKRR5G-CyrwFw_N.js +6 -0
- package/dist/client/assets/pt-PT-GEIXXZ67-SpK5vaGR.js +8 -0
- package/dist/client/assets/pug-CM36H1hd.js +1 -0
- package/dist/client/assets/puppet-Dw_NDgko.js +1 -0
- package/dist/client/assets/python-2pwcWoy7.js +1 -0
- package/dist/client/assets/q-C47l8kdS.js +1 -0
- package/dist/client/assets/quadrantDiagram-337W2JSQ-n7EIFT_f.js +7 -0
- package/dist/client/assets/quick-switcher-controller-CKrGBgcl.js +5 -0
- package/dist/client/assets/r-BmcXGVZ5.js +1 -0
- package/dist/client/assets/radar-KQ55EAFF-B4gMcoDX.js +1 -0
- package/dist/client/assets/requirementDiagram-Z7DCOOCP-BrquJATD.js +73 -0
- package/dist/client/assets/ro-RO-E2P6TFZI-90dn2iUp.js +12 -0
- package/dist/client/assets/room-zaSnuMv5.js +4 -0
- package/dist/client/assets/rough.esm-C7Rbwqik.js +1 -0
- package/dist/client/assets/roundRect-CDlbNkEg.js +1 -0
- package/dist/client/assets/rpm-Cm0x5xT_.js +1 -0
- package/dist/client/assets/ru-RU-YBIIY43T-Cl52NZnQ.js +10 -0
- package/dist/client/assets/ruby-Dl-I4pxG.js +1 -0
- package/dist/client/assets/runtime-config-loader--hxFvh23.js +1 -0
- package/dist/client/assets/sankeyDiagram-WA2Y5GQK-IpD6lgfO.js +10 -0
- package/dist/client/assets/sas-Bxkg4GVX.js +1 -0
- package/dist/client/assets/scheme-CO3zogua.js +1 -0
- package/dist/client/assets/sequenceDiagram-2WXFIKYE-DxZ6glIZ.js +145 -0
- package/dist/client/assets/shell-gYrTvBTP.js +1 -0
- package/dist/client/assets/si-LK-673C2CI2-DMSUxT-y.js +1 -0
- package/dist/client/assets/sieve-COX4Kn1X.js +1 -0
- package/dist/client/assets/simple-mode-BY9UFVy7.js +1 -0
- package/dist/client/assets/sk-SK-CKZHQ4AP-DUDai5Oe.js +7 -0
- package/dist/client/assets/sl-SI-557H2GWM-BbLeATfl.js +6 -0
- package/dist/client/assets/smalltalk-Dma1z5eE.js +1 -0
- package/dist/client/assets/solr-BvhcdkNH.js +1 -0
- package/dist/client/assets/sparql-gX7W9xeh.js +1 -0
- package/dist/client/assets/spreadsheet-BnlQRxWz.js +1 -0
- package/dist/client/assets/sql-CwA10oIk.js +1 -0
- package/dist/client/assets/src-H0-aBY9y.js +1 -0
- package/dist/client/assets/stateDiagram-RAJIS63D-A-rbDcdL.js +1 -0
- package/dist/client/assets/stateDiagram-v2-FVOUBMTO-CKhOHHLe.js +1 -0
- package/dist/client/assets/stex-DhLUylSV.js +1 -0
- package/dist/client/assets/stylus-9ZGSp3KB.js +1 -0
- package/dist/client/assets/subset-shared.chunk-93a-Md8B.js +1 -0
- package/dist/client/assets/subset-worker.chunk-B7pmUG1o.js +1 -0
- package/dist/client/assets/sv-SE-XOPKKDWS-BBa-AcMf.js +8 -0
- package/dist/client/assets/swift-CurfpLXH.js +1 -0
- package/dist/client/assets/ta-IN-XBH7DQI3-9uR7ADzx.js +6 -0
- package/dist/client/assets/tcl-BPvzXR-t.js +1 -0
- package/dist/client/assets/textile-BUq3vgBH.js +1 -0
- package/dist/client/assets/th-TH-TOCWH3R4-Box9U3ny.js +1 -0
- package/dist/client/assets/tiddlywiki-DRR6E4hS.js +1 -0
- package/dist/client/assets/tiki-C1XMixgx.js +1 -0
- package/dist/client/assets/timeline-definition-YZTLITO2-DuTppHot.js +61 -0
- package/dist/client/assets/toml-BQjoWSzq.js +1 -0
- package/dist/client/assets/tr-TR-GXW6CYY5-BA8pS3C5.js +4 -0
- package/dist/client/assets/treemap-KZPCXAKY-on28XbV_.js +1 -0
- package/dist/client/assets/troff-DbgTp3Cj.js +1 -0
- package/dist/client/assets/ttcn-1OxchGWH.js +1 -0
- package/dist/client/assets/ttcn-cfg-CC8OhyHu.js +1 -0
- package/dist/client/assets/turtle-D1WjVU4-.js +1 -0
- package/dist/client/assets/uk-UA-IJKTNUDG-B6hoHqzM.js +6 -0
- package/dist/client/assets/uz-UZ-TBZZEA4V-CPuftH33.js +1 -0
- package/dist/client/assets/vault-api-client-D7C_m9eq.js +188 -0
- package/dist/client/assets/vault-utils-Js2T-e-h.js +1 -0
- package/dist/client/assets/vb-Bf-XXYNJ.js +1 -0
- package/dist/client/assets/vbscript-HeSyWuOi.js +1 -0
- package/dist/client/assets/velocity-CUkiDsJQ.js +1 -0
- package/dist/client/assets/vennDiagram-LZ73GAT5-J0SBkXj8.js +34 -0
- package/dist/client/assets/verilog-BFxB5RAN.js +1 -0
- package/dist/client/assets/vhdl-BJUXQE-6.js +1 -0
- package/dist/client/assets/vi-VN-MULSGNVB-yRFd9OXl.js +7 -0
- package/dist/client/assets/webidl-advQMGTP.js +1 -0
- package/dist/client/assets/xquery-CNzoFgd7.js +1 -0
- package/dist/client/assets/xychartDiagram-JWTSCODW-Dn9dSYxn.js +7 -0
- package/dist/client/assets/yacas-BsmlDKac.js +1 -0
- package/dist/client/assets/yjs-provider-reset-guard-BcnBGrS9.js +4 -0
- package/dist/client/assets/z80-Bnez4vZ_.js +1 -0
- package/dist/client/assets/zh-CN-MVX3E32U-VzUIXB4K.js +11 -0
- package/dist/client/assets/zh-HK-JNU5RLIE-i0G2jHO_.js +1 -0
- package/dist/client/assets/zh-TW-LENVCA6T-BkHZg3jv.js +9 -0
- package/dist/client/excalidraw-editor.html +31 -0
- package/{public → dist/client}/index.html +135 -222
- package/docker-compose.yml +13 -1
- package/package.json +14 -7
- package/src/client/app/excalidraw-editor-entry.js +4 -0
- package/{public → src/client/app}/excalidraw-editor.html +1 -3
- package/src/client/app/index.html +469 -0
- package/src/client/app/main-entry.js +24 -0
- package/src/client/application/app-shell/git-feature.js +268 -32
- package/src/client/application/app-shell/ui-feature-identity.js +170 -0
- package/src/client/application/app-shell/ui-feature-shell.js +419 -0
- package/src/client/application/app-shell/ui-feature-sidebar.js +98 -0
- package/src/client/application/app-shell/ui-feature-tab-activity.js +128 -0
- package/src/client/application/app-shell/ui-feature-toolbar.js +520 -0
- package/src/client/application/app-shell/ui-feature.js +10 -648
- package/src/client/application/app-shell/workspace-feature.js +46 -0
- package/src/client/application/app-shell-elements.js +4 -0
- package/src/client/application/mermaid-preview-hydrator.js +1 -1
- package/src/client/application/plantuml-preview-hydrator.js +1 -1
- package/src/client/application/workspace-coordinator.js +147 -18
- package/src/client/application/workspace-preview-controller.js +34 -0
- package/src/client/application/workspace-route-controller.js +104 -0
- package/src/client/bootstrap/collabmd-app-shell.js +104 -0
- package/src/client/domain/markdown-formatting.js +197 -52
- package/src/client/domain/markdown-toolbar-actions.js +191 -0
- package/src/client/domain/runtime-paths.js +15 -0
- package/src/client/domain/workspace-request-id.js +7 -0
- package/src/client/excalidraw-editor.js +48 -2
- package/src/client/infrastructure/app-version-monitor.js +114 -0
- package/src/client/infrastructure/auth-client.js +219 -52
- package/src/client/infrastructure/browser-navigation-port.js +20 -0
- package/src/client/infrastructure/editor-collaboration-client.js +4 -0
- package/src/client/infrastructure/editor-session.js +47 -7
- package/src/client/infrastructure/editor-view-adapter.js +122 -58
- package/src/client/infrastructure/runtime-config-loader.js +56 -0
- package/src/client/infrastructure/runtime-config.js +66 -0
- package/src/client/infrastructure/vault-api-client.js +41 -7
- package/src/client/presentation/backlinks-panel.js +42 -9
- package/src/client/presentation/comment-ui/comment-ui-card.js +632 -0
- package/src/client/presentation/comment-ui/comment-ui-layout.js +452 -0
- package/src/client/presentation/comment-ui/comment-ui-render.js +149 -0
- package/src/client/presentation/comment-ui/comment-ui-shared.js +297 -0
- package/src/client/presentation/comment-ui/comment-ui-state.js +268 -0
- package/src/client/presentation/comment-ui-controller.js +13 -1529
- package/src/client/presentation/comments-panel.js +2 -2
- package/src/client/presentation/excalidraw-embed-controller.js +60 -2
- package/src/client/presentation/file-action-controller.js +195 -32
- package/src/client/presentation/file-explorer-controller.js +16 -2
- package/src/client/presentation/file-explorer-view.js +248 -7
- package/src/client/presentation/file-history-view-controller.js +806 -0
- package/src/client/presentation/file-tree-state.js +100 -5
- package/src/client/presentation/git-diff-view-controller.js +718 -121
- package/src/client/presentation/git-panel-controller.js +458 -66
- package/src/client/presentation/layout-controller.js +1 -1
- package/src/client/presentation/toast-controller.js +49 -6
- package/src/client/styles/components/actions.css +89 -0
- package/src/client/styles/components/feedback.css +71 -0
- package/src/client/styles/components/navigation.css +68 -0
- package/src/client/styles/components/scrollbars.css +104 -0
- package/src/client/styles/components/states.css +289 -0
- package/src/client/styles/components/surfaces.css +155 -0
- package/src/client/styles/features/backlinks.css +218 -0
- package/src/client/styles/features/collaboration-chat.css +228 -0
- package/src/client/styles/features/collaboration-dialogs.css +154 -0
- package/src/client/styles/features/collaboration-presence.css +103 -0
- package/src/client/styles/features/collaboration-ui.css +3 -0
- package/src/client/styles/features/comment-card.css +236 -0
- package/src/client/styles/features/comment-markdown.css +127 -0
- package/src/client/styles/features/comment-overlays.css +60 -0
- package/src/client/styles/features/comments-drawer.css +120 -0
- package/src/client/styles/features/comments.css +4 -0
- package/src/client/styles/features/diagram-preview.css +227 -0
- package/src/client/styles/features/diff-commit.css +268 -0
- package/src/client/styles/features/diff-lines.css +160 -0
- package/src/client/styles/features/diff-toolbar.css +98 -0
- package/src/client/styles/features/diff.css +3 -0
- package/src/client/styles/features/embedded-preview.css +218 -0
- package/src/client/styles/features/git-branch.css +155 -0
- package/src/client/styles/features/git-files.css +105 -0
- package/src/client/styles/features/git-history.css +339 -0
- package/src/client/styles/features/git.css +3 -0
- package/src/client/styles/features/media-lightbox.css +157 -0
- package/src/client/styles/features/outline.css +115 -0
- package/src/client/styles/features/preview-content.css +3 -0
- package/src/client/styles/features/preview-markdown.css +201 -0
- package/src/client/styles/features/preview-sidebars.css +2 -0
- package/src/client/styles/features/quick-switcher.css +167 -0
- package/src/client/styles/foundation/themes.css +347 -0
- package/src/client/styles/foundation/tokens.css +66 -0
- package/src/client/styles/foundation/utilities.css +36 -0
- package/src/client/styles/layout/editor-page.css +303 -0
- package/src/client/styles/layout/overlays.css +132 -0
- package/src/client/styles/layout/responsive.css +331 -0
- package/src/client/styles/layout/shell.css +314 -0
- package/src/client/styles/layout/sidebar.css +209 -0
- package/src/client/styles/layout/view-modes.css +92 -0
- package/src/client/styles/overrides/codemirror.css +53 -0
- package/src/client/styles/overrides/highlightjs.css +7 -0
- package/src/client/styles/overrides/vendor.css +2 -0
- package/src/client/styles/primitives/controls.css +277 -0
- package/src/client/styles/style.css +25 -4945
- package/src/server/auth/create-auth-service.js +373 -15
- package/src/server/auth/session-cookie.js +30 -4
- package/src/server/config/build-info.js +76 -0
- package/src/server/config/env.js +130 -6
- package/src/server/create-app-server.js +8 -0
- package/src/server/domain/collaboration/collaboration-room.js +90 -47
- package/src/server/index.js +3 -1
- package/src/server/infrastructure/git/command-runner.js +2 -1
- package/src/server/infrastructure/git/git-service.js +48 -2
- package/src/server/infrastructure/git/history-service.js +683 -0
- package/src/server/infrastructure/git/parsers.js +30 -0
- package/src/server/infrastructure/git/responses.js +73 -0
- package/src/server/infrastructure/http/create-auth-api-handler.js +30 -2
- package/src/server/infrastructure/http/create-git-api-command-handler.js +2 -0
- package/src/server/infrastructure/http/create-git-api-handler.js +2 -0
- package/src/server/infrastructure/http/create-git-api-query-handler.js +61 -0
- package/src/server/infrastructure/http/create-request-handler.js +15 -0
- package/src/server/infrastructure/http/create-static-handler.js +11 -2
- package/src/server/infrastructure/http/create-vault-api-command-handler.js +67 -0
- package/src/server/infrastructure/persistence/path-utils.js +11 -0
- package/src/server/infrastructure/persistence/vault-file-store.js +158 -3
- package/src/server/infrastructure/workspace/workspace-mutation-coordinator.js +84 -3
- package/public/assets/css/base.css +0 -1
- package/public/assets/css/style.css +0 -1
- package/public/assets/js/chunks/CodeMirrorEditor-UCMRAMCV-MAKZFDBE.js +0 -12
- package/public/assets/js/chunks/apl-C5P5JBDI.js +0 -1
- package/public/assets/js/chunks/ar-SA-NXDWD63E-MF6HMEA4.js +0 -8
- package/public/assets/js/chunks/architecture-PBZL5I3N-55LDZ5WS.js +0 -1
- package/public/assets/js/chunks/architectureDiagram-2XIMDMQ5-2VP562X7.js +0 -36
- package/public/assets/js/chunks/asciiarmor-3NCLLELT.js +0 -1
- package/public/assets/js/chunks/asn1-KF4WXU3M.js +0 -1
- package/public/assets/js/chunks/asterisk-EA3VIN65.js +0 -1
- package/public/assets/js/chunks/az-AZ-MXSORGZV-AIGO4TNU.js +0 -1
- package/public/assets/js/chunks/bg-BG-O6MV2KSF-X6AVO2AF.js +0 -5
- package/public/assets/js/chunks/blockDiagram-WCTKOSBZ-KM56WWDE.js +0 -132
- package/public/assets/js/chunks/bn-BD-T2VJNT7N-7OMHRIGC.js +0 -3
- package/public/assets/js/chunks/bn-IN-MMW2ORAC-EPKMNKG7.js +0 -3
- package/public/assets/js/chunks/brainfuck-A3CTQVFD.js +0 -1
- package/public/assets/js/chunks/c4Diagram-IC4MRINW-KX6UEGQZ.js +0 -10
- package/public/assets/js/chunks/ca-ES-MKBCGNOG-U44SUUTN.js +0 -8
- package/public/assets/js/chunks/chunk-2NTQWLZD.js +0 -25
- package/public/assets/js/chunks/chunk-2YRP2AWD.js +0 -1
- package/public/assets/js/chunks/chunk-3BUCGSSJ.js +0 -1
- package/public/assets/js/chunks/chunk-47L7JGE3.js +0 -1
- package/public/assets/js/chunks/chunk-4BCHPULB.js +0 -1
- package/public/assets/js/chunks/chunk-4NKM6YFO.js +0 -161
- package/public/assets/js/chunks/chunk-4WGMPBK5.js +0 -1
- package/public/assets/js/chunks/chunk-55WF6Y2Q.js +0 -1
- package/public/assets/js/chunks/chunk-5QRWYPYT.js +0 -25
- package/public/assets/js/chunks/chunk-775E65SU.js +0 -1
- package/public/assets/js/chunks/chunk-AJRGTECU.js +0 -70
- package/public/assets/js/chunks/chunk-B2J3PHGY.js +0 -1
- package/public/assets/js/chunks/chunk-B4JKB3BC.js +0 -1
- package/public/assets/js/chunks/chunk-CGVY4PKT.js +0 -13
- package/public/assets/js/chunks/chunk-CVTRX3TE.js +0 -220
- package/public/assets/js/chunks/chunk-DW6KK6VF.js +0 -1
- package/public/assets/js/chunks/chunk-E2HMNOQL.js +0 -189
- package/public/assets/js/chunks/chunk-EPTJZP5H.js +0 -7
- package/public/assets/js/chunks/chunk-G7NUGGE7.js +0 -13
- package/public/assets/js/chunks/chunk-GFDM7YCF.js +0 -1
- package/public/assets/js/chunks/chunk-GI7LBIBP.js +0 -1
- package/public/assets/js/chunks/chunk-GXRL27M7.js +0 -1
- package/public/assets/js/chunks/chunk-H6EYDHRW.js +0 -1
- package/public/assets/js/chunks/chunk-HEWVH67U.js +0 -9
- package/public/assets/js/chunks/chunk-HOCBCDA5.js +0 -1
- package/public/assets/js/chunks/chunk-HS2CUOC6.js +0 -1
- package/public/assets/js/chunks/chunk-HUAS4BYI.js +0 -12
- package/public/assets/js/chunks/chunk-HVNNEPP5.js +0 -2
- package/public/assets/js/chunks/chunk-I2GVZI7W.js +0 -38
- package/public/assets/js/chunks/chunk-I6PVWGBN.js +0 -14
- package/public/assets/js/chunks/chunk-IZ3V3F2A.js +0 -1
- package/public/assets/js/chunks/chunk-KPAQHIOI.js +0 -1
- package/public/assets/js/chunks/chunk-M3EW4V74.js +0 -1
- package/public/assets/js/chunks/chunk-MK3AFU3C.js +0 -90
- package/public/assets/js/chunks/chunk-NM6J3ND7.js +0 -1
- package/public/assets/js/chunks/chunk-NO7UPWTU.js +0 -1
- package/public/assets/js/chunks/chunk-OHGDMMWM.js +0 -1
- package/public/assets/js/chunks/chunk-OOT2HALX.js +0 -1
- package/public/assets/js/chunks/chunk-OQLLZFFN.js +0 -1
- package/public/assets/js/chunks/chunk-PF6TP4EI.js +0 -1
- package/public/assets/js/chunks/chunk-PMOZMECZ.js +0 -85
- package/public/assets/js/chunks/chunk-QBGS6DJR.js +0 -1
- package/public/assets/js/chunks/chunk-QF3ZQ6UQ.js +0 -1
- package/public/assets/js/chunks/chunk-QFXMAUW4.js +0 -1
- package/public/assets/js/chunks/chunk-QYKIT2IH.js +0 -41
- package/public/assets/js/chunks/chunk-S75BI2UQ.js +0 -1
- package/public/assets/js/chunks/chunk-SKEZZ3H6.js +0 -1
- package/public/assets/js/chunks/chunk-SO6QBCB6.js +0 -1
- package/public/assets/js/chunks/chunk-TFP6LRYJ.js +0 -53
- package/public/assets/js/chunks/chunk-VOODXHXA.js +0 -1
- package/public/assets/js/chunks/chunk-W7WJUTSA.js +0 -3
- package/public/assets/js/chunks/chunk-WNXFO2F2.js +0 -1
- package/public/assets/js/chunks/chunk-X6EEYWV4.js +0 -6
- package/public/assets/js/chunks/chunk-YVW3ZETS.js +0 -1
- package/public/assets/js/chunks/chunk-ZR2QRTBG.js +0 -339
- package/public/assets/js/chunks/chunk-ZZJX4LQ2.js +0 -1
- package/public/assets/js/chunks/classDiagram-VBA2DB6C-IYW4O2RM.js +0 -1
- package/public/assets/js/chunks/classDiagram-v2-RAHNMMFH-DNKVN2WD.js +0 -1
- package/public/assets/js/chunks/clike-RTBH33GE.js +0 -1
- package/public/assets/js/chunks/clojure-BR2VJ2JI.js +0 -1
- package/public/assets/js/chunks/cmake-2HEWVFEE.js +0 -1
- package/public/assets/js/chunks/cobol-V6EIK6DN.js +0 -1
- package/public/assets/js/chunks/coffeescript-JW3ZOGMD.js +0 -1
- package/public/assets/js/chunks/commonlisp-UCWSIHYK.js +0 -1
- package/public/assets/js/chunks/cose-bilkent-S5V4N54A-QVYRFFNC.js +0 -1
- package/public/assets/js/chunks/crystal-GR4VLC3M.js +0 -1
- package/public/assets/js/chunks/cs-CZ-V77HGUP7-OLBAKFG5.js +0 -7
- package/public/assets/js/chunks/css-C5DVWGB4.js +0 -1
- package/public/assets/js/chunks/cypher-K7FZM5GC.js +0 -1
- package/public/assets/js/chunks/d-CF3QNNH5.js +0 -1
- package/public/assets/js/chunks/da-DK-I5RFNTM4-QJIG2SEZ.js +0 -2
- package/public/assets/js/chunks/dagre-KLK3FWXG-KVNBUDOY.js +0 -4
- package/public/assets/js/chunks/de-CH-WLRDEVBV-4MMJDMVD.js +0 -7
- package/public/assets/js/chunks/de-DE-DTI4WUSC-ML7C46TT.js +0 -7
- package/public/assets/js/chunks/diagram-E7M64L7V-ZP33VRUC.js +0 -24
- package/public/assets/js/chunks/diagram-IFDJBPK2-ZG35YWOD.js +0 -43
- package/public/assets/js/chunks/diagram-P4PSJMXO-ZGIGM7D2.js +0 -24
- package/public/assets/js/chunks/diff-KOMSZU7O.js +0 -1
- package/public/assets/js/chunks/dist-7RQKSOUX.js +0 -7
- package/public/assets/js/chunks/dist-ARWGZ6MN.js +0 -1
- package/public/assets/js/chunks/dist-DPBSGC3Y.js +0 -2
- package/public/assets/js/chunks/dist-E36PJE5M.js +0 -1
- package/public/assets/js/chunks/dist-E5NM7OBW.js +0 -1
- package/public/assets/js/chunks/dist-ERADYPEK.js +0 -1
- package/public/assets/js/chunks/dist-F43RIHBZ.js +0 -1
- package/public/assets/js/chunks/dist-HAB5NIXI.js +0 -1
- package/public/assets/js/chunks/dist-HG23OLRA.js +0 -1
- package/public/assets/js/chunks/dist-IEJXBSDJ.js +0 -1
- package/public/assets/js/chunks/dist-IQA4KVJK.js +0 -1
- package/public/assets/js/chunks/dist-OIQTNVT2.js +0 -3
- package/public/assets/js/chunks/dist-PMZJ734S.js +0 -1
- package/public/assets/js/chunks/dist-RCQFQRLD.js +0 -1
- package/public/assets/js/chunks/dist-RQLC4GVI.js +0 -1
- package/public/assets/js/chunks/dist-RSJGLSKC.js +0 -1
- package/public/assets/js/chunks/dist-SGNQZVVX.js +0 -1
- package/public/assets/js/chunks/dist-VCFTF7Z6.js +0 -1
- package/public/assets/js/chunks/dist-VTO23SHH.js +0 -1
- package/public/assets/js/chunks/dist-XOODBV4L.js +0 -1
- package/public/assets/js/chunks/dist-ZFZNCRZY.js +0 -1
- package/public/assets/js/chunks/dockerfile-XCIKYOSI.js +0 -1
- package/public/assets/js/chunks/dtd-3XFH7W6Z.js +0 -1
- package/public/assets/js/chunks/dylan-3UWPKVOR.js +0 -1
- package/public/assets/js/chunks/ebnf-OLHTL3VN.js +0 -1
- package/public/assets/js/chunks/ecl-43LZ3ZRM.js +0 -1
- package/public/assets/js/chunks/editor-session-EAUBJCHH.js +0 -22
- package/public/assets/js/chunks/eiffel-ISPO2UJF.js +0 -1
- package/public/assets/js/chunks/el-GR-ZXDJ2OS4-WSCEIO6J.js +0 -7
- package/public/assets/js/chunks/elm-CLK576PK.js +0 -1
- package/public/assets/js/chunks/en-CTDJDZ6K-IC3QAUOI.js +0 -1
- package/public/assets/js/chunks/erDiagram-INFDFZHY-ZMS6H2TH.js +0 -70
- package/public/assets/js/chunks/erlang-AVQXQFOT.js +0 -1
- package/public/assets/js/chunks/es-ES-DYQHAD43-XGB5X5IM.js +0 -7
- package/public/assets/js/chunks/eu-ES-QDSYU5Y3-LA3JTIJ2.js +0 -7
- package/public/assets/js/chunks/excalidraw-mermaid-stub-NYXTOJ4H.js +0 -1
- package/public/assets/js/chunks/fa-IR-26LZG4PM-PFALMEDX.js +0 -9
- package/public/assets/js/chunks/factor-CRTVBD6Q.js +0 -1
- package/public/assets/js/chunks/fcl-FX24LKTH.js +0 -1
- package/public/assets/js/chunks/fi-FI-6YS4KDE4-ES5MV6P4.js +0 -6
- package/public/assets/js/chunks/flowDiagram-PKNHOUZH-QD4L5IE5.js +0 -162
- package/public/assets/js/chunks/forth-YKDKCTVS.js +0 -1
- package/public/assets/js/chunks/fortran-UJWC6SLU.js +0 -1
- package/public/assets/js/chunks/fr-FR-BRLLPTZC-VMFE22YV.js +0 -12
- package/public/assets/js/chunks/ganttDiagram-A5KZAMGK-VTMTQESP.js +0 -292
- package/public/assets/js/chunks/gas-MYEMWGRE.js +0 -1
- package/public/assets/js/chunks/gherkin-JWHAU2YG.js +0 -1
- package/public/assets/js/chunks/gitGraph-HDMCJU4V-YPHS74XX.js +0 -1
- package/public/assets/js/chunks/gitGraphDiagram-K3NZZRJ6-Z3EZ634T.js +0 -65
- package/public/assets/js/chunks/gl-ES-OKUZTLYG-GPT42ZHV.js +0 -6
- package/public/assets/js/chunks/groovy-QZIZQIAK.js +0 -1
- package/public/assets/js/chunks/haskell-JR3G7YNW.js +0 -1
- package/public/assets/js/chunks/haxe-TVLAIYEN.js +0 -1
- package/public/assets/js/chunks/he-IL-26MGYIU7-VQ5XQYYY.js +0 -8
- package/public/assets/js/chunks/hi-IN-Q4ZOGTP2-2Z766MXA.js +0 -3
- package/public/assets/js/chunks/http-YXQRE77G.js +0 -1
- package/public/assets/js/chunks/hu-HU-P2OXPSN5-6XDVPGTE.js +0 -3
- package/public/assets/js/chunks/id-ID-2EIKXYN6-J5GWSY2S.js +0 -8
- package/public/assets/js/chunks/idl-RAQGJ6LJ.js +0 -1
- package/public/assets/js/chunks/image-32MOCVDX-JN2EUMQG.js +0 -1
- package/public/assets/js/chunks/image-blob-reduce.esm-K5OWL55S.js +0 -13
- package/public/assets/js/chunks/info-3K5VOQVL-CXJSPNNP.js +0 -1
- package/public/assets/js/chunks/infoDiagram-LFFYTUFH-WQ34MUJA.js +0 -2
- package/public/assets/js/chunks/ishikawaDiagram-PHBUUO56-4IARWKJK.js +0 -70
- package/public/assets/js/chunks/it-IT-4CFKVXI2-NMBWUWFF.js +0 -12
- package/public/assets/js/chunks/ja-JP-MAND2Z4V-GQZYXXOC.js +0 -7
- package/public/assets/js/chunks/javascript-NM7KDJUE.js +0 -1
- package/public/assets/js/chunks/journeyDiagram-4ABVD52K-FJ4LF4SX.js +0 -139
- package/public/assets/js/chunks/julia-LG3BH25B.js +0 -1
- package/public/assets/js/chunks/kaa-HQRTCXTJ-7D6PAKDJ.js +0 -1
- package/public/assets/js/chunks/kab-KAB-JKIKKTGH-TNKFXNAX.js +0 -4
- package/public/assets/js/chunks/kanban-definition-K7BYSVSG-TY4EVYI3.js +0 -89
- package/public/assets/js/chunks/katex-5YJCUCFD.js +0 -261
- package/public/assets/js/chunks/kk-KZ-HXQ63ZFC-T4HCMWED.js +0 -1
- package/public/assets/js/chunks/km-KH-PKL3LSGX-HTLHEJV6.js +0 -7
- package/public/assets/js/chunks/ko-KR-KXLREZX3-QMR52QVI.js +0 -5
- package/public/assets/js/chunks/ku-TR-MJ4IER3X-K5CNY4UO.js +0 -6
- package/public/assets/js/chunks/livescript-4CVWVI4M.js +0 -1
- package/public/assets/js/chunks/lt-LT-H6WFQ6FJ-IW25FAGX.js +0 -3
- package/public/assets/js/chunks/lua-VWGE7DQ7.js +0 -1
- package/public/assets/js/chunks/lv-LV-GOCK6SJW-KTDFW5OH.js +0 -4
- package/public/assets/js/chunks/mathematica-D7APQSEU.js +0 -1
- package/public/assets/js/chunks/mbox-BN3XQBYX.js +0 -1
- package/public/assets/js/chunks/mermaid-runtime-BIFNJ2CT.js +0 -18
- package/public/assets/js/chunks/mindmap-definition-YRQLILUH-5B565RNP.js +0 -68
- package/public/assets/js/chunks/mirc-565WBI76.js +0 -1
- package/public/assets/js/chunks/mllike-VV3KS46B.js +0 -1
- package/public/assets/js/chunks/modelica-EGX44FZV.js +0 -1
- package/public/assets/js/chunks/mr-IN-IXVLDMEQ-PHM5DT7Q.js +0 -9
- package/public/assets/js/chunks/mscgen-GFGTHENT.js +0 -1
- package/public/assets/js/chunks/mumps-POZYWSMI.js +0 -1
- package/public/assets/js/chunks/my-MM-YG6MYTTD-ZHLCMEVA.js +0 -1
- package/public/assets/js/chunks/nb-NO-XGWJISD2-KSDFG6YU.js +0 -8
- package/public/assets/js/chunks/nginx-JUBX55EU.js +0 -1
- package/public/assets/js/chunks/nl-NL-XVDVCPNC-KVF3ZO2R.js +0 -13
- package/public/assets/js/chunks/nn-NO-EMX5MJX5-34QKSHNR.js +0 -4
- package/public/assets/js/chunks/nsis-RC4CREGM.js +0 -1
- package/public/assets/js/chunks/ntriples-4WK6CNVE.js +0 -1
- package/public/assets/js/chunks/oc-FR-ROEINTVO-5GP4AOYO.js +0 -4
- package/public/assets/js/chunks/octave-GOKFN2V7.js +0 -1
- package/public/assets/js/chunks/oz-OQUMNC63.js +0 -1
- package/public/assets/js/chunks/pa-IN-ZYN6SUDY-MVL7O44W.js +0 -4
- package/public/assets/js/chunks/packet-RMMSAZCW-D7XTR5TT.js +0 -1
- package/public/assets/js/chunks/pascal-BBWQWWWD.js +0 -1
- package/public/assets/js/chunks/percentages-5DKR754L-DG7W23CV.js +0 -1
- package/public/assets/js/chunks/perl-KTPJTTAM.js +0 -1
- package/public/assets/js/chunks/pica-6G3NROWT.js +0 -17
- package/public/assets/js/chunks/pie-UPGHQEXC-KGC3O6LN.js +0 -1
- package/public/assets/js/chunks/pieDiagram-SKSYHLDU-KWKRDEZS.js +0 -30
- package/public/assets/js/chunks/pig-IJMBS4FZ.js +0 -1
- package/public/assets/js/chunks/pl-PL-6VTG7PHC-VADRWSX4.js +0 -12
- package/public/assets/js/chunks/powershell-6YGCBHDP.js +0 -1
- package/public/assets/js/chunks/preview-render-compiler-6Y7TKXFJ.js +0 -1
- package/public/assets/js/chunks/properties-5QTD3364.js +0 -1
- package/public/assets/js/chunks/protobuf-LTRWBIK3.js +0 -1
- package/public/assets/js/chunks/pt-BR-5YFKRR5G-HHF4UPO4.js +0 -6
- package/public/assets/js/chunks/pt-PT-GEIXXZ67-TUTAUZJK.js +0 -8
- package/public/assets/js/chunks/pug-U4PV3WLG.js +0 -1
- package/public/assets/js/chunks/puppet-WGYJPR3Y.js +0 -1
- package/public/assets/js/chunks/python-6YGH4S47.js +0 -1
- package/public/assets/js/chunks/q-VIG4IJLI.js +0 -1
- package/public/assets/js/chunks/quadrantDiagram-337W2JSQ-GWQRUFHQ.js +0 -7
- package/public/assets/js/chunks/quick-switcher-controller-A6SKH5HI.js +0 -5
- package/public/assets/js/chunks/r-NVPCXGTR.js +0 -1
- package/public/assets/js/chunks/radar-KQ55EAFF-OPO64DRI.js +0 -1
- package/public/assets/js/chunks/requirementDiagram-Z7DCOOCP-ASW7IPJL.js +0 -73
- package/public/assets/js/chunks/ro-RO-E2P6TFZI-RJFCULYF.js +0 -12
- package/public/assets/js/chunks/roundRect-Z3DX3W5S.js +0 -1
- package/public/assets/js/chunks/rpm-UEA257HD.js +0 -1
- package/public/assets/js/chunks/ru-RU-YBIIY43T-BF27TNVK.js +0 -10
- package/public/assets/js/chunks/ruby-KPQRAJGE.js +0 -1
- package/public/assets/js/chunks/sankeyDiagram-WA2Y5GQK-W6BBWCLW.js +0 -10
- package/public/assets/js/chunks/sas-L7VATVH5.js +0 -1
- package/public/assets/js/chunks/scheme-T2NOWR3P.js +0 -1
- package/public/assets/js/chunks/sequenceDiagram-2WXFIKYE-H4G3ISLN.js +0 -145
- package/public/assets/js/chunks/shell-DLVDUNFA.js +0 -1
- package/public/assets/js/chunks/si-LK-673C2CI2-IOFGU4U2.js +0 -1
- package/public/assets/js/chunks/sieve-BKBZYDBU.js +0 -1
- package/public/assets/js/chunks/sk-SK-CKZHQ4AP-6O5JGN26.js +0 -7
- package/public/assets/js/chunks/sl-SI-557H2GWM-2NEHLV7W.js +0 -6
- package/public/assets/js/chunks/smalltalk-WRJQKJSD.js +0 -1
- package/public/assets/js/chunks/solr-66B3BIDL.js +0 -1
- package/public/assets/js/chunks/sparql-S25Z47JG.js +0 -1
- package/public/assets/js/chunks/spreadsheet-B272EF7Y.js +0 -1
- package/public/assets/js/chunks/sql-BPLIIUYC.js +0 -1
- package/public/assets/js/chunks/stateDiagram-RAJIS63D-OF5XXRUS.js +0 -1
- package/public/assets/js/chunks/stateDiagram-v2-FVOUBMTO-IV2CSQSQ.js +0 -1
- package/public/assets/js/chunks/stex-4IJY64QX.js +0 -1
- package/public/assets/js/chunks/stylus-PJUHLGPT.js +0 -1
- package/public/assets/js/chunks/subset-shared.chunk-4NMWHS4D.js +0 -1
- package/public/assets/js/chunks/subset-worker.chunk-NTLP7Y66.js +0 -1
- package/public/assets/js/chunks/sv-SE-XOPKKDWS-Q2L6KGFV.js +0 -8
- package/public/assets/js/chunks/swift-UYHTO4SX.js +0 -1
- package/public/assets/js/chunks/ta-IN-XBH7DQI3-ISSUGZAK.js +0 -6
- package/public/assets/js/chunks/tcl-OQ5J3VO2.js +0 -1
- package/public/assets/js/chunks/textile-NOGVBEYF.js +0 -1
- package/public/assets/js/chunks/th-TH-TOCWH3R4-TABEAMJA.js +0 -1
- package/public/assets/js/chunks/tiddlywiki-SYTK4QUE.js +0 -1
- package/public/assets/js/chunks/tiki-P7K4ZLOM.js +0 -1
- package/public/assets/js/chunks/timeline-definition-YZTLITO2-HBCANIUC.js +0 -61
- package/public/assets/js/chunks/toml-AUZYRP36.js +0 -1
- package/public/assets/js/chunks/tr-TR-GXW6CYY5-5NQRN52Y.js +0 -4
- package/public/assets/js/chunks/treemap-KZPCXAKY-WYMCT5F7.js +0 -1
- package/public/assets/js/chunks/troff-XFYJNQOJ.js +0 -1
- package/public/assets/js/chunks/ttcn-AK2IXWU6.js +0 -1
- package/public/assets/js/chunks/ttcn-cfg-3IDPIYPU.js +0 -1
- package/public/assets/js/chunks/turtle-OIDMF46P.js +0 -1
- package/public/assets/js/chunks/uk-UA-IJKTNUDG-2IIL3TO5.js +0 -6
- package/public/assets/js/chunks/uz-UZ-TBZZEA4V-X22KVKBP.js +0 -1
- package/public/assets/js/chunks/vb-J6K4XVA2.js +0 -1
- package/public/assets/js/chunks/vbscript-FM7DDZZE.js +0 -1
- package/public/assets/js/chunks/velocity-6KZFEOFD.js +0 -1
- package/public/assets/js/chunks/vennDiagram-LZ73GAT5-EBRF3MZR.js +0 -34
- package/public/assets/js/chunks/verilog-EWWQPMNN.js +0 -1
- package/public/assets/js/chunks/vhdl-CJ3M4IHI.js +0 -1
- package/public/assets/js/chunks/vi-VN-MULSGNVB-TENM65C7.js +0 -7
- package/public/assets/js/chunks/webidl-XVBHXCRV.js +0 -1
- package/public/assets/js/chunks/xquery-7WZOZ4UK.js +0 -1
- package/public/assets/js/chunks/xychartDiagram-JWTSCODW-WIFVRQPR.js +0 -7
- package/public/assets/js/chunks/yacas-MZ2ZZPF3.js +0 -1
- package/public/assets/js/chunks/z80-I447CBF7.js +0 -1
- package/public/assets/js/chunks/zh-CN-MVX3E32U-S5VA2BA5.js +0 -11
- package/public/assets/js/chunks/zh-HK-JNU5RLIE-A4VUKZFV.js +0 -1
- package/public/assets/js/chunks/zh-TW-LENVCA6T-KFB6KHMM.js +0 -9
- package/public/assets/js/excalidraw-editor-7ORML5YA.css +0 -1
- package/public/assets/js/excalidraw-editor-TCIH6GJL.js +0 -347
- package/public/assets/js/excalidraw-editor.css +0 -1
- package/public/assets/js/excalidraw-editor.js +0 -1
- package/public/assets/js/main.js +0 -381
- package/public/assets/js/preview-render-worker.js +0 -30
- /package/{public/assets/js/assets/Assistant-Bold-ZDZZ6JHA.woff2 → dist/client/assets/Assistant-Bold-gm-uSS1B.woff2} +0 -0
- /package/{public/assets/js/assets/Assistant-Medium-DZ25RZU3.woff2 → dist/client/assets/Assistant-Medium-DrcxCXg3.woff2} +0 -0
- /package/{public/assets/js/assets/Assistant-Regular-PLF2XOGW.woff2 → dist/client/assets/Assistant-Regular-DVxZuzxb.woff2} +0 -0
- /package/{public/assets/js/assets/Assistant-SemiBold-CZ5MX6FK.woff2 → dist/client/assets/Assistant-SemiBold-SCI4bEL9.woff2} +0 -0
- /package/{public → src/client}/assets/vendor/highlight/github-dark.min.css +0 -0
- /package/{public → src/client}/assets/vendor/highlight/github.min.css +0 -0
|
@@ -1,297 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from '
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const COMMENT_CARD_OFFSET = 14;
|
|
8
|
-
const COMMENT_CARD_WIDTH = 520;
|
|
9
|
-
const COMMENT_SELECTION_REVEAL_DELAY_MS = 150;
|
|
10
|
-
const COMMENT_SELECTION_CHIP_GAP = 12;
|
|
11
|
-
const COMMENT_CONTROL_SLOT_HEIGHT = 36;
|
|
12
|
-
const COMMENT_PREVIEW_RAIL_SLOT_HEIGHT = 30;
|
|
13
|
-
const COMMENT_PREVIEW_RAIL_MIN_WIDTH = 400;
|
|
14
|
-
const COMMENT_PREVIEW_RAIL_BREAKPOINT = 769;
|
|
15
|
-
const COMMENT_REACTION_PRESET_EMOJIS = Object.freeze(['👍', '❤️', '🎉', '👀', '🚀']);
|
|
16
|
-
const COMMENT_REACTION_MORE_EMOJIS = Object.freeze(['😂', '🔥', '✅', '🙏', '💡', '🤔', '👏', '😄', '🎯', '🙌']);
|
|
17
|
-
|
|
18
|
-
function clamp(value, min, max) {
|
|
19
|
-
return Math.min(Math.max(value, min), max);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function sortThreads(threads = []) {
|
|
23
|
-
return [...threads].sort((left, right) => (
|
|
24
|
-
(left.anchor?.startLine ?? 0) - (right.anchor?.startLine ?? 0)
|
|
25
|
-
|| left.createdAt - right.createdAt
|
|
26
|
-
));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function getAnchorKind(anchor) {
|
|
30
|
-
return anchor?.anchorKind || anchor?.kind || 'line';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function isTextSelectionAnchor(anchor) {
|
|
34
|
-
return getAnchorKind(anchor) === 'text'
|
|
35
|
-
&& Number.isFinite(anchor?.startIndex)
|
|
36
|
-
&& Number.isFinite(anchor?.endIndex)
|
|
37
|
-
&& anchor.endIndex > anchor.startIndex;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function areAnchorsEqual(left, right) {
|
|
41
|
-
if (left === right) {
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
if (!left || !right) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return getAnchorKind(left) === getAnchorKind(right)
|
|
49
|
-
&& (left.startIndex ?? null) === (right.startIndex ?? null)
|
|
50
|
-
&& (left.endIndex ?? null) === (right.endIndex ?? null)
|
|
51
|
-
&& (left.startLine ?? null) === (right.startLine ?? null)
|
|
52
|
-
&& (left.endLine ?? null) === (right.endLine ?? null)
|
|
53
|
-
&& (left.anchorQuote ?? left.quote ?? '') === (right.anchorQuote ?? right.quote ?? '');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function formatAnchorLabel(anchor) {
|
|
57
|
-
if (!anchor) {
|
|
58
|
-
return 'No source anchor';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if ((anchor.kind || anchor.anchorKind) === 'text' && anchor.quote) {
|
|
62
|
-
return anchor.startLine === anchor.endLine
|
|
63
|
-
? `Line ${anchor.startLine}`
|
|
64
|
-
: `Lines ${anchor.startLine}-${anchor.endLine}`;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return anchor.startLine === anchor.endLine
|
|
68
|
-
? `Line ${anchor.startLine}`
|
|
69
|
-
: `Lines ${anchor.startLine}-${anchor.endLine}`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function getAnchorGroupKey(anchor = {}) {
|
|
73
|
-
return [
|
|
74
|
-
anchor.kind || anchor.anchorKind || 'line',
|
|
75
|
-
anchor.startLine ?? 0,
|
|
76
|
-
anchor.endLine ?? 0,
|
|
77
|
-
anchor.quote || '',
|
|
78
|
-
].join('::');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function isLeafSourceBlock(element) {
|
|
82
|
-
return element && !element.querySelector('[data-source-line]');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function parseLineNumber(value) {
|
|
86
|
-
const parsed = Number.parseInt(value || '', 10);
|
|
87
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getLatestMessage(messages = []) {
|
|
91
|
-
return messages.reduce((latest, message) => {
|
|
92
|
-
if (!latest) {
|
|
93
|
-
return message;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return (message?.createdAt ?? 0) >= (latest?.createdAt ?? 0)
|
|
97
|
-
? message
|
|
98
|
-
: latest;
|
|
99
|
-
}, null);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function getLatestGroupMessage(group) {
|
|
103
|
-
return group?.threads?.reduce((latest, thread) => {
|
|
104
|
-
const next = getLatestMessage(thread?.messages ?? []);
|
|
105
|
-
if (!next) {
|
|
106
|
-
return latest;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return (next.createdAt ?? 0) >= (latest?.createdAt ?? 0)
|
|
110
|
-
? next
|
|
111
|
-
: latest;
|
|
112
|
-
}, null);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function createRenderedCommentBody(body, className = 'comment-markdown') {
|
|
116
|
-
const container = document.createElement('div');
|
|
117
|
-
container.className = className;
|
|
118
|
-
container.innerHTML = renderCommentMarkdownToHtml(body);
|
|
119
|
-
return container;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function hasLocalReaction(reaction, localUserId) {
|
|
123
|
-
return Boolean(localUserId && reaction?.users?.some((user) => user?.userId === localUserId));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function formatReactionCount(reaction) {
|
|
127
|
-
return String(Array.isArray(reaction?.users) ? reaction.users.length : 0);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function isReactionPickerOpen(reactionPicker, threadId, messageId) {
|
|
131
|
-
return reactionPicker?.threadId === threadId && reactionPicker?.messageId === messageId;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function getReactionPickerBounds(card) {
|
|
135
|
-
const picker = card?.querySelector?.('.comment-reaction-picker');
|
|
136
|
-
const wrap = picker?.closest?.('.comment-reaction-picker-wrap');
|
|
137
|
-
const scroll = card?.querySelector?.('.comment-card-scroll');
|
|
138
|
-
if (!(picker instanceof HTMLElement) || !(wrap instanceof HTMLElement) || !(scroll instanceof HTMLElement)) {
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return { picker, scroll, wrap };
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function overlapsAnchorRange(element, anchor) {
|
|
146
|
-
const startLine = parseLineNumber(element?.getAttribute?.('data-source-line'));
|
|
147
|
-
const endLine = parseLineNumber(element?.getAttribute?.('data-source-line-end')) ?? startLine;
|
|
148
|
-
if (!startLine || !endLine || !anchor) {
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return anchor.startLine <= endLine && anchor.endLine >= startLine;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function createNormalizedTextIndex(root) {
|
|
156
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
157
|
-
let normalized = '';
|
|
158
|
-
const map = [];
|
|
159
|
-
let lastWasWhitespace = true;
|
|
160
|
-
|
|
161
|
-
while (walker.nextNode()) {
|
|
162
|
-
const node = walker.currentNode;
|
|
163
|
-
const text = node.textContent || '';
|
|
164
|
-
for (let index = 0; index < text.length; index += 1) {
|
|
165
|
-
const char = text[index];
|
|
166
|
-
const isWhitespace = /\s/.test(char);
|
|
167
|
-
if (isWhitespace) {
|
|
168
|
-
if (lastWasWhitespace) {
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
normalized += ' ';
|
|
173
|
-
map.push({ node, offset: index });
|
|
174
|
-
lastWasWhitespace = true;
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
normalized += char;
|
|
179
|
-
map.push({ node, offset: index });
|
|
180
|
-
lastWasWhitespace = false;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
while (normalized.endsWith(' ')) {
|
|
185
|
-
normalized = normalized.slice(0, -1);
|
|
186
|
-
map.pop();
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return { map, normalized };
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function findUniqueQuoteRange(root, quote) {
|
|
193
|
-
const normalizedQuote = normalizeCommentQuoteForComparison(quote);
|
|
194
|
-
if (!root || !normalizedQuote) {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const index = createNormalizedTextIndex(root);
|
|
199
|
-
if (!index.normalized) {
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const matchIndex = index.normalized.indexOf(normalizedQuote);
|
|
204
|
-
if (matchIndex < 0) {
|
|
205
|
-
return null;
|
|
206
|
-
}
|
|
207
|
-
if (index.normalized.indexOf(normalizedQuote, matchIndex + 1) >= 0) {
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const start = index.map[matchIndex];
|
|
212
|
-
const end = index.map[matchIndex + normalizedQuote.length - 1];
|
|
213
|
-
if (!start || !end) {
|
|
214
|
-
return null;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const range = document.createRange();
|
|
218
|
-
range.setStart(start.node, start.offset);
|
|
219
|
-
range.setEnd(end.node, end.offset + 1);
|
|
220
|
-
return range;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function toRelativeRect(rect, containerRect) {
|
|
224
|
-
return {
|
|
225
|
-
bottom: rect.bottom - containerRect.top,
|
|
226
|
-
height: rect.height,
|
|
227
|
-
left: rect.left - containerRect.left,
|
|
228
|
-
right: rect.right - containerRect.left,
|
|
229
|
-
top: rect.top - containerRect.top,
|
|
230
|
-
width: rect.width,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
function createRectFromRects(rects = []) {
|
|
235
|
-
if (!Array.isArray(rects) || rects.length === 0) {
|
|
236
|
-
return null;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const left = Math.min(...rects.map((rect) => rect.left));
|
|
240
|
-
const top = Math.min(...rects.map((rect) => rect.top));
|
|
241
|
-
const right = Math.max(...rects.map((rect) => rect.right));
|
|
242
|
-
const bottom = Math.max(...rects.map((rect) => rect.bottom));
|
|
243
|
-
|
|
244
|
-
return {
|
|
245
|
-
bottom,
|
|
246
|
-
height: bottom - top,
|
|
247
|
-
left,
|
|
248
|
-
right,
|
|
249
|
-
top,
|
|
250
|
-
width: right - left,
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function pointIntersectsRect(x, y, rect) {
|
|
255
|
-
if (!rect) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return x >= rect.left
|
|
260
|
-
&& x <= rect.right
|
|
261
|
-
&& y >= rect.top
|
|
262
|
-
&& y <= rect.bottom;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
function normalizeGroupKeys(keys = []) {
|
|
266
|
-
return [...new Set(keys.filter(Boolean))].sort();
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
function serializeGroupKeys(keys = []) {
|
|
270
|
-
return normalizeGroupKeys(keys).join(' ');
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
function createCommentMarkerContent(count) {
|
|
274
|
-
const fragment = document.createDocumentFragment();
|
|
275
|
-
|
|
276
|
-
const icon = document.createElement('span');
|
|
277
|
-
icon.className = 'comment-marker-icon';
|
|
278
|
-
icon.setAttribute('aria-hidden', 'true');
|
|
279
|
-
icon.innerHTML = `
|
|
280
|
-
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
281
|
-
<path d="M3 4.75A1.75 1.75 0 0 1 4.75 3h6.5A1.75 1.75 0 0 1 13 4.75v4.5A1.75 1.75 0 0 1 11.25 11H8.9L6.5 13v-2H4.75A1.75 1.75 0 0 1 3 9.25v-4.5Z" stroke="currentColor" stroke-width="1.35" stroke-linejoin="round"/>
|
|
282
|
-
</svg>
|
|
283
|
-
`;
|
|
284
|
-
fragment.appendChild(icon);
|
|
285
|
-
|
|
286
|
-
if (count > 1) {
|
|
287
|
-
const countBadge = document.createElement('span');
|
|
288
|
-
countBadge.className = 'comment-marker-count';
|
|
289
|
-
countBadge.textContent = String(count);
|
|
290
|
-
fragment.appendChild(countBadge);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return fragment;
|
|
294
|
-
}
|
|
1
|
+
import { commentUiCardMethods } from './comment-ui/comment-ui-card.js';
|
|
2
|
+
import { commentUiLayoutMethods } from './comment-ui/comment-ui-layout.js';
|
|
3
|
+
import { commentUiRenderMethods } from './comment-ui/comment-ui-render.js';
|
|
4
|
+
import { commentUiStateMethods } from './comment-ui/comment-ui-state.js';
|
|
5
|
+
import { isTextSelectionAnchor } from './comment-ui/comment-ui-shared.js';
|
|
295
6
|
|
|
296
7
|
export class CommentUiController {
|
|
297
8
|
constructor({
|
|
@@ -516,1239 +227,12 @@ export class CommentUiController {
|
|
|
516
227
|
this.previewLayer?.remove();
|
|
517
228
|
this.pendingCardFocusElement = null;
|
|
518
229
|
}
|
|
519
|
-
|
|
520
|
-
attachSession(session) {
|
|
521
|
-
this.session?.getScrollContainer?.()?.removeEventListener('scroll', this.handleEditorScroll);
|
|
522
|
-
this.session = session;
|
|
523
|
-
this.selectionAnchor = session?.getCurrentSelectionCommentAnchor?.() ?? null;
|
|
524
|
-
this.pendingSelectionAnchor = null;
|
|
525
|
-
this.committedSelectionAnchor = null;
|
|
526
|
-
this.reactionPicker = null;
|
|
527
|
-
this.clearSelectionRevealTimer();
|
|
528
|
-
this.pointerSelecting = false;
|
|
529
|
-
session?.getScrollContainer?.()?.addEventListener('scroll', this.handleEditorScroll, { passive: true });
|
|
530
|
-
this.render();
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
setCurrentFile(filePath, { fileKind = 'markdown', supported = false } = {}) {
|
|
534
|
-
const didChangeFile = this.currentFile !== filePath;
|
|
535
|
-
this.currentFile = filePath;
|
|
536
|
-
this.fileKind = fileKind;
|
|
537
|
-
this.supported = Boolean(filePath && supported);
|
|
538
|
-
if (didChangeFile) {
|
|
539
|
-
this.drawerOpen = false;
|
|
540
|
-
this.threads = [];
|
|
541
|
-
this.selectionAnchor = null;
|
|
542
|
-
this.pendingSelectionAnchor = null;
|
|
543
|
-
this.committedSelectionAnchor = null;
|
|
544
|
-
this.clearSelectionRevealTimer();
|
|
545
|
-
this.pointerSelecting = false;
|
|
546
|
-
this.activeCard = null;
|
|
547
|
-
this.updateHoveredEditorGroups([]);
|
|
548
|
-
this.updateHoveredPreviewGroups([]);
|
|
549
|
-
this.previewHoverRegions = [];
|
|
550
|
-
this.lastPreviewPointerPosition = null;
|
|
551
|
-
this.reactionPicker = null;
|
|
552
|
-
}
|
|
553
|
-
if (!this.supported) {
|
|
554
|
-
this.drawerOpen = false;
|
|
555
|
-
this.activeCard = null;
|
|
556
|
-
this.threads = [];
|
|
557
|
-
this.selectionAnchor = null;
|
|
558
|
-
this.pendingSelectionAnchor = null;
|
|
559
|
-
this.committedSelectionAnchor = null;
|
|
560
|
-
this.clearSelectionRevealTimer();
|
|
561
|
-
this.pointerSelecting = false;
|
|
562
|
-
this.updateHoveredEditorGroups([]);
|
|
563
|
-
this.updateHoveredPreviewGroups([]);
|
|
564
|
-
this.previewHoverRegions = [];
|
|
565
|
-
this.lastPreviewPointerPosition = null;
|
|
566
|
-
this.reactionPicker = null;
|
|
567
|
-
}
|
|
568
|
-
this.render();
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
setSelectionAnchor(anchor) {
|
|
572
|
-
this.selectionAnchor = this.supported ? anchor : null;
|
|
573
|
-
if (!this.supported || !this.selectionAnchor) {
|
|
574
|
-
this.pendingSelectionAnchor = null;
|
|
575
|
-
this.committedSelectionAnchor = null;
|
|
576
|
-
this.clearSelectionRevealTimer();
|
|
577
|
-
this.renderToolbar();
|
|
578
|
-
this.scheduleLayoutRefresh();
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
if (!isTextSelectionAnchor(this.selectionAnchor)) {
|
|
583
|
-
this.pendingSelectionAnchor = null;
|
|
584
|
-
this.committedSelectionAnchor = null;
|
|
585
|
-
this.clearSelectionRevealTimer();
|
|
586
|
-
this.renderToolbar();
|
|
587
|
-
this.scheduleLayoutRefresh();
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
this.pendingSelectionAnchor = this.selectionAnchor;
|
|
592
|
-
if (this.activeCard?.mode === 'create') {
|
|
593
|
-
this.clearSelectionRevealTimer();
|
|
594
|
-
this.renderToolbar();
|
|
595
|
-
this.scheduleLayoutRefresh();
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
if (this.pointerSelecting) {
|
|
600
|
-
this.clearSelectionRevealTimer();
|
|
601
|
-
this.committedSelectionAnchor = null;
|
|
602
|
-
this.renderToolbar();
|
|
603
|
-
this.scheduleLayoutRefresh();
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
if (areAnchorsEqual(this.committedSelectionAnchor, this.selectionAnchor)) {
|
|
608
|
-
this.renderToolbar();
|
|
609
|
-
this.scheduleLayoutRefresh();
|
|
610
|
-
return;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
this.scheduleSelectionReveal(this.selectionAnchor);
|
|
614
|
-
this.renderToolbar();
|
|
615
|
-
this.scheduleLayoutRefresh();
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
handleEditorContentChange() {
|
|
619
|
-
if (this.activeCard?.mode === 'create') {
|
|
620
|
-
return;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
this.clearSelectionRevealTimer();
|
|
624
|
-
this.pendingSelectionAnchor = null;
|
|
625
|
-
this.committedSelectionAnchor = null;
|
|
626
|
-
this.scheduleLayoutRefresh();
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
setThreads(threads = []) {
|
|
630
|
-
this.threads = sortThreads(threads);
|
|
631
|
-
if (
|
|
632
|
-
this.activeCard?.mode === 'group'
|
|
633
|
-
&& !this.getThreadGroups().some((group) => group.key === this.activeCard.groupKey)
|
|
634
|
-
) {
|
|
635
|
-
this.activeCard = null;
|
|
636
|
-
}
|
|
637
|
-
if (
|
|
638
|
-
this.reactionPicker
|
|
639
|
-
&& !this.threads.some((thread) => (
|
|
640
|
-
thread.id === this.reactionPicker.threadId
|
|
641
|
-
&& thread.messages?.some((message) => message.id === this.reactionPicker.messageId)
|
|
642
|
-
))
|
|
643
|
-
) {
|
|
644
|
-
this.reactionPicker = null;
|
|
645
|
-
}
|
|
646
|
-
this.render();
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
setDrawerOpen(nextState) {
|
|
650
|
-
const normalizedState = Boolean(nextState);
|
|
651
|
-
if (normalizedState === this.drawerOpen) {
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
if (normalizedState) {
|
|
656
|
-
this.onWillOpenDrawer?.();
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
this.drawerOpen = normalizedState;
|
|
660
|
-
this.render();
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
closeDrawer() {
|
|
664
|
-
this.setDrawerOpen(false);
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
refreshLayout() {
|
|
668
|
-
this.renderEditorLayer();
|
|
669
|
-
this.renderPreviewLayer();
|
|
670
|
-
this.repositionActiveCard();
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
scheduleLayoutRefresh() {
|
|
674
|
-
if (this.layoutFrame) {
|
|
675
|
-
return;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
this.layoutFrame = requestAnimationFrame(() => {
|
|
679
|
-
this.layoutFrame = 0;
|
|
680
|
-
this.refreshLayout();
|
|
681
|
-
});
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
render() {
|
|
685
|
-
this.renderToolbar();
|
|
686
|
-
this.renderDrawer();
|
|
687
|
-
this.renderCard();
|
|
688
|
-
this.scheduleLayoutRefresh();
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
renderToolbar() {
|
|
692
|
-
const totalCount = this.threads.length;
|
|
693
|
-
const showControls = this.supported && Boolean(this.session);
|
|
694
|
-
this.commentSelectionButton?.classList.toggle('hidden', !showControls);
|
|
695
|
-
this.commentsToggleButton?.classList.toggle('hidden', !this.supported);
|
|
696
|
-
if (this.commentSelectionButton) {
|
|
697
|
-
this.commentSelectionButton.disabled = !this.selectionAnchor;
|
|
698
|
-
}
|
|
699
|
-
if (this.commentsToggleButton) {
|
|
700
|
-
this.commentsToggleButton.classList.toggle('active', this.drawerOpen);
|
|
701
|
-
this.commentsToggleButton.setAttribute('aria-expanded', String(this.drawerOpen));
|
|
702
|
-
const label = totalCount > 0 ? `Comments ${totalCount}` : 'Comments';
|
|
703
|
-
const labelElement = this.commentsToggleButton.querySelector('.pane-header-btn-label');
|
|
704
|
-
if (labelElement) {
|
|
705
|
-
labelElement.textContent = label;
|
|
706
|
-
} else {
|
|
707
|
-
this.commentsToggleButton.textContent = label;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
renderDrawer() {
|
|
713
|
-
if (!this.commentsDrawer || !this.commentsDrawerList) {
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
this.commentsDrawer.classList.toggle('hidden', !this.supported || !this.drawerOpen);
|
|
718
|
-
this.commentsDrawerList.replaceChildren();
|
|
719
|
-
const groups = this.getThreadGroups();
|
|
720
|
-
this.commentsDrawerEmpty?.classList.toggle('hidden', groups.length > 0);
|
|
721
|
-
if (!this.supported || groups.length === 0) {
|
|
722
|
-
return;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
const fragment = document.createDocumentFragment();
|
|
726
|
-
groups.forEach((group) => {
|
|
727
|
-
const button = document.createElement('button');
|
|
728
|
-
button.type = 'button';
|
|
729
|
-
button.className = 'comments-drawer-item';
|
|
730
|
-
button.classList.toggle('is-active', this.activeCard?.groupKey === group.key);
|
|
731
|
-
button.addEventListener('pointerdown', (event) => {
|
|
732
|
-
event.preventDefault();
|
|
733
|
-
});
|
|
734
|
-
button.addEventListener('click', () => {
|
|
735
|
-
this.openThreadGroup(group, {
|
|
736
|
-
anchor: group.anchor,
|
|
737
|
-
origin: 'drawer',
|
|
738
|
-
sourceRect: button.getBoundingClientRect(),
|
|
739
|
-
});
|
|
740
|
-
});
|
|
741
|
-
|
|
742
|
-
const header = document.createElement('div');
|
|
743
|
-
header.className = 'comments-drawer-item-header';
|
|
744
|
-
|
|
745
|
-
const title = document.createElement('span');
|
|
746
|
-
title.className = 'comments-drawer-item-title';
|
|
747
|
-
title.textContent = formatAnchorLabel(group.anchor);
|
|
748
|
-
|
|
749
|
-
const count = document.createElement('span');
|
|
750
|
-
count.className = 'comments-drawer-item-count';
|
|
751
|
-
count.textContent = String(group.threads.length);
|
|
752
|
-
|
|
753
|
-
header.append(title, count);
|
|
754
|
-
|
|
755
|
-
const quote = document.createElement('p');
|
|
756
|
-
quote.className = 'comments-drawer-item-quote';
|
|
757
|
-
quote.textContent = group.anchor.quote || group.anchor.excerpt || 'Source anchored comment';
|
|
758
|
-
|
|
759
|
-
const latestMessage = getLatestGroupMessage(group);
|
|
760
|
-
const preview = createRenderedCommentBody(
|
|
761
|
-
latestMessage?.body || '',
|
|
762
|
-
'comment-markdown comments-drawer-item-preview',
|
|
763
|
-
);
|
|
764
|
-
|
|
765
|
-
const footer = document.createElement('div');
|
|
766
|
-
footer.className = 'comments-drawer-item-footer';
|
|
767
|
-
const countLabel = document.createElement('span');
|
|
768
|
-
countLabel.textContent = `${group.threads.length} thread${group.threads.length === 1 ? '' : 's'}`;
|
|
769
|
-
|
|
770
|
-
const updatedLabel = document.createElement('span');
|
|
771
|
-
updatedLabel.className = 'comments-drawer-item-updated';
|
|
772
|
-
updatedLabel.textContent = latestMessage
|
|
773
|
-
? `${latestMessage.userName} • ${this.formatTimestamp(latestMessage.createdAt)}`
|
|
774
|
-
: '';
|
|
775
|
-
|
|
776
|
-
footer.append(countLabel, updatedLabel);
|
|
777
|
-
|
|
778
|
-
button.append(header, quote, preview, footer);
|
|
779
|
-
fragment.appendChild(button);
|
|
780
|
-
});
|
|
781
|
-
|
|
782
|
-
this.commentsDrawerList.appendChild(fragment);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
ensureEditorLayer() {
|
|
786
|
-
if (this.editorLayer?.isConnected && this.editorLayer.parentElement === this.editorContainer) {
|
|
787
|
-
return this.editorLayer;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
const layer = document.createElement('div');
|
|
791
|
-
layer.className = 'comment-editor-layer';
|
|
792
|
-
this.editorContainer?.appendChild(layer);
|
|
793
|
-
this.editorLayer = layer;
|
|
794
|
-
return layer;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
renderEditorLayer() {
|
|
798
|
-
const layer = this.ensureEditorLayer();
|
|
799
|
-
layer.replaceChildren();
|
|
800
|
-
|
|
801
|
-
if (!this.supported || !this.session) {
|
|
802
|
-
return;
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
const containerRect = this.editorContainer?.getBoundingClientRect?.();
|
|
806
|
-
if (!containerRect) {
|
|
807
|
-
return;
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
const groups = this.getThreadGroups();
|
|
811
|
-
const occupiedTops = [];
|
|
812
|
-
groups.forEach((group) => {
|
|
813
|
-
const rect = this.session.getCommentAnchorClientRect?.(group.anchor);
|
|
814
|
-
if (!rect) {
|
|
815
|
-
return;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
const relativeRect = toRelativeRect(rect, containerRect);
|
|
819
|
-
if (relativeRect.bottom < 0 || relativeRect.top > containerRect.height) {
|
|
820
|
-
return;
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
const button = document.createElement('button');
|
|
824
|
-
button.type = 'button';
|
|
825
|
-
button.className = 'comment-editor-badge';
|
|
826
|
-
button.dataset.count = String(group.threads.length);
|
|
827
|
-
const isActive = this.activeCard?.groupKey === group.key;
|
|
828
|
-
const isHovered = this.hoveredEditorGroupKeys.includes(group.key);
|
|
829
|
-
button.classList.toggle('is-active', isActive);
|
|
830
|
-
button.classList.toggle('is-hovered', isHovered);
|
|
831
|
-
button.classList.toggle('is-passive', !isActive && !isHovered);
|
|
832
|
-
button.setAttribute('aria-label', `${group.threads.length} comment thread${group.threads.length === 1 ? '' : 's'}`);
|
|
833
|
-
button.appendChild(createCommentMarkerContent(group.threads.length));
|
|
834
|
-
const top = Math.max(relativeRect.top, 8);
|
|
835
|
-
button.style.top = `${top}px`;
|
|
836
|
-
button.style.left = `${Math.max(containerRect.width - 36, 8)}px`;
|
|
837
|
-
button.title = `${group.threads.length} comment${group.threads.length === 1 ? '' : 's'}`;
|
|
838
|
-
button.addEventListener('pointerdown', (event) => {
|
|
839
|
-
event.preventDefault();
|
|
840
|
-
});
|
|
841
|
-
button.addEventListener('pointerenter', () => {
|
|
842
|
-
this.updateHoveredEditorGroups([group.key]);
|
|
843
|
-
});
|
|
844
|
-
button.addEventListener('pointerleave', () => {
|
|
845
|
-
this.updateHoveredEditorGroups([]);
|
|
846
|
-
});
|
|
847
|
-
button.addEventListener('focusin', () => {
|
|
848
|
-
this.updateHoveredEditorGroups([group.key]);
|
|
849
|
-
});
|
|
850
|
-
button.addEventListener('focusout', () => {
|
|
851
|
-
this.updateHoveredEditorGroups([]);
|
|
852
|
-
});
|
|
853
|
-
button.addEventListener('click', () => {
|
|
854
|
-
this.openThreadGroup(group, {
|
|
855
|
-
anchor: group.anchor,
|
|
856
|
-
origin: 'editor',
|
|
857
|
-
sourceRect: rect,
|
|
858
|
-
});
|
|
859
|
-
});
|
|
860
|
-
layer.appendChild(button);
|
|
861
|
-
occupiedTops.push(top);
|
|
862
|
-
});
|
|
863
|
-
|
|
864
|
-
if (!this.committedSelectionAnchor || this.activeCard?.mode === 'create') {
|
|
865
|
-
return;
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
const rect = this.session.getCommentAnchorClientRect?.(this.committedSelectionAnchor);
|
|
869
|
-
const chipRect = this.session.getSelectionChipClientRect?.(this.committedSelectionAnchor) ?? rect;
|
|
870
|
-
if (!chipRect) {
|
|
871
|
-
return;
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
const relativeRect = toRelativeRect(chipRect, containerRect);
|
|
875
|
-
if (relativeRect.bottom < 0 || relativeRect.top > containerRect.height) {
|
|
876
|
-
return;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
let chipTop = clamp(relativeRect.top, 8, Math.max(containerRect.height - COMMENT_CONTROL_SLOT_HEIGHT, 8));
|
|
880
|
-
while (occupiedTops.some((top) => Math.abs(top - chipTop) < (COMMENT_CONTROL_SLOT_HEIGHT - 4))) {
|
|
881
|
-
chipTop = clamp(
|
|
882
|
-
chipTop + COMMENT_CONTROL_SLOT_HEIGHT,
|
|
883
|
-
8,
|
|
884
|
-
Math.max(containerRect.height - COMMENT_CONTROL_SLOT_HEIGHT, 8),
|
|
885
|
-
);
|
|
886
|
-
}
|
|
887
|
-
const button = document.createElement('button');
|
|
888
|
-
button.type = 'button';
|
|
889
|
-
button.className = 'comment-selection-chip';
|
|
890
|
-
button.textContent = 'Comment';
|
|
891
|
-
button.style.top = `${chipTop}px`;
|
|
892
|
-
button.style.right = `${COMMENT_SELECTION_CHIP_GAP}px`;
|
|
893
|
-
button.addEventListener('pointerdown', (event) => {
|
|
894
|
-
event.preventDefault();
|
|
895
|
-
event.stopPropagation();
|
|
896
|
-
this.openComposerForSelection('editor', button.getBoundingClientRect());
|
|
897
|
-
});
|
|
898
|
-
layer.appendChild(button);
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
ensurePreviewLayer() {
|
|
902
|
-
if (this.previewLayer?.isConnected && this.previewLayer.parentElement === this.previewElement) {
|
|
903
|
-
return this.previewLayer;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
const highlightLayer = document.createElement('div');
|
|
907
|
-
highlightLayer.className = 'comment-preview-highlights';
|
|
908
|
-
const markerLayer = document.createElement('div');
|
|
909
|
-
markerLayer.className = 'comment-preview-layer';
|
|
910
|
-
this.previewElement?.append(highlightLayer, markerLayer);
|
|
911
|
-
this.previewHighlightLayer = highlightLayer;
|
|
912
|
-
this.previewLayer = markerLayer;
|
|
913
|
-
return markerLayer;
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
renderPreviewLayer() {
|
|
917
|
-
this.ensurePreviewLayer();
|
|
918
|
-
this.previewLayer?.replaceChildren();
|
|
919
|
-
this.previewHighlightLayer?.replaceChildren();
|
|
920
|
-
|
|
921
|
-
if (!this.supported || !this.previewElement) {
|
|
922
|
-
this.previewHoverRegions = [];
|
|
923
|
-
return;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
const previewRect = this.previewElement.getBoundingClientRect();
|
|
927
|
-
const groups = this.getThreadGroups();
|
|
928
|
-
const occupiedTops = [];
|
|
929
|
-
const hoverRegions = [];
|
|
930
|
-
const showPassiveMarkers = this.shouldRenderPassivePreviewMarkers();
|
|
931
|
-
groups.forEach((group) => {
|
|
932
|
-
const target = this.resolvePreviewTarget(group.anchor);
|
|
933
|
-
if (!target?.bubbleRect) {
|
|
934
|
-
return;
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
hoverRegions.push({
|
|
938
|
-
key: group.key,
|
|
939
|
-
rects: target.hoverRects?.length > 0 ? target.hoverRects : [target.bubbleRect],
|
|
940
|
-
});
|
|
941
|
-
|
|
942
|
-
const isActive = this.activeCard?.groupKey === group.key;
|
|
943
|
-
const isHovered = this.hoveredPreviewGroupKeys.includes(group.key);
|
|
944
|
-
const isEmphasized = isActive || isHovered;
|
|
945
|
-
|
|
946
|
-
target.highlightRects?.forEach((rect) => {
|
|
947
|
-
const highlight = document.createElement('div');
|
|
948
|
-
highlight.className = 'comment-preview-highlight';
|
|
949
|
-
highlight.classList.toggle('is-active', isActive);
|
|
950
|
-
highlight.classList.toggle('is-hovered', isHovered);
|
|
951
|
-
highlight.classList.toggle('is-passive', !isEmphasized);
|
|
952
|
-
highlight.style.left = `${rect.left - previewRect.left}px`;
|
|
953
|
-
highlight.style.top = `${rect.top - previewRect.top}px`;
|
|
954
|
-
highlight.style.width = `${rect.width}px`;
|
|
955
|
-
highlight.style.height = `${rect.height}px`;
|
|
956
|
-
this.previewHighlightLayer?.appendChild(highlight);
|
|
957
|
-
});
|
|
958
|
-
|
|
959
|
-
if (!showPassiveMarkers && !isEmphasized) {
|
|
960
|
-
return;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
const bubble = document.createElement('button');
|
|
964
|
-
bubble.type = 'button';
|
|
965
|
-
bubble.className = 'comment-preview-badge';
|
|
966
|
-
bubble.dataset.commentPreviewGroupKeys = group.key;
|
|
967
|
-
bubble.classList.toggle('is-active', isActive);
|
|
968
|
-
bubble.classList.toggle('is-hovered', isHovered);
|
|
969
|
-
bubble.classList.toggle('is-passive', !isEmphasized);
|
|
970
|
-
bubble.setAttribute('aria-label', `${group.threads.length} comment thread${group.threads.length === 1 ? '' : 's'}`);
|
|
971
|
-
bubble.appendChild(createCommentMarkerContent(group.threads.length));
|
|
972
|
-
let bubbleTop = clamp(
|
|
973
|
-
target.bubbleRect.top - previewRect.top,
|
|
974
|
-
6,
|
|
975
|
-
Math.max(this.previewElement.clientHeight - COMMENT_PREVIEW_RAIL_SLOT_HEIGHT, 6),
|
|
976
|
-
);
|
|
977
|
-
while (occupiedTops.some((top) => Math.abs(top - bubbleTop) < (COMMENT_PREVIEW_RAIL_SLOT_HEIGHT - 4))) {
|
|
978
|
-
bubbleTop = clamp(
|
|
979
|
-
bubbleTop + COMMENT_PREVIEW_RAIL_SLOT_HEIGHT,
|
|
980
|
-
6,
|
|
981
|
-
Math.max(this.previewElement.clientHeight - COMMENT_PREVIEW_RAIL_SLOT_HEIGHT, 6),
|
|
982
|
-
);
|
|
983
|
-
}
|
|
984
|
-
bubble.style.top = `${bubbleTop}px`;
|
|
985
|
-
bubble.title = `${group.threads.length} comment${group.threads.length === 1 ? '' : 's'}`;
|
|
986
|
-
bubble.addEventListener('pointerdown', (event) => {
|
|
987
|
-
event.preventDefault();
|
|
988
|
-
});
|
|
989
|
-
bubble.addEventListener('click', () => {
|
|
990
|
-
this.openThreadGroup(group, {
|
|
991
|
-
anchor: group.anchor,
|
|
992
|
-
origin: 'preview',
|
|
993
|
-
sourceRect: bubble.getBoundingClientRect(),
|
|
994
|
-
});
|
|
995
|
-
});
|
|
996
|
-
this.previewLayer?.appendChild(bubble);
|
|
997
|
-
occupiedTops.push(bubbleTop);
|
|
998
|
-
});
|
|
999
|
-
|
|
1000
|
-
this.previewHoverRegions = hoverRegions;
|
|
1001
|
-
if (this.lastPreviewPointerPosition) {
|
|
1002
|
-
this.updateHoveredPreviewGroups(
|
|
1003
|
-
this.getPreviewGroupKeysAtPoint(this.lastPreviewPointerPosition.x, this.lastPreviewPointerPosition.y),
|
|
1004
|
-
);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
resolvePreviewTarget(anchor) {
|
|
1009
|
-
if (!this.previewElement || !anchor) {
|
|
1010
|
-
return null;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
const diagramShell = Array.from(this.previewElement.querySelectorAll('.mermaid-shell, .plantuml-shell'))
|
|
1014
|
-
.find((element) => overlapsAnchorRange(element, anchor));
|
|
1015
|
-
if (diagramShell) {
|
|
1016
|
-
return {
|
|
1017
|
-
bubbleRect: diagramShell.getBoundingClientRect(),
|
|
1018
|
-
highlightRects: [],
|
|
1019
|
-
hoverRects: [diagramShell.getBoundingClientRect()],
|
|
1020
|
-
};
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
const candidates = Array.from(this.previewElement.querySelectorAll('[data-source-line]'))
|
|
1024
|
-
.filter((element) => isLeafSourceBlock(element) && overlapsAnchorRange(element, anchor));
|
|
1025
|
-
|
|
1026
|
-
if (anchor.kind === 'text' && anchor.quote) {
|
|
1027
|
-
const matches = candidates
|
|
1028
|
-
.map((element) => ({ element, range: findUniqueQuoteRange(element, anchor.quote) }))
|
|
1029
|
-
.filter((candidate) => candidate.range);
|
|
1030
|
-
if (matches.length === 1) {
|
|
1031
|
-
const rects = Array.from(matches[0].range.getClientRects());
|
|
1032
|
-
const bubbleRect = createRectFromRects(rects) || matches[0].element.getBoundingClientRect();
|
|
1033
|
-
return {
|
|
1034
|
-
bubbleRect,
|
|
1035
|
-
highlightRects: rects,
|
|
1036
|
-
hoverRects: rects,
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
const fallback = candidates[0];
|
|
1042
|
-
if (!fallback) {
|
|
1043
|
-
return null;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
return {
|
|
1047
|
-
bubbleRect: fallback.getBoundingClientRect(),
|
|
1048
|
-
highlightRects: [],
|
|
1049
|
-
hoverRects: [fallback.getBoundingClientRect()],
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
ensureCardRoot() {
|
|
1054
|
-
if (this.cardRoot?.isConnected && this.cardRoot.parentElement === document.body) {
|
|
1055
|
-
return this.cardRoot;
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
const root = document.createElement('div');
|
|
1059
|
-
root.className = 'comment-card-root hidden';
|
|
1060
|
-
document.body.appendChild(root);
|
|
1061
|
-
this.cardRoot = root;
|
|
1062
|
-
return root;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
openComposerForSelection(origin = 'editor', sourceRect = null) {
|
|
1066
|
-
const anchor = this.session?.getCurrentSelectionCommentAnchor?.();
|
|
1067
|
-
if (!anchor) {
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
this.selectionAnchor = anchor;
|
|
1072
|
-
this.reactionPicker = null;
|
|
1073
|
-
const nextOrigin = origin === 'editor' && sourceRect ? 'editor-chip' : origin;
|
|
1074
|
-
const nextSourceRect = sourceRect ?? (origin === 'toolbar'
|
|
1075
|
-
? this.commentSelectionButton?.getBoundingClientRect?.()
|
|
1076
|
-
: this.session?.getCommentAnchorClientRect?.(anchor));
|
|
1077
|
-
this.activeCard = {
|
|
1078
|
-
anchor,
|
|
1079
|
-
mode: 'create',
|
|
1080
|
-
origin: nextOrigin,
|
|
1081
|
-
replyThreadId: null,
|
|
1082
|
-
sourceRect: nextSourceRect,
|
|
1083
|
-
};
|
|
1084
|
-
this.render();
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
openThreadGroup(group, { anchor, origin, sourceRect }) {
|
|
1088
|
-
this.reactionPicker = null;
|
|
1089
|
-
this.activeCard = {
|
|
1090
|
-
anchor,
|
|
1091
|
-
groupKey: group.key,
|
|
1092
|
-
mode: 'group',
|
|
1093
|
-
origin,
|
|
1094
|
-
replyThreadId: null,
|
|
1095
|
-
sourceRect,
|
|
1096
|
-
};
|
|
1097
|
-
this.renderDrawer();
|
|
1098
|
-
this.renderCard();
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
closeCard() {
|
|
1102
|
-
this.activeCard = null;
|
|
1103
|
-
this.pendingCardFocusElement = null;
|
|
1104
|
-
this.reactionPicker = null;
|
|
1105
|
-
this.renderCard();
|
|
1106
|
-
this.scheduleLayoutRefresh();
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
getThreadGroups() {
|
|
1110
|
-
const groups = new Map();
|
|
1111
|
-
this.threads.forEach((thread) => {
|
|
1112
|
-
const key = getAnchorGroupKey(thread.anchor);
|
|
1113
|
-
const existing = groups.get(key);
|
|
1114
|
-
if (existing) {
|
|
1115
|
-
existing.threads.push(thread);
|
|
1116
|
-
return;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
groups.set(key, {
|
|
1120
|
-
anchor: thread.anchor,
|
|
1121
|
-
key,
|
|
1122
|
-
threads: [thread],
|
|
1123
|
-
});
|
|
1124
|
-
});
|
|
1125
|
-
|
|
1126
|
-
return Array.from(groups.values()).sort((left, right) => (
|
|
1127
|
-
(left.anchor?.startLine ?? 0) - (right.anchor?.startLine ?? 0)
|
|
1128
|
-
));
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
updateCardSourceRect() {
|
|
1132
|
-
if (!this.activeCard) {
|
|
1133
|
-
return null;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
if (this.activeCard.origin === 'editor') {
|
|
1137
|
-
return this.session?.getCommentAnchorClientRect?.(this.activeCard.anchor) ?? this.activeCard.sourceRect;
|
|
1138
|
-
}
|
|
1139
|
-
if (this.activeCard.origin === 'editor-chip') {
|
|
1140
|
-
return this.activeCard.sourceRect;
|
|
1141
|
-
}
|
|
1142
|
-
if (this.activeCard.origin === 'preview') {
|
|
1143
|
-
return this.resolvePreviewTarget(this.activeCard.anchor)?.bubbleRect ?? this.activeCard.sourceRect;
|
|
1144
|
-
}
|
|
1145
|
-
if (this.activeCard.origin === 'toolbar') {
|
|
1146
|
-
return this.commentSelectionButton?.getBoundingClientRect?.() ?? this.activeCard.sourceRect;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
return this.activeCard.sourceRect;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
renderCard() {
|
|
1153
|
-
const root = this.ensureCardRoot();
|
|
1154
|
-
root.replaceChildren();
|
|
1155
|
-
root.classList.toggle('hidden', !this.activeCard);
|
|
1156
|
-
if (!this.activeCard) {
|
|
1157
|
-
this.pendingCardFocusElement = null;
|
|
1158
|
-
root.style.visibility = '';
|
|
1159
|
-
return;
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
this.pendingCardFocusElement = null;
|
|
1163
|
-
|
|
1164
|
-
const card = document.createElement('section');
|
|
1165
|
-
card.className = 'comment-card';
|
|
1166
|
-
card.addEventListener('click', (event) => {
|
|
1167
|
-
if (
|
|
1168
|
-
!this.reactionPicker
|
|
1169
|
-
|| event.target?.closest?.('.comment-reaction-picker-wrap')
|
|
1170
|
-
) {
|
|
1171
|
-
return;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
this.reactionPicker = null;
|
|
1175
|
-
requestAnimationFrame(() => {
|
|
1176
|
-
if (this.activeCard) {
|
|
1177
|
-
this.renderCard();
|
|
1178
|
-
}
|
|
1179
|
-
});
|
|
1180
|
-
});
|
|
1181
|
-
|
|
1182
|
-
const header = document.createElement('div');
|
|
1183
|
-
header.className = 'comment-card-header';
|
|
1184
|
-
|
|
1185
|
-
const titleWrap = document.createElement('div');
|
|
1186
|
-
titleWrap.className = 'comment-card-title-wrap';
|
|
1187
|
-
|
|
1188
|
-
const title = document.createElement('h3');
|
|
1189
|
-
title.className = 'comment-card-title';
|
|
1190
|
-
title.textContent = this.activeCard.mode === 'create' ? 'New comment' : 'Comment threads';
|
|
1191
|
-
|
|
1192
|
-
const meta = document.createElement('p');
|
|
1193
|
-
meta.className = 'comment-card-meta';
|
|
1194
|
-
meta.textContent = formatAnchorLabel(this.activeCard.anchor);
|
|
1195
|
-
|
|
1196
|
-
titleWrap.append(title, meta);
|
|
1197
|
-
|
|
1198
|
-
const closeButton = document.createElement('button');
|
|
1199
|
-
closeButton.type = 'button';
|
|
1200
|
-
closeButton.className = 'comment-card-close';
|
|
1201
|
-
closeButton.setAttribute('aria-label', 'Close comments');
|
|
1202
|
-
closeButton.textContent = 'Close';
|
|
1203
|
-
closeButton.addEventListener('click', () => this.closeCard());
|
|
1204
|
-
|
|
1205
|
-
header.append(titleWrap, closeButton);
|
|
1206
|
-
card.appendChild(header);
|
|
1207
|
-
|
|
1208
|
-
const content = document.createElement('div');
|
|
1209
|
-
content.className = 'comment-card-scroll';
|
|
1210
|
-
|
|
1211
|
-
if (this.activeCard.anchor?.quote) {
|
|
1212
|
-
const quote = document.createElement('p');
|
|
1213
|
-
quote.className = 'comment-card-quote';
|
|
1214
|
-
quote.textContent = this.activeCard.anchor.quote;
|
|
1215
|
-
content.appendChild(quote);
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
if (this.activeCard.mode === 'create') {
|
|
1219
|
-
content.appendChild(this.createComposer());
|
|
1220
|
-
} else {
|
|
1221
|
-
const group = this.getThreadGroups().find((entry) => entry.key === this.activeCard.groupKey);
|
|
1222
|
-
if (!group) {
|
|
1223
|
-
this.closeCard();
|
|
1224
|
-
return;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
group.threads.forEach((thread) => {
|
|
1228
|
-
content.appendChild(this.createThreadElement(thread));
|
|
1229
|
-
});
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
root.style.visibility = 'hidden';
|
|
1233
|
-
card.appendChild(content);
|
|
1234
|
-
root.appendChild(card);
|
|
1235
|
-
this.updateReactionPickerPosition(card);
|
|
1236
|
-
this.positionCard(card);
|
|
1237
|
-
root.style.visibility = '';
|
|
1238
|
-
this.flushPendingCardFocus();
|
|
1239
|
-
this.scheduleLayoutRefresh();
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
getPreviewGroupKeysForTarget(target) {
|
|
1243
|
-
if (!(target instanceof Node)) {
|
|
1244
|
-
return [];
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
const keyCarrier = target.closest?.('[data-comment-preview-group-keys]');
|
|
1248
|
-
return serializeGroupKeys(
|
|
1249
|
-
String(keyCarrier?.dataset?.commentPreviewGroupKeys ?? '')
|
|
1250
|
-
.split(/\s+/)
|
|
1251
|
-
.filter(Boolean),
|
|
1252
|
-
).split(' ').filter(Boolean);
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
getPreviewGroupKeysAtPoint(x, y) {
|
|
1256
|
-
if (!Number.isFinite(x) || !Number.isFinite(y)) {
|
|
1257
|
-
return [];
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
const targetAtPoint = document.elementFromPoint(x, y);
|
|
1261
|
-
const targetKeys = this.getPreviewGroupKeysForTarget(targetAtPoint);
|
|
1262
|
-
if (targetKeys.length > 0) {
|
|
1263
|
-
return targetKeys;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
const matchingKeys = this.previewHoverRegions
|
|
1267
|
-
.filter((region) => region.rects.some((rect) => pointIntersectsRect(x, y, rect)))
|
|
1268
|
-
.map((region) => region.key);
|
|
1269
|
-
return normalizeGroupKeys(matchingKeys);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
updateHoveredPreviewGroups(nextKeys = []) {
|
|
1273
|
-
const normalizedKeys = normalizeGroupKeys(nextKeys);
|
|
1274
|
-
const signature = normalizedKeys.join(' ');
|
|
1275
|
-
if (signature === this.hoveredPreviewGroupKeysSignature) {
|
|
1276
|
-
return;
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
this.hoveredPreviewGroupKeys = normalizedKeys;
|
|
1280
|
-
this.hoveredPreviewGroupKeysSignature = signature;
|
|
1281
|
-
this.scheduleLayoutRefresh();
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
updateHoveredEditorGroups(nextKeys = []) {
|
|
1285
|
-
const normalizedKeys = normalizeGroupKeys(nextKeys);
|
|
1286
|
-
const signature = normalizedKeys.join(' ');
|
|
1287
|
-
if (signature === this.hoveredEditorGroupKeysSignature) {
|
|
1288
|
-
return;
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
this.hoveredEditorGroupKeys = normalizedKeys;
|
|
1292
|
-
this.hoveredEditorGroupKeysSignature = signature;
|
|
1293
|
-
this.scheduleLayoutRefresh();
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
syncHoveredPreviewGroupsFromTarget(target) {
|
|
1297
|
-
this.updateHoveredPreviewGroups(this.getPreviewGroupKeysForTarget(target));
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
shouldRenderPassivePreviewMarkers() {
|
|
1301
|
-
const previewWidth = this.previewContainer?.clientWidth ?? this.previewElement?.clientWidth ?? 0;
|
|
1302
|
-
return window.innerWidth >= COMMENT_PREVIEW_RAIL_BREAKPOINT && previewWidth >= COMMENT_PREVIEW_RAIL_MIN_WIDTH;
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
updateReactionPickerPosition(card) {
|
|
1306
|
-
const bounds = getReactionPickerBounds(card);
|
|
1307
|
-
if (!bounds) {
|
|
1308
|
-
return;
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
const { picker, scroll, wrap } = bounds;
|
|
1312
|
-
picker.classList.remove('is-upward');
|
|
1313
|
-
picker.style.maxHeight = '';
|
|
1314
|
-
|
|
1315
|
-
const wrapRect = wrap.getBoundingClientRect();
|
|
1316
|
-
const scrollRect = scroll.getBoundingClientRect();
|
|
1317
|
-
const pickerRect = picker.getBoundingClientRect();
|
|
1318
|
-
const safeViewportTop = 12;
|
|
1319
|
-
const safeViewportBottom = window.innerHeight - 12;
|
|
1320
|
-
const lowerBoundary = Math.min(scrollRect.bottom, safeViewportBottom);
|
|
1321
|
-
const upperBoundary = Math.max(scrollRect.top, safeViewportTop);
|
|
1322
|
-
const availableBelow = Math.max(lowerBoundary - wrapRect.bottom - 8, 0);
|
|
1323
|
-
const availableAbove = Math.max(wrapRect.top - upperBoundary - 8, 0);
|
|
1324
|
-
const shouldOpenUpward = pickerRect.height > availableBelow && availableAbove > availableBelow;
|
|
1325
|
-
const maxHeight = Math.max((shouldOpenUpward ? availableAbove : availableBelow), 120);
|
|
1326
|
-
|
|
1327
|
-
picker.classList.toggle('is-upward', shouldOpenUpward);
|
|
1328
|
-
picker.style.maxHeight = `${maxHeight}px`;
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
repositionActiveCard() {
|
|
1332
|
-
const card = this.cardRoot?.firstElementChild;
|
|
1333
|
-
if (!card || !this.activeCard) {
|
|
1334
|
-
if (this.cardRoot) {
|
|
1335
|
-
this.cardRoot.style.visibility = '';
|
|
1336
|
-
}
|
|
1337
|
-
return;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
this.positionCard(card);
|
|
1341
|
-
this.cardRoot.style.visibility = '';
|
|
1342
|
-
this.flushPendingCardFocus();
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
createComposer() {
|
|
1346
|
-
const form = document.createElement('form');
|
|
1347
|
-
form.className = 'comment-card-form';
|
|
1348
|
-
|
|
1349
|
-
const textarea = document.createElement('textarea');
|
|
1350
|
-
textarea.className = 'input comment-card-input';
|
|
1351
|
-
textarea.rows = 4;
|
|
1352
|
-
textarea.maxLength = COMMENT_BODY_MAX_LENGTH;
|
|
1353
|
-
textarea.placeholder = 'Add context, feedback, or a question...';
|
|
1354
|
-
|
|
1355
|
-
const actions = document.createElement('div');
|
|
1356
|
-
actions.className = 'comment-card-actions';
|
|
1357
|
-
|
|
1358
|
-
const cancel = document.createElement('button');
|
|
1359
|
-
cancel.type = 'button';
|
|
1360
|
-
cancel.className = 'btn btn-secondary';
|
|
1361
|
-
cancel.textContent = 'Cancel';
|
|
1362
|
-
cancel.addEventListener('click', () => this.closeCard());
|
|
1363
|
-
|
|
1364
|
-
const submit = document.createElement('button');
|
|
1365
|
-
submit.type = 'submit';
|
|
1366
|
-
submit.className = 'btn btn-primary';
|
|
1367
|
-
submit.textContent = 'Post comment';
|
|
1368
|
-
|
|
1369
|
-
actions.append(cancel, submit);
|
|
1370
|
-
form.append(textarea, actions);
|
|
1371
|
-
|
|
1372
|
-
form.addEventListener('submit', async (event) => {
|
|
1373
|
-
event.preventDefault();
|
|
1374
|
-
const threadId = await this.onCreateThread?.({
|
|
1375
|
-
anchor: this.activeCard?.anchor,
|
|
1376
|
-
body: textarea.value,
|
|
1377
|
-
});
|
|
1378
|
-
if (!threadId) {
|
|
1379
|
-
textarea.focus();
|
|
1380
|
-
return;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
this.closeCard();
|
|
1384
|
-
});
|
|
1385
|
-
|
|
1386
|
-
this.pendingCardFocusElement = textarea;
|
|
1387
|
-
return form;
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
createThreadElement(thread) {
|
|
1391
|
-
const article = document.createElement('article');
|
|
1392
|
-
article.className = 'comment-thread-card';
|
|
1393
|
-
|
|
1394
|
-
const header = document.createElement('div');
|
|
1395
|
-
header.className = 'comment-thread-card-header';
|
|
1396
|
-
|
|
1397
|
-
const heading = document.createElement('div');
|
|
1398
|
-
heading.className = 'comment-thread-card-heading';
|
|
1399
|
-
|
|
1400
|
-
const author = document.createElement('span');
|
|
1401
|
-
author.className = 'comment-thread-card-author';
|
|
1402
|
-
author.textContent = thread.createdByName;
|
|
1403
|
-
|
|
1404
|
-
const time = document.createElement('span');
|
|
1405
|
-
time.className = 'comment-thread-card-time';
|
|
1406
|
-
time.textContent = this.formatTimestamp(thread.createdAt);
|
|
1407
|
-
|
|
1408
|
-
const actions = document.createElement('div');
|
|
1409
|
-
actions.className = 'comment-thread-card-actions';
|
|
1410
|
-
|
|
1411
|
-
const jump = document.createElement('button');
|
|
1412
|
-
jump.type = 'button';
|
|
1413
|
-
jump.className = 'comment-thread-card-action';
|
|
1414
|
-
jump.textContent = 'Jump';
|
|
1415
|
-
jump.addEventListener('click', () => this.onNavigateToLine?.(thread.anchor?.startLine ?? 1));
|
|
1416
|
-
|
|
1417
|
-
const reply = document.createElement('button');
|
|
1418
|
-
reply.type = 'button';
|
|
1419
|
-
reply.className = 'comment-thread-card-action';
|
|
1420
|
-
const isReplying = this.activeCard?.replyThreadId === thread.id;
|
|
1421
|
-
reply.classList.toggle('is-active', isReplying);
|
|
1422
|
-
reply.textContent = 'Reply';
|
|
1423
|
-
reply.setAttribute('aria-pressed', String(isReplying));
|
|
1424
|
-
reply.setAttribute('aria-label', isReplying ? 'Cancel reply' : 'Reply to thread');
|
|
1425
|
-
reply.title = isReplying ? 'Cancel reply' : 'Reply to thread';
|
|
1426
|
-
reply.addEventListener('click', () => {
|
|
1427
|
-
this.activeCard = {
|
|
1428
|
-
...this.activeCard,
|
|
1429
|
-
replyThreadId: isReplying ? null : thread.id,
|
|
1430
|
-
};
|
|
1431
|
-
this.renderCard();
|
|
1432
|
-
});
|
|
1433
|
-
|
|
1434
|
-
const resolve = document.createElement('button');
|
|
1435
|
-
resolve.type = 'button';
|
|
1436
|
-
resolve.className = 'comment-thread-card-action is-danger';
|
|
1437
|
-
resolve.textContent = 'Resolve';
|
|
1438
|
-
resolve.addEventListener('click', async () => {
|
|
1439
|
-
await this.onResolveThread?.(thread.id);
|
|
1440
|
-
});
|
|
1441
|
-
|
|
1442
|
-
actions.append(jump, reply, resolve);
|
|
1443
|
-
heading.append(author, time);
|
|
1444
|
-
header.append(heading, actions);
|
|
1445
|
-
|
|
1446
|
-
article.append(header);
|
|
1447
|
-
|
|
1448
|
-
thread.messages.forEach((message) => {
|
|
1449
|
-
article.appendChild(this.createMessageElement(thread, message));
|
|
1450
|
-
});
|
|
1451
|
-
|
|
1452
|
-
if (this.activeCard?.replyThreadId === thread.id) {
|
|
1453
|
-
article.appendChild(this.createReplyComposer(thread));
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
return article;
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
createMessageElement(thread, message) {
|
|
1460
|
-
const container = document.createElement('div');
|
|
1461
|
-
container.className = 'comment-message-card';
|
|
1462
|
-
|
|
1463
|
-
const meta = document.createElement('div');
|
|
1464
|
-
meta.className = 'comment-message-card-meta';
|
|
1465
|
-
|
|
1466
|
-
const author = document.createElement('span');
|
|
1467
|
-
author.className = 'comment-message-card-author';
|
|
1468
|
-
author.textContent = message.userName;
|
|
1469
|
-
|
|
1470
|
-
const time = document.createElement('span');
|
|
1471
|
-
time.className = 'comment-message-card-time';
|
|
1472
|
-
time.textContent = this.formatTimestamp(message.createdAt);
|
|
1473
|
-
|
|
1474
|
-
const renderedBody = createRenderedCommentBody(
|
|
1475
|
-
message.body,
|
|
1476
|
-
'comment-message-card-body comment-markdown',
|
|
1477
|
-
);
|
|
1478
|
-
|
|
1479
|
-
meta.append(author, time);
|
|
1480
|
-
container.append(meta, renderedBody);
|
|
1481
|
-
container.appendChild(this.createReactionBar(thread, message));
|
|
1482
|
-
return container;
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
createReactionBar(thread, message) {
|
|
1486
|
-
const localUserId = this.session?.getLocalUser?.()?.userId ?? '';
|
|
1487
|
-
const wrap = document.createElement('div');
|
|
1488
|
-
wrap.className = 'comment-reaction-bar';
|
|
1489
|
-
|
|
1490
|
-
const existingReactionEmojis = new Set((message.reactions ?? []).map((reaction) => reaction.emoji));
|
|
1491
|
-
|
|
1492
|
-
const chips = document.createElement('div');
|
|
1493
|
-
chips.className = 'comment-reaction-chips';
|
|
1494
|
-
|
|
1495
|
-
(message.reactions ?? []).forEach((reaction) => {
|
|
1496
|
-
const chip = document.createElement('button');
|
|
1497
|
-
chip.type = 'button';
|
|
1498
|
-
chip.className = 'comment-reaction-chip';
|
|
1499
|
-
chip.classList.toggle('is-active', hasLocalReaction(reaction, localUserId));
|
|
1500
|
-
chip.setAttribute('aria-pressed', String(hasLocalReaction(reaction, localUserId)));
|
|
1501
|
-
chip.title = reaction.users?.map((user) => user.userName).join(', ') || reaction.emoji;
|
|
1502
|
-
|
|
1503
|
-
const emoji = document.createElement('span');
|
|
1504
|
-
emoji.className = 'comment-reaction-chip-emoji';
|
|
1505
|
-
emoji.textContent = reaction.emoji;
|
|
1506
|
-
|
|
1507
|
-
const count = document.createElement('span');
|
|
1508
|
-
count.className = 'comment-reaction-chip-count';
|
|
1509
|
-
count.textContent = formatReactionCount(reaction);
|
|
1510
|
-
|
|
1511
|
-
chip.append(emoji, count);
|
|
1512
|
-
chip.addEventListener('click', async () => {
|
|
1513
|
-
await this.onToggleReaction?.(thread.id, message.id, reaction.emoji);
|
|
1514
|
-
});
|
|
1515
|
-
chips.appendChild(chip);
|
|
1516
|
-
});
|
|
1517
|
-
|
|
1518
|
-
const actions = document.createElement('div');
|
|
1519
|
-
actions.className = 'comment-reaction-actions';
|
|
1520
|
-
|
|
1521
|
-
COMMENT_REACTION_PRESET_EMOJIS
|
|
1522
|
-
.filter((emoji) => !existingReactionEmojis.has(emoji))
|
|
1523
|
-
.forEach((emoji) => {
|
|
1524
|
-
actions.appendChild(this.createQuickReactionButton(thread, message, emoji));
|
|
1525
|
-
});
|
|
1526
|
-
|
|
1527
|
-
const pickerWrap = document.createElement('div');
|
|
1528
|
-
pickerWrap.className = 'comment-reaction-picker-wrap';
|
|
1529
|
-
|
|
1530
|
-
const moreButton = document.createElement('button');
|
|
1531
|
-
moreButton.type = 'button';
|
|
1532
|
-
moreButton.className = 'comment-reaction-more-trigger';
|
|
1533
|
-
moreButton.dataset.reactionPickerToggle = 'true';
|
|
1534
|
-
moreButton.setAttribute('aria-expanded', String(
|
|
1535
|
-
isReactionPickerOpen(this.reactionPicker, thread.id, message.id),
|
|
1536
|
-
));
|
|
1537
|
-
moreButton.textContent = 'More';
|
|
1538
|
-
moreButton.addEventListener('click', () => {
|
|
1539
|
-
const isOpen = isReactionPickerOpen(this.reactionPicker, thread.id, message.id);
|
|
1540
|
-
this.reactionPicker = isOpen
|
|
1541
|
-
? null
|
|
1542
|
-
: {
|
|
1543
|
-
messageId: message.id,
|
|
1544
|
-
threadId: thread.id,
|
|
1545
|
-
};
|
|
1546
|
-
this.renderCard();
|
|
1547
|
-
});
|
|
1548
|
-
|
|
1549
|
-
pickerWrap.appendChild(moreButton);
|
|
1550
|
-
|
|
1551
|
-
if (isReactionPickerOpen(this.reactionPicker, thread.id, message.id)) {
|
|
1552
|
-
pickerWrap.appendChild(this.createReactionPicker(thread, message));
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
actions.appendChild(pickerWrap);
|
|
1556
|
-
wrap.append(chips, actions);
|
|
1557
|
-
return wrap;
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
createQuickReactionButton(thread, message, emoji) {
|
|
1561
|
-
const button = document.createElement('button');
|
|
1562
|
-
button.type = 'button';
|
|
1563
|
-
button.className = 'comment-reaction-quick-add';
|
|
1564
|
-
button.textContent = emoji;
|
|
1565
|
-
button.title = `React with ${emoji}`;
|
|
1566
|
-
button.addEventListener('click', async () => {
|
|
1567
|
-
await this.onToggleReaction?.(thread.id, message.id, emoji);
|
|
1568
|
-
});
|
|
1569
|
-
return button;
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
createReactionPicker(thread, message) {
|
|
1573
|
-
const picker = document.createElement('div');
|
|
1574
|
-
picker.className = 'comment-reaction-picker';
|
|
1575
|
-
const moreGrid = document.createElement('div');
|
|
1576
|
-
moreGrid.className = 'comment-reaction-picker-grid';
|
|
1577
|
-
COMMENT_REACTION_MORE_EMOJIS.forEach((emoji) => {
|
|
1578
|
-
moreGrid.appendChild(this.createReactionPickerButton(thread, message, emoji));
|
|
1579
|
-
});
|
|
1580
|
-
picker.appendChild(moreGrid);
|
|
1581
|
-
|
|
1582
|
-
return picker;
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
createReactionPickerButton(thread, message, emoji) {
|
|
1586
|
-
const button = document.createElement('button');
|
|
1587
|
-
button.type = 'button';
|
|
1588
|
-
button.className = 'comment-reaction-picker-btn';
|
|
1589
|
-
button.textContent = emoji;
|
|
1590
|
-
button.title = `React with ${emoji}`;
|
|
1591
|
-
button.addEventListener('click', async () => {
|
|
1592
|
-
const didToggle = await this.onToggleReaction?.(thread.id, message.id, emoji);
|
|
1593
|
-
if (didToggle) {
|
|
1594
|
-
this.reactionPicker = null;
|
|
1595
|
-
this.renderCard();
|
|
1596
|
-
}
|
|
1597
|
-
});
|
|
1598
|
-
return button;
|
|
1599
|
-
}
|
|
1600
|
-
|
|
1601
|
-
createReplyComposer(thread) {
|
|
1602
|
-
const form = document.createElement('form');
|
|
1603
|
-
form.className = 'comment-reply-form';
|
|
1604
|
-
|
|
1605
|
-
const textarea = document.createElement('textarea');
|
|
1606
|
-
textarea.className = 'input comment-card-input';
|
|
1607
|
-
textarea.rows = 3;
|
|
1608
|
-
textarea.maxLength = COMMENT_BODY_MAX_LENGTH;
|
|
1609
|
-
textarea.placeholder = 'Reply to thread...';
|
|
1610
|
-
|
|
1611
|
-
const actions = document.createElement('div');
|
|
1612
|
-
actions.className = 'comment-card-actions';
|
|
1613
|
-
|
|
1614
|
-
const cancel = document.createElement('button');
|
|
1615
|
-
cancel.type = 'button';
|
|
1616
|
-
cancel.className = 'btn btn-secondary';
|
|
1617
|
-
cancel.textContent = 'Cancel';
|
|
1618
|
-
cancel.addEventListener('click', () => {
|
|
1619
|
-
this.activeCard = {
|
|
1620
|
-
...this.activeCard,
|
|
1621
|
-
replyThreadId: null,
|
|
1622
|
-
};
|
|
1623
|
-
this.renderCard();
|
|
1624
|
-
});
|
|
1625
|
-
|
|
1626
|
-
const submit = document.createElement('button');
|
|
1627
|
-
submit.type = 'submit';
|
|
1628
|
-
submit.className = 'btn btn-primary';
|
|
1629
|
-
submit.textContent = 'Reply';
|
|
1630
|
-
|
|
1631
|
-
actions.append(cancel, submit);
|
|
1632
|
-
form.append(textarea, actions);
|
|
1633
|
-
this.pendingCardFocusElement = textarea;
|
|
1634
|
-
|
|
1635
|
-
form.addEventListener('submit', async (event) => {
|
|
1636
|
-
event.preventDefault();
|
|
1637
|
-
const messageId = await this.onReplyToThread?.(thread.id, textarea.value);
|
|
1638
|
-
if (!messageId) {
|
|
1639
|
-
textarea.focus();
|
|
1640
|
-
return;
|
|
1641
|
-
}
|
|
1642
|
-
|
|
1643
|
-
this.activeCard = {
|
|
1644
|
-
...this.activeCard,
|
|
1645
|
-
replyThreadId: null,
|
|
1646
|
-
};
|
|
1647
|
-
this.renderCard();
|
|
1648
|
-
});
|
|
1649
|
-
|
|
1650
|
-
return form;
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
positionCard(card) {
|
|
1654
|
-
const sourceRect = this.updateCardSourceRect();
|
|
1655
|
-
const viewportWidth = window.innerWidth;
|
|
1656
|
-
const viewportHeight = window.innerHeight;
|
|
1657
|
-
const cardRect = card.getBoundingClientRect();
|
|
1658
|
-
const fallbackLeft = clamp((viewportWidth - cardRect.width) / 2, 16, viewportWidth - cardRect.width - 16);
|
|
1659
|
-
const fallbackTop = clamp((viewportHeight - cardRect.height) / 4, 16, viewportHeight - cardRect.height - 16);
|
|
1660
|
-
|
|
1661
|
-
let left = fallbackLeft;
|
|
1662
|
-
let top = fallbackTop;
|
|
1663
|
-
|
|
1664
|
-
if (sourceRect) {
|
|
1665
|
-
left = clamp(
|
|
1666
|
-
sourceRect.left,
|
|
1667
|
-
16,
|
|
1668
|
-
viewportWidth - Math.min(cardRect.width, COMMENT_CARD_WIDTH) - 16,
|
|
1669
|
-
);
|
|
1670
|
-
top = sourceRect.bottom + COMMENT_CARD_OFFSET;
|
|
1671
|
-
if (top + cardRect.height > viewportHeight - 16) {
|
|
1672
|
-
top = Math.max(sourceRect.top - cardRect.height - COMMENT_CARD_OFFSET, 16);
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
this.cardRoot.style.left = `${left}px`;
|
|
1677
|
-
this.cardRoot.style.top = `${top}px`;
|
|
1678
|
-
this.cardRoot.style.width = `${Math.min(Math.max(cardRect.width, COMMENT_CARD_WIDTH), viewportWidth - 32)}px`;
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
formatTimestamp(value) {
|
|
1682
|
-
if (!Number.isFinite(value)) {
|
|
1683
|
-
return '';
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
try {
|
|
1687
|
-
return this.timeFormatter.format(new Date(value));
|
|
1688
|
-
} catch {
|
|
1689
|
-
return '';
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
|
|
1693
|
-
flushPendingCardFocus() {
|
|
1694
|
-
const element = this.pendingCardFocusElement;
|
|
1695
|
-
if (!(element instanceof HTMLElement) || !element.isConnected) {
|
|
1696
|
-
this.pendingCardFocusElement = null;
|
|
1697
|
-
return;
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1700
|
-
this.pendingCardFocusElement = null;
|
|
1701
|
-
const focusElement = () => {
|
|
1702
|
-
if (!element.isConnected) {
|
|
1703
|
-
return;
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
const activeElement = document.activeElement;
|
|
1707
|
-
if (activeElement instanceof HTMLElement && this.editorContainer?.contains(activeElement)) {
|
|
1708
|
-
activeElement.blur();
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
element.focus({ preventScroll: true });
|
|
1712
|
-
};
|
|
1713
|
-
|
|
1714
|
-
focusElement();
|
|
1715
|
-
if (document.activeElement === element) {
|
|
1716
|
-
return;
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
|
-
requestAnimationFrame(() => {
|
|
1720
|
-
focusElement();
|
|
1721
|
-
if (document.activeElement !== element) {
|
|
1722
|
-
setTimeout(() => {
|
|
1723
|
-
focusElement();
|
|
1724
|
-
}, 50);
|
|
1725
|
-
}
|
|
1726
|
-
});
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
clearSelectionRevealTimer() {
|
|
1730
|
-
if (!this.selectionRevealTimer) {
|
|
1731
|
-
return;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
clearTimeout(this.selectionRevealTimer);
|
|
1735
|
-
this.selectionRevealTimer = 0;
|
|
1736
|
-
}
|
|
1737
|
-
|
|
1738
|
-
scheduleSelectionReveal(anchor) {
|
|
1739
|
-
this.clearSelectionRevealTimer();
|
|
1740
|
-
this.selectionRevealTimer = window.setTimeout(() => {
|
|
1741
|
-
this.selectionRevealTimer = 0;
|
|
1742
|
-
if (
|
|
1743
|
-
this.pointerSelecting
|
|
1744
|
-
|| this.activeCard?.mode === 'create'
|
|
1745
|
-
|| !areAnchorsEqual(this.pendingSelectionAnchor, anchor)
|
|
1746
|
-
) {
|
|
1747
|
-
return;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
this.committedSelectionAnchor = anchor;
|
|
1751
|
-
this.scheduleLayoutRefresh();
|
|
1752
|
-
}, COMMENT_SELECTION_REVEAL_DELAY_MS);
|
|
1753
|
-
}
|
|
1754
230
|
}
|
|
231
|
+
|
|
232
|
+
Object.assign(
|
|
233
|
+
CommentUiController.prototype,
|
|
234
|
+
commentUiStateMethods,
|
|
235
|
+
commentUiRenderMethods,
|
|
236
|
+
commentUiLayoutMethods,
|
|
237
|
+
commentUiCardMethods,
|
|
238
|
+
);
|