@guardian/interactive-component-library 0.1.0-alpha.44 → 0.1.0-alpha.46
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.
|
@@ -6506,30 +6506,33 @@
|
|
|
6506
6506
|
this.style = style;
|
|
6507
6507
|
}
|
|
6508
6508
|
render(frameState, feature, context) {
|
|
6509
|
+
if (!this.style) {
|
|
6510
|
+
return;
|
|
6511
|
+
}
|
|
6509
6512
|
const {
|
|
6510
6513
|
projection,
|
|
6511
6514
|
transform,
|
|
6512
6515
|
pixelRatio
|
|
6513
6516
|
} = frameState.viewState;
|
|
6517
|
+
const {
|
|
6518
|
+
stroke,
|
|
6519
|
+
fill
|
|
6520
|
+
} = this.style;
|
|
6514
6521
|
this.drawingFunction.context(context);
|
|
6515
6522
|
context.beginPath();
|
|
6516
6523
|
const geometries = feature.getProjectedGeometries(projection);
|
|
6517
6524
|
for (const geometry of geometries) {
|
|
6518
6525
|
this.drawingFunction(geometry);
|
|
6519
6526
|
}
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
fill
|
|
6523
|
-
}
|
|
6527
|
+
if (fill) {
|
|
6528
|
+
context.fillStyle = fill.getRgba();
|
|
6529
|
+
context.fill();
|
|
6530
|
+
}
|
|
6524
6531
|
if (stroke) {
|
|
6525
6532
|
context.lineWidth = stroke.width * pixelRatio / transform.k;
|
|
6526
6533
|
context.strokeStyle = stroke.getRgba();
|
|
6527
6534
|
context.stroke();
|
|
6528
6535
|
}
|
|
6529
|
-
if (fill) {
|
|
6530
|
-
context.fillStyle = fill.getRgba();
|
|
6531
|
-
context.fill();
|
|
6532
|
-
}
|
|
6533
6536
|
}
|
|
6534
6537
|
}
|
|
6535
6538
|
const textPadding = {
|
|
@@ -6662,6 +6665,13 @@
|
|
|
6662
6665
|
this.fill = options == null ? void 0 : options.fill;
|
|
6663
6666
|
this.text = options == null ? void 0 : options.text;
|
|
6664
6667
|
}
|
|
6668
|
+
clone() {
|
|
6669
|
+
return new Style({
|
|
6670
|
+
stroke: this.stroke,
|
|
6671
|
+
fill: this.fill,
|
|
6672
|
+
text: this.text
|
|
6673
|
+
});
|
|
6674
|
+
}
|
|
6665
6675
|
}
|
|
6666
6676
|
function memoise(fn) {
|
|
6667
6677
|
let called = false;
|
|
@@ -7693,15 +7703,15 @@
|
|
|
7693
7703
|
})]
|
|
7694
7704
|
});
|
|
7695
7705
|
}
|
|
7696
|
-
const ticker = "
|
|
7697
|
-
const tickerItems = "
|
|
7698
|
-
const tickerScroll = "
|
|
7699
|
-
const tickerItem = "
|
|
7700
|
-
const controls = "
|
|
7701
|
-
const gradient = "
|
|
7702
|
-
const buttons = "
|
|
7703
|
-
const button = "
|
|
7704
|
-
const buttonInner = "
|
|
7706
|
+
const ticker = "_ticker_1jg88_9";
|
|
7707
|
+
const tickerItems = "_tickerItems_1jg88_21";
|
|
7708
|
+
const tickerScroll = "_tickerScroll_1jg88_26";
|
|
7709
|
+
const tickerItem = "_tickerItem_1jg88_21";
|
|
7710
|
+
const controls = "_controls_1jg88_48";
|
|
7711
|
+
const gradient = "_gradient_1jg88_63";
|
|
7712
|
+
const buttons = "_buttons_1jg88_75";
|
|
7713
|
+
const button = "_button_1jg88_75";
|
|
7714
|
+
const buttonInner = "_buttonInner_1jg88_101";
|
|
7705
7715
|
const styles = {
|
|
7706
7716
|
ticker,
|
|
7707
7717
|
tickerItems,
|
|
@@ -7738,12 +7748,18 @@
|
|
|
7738
7748
|
setPageWidth(pageWidth2);
|
|
7739
7749
|
const numberOfPages2 = Math.ceil(tickerScrollRef.current.scrollWidth / pageWidth2);
|
|
7740
7750
|
setNumberOfPages(numberOfPages2);
|
|
7741
|
-
}, []);
|
|
7751
|
+
}, [childArray]);
|
|
7742
7752
|
hooks.useLayoutEffect(() => {
|
|
7743
7753
|
const hideButtons2 = childArray.length < 4;
|
|
7744
7754
|
setHideButtons(hideButtons2);
|
|
7745
7755
|
}, [childArray]);
|
|
7746
7756
|
function toggleExpandedState() {
|
|
7757
|
+
if (expanded) {
|
|
7758
|
+
tickerRef.current.scrollIntoView({
|
|
7759
|
+
behavior: "smooth",
|
|
7760
|
+
alignToTop: true
|
|
7761
|
+
});
|
|
7762
|
+
}
|
|
7747
7763
|
setExpanded((expanded2) => {
|
|
7748
7764
|
const newState = !expanded2;
|
|
7749
7765
|
if (onStateChange)
|