collabmd 0.1.44 → 0.1.46
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 +39 -19
- package/bin/collabmd.js +27 -1
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-CYM5nxUi.js +1 -0
- package/dist/client/assets/browser-utils--H_DkyEF.js +1 -0
- package/dist/client/assets/chunk-ERSWUTIN-hHdvnhaY.js +41 -0
- package/dist/client/assets/{chunk-CZQZEIFA-DT3N9fo7.js → chunk-YGJVY4SA-CjSe7Bx7.js} +2 -2
- package/dist/client/assets/comment-thread-store-CdcwrObc.js +1 -0
- package/dist/client/assets/comment-threads-9J6Em-_y.js +4 -0
- package/dist/client/assets/comment-ui-shared-BC4pt4w8.js +7 -0
- package/dist/client/assets/dist-B5HTH2BO.js +1 -0
- package/dist/client/assets/{dist-DhLvC8DS.js → dist-B5Jf1SLZ.js} +2 -2
- package/dist/client/assets/{dist-CnL7Y2sM.js → dist-BDt3rz7l.js} +1 -1
- package/dist/client/assets/dist-BEwK4csK.js +1 -0
- package/dist/client/assets/dist-BKW4PALF.js +1 -0
- package/dist/client/assets/dist-BWcHHOx-.js +1 -0
- package/dist/client/assets/{dist-CYZmbokb.js → dist-BalScOwZ.js} +9 -9
- package/dist/client/assets/dist-Bf8f4HmM.js +6 -0
- package/dist/client/assets/dist-BjHJDtyU.js +1 -0
- package/dist/client/assets/dist-Bm6pf9Bl.js +1 -0
- package/dist/client/assets/dist-BoVBdSjk.js +1 -0
- package/dist/client/assets/dist-CC5IrQMG.js +1 -0
- package/dist/client/assets/{dist-C11hHqv_.js → dist-CCP_AKPG.js} +12 -12
- package/dist/client/assets/dist-CZgOmxK6.js +1 -0
- package/dist/client/assets/{dist-D2AQ-76g.js → dist-Cqhv5LAk.js} +1 -1
- package/dist/client/assets/{dist-MvcV4190.js → dist-D-Z6FLem.js} +1 -1
- package/dist/client/assets/dist-DLMiIsNC.js +11 -0
- package/dist/client/assets/{dist-3bgCp7iY.js → dist-DZKu9Cs8.js} +1 -1
- package/dist/client/assets/dist-DaYdhcVs.js +1 -0
- package/dist/client/assets/dist-FWJsgGYI.js +1 -0
- package/dist/client/assets/dist-Kh2COra_.js +1 -0
- package/dist/client/assets/{dist-JYEDRrPT.js → dist-PDZ3bSqm.js} +1 -1
- package/dist/client/assets/{dist-Drp8uu5J.js → dist-TjMh8n1u.js} +1 -1
- package/dist/client/assets/{dist-DGb27Dl6.js → dist-dtAdgL39.js} +1 -1
- package/dist/client/assets/dist-jv4WdPnK.js +9 -0
- package/dist/client/assets/{dist-DK5Gs2wa.js → dist-rGBmqxC7.js} +1 -1
- package/dist/client/assets/{dist-DCzuX1AF.js → dist-shrl6K_0.js} +1 -1
- package/dist/client/assets/dist-tOaegDYS2.js +1 -0
- package/dist/client/assets/dist-ule2n6ak.js +1 -0
- package/dist/client/assets/dist-xElaxbia.js +1 -0
- package/dist/client/assets/drawio-editor-FzY1cVw8.js +9 -0
- package/dist/client/assets/drawioEditor-BjiKJqlc.js +2 -0
- package/dist/client/assets/editor-session-Cm9ekeNo.js +54 -0
- package/dist/client/assets/embedded-editor-base-CwTkk911.css +1 -0
- package/dist/client/assets/{en-GADW4C6J-DQ6zyCEM.js → en-7NFCYGKX-BrgYZAEe.js} +1 -1
- package/dist/client/assets/{preview-render-profile-BZzGSg6K.js → es-DXGV3RHd.js} +13 -13
- package/dist/client/assets/excalidraw-editor-B46zsTFI.js +9 -0
- package/dist/client/assets/excalidraw-editor-Bt7gMSoh.css +1 -0
- package/dist/client/assets/excalidraw-scene-BOben2gr.js +1 -0
- package/dist/client/assets/excalidrawEditor-CT2pHq7e.js +2 -0
- package/dist/client/assets/export-page-A7NHawJY.js +39 -0
- package/dist/client/assets/exportDocument-B2L8fe34.css +1 -0
- package/dist/client/assets/exportDocument-BaqcOAAW.js +2 -0
- package/dist/client/assets/file-icon-svg-CQAjlWjK.js +1 -0
- package/dist/client/assets/file-kind-BbqgGzpc.js +1 -0
- package/dist/client/assets/image-QXRYHUNP-SWEV8H0J.js +1 -0
- package/dist/client/assets/index-ClbjMBVt.js +2 -0
- package/dist/client/assets/index-Pum8ET-5.css +1 -0
- package/dist/client/assets/main-B3uPyqic.js +893 -0
- package/dist/client/assets/modulepreload-polyfill-P2Xu9kJm.js +1 -0
- package/dist/client/assets/pdf-BL9Pr2D5.js +54 -0
- package/dist/client/assets/pdf.worker-CLesOks4.mjs +64857 -0
- package/dist/client/assets/pdf_viewer-FVkkThnz.js +551 -0
- package/dist/client/assets/preview-diagram-utils-txBCoW8d.js +1 -0
- package/dist/client/assets/{preview-render-compiler-BSaQO_p3.js → preview-render-compiler-BD-XhkS2.js} +2 -2
- package/dist/client/assets/preview-render-compiler-BKedaMxx.js +1 -0
- package/dist/client/assets/preview-render-profile-CE-5rVTC.js +1 -0
- package/dist/client/assets/{preview-render-worker-B42LWvrD.js → preview-render-worker-CiPqc9n6.js} +20 -20
- package/dist/client/assets/prod-Dy20X7eT.js +1 -0
- package/dist/client/assets/prod-hnwh7wRM.js +177 -0
- package/dist/client/assets/quick-switcher-controller-fqOYR7qR.js +12 -0
- package/dist/client/assets/runtime-config-BLrEKVO1.js +1 -0
- package/dist/client/assets/vault-api-client-_LpV1aIn.js +6 -0
- package/dist/client/assets/{yjs-provider-reset-guard-Cox4nxwu.js → yjs-provider-reset-guard-DE0vINDP.js} +1 -1
- package/dist/client/drawio-editor.html +3 -2
- package/dist/client/excalidraw-editor.html +3 -2
- package/dist/client/export-document.html +4 -3
- package/dist/client/index.html +109 -27
- package/docker-compose.yml +42 -0
- package/package.json +26 -15
- package/scripts/local-structurizr-compose.mjs +101 -0
- package/src/client/app/drawio-editor-entry.js +0 -3
- package/src/client/app/drawio-editor.html +1 -0
- package/src/client/app/excalidraw-editor-entry.js +0 -3
- package/src/client/app/excalidraw-editor.html +1 -0
- package/src/client/app/export-document-entry.js +0 -3
- package/src/client/app/export-document.html +1 -0
- package/src/client/app/index.html +106 -24
- package/src/client/app/main-entry.js +0 -5
- package/src/client/application/app-shell/chat-feature.js +180 -124
- package/src/client/application/app-shell/comments-feature.js +20 -11
- package/src/client/application/app-shell/git-feature.js +16 -9
- package/src/client/application/app-shell/presence-feature.js +18 -11
- package/src/client/application/app-shell/ui-feature-shell.js +78 -17
- package/src/client/application/app-shell/ui-feature-sidebar.js +74 -1
- package/src/client/application/app-shell/ui-feature-tab-activity.js +2 -2
- package/src/client/application/app-shell/ui-feature-toolbar.js +2 -52
- package/src/client/application/app-shell/workspace-feature.js +27 -84
- package/src/client/application/app-shell-elements.js +9 -1
- package/src/client/application/diagram-chrome.js +161 -166
- package/src/client/application/diagram-preview-export.js +7 -34
- package/src/client/application/diagram-preview-hydrator.js +1 -19
- package/src/client/application/markdown-frontmatter.js +0 -2
- package/src/client/application/mermaid-preview-hydrator.js +1 -14
- package/src/client/application/pdf-preview-controller.js +992 -0
- package/src/client/application/plantuml-preview-hydrator.js +0 -10
- package/src/client/application/preview-diagram-utils.js +31 -2
- package/src/client/application/preview-render-compiler.js +2 -1
- package/src/client/application/preview-renderer.js +2 -2
- package/src/client/application/quick-switcher-loader.js +3 -1
- package/src/client/application/structurizr-preview-controller.js +395 -0
- package/src/client/application/workspace-coordinator.js +25 -3
- package/src/client/application/workspace-preview-controller.js +91 -5
- package/src/client/bootstrap/collabmd-app-shell.js +155 -43
- package/src/client/browser-utils.js +44 -0
- package/src/client/domain/excalidraw-collaboration.js +0 -2
- package/src/client/domain/room.js +38 -0
- package/src/client/domain/runtime-paths.js +26 -5
- package/src/client/domain/structurizr-language.js +99 -0
- package/src/client/domain/vault-paths.js +48 -0
- package/src/client/excalidraw-editor.js +833 -51
- package/src/client/export/export-pipeline.js +6 -34
- package/src/client/infrastructure/auth-client.js +4 -10
- package/src/client/infrastructure/browser-notification-port.js +33 -20
- package/src/client/infrastructure/browser-preferences-port.js +46 -9
- package/src/client/infrastructure/comment-thread-store.js +34 -13
- package/src/client/infrastructure/editor-session.js +10 -0
- package/src/client/infrastructure/editor-view-adapter.js +133 -5
- package/src/client/infrastructure/excalidraw-room-client.js +103 -14
- package/src/client/infrastructure/git-api-client.js +5 -0
- package/src/client/infrastructure/lobby-presence.js +1 -0
- package/src/client/infrastructure/vault-api-client.js +51 -0
- package/src/client/infrastructure/workspace-sync-client.js +13 -1
- package/src/client/presentation/comment-overview-controller.js +18 -53
- package/src/client/presentation/comment-ui/comment-ui-card.js +1 -12
- package/src/client/presentation/comment-ui/comment-ui-layout.js +242 -219
- package/src/client/presentation/comment-ui/comment-ui-render.js +32 -45
- package/src/client/presentation/comment-ui/comment-ui-shared.js +68 -13
- package/src/client/presentation/comment-ui-controller.js +5 -1
- package/src/client/presentation/drawio-embed-controller.js +9 -102
- package/src/client/presentation/drawio-viewer.js +118 -0
- package/src/client/presentation/excalidraw-embed-controller.js +74 -8
- package/src/client/presentation/file-action-controller.js +134 -0
- package/src/client/presentation/file-explorer-controller.js +33 -3
- package/src/client/presentation/file-explorer-view.js +59 -34
- package/src/client/presentation/file-icon-svg.js +40 -0
- package/src/client/presentation/file-tree-state.js +12 -4
- package/src/client/presentation/git-diff-view-controller.js +731 -3
- package/src/client/presentation/outline-controller.js +86 -0
- package/src/client/presentation/quick-switcher-controller.js +257 -74
- package/src/client/presentation/quick-switcher-text-search.js +3 -3
- package/src/client/presentation/toast-controller.js +3 -0
- package/src/client/styles/components/feedback.css +6 -0
- package/src/client/styles/components/navigation.css +11 -1
- package/src/client/styles/features/collaboration-chat.css +49 -53
- package/src/client/styles/features/collaboration-presence.css +9 -7
- package/src/client/styles/features/comment-card.css +25 -11
- package/src/client/styles/features/comment-overlays.css +0 -4
- package/src/client/styles/features/comment-overview.css +44 -21
- package/src/client/styles/features/comments-drawer.css +2 -100
- package/src/client/styles/features/diagram-preview.css +81 -18
- package/src/client/styles/features/diff-special.css +309 -0
- package/src/client/styles/features/embedded-preview.css +8 -33
- package/src/client/styles/features/quick-switcher.css +8 -0
- package/src/client/styles/foundation/themes.css +6 -0
- package/src/client/styles/foundation/tokens.css +1 -0
- package/src/client/styles/layout/editor-page.css +40 -0
- package/src/client/styles/layout/responsive.css +31 -1
- package/src/client/styles/layout/shell.css +383 -7
- package/src/client/styles/layout/sidebar.css +47 -15
- package/src/client/styles/layout/view-modes.css +1 -0
- package/src/client/styles/overrides/codemirror.css +217 -15
- package/src/client/styles/style.css +1 -0
- package/src/client/styles/surfaces/excalidraw-editor.css +294 -0
- package/src/domain/comment-threads.js +63 -5
- package/src/domain/excalidraw-room-codec.js +6 -4
- package/src/domain/file-kind.js +35 -3
- package/src/server/application/workspace-reconciliation.js +1 -1
- package/src/server/config/env.js +79 -0
- package/src/server/create-app-server.js +14 -3
- package/src/server/domain/bases/base-definition.js +1 -1
- package/src/server/domain/bases/base-expression-runtime.js +1 -4
- package/src/server/domain/bases/base-index-snapshot-store.js +1 -4
- package/src/server/domain/bases/base-query-service.js +1 -77
- package/src/server/domain/bases/base-transform.js +1 -4
- package/src/server/domain/collaboration/collaboration-room.js +55 -21
- package/src/server/domain/comment-overview.js +25 -8
- package/src/server/domain/docx-exporter.js +24 -33
- package/src/server/domain/ripgrep-search-service.js +7 -1
- package/src/server/domain/workspace-state.js +32 -11
- package/src/server/infrastructure/git/diff-service.js +29 -13
- package/src/server/infrastructure/git/git-service.js +61 -10
- package/src/server/infrastructure/git/history-service.js +96 -29
- package/src/server/infrastructure/git/image-mime.js +14 -0
- package/src/server/infrastructure/git/path-utils.js +1 -1
- package/src/server/infrastructure/git/responses.js +0 -95
- package/src/server/infrastructure/git/untracked-files.js +28 -1
- package/src/server/infrastructure/github/github-app-client.js +22 -15
- package/src/server/infrastructure/http/create-git-api-query-handler.js +31 -1
- package/src/server/infrastructure/http/create-request-handler.js +18 -31
- package/src/server/infrastructure/http/create-static-handler.js +5 -2
- package/src/server/infrastructure/http/create-structurizr-api-handler.js +145 -0
- package/src/server/infrastructure/http/create-vault-api-command-handler.js +70 -8
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +51 -3
- package/src/server/infrastructure/http/http-errors.js +7 -1
- package/src/server/infrastructure/http/http-request-helpers.js +22 -0
- package/src/server/infrastructure/persistence/path-utils.js +1 -1
- package/src/server/infrastructure/persistence/vault-file-store.js +3 -0
- package/src/server/infrastructure/structurizr/structurizr-embed.css +43 -0
- package/src/server/infrastructure/structurizr/structurizr-workspace-service.js +374 -0
- package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +4 -22
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-CbSISC1w.js +0 -1
- package/dist/client/assets/bases-preview-controller-2pLHk0uk.js +0 -143
- package/dist/client/assets/browser-utils-CKtI_rZl.js +0 -1
- package/dist/client/assets/button-BCEiw4Rw.js +0 -1
- package/dist/client/assets/chunk-AXR3VHVW-0GTk_evH.js +0 -41
- package/dist/client/assets/comment-threads-D-iKphIp.js +0 -4
- package/dist/client/assets/diagram-action-icons-aa_KOv9h.js +0 -36
- package/dist/client/assets/dist-BH87JoHx.js +0 -11
- package/dist/client/assets/dist-BIkPRZO7.js +0 -6
- package/dist/client/assets/dist-BqCsFpx4.js +0 -1
- package/dist/client/assets/dist-C2JHCt8U.js +0 -1
- package/dist/client/assets/dist-CZjTtmTu.js +0 -1
- package/dist/client/assets/dist-Cig4Ov_X.js +0 -1
- package/dist/client/assets/dist-CqQEC8gR.js +0 -1
- package/dist/client/assets/dist-D4Rzqod1.js +0 -1
- package/dist/client/assets/dist-D5sn-mwk.js +0 -9
- package/dist/client/assets/dist-D7G-n87v.js +0 -1
- package/dist/client/assets/dist-DRqOrNgN.js +0 -1
- package/dist/client/assets/dist-DetkMS_4.js +0 -1
- package/dist/client/assets/dist-Dp6FVkQ1.js +0 -1
- package/dist/client/assets/dist-DtbjNB28.js +0 -1
- package/dist/client/assets/dist-DyrYcvpo2.js +0 -1
- package/dist/client/assets/dist-GrygD2zE.js +0 -1
- package/dist/client/assets/dist-HmEpWUow.js +0 -1
- package/dist/client/assets/dist-RTa81Km7.js +0 -1
- package/dist/client/assets/drawio-editor-DDvFoarP.js +0 -9
- package/dist/client/assets/drawio-embed-controller-BD1GTRwn.js +0 -1
- package/dist/client/assets/drawioEditor-Bu5grlH5.js +0 -2
- package/dist/client/assets/editor-session-DGlpiAsK.js +0 -16
- package/dist/client/assets/embedded-editor-base-C9roKYpW.css +0 -1
- package/dist/client/assets/excalidraw-editor-BHu6k8d4.js +0 -9
- package/dist/client/assets/excalidraw-editor-Cr_184EF.css +0 -1
- package/dist/client/assets/excalidraw-embed-controller-y2fenN_g.js +0 -1
- package/dist/client/assets/excalidraw-embed-reconciler-DGiagExg.js +0 -1
- package/dist/client/assets/excalidraw-scene-BvsQ6mLP.js +0 -176
- package/dist/client/assets/excalidrawEditor-4vFE--Uw.js +0 -2
- package/dist/client/assets/export-page-Cby8JzPO.js +0 -39
- package/dist/client/assets/exportDocument-C9v-bc7I.css +0 -1
- package/dist/client/assets/exportDocument-CRHCfsdo.js +0 -2
- package/dist/client/assets/file-history-view-controller-BDjEV9xJ.js +0 -112
- package/dist/client/assets/file-kind-BKPOIRPE.js +0 -1
- package/dist/client/assets/git-diff-view-controller-DgdM1aqb.js +0 -150
- package/dist/client/assets/git-panel-controller-BDTR2HVp.js +0 -207
- package/dist/client/assets/image-XGD7JQR6-XDUWHRpO.js +0 -1
- package/dist/client/assets/index-7xOyXDhP.css +0 -1
- package/dist/client/assets/index-Bz1KuQ6y.js +0 -2
- package/dist/client/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/dist/client/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/dist/client/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/dist/client/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/dist/client/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/dist/client/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/dist/client/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/client/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/client/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/client/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/client/assets/main-Ci07m9oP.js +0 -152
- package/dist/client/assets/preview-diagram-utils-n_bbJA9V.js +0 -1
- package/dist/client/assets/preview-render-compiler-csGM5ZFz.js +0 -1
- package/dist/client/assets/quick-switcher-controller-CoiYvllm.js +0 -12
- package/dist/client/assets/room-CDrmIdDt.js +0 -1
- package/dist/client/assets/runtime-config-CDgeuPWN.js +0 -1
- package/dist/client/assets/runtime-config-loader-BHGniHP5.js +0 -1
- package/dist/client/assets/runtime-paths-DvpihCEq.js +0 -1
- package/dist/client/assets/segmented-control-DJrHSz8M.js +0 -1
- package/dist/client/assets/vault-api-client-sLB2bo56.js +0 -1
- package/dist/client/assets/vault-paths-CVkuh0j-.js +0 -5
- package/src/client/bootstrap/lazy-controller-feature.js +0 -433
- package/src/client/infrastructure/backlinks-api-client.js +0 -16
- package/src/client/infrastructure/plantuml-api-client.js +0 -19
- package/src/client/infrastructure/runtime-config-loader.js +0 -56
- package/src/server/domain/collaboration/room-persistence-controller.js +0 -80
- package/src/server/infrastructure/git/command-runner.js +0 -49
- package/src/server/infrastructure/git/errors.js +0 -8
- package/src/server/infrastructure/http/create-esm-proxy-handler.js +0 -130
package/README.md
CHANGED
|
@@ -14,13 +14,13 @@ Realtime collaboration for Markdown folders, diagrams, and git-backed docs, with
|
|
|
14
14
|
|
|
15
15
|
CollabMD turns a local Markdown folder, Obsidian-style vault, or docs repo into a collaborative workspace you can open in the browser.
|
|
16
16
|
|
|
17
|
-
Throughout this guide, **vault** simply means a regular folder on your computer that contains Markdown files.
|
|
17
|
+
Throughout this guide, **vault** simply means a regular folder on your computer that contains Markdown, diagram, and attachment files.
|
|
18
18
|
|
|
19
19
|
- No migration: your files stay on disk
|
|
20
20
|
- Your filesystem stays the source of truth: CollabMD does not move, rename, or delete files unless you explicitly do that in the app
|
|
21
21
|
- Realtime editing with Yjs
|
|
22
22
|
- External filesystem edits sync back into the app and connected browsers
|
|
23
|
-
- Mermaid, PlantUML, Excalidraw, and draw.io support
|
|
23
|
+
- Mermaid, PlantUML, Structurizr DSL, Excalidraw, and draw.io support
|
|
24
24
|
- Source-anchored comments, chat, and presence
|
|
25
25
|
- Works with plain folders, Obsidian-style vaults, and git-backed docs
|
|
26
26
|
|
|
@@ -65,11 +65,12 @@ Prefer video? [Open the WebM demo](https://raw.githubusercontent.com/andes90/col
|
|
|
65
65
|
- **Local-files-first** — your filesystem remains the source of truth
|
|
66
66
|
- **Realtime collaboration** — multiple people can edit the same file at the same time via Yjs
|
|
67
67
|
- **External edit sync** — changes made from tools like Obsidian or direct file writes are reflected back into open documents and the file explorer
|
|
68
|
+
- **File upload** — import multiple supported Markdown, Base, diagram, image, and PDF files into the vault from the file explorer
|
|
68
69
|
- **Markdown with context** — live preview, wiki-links, backlinks, outline, quick switcher, and scroll sync
|
|
69
70
|
- **Global text search** — search text across supported vault files with ripgrep-backed results grouped by file
|
|
70
|
-
- **Source-anchored comments** — comment on lines or selected text with inline markers
|
|
71
|
+
- **Source-anchored comments** — comment on lines or selected text with inline markers and preview bubbles, or pin threads to Excalidraw elements
|
|
71
72
|
- **Collaboration built in** — collaborator presence, follow mode, and team chat
|
|
72
|
-
- **Diagram-friendly** — Mermaid fences and standalone `.mmd` / `.mermaid`, PlantUML `.puml` / `.plantuml`, `.excalidraw`, `.drawio`, and public video embeds in Markdown
|
|
73
|
+
- **Diagram-friendly** — Mermaid fences and standalone `.mmd` / `.mermaid`, PlantUML `.puml` / `.plantuml`, Structurizr `.dsl` C4 workspaces, `.excalidraw`, `.drawio`, readonly PDF previews, and public video embeds in Markdown
|
|
73
74
|
- **Easy browser access** — optional Cloudflare Tunnel support makes a running session easy to share
|
|
74
75
|
|
|
75
76
|
## Best fit for
|
|
@@ -168,7 +169,7 @@ Then share the printed URL and password with your collaborator. If `cloudflared`
|
|
|
168
169
|
- Single-instance deployment only: collaboration room state is kept in-process and is not shared across replicas
|
|
169
170
|
- `oidc` currently supports Google only
|
|
170
171
|
- Hosted workspace mode currently provides the backend/API surface; Team Settings UI, invitation email delivery, GitHub callback redirect polish, and GitHub App checkout/publish wiring are still pending
|
|
171
|
-
-
|
|
172
|
+
- Text-anchored comments support markdown, Mermaid, PlantUML, and Structurizr DSL files. Excalidraw supports element-anchored threads; draw.io comments are not supported
|
|
172
173
|
- Windows use is supported via WSL2 rather than native Windows execution
|
|
173
174
|
|
|
174
175
|
## How it works
|
|
@@ -179,16 +180,16 @@ collabmd ~/my-vault --no-tunnel
|
|
|
179
180
|
|
|
180
181
|
CollabMD starts a local server, scans the vault, and opens a browser-based editor with:
|
|
181
182
|
|
|
182
|
-
- **File explorer sidebar** — browse, create, rename, and delete `.md`, `.mmd`, `.mermaid`, `.puml`, `.plantuml`, `.excalidraw`,
|
|
183
|
-
- **Live preview** — rendered as you type, with syntax-highlighted code blocks, public video embeds, plus Mermaid and
|
|
184
|
-
- **Anchored comments** — add comments from the editor
|
|
183
|
+
- **File explorer sidebar** — upload, browse, create, rename, and delete `.md`, `.markdown`, `.mdx`, `.base`, `.mmd`, `.mermaid`, `.puml`, `.plantuml`, `.dsl`, `.excalidraw`, `.drawio`, `.pdf`, and supported image files plus folders
|
|
184
|
+
- **Live preview** — rendered as you type, with syntax-highlighted code blocks, public video embeds, plus Mermaid, PlantUML, and Structurizr diagrams
|
|
185
|
+
- **Anchored comments** — add comments from the editor or selected Excalidraw elements, reopen threads in context, and review them from the comments drawer
|
|
185
186
|
- **`[[wiki-links]]` + backlinks** — jump between notes and inspect linked mentions
|
|
186
187
|
- **Room chat** — discuss changes without leaving the workspace
|
|
187
188
|
- **Presence + follow mode** — see who is online and follow another collaborator's active cursor
|
|
188
189
|
- **Quick switcher, global text search, and outline** — move around large vaults and long documents faster
|
|
189
|
-
- **Standalone diagram files** — open `.mmd` / `.mermaid
|
|
190
|
+
- **Standalone diagram files** — open `.mmd` / `.mermaid`, `.puml` / `.plantuml`, or `.dsl` files in side-by-side editor + preview; Structurizr workspaces provide context → container → component navigation; `.excalidraw` files use direct preview mode, `.drawio` files use an embedded diagrams.net editor/viewer, and `.pdf` files use a readonly browser preview
|
|
190
191
|
|
|
191
|
-
|
|
192
|
+
Text comment threads are source-anchored for markdown, Mermaid, PlantUML, and Structurizr DSL files. You can comment on a whole line or a text selection, then reopen the thread from either the editor marker or preview bubble. Excalidraw threads attach to selected canvas elements and also appear in the workspace overview. Draw.io comments are not supported.
|
|
192
193
|
|
|
193
194
|
Draw.io files use the diagrams.net embed/runtime. Opening a `.drawio` file directly mounts an interactive editor in the preview pane. Markdown embeds such as `![[architecture.drawio]]` use the diagrams.net viewer for a lighter inline preview and include an `Open` action to jump into the full file view.
|
|
194
195
|
|
|
@@ -196,7 +197,7 @@ Draw.io collaboration is intentionally conservative in this release: one connect
|
|
|
196
197
|
|
|
197
198
|
Markdown video embeds are opt-in and use standard image syntax such as `` or ``. The preview currently supports public YouTube URLs plus direct public `https` video files ending in `.mp4`, `.webm`, or `.ogg`. The editor toolbar also includes a `Video` action that inserts the same Markdown syntax for you.
|
|
198
199
|
|
|
199
|
-
Your filesystem is the source of truth. CollabMD reads files from disk, uses Yjs for realtime collaboration, and continuously writes plain text back to disk as you type. External changes from tools like Obsidian, direct file writes, or git-driven file updates are watched and reconciled back into live rooms and the explorer.
|
|
200
|
+
Your filesystem is the source of truth. CollabMD reads files from disk, uses Yjs for realtime collaboration, and continuously writes plain text back to disk as you type. External changes from tools like Obsidian, direct file writes, or git-driven file updates are watched and reconciled back into live rooms and the explorer. The file explorer can import multiple supported vault files at once; uploads preserve their names and bytes, reject duplicates, and include PDF files for readonly preview.
|
|
200
201
|
|
|
201
202
|
## Usage
|
|
202
203
|
|
|
@@ -219,6 +220,7 @@ collabmd [directory] [options]
|
|
|
219
220
|
| `--auth` | Auth strategy: `none`, `password`, `oidc` | `none` |
|
|
220
221
|
| `--auth-password` | Password for `--auth password` | generated per run |
|
|
221
222
|
| `--local-plantuml` | Start the bundled local docker-compose PlantUML service | off |
|
|
223
|
+
| `--local-structurizr` | Start the bundled local Structurizr renderer | off |
|
|
222
224
|
| `--no-tunnel` | Don't start Cloudflare Tunnel | tunnel on |
|
|
223
225
|
| `-v, --version` | Show version | |
|
|
224
226
|
| `-h, --help` | Show help | |
|
|
@@ -250,6 +252,9 @@ collabmd --auth oidc --no-tunnel
|
|
|
250
252
|
# Use the local docker-compose PlantUML service
|
|
251
253
|
collabmd --local-plantuml
|
|
252
254
|
|
|
255
|
+
# Use the local Structurizr renderer for .dsl workspaces
|
|
256
|
+
collabmd --local-structurizr
|
|
257
|
+
|
|
253
258
|
# Serve an Obsidian vault
|
|
254
259
|
collabmd ~/Documents/Obsidian/MyVault
|
|
255
260
|
```
|
|
@@ -396,11 +401,13 @@ For the full runtime env var reference, see the `Environment variables` details
|
|
|
396
401
|
|
|
397
402
|
Published image: `ghcr.io/andes90/collabmd:latest`
|
|
398
403
|
|
|
404
|
+
From the vault directory:
|
|
405
|
+
|
|
399
406
|
```bash
|
|
400
|
-
docker run -p 1234:1234 -v
|
|
407
|
+
docker run --rm -p 1234:1234 -v "$PWD:/data" ghcr.io/andes90/collabmd:latest
|
|
401
408
|
```
|
|
402
409
|
|
|
403
|
-
The published Docker image includes `ripgrep`, so global text search works without installing extra packages in the container.
|
|
410
|
+
Open `http://localhost:1234`. The published Docker image includes `ripgrep`, so global text search works without installing extra packages in the container.
|
|
404
411
|
|
|
405
412
|
The container listens on `0.0.0.0:1234` and stores vault files at `/data`.
|
|
406
413
|
|
|
@@ -459,9 +466,9 @@ docker run \
|
|
|
459
466
|
ghcr.io/andes90/collabmd:latest
|
|
460
467
|
```
|
|
461
468
|
|
|
462
|
-
### Local docker-compose with
|
|
469
|
+
### Local docker-compose with private diagram renderers
|
|
463
470
|
|
|
464
|
-
The included `docker-compose.yml` runs a prebuilt CollabMD image together with
|
|
471
|
+
The included `docker-compose.yml` runs a prebuilt CollabMD image together with local PlantUML and Structurizr containers. PlantUML SVG rendering and Structurizr `workspace.dsl` previews stay on the private Docker network automatically.
|
|
465
472
|
|
|
466
473
|
```bash
|
|
467
474
|
mkdir -p data/vault
|
|
@@ -495,10 +502,13 @@ docker build -t collabmd:local .
|
|
|
495
502
|
COLLABMD_IMAGE=collabmd:local docker compose up
|
|
496
503
|
```
|
|
497
504
|
|
|
498
|
-
The PlantUML container is
|
|
505
|
+
The PlantUML container is published on loopback by default at `http://127.0.0.1:18080`, and Structurizr is published at `http://127.0.0.1:19090` for host-based CLI use:
|
|
499
506
|
|
|
500
507
|
```bash
|
|
501
508
|
npm run start:local-plantuml
|
|
509
|
+
|
|
510
|
+
# Start CollabMD with Structurizr DSL support
|
|
511
|
+
npm run start:local-structurizr -- --no-tunnel
|
|
502
512
|
```
|
|
503
513
|
|
|
504
514
|
To use an existing vault on your machine instead of `./data/vault`:
|
|
@@ -579,6 +589,7 @@ npm run dev:client # Start the Vite dev server with API/WebSocket pro
|
|
|
579
589
|
npm run dev:server # Start only the backend server for local frontend development
|
|
580
590
|
npm run start # Build + start server
|
|
581
591
|
npm run start:local-plantuml # Build + start server with local docker-compose PlantUML
|
|
592
|
+
npm run start:local-structurizr # Build + start server with local Structurizr
|
|
582
593
|
npm run start:prod # Start server (expects previous build)
|
|
583
594
|
npm run test # Run unit + e2e tests
|
|
584
595
|
npm run test:unit # Fast Node-based unit tests
|
|
@@ -586,6 +597,8 @@ npm run test:e2e # Playwright browser tests
|
|
|
586
597
|
npm run tunnel # Start only the Cloudflare tunnel
|
|
587
598
|
npm run plantuml:up # Start only the local docker-compose PlantUML service
|
|
588
599
|
npm run plantuml:down # Stop only the local docker-compose PlantUML service
|
|
600
|
+
npm run structurizr:up # Start only the local Structurizr renderer
|
|
601
|
+
npm run structurizr:down # Stop only the local Structurizr renderer
|
|
589
602
|
npm run capture:readme-assets # Regenerate the README screenshot and demo assets
|
|
590
603
|
```
|
|
591
604
|
|
|
@@ -678,8 +691,14 @@ vite.config.mjs Vite multi-page build and dev-server proxy config
|
|
|
678
691
|
| `COLLABMD_GITHUB_HTML_BASE_URL` | GitHub web base URL for installation setup | `https://github.com` |
|
|
679
692
|
| `COLLABMD_GITHUB_SETUP_FLOW_COOKIE_NAME` | Signed cookie name for the GitHub App setup callback flow | `collabmd_github_setup_flow` |
|
|
680
693
|
| `PLANTUML_SERVER_URL` | Upstream PlantUML server base URL used for server-side SVG rendering | `https://www.plantuml.com/plantuml` |
|
|
694
|
+
| `STRUCTURIZR_SERVER_URL` | Structurizr Local-compatible sidecar base URL used for `.dsl` previews | disabled |
|
|
695
|
+
| `COLLABMD_STRUCTURIZR_MIRROR_DIR` | Writable disposable mirror directory passed to Structurizr | `<vault>/.collabmd/structurizr` |
|
|
696
|
+
| `COLLABMD_STRUCTURIZR_TRUSTED_EXECUTABLE_DSL` | Allow Structurizr `!script` and `!plugin` directives; keep false for untrusted vaults | `false` |
|
|
681
697
|
| `COLLABMD_DRAWIO_BASE_URL` | diagrams.net base URL used for `.drawio` viewing and editing | `https://embed.diagrams.net` |
|
|
682
698
|
| `COLLABMD_WIKI_LINK_AUTO_CREATE` | Create missing markdown files when clicking unresolved wiki-links; set to `false` to disable | `true` |
|
|
699
|
+
| `COLLABMD_SEARCH_MAX_FILE_SIZE` | Maximum size of each file considered by global text search; supports bytes or `K`, `M`, and `G` suffixes | `1M` |
|
|
700
|
+
| `COLLABMD_SEARCH_MAX_BUFFER_BYTES` | Maximum ripgrep output buffer for one global text search | `2097152` |
|
|
701
|
+
| `COLLABMD_MAX_PDF_UPLOAD_BYTES` | Maximum size of a PDF upload in bytes; other uploads remain limited to the default 8 MiB request-body limit | `52428800` |
|
|
683
702
|
| `COLLABMD_VAULT_DIR` | Vault directory path | CLI: current directory, server entrypoint: `data/vault`, Docker: `/data` |
|
|
684
703
|
| `COLLABMD_GIT_ENABLED` | Enable or disable git integration in the UI and API | `true` |
|
|
685
704
|
| `COLLABMD_GIT_REPO_URL` | Remote git repository used to bootstrap the vault checkout | |
|
|
@@ -718,10 +737,11 @@ cp .env.example .env
|
|
|
718
737
|
- If `COLLABMD_GIT_SSH_KNOWN_HOSTS_FILE` is not set, SSH falls back to `StrictHostKeyChecking=accept-new`.
|
|
719
738
|
- External filesystem edits are reconciled back into active rooms and the explorer. Ambiguous watcher bursts still fall back to batched workspace reconciliation.
|
|
720
739
|
- `.obsidian`, `.git`, `.trash`, and `node_modules` directories are ignored.
|
|
721
|
-
-
|
|
740
|
+
- Markdown, Base, Mermaid, PlantUML, Structurizr DSL, draw.io, Excalidraw, PDF, and image files are tracked by the vault tree; global text search indexes supported text formats.
|
|
722
741
|
- PlantUML preview rendering is server-side and uses `PLANTUML_SERVER_URL`; point it at a self-hosted renderer if you do not want to use the public PlantUML service.
|
|
723
|
-
-
|
|
724
|
-
- `
|
|
742
|
+
- Structurizr previews use a read-only official Local sidecar and a disposable `.collabmd/structurizr` mirror; the authoritative vault is never mounted into the renderer as its data directory.
|
|
743
|
+
- `docker compose up` uses the included local PlantUML and Structurizr services and avoids public diagram renderers by default. The initial git clone may also require a longer health-check grace period than a purely local vault.
|
|
744
|
+
- `collabmd --local-plantuml` and `npm run start:local-plantuml` start the local PlantUML compose service. `collabmd --local-structurizr` starts Structurizr Local against `http://127.0.0.1:${STRUCTURIZR_HOST_PORT:-19090}`.
|
|
725
745
|
|
|
726
746
|
## License
|
|
727
747
|
|
package/bin/collabmd.js
CHANGED
|
@@ -16,6 +16,7 @@ const { values, positionals } = parseArgs({
|
|
|
16
16
|
'auth-password': { type: 'string' },
|
|
17
17
|
help: { type: 'boolean', short: 'h', default: false },
|
|
18
18
|
'local-plantuml': { type: 'boolean', default: false },
|
|
19
|
+
'local-structurizr': { type: 'boolean', default: false },
|
|
19
20
|
port: { type: 'string', short: 'p', default: '1234' },
|
|
20
21
|
host: { type: 'string' },
|
|
21
22
|
'no-tunnel': { type: 'boolean', default: false },
|
|
@@ -45,6 +46,7 @@ if (values.help) {
|
|
|
45
46
|
--auth <strategy> Auth strategy: none, password, oidc (default: none)
|
|
46
47
|
--auth-password <pw> Password for --auth password (default: generated per run)
|
|
47
48
|
--local-plantuml Start the bundled docker-compose PlantUML service and use it
|
|
49
|
+
--local-structurizr Start the bundled Structurizr Local service and use it
|
|
48
50
|
--no-tunnel Don't start Cloudflare Tunnel
|
|
49
51
|
-v, --version Show version
|
|
50
52
|
-h, --help Show this help
|
|
@@ -55,6 +57,7 @@ if (values.help) {
|
|
|
55
57
|
collabmd --port 3000 Use a custom port
|
|
56
58
|
collabmd --auth password Require a generated password to join
|
|
57
59
|
collabmd --local-plantuml Use the local docker-compose PlantUML server
|
|
60
|
+
collabmd --local-structurizr Use the local docker-compose Structurizr renderer
|
|
58
61
|
collabmd --no-tunnel Local only, no tunnel
|
|
59
62
|
`);
|
|
60
63
|
process.exit(0);
|
|
@@ -64,6 +67,7 @@ const port = parseInt(values.port ?? process.env.PORT ?? '1234', 10) || 1234;
|
|
|
64
67
|
const host = values.host || process.env.HOST || '127.0.0.1';
|
|
65
68
|
const enableTunnel = !values['no-tunnel'];
|
|
66
69
|
const useLocalPlantUml = values['local-plantuml'];
|
|
70
|
+
const useLocalStructurizr = values['local-structurizr'];
|
|
67
71
|
|
|
68
72
|
const { resolveCliVaultDir, loadConfig } = await import('../src/server/config/env.js');
|
|
69
73
|
const vaultPath = resolveCliVaultDir(positionals);
|
|
@@ -101,6 +105,27 @@ if (useLocalPlantUml) {
|
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
|
|
108
|
+
if (useLocalStructurizr) {
|
|
109
|
+
const {
|
|
110
|
+
getLocalStructurizrServerUrl,
|
|
111
|
+
startLocalStructurizrComposeService,
|
|
112
|
+
} = await import('../scripts/local-structurizr-compose.mjs');
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
const localStructurizrUrl = getLocalStructurizrServerUrl();
|
|
116
|
+
console.log(` Structurizr: starting local docker-compose service at ${localStructurizrUrl}...`);
|
|
117
|
+
await startLocalStructurizrComposeService({ vaultDir: vaultPath });
|
|
118
|
+
process.env.STRUCTURIZR_SERVER_URL = localStructurizrUrl;
|
|
119
|
+
} catch (error) {
|
|
120
|
+
if (error.code === 'ENOENT') {
|
|
121
|
+
console.error('Error: Docker is not available. Install Docker Desktop or Docker Engine first.');
|
|
122
|
+
} else {
|
|
123
|
+
console.error(`Error: Failed to start local Structurizr service: ${error.message}`);
|
|
124
|
+
}
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
104
129
|
const { createAppServer } = await import('../src/server/create-app-server.js');
|
|
105
130
|
const { prepareConfigForStartup } = await import('../src/server/startup/git-remote-bootstrap.js');
|
|
106
131
|
|
|
@@ -185,9 +210,10 @@ try {
|
|
|
185
210
|
console.log(` ║${bannerLine}║`);
|
|
186
211
|
console.log(' ╚══════════════════════════════════════╝');
|
|
187
212
|
console.log('');
|
|
188
|
-
console.log(` Vault: ${vaultPath} (${fileCount}
|
|
213
|
+
console.log(` Vault: ${vaultPath} (${fileCount} files)`);
|
|
189
214
|
console.log(` Local: http://${info.host}:${info.port}`);
|
|
190
215
|
console.log(` PlantUML: ${config.plantumlServerUrl}`);
|
|
216
|
+
console.log(` Structurizr: ${config.structurizr?.enabled ? config.structurizr.serverUrl : 'disabled'}`);
|
|
191
217
|
if (config.auth.strategy === 'password') {
|
|
192
218
|
console.log(` Auth: password`);
|
|
193
219
|
console.log(` Secret: ${config.auth.password}`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{B as t,L as n,N as r,Q as i,R as a,W as o,Z as s,c,dt as l,et as u,pt as d,t as f}from"./dist-CCP_AKPG.js";import"./chunk-SRAX5OIU-KFQikY-4.js";import{n as p,t as m}from"./jsx-runtime-BpzPEenQ.js";import{a as h,o as g,p as _,s as v}from"./dist-xElaxbia.js";var y=e(p(),1),b=m(),x=c.define({token(e){return e.match(/^%%.*$/)?`comment`:e.match(/^"(?:[^"\\]|\\.)*"/)?`string`:e.match(/^(flowchart|graph|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt|pie|mindmap|journey|gitGraph|timeline|quadrantChart|sankey|xychart)\b/i)||e.match(/^(TB|TD|BT|RL|LR)\b/)||e.match(/^(subgraph|end|participant|actor|loop|alt|else|opt|par|critical|break|rect|note|over|activate|deactivate|title|section|class|style|linkStyle|classDef|click)\b/i)?`keyword`:e.match(/^[-.=<>|ox]+>/)||e.match(/^<[-.=<>|ox]+/)||e.match(/^--+|\.\.+|==+/)?`operator`:e.match(/^[[\](){}|<>]/)?`bracket`:e.match(/^[A-Za-z_][A-Za-z0-9_]*/)?`variableName`:e.match(/^\d+(\.\d+)?/)?`number`:e.match(/^[,:;]/)?`punctuation`:(e.eatSpace()||e.next(),null)}});function S(){return x}var C=t.theme({"&":{backgroundColor:`#1e1e1e`,color:`#d4d4d4`},".cm-content":{caretColor:`#fff`},".cm-cursor":{borderLeftColor:`#fff`},".cm-gutters":{backgroundColor:`#1e1e1e`,color:`#858585`,border:`none`},".cm-activeLineGutter":{backgroundColor:`#2a2a2a`},".cm-activeLine":{backgroundColor:`#2a2a2a`},".cm-errorLine":{backgroundColor:`rgba(255, 0, 0, 0.15)`}},{dark:!0}),w=f.define([{tag:n.keyword,color:`#569cd6`},{tag:n.string,color:`#ce9178`},{tag:n.comment,color:`#6a9955`},{tag:n.number,color:`#b5cea8`},{tag:n.operator,color:`#d4d4d4`},{tag:n.punctuation,color:`#d4d4d4`},{tag:n.variableName,color:`#9cdcfe`},{tag:n.bracket,color:`#ffd700`}]),T=t.theme({"&":{backgroundColor:`#ffffff`,color:`#1e1e1e`},".cm-content":{caretColor:`#000`},".cm-cursor":{borderLeftColor:`#000`},".cm-gutters":{backgroundColor:`#fff`,color:`#999`,border:`none`},".cm-activeLineGutter":{backgroundColor:`#e8e8e8`},".cm-activeLine":{backgroundColor:`#e8e8e8`},".cm-errorLine":{backgroundColor:`rgba(255, 0, 0, 0.1)`}}),E=f.define([{tag:n.keyword,color:`#0000ff`},{tag:n.string,color:`#a31515`},{tag:n.comment,color:`#008000`},{tag:n.number,color:`#098658`},{tag:n.operator,color:`#1e1e1e`},{tag:n.punctuation,color:`#1e1e1e`},{tag:n.variableName,color:`#001080`},{tag:n.bracket,color:`#af00db`}]),D=a.line({class:`cm-errorLine`}),O=(e,n)=>{if(!e||e<1||e>n.lines)return t.decorations.of(a.none);let r=n.line(e);return t.decorations.of(a.set([D.range(r.from)]))},k=e=>e===`dark`?[C,r(w)]:[T,r(E)],A=({value:e,onChange:n,onKeyboardSubmit:r,placeholder:a,theme:c,errorLine:f})=>{let p=(0,y.useRef)(null),m=(0,y.useRef)(null),x=(0,y.useRef)(n),C=(0,y.useRef)(r),w=(0,y.useRef)(new l),T=(0,y.useRef)(new l);return x.current=n,C.current=r,(0,y.useEffect)(()=>{if(!p.current)return;let n=w.current,r=new t({state:d.create({doc:e,extensions:[s.of([{key:`Mod-Enter`,run:()=>(C.current?.(),!0)},{key:`Mod-Shift-z`,run:_,preventDefault:!0}]),t.updateListener.of(e=>{e.docChanged&&x.current(e.state.doc.toString())}),g(),s.of([...h,...v]),i(),t.lineWrapping,n.of(k(c)),T.current.of([]),S(),o({drawRangeCursor:!0}),...a?[u(a)]:[]]}),parent:p.current});return m.current=r,r.focus(),()=>{r.destroy(),m.current=null}},[]),(0,y.useEffect)(()=>{let e=m.current;e&&e.dispatch({effects:w.current.reconfigure(k(c))})},[c]),(0,y.useEffect)(()=>{let e=m.current;e&&e.dispatch({effects:T.current.reconfigure(O(f,e.state.doc))})},[f]),(0,y.useEffect)(()=>{let t=m.current;if(!t)return;let n=t.state.doc.toString();e!==n&&t.dispatch({changes:{from:0,to:n.length,insert:e}})},[e]),(0,b.jsx)(`div`,{ref:p,className:`ttd-dialog-input ttd-dialog-input--codemirror`})};export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return typeof window>`u`?globalThis:window}function t({accept:t=``,multiple:n=!1}={}){return new Promise(r=>{let i=document.createElement(`input`),a=e();i.type=`file`,i.accept=t,i.multiple=n,i.style.position=`fixed`,i.style.left=`-9999px`,document.body.appendChild(i);let o=!1,s=null,c=(e=[])=>{o||(o=!0,s&&a.clearTimeout(s),a.removeEventListener(`focus`,l),i.remove(),r(Array.from(e??[])))},l=()=>{s=a.setTimeout(()=>{o||i.files?.length||c()},250)};i.addEventListener(`change`,()=>c(i.files),{once:!0}),i.addEventListener(`cancel`,()=>c(),{once:!0}),a.addEventListener(`focus`,l,{once:!0}),i.click()})}function n(t,n){let r=e();return typeof r.requestIdleCallback==`function`?r.requestIdleCallback(t,{timeout:n}):r.setTimeout(()=>t({didTimeout:!1,timeRemaining:()=>0}),1)}function r(t){if(t===null)return;let n=e();if(typeof n.cancelIdleCallback==`function`){n.cancelIdleCallback(t);return}n.clearTimeout(t)}function i(e,t,n){if(!e||!t)return!1;let r=t.getBoundingClientRect(),i=e.getBoundingClientRect();return i.bottom>=r.top-n&&i.top<=r.bottom+n}function a(t,n,{removeDelayMs:r=3e4,revokeDelayMs:i=r}={}){let a=e(),o=URL.createObjectURL(t),s=document.createElement(`a`);s.href=o,s.download=n,s.style&&(s.style.display=`none`),document.body.appendChild(s),s.click(),r>0?a.setTimeout(()=>s.remove(),r):s.remove(),a.setTimeout(()=>URL.revokeObjectURL(o),i)}function o(e=``,t=`download`){let n=String(e).match(/filename\*=UTF-8''([^;]+)/iu);if(n)try{return decodeURIComponent(n[1])}catch{return t}return String(e).match(/filename="([^"]+)"/iu)?.[1]||t}export{t as a,o as i,a as n,n as o,i as r,r as t};
|