@atlaskit/editor-plugin-type-ahead 11.3.5 → 11.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/commands/package.json +1 -8
- package/package.json +2 -2
- package/type-ahead-plugin/package.json +1 -8
- package/type-ahead-plugin-type/package.json +1 -8
- package/types/package.json +1 -8
- package/dist/types-ts4.5/entry-points/commands.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/type-ahead-plugin-type.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/type-ahead-plugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/analytics.d.ts +0 -8
- package/dist/types-ts4.5/pm-plugins/api.d.ts +0 -60
- package/dist/types-ts4.5/pm-plugins/commands/clear-list-error.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/commands/close-type-ahead.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/commands/insert-type-ahead-item.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/commands/insert-utils.d.ts +0 -18
- package/dist/types-ts4.5/pm-plugins/commands/open-typeahead-at-cursor.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/commands/set-selection-before-query.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/commands/update-list-error.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/commands/update-list-items.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/commands/update-query.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/commands/update-section-title.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/commands/update-selected-index.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/constants.d.ts +0 -8
- package/dist/types-ts4.5/pm-plugins/decorations.d.ts +0 -17
- package/dist/types-ts4.5/pm-plugins/input-rules.d.ts +0 -6
- package/dist/types-ts4.5/pm-plugins/insert-item-plugin.d.ts +0 -2
- package/dist/types-ts4.5/pm-plugins/isInsertionTransaction.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/item-is-disabled.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/key.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -18
- package/dist/types-ts4.5/pm-plugins/reducer.d.ts +0 -10
- package/dist/types-ts4.5/pm-plugins/stats-modifier.d.ts +0 -20
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -42
- package/dist/types-ts4.5/typeAheadPlugin.d.ts +0 -10
- package/dist/types-ts4.5/typeAheadPluginType.d.ts +0 -52
- package/dist/types-ts4.5/types/index.d.ts +0 -114
- package/dist/types-ts4.5/ui/ContentComponent.d.ts +0 -12
- package/dist/types-ts4.5/ui/InputQuery.d.ts +0 -31
- package/dist/types-ts4.5/ui/ListRow.d.ts +0 -21
- package/dist/types-ts4.5/ui/MoreOptions.d.ts +0 -16
- package/dist/types-ts4.5/ui/TypeAheadErrorFallback/EmptyState.d.ts +0 -9
- package/dist/types-ts4.5/ui/TypeAheadErrorFallback/GenericErrorSVG.d.ts +0 -6
- package/dist/types-ts4.5/ui/TypeAheadErrorFallback/MinHeightContainer.d.ts +0 -10
- package/dist/types-ts4.5/ui/TypeAheadErrorFallback/index.d.ts +0 -6
- package/dist/types-ts4.5/ui/TypeAheadList.d.ts +0 -55
- package/dist/types-ts4.5/ui/TypeAheadListItem.d.ts +0 -25
- package/dist/types-ts4.5/ui/TypeAheadMenu.d.ts +0 -14
- package/dist/types-ts4.5/ui/TypeAheadPopup.d.ts +0 -38
- package/dist/types-ts4.5/ui/WrapperTypeAhead.d.ts +0 -21
- package/dist/types-ts4.5/ui/hooks/build-sectioned-result.d.ts +0 -11
- package/dist/types-ts4.5/ui/hooks/use-item-insert.d.ts +0 -9
- package/dist/types-ts4.5/ui/hooks/use-load-items.d.ts +0 -5
- package/dist/types-ts4.5/ui/hooks/use-on-force-select.d.ts +0 -11
package/CHANGELOG.md
CHANGED
package/commands/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/commands.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/commands.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/commands.d.ts"
|
|
17
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "11.3.
|
|
3
|
+
"version": "11.3.6",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/primitives": "^19.0.0",
|
|
45
45
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
46
46
|
"@atlaskit/prosemirror-input-rules": "^3.7.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
48
48
|
"@atlaskit/tokens": "^13.4.0",
|
|
49
49
|
"@atlaskit/visually-hidden": "^3.1.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/type-ahead-plugin.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/type-ahead-plugin.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/type-ahead-plugin.d.ts"
|
|
17
10
|
}
|
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/type-ahead-plugin-type.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/type-ahead-plugin-type.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/type-ahead-plugin-type.d.ts"
|
|
17
10
|
}
|
package/types/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
17
10
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { openTypeAhead, openTypeAheadAtCursor, } from '../pm-plugins/commands/open-typeahead-at-cursor';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { typeAheadPlugin } from '../typeAheadPlugin';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { OpenTypeAheadProps, TypeAheadHandler, TypeAheadInputMethod, TypeAheadPluginOptions, TypeAheadPluginState, TypeAheadPluginSharedState, } from '../types/index';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { typeAheadPlugin } from './typeAheadPlugin';
|
|
2
|
-
export type { TypeAheadPlugin } from './typeAheadPluginType';
|
|
3
|
-
export type { OpenTypeAheadProps, TypeAheadHandler, TypeAheadInputMethod, TypeAheadPluginOptions, TypeAheadPluginState, TypeAheadPluginSharedState, } from './types';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare enum ACTIONS {
|
|
2
|
-
OPEN_TYPEAHEAD_AT_CURSOR = "OPEN_TYPEAHEAD_AT_CURSOR",
|
|
3
|
-
CLOSE_TYPE_AHEAD = "CLOSE_TYPE_AHEAD",
|
|
4
|
-
CHANGE_QUERY = "CHANGE_QUERY",
|
|
5
|
-
INSERT_ITEM = "INSERT_ITEM",
|
|
6
|
-
INSERT_RAW_QUERY = "INSERT_RAW_QUERY",
|
|
7
|
-
UPDATE_LIST_ITEMS = "UPDATE_LIST_ITEMS",
|
|
8
|
-
UPDATE_LIST_ERROR = "UPDATE_LIST_ERROR",
|
|
9
|
-
CLEAR_LIST_ERROR = "CLEAR_LIST_ERROR",
|
|
10
|
-
UPDATE_SELECTED_INDEX = "UPDATE_SELECTED_INDEX",
|
|
11
|
-
UPDATE_SECTION_TITLE = "UPDATE_SECTION_TITLE"
|
|
12
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
|
-
import type { TypeAheadInputMethod } from '../types';
|
|
6
|
-
export type CloseActionType = ACTION.INSERTED | ACTION.CANCELLED | ACTION.VIEW_MORE;
|
|
7
|
-
export type InputMethodType = INPUT_METHOD.KEYBOARD | INPUT_METHOD.MOUSE;
|
|
8
|
-
export declare const fireTypeAheadClosedAnalyticsEvent: (api: ExtractInjectionAPI<TypeAheadPlugin> | undefined, closeAction: CloseActionType | null, hasQuery: boolean, inputMethod: InputMethodType | null, invocationMethod?: TypeAheadInputMethod | null) => void;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
3
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { TypeAheadHandler, TypeAheadInputMethod } from '../types';
|
|
6
|
-
type CloseOptions = {
|
|
7
|
-
attachCommand?: Command;
|
|
8
|
-
insertCurrentQueryAsRawText: boolean;
|
|
9
|
-
};
|
|
10
|
-
type InsertItemProps = {
|
|
11
|
-
contentItem: TypeAheadItem;
|
|
12
|
-
query: string;
|
|
13
|
-
sourceListItem: TypeAheadItem[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Please do not use it. Ping #help-editor and talk to the Lego team before use it.
|
|
17
|
-
*
|
|
18
|
-
* @private
|
|
19
|
-
* @deprecated
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
export declare const createTypeAheadTools: (editorView: EditorView) => {
|
|
23
|
-
close: (options?: CloseOptions) => boolean;
|
|
24
|
-
currentQuery: () => string | undefined;
|
|
25
|
-
insertItemEmoji: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
|
|
26
|
-
insertItemMention: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
|
|
27
|
-
insertItemQuickInsert: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
|
|
28
|
-
isOpen: () => TypeAheadHandler | false;
|
|
29
|
-
openEmoji: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
30
|
-
openMention: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
31
|
-
openQuickInsert: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
32
|
-
searchEmoji: (query?: string) => {
|
|
33
|
-
close: (options?: CloseOptions) => boolean;
|
|
34
|
-
insert: ({ index, mode }: {
|
|
35
|
-
index: number;
|
|
36
|
-
mode?: SelectItemMode;
|
|
37
|
-
}) => Promise<void>;
|
|
38
|
-
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
39
|
-
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
40
|
-
};
|
|
41
|
-
searchMention: (query?: string) => {
|
|
42
|
-
close: (options?: CloseOptions) => boolean;
|
|
43
|
-
insert: ({ index, mode }: {
|
|
44
|
-
index: number;
|
|
45
|
-
mode?: SelectItemMode;
|
|
46
|
-
}) => Promise<void>;
|
|
47
|
-
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
48
|
-
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
49
|
-
};
|
|
50
|
-
searchQuickInsert: (query?: string) => {
|
|
51
|
-
close: (options?: CloseOptions) => boolean;
|
|
52
|
-
insert: ({ index, mode }: {
|
|
53
|
-
index: number;
|
|
54
|
-
mode?: SelectItemMode;
|
|
55
|
-
}) => Promise<void>;
|
|
56
|
-
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
57
|
-
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
2
|
-
import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
type Props = {
|
|
5
|
-
handler: TypeAheadHandler;
|
|
6
|
-
item: TypeAheadItem;
|
|
7
|
-
mode: SelectItemMode;
|
|
8
|
-
query: string;
|
|
9
|
-
sourceListItem: Array<TypeAheadItem>;
|
|
10
|
-
};
|
|
11
|
-
export declare const insertTypeAheadItem: (view: EditorView) => ({ item, handler, mode, query, sourceListItem }: Props) => void;
|
|
12
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
type Position = {
|
|
4
|
-
end: number;
|
|
5
|
-
start: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const insertBlockNode: ({ node, tr, position, }: {
|
|
8
|
-
node: PMNode;
|
|
9
|
-
position: Position;
|
|
10
|
-
tr: Transaction;
|
|
11
|
-
}) => Transaction;
|
|
12
|
-
export declare const insertInlineNodeOrFragment: ({ maybeFragment, tr, position, selectInlineNode, }: {
|
|
13
|
-
maybeFragment: Fragment | PMNode;
|
|
14
|
-
position: Position;
|
|
15
|
-
selectInlineNode: boolean;
|
|
16
|
-
tr: Transaction;
|
|
17
|
-
}) => Transaction;
|
|
18
|
-
export {};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { OpenTypeAheadProps } from '../../types';
|
|
4
|
-
export declare const openTypeAhead: (props: OpenTypeAheadProps) => (tr: Transaction) => void;
|
|
5
|
-
export declare const openTypeAheadAtCursor: ({ triggerHandler, inputMethod, query, removePrefixTriggerOnCancel, }: OpenTypeAheadProps) => EditorCommand;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
3
|
-
export declare const updateSelectedIndex: (selectedIndex: number, api: ExtractInjectionAPI<TypeAheadPlugin> | undefined) => Command;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const TYPE_AHEAD_DECORATION_KEY = "typeahead_decoration_key";
|
|
2
|
-
export declare const TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = "typeaheadDecoration";
|
|
3
|
-
export declare const TYPE_AHEAD_POPUP_CONTENT_CLASS = "fabric-editor-typeahead";
|
|
4
|
-
export declare const TYPE_AHEAD_DECORATION_ELEMENT_ID = "typeahaed_decoration_element_id";
|
|
5
|
-
export declare enum CloseSelectionOptions {
|
|
6
|
-
BEFORE_TEXT_INSERTED = "BEFORE_TEXT_INSERTED",
|
|
7
|
-
AFTER_TEXT_INSERTED = "AFTER_TEXT_INSERTED"
|
|
8
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
|
-
import type { CreateTypeAheadDecorations, PopupMountPointReference, RemoveTypeAheadDecorations } from '../types';
|
|
6
|
-
type FactoryProps = {
|
|
7
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
8
|
-
intl: IntlShape;
|
|
9
|
-
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
10
|
-
popupMountRef: PopupMountPointReference;
|
|
11
|
-
};
|
|
12
|
-
type FactoryReturn = {
|
|
13
|
-
createDecorations: CreateTypeAheadDecorations;
|
|
14
|
-
removeDecorations: RemoveTypeAheadDecorations;
|
|
15
|
-
};
|
|
16
|
-
export declare const factoryDecorations: ({ intl, popupMountRef, nodeViewPortalProviderAPI, api, }: FactoryProps) => FactoryReturn;
|
|
17
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { TypeAheadHandler } from '../types';
|
|
5
|
-
export declare function inputRulePlugin(schema: Schema, typeAheads: TypeAheadHandler[], featureFlags: FeatureFlags): SafePlugin | undefined;
|
|
6
|
-
export default inputRulePlugin;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { InsertionTransactionMeta } from '../types';
|
|
3
|
-
import type { ACTIONS } from './actions';
|
|
4
|
-
export declare const isInsertionTransaction: (transactions: readonly Transaction[], action: ACTIONS) => InsertionTransactionMeta | null;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
3
|
-
export declare const itemIsDisabled: (item: TypeAheadItem | undefined, api: ExtractInjectionAPI<TypeAheadPlugin> | undefined) => boolean;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
4
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
7
|
-
import type { PopupMountPointReference, TypeAheadHandler } from '../types';
|
|
8
|
-
type Props = {
|
|
9
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
10
|
-
getIntl: () => IntlShape;
|
|
11
|
-
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
12
|
-
popupMountRef: PopupMountPointReference;
|
|
13
|
-
reactDispatch: Dispatch;
|
|
14
|
-
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
15
|
-
};
|
|
16
|
-
/** Creates the type-ahead ProseMirror plugin. */
|
|
17
|
-
export declare function createPlugin({ reactDispatch, popupMountRef, typeAheadHandlers, getIntl, nodeViewPortalProviderAPI, api, }: Props): SafePlugin;
|
|
18
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { InsertTypeAheadStep } from '@atlaskit/adf-schema/steps';
|
|
2
|
-
import type { ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { CreateTypeAheadDecorations, PopupMountPointReference, RemoveTypeAheadDecorations, TypeAheadHandler, TypeAheadPluginState } from '../types';
|
|
4
|
-
export type ReducerOptions = {
|
|
5
|
-
createDecorations: CreateTypeAheadDecorations;
|
|
6
|
-
popupMountRef: PopupMountPointReference;
|
|
7
|
-
removeDecorations: RemoveTypeAheadDecorations;
|
|
8
|
-
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
9
|
-
};
|
|
10
|
-
export declare const createReducer: ({ typeAheadHandlers, removeDecorations, createDecorations, }: ReducerOptions) => (tr: ReadonlyTransaction, currentPluginState: TypeAheadPluginState, typeAheadStepOverride: InsertTypeAheadStep | null) => TypeAheadPluginState;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { TypeAheadStatsModifier } from '../types';
|
|
2
|
-
export declare class StatsModifier implements TypeAheadStatsModifier {
|
|
3
|
-
startedAt: number;
|
|
4
|
-
endedAt: number;
|
|
5
|
-
keyCount: {
|
|
6
|
-
arrowDown: number;
|
|
7
|
-
arrowUp: number;
|
|
8
|
-
};
|
|
9
|
-
constructor();
|
|
10
|
-
increaseArrowUp: () => void;
|
|
11
|
-
increaseArrowDown: () => void;
|
|
12
|
-
serialize: () => {
|
|
13
|
-
startedAt: number;
|
|
14
|
-
endedAt: number;
|
|
15
|
-
keyCount: {
|
|
16
|
-
arrowUp: number;
|
|
17
|
-
arrowDown: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { ExtractInjectionAPI, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
6
|
-
import type { TypeAheadHandler, TypeAheadPluginState } from '../types';
|
|
7
|
-
export declare const isTypeAheadHandler: (handler: any) => handler is TypeAheadHandler;
|
|
8
|
-
/** Is a typeahead plugin open? */
|
|
9
|
-
export declare const isTypeAheadOpen: (editorState: EditorState) => boolean;
|
|
10
|
-
export declare const getPluginState: (editorState: EditorState) => TypeAheadPluginState | undefined;
|
|
11
|
-
export declare const getTypeAheadHandler: (editorState: EditorState) => TypeAheadHandler | undefined;
|
|
12
|
-
export declare const getTypeAheadQuery: (editorState: EditorState) => string | undefined;
|
|
13
|
-
export declare const isTypeAheadAllowed: (state: EditorState) => boolean;
|
|
14
|
-
export declare const findHandler: (id: string, state: EditorState) => TypeAheadHandler | null;
|
|
15
|
-
export declare const skipForwardToSafeItem: ({ currentIndex, nextIndex, listSize, itemIsDisabled, }: {
|
|
16
|
-
currentIndex: number;
|
|
17
|
-
itemIsDisabled: (idx: number) => boolean;
|
|
18
|
-
listSize: number;
|
|
19
|
-
nextIndex: number;
|
|
20
|
-
}) => number;
|
|
21
|
-
export declare const skipBackwardToSafeItem: ({ currentIndex, nextIndex, listSize, itemIsDisabled, }: {
|
|
22
|
-
currentIndex: number;
|
|
23
|
-
itemIsDisabled: (idx: number) => boolean;
|
|
24
|
-
listSize: number;
|
|
25
|
-
nextIndex: number;
|
|
26
|
-
}) => number;
|
|
27
|
-
export declare const findHandlerByTrigger: ({ trigger, editorState, }: {
|
|
28
|
-
editorState: EditorState;
|
|
29
|
-
trigger: string;
|
|
30
|
-
}) => TypeAheadHandler | null;
|
|
31
|
-
type MoveSelectedIndexProps = {
|
|
32
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
33
|
-
direction: 'next' | 'previous';
|
|
34
|
-
editorView: EditorView;
|
|
35
|
-
};
|
|
36
|
-
export declare const moveSelectedIndex: ({ editorView, direction, api }: MoveSelectedIndexProps) => () => void;
|
|
37
|
-
type TypeAheadAssistiveLabels = {
|
|
38
|
-
listItemAriaLabel?: string;
|
|
39
|
-
popupAriaLabel: string;
|
|
40
|
-
};
|
|
41
|
-
export declare const getTypeAheadListAriaLabels: (trigger: string | undefined, intl: IntlShape, item?: TypeAheadItem) => TypeAheadAssistiveLabels;
|
|
42
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TypeAheadPlugin } from './typeAheadPluginType';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* Revamped typeahead using decorations instead of the `typeAheadQuery` mark
|
|
5
|
-
*
|
|
6
|
-
* https://product-fabric.atlassian.net/wiki/spaces/E/pages/2992177582/Technical+TypeAhead+Data+Flow
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
export declare const typeAheadPlugin: TypeAheadPlugin;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
2
|
-
import type { Command, NextEditorPlugin, OptionalPlugin, TypeAheadHandler, TypeAheadItem, TypeAheadSectionTitleUpdate } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
-
import type { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
|
|
5
|
-
import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
6
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
7
|
-
import type { MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
|
|
8
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
-
import type { TypeAheadPluginOptions, TypeAheadPluginSharedState, OpenTypeAheadProps } from './types';
|
|
10
|
-
type InsertTypeAheadItemProps = {
|
|
11
|
-
contentItem: TypeAheadItem;
|
|
12
|
-
mode?: SelectItemMode;
|
|
13
|
-
query: string;
|
|
14
|
-
sourceListItem: TypeAheadItem[];
|
|
15
|
-
triggerHandler: TypeAheadHandler;
|
|
16
|
-
};
|
|
17
|
-
type CloseTypeAheadProps = {
|
|
18
|
-
attachCommand?: Command;
|
|
19
|
-
insertCurrentQueryAsRawText: boolean;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Type ahead plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
23
|
-
* from `@atlaskit/editor-core`.
|
|
24
|
-
*/
|
|
25
|
-
export type TypeAheadPlugin = NextEditorPlugin<'typeAhead', {
|
|
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
|
-
/**
|
|
35
|
-
* Updates the display title for an existing typeahead section in the current typeahead session.
|
|
36
|
-
*
|
|
37
|
-
* The optional `showTitleWhenOnlySection` flag keeps the title visible when this section is
|
|
38
|
-
* the only populated section. It does not render titles for empty sections.
|
|
39
|
-
*/
|
|
40
|
-
updateSectionTitle?: (props: TypeAheadSectionTitleUpdate) => boolean;
|
|
41
|
-
};
|
|
42
|
-
dependencies: [
|
|
43
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
44
|
-
OptionalPlugin<FeatureFlagsPlugin>,
|
|
45
|
-
OptionalPlugin<ConnectivityPlugin>,
|
|
46
|
-
OptionalPlugin<ContextPanelPlugin>,
|
|
47
|
-
OptionalPlugin<MetricsPlugin>
|
|
48
|
-
];
|
|
49
|
-
pluginConfiguration: TypeAheadPluginOptions | undefined;
|
|
50
|
-
sharedState: TypeAheadPluginSharedState;
|
|
51
|
-
}>;
|
|
52
|
-
export {};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
3
|
-
import type { TypeAheadHandler, TypeAheadItem, TypeAheadStats, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
export type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
7
|
-
import type { CloseSelectionOptions } from '../pm-plugins/constants';
|
|
8
|
-
export type TypeAheadError = 'FETCH_ERROR';
|
|
9
|
-
export type TypeAheadErrorInfo = {
|
|
10
|
-
error: TypeAheadError;
|
|
11
|
-
} | null;
|
|
12
|
-
export type OnSelectItem = (props: {
|
|
13
|
-
index: number;
|
|
14
|
-
item: TypeAheadItem;
|
|
15
|
-
}) => void;
|
|
16
|
-
export interface TypeAheadStatsSerializable extends TypeAheadStats {
|
|
17
|
-
serialize: () => TypeAheadStats;
|
|
18
|
-
}
|
|
19
|
-
export interface TypeAheadStatsModifier extends TypeAheadStatsSerializable {
|
|
20
|
-
increaseArrowDown: () => void;
|
|
21
|
-
increaseArrowUp: () => void;
|
|
22
|
-
}
|
|
23
|
-
export interface TypeAheadStatsMobileModifier extends TypeAheadStatsSerializable {
|
|
24
|
-
closeTime: () => void;
|
|
25
|
-
resetTime: () => void;
|
|
26
|
-
}
|
|
27
|
-
export type TypeAheadSectionTitleUpdateState = Pick<TypeAheadResolvedSection, 'showTitleWhenOnlySection' | 'title'>;
|
|
28
|
-
export type TypeAheadPluginState = {
|
|
29
|
-
decorationElement: HTMLElement | null;
|
|
30
|
-
decorationSet: DecorationSet;
|
|
31
|
-
errorInfo: TypeAheadErrorInfo;
|
|
32
|
-
inputMethod: TypeAheadInputMethod | null;
|
|
33
|
-
items: Array<TypeAheadItem>;
|
|
34
|
-
query: string;
|
|
35
|
-
/**
|
|
36
|
-
* If true, removes the trigger character from query when typeahead is closed
|
|
37
|
-
*/
|
|
38
|
-
removePrefixTriggerOnCancel?: boolean;
|
|
39
|
-
sections: Array<TypeAheadResolvedSection>;
|
|
40
|
-
sectionTitleUpdates: Record<string, TypeAheadSectionTitleUpdateState>;
|
|
41
|
-
selectedIndex: number;
|
|
42
|
-
stats: TypeAheadStatsSerializable | null;
|
|
43
|
-
triggerHandler?: TypeAheadHandler;
|
|
44
|
-
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
45
|
-
};
|
|
46
|
-
export type TypeAheadResolvedSection = {
|
|
47
|
-
endIndex: number;
|
|
48
|
-
id: string;
|
|
49
|
-
/**
|
|
50
|
-
* Keeps this section's title visible when it is the only section with matching items.
|
|
51
|
-
* Does not render the title for an empty section.
|
|
52
|
-
*/
|
|
53
|
-
showTitleWhenOnlySection?: boolean;
|
|
54
|
-
startIndex: number;
|
|
55
|
-
title: string;
|
|
56
|
-
};
|
|
57
|
-
export type OnInsertSelectedItemProps = {
|
|
58
|
-
index: number;
|
|
59
|
-
mode: SelectItemMode;
|
|
60
|
-
query: string;
|
|
61
|
-
};
|
|
62
|
-
export type OnItemMatchProps = {
|
|
63
|
-
mode: SelectItemMode;
|
|
64
|
-
query: string;
|
|
65
|
-
};
|
|
66
|
-
export type OnInsertSelectedItem = (props: OnInsertSelectedItemProps) => void;
|
|
67
|
-
export type OnItemMatch = (props: OnItemMatchProps) => boolean;
|
|
68
|
-
export type OnTextInsertProps = {
|
|
69
|
-
forceFocusOnEditor: boolean;
|
|
70
|
-
setSelectionAt: CloseSelectionOptions;
|
|
71
|
-
text: string;
|
|
72
|
-
};
|
|
73
|
-
export type OnTextInsert = (props: OnTextInsertProps) => void;
|
|
74
|
-
export type InsertionTransactionMeta = (editorState: EditorState) => Transaction | false;
|
|
75
|
-
type PopupMountPoints = Pick<UiComponentFactoryParams, 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement'>;
|
|
76
|
-
export type PopupMountPointReference = Record<'current', PopupMountPoints | null>;
|
|
77
|
-
export type CreateTypeAheadDecorations = (tr: ReadonlyTransaction, options: {
|
|
78
|
-
inputMethod: TypeAheadInputMethod;
|
|
79
|
-
reopenQuery?: string;
|
|
80
|
-
triggerHandler: TypeAheadHandler;
|
|
81
|
-
}) => {
|
|
82
|
-
decorationElement: HTMLElement | null;
|
|
83
|
-
decorationSet: DecorationSet;
|
|
84
|
-
stats: TypeAheadStatsSerializable | null;
|
|
85
|
-
};
|
|
86
|
-
export type RemoveTypeAheadDecorations = (decorationSet?: DecorationSet) => boolean;
|
|
87
|
-
export type TypeAheadInputMethod = INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR
|
|
88
|
-
/**
|
|
89
|
-
* For Typeahead - Empty line prompt experiment
|
|
90
|
-
* Clean up ticket ED-24824
|
|
91
|
-
*/
|
|
92
|
-
| 'blockControl';
|
|
93
|
-
export type TypeAheadPluginOptions = {
|
|
94
|
-
isMobile?: boolean;
|
|
95
|
-
};
|
|
96
|
-
export interface TypeAheadPluginSharedState {
|
|
97
|
-
currentHandler?: TypeAheadHandler;
|
|
98
|
-
decorationElement: HTMLElement | null;
|
|
99
|
-
decorationSet: DecorationSet;
|
|
100
|
-
errorInfo: TypeAheadErrorInfo;
|
|
101
|
-
isAllowed: boolean;
|
|
102
|
-
isOpen: boolean;
|
|
103
|
-
items: Array<TypeAheadItem>;
|
|
104
|
-
query: string;
|
|
105
|
-
sections: Array<TypeAheadResolvedSection>;
|
|
106
|
-
selectedIndex: number;
|
|
107
|
-
triggerHandler?: TypeAheadHandler;
|
|
108
|
-
}
|
|
109
|
-
export type OpenTypeAheadProps = {
|
|
110
|
-
inputMethod: TypeAheadInputMethod;
|
|
111
|
-
query?: string;
|
|
112
|
-
removePrefixTriggerOnCancel?: boolean;
|
|
113
|
-
triggerHandler: TypeAheadHandler;
|
|
114
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
|
-
import type { PopupMountPointReference } from '../types';
|
|
6
|
-
interface ContentComponentProps {
|
|
7
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
8
|
-
editorView: EditorView;
|
|
9
|
-
popupMountRef: PopupMountPointReference;
|
|
10
|
-
}
|
|
11
|
-
export declare function ContentComponent({ api, editorView, popupMountRef, }: ContentComponentProps): React.JSX.Element | null;
|
|
12
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
8
|
-
import type { TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
9
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
import { CloseSelectionOptions } from '../pm-plugins/constants';
|
|
11
|
-
type InputQueryProps = {
|
|
12
|
-
cancel: (props: {
|
|
13
|
-
addPrefixTrigger: boolean;
|
|
14
|
-
forceFocusOnEditor: boolean;
|
|
15
|
-
setSelectionAt: CloseSelectionOptions;
|
|
16
|
-
text: string;
|
|
17
|
-
}) => void;
|
|
18
|
-
editorView: EditorView;
|
|
19
|
-
forceFocus: boolean;
|
|
20
|
-
items: TypeAheadItem[];
|
|
21
|
-
onItemSelect: (mode: SelectItemMode) => void;
|
|
22
|
-
onQueryChange: (query: string) => void;
|
|
23
|
-
onQueryFocus: () => void;
|
|
24
|
-
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
|
|
25
|
-
reopenQuery?: string;
|
|
26
|
-
selectNextItem: () => void;
|
|
27
|
-
selectPreviousItem: () => void;
|
|
28
|
-
triggerQueryPrefix: string;
|
|
29
|
-
};
|
|
30
|
-
export declare const InputQuery: React.MemoExoticComponent<({ triggerQueryPrefix, cancel, onQueryChange, onItemSelect, selectNextItem, selectPreviousItem, forceFocus, reopenQuery, onQueryFocus, onUndoRedo, editorView, items, }: InputQueryProps) => jsx.JSX.Element>;
|
|
31
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ReactNode, MouseEventHandler } from 'react';
|
|
3
|
-
import type { ListRowProps } from 'react-virtualized';
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param root0
|
|
7
|
-
* @param root0.children
|
|
8
|
-
* @param root0.registerChild
|
|
9
|
-
* @param root0.measure
|
|
10
|
-
* @param root0.index
|
|
11
|
-
* @param root0.style
|
|
12
|
-
* @param root0.isVisible
|
|
13
|
-
* @param root0.isScrolling
|
|
14
|
-
* @param root0.onMouseMove
|
|
15
|
-
* @example
|
|
16
|
-
*/
|
|
17
|
-
export declare const ListRow: React.ForwardRefExoticComponent<{
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
measure: () => void;
|
|
20
|
-
onMouseMove: MouseEventHandler<HTMLDivElement>;
|
|
21
|
-
} & Pick<ListRowProps, 'index' | 'isScrolling' | 'isVisible' | 'style'> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
type Props = {
|
|
8
|
-
ariaLabel?: string;
|
|
9
|
-
iconBefore?: React.ReactNode;
|
|
10
|
-
isFocused: boolean;
|
|
11
|
-
lastInputMethodRef?: React.MutableRefObject<'mouse' | 'keyboard'>;
|
|
12
|
-
onClick: () => void;
|
|
13
|
-
title: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const MoreOptions: ({ onClick, isFocused, title, ariaLabel, iconBefore, lastInputMethodRef, }: Props) => jsx.JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type EmptyStateProps = {
|
|
3
|
-
description?: React.ReactNode;
|
|
4
|
-
header: string;
|
|
5
|
-
renderImage?: () => React.ReactNode;
|
|
6
|
-
testId?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const EmptyState: ({ testId, header, description, renderImage, }: EmptyStateProps) => React.JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { SerializedStyles } from '@emotion/react';
|
|
7
|
-
export declare const minHeightComponentStyles: SerializedStyles;
|
|
8
|
-
export declare const MinHeightContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
9
|
-
minHeight: string;
|
|
10
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
8
|
-
import type { ExtractInjectionAPI, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
9
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
import type { InputMethodType } from '../pm-plugins/analytics';
|
|
11
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
12
|
-
import type { TypeAheadHandler, TypeAheadResolvedSection } from '../types';
|
|
13
|
-
type TypeAheadRowEntry = {
|
|
14
|
-
section: TypeAheadResolvedSection;
|
|
15
|
-
type: 'section';
|
|
16
|
-
} | {
|
|
17
|
-
itemIndex: number;
|
|
18
|
-
type: 'item';
|
|
19
|
-
};
|
|
20
|
-
export declare const buildTypeAheadRows: ({ itemsLength, sections, }: {
|
|
21
|
-
itemsLength: number;
|
|
22
|
-
sections: Array<TypeAheadResolvedSection>;
|
|
23
|
-
}) => Array<TypeAheadRowEntry>;
|
|
24
|
-
export declare const TypeAheadList: React.FC<WithIntlProps<{
|
|
25
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
26
|
-
decorationElement: HTMLElement;
|
|
27
|
-
editorView: EditorView;
|
|
28
|
-
emptyItem?: TypeAheadItem;
|
|
29
|
-
fitHeight: number;
|
|
30
|
-
items: Array<TypeAheadItem>;
|
|
31
|
-
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
32
|
-
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
33
|
-
onMoreOptionsClicked?: () => void;
|
|
34
|
-
sections?: Array<TypeAheadResolvedSection>;
|
|
35
|
-
selectedIndex: number;
|
|
36
|
-
showMoreOptionsButton?: boolean;
|
|
37
|
-
triggerHandler?: TypeAheadHandler;
|
|
38
|
-
} & WrappedComponentProps>> & {
|
|
39
|
-
WrappedComponent: React.ComponentType<{
|
|
40
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
41
|
-
decorationElement: HTMLElement;
|
|
42
|
-
editorView: EditorView;
|
|
43
|
-
emptyItem?: TypeAheadItem;
|
|
44
|
-
fitHeight: number;
|
|
45
|
-
items: Array<TypeAheadItem>;
|
|
46
|
-
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
47
|
-
onItemClick: (mode: SelectItemMode, index: number, inputMethod?: InputMethodType) => void;
|
|
48
|
-
onMoreOptionsClicked?: () => void;
|
|
49
|
-
sections?: Array<TypeAheadResolvedSection>;
|
|
50
|
-
selectedIndex: number;
|
|
51
|
-
showMoreOptionsButton?: boolean;
|
|
52
|
-
triggerHandler?: TypeAheadHandler;
|
|
53
|
-
} & WrappedComponentProps>;
|
|
54
|
-
};
|
|
55
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
import type { SerializedStyles } from '@emotion/react';
|
|
8
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
9
|
-
import type { ExtractInjectionAPI, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
10
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
11
|
-
export declare const itemIcon: SerializedStyles;
|
|
12
|
-
type TypeAheadListItemProps = {
|
|
13
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
14
|
-
ariaLabel?: string;
|
|
15
|
-
firstOnlineSupportedIndex: number;
|
|
16
|
-
item: TypeAheadItem;
|
|
17
|
-
itemIndex: number;
|
|
18
|
-
itemsLength: number;
|
|
19
|
-
lastInputMethodRef?: React.MutableRefObject<'mouse' | 'keyboard'>;
|
|
20
|
-
moreElementsInQuickInsertViewEnabled?: boolean;
|
|
21
|
-
onItemClick: (mode: SelectItemMode, index: number) => void;
|
|
22
|
-
selectedIndex: number;
|
|
23
|
-
};
|
|
24
|
-
export declare const TypeAheadListItem: React.MemoExoticComponent<({ item, itemsLength, selectedIndex, onItemClick, itemIndex, ariaLabel, moreElementsInQuickInsertViewEnabled, api, firstOnlineSupportedIndex, lastInputMethodRef, }: TypeAheadListItemProps) => jsx.JSX.Element>;
|
|
25
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
|
-
import type { PopupMountPointReference, TypeAheadPluginSharedState } from '../types';
|
|
6
|
-
type TypeAheadMenuType = {
|
|
7
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
8
|
-
editorView: EditorView;
|
|
9
|
-
popupMountRef: PopupMountPointReference;
|
|
10
|
-
selectedIndex: number;
|
|
11
|
-
typeAheadState: Omit<TypeAheadPluginSharedState, 'isOpen' | 'isAllowed' | 'selectedIndex'>;
|
|
12
|
-
};
|
|
13
|
-
export declare const TypeAheadMenu: React.MemoExoticComponent<({ editorView, popupMountRef, typeAheadState, selectedIndex, api, }: TypeAheadMenuType) => React.JSX.Element | null>;
|
|
14
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
8
|
-
import type { ExtractInjectionAPI, TypeAheadItem, TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
9
|
-
import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
import { CloseSelectionOptions } from '../pm-plugins/constants';
|
|
11
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
12
|
-
import type { OnSelectItem, TypeAheadErrorInfo, TypeAheadResolvedSection } from '../types';
|
|
13
|
-
type TypeAheadPopupProps = {
|
|
14
|
-
anchorElement: HTMLElement;
|
|
15
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
16
|
-
cancel: (params: {
|
|
17
|
-
addPrefixTrigger: boolean;
|
|
18
|
-
forceFocusOnEditor: boolean;
|
|
19
|
-
setSelectionAt: CloseSelectionOptions;
|
|
20
|
-
}) => void;
|
|
21
|
-
decorationSet: DecorationSet;
|
|
22
|
-
editorView: EditorView;
|
|
23
|
-
emptyItem?: TypeAheadItem;
|
|
24
|
-
errorInfo: TypeAheadErrorInfo;
|
|
25
|
-
isEmptyQuery: boolean;
|
|
26
|
-
items: Array<TypeAheadItem>;
|
|
27
|
-
onItemInsert: (mode: SelectItemMode, index: number) => void;
|
|
28
|
-
popupsBoundariesElement?: HTMLElement;
|
|
29
|
-
popupsMountPoint?: HTMLElement;
|
|
30
|
-
popupsScrollableElement?: HTMLElement;
|
|
31
|
-
sections?: Array<TypeAheadResolvedSection>;
|
|
32
|
-
selectedIndex: number;
|
|
33
|
-
setSelectedItem: OnSelectItem;
|
|
34
|
-
showMoreOptionsButton?: boolean;
|
|
35
|
-
triggerHandler: TypeAheadHandler;
|
|
36
|
-
};
|
|
37
|
-
export declare const TypeAheadPopup: React.MemoExoticComponent<(props: TypeAheadPopupProps) => jsx.JSX.Element>;
|
|
38
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { TypeAheadPlugin } from '../typeAheadPluginType';
|
|
5
|
-
import type { TypeAheadHandler, TypeAheadInputMethod } from '../types';
|
|
6
|
-
type WrapperProps = {
|
|
7
|
-
anchorElement: HTMLElement;
|
|
8
|
-
api: ExtractInjectionAPI<TypeAheadPlugin> | undefined;
|
|
9
|
-
editorView: EditorView;
|
|
10
|
-
getDecorationPosition: () => number | undefined;
|
|
11
|
-
inputMethod?: TypeAheadInputMethod;
|
|
12
|
-
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
|
|
13
|
-
popupsBoundariesElement?: HTMLElement;
|
|
14
|
-
popupsMountPoint?: HTMLElement;
|
|
15
|
-
popupsScrollableElement?: HTMLElement;
|
|
16
|
-
reopenQuery?: string;
|
|
17
|
-
shouldFocusCursorInsideQuery: boolean;
|
|
18
|
-
triggerHandler: TypeAheadHandler;
|
|
19
|
-
};
|
|
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
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { TypeAheadResolvedSection } from '../../types';
|
|
4
|
-
export declare const buildSectionedResult: ({ items, triggerHandler, intl, }: {
|
|
5
|
-
intl: IntlShape | null;
|
|
6
|
-
items: Array<TypeAheadItem>;
|
|
7
|
-
triggerHandler: TypeAheadHandler;
|
|
8
|
-
}) => {
|
|
9
|
-
items: Array<TypeAheadItem>;
|
|
10
|
-
sections: Array<TypeAheadResolvedSection>;
|
|
11
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ExtractInjectionAPI, TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
4
|
-
import type { OnInsertSelectedItem, OnItemMatch, OnTextInsert } from '../../types';
|
|
5
|
-
export declare const useItemInsert: (triggerHandler: TypeAheadHandler, editorView: EditorView, items: Array<TypeAheadItem>, api: ExtractInjectionAPI<TypeAheadPlugin> | undefined) => [
|
|
6
|
-
OnInsertSelectedItem,
|
|
7
|
-
OnTextInsert,
|
|
8
|
-
OnItemMatch
|
|
9
|
-
];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { ExtractInjectionAPI, TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { TypeAheadPlugin } from '../../typeAheadPluginType';
|
|
5
|
-
export declare const useLoadItems: (triggerHandler: TypeAheadHandler, editorView: EditorView, query: string, showViewMore?: boolean, api?: ExtractInjectionAPI<TypeAheadPlugin> | undefined, intl?: IntlShape) => Array<TypeAheadItem>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
type Props = {
|
|
4
|
-
closePopup: () => void;
|
|
5
|
-
editorView: EditorView;
|
|
6
|
-
items: Array<TypeAheadItem>;
|
|
7
|
-
query: string;
|
|
8
|
-
triggerHandler: TypeAheadHandler;
|
|
9
|
-
};
|
|
10
|
-
export declare const useOnForceSelect: ({ triggerHandler, items, query, editorView, closePopup, }: Props) => void;
|
|
11
|
-
export {};
|