@atlaskit/editor-plugin-media 3.2.0 → 4.1.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 (45) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/nodeviews/mediaGroup.js +16 -323
  3. package/dist/cjs/nodeviews/mediaNodeView/media.js +15 -6
  4. package/dist/cjs/nodeviews/mediaSingle.js +47 -593
  5. package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +2 -3
  6. package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
  7. package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +67 -649
  8. package/dist/cjs/ui/toolbar/alt-text.js +1 -2
  9. package/dist/cjs/ui/toolbar/index.js +7 -15
  10. package/dist/cjs/ui/toolbar/linking.js +3 -4
  11. package/dist/cjs/ui/toolbar/mediaInline.js +3 -7
  12. package/dist/cjs/ui/toolbar/pixel-resizing.js +1 -5
  13. package/dist/es2019/nodeviews/mediaGroup.js +1 -272
  14. package/dist/es2019/nodeviews/mediaNodeView/media.js +14 -5
  15. package/dist/es2019/nodeviews/mediaSingle.js +6 -477
  16. package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +2 -3
  17. package/dist/es2019/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
  18. package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -510
  19. package/dist/es2019/ui/toolbar/alt-text.js +1 -2
  20. package/dist/es2019/ui/toolbar/index.js +7 -15
  21. package/dist/es2019/ui/toolbar/linking.js +3 -4
  22. package/dist/es2019/ui/toolbar/mediaInline.js +3 -7
  23. package/dist/es2019/ui/toolbar/pixel-resizing.js +1 -5
  24. package/dist/esm/nodeviews/mediaGroup.js +15 -322
  25. package/dist/esm/nodeviews/mediaNodeView/media.js +15 -6
  26. package/dist/esm/nodeviews/mediaSingle.js +47 -593
  27. package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +2 -3
  28. package/dist/esm/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
  29. package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +64 -650
  30. package/dist/esm/ui/toolbar/alt-text.js +1 -2
  31. package/dist/esm/ui/toolbar/index.js +7 -15
  32. package/dist/esm/ui/toolbar/linking.js +3 -4
  33. package/dist/esm/ui/toolbar/mediaInline.js +3 -7
  34. package/dist/esm/ui/toolbar/pixel-resizing.js +1 -5
  35. package/dist/types/nodeviews/__mocks__/mediaNodeUpdater.d.ts +1 -0
  36. package/dist/types/nodeviews/mediaGroup.d.ts +2 -23
  37. package/dist/types/nodeviews/mediaNodeView/media.d.ts +1 -0
  38. package/dist/types/nodeviews/mediaSingle.d.ts +2 -38
  39. package/dist/types/nodeviews/mediaSingleNext.d.ts +1 -2
  40. package/dist/types-ts4.5/nodeviews/__mocks__/mediaNodeUpdater.d.ts +1 -0
  41. package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +2 -23
  42. package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +1 -0
  43. package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +2 -38
  44. package/dist/types-ts4.5/nodeviews/mediaSingleNext.d.ts +1 -2
  45. package/package.json +14 -23
@@ -8,7 +8,6 @@ import { MediaSharedClassNames as ClassNames } from '@atlaskit/editor-common/sty
8
8
  import { RECENT_SEARCH_WIDTH_IN_PX as CONTAINER_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
9
9
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
10
10
  import TextIcon from '@atlaskit/icon/core/text';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
12
  import { openMediaAltTextMenu } from '../../pm-plugins/alt-text/commands';
14
13
  import AltTextEdit from '../../pm-plugins/alt-text/ui/AltTextEdit';
@@ -54,7 +53,7 @@ var altTextEditComponent = function altTextEditComponent(options) {
54
53
  var _options$forceFocusSe;
55
54
  var tr = view.state.tr,
56
55
  dispatch = view.dispatch;
57
- var elementSelector = options !== null && options !== void 0 && options.triggerButtonSelector && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_8') ? options.triggerButtonSelector : "[data-testid=\"".concat(testId, "\"]");
56
+ var elementSelector = options !== null && options !== void 0 && options.triggerButtonSelector && editorExperiment('platform_editor_controls', 'variant1') ? options.triggerButtonSelector : "[data-testid=\"".concat(testId, "\"]");
58
57
  var newTr = options === null || options === void 0 || (_options$forceFocusSe = options.forceFocusSelector) === null || _options$forceFocusSe === void 0 ? void 0 : _options$forceFocusSe.call(options, elementSelector)(tr);
59
58
  if (newTr) {
60
59
  dispatch(newTr);
@@ -295,7 +295,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
295
295
  });
296
296
  }
297
297
  });
298
- if (!isEditorControlsEnabled || !fg('platform_editor_controls_patch_6')) {
298
+ if (!isEditorControlsEnabled) {
299
299
  toolbarButtons.push({
300
300
  type: 'separator'
301
301
  });
@@ -316,7 +316,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
316
316
  }
317
317
  var layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
318
318
  var addLayoutDropdownToToolbar = function addLayoutDropdownToToolbar() {
319
- if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_6')) {
319
+ if (editorExperiment('platform_editor_controls', 'variant1')) {
320
320
  var _pluginInjectionApi$a4;
321
321
  var layoutDropdown = buildLayoutDropdown(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
322
322
  toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), _toConsumableArray(layoutDropdown));
@@ -344,7 +344,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
344
344
  title: intl.formatMessage(layoutToMessages[selectedLayoutIcon.value]),
345
345
  icon: selectedLayoutIcon.icon
346
346
  };
347
- toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), [trigger], _toConsumableArray(isEditorControlsEnabled && fg('platform_editor_controls_patch_6') ? [] : [{
347
+ toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), [trigger], _toConsumableArray(isEditorControlsEnabled ? [] : [{
348
348
  type: 'separator'
349
349
  }]));
350
350
  }
@@ -426,7 +426,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
426
426
  icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
427
427
  color: "currentColor",
428
428
  spacing: "spacious",
429
- label: fg('platform_editor_controls_patch_7') ? '' : inlineTitle
429
+ label: ""
430
430
  }),
431
431
  tooltip: hasCaption ? inlineSwitcherTitle : undefined
432
432
  }, {
@@ -436,14 +436,10 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
436
436
  onClick: function onClick() {
437
437
  return true;
438
438
  },
439
- icon: fg('platform_editor_controls_patch_7') ? /*#__PURE__*/React.createElement(MaximizeIcon, {
439
+ icon: /*#__PURE__*/React.createElement(MaximizeIcon, {
440
440
  color: "currentColor",
441
441
  spacing: "spacious",
442
442
  label: ""
443
- }) : /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
444
- color: "currentColor",
445
- spacing: "spacious",
446
- label: fg('platform_editor_controls_patch_7') ? '' : floatingSwitcherTitle
447
443
  })
448
444
  }];
449
445
  var switchFromBlockToInline;
@@ -457,11 +453,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
457
453
  options: _options2,
458
454
  title: intl.formatMessage(messages.sizeOptions),
459
455
  icon: function icon() {
460
- return fg('platform_editor_controls_patch_7') ? /*#__PURE__*/React.createElement(MaximizeIcon, {
461
- color: "currentColor",
462
- spacing: "spacious",
463
- label: intl.formatMessage(messages.sizeOptions)
464
- }) : /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
456
+ return /*#__PURE__*/React.createElement(MaximizeIcon, {
465
457
  color: "currentColor",
466
458
  spacing: "spacious",
467
459
  label: intl.formatMessage(messages.sizeOptions)
@@ -774,7 +766,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
774
766
 
775
767
  // testId is required to show focus on trigger button on ESC key press
776
768
  // see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
777
- var overflowButtonSelector = editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_8') ? "[data-testid=\"".concat(overflowDropdwonBtnTriggerTestId, "\"]") : undefined;
769
+ var overflowButtonSelector = editorExperiment('platform_editor_controls', 'variant1') ? "[data-testid=\"".concat(overflowDropdwonBtnTriggerTestId, "\"]") : undefined;
778
770
  if (allowAltTextOnImages) {
779
771
  var mediaAltTextPluginState = getMediaAltTextPluginState(state);
780
772
  if (mediaAltTextPluginState.isAltTextEditorOpen) {
@@ -8,7 +8,6 @@ import { linkMessages, linkToolbarMessages } from '@atlaskit/editor-common/messa
8
8
  import { RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
9
9
  import LinkIcon from '@atlaskit/icon/core/link';
10
10
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
12
  import { hideLinkingToolbar, setUrlToMedia, showLinkingToolbar, unlink } from '../../pm-plugins/commands/linking';
14
13
  import { getMediaLinkingState } from '../../pm-plugins/linking';
@@ -55,7 +54,7 @@ export var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, med
55
54
  return null;
56
55
  }
57
56
  var setFocusOnFloatingToolbar = function setFocusOnFloatingToolbar(setFocus) {
58
- if (setFocus && editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_8')) {
57
+ if (setFocus && editorExperiment('platform_editor_controls', 'variant1')) {
59
58
  var _pluginInjectionApi$f;
60
59
  var tr = view.state.tr,
61
60
  dispatch = view.dispatch;
@@ -90,7 +89,7 @@ export var getLinkingToolbar = function getLinkingToolbar(toolbarBaseConfig, med
90
89
  */
91
90
  var tr = view.state.tr,
92
91
  dispatch = view.dispatch;
93
- var selector = editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_8') ? FORCE_FOCUS_SELECTOR_EDITOR_CONTROLS : FORCE_FOCUS_SELECTOR;
92
+ var selector = editorExperiment('platform_editor_controls', 'variant1') ? FORCE_FOCUS_SELECTOR_EDITOR_CONTROLS : FORCE_FOCUS_SELECTOR;
94
93
  pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 || _pluginInjectionApi$f2.forceFocusSelector(selector)(tr);
95
94
  dispatch(tr);
96
95
  },
@@ -144,7 +143,7 @@ export var getLinkingDropdownOptions = function getLinkingDropdownOptions(editor
144
143
  return true;
145
144
  },
146
145
  icon: /*#__PURE__*/React.createElement(LinkIcon, {
147
- label: fg('platform_editor_controls_patch_7') ? '' : title
146
+ label: ""
148
147
  })
149
148
  }];
150
149
  } else {
@@ -208,7 +208,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
208
208
  });
209
209
  }
210
210
  });
211
- if (!isEditorControlsEnabled || !fg('platform_editor_controls_patch_6')) {
211
+ if (!isEditorControlsEnabled) {
212
212
  inlineImageItems.push({
213
213
  type: 'separator'
214
214
  });
@@ -312,20 +312,16 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
312
312
  icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
313
313
  color: "currentColor",
314
314
  spacing: "spacious",
315
- label: fg('platform_editor_controls_patch_7') ? '' : mediaInlineImageTitle
315
+ label: ""
316
316
  })
317
317
  }, {
318
318
  id: 'editor.media.convert.mediasingle',
319
319
  title: mediaSingleTitle,
320
320
  onClick: changeMediaInlineToMediaSingle(editorAnalyticsAPI, widthPluginState),
321
- icon: fg('platform_editor_controls_patch_7') ? /*#__PURE__*/React.createElement(MaximizeIcon, {
321
+ icon: /*#__PURE__*/React.createElement(MaximizeIcon, {
322
322
  color: "currentColor",
323
323
  spacing: "spacious",
324
324
  label: ""
325
- }) : /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
326
- color: "currentColor",
327
- spacing: "spacious",
328
- label: fg('platform_editor_controls_patch_7') ? '' : mediaSingleTitle
329
325
  })
330
326
  }];
331
327
  var switchFromInlineToBlock;
@@ -4,9 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import React from 'react';
5
5
  import { pixelEntryMessages as messages } from '@atlaskit/editor-common/media';
6
6
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
7
- import GrowHorizontalIcon from '@atlaskit/icon/core/grow-horizontal';
8
7
  import ImageFullscreenIcon from '@atlaskit/icon/core/image-fullscreen';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
8
  import { openPixelEditor } from '../../pm-plugins/pixel-resizing/commands';
11
9
  import { PixelEntry } from '../../pm-plugins/pixel-resizing/ui';
12
10
  import { PIXEL_RESIZING_TOOLBAR_WIDTH } from '../../pm-plugins/pixel-resizing/ui/constants';
@@ -59,9 +57,7 @@ export var getResizeDropdownOption = function getResizeDropdownOption(mediaOptio
59
57
  return [{
60
58
  title: formatMessage(messages.resizeOption),
61
59
  onClick: openPixelEditor(),
62
- icon: fg('platform_editor_controls_patch_7') ? /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
63
- label: ""
64
- }) : /*#__PURE__*/React.createElement(GrowHorizontalIcon, {
60
+ icon: /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
65
61
  label: ""
66
62
  }),
67
63
  testId: 'media-pixel-resizing-dropdown-option'
@@ -24,3 +24,4 @@ export declare class MediaNodeUpdater {
24
24
  updateNodeAttrs(): void;
25
25
  handleExternalMedia(): Promise<void>;
26
26
  }
27
+ export declare function createMediaNodeUpdater(): MediaNodeUpdater;
@@ -1,30 +1,9 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
1
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
2
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
5
- import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
4
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
5
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
6
  import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
9
7
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
10
- import type { getPosHandler, MediaOptions } from '../types';
11
- type MediaGroupProps = {
12
- forwardRef?: (ref: HTMLElement) => void;
13
- node: PMNode;
14
- view: EditorView;
15
- getPos: () => number | undefined;
16
- disabled?: boolean;
17
- editorViewMode?: boolean;
18
- allowLazyLoading?: boolean;
19
- mediaProvider: Promise<MediaProvider>;
20
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
21
- isCopyPasteEnabled?: boolean;
22
- anchorPos: number;
23
- headPos: number;
24
- mediaOptions: MediaOptions;
25
- } & WrappedComponentProps;
26
- declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<MediaGroupProps>> & {
27
- WrappedComponent: React.ComponentType<MediaGroupProps>;
28
- };
29
- export default IntlMediaGroup;
8
+ import type { getPosHandler } from '../types';
30
9
  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;
@@ -25,6 +25,7 @@ export interface MediaNodeProps extends ReactNodeProps, ImageLoaderProps {
25
25
  }
26
26
  interface MediaNodeState {
27
27
  viewMediaClientConfig?: MediaClientConfig;
28
+ viewAndUploadMediaClientConfig?: MediaClientConfig;
28
29
  contextIdentifierProvider?: ContextIdentifierProvider;
29
30
  }
30
31
  export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState> {
@@ -1,51 +1,15 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- * @jsxFrag
5
- */
6
- import type { MouseEvent } from 'react';
7
- import React, { Component } from 'react';
8
1
  import { jsx } from '@emotion/react';
9
- import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
10
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
11
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
12
4
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
13
- import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
14
6
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
15
7
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
16
8
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
17
9
  import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
18
- import type { CardEvent } from '@atlaskit/media-card';
19
- import type { MediaClientConfig } from '@atlaskit/media-core';
20
10
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
21
11
  import type { ForwardRef, getPosHandler, MediaOptions } from '../types';
22
- import { MediaNodeUpdater } from './mediaNodeUpdater';
23
- import type { MediaSingleNodeProps, MediaSingleNodeViewProps } from './types';
24
- interface MediaSingleNodeState {
25
- width?: number;
26
- height?: number;
27
- viewMediaClientConfig?: MediaClientConfig;
28
- contextIdentifierProvider?: ContextIdentifierProvider;
29
- isCopying: boolean;
30
- }
31
- export default class MediaSingleNode extends Component<MediaSingleNodeProps, MediaSingleNodeState> {
32
- static defaultProps: Partial<MediaSingleNodeProps>;
33
- static displayName: string;
34
- mediaNodeUpdater: MediaNodeUpdater | null;
35
- state: MediaSingleNodeState;
36
- mediaSingleWrapperRef: React.RefObject<HTMLDivElement>;
37
- captionPlaceHolderRef: React.RefObject<HTMLButtonElement | HTMLSpanElement>;
38
- createOrUpdateMediaNodeUpdater: (props: MediaSingleNodeProps) => void;
39
- UNSAFE_componentWillReceiveProps(nextProps: MediaSingleNodeProps): void;
40
- setViewMediaClientConfig: (props: MediaSingleNodeProps) => Promise<void>;
41
- updateMediaNodeAttributes: (props: MediaSingleNodeProps) => Promise<void>;
42
- componentDidMount(): Promise<void>;
43
- selectMediaSingle: ({ event }: CardEvent) => void;
44
- updateSize: (width: number | null, layout: MediaSingleLayout) => void;
45
- onMediaSingleClicked: (event: MouseEvent) => void;
46
- render(): jsx.JSX.Element;
47
- private clickPlaceholder;
48
- }
12
+ import type { MediaSingleNodeViewProps } from './types';
49
13
  declare class MediaSingleNodeView extends ReactNodeView<MediaSingleNodeViewProps> {
50
14
  lastOffsetLeft: number;
51
15
  forceViewUpdate: boolean;
@@ -7,7 +7,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
9
9
  import type { ForwardRef, MediaOptions } from '../types';
10
- type MediaSingleNodeNextProps = {
10
+ export type MediaSingleNodeNextProps = {
11
11
  view: EditorView;
12
12
  node: PMNode;
13
13
  getPos: () => number | undefined;
@@ -31,4 +31,3 @@ type MediaSingleNodeNextProps = {
31
31
  editorAppearance?: EditorAppearance;
32
32
  };
33
33
  export declare const MediaSingleNodeNext: (mediaSingleNodeNextProps: MediaSingleNodeNextProps) => jsx.JSX.Element;
34
- export {};
@@ -24,3 +24,4 @@ export declare class MediaNodeUpdater {
24
24
  updateNodeAttrs(): void;
25
25
  handleExternalMedia(): Promise<void>;
26
26
  }
27
+ export declare function createMediaNodeUpdater(): MediaNodeUpdater;
@@ -1,30 +1,9 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
1
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
2
  import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
5
- import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
4
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
5
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
6
  import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
9
7
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
10
- import type { getPosHandler, MediaOptions } from '../types';
11
- type MediaGroupProps = {
12
- forwardRef?: (ref: HTMLElement) => void;
13
- node: PMNode;
14
- view: EditorView;
15
- getPos: () => number | undefined;
16
- disabled?: boolean;
17
- editorViewMode?: boolean;
18
- allowLazyLoading?: boolean;
19
- mediaProvider: Promise<MediaProvider>;
20
- contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
21
- isCopyPasteEnabled?: boolean;
22
- anchorPos: number;
23
- headPos: number;
24
- mediaOptions: MediaOptions;
25
- } & WrappedComponentProps;
26
- declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<MediaGroupProps>> & {
27
- WrappedComponent: React.ComponentType<MediaGroupProps>;
28
- };
29
- export default IntlMediaGroup;
8
+ import type { getPosHandler } from '../types';
30
9
  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;
@@ -25,6 +25,7 @@ export interface MediaNodeProps extends ReactNodeProps, ImageLoaderProps {
25
25
  }
26
26
  interface MediaNodeState {
27
27
  viewMediaClientConfig?: MediaClientConfig;
28
+ viewAndUploadMediaClientConfig?: MediaClientConfig;
28
29
  contextIdentifierProvider?: ContextIdentifierProvider;
29
30
  }
30
31
  export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState> {
@@ -1,51 +1,15 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- * @jsxFrag
5
- */
6
- import type { MouseEvent } from 'react';
7
- import React, { Component } from 'react';
8
1
  import { jsx } from '@emotion/react';
9
- import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
10
2
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
11
3
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
12
4
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
13
- import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
14
6
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
15
7
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
16
8
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
17
9
  import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
18
- import type { CardEvent } from '@atlaskit/media-card';
19
- import type { MediaClientConfig } from '@atlaskit/media-core';
20
10
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
21
11
  import type { ForwardRef, getPosHandler, MediaOptions } from '../types';
22
- import { MediaNodeUpdater } from './mediaNodeUpdater';
23
- import type { MediaSingleNodeProps, MediaSingleNodeViewProps } from './types';
24
- interface MediaSingleNodeState {
25
- width?: number;
26
- height?: number;
27
- viewMediaClientConfig?: MediaClientConfig;
28
- contextIdentifierProvider?: ContextIdentifierProvider;
29
- isCopying: boolean;
30
- }
31
- export default class MediaSingleNode extends Component<MediaSingleNodeProps, MediaSingleNodeState> {
32
- static defaultProps: Partial<MediaSingleNodeProps>;
33
- static displayName: string;
34
- mediaNodeUpdater: MediaNodeUpdater | null;
35
- state: MediaSingleNodeState;
36
- mediaSingleWrapperRef: React.RefObject<HTMLDivElement>;
37
- captionPlaceHolderRef: React.RefObject<HTMLButtonElement | HTMLSpanElement>;
38
- createOrUpdateMediaNodeUpdater: (props: MediaSingleNodeProps) => void;
39
- UNSAFE_componentWillReceiveProps(nextProps: MediaSingleNodeProps): void;
40
- setViewMediaClientConfig: (props: MediaSingleNodeProps) => Promise<void>;
41
- updateMediaNodeAttributes: (props: MediaSingleNodeProps) => Promise<void>;
42
- componentDidMount(): Promise<void>;
43
- selectMediaSingle: ({ event }: CardEvent) => void;
44
- updateSize: (width: number | null, layout: MediaSingleLayout) => void;
45
- onMediaSingleClicked: (event: MouseEvent) => void;
46
- render(): jsx.JSX.Element;
47
- private clickPlaceholder;
48
- }
12
+ import type { MediaSingleNodeViewProps } from './types';
49
13
  declare class MediaSingleNodeView extends ReactNodeView<MediaSingleNodeViewProps> {
50
14
  lastOffsetLeft: number;
51
15
  forceViewUpdate: boolean;
@@ -7,7 +7,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
8
  import type { MediaNextEditorPluginType } from '../mediaPluginType';
9
9
  import type { ForwardRef, MediaOptions } from '../types';
10
- type MediaSingleNodeNextProps = {
10
+ export type MediaSingleNodeNextProps = {
11
11
  view: EditorView;
12
12
  node: PMNode;
13
13
  getPos: () => number | undefined;
@@ -31,4 +31,3 @@ type MediaSingleNodeNextProps = {
31
31
  editorAppearance?: EditorAppearance;
32
32
  };
33
33
  export declare const MediaSingleNodeNext: (mediaSingleNodeNextProps: MediaSingleNodeNextProps) => jsx.JSX.Element;
34
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "3.2.0",
3
+ "version": "4.1.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
39
39
  "@atlaskit/analytics-next": "^11.1.0",
40
40
  "@atlaskit/button": "^23.2.0",
41
- "@atlaskit/editor-common": "^106.9.0",
41
+ "@atlaskit/editor-common": "^107.0.0",
42
42
  "@atlaskit/editor-palette": "^2.1.0",
43
43
  "@atlaskit/editor-plugin-analytics": "^2.3.0",
44
44
  "@atlaskit/editor-plugin-annotation": "^2.9.0",
@@ -59,19 +59,19 @@
59
59
  "@atlaskit/form": "^12.0.0",
60
60
  "@atlaskit/icon": "^27.0.0",
61
61
  "@atlaskit/media-card": "^79.3.0",
62
- "@atlaskit/media-client": "^33.4.0",
62
+ "@atlaskit/media-client": "^34.0.0",
63
63
  "@atlaskit/media-client-react": "^4.1.0",
64
64
  "@atlaskit/media-common": "^12.2.0",
65
- "@atlaskit/media-filmstrip": "^50.1.0",
66
- "@atlaskit/media-picker": "^69.0.0",
65
+ "@atlaskit/media-filmstrip": "^51.0.0",
66
+ "@atlaskit/media-picker": "^70.0.0",
67
67
  "@atlaskit/media-ui": "^28.3.0",
68
- "@atlaskit/media-viewer": "^52.2.0",
68
+ "@atlaskit/media-viewer": "^52.3.0",
69
69
  "@atlaskit/platform-feature-flags": "^1.1.0",
70
- "@atlaskit/primitives": "^14.8.0",
70
+ "@atlaskit/primitives": "^14.9.0",
71
71
  "@atlaskit/textfield": "^8.0.0",
72
72
  "@atlaskit/theme": "^18.0.0",
73
- "@atlaskit/tmp-editor-statsig": "^7.1.0",
74
- "@atlaskit/tokens": "^5.2.0",
73
+ "@atlaskit/tmp-editor-statsig": "^7.2.0",
74
+ "@atlaskit/tokens": "^5.3.0",
75
75
  "@atlaskit/tooltip": "^20.3.0",
76
76
  "@babel/runtime": "^7.0.0",
77
77
  "@emotion/react": "^11.7.1",
@@ -85,7 +85,7 @@
85
85
  "typescript": "~5.4.2"
86
86
  },
87
87
  "peerDependencies": {
88
- "@atlaskit/media-core": "^36.1.0",
88
+ "@atlaskit/media-core": "^37.0.0",
89
89
  "react": "^18.2.0",
90
90
  "react-dom": "^18.2.0",
91
91
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -127,12 +127,6 @@
127
127
  }
128
128
  },
129
129
  "platform-feature-flags": {
130
- "platform_editor_react18_phase2__media_single": {
131
- "type": "boolean"
132
- },
133
- "platform_editor_react18_phase2__media_single_jira": {
134
- "type": "boolean"
135
- },
136
130
  "platform_media_cross_client_copy": {
137
131
  "type": "boolean"
138
132
  },
@@ -172,7 +166,7 @@
172
166
  "platform_editor_remove_media_inline_feature_flag": {
173
167
  "type": "boolean"
174
168
  },
175
- "platform_editor_controls_patch_6": {
169
+ "platform_editor_media_single_toolbar_target": {
176
170
  "type": "boolean"
177
171
  },
178
172
  "platform_editor_ssr_media": {
@@ -184,18 +178,12 @@
184
178
  "platform_editor_no_cursor_on_live_doc_init": {
185
179
  "type": "boolean"
186
180
  },
187
- "platform_editor_controls_patch_7": {
188
- "type": "boolean"
189
- },
190
181
  "platform_editor_track_media_fail_to_insert": {
191
182
  "type": "boolean"
192
183
  },
193
184
  "confluence_frontend_preload_inline_comment_editor": {
194
185
  "type": "boolean"
195
186
  },
196
- "platform_editor_controls_patch_8": {
197
- "type": "boolean"
198
- },
199
187
  "platform_editor_controls_patch_9": {
200
188
  "type": "boolean"
201
189
  },
@@ -204,6 +192,9 @@
204
192
  },
205
193
  "platform_editor_controls_patch_11": {
206
194
  "type": "boolean"
195
+ },
196
+ "platform_media_video_captions": {
197
+ "type": "boolean"
207
198
  }
208
199
  },
209
200
  "stricter": {