@guardian/interactive-component-library 0.4.4 → 0.4.5

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.
@@ -36,14 +36,13 @@ class MapRenderer {
36
36
  }
37
37
  viewState.projection = projection;
38
38
  };
39
- const baseLayers = visibleLayers.filter((layer) => !layer.declutter);
40
- for (const layer of baseLayers) {
41
- renderLayer(layer);
42
- }
43
39
  const declutterTree = new RBush();
44
- const layersToDeclutter = [...visibleLayers].filter((layer) => !!layer.declutter).reverse();
45
- for (const layer of layersToDeclutter) {
46
- renderLayer(layer, declutterTree);
40
+ for (const layer of visibleLayers) {
41
+ if (layer.declutter) {
42
+ renderLayer(layer, declutterTree);
43
+ } else {
44
+ renderLayer(layer);
45
+ }
47
46
  }
48
47
  replaceChildren(this._element, mapElements);
49
48
  }
@@ -43,10 +43,12 @@ class TextLayerRenderer {
43
43
  x: relativeX * viewPortSize[0],
44
44
  y: relativeY * viewPortSize[1]
45
45
  });
46
- if (declutterTree.collides(bbox)) {
47
- continue;
46
+ if (declutterTree) {
47
+ if (declutterTree.collides(bbox)) {
48
+ continue;
49
+ }
50
+ declutterTree.insert(bbox);
48
51
  }
49
- declutterTree.insert(bbox);
50
52
  if (this.layer.drawCollisionBoxes) {
51
53
  const collisionBoxDebugElement = this.getCollisionBoxElement(bbox);
52
54
  textElements.push(collisionBoxDebugElement);
@@ -1,13 +1,13 @@
1
- const optionPicker = "_optionPicker_1b561_1";
2
- const title = "_title_1b561_13";
3
- const options = "_options_1b561_20";
4
- const option = "_option_1b561_1";
5
- const selected = "_selected_1b561_46";
6
- const optionIconContainer = "_optionIconContainer_1b561_55";
7
- const optionIcon = "_optionIcon_1b561_55";
8
- const optionTitle = "_optionTitle_1b561_67";
9
- const checkmark = "_checkmark_1b561_78";
10
- const checkmarkPath = "_checkmarkPath_1b561_82";
1
+ const optionPicker = "_optionPicker_1c1rh_1";
2
+ const title = "_title_1c1rh_13";
3
+ const options = "_options_1c1rh_20";
4
+ const option = "_option_1c1rh_1";
5
+ const selected = "_selected_1c1rh_47";
6
+ const optionIconContainer = "_optionIconContainer_1c1rh_56";
7
+ const optionIcon = "_optionIcon_1c1rh_56";
8
+ const optionTitle = "_optionTitle_1c1rh_68";
9
+ const checkmark = "_checkmark_1c1rh_79";
10
+ const checkmarkPath = "_checkmarkPath_1c1rh_83";
11
11
  const defaultStyles = {
12
12
  optionPicker,
13
13
  title,
package/dist/style.css CHANGED
@@ -3009,7 +3009,7 @@ body.android {
3009
3009
  cursor: auto;
3010
3010
  background-color: var(--tertiary-bg-color);
3011
3011
  }
3012
- ._optionPicker_1b561_1 {
3012
+ ._optionPicker_1c1rh_1 {
3013
3013
  background-color: rgba(255, 255, 255, 0.6);
3014
3014
  border: 1px solid var(--border-divider-color);
3015
3015
  border-radius: 8px;
@@ -3021,31 +3021,32 @@ body.android {
3021
3021
  row-gap: 4px;
3022
3022
  }
3023
3023
 
3024
- ._title_1b561_13 {
3024
+ ._title_1c1rh_13 {
3025
3025
  color: var(--secondary-text-color);
3026
3026
  font-family: var(--text-sans);
3027
3027
  font-size: var(--sans-xxsmall);
3028
3028
  line-height: var(--sans-line-height);
3029
3029
  }
3030
3030
 
3031
- ._options_1b561_20 {
3031
+ ._options_1c1rh_20 {
3032
3032
  display: flex;
3033
3033
  flex-direction: row;
3034
3034
  justify-content: stretch;
3035
3035
  gap: var(--space-2);
3036
3036
  }
3037
3037
 
3038
- ._options_1b561_20.vertical {
3038
+ ._options_1c1rh_20.vertical {
3039
3039
  flex-direction: column;
3040
3040
  }
3041
3041
 
3042
- ._option_1b561_1 {
3042
+ ._option_1c1rh_1 {
3043
+ flex: 1;
3044
+
3043
3045
  display: flex;
3044
3046
  flex-direction: column;
3045
3047
  align-items: center;
3046
3048
  gap: var(--space-2);
3047
3049
  min-height: 70px;
3048
- max-width: 124px;
3049
3050
 
3050
3051
  border: 1px solid var(--border-divider-color);
3051
3052
  border-radius: 8px;
@@ -3054,16 +3055,16 @@ body.android {
3054
3055
  background-color: var(--primary-bg-color);
3055
3056
  }
3056
3057
 
3057
- ._option_1b561_1._selected_1b561_46 {
3058
+ ._option_1c1rh_1._selected_1c1rh_47 {
3058
3059
  border: 1px solid var(--primary-text-color);
3059
3060
  }
3060
3061
 
3061
- ._option_1b561_1:hover:enabled {
3062
+ ._option_1c1rh_1:hover:enabled {
3062
3063
  background-color: var(--news-grey-05);
3063
3064
  cursor: pointer;
3064
3065
  }
3065
3066
 
3066
- ._optionIconContainer_1b561_55 {
3067
+ ._optionIconContainer_1c1rh_56 {
3067
3068
  width: 100%;
3068
3069
  display: flex;
3069
3070
  flex-direction: row;
@@ -3071,26 +3072,26 @@ body.android {
3071
3072
  gap: var(--space-1);
3072
3073
  }
3073
3074
 
3074
- ._optionIcon_1b561_55 {
3075
+ ._optionIcon_1c1rh_56 {
3075
3076
  width: 100%;
3076
3077
  }
3077
3078
 
3078
- ._optionTitle_1b561_67 {
3079
+ ._optionTitle_1c1rh_68 {
3079
3080
  color: var(--primary-text-color);
3080
3081
  font-family: var(--text-sans);
3081
3082
  font-size: var(--sans-xxsmall);
3082
3083
  line-height: var(--sans-line-height);
3083
3084
  }
3084
3085
 
3085
- ._option_1b561_1._selected_1b561_46 ._optionTitle_1b561_67 {
3086
+ ._option_1c1rh_1._selected_1c1rh_47 ._optionTitle_1c1rh_68 {
3086
3087
  font-weight: 700;
3087
3088
  }
3088
3089
 
3089
- ._checkmark_1b561_78 {
3090
+ ._checkmark_1c1rh_79 {
3090
3091
  width: 11px;
3091
3092
  }
3092
3093
 
3093
- ._checkmarkPath_1b561_82 {
3094
+ ._checkmarkPath_1c1rh_83 {
3094
3095
  fill: var(--primary-text-color);
3095
3096
  }
3096
3097
  body {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guardian/interactive-component-library",
3
3
  "private": false,
4
- "version": "0.4.4",
4
+ "version": "0.4.5",
5
5
  "packageManager": "pnpm@8.4.0",
6
6
  "repository": {
7
7
  "type": "git",