@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
@@ -76,7 +76,8 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
76
76
  onQueryFocus = _ref.onQueryFocus,
77
77
  onUndoRedo = _ref.onUndoRedo,
78
78
  editorView = _ref.editorView,
79
- items = _ref.items;
79
+ items = _ref.items,
80
+ useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
80
81
  var ref = (0, _react.useRef)(document.createElement('span'));
81
82
  var inputRef = (0, _react.useRef)(null);
82
83
  var _useState = (0, _react.useState)(null),
@@ -149,6 +150,19 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
149
150
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
150
151
  if (!event.isComposing || event.which !== 229 && event.keyCode !== 229) {
151
152
  if (selectedIndex === -1) {
153
+ if (useBetterTypeaheadNavigation) {
154
+ /**
155
+ * TODO DTR-1401: (also see ED-17200) There are two options
156
+ * here, either
157
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
158
+ * `insertSelectedItem` at the cost of breaking some of the a11y
159
+ * focus changes,
160
+ * - or do this jank at the cost of some small analytics noise.
161
+ *
162
+ * The focus behaviour still needs cleanup
163
+ */
164
+ selectPreviousItem();
165
+ }
152
166
  selectNextItem();
153
167
  }
154
168
  onItemSelect(event.shiftKey ? _typeAhead.SelectItemMode.SHIFT_ENTER : _typeAhead.SelectItemMode.ENTER);
@@ -156,18 +170,41 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
156
170
  break;
157
171
  case 'Tab':
158
172
  if (selectedIndex === -1) {
173
+ if (useBetterTypeaheadNavigation) {
174
+ /**
175
+ * TODO DTR-1401: (also see ED-17200) There are two options
176
+ * here, either
177
+ * - set the index directly to 1 in WrapperTypeAhead.tsx's
178
+ * `insertSelectedItem` at the cost of breaking some of the a11y
179
+ * focus changes,
180
+ * - or do this jank at the cost of some small analytics noise.
181
+ *
182
+ */
183
+ selectPreviousItem();
184
+ }
159
185
  selectNextItem();
160
186
  }
187
+ // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
161
188
  onItemSelect(_typeAhead.SelectItemMode.TAB);
162
189
  break;
163
190
  case 'ArrowDown':
164
- if (selectedIndex === -1) {
191
+ if (useBetterTypeaheadNavigation) {
165
192
  selectNextItem();
193
+ } else {
194
+ // TODO DTR-1401: why were we preventing selection?
195
+ if (selectedIndex === -1) {
196
+ selectNextItem();
197
+ }
166
198
  }
167
199
  break;
168
200
  case 'ArrowUp':
169
- if (selectedIndex === -1) {
201
+ if (useBetterTypeaheadNavigation) {
170
202
  selectPreviousItem();
203
+ } else {
204
+ // TODO DTR-1401: why were we preventing selection?
205
+ if (selectedIndex === -1) {
206
+ selectPreviousItem();
207
+ }
171
208
  }
172
209
  break;
173
210
  }
@@ -180,7 +217,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
180
217
  event.preventDefault();
181
218
  return false;
182
219
  }
183
- }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
220
+ }, [useBetterTypeaheadNavigation, onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state]);
184
221
  var onClick = (0, _react.useCallback)(function (event) {
185
222
  var _inputRef$current;
186
223
  event.stopPropagation();
@@ -185,6 +185,8 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
185
185
  selectPreviousItem();
186
186
  event.preventDefault();
187
187
  break;
188
+
189
+ // TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
188
190
  case 'Tab':
189
191
  //Tab key quick inserts the selected item.
190
192
  onItemClick(_typeAhead.SelectItemMode.TAB, selectedIndex);
@@ -29,7 +29,8 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
29
29
  inputMethod = _ref.inputMethod,
30
30
  getDecorationPosition = _ref.getDecorationPosition,
31
31
  reopenQuery = _ref.reopenQuery,
32
- onUndoRedo = _ref.onUndoRedo;
32
+ onUndoRedo = _ref.onUndoRedo,
33
+ useBetterTypeaheadNavigation = _ref.useBetterTypeaheadNavigation;
33
34
  var _useState = (0, _react.useState)(false),
34
35
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
35
36
  closed = _useState2[0],
@@ -51,15 +52,17 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
51
52
  var selectNextItem = (0, _react.useMemo)(function () {
52
53
  return (0, _utils.moveSelectedIndex)({
53
54
  editorView: editorView,
54
- direction: 'next'
55
+ direction: 'next',
56
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
55
57
  });
56
- }, [editorView]);
58
+ }, [editorView, useBetterTypeaheadNavigation]);
57
59
  var selectPreviousItem = (0, _react.useMemo)(function () {
58
60
  return (0, _utils.moveSelectedIndex)({
59
61
  editorView: editorView,
60
- direction: 'previous'
62
+ direction: 'previous',
63
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
61
64
  });
62
- }, [editorView]);
65
+ }, [editorView, useBetterTypeaheadNavigation]);
63
66
  var cancel = (0, _react.useCallback)(function (_ref2) {
64
67
  var setSelectionAt = _ref2.setSelectionAt,
65
68
  addPrefixTrigger = _ref2.addPrefixTrigger,
@@ -110,6 +113,7 @@ var WrapperTypeAhead = /*#__PURE__*/_react.default.memo(function (_ref) {
110
113
  return null;
111
114
  }
112
115
  return /*#__PURE__*/_react.default.createElement(_InputQuery.InputQuery, {
116
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation,
113
117
  triggerQueryPrefix: triggerHandler.trigger,
114
118
  onQueryChange: setQuery,
115
119
  onItemSelect: insertSelectedItem,
@@ -65,7 +65,8 @@ var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
65
65
  exports.findHandlerByTrigger = findHandlerByTrigger;
66
66
  var moveSelectedIndex = function moveSelectedIndex(_ref2) {
67
67
  var editorView = _ref2.editorView,
68
- direction = _ref2.direction;
68
+ direction = _ref2.direction,
69
+ useBetterTypeaheadNavigation = _ref2.useBetterTypeaheadNavigation;
69
70
  return function () {
70
71
  var typeAheadState = getPluginState(editorView.state);
71
72
  if (!typeAheadState) {
@@ -77,7 +78,26 @@ var moveSelectedIndex = function moveSelectedIndex(_ref2) {
77
78
  var nextIndex;
78
79
  if (direction === 'next') {
79
80
  stats.increaseArrowDown();
80
- nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
81
+ if (useBetterTypeaheadNavigation) {
82
+ /**
83
+ * See: https://product-fabric.atlassian.net/browse/ED-17200
84
+ * `selectedIndex` is forced to -1 now to not immediately focus the typeahead
85
+ * and only do so when there is explicit logic to focus into the typeahead
86
+ * options.
87
+ *
88
+ * This check for "set index to 1 when -1"
89
+ * - is a temporary workaround to get back the previous behaviour without
90
+ * entirely reverting the a11y improvements
91
+ *
92
+ */
93
+ if (selectedIndex === -1 && items.length > 1) {
94
+ nextIndex = 1;
95
+ } else {
96
+ nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
97
+ }
98
+ } else {
99
+ nextIndex = selectedIndex >= items.length - 1 ? 0 : selectedIndex + 1;
100
+ }
81
101
  } else {
82
102
  stats.increaseArrowUp();
83
103
  nextIndex = selectedIndex <= 0 ? items.length - 1 : selectedIndex - 1;
@@ -104,7 +104,9 @@ var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
104
104
  return function (pluginFactoryParams) {
105
105
  var editorPlugins = [];
106
106
  var preset = inputPreset.has(_base.default) ? inputPreset : inputPreset.add(_base.default);
107
- editorPlugins = preset.build();
107
+ editorPlugins = preset.build({
108
+ pluginInjectionAPI: pluginFactoryParams.pluginInjectionAPI
109
+ });
108
110
  var editorConfig = lightProcessPluginsList(editorPlugins);
109
111
  var schema = (0, _createSchema.createSchema)(editorConfig);
110
112
  var plugins = editorConfig.plugins.sort((0, _sortByOrder.sortByOrder)('plugins')).map(function (_ref) {
@@ -57,14 +57,16 @@ var EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
57
57
  eventDispatcher: props.eventDispatcher,
58
58
  inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
59
59
  inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
60
- isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
60
+ isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
61
+ featureFlags: props.featureFlags || {}
61
62
  }), (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.findReplace && (_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar ? (0, _react2.jsx)(_FindReplaceToolbarButtonWithState.default, {
62
63
  popupsBoundariesElement: props.popupsBoundariesElement,
63
64
  popupsMountPoint: props.popupsMountPoint,
64
65
  popupsScrollableElement: props.popupsScrollableElement,
65
66
  editorView: props.editorView,
66
67
  containerElement: props.containerElement,
67
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
68
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
69
+ featureFlags: props.featureFlags
68
70
  }) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
69
71
  (0, _react.useEffect)(function () {
70
72
  var _props$featureFlags7;
@@ -27,7 +27,7 @@ var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
27
27
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
28
28
  var buttonGroupStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n align-items: center;\n\n & > div {\n display: flex;\n }\n"])));
29
29
  exports.buttonGroupStyle = buttonGroupStyle;
30
- var separatorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), "var(--ds-border, ".concat(_colors.N30, ")"));
30
+ var separatorStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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(_colors.N30, ")"));
31
31
  exports.separatorStyles = separatorStyles;
32
32
  var wrapperStyle = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\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"])));
33
33
  exports.wrapperStyle = wrapperStyle;
@@ -13,8 +13,6 @@ var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
13
13
  var _analytics = require("../plugins/analytics");
14
14
  var _analytics2 = require("@atlaskit/editor-common/analytics");
15
15
  var _prosemirrorHistory = require("prosemirror-history");
16
- var _prosemirrorUtils = require("prosemirror-utils");
17
- var _featureFlagsContext = require("../plugins/feature-flags-context");
18
16
  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
17
  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; }
20
18
  var ruleWithAnalytics = function ruleWithAnalytics(getPayload) {
@@ -109,21 +107,6 @@ var createWrappingJoinRule = function createWrappingJoinRule(_ref3) {
109
107
  tr.setNodeMarkup(parentNodePosMapped, parentNode.type, parentNode.attrs, allowedMarks);
110
108
  }
111
109
  tr.wrap(range, wrapping);
112
- var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(state);
113
- if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && nodeType === state.schema.nodes.orderedList) {
114
- // if an orderedList node would be inserted by the input rule match, and
115
- // that orderedList node is being added directly before another orderedList
116
- // node, then join those nodes
117
- var $end = tr.doc.resolve(tr.mapping.map(end));
118
- var _node = (0, _prosemirrorUtils.findParentNodeOfTypeClosestToPos)($end, nodeType);
119
- if (_node) {
120
- var nodeEnd = _node.pos + _node.node.nodeSize;
121
- var after = tr.doc.resolve(nodeEnd).nodeAfter;
122
- if (after && after.type === nodeType && (0, _prosemirrorTransform.canJoin)(tr.doc, nodeEnd) && (!joinPredicate || joinPredicate(match, after, _analytics2.JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_BELOW))) {
123
- tr.join(nodeEnd);
124
- }
125
- }
126
- }
127
110
  var before = tr.doc.resolve(fixedStart - 1).nodeBefore;
128
111
  if (before && before.type === nodeType && (0, _prosemirrorTransform.canJoin)(tr.doc, fixedStart - 1) && (!joinPredicate || joinPredicate(match, before, _analytics2.JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST.JOINED_TO_LIST_ABOVE))) {
129
112
  tr.join(fixedStart - 1);
@@ -11,6 +11,7 @@ var _prosemirrorTransform = require("prosemirror-transform");
11
11
  var _document = require("./document");
12
12
  var _gapCursorSelection = require("../plugins/selection/gap-cursor-selection");
13
13
  var _selection = require("./selection");
14
+ var _node = require("../plugins/list/utils/node");
14
15
  var LookDirection;
15
16
  exports.LookDirection = LookDirection;
16
17
  (function (LookDirection) {
@@ -27,6 +28,18 @@ var nodeIsInsideAList = function nodeIsInsideAList(tr) {
27
28
  var nodes = tr.doc.type.schema.nodes;
28
29
  return (0, _prosemirrorUtils.hasParentNodeOfType)([nodes.orderedList, nodes.bulletList])(tr.selection);
29
30
  };
31
+ var selectionIsInsideAPanel = function selectionIsInsideAPanel(tr) {
32
+ var nodes = tr.doc.type.schema.nodes;
33
+ return (0, _prosemirrorUtils.hasParentNodeOfType)(nodes.panel)(tr.selection);
34
+ };
35
+ var selectionIsInNestedList = function selectionIsInNestedList(tr) {
36
+ var nodes = tr.doc.type.schema.nodes;
37
+ var parentListNode = (0, _prosemirrorUtils.findParentNodeOfType)([nodes.orderedList, nodes.bulletList])(tr.selection);
38
+ if (!parentListNode) {
39
+ return false;
40
+ }
41
+ return (0, _node.isListItemNode)(tr.doc.resolve(parentListNode.pos).parent);
42
+ };
30
43
  var insertBeforeOrAfter = function insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content) {
31
44
  /**
32
45
  * This block caters for the first item in a parent with the cursor being at the very start
@@ -54,9 +67,7 @@ var safeInsert = function safeInsert(content, position) {
54
67
  var _tr$selection$$from$n;
55
68
  var nodes = tr.doc.type.schema.nodes;
56
69
  var whitelist = [nodes.rule, nodes.mediaSingle];
57
-
58
- // fallback if the node to insert is not in the whitelist, or if the insertion should happen within a list.
59
- if (content instanceof _prosemirrorModel.Fragment || !whitelist.includes(content.type) || nodeIsInsideAList(tr)) {
70
+ if (content instanceof _prosemirrorModel.Fragment || !whitelist.includes(content.type)) {
60
71
  return null;
61
72
  }
62
73
 
@@ -88,14 +99,28 @@ var safeInsert = function safeInsert(content, position) {
88
99
  }
89
100
  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;
90
101
  var parentNodeType = tr.selection.$from.parent.type;
91
- if (!lookDirection && !shouldSplitSelectedNodeOnNodeInsertion({
102
+
103
+ // if there is no direction, and cannot split for this particular node
104
+ var noDirectionAndShouldNotSplit = !lookDirection && !shouldSplitSelectedNodeOnNodeInsertion({
92
105
  parentNodeType: parentNodeType,
93
106
  grandParentNodeType: grandParentNodeType,
94
107
  content: content
95
- })) {
108
+ });
109
+ var ruleNodeInANestedListNode = content.type === nodes.rule && selectionIsInNestedList(tr);
110
+ var nonRuleNodeInListNode = !(content.type === nodes.rule) && nodeIsInsideAList(tr);
111
+ if (ruleNodeInANestedListNode || noDirectionAndShouldNotSplit && nonRuleNodeInListNode || noDirectionAndShouldNotSplit && !nodeIsInsideAList(tr)) {
96
112
  // node to be inserted is an invalid child of selection so insert below selected node
97
113
  return (0, _prosemirrorUtils.safeInsert)(content, tr.selection.from)(tr);
98
114
  }
115
+
116
+ // if node is a rule and that is a flat list splitting and not at the end of a list
117
+ var _tr$selection = tr.selection,
118
+ from = _tr$selection.from,
119
+ to = _tr$selection.to;
120
+ var ruleTypeInAList = content.type === nodes.rule && nodeIsInsideAList(tr);
121
+ if (ruleTypeInAList && !($insertPos.pos === insertPosEnd)) {
122
+ return tr.replaceRange(from, to, new _prosemirrorModel.Slice(_prosemirrorModel.Fragment.from(nodes.rule.createChecked()), 0, 0));
123
+ }
99
124
  if (!lookDirection) {
100
125
  // fallback to consumer for now
101
126
  return null;
@@ -117,7 +142,14 @@ var safeInsert = function safeInsert(content, position) {
117
142
 
118
143
  // If we can't insert, and we think we should split, we fallback to consumer for now
119
144
  if (shouldSplit(parentNode.type, tr.doc.type.schema.nodes)) {
120
- return finaliseInsert(insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content), content.nodeSize);
145
+ var nextTr = finaliseInsert(insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content), content.nodeSize);
146
+
147
+ // Move selection to the closest text node, otherwise it defaults to the whatever the lookDirection is set to above
148
+ if ([nodes.orderedList, nodes.bulletList].includes(parentNode.type) && nextTr) {
149
+ return nextTr.setSelection(_prosemirrorState.TextSelection.between(nextTr.selection.$from, nextTr.selection.$from));
150
+ } else {
151
+ return nextTr;
152
+ }
121
153
  }
122
154
 
123
155
  // Can not insert into current parent, step up one parent
@@ -165,7 +197,21 @@ var insertSelectedItem = function insertSelectedItem(maybeNode) {
165
197
  *
166
198
  */
167
199
  } else if (node.isBlock) {
168
- tr = (0, _prosemirrorUtils.safeInsert)((0, _selection.normaliseNestedLayout)(state, node), undefined, true)(tr);
200
+ /**
201
+ *
202
+ * Rule has unique insertion behaviour
203
+ * so using this safeInsert function in order to handle specific cases in flat list vs nested list
204
+ * instead of a generic pmSafeInsert (i.e appending at the end)
205
+ *
206
+ */
207
+
208
+ var selectionInsideAPanel = selectionIsInsideAPanel(tr);
209
+ if (node.type.name === 'rule' && !selectionInsideAPanel) {
210
+ var _safeInsert;
211
+ tr = (_safeInsert = safeInsert(node, tr.selection.from)(tr)) !== null && _safeInsert !== void 0 ? _safeInsert : tr;
212
+ } else {
213
+ tr = (0, _prosemirrorUtils.safeInsert)((0, _selection.normaliseNestedLayout)(state, node), undefined, true)(tr);
214
+ }
169
215
 
170
216
  /**
171
217
  *
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "181.0.0";
9
+ var version = "182.0.0";
10
10
  exports.version = version;
11
11
  var nextMajorVersion = function nextMajorVersion() {
12
12
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
@@ -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
  }
@@ -29,17 +29,22 @@ export function getScrollGutterOptions(props) {
29
29
  return undefined;
30
30
  }
31
31
  export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
32
- var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
32
+ var _props$performanceTra, _props$linking, _ref, _props$featureFlags$u, _props$featureFlags, _props$featureFlags2, _props$performanceTra2, _props$textFormatting, _props$linking2;
33
33
  const appearance = props.appearance;
34
34
  const isMobile = appearance === 'mobile';
35
35
  const inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
36
36
  const cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
37
+
38
+ // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
39
+ const pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
40
+ const useBetterTypeaheadNavigation = Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true);
37
41
  return {
38
42
  ...props,
39
43
  createAnalyticsEvent,
40
44
  typeAhead: {
41
45
  createAnalyticsEvent,
42
- isMobile
46
+ isMobile,
47
+ useBetterTypeaheadNavigation: useBetterTypeaheadNavigation
43
48
  },
44
49
  featureFlags: createFeatureFlagsFromProps(props),
45
50
  paste: {
@@ -21,9 +21,12 @@ function getSpellCheck(featureFlags) {
21
21
  * which is used by both current and archv3 editors.
22
22
  */
23
23
  export function createFeatureFlagsFromProps(props) {
24
- var _props$featureFlags, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$collabEdit, _props$collabEdit2, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45;
24
+ var _props$featureFlags, _ref, _props$featureFlags$u, _props$featureFlags2, _props$featureFlags3, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags4, _props$featureFlags5, _props$allowTables, _props$featureFlags6, _props$featureFlags7, _props$allowTables2, _props$featureFlags8, _props$featureFlags9, _props$allowTables3, _props$featureFlags10, _props$featureFlags11, _props$allowTables4, _props$allowTables5, _props$featureFlags12, _props$featureFlags13, _props$allowTables6, _props$allowExtension, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$collabEdit, _props$collabEdit2, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42, _props$featureFlags43, _props$featureFlags44, _props$featureFlags45, _props$featureFlags46, _props$featureFlags47;
25
25
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
26
26
  const tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
27
+
28
+ // duplicated logic from `feature-flags-from-props.ts` due to presets not being finalised
29
+ const pseudoNormalisedUseBetterTypeaheadNavigation = (_ref = (_props$featureFlags$u = (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2['use-better-typeahead-navigation']) !== null && _props$featureFlags$u !== void 0 ? _props$featureFlags$u : (_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.useBetterTypeaheadNavigation) !== null && _ref !== void 0 ? _ref : null;
27
30
  return {
28
31
  ...normalizedFeatureFlags,
29
32
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
@@ -35,37 +38,39 @@ export function createFeatureFlagsFromProps(props) {
35
38
  singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
36
39
  undoRedoButtons: props.allowUndoRedoButtons,
37
40
  catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
38
- stickyHeadersOptimization: typeof ((_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.stickyHeadersOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
39
- initialRenderOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.initialRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
40
- mouseMoveOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.mouseMoveOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
41
- tableRenderOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.tableRenderOptimization) : typeof props.allowTables === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
42
- tableOverflowShadowsOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableOverflowShadowsOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
41
+ stickyHeadersOptimization: typeof ((_props$featureFlags4 = props.featureFlags) === null || _props$featureFlags4 === void 0 ? void 0 : _props$featureFlags4.stickyHeadersOptimization) === 'boolean' ? !!((_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.stickyHeadersOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables = props.allowTables) !== null && _props$allowTables !== void 0 && _props$allowTables.stickyHeadersOptimization),
42
+ initialRenderOptimization: typeof ((_props$featureFlags6 = props.featureFlags) === null || _props$featureFlags6 === void 0 ? void 0 : _props$featureFlags6.initialRenderOptimization) === 'boolean' ? !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.initialRenderOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables2 = props.allowTables) !== null && _props$allowTables2 !== void 0 && _props$allowTables2.initialRenderOptimization),
43
+ mouseMoveOptimization: typeof ((_props$featureFlags8 = props.featureFlags) === null || _props$featureFlags8 === void 0 ? void 0 : _props$featureFlags8.mouseMoveOptimization) === 'boolean' ? !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.mouseMoveOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables3 = props.allowTables) !== null && _props$allowTables3 !== void 0 && _props$allowTables3.mouseMoveOptimization),
44
+ tableRenderOptimization: typeof ((_props$featureFlags10 = props.featureFlags) === null || _props$featureFlags10 === void 0 ? void 0 : _props$featureFlags10.tableRenderOptimization) === 'boolean' ? !!((_props$featureFlags11 = props.featureFlags) !== null && _props$featureFlags11 !== void 0 && _props$featureFlags11.tableRenderOptimization) : typeof props.allowTables === 'object' && typeof ((_props$allowTables4 = props.allowTables) === null || _props$allowTables4 === void 0 ? void 0 : _props$allowTables4.tableRenderOptimization) === 'boolean' ? (_props$allowTables5 = props.allowTables) === null || _props$allowTables5 === void 0 ? void 0 : _props$allowTables5.tableRenderOptimization : true,
45
+ tableOverflowShadowsOptimization: typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.tableOverflowShadowsOptimization) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.tableOverflowShadowsOptimization) : typeof props.allowTables === 'object' && !!((_props$allowTables6 = props.allowTables) !== null && _props$allowTables6 !== void 0 && _props$allowTables6.tableOverflowShadowsOptimization),
43
46
  extendFloatingToolbar: Boolean(typeof props.allowExtension === 'object' && ((_props$allowExtension = props.allowExtension) === null || _props$allowExtension === void 0 ? void 0 : _props$allowExtension.allowExtendFloatingToolbars)),
44
- showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags12 = props.featureFlags) === null || _props$featureFlags12 === void 0 ? void 0 : _props$featureFlags12.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags13 = props.featureFlags) !== null && _props$featureFlags13 !== void 0 && _props$featureFlags13.showAvatarGroupAsPlugin) : false),
45
- errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useErrorBoundaryDocStructure) : false),
46
- synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.synchronyErrorDocStructure) : false),
47
- enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.enableViewUpdateSubscription) : false),
48
- collabAvatarScroll: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.collabAvatarScroll) : false),
49
- ufo: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.ufo) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.ufo) : false),
50
- twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.twoLineEditorToolbar) : false),
51
- saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
52
- saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactionsAnalyticsOnly) : false)),
47
+ showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.showAvatarGroupAsPlugin) : false),
48
+ errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.useErrorBoundaryDocStructure) : false),
49
+ synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.synchronyErrorDocStructure) : false),
50
+ enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.enableViewUpdateSubscription) : false),
51
+ collabAvatarScroll: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.collabAvatarScroll) : false),
52
+ ufo: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.ufo) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.ufo) : false),
53
+ twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.twoLineEditorToolbar) : false),
54
+ saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactions) : false)),
55
+ saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.saferDispatchedTransactionsAnalyticsOnly) : false)),
53
56
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
54
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
57
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
55
58
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
56
- showHoverPreview: Boolean(typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.showHoverPreview) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.showHoverPreview) : false),
57
- indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.indentationButtonsInTheToolbar) : false)),
58
- floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.floatingToolbarCopyButton) : false)),
59
- floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
59
+ showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
60
+ indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
61
+ floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
62
+ floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
60
63
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
61
64
  // Including fallback to props.featureFlags so that mobile feature flags
62
65
  // are included (they are not kebab cased)
63
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedLists) === true,
64
- listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.listNumberContinuity) === true,
65
- restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedListsToolbar) === true,
66
- useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42.useSomewhatSemanticTextColorNames) : false)),
66
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.restartNumberedLists) === true,
67
+ listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41.listNumberContinuity) === true,
68
+ restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags42 = props.featureFlags) === null || _props$featureFlags42 === void 0 ? void 0 : _props$featureFlags42.restartNumberedListsToolbar) === true,
69
+ useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44.useSomewhatSemanticTextColorNames) : false)),
67
70
  lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
68
- preventPopupOverflow: Boolean(typeof ((_props$featureFlags43 = props.featureFlags) === null || _props$featureFlags43 === void 0 ? void 0 : _props$featureFlags43['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags44 = props.featureFlags) !== null && _props$featureFlags44 !== void 0 && _props$featureFlags44['prevent-popup-overflow']) : false),
69
- useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45.useEditorNext) === true
71
+ preventPopupOverflow: Boolean(typeof ((_props$featureFlags45 = props.featureFlags) === null || _props$featureFlags45 === void 0 ? void 0 : _props$featureFlags45['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags46 = props.featureFlags) !== null && _props$featureFlags46 !== void 0 && _props$featureFlags46['prevent-popup-overflow']) : false),
72
+ useEditorNext: normalizedFeatureFlags.useEditorNext === true || ((_props$featureFlags47 = props.featureFlags) === null || _props$featureFlags47 === void 0 ? void 0 : _props$featureFlags47.useEditorNext) === true,
73
+ // duplicated logic from `create-plugins-list.ts` due to presets not being finalised
74
+ useBetterTypeaheadNavigation: Boolean(typeof pseudoNormalisedUseBetterTypeaheadNavigation === 'boolean' ? !!pseudoNormalisedUseBetterTypeaheadNavigation : true)
70
75
  };
71
76
  }
@@ -3,4 +3,15 @@ export function sortByOrder(item) {
3
3
  return function (a, b) {
4
4
  return Ranks[item].indexOf(a.name) - Ranks[item].indexOf(b.name);
5
5
  };
6
+ }
7
+
8
+ // while functionally the same, in order to avoid potentially rewriting the ~10
9
+ // existing implementations of the above function I decided creating a separate
10
+ // function avoided that whole mess. If someone can think of a better way to implement
11
+ // the above and below into a single function please do so
12
+
13
+ export function sortByOrderWithTypeName(item) {
14
+ return function (a, b) {
15
+ return Ranks[item].indexOf(a.type.name) - Ranks[item].indexOf(b.type.name);
16
+ };
6
17
  }
@@ -1,8 +1,10 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import React from 'react';
3
4
  import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
4
5
  import Editor from '../editor';
5
6
  import EditorNext from './index';
7
+ import { defaultProps } from './utils/editorPropTypes';
6
8
  import useUniversalPreset from '../labs/next/presets/useUniversalPreset';
7
9
  const EditorNextWrapper = ({
8
10
  props
@@ -24,4 +26,5 @@ export default class EditorMigrationComponent extends React.Component {
24
26
  props: this.props
25
27
  });
26
28
  }
27
- }
29
+ }
30
+ _defineProperty(EditorMigrationComponent, "defaultProps", defaultProps);
@@ -1,6 +1,5 @@
1
1
  import { nextMajorVersion } from '../../version-wrapper';
2
2
  export default function deprecationWarnings(props) {
3
- var _props$allowTextColor;
4
3
  if (process.env.NODE_ENV === 'production') {
5
4
  return;
6
5
  }
@@ -32,8 +31,4 @@ export default function deprecationWarnings(props) {
32
31
  // eslint-disable-next-line no-console
33
32
  console.warn(`Advanced table options are deprecated (except isHeaderRowRequired) to continue using advanced table features use - <Editor allowTables={{ advanced: true }} /> [Will be changed in editor-core@${nextVersion}]`);
34
33
  }
35
- if (props.hasOwnProperty('allowTextColor') && typeof props.allowTextColor !== 'boolean' && (props === null || props === void 0 ? void 0 : (_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) !== undefined) {
36
- // eslint-disable-next-line no-console
37
- console.warn(`"allowMoreTextColors" field of "allowTextColor" property is deprecated. It will be removedin editor-core@${nextVersion}. The color palette now shows more colors by default.`);
38
- }
39
34
  }
@@ -166,7 +166,8 @@ function FullPage(props) {
166
166
  editorView: config.editorView,
167
167
  eventDispatcher: config.eventDispatcher,
168
168
  inviteToEditHandler: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.inviteToEditHandler,
169
- isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected
169
+ isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected,
170
+ featureFlags: {}
170
171
  }), primaryToolbarComponents)), jsx("div", {
171
172
  css: contentArea
172
173
  }, jsx(ContentStyles, {
@@ -13,6 +13,7 @@ import typeAheadPlugin from '../../../plugins/type-ahead';
13
13
  import submitEditorPlugin from '../../../plugins/submit-editor';
14
14
  import fakeTextCursorPlugin from '../../../plugins/fake-text-cursor';
15
15
  import featureFlagsContextPlugin from '../../../plugins/feature-flags-context';
16
+ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
16
17
  import floatingToolbarPlugin from '../../../plugins/floating-toolbar';
17
18
  import clipboardPlugin from '../../../plugins/clipboard';
18
19
  import placeholderPlugin from '../../../plugins/placeholder';
@@ -29,7 +30,7 @@ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
29
30
  * their placement in the editor toolbar
30
31
  */
31
32
  export function createDefaultPreset(options) {
32
- const preset = new EditorPresetBuilder().add([pastePlugin, options.paste]).add(clipboardPlugin).add([basePlugin, options.base]).maybeAdd(undoRedoPlugin, (p, builder) => {
33
+ const preset = new EditorPresetBuilder().add([featureFlagsPlugin, options.featureFlags || {}]).add([pastePlugin, options.paste]).add(clipboardPlugin).add([basePlugin, options.base]).maybeAdd(undoRedoPlugin, (p, builder) => {
33
34
  var _options$featureFlags;
34
35
  // The undo redo plugin needs to be add before the blockTypePlugin
35
36
  if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {