@markdy/mdx 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 CHANGED
@@ -75,3 +75,4 @@ Fenced block metadata is passed as props to `MarkdyDiagram`. Snake-case aliases
75
75
  | `scene_boundary_progress=false` | `sceneBoundaryProgress={false}` | Preferred flag for the scene-boundary progress bar |
76
76
  | `playback_rate=0.5` | `playbackRate={0.5}` | Normalized timeline speed multiplier; `1` is Markdy's normal pace |
77
77
  | `interactive_viewport=true` | `interactiveViewport={true}` | Enable wheel zoom and drag pan on the rendered viewport |
78
+ | `controls=true` | `controls={true}` | Show a compact toolbar with play/pause, restart, speed, and view reset controls; also enables viewport interaction |
package/dist/index.d.ts CHANGED
@@ -14,11 +14,12 @@ type MarkdyDiagramProps = {
14
14
  sceneBoundaryProgress?: boolean | string;
15
15
  playbackRate?: number | string;
16
16
  interactiveViewport?: boolean | string;
17
+ controls?: boolean | string;
17
18
  className?: string;
18
19
  title?: string;
19
20
  description?: string;
20
21
  };
21
- declare function MarkdyDiagram({ code, width, height, bg, assets, autoplay, loop, copyright, progressBar, sceneBoundaryProgress, playbackRate, interactiveViewport, className, title, description, }: MarkdyDiagramProps): react.JSX.Element;
22
+ declare function MarkdyDiagram({ code, width, height, bg, assets, autoplay, loop, copyright, progressBar, sceneBoundaryProgress, playbackRate, controls, interactiveViewport, className, title, description, }: MarkdyDiagramProps): react.JSX.Element;
22
23
 
23
24
  type MarkdyFenceDefaults = Partial<{
24
25
  width: number;
@@ -30,6 +31,7 @@ type MarkdyFenceDefaults = Partial<{
30
31
  progressBar: boolean;
31
32
  playbackRate: number;
32
33
  interactiveViewport: boolean;
34
+ controls: boolean;
33
35
  title: string;
34
36
  description: string;
35
37
  }>;
package/dist/index.js CHANGED
@@ -40,7 +40,8 @@ function MarkdyDiagram({
40
40
  progressBar = false,
41
41
  sceneBoundaryProgress,
42
42
  playbackRate = 1,
43
- interactiveViewport = false,
43
+ controls = false,
44
+ interactiveViewport = controls,
44
45
  className,
45
46
  title = "Markdy animation",
46
47
  description
@@ -53,7 +54,8 @@ function MarkdyDiagram({
53
54
  const resolvedProgressBar = coerceBoolean(progressBar, false);
54
55
  const resolvedSceneBoundaryProgress = coerceBoolean(sceneBoundaryProgress, resolvedProgressBar);
55
56
  const resolvedPlaybackRate = coerceNumber(playbackRate, 1);
56
- const resolvedInteractiveViewport = coerceBoolean(interactiveViewport, false);
57
+ const resolvedControls = coerceBoolean(controls, false);
58
+ const resolvedInteractiveViewport = resolvedControls || coerceBoolean(interactiveViewport, false);
57
59
  const rootRef = useRef(null);
58
60
  const diagramRef = useRef(null);
59
61
  const hydratedRef = useRef(false);
@@ -84,7 +86,8 @@ function MarkdyDiagram({
84
86
  progressBar: resolvedProgressBar,
85
87
  sceneBoundaryProgress: resolvedSceneBoundaryProgress,
86
88
  playbackRate: resolvedPlaybackRate > 0 ? resolvedPlaybackRate : 1,
87
- interactiveViewport: resolvedInteractiveViewport
89
+ interactiveViewport: resolvedInteractiveViewport,
90
+ controls: resolvedControls
88
91
  });
89
92
  root.dataset.markdyInit = "done";
90
93
  root.removeAttribute("aria-busy");
@@ -133,7 +136,8 @@ function MarkdyDiagram({
133
136
  resolvedProgressBar,
134
137
  resolvedSceneBoundaryProgress,
135
138
  resolvedPlaybackRate,
136
- resolvedInteractiveViewport
139
+ resolvedInteractiveViewport,
140
+ resolvedControls
137
141
  ]);
138
142
  return /* @__PURE__ */ jsxs(
139
143
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/mdx",
3
- "version": "0.8.16",
3
+ "version": "0.8.18",
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.16"
45
+ "@markdy/renderer-dom": "0.8.18"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=18.0.0",