@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.
@@ -6510,30 +6510,33 @@ class FeatureRenderer {
6510
6510
  this.style = style2;
6511
6511
  }
6512
6512
  render(frameState, feature, context) {
6513
+ if (!this.style) {
6514
+ return;
6515
+ }
6513
6516
  const {
6514
6517
  projection,
6515
6518
  transform,
6516
6519
  pixelRatio
6517
6520
  } = frameState.viewState;
6521
+ const {
6522
+ stroke,
6523
+ fill
6524
+ } = this.style;
6518
6525
  this.drawingFunction.context(context);
6519
6526
  context.beginPath();
6520
6527
  const geometries = feature.getProjectedGeometries(projection);
6521
6528
  for (const geometry of geometries) {
6522
6529
  this.drawingFunction(geometry);
6523
6530
  }
6524
- const {
6525
- stroke,
6526
- fill
6527
- } = this.style;
6531
+ if (fill) {
6532
+ context.fillStyle = fill.getRgba();
6533
+ context.fill();
6534
+ }
6528
6535
  if (stroke) {
6529
6536
  context.lineWidth = stroke.width * pixelRatio / transform.k;
6530
6537
  context.strokeStyle = stroke.getRgba();
6531
6538
  context.stroke();
6532
6539
  }
6533
- if (fill) {
6534
- context.fillStyle = fill.getRgba();
6535
- context.fill();
6536
- }
6537
6540
  }
6538
6541
  }
6539
6542
  const textPadding = {
@@ -6666,6 +6669,13 @@ class Style {
6666
6669
  this.fill = options == null ? void 0 : options.fill;
6667
6670
  this.text = options == null ? void 0 : options.text;
6668
6671
  }
6672
+ clone() {
6673
+ return new Style({
6674
+ stroke: this.stroke,
6675
+ fill: this.fill,
6676
+ text: this.text
6677
+ });
6678
+ }
6669
6679
  }
6670
6680
  function memoise(fn) {
6671
6681
  let called = false;
@@ -7697,15 +7707,15 @@ function Gradient() {
7697
7707
  })]
7698
7708
  });
7699
7709
  }
7700
- const ticker = "_ticker_1as05_9";
7701
- const tickerItems = "_tickerItems_1as05_21";
7702
- const tickerScroll = "_tickerScroll_1as05_26";
7703
- const tickerItem = "_tickerItem_1as05_21";
7704
- const controls = "_controls_1as05_48";
7705
- const gradient = "_gradient_1as05_63";
7706
- const buttons = "_buttons_1as05_75";
7707
- const button = "_button_1as05_75";
7708
- const buttonInner = "_buttonInner_1as05_100";
7710
+ const ticker = "_ticker_1jg88_9";
7711
+ const tickerItems = "_tickerItems_1jg88_21";
7712
+ const tickerScroll = "_tickerScroll_1jg88_26";
7713
+ const tickerItem = "_tickerItem_1jg88_21";
7714
+ const controls = "_controls_1jg88_48";
7715
+ const gradient = "_gradient_1jg88_63";
7716
+ const buttons = "_buttons_1jg88_75";
7717
+ const button = "_button_1jg88_75";
7718
+ const buttonInner = "_buttonInner_1jg88_101";
7709
7719
  const styles = {
7710
7720
  ticker,
7711
7721
  tickerItems,
@@ -7742,12 +7752,18 @@ function Ticker({
7742
7752
  setPageWidth(pageWidth2);
7743
7753
  const numberOfPages2 = Math.ceil(tickerScrollRef.current.scrollWidth / pageWidth2);
7744
7754
  setNumberOfPages(numberOfPages2);
7745
- }, []);
7755
+ }, [childArray]);
7746
7756
  useLayoutEffect(() => {
7747
7757
  const hideButtons2 = childArray.length < 4;
7748
7758
  setHideButtons(hideButtons2);
7749
7759
  }, [childArray]);
7750
7760
  function toggleExpandedState() {
7761
+ if (expanded) {
7762
+ tickerRef.current.scrollIntoView({
7763
+ behavior: "smooth",
7764
+ alignToTop: true
7765
+ });
7766
+ }
7751
7767
  setExpanded((expanded2) => {
7752
7768
  const newState = !expanded2;
7753
7769
  if (onStateChange)