@atlaskit/editor-plugin-block-controls 7.2.5 → 7.2.6
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 +8 -0
- package/dist/cjs/ui/block-menu.js +10 -64
- package/dist/es2019/ui/block-menu.js +10 -65
- package/dist/esm/ui/block-menu.js +10 -64
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 7.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0b4cd77e72217`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0b4cd77e72217) -
|
|
8
|
+
clean up references to platform_editor_controls_performance_fixes
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 7.2.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
11
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
12
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
14
|
var _blockMenuItems = require("./block-menu-items");
|
|
16
15
|
var _consts = require("./consts");
|
|
17
16
|
var _domAttrName = require("./utils/dom-attr-name");
|
|
@@ -95,70 +94,17 @@ var BlockMenu = function BlockMenu(_ref3) {
|
|
|
95
94
|
if (isMenuOpen) {
|
|
96
95
|
return null;
|
|
97
96
|
}
|
|
98
|
-
if (
|
|
99
|
-
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
return /*#__PURE__*/_react.default.createElement(BlockMenuContent, {
|
|
103
|
-
editorView: editorView,
|
|
104
|
-
mountPoint: mountPoint,
|
|
105
|
-
boundariesElement: boundariesElement,
|
|
106
|
-
scrollableElement: scrollableElement,
|
|
107
|
-
api: api,
|
|
108
|
-
menuTriggerBy: menuTriggerBy,
|
|
109
|
-
formatMessage: formatMessage
|
|
110
|
-
});
|
|
97
|
+
if (!menuTriggerBy) {
|
|
98
|
+
return null;
|
|
111
99
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var handleOpenChange = function handleOpenChange(payload) {
|
|
116
|
-
if (!(payload !== null && payload !== void 0 && payload.isOpen)) {
|
|
117
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
|
|
118
|
-
closeMenu: true
|
|
119
|
-
}));
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
var onMenuItemActivated = function onMenuItemActivated(_ref4) {
|
|
123
|
-
var item = _ref4.item;
|
|
124
|
-
if (editorView) {
|
|
125
|
-
var _menuItemsCallback2, _menuItemsCallback2$c;
|
|
126
|
-
(_menuItemsCallback2 = _blockMenuItems.menuItemsCallback[item.value.name]) === null || _menuItemsCallback2 === void 0 || (_menuItemsCallback2$c = _menuItemsCallback2.call(_blockMenuItems.menuItemsCallback, api, formatMessage)) === null || _menuItemsCallback2$c === void 0 || _menuItemsCallback2$c(editorView.state, editorView.dispatch, editorView);
|
|
127
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
|
|
128
|
-
closeMenu: true
|
|
129
|
-
}));
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
133
|
-
alignX: 'left',
|
|
134
|
-
alignY: 'start'
|
|
135
|
-
// Ignored via go/ees005
|
|
136
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
137
|
-
,
|
|
138
|
-
target: targetHandleRef,
|
|
139
|
-
mountTo: undefined,
|
|
140
|
-
zIndex: _editorSharedStyles.akEditorFloatingOverlapPanelZIndex,
|
|
141
|
-
forcePlacement: true,
|
|
142
|
-
stick: true,
|
|
143
|
-
offset: [-6, 8]
|
|
144
|
-
}, /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenu, {
|
|
145
|
-
mountTo: mountPoint,
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(BlockMenuContent, {
|
|
101
|
+
editorView: editorView,
|
|
102
|
+
mountPoint: mountPoint,
|
|
146
103
|
boundariesElement: boundariesElement,
|
|
147
|
-
scrollableElement: scrollableElement
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
type: _uiMenu.ArrowKeyNavigationType.MENU
|
|
153
|
-
},
|
|
154
|
-
items: items,
|
|
155
|
-
isOpen: true,
|
|
156
|
-
fitWidth: _consts.BLOCK_MENU_WIDTH,
|
|
157
|
-
section: {
|
|
158
|
-
hasSeparator: true
|
|
159
|
-
},
|
|
160
|
-
onOpenChange: handleOpenChange,
|
|
161
|
-
onItemActivated: onMenuItemActivated
|
|
162
|
-
}));
|
|
104
|
+
scrollableElement: scrollableElement,
|
|
105
|
+
api: api,
|
|
106
|
+
menuTriggerBy: menuTriggerBy,
|
|
107
|
+
formatMessage: formatMessage
|
|
108
|
+
});
|
|
163
109
|
};
|
|
164
110
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(BlockMenu);
|
|
@@ -4,7 +4,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
4
4
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
6
6
|
import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { getBlockMenuItems, menuItemsCallback } from './block-menu-items';
|
|
9
8
|
import { BLOCK_MENU_WIDTH } from './consts';
|
|
10
9
|
import { getAnchorAttrName } from './utils/dom-attr-name';
|
|
@@ -93,71 +92,17 @@ const BlockMenu = ({
|
|
|
93
92
|
if (isMenuOpen) {
|
|
94
93
|
return null;
|
|
95
94
|
}
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
return /*#__PURE__*/React.createElement(BlockMenuContent, {
|
|
101
|
-
editorView: editorView,
|
|
102
|
-
mountPoint: mountPoint,
|
|
103
|
-
boundariesElement: boundariesElement,
|
|
104
|
-
scrollableElement: scrollableElement,
|
|
105
|
-
api: api,
|
|
106
|
-
menuTriggerBy: menuTriggerBy,
|
|
107
|
-
formatMessage: formatMessage
|
|
108
|
-
});
|
|
95
|
+
if (!menuTriggerBy) {
|
|
96
|
+
return null;
|
|
109
97
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const handleOpenChange = payload => {
|
|
114
|
-
if (!(payload !== null && payload !== void 0 && payload.isOpen)) {
|
|
115
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
|
|
116
|
-
closeMenu: true
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
const onMenuItemActivated = ({
|
|
121
|
-
item
|
|
122
|
-
}) => {
|
|
123
|
-
if (editorView) {
|
|
124
|
-
var _menuItemsCallback2, _menuItemsCallback2$c;
|
|
125
|
-
(_menuItemsCallback2 = menuItemsCallback[item.value.name]) === null || _menuItemsCallback2 === void 0 ? void 0 : (_menuItemsCallback2$c = _menuItemsCallback2.call(menuItemsCallback, api, formatMessage)) === null || _menuItemsCallback2$c === void 0 ? void 0 : _menuItemsCallback2$c(editorView.state, editorView.dispatch, editorView);
|
|
126
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
|
|
127
|
-
closeMenu: true
|
|
128
|
-
}));
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
return /*#__PURE__*/React.createElement(Popup, {
|
|
132
|
-
alignX: 'left',
|
|
133
|
-
alignY: 'start'
|
|
134
|
-
// Ignored via go/ees005
|
|
135
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
136
|
-
,
|
|
137
|
-
target: targetHandleRef,
|
|
138
|
-
mountTo: undefined,
|
|
139
|
-
zIndex: akEditorFloatingOverlapPanelZIndex,
|
|
140
|
-
forcePlacement: true,
|
|
141
|
-
stick: true,
|
|
142
|
-
offset: [-6, 8]
|
|
143
|
-
}, /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
144
|
-
mountTo: mountPoint,
|
|
98
|
+
return /*#__PURE__*/React.createElement(BlockMenuContent, {
|
|
99
|
+
editorView: editorView,
|
|
100
|
+
mountPoint: mountPoint,
|
|
145
101
|
boundariesElement: boundariesElement,
|
|
146
|
-
scrollableElement: scrollableElement
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
type: ArrowKeyNavigationType.MENU
|
|
152
|
-
},
|
|
153
|
-
items: items,
|
|
154
|
-
isOpen: true,
|
|
155
|
-
fitWidth: BLOCK_MENU_WIDTH,
|
|
156
|
-
section: {
|
|
157
|
-
hasSeparator: true
|
|
158
|
-
},
|
|
159
|
-
onOpenChange: handleOpenChange,
|
|
160
|
-
onItemActivated: onMenuItemActivated
|
|
161
|
-
}));
|
|
102
|
+
scrollableElement: scrollableElement,
|
|
103
|
+
api: api,
|
|
104
|
+
menuTriggerBy: menuTriggerBy,
|
|
105
|
+
formatMessage: formatMessage
|
|
106
|
+
});
|
|
162
107
|
};
|
|
163
108
|
export default injectIntl(BlockMenu);
|
|
@@ -4,7 +4,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
4
4
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
6
6
|
import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { getBlockMenuItems, menuItemsCallback } from './block-menu-items';
|
|
9
8
|
import { BLOCK_MENU_WIDTH } from './consts';
|
|
10
9
|
import { getAnchorAttrName } from './utils/dom-attr-name';
|
|
@@ -87,70 +86,17 @@ var BlockMenu = function BlockMenu(_ref3) {
|
|
|
87
86
|
if (isMenuOpen) {
|
|
88
87
|
return null;
|
|
89
88
|
}
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
return /*#__PURE__*/React.createElement(BlockMenuContent, {
|
|
95
|
-
editorView: editorView,
|
|
96
|
-
mountPoint: mountPoint,
|
|
97
|
-
boundariesElement: boundariesElement,
|
|
98
|
-
scrollableElement: scrollableElement,
|
|
99
|
-
api: api,
|
|
100
|
-
menuTriggerBy: menuTriggerBy,
|
|
101
|
-
formatMessage: formatMessage
|
|
102
|
-
});
|
|
89
|
+
if (!menuTriggerBy) {
|
|
90
|
+
return null;
|
|
103
91
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
var handleOpenChange = function handleOpenChange(payload) {
|
|
108
|
-
if (!(payload !== null && payload !== void 0 && payload.isOpen)) {
|
|
109
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
|
|
110
|
-
closeMenu: true
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
var onMenuItemActivated = function onMenuItemActivated(_ref4) {
|
|
115
|
-
var item = _ref4.item;
|
|
116
|
-
if (editorView) {
|
|
117
|
-
var _menuItemsCallback2, _menuItemsCallback2$c;
|
|
118
|
-
(_menuItemsCallback2 = menuItemsCallback[item.value.name]) === null || _menuItemsCallback2 === void 0 || (_menuItemsCallback2$c = _menuItemsCallback2.call(menuItemsCallback, api, formatMessage)) === null || _menuItemsCallback2$c === void 0 || _menuItemsCallback2$c(editorView.state, editorView.dispatch, editorView);
|
|
119
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 ? void 0 : api.blockControls.commands.toggleBlockMenu({
|
|
120
|
-
closeMenu: true
|
|
121
|
-
}));
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
return /*#__PURE__*/React.createElement(Popup, {
|
|
125
|
-
alignX: 'left',
|
|
126
|
-
alignY: 'start'
|
|
127
|
-
// Ignored via go/ees005
|
|
128
|
-
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
129
|
-
,
|
|
130
|
-
target: targetHandleRef,
|
|
131
|
-
mountTo: undefined,
|
|
132
|
-
zIndex: akEditorFloatingOverlapPanelZIndex,
|
|
133
|
-
forcePlacement: true,
|
|
134
|
-
stick: true,
|
|
135
|
-
offset: [-6, 8]
|
|
136
|
-
}, /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
137
|
-
mountTo: mountPoint,
|
|
92
|
+
return /*#__PURE__*/React.createElement(BlockMenuContent, {
|
|
93
|
+
editorView: editorView,
|
|
94
|
+
mountPoint: mountPoint,
|
|
138
95
|
boundariesElement: boundariesElement,
|
|
139
|
-
scrollableElement: scrollableElement
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
type: ArrowKeyNavigationType.MENU
|
|
145
|
-
},
|
|
146
|
-
items: items,
|
|
147
|
-
isOpen: true,
|
|
148
|
-
fitWidth: BLOCK_MENU_WIDTH,
|
|
149
|
-
section: {
|
|
150
|
-
hasSeparator: true
|
|
151
|
-
},
|
|
152
|
-
onOpenChange: handleOpenChange,
|
|
153
|
-
onItemActivated: onMenuItemActivated
|
|
154
|
-
}));
|
|
96
|
+
scrollableElement: scrollableElement,
|
|
97
|
+
api: api,
|
|
98
|
+
menuTriggerBy: menuTriggerBy,
|
|
99
|
+
formatMessage: formatMessage
|
|
100
|
+
});
|
|
155
101
|
};
|
|
156
102
|
export default injectIntl(BlockMenu);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.6",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@atlaskit/adf-schema": "^51.2.0",
|
|
32
32
|
"@atlaskit/editor-plugin-accessibility-utils": "^6.0.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^6.1.0",
|
|
34
|
-
"@atlaskit/editor-plugin-editor-disabled": "^6.
|
|
34
|
+
"@atlaskit/editor-plugin-editor-disabled": "^6.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-interaction": "^8.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-limited-mode": "^3.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-metrics": "^7.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-quick-insert": "^6.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-selection": "^6.1.0",
|
|
41
|
-
"@atlaskit/editor-plugin-type-ahead": "^6.
|
|
41
|
+
"@atlaskit/editor-plugin-type-ahead": "^6.4.0",
|
|
42
42
|
"@atlaskit/editor-plugin-user-intent": "^4.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-width": "^7.0.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
53
53
|
"@atlaskit/primitives": "^14.15.0",
|
|
54
54
|
"@atlaskit/theme": "^21.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^13.9.0",
|
|
56
56
|
"@atlaskit/tokens": "^6.4.0",
|
|
57
57
|
"@atlaskit/tooltip": "^20.5.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"uuid": "^3.1.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@atlaskit/editor-common": "^110.
|
|
67
|
+
"@atlaskit/editor-common": "^110.10.0",
|
|
68
68
|
"react": "^18.2.0",
|
|
69
69
|
"react-dom": "^18.2.0",
|
|
70
70
|
"react-intl-next": "npm:react-intl@^5.18.1"
|