@atlaskit/editor-plugin-tasks-and-decisions 2.2.0 → 2.3.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 +24 -0
- package/dist/cjs/nodeviews/task-lazy-node-view.js +34 -0
- package/dist/cjs/plugin.js +28 -6
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/es2019/nodeviews/task-lazy-node-view.js +23 -0
- package/dist/es2019/plugin.js +24 -1
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/esm/nodeviews/task-lazy-node-view.js +22 -0
- package/dist/esm/plugin.js +26 -1
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/types/nodeviews/task-lazy-node-view.d.ts +6 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/task-lazy-node-view.d.ts +6 -0
- package/dist/types-ts4.5/plugin.d.ts +1 -0
- package/package.json +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 2.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)
|
|
8
|
+
[`5a96af255a094`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5a96af255a094) -
|
|
9
|
+
Enabling lazy node view loading behind a feature flag for tasks for performance.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 2.3.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#124190](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124190)
|
|
17
|
+
[`9ab9c4ca2b9df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9ab9c4ca2b9df) -
|
|
18
|
+
Clean-up platform.editor.refactor-highlight-toolbar_mo0pj feature flag
|
|
19
|
+
- [#124209](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124209)
|
|
20
|
+
[`8aa1792f12ed3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8aa1792f12ed3) -
|
|
21
|
+
bump @atlaskit/editor-prosemirror to 5.0.0, bump @atlaskit/adf-schema to 40.1.0
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 2.2.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.lazyTaskView = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
|
+
var _taskItem = require("./taskItem");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
var lazyTaskView = exports.lazyTaskView = function lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api) {
|
|
15
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_lazy-node-views')) {
|
|
16
|
+
return (0, _taskItem.taskItemNodeViewFactory)(portalProviderAPI, eventDispatcher, providerFactory, api);
|
|
17
|
+
}
|
|
18
|
+
return (0, _lazyNodeView.withLazyLoading)({
|
|
19
|
+
nodeName: 'taskItem',
|
|
20
|
+
getNodeViewOptions: function getNodeViewOptions() {},
|
|
21
|
+
loader: function loader() {
|
|
22
|
+
var result = Promise.resolve().then(function () {
|
|
23
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-plugin-tasks-and-decisions_task-item-nodeview" */
|
|
24
|
+
'./taskItem'));
|
|
25
|
+
}).then(function (_ref) {
|
|
26
|
+
var taskItemNodeViewFactory = _ref.taskItemNodeViewFactory;
|
|
27
|
+
return function (node, view, getPos) {
|
|
28
|
+
return taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api)(node, view, getPos);
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -5,13 +5,15 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.tasksAndDecisionsPlugin = void 0;
|
|
8
|
+
exports.tasksAndDecisionsPlugin = exports.taskItemSpecWithFixedToDOM = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _react = require("@emotion/react");
|
|
10
11
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
13
|
var _indentation = require("@atlaskit/editor-common/indentation");
|
|
13
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
15
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
17
|
var _commands = require("./commands");
|
|
16
18
|
var _helpers = require("./pm-plugins/helpers");
|
|
17
19
|
var _inputRules = _interopRequireDefault(require("./pm-plugins/input-rules"));
|
|
@@ -22,15 +24,35 @@ var _ToolbarDecision = _interopRequireDefault(require("./ui/ToolbarDecision"));
|
|
|
22
24
|
var _ToolbarTask = _interopRequireDefault(require("./ui/ToolbarTask"));
|
|
23
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
26
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
|
-
|
|
27
|
+
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; }
|
|
28
|
+
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) { (0, _defineProperty2.default)(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; } /**
|
|
26
29
|
* @jsxRuntime classic
|
|
27
30
|
* @jsx jsx
|
|
28
|
-
*/
|
|
29
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
30
|
-
|
|
31
|
+
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
31
32
|
var taskDecisionToolbarGroupStyles = (0, _react.css)({
|
|
32
33
|
display: 'flex'
|
|
33
34
|
});
|
|
35
|
+
// @nodeSpecException:toDOM patch
|
|
36
|
+
var taskItemSpecWithFixedToDOM = exports.taskItemSpecWithFixedToDOM = function taskItemSpecWithFixedToDOM() {
|
|
37
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_lazy-node-views')) {
|
|
38
|
+
return _adfSchema.taskItem;
|
|
39
|
+
}
|
|
40
|
+
return _objectSpread(_objectSpread({}, _adfSchema.taskItem), {}, {
|
|
41
|
+
toDOM: function toDOM(node) {
|
|
42
|
+
var checked = node.attrs.state === 'DONE';
|
|
43
|
+
var inputAttrs = {
|
|
44
|
+
type: 'checkbox'
|
|
45
|
+
};
|
|
46
|
+
if (checked) {
|
|
47
|
+
inputAttrs.checked = 'true';
|
|
48
|
+
}
|
|
49
|
+
// TODO: Align styling with `@atlaskit/task-decision`
|
|
50
|
+
return ['div', {
|
|
51
|
+
style: 'display: flex;'
|
|
52
|
+
}, ['input', inputAttrs], ['div', 0]];
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
};
|
|
34
56
|
var addItem = function addItem(insert, listType, schema) {
|
|
35
57
|
return function (_ref) {
|
|
36
58
|
var listLocalId = _ref.listLocalId,
|
|
@@ -71,7 +93,7 @@ var tasksAndDecisionsPlugin = exports.tasksAndDecisionsPlugin = function tasksAn
|
|
|
71
93
|
node: _adfSchema.taskList
|
|
72
94
|
}, {
|
|
73
95
|
name: 'taskItem',
|
|
74
|
-
node:
|
|
96
|
+
node: taskItemSpecWithFixedToDOM()
|
|
75
97
|
}];
|
|
76
98
|
},
|
|
77
99
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -14,7 +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 _decisionItem = require("../nodeviews/decisionItem");
|
|
17
|
-
var
|
|
17
|
+
var _taskLazyNodeView = require("../nodeviews/task-lazy-node-view");
|
|
18
18
|
var _helpers = require("./helpers");
|
|
19
19
|
var _pluginKey = require("./plugin-key");
|
|
20
20
|
var _types = require("./types");
|
|
@@ -33,7 +33,7 @@ function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispa
|
|
|
33
33
|
return new _safePlugin.SafePlugin({
|
|
34
34
|
props: {
|
|
35
35
|
nodeViews: {
|
|
36
|
-
taskItem: (0,
|
|
36
|
+
taskItem: (0, _taskLazyNodeView.lazyTaskView)(portalProviderAPI, eventDispatcher, providerFactory, api),
|
|
37
37
|
decisionItem: (0, _decisionItem.decisionItemNodeView)(portalProviderAPI, eventDispatcher, api)
|
|
38
38
|
},
|
|
39
39
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { taskItemNodeViewFactory } from './taskItem';
|
|
4
|
+
export const lazyTaskView = (portalProviderAPI, eventDispatcher, providerFactory, api) => {
|
|
5
|
+
if (!fg('platform_editor_lazy-node-views')) {
|
|
6
|
+
return taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api);
|
|
7
|
+
}
|
|
8
|
+
return withLazyLoading({
|
|
9
|
+
nodeName: 'taskItem',
|
|
10
|
+
getNodeViewOptions: () => {},
|
|
11
|
+
loader: () => {
|
|
12
|
+
const result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-tasks-and-decisions_task-item-nodeview" */
|
|
13
|
+
'./taskItem').then(({
|
|
14
|
+
taskItemNodeViewFactory
|
|
15
|
+
}) => {
|
|
16
|
+
return (node, view, getPos) => {
|
|
17
|
+
return taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api)(node, view, getPos);
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -9,6 +9,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
9
9
|
import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
|
|
10
10
|
import { toolbarInsertBlockMessages as insertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { IconAction, IconDecision } from '@atlaskit/editor-common/quick-insert';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { getListTypes, insertTaskDecisionAction, insertTaskDecisionCommand } from './commands';
|
|
13
14
|
import { getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
|
|
14
15
|
import inputRulePlugin from './pm-plugins/input-rules';
|
|
@@ -20,6 +21,28 @@ import ToolbarTask from './ui/ToolbarTask';
|
|
|
20
21
|
const taskDecisionToolbarGroupStyles = css({
|
|
21
22
|
display: 'flex'
|
|
22
23
|
});
|
|
24
|
+
// @nodeSpecException:toDOM patch
|
|
25
|
+
export const taskItemSpecWithFixedToDOM = () => {
|
|
26
|
+
if (!fg('platform_editor_lazy-node-views')) {
|
|
27
|
+
return taskItem;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
...taskItem,
|
|
31
|
+
toDOM: node => {
|
|
32
|
+
const checked = node.attrs.state === 'DONE';
|
|
33
|
+
const inputAttrs = {
|
|
34
|
+
type: 'checkbox'
|
|
35
|
+
};
|
|
36
|
+
if (checked) {
|
|
37
|
+
inputAttrs.checked = 'true';
|
|
38
|
+
}
|
|
39
|
+
// TODO: Align styling with `@atlaskit/task-decision`
|
|
40
|
+
return ['div', {
|
|
41
|
+
style: 'display: flex;'
|
|
42
|
+
}, ['input', inputAttrs], ['div', 0]];
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
23
46
|
const addItem = (insert, listType, schema) => ({
|
|
24
47
|
listLocalId,
|
|
25
48
|
itemLocalId
|
|
@@ -61,7 +84,7 @@ export const tasksAndDecisionsPlugin = ({
|
|
|
61
84
|
node: taskList
|
|
62
85
|
}, {
|
|
63
86
|
name: 'taskItem',
|
|
64
|
-
node:
|
|
87
|
+
node: taskItemSpecWithFixedToDOM()
|
|
65
88
|
}];
|
|
66
89
|
},
|
|
67
90
|
getSharedState(editorState) {
|
|
@@ -5,7 +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 { decisionItemNodeView } from '../nodeviews/decisionItem';
|
|
8
|
-
import {
|
|
8
|
+
import { lazyTaskView } from '../nodeviews/task-lazy-node-view';
|
|
9
9
|
import { focusCheckboxAndUpdateSelection, getTaskItemDataAtPos, getTaskItemDataToFocus, removeCheckboxFocus } from './helpers';
|
|
10
10
|
import { stateKey } from './plugin-key';
|
|
11
11
|
import { ACTIONS } from './types';
|
|
@@ -20,7 +20,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory
|
|
|
20
20
|
return new SafePlugin({
|
|
21
21
|
props: {
|
|
22
22
|
nodeViews: {
|
|
23
|
-
taskItem:
|
|
23
|
+
taskItem: lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api),
|
|
24
24
|
decisionItem: decisionItemNodeView(portalProviderAPI, eventDispatcher, api)
|
|
25
25
|
},
|
|
26
26
|
handleTextInput(view, from, to, text) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { taskItemNodeViewFactory } from './taskItem';
|
|
4
|
+
export var lazyTaskView = function lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api) {
|
|
5
|
+
if (!fg('platform_editor_lazy-node-views')) {
|
|
6
|
+
return taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api);
|
|
7
|
+
}
|
|
8
|
+
return withLazyLoading({
|
|
9
|
+
nodeName: 'taskItem',
|
|
10
|
+
getNodeViewOptions: function getNodeViewOptions() {},
|
|
11
|
+
loader: function loader() {
|
|
12
|
+
var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-tasks-and-decisions_task-item-nodeview" */
|
|
13
|
+
'./taskItem').then(function (_ref) {
|
|
14
|
+
var taskItemNodeViewFactory = _ref.taskItemNodeViewFactory;
|
|
15
|
+
return function (node, view, getPos) {
|
|
16
|
+
return taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api)(node, view, getPos);
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
return result;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
+
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; }
|
|
1
4
|
/**
|
|
2
5
|
* @jsxRuntime classic
|
|
3
6
|
* @jsx jsx
|
|
@@ -9,6 +12,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
9
12
|
import { MAX_INDENTATION_LEVEL } from '@atlaskit/editor-common/indentation';
|
|
10
13
|
import { toolbarInsertBlockMessages as insertBlockMessages } from '@atlaskit/editor-common/messages';
|
|
11
14
|
import { IconAction, IconDecision } from '@atlaskit/editor-common/quick-insert';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
16
|
import { getListTypes, insertTaskDecisionAction, insertTaskDecisionCommand } from './commands';
|
|
13
17
|
import { getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
|
|
14
18
|
import inputRulePlugin from './pm-plugins/input-rules';
|
|
@@ -20,6 +24,27 @@ import ToolbarTask from './ui/ToolbarTask';
|
|
|
20
24
|
var taskDecisionToolbarGroupStyles = css({
|
|
21
25
|
display: 'flex'
|
|
22
26
|
});
|
|
27
|
+
// @nodeSpecException:toDOM patch
|
|
28
|
+
export var taskItemSpecWithFixedToDOM = function taskItemSpecWithFixedToDOM() {
|
|
29
|
+
if (!fg('platform_editor_lazy-node-views')) {
|
|
30
|
+
return taskItem;
|
|
31
|
+
}
|
|
32
|
+
return _objectSpread(_objectSpread({}, taskItem), {}, {
|
|
33
|
+
toDOM: function toDOM(node) {
|
|
34
|
+
var checked = node.attrs.state === 'DONE';
|
|
35
|
+
var inputAttrs = {
|
|
36
|
+
type: 'checkbox'
|
|
37
|
+
};
|
|
38
|
+
if (checked) {
|
|
39
|
+
inputAttrs.checked = 'true';
|
|
40
|
+
}
|
|
41
|
+
// TODO: Align styling with `@atlaskit/task-decision`
|
|
42
|
+
return ['div', {
|
|
43
|
+
style: 'display: flex;'
|
|
44
|
+
}, ['input', inputAttrs], ['div', 0]];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
23
48
|
var addItem = function addItem(insert, listType, schema) {
|
|
24
49
|
return function (_ref) {
|
|
25
50
|
var listLocalId = _ref.listLocalId,
|
|
@@ -60,7 +85,7 @@ export var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
|
60
85
|
node: taskList
|
|
61
86
|
}, {
|
|
62
87
|
name: 'taskItem',
|
|
63
|
-
node:
|
|
88
|
+
node: taskItemSpecWithFixedToDOM()
|
|
64
89
|
}];
|
|
65
90
|
},
|
|
66
91
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -10,7 +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 { decisionItemNodeView } from '../nodeviews/decisionItem';
|
|
13
|
-
import {
|
|
13
|
+
import { lazyTaskView } from '../nodeviews/task-lazy-node-view';
|
|
14
14
|
import { focusCheckboxAndUpdateSelection, getTaskItemDataAtPos, getTaskItemDataToFocus, removeCheckboxFocus } from './helpers';
|
|
15
15
|
import { stateKey } from './plugin-key';
|
|
16
16
|
import { ACTIONS } from './types';
|
|
@@ -26,7 +26,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory
|
|
|
26
26
|
return new SafePlugin({
|
|
27
27
|
props: {
|
|
28
28
|
nodeViews: {
|
|
29
|
-
taskItem:
|
|
29
|
+
taskItem: lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api),
|
|
30
30
|
decisionItem: decisionItemNodeView(portalProviderAPI, eventDispatcher, api)
|
|
31
31
|
},
|
|
32
32
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { TasksAndDecisionsPlugin } from '../types';
|
|
6
|
+
export declare const lazyTaskView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { TasksAndDecisionsPlugin } from '../types';
|
|
6
|
+
export declare const lazyTaskView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"@atlaskit/adf-schema": "^40.3.0",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.10.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
39
|
-
"@atlaskit/editor-common": "^
|
|
40
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
41
|
-
"@atlaskit/editor-plugin-context-identifier": "^1.
|
|
42
|
-
"@atlaskit/editor-plugin-type-ahead": "^1.
|
|
43
|
-
"@atlaskit/editor-prosemirror": "
|
|
39
|
+
"@atlaskit/editor-common": "^87.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-analytics": "^1.6.0",
|
|
41
|
+
"@atlaskit/editor-plugin-context-identifier": "^1.2.0",
|
|
42
|
+
"@atlaskit/editor-plugin-type-ahead": "^1.6.0",
|
|
43
|
+
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
44
44
|
"@atlaskit/icon": "^22.7.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
46
|
-
"@atlaskit/prosemirror-input-rules": "^3.
|
|
46
|
+
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
47
47
|
"@atlaskit/task-decision": "^17.10.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@emotion/react": "^11.7.1"
|
|
@@ -58,7 +58,6 @@
|
|
|
58
58
|
"@atlaskit/ssr": "*",
|
|
59
59
|
"@atlaskit/util-data-test": "^17.9.0",
|
|
60
60
|
"@atlaskit/visual-regression": "*",
|
|
61
|
-
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
|
62
61
|
"@testing-library/react": "^12.1.5",
|
|
63
62
|
"react-dom": "^16.8.0",
|
|
64
63
|
"typescript": "~5.4.2",
|
|
@@ -100,6 +99,9 @@
|
|
|
100
99
|
"platform-feature-flags": {
|
|
101
100
|
"react_18_tasks_and_decisions_concurrent_mode": {
|
|
102
101
|
"type": "boolean"
|
|
102
|
+
},
|
|
103
|
+
"platform_editor_lazy-node-views": {
|
|
104
|
+
"type": "boolean"
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
}
|