@atlaskit/editor-plugin-type-ahead 3.1.9 → 3.1.10
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/types/pm-plugins/api.d.ts +1 -1
- package/dist/types/pm-plugins/commands/insert-type-ahead-item.d.ts +2 -2
- package/dist/types/pm-plugins/commands/insert-utils.d.ts +3 -3
- package/dist/types/pm-plugins/decorations.d.ts +2 -2
- package/dist/types/pm-plugins/main.d.ts +4 -4
- package/dist/types/pm-plugins/reducer.d.ts +1 -1
- package/dist/types/pm-plugins/stats-modifier.d.ts +1 -1
- package/dist/types/pm-plugins/utils.d.ts +8 -8
- package/dist/types/typeAheadPluginType.d.ts +13 -13
- package/dist/types/types/index.d.ts +19 -19
- package/dist/types/ui/InputQuery.d.ts +9 -9
- package/dist/types/ui/ListRow.d.ts +2 -2
- package/dist/types/ui/MoreOptions.d.ts +3 -3
- package/dist/types/ui/TypeAheadErrorFallback/EmptyState.d.ts +2 -2
- package/dist/types/ui/TypeAheadList.d.ts +14 -14
- package/dist/types/ui/TypeAheadListItem.d.ts +6 -6
- package/dist/types/ui/TypeAheadMenu.d.ts +2 -2
- package/dist/types/ui/TypeAheadPopup.d.ts +14 -14
- package/dist/types/ui/WrapperTypeAhead.d.ts +7 -7
- package/dist/types/ui/hooks/use-on-force-select.d.ts +3 -3
- package/dist/types/ui/modern/TypeAheadMenu.d.ts +2 -2
- package/dist/types/ui/modern/TypeAheadPopup.d.ts +13 -13
- package/dist/types-ts4.5/pm-plugins/api.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands/insert-type-ahead-item.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/commands/insert-utils.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/decorations.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/main.d.ts +4 -4
- package/dist/types-ts4.5/pm-plugins/reducer.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/stats-modifier.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +8 -8
- package/dist/types-ts4.5/typeAheadPluginType.d.ts +13 -13
- package/dist/types-ts4.5/types/index.d.ts +19 -19
- package/dist/types-ts4.5/ui/InputQuery.d.ts +9 -9
- package/dist/types-ts4.5/ui/ListRow.d.ts +2 -2
- package/dist/types-ts4.5/ui/MoreOptions.d.ts +3 -3
- package/dist/types-ts4.5/ui/TypeAheadErrorFallback/EmptyState.d.ts +2 -2
- package/dist/types-ts4.5/ui/TypeAheadList.d.ts +14 -14
- package/dist/types-ts4.5/ui/TypeAheadListItem.d.ts +6 -6
- package/dist/types-ts4.5/ui/TypeAheadMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/TypeAheadPopup.d.ts +14 -14
- package/dist/types-ts4.5/ui/WrapperTypeAhead.d.ts +7 -7
- package/dist/types-ts4.5/ui/hooks/use-on-force-select.d.ts +3 -3
- package/dist/types-ts4.5/ui/modern/TypeAheadMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/modern/TypeAheadPopup.d.ts +13 -13
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 3.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 3.1.9
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -4,8 +4,8 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TypeAheadHandler, TypeAheadInputMethod } from '../types';
|
|
6
6
|
type CloseOptions = {
|
|
7
|
-
insertCurrentQueryAsRawText: boolean;
|
|
8
7
|
attachCommand?: Command;
|
|
8
|
+
insertCurrentQueryAsRawText: boolean;
|
|
9
9
|
};
|
|
10
10
|
type InsertItemProps = {
|
|
11
11
|
contentItem: TypeAheadItem;
|
|
@@ -2,11 +2,11 @@ import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
|
2
2
|
import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
type Props = {
|
|
5
|
-
item: TypeAheadItem;
|
|
6
5
|
handler: TypeAheadHandler;
|
|
6
|
+
item: TypeAheadItem;
|
|
7
7
|
mode: SelectItemMode;
|
|
8
|
-
sourceListItem: Array<TypeAheadItem>;
|
|
9
8
|
query: string;
|
|
9
|
+
sourceListItem: Array<TypeAheadItem>;
|
|
10
10
|
};
|
|
11
11
|
export declare const insertTypeAheadItem: (view: EditorView) => ({ item, handler, mode, query, sourceListItem }: Props) => void;
|
|
12
12
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
type Position = {
|
|
4
|
-
start: number;
|
|
5
4
|
end: number;
|
|
5
|
+
start: number;
|
|
6
6
|
};
|
|
7
7
|
export declare const insertBlockNode: ({ node, tr, position, }: {
|
|
8
8
|
node: PMNode;
|
|
9
|
-
tr: Transaction;
|
|
10
9
|
position: Position;
|
|
10
|
+
tr: Transaction;
|
|
11
11
|
}) => Transaction;
|
|
12
12
|
export declare const insertInlineNodeOrFragment: ({ maybeFragment, tr, position, selectInlineNode, }: {
|
|
13
13
|
maybeFragment: Fragment | PMNode;
|
|
14
|
-
tr: Transaction;
|
|
15
14
|
position: Position;
|
|
16
15
|
selectInlineNode: boolean;
|
|
16
|
+
tr: Transaction;
|
|
17
17
|
}) => Transaction;
|
|
18
18
|
export {};
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
5
|
import type { CreateTypeAheadDecorations, PopupMountPointReference, RemoveTypeAheadDecorations } from '../types';
|
|
6
6
|
type FactoryProps = {
|
|
7
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
7
8
|
intl: IntlShape;
|
|
8
|
-
popupMountRef: PopupMountPointReference;
|
|
9
9
|
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
10
|
-
|
|
10
|
+
popupMountRef: PopupMountPointReference;
|
|
11
11
|
};
|
|
12
12
|
type FactoryReturn = {
|
|
13
13
|
createDecorations: CreateTypeAheadDecorations;
|
|
@@ -6,12 +6,12 @@ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
6
6
|
import { type TypeAheadPlugin } from '../typeAheadPluginType';
|
|
7
7
|
import type { PopupMountPointReference, TypeAheadHandler } from '../types';
|
|
8
8
|
type Props = {
|
|
9
|
-
|
|
10
|
-
popupMountRef: PopupMountPointReference;
|
|
11
|
-
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
9
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
12
10
|
getIntl: () => IntlShape;
|
|
13
11
|
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
14
|
-
|
|
12
|
+
popupMountRef: PopupMountPointReference;
|
|
13
|
+
reactDispatch: Dispatch;
|
|
14
|
+
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
15
15
|
};
|
|
16
16
|
export declare function createPlugin({ reactDispatch, popupMountRef, typeAheadHandlers, getIntl, nodeViewPortalProviderAPI, api, }: Props): SafePlugin;
|
|
17
17
|
export {};
|
|
@@ -2,8 +2,8 @@ import { InsertTypeAheadStep } from '@atlaskit/adf-schema/steps';
|
|
|
2
2
|
import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { CreateTypeAheadDecorations, PopupMountPointReference, RemoveTypeAheadDecorations, TypeAheadHandler, TypeAheadPluginState } from '../types';
|
|
4
4
|
export type ReducerOptions = {
|
|
5
|
-
popupMountRef: PopupMountPointReference;
|
|
6
5
|
createDecorations: CreateTypeAheadDecorations;
|
|
6
|
+
popupMountRef: PopupMountPointReference;
|
|
7
7
|
removeDecorations: RemoveTypeAheadDecorations;
|
|
8
8
|
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
9
9
|
};
|
|
@@ -14,29 +14,29 @@ export declare const isTypeAheadAllowed: (state: EditorState) => boolean;
|
|
|
14
14
|
export declare const findHandler: (id: string, state: EditorState) => TypeAheadHandler | null;
|
|
15
15
|
export declare const skipForwardToSafeItem: ({ currentIndex, nextIndex, listSize, itemIsDisabled, }: {
|
|
16
16
|
currentIndex: number;
|
|
17
|
-
nextIndex: number;
|
|
18
|
-
listSize: number;
|
|
19
17
|
itemIsDisabled: (idx: number) => boolean;
|
|
18
|
+
listSize: number;
|
|
19
|
+
nextIndex: number;
|
|
20
20
|
}) => number;
|
|
21
21
|
export declare const skipBackwardToSafeItem: ({ currentIndex, nextIndex, listSize, itemIsDisabled, }: {
|
|
22
22
|
currentIndex: number;
|
|
23
|
-
nextIndex: number;
|
|
24
|
-
listSize: number;
|
|
25
23
|
itemIsDisabled: (idx: number) => boolean;
|
|
24
|
+
listSize: number;
|
|
25
|
+
nextIndex: number;
|
|
26
26
|
}) => number;
|
|
27
27
|
export declare const findHandlerByTrigger: ({ trigger, editorState, }: {
|
|
28
|
-
trigger: string;
|
|
29
28
|
editorState: EditorState;
|
|
29
|
+
trigger: string;
|
|
30
30
|
}) => TypeAheadHandler | null;
|
|
31
31
|
type MoveSelectedIndexProps = {
|
|
32
|
-
editorView: EditorView;
|
|
33
|
-
direction: 'next' | 'previous';
|
|
34
32
|
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
33
|
+
direction: 'next' | 'previous';
|
|
34
|
+
editorView: EditorView;
|
|
35
35
|
};
|
|
36
36
|
export declare const moveSelectedIndex: ({ editorView, direction, api }: MoveSelectedIndexProps) => () => void;
|
|
37
37
|
type TypeAheadAssistiveLabels = {
|
|
38
|
-
popupAriaLabel: string;
|
|
39
38
|
listItemAriaLabel?: string;
|
|
39
|
+
popupAriaLabel: string;
|
|
40
40
|
};
|
|
41
41
|
export declare const getTypeAheadListAriaLabels: (trigger: string | undefined, intl: IntlShape, item?: TypeAheadItem) => TypeAheadAssistiveLabels;
|
|
42
42
|
export {};
|
|
@@ -8,22 +8,30 @@ import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
|
|
|
8
8
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { type TypeAheadPluginOptions, type TypeAheadPluginSharedState, type OpenTypeAheadProps } from './types';
|
|
10
10
|
type InsertTypeAheadItemProps = {
|
|
11
|
-
triggerHandler: TypeAheadHandler;
|
|
12
11
|
contentItem: TypeAheadItem;
|
|
12
|
+
mode?: SelectItemMode;
|
|
13
13
|
query: string;
|
|
14
14
|
sourceListItem: TypeAheadItem[];
|
|
15
|
-
|
|
15
|
+
triggerHandler: TypeAheadHandler;
|
|
16
16
|
};
|
|
17
17
|
type CloseTypeAheadProps = {
|
|
18
|
-
insertCurrentQueryAsRawText: boolean;
|
|
19
18
|
attachCommand?: Command;
|
|
19
|
+
insertCurrentQueryAsRawText: boolean;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Type ahead plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
23
23
|
* from `@atlaskit/editor-core`.
|
|
24
24
|
*/
|
|
25
25
|
export type TypeAheadPlugin = NextEditorPlugin<'typeAhead', {
|
|
26
|
-
|
|
26
|
+
actions: {
|
|
27
|
+
close: (props: CloseTypeAheadProps) => boolean;
|
|
28
|
+
findHandlerByTrigger: (trigger: string) => TypeAheadHandler | null;
|
|
29
|
+
insert: (props: InsertTypeAheadItemProps) => boolean;
|
|
30
|
+
isAllowed: (editorState: EditorState) => boolean;
|
|
31
|
+
isOpen: (editorState: EditorState) => boolean;
|
|
32
|
+
open: (props: OpenTypeAheadProps) => boolean;
|
|
33
|
+
openAtTransaction: (props: OpenTypeAheadProps) => (tr: Transaction) => boolean;
|
|
34
|
+
};
|
|
27
35
|
dependencies: [
|
|
28
36
|
OptionalPlugin<AnalyticsPlugin>,
|
|
29
37
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
@@ -31,15 +39,7 @@ export type TypeAheadPlugin = NextEditorPlugin<'typeAhead', {
|
|
|
31
39
|
OptionalPlugin<ContextPanelPlugin>,
|
|
32
40
|
OptionalPlugin<MetricsPlugin>
|
|
33
41
|
];
|
|
42
|
+
pluginConfiguration: TypeAheadPluginOptions | undefined;
|
|
34
43
|
sharedState: TypeAheadPluginSharedState;
|
|
35
|
-
actions: {
|
|
36
|
-
isOpen: (editorState: EditorState) => boolean;
|
|
37
|
-
isAllowed: (editorState: EditorState) => boolean;
|
|
38
|
-
insert: (props: InsertTypeAheadItemProps) => boolean;
|
|
39
|
-
findHandlerByTrigger: (trigger: string) => TypeAheadHandler | null;
|
|
40
|
-
open: (props: OpenTypeAheadProps) => boolean;
|
|
41
|
-
close: (props: CloseTypeAheadProps) => boolean;
|
|
42
|
-
openAtTransaction: (props: OpenTypeAheadProps) => (tr: Transaction) => boolean;
|
|
43
|
-
};
|
|
44
44
|
}>;
|
|
45
45
|
export {};
|
|
@@ -17,32 +17,32 @@ export interface TypeAheadStatsSerializable extends TypeAheadStats {
|
|
|
17
17
|
serialize: () => TypeAheadStats;
|
|
18
18
|
}
|
|
19
19
|
export interface TypeAheadStatsModifier extends TypeAheadStatsSerializable {
|
|
20
|
-
increaseArrowUp: () => void;
|
|
21
20
|
increaseArrowDown: () => void;
|
|
21
|
+
increaseArrowUp: () => void;
|
|
22
22
|
}
|
|
23
23
|
export interface TypeAheadStatsMobileModifier extends TypeAheadStatsSerializable {
|
|
24
|
-
resetTime: () => void;
|
|
25
24
|
closeTime: () => void;
|
|
25
|
+
resetTime: () => void;
|
|
26
26
|
}
|
|
27
27
|
export type TypeAheadPluginState = {
|
|
28
|
-
decorationSet: DecorationSet;
|
|
29
28
|
decorationElement: HTMLElement | null;
|
|
30
|
-
|
|
31
|
-
query: string;
|
|
32
|
-
items: Array<TypeAheadItem>;
|
|
29
|
+
decorationSet: DecorationSet;
|
|
33
30
|
errorInfo: TypeAheadErrorInfo;
|
|
34
|
-
triggerHandler?: TypeAheadHandler;
|
|
35
|
-
selectedIndex: number;
|
|
36
|
-
stats: TypeAheadStatsSerializable | null;
|
|
37
31
|
inputMethod: TypeAheadInputMethod | null;
|
|
32
|
+
items: Array<TypeAheadItem>;
|
|
33
|
+
query: string;
|
|
38
34
|
/**
|
|
39
35
|
* If true, removes the trigger character from query when typeahead is closed
|
|
40
36
|
*/
|
|
41
37
|
removePrefixTriggerOnCancel?: boolean;
|
|
38
|
+
selectedIndex: number;
|
|
39
|
+
stats: TypeAheadStatsSerializable | null;
|
|
40
|
+
triggerHandler?: TypeAheadHandler;
|
|
41
|
+
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
42
42
|
};
|
|
43
43
|
export type OnInsertSelectedItemProps = {
|
|
44
|
-
mode: SelectItemMode;
|
|
45
44
|
index: number;
|
|
45
|
+
mode: SelectItemMode;
|
|
46
46
|
query: string;
|
|
47
47
|
};
|
|
48
48
|
export type OnItemMatchProps = {
|
|
@@ -61,12 +61,12 @@ export type InsertionTransactionMeta = (editorState: EditorState) => Transaction
|
|
|
61
61
|
type PopupMountPoints = Pick<UiComponentFactoryParams, 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement'>;
|
|
62
62
|
export type PopupMountPointReference = Record<'current', PopupMountPoints | null>;
|
|
63
63
|
export type CreateTypeAheadDecorations = (tr: ReadonlyTransaction, options: {
|
|
64
|
-
triggerHandler: TypeAheadHandler;
|
|
65
64
|
inputMethod: TypeAheadInputMethod;
|
|
66
65
|
reopenQuery?: string;
|
|
66
|
+
triggerHandler: TypeAheadHandler;
|
|
67
67
|
}) => {
|
|
68
|
-
decorationSet: DecorationSet;
|
|
69
68
|
decorationElement: HTMLElement | null;
|
|
69
|
+
decorationSet: DecorationSet;
|
|
70
70
|
stats: TypeAheadStatsSerializable | null;
|
|
71
71
|
};
|
|
72
72
|
export type RemoveTypeAheadDecorations = (decorationSet?: DecorationSet) => boolean;
|
|
@@ -80,20 +80,20 @@ export type TypeAheadPluginOptions = {
|
|
|
80
80
|
isMobile?: boolean;
|
|
81
81
|
};
|
|
82
82
|
export interface TypeAheadPluginSharedState {
|
|
83
|
-
query: string;
|
|
84
|
-
isOpen: boolean;
|
|
85
|
-
isAllowed: boolean;
|
|
86
83
|
currentHandler?: TypeAheadHandler;
|
|
87
|
-
decorationSet: DecorationSet;
|
|
88
84
|
decorationElement: HTMLElement | null;
|
|
89
|
-
|
|
90
|
-
items: Array<TypeAheadItem>;
|
|
85
|
+
decorationSet: DecorationSet;
|
|
91
86
|
errorInfo: TypeAheadErrorInfo;
|
|
87
|
+
isAllowed: boolean;
|
|
88
|
+
isOpen: boolean;
|
|
89
|
+
items: Array<TypeAheadItem>;
|
|
90
|
+
query: string;
|
|
92
91
|
selectedIndex: number;
|
|
92
|
+
triggerHandler?: TypeAheadHandler;
|
|
93
93
|
}
|
|
94
94
|
export type OpenTypeAheadProps = {
|
|
95
|
-
triggerHandler: TypeAheadHandler;
|
|
96
95
|
inputMethod: TypeAheadInputMethod;
|
|
97
96
|
query?: string;
|
|
98
97
|
removePrefixTriggerOnCancel?: boolean;
|
|
98
|
+
triggerHandler: TypeAheadHandler;
|
|
99
99
|
};
|
|
@@ -9,23 +9,23 @@ import type { TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
|
9
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
10
|
import { CloseSelectionOptions } from '../pm-plugins/constants';
|
|
11
11
|
type InputQueryProps = {
|
|
12
|
-
triggerQueryPrefix: string;
|
|
13
|
-
onQueryChange: (query: string) => void;
|
|
14
|
-
onItemSelect: (mode: SelectItemMode) => void;
|
|
15
|
-
selectNextItem: () => void;
|
|
16
|
-
selectPreviousItem: () => void;
|
|
17
12
|
cancel: (props: {
|
|
13
|
+
addPrefixTrigger: boolean;
|
|
18
14
|
forceFocusOnEditor: boolean;
|
|
19
15
|
setSelectionAt: CloseSelectionOptions;
|
|
20
|
-
addPrefixTrigger: boolean;
|
|
21
16
|
text: string;
|
|
22
17
|
}) => void;
|
|
23
|
-
|
|
18
|
+
editorView: EditorView;
|
|
24
19
|
forceFocus: boolean;
|
|
20
|
+
items: TypeAheadItem[];
|
|
21
|
+
onItemSelect: (mode: SelectItemMode) => void;
|
|
22
|
+
onQueryChange: (query: string) => void;
|
|
23
|
+
onQueryFocus: () => void;
|
|
25
24
|
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
|
|
26
25
|
reopenQuery?: string;
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
selectNextItem: () => void;
|
|
27
|
+
selectPreviousItem: () => void;
|
|
28
|
+
triggerQueryPrefix: string;
|
|
29
29
|
};
|
|
30
30
|
export declare const InputQuery: React.MemoExoticComponent<({ triggerQueryPrefix, cancel, onQueryChange, onItemSelect, selectNextItem, selectPreviousItem, forceFocus, reopenQuery, onQueryFocus, onUndoRedo, editorView, items, }: InputQueryProps) => jsx.JSX.Element>;
|
|
31
31
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { type ReactNode, type MouseEventHandler } from 'react';
|
|
2
2
|
import { type ListRowProps } from 'react-virtualized';
|
|
3
3
|
type Props = {
|
|
4
|
+
children: ReactNode;
|
|
4
5
|
measure: () => void;
|
|
5
|
-
registerChild?: (element?: Element) => void;
|
|
6
6
|
onMouseMove: MouseEventHandler<HTMLDivElement>;
|
|
7
|
-
|
|
7
|
+
registerChild?: (element?: Element) => void;
|
|
8
8
|
} & Pick<ListRowProps, 'index' | 'style' | 'isScrolling' | 'isVisible'>;
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
type Props = {
|
|
3
|
-
onClick: () => void;
|
|
4
|
-
isFocused: boolean;
|
|
5
|
-
title: string;
|
|
6
3
|
ariaLabel?: string;
|
|
7
4
|
iconBefore?: React.ReactNode;
|
|
5
|
+
isFocused: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
title: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const MoreOptions: ({ onClick, isFocused, title, ariaLabel, iconBefore }: Props) => jsx.JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type EmptyStateProps = {
|
|
3
|
-
header: string;
|
|
4
|
-
testId?: string;
|
|
5
3
|
description?: React.ReactNode;
|
|
4
|
+
header: string;
|
|
6
5
|
renderImage?: () => React.ReactNode;
|
|
6
|
+
testId?: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const EmptyState: ({ testId, header, description, renderImage }: EmptyStateProps) => React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -11,29 +11,29 @@ import { type InputMethodType } from '../pm-plugins/analytics';
|
|
|
11
11
|
import { type TypeAheadPlugin } from '../typeAheadPluginType';
|
|
12
12
|
import type { TypeAheadHandler } from '../types';
|
|
13
13
|
export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlProps<{
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
15
|
+
decorationElement: HTMLElement;
|
|
16
16
|
editorView: EditorView;
|
|
17
|
-
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
18
17
|
fitHeight: number;
|
|
19
|
-
|
|
20
|
-
triggerHandler?: TypeAheadHandler;
|
|
18
|
+
items: Array<TypeAheadItem>;
|
|
21
19
|
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
22
|
-
|
|
23
|
-
showMoreOptionsButton?: boolean;
|
|
20
|
+
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
24
21
|
onMoreOptionsClicked?: () => void;
|
|
22
|
+
selectedIndex: number;
|
|
23
|
+
showMoreOptionsButton?: boolean;
|
|
24
|
+
triggerHandler?: TypeAheadHandler;
|
|
25
25
|
} & WrappedComponentProps>> & {
|
|
26
26
|
WrappedComponent: React.ComponentType<{
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
28
|
+
decorationElement: HTMLElement;
|
|
29
29
|
editorView: EditorView;
|
|
30
|
-
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
31
30
|
fitHeight: number;
|
|
32
|
-
|
|
33
|
-
triggerHandler?: TypeAheadHandler;
|
|
31
|
+
items: Array<TypeAheadItem>;
|
|
34
32
|
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
35
|
-
|
|
36
|
-
showMoreOptionsButton?: boolean;
|
|
33
|
+
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
37
34
|
onMoreOptionsClicked?: () => void;
|
|
35
|
+
selectedIndex: number;
|
|
36
|
+
showMoreOptionsButton?: boolean;
|
|
37
|
+
triggerHandler?: TypeAheadHandler;
|
|
38
38
|
} & WrappedComponentProps>;
|
|
39
39
|
};
|
|
@@ -9,15 +9,15 @@ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-c
|
|
|
9
9
|
import { type TypeAheadPlugin } from '../typeAheadPluginType';
|
|
10
10
|
export declare const itemIcon: import("@emotion/react").SerializedStyles;
|
|
11
11
|
type TypeAheadListItemProps = {
|
|
12
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
firstOnlineSupportedIndex: number;
|
|
12
15
|
item: TypeAheadItem;
|
|
13
|
-
itemsLength: number;
|
|
14
16
|
itemIndex: number;
|
|
15
|
-
|
|
16
|
-
ariaLabel?: string;
|
|
17
|
-
onItemClick: (mode: SelectItemMode, index: number) => void;
|
|
17
|
+
itemsLength: number;
|
|
18
18
|
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
onItemClick: (mode: SelectItemMode, index: number) => void;
|
|
20
|
+
selectedIndex: number;
|
|
21
21
|
};
|
|
22
22
|
export declare const TypeAheadListItem: React.MemoExoticComponent<({ item, itemsLength, selectedIndex, onItemClick, itemIndex, ariaLabel, moreElementsInQuickInsertViewEnabled, api, firstOnlineSupportedIndex, }: TypeAheadListItemProps) => jsx.JSX.Element>;
|
|
23
23
|
export {};
|
|
@@ -4,11 +4,11 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
5
|
import type { PopupMountPointReference, TypeAheadPluginSharedState } from '../types';
|
|
6
6
|
type TypeAheadMenuType = {
|
|
7
|
-
|
|
7
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
popupMountRef: PopupMountPointReference;
|
|
10
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
11
10
|
selectedIndex: number;
|
|
11
|
+
typeAheadState: Omit<TypeAheadPluginSharedState, 'isOpen' | 'isAllowed' | 'selectedIndex'>;
|
|
12
12
|
};
|
|
13
13
|
export declare const TypeAheadMenu: React.MemoExoticComponent<({ editorView, popupMountRef, typeAheadState, selectedIndex, api }: TypeAheadMenuType) => React.JSX.Element | null>;
|
|
14
14
|
export {};
|
|
@@ -11,26 +11,26 @@ import { CloseSelectionOptions } from '../pm-plugins/constants';
|
|
|
11
11
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
12
12
|
import type { OnSelectItem, TypeAheadErrorInfo } from '../types';
|
|
13
13
|
type TypeAheadPopupProps = {
|
|
14
|
-
triggerHandler: TypeAheadHandler;
|
|
15
|
-
editorView: EditorView;
|
|
16
14
|
anchorElement: HTMLElement;
|
|
17
|
-
|
|
18
|
-
popupsBoundariesElement?: HTMLElement;
|
|
19
|
-
popupsScrollableElement?: HTMLElement;
|
|
20
|
-
items: Array<TypeAheadItem>;
|
|
21
|
-
errorInfo: TypeAheadErrorInfo;
|
|
22
|
-
selectedIndex: number;
|
|
23
|
-
setSelectedItem: OnSelectItem;
|
|
24
|
-
decorationSet: DecorationSet;
|
|
25
|
-
isEmptyQuery: boolean;
|
|
26
|
-
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
15
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
27
16
|
cancel: (params: {
|
|
28
|
-
setSelectionAt: CloseSelectionOptions;
|
|
29
17
|
addPrefixTrigger: boolean;
|
|
30
18
|
forceFocusOnEditor: boolean;
|
|
19
|
+
setSelectionAt: CloseSelectionOptions;
|
|
31
20
|
}) => void;
|
|
32
|
-
|
|
21
|
+
decorationSet: DecorationSet;
|
|
22
|
+
editorView: EditorView;
|
|
23
|
+
errorInfo: TypeAheadErrorInfo;
|
|
24
|
+
isEmptyQuery: boolean;
|
|
25
|
+
items: Array<TypeAheadItem>;
|
|
26
|
+
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
27
|
+
popupsBoundariesElement?: HTMLElement;
|
|
28
|
+
popupsMountPoint?: HTMLElement;
|
|
29
|
+
popupsScrollableElement?: HTMLElement;
|
|
30
|
+
selectedIndex: number;
|
|
31
|
+
setSelectedItem: OnSelectItem;
|
|
33
32
|
showMoreOptionsButton?: boolean;
|
|
33
|
+
triggerHandler: TypeAheadHandler;
|
|
34
34
|
};
|
|
35
35
|
export declare const TypeAheadPopup: React.MemoExoticComponent<(props: TypeAheadPopupProps) => jsx.JSX.Element>;
|
|
36
36
|
export {};
|
|
@@ -4,18 +4,18 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
5
|
import type { TypeAheadHandler, TypeAheadInputMethod } from '../types';
|
|
6
6
|
type WrapperProps = {
|
|
7
|
-
triggerHandler: TypeAheadHandler;
|
|
8
|
-
editorView: EditorView;
|
|
9
7
|
anchorElement: HTMLElement;
|
|
8
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
9
|
+
editorView: EditorView;
|
|
10
10
|
getDecorationPosition: () => number | undefined;
|
|
11
|
-
|
|
11
|
+
inputMethod?: TypeAheadInputMethod;
|
|
12
12
|
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
|
|
13
|
-
reopenQuery?: string;
|
|
14
|
-
popupsMountPoint?: HTMLElement;
|
|
15
13
|
popupsBoundariesElement?: HTMLElement;
|
|
14
|
+
popupsMountPoint?: HTMLElement;
|
|
16
15
|
popupsScrollableElement?: HTMLElement;
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
reopenQuery?: string;
|
|
17
|
+
shouldFocusCursorInsideQuery: boolean;
|
|
18
|
+
triggerHandler: TypeAheadHandler;
|
|
19
19
|
};
|
|
20
20
|
export declare const WrapperTypeAhead: React.MemoExoticComponent<({ triggerHandler, editorView, anchorElement, shouldFocusCursorInsideQuery, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, inputMethod, getDecorationPosition, reopenQuery, onUndoRedo, api, }: WrapperProps) => React.JSX.Element | null>;
|
|
21
21
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
type Props = {
|
|
4
|
-
|
|
4
|
+
closePopup: () => void;
|
|
5
|
+
editorView: EditorView;
|
|
5
6
|
items: Array<TypeAheadItem>;
|
|
6
7
|
query: string;
|
|
7
|
-
|
|
8
|
-
closePopup: () => void;
|
|
8
|
+
triggerHandler: TypeAheadHandler;
|
|
9
9
|
};
|
|
10
10
|
export declare const useOnForceSelect: ({ triggerHandler, items, query, editorView, closePopup, }: Props) => void;
|
|
11
11
|
export {};
|
|
@@ -4,10 +4,10 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
5
5
|
import type { PopupMountPointReference, TypeAheadPluginSharedState } from '../../types';
|
|
6
6
|
type TypeAheadMenuType = {
|
|
7
|
-
|
|
7
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
popupMountRef: PopupMountPointReference;
|
|
10
|
-
|
|
10
|
+
typeAheadState: Omit<TypeAheadPluginSharedState, 'isOpen' | 'isAllowed' | 'selectedIndex'>;
|
|
11
11
|
};
|
|
12
12
|
export declare const TypeAheadMenu: React.MemoExoticComponent<({ editorView, popupMountRef, typeAheadState, api }: TypeAheadMenuType) => React.JSX.Element | null>;
|
|
13
13
|
export {};
|
|
@@ -11,27 +11,27 @@ import { CloseSelectionOptions } from '../../pm-plugins/constants';
|
|
|
11
11
|
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
12
12
|
import type { TypeAheadErrorInfo } from '../../types';
|
|
13
13
|
type TypeAheadPopupProps = {
|
|
14
|
-
triggerHandler: TypeAheadHandler;
|
|
15
|
-
editorView: EditorView;
|
|
16
14
|
anchorElement: HTMLElement;
|
|
17
|
-
|
|
18
|
-
popupsBoundariesElement?: HTMLElement;
|
|
19
|
-
popupsScrollableElement?: HTMLElement;
|
|
20
|
-
items: Array<TypeAheadItem>;
|
|
21
|
-
errorInfo: TypeAheadErrorInfo;
|
|
22
|
-
decorationSet: DecorationSet;
|
|
23
|
-
isEmptyQuery: boolean;
|
|
24
|
-
query: string;
|
|
25
|
-
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
15
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
26
16
|
cancel: (params: {
|
|
27
|
-
setSelectionAt: CloseSelectionOptions;
|
|
28
17
|
addPrefixTrigger: boolean;
|
|
29
18
|
forceFocusOnEditor: boolean;
|
|
19
|
+
setSelectionAt: CloseSelectionOptions;
|
|
30
20
|
}) => void;
|
|
31
|
-
|
|
21
|
+
decorationSet: DecorationSet;
|
|
22
|
+
editorView: EditorView;
|
|
23
|
+
errorInfo: TypeAheadErrorInfo;
|
|
24
|
+
isEmptyQuery: boolean;
|
|
25
|
+
items: Array<TypeAheadItem>;
|
|
26
|
+
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
27
|
+
popupsBoundariesElement?: HTMLElement;
|
|
28
|
+
popupsMountPoint?: HTMLElement;
|
|
29
|
+
popupsScrollableElement?: HTMLElement;
|
|
30
|
+
query: string;
|
|
32
31
|
setSelectedItem?: (props: {
|
|
33
32
|
index: number;
|
|
34
33
|
}) => void;
|
|
34
|
+
triggerHandler: TypeAheadHandler;
|
|
35
35
|
};
|
|
36
36
|
export declare const TypeAheadPopup: React.MemoExoticComponent<(props: TypeAheadPopupProps) => jsx.JSX.Element>;
|
|
37
37
|
export {};
|
|
@@ -4,8 +4,8 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TypeAheadHandler, TypeAheadInputMethod } from '../types';
|
|
6
6
|
type CloseOptions = {
|
|
7
|
-
insertCurrentQueryAsRawText: boolean;
|
|
8
7
|
attachCommand?: Command;
|
|
8
|
+
insertCurrentQueryAsRawText: boolean;
|
|
9
9
|
};
|
|
10
10
|
type InsertItemProps = {
|
|
11
11
|
contentItem: TypeAheadItem;
|
|
@@ -2,11 +2,11 @@ import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
|
2
2
|
import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
type Props = {
|
|
5
|
-
item: TypeAheadItem;
|
|
6
5
|
handler: TypeAheadHandler;
|
|
6
|
+
item: TypeAheadItem;
|
|
7
7
|
mode: SelectItemMode;
|
|
8
|
-
sourceListItem: Array<TypeAheadItem>;
|
|
9
8
|
query: string;
|
|
9
|
+
sourceListItem: Array<TypeAheadItem>;
|
|
10
10
|
};
|
|
11
11
|
export declare const insertTypeAheadItem: (view: EditorView) => ({ item, handler, mode, query, sourceListItem }: Props) => void;
|
|
12
12
|
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
type Position = {
|
|
4
|
-
start: number;
|
|
5
4
|
end: number;
|
|
5
|
+
start: number;
|
|
6
6
|
};
|
|
7
7
|
export declare const insertBlockNode: ({ node, tr, position, }: {
|
|
8
8
|
node: PMNode;
|
|
9
|
-
tr: Transaction;
|
|
10
9
|
position: Position;
|
|
10
|
+
tr: Transaction;
|
|
11
11
|
}) => Transaction;
|
|
12
12
|
export declare const insertInlineNodeOrFragment: ({ maybeFragment, tr, position, selectInlineNode, }: {
|
|
13
13
|
maybeFragment: Fragment | PMNode;
|
|
14
|
-
tr: Transaction;
|
|
15
14
|
position: Position;
|
|
16
15
|
selectInlineNode: boolean;
|
|
16
|
+
tr: Transaction;
|
|
17
17
|
}) => Transaction;
|
|
18
18
|
export {};
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
5
|
import type { CreateTypeAheadDecorations, PopupMountPointReference, RemoveTypeAheadDecorations } from '../types';
|
|
6
6
|
type FactoryProps = {
|
|
7
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
7
8
|
intl: IntlShape;
|
|
8
|
-
popupMountRef: PopupMountPointReference;
|
|
9
9
|
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
10
|
-
|
|
10
|
+
popupMountRef: PopupMountPointReference;
|
|
11
11
|
};
|
|
12
12
|
type FactoryReturn = {
|
|
13
13
|
createDecorations: CreateTypeAheadDecorations;
|
|
@@ -6,12 +6,12 @@ import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
6
6
|
import { type TypeAheadPlugin } from '../typeAheadPluginType';
|
|
7
7
|
import type { PopupMountPointReference, TypeAheadHandler } from '../types';
|
|
8
8
|
type Props = {
|
|
9
|
-
|
|
10
|
-
popupMountRef: PopupMountPointReference;
|
|
11
|
-
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
9
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
12
10
|
getIntl: () => IntlShape;
|
|
13
11
|
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
14
|
-
|
|
12
|
+
popupMountRef: PopupMountPointReference;
|
|
13
|
+
reactDispatch: Dispatch;
|
|
14
|
+
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
15
15
|
};
|
|
16
16
|
export declare function createPlugin({ reactDispatch, popupMountRef, typeAheadHandlers, getIntl, nodeViewPortalProviderAPI, api, }: Props): SafePlugin;
|
|
17
17
|
export {};
|
|
@@ -2,8 +2,8 @@ import { InsertTypeAheadStep } from '@atlaskit/adf-schema/steps';
|
|
|
2
2
|
import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { CreateTypeAheadDecorations, PopupMountPointReference, RemoveTypeAheadDecorations, TypeAheadHandler, TypeAheadPluginState } from '../types';
|
|
4
4
|
export type ReducerOptions = {
|
|
5
|
-
popupMountRef: PopupMountPointReference;
|
|
6
5
|
createDecorations: CreateTypeAheadDecorations;
|
|
6
|
+
popupMountRef: PopupMountPointReference;
|
|
7
7
|
removeDecorations: RemoveTypeAheadDecorations;
|
|
8
8
|
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
9
9
|
};
|
|
@@ -14,29 +14,29 @@ export declare const isTypeAheadAllowed: (state: EditorState) => boolean;
|
|
|
14
14
|
export declare const findHandler: (id: string, state: EditorState) => TypeAheadHandler | null;
|
|
15
15
|
export declare const skipForwardToSafeItem: ({ currentIndex, nextIndex, listSize, itemIsDisabled, }: {
|
|
16
16
|
currentIndex: number;
|
|
17
|
-
nextIndex: number;
|
|
18
|
-
listSize: number;
|
|
19
17
|
itemIsDisabled: (idx: number) => boolean;
|
|
18
|
+
listSize: number;
|
|
19
|
+
nextIndex: number;
|
|
20
20
|
}) => number;
|
|
21
21
|
export declare const skipBackwardToSafeItem: ({ currentIndex, nextIndex, listSize, itemIsDisabled, }: {
|
|
22
22
|
currentIndex: number;
|
|
23
|
-
nextIndex: number;
|
|
24
|
-
listSize: number;
|
|
25
23
|
itemIsDisabled: (idx: number) => boolean;
|
|
24
|
+
listSize: number;
|
|
25
|
+
nextIndex: number;
|
|
26
26
|
}) => number;
|
|
27
27
|
export declare const findHandlerByTrigger: ({ trigger, editorState, }: {
|
|
28
|
-
trigger: string;
|
|
29
28
|
editorState: EditorState;
|
|
29
|
+
trigger: string;
|
|
30
30
|
}) => TypeAheadHandler | null;
|
|
31
31
|
type MoveSelectedIndexProps = {
|
|
32
|
-
editorView: EditorView;
|
|
33
|
-
direction: 'next' | 'previous';
|
|
34
32
|
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
33
|
+
direction: 'next' | 'previous';
|
|
34
|
+
editorView: EditorView;
|
|
35
35
|
};
|
|
36
36
|
export declare const moveSelectedIndex: ({ editorView, direction, api }: MoveSelectedIndexProps) => () => void;
|
|
37
37
|
type TypeAheadAssistiveLabels = {
|
|
38
|
-
popupAriaLabel: string;
|
|
39
38
|
listItemAriaLabel?: string;
|
|
39
|
+
popupAriaLabel: string;
|
|
40
40
|
};
|
|
41
41
|
export declare const getTypeAheadListAriaLabels: (trigger: string | undefined, intl: IntlShape, item?: TypeAheadItem) => TypeAheadAssistiveLabels;
|
|
42
42
|
export {};
|
|
@@ -8,22 +8,30 @@ import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
|
|
|
8
8
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { type TypeAheadPluginOptions, type TypeAheadPluginSharedState, type OpenTypeAheadProps } from './types';
|
|
10
10
|
type InsertTypeAheadItemProps = {
|
|
11
|
-
triggerHandler: TypeAheadHandler;
|
|
12
11
|
contentItem: TypeAheadItem;
|
|
12
|
+
mode?: SelectItemMode;
|
|
13
13
|
query: string;
|
|
14
14
|
sourceListItem: TypeAheadItem[];
|
|
15
|
-
|
|
15
|
+
triggerHandler: TypeAheadHandler;
|
|
16
16
|
};
|
|
17
17
|
type CloseTypeAheadProps = {
|
|
18
|
-
insertCurrentQueryAsRawText: boolean;
|
|
19
18
|
attachCommand?: Command;
|
|
19
|
+
insertCurrentQueryAsRawText: boolean;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Type ahead plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
23
23
|
* from `@atlaskit/editor-core`.
|
|
24
24
|
*/
|
|
25
25
|
export type TypeAheadPlugin = NextEditorPlugin<'typeAhead', {
|
|
26
|
-
|
|
26
|
+
actions: {
|
|
27
|
+
close: (props: CloseTypeAheadProps) => boolean;
|
|
28
|
+
findHandlerByTrigger: (trigger: string) => TypeAheadHandler | null;
|
|
29
|
+
insert: (props: InsertTypeAheadItemProps) => boolean;
|
|
30
|
+
isAllowed: (editorState: EditorState) => boolean;
|
|
31
|
+
isOpen: (editorState: EditorState) => boolean;
|
|
32
|
+
open: (props: OpenTypeAheadProps) => boolean;
|
|
33
|
+
openAtTransaction: (props: OpenTypeAheadProps) => (tr: Transaction) => boolean;
|
|
34
|
+
};
|
|
27
35
|
dependencies: [
|
|
28
36
|
OptionalPlugin<AnalyticsPlugin>,
|
|
29
37
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
@@ -31,15 +39,7 @@ export type TypeAheadPlugin = NextEditorPlugin<'typeAhead', {
|
|
|
31
39
|
OptionalPlugin<ContextPanelPlugin>,
|
|
32
40
|
OptionalPlugin<MetricsPlugin>
|
|
33
41
|
];
|
|
42
|
+
pluginConfiguration: TypeAheadPluginOptions | undefined;
|
|
34
43
|
sharedState: TypeAheadPluginSharedState;
|
|
35
|
-
actions: {
|
|
36
|
-
isOpen: (editorState: EditorState) => boolean;
|
|
37
|
-
isAllowed: (editorState: EditorState) => boolean;
|
|
38
|
-
insert: (props: InsertTypeAheadItemProps) => boolean;
|
|
39
|
-
findHandlerByTrigger: (trigger: string) => TypeAheadHandler | null;
|
|
40
|
-
open: (props: OpenTypeAheadProps) => boolean;
|
|
41
|
-
close: (props: CloseTypeAheadProps) => boolean;
|
|
42
|
-
openAtTransaction: (props: OpenTypeAheadProps) => (tr: Transaction) => boolean;
|
|
43
|
-
};
|
|
44
44
|
}>;
|
|
45
45
|
export {};
|
|
@@ -17,32 +17,32 @@ export interface TypeAheadStatsSerializable extends TypeAheadStats {
|
|
|
17
17
|
serialize: () => TypeAheadStats;
|
|
18
18
|
}
|
|
19
19
|
export interface TypeAheadStatsModifier extends TypeAheadStatsSerializable {
|
|
20
|
-
increaseArrowUp: () => void;
|
|
21
20
|
increaseArrowDown: () => void;
|
|
21
|
+
increaseArrowUp: () => void;
|
|
22
22
|
}
|
|
23
23
|
export interface TypeAheadStatsMobileModifier extends TypeAheadStatsSerializable {
|
|
24
|
-
resetTime: () => void;
|
|
25
24
|
closeTime: () => void;
|
|
25
|
+
resetTime: () => void;
|
|
26
26
|
}
|
|
27
27
|
export type TypeAheadPluginState = {
|
|
28
|
-
decorationSet: DecorationSet;
|
|
29
28
|
decorationElement: HTMLElement | null;
|
|
30
|
-
|
|
31
|
-
query: string;
|
|
32
|
-
items: Array<TypeAheadItem>;
|
|
29
|
+
decorationSet: DecorationSet;
|
|
33
30
|
errorInfo: TypeAheadErrorInfo;
|
|
34
|
-
triggerHandler?: TypeAheadHandler;
|
|
35
|
-
selectedIndex: number;
|
|
36
|
-
stats: TypeAheadStatsSerializable | null;
|
|
37
31
|
inputMethod: TypeAheadInputMethod | null;
|
|
32
|
+
items: Array<TypeAheadItem>;
|
|
33
|
+
query: string;
|
|
38
34
|
/**
|
|
39
35
|
* If true, removes the trigger character from query when typeahead is closed
|
|
40
36
|
*/
|
|
41
37
|
removePrefixTriggerOnCancel?: boolean;
|
|
38
|
+
selectedIndex: number;
|
|
39
|
+
stats: TypeAheadStatsSerializable | null;
|
|
40
|
+
triggerHandler?: TypeAheadHandler;
|
|
41
|
+
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
42
42
|
};
|
|
43
43
|
export type OnInsertSelectedItemProps = {
|
|
44
|
-
mode: SelectItemMode;
|
|
45
44
|
index: number;
|
|
45
|
+
mode: SelectItemMode;
|
|
46
46
|
query: string;
|
|
47
47
|
};
|
|
48
48
|
export type OnItemMatchProps = {
|
|
@@ -61,12 +61,12 @@ export type InsertionTransactionMeta = (editorState: EditorState) => Transaction
|
|
|
61
61
|
type PopupMountPoints = Pick<UiComponentFactoryParams, 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement'>;
|
|
62
62
|
export type PopupMountPointReference = Record<'current', PopupMountPoints | null>;
|
|
63
63
|
export type CreateTypeAheadDecorations = (tr: ReadonlyTransaction, options: {
|
|
64
|
-
triggerHandler: TypeAheadHandler;
|
|
65
64
|
inputMethod: TypeAheadInputMethod;
|
|
66
65
|
reopenQuery?: string;
|
|
66
|
+
triggerHandler: TypeAheadHandler;
|
|
67
67
|
}) => {
|
|
68
|
-
decorationSet: DecorationSet;
|
|
69
68
|
decorationElement: HTMLElement | null;
|
|
69
|
+
decorationSet: DecorationSet;
|
|
70
70
|
stats: TypeAheadStatsSerializable | null;
|
|
71
71
|
};
|
|
72
72
|
export type RemoveTypeAheadDecorations = (decorationSet?: DecorationSet) => boolean;
|
|
@@ -80,20 +80,20 @@ export type TypeAheadPluginOptions = {
|
|
|
80
80
|
isMobile?: boolean;
|
|
81
81
|
};
|
|
82
82
|
export interface TypeAheadPluginSharedState {
|
|
83
|
-
query: string;
|
|
84
|
-
isOpen: boolean;
|
|
85
|
-
isAllowed: boolean;
|
|
86
83
|
currentHandler?: TypeAheadHandler;
|
|
87
|
-
decorationSet: DecorationSet;
|
|
88
84
|
decorationElement: HTMLElement | null;
|
|
89
|
-
|
|
90
|
-
items: Array<TypeAheadItem>;
|
|
85
|
+
decorationSet: DecorationSet;
|
|
91
86
|
errorInfo: TypeAheadErrorInfo;
|
|
87
|
+
isAllowed: boolean;
|
|
88
|
+
isOpen: boolean;
|
|
89
|
+
items: Array<TypeAheadItem>;
|
|
90
|
+
query: string;
|
|
92
91
|
selectedIndex: number;
|
|
92
|
+
triggerHandler?: TypeAheadHandler;
|
|
93
93
|
}
|
|
94
94
|
export type OpenTypeAheadProps = {
|
|
95
|
-
triggerHandler: TypeAheadHandler;
|
|
96
95
|
inputMethod: TypeAheadInputMethod;
|
|
97
96
|
query?: string;
|
|
98
97
|
removePrefixTriggerOnCancel?: boolean;
|
|
98
|
+
triggerHandler: TypeAheadHandler;
|
|
99
99
|
};
|
|
@@ -9,23 +9,23 @@ import type { TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
|
9
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
10
|
import { CloseSelectionOptions } from '../pm-plugins/constants';
|
|
11
11
|
type InputQueryProps = {
|
|
12
|
-
triggerQueryPrefix: string;
|
|
13
|
-
onQueryChange: (query: string) => void;
|
|
14
|
-
onItemSelect: (mode: SelectItemMode) => void;
|
|
15
|
-
selectNextItem: () => void;
|
|
16
|
-
selectPreviousItem: () => void;
|
|
17
12
|
cancel: (props: {
|
|
13
|
+
addPrefixTrigger: boolean;
|
|
18
14
|
forceFocusOnEditor: boolean;
|
|
19
15
|
setSelectionAt: CloseSelectionOptions;
|
|
20
|
-
addPrefixTrigger: boolean;
|
|
21
16
|
text: string;
|
|
22
17
|
}) => void;
|
|
23
|
-
|
|
18
|
+
editorView: EditorView;
|
|
24
19
|
forceFocus: boolean;
|
|
20
|
+
items: TypeAheadItem[];
|
|
21
|
+
onItemSelect: (mode: SelectItemMode) => void;
|
|
22
|
+
onQueryChange: (query: string) => void;
|
|
23
|
+
onQueryFocus: () => void;
|
|
25
24
|
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
|
|
26
25
|
reopenQuery?: string;
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
selectNextItem: () => void;
|
|
27
|
+
selectPreviousItem: () => void;
|
|
28
|
+
triggerQueryPrefix: string;
|
|
29
29
|
};
|
|
30
30
|
export declare const InputQuery: React.MemoExoticComponent<({ triggerQueryPrefix, cancel, onQueryChange, onItemSelect, selectNextItem, selectPreviousItem, forceFocus, reopenQuery, onQueryFocus, onUndoRedo, editorView, items, }: InputQueryProps) => jsx.JSX.Element>;
|
|
31
31
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { type ReactNode, type MouseEventHandler } from 'react';
|
|
2
2
|
import { type ListRowProps } from 'react-virtualized';
|
|
3
3
|
type Props = {
|
|
4
|
+
children: ReactNode;
|
|
4
5
|
measure: () => void;
|
|
5
|
-
registerChild?: (element?: Element) => void;
|
|
6
6
|
onMouseMove: MouseEventHandler<HTMLDivElement>;
|
|
7
|
-
|
|
7
|
+
registerChild?: (element?: Element) => void;
|
|
8
8
|
} & Pick<ListRowProps, 'index' | 'style' | 'isScrolling' | 'isVisible'>;
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
type Props = {
|
|
3
|
-
onClick: () => void;
|
|
4
|
-
isFocused: boolean;
|
|
5
|
-
title: string;
|
|
6
3
|
ariaLabel?: string;
|
|
7
4
|
iconBefore?: React.ReactNode;
|
|
5
|
+
isFocused: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
title: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const MoreOptions: ({ onClick, isFocused, title, ariaLabel, iconBefore }: Props) => jsx.JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
type EmptyStateProps = {
|
|
3
|
-
header: string;
|
|
4
|
-
testId?: string;
|
|
5
3
|
description?: React.ReactNode;
|
|
4
|
+
header: string;
|
|
6
5
|
renderImage?: () => React.ReactNode;
|
|
6
|
+
testId?: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const EmptyState: ({ testId, header, description, renderImage }: EmptyStateProps) => React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -11,29 +11,29 @@ import { type InputMethodType } from '../pm-plugins/analytics';
|
|
|
11
11
|
import { type TypeAheadPlugin } from '../typeAheadPluginType';
|
|
12
12
|
import type { TypeAheadHandler } from '../types';
|
|
13
13
|
export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlProps<{
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
15
|
+
decorationElement: HTMLElement;
|
|
16
16
|
editorView: EditorView;
|
|
17
|
-
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
18
17
|
fitHeight: number;
|
|
19
|
-
|
|
20
|
-
triggerHandler?: TypeAheadHandler;
|
|
18
|
+
items: Array<TypeAheadItem>;
|
|
21
19
|
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
22
|
-
|
|
23
|
-
showMoreOptionsButton?: boolean;
|
|
20
|
+
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
24
21
|
onMoreOptionsClicked?: () => void;
|
|
22
|
+
selectedIndex: number;
|
|
23
|
+
showMoreOptionsButton?: boolean;
|
|
24
|
+
triggerHandler?: TypeAheadHandler;
|
|
25
25
|
} & WrappedComponentProps>> & {
|
|
26
26
|
WrappedComponent: React.ComponentType<{
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
28
|
+
decorationElement: HTMLElement;
|
|
29
29
|
editorView: EditorView;
|
|
30
|
-
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
31
30
|
fitHeight: number;
|
|
32
|
-
|
|
33
|
-
triggerHandler?: TypeAheadHandler;
|
|
31
|
+
items: Array<TypeAheadItem>;
|
|
34
32
|
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
35
|
-
|
|
36
|
-
showMoreOptionsButton?: boolean;
|
|
33
|
+
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
37
34
|
onMoreOptionsClicked?: () => void;
|
|
35
|
+
selectedIndex: number;
|
|
36
|
+
showMoreOptionsButton?: boolean;
|
|
37
|
+
triggerHandler?: TypeAheadHandler;
|
|
38
38
|
} & WrappedComponentProps>;
|
|
39
39
|
};
|
|
@@ -9,15 +9,15 @@ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-c
|
|
|
9
9
|
import { type TypeAheadPlugin } from '../typeAheadPluginType';
|
|
10
10
|
export declare const itemIcon: import("@emotion/react").SerializedStyles;
|
|
11
11
|
type TypeAheadListItemProps = {
|
|
12
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
firstOnlineSupportedIndex: number;
|
|
12
15
|
item: TypeAheadItem;
|
|
13
|
-
itemsLength: number;
|
|
14
16
|
itemIndex: number;
|
|
15
|
-
|
|
16
|
-
ariaLabel?: string;
|
|
17
|
-
onItemClick: (mode: SelectItemMode, index: number) => void;
|
|
17
|
+
itemsLength: number;
|
|
18
18
|
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
onItemClick: (mode: SelectItemMode, index: number) => void;
|
|
20
|
+
selectedIndex: number;
|
|
21
21
|
};
|
|
22
22
|
export declare const TypeAheadListItem: React.MemoExoticComponent<({ item, itemsLength, selectedIndex, onItemClick, itemIndex, ariaLabel, moreElementsInQuickInsertViewEnabled, api, firstOnlineSupportedIndex, }: TypeAheadListItemProps) => jsx.JSX.Element>;
|
|
23
23
|
export {};
|
|
@@ -4,11 +4,11 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
5
|
import type { PopupMountPointReference, TypeAheadPluginSharedState } from '../types';
|
|
6
6
|
type TypeAheadMenuType = {
|
|
7
|
-
|
|
7
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
popupMountRef: PopupMountPointReference;
|
|
10
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
11
10
|
selectedIndex: number;
|
|
11
|
+
typeAheadState: Omit<TypeAheadPluginSharedState, 'isOpen' | 'isAllowed' | 'selectedIndex'>;
|
|
12
12
|
};
|
|
13
13
|
export declare const TypeAheadMenu: React.MemoExoticComponent<({ editorView, popupMountRef, typeAheadState, selectedIndex, api }: TypeAheadMenuType) => React.JSX.Element | null>;
|
|
14
14
|
export {};
|
|
@@ -11,26 +11,26 @@ import { CloseSelectionOptions } from '../pm-plugins/constants';
|
|
|
11
11
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
12
12
|
import type { OnSelectItem, TypeAheadErrorInfo } from '../types';
|
|
13
13
|
type TypeAheadPopupProps = {
|
|
14
|
-
triggerHandler: TypeAheadHandler;
|
|
15
|
-
editorView: EditorView;
|
|
16
14
|
anchorElement: HTMLElement;
|
|
17
|
-
|
|
18
|
-
popupsBoundariesElement?: HTMLElement;
|
|
19
|
-
popupsScrollableElement?: HTMLElement;
|
|
20
|
-
items: Array<TypeAheadItem>;
|
|
21
|
-
errorInfo: TypeAheadErrorInfo;
|
|
22
|
-
selectedIndex: number;
|
|
23
|
-
setSelectedItem: OnSelectItem;
|
|
24
|
-
decorationSet: DecorationSet;
|
|
25
|
-
isEmptyQuery: boolean;
|
|
26
|
-
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
15
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
27
16
|
cancel: (params: {
|
|
28
|
-
setSelectionAt: CloseSelectionOptions;
|
|
29
17
|
addPrefixTrigger: boolean;
|
|
30
18
|
forceFocusOnEditor: boolean;
|
|
19
|
+
setSelectionAt: CloseSelectionOptions;
|
|
31
20
|
}) => void;
|
|
32
|
-
|
|
21
|
+
decorationSet: DecorationSet;
|
|
22
|
+
editorView: EditorView;
|
|
23
|
+
errorInfo: TypeAheadErrorInfo;
|
|
24
|
+
isEmptyQuery: boolean;
|
|
25
|
+
items: Array<TypeAheadItem>;
|
|
26
|
+
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
27
|
+
popupsBoundariesElement?: HTMLElement;
|
|
28
|
+
popupsMountPoint?: HTMLElement;
|
|
29
|
+
popupsScrollableElement?: HTMLElement;
|
|
30
|
+
selectedIndex: number;
|
|
31
|
+
setSelectedItem: OnSelectItem;
|
|
33
32
|
showMoreOptionsButton?: boolean;
|
|
33
|
+
triggerHandler: TypeAheadHandler;
|
|
34
34
|
};
|
|
35
35
|
export declare const TypeAheadPopup: React.MemoExoticComponent<(props: TypeAheadPopupProps) => jsx.JSX.Element>;
|
|
36
36
|
export {};
|
|
@@ -4,18 +4,18 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
5
|
import type { TypeAheadHandler, TypeAheadInputMethod } from '../types';
|
|
6
6
|
type WrapperProps = {
|
|
7
|
-
triggerHandler: TypeAheadHandler;
|
|
8
|
-
editorView: EditorView;
|
|
9
7
|
anchorElement: HTMLElement;
|
|
8
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
9
|
+
editorView: EditorView;
|
|
10
10
|
getDecorationPosition: () => number | undefined;
|
|
11
|
-
|
|
11
|
+
inputMethod?: TypeAheadInputMethod;
|
|
12
12
|
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
|
|
13
|
-
reopenQuery?: string;
|
|
14
|
-
popupsMountPoint?: HTMLElement;
|
|
15
13
|
popupsBoundariesElement?: HTMLElement;
|
|
14
|
+
popupsMountPoint?: HTMLElement;
|
|
16
15
|
popupsScrollableElement?: HTMLElement;
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
reopenQuery?: string;
|
|
17
|
+
shouldFocusCursorInsideQuery: boolean;
|
|
18
|
+
triggerHandler: TypeAheadHandler;
|
|
19
19
|
};
|
|
20
20
|
export declare const WrapperTypeAhead: React.MemoExoticComponent<({ triggerHandler, editorView, anchorElement, shouldFocusCursorInsideQuery, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, inputMethod, getDecorationPosition, reopenQuery, onUndoRedo, api, }: WrapperProps) => React.JSX.Element | null>;
|
|
21
21
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
type Props = {
|
|
4
|
-
|
|
4
|
+
closePopup: () => void;
|
|
5
|
+
editorView: EditorView;
|
|
5
6
|
items: Array<TypeAheadItem>;
|
|
6
7
|
query: string;
|
|
7
|
-
|
|
8
|
-
closePopup: () => void;
|
|
8
|
+
triggerHandler: TypeAheadHandler;
|
|
9
9
|
};
|
|
10
10
|
export declare const useOnForceSelect: ({ triggerHandler, items, query, editorView, closePopup, }: Props) => void;
|
|
11
11
|
export {};
|
|
@@ -4,10 +4,10 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
5
5
|
import type { PopupMountPointReference, TypeAheadPluginSharedState } from '../../types';
|
|
6
6
|
type TypeAheadMenuType = {
|
|
7
|
-
|
|
7
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
8
8
|
editorView: EditorView;
|
|
9
9
|
popupMountRef: PopupMountPointReference;
|
|
10
|
-
|
|
10
|
+
typeAheadState: Omit<TypeAheadPluginSharedState, 'isOpen' | 'isAllowed' | 'selectedIndex'>;
|
|
11
11
|
};
|
|
12
12
|
export declare const TypeAheadMenu: React.MemoExoticComponent<({ editorView, popupMountRef, typeAheadState, api }: TypeAheadMenuType) => React.JSX.Element | null>;
|
|
13
13
|
export {};
|
|
@@ -11,27 +11,27 @@ import { CloseSelectionOptions } from '../../pm-plugins/constants';
|
|
|
11
11
|
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
12
12
|
import type { TypeAheadErrorInfo } from '../../types';
|
|
13
13
|
type TypeAheadPopupProps = {
|
|
14
|
-
triggerHandler: TypeAheadHandler;
|
|
15
|
-
editorView: EditorView;
|
|
16
14
|
anchorElement: HTMLElement;
|
|
17
|
-
|
|
18
|
-
popupsBoundariesElement?: HTMLElement;
|
|
19
|
-
popupsScrollableElement?: HTMLElement;
|
|
20
|
-
items: Array<TypeAheadItem>;
|
|
21
|
-
errorInfo: TypeAheadErrorInfo;
|
|
22
|
-
decorationSet: DecorationSet;
|
|
23
|
-
isEmptyQuery: boolean;
|
|
24
|
-
query: string;
|
|
25
|
-
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
15
|
+
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
26
16
|
cancel: (params: {
|
|
27
|
-
setSelectionAt: CloseSelectionOptions;
|
|
28
17
|
addPrefixTrigger: boolean;
|
|
29
18
|
forceFocusOnEditor: boolean;
|
|
19
|
+
setSelectionAt: CloseSelectionOptions;
|
|
30
20
|
}) => void;
|
|
31
|
-
|
|
21
|
+
decorationSet: DecorationSet;
|
|
22
|
+
editorView: EditorView;
|
|
23
|
+
errorInfo: TypeAheadErrorInfo;
|
|
24
|
+
isEmptyQuery: boolean;
|
|
25
|
+
items: Array<TypeAheadItem>;
|
|
26
|
+
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
27
|
+
popupsBoundariesElement?: HTMLElement;
|
|
28
|
+
popupsMountPoint?: HTMLElement;
|
|
29
|
+
popupsScrollableElement?: HTMLElement;
|
|
30
|
+
query: string;
|
|
32
31
|
setSelectedItem?: (props: {
|
|
33
32
|
index: number;
|
|
34
33
|
}) => void;
|
|
34
|
+
triggerHandler: TypeAheadHandler;
|
|
35
35
|
};
|
|
36
36
|
export declare const TypeAheadPopup: React.MemoExoticComponent<(props: TypeAheadPopupProps) => jsx.JSX.Element>;
|
|
37
37
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/primitives": "^14.11.0",
|
|
48
48
|
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
49
49
|
"@atlaskit/theme": "^19.0.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
51
51
|
"@atlaskit/tokens": "^6.0.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"w3c-keyname": "^2.1.8"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@atlaskit/editor-common": "^107.
|
|
61
|
+
"@atlaskit/editor-common": "^107.28.0",
|
|
62
62
|
"react": "^18.2.0",
|
|
63
63
|
"react-dom": "^18.2.0",
|
|
64
64
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@af/visual-regression": "workspace:^",
|
|
68
68
|
"@atlaskit/ssr": "workspace:^",
|
|
69
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
70
69
|
"@testing-library/react": "^13.4.0",
|
|
71
70
|
"@types/react-virtualized": "^9.18.12",
|
|
72
71
|
"wait-for-expect": "^1.2.0"
|