@atlaskit/editor-core 187.8.3 → 187.8.10

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 (275) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/create-editor/ReactEditorViewInternal.js +4 -5
  3. package/dist/cjs/index.js +0 -6
  4. package/dist/cjs/plugins/annotation/commands/transform.js +2 -2
  5. package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
  6. package/dist/cjs/plugins/block-type/commands/block-type.js +2 -2
  7. package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +4 -4
  8. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -2
  9. package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +5 -5
  10. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -2
  11. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -2
  12. package/dist/cjs/plugins/layout/pm-plugins/main.js +1 -1
  13. package/dist/cjs/plugins/list/actions/conversions.js +5 -5
  14. package/dist/cjs/plugins/list/actions/indent-list-items-selected.js +11 -11
  15. package/dist/cjs/plugins/list/actions/join-list-items-forward.js +6 -6
  16. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +6 -7
  17. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +3 -4
  18. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +3 -4
  19. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +2 -2
  20. package/dist/cjs/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +2 -2
  21. package/dist/cjs/plugins/list/actions/merge-lists.js +3 -3
  22. package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +11 -11
  23. package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +2 -2
  24. package/dist/cjs/plugins/list/commands/indent-list.js +6 -7
  25. package/dist/cjs/plugins/list/commands/index.js +8 -10
  26. package/dist/cjs/plugins/list/commands/join-list-item-forward.js +5 -5
  27. package/dist/cjs/plugins/list/commands/listBackspace.js +13 -14
  28. package/dist/cjs/plugins/list/commands/outdent-list.js +4 -3
  29. package/dist/cjs/plugins/list/pm-plugins/main.js +5 -6
  30. package/dist/cjs/plugins/list/utils/analytics.js +1 -35
  31. package/dist/cjs/plugins/list/utils/indentation.js +2 -20
  32. package/dist/cjs/plugins/list/utils/node.js +2 -106
  33. package/dist/cjs/plugins/list/utils/selection.js +3 -54
  34. package/dist/cjs/plugins/tasks-and-decisions/commands.js +2 -2
  35. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +17 -18
  36. package/dist/cjs/plugins/text-color/commands/toggle-color.js +2 -2
  37. package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +9 -9
  38. package/dist/cjs/plugins/text-formatting/commands/transform-to-code.js +2 -2
  39. package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -5
  40. package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +2 -2
  41. package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +2 -1
  42. package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +2 -2
  43. package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +2 -3
  44. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
  45. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
  46. package/dist/cjs/ui/Appearance/Comment/Comment.js +5 -6
  47. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +2 -2
  48. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -2
  49. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +5 -5
  50. package/dist/cjs/ui/Dropdown/index.js +1 -2
  51. package/dist/cjs/ui/styles.js +3 -5
  52. package/dist/cjs/utils/commands.js +3 -222
  53. package/dist/cjs/utils/document.js +1 -26
  54. package/dist/cjs/utils/index.js +0 -19
  55. package/dist/cjs/version-wrapper.js +1 -1
  56. package/dist/cjs/version.json +1 -1
  57. package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -6
  58. package/dist/es2019/index.js +1 -1
  59. package/dist/es2019/plugins/annotation/commands/transform.js +1 -1
  60. package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
  61. package/dist/es2019/plugins/block-type/commands/block-type.js +1 -1
  62. package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +1 -1
  63. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
  64. package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  65. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -5
  66. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
  67. package/dist/es2019/plugins/layout/pm-plugins/main.js +1 -1
  68. package/dist/es2019/plugins/list/actions/conversions.js +2 -2
  69. package/dist/es2019/plugins/list/actions/indent-list-items-selected.js +2 -2
  70. package/dist/es2019/plugins/list/actions/join-list-items-forward.js +1 -1
  71. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
  72. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
  73. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
  74. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
  75. package/dist/es2019/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
  76. package/dist/es2019/plugins/list/actions/merge-lists.js +1 -1
  77. package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +3 -3
  78. package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +1 -1
  79. package/dist/es2019/plugins/list/commands/indent-list.js +3 -4
  80. package/dist/es2019/plugins/list/commands/index.js +4 -5
  81. package/dist/es2019/plugins/list/commands/join-list-item-forward.js +1 -1
  82. package/dist/es2019/plugins/list/commands/listBackspace.js +1 -2
  83. package/dist/es2019/plugins/list/commands/outdent-list.js +3 -2
  84. package/dist/es2019/plugins/list/pm-plugins/main.js +1 -1
  85. package/dist/es2019/plugins/list/utils/analytics.js +0 -36
  86. package/dist/es2019/plugins/list/utils/indentation.js +0 -18
  87. package/dist/es2019/plugins/list/utils/node.js +3 -89
  88. package/dist/es2019/plugins/list/utils/selection.js +1 -52
  89. package/dist/es2019/plugins/tasks-and-decisions/commands.js +1 -1
  90. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
  91. package/dist/es2019/plugins/text-color/commands/toggle-color.js +1 -1
  92. package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +1 -1
  93. package/dist/es2019/plugins/text-formatting/commands/transform-to-code.js +1 -1
  94. package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
  95. package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
  96. package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +2 -1
  97. package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
  98. package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
  99. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
  100. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
  101. package/dist/es2019/ui/Appearance/Comment/Comment.js +6 -5
  102. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +3 -2
  103. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
  104. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
  105. package/dist/es2019/ui/Dropdown/index.js +1 -2
  106. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
  107. package/dist/es2019/ui/styles.js +0 -5
  108. package/dist/es2019/utils/commands.js +2 -214
  109. package/dist/es2019/utils/document.js +1 -26
  110. package/dist/es2019/utils/index.js +1 -13
  111. package/dist/es2019/version-wrapper.js +1 -1
  112. package/dist/es2019/version.json +1 -1
  113. package/dist/esm/create-editor/ReactEditorViewInternal.js +3 -6
  114. package/dist/esm/index.js +1 -1
  115. package/dist/esm/plugins/annotation/commands/transform.js +1 -1
  116. package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
  117. package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
  118. package/dist/esm/plugins/block-type/pm-plugins/keymap.js +1 -1
  119. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
  120. package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  121. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -5
  122. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -1
  123. package/dist/esm/plugins/layout/pm-plugins/main.js +1 -1
  124. package/dist/esm/plugins/list/actions/conversions.js +2 -2
  125. package/dist/esm/plugins/list/actions/indent-list-items-selected.js +2 -2
  126. package/dist/esm/plugins/list/actions/join-list-items-forward.js +1 -1
  127. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +1 -2
  128. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +2 -2
  129. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +2 -2
  130. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-paragraph-with-list.js +1 -1
  131. package/dist/esm/plugins/list/actions/join-list-items-scenarios/join-sibling-list-items.js +1 -1
  132. package/dist/esm/plugins/list/actions/merge-lists.js +1 -1
  133. package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +3 -3
  134. package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +1 -1
  135. package/dist/esm/plugins/list/commands/indent-list.js +3 -4
  136. package/dist/esm/plugins/list/commands/index.js +4 -5
  137. package/dist/esm/plugins/list/commands/join-list-item-forward.js +1 -1
  138. package/dist/esm/plugins/list/commands/listBackspace.js +1 -2
  139. package/dist/esm/plugins/list/commands/outdent-list.js +3 -2
  140. package/dist/esm/plugins/list/pm-plugins/main.js +1 -1
  141. package/dist/esm/plugins/list/utils/analytics.js +0 -32
  142. package/dist/esm/plugins/list/utils/indentation.js +0 -17
  143. package/dist/esm/plugins/list/utils/node.js +3 -81
  144. package/dist/esm/plugins/list/utils/selection.js +3 -51
  145. package/dist/esm/plugins/tasks-and-decisions/commands.js +1 -1
  146. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
  147. package/dist/esm/plugins/text-color/commands/toggle-color.js +1 -1
  148. package/dist/esm/plugins/text-formatting/commands/text-formatting.js +1 -1
  149. package/dist/esm/plugins/text-formatting/commands/transform-to-code.js +1 -1
  150. package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting.js +2 -2
  151. package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +1 -1
  152. package/dist/esm/plugins/text-formatting/pm-plugins/main.js +2 -1
  153. package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +1 -1
  154. package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -2
  155. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +2 -1
  156. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +1 -1
  157. package/dist/esm/ui/Appearance/Comment/Comment.js +4 -5
  158. package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
  159. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -3
  160. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
  161. package/dist/esm/ui/Dropdown/index.js +1 -2
  162. package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
  163. package/dist/esm/ui/styles.js +2 -3
  164. package/dist/esm/utils/commands.js +2 -211
  165. package/dist/esm/utils/document.js +1 -26
  166. package/dist/esm/utils/index.js +1 -13
  167. package/dist/esm/version-wrapper.js +1 -1
  168. package/dist/esm/version.json +1 -1
  169. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +0 -1
  170. package/dist/types/index.d.ts +1 -1
  171. package/dist/types/plugins/block-type/commands/block-type.d.ts +1 -2
  172. package/dist/types/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
  173. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
  174. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
  175. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
  176. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
  177. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
  178. package/dist/types/plugins/list/actions/join-list-items-forward.d.ts +1 -1
  179. package/dist/types/plugins/list/commands/indent-list.d.ts +2 -1
  180. package/dist/types/plugins/list/commands/index.d.ts +2 -1
  181. package/dist/types/plugins/list/commands/join-list-item-forward.d.ts +1 -1
  182. package/dist/types/plugins/list/commands/listBackspace.d.ts +1 -1
  183. package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
  184. package/dist/types/plugins/list/utils/analytics.d.ts +2 -4
  185. package/dist/types/plugins/list/utils/indentation.d.ts +0 -5
  186. package/dist/types/plugins/list/utils/node.d.ts +2 -17
  187. package/dist/types/plugins/list/utils/selection.d.ts +1 -12
  188. package/dist/types/plugins/text-color/commands/toggle-color.d.ts +1 -1
  189. package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
  190. package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  191. package/dist/types/types/editor-appearance-component.d.ts +4 -4
  192. package/dist/types/types/editor-instance.d.ts +1 -1
  193. package/dist/types/types/editor-props.d.ts +5 -8
  194. package/dist/types/ui/Appearance/Comment/Comment.d.ts +2 -2
  195. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
  196. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  197. package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
  198. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  199. package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -1
  200. package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
  201. package/dist/types/ui/ElementBrowser/types.d.ts +1 -1
  202. package/dist/types/ui/styles.d.ts +0 -1
  203. package/dist/types/utils/commands.d.ts +3 -42
  204. package/dist/types/utils/document.d.ts +0 -4
  205. package/dist/types/utils/index.d.ts +1 -5
  206. package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +0 -1
  207. package/dist/types-ts4.5/index.d.ts +1 -1
  208. package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +1 -2
  209. package/dist/types-ts4.5/plugins/code-block/ide-ux/quote-handling.d.ts +1 -1
  210. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -1
  211. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
  212. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +1 -1
  213. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +1 -1
  214. package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -1
  215. package/dist/types-ts4.5/plugins/list/actions/join-list-items-forward.d.ts +1 -1
  216. package/dist/types-ts4.5/plugins/list/commands/indent-list.d.ts +2 -1
  217. package/dist/types-ts4.5/plugins/list/commands/index.d.ts +2 -1
  218. package/dist/types-ts4.5/plugins/list/commands/join-list-item-forward.d.ts +1 -1
  219. package/dist/types-ts4.5/plugins/list/commands/listBackspace.d.ts +1 -1
  220. package/dist/types-ts4.5/plugins/list/commands/outdent-list.d.ts +2 -1
  221. package/dist/types-ts4.5/plugins/list/utils/analytics.d.ts +2 -4
  222. package/dist/types-ts4.5/plugins/list/utils/indentation.d.ts +0 -5
  223. package/dist/types-ts4.5/plugins/list/utils/node.d.ts +2 -17
  224. package/dist/types-ts4.5/plugins/list/utils/selection.d.ts +1 -12
  225. package/dist/types-ts4.5/plugins/text-color/commands/toggle-color.d.ts +1 -1
  226. package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +2 -2
  227. package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
  228. package/dist/types-ts4.5/types/editor-appearance-component.d.ts +4 -4
  229. package/dist/types-ts4.5/types/editor-instance.d.ts +1 -1
  230. package/dist/types-ts4.5/types/editor-props.d.ts +5 -8
  231. package/dist/types-ts4.5/ui/Appearance/Comment/Comment.d.ts +2 -2
  232. package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +1 -2
  233. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  234. package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +1 -1
  235. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  236. package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +1 -1
  237. package/dist/types-ts4.5/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +1 -1
  238. package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +1 -1
  239. package/dist/types-ts4.5/ui/styles.d.ts +0 -1
  240. package/dist/types-ts4.5/utils/commands.d.ts +3 -48
  241. package/dist/types-ts4.5/utils/document.d.ts +0 -4
  242. package/dist/types-ts4.5/utils/index.d.ts +1 -5
  243. package/package.json +3 -3
  244. package/report.api.md +2 -13
  245. package/tmp/api-report-tmp.d.ts +2 -10
  246. package/dist/cjs/plugins/list/utils/replace-content.js +0 -24
  247. package/dist/cjs/ui/Appearance/FullPage/messages.js +0 -25
  248. package/dist/cjs/ui/DropdownMenu/index.js +0 -31
  249. package/dist/cjs/ui/DropdownMenu/types.js +0 -5
  250. package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -218
  251. package/dist/cjs/utils/prosemirror/autojoin.js +0 -68
  252. package/dist/es2019/plugins/list/utils/replace-content.js +0 -18
  253. package/dist/es2019/ui/Appearance/FullPage/messages.js +0 -18
  254. package/dist/es2019/ui/DropdownMenu/index.js +0 -18
  255. package/dist/es2019/ui/DropdownMenu/types.js +0 -1
  256. package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
  257. package/dist/es2019/utils/prosemirror/autojoin.js +0 -57
  258. package/dist/esm/plugins/list/utils/replace-content.js +0 -17
  259. package/dist/esm/ui/Appearance/FullPage/messages.js +0 -18
  260. package/dist/esm/ui/DropdownMenu/index.js +0 -20
  261. package/dist/esm/ui/DropdownMenu/types.js +0 -1
  262. package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +0 -205
  263. package/dist/esm/utils/prosemirror/autojoin.js +0 -63
  264. package/dist/types/plugins/list/utils/replace-content.d.ts +0 -8
  265. package/dist/types/ui/Appearance/FullPage/messages.d.ts +0 -18
  266. package/dist/types/ui/DropdownMenu/index.d.ts +0 -3
  267. package/dist/types/ui/DropdownMenu/types.d.ts +0 -1
  268. package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +0 -31
  269. package/dist/types/utils/prosemirror/autojoin.d.ts +0 -13
  270. package/dist/types-ts4.5/plugins/list/utils/replace-content.d.ts +0 -8
  271. package/dist/types-ts4.5/ui/Appearance/FullPage/messages.d.ts +0 -18
  272. package/dist/types-ts4.5/ui/DropdownMenu/index.d.ts +0 -3
  273. package/dist/types-ts4.5/ui/DropdownMenu/types.d.ts +0 -1
  274. package/dist/types-ts4.5/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +0 -31
  275. package/dist/types-ts4.5/utils/prosemirror/autojoin.d.ts +0 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 187.8.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d8c1bcdc71a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d8c1bcdc71a) - ED-19217 decoupled lists related util functions from editor-core
8
+ - Updated dependencies
9
+
10
+ ## 187.8.7
11
+
12
+ ### Patch Changes
13
+
14
+ - [`22e9c894ca1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/22e9c894ca1) - update test for numbered column table
15
+ - [`3a1cd78b42a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a1cd78b42a) - [ED-19203] Moving some common logic, styles, and types to editor-common to make it easier to extract the text-formatting plugin from editor-core
16
+ - Updated dependencies
17
+
3
18
  ## 187.8.3
4
19
 
5
20
  ### Patch Changes
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.ReactEditorView = exports.EDIT_AREA_ID = void 0;
7
+ exports.ReactEditorView = void 0;
8
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -35,12 +35,13 @@ var _document = require("../utils/document");
35
35
  var _createSchema = require("./create-schema");
36
36
  var _pluginPerformanceObserver = require("../utils/performance/plugin-performance-observer");
37
37
  var _getParticipantsCount = require("../plugins/collab-edit/get-participants-count");
38
- var _countNodes2 = require("../utils/count-nodes");
39
38
  var _trackTransactions = require("../utils/performance/track-transactions");
39
+ var _countNodes2 = require("../utils/count-nodes");
40
40
  var _consts = require("./consts");
41
41
  var _contextIdentifier = require("../plugins/base/pm-plugins/context-identifier");
42
42
  var _ReactEditorViewContext = _interopRequireDefault(require("./ReactEditorViewContext"));
43
43
  var _preset = require("@atlaskit/editor-common/preset");
44
+ var _ui = require("@atlaskit/editor-common/ui");
44
45
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
45
46
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
46
47
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
@@ -82,8 +83,6 @@ function handleEditorFocus(view) {
82
83
  view.focus();
83
84
  }, 0);
84
85
  }
85
- var EDIT_AREA_ID = 'ak-editor-textarea';
86
- exports.EDIT_AREA_ID = EDIT_AREA_ID;
87
86
  var ReactEditorView = /*#__PURE__*/function (_React$Component) {
88
87
  (0, _inherits2.default)(ReactEditorView, _React$Component);
89
88
  var _super = _createSuper(ReactEditorView);
@@ -529,7 +528,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
529
528
  ,
530
529
  "aria-multiline": _this.props.editorProps.appearance !== 'mobile' ? true : false,
531
530
  role: "textbox",
532
- id: EDIT_AREA_ID
531
+ id: _ui.EDIT_AREA_ID
533
532
  });
534
533
  });
535
534
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "editor", _this.createEditor(_this.props.editorProps.assistiveLabel));
package/dist/cjs/index.js CHANGED
@@ -287,12 +287,6 @@ Object.defineProperty(exports, "getNodesCount", {
287
287
  return _utils.getNodesCount;
288
288
  }
289
289
  });
290
- Object.defineProperty(exports, "hasVisibleContent", {
291
- enumerable: true,
292
- get: function get() {
293
- return _utils.hasVisibleContent;
294
- }
295
- });
296
290
  Object.defineProperty(exports, "historyPluginKey", {
297
291
  enumerable: true,
298
292
  get: function get() {
@@ -9,7 +9,7 @@ var _adfSchema = require("@atlaskit/adf-schema");
9
9
  var _analytics = require("@atlaskit/editor-common/analytics");
10
10
  var _utils = require("../../analytics/utils");
11
11
  var _utils2 = require("../utils");
12
- var _commands = require("../../../utils/commands");
12
+ var _mark = require("@atlaskit/editor-common/mark");
13
13
  var addAnnotationMark = function addAnnotationMark(id) {
14
14
  return function (transaction, state) {
15
15
  var inlineCommentState = (0, _utils2.getPluginState)(state);
@@ -22,7 +22,7 @@ var addAnnotationMark = function addAnnotationMark(id) {
22
22
  type: _adfSchema.AnnotationTypes.INLINE_COMMENT
23
23
  });
24
24
  // Apply the mark only to text node in the range.
25
- var tr = (0, _commands.applyMarkOnRange)(from, to, false, annotationMark, transaction);
25
+ var tr = (0, _mark.applyMarkOnRange)(from, to, false, annotationMark, transaction);
26
26
  // set selection back to the end of annotation once annotation mark is applied
27
27
  tr.setSelection(_state.TextSelection.create(tr.doc, head));
28
28
  return tr;
@@ -27,7 +27,7 @@ var _default = function _default() {
27
27
  key: newlinePreserveMarksKey,
28
28
  props: {
29
29
  handleKeyDown: (0, _keymap.keydownHandler)({
30
- Enter: (0, _utils.filterCommands)([_utils2.isSelectionEndOfParagraph, isSelectionAligned], splitBlockPreservingMarks)
30
+ Enter: (0, _utils.filterCommand)([_utils2.isSelectionEndOfParagraph, isSelectionAligned], splitBlockPreservingMarks)
31
31
  })
32
32
  }
33
33
  });
@@ -22,7 +22,7 @@ var _insert = require("@atlaskit/editor-common/insert");
22
22
  var _analytics = require("../../analytics");
23
23
  var _analytics2 = require("@atlaskit/editor-common/analytics");
24
24
  var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
25
- var _utils2 = require("../../../utils");
25
+ var _mark2 = require("@atlaskit/editor-common/mark");
26
26
  var _adfSchema = require("@atlaskit/adf-schema");
27
27
  var _editorTables = require("@atlaskit/editor-tables");
28
28
  var _transformToCodeBlock = require("./transform-to-code-block");
@@ -78,7 +78,7 @@ function withCurrentHeadingLevel(fn) {
78
78
  var _state$schema$nodes = state.schema.nodes,
79
79
  heading = _state$schema$nodes.heading,
80
80
  paragraph = _state$schema$nodes.paragraph;
81
- var nodes = (0, _utils2.filterChildrenBetween)(state.doc, state.selection.from, state.selection.to, function (node) {
81
+ var nodes = (0, _mark2.filterChildrenBetween)(state.doc, state.selection.from, state.selection.to, function (node) {
82
82
  return node.type === heading || node.type === paragraph;
83
83
  });
84
84
 
@@ -12,13 +12,13 @@ var commands = _interopRequireWildcard(require("../../../commands"));
12
12
  var blockTypes = _interopRequireWildcard(require("../types"));
13
13
  var _keymap = require("../../../utils/keymap");
14
14
  var _commands3 = require("../commands");
15
- var _commands4 = require("../../../utils/commands");
15
+ var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _analytics = require("../../analytics");
17
- var _utils = require("../utils");
17
+ var _utils2 = require("../utils");
18
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
19
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
- var backspace = (0, _commands.chainCommands)(_commands3.cleanUpAtTheStartOfDocument, (0, _commands3.deleteBlockContent)(_utils.isNodeAWrappingBlockNode), _commands3.deleteAndMoveCursor);
21
- var del = (0, _commands.chainCommands)((0, _commands4.deleteEmptyParagraphAndMoveBlockUp)(_utils.isNodeAWrappingBlockNode), (0, _commands3.deleteBlockContent)(_utils.isNodeAWrappingBlockNode), _commands3.deleteAndMoveCursor);
20
+ var backspace = (0, _commands.chainCommands)(_commands3.cleanUpAtTheStartOfDocument, (0, _commands3.deleteBlockContent)(_utils2.isNodeAWrappingBlockNode), _commands3.deleteAndMoveCursor);
21
+ var del = (0, _commands.chainCommands)((0, _utils.deleteEmptyParagraphAndMoveBlockUp)(_utils2.isNodeAWrappingBlockNode), (0, _commands3.deleteBlockContent)(_utils2.isNodeAWrappingBlockNode), _commands3.deleteAndMoveCursor);
22
22
  function keymapPlugin(schema, featureFlags, editorAnalyticsApi) {
23
23
  var list = {};
24
24
  keymaps.bindKeymapWithCommand(keymaps.insertNewLine.common, commands.insertNewLineWithAnalytics, list);
@@ -16,7 +16,7 @@ var _react = _interopRequireDefault(require("react"));
16
16
  var _react2 = require("@emotion/react");
17
17
  var _reactIntlNext = require("react-intl-next");
18
18
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
19
- var _DropdownMenu = _interopRequireDefault(require("../../../../ui/DropdownMenu"));
19
+ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
20
20
  var _styles = require("@atlaskit/editor-common/styles");
21
21
  var _styled = require("./styled");
22
22
  var _keymaps = require("../../../../keymaps");
@@ -137,7 +137,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
137
137
  var items = this.createItems();
138
138
  return (0, _react2.jsx)("span", {
139
139
  css: _styles.wrapperStyle
140
- }, (0, _react2.jsx)(_DropdownMenu.default, {
140
+ }, (0, _react2.jsx)(_uiMenu.DropdownMenuWithKeyboardNavigation, {
141
141
  items: items,
142
142
  onOpenChange: this.onOpenChange,
143
143
  onItemActivated: this.handleSelectBlockType,
@@ -95,10 +95,10 @@ var _default = new _safePlugin.SafePlugin({
95
95
  }
96
96
  return false;
97
97
  },
98
- Enter: (0, _utils3.filterCommands)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.insertNewlineWithIndent),
99
- 'Mod-]': (0, _utils3.filterCommands)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.indent),
100
- 'Mod-[': (0, _utils3.filterCommands)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
101
- Tab: (0, _utils3.filterCommands)(_lineHandling.isSelectionEntirelyInsideCodeBlock, function (state, dispatch) {
98
+ Enter: (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.insertNewlineWithIndent),
99
+ 'Mod-]': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.indent),
100
+ 'Mod-[': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
101
+ Tab: (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, function (state, dispatch) {
102
102
  if (!dispatch) {
103
103
  return false;
104
104
  }
@@ -107,7 +107,7 @@ var _default = new _safePlugin.SafePlugin({
107
107
  }
108
108
  return (0, _commands.indent)(state, dispatch);
109
109
  }),
110
- 'Shift-Tab': (0, _utils3.filterCommands)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
110
+ 'Shift-Tab': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
111
111
  'Mod-a': function ModA(state, dispatch) {
112
112
  if ((0, _lineHandling.isSelectionEntirelyInsideCodeBlock)(state)) {
113
113
  var _state$selection = state.selection,
@@ -37,7 +37,7 @@ var _reactIntlNext = require("react-intl-next");
37
37
  var _messages = _interopRequireDefault(require("./messages"));
38
38
  var _commands2 = require("@atlaskit/editor-plugin-table/commands");
39
39
  var _ScrollButtons = _interopRequireDefault(require("./ScrollButtons"));
40
- var _ToolbarArrowKeyNavigationProvider = require("../../../ui/ToolbarArrowKeyNavigationProvider");
40
+ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
41
41
  var _forceFocus = require("../pm-plugins/force-focus");
42
42
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
43
43
  /** @jsx jsx */
@@ -454,7 +454,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
454
454
  //Alt + F10 to reach first element in this floating toolbar
455
455
  return event.altKey && (event.key === 'F10' || event.keyCode === 121);
456
456
  };
457
- return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_ToolbarArrowKeyNavigationProvider.ToolbarArrowKeyNavigationProvider, {
457
+ return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
458
458
  editorView: this.props.editorView,
459
459
  handleEscape: this.handleEscape,
460
460
  disableArrowKeyNavigation: !this.shouldHandleArrowKeys(),
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.BlockInsertMenuLegacy = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
10
- var _DropdownMenu = _interopRequireDefault(require("../../../../ui/DropdownMenu"));
10
+ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
11
11
  var _dropdownButton = require("./dropdown-button");
12
12
  var BlockInsertMenuLegacy = function BlockInsertMenuLegacy(props) {
13
13
  var items = props.items;
@@ -16,7 +16,7 @@ var BlockInsertMenuLegacy = function BlockInsertMenuLegacy(props) {
16
16
  items: items
17
17
  }];
18
18
  }, [items]);
19
- return /*#__PURE__*/_react.default.createElement(_DropdownMenu.default, {
19
+ return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation, {
20
20
  items: dropdownItems,
21
21
  onItemActivated: props.onItemActivated,
22
22
  onOpenChange: props.onOpenChange,
@@ -96,7 +96,7 @@ var _default = function _default(options) {
96
96
  return undefined;
97
97
  },
98
98
  handleKeyDown: (0, _keymap.keydownHandler)({
99
- Tab: (0, _utils2.filterCommands)(isWholeSelectionInsideLayoutColumn, moveCursorToNextColumn)
99
+ Tab: (0, _utils2.filterCommand)(isWholeSelectionInsideLayoutColumn, moveCursorToNextColumn)
100
100
  }),
101
101
  handleClickOn: (0, _utils3.createSelectionClickHandler)(['layoutColumn'], function (target) {
102
102
  return target.hasAttribute('data-layout-section') || target.hasAttribute('data-layout-column');
@@ -8,8 +8,8 @@ var _state = require("@atlaskit/editor-prosemirror/state");
8
8
  var _model = require("@atlaskit/editor-prosemirror/model");
9
9
  var _transform = require("@atlaskit/editor-prosemirror/transform");
10
10
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
- var _node = require("../utils/node");
12
11
  var _utils2 = require("@atlaskit/editor-common/utils");
12
+ var _lists = require("@atlaskit/editor-common/lists");
13
13
  var _find = require("../utils/find");
14
14
  var _selection = require("@atlaskit/editor-common/selection");
15
15
  function convertListType(_ref) {
@@ -25,7 +25,7 @@ function convertListType(_ref) {
25
25
  var nodeSize = ((_$from$nodeAfter = $from.nodeAfter) === null || _$from$nodeAfter === void 0 ? void 0 : _$from$nodeAfter.nodeSize) || 1;
26
26
  listRange = $from.blockRange($from.doc.resolve($from.pos + nodeSize));
27
27
  } else {
28
- listRange = $from.blockRange($to, _node.isListNode);
28
+ listRange = $from.blockRange($to, _utils2.isListNode);
29
29
  }
30
30
  if (listRange) {
31
31
  return convertSelectedList({
@@ -52,7 +52,7 @@ function convertListType(_ref) {
52
52
  var resolvedPosition = doc.resolve(position);
53
53
  var currentChild = parentNode.child(i);
54
54
  var currentNodeRange = resolvedPosition.blockRange(tr.doc.resolve(position + currentChild.nodeSize));
55
- if (currentNodeRange && !(0, _node.isListNode)(currentChild) && !(0, _transform.findWrapping)(currentNodeRange, nextListNodeType)) {
55
+ if (currentNodeRange && !(0, _utils2.isListNode)(currentChild) && !(0, _transform.findWrapping)(currentNodeRange, nextListNodeType)) {
56
56
  return;
57
57
  }
58
58
  }
@@ -84,7 +84,7 @@ function convertListType(_ref) {
84
84
  nextListNodeType: nextListNodeType
85
85
  });
86
86
  if (tr.docChanged) {
87
- (0, _node.joinSiblingLists)({
87
+ (0, _lists.joinSiblingLists)({
88
88
  tr: tr,
89
89
  forceListType: nextListNodeType
90
90
  });
@@ -115,7 +115,7 @@ var convertSelectedList = function convertSelectedList(_ref2) {
115
115
 
116
116
  // use those positions to get the closest parent list nodes
117
117
  nodePositions.reduce(function (acc, pos) {
118
- var closestParentListNode = (0, _utils.findParentNodeClosestToPos)(tr.doc.resolve(pos), _node.isListNode);
118
+ var closestParentListNode = (0, _utils.findParentNodeClosestToPos)(tr.doc.resolve(pos), _utils2.isListNode);
119
119
  if (!closestParentListNode) {
120
120
  return acc;
121
121
  }
@@ -8,13 +8,13 @@ exports.indentListItemsSelected = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
- var _node = require("../utils/node");
11
+ var _lists = require("@atlaskit/editor-common/lists");
12
12
  var _find = require("../utils/find");
13
- var _selection = require("../utils/selection");
14
- var _selection2 = require("@atlaskit/editor-common/selection");
13
+ var _utils = require("@atlaskit/editor-common/utils");
14
+ var _selection = require("@atlaskit/editor-common/selection");
15
15
  var indentListItemsSelected = function indentListItemsSelected(tr) {
16
16
  var originalSelection = tr.selection;
17
- var normalizedSelection = (0, _selection.normalizeListItemsSelection)({
17
+ var normalizedSelection = (0, _lists.normalizeListItemsSelection)({
18
18
  selection: originalSelection,
19
19
  doc: tr.doc
20
20
  });
@@ -38,17 +38,17 @@ var indentListItemsSelected = function indentListItemsSelected(tr) {
38
38
  // @ts-ignore
39
39
  var positionListItemPosition = resolvedPos.posAtIndex(listItemIndex - 1);
40
40
  var previousListItem = tr.doc.nodeAt(positionListItemPosition);
41
- if (!previousListItem || !(0, _node.isListItemNode)(previousListItem)) {
41
+ if (!previousListItem || !(0, _utils.isListItemNode)(previousListItem)) {
42
42
  return null;
43
43
  }
44
- if ((0, _node.isListItemNode)(previousListItem) && listItemIndex === 0) {
44
+ if ((0, _utils.isListItemNode)(previousListItem) && listItemIndex === 0) {
45
45
  return null;
46
46
  }
47
47
  var listItemSelectedCommonParent = range.parent;
48
- var previousNestedList = (0, _node.isListNode)(previousListItem.lastChild) ? previousListItem.lastChild : null;
48
+ var previousNestedList = (0, _utils.isListNode)(previousListItem.lastChild) ? previousListItem.lastChild : null;
49
49
  var listNodeType = previousNestedList ? previousNestedList.type : listItemSelectedCommonParent.type;
50
50
  var nestedList = listItemsSelected.to.node.lastChild;
51
- var nestedItemsOffset = nestedList && (0, _node.isListNode)(nestedList) ? nestedList.nodeSize : 0;
51
+ var nestedItemsOffset = nestedList && (0, _utils.isListNode)(nestedList) ? nestedList.nodeSize : 0;
52
52
  var from = listItemsSelected.from.pos;
53
53
  var to = listItemsSelected.to.pos + listItemsSelected.to.node.nodeSize - nestedItemsOffset;
54
54
  var _createIndentedListIt = createIndentedListItemsSlice({
@@ -83,7 +83,7 @@ var calculateRange = function calculateRange(_ref) {
83
83
  var selection = _ref.selection;
84
84
  var $from = selection.$from,
85
85
  $to = selection.$to;
86
- var range = $from.blockRange($to, _node.isListNode);
86
+ var range = $from.blockRange($to, _utils.isListNode);
87
87
  if (!range) {
88
88
  return null;
89
89
  }
@@ -97,9 +97,9 @@ var calculateNewSelection = function calculateNewSelection(_ref2) {
97
97
  var offset = hasPreviousNestedList ? 2 : 0;
98
98
  var $from = normalizedSelection.$from,
99
99
  $to = normalizedSelection.$to;
100
- if (normalizedSelection instanceof _selection2.GapCursorSelection) {
100
+ if (normalizedSelection instanceof _selection.GapCursorSelection) {
101
101
  var _nextSelectionFrom = tr.doc.resolve($from.pos - offset);
102
- return new _selection2.GapCursorSelection(_nextSelectionFrom, normalizedSelection.side);
102
+ return new _selection.GapCursorSelection(_nextSelectionFrom, normalizedSelection.side);
103
103
  }
104
104
  if (originalSelection instanceof _state.NodeSelection) {
105
105
  return _state.NodeSelection.create(tr.doc, $from.pos - offset);
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.calcJoinListScenario = void 0;
7
7
  var _analytics = require("../../analytics");
8
- var _node = require("../utils/node");
8
+ var _utils = require("@atlaskit/editor-common/utils");
9
9
  var _selection = require("../utils/selection");
10
10
  var _joinListItemsScenarios = require("./join-list-items-scenarios");
11
11
  var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
@@ -17,7 +17,7 @@ var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
17
17
  var headInParagraph = (0, _selection.isPosInsideParagraph)($head);
18
18
  var headInLastNonListChild = headGrandParent && headGrandParent.lastChild && (headGrandParent.lastChild === headParent || headGrandParent.childCount > 1 && headGrandParent.child(headGrandParent.childCount - 2) === headParent &&
19
19
  //find the second last child if a list item may be the last child
20
- (0, _node.isListNode)(headGrandParent.lastChild));
20
+ (0, _utils.isListNode)(headGrandParent.lastChild));
21
21
  var nextInList = (0, _selection.isPosInsideList)($next);
22
22
  var nextInParagraph = (0, _selection.isPosInsideParagraph)($next);
23
23
  if (!headInList && headInParagraph && nextInList) {
@@ -35,11 +35,11 @@ var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
35
35
  var nextNodeAfter = $next.nodeAfter;
36
36
  var nextGrandParent = $next.node(-1);
37
37
  var headGreatGrandParent = $head.node(-2);
38
- var nextInListItem = (0, _node.isListItemNode)($next.parent);
39
- var nextNodeAfterListItem = (0, _node.isListItemNode)(nextNodeAfter);
38
+ var nextInListItem = (0, _utils.isListItemNode)($next.parent);
39
+ var nextNodeAfterListItem = (0, _utils.isListItemNode)(nextNodeAfter);
40
40
  var nextListItemHasFirstChildParagraph = nextNodeAfter &&
41
41
  //Redundant check but the linter complains otherwise
42
- nextNodeAfterListItem && (0, _node.isParagraphNode)(nextNodeAfter.firstChild);
42
+ nextNodeAfterListItem && (0, _utils.isParagraphNode)(nextNodeAfter.firstChild);
43
43
  if (!nextInListItem && nextListItemHasFirstChildParagraph) {
44
44
  return [_analytics.LIST_TEXT_SCENARIOS.JOIN_DESCENDANT_TO_PARENT, _joinListItemsScenarios.joinNestedListWithParentListItem];
45
45
  }
@@ -47,7 +47,7 @@ var calcJoinListScenario = function calcJoinListScenario(walkNode, $head) {
47
47
  return false;
48
48
  }
49
49
  var nextParentSiblingOfHeadParent = nextGrandParent && nextGrandParent === headGreatGrandParent;
50
- var nextNodeAfterIsParagraph = (0, _node.isParagraphNode)(nextNodeAfter);
50
+ var nextNodeAfterIsParagraph = (0, _utils.isParagraphNode)(nextNodeAfter);
51
51
  if (!nextNodeAfterIsParagraph) {
52
52
  return false;
53
53
  }
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.joinListItemWithParagraph = void 0;
7
- var _commands = require("../../../../utils/commands");
7
+ var _utils = require("@atlaskit/editor-common/utils");
8
8
  var _model = require("@atlaskit/editor-prosemirror/model");
9
- var _node = require("../../utils/node");
10
9
  // Case for when a users selection is at the end of a paragraph, the paragraph
11
10
  // is followed by a list, and they delete forward
12
11
  var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
@@ -15,7 +14,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
15
14
  $head = _ref.$head;
16
15
  // For empty paragraphs before a list
17
16
  if ($head.parent.content.size < 1) {
18
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
17
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
19
18
  return tr.doc.resolve($head.pos);
20
19
  }, [], [[$head.pos - 1, $head.pos]]);
21
20
  return true;
@@ -33,7 +32,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
33
32
  var lastChildOfFirstListItem = firstListItem.lastChild;
34
33
  var firstGrandchildOfFirstListItem = firstChildNodeOfFirstListItem.firstChild;
35
34
  var firstListItemHasOneChildWithNoNestedLists = hasSingleChild(firstListItem) && firstChildNodeOfFirstListItem.childCount < 2 && $next.nodeAfter;
36
- var firstListItemContainsParagraphAndNestedList = !hasSingleChild(firstListItem) && lastChildOfFirstListItem && (0, _node.isListNode)(lastChildOfFirstListItem);
35
+ var firstListItemContainsParagraphAndNestedList = !hasSingleChild(firstListItem) && lastChildOfFirstListItem && (0, _utils.isListNode)(lastChildOfFirstListItem);
37
36
  var insertions = [];
38
37
  var deletions = [];
39
38
 
@@ -53,7 +52,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
53
52
  deletions.push([tr.mapping.map($next.pos), tr.mapping.map($next.pos + firstListItem.nodeSize - 1)]);
54
53
  var firstListItemText = _model.Fragment.from(firstChildNodeOfFirstListItem.content);
55
54
  insertions.push([firstListItemText, paragraphPosition]);
56
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
55
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
57
56
  return tr.doc.resolve($head.pos);
58
57
  }, insertions, deletions);
59
58
  return true;
@@ -63,7 +62,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
63
62
  if (firstListItem.childCount > 1) {
64
63
  insertions.push([_model.Fragment.from(firstChildNodeOfFirstListItem.content), paragraphPosition]);
65
64
  deletions.push([tr.mapping.map($next.pos + 1), tr.mapping.map($next.pos + firstChildNodeOfFirstListItem.nodeSize + 1)]);
66
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
65
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
67
66
  return tr.doc.resolve($head.pos);
68
67
  }, insertions, deletions);
69
68
  return true;
@@ -78,7 +77,7 @@ var joinListItemWithParagraph = function joinListItemWithParagraph(_ref) {
78
77
  var nodeSizeOfFirstChild = firstChildNodeOfFirstListItem.nodeSize;
79
78
  deletions.push([tr.mapping.map($next.pos), tr.mapping.map($next.pos + 2 + nodeSizeOfFirstChild)]);
80
79
  }
81
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
80
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
82
81
  return tr.doc.resolve($head.pos);
83
82
  }, insertions, deletions);
84
83
  return true;
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.joinListItemWithParentNestedList = void 0;
7
- var _commands = require("../../../../utils/commands");
8
- var _node = require("../../utils/node");
7
+ var _utils = require("@atlaskit/editor-common/utils");
9
8
  //Case for two adjacent list items with the first being of greater indentation
10
9
  var joinListItemWithParentNestedList = function joinListItemWithParentNestedList(_ref) {
11
10
  var tr = _ref.tr,
@@ -70,7 +69,7 @@ var joinListItemWithParentNestedList = function joinListItemWithParentNestedList
70
69
  var beforeListItemK = $next.before();
71
70
  var afterListItemB = $next.before();
72
71
  var afterListItemK = $next.after();
73
- var containsChildrenO = (0, _node.isListNode)(listItemK.lastChild);
72
+ var containsChildrenO = (0, _utils.isListNode)(listItemK.lastChild);
74
73
  var textInsertPos = $head.pos;
75
74
  var childrenMInsertPos = $head.pos + 1;
76
75
  var childrenOInsertPos = afterListItemB - 2;
@@ -78,7 +77,7 @@ var joinListItemWithParentNestedList = function joinListItemWithParentNestedList
78
77
  var childrenMContent = containsChildrenO ? listItemK.content.cut(listItemK.firstChild.nodeSize, listItemK.nodeSize - listItemK.lastChild.nodeSize - 2 //Get the position before
79
78
  ) : listItemK.content.cut(listItemK.firstChild.nodeSize);
80
79
  var childrenOContent = listItemK.lastChild.content;
81
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
80
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
82
81
  return tr.doc.resolve(textInsertPos);
83
82
  }, containsChildrenO ? [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos], [childrenOContent, childrenOInsertPos]] : [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos]], [[beforeListItemK, afterListItemK]]);
84
83
  return true;
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.joinNestedListWithParentListItem = void 0;
7
- var _commands = require("../../../../utils/commands");
8
- var _node = require("../../utils/node");
7
+ var _utils = require("@atlaskit/editor-common/utils");
9
8
  //Case for two adjacent list items with the first being of lower indentation
10
9
  var joinNestedListWithParentListItem = function joinNestedListWithParentListItem(_ref) {
11
10
  var tr = _ref.tr,
@@ -62,7 +61,7 @@ var joinNestedListWithParentListItem = function joinNestedListWithParentListItem
62
61
  var afterListE = $next.after();
63
62
  var afterListItemF = tr.doc.resolve($next.pos + 1).after(); //List must always have at least one listItem
64
63
 
65
- var containsChildrenJ = (0, _node.isListNode)(listItemF.lastChild);
64
+ var containsChildrenJ = (0, _utils.isListNode)(listItemF.lastChild);
66
65
  var shouldRemoveListE = listE.childCount === 1 && !containsChildrenJ; //Assures no Children J and K
67
66
 
68
67
  var textInsertPos = $head.pos;
@@ -72,7 +71,7 @@ var joinNestedListWithParentListItem = function joinNestedListWithParentListItem
72
71
  var childrenHContent = containsChildrenJ ? listItemF.content.cut(paragraphG.nodeSize, listItemF.nodeSize - listItemF.lastChild.nodeSize - 2) : listItemF.content.cut(paragraphG.nodeSize); //If Children J doesn't exist then Children H will include the last node
73
72
  var childrenJContent = listItemF.lastChild.content; //Will be invalid if there are no Children J but it will be unused
74
73
 
75
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
74
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
76
75
  return tr.doc.resolve(textInsertPos);
77
76
  }, containsChildrenJ ? [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos], [childrenJContent, childrenJInsertPos]] : [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos]], [shouldRemoveListE ? [beforeListE, afterListE] : [beforeListItemF, afterListItemF]]);
78
77
  return true;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.joinParagrapWithList = void 0;
7
- var _commands = require("../../../../utils/commands");
7
+ var _utils = require("@atlaskit/editor-common/utils");
8
8
  //Case for two adjacent nodes with the first being a list item and the last being a paragraph
9
9
  var joinParagrapWithList = function joinParagrapWithList(_ref) {
10
10
  var tr = _ref.tr,
@@ -37,7 +37,7 @@ var joinParagrapWithList = function joinParagrapWithList(_ref) {
37
37
  var afterParagraphE = $next.after();
38
38
  var textInsertPos = $head.pos;
39
39
  var textContent = paragraphE.content;
40
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
40
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
41
41
  return tr.doc.resolve(textInsertPos);
42
42
  }, [[textContent, textInsertPos]], [[beforeParagraphE, afterParagraphE]]);
43
43
  return true;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.joinSiblingListItems = void 0;
7
- var _commands = require("../../../../utils/commands");
7
+ var _utils = require("@atlaskit/editor-common/utils");
8
8
  //Case for two adjacent list items of the same indentation
9
9
  var joinSiblingListItems = function joinSiblingListItems(_ref) {
10
10
  var tr = _ref.tr,
@@ -48,7 +48,7 @@ var joinSiblingListItems = function joinSiblingListItems(_ref) {
48
48
  var childrenGInsertPos = endListItemB;
49
49
  var textContent = paragraphF.content;
50
50
  var childrenGContent = listItemE.content.cut(paragraphF.nodeSize);
51
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
51
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
52
52
  return tr.doc.resolve(textInsertPos);
53
53
  }, [[textContent, textInsertPos], [childrenGContent, childrenGInsertPos]], [[beforeListItemE, afterListItemE]]);
54
54
  return true;
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.mergeNextListAtPosition = mergeNextListAtPosition;
7
- var _node = require("../utils/node");
7
+ var _utils = require("@atlaskit/editor-common/utils");
8
8
  function mergeNextListAtPosition(_ref) {
9
9
  var tr = _ref.tr,
10
10
  listPosition = _ref.listPosition;
11
11
  var listNodeAtPosition = tr.doc.nodeAt(listPosition);
12
- if (!(0, _node.isListNode)(listNodeAtPosition)) {
12
+ if (!(0, _utils.isListNode)(listNodeAtPosition)) {
13
13
  return;
14
14
  }
15
15
  var listPositionResolved = tr.doc.resolve(listPosition + listNodeAtPosition.nodeSize);
16
16
  var pos = listPositionResolved.pos,
17
17
  nodeAfter = listPositionResolved.nodeAfter,
18
18
  nodeBefore = listPositionResolved.nodeBefore;
19
- if (!(0, _node.isListNode)(nodeBefore) || !(0, _node.isListNode)(nodeAfter)) {
19
+ if (!(0, _utils.isListNode)(nodeBefore) || !(0, _utils.isListNode)(nodeAfter)) {
20
20
  return;
21
21
  }
22
22
  if ((nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.type.name) !== (nodeBefore === null || nodeBefore === void 0 ? void 0 : nodeBefore.type.name)) {