sense-react-timeline-editor 1.1.5 → 1.1.6

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/dist/index.esm.js CHANGED
@@ -3630,7 +3630,7 @@ var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3630
3630
  return /*#__PURE__*/function () {
3631
3631
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(info) {
3632
3632
  var _info$file$response, _info$file;
3633
- var totalDuration, _newAction, uid, duration, newAction;
3633
+ var hasDefault, totalDuration, _newAction, uid, duration, newAction;
3634
3634
  return _regenerator().w(function (_context) {
3635
3635
  while (1) switch (_context.n) {
3636
3636
  case 0:
@@ -3641,11 +3641,30 @@ var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3641
3641
  }
3642
3642
  return _context.a(2);
3643
3643
  case 1:
3644
- if (info.file.response) {
3644
+ if (!(info.file.status === 'error')) {
3645
3645
  _context.n = 2;
3646
3646
  break;
3647
3647
  }
3648
- totalDuration = row.actions.reduce(function (max, current) {
3648
+ onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [{
3649
+ id: info.file.uid,
3650
+ isUploading: false,
3651
+ start: 0,
3652
+ end: 0,
3653
+ effectId: 'custom_video_effect',
3654
+ isError: true,
3655
+ segment_type: 'bgm',
3656
+ uid: info.file.uid
3657
+ }]);
3658
+ return _context.a(2);
3659
+ case 2:
3660
+ if (info.file.response) {
3661
+ _context.n = 3;
3662
+ break;
3663
+ }
3664
+ hasDefault = row.actions.some(function (action) {
3665
+ return action.id === 'upload-bg-music';
3666
+ });
3667
+ totalDuration = hasDefault ? 0 : row.actions.reduce(function (max, current) {
3649
3668
  var _max$end;
3650
3669
  var currentEnd = current.end || 0;
3651
3670
  var maxEnd = (_max$end = max === null || max === void 0 ? void 0 : max.end) !== null && _max$end !== void 0 ? _max$end : 0;
@@ -3666,11 +3685,11 @@ var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3666
3685
  };
3667
3686
  onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [_newAction]);
3668
3687
  return _context.a(2);
3669
- case 2:
3688
+ case 3:
3670
3689
  uid = info.file.uid;
3671
- _context.n = 3;
3690
+ _context.n = 4;
3672
3691
  return getAudioDuration(info.file.response.url);
3673
- case 3:
3692
+ case 4:
3674
3693
  duration = _context.v;
3675
3694
  newAction = {
3676
3695
  id: ((_info$file$response = info.file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.id) || uid,
@@ -3685,7 +3704,7 @@ var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3685
3704
  uid: (_info$file = info.file) === null || _info$file === void 0 ? void 0 : _info$file.uid
3686
3705
  };
3687
3706
  onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [newAction]);
3688
- case 4:
3707
+ case 5:
3689
3708
  return _context.a(2);
3690
3709
  }
3691
3710
  }, _callee);
package/dist/index.js CHANGED
@@ -3640,7 +3640,7 @@ var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (prop
3640
3640
  return /*#__PURE__*/function () {
3641
3641
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(info) {
3642
3642
  var _info$file$response, _info$file;
3643
- var totalDuration, _newAction, uid, duration, newAction;
3643
+ var hasDefault, totalDuration, _newAction, uid, duration, newAction;
3644
3644
  return _regenerator().w(function (_context) {
3645
3645
  while (1) switch (_context.n) {
3646
3646
  case 0:
@@ -3651,11 +3651,30 @@ var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (prop
3651
3651
  }
3652
3652
  return _context.a(2);
3653
3653
  case 1:
3654
- if (info.file.response) {
3654
+ if (!(info.file.status === 'error')) {
3655
3655
  _context.n = 2;
3656
3656
  break;
3657
3657
  }
3658
- totalDuration = row.actions.reduce(function (max, current) {
3658
+ onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [{
3659
+ id: info.file.uid,
3660
+ isUploading: false,
3661
+ start: 0,
3662
+ end: 0,
3663
+ effectId: 'custom_video_effect',
3664
+ isError: true,
3665
+ segment_type: 'bgm',
3666
+ uid: info.file.uid
3667
+ }]);
3668
+ return _context.a(2);
3669
+ case 2:
3670
+ if (info.file.response) {
3671
+ _context.n = 3;
3672
+ break;
3673
+ }
3674
+ hasDefault = row.actions.some(function (action) {
3675
+ return action.id === 'upload-bg-music';
3676
+ });
3677
+ totalDuration = hasDefault ? 0 : row.actions.reduce(function (max, current) {
3659
3678
  var _max$end;
3660
3679
  var currentEnd = current.end || 0;
3661
3680
  var maxEnd = (_max$end = max === null || max === void 0 ? void 0 : max.end) !== null && _max$end !== void 0 ? _max$end : 0;
@@ -3676,11 +3695,11 @@ var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (prop
3676
3695
  };
3677
3696
  onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [_newAction]);
3678
3697
  return _context.a(2);
3679
- case 2:
3698
+ case 3:
3680
3699
  uid = info.file.uid;
3681
- _context.n = 3;
3700
+ _context.n = 4;
3682
3701
  return getAudioDuration(info.file.response.url);
3683
- case 3:
3702
+ case 4:
3684
3703
  duration = _context.v;
3685
3704
  newAction = {
3686
3705
  id: ((_info$file$response = info.file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.id) || uid,
@@ -3695,7 +3714,7 @@ var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (prop
3695
3714
  uid: (_info$file = info.file) === null || _info$file === void 0 ? void 0 : _info$file.uid
3696
3715
  };
3697
3716
  onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [newAction]);
3698
- case 4:
3717
+ case 5:
3699
3718
  return _context.a(2);
3700
3719
  }
3701
3720
  }, _callee);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sense-react-timeline-editor",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "author": "xzdarcy",
5
5
  "license": "MIT",
6
6
  "keywords": [