@atlaskit/editor-plugin-media 2.4.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/cjs/mediaPlugin.js +8 -8
- package/dist/cjs/nodeviews/lazy-media-single.js +2 -1
- package/dist/cjs/nodeviews/lazy-media.js +2 -1
- package/dist/cjs/nodeviews/mediaNodeView/media.js +7 -1
- package/dist/cjs/nodeviews/mediaSingle.js +16 -16
- package/dist/cjs/nodeviews/mediaSingleNext.js +2 -2
- package/dist/cjs/nodeviews/toDOM-fixes/mediaSingle.js +53 -51
- package/dist/cjs/pm-plugins/keymap.js +1 -2
- package/dist/cjs/pm-plugins/main.js +30 -19
- package/dist/cjs/pm-plugins/utils/media-inline.js +3 -1
- package/dist/cjs/pm-plugins/utils/media-single.js +10 -11
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
- package/dist/cjs/ui/toolbar/commands.js +2 -2
- package/dist/cjs/ui/toolbar/index.js +9 -7
- package/dist/cjs/ui/toolbar/mediaInline.js +1 -1
- package/dist/cjs/ui/toolbar/pixel-resizing.js +3 -3
- package/dist/es2019/mediaPlugin.js +7 -8
- package/dist/es2019/nodeviews/lazy-media-single.js +2 -1
- package/dist/es2019/nodeviews/lazy-media.js +2 -1
- package/dist/es2019/nodeviews/mediaNodeView/media.js +7 -1
- package/dist/es2019/nodeviews/mediaSingle.js +8 -8
- package/dist/es2019/nodeviews/mediaSingleNext.js +2 -2
- package/dist/es2019/nodeviews/toDOM-fixes/mediaSingle.js +5 -5
- package/dist/es2019/pm-plugins/keymap.js +1 -2
- package/dist/es2019/pm-plugins/main.js +9 -3
- package/dist/es2019/pm-plugins/utils/media-inline.js +3 -1
- package/dist/es2019/pm-plugins/utils/media-single.js +10 -11
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
- package/dist/es2019/ui/toolbar/commands.js +2 -2
- package/dist/es2019/ui/toolbar/index.js +9 -7
- package/dist/es2019/ui/toolbar/mediaInline.js +1 -1
- package/dist/es2019/ui/toolbar/pixel-resizing.js +3 -3
- package/dist/esm/mediaPlugin.js +8 -8
- package/dist/esm/nodeviews/lazy-media-single.js +2 -1
- package/dist/esm/nodeviews/lazy-media.js +2 -1
- package/dist/esm/nodeviews/mediaNodeView/media.js +7 -1
- package/dist/esm/nodeviews/mediaSingle.js +16 -16
- package/dist/esm/nodeviews/mediaSingleNext.js +2 -2
- package/dist/esm/nodeviews/toDOM-fixes/mediaSingle.js +52 -50
- package/dist/esm/pm-plugins/keymap.js +1 -2
- package/dist/esm/pm-plugins/main.js +30 -19
- package/dist/esm/pm-plugins/utils/media-inline.js +3 -1
- package/dist/esm/pm-plugins/utils/media-single.js +10 -11
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
- package/dist/esm/ui/toolbar/commands.js +2 -2
- package/dist/esm/ui/toolbar/index.js +9 -7
- package/dist/esm/ui/toolbar/mediaInline.js +1 -1
- package/dist/esm/ui/toolbar/pixel-resizing.js +3 -3
- package/dist/types/nodeviews/toDOM-fixes/mediaSingle.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/utils/media-single.d.ts +4 -4
- package/dist/types/types/index.d.ts +4 -1
- package/dist/types/ui/toolbar/commands.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +4 -4
- package/dist/types-ts4.5/types/index.d.ts +4 -1
- package/dist/types-ts4.5/ui/toolbar/commands.d.ts +1 -1
- package/package.json +9 -9
|
@@ -231,7 +231,8 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
231
231
|
allowMediaInline = options.allowMediaInline,
|
|
232
232
|
allowMediaInlineImages = options.allowMediaInlineImages,
|
|
233
233
|
allowImagePreview = options.allowImagePreview,
|
|
234
|
-
isViewOnly = options.isViewOnly
|
|
234
|
+
isViewOnly = options.isViewOnly,
|
|
235
|
+
allowPixelResizing = options.allowPixelResizing;
|
|
235
236
|
var toolbarButtons = [];
|
|
236
237
|
var _ref2 = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
|
|
237
238
|
hoverDecoration = _ref2.hoverDecoration;
|
|
@@ -270,7 +271,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
270
271
|
var widthPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width;
|
|
271
272
|
var isChangingLayoutDisabled = false;
|
|
272
273
|
var selectedNode = getSelectedMediaSingle(state);
|
|
273
|
-
if (
|
|
274
|
+
if (allowPixelResizing) {
|
|
274
275
|
var _widthPlugin$sharedSt;
|
|
275
276
|
var contentWidth = widthPlugin === null || widthPlugin === void 0 || (_widthPlugin$sharedSt = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt === void 0 ? void 0 : _widthPlugin$sharedSt.lineLength;
|
|
276
277
|
var selectedNodeMaxWidth = pluginState.currentMaxWidth || contentWidth;
|
|
@@ -278,7 +279,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
278
279
|
isChangingLayoutDisabled = true;
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
|
-
var layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled);
|
|
282
|
+
var layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
|
|
282
283
|
var addLayoutDropdownToToolbar = function addLayoutDropdownToToolbar() {
|
|
283
284
|
var selectedLayoutIcon = getSelectedLayoutIcon([].concat(_toConsumableArray(alignmentIcons), _toConsumableArray(wrappingIcons)),
|
|
284
285
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -435,7 +436,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
435
436
|
// Pixel Entry Toolbar Support
|
|
436
437
|
var selection = state.selection;
|
|
437
438
|
var isWithinTable = hasParentNodeOfType([state.schema.nodes.table])(selection);
|
|
438
|
-
if (allowResizing && (!isWithinTable || allowResizingInTables === true) &&
|
|
439
|
+
if (allowResizing && (!isWithinTable || allowResizingInTables === true) && allowPixelResizing) {
|
|
439
440
|
var selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
440
441
|
var sizeInput = {
|
|
441
442
|
type: 'custom',
|
|
@@ -699,7 +700,8 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
699
700
|
allowResizing = options.allowResizing,
|
|
700
701
|
isViewOnly = options.isViewOnly,
|
|
701
702
|
allowResizingInTables = options.allowResizingInTables,
|
|
702
|
-
allowAdvancedToolBarOptions = options.allowAdvancedToolBarOptions
|
|
703
|
+
allowAdvancedToolBarOptions = options.allowAdvancedToolBarOptions,
|
|
704
|
+
allowPixelResizing = options.allowPixelResizing;
|
|
703
705
|
var allowMediaInline = options.allowMediaInline;
|
|
704
706
|
allowMediaInline = fg('platform_editor_remove_media_inline_feature_flag') ? allowMediaInlineImages : allowMediaInline;
|
|
705
707
|
var mediaPluginState = stateKey.getState(state);
|
|
@@ -738,7 +740,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
738
740
|
}
|
|
739
741
|
var selection = state.selection;
|
|
740
742
|
var isWithinTable = hasParentNodeOfType([state.schema.nodes.table])(selection);
|
|
741
|
-
if (allowAdvancedToolBarOptions && allowResizing && (!isWithinTable || allowResizingInTables === true) && editorExperiment('platform_editor_controls', 'variant1')
|
|
743
|
+
if (allowAdvancedToolBarOptions && allowResizing && (!isWithinTable || allowResizingInTables === true) && allowPixelResizing && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
742
744
|
var mediaPixelResizingPluginState = getMediaPixelResizingPluginState(state);
|
|
743
745
|
if (mediaPixelResizingPluginState !== null && mediaPixelResizingPluginState !== void 0 && mediaPixelResizingPluginState.isPixelEditorOpen) {
|
|
744
746
|
return getPixelResizingToolbar(baseToolbar, {
|
|
@@ -840,7 +842,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
840
842
|
scrollable: true,
|
|
841
843
|
mediaAssistiveMessage: assistiveMessage
|
|
842
844
|
});
|
|
843
|
-
if (allowResizing &&
|
|
845
|
+
if (allowResizing && allowPixelResizing) {
|
|
844
846
|
return _objectSpread(_objectSpread({}, toolbarConfig), {}, {
|
|
845
847
|
width: mediaPluginState.isResizing ? undefined : getMaxToolbarWidth()
|
|
846
848
|
});
|
|
@@ -262,7 +262,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
262
262
|
LEGACY_fallbackIcon: IconEmbed
|
|
263
263
|
});
|
|
264
264
|
},
|
|
265
|
-
onClick: changeMediaInlineToMediaSingle(editorAnalyticsAPI, widthPluginState)
|
|
265
|
+
onClick: changeMediaInlineToMediaSingle(editorAnalyticsAPI, widthPluginState, options === null || options === void 0 ? void 0 : options.allowPixelResizing)
|
|
266
266
|
}, {
|
|
267
267
|
type: 'separator'
|
|
268
268
|
}, {
|
|
@@ -5,7 +5,6 @@ import React from 'react';
|
|
|
5
5
|
import { pixelEntryMessages as messages } from '@atlaskit/editor-common/media';
|
|
6
6
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import GrowHorizontalIcon from '@atlaskit/icon/core/grow-horizontal';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { openPixelEditor } from '../../pm-plugins/pixel-resizing/commands';
|
|
10
9
|
import { PixelEntry } from '../../pm-plugins/pixel-resizing/ui';
|
|
11
10
|
import { PIXEL_RESIZING_TOOLBAR_WIDTH } from '../../pm-plugins/pixel-resizing/ui/constants';
|
|
@@ -49,9 +48,10 @@ export var getResizeDropdownOption = function getResizeDropdownOption(mediaOptio
|
|
|
49
48
|
}
|
|
50
49
|
var allowResizing = mediaOptions.allowResizing,
|
|
51
50
|
allowResizingInTables = mediaOptions.allowResizingInTables,
|
|
52
|
-
allowAdvancedToolBarOptions = mediaOptions.allowAdvancedToolBarOptions
|
|
51
|
+
allowAdvancedToolBarOptions = mediaOptions.allowAdvancedToolBarOptions,
|
|
52
|
+
allowPixelResizing = mediaOptions.allowPixelResizing;
|
|
53
53
|
var isWithinTable = hasParentNodeOfType(state.schema.nodes.table)(state.selection);
|
|
54
|
-
if (allowAdvancedToolBarOptions && allowResizing && (!isWithinTable || allowResizingInTables === true) &&
|
|
54
|
+
if (allowAdvancedToolBarOptions && allowResizing && (!isWithinTable || allowResizingInTables === true) && allowPixelResizing) {
|
|
55
55
|
return [{
|
|
56
56
|
title: formatMessage(messages.resizeOption),
|
|
57
57
|
onClick: openPixelEditor(),
|
|
@@ -37,7 +37,7 @@ type PrepareWrapperContentDOMProps = {
|
|
|
37
37
|
isExtendedResizeExperience: boolean;
|
|
38
38
|
};
|
|
39
39
|
export declare const prepareWrapperContentDOM: ({ layout, dataAttrs, childMediaWidth, childMediaHeight, mediaSingleDimensionWidth, isPixelWidth, isExtendedResizeExperience, }: PrepareWrapperContentDOMProps) => DOMOutputSpec;
|
|
40
|
-
export declare const
|
|
40
|
+
export declare const getToDom: (allowPixelResizing: boolean) => (node: PMNode) => DOMOutputSpec;
|
|
41
41
|
export declare const mediaSingleSpecWithFixedToDOM: (mediaSingleOption: {
|
|
42
42
|
withCaption?: boolean;
|
|
43
43
|
withExtendedWidthTypes: boolean;
|
|
@@ -68,7 +68,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
68
68
|
subscribeToUploadInProgressState(fn: (isUploading: boolean) => void): void;
|
|
69
69
|
unsubscribeFromUploadInProgressState(fn: (isUploading: boolean) => void): void;
|
|
70
70
|
private previousMediaProvider;
|
|
71
|
-
setMediaProvider(mediaProvider?: Promise<MediaProvider>): Promise<void>;
|
|
71
|
+
setMediaProvider(mediaProvider?: Promise<MediaProvider> | MediaProvider): Promise<void>;
|
|
72
72
|
getMediaOptions: () => MediaPluginOptions;
|
|
73
73
|
setIsResizing(isResizing: boolean): void;
|
|
74
74
|
setResizingWidth(width: number): void;
|
|
@@ -5,8 +5,8 @@ import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model'
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { MediaState } from '../../types';
|
|
7
7
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
8
|
-
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia) => boolean;
|
|
9
|
-
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia) => boolean;
|
|
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) | undefined, insertMediaVia?: InsertMediaVia) => boolean;
|
|
11
|
-
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
|
|
8
|
+
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
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?: ((id: string, selectionPosition: number) => void) | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
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>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MediaADFAttrs, MediaInlineAttributes } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import type { HandlePositioning } from '@atlaskit/editor-common/resizer';
|
|
4
4
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
5
5
|
import type { EditorAppearance, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -17,6 +17,7 @@ export type MediaSingleWithType = 'pixel' | 'percentage';
|
|
|
17
17
|
export type MediaCopyScope = 'editor' | 'context';
|
|
18
18
|
export interface MediaPluginOptions {
|
|
19
19
|
provider?: Providers['mediaProvider'];
|
|
20
|
+
syncProvider?: MediaProvider;
|
|
20
21
|
/**
|
|
21
22
|
* @experimental
|
|
22
23
|
* Still under development. Use with caution.
|
|
@@ -55,6 +56,7 @@ export interface MediaPluginOptions {
|
|
|
55
56
|
editorAppearance?: EditorAppearance;
|
|
56
57
|
forceHandlePositioning?: HandlePositioning;
|
|
57
58
|
mediaShallowCopyScope?: MediaCopyScope;
|
|
59
|
+
allowPixelResizing?: boolean;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* @private
|
|
@@ -125,6 +127,7 @@ export type MediaFloatingToolbarOptions = {
|
|
|
125
127
|
fullWidthEnabled?: boolean;
|
|
126
128
|
allowCommentsOnMedia?: boolean;
|
|
127
129
|
isViewOnly?: boolean;
|
|
130
|
+
allowPixelResizing?: boolean;
|
|
128
131
|
};
|
|
129
132
|
export type MediaDecorationSpec = {
|
|
130
133
|
type: 'media';
|
|
@@ -10,7 +10,7 @@ export declare const DEFAULT_BORDER_SIZE = 2;
|
|
|
10
10
|
export declare const getNodeType: (state: EditorState) => "mediaSingle" | "mediaInline";
|
|
11
11
|
export declare const changeInlineToMediaCard: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
12
12
|
export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
13
|
-
export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, widthPluginState: WidthPluginState | undefined) => Command;
|
|
13
|
+
export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, widthPluginState: WidthPluginState | undefined, allowPixelResizing?: boolean) => Command;
|
|
14
14
|
export declare const removeInlineCard: Command;
|
|
15
15
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
16
16
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
@@ -37,7 +37,7 @@ type PrepareWrapperContentDOMProps = {
|
|
|
37
37
|
isExtendedResizeExperience: boolean;
|
|
38
38
|
};
|
|
39
39
|
export declare const prepareWrapperContentDOM: ({ layout, dataAttrs, childMediaWidth, childMediaHeight, mediaSingleDimensionWidth, isPixelWidth, isExtendedResizeExperience, }: PrepareWrapperContentDOMProps) => DOMOutputSpec;
|
|
40
|
-
export declare const
|
|
40
|
+
export declare const getToDom: (allowPixelResizing: boolean) => (node: PMNode) => DOMOutputSpec;
|
|
41
41
|
export declare const mediaSingleSpecWithFixedToDOM: (mediaSingleOption: {
|
|
42
42
|
withCaption?: boolean;
|
|
43
43
|
withExtendedWidthTypes: boolean;
|
|
@@ -68,7 +68,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
68
68
|
subscribeToUploadInProgressState(fn: (isUploading: boolean) => void): void;
|
|
69
69
|
unsubscribeFromUploadInProgressState(fn: (isUploading: boolean) => void): void;
|
|
70
70
|
private previousMediaProvider;
|
|
71
|
-
setMediaProvider(mediaProvider?: Promise<MediaProvider>): Promise<void>;
|
|
71
|
+
setMediaProvider(mediaProvider?: Promise<MediaProvider> | MediaProvider): Promise<void>;
|
|
72
72
|
getMediaOptions: () => MediaPluginOptions;
|
|
73
73
|
setIsResizing(isResizing: boolean): void;
|
|
74
74
|
setResizingWidth(width: number): void;
|
|
@@ -5,8 +5,8 @@ import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model'
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { MediaState } from '../../types';
|
|
7
7
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
8
|
-
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia) => boolean;
|
|
9
|
-
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia) => boolean;
|
|
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) | undefined, insertMediaVia?: InsertMediaVia) => boolean;
|
|
11
|
-
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
|
|
8
|
+
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
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?: ((id: string, selectionPosition: number) => void) | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
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>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MediaADFAttrs, MediaInlineAttributes } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import type { HandlePositioning } from '@atlaskit/editor-common/resizer';
|
|
4
4
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
5
5
|
import type { EditorAppearance, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -17,6 +17,7 @@ export type MediaSingleWithType = 'pixel' | 'percentage';
|
|
|
17
17
|
export type MediaCopyScope = 'editor' | 'context';
|
|
18
18
|
export interface MediaPluginOptions {
|
|
19
19
|
provider?: Providers['mediaProvider'];
|
|
20
|
+
syncProvider?: MediaProvider;
|
|
20
21
|
/**
|
|
21
22
|
* @experimental
|
|
22
23
|
* Still under development. Use with caution.
|
|
@@ -55,6 +56,7 @@ export interface MediaPluginOptions {
|
|
|
55
56
|
editorAppearance?: EditorAppearance;
|
|
56
57
|
forceHandlePositioning?: HandlePositioning;
|
|
57
58
|
mediaShallowCopyScope?: MediaCopyScope;
|
|
59
|
+
allowPixelResizing?: boolean;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* @private
|
|
@@ -125,6 +127,7 @@ export type MediaFloatingToolbarOptions = {
|
|
|
125
127
|
fullWidthEnabled?: boolean;
|
|
126
128
|
allowCommentsOnMedia?: boolean;
|
|
127
129
|
isViewOnly?: boolean;
|
|
130
|
+
allowPixelResizing?: boolean;
|
|
128
131
|
};
|
|
129
132
|
export type MediaDecorationSpec = {
|
|
130
133
|
type: 'media';
|
|
@@ -10,7 +10,7 @@ export declare const DEFAULT_BORDER_SIZE = 2;
|
|
|
10
10
|
export declare const getNodeType: (state: EditorState) => "mediaSingle" | "mediaInline";
|
|
11
11
|
export declare const changeInlineToMediaCard: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
12
12
|
export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
13
|
-
export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, widthPluginState: WidthPluginState | undefined) => Command;
|
|
13
|
+
export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, widthPluginState: WidthPluginState | undefined, allowPixelResizing?: boolean) => Command;
|
|
14
14
|
export declare const removeInlineCard: Command;
|
|
15
15
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
16
16
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
39
39
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
40
40
|
"@atlaskit/button": "^23.0.0",
|
|
41
|
-
"@atlaskit/editor-common": "^103.
|
|
41
|
+
"@atlaskit/editor-common": "^103.8.0",
|
|
42
42
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
44
44
|
"@atlaskit/editor-plugin-annotation": "^2.5.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
57
57
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
58
58
|
"@atlaskit/form": "^12.0.0",
|
|
59
|
-
"@atlaskit/icon": "^25.
|
|
60
|
-
"@atlaskit/media-card": "^79.
|
|
59
|
+
"@atlaskit/icon": "^25.6.0",
|
|
60
|
+
"@atlaskit/media-card": "^79.1.0",
|
|
61
61
|
"@atlaskit/media-client": "^32.0.0",
|
|
62
62
|
"@atlaskit/media-client-react": "^4.0.0",
|
|
63
63
|
"@atlaskit/media-common": "^12.0.0",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@atlaskit/primitives": "^14.4.0",
|
|
70
70
|
"@atlaskit/textfield": "^8.0.0",
|
|
71
71
|
"@atlaskit/theme": "^18.0.0",
|
|
72
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
73
|
-
"@atlaskit/tokens": "^4.
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^4.9.0",
|
|
73
|
+
"@atlaskit/tokens": "^4.8.0",
|
|
74
74
|
"@atlaskit/tooltip": "^20.0.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
76
76
|
"@emotion/react": "^11.7.1",
|
|
@@ -135,9 +135,6 @@
|
|
|
135
135
|
"platform_media_cross_client_copy": {
|
|
136
136
|
"type": "boolean"
|
|
137
137
|
},
|
|
138
|
-
"platform_editor_media_extended_resize_experience": {
|
|
139
|
-
"type": "boolean"
|
|
140
|
-
},
|
|
141
138
|
"platform_editor_media_batch_updates": {
|
|
142
139
|
"type": "boolean"
|
|
143
140
|
},
|
|
@@ -179,6 +176,9 @@
|
|
|
179
176
|
},
|
|
180
177
|
"platform_editor_media_single_toolbar_target": {
|
|
181
178
|
"type": "boolean"
|
|
179
|
+
},
|
|
180
|
+
"platform_editor_ssr_media": {
|
|
181
|
+
"type": "boolean"
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
184
|
"stricter": {
|