@atlaskit/editor-plugin-paste-options-toolbar 9.0.7 → 9.1.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 +14 -0
- package/dist/cjs/pasteOptionsToolbarPlugin.js +7 -7
- package/dist/es2019/pasteOptionsToolbarPlugin.js +6 -6
- package/dist/esm/pasteOptionsToolbarPlugin.js +7 -7
- package/dist/types/pasteOptionsToolbarPluginType.d.ts +3 -0
- package/dist/types-ts4.5/pasteOptionsToolbarPluginType.d.ts +3 -0
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste-options-toolbar
|
|
2
2
|
|
|
3
|
+
## 9.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`496231f48cbde`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/496231f48cbde) -
|
|
8
|
+
[ux] EDITOR-5907 Ensure experiment is only enabled for full page editor and AI actions only
|
|
9
|
+
visible if Editor AI streaming enabled
|
|
10
|
+
|
|
11
|
+
## 9.0.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 9.0.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.pasteOptionsToolbarPlugin = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
10
|
var _commands = require("./editor-commands/commands");
|
|
12
11
|
var _main = require("./pm-plugins/main");
|
|
13
12
|
var _types = require("./types/types");
|
|
@@ -17,9 +16,10 @@ var _toolbar = require("./ui/toolbar");
|
|
|
17
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
17
|
var pasteOptionsToolbarPlugin = exports.pasteOptionsToolbarPlugin = function pasteOptionsToolbarPlugin(_ref) {
|
|
19
18
|
var _api$analytics;
|
|
20
|
-
var
|
|
19
|
+
var config = _ref.config,
|
|
20
|
+
api = _ref.api;
|
|
21
21
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
22
|
-
if (
|
|
22
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
23
23
|
var _api$uiControlRegistr;
|
|
24
24
|
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register((0, _PasteMenuComponents.getPasteMenuComponents)({
|
|
25
25
|
api: api
|
|
@@ -33,7 +33,7 @@ var pasteOptionsToolbarPlugin = exports.pasteOptionsToolbarPlugin = function pas
|
|
|
33
33
|
plugin: function plugin(_ref2) {
|
|
34
34
|
var dispatch = _ref2.dispatch;
|
|
35
35
|
return (0, _main.createPlugin)(dispatch, {
|
|
36
|
-
useNewPasteMenu:
|
|
36
|
+
useNewPasteMenu: config === null || config === void 0 ? void 0 : config.usePopupBasedPasteActionsMenu
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
}];
|
|
@@ -66,7 +66,7 @@ var pasteOptionsToolbarPlugin = exports.pasteOptionsToolbarPlugin = function pas
|
|
|
66
66
|
},
|
|
67
67
|
pluginsOptions: {
|
|
68
68
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
69
|
-
if (
|
|
69
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
var pastePluginState = _types.pasteOptionsPluginKey.getState(state);
|
|
@@ -81,7 +81,7 @@ var pasteOptionsToolbarPlugin = exports.pasteOptionsToolbarPlugin = function pas
|
|
|
81
81
|
popupsMountPoint = _ref3.popupsMountPoint,
|
|
82
82
|
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
83
83
|
popupsScrollableElement = _ref3.popupsScrollableElement;
|
|
84
|
-
if (!(0
|
|
84
|
+
if (!(config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) || !editorView) {
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
return /*#__PURE__*/_react.default.createElement(_PasteActionsMenu.PasteActionsMenu, {
|
|
@@ -102,7 +102,7 @@ var pasteOptionsToolbarPlugin = exports.pasteOptionsToolbarPlugin = function pas
|
|
|
102
102
|
}),
|
|
103
103
|
lastContentPasted = _useSharedPluginState.lastContentPasted;
|
|
104
104
|
(0, _react.useEffect)(function () {
|
|
105
|
-
if (
|
|
105
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
if (!lastContentPasted) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
3
|
import { hideToolbar, showToolbar } from './editor-commands/commands';
|
|
5
4
|
import { createPlugin } from './pm-plugins/main';
|
|
6
5
|
import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types/types';
|
|
@@ -8,11 +7,12 @@ import { PasteActionsMenu } from './ui/on-paste-actions-menu/PasteActionsMenu';
|
|
|
8
7
|
import { getPasteMenuComponents } from './ui/on-paste-actions-menu/PasteMenuComponents';
|
|
9
8
|
import { buildToolbar, isToolbarVisible } from './ui/toolbar';
|
|
10
9
|
export const pasteOptionsToolbarPlugin = ({
|
|
10
|
+
config,
|
|
11
11
|
api
|
|
12
12
|
}) => {
|
|
13
13
|
var _api$analytics;
|
|
14
14
|
const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
15
|
-
if (
|
|
15
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
16
16
|
var _api$uiControlRegistr;
|
|
17
17
|
api === null || api === void 0 ? void 0 : (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 ? void 0 : _api$uiControlRegistr.actions.register(getPasteMenuComponents({
|
|
18
18
|
api
|
|
@@ -26,7 +26,7 @@ export const pasteOptionsToolbarPlugin = ({
|
|
|
26
26
|
plugin: ({
|
|
27
27
|
dispatch
|
|
28
28
|
}) => createPlugin(dispatch, {
|
|
29
|
-
useNewPasteMenu:
|
|
29
|
+
useNewPasteMenu: config === null || config === void 0 ? void 0 : config.usePopupBasedPasteActionsMenu
|
|
30
30
|
})
|
|
31
31
|
}];
|
|
32
32
|
},
|
|
@@ -58,7 +58,7 @@ export const pasteOptionsToolbarPlugin = ({
|
|
|
58
58
|
},
|
|
59
59
|
pluginsOptions: {
|
|
60
60
|
floatingToolbar(state, intl) {
|
|
61
|
-
if (
|
|
61
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
const pastePluginState = pasteOptionsPluginKey.getState(state);
|
|
@@ -74,7 +74,7 @@ export const pasteOptionsToolbarPlugin = ({
|
|
|
74
74
|
popupsBoundariesElement,
|
|
75
75
|
popupsScrollableElement
|
|
76
76
|
}) {
|
|
77
|
-
if (!
|
|
77
|
+
if (!(config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) || !editorView) {
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
80
|
return /*#__PURE__*/React.createElement(PasteActionsMenu, {
|
|
@@ -97,7 +97,7 @@ export const pasteOptionsToolbarPlugin = ({
|
|
|
97
97
|
};
|
|
98
98
|
});
|
|
99
99
|
useEffect(() => {
|
|
100
|
-
if (
|
|
100
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
if (!lastContentPasted) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
3
|
import { hideToolbar, showToolbar } from './editor-commands/commands';
|
|
5
4
|
import { createPlugin } from './pm-plugins/main';
|
|
6
5
|
import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types/types';
|
|
@@ -9,9 +8,10 @@ import { getPasteMenuComponents } from './ui/on-paste-actions-menu/PasteMenuComp
|
|
|
9
8
|
import { buildToolbar, isToolbarVisible } from './ui/toolbar';
|
|
10
9
|
export var pasteOptionsToolbarPlugin = function pasteOptionsToolbarPlugin(_ref) {
|
|
11
10
|
var _api$analytics;
|
|
12
|
-
var
|
|
11
|
+
var config = _ref.config,
|
|
12
|
+
api = _ref.api;
|
|
13
13
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
14
|
-
if (
|
|
14
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
15
15
|
var _api$uiControlRegistr;
|
|
16
16
|
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getPasteMenuComponents({
|
|
17
17
|
api: api
|
|
@@ -25,7 +25,7 @@ export var pasteOptionsToolbarPlugin = function pasteOptionsToolbarPlugin(_ref)
|
|
|
25
25
|
plugin: function plugin(_ref2) {
|
|
26
26
|
var dispatch = _ref2.dispatch;
|
|
27
27
|
return createPlugin(dispatch, {
|
|
28
|
-
useNewPasteMenu:
|
|
28
|
+
useNewPasteMenu: config === null || config === void 0 ? void 0 : config.usePopupBasedPasteActionsMenu
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
}];
|
|
@@ -58,7 +58,7 @@ export var pasteOptionsToolbarPlugin = function pasteOptionsToolbarPlugin(_ref)
|
|
|
58
58
|
},
|
|
59
59
|
pluginsOptions: {
|
|
60
60
|
floatingToolbar: function floatingToolbar(state, intl) {
|
|
61
|
-
if (
|
|
61
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
var pastePluginState = pasteOptionsPluginKey.getState(state);
|
|
@@ -73,7 +73,7 @@ export var pasteOptionsToolbarPlugin = function pasteOptionsToolbarPlugin(_ref)
|
|
|
73
73
|
popupsMountPoint = _ref3.popupsMountPoint,
|
|
74
74
|
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
75
75
|
popupsScrollableElement = _ref3.popupsScrollableElement;
|
|
76
|
-
if (!
|
|
76
|
+
if (!(config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) || !editorView) {
|
|
77
77
|
return null;
|
|
78
78
|
}
|
|
79
79
|
return /*#__PURE__*/React.createElement(PasteActionsMenu, {
|
|
@@ -94,7 +94,7 @@ export var pasteOptionsToolbarPlugin = function pasteOptionsToolbarPlugin(_ref)
|
|
|
94
94
|
}),
|
|
95
95
|
lastContentPasted = _useSharedPluginState.lastContentPasted;
|
|
96
96
|
useEffect(function () {
|
|
97
|
-
if (
|
|
97
|
+
if (config !== null && config !== void 0 && config.usePopupBasedPasteActionsMenu) {
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
100
|
if (!lastContentPasted) {
|
|
@@ -20,5 +20,8 @@ export interface PasteOptionsToolbarSharedState {
|
|
|
20
20
|
}
|
|
21
21
|
export type PasteOptionsToolbarPlugin = NextEditorPlugin<'pasteOptionsToolbarPlugin', {
|
|
22
22
|
dependencies: PasteOptionsToolbarPluginDependencies;
|
|
23
|
+
pluginConfiguration?: {
|
|
24
|
+
usePopupBasedPasteActionsMenu?: boolean;
|
|
25
|
+
};
|
|
23
26
|
sharedState: PasteOptionsToolbarSharedState;
|
|
24
27
|
}>;
|
|
@@ -20,5 +20,8 @@ export interface PasteOptionsToolbarSharedState {
|
|
|
20
20
|
}
|
|
21
21
|
export type PasteOptionsToolbarPlugin = NextEditorPlugin<'pasteOptionsToolbarPlugin', {
|
|
22
22
|
dependencies: PasteOptionsToolbarPluginDependencies;
|
|
23
|
+
pluginConfiguration?: {
|
|
24
|
+
usePopupBasedPasteActionsMenu?: boolean;
|
|
25
|
+
};
|
|
23
26
|
sharedState: PasteOptionsToolbarSharedState;
|
|
24
27
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste-options-toolbar",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "Paste options toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,12 +36,11 @@
|
|
|
36
36
|
"@atlaskit/editor-plugin-ui-control-registry": "^2.0.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
39
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
39
|
+
"@atlaskit/editor-toolbar": "^0.20.0",
|
|
40
40
|
"@atlaskit/editor-ui-control-model": "^1.1.0",
|
|
41
41
|
"@atlaskit/icon": "^32.1.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
43
|
"@atlaskit/primitives": "^18.0.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^39.0.0",
|
|
45
44
|
"@atlaskit/tokens": "^11.1.0",
|
|
46
45
|
"@babel/runtime": "^7.0.0",
|
|
47
46
|
"@compiled/react": "^0.20.0",
|
|
@@ -49,7 +48,7 @@
|
|
|
49
48
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
50
49
|
},
|
|
51
50
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^112.
|
|
51
|
+
"@atlaskit/editor-common": "^112.4.0",
|
|
53
52
|
"react": "^18.2.0",
|
|
54
53
|
"react-dom": "^18.2.0"
|
|
55
54
|
},
|