@atlaskit/editor-core 181.0.0 → 182.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/codemods/140.0.0-rc-kraken-fix-type-errors.ts +0 -2
  3. package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +0 -17
  4. package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +0 -4
  5. package/dist/cjs/create-editor/create-plugins-list.js +7 -2
  6. package/dist/cjs/create-editor/feature-flags-from-props.js +31 -26
  7. package/dist/cjs/create-editor/sort-by-order.js +12 -0
  8. package/dist/cjs/editor-next/editor-migration-component.js +4 -1
  9. package/dist/cjs/editor-next/utils/deprecationWarnings.js +0 -5
  10. package/dist/cjs/labs/next/full-page.js +2 -1
  11. package/dist/cjs/labs/next/presets/default.js +2 -1
  12. package/dist/cjs/labs/next/presets/universal.js +7 -1
  13. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +2 -1
  14. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +4 -7
  15. package/dist/cjs/plugins/analytics/plugin.js +6 -6
  16. package/dist/cjs/plugins/avatar-group/index.js +5 -2
  17. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
  18. package/dist/cjs/plugins/base/index.js +4 -2
  19. package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
  20. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
  21. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
  22. package/dist/cjs/plugins/border/index.js +20 -0
  23. package/dist/cjs/plugins/card/index.js +4 -2
  24. package/dist/cjs/plugins/card/toolbar.js +12 -15
  25. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +7 -3
  26. package/dist/cjs/plugins/code-block/toolbar.js +1 -1
  27. package/dist/cjs/plugins/collab-edit/analytics.js +2 -3
  28. package/dist/cjs/plugins/collab-edit/events/handlers.js +2 -2
  29. package/dist/cjs/plugins/collab-edit/events/initialize.js +3 -2
  30. package/dist/cjs/plugins/collab-edit/index.js +5 -3
  31. package/dist/cjs/plugins/collab-edit/plugin.js +4 -3
  32. package/dist/cjs/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
  33. package/dist/cjs/plugins/collab-edit/ui/avatars.js +2 -3
  34. package/dist/cjs/plugins/date/index.js +90 -64
  35. package/dist/cjs/plugins/editor-disabled/index.js +8 -0
  36. package/dist/cjs/plugins/expand/index.js +4 -1
  37. package/dist/cjs/plugins/expand/nodeviews/index.js +6 -7
  38. package/dist/cjs/plugins/expand/pm-plugins/main.js +5 -2
  39. package/dist/cjs/plugins/extension/extension-api.js +27 -14
  40. package/dist/cjs/plugins/extension/pm-plugins/main.js +117 -177
  41. package/dist/cjs/plugins/extension/pm-plugins/utils.js +80 -0
  42. package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +7 -11
  43. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
  44. package/dist/cjs/plugins/find-replace/index.js +5 -2
  45. package/dist/cjs/plugins/floating-toolbar/index.js +15 -7
  46. package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
  47. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
  48. package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
  49. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -5
  50. package/dist/cjs/plugins/hyperlink/Toolbar.js +9 -12
  51. package/dist/cjs/plugins/hyperlink/index.js +6 -2
  52. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
  53. package/dist/cjs/plugins/index.js +7 -0
  54. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
  55. package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +5 -5
  56. package/dist/cjs/plugins/list/commands/index.js +31 -27
  57. package/dist/cjs/plugins/list/commands/outdent-list.js +2 -3
  58. package/dist/cjs/plugins/list/index.js +4 -3
  59. package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
  60. package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +2 -1
  61. package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +58 -0
  62. package/dist/cjs/plugins/list/pm-plugins/keymap.js +4 -4
  63. package/dist/cjs/plugins/list/pm-plugins/main.js +23 -21
  64. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
  65. package/dist/cjs/plugins/media/nodeviews/styles.js +13 -1
  66. package/dist/cjs/plugins/media/toolbar/commands.js +105 -2
  67. package/dist/cjs/plugins/media/toolbar/imageBorder.js +20 -0
  68. package/dist/cjs/plugins/media/toolbar/index.js +33 -4
  69. package/dist/cjs/plugins/media/ui/ImageBorder/index.js +219 -0
  70. package/dist/cjs/plugins/media/ui/ImageBorder/messages.js +50 -0
  71. package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +54 -0
  72. package/dist/cjs/plugins/media/utils/current-media-node.js +28 -5
  73. package/dist/cjs/plugins/paste/util/index.js +2 -0
  74. package/dist/cjs/plugins/rank.js +1 -1
  75. package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +5 -0
  76. package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
  77. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +3 -1
  78. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
  79. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
  80. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +6 -3
  81. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
  82. package/dist/cjs/plugins/type-ahead/index.js +4 -1
  83. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +4 -2
  84. package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +4 -2
  85. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +41 -4
  86. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  87. package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  88. package/dist/cjs/plugins/type-ahead/utils.js +22 -2
  89. package/dist/cjs/test-utils.js +3 -1
  90. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
  91. package/dist/cjs/ui/styles.js +1 -1
  92. package/dist/cjs/utils/input-rules.js +0 -17
  93. package/dist/cjs/utils/insert.js +53 -7
  94. package/dist/cjs/version-wrapper.js +1 -1
  95. package/dist/cjs/version.json +1 -1
  96. package/dist/es2019/create-editor/create-plugins-list.js +7 -2
  97. package/dist/es2019/create-editor/feature-flags-from-props.js +31 -26
  98. package/dist/es2019/create-editor/sort-by-order.js +11 -0
  99. package/dist/es2019/editor-next/editor-migration-component.js +4 -1
  100. package/dist/es2019/editor-next/utils/deprecationWarnings.js +0 -5
  101. package/dist/es2019/labs/next/full-page.js +2 -1
  102. package/dist/es2019/labs/next/presets/default.js +2 -1
  103. package/dist/es2019/labs/next/presets/universal.js +8 -2
  104. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
  105. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -8
  106. package/dist/es2019/plugins/analytics/plugin.js +45 -43
  107. package/dist/es2019/plugins/avatar-group/index.js +26 -21
  108. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
  109. package/dist/es2019/plugins/base/index.js +101 -97
  110. package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
  111. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
  112. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +2 -7
  113. package/dist/es2019/plugins/border/index.js +11 -0
  114. package/dist/es2019/plugins/card/index.js +4 -2
  115. package/dist/es2019/plugins/card/toolbar.js +10 -11
  116. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +7 -3
  117. package/dist/es2019/plugins/code-block/toolbar.js +2 -2
  118. package/dist/es2019/plugins/collab-edit/analytics.js +2 -3
  119. package/dist/es2019/plugins/collab-edit/events/handlers.js +2 -2
  120. package/dist/es2019/plugins/collab-edit/events/initialize.js +3 -2
  121. package/dist/es2019/plugins/collab-edit/index.js +5 -3
  122. package/dist/es2019/plugins/collab-edit/plugin.js +4 -3
  123. package/dist/es2019/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
  124. package/dist/es2019/plugins/collab-edit/ui/avatars.js +2 -3
  125. package/dist/es2019/plugins/date/index.js +92 -64
  126. package/dist/es2019/plugins/editor-disabled/index.js +8 -0
  127. package/dist/es2019/plugins/expand/index.js +57 -53
  128. package/dist/es2019/plugins/expand/nodeviews/index.js +6 -9
  129. package/dist/es2019/plugins/expand/pm-plugins/main.js +5 -3
  130. package/dist/es2019/plugins/extension/extension-api.js +31 -13
  131. package/dist/es2019/plugins/extension/pm-plugins/main.js +77 -96
  132. package/dist/es2019/plugins/extension/pm-plugins/utils.js +30 -0
  133. package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -8
  134. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -3
  135. package/dist/es2019/plugins/find-replace/index.js +5 -2
  136. package/dist/es2019/plugins/floating-toolbar/index.js +159 -149
  137. package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +4 -1
  138. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
  139. package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +4 -1
  140. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +6 -5
  141. package/dist/es2019/plugins/hyperlink/Toolbar.js +7 -9
  142. package/dist/es2019/plugins/hyperlink/index.js +66 -62
  143. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -3
  144. package/dist/es2019/plugins/index.js +2 -1
  145. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
  146. package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +5 -5
  147. package/dist/es2019/plugins/list/commands/index.js +4 -4
  148. package/dist/es2019/plugins/list/commands/outdent-list.js +2 -4
  149. package/dist/es2019/plugins/list/index.js +80 -77
  150. package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
  151. package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +2 -1
  152. package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +52 -0
  153. package/dist/es2019/plugins/list/pm-plugins/keymap.js +4 -4
  154. package/dist/es2019/plugins/list/pm-plugins/main.js +46 -46
  155. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +4 -1
  156. package/dist/es2019/plugins/media/nodeviews/styles.js +12 -1
  157. package/dist/es2019/plugins/media/toolbar/commands.js +93 -0
  158. package/dist/es2019/plugins/media/toolbar/imageBorder.js +15 -0
  159. package/dist/es2019/plugins/media/toolbar/index.js +36 -5
  160. package/dist/es2019/plugins/media/ui/ImageBorder/index.js +206 -0
  161. package/dist/es2019/plugins/media/ui/ImageBorder/messages.js +43 -0
  162. package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +124 -0
  163. package/dist/es2019/plugins/media/utils/current-media-node.js +22 -3
  164. package/dist/es2019/plugins/paste/util/index.js +2 -0
  165. package/dist/es2019/plugins/rank.js +1 -1
  166. package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +7 -0
  167. package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
  168. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +59 -55
  169. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
  170. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
  171. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +6 -3
  172. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
  173. package/dist/es2019/plugins/type-ahead/index.js +4 -1
  174. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +4 -2
  175. package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +4 -2
  176. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +41 -4
  177. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  178. package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  179. package/dist/es2019/plugins/type-ahead/utils.js +22 -2
  180. package/dist/es2019/test-utils.js +3 -1
  181. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
  182. package/dist/es2019/ui/styles.js +1 -0
  183. package/dist/es2019/utils/input-rules.js +0 -17
  184. package/dist/es2019/utils/insert.js +61 -10
  185. package/dist/es2019/version-wrapper.js +1 -1
  186. package/dist/es2019/version.json +1 -1
  187. package/dist/esm/create-editor/create-plugins-list.js +7 -2
  188. package/dist/esm/create-editor/feature-flags-from-props.js +31 -26
  189. package/dist/esm/create-editor/sort-by-order.js +11 -0
  190. package/dist/esm/editor-next/editor-migration-component.js +3 -0
  191. package/dist/esm/editor-next/utils/deprecationWarnings.js +0 -5
  192. package/dist/esm/labs/next/full-page.js +2 -1
  193. package/dist/esm/labs/next/presets/default.js +2 -1
  194. package/dist/esm/labs/next/presets/universal.js +8 -2
  195. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
  196. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -5
  197. package/dist/esm/plugins/analytics/plugin.js +6 -6
  198. package/dist/esm/plugins/avatar-group/index.js +5 -2
  199. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
  200. package/dist/esm/plugins/base/index.js +4 -2
  201. package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
  202. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
  203. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
  204. package/dist/esm/plugins/border/index.js +13 -0
  205. package/dist/esm/plugins/card/index.js +4 -2
  206. package/dist/esm/plugins/card/toolbar.js +12 -15
  207. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +7 -3
  208. package/dist/esm/plugins/code-block/toolbar.js +2 -2
  209. package/dist/esm/plugins/collab-edit/analytics.js +2 -3
  210. package/dist/esm/plugins/collab-edit/events/handlers.js +2 -2
  211. package/dist/esm/plugins/collab-edit/events/initialize.js +3 -2
  212. package/dist/esm/plugins/collab-edit/index.js +5 -3
  213. package/dist/esm/plugins/collab-edit/plugin.js +4 -3
  214. package/dist/esm/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
  215. package/dist/esm/plugins/collab-edit/ui/avatars.js +2 -3
  216. package/dist/esm/plugins/date/index.js +90 -64
  217. package/dist/esm/plugins/editor-disabled/index.js +8 -0
  218. package/dist/esm/plugins/expand/index.js +4 -1
  219. package/dist/esm/plugins/expand/nodeviews/index.js +6 -7
  220. package/dist/esm/plugins/expand/pm-plugins/main.js +5 -2
  221. package/dist/esm/plugins/extension/extension-api.js +24 -12
  222. package/dist/esm/plugins/extension/pm-plugins/main.js +113 -173
  223. package/dist/esm/plugins/extension/pm-plugins/utils.js +72 -0
  224. package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -10
  225. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
  226. package/dist/esm/plugins/find-replace/index.js +5 -2
  227. package/dist/esm/plugins/floating-toolbar/index.js +15 -7
  228. package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
  229. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
  230. package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
  231. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +6 -5
  232. package/dist/esm/plugins/hyperlink/Toolbar.js +9 -13
  233. package/dist/esm/plugins/hyperlink/index.js +6 -2
  234. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
  235. package/dist/esm/plugins/index.js +2 -1
  236. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
  237. package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +5 -5
  238. package/dist/esm/plugins/list/commands/index.js +31 -27
  239. package/dist/esm/plugins/list/commands/outdent-list.js +2 -3
  240. package/dist/esm/plugins/list/index.js +4 -3
  241. package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
  242. package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +2 -1
  243. package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +51 -0
  244. package/dist/esm/plugins/list/pm-plugins/keymap.js +4 -4
  245. package/dist/esm/plugins/list/pm-plugins/main.js +23 -21
  246. package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
  247. package/dist/esm/plugins/media/nodeviews/styles.js +13 -1
  248. package/dist/esm/plugins/media/toolbar/commands.js +99 -0
  249. package/dist/esm/plugins/media/toolbar/imageBorder.js +14 -0
  250. package/dist/esm/plugins/media/toolbar/index.js +34 -5
  251. package/dist/esm/plugins/media/ui/ImageBorder/index.js +211 -0
  252. package/dist/esm/plugins/media/ui/ImageBorder/messages.js +43 -0
  253. package/dist/esm/plugins/media/ui/ImageBorder/styles.js +37 -0
  254. package/dist/esm/plugins/media/utils/current-media-node.js +24 -3
  255. package/dist/esm/plugins/paste/util/index.js +2 -0
  256. package/dist/esm/plugins/rank.js +1 -1
  257. package/dist/esm/plugins/rule/pm-plugins/input-rule.js +5 -0
  258. package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
  259. package/dist/esm/plugins/toolbar-lists-indentation/index.js +3 -1
  260. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
  261. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
  262. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +6 -3
  263. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
  264. package/dist/esm/plugins/type-ahead/index.js +4 -1
  265. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +4 -2
  266. package/dist/esm/plugins/type-ahead/pm-plugins/main.js +4 -2
  267. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +41 -4
  268. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -0
  269. package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +9 -5
  270. package/dist/esm/plugins/type-ahead/utils.js +22 -2
  271. package/dist/esm/test-utils.js +3 -1
  272. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
  273. package/dist/esm/ui/styles.js +1 -1
  274. package/dist/esm/utils/input-rules.js +0 -17
  275. package/dist/esm/utils/insert.js +56 -10
  276. package/dist/esm/version-wrapper.js +1 -1
  277. package/dist/esm/version.json +1 -1
  278. package/dist/types/create-editor/sort-by-order.d.ts +9 -0
  279. package/dist/types/editor-next/editor-migration-component.d.ts +1 -0
  280. package/dist/types/labs/next/presets/cxhtml.d.ts +36 -2
  281. package/dist/types/labs/next/presets/default.d.ts +72 -4
  282. package/dist/types/labs/next/presets/mobile.d.ts +36 -2
  283. package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -1
  284. package/dist/types/plugins/analytics/plugin.d.ts +2 -0
  285. package/dist/types/plugins/avatar-group/index.d.ts +2 -0
  286. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -0
  287. package/dist/types/plugins/base/index.d.ts +2 -0
  288. package/dist/types/plugins/base/pm-plugins/disable-spell-checking.d.ts +2 -1
  289. package/dist/types/plugins/border/index.d.ts +3 -0
  290. package/dist/types/plugins/card/index.d.ts +2 -0
  291. package/dist/types/plugins/card/toolbar.d.ts +2 -1
  292. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +5 -2
  293. package/dist/types/plugins/collab-edit/analytics.d.ts +2 -1
  294. package/dist/types/plugins/collab-edit/events/handlers.d.ts +2 -1
  295. package/dist/types/plugins/collab-edit/events/initialize.d.ts +3 -1
  296. package/dist/types/plugins/collab-edit/index.d.ts +2 -0
  297. package/dist/types/plugins/collab-edit/plugin.d.ts +2 -1
  298. package/dist/types/plugins/collab-edit/ui/avatars-with-plugin-state.d.ts +4 -0
  299. package/dist/types/plugins/collab-edit/ui/avatars.d.ts +2 -0
  300. package/dist/types/plugins/date/index.d.ts +9 -1
  301. package/dist/types/plugins/editor-disabled/index.d.ts +3 -1
  302. package/dist/types/plugins/expand/index.d.ts +2 -0
  303. package/dist/types/plugins/expand/nodeviews/index.d.ts +5 -2
  304. package/dist/types/plugins/expand/pm-plugins/main.d.ts +2 -1
  305. package/dist/types/plugins/extension/pm-plugins/main.d.ts +8 -2
  306. package/dist/types/plugins/extension/pm-plugins/utils.d.ts +3 -0
  307. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -7
  308. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +2 -0
  309. package/dist/types/plugins/find-replace/index.d.ts +2 -0
  310. package/dist/types/plugins/floating-toolbar/index.d.ts +4 -1
  311. package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +2 -0
  312. package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
  313. package/dist/types/plugins/hyperlink/index.d.ts +2 -0
  314. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -0
  315. package/dist/types/plugins/index.d.ts +1 -0
  316. package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -1
  317. package/dist/types/plugins/list/commands/index.d.ts +3 -2
  318. package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
  319. package/dist/types/plugins/list/index.d.ts +2 -0
  320. package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +1 -1
  321. package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +13 -0
  322. package/dist/types/plugins/list/pm-plugins/keymap.d.ts +2 -1
  323. package/dist/types/plugins/list/pm-plugins/main.d.ts +3 -2
  324. package/dist/types/plugins/media/nodeviews/styles.d.ts +3 -1
  325. package/dist/types/plugins/media/toolbar/commands.d.ts +5 -0
  326. package/dist/types/plugins/media/toolbar/imageBorder.d.ts +2 -0
  327. package/dist/types/plugins/media/types.d.ts +3 -0
  328. package/dist/types/plugins/media/ui/ImageBorder/index.d.ts +13 -0
  329. package/dist/types/plugins/media/ui/ImageBorder/messages.d.ts +42 -0
  330. package/dist/types/plugins/media/ui/ImageBorder/styles.d.ts +15 -0
  331. package/dist/types/plugins/media/utils/current-media-node.d.ts +6 -0
  332. package/dist/types/plugins/text-color/pm-plugins/main.d.ts +0 -2
  333. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -0
  334. package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
  335. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
  336. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -1
  337. package/dist/types/plugins/type-ahead/index.d.ts +1 -0
  338. package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +2 -1
  339. package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +2 -1
  340. package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +1 -0
  341. package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +1 -0
  342. package/dist/types/plugins/type-ahead/utils.d.ts +2 -1
  343. package/dist/types/test-utils.d.ts +4 -2
  344. package/dist/types/types/editor-props.d.ts +5 -0
  345. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
  346. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  347. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  348. package/package.json +13 -12
  349. package/report.api.md +12 -4
  350. package/codemods/__tests__/rename-experimental-text-color-prop.ts +0 -204
  351. package/codemods/migrates/rename-experimental-text-color-prop.ts +0 -6
@@ -5,7 +5,8 @@ import { INPUT_METHOD } from '../../analytics';
5
5
  import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentation-buttons';
6
6
  export function onItemActivated(_ref) {
7
7
  var buttonName = _ref.buttonName,
8
- editorView = _ref.editorView;
8
+ editorView = _ref.editorView,
9
+ featureFlags = _ref.featureFlags;
9
10
  switch (buttonName) {
10
11
  case 'bullet_list':
11
12
  toggleBulletList(editorView, INPUT_METHOD.TOOLBAR);
@@ -34,7 +35,7 @@ export function onItemActivated(_ref) {
34
35
  outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
35
36
  }
36
37
  if (_node === 'list') {
37
- outdentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
38
+ outdentList(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
38
39
  }
39
40
  if (_node === 'taskList') {
40
41
  outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
@@ -113,6 +113,8 @@ var TypeAheadMenu = /*#__PURE__*/React.memo(function (_ref) {
113
113
  *
114
114
  */
115
115
  var typeAheadPlugin = function typeAheadPlugin(options) {
116
+ var _options$useBetterTyp;
117
+ var useBetterTypeaheadNavigation = (_options$useBetterTyp = options === null || options === void 0 ? void 0 : options.useBetterTypeaheadNavigation) !== null && _options$useBetterTyp !== void 0 ? _options$useBetterTyp : true;
116
118
  var fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
117
119
  var popupMountRef = {
118
120
  current: null
@@ -139,7 +141,8 @@ var typeAheadPlugin = function typeAheadPlugin(options) {
139
141
  popupMountRef: popupMountRef,
140
142
  reactDispatch: dispatch,
141
143
  typeAheadHandlers: typeAhead,
142
- createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent
144
+ createAnalyticsEvent: options === null || options === void 0 ? void 0 : options.createAnalyticsEvent,
145
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
143
146
  });
144
147
  }
145
148
  }, {
@@ -15,7 +15,8 @@ import { closeTypeAhead } from '../transforms/close-type-ahead';
15
15
  export var factoryDecorations = function factoryDecorations(_ref) {
16
16
  var intl = _ref.intl,
17
17
  popupMountRef = _ref.popupMountRef,
18
- createAnalyticsEvent = _ref.createAnalyticsEvent;
18
+ createAnalyticsEvent = _ref.createAnalyticsEvent,
19
+ useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
19
20
  var createDecorations = function createDecorations(tr, _ref2) {
20
21
  var triggerHandler = _ref2.triggerHandler,
21
22
  inputMethod = _ref2.inputMethod,
@@ -87,7 +88,8 @@ export var factoryDecorations = function factoryDecorations(_ref) {
87
88
  popupsBoundariesElement: (_popupMountRef$curren2 = popupMountRef.current) === null || _popupMountRef$curren2 === void 0 ? void 0 : _popupMountRef$curren2.popupsBoundariesElement,
88
89
  popupsScrollableElement: (_popupMountRef$curren3 = popupMountRef.current) === null || _popupMountRef$curren3 === void 0 ? void 0 : _popupMountRef$curren3.popupsScrollableElement,
89
90
  onUndoRedo: onUndoRedo,
90
- reopenQuery: reopenQuery
91
+ reopenQuery: reopenQuery,
92
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
91
93
  })), typeaheadComponent);
92
94
  shouldFocusCursorInsideQuery = false;
93
95
  return typeaheadComponent;
@@ -25,12 +25,14 @@ export function createPlugin(_ref) {
25
25
  popupMountRef = _ref.popupMountRef,
26
26
  createAnalyticsEvent = _ref.createAnalyticsEvent,
27
27
  typeAheadHandlers = _ref.typeAheadHandlers,
28
- getIntl = _ref.getIntl;
28
+ getIntl = _ref.getIntl,
29
+ useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
29
30
  var intl = getIntl();
30
31
  var _factoryDecorations = factoryDecorations({
31
32
  intl: intl,
32
33
  popupMountRef: popupMountRef,
33
- createAnalyticsEvent: createAnalyticsEvent
34
+ createAnalyticsEvent: createAnalyticsEvent,
35
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
34
36
  }),
35
37
  createDecorations = _factoryDecorations.createDecorations,
36
38
  removeDecorations = _factoryDecorations.removeDecorations;
@@ -66,7 +66,8 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
66
66
  onQueryFocus = _ref.onQueryFocus,
67
67
  onUndoRedo = _ref.onUndoRedo,
68
68
  editorView = _ref.editorView,
69
- items = _ref.items;
69
+ items = _ref.items,
70
+ useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
70
71
  var ref = useRef(document.createElement('span'));
71
72
  var inputRef = useRef(null);
72
73
  var _useState = useState(null),
@@ -139,6 +140,19 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
139
140
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
140
141
  if (!event.isComposing || event.which !== 229 && event.keyCode !== 229) {
141
142
  if (selectedIndex === -1) {
143
+ if (useBetterTypeaheadNavigation) {
144
+ /**
145
+ * TODO DTR-1401: (also see ED-17200) There are two options
146
+ * here, either
147
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
148
+ * `insertSelectedItem` at the cost of breaking some of the a11y
149
+ * focus changes,
150
+ * - or do this jank at the cost of some small analytics noise.
151
+ *
152
+ * The focus behaviour still needs cleanup
153
+ */
154
+ selectPreviousItem();
155
+ }
142
156
  selectNextItem();
143
157
  }
144
158
  onItemSelect(event.shiftKey ? SelectItemMode.SHIFT_ENTER : SelectItemMode.ENTER);
@@ -146,18 +160,41 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
146
160
  break;
147
161
  case 'Tab':
148
162
  if (selectedIndex === -1) {
163
+ if (useBetterTypeaheadNavigation) {
164
+ /**
165
+ * TODO DTR-1401: (also see ED-17200) There are two options
166
+ * here, either
167
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
168
+ * `insertSelectedItem` at the cost of breaking some of the a11y
169
+ * focus changes,
170
+ * - or do this jank at the cost of some small analytics noise.
171
+ *
172
+ */
173
+ selectPreviousItem();
174
+ }
149
175
  selectNextItem();
150
176
  }
177
+ // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
151
178
  onItemSelect(SelectItemMode.TAB);
152
179
  break;
153
180
  case 'ArrowDown':
154
- if (selectedIndex === -1) {
181
+ if (useBetterTypeaheadNavigation) {
155
182
  selectNextItem();
183
+ } else {
184
+ // TODO DTR-1401: why were we preventing selection?
185
+ if (selectedIndex === -1) {
186
+ selectNextItem();
187
+ }
156
188
  }
157
189
  break;
158
190
  case 'ArrowUp':
159
- if (selectedIndex === -1) {
191
+ if (useBetterTypeaheadNavigation) {
160
192
  selectPreviousItem();
193
+ } else {
194
+ // TODO DTR-1401: why were we preventing selection?
195
+ if (selectedIndex === -1) {
196
+ selectPreviousItem();
197
+ }
161
198
  }
162
199
  break;
163
200
  }
@@ -170,7 +207,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
170
207
  event.preventDefault();
171
208
  return false;
172
209
  }
173
- }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
210
+ }, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
174
211
  var onClick = useCallback(function (event) {
175
212
  var _inputRef$current;
176
213
  event.stopPropagation();
@@ -176,6 +176,8 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
176
176
  selectPreviousItem();
177
177
  event.preventDefault();
178
178
  break;
179
+
180
+ // TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
179
181
  case 'Tab':
180
182
  //Tab key quick inserts the selected item.
181
183
  onItemClick(SelectItemMode.TAB, selectedIndex);
@@ -19,7 +19,8 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
19
19
  inputMethod = _ref.inputMethod,
20
20
  getDecorationPosition = _ref.getDecorationPosition,
21
21
  reopenQuery = _ref.reopenQuery,
22
- onUndoRedo = _ref.onUndoRedo;
22
+ onUndoRedo = _ref.onUndoRedo,
23
+ useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
23
24
  var _useState = useState(false),
24
25
  _useState2 = _slicedToArray(_useState, 2),
25
26
  closed = _useState2[0],
@@ -41,15 +42,17 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
41
42
  var selectNextItem = useMemo(function () {
42
43
  return moveSelectedIndex({
43
44
  editorView: editorView,
44
- direction: 'next'
45
+ direction: 'next',
46
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
45
47
  });
46
- }, [editorView]);
48
+ }, [editorView, useBetterTypeaheadNavigation]);
47
49
  var selectPreviousItem = useMemo(function () {
48
50
  return moveSelectedIndex({
49
51
  editorView: editorView,
50
- direction: 'previous'
52
+ direction: 'previous',
53
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
51
54
  });
52
- }, [editorView]);
55
+ }, [editorView, useBetterTypeaheadNavigation]);
53
56
  var cancel = useCallback(function (_ref2) {
54
57
  var setSelectionAt = _ref2.setSelectionAt,
55
58
  addPrefixTrigger = _ref2.addPrefixTrigger,
@@ -100,6 +103,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
100
103
  return null;
101
104
  }
102
105
  return /*#__PURE__*/React.createElement(InputQuery, {
106
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
103
107
  triggerQueryPrefix: triggerHandler.trigger,
104
108
  onQueryChange: setQuery,
105
109
  onItemSelect: insertSelectedItem,
@@ -51,7 +51,8 @@ export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
51
51
  };
52
52
  export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
53
53
  var editorView = _ref2.editorView,
54
- direction = _ref2.direction;
54
+ direction = _ref2.direction,
55
+ useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
55
56
  return function () {
56
57
  var typeAheadState = getPluginState(editorView.state);
57
58
  if (!typeAheadState) {
@@ -63,7 +64,26 @@ export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
63
64
  var nextIndex;
64
65
  if (direction === 'next') {
65
66
  stats.increaseArrowDown();
66
- nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
67
+ if (useBetterTypeaheadNavigation) {
68
+ /**
69
+ * See: https://product-fabric.atlassian.net/browse/ED-17200
70
+ * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
71
+ * and only do so when there is explicit logic to focus into the typeahead
72
+ * options.
73
+ *
74
+ * This check for "set index to 1 when -1"
75
+ * - is a temporary workaround to get back the previous behaviour without
76
+ * entirely reverting the a11y improvements
77
+ *
78
+ */
79
+ if (selectedIndex === -1 && items.length > 1) {
80
+ nextIndex = 1;
81
+ } else {
82
+ nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
83
+ }
84
+ } else {
85
+ nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
86
+ }
67
87
  } else {
68
88
  stats.increaseArrowUp();
69
89
  nextIndex = selectedIndex <= 0 ? items.length - 1 : selectedIndex - 1;
@@ -61,7 +61,9 @@ export var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
61
61
  return function (pluginFactoryParams) {
62
62
  var editorPlugins = [];
63
63
  var preset = inputPreset.has(basePlugin) ? inputPreset : inputPreset.add(basePlugin);
64
- editorPlugins = preset.build();
64
+ editorPlugins = preset.build({
65
+ pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
66
+ });
65
67
  var editorConfig = lightProcessPluginsList(editorPlugins);
66
68
  var schema = createSchema(editorConfig);
67
69
  var plugins = editorConfig.plugins.sort(sortByOrder('plugins')).map(function (_ref) {
@@ -46,14 +46,16 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
46
46
  eventDispatcher: props.eventDispatcher,
47
47
  inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
48
48
  inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
49
- isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
49
+ isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
50
+ featureFlags: props.featureFlags || {}
50
51
  }), (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.findReplace && (_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar ? jsx(FindReplaceToolbarButtonWithState, {
51
52
  popupsBoundariesElement: props.popupsBoundariesElement,
52
53
  popupsMountPoint: props.popupsMountPoint,
53
54
  popupsScrollableElement: props.popupsScrollableElement,
54
55
  editorView: props.editorView,
55
56
  containerElement: props.containerElement,
56
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
57
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
58
+ featureFlags: props.featureFlags
57
59
  }) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
58
60
  useEffect(function () {
59
61
  var _props$featureFlags7;
@@ -5,7 +5,7 @@ import { N30 } from '@atlaskit/theme/colors';
5
5
  export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
6
6
  export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
7
7
  export var buttonGroupStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n & > div {\n display: flex;\n }\n"])));
8
- export var separatorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), "var(--ds-border, ".concat(N30, ")"));
8
+ export var separatorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n user-select: none;\n"])), "var(--ds-border, ".concat(N30, ")"));
9
9
  export var wrapperStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > div,\n > span {\n display: flex;\n }\n\n > div > div {\n display: flex;\n }\n\n margin-left: 0;\n min-width: auto;\n"])));
10
10
  export var wrapperSmallStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 4px;\n min-width: 40px;\n"])));
11
11
  export var expandIconWrapperStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
@@ -8,8 +8,6 @@ import { createInputRulePlugin } from '@atlaskit/prosemirror-input-rules';
8
8
  import { addAnalytics } from '../plugins/analytics';
9
9
  import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
10
10
  import { closeHistory } from 'prosemirror-history';
11
- import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
12
- import { getFeatureFlags } from '../plugins/feature-flags-context';
13
11
  export var ruleWithAnalytics = function ruleWithAnalytics(getPayload) {
14
12
  return function (originalRule) {
15
13
  var onHandlerApply = function onHandlerApply(state, tr, matchResult) {
@@ -98,21 +96,6 @@ export var createWrappingJoinRule = function createWrappingJoinRule(_ref3) {
98
96
  tr.setNodeMarkup(parentNodePosMapped, parentNode.type, parentNode.attrs, allowedMarks);
99
97
  }
100
98
  tr.wrap(range, wrapping);
101
- var featureFlags = getFeatureFlags(state);
102
- if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && nodeType === state.schema.nodes.orderedList) {
103
- // if an orderedList node would be inserted by the input rule match, and
104
- // that orderedList node is being added directly before another orderedList
105
- // node, then join those nodes
106
- var $end = tr.doc.resolve(tr.mapping.map(end));
107
- var _node = findParentNodeOfTypeClosestToPos($end, nodeType);
108
- if (_node) {
109
- var nodeEnd = _node.pos + _node.node.nodeSize;
110
- var after = tr.doc.resolve(nodeEnd).nodeAfter;
111
- if (after && after.type === nodeType && canJoin(tr.doc, nodeEnd) && (!joinPredicate || joinPredicate(match, after, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_BELOW))) {
112
- tr.join(nodeEnd);
113
- }
114
- }
115
- }
116
99
  var before = tr.doc.resolve(fixedStart - 1).nodeBefore;
117
100
  if (before && before.type === nodeType && canJoin(tr.doc, fixedStart - 1) && (!joinPredicate || joinPredicate(match, before, JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_ABOVE))) {
118
101
  tr.join(fixedStart - 1);
@@ -1,10 +1,11 @@
1
- import { isNodeSelection, canInsert, hasParentNodeOfType, safeInsert as pmSafeInsert } from 'prosemirror-utils';
2
- import { Node, Fragment } from 'prosemirror-model';
3
- import { NodeSelection, Selection } from 'prosemirror-state';
1
+ import { isNodeSelection, canInsert, safeInsert as pmSafeInsert, hasParentNodeOfType, findParentNodeOfType } from 'prosemirror-utils';
2
+ import { Node, Fragment, Slice } from 'prosemirror-model';
3
+ import { NodeSelection, Selection, TextSelection } from 'prosemirror-state';
4
4
  import { ReplaceStep, ReplaceAroundStep } from 'prosemirror-transform';
5
5
  import { isEmptyParagraph } from './document';
6
6
  import { GapCursorSelection, Side } from '../plugins/selection/gap-cursor-selection';
7
7
  import { normaliseNestedLayout } from './selection';
8
+ import { isListItemNode } from '../plugins/list/utils/node';
8
9
  export var LookDirection;
9
10
  (function (LookDirection) {
10
11
  LookDirection["Before"] = "before";
@@ -20,6 +21,18 @@ var nodeIsInsideAList = function nodeIsInsideAList(tr) {
20
21
  var nodes = tr.doc.type.schema.nodes;
21
22
  return hasParentNodeOfType([nodes.orderedList, nodes.bulletList])(tr.selection);
22
23
  };
24
+ var selectionIsInsideAPanel = function selectionIsInsideAPanel(tr) {
25
+ var nodes = tr.doc.type.schema.nodes;
26
+ return hasParentNodeOfType(nodes.panel)(tr.selection);
27
+ };
28
+ var selectionIsInNestedList = function selectionIsInNestedList(tr) {
29
+ var nodes = tr.doc.type.schema.nodes;
30
+ var parentListNode = findParentNodeOfType([nodes.orderedList, nodes.bulletList])(tr.selection);
31
+ if (!parentListNode) {
32
+ return false;
33
+ }
34
+ return isListItemNode(tr.doc.resolve(parentListNode.pos).parent);
35
+ };
23
36
  var insertBeforeOrAfter = function insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content) {
24
37
  /**
25
38
  * This block caters for the first item in a parent with the cursor being at the very start
@@ -47,9 +60,7 @@ export var safeInsert = function safeInsert(content, position) {
47
60
  var _tr$selection$$from$n;
48
61
  var nodes = tr.doc.type.schema.nodes;
49
62
  var whitelist = [nodes.rule, nodes.mediaSingle];
50
-
51
- // fallback if the node to insert is not in the whitelist, or if the insertion should happen within a list.
52
- if (content instanceof Fragment || !whitelist.includes(content.type) || nodeIsInsideAList(tr)) {
63
+ if (content instanceof Fragment || !whitelist.includes(content.type)) {
53
64
  return null;
54
65
  }
55
66
 
@@ -81,14 +92,28 @@ export var safeInsert = function safeInsert(content, position) {
81
92
  }
82
93
  var grandParentNodeType = (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type;
83
94
  var parentNodeType = tr.selection.$from.parent.type;
84
- if (!lookDirection && !shouldSplitSelectedNodeOnNodeInsertion({
95
+
96
+ // if there is no direction, and cannot split for this particular node
97
+ var noDirectionAndShouldNotSplit = !lookDirection && !shouldSplitSelectedNodeOnNodeInsertion({
85
98
  parentNodeType: parentNodeType,
86
99
  grandParentNodeType: grandParentNodeType,
87
100
  content: content
88
- })) {
101
+ });
102
+ var ruleNodeInANestedListNode = content.type === nodes.rule && selectionIsInNestedList(tr);
103
+ var nonRuleNodeInListNode = !(content.type === nodes.rule) && nodeIsInsideAList(tr);
104
+ if (ruleNodeInANestedListNode || noDirectionAndShouldNotSplit && nonRuleNodeInListNode || noDirectionAndShouldNotSplit && !nodeIsInsideAList(tr)) {
89
105
  // node to be inserted is an invalid child of selection so insert below selected node
90
106
  return pmSafeInsert(content, tr.selection.from)(tr);
91
107
  }
108
+
109
+ // if node is a rule and that is a flat list splitting and not at the end of a list
110
+ var _tr$selection = tr.selection,
111
+ from = _tr$selection.from,
112
+ to = _tr$selection.to;
113
+ var ruleTypeInAList = content.type === nodes.rule && nodeIsInsideAList(tr);
114
+ if (ruleTypeInAList && !($insertPos.pos === insertPosEnd)) {
115
+ return tr.replaceRange(from, to, new Slice(Fragment.from(nodes.rule.createChecked()), 0, 0));
116
+ }
92
117
  if (!lookDirection) {
93
118
  // fallback to consumer for now
94
119
  return null;
@@ -110,7 +135,14 @@ export var safeInsert = function safeInsert(content, position) {
110
135
 
111
136
  // If we can't insert, and we think we should split, we fallback to consumer for now
112
137
  if (shouldSplit(parentNode.type, tr.doc.type.schema.nodes)) {
113
- return finaliseInsert(insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content), content.nodeSize);
138
+ var nextTr = finaliseInsert(insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content), content.nodeSize);
139
+
140
+ // Move selection to the closest text node, otherwise it defaults to the whatever the lookDirection is set to above
141
+ if ([nodes.orderedList, nodes.bulletList].includes(parentNode.type) && nextTr) {
142
+ return nextTr.setSelection(TextSelection.between(nextTr.selection.$from, nextTr.selection.$from));
143
+ } else {
144
+ return nextTr;
145
+ }
114
146
  }
115
147
 
116
148
  // Can not insert into current parent, step up one parent
@@ -157,7 +189,21 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
157
189
  *
158
190
  */
159
191
  } else if (node.isBlock) {
160
- tr = pmSafeInsert(normaliseNestedLayout(state, node), undefined, true)(tr);
192
+ /**
193
+ *
194
+ * Rule has unique insertion behaviour
195
+ * so using this safeInsert function in order to handle specific cases in flat list vs nested list
196
+ * instead of a generic pmSafeInsert (i.e appending at the end)
197
+ *
198
+ */
199
+
200
+ var selectionInsideAPanel = selectionIsInsideAPanel(tr);
201
+ if (node.type.name === 'rule' && !selectionInsideAPanel) {
202
+ var _safeInsert;
203
+ tr = (_safeInsert = safeInsert(node, tr.selection.from)(tr)) !== null && _safeInsert !== void 0 ? _safeInsert : tr;
204
+ } else {
205
+ tr = pmSafeInsert(normaliseNestedLayout(state, node), undefined, true)(tr);
206
+ }
161
207
 
162
208
  /**
163
209
  *
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "181.0.0";
2
+ export var version = "182.0.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "181.0.0",
3
+ "version": "182.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -3,3 +3,12 @@ export declare function sortByOrder(item: 'plugins' | 'nodes' | 'marks'): (a: {
3
3
  }, b: {
4
4
  name: string;
5
5
  }) => number;
6
+ export declare function sortByOrderWithTypeName(item: 'plugins' | 'nodes' | 'marks'): (a: {
7
+ type: {
8
+ name: string;
9
+ };
10
+ }, b: {
11
+ type: {
12
+ name: string;
13
+ };
14
+ }) => number;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { EditorProps } from '../types/editor-props';
3
3
  export default class EditorMigrationComponent extends React.Component<EditorProps> {
4
+ static defaultProps: EditorProps;
4
5
  render(): JSX.Element;
5
6
  }
@@ -20,11 +20,31 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
20
20
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
21
21
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlagsContext", {
22
22
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
23
- }>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"floatingToolbar", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"floatingToolbar", {}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"fakeTextCursor", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"fakeTextCursor", {}>, (config?: ((editorView: import("prosemirror-view").EditorView<any>) => void) | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"submitEditor", {
23
+ }>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"floatingToolbar", {
24
+ dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
25
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
26
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
27
+ }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
28
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
29
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
30
+ }>];
31
+ }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"floatingToolbar", {
32
+ dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
33
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
34
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
35
+ }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
36
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
37
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
38
+ }>];
39
+ }>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"fakeTextCursor", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"fakeTextCursor", {}>, (config?: ((editorView: import("prosemirror-view").EditorView<any>) => void) | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"submitEditor", {
24
40
  pluginConfiguration: ((editorView: import("prosemirror-view").EditorView<any>) => void) | undefined;
25
41
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"submitEditor", {
26
42
  pluginConfiguration: ((editorView: import("prosemirror-view").EditorView<any>) => void) | undefined;
27
- }>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"editorDisabled", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"editorDisabled", {}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"unsupportedContent", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"unsupportedContent", {}>, (config?: import("../../../plugins/type-ahead").TypeAheadPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"typeAhead", {
43
+ }>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"editorDisabled", {
44
+ sharedState: import("../../../plugins/editor-disabled").EditorDisabledPluginState;
45
+ }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"editorDisabled", {
46
+ sharedState: import("../../../plugins/editor-disabled").EditorDisabledPluginState;
47
+ }>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"unsupportedContent", {}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"unsupportedContent", {}>, (config?: import("../../../plugins/type-ahead").TypeAheadPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"typeAhead", {
28
48
  pluginConfiguration: import("../../../plugins/type-ahead").TypeAheadPluginOptions | undefined;
29
49
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"typeAhead", {
30
50
  pluginConfiguration: import("../../../plugins/type-ahead").TypeAheadPluginOptions | undefined;
@@ -38,7 +58,21 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
38
58
  pluginConfiguration: import("../../../plugins/text-formatting/types").TextFormattingOptions | undefined;
39
59
  }>, (config?: import("../../../plugins/hyperlink/types").HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
40
60
  pluginConfiguration: import("../../../plugins/hyperlink/types").HyperlinkPluginOptions | undefined;
61
+ dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
62
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
63
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
64
+ }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
65
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
66
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
67
+ }>];
41
68
  }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
42
69
  pluginConfiguration: import("../../../plugins/hyperlink/types").HyperlinkPluginOptions | undefined;
70
+ dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
71
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
72
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
73
+ }> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"featureFlags", {
74
+ pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
75
+ sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
76
+ }>];
43
77
  }>, ...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]]>[];
44
78
  export declare function EditorPresetCXHTML(props: EditorPresetCXHTMLProps): JSX.Element;