@markdy/core 1.4.21 → 1.4.22

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -427,6 +427,11 @@ var CONTROLS = {
427
427
  reset_view: { group: "controls", key: "resetView", type: "boolean" },
428
428
  resetViewButton: { group: "controls", key: "resetView", type: "boolean" },
429
429
  reset_view_button: { group: "controls", key: "resetView", type: "boolean" },
430
+ focus: { group: "controls", key: "resetView", type: "boolean" },
431
+ focusView: { group: "controls", key: "resetView", type: "boolean" },
432
+ focus_view: { group: "controls", key: "resetView", type: "boolean" },
433
+ focusButton: { group: "controls", key: "resetView", type: "boolean" },
434
+ focus_button: { group: "controls", key: "resetView", type: "boolean" },
430
435
  fullscreen: { group: "controls", key: "fullscreen", type: "boolean" },
431
436
  fullScreen: { group: "controls", key: "fullscreen", type: "boolean" },
432
437
  full_screen: { group: "controls", key: "fullscreen", type: "boolean" },
@@ -506,6 +511,11 @@ var FLAT = {
506
511
  fit_view_button: CONTROLS.fit_view_button,
507
512
  resetViewButton: CONTROLS.resetViewButton,
508
513
  reset_view_button: CONTROLS.reset_view_button,
514
+ focus: CONTROLS.focus,
515
+ focusView: CONTROLS.focusView,
516
+ focus_view: CONTROLS.focus_view,
517
+ focusButton: CONTROLS.focusButton,
518
+ focus_button: CONTROLS.focus_button,
509
519
  fullscreen: CONTROLS.fullscreen,
510
520
  fullScreen: CONTROLS.fullScreen,
511
521
  full_screen: CONTROLS.full_screen,
@@ -606,7 +616,15 @@ function unquote(raw) {
606
616
  function resolvePlayer(config = {}, overrides = {}) {
607
617
  const playback = config.playback ?? {};
608
618
  const overrideControls = typeof overrides.controls === "object" && overrides.controls !== null ? overrides.controls : void 0;
619
+ let globalControls;
620
+ if (typeof window !== "undefined") {
621
+ const win = window;
622
+ if (win.__MARKDY_DEFAULT_CONTROLS__ && typeof win.__MARKDY_DEFAULT_CONTROLS__ === "object") {
623
+ globalControls = win.__MARKDY_DEFAULT_CONTROLS__;
624
+ }
625
+ }
609
626
  const configuredControls = {
627
+ ...globalControls ?? {},
610
628
  ...config.controls ?? {},
611
629
  ...overrideControls ? overrideControls : {}
612
630
  };
@@ -617,12 +635,13 @@ function resolvePlayer(config = {}, overrides = {}) {
617
635
  const controlsExplicitlyDeclared = Boolean(
618
636
  config.controls && Object.keys(config.controls).length > 0 || overrideControls && Object.keys(overrideControls).length > 0
619
637
  );
638
+ const controlsActive = controlsAllowed && (hostControlDefault || controlsExplicitlyDeclared);
620
639
  const unconfiguredFallback = controlsExplicitlyDeclared ? false : hostControlDefault;
621
640
  const resolveControl = (value, fallback = unconfiguredFallback) => controlsAllowed && (value ?? fallback);
622
641
  const requestedControls = {
623
642
  seek: resolveControl(configuredControls.seek, false),
624
643
  speed: resolveControl(configuredControls.speed),
625
- fit: resolveControl(configuredControls.fit),
644
+ fit: controlsActive && configuredControls.fit !== false,
626
645
  resetView: resolveControl(configuredControls.resetView),
627
646
  fullscreen: resolveControl(configuredControls.fullscreen),
628
647
  svg: resolveControl(configuredControls.svg),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/core",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
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",