@atlaskit/editor-core 176.0.2 → 177.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 (450) hide show
  1. package/.eslintrc.js +2 -2
  2. package/CHANGELOG.md +114 -0
  3. package/codemods/{173.0.0-rename-unsafe-allowUndoRedoButton-prop.ts → 175.0.0-rename-unsafe-allowUndoRedoButton-prop.ts} +0 -0
  4. package/dist/cjs/create-editor/ReactEditorView.js +3 -1
  5. package/dist/cjs/create-editor/create-plugins-list.js +9 -6
  6. package/dist/cjs/create-editor/messages.js +17 -0
  7. package/dist/cjs/i18n/en.js +2 -2
  8. package/dist/cjs/i18n/en_GB.js +2 -2
  9. package/dist/cjs/i18n/en_ZZ.js +2 -2
  10. package/dist/cjs/i18n/index.js +4 -4
  11. package/dist/cjs/i18n/languages.js +9 -4
  12. package/dist/cjs/labs/next/presets/mobile.js +2 -2
  13. package/dist/cjs/labs/next/presets/preset.js +38 -6
  14. package/dist/cjs/plugins/annotation/nodeviews/index.js +1 -0
  15. package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +6 -1
  16. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -1
  17. package/dist/cjs/plugins/card/pm-plugins/doc.js +18 -29
  18. package/dist/cjs/plugins/card/pm-plugins/main.js +7 -21
  19. package/dist/cjs/plugins/card/toolbar.js +24 -8
  20. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +9 -5
  21. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +19 -53
  22. package/dist/cjs/plugins/card/utils.js +17 -3
  23. package/dist/cjs/plugins/collab-edit/actions.js +3 -3
  24. package/dist/cjs/plugins/copy-button/toolbar.js +5 -3
  25. package/dist/cjs/plugins/date/index.js +1 -7
  26. package/dist/cjs/plugins/date/ui/DatePicker/index.js +1 -2
  27. package/dist/cjs/plugins/emoji/index.js +7 -14
  28. package/dist/cjs/plugins/expand/pm-plugins/main.js +4 -1
  29. package/dist/cjs/plugins/expand/toolbar.js +1 -0
  30. package/dist/cjs/plugins/extension/commands.js +17 -2
  31. package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -0
  32. package/dist/cjs/plugins/extension/toolbar.js +49 -7
  33. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
  34. package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -2
  35. package/dist/cjs/plugins/floating-toolbar/index.js +16 -4
  36. package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +99 -0
  37. package/dist/cjs/plugins/floating-toolbar/ui/ConfirmationModal.js +10 -30
  38. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +16 -4
  39. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +108 -55
  40. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -2
  41. package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
  42. package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +51 -0
  43. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +27 -47
  44. package/dist/cjs/plugins/floating-toolbar/ui/messages.js +13 -3
  45. package/dist/cjs/plugins/floating-toolbar/utils.js +4 -19
  46. package/dist/cjs/plugins/help-dialog/index.js +3 -2
  47. package/dist/cjs/plugins/hyperlink/Toolbar.js +20 -1
  48. package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
  49. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
  50. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
  51. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
  52. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
  53. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
  54. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
  55. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +26 -12
  56. package/dist/cjs/plugins/layout/toolbar.js +1 -0
  57. package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +34 -4
  58. package/dist/cjs/plugins/list/commands/outdent-list.js +1 -1
  59. package/dist/cjs/plugins/list/index.js +6 -2
  60. package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
  61. package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +5 -2
  62. package/dist/cjs/plugins/list/pm-plugins/main.js +32 -10
  63. package/dist/cjs/plugins/media/index.js +35 -0
  64. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +7 -6
  65. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -1
  66. package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
  67. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +3 -1
  68. package/dist/cjs/plugins/media/pm-plugins/main.js +6 -0
  69. package/dist/cjs/plugins/media/toolbar/index.js +3 -0
  70. package/dist/cjs/plugins/media/utils/media-single.js +19 -3
  71. package/dist/cjs/plugins/panel/toolbar.js +1 -0
  72. package/dist/cjs/plugins/panel/utils.js +1 -1
  73. package/dist/cjs/plugins/paste/index.js +2 -1
  74. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +19 -3
  75. package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -1
  76. package/dist/cjs/plugins/paste/util/index.js +2 -2
  77. package/dist/cjs/plugins/placeholder/index.js +24 -47
  78. package/dist/cjs/plugins/placeholder/styles.js +2 -4
  79. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +7 -3
  80. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
  81. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +10 -5
  82. package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +5 -1
  83. package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
  84. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -6
  85. package/dist/cjs/plugins/type-ahead/index.js +2 -8
  86. package/dist/cjs/plugins/type-ahead/messages.js +44 -4
  87. package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +0 -1
  88. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +17 -1
  89. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +9 -4
  90. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
  91. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
  92. package/dist/cjs/plugins/type-ahead/utils.js +44 -2
  93. package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -2
  94. package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -1
  95. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
  96. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
  97. package/dist/cjs/ui/CollapsedEditor/index.js +4 -2
  98. package/dist/cjs/ui/ColorPickerButton/index.js +2 -1
  99. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -4
  100. package/dist/cjs/ui/ConfigPanel/FormContent.js +2 -1
  101. package/dist/cjs/ui/ContentStyles/index.js +1 -1
  102. package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +3 -1
  103. package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +55 -33
  104. package/dist/cjs/utils/commands.js +25 -13
  105. package/dist/cjs/utils/input-rules.js +26 -2
  106. package/dist/cjs/version-wrapper.js +1 -1
  107. package/dist/cjs/version.json +1 -1
  108. package/dist/es2019/create-editor/ReactEditorView.js +2 -1
  109. package/dist/es2019/create-editor/create-plugins-list.js +9 -6
  110. package/dist/es2019/create-editor/messages.js +8 -0
  111. package/dist/es2019/i18n/en.js +2 -2
  112. package/dist/es2019/i18n/en_GB.js +2 -2
  113. package/dist/es2019/i18n/en_ZZ.js +2 -2
  114. package/dist/es2019/i18n/index.js +4 -4
  115. package/dist/es2019/i18n/languages.js +9 -4
  116. package/dist/es2019/labs/next/presets/mobile.js +2 -2
  117. package/dist/es2019/labs/next/presets/preset.js +28 -7
  118. package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -0
  119. package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
  120. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +4 -1
  121. package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -19
  122. package/dist/es2019/plugins/card/pm-plugins/main.js +4 -19
  123. package/dist/es2019/plugins/card/toolbar.js +19 -2
  124. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +8 -6
  125. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -36
  126. package/dist/es2019/plugins/card/utils.js +15 -2
  127. package/dist/es2019/plugins/collab-edit/actions.js +3 -3
  128. package/dist/es2019/plugins/copy-button/toolbar.js +5 -3
  129. package/dist/es2019/plugins/date/index.js +0 -7
  130. package/dist/es2019/plugins/date/ui/DatePicker/index.js +1 -2
  131. package/dist/es2019/plugins/emoji/index.js +7 -13
  132. package/dist/es2019/plugins/expand/pm-plugins/main.js +3 -3
  133. package/dist/es2019/plugins/expand/toolbar.js +1 -0
  134. package/dist/es2019/plugins/extension/commands.js +10 -1
  135. package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -0
  136. package/dist/es2019/plugins/extension/toolbar.js +43 -8
  137. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
  138. package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
  139. package/dist/es2019/plugins/floating-toolbar/index.js +15 -5
  140. package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +70 -0
  141. package/dist/es2019/plugins/floating-toolbar/ui/ConfirmationModal.js +8 -27
  142. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +17 -4
  143. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +96 -50
  144. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
  145. package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +29 -76
  146. package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +32 -0
  147. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +26 -46
  148. package/dist/es2019/plugins/floating-toolbar/ui/messages.js +14 -4
  149. package/dist/es2019/plugins/floating-toolbar/utils.js +4 -17
  150. package/dist/es2019/plugins/help-dialog/index.js +2 -2
  151. package/dist/es2019/plugins/hyperlink/Toolbar.js +18 -2
  152. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -2
  153. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -9
  154. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
  155. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
  156. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
  157. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
  158. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
  159. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
  160. package/dist/es2019/plugins/layout/toolbar.js +1 -0
  161. package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +24 -4
  162. package/dist/es2019/plugins/list/commands/outdent-list.js +1 -1
  163. package/dist/es2019/plugins/list/index.js +7 -3
  164. package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
  165. package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +5 -2
  166. package/dist/es2019/plugins/list/pm-plugins/main.js +31 -11
  167. package/dist/es2019/plugins/media/index.js +38 -0
  168. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +6 -5
  169. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +3 -1
  170. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
  171. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +3 -1
  172. package/dist/es2019/plugins/media/pm-plugins/main.js +7 -0
  173. package/dist/es2019/plugins/media/toolbar/index.js +3 -0
  174. package/dist/es2019/plugins/media/utils/media-single.js +20 -3
  175. package/dist/es2019/plugins/panel/toolbar.js +1 -0
  176. package/dist/es2019/plugins/panel/utils.js +1 -1
  177. package/dist/es2019/plugins/paste/index.js +2 -1
  178. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +15 -2
  179. package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
  180. package/dist/es2019/plugins/paste/util/index.js +2 -2
  181. package/dist/es2019/plugins/placeholder/index.js +21 -47
  182. package/dist/es2019/plugins/placeholder/styles.js +1 -19
  183. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
  184. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
  185. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +8 -7
  186. package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
  187. package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +18 -12
  188. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
  189. package/dist/es2019/plugins/type-ahead/index.js +2 -2
  190. package/dist/es2019/plugins/type-ahead/messages.js +44 -4
  191. package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -1
  192. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +17 -1
  193. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +10 -5
  194. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
  195. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
  196. package/dist/es2019/plugins/type-ahead/utils.js +38 -0
  197. package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
  198. package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
  199. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -2
  200. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
  201. package/dist/es2019/ui/CollapsedEditor/index.js +3 -2
  202. package/dist/es2019/ui/ColorPickerButton/index.js +2 -1
  203. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +4 -5
  204. package/dist/es2019/ui/ConfigPanel/FormContent.js +3 -3
  205. package/dist/es2019/ui/ContentStyles/index.js +7 -2
  206. package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -0
  207. package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
  208. package/dist/es2019/utils/commands.js +26 -14
  209. package/dist/es2019/utils/input-rules.js +22 -1
  210. package/dist/es2019/version-wrapper.js +1 -1
  211. package/dist/es2019/version.json +1 -1
  212. package/dist/esm/create-editor/ReactEditorView.js +2 -1
  213. package/dist/esm/create-editor/create-plugins-list.js +9 -6
  214. package/dist/esm/create-editor/messages.js +8 -0
  215. package/dist/esm/i18n/en.js +2 -2
  216. package/dist/esm/i18n/en_GB.js +2 -2
  217. package/dist/esm/i18n/en_ZZ.js +2 -2
  218. package/dist/esm/i18n/index.js +4 -4
  219. package/dist/esm/i18n/languages.js +9 -4
  220. package/dist/esm/labs/next/presets/mobile.js +2 -2
  221. package/dist/esm/labs/next/presets/preset.js +36 -6
  222. package/dist/esm/plugins/annotation/nodeviews/index.js +1 -0
  223. package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
  224. package/dist/esm/plugins/breakout/ui/LayoutButton.js +4 -1
  225. package/dist/esm/plugins/card/pm-plugins/doc.js +10 -20
  226. package/dist/esm/plugins/card/pm-plugins/main.js +4 -17
  227. package/dist/esm/plugins/card/toolbar.js +24 -8
  228. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +8 -6
  229. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +9 -39
  230. package/dist/esm/plugins/card/utils.js +15 -2
  231. package/dist/esm/plugins/collab-edit/actions.js +3 -3
  232. package/dist/esm/plugins/copy-button/toolbar.js +5 -3
  233. package/dist/esm/plugins/date/index.js +1 -6
  234. package/dist/esm/plugins/date/ui/DatePicker/index.js +1 -2
  235. package/dist/esm/plugins/emoji/index.js +7 -13
  236. package/dist/esm/plugins/expand/pm-plugins/main.js +3 -3
  237. package/dist/esm/plugins/expand/toolbar.js +1 -0
  238. package/dist/esm/plugins/extension/commands.js +12 -1
  239. package/dist/esm/plugins/extension/pm-plugins/main.js +10 -0
  240. package/dist/esm/plugins/extension/toolbar.js +50 -8
  241. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
  242. package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
  243. package/dist/esm/plugins/floating-toolbar/index.js +16 -4
  244. package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +75 -0
  245. package/dist/esm/plugins/floating-toolbar/ui/ConfirmationModal.js +11 -25
  246. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +17 -4
  247. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +100 -47
  248. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
  249. package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
  250. package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +30 -0
  251. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +27 -47
  252. package/dist/esm/plugins/floating-toolbar/ui/messages.js +13 -3
  253. package/dist/esm/plugins/floating-toolbar/utils.js +4 -17
  254. package/dist/esm/plugins/help-dialog/index.js +3 -2
  255. package/dist/esm/plugins/hyperlink/Toolbar.js +20 -2
  256. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -3
  257. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
  258. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
  259. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
  260. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
  261. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
  262. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
  263. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
  264. package/dist/esm/plugins/layout/toolbar.js +1 -0
  265. package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +30 -4
  266. package/dist/esm/plugins/list/commands/outdent-list.js +1 -1
  267. package/dist/esm/plugins/list/index.js +7 -3
  268. package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
  269. package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +5 -2
  270. package/dist/esm/plugins/list/pm-plugins/main.js +31 -11
  271. package/dist/esm/plugins/media/index.js +33 -0
  272. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +7 -6
  273. package/dist/esm/plugins/media/nodeviews/mediaInline.js +3 -1
  274. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
  275. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +3 -1
  276. package/dist/esm/plugins/media/pm-plugins/main.js +7 -0
  277. package/dist/esm/plugins/media/toolbar/index.js +3 -0
  278. package/dist/esm/plugins/media/utils/media-single.js +18 -3
  279. package/dist/esm/plugins/panel/toolbar.js +1 -0
  280. package/dist/esm/plugins/panel/utils.js +1 -1
  281. package/dist/esm/plugins/paste/index.js +2 -1
  282. package/dist/esm/plugins/paste/pm-plugins/analytics.js +15 -2
  283. package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
  284. package/dist/esm/plugins/paste/util/index.js +2 -2
  285. package/dist/esm/plugins/placeholder/index.js +23 -45
  286. package/dist/esm/plugins/placeholder/styles.js +1 -2
  287. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
  288. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
  289. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +9 -5
  290. package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
  291. package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
  292. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
  293. package/dist/esm/plugins/type-ahead/index.js +2 -2
  294. package/dist/esm/plugins/type-ahead/messages.js +44 -4
  295. package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -1
  296. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +17 -1
  297. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +10 -5
  298. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
  299. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
  300. package/dist/esm/plugins/type-ahead/utils.js +38 -0
  301. package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
  302. package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
  303. package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -2
  304. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
  305. package/dist/esm/ui/CollapsedEditor/index.js +3 -2
  306. package/dist/esm/ui/ColorPickerButton/index.js +2 -1
  307. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +4 -5
  308. package/dist/esm/ui/ConfigPanel/FormContent.js +3 -3
  309. package/dist/esm/ui/ContentStyles/index.js +1 -1
  310. package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -0
  311. package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
  312. package/dist/esm/utils/commands.js +25 -13
  313. package/dist/esm/utils/input-rules.js +23 -1
  314. package/dist/esm/version-wrapper.js +1 -1
  315. package/dist/esm/version.json +1 -1
  316. package/dist/types/create-editor/messages.d.ts +7 -0
  317. package/dist/types/i18n/index.d.ts +4 -4
  318. package/dist/types/i18n/languages.d.ts +8 -3
  319. package/dist/types/labs/next/presets/cxhtml.d.ts +1 -1
  320. package/dist/types/labs/next/presets/default.d.ts +2 -2
  321. package/dist/types/labs/next/presets/mobile.d.ts +1 -1
  322. package/dist/types/labs/next/presets/preset.d.ts +10 -6
  323. package/dist/types/plugins/alignment/index.d.ts +2 -2
  324. package/dist/types/plugins/analytics/plugin.d.ts +2 -2
  325. package/dist/types/plugins/annotation/index.d.ts +2 -2
  326. package/dist/types/plugins/avatar-group/index.d.ts +4 -3
  327. package/dist/types/plugins/base/index.d.ts +2 -2
  328. package/dist/types/plugins/before-primaryToolbar/index.d.ts +4 -3
  329. package/dist/types/plugins/block-type/index.d.ts +2 -2
  330. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -1
  331. package/dist/types/plugins/breakout/index.d.ts +2 -2
  332. package/dist/types/plugins/caption/index.d.ts +2 -2
  333. package/dist/types/plugins/card/index.d.ts +2 -2
  334. package/dist/types/plugins/card/pm-plugins/doc.d.ts +4 -4
  335. package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
  336. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
  337. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +5 -5
  338. package/dist/types/plugins/card/utils.d.ts +2 -1
  339. package/dist/types/plugins/clear-marks-on-change-to-empty-document/index.d.ts +2 -2
  340. package/dist/types/plugins/clipboard/index.d.ts +2 -2
  341. package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -3
  342. package/dist/types/plugins/code-block/index.d.ts +2 -2
  343. package/dist/types/plugins/collab-edit/actions.d.ts +1 -1
  344. package/dist/types/plugins/collab-edit/index.d.ts +2 -2
  345. package/dist/types/plugins/context-panel/index.d.ts +2 -2
  346. package/dist/types/plugins/copy-button/index.d.ts +2 -2
  347. package/dist/types/plugins/custom-autoformat/index.d.ts +2 -2
  348. package/dist/types/plugins/data-consumer/index.d.ts +2 -2
  349. package/dist/types/plugins/date/index.d.ts +2 -2
  350. package/dist/types/plugins/date/ui/DatePicker/index.d.ts +0 -1
  351. package/dist/types/plugins/editor-disabled/index.d.ts +2 -2
  352. package/dist/types/plugins/emoji/index.d.ts +2 -2
  353. package/dist/types/plugins/emoji/types.d.ts +2 -1
  354. package/dist/types/plugins/expand/index.d.ts +2 -2
  355. package/dist/types/plugins/expand/pm-plugins/main.d.ts +1 -0
  356. package/dist/types/plugins/extension/commands.d.ts +2 -0
  357. package/dist/types/plugins/extension/index.d.ts +2 -2
  358. package/dist/types/plugins/extension/toolbar.d.ts +10 -0
  359. package/dist/types/plugins/fake-text-cursor/index.d.ts +2 -2
  360. package/dist/types/plugins/feature-flags-context/index.d.ts +2 -2
  361. package/dist/types/plugins/feedback-dialog/index.d.ts +3 -2
  362. package/dist/types/plugins/find-replace/index.d.ts +4 -3
  363. package/dist/types/plugins/floating-toolbar/index.d.ts +2 -2
  364. package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +4 -0
  365. package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +1 -8
  366. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +3 -0
  367. package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +4 -0
  368. package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +4 -0
  369. package/dist/types/plugins/floating-toolbar/ui/messages.d.ts +10 -0
  370. package/dist/types/plugins/floating-toolbar/ui/types.d.ts +1 -1
  371. package/dist/types/plugins/floating-toolbar/utils.d.ts +2 -3
  372. package/dist/types/plugins/fragment/index.d.ts +2 -2
  373. package/dist/types/plugins/grid/index.d.ts +2 -2
  374. package/dist/types/plugins/help-dialog/index.d.ts +2 -3
  375. package/dist/types/plugins/history/index.d.ts +2 -2
  376. package/dist/types/plugins/hyperlink/index.d.ts +2 -2
  377. package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -2
  378. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
  379. package/dist/types/plugins/image-upload/index.d.ts +2 -2
  380. package/dist/types/plugins/indentation/index.d.ts +2 -2
  381. package/dist/types/plugins/insert-block/index.d.ts +2 -2
  382. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
  383. package/dist/types/plugins/jira-issue/index.d.ts +2 -2
  384. package/dist/types/plugins/layout/index.d.ts +2 -2
  385. package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -2
  386. package/dist/types/plugins/list/index.d.ts +3 -2
  387. package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +3 -1
  388. package/dist/types/plugins/list/pm-plugins/main.d.ts +2 -2
  389. package/dist/types/plugins/list/types.d.ts +2 -0
  390. package/dist/types/plugins/macro/index.d.ts +2 -2
  391. package/dist/types/plugins/max-content-size/index.d.ts +2 -2
  392. package/dist/types/plugins/media/index.d.ts +2 -2
  393. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -1
  394. package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
  395. package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
  396. package/dist/types/plugins/mentions/index.d.ts +2 -2
  397. package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -2
  398. package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +2 -2
  399. package/dist/types/plugins/panel/index.d.ts +2 -2
  400. package/dist/types/plugins/paste/index.d.ts +3 -2
  401. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
  402. package/dist/types/plugins/placeholder/index.d.ts +4 -4
  403. package/dist/types/plugins/placeholder/styles.d.ts +0 -1
  404. package/dist/types/plugins/placeholder-text/index.d.ts +2 -2
  405. package/dist/types/plugins/quick-insert/index.d.ts +2 -2
  406. package/dist/types/plugins/rule/index.d.ts +2 -2
  407. package/dist/types/plugins/save-on-enter/index.d.ts +3 -2
  408. package/dist/types/plugins/scroll-into-view/index.d.ts +2 -2
  409. package/dist/types/plugins/selection/index.d.ts +2 -2
  410. package/dist/types/plugins/status/index.d.ts +2 -2
  411. package/dist/types/plugins/submit-editor/index.d.ts +4 -2
  412. package/dist/types/plugins/tasks-and-decisions/index.d.ts +2 -2
  413. package/dist/types/plugins/text-color/index.d.ts +3 -2
  414. package/dist/types/plugins/text-formatting/index.d.ts +2 -2
  415. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +4 -3
  416. package/dist/types/plugins/type-ahead/index.d.ts +2 -2
  417. package/dist/types/plugins/type-ahead/messages.d.ts +41 -1
  418. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +3 -1
  419. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +1 -0
  420. package/dist/types/plugins/type-ahead/utils.d.ts +7 -1
  421. package/dist/types/plugins/undo-redo/index.d.ts +2 -2
  422. package/dist/types/plugins/unsupported-content/index.d.ts +2 -2
  423. package/dist/types/plugins/view-update-subscription/index.d.ts +2 -2
  424. package/dist/types/plugins/width/index.d.ts +2 -2
  425. package/dist/types/test-utils.d.ts +2 -1
  426. package/dist/types/types/editor-plugin.d.ts +1 -1
  427. package/dist/types/types/editor-props.d.ts +0 -2
  428. package/dist/types/types/index.d.ts +1 -1
  429. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
  430. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  431. package/dist/types/ui/ConfigPanel/Fields/Fieldset.d.ts +2 -1
  432. package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -23
  433. package/dist/types/ui/ConfigPanel/types.d.ts +22 -0
  434. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  435. package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +1 -0
  436. package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +4 -1
  437. package/package.json +24 -24
  438. package/report.api.md +25 -16
  439. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +0 -181
  440. package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -66
  441. package/dist/cjs/plugins/emoji/ui/EmojiContextProvider/index.js +0 -61
  442. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +0 -151
  443. package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
  444. package/dist/es2019/plugins/emoji/ui/EmojiContextProvider/index.js +0 -21
  445. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +0 -161
  446. package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
  447. package/dist/esm/plugins/emoji/ui/EmojiContextProvider/index.js +0 -46
  448. package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +0 -25
  449. package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +0 -5
  450. package/dist/types/plugins/emoji/ui/EmojiContextProvider/index.d.ts +0 -13
@@ -142,12 +142,27 @@ var applyMarkOnRange = function applyMarkOnRange(from, to, removeMark, mark, tr)
142
142
 
143
143
  exports.applyMarkOnRange = applyMarkOnRange;
144
144
 
145
+ var entireSelectionContainsMark = function entireSelectionContainsMark(mark, doc, fromPos, toPos) {
146
+ var onlyContainsMark = true;
147
+ doc.nodesBetween(fromPos, toPos, function (node) {
148
+ // Skip recursion once we've found text which doesn't include the mark
149
+ if (!onlyContainsMark) {
150
+ return false;
151
+ }
152
+
153
+ if (node.isText) {
154
+ onlyContainsMark && (onlyContainsMark = mark.isInSet(node.marks));
155
+ }
156
+ });
157
+ return onlyContainsMark;
158
+ };
159
+
145
160
  var toggleMarkInRange = function toggleMarkInRange(mark) {
146
161
  return function (state, dispatch) {
147
162
  var tr = state.tr;
148
163
 
149
164
  if (state.selection instanceof _cellSelection.CellSelection) {
150
- var markInRange = false;
165
+ var removeMark = true;
151
166
  var cells = [];
152
167
  state.selection.forEachCell(function (cell, cellPos) {
153
168
  cells.push({
@@ -156,30 +171,27 @@ var toggleMarkInRange = function toggleMarkInRange(mark) {
156
171
  });
157
172
  var from = cellPos;
158
173
  var to = cellPos + cell.nodeSize;
159
-
160
- if (!markInRange) {
161
- markInRange = state.doc.rangeHasMark(from, to, mark);
162
- }
174
+ removeMark && (removeMark = entireSelectionContainsMark(mark, state.doc, from, to));
163
175
  });
164
176
 
165
177
  for (var i = cells.length - 1; i >= 0; i--) {
166
178
  var cell = cells[i];
167
179
  var from = cell.pos;
168
180
  var to = from + cell.node.nodeSize;
169
- applyMarkOnRange(from, to, markInRange, mark, tr);
181
+ applyMarkOnRange(from, to, removeMark, mark, tr);
170
182
  }
171
183
  } else {
172
184
  var _state$selection3 = state.selection,
173
185
  $from = _state$selection3.$from,
174
- $to = _state$selection3.$to; // The type for `rangeHasMark` only accepts a `MarkType` as a third param,
175
- // Yet the internals use a method that exists on both MarkType and Mark (one checks attributes the other doesnt)
176
- // For example, with our subsup mark: We use the same mark with different attributes to convert
177
- // different formatting but when using `MarkType.isInSet(marks)` it returns true for both.
178
- // Calling `Mark.isInSet(marks)` compares attributes as well.
186
+ $to = _state$selection3.$to; // We decide to remove the mark only if the entire selection contains the mark
187
+ // Examples with *bold* text
188
+ // Scenario 1: Selection contains both bold and non-bold text -> bold entire selection
189
+ // Scenario 2: Selection contains only bold text -> un-bold entire selection
190
+ // Scenario 3: Selection contains no bold text -> bold entire selection
179
191
 
180
- var _markInRange = state.doc.rangeHasMark($from.pos, $to.pos, mark);
192
+ var _removeMark = entireSelectionContainsMark(mark, state.doc, $from.pos, $to.pos);
181
193
 
182
- applyMarkOnRange($from.pos, $to.pos, _markInRange, mark, tr);
194
+ applyMarkOnRange($from.pos, $to.pos, _removeMark, mark, tr);
183
195
  }
184
196
 
185
197
  if (tr.docChanged) {
@@ -9,8 +9,6 @@ exports.ruleWithTransform = exports.ruleWithAnalytics = exports.createWrappingTe
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
- var _prosemirrorHistory = require("prosemirror-history");
13
-
14
12
  var _prosemirrorState = require("prosemirror-state");
15
13
 
16
14
  var _prosemirrorTransform = require("prosemirror-transform");
@@ -21,6 +19,12 @@ var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
21
19
 
22
20
  var _analytics = require("../plugins/analytics");
23
21
 
22
+ var _prosemirrorHistory = require("prosemirror-history");
23
+
24
+ var _prosemirrorUtils = require("prosemirror-utils");
25
+
26
+ var _featureFlagsContext = require("../plugins/feature-flags-context");
27
+
24
28
  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; }
25
29
 
26
30
  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; }
@@ -158,6 +162,26 @@ var createWrappingJoinRule = function createWrappingJoinRule(_ref3) {
158
162
  }
159
163
 
160
164
  tr.wrap(range, wrapping);
165
+ var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(state);
166
+
167
+ if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && nodeType === state.schema.nodes.orderedList) {
168
+ // if an orderedList node would be inserted by the input rule match, and
169
+ // that orderedList node is being added directly before another orderedList
170
+ // node, then join those nodes
171
+ var $end = tr.doc.resolve(tr.mapping.map(end));
172
+
173
+ var _node = (0, _prosemirrorUtils.findParentNodeOfTypeClosestToPos)($end, nodeType);
174
+
175
+ if (_node) {
176
+ var nodeEnd = _node.pos + _node.node.nodeSize;
177
+ var after = tr.doc.resolve(nodeEnd).nodeAfter;
178
+
179
+ if (after && after.type === nodeType && (0, _prosemirrorTransform.canJoin)(tr.doc, nodeEnd) && (!joinPredicate || joinPredicate(match, after))) {
180
+ tr.join(nodeEnd);
181
+ }
182
+ }
183
+ }
184
+
161
185
  var before = tr.doc.resolve(fixedStart - 1).nodeBefore;
162
186
 
163
187
  if (before && before.type === nodeType && (0, _prosemirrorTransform.canJoin)(tr.doc, fixedStart - 1) && (!joinPredicate || joinPredicate(match, before))) {
@@ -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 = "176.0.2";
9
+ var version = "177.0.0";
10
10
  exports.version = version;
11
11
 
12
12
  var nextMajorVersion = function nextMajorVersion() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "176.0.2",
3
+ "version": "177.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
4
4
  import { EditorState, Selection } from 'prosemirror-state';
5
5
  import { EditorView } from 'prosemirror-view';
6
6
  import { injectIntl } from 'react-intl-next';
7
+ import { editorMessages } from './messages';
7
8
  import { browser, getAnalyticsEventSeverity, getResponseEndTime, measureRender, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common/utils';
8
9
  import { ExperienceStore, EditorExperience, RELIABILITY_INTERVAL } from '@atlaskit/editor-common/ufo';
9
10
  import { createDispatch, EventDispatcher } from '../event-dispatcher';
@@ -586,7 +587,7 @@ export class ReactEditorView extends React.Component {
586
587
  className: getUAPrefix(),
587
588
  key: "ProseMirror",
588
589
  ref: this.handleEditorViewRef,
589
- "aria-label": "Main content area",
590
+ "aria-label": this.props.intl.formatMessage(editorMessages.editorAssistiveLabel),
590
591
  role: "textbox"
591
592
  }));
592
593
 
@@ -69,7 +69,6 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
69
69
  },
70
70
  placeholder: {
71
71
  placeholder: props.placeholder,
72
- placeholderHints: props.placeholderHints,
73
72
  placeholderBracketHint: props.placeholderBracketHint
74
73
  },
75
74
  textFormatting: { ...(props.textFormatting || {}),
@@ -146,7 +145,11 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
146
145
  } // Needs to be after allowTextColor as order of buttons in toolbar depends on it
147
146
 
148
147
 
149
- preset.add(listPlugin);
148
+ preset.add([listPlugin, {
149
+ restartNumberedLists: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.restartNumberedLists,
150
+ restartNumberedListsToolbar: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.restartNumberedListsToolbar,
151
+ listNumberContinuity: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.listNumberContinuity
152
+ }]);
150
153
 
151
154
  if (props.allowRule) {
152
155
  preset.add(rulePlugin);
@@ -233,10 +236,10 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
233
236
  }
234
237
 
235
238
  if (props.allowHelpDialog) {
236
- preset.add([helpDialogPlugin, props.legacyImageUploadProvider]);
239
+ preset.add([helpDialogPlugin, !!props.legacyImageUploadProvider]);
237
240
  }
238
241
 
239
- if (props.saveOnEnter) {
242
+ if (props.saveOnEnter && props.onSave) {
240
243
  preset.add([saveOnEnterPlugin, props.onSave]);
241
244
  }
242
245
 
@@ -306,7 +309,7 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
306
309
 
307
310
 
308
311
  if (!props.annotationProviders && props.allowConfluenceInlineComment) {
309
- preset.add(annotationPlugin);
312
+ preset.add([annotationPlugin, undefined]);
310
313
  }
311
314
 
312
315
  if (props.allowDate) {
@@ -423,7 +426,7 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
423
426
  }
424
427
 
425
428
  if (featureFlags.enableViewUpdateSubscription) {
426
- preset.add([viewUpdateSubscriptionPlugin]);
429
+ preset.add(viewUpdateSubscriptionPlugin);
427
430
  }
428
431
 
429
432
  preset.add([codeBidiWarningPlugin, {
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const editorMessages = defineMessages({
3
+ editorAssistiveLabel: {
4
+ id: 'fabric.editor.editorAssistiveLabel',
5
+ defaultMessage: 'Main content area, start typing to enter text.',
6
+ description: 'Text that is read out by screen reader when the main editor is in focus'
7
+ }
8
+ });
@@ -100,8 +100,8 @@ export default {
100
100
  'fabric.editor.error': 'Error',
101
101
  'fabric.editor.errorPanel': 'Error panel',
102
102
  'fabric.editor.errorPanel.description': 'Call out errors in a colored panel',
103
- 'fabric.editor.extension.confirmDeleteLinkedModalMessage': 'Removing this extension will break anything connected to it.',
104
- 'fabric.editor.extension.confirmDeleteLinkedModalOKButton': 'Remove extension',
103
+ 'fabric.editor.extension.confirmDeleteLinkedModalMessage': 'Deleting {nodeName} will break anything connected to it.',
104
+ 'fabric.editor.extension.confirmDeleteLinkedModalOKButton': 'Delete',
105
105
  'fabric.editor.extensions.config-panel.save-indicator': 'All changes are always autosaved',
106
106
  'fabric.editor.find': 'Find',
107
107
  'fabric.editor.findNext': 'Find next',
@@ -100,8 +100,8 @@ export default {
100
100
  'fabric.editor.error': 'Error',
101
101
  'fabric.editor.errorPanel': 'Error panel',
102
102
  'fabric.editor.errorPanel.description': 'Call out errors in a coloured panel',
103
- 'fabric.editor.extension.confirmDeleteLinkedModalMessage': 'Removing this extension will break anything connected to it.',
104
- 'fabric.editor.extension.confirmDeleteLinkedModalOKButton': 'Remove extension',
103
+ 'fabric.editor.extension.confirmDeleteLinkedModalMessage': 'Deleting {nodeName} will break anything connected to it.',
104
+ 'fabric.editor.extension.confirmDeleteLinkedModalOKButton': 'Delete',
105
105
  'fabric.editor.extensions.config-panel.save-indicator': 'All changes are always autosaved',
106
106
  'fabric.editor.find': 'Find',
107
107
  'fabric.editor.findNext': 'Find next',
@@ -100,8 +100,8 @@ export default {
100
100
  'fabric.editor.error': '⁣⁢Error؜‌⁡‌؜⁡‌⁣⁤',
101
101
  'fabric.editor.errorPanel': '⁣⁢Error panel⁠‍؜⁠⁠؜‍⁠⁠⁡⁣⁤',
102
102
  'fabric.editor.errorPanel.description': '⁣⁢Call out errors in a colored panel⁡⁠؜⁡‍‌‍؜‍⁣⁤',
103
- 'fabric.editor.extension.confirmDeleteLinkedModalMessage': '⁣⁢Removing this extension will break anything connected to it.⁠؜⁡‌‌‍‌⁡⁠⁡⁡⁡⁡⁣⁤',
104
- 'fabric.editor.extension.confirmDeleteLinkedModalOKButton': '⁣⁢Remove extension⁡‍‌‍⁠‌‍‍⁠⁠⁣⁤',
103
+ 'fabric.editor.extension.confirmDeleteLinkedModalMessage': 'Deleting {nodeName} will break anything connected to it.⁠؜⁡‌‌‍‌⁡⁠⁡⁡⁡⁡⁣⁤',
104
+ 'fabric.editor.extension.confirmDeleteLinkedModalOKButton': '⁣Delete⁡⁤',
105
105
  'fabric.editor.extensions.config-panel.save-indicator': '⁣⁢All changes are always autosaved⁠‍؜‌‌‍‍⁡‌‌‍‌‌⁣⁤',
106
106
  'fabric.editor.find': '⁣⁢Find⁠‌⁠‌⁠‍؜⁣⁤',
107
107
  'fabric.editor.findNext': '⁣⁢Find next؜‌؜‌؜⁠⁣⁤',
@@ -1,13 +1,15 @@
1
1
  /**
2
2
  * NOTE:
3
3
  *
4
- * This file is automatically generated by i18n-tools.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
4
+ * ED-16073:
5
+ * This was manually updated since the original `@atlaskit/i18n-tools` has been deprecated
6
6
  */
7
7
  export { default as zh } from './zh';
8
8
  export { default as zh_TW } from './zh_TW';
9
9
  export { default as cs } from './cs';
10
10
  export { default as da } from './da';
11
+ export { default as en } from './en';
12
+ export { default as en_GB } from './en_GB';
11
13
  export { default as nl } from './nl';
12
14
  export { default as et } from './et';
13
15
  export { default as fi } from './fi';
@@ -29,7 +31,5 @@ export { default as th } from './th';
29
31
  export { default as tr } from './tr';
30
32
  export { default as uk } from './uk';
31
33
  export { default as vi } from './vi';
32
- export { default as en } from './en';
33
- export { default as en_GB } from './en_GB';
34
34
  export { default as is } from './is';
35
35
  export { default as ro } from './ro';
@@ -1,14 +1,15 @@
1
1
  /**
2
2
  * NOTE:
3
3
  *
4
- * This file is automatically generated by i18n-tools.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
4
+ * ED-16073:
5
+ * This was manually updated since the original `@atlaskit/i18n-tools` has been deprecated
6
6
  */
7
7
  export default {
8
8
  zh: 'Chinese',
9
+ zh_TW: 'Chinese (Traditional)',
9
10
  cs: 'Czech',
10
- da: 'Danish',
11
11
  nl: 'Dutch',
12
+ da: 'Danish',
12
13
  en: 'English',
13
14
  en_GB: 'English (United Kingdom)',
14
15
  et: 'Estonian',
@@ -28,5 +29,9 @@ export default {
28
29
  ru: 'Russian',
29
30
  sk: 'Slovak',
30
31
  es: 'Spanish',
31
- sv: 'Swedish'
32
+ sv: 'Swedish',
33
+ th: 'Thai',
34
+ tr: 'Turkish',
35
+ uk: 'Ukrainian',
36
+ vi: 'Vietnamese'
32
37
  };
@@ -79,8 +79,8 @@ export function useMobilePreset({
79
79
  allowBlockCards: true,
80
80
  platform: 'mobile'
81
81
  }]);
82
- preset.add([mentionsPlugin]);
83
- preset.add([emojiPlugin]); // End
82
+ preset.add(mentionsPlugin);
83
+ preset.add(emojiPlugin); // End
84
84
 
85
85
  if (maxContentSize) {
86
86
  preset.add([maxContentSizePlugin, maxContentSize]);
@@ -1,15 +1,31 @@
1
1
  export class Preset {
2
- constructor() {
3
- this.plugins = [];
2
+ constructor(...more) {
3
+ this.data = [...more] || [];
4
4
  }
5
5
 
6
- add(plugin) {
7
- this.plugins.push(plugin);
8
- return this;
6
+ add(nextOrTuple) {
7
+ const newPreset = new Preset(nextOrTuple, ...this.data); // TODO: remove this `this.data.push`,
8
+ // once refactoring `create-plugins-list` to address this complexity:
9
+
10
+ /**
11
+ * preset.add(x)
12
+ * preset.add(y)
13
+ * preset.add(z)
14
+ */
15
+ // to:
16
+
17
+ /**
18
+ * immutablePreset = preset.add(x).add(foo).add(bar)
19
+ * presetWithY = presetWithY.add(y)
20
+ * presetWithZ = preset.add(z)
21
+ */
22
+
23
+ this.data.push(nextOrTuple);
24
+ return newPreset;
9
25
  }
10
26
 
11
27
  has(plugin) {
12
- return this.plugins.some(pluginPreset => {
28
+ return this.data.some(pluginPreset => {
13
29
  if (Array.isArray(pluginPreset)) {
14
30
  return pluginPreset[0] === plugin;
15
31
  }
@@ -25,7 +41,7 @@ export class Preset {
25
41
 
26
42
  processEditorPlugins() {
27
43
  const cache = new Map();
28
- this.plugins.forEach(pluginEntry => {
44
+ this.data.forEach(pluginEntry => {
29
45
  if (Array.isArray(pluginEntry)) {
30
46
  const [fn, options] = pluginEntry;
31
47
  cache.set(fn, options);
@@ -49,6 +65,11 @@ export class Preset {
49
65
  cache.forEach((options, fn) => {
50
66
  plugins.push(fn(options));
51
67
  });
68
+
69
+ if (plugins.some(plugin => typeof plugin === 'function')) {
70
+ throw new Error("!!! NextEditorPluginWithDependencies detected in presets. That's an unsupported runtime use case right now.");
71
+ }
72
+
52
73
  return plugins;
53
74
  }
54
75
 
@@ -19,6 +19,7 @@ export class AnnotationNodeView extends ReactNodeView {
19
19
  /*#__PURE__*/
20
20
  // all inline comment states are now set in decorations at ../pm-plugins/inline-comment.ts
21
21
  React.createElement("span", {
22
+ "data-mark-type": "annotation",
22
23
  ref: forwardRef
23
24
  })
24
25
  );
@@ -11,6 +11,7 @@ import { NORMAL_TEXT } from '../../types';
11
11
  import { blockTypeMenuItemStyle, keyboardShortcut, keyboardShortcutSelect } from './styled';
12
12
  import { tooltip, findKeymapByDescription } from '../../../../keymaps';
13
13
  import { BlockTypeButton } from './blocktype-button';
14
+ import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
14
15
 
15
16
  class ToolbarBlockType extends React.PureComponent {
16
17
  constructor(...args) {
@@ -46,16 +47,19 @@ class ToolbarBlockType extends React.PureComponent {
46
47
  const isActive = currentBlockType === blockType;
47
48
  const tagName = blockType.tagName || 'p';
48
49
  const Tag = tagName;
50
+ const keyMap = findKeymapByDescription(blockType.title.defaultMessage);
49
51
  return {
50
52
  content: jsx("div", {
51
53
  css: blockTypeMenuItemStyle(tagName, isActive)
52
54
  }, jsx(Tag, null, formatMessage(blockType.title))),
53
55
  value: blockType,
54
56
  label: formatMessage(blockType.title),
57
+ 'aria-label': tooltip(keyMap, formatMessage(blockType.title)),
58
+ keyShortcuts: getAriaKeyshortcuts(keyMap),
55
59
  key: `${blockType.name}-${index}`,
56
60
  elemAfter: jsx("div", {
57
61
  css: [keyboardShortcut, isActive && keyboardShortcutSelect]
58
- }, tooltip(findKeymapByDescription(blockType.title.defaultMessage))),
62
+ }, tooltip(keyMap)),
59
63
  isActive
60
64
  };
61
65
  });
@@ -20,6 +20,7 @@ import { getPluginState } from '../plugin-key';
20
20
  import { NodeSelection } from 'prosemirror-state';
21
21
  import { isSupportedNodeForBreakout } from '../utils/is-supported-node';
22
22
  import { token } from '@atlaskit/tokens';
23
+ import { layers } from '@atlaskit/theme/constants';
23
24
  const toolbarButtonWrapper = css`
24
25
  && button {
25
26
  background: ${token('color.background.neutral', N20A)};
@@ -108,6 +109,7 @@ class LayoutButton extends React.Component {
108
109
  const titleMessage = getTitle(breakoutMode);
109
110
  const title = formatMessage(titleMessage);
110
111
  const nextBreakoutMode = getNextBreakoutMode(breakoutMode);
112
+ const belowOtherPopupsZIndex = layers.layer() - 1;
111
113
  let pluginState = getPluginState(state);
112
114
  let element = getBreakoutNodeElement(pluginState, state.selection, editorView);
113
115
 
@@ -131,7 +133,8 @@ class LayoutButton extends React.Component {
131
133
  boundariesElement: boundariesElement,
132
134
  scrollableElement: scrollableElement,
133
135
  stick: true,
134
- forcePlacement: true
136
+ forcePlacement: true,
137
+ zIndex: belowOtherPopupsZIndex
135
138
  }, jsx("div", {
136
139
  css: toolbarButtonWrapper
137
140
  }, jsx(ToolbarButton, {
@@ -1,17 +1,16 @@
1
- import { NodeSelection } from 'prosemirror-state';
2
1
  import { closeHistory } from 'prosemirror-history';
3
- import { pluginKey } from './plugin-key';
4
- import { queueCards, resolveCard } from './actions';
5
- import { appearanceForNodeType } from '../utils';
6
- import { nodesBetweenChanged, processRawValue } from '../../../utils';
7
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../../../plugins/analytics';
2
+ import { NodeSelection } from 'prosemirror-state';
8
3
  import { isSafeUrl } from '@atlaskit/adf-schema';
9
- import { isFromCurrentDomain } from '../../hyperlink/utils';
10
- import { shouldReplaceLink } from './shouldReplaceLink';
4
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../../../plugins/analytics';
11
5
  import { SMART_LINK_TYPE } from '../../../plugins/analytics/types/node-events';
12
6
  import { getLinkCreationAnalyticsEvent } from '../../../plugins/hyperlink/analytics';
7
+ import { nodesBetweenChanged, processRawValue } from '../../../utils';
13
8
  import { unlinkPayload } from '../../../utils/linking-utils';
14
- import { getFeatureFlags } from '../../feature-flags-context';
9
+ import { isFromCurrentDomain } from '../../hyperlink/utils';
10
+ import { appearanceForNodeType } from '../utils';
11
+ import { queueCards, resolveCard } from './actions';
12
+ import { pluginKey } from './plugin-key';
13
+ import { shouldReplaceLink } from './shouldReplaceLink';
15
14
  /**
16
15
  * Attempt to replace the link into the respective card.
17
16
  */
@@ -198,17 +197,13 @@ export const changeSelectedCardToLink = (text, href, sendAnalytics, node, pos) =
198
197
 
199
198
  if (sendAnalytics) {
200
199
  if (selectedNode) {
201
- const {
202
- viewChangingExperimentToolbarStyle
203
- } = getFeatureFlags(state);
204
200
  addAnalytics(state, tr, {
205
201
  action: ACTION.CHANGED_TYPE,
206
202
  actionSubject: ACTION_SUBJECT.SMART_LINK,
207
203
  eventType: EVENT_TYPE.TRACK,
208
204
  attributes: {
209
205
  newType: SMART_LINK_TYPE.URL,
210
- previousType: appearanceForNodeType(selectedNode.type),
211
- featureFlag: viewChangingExperimentToolbarStyle || 'noChange'
206
+ previousType: appearanceForNodeType(selectedNode.type)
212
207
  }
213
208
  });
214
209
  }
@@ -333,17 +328,13 @@ export const setSelectedCardAppearance = appearance => (state, dispatch) => {
333
328
  } = state.selection;
334
329
  const nodeType = getLinkNodeType(appearance, state.schema.nodes);
335
330
  const tr = state.tr.setNodeMarkup(from, nodeType, attrs, selectedNode.marks);
336
- const {
337
- viewChangingExperimentToolbarStyle
338
- } = getFeatureFlags(state);
339
331
  addAnalytics(state, tr, {
340
332
  action: ACTION.CHANGED_TYPE,
341
333
  actionSubject: ACTION_SUBJECT.SMART_LINK,
342
334
  eventType: EVENT_TYPE.TRACK,
343
335
  attributes: {
344
336
  newType: appearance,
345
- previousType: appearanceForNodeType(selectedNode.type),
346
- featureFlag: viewChangingExperimentToolbarStyle || 'noChange'
337
+ previousType: appearanceForNodeType(selectedNode.type)
347
338
  }
348
339
  });
349
340
 
@@ -1,14 +1,13 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import rafSchedule from 'raf-schd';
3
3
  import { getInlineNodeViewProducer } from '../../../nodeviews/getInlineNodeViewProducer';
4
- import reducer from './reducers';
4
+ import { BlockCard } from '../nodeviews/blockCard';
5
+ import { EmbedCard } from '../nodeviews/embedCard';
6
+ import { InlineCardNodeView } from '../nodeviews/inlineCard';
5
7
  import { pluginKey } from './plugin-key';
8
+ import reducer from './reducers';
6
9
  import { handleProvider, resolveWithProvider } from './util/resolve';
7
10
  import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './util/state';
8
- import { EmbedCard } from '../nodeviews/embedCard';
9
- import { BlockCard } from '../nodeviews/blockCard';
10
- import { InlineCardNodeView } from '../nodeviews/inlineCard';
11
- import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../../plugins/analytics';
12
11
  export { pluginKey } from './plugin-key';
13
12
  export const createPlugin = options => pmPluginFactoryParams => {
14
13
  const {
@@ -21,20 +20,6 @@ export const createPlugin = options => pmPluginFactoryParams => {
21
20
  return new SafePlugin({
22
21
  state: {
23
22
  init() {
24
- const {
25
- viewChangingExperimentToolbarStyle
26
- } = pmPluginFactoryParams.featureFlags;
27
- pmPluginFactoryParams.dispatchAnalyticsEvent({
28
- eventType: EVENT_TYPE.OPERATIONAL,
29
- action: ACTION.EXPOSED,
30
- actionSubject: ACTION_SUBJECT.FEATURE,
31
- attributes: {
32
- flagKey: 'confluence.frontend.fabric.editor.view-changing-experiment-toolbar-style',
33
- value: viewChangingExperimentToolbarStyle || 'noChange'
34
- },
35
- source: '@atlaskit/feature-flag-client',
36
- tags: ['measurement']
37
- });
38
23
  return {
39
24
  requests: [],
40
25
  provider: null,
@@ -83,6 +83,8 @@ export const openLinkSettings = (state, dispatch) => {
83
83
  };
84
84
  export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
85
85
  return (state, intl, providerFactory) => {
86
+ var _linkPickerOptions$pl;
87
+
86
88
  const {
87
89
  inlineCard,
88
90
  blockCard,
@@ -109,10 +111,22 @@ export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
109
111
  } : {}; // Applies padding override for when link picker is currently displayed
110
112
 
111
113
  const className = pluginState.showLinkingToolbar ? FLOATING_TOOLBAR_LINKPICKER_CLASSNAME : undefined;
114
+ /**
115
+ * Enable focus trap only if feature flag is enabled AND for the new version of the picker
116
+ */
117
+
118
+ const {
119
+ lpLinkPicker,
120
+ lpLinkPickerFocusTrap,
121
+ preventPopupOverflow
122
+ } = getFeatureFlags(state);
123
+ const shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
124
+ const isLinkPickerEnabled = !!lpLinkPicker && !!(linkPickerOptions !== null && linkPickerOptions !== void 0 && (_linkPickerOptions$pl = linkPickerOptions.plugins) !== null && _linkPickerOptions$pl !== void 0 && _linkPickerOptions$pl.length);
112
125
  return {
113
126
  title: intl.formatMessage(messages.card),
114
127
  className,
115
128
  nodeType,
129
+ preventPopupOverflow,
116
130
  ...toolbarOffset,
117
131
  getDomRef: view => {
118
132
  const element = findDomRefAtPos(view.state.selection.from, view.domAtPos.bind(view));
@@ -128,8 +142,9 @@ export const floatingToolbar = (cardOptions, platform, linkPickerOptions) => {
128
142
  return element;
129
143
  },
130
144
  items: generateToolbarItems(state, intl, providerFactory, cardOptions, platform, linkPickerOptions),
131
- ...(pluginState.showLinkingToolbar ? editLinkToolbarConfig : {}),
132
- scrollable: pluginState.showLinkingToolbar ? false : true
145
+ scrollable: pluginState.showLinkingToolbar ? false : true,
146
+ focusTrap: shouldEnableFocusTrap && pluginState.showLinkingToolbar,
147
+ ...editLinkToolbarConfig(pluginState.showLinkingToolbar, isLinkPickerEnabled)
133
148
  };
134
149
  };
135
150
  };
@@ -213,6 +228,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, platfor
213
228
  }]
214
229
  }, ...getSettingsButtonGroup(state, intl), {
215
230
  id: 'editor.link.delete',
231
+ focusEditoronEnter: true,
216
232
  type: 'button',
217
233
  appearance: 'danger',
218
234
  icon: RemoveIcon,
@@ -267,6 +283,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, platfor
267
283
  const getUnlinkButtonGroup = (state, intl, node, inlineCard) => {
268
284
  return node.type === inlineCard ? [{
269
285
  id: 'editor.link.unlink',
286
+ focusEditoronEnter: true,
270
287
  type: 'button',
271
288
  title: intl.formatMessage(linkToolbarMessages.unlink),
272
289
  icon: UnlinkIcon,
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import HyperlinkToolbar from '../../hyperlink/ui/HyperlinkAddToolbar';
3
3
  import { showLinkToolbar, hideLinkToolbar } from '../pm-plugins/actions';
4
4
  import { addAnalytics } from '../../analytics';
5
- import { RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '../../../ui/LinkSearch/ToolbarComponents';
5
+ import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '../../../ui/LinkSearch/ToolbarComponents';
6
6
  import { changeSelectedCardToLink, updateCard } from '../pm-plugins/doc';
7
7
  import { findCardInfo, displayInfoForCard } from '../utils';
8
8
  import { NodeSelection } from 'prosemirror-state';
@@ -72,8 +72,8 @@ export const buildEditLinkToolbar = ({
72
72
  }) => {
73
73
  return {
74
74
  type: 'custom',
75
- fallback: [],
76
75
  disableArrowNavigation: true,
76
+ fallback: [],
77
77
  render: (view, idx) => {
78
78
  if (!view || !providerFactory) {
79
79
  return null;
@@ -106,8 +106,10 @@ export const buildEditLinkToolbar = ({
106
106
  }
107
107
  };
108
108
  };
109
- export const editLinkToolbarConfig = {
110
- height: RECENT_SEARCH_HEIGHT_IN_PX,
111
- width: RECENT_SEARCH_WIDTH_IN_PX,
112
- forcePlacement: true
109
+ export const editLinkToolbarConfig = (showLinkingToolbar, linkPickerOptions) => {
110
+ return showLinkingToolbar ? {
111
+ height: linkPickerOptions ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX,
112
+ width: RECENT_SEARCH_WIDTH_IN_PX,
113
+ forcePlacement: true
114
+ } : {};
113
115
  };