@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.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/nodeviews/mediaGroup.js +1 -3
- package/dist/cjs/nodeviews/mediaInline.js +1 -3
- package/dist/cjs/nodeviews/mediaNodeView/index.js +1 -3
- package/dist/cjs/pm-plugins/utils/batchMediaNodeAttrs.js +2 -2
- package/dist/es2019/nodeviews/mediaGroup.js +1 -3
- package/dist/es2019/nodeviews/mediaInline.js +1 -3
- package/dist/es2019/nodeviews/mediaNodeView/index.js +1 -3
- package/dist/es2019/pm-plugins/utils/batchMediaNodeAttrs.js +2 -2
- package/dist/esm/nodeviews/mediaGroup.js +1 -3
- package/dist/esm/nodeviews/mediaInline.js +1 -3
- package/dist/esm/nodeviews/mediaNodeView/index.js +1 -3
- package/dist/esm/pm-plugins/utils/batchMediaNodeAttrs.js +2 -2
- package/dist/types/mediaPluginType.d.ts +4 -4
- package/dist/types/nodeviews/mediaGroupNext.d.ts +18 -18
- package/dist/types/nodeviews/mediaInline.d.ts +12 -12
- package/dist/types/nodeviews/mediaNodeUpdater.d.ts +5 -5
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +3 -3
- package/dist/types/nodeviews/mediaNodeView/media.d.ts +11 -11
- package/dist/types/nodeviews/mediaSingleNext.d.ts +16 -16
- package/dist/types/nodeviews/styles.d.ts +3 -3
- package/dist/types/nodeviews/toDOM-fixes/mediaSingle.d.ts +11 -11
- package/dist/types/nodeviews/types.d.ts +21 -21
- package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +6 -6
- package/dist/types/pm-plugins/linking/actions.d.ts +1 -1
- package/dist/types/pm-plugins/linking/types.d.ts +3 -3
- package/dist/types/pm-plugins/picker-facade.d.ts +2 -2
- package/dist/types/pm-plugins/pixel-resizing/ui/index.d.ts +4 -4
- package/dist/types/pm-plugins/pixel-resizing/ui/types.d.ts +28 -28
- package/dist/types/pm-plugins/types.d.ts +44 -44
- package/dist/types/pm-plugins/utils/batchMediaNodeAttrs.d.ts +1 -1
- package/dist/types/types/index.d.ts +52 -52
- package/dist/types/types/media-plugin-options.d.ts +5 -5
- package/dist/types/ui/CaptionPlaceholder/index.d.ts +1 -1
- package/dist/types/ui/CommentBadge/index.d.ts +8 -8
- package/dist/types/ui/ImageBorder/index.d.ts +2 -2
- package/dist/types/ui/MediaLinkingToolbar.d.ts +5 -5
- package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
- package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
- package/dist/types/ui/MediaPicker/DropzoneWrapper.d.ts +3 -3
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
- package/dist/types/ui/MediaPicker/index.d.ts +2 -2
- package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +5 -5
- package/dist/types/ui/MediaViewer/PortalWrapper.d.ts +1 -1
- package/dist/types/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types/ui/ResizableMediaSingle/types.d.ts +11 -11
- package/dist/types/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types/ui/toolbar/layout-group.d.ts +1 -1
- package/dist/types/ui/toolbar/linking-toolbar-appearance.d.ts +2 -2
- package/dist/types-ts4.5/mediaPluginType.d.ts +4 -4
- package/dist/types-ts4.5/nodeviews/mediaGroupNext.d.ts +18 -18
- package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +12 -12
- package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +5 -5
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +3 -3
- package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +11 -11
- package/dist/types-ts4.5/nodeviews/mediaSingleNext.d.ts +16 -16
- package/dist/types-ts4.5/nodeviews/styles.d.ts +3 -3
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaSingle.d.ts +11 -11
- package/dist/types-ts4.5/nodeviews/types.d.ts +21 -21
- package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +6 -6
- package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/linking/types.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/picker-facade.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/index.d.ts +4 -4
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/types.d.ts +28 -28
- package/dist/types-ts4.5/pm-plugins/types.d.ts +44 -44
- package/dist/types-ts4.5/pm-plugins/utils/batchMediaNodeAttrs.d.ts +1 -1
- package/dist/types-ts4.5/types/index.d.ts +52 -52
- package/dist/types-ts4.5/types/media-plugin-options.d.ts +5 -5
- package/dist/types-ts4.5/ui/CaptionPlaceholder/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/CommentBadge/index.d.ts +8 -8
- package/dist/types-ts4.5/ui/ImageBorder/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +5 -5
- package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +3 -3
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaPicker/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +5 -5
- package/dist/types-ts4.5/ui/MediaViewer/PortalWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/types.d.ts +11 -11
- package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/layout-group.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/linking-toolbar-appearance.d.ts +2 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 5.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`be641b962b3ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/be641b962b3ca) -
|
|
8
|
+
Debounced media inline rendering
|
|
9
|
+
- [`a994e589f089b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a994e589f089b) -
|
|
10
|
+
Debounced media group rendering
|
|
11
|
+
- [`b78d65b49af6a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b78d65b49af6a) -
|
|
12
|
+
Debounced media nodeview rendering
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
18
|
+
## 5.2.14
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
23
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 5.2.13
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -109,8 +109,6 @@ var ReactMediaGroupNode = exports.ReactMediaGroupNode = function ReactMediaGroup
|
|
|
109
109
|
providerFactory: providerFactory,
|
|
110
110
|
mediaOptions: mediaOptions,
|
|
111
111
|
pluginInjectionApi: pluginInjectionApi
|
|
112
|
-
}
|
|
113
|
-
// @portal-render-immediately
|
|
114
|
-
true).init();
|
|
112
|
+
}).init();
|
|
115
113
|
};
|
|
116
114
|
};
|
|
@@ -351,8 +351,6 @@ var ReactMediaInlineNode = exports.ReactMediaInlineNode = function ReactMediaInl
|
|
|
351
351
|
providerFactory: providerFactory,
|
|
352
352
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
353
353
|
api: api
|
|
354
|
-
}
|
|
355
|
-
// @portal-render-immediately
|
|
356
|
-
true).init();
|
|
354
|
+
}).init();
|
|
357
355
|
};
|
|
358
356
|
};
|
|
@@ -222,8 +222,6 @@ var ReactMediaNode = exports.ReactMediaNode = function ReactMediaNode(portalProv
|
|
|
222
222
|
providerFactory: providerFactory,
|
|
223
223
|
mediaOptions: mediaOptions,
|
|
224
224
|
pluginInjectionApi: pluginInjectionApi
|
|
225
|
-
}
|
|
226
|
-
// @portal-render-immediately
|
|
227
|
-
true).init();
|
|
225
|
+
}).init();
|
|
228
226
|
};
|
|
229
227
|
};
|
|
@@ -29,7 +29,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
29
29
|
* @template T
|
|
30
30
|
* @param {T} func - The function to debounce.
|
|
31
31
|
* @param {number} [wait=0] - The number of milliseconds to delay.
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {object} [options] - The options object to pass to `debounce`.
|
|
33
33
|
* @param {Function} [resolver] - The function to resolve the cache key for memoization.
|
|
34
34
|
* @returns {Function} A new debounced and memoized function.
|
|
35
35
|
*
|
|
@@ -115,7 +115,7 @@ var runUpdate = exports.runUpdate = function runUpdate(editorView, cache) {
|
|
|
115
115
|
* @type {Function}
|
|
116
116
|
* @param {Function} runUpdate - The function to be debounced.
|
|
117
117
|
* @param {number} debouncedTime - The debounce delay in milliseconds.
|
|
118
|
-
* @param {
|
|
118
|
+
* @param {object} [options] - The debounce options. Defaults to {leading: false, trailing: true}.
|
|
119
119
|
* @param {Function} keyResolver - A function that returns the key to be used for memoization. In this case, it returns the editor view instance.
|
|
120
120
|
*
|
|
121
121
|
* This function performs the following steps:
|
|
@@ -18,7 +18,7 @@ import { batchStepsUpdate } from './batchSteps';
|
|
|
18
18
|
* @template T
|
|
19
19
|
* @param {T} func - The function to debounce.
|
|
20
20
|
* @param {number} [wait=0] - The number of milliseconds to delay.
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {object} [options] - The options object to pass to `debounce`.
|
|
22
22
|
* @param {Function} [resolver] - The function to resolve the cache key for memoization.
|
|
23
23
|
* @returns {Function} A new debounced and memoized function.
|
|
24
24
|
*
|
|
@@ -100,7 +100,7 @@ export const runUpdate = (editorView, cache) => {
|
|
|
100
100
|
* @type {Function}
|
|
101
101
|
* @param {Function} runUpdate - The function to be debounced.
|
|
102
102
|
* @param {number} debouncedTime - The debounce delay in milliseconds.
|
|
103
|
-
* @param {
|
|
103
|
+
* @param {object} [options] - The debounce options. Defaults to {leading: false, trailing: true}.
|
|
104
104
|
* @param {Function} keyResolver - A function that returns the key to be used for memoization. In this case, it returns the editor view instance.
|
|
105
105
|
*
|
|
106
106
|
* This function performs the following steps:
|
|
@@ -102,8 +102,6 @@ export var ReactMediaGroupNode = function ReactMediaGroupNode(portalProviderAPI,
|
|
|
102
102
|
providerFactory: providerFactory,
|
|
103
103
|
mediaOptions: mediaOptions,
|
|
104
104
|
pluginInjectionApi: pluginInjectionApi
|
|
105
|
-
}
|
|
106
|
-
// @portal-render-immediately
|
|
107
|
-
true).init();
|
|
105
|
+
}).init();
|
|
108
106
|
};
|
|
109
107
|
};
|
|
@@ -347,8 +347,6 @@ export var ReactMediaInlineNode = function ReactMediaInlineNode(portalProviderAP
|
|
|
347
347
|
providerFactory: providerFactory,
|
|
348
348
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
349
349
|
api: api
|
|
350
|
-
}
|
|
351
|
-
// @portal-render-immediately
|
|
352
|
-
true).init();
|
|
350
|
+
}).init();
|
|
353
351
|
};
|
|
354
352
|
};
|
|
@@ -216,8 +216,6 @@ export var ReactMediaNode = function ReactMediaNode(portalProviderAPI, eventDisp
|
|
|
216
216
|
providerFactory: providerFactory,
|
|
217
217
|
mediaOptions: mediaOptions,
|
|
218
218
|
pluginInjectionApi: pluginInjectionApi
|
|
219
|
-
}
|
|
220
|
-
// @portal-render-immediately
|
|
221
|
-
true).init();
|
|
219
|
+
}).init();
|
|
222
220
|
};
|
|
223
221
|
};
|
|
@@ -23,7 +23,7 @@ import { batchStepsUpdate } from './batchSteps';
|
|
|
23
23
|
* @template T
|
|
24
24
|
* @param {T} func - The function to debounce.
|
|
25
25
|
* @param {number} [wait=0] - The number of milliseconds to delay.
|
|
26
|
-
* @param {
|
|
26
|
+
* @param {object} [options] - The options object to pass to `debounce`.
|
|
27
27
|
* @param {Function} [resolver] - The function to resolve the cache key for memoization.
|
|
28
28
|
* @returns {Function} A new debounced and memoized function.
|
|
29
29
|
*
|
|
@@ -109,7 +109,7 @@ export var runUpdate = function runUpdate(editorView, cache) {
|
|
|
109
109
|
* @type {Function}
|
|
110
110
|
* @param {Function} runUpdate - The function to be debounced.
|
|
111
111
|
* @param {number} debouncedTime - The debounce delay in milliseconds.
|
|
112
|
-
* @param {
|
|
112
|
+
* @param {object} [options] - The debounce options. Defaults to {leading: false, trailing: true}.
|
|
113
113
|
* @param {Function} keyResolver - A function that returns the key to be used for memoization. In this case, it returns the editor view instance.
|
|
114
114
|
*
|
|
115
115
|
* This function performs the following steps:
|
|
@@ -38,9 +38,6 @@ export type MediaPluginDependencies = [
|
|
|
38
38
|
OptionalPlugin<InteractionPlugin>
|
|
39
39
|
];
|
|
40
40
|
export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
41
|
-
pluginConfiguration: MediaOptions | undefined;
|
|
42
|
-
dependencies: MediaPluginDependencies;
|
|
43
|
-
sharedState: MediaPluginState | null;
|
|
44
41
|
actions: {
|
|
45
42
|
insertMediaAsMediaSingle: InsertMediaAsMediaSingle;
|
|
46
43
|
/**
|
|
@@ -55,8 +52,11 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
55
52
|
setProvider: (provider: Promise<MediaProvider>) => boolean;
|
|
56
53
|
};
|
|
57
54
|
commands: {
|
|
58
|
-
showMediaViewer: (media: MediaADFAttrs) => EditorCommand;
|
|
59
55
|
hideMediaViewer: EditorCommand;
|
|
56
|
+
showMediaViewer: (media: MediaADFAttrs) => EditorCommand;
|
|
60
57
|
trackMediaPaste: (attrs: MediaADFAttrs) => EditorCommand;
|
|
61
58
|
};
|
|
59
|
+
dependencies: MediaPluginDependencies;
|
|
60
|
+
pluginConfiguration: MediaOptions | undefined;
|
|
61
|
+
sharedState: MediaPluginState | null;
|
|
62
62
|
}>;
|
|
@@ -5,33 +5,33 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { MediaOptions } from '../types';
|
|
7
7
|
export declare const MediaGroupNext: React.FC<import("react-intl-next").WithIntlProps<{
|
|
8
|
-
forwardRef?: (ref: HTMLElement) => void;
|
|
9
|
-
node: PMNode;
|
|
10
|
-
view: EditorView;
|
|
11
|
-
getPos: () => number | undefined;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
editorViewMode?: boolean;
|
|
14
8
|
allowLazyLoading?: boolean;
|
|
15
|
-
mediaProvider: Promise<MediaProvider>;
|
|
16
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
17
|
-
isCopyPasteEnabled?: boolean;
|
|
18
9
|
anchorPos: number;
|
|
10
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
editorViewMode?: boolean;
|
|
13
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
14
|
+
getPos: () => number | undefined;
|
|
19
15
|
headPos: number;
|
|
16
|
+
isCopyPasteEnabled?: boolean;
|
|
20
17
|
mediaOptions: MediaOptions;
|
|
18
|
+
mediaProvider: Promise<MediaProvider>;
|
|
19
|
+
node: PMNode;
|
|
20
|
+
view: EditorView;
|
|
21
21
|
} & WrappedComponentProps>> & {
|
|
22
22
|
WrappedComponent: React.ComponentType<{
|
|
23
|
-
forwardRef?: (ref: HTMLElement) => void;
|
|
24
|
-
node: PMNode;
|
|
25
|
-
view: EditorView;
|
|
26
|
-
getPos: () => number | undefined;
|
|
27
|
-
disabled?: boolean;
|
|
28
|
-
editorViewMode?: boolean;
|
|
29
23
|
allowLazyLoading?: boolean;
|
|
30
|
-
mediaProvider: Promise<MediaProvider>;
|
|
31
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
32
|
-
isCopyPasteEnabled?: boolean;
|
|
33
24
|
anchorPos: number;
|
|
25
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
editorViewMode?: boolean;
|
|
28
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
29
|
+
getPos: () => number | undefined;
|
|
34
30
|
headPos: number;
|
|
31
|
+
isCopyPasteEnabled?: boolean;
|
|
35
32
|
mediaOptions: MediaOptions;
|
|
33
|
+
mediaProvider: Promise<MediaProvider>;
|
|
34
|
+
node: PMNode;
|
|
35
|
+
view: EditorView;
|
|
36
36
|
} & WrappedComponentProps>;
|
|
37
37
|
};
|
|
@@ -12,28 +12,28 @@ import type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
|
12
12
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
13
13
|
import type { getPosHandler, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
14
14
|
export interface MediaInlineProps {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
node: PMNode;
|
|
18
|
-
isSelected: boolean;
|
|
19
|
-
view: EditorView;
|
|
20
|
-
getPos: ProsemirrorGetPosHandler;
|
|
21
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
15
|
+
addPendingTask: (promise: Promise<any>) => void;
|
|
16
|
+
allowInlineImages?: boolean;
|
|
22
17
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
18
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
19
|
+
editorViewMode?: boolean;
|
|
20
|
+
getPos: ProsemirrorGetPosHandler;
|
|
23
21
|
handleMediaNodeMount: (node: PMNode, getPos: ProsemirrorGetPosHandler) => void;
|
|
24
22
|
handleMediaNodeUnmount: (node: PMNode) => void;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
selectedMediaContainerNode: () => PMNode | undefined;
|
|
23
|
+
identifier: FileIdentifier;
|
|
24
|
+
isSelected: boolean;
|
|
28
25
|
mediaClientConfig: MediaClientConfig;
|
|
29
|
-
|
|
26
|
+
mediaProvider: Promise<MediaProvider>;
|
|
27
|
+
node: PMNode;
|
|
28
|
+
selectedMediaContainerNode: () => PMNode | undefined;
|
|
29
|
+
view: EditorView;
|
|
30
30
|
}
|
|
31
31
|
export declare const handleNewNode: (props: MediaInlineProps) => void;
|
|
32
32
|
export declare const MediaInline: (props: MediaInlineProps) => jsx.JSX.Element;
|
|
33
33
|
interface MediaInlineNodeViewProps {
|
|
34
|
-
providerFactory: ProviderFactory;
|
|
35
34
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
36
35
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
36
|
+
providerFactory: ProviderFactory;
|
|
37
37
|
}
|
|
38
38
|
export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInlineNodeViewProps> {
|
|
39
39
|
createDomRef(): HTMLSpanElement;
|
|
@@ -5,18 +5,18 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
6
6
|
import type { MediaOptions, MediaPluginState, getPosHandler as ProsemirrorGetPosHandler, SupportedMediaAttributes } from '../types';
|
|
7
7
|
type RemoteDimensions = {
|
|
8
|
-
id: string;
|
|
9
8
|
height: number;
|
|
9
|
+
id: string;
|
|
10
10
|
width: number;
|
|
11
11
|
};
|
|
12
12
|
export interface MediaNodeUpdaterProps {
|
|
13
|
-
view: EditorView;
|
|
14
|
-
node: PMNode;
|
|
15
|
-
mediaProvider?: Promise<MediaProvider>;
|
|
16
13
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
14
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
17
15
|
isMediaSingle: boolean;
|
|
18
16
|
mediaOptions?: MediaOptions;
|
|
19
|
-
|
|
17
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
18
|
+
node: PMNode;
|
|
19
|
+
view: EditorView;
|
|
20
20
|
}
|
|
21
21
|
export declare class MediaNodeUpdater {
|
|
22
22
|
props: MediaNodeUpdaterProps;
|
|
@@ -12,9 +12,9 @@ import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
|
12
12
|
import type { getPosHandler, MediaOptions } from '../../types';
|
|
13
13
|
import type { MediaNodeViewProps } from '../types';
|
|
14
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
15
|
-
width?: WidthPluginState;
|
|
16
|
-
mediaProvider?: Promise<MediaProvider>;
|
|
17
15
|
interactionState?: SharedInteractionState['interactionState'];
|
|
16
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
17
|
+
width?: WidthPluginState;
|
|
18
18
|
}
|
|
19
19
|
declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
20
20
|
private isSelected;
|
|
@@ -24,8 +24,8 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
24
24
|
getAttrs(): MediaADFAttrs;
|
|
25
25
|
isMediaBlobUrl(): boolean;
|
|
26
26
|
onExternalImageLoaded: (dimensions: {
|
|
27
|
-
width: number;
|
|
28
27
|
height: number;
|
|
28
|
+
width: number;
|
|
29
29
|
}) => void;
|
|
30
30
|
renderMediaNodeWithState: (contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth, mediaProvider, interactionState, }: MediaNodeWithPluginStateComponentProps) => React.JSX.Element;
|
|
31
31
|
renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
|
|
@@ -10,23 +10,23 @@ import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler, ReactNode
|
|
|
10
10
|
export declare const MEDIA_HEIGHT = 125;
|
|
11
11
|
export declare const FILE_WIDTH = 156;
|
|
12
12
|
export interface MediaNodeProps extends ReactNodeProps, ImageLoaderProps {
|
|
13
|
-
view: EditorView;
|
|
14
|
-
node: PMNode;
|
|
15
|
-
getPos: ProsemirrorGetPosHandler;
|
|
16
13
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
17
|
-
|
|
18
|
-
maxDimensions: CardDimensions;
|
|
19
|
-
isMediaSingle?: boolean;
|
|
20
|
-
onClick?: CardOnClickCallback;
|
|
21
|
-
mediaProvider?: Promise<MediaProvider>;
|
|
14
|
+
getPos: ProsemirrorGetPosHandler;
|
|
22
15
|
isLoading?: boolean;
|
|
23
|
-
|
|
16
|
+
isMediaSingle?: boolean;
|
|
24
17
|
isViewOnly?: boolean;
|
|
18
|
+
maxDimensions: CardDimensions;
|
|
19
|
+
mediaOptions?: MediaOptions;
|
|
20
|
+
mediaProvider?: Promise<MediaProvider>;
|
|
21
|
+
node: PMNode;
|
|
22
|
+
onClick?: CardOnClickCallback;
|
|
23
|
+
originalDimensions: NumericalCardDimensions;
|
|
24
|
+
view: EditorView;
|
|
25
25
|
}
|
|
26
26
|
interface MediaNodeState {
|
|
27
|
-
viewMediaClientConfig?: MediaClientConfig;
|
|
28
|
-
viewAndUploadMediaClientConfig?: MediaClientConfig;
|
|
29
27
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
28
|
+
viewAndUploadMediaClientConfig?: MediaClientConfig;
|
|
29
|
+
viewMediaClientConfig?: MediaClientConfig;
|
|
30
30
|
}
|
|
31
31
|
export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState> {
|
|
32
32
|
private mediaPluginState;
|
|
@@ -8,26 +8,26 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
8
8
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
9
9
|
import type { ForwardRef, MediaOptions } from '../types';
|
|
10
10
|
export type MediaSingleNodeNextProps = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
addPendingTask?: (promise: Promise<any>) => void;
|
|
12
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
13
|
+
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
14
|
+
editorAppearance?: EditorAppearance;
|
|
15
|
+
editorDisabled?: boolean;
|
|
16
|
+
editorViewMode?: boolean;
|
|
14
17
|
eventDispatcher: EventDispatcher;
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
forwardRef: ForwardRef;
|
|
19
|
+
fullWidthMode?: boolean;
|
|
20
|
+
getPos: () => number | undefined;
|
|
21
|
+
isCopyPasteEnabled?: boolean;
|
|
22
|
+
isDrafting?: boolean;
|
|
17
23
|
lineLength: number;
|
|
18
24
|
mediaOptions: MediaOptions;
|
|
19
25
|
mediaProvider?: Promise<MediaProvider>;
|
|
20
|
-
|
|
21
|
-
fullWidthMode?: boolean;
|
|
22
|
-
addPendingTask?: (promise: Promise<any>) => void;
|
|
23
|
-
isDrafting?: boolean;
|
|
24
|
-
targetNodeId?: string;
|
|
25
|
-
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
26
|
-
isCopyPasteEnabled?: boolean;
|
|
27
|
-
forwardRef: ForwardRef;
|
|
26
|
+
node: PMNode;
|
|
28
27
|
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
selected: Function;
|
|
29
|
+
targetNodeId?: string;
|
|
30
|
+
view: EditorView;
|
|
31
|
+
width: number;
|
|
32
32
|
};
|
|
33
33
|
export declare const MediaSingleNodeNext: (mediaSingleNodeNextProps: MediaSingleNodeNextProps) => jsx.JSX.Element;
|
|
@@ -7,11 +7,11 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
import type { NumericalCardDimensions } from '@atlaskit/media-card';
|
|
8
8
|
export declare const MediaSingleNodeSelector = "media-single-node";
|
|
9
9
|
type MediaCardWrapperProps = {
|
|
10
|
-
dimensions: NumericalCardDimensions;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
selected?: boolean;
|
|
13
10
|
borderWidth?: number;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
dimensions: NumericalCardDimensions;
|
|
14
13
|
onContextMenu?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
14
|
+
selected?: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare const MediaCardWrapper: ({ dimensions, children, selected, borderWidth, onContextMenu, }: MediaCardWrapperProps) => jsx.JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema/schema';
|
|
2
2
|
import type { DOMOutputSpec, NodeSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
type MediaWidthCSSCalcProps = {
|
|
4
|
-
layout: MediaSingleLayout;
|
|
5
|
-
mediaSingleDimensionWidth: number | undefined;
|
|
6
4
|
baseWidth: number | undefined;
|
|
7
|
-
isPixelWidth: boolean;
|
|
8
5
|
isExtendedResizeExperience: boolean;
|
|
6
|
+
isPixelWidth: boolean;
|
|
7
|
+
layout: MediaSingleLayout;
|
|
8
|
+
mediaSingleDimensionWidth: number | undefined;
|
|
9
9
|
};
|
|
10
10
|
export declare const mediaWidthCSSCalc: ({ mediaSingleDimensionWidth, layout, baseWidth, isPixelWidth, isExtendedResizeExperience, }: MediaWidthCSSCalcProps) => string;
|
|
11
11
|
type MediaContentWrapperWidthCSSCalcProps = {
|
|
12
|
-
|
|
12
|
+
childMediaWidth: number | undefined;
|
|
13
13
|
isExternalMedia: boolean;
|
|
14
|
+
isMediaWrapped: boolean;
|
|
14
15
|
isPixelWidth: boolean;
|
|
15
|
-
childMediaWidth: number | undefined;
|
|
16
16
|
mediaSingleDimensionWidth: number | undefined;
|
|
17
17
|
};
|
|
18
18
|
export declare const mediaContentWrapperWidthCSSCalc: ({ isMediaWrapped, isExternalMedia, isPixelWidth, childMediaWidth, mediaSingleDimensionWidth, }: MediaContentWrapperWidthCSSCalcProps) => string;
|
|
19
19
|
type MediaProportionalWidthCSSCalcProps = {
|
|
20
|
-
isPixelWidth: boolean;
|
|
21
20
|
isExtendedResizeExperience: boolean;
|
|
22
21
|
isMediaWrapped: boolean;
|
|
22
|
+
isPixelWidth: boolean;
|
|
23
23
|
mediaSingleDimensionWidth: number | undefined;
|
|
24
24
|
};
|
|
25
25
|
export declare const mediaProportionalWidthCSSCalc: ({ isPixelWidth, isExtendedResizeExperience, mediaSingleDimensionWidth, isMediaWrapped, }: MediaProportionalWidthCSSCalcProps) => string;
|
|
@@ -28,13 +28,13 @@ type MediaJustifyContentCSSProps = {
|
|
|
28
28
|
};
|
|
29
29
|
export declare const mediaJustifyContentCSS: ({ layout }: MediaJustifyContentCSSProps) => string;
|
|
30
30
|
type PrepareWrapperContentDOMProps = {
|
|
31
|
-
layout: MediaSingleLayout;
|
|
32
|
-
dataAttrs: Record<string, unknown>;
|
|
33
|
-
childMediaWidth: number;
|
|
34
31
|
childMediaHeight: number;
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
childMediaWidth: number;
|
|
33
|
+
dataAttrs: Record<string, unknown>;
|
|
37
34
|
isExtendedResizeExperience: boolean;
|
|
35
|
+
isPixelWidth: boolean;
|
|
36
|
+
layout: MediaSingleLayout;
|
|
37
|
+
mediaSingleDimensionWidth: number;
|
|
38
38
|
};
|
|
39
39
|
export declare const prepareWrapperContentDOM: ({ layout, dataAttrs, childMediaWidth, childMediaHeight, mediaSingleDimensionWidth, isPixelWidth, isExtendedResizeExperience, }: PrepareWrapperContentDOMProps) => DOMOutputSpec;
|
|
40
40
|
export declare const getToDom: (allowPixelResizing: boolean) => (node: PMNode) => DOMOutputSpec;
|
|
@@ -7,41 +7,41 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
7
7
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
8
8
|
import type { ForwardRef, MediaOptions, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
9
9
|
export interface MediaSingleNodeProps {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
addPendingTask?: (promise: Promise<any>) => void;
|
|
11
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
12
|
+
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
13
|
+
editorAppearance?: EditorAppearance;
|
|
14
|
+
editorDisabled?: boolean;
|
|
15
|
+
editorViewMode?: boolean;
|
|
13
16
|
eventDispatcher: EventDispatcher;
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
forwardRef: ForwardRef;
|
|
18
|
+
fullWidthMode?: boolean;
|
|
19
|
+
getPos: ProsemirrorGetPosHandler;
|
|
20
|
+
isCopyPasteEnabled?: boolean;
|
|
21
|
+
isDrafting?: boolean;
|
|
16
22
|
lineLength: number;
|
|
17
23
|
mediaOptions: MediaOptions;
|
|
18
24
|
mediaProvider?: Promise<MediaProvider>;
|
|
19
|
-
|
|
20
|
-
fullWidthMode?: boolean;
|
|
21
|
-
addPendingTask?: (promise: Promise<any>) => void;
|
|
22
|
-
isDrafting?: boolean;
|
|
23
|
-
targetNodeId?: string;
|
|
24
|
-
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
25
|
-
isCopyPasteEnabled?: boolean;
|
|
26
|
-
forwardRef: ForwardRef;
|
|
25
|
+
node: PMNode;
|
|
27
26
|
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
selected: Function;
|
|
28
|
+
targetNodeId?: string;
|
|
29
|
+
view: EditorView;
|
|
30
|
+
width: number;
|
|
31
31
|
}
|
|
32
32
|
export interface MediaSingleNodeViewProps {
|
|
33
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
34
|
+
editorAppearance?: EditorAppearance;
|
|
33
35
|
eventDispatcher: EventDispatcher;
|
|
34
|
-
providerFactory: ProviderFactory;
|
|
35
|
-
mediaOptions: MediaOptions;
|
|
36
36
|
fullWidthMode?: boolean;
|
|
37
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
38
37
|
isCopyPasteEnabled?: boolean;
|
|
38
|
+
mediaOptions: MediaOptions;
|
|
39
39
|
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
40
|
-
|
|
40
|
+
providerFactory: ProviderFactory;
|
|
41
41
|
}
|
|
42
42
|
export interface MediaNodeViewProps {
|
|
43
43
|
eventDispatcher: EventDispatcher;
|
|
44
|
-
providerFactory: ProviderFactory;
|
|
45
44
|
mediaOptions: MediaOptions;
|
|
46
45
|
pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
46
|
+
providerFactory: ProviderFactory;
|
|
47
47
|
}
|
|
@@ -5,18 +5,18 @@ import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
export declare const MAX_ALT_TEXT_LENGTH = 510;
|
|
7
7
|
type Props = {
|
|
8
|
-
view: EditorView;
|
|
9
|
-
nodeType: 'mediaSingle' | 'mediaInline';
|
|
10
|
-
mediaType: 'file' | 'image' | 'external';
|
|
11
|
-
value?: string;
|
|
12
8
|
altTextValidator?: (value: string) => string[];
|
|
13
|
-
|
|
9
|
+
mediaType: 'file' | 'image' | 'external';
|
|
10
|
+
nodeType: 'mediaSingle' | 'mediaInline';
|
|
14
11
|
onEnter?: () => void;
|
|
12
|
+
onEscape?: () => void;
|
|
13
|
+
value?: string;
|
|
14
|
+
view: EditorView;
|
|
15
15
|
} & WrappedComponentProps & WithAnalyticsEventsProps;
|
|
16
16
|
export type AltTextEditComponentState = {
|
|
17
|
+
lastValue: string | undefined;
|
|
17
18
|
showClearTextButton: boolean;
|
|
18
19
|
validationErrors: string[] | undefined;
|
|
19
|
-
lastValue: string | undefined;
|
|
20
20
|
};
|
|
21
21
|
export declare class AltTextEditComponent extends React.Component<Props, AltTextEditComponentState> {
|
|
22
22
|
private fireCustomAnalytics?;
|
|
@@ -11,8 +11,8 @@ interface HideAction {
|
|
|
11
11
|
type: MediaLinkingActionsTypes.hideToolbar;
|
|
12
12
|
}
|
|
13
13
|
interface SetLinkToMedia {
|
|
14
|
-
type: MediaLinkingActionsTypes.setUrl;
|
|
15
14
|
payload: string;
|
|
15
|
+
type: MediaLinkingActionsTypes.setUrl;
|
|
16
16
|
}
|
|
17
17
|
interface Unlink {
|
|
18
18
|
type: MediaLinkingActionsTypes.unlink;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export type InitialState = {
|
|
2
|
-
visible: false;
|
|
3
2
|
editable: false;
|
|
4
3
|
link: '';
|
|
5
4
|
mediaPos: null;
|
|
5
|
+
visible: false;
|
|
6
6
|
};
|
|
7
7
|
export type MediaLinkingState = {
|
|
8
|
-
mediaPos: number | null;
|
|
9
|
-
link: string;
|
|
10
8
|
editable: boolean;
|
|
9
|
+
link: string;
|
|
10
|
+
mediaPos: number | null;
|
|
11
11
|
visible: boolean;
|
|
12
12
|
};
|
|
@@ -5,14 +5,14 @@ import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, Uplo
|
|
|
5
5
|
import type { CustomMediaPicker, MediaState, MediaStateEventSubscriber, MobileUploadEndEventPayload } from '../types';
|
|
6
6
|
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
7
|
type ExtendedComponentConfigs = {
|
|
8
|
+
clipboard: null;
|
|
8
9
|
customMediaPicker: CustomMediaPicker;
|
|
9
10
|
dropzone: null;
|
|
10
|
-
clipboard: null;
|
|
11
11
|
};
|
|
12
12
|
export type PickerFacadeConfig = {
|
|
13
|
-
mediaClientConfig: MediaClientConfig;
|
|
14
13
|
errorReporter: ErrorReportingHandler;
|
|
15
14
|
featureFlags?: MediaFeatureFlags;
|
|
15
|
+
mediaClientConfig: MediaClientConfig;
|
|
16
16
|
};
|
|
17
17
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
18
18
|
export default class PickerFacade {
|
|
@@ -8,12 +8,12 @@ import type { MediaNextEditorPluginType } from '../../../mediaPluginType';
|
|
|
8
8
|
import type { MediaPluginState } from '../../../types';
|
|
9
9
|
export type Props = {
|
|
10
10
|
editorView: EditorView;
|
|
11
|
-
selectedMediaSingleNode: ContentNodeWithPos;
|
|
12
|
-
pluginInjectionApi?: ExtractInjectionAPI<MediaNextEditorPluginType>;
|
|
13
|
-
intl: IntlShape;
|
|
14
|
-
pluginState: MediaPluginState;
|
|
15
11
|
hoverDecoration: HoverDecorationHandler | undefined;
|
|
12
|
+
intl: IntlShape;
|
|
16
13
|
isEditorFullWidthEnabled?: boolean;
|
|
14
|
+
pluginInjectionApi?: ExtractInjectionAPI<MediaNextEditorPluginType>;
|
|
15
|
+
pluginState: MediaPluginState;
|
|
16
|
+
selectedMediaSingleNode: ContentNodeWithPos;
|
|
17
17
|
triggerButtonSelector?: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const PixelEntry: ({ editorView, selectedMediaSingleNode, pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Props) => jsx.JSX.Element | null;
|