@atlaskit/editor-plugin-list 3.1.2 → 3.1.3

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,11 @@
1
1
  # @atlaskit/editor-plugin-list
2
2
 
3
+ ## 3.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#66804](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66804) [`107c6d15dda7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/107c6d15dda7) - ED-21802 Disable insert inside nested task list through toolbar and keybinding.
8
+
3
9
  ## 3.1.2
4
10
 
5
11
  ### Patch Changes
@@ -120,6 +120,12 @@ var toggleList = exports.toggleList = function toggleList(editorAnalyticsAPI) {
120
120
  return function (inputMethod, listType) {
121
121
  return function (_ref) {
122
122
  var tr = _ref.tr;
123
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-action-in-list')) {
124
+ var taskList = tr.doc.type.schema.nodes.taskList;
125
+ if ((0, _utils2.hasParentNodeOfType)(taskList)(tr.selection)) {
126
+ return tr;
127
+ }
128
+ }
123
129
  var listInsideSelection = (0, _selection2.selectionContainsList)(tr);
124
130
  var listNodeType = tr.doc.type.schema.nodes[listType];
125
131
  var actionSubjectId = listType === 'bulletList' ? _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
@@ -85,8 +85,9 @@ var handleDocChanged = function handleDocChanged(featureFlags) {
85
85
  var handleSelectionChanged = function handleSelectionChanged(tr, pluginState) {
86
86
  var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
87
87
  bulletList = _tr$doc$type$schema$n.bulletList,
88
- orderedList = _tr$doc$type$schema$n.orderedList;
89
- var listParent = (0, _utils2.findParentNodeOfType)([bulletList, orderedList])(tr.selection);
88
+ orderedList = _tr$doc$type$schema$n.orderedList,
89
+ taskList = _tr$doc$type$schema$n.taskList;
90
+ var listParent = (0, _utils2.findParentNodeOfType)([bulletList, orderedList, taskList])(tr.selection);
90
91
  var bulletListActive = !!listParent && listParent.node.type === bulletList;
91
92
  var orderedListActive = !!listParent && listParent.node.type === orderedList;
92
93
  var bulletListDisabled = !(bulletListActive || orderedListActive || (0, _selection2.isWrappingPossible)(bulletList, tr.selection));
@@ -92,6 +92,14 @@ export const toggleList = editorAnalyticsAPI => (inputMethod, listType) => {
92
92
  return function ({
93
93
  tr
94
94
  }) {
95
+ if (getBooleanFF('platform.editor.allow-action-in-list')) {
96
+ const {
97
+ taskList
98
+ } = tr.doc.type.schema.nodes;
99
+ if (hasParentNodeOfType(taskList)(tr.selection)) {
100
+ return tr;
101
+ }
102
+ }
95
103
  const listInsideSelection = selectionContainsList(tr);
96
104
  const listNodeType = tr.doc.type.schema.nodes[listType];
97
105
  const actionSubjectId = listType === 'bulletList' ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
@@ -74,9 +74,10 @@ const handleDocChanged = featureFlags => (tr, pluginState, editorState) => {
74
74
  const handleSelectionChanged = (tr, pluginState) => {
75
75
  const {
76
76
  bulletList,
77
- orderedList
77
+ orderedList,
78
+ taskList
78
79
  } = tr.doc.type.schema.nodes;
79
- const listParent = findParentNodeOfType([bulletList, orderedList])(tr.selection);
80
+ const listParent = findParentNodeOfType([bulletList, orderedList, taskList])(tr.selection);
80
81
  const bulletListActive = !!listParent && listParent.node.type === bulletList;
81
82
  const orderedListActive = !!listParent && listParent.node.type === orderedList;
82
83
  const bulletListDisabled = !(bulletListActive || orderedListActive || isWrappingPossible(bulletList, tr.selection));
@@ -101,6 +101,12 @@ export var toggleList = function toggleList(editorAnalyticsAPI) {
101
101
  return function (inputMethod, listType) {
102
102
  return function (_ref) {
103
103
  var tr = _ref.tr;
104
+ if (getBooleanFF('platform.editor.allow-action-in-list')) {
105
+ var taskList = tr.doc.type.schema.nodes.taskList;
106
+ if (hasParentNodeOfType(taskList)(tr.selection)) {
107
+ return tr;
108
+ }
109
+ }
104
110
  var listInsideSelection = selectionContainsList(tr);
105
111
  var listNodeType = tr.doc.type.schema.nodes[listType];
106
112
  var actionSubjectId = listType === 'bulletList' ? ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
@@ -78,8 +78,9 @@ var handleDocChanged = function handleDocChanged(featureFlags) {
78
78
  var handleSelectionChanged = function handleSelectionChanged(tr, pluginState) {
79
79
  var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
80
80
  bulletList = _tr$doc$type$schema$n.bulletList,
81
- orderedList = _tr$doc$type$schema$n.orderedList;
82
- var listParent = findParentNodeOfType([bulletList, orderedList])(tr.selection);
81
+ orderedList = _tr$doc$type$schema$n.orderedList,
82
+ taskList = _tr$doc$type$schema$n.taskList;
83
+ var listParent = findParentNodeOfType([bulletList, orderedList, taskList])(tr.selection);
83
84
  var bulletListActive = !!listParent && listParent.node.type === bulletList;
84
85
  var orderedListActive = !!listParent && listParent.node.type === orderedList;
85
86
  var bulletListDisabled = !(bulletListActive || orderedListActive || isWrappingPossible(bulletList, tr.selection));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-list",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "List plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@atlaskit/adf-schema": "^35.3.0",
36
- "@atlaskit/editor-common": "^76.36.0",
36
+ "@atlaskit/editor-common": "^76.39.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
39
39
  "@atlaskit/editor-prosemirror": "1.1.0",