@atlaskit/editor-plugin-tasks-and-decisions 11.4.6 → 11.4.7

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-plugin-tasks-and-decisions
2
2
 
3
+ ## 11.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3e18e5bea1aa1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3e18e5bea1aa1) -
8
+ Fixed cursor placement when pressing Enter at the start of a nested task item. Fixed extra spacing
9
+ on nested task lists when flexible list indentation is enabled.
10
+ - Updated dependencies
11
+
3
12
  ## 11.4.6
4
13
 
5
14
  ### Patch Changes
@@ -606,7 +606,19 @@ var enter = function enter(editorAnalyticsAPI, getContextIdentifier) {
606
606
  return tr.insert(blockTaskItemNode.pos, newTaskItem);
607
607
  }
608
608
  // Current position will point to text node, but we want to insert above the taskItem node
609
- return tr.insert($from.pos - 1, newTask);
609
+ var insertPos = $from.pos - 1;
610
+ tr.insert(insertPos, newTask);
611
+ // Place cursor on the newly inserted empty task item above
612
+ // when nested inside another taskList.
613
+ if ((0, _expValEquals.expValEquals)('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
614
+ var taskListType = schema.nodes.taskList;
615
+ var parentTaskList = $from.node($from.depth - 1);
616
+ var grandparent = $from.depth >= 3 ? $from.node($from.depth - 2) : null;
617
+ if ((parentTaskList === null || parentTaskList === void 0 ? void 0 : parentTaskList.type) === taskListType && (grandparent === null || grandparent === void 0 ? void 0 : grandparent.type) === taskListType) {
618
+ tr.setSelection(_state2.TextSelection.create(tr.doc, insertPos + 1));
619
+ }
620
+ }
621
+ return tr;
610
622
  }
611
623
  }
612
624
  /**
@@ -601,7 +601,21 @@ const enter = (editorAnalyticsAPI, getContextIdentifier) => filter(isInsideTaskO
601
601
  return tr.insert(blockTaskItemNode.pos, newTaskItem);
602
602
  }
603
603
  // Current position will point to text node, but we want to insert above the taskItem node
604
- return tr.insert($from.pos - 1, newTask);
604
+ const insertPos = $from.pos - 1;
605
+ tr.insert(insertPos, newTask);
606
+ // Place cursor on the newly inserted empty task item above
607
+ // when nested inside another taskList.
608
+ if (expValEquals('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
609
+ const {
610
+ taskList: taskListType
611
+ } = schema.nodes;
612
+ const parentTaskList = $from.node($from.depth - 1);
613
+ const grandparent = $from.depth >= 3 ? $from.node($from.depth - 2) : null;
614
+ if ((parentTaskList === null || parentTaskList === void 0 ? void 0 : parentTaskList.type) === taskListType && (grandparent === null || grandparent === void 0 ? void 0 : grandparent.type) === taskListType) {
615
+ tr.setSelection(TextSelection.create(tr.doc, insertPos + 1));
616
+ }
617
+ }
618
+ return tr;
605
619
  }
606
620
  }
607
621
  /**
@@ -598,7 +598,19 @@ var enter = function enter(editorAnalyticsAPI, getContextIdentifier) {
598
598
  return tr.insert(blockTaskItemNode.pos, newTaskItem);
599
599
  }
600
600
  // Current position will point to text node, but we want to insert above the taskItem node
601
- return tr.insert($from.pos - 1, newTask);
601
+ var insertPos = $from.pos - 1;
602
+ tr.insert(insertPos, newTask);
603
+ // Place cursor on the newly inserted empty task item above
604
+ // when nested inside another taskList.
605
+ if (expValEquals('platform_editor_flexible_list_indentation', 'isEnabled', true)) {
606
+ var taskListType = schema.nodes.taskList;
607
+ var parentTaskList = $from.node($from.depth - 1);
608
+ var grandparent = $from.depth >= 3 ? $from.node($from.depth - 2) : null;
609
+ if ((parentTaskList === null || parentTaskList === void 0 ? void 0 : parentTaskList.type) === taskListType && (grandparent === null || grandparent === void 0 ? void 0 : grandparent.type) === taskListType) {
610
+ tr.setSelection(TextSelection.create(tr.doc, insertPos + 1));
611
+ }
612
+ }
613
+ return tr;
602
614
  }
603
615
  }
604
616
  /**
@@ -1,8 +1,7 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
2
  import type { ExtractInjectionAPI, getPosHandlerNode } from '@atlaskit/editor-common/types';
3
3
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- import type { NodeView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
6
5
  import type { TasksAndDecisionsPlugin } from '../tasksAndDecisionsPluginType';
7
6
  interface TaskItemNodeViewOptions {
8
7
  api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
@@ -1,8 +1,7 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
2
  import type { ExtractInjectionAPI, getPosHandlerNode } from '@atlaskit/editor-common/types';
3
3
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- import type { NodeView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
6
5
  import type { TasksAndDecisionsPlugin } from '../tasksAndDecisionsPluginType';
7
6
  interface TaskItemNodeViewOptions {
8
7
  api: ExtractInjectionAPI<TasksAndDecisionsPlugin> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-tasks-and-decisions",
3
- "version": "11.4.6",
3
+ "version": "11.4.7",
4
4
  "description": "Tasks and decisions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/primitives": "^18.1.0",
50
50
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
51
51
  "@atlaskit/task-decision": "^19.3.0",
52
- "@atlaskit/tmp-editor-statsig": "^54.0.0",
52
+ "@atlaskit/tmp-editor-statsig": "^54.1.0",
53
53
  "@atlaskit/tokens": "^11.4.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@compiled/react": "^0.20.0",