@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
@@ -10,7 +10,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
11
  var _transform = require("@atlaskit/editor-prosemirror/transform");
12
12
  var _utils = require("@atlaskit/editor-common/utils");
13
- var _node = require("../utils/node");
13
+ var _lists = require("@atlaskit/editor-common/lists");
14
14
  var _find = require("../utils/find");
15
15
  var _selection = require("../utils/selection");
16
16
  var _gapCursorSelection = require("../../selection/gap-cursor-selection");
@@ -20,7 +20,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
20
20
  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; }
21
21
  var outdentListItemsSelected = function outdentListItemsSelected(tr, state, featureFlags) {
22
22
  var originalSelection = tr.selection;
23
- var normalizedSelection = (0, _selection.normalizeListItemsSelection)({
23
+ var normalizedSelection = (0, _lists.normalizeListItemsSelection)({
24
24
  selection: tr.selection,
25
25
  doc: tr.doc
26
26
  });
@@ -28,7 +28,7 @@ var outdentListItemsSelected = function outdentListItemsSelected(tr, state, feat
28
28
  if (!rootList) {
29
29
  return;
30
30
  }
31
- var commonList = normalizedSelection.$from.blockRange(rootList, _node.isListNode);
31
+ var commonList = normalizedSelection.$from.blockRange(rootList, _utils.isListNode);
32
32
  if (!commonList) {
33
33
  return;
34
34
  }
@@ -40,11 +40,11 @@ var outdentListItemsSelected = function outdentListItemsSelected(tr, state, feat
40
40
  nodeRanges.forEach(function (range) {
41
41
  var $from = tr.doc.resolve(tr.mapping.map(range.from));
42
42
  var $to = tr.doc.resolve(tr.mapping.map(range.to));
43
- var mappedRange = $from.blockRange($to, _node.isListNode);
43
+ var mappedRange = $from.blockRange($to, _utils.isListNode);
44
44
  if (!mappedRange) {
45
45
  return;
46
46
  }
47
- if ((0, _node.isListItemNode)($from.node(mappedRange.depth - 1))) {
47
+ if ((0, _utils.isListItemNode)($from.node(mappedRange.depth - 1))) {
48
48
  outdentRangeToParentList({
49
49
  tr: tr,
50
50
  range: mappedRange
@@ -70,9 +70,9 @@ var outdentListItemsSelected = function outdentListItemsSelected(tr, state, feat
70
70
  hasNormalizedFromPositionLiftedOut: hasNormalizedFromPositionLiftedOut
71
71
  });
72
72
  tr.setSelection(nextSelection);
73
- (0, _node.joinSiblingLists)({
73
+ (0, _lists.joinSiblingLists)({
74
74
  tr: tr,
75
- direction: _node.JoinDirection.RIGHT
75
+ direction: _lists.JoinDirection.RIGHT
76
76
  });
77
77
  };
78
78
  exports.outdentListItemsSelected = outdentListItemsSelected;
@@ -139,11 +139,11 @@ var splitRangeSelection = function splitRangeSelection(selection) {
139
139
  var previousListItem = findPreviousListItemSibling($to);
140
140
  while (previousListItem && previousListItem.pos >= lastListItem.pos && previousListItem.pos >= commonListRange.start) {
141
141
  var node = doc.nodeAt(previousListItem.pos);
142
- if (!node || !(0, _node.isListItemNode)(node)) {
142
+ if (!node || !(0, _utils.isListItemNode)(node)) {
143
143
  return [];
144
144
  }
145
145
  var offset = 0;
146
- if (node && node.lastChild && (0, _node.isListNode)(node.lastChild)) {
146
+ if (node && node.lastChild && (0, _utils.isListNode)(node.lastChild)) {
147
147
  offset = node.lastChild.nodeSize;
148
148
  }
149
149
  var start = previousListItem.pos + 1;
@@ -192,7 +192,7 @@ var extractListItemsRangeFromList = function extractListItemsRangeFromList(_ref3
192
192
  if (isAtTop) {
193
193
  for (var _i = 0; _i < listItemContent.childCount; _i++) {
194
194
  var child = listItemContent.child(_i);
195
- if (child && (0, _node.isListNode)(child) && child.type !== list.type) {
195
+ if (child && (0, _utils.isListNode)(child) && child.type !== list.type) {
196
196
  var newNestedList = list.type.create(null, child.content);
197
197
  listItemContent = listItemContent.replaceChild(_i, newNestedList);
198
198
  }
@@ -269,7 +269,7 @@ var extractListItemsRangeFromList = function extractListItemsRangeFromList(_ref3
269
269
  };
270
270
  var findPreviousListItemSibling = function findPreviousListItemSibling($pos) {
271
271
  var doc = $pos.doc;
272
- var isPositionListItem = (0, _node.isListNode)($pos.node());
272
+ var isPositionListItem = (0, _utils.isListNode)($pos.node());
273
273
  var listItemPosition = $pos;
274
274
  if (!isPositionListItem) {
275
275
  var listItem = (0, _find.findFirstParentListItemNode)($pos);
@@ -7,7 +7,7 @@ exports.wrapInList = wrapInList;
7
7
  exports.wrapInListAndJoin = wrapInListAndJoin;
8
8
  var _model = require("@atlaskit/editor-prosemirror/model");
9
9
  var _transform = require("@atlaskit/editor-prosemirror/transform");
10
- var _autojoin = require("../../../utils/prosemirror/autojoin");
10
+ var _utils = require("@atlaskit/editor-common/utils");
11
11
  var _gapCursorSelection = require("../../selection/gap-cursor-selection");
12
12
  var _selection = require("../utils/selection");
13
13
  /**
@@ -16,7 +16,7 @@ var _selection = require("../utils/selection");
16
16
  */
17
17
  function wrapInListAndJoin(nodeType, tr) {
18
18
  wrapInList(nodeType)(tr);
19
- (0, _autojoin.autoJoinTr)(tr, function (before, after) {
19
+ (0, _utils.autoJoinTr)(tr, function (before, after) {
20
20
  return before.type === after.type && before.type === nodeType;
21
21
  });
22
22
  }
@@ -7,13 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.indentList = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _analytics = require("@atlaskit/editor-common/analytics");
10
- var _indentation = require("../utils/indentation");
10
+ var _lists = require("@atlaskit/editor-common/lists");
11
11
  var _indentListItemsSelected = require("../actions/indent-list-items-selected");
12
- var _node = require("../utils/node");
12
+ var _utils = require("@atlaskit/editor-common/utils");
13
13
  var _find = require("../utils/find");
14
14
  var _types = require("../types");
15
15
  var _selection = require("../utils/selection");
16
- var _analytics2 = require("../utils/analytics");
17
16
  var _history = require("@atlaskit/editor-prosemirror/history");
18
17
  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; }
19
18
  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; }
@@ -31,7 +30,7 @@ var indentList = function indentList(editorAnalyticsAPI) {
31
30
 
32
31
  // Save the history, so it could undo/revert to the same state before the indent, see https://product-fabric.atlassian.net/browse/ED-14753
33
32
  (0, _history.closeHistory)(tr);
34
- var firstListItemSelectedAttributes = (0, _selection.getListItemAttributes)($from);
33
+ var firstListItemSelectedAttributes = (0, _lists.getListItemAttributes)($from);
35
34
  var parentListNode = (0, _find.findFirstParentListNode)($from);
36
35
  if (!parentListNode || firstListItemSelectedAttributes && firstListItemSelectedAttributes.indentLevel === 0 && firstListItemSelectedAttributes.itemIndex === 0) {
37
36
  if ((0, _selection.isInsideTableCell)(state)) {
@@ -43,9 +42,9 @@ var indentList = function indentList(editorAnalyticsAPI) {
43
42
  }
44
43
  }
45
44
  var currentListNode = parentListNode.node;
46
- var actionSubjectId = (0, _node.isBulletList)(currentListNode) ? _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
45
+ var actionSubjectId = (0, _utils.isBulletList)(currentListNode) ? _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
47
46
  (0, _indentListItemsSelected.indentListItemsSelected)(tr);
48
- var maximimunNestedLevelReached = !(0, _indentation.hasValidListIndentationLevel)({
47
+ var maximimunNestedLevelReached = !(0, _lists.hasValidListIndentationLevel)({
49
48
  tr: tr,
50
49
  maxIndentation: _types.MAX_NESTED_LIST_INDENTATION
51
50
  });
@@ -58,7 +57,7 @@ var indentList = function indentList(editorAnalyticsAPI) {
58
57
  actionSubject: _analytics.ACTION_SUBJECT.LIST,
59
58
  actionSubjectId: actionSubjectId,
60
59
  eventType: _analytics.EVENT_TYPE.TRACK,
61
- attributes: _objectSpread(_objectSpread({}, (0, _analytics2.getCommonListAnalyticsAttributes)(state)), {}, {
60
+ attributes: _objectSpread(_objectSpread({}, (0, _lists.getCommonListAnalyticsAttributes)(state)), {}, {
62
61
  inputMethod: inputMethod
63
62
  })
64
63
  })(tr);
@@ -24,22 +24,20 @@ var _model = require("@atlaskit/editor-prosemirror/model");
24
24
  var _state = require("@atlaskit/editor-prosemirror/state");
25
25
  var baseCommand = _interopRequireWildcard(require("@atlaskit/editor-prosemirror/commands"));
26
26
  var _utils = require("@atlaskit/editor-prosemirror/utils");
27
- var _document = require("../../../utils/document");
28
- var _commands2 = require("../../../utils/commands");
29
27
  var _utils2 = require("@atlaskit/editor-common/utils");
28
+ var _commands2 = require("../../../utils/commands");
30
29
  var _utils3 = require("../../../utils");
30
+ var _lists = require("@atlaskit/editor-common/lists");
31
31
  var _transforms = require("../transforms");
32
32
  var _gapCursorSelection = require("../../selection/gap-cursor-selection");
33
33
  var _analytics = require("@atlaskit/editor-common/analytics");
34
34
  var _selection = require("../utils/selection");
35
- var _analytics2 = require("../utils/analytics");
36
35
  var _listBackspace = require("./listBackspace");
37
36
  var _joinListItemForward = require("./join-list-item-forward");
38
37
  var _conversions = require("../actions/conversions");
39
38
  var _wrapAndJoinLists = require("../actions/wrap-and-join-lists");
40
39
  var _outdentList = require("./outdent-list");
41
40
  var _indentList = require("./indent-list");
42
- var _replaceContent = require("../utils/replace-content");
43
41
  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); }
44
42
  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; }
45
43
  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; }
@@ -56,7 +54,7 @@ var enterKeyCommand = function enterKeyCommand(editorAnalyticsAPI) {
56
54
  var wrapper = $from.node($from.depth - 1);
57
55
  if (wrapper && wrapper.type === listItem) {
58
56
  /** Check if the wrapper has any visible content */
59
- var wrapperHasContent = (0, _document.hasVisibleContent)(wrapper);
57
+ var wrapperHasContent = (0, _utils2.hasVisibleContent)(wrapper);
60
58
  if (!wrapperHasContent) {
61
59
  return (0, _outdentList.outdentList)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD, featureFlags)(state, dispatch);
62
60
  } else if (!(0, _utils.hasParentNodeOfType)(codeBlock)(selection)) {
@@ -75,12 +73,12 @@ var backspaceKeyCommand = function backspaceKeyCommand(editorAnalyticsAPI) {
75
73
  return baseCommand.chainCommands((0, _listBackspace.listBackspace)(editorAnalyticsAPI),
76
74
  // if we're at the start of a list item, we need to either backspace
77
75
  // directly to an empty list item above, or outdent this node
78
- (0, _utils2.filterCommands)([_commands2.isEmptySelectionAtStart,
76
+ (0, _utils2.filterCommand)([_utils2.isEmptySelectionAtStart,
79
77
  // list items might have multiple paragraphs; only do this at the first one
80
78
  _commands2.isFirstChildOfParent, _selection.isInsideListItem], baseCommand.chainCommands(deletePreviousEmptyListItem, (0, _outdentList.outdentList)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD, featureFlags))),
81
79
  // if we're just inside a paragraph node (or gapcursor is shown) and backspace, then try to join
82
80
  // the text to the previous list item, if one exists
83
- (0, _utils2.filterCommands)([_commands2.isEmptySelectionAtStart, _selection.canJoinToPreviousListItem], joinToPreviousListItem))(state, dispatch);
81
+ (0, _utils2.filterCommand)([_utils2.isEmptySelectionAtStart, _selection.canJoinToPreviousListItem], joinToPreviousListItem))(state, dispatch);
84
82
  };
85
83
  };
86
84
  };
@@ -142,7 +140,7 @@ var toggleList = function toggleList(editorAnalyticsAPI) {
142
140
  actionSubject: _analytics.ACTION_SUBJECT.LIST,
143
141
  actionSubjectId: _analytics.ACTION_SUBJECT_ID.TEXT,
144
142
  eventType: _analytics.EVENT_TYPE.TRACK,
145
- attributes: _objectSpread(_objectSpread({}, (0, _analytics2.getCommonListAnalyticsAttributes)(state)), {}, {
143
+ attributes: _objectSpread(_objectSpread({}, (0, _lists.getCommonListAnalyticsAttributes)(state)), {}, {
146
144
  transformedFrom: transformedFrom,
147
145
  inputMethod: inputMethod
148
146
  })
@@ -161,7 +159,7 @@ var toggleList = function toggleList(editorAnalyticsAPI) {
161
159
  actionSubject: _analytics.ACTION_SUBJECT.LIST,
162
160
  actionSubjectId: actionSubjectId,
163
161
  eventType: _analytics.EVENT_TYPE.TRACK,
164
- attributes: _objectSpread(_objectSpread({}, (0, _analytics2.getCommonListAnalyticsAttributes)(state)), {}, {
162
+ attributes: _objectSpread(_objectSpread({}, (0, _lists.getCommonListAnalyticsAttributes)(state)), {}, {
165
163
  transformedFrom: transformedFrom,
166
164
  inputMethod: inputMethod
167
165
  })
@@ -314,7 +312,7 @@ var joinToPreviousListItem = function joinToPreviousListItem(state, dispatch) {
314
312
  var list = $cut.nodeBefore.copy($cut.nodeBefore.content.append(_model.Fragment.from(listItem.createChecked({}, $cut.nodeAfter))));
315
313
  tr.replaceWith(nodeBeforePos, $from.pos + $cut.nodeAfter.nodeSize, list);
316
314
  } else {
317
- var step = (0, _replaceContent.moveTargetIntoList)({
315
+ var step = (0, _lists.moveTargetIntoList)({
318
316
  insertPosition: $lastNode.pos,
319
317
  $target: $cut
320
318
  });
@@ -6,16 +6,16 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.joinListItemForward = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
- var _commands = require("../../../utils/commands");
9
+ var _utils = require("@atlaskit/editor-common/utils");
10
10
  var _analytics = require("@atlaskit/editor-common/analytics");
11
- var _utils = require("@atlaskit/editor-prosemirror/utils");
11
+ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
12
12
  var _joinListItemsForward = require("../actions/join-list-items-forward");
13
13
  var joinListItemForward = function joinListItemForward(editorAnalyticsAPI) {
14
14
  return function (state, dispatch) {
15
15
  var tr = state.tr,
16
16
  $head = state.selection.$head;
17
- var walkNode = (0, _commands.walkNextNode)($head);
18
- if (!(0, _commands.isEmptySelectionAtEnd)(state)) {
17
+ var walkNode = (0, _utils.walkNextNode)($head);
18
+ if (!(0, _utils.isEmptySelectionAtEnd)(state)) {
19
19
  return false;
20
20
  }
21
21
  var scenarios = (0, _joinListItemsForward.calcJoinListScenario)(walkNode, $head);
@@ -36,7 +36,7 @@ var joinListItemForward = function joinListItemForward(editorAnalyticsAPI) {
36
36
  var _state$schema$nodes = state.schema.nodes,
37
37
  bulletList = _state$schema$nodes.bulletList,
38
38
  orderedList = _state$schema$nodes.orderedList;
39
- var listParent = (0, _utils.findParentNodeOfType)([bulletList, orderedList])(tr.selection);
39
+ var listParent = (0, _utils2.findParentNodeOfType)([bulletList, orderedList])(tr.selection);
40
40
  var actionSubjectId = _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_BULLET;
41
41
  if (listParent && listParent.node.type === orderedList) {
42
42
  actionSubjectId = _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.listBackspace = exports.calcJoinListScenario = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _commands = require("../../../utils/commands");
9
+ var _utils = require("@atlaskit/editor-common/utils");
10
10
  var _analytics = require("@atlaskit/editor-common/analytics");
11
- var _utils = require("@atlaskit/editor-prosemirror/utils");
12
- var _utils2 = require("@atlaskit/editor-common/utils");
11
+ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
13
12
  var _selection = require("../utils/selection");
14
13
  var _BACKSPACE_COMMANDS;
15
14
  //Cases below refer to the cases found in this document: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1146954996/List+Backspace+and+Delete+Behaviour
@@ -51,7 +50,7 @@ var listBackspaceCase2 = function listBackspaceCase2(tr, dispatch, $prev, $head)
51
50
  var childrenGInsertPos = $prev.pos;
52
51
  var textContent = $head.parent.content;
53
52
  var childrenGContent = listItemE.content.cut(listItemE.firstChild.nodeSize);
54
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
53
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
55
54
  return tr.doc.resolve(textInsertPos);
56
55
  }, [[textContent, textInsertPos], [childrenGContent, childrenGInsertPos]], [[beforeListItemE, afterListItemE]]);
57
56
  if (dispatch) {
@@ -109,7 +108,7 @@ var listBackspaceCase3 = function listBackspaceCase3(tr, dispatch, $prev, $head)
109
108
  var afterListE = $head.after(-2);
110
109
  var afterListItemF = $head.after(-1);
111
110
  var startListE = $head.start(-2);
112
- var containsChildrenJ = (0, _utils2.isListNode)(listItemF.lastChild);
111
+ var containsChildrenJ = (0, _utils.isListNode)(listItemF.lastChild);
113
112
  var shouldRemoveListE = listE.childCount === 1 && !containsChildrenJ; //Assures no Children J and K
114
113
  var textInsertPos = $prev.pos;
115
114
  var childrenHInsertPos = afterParagraphD;
@@ -118,7 +117,7 @@ var listBackspaceCase3 = function listBackspaceCase3(tr, dispatch, $prev, $head)
118
117
  var childrenHContent = containsChildrenJ ? listItemF.content.cut(listItemF.firstChild.nodeSize, listItemF.nodeSize - listItemF.lastChild.nodeSize - 2) : listItemF.content.cut(listItemF.firstChild.nodeSize); //If Children J doesn't exist then Children H will include the last node
119
118
  var childrenJContent = listItemF.lastChild.content; //Will be invalid if there are no Children J but it will be unused
120
119
 
121
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
120
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
122
121
  return tr.doc.resolve(textInsertPos);
123
122
  }, containsChildrenJ ? [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos], [childrenJContent, childrenJInsertPos]] : [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos]], [shouldRemoveListE ? [beforeListE, afterListE] : [beforeListItemF, afterListItemF]]);
124
123
  if (dispatch) {
@@ -193,7 +192,7 @@ var listBackspaceCase4 = function listBackspaceCase4(tr, dispatch, $prev, $head,
193
192
  var beforeListItemK = $head.before(-1);
194
193
  var afterParagraphJ = $last.after();
195
194
  var afterListItemK = $head.after(-1);
196
- var containsChildrenO = (0, _utils2.isListNode)(listItemK.lastChild);
195
+ var containsChildrenO = (0, _utils.isListNode)(listItemK.lastChild);
197
196
  var textInsertPos = $last.pos;
198
197
  var childrenMInsertPos = afterParagraphJ;
199
198
  var childrenOInsertPos = $prev.pos - 1; //Last item of listItem B must be a list therefore we can simply decrement $prev to get there
@@ -201,7 +200,7 @@ var listBackspaceCase4 = function listBackspaceCase4(tr, dispatch, $prev, $head,
201
200
  var textContent = paragraphL.content;
202
201
  var childrenMContent = containsChildrenO ? listItemK.content.cut(listItemK.firstChild.nodeSize, listItemK.nodeSize - listItemK.lastChild.nodeSize - 2) : listItemK.content.cut(listItemK.firstChild.nodeSize);
203
202
  var childrenOContent = listItemK.lastChild.content;
204
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
203
+ (0, _utils.insertContentDeleteRange)(tr, function (tr) {
205
204
  return tr.doc.resolve(textInsertPos);
206
205
  }, containsChildrenO ? [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos], [childrenOContent, childrenOInsertPos]] : [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos]], [[beforeListItemK, afterListItemK]]);
207
206
  if (dispatch) {
@@ -227,15 +226,15 @@ var calcJoinListScenario = function calcJoinListScenario(walkNode, $head, tr) {
227
226
  if (prevInParagraph) {
228
227
  return [_analytics.LIST_TEXT_SCENARIOS.JOIN_DESCENDANT_TO_PARENT, null];
229
228
  }
230
- var prevParentLastChildIsList = $prev.parent.lastChild && (0, _utils2.isListNode)($prev.parent.lastChild);
231
- var prevParentLastChildIsParagraph = (0, _utils2.isParagraphNode)($prev.parent.lastChild);
229
+ var prevParentLastChildIsList = $prev.parent.lastChild && (0, _utils.isListNode)($prev.parent.lastChild);
230
+ var prevParentLastChildIsParagraph = (0, _utils.isParagraphNode)($prev.parent.lastChild);
232
231
 
233
232
  // Will search for the possible last node for case 4 (where the list could be indented multiple times)
234
233
  // $last is required to determine whether we are in case 2 or 4
235
234
  var $last = tr.doc.resolve($prev.pos);
236
235
  var lastFoundNode;
237
236
  do {
238
- var _walkNode = (0, _commands.walkPrevNode)($last);
237
+ var _walkNode = (0, _utils.walkPrevNode)($last);
239
238
  $last = _walkNode.$pos;
240
239
  lastFoundNode = _walkNode.foundNode;
241
240
  } while (lastFoundNode && !$last.parent.isTextblock);
@@ -252,8 +251,8 @@ var listBackspace = function listBackspace(editorAnalyticsAPI) {
252
251
  return function (state, dispatch) {
253
252
  var tr = state.tr,
254
253
  $head = state.selection.$head;
255
- var walkNode = (0, _commands.walkPrevNode)($head);
256
- if (!(0, _commands.isEmptySelectionAtStart)(state)) {
254
+ var walkNode = (0, _utils.walkPrevNode)($head);
255
+ if (!(0, _utils.isEmptySelectionAtStart)(state)) {
257
256
  return false;
258
257
  }
259
258
  var scenario = calcJoinListScenario(walkNode, $head, tr);
@@ -263,7 +262,7 @@ var listBackspace = function listBackspace(editorAnalyticsAPI) {
263
262
  var _state$schema$nodes = state.schema.nodes,
264
263
  bulletList = _state$schema$nodes.bulletList,
265
264
  orderedList = _state$schema$nodes.orderedList;
266
- var listParent = (0, _utils.findParentNodeOfType)([bulletList, orderedList])(tr.selection);
265
+ var listParent = (0, _utils2.findParentNodeOfType)([bulletList, orderedList])(tr.selection);
267
266
  var actionSubjectId = _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_BULLET;
268
267
  if (listParent && listParent.node.type === orderedList) {
269
268
  actionSubjectId = _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
@@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.outdentList = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _lists = require("@atlaskit/editor-common/lists");
9
10
  var _analytics = require("@atlaskit/editor-common/analytics");
10
11
  var _selection = require("../utils/selection");
11
- var _node = require("../utils/node");
12
+ var _utils = require("@atlaskit/editor-common/utils");
12
13
  var _find = require("../utils/find");
13
14
  var _analytics2 = require("../utils/analytics");
14
15
  var _outdentListItemsSelected = require("../actions/outdent-list-items-selected");
@@ -32,7 +33,7 @@ var outdentList = function outdentList(editorAnalyticsAPI) {
32
33
 
33
34
  // Save the history, so it could undo/revert to the same state before the outdent, see https://product-fabric.atlassian.net/browse/ED-14753
34
35
  (0, _history.closeHistory)(state.tr);
35
- var actionSubjectId = (0, _node.isBulletList)(parentListNode.node) ? _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
36
+ var actionSubjectId = (0, _utils.isBulletList)(parentListNode.node) ? _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_BULLET : _analytics.ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER;
36
37
  var customTr = state.tr;
37
38
  (0, _outdentListItemsSelected.outdentListItemsSelected)(customTr, state, featureFlags);
38
39
  if (!customTr || !customTr.docChanged) {
@@ -55,7 +56,7 @@ var outdentList = function outdentList(editorAnalyticsAPI) {
55
56
  actionSubject: _analytics.ACTION_SUBJECT.LIST,
56
57
  actionSubjectId: actionSubjectId,
57
58
  eventType: _analytics.EVENT_TYPE.TRACK,
58
- attributes: _objectSpread(_objectSpread(_objectSpread({}, (0, _analytics2.getCommonListAnalyticsAttributes)(state)), restartListsAttributes), {}, {
59
+ attributes: _objectSpread(_objectSpread(_objectSpread({}, (0, _lists.getCommonListAnalyticsAttributes)(state)), restartListsAttributes), {}, {
59
60
  inputMethod: inputMethod
60
61
  })
61
62
  })(customTr);
@@ -11,12 +11,11 @@ var _state = require("@atlaskit/editor-prosemirror/state");
11
11
  var _view = require("@atlaskit/editor-prosemirror/view");
12
12
  var _utils = require("@atlaskit/editor-prosemirror/utils");
13
13
  var _selection = require("../utils/selection");
14
- var _node = require("../utils/node");
14
+ var _utils2 = require("@atlaskit/editor-common/utils");
15
15
  var _pluginStateFactory = require("../../../utils/plugin-state-factory");
16
- var _utils2 = require("../../../utils");
16
+ var _utils3 = require("../../../utils");
17
17
  var _selection2 = require("@atlaskit/editor-common/selection");
18
18
  var _styles = require("@atlaskit/editor-common/styles");
19
- var _utils3 = require("@atlaskit/editor-common/utils");
20
19
  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; }
21
20
  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; }
22
21
  var listPluginKey = new _state.PluginKey('listPlugin');
@@ -48,7 +47,7 @@ var getDecorations = function getDecorations(doc, state, featureFlags) {
48
47
  }
49
48
  }
50
49
  }
51
- if ((0, _node.isListNode)(node)) {
50
+ if ((0, _utils2.isListNode)(node)) {
52
51
  processedListsStack.push({
53
52
  node: node,
54
53
  startPos: currentNodeStartPos
@@ -63,7 +62,7 @@ var getDecorations = function getDecorations(doc, state, featureFlags) {
63
62
  var _node$attrs;
64
63
  // If a numbered list has item counters numbering >= 100, we'll need to add special
65
64
  // spacing to account for the extra digit chars
66
- var digitsSize = (0, _utils3.getItemCounterDigitsSize)({
65
+ var digitsSize = (0, _utils2.getItemCounterDigitsSize)({
67
66
  itemsCount: node === null || node === void 0 ? void 0 : node.childCount,
68
67
  order: node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.order
69
68
  });
@@ -156,7 +155,7 @@ var createPlugin = function createPlugin(eventDispatch, featureFlags) {
156
155
  if (isCodeBlockNextToListMarker) {
157
156
  // +1 needed to put cursor inside li
158
157
  // otherwise gap cursor markup will be injected as immediate child of ul resulting in invalid html
159
- (0, _utils2.setGapCursorSelection)(view, pos + 1, _selection2.Side.LEFT);
158
+ (0, _utils3.setGapCursorSelection)(view, pos + 1, _selection2.Side.LEFT);
160
159
  return true;
161
160
  }
162
161
  }
@@ -4,44 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.storeRestartListsAttributes = exports.getRestartListsAttributes = exports.getCommonListAnalyticsAttributes = exports.countListItemsInSelection = exports.RESTART_LISTS_ANALYTICS_KEY = void 0;
7
+ exports.storeRestartListsAttributes = exports.getRestartListsAttributes = exports.RESTART_LISTS_ANALYTICS_KEY = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _utils = require("@atlaskit/editor-common/utils");
10
- var _selection = require("./selection");
11
9
  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; }
12
10
  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; }
13
- var getCommonListAnalyticsAttributes = function getCommonListAnalyticsAttributes(state) {
14
- var _state$selection = state.selection,
15
- $from = _state$selection.$from,
16
- $to = _state$selection.$to;
17
- var fromAttrs = (0, _selection.getListItemAttributes)($from);
18
- var toAttrs = (0, _selection.getListItemAttributes)($to);
19
- return {
20
- itemIndexAtSelectionStart: fromAttrs.itemIndex,
21
- itemIndexAtSelectionEnd: toAttrs.itemIndex,
22
- indentLevelAtSelectionStart: fromAttrs.indentLevel,
23
- indentLevelAtSelectionEnd: toAttrs.indentLevel,
24
- itemsInSelection: countListItemsInSelection(state)
25
- };
26
- };
27
- exports.getCommonListAnalyticsAttributes = getCommonListAnalyticsAttributes;
28
- var countListItemsInSelection = function countListItemsInSelection(state) {
29
- var _state$selection2 = state.selection,
30
- from = _state$selection2.from,
31
- to = _state$selection2.to;
32
- if (from === to) {
33
- return 1;
34
- }
35
- var count = 0;
36
- var listSlice = state.doc.cut(from, to);
37
- listSlice.content.nodesBetween(0, listSlice.content.size, function (node, pos, parent, index) {
38
- if (parent && (0, _utils.isListItemNode)(parent) && !(0, _utils.isListNode)(node) && index === 0) {
39
- count++;
40
- }
41
- });
42
- return count;
43
- };
44
- exports.countListItemsInSelection = countListItemsInSelection;
45
11
  var RESTART_LISTS_ANALYTICS_KEY = 'restartListsAnalytics';
46
12
  exports.RESTART_LISTS_ANALYTICS_KEY = RESTART_LISTS_ANALYTICS_KEY;
47
13
  var getRestartListsAttributes = function getRestartListsAttributes(tr) {
@@ -3,8 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.hasValidListIndentationLevel = exports.getListLiftTarget = void 0;
7
- var _selection = require("./selection");
6
+ exports.getListLiftTarget = void 0;
8
7
  var _utils = require("@atlaskit/editor-common/utils");
9
8
  // This will return (depth - 1) for root list parent of a list.
10
9
  var getListLiftTarget = function getListLiftTarget(resPos) {
@@ -20,21 +19,4 @@ var getListLiftTarget = function getListLiftTarget(resPos) {
20
19
  }
21
20
  return target - 1;
22
21
  };
23
- exports.getListLiftTarget = getListLiftTarget;
24
- var hasValidListIndentationLevel = function hasValidListIndentationLevel(_ref) {
25
- var tr = _ref.tr,
26
- maxIndentation = _ref.maxIndentation;
27
- var initialIndentationLevel = (0, _selection.numberNestedLists)(tr.selection.$from);
28
- var currentIndentationLevel;
29
- var currentPos = tr.selection.$to.pos;
30
- do {
31
- var resolvedPos = tr.doc.resolve(currentPos);
32
- currentIndentationLevel = (0, _selection.numberNestedLists)(resolvedPos);
33
- if (currentIndentationLevel > maxIndentation) {
34
- return false;
35
- }
36
- currentPos++;
37
- } while (currentIndentationLevel >= initialIndentationLevel);
38
- return true;
39
- };
40
- exports.hasValidListIndentationLevel = hasValidListIndentationLevel;
22
+ exports.getListLiftTarget = getListLiftTarget;
@@ -3,32 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.JoinDirection = void 0;
7
- Object.defineProperty(exports, "isBulletList", {
8
- enumerable: true,
9
- get: function get() {
10
- return _utils.isBulletList;
11
- }
12
- });
13
- Object.defineProperty(exports, "isListItemNode", {
14
- enumerable: true,
15
- get: function get() {
16
- return _utils.isListItemNode;
17
- }
18
- });
19
- Object.defineProperty(exports, "isListNode", {
20
- enumerable: true,
21
- get: function get() {
22
- return _utils.isListNode;
23
- }
24
- });
25
- Object.defineProperty(exports, "isParagraphNode", {
26
- enumerable: true,
27
- get: function get() {
28
- return _utils.isParagraphNode;
29
- }
30
- });
31
- exports.joinSiblingLists = void 0;
6
+ exports.isListNodeValidContent = isListNodeValidContent;
32
7
  var _model = require("@atlaskit/editor-prosemirror/model");
33
8
  var _utils = require("@atlaskit/editor-common/utils");
34
9
  function isListNodeValidContent(node) {
@@ -38,83 +13,4 @@ function isListNodeValidContent(node) {
38
13
  }
39
14
  var listFragment = _model.Fragment.from(bulletList.createAndFill());
40
15
  return !(0, _utils.isListItemNode)(node) && node.type.validContent(listFragment);
41
- }
42
- var JoinDirection = /*#__PURE__*/function (JoinDirection) {
43
- JoinDirection[JoinDirection["LEFT"] = 1] = "LEFT";
44
- JoinDirection[JoinDirection["RIGHT"] = -1] = "RIGHT";
45
- return JoinDirection;
46
- }({});
47
- exports.JoinDirection = JoinDirection;
48
- var joinSiblingLists = function joinSiblingLists(_ref) {
49
- var tr = _ref.tr,
50
- direction = _ref.direction,
51
- forceListType = _ref.forceListType;
52
- var result = {
53
- orderedList: 0,
54
- bulletList: 0
55
- };
56
- var doc = tr.doc,
57
- _tr$selection = tr.selection,
58
- $from = _tr$selection.$from,
59
- $to = _tr$selection.$to,
60
- selection = tr.selection;
61
- var range = $from.blockRange($to, isListNodeValidContent);
62
- if (!range) {
63
- return result;
64
- }
65
- var rootListNode = doc.nodeAt(range.start);
66
- var from = (0, _utils.isListNode)(rootListNode) ? range.start : 0;
67
- var to = (0, _utils.isListNode)(rootListNode) ? range.end : tr.doc.content.size;
68
- var joins = [];
69
- doc.nodesBetween(from, to, function (node, pos, parent) {
70
- var resolvedPos = doc.resolve(pos);
71
- var nodeBefore = resolvedPos.nodeBefore,
72
- nodeAfter = resolvedPos.nodeAfter;
73
- if (!nodeBefore || !nodeAfter || !(0, _utils.isListNode)(nodeBefore) || !(0, _utils.isListNode)(nodeAfter)) {
74
- return;
75
- }
76
- var isNestedList = (0, _utils.isListItemNode)(parent);
77
- if (!isNestedList && nodeBefore.type !== nodeAfter.type && !forceListType) {
78
- return;
79
- }
80
- var index = resolvedPos.index();
81
- var positionPreviousNode = resolvedPos.posAtIndex(index - 1);
82
- var positionCurrentNode = resolvedPos.posAtIndex(index);
83
-
84
- // If the previous node is part of the selection, OR
85
- // If the previous node is not part of the selection and the previous node has the same list type that we’re converting to
86
- var joinBefore = positionPreviousNode >= from || nodeBefore.type === forceListType;
87
- if (forceListType) {
88
- if (joinBefore) {
89
- tr.setNodeMarkup(positionPreviousNode, forceListType);
90
- }
91
- tr.setNodeMarkup(positionCurrentNode, forceListType);
92
- }
93
- if (isNestedList && nodeBefore.type !== nodeAfter.type) {
94
- var nodeType = direction === JoinDirection.RIGHT ? nodeAfter.type : nodeBefore.type;
95
- tr.setNodeMarkup(positionPreviousNode, nodeType);
96
- }
97
- if (joinBefore) {
98
- joins.push(pos);
99
- }
100
- });
101
- if (selection.empty && rootListNode && (0, _utils.isListNode)(rootListNode)) {
102
- var resolvedPos = doc.resolve(range.start + rootListNode.nodeSize);
103
- var nodeBefore = resolvedPos.nodeBefore,
104
- nodeAfter = resolvedPos.nodeAfter;
105
- if (nodeBefore && nodeAfter && (0, _utils.isListNode)(nodeBefore) && (0, _utils.isListNode)(nodeAfter) && nodeAfter.type === nodeBefore.type) {
106
- joins.push(resolvedPos.pos);
107
- }
108
- }
109
- for (var i = joins.length - 1; i >= 0; i--) {
110
- var listNode = tr.doc.nodeAt(joins[i]);
111
- var listName = listNode === null || listNode === void 0 ? void 0 : listNode.type.name;
112
- if (listName && (listName === 'orderedList' || listName === 'bulletList')) {
113
- var amount = result[listName] || 0;
114
- result[listName] = amount + 1;
115
- }
116
- tr.join(joins[i]);
117
- }
118
- return result;
119
- };
120
- exports.joinSiblingLists = joinSiblingLists;
16
+ }