@atlaskit/editor-plugin-media-insert 9.2.6 → 9.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media-insert
|
|
2
2
|
|
|
3
|
+
## 9.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8497783928a16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8497783928a16) -
|
|
8
|
+
ED-29110: clean up sharedPluginStateHookMigratorFactory in media, mentions and paste options
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 9.2.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -42,25 +42,6 @@ var CustomTabPanel = function CustomTabPanel(_ref) {
|
|
|
42
42
|
}), children)
|
|
43
43
|
);
|
|
44
44
|
};
|
|
45
|
-
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (pluginInjectionApi) {
|
|
46
|
-
return (0, _hooks.useSharedPluginStateWithSelector)(pluginInjectionApi, ['media', 'mediaInsert'], function (states) {
|
|
47
|
-
var _states$mediaState, _states$mediaInsertSt, _states$mediaInsertSt2;
|
|
48
|
-
return {
|
|
49
|
-
mediaProvider: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.mediaProvider,
|
|
50
|
-
isOpen: (_states$mediaInsertSt = states.mediaInsertState) === null || _states$mediaInsertSt === void 0 ? void 0 : _states$mediaInsertSt.isOpen,
|
|
51
|
-
mountInfo: (_states$mediaInsertSt2 = states.mediaInsertState) === null || _states$mediaInsertSt2 === void 0 ? void 0 : _states$mediaInsertSt2.mountInfo
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
}, function (pluginInjectionApi) {
|
|
55
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['media', 'mediaInsert']),
|
|
56
|
-
mediaState = _useSharedPluginState.mediaState,
|
|
57
|
-
mediaInsertState = _useSharedPluginState.mediaInsertState;
|
|
58
|
-
return {
|
|
59
|
-
mediaProvider: mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider,
|
|
60
|
-
isOpen: mediaInsertState === null || mediaInsertState === void 0 ? void 0 : mediaInsertState.isOpen,
|
|
61
|
-
mountInfo: mediaInsertState === null || mediaInsertState === void 0 ? void 0 : mediaInsertState.mountInfo
|
|
62
|
-
};
|
|
63
|
-
});
|
|
64
45
|
var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
65
46
|
var api = _ref2.api,
|
|
66
47
|
editorView = _ref2.editorView,
|
|
@@ -76,10 +57,17 @@ var MediaInsertPicker = exports.MediaInsertPicker = function MediaInsertPicker(_
|
|
|
76
57
|
isOnlyExternalLinks = _ref2$isOnlyExternalL === void 0 ? false : _ref2$isOnlyExternalL,
|
|
77
58
|
customizedUrlValidation = _ref2.customizedUrlValidation,
|
|
78
59
|
customizedHelperMessage = _ref2.customizedHelperMessage;
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
60
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['media', 'mediaInsert'], function (states) {
|
|
61
|
+
var _states$mediaState, _states$mediaInsertSt, _states$mediaInsertSt2;
|
|
62
|
+
return {
|
|
63
|
+
mediaProvider: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.mediaProvider,
|
|
64
|
+
isOpen: (_states$mediaInsertSt = states.mediaInsertState) === null || _states$mediaInsertSt === void 0 ? void 0 : _states$mediaInsertSt.isOpen,
|
|
65
|
+
mountInfo: (_states$mediaInsertSt2 = states.mediaInsertState) === null || _states$mediaInsertSt2 === void 0 ? void 0 : _states$mediaInsertSt2.mountInfo
|
|
66
|
+
};
|
|
67
|
+
}),
|
|
68
|
+
mediaProvider = _useSharedPluginState.mediaProvider,
|
|
69
|
+
isOpen = _useSharedPluginState.isOpen,
|
|
70
|
+
mountInfo = _useSharedPluginState.mountInfo;
|
|
83
71
|
var targetRef;
|
|
84
72
|
var mountPoint;
|
|
85
73
|
if (mountInfo) {
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getDomRefFromSelection } from '@atlaskit/editor-common/get-dom-ref-from-selection';
|
|
6
|
-
import {
|
|
6
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { mediaInsertMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -34,26 +34,6 @@ const CustomTabPanel = ({
|
|
|
34
34
|
}), children)
|
|
35
35
|
);
|
|
36
36
|
};
|
|
37
|
-
const useSharedState = sharedPluginStateHookMigratorFactory(pluginInjectionApi => {
|
|
38
|
-
return useSharedPluginStateWithSelector(pluginInjectionApi, ['media', 'mediaInsert'], states => {
|
|
39
|
-
var _states$mediaState, _states$mediaInsertSt, _states$mediaInsertSt2;
|
|
40
|
-
return {
|
|
41
|
-
mediaProvider: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.mediaProvider,
|
|
42
|
-
isOpen: (_states$mediaInsertSt = states.mediaInsertState) === null || _states$mediaInsertSt === void 0 ? void 0 : _states$mediaInsertSt.isOpen,
|
|
43
|
-
mountInfo: (_states$mediaInsertSt2 = states.mediaInsertState) === null || _states$mediaInsertSt2 === void 0 ? void 0 : _states$mediaInsertSt2.mountInfo
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
}, pluginInjectionApi => {
|
|
47
|
-
const {
|
|
48
|
-
mediaState,
|
|
49
|
-
mediaInsertState
|
|
50
|
-
} = useSharedPluginState(pluginInjectionApi, ['media', 'mediaInsert']);
|
|
51
|
-
return {
|
|
52
|
-
mediaProvider: mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider,
|
|
53
|
-
isOpen: mediaInsertState === null || mediaInsertState === void 0 ? void 0 : mediaInsertState.isOpen,
|
|
54
|
-
mountInfo: mediaInsertState === null || mediaInsertState === void 0 ? void 0 : mediaInsertState.mountInfo
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
37
|
export const MediaInsertPicker = ({
|
|
58
38
|
api,
|
|
59
39
|
editorView,
|
|
@@ -73,7 +53,14 @@ export const MediaInsertPicker = ({
|
|
|
73
53
|
mediaProvider,
|
|
74
54
|
isOpen,
|
|
75
55
|
mountInfo
|
|
76
|
-
} =
|
|
56
|
+
} = useSharedPluginStateWithSelector(api, ['media', 'mediaInsert'], states => {
|
|
57
|
+
var _states$mediaState, _states$mediaInsertSt, _states$mediaInsertSt2;
|
|
58
|
+
return {
|
|
59
|
+
mediaProvider: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.mediaProvider,
|
|
60
|
+
isOpen: (_states$mediaInsertSt = states.mediaInsertState) === null || _states$mediaInsertSt === void 0 ? void 0 : _states$mediaInsertSt.isOpen,
|
|
61
|
+
mountInfo: (_states$mediaInsertSt2 = states.mediaInsertState) === null || _states$mediaInsertSt2 === void 0 ? void 0 : _states$mediaInsertSt2.mountInfo
|
|
62
|
+
};
|
|
63
|
+
});
|
|
77
64
|
let targetRef;
|
|
78
65
|
let mountPoint;
|
|
79
66
|
if (mountInfo) {
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getDomRefFromSelection } from '@atlaskit/editor-common/get-dom-ref-from-selection';
|
|
6
|
-
import {
|
|
6
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { mediaInsertMessages } from '@atlaskit/editor-common/messages';
|
|
8
8
|
import { PlainOutsideClickTargetRefContext, Popup, withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -33,25 +33,6 @@ var CustomTabPanel = function CustomTabPanel(_ref) {
|
|
|
33
33
|
}), children)
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
|
-
var useSharedState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
|
|
37
|
-
return useSharedPluginStateWithSelector(pluginInjectionApi, ['media', 'mediaInsert'], function (states) {
|
|
38
|
-
var _states$mediaState, _states$mediaInsertSt, _states$mediaInsertSt2;
|
|
39
|
-
return {
|
|
40
|
-
mediaProvider: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.mediaProvider,
|
|
41
|
-
isOpen: (_states$mediaInsertSt = states.mediaInsertState) === null || _states$mediaInsertSt === void 0 ? void 0 : _states$mediaInsertSt.isOpen,
|
|
42
|
-
mountInfo: (_states$mediaInsertSt2 = states.mediaInsertState) === null || _states$mediaInsertSt2 === void 0 ? void 0 : _states$mediaInsertSt2.mountInfo
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
}, function (pluginInjectionApi) {
|
|
46
|
-
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['media', 'mediaInsert']),
|
|
47
|
-
mediaState = _useSharedPluginState.mediaState,
|
|
48
|
-
mediaInsertState = _useSharedPluginState.mediaInsertState;
|
|
49
|
-
return {
|
|
50
|
-
mediaProvider: mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider,
|
|
51
|
-
isOpen: mediaInsertState === null || mediaInsertState === void 0 ? void 0 : mediaInsertState.isOpen,
|
|
52
|
-
mountInfo: mediaInsertState === null || mediaInsertState === void 0 ? void 0 : mediaInsertState.mountInfo
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
36
|
export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
56
37
|
var api = _ref2.api,
|
|
57
38
|
editorView = _ref2.editorView,
|
|
@@ -67,10 +48,17 @@ export var MediaInsertPicker = function MediaInsertPicker(_ref2) {
|
|
|
67
48
|
isOnlyExternalLinks = _ref2$isOnlyExternalL === void 0 ? false : _ref2$isOnlyExternalL,
|
|
68
49
|
customizedUrlValidation = _ref2.customizedUrlValidation,
|
|
69
50
|
customizedHelperMessage = _ref2.customizedHelperMessage;
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
51
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['media', 'mediaInsert'], function (states) {
|
|
52
|
+
var _states$mediaState, _states$mediaInsertSt, _states$mediaInsertSt2;
|
|
53
|
+
return {
|
|
54
|
+
mediaProvider: (_states$mediaState = states.mediaState) === null || _states$mediaState === void 0 ? void 0 : _states$mediaState.mediaProvider,
|
|
55
|
+
isOpen: (_states$mediaInsertSt = states.mediaInsertState) === null || _states$mediaInsertSt === void 0 ? void 0 : _states$mediaInsertSt.isOpen,
|
|
56
|
+
mountInfo: (_states$mediaInsertSt2 = states.mediaInsertState) === null || _states$mediaInsertSt2 === void 0 ? void 0 : _states$mediaInsertSt2.mountInfo
|
|
57
|
+
};
|
|
58
|
+
}),
|
|
59
|
+
mediaProvider = _useSharedPluginState.mediaProvider,
|
|
60
|
+
isOpen = _useSharedPluginState.isOpen,
|
|
61
|
+
mountInfo = _useSharedPluginState.mountInfo;
|
|
74
62
|
var targetRef;
|
|
75
63
|
var mountPoint;
|
|
76
64
|
if (mountInfo) {
|