@atlaskit/editor-core 187.28.3 → 187.29.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.
Files changed (225) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/index.js +0 -7
  3. package/dist/cjs/labs/next/presets/universal.js +2 -1
  4. package/dist/cjs/plugins/analytics/index.js +0 -6
  5. package/dist/cjs/plugins/analytics/types/index.js +0 -6
  6. package/dist/cjs/plugins/index.js +0 -7
  7. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/commands.js +1 -1
  8. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +7 -1
  9. package/dist/cjs/utils/commands.js +1 -33
  10. package/dist/cjs/utils/index.js +0 -13
  11. package/dist/cjs/utils/mark.js +2 -46
  12. package/dist/cjs/utils/selection.js +0 -5
  13. package/dist/cjs/version-wrapper.js +1 -1
  14. package/dist/es2019/index.js +0 -1
  15. package/dist/es2019/labs/next/presets/universal.js +2 -1
  16. package/dist/es2019/plugins/analytics/index.js +1 -1
  17. package/dist/es2019/plugins/analytics/types/index.js +1 -1
  18. package/dist/es2019/plugins/index.js +0 -1
  19. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/commands.js +1 -1
  20. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +5 -1
  21. package/dist/es2019/utils/commands.js +1 -33
  22. package/dist/es2019/utils/index.js +1 -2
  23. package/dist/es2019/utils/mark.js +0 -41
  24. package/dist/es2019/utils/selection.js +0 -6
  25. package/dist/es2019/version-wrapper.js +1 -1
  26. package/dist/esm/index.js +0 -1
  27. package/dist/esm/labs/next/presets/universal.js +2 -1
  28. package/dist/esm/plugins/analytics/index.js +1 -1
  29. package/dist/esm/plugins/analytics/types/index.js +1 -1
  30. package/dist/esm/plugins/index.js +0 -1
  31. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/commands.js +1 -1
  32. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +7 -1
  33. package/dist/esm/utils/commands.js +1 -31
  34. package/dist/esm/utils/index.js +1 -2
  35. package/dist/esm/utils/mark.js +0 -42
  36. package/dist/esm/utils/selection.js +0 -4
  37. package/dist/esm/version-wrapper.js +1 -1
  38. package/dist/types/index.d.ts +0 -3
  39. package/dist/types/plugins/analytics/index.d.ts +1 -1
  40. package/dist/types/plugins/analytics/types/index.d.ts +1 -1
  41. package/dist/types/plugins/index.d.ts +0 -1
  42. package/dist/types/plugins/paste/index.d.ts +1 -1
  43. package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +1 -0
  44. package/dist/types/utils/commands.d.ts +1 -4
  45. package/dist/types/utils/index.d.ts +1 -2
  46. package/dist/types/utils/mark.d.ts +2 -12
  47. package/dist/types/utils/selection.d.ts +0 -2
  48. package/dist/types-ts4.5/index.d.ts +0 -3
  49. package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
  50. package/dist/types-ts4.5/plugins/analytics/types/index.d.ts +1 -1
  51. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  52. package/dist/types-ts4.5/plugins/paste/index.d.ts +1 -1
  53. package/dist/types-ts4.5/plugins/text-color/ui/ToolbarTextColor/index.d.ts +1 -0
  54. package/dist/types-ts4.5/utils/commands.d.ts +1 -4
  55. package/dist/types-ts4.5/utils/index.d.ts +1 -2
  56. package/dist/types-ts4.5/utils/mark.d.ts +2 -12
  57. package/dist/types-ts4.5/utils/selection.d.ts +0 -2
  58. package/package.json +3 -3
  59. package/report.api.md +0 -9
  60. package/tmp/api-report-tmp.d.ts +0 -9
  61. package/dist/cjs/plugins/list/actions/conversions.js +0 -153
  62. package/dist/cjs/plugins/list/actions/indent-list-items-selected.js +0 -125
  63. package/dist/cjs/plugins/list/actions/indent-list.js +0 -49
  64. package/dist/cjs/plugins/list/actions/join-list-items-forward.js +0 -59
  65. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/index.js +0 -40
  66. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -88
  67. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -85
  68. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -79
  69. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -45
  70. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -56
  71. package/dist/cjs/plugins/list/actions/merge-lists.js +0 -27
  72. package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +0 -291
  73. package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +0 -98
  74. package/dist/cjs/plugins/list/commands/indent-list.js +0 -71
  75. package/dist/cjs/plugins/list/commands/index.js +0 -348
  76. package/dist/cjs/plugins/list/commands/join-list-item-forward.js +0 -61
  77. package/dist/cjs/plugins/list/commands/listBackspace.js +0 -284
  78. package/dist/cjs/plugins/list/commands/outdent-list.js +0 -70
  79. package/dist/cjs/plugins/list/index.js +0 -133
  80. package/dist/cjs/plugins/list/messages.js +0 -37
  81. package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +0 -61
  82. package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +0 -36
  83. package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +0 -58
  84. package/dist/cjs/plugins/list/pm-plugins/keymap.js +0 -27
  85. package/dist/cjs/plugins/list/pm-plugins/main.js +0 -168
  86. package/dist/cjs/plugins/list/transforms.js +0 -100
  87. package/dist/cjs/plugins/list/types.js +0 -8
  88. package/dist/cjs/plugins/list/utils/analytics.js +0 -22
  89. package/dist/cjs/plugins/list/utils/find.js +0 -68
  90. package/dist/cjs/plugins/list/utils/indentation.js +0 -22
  91. package/dist/cjs/plugins/list/utils/node.js +0 -16
  92. package/dist/cjs/plugins/list/utils/selection.js +0 -95
  93. package/dist/cjs/utils/input-rules.js +0 -30
  94. package/dist/es2019/plugins/list/actions/conversions.js +0 -160
  95. package/dist/es2019/plugins/list/actions/indent-list-items-selected.js +0 -124
  96. package/dist/es2019/plugins/list/actions/indent-list.js +0 -44
  97. package/dist/es2019/plugins/list/actions/join-list-items-forward.js +0 -54
  98. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/index.js +0 -5
  99. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -74
  100. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -78
  101. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -72
  102. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -37
  103. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -48
  104. package/dist/es2019/plugins/list/actions/merge-lists.js +0 -24
  105. package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +0 -295
  106. package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +0 -91
  107. package/dist/es2019/plugins/list/commands/indent-list.js +0 -62
  108. package/dist/es2019/plugins/list/commands/index.js +0 -322
  109. package/dist/es2019/plugins/list/commands/join-list-item-forward.js +0 -53
  110. package/dist/es2019/plugins/list/commands/listBackspace.js +0 -276
  111. package/dist/es2019/plugins/list/commands/outdent-list.js +0 -60
  112. package/dist/es2019/plugins/list/index.js +0 -120
  113. package/dist/es2019/plugins/list/messages.js +0 -29
  114. package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +0 -55
  115. package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +0 -33
  116. package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +0 -52
  117. package/dist/es2019/plugins/list/pm-plugins/keymap.js +0 -19
  118. package/dist/es2019/plugins/list/pm-plugins/main.js +0 -159
  119. package/dist/es2019/plugins/list/transforms.js +0 -102
  120. package/dist/es2019/plugins/list/types.js +0 -1
  121. package/dist/es2019/plugins/list/utils/analytics.js +0 -12
  122. package/dist/es2019/plugins/list/utils/find.js +0 -61
  123. package/dist/es2019/plugins/list/utils/indentation.js +0 -16
  124. package/dist/es2019/plugins/list/utils/node.js +0 -12
  125. package/dist/es2019/plugins/list/utils/selection.js +0 -96
  126. package/dist/es2019/utils/input-rules.js +0 -20
  127. package/dist/esm/plugins/list/actions/conversions.js +0 -147
  128. package/dist/esm/plugins/list/actions/indent-list-items-selected.js +0 -117
  129. package/dist/esm/plugins/list/actions/indent-list.js +0 -43
  130. package/dist/esm/plugins/list/actions/join-list-items-forward.js +0 -52
  131. package/dist/esm/plugins/list/actions/join-list-items-scenarios/index.js +0 -5
  132. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -81
  133. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -79
  134. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -73
  135. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -38
  136. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -49
  137. package/dist/esm/plugins/list/actions/merge-lists.js +0 -21
  138. package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +0 -283
  139. package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +0 -92
  140. package/dist/esm/plugins/list/commands/indent-list.js +0 -63
  141. package/dist/esm/plugins/list/commands/index.js +0 -320
  142. package/dist/esm/plugins/list/commands/join-list-item-forward.js +0 -53
  143. package/dist/esm/plugins/list/commands/listBackspace.js +0 -275
  144. package/dist/esm/plugins/list/commands/outdent-list.js +0 -62
  145. package/dist/esm/plugins/list/index.js +0 -127
  146. package/dist/esm/plugins/list/messages.js +0 -29
  147. package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +0 -56
  148. package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +0 -30
  149. package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +0 -51
  150. package/dist/esm/plugins/list/pm-plugins/keymap.js +0 -19
  151. package/dist/esm/plugins/list/pm-plugins/main.js +0 -159
  152. package/dist/esm/plugins/list/transforms.js +0 -92
  153. package/dist/esm/plugins/list/types.js +0 -1
  154. package/dist/esm/plugins/list/utils/analytics.js +0 -12
  155. package/dist/esm/plugins/list/utils/find.js +0 -59
  156. package/dist/esm/plugins/list/utils/indentation.js +0 -16
  157. package/dist/esm/plugins/list/utils/node.js +0 -10
  158. package/dist/esm/plugins/list/utils/selection.js +0 -81
  159. package/dist/esm/utils/input-rules.js +0 -22
  160. package/dist/types/plugins/list/actions/conversions.d.ts +0 -6
  161. package/dist/types/plugins/list/actions/indent-list-items-selected.d.ts +0 -2
  162. package/dist/types/plugins/list/actions/indent-list.d.ts +0 -2
  163. package/dist/types/plugins/list/actions/join-list-items-forward.d.ts +0 -13
  164. package/dist/types/plugins/list/actions/join-list-items-scenarios/index.d.ts +0 -5
  165. package/dist/types/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.d.ts +0 -9
  166. package/dist/types/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.d.ts +0 -9
  167. package/dist/types/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.d.ts +0 -9
  168. package/dist/types/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.d.ts +0 -9
  169. package/dist/types/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.d.ts +0 -9
  170. package/dist/types/plugins/list/actions/merge-lists.d.ts +0 -7
  171. package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +0 -3
  172. package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +0 -15
  173. package/dist/types/plugins/list/commands/indent-list.d.ts +0 -6
  174. package/dist/types/plugins/list/commands/index.d.ts +0 -17
  175. package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +0 -3
  176. package/dist/types/plugins/list/commands/listBackspace.d.ts +0 -10
  177. package/dist/types/plugins/list/commands/outdent-list.d.ts +0 -7
  178. package/dist/types/plugins/list/index.d.ts +0 -3
  179. package/dist/types/plugins/list/messages.d.ts +0 -27
  180. package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +0 -9
  181. package/dist/types/plugins/list/pm-plugins/input-rules/index.d.ts +0 -4
  182. package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +0 -12
  183. package/dist/types/plugins/list/pm-plugins/keymap.d.ts +0 -5
  184. package/dist/types/plugins/list/pm-plugins/main.d.ts +0 -11
  185. package/dist/types/plugins/list/transforms.d.ts +0 -4
  186. package/dist/types/plugins/list/types.d.ts +0 -4
  187. package/dist/types/plugins/list/utils/analytics.d.ts +0 -5
  188. package/dist/types/plugins/list/utils/find.d.ts +0 -10
  189. package/dist/types/plugins/list/utils/indentation.d.ts +0 -2
  190. package/dist/types/plugins/list/utils/node.d.ts +0 -2
  191. package/dist/types/plugins/list/utils/selection.d.ts +0 -14
  192. package/dist/types/utils/input-rules.d.ts +0 -10
  193. package/dist/types-ts4.5/plugins/list/actions/conversions.d.ts +0 -6
  194. package/dist/types-ts4.5/plugins/list/actions/indent-list-items-selected.d.ts +0 -2
  195. package/dist/types-ts4.5/plugins/list/actions/indent-list.d.ts +0 -2
  196. package/dist/types-ts4.5/plugins/list/actions/join-list-items-forward.d.ts +0 -16
  197. package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/index.d.ts +0 -5
  198. package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.d.ts +0 -9
  199. package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.d.ts +0 -9
  200. package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.d.ts +0 -9
  201. package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.d.ts +0 -9
  202. package/dist/types-ts4.5/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.d.ts +0 -9
  203. package/dist/types-ts4.5/plugins/list/actions/merge-lists.d.ts +0 -7
  204. package/dist/types-ts4.5/plugins/list/actions/outdent-list-items-selected.d.ts +0 -3
  205. package/dist/types-ts4.5/plugins/list/actions/wrap-and-join-lists.d.ts +0 -15
  206. package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +0 -6
  207. package/dist/types-ts4.5/plugins/list/commands/index.d.ts +0 -17
  208. package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +0 -3
  209. package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +0 -13
  210. package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +0 -7
  211. package/dist/types-ts4.5/plugins/list/index.d.ts +0 -3
  212. package/dist/types-ts4.5/plugins/list/messages.d.ts +0 -27
  213. package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +0 -9
  214. package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/index.d.ts +0 -4
  215. package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +0 -12
  216. package/dist/types-ts4.5/plugins/list/pm-plugins/keymap.d.ts +0 -5
  217. package/dist/types-ts4.5/plugins/list/pm-plugins/main.d.ts +0 -11
  218. package/dist/types-ts4.5/plugins/list/transforms.d.ts +0 -4
  219. package/dist/types-ts4.5/plugins/list/types.d.ts +0 -4
  220. package/dist/types-ts4.5/plugins/list/utils/analytics.d.ts +0 -5
  221. package/dist/types-ts4.5/plugins/list/utils/find.d.ts +0 -10
  222. package/dist/types-ts4.5/plugins/list/utils/indentation.d.ts +0 -2
  223. package/dist/types-ts4.5/plugins/list/utils/node.d.ts +0 -2
  224. package/dist/types-ts4.5/plugins/list/utils/selection.d.ts +0 -14
  225. package/dist/types-ts4.5/utils/input-rules.d.ts +0 -10
@@ -1,10 +1,4 @@
1
1
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
2
- import { GapCursorSelection } from '@atlaskit/editor-common/selection';
3
- var isFirstChildOfParent = function isFirstChildOfParent(state) {
4
- var $from = state.selection.$from;
5
- return $from.depth > 1 ? state.selection instanceof GapCursorSelection && $from.parentOffset === 0 || $from.index($from.depth - 1) === 0 : true;
6
- };
7
-
8
2
  /**
9
3
  * Creates a filter that checks if the node at a given number of parents above the current
10
4
  * selection is of the correct node type.
@@ -20,30 +14,6 @@ var isNthParentOfType = function isNthParentOfType(nodeType, depthAway) {
20
14
  return !!parent && parent.type === state.schema.nodes[nodeType];
21
15
  };
22
16
  };
23
-
24
- // https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L90
25
- // Keep going left up the tree, without going across isolating boundaries, until we
26
- // can go along the tree at that same level
27
- //
28
- // You can think of this as, if you could construct each document like we do in the tests,
29
- // return the position of the first ) backwards from the current selection.
30
- function findCutBefore($pos) {
31
- // parent is non-isolating, so we can look across this boundary
32
- if (!$pos.parent.type.spec.isolating) {
33
- // search up the tree from the pos's *parent*
34
- for (var i = $pos.depth - 1; i >= 0; i--) {
35
- // starting from the inner most node's parent, find out
36
- // if we're not its first child
37
- if ($pos.index(i) > 0) {
38
- return $pos.doc.resolve($pos.before(i + 1));
39
- }
40
- if ($pos.node(i).type.spec.isolating) {
41
- break;
42
- }
43
- }
44
- }
45
- return null;
46
- }
47
17
  var withScrollIntoView = function withScrollIntoView(command) {
48
18
  return function (state, dispatch, view) {
49
19
  return command(state, function (tr) {
@@ -73,4 +43,4 @@ var selectNode = function selectNode(pos) {
73
43
  return true;
74
44
  };
75
45
  };
76
- export { isFirstChildOfParent, isNthParentOfType, findCutBefore, withScrollIntoView, selectNode };
46
+ export { isNthParentOfType, withScrollIntoView, selectNode };
@@ -5,9 +5,8 @@ import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
5
5
  export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem } from '@atlaskit/editor-common/utils';
6
6
  export { insideTable } from '@atlaskit/editor-common/core-utils';
7
7
  export { isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount } from './document';
8
- export { sanitiseMarksInSelection } from './mark';
9
8
  export { isParagraph, isText, isLinkMark } from './nodes';
10
- export { setNodeSelection, setGapCursorSelection, setTextSelection } from './selection';
9
+ export { setNodeSelection, setTextSelection } from './selection';
11
10
  export { default as measurements } from './performance/measure-enum';
12
11
  function isMarkTypeCompatibleWithMark(markType, mark) {
13
12
  return !mark.type.excludes(markType) && !markType.excludes(mark.type);
@@ -31,46 +31,4 @@ export var isMarkExcluded = function isMarkExcluded(type, marks) {
31
31
  });
32
32
  }
33
33
  return false;
34
- };
35
-
36
- /**
37
- * Removes marks from nodes in the current selection that are not supported
38
- */
39
- export var sanitiseSelectionMarksForWrapping = function sanitiseSelectionMarksForWrapping(state, newParentType) {
40
- var tr = state.tr;
41
- sanitiseMarksInSelection(tr, newParentType);
42
- return tr;
43
- };
44
- export var sanitiseMarksInSelection = function sanitiseMarksInSelection(tr, newParentType) {
45
- var _tr$selection = tr.selection,
46
- from = _tr$selection.from,
47
- to = _tr$selection.to;
48
- var nodesSanitized = [];
49
- tr.doc.nodesBetween(from, to, function (node, pos, parent) {
50
- if (node.isText) {
51
- return false;
52
- }
53
- // Skip expands and layouts if they are outside selection
54
- // but continue to iterate over their children.
55
- if (['expand', 'layoutSection'].includes(node.type.name) && (pos < from || pos > to)) {
56
- return true;
57
- }
58
- node.marks.forEach(function (mark) {
59
- if (!(parent !== null && parent !== void 0 && parent.type.allowsMarkType(mark.type)) || newParentType && !newParentType.allowsMarkType(mark.type)) {
60
- var filteredMarks = node.marks.filter(function (m) {
61
- return m.type !== mark.type;
62
- });
63
- var position = pos > 0 ? pos : 0;
64
- var marksRemoved = node.marks.filter(function (m) {
65
- return m.type === mark.type;
66
- });
67
- nodesSanitized.push({
68
- node: node,
69
- marksRemoved: marksRemoved
70
- });
71
- tr.setNodeMarkup(position, undefined, node.attrs, filteredMarks);
72
- }
73
- });
74
- });
75
- return nodesSanitized;
76
34
  };
@@ -8,10 +8,6 @@ export function setAllSelection(view) {
8
8
  var tr = state.tr.setSelection(new AllSelection(view.state.doc));
9
9
  dispatch(tr);
10
10
  }
11
- export function setGapCursorSelection(view, pos, side) {
12
- var state = view.state;
13
- view.dispatch(state.tr.setSelection(new GapCursorSelection(state.doc.resolve(pos), side)));
14
- }
15
11
  export function setCellSelection(view, anchor, head) {
16
12
  var state = view.state,
17
13
  dispatch = view.dispatch;
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "187.28.3";
2
+ export var version = "187.29.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -26,9 +26,6 @@ export { changeColor } from './plugins/text-color/commands/change-color';
26
26
  export { insertHorizontalRule } from './plugins/rule/commands';
27
27
  export { blockPluginStateKey } from './plugins';
28
28
  export type { BlockTypeState } from './plugins';
29
- export { pluginKey as listStateKey } from './plugins/list/pm-plugins/main';
30
- export type { ListState } from './plugins/list/types';
31
- export type { InputMethod as ListInputMethod } from './plugins/list/commands';
32
29
  export { subscribeToToolbarAndPickerUpdates } from './plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates';
33
30
  export { subscribeTypeAheadUpdates } from './plugins/view-update-subscription/subscribe/type-ahead-updates';
34
31
  export type { InputMethodToolbar as TextFormattingInputMethodToolbar, InputMethodBasic as TextFormattingInputMethodBasic, } from '@atlaskit/editor-common/types';
@@ -1,5 +1,5 @@
1
1
  import analyticsPlugin from './plugin';
2
- export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, LIST_TEXT_SCENARIOS, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
2
+ export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
3
3
  export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, FireAnalyticsCallback, FireAnalyticsEvent, } from '@atlaskit/editor-common/analytics';
4
4
  export { withAnalytics, addAnalytics } from './utils';
5
5
  export declare const analyticsPluginKey: import("prosemirror-state").PluginKey<any>;
@@ -6,4 +6,4 @@ export type { MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, } from '.
6
6
  export type { DispatchAnalyticsEvent } from './dispatch-analytics-event';
7
7
  export type { CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, } from './link-tool-bar-events';
8
8
  export type { FormatEventPayload, CommonListAnalyticsAttributes, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, ListEventPayload, PasteContent, PasteEventPayload, PasteSource, PasteType, PasteContents, SubstituteEventPayload, TableEventPayload, PasteSources, PasteTypes, PASTE_ACTION_SUBJECT_ID, } from '@atlaskit/editor-common/analytics';
9
- export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE, LIST_TEXT_SCENARIOS, SYMBOL, TABLE_BREAKOUT, } from '@atlaskit/editor-common/analytics';
9
+ export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE, SYMBOL, TABLE_BREAKOUT, } from '@atlaskit/editor-common/analytics';
@@ -14,7 +14,6 @@ export { default as helpDialogPlugin } from './help-dialog';
14
14
  export { default as insertBlockPlugin } from './insert-block';
15
15
  export { default as jiraIssuePlugin } from './jira-issue';
16
16
  export { default as layoutPlugin } from './layout';
17
- export { default as listPlugin } from './list';
18
17
  export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
19
18
  export { default as macroPlugin } from './macro';
20
19
  export { default as maxContentSizePlugin } from './max-content-size';
@@ -3,7 +3,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
3
3
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
4
4
  import type { cardPlugin } from '@atlaskit/editor-plugin-card';
5
5
  import type betterTypeHistoryPlugin from '../better-type-history';
6
- import type listPlugin from '../list';
6
+ import type { listPlugin } from '@atlaskit/editor-plugin-list';
7
7
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
8
  export type PastePluginOptions = {
9
9
  cardOptions?: CardOptions;
@@ -40,6 +40,7 @@ export declare class ToolbarTextColor extends React.Component<Props & WrappedCom
40
40
  private handleOpenChange;
41
41
  private hide;
42
42
  private hideonEsc;
43
+ private getSelectedColor;
43
44
  private getCommonAnalyticsAttributes;
44
45
  private buildAnalyticsPalette;
45
46
  private buildAnalyticsSelectColor;
@@ -1,8 +1,6 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
4
3
  import type { Command, HigherOrderCommand } from '@atlaskit/editor-common/types';
5
- declare const isFirstChildOfParent: (state: EditorState) => boolean;
6
4
  /**
7
5
  * Creates a filter that checks if the node at a given number of parents above the current
8
6
  * selection is of the correct node type.
@@ -12,7 +10,6 @@ declare const isFirstChildOfParent: (state: EditorState) => boolean;
12
10
  * is usually inside the text content.
13
11
  */
14
12
  declare const isNthParentOfType: (nodeType: string, depthAway: number) => (state: EditorState, view?: EditorView) => boolean;
15
- declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
16
13
  declare const withScrollIntoView: HigherOrderCommand;
17
14
  /**
18
15
  * Insert content, delete a range and create a new selection
@@ -24,4 +21,4 @@ declare const withScrollIntoView: HigherOrderCommand;
24
21
  * @param deletions the ranges to delete
25
22
  */
26
23
  declare const selectNode: (pos: number) => Command;
27
- export { isFirstChildOfParent, isNthParentOfType, findCutBefore, withScrollIntoView, selectNode, };
24
+ export { isNthParentOfType, withScrollIntoView, selectNode };
@@ -4,9 +4,8 @@ import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
4
4
  export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, } from '@atlaskit/editor-common/utils';
5
5
  export { insideTable } from '@atlaskit/editor-common/core-utils';
6
6
  export { isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount, } from './document';
7
- export { sanitiseMarksInSelection } from './mark';
8
7
  export { isParagraph, isText, isLinkMark } from './nodes';
9
- export { setNodeSelection, setGapCursorSelection, setTextSelection, } from './selection';
8
+ export { setNodeSelection, setTextSelection } from './selection';
10
9
  export type { JSONDocNode };
11
10
  export { default as measurements } from './performance/measure-enum';
12
11
  export declare function getCursor(selection: Selection): ResolvedPos | undefined;
@@ -1,14 +1,4 @@
1
- import type { Node, Mark, MarkType, NodeType } from '@atlaskit/editor-prosemirror/model';
2
- import type { SelectionRange, EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import type { Node, Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
2
+ import type { SelectionRange } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
4
4
  export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
5
- /**
6
- * Removes marks from nodes in the current selection that are not supported
7
- */
8
- export declare const sanitiseSelectionMarksForWrapping: (state: EditorState, newParentType?: NodeType) => Transaction | undefined;
9
- type NodesSanitized = Array<{
10
- node: Node;
11
- marksRemoved: Mark[];
12
- }>;
13
- export declare const sanitiseMarksInSelection: (tr: Transaction, newParentType?: NodeType) => NodesSanitized;
14
- export {};
@@ -1,10 +1,8 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Node } from '@atlaskit/editor-prosemirror/model';
4
- import type { Side } from '@atlaskit/editor-common/selection';
5
4
  export { setNodeSelection, setTextSelection, } from '@atlaskit/editor-common/utils';
6
5
  export declare function setAllSelection(view: EditorView): void;
7
- export declare function setGapCursorSelection(view: EditorView, pos: number, side: Side): void;
8
6
  export declare function setCellSelection(view: EditorView, anchor: number, head?: number): void;
9
7
  export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
10
8
  export declare const duplicateSelection: (selectionToDuplicate: Selection, doc: Node) => Selection | undefined;
@@ -26,9 +26,6 @@ export { changeColor } from './plugins/text-color/commands/change-color';
26
26
  export { insertHorizontalRule } from './plugins/rule/commands';
27
27
  export { blockPluginStateKey } from './plugins';
28
28
  export type { BlockTypeState } from './plugins';
29
- export { pluginKey as listStateKey } from './plugins/list/pm-plugins/main';
30
- export type { ListState } from './plugins/list/types';
31
- export type { InputMethod as ListInputMethod } from './plugins/list/commands';
32
29
  export { subscribeToToolbarAndPickerUpdates } from './plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates';
33
30
  export { subscribeTypeAheadUpdates } from './plugins/view-update-subscription/subscribe/type-ahead-updates';
34
31
  export type { InputMethodToolbar as TextFormattingInputMethodToolbar, InputMethodBasic as TextFormattingInputMethodBasic, } from '@atlaskit/editor-common/types';
@@ -1,5 +1,5 @@
1
1
  import analyticsPlugin from './plugin';
2
- export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, LIST_TEXT_SCENARIOS, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
2
+ export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
3
3
  export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, FireAnalyticsCallback, FireAnalyticsEvent, } from '@atlaskit/editor-common/analytics';
4
4
  export { withAnalytics, addAnalytics } from './utils';
5
5
  export declare const analyticsPluginKey: import("prosemirror-state").PluginKey<any>;
@@ -6,4 +6,4 @@ export type { MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, } from '.
6
6
  export type { DispatchAnalyticsEvent } from './dispatch-analytics-event';
7
7
  export type { CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, } from './link-tool-bar-events';
8
8
  export type { FormatEventPayload, CommonListAnalyticsAttributes, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, ListEventPayload, PasteContent, PasteEventPayload, PasteSource, PasteType, PasteContents, SubstituteEventPayload, TableEventPayload, PasteSources, PasteTypes, PASTE_ACTION_SUBJECT_ID, } from '@atlaskit/editor-common/analytics';
9
- export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE, LIST_TEXT_SCENARIOS, SYMBOL, TABLE_BREAKOUT, } from '@atlaskit/editor-common/analytics';
9
+ export { USER_CONTEXT, DELETE_DIRECTION, INDENT_DIRECTION, PUNC, TABLE_ACTION, INDENT_TYPE, SYMBOL, TABLE_BREAKOUT, } from '@atlaskit/editor-common/analytics';
@@ -14,7 +14,6 @@ export { default as helpDialogPlugin } from './help-dialog';
14
14
  export { default as insertBlockPlugin } from './insert-block';
15
15
  export { default as jiraIssuePlugin } from './jira-issue';
16
16
  export { default as layoutPlugin } from './layout';
17
- export { default as listPlugin } from './list';
18
17
  export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
19
18
  export { default as macroPlugin } from './macro';
20
19
  export { default as maxContentSizePlugin } from './max-content-size';
@@ -3,7 +3,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
3
3
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
4
4
  import type { cardPlugin } from '@atlaskit/editor-plugin-card';
5
5
  import type betterTypeHistoryPlugin from '../better-type-history';
6
- import type listPlugin from '../list';
6
+ import type { listPlugin } from '@atlaskit/editor-plugin-list';
7
7
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
8
  export type PastePluginOptions = {
9
9
  cardOptions?: CardOptions;
@@ -40,6 +40,7 @@ export declare class ToolbarTextColor extends React.Component<Props & WrappedCom
40
40
  private handleOpenChange;
41
41
  private hide;
42
42
  private hideonEsc;
43
+ private getSelectedColor;
43
44
  private getCommonAnalyticsAttributes;
44
45
  private buildAnalyticsPalette;
45
46
  private buildAnalyticsSelectColor;
@@ -1,8 +1,6 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
4
3
  import type { Command, HigherOrderCommand } from '@atlaskit/editor-common/types';
5
- declare const isFirstChildOfParent: (state: EditorState) => boolean;
6
4
  /**
7
5
  * Creates a filter that checks if the node at a given number of parents above the current
8
6
  * selection is of the correct node type.
@@ -12,7 +10,6 @@ declare const isFirstChildOfParent: (state: EditorState) => boolean;
12
10
  * is usually inside the text content.
13
11
  */
14
12
  declare const isNthParentOfType: (nodeType: string, depthAway: number) => (state: EditorState, view?: EditorView) => boolean;
15
- declare function findCutBefore($pos: ResolvedPos): ResolvedPos | null;
16
13
  declare const withScrollIntoView: HigherOrderCommand;
17
14
  /**
18
15
  * Insert content, delete a range and create a new selection
@@ -24,4 +21,4 @@ declare const withScrollIntoView: HigherOrderCommand;
24
21
  * @param deletions the ranges to delete
25
22
  */
26
23
  declare const selectNode: (pos: number) => Command;
27
- export { isFirstChildOfParent, isNthParentOfType, findCutBefore, withScrollIntoView, selectNode, };
24
+ export { isNthParentOfType, withScrollIntoView, selectNode };
@@ -4,9 +4,8 @@ import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
4
4
  export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, } from '@atlaskit/editor-common/utils';
5
5
  export { insideTable } from '@atlaskit/editor-common/core-utils';
6
6
  export { isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount, } from './document';
7
- export { sanitiseMarksInSelection } from './mark';
8
7
  export { isParagraph, isText, isLinkMark } from './nodes';
9
- export { setNodeSelection, setGapCursorSelection, setTextSelection, } from './selection';
8
+ export { setNodeSelection, setTextSelection } from './selection';
10
9
  export type { JSONDocNode };
11
10
  export { default as measurements } from './performance/measure-enum';
12
11
  export declare function getCursor(selection: Selection): ResolvedPos | undefined;
@@ -1,14 +1,4 @@
1
- import type { Node, Mark, MarkType, NodeType } from '@atlaskit/editor-prosemirror/model';
2
- import type { SelectionRange, EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import type { Node, Mark, MarkType } from '@atlaskit/editor-prosemirror/model';
2
+ import type { SelectionRange } from '@atlaskit/editor-prosemirror/state';
3
3
  export declare const isMarkAllowedInRange: (doc: Node, ranges: readonly SelectionRange[], type: MarkType) => boolean;
4
4
  export declare const isMarkExcluded: (type: MarkType, marks?: readonly Mark[] | null) => boolean;
5
- /**
6
- * Removes marks from nodes in the current selection that are not supported
7
- */
8
- export declare const sanitiseSelectionMarksForWrapping: (state: EditorState, newParentType?: NodeType) => Transaction | undefined;
9
- type NodesSanitized = Array<{
10
- node: Node;
11
- marksRemoved: Mark[];
12
- }>;
13
- export declare const sanitiseMarksInSelection: (tr: Transaction, newParentType?: NodeType) => NodesSanitized;
14
- export {};
@@ -1,10 +1,8 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Node } from '@atlaskit/editor-prosemirror/model';
4
- import type { Side } from '@atlaskit/editor-common/selection';
5
4
  export { setNodeSelection, setTextSelection, } from '@atlaskit/editor-common/utils';
6
5
  export declare function setAllSelection(view: EditorView): void;
7
- export declare function setGapCursorSelection(view: EditorView, pos: number, side: Side): void;
8
6
  export declare function setCellSelection(view: EditorView, anchor: number, head?: number): void;
9
7
  export declare const isValidPosition: (pos: number, state: EditorState) => boolean;
10
8
  export declare const duplicateSelection: (selectionToDuplicate: Selection, doc: Node) => Selection | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.28.3",
3
+ "version": "187.29.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/code": "^14.6.0",
56
56
  "@atlaskit/date": "^0.10.0",
57
57
  "@atlaskit/datetime-picker": "^12.7.0",
58
- "@atlaskit/editor-common": "^74.49.0",
58
+ "@atlaskit/editor-common": "^74.50.0",
59
59
  "@atlaskit/editor-json-transformer": "^8.10.0",
60
60
  "@atlaskit/editor-markdown-transformer": "^5.2.5",
61
61
  "@atlaskit/editor-palette": "1.5.1",
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/editor-plugin-guideline": "^0.3.4",
74
74
  "@atlaskit/editor-plugin-hyperlink": "^0.3.0",
75
75
  "@atlaskit/editor-plugin-image-upload": "^0.1.0",
76
- "@atlaskit/editor-plugin-list": "^0.2.0",
76
+ "@atlaskit/editor-plugin-list": "^1.0.0",
77
77
  "@atlaskit/editor-plugin-table": "^2.10.0",
78
78
  "@atlaskit/editor-plugin-text-formatting": "^0.2.0",
79
79
  "@atlaskit/editor-plugin-width": "^0.1.0",
package/report.api.md CHANGED
@@ -93,7 +93,6 @@ import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
93
93
  import { jsx } from '@emotion/react';
94
94
  import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
95
95
  import type { LinkingOptions } from '@atlaskit/editor-common/types';
96
- import { ListState } from '@atlaskit/editor-plugin-list';
97
96
  import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
98
97
  import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
99
98
  import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
@@ -1185,14 +1184,6 @@ export { lightModeStatusColorPalette };
1185
1184
  // @public (undocumented)
1186
1185
  type Listener = (data: any) => void;
1187
1186
 
1188
- // @public (undocumented)
1189
- export type ListInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
1190
-
1191
- export { ListState };
1192
-
1193
- // @public (undocumented)
1194
- export const listStateKey: PluginKey<ListState>;
1195
-
1196
1187
  export { MacroAttributes };
1197
1188
 
1198
1189
  export { MacroProvider };
@@ -82,7 +82,6 @@ import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
82
82
  import { jsx } from '@emotion/react';
83
83
  import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
84
84
  import type { LinkingOptions } from '@atlaskit/editor-common/types';
85
- import { ListState } from '@atlaskit/editor-plugin-list';
86
85
  import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
87
86
  import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
88
87
  import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
@@ -1062,14 +1061,6 @@ export { lightModeStatusColorPalette }
1062
1061
  // @public (undocumented)
1063
1062
  type Listener = (data: any) => void;
1064
1063
 
1065
- // @public (undocumented)
1066
- export type ListInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
1067
-
1068
- export { ListState }
1069
-
1070
- // @public (undocumented)
1071
- export const listStateKey: PluginKey<ListState>;
1072
-
1073
1064
  export { MacroAttributes }
1074
1065
 
1075
1066
  export { MacroProvider }
@@ -1,153 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.convertListType = convertListType;
7
- var _state = require("@atlaskit/editor-prosemirror/state");
8
- var _model = require("@atlaskit/editor-prosemirror/model");
9
- var _transform = require("@atlaskit/editor-prosemirror/transform");
10
- var _utils = require("@atlaskit/editor-prosemirror/utils");
11
- var _utils2 = require("@atlaskit/editor-common/utils");
12
- var _lists = require("@atlaskit/editor-common/lists");
13
- var _find = require("../utils/find");
14
- var _selection = require("@atlaskit/editor-common/selection");
15
- function convertListType(_ref) {
16
- var tr = _ref.tr,
17
- nextListNodeType = _ref.nextListNodeType;
18
- var doc = tr.doc,
19
- _tr$selection = tr.selection,
20
- $from = _tr$selection.$from,
21
- $to = _tr$selection.$to;
22
- var listRange;
23
- if (tr.selection instanceof _selection.GapCursorSelection) {
24
- var _$from$nodeAfter;
25
- var nodeSize = ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.nodeSize) || 1;
26
- listRange = $from.blockRange($from.doc.resolve($from.pos + nodeSize));
27
- } else {
28
- listRange = $from.blockRange($to, _utils2.isListNode);
29
- }
30
- if (listRange) {
31
- return convertSelectedList({
32
- tr: tr,
33
- nextListNodeType: nextListNodeType
34
- });
35
- }
36
- var nodeRangeAroundList = $from.blockRange($to);
37
- if (!nodeRangeAroundList) {
38
- return;
39
- }
40
- var parentNode = nodeRangeAroundList.parent;
41
- var startIndex = nodeRangeAroundList.startIndex,
42
- endIndex = nodeRangeAroundList.endIndex,
43
- depth = nodeRangeAroundList.depth;
44
-
45
- // Checking for invalid nodes to prevent conversion
46
- // eg. a panel cannot be wrapped in a list so return
47
- // It will skip this check if the selection begins within a list
48
- // This is to match the behaviour of the toolbar buttons being disabled
49
- if (!(0, _find.findFirstParentListNode)($from)) {
50
- for (var i = startIndex; i < endIndex; i++) {
51
- var position = nodeRangeAroundList.$from.posAtIndex(i, depth);
52
- var resolvedPosition = doc.resolve(position);
53
- var currentChild = parentNode.child(i);
54
- var currentNodeRange = resolvedPosition.blockRange(tr.doc.resolve(position + currentChild.nodeSize));
55
- if (currentNodeRange && !(0, _utils2.isListNode)(currentChild) && !(0, _transform.findWrapping)(currentNodeRange, nextListNodeType)) {
56
- return;
57
- }
58
- }
59
- }
60
-
61
- // Checking for any non list nodes and wrapping them in a list
62
- // so they can be converted
63
- tr.doc.nodesBetween(nodeRangeAroundList.start, nodeRangeAroundList.end, function (node, pos) {
64
- // Skip over any nodes that are part of a list
65
- if ((0, _find.findFirstParentListNode)(tr.doc.resolve(tr.mapping.map(pos)))) {
66
- return false;
67
- }
68
-
69
- // The following applies to suitable nodes that are not within a list
70
- var currentNodeNotWrappedInList = node;
71
- var isNotAnEmptyParagraphAndIsParagraphOrLeafNode = !(0, _utils2.isEmptyParagraph)(currentNodeNotWrappedInList) && (!node.type.isBlock || node.type.name === 'paragraph');
72
- if (isNotAnEmptyParagraphAndIsParagraphOrLeafNode && nodeRangeAroundList) {
73
- var remainingNodeRange = new _model.NodeRange(tr.doc.resolve(tr.mapping.map(pos)), tr.doc.resolve(tr.mapping.map(pos) + currentNodeNotWrappedInList.nodeSize), nodeRangeAroundList.depth);
74
- convertAroundList({
75
- tr: tr,
76
- nextListNodeType: nextListNodeType,
77
- nodeRange: remainingNodeRange
78
- });
79
- return false;
80
- }
81
- });
82
- convertSelectedList({
83
- tr: tr,
84
- nextListNodeType: nextListNodeType
85
- });
86
- if (tr.docChanged) {
87
- (0, _lists.joinSiblingLists)({
88
- tr: tr,
89
- forceListType: nextListNodeType
90
- });
91
- }
92
- }
93
- var convertSelectedList = function convertSelectedList(_ref2) {
94
- var tr = _ref2.tr,
95
- nextListNodeType = _ref2.nextListNodeType;
96
- var selection = tr.selection,
97
- _tr$selection2 = tr.selection,
98
- from = _tr$selection2.from,
99
- to = _tr$selection2.to;
100
- var codeBlock = tr.doc.type.schema.nodes.codeBlock;
101
- // get the positions of all the leaf nodes within the selection
102
- var nodePositions = [];
103
- if (selection instanceof _state.TextSelection && selection.$cursor || selection instanceof _selection.GapCursorSelection) {
104
- nodePositions.push(from);
105
- } else {
106
- // nodesBetween doesn't return leaf nodes that are outside of from and to
107
- tr.doc.nodesBetween(from, to, function (node, pos) {
108
- // isLeaf is false for empty codeBlock so adding additional check for childCount
109
- if (!node.isLeaf && !(node.type === codeBlock && node.childCount === 0)) {
110
- return true;
111
- }
112
- nodePositions.push(pos);
113
- });
114
- }
115
-
116
- // use those positions to get the closest parent list nodes
117
- nodePositions.reduce(function (acc, pos) {
118
- var closestParentListNode = (0, _utils.findParentNodeClosestToPos)(tr.doc.resolve(pos), _utils2.isListNode);
119
- if (!closestParentListNode) {
120
- return acc;
121
- }
122
-
123
- // don't add duplicates if the parent has already been added into the array
124
- var existingParent = acc.find(function (node) {
125
- return node.pos === closestParentListNode.pos && node.start === closestParentListNode.start && node.depth === closestParentListNode.depth;
126
- });
127
- if (!existingParent) {
128
- acc.push(closestParentListNode);
129
- }
130
- return acc;
131
- }, []).forEach(function (item) {
132
- tr.setNodeMarkup(item.pos, nextListNodeType);
133
- });
134
- };
135
- var convertAroundList = function convertAroundList(_ref3) {
136
- var tr = _ref3.tr,
137
- nextListNodeType = _ref3.nextListNodeType,
138
- nodeRange = _ref3.nodeRange;
139
- for (var i = nodeRange.endIndex - 1; i >= nodeRange.startIndex; i--) {
140
- // @ts-ignore posAtIndex is a public API but has no type yet
141
- var position = nodeRange.$from.posAtIndex(i, nodeRange.depth);
142
- var resolvedPos = tr.doc.resolve(position + 1);
143
- var range = resolvedPos.blockRange(resolvedPos);
144
- if (!range) {
145
- return;
146
- }
147
- var wrappings = (0, _transform.findWrapping)(range, nextListNodeType);
148
- if (!range || !wrappings) {
149
- return;
150
- }
151
- tr.wrap(range, wrappings);
152
- }
153
- };