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,6 +1,5 @@
|
|
|
1
1
|
import { setDiagramActionButtonIcon } from '../domain/diagram-action-icons.js';
|
|
2
2
|
import {
|
|
3
|
-
downloadBlob,
|
|
4
3
|
rasterizeSvgMarkupToPngBlob,
|
|
5
4
|
writeBlobToClipboard,
|
|
6
5
|
} from './diagram-preview-export.js';
|
|
@@ -9,13 +8,15 @@ import {
|
|
|
9
8
|
getFrameViewportSize,
|
|
10
9
|
} from './preview-diagram-utils.js';
|
|
11
10
|
import { clamp } from '../domain/vault-utils.js';
|
|
11
|
+
import { downloadBlob } from '../browser-utils.js';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const DIAGRAM_CHROME_ZOOM = Object.freeze({
|
|
14
14
|
animationDurationMs: 160,
|
|
15
15
|
default: 1,
|
|
16
16
|
max: 3,
|
|
17
17
|
min: 0.1,
|
|
18
18
|
step: 0.1,
|
|
19
|
+
wheelSensitivity: 0.01,
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
const DIAGRAM_CHROME_ZOOM_POLICY = Object.freeze({
|
|
@@ -80,7 +81,6 @@ export class DiagramChrome {
|
|
|
80
81
|
this.shellControllers = new WeakMap();
|
|
81
82
|
this.shellViewStates = new WeakMap();
|
|
82
83
|
this.shellRefits = new WeakMap();
|
|
83
|
-
this.resizeFrameId = null;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
destroy() {
|
|
@@ -89,10 +89,6 @@ export class DiagramChrome {
|
|
|
89
89
|
this.resizeObservers.clear();
|
|
90
90
|
this.maximizedRoots.forEach((root) => root.remove());
|
|
91
91
|
this.maximizedRoots.clear();
|
|
92
|
-
if (this.resizeFrameId) {
|
|
93
|
-
this.window.cancelAnimationFrame(this.resizeFrameId);
|
|
94
|
-
this.resizeFrameId = null;
|
|
95
|
-
}
|
|
96
92
|
this.activeMaximizedShell = null;
|
|
97
93
|
}
|
|
98
94
|
|
|
@@ -186,17 +182,6 @@ export class DiagramChrome {
|
|
|
186
182
|
});
|
|
187
183
|
}
|
|
188
184
|
|
|
189
|
-
scheduleActiveRefitOnNextFrame() {
|
|
190
|
-
if (this.resizeFrameId) {
|
|
191
|
-
this.window.cancelAnimationFrame(this.resizeFrameId);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
this.resizeFrameId = this.window.requestAnimationFrame(() => {
|
|
195
|
-
this.resizeFrameId = null;
|
|
196
|
-
this.scheduleActiveRefit();
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
185
|
ensureMaximizedRoot(kind) {
|
|
201
186
|
const config = getKindConfig(kind);
|
|
202
187
|
const existing = this.maximizedRoots.get(kind);
|
|
@@ -282,12 +267,11 @@ export class DiagramChrome {
|
|
|
282
267
|
const toolbar = this.document.createElement('div');
|
|
283
268
|
toolbar.className = config.toolbarClassName;
|
|
284
269
|
const leftGroup = this.document.createElement('div');
|
|
285
|
-
leftGroup.className = 'diagram-preview-toolbar-group
|
|
270
|
+
leftGroup.className = 'diagram-preview-toolbar-group';
|
|
286
271
|
const rightGroup = this.document.createElement('div');
|
|
287
272
|
rightGroup.className = 'diagram-preview-toolbar-group diagram-preview-toolbar-group--actions';
|
|
288
273
|
|
|
289
|
-
const decreaseButton = this.createButton(kind, '
|
|
290
|
-
decreaseButton.textContent = '−';
|
|
274
|
+
const decreaseButton = this.createButton(kind, '−', 'Zoom out');
|
|
291
275
|
const increaseButton = this.createButton(kind, '+', 'Zoom in');
|
|
292
276
|
const resetButton = this.createButton(kind, '', 'Reset zoom', { icon: 'fit' });
|
|
293
277
|
const copyButton = this.createButton(kind, '', 'Copy image', { icon: 'copy' });
|
|
@@ -470,11 +454,11 @@ export class DiagramChrome {
|
|
|
470
454
|
}
|
|
471
455
|
|
|
472
456
|
let currentZoom = zoomPolicy.default;
|
|
473
|
-
let defaultZoom = 1;
|
|
474
457
|
let zoomAnimationFrameId = null;
|
|
458
|
+
let zoomAnimationTarget = null;
|
|
475
459
|
let resetZoomFrameId = null;
|
|
476
|
-
let layoutFrameId = null;
|
|
477
460
|
let replacementFrameId = null;
|
|
461
|
+
let pinchState = null;
|
|
478
462
|
let hasManualZoom = Boolean(
|
|
479
463
|
previousViewState?.hasManualZoom
|
|
480
464
|
|| previousViewState?.scrollLeft > 0
|
|
@@ -484,15 +468,7 @@ export class DiagramChrome {
|
|
|
484
468
|
const hasRestorableViewState = Number.isFinite(previousViewState?.zoom);
|
|
485
469
|
let lastAutoFitViewportWidth = hasInitialViewport ? previousViewportWidth : 0;
|
|
486
470
|
let shouldForceScheduledReset = false;
|
|
487
|
-
|
|
488
|
-
let activePointerId = null;
|
|
489
|
-
let panStartX = 0;
|
|
490
|
-
let panStartY = 0;
|
|
491
|
-
let panStartScrollLeft = 0;
|
|
492
|
-
let panStartScrollTop = 0;
|
|
493
|
-
|
|
494
|
-
diagramElement.style.display = 'block';
|
|
495
|
-
diagramElement.style.margin = '0 auto';
|
|
471
|
+
|
|
496
472
|
diagramElement.style.maxWidth = 'none';
|
|
497
473
|
|
|
498
474
|
const calculateDefaultZoom = () => {
|
|
@@ -518,52 +494,56 @@ export class DiagramChrome {
|
|
|
518
494
|
decreaseButton.disabled = currentZoom <= zoomPolicy.min;
|
|
519
495
|
increaseButton.disabled = currentZoom >= zoomPolicy.max;
|
|
520
496
|
|
|
521
|
-
const viewport = getFrameViewportSize(frame);
|
|
522
|
-
const isPannable = (baseWidth * currentZoom) > viewport.width || (baseHeight * currentZoom) > viewport.height;
|
|
523
|
-
frame.classList.toggle('is-pannable', isPannable);
|
|
524
|
-
diagramElement.style.margin = isPannable ? '0' : '0 auto';
|
|
525
497
|
};
|
|
526
498
|
|
|
527
|
-
// ponytail: size from the current viewport for the first paint; hidden shells refit later.
|
|
528
499
|
const initialZoom = hasRestorableViewState
|
|
529
500
|
? clamp(previousViewState.zoom, zoomPolicy.min, zoomPolicy.max)
|
|
530
501
|
: hasInitialViewport
|
|
531
502
|
? clamp(previousViewportWidth / baseWidth, zoomPolicy.min, zoomPolicy.fitMax)
|
|
532
503
|
: zoomPolicy.default;
|
|
533
|
-
applyZoom(initialZoom);
|
|
534
504
|
|
|
535
505
|
const getViewportCenter = () => ({
|
|
536
506
|
x: frame.scrollLeft + (frame.clientWidth / 2),
|
|
537
507
|
y: frame.scrollTop + (frame.clientHeight / 2),
|
|
538
508
|
});
|
|
539
509
|
|
|
540
|
-
const
|
|
510
|
+
const restoreViewportPoint = (previousZoom, nextZoom, contentPoint, viewportPoint) => {
|
|
541
511
|
if (previousZoom === 0) {
|
|
542
512
|
return;
|
|
543
513
|
}
|
|
544
514
|
|
|
545
515
|
const scale = nextZoom / previousZoom;
|
|
546
|
-
frame.scrollLeft = (
|
|
547
|
-
frame.scrollTop = (
|
|
516
|
+
frame.scrollLeft = (contentPoint.x * scale) - viewportPoint.x;
|
|
517
|
+
frame.scrollTop = (contentPoint.y * scale) - viewportPoint.y;
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
const restoreViewportCenter = (previousZoom, nextZoom, center) => {
|
|
521
|
+
restoreViewportPoint(previousZoom, nextZoom, center, {
|
|
522
|
+
x: frame.clientWidth / 2,
|
|
523
|
+
y: frame.clientHeight / 2,
|
|
524
|
+
});
|
|
548
525
|
};
|
|
549
526
|
|
|
550
527
|
const animateZoomTo = (nextZoom) => {
|
|
551
528
|
const targetZoom = clamp(nextZoom, zoomPolicy.min, zoomPolicy.max);
|
|
529
|
+
if (zoomAnimationFrameId) {
|
|
530
|
+
zoomAnimationTarget = targetZoom;
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
|
|
552
534
|
const startZoom = currentZoom;
|
|
553
535
|
if (targetZoom === startZoom) {
|
|
554
536
|
return;
|
|
555
537
|
}
|
|
556
538
|
|
|
539
|
+
zoomAnimationTarget = targetZoom;
|
|
557
540
|
const center = getViewportCenter();
|
|
558
541
|
const startedAt = performance.now();
|
|
559
|
-
if (zoomAnimationFrameId) {
|
|
560
|
-
this.window.cancelAnimationFrame(zoomAnimationFrameId);
|
|
561
|
-
}
|
|
562
542
|
|
|
563
543
|
const tick = (now) => {
|
|
564
544
|
const progress = clamp((now - startedAt) / zoomPolicy.animationDurationMs, 0, 1);
|
|
565
545
|
const easedProgress = easeOutCubic(progress);
|
|
566
|
-
const animatedZoom = startZoom + ((
|
|
546
|
+
const animatedZoom = startZoom + ((zoomAnimationTarget - startZoom) * easedProgress);
|
|
567
547
|
applyZoom(animatedZoom);
|
|
568
548
|
restoreViewportCenter(startZoom, animatedZoom, center);
|
|
569
549
|
|
|
@@ -573,33 +553,35 @@ export class DiagramChrome {
|
|
|
573
553
|
}
|
|
574
554
|
|
|
575
555
|
zoomAnimationFrameId = null;
|
|
576
|
-
|
|
577
|
-
|
|
556
|
+
const completedZoom = zoomAnimationTarget;
|
|
557
|
+
zoomAnimationTarget = null;
|
|
558
|
+
applyZoom(completedZoom);
|
|
559
|
+
restoreViewportCenter(startZoom, completedZoom, center);
|
|
578
560
|
};
|
|
579
561
|
|
|
580
562
|
zoomAnimationFrameId = this.window.requestAnimationFrame(tick);
|
|
581
563
|
};
|
|
582
564
|
|
|
565
|
+
const cancelZoomAnimation = () => {
|
|
566
|
+
if (zoomAnimationFrameId) {
|
|
567
|
+
this.window.cancelAnimationFrame(zoomAnimationFrameId);
|
|
568
|
+
zoomAnimationFrameId = null;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
zoomAnimationTarget = null;
|
|
572
|
+
};
|
|
573
|
+
|
|
583
574
|
const zoomBy = (delta) => {
|
|
584
575
|
hasManualZoom = true;
|
|
585
|
-
animateZoomTo(currentZoom + delta);
|
|
576
|
+
animateZoomTo((zoomAnimationTarget ?? currentZoom) + delta);
|
|
586
577
|
};
|
|
587
578
|
|
|
588
|
-
const resetZoomToFit = (
|
|
589
|
-
defaultZoom = calculateDefaultZoom();
|
|
579
|
+
const resetZoomToFit = () => {
|
|
580
|
+
const defaultZoom = calculateDefaultZoom();
|
|
590
581
|
hasManualZoom = false;
|
|
591
582
|
lastAutoFitViewportWidth = getFrameViewportSize(frame).width;
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
animateZoomTo(defaultZoom);
|
|
595
|
-
return;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
if (zoomAnimationFrameId) {
|
|
599
|
-
this.window.cancelAnimationFrame(zoomAnimationFrameId);
|
|
600
|
-
zoomAnimationFrameId = null;
|
|
601
|
-
}
|
|
602
|
-
|
|
583
|
+
pinchState = null;
|
|
584
|
+
cancelZoomAnimation();
|
|
603
585
|
applyZoom(defaultZoom);
|
|
604
586
|
frame.scrollLeft = 0;
|
|
605
587
|
frame.scrollTop = 0;
|
|
@@ -610,40 +592,133 @@ export class DiagramChrome {
|
|
|
610
592
|
if (resetZoomFrameId) {
|
|
611
593
|
this.window.cancelAnimationFrame(resetZoomFrameId);
|
|
612
594
|
}
|
|
613
|
-
if (layoutFrameId) {
|
|
614
|
-
this.window.cancelAnimationFrame(layoutFrameId);
|
|
615
|
-
}
|
|
616
595
|
|
|
617
596
|
resetZoomFrameId = this.window.requestAnimationFrame(() => {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
resetZoomToFit();
|
|
638
|
-
});
|
|
639
|
-
});
|
|
597
|
+
resetZoomFrameId = null;
|
|
598
|
+
if (!shell.isConnected) {
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
const shouldForce = shouldForceScheduledReset;
|
|
603
|
+
shouldForceScheduledReset = false;
|
|
604
|
+
const viewportWidth = getFrameViewportSize(frame).width;
|
|
605
|
+
const viewportChanged = Math.abs(viewportWidth - lastAutoFitViewportWidth) > 1;
|
|
606
|
+
if (!shouldForce && hasManualZoom) {
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
if (!shouldForce && viewportWidth > 0 && lastAutoFitViewportWidth > 0 && !viewportChanged) {
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
resetZoomToFit();
|
|
640
614
|
});
|
|
641
615
|
};
|
|
642
616
|
|
|
643
617
|
const resizeObserver = this.attachShellResizeObserver(shell, frame, () => scheduleResetZoomToFit());
|
|
644
618
|
|
|
619
|
+
const getFrameViewportPoint = (clientX, clientY) => {
|
|
620
|
+
const rect = frame.getBoundingClientRect();
|
|
621
|
+
return {
|
|
622
|
+
x: Number(clientX) - rect.left,
|
|
623
|
+
y: Number(clientY) - rect.top,
|
|
624
|
+
};
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
const getPinchGesture = (touches) => {
|
|
628
|
+
if (!touches || touches.length !== 2) {
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const first = touches[0];
|
|
633
|
+
const second = touches[1];
|
|
634
|
+
const center = getFrameViewportPoint(
|
|
635
|
+
(first.clientX + second.clientX) / 2,
|
|
636
|
+
(first.clientY + second.clientY) / 2,
|
|
637
|
+
);
|
|
638
|
+
const distance = Math.hypot(
|
|
639
|
+
second.clientX - first.clientX,
|
|
640
|
+
second.clientY - first.clientY,
|
|
641
|
+
);
|
|
642
|
+
if (!Number.isFinite(distance) || distance <= 0) {
|
|
643
|
+
return null;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
return { center, distance };
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
const startPinch = (touches) => {
|
|
650
|
+
const gesture = getPinchGesture(touches);
|
|
651
|
+
if (!gesture) {
|
|
652
|
+
return false;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
cancelZoomAnimation();
|
|
656
|
+
pinchState = {
|
|
657
|
+
contentPoint: {
|
|
658
|
+
x: frame.scrollLeft + gesture.center.x,
|
|
659
|
+
y: frame.scrollTop + gesture.center.y,
|
|
660
|
+
},
|
|
661
|
+
distance: gesture.distance,
|
|
662
|
+
zoom: currentZoom,
|
|
663
|
+
};
|
|
664
|
+
return true;
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
const updatePinch = (touches) => {
|
|
668
|
+
const gesture = getPinchGesture(touches);
|
|
669
|
+
if (!gesture) {
|
|
670
|
+
return false;
|
|
671
|
+
}
|
|
672
|
+
if (!pinchState && !startPinch(touches)) {
|
|
673
|
+
return false;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
hasManualZoom = true;
|
|
677
|
+
applyZoom(pinchState.zoom * (gesture.distance / pinchState.distance));
|
|
678
|
+
restoreViewportPoint(
|
|
679
|
+
pinchState.zoom,
|
|
680
|
+
currentZoom,
|
|
681
|
+
pinchState.contentPoint,
|
|
682
|
+
gesture.center,
|
|
683
|
+
);
|
|
684
|
+
return true;
|
|
685
|
+
};
|
|
686
|
+
|
|
645
687
|
decreaseButton.addEventListener('click', () => zoomBy(-zoomPolicy.step));
|
|
646
688
|
increaseButton.addEventListener('click', () => zoomBy(zoomPolicy.step));
|
|
689
|
+
frame.addEventListener('wheel', (event) => {
|
|
690
|
+
if (!event.ctrlKey) {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
event.preventDefault();
|
|
695
|
+
const deltaY = Number.isFinite(event.deltaY) ? event.deltaY : 0;
|
|
696
|
+
const wheelDelta = clamp(
|
|
697
|
+
-deltaY * zoomPolicy.wheelSensitivity,
|
|
698
|
+
-zoomPolicy.step / 2,
|
|
699
|
+
zoomPolicy.step / 2,
|
|
700
|
+
);
|
|
701
|
+
if (wheelDelta !== 0) {
|
|
702
|
+
zoomBy(wheelDelta);
|
|
703
|
+
}
|
|
704
|
+
}, { passive: false });
|
|
705
|
+
frame.addEventListener('touchstart', (event) => {
|
|
706
|
+
if (event.touches.length === 2) {
|
|
707
|
+
startPinch(event.touches);
|
|
708
|
+
}
|
|
709
|
+
}, { passive: true });
|
|
710
|
+
frame.addEventListener('touchmove', (event) => {
|
|
711
|
+
if (event.touches.length === 2 && updatePinch(event.touches)) {
|
|
712
|
+
event.preventDefault();
|
|
713
|
+
}
|
|
714
|
+
}, { passive: false });
|
|
715
|
+
const finishPinch = (event) => {
|
|
716
|
+
if (event.touches.length !== 2) {
|
|
717
|
+
pinchState = null;
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
frame.addEventListener('touchend', finishPinch);
|
|
721
|
+
frame.addEventListener('touchcancel', finishPinch);
|
|
647
722
|
resetButton.addEventListener('click', () => {
|
|
648
723
|
scheduleResetZoomToFit({ force: true });
|
|
649
724
|
});
|
|
@@ -660,82 +735,6 @@ export class DiagramChrome {
|
|
|
660
735
|
);
|
|
661
736
|
});
|
|
662
737
|
|
|
663
|
-
const stopPanning = () => {
|
|
664
|
-
if (!isPanning) {
|
|
665
|
-
return;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
isPanning = false;
|
|
669
|
-
frame.classList.remove('is-dragging');
|
|
670
|
-
this.window.removeEventListener('pointerup', stopPanning, true);
|
|
671
|
-
this.window.removeEventListener('pointercancel', stopPanning, true);
|
|
672
|
-
this.window.removeEventListener('mouseup', stopPanning, true);
|
|
673
|
-
this.window.removeEventListener('touchend', stopPanning, true);
|
|
674
|
-
this.window.removeEventListener('touchcancel', stopPanning, true);
|
|
675
|
-
this.window.removeEventListener('blur', stopPanning, true);
|
|
676
|
-
|
|
677
|
-
if (activePointerId !== null && typeof frame.releasePointerCapture === 'function') {
|
|
678
|
-
try {
|
|
679
|
-
frame.releasePointerCapture(activePointerId);
|
|
680
|
-
} catch {
|
|
681
|
-
// Ignore capture release issues during drag end.
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
activePointerId = null;
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
frame.addEventListener('pointerdown', (event) => {
|
|
689
|
-
if (event.button !== 0 || !frame.classList.contains('is-pannable')) {
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
if (zoomAnimationFrameId) {
|
|
694
|
-
this.window.cancelAnimationFrame(zoomAnimationFrameId);
|
|
695
|
-
zoomAnimationFrameId = null;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
isPanning = true;
|
|
699
|
-
activePointerId = event.pointerId;
|
|
700
|
-
panStartX = event.clientX;
|
|
701
|
-
panStartY = event.clientY;
|
|
702
|
-
panStartScrollLeft = frame.scrollLeft;
|
|
703
|
-
panStartScrollTop = frame.scrollTop;
|
|
704
|
-
|
|
705
|
-
frame.classList.add('is-dragging');
|
|
706
|
-
this.window.addEventListener('pointerup', stopPanning, true);
|
|
707
|
-
this.window.addEventListener('pointercancel', stopPanning, true);
|
|
708
|
-
this.window.addEventListener('mouseup', stopPanning, true);
|
|
709
|
-
this.window.addEventListener('touchend', stopPanning, true);
|
|
710
|
-
this.window.addEventListener('touchcancel', stopPanning, true);
|
|
711
|
-
this.window.addEventListener('blur', stopPanning, true);
|
|
712
|
-
if (typeof frame.setPointerCapture === 'function') {
|
|
713
|
-
try {
|
|
714
|
-
frame.setPointerCapture(event.pointerId);
|
|
715
|
-
} catch {
|
|
716
|
-
// Safari can reject pointer capture during rapid layout transitions.
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
event.preventDefault();
|
|
720
|
-
});
|
|
721
|
-
|
|
722
|
-
frame.addEventListener('pointermove', (event) => {
|
|
723
|
-
if (!isPanning) {
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
frame.scrollLeft = panStartScrollLeft - (event.clientX - panStartX);
|
|
728
|
-
frame.scrollTop = panStartScrollTop - (event.clientY - panStartY);
|
|
729
|
-
});
|
|
730
|
-
|
|
731
|
-
frame.addEventListener('pointerup', stopPanning);
|
|
732
|
-
frame.addEventListener('pointercancel', stopPanning);
|
|
733
|
-
frame.addEventListener('lostpointercapture', stopPanning);
|
|
734
|
-
frame.addEventListener('mouseleave', stopPanning);
|
|
735
|
-
frame.addEventListener('mouseup', stopPanning);
|
|
736
|
-
frame.addEventListener('touchend', stopPanning);
|
|
737
|
-
frame.addEventListener('touchcancel', stopPanning);
|
|
738
|
-
|
|
739
738
|
frame.appendChild(diagramElement);
|
|
740
739
|
const sourceNode = sourceSelector ? shell.querySelector(sourceSelector) : null;
|
|
741
740
|
const nextChildren = sourceNode ? [sourceNode, toolbar, frame] : [toolbar, frame];
|
|
@@ -789,16 +788,12 @@ export class DiagramChrome {
|
|
|
789
788
|
|
|
790
789
|
const controller = {
|
|
791
790
|
destroy: () => {
|
|
792
|
-
stopPanning();
|
|
793
791
|
if (zoomAnimationFrameId) {
|
|
794
792
|
this.window.cancelAnimationFrame(zoomAnimationFrameId);
|
|
795
793
|
}
|
|
796
794
|
if (resetZoomFrameId) {
|
|
797
795
|
this.window.cancelAnimationFrame(resetZoomFrameId);
|
|
798
796
|
}
|
|
799
|
-
if (layoutFrameId) {
|
|
800
|
-
this.window.cancelAnimationFrame(layoutFrameId);
|
|
801
|
-
}
|
|
802
797
|
if (replacementFrameId) {
|
|
803
798
|
this.window.cancelAnimationFrame(replacementFrameId);
|
|
804
799
|
}
|
|
@@ -4,10 +4,13 @@ import {
|
|
|
4
4
|
stripVaultFileExtension,
|
|
5
5
|
} from '../../domain/file-kind.js';
|
|
6
6
|
import { getVaultPathLeaf } from '../domain/vault-paths.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import {
|
|
8
|
+
encodeSvgDataUrl,
|
|
9
|
+
loadImage,
|
|
10
|
+
resolveSvgDimensions,
|
|
11
|
+
sanitizeSvgMarkup,
|
|
12
|
+
serializeSvgElement,
|
|
13
|
+
} from './preview-diagram-utils.js';
|
|
11
14
|
|
|
12
15
|
const LIGHT_EXPORT_MERMAID_CONFIG = Object.freeze({
|
|
13
16
|
htmlLabels: false,
|
|
@@ -28,41 +31,11 @@ const MERMAID_INIT_DIRECTIVE_PATTERN = /^\s*%%\{\s*(?:init|initialize)\s*:[\s\S]
|
|
|
28
31
|
|
|
29
32
|
let mermaidExportCounter = 0;
|
|
30
33
|
|
|
31
|
-
function encodeSvgDataUrl(svgMarkup) {
|
|
32
|
-
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgMarkup)}`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
34
|
function createMermaidExportId() {
|
|
36
35
|
mermaidExportCounter += 1;
|
|
37
36
|
return `mermaid-export-${mermaidExportCounter.toString(36)}`;
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
function resolveSvgDimensions(svgElement) {
|
|
41
|
-
const widthAttr = Number.parseFloat(svgElement.getAttribute('width') || '');
|
|
42
|
-
const heightAttr = Number.parseFloat(svgElement.getAttribute('height') || '');
|
|
43
|
-
const viewBox = svgElement.getAttribute('viewBox') || '';
|
|
44
|
-
const viewBoxParts = viewBox.split(/\s+/u).map((value) => Number.parseFloat(value));
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
height: Number.isFinite(heightAttr) && heightAttr > 0
|
|
48
|
-
? heightAttr
|
|
49
|
-
: (Number.isFinite(viewBoxParts[3]) && viewBoxParts[3] > 0 ? viewBoxParts[3] : 800),
|
|
50
|
-
width: Number.isFinite(widthAttr) && widthAttr > 0
|
|
51
|
-
? widthAttr
|
|
52
|
-
: (Number.isFinite(viewBoxParts[2]) && viewBoxParts[2] > 0 ? viewBoxParts[2] : 1200),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function loadImage(src) {
|
|
57
|
-
return new Promise((resolve, reject) => {
|
|
58
|
-
const image = new Image();
|
|
59
|
-
image.decoding = 'async';
|
|
60
|
-
image.addEventListener('load', () => resolve(image), { once: true });
|
|
61
|
-
image.addEventListener('error', () => reject(new Error(`Failed to load image: ${src}`)), { once: true });
|
|
62
|
-
image.src = src;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
39
|
async function canvasToPngBlob(canvas) {
|
|
67
40
|
if (typeof canvas.toBlob === 'function') {
|
|
68
41
|
const blob = await new Promise((resolve) => canvas.toBlob(resolve, 'image/png'));
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
syncAttribute,
|
|
9
9
|
normalizeDiagramError,
|
|
10
10
|
} from './preview-diagram-utils.js';
|
|
11
|
-
import { resolveApiUrl } from '../domain/runtime-paths.js';
|
|
12
11
|
|
|
13
12
|
function datasetKeyToAttributeName(datasetKey) {
|
|
14
13
|
return `data-${datasetKey.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`)}`;
|
|
@@ -18,7 +17,6 @@ export class DiagramPreviewHydrator {
|
|
|
18
17
|
constructor(renderer, {
|
|
19
18
|
batchSize,
|
|
20
19
|
datasetKeys,
|
|
21
|
-
fetchFn = null,
|
|
22
20
|
loadFileSource = null,
|
|
23
21
|
filePathLabel,
|
|
24
22
|
requestIdleRenderFn = requestIdleRender,
|
|
@@ -32,7 +30,7 @@ export class DiagramPreviewHydrator {
|
|
|
32
30
|
this.renderer = renderer;
|
|
33
31
|
this.batchSize = batchSize;
|
|
34
32
|
this.datasetKeys = datasetKeys;
|
|
35
|
-
this.loadFileSource = loadFileSource
|
|
33
|
+
this.loadFileSource = loadFileSource;
|
|
36
34
|
this.filePathLabel = filePathLabel;
|
|
37
35
|
this.requestIdleRenderFn = requestIdleRenderFn;
|
|
38
36
|
this.cancelIdleRenderFn = cancelIdleRenderFn;
|
|
@@ -58,22 +56,6 @@ export class DiagramPreviewHydrator {
|
|
|
58
56
|
this.fileInflightRequests = new Map();
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
createLegacyFileSourceLoader(fetchFn) {
|
|
62
|
-
if (typeof fetchFn !== 'function') {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return async (filePath) => {
|
|
67
|
-
const response = await fetchFn(resolveApiUrl(`/file?path=${encodeURIComponent(filePath)}`));
|
|
68
|
-
const payload = await response.json().catch(() => ({}));
|
|
69
|
-
if (!response.ok || payload?.ok === false) {
|
|
70
|
-
throw new Error(payload?.error || `Failed to load ${this.filePathLabel.toLowerCase()} source`);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return String(payload?.content ?? '');
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
59
|
destroy() {
|
|
78
60
|
this.cancelHydration();
|
|
79
61
|
this.clearPreservedShells();
|
|
@@ -2,8 +2,6 @@ import { dump as dumpYaml } from 'js-yaml';
|
|
|
2
2
|
|
|
3
3
|
import { escapeHtml } from '../domain/vault-utils.js';
|
|
4
4
|
|
|
5
|
-
export { extractYamlFrontmatter } from '../../domain/yaml-frontmatter.js';
|
|
6
|
-
|
|
7
5
|
function isPlainObject(value) {
|
|
8
6
|
return Object.prototype.toString.call(value) === '[object Object]';
|
|
9
7
|
}
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from './preview-diagram-utils.js';
|
|
13
13
|
|
|
14
14
|
export class MermaidPreviewHydrator extends DiagramPreviewHydrator {
|
|
15
|
-
constructor(renderer, {
|
|
15
|
+
constructor(renderer, { loadFileSource = null } = {}) {
|
|
16
16
|
super(renderer, {
|
|
17
17
|
batchSize: MERMAID_BATCH_SIZE,
|
|
18
18
|
datasetKeys: {
|
|
@@ -26,24 +26,17 @@ export class MermaidPreviewHydrator extends DiagramPreviewHydrator {
|
|
|
26
26
|
sourceLineEnd: 'sourceLineEnd',
|
|
27
27
|
target: 'mermaidTarget',
|
|
28
28
|
},
|
|
29
|
-
fetchFn,
|
|
30
29
|
filePathLabel: 'Mermaid',
|
|
31
30
|
loadFileSource,
|
|
32
31
|
shellClassName: 'mermaid-shell',
|
|
33
32
|
sourceClassName: 'mermaid-source',
|
|
34
33
|
});
|
|
35
|
-
this.renderer = renderer;
|
|
36
34
|
this.currentTheme = document.documentElement?.dataset.theme === 'light' ? 'light' : 'dark';
|
|
37
35
|
this.diagramChrome = renderer.diagramChrome;
|
|
38
36
|
this.loader = null;
|
|
39
37
|
this.runtime = null;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
destroy() {
|
|
43
|
-
this.cancelHydration();
|
|
44
|
-
this.clearPreservedShells();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
40
|
cancelHydration({ preserveActiveShell = false } = {}) {
|
|
48
41
|
super.cancelHydration();
|
|
49
42
|
if (!preserveActiveShell) {
|
|
@@ -360,10 +353,4 @@ export class MermaidPreviewHydrator extends DiagramPreviewHydrator {
|
|
|
360
353
|
shell._diagramRenderedSource = renderedSource;
|
|
361
354
|
}
|
|
362
355
|
|
|
363
|
-
scheduleActiveRefit() {
|
|
364
|
-
this.diagramChrome?.scheduleActiveRefit?.({
|
|
365
|
-
kind: 'mermaid',
|
|
366
|
-
root: this.renderer.previewElement,
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
356
|
}
|
|
@@ -32,18 +32,12 @@ export class PlantUmlPreviewHydrator extends DiagramPreviewHydrator {
|
|
|
32
32
|
shellClassName: 'plantuml-shell',
|
|
33
33
|
sourceClassName: 'plantuml-source',
|
|
34
34
|
});
|
|
35
|
-
this.renderer = renderer;
|
|
36
35
|
this.diagramChrome = renderer.diagramChrome;
|
|
37
36
|
this.renderClient = renderClient;
|
|
38
37
|
this.svgCache = new Map();
|
|
39
38
|
this.svgInflightRequests = new Map();
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
destroy() {
|
|
43
|
-
this.cancelHydration();
|
|
44
|
-
this.clearPreservedShells();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
41
|
cancelHydration({ preserveActiveShell = false } = {}) {
|
|
48
42
|
super.cancelHydration();
|
|
49
43
|
if (!preserveActiveShell) {
|
|
@@ -51,10 +45,6 @@ export class PlantUmlPreviewHydrator extends DiagramPreviewHydrator {
|
|
|
51
45
|
}
|
|
52
46
|
}
|
|
53
47
|
|
|
54
|
-
scheduleActiveRefit() {
|
|
55
|
-
this.diagramChrome?.scheduleActiveRefitOnNextFrame?.();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
48
|
handleReconcile({ restoredMaximizedShell }) {
|
|
59
49
|
if (restoredMaximizedShell) {
|
|
60
50
|
document.body.classList.add('plantuml-maximized-open');
|