@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
@@ -8,14 +8,54 @@ exports.typeAheadListMessages = void 0;
8
8
  var _reactIntlNext = require("react-intl-next");
9
9
 
10
10
  var typeAheadListMessages = (0, _reactIntlNext.defineMessages)({
11
- typeAheadResultLabel: {
12
- id: 'fabric.editor.typeAheadResultLabel',
13
- defaultMessage: 'TypeAhead results',
11
+ typeAheadPopupLabel: {
12
+ id: 'fabric.editor.typeAhead.popupLabel',
13
+ defaultMessage: 'Typeahead results',
14
14
  description: 'the result of a typeahead, similar to autocomplete results+'
15
15
  },
16
+ quickInsertPopupLabel: {
17
+ id: 'fabric.editor.typeAhead.quickInsertPopupLabel',
18
+ defaultMessage: 'Shortcuts for inserts and formatting',
19
+ description: 'the result of a quick insert typeahead, similar to autocomplete results+'
20
+ },
21
+ quickInsertInputLabel: {
22
+ id: 'fabric.editor.typeAhead.quickInsertInputLabel',
23
+ defaultMessage: 'Begin typing to search or filter shortcut options',
24
+ description: 'assisitve text for typeahed input field'
25
+ },
26
+ emojiPopupLabel: {
27
+ id: 'fabric.editor.typeahead.emojiPopupLabel',
28
+ defaultMessage: 'Emoji shortcuts',
29
+ description: 'the result of a emoji typeahead, similar to autocomplete results+'
30
+ },
31
+ emojiInputLabel: {
32
+ id: 'fabric.editor.typeahead.emojiInputLabel',
33
+ defaultMessage: 'Begin typing to search or filter emoji options',
34
+ description: 'assisitve text for typeahed input field'
35
+ },
36
+ mentionPopupLabel: {
37
+ id: 'fabric.editor.typeahead.mentionPopupLabel',
38
+ defaultMessage: 'Users you can tag',
39
+ description: 'the aria label of a mention typeahead popup'
40
+ },
41
+ mentionInputLabel: {
42
+ id: 'fabric.editor.typeahead.mentionInputLabel',
43
+ defaultMessage: 'Begin typing to search for users to tag',
44
+ description: 'assisitve text for typeahed input field'
45
+ },
46
+ metionListItemLabel: {
47
+ id: 'fabric.editor.typeahead.metionListItemLabel',
48
+ defaultMessage: 'User {name} @{shortName}',
49
+ description: 'assistive text for user mention items username and nickname'
50
+ },
51
+ emojiListItemLabel: {
52
+ id: 'fabric.editor.typeahead.emojiListItemLabel',
53
+ defaultMessage: 'Emoji {name} Text Shortcut {shortcut}',
54
+ description: 'assistive text for emoji name and shortcut'
55
+ },
16
56
  inputQueryAssistiveLabel: {
17
57
  id: 'fabric.editor.inputQueryAssistiveTxt',
18
- defaultMessage: 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.',
58
+ defaultMessage: 'When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.',
19
59
  description: 'Assistive text to the user when using typeahead shortcut'
20
60
  },
21
61
  searchResultsLabel: {
@@ -67,7 +67,6 @@ var factoryDecorations = function factoryDecorations(_ref) {
67
67
 
68
68
  typeaheadComponent.setAttribute('id', decorationId);
69
69
  typeaheadComponent.setAttribute('role', 'search');
70
- typeaheadComponent.setAttribute('aria-label', "On ".concat(triggerHandler.id));
71
70
  typeaheadComponent.dataset.typeAheadQuery = 'true';
72
71
  typeaheadComponent.dataset.trigger = triggerHandler.trigger; // This line below seems weird,
73
72
  // we need that cuz the clickAreaHelper
@@ -69,6 +69,22 @@ var isSelectAllShortcut = function isSelectAllShortcut(event) {
69
69
  return (event.ctrlKey || event.metaKey) && key === 'a';
70
70
  };
71
71
 
72
+ var getAriaLabel = function getAriaLabel(triggerPrefix, intl) {
73
+ switch (triggerPrefix) {
74
+ case '@':
75
+ return _messages.typeAheadListMessages.mentionInputLabel;
76
+
77
+ case '/':
78
+ return _messages.typeAheadListMessages.quickInsertInputLabel;
79
+
80
+ case ':':
81
+ return _messages.typeAheadListMessages.emojiInputLabel;
82
+
83
+ default:
84
+ return _messages.typeAheadListMessages.quickInsertInputLabel;
85
+ }
86
+ };
87
+
72
88
  var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
73
89
  var triggerQueryPrefix = _ref.triggerQueryPrefix,
74
90
  cancel = _ref.cancel,
@@ -465,7 +481,7 @@ var InputQuery = /*#__PURE__*/_react.default.memo(function (_ref) {
465
481
  style: {
466
482
  display: 'none'
467
483
  }
468
- }, intl.formatMessage(_messages.typeAheadListMessages.inputQueryAssistiveLabel)), (0, _react2.jsx)(_AssistiveText.AssistiveText, {
484
+ }, intl.formatMessage(getAriaLabel(triggerQueryPrefix, intl)), ",", intl.formatMessage(_messages.typeAheadListMessages.inputQueryAssistiveLabel)), (0, _react2.jsx)(_AssistiveText.AssistiveText, {
469
485
  assistiveText: items.length === 0 ? intl.formatMessage(_messages.typeAheadListMessages.noSearchResultsLabel, {
470
486
  itemsLength: items.length
471
487
  }) : '',
@@ -70,7 +70,8 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
70
70
  onItemClick = _ref2.onItemClick,
71
71
  intl = _ref2.intl,
72
72
  fitHeight = _ref2.fitHeight,
73
- decorationElement = _ref2.decorationElement;
73
+ decorationElement = _ref2.decorationElement,
74
+ triggerHandler = _ref2.triggerHandler;
74
75
  var listRef = (0, _react.useRef)();
75
76
  var listContainerRef = (0, _react.useRef)(null);
76
77
  var lastVisibleIndexes = (0, _react.useRef)({
@@ -253,6 +254,7 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
253
254
  key = _ref4.key,
254
255
  style = _ref4.style,
255
256
  parent = _ref4.parent;
257
+ var currentItem = items[index];
256
258
  return (0, _react2.jsx)(_CellMeasurer.CellMeasurer, {
257
259
  key: key,
258
260
  cache: cache,
@@ -266,21 +268,24 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
266
268
  "data-testid": "list-item-height-observed-".concat(index)
267
269
  }, (0, _react2.jsx)(_TypeAheadListItem.TypeAheadListItem, {
268
270
  key: items[index].title,
269
- item: items[index],
271
+ item: currentItem,
270
272
  itemsLength: items.length,
271
273
  itemIndex: index,
272
274
  selectedIndex: selectedIndex,
273
- onItemClick: actions.onItemClick
275
+ onItemClick: actions.onItemClick,
276
+ ariaLabel: (0, _utils.getTypeAheadListAriaLabels)(triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.trigger, intl, currentItem).listItemAriaLabel
274
277
  }))));
275
278
  };
276
279
 
280
+ var popupAriaLabel = (0, _utils.getTypeAheadListAriaLabels)(triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.trigger, intl).popupAriaLabel;
281
+
277
282
  if (!Array.isArray(items)) {
278
283
  return null;
279
284
  }
280
285
 
281
286
  var menuGroupId = ((_decorationElement$qu2 = decorationElement.querySelector("[role='combobox']")) === null || _decorationElement$qu2 === void 0 ? void 0 : _decorationElement$qu2.getAttribute('aria-controls')) || _constants.TYPE_AHEAD_DECORATION_ELEMENT_ID;
282
287
  return (0, _react2.jsx)(_menu.MenuGroup, {
283
- "aria-label": intl.formatMessage(_messages.typeAheadListMessages.typeAheadResultLabel),
288
+ "aria-label": popupAriaLabel,
284
289
  "aria-relevant": "additions removals"
285
290
  }, (0, _react2.jsx)("div", {
286
291
  id: menuGroupId,
@@ -103,7 +103,8 @@ var TypeAheadListItem = function TypeAheadListItem(_ref3) {
103
103
  itemsLength = _ref3.itemsLength,
104
104
  selectedIndex = _ref3.selectedIndex,
105
105
  onItemClick = _ref3.onItemClick,
106
- itemIndex = _ref3.itemIndex;
106
+ itemIndex = _ref3.itemIndex,
107
+ ariaLabel = _ref3.ariaLabel;
107
108
 
108
109
  /**
109
110
  * To select and highlight the first Item when no item is selected
@@ -152,21 +153,23 @@ var TypeAheadListItem = function TypeAheadListItem(_ref3) {
152
153
  var listItemClasses = [customRenderItemDivStyle, isSelected && selectedStyle];
153
154
  return (0, _react2.jsx)("div", {
154
155
  "aria-selected": isSelected,
155
- "aria-label": title,
156
156
  role: "option",
157
+ "aria-label": ariaLabel,
157
158
  "aria-setsize": itemsLength,
158
159
  tabIndex: 0,
159
160
  css: listItemClasses,
160
161
  className: "ak-typeahead-item ".concat(isSelected ? 'typeahead-selected-item' : '') //CSS classes added for test cases purpose
161
162
  ,
162
163
  ref: customItemRef
164
+ }, (0, _react2.jsx)("div", {
165
+ "aria-hidden": true
163
166
  }, (0, _react2.jsx)(Comp, {
164
167
  onClick: insertSelectedItem,
165
168
  isSelected: false //The selection styles are handled in the parent div instead. Hence isSelected is made false always.
166
169
  ,
167
170
  onHover: noop
168
- }));
169
- }, [customRenderItem, insertSelectedItem, isSelected, title, customItemRef, itemsLength]);
171
+ })));
172
+ }, [customRenderItem, isSelected, ariaLabel, itemsLength, customItemRef, insertSelectedItem]);
170
173
 
171
174
  if (customItem) {
172
175
  return customItem;
@@ -179,7 +182,7 @@ var TypeAheadListItem = function TypeAheadListItem(_ref3) {
179
182
  iconBefore: elementIcon,
180
183
  isSelected: isSelected,
181
184
  "aria-selected": isSelected,
182
- "aria-label": item.title,
185
+ "aria-label": title,
183
186
  "aria-setsize": itemsLength,
184
187
  role: "option",
185
188
  ref: buttonItemRef
@@ -236,7 +236,8 @@ var TypeAheadPopup = /*#__PURE__*/_react.default.memo(function (props) {
236
236
  onItemClick: onItemInsert,
237
237
  fitHeight: fitHeight,
238
238
  editorView: editorView,
239
- decorationElement: anchorElement
239
+ decorationElement: anchorElement,
240
+ triggerHandler: triggerHandler
240
241
  })));
241
242
  });
242
243
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadHandler = exports.getPluginState = exports.findTypeAheadDecorations = exports.findHandlerByTrigger = exports.findHandler = void 0;
6
+ exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadListAriaLabels = exports.getTypeAheadHandler = exports.getPluginState = exports.findTypeAheadDecorations = exports.findHandlerByTrigger = exports.findHandler = void 0;
7
7
 
8
8
  var _prosemirrorState = require("prosemirror-state");
9
9
 
@@ -17,6 +17,8 @@ var _updateSelectedIndex = require("./commands/update-selected-index");
17
17
 
18
18
  var _statsModifier = require("./stats-modifier");
19
19
 
20
+ var _messages = require("./messages");
21
+
20
22
  var findTypeAheadDecorations = function findTypeAheadDecorations(state) {
21
23
  var selection = state.selection;
22
24
 
@@ -144,4 +146,44 @@ var moveSelectedIndex = function moveSelectedIndex(_ref2) {
144
146
  };
145
147
  };
146
148
 
147
- exports.moveSelectedIndex = moveSelectedIndex;
149
+ exports.moveSelectedIndex = moveSelectedIndex;
150
+
151
+ var getTypeAheadListAriaLabels = function getTypeAheadListAriaLabels(trigger, intl, item) {
152
+ var _item$mention, _item$mention2, _item$emoji, _item$emoji2, _item$emoji3;
153
+
154
+ switch (trigger) {
155
+ case '@':
156
+ return {
157
+ popupAriaLabel: intl.formatMessage(_messages.typeAheadListMessages.mentionPopupLabel),
158
+ listItemAriaLabel: intl.formatMessage(_messages.typeAheadListMessages.metionListItemLabel, {
159
+ name: (item === null || item === void 0 ? void 0 : (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.name) || '',
160
+ shortName: (item === null || item === void 0 ? void 0 : (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.mentionName) || ''
161
+ })
162
+ };
163
+
164
+ case '/':
165
+ return {
166
+ popupAriaLabel: intl.formatMessage(_messages.typeAheadListMessages.quickInsertPopupLabel),
167
+ listItemAriaLabel: intl.formatMessage(_messages.typeAheadListMessages.emojiListItemLabel, {
168
+ name: (item === null || item === void 0 ? void 0 : item.title) || '',
169
+ shortcut: (item === null || item === void 0 ? void 0 : (_item$emoji = item.emoji) === null || _item$emoji === void 0 ? void 0 : _item$emoji.shortName) || ''
170
+ })
171
+ };
172
+
173
+ case ':':
174
+ return {
175
+ popupAriaLabel: intl.formatMessage(_messages.typeAheadListMessages.emojiPopupLabel),
176
+ listItemAriaLabel: intl.formatMessage(_messages.typeAheadListMessages.emojiListItemLabel, {
177
+ name: (item === null || item === void 0 ? void 0 : (_item$emoji2 = item.emoji) === null || _item$emoji2 === void 0 ? void 0 : _item$emoji2.name) || '',
178
+ shortcut: (item === null || item === void 0 ? void 0 : (_item$emoji3 = item.emoji) === null || _item$emoji3 === void 0 ? void 0 : _item$emoji3.shortName) || ''
179
+ })
180
+ };
181
+
182
+ default:
183
+ return {
184
+ popupAriaLabel: intl.formatMessage(_messages.typeAheadListMessages.typeAheadPopupLabel)
185
+ };
186
+ }
187
+ };
188
+
189
+ exports.getTypeAheadListAriaLabels = getTypeAheadListAriaLabels;
@@ -41,6 +41,8 @@ var _api = require("../../../type-ahead/api");
41
41
 
42
42
  var _commands = require("../../commands");
43
43
 
44
+ var _keymaps2 = require("@atlaskit/editor-common/keymaps");
45
+
44
46
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
45
47
 
46
48
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -117,7 +119,8 @@ var ToolbarUndoRedo = /*#__PURE__*/function (_PureComponent) {
117
119
  spacing: isReducedSpacing ? 'none' : 'default',
118
120
  onClick: handleUndo,
119
121
  disabled: !canUndo || disabled,
120
- "aria-label": labelUndo,
122
+ "aria-label": (0, _keymaps.tooltip)(_keymaps.undo, labelUndo),
123
+ "aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.undo),
121
124
  title: (0, _react2.jsx)(_keymaps.ToolTipContent, {
122
125
  description: labelUndo,
123
126
  keymap: _keymaps.undo
@@ -139,7 +142,8 @@ var ToolbarUndoRedo = /*#__PURE__*/function (_PureComponent) {
139
142
  label: ""
140
143
  }),
141
144
  testId: "ak-editor-toolbar-button-redo",
142
- "aria-label": labelRedo
145
+ "aria-label": (0, _keymaps.tooltip)(_keymaps.redo, labelRedo),
146
+ "aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.redo)
143
147
  }), (0, _react2.jsx)("span", {
144
148
  css: _styles.separatorStyles
145
149
  }));
@@ -29,6 +29,8 @@ var _ToolbarButton = _interopRequireDefault(require("../../ToolbarButton"));
29
29
 
30
30
  var _keymaps = require("../../../keymaps");
31
31
 
32
+ var _keymaps2 = require("@atlaskit/editor-common/keymaps");
33
+
32
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
35
 
34
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -77,8 +79,9 @@ var AlignmentButton = /*#__PURE__*/function (_PureComponent) {
77
79
  description: label,
78
80
  keymap: shortcut
79
81
  }),
80
- "aria-label": label,
82
+ "aria-label": shortcut ? (0, _keymaps.tooltip)(shortcut, label) : label,
81
83
  "aria-pressed": isSelected,
84
+ "aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(shortcut),
82
85
  onClick: this.onClick,
83
86
  iconBefore: content
84
87
  });
@@ -34,7 +34,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
34
34
  var TableControlsPadding = 20;
35
35
  exports.TableControlsPadding = TableControlsPadding;
36
36
  var mainToolbarWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n padding: ", "px ", "px 0;\n display: flex;\n height: auto;\n background-color: ", ";\n box-shadow: none;\n padding-left: ", "px;\n\n & > div {\n > :first-child:not(style),\n > style:first-child + * {\n margin-left: 0;\n }\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), (0, _constants.gridSize)(), (0, _constants.gridSize)(), (0, _tokens.token)('elevation.surface', 'white'), TableControlsPadding);
37
- var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: sticky;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n padding-bottom: ", "px;\n z-index: ", ";\n transition: box-shadow ease-in-out 0.2s;\n &.show-keyline {\n box-shadow: 0 ", "px 0 0\n ", ";\n }\n"])), (0, _constants.gridSize)(), _editorSharedStyles.akEditorGridLineZIndex + _editorSharedStyles.akEditorMenuZIndex, _editorSharedStyles.akEditorToolbarKeylineHeight, (0, _tokens.token)('color.border', _colors.N30));
37
+ var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: sticky;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n padding-bottom: ", "px;\n z-index: ", ";\n transition: box-shadow ease-in-out 0.2s;\n &.show-keyline {\n box-shadow: 0 ", "px 0 0\n ", ";\n }\n"])), (0, _constants.gridSize)(), _editorSharedStyles.akEditorMenuZIndex, _editorSharedStyles.akEditorToolbarKeylineHeight, (0, _tokens.token)('color.border', _colors.N30));
38
38
 
39
39
  var StickyToolbar = function StickyToolbar(props) {
40
40
  var _useState = (0, _react.useState)(0),
@@ -104,7 +104,8 @@ var EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
104
104
 
105
105
  var contextPanelWidth = _ref.width;
106
106
  return (0, _react2.jsx)(_ToolbarArrowKeyNavigationProvider.ToolbarArrowKeyNavigationProvider, {
107
- editorView: props.editorView
107
+ editorView: props.editorView,
108
+ childComponentSelector: "[data-testid='ak-editor-main-toolbar']"
108
109
  }, (0, _react2.jsx)("div", {
109
110
  css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
110
111
  "data-testid": "ak-editor-main-toolbar"
@@ -21,6 +21,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
21
21
 
22
22
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
23
 
24
+ var _ui = require("@atlaskit/editor-common/ui");
25
+
24
26
  var _react = _interopRequireDefault(require("react"));
25
27
 
26
28
  var _editor = _interopRequireDefault(require("../../editor"));
@@ -88,10 +90,10 @@ var CollapsedEditor = /*#__PURE__*/function (_React$Component) {
88
90
  }
89
91
 
90
92
  if (!this.props.isExpanded) {
91
- return /*#__PURE__*/_react.default.createElement(_ChromeCollapsed.default, {
93
+ return /*#__PURE__*/_react.default.createElement(_ui.IntlProviderIfMissingWrapper, null, /*#__PURE__*/_react.default.createElement(_ChromeCollapsed.default, {
92
94
  onFocus: this.props.onFocus,
93
95
  text: this.props.placeholder
94
- });
96
+ }));
95
97
  }
96
98
 
97
99
  return /*#__PURE__*/_react.default.cloneElement(child, {
@@ -114,7 +114,8 @@ var ColorPickerButton = function ColorPickerButton(props) {
114
114
  zIndex: props.setDisableParentScroll ? 600 : undefined,
115
115
  ariaLabel: "Color picker popup"
116
116
  }, (0, _react2.jsx)("div", {
117
- css: colorPickerWrapper
117
+ css: colorPickerWrapper,
118
+ "data-test-id": "color-picker-menu"
118
119
  }, (0, _react2.jsx)(ColorPaletteWithListeners, {
119
120
  palette: props.colorPalette,
120
121
  cols: props.cols,
@@ -45,8 +45,6 @@ var _addCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/add-circle
45
45
 
46
46
  var _messages = require("../messages");
47
47
 
48
- var _FormContent = _interopRequireDefault(require("../FormContent"));
49
-
50
48
  var _utils = require("../utils");
51
49
 
52
50
  var _constants = require("@atlaskit/theme/constants");
@@ -291,7 +289,8 @@ var FieldsetField = /*#__PURE__*/function (_React$Component) {
291
289
  extensionManifest = _this$props.extensionManifest,
292
290
  onFieldChange = _this$props.onFieldChange,
293
291
  firstVisibleFieldName = _this$props.firstVisibleFieldName,
294
- error = _this$props.error;
292
+ error = _this$props.error,
293
+ FormComponent = _this$props.formComponent;
295
294
  var label = field.label,
296
295
  options = field.options;
297
296
  var _this$state3 = this.state,
@@ -301,7 +300,7 @@ var FieldsetField = /*#__PURE__*/function (_React$Component) {
301
300
  var children = this.renderActions();
302
301
  return (0, _react2.jsx)(_react.Fragment, null, error && (0, _react2.jsx)(FieldsetError, {
303
302
  message: error
304
- }), (0, _react2.jsx)("div", null, options.showTitle && (0, _react2.jsx)("h5", null, label), (0, _react2.jsx)(_FormContent.default, {
303
+ }), (0, _react2.jsx)("div", null, options.showTitle && (0, _react2.jsx)("h5", null, label), (0, _react2.jsx)(FormComponent, {
305
304
  fields: selectedFields,
306
305
  parentName: name,
307
306
  extensionManifest: extensionManifest,
@@ -152,7 +152,8 @@ function FieldComponent(_ref) {
152
152
  onFieldChange: onFieldChange,
153
153
  extensionManifest: extensionManifest,
154
154
  parameters: defaultValue || {},
155
- error: error
155
+ error: error,
156
+ formComponent: FormContent
156
157
  });
157
158
 
158
159
  case 'user':
@@ -88,7 +88,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
88
88
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
89
89
 
90
90
  var contentStyles = function contentStyles(props) {
91
- return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
91
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
92
92
  theme: props.theme
93
93
  }), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _tokens.token)('color.border.focused', '#8cf'), _styles17.placeholderTextStyles, _styles5.placeholderStyles, (0, _styles7.codeBlockStyles)(props), (0, _styles6.blocktypeStyles)(props), (0, _styles16.textFormattingStyles)(props), _styles.textColorStyles, _styles8.listsStyles, (0, _styles9.ruleStyles)(props), _styles10.mediaStyles, _styles11.layoutStyles, _styles3.telepointerStyle, _styles4.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles12.panelStyles)(props), _styles13.fakeCursorStyles, _styles14.mentionsStyles, _styles15.emojiStyles, _styles.tasksAndDecisionsStyles, _styles18.gridStyles, _styles19.linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles20.extensionStyles, (0, _styles21.expandStyles)(props), _styles22.findReplaceStyles, _styles23.taskDecisionStyles, _styles24.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles25.smartCardStyles, _styles.smartCardSharedStyles, _styles26.dateStyles, _styled.embedCardStyles, _styles2.unsupportedStyles, _style.ClassNames.FLOATING_TOOLBAR_COMPONENT);
94
94
  };
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.inputWrapper = exports.containerWithProvider = exports.container = exports.RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = exports.RECENT_SEARCH_WIDTH_IN_PX = exports.RECENT_SEARCH_HEIGHT_IN_PX = void 0;
8
+ exports.inputWrapper = exports.containerWithProvider = exports.container = exports.RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = exports.RECENT_SEARCH_WIDTH_IN_PX = exports.RECENT_SEARCH_HEIGHT_IN_PX = exports.LINKPICKER_HEIGHT_IN_PX = void 0;
9
9
 
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
11
 
@@ -19,6 +19,8 @@ var RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
19
19
  exports.RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX;
20
20
  var RECENT_SEARCH_HEIGHT_IN_PX = 360;
21
21
  exports.RECENT_SEARCH_HEIGHT_IN_PX = RECENT_SEARCH_HEIGHT_IN_PX;
22
+ var LINKPICKER_HEIGHT_IN_PX = 570;
23
+ exports.LINKPICKER_HEIGHT_IN_PX = LINKPICKER_HEIGHT_IN_PX;
22
24
  var inputWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n line-height: 0;\n padding: 5px 0;\n align-items: center;\n"])));
23
25
  exports.inputWrapper = inputWrapper;
24
26
  var container = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n overflow: auto;\n padding: 0;\n\n width: ", "px;\n line-height: initial;\n"])), RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX);
@@ -37,32 +37,33 @@ exports.KeyDownHandlerContext = KeyDownHandlerContext;
37
37
 
38
38
  var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvider(_ref) {
39
39
  var children = _ref.children,
40
- editorView = _ref.editorView;
40
+ editorView = _ref.editorView,
41
+ childComponentSelector = _ref.childComponentSelector,
42
+ handleEscape = _ref.handleEscape,
43
+ disableArrowKeyNavigation = _ref.disableArrowKeyNavigation;
41
44
  var wrapperRef = (0, _react.useRef)(null);
42
- var currentSelectedItemIndex = (0, _react.useRef)(0);
43
-
44
- var incrementIndex = function incrementIndex(list) {
45
- if (currentSelectedItemIndex.current === list.length - 1) {
46
- currentSelectedItemIndex.current = 0;
45
+ var selectedItemIndex = (0, _react.useRef)(0);
46
+ var incrementIndex = (0, _react.useCallback)(function (list) {
47
+ if (selectedItemIndex.current === list.length - 1) {
48
+ selectedItemIndex.current = 0;
47
49
  } else {
48
- currentSelectedItemIndex.current = currentSelectedItemIndex.current + 1;
50
+ selectedItemIndex.current = selectedItemIndex.current + 1;
49
51
  }
50
- };
51
-
52
- var decrementIndex = function decrementIndex(list) {
53
- if (currentSelectedItemIndex.current === 0) {
54
- currentSelectedItemIndex.current = list.length - 1;
52
+ }, []);
53
+ var decrementIndex = (0, _react.useCallback)(function (list) {
54
+ if (selectedItemIndex.current === 0) {
55
+ selectedItemIndex.current = list.length - 1;
55
56
  } else {
56
- currentSelectedItemIndex.current = currentSelectedItemIndex.current - 1;
57
+ selectedItemIndex.current = selectedItemIndex.current - 1;
57
58
  }
58
- };
59
+ }, []);
59
60
 
60
61
  var handleArrowRight = function handleArrowRight() {
61
62
  var _filteredFocusableEle;
62
63
 
63
64
  var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
64
65
  incrementIndex(filteredFocusableElements);
65
- (_filteredFocusableEle = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle === void 0 ? void 0 : _filteredFocusableEle.focus();
66
+ (_filteredFocusableEle = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle === void 0 ? void 0 : _filteredFocusableEle.focus();
66
67
  };
67
68
 
68
69
  var handleArrowLeft = function handleArrowLeft() {
@@ -70,14 +71,23 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
70
71
 
71
72
  var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
72
73
  decrementIndex(filteredFocusableElements);
73
- (_filteredFocusableEle2 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle2 === void 0 ? void 0 : _filteredFocusableEle2.focus();
74
+ (_filteredFocusableEle2 = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle2 === void 0 ? void 0 : _filteredFocusableEle2.focus();
74
75
  };
75
76
 
76
77
  var handleTab = function handleTab() {
77
78
  var _filteredFocusableEle3;
78
79
 
79
80
  var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
80
- (_filteredFocusableEle3 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle3 === void 0 ? void 0 : _filteredFocusableEle3.focus();
81
+ (_filteredFocusableEle3 = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle3 === void 0 ? void 0 : _filteredFocusableEle3.focus();
82
+ };
83
+
84
+ var focusAndScrollToElement = function focusAndScrollToElement(element) {
85
+ element === null || element === void 0 ? void 0 : element.scrollIntoView({
86
+ behavior: 'smooth',
87
+ block: 'center',
88
+ inline: 'nearest'
89
+ });
90
+ element.focus();
81
91
  };
82
92
 
83
93
  var submenuKeydownHandleContext = {
@@ -86,7 +96,7 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
86
96
  handleTab: handleTab
87
97
  };
88
98
  (0, _react.useLayoutEffect)(function () {
89
- if (!wrapperRef.current) {
99
+ if (!wrapperRef.current || disableArrowKeyNavigation) {
90
100
  return;
91
101
  }
92
102
 
@@ -97,17 +107,17 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
97
107
  */
98
108
 
99
109
  var handleKeyDown = function handleKeyDown(event) {
100
- var _document$querySelect, _wrapperRef$current, _filteredFocusableEle4;
110
+ var _document$querySelect, _document$querySelect2, _wrapperRef$current;
101
111
 
102
- //To trap the focus inside the horizontal main toolbar for left and right arrow keys
103
- var targetElement = event.target; //To filter out the events outside the main toolbar
112
+ //To trap the focus inside the horizontal toolbar for left and right arrow keys
113
+ var targetElement = event.target; //To filter out the events outside the child component
104
114
 
105
- if (!targetElement.closest("[data-testid='ak-editor-main-toolbar']")) {
115
+ if (!targetElement.closest("".concat(childComponentSelector))) {
106
116
  return;
107
117
  } //The key events are from child components such as dropdown menus / popups are ignored
108
118
 
109
119
 
110
- if ((_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown') {
120
+ if ((_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || (_document$querySelect2 = document.querySelector('[data-test-id="color-picker-menu"]')) !== null && _document$querySelect2 !== void 0 && _document$querySelect2.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown' || disableArrowKeyNavigation) {
111
121
  return;
112
122
  }
113
123
 
@@ -120,25 +130,37 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
120
130
 
121
131
 
122
132
  if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
123
- currentSelectedItemIndex.current = -1;
133
+ selectedItemIndex.current = -1;
124
134
  } else {
125
- currentSelectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : currentSelectedItemIndex.current;
135
+ selectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
126
136
  }
127
137
 
128
- if (event.key === 'ArrowRight') {
129
- incrementIndex(filteredFocusableElements);
130
- } else if (event.key === 'ArrowLeft') {
131
- decrementIndex(filteredFocusableElements);
132
- }
138
+ switch (event.key) {
139
+ case 'ArrowRight':
140
+ incrementIndex(filteredFocusableElements);
141
+ focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current]);
142
+ event.preventDefault();
143
+ break;
144
+
145
+ case 'ArrowLeft':
146
+ decrementIndex(filteredFocusableElements);
147
+ focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current]);
148
+ event.preventDefault();
149
+ break;
133
150
 
134
- (_filteredFocusableEle4 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle4 === void 0 ? void 0 : _filteredFocusableEle4.focus();
151
+ case 'Escape':
152
+ handleEscape(event);
153
+ break;
154
+
155
+ default:
156
+ }
135
157
  };
136
158
 
137
159
  element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
138
160
  return function () {
139
161
  element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
140
162
  };
141
- }, [currentSelectedItemIndex, wrapperRef, editorView]);
163
+ }, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex]);
142
164
  return /*#__PURE__*/_react.default.createElement("div", {
143
165
  className: "custom-key-handler-wrapper",
144
166
  ref: wrapperRef
@@ -161,6 +183,6 @@ function getFocusableElements(rootNode) {
161
183
  function getFilteredFocusableElements(rootNode) {
162
184
  //The focusable elements from child components such as dropdown menus / popups are ignored
163
185
  return getFocusableElements(rootNode).filter(function (elm) {
164
- return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]');
186
+ return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons');
165
187
  });
166
188
  }