@markdy/core 1.4.24 → 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 +7 -2
- package/dist/index.js +6 -5
- package/package.json +1 -1
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?:
|
|
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 | (
|
|
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
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
|
|
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 = {
|
|
@@ -650,7 +651,7 @@ function resolvePlayer(config = {}, overrides = {}) {
|
|
|
650
651
|
seek: resolveControl(configuredControls.seek, false),
|
|
651
652
|
speed: resolveControl(configuredControls.speed),
|
|
652
653
|
fit: controlsActive && configuredControls.fit !== false,
|
|
653
|
-
interact:
|
|
654
|
+
interact: resolveControl(interactExplicit),
|
|
654
655
|
resetView: resolveControl(configuredControls.resetView),
|
|
655
656
|
fullscreen: resolveControl(configuredControls.fullscreen),
|
|
656
657
|
svg: resolveControl(configuredControls.svg),
|
package/package.json
CHANGED