@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
package/report.api.md
CHANGED
|
@@ -16,28 +16,27 @@
|
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
18
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
19
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
20
19
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
21
|
-
import type {
|
|
22
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
20
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
23
21
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
24
22
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
23
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
26
24
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
27
25
|
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
28
26
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
27
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
29
28
|
|
|
30
29
|
// @public (undocumented)
|
|
31
30
|
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
32
31
|
|
|
33
32
|
// @public (undocumented)
|
|
34
|
-
type IndentList = (inputMethod: InputMethod) =>
|
|
33
|
+
type IndentList = (inputMethod: InputMethod) => EditorCommand;
|
|
35
34
|
|
|
36
35
|
// @public (undocumented)
|
|
37
|
-
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
36
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
38
37
|
|
|
39
38
|
// @public (undocumented)
|
|
40
|
-
type IsInsideListItem = (
|
|
39
|
+
type IsInsideListItem = (tr: Transaction) => boolean;
|
|
41
40
|
|
|
42
41
|
// @public (undocumented)
|
|
43
42
|
export type ListPlugin = NextEditorPlugin<
|
|
@@ -49,17 +48,22 @@ export type ListPlugin = NextEditorPlugin<
|
|
|
49
48
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
50
49
|
];
|
|
51
50
|
actions: {
|
|
51
|
+
isInsideListItem: IsInsideListItem;
|
|
52
|
+
findRootParentListNode: FindRootParentListNode;
|
|
53
|
+
};
|
|
54
|
+
commands: {
|
|
52
55
|
indentList: IndentList;
|
|
53
56
|
outdentList: OutdentList;
|
|
54
57
|
toggleOrderedList: ToggleOrderedList;
|
|
55
58
|
toggleBulletList: ToggleBulletList;
|
|
56
|
-
isInsideListItem: IsInsideListItem;
|
|
57
|
-
findRootParentListNode: FindRootParentListNode;
|
|
58
59
|
};
|
|
59
60
|
sharedState: ListState | undefined;
|
|
60
61
|
}
|
|
61
62
|
>;
|
|
62
63
|
|
|
64
|
+
// @public (undocumented)
|
|
65
|
+
export const listPlugin: ListPlugin;
|
|
66
|
+
|
|
63
67
|
// @public (undocumented)
|
|
64
68
|
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
65
69
|
|
|
@@ -78,19 +82,13 @@ export interface ListState {
|
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
// @public (undocumented)
|
|
81
|
-
type OutdentList = (
|
|
82
|
-
inputMethod: InputMethod,
|
|
83
|
-
featureFlags: FeatureFlags,
|
|
84
|
-
) => Command;
|
|
85
|
+
type OutdentList = (inputMethod: InputMethod) => EditorCommand;
|
|
85
86
|
|
|
86
87
|
// @public (undocumented)
|
|
87
|
-
type ToggleBulletList = (
|
|
88
|
+
type ToggleBulletList = (inputMethod: InputMethod) => EditorCommand;
|
|
88
89
|
|
|
89
90
|
// @public (undocumented)
|
|
90
|
-
type ToggleOrderedList = (
|
|
91
|
-
view: EditorView,
|
|
92
|
-
inputMethod: InputMethod,
|
|
93
|
-
) => boolean;
|
|
91
|
+
type ToggleOrderedList = (inputMethod: InputMethod) => EditorCommand;
|
|
94
92
|
|
|
95
93
|
// (No @packageDocumentation comment for this package)
|
|
96
94
|
```
|
|
@@ -103,7 +101,8 @@ type ToggleOrderedList = (
|
|
|
103
101
|
|
|
104
102
|
```json
|
|
105
103
|
{
|
|
106
|
-
"react": "^16.8.0"
|
|
104
|
+
"react": "^16.8.0",
|
|
105
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
107
106
|
}
|
|
108
107
|
```
|
|
109
108
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -5,28 +5,27 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
9
8
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
import type {
|
|
11
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
12
10
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
13
11
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
14
12
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
15
13
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
16
14
|
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
17
15
|
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
16
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
18
17
|
|
|
19
18
|
// @public (undocumented)
|
|
20
19
|
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
21
20
|
|
|
22
21
|
// @public (undocumented)
|
|
23
|
-
type IndentList = (inputMethod: InputMethod) =>
|
|
22
|
+
type IndentList = (inputMethod: InputMethod) => EditorCommand;
|
|
24
23
|
|
|
25
24
|
// @public (undocumented)
|
|
26
|
-
type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
25
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
27
26
|
|
|
28
27
|
// @public (undocumented)
|
|
29
|
-
type IsInsideListItem = (
|
|
28
|
+
type IsInsideListItem = (tr: Transaction) => boolean;
|
|
30
29
|
|
|
31
30
|
// @public (undocumented)
|
|
32
31
|
export type ListPlugin = NextEditorPlugin<'list', {
|
|
@@ -36,16 +35,21 @@ export type ListPlugin = NextEditorPlugin<'list', {
|
|
|
36
35
|
OptionalPlugin<typeof analyticsPlugin>
|
|
37
36
|
];
|
|
38
37
|
actions: {
|
|
38
|
+
isInsideListItem: IsInsideListItem;
|
|
39
|
+
findRootParentListNode: FindRootParentListNode;
|
|
40
|
+
};
|
|
41
|
+
commands: {
|
|
39
42
|
indentList: IndentList;
|
|
40
43
|
outdentList: OutdentList;
|
|
41
44
|
toggleOrderedList: ToggleOrderedList;
|
|
42
45
|
toggleBulletList: ToggleBulletList;
|
|
43
|
-
isInsideListItem: IsInsideListItem;
|
|
44
|
-
findRootParentListNode: FindRootParentListNode;
|
|
45
46
|
};
|
|
46
47
|
sharedState: ListState | undefined;
|
|
47
48
|
}>;
|
|
48
49
|
|
|
50
|
+
// @public (undocumented)
|
|
51
|
+
export const listPlugin: ListPlugin;
|
|
52
|
+
|
|
49
53
|
// @public (undocumented)
|
|
50
54
|
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
51
55
|
|
|
@@ -64,13 +68,13 @@ export interface ListState {
|
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
// @public (undocumented)
|
|
67
|
-
type OutdentList = (inputMethod: InputMethod
|
|
71
|
+
type OutdentList = (inputMethod: InputMethod) => EditorCommand;
|
|
68
72
|
|
|
69
73
|
// @public (undocumented)
|
|
70
|
-
type ToggleBulletList = (
|
|
74
|
+
type ToggleBulletList = (inputMethod: InputMethod) => EditorCommand;
|
|
71
75
|
|
|
72
76
|
// @public (undocumented)
|
|
73
|
-
type ToggleOrderedList = (
|
|
77
|
+
type ToggleOrderedList = (inputMethod: InputMethod) => EditorCommand;
|
|
74
78
|
|
|
75
79
|
// (No @packageDocumentation comment for this package)
|
|
76
80
|
|