@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
@@ -43,7 +43,7 @@ function getSpellCheck(featureFlags) {
43
43
 
44
44
 
45
45
  function createFeatureFlagsFromProps(props) {
46
- var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$collabEdit, _props$collabEdit2, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39;
46
+ var _props$featureFlags, _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$allowTables5, _props$featureFlags10, _props$featureFlags11, _props$allowTables6, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$collabEdit, _props$collabEdit2, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41, _props$featureFlags42;
47
47
 
48
48
  var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
49
49
  var tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
@@ -51,11 +51,9 @@ function createFeatureFlagsFromProps(props) {
51
51
  newInsertionBehaviour: props.allowNewInsertionBehaviour,
52
52
  interactiveExpand: typeof props.allowExpand === 'boolean' ? props.allowExpand : Boolean(props.allowExpand && props.allowExpand.allowInteractiveExpand !== false),
53
53
  placeholderBracketHint: !!props.placeholderBracketHint,
54
- placeholderHints: Array.isArray(props.placeholderHints) && props.placeholderHints.length > 0,
55
54
  moreTextColors: typeof props.allowTextColor === 'boolean' ? false : Boolean(((_props$allowTextColor = props.allowTextColor) === null || _props$allowTextColor === void 0 ? void 0 : _props$allowTextColor.allowMoreTextColors) === true),
56
55
  findReplace: !!props.allowFindReplace,
57
56
  findReplaceMatchCase: (0, _typeof2.default)(props.allowFindReplace) === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
58
- keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
59
57
  addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
60
58
  singleLayout: (0, _typeof2.default)(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
61
59
  undoRedoButtons: props.allowUndoRedoButtons,
@@ -76,17 +74,19 @@ function createFeatureFlagsFromProps(props) {
76
74
  saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.saferDispatchedTransactions) : false)),
77
75
  useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
78
76
  chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
79
- viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
80
77
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
81
- showHoverPreview: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.showHoverPreview) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.showHoverPreview) : false),
82
- indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags33 = props.featureFlags) !== null && _props$featureFlags33 !== void 0 && _props$featureFlags33.indentationButtonsInTheToolbar) : false)),
83
- floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags35 = props.featureFlags) !== null && _props$featureFlags35 !== void 0 && _props$featureFlags35.floatingToolbarCopyButton) : false)),
84
- floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
78
+ showHoverPreview: Boolean(typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.showHoverPreview) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.showHoverPreview) : false),
79
+ indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.indentationButtonsInTheToolbar) : false)),
80
+ floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.floatingToolbarCopyButton) : false)),
81
+ floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
85
82
  disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
86
83
  // Including fallback to props.featureFlags so that mobile feature flags
87
84
  // are included (they are not kebab cased)
88
- restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.restartNumberedLists) === true,
89
- listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.listNumberContinuity) === true,
90
- restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.restartNumberedListsToolbar) === true
85
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.restartNumberedLists) === true,
86
+ listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.listNumberContinuity) === true,
87
+ restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.restartNumberedListsToolbar) === true,
88
+ useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags40 = props.featureFlags) !== null && _props$featureFlags40 !== void 0 && _props$featureFlags40.useSomewhatSemanticTextColorNames) : false)),
89
+ lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
90
+ preventPopupOverflow: Boolean(typeof ((_props$featureFlags41 = props.featureFlags) === null || _props$featureFlags41 === void 0 ? void 0 : _props$featureFlags41['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags42 = props.featureFlags) !== null && _props$featureFlags42 !== void 0 && _props$featureFlags42['prevent-popup-overflow']) : false)
91
91
  });
92
92
  }
@@ -47,6 +47,8 @@ var _types = require("../../analytics/types");
47
47
 
48
48
  var _keymaps = require("../../../keymaps");
49
49
 
50
+ var _keymaps2 = require("@atlaskit/editor-common/keymaps");
51
+
50
52
  var _templateObject, _templateObject2, _templateObject3;
51
53
 
52
54
  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); }
@@ -114,6 +116,7 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
114
116
  takeFullWidth = _this$props.takeFullWidth;
115
117
  var title = formatMessage(messages.findReplaceToolbarButton);
116
118
  var stackBelowOtherEditorFloatingPanels = _editorSharedStyles.akEditorFloatingPanelZIndex - 1;
119
+ var keymap = (0, _keymaps.findKeymapByDescription)('Find');
117
120
  return (0, _react2.jsx)("div", {
118
121
  css: [toolbarButtonWrapper, takeFullWidth && toolbarButtonWrapperFullWith]
119
122
  }, (0, _react2.jsx)(_Dropdown.default, {
@@ -137,14 +140,16 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
137
140
  selected: isActive,
138
141
  title: (0, _react2.jsx)(_keymaps.ToolTipContent, {
139
142
  description: title,
140
- keymap: (0, _keymaps.findKeymapByDescription)('Find')
143
+ keymap: keymap
141
144
  }),
142
145
  iconBefore: (0, _react2.jsx)(_search.default, {
143
146
  label: title
144
147
  }),
145
148
  onClick: this.toggleOpen,
146
149
  "aria-expanded": isActive,
147
- "aria-haspopup": true
150
+ "aria-haspopup": true,
151
+ "aria-label": keymap ? (0, _keymaps.tooltip)(keymap, title) : title,
152
+ "aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(keymap)
148
153
  })
149
154
  }, (0, _react2.jsx)("div", {
150
155
  css: wrapper
@@ -224,7 +224,9 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
224
224
  _config$offset = config.offset,
225
225
  offset = _config$offset === void 0 ? [0, 12] : _config$offset,
226
226
  forcePlacement = config.forcePlacement,
227
- onPositionCalculated = config.onPositionCalculated;
227
+ preventPopupOverflow = config.preventPopupOverflow,
228
+ onPositionCalculated = config.onPositionCalculated,
229
+ focusTrap = config.focusTrap;
228
230
  var targetRef = getDomRef(editorView, dispatchAnalyticsEvent);
229
231
 
230
232
  if (!targetRef || editorDisabledPlugin && editorDisabledPlugin.editorDisabled) {
@@ -250,6 +252,7 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
250
252
 
251
253
  var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
252
254
  var scrollable = (0, _featureFlagsContext.getFeatureFlags)(editorView.state).floatingToolbarCopyButton && config.scrollable;
255
+ var confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
253
256
  return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.ErrorBoundary, {
254
257
  component: _analytics.ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
255
258
  componentId: (0, _camelCase.default)(title),
@@ -272,7 +275,9 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
272
275
  onPositionCalculated: customPositionCalculation,
273
276
  style: scrollable ? {
274
277
  maxWidth: '100%'
275
- } : {}
278
+ } : {},
279
+ focusTrap: focusTrap,
280
+ preventOverflow: preventPopupOverflow
276
281
  }, /*#__PURE__*/_react.default.createElement(_ToolbarLoader.ToolbarLoader, {
277
282
  target: targetRef,
278
283
  items: toolbarItems,
@@ -291,9 +296,16 @@ var floatingToolbarPlugin = function floatingToolbarPlugin() {
291
296
  extensionsProvider: extensionsState === null || extensionsState === void 0 ? void 0 : extensionsState.extensionProvider,
292
297
  scrollable: scrollable
293
298
  })), /*#__PURE__*/_react.default.createElement(_ConfirmationModal.ConfirmationModal, {
294
- options: confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog,
299
+ options: confirmDialogOptions,
295
300
  onConfirm: function onConfirm() {
296
- dispatchCommand(confirmButtonItem.onClick);
301
+ var isChecked = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
302
+
303
+ if (!!confirmDialogOptions.onConfirm) {
304
+ dispatchCommand(confirmDialogOptions.onConfirm(isChecked));
305
+ } else {
306
+ dispatchCommand(confirmButtonItem.onClick);
307
+ }
308
+
297
309
  dispatchCommand((0, _commands.hideConfirmDialog)());
298
310
  } // When closed without clicking OK or cancel buttons
299
311
  ,
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.CheckboxModal = void 0;
11
+
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
14
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
+
16
+ var _react = _interopRequireWildcard(require("react"));
17
+
18
+ var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
19
+
20
+ var _checkbox = require("@atlaskit/checkbox");
21
+
22
+ var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
23
+
24
+ var _messages = _interopRequireDefault(require("./messages"));
25
+
26
+ 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); }
27
+
28
+ 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; }
29
+
30
+ var CheckboxModal = function CheckboxModal(props) {
31
+ var _useState = (0, _react.useState)(false),
32
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
33
+ isChecked = _useState2[0],
34
+ setCheckbox = _useState2[1];
35
+
36
+ var onConfirm = props.onConfirm,
37
+ onClose = props.onClose,
38
+ options = props.options,
39
+ formatMessage = props.intl.formatMessage,
40
+ testId = props.testId;
41
+ var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(_messages.default.confirmModalDefaultHeading);
42
+ var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
43
+ var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
44
+ var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
45
+
46
+ var ListComponent = function ListComponent(_ref) {
47
+ var nodes = _ref.nodes;
48
+
49
+ if (!nodes) {
50
+ return null;
51
+ }
52
+
53
+ return /*#__PURE__*/_react.default.createElement("ul", null, nodes.map(function (node) {
54
+ return /*#__PURE__*/_react.default.createElement(ListItem, (0, _extends2.default)({}, node, {
55
+ key: node.id
56
+ }));
57
+ }));
58
+ };
59
+
60
+ var ListItem = function ListItem(props) {
61
+ var id = props.id,
62
+ name = props.name,
63
+ amount = props.amount;
64
+ return /*#__PURE__*/_react.default.createElement("li", {
65
+ id: id
66
+ }, formatMessage(_messages.default.confirmModalListUnit, {
67
+ name: name,
68
+ amount: amount
69
+ }));
70
+ };
71
+
72
+ return /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
73
+ onClose: onClose,
74
+ testId: testId
75
+ }, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
76
+ appearance: "warning"
77
+ }, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (options === null || options === void 0 ? void 0 : options.getChildrenInfo) && /*#__PURE__*/_react.default.createElement(ListComponent, {
78
+ nodes: options === null || options === void 0 ? void 0 : options.getChildrenInfo()
79
+ }), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
80
+ isChecked: isChecked,
81
+ onChange: function onChange() {
82
+ return setCheckbox(!isChecked);
83
+ },
84
+ label: checkboxlabel,
85
+ testId: testId ? "".concat(testId, "-checkbox") : undefined
86
+ }))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
87
+ appearance: "default",
88
+ onClick: onClose,
89
+ testId: testId ? "".concat(testId, "-cancel-button") : undefined
90
+ }, cancelButtonLabel), /*#__PURE__*/_react.default.createElement(_standardButton.default, {
91
+ appearance: "warning",
92
+ onClick: function onClick() {
93
+ return onConfirm(isChecked);
94
+ },
95
+ testId: testId ? "".concat(testId, "-confirm-button") : undefined
96
+ }, okButtonLabel)));
97
+ };
98
+
99
+ exports.CheckboxModal = CheckboxModal;
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -13,39 +11,21 @@ var _react = _interopRequireDefault(require("react"));
13
11
 
14
12
  var _reactIntlNext = require("react-intl-next");
15
13
 
16
- var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
14
+ var _SimpleModal = require("./SimpleModal");
17
15
 
18
- var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
16
+ var _CheckboxModal = require("./CheckboxModal");
19
17
 
20
- var _messages = _interopRequireDefault(require("./messages"));
18
+ var _modalDialog = require("@atlaskit/modal-dialog");
21
19
 
22
- 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); }
20
+ var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
21
+ var options = props.options;
23
22
 
24
- 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; }
23
+ var renderModel = function renderModel() {
24
+ var isReferentialityDialog = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
25
+ return isReferentialityDialog ? /*#__PURE__*/_react.default.createElement(_CheckboxModal.CheckboxModal, props) : /*#__PURE__*/_react.default.createElement(_SimpleModal.SimpleModal, props);
26
+ };
25
27
 
26
- var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
27
- var onConfirm = props.onConfirm,
28
- onClose = props.onClose,
29
- options = props.options,
30
- formatMessage = props.intl.formatMessage,
31
- testId = props.testId;
32
- var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(_messages.default.confirmModalDefaultHeading);
33
- var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(_messages.default.confirmModalOK);
34
- var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(_messages.default.confirmModalCancel);
35
- return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, options && /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
36
- onClose: onClose,
37
- testId: testId
38
- }, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
39
- appearance: "warning"
40
- }, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("p", null, options.message)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
41
- appearance: "default",
42
- onClick: onClose,
43
- testId: testId ? "".concat(testId, "-cancel-button") : undefined
44
- }, cancelButtonLabel), /*#__PURE__*/_react.default.createElement(_standardButton.default, {
45
- appearance: "warning",
46
- onClick: onConfirm,
47
- testId: testId ? "".concat(testId, "-confirm-button") : undefined
48
- }, okButtonLabel))));
28
+ return options ? /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
49
29
  };
50
30
 
51
31
  var ConfirmationModal = (0, _reactIntlNext.injectIntl)(ConfirmationModalImpl);
@@ -82,12 +82,14 @@ var Dropdown = /*#__PURE__*/function (_Component) {
82
82
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderArrayOptions", function (options) {
83
83
  var _this$props = _this.props,
84
84
  showSelected = _this$props.showSelected,
85
- dispatchCommand = _this$props.dispatchCommand;
85
+ dispatchCommand = _this$props.dispatchCommand,
86
+ editorView = _this$props.editorView;
86
87
  return (0, _react2.jsx)(_DropdownMenu.default, {
87
88
  hide: _this.hide,
88
89
  dispatchCommand: dispatchCommand,
89
90
  items: options,
90
- showSelected: showSelected
91
+ showSelected: showSelected,
92
+ editorView: editorView
91
93
  });
92
94
  });
93
95
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
@@ -108,6 +110,13 @@ var Dropdown = /*#__PURE__*/function (_Component) {
108
110
 
109
111
  (_document$querySelect = document.querySelector("[data-testid=".concat(_this.props.buttonTestId, "]"))) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
110
112
  });
113
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChanged", function (openChangedEvent) {
114
+ if (!openChangedEvent.isOpen && openChangedEvent.event instanceof KeyboardEvent) {
115
+ var _openChangedEvent$eve;
116
+
117
+ ((_openChangedEvent$eve = openChangedEvent.event) === null || _openChangedEvent$eve === void 0 ? void 0 : _openChangedEvent$eve.key) === 'Escape' ? _this.hideonEsc() : _this.hide();
118
+ }
119
+ });
111
120
  return _this;
112
121
  }
113
122
 
@@ -127,7 +136,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
127
136
  disabled = _this$props2.disabled,
128
137
  tooltip = _this$props2.tooltip,
129
138
  buttonTestId = _this$props2.buttonTestId,
130
- dropdownWidth = _this$props2.dropdownWidth;
139
+ dropdownWidth = _this$props2.dropdownWidth,
140
+ editorView = _this$props2.editorView;
131
141
  var trigger;
132
142
 
133
143
  if (icon) {
@@ -173,9 +183,11 @@ var Dropdown = /*#__PURE__*/function (_Component) {
173
183
  isOpen: isOpen,
174
184
  handleClickOutside: this.hide,
175
185
  handleEscapeKeydown: this.hideonEsc,
186
+ onOpenChange: this.onOpenChanged,
176
187
  fitWidth: fitWidth + fitTolerance,
177
188
  fitHeight: fitHeight + fitTolerance,
178
- trigger: trigger
189
+ trigger: trigger,
190
+ editorView: editorView
179
191
  }, Array.isArray(options) ? this.renderArrayOptions(options) : options.render({
180
192
  hide: this.hide,
181
193
  dispatchCommand: dispatchCommand
@@ -17,11 +17,13 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
17
17
 
18
18
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
19
19
 
20
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
21
+
20
22
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
21
23
 
22
- var _react = require("@emotion/react");
24
+ var _react = require("react");
23
25
 
24
- var _react2 = require("react");
26
+ var _react2 = require("@emotion/react");
25
27
 
26
28
  var _constants = require("@atlaskit/theme/constants");
27
29
 
@@ -50,12 +52,101 @@ var menuItemDimensions = {
50
52
  height: 32
51
53
  };
52
54
  exports.menuItemDimensions = menuItemDimensions;
53
- var spacer = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1;\n padding: 8px;\n"])));
54
- var menuContainer = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n min-width: ", "px;\n\n // temporary solution to retain spacing defined by @atlaskit/Item\n & button {\n min-height: ", "px;\n padding: 8px 8px 7px;\n\n & > [data-item-elem-before] {\n margin-right: ", "px;\n }\n }\n"])), menuItemDimensions.width, (0, _constants.gridSize)() * 4, (0, _constants.gridSize)() / 2);
55
+ var spacer = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1;\n padding: 8px;\n"])));
56
+ var menuContainer = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n min-width: ", "px;\n\n // temporary solution to retain spacing defined by @atlaskit/Item\n & button {\n min-height: ", "px;\n padding: 8px 8px 7px;\n\n & > [data-item-elem-before] {\n margin-right: ", "px;\n }\n }\n"])), menuItemDimensions.width, (0, _constants.gridSize)() * 4, (0, _constants.gridSize)() / 2);
55
57
  var itemSpacing = (0, _constants.gridSize)() / 2;
56
58
  exports.itemSpacing = itemSpacing;
57
59
  var DropdownButtonItem = _menu.ButtonItem;
58
60
 
61
+ var DropdownMenuItem = function DropdownMenuItem(_ref) {
62
+ var item = _ref.item,
63
+ hide = _ref.hide,
64
+ dispatchCommand = _ref.dispatchCommand,
65
+ editorView = _ref.editorView,
66
+ iconBefore = _ref.iconBefore;
67
+
68
+ var _useState = (0, _react.useState)(item.tooltip || ''),
69
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
70
+ tooltipContent = _useState2[0],
71
+ setTooltipContent = _useState2[1];
72
+
73
+ var handleTooltipMouseOut = (0, _react.useCallback)(function () {
74
+ setTooltipContent('');
75
+ }, []);
76
+ var handleItemMouseDown = (0, _react.useCallback)(function (e) {
77
+ e.preventDefault();
78
+ }, []);
79
+ var handleItemMouseOver = (0, _react.useCallback)(function (e) {
80
+ setTooltipContent(item.tooltip || '');
81
+
82
+ if (item.onMouseOver) {
83
+ e.preventDefault();
84
+ dispatchCommand(item.onMouseOver);
85
+ }
86
+ }, [item.tooltip, item.onMouseOver, dispatchCommand]);
87
+ var handleItemMouseEnter = (0, _react.useCallback)(function (e) {
88
+ if (item.onMouseEnter) {
89
+ e.preventDefault();
90
+ dispatchCommand(item.onMouseEnter);
91
+ }
92
+ }, [item.onMouseEnter, dispatchCommand]);
93
+ var handleItemMouseLeave = (0, _react.useCallback)(function (e) {
94
+ if (item.onMouseLeave) {
95
+ e.preventDefault();
96
+ dispatchCommand(item.onMouseLeave);
97
+ }
98
+ }, [item.onMouseLeave, dispatchCommand]);
99
+ var handleItemOnFocus = (0, _react.useCallback)(function (e) {
100
+ if (item.onFocus) {
101
+ e.preventDefault();
102
+ dispatchCommand(item.onFocus);
103
+ }
104
+ }, [item.onFocus, dispatchCommand]);
105
+ var handleItemOnBlur = (0, _react.useCallback)(function (e) {
106
+ if (item.onBlur) {
107
+ e.preventDefault();
108
+ dispatchCommand(item.onBlur);
109
+ }
110
+ }, [item.onBlur, dispatchCommand]);
111
+ var handleItemClick = (0, _react.useCallback)(function () {
112
+ /**
113
+ * The order of dispatching the event and hide() is important, because
114
+ * the ClickAreaBlock will be relying on the element to calculate the
115
+ * click coordinate.
116
+ * For more details, please visit the comment in this PR https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5328/edm-1321-set-selection-near-smart-link?link_source=email#chg-packages/editor/editor-core/src/plugins/floating-toolbar/ui/DropdownMenu.tsx
117
+ */
118
+ dispatchCommand(item.onClick);
119
+ hide();
120
+
121
+ if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
122
+ editorView === null || editorView === void 0 ? void 0 : editorView.focus();
123
+ }
124
+ }, [dispatchCommand, item.onClick, hide, editorView]);
125
+ var itemContent = (0, _react2.jsx)(DropdownButtonItem, {
126
+ iconBefore: iconBefore,
127
+ iconAfter: item.elemAfter,
128
+ onClick: handleItemClick,
129
+ "data-testid": item.testId,
130
+ isDisabled: item.disabled,
131
+ onMouseDown: handleItemMouseDown,
132
+ onMouseOver: handleItemMouseOver,
133
+ onMouseEnter: handleItemMouseEnter,
134
+ onMouseLeave: handleItemMouseLeave,
135
+ onFocus: handleItemOnFocus,
136
+ onBlur: handleItemOnBlur
137
+ }, item.title);
138
+
139
+ if (tooltipContent) {
140
+ return (0, _react2.jsx)(_tooltip.default, {
141
+ content: tooltipContent
142
+ }, (0, _react2.jsx)("div", {
143
+ onMouseOut: handleTooltipMouseOut
144
+ }, itemContent));
145
+ }
146
+
147
+ return itemContent;
148
+ };
149
+
59
150
  var Dropdown = /*#__PURE__*/function (_Component) {
60
151
  (0, _inherits2.default)(Dropdown, _Component);
61
152
 
@@ -75,59 +166,21 @@ var Dropdown = /*#__PURE__*/function (_Component) {
75
166
  hide = _this$props.hide,
76
167
  dispatchCommand = _this$props.dispatchCommand,
77
168
  items = _this$props.items,
78
- intl = _this$props.intl;
79
- return (0, _react.jsx)("div", {
169
+ intl = _this$props.intl,
170
+ editorView = _this$props.editorView;
171
+ return (0, _react2.jsx)("div", {
80
172
  css: menuContainer
81
173
  }, items.filter(function (item) {
82
174
  return !item.hidden;
83
175
  }).map(function (item, idx) {
84
- var itemContent = (0, _react.jsx)(DropdownButtonItem, {
176
+ return (0, _react2.jsx)(DropdownMenuItem, {
85
177
  key: idx,
86
- iconBefore: _this.renderSelected(item, intl),
87
- iconAfter: item.elemAfter,
88
- onClick: function onClick() {
89
- /**
90
- * The order of dispatching the event and hide() is important, because
91
- * the ClickAreaBlock will be relying on the element to calculate the
92
- * click coordinate.
93
- * For more details, please visit the comment in this PR https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5328/edm-1321-set-selection-near-smart-link?link_source=email#chg-packages/editor/editor-core/src/plugins/floating-toolbar/ui/DropdownMenu.tsx
94
- */
95
- dispatchCommand(item.onClick);
96
- hide();
97
- },
98
- "data-testid": item.testId,
99
- isDisabled: item.disabled,
100
- onMouseDown: function onMouseDown(e) {
101
- e.preventDefault();
102
- },
103
- onMouseOver: function onMouseOver(e) {
104
- if (item.onMouseOver) {
105
- e.preventDefault();
106
- dispatchCommand(item.onMouseOver);
107
- }
108
- },
109
- onMouseEnter: function onMouseEnter(e) {
110
- if (item.onMouseEnter) {
111
- e.preventDefault();
112
- dispatchCommand(item.onMouseEnter);
113
- }
114
- },
115
- onMouseLeave: function onMouseLeave(e) {
116
- if (item.onMouseLeave) {
117
- e.preventDefault();
118
- dispatchCommand(item.onMouseLeave);
119
- }
120
- }
121
- }, item.title);
122
-
123
- if (item.tooltip) {
124
- return (0, _react.jsx)(_tooltip.default, {
125
- key: idx,
126
- content: item.tooltip
127
- }, itemContent);
128
- }
129
-
130
- return itemContent;
178
+ item: item,
179
+ hide: hide,
180
+ dispatchCommand: dispatchCommand,
181
+ editorView: editorView,
182
+ iconBefore: _this.renderSelected(item, intl)
183
+ });
131
184
  }));
132
185
  }
133
186
  }, {
@@ -138,20 +191,20 @@ var Dropdown = /*#__PURE__*/function (_Component) {
138
191
  var selected = item.selected;
139
192
 
140
193
  if (showSelected && selected) {
141
- return (0, _react.jsx)(_done.default, {
194
+ return (0, _react2.jsx)(_done.default, {
142
195
  primaryColor: (0, _tokens.token)('color.icon.selected', _colors.B400),
143
196
  size: "small",
144
197
  label: intl.formatMessage(_messages.default.confirmModalOK)
145
198
  });
146
199
  }
147
200
 
148
- return (0, _react.jsx)("span", {
201
+ return (0, _react2.jsx)("span", {
149
202
  css: spacer
150
203
  });
151
204
  }
152
205
  }]);
153
206
  return Dropdown;
154
- }(_react2.Component);
207
+ }(_react.Component);
155
208
 
156
209
  var _default = (0, _reactIntlNext.injectIntl)(Dropdown);
157
210
 
@@ -37,6 +37,7 @@ var emojiPickerButtonWrapper = (0, _react.css)(_templateObject || (_templateObje
37
37
  // https://product-fabric.atlassian.net/browse/CETI-148
38
38
 
39
39
  var emojiPickerWrapper = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: -12px;\n margin-top: -4px;\n"])));
40
+ var EmojiPickerWithListener = (0, _withOuterListeners.default)(_emoji.EmojiPicker);
40
41
 
41
42
  var EmojiPickerButton = function EmojiPickerButton(props) {
42
43
  var buttonRef = _react2.default.useRef(null);
@@ -46,8 +47,6 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
46
47
  isPopupOpen = _React$useState2[0],
47
48
  setIsPopupOpen = _React$useState2[1];
48
49
 
49
- var EmojiPickerWithListener = (0, _withOuterListeners.default)(_emoji.EmojiPicker);
50
-
51
50
  _react2.default.useEffect(function () {
52
51
  if (props.setDisableParentScroll) {
53
52
  props.setDisableParentScroll(isPopupOpen);