@atlaskit/editor-plugin-media-insert 3.1.1 → 3.1.3
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 +20 -0
- package/dist/cjs/actions.js +4 -4
- package/dist/cjs/plugin.js +6 -7
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/ui/MediaFromURL.js +93 -104
- package/dist/cjs/ui/MediaInsertPicker.js +13 -5
- package/dist/es2019/actions.js +4 -4
- package/dist/es2019/plugin.js +6 -7
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/ui/MediaFromURL.js +62 -73
- package/dist/es2019/ui/MediaInsertPicker.js +13 -5
- package/dist/esm/actions.js +4 -4
- package/dist/esm/plugin.js +6 -7
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/ui/MediaFromURL.js +90 -104
- package/dist/esm/ui/MediaInsertPicker.js +13 -5
- package/dist/types/actions.d.ts +4 -1
- package/dist/types/types.d.ts +8 -4
- package/dist/types-ts4.5/actions.d.ts +4 -1
- package/dist/types-ts4.5/types.d.ts +8 -4
- package/package.json +3 -3
|
@@ -71,10 +71,18 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
|
71
71
|
insertExternalMediaSingle = _ref2.insertExternalMediaSingle,
|
|
72
72
|
insertFile = _ref2.insertFile;
|
|
73
73
|
var _ref3 = (_useSharedPluginState = (_useSharedPluginState2 = useSharedPluginState(api, ['mediaInsert'])) === null || _useSharedPluginState2 === void 0 ? void 0 : _useSharedPluginState2.mediaInsertState) !== null && _useSharedPluginState !== void 0 ? _useSharedPluginState : {},
|
|
74
|
-
isOpen = _ref3.isOpen
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var
|
|
74
|
+
isOpen = _ref3.isOpen,
|
|
75
|
+
mountInfo = _ref3.mountInfo;
|
|
76
|
+
var targetRef;
|
|
77
|
+
var mountPoint;
|
|
78
|
+
if (mountInfo) {
|
|
79
|
+
targetRef = mountInfo.ref;
|
|
80
|
+
mountPoint = mountInfo.mountPoint;
|
|
81
|
+
} else {
|
|
82
|
+
// If targetRef is undefined, target the selection in the editor
|
|
83
|
+
targetRef = getDomRefFromSelection(editorView, dispatchAnalyticsEvent);
|
|
84
|
+
mountPoint = popupsMountPoint;
|
|
85
|
+
}
|
|
78
86
|
var mediaProvider = (_useSharedPluginState3 = useSharedPluginState(api, ['media'])) === null || _useSharedPluginState3 === void 0 || (_useSharedPluginState3 = _useSharedPluginState3.mediaState) === null || _useSharedPluginState3 === void 0 ? void 0 : _useSharedPluginState3.mediaProvider;
|
|
79
87
|
var intl = useIntl();
|
|
80
88
|
var focusEditor = useFocusEditor({
|
|
@@ -112,7 +120,7 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
|
112
120
|
zIndex: akEditorFloatingDialogZIndex,
|
|
113
121
|
fitHeight: 390,
|
|
114
122
|
fitWidth: 340,
|
|
115
|
-
mountTo:
|
|
123
|
+
mountTo: mountPoint,
|
|
116
124
|
boundariesElement: popupsBoundariesElement,
|
|
117
125
|
handleClickOutside: handleClose(INPUT_METHOD.MOUSE),
|
|
118
126
|
handleEscapeKeydown: handleClose(INPUT_METHOD.KEYBOARD),
|
package/dist/types/actions.d.ts
CHANGED
|
@@ -2,5 +2,8 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
export type MediaInsertPluginAction = typeof ACTION_OPEN_POPUP | typeof ACTION_CLOSE_POPUP;
|
|
3
3
|
export declare const ACTION_OPEN_POPUP = "OPEN_POPUP";
|
|
4
4
|
export declare const ACTION_CLOSE_POPUP = "CLOSE_POPUP";
|
|
5
|
-
export declare const showMediaInsertPopup: (tr: Transaction,
|
|
5
|
+
export declare const showMediaInsertPopup: (tr: Transaction, mountInfo?: {
|
|
6
|
+
ref: HTMLElement;
|
|
7
|
+
mountPoint: HTMLElement;
|
|
8
|
+
}) => Transaction;
|
|
6
9
|
export declare const closeMediaInsertPicker: (tr: Transaction) => Transaction;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { type InsertMediaVia } from '@atlaskit/editor-common/analytics';
|
|
3
2
|
import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
4
3
|
import type { EditorCommand, NextEditorPlugin, OptionalPlugin, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
|
|
5
4
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
@@ -9,12 +8,14 @@ import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
|
9
8
|
import { type MediaState, type MediaStateEventSubscriber } from '@atlaskit/editor-plugin-media/types';
|
|
10
9
|
export type MediaInsertPluginState = {
|
|
11
10
|
isOpen?: boolean;
|
|
12
|
-
|
|
11
|
+
mountInfo?: {
|
|
12
|
+
ref: HTMLElement;
|
|
13
|
+
mountPoint: HTMLElement;
|
|
14
|
+
};
|
|
13
15
|
};
|
|
14
16
|
export type InsertMediaSingle = (props: {
|
|
15
17
|
mediaState: MediaState;
|
|
16
18
|
inputMethod: InputMethodInsertMedia;
|
|
17
|
-
insertMediaVia: InsertMediaVia;
|
|
18
19
|
}) => boolean;
|
|
19
20
|
export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
20
21
|
dependencies: [
|
|
@@ -24,7 +25,10 @@ export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
|
24
25
|
];
|
|
25
26
|
sharedState: MediaInsertPluginState;
|
|
26
27
|
commands: {
|
|
27
|
-
showMediaInsertPopup: (
|
|
28
|
+
showMediaInsertPopup: (mountInfo?: {
|
|
29
|
+
ref: HTMLElement;
|
|
30
|
+
mountPoint: HTMLElement;
|
|
31
|
+
}) => EditorCommand;
|
|
28
32
|
};
|
|
29
33
|
}>;
|
|
30
34
|
export type InsertExternalMediaSingle = (props: {
|
|
@@ -2,5 +2,8 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
export type MediaInsertPluginAction = typeof ACTION_OPEN_POPUP | typeof ACTION_CLOSE_POPUP;
|
|
3
3
|
export declare const ACTION_OPEN_POPUP = "OPEN_POPUP";
|
|
4
4
|
export declare const ACTION_CLOSE_POPUP = "CLOSE_POPUP";
|
|
5
|
-
export declare const showMediaInsertPopup: (tr: Transaction,
|
|
5
|
+
export declare const showMediaInsertPopup: (tr: Transaction, mountInfo?: {
|
|
6
|
+
ref: HTMLElement;
|
|
7
|
+
mountPoint: HTMLElement;
|
|
8
|
+
}) => Transaction;
|
|
6
9
|
export declare const closeMediaInsertPicker: (tr: Transaction) => Transaction;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { type InsertMediaVia } from '@atlaskit/editor-common/analytics';
|
|
3
2
|
import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
4
3
|
import type { EditorCommand, NextEditorPlugin, OptionalPlugin, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
|
|
5
4
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
@@ -9,12 +8,14 @@ import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
|
9
8
|
import { type MediaState, type MediaStateEventSubscriber } from '@atlaskit/editor-plugin-media/types';
|
|
10
9
|
export type MediaInsertPluginState = {
|
|
11
10
|
isOpen?: boolean;
|
|
12
|
-
|
|
11
|
+
mountInfo?: {
|
|
12
|
+
ref: HTMLElement;
|
|
13
|
+
mountPoint: HTMLElement;
|
|
14
|
+
};
|
|
13
15
|
};
|
|
14
16
|
export type InsertMediaSingle = (props: {
|
|
15
17
|
mediaState: MediaState;
|
|
16
18
|
inputMethod: InputMethodInsertMedia;
|
|
17
|
-
insertMediaVia: InsertMediaVia;
|
|
18
19
|
}) => boolean;
|
|
19
20
|
export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
20
21
|
dependencies: [
|
|
@@ -24,7 +25,10 @@ export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
|
24
25
|
];
|
|
25
26
|
sharedState: MediaInsertPluginState;
|
|
26
27
|
commands: {
|
|
27
|
-
showMediaInsertPopup: (
|
|
28
|
+
showMediaInsertPopup: (mountInfo?: {
|
|
29
|
+
ref: HTMLElement;
|
|
30
|
+
mountPoint: HTMLElement;
|
|
31
|
+
}) => EditorCommand;
|
|
28
32
|
};
|
|
29
33
|
}>;
|
|
30
34
|
export type InsertExternalMediaSingle = (props: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media-insert",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "Media Insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
27
27
|
"@atlaskit/button": "^20.2.0",
|
|
28
|
-
"@atlaskit/editor-common": "^92.
|
|
28
|
+
"@atlaskit/editor-common": "^92.1.0",
|
|
29
29
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
30
30
|
"@atlaskit/editor-plugin-media": "^1.34.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
32
32
|
"@atlaskit/editor-shared-styles": "^3.0.0",
|
|
33
33
|
"@atlaskit/form": "^10.5.3",
|
|
34
|
-
"@atlaskit/icon": "^22.
|
|
34
|
+
"@atlaskit/icon": "^22.20.0",
|
|
35
35
|
"@atlaskit/media-card": "^78.5.0",
|
|
36
36
|
"@atlaskit/media-client": "^28.0.0",
|
|
37
37
|
"@atlaskit/media-client-react": "^2.2.0",
|