@atlaskit/editor-plugin-tasks-and-decisions 9.1.11 → 9.1.12
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 +9 -0
- package/dist/cjs/pm-plugins/main.js +21 -0
- package/dist/es2019/pm-plugins/main.js +25 -0
- package/dist/esm/pm-plugins/main.js +21 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-tasks-and-decisions
|
|
2
2
|
|
|
3
|
+
## 9.1.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 9.1.11
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -31,6 +31,9 @@ function nodesBetweenChanged(tr, f, startPos) {
|
|
|
31
31
|
if (!stepRange) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
36
|
+
|
|
34
37
|
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
35
38
|
}
|
|
36
39
|
|
|
@@ -43,6 +46,8 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
43
46
|
var taskPlaceholder = arguments.length > 9 ? arguments[9] : undefined;
|
|
44
47
|
return new _safePlugin.SafePlugin({
|
|
45
48
|
props: {
|
|
49
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
50
|
+
|
|
46
51
|
nodeViews: _objectSpread({
|
|
47
52
|
taskItem: (0, _taskNodeView.taskView)(api, getIntl(), taskPlaceholder),
|
|
48
53
|
decisionItem: function (node) {
|
|
@@ -51,6 +56,7 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
51
56
|
}, (0, _expValEquals.expValEquals)('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) ? {
|
|
52
57
|
blockTaskItem: (0, _taskNodeView.taskView)(api, getIntl(), taskPlaceholder)
|
|
53
58
|
} : {}),
|
|
59
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
54
60
|
decorations: function decorations(state) {
|
|
55
61
|
var pluginState = _pluginKey.stateKey.getState(state);
|
|
56
62
|
if (pluginState !== null && pluginState !== void 0 && pluginState.decorations) {
|
|
@@ -58,6 +64,7 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
58
64
|
}
|
|
59
65
|
return _view.DecorationSet.empty;
|
|
60
66
|
},
|
|
67
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
61
68
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
62
69
|
// When a decision item is selected and the user starts typing, the entire node
|
|
63
70
|
// should be replaced with what was just typed. This custom text input handler
|
|
@@ -81,11 +88,15 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
81
88
|
}, {
|
|
82
89
|
useLongPressSelection: useLongPressSelection
|
|
83
90
|
}),
|
|
91
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
92
|
+
|
|
84
93
|
handleDOMEvents: {
|
|
85
94
|
// When the page is lazy loaded and task item is not yet available this allows
|
|
86
95
|
// our toDOM implementation to toggle the node state
|
|
87
96
|
change: _taskItemOnChange.taskItemOnChange
|
|
88
97
|
},
|
|
98
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
99
|
+
|
|
89
100
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
90
101
|
var state = view.state;
|
|
91
102
|
var selection = state.selection,
|
|
@@ -178,6 +189,8 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
178
189
|
}
|
|
179
190
|
}
|
|
180
191
|
},
|
|
192
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
193
|
+
|
|
181
194
|
transformPasted: function transformPasted(slice, view) {
|
|
182
195
|
var _view$state;
|
|
183
196
|
if (Boolean(view === null || view === void 0 || (_view$state = view.state) === null || _view$state === void 0 || (_view$state = _view$state.schema) === null || _view$state === void 0 || (_view$state = _view$state.nodes) === null || _view$state === void 0 ? void 0 : _view$state.blockTaskItem)) {
|
|
@@ -187,6 +200,7 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
187
200
|
}
|
|
188
201
|
},
|
|
189
202
|
state: {
|
|
203
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
190
204
|
init: function init() {
|
|
191
205
|
return {
|
|
192
206
|
insideTaskDecisionItem: false,
|
|
@@ -198,6 +212,7 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
198
212
|
decorations: _view.DecorationSet.empty
|
|
199
213
|
};
|
|
200
214
|
},
|
|
215
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
201
216
|
apply: function apply(tr, pluginState) {
|
|
202
217
|
var metaData = tr.getMeta(_pluginKey.stateKey);
|
|
203
218
|
var _ref = metaData !== null && metaData !== void 0 ? metaData : {
|
|
@@ -249,6 +264,8 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
249
264
|
})]);
|
|
250
265
|
} else {
|
|
251
266
|
var _newPluginState$decor;
|
|
267
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
268
|
+
|
|
252
269
|
decorations = (_newPluginState$decor = newPluginState.decorations) === null || _newPluginState$decor === void 0 ? void 0 : _newPluginState$decor.map(tr.mapping, tr.doc);
|
|
253
270
|
}
|
|
254
271
|
var newState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
@@ -267,9 +284,13 @@ function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl
|
|
|
267
284
|
*
|
|
268
285
|
* Note: we currently do not handle the edge case where two nodes may have the same localId
|
|
269
286
|
*/
|
|
287
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
288
|
+
|
|
270
289
|
appendTransaction: function appendTransaction(transactions, _oldState, newState) {
|
|
271
290
|
var tr = newState.tr;
|
|
272
291
|
var modified = false;
|
|
292
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
293
|
+
|
|
273
294
|
transactions.forEach(function (transaction) {
|
|
274
295
|
if (!transaction.docChanged) {
|
|
275
296
|
return;
|
|
@@ -19,6 +19,9 @@ function nodesBetweenChanged(tr, f, startPos) {
|
|
|
19
19
|
if (!stepRange) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
24
|
+
|
|
22
25
|
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
23
26
|
}
|
|
24
27
|
|
|
@@ -26,6 +29,8 @@ function nodesBetweenChanged(tr, f, startPos) {
|
|
|
26
29
|
export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api, getIntl, useLongPressSelection = false, hasEditPermission, hasRequestedEditPermission, requestToEditContent, taskPlaceholder) {
|
|
27
30
|
return new SafePlugin({
|
|
28
31
|
props: {
|
|
32
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
33
|
+
|
|
29
34
|
nodeViews: {
|
|
30
35
|
taskItem: taskView(api, getIntl(), taskPlaceholder),
|
|
31
36
|
decisionItem: node => {
|
|
@@ -35,6 +40,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
35
40
|
blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
|
|
36
41
|
} : {})
|
|
37
42
|
},
|
|
43
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
44
|
+
|
|
38
45
|
decorations(state) {
|
|
39
46
|
const pluginState = stateKey.getState(state);
|
|
40
47
|
if (pluginState !== null && pluginState !== void 0 && pluginState.decorations) {
|
|
@@ -42,6 +49,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
42
49
|
}
|
|
43
50
|
return DecorationSet.empty;
|
|
44
51
|
},
|
|
52
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
53
|
+
|
|
45
54
|
handleTextInput(view, from, to, text) {
|
|
46
55
|
// When a decision item is selected and the user starts typing, the entire node
|
|
47
56
|
// should be replaced with what was just typed. This custom text input handler
|
|
@@ -67,11 +76,15 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
67
76
|
handleClickOn: createSelectionClickHandler(['decisionItem', 'taskItem'], target => target.hasAttribute('data-decision-wrapper') || target.getAttribute('aria-label') === 'Decision', {
|
|
68
77
|
useLongPressSelection
|
|
69
78
|
}),
|
|
79
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
80
|
+
|
|
70
81
|
handleDOMEvents: {
|
|
71
82
|
// When the page is lazy loaded and task item is not yet available this allows
|
|
72
83
|
// our toDOM implementation to toggle the node state
|
|
73
84
|
change: taskItemOnChange
|
|
74
85
|
},
|
|
86
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
87
|
+
|
|
75
88
|
handleKeyDown: (view, event) => {
|
|
76
89
|
const {
|
|
77
90
|
state
|
|
@@ -170,6 +183,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
170
183
|
}
|
|
171
184
|
}
|
|
172
185
|
},
|
|
186
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
187
|
+
|
|
173
188
|
transformPasted: (slice, view) => {
|
|
174
189
|
var _view$state, _view$state$schema, _view$state$schema$no;
|
|
175
190
|
if (Boolean(view === null || view === void 0 ? void 0 : (_view$state = view.state) === null || _view$state === void 0 ? void 0 : (_view$state$schema = _view$state.schema) === null || _view$state$schema === void 0 ? void 0 : (_view$state$schema$no = _view$state$schema.nodes) === null || _view$state$schema$no === void 0 ? void 0 : _view$state$schema$no.blockTaskItem)) {
|
|
@@ -179,6 +194,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
179
194
|
}
|
|
180
195
|
},
|
|
181
196
|
state: {
|
|
197
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
198
|
+
|
|
182
199
|
init() {
|
|
183
200
|
return {
|
|
184
201
|
insideTaskDecisionItem: false,
|
|
@@ -190,6 +207,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
190
207
|
decorations: DecorationSet.empty
|
|
191
208
|
};
|
|
192
209
|
},
|
|
210
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
211
|
+
|
|
193
212
|
apply(tr, pluginState) {
|
|
194
213
|
const metaData = tr.getMeta(stateKey);
|
|
195
214
|
const {
|
|
@@ -244,6 +263,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
244
263
|
})]);
|
|
245
264
|
} else {
|
|
246
265
|
var _newPluginState$decor;
|
|
266
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
267
|
+
|
|
247
268
|
decorations = (_newPluginState$decor = newPluginState.decorations) === null || _newPluginState$decor === void 0 ? void 0 : _newPluginState$decor.map(tr.mapping, tr.doc);
|
|
248
269
|
}
|
|
249
270
|
const newState = {
|
|
@@ -263,9 +284,13 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
263
284
|
*
|
|
264
285
|
* Note: we currently do not handle the edge case where two nodes may have the same localId
|
|
265
286
|
*/
|
|
287
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
288
|
+
|
|
266
289
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
267
290
|
const tr = newState.tr;
|
|
268
291
|
let modified = false;
|
|
292
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
293
|
+
|
|
269
294
|
transactions.forEach(transaction => {
|
|
270
295
|
if (!transaction.docChanged) {
|
|
271
296
|
return;
|
|
@@ -24,6 +24,9 @@ function nodesBetweenChanged(tr, f, startPos) {
|
|
|
24
24
|
if (!stepRange) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
29
|
+
|
|
27
30
|
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -36,6 +39,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
36
39
|
var taskPlaceholder = arguments.length > 9 ? arguments[9] : undefined;
|
|
37
40
|
return new SafePlugin({
|
|
38
41
|
props: {
|
|
42
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
43
|
+
|
|
39
44
|
nodeViews: _objectSpread({
|
|
40
45
|
taskItem: taskView(api, getIntl(), taskPlaceholder),
|
|
41
46
|
decisionItem: function (node) {
|
|
@@ -44,6 +49,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
44
49
|
}, expValEquals('platform_editor_blocktaskitem_node_tenantid', 'isEnabled', true) ? {
|
|
45
50
|
blockTaskItem: taskView(api, getIntl(), taskPlaceholder)
|
|
46
51
|
} : {}),
|
|
52
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
47
53
|
decorations: function decorations(state) {
|
|
48
54
|
var pluginState = stateKey.getState(state);
|
|
49
55
|
if (pluginState !== null && pluginState !== void 0 && pluginState.decorations) {
|
|
@@ -51,6 +57,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
51
57
|
}
|
|
52
58
|
return DecorationSet.empty;
|
|
53
59
|
},
|
|
60
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
54
61
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
55
62
|
// When a decision item is selected and the user starts typing, the entire node
|
|
56
63
|
// should be replaced with what was just typed. This custom text input handler
|
|
@@ -74,11 +81,15 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
74
81
|
}, {
|
|
75
82
|
useLongPressSelection: useLongPressSelection
|
|
76
83
|
}),
|
|
84
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
85
|
+
|
|
77
86
|
handleDOMEvents: {
|
|
78
87
|
// When the page is lazy loaded and task item is not yet available this allows
|
|
79
88
|
// our toDOM implementation to toggle the node state
|
|
80
89
|
change: taskItemOnChange
|
|
81
90
|
},
|
|
91
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
92
|
+
|
|
82
93
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
83
94
|
var state = view.state;
|
|
84
95
|
var selection = state.selection,
|
|
@@ -171,6 +182,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
171
182
|
}
|
|
172
183
|
}
|
|
173
184
|
},
|
|
185
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
186
|
+
|
|
174
187
|
transformPasted: function transformPasted(slice, view) {
|
|
175
188
|
var _view$state;
|
|
176
189
|
if (Boolean(view === null || view === void 0 || (_view$state = view.state) === null || _view$state === void 0 || (_view$state = _view$state.schema) === null || _view$state === void 0 || (_view$state = _view$state.nodes) === null || _view$state === void 0 ? void 0 : _view$state.blockTaskItem)) {
|
|
@@ -180,6 +193,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
180
193
|
}
|
|
181
194
|
},
|
|
182
195
|
state: {
|
|
196
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
183
197
|
init: function init() {
|
|
184
198
|
return {
|
|
185
199
|
insideTaskDecisionItem: false,
|
|
@@ -191,6 +205,7 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
191
205
|
decorations: DecorationSet.empty
|
|
192
206
|
};
|
|
193
207
|
},
|
|
208
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
194
209
|
apply: function apply(tr, pluginState) {
|
|
195
210
|
var metaData = tr.getMeta(stateKey);
|
|
196
211
|
var _ref = metaData !== null && metaData !== void 0 ? metaData : {
|
|
@@ -242,6 +257,8 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
242
257
|
})]);
|
|
243
258
|
} else {
|
|
244
259
|
var _newPluginState$decor;
|
|
260
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
261
|
+
|
|
245
262
|
decorations = (_newPluginState$decor = newPluginState.decorations) === null || _newPluginState$decor === void 0 ? void 0 : _newPluginState$decor.map(tr.mapping, tr.doc);
|
|
246
263
|
}
|
|
247
264
|
var newState = _objectSpread(_objectSpread({}, newPluginState), {}, {
|
|
@@ -260,9 +277,13 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
|
|
|
260
277
|
*
|
|
261
278
|
* Note: we currently do not handle the edge case where two nodes may have the same localId
|
|
262
279
|
*/
|
|
280
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
281
|
+
|
|
263
282
|
appendTransaction: function appendTransaction(transactions, _oldState, newState) {
|
|
264
283
|
var tr = newState.tr;
|
|
265
284
|
var modified = false;
|
|
285
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
286
|
+
|
|
266
287
|
transactions.forEach(function (transaction) {
|
|
267
288
|
if (!transaction.docChanged) {
|
|
268
289
|
return;
|