@guardian/interactive-component-library 0.1.0-alpha.46 → 0.1.0-alpha.47
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.
|
@@ -4602,7 +4602,9 @@ class Dispatcher {
|
|
|
4602
4602
|
}
|
|
4603
4603
|
const MapEvent = {
|
|
4604
4604
|
CHANGE: "change",
|
|
4605
|
-
ZOOM: "zoom"
|
|
4605
|
+
ZOOM: "zoom",
|
|
4606
|
+
TRANSITION_START: "transition_start",
|
|
4607
|
+
TRANSITION_END: "transition_end"
|
|
4606
4608
|
};
|
|
4607
4609
|
var noop = { value: () => {
|
|
4608
4610
|
} };
|
|
@@ -5922,10 +5924,8 @@ let Map$2 = class Map2 {
|
|
|
5922
5924
|
this._resizeObserver = new ResizeObserver(() => this._updateSize());
|
|
5923
5925
|
this._resizeObserver.observe(this.target);
|
|
5924
5926
|
this._viewport.addEventListener("touchmove", (event) => {
|
|
5925
|
-
if (event.targetTouches.length < 2) {
|
|
5927
|
+
if (event.targetTouches.length < 2 && this.collaborativeGesturesEnabled) {
|
|
5926
5928
|
this._filterEventCallback(true);
|
|
5927
|
-
} else {
|
|
5928
|
-
event.stopImmediatePropagation();
|
|
5929
5929
|
}
|
|
5930
5930
|
});
|
|
5931
5931
|
}
|
|
@@ -5943,6 +5943,9 @@ let Map$2 = class Map2 {
|
|
|
5943
5943
|
get zoomLevel() {
|
|
5944
5944
|
return this.view.transform.k;
|
|
5945
5945
|
}
|
|
5946
|
+
get isTransitioning() {
|
|
5947
|
+
return this._isTransitioning;
|
|
5948
|
+
}
|
|
5946
5949
|
/** PUBLIC METHODS */
|
|
5947
5950
|
onFilterEvent(callback) {
|
|
5948
5951
|
this._filterEventCallback = callback;
|
|
@@ -6047,6 +6050,7 @@ let Map$2 = class Map2 {
|
|
|
6047
6050
|
const ease = options.ease || ((t) => t);
|
|
6048
6051
|
return new Promise((resolve) => {
|
|
6049
6052
|
this._isTransitioning = true;
|
|
6053
|
+
this.dispatcher.dispatch(MapEvent.TRANSITION_START);
|
|
6050
6054
|
const _timer = timer((elapsed) => {
|
|
6051
6055
|
const t = Math.min(elapsed / options.duration, 1);
|
|
6052
6056
|
callback(ease(t));
|
|
@@ -6054,6 +6058,7 @@ let Map$2 = class Map2 {
|
|
|
6054
6058
|
if (elapsed >= options.duration) {
|
|
6055
6059
|
_timer.stop();
|
|
6056
6060
|
this._isTransitioning = false;
|
|
6061
|
+
this.dispatcher.dispatch(MapEvent.TRANSITION_END);
|
|
6057
6062
|
resolve();
|
|
6058
6063
|
}
|
|
6059
6064
|
});
|
|
@@ -6101,7 +6106,7 @@ let Map$2 = class Map2 {
|
|
|
6101
6106
|
if (event.type === "wheel" && !event[this._zoomBypassKey]) {
|
|
6102
6107
|
return filterEvent(true);
|
|
6103
6108
|
}
|
|
6104
|
-
if ("targetTouches" in event) {
|
|
6109
|
+
if ("targetTouches" in event && this.collaborativeGesturesEnabled) {
|
|
6105
6110
|
if (event.targetTouches.length < 2) {
|
|
6106
6111
|
return false;
|
|
6107
6112
|
}
|