@popmenu/common-ui 0.17.0 → 0.18.0
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/build/components/AudioPlayer/util/index.d.ts +0 -1
- package/build/components/AudioPlayer/util/setupAudioRef.d.ts +1 -1
- package/build/components/AudioPlayer/util/types.d.ts +6 -3
- package/build/components/Table/TableProps.d.ts +2 -0
- package/build/index.es.js +222 -199
- package/build/index.es.js.map +1 -1
- package/build/index.js +222 -199
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/build/components/AudioPlayer/util/usePlaybackIcon.d.ts +0 -2
package/build/index.js
CHANGED
|
@@ -76,8 +76,8 @@ function _interopNamespace(e) {
|
|
|
76
76
|
|
|
77
77
|
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
78
78
|
var AppBar__default = /*#__PURE__*/_interopDefaultLegacy(AppBar);
|
|
79
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
80
79
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
80
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
81
81
|
var MuiIconButton__default = /*#__PURE__*/_interopDefaultLegacy(MuiIconButton);
|
|
82
82
|
var MuiTypography__default = /*#__PURE__*/_interopDefaultLegacy(MuiTypography);
|
|
83
83
|
var MuiAvatar__default = /*#__PURE__*/_interopDefaultLegacy(MuiAvatar);
|
|
@@ -170,6 +170,168 @@ function __spreadArray(to, from, pack) {
|
|
|
170
170
|
return to.concat(ar || from);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
var _path$3K;
|
|
174
|
+
|
|
175
|
+
function _extends$3$() { _extends$3$ = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3$.apply(this, arguments); }
|
|
176
|
+
|
|
177
|
+
function SvgMore(props) {
|
|
178
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3$({
|
|
179
|
+
viewBox: "0 0 16 16",
|
|
180
|
+
strokeLinecap: "round",
|
|
181
|
+
strokeLinejoin: "round",
|
|
182
|
+
stroke: "currentColor",
|
|
183
|
+
width: "1em",
|
|
184
|
+
height: "1em",
|
|
185
|
+
fill: "none"
|
|
186
|
+
}, props), _path$3K || (_path$3K = /*#__PURE__*/React__namespace.createElement("path", {
|
|
187
|
+
d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.333A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z"
|
|
188
|
+
})));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
var _path$2X;
|
|
192
|
+
|
|
193
|
+
function _extends$3b() { _extends$3b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3b.apply(this, arguments); }
|
|
194
|
+
|
|
195
|
+
function SvgChevronDown(props) {
|
|
196
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3b({
|
|
197
|
+
viewBox: "0 0 16 16",
|
|
198
|
+
strokeLinecap: "round",
|
|
199
|
+
strokeLinejoin: "round",
|
|
200
|
+
stroke: "currentColor",
|
|
201
|
+
width: "1em",
|
|
202
|
+
height: "1em",
|
|
203
|
+
fill: "none"
|
|
204
|
+
}, props), _path$2X || (_path$2X = /*#__PURE__*/React__namespace.createElement("path", {
|
|
205
|
+
d: "M4 6l4 4 4-4"
|
|
206
|
+
})));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var _path$2W;
|
|
210
|
+
|
|
211
|
+
function _extends$3a() { _extends$3a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3a.apply(this, arguments); }
|
|
212
|
+
|
|
213
|
+
function SvgChevronUp(props) {
|
|
214
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3a({
|
|
215
|
+
viewBox: "0 0 16 16",
|
|
216
|
+
strokeLinecap: "round",
|
|
217
|
+
strokeLinejoin: "round",
|
|
218
|
+
stroke: "currentColor",
|
|
219
|
+
width: "1em",
|
|
220
|
+
height: "1em",
|
|
221
|
+
fill: "none"
|
|
222
|
+
}, props), _path$2W || (_path$2W = /*#__PURE__*/React__namespace.createElement("path", {
|
|
223
|
+
d: "M12 10L8 6l-4 4"
|
|
224
|
+
})));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
var _path$1f;
|
|
228
|
+
|
|
229
|
+
function _extends$1p() { _extends$1p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1p.apply(this, arguments); }
|
|
230
|
+
|
|
231
|
+
function SvgPause(props) {
|
|
232
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1p({
|
|
233
|
+
viewBox: "0 0 16 16",
|
|
234
|
+
strokeLinecap: "round",
|
|
235
|
+
strokeLinejoin: "round",
|
|
236
|
+
stroke: "currentColor",
|
|
237
|
+
width: "1em",
|
|
238
|
+
height: "1em",
|
|
239
|
+
fill: "none"
|
|
240
|
+
}, props), _path$1f || (_path$1f = /*#__PURE__*/React__namespace.createElement("path", {
|
|
241
|
+
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
242
|
+
})));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
var _path$1d;
|
|
246
|
+
|
|
247
|
+
function _extends$1n() { _extends$1n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1n.apply(this, arguments); }
|
|
248
|
+
|
|
249
|
+
function SvgPlay(props) {
|
|
250
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1n({
|
|
251
|
+
viewBox: "0 0 16 16",
|
|
252
|
+
strokeLinecap: "round",
|
|
253
|
+
strokeLinejoin: "round",
|
|
254
|
+
stroke: "currentColor",
|
|
255
|
+
width: "1em",
|
|
256
|
+
height: "1em",
|
|
257
|
+
fill: "none"
|
|
258
|
+
}, props), _path$1d || (_path$1d = /*#__PURE__*/React__namespace.createElement("path", {
|
|
259
|
+
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
260
|
+
})));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
var _path$10;
|
|
264
|
+
|
|
265
|
+
function _extends$1a() { _extends$1a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1a.apply(this, arguments); }
|
|
266
|
+
|
|
267
|
+
function SvgVolumeDown(props) {
|
|
268
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({
|
|
269
|
+
viewBox: "0 0 16 16",
|
|
270
|
+
strokeLinecap: "round",
|
|
271
|
+
strokeLinejoin: "round",
|
|
272
|
+
stroke: "currentColor",
|
|
273
|
+
width: "1em",
|
|
274
|
+
height: "1em",
|
|
275
|
+
fill: "none"
|
|
276
|
+
}, props), _path$10 || (_path$10 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
277
|
+
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
278
|
+
})));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
var _path$$;
|
|
282
|
+
|
|
283
|
+
function _extends$19() { _extends$19 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$19.apply(this, arguments); }
|
|
284
|
+
|
|
285
|
+
function SvgVolumeMute(props) {
|
|
286
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({
|
|
287
|
+
viewBox: "0 0 16 16",
|
|
288
|
+
strokeLinecap: "round",
|
|
289
|
+
strokeLinejoin: "round",
|
|
290
|
+
stroke: "currentColor",
|
|
291
|
+
width: "1em",
|
|
292
|
+
height: "1em",
|
|
293
|
+
fill: "none"
|
|
294
|
+
}, props), _path$$ || (_path$$ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
295
|
+
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
|
|
296
|
+
})));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
var _path$_;
|
|
300
|
+
|
|
301
|
+
function _extends$18() { _extends$18 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$18.apply(this, arguments); }
|
|
302
|
+
|
|
303
|
+
function SvgVolumeOff(props) {
|
|
304
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$18({
|
|
305
|
+
viewBox: "0 0 16 16",
|
|
306
|
+
strokeLinecap: "round",
|
|
307
|
+
strokeLinejoin: "round",
|
|
308
|
+
stroke: "currentColor",
|
|
309
|
+
width: "1em",
|
|
310
|
+
height: "1em",
|
|
311
|
+
fill: "none"
|
|
312
|
+
}, props), _path$_ || (_path$_ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
313
|
+
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
|
|
314
|
+
})));
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
var _path$Z;
|
|
318
|
+
|
|
319
|
+
function _extends$17() { _extends$17 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$17.apply(this, arguments); }
|
|
320
|
+
|
|
321
|
+
function SvgVolumeUp(props) {
|
|
322
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$17({
|
|
323
|
+
viewBox: "0 0 16 16",
|
|
324
|
+
strokeLinecap: "round",
|
|
325
|
+
strokeLinejoin: "round",
|
|
326
|
+
stroke: "currentColor",
|
|
327
|
+
width: "1em",
|
|
328
|
+
height: "1em",
|
|
329
|
+
fill: "none"
|
|
330
|
+
}, props), _path$Z || (_path$Z = /*#__PURE__*/React__namespace.createElement("path", {
|
|
331
|
+
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713"
|
|
332
|
+
})));
|
|
333
|
+
}
|
|
334
|
+
|
|
173
335
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
174
336
|
|
|
175
337
|
var classnames = {exports: {}};
|
|
@@ -1583,11 +1745,11 @@ var AUDIO_PLAYER_EVENT_TYPES;
|
|
|
1583
1745
|
AUDIO_PLAYER_EVENT_TYPES["DURATION_CHANGE"] = "DURATION_CHANGE";
|
|
1584
1746
|
AUDIO_PLAYER_EVENT_TYPES["SET_TIME"] = "SET_TIME";
|
|
1585
1747
|
AUDIO_PLAYER_EVENT_TYPES["CAN_PLAY"] = "CAN_PLAY";
|
|
1748
|
+
AUDIO_PLAYER_EVENT_TYPES["RESET"] = "RESET";
|
|
1586
1749
|
})(AUDIO_PLAYER_EVENT_TYPES || (AUDIO_PLAYER_EVENT_TYPES = {}));
|
|
1587
1750
|
var PLAYBACK_STATES;
|
|
1588
1751
|
(function (PLAYBACK_STATES) {
|
|
1589
1752
|
PLAYBACK_STATES["NONE"] = "NONE";
|
|
1590
|
-
PLAYBACK_STATES["PLAYABLE"] = "PLAYABLE";
|
|
1591
1753
|
PLAYBACK_STATES["PAUSED"] = "PAUSED";
|
|
1592
1754
|
PLAYBACK_STATES["PLAYING"] = "PLAYING";
|
|
1593
1755
|
})(PLAYBACK_STATES || (PLAYBACK_STATES = {}));
|
|
@@ -1613,22 +1775,38 @@ var initialAudioPlayerState = {
|
|
|
1613
1775
|
volumeButtonLabel: CONTROL_LABELS.MUTE,
|
|
1614
1776
|
},
|
|
1615
1777
|
};
|
|
1778
|
+
var getPlayback = function (_a) {
|
|
1779
|
+
var audio = _a.current;
|
|
1780
|
+
var playback = PLAYBACK_STATES.NONE;
|
|
1781
|
+
if (audio) {
|
|
1782
|
+
var paused = audio.paused, readyState = audio.readyState;
|
|
1783
|
+
if (readyState === 0) {
|
|
1784
|
+
playback = PLAYBACK_STATES.NONE;
|
|
1785
|
+
}
|
|
1786
|
+
else if (paused) {
|
|
1787
|
+
playback = PLAYBACK_STATES.PAUSED;
|
|
1788
|
+
}
|
|
1789
|
+
else {
|
|
1790
|
+
playback = PLAYBACK_STATES.PLAYING;
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
return playback;
|
|
1794
|
+
};
|
|
1616
1795
|
var audioPlayerReducer = function (state, event) {
|
|
1617
1796
|
var _a, _b;
|
|
1618
|
-
console.log(event.type);
|
|
1619
1797
|
var audioRef = state.context.audioRef;
|
|
1620
1798
|
var nextState = __assign({}, state);
|
|
1621
1799
|
switch (state.playback) {
|
|
1622
1800
|
case PLAYBACK_STATES.NONE:
|
|
1623
1801
|
if (event.type === AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY) {
|
|
1624
|
-
nextState.playback =
|
|
1802
|
+
nextState.playback = getPlayback(audioRef);
|
|
1625
1803
|
return nextState;
|
|
1626
1804
|
}
|
|
1627
1805
|
break;
|
|
1628
1806
|
case PLAYBACK_STATES.PAUSED:
|
|
1629
1807
|
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
1630
1808
|
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
1631
|
-
nextState.playback =
|
|
1809
|
+
nextState.playback = getPlayback(audioRef);
|
|
1632
1810
|
nextState.context.playbackButtonLabel = CONTROL_LABELS.PAUSE;
|
|
1633
1811
|
return nextState;
|
|
1634
1812
|
}
|
|
@@ -1636,12 +1814,11 @@ var audioPlayerReducer = function (state, event) {
|
|
|
1636
1814
|
case PLAYBACK_STATES.PLAYING:
|
|
1637
1815
|
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
|
|
1638
1816
|
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
|
1639
|
-
nextState.playback =
|
|
1817
|
+
nextState.playback = getPlayback(audioRef);
|
|
1640
1818
|
nextState.context.playbackButtonLabel = CONTROL_LABELS.PLAY;
|
|
1641
1819
|
return nextState;
|
|
1642
1820
|
}
|
|
1643
1821
|
if (event.type === AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE) {
|
|
1644
|
-
// time change is managed by audioRef automatically, return state to force re-render so ui stays synced
|
|
1645
1822
|
return nextState;
|
|
1646
1823
|
}
|
|
1647
1824
|
break;
|
|
@@ -1682,183 +1859,17 @@ var audioPlayerReducer = function (state, event) {
|
|
|
1682
1859
|
return nextState;
|
|
1683
1860
|
}
|
|
1684
1861
|
break;
|
|
1862
|
+
case AUDIO_PLAYER_EVENT_TYPES.RESET:
|
|
1863
|
+
if (audioRef.current) {
|
|
1864
|
+
audioRef.current.currentTime = 0;
|
|
1865
|
+
nextState.playback = getPlayback(audioRef);
|
|
1866
|
+
return nextState;
|
|
1867
|
+
}
|
|
1868
|
+
break;
|
|
1685
1869
|
}
|
|
1686
1870
|
return state;
|
|
1687
1871
|
};
|
|
1688
1872
|
|
|
1689
|
-
var _path$3K;
|
|
1690
|
-
|
|
1691
|
-
function _extends$3$() { _extends$3$ = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3$.apply(this, arguments); }
|
|
1692
|
-
|
|
1693
|
-
function SvgMore(props) {
|
|
1694
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3$({
|
|
1695
|
-
viewBox: "0 0 16 16",
|
|
1696
|
-
strokeLinecap: "round",
|
|
1697
|
-
strokeLinejoin: "round",
|
|
1698
|
-
stroke: "currentColor",
|
|
1699
|
-
width: "1em",
|
|
1700
|
-
height: "1em",
|
|
1701
|
-
fill: "none"
|
|
1702
|
-
}, props), _path$3K || (_path$3K = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1703
|
-
d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.333A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z"
|
|
1704
|
-
})));
|
|
1705
|
-
}
|
|
1706
|
-
|
|
1707
|
-
var _path$2X;
|
|
1708
|
-
|
|
1709
|
-
function _extends$3b() { _extends$3b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3b.apply(this, arguments); }
|
|
1710
|
-
|
|
1711
|
-
function SvgChevronDown(props) {
|
|
1712
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3b({
|
|
1713
|
-
viewBox: "0 0 16 16",
|
|
1714
|
-
strokeLinecap: "round",
|
|
1715
|
-
strokeLinejoin: "round",
|
|
1716
|
-
stroke: "currentColor",
|
|
1717
|
-
width: "1em",
|
|
1718
|
-
height: "1em",
|
|
1719
|
-
fill: "none"
|
|
1720
|
-
}, props), _path$2X || (_path$2X = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1721
|
-
d: "M4 6l4 4 4-4"
|
|
1722
|
-
})));
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
var _path$2W;
|
|
1726
|
-
|
|
1727
|
-
function _extends$3a() { _extends$3a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3a.apply(this, arguments); }
|
|
1728
|
-
|
|
1729
|
-
function SvgChevronUp(props) {
|
|
1730
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3a({
|
|
1731
|
-
viewBox: "0 0 16 16",
|
|
1732
|
-
strokeLinecap: "round",
|
|
1733
|
-
strokeLinejoin: "round",
|
|
1734
|
-
stroke: "currentColor",
|
|
1735
|
-
width: "1em",
|
|
1736
|
-
height: "1em",
|
|
1737
|
-
fill: "none"
|
|
1738
|
-
}, props), _path$2W || (_path$2W = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1739
|
-
d: "M12 10L8 6l-4 4"
|
|
1740
|
-
})));
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
var _path$1f;
|
|
1744
|
-
|
|
1745
|
-
function _extends$1p() { _extends$1p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1p.apply(this, arguments); }
|
|
1746
|
-
|
|
1747
|
-
function SvgPause(props) {
|
|
1748
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1p({
|
|
1749
|
-
viewBox: "0 0 16 16",
|
|
1750
|
-
strokeLinecap: "round",
|
|
1751
|
-
strokeLinejoin: "round",
|
|
1752
|
-
stroke: "currentColor",
|
|
1753
|
-
width: "1em",
|
|
1754
|
-
height: "1em",
|
|
1755
|
-
fill: "none"
|
|
1756
|
-
}, props), _path$1f || (_path$1f = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1757
|
-
d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
|
|
1758
|
-
})));
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
var _path$1d;
|
|
1762
|
-
|
|
1763
|
-
function _extends$1n() { _extends$1n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1n.apply(this, arguments); }
|
|
1764
|
-
|
|
1765
|
-
function SvgPlay(props) {
|
|
1766
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1n({
|
|
1767
|
-
viewBox: "0 0 16 16",
|
|
1768
|
-
strokeLinecap: "round",
|
|
1769
|
-
strokeLinejoin: "round",
|
|
1770
|
-
stroke: "currentColor",
|
|
1771
|
-
width: "1em",
|
|
1772
|
-
height: "1em",
|
|
1773
|
-
fill: "none"
|
|
1774
|
-
}, props), _path$1d || (_path$1d = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1775
|
-
d: "M3.333 2l9.334 6-9.334 6V2z"
|
|
1776
|
-
})));
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
var _path$10;
|
|
1780
|
-
|
|
1781
|
-
function _extends$1a() { _extends$1a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1a.apply(this, arguments); }
|
|
1782
|
-
|
|
1783
|
-
function SvgVolumeDown(props) {
|
|
1784
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1a({
|
|
1785
|
-
viewBox: "0 0 16 16",
|
|
1786
|
-
strokeLinecap: "round",
|
|
1787
|
-
strokeLinejoin: "round",
|
|
1788
|
-
stroke: "currentColor",
|
|
1789
|
-
width: "1em",
|
|
1790
|
-
height: "1em",
|
|
1791
|
-
fill: "none"
|
|
1792
|
-
}, props), _path$10 || (_path$10 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1793
|
-
d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
|
|
1794
|
-
})));
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
var _path$$;
|
|
1798
|
-
|
|
1799
|
-
function _extends$19() { _extends$19 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$19.apply(this, arguments); }
|
|
1800
|
-
|
|
1801
|
-
function SvgVolumeMute(props) {
|
|
1802
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$19({
|
|
1803
|
-
viewBox: "0 0 16 16",
|
|
1804
|
-
strokeLinecap: "round",
|
|
1805
|
-
strokeLinejoin: "round",
|
|
1806
|
-
stroke: "currentColor",
|
|
1807
|
-
width: "1em",
|
|
1808
|
-
height: "1em",
|
|
1809
|
-
fill: "none"
|
|
1810
|
-
}, props), _path$$ || (_path$$ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1811
|
-
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
|
|
1812
|
-
})));
|
|
1813
|
-
}
|
|
1814
|
-
|
|
1815
|
-
var _path$_;
|
|
1816
|
-
|
|
1817
|
-
function _extends$18() { _extends$18 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$18.apply(this, arguments); }
|
|
1818
|
-
|
|
1819
|
-
function SvgVolumeOff(props) {
|
|
1820
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$18({
|
|
1821
|
-
viewBox: "0 0 16 16",
|
|
1822
|
-
strokeLinecap: "round",
|
|
1823
|
-
strokeLinejoin: "round",
|
|
1824
|
-
stroke: "currentColor",
|
|
1825
|
-
width: "1em",
|
|
1826
|
-
height: "1em",
|
|
1827
|
-
fill: "none"
|
|
1828
|
-
}, props), _path$_ || (_path$_ = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1829
|
-
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
|
|
1830
|
-
})));
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
var _path$Z;
|
|
1834
|
-
|
|
1835
|
-
function _extends$17() { _extends$17 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$17.apply(this, arguments); }
|
|
1836
|
-
|
|
1837
|
-
function SvgVolumeUp(props) {
|
|
1838
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$17({
|
|
1839
|
-
viewBox: "0 0 16 16",
|
|
1840
|
-
strokeLinecap: "round",
|
|
1841
|
-
strokeLinejoin: "round",
|
|
1842
|
-
stroke: "currentColor",
|
|
1843
|
-
width: "1em",
|
|
1844
|
-
height: "1em",
|
|
1845
|
-
fill: "none"
|
|
1846
|
-
}, props), _path$Z || (_path$Z = /*#__PURE__*/React__namespace.createElement("path", {
|
|
1847
|
-
d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713"
|
|
1848
|
-
})));
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
var usePlaybackIcon = function (state) {
|
|
1852
|
-
var _a;
|
|
1853
|
-
var options = (_a = {},
|
|
1854
|
-
_a[PLAYBACK_STATES.PAUSED] = SvgPlay,
|
|
1855
|
-
_a[PLAYBACK_STATES.PLAYING] = SvgPause,
|
|
1856
|
-
_a[PLAYBACK_STATES.NONE] = SvgPlay,
|
|
1857
|
-
_a[PLAYBACK_STATES.PLAYABLE] = SvgPlay,
|
|
1858
|
-
_a);
|
|
1859
|
-
return options[state.playback];
|
|
1860
|
-
};
|
|
1861
|
-
|
|
1862
1873
|
var useVolumeIcon = function (state) {
|
|
1863
1874
|
var volumeIcon = SvgVolumeUp;
|
|
1864
1875
|
if (state.context.volume >= 0.5) {
|
|
@@ -1890,7 +1901,7 @@ var formatTime = function (time, remaning) {
|
|
|
1890
1901
|
};
|
|
1891
1902
|
|
|
1892
1903
|
var setupAudioRef = function (config) { return function () {
|
|
1893
|
-
var _a, _b, _c;
|
|
1904
|
+
var _a, _b, _c, _d;
|
|
1894
1905
|
var audioRef = config.audioRef, send = config.send;
|
|
1895
1906
|
var handleDurationChange = function (event) {
|
|
1896
1907
|
var duration = event.target.duration;
|
|
@@ -1903,27 +1914,32 @@ var setupAudioRef = function (config) { return function () {
|
|
|
1903
1914
|
var handleCanPlay = function () {
|
|
1904
1915
|
send({ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY });
|
|
1905
1916
|
};
|
|
1917
|
+
var handleEnded = function () {
|
|
1918
|
+
send({ type: AUDIO_PLAYER_EVENT_TYPES.RESET });
|
|
1919
|
+
};
|
|
1906
1920
|
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('durationchange', handleDurationChange);
|
|
1907
1921
|
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('timeupdate', handleTimeUpdate);
|
|
1908
1922
|
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('canplay', handleCanPlay);
|
|
1923
|
+
(_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('ended', handleEnded);
|
|
1909
1924
|
return function () {
|
|
1910
|
-
var _a, _b, _c;
|
|
1925
|
+
var _a, _b, _c, _d;
|
|
1911
1926
|
(_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('durationchange', handleDurationChange);
|
|
1912
1927
|
(_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('timeupdate', handleTimeUpdate);
|
|
1913
1928
|
(_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('canplay', handleCanPlay);
|
|
1929
|
+
(_d = audioRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('ended', handleEnded);
|
|
1914
1930
|
};
|
|
1915
1931
|
}; };
|
|
1916
1932
|
|
|
1917
1933
|
var AudioPlayer = function (props) {
|
|
1918
|
-
var _a, _b, _c, _d;
|
|
1934
|
+
var _a, _b, _c, _d, _f;
|
|
1919
1935
|
var src = props.src;
|
|
1920
1936
|
var volumeRef = React.useRef(null);
|
|
1921
1937
|
var audioRef = React.useRef(null);
|
|
1922
|
-
var
|
|
1923
|
-
var
|
|
1938
|
+
var _g = React.useState(false), disableRipple = _g[0], setDisableRipple = _g[1];
|
|
1939
|
+
var _h = React.useReducer(audioPlayerReducer, __assign(__assign({}, initialAudioPlayerState), { context: __assign(__assign({}, initialAudioPlayerState.context), { audioRef: audioRef }) })), state = _h[0], send = _h[1];
|
|
1924
1940
|
React.useEffect(setupAudioRef({ audioRef: audioRef, send: send }), [audioRef]);
|
|
1925
|
-
var PlaybackIcon =
|
|
1926
|
-
var VolumeIcon = useVolumeIcon(state);
|
|
1941
|
+
var PlaybackIcon = state.playback !== PLAYBACK_STATES.PAUSED ? SvgPause : SvgPlay;
|
|
1942
|
+
var VolumeIcon = React.useMemo(function () { return useVolumeIcon(state); }, [state.context.volume, (_a = state.context.audioRef.current) === null || _a === void 0 ? void 0 : _a.muted]);
|
|
1927
1943
|
var togglePlayback = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK }); };
|
|
1928
1944
|
var toggleVolumeControl = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL }); };
|
|
1929
1945
|
var toggleMute = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE }); };
|
|
@@ -1944,11 +1960,11 @@ var AudioPlayer = function (props) {
|
|
|
1944
1960
|
React__default['default'].createElement(core.Slider, { color: "secondary", orientation: "vertical", value: state.context.volume, onChange: setVolume, max: 1, step: 0.01 })))));
|
|
1945
1961
|
}))),
|
|
1946
1962
|
React__default['default'].createElement(Box, { display: "flex", flexGrow: 1, alignItems: "center", gap: 1 },
|
|
1947
|
-
React__default['default'].createElement(Box, { flexBasis: 60 },
|
|
1948
|
-
React__default['default'].createElement(Typography, null, formatTime(((
|
|
1949
|
-
React__default['default'].createElement(core.Slider, { color: "secondary", value: ((
|
|
1950
|
-
React__default['default'].createElement(Box, { flexBasis: 60, textAlign: "end" },
|
|
1951
|
-
React__default['default'].createElement(Typography, null, formatTime(((
|
|
1963
|
+
React__default['default'].createElement(Box, { flexBasis: 60, flexShrink: 0 },
|
|
1964
|
+
React__default['default'].createElement(Typography, null, formatTime(((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0))),
|
|
1965
|
+
React__default['default'].createElement(core.Slider, { color: "secondary", value: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) || 0, max: ((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }),
|
|
1966
|
+
React__default['default'].createElement(Box, { flexBasis: 60, flexShrink: 0, textAlign: "end" },
|
|
1967
|
+
React__default['default'].createElement(Typography, null, formatTime(((_f = state.context.audioRef.current) === null || _f === void 0 ? void 0 : _f.duration) || 0))))));
|
|
1952
1968
|
};
|
|
1953
1969
|
|
|
1954
1970
|
var LoadingStatus;
|
|
@@ -7030,14 +7046,16 @@ var useTableStyles = core.makeStyles(function (_a) {
|
|
|
7030
7046
|
},
|
|
7031
7047
|
tableWrap: function () { return ({
|
|
7032
7048
|
maxWidth: '100%',
|
|
7033
|
-
overflowX: '
|
|
7049
|
+
overflowX: 'auto',
|
|
7034
7050
|
overflowY: 'hidden',
|
|
7035
7051
|
}); },
|
|
7036
7052
|
});
|
|
7037
7053
|
});
|
|
7038
7054
|
|
|
7039
7055
|
var TableActionsCell = function (props) {
|
|
7040
|
-
var _a = props.actions, primary = _a.primary, secondary = _a.secondary,
|
|
7056
|
+
var _a = props.actions, primary = _a.primary, secondary = _a.secondary, intermediate = __rest(_a, ["primary", "secondary"]);
|
|
7057
|
+
var tertiary = intermediate.tertiary, restActions = __rest(intermediate, ["tertiary"]);
|
|
7058
|
+
var overflow = Object.keys(props.actions).length > 3;
|
|
7041
7059
|
var _b = React__default['default'].useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
7042
7060
|
var openMenu = function (event) {
|
|
7043
7061
|
setAnchorEl(event.currentTarget);
|
|
@@ -7054,10 +7072,14 @@ var TableActionsCell = function (props) {
|
|
|
7054
7072
|
React__default['default'].createElement(Icon, { icon: primary.icon }))),
|
|
7055
7073
|
secondary && secondary.icon && (React__default['default'].createElement(IconButton, { size: "small", onClick: function () { return secondary.action(props.cell); } },
|
|
7056
7074
|
React__default['default'].createElement(Icon, { icon: secondary.icon }))),
|
|
7057
|
-
|
|
7075
|
+
!overflow && tertiary && tertiary.icon && (React__default['default'].createElement(IconButton, { size: "small", onClick: function () { return tertiary.action(props.cell); } },
|
|
7076
|
+
React__default['default'].createElement(Icon, { icon: tertiary.icon }))),
|
|
7077
|
+
overflow && restActions && (React__default['default'].createElement(React__default['default'].Fragment, null,
|
|
7058
7078
|
React__default['default'].createElement(IconButton, { size: "small", onClick: openMenu },
|
|
7059
7079
|
React__default['default'].createElement(Icon, { icon: SvgMore })),
|
|
7060
|
-
React__default['default'].createElement(Menu__default['default'], { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: closeMenu }, Object.values(
|
|
7080
|
+
React__default['default'].createElement(Menu__default['default'], { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: closeMenu }, Object.values(__assign({ tertiary: tertiary }, restActions))
|
|
7081
|
+
.filter(function (value) { return value; })
|
|
7082
|
+
.map(function (_a, i) {
|
|
7061
7083
|
var label = _a.label, action = _a.action;
|
|
7062
7084
|
return (React__default['default'].createElement(MenuItem__default['default'], { key: i, onClick: function () { return handleItemClick(action); } }, label));
|
|
7063
7085
|
}))))));
|
|
@@ -7082,7 +7104,7 @@ var makeColumns = function (config) {
|
|
|
7082
7104
|
/* eslint-disable react/jsx-key */
|
|
7083
7105
|
var Table = function (props) {
|
|
7084
7106
|
var actionColumnId = 'table-actions-column';
|
|
7085
|
-
var rawColumns = props.columns, data = props.data, actions = props.actions, sortable = props.sortable, emptyMessage = props.emptyMessage, EmptyImage = props.EmptyImage, isLoading = props.loading;
|
|
7107
|
+
var rawColumns = props.columns, data = props.data, actions = props.actions, sortable = props.sortable, emptyMessage = props.emptyMessage, EmptyImage = props.EmptyImage, isLoading = props.loading, enableMinHeight = props.enableMinHeight;
|
|
7086
7108
|
var classes = useTableStyles(props);
|
|
7087
7109
|
var columns = React.useMemo(function () { return makeColumns({ columns: rawColumns, actions: actions, actionColumnId: actionColumnId }); }, [rawColumns, actions]);
|
|
7088
7110
|
// @ts-expect-error @types/react-table issue
|
|
@@ -7094,8 +7116,8 @@ var Table = function (props) {
|
|
|
7094
7116
|
var handlePagination = function (_e, pageNumber) {
|
|
7095
7117
|
gotoPage(pageNumber - 1);
|
|
7096
7118
|
};
|
|
7097
|
-
return (React__default['default'].createElement(Box, { className: classes.root, minHeight:
|
|
7098
|
-
React__default['default'].createElement(Box, { className: classes.tableWrap },
|
|
7119
|
+
return (React__default['default'].createElement(Box, { className: classes.root, minHeight: (isLoading || isEmpty) && enableMinHeight ? 618 : 'unset' },
|
|
7120
|
+
React__default['default'].createElement(Box, { className: classes.tableWrap, minHeight: page.length > 0 && !isLoading && enableMinHeight ? 618 : 'unset' },
|
|
7099
7121
|
React__default['default'].createElement("table", __assign({ className: classes.table }, getTableProps()),
|
|
7100
7122
|
React__default['default'].createElement(TableHeader, null, headerGroups.map(function (headerGroup) { return (React__default['default'].createElement(TableHeaderRow, __assign({}, headerGroup.getHeaderGroupProps()), headerGroup.headers.map(function (column) { return (React__default['default'].createElement(TableHeaderCell
|
|
7101
7123
|
// @ts-expect-error @types/react-table issue
|
|
@@ -7114,6 +7136,7 @@ var Table = function (props) {
|
|
|
7114
7136
|
};
|
|
7115
7137
|
Table.defaultProps = {
|
|
7116
7138
|
emptyMessage: 'No results.',
|
|
7139
|
+
enableMinHeight: true,
|
|
7117
7140
|
};
|
|
7118
7141
|
|
|
7119
7142
|
var useToggleButtonStyles = styles.makeStyles(function (theme) { return ({
|