@atlaskit/editor-plugin-media 5.2.6 → 5.2.7
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 +12 -0
- package/dist/cjs/nodeviews/toDOM-fixes/media.js +2 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -5
- package/dist/es2019/nodeviews/toDOM-fixes/media.js +2 -1
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -5
- package/dist/esm/nodeviews/toDOM-fixes/media.js +2 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -5
- package/dist/types/nodeviews/lazy-media-group.d.ts +2 -1
- package/dist/types/nodeviews/lazy-media.d.ts +2 -1
- package/dist/types/nodeviews/mediaGroup.d.ts +2 -2
- package/dist/types/nodeviews/mediaGroupNext.d.ts +12 -12
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +2 -2
- package/dist/types/nodeviews/toDOM-fixes/mediaGroup.d.ts +1 -1
- package/dist/types/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -1
- package/dist/types/pm-plugins/linking/index.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/picker-facade.d.ts +7 -2
- package/dist/types/pm-plugins/pixel-resizing/index.d.ts +1 -1
- package/dist/types/pm-plugins/utils/analytics.d.ts +2 -2
- package/dist/types/pm-plugins/utils/check-media-type.d.ts +1 -1
- package/dist/types/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types/ui/toolbar/alt-text.d.ts +1 -1
- package/dist/types/ui/toolbar/pixel-resizing.d.ts +2 -2
- package/dist/types/ui/toolbar/utils.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/lazy-media-group.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/lazy-media.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/mediaGroupNext.d.ts +12 -12
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaGroup.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/linking/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/picker-facade.d.ts +7 -2
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/utils/check-media-type.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/alt-text.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/pixel-resizing.d.ts +2 -2
- package/dist/types-ts4.5/ui/toolbar/utils.d.ts +1 -1
- package/package.json +9 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 5.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#199487](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/199487)
|
|
8
|
+
[`859430405e506`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/859430405e506) -
|
|
9
|
+
ED-28970 remove platform_editor_inline_resize_media_to_edge
|
|
10
|
+
- [#199353](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/199353)
|
|
11
|
+
[`f2d4ca35574b8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2d4ca35574b8) -
|
|
12
|
+
Internal changes to how border radius values are applied. No visual change.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 5.2.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -63,7 +63,8 @@ var mediaSpecWithFixedToDOM = exports.mediaSpecWithFixedToDOM = function mediaSp
|
|
|
63
63
|
backgroundImage: "url(\"".concat(dataUrl, "\")"),
|
|
64
64
|
marginLeft: '0',
|
|
65
65
|
marginRight: 'var(--ak-editor-media-margin-right, 4px)',
|
|
66
|
-
|
|
66
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
67
|
+
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
67
68
|
outline: 'none',
|
|
68
69
|
flexBasis: "".concat(defaultImageCardDimensions.width, "px"),
|
|
69
70
|
backgroundColor: 'var(--ak-editor-media-card-background-color)',
|
|
@@ -214,10 +214,8 @@ var ResizableMediaSingleNextFunctional = exports.ResizableMediaSingleNextFunctio
|
|
|
214
214
|
return !!($pos && $pos.depth !== 0);
|
|
215
215
|
}, [nodePosition, view]);
|
|
216
216
|
var isAdjacentMode = (0, _react.useMemo)(function () {
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
217
|
+
if (forceHandlePositioning === 'adjacent') {
|
|
218
|
+
return true;
|
|
221
219
|
}
|
|
222
220
|
return isNestedNode;
|
|
223
221
|
}, [isNestedNode, forceHandlePositioning]);
|
|
@@ -233,7 +231,7 @@ var ResizableMediaSingleNextFunctional = exports.ResizableMediaSingleNextFunctio
|
|
|
233
231
|
});
|
|
234
232
|
}, [layout, maybeContainerWidth, fullWidthMode, dimensions.width, isAdjacentMode]);
|
|
235
233
|
var maxWidth = (0, _react.useMemo)(function () {
|
|
236
|
-
if (editorAppearance === 'chromeless' && forceHandlePositioning === 'adjacent'
|
|
234
|
+
if (editorAppearance === 'chromeless' && forceHandlePositioning === 'adjacent') {
|
|
237
235
|
return containerWidth - _mediaSingle.MEDIA_SINGLE_ADJACENT_HANDLE_MARGIN * 2;
|
|
238
236
|
}
|
|
239
237
|
if (!isResizing && isAdjacentMode) {
|
|
@@ -56,7 +56,8 @@ export const mediaSpecWithFixedToDOM = () => {
|
|
|
56
56
|
backgroundImage: `url("${dataUrl}")`,
|
|
57
57
|
marginLeft: '0',
|
|
58
58
|
marginRight: 'var(--ak-editor-media-margin-right, 4px)',
|
|
59
|
-
|
|
59
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
60
|
+
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
60
61
|
outline: 'none',
|
|
61
62
|
flexBasis: `${defaultImageCardDimensions.width}px`,
|
|
62
63
|
backgroundColor: 'var(--ak-editor-media-card-background-color)',
|
|
@@ -194,10 +194,8 @@ export const ResizableMediaSingleNextFunctional = props => {
|
|
|
194
194
|
return !!($pos && $pos.depth !== 0);
|
|
195
195
|
}, [nodePosition, view]);
|
|
196
196
|
const isAdjacentMode = useMemo(() => {
|
|
197
|
-
if (
|
|
198
|
-
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
197
|
+
if (forceHandlePositioning === 'adjacent') {
|
|
198
|
+
return true;
|
|
201
199
|
}
|
|
202
200
|
return isNestedNode;
|
|
203
201
|
}, [isNestedNode, forceHandlePositioning]);
|
|
@@ -213,7 +211,7 @@ export const ResizableMediaSingleNextFunctional = props => {
|
|
|
213
211
|
});
|
|
214
212
|
}, [layout, maybeContainerWidth, fullWidthMode, dimensions.width, isAdjacentMode]);
|
|
215
213
|
const maxWidth = useMemo(() => {
|
|
216
|
-
if (editorAppearance === 'chromeless' && forceHandlePositioning === 'adjacent'
|
|
214
|
+
if (editorAppearance === 'chromeless' && forceHandlePositioning === 'adjacent') {
|
|
217
215
|
return containerWidth - MEDIA_SINGLE_ADJACENT_HANDLE_MARGIN * 2;
|
|
218
216
|
}
|
|
219
217
|
if (!isResizing && isAdjacentMode) {
|
|
@@ -57,7 +57,8 @@ export var mediaSpecWithFixedToDOM = function mediaSpecWithFixedToDOM() {
|
|
|
57
57
|
backgroundImage: "url(\"".concat(dataUrl, "\")"),
|
|
58
58
|
marginLeft: '0',
|
|
59
59
|
marginRight: 'var(--ak-editor-media-margin-right, 4px)',
|
|
60
|
-
|
|
60
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
61
|
+
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
61
62
|
outline: 'none',
|
|
62
63
|
flexBasis: "".concat(defaultImageCardDimensions.width, "px"),
|
|
63
64
|
backgroundColor: 'var(--ak-editor-media-card-background-color)',
|
|
@@ -204,10 +204,8 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
|
|
|
204
204
|
return !!($pos && $pos.depth !== 0);
|
|
205
205
|
}, [nodePosition, view]);
|
|
206
206
|
var isAdjacentMode = useMemo(function () {
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
return true;
|
|
210
|
-
}
|
|
207
|
+
if (forceHandlePositioning === 'adjacent') {
|
|
208
|
+
return true;
|
|
211
209
|
}
|
|
212
210
|
return isNestedNode;
|
|
213
211
|
}, [isNestedNode, forceHandlePositioning]);
|
|
@@ -223,7 +221,7 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
|
|
|
223
221
|
});
|
|
224
222
|
}, [layout, maybeContainerWidth, fullWidthMode, dimensions.width, isAdjacentMode]);
|
|
225
223
|
var maxWidth = useMemo(function () {
|
|
226
|
-
if (editorAppearance === 'chromeless' && forceHandlePositioning === 'adjacent'
|
|
224
|
+
if (editorAppearance === 'chromeless' && forceHandlePositioning === 'adjacent') {
|
|
227
225
|
return containerWidth - MEDIA_SINGLE_ADJACENT_HANDLE_MARGIN * 2;
|
|
228
226
|
}
|
|
229
227
|
if (!isResizing && isAdjacentMode) {
|
|
@@ -3,4 +3,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
6
|
-
|
|
6
|
+
import type { MediaOptions } from '../types';
|
|
7
|
+
export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
@@ -4,4 +4,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
4
4
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
7
|
-
|
|
7
|
+
import type { MediaOptions } from '../types';
|
|
8
|
+
export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
|
|
@@ -5,5 +5,5 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
8
|
-
import type { getPosHandler } from '../types';
|
|
9
|
-
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
8
|
+
import type { getPosHandler, MediaOptions } from '../types';
|
|
9
|
+
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -5,31 +5,31 @@ 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?: (
|
|
8
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
9
9
|
node: PMNode;
|
|
10
10
|
view: EditorView;
|
|
11
11
|
getPos: () => number | undefined;
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
editorViewMode?: boolean
|
|
14
|
-
allowLazyLoading?: boolean
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
editorViewMode?: boolean;
|
|
14
|
+
allowLazyLoading?: boolean;
|
|
15
15
|
mediaProvider: Promise<MediaProvider>;
|
|
16
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
17
|
-
isCopyPasteEnabled?: boolean
|
|
16
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
17
|
+
isCopyPasteEnabled?: boolean;
|
|
18
18
|
anchorPos: number;
|
|
19
19
|
headPos: number;
|
|
20
20
|
mediaOptions: MediaOptions;
|
|
21
21
|
} & WrappedComponentProps>> & {
|
|
22
22
|
WrappedComponent: React.ComponentType<{
|
|
23
|
-
forwardRef?: (
|
|
23
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
24
24
|
node: PMNode;
|
|
25
25
|
view: EditorView;
|
|
26
26
|
getPos: () => number | undefined;
|
|
27
|
-
disabled?: boolean
|
|
28
|
-
editorViewMode?: boolean
|
|
29
|
-
allowLazyLoading?: boolean
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
editorViewMode?: boolean;
|
|
29
|
+
allowLazyLoading?: boolean;
|
|
30
30
|
mediaProvider: Promise<MediaProvider>;
|
|
31
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
32
|
-
isCopyPasteEnabled?: boolean
|
|
31
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
32
|
+
isCopyPasteEnabled?: boolean;
|
|
33
33
|
anchorPos: number;
|
|
34
34
|
headPos: number;
|
|
35
35
|
mediaOptions: MediaOptions;
|
|
@@ -9,7 +9,7 @@ import type { SharedInteractionState } from '@atlaskit/editor-plugin-interaction
|
|
|
9
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
12
|
-
import type { getPosHandler } from '../../types';
|
|
12
|
+
import type { getPosHandler, MediaOptions } from '../../types';
|
|
13
13
|
import type { MediaNodeViewProps } from '../types';
|
|
14
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
15
15
|
width?: WidthPluginState;
|
|
@@ -31,5 +31,5 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
31
31
|
renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
|
|
32
32
|
render(): React.JSX.Element;
|
|
33
33
|
}
|
|
34
|
-
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
34
|
+
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
|
|
35
35
|
export {};
|
|
@@ -32,5 +32,5 @@ export declare const defaultSquareCardDimensions: {
|
|
|
32
32
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
33
33
|
* case we can consolidate them.
|
|
34
34
|
*/
|
|
35
|
-
export declare const getDefaultCardDimensions: (appearance?:
|
|
35
|
+
export declare const getDefaultCardDimensions: (appearance?: "image" | "square" | "horizontal" | "auto") => Required<typeof defaultImageCardDimensions>;
|
|
36
36
|
export declare const mediaGroupSpecWithFixedToDOM: () => import("prosemirror-model").NodeSpec;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
3
|
+
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
4
4
|
export declare const createPlugin: ({ dispatch, providerFactory }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
5
5
|
export { createCommand, getPluginState };
|
|
@@ -41,6 +41,6 @@ export declare class AltTextEditComponent extends React.Component<Props, AltText
|
|
|
41
41
|
private handleClearText;
|
|
42
42
|
}
|
|
43
43
|
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Props, "intl"> & {
|
|
44
|
-
forwardedRef?: React.Ref<any
|
|
44
|
+
forwardedRef?: React.Ref<any>;
|
|
45
45
|
}, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
46
46
|
export default _default;
|
|
@@ -4,6 +4,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import type { MediaLinkingActions } from './actions';
|
|
5
5
|
import type { MediaLinkingState } from './types';
|
|
6
6
|
export declare const mediaLinkingPluginKey: PluginKey<MediaLinkingState>;
|
|
7
|
-
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getMediaLinkingState: (state: import("prosemirror-state").EditorState) => MediaLinkingState;
|
|
8
8
|
declare const _default: (dispatch: Dispatch) => SafePlugin<MediaLinkingState>;
|
|
9
9
|
export default _default;
|
|
@@ -96,7 +96,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
96
96
|
*
|
|
97
97
|
* NOTE: The promise will resolve even if some of the media have failed to process.
|
|
98
98
|
*/
|
|
99
|
-
waitForPendingTasks: (timeout?: number
|
|
99
|
+
waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
|
|
100
100
|
setView(view: EditorView): void;
|
|
101
101
|
/**
|
|
102
102
|
* Called from React UI Component when user clicks on "Delete" icon
|
|
@@ -134,7 +134,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
134
134
|
private handleMediaState;
|
|
135
135
|
removeSelectedMediaContainer: () => boolean;
|
|
136
136
|
selectedMediaContainerNode: () => PMNode | undefined;
|
|
137
|
-
handleDrag: (dragState:
|
|
137
|
+
handleDrag: (dragState: "enter" | "leave") => void;
|
|
138
138
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
139
139
|
}
|
|
140
140
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
@@ -4,6 +4,11 @@ import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
|
4
4
|
import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
|
|
5
5
|
import type { CustomMediaPicker, MediaState, MediaStateEventSubscriber, MobileUploadEndEventPayload } from '../types';
|
|
6
6
|
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
|
+
type ExtendedComponentConfigs = {
|
|
8
|
+
customMediaPicker: CustomMediaPicker;
|
|
9
|
+
dropzone: null;
|
|
10
|
+
clipboard: null;
|
|
11
|
+
};
|
|
7
12
|
export type PickerFacadeConfig = {
|
|
8
13
|
mediaClientConfig: MediaClientConfig;
|
|
9
14
|
errorReporter: ErrorReportingHandler;
|
|
@@ -12,7 +17,7 @@ export type PickerFacadeConfig = {
|
|
|
12
17
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
13
18
|
export default class PickerFacade {
|
|
14
19
|
readonly config: PickerFacadeConfig;
|
|
15
|
-
readonly pickerConfig?:
|
|
20
|
+
readonly pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined;
|
|
16
21
|
private picker?;
|
|
17
22
|
private onDragListeners;
|
|
18
23
|
private pickerType;
|
|
@@ -20,7 +25,7 @@ export default class PickerFacade {
|
|
|
20
25
|
private eventListeners;
|
|
21
26
|
private analyticsName;
|
|
22
27
|
erroredFiles: Set<string>;
|
|
23
|
-
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?:
|
|
28
|
+
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined, analyticsName?: string);
|
|
24
29
|
init(): Promise<PickerFacade>;
|
|
25
30
|
get type(): PickerType;
|
|
26
31
|
get mediaPicker(): CustomMediaPicker | undefined;
|
|
@@ -4,7 +4,7 @@ declare const createCommand: <A = {
|
|
|
4
4
|
type: "openPixelEditor";
|
|
5
5
|
} | {
|
|
6
6
|
type: "closePixelEditor";
|
|
7
|
-
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => {
|
|
8
8
|
isPixelEditorOpen: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MediaEventPayload, MediaInputResizeTrackAction, MediaResizeTrackAction, MediaSwitchType } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T[
|
|
4
|
-
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T[
|
|
3
|
+
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
4
|
+
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
5
5
|
export declare const getChangeMediaAnalytics: (previousType: MediaSwitchType, newType: MediaSwitchType, changeFromLocation?: string) => MediaEventPayload;
|
|
6
6
|
export declare function findChangeFromLocation(selection: Selection): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { MediaType } from '@atlaskit/media-client';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
|
-
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType |
|
|
4
|
+
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType | "external" | undefined>;
|
|
@@ -7,6 +7,6 @@ import type { MediaState } from '../../types';
|
|
|
7
7
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
8
8
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
9
9
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
10
|
-
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (
|
|
10
|
+
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (id: string, selectionPosition: number) => void, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
11
11
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
12
12
|
export declare const isVideo: import("memoize-one").MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -30,7 +30,7 @@ export default class ResizableMediaSingle extends React.Component<Props, State>
|
|
|
30
30
|
width: number | null;
|
|
31
31
|
layout: MediaSingleLayout;
|
|
32
32
|
};
|
|
33
|
-
calcUnwrappedLayout: (pct: number, width: number) =>
|
|
33
|
+
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
34
34
|
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
35
35
|
/**
|
|
36
36
|
* The maxmimum number of grid columns this node can resize to.
|
|
@@ -12,5 +12,5 @@ interface AltTextToolbarOptions {
|
|
|
12
12
|
triggerButtonSelector?: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const getAltTextToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, options?: AltTextToolbarOptions) => FloatingToolbarConfig;
|
|
15
|
-
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape[
|
|
15
|
+
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape["formatMessage"], allowAltTextOnImages?: boolean, selectedNodeType?: NodeType, editorAnalyticsAPI?: EditorAnalyticsAPI) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
16
16
|
export {};
|
|
@@ -4,5 +4,5 @@ import { type NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { type Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
6
|
import type { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
7
|
-
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props,
|
|
8
|
-
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape[
|
|
7
|
+
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props, "editorView" | "selectedMediaSingleNode">) => FloatingToolbarConfig;
|
|
8
|
+
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape["formatMessage"], selectedNodeType?: NodeType) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
@@ -25,4 +25,4 @@ export declare const getSelectedLayoutIcon: (layoutIcons: LayoutIcon[], selected
|
|
|
25
25
|
*/
|
|
26
26
|
export declare const canShowSwitchButtons: (mediaSingleNode?: ProseMirrorNode) => boolean | null;
|
|
27
27
|
export declare const updateToFullHeightSeparator: (items: FloatingToolbarItem<Command>[]) => void;
|
|
28
|
-
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType:
|
|
28
|
+
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType: "inline" | "block", intl: IntlShape, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, hasCaption?: boolean) => FloatingToolbarDropdown<Command>;
|
|
@@ -3,4 +3,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
6
|
-
|
|
6
|
+
import type { MediaOptions } from '../types';
|
|
7
|
+
export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
@@ -4,4 +4,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
4
4
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
7
|
-
|
|
7
|
+
import type { MediaOptions } from '../types';
|
|
8
|
+
export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
|
|
@@ -5,5 +5,5 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
8
|
-
import type { getPosHandler } from '../types';
|
|
9
|
-
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
8
|
+
import type { getPosHandler, MediaOptions } from '../types';
|
|
9
|
+
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -5,31 +5,31 @@ 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?: (
|
|
8
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
9
9
|
node: PMNode;
|
|
10
10
|
view: EditorView;
|
|
11
11
|
getPos: () => number | undefined;
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
editorViewMode?: boolean
|
|
14
|
-
allowLazyLoading?: boolean
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
editorViewMode?: boolean;
|
|
14
|
+
allowLazyLoading?: boolean;
|
|
15
15
|
mediaProvider: Promise<MediaProvider>;
|
|
16
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
17
|
-
isCopyPasteEnabled?: boolean
|
|
16
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
17
|
+
isCopyPasteEnabled?: boolean;
|
|
18
18
|
anchorPos: number;
|
|
19
19
|
headPos: number;
|
|
20
20
|
mediaOptions: MediaOptions;
|
|
21
21
|
} & WrappedComponentProps>> & {
|
|
22
22
|
WrappedComponent: React.ComponentType<{
|
|
23
|
-
forwardRef?: (
|
|
23
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
24
24
|
node: PMNode;
|
|
25
25
|
view: EditorView;
|
|
26
26
|
getPos: () => number | undefined;
|
|
27
|
-
disabled?: boolean
|
|
28
|
-
editorViewMode?: boolean
|
|
29
|
-
allowLazyLoading?: boolean
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
editorViewMode?: boolean;
|
|
29
|
+
allowLazyLoading?: boolean;
|
|
30
30
|
mediaProvider: Promise<MediaProvider>;
|
|
31
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
32
|
-
isCopyPasteEnabled?: boolean
|
|
31
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
32
|
+
isCopyPasteEnabled?: boolean;
|
|
33
33
|
anchorPos: number;
|
|
34
34
|
headPos: number;
|
|
35
35
|
mediaOptions: MediaOptions;
|
|
@@ -9,7 +9,7 @@ import type { SharedInteractionState } from '@atlaskit/editor-plugin-interaction
|
|
|
9
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
12
|
-
import type { getPosHandler } from '../../types';
|
|
12
|
+
import type { getPosHandler, MediaOptions } from '../../types';
|
|
13
13
|
import type { MediaNodeViewProps } from '../types';
|
|
14
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
15
15
|
width?: WidthPluginState;
|
|
@@ -31,5 +31,5 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
31
31
|
renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
|
|
32
32
|
render(): React.JSX.Element;
|
|
33
33
|
}
|
|
34
|
-
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
34
|
+
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
|
|
35
35
|
export {};
|
|
@@ -32,5 +32,5 @@ export declare const defaultSquareCardDimensions: {
|
|
|
32
32
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
33
33
|
* case we can consolidate them.
|
|
34
34
|
*/
|
|
35
|
-
export declare const getDefaultCardDimensions: (appearance?:
|
|
35
|
+
export declare const getDefaultCardDimensions: (appearance?: "image" | "square" | "horizontal" | "auto") => Required<typeof defaultImageCardDimensions>;
|
|
36
36
|
export declare const mediaGroupSpecWithFixedToDOM: () => import("prosemirror-model").NodeSpec;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
3
|
+
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
4
4
|
export declare const createPlugin: ({ dispatch, providerFactory }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
5
5
|
export { createCommand, getPluginState };
|
|
@@ -41,6 +41,6 @@ export declare class AltTextEditComponent extends React.Component<Props, AltText
|
|
|
41
41
|
private handleClearText;
|
|
42
42
|
}
|
|
43
43
|
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Props, "intl"> & {
|
|
44
|
-
forwardedRef?: React.Ref<any
|
|
44
|
+
forwardedRef?: React.Ref<any>;
|
|
45
45
|
}, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
46
46
|
export default _default;
|
|
@@ -4,6 +4,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import type { MediaLinkingActions } from './actions';
|
|
5
5
|
import type { MediaLinkingState } from './types';
|
|
6
6
|
export declare const mediaLinkingPluginKey: PluginKey<MediaLinkingState>;
|
|
7
|
-
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getMediaLinkingState: (state: import("prosemirror-state").EditorState) => MediaLinkingState;
|
|
8
8
|
declare const _default: (dispatch: Dispatch) => SafePlugin<MediaLinkingState>;
|
|
9
9
|
export default _default;
|
|
@@ -96,7 +96,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
96
96
|
*
|
|
97
97
|
* NOTE: The promise will resolve even if some of the media have failed to process.
|
|
98
98
|
*/
|
|
99
|
-
waitForPendingTasks: (timeout?: number
|
|
99
|
+
waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
|
|
100
100
|
setView(view: EditorView): void;
|
|
101
101
|
/**
|
|
102
102
|
* Called from React UI Component when user clicks on "Delete" icon
|
|
@@ -134,7 +134,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
134
134
|
private handleMediaState;
|
|
135
135
|
removeSelectedMediaContainer: () => boolean;
|
|
136
136
|
selectedMediaContainerNode: () => PMNode | undefined;
|
|
137
|
-
handleDrag: (dragState:
|
|
137
|
+
handleDrag: (dragState: "enter" | "leave") => void;
|
|
138
138
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
139
139
|
}
|
|
140
140
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
@@ -4,6 +4,11 @@ import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
|
4
4
|
import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
|
|
5
5
|
import type { CustomMediaPicker, MediaState, MediaStateEventSubscriber, MobileUploadEndEventPayload } from '../types';
|
|
6
6
|
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
|
+
type ExtendedComponentConfigs = {
|
|
8
|
+
customMediaPicker: CustomMediaPicker;
|
|
9
|
+
dropzone: null;
|
|
10
|
+
clipboard: null;
|
|
11
|
+
};
|
|
7
12
|
export type PickerFacadeConfig = {
|
|
8
13
|
mediaClientConfig: MediaClientConfig;
|
|
9
14
|
errorReporter: ErrorReportingHandler;
|
|
@@ -12,7 +17,7 @@ export type PickerFacadeConfig = {
|
|
|
12
17
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
13
18
|
export default class PickerFacade {
|
|
14
19
|
readonly config: PickerFacadeConfig;
|
|
15
|
-
readonly pickerConfig?:
|
|
20
|
+
readonly pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined;
|
|
16
21
|
private picker?;
|
|
17
22
|
private onDragListeners;
|
|
18
23
|
private pickerType;
|
|
@@ -20,7 +25,7 @@ export default class PickerFacade {
|
|
|
20
25
|
private eventListeners;
|
|
21
26
|
private analyticsName;
|
|
22
27
|
erroredFiles: Set<string>;
|
|
23
|
-
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?:
|
|
28
|
+
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined, analyticsName?: string);
|
|
24
29
|
init(): Promise<PickerFacade>;
|
|
25
30
|
get type(): PickerType;
|
|
26
31
|
get mediaPicker(): CustomMediaPicker | undefined;
|
|
@@ -4,7 +4,7 @@ declare const createCommand: <A = {
|
|
|
4
4
|
type: "openPixelEditor";
|
|
5
5
|
} | {
|
|
6
6
|
type: "closePixelEditor";
|
|
7
|
-
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => {
|
|
8
8
|
isPixelEditorOpen: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MediaEventPayload, MediaInputResizeTrackAction, MediaResizeTrackAction, MediaSwitchType } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T[
|
|
4
|
-
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T[
|
|
3
|
+
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
4
|
+
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
5
5
|
export declare const getChangeMediaAnalytics: (previousType: MediaSwitchType, newType: MediaSwitchType, changeFromLocation?: string) => MediaEventPayload;
|
|
6
6
|
export declare function findChangeFromLocation(selection: Selection): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { MediaType } from '@atlaskit/media-client';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
|
-
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType |
|
|
4
|
+
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType | "external" | undefined>;
|
|
@@ -7,6 +7,6 @@ import type { MediaState } from '../../types';
|
|
|
7
7
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
8
8
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
9
9
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
10
|
-
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (
|
|
10
|
+
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (id: string, selectionPosition: number) => void, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
11
11
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
12
12
|
export declare const isVideo: import("memoize-one").MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -30,7 +30,7 @@ export default class ResizableMediaSingle extends React.Component<Props, State>
|
|
|
30
30
|
width: number | null;
|
|
31
31
|
layout: MediaSingleLayout;
|
|
32
32
|
};
|
|
33
|
-
calcUnwrappedLayout: (pct: number, width: number) =>
|
|
33
|
+
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
34
34
|
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
35
35
|
/**
|
|
36
36
|
* The maxmimum number of grid columns this node can resize to.
|
|
@@ -12,5 +12,5 @@ interface AltTextToolbarOptions {
|
|
|
12
12
|
triggerButtonSelector?: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const getAltTextToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, options?: AltTextToolbarOptions) => FloatingToolbarConfig;
|
|
15
|
-
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape[
|
|
15
|
+
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape["formatMessage"], allowAltTextOnImages?: boolean, selectedNodeType?: NodeType, editorAnalyticsAPI?: EditorAnalyticsAPI) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
16
16
|
export {};
|
|
@@ -4,5 +4,5 @@ import { type NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { type Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
6
|
import type { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
7
|
-
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props,
|
|
8
|
-
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape[
|
|
7
|
+
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props, "editorView" | "selectedMediaSingleNode">) => FloatingToolbarConfig;
|
|
8
|
+
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape["formatMessage"], selectedNodeType?: NodeType) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
@@ -25,4 +25,4 @@ export declare const getSelectedLayoutIcon: (layoutIcons: LayoutIcon[], selected
|
|
|
25
25
|
*/
|
|
26
26
|
export declare const canShowSwitchButtons: (mediaSingleNode?: ProseMirrorNode) => boolean | null;
|
|
27
27
|
export declare const updateToFullHeightSeparator: (items: FloatingToolbarItem<Command>[]) => void;
|
|
28
|
-
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType:
|
|
28
|
+
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType: "inline" | "block", intl: IntlShape, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, hasCaption?: boolean) => FloatingToolbarDropdown<Command>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.7",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/button": "^23.3.0",
|
|
40
40
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
42
|
-
"@atlaskit/editor-plugin-annotation": "^3.
|
|
42
|
+
"@atlaskit/editor-plugin-annotation": "^3.2.0",
|
|
43
43
|
"@atlaskit/editor-plugin-connectivity": "^3.1.0",
|
|
44
44
|
"@atlaskit/editor-plugin-decorations": "^3.0.0",
|
|
45
45
|
"@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"@atlaskit/editor-plugin-selection": "^3.0.0",
|
|
53
53
|
"@atlaskit/editor-plugin-width": "^4.0.0",
|
|
54
54
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
55
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
55
|
+
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
56
56
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
57
57
|
"@atlaskit/form": "^12.0.0",
|
|
58
|
-
"@atlaskit/icon": "^27.
|
|
59
|
-
"@atlaskit/icon-lab": "^5.
|
|
60
|
-
"@atlaskit/media-card": "^79.
|
|
61
|
-
"@atlaskit/media-client": "^35.
|
|
58
|
+
"@atlaskit/icon": "^27.11.0",
|
|
59
|
+
"@atlaskit/icon-lab": "^5.4.0",
|
|
60
|
+
"@atlaskit/media-card": "^79.5.0",
|
|
61
|
+
"@atlaskit/media-client": "^35.3.0",
|
|
62
62
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
63
63
|
"@atlaskit/media-common": "^12.3.0",
|
|
64
64
|
"@atlaskit/media-filmstrip": "^51.0.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": "^9.
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^9.27.0",
|
|
73
73
|
"@atlaskit/tokens": "^6.0.0",
|
|
74
74
|
"@atlaskit/tooltip": "^20.4.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
@@ -80,11 +80,8 @@
|
|
|
80
80
|
"memoize-one": "^6.0.0",
|
|
81
81
|
"uuid": "^3.1.0"
|
|
82
82
|
},
|
|
83
|
-
"devDependencies": {
|
|
84
|
-
"typescript": "~5.4.2"
|
|
85
|
-
},
|
|
86
83
|
"peerDependencies": {
|
|
87
|
-
"@atlaskit/editor-common": "^107.
|
|
84
|
+
"@atlaskit/editor-common": "^107.20.0",
|
|
88
85
|
"@atlaskit/media-core": "^37.0.0",
|
|
89
86
|
"react": "^18.2.0",
|
|
90
87
|
"react-dom": "^18.2.0",
|
|
@@ -139,9 +136,6 @@
|
|
|
139
136
|
"platform-visual-refresh-icons": {
|
|
140
137
|
"type": "boolean"
|
|
141
138
|
},
|
|
142
|
-
"platform_editor_inline_resize_media_to_edge": {
|
|
143
|
-
"type": "boolean"
|
|
144
|
-
},
|
|
145
139
|
"confluence_frontend_media_scroll_fix": {
|
|
146
140
|
"type": "boolean"
|
|
147
141
|
},
|