@atlaskit/editor-plugin-media 9.9.1 → 10.0.1
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/mediaGroupNext.js +1 -0
- package/dist/cjs/nodeviews/mediaInline.js +1 -1
- package/dist/cjs/nodeviews/mediaNodeView/media.js +2 -1
- package/dist/cjs/nodeviews/mediaSingle.js +2 -1
- package/dist/cjs/nodeviews/mediaSingleNext.js +1 -1
- package/dist/cjs/nodeviews/styles.js +1 -1
- package/dist/cjs/pm-plugins/alt-text/index.js +15 -13
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +3 -2
- package/dist/cjs/pm-plugins/linking/index.js +2 -2
- package/dist/cjs/pm-plugins/pixel-resizing/index.js +12 -10
- package/dist/cjs/pm-plugins/pixel-resizing/ui/index.js +1 -1
- package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
- package/dist/cjs/ui/ImageBorder/index.js +1 -1
- package/dist/cjs/ui/Media/DropPlaceholder.js +1 -1
- package/dist/cjs/ui/MediaLinkingToolbar.js +1 -1
- package/dist/cjs/ui/MediaViewer/MediaViewerContainer.js +1 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +1 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
- package/dist/cjs/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/cjs/ui/ToolbarMedia/index.js +4 -1
- package/dist/cjs/ui/toolbar/layout-group.js +1 -1
- package/dist/cjs/ui/toolbar/linking-toolbar-appearance.js +1 -1
- package/dist/es2019/nodeviews/mediaGroupNext.js +1 -0
- package/dist/es2019/nodeviews/mediaInline.js +1 -1
- package/dist/es2019/nodeviews/mediaNodeView/media.js +2 -1
- package/dist/es2019/nodeviews/mediaSingle.js +2 -1
- package/dist/es2019/nodeviews/mediaSingleNext.js +1 -1
- package/dist/es2019/nodeviews/styles.js +1 -1
- package/dist/es2019/pm-plugins/alt-text/index.js +5 -5
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +3 -2
- package/dist/es2019/pm-plugins/linking/index.js +2 -4
- package/dist/es2019/pm-plugins/pixel-resizing/index.js +5 -5
- package/dist/es2019/pm-plugins/pixel-resizing/ui/index.js +1 -1
- package/dist/es2019/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
- package/dist/es2019/ui/ImageBorder/index.js +1 -1
- package/dist/es2019/ui/Media/DropPlaceholder.js +1 -1
- package/dist/es2019/ui/MediaLinkingToolbar.js +1 -1
- package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +1 -0
- package/dist/es2019/ui/MediaViewer/MediaViewerContainer.js +1 -1
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +1 -1
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
- package/dist/es2019/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/es2019/ui/ToolbarMedia/index.js +4 -1
- package/dist/es2019/ui/toolbar/layout-group.js +1 -1
- package/dist/es2019/ui/toolbar/linking-toolbar-appearance.js +1 -1
- package/dist/esm/nodeviews/mediaGroupNext.js +1 -0
- package/dist/esm/nodeviews/mediaInline.js +1 -1
- package/dist/esm/nodeviews/mediaNodeView/media.js +2 -1
- package/dist/esm/nodeviews/mediaSingle.js +2 -1
- package/dist/esm/nodeviews/mediaSingleNext.js +1 -1
- package/dist/esm/nodeviews/styles.js +1 -1
- package/dist/esm/pm-plugins/alt-text/index.js +14 -13
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +3 -2
- package/dist/esm/pm-plugins/linking/index.js +2 -3
- package/dist/esm/pm-plugins/pixel-resizing/index.js +11 -10
- package/dist/esm/pm-plugins/pixel-resizing/ui/index.js +1 -1
- package/dist/esm/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
- package/dist/esm/ui/ImageBorder/index.js +1 -1
- package/dist/esm/ui/Media/DropPlaceholder.js +1 -1
- package/dist/esm/ui/MediaLinkingToolbar.js +1 -1
- package/dist/esm/ui/MediaViewer/MediaViewerContainer.js +1 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +1 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
- package/dist/esm/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/esm/ui/ToolbarMedia/index.js +4 -1
- package/dist/esm/ui/toolbar/layout-group.js +1 -1
- package/dist/esm/ui/toolbar/linking-toolbar-appearance.js +1 -1
- package/dist/types/nodeviews/lazy-media-group.d.ts +3 -2
- package/dist/types/nodeviews/lazy-media-inline.d.ts +2 -1
- package/dist/types/nodeviews/mediaGroup.d.ts +2 -2
- package/dist/types/nodeviews/mediaGroupNext.d.ts +2 -2
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +2 -2
- package/dist/types/nodeviews/mediaNodeView/media.d.ts +2 -2
- package/dist/types/nodeviews/mediaSingle.d.ts +2 -1
- package/dist/types/nodeviews/toDOM-fixes/media.d.ts +18 -17
- package/dist/types/nodeviews/toDOM-fixes/mediaGroup.d.ts +7 -6
- package/dist/types/nodeviews/toDOM-fixes/mediaInline.d.ts +18 -17
- package/dist/types/pm-plugins/alt-text/commands.d.ts +5 -4
- package/dist/types/pm-plugins/alt-text/index.d.ts +7 -3
- package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +2 -2
- package/dist/types/pm-plugins/linking/index.d.ts +4 -1
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/picker-facade.d.ts +2 -7
- package/dist/types/pm-plugins/pixel-resizing/commands.d.ts +4 -3
- package/dist/types/pm-plugins/pixel-resizing/index.d.ts +7 -5
- package/dist/types/pm-plugins/pixel-resizing/ui/index.d.ts +1 -1
- package/dist/types/pm-plugins/utils/media-single.d.ts +2 -1
- package/dist/types/ui/ImageBorder/styles.d.ts +10 -9
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
- package/dist/types/ui/ResizableMediaSingle/index.d.ts +3 -2
- package/dist/types/ui/ResizableMediaSingle/styled.d.ts +2 -1
- package/dist/types/ui/ToolbarMedia/index.d.ts +3 -3
- package/dist/types/ui/hooks/useMediaProvider.d.ts +2 -1
- package/dist/types/ui/toolbar/commands.d.ts +2 -2
- package/dist/types/ui/toolbar/utils.d.ts +4 -3
- package/dist/types-ts4.5/nodeviews/lazy-media-group.d.ts +3 -2
- package/dist/types-ts4.5/nodeviews/lazy-media-inline.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/mediaGroupNext.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/media.d.ts +18 -17
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaGroup.d.ts +7 -6
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaInline.d.ts +18 -17
- package/dist/types-ts4.5/pm-plugins/alt-text/commands.d.ts +5 -4
- package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +7 -3
- package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/linking/index.d.ts +4 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/picker-facade.d.ts +2 -7
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/commands.d.ts +4 -3
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/index.d.ts +7 -5
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +2 -1
- package/dist/types-ts4.5/ui/ImageBorder/styles.d.ts +10 -9
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +1 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/ResizableMediaSingle/styled.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/hooks/useMediaProvider.d.ts +2 -1
- package/dist/types-ts4.5/ui/toolbar/commands.d.ts +2 -2
- package/dist/types-ts4.5/ui/toolbar/utils.d.ts +4 -3
- package/package.json +18 -18
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
declare const createCommand: <A = {
|
|
4
|
-
type:
|
|
5
|
+
type: 'openPixelEditor';
|
|
5
6
|
} | {
|
|
6
|
-
type:
|
|
7
|
-
}>(action: A | ((state: Readonly<
|
|
7
|
+
type: 'closePixelEditor';
|
|
8
|
+
}>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
9
|
+
declare const getPluginState: (state: EditorState) => {
|
|
8
10
|
isPixelEditorOpen: boolean;
|
|
9
11
|
};
|
|
10
|
-
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
12
|
+
export declare const createPlugin: ({ dispatch, }: PMPluginFactoryParams) => SafePlugin<{
|
|
11
13
|
isPixelEditorOpen: boolean;
|
|
12
14
|
}>;
|
|
13
15
|
export { createCommand, getPluginState };
|
|
@@ -17,6 +17,6 @@ export type Props = {
|
|
|
17
17
|
triggerButtonSelector?: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const PixelEntry: ({ editorView, selectedMediaSingleNode, pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Props) => jsx.JSX.Element | null;
|
|
20
|
-
export declare const FullWidthDisplay: ({ intl: { formatMessage } }: {
|
|
20
|
+
export declare const FullWidthDisplay: ({ intl: { formatMessage }, }: {
|
|
21
21
|
intl: IntlShape;
|
|
22
22
|
}) => jsx.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type MemoizedFn } from 'memoize-one';
|
|
1
2
|
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
2
3
|
import type { EditorAnalyticsAPI, InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { type InsertMediaVia } from '@atlaskit/editor-common/analytics';
|
|
@@ -11,4 +12,4 @@ export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode,
|
|
|
11
12
|
export declare const createInsertMediaAsMediaSingleCommand: (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => EditorCommand;
|
|
12
13
|
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;
|
|
13
14
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
14
|
-
export declare const isVideo:
|
|
15
|
+
export declare const isVideo: MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { type SerializedStyles } from '@emotion/react';
|
|
1
2
|
export declare const menuItemDimensions: {
|
|
2
3
|
width: number;
|
|
3
4
|
height: number;
|
|
4
5
|
};
|
|
5
6
|
export declare const itemSpacing = 4;
|
|
6
|
-
export declare const contextualMenuArrow:
|
|
7
|
-
export declare const contextualMenuColorIcon: (color?: string) =>
|
|
8
|
-
export declare const contextualSubMenu: (index: number) =>
|
|
9
|
-
export declare const buttonStyle: (selected: boolean) =>
|
|
10
|
-
export declare const buttonWrapperStyle:
|
|
11
|
-
export declare const line: (size: number, selected: boolean) =>
|
|
7
|
+
export declare const contextualMenuArrow: SerializedStyles;
|
|
8
|
+
export declare const contextualMenuColorIcon: (color?: string) => SerializedStyles;
|
|
9
|
+
export declare const contextualSubMenu: (index: number) => SerializedStyles;
|
|
10
|
+
export declare const buttonStyle: (selected: boolean) => SerializedStyles;
|
|
11
|
+
export declare const buttonWrapperStyle: SerializedStyles;
|
|
12
|
+
export declare const line: (size: number, selected: boolean) => SerializedStyles;
|
|
12
13
|
export declare const toolbarButtonWrapper: ({ enabled, isOpen, }: {
|
|
13
14
|
enabled: boolean;
|
|
14
15
|
isOpen: boolean;
|
|
15
|
-
}) =>
|
|
16
|
-
export declare const dropdownOptionButton:
|
|
17
|
-
export declare const dropdownWrapper:
|
|
16
|
+
}) => SerializedStyles;
|
|
17
|
+
export declare const dropdownOptionButton: SerializedStyles;
|
|
18
|
+
export declare const dropdownWrapper: SerializedStyles;
|
|
@@ -14,5 +14,5 @@ export type Props = {
|
|
|
14
14
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
15
15
|
children: (props: ChildrenProps) => React.ReactElement | null;
|
|
16
16
|
};
|
|
17
|
-
export default function PickerFacadeProvider({ api, analyticsName, children }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
17
|
+
export default function PickerFacadeProvider({ api, analyticsName, children, }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
18
18
|
export {};
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
8
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
8
9
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
9
10
|
import type { Props } from './types';
|
|
10
11
|
type State = {
|
|
@@ -28,11 +29,11 @@ export default class ResizableMediaSingle extends React.Component<Props, State>
|
|
|
28
29
|
*/
|
|
29
30
|
checkLayout(oldLayout: MediaSingleLayout, newLayout: MediaSingleLayout): void;
|
|
30
31
|
calcNewSize: (newWidth: number, stop: boolean) => {
|
|
31
|
-
width: number | null;
|
|
32
32
|
layout: MediaSingleLayout;
|
|
33
|
+
width: number | null;
|
|
33
34
|
};
|
|
34
35
|
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
35
|
-
get $pos():
|
|
36
|
+
get $pos(): ResolvedPos | null;
|
|
36
37
|
/**
|
|
37
38
|
* The maxmimum number of grid columns this node can resize to.
|
|
38
39
|
*/
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { type SerializedStyles } from '@emotion/react';
|
|
1
2
|
import type { MediaSingleDimensionHelperProps } from '@atlaskit/editor-common/ui';
|
|
2
|
-
export declare const wrapperStyle: (props: MediaSingleDimensionHelperProps) =>
|
|
3
|
+
export declare const wrapperStyle: (props: MediaSingleDimensionHelperProps) => SerializedStyles;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
2
|
+
import type { WithIntlProps, WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
interface Props {
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
isDisabled?: boolean;
|
|
8
8
|
isReducedSpacing?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare const
|
|
10
|
+
declare const _default_1: React.FC<WithIntlProps<Props & WrappedComponentProps>> & {
|
|
11
11
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
12
12
|
};
|
|
13
|
-
export default
|
|
13
|
+
export default _default_1;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
1
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
3
|
-
export declare const useMediaProvider: (pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) =>
|
|
4
|
+
export declare const useMediaProvider: (pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => MediaProvider | undefined;
|
|
@@ -2,7 +2,7 @@ import type { BorderMarkAttributes, RichMediaLayout } from '@atlaskit/adf-schema
|
|
|
2
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { Command, EditorContainerWidth as WidthPluginState } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { ForceFocusSelector } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
5
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import type { PixelEntryValidation } from '../../pm-plugins/pixel-resizing/ui/types';
|
|
7
7
|
import type { EventInput } from '../../pm-plugins/types';
|
|
8
8
|
export declare const DEFAULT_BORDER_COLOR = "#091e4224";
|
|
@@ -15,6 +15,6 @@ export declare const removeInlineCardWithAnalytics: (editorAnalyticsAPI: EditorA
|
|
|
15
15
|
export declare const removeInlineCard: Command;
|
|
16
16
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
17
17
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
18
|
-
export declare const updateMediaSingleWidthTr: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, state: EditorState, width: number, validation: PixelEntryValidation, inputMethod: EventInput, layout: RichMediaLayout) =>
|
|
18
|
+
export declare const updateMediaSingleWidthTr: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, state: EditorState, width: number, validation: PixelEntryValidation, inputMethod: EventInput, layout: RichMediaLayout) => Transaction | null;
|
|
19
19
|
export declare const updateMediaSingleWidth: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (width: number, validation: PixelEntryValidation, inputMethod: EventInput, layout: RichMediaLayout) => Command;
|
|
20
20
|
export declare const changeMediaSingleToMediaInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { type MemoizedFn } from 'memoize-one';
|
|
1
2
|
import type { IntlShape } from 'react-intl-next';
|
|
2
3
|
import type { ExternalMediaAttributes, MediaADFAttrs, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
3
4
|
import type { LayoutIcon } from '@atlaskit/editor-common/card';
|
|
4
5
|
import type { Command, FloatingToolbarItem, FloatingToolbarDropdown, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
6
|
import type { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
7
8
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
8
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
10
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
@@ -13,9 +14,9 @@ export declare const getSelectedNearestMediaContainerNodeAttrsFunction: (selecte
|
|
|
13
14
|
export declare const getSelectedNearestMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaADFAttrs | null;
|
|
14
15
|
export declare const getIsDownloadDisabledByDataSecurityPolicy: (mediaPluginState: MediaPluginState) => boolean;
|
|
15
16
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState, isViewMode?: boolean) => Promise<boolean>;
|
|
16
|
-
export declare const removeMediaGroupNode: (state: EditorState) =>
|
|
17
|
+
export declare const removeMediaGroupNode: (state: EditorState) => Transaction;
|
|
17
18
|
export declare const getSelectedMediaSingle: (state: EditorState) => ReturnType<ReturnType<typeof findSelectedNodeOfType>> | ReturnType<ReturnType<typeof findParentNodeOfType>>;
|
|
18
|
-
export declare const getPixelWidthOfElement:
|
|
19
|
+
export declare const getPixelWidthOfElement: MemoizedFn<(editorView: EditorView, pos: number, mediaWidth: number) => number>;
|
|
19
20
|
export declare const calcNewLayout: (width: number, layout: RichMediaLayout, contentWidth: number, fullWidthMode?: boolean, isNested?: boolean) => RichMediaLayout;
|
|
20
21
|
export declare const getMaxToolbarWidth: () => number;
|
|
21
22
|
export declare const getSelectedLayoutIcon: (layoutIcons: LayoutIcon[], selectedNode: ProseMirrorNode) => LayoutIcon | undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
3
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
4
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
6
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
6
|
-
import type {
|
|
7
|
-
export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options:
|
|
7
|
+
import type { MediaPluginOptions } from '../types';
|
|
8
|
+
export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaPluginOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
+
import { type NodeViewConstructor } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
4
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
4
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
6
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
7
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
7
|
-
export declare const lazyMediaInlineView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) =>
|
|
8
|
+
export declare const lazyMediaInlineView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => 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,
|
|
9
|
-
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
8
|
+
import type { getPosHandler, MediaPluginOptions } from '../types';
|
|
9
|
+
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
2
|
+
import type { WithIntlProps, WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
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
|
-
export declare const MediaGroupNext: React.FC<
|
|
7
|
+
export declare const MediaGroupNext: React.FC<WithIntlProps<{
|
|
8
8
|
allowLazyLoading?: boolean;
|
|
9
9
|
anchorPos: number;
|
|
10
10
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
@@ -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, getPosHandlerNode, MediaOptions } from '../../types';
|
|
12
|
+
import type { getPosHandler, getPosHandlerNode, MediaOptions, MediaPluginOptions } from '../../types';
|
|
13
13
|
import type { MediaNodeViewProps } from '../types';
|
|
14
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
15
15
|
interactionState?: SharedInteractionState['interactionState'];
|
|
@@ -41,5 +41,5 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
41
41
|
render(): React.JSX.Element;
|
|
42
42
|
destroy(): void;
|
|
43
43
|
}
|
|
44
|
-
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
44
|
+
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaPluginOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
|
|
45
45
|
export {};
|
|
@@ -59,5 +59,5 @@ export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState>
|
|
|
59
59
|
private onFullscreenChange;
|
|
60
60
|
private handleNewNode;
|
|
61
61
|
}
|
|
62
|
-
declare const
|
|
63
|
-
export default
|
|
62
|
+
declare const _default_1: React.ComponentClass<MediaNodeProps & ImageLoaderProps>;
|
|
63
|
+
export default _default_1;
|
|
@@ -5,6 +5,7 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
6
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
7
7
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { SelectedState } from '@atlaskit/editor-common/utils';
|
|
8
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
9
10
|
import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
11
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
@@ -23,7 +24,7 @@ declare class MediaSingleNodeView extends ReactNodeView<MediaSingleNodeViewProps
|
|
|
23
24
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
24
25
|
subscribeToViewModeChange(domRef: HTMLElement): (() => void) | undefined;
|
|
25
26
|
updateDomRefContentEditable(domRef: HTMLElement, editorViewMode?: 'edit' | 'view'): void;
|
|
26
|
-
checkAndUpdateSelectionType: () =>
|
|
27
|
+
checkAndUpdateSelectionType: () => SelectedState | null;
|
|
27
28
|
isNodeSelected: () => boolean;
|
|
28
29
|
getNodeMediaId(node: PMNode): string | undefined;
|
|
29
30
|
stopEvent(event: Event): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
3
|
/**
|
|
3
4
|
* Duplicate consts from `media-card`.
|
|
4
5
|
* `packages/media/media-card/src/utils/cardDimensions.ts`
|
|
@@ -15,29 +16,29 @@ export declare const defaultImageCardDimensions: {
|
|
|
15
16
|
height: number;
|
|
16
17
|
};
|
|
17
18
|
export declare const mediaSpecWithFixedToDOM: () => {
|
|
18
|
-
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
19
|
-
content?: string;
|
|
20
|
-
marks?: string;
|
|
21
|
-
group?: string;
|
|
22
|
-
inline?: boolean;
|
|
23
19
|
atom?: boolean;
|
|
24
20
|
attrs?: {
|
|
25
|
-
[name: string]:
|
|
21
|
+
[name: string]: AttributeSpec;
|
|
26
22
|
};
|
|
27
|
-
selectable?: boolean;
|
|
28
|
-
draggable?: boolean;
|
|
29
23
|
code?: boolean;
|
|
30
|
-
|
|
24
|
+
content?: string;
|
|
25
|
+
defining?: boolean;
|
|
31
26
|
definingAsContext?: boolean;
|
|
32
27
|
definingForContent?: boolean;
|
|
33
|
-
|
|
28
|
+
disableDropCursor?: boolean | ((view: EditorView, pos: {
|
|
29
|
+
inside: number;
|
|
30
|
+
pos: number;
|
|
31
|
+
}, event: DragEvent) => boolean);
|
|
32
|
+
draggable?: boolean;
|
|
33
|
+
group?: string;
|
|
34
|
+
inline?: boolean;
|
|
34
35
|
isolating?: boolean;
|
|
35
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
36
|
-
toDebugString?: (node: PMNode) => string;
|
|
37
36
|
leafText?: (node: PMNode) => string;
|
|
38
37
|
linebreakReplacement?: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
marks?: string;
|
|
39
|
+
parseDOM?: readonly TagParseRule[];
|
|
40
|
+
selectable?: boolean;
|
|
41
|
+
toDebugString?: (node: PMNode) => string;
|
|
42
|
+
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
43
|
+
whitespace?: "pre" | "normal";
|
|
43
44
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DOMOutputSpec } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { AttributeSpec, DOMOutputSpec, Node, TagParseRule } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
3
|
/**
|
|
3
4
|
* Duplicate consts from `media-card`.
|
|
4
5
|
* `packages/media/media-card/src/utils/cardDimensions.ts`
|
|
@@ -42,7 +43,7 @@ export declare const mediaGroupSpecWithFixedToDOM: () => {
|
|
|
42
43
|
inline?: boolean;
|
|
43
44
|
atom?: boolean;
|
|
44
45
|
attrs?: {
|
|
45
|
-
[name: string]:
|
|
46
|
+
[name: string]: AttributeSpec;
|
|
46
47
|
};
|
|
47
48
|
selectable?: boolean;
|
|
48
49
|
draggable?: boolean;
|
|
@@ -52,11 +53,11 @@ export declare const mediaGroupSpecWithFixedToDOM: () => {
|
|
|
52
53
|
definingForContent?: boolean;
|
|
53
54
|
defining?: boolean;
|
|
54
55
|
isolating?: boolean;
|
|
55
|
-
parseDOM?: readonly
|
|
56
|
-
toDebugString?: (node:
|
|
57
|
-
leafText?: (node:
|
|
56
|
+
parseDOM?: readonly TagParseRule[];
|
|
57
|
+
toDebugString?: (node: Node) => string;
|
|
58
|
+
leafText?: (node: Node) => string;
|
|
58
59
|
linebreakReplacement?: boolean;
|
|
59
|
-
disableDropCursor?: boolean | ((view:
|
|
60
|
+
disableDropCursor?: boolean | ((view: EditorView, pos: {
|
|
60
61
|
pos: number;
|
|
61
62
|
inside: number;
|
|
62
63
|
}, event: DragEvent) => boolean);
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { AttributeSpec, DOMOutputSpec, Node as PMNode, TagParseRule } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
3
|
export declare const mediaInlineSpecWithFixedToDOM: () => {
|
|
3
|
-
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
4
|
-
content?: string;
|
|
5
|
-
marks?: string;
|
|
6
|
-
group?: string;
|
|
7
|
-
inline?: boolean;
|
|
8
4
|
atom?: boolean;
|
|
9
5
|
attrs?: {
|
|
10
|
-
[name: string]:
|
|
6
|
+
[name: string]: AttributeSpec;
|
|
11
7
|
};
|
|
12
|
-
selectable?: boolean;
|
|
13
|
-
draggable?: boolean;
|
|
14
8
|
code?: boolean;
|
|
15
|
-
|
|
9
|
+
content?: string;
|
|
10
|
+
defining?: boolean;
|
|
16
11
|
definingAsContext?: boolean;
|
|
17
12
|
definingForContent?: boolean;
|
|
18
|
-
|
|
13
|
+
disableDropCursor?: boolean | ((view: EditorView, pos: {
|
|
14
|
+
inside: number;
|
|
15
|
+
pos: number;
|
|
16
|
+
}, event: DragEvent) => boolean);
|
|
17
|
+
draggable?: boolean;
|
|
18
|
+
group?: string;
|
|
19
|
+
inline?: boolean;
|
|
19
20
|
isolating?: boolean;
|
|
20
|
-
parseDOM?: readonly import("prosemirror-model").TagParseRule[];
|
|
21
|
-
toDebugString?: (node: PMNode) => string;
|
|
22
21
|
leafText?: (node: PMNode) => string;
|
|
23
22
|
linebreakReplacement?: boolean;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
marks?: string;
|
|
24
|
+
parseDOM?: readonly TagParseRule[];
|
|
25
|
+
selectable?: boolean;
|
|
26
|
+
toDebugString?: (node: PMNode) => string;
|
|
27
|
+
toDOM: (node: PMNode) => DOMOutputSpec;
|
|
28
|
+
whitespace?: "pre" | "normal";
|
|
28
29
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
export declare const closeMediaAltTextMenuAndSave: (altText?: string) => Command;
|
|
4
|
+
export declare const closeMediaAltTextMenu: Command;
|
|
5
|
+
export declare const openMediaAltTextMenu: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
6
|
+
export declare const updateAltText: (newAltText: string) => Command;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { Command, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { MediaAltTextAction } from './actions';
|
|
5
|
+
import type { MediaAltTextState } from './types';
|
|
6
|
+
declare const createCommand: <A = MediaAltTextAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
7
|
+
declare const getPluginState: (state: EditorState) => MediaAltTextState;
|
|
8
|
+
export declare const createPlugin: ({ dispatch, providerFactory, }: PMPluginFactoryParams) => SafePlugin<MediaAltTextState>;
|
|
5
9
|
export { createCommand, getPluginState };
|
|
@@ -41,7 +41,7 @@ export declare class AltTextEditComponent extends React.Component<Props, AltText
|
|
|
41
41
|
private handleOnBlur;
|
|
42
42
|
private handleClearText;
|
|
43
43
|
}
|
|
44
|
-
declare const
|
|
44
|
+
declare const _default_1: React.ForwardRefExoticComponent<Omit<Omit<Props, 'intl'> & {
|
|
45
45
|
forwardedRef?: React.Ref<any>;
|
|
46
46
|
}, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
47
|
-
export default
|
|
47
|
+
export default _default_1;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
6
|
import type { MediaLinkingActions } from './actions';
|
|
5
7
|
import type { MediaLinkingState } from './types';
|
|
6
8
|
export declare const mediaLinkingPluginKey: PluginKey<MediaLinkingState>;
|
|
7
|
-
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<
|
|
9
|
+
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
10
|
+
export declare const getMediaLinkingState: (state: EditorState) => MediaLinkingState;
|
|
8
11
|
declare const _default: (dispatch: Dispatch) => SafePlugin<MediaLinkingState>;
|
|
9
12
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema'
|
|
|
3
3
|
import type { InsertMediaVia } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
5
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
6
|
-
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
+
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
9
|
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -75,7 +75,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
75
75
|
updateElement(): void;
|
|
76
76
|
private isMediaSchemaNode;
|
|
77
77
|
private getDomElement;
|
|
78
|
-
get contextIdentifierProvider():
|
|
78
|
+
get contextIdentifierProvider(): ContextIdentifierProvider | undefined;
|
|
79
79
|
onNodeInserted: (id: string, selectionPosition: number) => void;
|
|
80
80
|
/**
|
|
81
81
|
* we insert a new file by inserting a initial state for that file.
|
|
@@ -4,11 +4,6 @@ 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
|
-
clipboard: null;
|
|
9
|
-
customMediaPicker: CustomMediaPicker;
|
|
10
|
-
dropzone: null;
|
|
11
|
-
};
|
|
12
7
|
export type PickerFacadeConfig = {
|
|
13
8
|
errorReporter: ErrorReportingHandler;
|
|
14
9
|
featureFlags?: MediaFeatureFlags;
|
|
@@ -17,7 +12,7 @@ export type PickerFacadeConfig = {
|
|
|
17
12
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
18
13
|
export default class PickerFacade {
|
|
19
14
|
readonly config: PickerFacadeConfig;
|
|
20
|
-
readonly pickerConfig?:
|
|
15
|
+
readonly pickerConfig?: CustomMediaPicker | null | undefined;
|
|
21
16
|
private picker?;
|
|
22
17
|
private onDragListeners;
|
|
23
18
|
private pickerType;
|
|
@@ -25,7 +20,7 @@ export default class PickerFacade {
|
|
|
25
20
|
private eventListeners;
|
|
26
21
|
private analyticsName;
|
|
27
22
|
erroredFiles: Set<string>;
|
|
28
|
-
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?:
|
|
23
|
+
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?: CustomMediaPicker | null | undefined, analyticsName?: string);
|
|
29
24
|
init(): Promise<PickerFacade>;
|
|
30
25
|
get type(): PickerType;
|
|
31
26
|
get mediaPicker(): CustomMediaPicker | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
1
2
|
import { type Transaction, type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export declare const openPixelEditor: () =>
|
|
3
|
-
export declare const closePixelEditor: () =>
|
|
4
|
-
export declare const closePixelEditorAndSave: (saveTransform: (tr: Transaction, state: EditorState) => Transaction) =>
|
|
3
|
+
export declare const openPixelEditor: () => Command;
|
|
4
|
+
export declare const closePixelEditor: () => Command;
|
|
5
|
+
export declare const closePixelEditorAndSave: (saveTransform: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
declare const createCommand: <A = {
|
|
4
|
-
type:
|
|
5
|
+
type: 'openPixelEditor';
|
|
5
6
|
} | {
|
|
6
|
-
type:
|
|
7
|
-
}>(action: A | ((state: Readonly<
|
|
7
|
+
type: 'closePixelEditor';
|
|
8
|
+
}>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
9
|
+
declare const getPluginState: (state: EditorState) => {
|
|
8
10
|
isPixelEditorOpen: boolean;
|
|
9
11
|
};
|
|
10
|
-
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
12
|
+
export declare const createPlugin: ({ dispatch, }: PMPluginFactoryParams) => SafePlugin<{
|
|
11
13
|
isPixelEditorOpen: boolean;
|
|
12
14
|
}>;
|
|
13
15
|
export { createCommand, getPluginState };
|
|
@@ -17,6 +17,6 @@ export type Props = {
|
|
|
17
17
|
triggerButtonSelector?: string;
|
|
18
18
|
};
|
|
19
19
|
export declare const PixelEntry: ({ editorView, selectedMediaSingleNode, pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Props) => jsx.JSX.Element | null;
|
|
20
|
-
export declare const FullWidthDisplay: ({ intl: { formatMessage } }: {
|
|
20
|
+
export declare const FullWidthDisplay: ({ intl: { formatMessage }, }: {
|
|
21
21
|
intl: IntlShape;
|
|
22
22
|
}) => jsx.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type MemoizedFn } from 'memoize-one';
|
|
1
2
|
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
2
3
|
import type { EditorAnalyticsAPI, InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { type InsertMediaVia } from '@atlaskit/editor-common/analytics';
|
|
@@ -11,4 +12,4 @@ export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode,
|
|
|
11
12
|
export declare const createInsertMediaAsMediaSingleCommand: (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => EditorCommand;
|
|
12
13
|
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;
|
|
13
14
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
14
|
-
export declare const isVideo:
|
|
15
|
+
export declare const isVideo: MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { type SerializedStyles } from '@emotion/react';
|
|
1
2
|
export declare const menuItemDimensions: {
|
|
2
3
|
width: number;
|
|
3
4
|
height: number;
|
|
4
5
|
};
|
|
5
6
|
export declare const itemSpacing = 4;
|
|
6
|
-
export declare const contextualMenuArrow:
|
|
7
|
-
export declare const contextualMenuColorIcon: (color?: string) =>
|
|
8
|
-
export declare const contextualSubMenu: (index: number) =>
|
|
9
|
-
export declare const buttonStyle: (selected: boolean) =>
|
|
10
|
-
export declare const buttonWrapperStyle:
|
|
11
|
-
export declare const line: (size: number, selected: boolean) =>
|
|
7
|
+
export declare const contextualMenuArrow: SerializedStyles;
|
|
8
|
+
export declare const contextualMenuColorIcon: (color?: string) => SerializedStyles;
|
|
9
|
+
export declare const contextualSubMenu: (index: number) => SerializedStyles;
|
|
10
|
+
export declare const buttonStyle: (selected: boolean) => SerializedStyles;
|
|
11
|
+
export declare const buttonWrapperStyle: SerializedStyles;
|
|
12
|
+
export declare const line: (size: number, selected: boolean) => SerializedStyles;
|
|
12
13
|
export declare const toolbarButtonWrapper: ({ enabled, isOpen, }: {
|
|
13
14
|
enabled: boolean;
|
|
14
15
|
isOpen: boolean;
|
|
15
|
-
}) =>
|
|
16
|
-
export declare const dropdownOptionButton:
|
|
17
|
-
export declare const dropdownWrapper:
|
|
16
|
+
}) => SerializedStyles;
|
|
17
|
+
export declare const dropdownOptionButton: SerializedStyles;
|
|
18
|
+
export declare const dropdownWrapper: SerializedStyles;
|
|
@@ -14,5 +14,5 @@ export type Props = {
|
|
|
14
14
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
15
15
|
children: (props: ChildrenProps) => React.ReactElement | null;
|
|
16
16
|
};
|
|
17
|
-
export default function PickerFacadeProvider({ api, analyticsName, children }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
17
|
+
export default function PickerFacadeProvider({ api, analyticsName, children, }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
18
18
|
export {};
|