@atlaskit/editor-plugin-selection-extension 11.1.5 → 11.1.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 +12 -0
- package/dist/cjs/ui/LegacyToolbarComponent.js +10 -4
- package/dist/cjs/ui/toolbar/SelectionExtensionDropdownMenu.js +6 -2
- package/dist/cjs/ui/toolbar-components/register-inline-toolbar.js +3 -1
- package/dist/cjs/ui/utils/registerBlockMenuItems.js +6 -2
- package/dist/es2019/ui/LegacyToolbarComponent.js +10 -4
- package/dist/es2019/ui/toolbar/SelectionExtensionDropdownMenu.js +6 -2
- package/dist/es2019/ui/toolbar-components/register-inline-toolbar.js +3 -1
- package/dist/es2019/ui/utils/registerBlockMenuItems.js +6 -2
- package/dist/esm/ui/LegacyToolbarComponent.js +10 -4
- package/dist/esm/ui/toolbar/SelectionExtensionDropdownMenu.js +6 -2
- package/dist/esm/ui/toolbar-components/register-inline-toolbar.js +3 -1
- package/dist/esm/ui/utils/registerBlockMenuItems.js +6 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -13,7 +13,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
13
13
|
var LegacyPrimaryToolbarComponent = exports.LegacyPrimaryToolbarComponent = function LegacyPrimaryToolbarComponent(_ref) {
|
|
14
14
|
var primaryToolbarItemExtensions = _ref.primaryToolbarItemExtensions;
|
|
15
15
|
// NEXT PR: need to render a separator after – if there are extensions added
|
|
16
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, primaryToolbarItemExtensions.map(function (toolbarItemExtension,
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, primaryToolbarItemExtensions.map(function (toolbarItemExtension, _i) {
|
|
17
17
|
var toolbarItem = toolbarItemExtension.getToolbarItem();
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement(LegacyExtensionToolbarItem, {
|
|
19
19
|
key: toolbarItem.tooltip,
|
|
@@ -72,7 +72,9 @@ var LegacyExtensionToolbarItem = exports.LegacyExtensionToolbarItem = function L
|
|
|
72
72
|
var handleOnOpenChange = function handleOnOpenChange(attrs) {
|
|
73
73
|
setIsOpen(!!(attrs !== null && attrs !== void 0 && attrs.isOpen));
|
|
74
74
|
};
|
|
75
|
-
var items = isOpen ?
|
|
75
|
+
var items = isOpen ?
|
|
76
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
77
|
+
getMenuItems().map(function (menuItem, i) {
|
|
76
78
|
// Only process ExtensionMenuItemConfiguration, skip ExtensionMenuSectionConfiguration
|
|
77
79
|
if ('label' in menuItem && 'icon' in menuItem) {
|
|
78
80
|
return {
|
|
@@ -98,10 +100,14 @@ var LegacyExtensionToolbarItem = exports.LegacyExtensionToolbarItem = function L
|
|
|
98
100
|
}).filter(function (item) {
|
|
99
101
|
return item !== undefined;
|
|
100
102
|
}) : [];
|
|
101
|
-
return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation
|
|
104
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
105
|
+
, {
|
|
102
106
|
arrowKeyNavigationProviderOptions: {
|
|
103
107
|
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
104
|
-
}
|
|
108
|
+
}
|
|
109
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
110
|
+
,
|
|
105
111
|
items: [{
|
|
106
112
|
items: items
|
|
107
113
|
}],
|
|
@@ -21,7 +21,9 @@ var SelectionExtensionDropdownMenuComponent = /*#__PURE__*/_react.default.memo(f
|
|
|
21
21
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
22
22
|
isMenuOpen = _useState2[0],
|
|
23
23
|
setIsMenuOpen = _useState2[1];
|
|
24
|
-
return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation
|
|
25
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
26
|
+
, {
|
|
25
27
|
section: {
|
|
26
28
|
hasSeparator: true
|
|
27
29
|
},
|
|
@@ -33,7 +35,9 @@ var SelectionExtensionDropdownMenuComponent = /*#__PURE__*/_react.default.memo(f
|
|
|
33
35
|
"data-testid": "selection-extension-dropdown-menu"
|
|
34
36
|
}, /*#__PURE__*/_react.default.createElement(_SelectionExtensionDropdownMenuButton.SelectionExtensionDropdownMenuButton, {
|
|
35
37
|
"aria-expanded": isMenuOpen,
|
|
36
|
-
selected: isMenuOpen
|
|
38
|
+
selected: isMenuOpen
|
|
39
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
40
|
+
,
|
|
37
41
|
onClick: function onClick() {
|
|
38
42
|
return setIsMenuOpen(function (prevIsMenuOpen) {
|
|
39
43
|
var nextIsMenuOpen = !prevIsMenuOpen;
|
|
@@ -23,7 +23,9 @@ var InlineToolbarMenuItemComponent = function InlineToolbarMenuItemComponent(_re
|
|
|
23
23
|
if (!editorView || !api) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(_SelectionExtensionComponentContext.SelectionExtensionComponentContextProvider
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_SelectionExtensionComponentContext.SelectionExtensionComponentContextProvider
|
|
27
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
28
|
+
, {
|
|
27
29
|
value: {
|
|
28
30
|
api: api,
|
|
29
31
|
editorView: editorView,
|
|
@@ -43,7 +43,9 @@ function registerBlockMenuItems(_ref) {
|
|
|
43
43
|
if (!editorView) {
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
|
-
return /*#__PURE__*/_react.default.createElement(_SelectionExtensionComponentContext.SelectionExtensionComponentContextProvider
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_SelectionExtensionComponentContext.SelectionExtensionComponentContextProvider
|
|
47
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
48
|
+
, {
|
|
47
49
|
value: {
|
|
48
50
|
api: api,
|
|
49
51
|
editorView: editorView,
|
|
@@ -73,7 +75,9 @@ function registerBlockMenuItems(_ref) {
|
|
|
73
75
|
if (!editorView) {
|
|
74
76
|
return null;
|
|
75
77
|
}
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(_SelectionExtensionComponentContext.SelectionExtensionComponentContextProvider
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_SelectionExtensionComponentContext.SelectionExtensionComponentContextProvider
|
|
79
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
80
|
+
, {
|
|
77
81
|
value: {
|
|
78
82
|
api: api,
|
|
79
83
|
editorView: editorView,
|
|
@@ -4,7 +4,7 @@ export const LegacyPrimaryToolbarComponent = ({
|
|
|
4
4
|
primaryToolbarItemExtensions
|
|
5
5
|
}) => {
|
|
6
6
|
// NEXT PR: need to render a separator after – if there are extensions added
|
|
7
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, primaryToolbarItemExtensions.map((toolbarItemExtension,
|
|
7
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, primaryToolbarItemExtensions.map((toolbarItemExtension, _i) => {
|
|
8
8
|
const toolbarItem = toolbarItemExtension.getToolbarItem();
|
|
9
9
|
return /*#__PURE__*/React.createElement(LegacyExtensionToolbarItem, {
|
|
10
10
|
key: toolbarItem.tooltip,
|
|
@@ -61,7 +61,9 @@ export const LegacyExtensionToolbarItem = ({
|
|
|
61
61
|
const handleOnOpenChange = attrs => {
|
|
62
62
|
setIsOpen(!!(attrs !== null && attrs !== void 0 && attrs.isOpen));
|
|
63
63
|
};
|
|
64
|
-
const items = isOpen ?
|
|
64
|
+
const items = isOpen ?
|
|
65
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
66
|
+
getMenuItems().map((menuItem, i) => {
|
|
65
67
|
// Only process ExtensionMenuItemConfiguration, skip ExtensionMenuSectionConfiguration
|
|
66
68
|
if ('label' in menuItem && 'icon' in menuItem) {
|
|
67
69
|
return {
|
|
@@ -85,10 +87,14 @@ export const LegacyExtensionToolbarItem = ({
|
|
|
85
87
|
}
|
|
86
88
|
return undefined;
|
|
87
89
|
}).filter(item => item !== undefined) : [];
|
|
88
|
-
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
90
|
+
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
91
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
92
|
+
, {
|
|
89
93
|
arrowKeyNavigationProviderOptions: {
|
|
90
94
|
type: ArrowKeyNavigationType.MENU
|
|
91
|
-
}
|
|
95
|
+
}
|
|
96
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
97
|
+
,
|
|
92
98
|
items: [{
|
|
93
99
|
items
|
|
94
100
|
}],
|
|
@@ -9,7 +9,9 @@ const SelectionExtensionDropdownMenuComponent = /*#__PURE__*/React.memo(({
|
|
|
9
9
|
editorAnalyticsAPI
|
|
10
10
|
}) => {
|
|
11
11
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
12
|
-
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
12
|
+
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
13
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
14
|
+
, {
|
|
13
15
|
section: {
|
|
14
16
|
hasSeparator: true
|
|
15
17
|
},
|
|
@@ -21,7 +23,9 @@ const SelectionExtensionDropdownMenuComponent = /*#__PURE__*/React.memo(({
|
|
|
21
23
|
"data-testid": "selection-extension-dropdown-menu"
|
|
22
24
|
}, /*#__PURE__*/React.createElement(SelectionExtensionDropdownMenuButton, {
|
|
23
25
|
"aria-expanded": isMenuOpen,
|
|
24
|
-
selected: isMenuOpen
|
|
26
|
+
selected: isMenuOpen
|
|
27
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
28
|
+
,
|
|
25
29
|
onClick: () => setIsMenuOpen(prevIsMenuOpen => {
|
|
26
30
|
const nextIsMenuOpen = !prevIsMenuOpen;
|
|
27
31
|
if (editorAnalyticsAPI) {
|
|
@@ -18,7 +18,9 @@ const InlineToolbarMenuItemComponent = ({
|
|
|
18
18
|
if (!editorView || !api) {
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
|
-
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
21
|
+
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
22
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
23
|
+
, {
|
|
22
24
|
value: {
|
|
23
25
|
api,
|
|
24
26
|
editorView,
|
|
@@ -38,7 +38,9 @@ export function registerBlockMenuItems({
|
|
|
38
38
|
if (!editorView) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
|
-
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
41
|
+
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
42
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
43
|
+
, {
|
|
42
44
|
value: {
|
|
43
45
|
api,
|
|
44
46
|
editorView,
|
|
@@ -66,7 +68,9 @@ export function registerBlockMenuItems({
|
|
|
66
68
|
if (!editorView) {
|
|
67
69
|
return null;
|
|
68
70
|
}
|
|
69
|
-
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
71
|
+
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
72
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
73
|
+
, {
|
|
70
74
|
value: {
|
|
71
75
|
api,
|
|
72
76
|
editorView,
|
|
@@ -4,7 +4,7 @@ import { ArrowKeyNavigationType, DropdownMenuWithKeyboardNavigation as DropdownM
|
|
|
4
4
|
export var LegacyPrimaryToolbarComponent = function LegacyPrimaryToolbarComponent(_ref) {
|
|
5
5
|
var primaryToolbarItemExtensions = _ref.primaryToolbarItemExtensions;
|
|
6
6
|
// NEXT PR: need to render a separator after – if there are extensions added
|
|
7
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, primaryToolbarItemExtensions.map(function (toolbarItemExtension,
|
|
7
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, primaryToolbarItemExtensions.map(function (toolbarItemExtension, _i) {
|
|
8
8
|
var toolbarItem = toolbarItemExtension.getToolbarItem();
|
|
9
9
|
return /*#__PURE__*/React.createElement(LegacyExtensionToolbarItem, {
|
|
10
10
|
key: toolbarItem.tooltip,
|
|
@@ -63,7 +63,9 @@ export var LegacyExtensionToolbarItem = function LegacyExtensionToolbarItem(_ref
|
|
|
63
63
|
var handleOnOpenChange = function handleOnOpenChange(attrs) {
|
|
64
64
|
setIsOpen(!!(attrs !== null && attrs !== void 0 && attrs.isOpen));
|
|
65
65
|
};
|
|
66
|
-
var items = isOpen ?
|
|
66
|
+
var items = isOpen ?
|
|
67
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
68
|
+
getMenuItems().map(function (menuItem, i) {
|
|
67
69
|
// Only process ExtensionMenuItemConfiguration, skip ExtensionMenuSectionConfiguration
|
|
68
70
|
if ('label' in menuItem && 'icon' in menuItem) {
|
|
69
71
|
return {
|
|
@@ -89,10 +91,14 @@ export var LegacyExtensionToolbarItem = function LegacyExtensionToolbarItem(_ref
|
|
|
89
91
|
}).filter(function (item) {
|
|
90
92
|
return item !== undefined;
|
|
91
93
|
}) : [];
|
|
92
|
-
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
94
|
+
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
95
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
96
|
+
, {
|
|
93
97
|
arrowKeyNavigationProviderOptions: {
|
|
94
98
|
type: ArrowKeyNavigationType.MENU
|
|
95
|
-
}
|
|
99
|
+
}
|
|
100
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
101
|
+
,
|
|
96
102
|
items: [{
|
|
97
103
|
items: items
|
|
98
104
|
}],
|
|
@@ -12,7 +12,9 @@ var SelectionExtensionDropdownMenuComponent = /*#__PURE__*/React.memo(function (
|
|
|
12
12
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13
13
|
isMenuOpen = _useState2[0],
|
|
14
14
|
setIsMenuOpen = _useState2[1];
|
|
15
|
-
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
15
|
+
return /*#__PURE__*/React.createElement(DropdownMenu
|
|
16
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
17
|
+
, {
|
|
16
18
|
section: {
|
|
17
19
|
hasSeparator: true
|
|
18
20
|
},
|
|
@@ -24,7 +26,9 @@ var SelectionExtensionDropdownMenuComponent = /*#__PURE__*/React.memo(function (
|
|
|
24
26
|
"data-testid": "selection-extension-dropdown-menu"
|
|
25
27
|
}, /*#__PURE__*/React.createElement(SelectionExtensionDropdownMenuButton, {
|
|
26
28
|
"aria-expanded": isMenuOpen,
|
|
27
|
-
selected: isMenuOpen
|
|
29
|
+
selected: isMenuOpen
|
|
30
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
31
|
+
,
|
|
28
32
|
onClick: function onClick() {
|
|
29
33
|
return setIsMenuOpen(function (prevIsMenuOpen) {
|
|
30
34
|
var nextIsMenuOpen = !prevIsMenuOpen;
|
|
@@ -16,7 +16,9 @@ var InlineToolbarMenuItemComponent = function InlineToolbarMenuItemComponent(_re
|
|
|
16
16
|
if (!editorView || !api) {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
19
|
+
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
20
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
21
|
+
, {
|
|
20
22
|
value: {
|
|
21
23
|
api: api,
|
|
22
24
|
editorView: editorView,
|
|
@@ -36,7 +36,9 @@ export function registerBlockMenuItems(_ref) {
|
|
|
36
36
|
if (!editorView) {
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
|
-
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
39
|
+
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
40
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
41
|
+
, {
|
|
40
42
|
value: {
|
|
41
43
|
api: api,
|
|
42
44
|
editorView: editorView,
|
|
@@ -66,7 +68,9 @@ export function registerBlockMenuItems(_ref) {
|
|
|
66
68
|
if (!editorView) {
|
|
67
69
|
return null;
|
|
68
70
|
}
|
|
69
|
-
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
71
|
+
return /*#__PURE__*/React.createElement(SelectionExtensionComponentContextProvider
|
|
72
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
73
|
+
, {
|
|
70
74
|
value: {
|
|
71
75
|
api: api,
|
|
72
76
|
editorView: editorView,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.7",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/lozenge": "^13.5.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/primitives": "^18.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^45.0.0",
|
|
56
56
|
"@atlaskit/tokens": "^11.1.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": "^112.
|
|
63
|
+
"@atlaskit/editor-common": "^112.8.0",
|
|
64
64
|
"react": "^18.2.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|