@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.
|
@@ -4598,7 +4598,9 @@
|
|
|
4598
4598
|
}
|
|
4599
4599
|
const MapEvent = {
|
|
4600
4600
|
CHANGE: "change",
|
|
4601
|
-
ZOOM: "zoom"
|
|
4601
|
+
ZOOM: "zoom",
|
|
4602
|
+
TRANSITION_START: "transition_start",
|
|
4603
|
+
TRANSITION_END: "transition_end"
|
|
4602
4604
|
};
|
|
4603
4605
|
var noop = { value: () => {
|
|
4604
4606
|
} };
|
|
@@ -5918,10 +5920,8 @@
|
|
|
5918
5920
|
this._resizeObserver = new ResizeObserver(() => this._updateSize());
|
|
5919
5921
|
this._resizeObserver.observe(this.target);
|
|
5920
5922
|
this._viewport.addEventListener("touchmove", (event) => {
|
|
5921
|
-
if (event.targetTouches.length < 2) {
|
|
5923
|
+
if (event.targetTouches.length < 2 && this.collaborativeGesturesEnabled) {
|
|
5922
5924
|
this._filterEventCallback(true);
|
|
5923
|
-
} else {
|
|
5924
|
-
event.stopImmediatePropagation();
|
|
5925
5925
|
}
|
|
5926
5926
|
});
|
|
5927
5927
|
}
|
|
@@ -5939,6 +5939,9 @@
|
|
|
5939
5939
|
get zoomLevel() {
|
|
5940
5940
|
return this.view.transform.k;
|
|
5941
5941
|
}
|
|
5942
|
+
get isTransitioning() {
|
|
5943
|
+
return this._isTransitioning;
|
|
5944
|
+
}
|
|
5942
5945
|
/** PUBLIC METHODS */
|
|
5943
5946
|
onFilterEvent(callback) {
|
|
5944
5947
|
this._filterEventCallback = callback;
|
|
@@ -6043,6 +6046,7 @@
|
|
|
6043
6046
|
const ease = options.ease || ((t) => t);
|
|
6044
6047
|
return new Promise((resolve) => {
|
|
6045
6048
|
this._isTransitioning = true;
|
|
6049
|
+
this.dispatcher.dispatch(MapEvent.TRANSITION_START);
|
|
6046
6050
|
const _timer = timer((elapsed) => {
|
|
6047
6051
|
const t = Math.min(elapsed / options.duration, 1);
|
|
6048
6052
|
callback(ease(t));
|
|
@@ -6050,6 +6054,7 @@
|
|
|
6050
6054
|
if (elapsed >= options.duration) {
|
|
6051
6055
|
_timer.stop();
|
|
6052
6056
|
this._isTransitioning = false;
|
|
6057
|
+
this.dispatcher.dispatch(MapEvent.TRANSITION_END);
|
|
6053
6058
|
resolve();
|
|
6054
6059
|
}
|
|
6055
6060
|
});
|
|
@@ -6097,7 +6102,7 @@
|
|
|
6097
6102
|
if (event.type === "wheel" && !event[this._zoomBypassKey]) {
|
|
6098
6103
|
return filterEvent(true);
|
|
6099
6104
|
}
|
|
6100
|
-
if ("targetTouches" in event) {
|
|
6105
|
+
if ("targetTouches" in event && this.collaborativeGesturesEnabled) {
|
|
6101
6106
|
if (event.targetTouches.length < 2) {
|
|
6102
6107
|
return false;
|
|
6103
6108
|
}
|