@atlaskit/editor-plugin-tasks-and-decisions 6.4.3 → 6.4.5
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 +16 -0
- package/dist/cjs/pm-plugins/commands.js +0 -16
- package/dist/cjs/pm-plugins/helpers.js +19 -4
- package/dist/es2019/pm-plugins/commands.js +1 -17
- package/dist/es2019/pm-plugins/helpers.js +14 -2
- package/dist/esm/pm-plugins/commands.js +0 -16
- package/dist/esm/pm-plugins/helpers.js +20 -5
- package/dist/types/nodeviews/DecisionItemNodeView.d.ts +1 -1
- package/dist/types/nodeviews/TaskItemNodeView.d.ts +2 -2
- package/dist/types/nodeviews/hooks/use-show-placeholder.d.ts +1 -1
- package/dist/types/pm-plugins/helpers.d.ts +5 -5
- package/dist/types/pm-plugins/insert-commands.d.ts +1 -1
- package/dist/types/pm-plugins/types.d.ts +1 -1
- package/dist/types/tasksAndDecisionsPluginType.d.ts +4 -4
- package/dist/types/types/index.d.ts +15 -15
- package/dist/types/ui/Task/RequestToEditPopup.d.ts +4 -4
- package/dist/types/ui/Task/index.d.ts +8 -8
- package/dist/types/ui/Task/task-item-with-providers.d.ts +6 -6
- package/dist/types/ui/ToolbarDecision/index.d.ts +1 -1
- package/dist/types/ui/ToolbarTask/index.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/DecisionItemNodeView.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/TaskItemNodeView.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/hooks/use-show-placeholder.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/helpers.d.ts +5 -5
- package/dist/types-ts4.5/pm-plugins/insert-commands.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/types.d.ts +1 -1
- package/dist/types-ts4.5/tasksAndDecisionsPluginType.d.ts +4 -4
- package/dist/types-ts4.5/types/index.d.ts +15 -15
- package/dist/types-ts4.5/ui/Task/RequestToEditPopup.d.ts +4 -4
- package/dist/types-ts4.5/ui/Task/index.d.ts +8 -8
- package/dist/types-ts4.5/ui/Task/task-item-with-providers.d.ts +6 -6
- package/dist/types-ts4.5/ui/ToolbarDecision/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ToolbarTask/index.d.ts +1 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 6.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`69ab2a06347c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/69ab2a06347c4) -
|
|
8
|
+
[EDITOR-1155] Handle shift-tab for blockTaskItems
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.4.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
16
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.4.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.wrapSelectionInTaskList = exports.liftSelection = exports.joinAtCut = void 0;
|
|
7
7
|
var _commands = require("@atlaskit/editor-common/commands");
|
|
8
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
-
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
10
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
9
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
12
10
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
13
11
|
var _helpers = require("./helpers");
|
|
@@ -68,20 +66,6 @@ var wrapSelectionInTaskList = exports.wrapSelectionInTaskList = function wrapSel
|
|
|
68
66
|
return true;
|
|
69
67
|
}
|
|
70
68
|
var blockRange = (0, _helpers.getBlockRange)($from, $to);
|
|
71
|
-
if (blockTaskItem && isBlockTaskItem && blockTaskItemNode) {
|
|
72
|
-
var startOfNodeInBlockTaskItem = state.doc.resolve(blockTaskItemNode.start);
|
|
73
|
-
if (state.selection instanceof _state.TextSelection && state.selection.$to !== state.selection.$from) {
|
|
74
|
-
var lastNode = $to.node($to.depth);
|
|
75
|
-
var endOfNodeInBlockTaskItem = state.doc.resolve($to.start() + lastNode.nodeSize - 1);
|
|
76
|
-
if (lastNode.type === taskItem) {
|
|
77
|
-
blockRange = new _model.NodeRange(startOfNodeInBlockTaskItem, endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
78
|
-
}
|
|
79
|
-
} else {
|
|
80
|
-
// Get the Resolved $from and $to of the node nested inside the blockTaskItem
|
|
81
|
-
var _endOfNodeInBlockTaskItem = state.doc.resolve(blockTaskItemNode.start + blockTaskItemNode.node.nodeSize - 1);
|
|
82
|
-
blockRange = new _model.NodeRange(startOfNodeInBlockTaskItem, _endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
69
|
if (!blockRange) {
|
|
86
70
|
return true;
|
|
87
71
|
}
|
|
@@ -17,6 +17,7 @@ exports.openRequestEditPopupAt = openRequestEditPopupAt;
|
|
|
17
17
|
exports.removeCheckboxFocus = removeCheckboxFocus;
|
|
18
18
|
exports.walkOut = exports.subtreeHeight = void 0;
|
|
19
19
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
20
21
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
21
22
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
22
23
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
@@ -27,6 +28,9 @@ var isInsideTaskOrDecisionItem = exports.isInsideTaskOrDecisionItem = function i
|
|
|
27
28
|
decisionItem = _state$schema$nodes.decisionItem,
|
|
28
29
|
taskItem = _state$schema$nodes.taskItem,
|
|
29
30
|
blockTaskItem = _state$schema$nodes.blockTaskItem;
|
|
31
|
+
if (blockTaskItem) {
|
|
32
|
+
return Boolean((0, _utils2.findParentNodeOfTypeClosestToPos)(state.selection.$from, [decisionItem, taskItem, blockTaskItem]));
|
|
33
|
+
}
|
|
30
34
|
return (0, _utils2.hasParentNodeOfType)([decisionItem, taskItem, blockTaskItem])(state.selection);
|
|
31
35
|
};
|
|
32
36
|
var isActionOrDecisionList = exports.isActionOrDecisionList = function isActionOrDecisionList(node) {
|
|
@@ -68,7 +72,18 @@ var isTable = exports.isTable = function isTable(node) {
|
|
|
68
72
|
* ("nested") taskList, if one exists.
|
|
69
73
|
*/
|
|
70
74
|
var getBlockRange = exports.getBlockRange = function getBlockRange($from, $to) {
|
|
71
|
-
var
|
|
75
|
+
var _$from$doc$type$schem = $from.doc.type.schema.nodes,
|
|
76
|
+
taskList = _$from$doc$type$schem.taskList,
|
|
77
|
+
blockTaskItem = _$from$doc$type$schem.blockTaskItem;
|
|
78
|
+
var blockTaskItemNode = (0, _utils.findFarthestParentNode)(function (node) {
|
|
79
|
+
return node.type === blockTaskItem;
|
|
80
|
+
})($from);
|
|
81
|
+
if (blockTaskItem && blockTaskItemNode) {
|
|
82
|
+
var startOfNodeInBlockTaskItem = $from.doc.resolve(blockTaskItemNode.start);
|
|
83
|
+
var lastNode = $to.node($to.depth);
|
|
84
|
+
var endOfNodeInBlockTaskItem = $from.doc.resolve($to.start() + lastNode.nodeSize - 1);
|
|
85
|
+
return new _model.NodeRange(startOfNodeInBlockTaskItem, endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
86
|
+
}
|
|
72
87
|
var end = $to.end();
|
|
73
88
|
var $after = $to.doc.resolve(end + 1);
|
|
74
89
|
var after = $after.nodeAfter;
|
|
@@ -98,9 +113,9 @@ var getBlockRange = exports.getBlockRange = function getBlockRange($from, $to) {
|
|
|
98
113
|
*/
|
|
99
114
|
var getCurrentIndentLevel = exports.getCurrentIndentLevel = function getCurrentIndentLevel(selection) {
|
|
100
115
|
var $from = selection.$from;
|
|
101
|
-
var _$from$doc$type$
|
|
102
|
-
taskList = _$from$doc$type$
|
|
103
|
-
blockTaskItem = _$from$doc$type$
|
|
116
|
+
var _$from$doc$type$schem2 = $from.doc.type.schema.nodes,
|
|
117
|
+
taskList = _$from$doc$type$schem2.taskList,
|
|
118
|
+
blockTaskItem = _$from$doc$type$schem2.blockTaskItem;
|
|
104
119
|
var furthestParent = (0, _utils.findFarthestParentNode)(function (node) {
|
|
105
120
|
return node.type === taskList;
|
|
106
121
|
})($from);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { findCutBefore } from '@atlaskit/editor-common/commands';
|
|
2
2
|
import { findFarthestParentNode } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
3
|
import { findWrapping, ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
|
|
6
4
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
5
|
import { getBlockRange, isActionOrDecisionItem, isActionOrDecisionList, liftBlock, subtreeHeight } from './helpers';
|
|
@@ -63,21 +61,7 @@ export const wrapSelectionInTaskList = (state, dispatch) => {
|
|
|
63
61
|
if (maxDepth >= 6) {
|
|
64
62
|
return true;
|
|
65
63
|
}
|
|
66
|
-
|
|
67
|
-
if (blockTaskItem && isBlockTaskItem && blockTaskItemNode) {
|
|
68
|
-
const startOfNodeInBlockTaskItem = state.doc.resolve(blockTaskItemNode.start);
|
|
69
|
-
if (state.selection instanceof TextSelection && state.selection.$to !== state.selection.$from) {
|
|
70
|
-
const lastNode = $to.node($to.depth);
|
|
71
|
-
const endOfNodeInBlockTaskItem = state.doc.resolve($to.start() + lastNode.nodeSize - 1);
|
|
72
|
-
if (lastNode.type === taskItem) {
|
|
73
|
-
blockRange = new NodeRange(startOfNodeInBlockTaskItem, endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
// Get the Resolved $from and $to of the node nested inside the blockTaskItem
|
|
77
|
-
const endOfNodeInBlockTaskItem = state.doc.resolve(blockTaskItemNode.start + blockTaskItemNode.node.nodeSize - 1);
|
|
78
|
-
blockRange = new NodeRange(startOfNodeInBlockTaskItem, endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
64
|
+
const blockRange = getBlockRange($from, $to);
|
|
81
65
|
if (!blockRange) {
|
|
82
66
|
return true;
|
|
83
67
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { findFarthestParentNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
-
import { findParentNodeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import { findParentNodeClosestToPos, findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
6
|
import { stateKey } from './plugin-key';
|
|
6
7
|
import { ACTIONS } from './types';
|
|
7
8
|
export const isInsideTaskOrDecisionItem = state => {
|
|
@@ -10,6 +11,9 @@ export const isInsideTaskOrDecisionItem = state => {
|
|
|
10
11
|
taskItem,
|
|
11
12
|
blockTaskItem
|
|
12
13
|
} = state.schema.nodes;
|
|
14
|
+
if (blockTaskItem) {
|
|
15
|
+
return Boolean(findParentNodeOfTypeClosestToPos(state.selection.$from, [decisionItem, taskItem, blockTaskItem]));
|
|
16
|
+
}
|
|
13
17
|
return hasParentNodeOfType([decisionItem, taskItem, blockTaskItem])(state.selection);
|
|
14
18
|
};
|
|
15
19
|
export const isActionOrDecisionList = node => {
|
|
@@ -58,8 +62,16 @@ export const isTable = node => {
|
|
|
58
62
|
*/
|
|
59
63
|
export const getBlockRange = ($from, $to) => {
|
|
60
64
|
const {
|
|
61
|
-
taskList
|
|
65
|
+
taskList,
|
|
66
|
+
blockTaskItem
|
|
62
67
|
} = $from.doc.type.schema.nodes;
|
|
68
|
+
const blockTaskItemNode = findFarthestParentNode(node => node.type === blockTaskItem)($from);
|
|
69
|
+
if (blockTaskItem && blockTaskItemNode) {
|
|
70
|
+
const startOfNodeInBlockTaskItem = $from.doc.resolve(blockTaskItemNode.start);
|
|
71
|
+
const lastNode = $to.node($to.depth);
|
|
72
|
+
const endOfNodeInBlockTaskItem = $from.doc.resolve($to.start() + lastNode.nodeSize - 1);
|
|
73
|
+
return new NodeRange(startOfNodeInBlockTaskItem, endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
74
|
+
}
|
|
63
75
|
let end = $to.end();
|
|
64
76
|
const $after = $to.doc.resolve(end + 1);
|
|
65
77
|
const after = $after.nodeAfter;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { findCutBefore } from '@atlaskit/editor-common/commands';
|
|
2
2
|
import { findFarthestParentNode } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
3
|
import { findWrapping, ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
|
|
6
4
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
5
|
import { getBlockRange, isActionOrDecisionItem, isActionOrDecisionList, liftBlock, subtreeHeight } from './helpers';
|
|
@@ -62,20 +60,6 @@ export var wrapSelectionInTaskList = function wrapSelectionInTaskList(state, dis
|
|
|
62
60
|
return true;
|
|
63
61
|
}
|
|
64
62
|
var blockRange = getBlockRange($from, $to);
|
|
65
|
-
if (blockTaskItem && isBlockTaskItem && blockTaskItemNode) {
|
|
66
|
-
var startOfNodeInBlockTaskItem = state.doc.resolve(blockTaskItemNode.start);
|
|
67
|
-
if (state.selection instanceof TextSelection && state.selection.$to !== state.selection.$from) {
|
|
68
|
-
var lastNode = $to.node($to.depth);
|
|
69
|
-
var endOfNodeInBlockTaskItem = state.doc.resolve($to.start() + lastNode.nodeSize - 1);
|
|
70
|
-
if (lastNode.type === taskItem) {
|
|
71
|
-
blockRange = new NodeRange(startOfNodeInBlockTaskItem, endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
72
|
-
}
|
|
73
|
-
} else {
|
|
74
|
-
// Get the Resolved $from and $to of the node nested inside the blockTaskItem
|
|
75
|
-
var _endOfNodeInBlockTaskItem = state.doc.resolve(blockTaskItemNode.start + blockTaskItemNode.node.nodeSize - 1);
|
|
76
|
-
blockRange = new NodeRange(startOfNodeInBlockTaskItem, _endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
63
|
if (!blockRange) {
|
|
80
64
|
return true;
|
|
81
65
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { findFarthestParentNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { NodeRange } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
4
|
import { liftTarget } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
-
import { findParentNodeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import { findParentNodeClosestToPos, findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
6
|
import { stateKey } from './plugin-key';
|
|
6
7
|
import { ACTIONS } from './types';
|
|
7
8
|
export var isInsideTaskOrDecisionItem = function isInsideTaskOrDecisionItem(state) {
|
|
@@ -9,6 +10,9 @@ export var isInsideTaskOrDecisionItem = function isInsideTaskOrDecisionItem(stat
|
|
|
9
10
|
decisionItem = _state$schema$nodes.decisionItem,
|
|
10
11
|
taskItem = _state$schema$nodes.taskItem,
|
|
11
12
|
blockTaskItem = _state$schema$nodes.blockTaskItem;
|
|
13
|
+
if (blockTaskItem) {
|
|
14
|
+
return Boolean(findParentNodeOfTypeClosestToPos(state.selection.$from, [decisionItem, taskItem, blockTaskItem]));
|
|
15
|
+
}
|
|
12
16
|
return hasParentNodeOfType([decisionItem, taskItem, blockTaskItem])(state.selection);
|
|
13
17
|
};
|
|
14
18
|
export var isActionOrDecisionList = function isActionOrDecisionList(node) {
|
|
@@ -50,7 +54,18 @@ export var isTable = function isTable(node) {
|
|
|
50
54
|
* ("nested") taskList, if one exists.
|
|
51
55
|
*/
|
|
52
56
|
export var getBlockRange = function getBlockRange($from, $to) {
|
|
53
|
-
var
|
|
57
|
+
var _$from$doc$type$schem = $from.doc.type.schema.nodes,
|
|
58
|
+
taskList = _$from$doc$type$schem.taskList,
|
|
59
|
+
blockTaskItem = _$from$doc$type$schem.blockTaskItem;
|
|
60
|
+
var blockTaskItemNode = findFarthestParentNode(function (node) {
|
|
61
|
+
return node.type === blockTaskItem;
|
|
62
|
+
})($from);
|
|
63
|
+
if (blockTaskItem && blockTaskItemNode) {
|
|
64
|
+
var startOfNodeInBlockTaskItem = $from.doc.resolve(blockTaskItemNode.start);
|
|
65
|
+
var lastNode = $to.node($to.depth);
|
|
66
|
+
var endOfNodeInBlockTaskItem = $from.doc.resolve($to.start() + lastNode.nodeSize - 1);
|
|
67
|
+
return new NodeRange(startOfNodeInBlockTaskItem, endOfNodeInBlockTaskItem, blockTaskItemNode.depth - 1);
|
|
68
|
+
}
|
|
54
69
|
var end = $to.end();
|
|
55
70
|
var $after = $to.doc.resolve(end + 1);
|
|
56
71
|
var after = $after.nodeAfter;
|
|
@@ -80,9 +95,9 @@ export var getBlockRange = function getBlockRange($from, $to) {
|
|
|
80
95
|
*/
|
|
81
96
|
export var getCurrentIndentLevel = function getCurrentIndentLevel(selection) {
|
|
82
97
|
var $from = selection.$from;
|
|
83
|
-
var _$from$doc$type$
|
|
84
|
-
taskList = _$from$doc$type$
|
|
85
|
-
blockTaskItem = _$from$doc$type$
|
|
98
|
+
var _$from$doc$type$schem2 = $from.doc.type.schema.nodes,
|
|
99
|
+
taskList = _$from$doc$type$schem2.taskList,
|
|
100
|
+
blockTaskItem = _$from$doc$type$schem2.blockTaskItem;
|
|
86
101
|
var furthestParent = findFarthestParentNode(function (node) {
|
|
87
102
|
return node.type === taskList;
|
|
88
103
|
})($from);
|
|
@@ -44,7 +44,7 @@ export declare class DecisionItemNodeView implements NodeView {
|
|
|
44
44
|
* const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
|
|
45
45
|
*/
|
|
46
46
|
ignoreMutation(mutation: MutationRecord | {
|
|
47
|
-
type: 'selection';
|
|
48
47
|
target: Node;
|
|
48
|
+
type: 'selection';
|
|
49
49
|
}): boolean;
|
|
50
50
|
}
|
|
@@ -6,8 +6,8 @@ import type { NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
import type { TasksAndDecisionsPlugin } from '../tasksAndDecisionsPluginType';
|
|
7
7
|
interface TaskItemNodeViewOptions {
|
|
8
8
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
9
|
intl: IntlShape;
|
|
10
|
+
placeholder?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare class TaskItemNodeView implements NodeView {
|
|
13
13
|
dom: Node;
|
|
@@ -31,8 +31,8 @@ export declare class TaskItemNodeView implements NodeView {
|
|
|
31
31
|
private updatePlaceholder;
|
|
32
32
|
update(node: PMNode): boolean;
|
|
33
33
|
ignoreMutation(mutation: MutationRecord | {
|
|
34
|
-
type: 'selection';
|
|
35
34
|
target: Node;
|
|
35
|
+
type: 'selection';
|
|
36
36
|
}): boolean;
|
|
37
37
|
destroy(): void;
|
|
38
38
|
}
|
|
@@ -2,8 +2,8 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
4
4
|
type Props2 = {
|
|
5
|
-
editorView: EditorView;
|
|
6
5
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
6
|
+
editorView: EditorView;
|
|
7
7
|
getPos: () => number | undefined;
|
|
8
8
|
isContentNodeEmpty: boolean;
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { NodeRange, type Node, type NodeType, type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { TaskItemData } from './types';
|
|
@@ -12,7 +12,7 @@ export declare const isTable: (node?: Node | null) => boolean;
|
|
|
12
12
|
* Creates a NodeRange around the given taskItem and the following
|
|
13
13
|
* ("nested") taskList, if one exists.
|
|
14
14
|
*/
|
|
15
|
-
export declare const getBlockRange: ($from: ResolvedPos, $to: ResolvedPos) =>
|
|
15
|
+
export declare const getBlockRange: ($from: ResolvedPos, $to: ResolvedPos) => NodeRange | null;
|
|
16
16
|
/**
|
|
17
17
|
* Calculates the current indent level of the selection within a task list in the ProseMirror document.
|
|
18
18
|
*
|
|
@@ -70,14 +70,14 @@ export declare function getTaskItemDataAtPos(view: EditorView): {
|
|
|
70
70
|
localId: any;
|
|
71
71
|
} | undefined;
|
|
72
72
|
export declare function getAllTaskItemsDataInRootTaskList(view: EditorView): {
|
|
73
|
+
index: number;
|
|
73
74
|
node: Node;
|
|
74
75
|
pos: number;
|
|
75
|
-
index: number;
|
|
76
76
|
}[] | undefined;
|
|
77
77
|
export declare function getCurrentTaskItemIndex(view: EditorView, allTaskItems: Array<{
|
|
78
|
+
index: number;
|
|
78
79
|
node: Node;
|
|
79
80
|
pos: number;
|
|
80
|
-
index: number;
|
|
81
81
|
}>): number;
|
|
82
82
|
export declare function getTaskItemDataToFocus(view: EditorView, direction: 'next' | 'previous'): {
|
|
83
83
|
pos: number;
|
|
@@ -89,6 +89,6 @@ export declare function removeCheckboxFocus(view: EditorView): void;
|
|
|
89
89
|
export declare function openRequestEditPopupAt(view: EditorView, pos: number): void;
|
|
90
90
|
export declare function closeRequestEditPopupAt(view: EditorView): void;
|
|
91
91
|
export declare function findFirstParentListNode($pos: ResolvedPos): {
|
|
92
|
-
pos: number;
|
|
93
92
|
node: Node;
|
|
93
|
+
pos: number;
|
|
94
94
|
} | null;
|
|
@@ -6,8 +6,8 @@ import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prose
|
|
|
6
6
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
7
7
|
import type { AddItemAttrs, AddItemTransactionCreator, GetContextIdentifier, TaskDecisionInputMethod, TaskDecisionListType } from '../types';
|
|
8
8
|
export declare const getListTypes: (listType: TaskDecisionListType, schema: Schema) => {
|
|
9
|
-
list: NodeType;
|
|
10
9
|
item: NodeType;
|
|
10
|
+
list: NodeType;
|
|
11
11
|
};
|
|
12
12
|
export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
|
|
13
13
|
export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
|
|
@@ -14,12 +14,9 @@ export type TasksAndDecisionsPluginDependencies = [
|
|
|
14
14
|
OptionalPlugin<EditorViewModePlugin>
|
|
15
15
|
];
|
|
16
16
|
export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
17
|
-
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
18
|
-
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
19
|
-
dependencies: TasksAndDecisionsPluginDependencies;
|
|
20
17
|
actions: {
|
|
21
|
-
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
22
18
|
indentTaskList: ReturnType<typeof getIndentCommand>;
|
|
19
|
+
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
23
20
|
outdentTaskList: ReturnType<typeof getUnindentCommand>;
|
|
24
21
|
setProvider: (provider: Promise<TaskDecisionProvider>) => Promise<boolean>;
|
|
25
22
|
};
|
|
@@ -27,4 +24,7 @@ export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
|
27
24
|
updateEditPermission: (hasEditPermission: boolean | undefined) => EditorCommand;
|
|
28
25
|
updateHasRequestedEditPermission: (hasRequestedEditPermission: boolean) => EditorCommand;
|
|
29
26
|
};
|
|
27
|
+
dependencies: TasksAndDecisionsPluginDependencies;
|
|
28
|
+
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
29
|
+
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
30
30
|
}>;
|
|
@@ -9,25 +9,29 @@ import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
|
9
9
|
export type TaskDecisionListType = 'taskList' | 'decisionList';
|
|
10
10
|
export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
11
11
|
export type ContextData = {
|
|
12
|
-
objectId: string;
|
|
13
12
|
containerId: string;
|
|
13
|
+
objectId: string;
|
|
14
14
|
userContext: USER_CONTEXT;
|
|
15
15
|
};
|
|
16
16
|
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']> | Partial<BlockTaskItemDefinition['attrs']>;
|
|
17
17
|
export type AddItemTransactionCreator = (opts: {
|
|
18
|
-
state: EditorState;
|
|
19
|
-
tr: Transaction;
|
|
20
|
-
list: NodeType;
|
|
21
18
|
item: NodeType;
|
|
22
|
-
listLocalId: string;
|
|
23
|
-
itemLocalId: string;
|
|
24
19
|
itemAttrs?: AddItemAttrs;
|
|
20
|
+
itemLocalId: string;
|
|
21
|
+
list: NodeType;
|
|
22
|
+
listLocalId: string;
|
|
23
|
+
state: EditorState;
|
|
24
|
+
tr: Transaction;
|
|
25
25
|
}) => Transaction | null;
|
|
26
26
|
/**
|
|
27
27
|
* Interface representing the options for the TaskDecisionPlugin.
|
|
28
28
|
* Extends the LongPressSelectionPluginOptions interface.
|
|
29
29
|
*/
|
|
30
30
|
export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPluginOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
33
|
+
*/
|
|
34
|
+
allowBlockTaskItem?: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* Indicates whether nested tasks are allowed.
|
|
33
37
|
* @default false
|
|
@@ -64,10 +68,6 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
64
68
|
* Placeholder text to display when creating a task.
|
|
65
69
|
*/
|
|
66
70
|
taskPlaceholder?: string;
|
|
67
|
-
/**
|
|
68
|
-
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
69
|
-
*/
|
|
70
|
-
allowBlockTaskItem?: boolean;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* @private
|
|
@@ -76,24 +76,24 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
76
76
|
*/
|
|
77
77
|
export type TaskDecisionPluginOptions = TasksAndDecisionsPluginOptions;
|
|
78
78
|
export type TaskDecisionPluginState = {
|
|
79
|
-
|
|
79
|
+
decorations: DecorationSet;
|
|
80
80
|
focusedTaskItemLocalId: string | null;
|
|
81
81
|
hasEditPermission?: boolean;
|
|
82
82
|
hasRequestedEditPermission?: boolean;
|
|
83
|
+
insideTaskDecisionItem: boolean;
|
|
84
|
+
openRequestToEditPopupAt?: number | null;
|
|
83
85
|
requestToEditContent?: () => void;
|
|
84
86
|
taskDecisionProvider: TaskDecisionProvider | undefined;
|
|
85
|
-
openRequestToEditPopupAt?: number | null;
|
|
86
|
-
decorations: DecorationSet;
|
|
87
87
|
};
|
|
88
88
|
export type TaskAndDecisionsSharedState = Pick<TaskDecisionPluginState, 'focusedTaskItemLocalId' | 'hasEditPermission' | 'requestToEditContent' | 'taskDecisionProvider' | 'hasRequestedEditPermission' | 'openRequestToEditPopupAt'> & {
|
|
89
|
-
isInsideTask: boolean;
|
|
90
89
|
indentDisabled: boolean;
|
|
90
|
+
isInsideTask: boolean;
|
|
91
91
|
outdentDisabled: boolean;
|
|
92
92
|
};
|
|
93
93
|
export type GetContextIdentifier = () => ContextIdentifierProvider | undefined;
|
|
94
94
|
export type TaskItemState = 'DONE' | 'TODO';
|
|
95
95
|
export type TaskItemInfoMeta = {
|
|
96
|
+
checkState: TaskItemState;
|
|
96
97
|
from: number;
|
|
97
98
|
to: number;
|
|
98
|
-
checkState: TaskItemState;
|
|
99
99
|
};
|
|
@@ -8,14 +8,14 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
8
8
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
10
10
|
interface Props {
|
|
11
|
-
|
|
12
|
-
mountTo?: HTMLElement;
|
|
11
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
13
12
|
boundariesElement?: HTMLElement;
|
|
14
|
-
scrollableElement?: HTMLElement;
|
|
15
13
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
16
14
|
editorView: EditorView;
|
|
17
|
-
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
mountTo?: HTMLElement;
|
|
18
17
|
onClose: () => void;
|
|
18
|
+
scrollableElement?: HTMLElement;
|
|
19
19
|
}
|
|
20
20
|
export declare const RequestToEditPopup: ({ element, api, editorView, onClose, mountTo, boundariesElement, scrollableElement, }: Props) => JSX.Element | null;
|
|
21
21
|
export {};
|
|
@@ -7,20 +7,20 @@ import type { ContentRef } from '@atlaskit/task-decision';
|
|
|
7
7
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
8
8
|
import { type TaskAndDecisionsSharedState } from '../../types';
|
|
9
9
|
export interface TaskProps {
|
|
10
|
-
|
|
10
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
|
+
children?: ReactElement<any>;
|
|
12
|
+
contentRef?: ContentRef;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
disableOnChange?: boolean;
|
|
15
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
11
16
|
isDone: boolean;
|
|
12
17
|
isFocused?: boolean;
|
|
13
|
-
contentRef?: ContentRef;
|
|
14
18
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
15
19
|
onClick?: () => void;
|
|
16
20
|
placeholder?: string;
|
|
17
|
-
showPlaceholder?: boolean;
|
|
18
|
-
children?: ReactElement<any>;
|
|
19
21
|
providers?: ProviderFactory;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
23
|
-
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
22
|
+
showPlaceholder?: boolean;
|
|
23
|
+
taskId: string;
|
|
24
24
|
}
|
|
25
25
|
type TaskItemProps = TaskProps & WrappedComponentProps & {
|
|
26
26
|
taskDecisionProvider: TaskAndDecisionsSharedState['taskDecisionProvider'] | undefined;
|
|
@@ -3,17 +3,17 @@ import React, { Component } from 'react';
|
|
|
3
3
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ContentRef, TaskDecisionProvider } from '@atlaskit/task-decision';
|
|
5
5
|
export interface Props {
|
|
6
|
-
|
|
6
|
+
children?: ReactElement<any>;
|
|
7
|
+
contentRef?: ContentRef;
|
|
8
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
9
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
7
10
|
isDone: boolean;
|
|
8
11
|
isFocused?: boolean;
|
|
9
|
-
contentRef?: ContentRef;
|
|
10
12
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
11
|
-
showPlaceholder?: boolean;
|
|
12
13
|
placeholder?: string;
|
|
13
|
-
|
|
14
|
+
showPlaceholder?: boolean;
|
|
14
15
|
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
15
|
-
|
|
16
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
16
|
+
taskId: string;
|
|
17
17
|
}
|
|
18
18
|
export interface State {
|
|
19
19
|
resolvedContextProvider?: ContextIdentifierProvider;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
|
@@ -44,7 +44,7 @@ export declare class DecisionItemNodeView implements NodeView {
|
|
|
44
44
|
* const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
|
|
45
45
|
*/
|
|
46
46
|
ignoreMutation(mutation: MutationRecord | {
|
|
47
|
-
type: 'selection';
|
|
48
47
|
target: Node;
|
|
48
|
+
type: 'selection';
|
|
49
49
|
}): boolean;
|
|
50
50
|
}
|
|
@@ -6,8 +6,8 @@ import type { NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
6
6
|
import type { TasksAndDecisionsPlugin } from '../tasksAndDecisionsPluginType';
|
|
7
7
|
interface TaskItemNodeViewOptions {
|
|
8
8
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
9
|
-
placeholder?: string;
|
|
10
9
|
intl: IntlShape;
|
|
10
|
+
placeholder?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare class TaskItemNodeView implements NodeView {
|
|
13
13
|
dom: Node;
|
|
@@ -31,8 +31,8 @@ export declare class TaskItemNodeView implements NodeView {
|
|
|
31
31
|
private updatePlaceholder;
|
|
32
32
|
update(node: PMNode): boolean;
|
|
33
33
|
ignoreMutation(mutation: MutationRecord | {
|
|
34
|
-
type: 'selection';
|
|
35
34
|
target: Node;
|
|
35
|
+
type: 'selection';
|
|
36
36
|
}): boolean;
|
|
37
37
|
destroy(): void;
|
|
38
38
|
}
|
|
@@ -2,8 +2,8 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
4
4
|
type Props2 = {
|
|
5
|
-
editorView: EditorView;
|
|
6
5
|
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
6
|
+
editorView: EditorView;
|
|
7
7
|
getPos: () => number | undefined;
|
|
8
8
|
isContentNodeEmpty: boolean;
|
|
9
9
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { NodeRange, type Node, type NodeType, type ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { TaskItemData } from './types';
|
|
@@ -12,7 +12,7 @@ export declare const isTable: (node?: Node | null) => boolean;
|
|
|
12
12
|
* Creates a NodeRange around the given taskItem and the following
|
|
13
13
|
* ("nested") taskList, if one exists.
|
|
14
14
|
*/
|
|
15
|
-
export declare const getBlockRange: ($from: ResolvedPos, $to: ResolvedPos) =>
|
|
15
|
+
export declare const getBlockRange: ($from: ResolvedPos, $to: ResolvedPos) => NodeRange | null;
|
|
16
16
|
/**
|
|
17
17
|
* Calculates the current indent level of the selection within a task list in the ProseMirror document.
|
|
18
18
|
*
|
|
@@ -70,14 +70,14 @@ export declare function getTaskItemDataAtPos(view: EditorView): {
|
|
|
70
70
|
localId: any;
|
|
71
71
|
} | undefined;
|
|
72
72
|
export declare function getAllTaskItemsDataInRootTaskList(view: EditorView): {
|
|
73
|
+
index: number;
|
|
73
74
|
node: Node;
|
|
74
75
|
pos: number;
|
|
75
|
-
index: number;
|
|
76
76
|
}[] | undefined;
|
|
77
77
|
export declare function getCurrentTaskItemIndex(view: EditorView, allTaskItems: Array<{
|
|
78
|
+
index: number;
|
|
78
79
|
node: Node;
|
|
79
80
|
pos: number;
|
|
80
|
-
index: number;
|
|
81
81
|
}>): number;
|
|
82
82
|
export declare function getTaskItemDataToFocus(view: EditorView, direction: 'next' | 'previous'): {
|
|
83
83
|
pos: number;
|
|
@@ -89,6 +89,6 @@ export declare function removeCheckboxFocus(view: EditorView): void;
|
|
|
89
89
|
export declare function openRequestEditPopupAt(view: EditorView, pos: number): void;
|
|
90
90
|
export declare function closeRequestEditPopupAt(view: EditorView): void;
|
|
91
91
|
export declare function findFirstParentListNode($pos: ResolvedPos): {
|
|
92
|
-
pos: number;
|
|
93
92
|
node: Node;
|
|
93
|
+
pos: number;
|
|
94
94
|
} | null;
|
|
@@ -6,8 +6,8 @@ import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prose
|
|
|
6
6
|
import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
7
7
|
import type { AddItemAttrs, AddItemTransactionCreator, GetContextIdentifier, TaskDecisionInputMethod, TaskDecisionListType } from '../types';
|
|
8
8
|
export declare const getListTypes: (listType: TaskDecisionListType, schema: Schema) => {
|
|
9
|
-
list: NodeType;
|
|
10
9
|
item: NodeType;
|
|
10
|
+
list: NodeType;
|
|
11
11
|
};
|
|
12
12
|
export declare const insertTaskDecisionAction: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (state: EditorState, listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string, itemAttrs?: AddItemAttrs) => Transaction;
|
|
13
13
|
export declare const insertTaskDecisionCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, getContextIdentifierProvider: GetContextIdentifier) => (listType: TaskDecisionListType, inputMethod?: INPUT_METHOD.FORMATTING | INPUT_METHOD.QUICK_INSERT | TOOLBAR_MENU_TYPE, addItem?: AddItemTransactionCreator, listLocalId?: string, itemLocalId?: string) => Command;
|
|
@@ -14,12 +14,9 @@ export type TasksAndDecisionsPluginDependencies = [
|
|
|
14
14
|
OptionalPlugin<EditorViewModePlugin>
|
|
15
15
|
];
|
|
16
16
|
export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
17
|
-
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
18
|
-
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
19
|
-
dependencies: TasksAndDecisionsPluginDependencies;
|
|
20
17
|
actions: {
|
|
21
|
-
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
22
18
|
indentTaskList: ReturnType<typeof getIndentCommand>;
|
|
19
|
+
insertTaskDecision: ReturnType<typeof insertTaskDecisionCommand>;
|
|
23
20
|
outdentTaskList: ReturnType<typeof getUnindentCommand>;
|
|
24
21
|
setProvider: (provider: Promise<TaskDecisionProvider>) => Promise<boolean>;
|
|
25
22
|
};
|
|
@@ -27,4 +24,7 @@ export type TasksAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
|
|
|
27
24
|
updateEditPermission: (hasEditPermission: boolean | undefined) => EditorCommand;
|
|
28
25
|
updateHasRequestedEditPermission: (hasRequestedEditPermission: boolean) => EditorCommand;
|
|
29
26
|
};
|
|
27
|
+
dependencies: TasksAndDecisionsPluginDependencies;
|
|
28
|
+
pluginConfiguration: TasksAndDecisionsPluginOptions | undefined;
|
|
29
|
+
sharedState: TaskAndDecisionsSharedState | undefined;
|
|
30
30
|
}>;
|
|
@@ -9,25 +9,29 @@ import type { TaskDecisionProvider } from '@atlaskit/task-decision/types';
|
|
|
9
9
|
export type TaskDecisionListType = 'taskList' | 'decisionList';
|
|
10
10
|
export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
11
11
|
export type ContextData = {
|
|
12
|
-
objectId: string;
|
|
13
12
|
containerId: string;
|
|
13
|
+
objectId: string;
|
|
14
14
|
userContext: USER_CONTEXT;
|
|
15
15
|
};
|
|
16
16
|
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']> | Partial<BlockTaskItemDefinition['attrs']>;
|
|
17
17
|
export type AddItemTransactionCreator = (opts: {
|
|
18
|
-
state: EditorState;
|
|
19
|
-
tr: Transaction;
|
|
20
|
-
list: NodeType;
|
|
21
18
|
item: NodeType;
|
|
22
|
-
listLocalId: string;
|
|
23
|
-
itemLocalId: string;
|
|
24
19
|
itemAttrs?: AddItemAttrs;
|
|
20
|
+
itemLocalId: string;
|
|
21
|
+
list: NodeType;
|
|
22
|
+
listLocalId: string;
|
|
23
|
+
state: EditorState;
|
|
24
|
+
tr: Transaction;
|
|
25
25
|
}) => Transaction | null;
|
|
26
26
|
/**
|
|
27
27
|
* Interface representing the options for the TaskDecisionPlugin.
|
|
28
28
|
* Extends the LongPressSelectionPluginOptions interface.
|
|
29
29
|
*/
|
|
30
30
|
export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPluginOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
33
|
+
*/
|
|
34
|
+
allowBlockTaskItem?: boolean;
|
|
31
35
|
/**
|
|
32
36
|
* Indicates whether nested tasks are allowed.
|
|
33
37
|
* @default false
|
|
@@ -64,10 +68,6 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
64
68
|
* Placeholder text to display when creating a task.
|
|
65
69
|
*/
|
|
66
70
|
taskPlaceholder?: string;
|
|
67
|
-
/**
|
|
68
|
-
* Allows the blockTaskItem node to be a child of taskList (taskItem variant that supports block children - currently only supports extension and is intended to support Confluence TinyMCE migration flows in conjunction with the Legacy Content Extension)
|
|
69
|
-
*/
|
|
70
|
-
allowBlockTaskItem?: boolean;
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* @private
|
|
@@ -76,24 +76,24 @@ export interface TasksAndDecisionsPluginOptions extends LongPressSelectionPlugin
|
|
|
76
76
|
*/
|
|
77
77
|
export type TaskDecisionPluginOptions = TasksAndDecisionsPluginOptions;
|
|
78
78
|
export type TaskDecisionPluginState = {
|
|
79
|
-
|
|
79
|
+
decorations: DecorationSet;
|
|
80
80
|
focusedTaskItemLocalId: string | null;
|
|
81
81
|
hasEditPermission?: boolean;
|
|
82
82
|
hasRequestedEditPermission?: boolean;
|
|
83
|
+
insideTaskDecisionItem: boolean;
|
|
84
|
+
openRequestToEditPopupAt?: number | null;
|
|
83
85
|
requestToEditContent?: () => void;
|
|
84
86
|
taskDecisionProvider: TaskDecisionProvider | undefined;
|
|
85
|
-
openRequestToEditPopupAt?: number | null;
|
|
86
|
-
decorations: DecorationSet;
|
|
87
87
|
};
|
|
88
88
|
export type TaskAndDecisionsSharedState = Pick<TaskDecisionPluginState, 'focusedTaskItemLocalId' | 'hasEditPermission' | 'requestToEditContent' | 'taskDecisionProvider' | 'hasRequestedEditPermission' | 'openRequestToEditPopupAt'> & {
|
|
89
|
-
isInsideTask: boolean;
|
|
90
89
|
indentDisabled: boolean;
|
|
90
|
+
isInsideTask: boolean;
|
|
91
91
|
outdentDisabled: boolean;
|
|
92
92
|
};
|
|
93
93
|
export type GetContextIdentifier = () => ContextIdentifierProvider | undefined;
|
|
94
94
|
export type TaskItemState = 'DONE' | 'TODO';
|
|
95
95
|
export type TaskItemInfoMeta = {
|
|
96
|
+
checkState: TaskItemState;
|
|
96
97
|
from: number;
|
|
97
98
|
to: number;
|
|
98
|
-
checkState: TaskItemState;
|
|
99
99
|
};
|
|
@@ -8,14 +8,14 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
8
8
|
import { type EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
9
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
10
10
|
interface Props {
|
|
11
|
-
|
|
12
|
-
mountTo?: HTMLElement;
|
|
11
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
13
12
|
boundariesElement?: HTMLElement;
|
|
14
|
-
scrollableElement?: HTMLElement;
|
|
15
13
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
16
14
|
editorView: EditorView;
|
|
17
|
-
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
mountTo?: HTMLElement;
|
|
18
17
|
onClose: () => void;
|
|
18
|
+
scrollableElement?: HTMLElement;
|
|
19
19
|
}
|
|
20
20
|
export declare const RequestToEditPopup: ({ element, api, editorView, onClose, mountTo, boundariesElement, scrollableElement, }: Props) => JSX.Element | null;
|
|
21
21
|
export {};
|
|
@@ -7,20 +7,20 @@ import type { ContentRef } from '@atlaskit/task-decision';
|
|
|
7
7
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
8
8
|
import { type TaskAndDecisionsSharedState } from '../../types';
|
|
9
9
|
export interface TaskProps {
|
|
10
|
-
|
|
10
|
+
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
|
+
children?: ReactElement<any>;
|
|
12
|
+
contentRef?: ContentRef;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
disableOnChange?: boolean;
|
|
15
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
11
16
|
isDone: boolean;
|
|
12
17
|
isFocused?: boolean;
|
|
13
|
-
contentRef?: ContentRef;
|
|
14
18
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
15
19
|
onClick?: () => void;
|
|
16
20
|
placeholder?: string;
|
|
17
|
-
showPlaceholder?: boolean;
|
|
18
|
-
children?: ReactElement<any>;
|
|
19
21
|
providers?: ProviderFactory;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
inputRef?: Ref<HTMLInputElement>;
|
|
23
|
-
api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
22
|
+
showPlaceholder?: boolean;
|
|
23
|
+
taskId: string;
|
|
24
24
|
}
|
|
25
25
|
type TaskItemProps = TaskProps & WrappedComponentProps & {
|
|
26
26
|
taskDecisionProvider: TaskAndDecisionsSharedState['taskDecisionProvider'] | undefined;
|
|
@@ -3,17 +3,17 @@ import React, { Component } from 'react';
|
|
|
3
3
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ContentRef, TaskDecisionProvider } from '@atlaskit/task-decision';
|
|
5
5
|
export interface Props {
|
|
6
|
-
|
|
6
|
+
children?: ReactElement<any>;
|
|
7
|
+
contentRef?: ContentRef;
|
|
8
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
9
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
7
10
|
isDone: boolean;
|
|
8
11
|
isFocused?: boolean;
|
|
9
|
-
contentRef?: ContentRef;
|
|
10
12
|
onChange?: (taskId: string, isChecked: boolean) => void;
|
|
11
|
-
showPlaceholder?: boolean;
|
|
12
13
|
placeholder?: string;
|
|
13
|
-
|
|
14
|
+
showPlaceholder?: boolean;
|
|
14
15
|
taskDecisionProvider?: Promise<TaskDecisionProvider>;
|
|
15
|
-
|
|
16
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
16
|
+
taskId: string;
|
|
17
17
|
}
|
|
18
18
|
export interface State {
|
|
19
19
|
resolvedContextProvider?: ContextIdentifierProvider;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
|
@@ -4,10 +4,10 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { TasksAndDecisionsPlugin } from '../../tasksAndDecisionsPluginType';
|
|
6
6
|
export interface Props {
|
|
7
|
+
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
7
8
|
editorView?: EditorView;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
isReducedSpacing?: boolean;
|
|
10
|
-
editorAPI: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface State {
|
|
13
13
|
disabled: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.5",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^50.2.
|
|
35
|
+
"@atlaskit/adf-schema": "^50.2.2",
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
38
38
|
"@atlaskit/css": "^0.12.0",
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
"@atlaskit/primitives": "^14.11.0",
|
|
50
50
|
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
51
51
|
"@atlaskit/task-decision": "^19.2.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^11.6.0",
|
|
53
53
|
"@atlaskit/tokens": "^6.0.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@compiled/react": "^0.18.3",
|
|
56
56
|
"bind-event-listener": "^3.0.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@atlaskit/editor-common": "^107.
|
|
59
|
+
"@atlaskit/editor-common": "^107.30.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
62
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"@af/visual-regression": "workspace:^",
|
|
67
67
|
"@atlaskit/ssr": "workspace:^",
|
|
68
68
|
"@atlaskit/util-data-test": "^18.1.0",
|
|
69
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
70
69
|
"@testing-library/react": "^13.4.0",
|
|
71
70
|
"wait-for-expect": "^1.2.0"
|
|
72
71
|
},
|