@atlaskit/editor-plugin-insert-block 30.0.5 → 31.0.1
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 +15 -0
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -2
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertButton.js +2 -2
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenu.compiled.css +1 -0
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenu.js +113 -238
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuContent.js +1 -4
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertButton.js +1 -1
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenu.compiled.css +1 -0
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenu.js +97 -204
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuContent.js +1 -4
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertButton.js +1 -1
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenu.compiled.css +1 -0
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenu.js +115 -240
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuContent.js +1 -4
- package/dist/types/ui/registered-insert-menu/RegisteredInsertMenu.d.ts +5 -7
- package/package.json +32 -32
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuItem.js +0 -64
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuList.compiled.css +0 -11
- package/dist/cjs/ui/registered-insert-menu/RegisteredInsertMenuList.js +0 -324
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuItem.js +0 -54
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuList.compiled.css +0 -11
- package/dist/es2019/ui/registered-insert-menu/RegisteredInsertMenuList.js +0 -273
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuItem.js +0 -56
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuList.compiled.css +0 -11
- package/dist/esm/ui/registered-insert-menu/RegisteredInsertMenuList.js +0 -317
- package/dist/types/ui/registered-insert-menu/RegisteredInsertMenuItem.d.ts +0 -16
- package/dist/types/ui/registered-insert-menu/RegisteredInsertMenuList.d.ts +0 -31
|
@@ -1,242 +1,135 @@
|
|
|
1
1
|
/* RegisteredInsertMenu.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./RegisteredInsertMenu.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { useCallback,
|
|
4
|
+
import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
|
-
import {
|
|
7
|
-
import { toolbarInsertBlockMessages
|
|
6
|
+
import { insertSelectedItem } from '@atlaskit/editor-common/insert';
|
|
7
|
+
import { toolbarInsertBlockMessages } from '@atlaskit/editor-common/messages/insert-block';
|
|
8
8
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { TYPE_AHEAD_SURFACE_CONTEXT } from '@atlaskit/editor-common/type-ahead-surface-context';
|
|
13
|
-
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
|
|
9
|
+
import { RegisteredMenuContext } from '@atlaskit/editor-common/registered-menu/context';
|
|
10
|
+
import { createRegisteredMenuSurfaceContext } from '@atlaskit/editor-common/registered-menu/surface-context';
|
|
11
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
14
12
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
15
13
|
import Textfield from '@atlaskit/textfield/text-field';
|
|
16
|
-
import { RegisteredInsertMenuList } from './RegisteredInsertMenuList';
|
|
17
14
|
const DEFAULT_MENU_MAX_HEIGHT = 520;
|
|
15
|
+
const SEARCH_HEIGHT = 64;
|
|
18
16
|
const styles = {
|
|
19
17
|
menu: "_2rko1mok _1reo15vq _18m915vq _bfhk1bhr _16qs130s _1e0c1txw _2lx21bp4 _1bsb1edt",
|
|
18
|
+
hidden: "_1e0cglyw",
|
|
20
19
|
search: "_18zrutpp _1o9zidpf _1q51utpp _85i5u2gc"
|
|
21
20
|
};
|
|
22
|
-
export const RegisteredInsertMenu =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
onClose,
|
|
31
|
-
onSelect
|
|
32
|
-
}) => {
|
|
33
|
-
const menuStyle = {
|
|
34
|
-
maxHeight
|
|
35
|
-
};
|
|
21
|
+
export const RegisteredInsertMenu = props => {
|
|
22
|
+
var _props$maxHeight, _interaction$expanded;
|
|
23
|
+
const {
|
|
24
|
+
components,
|
|
25
|
+
editorView,
|
|
26
|
+
isOffline,
|
|
27
|
+
onSelect
|
|
28
|
+
} = props;
|
|
36
29
|
const {
|
|
37
30
|
formatMessage
|
|
38
31
|
} = useIntl();
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const [renderedItems, setRenderedItems] = useState({
|
|
45
|
-
startIndex: -1,
|
|
46
|
-
stopIndex: -1
|
|
47
|
-
});
|
|
32
|
+
const [interaction, setInteraction] = useState();
|
|
33
|
+
const registerInteraction = useCallback(next => {
|
|
34
|
+
setInteraction(next);
|
|
35
|
+
return () => setInteraction(current => current === next ? undefined : current);
|
|
36
|
+
}, []);
|
|
48
37
|
const searchRef = useRef(null);
|
|
38
|
+
const hasInteraction = Boolean(interaction);
|
|
49
39
|
useLayoutEffect(() => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
getItemRank,
|
|
66
|
-
query,
|
|
67
|
-
rootComponent: MENU,
|
|
68
|
-
selectCategoryItems: hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined,
|
|
69
|
-
surfaceContext
|
|
70
|
-
}), [components, formatMessage, getItemRank, hasSectionOverflowItems, query, surfaceContext]);
|
|
71
|
-
const [previewActivation, setPreviewActivation] = useState();
|
|
72
|
-
const activePreviewItemKey = (previewActivation === null || previewActivation === void 0 ? void 0 : previewActivation.model) === model ? previewActivation.itemKey : undefined;
|
|
73
|
-
const searchResultCount = useMemo(() => model.sections.reduce((count, section) => count + section.filter(({
|
|
74
|
-
key,
|
|
75
|
-
type
|
|
76
|
-
}) => type === 'menu-item' && !isSectionOverflowItemKey(key)).length, 0), [model.sections]);
|
|
77
|
-
const flushSearchAnalytics = useQuickInsertSearchAnalytics({
|
|
78
|
-
fireAnalyticsEvent,
|
|
79
|
-
query,
|
|
80
|
-
resultCount: searchResultCount,
|
|
40
|
+
if (hasInteraction) {
|
|
41
|
+
var _searchRef$current;
|
|
42
|
+
(_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.focus({
|
|
43
|
+
preventScroll: true
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}, [hasInteraction]);
|
|
47
|
+
const maxHeight = (_props$maxHeight = props.maxHeight) !== null && _props$maxHeight !== void 0 ? _props$maxHeight : DEFAULT_MENU_MAX_HEIGHT;
|
|
48
|
+
const menuStyle = useMemo(() => ({
|
|
49
|
+
maxHeight
|
|
50
|
+
}), [maxHeight]);
|
|
51
|
+
const [menuOpenId] = useState(() => Symbol('registered-insert-menu-open'));
|
|
52
|
+
const [query, setQuery] = useState('');
|
|
53
|
+
const surfaceContext = useMemo(() => createRegisteredMenuSurfaceContext({
|
|
54
|
+
menuOpenId,
|
|
81
55
|
surface: 'toolbar'
|
|
82
|
-
});
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
56
|
+
}), [menuOpenId]);
|
|
57
|
+
const Root = useMemo(() => {
|
|
58
|
+
var _components$find;
|
|
59
|
+
return (_components$find = components.find(({
|
|
60
|
+
key,
|
|
61
|
+
type,
|
|
62
|
+
parents
|
|
63
|
+
}) => key === MENU.key && type === MENU.type && !(parents !== null && parents !== void 0 && parents.length))) === null || _components$find === void 0 ? void 0 : _components$find.component;
|
|
64
|
+
}, [components]);
|
|
65
|
+
// Interaction updates should not recreate the registered component's own props.
|
|
66
|
+
const menu = useMemo(() => Root && /*#__PURE__*/React.createElement(Root, null, null), [Root]);
|
|
67
|
+
const select = useCallback(selection => {
|
|
89
68
|
onSelect();
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
selectedItemIndexRef.current = initialItemIndex;
|
|
99
|
-
setSelectedItemIndex(initialItemIndex);
|
|
100
|
-
}, [itemCount, query, selectableItemKeys]);
|
|
101
|
-
useLayoutEffect(() => {
|
|
102
|
-
setPreviewActivation(undefined);
|
|
103
|
-
}, [model, query]);
|
|
104
|
-
const isActiveItemMounted = selectedItemIndex >= 0 && selectedItemIndex < itemCount && (selectedItemIndex >= renderedItems.startIndex && selectedItemIndex <= renderedItems.stopIndex || Boolean(model.footer) && selectedItemIndex === itemCount - 1);
|
|
105
|
-
const activeItemId = `${listId}-${selectedItemIndex}`;
|
|
106
|
-
const setKeyboardPreview = useCallback(itemIndex => {
|
|
107
|
-
const item = selectableItems[itemIndex];
|
|
108
|
-
setPreviewActivation(item ? {
|
|
109
|
-
itemKey: item.key,
|
|
110
|
-
model,
|
|
111
|
-
source: 'keyboard'
|
|
112
|
-
} : undefined);
|
|
113
|
-
}, [model, selectableItems]);
|
|
114
|
-
const selectNextItem = useCallback(() => {
|
|
115
|
-
const currentIndex = selectedItemIndexRef.current;
|
|
116
|
-
const nextIndex = itemCount === 0 ? -1 : currentIndex < 0 ? 0 : (currentIndex + 1) % itemCount;
|
|
117
|
-
selectedItemIndexRef.current = nextIndex;
|
|
118
|
-
setSelectedItemIndex(nextIndex);
|
|
119
|
-
setKeyboardPreview(nextIndex);
|
|
120
|
-
}, [itemCount, setKeyboardPreview]);
|
|
121
|
-
const selectPreviousItem = useCallback(() => {
|
|
122
|
-
const currentIndex = selectedItemIndexRef.current;
|
|
123
|
-
const previousIndex = itemCount === 0 ? -1 : currentIndex <= 0 ? itemCount - 1 : currentIndex - 1;
|
|
124
|
-
selectedItemIndexRef.current = previousIndex;
|
|
125
|
-
setSelectedItemIndex(previousIndex);
|
|
126
|
-
setKeyboardPreview(previousIndex);
|
|
127
|
-
}, [itemCount, setKeyboardPreview]);
|
|
128
|
-
const onItemHover = useCallback((itemIndex, itemKey) => {
|
|
129
|
-
selectedItemIndexRef.current = itemIndex;
|
|
130
|
-
setSelectedItemIndex(itemIndex);
|
|
131
|
-
setPreviewActivation(current => {
|
|
132
|
-
if ((current === null || current === void 0 ? void 0 : current.itemKey) === itemKey && (current === null || current === void 0 ? void 0 : current.model) === model && (current === null || current === void 0 ? void 0 : current.source) === 'pointer') {
|
|
133
|
-
return current;
|
|
134
|
-
}
|
|
135
|
-
return itemKey ? {
|
|
136
|
-
itemKey,
|
|
137
|
-
model,
|
|
138
|
-
source: 'pointer'
|
|
139
|
-
} : undefined;
|
|
140
|
-
});
|
|
141
|
-
}, [model]);
|
|
142
|
-
const onItemFocus = useCallback((itemIndex, itemKey) => {
|
|
143
|
-
selectedItemIndexRef.current = itemIndex;
|
|
144
|
-
setSelectedItemIndex(itemIndex);
|
|
145
|
-
setPreviewActivation(current => {
|
|
146
|
-
if ((current === null || current === void 0 ? void 0 : current.itemKey) === itemKey && (current === null || current === void 0 ? void 0 : current.model) === model) {
|
|
147
|
-
return current;
|
|
69
|
+
queueMicrotask(() => {
|
|
70
|
+
const {
|
|
71
|
+
state
|
|
72
|
+
} = editorView;
|
|
73
|
+
const insert = (content, options = {}) => insertSelectedItem(content, options)(state, state.tr, state.selection.head);
|
|
74
|
+
const transaction = selection(insert);
|
|
75
|
+
if (transaction) {
|
|
76
|
+
editorView.dispatch(transaction);
|
|
148
77
|
}
|
|
149
|
-
return itemKey ? {
|
|
150
|
-
itemKey,
|
|
151
|
-
model,
|
|
152
|
-
source: 'keyboard'
|
|
153
|
-
} : undefined;
|
|
154
78
|
});
|
|
155
|
-
}, [
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
(_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : (_getDocument$getEleme = _getDocument.getElementById(activeItemId)) === null || _getDocument$getEleme === void 0 ? void 0 : _getDocument$getEleme.click();
|
|
171
|
-
}
|
|
172
|
-
}, [activeItemId, isActiveItemMounted]);
|
|
173
|
-
const onQueryChange = useCallback(event => {
|
|
174
|
-
setQuery(event.currentTarget.value);
|
|
175
|
-
}, []);
|
|
79
|
+
}, [editorView, onSelect]);
|
|
80
|
+
const registeredMenu = useMemo(() => ({
|
|
81
|
+
components,
|
|
82
|
+
onClose: props.onClose,
|
|
83
|
+
maxHeight: Math.max(0, maxHeight - SEARCH_HEIGHT),
|
|
84
|
+
registerInteraction,
|
|
85
|
+
editorView,
|
|
86
|
+
isOffline,
|
|
87
|
+
menuOpenId,
|
|
88
|
+
rootComponent: MENU,
|
|
89
|
+
query,
|
|
90
|
+
select,
|
|
91
|
+
surfaceContext
|
|
92
|
+
}), [components, props.onClose, maxHeight, registerInteraction, editorView, isOffline, menuOpenId, query, select, surfaceContext]);
|
|
93
|
+
const onQueryChange = useCallback(event => setQuery(event.currentTarget.value), []);
|
|
176
94
|
const onKeyDown = useCallback(event => {
|
|
177
95
|
if (event.key === 'Escape') {
|
|
96
|
+
var _interaction$onClose;
|
|
178
97
|
event.preventDefault();
|
|
179
|
-
|
|
98
|
+
interaction === null || interaction === void 0 ? void 0 : (_interaction$onClose = interaction.onClose) === null || _interaction$onClose === void 0 ? void 0 : _interaction$onClose.call(interaction);
|
|
99
|
+
props.onClose();
|
|
180
100
|
return;
|
|
181
101
|
}
|
|
182
|
-
|
|
183
|
-
//
|
|
184
|
-
|
|
185
|
-
// to retain their native keyboard behaviour.
|
|
186
|
-
if (event.target !== searchRef.current) {
|
|
102
|
+
// Some IME key events report 229 without setting isComposing. Let the input finish
|
|
103
|
+
// composing text before handling menu navigation or selection.
|
|
104
|
+
if (event.target !== searchRef.current || event.nativeEvent.isComposing || event.keyCode === 229) {
|
|
187
105
|
return;
|
|
188
106
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
event.preventDefault();
|
|
192
|
-
selectNextItem();
|
|
193
|
-
break;
|
|
194
|
-
case 'ArrowUp':
|
|
195
|
-
event.preventDefault();
|
|
196
|
-
selectPreviousItem();
|
|
197
|
-
break;
|
|
198
|
-
case 'Enter':
|
|
199
|
-
event.preventDefault();
|
|
200
|
-
selectActiveItem();
|
|
201
|
-
break;
|
|
107
|
+
if (interaction !== null && interaction !== void 0 && interaction.onKeyDown(event.nativeEvent)) {
|
|
108
|
+
event.preventDefault();
|
|
202
109
|
}
|
|
203
|
-
}, [
|
|
204
|
-
return /*#__PURE__*/React.createElement(
|
|
205
|
-
|
|
206
|
-
|
|
110
|
+
}, [interaction, props.onClose]);
|
|
111
|
+
return /*#__PURE__*/React.createElement(RegisteredMenuContext.Provider, {
|
|
112
|
+
value: registeredMenu
|
|
113
|
+
}, Root && /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
"data-registered-insert-menu-root": "",
|
|
207
115
|
onKeyDownCapture: onKeyDown,
|
|
208
|
-
|
|
209
|
-
|
|
116
|
+
"data-keyboard-navigation-independent": "",
|
|
117
|
+
"data-testid": "registered-insert-menu",
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- The popup supplies the available height at runtime.
|
|
119
|
+
style: menuStyle,
|
|
120
|
+
className: ax([styles.menu, !interaction && styles.hidden])
|
|
210
121
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
211
122
|
xcss: styles.search
|
|
212
123
|
}, /*#__PURE__*/React.createElement(Textfield, {
|
|
213
|
-
"aria-
|
|
214
|
-
"aria-
|
|
215
|
-
"aria-
|
|
216
|
-
|
|
124
|
+
"aria-label": (interaction === null || interaction === void 0 ? void 0 : interaction.label) || formatMessage(toolbarInsertBlockMessages.insertMenu),
|
|
125
|
+
"aria-activedescendant": interaction === null || interaction === void 0 ? void 0 : interaction.activeDescendantId,
|
|
126
|
+
"aria-controls": interaction === null || interaction === void 0 ? void 0 : interaction.listId,
|
|
127
|
+
"aria-expanded": (_interaction$expanded = interaction === null || interaction === void 0 ? void 0 : interaction.expanded) !== null && _interaction$expanded !== void 0 ? _interaction$expanded : false,
|
|
128
|
+
"aria-autocomplete": "list",
|
|
129
|
+
placeholder: formatMessage(typeAheadListMessages.quickInsertInputPlaceholderLabel),
|
|
217
130
|
ref: searchRef,
|
|
218
131
|
role: "combobox",
|
|
219
132
|
value: query,
|
|
220
133
|
onChange: onQueryChange
|
|
221
|
-
})),
|
|
222
|
-
editorView: editorView,
|
|
223
|
-
emptyStateHandler: emptyStateHandler,
|
|
224
|
-
isOffline: isOffline,
|
|
225
|
-
listId: listId,
|
|
226
|
-
listLabel: formatMessage(messages.insertMenu),
|
|
227
|
-
maxHeight: maxHeight,
|
|
228
|
-
menuOpenId: menuOpenId,
|
|
229
|
-
model: model,
|
|
230
|
-
onClose: selectWithAnalytics,
|
|
231
|
-
onItemFocus: onItemFocus,
|
|
232
|
-
onItemHover: onItemHover,
|
|
233
|
-
onItemBlur: onItemBlur,
|
|
234
|
-
onItemLeave: onItemLeave,
|
|
235
|
-
onItemVisibilityChange: onItemVisibilityChange,
|
|
236
|
-
onRenderedItemsChange: setRenderedItems,
|
|
237
|
-
query: query,
|
|
238
|
-
selectedItemIndex: selectedItemIndex,
|
|
239
|
-
surfaceContext: surfaceContext,
|
|
240
|
-
activePreviewItemKey: activePreviewItemKey
|
|
241
|
-
}));
|
|
134
|
+
})), menu));
|
|
242
135
|
};
|
|
@@ -24,7 +24,7 @@ export const RegisteredInsertMenuContent = ({
|
|
|
24
24
|
onSelect,
|
|
25
25
|
target
|
|
26
26
|
}) => {
|
|
27
|
-
var _api$uiControlRegistr2, _api$uiControlRegistr3
|
|
27
|
+
var _api$uiControlRegistr2, _api$uiControlRegistr3;
|
|
28
28
|
const getComponents = useCallback(() => {
|
|
29
29
|
var _api$uiControlRegistr;
|
|
30
30
|
const components = api === null || api === void 0 ? void 0 : (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 ? void 0 : _api$uiControlRegistr.actions.getComponents(MENU.key);
|
|
@@ -42,9 +42,6 @@ export const RegisteredInsertMenuContent = ({
|
|
|
42
42
|
}, /*#__PURE__*/React.createElement(RegisteredInsertMenu, {
|
|
43
43
|
components: components,
|
|
44
44
|
editorView: editorView,
|
|
45
|
-
emptyStateHandler: api === null || api === void 0 ? void 0 : (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : (_api$quickInsert$shar = _api$quickInsert.sharedState.currentState()) === null || _api$quickInsert$shar === void 0 ? void 0 : _api$quickInsert$shar.emptyStateHandler,
|
|
46
|
-
fireAnalyticsEvent: api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent,
|
|
47
|
-
getItemRank: api === null || api === void 0 ? void 0 : (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : (_api$quickInsert2$sha = _api$quickInsert2.sharedState.currentState()) === null || _api$quickInsert2$sha === void 0 ? void 0 : _api$quickInsert2$sha.getItemRank,
|
|
48
45
|
isOffline: isOffline,
|
|
49
46
|
maxHeight: maxHeight,
|
|
50
47
|
onClose: onClose,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import Popup from '@atlaskit/editor-common/Popup';
|
|
3
|
-
import { useMenuPopupSizing } from '@atlaskit/editor-common/
|
|
3
|
+
import { useMenuPopupSizing } from '@atlaskit/editor-common/registered-menu/popup-sizing';
|
|
4
4
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
5
5
|
import InsertMenu, { DEFAULT_HEIGHT } from '../ElementBrowser/InsertMenu';
|
|
6
6
|
import { RegisteredInsertMenuContent } from '../registered-insert-menu/RegisteredInsertMenuContent';
|
|
@@ -5,7 +5,7 @@ import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMod
|
|
|
5
5
|
import { getAriaKeyshortcuts, insertElements, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
7
7
|
import Popup from '@atlaskit/editor-common/Popup';
|
|
8
|
-
import { useMenuPopupSizing } from '@atlaskit/editor-common/
|
|
8
|
+
import { useMenuPopupSizing } from '@atlaskit/editor-common/registered-menu/popup-sizing';
|
|
9
9
|
import { useEditorToolbar } from '@atlaskit/editor-common/toolbar/context';
|
|
10
10
|
import { TOOLBAR_BUTTON_TEST_ID } from '@atlaskit/editor-common/toolbar/keys';
|
|
11
11
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|