@markdy/core 1.5.1 → 1.5.2
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.js +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -647,12 +647,13 @@ function resolvePlayer(config = {}, overrides = {}) {
|
|
|
647
647
|
const unconfiguredFallback = controlsExplicitlyDeclared ? false : hostControlDefault;
|
|
648
648
|
const resolveControl = (value, fallback = unconfiguredFallback) => controlsAllowed && (value ?? fallback);
|
|
649
649
|
const interactExplicit = configuredControls.interact ?? configuredControls.fit;
|
|
650
|
+
const fallbackResetView = configuredControls.resetView !== void 0 ? configuredControls.resetView : configuredControls.fullscreen ?? unconfiguredFallback;
|
|
650
651
|
const requestedControls = {
|
|
651
652
|
seek: resolveControl(configuredControls.seek, false),
|
|
652
653
|
speed: resolveControl(configuredControls.speed),
|
|
653
654
|
fit: controlsActive && configuredControls.fit !== false,
|
|
654
655
|
interact: resolveControl(interactExplicit),
|
|
655
|
-
resetView: resolveControl(
|
|
656
|
+
resetView: resolveControl(fallbackResetView),
|
|
656
657
|
fullscreen: resolveControl(configuredControls.fullscreen),
|
|
657
658
|
svg: resolveControl(configuredControls.svg),
|
|
658
659
|
gif: resolveControl(configuredControls.gif),
|
|
@@ -661,12 +662,13 @@ function resolvePlayer(config = {}, overrides = {}) {
|
|
|
661
662
|
theme: resolveControl(configuredControls.theme)
|
|
662
663
|
};
|
|
663
664
|
const hasExplicitInteraction = config.interaction !== void 0;
|
|
664
|
-
const fallbackGesture = overrides.interactiveViewport === true || overrides.controls === true;
|
|
665
|
-
const interactionOn = overrides.interactiveViewport === true || overrides.controls === true || overrides.interactiveViewport !== false && hasExplicitInteraction;
|
|
665
|
+
const fallbackGesture = overrides.interactiveViewport === true || overrides.controls === true || Boolean(requestedControls.fullscreen && controlsActive);
|
|
666
|
+
const interactionOn = overrides.interactiveViewport === true || overrides.controls === true || Boolean(requestedControls.fullscreen && controlsActive) || overrides.interactiveViewport !== false && hasExplicitInteraction;
|
|
667
|
+
const defaultGesture = hasExplicitInteraction ? false : fallbackGesture;
|
|
666
668
|
const gestures = {
|
|
667
|
-
zoom: interactionOn && (interaction.zoom ??
|
|
668
|
-
pan: interactionOn && (interaction.pan ??
|
|
669
|
-
doubleClickToReset: interactionOn && (interaction.doubleClickToReset ??
|
|
669
|
+
zoom: interactionOn && (interaction.zoom ?? defaultGesture),
|
|
670
|
+
pan: interactionOn && (interaction.pan ?? defaultGesture),
|
|
671
|
+
doubleClickToReset: interactionOn && (interaction.doubleClickToReset ?? defaultGesture)
|
|
670
672
|
};
|
|
671
673
|
const interactionEnabled = gestures.zoom || gestures.pan || gestures.doubleClickToReset;
|
|
672
674
|
const configuredSpeeds = configuredControls.speeds?.length ? configuredControls.speeds : [0.25, 1];
|
package/package.json
CHANGED