@markdy/renderer-dom 1.4.23 → 1.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -0
- package/dist/index.js +160 -48
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -203,6 +203,12 @@ interface DiagramOptions {
|
|
|
203
203
|
defaultFit?: boolean;
|
|
204
204
|
/** Alias for defaultFit. */
|
|
205
205
|
fit?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Initial interact state (pinch, zoom, and drag). Defaults to false when undeclared.
|
|
208
|
+
*/
|
|
209
|
+
defaultInteract?: boolean;
|
|
210
|
+
/** Alias for defaultInteract. */
|
|
211
|
+
interact?: boolean;
|
|
206
212
|
/**
|
|
207
213
|
* Optional custom fullscreen toggle handler.
|
|
208
214
|
* When provided, the footer fullscreen control delegates toggling to this callback.
|
|
@@ -228,6 +234,10 @@ interface Diagram {
|
|
|
228
234
|
exportGif(options?: GifDiagramExportOptions): Promise<Blob>;
|
|
229
235
|
resize(): void;
|
|
230
236
|
resetView(): void;
|
|
237
|
+
toggleInteract(active?: boolean): void;
|
|
238
|
+
isInteractActive(): boolean;
|
|
239
|
+
toggleFitView(): void;
|
|
240
|
+
isFitActive(): boolean;
|
|
231
241
|
syncFullscreen(isFull?: boolean): void;
|
|
232
242
|
destroy(): void;
|
|
233
243
|
}
|
package/dist/index.js
CHANGED
|
@@ -6575,6 +6575,8 @@ function createDiagram(opts) {
|
|
|
6575
6575
|
contentPadding,
|
|
6576
6576
|
defaultFit,
|
|
6577
6577
|
fit: explicitFitOption,
|
|
6578
|
+
defaultInteract,
|
|
6579
|
+
interact: explicitInteractOption,
|
|
6578
6580
|
defaultThemes,
|
|
6579
6581
|
defaultLightTheme,
|
|
6580
6582
|
defaultDarkTheme
|
|
@@ -6664,6 +6666,7 @@ function createDiagram(opts) {
|
|
|
6664
6666
|
speed: speedControls,
|
|
6665
6667
|
speeds: speedOptions,
|
|
6666
6668
|
fit: fitViewButton,
|
|
6669
|
+
interact: interactButton,
|
|
6667
6670
|
resetView: resetViewButton,
|
|
6668
6671
|
fullscreen: fullscreenButton,
|
|
6669
6672
|
svg: svgButton,
|
|
@@ -6721,6 +6724,7 @@ function createDiagram(opts) {
|
|
|
6721
6724
|
let controlsScrubberTooltip = null;
|
|
6722
6725
|
let controlsRateButtons = [];
|
|
6723
6726
|
let controlsSeekBar = null;
|
|
6727
|
+
let controlsInteractButton = null;
|
|
6724
6728
|
let controlsFitButton = null;
|
|
6725
6729
|
let closeCodePanel = null;
|
|
6726
6730
|
let progressEl = null;
|
|
@@ -7281,16 +7285,21 @@ function createDiagram(opts) {
|
|
|
7281
7285
|
let dragMoved = false;
|
|
7282
7286
|
let suppressNextClick = false;
|
|
7283
7287
|
const explicitFit = defaultFit ?? explicitFitOption;
|
|
7284
|
-
let fitViewActive = explicitFit !== void 0 ? Boolean(explicitFit) :
|
|
7288
|
+
let fitViewActive = explicitFit !== void 0 ? Boolean(explicitFit) : opts.fitMode === "contain" || Boolean(showControls);
|
|
7285
7289
|
if (fitViewActive) {
|
|
7286
7290
|
cameraLayer.style.setProperty("transform", "none", "important");
|
|
7287
7291
|
}
|
|
7292
|
+
const hasAuthorInteraction = Boolean(plan.meta.player?.interaction?.pan) || Boolean(plan.meta.player?.interaction?.zoom) || Boolean(plan.meta.player?.interaction?.enabled);
|
|
7293
|
+
const hasInteractControl = showControls && (interactButton ?? fitViewButton) !== false && (Boolean(interactButton) || Boolean(fitViewButton));
|
|
7294
|
+
const explicitInteract = defaultInteract ?? explicitInteractOption;
|
|
7295
|
+
let interactActive = explicitInteract !== void 0 ? Boolean(explicitInteract) : hasInteractControl ? false : hasAuthorInteraction || Boolean(explicitInteractiveViewport);
|
|
7288
7296
|
const ICONS2 = {
|
|
7289
7297
|
play: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg>',
|
|
7290
7298
|
pause: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>',
|
|
7291
7299
|
restart: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>',
|
|
7292
7300
|
prevBeat: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M6 6h2v12H6zm3.5 6 8.5 6V6z"/></svg>',
|
|
7293
7301
|
nextBeat: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"/></svg>',
|
|
7302
|
+
interact: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"/><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg>',
|
|
7294
7303
|
fit: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/></svg>',
|
|
7295
7304
|
resetView: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="3"/></svg>',
|
|
7296
7305
|
fullscreen: '<svg class="markdy-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"/></svg>',
|
|
@@ -7307,7 +7316,6 @@ function createDiagram(opts) {
|
|
|
7307
7316
|
viewportTransform.style.transform = `translate(${viewportPanX}px, ${viewportPanY}px) scale(${viewportScale})`;
|
|
7308
7317
|
}
|
|
7309
7318
|
function resetViewportTransform() {
|
|
7310
|
-
releaseFitView();
|
|
7311
7319
|
viewportScale = 1;
|
|
7312
7320
|
viewportPanX = 0;
|
|
7313
7321
|
viewportPanY = 0;
|
|
@@ -7324,6 +7332,7 @@ function createDiagram(opts) {
|
|
|
7324
7332
|
function toggleFitView() {
|
|
7325
7333
|
if (fitViewActive) {
|
|
7326
7334
|
resetViewportTransform();
|
|
7335
|
+
releaseFitView();
|
|
7327
7336
|
syncControls();
|
|
7328
7337
|
return;
|
|
7329
7338
|
}
|
|
@@ -7338,7 +7347,29 @@ function createDiagram(opts) {
|
|
|
7338
7347
|
viewport.scrollTop = 0;
|
|
7339
7348
|
syncControls();
|
|
7340
7349
|
}
|
|
7350
|
+
function toggleInteract(force) {
|
|
7351
|
+
interactActive = force !== void 0 ? force : !interactActive;
|
|
7352
|
+
if (interactActive) {
|
|
7353
|
+
viewport.style.cursor = "grab";
|
|
7354
|
+
viewport.style.touchAction = "none";
|
|
7355
|
+
} else {
|
|
7356
|
+
resetViewportTransform();
|
|
7357
|
+
if (defaultFit !== false) {
|
|
7358
|
+
fitViewActive = true;
|
|
7359
|
+
cameraLayer.style.setProperty("transform", "none", "important");
|
|
7360
|
+
scaleScene();
|
|
7361
|
+
}
|
|
7362
|
+
viewport.style.cursor = clickToPlay ? "pointer" : "default";
|
|
7363
|
+
viewport.style.touchAction = scrollableViewport ? "pan-x pan-y" : "auto";
|
|
7364
|
+
}
|
|
7365
|
+
syncControls();
|
|
7366
|
+
}
|
|
7367
|
+
const activePointers = /* @__PURE__ */ new Map();
|
|
7368
|
+
let initialPinchDistance = null;
|
|
7369
|
+
let initialPinchScale = 1;
|
|
7370
|
+
let pinchScenePoint = { x: 0, y: 0 };
|
|
7341
7371
|
function handleViewportWheel(event) {
|
|
7372
|
+
if (!interactActive) return;
|
|
7342
7373
|
if (scrollableViewport && !event.ctrlKey && !event.metaKey) return;
|
|
7343
7374
|
event.preventDefault();
|
|
7344
7375
|
const rect = viewport.getBoundingClientRect();
|
|
@@ -7354,40 +7385,99 @@ function createDiagram(opts) {
|
|
|
7354
7385
|
applyViewportTransform();
|
|
7355
7386
|
}
|
|
7356
7387
|
function handleViewportPointerDown(event) {
|
|
7388
|
+
if (!interactActive) return;
|
|
7357
7389
|
if (scrollableViewport) return;
|
|
7358
7390
|
if (!allowPan) return;
|
|
7359
|
-
if (event.button !== 0
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7391
|
+
if (event.button !== 0) return;
|
|
7392
|
+
activePointers.set(event.pointerId, { clientX: event.clientX, clientY: event.clientY });
|
|
7393
|
+
try {
|
|
7394
|
+
viewport.setPointerCapture(event.pointerId);
|
|
7395
|
+
} catch {
|
|
7396
|
+
}
|
|
7397
|
+
if (activePointers.size === 1) {
|
|
7398
|
+
activePointerId = event.pointerId;
|
|
7399
|
+
dragStartX = event.clientX;
|
|
7400
|
+
dragStartY = event.clientY;
|
|
7401
|
+
dragLastX = event.clientX;
|
|
7402
|
+
dragLastY = event.clientY;
|
|
7403
|
+
dragMoved = false;
|
|
7404
|
+
viewport.style.cursor = "grabbing";
|
|
7405
|
+
} else if (activePointers.size === 2) {
|
|
7406
|
+
const pts = Array.from(activePointers.values());
|
|
7407
|
+
const p1 = pts[0];
|
|
7408
|
+
const p2 = pts[1];
|
|
7409
|
+
initialPinchDistance = Math.hypot(p2.clientX - p1.clientX, p2.clientY - p1.clientY);
|
|
7410
|
+
initialPinchScale = viewportScale;
|
|
7411
|
+
const midX = (p1.clientX + p2.clientX) / 2;
|
|
7412
|
+
const midY = (p1.clientY + p2.clientY) / 2;
|
|
7413
|
+
const rect = viewport.getBoundingClientRect();
|
|
7414
|
+
const pointerX = (midX - rect.left + viewport.scrollLeft - sceneOffsetX) / fitScale;
|
|
7415
|
+
const pointerY = (midY - rect.top + viewport.scrollTop - sceneOffsetY) / fitScale;
|
|
7416
|
+
pinchScenePoint = {
|
|
7417
|
+
x: (pointerX - viewportPanX) / viewportScale,
|
|
7418
|
+
y: (pointerY - viewportPanY) / viewportScale
|
|
7419
|
+
};
|
|
7420
|
+
dragMoved = true;
|
|
7421
|
+
}
|
|
7368
7422
|
}
|
|
7369
7423
|
function handleViewportPointerMove(event) {
|
|
7370
|
-
if (
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7424
|
+
if (!interactActive) return;
|
|
7425
|
+
if (!activePointers.has(event.pointerId)) return;
|
|
7426
|
+
activePointers.set(event.pointerId, { clientX: event.clientX, clientY: event.clientY });
|
|
7427
|
+
if (activePointers.size === 1 && event.pointerId === activePointerId) {
|
|
7428
|
+
const deltaX = (event.clientX - dragLastX) / fitScale;
|
|
7429
|
+
const deltaY = (event.clientY - dragLastY) / fitScale;
|
|
7430
|
+
const totalX = event.clientX - dragStartX;
|
|
7431
|
+
const totalY = event.clientY - dragStartY;
|
|
7432
|
+
if (!dragMoved && Math.hypot(totalX, totalY) >= DRAG_CLICK_THRESHOLD_PX) dragMoved = true;
|
|
7433
|
+
dragLastX = event.clientX;
|
|
7434
|
+
dragLastY = event.clientY;
|
|
7435
|
+
viewportPanX += deltaX;
|
|
7436
|
+
viewportPanY += deltaY;
|
|
7437
|
+
applyViewportTransform();
|
|
7438
|
+
} else if (activePointers.size >= 2 && initialPinchDistance && initialPinchDistance > 0) {
|
|
7439
|
+
const pts = Array.from(activePointers.values());
|
|
7440
|
+
const p1 = pts[0];
|
|
7441
|
+
const p2 = pts[1];
|
|
7442
|
+
const currentDistance = Math.hypot(p2.clientX - p1.clientX, p2.clientY - p1.clientY);
|
|
7443
|
+
const pinchRatio = currentDistance / initialPinchDistance;
|
|
7444
|
+
const nextScale = Math.min(MAX_VIEWPORT_ZOOM, Math.max(MIN_VIEWPORT_ZOOM, initialPinchScale * pinchRatio));
|
|
7445
|
+
const midX = (p1.clientX + p2.clientX) / 2;
|
|
7446
|
+
const midY = (p1.clientY + p2.clientY) / 2;
|
|
7447
|
+
const rect = viewport.getBoundingClientRect();
|
|
7448
|
+
const pointerX = (midX - rect.left + viewport.scrollLeft - sceneOffsetX) / fitScale;
|
|
7449
|
+
const pointerY = (midY - rect.top + viewport.scrollTop - sceneOffsetY) / fitScale;
|
|
7450
|
+
viewportScale = nextScale;
|
|
7451
|
+
viewportPanX = pointerX - pinchScenePoint.x * viewportScale;
|
|
7452
|
+
viewportPanY = pointerY - pinchScenePoint.y * viewportScale;
|
|
7453
|
+
applyViewportTransform();
|
|
7454
|
+
dragMoved = true;
|
|
7455
|
+
}
|
|
7381
7456
|
}
|
|
7382
7457
|
function handleViewportPointerEnd(event) {
|
|
7383
|
-
if (event.pointerId
|
|
7458
|
+
if (viewport.hasPointerCapture(event.pointerId)) {
|
|
7459
|
+
try {
|
|
7460
|
+
viewport.releasePointerCapture(event.pointerId);
|
|
7461
|
+
} catch {
|
|
7462
|
+
}
|
|
7463
|
+
}
|
|
7464
|
+
activePointers.delete(event.pointerId);
|
|
7384
7465
|
if (dragMoved) suppressNextClick = true;
|
|
7385
|
-
if (
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7466
|
+
if (activePointers.size === 1) {
|
|
7467
|
+
const remaining = Array.from(activePointers.entries())[0];
|
|
7468
|
+
activePointerId = remaining[0];
|
|
7469
|
+
dragLastX = remaining[1].clientX;
|
|
7470
|
+
dragLastY = remaining[1].clientY;
|
|
7471
|
+
viewport.style.cursor = "grabbing";
|
|
7472
|
+
} else if (activePointers.size === 0) {
|
|
7473
|
+
activePointerId = null;
|
|
7474
|
+
initialPinchDistance = null;
|
|
7475
|
+
dragMoved = false;
|
|
7476
|
+
viewport.style.cursor = interactActive ? "grab" : clickToPlay ? "pointer" : "default";
|
|
7477
|
+
}
|
|
7389
7478
|
}
|
|
7390
7479
|
function handleViewportDoubleClick(event) {
|
|
7480
|
+
if (!interactActive) return;
|
|
7391
7481
|
event.preventDefault();
|
|
7392
7482
|
suppressNextClick = false;
|
|
7393
7483
|
resetViewportTransform();
|
|
@@ -7410,8 +7500,9 @@ function createDiagram(opts) {
|
|
|
7410
7500
|
controlsSeekBar.value = String(sceneMs / 1e3);
|
|
7411
7501
|
controlsSeekBar.style.setProperty("--seek-pct", `${clamped * 100}%`);
|
|
7412
7502
|
}
|
|
7413
|
-
if (
|
|
7414
|
-
|
|
7503
|
+
if (controlsInteractButton) {
|
|
7504
|
+
const pressed = defaultFit === false ? fitViewActive : interactActive;
|
|
7505
|
+
controlsInteractButton.setAttribute("aria-pressed", pressed ? "true" : "false");
|
|
7415
7506
|
}
|
|
7416
7507
|
}
|
|
7417
7508
|
function emitPlayStateChange(playing) {
|
|
@@ -7662,6 +7753,18 @@ function createDiagram(opts) {
|
|
|
7662
7753
|
resetView() {
|
|
7663
7754
|
resetViewportTransform();
|
|
7664
7755
|
},
|
|
7756
|
+
toggleInteract(active) {
|
|
7757
|
+
toggleInteract(active);
|
|
7758
|
+
},
|
|
7759
|
+
isInteractActive() {
|
|
7760
|
+
return interactActive;
|
|
7761
|
+
},
|
|
7762
|
+
toggleFitView() {
|
|
7763
|
+
toggleFitView();
|
|
7764
|
+
},
|
|
7765
|
+
isFitActive() {
|
|
7766
|
+
return fitViewActive;
|
|
7767
|
+
},
|
|
7665
7768
|
syncFullscreen(isFull) {
|
|
7666
7769
|
syncFullscreenHandler?.(isFull);
|
|
7667
7770
|
},
|
|
@@ -8216,13 +8319,24 @@ function createDiagram(opts) {
|
|
|
8216
8319
|
});
|
|
8217
8320
|
toolbar.appendChild(button);
|
|
8218
8321
|
}
|
|
8322
|
+
function mountInteractControl(toolbar) {
|
|
8323
|
+
const showButton = (interactButton ?? fitViewButton) !== false && (Boolean(interactButton) || Boolean(fitViewButton));
|
|
8324
|
+
if (!showButton) return;
|
|
8325
|
+
controlsInteractButton = makeControlButton("Interact", "Toggle interactive mode (pinch, zoom, and drag)", ICONS2.interact);
|
|
8326
|
+
controlsInteractButton.className = "markdy-control-interact markdy-control-fit";
|
|
8327
|
+
controlsInteractButton.setAttribute("aria-pressed", (defaultFit === false ? fitViewActive : interactActive) ? "true" : "false");
|
|
8328
|
+
controlsInteractButton.addEventListener("click", () => {
|
|
8329
|
+
if (defaultFit === false) {
|
|
8330
|
+
toggleFitView();
|
|
8331
|
+
} else {
|
|
8332
|
+
toggleInteract();
|
|
8333
|
+
}
|
|
8334
|
+
});
|
|
8335
|
+
controlsFitButton = controlsInteractButton;
|
|
8336
|
+
toolbar.appendChild(controlsInteractButton);
|
|
8337
|
+
}
|
|
8219
8338
|
function mountFitControl(toolbar) {
|
|
8220
|
-
|
|
8221
|
-
controlsFitButton = makeControlButton("Fit", "Fit all items in view and ignore camera zoom", ICONS2.fit);
|
|
8222
|
-
controlsFitButton.className = "markdy-control-fit";
|
|
8223
|
-
controlsFitButton.setAttribute("aria-pressed", fitViewActive ? "true" : "false");
|
|
8224
|
-
controlsFitButton.addEventListener("click", toggleFitView);
|
|
8225
|
-
toolbar.appendChild(controlsFitButton);
|
|
8339
|
+
mountInteractControl(toolbar);
|
|
8226
8340
|
}
|
|
8227
8341
|
function mountResetViewControl(toolbar) {
|
|
8228
8342
|
if (!resetViewButton) return;
|
|
@@ -8470,13 +8584,13 @@ function createDiagram(opts) {
|
|
|
8470
8584
|
mountSpeedControls(speedGroup);
|
|
8471
8585
|
toolsGroup.appendChild(speedGroup);
|
|
8472
8586
|
}
|
|
8473
|
-
if (fitViewButton || resetViewButton || fullscreenButton) {
|
|
8587
|
+
if (interactButton || fitViewButton || resetViewButton || fullscreenButton) {
|
|
8474
8588
|
if (toolsGroup.children.length > 0) {
|
|
8475
8589
|
const divider = document.createElement("div");
|
|
8476
8590
|
divider.className = "markdy-control-divider";
|
|
8477
8591
|
toolsGroup.appendChild(divider);
|
|
8478
8592
|
}
|
|
8479
|
-
|
|
8593
|
+
mountInteractControl(toolsGroup);
|
|
8480
8594
|
mountResetViewControl(toolsGroup);
|
|
8481
8595
|
mountFullscreenControl(toolsGroup);
|
|
8482
8596
|
}
|
|
@@ -8499,18 +8613,16 @@ function createDiagram(opts) {
|
|
|
8499
8613
|
ensureFooter().insertBefore(toolbar, badge);
|
|
8500
8614
|
syncControls();
|
|
8501
8615
|
}
|
|
8502
|
-
viewport.style.cursor =
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
viewport.addEventListener("pointercancel", handleViewportPointerEnd);
|
|
8511
|
-
}
|
|
8512
|
-
if (doubleClickToReset) viewport.addEventListener("dblclick", handleViewportDoubleClick);
|
|
8616
|
+
viewport.style.cursor = interactActive ? "grab" : clickToPlay ? "pointer" : "default";
|
|
8617
|
+
viewport.style.touchAction = interactActive ? "none" : scrollableViewport ? "pan-x pan-y" : "auto";
|
|
8618
|
+
if (allowZoom) viewport.addEventListener("wheel", handleViewportWheel, { passive: false });
|
|
8619
|
+
if (allowPan) {
|
|
8620
|
+
viewport.addEventListener("pointerdown", handleViewportPointerDown);
|
|
8621
|
+
viewport.addEventListener("pointermove", handleViewportPointerMove);
|
|
8622
|
+
viewport.addEventListener("pointerup", handleViewportPointerEnd);
|
|
8623
|
+
viewport.addEventListener("pointercancel", handleViewportPointerEnd);
|
|
8513
8624
|
}
|
|
8625
|
+
if (doubleClickToReset) viewport.addEventListener("dblclick", handleViewportDoubleClick);
|
|
8514
8626
|
if (showControls) mountControls();
|
|
8515
8627
|
if (clickToPlay) {
|
|
8516
8628
|
viewport.addEventListener("click", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/renderer-dom",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.25",
|
|
4
4
|
"description": "Browser renderer for diagram-native animated MarkdyScript architecture diagrams, built on the Web Animations API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,10 +41,11 @@
|
|
|
41
41
|
"url": "https://github.com/HoangYell/markdy-com/issues"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
|
-
"access": "public"
|
|
44
|
+
"access": "public",
|
|
45
|
+
"registry": "https://registry.npmjs.org"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
|
-
"@markdy/core": "^1.4.
|
|
48
|
+
"@markdy/core": "^1.4.25",
|
|
48
49
|
"html2canvas": "^1.4.1"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|