@markdy/renderer-dom 0.8.17 → 0.8.19
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +45 -28
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ diagram.destroy(); // clean up DOM + cancel animations
|
|
|
77
77
|
| `sceneBoundaryProgress` | `boolean` | `progressBar ?? true` | Preferred flag for the rainbow scene-boundary progress bar |
|
|
78
78
|
| `playbackRate` | `number` | `1` | Normalized timeline speed multiplier; `1` is Markdy's normal pace |
|
|
79
79
|
| `interactiveViewport` | `boolean` | `false` | Enable wheel zoom and drag pan on the rendered viewport |
|
|
80
|
-
| `controls` | `boolean` | `false` | Show a compact toolbar with play/pause, restart, speed, and view reset controls
|
|
80
|
+
| `controls` | `boolean` | `false` | Show a compact toolbar with play/pause, restart, speed, and view reset controls; also enables viewport interaction |
|
|
81
81
|
| `onWarning` | `(warning: Diagnostic) => void` | `console.warn` | Called for each soft parse warning |
|
|
82
82
|
| `onTimeUpdate` | `(seconds: number, durationSeconds: number) => void` | — | Called whenever playback or seek changes the current time |
|
|
83
83
|
| `onPlayStateChange` | `(playing: boolean) => void` | — | Called when playback starts or pauses |
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ interface DiagramOptions {
|
|
|
24
24
|
playbackRate?: number;
|
|
25
25
|
/** Enable wheel zoom and drag pan on the rendered viewport. Defaults to false. */
|
|
26
26
|
interactiveViewport?: boolean;
|
|
27
|
-
/** Show built-in playback and viewport controls. Defaults to false. */
|
|
27
|
+
/** Show built-in playback and viewport controls. Also enables viewport interaction. Defaults to false. */
|
|
28
28
|
controls?: boolean;
|
|
29
29
|
onWarning?: (warning: Diagnostic) => void;
|
|
30
30
|
onTimeUpdate?: (seconds: number, durationSeconds: number) => void;
|
package/dist/index.js
CHANGED
|
@@ -1863,8 +1863,8 @@ function createDiagram(opts) {
|
|
|
1863
1863
|
progressBar,
|
|
1864
1864
|
sceneBoundaryProgress,
|
|
1865
1865
|
playbackRate: initialPlaybackRate = DEFAULT_PLAYBACK_RATE,
|
|
1866
|
-
interactiveViewport = false,
|
|
1867
1866
|
controls = false,
|
|
1867
|
+
interactiveViewport = controls,
|
|
1868
1868
|
onWarning = (w) => console.warn(`[markdy] line ${w.line}: ${w.message}`),
|
|
1869
1869
|
onTimeUpdate,
|
|
1870
1870
|
onPlayStateChange
|
|
@@ -1909,6 +1909,25 @@ function createDiagram(opts) {
|
|
|
1909
1909
|
progressEl.style.webkitMaskComposite = "xor";
|
|
1910
1910
|
progressEl.style.padding = "2px";
|
|
1911
1911
|
}
|
|
1912
|
+
let footer = null;
|
|
1913
|
+
function ensureFooter() {
|
|
1914
|
+
if (footer) return footer;
|
|
1915
|
+
footer = document.createElement("div");
|
|
1916
|
+
footer.className = "markdy-footer";
|
|
1917
|
+
Object.assign(footer.style, {
|
|
1918
|
+
display: "flex",
|
|
1919
|
+
alignItems: "center",
|
|
1920
|
+
justifyContent: "flex-end",
|
|
1921
|
+
flexWrap: "wrap",
|
|
1922
|
+
gap: "6px",
|
|
1923
|
+
width: "100%",
|
|
1924
|
+
boxSizing: "border-box",
|
|
1925
|
+
padding: "4px 6px 0"
|
|
1926
|
+
});
|
|
1927
|
+
if (container.parentNode) container.parentNode.insertBefore(footer, container.nextSibling);
|
|
1928
|
+
else container.appendChild(footer);
|
|
1929
|
+
return footer;
|
|
1930
|
+
}
|
|
1912
1931
|
let badge = null;
|
|
1913
1932
|
if (copyright) {
|
|
1914
1933
|
badge = document.createElement("a");
|
|
@@ -1917,17 +1936,17 @@ function createDiagram(opts) {
|
|
|
1917
1936
|
badge.rel = "noopener noreferrer";
|
|
1918
1937
|
badge.textContent = "Powered by Markdy";
|
|
1919
1938
|
Object.assign(badge.style, {
|
|
1920
|
-
display: "
|
|
1939
|
+
display: "inline-flex",
|
|
1940
|
+
alignItems: "center",
|
|
1921
1941
|
textAlign: "right",
|
|
1922
1942
|
fontSize: "10px",
|
|
1923
1943
|
fontFamily: "system-ui, sans-serif",
|
|
1924
1944
|
color: "#999",
|
|
1925
1945
|
textDecoration: "none",
|
|
1926
|
-
padding: "
|
|
1946
|
+
padding: "0",
|
|
1927
1947
|
opacity: "0.7"
|
|
1928
1948
|
});
|
|
1929
|
-
|
|
1930
|
-
else container.appendChild(badge);
|
|
1949
|
+
ensureFooter().appendChild(badge);
|
|
1931
1950
|
}
|
|
1932
1951
|
ensureSceneStyles(document);
|
|
1933
1952
|
ensureNodeStyles(document);
|
|
@@ -2228,6 +2247,7 @@ function createDiagram(opts) {
|
|
|
2228
2247
|
resizeObserver.disconnect();
|
|
2229
2248
|
if (progressEl?.parentNode === viewport) viewport.removeChild(progressEl);
|
|
2230
2249
|
if (badge?.parentNode) badge.parentNode.removeChild(badge);
|
|
2250
|
+
if (footer?.parentNode) footer.parentNode.removeChild(footer);
|
|
2231
2251
|
if (viewport.parentNode === container) container.removeChild(viewport);
|
|
2232
2252
|
}
|
|
2233
2253
|
};
|
|
@@ -2246,16 +2266,16 @@ function createDiagram(opts) {
|
|
|
2246
2266
|
button.title = ariaLabel;
|
|
2247
2267
|
Object.assign(button.style, {
|
|
2248
2268
|
appearance: "none",
|
|
2249
|
-
border: "1px solid rgba(
|
|
2250
|
-
borderRadius: "
|
|
2251
|
-
background: "rgba(
|
|
2252
|
-
color: "#
|
|
2269
|
+
border: "1px solid rgba(148, 163, 184, 0.55)",
|
|
2270
|
+
borderRadius: "5px",
|
|
2271
|
+
background: "rgba(248, 250, 252, 0.92)",
|
|
2272
|
+
color: "#475569",
|
|
2253
2273
|
cursor: "pointer",
|
|
2254
|
-
font: "600
|
|
2255
|
-
padding: "6px
|
|
2256
|
-
minWidth: "
|
|
2274
|
+
font: "600 10px/1.1 system-ui, sans-serif",
|
|
2275
|
+
padding: "4px 6px",
|
|
2276
|
+
minWidth: "28px",
|
|
2257
2277
|
whiteSpace: "nowrap",
|
|
2258
|
-
boxShadow: "
|
|
2278
|
+
boxShadow: "none"
|
|
2259
2279
|
});
|
|
2260
2280
|
return button;
|
|
2261
2281
|
}
|
|
@@ -2265,23 +2285,20 @@ function createDiagram(opts) {
|
|
|
2265
2285
|
toolbar.setAttribute("role", "toolbar");
|
|
2266
2286
|
toolbar.setAttribute("aria-label", "Diagram controls");
|
|
2267
2287
|
Object.assign(toolbar.style, {
|
|
2268
|
-
position: "
|
|
2269
|
-
left: "50%",
|
|
2270
|
-
bottom: "10px",
|
|
2271
|
-
zIndex: "10000",
|
|
2288
|
+
position: "static",
|
|
2272
2289
|
display: "flex",
|
|
2273
2290
|
alignItems: "center",
|
|
2274
|
-
justifyContent: "
|
|
2291
|
+
justifyContent: "flex-end",
|
|
2275
2292
|
flexWrap: "wrap",
|
|
2276
|
-
gap: "
|
|
2277
|
-
maxWidth: "
|
|
2278
|
-
padding: "
|
|
2279
|
-
border: "
|
|
2280
|
-
borderRadius: "
|
|
2281
|
-
background: "
|
|
2282
|
-
boxShadow: "
|
|
2283
|
-
backdropFilter: "
|
|
2284
|
-
transform: "
|
|
2293
|
+
gap: "4px",
|
|
2294
|
+
maxWidth: "100%",
|
|
2295
|
+
padding: "0",
|
|
2296
|
+
border: "0",
|
|
2297
|
+
borderRadius: "0",
|
|
2298
|
+
background: "transparent",
|
|
2299
|
+
boxShadow: "none",
|
|
2300
|
+
backdropFilter: "none",
|
|
2301
|
+
transform: "none",
|
|
2285
2302
|
pointerEvents: "auto"
|
|
2286
2303
|
});
|
|
2287
2304
|
for (const eventName of ["click", "dblclick", "pointerdown", "pointermove", "pointerup", "wheel"]) {
|
|
@@ -2313,7 +2330,7 @@ function createDiagram(opts) {
|
|
|
2313
2330
|
resetButton.addEventListener("click", resetViewportTransform);
|
|
2314
2331
|
toolbar.appendChild(resetButton);
|
|
2315
2332
|
}
|
|
2316
|
-
|
|
2333
|
+
ensureFooter().insertBefore(toolbar, badge ?? null);
|
|
2317
2334
|
syncControls();
|
|
2318
2335
|
}
|
|
2319
2336
|
viewport.style.cursor = interactiveViewport ? "grab" : "pointer";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/renderer-dom",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.19",
|
|
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",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@markdy/core": "0.8.
|
|
47
|
+
"@markdy/core": "0.8.19"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"jsdom": "^29.1.1",
|
|
51
51
|
"tsup": "^8.5.1",
|
|
52
52
|
"typescript": "^5.9.3",
|
|
53
53
|
"vitest": "^4.1.7",
|
|
54
|
-
"@markdy/stdlib-systems": "0.8.
|
|
54
|
+
"@markdy/stdlib-systems": "0.8.19"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsup",
|