@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,2 +1,14 @@
1
- import { DropdownMenu } from '@atlaskit/editor-common/ui-menu';
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import { DropdownMenu as DropdownComponent } from '@atlaskit/editor-common/ui-menu';
3
+ import React, { useContext } from 'react';
4
+ import { KeyDownHandlerContext } from '../ToolbarArrowKeyNavigationProvider';
5
+ const DropdownMenu = /*#__PURE__*/React.memo(({ ...props
6
+ }) => {
7
+ const keydownHandlerContext = useContext(KeyDownHandlerContext); //This context is to handle the tab, Arrow Right/Left key events for dropdown.
8
+ //Default context has the void callbacks for above key events
9
+
10
+ return /*#__PURE__*/React.createElement(DropdownComponent, _extends({
11
+ keyDownHandlerContext: keydownHandlerContext
12
+ }, props));
13
+ });
2
14
  export default DropdownMenu;
@@ -1,4 +1,3 @@
1
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
1
  import { gridSize } from '@atlaskit/theme/constants';
3
2
  export const GRID_SIZE = gridSize();
4
3
  export const DEVICE_BREAKPOINT_NUMBERS = {
@@ -0,0 +1,148 @@
1
+ /* eslint-disable no-console */
2
+ import React, { useLayoutEffect, useRef } from 'react';
3
+
4
+ /*
5
+ ** The context is used to handle the keydown events of submenus.
6
+ ** Because the keyboard navigation is explicitly managed for main toolbar items
7
+ ** Few key presses such as Tab,Arrow Right/Left need ot be handled here via context
8
+ */
9
+ export const KeyDownHandlerContext = /*#__PURE__*/React.createContext({
10
+ handleArrowLeft: () => {},
11
+ handleArrowRight: () => {},
12
+ handleTab: () => {}
13
+ });
14
+ /**
15
+ * This component is a wrapper of main toolbar which listens to keydown events of children
16
+ * and handles left/right arrow key navigation for all focusable elements
17
+ * @param
18
+ * @returns
19
+ */
20
+
21
+ export const ToolbarArrowKeyNavigationProvider = ({
22
+ children,
23
+ editorView
24
+ }) => {
25
+ const wrapperRef = useRef(null);
26
+ const currentSelectedItemIndex = useRef(0);
27
+
28
+ const incrementIndex = list => {
29
+ if (currentSelectedItemIndex.current === list.length - 1) {
30
+ currentSelectedItemIndex.current = 0;
31
+ } else {
32
+ currentSelectedItemIndex.current = currentSelectedItemIndex.current + 1;
33
+ }
34
+ };
35
+
36
+ const decrementIndex = list => {
37
+ if (currentSelectedItemIndex.current === 0) {
38
+ currentSelectedItemIndex.current = list.length - 1;
39
+ } else {
40
+ currentSelectedItemIndex.current = currentSelectedItemIndex.current - 1;
41
+ }
42
+ };
43
+
44
+ const handleArrowRight = () => {
45
+ var _filteredFocusableEle;
46
+
47
+ const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
48
+ incrementIndex(filteredFocusableElements);
49
+ (_filteredFocusableEle = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle === void 0 ? void 0 : _filteredFocusableEle.focus();
50
+ };
51
+
52
+ const handleArrowLeft = () => {
53
+ var _filteredFocusableEle2;
54
+
55
+ const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
56
+ decrementIndex(filteredFocusableElements);
57
+ (_filteredFocusableEle2 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle2 === void 0 ? void 0 : _filteredFocusableEle2.focus();
58
+ };
59
+
60
+ const handleTab = () => {
61
+ var _filteredFocusableEle3;
62
+
63
+ const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
64
+ (_filteredFocusableEle3 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle3 === void 0 ? void 0 : _filteredFocusableEle3.focus();
65
+ };
66
+
67
+ const submenuKeydownHandleContext = {
68
+ handleArrowLeft,
69
+ handleArrowRight,
70
+ handleTab
71
+ };
72
+ useLayoutEffect(() => {
73
+ if (!wrapperRef.current) {
74
+ return;
75
+ }
76
+
77
+ const {
78
+ current: element
79
+ } = wrapperRef;
80
+ /**
81
+ * To handle the key events on the list
82
+ * @param event
83
+ */
84
+
85
+ const handleKeyDown = event => {
86
+ var _document$querySelect, _wrapperRef$current, _filteredFocusableEle4;
87
+
88
+ //To trap the focus inside the horizontal main toolbar for left and right arrow keys
89
+ const targetElement = event.target; //To filter out the events outside the main toolbar
90
+
91
+ if (!targetElement.closest("[data-testid='ak-editor-main-toolbar']")) {
92
+ return;
93
+ } //The key events are from child components such as dropdown menus / popups are ignored
94
+
95
+
96
+ if ((_document$querySelect = document.querySelector('[data-role="droplistContent"], [data-test-id="color-picker-menu"], [data-emoji-picker-container="true"]')) !== null && _document$querySelect !== void 0 && _document$querySelect.contains(targetElement) || event.key === 'ArrowUp' || event.key === 'ArrowDown') {
97
+ return;
98
+ }
99
+
100
+ const filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
101
+
102
+ if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
103
+ return;
104
+ } //This is kind of hack to reset the current focused toolbar item
105
+ //to handle some usecases such as Tab in/out of main toolbar
106
+
107
+
108
+ if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
109
+ currentSelectedItemIndex.current = -1;
110
+ } else {
111
+ currentSelectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : currentSelectedItemIndex.current;
112
+ }
113
+
114
+ if (event.key === 'ArrowRight') {
115
+ incrementIndex(filteredFocusableElements);
116
+ } else if (event.key === 'ArrowLeft') {
117
+ decrementIndex(filteredFocusableElements);
118
+ }
119
+
120
+ (_filteredFocusableEle4 = filteredFocusableElements[currentSelectedItemIndex.current]) === null || _filteredFocusableEle4 === void 0 ? void 0 : _filteredFocusableEle4.focus();
121
+ };
122
+
123
+ element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
124
+ return () => {
125
+ element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
126
+ };
127
+ }, [currentSelectedItemIndex, wrapperRef, editorView]);
128
+ return /*#__PURE__*/React.createElement("div", {
129
+ className: "custom-key-handler-wrapper",
130
+ ref: wrapperRef
131
+ }, /*#__PURE__*/React.createElement(KeyDownHandlerContext.Provider, {
132
+ value: submenuKeydownHandleContext
133
+ }, children));
134
+ };
135
+
136
+ function getFocusableElements(rootNode) {
137
+ if (!rootNode) {
138
+ return [];
139
+ }
140
+
141
+ const focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, div[tabindex="-1"], div[tabindex="0"]') || [];
142
+ return Array.from(focusableModalElements);
143
+ }
144
+
145
+ function getFilteredFocusableElements(rootNode) {
146
+ //The focusable elements from child components such as dropdown menus / popups are ignored
147
+ return getFocusableElements(rootNode).filter(elm => !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]'));
148
+ }
@@ -2,13 +2,7 @@ import { css } from '@emotion/react';
2
2
  import { N30 } from '@atlaskit/theme/colors';
3
3
  import { token } from '@atlaskit/tokens';
4
4
  export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
5
- export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar'; // TODO ED-15449 delete this style when deleting editor-core table
6
-
7
- export const cellColourPreviewStyles = selectedColor => css`
8
- &::before {
9
- background: ${selectedColor};
10
- }
11
- `;
5
+ export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
12
6
  export const buttonGroupStyle = css`
13
7
  display: inline-flex;
14
8
  align-items: center;
@@ -37,19 +37,20 @@ export const copyToClipboard = async textToCopy => {
37
37
  throw new Error('Clipboard api is not supported');
38
38
  }
39
39
  };
40
- export const copyHTMLToClipboard = async htmlToCopy => {
40
+ export const copyHTMLToClipboard = async (elementToCopy, plainTextToCopy) => {
41
41
  // @ts-ignore
42
42
  if (isClipboardApiSupported() && typeof ClipboardItem !== 'undefined') {
43
43
  try {
44
- const blobInput = new Blob([htmlToCopy], {
45
- type: 'text/html'
44
+ const data = new ClipboardItem({
45
+ 'text/plain': new Blob([plainTextToCopy || elementToCopy.innerText], {
46
+ type: 'text/plain'
47
+ }),
48
+ 'text/html': new Blob([elementToCopy.innerHTML], {
49
+ type: 'text/html'
50
+ })
46
51
  }); // @ts-ignore
47
52
 
48
- const data = [new ClipboardItem({
49
- 'text/html': blobInput
50
- })]; // @ts-ignore
51
-
52
- navigator.clipboard.write(data);
53
+ await navigator.clipboard.write([data]);
53
54
  } catch (error) {
54
55
  throw new Error('Clipboard api is not supported');
55
56
  }
@@ -58,7 +59,8 @@ export const copyHTMLToClipboard = async htmlToCopy => {
58
59
  // Hence of use of this polyfill
59
60
  const Clipboard = clipboard;
60
61
  const dt = new Clipboard.DT();
61
- dt.setData('text/html', htmlToCopy);
62
+ dt.setData('text/plain', plainTextToCopy || elementToCopy.innerText);
63
+ dt.setData('text/html', elementToCopy.innerHTML);
62
64
  Clipboard.write(dt);
63
65
  }
64
66
  };
@@ -1,5 +1,5 @@
1
1
  import { Node } from 'prosemirror-model';
2
- import { transformMediaLinkMarks, transformTextLinkCodeMarks, transformDedupeMarks, transformNodesMissingContent, transformIndentationMarks } from '@atlaskit/adf-utils/transforms';
2
+ import { transformMediaLinkMarks, transformTextLinkCodeMarks, transformDedupeMarks, transformNodesMissingContent, transformIndentationMarks, transformInvalidMediaContent } from '@atlaskit/adf-utils/transforms';
3
3
  import { sanitizeNodeForPrivacy } from '../utils/filter/privacy-filter';
4
4
  import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
5
5
  import { getBreakoutMode } from './node-width';
@@ -252,6 +252,19 @@ export function processRawValue(schema, value, providerFactory, sanitizePrivateC
252
252
  });
253
253
  }
254
254
 
255
+ ({
256
+ transformedAdf,
257
+ isTransformed
258
+ } = transformInvalidMediaContent(transformedAdf));
259
+
260
+ if (isTransformed && dispatchAnalyticsEvent) {
261
+ dispatchAnalyticsEvent({
262
+ action: ACTION.INVALID_MEDIA_CONTENT_TRANSFORMED,
263
+ actionSubject: ACTION_SUBJECT.EDITOR,
264
+ eventType: EVENT_TYPE.OPERATIONAL
265
+ });
266
+ }
267
+
255
268
  const entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent);
256
269
  let newEntity = maySanitizePrivateContent(entity, providerFactory, sanitizePrivateContent);
257
270
  const parsedDoc = Node.fromJSON(schema, newEntity); // throws an error if the document is invalid
@@ -368,13 +368,6 @@ export function stringRepeat(text, length) {
368
368
 
369
369
  return result;
370
370
  }
371
- /**
372
- * A replacement for `Array.from` until it becomes widely implemented.
373
- */
374
-
375
- export function arrayFrom(obj) {
376
- return Array.prototype.slice.call(obj);
377
- }
378
371
  /*
379
372
  * From Modernizr
380
373
  * Returns the kind of transitionevent available for the element
@@ -1,8 +1,9 @@
1
- import { canJoin, findWrapping } from 'prosemirror-transform';
2
1
  import { closeHistory } from 'prosemirror-history';
3
2
  import { TextSelection } from 'prosemirror-state';
4
- import { addAnalytics } from '../plugins/analytics/utils';
3
+ import { canJoin, findWrapping } from 'prosemirror-transform';
4
+ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
5
5
  import { createInputRulePlugin } from '@atlaskit/prosemirror-input-rules';
6
+ import { addAnalytics } from '../plugins/analytics';
6
7
  export const ruleWithAnalytics = getPayload => {
7
8
  return originalRule => {
8
9
  const onHandlerApply = (state, tr, matchResult) => {
@@ -57,7 +58,7 @@ export const createPlugin = (pluginName, rules, options = {}) => {
57
58
  const unsupportedMarks = isBlockNodeRule ? ['code', 'link', 'typeAheadQuery'] : ['code'];
58
59
  const $from = state.selection.$from;
59
60
 
60
- if ($from.parent.type.spec.code || !(state.selection instanceof TextSelection) || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
61
+ if ($from.parent.type.spec.code || !(state.selection instanceof TextSelection) && !(state.selection instanceof GapCursorSelection) || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
61
62
  return false;
62
63
  }
63
64
 
@@ -0,0 +1,28 @@
1
+ /*
2
+ isPositionNearTableRow()
3
+ Returns true when a sibling node, or any of the parent's sibling
4
+ nodes are a tableRow
5
+ */
6
+ export function isPositionNearTableRow(pos, schema, direction) {
7
+ if (!schema.nodes.tableRow) {
8
+ return false;
9
+ }
10
+
11
+ let doc = pos.doc;
12
+ let resolved = pos;
13
+ const sibling = direction === 'before' ? 'nodeBefore' : 'nodeAfter';
14
+
15
+ while (resolved.depth > 0) {
16
+ var _resolved$sibling;
17
+
18
+ const siblingType = (_resolved$sibling = resolved[sibling]) === null || _resolved$sibling === void 0 ? void 0 : _resolved$sibling.type;
19
+
20
+ if (siblingType === schema.nodes.tableRow) {
21
+ return true;
22
+ }
23
+
24
+ resolved = doc.resolve(resolved[direction]());
25
+ }
26
+
27
+ return false;
28
+ }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "175.0.4";
2
+ export const version = "176.0.0";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "175.0.4",
3
+ "version": "176.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -77,7 +77,7 @@ export function shouldReconfigureState(props, nextProps) {
77
77
  }
78
78
 
79
79
  var mobileProperties = props.appearance === 'mobile' ? ['featureFlags', 'quickInsert'] : [];
80
- var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder'].concat(mobileProperties);
80
+ var properties = ['appearance', 'persistScrollGutter', 'allowUndoRedoButtons', 'placeholder', 'sanitizePrivateContent'].concat(mobileProperties);
81
81
  return properties.reduce(function (acc, curr) {
82
82
  return acc || props[curr] !== nextProps[curr];
83
83
  }, false);
@@ -47,7 +47,7 @@ export function getScrollGutterOptions(props) {
47
47
  return undefined;
48
48
  }
49
49
  export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
50
- var _props$performanceTra, _props$linking, _props$featureFlags, _props$performanceTra2, _props$textFormatting, _props$linking2;
50
+ var _props$performanceTra, _props$linking, _props$performanceTra2, _props$textFormatting, _props$linking2;
51
51
 
52
52
  var appearance = props.appearance;
53
53
  var isMobile = appearance === 'mobile';
@@ -62,8 +62,7 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
62
62
  featureFlags: createFeatureFlagsFromProps(props),
63
63
  paste: {
64
64
  cardOptions: cardOptions,
65
- sanitizePrivateContent: props.sanitizePrivateContent,
66
- plainTextPasteLinkification: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.plainTextPasteLinkification) === true
65
+ sanitizePrivateContent: props.sanitizePrivateContent
67
66
  },
68
67
  base: {
69
68
  allowInlineCursorTarget: !isMobile,
@@ -301,7 +300,6 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
301
300
  var extensionConfig = _typeof(props.allowExtension) === 'object' ? props.allowExtension : {};
302
301
  preset.add([extensionPlugin, {
303
302
  breakoutEnabled: props.appearance === 'full-page' && extensionConfig.allowBreakout !== false,
304
- stickToolbarToBottom: extensionConfig.stickToolbarToBottom,
305
303
  allowAutoSave: extensionConfig.allowAutoSave,
306
304
  extensionHandlers: props.extensionHandlers,
307
305
  useLongPressSelection: false,
@@ -1 +1 @@
1
- export { addAltText, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, alignRight, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
1
+ export { addAltText, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
@@ -14,9 +14,7 @@ export function useCXHTMLPreset(_ref) {
14
14
 
15
15
  var _useDefaultPreset = useDefaultPreset({
16
16
  featureFlags: featureFlags,
17
- paste: {
18
- plainTextPasteLinkification: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.plainTextPasteLinkification
19
- }
17
+ paste: {}
20
18
  }),
21
19
  _useDefaultPreset2 = _slicedToArray(_useDefaultPreset, 1),
22
20
  preset = _useDefaultPreset2[0];
@@ -38,9 +38,7 @@ export function useMobilePreset(_ref) {
38
38
 
39
39
  var _useDefaultPreset = useDefaultPreset({
40
40
  featureFlags: featureFlags,
41
- paste: {
42
- plainTextPasteLinkification: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.plainTextPasteLinkification
43
- }
41
+ paste: {}
44
42
  }),
45
43
  _useDefaultPreset2 = _slicedToArray(_useDefaultPreset, 1),
46
44
  preset = _useDefaultPreset2[0];
@@ -1,4 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
4
+ import { jsx } from '@emotion/react';
2
5
  import React from 'react';
3
6
  import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
4
7
  import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
@@ -158,17 +161,21 @@ function getPortalChildren(_ref2) {
158
161
  // within inline node view Components however would require a sizable
159
162
  // refactor. A test suite to catch any instances of this is ideal however
160
163
  // the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
161
- return /*#__PURE__*/React.createElement(ErrorBoundary, {
164
+ return jsx(ErrorBoundary, {
162
165
  component: ACTION_SUBJECT.REACT_NODE_VIEW,
163
166
  componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : ACTION_SUBJECT_ID.UNKNOWN_NODE,
164
167
  dispatchAnalyticsEvent: dispatchAnalyticsEvent
165
- }, /*#__PURE__*/React.createElement("span", {
168
+ }, jsx("span", {
169
+ "aria-hidden": "true",
170
+ className: "zeroWidthSpaceContainer"
171
+ }, jsx("span", {
166
172
  className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
167
- }), ZERO_WIDTH_SPACE, /*#__PURE__*/React.createElement(Component, _extends({
173
+ }), ZERO_WIDTH_SPACE), jsx(Component, _extends({
168
174
  view: nodeViewParams.view,
169
175
  getPos: nodeViewParams.getPos,
170
176
  node: currentNode
171
- }, extraComponentProps)), /*#__PURE__*/React.createElement("span", {
177
+ }, extraComponentProps)), jsx("span", {
178
+ "aria-hidden": "true",
172
179
  className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
173
180
  }));
174
181
  };
@@ -7,4 +7,4 @@ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
7
7
  import { inlineNodeViewClassname } from './getInlineNodeViewProducer'; // For reasoning behind styles, see comments in:
8
8
  // ./getInlineNodeViewProducer -> portalChildren()
9
9
 
10
- export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > * {\n white-space: pre-wrap;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, ZERO_WIDTH_SPACE);
10
+ export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > *:not(span[aria-hidden='true'].zeroWidthSpaceContainer) {\n white-space: pre-wrap;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, inlineNodeViewClassname, ZERO_WIDTH_SPACE);
@@ -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
  var list = {};
6
6
  bindKeymapWithCommand(alignLeft.common, changeAlignment('start'), list);
7
- bindKeymapWithCommand(alignRight.common, changeAlignment('end'), list);
8
7
  return keymap(list);
9
8
  }
@@ -37,6 +37,8 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
37
37
 
38
38
  _this = _super.call.apply(_super, [this].concat(args));
39
39
 
40
+ _defineProperty(_assertThisInitialized(_this), "toolbarItemRef", /*#__PURE__*/React.createRef());
41
+
40
42
  _defineProperty(_assertThisInitialized(_this), "state", {
41
43
  isOpen: false
42
44
  });
@@ -61,14 +63,29 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
61
63
  });
62
64
  });
63
65
 
64
- _defineProperty(_assertThisInitialized(_this), "hide", function () {
66
+ _defineProperty(_assertThisInitialized(_this), "hide", function (attrs) {
65
67
  if (_this.state.isOpen) {
66
68
  _this.setState({
67
69
  isOpen: false
68
70
  });
71
+
72
+ if ((attrs === null || attrs === void 0 ? void 0 : attrs.event) instanceof KeyboardEvent && attrs.event.key === 'Escape') {
73
+ var _this$toolbarItemRef, _this$toolbarItemRef$;
74
+
75
+ (_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();
76
+ }
69
77
  }
70
78
  });
71
79
 
80
+ _defineProperty(_assertThisInitialized(_this), "hideonEsc", function () {
81
+ var _this$toolbarItemRef2, _this$toolbarItemRef3;
82
+
83
+ _this.hide(); //To set the focus on the textcolor button when the menu is closed by 'Esc' only (aria guidelines)
84
+
85
+
86
+ (_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();
87
+ });
88
+
72
89
  return _this;
73
90
  }
74
91
 
@@ -94,10 +111,17 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
94
111
  boundariesElement: popupsBoundariesElement,
95
112
  scrollableElement: popupsScrollableElement,
96
113
  isOpen: isOpen,
97
- handleClickOutside: this.hide,
98
- handleEscapeKeydown: this.hide,
114
+ handleClickOutside: function handleClickOutside(event) {
115
+ return _this2.hide({
116
+ isOpen: false,
117
+ event: event
118
+ });
119
+ },
120
+ handleEscapeKeydown: this.hideonEsc,
121
+ onOpenChange: this.hide,
99
122
  fitWidth: 112,
100
123
  fitHeight: 80,
124
+ closeonTab: true,
101
125
  trigger: jsx(ToolbarButton, {
102
126
  spacing: isReducedSpacing ? 'none' : 'default',
103
127
  disabled: disabled,
@@ -116,7 +140,8 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
116
140
  css: expandIconWrapper
117
141
  }, jsx(ExpandIcon, {
118
142
  label: ""
119
- })))
143
+ }))),
144
+ ref: this.toolbarItemRef
120
145
  })
121
146
  }, jsx(Alignment, {
122
147
  onClick: function onClick(align) {
@@ -11,8 +11,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
11
11
  import React from 'react';
12
12
  import { AnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
13
13
  import { ReactNodeView } from '../../../nodeviews';
14
- import WithPluginState from '../../../ui/WithPluginState';
15
- import { inlineCommentPluginKey } from '../utils';
16
14
  export var AnnotationNodeView = /*#__PURE__*/function (_ReactNodeView) {
17
15
  _inherits(AnnotationNodeView, _ReactNodeView);
18
16
 
@@ -41,37 +39,13 @@ export var AnnotationNodeView = /*#__PURE__*/function (_ReactNodeView) {
41
39
  }, {
42
40
  key: "render",
43
41
  value: function render(_props, forwardRef) {
44
- var _this = this;
45
-
46
- return /*#__PURE__*/React.createElement(WithPluginState, {
47
- plugins: {
48
- inlineCommentState: inlineCommentPluginKey
49
- },
50
- editorView: this.view,
51
- render: function render(_ref) {
52
- var inlineCommentState = _ref.inlineCommentState;
53
-
54
- if (!(inlineCommentState !== null && inlineCommentState !== void 0 && inlineCommentState.isVisible)) {
55
- return /*#__PURE__*/React.createElement("span", {
56
- ref: forwardRef
57
- });
58
- } // Check if selection includes current annotation ID
59
-
60
-
61
- var annotations = inlineCommentState.annotations,
62
- selectedAnnotations = inlineCommentState.selectedAnnotations;
63
- var id = _this.node.attrs.id;
64
- var isUnresolved = annotations[id] === false;
65
- var annotationHasFocus = selectedAnnotations.some(function (x) {
66
- return x.id === id;
67
- });
68
- var className = getAnnotationViewClassname(isUnresolved, annotationHasFocus);
69
- return /*#__PURE__*/React.createElement("span", {
70
- className: className,
71
- ref: forwardRef
72
- });
73
- }
74
- });
42
+ return (
43
+ /*#__PURE__*/
44
+ // all inline comment states are now set in decorations at ../pm-plugins/inline-comment.ts
45
+ React.createElement("span", {
46
+ ref: forwardRef
47
+ })
48
+ );
75
49
  }
76
50
  }]);
77
51
 
@@ -3,8 +3,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import { RESOLVE_METHOD } from './../../analytics/types/inline-comment-events';
5
5
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
+ import { Decoration, DecorationSet } from 'prosemirror-view';
6
7
  import { AnnotationTypes } from '@atlaskit/adf-schema';
7
- import { AnnotationNodeView } from '../nodeviews';
8
+ import { AnnotationNodeView, getAnnotationViewClassname } from '../nodeviews';
8
9
  import { updateInlineCommentResolvedState, updateMouseState, clearDirtyMark, setInlineCommentsVisibility } from '../commands';
9
10
  import { getAllAnnotations, inlineCommentPluginKey, getPluginState } from '../utils';
10
11
  import { createPluginState } from './plugin-factory';
@@ -219,10 +220,34 @@ export var inlineCommentPlugin = function inlineCommentPlugin(options) {
219
220
  }
220
221
  },
221
222
  decorations: function decorations(state) {
223
+ // highlight comments, depending on state
222
224
  var _getPluginState3 = getPluginState(state),
223
- draftDecorationSet = _getPluginState3.draftDecorationSet;
225
+ draftDecorationSet = _getPluginState3.draftDecorationSet,
226
+ annotations = _getPluginState3.annotations,
227
+ selectedAnnotations = _getPluginState3.selectedAnnotations,
228
+ isVisible = _getPluginState3.isVisible;
229
+
230
+ var decorations = draftDecorationSet !== null && draftDecorationSet !== void 0 ? draftDecorationSet : DecorationSet.empty;
231
+ var focusDecorations = [];
232
+ state.doc.descendants(function (node, pos) {
233
+ node.marks.filter(function (mark) {
234
+ return mark.type === state.schema.marks.annotation;
235
+ }).forEach(function (mark) {
236
+ var isSelected = selectedAnnotations.some(function (selectedAnnotation) {
237
+ return selectedAnnotation.id === mark.attrs.id;
238
+ });
239
+ var isUnresolved = annotations[mark.attrs.id] === false;
224
240
 
225
- return draftDecorationSet;
241
+ if (isVisible) {
242
+ focusDecorations.push(Decoration.inline(pos, pos + node.nodeSize, {
243
+ class: "".concat(getAnnotationViewClassname(isUnresolved, isSelected), " ").concat(isUnresolved),
244
+ nodeName: 'span'
245
+ }));
246
+ }
247
+ });
248
+ });
249
+ decorations = decorations.add(state.doc, focusDecorations);
250
+ return decorations;
226
251
  }
227
252
  }
228
253
  });