@atlaskit/editor-plugin-tasks-and-decisions 2.12.39 → 2.12.41
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 +12 -0
- package/dist/cjs/nodeviews/task-lazy-node-view.js +1 -4
- package/dist/cjs/nodeviews/taskItem.js +1 -2
- package/dist/cjs/pm-plugins/helpers.js +0 -2
- package/dist/cjs/pm-plugins/input-rules.js +2 -8
- package/dist/cjs/pm-plugins/insert-commands.js +5 -20
- package/dist/cjs/pm-plugins/keymaps.js +1 -7
- package/dist/cjs/pm-plugins/main.js +0 -5
- package/dist/es2019/nodeviews/task-lazy-node-view.js +1 -4
- package/dist/es2019/nodeviews/taskItem.js +0 -3
- package/dist/es2019/pm-plugins/helpers.js +0 -2
- package/dist/es2019/pm-plugins/input-rules.js +2 -8
- package/dist/es2019/pm-plugins/insert-commands.js +5 -20
- package/dist/es2019/pm-plugins/keymaps.js +1 -7
- package/dist/es2019/pm-plugins/main.js +0 -5
- package/dist/esm/nodeviews/task-lazy-node-view.js +1 -4
- package/dist/esm/nodeviews/taskItem.js +1 -2
- package/dist/esm/pm-plugins/helpers.js +0 -2
- package/dist/esm/pm-plugins/input-rules.js +2 -8
- package/dist/esm/pm-plugins/insert-commands.js +5 -20
- package/dist/esm/pm-plugins/keymaps.js +1 -7
- package/dist/esm/pm-plugins/main.js +0 -5
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -11,10 +11,7 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
|
11
11
|
var _taskItem = require("./taskItem");
|
|
12
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
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 && {}.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, placeholder
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
|
-
) {
|
|
14
|
+
var lazyTaskView = exports.lazyTaskView = function lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder) {
|
|
18
15
|
if ((0, _experiments.editorExperiment)('platform_editor_exp_lazy_node_views', false)) {
|
|
19
16
|
return (0, _taskItem.taskItemNodeViewFactory)(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder);
|
|
20
17
|
}
|
|
@@ -411,8 +411,7 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
411
411
|
return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
|
|
412
412
|
}
|
|
413
413
|
}]);
|
|
414
|
-
}(_reactNodeView.default);
|
|
415
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
414
|
+
}(_reactNodeView.default);
|
|
416
415
|
function taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder) {
|
|
417
416
|
return function (node, view, getPos) {
|
|
418
417
|
return new Task(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -235,8 +235,6 @@ function getAllTaskItemsDataInRootTaskList(view) {
|
|
|
235
235
|
var rootTaskList = rootTaskListData.node;
|
|
236
236
|
var rootTaskListStartPos = rootTaskListData.start;
|
|
237
237
|
var allTaskItems = [];
|
|
238
|
-
// Ignored via go/ees005
|
|
239
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
240
238
|
rootTaskList.descendants(function (node, pos, parent, index) {
|
|
241
239
|
if (node.type === taskItem) {
|
|
242
240
|
allTaskItems.push({
|
|
@@ -17,10 +17,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
17
17
|
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; }
|
|
18
18
|
var createListRule = function createListRule(editorAnalyticsAPI, getContextIdentifierProvider) {
|
|
19
19
|
return function (regex, listType, itemAttrs) {
|
|
20
|
-
return (0, _utils.createRule)(regex,
|
|
21
|
-
// Ignored via go/ees005
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
23
|
-
function (state, _match, start, end) {
|
|
20
|
+
return (0, _utils.createRule)(regex, function (state, _match, start, end) {
|
|
24
21
|
var paragraph = state.schema.nodes.paragraph;
|
|
25
22
|
var _getListTypes = (0, _insertCommands.getListTypes)(listType, state.schema),
|
|
26
23
|
list = _getListTypes.list;
|
|
@@ -40,10 +37,7 @@ var isCursorInsideList = function isCursorInsideList($pos) {
|
|
|
40
37
|
var _$pos$node;
|
|
41
38
|
return ((_$pos$node = $pos.node($pos.depth - 1)) === null || _$pos$node === void 0 ? void 0 : _$pos$node.type.name) === 'listItem';
|
|
42
39
|
};
|
|
43
|
-
var processShortcutForNestedTask = function processShortcutForNestedTask(content, $from, tr, list, item, listLocalId, itemLocalId, itemAttrs
|
|
44
|
-
// Ignored via go/ees005
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
46
|
-
) {
|
|
40
|
+
var processShortcutForNestedTask = function processShortcutForNestedTask(content, $from, tr, list, item, listLocalId, itemLocalId, itemAttrs) {
|
|
47
41
|
//Extracting the content into the 'contentWithoutShortcut' from 'content' after removing the keyboard shortcut text, i.e., '[] '.
|
|
48
42
|
var contentWithoutShortcut = content.cut($from.pos - $from.start(), content.size);
|
|
49
43
|
tr.insert($from.after(), list.create({
|
|
@@ -29,10 +29,7 @@ var getContextData = function getContextData() {
|
|
|
29
29
|
userContext: userContext
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
var generateAnalyticsPayload = function generateAnalyticsPayload(listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx, listSize
|
|
33
|
-
// Ignored via go/ees005
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
35
|
-
) {
|
|
32
|
+
var generateAnalyticsPayload = function generateAnalyticsPayload(listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx, listSize) {
|
|
36
33
|
var containerId;
|
|
37
34
|
var objectId;
|
|
38
35
|
var userContext;
|
|
@@ -81,10 +78,7 @@ var insertTaskDecisionAction = exports.insertTaskDecisionAction = function inser
|
|
|
81
78
|
var addItem = arguments.length > 3 ? arguments[3] : undefined;
|
|
82
79
|
var listLocalId = arguments.length > 4 ? arguments[4] : undefined;
|
|
83
80
|
var itemLocalId = arguments.length > 5 ? arguments[5] : undefined;
|
|
84
|
-
var itemAttrs
|
|
85
|
-
// Ignored via go/ees005
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
87
|
-
= arguments.length > 6 ? arguments[6] : undefined;
|
|
81
|
+
var itemAttrs = arguments.length > 6 ? arguments[6] : undefined;
|
|
88
82
|
var schema = state.schema;
|
|
89
83
|
var addAndCreateList = function addAndCreateList(_ref) {
|
|
90
84
|
var tr = _ref.tr,
|
|
@@ -123,10 +117,7 @@ var insertTaskDecisionCommand = exports.insertTaskDecisionCommand = function ins
|
|
|
123
117
|
var inputMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
124
118
|
var addItem = arguments.length > 2 ? arguments[2] : undefined;
|
|
125
119
|
var listLocalId = arguments.length > 3 ? arguments[3] : undefined;
|
|
126
|
-
var itemLocalId
|
|
127
|
-
// Ignored via go/ees005
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
129
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
120
|
+
var itemLocalId = arguments.length > 4 ? arguments[4] : undefined;
|
|
130
121
|
return function (state, dispatch) {
|
|
131
122
|
var tr = insertTaskDecisionAction(editorAnalyticsAPI, getContextIdentifierProvider)(state, listType, inputMethod, addItem, listLocalId, itemLocalId);
|
|
132
123
|
if (dispatch) {
|
|
@@ -137,10 +128,7 @@ var insertTaskDecisionCommand = exports.insertTaskDecisionCommand = function ins
|
|
|
137
128
|
};
|
|
138
129
|
};
|
|
139
130
|
var insertTaskDecisionWithAnalytics = exports.insertTaskDecisionWithAnalytics = function insertTaskDecisionWithAnalytics(editorAnalyticsAPI, getContextIdentifierProvider) {
|
|
140
|
-
return function (state, listType, inputMethod, addAndCreateList, addToList, listLocalId, itemLocalId, itemAttrs
|
|
141
|
-
// Ignored via go/ees005
|
|
142
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
143
|
-
) {
|
|
131
|
+
return function (state, listType, inputMethod, addAndCreateList, addToList, listLocalId, itemLocalId, itemAttrs) {
|
|
144
132
|
var schema = state.schema;
|
|
145
133
|
var _getListTypes = getListTypes(listType, schema),
|
|
146
134
|
list = _getListTypes.list,
|
|
@@ -201,10 +189,7 @@ var changeInDepth = exports.changeInDepth = function changeInDepth(before, after
|
|
|
201
189
|
var createListAtSelection = exports.createListAtSelection = function createListAtSelection(tr, list, item, schema, state) {
|
|
202
190
|
var listLocalId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _adfSchema.uuid.generate();
|
|
203
191
|
var itemLocalId = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : _adfSchema.uuid.generate();
|
|
204
|
-
var itemAttrs
|
|
205
|
-
// Ignored via go/ees005
|
|
206
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
207
|
-
= arguments.length > 7 ? arguments[7] : undefined;
|
|
192
|
+
var itemAttrs = arguments.length > 7 ? arguments[7] : undefined;
|
|
208
193
|
var selection = state.selection;
|
|
209
194
|
var $from = selection.$from,
|
|
210
195
|
$to = selection.$to;
|
|
@@ -254,10 +254,7 @@ var processNestedActionItem = function processNestedActionItem(tr, $from, previo
|
|
|
254
254
|
var stableResolvedPos = tr.doc.resolve(previousListItemPos);
|
|
255
255
|
tr.setSelection(_state.TextSelection.create(tr.doc, stableResolvedPos.after() + 2));
|
|
256
256
|
};
|
|
257
|
-
var splitListItemWith = function splitListItemWith(tr, content, $from, setSelection
|
|
258
|
-
// Ignored via go/ees005
|
|
259
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
260
|
-
) {
|
|
257
|
+
var splitListItemWith = function splitListItemWith(tr, content, $from, setSelection) {
|
|
261
258
|
var _frag$firstChild;
|
|
262
259
|
var origDoc = tr.doc;
|
|
263
260
|
|
|
@@ -405,9 +402,6 @@ var cmdOptEnter = (0, _utils.filterCommand)(_helpers.isInsideTaskOrDecisionItem,
|
|
|
405
402
|
}
|
|
406
403
|
return true;
|
|
407
404
|
});
|
|
408
|
-
|
|
409
|
-
// Ignored via go/ees005
|
|
410
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
411
405
|
function keymapPlugin(schema, api, allowNestedTasks, consumeTabs) {
|
|
412
406
|
var _api$analytics3, _api$analytics4;
|
|
413
407
|
var getContextIdentifier = function getContextIdentifier() {
|
|
@@ -31,9 +31,6 @@ function nodesBetweenChanged(tr, f, startPos) {
|
|
|
31
31
|
}
|
|
32
32
|
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
// Ignored via go/ees005
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
37
34
|
function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispatch, api) {
|
|
38
35
|
var useLongPressSelection = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
39
36
|
var hasEditPermission = arguments.length > 6 ? arguments[6] : undefined;
|
|
@@ -46,8 +43,6 @@ function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispa
|
|
|
46
43
|
taskItem: (0, _taskLazyNodeView.lazyTaskView)(portalProviderAPI, eventDispatcher, providerFactory, api, taskPlaceholder),
|
|
47
44
|
decisionItem: (0, _decisionLazyNodeView.lazyDecisionView)(portalProviderAPI, eventDispatcher, api)
|
|
48
45
|
},
|
|
49
|
-
// Ignored via go/ees005
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
51
46
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
52
47
|
// When a decision item is selected and the user starts typing, the entire node
|
|
53
48
|
// should be replaced with what was just typed. This custom text input handler
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { taskItemNodeViewFactory } from './taskItem';
|
|
4
|
-
export const lazyTaskView = (portalProviderAPI, eventDispatcher, providerFactory, api, placeholder
|
|
5
|
-
// Ignored via go/ees005
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
-
) => {
|
|
4
|
+
export const lazyTaskView = (portalProviderAPI, eventDispatcher, providerFactory, api, placeholder) => {
|
|
8
5
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
9
6
|
return taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder);
|
|
10
7
|
}
|
|
@@ -368,9 +368,6 @@ class Task extends ReactNodeView {
|
|
|
368
368
|
return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
|
|
372
|
-
// Ignored via go/ees005
|
|
373
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
374
371
|
export function taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder) {
|
|
375
372
|
return (node, view, getPos) => {
|
|
376
373
|
return new Task(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -241,8 +241,6 @@ export function getAllTaskItemsDataInRootTaskList(view) {
|
|
|
241
241
|
const rootTaskList = rootTaskListData.node;
|
|
242
242
|
const rootTaskListStartPos = rootTaskListData.start;
|
|
243
243
|
const allTaskItems = [];
|
|
244
|
-
// Ignored via go/ees005
|
|
245
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
246
244
|
rootTaskList.descendants((node, pos, parent, index) => {
|
|
247
245
|
if (node.type === taskItem) {
|
|
248
246
|
allTaskItems.push({
|
|
@@ -6,10 +6,7 @@ import { canInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
|
6
6
|
import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
7
7
|
import { changeInDepth, getListTypes, insertTaskDecisionAction } from './insert-commands';
|
|
8
8
|
const createListRule = (editorAnalyticsAPI, getContextIdentifierProvider) => (regex, listType, itemAttrs) => {
|
|
9
|
-
return createRule(regex,
|
|
10
|
-
// Ignored via go/ees005
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
12
|
-
(state, _match, start, end) => {
|
|
9
|
+
return createRule(regex, (state, _match, start, end) => {
|
|
13
10
|
const {
|
|
14
11
|
paragraph
|
|
15
12
|
} = state.schema.nodes;
|
|
@@ -31,10 +28,7 @@ const isCursorInsideList = $pos => {
|
|
|
31
28
|
var _$pos$node;
|
|
32
29
|
return ((_$pos$node = $pos.node($pos.depth - 1)) === null || _$pos$node === void 0 ? void 0 : _$pos$node.type.name) === 'listItem';
|
|
33
30
|
};
|
|
34
|
-
const processShortcutForNestedTask = (content, $from, tr, list, item, listLocalId, itemLocalId, itemAttrs
|
|
35
|
-
// Ignored via go/ees005
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
37
|
-
) => {
|
|
31
|
+
const processShortcutForNestedTask = (content, $from, tr, list, item, listLocalId, itemLocalId, itemAttrs) => {
|
|
38
32
|
//Extracting the content into the 'contentWithoutShortcut' from 'content' after removing the keyboard shortcut text, i.e., '[] '.
|
|
39
33
|
const contentWithoutShortcut = content.cut($from.pos - $from.start(), content.size);
|
|
40
34
|
tr.insert($from.after(), list.create({
|
|
@@ -20,10 +20,7 @@ const getContextData = (contextProvider = {}) => {
|
|
|
20
20
|
userContext
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
const generateAnalyticsPayload = (listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx, listSize
|
|
24
|
-
// Ignored via go/ees005
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
26
|
-
) => {
|
|
23
|
+
const generateAnalyticsPayload = (listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx, listSize) => {
|
|
27
24
|
let containerId;
|
|
28
25
|
let objectId;
|
|
29
26
|
let userContext;
|
|
@@ -69,10 +66,7 @@ export const getListTypes = (listType, schema) => {
|
|
|
69
66
|
item: decisionItem
|
|
70
67
|
};
|
|
71
68
|
};
|
|
72
|
-
export const insertTaskDecisionAction = (editorAnalyticsAPI, getContextIdentifierProvider) => (state, listType, inputMethod = INPUT_METHOD.TOOLBAR, addItem, listLocalId, itemLocalId, itemAttrs
|
|
73
|
-
// Ignored via go/ees005
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
75
|
-
) => {
|
|
69
|
+
export const insertTaskDecisionAction = (editorAnalyticsAPI, getContextIdentifierProvider) => (state, listType, inputMethod = INPUT_METHOD.TOOLBAR, addItem, listLocalId, itemLocalId, itemAttrs) => {
|
|
76
70
|
const {
|
|
77
71
|
schema
|
|
78
72
|
} = state;
|
|
@@ -109,20 +103,14 @@ export const insertTaskDecisionAction = (editorAnalyticsAPI, getContextIdentifie
|
|
|
109
103
|
autoJoinTr(tr, ['taskList', 'decisionList']);
|
|
110
104
|
return tr;
|
|
111
105
|
};
|
|
112
|
-
export const insertTaskDecisionCommand = (editorAnalyticsAPI, getContextIdentifierProvider) => (listType, inputMethod = INPUT_METHOD.TOOLBAR, addItem, listLocalId, itemLocalId
|
|
113
|
-
// Ignored via go/ees005
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
115
|
-
) => (state, dispatch) => {
|
|
106
|
+
export const insertTaskDecisionCommand = (editorAnalyticsAPI, getContextIdentifierProvider) => (listType, inputMethod = INPUT_METHOD.TOOLBAR, addItem, listLocalId, itemLocalId) => (state, dispatch) => {
|
|
116
107
|
const tr = insertTaskDecisionAction(editorAnalyticsAPI, getContextIdentifierProvider)(state, listType, inputMethod, addItem, listLocalId, itemLocalId);
|
|
117
108
|
if (dispatch) {
|
|
118
109
|
dispatch(tr);
|
|
119
110
|
}
|
|
120
111
|
return true;
|
|
121
112
|
};
|
|
122
|
-
export const insertTaskDecisionWithAnalytics = (editorAnalyticsAPI, getContextIdentifierProvider) => (state, listType, inputMethod, addAndCreateList, addToList, listLocalId, itemLocalId, itemAttrs
|
|
123
|
-
// Ignored via go/ees005
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
125
|
-
) => {
|
|
113
|
+
export const insertTaskDecisionWithAnalytics = (editorAnalyticsAPI, getContextIdentifierProvider) => (state, listType, inputMethod, addAndCreateList, addToList, listLocalId, itemLocalId, itemAttrs) => {
|
|
126
114
|
const {
|
|
127
115
|
schema
|
|
128
116
|
} = state;
|
|
@@ -185,10 +173,7 @@ export const isSupportedSourceNode = (schema, selection) => {
|
|
|
185
173
|
return hasParentNodeOfType([blockquote, paragraph, decisionList, taskList])(selection) && !hasParentNodeOfType([bulletList, numberedList])(selection);
|
|
186
174
|
};
|
|
187
175
|
export const changeInDepth = (before, after) => after.depth - before.depth;
|
|
188
|
-
export const createListAtSelection = (tr, list, item, schema, state, listLocalId = uuid.generate(), itemLocalId = uuid.generate(), itemAttrs
|
|
189
|
-
// Ignored via go/ees005
|
|
190
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
191
|
-
) => {
|
|
176
|
+
export const createListAtSelection = (tr, list, item, schema, state, listLocalId = uuid.generate(), itemLocalId = uuid.generate(), itemAttrs) => {
|
|
192
177
|
const {
|
|
193
178
|
selection
|
|
194
179
|
} = state;
|
|
@@ -229,10 +229,7 @@ const processNestedActionItem = (tr, $from, previousListItemPos) => {
|
|
|
229
229
|
const stableResolvedPos = tr.doc.resolve(previousListItemPos);
|
|
230
230
|
tr.setSelection(TextSelection.create(tr.doc, stableResolvedPos.after() + 2));
|
|
231
231
|
};
|
|
232
|
-
const splitListItemWith = (tr, content, $from, setSelection
|
|
233
|
-
// Ignored via go/ees005
|
|
234
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
235
|
-
) => {
|
|
232
|
+
const splitListItemWith = (tr, content, $from, setSelection) => {
|
|
236
233
|
var _frag$firstChild;
|
|
237
234
|
const origDoc = tr.doc;
|
|
238
235
|
|
|
@@ -403,9 +400,6 @@ const cmdOptEnter = filter(isInsideTaskOrDecisionItem, (state, dispatch) => {
|
|
|
403
400
|
}
|
|
404
401
|
return true;
|
|
405
402
|
});
|
|
406
|
-
|
|
407
|
-
// Ignored via go/ees005
|
|
408
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
409
403
|
export function keymapPlugin(schema, api, allowNestedTasks, consumeTabs) {
|
|
410
404
|
var _api$analytics3, _api$analytics4;
|
|
411
405
|
const getContextIdentifier = () => {
|
|
@@ -19,9 +19,6 @@ function nodesBetweenChanged(tr, f, startPos) {
|
|
|
19
19
|
}
|
|
20
20
|
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
// Ignored via go/ees005
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
25
22
|
export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispatch, api, useLongPressSelection = false, hasEditPermission, hasRequestedEditPermission, requestToEditContent, taskPlaceholder) {
|
|
26
23
|
return new SafePlugin({
|
|
27
24
|
props: {
|
|
@@ -29,8 +26,6 @@ export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory
|
|
|
29
26
|
taskItem: lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api, taskPlaceholder),
|
|
30
27
|
decisionItem: lazyDecisionView(portalProviderAPI, eventDispatcher, api)
|
|
31
28
|
},
|
|
32
|
-
// Ignored via go/ees005
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
34
29
|
handleTextInput(view, from, to, text) {
|
|
35
30
|
// When a decision item is selected and the user starts typing, the entire node
|
|
36
31
|
// should be replaced with what was just typed. This custom text input handler
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { withLazyLoading } from '@atlaskit/editor-common/lazy-node-view';
|
|
2
2
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
3
|
import { taskItemNodeViewFactory } from './taskItem';
|
|
4
|
-
export var lazyTaskView = function lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder
|
|
5
|
-
// Ignored via go/ees005
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
7
|
-
) {
|
|
4
|
+
export var lazyTaskView = function lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder) {
|
|
8
5
|
if (editorExperiment('platform_editor_exp_lazy_node_views', false)) {
|
|
9
6
|
return taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder);
|
|
10
7
|
}
|
|
@@ -402,8 +402,7 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
402
402
|
return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
|
|
403
403
|
}
|
|
404
404
|
}]);
|
|
405
|
-
}(ReactNodeView);
|
|
406
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
405
|
+
}(ReactNodeView);
|
|
407
406
|
export function taskItemNodeViewFactory(portalProviderAPI, eventDispatcher, providerFactory, api, placeholder) {
|
|
408
407
|
return function (node, view, getPos) {
|
|
409
408
|
return new Task(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -220,8 +220,6 @@ export function getAllTaskItemsDataInRootTaskList(view) {
|
|
|
220
220
|
var rootTaskList = rootTaskListData.node;
|
|
221
221
|
var rootTaskListStartPos = rootTaskListData.start;
|
|
222
222
|
var allTaskItems = [];
|
|
223
|
-
// Ignored via go/ees005
|
|
224
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
225
223
|
rootTaskList.descendants(function (node, pos, parent, index) {
|
|
226
224
|
if (node.type === taskItem) {
|
|
227
225
|
allTaskItems.push({
|
|
@@ -10,10 +10,7 @@ import { createPlugin, leafNodeReplacementCharacter } from '@atlaskit/prosemirro
|
|
|
10
10
|
import { changeInDepth, getListTypes, insertTaskDecisionAction } from './insert-commands';
|
|
11
11
|
var createListRule = function createListRule(editorAnalyticsAPI, getContextIdentifierProvider) {
|
|
12
12
|
return function (regex, listType, itemAttrs) {
|
|
13
|
-
return createRule(regex,
|
|
14
|
-
// Ignored via go/ees005
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
16
|
-
function (state, _match, start, end) {
|
|
13
|
+
return createRule(regex, function (state, _match, start, end) {
|
|
17
14
|
var paragraph = state.schema.nodes.paragraph;
|
|
18
15
|
var _getListTypes = getListTypes(listType, state.schema),
|
|
19
16
|
list = _getListTypes.list;
|
|
@@ -33,10 +30,7 @@ var isCursorInsideList = function isCursorInsideList($pos) {
|
|
|
33
30
|
var _$pos$node;
|
|
34
31
|
return ((_$pos$node = $pos.node($pos.depth - 1)) === null || _$pos$node === void 0 ? void 0 : _$pos$node.type.name) === 'listItem';
|
|
35
32
|
};
|
|
36
|
-
var processShortcutForNestedTask = function processShortcutForNestedTask(content, $from, tr, list, item, listLocalId, itemLocalId, itemAttrs
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
39
|
-
) {
|
|
33
|
+
var processShortcutForNestedTask = function processShortcutForNestedTask(content, $from, tr, list, item, listLocalId, itemLocalId, itemAttrs) {
|
|
40
34
|
//Extracting the content into the 'contentWithoutShortcut' from 'content' after removing the keyboard shortcut text, i.e., '[] '.
|
|
41
35
|
var contentWithoutShortcut = content.cut($from.pos - $from.start(), content.size);
|
|
42
36
|
tr.insert($from.after(), list.create({
|
|
@@ -22,10 +22,7 @@ var getContextData = function getContextData() {
|
|
|
22
22
|
userContext: userContext
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
var generateAnalyticsPayload = function generateAnalyticsPayload(listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx, listSize
|
|
26
|
-
// Ignored via go/ees005
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
28
|
-
) {
|
|
25
|
+
var generateAnalyticsPayload = function generateAnalyticsPayload(listType, contextData, inputMethod, itemLocalId, listLocalId, itemIdx, listSize) {
|
|
29
26
|
var containerId;
|
|
30
27
|
var objectId;
|
|
31
28
|
var userContext;
|
|
@@ -74,10 +71,7 @@ export var insertTaskDecisionAction = function insertTaskDecisionAction(editorAn
|
|
|
74
71
|
var addItem = arguments.length > 3 ? arguments[3] : undefined;
|
|
75
72
|
var listLocalId = arguments.length > 4 ? arguments[4] : undefined;
|
|
76
73
|
var itemLocalId = arguments.length > 5 ? arguments[5] : undefined;
|
|
77
|
-
var itemAttrs
|
|
78
|
-
// Ignored via go/ees005
|
|
79
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
80
|
-
= arguments.length > 6 ? arguments[6] : undefined;
|
|
74
|
+
var itemAttrs = arguments.length > 6 ? arguments[6] : undefined;
|
|
81
75
|
var schema = state.schema;
|
|
82
76
|
var addAndCreateList = function addAndCreateList(_ref) {
|
|
83
77
|
var tr = _ref.tr,
|
|
@@ -116,10 +110,7 @@ export var insertTaskDecisionCommand = function insertTaskDecisionCommand(editor
|
|
|
116
110
|
var inputMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INPUT_METHOD.TOOLBAR;
|
|
117
111
|
var addItem = arguments.length > 2 ? arguments[2] : undefined;
|
|
118
112
|
var listLocalId = arguments.length > 3 ? arguments[3] : undefined;
|
|
119
|
-
var itemLocalId
|
|
120
|
-
// Ignored via go/ees005
|
|
121
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
122
|
-
= arguments.length > 4 ? arguments[4] : undefined;
|
|
113
|
+
var itemLocalId = arguments.length > 4 ? arguments[4] : undefined;
|
|
123
114
|
return function (state, dispatch) {
|
|
124
115
|
var tr = insertTaskDecisionAction(editorAnalyticsAPI, getContextIdentifierProvider)(state, listType, inputMethod, addItem, listLocalId, itemLocalId);
|
|
125
116
|
if (dispatch) {
|
|
@@ -130,10 +121,7 @@ export var insertTaskDecisionCommand = function insertTaskDecisionCommand(editor
|
|
|
130
121
|
};
|
|
131
122
|
};
|
|
132
123
|
export var insertTaskDecisionWithAnalytics = function insertTaskDecisionWithAnalytics(editorAnalyticsAPI, getContextIdentifierProvider) {
|
|
133
|
-
return function (state, listType, inputMethod, addAndCreateList, addToList, listLocalId, itemLocalId, itemAttrs
|
|
134
|
-
// Ignored via go/ees005
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
136
|
-
) {
|
|
124
|
+
return function (state, listType, inputMethod, addAndCreateList, addToList, listLocalId, itemLocalId, itemAttrs) {
|
|
137
125
|
var schema = state.schema;
|
|
138
126
|
var _getListTypes = getListTypes(listType, schema),
|
|
139
127
|
list = _getListTypes.list,
|
|
@@ -194,10 +182,7 @@ export var changeInDepth = function changeInDepth(before, after) {
|
|
|
194
182
|
export var createListAtSelection = function createListAtSelection(tr, list, item, schema, state) {
|
|
195
183
|
var listLocalId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : uuid.generate();
|
|
196
184
|
var itemLocalId = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : uuid.generate();
|
|
197
|
-
var itemAttrs
|
|
198
|
-
// Ignored via go/ees005
|
|
199
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
200
|
-
= arguments.length > 7 ? arguments[7] : undefined;
|
|
185
|
+
var itemAttrs = arguments.length > 7 ? arguments[7] : undefined;
|
|
201
186
|
var selection = state.selection;
|
|
202
187
|
var $from = selection.$from,
|
|
203
188
|
$to = selection.$to;
|
|
@@ -246,10 +246,7 @@ var processNestedActionItem = function processNestedActionItem(tr, $from, previo
|
|
|
246
246
|
var stableResolvedPos = tr.doc.resolve(previousListItemPos);
|
|
247
247
|
tr.setSelection(TextSelection.create(tr.doc, stableResolvedPos.after() + 2));
|
|
248
248
|
};
|
|
249
|
-
var splitListItemWith = function splitListItemWith(tr, content, $from, setSelection
|
|
250
|
-
// Ignored via go/ees005
|
|
251
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
252
|
-
) {
|
|
249
|
+
var splitListItemWith = function splitListItemWith(tr, content, $from, setSelection) {
|
|
253
250
|
var _frag$firstChild;
|
|
254
251
|
var origDoc = tr.doc;
|
|
255
252
|
|
|
@@ -397,9 +394,6 @@ var cmdOptEnter = filter(isInsideTaskOrDecisionItem, function (state, dispatch)
|
|
|
397
394
|
}
|
|
398
395
|
return true;
|
|
399
396
|
});
|
|
400
|
-
|
|
401
|
-
// Ignored via go/ees005
|
|
402
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
403
397
|
export function keymapPlugin(schema, api, allowNestedTasks, consumeTabs) {
|
|
404
398
|
var _api$analytics3, _api$analytics4;
|
|
405
399
|
var getContextIdentifier = function getContextIdentifier() {
|
|
@@ -24,9 +24,6 @@ function nodesBetweenChanged(tr, f, startPos) {
|
|
|
24
24
|
}
|
|
25
25
|
tr.doc.nodesBetween(stepRange.from, stepRange.to, f, startPos);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
// Ignored via go/ees005
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
30
27
|
export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispatch, api) {
|
|
31
28
|
var useLongPressSelection = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
32
29
|
var hasEditPermission = arguments.length > 6 ? arguments[6] : undefined;
|
|
@@ -39,8 +36,6 @@ export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory
|
|
|
39
36
|
taskItem: lazyTaskView(portalProviderAPI, eventDispatcher, providerFactory, api, taskPlaceholder),
|
|
40
37
|
decisionItem: lazyDecisionView(portalProviderAPI, eventDispatcher, api)
|
|
41
38
|
},
|
|
42
|
-
// Ignored via go/ees005
|
|
43
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
44
39
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
45
40
|
// When a decision item is selected and the user starts typing, the entire node
|
|
46
41
|
// should be replaced with what was just typed. This custom text input handler
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-tasks-and-decisions",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.41",
|
|
4
4
|
"description": "Tasks and decisions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
35
|
"@atlaskit/analytics-namespaced-context": "^6.12.0",
|
|
36
36
|
"@atlaskit/analytics-next": "^10.2.0",
|
|
37
|
-
"@atlaskit/editor-common": "^99.
|
|
38
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
37
|
+
"@atlaskit/editor-common": "^99.5.0",
|
|
38
|
+
"@atlaskit/editor-plugin-analytics": "^1.11.0",
|
|
39
39
|
"@atlaskit/editor-plugin-context-identifier": "^1.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-viewmode": "2.1.16",
|
|
41
41
|
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
43
|
-
"@atlaskit/heading": "4.0.
|
|
43
|
+
"@atlaskit/heading": "4.0.2",
|
|
44
44
|
"@atlaskit/icon": "23.4.1",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
46
46
|
"@atlaskit/popup": "1.30.6",
|
|
47
47
|
"@atlaskit/primitives": "13.3.8",
|
|
48
48
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
|
49
49
|
"@atlaskit/task-decision": "^17.11.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
51
|
-
"@atlaskit/tokens": "3.
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^2.41.0",
|
|
51
|
+
"@atlaskit/tokens": "3.2.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1"
|
|
54
54
|
},
|