@atlaskit/editor-plugin-media 3.0.10 → 3.0.11
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/CHANGELOG.md +9 -0
- package/dist/cjs/mediaPlugin.js +14 -15
- package/dist/cjs/nodeviews/lazy-media-group.js +4 -3
- package/dist/cjs/nodeviews/lazy-media-inline.js +4 -3
- package/dist/cjs/nodeviews/lazy-media-single.js +1 -2
- package/dist/cjs/nodeviews/lazy-media.js +1 -2
- package/dist/cjs/nodeviews/mediaGroupNext.js +1 -2
- package/dist/cjs/nodeviews/mediaNodeUpdater.js +140 -140
- package/dist/cjs/nodeviews/mediaNodeView/media.js +1 -2
- package/dist/cjs/nodeviews/mediaSingle.js +1 -2
- package/dist/cjs/nodeviews/mediaSingleNext.js +1 -2
- package/dist/cjs/pm-plugins/main.js +1 -2
- package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -2
- package/dist/cjs/ui/CaptionPlaceholder/index.js +1 -2
- package/dist/cjs/ui/CommentBadge/index.js +1 -2
- package/dist/cjs/ui/ImageBorder/styles.js +1 -2
- package/dist/cjs/ui/MediaLinkingToolbar.js +1 -2
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +1 -2
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -2
- package/dist/cjs/ui/ResizableMediaSingle/styles.js +1 -2
- package/dist/cjs/ui/toolbar/index.js +6 -7
- package/dist/cjs/ui/toolbar/linking-toolbar-appearance.js +1 -2
- package/dist/cjs/ui/toolbar/mediaInline.js +1 -2
- package/dist/es2019/nodeviews/lazy-media-group.js +3 -1
- package/dist/es2019/nodeviews/lazy-media-inline.js +3 -1
- package/dist/es2019/ui/toolbar/index.js +7 -7
- package/dist/esm/mediaPlugin.js +13 -13
- package/dist/esm/nodeviews/lazy-media-group.js +3 -1
- package/dist/esm/nodeviews/lazy-media-inline.js +3 -1
- package/dist/esm/nodeviews/mediaNodeUpdater.js +140 -140
- package/dist/esm/ui/toolbar/index.js +5 -5
- package/package.json +3 -3
|
@@ -349,12 +349,12 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
349
349
|
}
|
|
350
350
|
});
|
|
351
351
|
(0, _defineProperty2.default)(this, "shouldNodeBeDeepCopied", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
352
|
-
var
|
|
352
|
+
var _ref0, _this$props$mediaOpti, _this$props$mediaOpti2, _this$mediaPluginStat;
|
|
353
353
|
var scope, attrs, id, isIdentifierOutsideEditorScope;
|
|
354
354
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
355
355
|
while (1) switch (_context8.prev = _context8.next) {
|
|
356
356
|
case 0:
|
|
357
|
-
scope = (
|
|
357
|
+
scope = (_ref0 = (_this$props$mediaOpti = (_this$props$mediaOpti2 = _this.props.mediaOptions) === null || _this$props$mediaOpti2 === void 0 ? void 0 : _this$props$mediaOpti2.mediaShallowCopyScope) !== null && _this$props$mediaOpti !== void 0 ? _this$props$mediaOpti : (_this$mediaPluginStat = _this.mediaPluginState) === null || _this$mediaPluginStat === void 0 || (_this$mediaPluginStat = _this$mediaPluginStat.mediaOptions) === null || _this$mediaPluginStat === void 0 ? void 0 : _this$mediaPluginStat.mediaShallowCopyScope) !== null && _ref0 !== void 0 ? _ref0 : 'context';
|
|
358
358
|
if (!(scope === 'context')) {
|
|
359
359
|
_context8.next = 7;
|
|
360
360
|
break;
|
|
@@ -403,139 +403,139 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
403
403
|
}
|
|
404
404
|
}, _callee9);
|
|
405
405
|
})));
|
|
406
|
-
(0, _defineProperty2.default)(this, "isNodeFromDifferentCollection", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
406
|
+
(0, _defineProperty2.default)(this, "isNodeFromDifferentCollection", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
407
407
|
var mediaProvider, currentCollectionName, attrs, nodeCollection, __contextId, contextId;
|
|
408
|
-
return _regenerator.default.wrap(function
|
|
409
|
-
while (1) switch (
|
|
408
|
+
return _regenerator.default.wrap(function _callee0$(_context0) {
|
|
409
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
410
410
|
case 0:
|
|
411
|
-
|
|
411
|
+
_context0.next = 2;
|
|
412
412
|
return _this.props.mediaProvider;
|
|
413
413
|
case 2:
|
|
414
|
-
mediaProvider =
|
|
414
|
+
mediaProvider = _context0.sent;
|
|
415
415
|
if (!(!mediaProvider || !mediaProvider.uploadParams)) {
|
|
416
|
-
|
|
416
|
+
_context0.next = 5;
|
|
417
417
|
break;
|
|
418
418
|
}
|
|
419
|
-
return
|
|
419
|
+
return _context0.abrupt("return", false);
|
|
420
420
|
case 5:
|
|
421
421
|
currentCollectionName = mediaProvider.uploadParams.collection;
|
|
422
422
|
attrs = _this.getAttrs();
|
|
423
423
|
if (!(!attrs || attrs && !isMediaTypeSupported(attrs.type))) {
|
|
424
|
-
|
|
424
|
+
_context0.next = 9;
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
427
|
-
return
|
|
427
|
+
return _context0.abrupt("return", false);
|
|
428
428
|
case 9:
|
|
429
429
|
nodeCollection = attrs.collection, __contextId = attrs.__contextId;
|
|
430
|
-
|
|
431
|
-
if (
|
|
432
|
-
|
|
430
|
+
_context0.t0 = __contextId;
|
|
431
|
+
if (_context0.t0) {
|
|
432
|
+
_context0.next = 15;
|
|
433
433
|
break;
|
|
434
434
|
}
|
|
435
|
-
|
|
435
|
+
_context0.next = 14;
|
|
436
436
|
return _this.getObjectId();
|
|
437
437
|
case 14:
|
|
438
|
-
|
|
438
|
+
_context0.t0 = _context0.sent;
|
|
439
439
|
case 15:
|
|
440
|
-
contextId =
|
|
440
|
+
contextId = _context0.t0;
|
|
441
441
|
if (!(contextId && currentCollectionName !== nodeCollection)) {
|
|
442
|
-
|
|
442
|
+
_context0.next = 18;
|
|
443
443
|
break;
|
|
444
444
|
}
|
|
445
|
-
return
|
|
445
|
+
return _context0.abrupt("return", true);
|
|
446
446
|
case 18:
|
|
447
|
-
return
|
|
447
|
+
return _context0.abrupt("return", false);
|
|
448
448
|
case 19:
|
|
449
449
|
case "end":
|
|
450
|
-
return
|
|
450
|
+
return _context0.stop();
|
|
451
451
|
}
|
|
452
|
-
},
|
|
452
|
+
}, _callee0);
|
|
453
453
|
})));
|
|
454
454
|
(0, _defineProperty2.default)(this, "handleCopyFileSwitcher", /*#__PURE__*/function () {
|
|
455
|
-
var
|
|
455
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee1(attrs) {
|
|
456
456
|
var mediaClient, source, destination, traceContext, _yield$mediaClient$fi, id, _sourceAP, copyV2Source, _destAP, copyV2Destination, _yield$mediaClient$fi2, _id;
|
|
457
|
-
return _regenerator.default.wrap(function
|
|
458
|
-
while (1) switch (
|
|
457
|
+
return _regenerator.default.wrap(function _callee1$(_context1) {
|
|
458
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
459
459
|
case 0:
|
|
460
460
|
mediaClient = attrs.mediaClient, source = attrs.source, destination = attrs.destination, traceContext = attrs.traceContext;
|
|
461
|
-
|
|
462
|
-
|
|
461
|
+
_context1.prev = 1;
|
|
462
|
+
_context1.next = 4;
|
|
463
463
|
return mediaClient.file.copyFile(source, destination, undefined, traceContext);
|
|
464
464
|
case 4:
|
|
465
|
-
_yield$mediaClient$fi =
|
|
465
|
+
_yield$mediaClient$fi = _context1.sent;
|
|
466
466
|
id = _yield$mediaClient$fi.id;
|
|
467
|
-
return
|
|
467
|
+
return _context1.abrupt("return", id);
|
|
468
468
|
case 9:
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
_context1.prev = 9;
|
|
470
|
+
_context1.t0 = _context1["catch"](1);
|
|
471
471
|
if (!(0, _platformFeatureFlags.fg)('platform_media_cross_client_copy')) {
|
|
472
|
-
|
|
472
|
+
_context1.next = 21;
|
|
473
473
|
break;
|
|
474
474
|
}
|
|
475
475
|
// calling /v2/file/copy by removing the auth tokens to make cross product copy and pastes
|
|
476
476
|
_sourceAP = source.authProvider, copyV2Source = (0, _objectWithoutProperties2.default)(source, _excluded);
|
|
477
477
|
_destAP = destination.authProvider, copyV2Destination = (0, _objectWithoutProperties2.default)(destination, _excluded2);
|
|
478
|
-
|
|
478
|
+
_context1.next = 16;
|
|
479
479
|
return mediaClient.file.copyFile(copyV2Source, copyV2Destination, undefined, traceContext);
|
|
480
480
|
case 16:
|
|
481
|
-
_yield$mediaClient$fi2 =
|
|
481
|
+
_yield$mediaClient$fi2 = _context1.sent;
|
|
482
482
|
_id = _yield$mediaClient$fi2.id;
|
|
483
|
-
return
|
|
483
|
+
return _context1.abrupt("return", _id);
|
|
484
484
|
case 21:
|
|
485
|
-
throw
|
|
485
|
+
throw _context1.t0;
|
|
486
486
|
case 22:
|
|
487
487
|
case "end":
|
|
488
|
-
return
|
|
488
|
+
return _context1.stop();
|
|
489
489
|
}
|
|
490
|
-
},
|
|
490
|
+
}, _callee1, null, [[1, 9]]);
|
|
491
491
|
}));
|
|
492
492
|
return function (_x4) {
|
|
493
|
-
return
|
|
493
|
+
return _ref11.apply(this, arguments);
|
|
494
494
|
};
|
|
495
495
|
}());
|
|
496
496
|
(0, _defineProperty2.default)(this, "copyNodeFromBlobUrl", /*#__PURE__*/function () {
|
|
497
|
-
var
|
|
497
|
+
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(getPos) {
|
|
498
498
|
var attrs, url, mediaAttrs, mediaProvider, currentCollectionName, contextId, id, collection, height, width, mimeType, name, size, uploadMediaClientConfig, mediaClient, getAuthFromContext, mediaFileId, pos;
|
|
499
|
-
return _regenerator.default.wrap(function
|
|
500
|
-
while (1) switch (
|
|
499
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
500
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
501
501
|
case 0:
|
|
502
502
|
attrs = _this.getAttrs();
|
|
503
503
|
if (!(!attrs || attrs.type !== 'external')) {
|
|
504
|
-
|
|
504
|
+
_context10.next = 3;
|
|
505
505
|
break;
|
|
506
506
|
}
|
|
507
|
-
return
|
|
507
|
+
return _context10.abrupt("return");
|
|
508
508
|
case 3:
|
|
509
509
|
url = attrs.url;
|
|
510
510
|
mediaAttrs = (0, _mediaClient.getAttrsFromUrl)(url);
|
|
511
511
|
if (mediaAttrs) {
|
|
512
|
-
|
|
512
|
+
_context10.next = 7;
|
|
513
513
|
break;
|
|
514
514
|
}
|
|
515
|
-
return
|
|
515
|
+
return _context10.abrupt("return");
|
|
516
516
|
case 7:
|
|
517
|
-
|
|
517
|
+
_context10.next = 9;
|
|
518
518
|
return _this.props.mediaProvider;
|
|
519
519
|
case 9:
|
|
520
|
-
mediaProvider =
|
|
520
|
+
mediaProvider = _context10.sent;
|
|
521
521
|
if (!(!mediaProvider || !mediaProvider.uploadParams)) {
|
|
522
|
-
|
|
522
|
+
_context10.next = 12;
|
|
523
523
|
break;
|
|
524
524
|
}
|
|
525
|
-
return
|
|
525
|
+
return _context10.abrupt("return");
|
|
526
526
|
case 12:
|
|
527
527
|
currentCollectionName = mediaProvider.uploadParams.collection;
|
|
528
528
|
contextId = mediaAttrs.contextId, id = mediaAttrs.id, collection = mediaAttrs.collection, height = mediaAttrs.height, width = mediaAttrs.width, mimeType = mediaAttrs.mimeType, name = mediaAttrs.name, size = mediaAttrs.size;
|
|
529
529
|
uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
|
|
530
530
|
if (!(!uploadMediaClientConfig || !uploadMediaClientConfig.getAuthFromContext)) {
|
|
531
|
-
|
|
531
|
+
_context10.next = 17;
|
|
532
532
|
break;
|
|
533
533
|
}
|
|
534
|
-
return
|
|
534
|
+
return _context10.abrupt("return");
|
|
535
535
|
case 17:
|
|
536
536
|
mediaClient = (0, _mediaClientReact.getMediaClient)(uploadMediaClientConfig);
|
|
537
537
|
getAuthFromContext = uploadMediaClientConfig.getAuthFromContext;
|
|
538
|
-
|
|
538
|
+
_context10.next = 21;
|
|
539
539
|
return _this.handleCopyFileSwitcher({
|
|
540
540
|
mediaClient: mediaClient,
|
|
541
541
|
source: {
|
|
@@ -552,13 +552,13 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
554
|
case 21:
|
|
555
|
-
mediaFileId =
|
|
555
|
+
mediaFileId = _context10.sent;
|
|
556
556
|
pos = getPos();
|
|
557
557
|
if (!(typeof pos !== 'number')) {
|
|
558
|
-
|
|
558
|
+
_context10.next = 25;
|
|
559
559
|
break;
|
|
560
560
|
}
|
|
561
|
-
return
|
|
561
|
+
return _context10.abrupt("return");
|
|
562
562
|
case 25:
|
|
563
563
|
(0, _helpers.replaceExternalMedia)(pos + 1, {
|
|
564
564
|
id: mediaFileId,
|
|
@@ -571,37 +571,37 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
571
571
|
})(_this.props.view.state, _this.props.view.dispatch);
|
|
572
572
|
case 26:
|
|
573
573
|
case "end":
|
|
574
|
-
return
|
|
574
|
+
return _context10.stop();
|
|
575
575
|
}
|
|
576
|
-
},
|
|
576
|
+
}, _callee10);
|
|
577
577
|
}));
|
|
578
578
|
return function (_x5) {
|
|
579
|
-
return
|
|
579
|
+
return _ref12.apply(this, arguments);
|
|
580
580
|
};
|
|
581
581
|
}());
|
|
582
582
|
// Copies the pasted node into the current collection using a getPos handler
|
|
583
583
|
(0, _defineProperty2.default)(this, "copyNodeFromPos", /*#__PURE__*/function () {
|
|
584
|
-
var
|
|
584
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(getPos, traceContext) {
|
|
585
585
|
var attrs, copiedAttrs;
|
|
586
|
-
return _regenerator.default.wrap(function
|
|
587
|
-
while (1) switch (
|
|
586
|
+
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
587
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
588
588
|
case 0:
|
|
589
589
|
attrs = _this.getAttrs();
|
|
590
590
|
if (!(!attrs || attrs && !isMediaTypeSupported(attrs.type))) {
|
|
591
|
-
|
|
591
|
+
_context11.next = 3;
|
|
592
592
|
break;
|
|
593
593
|
}
|
|
594
|
-
return
|
|
594
|
+
return _context11.abrupt("return");
|
|
595
595
|
case 3:
|
|
596
|
-
|
|
596
|
+
_context11.next = 5;
|
|
597
597
|
return _this.copyFile(attrs.id, attrs.collection, traceContext);
|
|
598
598
|
case 5:
|
|
599
|
-
copiedAttrs =
|
|
599
|
+
copiedAttrs = _context11.sent;
|
|
600
600
|
if (copiedAttrs) {
|
|
601
|
-
|
|
601
|
+
_context11.next = 8;
|
|
602
602
|
break;
|
|
603
603
|
}
|
|
604
|
-
return
|
|
604
|
+
return _context11.abrupt("return");
|
|
605
605
|
case 8:
|
|
606
606
|
(0, _helpers.updateCurrentMediaNodeAttrs)(copiedAttrs, {
|
|
607
607
|
node: _this.props.node,
|
|
@@ -609,82 +609,82 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
609
609
|
})(_this.props.view.state, _this.props.view.dispatch);
|
|
610
610
|
case 9:
|
|
611
611
|
case "end":
|
|
612
|
-
return
|
|
612
|
+
return _context11.stop();
|
|
613
613
|
}
|
|
614
|
-
},
|
|
614
|
+
}, _callee11);
|
|
615
615
|
}));
|
|
616
616
|
return function (_x6, _x7) {
|
|
617
|
-
return
|
|
617
|
+
return _ref13.apply(this, arguments);
|
|
618
618
|
};
|
|
619
619
|
}());
|
|
620
620
|
// Copies the pasted node into the current collection
|
|
621
621
|
(0, _defineProperty2.default)(this, "copyNode", /*#__PURE__*/function () {
|
|
622
|
-
var
|
|
622
|
+
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12(traceContext) {
|
|
623
623
|
var attrs, view, copiedAttrs;
|
|
624
|
-
return _regenerator.default.wrap(function
|
|
625
|
-
while (1) switch (
|
|
624
|
+
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
625
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
626
626
|
case 0:
|
|
627
627
|
attrs = _this.getAttrs();
|
|
628
628
|
view = _this.props.view;
|
|
629
629
|
if (!(!attrs || attrs && !isMediaTypeSupported(attrs.type))) {
|
|
630
|
-
|
|
630
|
+
_context12.next = 4;
|
|
631
631
|
break;
|
|
632
632
|
}
|
|
633
|
-
return
|
|
633
|
+
return _context12.abrupt("return");
|
|
634
634
|
case 4:
|
|
635
|
-
|
|
635
|
+
_context12.next = 6;
|
|
636
636
|
return _this.copyFile(attrs.id, attrs.collection, traceContext);
|
|
637
637
|
case 6:
|
|
638
|
-
copiedAttrs =
|
|
638
|
+
copiedAttrs = _context12.sent;
|
|
639
639
|
if (copiedAttrs) {
|
|
640
|
-
|
|
640
|
+
_context12.next = 9;
|
|
641
641
|
break;
|
|
642
642
|
}
|
|
643
|
-
return
|
|
643
|
+
return _context12.abrupt("return");
|
|
644
644
|
case 9:
|
|
645
645
|
(0, _helpers.updateMediaNodeAttrs)(attrs.id, copiedAttrs)(view.state, view.dispatch);
|
|
646
646
|
case 10:
|
|
647
647
|
case "end":
|
|
648
|
-
return
|
|
648
|
+
return _context12.stop();
|
|
649
649
|
}
|
|
650
|
-
},
|
|
650
|
+
}, _callee12);
|
|
651
651
|
}));
|
|
652
652
|
return function (_x8) {
|
|
653
|
-
return
|
|
653
|
+
return _ref14.apply(this, arguments);
|
|
654
654
|
};
|
|
655
655
|
}());
|
|
656
656
|
(0, _defineProperty2.default)(this, "copyFile", /*#__PURE__*/function () {
|
|
657
|
-
var
|
|
657
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(id, collection, traceContext) {
|
|
658
658
|
var mediaProvider, nodeContextId, uploadMediaClientConfig, mediaClient, currentCollectionName, objectId, getAuthFromContext, mediaFileId;
|
|
659
|
-
return _regenerator.default.wrap(function
|
|
660
|
-
while (1) switch (
|
|
659
|
+
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
660
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
661
661
|
case 0:
|
|
662
|
-
|
|
662
|
+
_context13.next = 2;
|
|
663
663
|
return _this.props.mediaProvider;
|
|
664
664
|
case 2:
|
|
665
|
-
mediaProvider =
|
|
665
|
+
mediaProvider = _context13.sent;
|
|
666
666
|
if (mediaProvider !== null && mediaProvider !== void 0 && mediaProvider.uploadParams) {
|
|
667
|
-
|
|
667
|
+
_context13.next = 5;
|
|
668
668
|
break;
|
|
669
669
|
}
|
|
670
|
-
return
|
|
670
|
+
return _context13.abrupt("return");
|
|
671
671
|
case 5:
|
|
672
672
|
nodeContextId = _this.getNodeContextId();
|
|
673
673
|
uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
|
|
674
674
|
if (!(!(uploadMediaClientConfig !== null && uploadMediaClientConfig !== void 0 && uploadMediaClientConfig.getAuthFromContext) || !nodeContextId)) {
|
|
675
|
-
|
|
675
|
+
_context13.next = 9;
|
|
676
676
|
break;
|
|
677
677
|
}
|
|
678
|
-
return
|
|
678
|
+
return _context13.abrupt("return");
|
|
679
679
|
case 9:
|
|
680
680
|
mediaClient = (0, _mediaClientReact.getMediaClient)(uploadMediaClientConfig);
|
|
681
681
|
currentCollectionName = mediaProvider.uploadParams.collection;
|
|
682
|
-
|
|
682
|
+
_context13.next = 13;
|
|
683
683
|
return _this.getObjectId();
|
|
684
684
|
case 13:
|
|
685
|
-
objectId =
|
|
685
|
+
objectId = _context13.sent;
|
|
686
686
|
getAuthFromContext = uploadMediaClientConfig.getAuthFromContext;
|
|
687
|
-
|
|
687
|
+
_context13.next = 17;
|
|
688
688
|
return _this.handleCopyFileSwitcher({
|
|
689
689
|
mediaClient: mediaClient,
|
|
690
690
|
source: {
|
|
@@ -702,20 +702,20 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
702
702
|
traceContext: traceContext
|
|
703
703
|
});
|
|
704
704
|
case 17:
|
|
705
|
-
mediaFileId =
|
|
706
|
-
return
|
|
705
|
+
mediaFileId = _context13.sent;
|
|
706
|
+
return _context13.abrupt("return", {
|
|
707
707
|
id: mediaFileId,
|
|
708
708
|
collection: currentCollectionName,
|
|
709
709
|
__contextId: objectId
|
|
710
710
|
});
|
|
711
711
|
case 19:
|
|
712
712
|
case "end":
|
|
713
|
-
return
|
|
713
|
+
return _context13.stop();
|
|
714
714
|
}
|
|
715
|
-
},
|
|
715
|
+
}, _callee13);
|
|
716
716
|
}));
|
|
717
|
-
return function (_x9,
|
|
718
|
-
return
|
|
717
|
+
return function (_x9, _x0, _x1) {
|
|
718
|
+
return _ref15.apply(this, arguments);
|
|
719
719
|
};
|
|
720
720
|
}());
|
|
721
721
|
this.props = props;
|
|
@@ -735,42 +735,42 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
735
735
|
}, {
|
|
736
736
|
key: "getRemoteDimensions",
|
|
737
737
|
value: function () {
|
|
738
|
-
var _getRemoteDimensions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
738
|
+
var _getRemoteDimensions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
739
739
|
var mediaProvider, mediaOptions, attrs, height, width, id, collection, viewMediaClientConfig, mediaClient, currentState, imageMetadata;
|
|
740
|
-
return _regenerator.default.wrap(function
|
|
741
|
-
while (1) switch (
|
|
740
|
+
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
741
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
742
742
|
case 0:
|
|
743
|
-
|
|
743
|
+
_context14.next = 2;
|
|
744
744
|
return this.props.mediaProvider;
|
|
745
745
|
case 2:
|
|
746
|
-
mediaProvider =
|
|
746
|
+
mediaProvider = _context14.sent;
|
|
747
747
|
mediaOptions = this.props.mediaOptions;
|
|
748
748
|
attrs = this.getAttrs();
|
|
749
749
|
if (!(!mediaProvider || !attrs)) {
|
|
750
|
-
|
|
750
|
+
_context14.next = 7;
|
|
751
751
|
break;
|
|
752
752
|
}
|
|
753
|
-
return
|
|
753
|
+
return _context14.abrupt("return", false);
|
|
754
754
|
case 7:
|
|
755
755
|
height = attrs.height, width = attrs.width;
|
|
756
756
|
if (!(attrs.type === 'external' || !attrs.id)) {
|
|
757
|
-
|
|
757
|
+
_context14.next = 10;
|
|
758
758
|
break;
|
|
759
759
|
}
|
|
760
|
-
return
|
|
760
|
+
return _context14.abrupt("return", false);
|
|
761
761
|
case 10:
|
|
762
762
|
id = attrs.id, collection = attrs.collection;
|
|
763
763
|
if (!(height && width)) {
|
|
764
|
-
|
|
764
|
+
_context14.next = 13;
|
|
765
765
|
break;
|
|
766
766
|
}
|
|
767
|
-
return
|
|
767
|
+
return _context14.abrupt("return", false);
|
|
768
768
|
case 13:
|
|
769
769
|
if (!(mediaOptions && !mediaOptions.allowRemoteDimensionsFetch)) {
|
|
770
|
-
|
|
770
|
+
_context14.next = 15;
|
|
771
771
|
break;
|
|
772
772
|
}
|
|
773
|
-
return
|
|
773
|
+
return _context14.abrupt("return", {
|
|
774
774
|
id: id,
|
|
775
775
|
height: _mediaSingle.DEFAULT_IMAGE_HEIGHT,
|
|
776
776
|
width: _mediaSingle.DEFAULT_IMAGE_WIDTH
|
|
@@ -778,40 +778,40 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
778
778
|
case 15:
|
|
779
779
|
viewMediaClientConfig = mediaProvider.viewMediaClientConfig;
|
|
780
780
|
mediaClient = (0, _mediaClientReact.getMediaClient)(viewMediaClientConfig);
|
|
781
|
-
|
|
781
|
+
_context14.next = 19;
|
|
782
782
|
return mediaClient.file.getCurrentState(id, {
|
|
783
783
|
collectionName: collection
|
|
784
784
|
});
|
|
785
785
|
case 19:
|
|
786
|
-
currentState =
|
|
786
|
+
currentState = _context14.sent;
|
|
787
787
|
if ((0, _mediaClient.isImageRepresentationReady)(currentState)) {
|
|
788
|
-
|
|
788
|
+
_context14.next = 22;
|
|
789
789
|
break;
|
|
790
790
|
}
|
|
791
|
-
return
|
|
791
|
+
return _context14.abrupt("return", false);
|
|
792
792
|
case 22:
|
|
793
|
-
|
|
793
|
+
_context14.next = 24;
|
|
794
794
|
return mediaClient.getImageMetadata(id, {
|
|
795
795
|
collection: collection
|
|
796
796
|
});
|
|
797
797
|
case 24:
|
|
798
|
-
imageMetadata =
|
|
798
|
+
imageMetadata = _context14.sent;
|
|
799
799
|
if (!(!imageMetadata || !imageMetadata.original)) {
|
|
800
|
-
|
|
800
|
+
_context14.next = 27;
|
|
801
801
|
break;
|
|
802
802
|
}
|
|
803
|
-
return
|
|
803
|
+
return _context14.abrupt("return", false);
|
|
804
804
|
case 27:
|
|
805
|
-
return
|
|
805
|
+
return _context14.abrupt("return", {
|
|
806
806
|
id: id,
|
|
807
807
|
height: imageMetadata.original.height || _mediaSingle.DEFAULT_IMAGE_HEIGHT,
|
|
808
808
|
width: imageMetadata.original.width || _mediaSingle.DEFAULT_IMAGE_WIDTH
|
|
809
809
|
});
|
|
810
810
|
case 28:
|
|
811
811
|
case "end":
|
|
812
|
-
return
|
|
812
|
+
return _context14.stop();
|
|
813
813
|
}
|
|
814
|
-
},
|
|
814
|
+
}, _callee14, this);
|
|
815
815
|
}));
|
|
816
816
|
function getRemoteDimensions() {
|
|
817
817
|
return _getRemoteDimensions.apply(this, arguments);
|
|
@@ -821,38 +821,38 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
821
821
|
}, {
|
|
822
822
|
key: "handleExternalMedia",
|
|
823
823
|
value: function () {
|
|
824
|
-
var _handleExternalMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
825
|
-
return _regenerator.default.wrap(function
|
|
826
|
-
while (1) switch (
|
|
824
|
+
var _handleExternalMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(getPos) {
|
|
825
|
+
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
826
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
827
827
|
case 0:
|
|
828
828
|
if (!this.isMediaBlobUrl()) {
|
|
829
|
-
|
|
829
|
+
_context15.next = 12;
|
|
830
830
|
break;
|
|
831
831
|
}
|
|
832
|
-
|
|
833
|
-
|
|
832
|
+
_context15.prev = 1;
|
|
833
|
+
_context15.next = 4;
|
|
834
834
|
return this.copyNodeFromBlobUrl(getPos);
|
|
835
835
|
case 4:
|
|
836
|
-
|
|
836
|
+
_context15.next = 10;
|
|
837
837
|
break;
|
|
838
838
|
case 6:
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
839
|
+
_context15.prev = 6;
|
|
840
|
+
_context15.t0 = _context15["catch"](1);
|
|
841
|
+
_context15.next = 10;
|
|
842
842
|
return this.uploadExternalMedia(getPos);
|
|
843
843
|
case 10:
|
|
844
|
-
|
|
844
|
+
_context15.next = 14;
|
|
845
845
|
break;
|
|
846
846
|
case 12:
|
|
847
|
-
|
|
847
|
+
_context15.next = 14;
|
|
848
848
|
return this.uploadExternalMedia(getPos);
|
|
849
849
|
case 14:
|
|
850
850
|
case "end":
|
|
851
|
-
return
|
|
851
|
+
return _context15.stop();
|
|
852
852
|
}
|
|
853
|
-
},
|
|
853
|
+
}, _callee15, this, [[1, 6]]);
|
|
854
854
|
}));
|
|
855
|
-
function handleExternalMedia(
|
|
855
|
+
function handleExternalMedia(_x10) {
|
|
856
856
|
return _handleExternalMedia.apply(this, arguments);
|
|
857
857
|
}
|
|
858
858
|
return handleExternalMedia;
|
|
@@ -25,8 +25,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
25
25
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
26
26
|
var _pluginKey = require("../../pm-plugins/plugin-key");
|
|
27
27
|
var _styles = require("../styles");
|
|
28
|
-
function
|
|
29
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
30
29
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
31
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
32
31
|
// This is being used by DropPlaceholder now
|
|
@@ -42,8 +42,7 @@ var _helpers = require("./helpers");
|
|
|
42
42
|
var _mediaNodeUpdater = require("./mediaNodeUpdater");
|
|
43
43
|
var _mediaSingleNext = require("./mediaSingleNext");
|
|
44
44
|
var _styles = require("./styles");
|
|
45
|
-
function
|
|
46
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
45
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
47
46
|
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
48
47
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
49
48
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -30,8 +30,7 @@ var _ResizableMediaSingleNext = _interopRequireDefault(require("../ui/ResizableM
|
|
|
30
30
|
var _helpers = require("./helpers");
|
|
31
31
|
var _mediaNodeUpdater = require("./mediaNodeUpdater");
|
|
32
32
|
var _styles = require("./styles");
|
|
33
|
-
function
|
|
34
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
35
34
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
35
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
37
36
|
* @jsxRuntime classic
|
|
@@ -39,8 +39,7 @@ var _actions = require("./actions");
|
|
|
39
39
|
var _mediaTaskManager = require("./mediaTaskManager");
|
|
40
40
|
var _pickerFacade = _interopRequireDefault(require("./picker-facade"));
|
|
41
41
|
var _pluginKey = require("./plugin-key");
|
|
42
|
-
function
|
|
43
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
42
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
44
43
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
45
44
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
46
45
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|