@atlaskit/editor-plugin-media 1.29.4 → 1.29.6
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 +18 -0
- package/dist/cjs/nodeviews/mediaInline.js +3 -3
- package/dist/cjs/plugin.js +1 -7
- package/dist/cjs/pm-plugins/alt-text/commands.js +2 -2
- package/dist/cjs/pm-plugins/alt-text/index.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +0 -1
- package/dist/cjs/toolbar/alt-text.js +2 -2
- package/dist/cjs/toolbar/mediaInline.js +2 -2
- package/dist/cjs/toolbar/utils.js +2 -2
- package/dist/cjs/ui/MediaLinkingToolbar.js +2 -2
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +3 -3
- package/dist/cjs/utils/media-common.js +3 -3
- package/dist/cjs/utils/media-single.js +2 -12
- package/dist/es2019/nodeviews/mediaInline.js +2 -2
- package/dist/es2019/plugin.js +1 -2
- package/dist/es2019/pm-plugins/alt-text/commands.js +1 -1
- package/dist/es2019/pm-plugins/alt-text/index.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +1 -1
- package/dist/es2019/toolbar/alt-text.js +1 -1
- package/dist/es2019/toolbar/mediaInline.js +1 -1
- package/dist/es2019/toolbar/utils.js +1 -1
- package/dist/es2019/ui/MediaLinkingToolbar.js +1 -1
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +3 -3
- package/dist/es2019/utils/media-common.js +2 -2
- package/dist/es2019/utils/media-single.js +1 -11
- package/dist/esm/nodeviews/mediaInline.js +2 -2
- package/dist/esm/plugin.js +1 -2
- package/dist/esm/pm-plugins/alt-text/commands.js +1 -1
- package/dist/esm/pm-plugins/alt-text/index.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +1 -1
- package/dist/esm/toolbar/alt-text.js +1 -1
- package/dist/esm/toolbar/mediaInline.js +1 -1
- package/dist/esm/toolbar/utils.js +1 -1
- package/dist/esm/ui/MediaLinkingToolbar.js +1 -1
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +3 -3
- package/dist/esm/utils/media-common.js +2 -2
- package/dist/esm/utils/media-single.js +1 -9
- package/dist/types/nodeviews/mediaGroup.d.ts +1 -5
- package/dist/types/nodeviews/mediaInline.d.ts +2 -10
- package/dist/types/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/picker-facade.d.ts +4 -8
- package/dist/types/plugin.d.ts +0 -5
- package/dist/types/pm-plugins/alt-text/commands.d.ts +0 -2
- package/dist/types/pm-plugins/alt-text/index.d.ts +0 -2
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/linking/actions.d.ts +5 -4
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/toolbar/alt-text.d.ts +3 -3
- package/dist/types/toolbar/mediaInline.d.ts +0 -3
- package/dist/types/toolbar/utils.d.ts +0 -1
- package/dist/types/ui/Media/DropPlaceholder.d.ts +1 -1
- package/dist/types/ui/MediaLinkingToolbar.d.ts +2 -2
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +2 -1
- package/dist/types/ui/MediaViewer/MediaViewerContainer.d.ts +0 -1
- package/dist/types/ui/PixelEntry/types.d.ts +2 -1
- package/dist/types/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types/utils/media-common.d.ts +0 -2
- package/dist/types/utils/media-files.d.ts +0 -4
- package/dist/types/utils/media-inline.d.ts +2 -1
- package/dist/types/utils/media-single.d.ts +0 -10
- package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +1 -5
- package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +2 -10
- package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/picker-facade.d.ts +4 -8
- package/dist/types-ts4.5/plugin.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/alt-text/commands.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +5 -4
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/toolbar/alt-text.d.ts +3 -3
- package/dist/types-ts4.5/toolbar/mediaInline.d.ts +0 -3
- package/dist/types-ts4.5/toolbar/utils.d.ts +0 -1
- package/dist/types-ts4.5/ui/Media/DropPlaceholder.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +2 -1
- package/dist/types-ts4.5/ui/MediaViewer/MediaViewerContainer.d.ts +0 -1
- package/dist/types-ts4.5/ui/PixelEntry/types.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/media-common.d.ts +0 -2
- package/dist/types-ts4.5/utils/media-files.d.ts +0 -4
- package/dist/types-ts4.5/utils/media-inline.d.ts +2 -1
- package/dist/types-ts4.5/utils/media-single.d.ts +0 -10
- package/package.json +2 -2
- package/dist/cjs/commands/index.js +0 -24
- package/dist/es2019/commands/index.js +0 -1
- package/dist/esm/commands/index.js +0 -1
- package/dist/types/commands/index.d.ts +0 -1
- package/dist/types-ts4.5/commands/index.d.ts +0 -1
|
@@ -189,7 +189,7 @@ export var changeFromMediaInlineToMediaSingleNode = function changeFromMediaInli
|
|
|
189
189
|
}
|
|
190
190
|
return true;
|
|
191
191
|
};
|
|
192
|
-
|
|
192
|
+
var createMediaSingleNode = function createMediaSingleNode(schema, collection, maxWidth, minWidth, alignLeftOnInsert) {
|
|
193
193
|
return function (mediaState) {
|
|
194
194
|
var id = mediaState.id,
|
|
195
195
|
dimensions = mediaState.dimensions,
|
|
@@ -245,14 +245,6 @@ var replaceWithMediaSingleNode = function replaceWithMediaSingleNode(schema, max
|
|
|
245
245
|
return mediaSingle.createChecked(extendedMediaSingleAttrs, copiedMediaNode);
|
|
246
246
|
};
|
|
247
247
|
};
|
|
248
|
-
export function isCaptionNode(editorView) {
|
|
249
|
-
var $from = editorView.state.selection.$from;
|
|
250
|
-
var immediateWrapperParentNode = editorView.state.doc.nodeAt($from.before(Math.max($from.depth, 1)));
|
|
251
|
-
if (immediateWrapperParentNode && immediateWrapperParentNode.type.name === 'caption') {
|
|
252
|
-
return true;
|
|
253
|
-
}
|
|
254
|
-
return false;
|
|
255
|
-
}
|
|
256
248
|
export var isVideo = memoizeOne(function (fileType) {
|
|
257
249
|
return !!fileType && fileType.includes('video');
|
|
258
250
|
});
|
|
@@ -6,10 +6,9 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
|
6
6
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
10
9
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
11
10
|
import type { getPosHandler, MediaOptions } from '../types';
|
|
12
|
-
|
|
11
|
+
type MediaGroupProps = {
|
|
13
12
|
forwardRef?: (ref: HTMLElement) => void;
|
|
14
13
|
node: PMNode;
|
|
15
14
|
view: EditorView;
|
|
@@ -24,9 +23,6 @@ export type MediaGroupProps = {
|
|
|
24
23
|
headPos: number;
|
|
25
24
|
mediaOptions: MediaOptions;
|
|
26
25
|
} & WrappedComponentProps;
|
|
27
|
-
export interface MediaGroupState {
|
|
28
|
-
viewMediaClientConfig?: MediaClientConfig;
|
|
29
|
-
}
|
|
30
26
|
declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<MediaGroupProps>> & {
|
|
31
27
|
WrappedComponent: React.ComponentType<MediaGroupProps>;
|
|
32
28
|
};
|
|
@@ -11,7 +11,6 @@ import type { FileIdentifier } from '@atlaskit/media-client';
|
|
|
11
11
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
12
12
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
13
13
|
import type { getPosHandler, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
14
|
-
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
15
14
|
export interface MediaInlineProps {
|
|
16
15
|
mediaProvider: Promise<MediaProvider>;
|
|
17
16
|
identifier: FileIdentifier;
|
|
@@ -24,17 +23,9 @@ export interface MediaInlineProps {
|
|
|
24
23
|
mediaPluginState: MediaPluginState;
|
|
25
24
|
editorViewMode?: boolean;
|
|
26
25
|
}
|
|
27
|
-
export declare const createMediaNodeUpdater: (props: MediaInlineProps) => MediaNodeUpdater;
|
|
28
|
-
/**
|
|
29
|
-
* Handles updating the media inline node attributes
|
|
30
|
-
* but also handling copy-paste for cross-editor of the same instance
|
|
31
|
-
* using the contextid
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export declare const updateMediaNodeAttributes: (props: MediaInlineProps, mediaNodeUpdater: MediaNodeUpdater) => Promise<void>;
|
|
35
26
|
export declare const handleNewNode: (props: MediaInlineProps) => void;
|
|
36
27
|
export declare const MediaInline: (props: MediaInlineProps) => jsx.JSX.Element;
|
|
37
|
-
|
|
28
|
+
interface MediaInlineNodeViewProps {
|
|
38
29
|
providerFactory: ProviderFactory;
|
|
39
30
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
40
31
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
@@ -46,3 +37,4 @@ export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInl
|
|
|
46
37
|
render(props: MediaInlineNodeViewProps): jsx.JSX.Element;
|
|
47
38
|
}
|
|
48
39
|
export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
40
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
6
6
|
import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler, SupportedMediaAttributes } from '../types';
|
|
7
|
-
|
|
7
|
+
type RemoteDimensions = {
|
|
8
8
|
id: string;
|
|
9
9
|
height: number;
|
|
10
10
|
width: number;
|
|
@@ -43,3 +43,4 @@ export declare class MediaNodeUpdater {
|
|
|
43
43
|
copyNode: (traceContext?: MediaTraceContext) => Promise<void>;
|
|
44
44
|
private copyFile;
|
|
45
45
|
}
|
|
46
|
+
export {};
|
|
@@ -20,7 +20,7 @@ import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
|
20
20
|
import type { ForwardRef, getPosHandler, MediaOptions } from '../types';
|
|
21
21
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
22
22
|
import type { MediaSingleNodeProps, MediaSingleNodeViewProps } from './types';
|
|
23
|
-
|
|
23
|
+
interface MediaSingleNodeState {
|
|
24
24
|
width?: number;
|
|
25
25
|
height?: number;
|
|
26
26
|
viewMediaClientConfig?: MediaClientConfig;
|
|
@@ -3,21 +3,16 @@ import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags
|
|
|
3
3
|
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, MobileUploadEndEventPayload } from './types';
|
|
6
|
-
|
|
7
|
-
export type ExtendedComponentConfigs = {
|
|
8
|
-
customMediaPicker: CustomMediaPicker;
|
|
9
|
-
dropzone: null;
|
|
10
|
-
clipboard: null;
|
|
11
|
-
};
|
|
6
|
+
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
12
7
|
export type PickerFacadeConfig = {
|
|
13
8
|
mediaClientConfig: MediaClientConfig;
|
|
14
9
|
errorReporter: ErrorReportingHandler;
|
|
15
10
|
featureFlags?: MediaFeatureFlags;
|
|
16
11
|
};
|
|
17
|
-
|
|
12
|
+
type MediaStateEvent = MediaState;
|
|
18
13
|
export type MediaStateEventListener = (evt: MediaStateEvent) => void;
|
|
19
14
|
export type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
|
|
20
|
-
|
|
15
|
+
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
21
16
|
export default class PickerFacade {
|
|
22
17
|
readonly config: PickerFacadeConfig;
|
|
23
18
|
readonly pickerConfig?: CustomMediaPicker | null | undefined;
|
|
@@ -42,3 +37,4 @@ export default class PickerFacade {
|
|
|
42
37
|
handleMobileUploadEnd: (event: MobileUploadEndEventPayload) => void;
|
|
43
38
|
handleReady: (event: UploadEndEventPayload) => void;
|
|
44
39
|
}
|
|
40
|
+
export {};
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
1
|
import type { MediaNextEditorPluginType } from './next-plugin-type';
|
|
3
|
-
import type { MediaState } from './pm-plugins/main';
|
|
4
|
-
import type { CustomMediaPicker } from './types';
|
|
5
|
-
export type { MediaState, MediaProvider, CustomMediaPicker };
|
|
6
|
-
export { insertMediaSingleNode } from './utils/media-single';
|
|
7
2
|
export declare const mediaPlugin: MediaNextEditorPluginType;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
export declare const closeMediaAltTextMenuAndSave: (altText?: string) => import("@atlaskit/editor-common/types").Command;
|
|
4
3
|
export declare const closeMediaAltTextMenu: import("@atlaskit/editor-common/types").Command;
|
|
5
4
|
export declare const openMediaAltTextMenu: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
6
|
-
export declare const updateAltTextTransform: (newAltText: string) => (tr: Transaction, state: EditorState) => Transaction;
|
|
7
5
|
export declare const updateAltText: (newAltText: string) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
export declare const pluginKey: PluginKey<any>;
|
|
5
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) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
6
4
|
export declare const createPlugin: ({ dispatch, providerFactory }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
7
5
|
export { createCommand, getPluginState };
|
|
@@ -6,5 +6,5 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-plugin-selection';
|
|
|
6
6
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
7
7
|
import type { MediaOptions } from '../types';
|
|
8
8
|
type WidthPlugin = ExtractInjectionAPI<MediaNextEditorPluginType>['width'];
|
|
9
|
-
|
|
9
|
+
declare function keymapPlugin(options: MediaOptions | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorSelectionAPI: EditorSelectionAPI | undefined, widthPlugin: WidthPlugin | undefined, getIntl: () => IntlShape): SafePlugin;
|
|
10
10
|
export default keymapPlugin;
|
|
@@ -4,17 +4,18 @@ export declare enum MediaLinkingActionsTypes {
|
|
|
4
4
|
setUrl = "MEDIA_SET_LINK_TO",
|
|
5
5
|
unlink = "MEDIA_LINKING_UNLINK"
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface VisibleAction {
|
|
8
8
|
type: MediaLinkingActionsTypes.showToolbar;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface HideAction {
|
|
11
11
|
type: MediaLinkingActionsTypes.hideToolbar;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface SetLinkToMedia {
|
|
14
14
|
type: MediaLinkingActionsTypes.setUrl;
|
|
15
15
|
payload: string;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
interface Unlink {
|
|
18
18
|
type: MediaLinkingActionsTypes.unlink;
|
|
19
19
|
}
|
|
20
20
|
export type MediaLinkingActions = VisibleAction | SetLinkToMedia | HideAction | Unlink;
|
|
21
|
+
export {};
|
|
@@ -12,9 +12,9 @@ import type { MediaPluginOptions } from '../media-plugin-options';
|
|
|
12
12
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
13
13
|
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
14
14
|
import PickerFacade from '../picker-facade';
|
|
15
|
-
import type { MediaOptions, MediaState,
|
|
15
|
+
import type { MediaOptions, MediaState, getPosHandlerNode as ProsemirrorGetPosHandler } from '../types';
|
|
16
16
|
import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
17
|
-
export type { MediaState
|
|
17
|
+
export type { MediaState };
|
|
18
18
|
export { stateKey } from './plugin-key';
|
|
19
19
|
export declare const MEDIA_CONTENT_WRAP_CLASS_NAME = "media-content-wrap";
|
|
20
20
|
export declare const MEDIA_PLUGIN_IS_RESIZING_KEY = "mediaSinglePlugin.isResizing";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { Command, FloatingToolbarButton, FloatingToolbarConfig
|
|
3
|
+
import type { Command, FloatingToolbarButton, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
5
5
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import type { MediaToolbarBaseConfig } from '../types';
|
|
7
7
|
export declare const altTextButton: (intl: IntlShape, state: EditorState, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => FloatingToolbarButton<Command>;
|
|
8
|
-
|
|
9
|
-
export interface AltTextToolbarOptions {
|
|
8
|
+
interface AltTextToolbarOptions {
|
|
10
9
|
altTextValidator?: (value: string) => string[];
|
|
11
10
|
forceFocusSelector?: ForceFocusSelector;
|
|
12
11
|
}
|
|
13
12
|
export declare const getAltTextToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, options?: AltTextToolbarOptions) => FloatingToolbarConfig;
|
|
13
|
+
export {};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
2
|
import type { Command, ExtractInjectionAPI, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
4
3
|
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
5
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
5
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
7
|
-
import type { MediaLinkingState } from '../pm-plugins/linking';
|
|
8
6
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
9
7
|
import type { MediaFloatingToolbarOptions } from '../types';
|
|
10
8
|
export declare const generateMediaInlineFloatingToolbar: (state: EditorState, intl: IntlShape, mediaPluginState: MediaPluginState, hoverDecoration: HoverDecorationHandler | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, options?: MediaFloatingToolbarOptions) => FloatingToolbarItem<Command>[];
|
|
11
|
-
export declare const getMediaInlineImageToolbar: (state: EditorState, intl: IntlShape, mediaPluginState: MediaPluginState, hoverDecoration: HoverDecorationHandler | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, mediaLinkingState: MediaLinkingState, options?: MediaFloatingToolbarOptions) => FloatingToolbarItem<Command>[];
|
|
@@ -5,7 +5,6 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
8
|
-
export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
9
8
|
export declare const getSelectedNearestMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
10
9
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState, isViewMode?: boolean) => Promise<boolean>;
|
|
11
10
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
@@ -7,7 +7,7 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
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
11
|
intl: IntlShape;
|
|
12
12
|
providerFactory: ProviderFactory;
|
|
13
13
|
editing: boolean;
|
|
@@ -22,7 +22,7 @@ export type Props = {
|
|
|
22
22
|
}) => void;
|
|
23
23
|
displayUrl?: string;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
declare class LinkAddToolbar extends React.PureComponent<Props & WrappedComponentProps> {
|
|
26
26
|
state: {
|
|
27
27
|
validationErrors: never[];
|
|
28
28
|
};
|
|
@@ -3,7 +3,7 @@ import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
|
3
3
|
import type { BrowserConfig, ClipboardConfig, DropzoneConfig } from '@atlaskit/media-picker/types';
|
|
4
4
|
import PickerFacade from '../../picker-facade';
|
|
5
5
|
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
6
|
-
|
|
6
|
+
interface ChildrenProps {
|
|
7
7
|
config: ClipboardConfig | BrowserConfig | DropzoneConfig;
|
|
8
8
|
mediaClientConfig: MediaClientConfig;
|
|
9
9
|
pickerFacadeInstance: PickerFacade;
|
|
@@ -14,3 +14,4 @@ export type Props = {
|
|
|
14
14
|
children: (props: ChildrenProps) => React.ReactElement | null;
|
|
15
15
|
};
|
|
16
16
|
export default function PickerFacadeProvider({ mediaState, analyticsName, children }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
17
|
+
export {};
|
|
@@ -14,6 +14,5 @@ type MediaViewerContainerProps = {
|
|
|
14
14
|
isInline?: boolean;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
16
|
};
|
|
17
|
-
export declare const mediaViewerContainerTestID = "media-viewer-container-test";
|
|
18
17
|
export declare const MediaViewerContainer: ({ mediaNode, mediaPluginState, isEditorViewMode, isSelected, isInline, children, }: MediaViewerContainerProps) => jsx.JSX.Element;
|
|
19
18
|
export {};
|
|
@@ -52,7 +52,8 @@ export type PixelEntryFormValues = {
|
|
|
52
52
|
inputHeight: number | '';
|
|
53
53
|
};
|
|
54
54
|
export type PixelEntryValidation = 'valid' | 'greater-than-max' | 'less-than-min';
|
|
55
|
-
|
|
55
|
+
type PixelEntryFormData = {
|
|
56
56
|
width: number;
|
|
57
57
|
validation: PixelEntryValidation;
|
|
58
58
|
};
|
|
59
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { MediaNextEditorPluginType } from '../../next-plugin-type';
|
|
5
|
-
|
|
5
|
+
interface Props {
|
|
6
6
|
isDisabled?: boolean;
|
|
7
7
|
isReducedSpacing?: boolean;
|
|
8
8
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
@@ -7,7 +7,6 @@ export declare const isMediaBlobUrlFromAttrs: (attrs: MediaADFAttrs) => boolean;
|
|
|
7
7
|
export declare const posOfMediaGroupNearby: (state: EditorState) => number | undefined;
|
|
8
8
|
export declare const isSelectionNonMediaBlockNode: (state: EditorState) => boolean;
|
|
9
9
|
export declare const isSelectionMediaSingleNode: (state: EditorState) => boolean;
|
|
10
|
-
export declare const isSelectionMediaInlineNode: (state: EditorState) => boolean;
|
|
11
10
|
export declare const posOfPrecedingMediaGroup: (state: EditorState) => number | undefined;
|
|
12
11
|
/**
|
|
13
12
|
* Determine whether the cursor is inside empty paragraph
|
|
@@ -19,6 +18,5 @@ export declare const removeMediaNode: (view: EditorView, node: PMNode, getPos: P
|
|
|
19
18
|
export declare const splitMediaGroup: (view: EditorView) => boolean;
|
|
20
19
|
export declare const copyOptionalAttrsFromMediaState: (mediaState: MediaState, node: PMNode) => void;
|
|
21
20
|
export declare const getMediaNodeFromSelection: (state: EditorState) => PMNode | null;
|
|
22
|
-
export declare const getMediaInlineNodeFromSelection: (state: EditorState) => PMNode | null;
|
|
23
21
|
export declare const isMediaSingleOrInlineNodeSelected: (state: EditorState) => boolean | undefined;
|
|
24
22
|
export declare const getMediaSingleOrInlineNodeFromSelection: (state: EditorState) => PMNode | null;
|
|
@@ -2,10 +2,6 @@ import type { EditorAnalyticsAPI, InputMethodInsertMedia } from '@atlaskit/edito
|
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { MediaState } from '../types';
|
|
5
|
-
export interface Range {
|
|
6
|
-
start: number;
|
|
7
|
-
end: number;
|
|
8
|
-
}
|
|
9
5
|
export declare const canInsertMediaInline: (state: EditorState) => boolean;
|
|
10
6
|
/**
|
|
11
7
|
* Create a new media inline to insert the new media.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { MediaOptions } from '../types';
|
|
3
|
-
|
|
3
|
+
type MediaNodeType = 'inline' | 'block' | 'group';
|
|
4
4
|
export declare const isInSupportedInlineImageParent: (state: EditorState) => boolean;
|
|
5
5
|
export declare const getMediaNodeInsertionType: (state: EditorState, mediaOptions?: MediaOptions, fileMimeType?: string) => MediaNodeType;
|
|
6
|
+
export {};
|
|
@@ -3,19 +3,9 @@ import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
|
|
|
3
3
|
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { MediaState } from '../types';
|
|
6
|
-
export interface MediaSingleState extends MediaState {
|
|
7
|
-
dimensions: {
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
};
|
|
11
|
-
scaleFactor?: number;
|
|
12
|
-
contextId?: string;
|
|
13
|
-
}
|
|
14
6
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
15
7
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia) => boolean;
|
|
16
8
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => boolean;
|
|
17
9
|
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) | undefined) => boolean;
|
|
18
10
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
|
|
19
|
-
export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
|
|
20
|
-
export declare function isCaptionNode(editorView: EditorView): boolean;
|
|
21
11
|
export declare const isVideo: import("memoize-one").MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -6,10 +6,9 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
|
6
6
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
8
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
10
9
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
11
10
|
import type { getPosHandler, MediaOptions } from '../types';
|
|
12
|
-
|
|
11
|
+
type MediaGroupProps = {
|
|
13
12
|
forwardRef?: (ref: HTMLElement) => void;
|
|
14
13
|
node: PMNode;
|
|
15
14
|
view: EditorView;
|
|
@@ -24,9 +23,6 @@ export type MediaGroupProps = {
|
|
|
24
23
|
headPos: number;
|
|
25
24
|
mediaOptions: MediaOptions;
|
|
26
25
|
} & WrappedComponentProps;
|
|
27
|
-
export interface MediaGroupState {
|
|
28
|
-
viewMediaClientConfig?: MediaClientConfig;
|
|
29
|
-
}
|
|
30
26
|
declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<MediaGroupProps>> & {
|
|
31
27
|
WrappedComponent: React.ComponentType<MediaGroupProps>;
|
|
32
28
|
};
|
|
@@ -11,7 +11,6 @@ import type { FileIdentifier } from '@atlaskit/media-client';
|
|
|
11
11
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
12
12
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
13
13
|
import type { getPosHandler, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
14
|
-
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
15
14
|
export interface MediaInlineProps {
|
|
16
15
|
mediaProvider: Promise<MediaProvider>;
|
|
17
16
|
identifier: FileIdentifier;
|
|
@@ -24,17 +23,9 @@ export interface MediaInlineProps {
|
|
|
24
23
|
mediaPluginState: MediaPluginState;
|
|
25
24
|
editorViewMode?: boolean;
|
|
26
25
|
}
|
|
27
|
-
export declare const createMediaNodeUpdater: (props: MediaInlineProps) => MediaNodeUpdater;
|
|
28
|
-
/**
|
|
29
|
-
* Handles updating the media inline node attributes
|
|
30
|
-
* but also handling copy-paste for cross-editor of the same instance
|
|
31
|
-
* using the contextid
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export declare const updateMediaNodeAttributes: (props: MediaInlineProps, mediaNodeUpdater: MediaNodeUpdater) => Promise<void>;
|
|
35
26
|
export declare const handleNewNode: (props: MediaInlineProps) => void;
|
|
36
27
|
export declare const MediaInline: (props: MediaInlineProps) => jsx.JSX.Element;
|
|
37
|
-
|
|
28
|
+
interface MediaInlineNodeViewProps {
|
|
38
29
|
providerFactory: ProviderFactory;
|
|
39
30
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
40
31
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
@@ -46,3 +37,4 @@ export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInl
|
|
|
46
37
|
render(props: MediaInlineNodeViewProps): jsx.JSX.Element;
|
|
47
38
|
}
|
|
48
39
|
export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
40
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
6
6
|
import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler, SupportedMediaAttributes } from '../types';
|
|
7
|
-
|
|
7
|
+
type RemoteDimensions = {
|
|
8
8
|
id: string;
|
|
9
9
|
height: number;
|
|
10
10
|
width: number;
|
|
@@ -43,3 +43,4 @@ export declare class MediaNodeUpdater {
|
|
|
43
43
|
copyNode: (traceContext?: MediaTraceContext) => Promise<void>;
|
|
44
44
|
private copyFile;
|
|
45
45
|
}
|
|
46
|
+
export {};
|
|
@@ -20,7 +20,7 @@ import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
|
20
20
|
import type { ForwardRef, getPosHandler, MediaOptions } from '../types';
|
|
21
21
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
22
22
|
import type { MediaSingleNodeProps, MediaSingleNodeViewProps } from './types';
|
|
23
|
-
|
|
23
|
+
interface MediaSingleNodeState {
|
|
24
24
|
width?: number;
|
|
25
25
|
height?: number;
|
|
26
26
|
viewMediaClientConfig?: MediaClientConfig;
|
|
@@ -3,21 +3,16 @@ import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags
|
|
|
3
3
|
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, MobileUploadEndEventPayload } from './types';
|
|
6
|
-
|
|
7
|
-
export type ExtendedComponentConfigs = {
|
|
8
|
-
customMediaPicker: CustomMediaPicker;
|
|
9
|
-
dropzone: null;
|
|
10
|
-
clipboard: null;
|
|
11
|
-
};
|
|
6
|
+
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
12
7
|
export type PickerFacadeConfig = {
|
|
13
8
|
mediaClientConfig: MediaClientConfig;
|
|
14
9
|
errorReporter: ErrorReportingHandler;
|
|
15
10
|
featureFlags?: MediaFeatureFlags;
|
|
16
11
|
};
|
|
17
|
-
|
|
12
|
+
type MediaStateEvent = MediaState;
|
|
18
13
|
export type MediaStateEventListener = (evt: MediaStateEvent) => void;
|
|
19
14
|
export type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
|
|
20
|
-
|
|
15
|
+
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
21
16
|
export default class PickerFacade {
|
|
22
17
|
readonly config: PickerFacadeConfig;
|
|
23
18
|
readonly pickerConfig?: CustomMediaPicker | null | undefined;
|
|
@@ -42,3 +37,4 @@ export default class PickerFacade {
|
|
|
42
37
|
handleMobileUploadEnd: (event: MobileUploadEndEventPayload) => void;
|
|
43
38
|
handleReady: (event: UploadEndEventPayload) => void;
|
|
44
39
|
}
|
|
40
|
+
export {};
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
2
1
|
import type { MediaNextEditorPluginType } from './next-plugin-type';
|
|
3
|
-
import type { MediaState } from './pm-plugins/main';
|
|
4
|
-
import type { CustomMediaPicker } from './types';
|
|
5
|
-
export type { MediaState, MediaProvider, CustomMediaPicker };
|
|
6
|
-
export { insertMediaSingleNode } from './utils/media-single';
|
|
7
2
|
export declare const mediaPlugin: MediaNextEditorPluginType;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
export declare const closeMediaAltTextMenuAndSave: (altText?: string) => import("@atlaskit/editor-common/types").Command;
|
|
4
3
|
export declare const closeMediaAltTextMenu: import("@atlaskit/editor-common/types").Command;
|
|
5
4
|
export declare const openMediaAltTextMenu: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
6
|
-
export declare const updateAltTextTransform: (newAltText: string) => (tr: Transaction, state: EditorState) => Transaction;
|
|
7
5
|
export declare const updateAltText: (newAltText: string) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
export declare const pluginKey: PluginKey<any>;
|
|
5
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) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
6
4
|
export declare const createPlugin: ({ dispatch, providerFactory }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
7
5
|
export { createCommand, getPluginState };
|
|
@@ -6,5 +6,5 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-plugin-selection';
|
|
|
6
6
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
7
7
|
import type { MediaOptions } from '../types';
|
|
8
8
|
type WidthPlugin = ExtractInjectionAPI<MediaNextEditorPluginType>['width'];
|
|
9
|
-
|
|
9
|
+
declare function keymapPlugin(options: MediaOptions | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorSelectionAPI: EditorSelectionAPI | undefined, widthPlugin: WidthPlugin | undefined, getIntl: () => IntlShape): SafePlugin;
|
|
10
10
|
export default keymapPlugin;
|
|
@@ -4,17 +4,18 @@ export declare enum MediaLinkingActionsTypes {
|
|
|
4
4
|
setUrl = "MEDIA_SET_LINK_TO",
|
|
5
5
|
unlink = "MEDIA_LINKING_UNLINK"
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface VisibleAction {
|
|
8
8
|
type: MediaLinkingActionsTypes.showToolbar;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface HideAction {
|
|
11
11
|
type: MediaLinkingActionsTypes.hideToolbar;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface SetLinkToMedia {
|
|
14
14
|
type: MediaLinkingActionsTypes.setUrl;
|
|
15
15
|
payload: string;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
interface Unlink {
|
|
18
18
|
type: MediaLinkingActionsTypes.unlink;
|
|
19
19
|
}
|
|
20
20
|
export type MediaLinkingActions = VisibleAction | SetLinkToMedia | HideAction | Unlink;
|
|
21
|
+
export {};
|
|
@@ -12,9 +12,9 @@ import type { MediaPluginOptions } from '../media-plugin-options';
|
|
|
12
12
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
13
13
|
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
14
14
|
import PickerFacade from '../picker-facade';
|
|
15
|
-
import type { MediaOptions, MediaState,
|
|
15
|
+
import type { MediaOptions, MediaState, getPosHandlerNode as ProsemirrorGetPosHandler } from '../types';
|
|
16
16
|
import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
17
|
-
export type { MediaState
|
|
17
|
+
export type { MediaState };
|
|
18
18
|
export { stateKey } from './plugin-key';
|
|
19
19
|
export declare const MEDIA_CONTENT_WRAP_CLASS_NAME = "media-content-wrap";
|
|
20
20
|
export declare const MEDIA_PLUGIN_IS_RESIZING_KEY = "mediaSinglePlugin.isResizing";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { Command, FloatingToolbarButton, FloatingToolbarConfig
|
|
3
|
+
import type { Command, FloatingToolbarButton, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
5
5
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import type { MediaToolbarBaseConfig } from '../types';
|
|
7
7
|
export declare const altTextButton: (intl: IntlShape, state: EditorState, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => FloatingToolbarButton<Command>;
|
|
8
|
-
|
|
9
|
-
export interface AltTextToolbarOptions {
|
|
8
|
+
interface AltTextToolbarOptions {
|
|
10
9
|
altTextValidator?: (value: string) => string[];
|
|
11
10
|
forceFocusSelector?: ForceFocusSelector;
|
|
12
11
|
}
|
|
13
12
|
export declare const getAltTextToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, options?: AltTextToolbarOptions) => FloatingToolbarConfig;
|
|
13
|
+
export {};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
2
|
import type { Command, ExtractInjectionAPI, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
4
3
|
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
5
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
5
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
7
|
-
import type { MediaLinkingState } from '../pm-plugins/linking';
|
|
8
6
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
9
7
|
import type { MediaFloatingToolbarOptions } from '../types';
|
|
10
8
|
export declare const generateMediaInlineFloatingToolbar: (state: EditorState, intl: IntlShape, mediaPluginState: MediaPluginState, hoverDecoration: HoverDecorationHandler | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, options?: MediaFloatingToolbarOptions) => FloatingToolbarItem<Command>[];
|
|
11
|
-
export declare const getMediaInlineImageToolbar: (state: EditorState, intl: IntlShape, mediaPluginState: MediaPluginState, hoverDecoration: HoverDecorationHandler | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, mediaLinkingState: MediaLinkingState, options?: MediaFloatingToolbarOptions) => FloatingToolbarItem<Command>[];
|
|
@@ -5,7 +5,6 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
8
|
-
export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
9
8
|
export declare const getSelectedNearestMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
10
9
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState, isViewMode?: boolean) => Promise<boolean>;
|
|
11
10
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|