@atlaskit/editor-plugin-list 0.2.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +14 -0
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/cjs/actions/conversions.js +153 -0
- package/dist/cjs/actions/indent-list-items-selected.js +125 -0
- package/dist/cjs/actions/indent-list.js +49 -0
- package/dist/cjs/actions/join-list-items-forward.js +59 -0
- package/dist/cjs/actions/join-list-items-scenarios/index.js +40 -0
- package/dist/cjs/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +88 -0
- package/dist/cjs/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +85 -0
- package/dist/cjs/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +79 -0
- package/dist/cjs/actions/join-list-items-scenarios/join-paragraph-with-list.js +45 -0
- package/dist/cjs/actions/join-list-items-scenarios/join-sibling-list-items.js +56 -0
- package/dist/cjs/actions/merge-lists.js +27 -0
- package/dist/cjs/actions/outdent-list-items-selected.js +289 -0
- package/dist/cjs/actions/wrap-and-join-lists.js +100 -0
- package/dist/cjs/commands/indent-list.js +69 -0
- package/dist/cjs/commands/index.js +349 -0
- package/dist/cjs/commands/isFirstChildOfParent.js +12 -0
- package/dist/cjs/commands/join-list-item-forward.js +61 -0
- package/dist/cjs/commands/listBackspace.js +284 -0
- package/dist/cjs/commands/outdent-list.js +69 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/messages.js +37 -0
- package/dist/cjs/plugin.js +137 -0
- package/dist/cjs/pm-plugins/input-rules/create-list-input-rule.js +63 -0
- package/dist/cjs/pm-plugins/input-rules/index.js +38 -0
- package/dist/cjs/pm-plugins/input-rules/wrapping-join-rule.js +60 -0
- package/dist/cjs/pm-plugins/keymap.js +27 -0
- package/dist/cjs/pm-plugins/main.js +166 -0
- package/dist/cjs/transforms.js +99 -0
- package/dist/cjs/types.js +4 -1
- package/dist/cjs/utils/analytics.js +22 -0
- package/dist/cjs/utils/find.js +68 -0
- package/dist/cjs/utils/indentation.js +22 -0
- package/dist/cjs/utils/mark.js +40 -0
- package/dist/cjs/utils/node.js +16 -0
- package/dist/cjs/utils/selection.js +95 -0
- package/dist/es2019/actions/conversions.js +160 -0
- package/dist/es2019/actions/indent-list-items-selected.js +124 -0
- package/dist/es2019/actions/indent-list.js +44 -0
- package/dist/es2019/actions/join-list-items-forward.js +54 -0
- package/dist/es2019/actions/join-list-items-scenarios/index.js +5 -0
- package/dist/es2019/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +74 -0
- package/dist/es2019/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +77 -0
- package/dist/es2019/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +71 -0
- package/dist/es2019/actions/join-list-items-scenarios/join-paragraph-with-list.js +37 -0
- package/dist/es2019/actions/join-list-items-scenarios/join-sibling-list-items.js +48 -0
- package/dist/es2019/actions/merge-lists.js +24 -0
- package/dist/es2019/actions/outdent-list-items-selected.js +293 -0
- package/dist/es2019/actions/wrap-and-join-lists.js +93 -0
- package/dist/es2019/commands/indent-list.js +61 -0
- package/dist/es2019/commands/index.js +322 -0
- package/dist/es2019/commands/isFirstChildOfParent.js +7 -0
- package/dist/es2019/commands/join-list-item-forward.js +53 -0
- package/dist/es2019/commands/listBackspace.js +276 -0
- package/dist/es2019/commands/outdent-list.js +60 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/messages.js +29 -0
- package/dist/es2019/plugin.js +123 -0
- package/dist/es2019/pm-plugins/input-rules/create-list-input-rule.js +56 -0
- package/dist/es2019/pm-plugins/input-rules/index.js +35 -0
- package/dist/es2019/pm-plugins/input-rules/wrapping-join-rule.js +55 -0
- package/dist/es2019/pm-plugins/keymap.js +19 -0
- package/dist/es2019/pm-plugins/main.js +156 -0
- package/dist/es2019/transforms.js +101 -0
- package/dist/es2019/types.js +1 -1
- package/dist/es2019/utils/analytics.js +12 -0
- package/dist/es2019/utils/find.js +61 -0
- package/dist/es2019/utils/indentation.js +15 -0
- package/dist/es2019/utils/mark.js +30 -0
- package/dist/es2019/utils/node.js +12 -0
- package/dist/es2019/utils/selection.js +96 -0
- package/dist/esm/actions/conversions.js +147 -0
- package/dist/esm/actions/indent-list-items-selected.js +117 -0
- package/dist/esm/actions/indent-list.js +43 -0
- package/dist/esm/actions/join-list-items-forward.js +52 -0
- package/dist/esm/actions/join-list-items-scenarios/index.js +5 -0
- package/dist/esm/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +81 -0
- package/dist/esm/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +78 -0
- package/dist/esm/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +72 -0
- package/dist/esm/actions/join-list-items-scenarios/join-paragraph-with-list.js +38 -0
- package/dist/esm/actions/join-list-items-scenarios/join-sibling-list-items.js +49 -0
- package/dist/esm/actions/merge-lists.js +21 -0
- package/dist/esm/actions/outdent-list-items-selected.js +281 -0
- package/dist/esm/actions/wrap-and-join-lists.js +94 -0
- package/dist/esm/commands/indent-list.js +61 -0
- package/dist/esm/commands/index.js +323 -0
- package/dist/esm/commands/isFirstChildOfParent.js +5 -0
- package/dist/esm/commands/join-list-item-forward.js +53 -0
- package/dist/esm/commands/listBackspace.js +275 -0
- package/dist/esm/commands/outdent-list.js +61 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/messages.js +29 -0
- package/dist/esm/plugin.js +130 -0
- package/dist/esm/pm-plugins/input-rules/create-list-input-rule.js +57 -0
- package/dist/esm/pm-plugins/input-rules/index.js +32 -0
- package/dist/esm/pm-plugins/input-rules/wrapping-join-rule.js +54 -0
- package/dist/esm/pm-plugins/keymap.js +19 -0
- package/dist/esm/pm-plugins/main.js +156 -0
- package/dist/esm/transforms.js +91 -0
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils/analytics.js +12 -0
- package/dist/esm/utils/find.js +59 -0
- package/dist/esm/utils/indentation.js +15 -0
- package/dist/esm/utils/mark.js +33 -0
- package/dist/esm/utils/node.js +10 -0
- package/dist/esm/utils/selection.js +81 -0
- package/dist/types/actions/conversions.d.ts +6 -0
- package/dist/types/actions/indent-list-items-selected.d.ts +2 -0
- package/dist/types/actions/indent-list.d.ts +2 -0
- package/dist/types/actions/join-list-items-forward.d.ts +13 -0
- package/dist/types/actions/join-list-items-scenarios/index.d.ts +5 -0
- package/dist/types/actions/join-list-items-scenarios/join-list-item-with-paragraph.d.ts +9 -0
- package/dist/types/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.d.ts +9 -0
- package/dist/types/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.d.ts +9 -0
- package/dist/types/actions/join-list-items-scenarios/join-paragraph-with-list.d.ts +9 -0
- package/dist/types/actions/join-list-items-scenarios/join-sibling-list-items.d.ts +9 -0
- package/dist/types/actions/merge-lists.d.ts +7 -0
- package/dist/types/actions/outdent-list-items-selected.d.ts +3 -0
- package/dist/types/actions/wrap-and-join-lists.d.ts +17 -0
- package/dist/types/commands/indent-list.d.ts +6 -0
- package/dist/types/commands/index.d.ts +15 -0
- package/dist/types/commands/isFirstChildOfParent.d.ts +2 -0
- package/dist/types/commands/join-list-item-forward.d.ts +3 -0
- package/dist/types/commands/listBackspace.d.ts +10 -0
- package/dist/types/commands/outdent-list.d.ts +6 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/messages.d.ts +27 -0
- package/dist/types/plugin.d.ts +2 -0
- package/dist/types/pm-plugins/input-rules/create-list-input-rule.d.ts +11 -0
- package/dist/types/pm-plugins/input-rules/index.d.ts +5 -0
- package/dist/types/pm-plugins/input-rules/wrapping-join-rule.d.ts +13 -0
- package/dist/types/pm-plugins/keymap.d.ts +5 -0
- package/dist/types/pm-plugins/main.d.ts +11 -0
- package/dist/types/transforms.d.ts +4 -0
- package/dist/types/types.d.ts +13 -13
- package/dist/types/utils/analytics.d.ts +5 -0
- package/dist/types/utils/find.d.ts +10 -0
- package/dist/types/utils/indentation.d.ts +2 -0
- package/dist/types/utils/mark.d.ts +8 -0
- package/dist/types/utils/node.d.ts +2 -0
- package/dist/types/utils/selection.d.ts +14 -0
- package/dist/types-ts4.5/actions/conversions.d.ts +6 -0
- package/dist/types-ts4.5/actions/indent-list-items-selected.d.ts +2 -0
- package/dist/types-ts4.5/actions/indent-list.d.ts +2 -0
- package/dist/types-ts4.5/actions/join-list-items-forward.d.ts +16 -0
- package/dist/types-ts4.5/actions/join-list-items-scenarios/index.d.ts +5 -0
- package/dist/types-ts4.5/actions/join-list-items-scenarios/join-list-item-with-paragraph.d.ts +9 -0
- package/dist/types-ts4.5/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.d.ts +9 -0
- package/dist/types-ts4.5/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.d.ts +9 -0
- package/dist/types-ts4.5/actions/join-list-items-scenarios/join-paragraph-with-list.d.ts +9 -0
- package/dist/types-ts4.5/actions/join-list-items-scenarios/join-sibling-list-items.d.ts +9 -0
- package/dist/types-ts4.5/actions/merge-lists.d.ts +7 -0
- package/dist/types-ts4.5/actions/outdent-list-items-selected.d.ts +3 -0
- package/dist/types-ts4.5/actions/wrap-and-join-lists.d.ts +17 -0
- package/dist/types-ts4.5/commands/indent-list.d.ts +6 -0
- package/dist/types-ts4.5/commands/index.d.ts +15 -0
- package/dist/types-ts4.5/commands/isFirstChildOfParent.d.ts +2 -0
- package/dist/types-ts4.5/commands/join-list-item-forward.d.ts +3 -0
- package/dist/types-ts4.5/commands/listBackspace.d.ts +13 -0
- package/dist/types-ts4.5/commands/outdent-list.d.ts +6 -0
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/messages.d.ts +27 -0
- package/dist/types-ts4.5/plugin.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/input-rules/create-list-input-rule.d.ts +11 -0
- package/dist/types-ts4.5/pm-plugins/input-rules/index.d.ts +5 -0
- package/dist/types-ts4.5/pm-plugins/input-rules/wrapping-join-rule.d.ts +13 -0
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +5 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +11 -0
- package/dist/types-ts4.5/transforms.d.ts +4 -0
- package/dist/types-ts4.5/types.d.ts +13 -13
- package/dist/types-ts4.5/utils/analytics.d.ts +5 -0
- package/dist/types-ts4.5/utils/find.d.ts +10 -0
- package/dist/types-ts4.5/utils/indentation.d.ts +2 -0
- package/dist/types-ts4.5/utils/mark.d.ts +8 -0
- package/dist/types-ts4.5/utils/node.d.ts +2 -0
- package/dist/types-ts4.5/utils/selection.d.ts +14 -0
- package/package.json +8 -5
- package/report.api.md +17 -18
- package/tmp/api-report-tmp.d.ts +15 -11
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
unorderedList: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
unorderedListDescription: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
orderedList: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
orderedListDescription: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
lists: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
type Props = {
|
|
5
|
+
listType: NodeType;
|
|
6
|
+
expression: RegExp;
|
|
7
|
+
featureFlags: FeatureFlags;
|
|
8
|
+
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare function createRuleForListType({ listType, expression, featureFlags, editorAnalyticsApi, }: Props): import("@atlaskit/editor-common/types").InputRuleWrapper;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
export default function inputRulePlugin(schema: Schema, featureFlags: FeatureFlags, editorAnalyticsApi: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { FeatureFlags, InputRuleWrapper } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
type Attrs = Record<string, any>;
|
|
5
|
+
type WrappingRuleProps = {
|
|
6
|
+
featureFlags: FeatureFlags;
|
|
7
|
+
match: RegExp;
|
|
8
|
+
nodeType: NodeType;
|
|
9
|
+
getAttrs?: Attrs | ((matchResult: RegExpExecArray) => Attrs);
|
|
10
|
+
joinPredicate?: (matchResult: RegExpExecArray, node: PMNode, joinScenario: JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST) => boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const createWrappingJoinRule: ({ match, nodeType, getAttrs, joinPredicate, featureFlags, }: WrappingRuleProps) => InputRuleWrapper;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare function keymapPlugin(featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
5
|
+
export default keymapPlugin;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import type { ListState } from '../types';
|
|
9
|
+
export declare const pluginKey: PluginKey<ListState>;
|
|
10
|
+
export declare const getDecorations: (doc: Node, state: EditorState, featureFlags: FeatureFlags) => DecorationSet;
|
|
11
|
+
export declare const createPlugin: (eventDispatch: Dispatch, featureFlags: FeatureFlags) => SafePlugin;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export declare function liftFollowingList(from: number, to: number, rootListDepth: number, tr: Transaction): Transaction;
|
|
3
|
+
export declare function liftNodeSelectionList(selection: Selection, tr: Transaction): Transaction;
|
|
4
|
+
export declare function liftTextSelectionList(selection: Selection, tr: Transaction): Transaction;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Command, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { EditorCommand, FeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
3
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
4
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
6
5
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type {
|
|
8
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
9
7
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
8
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
9
|
+
export declare const MAX_NESTED_LIST_INDENTATION = 6;
|
|
11
10
|
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
12
|
-
export type IndentList = (inputMethod: InputMethod) =>
|
|
13
|
-
export type OutdentList = (inputMethod: InputMethod
|
|
14
|
-
export type ToggleOrderedList = (
|
|
15
|
-
export type ToggleBulletList = (
|
|
16
|
-
export type IsInsideListItem = (
|
|
11
|
+
export type IndentList = (inputMethod: InputMethod) => EditorCommand;
|
|
12
|
+
export type OutdentList = (inputMethod: InputMethod) => EditorCommand;
|
|
13
|
+
export type ToggleOrderedList = (inputMethod: InputMethod) => EditorCommand;
|
|
14
|
+
export type ToggleBulletList = (inputMethod: InputMethod) => EditorCommand;
|
|
15
|
+
export type IsInsideListItem = (tr: Transaction) => boolean;
|
|
17
16
|
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
18
17
|
export interface ListState {
|
|
19
18
|
bulletListActive: boolean;
|
|
@@ -29,13 +28,14 @@ export type ListPlugin = NextEditorPlugin<'list', {
|
|
|
29
28
|
OptionalPlugin<typeof analyticsPlugin>
|
|
30
29
|
];
|
|
31
30
|
actions: {
|
|
31
|
+
isInsideListItem: IsInsideListItem;
|
|
32
|
+
findRootParentListNode: FindRootParentListNode;
|
|
33
|
+
};
|
|
34
|
+
commands: {
|
|
32
35
|
indentList: IndentList;
|
|
33
36
|
outdentList: OutdentList;
|
|
34
37
|
toggleOrderedList: ToggleOrderedList;
|
|
35
38
|
toggleBulletList: ToggleBulletList;
|
|
36
|
-
isInsideListItem: IsInsideListItem;
|
|
37
|
-
findRootParentListNode: FindRootParentListNode;
|
|
38
39
|
};
|
|
39
40
|
sharedState: ListState | undefined;
|
|
40
41
|
}>;
|
|
41
|
-
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RestartListsAttributesForListOutdented } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const RESTART_LISTS_ANALYTICS_KEY = "restartListsAnalytics";
|
|
4
|
+
export declare const getRestartListsAttributes: (tr: Transaction) => RestartListsAttributesForListOutdented;
|
|
5
|
+
export declare const storeRestartListsAttributes: (tr: Transaction, attributes: RestartListsAttributesForListOutdented) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export declare function findFirstParentListNode($pos: ResolvedPos): {
|
|
3
|
+
pos: number;
|
|
4
|
+
node: PMNode;
|
|
5
|
+
} | null;
|
|
6
|
+
export declare function findFirstParentListItemNode($pos: ResolvedPos): {
|
|
7
|
+
pos: number;
|
|
8
|
+
node: PMNode;
|
|
9
|
+
} | null;
|
|
10
|
+
export declare const findRootParentListNode: ($pos: ResolvedPos) => ResolvedPos | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Mark, Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type NodesSanitized = Array<{
|
|
4
|
+
node: Node;
|
|
5
|
+
marksRemoved: Mark[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const sanitiseMarksInSelection: (tr: Transaction, newParentType?: NodeType) => NodesSanitized;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NodeRange, NodeType, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const isPosInsideParagraph: ($pos: ResolvedPos) => boolean;
|
|
4
|
+
export declare const isPosInsideList: ($pos: ResolvedPos) => boolean;
|
|
5
|
+
export declare const isWrappingPossible: (nodeType: NodeType, selection: Selection) => boolean;
|
|
6
|
+
export declare const isInsideListItem: (tr: Transaction) => boolean;
|
|
7
|
+
export declare const isInsideTableCell: (tr: Transaction) => boolean;
|
|
8
|
+
export declare const canJoinToPreviousListItem: (tr: Transaction) => boolean;
|
|
9
|
+
export declare const selectionContainsList: (tr: Transaction) => PMNode | null;
|
|
10
|
+
type CreateNodeRange = (props: {
|
|
11
|
+
selection: Selection;
|
|
12
|
+
}) => NodeRange | null;
|
|
13
|
+
export declare const createListNodeRange: CreateNodeRange;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare function convertListType({ tr, nextListNodeType, }: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
nextListNodeType: NodeType;
|
|
6
|
+
}): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LIST_TEXT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { WalkNode } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
type ScenariosAllowed = LIST_TEXT_SCENARIOS.JOIN_PARAGRAPH_WITH_LIST | LIST_TEXT_SCENARIOS.JOIN_SIBLINGS | LIST_TEXT_SCENARIOS.JOIN_DESCENDANT_TO_PARENT | LIST_TEXT_SCENARIOS.JOIN_PARENT_SIBLING_TO_PARENT_CHILD | LIST_TEXT_SCENARIOS.JOIN_LIST_ITEM_WITH_PARAGRAPH;
|
|
6
|
+
type DeleteAction = (props: {
|
|
7
|
+
tr: Transaction;
|
|
8
|
+
$next: ResolvedPos;
|
|
9
|
+
$head: ResolvedPos;
|
|
10
|
+
}) => boolean;
|
|
11
|
+
type ScenarioAction = false | [
|
|
12
|
+
ScenariosAllowed,
|
|
13
|
+
DeleteAction
|
|
14
|
+
];
|
|
15
|
+
export declare const calcJoinListScenario: (walkNode: WalkNode, $head: ResolvedPos) => ScenarioAction;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { joinParagrapWithList } from './join-paragraph-with-list';
|
|
2
|
+
export { joinSiblingListItems } from './join-sibling-list-items';
|
|
3
|
+
export { joinNestedListWithParentListItem } from './join-nested-list-with-parent-list-item';
|
|
4
|
+
export { joinListItemWithParentNestedList } from './join-list-item-with-parent-nested-list';
|
|
5
|
+
export { joinListItemWithParagraph } from './join-list-item-with-paragraph';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type DeleteAction = (props: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
$next: ResolvedPos;
|
|
6
|
+
$head: ResolvedPos;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export declare const joinListItemWithParagraph: DeleteAction;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type DeleteAction = (props: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
$next: ResolvedPos;
|
|
6
|
+
$head: ResolvedPos;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export declare const joinListItemWithParentNestedList: DeleteAction;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type DeleteAction = (props: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
$next: ResolvedPos;
|
|
6
|
+
$head: ResolvedPos;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export declare const joinNestedListWithParentListItem: DeleteAction;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type DeleteAction = (props: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
$next: ResolvedPos;
|
|
6
|
+
$head: ResolvedPos;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export declare const joinParagrapWithList: DeleteAction;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type DeleteAction = (props: {
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
$next: ResolvedPos;
|
|
6
|
+
$head: ResolvedPos;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export declare const joinSiblingListItems: DeleteAction;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
type MergeNextListAtPositionProps = {
|
|
3
|
+
listPosition: number;
|
|
4
|
+
tr: Transaction;
|
|
5
|
+
};
|
|
6
|
+
export declare function mergeNextListAtPosition({ tr, listPosition, }: MergeNextListAtPositionProps): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps the selection in a list with the given type. If this results in
|
|
5
|
+
* two adjacent lists of the same type, those will be joined together.
|
|
6
|
+
*/
|
|
7
|
+
export declare function wrapInListAndJoin(nodeType: NodeType, tr: Transaction): void;
|
|
8
|
+
type Attrs = {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Wraps the selection in a list with the given type and attributes.
|
|
13
|
+
*
|
|
14
|
+
* Adapted from https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js#L64-L89
|
|
15
|
+
*/
|
|
16
|
+
export declare function wrapInList(listType: NodeType, attrs?: Attrs): (tr: Transaction) => boolean;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
4
|
+
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
|
+
export declare const indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => EditorCommand;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { Command, EditorCommand, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import { indentList } from './indent-list';
|
|
6
|
+
import { outdentList } from './outdent-list';
|
|
7
|
+
export { outdentList, indentList };
|
|
8
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
9
|
+
export declare const enterKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (featureFlags: FeatureFlags) => Command;
|
|
10
|
+
export declare const backspaceKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (featureFlags: FeatureFlags) => Command;
|
|
11
|
+
export declare const deleteKeyCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
12
|
+
export declare const rootListDepth: (pos: ResolvedPos, nodes: Record<string, NodeType>) => number | undefined;
|
|
13
|
+
export declare const toggleList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod, listType: 'bulletList' | 'orderedList') => EditorCommand;
|
|
14
|
+
export declare const toggleBulletList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => EditorCommand;
|
|
15
|
+
export declare const toggleOrderedList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: InputMethod) => EditorCommand;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { LIST_TEXT_SCENARIOS } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { CommandDispatch } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { WalkNode } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
type ScenariosAllowed = LIST_TEXT_SCENARIOS.JOIN_SIBLINGS | LIST_TEXT_SCENARIOS.JOIN_DESCENDANT_TO_PARENT | LIST_TEXT_SCENARIOS.JOIN_TO_SIBLING_DESCENDANT;
|
|
8
|
+
export declare const calcJoinListScenario: (walkNode: WalkNode, $head: ResolvedPos, tr: Transaction) => [
|
|
9
|
+
ScenariosAllowed,
|
|
10
|
+
ResolvedPos | null
|
|
11
|
+
] | false;
|
|
12
|
+
export declare const listBackspace: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import type { EditorCommand, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
5
|
+
export declare const outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InputMethod | undefined, featureFlags: FeatureFlags) => EditorCommand;
|
|
6
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type { ListPlugin, ListPluginOptions, FindRootParentListNode, ListState, } from './types';
|
|
1
|
+
export type { ListPlugin, ListPluginOptions, FindRootParentListNode, ListState, InputMethod, } from './types';
|
|
2
|
+
export { listPlugin } from './plugin';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
unorderedList: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
unorderedListDescription: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
orderedList: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
orderedListDescription: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
lists: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
type Props = {
|
|
5
|
+
listType: NodeType;
|
|
6
|
+
expression: RegExp;
|
|
7
|
+
featureFlags: FeatureFlags;
|
|
8
|
+
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare function createRuleForListType({ listType, expression, featureFlags, editorAnalyticsApi, }: Props): import("@atlaskit/editor-common/types").InputRuleWrapper;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
export default function inputRulePlugin(schema: Schema, featureFlags: FeatureFlags, editorAnalyticsApi: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { FeatureFlags, InputRuleWrapper } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
type Attrs = Record<string, any>;
|
|
5
|
+
type WrappingRuleProps = {
|
|
6
|
+
featureFlags: FeatureFlags;
|
|
7
|
+
match: RegExp;
|
|
8
|
+
nodeType: NodeType;
|
|
9
|
+
getAttrs?: Attrs | ((matchResult: RegExpExecArray) => Attrs);
|
|
10
|
+
joinPredicate?: (matchResult: RegExpExecArray, node: PMNode, joinScenario: JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST) => boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const createWrappingJoinRule: ({ match, nodeType, getAttrs, joinPredicate, featureFlags, }: WrappingRuleProps) => InputRuleWrapper;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
export declare function keymapPlugin(featureFlags: FeatureFlags, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin | undefined;
|
|
5
|
+
export default keymapPlugin;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
+
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import type { ListState } from '../types';
|
|
9
|
+
export declare const pluginKey: PluginKey<ListState>;
|
|
10
|
+
export declare const getDecorations: (doc: Node, state: EditorState, featureFlags: FeatureFlags) => DecorationSet;
|
|
11
|
+
export declare const createPlugin: (eventDispatch: Dispatch, featureFlags: FeatureFlags) => SafePlugin;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export declare function liftFollowingList(from: number, to: number, rootListDepth: number, tr: Transaction): Transaction;
|
|
3
|
+
export declare function liftNodeSelectionList(selection: Selection, tr: Transaction): Transaction;
|
|
4
|
+
export declare function liftTextSelectionList(selection: Selection, tr: Transaction): Transaction;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Command, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { EditorCommand, FeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
3
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
4
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
6
5
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type {
|
|
8
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
9
7
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
8
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
9
|
+
export declare const MAX_NESTED_LIST_INDENTATION = 6;
|
|
11
10
|
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
12
|
-
export type IndentList = (inputMethod: InputMethod) =>
|
|
13
|
-
export type OutdentList = (inputMethod: InputMethod
|
|
14
|
-
export type ToggleOrderedList = (
|
|
15
|
-
export type ToggleBulletList = (
|
|
16
|
-
export type IsInsideListItem = (
|
|
11
|
+
export type IndentList = (inputMethod: InputMethod) => EditorCommand;
|
|
12
|
+
export type OutdentList = (inputMethod: InputMethod) => EditorCommand;
|
|
13
|
+
export type ToggleOrderedList = (inputMethod: InputMethod) => EditorCommand;
|
|
14
|
+
export type ToggleBulletList = (inputMethod: InputMethod) => EditorCommand;
|
|
15
|
+
export type IsInsideListItem = (tr: Transaction) => boolean;
|
|
17
16
|
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
18
17
|
export interface ListState {
|
|
19
18
|
bulletListActive: boolean;
|
|
@@ -29,13 +28,14 @@ export type ListPlugin = NextEditorPlugin<'list', {
|
|
|
29
28
|
OptionalPlugin<typeof analyticsPlugin>
|
|
30
29
|
];
|
|
31
30
|
actions: {
|
|
31
|
+
isInsideListItem: IsInsideListItem;
|
|
32
|
+
findRootParentListNode: FindRootParentListNode;
|
|
33
|
+
};
|
|
34
|
+
commands: {
|
|
32
35
|
indentList: IndentList;
|
|
33
36
|
outdentList: OutdentList;
|
|
34
37
|
toggleOrderedList: ToggleOrderedList;
|
|
35
38
|
toggleBulletList: ToggleBulletList;
|
|
36
|
-
isInsideListItem: IsInsideListItem;
|
|
37
|
-
findRootParentListNode: FindRootParentListNode;
|
|
38
39
|
};
|
|
39
40
|
sharedState: ListState | undefined;
|
|
40
41
|
}>;
|
|
41
|
-
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RestartListsAttributesForListOutdented } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const RESTART_LISTS_ANALYTICS_KEY = "restartListsAnalytics";
|
|
4
|
+
export declare const getRestartListsAttributes: (tr: Transaction) => RestartListsAttributesForListOutdented;
|
|
5
|
+
export declare const storeRestartListsAttributes: (tr: Transaction, attributes: RestartListsAttributesForListOutdented) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
export declare function findFirstParentListNode($pos: ResolvedPos): {
|
|
3
|
+
pos: number;
|
|
4
|
+
node: PMNode;
|
|
5
|
+
} | null;
|
|
6
|
+
export declare function findFirstParentListItemNode($pos: ResolvedPos): {
|
|
7
|
+
pos: number;
|
|
8
|
+
node: PMNode;
|
|
9
|
+
} | null;
|
|
10
|
+
export declare const findRootParentListNode: ($pos: ResolvedPos) => ResolvedPos | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Mark, Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
type NodesSanitized = Array<{
|
|
4
|
+
node: Node;
|
|
5
|
+
marksRemoved: Mark[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const sanitiseMarksInSelection: (tr: Transaction, newParentType?: NodeType) => NodesSanitized;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NodeRange, NodeType, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const isPosInsideParagraph: ($pos: ResolvedPos) => boolean;
|
|
4
|
+
export declare const isPosInsideList: ($pos: ResolvedPos) => boolean;
|
|
5
|
+
export declare const isWrappingPossible: (nodeType: NodeType, selection: Selection) => boolean;
|
|
6
|
+
export declare const isInsideListItem: (tr: Transaction) => boolean;
|
|
7
|
+
export declare const isInsideTableCell: (tr: Transaction) => boolean;
|
|
8
|
+
export declare const canJoinToPreviousListItem: (tr: Transaction) => boolean;
|
|
9
|
+
export declare const selectionContainsList: (tr: Transaction) => PMNode | null;
|
|
10
|
+
type CreateNodeRange = (props: {
|
|
11
|
+
selection: Selection;
|
|
12
|
+
}) => NodeRange | null;
|
|
13
|
+
export declare const createListNodeRange: CreateNodeRange;
|
|
14
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-list",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,18 +31,21 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/
|
|
34
|
+
"@atlaskit/adf-schema": "^28.1.0",
|
|
35
|
+
"@atlaskit/editor-common": "^74.51.0",
|
|
35
36
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
36
37
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
38
|
+
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
|
+
"@atlaskit/prosemirror-input-rules": "^2.4.0",
|
|
37
40
|
"@babel/runtime": "^7.0.0"
|
|
38
41
|
},
|
|
39
42
|
"peerDependencies": {
|
|
40
|
-
"react": "^16.8.0"
|
|
43
|
+
"react": "^16.8.0",
|
|
44
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
41
45
|
},
|
|
42
46
|
"devDependencies": {
|
|
43
47
|
"@af/visual-regression": "*",
|
|
44
|
-
"@atlaskit/
|
|
45
|
-
"@atlaskit/webdriver-runner": "*",
|
|
48
|
+
"@atlaskit/editor-test-helpers": "^18.11.0",
|
|
46
49
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
47
50
|
"@testing-library/react": "^12.1.5",
|
|
48
51
|
"react-dom": "^16.8.0",
|