@atlaskit/editor-plugin-list 3.9.11 → 3.10.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/CHANGELOG.md +12 -0
- package/dist/cjs/pm-plugins/actions/wrap-and-join-lists.js +0 -2
- package/dist/cjs/pm-plugins/commands/listBackspace.js +0 -6
- package/dist/cjs/pm-plugins/input-rules/wrapping-join-rule.js +1 -4
- package/dist/cjs/pm-plugins/transforms.js +0 -2
- package/dist/cjs/pm-plugins/utils/find.js +2 -2
- package/dist/es2019/pm-plugins/actions/wrap-and-join-lists.js +0 -2
- package/dist/es2019/pm-plugins/commands/listBackspace.js +0 -6
- package/dist/es2019/pm-plugins/input-rules/wrapping-join-rule.js +1 -4
- package/dist/es2019/pm-plugins/transforms.js +0 -2
- package/dist/esm/pm-plugins/actions/wrap-and-join-lists.js +0 -2
- package/dist/esm/pm-plugins/commands/listBackspace.js +0 -6
- package/dist/esm/pm-plugins/input-rules/wrapping-join-rule.js +1 -4
- package/dist/esm/pm-plugins/transforms.js +0 -2
- package/dist/esm/pm-plugins/utils/find.js +4 -3
- package/dist/types/listPluginType.d.ts +19 -12
- package/dist/types-ts4.5/listPluginType.d.ts +19 -15
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-list
|
|
2
2
|
|
|
3
|
+
## 3.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#105322](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105322)
|
|
8
|
+
[`8876083532adc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8876083532adc) -
|
|
9
|
+
Bumped editor-prosemirror version to 7.0.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 3.9.11
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -76,8 +76,6 @@ function wrapInList(listType, attrs) {
|
|
|
76
76
|
*
|
|
77
77
|
* Adapted from https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js#L91-L112
|
|
78
78
|
*/
|
|
79
|
-
// Ignored via go/ees005
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
81
79
|
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
82
80
|
var content = _model.Fragment.empty;
|
|
83
81
|
for (var i = wrappers.length - 1; i >= 0; i--) {
|
|
@@ -13,8 +13,6 @@ var _selection = require("../utils/selection");
|
|
|
13
13
|
//Cases below refer to the cases found in this document: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1146954996/List+Backspace+and+Delete+Behaviour
|
|
14
14
|
|
|
15
15
|
//Case for two adjacent list items of the same indentation
|
|
16
|
-
// Ignored via go/ees005
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
18
16
|
var listBackspaceCase2 = function listBackspaceCase2(tr, dispatch, $prev, $head) {
|
|
19
17
|
/* CASE 2
|
|
20
18
|
* Initial Structure:
|
|
@@ -62,8 +60,6 @@ var listBackspaceCase2 = function listBackspaceCase2(tr, dispatch, $prev, $head)
|
|
|
62
60
|
};
|
|
63
61
|
|
|
64
62
|
//Case for two adjacent list items with the first being of lower indentation
|
|
65
|
-
// Ignored via go/ees005
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
67
63
|
var listBackspaceCase3 = function listBackspaceCase3(tr, dispatch, $prev, $head) {
|
|
68
64
|
/* CASE 3
|
|
69
65
|
* Initial Structure:
|
|
@@ -131,8 +127,6 @@ var listBackspaceCase3 = function listBackspaceCase3(tr, dispatch, $prev, $head)
|
|
|
131
127
|
};
|
|
132
128
|
|
|
133
129
|
//Case for two adjacent list items with the first being of greater indentation
|
|
134
|
-
// Ignored via go/ees005
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
136
130
|
var listBackspaceCase4 = function listBackspaceCase4(tr, dispatch, $prev, $head, $last) {
|
|
137
131
|
/* CASE 4
|
|
138
132
|
* Initial Structure:
|
|
@@ -15,10 +15,7 @@ var createWrappingJoinRule = exports.createWrappingJoinRule = function createWra
|
|
|
15
15
|
nodeType = _ref.nodeType,
|
|
16
16
|
getAttrs = _ref.getAttrs,
|
|
17
17
|
joinPredicate = _ref.joinPredicate;
|
|
18
|
-
var handler = function handler(state, match, start, end
|
|
19
|
-
// Ignored via go/ees005
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
21
|
-
) {
|
|
18
|
+
var handler = function handler(state, match, start, end) {
|
|
22
19
|
var attrs = (getAttrs instanceof Function ? getAttrs(match) : getAttrs) || {};
|
|
23
20
|
var tr = state.tr;
|
|
24
21
|
var fixedStart = Math.max(start, 1);
|
|
@@ -30,8 +30,6 @@ function liftListItem(selection, tr) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Function will lift list item following selection to level-1.
|
|
33
|
-
// Ignored via go/ees005
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
35
33
|
function liftFollowingList(from, to, rootListDepth, tr) {
|
|
36
34
|
var listItem = tr.doc.type.schema.nodes.listItem;
|
|
37
35
|
var lifted = false;
|
|
@@ -44,7 +44,7 @@ function findFirstParentListItemNode($pos) {
|
|
|
44
44
|
pos: listItemNodePosition.pos
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
var
|
|
47
|
+
var _findRootParentListNode = exports.findRootParentListNode = function findRootParentListNode($pos) {
|
|
48
48
|
var doc = $pos.doc;
|
|
49
49
|
if ($pos.pos + 1 > doc.content.size) {
|
|
50
50
|
return null;
|
|
@@ -63,5 +63,5 @@ var findRootParentListNode = exports.findRootParentListNode = function findRootP
|
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
65
|
var listNodePosition = doc.resolve(parentList.pos);
|
|
66
|
-
return
|
|
66
|
+
return _findRootParentListNode(listNodePosition);
|
|
67
67
|
};
|
|
@@ -69,8 +69,6 @@ export function wrapInList(listType, attrs) {
|
|
|
69
69
|
*
|
|
70
70
|
* Adapted from https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js#L91-L112
|
|
71
71
|
*/
|
|
72
|
-
// Ignored via go/ees005
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
74
72
|
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
75
73
|
let content = Fragment.empty;
|
|
76
74
|
for (let i = wrappers.length - 1; i >= 0; i--) {
|
|
@@ -5,8 +5,6 @@ import { isPosInsideList, isPosInsideParagraph } from '../utils/selection';
|
|
|
5
5
|
//Cases below refer to the cases found in this document: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1146954996/List+Backspace+and+Delete+Behaviour
|
|
6
6
|
|
|
7
7
|
//Case for two adjacent list items of the same indentation
|
|
8
|
-
// Ignored via go/ees005
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
8
|
const listBackspaceCase2 = (tr, dispatch, $prev, $head) => {
|
|
11
9
|
/* CASE 2
|
|
12
10
|
* Initial Structure:
|
|
@@ -52,8 +50,6 @@ const listBackspaceCase2 = (tr, dispatch, $prev, $head) => {
|
|
|
52
50
|
};
|
|
53
51
|
|
|
54
52
|
//Case for two adjacent list items with the first being of lower indentation
|
|
55
|
-
// Ignored via go/ees005
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
57
53
|
const listBackspaceCase3 = (tr, dispatch, $prev, $head) => {
|
|
58
54
|
/* CASE 3
|
|
59
55
|
* Initial Structure:
|
|
@@ -119,8 +115,6 @@ const listBackspaceCase3 = (tr, dispatch, $prev, $head) => {
|
|
|
119
115
|
};
|
|
120
116
|
|
|
121
117
|
//Case for two adjacent list items with the first being of greater indentation
|
|
122
|
-
// Ignored via go/ees005
|
|
123
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
124
118
|
const listBackspaceCase4 = (tr, dispatch, $prev, $head, $last) => {
|
|
125
119
|
/* CASE 4
|
|
126
120
|
* Initial Structure:
|
|
@@ -11,10 +11,7 @@ export const createWrappingJoinRule = ({
|
|
|
11
11
|
getAttrs,
|
|
12
12
|
joinPredicate
|
|
13
13
|
}) => {
|
|
14
|
-
const handler = (state, match, start, end
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
|
-
) => {
|
|
14
|
+
const handler = (state, match, start, end) => {
|
|
18
15
|
const attrs = (getAttrs instanceof Function ? getAttrs(match) : getAttrs) || {};
|
|
19
16
|
const tr = state.tr;
|
|
20
17
|
const fixedStart = Math.max(start, 1);
|
|
@@ -22,8 +22,6 @@ function liftListItem(selection, tr) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// Function will lift list item following selection to level-1.
|
|
25
|
-
// Ignored via go/ees005
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
27
25
|
export function liftFollowingList(from, to, rootListDepth, tr) {
|
|
28
26
|
const {
|
|
29
27
|
listItem
|
|
@@ -70,8 +70,6 @@ export function wrapInList(listType, attrs) {
|
|
|
70
70
|
*
|
|
71
71
|
* Adapted from https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js#L91-L112
|
|
72
72
|
*/
|
|
73
|
-
// Ignored via go/ees005
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
75
73
|
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
76
74
|
var content = Fragment.empty;
|
|
77
75
|
for (var i = wrappers.length - 1; i >= 0; i--) {
|
|
@@ -6,8 +6,6 @@ import { isPosInsideList, isPosInsideParagraph } from '../utils/selection';
|
|
|
6
6
|
//Cases below refer to the cases found in this document: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1146954996/List+Backspace+and+Delete+Behaviour
|
|
7
7
|
|
|
8
8
|
//Case for two adjacent list items of the same indentation
|
|
9
|
-
// Ignored via go/ees005
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
11
9
|
var listBackspaceCase2 = function listBackspaceCase2(tr, dispatch, $prev, $head) {
|
|
12
10
|
/* CASE 2
|
|
13
11
|
* Initial Structure:
|
|
@@ -55,8 +53,6 @@ var listBackspaceCase2 = function listBackspaceCase2(tr, dispatch, $prev, $head)
|
|
|
55
53
|
};
|
|
56
54
|
|
|
57
55
|
//Case for two adjacent list items with the first being of lower indentation
|
|
58
|
-
// Ignored via go/ees005
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
60
56
|
var listBackspaceCase3 = function listBackspaceCase3(tr, dispatch, $prev, $head) {
|
|
61
57
|
/* CASE 3
|
|
62
58
|
* Initial Structure:
|
|
@@ -124,8 +120,6 @@ var listBackspaceCase3 = function listBackspaceCase3(tr, dispatch, $prev, $head)
|
|
|
124
120
|
};
|
|
125
121
|
|
|
126
122
|
//Case for two adjacent list items with the first being of greater indentation
|
|
127
|
-
// Ignored via go/ees005
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
129
123
|
var listBackspaceCase4 = function listBackspaceCase4(tr, dispatch, $prev, $head, $last) {
|
|
130
124
|
/* CASE 4
|
|
131
125
|
* Initial Structure:
|
|
@@ -10,10 +10,7 @@ export var createWrappingJoinRule = function createWrappingJoinRule(_ref) {
|
|
|
10
10
|
nodeType = _ref.nodeType,
|
|
11
11
|
getAttrs = _ref.getAttrs,
|
|
12
12
|
joinPredicate = _ref.joinPredicate;
|
|
13
|
-
var handler = function handler(state, match, start, end
|
|
14
|
-
// Ignored via go/ees005
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
16
|
-
) {
|
|
13
|
+
var handler = function handler(state, match, start, end) {
|
|
17
14
|
var attrs = (getAttrs instanceof Function ? getAttrs(match) : getAttrs) || {};
|
|
18
15
|
var tr = state.tr;
|
|
19
16
|
var fixedStart = Math.max(start, 1);
|
|
@@ -22,8 +22,6 @@ function liftListItem(selection, tr) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// Function will lift list item following selection to level-1.
|
|
25
|
-
// Ignored via go/ees005
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
27
25
|
export function liftFollowingList(from, to, rootListDepth, tr) {
|
|
28
26
|
var listItem = tr.doc.type.schema.nodes.listItem;
|
|
29
27
|
var lifted = false;
|
|
@@ -36,7 +36,7 @@ export function findFirstParentListItemNode($pos) {
|
|
|
36
36
|
pos: listItemNodePosition.pos
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
var _findRootParentListNode = function findRootParentListNode($pos) {
|
|
40
40
|
var doc = $pos.doc;
|
|
41
41
|
if ($pos.pos + 1 > doc.content.size) {
|
|
42
42
|
return null;
|
|
@@ -55,5 +55,6 @@ export var findRootParentListNode = function findRootParentListNode($pos) {
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
var listNodePosition = doc.resolve(parentList.pos);
|
|
58
|
-
return
|
|
59
|
-
};
|
|
58
|
+
return _findRootParentListNode(listNodePosition);
|
|
59
|
+
};
|
|
60
|
+
export { _findRootParentListNode as findRootParentListNode };
|
|
@@ -2,17 +2,24 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { FindRootParentListNode, IndentList, IsInsideListItem, ListState, OutdentList, ToggleBulletList, ToggleOrderedList } from './types';
|
|
5
|
+
export type ListPluginDependencies = [
|
|
6
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
7
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
8
|
+
];
|
|
9
|
+
export type ListPluginActions = {
|
|
10
|
+
isInsideListItem: IsInsideListItem;
|
|
11
|
+
findRootParentListNode: FindRootParentListNode;
|
|
12
|
+
};
|
|
13
|
+
export type ListPluginCommands = {
|
|
14
|
+
indentList: IndentList;
|
|
15
|
+
outdentList: OutdentList;
|
|
16
|
+
toggleOrderedList: ToggleOrderedList;
|
|
17
|
+
toggleBulletList: ToggleBulletList;
|
|
18
|
+
};
|
|
19
|
+
export type ListPluginSharedState = ListState | undefined;
|
|
5
20
|
export type ListPlugin = NextEditorPlugin<'list', {
|
|
6
|
-
dependencies:
|
|
7
|
-
actions:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
commands: {
|
|
12
|
-
indentList: IndentList;
|
|
13
|
-
outdentList: OutdentList;
|
|
14
|
-
toggleOrderedList: ToggleOrderedList;
|
|
15
|
-
toggleBulletList: ToggleBulletList;
|
|
16
|
-
};
|
|
17
|
-
sharedState: ListState | undefined;
|
|
21
|
+
dependencies: ListPluginDependencies;
|
|
22
|
+
actions: ListPluginActions;
|
|
23
|
+
commands: ListPluginCommands;
|
|
24
|
+
sharedState: ListPluginSharedState;
|
|
18
25
|
}>;
|
|
@@ -2,20 +2,24 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { FindRootParentListNode, IndentList, IsInsideListItem, ListState, OutdentList, ToggleBulletList, ToggleOrderedList } from './types';
|
|
5
|
+
export type ListPluginDependencies = [
|
|
6
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
7
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
8
|
+
];
|
|
9
|
+
export type ListPluginActions = {
|
|
10
|
+
isInsideListItem: IsInsideListItem;
|
|
11
|
+
findRootParentListNode: FindRootParentListNode;
|
|
12
|
+
};
|
|
13
|
+
export type ListPluginCommands = {
|
|
14
|
+
indentList: IndentList;
|
|
15
|
+
outdentList: OutdentList;
|
|
16
|
+
toggleOrderedList: ToggleOrderedList;
|
|
17
|
+
toggleBulletList: ToggleBulletList;
|
|
18
|
+
};
|
|
19
|
+
export type ListPluginSharedState = ListState | undefined;
|
|
5
20
|
export type ListPlugin = NextEditorPlugin<'list', {
|
|
6
|
-
dependencies:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
actions: {
|
|
11
|
-
isInsideListItem: IsInsideListItem;
|
|
12
|
-
findRootParentListNode: FindRootParentListNode;
|
|
13
|
-
};
|
|
14
|
-
commands: {
|
|
15
|
-
indentList: IndentList;
|
|
16
|
-
outdentList: OutdentList;
|
|
17
|
-
toggleOrderedList: ToggleOrderedList;
|
|
18
|
-
toggleBulletList: ToggleBulletList;
|
|
19
|
-
};
|
|
20
|
-
sharedState: ListState | undefined;
|
|
21
|
+
dependencies: ListPluginDependencies;
|
|
22
|
+
actions: ListPluginActions;
|
|
23
|
+
commands: ListPluginCommands;
|
|
24
|
+
sharedState: ListPluginSharedState;
|
|
21
25
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-list",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "List plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^99.
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
37
|
-
"@atlaskit/editor-plugin-feature-flags": "^1.
|
|
38
|
-
"@atlaskit/editor-prosemirror": "
|
|
39
|
-
"@atlaskit/prosemirror-input-rules": "^3.
|
|
35
|
+
"@atlaskit/editor-common": "^99.10.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^1.12.0",
|
|
37
|
+
"@atlaskit/editor-plugin-feature-flags": "^1.3.0",
|
|
38
|
+
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
|
+
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -74,8 +74,7 @@
|
|
|
74
74
|
],
|
|
75
75
|
"deprecation": "no-deprecated-imports",
|
|
76
76
|
"styling": [
|
|
77
|
-
"
|
|
78
|
-
"emotion"
|
|
77
|
+
"compiled"
|
|
79
78
|
],
|
|
80
79
|
"imports": [
|
|
81
80
|
"import-no-extraneous-disable-for-examples-and-docs"
|