@bigbinary/neeto-media-recorder 1.3.22 → 1.4.0-beta1
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/index.js +56 -50
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { screenRecorder, multipartS3Uploader } from '@bigbinary/neeto-media-reco
|
|
|
7
7
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
8
8
|
import { Typography, Spinner, Button, Callout, Alert } from '@bigbinary/neetoui';
|
|
9
9
|
import { useTranslation, Trans } from 'react-i18next';
|
|
10
|
-
import { useMutation } from 'react-query';
|
|
10
|
+
import { useMutation } from '@tanstack/react-query';
|
|
11
11
|
import axios from 'axios';
|
|
12
12
|
import withT from '@bigbinary/neeto-commons-frontend/react-utils/withT';
|
|
13
13
|
import { Computer, Unlock, Pause, Delete, Download, Close } from '@bigbinary/neeto-icons';
|
|
@@ -459,6 +459,47 @@ try {
|
|
|
459
459
|
|
|
460
460
|
var _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regenerator);
|
|
461
461
|
|
|
462
|
+
function _typeof(obj) {
|
|
463
|
+
"@babel/helpers - typeof";
|
|
464
|
+
|
|
465
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
466
|
+
return typeof obj;
|
|
467
|
+
} : function (obj) {
|
|
468
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
469
|
+
}, _typeof(obj);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
function _toPrimitive(input, hint) {
|
|
473
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
474
|
+
var prim = input[Symbol.toPrimitive];
|
|
475
|
+
if (prim !== undefined) {
|
|
476
|
+
var res = prim.call(input, hint || "default");
|
|
477
|
+
if (_typeof(res) !== "object") return res;
|
|
478
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
479
|
+
}
|
|
480
|
+
return (hint === "string" ? String : Number)(input);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function _toPropertyKey(arg) {
|
|
484
|
+
var key = _toPrimitive(arg, "string");
|
|
485
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function _defineProperty(obj, key, value) {
|
|
489
|
+
key = _toPropertyKey(key);
|
|
490
|
+
if (key in obj) {
|
|
491
|
+
Object.defineProperty(obj, key, {
|
|
492
|
+
value: value,
|
|
493
|
+
enumerable: true,
|
|
494
|
+
configurable: true,
|
|
495
|
+
writable: true
|
|
496
|
+
});
|
|
497
|
+
} else {
|
|
498
|
+
obj[key] = value;
|
|
499
|
+
}
|
|
500
|
+
return obj;
|
|
501
|
+
}
|
|
502
|
+
|
|
462
503
|
var baseUrl = "/api/v1/recordings";
|
|
463
504
|
var create = function create() {
|
|
464
505
|
return axios.post(baseUrl);
|
|
@@ -475,17 +516,23 @@ var recordingsApi = {
|
|
|
475
516
|
update: update
|
|
476
517
|
};
|
|
477
518
|
|
|
519
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
520
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
478
521
|
var useCreateRecording = function useCreateRecording(options) {
|
|
479
|
-
return useMutation(
|
|
522
|
+
return useMutation(_objectSpread({
|
|
523
|
+
mutationFn: recordingsApi.create
|
|
524
|
+
}, options));
|
|
480
525
|
};
|
|
481
526
|
var useRecordingUploadSuccess = function useRecordingUploadSuccess() {
|
|
482
|
-
return useMutation(
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
527
|
+
return useMutation({
|
|
528
|
+
mutationFn: function mutationFn(id) {
|
|
529
|
+
return recordingsApi.update({
|
|
530
|
+
id: id,
|
|
531
|
+
payload: {
|
|
532
|
+
isUploaded: true
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
489
536
|
});
|
|
490
537
|
};
|
|
491
538
|
|
|
@@ -509,47 +556,6 @@ var AbortUpload = withT(function (_ref) {
|
|
|
509
556
|
}, t("neetoMediaRecorder.record.doNotLeaveThePage")))));
|
|
510
557
|
});
|
|
511
558
|
|
|
512
|
-
function _typeof(obj) {
|
|
513
|
-
"@babel/helpers - typeof";
|
|
514
|
-
|
|
515
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
516
|
-
return typeof obj;
|
|
517
|
-
} : function (obj) {
|
|
518
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
519
|
-
}, _typeof(obj);
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
function _toPrimitive(input, hint) {
|
|
523
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
524
|
-
var prim = input[Symbol.toPrimitive];
|
|
525
|
-
if (prim !== undefined) {
|
|
526
|
-
var res = prim.call(input, hint || "default");
|
|
527
|
-
if (_typeof(res) !== "object") return res;
|
|
528
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
529
|
-
}
|
|
530
|
-
return (hint === "string" ? String : Number)(input);
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
function _toPropertyKey(arg) {
|
|
534
|
-
var key = _toPrimitive(arg, "string");
|
|
535
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
function _defineProperty(obj, key, value) {
|
|
539
|
-
key = _toPropertyKey(key);
|
|
540
|
-
if (key in obj) {
|
|
541
|
-
Object.defineProperty(obj, key, {
|
|
542
|
-
value: value,
|
|
543
|
-
enumerable: true,
|
|
544
|
-
configurable: true,
|
|
545
|
-
writable: true
|
|
546
|
-
});
|
|
547
|
-
} else {
|
|
548
|
-
obj[key] = value;
|
|
549
|
-
}
|
|
550
|
-
return obj;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
559
|
function _extends() {
|
|
554
560
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
555
561
|
for (var i = 1; i < arguments.length; i++) {
|