@atlaskit/editor-plugin-type-ahead 30.0.4 → 31.0.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 +15 -0
- package/dist/cjs/pm-plugins/commands/insert-type-ahead-item.js +4 -8
- package/dist/cjs/ui/ContentComponent.js +1 -2
- package/dist/cjs/ui/InputQuery.js +49 -21
- package/dist/cjs/ui/WrapperTypeAhead.js +4 -5
- package/dist/cjs/ui/registered-menu/RegisteredTypeAheadMenu.js +128 -227
- package/dist/es2019/pm-plugins/commands/insert-type-ahead-item.js +3 -7
- package/dist/es2019/ui/ContentComponent.js +1 -2
- package/dist/es2019/ui/InputQuery.js +44 -16
- package/dist/es2019/ui/WrapperTypeAhead.js +4 -5
- package/dist/es2019/ui/registered-menu/RegisteredTypeAheadMenu.js +112 -200
- package/dist/esm/pm-plugins/commands/insert-type-ahead-item.js +4 -8
- package/dist/esm/ui/ContentComponent.js +1 -2
- package/dist/esm/ui/InputQuery.js +49 -21
- package/dist/esm/ui/WrapperTypeAhead.js +4 -5
- package/dist/esm/ui/registered-menu/RegisteredTypeAheadMenu.js +129 -228
- package/dist/types/pm-plugins/commands/insert-type-ahead-item.d.ts +4 -4
- package/dist/types/ui/InputQuery.d.ts +4 -1
- package/dist/types/ui/registered-menu/RegisteredTypeAheadMenu.d.ts +2 -3
- package/package.json +9 -9
- package/dist/cjs/ui/registered-menu/PassThrough.js +0 -10
- package/dist/cjs/ui/registered-menu/TypeAheadContext.js +0 -8
- package/dist/cjs/ui/registered-menu/TypeAheadItemRow.js +0 -48
- package/dist/cjs/ui/registered-menu/TypeAheadMenuFooter.compiled.css +0 -3
- package/dist/cjs/ui/registered-menu/TypeAheadMenuFooter.js +0 -33
- package/dist/cjs/ui/registered-menu/TypeAheadMenuRenderer.js +0 -167
- package/dist/cjs/ui/registered-menu/TypeAheadProvider.js +0 -8
- package/dist/cjs/ui/registered-menu/TypeAheadSectionRow.js +0 -15
- package/dist/cjs/ui/registered-menu/buildTypeAheadMenuModel.js +0 -5
- package/dist/cjs/ui/registered-menu/createTypeAheadRowRenderer.js +0 -76
- package/dist/cjs/ui/registered-menu/getTypeAheadGlobalViewMoreId.js +0 -9
- package/dist/cjs/ui/registered-menu/getTypeAheadItemId.js +0 -9
- package/dist/cjs/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.js +0 -40
- package/dist/cjs/ui/registered-menu/quick-insert/TypeAheadQuickInsertProvider.js +0 -66
- package/dist/cjs/ui/registered-menu/typeAheadMenuTypes.js +0 -5
- package/dist/cjs/ui/registered-menu/typeAheadSurfaces.js +0 -27
- package/dist/cjs/ui/registered-menu/useTypeAheadContext.js +0 -15
- package/dist/es2019/ui/registered-menu/PassThrough.js +0 -3
- package/dist/es2019/ui/registered-menu/TypeAheadContext.js +0 -2
- package/dist/es2019/ui/registered-menu/TypeAheadItemRow.js +0 -35
- package/dist/es2019/ui/registered-menu/TypeAheadMenuFooter.compiled.css +0 -3
- package/dist/es2019/ui/registered-menu/TypeAheadMenuFooter.js +0 -24
- package/dist/es2019/ui/registered-menu/TypeAheadMenuRenderer.js +0 -134
- package/dist/es2019/ui/registered-menu/TypeAheadProvider.js +0 -2
- package/dist/es2019/ui/registered-menu/TypeAheadSectionRow.js +0 -9
- package/dist/es2019/ui/registered-menu/buildTypeAheadMenuModel.js +0 -1
- package/dist/es2019/ui/registered-menu/createTypeAheadRowRenderer.js +0 -67
- package/dist/es2019/ui/registered-menu/getTypeAheadGlobalViewMoreId.js +0 -1
- package/dist/es2019/ui/registered-menu/getTypeAheadItemId.js +0 -1
- package/dist/es2019/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.js +0 -31
- package/dist/es2019/ui/registered-menu/quick-insert/TypeAheadQuickInsertProvider.js +0 -58
- package/dist/es2019/ui/registered-menu/typeAheadMenuTypes.js +0 -1
- package/dist/es2019/ui/registered-menu/typeAheadSurfaces.js +0 -21
- package/dist/es2019/ui/registered-menu/useTypeAheadContext.js +0 -9
- package/dist/esm/ui/registered-menu/PassThrough.js +0 -4
- package/dist/esm/ui/registered-menu/TypeAheadContext.js +0 -2
- package/dist/esm/ui/registered-menu/TypeAheadItemRow.js +0 -40
- package/dist/esm/ui/registered-menu/TypeAheadMenuFooter.compiled.css +0 -3
- package/dist/esm/ui/registered-menu/TypeAheadMenuFooter.js +0 -26
- package/dist/esm/ui/registered-menu/TypeAheadMenuRenderer.js +0 -158
- package/dist/esm/ui/registered-menu/TypeAheadProvider.js +0 -2
- package/dist/esm/ui/registered-menu/TypeAheadSectionRow.js +0 -8
- package/dist/esm/ui/registered-menu/buildTypeAheadMenuModel.js +0 -1
- package/dist/esm/ui/registered-menu/createTypeAheadRowRenderer.js +0 -69
- package/dist/esm/ui/registered-menu/getTypeAheadGlobalViewMoreId.js +0 -3
- package/dist/esm/ui/registered-menu/getTypeAheadItemId.js +0 -3
- package/dist/esm/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.js +0 -32
- package/dist/esm/ui/registered-menu/quick-insert/TypeAheadQuickInsertProvider.js +0 -58
- package/dist/esm/ui/registered-menu/typeAheadMenuTypes.js +0 -1
- package/dist/esm/ui/registered-menu/typeAheadSurfaces.js +0 -21
- package/dist/esm/ui/registered-menu/useTypeAheadContext.js +0 -9
- package/dist/types/ui/registered-menu/PassThrough.d.ts +0 -2
- package/dist/types/ui/registered-menu/TypeAheadContext.d.ts +0 -20
- package/dist/types/ui/registered-menu/TypeAheadItemRow.d.ts +0 -15
- package/dist/types/ui/registered-menu/TypeAheadMenuFooter.d.ts +0 -11
- package/dist/types/ui/registered-menu/TypeAheadMenuRenderer.d.ts +0 -19
- package/dist/types/ui/registered-menu/TypeAheadProvider.d.ts +0 -3
- package/dist/types/ui/registered-menu/TypeAheadSectionRow.d.ts +0 -5
- package/dist/types/ui/registered-menu/buildTypeAheadMenuModel.d.ts +0 -3
- package/dist/types/ui/registered-menu/createTypeAheadRowRenderer.d.ts +0 -17
- package/dist/types/ui/registered-menu/getTypeAheadGlobalViewMoreId.d.ts +0 -1
- package/dist/types/ui/registered-menu/getTypeAheadItemId.d.ts +0 -1
- package/dist/types/ui/registered-menu/quick-insert/TypeAheadQuickInsertItem.d.ts +0 -3
- package/dist/types/ui/registered-menu/quick-insert/TypeAheadQuickInsertProvider.d.ts +0 -2
- package/dist/types/ui/registered-menu/typeAheadMenuTypes.d.ts +0 -8
- package/dist/types/ui/registered-menu/typeAheadSurfaces.d.ts +0 -17
- package/dist/types/ui/registered-menu/useTypeAheadContext.d.ts +0 -2
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CellMeasurer } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
3
|
-
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
4
|
-
import { ListRow } from '../ListRow';
|
|
5
|
-
import { TypeAheadItemRow } from './TypeAheadItemRow';
|
|
6
|
-
import { TypeAheadSectionRow } from './TypeAheadSectionRow';
|
|
7
|
-
var noOp = function noOp() {};
|
|
8
|
-
export var createTypeAheadRowRenderer = function createTypeAheadRowRenderer(_ref) {
|
|
9
|
-
var cache = _ref.cache,
|
|
10
|
-
_ref$hasScrollPadding = _ref.hasScrollPadding,
|
|
11
|
-
hasScrollPadding = _ref$hasScrollPadding === void 0 ? false : _ref$hasScrollPadding,
|
|
12
|
-
onMeasured = _ref.onMeasured,
|
|
13
|
-
itemIndexByRowIndex = _ref.itemIndexByRowIndex,
|
|
14
|
-
Item = _ref.Item,
|
|
15
|
-
listId = _ref.listId,
|
|
16
|
-
onItemHover = _ref.onItemHover,
|
|
17
|
-
onItemLeave = _ref.onItemLeave,
|
|
18
|
-
onItemVisibilityChange = _ref.onItemVisibilityChange,
|
|
19
|
-
rows = _ref.rows,
|
|
20
|
-
selectedItemIndex = _ref.selectedItemIndex;
|
|
21
|
-
return function (_ref2) {
|
|
22
|
-
var index = _ref2.index,
|
|
23
|
-
key = _ref2.key,
|
|
24
|
-
parent = _ref2.parent,
|
|
25
|
-
style = _ref2.style,
|
|
26
|
-
isScrolling = _ref2.isScrolling,
|
|
27
|
-
isVisible = _ref2.isVisible;
|
|
28
|
-
var registration = rows[index];
|
|
29
|
-
if (!registration) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
var itemIndex = itemIndexByRowIndex.get(index);
|
|
33
|
-
var rowContent = registration.type === 'menu-section' ? /*#__PURE__*/React.createElement(TypeAheadSectionRow, {
|
|
34
|
-
registration: registration
|
|
35
|
-
}) : /*#__PURE__*/React.createElement(TypeAheadItemRow, {
|
|
36
|
-
Item: Item,
|
|
37
|
-
isSelected: itemIndex === selectedItemIndex,
|
|
38
|
-
itemIndex: itemIndex !== null && itemIndex !== void 0 ? itemIndex : 0,
|
|
39
|
-
listId: listId,
|
|
40
|
-
onItemHover: onItemHover,
|
|
41
|
-
onItemLeave: onItemLeave,
|
|
42
|
-
onItemVisibilityChange: onItemVisibilityChange,
|
|
43
|
-
isVisible: isVisible,
|
|
44
|
-
registration: registration,
|
|
45
|
-
rowIndex: index
|
|
46
|
-
});
|
|
47
|
-
return /*#__PURE__*/React.createElement(CellMeasurer, {
|
|
48
|
-
key: key,
|
|
49
|
-
cache: cache,
|
|
50
|
-
parent: parent,
|
|
51
|
-
columnIndex: 0,
|
|
52
|
-
rowIndex: index
|
|
53
|
-
}, function (_ref3) {
|
|
54
|
-
var measure = _ref3.measure;
|
|
55
|
-
return /*#__PURE__*/React.createElement(ListRow, {
|
|
56
|
-
index: index,
|
|
57
|
-
isScrolling: isScrolling,
|
|
58
|
-
isVisible: isVisible,
|
|
59
|
-
measure: measure,
|
|
60
|
-
onMeasured: onMeasured,
|
|
61
|
-
onMouseMove: noOp,
|
|
62
|
-
style: style
|
|
63
|
-
}, hasScrollPadding ? /*#__PURE__*/React.createElement(Box, {
|
|
64
|
-
paddingBlockStart: index === 0 ? 'space.100' : undefined,
|
|
65
|
-
paddingBlockEnd: index === rows.length - 1 ? 'space.100' : undefined
|
|
66
|
-
}, rowContent) : rowContent);
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { QuickInsertProvider } from '@atlaskit/editor-common/quick-insert/provider';
|
|
3
|
-
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
4
|
-
import { PassThrough } from '../PassThrough';
|
|
5
|
-
export var TypeAheadQuickInsertItem = function TypeAheadQuickInsertItem(_ref) {
|
|
6
|
-
var _registration$compone;
|
|
7
|
-
var id = _ref.id,
|
|
8
|
-
isSelected = _ref.isSelected,
|
|
9
|
-
registration = _ref.registration;
|
|
10
|
-
var quickInsertContext = useQuickInsertContext();
|
|
11
|
-
var Component = (_registration$compone = registration.component) !== null && _registration$compone !== void 0 ? _registration$compone : PassThrough;
|
|
12
|
-
var contextValue = useMemo(function () {
|
|
13
|
-
return {
|
|
14
|
-
activePreviewItemKey: quickInsertContext.activePreviewItemKey,
|
|
15
|
-
editorView: quickInsertContext.editorView,
|
|
16
|
-
isOffline: quickInsertContext.isOffline,
|
|
17
|
-
menuOpenId: quickInsertContext.menuOpenId,
|
|
18
|
-
popupsMountPoint: quickInsertContext.popupsMountPoint,
|
|
19
|
-
surfaceContext: quickInsertContext.surfaceContext,
|
|
20
|
-
surface: 'typeahead',
|
|
21
|
-
item: {
|
|
22
|
-
id: id,
|
|
23
|
-
isPreviewActive: quickInsertContext.activePreviewItemKey === registration.key,
|
|
24
|
-
isSelected: isSelected
|
|
25
|
-
},
|
|
26
|
-
select: quickInsertContext.select
|
|
27
|
-
};
|
|
28
|
-
}, [id, isSelected, quickInsertContext, registration.key]);
|
|
29
|
-
return /*#__PURE__*/React.createElement(QuickInsertProvider, {
|
|
30
|
-
value: contextValue
|
|
31
|
-
}, /*#__PURE__*/React.createElement(Component, null, null));
|
|
32
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useMemo } from 'react';
|
|
2
|
-
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
3
|
-
import { QuickInsertProvider } from '@atlaskit/editor-common/quick-insert/provider';
|
|
4
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
5
|
-
import { performTypeAheadSelection } from '../../../pm-plugins/commands/insert-type-ahead-item';
|
|
6
|
-
import { useTypeAheadContext } from '../useTypeAheadContext';
|
|
7
|
-
export var TypeAheadQuickInsertProvider = function TypeAheadQuickInsertProvider(_ref) {
|
|
8
|
-
var children = _ref.children;
|
|
9
|
-
var _useTypeAheadContext = useTypeAheadContext(),
|
|
10
|
-
activePreviewItemKey = _useTypeAheadContext.activePreviewItemKey,
|
|
11
|
-
api = _useTypeAheadContext.api,
|
|
12
|
-
editorView = _useTypeAheadContext.editorView,
|
|
13
|
-
inputMethod = _useTypeAheadContext.inputMethod,
|
|
14
|
-
menuOpenId = _useTypeAheadContext.menuOpenId,
|
|
15
|
-
onClose = _useTypeAheadContext.onClose,
|
|
16
|
-
popupsMountPoint = _useTypeAheadContext.popupsMountPoint,
|
|
17
|
-
query = _useTypeAheadContext.query,
|
|
18
|
-
surfaceContext = _useTypeAheadContext.surfaceContext,
|
|
19
|
-
triggerHandler = _useTypeAheadContext.triggerHandler;
|
|
20
|
-
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['connectivity'], function (_ref2) {
|
|
21
|
-
var connectivityState = _ref2.connectivityState;
|
|
22
|
-
return {
|
|
23
|
-
isOffline: isOfflineMode(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
|
|
24
|
-
};
|
|
25
|
-
}),
|
|
26
|
-
isOffline = _useSharedPluginState.isOffline;
|
|
27
|
-
var select = useCallback(function (selectionHandler) {
|
|
28
|
-
onClose();
|
|
29
|
-
queueMicrotask(function () {
|
|
30
|
-
performTypeAheadSelection(editorView)({
|
|
31
|
-
handler: triggerHandler,
|
|
32
|
-
inputMethod: inputMethod,
|
|
33
|
-
query: query,
|
|
34
|
-
selectionHandler: selectionHandler
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}, [editorView, inputMethod, onClose, query, triggerHandler]);
|
|
38
|
-
var contextValue = useMemo(function () {
|
|
39
|
-
return {
|
|
40
|
-
activePreviewItemKey: activePreviewItemKey,
|
|
41
|
-
editorView: editorView,
|
|
42
|
-
isOffline: isOffline,
|
|
43
|
-
menuOpenId: menuOpenId,
|
|
44
|
-
popupsMountPoint: popupsMountPoint,
|
|
45
|
-
item: {
|
|
46
|
-
id: 'typeahead-quick-insert',
|
|
47
|
-
isPreviewActive: false,
|
|
48
|
-
isSelected: false
|
|
49
|
-
},
|
|
50
|
-
surface: 'typeahead',
|
|
51
|
-
select: select,
|
|
52
|
-
surfaceContext: surfaceContext
|
|
53
|
-
};
|
|
54
|
-
}, [activePreviewItemKey, editorView, isOffline, menuOpenId, popupsMountPoint, select, surfaceContext]);
|
|
55
|
-
return /*#__PURE__*/React.createElement(QuickInsertProvider, {
|
|
56
|
-
value: contextValue
|
|
57
|
-
}, children);
|
|
58
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
|
-
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
|
3
|
-
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
4
|
-
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
5
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
6
|
-
import { TypeAheadQuickInsertItem } from './quick-insert/TypeAheadQuickInsertItem';
|
|
7
|
-
import { TypeAheadQuickInsertProvider } from './quick-insert/TypeAheadQuickInsertProvider';
|
|
8
|
-
var quickInsertSurface = {
|
|
9
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT,
|
|
10
|
-
Item: TypeAheadQuickInsertItem,
|
|
11
|
-
listIdPrefix: 'quick-insert-menu',
|
|
12
|
-
listLabel: typeAheadListMessages.quickInsertInputLabel,
|
|
13
|
-
Provider: TypeAheadQuickInsertProvider,
|
|
14
|
-
root: MENU
|
|
15
|
-
};
|
|
16
|
-
export var getTypeAheadSurface = function getTypeAheadSurface(id) {
|
|
17
|
-
if (id === TypeAheadAvailableNodes.QUICK_INSERT && isExperimentEnabled('platform_editor_slash_command')) {
|
|
18
|
-
return quickInsertSurface;
|
|
19
|
-
}
|
|
20
|
-
return undefined;
|
|
21
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { TypeAheadContext } from './TypeAheadContext';
|
|
3
|
-
export var useTypeAheadContext = function useTypeAheadContext() {
|
|
4
|
-
var value = useContext(TypeAheadContext);
|
|
5
|
-
if (!value) {
|
|
6
|
-
throw new Error('useTypeAheadContext must be used within TypeAheadProvider');
|
|
7
|
-
}
|
|
8
|
-
return value;
|
|
9
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'react';
|
|
2
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
4
|
-
import type { TypeAheadHandler } from '@atlaskit/editor-common/types/type-ahead';
|
|
5
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { SurfaceContext } from '@atlaskit/editor-ui-control-model/types';
|
|
7
|
-
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
8
|
-
export type TypeAheadContextValue = {
|
|
9
|
-
activePreviewItemKey?: string;
|
|
10
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
11
|
-
editorView: EditorView;
|
|
12
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT;
|
|
13
|
-
menuOpenId: symbol;
|
|
14
|
-
onClose: () => void;
|
|
15
|
-
popupsMountPoint?: HTMLElement;
|
|
16
|
-
query: string;
|
|
17
|
-
surfaceContext: SurfaceContext;
|
|
18
|
-
triggerHandler: TypeAheadHandler;
|
|
19
|
-
};
|
|
20
|
-
export declare const TypeAheadContext: Context<TypeAheadContextValue | null>;
|
|
@@ -1,15 +0,0 @@
|
|
|
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 TypeAheadItemRow: ({ isSelected, itemIndex, Item, listId, onItemHover, onItemLeave, onItemVisibilityChange, registration, rowIndex, isVisible, }: {
|
|
5
|
-
isSelected: boolean;
|
|
6
|
-
isVisible: boolean;
|
|
7
|
-
Item: TypeAheadItemComponent;
|
|
8
|
-
itemIndex: number;
|
|
9
|
-
listId: string;
|
|
10
|
-
onItemHover: (itemIndex: number, itemKey: string) => void;
|
|
11
|
-
onItemLeave: (itemKey: string) => void;
|
|
12
|
-
onItemVisibilityChange: (itemKey: string, isVisible: boolean) => void;
|
|
13
|
-
registration: RegisterMenuItem;
|
|
14
|
-
rowIndex: number;
|
|
15
|
-
}) => React.JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
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, hasScrollPadding, }: {
|
|
5
|
-
hasScrollPadding?: boolean;
|
|
6
|
-
id: string;
|
|
7
|
-
isSelected: boolean;
|
|
8
|
-
Item: TypeAheadItemComponent;
|
|
9
|
-
onMouseMove: () => void;
|
|
10
|
-
registration: RegisterMenuItem;
|
|
11
|
-
}) => React.JSX.Element;
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
hasScrollPadding?: boolean;
|
|
7
|
-
Item: TypeAheadItemComponent;
|
|
8
|
-
listId: string;
|
|
9
|
-
listLabel: MessageDescriptor;
|
|
10
|
-
maxHeight: number;
|
|
11
|
-
model: TypeAheadMenuModel;
|
|
12
|
-
onItemHover: (itemIndex: number, itemKey?: string) => void;
|
|
13
|
-
onItemLeave: (itemKey: string) => void;
|
|
14
|
-
onItemVisibilityChange: (itemKey: string, isVisible: boolean) => void;
|
|
15
|
-
query?: string;
|
|
16
|
-
selectedItemIndex: number;
|
|
17
|
-
};
|
|
18
|
-
export declare const TypeAheadMenuRenderer: ({ Item, listLabel, listId, maxHeight, model, query, hasScrollPadding, onItemHover, onItemLeave, onItemVisibilityChange, selectedItemIndex, }: Props) => React.JSX.Element | null;
|
|
19
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
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, hasScrollPadding, onMeasured, itemIndexByRowIndex, Item, listId, onItemHover, onItemLeave, onItemVisibilityChange, rows, selectedItemIndex, }: {
|
|
6
|
-
cache: CellMeasurerCache;
|
|
7
|
-
hasScrollPadding?: boolean;
|
|
8
|
-
Item: TypeAheadItemComponent;
|
|
9
|
-
itemIndexByRowIndex: Map<number, number>;
|
|
10
|
-
listId: string;
|
|
11
|
-
onItemHover: (itemIndex: number, itemKey: string) => void;
|
|
12
|
-
onItemLeave: (itemKey: string) => void;
|
|
13
|
-
onItemVisibilityChange: (itemKey: string, isVisible: boolean) => void;
|
|
14
|
-
onMeasured: () => void;
|
|
15
|
-
rows: Array<RegisterMenuItem | RegisterMenuSection>;
|
|
16
|
-
selectedItemIndex: number;
|
|
17
|
-
}) => ListRowRenderer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getTypeAheadGlobalViewMoreId: (listId: string) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getTypeAheadItemId: (listId: string, itemIndex: number) => string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
|
|
3
|
-
export type TypeAheadItemRenderProps = {
|
|
4
|
-
id: string;
|
|
5
|
-
isSelected: boolean;
|
|
6
|
-
registration: RegisterMenuItem;
|
|
7
|
-
};
|
|
8
|
-
export type TypeAheadItemComponent = React.ComponentType<TypeAheadItemRenderProps>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { MessageDescriptor } from 'react-intl';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
|
-
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
5
|
-
import type { TypeAheadItemComponent } from './typeAheadMenuTypes';
|
|
6
|
-
export type TypeAheadSurface = {
|
|
7
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT;
|
|
8
|
-
Item: TypeAheadItemComponent;
|
|
9
|
-
listIdPrefix: string;
|
|
10
|
-
listLabel: MessageDescriptor;
|
|
11
|
-
Provider: React.ComponentType<React.PropsWithChildren>;
|
|
12
|
-
root: {
|
|
13
|
-
key: string;
|
|
14
|
-
type: 'menu';
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const getTypeAheadSurface: (id?: TypeAheadAvailableNodes) => TypeAheadSurface | undefined;
|