@atlaskit/editor-plugin-tasks-and-decisions 6.1.2 → 6.2.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 +23 -0
- package/dist/cjs/nodeviews/taskItemNodeSpec.js +27 -5
- package/dist/cjs/pm-plugins/main.js +5 -2
- package/dist/cjs/tasksAndDecisionsPlugin.js +6 -1
- package/dist/es2019/nodeviews/taskItemNodeSpec.js +26 -3
- package/dist/es2019/pm-plugins/main.js +5 -1
- package/dist/es2019/tasksAndDecisionsPlugin.js +6 -2
- package/dist/esm/nodeviews/taskItemNodeSpec.js +27 -5
- package/dist/esm/pm-plugins/main.js +5 -2
- package/dist/esm/tasksAndDecisionsPlugin.js +7 -2
- package/dist/types/nodeviews/taskItemNodeSpec.d.ts +8 -0
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/taskItemNodeSpec.d.ts +8 -0
- package/dist/types-ts4.5/types/index.d.ts +2 -2
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 6.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`13a1ad07bb39e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/13a1ad07bb39e) -
|
|
8
|
+
[ux] EDITOR-1146 | EDITOR-1176 Introduce `blockTaskItem` node to Renderer and Editor
|
|
9
|
+
`editor-plugin-tasks-and-decisions` which adopts the same code and functionality as the regular
|
|
10
|
+
`taskItem` except that it allows block content such as extensions to be inserted. This is to
|
|
11
|
+
facilitate TinyMCE migration which requires usage of the Legacy Content Extension.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
17
|
+
## 6.1.3
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#195649](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195649)
|
|
22
|
+
[`231bb33e06dfe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/231bb33e06dfe) -
|
|
23
|
+
EDITOR-1131 Bump adf-schema version to 50.2.0
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 6.1.2
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.taskItemNodeSpec = exports.lazyTaskItemToDom = void 0;
|
|
7
|
+
exports.taskItemNodeSpec = exports.lazyTaskItemToDom = exports.blockTaskItemNodeSpec = void 0;
|
|
8
8
|
exports.taskItemToDom = taskItemToDom;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
@@ -31,6 +31,24 @@ var taskItemNodeSpec = exports.taskItemNodeSpec = function taskItemNodeSpec() {
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
37
|
+
* with fallback UI for lazy node view rendering / window virtualization
|
|
38
|
+
* @nodeSpecException:toDOM patch
|
|
39
|
+
* @returns
|
|
40
|
+
* @example
|
|
41
|
+
*/
|
|
42
|
+
var blockTaskItemNodeSpec = exports.blockTaskItemNodeSpec = function blockTaskItemNodeSpec() {
|
|
43
|
+
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
44
|
+
return _adfSchema.blockTaskItemStage0;
|
|
45
|
+
}
|
|
46
|
+
return _objectSpread(_objectSpread({}, _adfSchema.blockTaskItemStage0), {}, {
|
|
47
|
+
toDOM: function toDOM(node) {
|
|
48
|
+
return lazyTaskItemToDom(node);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
34
52
|
var getCheckBoxId = function getCheckBoxId(localId) {
|
|
35
53
|
return "task-checkbox-".concat(localId);
|
|
36
54
|
};
|
|
@@ -56,11 +74,13 @@ function taskItemToDom(node, placeholder, intl) {
|
|
|
56
74
|
if (checked) {
|
|
57
75
|
inputAttrs.checked = 'true';
|
|
58
76
|
}
|
|
59
|
-
var dataAttrs = {
|
|
77
|
+
var dataAttrs = _objectSpread({
|
|
60
78
|
'data-task-local-id': node.attrs.localId,
|
|
61
79
|
'data-task-state': node.attrs.state,
|
|
62
80
|
'data-prosemirror-node-name': 'taskItem'
|
|
63
|
-
}
|
|
81
|
+
}, node.type.name === 'blockTaskItem' ? {
|
|
82
|
+
'data-task-is-block': 'true'
|
|
83
|
+
} : {});
|
|
64
84
|
var contentDomDataAttrs = node.content.childCount > 0 ? {} : {
|
|
65
85
|
'data-empty': 'true'
|
|
66
86
|
};
|
|
@@ -131,10 +151,12 @@ var lazyTaskItemToDom = exports.lazyTaskItemToDom = function lazyTaskItemToDom(n
|
|
|
131
151
|
if (checked) {
|
|
132
152
|
inputAttrs.checked = 'true';
|
|
133
153
|
}
|
|
134
|
-
var dataAttrs = {
|
|
154
|
+
var dataAttrs = _objectSpread({
|
|
135
155
|
'data-task-local-id': node.attrs.localId,
|
|
136
156
|
'data-task-state': node.attrs.state
|
|
137
|
-
}
|
|
157
|
+
}, node.type.name === 'blockTaskItem' ? {
|
|
158
|
+
'data-task-is-block': 'true'
|
|
159
|
+
} : {});
|
|
138
160
|
return ['div', _objectSpread(_objectSpread({
|
|
139
161
|
class: _styles.TaskDecisionSharedCssClassName.TASK_CONTAINER
|
|
140
162
|
}, dataAttrs), {}, {
|
|
@@ -14,6 +14,7 @@ var _selection = require("@atlaskit/editor-common/selection");
|
|
|
14
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
16
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
17
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
18
|
var _DecisionItemNodeView = require("../nodeviews/DecisionItemNodeView");
|
|
18
19
|
var _taskNodeView = require("../nodeviews/task-node-view");
|
|
19
20
|
var _actions = require("./actions");
|
|
@@ -41,12 +42,14 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
41
42
|
var taskPlaceholder = arguments.length > 9 ? arguments[9] : undefined;
|
|
42
43
|
return new _safePlugin.SafePlugin({
|
|
43
44
|
props: {
|
|
44
|
-
nodeViews: {
|
|
45
|
+
nodeViews: _objectSpread({
|
|
45
46
|
taskItem: (0, _taskNodeView.taskView)(api, getIntl(), taskPlaceholder),
|
|
46
47
|
decisionItem: function (node) {
|
|
47
48
|
return new _DecisionItemNodeView.DecisionItemNodeView(node, getIntl());
|
|
48
49
|
}
|
|
49
|
-
},
|
|
50
|
+
}, (0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node', 'isEnabled', true) ? {
|
|
51
|
+
blockTaskItem: (0, _taskNodeView.taskView)(api, getIntl(), taskPlaceholder)
|
|
52
|
+
} : {}),
|
|
50
53
|
decorations: function decorations(state) {
|
|
51
54
|
var pluginState = _pluginKey.stateKey.getState(state);
|
|
52
55
|
if (pluginState !== null && pluginState !== void 0 && pluginState.decorations) {
|
|
@@ -12,6 +12,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
16
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
16
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
17
18
|
var _indentation = require("@atlaskit/editor-common/indentation");
|
|
@@ -19,6 +20,7 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
19
20
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
20
21
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
21
22
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
23
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
24
|
var _taskItemNodeSpec = require("./nodeviews/taskItemNodeSpec");
|
|
23
25
|
var _decisionItem = require("./nodeviews/toDOM-fixes/decisionItem");
|
|
24
26
|
var _helpers = require("./pm-plugins/helpers");
|
|
@@ -122,7 +124,10 @@ var tasksAndDecisionsPlugin = exports.tasksAndDecisionsPlugin = function tasksAn
|
|
|
122
124
|
}, {
|
|
123
125
|
name: 'taskItem',
|
|
124
126
|
node: (0, _taskItemNodeSpec.taskItemNodeSpec)()
|
|
125
|
-
}]
|
|
127
|
+
}].concat((0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node', 'isEnabled', true) ? [{
|
|
128
|
+
name: 'blockTaskItem',
|
|
129
|
+
node: (0, _taskItemNodeSpec.blockTaskItemNodeSpec)()
|
|
130
|
+
}] : []));
|
|
126
131
|
},
|
|
127
132
|
getSharedState: function getSharedState(editorState) {
|
|
128
133
|
if (!editorState) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { taskItem } from '@atlaskit/adf-schema';
|
|
1
|
+
import { taskItem, blockTaskItemStage0 as blockTaskItem } from '@atlaskit/adf-schema';
|
|
2
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
3
|
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -19,6 +19,23 @@ export const taskItemNodeSpec = () => {
|
|
|
19
19
|
toDOM: node => lazyTaskItemToDom(node)
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
25
|
+
* with fallback UI for lazy node view rendering / window virtualization
|
|
26
|
+
* @nodeSpecException:toDOM patch
|
|
27
|
+
* @returns
|
|
28
|
+
* @example
|
|
29
|
+
*/
|
|
30
|
+
export const blockTaskItemNodeSpec = () => {
|
|
31
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
32
|
+
return blockTaskItem;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
...blockTaskItem,
|
|
36
|
+
toDOM: node => lazyTaskItemToDom(node)
|
|
37
|
+
};
|
|
38
|
+
};
|
|
22
39
|
const getCheckBoxId = localId => `task-checkbox-${localId}`;
|
|
23
40
|
|
|
24
41
|
// eslint-disable-next-line jsdoc/require-example
|
|
@@ -45,7 +62,10 @@ export function taskItemToDom(node, placeholder, intl) {
|
|
|
45
62
|
const dataAttrs = {
|
|
46
63
|
'data-task-local-id': node.attrs.localId,
|
|
47
64
|
'data-task-state': node.attrs.state,
|
|
48
|
-
'data-prosemirror-node-name': 'taskItem'
|
|
65
|
+
'data-prosemirror-node-name': 'taskItem',
|
|
66
|
+
...(node.type.name === 'blockTaskItem' ? {
|
|
67
|
+
'data-task-is-block': 'true'
|
|
68
|
+
} : {})
|
|
49
69
|
};
|
|
50
70
|
const contentDomDataAttrs = node.content.childCount > 0 ? {} : {
|
|
51
71
|
'data-empty': 'true'
|
|
@@ -121,7 +141,10 @@ export const lazyTaskItemToDom = node => {
|
|
|
121
141
|
}
|
|
122
142
|
const dataAttrs = {
|
|
123
143
|
'data-task-local-id': node.attrs.localId,
|
|
124
|
-
'data-task-state': node.attrs.state
|
|
144
|
+
'data-task-state': node.attrs.state,
|
|
145
|
+
...(node.type.name === 'blockTaskItem' ? {
|
|
146
|
+
'data-task-is-block': 'true'
|
|
147
|
+
} : {})
|
|
125
148
|
};
|
|
126
149
|
return ['div', {
|
|
127
150
|
class: TaskDecisionSharedCssClassName.TASK_CONTAINER,
|
|
@@ -5,6 +5,7 @@ import { createSelectionClickHandler, GapCursorSelection } from '@atlaskit/edito
|
|
|
5
5
|
import { getStepRange } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
import { DecisionItemNodeView } from '../nodeviews/DecisionItemNodeView';
|
|
9
10
|
import { taskView } from '../nodeviews/task-node-view';
|
|
10
11
|
import { focusTaskDecision, setProvider, openRequestEditPopup } from './actions';
|
|
@@ -28,7 +29,10 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
28
29
|
taskItem: taskView(api, getIntl(), taskPlaceholder),
|
|
29
30
|
decisionItem: node => {
|
|
30
31
|
return new DecisionItemNodeView(node, getIntl());
|
|
31
|
-
}
|
|
32
|
+
},
|
|
33
|
+
...(expValEquals('platform_editor_blocktaskitem_node', 'isEnabled', true) ? {
|
|
34
|
+
blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
|
|
35
|
+
} : {})
|
|
32
36
|
},
|
|
33
37
|
decorations(state) {
|
|
34
38
|
const pluginState = stateKey.getState(state);
|
|
@@ -9,7 +9,8 @@ import { toolbarInsertBlockMessages as insertBlockMessages } from '@atlaskit/edi
|
|
|
9
9
|
import { IconAction, IconDecision } from '@atlaskit/editor-common/quick-insert';
|
|
10
10
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
11
11
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
12
|
-
import {
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
+
import { taskItemNodeSpec, blockTaskItemNodeSpec } from './nodeviews/taskItemNodeSpec';
|
|
13
14
|
import { decisionItemSpecWithFixedToDOM } from './nodeviews/toDOM-fixes/decisionItem';
|
|
14
15
|
import { closeRequestEditPopupAt, getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
|
|
15
16
|
// Ignored via go/ees005
|
|
@@ -111,7 +112,10 @@ export const tasksAndDecisionsPlugin = ({
|
|
|
111
112
|
}, {
|
|
112
113
|
name: 'taskItem',
|
|
113
114
|
node: taskItemNodeSpec()
|
|
114
|
-
}
|
|
115
|
+
}, ...(expValEquals('platform_editor_blocktaskitem_node', 'isEnabled', true) ? [{
|
|
116
|
+
name: 'blockTaskItem',
|
|
117
|
+
node: blockTaskItemNodeSpec()
|
|
118
|
+
}] : [])];
|
|
115
119
|
},
|
|
116
120
|
getSharedState(editorState) {
|
|
117
121
|
if (!editorState) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { taskItem } from '@atlaskit/adf-schema';
|
|
4
|
+
import { taskItem, blockTaskItemStage0 as blockTaskItem } from '@atlaskit/adf-schema';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
6
|
import { tasksAndDecisionsMessages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { TaskDecisionSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -23,6 +23,24 @@ export var taskItemNodeSpec = function taskItemNodeSpec() {
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
29
|
+
* with fallback UI for lazy node view rendering / window virtualization
|
|
30
|
+
* @nodeSpecException:toDOM patch
|
|
31
|
+
* @returns
|
|
32
|
+
* @example
|
|
33
|
+
*/
|
|
34
|
+
export var blockTaskItemNodeSpec = function blockTaskItemNodeSpec() {
|
|
35
|
+
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
36
|
+
return blockTaskItem;
|
|
37
|
+
}
|
|
38
|
+
return _objectSpread(_objectSpread({}, blockTaskItem), {}, {
|
|
39
|
+
toDOM: function toDOM(node) {
|
|
40
|
+
return lazyTaskItemToDom(node);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
26
44
|
var getCheckBoxId = function getCheckBoxId(localId) {
|
|
27
45
|
return "task-checkbox-".concat(localId);
|
|
28
46
|
};
|
|
@@ -48,11 +66,13 @@ export function taskItemToDom(node, placeholder, intl) {
|
|
|
48
66
|
if (checked) {
|
|
49
67
|
inputAttrs.checked = 'true';
|
|
50
68
|
}
|
|
51
|
-
var dataAttrs = {
|
|
69
|
+
var dataAttrs = _objectSpread({
|
|
52
70
|
'data-task-local-id': node.attrs.localId,
|
|
53
71
|
'data-task-state': node.attrs.state,
|
|
54
72
|
'data-prosemirror-node-name': 'taskItem'
|
|
55
|
-
}
|
|
73
|
+
}, node.type.name === 'blockTaskItem' ? {
|
|
74
|
+
'data-task-is-block': 'true'
|
|
75
|
+
} : {});
|
|
56
76
|
var contentDomDataAttrs = node.content.childCount > 0 ? {} : {
|
|
57
77
|
'data-empty': 'true'
|
|
58
78
|
};
|
|
@@ -123,10 +143,12 @@ export var lazyTaskItemToDom = function lazyTaskItemToDom(node) {
|
|
|
123
143
|
if (checked) {
|
|
124
144
|
inputAttrs.checked = 'true';
|
|
125
145
|
}
|
|
126
|
-
var dataAttrs = {
|
|
146
|
+
var dataAttrs = _objectSpread({
|
|
127
147
|
'data-task-local-id': node.attrs.localId,
|
|
128
148
|
'data-task-state': node.attrs.state
|
|
129
|
-
}
|
|
149
|
+
}, node.type.name === 'blockTaskItem' ? {
|
|
150
|
+
'data-task-is-block': 'true'
|
|
151
|
+
} : {});
|
|
130
152
|
return ['div', _objectSpread(_objectSpread({
|
|
131
153
|
class: TaskDecisionSharedCssClassName.TASK_CONTAINER
|
|
132
154
|
}, dataAttrs), {}, {
|
|
@@ -10,6 +10,7 @@ import { createSelectionClickHandler, GapCursorSelection } from '@atlaskit/edito
|
|
|
10
10
|
import { getStepRange } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
12
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
import { DecisionItemNodeView } from '../nodeviews/DecisionItemNodeView';
|
|
14
15
|
import { taskView } from '../nodeviews/task-node-view';
|
|
15
16
|
import { focusTaskDecision, setProvider, openRequestEditPopup } from './actions';
|
|
@@ -34,12 +35,14 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
34
35
|
var taskPlaceholder = arguments.length > 9 ? arguments[9] : undefined;
|
|
35
36
|
return new SafePlugin({
|
|
36
37
|
props: {
|
|
37
|
-
nodeViews: {
|
|
38
|
+
nodeViews: _objectSpread({
|
|
38
39
|
taskItem: taskView(api, getIntl(), taskPlaceholder),
|
|
39
40
|
decisionItem: function (node) {
|
|
40
41
|
return new DecisionItemNodeView(node, getIntl());
|
|
41
42
|
}
|
|
42
|
-
},
|
|
43
|
+
}, expValEquals('platform_editor_blocktaskitem_node', 'isEnabled', true) ? {
|
|
44
|
+
blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
|
|
45
|
+
} : {}),
|
|
43
46
|
decorations: function decorations(state) {
|
|
44
47
|
var pluginState = stateKey.getState(state);
|
|
45
48
|
if (pluginState !== null && pluginState !== void 0 && pluginState.decorations) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* tasksAndDecisionsPlugin.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
4
|
import "./tasksAndDecisionsPlugin.compiled.css";
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -11,7 +12,8 @@ import { toolbarInsertBlockMessages as insertBlockMessages } from '@atlaskit/edi
|
|
|
11
12
|
import { IconAction, IconDecision } from '@atlaskit/editor-common/quick-insert';
|
|
12
13
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
13
14
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
14
|
-
import {
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
|
+
import { taskItemNodeSpec, blockTaskItemNodeSpec } from './nodeviews/taskItemNodeSpec';
|
|
15
17
|
import { decisionItemSpecWithFixedToDOM } from './nodeviews/toDOM-fixes/decisionItem';
|
|
16
18
|
import { closeRequestEditPopupAt, getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
|
|
17
19
|
// Ignored via go/ees005
|
|
@@ -113,7 +115,10 @@ export var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref3) {
|
|
|
113
115
|
}, {
|
|
114
116
|
name: 'taskItem',
|
|
115
117
|
node: taskItemNodeSpec()
|
|
116
|
-
}]
|
|
118
|
+
}].concat(_toConsumableArray(expValEquals('platform_editor_blocktaskitem_node', 'isEnabled', true) ? [{
|
|
119
|
+
name: 'blockTaskItem',
|
|
120
|
+
node: blockTaskItemNodeSpec()
|
|
121
|
+
}] : []));
|
|
117
122
|
},
|
|
118
123
|
getSharedState: function getSharedState(editorState) {
|
|
119
124
|
if (!editorState) {
|
|
@@ -8,6 +8,14 @@ import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror
|
|
|
8
8
|
* @example
|
|
9
9
|
*/
|
|
10
10
|
export declare const taskItemNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
11
|
+
/**
|
|
12
|
+
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
13
|
+
* with fallback UI for lazy node view rendering / window virtualization
|
|
14
|
+
* @nodeSpecException:toDOM patch
|
|
15
|
+
* @returns
|
|
16
|
+
* @example
|
|
17
|
+
*/
|
|
18
|
+
export declare const blockTaskItemNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
11
19
|
/**
|
|
12
20
|
* Converts a task item node to a DOM output specification.
|
|
13
21
|
* This is used for rendering the task item in the editor.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DecisionItemDefinition, TaskItemDefinition } from '@atlaskit/adf-schema';
|
|
1
|
+
import type { BlockTaskItemDefinition, DecisionItemDefinition, TaskItemDefinition } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { INPUT_METHOD, USER_CONTEXT } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
@@ -13,7 +13,7 @@ export type ContextData = {
|
|
|
13
13
|
containerId: string;
|
|
14
14
|
userContext: USER_CONTEXT;
|
|
15
15
|
};
|
|
16
|
-
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']>;
|
|
16
|
+
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']> | Partial<BlockTaskItemDefinition['attrs']>;
|
|
17
17
|
export type AddItemTransactionCreator = (opts: {
|
|
18
18
|
state: EditorState;
|
|
19
19
|
tr: Transaction;
|
|
@@ -8,6 +8,14 @@ import type { DOMOutputSpec, Node as PMNode } from '@atlaskit/editor-prosemirror
|
|
|
8
8
|
* @example
|
|
9
9
|
*/
|
|
10
10
|
export declare const taskItemNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
11
|
+
/**
|
|
12
|
+
* Wrapper for ADF blockTaskItem node spec to augment toDOM implementation
|
|
13
|
+
* with fallback UI for lazy node view rendering / window virtualization
|
|
14
|
+
* @nodeSpecException:toDOM patch
|
|
15
|
+
* @returns
|
|
16
|
+
* @example
|
|
17
|
+
*/
|
|
18
|
+
export declare const blockTaskItemNodeSpec: () => import("prosemirror-model").NodeSpec;
|
|
11
19
|
/**
|
|
12
20
|
* Converts a task item node to a DOM output specification.
|
|
13
21
|
* This is used for rendering the task item in the editor.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DecisionItemDefinition, TaskItemDefinition } from '@atlaskit/adf-schema';
|
|
1
|
+
import type { BlockTaskItemDefinition, DecisionItemDefinition, TaskItemDefinition } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { INPUT_METHOD, USER_CONTEXT } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
@@ -13,7 +13,7 @@ export type ContextData = {
|
|
|
13
13
|
containerId: string;
|
|
14
14
|
userContext: USER_CONTEXT;
|
|
15
15
|
};
|
|
16
|
-
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']>;
|
|
16
|
+
export type AddItemAttrs = Partial<DecisionItemDefinition['attrs']> | Partial<TaskItemDefinition['attrs']> | Partial<BlockTaskItemDefinition['attrs']>;
|
|
17
17
|
export type AddItemTransactionCreator = (opts: {
|
|
18
18
|
state: EditorState;
|
|
19
19
|
tr: Transaction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
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.0
|
|
35
|
+
"@atlaskit/adf-schema": "^50.2.0",
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
38
38
|
"@atlaskit/css": "^0.12.0",
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-type-ahead": "^3.1.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
44
|
+
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
45
45
|
"@atlaskit/heading": "^5.2.0",
|
|
46
|
-
"@atlaskit/icon": "^27.
|
|
46
|
+
"@atlaskit/icon": "^27.10.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/popup": "^4.3.0",
|
|
49
49
|
"@atlaskit/primitives": "^14.11.0",
|
|
50
|
-
"@atlaskit/prosemirror-input-rules": "^3.
|
|
50
|
+
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
51
51
|
"@atlaskit/task-decision": "^19.2.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^9.26.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.20.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"
|
|
@@ -68,7 +68,6 @@
|
|
|
68
68
|
"@atlaskit/util-data-test": "^18.0.0",
|
|
69
69
|
"@atlaskit/visual-regression": "workspace:^",
|
|
70
70
|
"@testing-library/react": "^13.4.0",
|
|
71
|
-
"typescript": "~5.4.2",
|
|
72
71
|
"wait-for-expect": "^1.2.0"
|
|
73
72
|
},
|
|
74
73
|
"techstack": {
|