collabmd 0.1.44 → 0.1.45
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/dist/client/assets/{chunk-AXR3VHVW-0GTk_evH.js → chunk-ERSWUTIN-ME9RVNel.js} +3 -3
- package/dist/client/assets/{chunk-CZQZEIFA-DT3N9fo7.js → chunk-YGJVY4SA-CjSe7Bx7.js} +2 -2
- package/dist/client/assets/{comment-threads-D-iKphIp.js → comment-threads-DDegmaFO.js} +1 -1
- package/dist/client/assets/drawio-editor-ClE8jpoG.js +9 -0
- package/dist/client/assets/drawioEditor-CXaTM9Ds.js +2 -0
- package/dist/client/assets/editor-session-GTwZS6Df.js +16 -0
- package/dist/client/assets/embedded-editor-base-CiNEc8vy.css +1 -0
- package/dist/client/assets/{en-GADW4C6J-DQ6zyCEM.js → en-7NFCYGKX-BrgYZAEe.js} +1 -1
- package/dist/client/assets/{excalidraw-editor-BHu6k8d4.js → excalidraw-editor-BZVM81BO.js} +2 -2
- package/dist/client/assets/excalidraw-editor-CyGwOhLz.css +1 -0
- package/dist/client/assets/excalidraw-scene-C8n9CHsK.js +176 -0
- package/dist/client/assets/excalidrawEditor-DxJanCze.js +2 -0
- package/dist/client/assets/export-page-CUfws2T-.js +39 -0
- package/dist/client/assets/exportDocument-BCuxqXDY.js +2 -0
- package/dist/client/assets/exportDocument-DV-OX74E.css +1 -0
- package/dist/client/assets/image-QXRYHUNP-lfTHE3bb.js +1 -0
- package/dist/client/assets/index-C3YnUgMD.css +1 -0
- package/dist/client/assets/index-D2wXraJ1.js +2 -0
- package/dist/client/assets/main-DtiGz7uI.js +795 -0
- package/dist/client/assets/modulepreload-polyfill-P2Xu9kJm.js +1 -0
- package/dist/client/assets/preview-diagram-utils-txBCoW8d.js +1 -0
- package/dist/client/assets/quick-switcher-controller-shW_6vPY.js +12 -0
- package/dist/client/assets/room-CQLoqtMo.js +1 -0
- package/dist/client/assets/runtime-config-DSGmGE9V.js +1 -0
- package/dist/client/assets/vault-api-client-C6bcGwy-.js +5 -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 +97 -27
- package/package.json +10 -12
- 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 +94 -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 +1 -1
- package/src/client/application/app-shell/git-feature.js +4 -9
- package/src/client/application/app-shell/presence-feature.js +16 -10
- package/src/client/application/app-shell/ui-feature-shell.js +33 -15
- 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/workspace-feature.js +22 -83
- package/src/client/application/app-shell-elements.js +7 -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/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/workspace-preview-controller.js +0 -3
- package/src/client/bootstrap/collabmd-app-shell.js +125 -39
- package/src/client/domain/excalidraw-collaboration.js +0 -2
- package/src/client/domain/room.js +38 -0
- 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 +36 -9
- package/src/client/infrastructure/editor-view-adapter.js +87 -3
- package/src/client/infrastructure/lobby-presence.js +1 -0
- package/src/client/infrastructure/vault-api-client.js +25 -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 +65 -14
- package/src/client/presentation/comment-ui-controller.js +5 -1
- package/src/client/presentation/file-action-controller.js +32 -0
- package/src/client/presentation/file-explorer-controller.js +33 -3
- package/src/client/presentation/file-explorer-view.js +49 -5
- package/src/client/presentation/file-tree-state.js +10 -4
- package/src/client/presentation/quick-switcher-controller.js +243 -72
- package/src/client/presentation/quick-switcher-text-search.js +2 -2
- package/src/client/presentation/toast-controller.js +3 -0
- package/src/client/styles/components/feedback.css +6 -0
- 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 +5 -18
- 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/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 +25 -6
- package/src/client/styles/layout/sidebar.css +47 -15
- package/src/client/styles/overrides/codemirror.css +217 -15
- package/src/server/application/workspace-reconciliation.js +1 -1
- package/src/server/create-app-server.js +2 -3
- package/src/server/domain/bases/base-query-service.js +1 -77
- package/src/server/domain/comment-overview.js +10 -3
- package/src/server/domain/docx-exporter.js +24 -33
- package/src/server/domain/ripgrep-search-service.js +3 -1
- package/src/server/domain/workspace-state.js +32 -11
- package/src/server/infrastructure/git/diff-service.js +24 -13
- package/src/server/infrastructure/git/git-service.js +40 -10
- package/src/server/infrastructure/git/history-service.js +42 -29
- package/src/server/infrastructure/git/path-utils.js +1 -1
- package/src/server/infrastructure/git/responses.js +0 -95
- package/src/server/infrastructure/github/github-app-client.js +22 -15
- package/src/server/infrastructure/http/create-request-handler.js +2 -8
- package/src/server/infrastructure/http/create-vault-api-command-handler.js +5 -5
- package/src/server/infrastructure/http/http-errors.js +7 -1
- package/dist/client/assets/bases-preview-controller-2pLHk0uk.js +0 -143
- package/dist/client/assets/button-BCEiw4Rw.js +0 -1
- package/dist/client/assets/diagram-action-icons-aa_KOv9h.js +0 -36
- 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-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/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/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/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
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { execFile as execFileCallback } from 'node:child_process';
|
|
2
|
-
import { access } from 'node:fs/promises';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { promisify } from 'node:util';
|
|
5
|
-
|
|
6
|
-
const execFile = promisify(execFileCallback);
|
|
7
|
-
|
|
8
|
-
export class GitCommandRunner {
|
|
9
|
-
constructor({
|
|
10
|
-
commandEnv = null,
|
|
11
|
-
enabled = true,
|
|
12
|
-
execFileImpl = execFile,
|
|
13
|
-
vaultDir,
|
|
14
|
-
}) {
|
|
15
|
-
this.commandEnv = commandEnv;
|
|
16
|
-
this.enabled = enabled;
|
|
17
|
-
this.execFileImpl = execFileImpl;
|
|
18
|
-
this.vaultDir = vaultDir;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async isGitRepo() {
|
|
22
|
-
if (!this.enabled) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
try {
|
|
27
|
-
await access(join(this.vaultDir, '.git'));
|
|
28
|
-
return true;
|
|
29
|
-
} catch {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async execGit(args, { env = null } = {}) {
|
|
35
|
-
const result = await this.execFileImpl('git', ['-c', 'core.quotepath=false', ...args], {
|
|
36
|
-
cwd: this.vaultDir,
|
|
37
|
-
encoding: 'utf8',
|
|
38
|
-
env: {
|
|
39
|
-
...process.env,
|
|
40
|
-
...(this.commandEnv ?? {}),
|
|
41
|
-
...(env ?? {}),
|
|
42
|
-
},
|
|
43
|
-
maxBuffer: 5 * 1024 * 1024,
|
|
44
|
-
timeout: 10_000,
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
return String(result.stdout ?? '');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { createRequestError } from './http-errors.js';
|
|
2
|
-
import { sendResponse, textResponse } from './http-response.js';
|
|
3
|
-
|
|
4
|
-
const ESM_PROXY_PREFIX = '/_esm/';
|
|
5
|
-
const ESM_UPSTREAM_ORIGIN = 'https://esm.sh';
|
|
6
|
-
const ESM_TEXT_CONTENT_TYPE_PATTERN = /\b(?:javascript|ecmascript|css|json|text\/plain|text\/css)\b/i;
|
|
7
|
-
|
|
8
|
-
function rewriteEsmText(body) {
|
|
9
|
-
return body
|
|
10
|
-
.replace(/((?:from|import)\s*(?:\(\s*)?["'])\/(?!_esm\/)/g, '$1/_esm/')
|
|
11
|
-
.replace(/((?:import|url)\(\s*["']?)\/(?!_esm\/)/g, '$1/_esm/')
|
|
12
|
-
.replace(/(@import\s+["'])\/(?!_esm\/)/g, '$1/_esm/');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function looksLikeHtmlDocument(body) {
|
|
16
|
-
const trimmed = body.trimStart();
|
|
17
|
-
return trimmed.startsWith('<!DOCTYPE html')
|
|
18
|
-
|| trimmed.startsWith('<!doctype html')
|
|
19
|
-
|| trimmed.startsWith('<html')
|
|
20
|
-
|| trimmed.startsWith('<HTML')
|
|
21
|
-
|| trimmed.startsWith('<?xml');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function isEsmProxyPath(pathname) {
|
|
25
|
-
return pathname === '/_esm' || pathname.startsWith(ESM_PROXY_PREFIX);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function resolveEsmUpstreamUrl(requestUrl) {
|
|
29
|
-
const proxiedPath = requestUrl.pathname === '/_esm'
|
|
30
|
-
? ''
|
|
31
|
-
: requestUrl.pathname.slice(ESM_PROXY_PREFIX.length);
|
|
32
|
-
|
|
33
|
-
if (!proxiedPath) {
|
|
34
|
-
throw createRequestError(400, 'Missing esm.sh module path');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return new URL(`${proxiedPath}${requestUrl.search}`, `${ESM_UPSTREAM_ORIGIN}/`).toString();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function createEsmProxyHandler() {
|
|
41
|
-
const esmAssetCache = new Map();
|
|
42
|
-
|
|
43
|
-
async function fetchEsmAsset(upstreamUrl) {
|
|
44
|
-
if (!globalThis.fetch) {
|
|
45
|
-
throw createRequestError(500, 'Global fetch is unavailable for esm proxy');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (!esmAssetCache.has(upstreamUrl)) {
|
|
49
|
-
esmAssetCache.set(upstreamUrl, (async () => {
|
|
50
|
-
let lastError = null;
|
|
51
|
-
|
|
52
|
-
for (let attempt = 1; attempt <= 3; attempt += 1) {
|
|
53
|
-
try {
|
|
54
|
-
const response = await globalThis.fetch(upstreamUrl, {
|
|
55
|
-
headers: {
|
|
56
|
-
Accept: 'text/javascript, application/javascript, text/css;q=0.9, */*;q=0.5',
|
|
57
|
-
},
|
|
58
|
-
redirect: 'follow',
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
if (!response.ok) {
|
|
62
|
-
throw createRequestError(502, `esm.sh responded with ${response.status}`);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const contentType = response.headers.get('content-type') || 'application/octet-stream';
|
|
66
|
-
const cacheControl = response.headers.get('cache-control') || 'public, max-age=300';
|
|
67
|
-
|
|
68
|
-
if (ESM_TEXT_CONTENT_TYPE_PATTERN.test(contentType)) {
|
|
69
|
-
const text = await response.text();
|
|
70
|
-
if (looksLikeHtmlDocument(text)) {
|
|
71
|
-
throw createRequestError(502, 'esm.sh returned HTML for a module asset');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
body: rewriteEsmText(text),
|
|
76
|
-
cacheControl,
|
|
77
|
-
contentType,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
body: Buffer.from(await response.arrayBuffer()),
|
|
83
|
-
cacheControl,
|
|
84
|
-
contentType,
|
|
85
|
-
};
|
|
86
|
-
} catch (error) {
|
|
87
|
-
lastError = error;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
throw lastError || createRequestError(502, 'Failed to fetch esm.sh asset');
|
|
92
|
-
})().catch((error) => {
|
|
93
|
-
esmAssetCache.delete(upstreamUrl);
|
|
94
|
-
throw error;
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return esmAssetCache.get(upstreamUrl);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return async function handleEsmProxy(req, res, requestUrl) {
|
|
102
|
-
if (!isEsmProxyPath(requestUrl.pathname)) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
107
|
-
textResponse(req, res, 405, 'Method Not Allowed');
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
try {
|
|
112
|
-
const upstreamUrl = resolveEsmUpstreamUrl(requestUrl);
|
|
113
|
-
const asset = await fetchEsmAsset(upstreamUrl);
|
|
114
|
-
sendResponse(req, res, {
|
|
115
|
-
body: asset.body,
|
|
116
|
-
headers: {
|
|
117
|
-
'Cache-Control': asset.cacheControl,
|
|
118
|
-
'Content-Type': asset.contentType,
|
|
119
|
-
},
|
|
120
|
-
statusCode: 200,
|
|
121
|
-
});
|
|
122
|
-
} catch (error) {
|
|
123
|
-
const statusCode = Number.isInteger(error?.statusCode) ? error.statusCode : 502;
|
|
124
|
-
console.error(`[http] Failed to proxy "${requestUrl.pathname}":`, error.message);
|
|
125
|
-
textResponse(req, res, statusCode, 'Bad Gateway', { 'Cache-Control': 'no-store' });
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return true;
|
|
129
|
-
};
|
|
130
|
-
}
|