@atlaskit/editor-plugin-tasks-and-decisions 21.0.11 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,14 +6,12 @@ import { getStepRange } from '@atlaskit/editor-common/utils';
6
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
9
  import { DecisionItemNodeView } from '../nodeviews/DecisionItemNodeView';
11
10
  import { taskView } from '../nodeviews/task-node-view';
12
11
  import { focusTaskDecision, openRequestEditPopup, setProvider } from './actions';
13
12
  import { focusCheckbox, focusCheckboxAndUpdateSelection, getTaskItemDataAtPos, getTaskItemDataToFocus, isInsideTask, removeCheckboxFocus } from './helpers';
14
13
  import { stateKey } from './plugin-key';
15
14
  import { taskItemOnChange } from './taskItemOnChange';
16
- import { applyTaskListNormalisationFixes } from './transforms';
17
15
  import { ACTIONS } from './types';
18
16
  import { tempTransformSliceToRemoveBlockTaskItem } from './utils/paste';
19
17
  function nodesBetweenChanged(tr, f, startPos) {
@@ -266,22 +264,6 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
266
264
  * Note: we currently do not handle the edge case where two nodes may have the same localId
267
265
  */
268
266
  appendTransaction: (transactions, _oldState, newState) => {
269
- // Normalise taskList structure first — runs on its own transaction (without addToHistory: false)
270
- // so it is included in history and correctly undone with the triggering operation.
271
- if (expValEqualsNoExposure('platform_editor_flexible_list_schema', 'isEnabled', true) && transactions.some(t => t.docChanged)) {
272
- const normTr = applyTaskListNormalisationFixes({
273
- tr: newState.tr,
274
- transactions,
275
- doc: newState.doc,
276
- schema: newState.schema
277
- });
278
- if (normTr.docChanged) {
279
- // Return the normalisation transaction — the next appendTransaction call will
280
- // assign any missing localIds to newly inserted nodes via the localId path below.
281
- return normTr;
282
- }
283
- }
284
-
285
267
  // Assign unique localIds to any new nodes that don't have one.
286
268
  // Runs with addToHistory: false so localId assignment is not part of the undo history.
287
269
  const tr = newState.tr;
@@ -1,12 +1,9 @@
1
1
  import { uuid } from '@atlaskit/adf-schema/uuid';
2
- import { flattenList as flattenListBase } from '@atlaskit/editor-common/lists';
3
- import { fg } from '@atlaskit/platform-feature-flags/fg';
4
-
5
2
  /**
6
- * Flattens a taskList into one item per task item, recording which items the
7
- * selection touches.
3
+ * Flattens a taskList tree into an array of task items with computed depths.
4
+ * Only selected items have their depth adjusted by indentDelta.
8
5
  */
9
- function flattenTaskListImpl(options) {
6
+ export function flattenTaskList(options) {
10
7
  const {
11
8
  doc,
12
9
  rootListStart,
@@ -66,32 +63,6 @@ function flattenTaskListImpl(options) {
66
63
  };
67
64
  }
68
65
 
69
- /**
70
- * Flattens a taskList tree into an array of task items with computed depths.
71
- * Only selected items have their depth adjusted by indentDelta.
72
- */
73
- export function flattenTaskList(options) {
74
- if (fg('platform_editor_flexible_list_normalization_fix')) {
75
- return flattenTaskListImpl(options);
76
- }
77
- const {
78
- taskList,
79
- taskItem,
80
- blockTaskItem
81
- } = options.doc.type.schema.nodes;
82
- return flattenListBase(options, {
83
- isContentNode: (node, parent) => {
84
- const isTaskItemType = node.type === taskItem || blockTaskItem != null && node.type === blockTaskItem;
85
- return isTaskItemType && parent != null && parent.type === taskList;
86
- },
87
- getSelectionBounds: (node, pos) => ({
88
- start: pos,
89
- end: pos + node.nodeSize
90
- }),
91
- getDepth: (resolvedDepth, rootDepth) => resolvedDepth - rootDepth - 1
92
- });
93
- }
94
-
95
66
  // Each stack entry collects children for a taskList at a given depth.
96
67
  // The root entry (depth -1) is special: its children become the content
97
68
  // of the outermost taskList directly (not wrapped in another taskList).
@@ -15,9 +15,8 @@ import { IconAction, IconDecision } from '@atlaskit/editor-common/quick-insert';
15
15
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
16
16
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
17
17
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
19
18
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
20
- import { closeRequestEditPopupAt, getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
19
+ import { closeRequestEditPopupAt, getCurrentIndentLevel, isInsideTask } from './pm-plugins/helpers';
21
20
  // Ignored via go/ees005
22
21
  // eslint-disable-next-line import/no-named-as-default
23
22
  import inputRulePlugin from './pm-plugins/input-rules';
@@ -194,13 +193,11 @@ export const tasksAndDecisionsPlugin = ({
194
193
  }
195
194
  const pluginState = taskPluginKey.getState(editorState);
196
195
  const indentLevel = getCurrentIndentLevel(editorState.selection) || 0;
197
- const itemIndex = getTaskItemIndex(editorState);
198
- const isFlexibleListIndentationEnabled = expValEqualsNoExposure('platform_editor_flexible_list_indentation', 'isEnabled', true);
199
196
  return {
200
197
  focusedTaskItemLocalId: (pluginState === null || pluginState === void 0 ? void 0 : pluginState.focusedTaskItemLocalId) || null,
201
198
  isInsideTask: isInsideTask(editorState),
202
- indentDisabled: !isFlexibleListIndentationEnabled && itemIndex === 0 || indentLevel >= MAX_INDENTATION_LEVEL,
203
- outdentDisabled: isFlexibleListIndentationEnabled ? indentLevel <= 0 : indentLevel <= 1,
199
+ indentDisabled: indentLevel >= MAX_INDENTATION_LEVEL,
200
+ outdentDisabled: indentLevel <= 0,
204
201
  // hasEditPermission is assumed to be true if pluginState.hasEditPermission is undefined
205
202
  // this allows the default plugin state to initialise as true if the extra configuration is not provided
206
203
  hasEditPermission: (pluginState === null || pluginState === void 0 ? void 0 : pluginState.hasEditPermission) !== undefined ? pluginState === null || pluginState === void 0 ? void 0 : pluginState.hasEditPermission : true,
@@ -1,81 +1,9 @@
1
1
  import { findCutBefore } from '@atlaskit/editor-common/commands';
2
2
  import { getFirstParagraphBlockMarkAttrs } from '@atlaskit/editor-common/lists';
3
3
  import { isTaskList } from '@atlaskit/editor-common/transforms';
4
- import { findWrapping, ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
5
- import { getBlockRange, isActionOrDecisionItem, isActionOrDecisionList, liftBlock, subtreeHeight } from './helpers';
6
- import { findBlockTaskItem, normalizeTaskItemsSelection } from './utils';
4
+ import { ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
5
+ import { isActionOrDecisionItem, isActionOrDecisionList } from './helpers';
7
6
  import { normalizeNodeForTaskTextSize } from './utils/paste';
8
- export var liftSelection = function liftSelection(state, dispatch) {
9
- var normalizedSelection = normalizeTaskItemsSelection(state.selection);
10
- var $from = normalizedSelection.$from,
11
- $to = normalizedSelection.$to;
12
- var tr = liftBlock(state.tr, $from, $to);
13
- if (dispatch && tr) {
14
- dispatch(tr);
15
- }
16
- return !!tr;
17
- };
18
-
19
- /**
20
- * Wraps the current selection in a task list, respecting a maximum indentation depth of 6 levels.
21
- *
22
- * - Normalizes the selection to ensure it covers complete task items.
23
- * - Determines the maximum depth of task list nesting within the selection.
24
- * - If the selection is already nested at or beyond the maximum depth, the command does nothing.
25
- * - Calculates the block range to wrap, handling both regular and block task items.
26
- * - Wraps the block in a task list to increase indentation or create a new task list if necessary.
27
- *
28
- * @param state - The current editor state.
29
- * @param dispatch - The dispatch function to apply the transaction.
30
- * @returns `true` if the command was handled (even if no changes were made), otherwise `false`.
31
- * @example
32
- * ```typescript
33
- * autoJoin(wrapSelectionInTaskList, ['taskList']))(state, dispatch);
34
- * ```
35
- */
36
- export var wrapSelectionInTaskList = function wrapSelectionInTaskList(state, dispatch) {
37
- var _normalizeTaskItemsSe = normalizeTaskItemsSelection(state.selection),
38
- $from = _normalizeTaskItemsSe.$from,
39
- $to = _normalizeTaskItemsSe.$to;
40
-
41
- // limit ui indentation to 6 levels
42
- var _state$schema$nodes = state.schema.nodes,
43
- taskList = _state$schema$nodes.taskList,
44
- taskItem = _state$schema$nodes.taskItem,
45
- blockTaskItem = _state$schema$nodes.blockTaskItem;
46
- var maxDepth = subtreeHeight($from, $to, [taskList, taskItem]);
47
- if (blockTaskItem) {
48
- var resultOfFindBlockTaskItem = findBlockTaskItem($from);
49
- if (resultOfFindBlockTaskItem) {
50
- var hasParagraph = resultOfFindBlockTaskItem.hasParagraph;
51
- // If the selection is inside a nested node inside the blockTaskItem
52
- // Remove the difference in depth between the selection and the blockTaskItemNode
53
- if (hasParagraph) {
54
- maxDepth = subtreeHeight($from, $to, [taskList, blockTaskItem]) - 1;
55
- } else {
56
- maxDepth = subtreeHeight($from, $to, [taskList, blockTaskItem]);
57
- }
58
- }
59
- }
60
- if (maxDepth >= 6) {
61
- return true;
62
- }
63
- var blockRange = getBlockRange({
64
- $from: $from,
65
- $to: $to
66
- });
67
- if (!blockRange) {
68
- return true;
69
- }
70
- var wrapping = findWrapping(blockRange, state.schema.nodes.taskList);
71
- if (!wrapping) {
72
- return true;
73
- }
74
- if (dispatch) {
75
- dispatch(state.tr.wrap(blockRange, wrapping).scrollIntoView());
76
- }
77
- return true;
78
- };
79
7
 
80
8
  /**
81
9
  * Tries to move the paragraph content near the given position into the taskItem or decisionItem
@@ -195,56 +195,6 @@ export var walkOut = function walkOut($startPos) {
195
195
  return $pos;
196
196
  };
197
197
 
198
- /**
199
- * Finds the height of a tree-like structure, given any position inside it.
200
- *
201
- * Traverses from the top of the tree to all leaf nodes, and returns the length
202
- * of the longest path.
203
- *
204
- * This means you can use it with things like taskList, which
205
- * do not nest themselves inside taskItems but rather as adjacent children.
206
- *
207
- * @param $pos Any position inside the tree.
208
- * @param types The node types to consider traversable
209
- */
210
- export var subtreeHeight = function subtreeHeight($from, $to, types) {
211
- var root = findFarthestParentNode(function (node) {
212
- return types.indexOf(node.type) > -1;
213
- })($from);
214
- if (!root) {
215
- return -1;
216
- }
217
-
218
- // get the height between the root and the current position
219
- var distToParent = $from.depth - root.depth;
220
-
221
- // include any following taskList since nested lists appear
222
- // as siblings
223
- //
224
- // this is unlike regular bullet lists where the orderedList
225
- // appears as descendent of listItem
226
- var blockRange = getBlockRange({
227
- $from: $from,
228
- $to: $to
229
- });
230
- if (!blockRange) {
231
- return -1;
232
- }
233
-
234
- // and get the max height from the current position to the
235
- // deepest leaf node
236
- var maxChildDepth = $from.depth;
237
- $from.doc.nodesBetween(blockRange.start, blockRange.end, function (descendent, relPos, _parent) {
238
- maxChildDepth = Math.max($from.doc.resolve(relPos).depth, maxChildDepth);
239
-
240
- // keep descending down the tree if we can
241
- if (types.indexOf(descendent.type) > -1) {
242
- return true;
243
- }
244
- });
245
- return distToParent + (maxChildDepth - $from.depth);
246
- };
247
-
248
198
  /**
249
199
  * Determines if the current selection is inside an empty taskItem, decisionItem, or blockTaskItem.
250
200
  *
@@ -14,9 +14,8 @@ import { keymap } from '@atlaskit/editor-prosemirror/keymap';
14
14
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
15
15
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
16
16
  import { findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
17
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
17
  import { moveSelectedTaskListItems } from './actions/move-selected-task-list-items';
19
- import { joinAtCut, liftSelection, wrapSelectionInTaskList } from './commands';
18
+ import { joinAtCut } from './commands';
20
19
  import { findFirstParentListNode, getBlockRange, getCurrentIndentLevel, getTaskItemIndex, isActionOrDecisionItem, isActionOrDecisionList, isEmptyTaskDecision, isInFirstTextblockOfBlockTaskItem, isInLastTextblockOfBlockTaskItem, isInsideDecision, isInsideTask, isInsideTaskOrDecisionItem, isTable, liftBlock, walkOut } from './helpers';
21
20
  import { insertTaskDecisionWithAnalytics } from './insert-commands';
22
21
  import { toggleTaskList } from './toggle-tasklist-commands';
@@ -100,24 +99,18 @@ export var getUnindentCommand = function getUnindentCommand(editorAnalyticsAPI)
100
99
  return filter(isInsideTask, function (state, dispatch) {
101
100
  var normalizedSelection = normalizeTaskItemsSelection(state.selection);
102
101
  var curIndentLevel = getCurrentIndentLevel(normalizedSelection);
103
- if (expValEquals('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
104
- if (!curIndentLevel) {
105
- return true;
106
- }
107
- var outdentTr = moveSelectedTaskListItems(state.tr, -1);
108
- if (outdentTr) {
109
- withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.OUTDENT, inputMethod))(function (_state, d) {
110
- d === null || d === void 0 || d(outdentTr);
111
- return true;
112
- })(state, dispatch);
113
- return true;
114
- }
115
- return false;
102
+ if (!curIndentLevel) {
103
+ return true;
116
104
  }
117
- if (!curIndentLevel || curIndentLevel === 1) {
118
- return false;
105
+ var outdentTr = moveSelectedTaskListItems(state.tr, -1);
106
+ if (outdentTr) {
107
+ withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.OUTDENT, inputMethod))(function (_state, d) {
108
+ d === null || d === void 0 || d(outdentTr);
109
+ return true;
110
+ })(state, dispatch);
111
+ return true;
119
112
  }
120
- return withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.OUTDENT, inputMethod))(autoJoin(liftSelection, ['taskList']))(state, dispatch);
113
+ return false;
121
114
  });
122
115
  };
123
116
  };
@@ -144,24 +137,18 @@ export var getIndentCommand = function getIndentCommand(editorAnalyticsAPI) {
144
137
  return filter(isInsideTask, function (state, dispatch) {
145
138
  var normalizedSelection = normalizeTaskItemsSelection(state.selection);
146
139
  var curIndentLevel = getCurrentIndentLevel(normalizedSelection);
147
- if (expValEquals('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
148
- if (!curIndentLevel) {
149
- return true;
150
- }
151
- var indentTr = moveSelectedTaskListItems(state.tr, 1);
152
- if (indentTr) {
153
- withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.INDENT, inputMethod))(function (_state, d) {
154
- d === null || d === void 0 || d(indentTr);
155
- return true;
156
- })(state, dispatch);
157
- return true;
158
- }
159
- return false;
140
+ if (!curIndentLevel) {
141
+ return true;
160
142
  }
161
- if (!curIndentLevel || curIndentLevel >= 6) {
143
+ var indentTr = moveSelectedTaskListItems(state.tr, 1);
144
+ if (indentTr) {
145
+ withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.INDENT, inputMethod))(function (_state, d) {
146
+ d === null || d === void 0 || d(indentTr);
147
+ return true;
148
+ })(state, dispatch);
162
149
  return true;
163
150
  }
164
- return withAnalytics(editorAnalyticsAPI, indentationAnalytics(curIndentLevel, INDENT_DIRECTION.INDENT, inputMethod))(autoJoin(wrapSelectionInTaskList, ['taskList']))(state, dispatch);
151
+ return false;
165
152
  });
166
153
  };
167
154
  };
@@ -599,13 +586,12 @@ var enter = function enter(editorAnalyticsAPI, getContextIdentifier) {
599
586
  tr.insert(insertPos, newTask);
600
587
  // Place cursor on the newly inserted empty task item above
601
588
  // when nested inside another taskList.
602
- if (expValEquals('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
603
- var taskListType = schema.nodes.taskList;
604
- var parentTaskList = $from.node($from.depth - 1);
605
- var grandparent = $from.depth >= 3 ? $from.node($from.depth - 2) : null;
606
- if ((parentTaskList === null || parentTaskList === void 0 ? void 0 : parentTaskList.type) === taskListType && (grandparent === null || grandparent === void 0 ? void 0 : grandparent.type) === taskListType) {
607
- tr.setSelection(TextSelection.create(tr.doc, insertPos + 1));
608
- }
589
+
590
+ var taskListType = schema.nodes.taskList;
591
+ var parentTaskList = $from.node($from.depth - 1);
592
+ var grandparent = $from.depth >= 3 ? $from.node($from.depth - 2) : null;
593
+ if ((parentTaskList === null || parentTaskList === void 0 ? void 0 : parentTaskList.type) === taskListType && (grandparent === null || grandparent === void 0 ? void 0 : grandparent.type) === taskListType) {
594
+ tr.setSelection(TextSelection.create(tr.doc, insertPos + 1));
609
595
  }
610
596
  return tr;
611
597
  }
@@ -11,14 +11,12 @@ import { getStepRange } from '@atlaskit/editor-common/utils';
11
11
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
13
13
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
15
14
  import { DecisionItemNodeView } from '../nodeviews/DecisionItemNodeView';
16
15
  import { taskView } from '../nodeviews/task-node-view';
17
16
  import { focusTaskDecision, openRequestEditPopup, setProvider } from './actions';
18
17
  import { focusCheckbox, focusCheckboxAndUpdateSelection, getTaskItemDataAtPos, getTaskItemDataToFocus, isInsideTask, removeCheckboxFocus } from './helpers';
19
18
  import { stateKey } from './plugin-key';
20
19
  import { taskItemOnChange } from './taskItemOnChange';
21
- import { applyTaskListNormalisationFixes } from './transforms';
22
20
  import { ACTIONS } from './types';
23
21
  import { tempTransformSliceToRemoveBlockTaskItem } from './utils/paste';
24
22
  function nodesBetweenChanged(tr, f, startPos) {
@@ -263,24 +261,6 @@ export function createPlugin(portalProviderAPI, eventDispatcher, dispatch, api,
263
261
  * Note: we currently do not handle the edge case where two nodes may have the same localId
264
262
  */
265
263
  appendTransaction: function appendTransaction(transactions, _oldState, newState) {
266
- // Normalise taskList structure first — runs on its own transaction (without addToHistory: false)
267
- // so it is included in history and correctly undone with the triggering operation.
268
- if (expValEqualsNoExposure('platform_editor_flexible_list_schema', 'isEnabled', true) && transactions.some(function (t) {
269
- return t.docChanged;
270
- })) {
271
- var normTr = applyTaskListNormalisationFixes({
272
- tr: newState.tr,
273
- transactions: transactions,
274
- doc: newState.doc,
275
- schema: newState.schema
276
- });
277
- if (normTr.docChanged) {
278
- // Return the normalisation transaction — the next appendTransaction call will
279
- // assign any missing localIds to newly inserted nodes via the localId path below.
280
- return normTr;
281
- }
282
- }
283
-
284
264
  // Assign unique localIds to any new nodes that don't have one.
285
265
  // Runs with addToHistory: false so localId assignment is not part of the undo history.
286
266
  var tr = newState.tr;
@@ -2,14 +2,11 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
2
2
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3
3
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4
4
  import { uuid } from '@atlaskit/adf-schema/uuid';
5
- import { flattenList as flattenListBase } from '@atlaskit/editor-common/lists';
6
- import { fg } from '@atlaskit/platform-feature-flags/fg';
7
-
8
5
  /**
9
- * Flattens a taskList into one item per task item, recording which items the
10
- * selection touches.
6
+ * Flattens a taskList tree into an array of task items with computed depths.
7
+ * Only selected items have their depth adjusted by indentDelta.
11
8
  */
12
- function flattenTaskListImpl(options) {
9
+ export function flattenTaskList(options) {
13
10
  var doc = options.doc,
14
11
  rootListStart = options.rootListStart,
15
12
  rootListEnd = options.rootListEnd,
@@ -66,35 +63,6 @@ function flattenTaskListImpl(options) {
66
63
  };
67
64
  }
68
65
 
69
- /**
70
- * Flattens a taskList tree into an array of task items with computed depths.
71
- * Only selected items have their depth adjusted by indentDelta.
72
- */
73
- export function flattenTaskList(options) {
74
- if (fg('platform_editor_flexible_list_normalization_fix')) {
75
- return flattenTaskListImpl(options);
76
- }
77
- var _options$doc$type$sch = options.doc.type.schema.nodes,
78
- taskList = _options$doc$type$sch.taskList,
79
- taskItem = _options$doc$type$sch.taskItem,
80
- blockTaskItem = _options$doc$type$sch.blockTaskItem;
81
- return flattenListBase(options, {
82
- isContentNode: function isContentNode(node, parent) {
83
- var isTaskItemType = node.type === taskItem || blockTaskItem != null && node.type === blockTaskItem;
84
- return isTaskItemType && parent != null && parent.type === taskList;
85
- },
86
- getSelectionBounds: function getSelectionBounds(node, pos) {
87
- return {
88
- start: pos,
89
- end: pos + node.nodeSize
90
- };
91
- },
92
- getDepth: function getDepth(resolvedDepth, rootDepth) {
93
- return resolvedDepth - rootDepth - 1;
94
- }
95
- });
96
- }
97
-
98
66
  // Each stack entry collects children for a taskList at a given depth.
99
67
  // The root entry (depth -1) is special: its children become the content
100
68
  // of the outermost taskList directly (not wrapped in another taskList).
@@ -21,9 +21,8 @@ import { IconAction, IconDecision } from '@atlaskit/editor-common/quick-insert';
21
21
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
22
22
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
23
23
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
24
- import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
25
24
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
26
- import { closeRequestEditPopupAt, getCurrentIndentLevel, getTaskItemIndex, isInsideTask } from './pm-plugins/helpers';
25
+ import { closeRequestEditPopupAt, getCurrentIndentLevel, isInsideTask } from './pm-plugins/helpers';
27
26
  // Ignored via go/ees005
28
27
  // eslint-disable-next-line import/no-named-as-default
29
28
  import inputRulePlugin from './pm-plugins/input-rules';
@@ -200,13 +199,11 @@ export var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref3) {
200
199
  }
201
200
  var pluginState = taskPluginKey.getState(editorState);
202
201
  var indentLevel = getCurrentIndentLevel(editorState.selection) || 0;
203
- var itemIndex = getTaskItemIndex(editorState);
204
- var isFlexibleListIndentationEnabled = expValEqualsNoExposure('platform_editor_flexible_list_indentation', 'isEnabled', true);
205
202
  return {
206
203
  focusedTaskItemLocalId: (pluginState === null || pluginState === void 0 ? void 0 : pluginState.focusedTaskItemLocalId) || null,
207
204
  isInsideTask: isInsideTask(editorState),
208
- indentDisabled: !isFlexibleListIndentationEnabled && itemIndex === 0 || indentLevel >= MAX_INDENTATION_LEVEL,
209
- outdentDisabled: isFlexibleListIndentationEnabled ? indentLevel <= 0 : indentLevel <= 1,
205
+ indentDisabled: indentLevel >= MAX_INDENTATION_LEVEL,
206
+ outdentDisabled: indentLevel <= 0,
210
207
  // hasEditPermission is assumed to be true if pluginState.hasEditPermission is undefined
211
208
  // this allows the default plugin state to initialise as true if the extra configuration is not provided
212
209
  hasEditPermission: (pluginState === null || pluginState === void 0 ? void 0 : pluginState.hasEditPermission) !== undefined ? pluginState === null || pluginState === void 0 ? void 0 : pluginState.hasEditPermission : true,
@@ -1,24 +1,5 @@
1
1
  import type { Command } from '@atlaskit/editor-common/types';
2
2
  import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
- export declare const liftSelection: Command;
4
- /**
5
- * Wraps the current selection in a task list, respecting a maximum indentation depth of 6 levels.
6
- *
7
- * - Normalizes the selection to ensure it covers complete task items.
8
- * - Determines the maximum depth of task list nesting within the selection.
9
- * - If the selection is already nested at or beyond the maximum depth, the command does nothing.
10
- * - Calculates the block range to wrap, handling both regular and block task items.
11
- * - Wraps the block in a task list to increase indentation or create a new task list if necessary.
12
- *
13
- * @param state - The current editor state.
14
- * @param dispatch - The dispatch function to apply the transaction.
15
- * @returns `true` if the command was handled (even if no changes were made), otherwise `false`.
16
- * @example
17
- * ```typescript
18
- * autoJoin(wrapSelectionInTaskList, ['taskList']))(state, dispatch);
19
- * ```
20
- */
21
- export declare const wrapSelectionInTaskList: Command;
22
3
  /**
23
4
  * Tries to move the paragraph content near the given position into the taskItem or decisionItem
24
5
  * before it.
@@ -1,5 +1,5 @@
1
1
  import { NodeRange } from '@atlaskit/editor-prosemirror/model';
2
- import type { Node, NodeType, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Node, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { TaskItemData } from './types';
@@ -43,19 +43,6 @@ export declare const getTaskItemIndex: (state: EditorState) => number;
43
43
  * @param $startPos Position to start walking from.
44
44
  */
45
45
  export declare const walkOut: ($startPos: ResolvedPos) => ResolvedPos;
46
- /**
47
- * Finds the height of a tree-like structure, given any position inside it.
48
- *
49
- * Traverses from the top of the tree to all leaf nodes, and returns the length
50
- * of the longest path.
51
- *
52
- * This means you can use it with things like taskList, which
53
- * do not nest themselves inside taskItems but rather as adjacent children.
54
- *
55
- * @param $pos Any position inside the tree.
56
- * @param types The node types to consider traversable
57
- */
58
- export declare const subtreeHeight: ($from: ResolvedPos, $to: ResolvedPos, types: NodeType[]) => number;
59
46
  /**
60
47
  * Determines if the current selection is inside an empty taskItem, decisionItem, or blockTaskItem.
61
48
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-tasks-and-decisions",
3
- "version": "21.0.11",
3
+ "version": "22.0.0",
4
4
  "description": "Tasks and decisions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,14 +29,14 @@
29
29
  "@atlaskit/adf-schema": "^57.5.0",
30
30
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
31
31
  "@atlaskit/css": "^1.1.0",
32
- "@atlaskit/editor-plugin-analytics": "^18.0.0",
33
- "@atlaskit/editor-plugin-block-menu": "^17.0.0",
34
- "@atlaskit/editor-plugin-context-identifier": "^18.0.0",
35
- "@atlaskit/editor-plugin-editor-viewmode": "^20.0.0",
36
- "@atlaskit/editor-plugin-selection": "^18.0.0",
37
- "@atlaskit/editor-plugin-toolbar": "^15.0.0",
38
- "@atlaskit/editor-plugin-type-ahead": "^19.1.0",
39
- "@atlaskit/editor-prosemirror": "^8.0.0",
32
+ "@atlaskit/editor-plugin-analytics": "^19.0.0",
33
+ "@atlaskit/editor-plugin-block-menu": "^18.0.0",
34
+ "@atlaskit/editor-plugin-context-identifier": "^19.0.0",
35
+ "@atlaskit/editor-plugin-editor-viewmode": "^21.0.0",
36
+ "@atlaskit/editor-plugin-selection": "^19.0.0",
37
+ "@atlaskit/editor-plugin-toolbar": "^16.0.0",
38
+ "@atlaskit/editor-plugin-type-ahead": "^20.0.0",
39
+ "@atlaskit/editor-prosemirror": "^9.0.0",
40
40
  "@atlaskit/editor-shared-styles": "^4.3.0",
41
41
  "@atlaskit/editor-toolbar": "^2.6.0",
42
42
  "@atlaskit/editor-toolbar-model": "^1.2.0",
@@ -48,13 +48,13 @@
48
48
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
49
49
  "@atlaskit/task-decision": "^21.10.0",
50
50
  "@atlaskit/tmp-editor-statsig": "^199.0.0",
51
- "@atlaskit/tokens": "^18.0.0",
51
+ "@atlaskit/tokens": "^18.2.0",
52
52
  "@babel/runtime": "^7.0.0",
53
53
  "@compiled/react": "^1.0.2",
54
54
  "bind-event-listener": "^3.0.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "@atlaskit/editor-common": "^122.11.0",
57
+ "@atlaskit/editor-common": "^123.0.0",
58
58
  "react": "^18.2.0 || ^19.2.0",
59
59
  "react-dom": "^18.2.0 || ^19.2.0",
60
60
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -76,9 +76,6 @@
76
76
  "platform_editor_element_browser_analytic": {
77
77
  "type": "boolean"
78
78
  },
79
- "platform_editor_flexible_list_normalization_fix": {
80
- "type": "boolean"
81
- },
82
79
  "platform_editor_markdown_compatible_toolbar": {
83
80
  "type": "boolean"
84
81
  }