@atlaskit/editor-plugin-list 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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 +291 -0
- package/dist/cjs/actions/wrap-and-join-lists.js +100 -0
- package/dist/cjs/commands/indent-list.js +71 -0
- package/dist/cjs/commands/index.js +350 -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 +70 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/messages.js +37 -0
- package/dist/cjs/plugin.js +133 -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 +295 -0
- package/dist/es2019/actions/wrap-and-join-lists.js +93 -0
- package/dist/es2019/commands/indent-list.js +62 -0
- package/dist/es2019/commands/index.js +326 -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 +121 -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 +283 -0
- package/dist/esm/actions/wrap-and-join-lists.js +94 -0
- package/dist/esm/commands/indent-list.js +63 -0
- package/dist/esm/commands/index.js +324 -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 +62 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/messages.js +29 -0
- package/dist/esm/plugin.js +126 -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 +16 -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 +29 -2
- 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 +16 -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 +29 -2
- 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 +61 -1
- package/tmp/api-report-tmp.d.ts +53 -0
package/report.api.md
CHANGED
|
@@ -16,10 +16,28 @@
|
|
|
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
|
+
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
21
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
22
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
19
23
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
20
24
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
21
26
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
22
27
|
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
28
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
29
|
+
|
|
30
|
+
// @public (undocumented)
|
|
31
|
+
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
32
|
+
|
|
33
|
+
// @public (undocumented)
|
|
34
|
+
type IndentList = (inputMethod: InputMethod) => Command;
|
|
35
|
+
|
|
36
|
+
// @public (undocumented)
|
|
37
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
38
|
+
|
|
39
|
+
// @public (undocumented)
|
|
40
|
+
type IsInsideListItem = (state: EditorState) => boolean;
|
|
23
41
|
|
|
24
42
|
// @public (undocumented)
|
|
25
43
|
export type ListPlugin = NextEditorPlugin<
|
|
@@ -30,12 +48,53 @@ export type ListPlugin = NextEditorPlugin<
|
|
|
30
48
|
typeof featureFlagsPlugin,
|
|
31
49
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
32
50
|
];
|
|
51
|
+
actions: {
|
|
52
|
+
indentList: IndentList;
|
|
53
|
+
outdentList: OutdentList;
|
|
54
|
+
toggleOrderedList: ToggleOrderedList;
|
|
55
|
+
toggleBulletList: ToggleBulletList;
|
|
56
|
+
isInsideListItem: IsInsideListItem;
|
|
57
|
+
findRootParentListNode: FindRootParentListNode;
|
|
58
|
+
};
|
|
59
|
+
sharedState: ListState | undefined;
|
|
33
60
|
}
|
|
34
61
|
>;
|
|
35
62
|
|
|
63
|
+
// @public (undocumented)
|
|
64
|
+
export const listPlugin: ListPlugin;
|
|
65
|
+
|
|
36
66
|
// @public (undocumented)
|
|
37
67
|
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
38
68
|
|
|
69
|
+
// @public (undocumented)
|
|
70
|
+
export interface ListState {
|
|
71
|
+
// (undocumented)
|
|
72
|
+
bulletListActive: boolean;
|
|
73
|
+
// (undocumented)
|
|
74
|
+
bulletListDisabled: boolean;
|
|
75
|
+
// (undocumented)
|
|
76
|
+
decorationSet: DecorationSet;
|
|
77
|
+
// (undocumented)
|
|
78
|
+
orderedListActive: boolean;
|
|
79
|
+
// (undocumented)
|
|
80
|
+
orderedListDisabled: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// @public (undocumented)
|
|
84
|
+
type OutdentList = (
|
|
85
|
+
inputMethod: InputMethod,
|
|
86
|
+
featureFlags: FeatureFlags,
|
|
87
|
+
) => Command;
|
|
88
|
+
|
|
89
|
+
// @public (undocumented)
|
|
90
|
+
type ToggleBulletList = (view: EditorView, inputMethod: InputMethod) => boolean;
|
|
91
|
+
|
|
92
|
+
// @public (undocumented)
|
|
93
|
+
type ToggleOrderedList = (
|
|
94
|
+
view: EditorView,
|
|
95
|
+
inputMethod: InputMethod,
|
|
96
|
+
) => boolean;
|
|
97
|
+
|
|
39
98
|
// (No @packageDocumentation comment for this package)
|
|
40
99
|
```
|
|
41
100
|
|
|
@@ -47,7 +106,8 @@ export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
|
47
106
|
|
|
48
107
|
```json
|
|
49
108
|
{
|
|
50
|
-
"react": "^16.8.0"
|
|
109
|
+
"react": "^16.8.0",
|
|
110
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
51
111
|
}
|
|
52
112
|
```
|
|
53
113
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -5,10 +5,28 @@
|
|
|
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
|
+
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
12
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
13
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
14
|
+
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
15
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
11
16
|
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
17
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
18
|
+
|
|
19
|
+
// @public (undocumented)
|
|
20
|
+
export type FindRootParentListNode = ($pos: ResolvedPos) => ResolvedPos | null;
|
|
21
|
+
|
|
22
|
+
// @public (undocumented)
|
|
23
|
+
type IndentList = (inputMethod: InputMethod) => Command;
|
|
24
|
+
|
|
25
|
+
// @public (undocumented)
|
|
26
|
+
export type InputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
27
|
+
|
|
28
|
+
// @public (undocumented)
|
|
29
|
+
type IsInsideListItem = (state: EditorState) => boolean;
|
|
12
30
|
|
|
13
31
|
// @public (undocumented)
|
|
14
32
|
export type ListPlugin = NextEditorPlugin<'list', {
|
|
@@ -17,11 +35,46 @@ export type ListPlugin = NextEditorPlugin<'list', {
|
|
|
17
35
|
typeof featureFlagsPlugin,
|
|
18
36
|
OptionalPlugin<typeof analyticsPlugin>
|
|
19
37
|
];
|
|
38
|
+
actions: {
|
|
39
|
+
indentList: IndentList;
|
|
40
|
+
outdentList: OutdentList;
|
|
41
|
+
toggleOrderedList: ToggleOrderedList;
|
|
42
|
+
toggleBulletList: ToggleBulletList;
|
|
43
|
+
isInsideListItem: IsInsideListItem;
|
|
44
|
+
findRootParentListNode: FindRootParentListNode;
|
|
45
|
+
};
|
|
46
|
+
sharedState: ListState | undefined;
|
|
20
47
|
}>;
|
|
21
48
|
|
|
49
|
+
// @public (undocumented)
|
|
50
|
+
export const listPlugin: ListPlugin;
|
|
51
|
+
|
|
22
52
|
// @public (undocumented)
|
|
23
53
|
export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
|
|
24
54
|
|
|
55
|
+
// @public (undocumented)
|
|
56
|
+
export interface ListState {
|
|
57
|
+
// (undocumented)
|
|
58
|
+
bulletListActive: boolean;
|
|
59
|
+
// (undocumented)
|
|
60
|
+
bulletListDisabled: boolean;
|
|
61
|
+
// (undocumented)
|
|
62
|
+
decorationSet: DecorationSet;
|
|
63
|
+
// (undocumented)
|
|
64
|
+
orderedListActive: boolean;
|
|
65
|
+
// (undocumented)
|
|
66
|
+
orderedListDisabled: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// @public (undocumented)
|
|
70
|
+
type OutdentList = (inputMethod: InputMethod, featureFlags: FeatureFlags) => Command;
|
|
71
|
+
|
|
72
|
+
// @public (undocumented)
|
|
73
|
+
type ToggleBulletList = (view: EditorView, inputMethod: InputMethod) => boolean;
|
|
74
|
+
|
|
75
|
+
// @public (undocumented)
|
|
76
|
+
type ToggleOrderedList = (view: EditorView, inputMethod: InputMethod) => boolean;
|
|
77
|
+
|
|
25
78
|
// (No @packageDocumentation comment for this package)
|
|
26
79
|
|
|
27
80
|
```
|