@atlaskit/editor-plugin-media 3.0.10 → 3.0.12

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/mediaPlugin.js +14 -15
  3. package/dist/cjs/nodeviews/lazy-media-group.js +4 -3
  4. package/dist/cjs/nodeviews/lazy-media-inline.js +4 -3
  5. package/dist/cjs/nodeviews/lazy-media-single.js +1 -2
  6. package/dist/cjs/nodeviews/lazy-media.js +1 -2
  7. package/dist/cjs/nodeviews/mediaGroupNext.js +1 -2
  8. package/dist/cjs/nodeviews/mediaNodeUpdater.js +140 -140
  9. package/dist/cjs/nodeviews/mediaNodeView/media.js +1 -2
  10. package/dist/cjs/nodeviews/mediaSingle.js +1 -2
  11. package/dist/cjs/nodeviews/mediaSingleNext.js +1 -2
  12. package/dist/cjs/pm-plugins/main.js +1 -2
  13. package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -2
  14. package/dist/cjs/ui/CaptionPlaceholder/index.js +1 -2
  15. package/dist/cjs/ui/CommentBadge/index.js +1 -2
  16. package/dist/cjs/ui/ImageBorder/styles.js +1 -2
  17. package/dist/cjs/ui/MediaLinkingToolbar.js +1 -2
  18. package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +1 -2
  19. package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -2
  20. package/dist/cjs/ui/ResizableMediaSingle/styles.js +1 -2
  21. package/dist/cjs/ui/toolbar/index.js +6 -7
  22. package/dist/cjs/ui/toolbar/linking-toolbar-appearance.js +1 -2
  23. package/dist/cjs/ui/toolbar/mediaInline.js +1 -2
  24. package/dist/es2019/nodeviews/lazy-media-group.js +3 -1
  25. package/dist/es2019/nodeviews/lazy-media-inline.js +3 -1
  26. package/dist/es2019/ui/toolbar/index.js +7 -7
  27. package/dist/esm/mediaPlugin.js +13 -13
  28. package/dist/esm/nodeviews/lazy-media-group.js +3 -1
  29. package/dist/esm/nodeviews/lazy-media-inline.js +3 -1
  30. package/dist/esm/nodeviews/mediaNodeUpdater.js +140 -140
  31. package/dist/esm/ui/toolbar/index.js +5 -5
  32. package/package.json +6 -6
@@ -342,12 +342,12 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
342
342
  }
343
343
  });
344
344
  _defineProperty(this, "shouldNodeBeDeepCopied", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
345
- var _ref10, _this$props$mediaOpti, _this$props$mediaOpti2, _this$mediaPluginStat;
345
+ var _ref0, _this$props$mediaOpti, _this$props$mediaOpti2, _this$mediaPluginStat;
346
346
  var scope, attrs, id, isIdentifierOutsideEditorScope;
347
347
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
348
348
  while (1) switch (_context8.prev = _context8.next) {
349
349
  case 0:
350
- scope = (_ref10 = (_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 && _ref10 !== void 0 ? _ref10 : 'context';
350
+ 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';
351
351
  if (!(scope === 'context')) {
352
352
  _context8.next = 7;
353
353
  break;
@@ -396,139 +396,139 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
396
396
  }
397
397
  }, _callee9);
398
398
  })));
399
- _defineProperty(this, "isNodeFromDifferentCollection", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
399
+ _defineProperty(this, "isNodeFromDifferentCollection", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
400
400
  var mediaProvider, currentCollectionName, attrs, nodeCollection, __contextId, contextId;
401
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
402
- while (1) switch (_context10.prev = _context10.next) {
401
+ return _regeneratorRuntime.wrap(function _callee0$(_context0) {
402
+ while (1) switch (_context0.prev = _context0.next) {
403
403
  case 0:
404
- _context10.next = 2;
404
+ _context0.next = 2;
405
405
  return _this.props.mediaProvider;
406
406
  case 2:
407
- mediaProvider = _context10.sent;
407
+ mediaProvider = _context0.sent;
408
408
  if (!(!mediaProvider || !mediaProvider.uploadParams)) {
409
- _context10.next = 5;
409
+ _context0.next = 5;
410
410
  break;
411
411
  }
412
- return _context10.abrupt("return", false);
412
+ return _context0.abrupt("return", false);
413
413
  case 5:
414
414
  currentCollectionName = mediaProvider.uploadParams.collection;
415
415
  attrs = _this.getAttrs();
416
416
  if (!(!attrs || attrs && !isMediaTypeSupported(attrs.type))) {
417
- _context10.next = 9;
417
+ _context0.next = 9;
418
418
  break;
419
419
  }
420
- return _context10.abrupt("return", false);
420
+ return _context0.abrupt("return", false);
421
421
  case 9:
422
422
  nodeCollection = attrs.collection, __contextId = attrs.__contextId;
423
- _context10.t0 = __contextId;
424
- if (_context10.t0) {
425
- _context10.next = 15;
423
+ _context0.t0 = __contextId;
424
+ if (_context0.t0) {
425
+ _context0.next = 15;
426
426
  break;
427
427
  }
428
- _context10.next = 14;
428
+ _context0.next = 14;
429
429
  return _this.getObjectId();
430
430
  case 14:
431
- _context10.t0 = _context10.sent;
431
+ _context0.t0 = _context0.sent;
432
432
  case 15:
433
- contextId = _context10.t0;
433
+ contextId = _context0.t0;
434
434
  if (!(contextId && currentCollectionName !== nodeCollection)) {
435
- _context10.next = 18;
435
+ _context0.next = 18;
436
436
  break;
437
437
  }
438
- return _context10.abrupt("return", true);
438
+ return _context0.abrupt("return", true);
439
439
  case 18:
440
- return _context10.abrupt("return", false);
440
+ return _context0.abrupt("return", false);
441
441
  case 19:
442
442
  case "end":
443
- return _context10.stop();
443
+ return _context0.stop();
444
444
  }
445
- }, _callee10);
445
+ }, _callee0);
446
446
  })));
447
447
  _defineProperty(this, "handleCopyFileSwitcher", /*#__PURE__*/function () {
448
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(attrs) {
448
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee1(attrs) {
449
449
  var mediaClient, source, destination, traceContext, _yield$mediaClient$fi, id, _sourceAP, copyV2Source, _destAP, copyV2Destination, _yield$mediaClient$fi2, _id;
450
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
451
- while (1) switch (_context11.prev = _context11.next) {
450
+ return _regeneratorRuntime.wrap(function _callee1$(_context1) {
451
+ while (1) switch (_context1.prev = _context1.next) {
452
452
  case 0:
453
453
  mediaClient = attrs.mediaClient, source = attrs.source, destination = attrs.destination, traceContext = attrs.traceContext;
454
- _context11.prev = 1;
455
- _context11.next = 4;
454
+ _context1.prev = 1;
455
+ _context1.next = 4;
456
456
  return mediaClient.file.copyFile(source, destination, undefined, traceContext);
457
457
  case 4:
458
- _yield$mediaClient$fi = _context11.sent;
458
+ _yield$mediaClient$fi = _context1.sent;
459
459
  id = _yield$mediaClient$fi.id;
460
- return _context11.abrupt("return", id);
460
+ return _context1.abrupt("return", id);
461
461
  case 9:
462
- _context11.prev = 9;
463
- _context11.t0 = _context11["catch"](1);
462
+ _context1.prev = 9;
463
+ _context1.t0 = _context1["catch"](1);
464
464
  if (!fg('platform_media_cross_client_copy')) {
465
- _context11.next = 21;
465
+ _context1.next = 21;
466
466
  break;
467
467
  }
468
468
  // calling /v2/file/copy by removing the auth tokens to make cross product copy and pastes
469
469
  _sourceAP = source.authProvider, copyV2Source = _objectWithoutProperties(source, _excluded);
470
470
  _destAP = destination.authProvider, copyV2Destination = _objectWithoutProperties(destination, _excluded2);
471
- _context11.next = 16;
471
+ _context1.next = 16;
472
472
  return mediaClient.file.copyFile(copyV2Source, copyV2Destination, undefined, traceContext);
473
473
  case 16:
474
- _yield$mediaClient$fi2 = _context11.sent;
474
+ _yield$mediaClient$fi2 = _context1.sent;
475
475
  _id = _yield$mediaClient$fi2.id;
476
- return _context11.abrupt("return", _id);
476
+ return _context1.abrupt("return", _id);
477
477
  case 21:
478
- throw _context11.t0;
478
+ throw _context1.t0;
479
479
  case 22:
480
480
  case "end":
481
- return _context11.stop();
481
+ return _context1.stop();
482
482
  }
483
- }, _callee11, null, [[1, 9]]);
483
+ }, _callee1, null, [[1, 9]]);
484
484
  }));
485
485
  return function (_x4) {
486
- return _ref13.apply(this, arguments);
486
+ return _ref11.apply(this, arguments);
487
487
  };
488
488
  }());
489
489
  _defineProperty(this, "copyNodeFromBlobUrl", /*#__PURE__*/function () {
490
- var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(getPos) {
490
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(getPos) {
491
491
  var attrs, url, mediaAttrs, mediaProvider, currentCollectionName, contextId, id, collection, height, width, mimeType, name, size, uploadMediaClientConfig, mediaClient, getAuthFromContext, mediaFileId, pos;
492
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
493
- while (1) switch (_context12.prev = _context12.next) {
492
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
493
+ while (1) switch (_context10.prev = _context10.next) {
494
494
  case 0:
495
495
  attrs = _this.getAttrs();
496
496
  if (!(!attrs || attrs.type !== 'external')) {
497
- _context12.next = 3;
497
+ _context10.next = 3;
498
498
  break;
499
499
  }
500
- return _context12.abrupt("return");
500
+ return _context10.abrupt("return");
501
501
  case 3:
502
502
  url = attrs.url;
503
503
  mediaAttrs = getAttrsFromUrl(url);
504
504
  if (mediaAttrs) {
505
- _context12.next = 7;
505
+ _context10.next = 7;
506
506
  break;
507
507
  }
508
- return _context12.abrupt("return");
508
+ return _context10.abrupt("return");
509
509
  case 7:
510
- _context12.next = 9;
510
+ _context10.next = 9;
511
511
  return _this.props.mediaProvider;
512
512
  case 9:
513
- mediaProvider = _context12.sent;
513
+ mediaProvider = _context10.sent;
514
514
  if (!(!mediaProvider || !mediaProvider.uploadParams)) {
515
- _context12.next = 12;
515
+ _context10.next = 12;
516
516
  break;
517
517
  }
518
- return _context12.abrupt("return");
518
+ return _context10.abrupt("return");
519
519
  case 12:
520
520
  currentCollectionName = mediaProvider.uploadParams.collection;
521
521
  contextId = mediaAttrs.contextId, id = mediaAttrs.id, collection = mediaAttrs.collection, height = mediaAttrs.height, width = mediaAttrs.width, mimeType = mediaAttrs.mimeType, name = mediaAttrs.name, size = mediaAttrs.size;
522
522
  uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
523
523
  if (!(!uploadMediaClientConfig || !uploadMediaClientConfig.getAuthFromContext)) {
524
- _context12.next = 17;
524
+ _context10.next = 17;
525
525
  break;
526
526
  }
527
- return _context12.abrupt("return");
527
+ return _context10.abrupt("return");
528
528
  case 17:
529
529
  mediaClient = getMediaClient(uploadMediaClientConfig);
530
530
  getAuthFromContext = uploadMediaClientConfig.getAuthFromContext;
531
- _context12.next = 21;
531
+ _context10.next = 21;
532
532
  return _this.handleCopyFileSwitcher({
533
533
  mediaClient: mediaClient,
534
534
  source: {
@@ -545,13 +545,13 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
545
545
  }
546
546
  });
547
547
  case 21:
548
- mediaFileId = _context12.sent;
548
+ mediaFileId = _context10.sent;
549
549
  pos = getPos();
550
550
  if (!(typeof pos !== 'number')) {
551
- _context12.next = 25;
551
+ _context10.next = 25;
552
552
  break;
553
553
  }
554
- return _context12.abrupt("return");
554
+ return _context10.abrupt("return");
555
555
  case 25:
556
556
  replaceExternalMedia(pos + 1, {
557
557
  id: mediaFileId,
@@ -564,37 +564,37 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
564
564
  })(_this.props.view.state, _this.props.view.dispatch);
565
565
  case 26:
566
566
  case "end":
567
- return _context12.stop();
567
+ return _context10.stop();
568
568
  }
569
- }, _callee12);
569
+ }, _callee10);
570
570
  }));
571
571
  return function (_x5) {
572
- return _ref14.apply(this, arguments);
572
+ return _ref12.apply(this, arguments);
573
573
  };
574
574
  }());
575
575
  // Copies the pasted node into the current collection using a getPos handler
576
576
  _defineProperty(this, "copyNodeFromPos", /*#__PURE__*/function () {
577
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(getPos, traceContext) {
577
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(getPos, traceContext) {
578
578
  var attrs, copiedAttrs;
579
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
580
- while (1) switch (_context13.prev = _context13.next) {
579
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
580
+ while (1) switch (_context11.prev = _context11.next) {
581
581
  case 0:
582
582
  attrs = _this.getAttrs();
583
583
  if (!(!attrs || attrs && !isMediaTypeSupported(attrs.type))) {
584
- _context13.next = 3;
584
+ _context11.next = 3;
585
585
  break;
586
586
  }
587
- return _context13.abrupt("return");
587
+ return _context11.abrupt("return");
588
588
  case 3:
589
- _context13.next = 5;
589
+ _context11.next = 5;
590
590
  return _this.copyFile(attrs.id, attrs.collection, traceContext);
591
591
  case 5:
592
- copiedAttrs = _context13.sent;
592
+ copiedAttrs = _context11.sent;
593
593
  if (copiedAttrs) {
594
- _context13.next = 8;
594
+ _context11.next = 8;
595
595
  break;
596
596
  }
597
- return _context13.abrupt("return");
597
+ return _context11.abrupt("return");
598
598
  case 8:
599
599
  updateCurrentMediaNodeAttrs(copiedAttrs, {
600
600
  node: _this.props.node,
@@ -602,82 +602,82 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
602
602
  })(_this.props.view.state, _this.props.view.dispatch);
603
603
  case 9:
604
604
  case "end":
605
- return _context13.stop();
605
+ return _context11.stop();
606
606
  }
607
- }, _callee13);
607
+ }, _callee11);
608
608
  }));
609
609
  return function (_x6, _x7) {
610
- return _ref15.apply(this, arguments);
610
+ return _ref13.apply(this, arguments);
611
611
  };
612
612
  }());
613
613
  // Copies the pasted node into the current collection
614
614
  _defineProperty(this, "copyNode", /*#__PURE__*/function () {
615
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(traceContext) {
615
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(traceContext) {
616
616
  var attrs, view, copiedAttrs;
617
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
618
- while (1) switch (_context14.prev = _context14.next) {
617
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
618
+ while (1) switch (_context12.prev = _context12.next) {
619
619
  case 0:
620
620
  attrs = _this.getAttrs();
621
621
  view = _this.props.view;
622
622
  if (!(!attrs || attrs && !isMediaTypeSupported(attrs.type))) {
623
- _context14.next = 4;
623
+ _context12.next = 4;
624
624
  break;
625
625
  }
626
- return _context14.abrupt("return");
626
+ return _context12.abrupt("return");
627
627
  case 4:
628
- _context14.next = 6;
628
+ _context12.next = 6;
629
629
  return _this.copyFile(attrs.id, attrs.collection, traceContext);
630
630
  case 6:
631
- copiedAttrs = _context14.sent;
631
+ copiedAttrs = _context12.sent;
632
632
  if (copiedAttrs) {
633
- _context14.next = 9;
633
+ _context12.next = 9;
634
634
  break;
635
635
  }
636
- return _context14.abrupt("return");
636
+ return _context12.abrupt("return");
637
637
  case 9:
638
638
  updateMediaNodeAttrs(attrs.id, copiedAttrs)(view.state, view.dispatch);
639
639
  case 10:
640
640
  case "end":
641
- return _context14.stop();
641
+ return _context12.stop();
642
642
  }
643
- }, _callee14);
643
+ }, _callee12);
644
644
  }));
645
645
  return function (_x8) {
646
- return _ref16.apply(this, arguments);
646
+ return _ref14.apply(this, arguments);
647
647
  };
648
648
  }());
649
649
  _defineProperty(this, "copyFile", /*#__PURE__*/function () {
650
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id, collection, traceContext) {
650
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id, collection, traceContext) {
651
651
  var mediaProvider, nodeContextId, uploadMediaClientConfig, mediaClient, currentCollectionName, objectId, getAuthFromContext, mediaFileId;
652
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
653
- while (1) switch (_context15.prev = _context15.next) {
652
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
653
+ while (1) switch (_context13.prev = _context13.next) {
654
654
  case 0:
655
- _context15.next = 2;
655
+ _context13.next = 2;
656
656
  return _this.props.mediaProvider;
657
657
  case 2:
658
- mediaProvider = _context15.sent;
658
+ mediaProvider = _context13.sent;
659
659
  if (mediaProvider !== null && mediaProvider !== void 0 && mediaProvider.uploadParams) {
660
- _context15.next = 5;
660
+ _context13.next = 5;
661
661
  break;
662
662
  }
663
- return _context15.abrupt("return");
663
+ return _context13.abrupt("return");
664
664
  case 5:
665
665
  nodeContextId = _this.getNodeContextId();
666
666
  uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
667
667
  if (!(!(uploadMediaClientConfig !== null && uploadMediaClientConfig !== void 0 && uploadMediaClientConfig.getAuthFromContext) || !nodeContextId)) {
668
- _context15.next = 9;
668
+ _context13.next = 9;
669
669
  break;
670
670
  }
671
- return _context15.abrupt("return");
671
+ return _context13.abrupt("return");
672
672
  case 9:
673
673
  mediaClient = getMediaClient(uploadMediaClientConfig);
674
674
  currentCollectionName = mediaProvider.uploadParams.collection;
675
- _context15.next = 13;
675
+ _context13.next = 13;
676
676
  return _this.getObjectId();
677
677
  case 13:
678
- objectId = _context15.sent;
678
+ objectId = _context13.sent;
679
679
  getAuthFromContext = uploadMediaClientConfig.getAuthFromContext;
680
- _context15.next = 17;
680
+ _context13.next = 17;
681
681
  return _this.handleCopyFileSwitcher({
682
682
  mediaClient: mediaClient,
683
683
  source: {
@@ -695,20 +695,20 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
695
695
  traceContext: traceContext
696
696
  });
697
697
  case 17:
698
- mediaFileId = _context15.sent;
699
- return _context15.abrupt("return", {
698
+ mediaFileId = _context13.sent;
699
+ return _context13.abrupt("return", {
700
700
  id: mediaFileId,
701
701
  collection: currentCollectionName,
702
702
  __contextId: objectId
703
703
  });
704
704
  case 19:
705
705
  case "end":
706
- return _context15.stop();
706
+ return _context13.stop();
707
707
  }
708
- }, _callee15);
708
+ }, _callee13);
709
709
  }));
710
- return function (_x9, _x10, _x11) {
711
- return _ref17.apply(this, arguments);
710
+ return function (_x9, _x0, _x1) {
711
+ return _ref15.apply(this, arguments);
712
712
  };
713
713
  }());
714
714
  this.props = props;
@@ -728,42 +728,42 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
728
728
  }, {
729
729
  key: "getRemoteDimensions",
730
730
  value: function () {
731
- var _getRemoteDimensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
731
+ var _getRemoteDimensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
732
732
  var mediaProvider, mediaOptions, attrs, height, width, id, collection, viewMediaClientConfig, mediaClient, currentState, imageMetadata;
733
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
734
- while (1) switch (_context16.prev = _context16.next) {
733
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
734
+ while (1) switch (_context14.prev = _context14.next) {
735
735
  case 0:
736
- _context16.next = 2;
736
+ _context14.next = 2;
737
737
  return this.props.mediaProvider;
738
738
  case 2:
739
- mediaProvider = _context16.sent;
739
+ mediaProvider = _context14.sent;
740
740
  mediaOptions = this.props.mediaOptions;
741
741
  attrs = this.getAttrs();
742
742
  if (!(!mediaProvider || !attrs)) {
743
- _context16.next = 7;
743
+ _context14.next = 7;
744
744
  break;
745
745
  }
746
- return _context16.abrupt("return", false);
746
+ return _context14.abrupt("return", false);
747
747
  case 7:
748
748
  height = attrs.height, width = attrs.width;
749
749
  if (!(attrs.type === 'external' || !attrs.id)) {
750
- _context16.next = 10;
750
+ _context14.next = 10;
751
751
  break;
752
752
  }
753
- return _context16.abrupt("return", false);
753
+ return _context14.abrupt("return", false);
754
754
  case 10:
755
755
  id = attrs.id, collection = attrs.collection;
756
756
  if (!(height && width)) {
757
- _context16.next = 13;
757
+ _context14.next = 13;
758
758
  break;
759
759
  }
760
- return _context16.abrupt("return", false);
760
+ return _context14.abrupt("return", false);
761
761
  case 13:
762
762
  if (!(mediaOptions && !mediaOptions.allowRemoteDimensionsFetch)) {
763
- _context16.next = 15;
763
+ _context14.next = 15;
764
764
  break;
765
765
  }
766
- return _context16.abrupt("return", {
766
+ return _context14.abrupt("return", {
767
767
  id: id,
768
768
  height: DEFAULT_IMAGE_HEIGHT,
769
769
  width: DEFAULT_IMAGE_WIDTH
@@ -771,40 +771,40 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
771
771
  case 15:
772
772
  viewMediaClientConfig = mediaProvider.viewMediaClientConfig;
773
773
  mediaClient = getMediaClient(viewMediaClientConfig);
774
- _context16.next = 19;
774
+ _context14.next = 19;
775
775
  return mediaClient.file.getCurrentState(id, {
776
776
  collectionName: collection
777
777
  });
778
778
  case 19:
779
- currentState = _context16.sent;
779
+ currentState = _context14.sent;
780
780
  if (isImageRepresentationReady(currentState)) {
781
- _context16.next = 22;
781
+ _context14.next = 22;
782
782
  break;
783
783
  }
784
- return _context16.abrupt("return", false);
784
+ return _context14.abrupt("return", false);
785
785
  case 22:
786
- _context16.next = 24;
786
+ _context14.next = 24;
787
787
  return mediaClient.getImageMetadata(id, {
788
788
  collection: collection
789
789
  });
790
790
  case 24:
791
- imageMetadata = _context16.sent;
791
+ imageMetadata = _context14.sent;
792
792
  if (!(!imageMetadata || !imageMetadata.original)) {
793
- _context16.next = 27;
793
+ _context14.next = 27;
794
794
  break;
795
795
  }
796
- return _context16.abrupt("return", false);
796
+ return _context14.abrupt("return", false);
797
797
  case 27:
798
- return _context16.abrupt("return", {
798
+ return _context14.abrupt("return", {
799
799
  id: id,
800
800
  height: imageMetadata.original.height || DEFAULT_IMAGE_HEIGHT,
801
801
  width: imageMetadata.original.width || DEFAULT_IMAGE_WIDTH
802
802
  });
803
803
  case 28:
804
804
  case "end":
805
- return _context16.stop();
805
+ return _context14.stop();
806
806
  }
807
- }, _callee16, this);
807
+ }, _callee14, this);
808
808
  }));
809
809
  function getRemoteDimensions() {
810
810
  return _getRemoteDimensions.apply(this, arguments);
@@ -814,38 +814,38 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
814
814
  }, {
815
815
  key: "handleExternalMedia",
816
816
  value: function () {
817
- var _handleExternalMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(getPos) {
818
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
819
- while (1) switch (_context17.prev = _context17.next) {
817
+ var _handleExternalMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(getPos) {
818
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
819
+ while (1) switch (_context15.prev = _context15.next) {
820
820
  case 0:
821
821
  if (!this.isMediaBlobUrl()) {
822
- _context17.next = 12;
822
+ _context15.next = 12;
823
823
  break;
824
824
  }
825
- _context17.prev = 1;
826
- _context17.next = 4;
825
+ _context15.prev = 1;
826
+ _context15.next = 4;
827
827
  return this.copyNodeFromBlobUrl(getPos);
828
828
  case 4:
829
- _context17.next = 10;
829
+ _context15.next = 10;
830
830
  break;
831
831
  case 6:
832
- _context17.prev = 6;
833
- _context17.t0 = _context17["catch"](1);
834
- _context17.next = 10;
832
+ _context15.prev = 6;
833
+ _context15.t0 = _context15["catch"](1);
834
+ _context15.next = 10;
835
835
  return this.uploadExternalMedia(getPos);
836
836
  case 10:
837
- _context17.next = 14;
837
+ _context15.next = 14;
838
838
  break;
839
839
  case 12:
840
- _context17.next = 14;
840
+ _context15.next = 14;
841
841
  return this.uploadExternalMedia(getPos);
842
842
  case 14:
843
843
  case "end":
844
- return _context17.stop();
844
+ return _context15.stop();
845
845
  }
846
- }, _callee17, this, [[1, 6]]);
846
+ }, _callee15, this, [[1, 6]]);
847
847
  }));
848
- function handleExternalMedia(_x12) {
848
+ function handleExternalMedia(_x10) {
849
849
  return _handleExternalMedia.apply(this, arguments);
850
850
  }
851
851
  return handleExternalMedia;
@@ -808,7 +808,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
808
808
  selectedNodeType = state.selection.node.type;
809
809
  }
810
810
  if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
811
- var _pluginInjectionApi$a10, _pluginInjectionApi$f2;
811
+ var _pluginInjectionApi$a0, _pluginInjectionApi$f2;
812
812
  var mediaOffset = state.selection.$from.parentOffset + 1;
813
813
  baseToolbar.getDomRef = function () {
814
814
  var _mediaPluginState$ele2;
@@ -817,7 +817,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
817
817
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
818
818
  return (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(selector);
819
819
  };
820
- items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector, isViewOnly);
820
+ items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a0 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a0 === void 0 ? void 0 : _pluginInjectionApi$a0.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector, isViewOnly);
821
821
  } else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
822
822
  items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
823
823
  } else {
@@ -831,9 +831,9 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
831
831
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
832
832
  }
833
833
  if (!mediaPluginState.isResizing && editorExperiment('platform_editor_controls', 'variant1')) {
834
- var _pluginInjectionApi$a11, _pluginInjectionApi$a12;
834
+ var _pluginInjectionApi$a1, _pluginInjectionApi$a10;
835
835
  updateToFullHeightSeparator(items);
836
- var customOptions = [].concat(_toConsumableArray(getLinkingDropdownOptions(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly)), _toConsumableArray(getAltTextDropdownOption(state, intl.formatMessage, allowAltTextOnImages, selectedNodeType, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a11 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a11 === void 0 ? void 0 : _pluginInjectionApi$a11.actions)), _toConsumableArray(getResizeDropdownOption(options, state, intl.formatMessage, selectedNodeType)));
836
+ var customOptions = [].concat(_toConsumableArray(getLinkingDropdownOptions(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly)), _toConsumableArray(getAltTextDropdownOption(state, intl.formatMessage, allowAltTextOnImages, selectedNodeType, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a1 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a1 === void 0 ? void 0 : _pluginInjectionApi$a1.actions)), _toConsumableArray(getResizeDropdownOption(options, state, intl.formatMessage, selectedNodeType)));
837
837
  if (customOptions.length) {
838
838
  customOptions.push({
839
839
  type: 'separator'
@@ -864,7 +864,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
864
864
  })
865
865
  }, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)), _objectSpread({
866
866
  title: intl === null || intl === void 0 ? void 0 : intl.formatMessage(commonMessages.delete),
867
- onClick: fg('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a12 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a12 === void 0 ? void 0 : _pluginInjectionApi$a12.actions, selectedNodeType) : remove,
867
+ onClick: fg('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, selectedNodeType) : remove,
868
868
  icon: /*#__PURE__*/React.createElement(DeleteIcon, {
869
869
  label: ""
870
870
  })