@atlaskit/editor-plugin-paste-options-toolbar 13.0.0 → 13.0.2
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/pm-plugins/main.js +1 -2
- package/dist/cjs/ui/on-paste-actions-menu/PasteActionsMenuContent.js +12 -0
- package/dist/es2019/pm-plugins/main.js +1 -2
- package/dist/es2019/ui/on-paste-actions-menu/PasteActionsMenuContent.js +12 -0
- package/dist/esm/pm-plugins/main.js +1 -2
- package/dist/esm/ui/on-paste-actions-menu/PasteActionsMenuContent.js +12 -0
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste-options-toolbar
|
|
2
2
|
|
|
3
|
+
## 13.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 13.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`defb03527fd74`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/defb03527fd74) -
|
|
14
|
+
Clean up feature gate `platform_editor_paste_actions_keypress_fix`
|
|
15
|
+
- [`12f4372b86b8d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/12f4372b86b8d) -
|
|
16
|
+
Add `platform_editor_menu_radius_update` experiment that bumps the editor menu surface border
|
|
17
|
+
radius from `radius.small` (4px) to `radius.large` (8px). The block menu and paste actions menu
|
|
18
|
+
now consume the shared `ToolbarMenuContainer` surface rather than rolling their own, so they
|
|
19
|
+
inherit the gated radius along with `ToolbarMenuContainer`'s existing consumers (table and layout
|
|
20
|
+
menus).
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 13.0.0
|
|
4
24
|
|
|
5
25
|
### Major Changes
|
|
@@ -7,7 +7,6 @@ exports.createPlugin = createPlugin;
|
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
8
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
9
|
var _view2 = require("@atlaskit/editor-prosemirror/view");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _commands = require("../editor-commands/commands");
|
|
12
11
|
var _types = require("../types/types");
|
|
13
12
|
var _constants = require("./constants");
|
|
@@ -55,7 +54,7 @@ function createPlugin(dispatch, options) {
|
|
|
55
54
|
},
|
|
56
55
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
57
56
|
// Don't hide toolbar when pressing modifier keys alone (Ctrl, Shift, Alt, Meta/Cmd)
|
|
58
|
-
if (isModifierKey(event)
|
|
57
|
+
if (isModifierKey(event)) {
|
|
59
58
|
return false;
|
|
60
59
|
}
|
|
61
60
|
(0, _commands.checkAndHideToolbar)(view);
|
|
@@ -11,8 +11,10 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
13
13
|
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
14
|
+
var _toolbarMenuContainer = require("@atlaskit/editor-toolbar/toolbar-menu-container");
|
|
14
15
|
var _editorUiControlModel = require("@atlaskit/editor-ui-control-model");
|
|
15
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
18
|
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); }
|
|
17
19
|
var styles = {
|
|
18
20
|
container: "_2rko12b0 _bfhk1bhr _16qs130s"
|
|
@@ -33,6 +35,16 @@ var PasteActionsMenuContent = exports.PasteActionsMenuContent = function PasteAc
|
|
|
33
35
|
contentRef.current = node;
|
|
34
36
|
}
|
|
35
37
|
}, [setOutsideClickTargetRef, contentRef]);
|
|
38
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_menu_radius_update', 'isEnabled', true)) {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_toolbarMenuContainer.ToolbarMenuContainer, {
|
|
40
|
+
ref: mergedRef,
|
|
41
|
+
onMouseDown: onMouseDown,
|
|
42
|
+
onMouseEnter: onMouseEnter
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement(_editorUiControlModel.SurfaceRenderer, {
|
|
44
|
+
surface: pasteMenuSurface,
|
|
45
|
+
components: components
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
36
48
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
37
49
|
ref: mergedRef,
|
|
38
50
|
xcss: styles.container,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { checkAndHideToolbar } from '../editor-commands/commands';
|
|
6
5
|
import { pasteOptionsPluginKey, ToolbarDropdownOption } from '../types/types';
|
|
7
6
|
import { PASTE_HIGHLIGHT_DECORATION_KEY, TEXT_HIGHLIGHT_CLASS } from './constants';
|
|
@@ -49,7 +48,7 @@ export function createPlugin(dispatch, options) {
|
|
|
49
48
|
},
|
|
50
49
|
handleKeyDown: (view, event) => {
|
|
51
50
|
// Don't hide toolbar when pressing modifier keys alone (Ctrl, Shift, Alt, Meta/Cmd)
|
|
52
|
-
if (isModifierKey(event)
|
|
51
|
+
if (isModifierKey(event)) {
|
|
53
52
|
return false;
|
|
54
53
|
}
|
|
55
54
|
checkAndHideToolbar(view);
|
|
@@ -4,8 +4,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useCallback, useContext } from 'react';
|
|
5
5
|
import { PASTE_MENU } from '@atlaskit/editor-common/toolbar';
|
|
6
6
|
import { OutsideClickTargetRefContext } from '@atlaskit/editor-common/ui-react';
|
|
7
|
+
import { ToolbarMenuContainer } from '@atlaskit/editor-toolbar/toolbar-menu-container';
|
|
7
8
|
import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model';
|
|
8
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
11
|
const styles = {
|
|
10
12
|
container: "_2rko12b0 _bfhk1bhr _16qs130s"
|
|
11
13
|
};
|
|
@@ -26,6 +28,16 @@ export const PasteActionsMenuContent = ({
|
|
|
26
28
|
contentRef.current = node;
|
|
27
29
|
}
|
|
28
30
|
}, [setOutsideClickTargetRef, contentRef]);
|
|
31
|
+
if (expValEquals('platform_editor_menu_radius_update', 'isEnabled', true)) {
|
|
32
|
+
return /*#__PURE__*/React.createElement(ToolbarMenuContainer, {
|
|
33
|
+
ref: mergedRef,
|
|
34
|
+
onMouseDown: onMouseDown,
|
|
35
|
+
onMouseEnter: onMouseEnter
|
|
36
|
+
}, /*#__PURE__*/React.createElement(SurfaceRenderer, {
|
|
37
|
+
surface: pasteMenuSurface,
|
|
38
|
+
components: components
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
29
41
|
return /*#__PURE__*/React.createElement(Box, {
|
|
30
42
|
ref: mergedRef,
|
|
31
43
|
xcss: styles.container,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { checkAndHideToolbar } from '../editor-commands/commands';
|
|
6
5
|
import { pasteOptionsPluginKey, ToolbarDropdownOption } from '../types/types';
|
|
7
6
|
import { PASTE_HIGHLIGHT_DECORATION_KEY, TEXT_HIGHLIGHT_CLASS } from './constants';
|
|
@@ -49,7 +48,7 @@ export function createPlugin(dispatch, options) {
|
|
|
49
48
|
},
|
|
50
49
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
51
50
|
// Don't hide toolbar when pressing modifier keys alone (Ctrl, Shift, Alt, Meta/Cmd)
|
|
52
|
-
if (isModifierKey(event)
|
|
51
|
+
if (isModifierKey(event)) {
|
|
53
52
|
return false;
|
|
54
53
|
}
|
|
55
54
|
checkAndHideToolbar(view);
|
|
@@ -4,8 +4,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useCallback, useContext } from 'react';
|
|
5
5
|
import { PASTE_MENU } from '@atlaskit/editor-common/toolbar';
|
|
6
6
|
import { OutsideClickTargetRefContext } from '@atlaskit/editor-common/ui-react';
|
|
7
|
+
import { ToolbarMenuContainer } from '@atlaskit/editor-toolbar/toolbar-menu-container';
|
|
7
8
|
import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model';
|
|
8
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
11
|
var styles = {
|
|
10
12
|
container: "_2rko12b0 _bfhk1bhr _16qs130s"
|
|
11
13
|
};
|
|
@@ -25,6 +27,16 @@ export var PasteActionsMenuContent = function PasteActionsMenuContent(_ref) {
|
|
|
25
27
|
contentRef.current = node;
|
|
26
28
|
}
|
|
27
29
|
}, [setOutsideClickTargetRef, contentRef]);
|
|
30
|
+
if (expValEquals('platform_editor_menu_radius_update', 'isEnabled', true)) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(ToolbarMenuContainer, {
|
|
32
|
+
ref: mergedRef,
|
|
33
|
+
onMouseDown: onMouseDown,
|
|
34
|
+
onMouseEnter: onMouseEnter
|
|
35
|
+
}, /*#__PURE__*/React.createElement(SurfaceRenderer, {
|
|
36
|
+
surface: pasteMenuSurface,
|
|
37
|
+
components: components
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
28
40
|
return /*#__PURE__*/React.createElement(Box, {
|
|
29
41
|
ref: mergedRef,
|
|
30
42
|
xcss: styles.container,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste-options-toolbar",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.2",
|
|
4
4
|
"description": "Paste options toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"@atlaskit/icon": "^36.0.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
36
36
|
"@atlaskit/primitives": "^20.0.0",
|
|
37
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
37
|
+
"@atlaskit/tmp-editor-statsig": "^106.0.0",
|
|
38
38
|
"@atlaskit/tokens": "^14.0.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"@compiled/react": "^0.20.0",
|
|
41
41
|
"@emotion/react": "^11.7.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@atlaskit/editor-common": "^116.
|
|
44
|
+
"@atlaskit/editor-common": "^116.2.0",
|
|
45
45
|
"react": "^18.2.0",
|
|
46
46
|
"react-dom": "^18.2.0",
|
|
47
47
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -54,9 +54,6 @@
|
|
|
54
54
|
"wait-for-expect": "^1.2.0"
|
|
55
55
|
},
|
|
56
56
|
"platform-feature-flags": {
|
|
57
|
-
"platform_editor_paste_actions_keypress_fix": {
|
|
58
|
-
"type": "boolean"
|
|
59
|
-
},
|
|
60
57
|
"platform_editor_paste_actions_menu_exposure": {
|
|
61
58
|
"type": "boolean"
|
|
62
59
|
},
|