@atlaskit/editor-plugin-selection-extension 10.3.16 → 10.3.18
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 +17 -0
- package/dist/cjs/ui/menu/SelectionExtensionDropdownItem.js +8 -2
- package/dist/cjs/ui/menu/SelectionExtensionNestedDropdownMenu.js +14 -4
- package/dist/cjs/ui/toolbar-components.js +7 -0
- package/dist/es2019/ui/menu/SelectionExtensionDropdownItem.js +8 -2
- package/dist/es2019/ui/menu/SelectionExtensionNestedDropdownMenu.js +14 -4
- package/dist/es2019/ui/toolbar-components.js +7 -0
- package/dist/esm/ui/menu/SelectionExtensionDropdownItem.js +8 -2
- package/dist/esm/ui/menu/SelectionExtensionNestedDropdownMenu.js +14 -4
- package/dist/esm/ui/toolbar-components.js +7 -0
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 10.3.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7ea2e225c0abb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ea2e225c0abb) -
|
|
8
|
+
[ux] Minor styling, wording changes for block menu and sync blocks
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 10.3.17
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`52d4b8fab3118`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/52d4b8fab3118) -
|
|
16
|
+
Add platform_editor_toolbar_hide_overflow_menu experiment, add logic to hide menu button if there
|
|
17
|
+
are no menu items rendered
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 10.3.16
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -107,7 +107,10 @@ var SelectionExtensionDropdownItem = exports.SelectionExtensionDropdownItem = fu
|
|
|
107
107
|
position: "top"
|
|
108
108
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
109
109
|
elemBefore: IconComponent ? /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
110
|
-
size:
|
|
110
|
+
size:
|
|
111
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
112
|
+
// To clean up: simplify conditional to just check if extensionLocation is inline-toolbar or block-menu
|
|
113
|
+
(extensionLocation === 'inline-toolbar' || extensionLocation === 'block-menu') && ((0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_1') || (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3')) ? 'small' : undefined,
|
|
111
114
|
label: ""
|
|
112
115
|
}) : undefined,
|
|
113
116
|
onClick: handleClick,
|
|
@@ -129,7 +132,10 @@ var SelectionExtensionDropdownItem = exports.SelectionExtensionDropdownItem = fu
|
|
|
129
132
|
}
|
|
130
133
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
131
134
|
elemBefore: IconComponent ? /*#__PURE__*/_react.default.createElement(IconComponent, {
|
|
132
|
-
size:
|
|
135
|
+
size:
|
|
136
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
137
|
+
// To clean up: simplify conditional to just check if extensionLocation is inline-toolbar or block-menu
|
|
138
|
+
(extensionLocation === 'inline-toolbar' || extensionLocation === 'block-menu') && ((0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_1') || (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3')) ? 'small' : undefined,
|
|
133
139
|
label: ""
|
|
134
140
|
}) : undefined,
|
|
135
141
|
onClick: handleClick,
|
|
@@ -48,11 +48,21 @@ var SelectionExtensionNestedDropdownMenu = exports.SelectionExtensionNestedDropd
|
|
|
48
48
|
};
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarNestedDropdownMenu, {
|
|
50
50
|
text: nestedDropdownMenu.label,
|
|
51
|
-
elemBefore: IconComponent ?
|
|
52
|
-
|
|
51
|
+
elemBefore: IconComponent ?
|
|
52
|
+
/*#__PURE__*/
|
|
53
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
54
|
+
// To clean up: keep only size="small"
|
|
55
|
+
_react.default.createElement(IconComponent, {
|
|
56
|
+
label: "",
|
|
57
|
+
size: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined
|
|
53
58
|
}) : undefined,
|
|
54
|
-
elemAfter:
|
|
55
|
-
|
|
59
|
+
elemAfter:
|
|
60
|
+
/*#__PURE__*/
|
|
61
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
62
|
+
// To clean up: keep only size="small"
|
|
63
|
+
_react.default.createElement(_chevronRight.default, {
|
|
64
|
+
label: "",
|
|
65
|
+
size: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined
|
|
56
66
|
}),
|
|
57
67
|
onClick: handleClick,
|
|
58
68
|
dropdownTestId: "editor-selection-extension-menu",
|
|
@@ -8,6 +8,7 @@ exports.getToolbarComponents = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
11
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
12
|
var _MenuItem = require("./toolbar-components/MenuItem");
|
|
12
13
|
var _registerInlineToolbar = require("./toolbar-components/register-inline-toolbar");
|
|
13
14
|
var _migrateSelectionExtention = require("./utils/migrate-selection-extention");
|
|
@@ -56,6 +57,9 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
56
57
|
};
|
|
57
58
|
var registerFirstPartyExtensions = function registerFirstPartyExtensions(api, extensions) {
|
|
58
59
|
var components = [];
|
|
60
|
+
if (extensions.length === 0 && (0, _expValEquals.expValEquals)('platform_editor_toolbar_hide_overflow_menu', 'isEnabled', true)) {
|
|
61
|
+
return components;
|
|
62
|
+
}
|
|
59
63
|
components.push({
|
|
60
64
|
type: _toolbar.FIRST_PARTY_EXTENSIONS_MENU_ITEM.type,
|
|
61
65
|
key: _toolbar.FIRST_PARTY_EXTENSIONS_MENU_ITEM.key,
|
|
@@ -75,6 +79,9 @@ var registerFirstPartyExtensions = function registerFirstPartyExtensions(api, ex
|
|
|
75
79
|
};
|
|
76
80
|
var registerExternalExtensions = function registerExternalExtensions(api, extensions) {
|
|
77
81
|
var components = [];
|
|
82
|
+
if (extensions.length === 0 && (0, _expValEquals.expValEquals)('platform_editor_toolbar_hide_overflow_menu', 'isEnabled', true)) {
|
|
83
|
+
return components;
|
|
84
|
+
}
|
|
78
85
|
components.push({
|
|
79
86
|
type: _toolbar.EXTERNAL_EXTENSIONS_MENU_ITEM.type,
|
|
80
87
|
key: _toolbar.EXTERNAL_EXTENSIONS_MENU_ITEM.key,
|
|
@@ -98,7 +98,10 @@ export const SelectionExtensionDropdownItem = ({
|
|
|
98
98
|
position: "top"
|
|
99
99
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
100
100
|
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
101
|
-
size:
|
|
101
|
+
size:
|
|
102
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
103
|
+
// To clean up: simplify conditional to just check if extensionLocation is inline-toolbar or block-menu
|
|
104
|
+
(extensionLocation === 'inline-toolbar' || extensionLocation === 'block-menu') && (fg('platform_editor_block_menu_v2_patch_1') || fg('platform_editor_block_menu_v2_patch_3')) ? 'small' : undefined,
|
|
102
105
|
label: ""
|
|
103
106
|
}) : undefined,
|
|
104
107
|
onClick: handleClick,
|
|
@@ -120,7 +123,10 @@ export const SelectionExtensionDropdownItem = ({
|
|
|
120
123
|
}
|
|
121
124
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
122
125
|
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
123
|
-
size:
|
|
126
|
+
size:
|
|
127
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
128
|
+
// To clean up: simplify conditional to just check if extensionLocation is inline-toolbar or block-menu
|
|
129
|
+
(extensionLocation === 'inline-toolbar' || extensionLocation === 'block-menu') && (fg('platform_editor_block_menu_v2_patch_1') || fg('platform_editor_block_menu_v2_patch_3')) ? 'small' : undefined,
|
|
124
130
|
label: ""
|
|
125
131
|
}) : undefined,
|
|
126
132
|
onClick: handleClick,
|
|
@@ -42,11 +42,21 @@ export const SelectionExtensionNestedDropdownMenu = ({
|
|
|
42
42
|
};
|
|
43
43
|
return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
|
|
44
44
|
text: nestedDropdownMenu.label,
|
|
45
|
-
elemBefore: IconComponent ?
|
|
46
|
-
|
|
45
|
+
elemBefore: IconComponent ?
|
|
46
|
+
/*#__PURE__*/
|
|
47
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
48
|
+
// To clean up: keep only size="small"
|
|
49
|
+
React.createElement(IconComponent, {
|
|
50
|
+
label: "",
|
|
51
|
+
size: fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined
|
|
47
52
|
}) : undefined,
|
|
48
|
-
elemAfter:
|
|
49
|
-
|
|
53
|
+
elemAfter:
|
|
54
|
+
/*#__PURE__*/
|
|
55
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
56
|
+
// To clean up: keep only size="small"
|
|
57
|
+
React.createElement(ChevronRightIcon, {
|
|
58
|
+
label: "",
|
|
59
|
+
size: fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined
|
|
50
60
|
}),
|
|
51
61
|
onClick: handleClick,
|
|
52
62
|
dropdownTestId: "editor-selection-extension-menu",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { APPS_SECTION, EXTERNAL_EXTENSIONS_MENU_ITEM, FIRST_PARTY_EXTENSIONS_MENU_ITEM, OVERFLOW_EXTENSIONS_MENU_SECTION, OVERFLOW_EXTENSIONS_MENU_SECTION_RANK, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { MenuItem } from './toolbar-components/MenuItem';
|
|
4
5
|
import { registerInlineToolbar } from './toolbar-components/register-inline-toolbar';
|
|
5
6
|
import { migrateSelectionExtensionToMenuItem } from './utils/migrate-selection-extention';
|
|
@@ -39,6 +40,9 @@ export const getToolbarComponents = ({
|
|
|
39
40
|
};
|
|
40
41
|
const registerFirstPartyExtensions = (api, extensions) => {
|
|
41
42
|
const components = [];
|
|
43
|
+
if (extensions.length === 0 && expValEquals('platform_editor_toolbar_hide_overflow_menu', 'isEnabled', true)) {
|
|
44
|
+
return components;
|
|
45
|
+
}
|
|
42
46
|
components.push({
|
|
43
47
|
type: FIRST_PARTY_EXTENSIONS_MENU_ITEM.type,
|
|
44
48
|
key: FIRST_PARTY_EXTENSIONS_MENU_ITEM.key,
|
|
@@ -58,6 +62,9 @@ const registerFirstPartyExtensions = (api, extensions) => {
|
|
|
58
62
|
};
|
|
59
63
|
const registerExternalExtensions = (api, extensions) => {
|
|
60
64
|
const components = [];
|
|
65
|
+
if (extensions.length === 0 && expValEquals('platform_editor_toolbar_hide_overflow_menu', 'isEnabled', true)) {
|
|
66
|
+
return components;
|
|
67
|
+
}
|
|
61
68
|
components.push({
|
|
62
69
|
type: EXTERNAL_EXTENSIONS_MENU_ITEM.type,
|
|
63
70
|
key: EXTERNAL_EXTENSIONS_MENU_ITEM.key,
|
|
@@ -98,7 +98,10 @@ export var SelectionExtensionDropdownItem = function SelectionExtensionDropdownI
|
|
|
98
98
|
position: "top"
|
|
99
99
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
100
100
|
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
101
|
-
size:
|
|
101
|
+
size:
|
|
102
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
103
|
+
// To clean up: simplify conditional to just check if extensionLocation is inline-toolbar or block-menu
|
|
104
|
+
(extensionLocation === 'inline-toolbar' || extensionLocation === 'block-menu') && (fg('platform_editor_block_menu_v2_patch_1') || fg('platform_editor_block_menu_v2_patch_3')) ? 'small' : undefined,
|
|
102
105
|
label: ""
|
|
103
106
|
}) : undefined,
|
|
104
107
|
onClick: handleClick,
|
|
@@ -120,7 +123,10 @@ export var SelectionExtensionDropdownItem = function SelectionExtensionDropdownI
|
|
|
120
123
|
}
|
|
121
124
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
122
125
|
elemBefore: IconComponent ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
123
|
-
size:
|
|
126
|
+
size:
|
|
127
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
128
|
+
// To clean up: simplify conditional to just check if extensionLocation is inline-toolbar or block-menu
|
|
129
|
+
(extensionLocation === 'inline-toolbar' || extensionLocation === 'block-menu') && (fg('platform_editor_block_menu_v2_patch_1') || fg('platform_editor_block_menu_v2_patch_3')) ? 'small' : undefined,
|
|
124
130
|
label: ""
|
|
125
131
|
}) : undefined,
|
|
126
132
|
onClick: handleClick,
|
|
@@ -41,11 +41,21 @@ export var SelectionExtensionNestedDropdownMenu = function SelectionExtensionNes
|
|
|
41
41
|
};
|
|
42
42
|
return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
|
|
43
43
|
text: nestedDropdownMenu.label,
|
|
44
|
-
elemBefore: IconComponent ?
|
|
45
|
-
|
|
44
|
+
elemBefore: IconComponent ?
|
|
45
|
+
/*#__PURE__*/
|
|
46
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
47
|
+
// To clean up: keep only size="small"
|
|
48
|
+
React.createElement(IconComponent, {
|
|
49
|
+
label: "",
|
|
50
|
+
size: fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined
|
|
46
51
|
}) : undefined,
|
|
47
|
-
elemAfter:
|
|
48
|
-
|
|
52
|
+
elemAfter:
|
|
53
|
+
/*#__PURE__*/
|
|
54
|
+
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
55
|
+
// To clean up: keep only size="small"
|
|
56
|
+
React.createElement(ChevronRightIcon, {
|
|
57
|
+
label: "",
|
|
58
|
+
size: fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined
|
|
49
59
|
}),
|
|
50
60
|
onClick: handleClick,
|
|
51
61
|
dropdownTestId: "editor-selection-extension-menu",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { APPS_SECTION, EXTERNAL_EXTENSIONS_MENU_ITEM, FIRST_PARTY_EXTENSIONS_MENU_ITEM, OVERFLOW_EXTENSIONS_MENU_SECTION, OVERFLOW_EXTENSIONS_MENU_SECTION_RANK, TOOLBAR_RANK, TOOLBARS } from '@atlaskit/editor-common/toolbar';
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
import { MenuItem } from './toolbar-components/MenuItem';
|
|
5
6
|
import { registerInlineToolbar } from './toolbar-components/register-inline-toolbar';
|
|
6
7
|
import { migrateSelectionExtensionToMenuItem } from './utils/migrate-selection-extention';
|
|
@@ -49,6 +50,9 @@ export var getToolbarComponents = function getToolbarComponents(_ref) {
|
|
|
49
50
|
};
|
|
50
51
|
var registerFirstPartyExtensions = function registerFirstPartyExtensions(api, extensions) {
|
|
51
52
|
var components = [];
|
|
53
|
+
if (extensions.length === 0 && expValEquals('platform_editor_toolbar_hide_overflow_menu', 'isEnabled', true)) {
|
|
54
|
+
return components;
|
|
55
|
+
}
|
|
52
56
|
components.push({
|
|
53
57
|
type: FIRST_PARTY_EXTENSIONS_MENU_ITEM.type,
|
|
54
58
|
key: FIRST_PARTY_EXTENSIONS_MENU_ITEM.key,
|
|
@@ -68,6 +72,9 @@ var registerFirstPartyExtensions = function registerFirstPartyExtensions(api, ex
|
|
|
68
72
|
};
|
|
69
73
|
var registerExternalExtensions = function registerExternalExtensions(api, extensions) {
|
|
70
74
|
var components = [];
|
|
75
|
+
if (extensions.length === 0 && expValEquals('platform_editor_toolbar_hide_overflow_menu', 'isEnabled', true)) {
|
|
76
|
+
return components;
|
|
77
|
+
}
|
|
71
78
|
components.push({
|
|
72
79
|
type: EXTERNAL_EXTENSIONS_MENU_ITEM.type,
|
|
73
80
|
key: EXTERNAL_EXTENSIONS_MENU_ITEM.key,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.18",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@atlaskit/css": "^0.19.0",
|
|
37
37
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^7.0.0",
|
|
39
|
-
"@atlaskit/editor-plugin-block-controls": "^8.
|
|
40
|
-
"@atlaskit/editor-plugin-block-menu": "^6.
|
|
39
|
+
"@atlaskit/editor-plugin-block-controls": "^8.6.0",
|
|
40
|
+
"@atlaskit/editor-plugin-block-menu": "^6.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-editor-viewmode": "^9.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-editor-viewmode-effects": "^7.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-primary-toolbar": "^8.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/lozenge": "^13.4.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/primitives": "^18.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^29.
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^29.6.0",
|
|
56
56
|
"@atlaskit/tokens": "^11.0.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"uuid": "^3.1.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@atlaskit/editor-common": "^111.
|
|
63
|
+
"@atlaskit/editor-common": "^111.19.0",
|
|
64
64
|
"react": "^18.2.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
@@ -118,6 +118,9 @@
|
|
|
118
118
|
},
|
|
119
119
|
"platform_editor_block_menu_v2_patch_2": {
|
|
120
120
|
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"platform_editor_block_menu_v2_patch_3": {
|
|
123
|
+
"type": "boolean"
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
}
|