@atlaskit/editor-plugin-type-ahead 14.0.1 → 14.0.3
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 +14 -0
- package/dist/cjs/ui/registered-menu/RegisteredTypeAheadMenu.compiled.css +6 -0
- package/dist/cjs/ui/registered-menu/RegisteredTypeAheadMenu.js +62 -45
- package/dist/cjs/ui/registered-menu/TypeAheadItemRow.js +7 -5
- package/dist/cjs/ui/registered-menu/TypeAheadMenuFooter.compiled.css +3 -0
- package/dist/cjs/ui/registered-menu/TypeAheadMenuFooter.js +30 -0
- package/dist/cjs/ui/registered-menu/TypeAheadMenuRenderer.js +141 -0
- package/dist/cjs/ui/registered-menu/TypeAheadSectionRow.js +15 -0
- package/dist/cjs/ui/registered-menu/buildTypeAheadMenuModel.js +34 -16
- package/dist/cjs/ui/registered-menu/createTypeAheadRowRenderer.js +62 -0
- package/dist/cjs/ui/registered-menu/getTypeAheadGlobalViewMoreId.js +9 -0
- package/dist/cjs/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.js +7 -11
- package/dist/es2019/ui/registered-menu/RegisteredTypeAheadMenu.compiled.css +6 -0
- package/dist/es2019/ui/registered-menu/RegisteredTypeAheadMenu.js +47 -37
- package/dist/es2019/ui/registered-menu/TypeAheadItemRow.js +7 -5
- package/dist/es2019/ui/registered-menu/TypeAheadMenuFooter.compiled.css +3 -0
- package/dist/es2019/ui/registered-menu/TypeAheadMenuFooter.js +22 -0
- package/dist/es2019/ui/registered-menu/TypeAheadMenuRenderer.js +109 -0
- package/dist/es2019/ui/registered-menu/TypeAheadSectionRow.js +9 -0
- package/dist/es2019/ui/registered-menu/buildTypeAheadMenuModel.js +29 -8
- package/dist/es2019/ui/registered-menu/createTypeAheadRowRenderer.js +54 -0
- package/dist/es2019/ui/registered-menu/getTypeAheadGlobalViewMoreId.js +1 -0
- package/dist/es2019/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.js +5 -6
- package/dist/esm/ui/registered-menu/RegisteredTypeAheadMenu.compiled.css +6 -0
- package/dist/esm/ui/registered-menu/RegisteredTypeAheadMenu.js +62 -45
- package/dist/esm/ui/registered-menu/TypeAheadItemRow.js +7 -5
- package/dist/esm/ui/registered-menu/TypeAheadMenuFooter.compiled.css +3 -0
- package/dist/esm/ui/registered-menu/TypeAheadMenuFooter.js +23 -0
- package/dist/esm/ui/registered-menu/TypeAheadMenuRenderer.js +132 -0
- package/dist/esm/ui/registered-menu/TypeAheadSectionRow.js +8 -0
- package/dist/esm/ui/registered-menu/buildTypeAheadMenuModel.js +33 -16
- package/dist/esm/ui/registered-menu/createTypeAheadRowRenderer.js +55 -0
- package/dist/esm/ui/registered-menu/getTypeAheadGlobalViewMoreId.js +3 -0
- package/dist/esm/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.js +7 -10
- package/dist/types/ui/registered-menu/RegisteredTypeAheadMenu.d.ts +2 -1
- package/dist/types/ui/registered-menu/TypeAheadItemRow.d.ts +2 -1
- package/dist/types/ui/registered-menu/TypeAheadMenuFooter.d.ts +10 -0
- package/dist/types/ui/registered-menu/TypeAheadMenuRenderer.d.ts +15 -0
- package/dist/types/ui/registered-menu/TypeAheadSectionRow.d.ts +5 -0
- package/dist/types/ui/registered-menu/buildTypeAheadMenuModel.d.ts +5 -3
- package/dist/types/ui/registered-menu/createTypeAheadRowRenderer.d.ts +13 -0
- package/dist/types/ui/registered-menu/getTypeAheadGlobalViewMoreId.d.ts +1 -0
- package/dist/types/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.d.ts +1 -1
- package/dist/types/ui/registered-menu/typeAheadMenuTypes.d.ts +0 -1
- package/package.json +5 -3
|
@@ -1,23 +1,32 @@
|
|
|
1
|
+
/* RegisteredTypeAheadMenu.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import "./RegisteredTypeAheadMenu.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
2
5
|
import React, { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import {
|
|
6
|
+
import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
|
|
4
7
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
5
8
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
6
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
10
|
import { InputQuery } from '../InputQuery';
|
|
8
11
|
import { buildTypeAheadMenuModel } from './buildTypeAheadMenuModel';
|
|
12
|
+
import { getTypeAheadGlobalViewMoreId } from './getTypeAheadGlobalViewMoreId';
|
|
9
13
|
import { getTypeAheadItemId } from './getTypeAheadItemId';
|
|
10
|
-
import {
|
|
11
|
-
import { TypeAheadItemRow } from './TypeAheadItemRow';
|
|
14
|
+
import { TypeAheadMenuRenderer } from './TypeAheadMenuRenderer';
|
|
12
15
|
import { TypeAheadProvider } from './TypeAheadProvider';
|
|
16
|
+
var styles = {
|
|
17
|
+
menu: "_2rko12b0 _1reo15vq _18m915vq _1rjc1b66 _bfhk1bhr _16qs130s _1bsb5x59"
|
|
18
|
+
};
|
|
19
|
+
var DEFAULT_MENU_MAX_HEIGHT = 520;
|
|
13
20
|
var POPUP_OFFSET = [0, 8];
|
|
21
|
+
var SECTION_OVERFLOW_LIMIT = 30;
|
|
14
22
|
export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
|
|
15
|
-
var _model$root$component, _model$root;
|
|
16
23
|
var anchorElement = _ref.anchorElement,
|
|
17
24
|
api = _ref.api,
|
|
18
25
|
cancel = _ref.cancel,
|
|
19
26
|
editorView = _ref.editorView,
|
|
20
27
|
forceFocus = _ref.forceFocus,
|
|
28
|
+
_ref$maxHeight = _ref.maxHeight,
|
|
29
|
+
maxHeight = _ref$maxHeight === void 0 ? DEFAULT_MENU_MAX_HEIGHT : _ref$maxHeight,
|
|
21
30
|
onClose = _ref.onClose,
|
|
22
31
|
onUndoRedo = _ref.onUndoRedo,
|
|
23
32
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
@@ -28,7 +37,6 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
|
|
|
28
37
|
setQuery = _ref.setQuery,
|
|
29
38
|
surface = _ref.surface,
|
|
30
39
|
triggerHandler = _ref.triggerHandler;
|
|
31
|
-
var intl = useIntl();
|
|
32
40
|
var generatedId = useId();
|
|
33
41
|
var listId = "".concat(surface.listIdPrefix, "-").concat(generatedId);
|
|
34
42
|
var menuRef = useRef(null);
|
|
@@ -40,39 +48,55 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
|
|
|
40
48
|
var _api$uiControlRegistr, _api$uiControlRegistr2;
|
|
41
49
|
return (_api$uiControlRegistr = api === null || api === void 0 || (_api$uiControlRegistr2 = api.uiControlRegistry) === null || _api$uiControlRegistr2 === void 0 ? void 0 : _api$uiControlRegistr2.actions.getComponents(surface.root.key)) !== null && _api$uiControlRegistr !== void 0 ? _api$uiControlRegistr : [];
|
|
42
50
|
}, [api, surface.root.key]);
|
|
43
|
-
var
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
var hasSectionOverflowItems = useMemo(function () {
|
|
52
|
+
return components.some(function (_ref2) {
|
|
53
|
+
var key = _ref2.key;
|
|
54
|
+
return isSectionOverflowItemKey(key);
|
|
55
|
+
});
|
|
56
|
+
}, [components]);
|
|
57
|
+
var menuModel = useMemo(function () {
|
|
58
|
+
return buildTypeAheadMenuModel(components, surface.root, hasSectionOverflowItems ? SECTION_OVERFLOW_LIMIT : undefined);
|
|
59
|
+
}, [components, hasSectionOverflowItems, surface.root]);
|
|
60
|
+
var rows = useMemo(function () {
|
|
61
|
+
return menuModel.sections.flat();
|
|
62
|
+
}, [menuModel.sections]);
|
|
63
|
+
var selectableRowIndexes = useMemo(function () {
|
|
64
|
+
return rows.flatMap(function (registration, rowIndex) {
|
|
65
|
+
return registration.type === 'menu-item' ? [rowIndex] : [];
|
|
66
|
+
});
|
|
67
|
+
}, [rows]);
|
|
68
|
+
var selectableRowKeys = selectableRowIndexes.map(function (index) {
|
|
69
|
+
var _rows$index;
|
|
70
|
+
return (_rows$index = rows[index]) === null || _rows$index === void 0 ? void 0 : _rows$index.key;
|
|
49
71
|
}).join(',');
|
|
72
|
+
var selectableItemCount = selectableRowIndexes.length + (menuModel.footer ? 1 : 0);
|
|
50
73
|
useLayoutEffect(function () {
|
|
51
|
-
setSelectedItemIndex(
|
|
52
|
-
}, [
|
|
74
|
+
setSelectedItemIndex(selectableItemCount > 0 ? 0 : -1);
|
|
75
|
+
}, [query, selectableItemCount, selectableRowKeys]);
|
|
53
76
|
var selectActiveItem = useCallback(function (_mode) {
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
var rowIndex = selectableRowIndexes[selectedItemIndex];
|
|
78
|
+
var selectedId = rowIndex !== undefined ? getTypeAheadItemId(listId, rowIndex) : menuModel.footer && selectedItemIndex === selectableRowIndexes.length ? getTypeAheadGlobalViewMoreId(listId) : undefined;
|
|
79
|
+
if (selectedId) {
|
|
80
|
+
var _menuRef$current;
|
|
81
|
+
(_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 || (_menuRef$current = _menuRef$current.ownerDocument.getElementById(selectedId)) === null || _menuRef$current === void 0 || _menuRef$current.click();
|
|
57
82
|
}
|
|
58
|
-
|
|
59
|
-
}, [listId, selectedItemIndex]);
|
|
83
|
+
}, [listId, menuModel.footer, selectableRowIndexes, selectedItemIndex]);
|
|
60
84
|
var selectNextItem = useCallback(function () {
|
|
61
85
|
setSelectedItemIndex(function (currentIndex) {
|
|
62
|
-
if (
|
|
86
|
+
if (selectableItemCount === 0) {
|
|
63
87
|
return -1;
|
|
64
88
|
}
|
|
65
|
-
return currentIndex < 0 || currentIndex ===
|
|
89
|
+
return currentIndex < 0 || currentIndex === selectableItemCount - 1 ? 0 : currentIndex + 1;
|
|
66
90
|
});
|
|
67
|
-
}, [
|
|
91
|
+
}, [selectableItemCount]);
|
|
68
92
|
var selectPreviousItem = useCallback(function () {
|
|
69
93
|
setSelectedItemIndex(function (currentIndex) {
|
|
70
|
-
if (
|
|
94
|
+
if (selectableItemCount === 0) {
|
|
71
95
|
return -1;
|
|
72
96
|
}
|
|
73
|
-
return currentIndex <= 0 ?
|
|
97
|
+
return currentIndex <= 0 ? selectableItemCount - 1 : currentIndex - 1;
|
|
74
98
|
});
|
|
75
|
-
}, [
|
|
99
|
+
}, [selectableItemCount]);
|
|
76
100
|
var typeAheadContextValue = useMemo(function () {
|
|
77
101
|
return {
|
|
78
102
|
api: api,
|
|
@@ -84,10 +108,9 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
|
|
|
84
108
|
};
|
|
85
109
|
}, [api, editorView, onClose, query, surface.inputMethod, triggerHandler]);
|
|
86
110
|
var noOp = useCallback(function () {}, []);
|
|
87
|
-
var RootComponent = (_model$root$component = (_model$root = model.root) === null || _model$root === void 0 ? void 0 : _model$root.component) !== null && _model$root$component !== void 0 ? _model$root$component : PassThrough;
|
|
88
111
|
var SurfaceProvider = surface.Provider;
|
|
89
112
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputQuery, {
|
|
90
|
-
activeDescendantId: selectedItemIndex
|
|
113
|
+
activeDescendantId: selectableRowIndexes[selectedItemIndex] !== undefined ? getTypeAheadItemId(listId, selectableRowIndexes[selectedItemIndex]) : menuModel.footer && selectedItemIndex === selectableRowIndexes.length ? getTypeAheadGlobalViewMoreId(listId) : undefined,
|
|
91
114
|
cancel: cancel,
|
|
92
115
|
editorView: editorView,
|
|
93
116
|
forceFocus: forceFocus,
|
|
@@ -96,7 +119,7 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
|
|
|
96
119
|
onQueryChange: setQuery,
|
|
97
120
|
onQueryFocus: noOp,
|
|
98
121
|
onUndoRedo: onUndoRedo,
|
|
99
|
-
optionCount:
|
|
122
|
+
optionCount: selectableItemCount,
|
|
100
123
|
reopenQuery: reopenQuery,
|
|
101
124
|
selectNextItem: selectNextItem,
|
|
102
125
|
selectPreviousItem: selectPreviousItem,
|
|
@@ -105,7 +128,8 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
|
|
|
105
128
|
}), /*#__PURE__*/React.createElement(Popup, {
|
|
106
129
|
ariaLabel: null,
|
|
107
130
|
boundariesElement: popupsBoundariesElement,
|
|
108
|
-
|
|
131
|
+
fitHeight: maxHeight,
|
|
132
|
+
fitWidth: 340,
|
|
109
133
|
mountTo: popupsMountPoint,
|
|
110
134
|
offset: POPUP_OFFSET,
|
|
111
135
|
preventOverflow: true,
|
|
@@ -114,24 +138,17 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
|
|
|
114
138
|
zIndex: akEditorFloatingDialogZIndex
|
|
115
139
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
116
140
|
ref: menuRef,
|
|
117
|
-
backgroundColor: "elevation.surface.overlay",
|
|
118
141
|
"data-registered-type-ahead-menu": "",
|
|
119
|
-
|
|
142
|
+
xcss: styles.menu
|
|
120
143
|
}, /*#__PURE__*/React.createElement(TypeAheadProvider, {
|
|
121
144
|
value: typeAheadContextValue
|
|
122
|
-
}, /*#__PURE__*/React.createElement(SurfaceProvider, null, /*#__PURE__*/React.createElement(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
key: "".concat(registration.type, ":").concat(registration.key),
|
|
132
|
-
listId: listId,
|
|
133
|
-
onItemHover: setSelectedItemIndex,
|
|
134
|
-
registration: registration
|
|
135
|
-
});
|
|
136
|
-
}))))))));
|
|
145
|
+
}, /*#__PURE__*/React.createElement(SurfaceProvider, null, /*#__PURE__*/React.createElement(TypeAheadMenuRenderer, {
|
|
146
|
+
Item: surface.Item,
|
|
147
|
+
listLabel: surface.listLabel,
|
|
148
|
+
listId: listId,
|
|
149
|
+
maxHeight: maxHeight,
|
|
150
|
+
model: menuModel,
|
|
151
|
+
onItemHover: setSelectedItemIndex,
|
|
152
|
+
selectedItemIndex: selectedItemIndex
|
|
153
|
+
}))))));
|
|
137
154
|
};
|
|
@@ -6,14 +6,16 @@ export var TypeAheadItemRow = function TypeAheadItemRow(_ref) {
|
|
|
6
6
|
Item = _ref.Item,
|
|
7
7
|
listId = _ref.listId,
|
|
8
8
|
onItemHover = _ref.onItemHover,
|
|
9
|
-
registration = _ref.registration
|
|
9
|
+
registration = _ref.registration,
|
|
10
|
+
rowIndex = _ref.rowIndex;
|
|
10
11
|
var onMouseMove = useCallback(function () {
|
|
11
12
|
return onItemHover(itemIndex);
|
|
12
13
|
}, [itemIndex, onItemHover]);
|
|
13
|
-
return /*#__PURE__*/React.createElement(
|
|
14
|
-
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
onMouseMove: onMouseMove
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Item, {
|
|
17
|
+
id: getTypeAheadItemId(listId, rowIndex),
|
|
15
18
|
isSelected: isSelected,
|
|
16
|
-
onMouseMove: onMouseMove,
|
|
17
19
|
registration: registration
|
|
18
|
-
});
|
|
20
|
+
}));
|
|
19
21
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* TypeAheadMenuFooter.tsx generated by @compiled/babel-plugin v2.0.0 */
|
|
2
|
+
import "./TypeAheadMenuFooter.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
6
|
+
var styles = {
|
|
7
|
+
footer: "_1rjc1b66 _1i531l7x _15a5nqa1 _uwhke4h9"
|
|
8
|
+
};
|
|
9
|
+
export var TypeAheadMenuFooter = function TypeAheadMenuFooter(_ref) {
|
|
10
|
+
var id = _ref.id,
|
|
11
|
+
isSelected = _ref.isSelected,
|
|
12
|
+
Item = _ref.Item,
|
|
13
|
+
onMouseMove = _ref.onMouseMove,
|
|
14
|
+
registration = _ref.registration;
|
|
15
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
16
|
+
onMouseMove: onMouseMove,
|
|
17
|
+
xcss: styles.footer
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Item, {
|
|
19
|
+
id: id,
|
|
20
|
+
isSelected: isSelected,
|
|
21
|
+
registration: registration
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
3
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
import React, { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
|
|
6
|
+
import { useIntl } from 'react-intl';
|
|
7
|
+
import { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
8
|
+
import { List } from 'react-virtualized/dist/commonjs/List';
|
|
9
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
10
|
+
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
11
|
+
import { createTypeAheadRowRenderer } from './createTypeAheadRowRenderer';
|
|
12
|
+
import { getTypeAheadGlobalViewMoreId } from './getTypeAheadGlobalViewMoreId';
|
|
13
|
+
import { PassThrough } from './PassThrough';
|
|
14
|
+
import { TypeAheadMenuFooter } from './TypeAheadMenuFooter';
|
|
15
|
+
var LIST_WIDTH = 340;
|
|
16
|
+
var ESTIMATED_ROW_HEIGHT = 56;
|
|
17
|
+
var MENU_FOOTER_HEIGHT = 48;
|
|
18
|
+
export var TypeAheadMenuRenderer = function TypeAheadMenuRenderer(_ref) {
|
|
19
|
+
var _model$root$component;
|
|
20
|
+
var Item = _ref.Item,
|
|
21
|
+
listLabel = _ref.listLabel,
|
|
22
|
+
listId = _ref.listId,
|
|
23
|
+
maxHeight = _ref.maxHeight,
|
|
24
|
+
model = _ref.model,
|
|
25
|
+
onItemHover = _ref.onItemHover,
|
|
26
|
+
selectedItemIndex = _ref.selectedItemIndex;
|
|
27
|
+
var intl = useIntl();
|
|
28
|
+
var listRef = useRef(null);
|
|
29
|
+
var rows = useMemo(function () {
|
|
30
|
+
return model.sections.flat();
|
|
31
|
+
}, [model.sections]);
|
|
32
|
+
var cache = useMemo(function () {
|
|
33
|
+
return new CellMeasurerCache({
|
|
34
|
+
defaultHeight: ESTIMATED_ROW_HEIGHT,
|
|
35
|
+
fixedWidth: true
|
|
36
|
+
});
|
|
37
|
+
}, []);
|
|
38
|
+
var itemIndexByRowIndex = useMemo(function () {
|
|
39
|
+
var indexes = new Map();
|
|
40
|
+
var itemIndex = 0;
|
|
41
|
+
rows.forEach(function (registration, rowIndex) {
|
|
42
|
+
if (registration.type === 'menu-item') {
|
|
43
|
+
indexes.set(rowIndex, itemIndex++);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return indexes;
|
|
47
|
+
}, [rows]);
|
|
48
|
+
var selectedRowIndex = useMemo(function () {
|
|
49
|
+
var _iterator = _createForOfIteratorHelper(itemIndexByRowIndex),
|
|
50
|
+
_step;
|
|
51
|
+
try {
|
|
52
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
53
|
+
var _step$value = _slicedToArray(_step.value, 2),
|
|
54
|
+
rowIndex = _step$value[0],
|
|
55
|
+
itemIndex = _step$value[1];
|
|
56
|
+
if (itemIndex === selectedItemIndex) {
|
|
57
|
+
return rowIndex;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
} catch (err) {
|
|
61
|
+
_iterator.e(err);
|
|
62
|
+
} finally {
|
|
63
|
+
_iterator.f();
|
|
64
|
+
}
|
|
65
|
+
return -1;
|
|
66
|
+
}, [itemIndexByRowIndex, selectedItemIndex]);
|
|
67
|
+
var rowKeySignature = useMemo(function () {
|
|
68
|
+
return rows.map(function (_ref2) {
|
|
69
|
+
var key = _ref2.key,
|
|
70
|
+
type = _ref2.type;
|
|
71
|
+
return "".concat(type, ":").concat(key);
|
|
72
|
+
}).join('\0');
|
|
73
|
+
}, [rows]);
|
|
74
|
+
useLayoutEffect(function () {
|
|
75
|
+
var _listRef$current, _listRef$current2;
|
|
76
|
+
cache.clearAll();
|
|
77
|
+
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.recomputeRowHeights();
|
|
78
|
+
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.scrollToPosition(0);
|
|
79
|
+
}, [cache, rowKeySignature]);
|
|
80
|
+
useLayoutEffect(function () {
|
|
81
|
+
if (selectedRowIndex >= 0) {
|
|
82
|
+
var _listRef$current3;
|
|
83
|
+
(_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 || _listRef$current3.scrollToRow(selectedRowIndex);
|
|
84
|
+
}
|
|
85
|
+
}, [selectedRowIndex]);
|
|
86
|
+
var renderRow = createTypeAheadRowRenderer({
|
|
87
|
+
cache: cache,
|
|
88
|
+
itemIndexByRowIndex: itemIndexByRowIndex,
|
|
89
|
+
Item: Item,
|
|
90
|
+
listId: listId,
|
|
91
|
+
onItemHover: onItemHover,
|
|
92
|
+
rows: rows,
|
|
93
|
+
selectedItemIndex: selectedItemIndex
|
|
94
|
+
});
|
|
95
|
+
var footerItemIndex = itemIndexByRowIndex.size;
|
|
96
|
+
var onFooterItemHover = useCallback(function () {
|
|
97
|
+
return onItemHover(footerItemIndex);
|
|
98
|
+
}, [footerItemIndex, onItemHover]);
|
|
99
|
+
if (!model.root) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
var RootComponent = (_model$root$component = model.root.component) !== null && _model$root$component !== void 0 ? _model$root$component : PassThrough;
|
|
103
|
+
var listMaxHeight = Math.max(0, maxHeight - (model.footer ? MENU_FOOTER_HEIGHT : 0));
|
|
104
|
+
return /*#__PURE__*/React.createElement(RootComponent, null, /*#__PURE__*/React.createElement(Box, {
|
|
105
|
+
"aria-label": intl.formatMessage(listLabel),
|
|
106
|
+
id: listId,
|
|
107
|
+
role: "listbox"
|
|
108
|
+
}, rows.length === 0 ? /*#__PURE__*/React.createElement(Box, {
|
|
109
|
+
paddingBlock: "space.150",
|
|
110
|
+
paddingInline: "space.250"
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
112
|
+
align: "center",
|
|
113
|
+
as: "p"
|
|
114
|
+
}, intl.formatMessage(typeAheadListMessages.emptySearchResults))) : /*#__PURE__*/React.createElement(List, {
|
|
115
|
+
containerRole: "presentation",
|
|
116
|
+
height: Math.min(rows.length * ESTIMATED_ROW_HEIGHT, listMaxHeight),
|
|
117
|
+
overscanRowCount: 3,
|
|
118
|
+
ref: listRef,
|
|
119
|
+
role: "presentation",
|
|
120
|
+
rowCount: rows.length,
|
|
121
|
+
rowHeight: cache.rowHeight,
|
|
122
|
+
rowRenderer: renderRow,
|
|
123
|
+
scrollToAlignment: "auto",
|
|
124
|
+
width: LIST_WIDTH
|
|
125
|
+
}), model.footer && /*#__PURE__*/React.createElement(TypeAheadMenuFooter, {
|
|
126
|
+
id: getTypeAheadGlobalViewMoreId(listId),
|
|
127
|
+
isSelected: selectedItemIndex === footerItemIndex,
|
|
128
|
+
Item: Item,
|
|
129
|
+
onMouseMove: onFooterItemHover,
|
|
130
|
+
registration: model.footer
|
|
131
|
+
})));
|
|
132
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PassThrough } from './PassThrough';
|
|
3
|
+
export var TypeAheadSectionRow = function TypeAheadSectionRow(_ref) {
|
|
4
|
+
var _registration$compone;
|
|
5
|
+
var registration = _ref.registration;
|
|
6
|
+
var Component = (_registration$compone = registration.component) !== null && _registration$compone !== void 0 ? _registration$compone : PassThrough;
|
|
7
|
+
return /*#__PURE__*/React.createElement(Component, null, null);
|
|
8
|
+
};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
3
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
|
+
import { isMenuFooterSectionKey } from '@atlaskit/editor-common/type-ahead-is-menu-footer-section-key';
|
|
6
|
+
import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
|
|
4
7
|
import { resolveSurface, willComponentRender } from '@atlaskit/editor-ui-control-model/surface-renderer';
|
|
5
|
-
export var buildTypeAheadMenuModel = function buildTypeAheadMenuModel(components, rootComponent) {
|
|
8
|
+
export var buildTypeAheadMenuModel = function buildTypeAheadMenuModel(components, rootComponent, sectionOverflowLimit) {
|
|
6
9
|
var _resolveSurface = resolveSurface(components, rootComponent),
|
|
7
10
|
root = _resolveSurface.root,
|
|
8
11
|
childrenMap = _resolveSurface.childrenMap,
|
|
9
12
|
topLevelChildren = _resolveSurface.topLevelChildren;
|
|
10
|
-
var
|
|
13
|
+
var sections = [];
|
|
14
|
+
var footer;
|
|
11
15
|
var _iterator = _createForOfIteratorHelper(topLevelChildren !== null && topLevelChildren !== void 0 ? topLevelChildren : []),
|
|
12
16
|
_step;
|
|
13
17
|
try {
|
|
@@ -17,20 +21,32 @@ export var buildTypeAheadMenuModel = function buildTypeAheadMenuModel(components
|
|
|
17
21
|
if (section.type !== 'menu-section' || !willComponentRender(section, childrenMap)) {
|
|
18
22
|
continue;
|
|
19
23
|
}
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
var children = (_childrenMap$get = childrenMap.get(section.key)) !== null && _childrenMap$get !== void 0 ? _childrenMap$get : [];
|
|
25
|
+
if (isMenuFooterSectionKey(section.key)) {
|
|
26
|
+
footer = children.find(function (child) {
|
|
27
|
+
return child.type === 'menu-item' && willComponentRender(child, childrenMap);
|
|
28
|
+
});
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
var viewMoreItem = void 0;
|
|
32
|
+
for (var index = children.length - 1; index >= 0; index--) {
|
|
33
|
+
var child = children[index];
|
|
34
|
+
if ((child === null || child === void 0 ? void 0 : child.type) === 'menu-item' && isSectionOverflowItemKey(child.key) && willComponentRender(child, childrenMap)) {
|
|
35
|
+
viewMoreItem = child;
|
|
36
|
+
break;
|
|
28
37
|
}
|
|
29
|
-
} catch (err) {
|
|
30
|
-
_iterator2.e(err);
|
|
31
|
-
} finally {
|
|
32
|
-
_iterator2.f();
|
|
33
38
|
}
|
|
39
|
+
var items = children.filter(function (child) {
|
|
40
|
+
return child.type === 'menu-item' && !isSectionOverflowItemKey(child.key) && willComponentRender(child, childrenMap);
|
|
41
|
+
});
|
|
42
|
+
if (items.length === 0) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (sectionOverflowLimit !== undefined && viewMoreItem !== undefined && items.length > sectionOverflowLimit) {
|
|
46
|
+
sections.push([section].concat(_toConsumableArray(items.slice(0, sectionOverflowLimit)), [viewMoreItem]));
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
sections.push([section].concat(_toConsumableArray(items)));
|
|
34
50
|
}
|
|
35
51
|
} catch (err) {
|
|
36
52
|
_iterator.e(err);
|
|
@@ -38,7 +54,8 @@ export var buildTypeAheadMenuModel = function buildTypeAheadMenuModel(components
|
|
|
38
54
|
_iterator.f();
|
|
39
55
|
}
|
|
40
56
|
return {
|
|
41
|
-
|
|
42
|
-
root: root
|
|
57
|
+
footer: footer,
|
|
58
|
+
root: root,
|
|
59
|
+
sections: sections
|
|
43
60
|
};
|
|
44
61
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CellMeasurer } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
3
|
+
import { ListRow } from '../ListRow';
|
|
4
|
+
import { TypeAheadItemRow } from './TypeAheadItemRow';
|
|
5
|
+
import { TypeAheadSectionRow } from './TypeAheadSectionRow';
|
|
6
|
+
var noOp = function noOp() {};
|
|
7
|
+
export var createTypeAheadRowRenderer = function createTypeAheadRowRenderer(_ref) {
|
|
8
|
+
var cache = _ref.cache,
|
|
9
|
+
itemIndexByRowIndex = _ref.itemIndexByRowIndex,
|
|
10
|
+
Item = _ref.Item,
|
|
11
|
+
listId = _ref.listId,
|
|
12
|
+
onItemHover = _ref.onItemHover,
|
|
13
|
+
rows = _ref.rows,
|
|
14
|
+
selectedItemIndex = _ref.selectedItemIndex;
|
|
15
|
+
return function (_ref2) {
|
|
16
|
+
var index = _ref2.index,
|
|
17
|
+
key = _ref2.key,
|
|
18
|
+
parent = _ref2.parent,
|
|
19
|
+
style = _ref2.style,
|
|
20
|
+
isScrolling = _ref2.isScrolling,
|
|
21
|
+
isVisible = _ref2.isVisible;
|
|
22
|
+
var registration = rows[index];
|
|
23
|
+
if (!registration) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var itemIndex = itemIndexByRowIndex.get(index);
|
|
27
|
+
return /*#__PURE__*/React.createElement(CellMeasurer, {
|
|
28
|
+
key: key,
|
|
29
|
+
cache: cache,
|
|
30
|
+
parent: parent,
|
|
31
|
+
columnIndex: 0,
|
|
32
|
+
rowIndex: index
|
|
33
|
+
}, function (_ref3) {
|
|
34
|
+
var measure = _ref3.measure;
|
|
35
|
+
return /*#__PURE__*/React.createElement(ListRow, {
|
|
36
|
+
index: index,
|
|
37
|
+
isScrolling: isScrolling,
|
|
38
|
+
isVisible: isVisible,
|
|
39
|
+
measure: measure,
|
|
40
|
+
onMouseMove: noOp,
|
|
41
|
+
style: style
|
|
42
|
+
}, registration.type === 'menu-section' ? /*#__PURE__*/React.createElement(TypeAheadSectionRow, {
|
|
43
|
+
registration: registration
|
|
44
|
+
}) : /*#__PURE__*/React.createElement(TypeAheadItemRow, {
|
|
45
|
+
Item: Item,
|
|
46
|
+
isSelected: itemIndex === selectedItemIndex,
|
|
47
|
+
itemIndex: itemIndex !== null && itemIndex !== void 0 ? itemIndex : 0,
|
|
48
|
+
listId: listId,
|
|
49
|
+
onItemHover: onItemHover,
|
|
50
|
+
registration: registration,
|
|
51
|
+
rowIndex: index
|
|
52
|
+
}));
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
1
|
import React, { useMemo } from 'react';
|
|
5
2
|
import { QuickInsertProvider } from '@atlaskit/editor-common/quick-insert/provider';
|
|
6
3
|
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
@@ -9,19 +6,19 @@ export var TypeAheadQuickInsertItem = function TypeAheadQuickInsertItem(_ref) {
|
|
|
9
6
|
var _registration$compone;
|
|
10
7
|
var id = _ref.id,
|
|
11
8
|
isSelected = _ref.isSelected,
|
|
12
|
-
onMouseMove = _ref.onMouseMove,
|
|
13
9
|
registration = _ref.registration;
|
|
14
10
|
var quickInsertContext = useQuickInsertContext();
|
|
15
11
|
var Component = (_registration$compone = registration.component) !== null && _registration$compone !== void 0 ? _registration$compone : PassThrough;
|
|
16
12
|
var contextValue = useMemo(function () {
|
|
17
|
-
return
|
|
13
|
+
return {
|
|
14
|
+
editorView: quickInsertContext.editorView,
|
|
18
15
|
item: {
|
|
19
16
|
id: id,
|
|
20
|
-
isSelected: isSelected
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
}, [id, isSelected,
|
|
17
|
+
isSelected: isSelected
|
|
18
|
+
},
|
|
19
|
+
select: quickInsertContext.select
|
|
20
|
+
};
|
|
21
|
+
}, [id, isSelected, quickInsertContext]);
|
|
25
22
|
return /*#__PURE__*/React.createElement(QuickInsertProvider, {
|
|
26
23
|
value: contextValue
|
|
27
24
|
}, /*#__PURE__*/React.createElement(Component, null, null));
|
|
@@ -15,6 +15,7 @@ type Props = {
|
|
|
15
15
|
}) => void;
|
|
16
16
|
editorView: EditorView;
|
|
17
17
|
forceFocus: boolean;
|
|
18
|
+
maxHeight?: number;
|
|
18
19
|
onClose: () => void;
|
|
19
20
|
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
|
|
20
21
|
popupsBoundariesElement?: HTMLElement;
|
|
@@ -26,5 +27,5 @@ type Props = {
|
|
|
26
27
|
surface: TypeAheadSurface;
|
|
27
28
|
triggerHandler: TypeAheadHandler;
|
|
28
29
|
};
|
|
29
|
-
export declare const RegisteredTypeAheadMenu: ({ anchorElement, api, cancel, editorView, forceFocus, onClose, onUndoRedo, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, query, reopenQuery, setQuery, surface, triggerHandler, }: Props) => React.JSX.Element;
|
|
30
|
+
export declare const RegisteredTypeAheadMenu: ({ anchorElement, api, cancel, editorView, forceFocus, maxHeight, onClose, onUndoRedo, popupsBoundariesElement, popupsMountPoint, popupsScrollableElement, query, reopenQuery, setQuery, surface, triggerHandler, }: Props) => React.JSX.Element;
|
|
30
31
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
3
3
|
import type { TypeAheadItemComponent } from './typeAheadMenuTypes';
|
|
4
|
-
export declare const TypeAheadItemRow: ({ isSelected, itemIndex, Item, listId, onItemHover, registration, }: {
|
|
4
|
+
export declare const TypeAheadItemRow: ({ isSelected, itemIndex, Item, listId, onItemHover, registration, rowIndex, }: {
|
|
5
5
|
isSelected: boolean;
|
|
6
6
|
Item: TypeAheadItemComponent;
|
|
7
7
|
itemIndex: number;
|
|
8
8
|
listId: string;
|
|
9
9
|
onItemHover: (itemIndex: number) => void;
|
|
10
10
|
registration: RegisterMenuItem;
|
|
11
|
+
rowIndex: number;
|
|
11
12
|
}) => React.JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
3
|
+
import type { TypeAheadItemComponent } from './typeAheadMenuTypes';
|
|
4
|
+
export declare const TypeAheadMenuFooter: ({ id, isSelected, Item, onMouseMove, registration, }: {
|
|
5
|
+
id: string;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
Item: TypeAheadItemComponent;
|
|
8
|
+
onMouseMove: () => void;
|
|
9
|
+
registration: RegisterMenuItem;
|
|
10
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MessageDescriptor } from 'react-intl';
|
|
3
|
+
import type { TypeAheadMenuModel } from './buildTypeAheadMenuModel';
|
|
4
|
+
import type { TypeAheadItemComponent } from './typeAheadMenuTypes';
|
|
5
|
+
type Props = {
|
|
6
|
+
Item: TypeAheadItemComponent;
|
|
7
|
+
listId: string;
|
|
8
|
+
listLabel: MessageDescriptor;
|
|
9
|
+
maxHeight: number;
|
|
10
|
+
model: TypeAheadMenuModel;
|
|
11
|
+
onItemHover: (itemIndex: number) => void;
|
|
12
|
+
selectedItemIndex: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const TypeAheadMenuRenderer: ({ Item, listLabel, listId, maxHeight, model, onItemHover, selectedItemIndex, }: Props) => React.JSX.Element | null;
|
|
15
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { SurfaceIdentifier } from '@atlaskit/editor-ui-control-model/surface-renderer/types';
|
|
2
|
-
import type { RegisterComponent, RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
2
|
+
import type { RegisterComponent, RegisterMenuItem, RegisterMenuSection } from '@atlaskit/editor-ui-control-model/types';
|
|
3
|
+
export type TypeAheadMenuSection = [RegisterMenuSection, ...RegisterMenuItem[]];
|
|
3
4
|
export type TypeAheadMenuModel = {
|
|
4
|
-
|
|
5
|
+
footer: RegisterMenuItem | undefined;
|
|
5
6
|
root: RegisterComponent | undefined;
|
|
7
|
+
sections: TypeAheadMenuSection[];
|
|
6
8
|
};
|
|
7
|
-
export declare const buildTypeAheadMenuModel: (components: RegisterComponent[], rootComponent: SurfaceIdentifier) => TypeAheadMenuModel;
|
|
9
|
+
export declare const buildTypeAheadMenuModel: (components: RegisterComponent[], rootComponent: SurfaceIdentifier, sectionOverflowLimit?: number) => TypeAheadMenuModel;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
2
|
+
import type { ListRowRenderer } from 'react-virtualized/dist/commonjs/List';
|
|
3
|
+
import type { RegisterMenuItem, RegisterMenuSection } from '@atlaskit/editor-ui-control-model/types';
|
|
4
|
+
import type { TypeAheadItemComponent } from './typeAheadMenuTypes';
|
|
5
|
+
export declare const createTypeAheadRowRenderer: ({ cache, itemIndexByRowIndex, Item, listId, onItemHover, rows, selectedItemIndex, }: {
|
|
6
|
+
cache: CellMeasurerCache;
|
|
7
|
+
Item: TypeAheadItemComponent;
|
|
8
|
+
itemIndexByRowIndex: Map<number, number>;
|
|
9
|
+
listId: string;
|
|
10
|
+
onItemHover: (itemIndex: number) => void;
|
|
11
|
+
rows: Array<RegisterMenuItem | RegisterMenuSection>;
|
|
12
|
+
selectedItemIndex: number;
|
|
13
|
+
}) => ListRowRenderer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTypeAheadGlobalViewMoreId: (listId: string) => string;
|