@markdy/mdx 0.8.14 → 0.8.16
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 +2 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +7 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -73,4 +73,5 @@ Fenced block metadata is passed as props to `MarkdyDiagram`. Snake-case aliases
|
|
|
73
73
|
|---|---|---|
|
|
74
74
|
| `progress_bar=false` | `progressBar={false}` | Deprecated compatibility flag for the scene-boundary progress bar |
|
|
75
75
|
| `scene_boundary_progress=false` | `sceneBoundaryProgress={false}` | Preferred flag for the scene-boundary progress bar |
|
|
76
|
-
| `playback_rate=0.5` | `playbackRate={0.5}` |
|
|
76
|
+
| `playback_rate=0.5` | `playbackRate={0.5}` | Normalized timeline speed multiplier; `1` is Markdy's normal pace |
|
|
77
|
+
| `interactive_viewport=true` | `interactiveViewport={true}` | Enable wheel zoom and drag pan on the rendered viewport |
|
package/dist/index.d.ts
CHANGED
|
@@ -13,11 +13,12 @@ type MarkdyDiagramProps = {
|
|
|
13
13
|
progressBar?: boolean | string;
|
|
14
14
|
sceneBoundaryProgress?: boolean | string;
|
|
15
15
|
playbackRate?: number | string;
|
|
16
|
+
interactiveViewport?: boolean | string;
|
|
16
17
|
className?: string;
|
|
17
18
|
title?: string;
|
|
18
19
|
description?: string;
|
|
19
20
|
};
|
|
20
|
-
declare function MarkdyDiagram({ code, width, height, bg, assets, autoplay, loop, copyright, progressBar, sceneBoundaryProgress, playbackRate, className, title, description, }: MarkdyDiagramProps): react.JSX.Element;
|
|
21
|
+
declare function MarkdyDiagram({ code, width, height, bg, assets, autoplay, loop, copyright, progressBar, sceneBoundaryProgress, playbackRate, interactiveViewport, className, title, description, }: MarkdyDiagramProps): react.JSX.Element;
|
|
21
22
|
|
|
22
23
|
type MarkdyFenceDefaults = Partial<{
|
|
23
24
|
width: number;
|
|
@@ -27,6 +28,8 @@ type MarkdyFenceDefaults = Partial<{
|
|
|
27
28
|
loop: boolean;
|
|
28
29
|
copyright: boolean;
|
|
29
30
|
progressBar: boolean;
|
|
31
|
+
playbackRate: number;
|
|
32
|
+
interactiveViewport: boolean;
|
|
30
33
|
title: string;
|
|
31
34
|
description: string;
|
|
32
35
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ function MarkdyDiagram({
|
|
|
40
40
|
progressBar = false,
|
|
41
41
|
sceneBoundaryProgress,
|
|
42
42
|
playbackRate = 1,
|
|
43
|
+
interactiveViewport = false,
|
|
43
44
|
className,
|
|
44
45
|
title = "Markdy animation",
|
|
45
46
|
description
|
|
@@ -52,6 +53,7 @@ function MarkdyDiagram({
|
|
|
52
53
|
const resolvedProgressBar = coerceBoolean(progressBar, false);
|
|
53
54
|
const resolvedSceneBoundaryProgress = coerceBoolean(sceneBoundaryProgress, resolvedProgressBar);
|
|
54
55
|
const resolvedPlaybackRate = coerceNumber(playbackRate, 1);
|
|
56
|
+
const resolvedInteractiveViewport = coerceBoolean(interactiveViewport, false);
|
|
55
57
|
const rootRef = useRef(null);
|
|
56
58
|
const diagramRef = useRef(null);
|
|
57
59
|
const hydratedRef = useRef(false);
|
|
@@ -81,7 +83,8 @@ function MarkdyDiagram({
|
|
|
81
83
|
copyright: resolvedCopyright,
|
|
82
84
|
progressBar: resolvedProgressBar,
|
|
83
85
|
sceneBoundaryProgress: resolvedSceneBoundaryProgress,
|
|
84
|
-
playbackRate: resolvedPlaybackRate > 0 ? resolvedPlaybackRate : 1
|
|
86
|
+
playbackRate: resolvedPlaybackRate > 0 ? resolvedPlaybackRate : 1,
|
|
87
|
+
interactiveViewport: resolvedInteractiveViewport
|
|
85
88
|
});
|
|
86
89
|
root.dataset.markdyInit = "done";
|
|
87
90
|
root.removeAttribute("aria-busy");
|
|
@@ -129,7 +132,8 @@ function MarkdyDiagram({
|
|
|
129
132
|
resolvedLoop,
|
|
130
133
|
resolvedProgressBar,
|
|
131
134
|
resolvedSceneBoundaryProgress,
|
|
132
|
-
resolvedPlaybackRate
|
|
135
|
+
resolvedPlaybackRate,
|
|
136
|
+
resolvedInteractiveViewport
|
|
133
137
|
]);
|
|
134
138
|
return /* @__PURE__ */ jsxs(
|
|
135
139
|
"div",
|
|
@@ -228,6 +232,7 @@ function normalizeMetaKey(key) {
|
|
|
228
232
|
if (key === "progress_bar") return "progressBar";
|
|
229
233
|
if (key === "scene_boundary_progress") return "sceneBoundaryProgress";
|
|
230
234
|
if (key === "playback_rate") return "playbackRate";
|
|
235
|
+
if (key === "interactive_viewport") return "interactiveViewport";
|
|
231
236
|
return key;
|
|
232
237
|
}
|
|
233
238
|
function parseMeta(meta) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/mdx",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.16",
|
|
4
4
|
"description": "MDX plugin and lightweight React component for diagram-native animated Markdy diagrams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"unist-util-visit": "^5.0.0",
|
|
45
|
-
"@markdy/renderer-dom": "0.8.
|
|
45
|
+
"@markdy/renderer-dom": "0.8.16"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=18.0.0",
|