@atlaskit/editor-plugin-tasks-and-decisions 2.3.3 → 2.3.4
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 +8 -0
- package/dist/cjs/nodeviews/decisionItem.js +2 -23
- package/dist/cjs/nodeviews/taskItem.js +4 -26
- package/dist/es2019/nodeviews/decisionItem.js +2 -20
- package/dist/es2019/nodeviews/taskItem.js +2 -20
- package/dist/esm/nodeviews/decisionItem.js +2 -23
- package/dist/esm/nodeviews/taskItem.js +4 -26
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 2.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`17f9128c6a629`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/17f9128c6a629) -
|
|
8
|
+
Cleanup feature flag for tasks and decisions react 18 concurrent mode fix.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 2.3.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -13,7 +13,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _Decision = _interopRequireDefault(require("../ui/Decision"));
|
|
18
17
|
var _useShowPlaceholder = require("./hooks/use-show-placeholder");
|
|
19
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -90,36 +89,16 @@ var Decision = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
90
89
|
}, {
|
|
91
90
|
key: "viewShouldUpdate",
|
|
92
91
|
value: function viewShouldUpdate(nextNode) {
|
|
93
|
-
|
|
94
|
-
* To ensure the placeholder is correctly toggled we need to allow react to re-render
|
|
95
|
-
* on first character insertion or when the last character is deleted.
|
|
96
|
-
*/
|
|
97
|
-
if ((0, _platformFeatureFlags.fg)('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
98
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
99
|
-
} else {
|
|
100
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode);
|
|
101
|
-
}
|
|
92
|
+
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
102
93
|
}
|
|
103
94
|
}, {
|
|
104
95
|
key: "update",
|
|
105
96
|
value: function update(node, decorations) {
|
|
106
|
-
|
|
107
|
-
if ((0, _platformFeatureFlags.fg)('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
108
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(Decision.prototype), "update", this).call(this, node, decorations);
|
|
109
|
-
} else {
|
|
110
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(Decision.prototype), "update", this).call(this, node, decorations, undefined,
|
|
111
|
-
// Toggle the placeholder based on whether user input exists.
|
|
112
|
-
function (_currentNode, _newNode) {
|
|
113
|
-
return !_this.isContentEmpty(_newNode);
|
|
114
|
-
});
|
|
115
|
-
}
|
|
97
|
+
return (0, _get2.default)((0, _getPrototypeOf2.default)(Decision.prototype), "update", this).call(this, node, decorations);
|
|
116
98
|
}
|
|
117
99
|
}, {
|
|
118
100
|
key: "ignoreMutation",
|
|
119
101
|
value: function ignoreMutation(mutation) {
|
|
120
|
-
if (!(0, _platformFeatureFlags.fg)('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
102
|
if (!this.contentDOM) {
|
|
124
103
|
return true;
|
|
125
104
|
}
|
|
@@ -18,7 +18,6 @@ var _steps = require("@atlaskit/adf-schema/steps");
|
|
|
18
18
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
19
19
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
20
20
|
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
21
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
21
|
var _Task = _interopRequireDefault(require("../ui/Task"));
|
|
23
22
|
var _useShowPlaceholder = require("./hooks/use-show-placeholder");
|
|
24
23
|
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; }
|
|
@@ -181,39 +180,18 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
181
180
|
}, {
|
|
182
181
|
key: "viewShouldUpdate",
|
|
183
182
|
value: function viewShouldUpdate(nextNode) {
|
|
184
|
-
|
|
185
|
-
* To ensure the placeholder is correctly toggled we need to allow react to re-render
|
|
186
|
-
* on first character insertion or when the last character is deleted.
|
|
187
|
-
*/
|
|
188
|
-
if ((0, _platformFeatureFlags.fg)('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
189
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
190
|
-
} else {
|
|
191
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode);
|
|
192
|
-
}
|
|
183
|
+
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
193
184
|
}
|
|
194
185
|
}, {
|
|
195
186
|
key: "update",
|
|
196
187
|
value: function update(node, decorations) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return !!(currentNode.attrs.state === newNode.attrs.state);
|
|
201
|
-
});
|
|
202
|
-
} else {
|
|
203
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(Task.prototype), "update", this).call(this, node, decorations, undefined, function (currentNode, newNode) {
|
|
204
|
-
return (
|
|
205
|
-
// Toggle the placeholder based on whether user input exists
|
|
206
|
-
!_this2.isContentEmpty(newNode) && !!(currentNode.attrs.state === newNode.attrs.state)
|
|
207
|
-
);
|
|
208
|
-
});
|
|
209
|
-
}
|
|
188
|
+
return (0, _get2.default)((0, _getPrototypeOf2.default)(Task.prototype), "update", this).call(this, node, decorations, undefined, function (currentNode, newNode) {
|
|
189
|
+
return !!(currentNode.attrs.state === newNode.attrs.state);
|
|
190
|
+
});
|
|
210
191
|
}
|
|
211
192
|
}, {
|
|
212
193
|
key: "ignoreMutation",
|
|
213
194
|
value: function ignoreMutation(mutation) {
|
|
214
|
-
if (!(0, _platformFeatureFlags.fg)('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
195
|
if (!this.contentDOM) {
|
|
218
196
|
return true;
|
|
219
197
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import DecisionItem from '../ui/Decision';
|
|
5
4
|
import { useShowPlaceholder } from './hooks/use-show-placeholder';
|
|
6
5
|
const DecisionItemWrapper = ({
|
|
@@ -58,29 +57,12 @@ class Decision extends ReactNodeView {
|
|
|
58
57
|
});
|
|
59
58
|
}
|
|
60
59
|
viewShouldUpdate(nextNode) {
|
|
61
|
-
|
|
62
|
-
* To ensure the placeholder is correctly toggled we need to allow react to re-render
|
|
63
|
-
* on first character insertion or when the last character is deleted.
|
|
64
|
-
*/
|
|
65
|
-
if (fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
66
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
67
|
-
} else {
|
|
68
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode);
|
|
69
|
-
}
|
|
60
|
+
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
70
61
|
}
|
|
71
62
|
update(node, decorations) {
|
|
72
|
-
|
|
73
|
-
return super.update(node, decorations);
|
|
74
|
-
} else {
|
|
75
|
-
return super.update(node, decorations, undefined,
|
|
76
|
-
// Toggle the placeholder based on whether user input exists.
|
|
77
|
-
(_currentNode, _newNode) => !this.isContentEmpty(_newNode));
|
|
78
|
-
}
|
|
63
|
+
return super.update(node, decorations);
|
|
79
64
|
}
|
|
80
65
|
ignoreMutation(mutation) {
|
|
81
|
-
if (!fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
66
|
if (!this.contentDOM) {
|
|
85
67
|
return true;
|
|
86
68
|
}
|
|
@@ -4,7 +4,6 @@ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
|
4
4
|
import { AnalyticsListener } from '@atlaskit/analytics-next';
|
|
5
5
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
6
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import TaskItem from '../ui/Task';
|
|
9
8
|
import { useShowPlaceholder } from './hooks/use-show-placeholder';
|
|
10
9
|
const TaskItemWrapper = ({
|
|
@@ -151,29 +150,12 @@ class Task extends ReactNodeView {
|
|
|
151
150
|
}));
|
|
152
151
|
}
|
|
153
152
|
viewShouldUpdate(nextNode) {
|
|
154
|
-
|
|
155
|
-
* To ensure the placeholder is correctly toggled we need to allow react to re-render
|
|
156
|
-
* on first character insertion or when the last character is deleted.
|
|
157
|
-
*/
|
|
158
|
-
if (fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
159
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
160
|
-
} else {
|
|
161
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode);
|
|
162
|
-
}
|
|
153
|
+
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
163
154
|
}
|
|
164
155
|
update(node, decorations) {
|
|
165
|
-
|
|
166
|
-
return super.update(node, decorations, undefined, (currentNode, newNode) => !!(currentNode.attrs.state === newNode.attrs.state));
|
|
167
|
-
} else {
|
|
168
|
-
return super.update(node, decorations, undefined, (currentNode, newNode) =>
|
|
169
|
-
// Toggle the placeholder based on whether user input exists
|
|
170
|
-
!this.isContentEmpty(newNode) && !!(currentNode.attrs.state === newNode.attrs.state));
|
|
171
|
-
}
|
|
156
|
+
return super.update(node, decorations, undefined, (currentNode, newNode) => !!(currentNode.attrs.state === newNode.attrs.state));
|
|
172
157
|
}
|
|
173
158
|
ignoreMutation(mutation) {
|
|
174
|
-
if (!fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
159
|
if (!this.contentDOM) {
|
|
178
160
|
return true;
|
|
179
161
|
}
|
|
@@ -8,7 +8,6 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import DecisionItem from '../ui/Decision';
|
|
13
12
|
import { useShowPlaceholder } from './hooks/use-show-placeholder';
|
|
14
13
|
var DecisionItemWrapper = function DecisionItemWrapper(_ref) {
|
|
@@ -83,36 +82,16 @@ var Decision = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
83
82
|
}, {
|
|
84
83
|
key: "viewShouldUpdate",
|
|
85
84
|
value: function viewShouldUpdate(nextNode) {
|
|
86
|
-
|
|
87
|
-
* To ensure the placeholder is correctly toggled we need to allow react to re-render
|
|
88
|
-
* on first character insertion or when the last character is deleted.
|
|
89
|
-
*/
|
|
90
|
-
if (fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
91
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
92
|
-
} else {
|
|
93
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode);
|
|
94
|
-
}
|
|
85
|
+
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
95
86
|
}
|
|
96
87
|
}, {
|
|
97
88
|
key: "update",
|
|
98
89
|
value: function update(node, decorations) {
|
|
99
|
-
|
|
100
|
-
if (fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
101
|
-
return _get(_getPrototypeOf(Decision.prototype), "update", this).call(this, node, decorations);
|
|
102
|
-
} else {
|
|
103
|
-
return _get(_getPrototypeOf(Decision.prototype), "update", this).call(this, node, decorations, undefined,
|
|
104
|
-
// Toggle the placeholder based on whether user input exists.
|
|
105
|
-
function (_currentNode, _newNode) {
|
|
106
|
-
return !_this.isContentEmpty(_newNode);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
90
|
+
return _get(_getPrototypeOf(Decision.prototype), "update", this).call(this, node, decorations);
|
|
109
91
|
}
|
|
110
92
|
}, {
|
|
111
93
|
key: "ignoreMutation",
|
|
112
94
|
value: function ignoreMutation(mutation) {
|
|
113
|
-
if (!fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
95
|
if (!this.contentDOM) {
|
|
117
96
|
return true;
|
|
118
97
|
}
|
|
@@ -15,7 +15,6 @@ import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
|
15
15
|
import { AnalyticsListener } from '@atlaskit/analytics-next';
|
|
16
16
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
17
17
|
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
18
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
18
|
import TaskItem from '../ui/Task';
|
|
20
19
|
import { useShowPlaceholder } from './hooks/use-show-placeholder';
|
|
21
20
|
var TaskItemWrapper = function TaskItemWrapper(_ref) {
|
|
@@ -174,39 +173,18 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
174
173
|
}, {
|
|
175
174
|
key: "viewShouldUpdate",
|
|
176
175
|
value: function viewShouldUpdate(nextNode) {
|
|
177
|
-
|
|
178
|
-
* To ensure the placeholder is correctly toggled we need to allow react to re-render
|
|
179
|
-
* on first character insertion or when the last character is deleted.
|
|
180
|
-
*/
|
|
181
|
-
if (fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
182
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
183
|
-
} else {
|
|
184
|
-
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode);
|
|
185
|
-
}
|
|
176
|
+
return this.isContentEmpty(this.node) && !this.isContentEmpty(nextNode) || this.isContentEmpty(nextNode) && !this.isContentEmpty(this.node);
|
|
186
177
|
}
|
|
187
178
|
}, {
|
|
188
179
|
key: "update",
|
|
189
180
|
value: function update(node, decorations) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return !!(currentNode.attrs.state === newNode.attrs.state);
|
|
194
|
-
});
|
|
195
|
-
} else {
|
|
196
|
-
return _get(_getPrototypeOf(Task.prototype), "update", this).call(this, node, decorations, undefined, function (currentNode, newNode) {
|
|
197
|
-
return (
|
|
198
|
-
// Toggle the placeholder based on whether user input exists
|
|
199
|
-
!_this2.isContentEmpty(newNode) && !!(currentNode.attrs.state === newNode.attrs.state)
|
|
200
|
-
);
|
|
201
|
-
});
|
|
202
|
-
}
|
|
181
|
+
return _get(_getPrototypeOf(Task.prototype), "update", this).call(this, node, decorations, undefined, function (currentNode, newNode) {
|
|
182
|
+
return !!(currentNode.attrs.state === newNode.attrs.state);
|
|
183
|
+
});
|
|
203
184
|
}
|
|
204
185
|
}, {
|
|
205
186
|
key: "ignoreMutation",
|
|
206
187
|
value: function ignoreMutation(mutation) {
|
|
207
|
-
if (!fg('react_18_tasks_and_decisions_concurrent_mode')) {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
188
|
if (!this.contentDOM) {
|
|
211
189
|
return true;
|
|
212
190
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/adf-schema": "^40.3.0",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.10.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^10.0.0",
|
|
39
|
-
"@atlaskit/editor-common": "^87.
|
|
39
|
+
"@atlaskit/editor-common": "^87.5.0",
|
|
40
40
|
"@atlaskit/editor-plugin-analytics": "^1.6.0",
|
|
41
41
|
"@atlaskit/editor-plugin-context-identifier": "^1.2.0",
|
|
42
42
|
"@atlaskit/editor-plugin-type-ahead": "^1.6.0",
|
|
@@ -98,9 +98,6 @@
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"platform-feature-flags": {
|
|
101
|
-
"react_18_tasks_and_decisions_concurrent_mode": {
|
|
102
|
-
"type": "boolean"
|
|
103
|
-
},
|
|
104
101
|
"platform_editor_lazy-node-views": {
|
|
105
102
|
"type": "boolean"
|
|
106
103
|
}
|