@atlaskit/editor-core 175.0.4 → 176.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 (380) hide show
  1. package/.eslintrc.js +23 -57
  2. package/CHANGELOG.md +76 -0
  3. package/dist/cjs/create-editor/ReactEditorView.js +1 -1
  4. package/dist/cjs/create-editor/create-plugins-list.js +2 -4
  5. package/dist/cjs/keymaps/index.js +0 -6
  6. package/dist/cjs/labs/next/presets/cxhtml.js +1 -3
  7. package/dist/cjs/labs/next/presets/mobile.js +1 -3
  8. package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +12 -5
  9. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  10. package/dist/cjs/plugins/alignment/pm-plugins/keymap.js +0 -1
  11. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +27 -4
  12. package/dist/cjs/plugins/annotation/nodeviews/index.js +7 -35
  13. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +28 -2
  14. package/dist/cjs/plugins/annotation/utils.js +7 -3
  15. package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +1 -0
  16. package/dist/cjs/plugins/caption/nodeviews/index.js +4 -1
  17. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +1 -0
  18. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -1
  19. package/dist/cjs/plugins/code-block/nodeviews/code-block.js +7 -3
  20. package/dist/cjs/plugins/code-block/refresh-browser-selection.js +3 -1
  21. package/dist/cjs/plugins/code-block/styles.js +6 -2
  22. package/dist/cjs/plugins/code-block/ui/class-names.js +2 -0
  23. package/dist/cjs/plugins/collab-edit/utils.js +4 -0
  24. package/dist/cjs/plugins/copy-button/commands.js +5 -3
  25. package/dist/cjs/plugins/emoji/messages.js +17 -0
  26. package/dist/cjs/plugins/emoji/nodeviews/emoji.js +18 -2
  27. package/dist/cjs/plugins/expand/pm-plugins/keymap.js +11 -1
  28. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +17 -13
  29. package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -0
  30. package/dist/cjs/plugins/floating-toolbar/index.js +2 -0
  31. package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +9 -1
  32. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +20 -1
  33. package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +6 -2
  34. package/dist/cjs/plugins/floating-toolbar/ui/Select.js +10 -4
  35. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -0
  36. package/dist/cjs/plugins/help-dialog/ui/index.js +1 -4
  37. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +2 -2
  38. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -9
  39. package/dist/cjs/plugins/media/index.js +2 -2
  40. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +27 -3
  41. package/dist/cjs/plugins/media/pm-plugins/main.js +17 -2
  42. package/dist/cjs/plugins/media/toolbar/alt-text.js +1 -0
  43. package/dist/cjs/plugins/media/toolbar/linking.js +1 -0
  44. package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +9 -6
  45. package/dist/cjs/plugins/media/ui/ToolbarMedia/toolbar-media-messages.js +2 -2
  46. package/dist/cjs/plugins/mentions/messages.js +5 -0
  47. package/dist/cjs/plugins/mentions/nodeviews/mention.js +18 -2
  48. package/dist/cjs/plugins/mentions/styles.js +1 -1
  49. package/dist/cjs/plugins/mentions/ui/Mention/index.js +15 -0
  50. package/dist/cjs/plugins/panel/actions.js +1 -1
  51. package/dist/cjs/plugins/panel/index.js +1 -0
  52. package/dist/cjs/plugins/panel/toolbar.js +2 -2
  53. package/dist/cjs/plugins/paste/index.js +2 -3
  54. package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -2
  55. package/dist/cjs/plugins/quick-insert/assets/action.js +3 -0
  56. package/dist/cjs/plugins/quick-insert/assets/code.js +3 -0
  57. package/dist/cjs/plugins/quick-insert/assets/custom-panel.js +3 -0
  58. package/dist/cjs/plugins/quick-insert/assets/date.js +3 -0
  59. package/dist/cjs/plugins/quick-insert/assets/decision.js +3 -0
  60. package/dist/cjs/plugins/quick-insert/assets/divider.js +3 -0
  61. package/dist/cjs/plugins/quick-insert/assets/emoji.js +3 -0
  62. package/dist/cjs/plugins/quick-insert/assets/expand.js +3 -0
  63. package/dist/cjs/plugins/quick-insert/assets/fallback.js +3 -0
  64. package/dist/cjs/plugins/quick-insert/assets/feedback.js +3 -0
  65. package/dist/cjs/plugins/quick-insert/assets/heading1.js +3 -0
  66. package/dist/cjs/plugins/quick-insert/assets/heading2.js +3 -0
  67. package/dist/cjs/plugins/quick-insert/assets/heading3.js +3 -0
  68. package/dist/cjs/plugins/quick-insert/assets/heading4.js +3 -0
  69. package/dist/cjs/plugins/quick-insert/assets/heading5.js +3 -0
  70. package/dist/cjs/plugins/quick-insert/assets/heading6.js +3 -0
  71. package/dist/cjs/plugins/quick-insert/assets/images.js +3 -0
  72. package/dist/cjs/plugins/quick-insert/assets/layout.js +3 -0
  73. package/dist/cjs/plugins/quick-insert/assets/link.js +3 -0
  74. package/dist/cjs/plugins/quick-insert/assets/list-number.js +3 -0
  75. package/dist/cjs/plugins/quick-insert/assets/list.js +3 -0
  76. package/dist/cjs/plugins/quick-insert/assets/mention.js +3 -0
  77. package/dist/cjs/plugins/quick-insert/assets/panel-error.js +3 -0
  78. package/dist/cjs/plugins/quick-insert/assets/panel-note.js +3 -0
  79. package/dist/cjs/plugins/quick-insert/assets/panel-success.js +3 -0
  80. package/dist/cjs/plugins/quick-insert/assets/panel-warning.js +3 -0
  81. package/dist/cjs/plugins/quick-insert/assets/panel.js +3 -0
  82. package/dist/cjs/plugins/quick-insert/assets/quote.js +3 -0
  83. package/dist/cjs/plugins/quick-insert/assets/status.js +3 -0
  84. package/dist/cjs/plugins/selection/gap-cursor/actions.js +26 -3
  85. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +41 -4
  86. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/styles.js +6 -1
  87. package/dist/cjs/plugins/text-color/utils/color.js +3 -0
  88. package/dist/cjs/plugins/type-ahead/commands/insert-type-ahead-item.js +4 -3
  89. package/dist/cjs/plugins/type-ahead/index.js +42 -22
  90. package/dist/cjs/plugins/type-ahead/messages.js +13 -3
  91. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +25 -16
  92. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +126 -64
  93. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +12 -14
  94. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +37 -14
  95. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +36 -5
  96. package/dist/cjs/plugins/type-ahead/utils.js +3 -1
  97. package/dist/cjs/ui/Alignment/index.js +0 -1
  98. package/dist/cjs/ui/Appearance/Chromeless.js +1 -1
  99. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
  100. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +6 -2
  101. package/dist/cjs/ui/ColorPickerButton/index.js +4 -0
  102. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -4
  103. package/dist/cjs/ui/ConfigPanel/Fields/Select.js +1 -3
  104. package/dist/cjs/ui/Dropdown/index.js +28 -1
  105. package/dist/cjs/ui/DropdownMenu/index.js +25 -1
  106. package/dist/cjs/ui/ElementBrowser/constants.js +0 -1
  107. package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +166 -0
  108. package/dist/cjs/ui/styles.js +12 -18
  109. package/dist/cjs/utils/clipboard.js +17 -12
  110. package/dist/cjs/utils/document.js +13 -0
  111. package/dist/cjs/utils/index.js +0 -9
  112. package/dist/cjs/utils/input-rules.js +7 -5
  113. package/dist/cjs/utils/table.js +35 -0
  114. package/dist/cjs/version-wrapper.js +1 -1
  115. package/dist/cjs/version.json +1 -1
  116. package/dist/es2019/create-editor/ReactEditorView.js +1 -1
  117. package/dist/es2019/create-editor/create-plugins-list.js +2 -4
  118. package/dist/es2019/keymaps/index.js +1 -1
  119. package/dist/es2019/labs/next/presets/cxhtml.js +1 -3
  120. package/dist/es2019/labs/next/presets/mobile.js +1 -3
  121. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +11 -4
  122. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  123. package/dist/es2019/plugins/alignment/pm-plugins/keymap.js +1 -2
  124. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +26 -4
  125. package/dist/es2019/plugins/annotation/nodeviews/index.js +7 -31
  126. package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +24 -3
  127. package/dist/es2019/plugins/annotation/utils.js +8 -4
  128. package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +1 -0
  129. package/dist/es2019/plugins/caption/nodeviews/index.js +4 -1
  130. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +1 -0
  131. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -1
  132. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +7 -3
  133. package/dist/es2019/plugins/code-block/refresh-browser-selection.js +2 -1
  134. package/dist/es2019/plugins/code-block/styles.js +21 -5
  135. package/dist/es2019/plugins/code-block/ui/class-names.js +2 -0
  136. package/dist/es2019/plugins/collab-edit/utils.js +5 -1
  137. package/dist/es2019/plugins/copy-button/commands.js +5 -3
  138. package/dist/es2019/plugins/emoji/messages.js +8 -0
  139. package/dist/es2019/plugins/emoji/nodeviews/emoji.js +16 -2
  140. package/dist/es2019/plugins/expand/pm-plugins/keymap.js +10 -1
  141. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +17 -13
  142. package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -0
  143. package/dist/es2019/plugins/floating-toolbar/index.js +2 -0
  144. package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +9 -1
  145. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +20 -1
  146. package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +3 -2
  147. package/dist/es2019/plugins/floating-toolbar/ui/Select.js +9 -3
  148. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -0
  149. package/dist/es2019/plugins/help-dialog/ui/index.js +1 -2
  150. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +2 -2
  151. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +15 -2
  152. package/dist/es2019/plugins/media/index.js +2 -2
  153. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +25 -4
  154. package/dist/es2019/plugins/media/pm-plugins/main.js +14 -1
  155. package/dist/es2019/plugins/media/toolbar/alt-text.js +1 -0
  156. package/dist/es2019/plugins/media/toolbar/linking.js +1 -0
  157. package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +4 -2
  158. package/dist/es2019/plugins/media/ui/ToolbarMedia/toolbar-media-messages.js +2 -2
  159. package/dist/es2019/plugins/mentions/messages.js +5 -0
  160. package/dist/es2019/plugins/mentions/nodeviews/mention.js +16 -2
  161. package/dist/es2019/plugins/mentions/styles.js +2 -1
  162. package/dist/es2019/plugins/mentions/ui/Mention/index.js +12 -0
  163. package/dist/es2019/plugins/panel/actions.js +2 -2
  164. package/dist/es2019/plugins/panel/index.js +1 -0
  165. package/dist/es2019/plugins/panel/toolbar.js +3 -3
  166. package/dist/es2019/plugins/paste/index.js +2 -3
  167. package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -2
  168. package/dist/es2019/plugins/quick-insert/assets/action.js +3 -0
  169. package/dist/es2019/plugins/quick-insert/assets/code.js +3 -0
  170. package/dist/es2019/plugins/quick-insert/assets/custom-panel.js +3 -0
  171. package/dist/es2019/plugins/quick-insert/assets/date.js +3 -0
  172. package/dist/es2019/plugins/quick-insert/assets/decision.js +3 -0
  173. package/dist/es2019/plugins/quick-insert/assets/divider.js +3 -0
  174. package/dist/es2019/plugins/quick-insert/assets/emoji.js +3 -0
  175. package/dist/es2019/plugins/quick-insert/assets/expand.js +3 -0
  176. package/dist/es2019/plugins/quick-insert/assets/fallback.js +3 -0
  177. package/dist/es2019/plugins/quick-insert/assets/feedback.js +3 -0
  178. package/dist/es2019/plugins/quick-insert/assets/heading1.js +3 -0
  179. package/dist/es2019/plugins/quick-insert/assets/heading2.js +3 -0
  180. package/dist/es2019/plugins/quick-insert/assets/heading3.js +3 -0
  181. package/dist/es2019/plugins/quick-insert/assets/heading4.js +3 -0
  182. package/dist/es2019/plugins/quick-insert/assets/heading5.js +3 -0
  183. package/dist/es2019/plugins/quick-insert/assets/heading6.js +3 -0
  184. package/dist/es2019/plugins/quick-insert/assets/images.js +3 -0
  185. package/dist/es2019/plugins/quick-insert/assets/layout.js +3 -0
  186. package/dist/es2019/plugins/quick-insert/assets/link.js +3 -0
  187. package/dist/es2019/plugins/quick-insert/assets/list-number.js +3 -0
  188. package/dist/es2019/plugins/quick-insert/assets/list.js +3 -0
  189. package/dist/es2019/plugins/quick-insert/assets/mention.js +3 -0
  190. package/dist/es2019/plugins/quick-insert/assets/panel-error.js +3 -0
  191. package/dist/es2019/plugins/quick-insert/assets/panel-note.js +3 -0
  192. package/dist/es2019/plugins/quick-insert/assets/panel-success.js +3 -0
  193. package/dist/es2019/plugins/quick-insert/assets/panel-warning.js +3 -0
  194. package/dist/es2019/plugins/quick-insert/assets/panel.js +3 -0
  195. package/dist/es2019/plugins/quick-insert/assets/quote.js +3 -0
  196. package/dist/es2019/plugins/quick-insert/assets/status.js +3 -0
  197. package/dist/es2019/plugins/selection/gap-cursor/actions.js +26 -5
  198. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +42 -4
  199. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/styles.js +6 -1
  200. package/dist/es2019/plugins/text-color/utils/color.js +3 -0
  201. package/dist/es2019/plugins/type-ahead/commands/insert-type-ahead-item.js +4 -3
  202. package/dist/es2019/plugins/type-ahead/index.js +17 -4
  203. package/dist/es2019/plugins/type-ahead/messages.js +13 -3
  204. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +24 -16
  205. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +108 -61
  206. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +12 -14
  207. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +32 -8
  208. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +42 -7
  209. package/dist/es2019/plugins/type-ahead/utils.js +3 -1
  210. package/dist/es2019/ui/Alignment/index.js +1 -2
  211. package/dist/es2019/ui/Appearance/Chromeless.js +4 -0
  212. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +1 -1
  213. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +5 -2
  214. package/dist/es2019/ui/ColorPickerButton/index.js +4 -0
  215. package/dist/es2019/ui/ConfigPanel/Fields/CustomSelect.js +2 -4
  216. package/dist/es2019/ui/ConfigPanel/Fields/Select.js +1 -3
  217. package/dist/es2019/ui/Dropdown/index.js +16 -1
  218. package/dist/es2019/ui/DropdownMenu/index.js +13 -1
  219. package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
  220. package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +148 -0
  221. package/dist/es2019/ui/styles.js +1 -7
  222. package/dist/es2019/utils/clipboard.js +11 -9
  223. package/dist/es2019/utils/document.js +14 -1
  224. package/dist/es2019/utils/index.js +0 -7
  225. package/dist/es2019/utils/input-rules.js +4 -3
  226. package/dist/es2019/utils/table.js +28 -0
  227. package/dist/es2019/version-wrapper.js +1 -1
  228. package/dist/es2019/version.json +1 -1
  229. package/dist/esm/create-editor/ReactEditorView.js +1 -1
  230. package/dist/esm/create-editor/create-plugins-list.js +2 -4
  231. package/dist/esm/keymaps/index.js +1 -1
  232. package/dist/esm/labs/next/presets/cxhtml.js +1 -3
  233. package/dist/esm/labs/next/presets/mobile.js +1 -3
  234. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +11 -4
  235. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
  236. package/dist/esm/plugins/alignment/pm-plugins/keymap.js +1 -2
  237. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +29 -4
  238. package/dist/esm/plugins/annotation/nodeviews/index.js +7 -33
  239. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +28 -3
  240. package/dist/esm/plugins/annotation/utils.js +8 -4
  241. package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +1 -0
  242. package/dist/esm/plugins/caption/nodeviews/index.js +4 -1
  243. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +1 -0
  244. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -1
  245. package/dist/esm/plugins/code-block/nodeviews/code-block.js +7 -3
  246. package/dist/esm/plugins/code-block/refresh-browser-selection.js +2 -1
  247. package/dist/esm/plugins/code-block/styles.js +7 -2
  248. package/dist/esm/plugins/code-block/ui/class-names.js +2 -0
  249. package/dist/esm/plugins/collab-edit/utils.js +5 -2
  250. package/dist/esm/plugins/copy-button/commands.js +5 -3
  251. package/dist/esm/plugins/emoji/messages.js +8 -0
  252. package/dist/esm/plugins/emoji/nodeviews/emoji.js +15 -2
  253. package/dist/esm/plugins/expand/pm-plugins/keymap.js +10 -1
  254. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +17 -13
  255. package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -0
  256. package/dist/esm/plugins/floating-toolbar/index.js +2 -0
  257. package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -1
  258. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +20 -1
  259. package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +5 -2
  260. package/dist/esm/plugins/floating-toolbar/ui/Select.js +9 -3
  261. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -0
  262. package/dist/esm/plugins/help-dialog/ui/index.js +1 -4
  263. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +2 -2
  264. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +23 -9
  265. package/dist/esm/plugins/media/index.js +2 -2
  266. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +25 -4
  267. package/dist/esm/plugins/media/pm-plugins/main.js +14 -1
  268. package/dist/esm/plugins/media/toolbar/alt-text.js +1 -0
  269. package/dist/esm/plugins/media/toolbar/linking.js +1 -0
  270. package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
  271. package/dist/esm/plugins/media/ui/ToolbarMedia/toolbar-media-messages.js +2 -2
  272. package/dist/esm/plugins/mentions/messages.js +5 -0
  273. package/dist/esm/plugins/mentions/nodeviews/mention.js +15 -2
  274. package/dist/esm/plugins/mentions/styles.js +1 -1
  275. package/dist/esm/plugins/mentions/ui/Mention/index.js +13 -0
  276. package/dist/esm/plugins/panel/actions.js +2 -2
  277. package/dist/esm/plugins/panel/index.js +1 -0
  278. package/dist/esm/plugins/panel/toolbar.js +3 -3
  279. package/dist/esm/plugins/paste/index.js +2 -3
  280. package/dist/esm/plugins/paste/pm-plugins/main.js +2 -2
  281. package/dist/esm/plugins/quick-insert/assets/action.js +3 -0
  282. package/dist/esm/plugins/quick-insert/assets/code.js +3 -0
  283. package/dist/esm/plugins/quick-insert/assets/custom-panel.js +3 -0
  284. package/dist/esm/plugins/quick-insert/assets/date.js +3 -0
  285. package/dist/esm/plugins/quick-insert/assets/decision.js +3 -0
  286. package/dist/esm/plugins/quick-insert/assets/divider.js +3 -0
  287. package/dist/esm/plugins/quick-insert/assets/emoji.js +3 -0
  288. package/dist/esm/plugins/quick-insert/assets/expand.js +3 -0
  289. package/dist/esm/plugins/quick-insert/assets/fallback.js +3 -0
  290. package/dist/esm/plugins/quick-insert/assets/feedback.js +3 -0
  291. package/dist/esm/plugins/quick-insert/assets/heading1.js +3 -0
  292. package/dist/esm/plugins/quick-insert/assets/heading2.js +3 -0
  293. package/dist/esm/plugins/quick-insert/assets/heading3.js +3 -0
  294. package/dist/esm/plugins/quick-insert/assets/heading4.js +3 -0
  295. package/dist/esm/plugins/quick-insert/assets/heading5.js +3 -0
  296. package/dist/esm/plugins/quick-insert/assets/heading6.js +3 -0
  297. package/dist/esm/plugins/quick-insert/assets/images.js +3 -0
  298. package/dist/esm/plugins/quick-insert/assets/layout.js +3 -0
  299. package/dist/esm/plugins/quick-insert/assets/link.js +3 -0
  300. package/dist/esm/plugins/quick-insert/assets/list-number.js +3 -0
  301. package/dist/esm/plugins/quick-insert/assets/list.js +3 -0
  302. package/dist/esm/plugins/quick-insert/assets/mention.js +3 -0
  303. package/dist/esm/plugins/quick-insert/assets/panel-error.js +3 -0
  304. package/dist/esm/plugins/quick-insert/assets/panel-note.js +3 -0
  305. package/dist/esm/plugins/quick-insert/assets/panel-success.js +3 -0
  306. package/dist/esm/plugins/quick-insert/assets/panel-warning.js +3 -0
  307. package/dist/esm/plugins/quick-insert/assets/panel.js +3 -0
  308. package/dist/esm/plugins/quick-insert/assets/quote.js +3 -0
  309. package/dist/esm/plugins/quick-insert/assets/status.js +3 -0
  310. package/dist/esm/plugins/selection/gap-cursor/actions.js +24 -5
  311. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +44 -4
  312. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/styles.js +6 -1
  313. package/dist/esm/plugins/text-color/utils/color.js +3 -0
  314. package/dist/esm/plugins/type-ahead/commands/insert-type-ahead-item.js +4 -3
  315. package/dist/esm/plugins/type-ahead/index.js +35 -22
  316. package/dist/esm/plugins/type-ahead/messages.js +13 -3
  317. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +24 -16
  318. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +124 -64
  319. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +12 -14
  320. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +35 -14
  321. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +38 -7
  322. package/dist/esm/plugins/type-ahead/utils.js +3 -1
  323. package/dist/esm/ui/Alignment/index.js +1 -2
  324. package/dist/esm/ui/Appearance/Chromeless.js +1 -1
  325. package/dist/esm/ui/Appearance/Comment/Toolbar.js +1 -1
  326. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +5 -2
  327. package/dist/esm/ui/ColorPickerButton/index.js +4 -0
  328. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +2 -4
  329. package/dist/esm/ui/ConfigPanel/Fields/Select.js +1 -3
  330. package/dist/esm/ui/Dropdown/index.js +17 -1
  331. package/dist/esm/ui/DropdownMenu/index.js +14 -1
  332. package/dist/esm/ui/ElementBrowser/constants.js +0 -1
  333. package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +147 -0
  334. package/dist/esm/ui/styles.js +12 -16
  335. package/dist/esm/utils/clipboard.js +17 -12
  336. package/dist/esm/utils/document.js +14 -1
  337. package/dist/esm/utils/index.js +0 -7
  338. package/dist/esm/utils/input-rules.js +4 -3
  339. package/dist/esm/utils/table.js +28 -0
  340. package/dist/esm/version-wrapper.js +1 -1
  341. package/dist/esm/version.json +1 -1
  342. package/dist/types/keymaps/index.d.ts +1 -1
  343. package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +2 -0
  344. package/dist/types/plugins/annotation/utils.d.ts +2 -2
  345. package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +2 -0
  346. package/dist/types/plugins/code-block/refresh-browser-selection.d.ts +2 -0
  347. package/dist/types/plugins/code-block/ui/class-names.d.ts +2 -0
  348. package/dist/types/plugins/emoji/messages.d.ts +7 -0
  349. package/dist/types/plugins/extension/index.d.ts +0 -1
  350. package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
  351. package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +6 -0
  352. package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -0
  353. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +3 -1
  354. package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +1 -0
  355. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +4 -1
  356. package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
  357. package/dist/types/plugins/media/ui/CaptionPlaceholder/index.d.ts +3 -3
  358. package/dist/types/plugins/mentions/messages.d.ts +5 -0
  359. package/dist/types/plugins/mentions/ui/Mention/index.d.ts +1 -0
  360. package/dist/types/plugins/paste/index.d.ts +1 -2
  361. package/dist/types/plugins/paste/pm-plugins/main.d.ts +1 -1
  362. package/dist/types/plugins/selection/gap-cursor/actions.d.ts +2 -0
  363. package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +3 -0
  364. package/dist/types/plugins/type-ahead/messages.d.ts +10 -0
  365. package/dist/types/plugins/type-ahead/ui/TypeAheadPopup.d.ts +7 -1
  366. package/dist/types/plugins/type-ahead/utils.d.ts +1 -0
  367. package/dist/types/types/extension-config.d.ts +0 -1
  368. package/dist/types/ui/ConfigPanel/Fields/SelectItem.d.ts +1 -1
  369. package/dist/types/ui/Dropdown/index.d.ts +6 -1
  370. package/dist/types/ui/DropdownMenu/index.d.ts +2 -1
  371. package/dist/types/ui/ElementBrowser/types.d.ts +3 -1
  372. package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +18 -0
  373. package/dist/types/ui/styles.d.ts +0 -1
  374. package/dist/types/utils/clipboard.d.ts +1 -1
  375. package/dist/types/utils/index.d.ts +0 -4
  376. package/dist/types/utils/input-rules.d.ts +2 -2
  377. package/dist/types/utils/table.d.ts +3 -0
  378. package/docs/3-annotations.tsx +1 -0
  379. package/package.json +27 -25
  380. package/report.api.md +74 -74
@@ -1,9 +1,8 @@
1
1
  import { keymap } from 'prosemirror-keymap';
2
- import { bindKeymapWithCommand, alignLeft, alignRight } from '../../../keymaps';
2
+ import { bindKeymapWithCommand, alignLeft } from '../../../keymaps';
3
3
  import { changeAlignment } from '../commands';
4
4
  export function keymapPlugin() {
5
5
  const list = {};
6
6
  bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
7
- bindKeymapWithCommand(alignRight.common, changeAlignment('end'), list);
8
7
  return keymap(list);
9
8
  }
@@ -15,6 +15,8 @@ export class AlignmentToolbar extends React.Component {
15
15
  constructor(...args) {
16
16
  super(...args);
17
17
 
18
+ _defineProperty(this, "toolbarItemRef", /*#__PURE__*/React.createRef());
19
+
18
20
  _defineProperty(this, "state", {
19
21
  isOpen: false
20
22
  });
@@ -38,13 +40,27 @@ export class AlignmentToolbar extends React.Component {
38
40
  });
39
41
  });
40
42
 
41
- _defineProperty(this, "hide", () => {
43
+ _defineProperty(this, "hide", attrs => {
42
44
  if (this.state.isOpen) {
43
45
  this.setState({
44
46
  isOpen: false
45
47
  });
48
+
49
+ if ((attrs === null || attrs === void 0 ? void 0 : attrs.event) instanceof KeyboardEvent && attrs.event.key === 'Escape') {
50
+ var _this$toolbarItemRef, _this$toolbarItemRef$;
51
+
52
+ (_this$toolbarItemRef = this.toolbarItemRef) === null || _this$toolbarItemRef === void 0 ? void 0 : (_this$toolbarItemRef$ = _this$toolbarItemRef.current) === null || _this$toolbarItemRef$ === void 0 ? void 0 : _this$toolbarItemRef$.focus();
53
+ }
46
54
  }
47
55
  });
56
+
57
+ _defineProperty(this, "hideonEsc", () => {
58
+ var _this$toolbarItemRef2, _this$toolbarItemRef3;
59
+
60
+ this.hide(); //To set the focus on the textcolor button when the menu is closed by 'Esc' only (aria guidelines)
61
+
62
+ (_this$toolbarItemRef2 = this.toolbarItemRef) === null || _this$toolbarItemRef2 === void 0 ? void 0 : (_this$toolbarItemRef3 = _this$toolbarItemRef2.current) === null || _this$toolbarItemRef3 === void 0 ? void 0 : _this$toolbarItemRef3.focus();
63
+ });
48
64
  }
49
65
 
50
66
  render() {
@@ -68,10 +84,15 @@ export class AlignmentToolbar extends React.Component {
68
84
  boundariesElement: popupsBoundariesElement,
69
85
  scrollableElement: popupsScrollableElement,
70
86
  isOpen: isOpen,
71
- handleClickOutside: this.hide,
72
- handleEscapeKeydown: this.hide,
87
+ handleClickOutside: event => this.hide({
88
+ isOpen: false,
89
+ event
90
+ }),
91
+ handleEscapeKeydown: this.hideonEsc,
92
+ onOpenChange: this.hide,
73
93
  fitWidth: 112,
74
94
  fitHeight: 80,
95
+ closeonTab: true,
75
96
  trigger: jsx(ToolbarButton, {
76
97
  spacing: isReducedSpacing ? 'none' : 'default',
77
98
  disabled: disabled,
@@ -90,7 +111,8 @@ export class AlignmentToolbar extends React.Component {
90
111
  css: expandIconWrapper
91
112
  }, jsx(ExpandIcon, {
92
113
  label: ""
93
- })))
114
+ }))),
115
+ ref: this.toolbarItemRef
94
116
  })
95
117
  }, jsx(Alignment, {
96
118
  onClick: align => this.changeAlignment(align),
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
3
3
  import { ReactNodeView } from '../../../nodeviews';
4
- import WithPluginState from '../../../ui/WithPluginState';
5
- import { inlineCommentPluginKey } from '../utils';
6
4
  export class AnnotationNodeView extends ReactNodeView {
7
5
  createDomRef() {
8
6
  return document.createElement('span');
@@ -17,35 +15,13 @@ export class AnnotationNodeView extends ReactNodeView {
17
15
  }
18
16
 
19
17
  render(_props, forwardRef) {
20
- return /*#__PURE__*/React.createElement(WithPluginState, {
21
- plugins: {
22
- inlineCommentState: inlineCommentPluginKey
23
- },
24
- editorView: this.view,
25
- render: ({
26
- inlineCommentState
27
- }) => {
28
- if (!(inlineCommentState !== null && inlineCommentState !== void 0 && inlineCommentState.isVisible)) {
29
- return /*#__PURE__*/React.createElement("span", {
30
- ref: forwardRef
31
- });
32
- } // Check if selection includes current annotation ID
33
-
34
-
35
- const {
36
- annotations,
37
- selectedAnnotations
38
- } = inlineCommentState;
39
- const id = this.node.attrs.id;
40
- const isUnresolved = annotations[id] === false;
41
- const annotationHasFocus = selectedAnnotations.some(x => x.id === id);
42
- const className = getAnnotationViewClassname(isUnresolved, annotationHasFocus);
43
- return /*#__PURE__*/React.createElement("span", {
44
- className: className,
45
- ref: forwardRef
46
- });
47
- }
48
- });
18
+ return (
19
+ /*#__PURE__*/
20
+ // all inline comment states are now set in decorations at ../pm-plugins/inline-comment.ts
21
+ React.createElement("span", {
22
+ ref: forwardRef
23
+ })
24
+ );
49
25
  }
50
26
 
51
27
  }
@@ -1,7 +1,8 @@
1
1
  import { RESOLVE_METHOD } from './../../analytics/types/inline-comment-events';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { Decoration, DecorationSet } from 'prosemirror-view';
3
4
  import { AnnotationTypes } from '@atlaskit/adf-schema';
4
- import { AnnotationNodeView } from '../nodeviews';
5
+ import { AnnotationNodeView, getAnnotationViewClassname } from '../nodeviews';
5
6
  import { updateInlineCommentResolvedState, updateMouseState, clearDirtyMark, setInlineCommentsVisibility } from '../commands';
6
7
  import { getAllAnnotations, inlineCommentPluginKey, getPluginState } from '../utils';
7
8
  import { createPluginState } from './plugin-factory';
@@ -166,10 +167,30 @@ export const inlineCommentPlugin = options => {
166
167
  },
167
168
 
168
169
  decorations(state) {
170
+ // highlight comments, depending on state
169
171
  const {
170
- draftDecorationSet
172
+ draftDecorationSet,
173
+ annotations,
174
+ selectedAnnotations,
175
+ isVisible
171
176
  } = getPluginState(state);
172
- return draftDecorationSet;
177
+ let decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : DecorationSet.empty;
178
+ const focusDecorations = [];
179
+ state.doc.descendants((node, pos) => {
180
+ node.marks.filter(mark => mark.type === state.schema.marks.annotation).forEach(mark => {
181
+ const isSelected = selectedAnnotations.some(selectedAnnotation => selectedAnnotation.id === mark.attrs.id);
182
+ const isUnresolved = annotations[mark.attrs.id] === false;
183
+
184
+ if (isVisible) {
185
+ focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
186
+ class: `${getAnnotationViewClassname(isUnresolved, isSelected)} ${isUnresolved}`,
187
+ nodeName: 'span'
188
+ }));
189
+ }
190
+ });
191
+ });
192
+ decorations = decorations.add(state.doc, focusDecorations);
193
+ return decorations;
173
194
  }
174
195
 
175
196
  }
@@ -4,7 +4,7 @@ import { AnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
4
4
  import { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from '@atlaskit/editor-common/utils';
5
5
  import { AnnotationTypes } from '@atlaskit/adf-schema';
6
6
  import { AnnotationSelectionType } from './types';
7
- import { sum } from '../../utils';
7
+ import { isText, isParagraph, sum } from '../../utils';
8
8
  import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION } from '../analytics';
9
9
 
10
10
  /**
@@ -255,7 +255,7 @@ export const isSelectionValid = state => {
255
255
  return AnnotationSelectionType.DISABLED;
256
256
  }
257
257
 
258
- if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection)) {
258
+ if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection, state.schema)) {
259
259
  return AnnotationSelectionType.INVALID;
260
260
  }
261
261
 
@@ -308,10 +308,14 @@ function isEmptyTextSelection(selection, schema) {
308
308
  */
309
309
 
310
310
 
311
- export function hasInvalidWhitespaceNode(selection) {
311
+ export function hasInvalidWhitespaceNode(selection, schema) {
312
312
  let foundInvalidWhitespace = false;
313
313
  const content = selection.content().content;
314
314
  content.descendants(node => {
315
+ if (isText(node, schema)) {
316
+ return false;
317
+ }
318
+
315
319
  if (node.textContent.trim() === '') {
316
320
  // Trailing new lines do not result in the annotation spanning into
317
321
  // the trailing new line so can be ignored when looking for invalid
@@ -319,7 +323,7 @@ export function hasInvalidWhitespaceNode(selection) {
319
323
  const nodeIsTrailingNewLine = // it is the final node
320
324
  node.eq(content.lastChild) && // and there are multiple nodes
321
325
  !node.eq(content.firstChild) && // and it is a paragraph node
322
- node.type.name === 'paragraph';
326
+ isParagraph(node, schema);
323
327
 
324
328
  if (!nodeIsTrailingNewLine) {
325
329
  foundInvalidWhitespace = true;
@@ -44,6 +44,7 @@ export default (() => {
44
44
  const createWidget = side => {
45
45
  const node = document.createElement('span');
46
46
  node.contentEditable = 'true';
47
+ node.setAttribute('aria-hidden', 'true');
47
48
  node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE));
48
49
  node.className = 'cursor-target';
49
50
  return Decoration.widget(selection.from, node, {
@@ -16,7 +16,10 @@ export class CaptionNodeView extends SelectionBasedNodeView {
16
16
  }
17
17
 
18
18
  getContentDOM() {
19
- const dom = document.createElement('div');
19
+ const dom = document.createElement('div'); // setting a className prevents PM/Chrome mutation observer from
20
+ // incorrectly deleting nodes
21
+
22
+ dom.className = 'caption-wrapper';
20
23
  return {
21
24
  dom
22
25
  };
@@ -73,6 +73,7 @@ export const buildEditLinkToolbar = ({
73
73
  return {
74
74
  type: 'custom',
75
75
  fallback: [],
76
+ disableArrowNavigation: true,
76
77
  render: (view, idx) => {
77
78
  if (!view || !providerFactory) {
78
79
  return null;
@@ -65,8 +65,9 @@ const getCustomStyles = (selected, disabled) => {
65
65
  return [primitiveStyles, unselectedStyles, interactiveStyles];
66
66
  };
67
67
 
68
+ //tabindex is -1 as the menu options should be focusable explicitly only by arrow keys.
68
69
  const OptionRoot = props => jsx("div", _extends({}, props, {
69
- tabIndex: 0
70
+ tabIndex: -1
70
71
  }));
71
72
 
72
73
  const Option = ({
@@ -13,6 +13,8 @@ const toDOM = node => ['div', {
13
13
  class: codeBlockClassNames.start,
14
14
  contenteditable: 'false'
15
15
  }], ['div', {
16
+ class: codeBlockClassNames.contentWrapper
17
+ }, ['div', {
16
18
  class: codeBlockClassNames.gutter,
17
19
  contenteditable: 'false'
18
20
  }], ['div', {
@@ -22,7 +24,7 @@ const toDOM = node => ['div', {
22
24
  spellcheck: 'false',
23
25
  contenteditable: 'true',
24
26
  'data-testid': 'code-block--code'
25
- }, 0]], ['div', {
27
+ }, 0]]], ['div', {
26
28
  class: codeBlockClassNames.end,
27
29
  contenteditable: 'false'
28
30
  }]];
@@ -67,7 +69,8 @@ export class CodeBlockView {
67
69
  if ((_this$dom = this.dom) !== null && _this$dom !== void 0 && _this$dom.childNodes && this.dom.childNodes.length > 1) {
68
70
  var _contentView$childNod;
69
71
 
70
- const contentView = this.dom.childNodes[1];
72
+ const contentWrapper = this.dom.childNodes[1];
73
+ const contentView = contentWrapper === null || contentWrapper === void 0 ? void 0 : contentWrapper.childNodes[1];
71
74
 
72
75
  if ((contentView === null || contentView === void 0 ? void 0 : (_contentView$childNod = contentView.childNodes) === null || _contentView$childNod === void 0 ? void 0 : _contentView$childNod.length) > 0) {
73
76
  const codeElement = contentView.firstChild;
@@ -88,7 +91,8 @@ export class CodeBlockView {
88
91
  var _this$dom2;
89
92
 
90
93
  if ((_this$dom2 = this.dom) !== null && _this$dom2 !== void 0 && _this$dom2.childNodes && this.dom.childNodes.length > 1) {
91
- const contentView = this.dom.childNodes[1];
94
+ const contentWrapper = this.dom.childNodes[1];
95
+ const contentView = contentWrapper === null || contentWrapper === void 0 ? void 0 : contentWrapper.childNodes[1];
92
96
 
93
97
  if (contentView !== null && contentView !== void 0 && contentView.childNodes && contentView.childNodes.length > 1) {
94
98
  let savedInnerHTML = '';
@@ -24,4 +24,5 @@ const refreshBrowserSelectionOnChange = (transaction, editorState) => {
24
24
  }
25
25
  };
26
26
 
27
- export default refreshBrowserSelectionOnChange;
27
+ export default refreshBrowserSelectionOnChange;
28
+ export { refreshBrowserSelection };
@@ -4,6 +4,19 @@ import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderS
4
4
  import { token } from '@atlaskit/tokens';
5
5
  import { codeBlockClassNames } from './ui/class-names';
6
6
  import { codeBlockSharedStyles } from '@atlaskit/editor-common/styles';
7
+
8
+ const GutterDangerOverlay = () => css`
9
+ &::after {
10
+ height: 100%;
11
+ content: '';
12
+ position: absolute;
13
+ left: 0;
14
+ top: 0;
15
+ width: 24px;
16
+ background-color: ${token('color.blanket.danger', 'none')};
17
+ }
18
+ `;
19
+
7
20
  export const codeBlockStyles = props => css`
8
21
  .ProseMirror {
9
22
  ${codeBlockSharedStyles(props)}
@@ -30,27 +43,30 @@ export const codeBlockStyles = props => css`
30
43
 
31
44
  /* Danger when top level node */
32
45
  .ProseMirror .danger.code-block {
33
- box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px ${akEditorDeleteBorder};
46
+ box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
47
+ ${token('color.border.danger', akEditorDeleteBorder)};
34
48
 
35
49
  .${codeBlockClassNames.gutter} {
36
- background-color: ${token('color.blanket.danger', R75)};
50
+ background-color: ${token('color.background.danger', R75)};
37
51
  color: ${token('color.text.danger', akEditorDeleteIconColor)};
52
+ ${GutterDangerOverlay()};
38
53
  }
39
54
 
40
55
  .${codeBlockClassNames.content} {
41
- background-color: ${token('color.background.danger', akEditorDeleteBackground)};
56
+ background-color: ${token('color.blanket.danger', akEditorDeleteBackground)};
42
57
  }
43
58
  }
44
59
 
45
60
  /* Danger when nested node */
46
61
  .ProseMirror .danger .code-block {
47
62
  .${codeBlockClassNames.gutter} {
48
- background-color: ${token('color.blanket.danger', 'rgba(255, 143, 115, 0.5)')};
63
+ background-color: ${token('color.background.danger', 'rgba(255, 143, 115, 0.5)')};
49
64
  color: ${token('color.text.danger', akEditorDeleteIconColor)};
65
+ ${GutterDangerOverlay()};
50
66
  }
51
67
 
52
68
  .${codeBlockClassNames.content} {
53
- background-color: ${token('color.background.danger', 'rgba(255, 189, 173, 0.5)')};
69
+ background-color: ${token('color.blanket.danger', 'rgba(255, 189, 173, 0.5)')};
54
70
  }
55
71
  }
56
72
  `;
@@ -1,7 +1,9 @@
1
1
  import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
2
2
  export const codeBlockClassNames = {
3
+ container: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER,
3
4
  start: CodeBlockSharedCssClassName.CODEBLOCK_START,
4
5
  end: CodeBlockSharedCssClassName.CODEBLOCK_END,
6
+ contentWrapper: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER,
5
7
  gutter: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER,
6
8
  content: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
7
9
  };
@@ -1,4 +1,3 @@
1
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
1
  import { Selection, TextSelection } from 'prosemirror-state';
3
2
  import { Decoration } from 'prosemirror-view';
4
3
  import * as themeColors from '@atlaskit/theme/colors';
@@ -6,10 +5,15 @@ import { hexToRgba } from '@atlaskit/adf-schema';
6
5
  import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/utils';
7
6
  import { addAnalytics } from '../analytics/utils';
8
7
  import { EVENT_TYPE, ACTION, ACTION_SUBJECT } from '../analytics/types';
8
+ // TODO: https://product-fabric.atlassian.net/browse/DSP-7269
9
+
10
+ /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
9
11
  export const colors = [themeColors.R100, themeColors.R300, themeColors.R500, themeColors.Y100, themeColors.Y300, themeColors.Y500, themeColors.G100, themeColors.G300, themeColors.G500, themeColors.T100, themeColors.T300, themeColors.T500, themeColors.B100, themeColors.B300, themeColors.B500, themeColors.P100, themeColors.P300, themeColors.P500, themeColors.N70, themeColors.N200, themeColors.N800].map(solid => ({
10
12
  solid,
11
13
  selection: hexToRgba(solid, 0.2)
12
14
  }));
15
+ /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
16
+
13
17
  export const getAvatarColor = str => {
14
18
  let hash = 0;
15
19
 
@@ -26,8 +26,10 @@ export function createToolbarCopyCommandForMark(markType) {
26
26
  // since we're copying the text inside a paragraph, it will always be 1 1
27
27
  // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
28
28
 
29
- div.firstChild.setAttribute('data-pm-slice', '1 1 []');
30
- copyHTMLToClipboard(div.innerHTML);
29
+ div.firstChild.setAttribute('data-pm-slice', '1 1 []'); // If we're copying a hyperlink, we'd copy the url as the fallback plain text
30
+
31
+ const linkUrl = domNode.getAttribute('href');
32
+ copyHTMLToClipboard(div, markType.name === 'link' && linkUrl ? linkUrl : undefined);
31
33
  }
32
34
 
33
35
  const copyToClipboardTr = state.tr;
@@ -136,7 +138,7 @@ export const createToolbarCopyCommandForNode = nodeType => (state, dispatch) =>
136
138
  div.firstChild.setAttribute('data-pm-slice', '0 0 []');
137
139
  }
138
140
 
139
- copyHTMLToClipboard(div.innerHTML);
141
+ copyHTMLToClipboard(div);
140
142
  }
141
143
 
142
144
  copyToClipboardTr.setMeta('scrollIntoView', false);
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ emojiNodeLabel: {
4
+ id: 'fabric.emoji.label',
5
+ defaultMessage: 'Emoji',
6
+ description: 'Label to indicate emoji node to Screen reader users'
7
+ }
8
+ });
@@ -1,15 +1,29 @@
1
1
  import React from 'react';
2
2
  import Emoji from '../ui/Emoji';
3
+ import { useIntl } from 'react-intl-next';
4
+ import { messages } from '../messages';
5
+ const EmojiAssistiveTextComponent = /*#__PURE__*/React.memo(({
6
+ emojiShortName
7
+ }) => {
8
+ const intl = useIntl();
9
+ return /*#__PURE__*/React.createElement("span", {
10
+ className: 'assistive'
11
+ }, `${intl.formatMessage(messages.emojiNodeLabel)} ${emojiShortName}`);
12
+ });
3
13
  export function EmojiNodeView(props) {
4
14
  const {
5
15
  shortName,
6
16
  id,
7
17
  text
8
18
  } = props.node.attrs;
9
- return /*#__PURE__*/React.createElement(Emoji, {
19
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EmojiAssistiveTextComponent, {
20
+ emojiShortName: shortName
21
+ }), /*#__PURE__*/React.createElement("span", {
22
+ "aria-hidden": "true"
23
+ }, /*#__PURE__*/React.createElement(Emoji, {
10
24
  providers: props.providerFactory,
11
25
  id: id,
12
26
  shortName: shortName,
13
27
  fallback: text
14
- });
28
+ })));
15
29
  }
@@ -8,6 +8,7 @@ import { expandClassNames } from '../ui/class-names';
8
8
  import { deleteExpand, focusTitle } from '../commands';
9
9
  import { getPluginState as getSelectionPluginState } from '../../selection/plugin-factory';
10
10
  import { RelativeSelectionPos } from '../../selection/types';
11
+ import { isPositionNearTableRow } from '../../../utils/table';
11
12
 
12
13
  const isExpandNode = node => {
13
14
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -111,7 +112,15 @@ export function expandKeymap() {
111
112
  } = state.selection;
112
113
 
113
114
  if (editorView.endOfTextblock('up')) {
114
- const expand = findExpand(state);
115
+ const expand = findExpand(state); // Moving UP in a table should move the cursor to the row above
116
+ // however when an expand is in a table cell to the left of the
117
+ // current table cell, arrow UP moves the cursor to the left
118
+ // see ED-15425
119
+
120
+ if (isPositionNearTableRow($from, schema, 'before') && !expand) {
121
+ return false;
122
+ }
123
+
115
124
  const prevCursorPos = Math.max($from.pos - $from.parentOffset - 1, 0); // move cursor from expand's content to its title
116
125
 
117
126
  if (expand && expand.start === prevCursorPos) {
@@ -26,7 +26,7 @@ function getSpellCheck(featureFlags) {
26
26
 
27
27
 
28
28
  export function createFeatureFlagsFromProps(props) {
29
- 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$featureFlags28, _props$featureFlags29, _props$collabEdit, _props$collabEdit2, _props$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38;
29
+ 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;
30
30
 
31
31
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
32
32
  const tableCellOptionsInFloatingToolbar = normalizedFeatureFlags.tableCellOptionsInFloatingToolbar || ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.tableCellOptionsInFloatingToolbar) || undefined;
@@ -53,19 +53,23 @@ export function createFeatureFlagsFromProps(props) {
53
53
  errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags14 = props.featureFlags) === null || _props$featureFlags14 === void 0 ? void 0 : _props$featureFlags14.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags15 = props.featureFlags) !== null && _props$featureFlags15 !== void 0 && _props$featureFlags15.useErrorBoundaryDocStructure) : false),
54
54
  synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.synchronyErrorDocStructure) : false),
55
55
  enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.enableViewUpdateSubscription) : false),
56
- plainTextPasteLinkification: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.plainTextPasteLinkification) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.plainTextPasteLinkification) : false),
57
- collabAvatarScroll: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.collabAvatarScroll) : false),
58
- ufo: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.ufo) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.ufo) : false),
59
- twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.twoLineEditorToolbar) : false),
60
- saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.saferDispatchedTransactions) : false)),
56
+ collabAvatarScroll: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.collabAvatarScroll) : false),
57
+ ufo: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.ufo) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.ufo) : false),
58
+ twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.twoLineEditorToolbar) : false),
59
+ 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)),
61
60
  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),
62
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
63
- viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
61
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
62
+ 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,
64
63
  tableCellOptionsInFloatingToolbar: typeof tableCellOptionsInFloatingToolbar === 'boolean' ? tableCellOptionsInFloatingToolbar : false,
65
- showHoverPreview: Boolean(typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32.showHoverPreview) === 'boolean' ? !!((_props$featureFlags33 = props.featureFlags) !== null && _props$featureFlags33 !== void 0 && _props$featureFlags33.showHoverPreview) : false),
66
- indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags35 = props.featureFlags) !== null && _props$featureFlags35 !== void 0 && _props$featureFlags35.indentationButtonsInTheToolbar) : false)),
67
- floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags37 = props.featureFlags) !== null && _props$featureFlags37 !== void 0 && _props$featureFlags37.floatingToolbarCopyButton) : false)),
68
- floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
69
- disableSpellcheckByBrowser: getSpellCheck(props.featureFlags)
64
+ 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),
65
+ 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)),
66
+ 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)),
67
+ 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,
68
+ disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
69
+ // Including fallback to props.featureFlags so that mobile feature flags
70
+ // are included (they are not kebab cased)
71
+ restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.restartNumberedLists) === true,
72
+ listNumberContinuity: normalizedFeatureFlags.listNumberContinuity === true || ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38.listNumberContinuity) === true,
73
+ restartNumberedListsToolbar: normalizedFeatureFlags.restartNumberedListsToolbar === true || ((_props$featureFlags39 = props.featureFlags) === null || _props$featureFlags39 === void 0 ? void 0 : _props$featureFlags39.restartNumberedListsToolbar) === true
70
74
  };
71
75
  }
@@ -88,6 +88,7 @@ class FindReplaceToolbarButton extends React.PureComponent {
88
88
  },
89
89
  fitWidth: 352,
90
90
  zIndex: stackBelowOtherEditorFloatingPanels,
91
+ disableArrowKeyNavigation: true,
91
92
  trigger: jsx(ToolbarButton, {
92
93
  buttonId: TOOLBAR_BUTTON.FIND_REPLACE,
93
94
  spacing: isReducedSpacing ? 'none' : 'default',
@@ -187,6 +187,7 @@ const floatingToolbarPlugin = () => ({
187
187
  className = '',
188
188
  height,
189
189
  width,
190
+ zIndex,
190
191
  offset = [0, 12],
191
192
  forcePlacement,
192
193
  onPositionCalculated
@@ -229,6 +230,7 @@ const floatingToolbarPlugin = () => ({
229
230
  fitWidth: width,
230
231
  alignX: align,
231
232
  stick: true,
233
+ zIndex: zIndex,
232
234
  mountTo: popupsMountPoint,
233
235
  boundariesElement: popupsBoundariesElement,
234
236
  scrollableElement: popupsScrollableElement,
@@ -56,6 +56,14 @@ export default class Dropdown extends Component {
56
56
  isOpen: false
57
57
  });
58
58
  });
59
+
60
+ _defineProperty(this, "hideonEsc", () => {
61
+ var _document$querySelect;
62
+
63
+ this.hide(); //Focus the trigger button only on Escape
64
+
65
+ (_document$querySelect = document.querySelector(`[data-testid=${this.props.buttonTestId}]`)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.focus();
66
+ });
59
67
  }
60
68
 
61
69
  render() {
@@ -120,7 +128,7 @@ export default class Dropdown extends Component {
120
128
  scrollableElement: scrollableElement,
121
129
  isOpen: isOpen,
122
130
  handleClickOutside: this.hide,
123
- handleEscapeKeydown: this.hide,
131
+ handleEscapeKeydown: this.hideonEsc,
124
132
  fitWidth: fitWidth + fitTolerance,
125
133
  fitHeight: fitHeight + fitTolerance,
126
134
  trigger: trigger
@@ -32,6 +32,7 @@ const menuContainer = css`
32
32
  }
33
33
  `;
34
34
  export const itemSpacing = gridSize() / 2;
35
+ const DropdownButtonItem = ButtonItem;
35
36
 
36
37
  class Dropdown extends Component {
37
38
  render() {
@@ -44,7 +45,7 @@ class Dropdown extends Component {
44
45
  return jsx("div", {
45
46
  css: menuContainer
46
47
  }, items.filter(item => !item.hidden).map((item, idx) => {
47
- const itemContent = jsx(ButtonItem, {
48
+ const itemContent = jsx(DropdownButtonItem, {
48
49
  key: idx,
49
50
  iconBefore: this.renderSelected(item, intl),
50
51
  iconAfter: item.elemAfter,
@@ -62,6 +63,24 @@ class Dropdown extends Component {
62
63
  isDisabled: item.disabled,
63
64
  onMouseDown: e => {
64
65
  e.preventDefault();
66
+ },
67
+ onMouseOver: e => {
68
+ if (item.onMouseOver) {
69
+ e.preventDefault();
70
+ dispatchCommand(item.onMouseOver);
71
+ }
72
+ },
73
+ onMouseEnter: e => {
74
+ if (item.onMouseEnter) {
75
+ e.preventDefault();
76
+ dispatchCommand(item.onMouseEnter);
77
+ }
78
+ },
79
+ onMouseLeave: e => {
80
+ if (item.onMouseLeave) {
81
+ e.preventDefault();
82
+ dispatchCommand(item.onMouseLeave);
83
+ }
65
84
  }
66
85
  }, item.title);
67
86