@atlaskit/editor-plugin-media 2.3.21 → 2.4.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/nodeviews/mediaGroup.js +1 -1
  3. package/dist/cjs/nodeviews/mediaSingle.js +1 -1
  4. package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
  5. package/dist/cjs/ui/toolbar/alt-text.js +2 -1
  6. package/dist/cjs/ui/toolbar/index.js +8 -5
  7. package/dist/es2019/nodeviews/mediaGroup.js +1 -1
  8. package/dist/es2019/nodeviews/mediaSingle.js +1 -1
  9. package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
  10. package/dist/es2019/ui/toolbar/alt-text.js +2 -1
  11. package/dist/es2019/ui/toolbar/index.js +10 -5
  12. package/dist/esm/nodeviews/mediaGroup.js +1 -1
  13. package/dist/esm/nodeviews/mediaSingle.js +1 -1
  14. package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
  15. package/dist/esm/ui/toolbar/alt-text.js +2 -1
  16. package/dist/esm/ui/toolbar/index.js +8 -5
  17. package/dist/types/index.d.ts +1 -0
  18. package/dist/types/nodeviews/lazy-media-group.d.ts +1 -2
  19. package/dist/types/nodeviews/lazy-media.d.ts +1 -2
  20. package/dist/types/nodeviews/mediaGroup.d.ts +1 -1
  21. package/dist/types/nodeviews/mediaNodeView/index.d.ts +2 -2
  22. package/dist/types/types/index.d.ts +7 -1
  23. package/dist/types-ts4.5/index.d.ts +1 -0
  24. package/dist/types-ts4.5/nodeviews/lazy-media-group.d.ts +1 -2
  25. package/dist/types-ts4.5/nodeviews/lazy-media.d.ts +1 -2
  26. package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +1 -1
  27. package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +2 -2
  28. package/dist/types-ts4.5/types/index.d.ts +7 -1
  29. package/package.json +12 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @atlaskit/editor-plugin-media
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#139139](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139139)
8
+ [`7f6b665d778dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f6b665d778dd) -
9
+ [https://product-fabric.atlassian.net/browse/ED-27499](ED-27499) - the new
10
+ `@atlassian/confluence-presets` package with Confluence `full-page` preset is created
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 2.3.22
17
+
18
+ ### Patch Changes
19
+
20
+ - [#137128](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137128)
21
+ [`9717d76a633ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9717d76a633ca) -
22
+ [ux] Fix media custom toolbar position issue
23
+ - [#137153](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137153)
24
+ [`105ebf2f4f54b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/105ebf2f4f54b) -
25
+ [ED-27125] This change is adding a feature gate to use the functional components for media nodes
26
+ which will resolve the bug of attachment duplication when copying and pasting.
27
+ - Updated dependencies
28
+
3
29
  ## 2.3.21
4
30
 
5
31
  ### Patch Changes
@@ -348,7 +348,7 @@ var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
348
348
  if (!mediaProvider) {
349
349
  return null;
350
350
  }
351
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single')) {
351
+ if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single') || (0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single_jira')) {
352
352
  return /*#__PURE__*/_react.default.createElement(_mediaGroupNext.MediaGroupNext, {
353
353
  node: _this3.node,
354
354
  getPos: getPos,
@@ -565,7 +565,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
565
565
  var mediaProvider = (0, _react.useMemo)(function () {
566
566
  return mediaState !== null && mediaState !== void 0 && mediaState.mediaProvider ? Promise.resolve(mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider) : undefined;
567
567
  }, [mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider]);
568
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single')) {
568
+ if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single') || (0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single_jira')) {
569
569
  return (0, _react2.jsx)(_mediaSingleNext.MediaSingleNodeNext, {
570
570
  width: (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0,
571
571
  lineLength: (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0,
@@ -1075,7 +1075,7 @@ var ResizableMediaSingleToggle = function ResizableMediaSingleToggle(_ref9) {
1075
1075
  viewMediaClientConfig = _ref9.viewMediaClientConfig,
1076
1076
  width = _ref9.width,
1077
1077
  forceHandlePositioning = _ref9.forceHandlePositioning;
1078
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single')) {
1078
+ if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single') || (0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single_jira')) {
1079
1079
  return (0, _react2.jsx)(ResizableMediaSingleNextFunctional, {
1080
1080
  allowBreakoutSnapPoints: allowBreakoutSnapPoints
1081
1081
  // eslint-disable-next-line react/no-children-prop
@@ -95,7 +95,8 @@ var getAltTextDropdownOption = exports.getAltTextDropdownOption = function getAl
95
95
  onClick: (0, _commands.openMediaAltTextMenu)(editorAnalyticsAPI),
96
96
  icon: /*#__PURE__*/_react.default.createElement(_text.default, {
97
97
  label: ""
98
- })
98
+ }),
99
+ testId: 'media-alt-text-dropdown-option'
99
100
  }];
100
101
  }
101
102
  return [];
@@ -720,11 +720,14 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
720
720
  return;
721
721
  }
722
722
  var nodeType = allowMediaInline ? [mediaInline, mediaSingle, media] : [mediaSingle];
723
+ var isSelectedNodeMediaSingle = state.selection instanceof _state2.NodeSelection && state.selection.node.type === mediaSingle;
723
724
  var baseToolbar = {
724
725
  title: 'Media floating controls',
725
726
  nodeType: nodeType,
726
727
  getDomRef: function getDomRef() {
727
- return mediaPluginState.element;
728
+ var _mediaPluginState$ele;
729
+ var element = isSelectedNodeMediaSingle && (0, _platformFeatureFlags.fg)('platform_editor_media_single_toolbar_target') ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(".".concat(_styles.MediaSingleNodeSelector))) || mediaPluginState.element : mediaPluginState.element;
730
+ return element;
728
731
  }
729
732
  };
730
733
  if (allowLinking && mediaLinkingState && mediaLinkingState.visible && (0, _linking3.shouldShowMediaLinkToolbar)(state)) {
@@ -767,21 +770,21 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
767
770
  var _pluginInjectionApi$a8, _pluginInjectionApi$f2;
768
771
  var mediaOffset = state.selection.$from.parentOffset + 1;
769
772
  baseToolbar.getDomRef = function () {
770
- var _mediaPluginState$ele;
773
+ var _mediaPluginState$ele2;
771
774
  var selector = (0, _mediaFilmstrip.mediaFilmstripItemDOMSelector)(mediaOffset);
772
775
  // Ignored via go/ees005
773
776
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
774
- return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
777
+ return (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(selector);
775
778
  };
776
779
  items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.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);
777
780
  } else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
778
781
  items = (0, _mediaInline2.generateMediaInlineFloatingToolbar)(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
779
782
  } else {
780
783
  baseToolbar.getDomRef = function () {
781
- var _mediaPluginState$ele2;
784
+ var _mediaPluginState$ele3;
782
785
  // Ignored via go/ees005
783
786
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
784
- var element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(".".concat(_styles.MediaSingleNodeSelector));
787
+ var element = (_mediaPluginState$ele3 = mediaPluginState.element) === null || _mediaPluginState$ele3 === void 0 ? void 0 : _mediaPluginState$ele3.querySelector(".".concat(_styles.MediaSingleNodeSelector));
785
788
  return element || mediaPluginState.element;
786
789
  };
787
790
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
@@ -296,7 +296,7 @@ class MediaGroupNodeView extends ReactNodeView {
296
296
  if (!mediaProvider) {
297
297
  return null;
298
298
  }
299
- if (fg('platform_editor_react18_phase2__media_single')) {
299
+ if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
300
300
  return /*#__PURE__*/React.createElement(MediaGroupNext, {
301
301
  node: this.node,
302
302
  getPos: getPos,
@@ -480,7 +480,7 @@ const MediaSingleNodeWrapper = ({
480
480
  editorViewModeState
481
481
  } = useSharedPluginState(pluginInjectionApi, ['width', 'media', 'annotation', 'editorDisabled', 'editorViewMode']);
482
482
  const mediaProvider = useMemo(() => mediaState !== null && mediaState !== void 0 && mediaState.mediaProvider ? Promise.resolve(mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider) : undefined, [mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider]);
483
- if (fg('platform_editor_react18_phase2__media_single')) {
483
+ if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
484
484
  return jsx(MediaSingleNodeNext, {
485
485
  width: (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0,
486
486
  lineLength: (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0,
@@ -983,7 +983,7 @@ const ResizableMediaSingleToggle = ({
983
983
  width,
984
984
  forceHandlePositioning
985
985
  }) => {
986
- if (fg('platform_editor_react18_phase2__media_single')) {
986
+ if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
987
987
  return jsx(ResizableMediaSingleNextFunctional, {
988
988
  allowBreakoutSnapPoints: allowBreakoutSnapPoints
989
989
  // eslint-disable-next-line react/no-children-prop
@@ -91,7 +91,8 @@ export const getAltTextDropdownOption = (state, formatMessage, allowAltTextOnIma
91
91
  onClick: openMediaAltTextMenu(editorAnalyticsAPI),
92
92
  icon: /*#__PURE__*/React.createElement(TextIcon, {
93
93
  label: ""
94
- })
94
+ }),
95
+ testId: 'media-alt-text-dropdown-option'
95
96
  }];
96
97
  }
97
98
  return [];
@@ -717,10 +717,15 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
717
717
  return;
718
718
  }
719
719
  const nodeType = allowMediaInline ? [mediaInline, mediaSingle, media] : [mediaSingle];
720
+ const isSelectedNodeMediaSingle = state.selection instanceof NodeSelection && state.selection.node.type === mediaSingle;
720
721
  const baseToolbar = {
721
722
  title: 'Media floating controls',
722
723
  nodeType,
723
- getDomRef: () => mediaPluginState.element
724
+ getDomRef: () => {
725
+ var _mediaPluginState$ele;
726
+ const element = isSelectedNodeMediaSingle && fg('platform_editor_media_single_toolbar_target') ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(`.${MediaSingleNodeSelector}`)) || mediaPluginState.element : mediaPluginState.element;
727
+ return element;
728
+ }
724
729
  };
725
730
  if (allowLinking && mediaLinkingState && mediaLinkingState.visible && shouldShowMediaLinkToolbar(state)) {
726
731
  const linkingToolbar = getLinkingToolbar(baseToolbar, mediaLinkingState, state, intl, pluginInjectionApi, providerFactory);
@@ -764,21 +769,21 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
764
769
  var _pluginInjectionApi$a8, _pluginInjectionApi$f3, _pluginInjectionApi$f4;
765
770
  const mediaOffset = state.selection.$from.parentOffset + 1;
766
771
  baseToolbar.getDomRef = () => {
767
- var _mediaPluginState$ele;
772
+ var _mediaPluginState$ele2;
768
773
  const selector = mediaFilmstripItemDOMSelector(mediaOffset);
769
774
  // Ignored via go/ees005
770
775
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
771
- return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
776
+ return (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(selector);
772
777
  };
773
778
  items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f3 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f3 === void 0 ? void 0 : (_pluginInjectionApi$f4 = _pluginInjectionApi$f3.actions) === null || _pluginInjectionApi$f4 === void 0 ? void 0 : _pluginInjectionApi$f4.forceFocusSelector, isViewOnly);
774
779
  } else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
775
780
  items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
776
781
  } else {
777
782
  baseToolbar.getDomRef = () => {
778
- var _mediaPluginState$ele2;
783
+ var _mediaPluginState$ele3;
779
784
  // Ignored via go/ees005
780
785
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
781
- const element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(`.${MediaSingleNodeSelector}`);
786
+ const element = (_mediaPluginState$ele3 = mediaPluginState.element) === null || _mediaPluginState$ele3 === void 0 ? void 0 : _mediaPluginState$ele3.querySelector(`.${MediaSingleNodeSelector}`);
782
787
  return element || mediaPluginState.element;
783
788
  };
784
789
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
@@ -341,7 +341,7 @@ var MediaGroupNodeView = /*#__PURE__*/function (_ReactNodeView) {
341
341
  if (!mediaProvider) {
342
342
  return null;
343
343
  }
344
- if (fg('platform_editor_react18_phase2__media_single')) {
344
+ if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
345
345
  return /*#__PURE__*/React.createElement(MediaGroupNext, {
346
346
  node: _this3.node,
347
347
  getPos: getPos,
@@ -560,7 +560,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
560
560
  var mediaProvider = useMemo(function () {
561
561
  return mediaState !== null && mediaState !== void 0 && mediaState.mediaProvider ? Promise.resolve(mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider) : undefined;
562
562
  }, [mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider]);
563
- if (fg('platform_editor_react18_phase2__media_single')) {
563
+ if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
564
564
  return jsx(MediaSingleNodeNext, {
565
565
  width: (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0,
566
566
  lineLength: (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0,
@@ -1068,7 +1068,7 @@ var ResizableMediaSingleToggle = function ResizableMediaSingleToggle(_ref9) {
1068
1068
  viewMediaClientConfig = _ref9.viewMediaClientConfig,
1069
1069
  width = _ref9.width,
1070
1070
  forceHandlePositioning = _ref9.forceHandlePositioning;
1071
- if (fg('platform_editor_react18_phase2__media_single')) {
1071
+ if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
1072
1072
  return jsx(ResizableMediaSingleNextFunctional, {
1073
1073
  allowBreakoutSnapPoints: allowBreakoutSnapPoints
1074
1074
  // eslint-disable-next-line react/no-children-prop
@@ -88,7 +88,8 @@ export var getAltTextDropdownOption = function getAltTextDropdownOption(state, f
88
88
  onClick: openMediaAltTextMenu(editorAnalyticsAPI),
89
89
  icon: /*#__PURE__*/React.createElement(TextIcon, {
90
90
  label: ""
91
- })
91
+ }),
92
+ testId: 'media-alt-text-dropdown-option'
92
93
  }];
93
94
  }
94
95
  return [];
@@ -710,11 +710,14 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
710
710
  return;
711
711
  }
712
712
  var nodeType = allowMediaInline ? [mediaInline, mediaSingle, media] : [mediaSingle];
713
+ var isSelectedNodeMediaSingle = state.selection instanceof NodeSelection && state.selection.node.type === mediaSingle;
713
714
  var baseToolbar = {
714
715
  title: 'Media floating controls',
715
716
  nodeType: nodeType,
716
717
  getDomRef: function getDomRef() {
717
- return mediaPluginState.element;
718
+ var _mediaPluginState$ele;
719
+ var element = isSelectedNodeMediaSingle && fg('platform_editor_media_single_toolbar_target') ? ((_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(".".concat(MediaSingleNodeSelector))) || mediaPluginState.element : mediaPluginState.element;
720
+ return element;
718
721
  }
719
722
  };
720
723
  if (allowLinking && mediaLinkingState && mediaLinkingState.visible && shouldShowMediaLinkToolbar(state)) {
@@ -757,21 +760,21 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
757
760
  var _pluginInjectionApi$a8, _pluginInjectionApi$f2;
758
761
  var mediaOffset = state.selection.$from.parentOffset + 1;
759
762
  baseToolbar.getDomRef = function () {
760
- var _mediaPluginState$ele;
763
+ var _mediaPluginState$ele2;
761
764
  var selector = mediaFilmstripItemDOMSelector(mediaOffset);
762
765
  // Ignored via go/ees005
763
766
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
764
- return (_mediaPluginState$ele = mediaPluginState.element) === null || _mediaPluginState$ele === void 0 ? void 0 : _mediaPluginState$ele.querySelector(selector);
767
+ return (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(selector);
765
768
  };
766
769
  items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.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);
767
770
  } else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
768
771
  items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
769
772
  } else {
770
773
  baseToolbar.getDomRef = function () {
771
- var _mediaPluginState$ele2;
774
+ var _mediaPluginState$ele3;
772
775
  // Ignored via go/ees005
773
776
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
774
- var element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(".".concat(MediaSingleNodeSelector));
777
+ var element = (_mediaPluginState$ele3 = mediaPluginState.element) === null || _mediaPluginState$ele3 === void 0 ? void 0 : _mediaPluginState$ele3.querySelector(".".concat(MediaSingleNodeSelector));
775
778
  return element || mediaPluginState.element;
776
779
  };
777
780
  items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
@@ -1,2 +1,3 @@
1
1
  export type { MediaNextEditorPluginType as MediaPlugin } from './mediaPluginType';
2
+ export type { MediaPluginOptions } from './types/index';
2
3
  export { mediaPlugin } from './mediaPlugin';
@@ -3,5 +3,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
4
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
5
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
6
- import type { MediaOptions } from '../types';
7
- export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
6
+ export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: import("../types").MediaPluginOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
@@ -4,5 +4,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
4
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
7
- import type { MediaOptions } from '../types';
8
- export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
7
+ export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: import("../types").MediaPluginOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
@@ -27,4 +27,4 @@ declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<M
27
27
  WrappedComponent: React.ComponentType<MediaGroupProps>;
28
28
  };
29
29
  export default IntlMediaGroup;
30
- export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
30
+ export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: import("../types").MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -8,7 +8,7 @@ import type { ExtractInjectionAPI, EditorContainerWidth as WidthPluginState } fr
8
8
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
11
- import type { getPosHandler, MediaOptions } from '../../types';
11
+ import type { getPosHandler } from '../../types';
12
12
  import type { MediaNodeViewProps } from '../types';
13
13
  interface MediaNodeWithPluginStateComponentProps {
14
14
  width?: WidthPluginState;
@@ -29,5 +29,5 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
29
29
  renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
30
30
  render(): React.JSX.Element;
31
31
  }
32
- export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
32
+ export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: import("../../types").MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
33
33
  export {};
@@ -15,7 +15,7 @@ interface PlaceholderTextOptions {
15
15
  export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
16
16
  export type MediaSingleWithType = 'pixel' | 'percentage';
17
17
  export type MediaCopyScope = 'editor' | 'context';
18
- export interface MediaOptions {
18
+ export interface MediaPluginOptions {
19
19
  provider?: Providers['mediaProvider'];
20
20
  /**
21
21
  * @experimental
@@ -56,6 +56,12 @@ export interface MediaOptions {
56
56
  forceHandlePositioning?: HandlePositioning;
57
57
  mediaShallowCopyScope?: MediaCopyScope;
58
58
  }
59
+ /**
60
+ * @private
61
+ * @deprecated Use {@link MediaPluginOptions} instead.
62
+ * @see https://product-fabric.atlassian.net/browse/ED-27496
63
+ */
64
+ export type MediaOptions = MediaPluginOptions;
59
65
  export interface MediaSingleOptions {
60
66
  disableLayout?: boolean;
61
67
  }
@@ -1,2 +1,3 @@
1
1
  export type { MediaNextEditorPluginType as MediaPlugin } from './mediaPluginType';
2
+ export type { MediaPluginOptions } from './types/index';
2
3
  export { mediaPlugin } from './mediaPlugin';
@@ -3,5 +3,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
3
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
4
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
5
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
6
- import type { MediaOptions } from '../types';
7
- export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
6
+ export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: import("../types").MediaPluginOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
@@ -4,5 +4,4 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
4
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
6
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
7
- import type { MediaOptions } from '../types';
8
- export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
7
+ export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: import("../types").MediaPluginOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
@@ -27,4 +27,4 @@ declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<M
27
27
  WrappedComponent: React.ComponentType<MediaGroupProps>;
28
28
  };
29
29
  export default IntlMediaGroup;
30
- export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
30
+ export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: import("../types").MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -8,7 +8,7 @@ import type { ExtractInjectionAPI, EditorContainerWidth as WidthPluginState } fr
8
8
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
11
- import type { getPosHandler, MediaOptions } from '../../types';
11
+ import type { getPosHandler } from '../../types';
12
12
  import type { MediaNodeViewProps } from '../types';
13
13
  interface MediaNodeWithPluginStateComponentProps {
14
14
  width?: WidthPluginState;
@@ -29,5 +29,5 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
29
29
  renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
30
30
  render(): React.JSX.Element;
31
31
  }
32
- export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
32
+ export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: import("../../types").MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
33
33
  export {};
@@ -15,7 +15,7 @@ interface PlaceholderTextOptions {
15
15
  export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
16
16
  export type MediaSingleWithType = 'pixel' | 'percentage';
17
17
  export type MediaCopyScope = 'editor' | 'context';
18
- export interface MediaOptions {
18
+ export interface MediaPluginOptions {
19
19
  provider?: Providers['mediaProvider'];
20
20
  /**
21
21
  * @experimental
@@ -56,6 +56,12 @@ export interface MediaOptions {
56
56
  forceHandlePositioning?: HandlePositioning;
57
57
  mediaShallowCopyScope?: MediaCopyScope;
58
58
  }
59
+ /**
60
+ * @private
61
+ * @deprecated Use {@link MediaPluginOptions} instead.
62
+ * @see https://product-fabric.atlassian.net/browse/ED-27496
63
+ */
64
+ export type MediaOptions = MediaPluginOptions;
59
65
  export interface MediaSingleOptions {
60
66
  disableLayout?: boolean;
61
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "2.3.21",
3
+ "version": "2.4.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,15 +38,15 @@
38
38
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
39
39
  "@atlaskit/analytics-next": "^11.0.0",
40
40
  "@atlaskit/button": "^23.0.0",
41
- "@atlaskit/editor-common": "^103.0.0",
41
+ "@atlaskit/editor-common": "^103.4.0",
42
42
  "@atlaskit/editor-palette": "^2.1.0",
43
43
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
44
- "@atlaskit/editor-plugin-annotation": "^2.2.0",
44
+ "@atlaskit/editor-plugin-annotation": "^2.5.0",
45
45
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
46
46
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
47
47
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
48
- "@atlaskit/editor-plugin-editor-viewmode": "^3.0.0",
49
- "@atlaskit/editor-plugin-floating-toolbar": "^3.3.0",
48
+ "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
49
+ "@atlaskit/editor-plugin-floating-toolbar": "^3.6.0",
50
50
  "@atlaskit/editor-plugin-focus": "^1.5.0",
51
51
  "@atlaskit/editor-plugin-grid": "^2.0.0",
52
52
  "@atlaskit/editor-plugin-guideline": "^2.0.0",
@@ -66,7 +66,7 @@
66
66
  "@atlaskit/media-ui": "^28.1.0",
67
67
  "@atlaskit/media-viewer": "^52.0.0",
68
68
  "@atlaskit/platform-feature-flags": "^1.1.0",
69
- "@atlaskit/primitives": "^14.3.0",
69
+ "@atlaskit/primitives": "^14.4.0",
70
70
  "@atlaskit/textfield": "^8.0.0",
71
71
  "@atlaskit/theme": "^18.0.0",
72
72
  "@atlaskit/tmp-editor-statsig": "^4.6.0",
@@ -129,6 +129,9 @@
129
129
  "platform_editor_react18_phase2__media_single": {
130
130
  "type": "boolean"
131
131
  },
132
+ "platform_editor_react18_phase2__media_single_jira": {
133
+ "type": "boolean"
134
+ },
132
135
  "platform_media_cross_client_copy": {
133
136
  "type": "boolean"
134
137
  },
@@ -176,6 +179,9 @@
176
179
  },
177
180
  "platform_editor_remove_media_inline_feature_flag": {
178
181
  "type": "boolean"
182
+ },
183
+ "platform_editor_media_single_toolbar_target": {
184
+ "type": "boolean"
179
185
  }
180
186
  },
181
187
  "stricter": {