@markdy/core 1.4.25 → 1.5.0

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 CHANGED
@@ -31,6 +31,11 @@ type PlayerControlsConfig = {
31
31
  /** Speed multipliers offered by the speed buttons. */
32
32
  speeds?: number[];
33
33
  };
34
+ type PlayerControlsInput = PlayerControlsConfig & {
35
+ /** Alias for resetView */
36
+ focus?: boolean;
37
+ [key: string]: unknown;
38
+ };
34
39
  /** What pointer and key input do. Declaring the group opts in. */
35
40
  type PlayerInteractionConfig = {
36
41
  zoom?: boolean;
@@ -48,7 +53,7 @@ type PlayerChromeConfig = {
48
53
  };
49
54
  type PlayerConfig = {
50
55
  playback?: PlayerPlaybackConfig;
51
- controls?: PlayerControlsConfig;
56
+ controls?: PlayerControlsInput;
52
57
  interaction?: PlayerInteractionConfig;
53
58
  chrome?: PlayerChromeConfig;
54
59
  };
@@ -443,7 +448,7 @@ type PlayerOverrides = {
443
448
  loop?: boolean;
444
449
  playbackRate?: number;
445
450
  copyright?: boolean;
446
- controls?: boolean | (PlayerControlsConfig & {
451
+ controls?: boolean | (PlayerControlsInput & {
447
452
  playback?: boolean;
448
453
  });
449
454
  interactiveViewport?: boolean;
package/dist/index.js CHANGED
@@ -624,10 +624,11 @@ function resolvePlayer(config = {}, overrides = {}) {
624
624
  const playback = config.playback ?? {};
625
625
  const overrideControls = typeof overrides.controls === "object" && overrides.controls !== null ? overrides.controls : void 0;
626
626
  let globalControls;
627
- if (typeof window !== "undefined") {
628
- const win = window;
629
- if (win.__MARKDY_DEFAULT_CONTROLS__ && typeof win.__MARKDY_DEFAULT_CONTROLS__ === "object") {
630
- globalControls = win.__MARKDY_DEFAULT_CONTROLS__;
627
+ if (typeof globalThis !== "undefined") {
628
+ const glob = globalThis;
629
+ const controls2 = glob.window?.__MARKDY_DEFAULT_CONTROLS__ ?? glob.__MARKDY_DEFAULT_CONTROLS__;
630
+ if (controls2 && typeof controls2 === "object") {
631
+ globalControls = controls2;
631
632
  }
632
633
  }
633
634
  const configuredControls = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/core",
3
- "version": "1.4.25",
3
+ "version": "1.5.0",
4
4
  "description": "Diagram-native MarkdyScript parser and compiler (auto-layout, edge routing, cue scheduling) — zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "type": "module",