@atlaskit/editor-plugin-media 5.2.13 → 5.3.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 (86) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/nodeviews/mediaGroup.js +1 -3
  3. package/dist/cjs/nodeviews/mediaInline.js +1 -3
  4. package/dist/cjs/nodeviews/mediaNodeView/index.js +1 -3
  5. package/dist/cjs/pm-plugins/utils/batchMediaNodeAttrs.js +2 -2
  6. package/dist/es2019/nodeviews/mediaGroup.js +1 -3
  7. package/dist/es2019/nodeviews/mediaInline.js +1 -3
  8. package/dist/es2019/nodeviews/mediaNodeView/index.js +1 -3
  9. package/dist/es2019/pm-plugins/utils/batchMediaNodeAttrs.js +2 -2
  10. package/dist/esm/nodeviews/mediaGroup.js +1 -3
  11. package/dist/esm/nodeviews/mediaInline.js +1 -3
  12. package/dist/esm/nodeviews/mediaNodeView/index.js +1 -3
  13. package/dist/esm/pm-plugins/utils/batchMediaNodeAttrs.js +2 -2
  14. package/dist/types/mediaPluginType.d.ts +4 -4
  15. package/dist/types/nodeviews/mediaGroupNext.d.ts +18 -18
  16. package/dist/types/nodeviews/mediaInline.d.ts +12 -12
  17. package/dist/types/nodeviews/mediaNodeUpdater.d.ts +5 -5
  18. package/dist/types/nodeviews/mediaNodeView/index.d.ts +3 -3
  19. package/dist/types/nodeviews/mediaNodeView/media.d.ts +11 -11
  20. package/dist/types/nodeviews/mediaSingleNext.d.ts +16 -16
  21. package/dist/types/nodeviews/styles.d.ts +3 -3
  22. package/dist/types/nodeviews/toDOM-fixes/mediaSingle.d.ts +11 -11
  23. package/dist/types/nodeviews/types.d.ts +21 -21
  24. package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +6 -6
  25. package/dist/types/pm-plugins/linking/actions.d.ts +1 -1
  26. package/dist/types/pm-plugins/linking/types.d.ts +3 -3
  27. package/dist/types/pm-plugins/picker-facade.d.ts +2 -2
  28. package/dist/types/pm-plugins/pixel-resizing/ui/index.d.ts +4 -4
  29. package/dist/types/pm-plugins/pixel-resizing/ui/types.d.ts +28 -28
  30. package/dist/types/pm-plugins/types.d.ts +44 -44
  31. package/dist/types/pm-plugins/utils/batchMediaNodeAttrs.d.ts +1 -1
  32. package/dist/types/types/index.d.ts +52 -52
  33. package/dist/types/types/media-plugin-options.d.ts +5 -5
  34. package/dist/types/ui/CaptionPlaceholder/index.d.ts +1 -1
  35. package/dist/types/ui/CommentBadge/index.d.ts +8 -8
  36. package/dist/types/ui/ImageBorder/index.d.ts +2 -2
  37. package/dist/types/ui/MediaLinkingToolbar.d.ts +5 -5
  38. package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
  39. package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
  40. package/dist/types/ui/MediaPicker/DropzoneWrapper.d.ts +3 -3
  41. package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
  42. package/dist/types/ui/MediaPicker/index.d.ts +2 -2
  43. package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +5 -5
  44. package/dist/types/ui/MediaViewer/PortalWrapper.d.ts +1 -1
  45. package/dist/types/ui/ResizableMediaSingle/index.d.ts +1 -1
  46. package/dist/types/ui/ResizableMediaSingle/types.d.ts +11 -11
  47. package/dist/types/ui/ToolbarMedia/index.d.ts +1 -1
  48. package/dist/types/ui/toolbar/layout-group.d.ts +1 -1
  49. package/dist/types/ui/toolbar/linking-toolbar-appearance.d.ts +2 -2
  50. package/dist/types-ts4.5/mediaPluginType.d.ts +4 -4
  51. package/dist/types-ts4.5/nodeviews/mediaGroupNext.d.ts +18 -18
  52. package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +12 -12
  53. package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +5 -5
  54. package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +3 -3
  55. package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +11 -11
  56. package/dist/types-ts4.5/nodeviews/mediaSingleNext.d.ts +16 -16
  57. package/dist/types-ts4.5/nodeviews/styles.d.ts +3 -3
  58. package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaSingle.d.ts +11 -11
  59. package/dist/types-ts4.5/nodeviews/types.d.ts +21 -21
  60. package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +6 -6
  61. package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +1 -1
  62. package/dist/types-ts4.5/pm-plugins/linking/types.d.ts +3 -3
  63. package/dist/types-ts4.5/pm-plugins/picker-facade.d.ts +2 -2
  64. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/index.d.ts +4 -4
  65. package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/types.d.ts +28 -28
  66. package/dist/types-ts4.5/pm-plugins/types.d.ts +44 -44
  67. package/dist/types-ts4.5/pm-plugins/utils/batchMediaNodeAttrs.d.ts +1 -1
  68. package/dist/types-ts4.5/types/index.d.ts +52 -52
  69. package/dist/types-ts4.5/types/media-plugin-options.d.ts +5 -5
  70. package/dist/types-ts4.5/ui/CaptionPlaceholder/index.d.ts +1 -1
  71. package/dist/types-ts4.5/ui/CommentBadge/index.d.ts +8 -8
  72. package/dist/types-ts4.5/ui/ImageBorder/index.d.ts +2 -2
  73. package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +5 -5
  74. package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
  75. package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
  76. package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +3 -3
  77. package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
  78. package/dist/types-ts4.5/ui/MediaPicker/index.d.ts +2 -2
  79. package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +5 -5
  80. package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +1 -1
  81. package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +1 -1
  82. package/dist/types-ts4.5/ui/ResizableMediaSingle/types.d.ts +11 -11
  83. package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +1 -1
  84. package/dist/types-ts4.5/ui/toolbar/layout-group.d.ts +1 -1
  85. package/dist/types-ts4.5/ui/toolbar/linking-toolbar-appearance.d.ts +2 -2
  86. package/package.json +7 -7
@@ -10,69 +10,69 @@ import type { MediaOptions, MediaState, MediaStateEventSubscriber, ProsemirrorGe
10
10
  import type { MediaPluginOptions } from '../types/media-plugin-options';
11
11
  import type PickerFacade from './picker-facade';
12
12
  export interface MediaNodeWithPosHandler {
13
- node: PMNode;
14
13
  getPos: ProsemirrorGetPosHandler;
14
+ node: PMNode;
15
15
  }
16
16
  export interface MediaPluginState {
17
+ addPendingTask: (promise: Promise<any>) => void;
18
+ allowInlineImages?: boolean;
17
19
  allowsUploads: boolean;
18
- mediaClientConfig?: MediaClientConfig;
19
- uploadMediaClientConfig?: MediaClientConfig;
20
- ignoreLinks: boolean;
21
- waitForMediaUpload: boolean;
22
20
  allUploadsFinished: boolean;
23
- showDropzone: boolean;
24
- isFullscreen: boolean;
25
- element?: HTMLElement;
26
- videoControlsWrapperRef?: HTMLElement;
27
- layout: MediaSingleLayout;
28
- mediaNodes: MediaNodeWithPosHandler[];
29
- options: MediaPluginOptions;
30
- mediaProvider?: MediaProvider;
31
- pickers: PickerFacade[];
32
- pickerPromises: Array<Promise<PickerFacade>>;
21
+ clone(): MediaPluginState;
22
+ currentMaxWidth?: number;
23
+ destroy(): void;
24
+ dispatch?: Dispatch;
33
25
  editingMediaSinglePos?: number;
34
- showEditingDialog?: boolean;
35
- mediaOptions?: MediaOptions;
26
+ element?: HTMLElement;
27
+ findMediaNode: (id: string) => MediaNodeWithPosHandler | null;
28
+ getMediaOptions: () => MediaPluginOptions;
29
+ handleDrag: (dragState: 'enter' | 'leave') => void;
30
+ handleMediaGroupUpdate: (oldNodes: PMNode[], newNodes: PMNode[]) => void;
31
+ handleMediaNodeMount: (node: PMNode, getPos: ProsemirrorGetPosHandler) => void;
32
+ handleMediaNodeRemoval: (node: PMNode | undefined, getPos: ProsemirrorGetPosHandler) => void;
33
+ handleMediaNodeUnmount: (oldNode: PMNode) => void;
34
+ ignoreLinks: boolean;
35
+ insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string, insertMediaVia?: InsertMediaVia) => void;
36
+ isFullscreen: boolean;
37
+ isIdentifierInEditorScope: (identifier: Identifier) => boolean;
38
+ isMediaViewerVisible?: boolean;
36
39
  isResizing: boolean;
37
- resizingWidth: number;
38
- currentMaxWidth?: number;
39
- allowInlineImages?: boolean;
40
40
  lastAddedMediaSingleFileIds: {
41
41
  id: string;
42
42
  selectionPosition: number;
43
43
  }[];
44
- dispatch?: Dispatch;
45
- setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
46
- getMediaOptions: () => MediaPluginOptions;
47
- insertFile: (mediaState: MediaState, onMediaStateChanged: MediaStateEventSubscriber, pickerType?: string, insertMediaVia?: InsertMediaVia) => void;
48
- addPendingTask: (promise: Promise<any>) => void;
49
- splitMediaGroup: () => boolean;
44
+ layout: MediaSingleLayout;
45
+ mediaClientConfig?: MediaClientConfig;
46
+ mediaNodes: MediaNodeWithPosHandler[];
47
+ mediaOptions?: MediaOptions;
48
+ mediaProvider?: MediaProvider;
49
+ mediaViewerSelectedMedia?: MediaADFAttrs;
50
50
  onPopupPickerClose: () => void;
51
- showMediaPicker: () => void;
52
- setBrowseFn: (browseFn: () => void) => void;
53
51
  onPopupToggle: (onPopupToogleCallback: (isOpen: boolean) => void) => void;
54
- waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
55
- handleMediaNodeRemoval: (node: PMNode | undefined, getPos: ProsemirrorGetPosHandler) => void;
56
- handleMediaNodeMount: (node: PMNode, getPos: ProsemirrorGetPosHandler) => void;
57
- handleMediaNodeUnmount: (oldNode: PMNode) => void;
58
- handleMediaGroupUpdate: (oldNodes: PMNode[], newNodes: PMNode[]) => void;
59
- findMediaNode: (id: string) => MediaNodeWithPosHandler | null;
60
- updateMediaSingleNodeAttrs: (id: string, attrs: object) => undefined | boolean;
52
+ options: MediaPluginOptions;
53
+ pickerPromises: Array<Promise<PickerFacade>>;
54
+ pickers: PickerFacade[];
61
55
  removeSelectedMediaContainer: () => boolean;
56
+ resizingWidth: number;
62
57
  selectedMediaContainerNode: () => PMNode | undefined;
63
- handleDrag: (dragState: 'enter' | 'leave') => void;
64
- isIdentifierInEditorScope: (identifier: Identifier) => boolean;
65
- trackOutOfScopeIdentifier: (identifier: Identifier) => void;
66
- updateElement(): void;
58
+ setBrowseFn: (browseFn: () => void) => void;
67
59
  setIsResizing(isResizing: boolean): void;
60
+ setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
68
61
  setResizingWidth(width: number): void;
69
62
  setView(view: EditorView): void;
70
- destroy(): void;
71
- updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen' | 'videoControlsWrapperRef'>>): void;
72
- clone(): MediaPluginState;
63
+ showDropzone: boolean;
64
+ showEditingDialog?: boolean;
65
+ showMediaPicker: () => void;
66
+ splitMediaGroup: () => boolean;
73
67
  subscribeToUploadInProgressState(fn: (isUploading: boolean) => void): void;
68
+ trackOutOfScopeIdentifier: (identifier: Identifier) => void;
74
69
  unsubscribeFromUploadInProgressState(fn: (isUploading: boolean) => void): void;
75
- isMediaViewerVisible?: boolean;
76
- mediaViewerSelectedMedia?: MediaADFAttrs;
70
+ updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen' | 'videoControlsWrapperRef'>>): void;
71
+ updateElement(): void;
72
+ updateMediaSingleNodeAttrs: (id: string, attrs: object) => undefined | boolean;
73
+ uploadMediaClientConfig?: MediaClientConfig;
74
+ videoControlsWrapperRef?: HTMLElement;
75
+ waitForMediaUpload: boolean;
76
+ waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
77
77
  }
78
78
  export type EventInput = 'keyboard' | 'mouse' | 'floatingToolBar';
@@ -29,7 +29,7 @@ export declare const runUpdate: (editorView: EditorView, cache: MediaAttributesC
29
29
  * @type {Function}
30
30
  * @param {Function} runUpdate - The function to be debounced.
31
31
  * @param {number} debouncedTime - The debounce delay in milliseconds.
32
- * @param {Object} [options] - The debounce options. Defaults to {leading: false, trailing: true}.
32
+ * @param {object} [options] - The debounce options. Defaults to {leading: false, trailing: true}.
33
33
  * @param {Function} keyResolver - A function that returns the key to be used for memoization. In this case, it returns the editor view instance.
34
34
  *
35
35
  * This function performs the following steps:
@@ -16,47 +16,41 @@ export type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | '
16
16
  export type MediaSingleWithType = 'pixel' | 'percentage';
17
17
  export type MediaCopyScope = 'editor' | 'context';
18
18
  export interface MediaPluginOptions {
19
- provider?: Providers['mediaProvider'];
20
- syncProvider?: MediaProvider;
19
+ alignLeftOnInsert?: boolean;
20
+ allowAdvancedToolBarOptions?: boolean;
21
+ allowAltTextOnImages?: boolean;
22
+ allowBreakoutSnapPoints?: boolean;
23
+ allowCaptions?: boolean;
24
+ allowCommentsOnMedia?: boolean;
25
+ allowDropzoneDropLine?: boolean;
26
+ allowImagePreview?: boolean;
27
+ allowLazyLoading?: boolean;
28
+ allowLinking?: boolean;
29
+ allowMarkingUploadsAsIncomplete?: boolean;
30
+ allowMediaGroup?: boolean;
21
31
  /**
22
32
  * @experimental
23
33
  * Still under development. Use with caution.
24
34
  */
25
35
  allowMediaInlineImages?: boolean;
26
36
  allowMediaSingle?: boolean | MediaSingleOptions;
27
- allowMediaGroup?: boolean;
28
- customDropzoneContainer?: HTMLElement;
29
- customMediaPicker?: CustomMediaPicker;
30
- allowResizing?: boolean;
31
- allowResizingInTables?: boolean;
32
- allowLinking?: boolean;
33
- allowLazyLoading?: boolean;
34
- allowBreakoutSnapPoints?: boolean;
35
- allowAdvancedToolBarOptions?: boolean;
36
37
  allowMediaSingleEditable?: boolean;
38
+ allowPixelResizing?: boolean;
37
39
  allowRemoteDimensionsFetch?: boolean;
38
- allowDropzoneDropLine?: boolean;
39
- allowMarkingUploadsAsIncomplete?: boolean;
40
- allowImagePreview?: boolean;
41
- fullWidthEnabled?: boolean;
42
- uploadErrorHandler?: (state: MediaState) => void;
43
- waitForMediaUpload?: boolean;
44
- isCopyPasteEnabled?: boolean;
45
- allowAltTextOnImages?: boolean;
46
- enableDownloadButton?: boolean;
47
- altTextValidator?: (value: string) => string[];
48
- useForgePlugins?: boolean;
40
+ allowResizing?: boolean;
41
+ allowResizingInTables?: boolean;
49
42
  allowTemplatePlaceholders?: boolean | PlaceholderTextOptions;
50
- alignLeftOnInsert?: boolean;
43
+ altTextValidator?: (value: string) => string[];
44
+ customDropzoneContainer?: HTMLElement;
45
+ customMediaPicker?: CustomMediaPicker;
46
+ editorAppearance?: EditorAppearance;
51
47
  editorSelectionAPI?: EditorSelectionAPI;
48
+ enableDownloadButton?: boolean;
52
49
  featureFlags?: MediaFeatureFlags;
53
- getEditorFeatureFlags?: GetEditorFeatureFlags;
54
- allowCaptions?: boolean;
55
- allowCommentsOnMedia?: boolean;
56
- editorAppearance?: EditorAppearance;
57
50
  forceHandlePositioning?: HandlePositioning;
58
- mediaShallowCopyScope?: MediaCopyScope;
59
- allowPixelResizing?: boolean;
51
+ fullWidthEnabled?: boolean;
52
+ getEditorFeatureFlags?: GetEditorFeatureFlags;
53
+ isCopyPasteEnabled?: boolean;
60
54
  /**
61
55
  * Enabling this will prevent this plugin from automatically trying to upload external images to the Media service.
62
56
  * This can be used in conjunction with the `isOnlyExternalLinks` config for `media-insert-plugin` to limit images
@@ -74,7 +68,13 @@ export interface MediaPluginOptions {
74
68
  * ```
75
69
  */
76
70
  isExternalMediaUploadDisabled?: boolean;
71
+ mediaShallowCopyScope?: MediaCopyScope;
77
72
  onCommentButtonMount?: () => void;
73
+ provider?: Providers['mediaProvider'];
74
+ syncProvider?: MediaProvider;
75
+ uploadErrorHandler?: (state: MediaState) => void;
76
+ useForgePlugins?: boolean;
77
+ waitForMediaUpload?: boolean;
78
78
  }
79
79
  /**
80
80
  * @private
@@ -86,31 +86,31 @@ export interface MediaSingleOptions {
86
86
  disableLayout?: boolean;
87
87
  }
88
88
  export interface MediaState {
89
- id: string;
90
- status?: MediaStateStatus;
91
- fileName?: string;
92
- fileSize?: number;
93
- fileMimeType?: string;
94
89
  collection?: string;
90
+ contextId?: string;
95
91
  dimensions?: {
96
- width: number | undefined;
97
92
  height: number | undefined;
93
+ width: number | undefined;
98
94
  };
99
- scaleFactor?: number;
100
95
  error?: {
101
- name: string;
102
96
  description: string;
97
+ name: string;
103
98
  };
99
+ fileMimeType?: string;
100
+ fileName?: string;
101
+ fileSize?: number;
102
+ id: string;
104
103
  /** still require to support Mobile */
105
104
  publicId?: string;
106
- contextId?: string;
105
+ scaleFactor?: number;
106
+ status?: MediaStateStatus;
107
107
  }
108
108
  export type Listener = (data: any) => void;
109
109
  export interface CustomMediaPicker {
110
+ destroy(): void;
111
+ emit(event: string, data: any): void;
110
112
  on(event: string, cb: Listener): void;
111
113
  removeAllListeners(event: any): void;
112
- emit(event: string, data: any): void;
113
- destroy(): void;
114
114
  setUploadParams(uploadParams: UploadParams): void;
115
115
  }
116
116
  export type MobileUploadEndEventPayload = {
@@ -120,37 +120,37 @@ export type MobileUploadEndEventPayload = {
120
120
  };
121
121
  };
122
122
  export type MediaEditorState = {
123
- mediaClientConfig?: MediaClientConfig;
124
123
  editor?: {
125
- pos: number;
126
124
  identifier: FileIdentifier;
125
+ pos: number;
127
126
  };
127
+ mediaClientConfig?: MediaClientConfig;
128
128
  };
129
129
  export type MediaToolbarBaseConfig = {
130
- title: string;
131
130
  getDomRef?: (view: EditorView) => HTMLElement | undefined;
132
131
  nodeType: NodeType | NodeType[];
132
+ title: string;
133
133
  };
134
134
  export type MediaFloatingToolbarOptions = {
135
- providerFactory?: ProviderFactory;
136
- allowResizing?: boolean;
137
- allowMediaInline?: boolean;
138
- allowMediaInlineImages?: boolean;
139
- allowLinking?: boolean;
140
135
  allowAdvancedToolBarOptions?: boolean;
141
- allowResizingInTables?: boolean;
142
136
  allowAltTextOnImages?: boolean;
137
+ allowCommentsOnMedia?: boolean;
143
138
  allowImagePreview?: boolean;
139
+ allowLinking?: boolean;
140
+ allowMediaInline?: boolean;
141
+ allowMediaInlineImages?: boolean;
142
+ allowPixelResizing?: boolean;
143
+ allowResizing?: boolean;
144
+ allowResizingInTables?: boolean;
144
145
  altTextValidator?: (value: string) => string[];
145
146
  fullWidthEnabled?: boolean;
146
- allowCommentsOnMedia?: boolean;
147
147
  isViewOnly?: boolean;
148
- allowPixelResizing?: boolean;
149
148
  onCommentButtonMount?: () => void;
149
+ providerFactory?: ProviderFactory;
150
150
  };
151
151
  export type MediaDecorationSpec = {
152
- type: 'media';
153
152
  selected: boolean;
153
+ type: 'media';
154
154
  };
155
155
  export type SupportedMediaAttributes = MediaADFAttrs | MediaInlineAttributes;
156
156
  export type ProsemirrorGetPosHandler = getPosHandlerNode;
@@ -3,14 +3,14 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
3
  import type { ErrorReporter } from '@atlaskit/editor-common/utils';
4
4
  import type { CustomMediaPicker, MediaState } from './index';
5
5
  export type MediaPluginOptions = {
6
- providerFactory: ProviderFactory;
6
+ allowResizing: boolean;
7
+ customDropzoneContainer?: HTMLElement;
8
+ customMediaPicker?: CustomMediaPicker;
9
+ errorReporter?: ErrorReporter;
7
10
  nodeViews: {
8
11
  [name: string]: NodeViewConstructor;
9
12
  };
10
- errorReporter?: ErrorReporter;
13
+ providerFactory: ProviderFactory;
11
14
  uploadErrorHandler?: (state: MediaState) => void;
12
15
  waitForMediaUpload?: boolean;
13
- customDropzoneContainer?: HTMLElement;
14
- customMediaPicker?: CustomMediaPicker;
15
- allowResizing: boolean;
16
16
  };
@@ -6,9 +6,9 @@ import React from 'react';
6
6
  type CaptionPlaceholderProps = {
7
7
  onClick: () => void;
8
8
  placeholderMessage?: {
9
- id: string;
10
9
  defaultMessage: string;
11
10
  description: string;
11
+ id: string;
12
12
  };
13
13
  };
14
14
  export declare const CaptionPlaceholder: React.ForwardRefExoticComponent<CaptionPlaceholderProps & React.RefAttributes<HTMLSpanElement>>;
@@ -7,13 +7,13 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
7
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
8
8
  import type { getPosHandler } from '../../types';
9
9
  type CommentBadgeProps = {
10
- intl: IntlShape;
11
10
  api: ExtractInjectionAPI<MediaNextEditorPluginType>;
12
- mediaNode: PMNode | null;
13
- view: EditorView;
11
+ badgeOffsetRight?: string;
14
12
  getPos: getPosHandler;
13
+ intl: IntlShape;
15
14
  isDrafting: boolean;
16
- badgeOffsetRight?: string;
15
+ mediaNode: PMNode | null;
16
+ view: EditorView;
17
17
  };
18
18
  export declare const CommentBadge: React.FC<import("react-intl-next").WithIntlProps<CommentBadgeProps>> & {
19
19
  WrappedComponent: React.ComponentType<CommentBadgeProps>;
@@ -24,13 +24,13 @@ export declare const CommentBadge: React.FC<import("react-intl-next").WithIntlPr
24
24
  * when clean up platform_editor_add_media_from_url_rollout feature flag
25
25
  */
26
26
  type CommentBadgeNextWrapperProps = {
27
- mediaSingleElement?: HTMLElement | null;
28
- marks?: AnnotationMarkDefinition[];
29
- isDrafting?: boolean;
30
27
  api: ExtractInjectionAPI<MediaNextEditorPluginType>;
28
+ getPos: getPosHandler;
29
+ isDrafting?: boolean;
30
+ marks?: AnnotationMarkDefinition[];
31
31
  mediaNode: PMNode | null;
32
+ mediaSingleElement?: HTMLElement | null;
32
33
  view: EditorView;
33
- getPos: getPosHandler;
34
34
  };
35
35
  export declare const CommentBadgeNextWrapper: ({ api, mediaNode, view, getPos, isDrafting, }: CommentBadgeNextWrapperProps) => React.JSX.Element | null;
36
36
  export {};
@@ -2,10 +2,10 @@ import { jsx } from '@emotion/react';
2
2
  import type { IntlShape } from 'react-intl-next';
3
3
  import type { BorderMarkAttributes } from '@atlaskit/adf-schema';
4
4
  export interface ImageBorderProps {
5
- intl: IntlShape;
6
- toggleBorder: () => void;
7
5
  borderMark?: BorderMarkAttributes;
6
+ intl: IntlShape;
8
7
  setBorder: (attrs: Partial<BorderMarkAttributes>) => void;
8
+ toggleBorder: () => void;
9
9
  }
10
10
  declare const ImageBorder: ({ intl: { formatMessage }, toggleBorder, borderMark, setBorder, }: ImageBorderProps) => jsx.JSX.Element;
11
11
  export default ImageBorder;
@@ -8,19 +8,19 @@ import type { IntlShape, WrappedComponentProps } from 'react-intl-next';
8
8
  import type { RecentSearchInputTypes } from '@atlaskit/editor-common/link';
9
9
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
10
10
  type Props = {
11
- intl: IntlShape;
12
- providerFactory: ProviderFactory;
11
+ displayUrl?: string;
13
12
  editing: boolean;
13
+ intl: IntlShape;
14
14
  onBack: (url: string, meta: {
15
15
  inputMethod?: RecentSearchInputTypes;
16
16
  }, setFocus?: boolean) => void;
17
- onUnlink: (setFocus?: boolean) => void;
18
- onCancel: () => void;
19
17
  onBlur: (href: string) => void;
18
+ onCancel: () => void;
20
19
  onSubmit: (href: string, meta: {
21
20
  inputMethod: RecentSearchInputTypes;
22
21
  }, setFocus?: boolean) => void;
23
- displayUrl?: string;
22
+ onUnlink: (setFocus?: boolean) => void;
23
+ providerFactory: ProviderFactory;
24
24
  };
25
25
  declare class LinkAddToolbar extends React.PureComponent<Props & WrappedComponentProps> {
26
26
  state: {
@@ -4,9 +4,9 @@ import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags
4
4
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
5
5
  type Props = {
6
6
  api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
7
+ featureFlags?: MediaFeatureFlags;
7
8
  isOpen?: boolean;
8
9
  onBrowseFn: (browse: () => void) => void;
9
- featureFlags?: MediaFeatureFlags;
10
10
  };
11
11
  export declare const BrowserWrapper: ({ api, isOpen, onBrowseFn, featureFlags }: Props) => React.JSX.Element;
12
12
  export {};
@@ -4,8 +4,8 @@ import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags
4
4
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
5
5
  type Props = {
6
6
  api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
7
- featureFlags?: MediaFeatureFlags;
8
7
  container?: HTMLElement;
8
+ featureFlags?: MediaFeatureFlags;
9
9
  };
10
10
  export declare const ClipboardWrapper: ({ api, container, featureFlags }: Props) => React.JSX.Element;
11
11
  export {};
@@ -4,10 +4,10 @@ import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags
4
4
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
5
5
  type Props = {
6
6
  api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
7
- isActive: boolean;
8
- featureFlags?: MediaFeatureFlags;
9
- editorDomElement: Element;
10
7
  appearance: EditorAppearance;
8
+ editorDomElement: Element;
9
+ featureFlags?: MediaFeatureFlags;
10
+ isActive: boolean;
11
11
  };
12
12
  export declare const DropzoneWrapper: ({ api, isActive, featureFlags, editorDomElement, appearance, }: Props) => React.JSX.Element;
13
13
  export {};
@@ -10,8 +10,8 @@ interface ChildrenProps {
10
10
  pickerFacadeInstance: PickerFacade;
11
11
  }
12
12
  export type Props = {
13
- api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
14
13
  analyticsName: string;
14
+ api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
15
15
  children: (props: ChildrenProps) => React.ReactElement | null;
16
16
  };
17
17
  export default function PickerFacadeProvider({ api, analyticsName, children }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
4
4
  type Props = {
5
- editorDomElement: Element;
6
- appearance: EditorAppearance;
7
5
  api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
6
+ appearance: EditorAppearance;
7
+ editorDomElement: Element;
8
8
  onPopupToggle: (onPopupToggle: (isPopupOpened: boolean) => void) => void;
9
9
  setBrowseFn: (nativeBrowseFn: () => void) => void;
10
10
  };
@@ -7,13 +7,13 @@ import { jsx } from '@emotion/react';
7
7
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
8
  import type { MediaClientConfig } from '@atlaskit/media-core/auth';
9
9
  type MediaViewerContainerProps = {
10
- mediaNode: PMNode;
11
- selectedMediaContainerNode: () => PMNode | undefined;
12
- mediaClientConfig: MediaClientConfig;
10
+ children?: React.ReactNode;
13
11
  isEditorViewMode?: boolean;
14
- isSelected?: boolean;
15
12
  isInline?: boolean;
16
- children?: React.ReactNode;
13
+ isSelected?: boolean;
14
+ mediaClientConfig: MediaClientConfig;
15
+ mediaNode: PMNode;
16
+ selectedMediaContainerNode: () => PMNode | undefined;
17
17
  };
18
18
  export declare const MediaViewerContainer: ({ mediaNode, selectedMediaContainerNode, mediaClientConfig, isEditorViewMode, isSelected, isInline, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
19
19
  export {};
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import type { MediaADFAttrs } from '@atlaskit/adf-schema';
3
3
  import type { Identifier, MediaClientConfig } from '@atlaskit/media-client';
4
4
  interface RenderMediaViewerProps {
5
+ items?: Identifier[];
5
6
  mediaClientConfig: MediaClientConfig;
6
7
  onClose: () => void;
7
8
  selectedNodeAttrs: MediaADFAttrs;
8
- items?: Identifier[];
9
9
  }
10
10
  export declare const RenderMediaViewer: ({ mediaClientConfig, onClose, selectedNodeAttrs, items, }: RenderMediaViewerProps) => React.ReactPortal;
11
11
  export {};
@@ -8,8 +8,8 @@ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema'
8
8
  import type { MediaClientConfig } from '@atlaskit/media-core';
9
9
  import type { Props } from './types';
10
10
  type State = {
11
- offsetLeft: number;
12
11
  isVideoFile: boolean;
12
+ offsetLeft: number;
13
13
  resizedPctWidth?: number;
14
14
  };
15
15
  export default class ResizableMediaSingle extends React.Component<Props, State> {
@@ -12,19 +12,19 @@ export type EnabledHandles = {
12
12
  right?: boolean;
13
13
  };
14
14
  export type Props = MediaSingleProps & {
15
- updateSize: (width: number | null, layout: MediaSingleLayout) => void;
16
- getPos: getPosHandler;
17
- view: EditorView;
18
- lineLength: number;
19
- gridSize: number;
20
- containerWidth: number;
21
15
  allowBreakoutSnapPoints?: boolean;
22
- selected: boolean;
23
- viewMediaClientConfig?: MediaClientConfig;
24
- fullWidthMode?: boolean;
16
+ containerWidth: number;
17
+ disableHandles?: boolean;
25
18
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
19
+ forceHandlePositioning?: HandlePositioning;
20
+ fullWidthMode?: boolean;
21
+ getPos: getPosHandler;
22
+ gridSize: number;
23
+ lineLength: number;
26
24
  mediaSingleWidth?: number;
27
25
  pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
28
- disableHandles?: boolean;
29
- forceHandlePositioning?: HandlePositioning;
26
+ selected: boolean;
27
+ updateSize: (width: number | null, layout: MediaSingleLayout) => void;
28
+ view: EditorView;
29
+ viewMediaClientConfig?: MediaClientConfig;
30
30
  };
@@ -3,9 +3,9 @@ import type { WrappedComponentProps } from 'react-intl-next';
3
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import type { MediaNextEditorPluginType } from '../../mediaPluginType';
5
5
  interface Props {
6
+ api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
6
7
  isDisabled?: boolean;
7
8
  isReducedSpacing?: boolean;
8
- api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
9
9
  }
10
10
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
11
11
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
@@ -5,9 +5,9 @@
5
5
  import { jsx } from '@emotion/react';
6
6
  import type { Command, FloatingToolbarItem } from '@atlaskit/editor-common/types';
7
7
  type Props = {
8
- layoutButtons: FloatingToolbarItem<Command>[];
9
8
  dispatchCommand: (command: Command) => void;
10
9
  hide: () => void;
10
+ layoutButtons: FloatingToolbarItem<Command>[];
11
11
  };
12
12
  export declare const LayoutGroup: ({ layoutButtons, dispatchCommand, hide }: Props) => jsx.JSX.Element;
13
13
  export {};
@@ -10,11 +10,11 @@ import type { MediaLinkingState } from '../../pm-plugins/linking/types';
10
10
  export interface LinkingToolbarProps {
11
11
  editorState: EditorState;
12
12
  intl: IntlShape;
13
+ isInlineNode?: boolean;
14
+ isViewOnly?: boolean;
13
15
  mediaLinkingState: MediaLinkingState;
14
16
  onAddLink: React.MouseEventHandler;
15
17
  onEditLink: React.MouseEventHandler;
16
18
  onOpenLink: React.MouseEventHandler;
17
- isInlineNode?: boolean;
18
- isViewOnly?: boolean;
19
19
  }
20
20
  export declare const LinkToolbarAppearance: ({ editorState, mediaLinkingState, intl, onAddLink, onEditLink, onOpenLink, isInlineNode, isViewOnly, }: LinkingToolbarProps) => jsx.JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "5.2.13",
3
+ "version": "5.3.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,20 +41,20 @@
41
41
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
42
42
  "@atlaskit/editor-plugin-annotation": "^3.3.0",
43
43
  "@atlaskit/editor-plugin-connectivity": "^3.1.0",
44
- "@atlaskit/editor-plugin-decorations": "^3.0.0",
44
+ "@atlaskit/editor-plugin-decorations": "^3.1.0",
45
45
  "@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
46
46
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
47
- "@atlaskit/editor-plugin-floating-toolbar": "^5.1.0",
47
+ "@atlaskit/editor-plugin-floating-toolbar": "^5.2.0",
48
48
  "@atlaskit/editor-plugin-focus": "^2.0.0",
49
49
  "@atlaskit/editor-plugin-grid": "^3.1.0",
50
50
  "@atlaskit/editor-plugin-guideline": "^3.0.0",
51
51
  "@atlaskit/editor-plugin-interaction": "^5.0.0",
52
- "@atlaskit/editor-plugin-selection": "^3.1.0",
52
+ "@atlaskit/editor-plugin-selection": "^3.2.0",
53
53
  "@atlaskit/editor-plugin-width": "^4.0.0",
54
54
  "@atlaskit/editor-prosemirror": "7.0.0",
55
55
  "@atlaskit/editor-shared-styles": "^3.6.0",
56
56
  "@atlaskit/editor-tables": "^2.9.0",
57
- "@atlaskit/form": "^12.1.0",
57
+ "@atlaskit/form": "^12.2.0",
58
58
  "@atlaskit/icon": "^28.0.0",
59
59
  "@atlaskit/icon-lab": "^5.6.0",
60
60
  "@atlaskit/media-card": "^79.5.0",
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/primitives": "^14.11.0",
70
70
  "@atlaskit/textfield": "^8.0.0",
71
71
  "@atlaskit/theme": "^19.0.0",
72
- "@atlaskit/tmp-editor-statsig": "^11.3.0",
72
+ "@atlaskit/tmp-editor-statsig": "^11.6.0",
73
73
  "@atlaskit/tokens": "^6.0.0",
74
74
  "@atlaskit/tooltip": "^20.4.0",
75
75
  "@babel/runtime": "^7.0.0",
@@ -81,7 +81,7 @@
81
81
  "uuid": "^3.1.0"
82
82
  },
83
83
  "peerDependencies": {
84
- "@atlaskit/editor-common": "^107.26.0",
84
+ "@atlaskit/editor-common": "^107.29.0",
85
85
  "@atlaskit/media-core": "^37.0.0",
86
86
  "react": "^18.2.0",
87
87
  "react-dom": "^18.2.0",