@guardian/interactive-component-library 0.7.0 → 0.7.2

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.
@@ -26,6 +26,9 @@ export class TextLayer {
26
26
  * called with the hovered feature, and the mouse event.
27
27
  *
28
28
  * The callback can optionally return a cleanup function that will be called when the mouse leaves this feature.
29
+ *
30
+ * Note that this callback is attached to the "pointerover" and "pointerout" events, so touch
31
+ * events will not trigger it.
29
32
  * @param {boolean} [params.restyleOnHover] If true, the layer will re-render when the mouse hovers over a feature.
30
33
  *
31
34
  * The provided style function will be called with the `isHovering` parameter set to `true` for the hovered feature.
@@ -89,6 +89,9 @@ class TextLayer {
89
89
  * called with the hovered feature, and the mouse event.
90
90
  *
91
91
  * The callback can optionally return a cleanup function that will be called when the mouse leaves this feature.
92
+ *
93
+ * Note that this callback is attached to the "pointerover" and "pointerout" events, so touch
94
+ * events will not trigger it.
92
95
  * @param {boolean} [params.restyleOnHover] If true, the layer will re-render when the mouse hovers over a feature.
93
96
  *
94
97
  * The provided style function will be called with the `isHovering` parameter set to `true` for the hovered feature.
@@ -276,7 +276,7 @@ class TextLayerRenderer {
276
276
  });
277
277
  }
278
278
  if (this.layer.onHover) {
279
- this._element.addEventListener("mouseover", (event) => {
279
+ this._element.addEventListener("pointerover", (event) => {
280
280
  if (!event.target) return;
281
281
  const hoveredFeature = this.layer.source.getFeatures().find((feature) => {
282
282
  var _a;
@@ -285,14 +285,14 @@ class TextLayerRenderer {
285
285
  if (!hoveredFeature) return;
286
286
  const onHoverLeave = this.layer.onHover(hoveredFeature, event);
287
287
  if (onHoverLeave) {
288
- this._element.addEventListener("mouseout", onHoverLeave, {
288
+ this._element.addEventListener("pointerout", onHoverLeave, {
289
289
  once: true
290
290
  });
291
291
  }
292
292
  });
293
293
  }
294
294
  if (this.layer.restyleOnHover) {
295
- this._element.addEventListener("mouseover", (event) => {
295
+ this._element.addEventListener("pointerover", (event) => {
296
296
  if (!event.target) return;
297
297
  const hoveredFeature = this.layer.source.getFeatures().find((feature) => {
298
298
  var _a;
@@ -302,7 +302,7 @@ class TextLayerRenderer {
302
302
  this._hoveredFeature = hoveredFeature;
303
303
  this.layer.dispatcher.dispatch(MapEvent.CHANGE);
304
304
  this._element.addEventListener(
305
- "mouseout",
305
+ "pointerout",
306
306
  () => {
307
307
  this._hoveredFeature = void 0;
308
308
  this.layer.dispatcher.dispatch(MapEvent.CHANGE);
package/dist/style.css CHANGED
@@ -1359,14 +1359,14 @@ body {
1359
1359
  --new-group-01: #333333;
1360
1360
  --dem: #093ca3;
1361
1361
  --gop: #c70000;
1362
- --oth: #707070;
1362
+ --oth: #4d4d4d;
1363
1363
  --ind-dem: #7378d8;
1364
1364
  --lib: #c6b716;
1365
1365
  --grn: #0da498;
1366
1366
  --ken: #ef6f07;
1367
1367
  --dem-2: #dad7f5;
1368
1368
  --gop-2: #ffdbd4;
1369
- --oth-2: #e7e7e7;
1369
+ --oth-2: #cccccc;
1370
1370
  --ind-dem-2: #dad7f5;
1371
1371
  --lib-2: #f4eac2;
1372
1372
  --grn-2: #cfedea;
@@ -1471,14 +1471,14 @@ body {
1471
1471
  --new-group-01: #cccccc;
1472
1472
  --dem: #3261db;
1473
1473
  --gop: #c70000;
1474
- --oth: #707070;
1474
+ --oth: #cccccc;
1475
1475
  --ind-dem: #7389d8;
1476
1476
  --lib: #c6b716;
1477
1477
  --grn: #23b4a9;
1478
1478
  --ken: #ef6f07;
1479
1479
  --dem-2: #20366d;
1480
1480
  --gop-2: #5a0b0b;
1481
- --oth-2: #333333;
1481
+ --oth-2: #4d4d4d;
1482
1482
  --ind-dem-2: #394261;
1483
1483
  --lib-2: #524d13;
1484
1484
  --grn-2: #19524e;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@guardian/interactive-component-library",
3
3
  "private": false,
4
- "version": "0.7.0",
4
+ "version": "0.7.2",
5
5
  "packageManager": "pnpm@8.4.0",
6
6
  "repository": {
7
7
  "type": "git",