@atlaskit/editor-plugin-selection-extension 13.1.15 → 13.2.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 +24 -0
- package/dist/cjs/entry-points/selection-extension-plugin-type.js +1 -0
- package/dist/cjs/entry-points/selection-extension-plugin.js +12 -0
- package/dist/cjs/entry-points/types.js +1 -0
- package/dist/cjs/ui/menu/SelectionExtensionDropdownItem.js +19 -41
- package/dist/cjs/ui/menu/SelectionExtensionNestedDropdownMenu.js +2 -3
- package/dist/cjs/ui/toolbar-components/register-inline-toolbar.js +1 -11
- package/dist/es2019/entry-points/selection-extension-plugin-type.js +0 -0
- package/dist/es2019/entry-points/selection-extension-plugin.js +2 -0
- package/dist/es2019/entry-points/types.js +0 -0
- package/dist/es2019/ui/menu/SelectionExtensionDropdownItem.js +19 -41
- package/dist/es2019/ui/menu/SelectionExtensionNestedDropdownMenu.js +2 -3
- package/dist/es2019/ui/toolbar-components/register-inline-toolbar.js +1 -9
- package/dist/esm/entry-points/selection-extension-plugin-type.js +0 -0
- package/dist/esm/entry-points/selection-extension-plugin.js +2 -0
- package/dist/esm/entry-points/types.js +0 -0
- package/dist/esm/ui/menu/SelectionExtensionDropdownItem.js +19 -41
- package/dist/esm/ui/menu/SelectionExtensionNestedDropdownMenu.js +2 -3
- package/dist/esm/ui/toolbar-components/register-inline-toolbar.js +1 -11
- package/dist/types/entry-points/selection-extension-plugin-type.d.ts +1 -0
- package/dist/types/entry-points/selection-extension-plugin.d.ts +1 -0
- package/dist/types/entry-points/types.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/selection-extension-plugin-type.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/selection-extension-plugin.d.ts +1 -0
- package/dist/types-ts4.5/entry-points/types.d.ts +1 -0
- package/package.json +10 -16
- package/selection-extension-plugin/package.json +17 -0
- package/selection-extension-plugin-type/package.json +17 -0
- package/types/package.json +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-selection-extension
|
|
2
2
|
|
|
3
|
+
## 13.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`41168b2bd2790`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41168b2bd2790) -
|
|
8
|
+
Autofix: add explicit package exports (barrel removal)
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 13.1.16
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`9b17a2bfdbc92`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b17a2bfdbc92) -
|
|
19
|
+
Cleanup feature gates `platform_editor_block_menu_v2_patch_1` and
|
|
20
|
+
`platform_editor_block_menu_v2_patch_2`. The patch_1 behaviour (inline toolbar uses
|
|
21
|
+
`InlineToolbarMenuItemComponent` and block menu is only closed when
|
|
22
|
+
`extensionLocation === 'block-menu'`) and patch_2 behaviour (max-width styles on block menu,
|
|
23
|
+
tooltip/title-wrap on nested dropdown menus, truncation tooltip on dropdown items) are now
|
|
24
|
+
permanent.
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 13.1.15
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "selectionExtensionPlugin", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _selectionExtensionPlugin.selectionExtensionPlugin;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _selectionExtensionPlugin = require("../selectionExtensionPlugin");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -59,18 +59,9 @@ var SelectionExtensionDropdownItem = exports.SelectionExtensionDropdownItem = fu
|
|
|
59
59
|
selectedNode: selectedNode,
|
|
60
60
|
nodePos: nodePos
|
|
61
61
|
});
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || _api$blockControls2.commands.toggleBlockMenu({
|
|
66
|
-
closeMenu: true
|
|
67
|
-
})({
|
|
68
|
-
tr: tr
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
var _api$blockControls3;
|
|
73
|
-
api === null || api === void 0 || (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 || _api$blockControls3.commands.toggleBlockMenu({
|
|
62
|
+
if (extensionLocation === 'block-menu') {
|
|
63
|
+
var _api$blockControls2;
|
|
64
|
+
api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || _api$blockControls2.commands.toggleBlockMenu({
|
|
74
65
|
closeMenu: true
|
|
75
66
|
})({
|
|
76
67
|
tr: tr
|
|
@@ -112,39 +103,26 @@ var SelectionExtensionDropdownItem = exports.SelectionExtensionDropdownItem = fu
|
|
|
112
103
|
var elemBeforeIcon = iconElement && extensionLocation === 'block-menu' ? /*#__PURE__*/_react.default.createElement("span", {
|
|
113
104
|
className: (0, _runtime.ax)([styles.svgOverflow])
|
|
114
105
|
}, iconElement) : iconElement;
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
120
|
-
elemBefore: elemBeforeIcon,
|
|
121
|
-
onClick: handleClick,
|
|
122
|
-
isDisabled: dropdownItem.isDisabled,
|
|
123
|
-
testId: _blockMenu.EXTENSION_MENU_ITEM_TEST_ID
|
|
124
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
125
|
-
as: "span",
|
|
126
|
-
xcss: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_5') ? styles.contentWrapperWithJustifyContent : styles.contentWrapper,
|
|
127
|
-
onMouseOver: handleMouseEnter
|
|
128
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
129
|
-
as: "span",
|
|
130
|
-
xcss: styles.label,
|
|
131
|
-
ref: labelRef
|
|
132
|
-
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
133
|
-
as: "span",
|
|
134
|
-
xcss: styles.lozenge
|
|
135
|
-
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
136
|
-
appearance: (0, _platformFeatureFlags.fg)('confluence_fronend_labels_categorization_migration') ? 'discovery' : 'new'
|
|
137
|
-
}, dropdownItem.lozenge.label)) : undefined)));
|
|
138
|
-
}
|
|
139
|
-
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
|
|
107
|
+
content: isTruncated ? dropdownItem.label : null,
|
|
108
|
+
position: "top"
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
140
110
|
elemBefore: elemBeforeIcon,
|
|
141
|
-
testId: _blockMenu.EXTENSION_MENU_ITEM_TEST_ID,
|
|
142
111
|
onClick: handleClick,
|
|
143
|
-
isDisabled: dropdownItem.isDisabled
|
|
144
|
-
|
|
112
|
+
isDisabled: dropdownItem.isDisabled,
|
|
113
|
+
testId: _blockMenu.EXTENSION_MENU_ITEM_TEST_ID
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
115
|
+
as: "span",
|
|
116
|
+
xcss: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_5') ? styles.contentWrapperWithJustifyContent : styles.contentWrapper,
|
|
117
|
+
onMouseOver: handleMouseEnter
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
119
|
+
as: "span",
|
|
120
|
+
xcss: styles.label,
|
|
121
|
+
ref: labelRef
|
|
122
|
+
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
145
123
|
as: "span",
|
|
146
124
|
xcss: styles.lozenge
|
|
147
125
|
}, /*#__PURE__*/_react.default.createElement(_lozenge.default, {
|
|
148
126
|
appearance: (0, _platformFeatureFlags.fg)('confluence_fronend_labels_categorization_migration') ? 'discovery' : 'new'
|
|
149
|
-
}, dropdownItem.lozenge.label)) : undefined);
|
|
127
|
+
}, dropdownItem.lozenge.label)) : undefined)));
|
|
150
128
|
};
|
|
@@ -10,7 +10,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
10
10
|
var _blockMenu = require("@atlaskit/editor-common/block-menu");
|
|
11
11
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
12
12
|
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _SelectionExtensionComponentContext = require("../SelectionExtensionComponentContext");
|
|
15
14
|
var _SelectionExtensionDropdownItem = require("./SelectionExtensionDropdownItem");
|
|
16
15
|
var ChildItems = function ChildItems(_ref) {
|
|
@@ -60,8 +59,8 @@ var SelectionExtensionNestedDropdownMenu = exports.SelectionExtensionNestedDropd
|
|
|
60
59
|
}),
|
|
61
60
|
onClick: handleClick,
|
|
62
61
|
dropdownTestId: "editor-selection-extension-menu",
|
|
63
|
-
shouldTitleWrap:
|
|
64
|
-
tooltipContent:
|
|
62
|
+
shouldTitleWrap: false,
|
|
63
|
+
tooltipContent: nestedDropdownMenu.label
|
|
65
64
|
}, /*#__PURE__*/_react.default.createElement(ChildItems, {
|
|
66
65
|
nestedDropdownMenu: nestedDropdownMenu
|
|
67
66
|
}));
|
|
@@ -7,10 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.registerInlineToolbar = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _SelectionExtensionMenuItems = require("../menu/SelectionExtensionMenuItems");
|
|
12
11
|
var _SelectionExtensionComponentContext = require("../SelectionExtensionComponentContext");
|
|
13
|
-
var _MenuItem = require("./MenuItem");
|
|
14
12
|
var _ToolbarButton = require("./ToolbarButton");
|
|
15
13
|
var _ToolbarMenu = require("./ToolbarMenu");
|
|
16
14
|
var EXTENSION_RANK_MULTIPLIER = 100;
|
|
@@ -114,11 +112,6 @@ var registerInlineToolbar = exports.registerInlineToolbar = function registerInl
|
|
|
114
112
|
}]
|
|
115
113
|
});
|
|
116
114
|
}
|
|
117
|
-
|
|
118
|
-
// Remove ExtensionMenuSectionConfiguration - only care about items
|
|
119
|
-
var menuItems = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_1') ? [] : getMenuItems().filter(function (item) {
|
|
120
|
-
return 'label' in item && 'icon' in item;
|
|
121
|
-
});
|
|
122
115
|
components.push({
|
|
123
116
|
type: 'menu-item',
|
|
124
117
|
key: key,
|
|
@@ -129,13 +122,10 @@ var registerInlineToolbar = exports.registerInlineToolbar = function registerInl
|
|
|
129
122
|
rank: (index + 1) * EXTENSION_RANK_MULTIPLIER
|
|
130
123
|
}],
|
|
131
124
|
component: function component() {
|
|
132
|
-
return
|
|
125
|
+
return /*#__PURE__*/_react.default.createElement(InlineToolbarMenuItemComponent, {
|
|
133
126
|
api: api,
|
|
134
127
|
extension: extension,
|
|
135
128
|
getMenuItems: getMenuItems
|
|
136
|
-
}) : /*#__PURE__*/_react.default.createElement(_MenuItem.MenuItem, {
|
|
137
|
-
api: api,
|
|
138
|
-
extensionMenuItems: menuItems
|
|
139
129
|
});
|
|
140
130
|
}
|
|
141
131
|
});
|
|
File without changes
|
|
File without changes
|
|
@@ -53,18 +53,9 @@ export const SelectionExtensionDropdownItem = ({
|
|
|
53
53
|
selectedNode,
|
|
54
54
|
nodePos
|
|
55
55
|
});
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.toggleBlockMenu({
|
|
60
|
-
closeMenu: true
|
|
61
|
-
})({
|
|
62
|
-
tr
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
var _api$blockControls3;
|
|
67
|
-
api === null || api === void 0 ? void 0 : (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 ? void 0 : _api$blockControls3.commands.toggleBlockMenu({
|
|
56
|
+
if (extensionLocation === 'block-menu') {
|
|
57
|
+
var _api$blockControls2;
|
|
58
|
+
api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.toggleBlockMenu({
|
|
68
59
|
closeMenu: true
|
|
69
60
|
})({
|
|
70
61
|
tr
|
|
@@ -103,39 +94,26 @@ export const SelectionExtensionDropdownItem = ({
|
|
|
103
94
|
const elemBeforeIcon = iconElement && extensionLocation === 'block-menu' ? /*#__PURE__*/React.createElement("span", {
|
|
104
95
|
className: ax([styles.svgOverflow])
|
|
105
96
|
}, iconElement) : iconElement;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
111
|
-
elemBefore: elemBeforeIcon,
|
|
112
|
-
onClick: handleClick,
|
|
113
|
-
isDisabled: dropdownItem.isDisabled,
|
|
114
|
-
testId: EXTENSION_MENU_ITEM_TEST_ID
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
116
|
-
as: "span",
|
|
117
|
-
xcss: fg('platform_editor_block_menu_v2_patch_5') ? styles.contentWrapperWithJustifyContent : styles.contentWrapper,
|
|
118
|
-
onMouseOver: handleMouseEnter
|
|
119
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
120
|
-
as: "span",
|
|
121
|
-
xcss: styles.label,
|
|
122
|
-
ref: labelRef
|
|
123
|
-
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/React.createElement(Box, {
|
|
124
|
-
as: "span",
|
|
125
|
-
xcss: styles.lozenge
|
|
126
|
-
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
127
|
-
appearance: fg('confluence_fronend_labels_categorization_migration') ? 'discovery' : 'new'
|
|
128
|
-
}, dropdownItem.lozenge.label)) : undefined)));
|
|
129
|
-
}
|
|
130
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
97
|
+
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
98
|
+
content: isTruncated ? dropdownItem.label : null,
|
|
99
|
+
position: "top"
|
|
100
|
+
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
131
101
|
elemBefore: elemBeforeIcon,
|
|
132
|
-
testId: EXTENSION_MENU_ITEM_TEST_ID,
|
|
133
102
|
onClick: handleClick,
|
|
134
|
-
isDisabled: dropdownItem.isDisabled
|
|
135
|
-
|
|
103
|
+
isDisabled: dropdownItem.isDisabled,
|
|
104
|
+
testId: EXTENSION_MENU_ITEM_TEST_ID
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
106
|
+
as: "span",
|
|
107
|
+
xcss: fg('platform_editor_block_menu_v2_patch_5') ? styles.contentWrapperWithJustifyContent : styles.contentWrapper,
|
|
108
|
+
onMouseOver: handleMouseEnter
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
110
|
+
as: "span",
|
|
111
|
+
xcss: styles.label,
|
|
112
|
+
ref: labelRef
|
|
113
|
+
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/React.createElement(Box, {
|
|
136
114
|
as: "span",
|
|
137
115
|
xcss: styles.lozenge
|
|
138
116
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
139
117
|
appearance: fg('confluence_fronend_labels_categorization_migration') ? 'discovery' : 'new'
|
|
140
|
-
}, dropdownItem.lozenge.label)) : undefined);
|
|
118
|
+
}, dropdownItem.lozenge.label)) : undefined)));
|
|
141
119
|
};
|
|
@@ -3,7 +3,6 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
|
|
|
3
3
|
import { EXTENSION_MENU_ITEM_TEST_ID } from '@atlaskit/editor-common/block-menu';
|
|
4
4
|
import { ToolbarDropdownItemSection, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
5
5
|
import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { useSelectionExtensionComponentContext } from '../SelectionExtensionComponentContext';
|
|
8
7
|
import { SelectionExtensionDropdownItem } from './SelectionExtensionDropdownItem';
|
|
9
8
|
const ChildItems = ({
|
|
@@ -54,8 +53,8 @@ export const SelectionExtensionNestedDropdownMenu = ({
|
|
|
54
53
|
}),
|
|
55
54
|
onClick: handleClick,
|
|
56
55
|
dropdownTestId: "editor-selection-extension-menu",
|
|
57
|
-
shouldTitleWrap:
|
|
58
|
-
tooltipContent:
|
|
56
|
+
shouldTitleWrap: false,
|
|
57
|
+
tooltipContent: nestedDropdownMenu.label
|
|
59
58
|
}, /*#__PURE__*/React.createElement(ChildItems, {
|
|
60
59
|
nestedDropdownMenu: nestedDropdownMenu
|
|
61
60
|
}));
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { APPS_SECTION, OVERFLOW_EXTENSIONS_MENU_SECTION, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { SelectionExtensionMenuItems } from '../menu/SelectionExtensionMenuItems';
|
|
5
4
|
import { SelectionExtensionComponentContextProvider } from '../SelectionExtensionComponentContext';
|
|
6
|
-
import { MenuItem } from './MenuItem';
|
|
7
5
|
import { ToolbarButton } from './ToolbarButton';
|
|
8
6
|
import { ToolbarMenu } from './ToolbarMenu';
|
|
9
7
|
const EXTENSION_RANK_MULTIPLIER = 100;
|
|
@@ -114,9 +112,6 @@ export const registerInlineToolbar = ({
|
|
|
114
112
|
}]
|
|
115
113
|
});
|
|
116
114
|
}
|
|
117
|
-
|
|
118
|
-
// Remove ExtensionMenuSectionConfiguration - only care about items
|
|
119
|
-
const menuItems = fg('platform_editor_block_menu_v2_patch_1') ? [] : getMenuItems().filter(item => 'label' in item && 'icon' in item);
|
|
120
115
|
components.push({
|
|
121
116
|
type: 'menu-item',
|
|
122
117
|
key,
|
|
@@ -127,13 +122,10 @@ export const registerInlineToolbar = ({
|
|
|
127
122
|
rank: (index + 1) * EXTENSION_RANK_MULTIPLIER
|
|
128
123
|
}],
|
|
129
124
|
component: () => {
|
|
130
|
-
return
|
|
125
|
+
return /*#__PURE__*/React.createElement(InlineToolbarMenuItemComponent, {
|
|
131
126
|
api: api,
|
|
132
127
|
extension: extension,
|
|
133
128
|
getMenuItems: getMenuItems
|
|
134
|
-
}) : /*#__PURE__*/React.createElement(MenuItem, {
|
|
135
|
-
api: api,
|
|
136
|
-
extensionMenuItems: menuItems
|
|
137
129
|
});
|
|
138
130
|
}
|
|
139
131
|
});
|
|
File without changes
|
|
File without changes
|
|
@@ -50,18 +50,9 @@ export var SelectionExtensionDropdownItem = function SelectionExtensionDropdownI
|
|
|
50
50
|
selectedNode: selectedNode,
|
|
51
51
|
nodePos: nodePos
|
|
52
52
|
});
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || _api$blockControls2.commands.toggleBlockMenu({
|
|
57
|
-
closeMenu: true
|
|
58
|
-
})({
|
|
59
|
-
tr: tr
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
var _api$blockControls3;
|
|
64
|
-
api === null || api === void 0 || (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 || _api$blockControls3.commands.toggleBlockMenu({
|
|
53
|
+
if (extensionLocation === 'block-menu') {
|
|
54
|
+
var _api$blockControls2;
|
|
55
|
+
api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || _api$blockControls2.commands.toggleBlockMenu({
|
|
65
56
|
closeMenu: true
|
|
66
57
|
})({
|
|
67
58
|
tr: tr
|
|
@@ -103,39 +94,26 @@ export var SelectionExtensionDropdownItem = function SelectionExtensionDropdownI
|
|
|
103
94
|
var elemBeforeIcon = iconElement && extensionLocation === 'block-menu' ? /*#__PURE__*/React.createElement("span", {
|
|
104
95
|
className: ax([styles.svgOverflow])
|
|
105
96
|
}, iconElement) : iconElement;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
111
|
-
elemBefore: elemBeforeIcon,
|
|
112
|
-
onClick: handleClick,
|
|
113
|
-
isDisabled: dropdownItem.isDisabled,
|
|
114
|
-
testId: EXTENSION_MENU_ITEM_TEST_ID
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
116
|
-
as: "span",
|
|
117
|
-
xcss: fg('platform_editor_block_menu_v2_patch_5') ? styles.contentWrapperWithJustifyContent : styles.contentWrapper,
|
|
118
|
-
onMouseOver: handleMouseEnter
|
|
119
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
120
|
-
as: "span",
|
|
121
|
-
xcss: styles.label,
|
|
122
|
-
ref: labelRef
|
|
123
|
-
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/React.createElement(Box, {
|
|
124
|
-
as: "span",
|
|
125
|
-
xcss: styles.lozenge
|
|
126
|
-
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
127
|
-
appearance: fg('confluence_fronend_labels_categorization_migration') ? 'discovery' : 'new'
|
|
128
|
-
}, dropdownItem.lozenge.label)) : undefined)));
|
|
129
|
-
}
|
|
130
|
-
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
97
|
+
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
98
|
+
content: isTruncated ? dropdownItem.label : null,
|
|
99
|
+
position: "top"
|
|
100
|
+
}, /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
131
101
|
elemBefore: elemBeforeIcon,
|
|
132
|
-
testId: EXTENSION_MENU_ITEM_TEST_ID,
|
|
133
102
|
onClick: handleClick,
|
|
134
|
-
isDisabled: dropdownItem.isDisabled
|
|
135
|
-
|
|
103
|
+
isDisabled: dropdownItem.isDisabled,
|
|
104
|
+
testId: EXTENSION_MENU_ITEM_TEST_ID
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
106
|
+
as: "span",
|
|
107
|
+
xcss: fg('platform_editor_block_menu_v2_patch_5') ? styles.contentWrapperWithJustifyContent : styles.contentWrapper,
|
|
108
|
+
onMouseOver: handleMouseEnter
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
110
|
+
as: "span",
|
|
111
|
+
xcss: styles.label,
|
|
112
|
+
ref: labelRef
|
|
113
|
+
}, dropdownItem.label), dropdownItem.lozenge ? /*#__PURE__*/React.createElement(Box, {
|
|
136
114
|
as: "span",
|
|
137
115
|
xcss: styles.lozenge
|
|
138
116
|
}, /*#__PURE__*/React.createElement(Lozenge, {
|
|
139
117
|
appearance: fg('confluence_fronend_labels_categorization_migration') ? 'discovery' : 'new'
|
|
140
|
-
}, dropdownItem.lozenge.label)) : undefined);
|
|
118
|
+
}, dropdownItem.lozenge.label)) : undefined)));
|
|
141
119
|
};
|
|
@@ -3,7 +3,6 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit
|
|
|
3
3
|
import { EXTENSION_MENU_ITEM_TEST_ID } from '@atlaskit/editor-common/block-menu';
|
|
4
4
|
import { ToolbarDropdownItemSection, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
5
5
|
import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { useSelectionExtensionComponentContext } from '../SelectionExtensionComponentContext';
|
|
8
7
|
import { SelectionExtensionDropdownItem } from './SelectionExtensionDropdownItem';
|
|
9
8
|
var ChildItems = function ChildItems(_ref) {
|
|
@@ -53,8 +52,8 @@ export var SelectionExtensionNestedDropdownMenu = function SelectionExtensionNes
|
|
|
53
52
|
}),
|
|
54
53
|
onClick: handleClick,
|
|
55
54
|
dropdownTestId: "editor-selection-extension-menu",
|
|
56
|
-
shouldTitleWrap:
|
|
57
|
-
tooltipContent:
|
|
55
|
+
shouldTitleWrap: false,
|
|
56
|
+
tooltipContent: nestedDropdownMenu.label
|
|
58
57
|
}, /*#__PURE__*/React.createElement(ChildItems, {
|
|
59
58
|
nestedDropdownMenu: nestedDropdownMenu
|
|
60
59
|
}));
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { APPS_SECTION, OVERFLOW_EXTENSIONS_MENU_SECTION, useEditorToolbar } from '@atlaskit/editor-common/toolbar';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { SelectionExtensionMenuItems } from '../menu/SelectionExtensionMenuItems';
|
|
5
4
|
import { SelectionExtensionComponentContextProvider } from '../SelectionExtensionComponentContext';
|
|
6
|
-
import { MenuItem } from './MenuItem';
|
|
7
5
|
import { ToolbarButton } from './ToolbarButton';
|
|
8
6
|
import { ToolbarMenu } from './ToolbarMenu';
|
|
9
7
|
var EXTENSION_RANK_MULTIPLIER = 100;
|
|
@@ -107,11 +105,6 @@ export var registerInlineToolbar = function registerInlineToolbar(_ref2) {
|
|
|
107
105
|
}]
|
|
108
106
|
});
|
|
109
107
|
}
|
|
110
|
-
|
|
111
|
-
// Remove ExtensionMenuSectionConfiguration - only care about items
|
|
112
|
-
var menuItems = fg('platform_editor_block_menu_v2_patch_1') ? [] : getMenuItems().filter(function (item) {
|
|
113
|
-
return 'label' in item && 'icon' in item;
|
|
114
|
-
});
|
|
115
108
|
components.push({
|
|
116
109
|
type: 'menu-item',
|
|
117
110
|
key: key,
|
|
@@ -122,13 +115,10 @@ export var registerInlineToolbar = function registerInlineToolbar(_ref2) {
|
|
|
122
115
|
rank: (index + 1) * EXTENSION_RANK_MULTIPLIER
|
|
123
116
|
}],
|
|
124
117
|
component: function component() {
|
|
125
|
-
return
|
|
118
|
+
return /*#__PURE__*/React.createElement(InlineToolbarMenuItemComponent, {
|
|
126
119
|
api: api,
|
|
127
120
|
extension: extension,
|
|
128
121
|
getMenuItems: getMenuItems
|
|
129
|
-
}) : /*#__PURE__*/React.createElement(MenuItem, {
|
|
130
|
-
api: api,
|
|
131
|
-
extensionMenuItems: menuItems
|
|
132
122
|
});
|
|
133
123
|
}
|
|
134
124
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { SelectionExtensionPlugin } from '../selectionExtensionPluginType';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { selectionExtensionPlugin } from '../selectionExtensionPlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { BlockMenuExtensionConfiguration, ExtensionConfiguration, ExtensionMenuItemConfiguration, ExtensionToolbarItemConfiguration, InsertAdfAtEndOfDocResult, LinkInsertionOption, ReplaceWithAdfResult, SelectionExtension, SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtensionPluginState, SelectionExtensionSelectionInfo, ToolbarExtensionConfiguration, SelectionAdfResult, SelectionExtensionCallbackOptions, SelectionRange, } from '../types/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { SelectionExtensionPlugin } from '../selectionExtensionPluginType';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { selectionExtensionPlugin } from '../selectionExtensionPlugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { BlockMenuExtensionConfiguration, ExtensionConfiguration, ExtensionMenuItemConfiguration, ExtensionToolbarItemConfiguration, InsertAdfAtEndOfDocResult, LinkInsertionOption, ReplaceWithAdfResult, SelectionExtension, SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtensionPluginState, SelectionExtensionSelectionInfo, ToolbarExtensionConfiguration, SelectionAdfResult, SelectionExtensionCallbackOptions, SelectionRange, } from '../types/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-selection-extension",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,28 +38,28 @@
|
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^10.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-block-controls": "^11.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-block-menu": "^9.1.0",
|
|
41
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^12.
|
|
42
|
-
"@atlaskit/editor-plugin-editor-viewmode-effects": "^10.
|
|
43
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^11.
|
|
44
|
-
"@atlaskit/editor-plugin-selection-toolbar": "^11.
|
|
45
|
-
"@atlaskit/editor-plugin-toolbar": "^7.
|
|
46
|
-
"@atlaskit/editor-plugin-user-preferences": "^8.
|
|
41
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^12.1.0",
|
|
42
|
+
"@atlaskit/editor-plugin-editor-viewmode-effects": "^10.1.0",
|
|
43
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^11.1.0",
|
|
44
|
+
"@atlaskit/editor-plugin-selection-toolbar": "^11.3.0",
|
|
45
|
+
"@atlaskit/editor-plugin-toolbar": "^7.3.0",
|
|
46
|
+
"@atlaskit/editor-plugin-user-preferences": "^8.2.0",
|
|
47
47
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
50
|
-
"@atlaskit/editor-toolbar": "^1.
|
|
50
|
+
"@atlaskit/editor-toolbar": "^1.2.0",
|
|
51
51
|
"@atlaskit/icon": "^34.5.0",
|
|
52
52
|
"@atlaskit/lozenge": "^13.8.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
54
54
|
"@atlaskit/primitives": "^19.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^80.0.0",
|
|
56
56
|
"@atlaskit/tokens": "^13.0.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
59
59
|
"uuid": "^3.1.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@atlaskit/editor-common": "^114.
|
|
62
|
+
"@atlaskit/editor-common": "^114.30.0",
|
|
63
63
|
"react": "^18.2.0",
|
|
64
64
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
65
65
|
},
|
|
@@ -114,12 +114,6 @@
|
|
|
114
114
|
"platform_editor_selection_extension_improvement": {
|
|
115
115
|
"type": "boolean"
|
|
116
116
|
},
|
|
117
|
-
"platform_editor_block_menu_v2_patch_1": {
|
|
118
|
-
"type": "boolean"
|
|
119
|
-
},
|
|
120
|
-
"platform_editor_block_menu_v2_patch_2": {
|
|
121
|
-
"type": "boolean"
|
|
122
|
-
},
|
|
123
117
|
"platform_editor_block_menu_v2_patch_5": {
|
|
124
118
|
"type": "boolean"
|
|
125
119
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-selection-extension/selection-extension-plugin",
|
|
3
|
+
"main": "../dist/cjs/entry-points/selection-extension-plugin.js",
|
|
4
|
+
"module": "../dist/esm/entry-points/selection-extension-plugin.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/entry-points/selection-extension-plugin.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../dist/types/entry-points/selection-extension-plugin.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../dist/types-ts4.5/entry-points/selection-extension-plugin.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-selection-extension/selection-extension-plugin-type",
|
|
3
|
+
"main": "../dist/cjs/entry-points/selection-extension-plugin-type.js",
|
|
4
|
+
"module": "../dist/esm/entry-points/selection-extension-plugin-type.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/entry-points/selection-extension-plugin-type.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../dist/types/entry-points/selection-extension-plugin-type.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../dist/types-ts4.5/entry-points/selection-extension-plugin-type.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-selection-extension/types",
|
|
3
|
+
"main": "../dist/cjs/entry-points/types.js",
|
|
4
|
+
"module": "../dist/esm/entry-points/types.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|