@rocket.chat/fuselage 0.32.0-dev.333 → 0.32.0-dev.334

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.
@@ -6,5 +6,11 @@ export declare const AudioPlayer: React.ForwardRefExoticComponent<{
6
6
  minPlaybackSpeed?: number | undefined;
7
7
  playbackSpeedStep?: number | undefined;
8
8
  download?: boolean | undefined;
9
+ playLabel?: string | undefined;
10
+ pauseLabel?: string | undefined;
11
+ audioPlaybackRangeLabel?: string | undefined;
12
+ reducePlaybackSpeedLabel?: string | undefined;
13
+ increasePlaybackSpeedLabel?: string | undefined;
14
+ downloadAudioFileLabel?: string | undefined;
9
15
  } & React.RefAttributes<HTMLAudioElement>>;
10
16
  //# sourceMappingURL=AudioPlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../src/components/AudioPlayer/AudioPlayer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AA6B5D,eAAO,MAAM,WAAW;SAGf,MAAM;;;;;;0CAmKd,CAAC"}
1
+ {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../src/components/AudioPlayer/AudioPlayer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAuC,MAAM,OAAO,CAAC;AA6B5D,eAAO,MAAM,WAAW;SAGf,MAAM;;;;;;;;;;;;0CAoLd,CAAC"}
@@ -3254,13 +3254,13 @@ function forceDownload(url, fileName) {
3254
3254
  xhr.send();
3255
3255
  }
3256
3256
  var AudioPlayer = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a, ref) {
3257
- var src = _a.src, _b = _a.type, type = _b === void 0 ? 'audio/mpeg' : _b, _c = _a.maxPlaybackSpeed, maxPlaybackSpeed = _c === void 0 ? 2 : _c, _d = _a.minPlaybackSpeed, minPlaybackSpeed = _d === void 0 ? 0.5 : _d, _e = _a.playbackSpeedStep, playbackSpeedStep = _e === void 0 ? 0.5 : _e, _f = _a.download, download = _f === void 0 ? false : _f;
3257
+ var src = _a.src, _b = _a.type, type = _b === void 0 ? 'audio/mpeg' : _b, _c = _a.maxPlaybackSpeed, maxPlaybackSpeed = _c === void 0 ? 2 : _c, _d = _a.minPlaybackSpeed, minPlaybackSpeed = _d === void 0 ? 0.5 : _d, _e = _a.playbackSpeedStep, playbackSpeedStep = _e === void 0 ? 0.5 : _e, _f = _a.download, download = _f === void 0 ? false : _f, _g = _a.playLabel, playLabel = _g === void 0 ? 'Play' : _g, _h = _a.pauseLabel, pauseLabel = _h === void 0 ? 'Pause' : _h, _j = _a.audioPlaybackRangeLabel, audioPlaybackRangeLabel = _j === void 0 ? 'Audio Playback Range' : _j, _k = _a.reducePlaybackSpeedLabel, reducePlaybackSpeedLabel = _k === void 0 ? 'Reduce Playback Speed' : _k, _l = _a.increasePlaybackSpeedLabel, increasePlaybackSpeedLabel = _l === void 0 ? 'Increase Playback Speed' : _l, _m = _a.downloadAudioFileLabel, downloadAudioFileLabel = _m === void 0 ? 'Download Audio File' : _m;
3258
3258
  var audioRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
3259
3259
  var refs = (0,_rocket_chat_fuselage_hooks__WEBPACK_IMPORTED_MODULE_0__.useMergedRefs)(ref, audioRef);
3260
- var _g = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), 2), isPlaying = _g[0], setIsPlaying = _g[1];
3261
- var _h = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), 2), currentTime = _h[0], setCurrentTime = _h[1];
3262
- var _j = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), 2), durationTime = _j[0], setDurationTime = _j[1];
3263
- var _k = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1), 2), playbackSpeed = _k[0], setPlaybackSpeed = _k[1];
3260
+ var _o = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false), 2), isPlaying = _o[0], setIsPlaying = _o[1];
3261
+ var _p = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), 2), currentTime = _p[0], setCurrentTime = _p[1];
3262
+ var _q = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), 2), durationTime = _q[0], setDurationTime = _q[1];
3263
+ var _r = __read((0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1), 2), playbackSpeed = _r[0], setPlaybackSpeed = _r[1];
3264
3264
  var handlePlay = function () {
3265
3265
  var _a, _b, _c;
3266
3266
  var isPlaying = (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.paused;
@@ -3280,9 +3280,9 @@ var AudioPlayer = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a
3280
3280
  var handleDecreasePlayBackSpeed = function () { return handlePlaybackSpeed(-1); };
3281
3281
  return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.Box, { borderWidth: 'default', bg: 'light', borderColor: 'extra-light', p: 'x16', width: 'fit-content', borderRadius: 'x4' },
3282
3282
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.Box, { display: 'flex', alignItems: 'center' },
3283
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { large: true, onClick: handlePlay, icon: isPlaying ? 'pause-unfilled' : 'play-unfilled' }),
3283
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { large: true, onClick: handlePlay, "aria-label": isPlaying ? pauseLabel : playLabel, icon: isPlaying ? 'pause-unfilled' : 'play-unfilled' }),
3284
3284
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.Box, { mi: 'x12', position: 'relative' },
3285
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Slider__WEBPACK_IMPORTED_MODULE_3__.Slider, { showOutput: false, value: currentTime, maxValue: durationTime, onChange: function (value) {
3285
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Slider__WEBPACK_IMPORTED_MODULE_3__.Slider, { "aria-label": audioPlaybackRangeLabel, showOutput: false, value: currentTime, maxValue: durationTime, onChange: function (value) {
3286
3286
  if (audioRef.current) {
3287
3287
  audioRef.current.currentTime = value;
3288
3288
  }
@@ -3291,13 +3291,13 @@ var AudioPlayer = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_a
3291
3291
  getMaskTime(currentTime),
3292
3292
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.Box, { fontScale: 'micro', display: 'flex', justifyContent: 'space-around', id: 'controllers' },
3293
3293
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.Box, { mi: 'x8', display: 'flex', alignItems: 'center', justifyContent: 'space-between' },
3294
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { disabled: playbackSpeed <= minPlaybackSpeed, icon: 'h-bar', mini: true, onClick: handleDecreasePlayBackSpeed }),
3294
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { "aria-label": reducePlaybackSpeedLabel, disabled: playbackSpeed <= minPlaybackSpeed, icon: 'h-bar', mini: true, onClick: handleDecreasePlayBackSpeed }),
3295
3295
  react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.Box, { mi: 'x8' },
3296
3296
  playbackSpeed.toFixed(1),
3297
3297
  "x"),
3298
- react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { disabled: playbackSpeed >= maxPlaybackSpeed, icon: 'plus', mini: true, onClick: handleIncreasePlayBackSpeed }))),
3298
+ react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { "aria-label": increasePlaybackSpeedLabel, disabled: playbackSpeed >= maxPlaybackSpeed, icon: 'plus', mini: true, onClick: handleIncreasePlayBackSpeed }))),
3299
3299
  getMaskTime(durationTime))),
3300
- download && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { is: 'a', href: src, download: true, icon: 'download', large: true, onClick: function (e) {
3300
+ download && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(___WEBPACK_IMPORTED_MODULE_2__.IconButton, { "aria-label": downloadAudioFileLabel, is: 'a', href: src, download: true, icon: 'download', large: true, onClick: function (e) {
3301
3301
  var host = new URL(src).host;
3302
3302
  if (host !== window.location.host) {
3303
3303
  e.preventDefault();