@atlaskit/editor-common 122.12.0 → 123.0.1
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 +30 -0
- package/dist/cjs/extensibility/ExtensionComponent.js +1 -1
- package/dist/cjs/extensions/extension-handlers.js +1 -2
- package/dist/cjs/lists/flatten-list.js +1 -73
- package/dist/cjs/lists/index.js +0 -26
- package/dist/cjs/lists/node.js +1 -78
- package/dist/cjs/lists/replace-content.js +1 -9
- package/dist/cjs/lists/selection.js +2 -29
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-anchor/node-anchor-provider.js +1 -3
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/extensibility/ExtensionComponent.js +1 -1
- package/dist/es2019/extensions/extension-handlers.js +1 -2
- package/dist/es2019/lists/flatten-list.js +1 -76
- package/dist/es2019/lists/index.js +2 -4
- package/dist/es2019/lists/node.js +0 -77
- package/dist/es2019/lists/replace-content.js +1 -3
- package/dist/es2019/lists/selection.js +1 -31
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-anchor/node-anchor-provider.js +1 -3
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/extensibility/ExtensionComponent.js +1 -1
- package/dist/esm/extensions/extension-handlers.js +1 -2
- package/dist/esm/lists/flatten-list.js +1 -71
- package/dist/esm/lists/index.js +2 -4
- package/dist/esm/lists/node.js +0 -77
- package/dist/esm/lists/replace-content.js +1 -3
- package/dist/esm/lists/selection.js +1 -28
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-anchor/node-anchor-provider.js +1 -3
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/lists/flatten-list.d.ts +0 -28
- package/dist/types/lists/index.d.ts +2 -4
- package/dist/types/lists/node.d.ts +0 -1
- package/dist/types/lists/replace-content.d.ts +1 -1
- package/dist/types/lists/selection.d.ts +1 -7
- package/package.json +4 -7
- package/dist/cjs/lists/indentation.js +0 -23
- package/dist/cjs/lists/wrapTaskListIntoListAbove.js +0 -30
- package/dist/es2019/lists/indentation.js +0 -18
- package/dist/es2019/lists/wrapTaskListIntoListAbove.js +0 -24
- package/dist/esm/lists/indentation.js +0 -17
- package/dist/esm/lists/wrapTaskListIntoListAbove.js +0 -24
- package/dist/types/lists/indentation.d.ts +0 -5
- package/dist/types/lists/wrapTaskListIntoListAbove.d.ts +0 -2
- package/lists/indentation/package.json +0 -10
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export var wrapTaskListIntoListAbove = function wrapTaskListIntoListAbove(tr, taskListStart, previousListStart) {
|
|
3
|
-
var $taskListStart = tr.doc.resolve(taskListStart);
|
|
4
|
-
|
|
5
|
-
/* Safecheck: if not passed a taskList node, return */
|
|
6
|
-
if ($taskListStart.node().type.name !== 'taskList') {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
var $previousListStart = tr.doc.resolve(previousListStart);
|
|
10
|
-
var taskList = tr.doc.slice($taskListStart.pos, $taskListStart.after());
|
|
11
|
-
var frag = Fragment.from(taskList.content);
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
Delete the existing taskList at the same level and insert inside above list provided
|
|
15
|
-
1. To delete the tasklist, we need wrapping positions before and after it to completely delete it.
|
|
16
|
-
$taskListStart.after() would give us closing position enclosed by node itself using it would remove only the contents of taskList
|
|
17
|
-
so we add 1 to it to get the position after the taskList node and completly remove it.
|
|
18
|
-
2. Inserting the taskList at the end() position safe inserts the taskList to next available position which would lead to deleting and inserting taskList at same place.
|
|
19
|
-
Reason: $previousListStart.end() gives us end position of listItem but we can add content only inside listItem not at same level
|
|
20
|
-
so we subtract 1 to get the position inside the list item and insert the TaskList same level as paragraph/content inside listItem.
|
|
21
|
-
*/
|
|
22
|
-
tr.delete($taskListStart.before(), $taskListStart.after() + 1);
|
|
23
|
-
tr.insert($previousListStart.end() - 1, frag);
|
|
24
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@atlaskit/editor-common/lists/indentation",
|
|
3
|
-
"main": "../../dist/cjs/lists/indentation.js",
|
|
4
|
-
"module": "../../dist/esm/lists/indentation.js",
|
|
5
|
-
"module:es2019": "../../dist/es2019/lists/indentation.js",
|
|
6
|
-
"sideEffects": [
|
|
7
|
-
"**/*.compiled.css"
|
|
8
|
-
],
|
|
9
|
-
"types": "../../dist/types/lists/indentation.d.ts"
|
|
10
|
-
}
|