@guardian/interactive-component-library 0.1.0-alpha.45 → 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
|
}
|
|
@@ -7707,15 +7712,15 @@ function Gradient() {
|
|
|
7707
7712
|
})]
|
|
7708
7713
|
});
|
|
7709
7714
|
}
|
|
7710
|
-
const ticker = "
|
|
7711
|
-
const tickerItems = "
|
|
7712
|
-
const tickerScroll = "
|
|
7713
|
-
const tickerItem = "
|
|
7714
|
-
const controls = "
|
|
7715
|
-
const gradient = "
|
|
7716
|
-
const buttons = "
|
|
7717
|
-
const button = "
|
|
7718
|
-
const buttonInner = "
|
|
7715
|
+
const ticker = "_ticker_1jg88_9";
|
|
7716
|
+
const tickerItems = "_tickerItems_1jg88_21";
|
|
7717
|
+
const tickerScroll = "_tickerScroll_1jg88_26";
|
|
7718
|
+
const tickerItem = "_tickerItem_1jg88_21";
|
|
7719
|
+
const controls = "_controls_1jg88_48";
|
|
7720
|
+
const gradient = "_gradient_1jg88_63";
|
|
7721
|
+
const buttons = "_buttons_1jg88_75";
|
|
7722
|
+
const button = "_button_1jg88_75";
|
|
7723
|
+
const buttonInner = "_buttonInner_1jg88_101";
|
|
7719
7724
|
const styles = {
|
|
7720
7725
|
ticker,
|
|
7721
7726
|
tickerItems,
|
|
@@ -7752,12 +7757,18 @@ function Ticker({
|
|
|
7752
7757
|
setPageWidth(pageWidth2);
|
|
7753
7758
|
const numberOfPages2 = Math.ceil(tickerScrollRef.current.scrollWidth / pageWidth2);
|
|
7754
7759
|
setNumberOfPages(numberOfPages2);
|
|
7755
|
-
}, []);
|
|
7760
|
+
}, [childArray]);
|
|
7756
7761
|
useLayoutEffect(() => {
|
|
7757
7762
|
const hideButtons2 = childArray.length < 4;
|
|
7758
7763
|
setHideButtons(hideButtons2);
|
|
7759
7764
|
}, [childArray]);
|
|
7760
7765
|
function toggleExpandedState() {
|
|
7766
|
+
if (expanded) {
|
|
7767
|
+
tickerRef.current.scrollIntoView({
|
|
7768
|
+
behavior: "smooth",
|
|
7769
|
+
alignToTop: true
|
|
7770
|
+
});
|
|
7771
|
+
}
|
|
7761
7772
|
setExpanded((expanded2) => {
|
|
7762
7773
|
const newState = !expanded2;
|
|
7763
7774
|
if (onStateChange)
|