collabmd 0.1.48 → 0.1.49
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 +61 -5
- package/bin/collabmd.js +3 -0
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-C-nmgL5g.js +1 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-CdVZqicp.js +1 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-I39sYjHI.js → architectureDiagram-5GKGNRK7-wUo0bXif.js} +3 -3
- package/dist/client/assets/{blockDiagram-NRAW4CY4-C6DtJy5Y.js → blockDiagram-I7D4REHJ-BRSK3m49.js} +4 -4
- package/dist/client/assets/browser-utils-DbXSMI-6.js +1 -0
- package/dist/client/assets/{c4Diagram-UCG6FXSJ-CtWtxS9_.js → c4Diagram-7LVT6UL2-yD2poxqw.js} +1 -1
- package/dist/client/assets/channel-Fa4GS_-F.js +1 -0
- package/dist/client/assets/chunk-2E4U76K2-BPnTT-J3.js +2 -0
- package/dist/client/assets/{chunk-TEH6E4GO-DVayPj-q.js → chunk-4HAMMTFA-DStbIfJ1.js} +20 -20
- package/dist/client/assets/{chunk-75Z2AOVW-CdFSaPjz.js → chunk-75Z2AOVW-C5pGd3W9.js} +1 -1
- package/dist/client/assets/{chunk-CLGD4ZFX-DQLgbQrv.js → chunk-CLGD4ZFX-BMeArk03.js} +1 -1
- package/dist/client/assets/chunk-DU6HZSFF-Zkp69c6c.js +127 -0
- package/dist/client/assets/{chunk-F27PBJKO-CNHIFhjo.js → chunk-F27PBJKO-D4xNct1r.js} +1 -1
- package/dist/client/assets/{chunk-GMAD6QVW-CbcBqPM5.js → chunk-GMAD6QVW-NZ6WpDb8.js} +1 -1
- package/dist/client/assets/{chunk-OBVCFTLP-BJR7u1jh.js → chunk-GVQU2GXP-D8SDprfX.js} +1 -1
- package/dist/client/assets/{chunk-G27WJ6UU-D9-eg537.js → chunk-IMKFNOWR-D8jEuU3Q.js} +2 -2
- package/dist/client/assets/{chunk-JQ64N6SF-DSFNH4bh.js → chunk-L3NEJ4N5-aijKP-eh.js} +1 -1
- package/dist/client/assets/chunk-OSK3NFVY-CCbLQAMa.js +10 -0
- package/dist/client/assets/{chunk-P2QGCYS3-BRpqY32H.js → chunk-P2QGCYS3-Oag_FdCq.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-Cb4SlVZF.js → chunk-POPQ4Y6H-CYnpIgXT.js} +1 -1
- package/dist/client/assets/{chunk-PWAF6VOD-Cz8IwBB5.js → chunk-PWAF6VOD-JSNrcBmP.js} +1 -1
- package/dist/client/assets/{chunk-RM4UPSZO-CWRwxNWJ.js → chunk-RM4UPSZO-DOWllDY8.js} +4 -4
- package/dist/client/assets/{chunk-RHFEMEQ7-CWY8cf4H.js → chunk-SHT3W25Y-BiQGljao.js} +5 -5
- package/dist/client/assets/{chunk-SVP7TREG-CyHOmcac.js → chunk-SVP7TREG-DB485R5x.js} +1 -1
- package/dist/client/assets/{chunk-LCL6LL3I-DmDkVukh.js → chunk-TICWLB2K-8rAVvoS3.js} +4 -4
- package/dist/client/assets/{chunk-CKBBP62Z-DG26UiBv.js → chunk-TLUHSLCS-DTY5v0aj.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-BsQWoR3Q.js +1 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BsQWoR3Q.js +1 -0
- package/dist/client/assets/{comment-thread-store-CdcwrObc.js → comment-thread-store-CX98zR6q.js} +1 -1
- package/dist/client/assets/comment-threads-BnRwo5B9.js +4 -0
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CdTPi2yO.js → cynefinDiagram-5FMLGOSQ-rTz9RhFH.js} +1 -1
- package/dist/client/assets/{dagre-3AP2YEHR-5gtJtd0O.js → dagre-GXQ25YYZ-Cr67wLpQ.js} +2 -2
- package/dist/client/assets/{diagram-S7CK7UJ4-BudWz9WU.js → diagram-S7CK7UJ4-DywERe__.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-3v4rbH-s.js → diagram-UQ7AKVKN-CNYlXtu4.js} +1 -1
- package/dist/client/assets/diagram-VSXAHHWV-0H1a61Bn.js +3 -0
- package/dist/client/assets/{diagram-VX7I27RA-C_-rj0sw.js → diagram-VX7I27RA-CsJbsx5F.js} +1 -1
- package/dist/client/assets/{diagram-Z3DM3KII-B4yxavgj.js → diagram-Z3DM3KII-D0mLxEgI.js} +1 -1
- package/dist/client/assets/dist--hk9I5HQ.js +1 -0
- package/dist/client/assets/{dist-DutPuFmC.js → dist-B1XEa-Zs.js} +1 -1
- package/dist/client/assets/dist-Bd1JucQF.js +1 -0
- package/dist/client/assets/{dist-DZAAWTG-.js → dist-C0G3AaXG.js} +1 -1
- package/dist/client/assets/dist-Dm4w5UId.js +1 -0
- package/dist/client/assets/{dist-B_yQaEv_.js → dist-DpYDHR9p.js} +1 -1
- package/dist/client/assets/{dist-CietwTVS.js → dist-DzNmC81X.js} +1 -1
- package/dist/client/assets/{dist-DDUn5zTz.js → dist-GvvCNBe4.js} +1 -1
- package/dist/client/assets/dist-JaU3aRlD.js +19 -0
- package/dist/client/assets/{dist-Bw3VIE_v.js → dist-TW8iFRyW.js} +1 -1
- package/dist/client/assets/{dist-Dir5dDKZ.js → dist-jVU5Be5P.js} +1 -1
- package/dist/client/assets/document-formatter-rDDjRfZ2.js +2 -0
- package/dist/client/assets/drawioEditor-JubEEha7.js +9 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-HeTxHpCU.js +1 -0
- package/dist/client/assets/editor-session-Bk6oIvSr.js +54 -0
- package/dist/client/assets/{embedded-editor-base-B3l6Xy65.css → embedded-editor-base-BlCgz6mw.css} +1 -1
- package/dist/client/assets/{erDiagram-SSCWMZ5O-C-iy6VkX.js → erDiagram-RLTQ6QDP-CbrDdd5P.js} +2 -2
- package/dist/client/assets/{vault-utils-DvoSftJT.js → es-Bfdp096f.js} +13 -13
- package/dist/client/assets/excalidraw-element-link-YLIaTnVF.js +7 -0
- package/dist/client/assets/{excalidraw-scene-BOben2gr.js → excalidraw-scene-6uROebca.js} +1 -1
- package/dist/client/assets/excalidrawEditor-dBMbRX_S.js +9 -0
- package/dist/client/assets/export-page-CRRQ2NEl.js +57 -0
- package/dist/client/assets/exportDocument-BlQRd9_m.js +2 -0
- package/dist/client/assets/exportDocument-CNSbjZwu.css +1 -0
- package/dist/client/assets/flowDiagram-HODETNUW-D5Gy0wmg.js +1 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DtKHAbez.js → ganttDiagram-EL5Y4UJY-BHgOYiZz.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-oue8fQ5o.js → gitGraphDiagram-WWUBYQGX-Dl__X3Sk.js} +1 -1
- package/dist/client/assets/image-ZVKINSPA-DgzW5zAy.js +1 -0
- package/dist/client/assets/index-D3RER1SZ.js +1023 -0
- package/dist/client/assets/index-DREVKl_K.css +1 -0
- package/dist/client/assets/{infoDiagram-RXCK75RN-BMzo6KIn.js → infoDiagram-27XIBGKW-DBpoANC9.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BIM3h287.js → ishikawaDiagram-5VMMS53U-BMPC6hfp.js} +1 -1
- package/dist/client/assets/{journeyDiagram-EYS64GPL-mF6Lh8O-.js → journeyDiagram-3NMN7TZE-B1sApUmM.js} +2 -2
- package/dist/client/assets/{kanban-definition-3QL26DDD-DLN2NyoR.js → kanban-definition-UXKFOSKX-C9yP4td1.js} +4 -4
- package/dist/client/assets/{line-BfTWJmgf.js → line-BFl3ujec.js} +1 -1
- package/dist/client/assets/mermaid.core-BrY09czX.js +11 -0
- package/dist/client/assets/mermaid.core-DfcNfOTv.js +1 -0
- package/dist/client/assets/{mindmap-definition-FBJOCRG2-CRyHaHTk.js → mindmap-definition-YA3MSWOX-BUQHcYbK.js} +8 -8
- package/dist/client/assets/pegDiagram-XKGWAZYB-Bi2Iml7Z.js +1 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-B5OZPb88.js → pieDiagram-E7YTZNPT-_gYXnMoi.js} +1 -1
- package/dist/client/assets/preview-render-compiler-CfxJYldJ.js +41 -0
- package/dist/client/assets/preview-render-compiler-Cu8_i9iS.js +1 -0
- package/dist/client/assets/{preview-render-worker-_QTxqKvP.js → preview-render-worker-c4Yi93qW.js} +41 -35
- package/dist/client/assets/prod-BiJL30sl.js +1 -0
- package/dist/client/assets/prod-qAk7rHa4.js +177 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-Drrw14YH.js → quadrantDiagram-AXDQQJYC-DwexhEhd.js} +1 -1
- package/dist/client/assets/quick-switcher-controller-BoIK_wuG.js +1 -0
- package/dist/client/assets/railroadDiagram-O6MQD6OU-BVA5UbMu.js +1 -0
- package/dist/client/assets/{requirementDiagram-EFPCY7ZU-CRZG6mRB.js → requirementDiagram-BXWQKSXE-C4cKwiIw.js} +2 -2
- package/dist/client/assets/runtime-config-DcmnGcXU.js +1 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-DvarEJpo.js → sankeyDiagram-P5KCCOFB-B5HHkRT2.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-B4oWlb-w.js → sequenceDiagram-WJ2MYXX4-BX6jqJFD.js} +6 -6
- package/dist/client/assets/{stateDiagram-HBIQ2CUA-qbHIIqRZ.js → stateDiagram-D77RDMKH-CmqxyRGx.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-zoLLQVyh.js +1 -0
- package/dist/client/assets/{swimlanes-XN3QIQJK-xB6CtUGj.js → swimlanes-42K2YHIH-Bmgb9Zld.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DS-KQN37.js +8 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-Lj_yTNlY.js → timeline-definition-24CTP7MA-BA-lVH6P.js} +1 -1
- package/dist/client/assets/vault-api-client-iZLhMJKe.js +6 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-BekRp5Y0.js → vennDiagram-4TSXK5OY-DNdUC_Xj.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-kdnV_Hdm.js → wardleyDiagram-VM6X3IG4-C2oY-YbF.js} +1 -1
- package/dist/client/assets/wiki-link-resolver-DFIwErjc.js +1 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-DufGwNSB.js → xychartDiagram-S5SC5T6Z-CoIR8CBX.js} +1 -1
- package/dist/client/assets/{yjs-provider-reset-guard-DE0vINDP.js → yjs-provider-reset-guard-9ul1qF6k.js} +1 -1
- package/dist/client/drawio-editor.html +11 -3
- package/dist/client/excalidraw-editor.html +45 -2
- package/dist/client/export-document.html +3 -3
- package/dist/client/index.html +67 -35
- package/integrations/pi/index.ts +94 -0
- package/package.json +41 -32
- package/src/client/app/drawio-editor.html +2 -2
- package/src/client/app/excalidraw-editor.html +2 -2
- package/src/client/app/export-document.html +1 -1
- package/src/client/app/index.html +49 -33
- package/src/client/app/main-entry.js +15 -1
- package/src/client/application/app-shell/chat-feature.js +7 -22
- package/src/client/application/app-shell/git-feature.js +23 -5
- package/src/client/application/app-shell/presence-feature.js +8 -25
- package/src/client/application/app-shell/ui-feature-shell.js +36 -91
- package/src/client/application/app-shell/ui-feature-sidebar.js +43 -7
- package/src/client/application/app-shell/ui-feature-tab-activity.js +19 -6
- package/src/client/application/app-shell/ui-feature-toolbar.js +16 -129
- package/src/client/application/app-shell-elements.js +4 -0
- package/src/client/application/preview-render-compiler.js +1 -87
- package/src/client/application/preview-render-scheduler.js +8 -24
- package/src/client/application/preview-renderer.js +2 -2
- package/src/client/application/webmcp-diagram-renderer.js +47 -0
- package/src/client/application/workspace-coordinator.js +3 -1
- package/src/client/application/workspace-route-controller.js +7 -0
- package/src/client/bootstrap/collabmd-app-shell.js +78 -1
- package/src/client/domain/excalidraw-element-link.js +73 -0
- package/src/client/domain/excalidraw-scene.js +21 -0
- package/src/client/domain/hash-routes.js +8 -0
- package/src/client/domain/room.js +1 -5
- package/src/client/domain/runtime-paths.js +5 -0
- package/src/client/excalidraw-editor.js +135 -10
- package/src/client/export/export-host.js +3 -1
- package/src/client/export/export-pipeline.js +4 -17
- package/src/client/infrastructure/agent-connection-api-client.js +23 -0
- package/src/client/infrastructure/auth-client.js +3 -13
- package/src/client/infrastructure/editor-session.js +11 -0
- package/src/client/infrastructure/editor-view-adapter.js +13 -0
- package/src/client/infrastructure/excalidraw-room-client.js +80 -1
- package/src/client/infrastructure/git-api-client.js +39 -33
- package/src/client/infrastructure/lobby-presence.js +2 -5
- package/src/client/infrastructure/runtime-config.js +11 -1
- package/src/client/infrastructure/tab-activity-lock.js +2 -5
- package/src/client/infrastructure/vault-api-client.js +33 -26
- package/src/client/infrastructure/webmcp-tool-registry.js +283 -0
- package/src/client/infrastructure/workspace-sync-client.js +6 -4
- package/src/client/presentation/agent-connection-controller.js +255 -0
- package/src/client/presentation/backlinks-panel.js +3 -0
- package/src/client/presentation/bases-preview-controller.js +27 -18
- package/src/client/presentation/comment-ui/comment-ui-card.js +4 -2
- package/src/client/presentation/create-menu-presenter.js +19 -16
- package/src/client/presentation/excalidraw-embed-controller.js +164 -4
- package/src/client/presentation/file-explorer-view.js +70 -12
- package/src/client/presentation/file-history-view-controller.js +13 -11
- package/src/client/presentation/git-diff-view-controller.js +35 -43
- package/src/client/presentation/git-panel-controller.js +77 -27
- package/src/client/presentation/image-lightbox-controller.js +20 -16
- package/src/client/presentation/layout-controller.js +3 -1
- package/src/client/presentation/quick-switcher-controller.js +20 -78
- package/src/client/presentation/quick-switcher-text-search.js +10 -14
- package/src/client/styles/components/navigation.css +1 -2
- package/src/client/styles/features/agent-connection.css +202 -0
- package/src/client/styles/features/collaboration-chat.css +8 -1
- package/src/client/styles/features/collaboration-dialogs.css +16 -1
- package/src/client/styles/features/collaboration-presence.css +17 -4
- package/src/client/styles/features/diff-toolbar.css +1 -1
- package/src/client/styles/features/media-lightbox.css +12 -3
- package/src/client/styles/features/quick-switcher.css +20 -11
- package/src/client/styles/foundation/themes.css +2 -0
- package/src/client/styles/layout/editor-page.css +25 -11
- package/src/client/styles/layout/responsive.css +2 -20
- package/src/client/styles/layout/shell.css +1 -0
- package/src/client/styles/layout/sidebar.css +7 -4
- package/src/client/styles/primitives/controls.css +21 -54
- package/src/client/styles/style.css +1 -0
- package/src/domain/agent-tool-definitions.js +796 -0
- package/src/domain/collabmd-content-capabilities.js +149 -0
- package/src/domain/collaboration-protocol.js +2 -0
- package/src/domain/comment-threads.js +3 -5
- package/src/domain/diagram-source.js +50 -0
- package/src/domain/editable-content-revision.js +10 -0
- package/src/domain/editable-text.js +3 -0
- package/src/domain/exact-text-edits.js +69 -0
- package/src/domain/excalidraw-agent-scene.js +522 -0
- package/src/domain/excalidraw-agent-verification.js +460 -0
- package/src/domain/excalidraw-room-codec.js +1 -5
- package/src/domain/video-embed.js +76 -0
- package/src/server/application/agent-connection-service.js +178 -0
- package/src/server/application/agent-content-service.js +773 -0
- package/src/server/application/workspace-reconciliation.js +5 -7
- package/src/server/config/env.js +51 -1
- package/src/server/create-app-server.js +36 -0
- package/src/server/domain/bases/base-query-service.js +1 -5
- package/src/server/domain/collaboration/collaboration-room.js +121 -25
- package/src/server/domain/collaboration/protocol.js +4 -0
- package/src/server/domain/hosted-workspace.js +21 -0
- package/src/server/domain/markdown-reference-extractor.js +15 -1
- package/src/server/infrastructure/git/git-service.js +19 -1
- package/src/server/infrastructure/git/history-service.js +1 -1
- package/src/server/infrastructure/git/local-exclude.js +25 -0
- package/src/server/infrastructure/git/parsers.js +19 -17
- package/src/server/infrastructure/git/path-utils.js +0 -16
- package/src/server/infrastructure/git/status-service.js +1 -1
- package/src/server/infrastructure/git/untracked-files.js +12 -21
- package/src/server/infrastructure/http/create-agent-api-handler.js +171 -0
- package/src/server/infrastructure/http/create-git-api-command-handler.js +32 -0
- package/src/server/infrastructure/http/create-request-handler.js +28 -0
- package/src/server/infrastructure/http/create-static-handler.js +6 -0
- package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +199 -0
- package/src/server/infrastructure/persistence/agent-connection-store.js +120 -0
- package/src/server/infrastructure/persistence/pull-backup-store.js +2 -27
- package/src/server/infrastructure/persistence/vault-file-store.js +9 -2
- package/src/server/shared/agent-tool-image.js +22 -0
- package/src/server/shared/agent-tool-rate-limiter.js +20 -0
- package/src/server/startup/git-remote-bootstrap.js +5 -33
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BPH4FJkv.js +0 -1
- package/dist/client/assets/abnfDiagram-VCTEODGH-BNDLzJ7L.js +0 -1
- package/dist/client/assets/browser-utils--H_DkyEF.js +0 -1
- package/dist/client/assets/channel-CaoKA_We.js +0 -1
- package/dist/client/assets/chunk-DSNCTWBM-8xkug7fQ.js +0 -2
- package/dist/client/assets/chunk-DU6HZSFF-COXDzJK1.js +0 -127
- package/dist/client/assets/chunk-R7TYR2AO-CTd0Yj98.js +0 -10
- package/dist/client/assets/classDiagram-DTDB5LWJ-7fEmn0zV.js +0 -1
- package/dist/client/assets/classDiagram-v2-JRS7N3AN-7fEmn0zV.js +0 -1
- package/dist/client/assets/comment-threads-9J6Em-_y.js +0 -4
- package/dist/client/assets/comment-ui-shared-DuoyznXW.js +0 -7
- package/dist/client/assets/diagram-VSXAHHWV-CQRVEZR7.js +0 -3
- package/dist/client/assets/dist-73RPdcyU.js +0 -1
- package/dist/client/assets/dist-CH-sQu3r.js +0 -1
- package/dist/client/assets/document-formatter-Dxl_a8XO.js +0 -2
- package/dist/client/assets/drawio-editor-BVaNNtYp.js +0 -9
- package/dist/client/assets/drawioEditor-BkIBlXx0.js +0 -2
- package/dist/client/assets/ebnfDiagram-PWID7BFC-OXa8VEp1.js +0 -1
- package/dist/client/assets/editor-session-DMyVdHLj.js +0 -54
- package/dist/client/assets/excalidraw-editor-BjYaNEMY.js +0 -9
- package/dist/client/assets/excalidraw-mermaid-stub-BNckbX2n.js +0 -1
- package/dist/client/assets/excalidraw-mermaid-stub-DE5FTiZB.js +0 -1
- package/dist/client/assets/excalidrawEditor-ChqF_d82.js +0 -2
- package/dist/client/assets/export-page-Dyu0XCbu.js +0 -57
- package/dist/client/assets/exportDocument-CJBx4Xjx.css +0 -1
- package/dist/client/assets/exportDocument-Dgvfa2Sd.js +0 -2
- package/dist/client/assets/flowDiagram-A5DVABFB-CiW1eN8C.js +0 -1
- package/dist/client/assets/image-ZVKINSPA-0zXSnE7M.js +0 -1
- package/dist/client/assets/index-CSNIMyOP.css +0 -1
- package/dist/client/assets/index-DG3N2Ps-.js +0 -2
- package/dist/client/assets/main-D0wCxpVn.js +0 -903
- package/dist/client/assets/mermaid.core-BJRLUQZE.js +0 -11
- package/dist/client/assets/pegDiagram-XKGWAZYB-B31fKPR2.js +0 -1
- package/dist/client/assets/preview-render-compiler-CrJIooVD.js +0 -35
- package/dist/client/assets/preview-render-compiler-O0JxBVNF.js +0 -1
- package/dist/client/assets/preview-render-profile-B4RWYWHt.js +0 -1
- package/dist/client/assets/prod-BiYPMR1i.js +0 -177
- package/dist/client/assets/prod-VxdGZ5Ly.js +0 -1
- package/dist/client/assets/quick-switcher-controller-CaEjEtq_.js +0 -1
- package/dist/client/assets/railroadDiagram-O6MQD6OU-BPifP0MB.js +0 -1
- package/dist/client/assets/runtime-config-BLrEKVO1.js +0 -1
- package/dist/client/assets/stateDiagram-v2-4QOOHH4V-B--gjrit.js +0 -1
- package/dist/client/assets/swimlanesDiagram-VK2B7HYN-DO8XNXEg.js +0 -8
- package/dist/client/assets/vault-api-client-BkwdFjx0.js +0 -6
- package/src/client/app/drawio-editor-entry.js +0 -1
- package/src/client/app/excalidraw-editor-entry.js +0 -1
- package/src/client/excalidraw-mermaid-stub.js +0 -7
- package/src/client/main.js +0 -16
- /package/dist/client/assets/{drawio-editor-UQQ8XHou.css → drawioEditor-UQQ8XHou.css} +0 -0
- /package/dist/client/assets/{excalidraw-editor-BbSbI80a.css → excalidrawEditor-BbSbI80a.css} +0 -0
- /package/dist/client/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -247,7 +247,7 @@ function bindDialogEvents() {
|
|
|
247
247
|
this.elements.gitResetFileName.value = '';
|
|
248
248
|
}
|
|
249
249
|
if (this.elements.gitResetSubmit) {
|
|
250
|
-
this.elements.gitResetSubmit.textContent = 'Reset
|
|
250
|
+
this.elements.gitResetSubmit.textContent = 'Reset file';
|
|
251
251
|
}
|
|
252
252
|
});
|
|
253
253
|
|
|
@@ -294,13 +294,24 @@ function bindEvents() {
|
|
|
294
294
|
this.elements.emptyStateSearchBtn?.addEventListener('click', () => {
|
|
295
295
|
void this.toggleQuickSwitcher();
|
|
296
296
|
});
|
|
297
|
+
this.elements.presencePanel?.addEventListener('toggle', (event) => {
|
|
298
|
+
this.presencePanelOpen = event.newState === 'open';
|
|
299
|
+
this.renderAvatars?.();
|
|
300
|
+
this.renderPresence?.();
|
|
301
|
+
});
|
|
297
302
|
|
|
298
|
-
this.elements.
|
|
299
|
-
this.
|
|
300
|
-
this.
|
|
301
|
-
|
|
303
|
+
this.elements.chatPanel?.addEventListener('toggle', (event) => {
|
|
304
|
+
this.chatIsOpen = event.newState === 'open';
|
|
305
|
+
if (this.chatIsOpen) {
|
|
306
|
+
this.chatUnreadCount = 0;
|
|
307
|
+
}
|
|
308
|
+
this.renderChat?.({ messagesChanged: this.chatIsOpen, stickToBottom: this.chatIsOpen });
|
|
309
|
+
if (this.chatIsOpen) {
|
|
310
|
+
requestAnimationFrame(() => this.elements.chatInput?.focus());
|
|
311
|
+
}
|
|
302
312
|
});
|
|
303
313
|
|
|
314
|
+
|
|
304
315
|
this.elements.chatNotificationButton?.addEventListener('click', () => {
|
|
305
316
|
void this.handleChatNotificationToggle();
|
|
306
317
|
});
|
|
@@ -309,9 +320,6 @@ function bindEvents() {
|
|
|
309
320
|
this.toggleChatNotificationMute();
|
|
310
321
|
});
|
|
311
322
|
|
|
312
|
-
this.elements.chatCloseButton?.addEventListener('click', () => {
|
|
313
|
-
this.closeChatPanel({ restoreFocus: true });
|
|
314
|
-
});
|
|
315
323
|
|
|
316
324
|
this.elements.chatForm?.addEventListener('submit', (event) => {
|
|
317
325
|
event.preventDefault();
|
|
@@ -341,10 +349,6 @@ function bindEvents() {
|
|
|
341
349
|
this.toggleVimMode();
|
|
342
350
|
});
|
|
343
351
|
|
|
344
|
-
this.elements.userCount?.addEventListener('click', (event) => {
|
|
345
|
-
event.preventDefault();
|
|
346
|
-
this.togglePresencePanel?.();
|
|
347
|
-
});
|
|
348
352
|
|
|
349
353
|
this.elements.editorFindButton?.addEventListener('click', () => {
|
|
350
354
|
this.runEditorCommand?.('openSearch');
|
|
@@ -354,11 +358,6 @@ function bindEvents() {
|
|
|
354
358
|
void this.formatCurrentDocument();
|
|
355
359
|
});
|
|
356
360
|
|
|
357
|
-
this.elements.toolbarOverflowToggle?.addEventListener('click', (event) => {
|
|
358
|
-
event.preventDefault();
|
|
359
|
-
this.closePresencePanel?.();
|
|
360
|
-
this.toggleToolbarOverflowMenu();
|
|
361
|
-
});
|
|
362
361
|
|
|
363
362
|
this.elements.toolbarOverflowMenu?.addEventListener('click', (event) => {
|
|
364
363
|
const button = event.target instanceof Element ? event.target.closest('button') : null;
|
|
@@ -367,6 +366,14 @@ function bindEvents() {
|
|
|
367
366
|
}
|
|
368
367
|
});
|
|
369
368
|
|
|
369
|
+
this.elements.toolbarOverflowMenu?.addEventListener('toggle', (event) => {
|
|
370
|
+
if (event.newState === 'closed') {
|
|
371
|
+
this.elements.toolbarOverflowMenu.querySelectorAll('details[open]').forEach((detail) => {
|
|
372
|
+
detail.removeAttribute('open');
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
370
377
|
this.elements.previewContent?.addEventListener('click', (event) => {
|
|
371
378
|
this.handlePreviewContentClick?.(event);
|
|
372
379
|
});
|
|
@@ -399,47 +406,16 @@ function bindEvents() {
|
|
|
399
406
|
this.setSidebarTab('comments');
|
|
400
407
|
});
|
|
401
408
|
|
|
402
|
-
|
|
403
|
-
this.
|
|
409
|
+
this.elements.sidebarTabs?.addEventListener('keydown', (event) => {
|
|
410
|
+
this.handleSidebarTabsKeydown(event);
|
|
404
411
|
});
|
|
405
412
|
|
|
413
|
+
|
|
406
414
|
document.addEventListener('keydown', (event) => {
|
|
407
415
|
this.handleDocumentKeydown(event);
|
|
408
416
|
}, { capture: true });
|
|
409
417
|
}
|
|
410
418
|
|
|
411
|
-
/** @this {UiShellContext} */
|
|
412
|
-
function handleDocumentPointerDown(event) {
|
|
413
|
-
this.handleMarkdownToolbarDocumentPointerDown?.(event);
|
|
414
|
-
|
|
415
|
-
const target = event.target instanceof Element ? event.target : null;
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
this.toolbarOverflowOpen
|
|
419
|
-
&& !this.elements.toolbarOverflowMenu?.contains(target)
|
|
420
|
-
&& !this.elements.toolbarOverflowToggle?.contains(target)
|
|
421
|
-
) {
|
|
422
|
-
this.closeToolbarOverflowMenu();
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
if (
|
|
426
|
-
this.presencePanelOpen
|
|
427
|
-
&& !this.elements.presencePanel?.contains(target)
|
|
428
|
-
&& !target?.closest?.('[data-presence-panel-trigger="true"]')
|
|
429
|
-
) {
|
|
430
|
-
this.closePresencePanel?.();
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
if (!this.chatIsOpen) {
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
if (this.elements.chatContainer?.contains(target)) {
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
this.closeChatPanel({ restoreFocus: false });
|
|
442
|
-
}
|
|
443
419
|
|
|
444
420
|
/** @this {UiShellContext} */
|
|
445
421
|
function handleDocumentKeydown(event) {
|
|
@@ -447,20 +423,6 @@ function handleDocumentKeydown(event) {
|
|
|
447
423
|
this.stopFollowingUser?.();
|
|
448
424
|
}
|
|
449
425
|
|
|
450
|
-
if (event.key === 'Escape' && this.toolbarOverflowOpen) {
|
|
451
|
-
this.closeToolbarOverflowMenu();
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
if (event.key === 'Escape' && this.presencePanelOpen) {
|
|
456
|
-
this.closePresencePanel?.();
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
if (event.key === 'Escape' && this.chatIsOpen) {
|
|
461
|
-
this.closeChatPanel({ restoreFocus: true });
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
426
|
|
|
465
427
|
if (isPlainQuickSwitcherShortcut(event)) {
|
|
466
428
|
event.preventDefault();
|
|
@@ -883,20 +845,6 @@ function handlePreviewContentClick(event) {
|
|
|
883
845
|
this.session?.toggleTaskListItem?.(sourceLine);
|
|
884
846
|
}
|
|
885
847
|
|
|
886
|
-
/** @this {UiShellContext} */
|
|
887
|
-
function setToolbarOverflowOpen(nextState) {
|
|
888
|
-
this.toolbarOverflowOpen = Boolean(nextState);
|
|
889
|
-
this.elements.toolbarOverflowToggle?.setAttribute('aria-expanded', String(this.toolbarOverflowOpen));
|
|
890
|
-
this.elements.toolbarOverflowToggle?.classList.toggle('active', this.toolbarOverflowOpen);
|
|
891
|
-
this.elements.toolbarOverflowToggle?.closest('.toolbar-right')?.classList.toggle('is-overflow-open', this.toolbarOverflowOpen);
|
|
892
|
-
|
|
893
|
-
if (!this.toolbarOverflowOpen) {
|
|
894
|
-
this.elements.toolbarOverflowMenu?.querySelectorAll('details[open]').forEach((detail) => {
|
|
895
|
-
detail.removeAttribute('open');
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
|
|
900
848
|
/** @this {UiShellContext} */
|
|
901
849
|
function syncToolbarOverflowVisibility() {
|
|
902
850
|
const toggle = this.elements.toolbarOverflowToggle;
|
|
@@ -911,12 +859,9 @@ function syncToolbarOverflowVisibility() {
|
|
|
911
859
|
|
|
912
860
|
/** @this {UiShellContext} */
|
|
913
861
|
function closeToolbarOverflowMenu() {
|
|
914
|
-
this.
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
/** @this {UiShellContext} */
|
|
918
|
-
function toggleToolbarOverflowMenu() {
|
|
919
|
-
this.setToolbarOverflowOpen(!this.toolbarOverflowOpen);
|
|
862
|
+
if (this.elements.toolbarOverflowMenu?.matches(':popover-open')) {
|
|
863
|
+
this.elements.toolbarOverflowMenu.hidePopover();
|
|
864
|
+
}
|
|
920
865
|
}
|
|
921
866
|
|
|
922
867
|
/** @this {UiShellContext} */
|
|
@@ -1049,9 +994,12 @@ function showEditorLoading() {
|
|
|
1049
994
|
if (!this.elements.editorContainer) return;
|
|
1050
995
|
this.elements.editorContainer.classList.add('is-loading-editor');
|
|
1051
996
|
this.elements.editorContainer.innerHTML = `
|
|
1052
|
-
<div class="editor-loading" id="editorLoading">
|
|
1053
|
-
<div class="
|
|
1054
|
-
<
|
|
997
|
+
<div class="editor-loading" id="editorLoading" role="status" aria-live="polite" aria-label="Loading file…">
|
|
998
|
+
<div class="skeleton-line skeleton-line--title skeleton-line--break"></div>
|
|
999
|
+
<div class="skeleton-line skeleton-line--full"></div>
|
|
1000
|
+
<div class="skeleton-line skeleton-line--ninety"></div>
|
|
1001
|
+
<div class="skeleton-line skeleton-line--ninety-five"></div>
|
|
1002
|
+
<div class="skeleton-line skeleton-line--eighty"></div>
|
|
1055
1003
|
</div>`;
|
|
1056
1004
|
}
|
|
1057
1005
|
|
|
@@ -1095,7 +1043,6 @@ export const uiFeatureShellMethods = {
|
|
|
1095
1043
|
getStoredVimMode,
|
|
1096
1044
|
handleConnectionChange,
|
|
1097
1045
|
handleDocumentKeydown,
|
|
1098
|
-
handleDocumentPointerDown,
|
|
1099
1046
|
handlePreviewContentClick,
|
|
1100
1047
|
handleThemeChange,
|
|
1101
1048
|
hideEditorLoading,
|
|
@@ -1107,7 +1054,6 @@ export const uiFeatureShellMethods = {
|
|
|
1107
1054
|
promptForVersionReload,
|
|
1108
1055
|
requestPreviewRouteAnchor,
|
|
1109
1056
|
scheduleBacklinkRefresh,
|
|
1110
|
-
setToolbarOverflowOpen,
|
|
1111
1057
|
showEditorLoadError,
|
|
1112
1058
|
showEditorLoading,
|
|
1113
1059
|
syncPreviewCodeCopyButtons,
|
|
@@ -1117,7 +1063,6 @@ export const uiFeatureShellMethods = {
|
|
|
1117
1063
|
syncToolbarOverflowVisibility,
|
|
1118
1064
|
syncVimModeToggle,
|
|
1119
1065
|
syncWrapToggle,
|
|
1120
|
-
toggleToolbarOverflowMenu,
|
|
1121
1066
|
toggleLineWrapping,
|
|
1122
1067
|
unfoldPreviewHeading,
|
|
1123
1068
|
toggleVimMode,
|
|
@@ -153,6 +153,26 @@ function applySidebarVisibility(showSidebar) {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/** @this {UiSidebarContext} */
|
|
157
|
+
function handleSidebarTabsKeydown(event) {
|
|
158
|
+
if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) return;
|
|
159
|
+
|
|
160
|
+
const tabs = [
|
|
161
|
+
this.elements.filesSidebarTab,
|
|
162
|
+
this.elements.commentsSidebarTab,
|
|
163
|
+
this.elements.gitSidebarTab,
|
|
164
|
+
].filter((tab) => tab && !tab.classList.contains('hidden'));
|
|
165
|
+
const currentIndex = Math.max(0, tabs.indexOf(event.target));
|
|
166
|
+
const nextIndex = event.key === 'Home'
|
|
167
|
+
? 0
|
|
168
|
+
: event.key === 'End'
|
|
169
|
+
? tabs.length - 1
|
|
170
|
+
: (currentIndex + (event.key === 'ArrowRight' ? 1 : -1) + tabs.length) % tabs.length;
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
tabs[nextIndex]?.click();
|
|
173
|
+
tabs[nextIndex]?.focus();
|
|
174
|
+
}
|
|
175
|
+
|
|
156
176
|
/** @this {UiSidebarContext} */
|
|
157
177
|
function setSidebarTab(tab) {
|
|
158
178
|
const nextTab = tab === 'git' && this.gitRepoAvailable
|
|
@@ -162,15 +182,30 @@ function setSidebarTab(tab) {
|
|
|
162
182
|
: 'files';
|
|
163
183
|
this.activeSidebarTab = nextTab;
|
|
164
184
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
185
|
+
[
|
|
186
|
+
[this.elements.filesSidebarTab, 'files'],
|
|
187
|
+
[this.elements.commentsSidebarTab, 'comments'],
|
|
188
|
+
[this.elements.gitSidebarTab, 'git'],
|
|
189
|
+
].forEach(([button, buttonTab]) => {
|
|
190
|
+
const selected = nextTab === buttonTab;
|
|
191
|
+
button?.classList.toggle('active', selected);
|
|
192
|
+
button?.setAttribute('aria-selected', String(selected));
|
|
193
|
+
button?.setAttribute('tabindex', selected ? '0' : '-1');
|
|
194
|
+
});
|
|
195
|
+
const filePanel = document.getElementById('fileTree');
|
|
196
|
+
const commentPanel = this.elements.commentOverviewPanel;
|
|
197
|
+
const gitPanelElement = document.getElementById('gitPanel');
|
|
198
|
+
[
|
|
199
|
+
[filePanel, nextTab === 'files'],
|
|
200
|
+
[commentPanel, nextTab === 'comments'],
|
|
201
|
+
[gitPanelElement, nextTab === 'git'],
|
|
202
|
+
].forEach(([panel, selected]) => {
|
|
203
|
+
panel?.classList.toggle('hidden', !selected);
|
|
204
|
+
panel?.setAttribute('aria-hidden', String(!selected));
|
|
205
|
+
});
|
|
169
206
|
this.elements.fileSearch?.classList.toggle('hidden', nextTab !== 'files');
|
|
170
|
-
this.elements.commentOverviewPanel?.classList.toggle('hidden', nextTab !== 'comments');
|
|
171
207
|
this.elements.gitSearch?.classList.toggle('hidden', nextTab !== 'git');
|
|
172
|
-
|
|
173
|
-
document.getElementById('gitPanel')?.classList.toggle('hidden', nextTab !== 'git');
|
|
208
|
+
gitPanelElement?.classList.toggle('active', nextTab === 'git');
|
|
174
209
|
this.gitPanel.setActive(nextTab === 'git');
|
|
175
210
|
if (nextTab === 'comments') {
|
|
176
211
|
this.refreshCommentOverviewForSidebarOpen?.();
|
|
@@ -180,6 +215,7 @@ function setSidebarTab(tab) {
|
|
|
180
215
|
export const uiFeatureSidebarMethods = {
|
|
181
216
|
applySidebarVisibility,
|
|
182
217
|
closeSidebarOnMobile,
|
|
218
|
+
handleSidebarTabsKeydown,
|
|
183
219
|
initializeSidebarResizer,
|
|
184
220
|
isMobileViewport,
|
|
185
221
|
restoreSidebarState,
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
* @property {string | null} followedUserClientId
|
|
11
11
|
* @property {string} followedCursorSignature
|
|
12
12
|
* @property {{ status: string, unreachable: boolean }} connectionState
|
|
13
|
-
* @property {{
|
|
13
|
+
* @property {{ tabLockOverlay?: HTMLDialogElement | null, tabLockTitle?: HTMLElement | null, tabLockCopy?: HTMLElement | null }} elements
|
|
14
14
|
* @property {{ connect(): void, disconnect(): void, provider?: unknown }} lobby
|
|
15
15
|
* @property {{ connect(): void, disconnect(): void, provider?: unknown }} workspaceSync
|
|
16
16
|
* @property {{ show(message: string): void }} toastController
|
|
17
17
|
* @property {{ tryActivate(options?: { takeover?: boolean }): void }} tabActivityLock
|
|
18
|
+
* @property {{ refresh(): Promise<boolean> }} webMcpTools
|
|
18
19
|
* @property {{ prepareFileDisconnect(filePath: string): Promise<void> }} excalidrawEmbed
|
|
19
20
|
* @property {{ handleHashChange(): Promise<void> }} workspaceRouteController
|
|
20
21
|
* @property {() => boolean} isExcalidrawFile
|
|
@@ -35,6 +36,7 @@ function handleTabActivated({ takeover = false } = {}) {
|
|
|
35
36
|
const wasInactive = !this.isTabActive;
|
|
36
37
|
this.isTabActive = true;
|
|
37
38
|
this.hideTabLockOverlay();
|
|
39
|
+
void this.webMcpTools?.refresh();
|
|
38
40
|
|
|
39
41
|
if (!this.lobby.provider) {
|
|
40
42
|
this.lobby.connect();
|
|
@@ -65,9 +67,7 @@ async function handleTabBlocked({ reason } = {}) {
|
|
|
65
67
|
);
|
|
66
68
|
|
|
67
69
|
this.isTabActive = false;
|
|
68
|
-
|
|
69
|
-
this.elements.displayNameDialog.close();
|
|
70
|
-
}
|
|
70
|
+
void this.webMcpTools?.refresh();
|
|
71
71
|
this.lobby.disconnect();
|
|
72
72
|
this.workspaceSync.disconnect();
|
|
73
73
|
this.globalUsers = [];
|
|
@@ -100,6 +100,11 @@ function showTabLockOverlay({ reason } = {}) {
|
|
|
100
100
|
const copy = this.elements.tabLockCopy;
|
|
101
101
|
if (!overlay) return;
|
|
102
102
|
|
|
103
|
+
document.dispatchEvent(new Event('collabmd:close-custom-modals'));
|
|
104
|
+
document.querySelectorAll('dialog[open]').forEach((dialog) => {
|
|
105
|
+
if (dialog !== overlay) dialog.close();
|
|
106
|
+
});
|
|
107
|
+
|
|
103
108
|
if (title) {
|
|
104
109
|
title.textContent = reason === 'taken-over'
|
|
105
110
|
? 'This tab is no longer active'
|
|
@@ -112,12 +117,20 @@ function showTabLockOverlay({ reason } = {}) {
|
|
|
112
117
|
: 'To avoid duplicate presence and chat, only one tab can stay connected at a time. Use the other tab, or take over the session here.';
|
|
113
118
|
}
|
|
114
119
|
|
|
115
|
-
overlay.
|
|
120
|
+
if (!overlay.open) {
|
|
121
|
+
this.tabLockPreviouslyFocusedElement = document.activeElement instanceof HTMLElement
|
|
122
|
+
? document.activeElement
|
|
123
|
+
: null;
|
|
124
|
+
overlay.showModal();
|
|
125
|
+
}
|
|
126
|
+
this.elements.tabLockTakeoverButton?.focus();
|
|
116
127
|
}
|
|
117
128
|
|
|
118
129
|
/** @this {UiTabActivityContext} */
|
|
119
130
|
function hideTabLockOverlay() {
|
|
120
|
-
this.elements.tabLockOverlay?.
|
|
131
|
+
if (this.elements.tabLockOverlay?.open) this.elements.tabLockOverlay.close();
|
|
132
|
+
this.tabLockPreviouslyFocusedElement?.focus?.();
|
|
133
|
+
this.tabLockPreviouslyFocusedElement = null;
|
|
121
134
|
}
|
|
122
135
|
|
|
123
136
|
export const uiFeatureTabActivityMethods = {
|
|
@@ -39,13 +39,17 @@ function renderBlockMenuMarkup(activeAction) {
|
|
|
39
39
|
type="button"
|
|
40
40
|
class="ui-button ui-button--ghost markdown-toolbar-block-trigger"
|
|
41
41
|
data-markdown-block-menu-toggle
|
|
42
|
-
|
|
43
|
-
aria-expanded="false"
|
|
42
|
+
popovertarget="markdownBlockMenuPopover"
|
|
44
43
|
title="Block formatting"
|
|
45
44
|
>
|
|
46
45
|
<span class="markdown-toolbar-block-trigger-label" data-markdown-block-trigger-label>${triggerLabel}</span>
|
|
47
46
|
<span class="markdown-toolbar-block-trigger-icon" aria-hidden="true">${icons.chevronDown}</span>
|
|
48
47
|
</button>
|
|
48
|
+
<div id="markdownBlockMenuPopover" class="markdown-toolbar-popover" popover="auto">
|
|
49
|
+
<div class="markdown-toolbar-menu" data-markdown-block-menu role="menu" aria-label="Block formatting">
|
|
50
|
+
${renderBlockMenuItemsMarkup(activeAction)}
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
49
53
|
</div>
|
|
50
54
|
`;
|
|
51
55
|
}
|
|
@@ -111,39 +115,12 @@ function renderMarkdownToolbar() {
|
|
|
111
115
|
|
|
112
116
|
const activeAction = this.getActiveMarkdownBlockAction();
|
|
113
117
|
root.innerHTML = renderMarkdownToolbarMarkup(activeAction);
|
|
114
|
-
this.renderMarkdownBlockMenuPopover();
|
|
115
118
|
this.syncMarkdownToolbarBlockUi();
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
/** @this {UiToolbarContext} */
|
|
119
122
|
function getMarkdownBlockMenuPopover() {
|
|
120
|
-
return
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** @this {UiToolbarContext} */
|
|
124
|
-
function renderMarkdownBlockMenuPopover() {
|
|
125
|
-
const mountTarget = this.elements?.editorContainer ?? document.body;
|
|
126
|
-
let popover = this.getMarkdownBlockMenuPopover();
|
|
127
|
-
if (!popover) {
|
|
128
|
-
popover = document.createElement('div');
|
|
129
|
-
popover.className = 'markdown-toolbar-popover hidden';
|
|
130
|
-
popover.innerHTML = '<div class="markdown-toolbar-menu" data-markdown-block-menu role="menu" aria-label="Block formatting"></div>';
|
|
131
|
-
popover.addEventListener('click', (event) => {
|
|
132
|
-
this.handleMarkdownToolbarClick?.(event);
|
|
133
|
-
});
|
|
134
|
-
popover.addEventListener('keydown', (event) => {
|
|
135
|
-
this.handleMarkdownToolbarKeydown?.(event);
|
|
136
|
-
});
|
|
137
|
-
mountTarget?.appendChild(popover);
|
|
138
|
-
this._markdownBlockMenuPopover = popover;
|
|
139
|
-
} else if (popover.parentElement !== mountTarget) {
|
|
140
|
-
mountTarget?.appendChild(popover);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const menu = popover.querySelector('[data-markdown-block-menu]');
|
|
144
|
-
if (menu) {
|
|
145
|
-
menu.innerHTML = renderBlockMenuItemsMarkup(this.getActiveMarkdownBlockAction());
|
|
146
|
-
}
|
|
123
|
+
return document.getElementById('markdownBlockMenuPopover');
|
|
147
124
|
}
|
|
148
125
|
|
|
149
126
|
/** @this {UiToolbarContext} */
|
|
@@ -166,13 +143,7 @@ function syncMarkdownToolbarBlockUi() {
|
|
|
166
143
|
toggle.setAttribute('title', `${actionMeta.label}. Block formatting`);
|
|
167
144
|
}
|
|
168
145
|
|
|
169
|
-
const
|
|
170
|
-
this.getMarkdownBlockMenuPopover()?.querySelectorAll('[data-markdown-block-action]') ?? [],
|
|
171
|
-
);
|
|
172
|
-
const blockActionItems = [
|
|
173
|
-
...root.querySelectorAll('[data-markdown-block-action]'),
|
|
174
|
-
...popoverItems,
|
|
175
|
-
];
|
|
146
|
+
const blockActionItems = root.querySelectorAll('[data-markdown-block-action]');
|
|
176
147
|
blockActionItems.forEach((item) => {
|
|
177
148
|
const itemAction = item.getAttribute('data-markdown-block-action');
|
|
178
149
|
const isActive = itemAction === activeAction;
|
|
@@ -194,71 +165,23 @@ function setActiveMarkdownBlockAction(action) {
|
|
|
194
165
|
|
|
195
166
|
/** @this {UiToolbarContext} */
|
|
196
167
|
function isMarkdownBlockMenuOpen() {
|
|
197
|
-
return Boolean(this.
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/** @this {UiToolbarContext} */
|
|
201
|
-
function positionMarkdownBlockMenu() {
|
|
202
|
-
const popover = this.getMarkdownBlockMenuPopover();
|
|
203
|
-
const toggle = this.elements?.markdownToolbar?.querySelector('[data-markdown-block-menu-toggle]');
|
|
204
|
-
const mountTarget = popover?.parentElement;
|
|
205
|
-
if (!popover || !toggle || !(mountTarget instanceof HTMLElement)) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const toggleRect = toggle.getBoundingClientRect();
|
|
210
|
-
const mountRect = mountTarget.getBoundingClientRect();
|
|
211
|
-
const menuRect = popover.getBoundingClientRect();
|
|
212
|
-
const menuWidth = menuRect.width || 176;
|
|
213
|
-
const menuHeight = menuRect.height || 240;
|
|
214
|
-
const horizontalPadding = 8;
|
|
215
|
-
const verticalGap = 6;
|
|
216
|
-
const preferredLeft = toggleRect.left - mountRect.left;
|
|
217
|
-
const maxLeft = Math.max(horizontalPadding, mountRect.width - menuWidth - horizontalPadding);
|
|
218
|
-
const preferredTop = (toggleRect.bottom - mountRect.top) + verticalGap;
|
|
219
|
-
const fitsBelow = preferredTop + menuHeight <= mountRect.height - horizontalPadding;
|
|
220
|
-
|
|
221
|
-
popover.style.left = `${Math.max(horizontalPadding, Math.min(preferredLeft, maxLeft))}px`;
|
|
222
|
-
popover.style.top = `${fitsBelow
|
|
223
|
-
? preferredTop
|
|
224
|
-
: Math.max(horizontalPadding, (toggleRect.top - mountRect.top) - menuHeight - verticalGap)}px`;
|
|
168
|
+
return Boolean(this.getMarkdownBlockMenuPopover()?.matches(':popover-open'));
|
|
225
169
|
}
|
|
226
170
|
|
|
227
171
|
/** @this {UiToolbarContext} */
|
|
228
172
|
function openMarkdownBlockMenu() {
|
|
229
|
-
const root = this.elements?.markdownToolbar;
|
|
230
|
-
if (!root) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
this.renderMarkdownBlockMenuPopover();
|
|
235
|
-
root.classList.add('is-menu-open');
|
|
236
173
|
const popover = this.getMarkdownBlockMenuPopover();
|
|
237
|
-
popover
|
|
238
|
-
|
|
239
|
-
this.positionMarkdownBlockMenu();
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/** @this {UiToolbarContext} */
|
|
243
|
-
function closeMarkdownBlockMenu() {
|
|
244
|
-
const root = this.elements?.markdownToolbar;
|
|
245
|
-
if (!root) {
|
|
246
|
-
return;
|
|
174
|
+
if (popover && !popover.matches(':popover-open')) {
|
|
175
|
+
popover.showPopover();
|
|
247
176
|
}
|
|
248
|
-
|
|
249
|
-
root.classList.remove('is-menu-open');
|
|
250
|
-
this.getMarkdownBlockMenuPopover()?.classList.add('hidden');
|
|
251
|
-
root.querySelector('[data-markdown-block-menu-toggle]')?.setAttribute('aria-expanded', 'false');
|
|
252
177
|
}
|
|
253
178
|
|
|
254
179
|
/** @this {UiToolbarContext} */
|
|
255
|
-
function
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
180
|
+
function closeMarkdownBlockMenu() {
|
|
181
|
+
const popover = this.getMarkdownBlockMenuPopover();
|
|
182
|
+
if (popover?.matches(':popover-open')) {
|
|
183
|
+
popover.hidePopover();
|
|
259
184
|
}
|
|
260
|
-
|
|
261
|
-
this.openMarkdownBlockMenu();
|
|
262
185
|
}
|
|
263
186
|
|
|
264
187
|
/** @this {UiToolbarContext} */
|
|
@@ -276,12 +199,6 @@ function handleMarkdownToolbarClick(event) {
|
|
|
276
199
|
return;
|
|
277
200
|
}
|
|
278
201
|
|
|
279
|
-
const blockMenuToggle = target.closest('[data-markdown-block-menu-toggle]');
|
|
280
|
-
if (blockMenuToggle) {
|
|
281
|
-
event.preventDefault();
|
|
282
|
-
this.toggleMarkdownBlockMenu();
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
202
|
|
|
286
203
|
const blockActionButton = target.closest('[data-markdown-block-action]');
|
|
287
204
|
if (blockActionButton) {
|
|
@@ -309,7 +226,7 @@ function handleMarkdownToolbarKeydown(event) {
|
|
|
309
226
|
const toggle = event.target instanceof Element
|
|
310
227
|
? event.target.closest('[data-markdown-block-menu-toggle]')
|
|
311
228
|
: null;
|
|
312
|
-
if (toggle &&
|
|
229
|
+
if (toggle && event.key === 'ArrowDown') {
|
|
313
230
|
event.preventDefault();
|
|
314
231
|
this.openMarkdownBlockMenu();
|
|
315
232
|
this.getMarkdownBlockMenuPopover()?.querySelector('[data-markdown-block-action]')?.focus();
|
|
@@ -317,18 +234,7 @@ function handleMarkdownToolbarKeydown(event) {
|
|
|
317
234
|
return;
|
|
318
235
|
}
|
|
319
236
|
|
|
320
|
-
if (event.key === 'Escape') {
|
|
321
|
-
event.preventDefault();
|
|
322
|
-
this.closeMarkdownBlockMenu();
|
|
323
|
-
this.elements?.markdownToolbar?.querySelector('[data-markdown-block-menu-toggle]')?.focus();
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
237
|
const menuItems = Array.from(this.getMarkdownBlockMenuPopover()?.querySelectorAll('[data-markdown-block-action]') ?? []);
|
|
328
|
-
if (menuItems.length === 0) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
238
|
const currentIndex = menuItems.findIndex((item) => item === event.target);
|
|
333
239
|
if (currentIndex < 0) {
|
|
334
240
|
return;
|
|
@@ -343,21 +249,6 @@ function handleMarkdownToolbarKeydown(event) {
|
|
|
343
249
|
}
|
|
344
250
|
}
|
|
345
251
|
|
|
346
|
-
/** @this {UiToolbarContext} */
|
|
347
|
-
function handleMarkdownToolbarDocumentPointerDown(event) {
|
|
348
|
-
if (!this.isMarkdownBlockMenuOpen()) {
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
if (
|
|
353
|
-
this.elements?.markdownToolbar?.contains(event.target)
|
|
354
|
-
|| this.getMarkdownBlockMenuPopover()?.contains(event.target)
|
|
355
|
-
) {
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
this.closeMarkdownBlockMenu();
|
|
360
|
-
}
|
|
361
252
|
|
|
362
253
|
/** @this {UiToolbarContext} */
|
|
363
254
|
function applyMarkdownToolbarAction(action) {
|
|
@@ -470,16 +361,12 @@ export const uiFeatureToolbarMethods = {
|
|
|
470
361
|
getMarkdownBlockMenuPopover,
|
|
471
362
|
handleEditorImageInsert,
|
|
472
363
|
handleMarkdownToolbarClick,
|
|
473
|
-
handleMarkdownToolbarDocumentPointerDown,
|
|
474
364
|
handleMarkdownToolbarKeydown,
|
|
475
365
|
handleToolbarImageInsert,
|
|
476
366
|
isMarkdownBlockMenuOpen,
|
|
477
367
|
openMarkdownBlockMenu,
|
|
478
|
-
positionMarkdownBlockMenu,
|
|
479
|
-
renderMarkdownBlockMenuPopover,
|
|
480
368
|
renderMarkdownToolbar,
|
|
481
369
|
runEditorCommand,
|
|
482
370
|
setActiveMarkdownBlockAction,
|
|
483
371
|
syncMarkdownToolbarBlockUi,
|
|
484
|
-
toggleMarkdownBlockMenu,
|
|
485
372
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export function bindAppShellElements(doc = document) {
|
|
2
2
|
return {
|
|
3
|
+
agentConnectionContent: doc.getElementById('agentConnectionContent'),
|
|
4
|
+
agentConnectionDialog: doc.getElementById('agentConnectionDialog'),
|
|
5
|
+
connectAgentButton: doc.getElementById('connectAgentBtn'),
|
|
3
6
|
currentUserName: doc.getElementById('currentUserName'),
|
|
4
7
|
chatContainer: doc.getElementById('chatContainer'),
|
|
5
8
|
chatEmptyState: doc.getElementById('chatEmptyState'),
|
|
@@ -35,6 +38,7 @@ export function bindAppShellElements(doc = document) {
|
|
|
35
38
|
displayNameInput: doc.getElementById('displayNameInput'),
|
|
36
39
|
displayNameSubmit: doc.getElementById('displayNameSubmit'),
|
|
37
40
|
displayNameTitle: doc.getElementById('displayNameTitle'),
|
|
41
|
+
fileActionDialog: doc.getElementById('fileActionDialog'),
|
|
38
42
|
editNameButton: doc.getElementById('editNameBtn'),
|
|
39
43
|
editorFindButton: doc.getElementById('editorFindBtn'),
|
|
40
44
|
editorFormatButton: doc.getElementById('editorFormatBtn'),
|