@markdy/astro 0.8.16 → 0.8.18
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 +3 -2
- package/package.json +2 -2
- package/src/Markdy.astro +8 -2
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ const code = `
|
|
|
47
47
|
`;
|
|
48
48
|
---
|
|
49
49
|
|
|
50
|
-
<Markdy code={code} width={800} height={400} bg="#07111f" autoplay />
|
|
50
|
+
<Markdy code={code} width={800} height={400} bg="#07111f" autoplay controls />
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
### In MDX
|
|
@@ -64,7 +64,7 @@ export const code = `
|
|
|
64
64
|
Web -> API "GET /users"
|
|
65
65
|
`;
|
|
66
66
|
|
|
67
|
-
<Markdy code={code} width={600} height={300} bg="#07111f" autoplay />
|
|
67
|
+
<Markdy code={code} width={600} height={300} bg="#07111f" autoplay controls />
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
## Props
|
|
@@ -83,6 +83,7 @@ export const code = `
|
|
|
83
83
|
| `sceneBoundaryProgress` | `boolean` | `progressBar` | Preferred flag for the rainbow scene-boundary progress bar |
|
|
84
84
|
| `playbackRate` | `number` | `1` | Normalized timeline speed multiplier; `1` is Markdy's normal pace |
|
|
85
85
|
| `interactiveViewport` | `boolean` | `false` | Enable wheel zoom and drag pan after hydration |
|
|
86
|
+
| `controls` | `boolean` | `false` | Show a compact toolbar with play/pause, restart, speed, and view reset controls; also enables viewport interaction |
|
|
86
87
|
| `class` | `string` | — | CSS class for the outer wrapper |
|
|
87
88
|
|
|
88
89
|
> **Tip:** Match `width`, `height`, and `bg` props to your `scene` declaration values to avoid a visual flash on hydration.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/astro",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.18",
|
|
4
4
|
"description": "Astro island component for diagram-native animated MarkdyScript architecture diagrams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@markdy/renderer-dom": "0.8.
|
|
41
|
+
"@markdy/renderer-dom": "0.8.18"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"astro": ">=4.0.0"
|
package/src/Markdy.astro
CHANGED
|
@@ -48,6 +48,8 @@ export interface Props {
|
|
|
48
48
|
playbackRate?: number;
|
|
49
49
|
/** Enable wheel zoom and drag pan after hydration. Defaults to false. */
|
|
50
50
|
interactiveViewport?: boolean;
|
|
51
|
+
/** Show built-in playback and viewport controls. Also enables viewport interaction. Defaults to false. */
|
|
52
|
+
controls?: boolean;
|
|
51
53
|
class?: string;
|
|
52
54
|
/**
|
|
53
55
|
* Short human-readable title for the animation.
|
|
@@ -74,7 +76,8 @@ const {
|
|
|
74
76
|
progressBar = true,
|
|
75
77
|
sceneBoundaryProgress,
|
|
76
78
|
playbackRate = 1,
|
|
77
|
-
|
|
79
|
+
controls = false,
|
|
80
|
+
interactiveViewport = controls,
|
|
78
81
|
class: className,
|
|
79
82
|
title = "Markdy animation",
|
|
80
83
|
description,
|
|
@@ -99,6 +102,7 @@ const codeB64 =
|
|
|
99
102
|
data-markdy-scene-boundary-progress={String(sceneBoundaryProgress ?? progressBar)}
|
|
100
103
|
data-markdy-playback-rate={String(playbackRate)}
|
|
101
104
|
data-markdy-interactive-viewport={String(interactiveViewport)}
|
|
105
|
+
data-markdy-controls={String(controls)}
|
|
102
106
|
role="img"
|
|
103
107
|
aria-label={title}
|
|
104
108
|
aria-busy="true"
|
|
@@ -275,7 +279,8 @@ const codeB64 =
|
|
|
275
279
|
const progressBar = el.dataset.markdyProgressBar !== "false";
|
|
276
280
|
const sceneBoundaryProgress = el.dataset.markdySceneBoundaryProgress !== "false";
|
|
277
281
|
const playbackRate = Number(el.dataset.markdyPlaybackRate ?? "1");
|
|
278
|
-
const
|
|
282
|
+
const controls = el.dataset.markdyControls === "true";
|
|
283
|
+
const interactiveViewport = controls || el.dataset.markdyInteractiveViewport === "true";
|
|
279
284
|
|
|
280
285
|
// Code-split: renderer-dom is NOT part of the initial page bundle.
|
|
281
286
|
const { createDiagram } = await import("@markdy/renderer-dom");
|
|
@@ -295,6 +300,7 @@ const codeB64 =
|
|
|
295
300
|
sceneBoundaryProgress,
|
|
296
301
|
playbackRate: Number.isFinite(playbackRate) && playbackRate > 0 ? playbackRate : 1,
|
|
297
302
|
interactiveViewport,
|
|
303
|
+
controls,
|
|
298
304
|
});
|
|
299
305
|
|
|
300
306
|
el.dataset.markdyInit = "done";
|