@playkit-js/hotspots 3.1.0 → 3.1.1-canary.2-da81074

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playkit-js/hotspots",
3
- "version": "3.1.0",
3
+ "version": "3.1.1-canary.2-da81074",
4
4
  "private": false,
5
5
  "bugs": {
6
6
  "url": "https://github.com/kaltura/playkit-js-hotspots/issues"
@@ -11,7 +11,7 @@
11
11
  "url": "git+https://github.com/kaltura/playkit-js-hotspots.git"
12
12
  },
13
13
  "dependencies": {
14
- "@playkit-js/common": "^1.0.5"
14
+ "@playkit-js/common": "^1.0.7"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@typescript-eslint/eslint-plugin": "^5.23.0",
@@ -1,4 +1,5 @@
1
1
  import {h, Component} from 'preact';
2
+ import {A11yWrapper} from '@playkit-js/common';
2
3
  import {LayoutHotspot} from '../utils/hotspot';
3
4
  import {AnalyticsEvents} from '../utils/analyticsEvents';
4
5
 
@@ -71,12 +72,6 @@ export default class Hotspot extends Component<Props, State> {
71
72
  });
72
73
  }
73
74
 
74
- handleKeyUp = (event: any) => {
75
- if (event.keyCode === 13) {
76
- this.handleClick();
77
- }
78
- };
79
-
80
75
  isClickable = (): boolean => {
81
76
  const {
82
77
  hotspot: {onClick}
@@ -177,16 +172,11 @@ export default class Hotspot extends Component<Props, State> {
177
172
  };
178
173
 
179
174
  return (
180
- <div
181
- onClick={this.handleClick}
182
- onKeyUp={this.handleKeyUp}
183
- tabIndex={0}
184
- aria-label={label}
185
- aria-disabled={disableClick}
186
- role="button"
187
- style={containerStyles}>
188
- <div style={buttonStyles}>{label}</div>
189
- </div>
175
+ <A11yWrapper onClick={this.handleClick}>
176
+ <div tabIndex={0} aria-label={label} aria-disabled={disableClick} role="button" style={containerStyles}>
177
+ <div style={buttonStyles}>{label}</div>
178
+ </div>
179
+ </A11yWrapper>
190
180
  );
191
181
  }
192
182
  }
@@ -40,6 +40,6 @@ export default class HotspotWrapper extends Component<Props> {
40
40
  const {hotspots} = this.props;
41
41
  const hotspotsElements = this.renderHotspots(hotspots);
42
42
 
43
- return <div style={hotspotsContainerStyles}>{hotspotsElements}</div>;
43
+ return <div style={hotspotsContainerStyles} aria-live="polite">{hotspotsElements}</div>;
44
44
  }
45
45
  }