@micromag/element-audio 0.3.310 → 0.3.311

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/es/index.js CHANGED
@@ -96,6 +96,12 @@ function AudioBars(_ref) {
96
96
  var distance = Math.max(0, Math.min(1, (x - elX) / width));
97
97
  setCurrentSeek(distance * elWidth);
98
98
  }, [elRef.current, elWidth, setCurrentSeek]);
99
+ var onClick = useCallback(function (e) {
100
+ if (e) {
101
+ seekFromX(e.clientX || null);
102
+ setCurrentSeek(null);
103
+ }
104
+ }, [seekFromX, setCurrentSeek]);
99
105
  var bind = useGesture({
100
106
  onDrag: function onDrag(_ref2) {
101
107
  var _ref2$xy = _slicedToArray(_ref2.xy, 1),
@@ -164,9 +170,7 @@ function AudioBars(_ref) {
164
170
  strokeLinecap: "round"
165
171
  });
166
172
  })), /*#__PURE__*/React.createElement("button", Object.assign({}, bind(), {
167
- onClick: function onClick(e) {
168
- return e.target !== null ? seekFromX(e.target.clientX) : null;
169
- },
173
+ onClick: onClick,
170
174
  type: "button",
171
175
  className: styles$2.seekButton,
172
176
  title: intl.formatMessage({
@@ -328,8 +332,6 @@ var Audio = function Audio(_ref) {
328
332
  return;
329
333
  }
330
334
 
331
- console.log('fuck off', newTime);
332
-
333
335
  if (isNumber(newTime)) {
334
336
  element.currentTime = newTime;
335
337
  }
package/lib/index.js CHANGED
@@ -111,6 +111,12 @@ function AudioBars(_ref) {
111
111
  var distance = Math.max(0, Math.min(1, (x - elX) / width));
112
112
  setCurrentSeek(distance * elWidth);
113
113
  }, [elRef.current, elWidth, setCurrentSeek]);
114
+ var onClick = React.useCallback(function (e) {
115
+ if (e) {
116
+ seekFromX(e.clientX || null);
117
+ setCurrentSeek(null);
118
+ }
119
+ }, [seekFromX, setCurrentSeek]);
114
120
  var bind = react.useGesture({
115
121
  onDrag: function onDrag(_ref2) {
116
122
  var _ref2$xy = _slicedToArray__default["default"](_ref2.xy, 1),
@@ -179,9 +185,7 @@ function AudioBars(_ref) {
179
185
  strokeLinecap: "round"
180
186
  });
181
187
  })), /*#__PURE__*/React__default["default"].createElement("button", Object.assign({}, bind(), {
182
- onClick: function onClick(e) {
183
- return e.target !== null ? seekFromX(e.target.clientX) : null;
184
- },
188
+ onClick: onClick,
185
189
  type: "button",
186
190
  className: styles$2.seekButton,
187
191
  title: intl.formatMessage({
@@ -343,8 +347,6 @@ var Audio = function Audio(_ref) {
343
347
  return;
344
348
  }
345
349
 
346
- console.log('fuck off', newTime);
347
-
348
350
  if (isNumber__default["default"](newTime)) {
349
351
  element.currentTime = newTime;
350
352
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-audio",
3
- "version": "0.3.310",
3
+ "version": "0.3.311",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -52,9 +52,9 @@
52
52
  "@fortawesome/fontawesome-svg-core": "^1.2.32",
53
53
  "@fortawesome/free-solid-svg-icons": "^5.15.1",
54
54
  "@fortawesome/react-fontawesome": "^0.1.13",
55
- "@micromag/core": "^0.3.307",
56
- "@micromag/element-closed-captions": "^0.3.307",
57
- "@micromag/element-media-controls": "^0.3.307",
55
+ "@micromag/core": "^0.3.311",
56
+ "@micromag/element-closed-captions": "^0.3.311",
57
+ "@micromag/element-media-controls": "^0.3.311",
58
58
  "@react-spring/core": "^9.1.1",
59
59
  "@react-spring/web": "^9.1.1",
60
60
  "@use-gesture/react": "^10.2.4",
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "c2f4fbfcf0f643737a77f99dccf4d353f7856c2c"
71
+ "gitHead": "fab297a7ad204611597c749b969f14d992d35d47"
72
72
  }