@atlaskit/editor-core 171.0.0 → 172.0.1

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 (303) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/codemods/172.0.0-transform-smartlinks-prop.ts +8 -0
  3. package/codemods/__tests__/rename-smartlinks-prop.ts +204 -0
  4. package/codemods/migrates/rename-smartlinks-prop.ts +56 -0
  5. package/dist/cjs/create-editor/ReactEditorView.js +13 -4
  6. package/dist/cjs/create-editor/create-plugins-list.js +21 -12
  7. package/dist/cjs/editor.js +8 -23
  8. package/dist/cjs/labs/next/internal/hooks/use-editor/index.js +6 -1
  9. package/dist/cjs/labs/next/presets/default.js +1 -1
  10. package/dist/cjs/nodeviews/context-adapter.js +2 -2
  11. package/dist/cjs/plugins/analytics/plugin.js +24 -11
  12. package/dist/cjs/plugins/base/index.js +3 -3
  13. package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +84 -0
  14. package/dist/cjs/plugins/card/index.js +1 -1
  15. package/dist/cjs/plugins/card/toolbar.js +11 -5
  16. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +5 -1
  17. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +7 -7
  18. package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -2
  19. package/dist/cjs/plugins/code-block/actions.js +13 -0
  20. package/dist/cjs/plugins/code-block/index.js +7 -0
  21. package/dist/cjs/plugins/code-block/nodeviews/code-block.js +2 -4
  22. package/dist/cjs/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +132 -0
  23. package/dist/cjs/plugins/code-block/pm-plugins/main.js +1 -23
  24. package/dist/cjs/plugins/code-block/styles.js +3 -36
  25. package/dist/cjs/plugins/code-block/toolbar.js +9 -0
  26. package/dist/cjs/plugins/code-block/ui/class-names.js +1 -2
  27. package/dist/cjs/plugins/copy-button/commands.js +40 -20
  28. package/dist/cjs/plugins/copy-button/toolbar.js +51 -0
  29. package/dist/cjs/plugins/copy-button/utils.js +16 -38
  30. package/dist/cjs/plugins/expand/toolbar.js +8 -2
  31. package/dist/cjs/plugins/extension/toolbar.js +5 -1
  32. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +1 -1
  33. package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
  34. package/dist/cjs/plugins/extension/ui/Extension/styles.js +2 -4
  35. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +29 -18
  36. package/dist/cjs/plugins/feedback-dialog/index.js +2 -2
  37. package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -20
  38. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +7 -32
  39. package/dist/cjs/plugins/hyperlink/Toolbar.js +146 -135
  40. package/dist/cjs/plugins/hyperlink/index.js +4 -4
  41. package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +50 -0
  42. package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +38 -0
  43. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -5
  44. package/dist/cjs/plugins/indentation/commands/index.js +35 -7
  45. package/dist/cjs/plugins/indentation/commands/utils.js +11 -7
  46. package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +5 -3
  47. package/dist/cjs/plugins/layout/toolbar.js +3 -1
  48. package/dist/cjs/plugins/media/toolbar/index.js +13 -5
  49. package/dist/cjs/plugins/mentions/analytics.js +5 -5
  50. package/dist/cjs/plugins/panel/toolbar.js +3 -3
  51. package/dist/cjs/plugins/paste/edge-cases/index.js +16 -3
  52. package/dist/cjs/plugins/paste/handlers.js +25 -2
  53. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +16 -3
  54. package/dist/cjs/plugins/paste/pm-plugins/main.js +22 -3
  55. package/dist/cjs/plugins/status/analytics.js +3 -3
  56. package/dist/cjs/plugins/table/toolbar.js +2 -2
  57. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  58. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +43 -32
  59. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +33 -13
  60. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +122 -0
  61. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
  62. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
  63. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +7 -1
  64. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +40 -19
  65. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +10 -0
  66. package/dist/cjs/types/browser.js +6 -0
  67. package/dist/cjs/ui/Addon/click-area-helper.js +40 -19
  68. package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
  69. package/dist/cjs/ui/ContentStyles/index.js +1 -3
  70. package/dist/cjs/ui/DropList/index.js +215 -0
  71. package/dist/cjs/ui/Dropdown/index.js +2 -5
  72. package/dist/cjs/ui/DropdownMenu/index.js +140 -86
  73. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +25 -14
  74. package/dist/cjs/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +2 -2
  75. package/dist/cjs/ui/ElementBrowser/components/ElementList/utils.js +28 -1
  76. package/dist/cjs/ui/ElementBrowser/constants.js +2 -7
  77. package/dist/cjs/ui/Layer/index.js +245 -0
  78. package/dist/cjs/ui/Layer/internal/helpers.js +70 -0
  79. package/dist/cjs/ui/PortalProvider/index.js +7 -26
  80. package/dist/cjs/version-wrapper.js +1 -1
  81. package/dist/cjs/version.json +1 -1
  82. package/dist/es2019/create-editor/ReactEditorView.js +15 -4
  83. package/dist/es2019/create-editor/create-plugins-list.js +21 -11
  84. package/dist/es2019/editor.js +9 -23
  85. package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +6 -1
  86. package/dist/es2019/labs/next/presets/default.js +1 -1
  87. package/dist/es2019/nodeviews/context-adapter.js +2 -2
  88. package/dist/es2019/plugins/analytics/plugin.js +19 -4
  89. package/dist/es2019/plugins/base/index.js +3 -3
  90. package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +70 -0
  91. package/dist/es2019/plugins/card/index.js +1 -1
  92. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -2
  93. package/dist/es2019/plugins/card/toolbar.js +10 -5
  94. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +5 -1
  95. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -7
  96. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +1 -2
  97. package/dist/es2019/plugins/code-block/actions.js +12 -0
  98. package/dist/es2019/plugins/code-block/index.js +4 -0
  99. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +1 -1
  100. package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
  101. package/dist/es2019/plugins/code-block/pm-plugins/main.js +1 -21
  102. package/dist/es2019/plugins/code-block/styles.js +2 -159
  103. package/dist/es2019/plugins/code-block/toolbar.js +8 -0
  104. package/dist/es2019/plugins/code-block/ui/class-names.js +1 -2
  105. package/dist/es2019/plugins/copy-button/commands.js +35 -15
  106. package/dist/es2019/plugins/copy-button/toolbar.js +29 -0
  107. package/dist/es2019/plugins/copy-button/utils.js +15 -27
  108. package/dist/es2019/plugins/expand/toolbar.js +4 -1
  109. package/dist/es2019/plugins/extension/toolbar.js +4 -1
  110. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +1 -1
  111. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
  112. package/dist/es2019/plugins/extension/ui/Extension/styles.js +1 -3
  113. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +27 -15
  114. package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
  115. package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -19
  116. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +14 -29
  117. package/dist/es2019/plugins/hyperlink/Toolbar.js +11 -5
  118. package/dist/es2019/plugins/hyperlink/index.js +4 -4
  119. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +24 -0
  120. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
  121. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -9
  122. package/dist/es2019/plugins/indentation/commands/index.js +24 -9
  123. package/dist/es2019/plugins/indentation/commands/utils.js +8 -3
  124. package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +5 -4
  125. package/dist/es2019/plugins/layout/toolbar.js +2 -1
  126. package/dist/es2019/plugins/media/toolbar/index.js +10 -3
  127. package/dist/es2019/plugins/mentions/analytics.js +1 -1
  128. package/dist/es2019/plugins/panel/toolbar.js +1 -1
  129. package/dist/es2019/plugins/paste/edge-cases/index.js +15 -3
  130. package/dist/es2019/plugins/paste/handlers.js +27 -2
  131. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +12 -3
  132. package/dist/es2019/plugins/paste/pm-plugins/main.js +24 -4
  133. package/dist/es2019/plugins/status/analytics.js +1 -1
  134. package/dist/es2019/plugins/table/toolbar.js +1 -1
  135. package/dist/es2019/plugins/table/ui/common-styles.js +2 -0
  136. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +10 -10
  137. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +23 -4
  138. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +104 -0
  139. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
  140. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
  141. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +7 -1
  142. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -16
  143. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
  144. package/dist/es2019/types/browser.js +2 -0
  145. package/dist/es2019/ui/Addon/click-area-helper.js +37 -18
  146. package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
  147. package/dist/es2019/ui/ContentStyles/index.js +5 -9
  148. package/dist/es2019/ui/DropList/index.js +186 -0
  149. package/dist/es2019/ui/Dropdown/index.js +2 -6
  150. package/dist/es2019/ui/DropdownMenu/index.js +124 -75
  151. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +11 -22
  152. package/dist/es2019/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
  153. package/dist/es2019/ui/ElementBrowser/components/ElementList/utils.js +26 -2
  154. package/dist/es2019/ui/ElementBrowser/constants.js +1 -4
  155. package/dist/es2019/ui/Layer/index.js +195 -0
  156. package/dist/es2019/ui/Layer/internal/helpers.js +62 -0
  157. package/dist/es2019/ui/PortalProvider/index.js +5 -23
  158. package/dist/es2019/version-wrapper.js +1 -1
  159. package/dist/es2019/version.json +1 -1
  160. package/dist/esm/create-editor/ReactEditorView.js +13 -4
  161. package/dist/esm/create-editor/create-plugins-list.js +21 -12
  162. package/dist/esm/editor.js +9 -23
  163. package/dist/esm/labs/next/internal/hooks/use-editor/index.js +6 -1
  164. package/dist/esm/labs/next/presets/default.js +1 -1
  165. package/dist/esm/nodeviews/context-adapter.js +2 -2
  166. package/dist/esm/plugins/analytics/plugin.js +24 -11
  167. package/dist/esm/plugins/base/index.js +3 -3
  168. package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +72 -0
  169. package/dist/esm/plugins/card/index.js +1 -1
  170. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -2
  171. package/dist/esm/plugins/card/toolbar.js +11 -5
  172. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +5 -1
  173. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +7 -7
  174. package/dist/esm/plugins/clipboard/pm-plugins/main.js +1 -2
  175. package/dist/esm/plugins/code-block/actions.js +12 -0
  176. package/dist/esm/plugins/code-block/index.js +6 -0
  177. package/dist/esm/plugins/code-block/nodeviews/code-block.js +2 -4
  178. package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
  179. package/dist/esm/plugins/code-block/pm-plugins/main.js +1 -20
  180. package/dist/esm/plugins/code-block/styles.js +4 -32
  181. package/dist/esm/plugins/code-block/toolbar.js +8 -0
  182. package/dist/esm/plugins/code-block/ui/class-names.js +1 -2
  183. package/dist/esm/plugins/copy-button/commands.js +35 -15
  184. package/dist/esm/plugins/copy-button/toolbar.js +31 -0
  185. package/dist/esm/plugins/copy-button/utils.js +14 -29
  186. package/dist/esm/plugins/expand/toolbar.js +6 -2
  187. package/dist/esm/plugins/extension/toolbar.js +4 -1
  188. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +1 -1
  189. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
  190. package/dist/esm/plugins/extension/ui/Extension/styles.js +3 -4
  191. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +28 -16
  192. package/dist/esm/plugins/feedback-dialog/index.js +1 -1
  193. package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -21
  194. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +8 -27
  195. package/dist/esm/plugins/hyperlink/Toolbar.js +144 -135
  196. package/dist/esm/plugins/hyperlink/index.js +4 -4
  197. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +26 -0
  198. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
  199. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +46 -5
  200. package/dist/esm/plugins/indentation/commands/index.js +30 -9
  201. package/dist/esm/plugins/indentation/commands/utils.js +12 -8
  202. package/dist/esm/plugins/indentation/pm-plugins/keymap.js +5 -4
  203. package/dist/esm/plugins/layout/toolbar.js +2 -1
  204. package/dist/esm/plugins/media/toolbar/index.js +12 -5
  205. package/dist/esm/plugins/mentions/analytics.js +1 -1
  206. package/dist/esm/plugins/panel/toolbar.js +1 -1
  207. package/dist/esm/plugins/paste/edge-cases/index.js +15 -3
  208. package/dist/esm/plugins/paste/handlers.js +23 -2
  209. package/dist/esm/plugins/paste/pm-plugins/analytics.js +13 -3
  210. package/dist/esm/plugins/paste/pm-plugins/main.js +23 -4
  211. package/dist/esm/plugins/status/analytics.js +1 -1
  212. package/dist/esm/plugins/table/toolbar.js +1 -1
  213. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  214. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +37 -31
  215. package/dist/esm/plugins/toolbar-lists-indentation/index.js +32 -13
  216. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +105 -0
  217. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
  218. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
  219. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +7 -1
  220. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -20
  221. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
  222. package/dist/esm/types/browser.js +2 -0
  223. package/dist/esm/ui/Addon/click-area-helper.js +37 -18
  224. package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
  225. package/dist/esm/ui/ContentStyles/index.js +2 -4
  226. package/dist/esm/ui/DropList/index.js +203 -0
  227. package/dist/esm/ui/Dropdown/index.js +2 -6
  228. package/dist/esm/ui/DropdownMenu/index.js +134 -88
  229. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +27 -17
  230. package/dist/esm/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
  231. package/dist/esm/ui/ElementBrowser/components/ElementList/utils.js +26 -2
  232. package/dist/esm/ui/ElementBrowser/constants.js +1 -4
  233. package/dist/esm/ui/Layer/index.js +228 -0
  234. package/dist/esm/ui/Layer/internal/helpers.js +62 -0
  235. package/dist/esm/ui/PortalProvider/index.js +7 -26
  236. package/dist/esm/version-wrapper.js +1 -1
  237. package/dist/esm/version.json +1 -1
  238. package/dist/types/labs/next/presets/default.d.ts +2 -0
  239. package/dist/types/plugins/analytics/plugin.d.ts +5 -1
  240. package/dist/types/plugins/analytics/types/cut-copy-events.d.ts +2 -0
  241. package/dist/types/plugins/analytics/types/general-events.d.ts +1 -0
  242. package/dist/types/plugins/analytics/types/paste-events.d.ts +1 -0
  243. package/dist/types/plugins/base/index.d.ts +1 -1
  244. package/dist/types/plugins/base/pm-plugins/{fix-chrome-spell-checking.d.ts → disable-spell-checking.d.ts} +0 -0
  245. package/dist/types/plugins/card/index.d.ts +2 -7
  246. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +2 -1
  247. package/dist/types/plugins/card/toolbar.d.ts +3 -5
  248. package/dist/types/plugins/card/types.d.ts +2 -0
  249. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +4 -1
  250. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +2 -1
  251. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +3 -0
  252. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
  253. package/dist/types/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.d.ts +11 -0
  254. package/dist/types/plugins/code-block/styles.d.ts +0 -1
  255. package/dist/types/plugins/code-block/ui/class-names.d.ts +0 -1
  256. package/dist/types/plugins/copy-button/commands.d.ts +2 -2
  257. package/dist/types/plugins/copy-button/toolbar.d.ts +7 -0
  258. package/dist/types/plugins/copy-button/utils.d.ts +7 -6
  259. package/dist/types/plugins/floating-toolbar/types.d.ts +1 -2
  260. package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
  261. package/dist/types/plugins/hyperlink/index.d.ts +2 -2
  262. package/dist/types/plugins/hyperlink/types.d.ts +30 -0
  263. package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -0
  264. package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.d.ts +2 -0
  265. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +4 -3
  266. package/dist/types/plugins/indentation/commands/index.d.ts +6 -2
  267. package/dist/types/plugins/indentation/commands/utils.d.ts +8 -2
  268. package/dist/types/plugins/paste/edge-cases/index.d.ts +3 -2
  269. package/dist/types/plugins/paste/handlers.d.ts +1 -0
  270. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +7 -1
  271. package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +5 -0
  272. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -1
  273. package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +14 -0
  274. package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
  275. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
  276. package/dist/types/types/browser.d.ts +10 -0
  277. package/dist/types/types/editor-props.d.ts +6 -5
  278. package/dist/types/types/feature-flags.d.ts +29 -24
  279. package/dist/types/types/index.d.ts +1 -0
  280. package/dist/types/ui/Addon/click-area-helper.d.ts +10 -0
  281. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  282. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  283. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  284. package/dist/types/ui/DropList/index.d.ts +22 -0
  285. package/dist/types/ui/Dropdown/index.d.ts +2 -1
  286. package/dist/types/ui/DropdownMenu/index.d.ts +0 -1
  287. package/dist/types/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +1 -1
  288. package/dist/types/ui/ElementBrowser/components/ElementList/utils.d.ts +1 -0
  289. package/dist/types/ui/ElementBrowser/constants.d.ts +1 -3
  290. package/dist/types/ui/Layer/index.d.ts +47 -0
  291. package/dist/types/ui/Layer/internal/helpers.d.ts +5 -0
  292. package/package.json +23 -18
  293. package/dist/cjs/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -37
  294. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +0 -195
  295. package/dist/cjs/utils/check-if-mobile-bridge.js +0 -19
  296. package/dist/es2019/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -22
  297. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +0 -152
  298. package/dist/es2019/utils/check-if-mobile-bridge.js +0 -12
  299. package/dist/esm/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -24
  300. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +0 -178
  301. package/dist/esm/utils/check-if-mobile-bridge.js +0 -12
  302. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +0 -48
  303. package/dist/types/utils/check-if-mobile-bridge.d.ts +0 -1
@@ -1,166 +1,9 @@
1
1
  import { css } from '@emotion/react';
2
- import { themed } from '@atlaskit/theme/components';
3
- import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
4
- import { R75, N20, DN50, N30, DN20, N90, DN90, N400, DN400, N800, DN500 } from '@atlaskit/theme/colors';
5
- import { blockNodesVerticalMargin, akEditorTableCellMinWidth, akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, SelectionStyle, getSelectionStyles, akEditorCodeFontFamily, akEditorSelectedNodeClassName, overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
2
+ import { R75 } from '@atlaskit/theme/colors';
3
+ import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
6
4
  import { token } from '@atlaskit/tokens';
7
5
  import { codeBlockClassNames } from './ui/class-names';
8
6
  import { codeBlockSharedStyles } from '@atlaskit/editor-common/styles';
9
- export const highlightingCodeBlockStyles = props => css`
10
- .ProseMirror .code-block {
11
- position: relative;
12
- background-image: ${overflowShadow({
13
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4118
14
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
15
- background: themed({
16
- light: N20,
17
- dark: DN50
18
- })(props),
19
- width: '8px'
20
- })};
21
- background-repeat: no-repeat;
22
- background-color: ${themed({
23
- light: token('color.background.neutral', N20),
24
- dark: token('color.background.neutral', DN50)
25
- })(props)};
26
-
27
- --ds--code--bg-color: transparent;
28
-
29
- background-attachment: local, scroll, scroll;
30
- background-size: 8px 100%, 8px 100%, 8px 100%;
31
- background-position: 100% 0, 100% 0, 0 0;
32
- font-family: ${akEditorCodeFontFamily};
33
- border-radius: ${borderRadius()}px;
34
- margin: ${blockNodesVerticalMargin} 0 0 0;
35
- counter-reset: line;
36
- display: flex;
37
- min-width: ${akEditorTableCellMinWidth}px;
38
- cursor: pointer;
39
- overflow-x: auto;
40
-
41
- .${codeBlockClassNames.gutter} {
42
- /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */
43
- flex-shrink: 0;
44
- text-align: right;
45
- background-color: ${themed({
46
- light: token('color.background.neutral', N30),
47
- dark: token('color.background.neutral', DN20)
48
- })(props)};
49
- padding: ${gridSize()}px;
50
- color: ${themed({
51
- light: token('color.text.subtlest', N90),
52
- dark: token('color.text.subtlest', DN90)
53
- })(props)};
54
-
55
- span {
56
- display: block;
57
- line-height: 0;
58
- font-size: 0;
59
-
60
- &::before {
61
- display: inline-block;
62
- content: counter(line);
63
- counter-increment: line;
64
- font-size: ${relativeFontSizeToBase16(fontSize())};
65
- line-height: 1.5rem;
66
- color: ${themed({
67
- light: token('color.text.subtle', N400),
68
- dark: token('color.text.subtle', DN400)
69
- })(props)};
70
- }
71
- }
72
- }
73
-
74
- .${codeBlockClassNames.highlighting} {
75
- position: absolute;
76
- z-index: 2;
77
- width: 100%;
78
- height: 100%;
79
- top: 0;
80
- right: 0;
81
- bottom: 0;
82
- left: 0;
83
- pointer-events: none;
84
- overflow: hidden;
85
- tab-size: 4;
86
-
87
- & [data-ds--code--code-block] {
88
- font-size: ${relativeFontSizeToBase16(fontSize())};
89
- line-height: 1.5rem;
90
- }
91
- }
92
-
93
- .${codeBlockClassNames.content} {
94
- position: relative;
95
- z-index: 1;
96
- display: flex;
97
- flex: 1;
98
-
99
- > code {
100
- flex-grow: 1;
101
- tab-size: 4;
102
- cursor: text;
103
- /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */
104
- font-size: ${relativeFontSizeToBase16(fontSize())};
105
- line-height: 1.5rem;
106
- border-radius: ${borderRadius()}px;
107
- margin: ${gridSize()}px;
108
- white-space: pre;
109
- }
110
-
111
- &[data-debounce='true'] {
112
- .${codeBlockClassNames.highlighting} {
113
- display: none;
114
- }
115
- }
116
-
117
- &:not([data-debounce='true']) {
118
- > code:not([data-language='plaintext']):not([data-language='none']):not([data-language='']) {
119
- color: transparent;
120
- caret-color: ${themed({
121
- light: token('color.text', N800),
122
- dark: token('color.text', DN500)
123
- })(props)};
124
- }
125
- }
126
- }
127
- }
128
-
129
- .ProseMirror li > .code-block {
130
- margin: 0;
131
- }
132
-
133
- .ProseMirror .code-block.${akEditorSelectedNodeClassName}:not(.danger) {
134
- ${getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket])}
135
- }
136
-
137
- /* Danger when top level node */
138
- .ProseMirror .danger.code-block {
139
- box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
140
- ${token('color.border.danger', akEditorDeleteBorder)};
141
-
142
- .${codeBlockClassNames.gutter} {
143
- background-color: ${token('color.blanket.danger', R75)};
144
- color: ${token('color.text.danger', akEditorDeleteIconColor)};
145
- }
146
-
147
- .${codeBlockClassNames.content} {
148
- background-color: ${token('color.background.danger', akEditorDeleteBackground)};
149
- }
150
- }
151
-
152
- /* Danger when nested node */
153
- .ProseMirror .danger .code-block {
154
- .${codeBlockClassNames.gutter} {
155
- background-color: ${token('color.blanket.danger', 'rgba(255, 143, 115, 0.5)')};
156
- color: ${token('color.text.danger', akEditorDeleteIconColor)};
157
- }
158
-
159
- .${codeBlockClassNames.content} {
160
- background-color: ${token('color.background.danger', 'rgba(255, 189, 173, 0.5)')};
161
- }
162
- }
163
- `;
164
7
  export const codeBlockStyles = props => css`
165
8
  .ProseMirror {
166
9
  ${codeBlockSharedStyles(props)}
@@ -4,6 +4,7 @@ import CopyIcon from '@atlaskit/icon/glyph/copy';
4
4
  import { findDomRefAtPos } from 'prosemirror-utils';
5
5
  import { removeCodeBlock, changeLanguage, copyContentToClipboard, resetCopiedState } from './actions';
6
6
  import commonMessages from '../../messages';
7
+ import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
7
8
  import { hoverDecoration } from '../base/pm-plugins/decoration';
8
9
  import { pluginKey } from './plugin-key';
9
10
  import { createLanguageList, getLanguageIdentifier, DEFAULT_LANGUAGES } from './language-list';
@@ -60,9 +61,16 @@ export const getToolbarConfig = (allowCopyToClipboard = false) => (state, {
60
61
  type: 'button',
61
62
  appearance: 'subtle',
62
63
  icon: CopyIcon,
64
+ // note: copyContentToClipboard contains logic that also removes the
65
+ // visual feedback for the copy button
63
66
  onClick: copyContentToClipboard,
64
67
  title: formatMessage(codeBlockState.contentCopied ? commonMessages.copiedToClipboard : commonMessages.copyToClipboard),
68
+ onMouseEnter: provideVisualFeedbackForCopyButton,
69
+ // note: resetCopiedState contains logic that also removes the
70
+ // visual feedback for the copy button
65
71
  onMouseLeave: resetCopiedState,
72
+ onFocus: provideVisualFeedbackForCopyButton,
73
+ onBlur: removeVisualFeedbackForCopyButton,
66
74
  hideTooltipOnClick: false,
67
75
  disabled: codeBlockState.isNodeSelected,
68
76
  tabIndex: null
@@ -1,6 +1,5 @@
1
1
  import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
2
2
  export const codeBlockClassNames = {
3
3
  gutter: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER,
4
- content: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT,
5
- highlighting: 'code-highlighting'
4
+ content: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
6
5
  };
@@ -1,37 +1,57 @@
1
- import { findSelectedNodeOfType, findParentNodeOfType } from 'prosemirror-utils';
2
1
  import { pluginKey } from './pm-plugins/plugin-key';
3
2
  import { hoverDecoration } from '../base/pm-plugins/decoration';
4
- import { DOMSerializer } from 'prosemirror-model';
5
3
  import { copyHTMLToClipboard } from '../../utils/clipboard';
6
- export const copy = nodeType => (state, dispatch) => {
4
+ import { getSelectedNodeOrNodeParentByNodeType, toDOM } from './utils';
5
+ import { addAnalytics, ACTION, INPUT_METHOD } from '../analytics';
6
+ import { getAnalyticsPayload } from '../clipboard/pm-plugins/main';
7
+ export const createToolbarCopyCommand = nodeType => (state, dispatch) => {
7
8
  const {
8
9
  tr,
9
10
  schema
10
11
  } = state; // This command should only be triggered by the Copy button in the floating toolbar
11
12
  // which is only visible when selection is inside the target node
12
13
 
13
- let node = findSelectedNodeOfType(nodeType)(tr.selection);
14
-
15
- if (!node) {
16
- node = findParentNodeOfType(nodeType)(tr.selection);
17
- }
14
+ let node = getSelectedNodeOrNodeParentByNodeType({
15
+ nodeType,
16
+ selection: tr.selection
17
+ });
18
18
 
19
19
  if (!node) {
20
20
  return false;
21
21
  }
22
22
 
23
- const domNode = DOMSerializer.fromSchema(schema).serializeNode(node.node);
24
- const div = document.createElement('div');
25
- div.appendChild(domNode); // The "0 0" refers to the start and end depth of the slice
26
- // since we're coping the block node only, it will always be 0 0
27
- // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
23
+ const domNode = toDOM(node.node, schema);
24
+
25
+ if (domNode) {
26
+ const div = document.createElement('div');
27
+ div.appendChild(domNode); // if copying inline content
28
+
29
+ if (node.node.type.inlineContent) {
30
+ // The "1 1" refers to the start and end depth of the slice
31
+ // since we're copying the text inside a paragraph, it will always be 1 1
32
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
33
+ div.firstChild.setAttribute('data-pm-slice', '1 1 []');
34
+ } else {
35
+ // The "0 0" refers to the start and end depth of the slice
36
+ // since we're copying the block node only, it will always be 0 0
37
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
38
+ div.firstChild.setAttribute('data-pm-slice', '0 0 []');
39
+ }
40
+
41
+ copyHTMLToClipboard(div.innerHTML);
42
+ }
28
43
 
29
- div.firstChild.setAttribute('data-pm-slice', '0 0 []');
30
- copyHTMLToClipboard(div.innerHTML);
31
44
  const copyToClipboardTr = tr;
32
45
  copyToClipboardTr.setMeta(pluginKey, {
33
46
  copied: true
34
47
  });
48
+ const analyticsPayload = getAnalyticsPayload(state, ACTION.COPIED);
49
+
50
+ if (analyticsPayload) {
51
+ analyticsPayload.attributes.inputMethod = INPUT_METHOD.FLOATING_TB;
52
+ analyticsPayload.attributes.nodeType = node.node.type.name;
53
+ addAnalytics(state, copyToClipboardTr, analyticsPayload);
54
+ }
35
55
 
36
56
  if (dispatch) {
37
57
  dispatch(copyToClipboardTr);
@@ -0,0 +1,29 @@
1
+ import CopyIcon from '@atlaskit/icon/glyph/copy';
2
+ import commonMessages from '../../messages';
3
+ import { hoverDecoration } from '../base/pm-plugins/decoration';
4
+ import { createToolbarCopyCommand, resetCopiedState } from './commands';
5
+ import { pluginKey } from './pm-plugins/plugin-key';
6
+ export const getCopyButtonConfig = (state, formatMessage, nodeType, onMouseEnter, onMouseLeave) => {
7
+ const copyButtonState = pluginKey.getState(state);
8
+ return {
9
+ id: 'editor.floatingToolbar.copy',
10
+ type: 'button',
11
+ appearance: 'subtle',
12
+ icon: CopyIcon,
13
+ onClick: createToolbarCopyCommand(nodeType),
14
+ title: formatMessage(copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied ? commonMessages.copiedToClipboard : commonMessages.copyToClipboard),
15
+ onMouseEnter: onMouseEnter || hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
16
+ onMouseLeave: resetCopiedState(nodeType, onMouseLeave),
17
+ onFocus: hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
18
+ onBlur: hoverDecoration(nodeType, false),
19
+ hideTooltipOnClick: false,
20
+ tabIndex: null // TODO select and delete styling needs to be removed when keyboard cursor moves away
21
+ // problem already exist with delete as well
22
+
23
+ };
24
+ };
25
+ export const showCopyButton = state => {
26
+ return state && // Check if the Copy button plugin is enabled
27
+ // @ts-ignore pluginKey.key
28
+ state.plugins.find(p => p.key === pluginKey.key);
29
+ };
@@ -1,29 +1,17 @@
1
- import CopyIcon from '@atlaskit/icon/glyph/copy';
2
- import commonMessages from '../../messages';
3
- import { hoverDecoration } from '../base/pm-plugins/decoration';
4
- import { copy, resetCopiedState } from './commands';
5
- import { pluginKey } from './pm-plugins/plugin-key';
6
- export const getCopyButtonConfig = (state, formatMessage, nodeType, onMouseEnter, onMouseLeave) => {
7
- const copyButtonState = pluginKey.getState(state);
8
- return {
9
- id: 'editor.floatingToolbar.copy',
10
- type: 'button',
11
- appearance: 'subtle',
12
- icon: CopyIcon,
13
- onClick: copy(nodeType),
14
- title: formatMessage(copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied ? commonMessages.copiedToClipboard : commonMessages.copyToClipboard),
15
- onMouseEnter: onMouseEnter || hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
16
- onMouseLeave: resetCopiedState(nodeType, onMouseLeave),
17
- onFocus: hoverDecoration(nodeType, true, 'ak-editor-selected-node'),
18
- onBlur: hoverDecoration(nodeType, false),
19
- hideTooltipOnClick: false,
20
- tabIndex: null // TODO select and delete styling needs to be removed when keyboard cursor moves away
21
- // problem already exist with delete as well
1
+ import { findSelectedNodeOfType, findParentNodeOfType } from 'prosemirror-utils';
2
+ import { DOMSerializer } from 'prosemirror-model';
3
+ export function getSelectedNodeOrNodeParentByNodeType({
4
+ nodeType,
5
+ selection
6
+ }) {
7
+ let node = findSelectedNodeOfType(nodeType)(selection);
22
8
 
23
- };
24
- };
25
- export const showCopyButton = state => {
26
- return state && // Check if the Copy button plugin is enabled
27
- // @ts-ignore pluginKey.key
28
- state.plugins.find(p => p.key === pluginKey.key);
9
+ if (!node) {
10
+ node = findParentNodeOfType(nodeType)(selection);
11
+ }
12
+
13
+ return node;
14
+ }
15
+ export const toDOM = (node, schema) => {
16
+ return DOMSerializer.fromSchema(schema).serializeNode(node);
29
17
  };
@@ -3,6 +3,7 @@ import commonMessages from '../../messages';
3
3
  import { deleteExpand } from './commands';
4
4
  import { hoverDecoration } from '../base/pm-plugins/decoration';
5
5
  import { getPluginState } from './pm-plugins/plugin-factory';
6
+ import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
6
7
  export const getToolbarConfig = (state, {
7
8
  formatMessage
8
9
  }) => {
@@ -20,7 +21,9 @@ export const getToolbarConfig = (state, {
20
21
  getDomRef: () => expandRef,
21
22
  nodeType: [nestedExpand, expand],
22
23
  offset: [0, 6],
23
- items: [{
24
+ items: [...(state && showCopyButton(state) ? [getCopyButtonConfig(state, formatMessage, [nestedExpand, expand]), {
25
+ type: 'separator'
26
+ }] : []), {
24
27
  id: 'editor.expand.delete',
25
28
  type: 'button',
26
29
  appearance: 'danger',
@@ -12,6 +12,7 @@ import { getPluginState } from './pm-plugins/main';
12
12
  import { getSelectedExtension } from './utils';
13
13
  import { updateExtensionLayout, removeExtension } from './commands';
14
14
  import { pluginKey as macroPluginKey } from '../macro/plugin-key';
15
+ import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
15
16
  export const messages = defineMessages({
16
17
  edit: {
17
18
  id: 'fabric.editor.edit',
@@ -119,7 +120,9 @@ export const getToolbarConfig = (breakoutEnabled = true) => (state, intl) => {
119
120
  }, {
120
121
  type: 'extensions-placeholder',
121
122
  separator: 'end'
122
- }, {
123
+ }, ...(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, nodeType), {
124
+ type: 'separator'
125
+ }] : []), {
123
126
  id: 'editor.extension.delete',
124
127
  type: 'button',
125
128
  icon: RemoveIcon,
@@ -33,7 +33,7 @@ export const wrapperStyle = (theme, extensionWidth) => css`
33
33
  }
34
34
  `;
35
35
  export const header = css`
36
- padding: ${padding / 2}px ${padding / 2}px ${padding / 4}px;
36
+ padding: ${padding / 2}px ${padding / 2}px 0px;
37
37
  vertical-align: middle;
38
38
 
39
39
  &.with-children:not(.without-frame) {
@@ -7,7 +7,7 @@ export const wrapperStyle = theme => css`
7
7
 
8
8
  cursor: pointer;
9
9
  display: inline-flex;
10
- margin: 1px;
10
+ margin: 1px 1px 4px;
11
11
 
12
12
  > img {
13
13
  border-radius: ${borderRadius()}px;
@@ -1,9 +1,8 @@
1
1
  import { css } from '@emotion/react';
2
- import { fontSize, gridSize } from '@atlaskit/theme/constants';
2
+ import { gridSize } from '@atlaskit/theme/constants';
3
3
  import { themed } from '@atlaskit/theme/components';
4
4
  import { borderRadius } from '@atlaskit/theme/constants';
5
5
  import { N20, DN50, DN700, B200, N20A, N70 } from '@atlaskit/theme/colors';
6
- import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
7
6
  import { token } from '@atlaskit/tokens';
8
7
  export const padding = gridSize();
9
8
  export const BODIED_EXT_PADDING = padding * 2;
@@ -18,7 +17,6 @@ export const wrapperDefault = theme => css`
18
17
  })(theme)};
19
18
  position: relative;
20
19
  vertical-align: middle;
21
- font-size: ${relativeFontSizeToBase16(fontSize())};
22
20
 
23
21
  .ProseMirror-selectednode > span > & > .extension-overlay {
24
22
  box-shadow: inset 0px 0px 0px 2px ${token('color.border.selected', B200)};
@@ -1,10 +1,24 @@
1
1
  import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
2
- import { browser } from '@atlaskit/editor-common/utils';
3
2
 
4
- const safeNumberFeatureFlag = value => {
5
- const parsedValue = parseInt(value, 10);
6
- return !isNaN(parsedValue) && Number.isInteger(parsedValue) && Number.isSafeInteger(parsedValue) ? parsedValue : undefined;
7
- };
3
+ function verifyJSON(json) {
4
+ try {
5
+ return JSON.parse(json);
6
+ } catch (e) {
7
+ return undefined;
8
+ }
9
+ }
10
+
11
+ function getSpellCheck(featureFlags) {
12
+ if (!!(featureFlags !== null && featureFlags !== void 0 && featureFlags['disableSpellcheckByBrowser'])) {
13
+ return typeof (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser']) === 'object' ? featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser'] : typeof (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser']) === 'string' ? verifyJSON(featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disableSpellcheckByBrowser']) : undefined;
14
+ }
15
+
16
+ if (!!(featureFlags !== null && featureFlags !== void 0 && featureFlags['disable-spellcheck-by-browser'])) {
17
+ return typeof (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser']) === 'object' ? featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser'] : typeof (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser']) === 'string' ? verifyJSON(featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags['disable-spellcheck-by-browser']) : undefined;
18
+ }
19
+
20
+ return undefined;
21
+ }
8
22
  /**
9
23
  * Transforms EditorProps to an FeatureFlags object,
10
24
  * which is used by both current and archv3 editors.
@@ -12,7 +26,7 @@ const safeNumberFeatureFlag = value => {
12
26
 
13
27
 
14
28
  export function createFeatureFlagsFromProps(props) {
15
- var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _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$featureFlags30, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$collabEdit, _props$collabEdit2, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38, _props$featureFlags39, _props$featureFlags40, _props$featureFlags41;
29
+ var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$allowTables, _props$featureFlags3, _props$featureFlags4, _props$allowTables2, _props$featureFlags5, _props$featureFlags6, _props$allowTables3, _props$featureFlags7, _props$featureFlags8, _props$allowTables4, _props$featureFlags9, _props$featureFlags10, _props$allowTables5, _props$allowExtension, _props$featureFlags11, _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$featureFlags30, _props$collabEdit, _props$collabEdit2, _props$featureFlags31, _props$featureFlags32, _props$featureFlags33, _props$featureFlags34, _props$featureFlags35, _props$featureFlags36, _props$featureFlags37, _props$featureFlags38;
16
30
 
17
31
  const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
18
32
  return { ...normalizedFeatureFlags,
@@ -42,16 +56,14 @@ export function createFeatureFlagsFromProps(props) {
42
56
  plainTextPasteLinkification: Boolean(typeof ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.plainTextPasteLinkification) === 'boolean' ? !!((_props$featureFlags22 = props.featureFlags) !== null && _props$featureFlags22 !== void 0 && _props$featureFlags22.plainTextPasteLinkification) : false),
43
57
  collabAvatarScroll: Boolean(typeof ((_props$featureFlags23 = props.featureFlags) === null || _props$featureFlags23 === void 0 ? void 0 : _props$featureFlags23.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags24 = props.featureFlags) !== null && _props$featureFlags24 !== void 0 && _props$featureFlags24.collabAvatarScroll) : false),
44
58
  ufo: Boolean(typeof ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.ufo) === 'boolean' ? !!((_props$featureFlags26 = props.featureFlags) !== null && _props$featureFlags26 !== void 0 && _props$featureFlags26.ufo) : false),
45
- codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
46
59
  twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags27 = props.featureFlags) === null || _props$featureFlags27 === void 0 ? void 0 : _props$featureFlags27.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags28 = props.featureFlags) !== null && _props$featureFlags28 !== void 0 && _props$featureFlags28.twoLineEditorToolbar) : false),
47
- codeBidiWarnings: Boolean(typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.codeBidiWarnings) : true),
48
- saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags32 = props.featureFlags) !== null && _props$featureFlags32 !== void 0 && _props$featureFlags32.saferDispatchedTransactions) : false)),
49
- maxUnsafeChromeSpellcheckingVersion: safeNumberFeatureFlag((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.maxUnsafeChromeSpellcheckingVersion),
60
+ saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags29 = props.featureFlags) === null || _props$featureFlags29 === void 0 ? void 0 : _props$featureFlags29.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags30 = props.featureFlags) !== null && _props$featureFlags30 !== void 0 && _props$featureFlags30.saferDispatchedTransactions) : false)),
50
61
  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),
51
- chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags34 = props.featureFlags) === null || _props$featureFlags34 === void 0 ? void 0 : _props$featureFlags34.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
52
- viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
53
- showHoverPreview: Boolean(typeof ((_props$featureFlags36 = props.featureFlags) === null || _props$featureFlags36 === void 0 ? void 0 : _props$featureFlags36.showHoverPreview) === 'boolean' ? !!((_props$featureFlags37 = props.featureFlags) !== null && _props$featureFlags37 !== void 0 && _props$featureFlags37.showHoverPreview) : false),
54
- indentationButtonsInTheToolbar: Boolean(typeof ((_props$featureFlags38 = props.featureFlags) === null || _props$featureFlags38 === void 0 ? void 0 : _props$featureFlags38['indentation-buttons-in-the-toolbar']) === 'boolean' ? !!((_props$featureFlags39 = props.featureFlags) !== null && _props$featureFlags39 !== void 0 && _props$featureFlags39['indentation-buttons-in-the-toolbar']) : false),
55
- floatingToolbarCopyButton: Boolean(typeof ((_props$featureFlags40 = props.featureFlags) === null || _props$featureFlags40 === void 0 ? void 0 : _props$featureFlags40.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags41 = props.featureFlags) !== null && _props$featureFlags41 !== void 0 && _props$featureFlags41.floatingToolbarCopyButton) : false)
62
+ chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags31 = props.featureFlags) === null || _props$featureFlags31 === void 0 ? void 0 : _props$featureFlags31.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
63
+ viewChangingExperimentToolbarStyle: typeof ((_props$featureFlags32 = props.featureFlags) === null || _props$featureFlags32 === void 0 ? void 0 : _props$featureFlags32['view-changing-experiment-toolbar-style']) === 'string' ? props.featureFlags['view-changing-experiment-toolbar-style'] || undefined : undefined,
64
+ showHoverPreview: Boolean(typeof ((_props$featureFlags33 = props.featureFlags) === null || _props$featureFlags33 === void 0 ? void 0 : _props$featureFlags33.showHoverPreview) === 'boolean' ? !!((_props$featureFlags34 = props.featureFlags) !== null && _props$featureFlags34 !== void 0 && _props$featureFlags34.showHoverPreview) : false),
65
+ indentationButtonsInTheToolbar: Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags35 = props.featureFlags) === null || _props$featureFlags35 === void 0 ? void 0 : _props$featureFlags35.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags36 = props.featureFlags) !== null && _props$featureFlags36 !== void 0 && _props$featureFlags36.indentationButtonsInTheToolbar) : false)),
66
+ floatingToolbarCopyButton: Boolean(typeof normalizedFeatureFlags.floatingToolbarCopyButton === 'boolean' && !!normalizedFeatureFlags.floatingToolbarCopyButton || (typeof ((_props$featureFlags37 = props.featureFlags) === null || _props$featureFlags37 === void 0 ? void 0 : _props$featureFlags37.floatingToolbarCopyButton) === 'boolean' ? !!((_props$featureFlags38 = props.featureFlags) !== null && _props$featureFlags38 !== void 0 && _props$featureFlags38.floatingToolbarCopyButton) : false)),
67
+ disableSpellcheckByBrowser: getSpellCheck(props.featureFlags)
56
68
  };
57
69
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { PluginKey } from 'prosemirror-state';
3
3
  import { IconFeedback } from '../quick-insert/assets';
4
- import { version as coreVersion } from '../../version.json';
4
+ import { version as coreVersion } from '../../version-wrapper';
5
5
  import { addAnalytics, ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '../analytics';
6
6
  import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
7
7
  import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
@@ -43,12 +43,6 @@ class FindReplaceToolbarButton extends React.PureComponent {
43
43
  constructor(...args) {
44
44
  super(...args);
45
45
 
46
- _defineProperty(this, "handleKeydown", event => {
47
- if (event.metaKey && event.key === 'f') {
48
- event.preventDefault();
49
- }
50
- });
51
-
52
46
  _defineProperty(this, "toggleOpen", () => {
53
47
  if (this.props.isActive) {
54
48
  this.props.onCancel({
@@ -60,19 +54,6 @@ class FindReplaceToolbarButton extends React.PureComponent {
60
54
  });
61
55
  }
62
56
 
63
- componentDidMount() {
64
- window.addEventListener('keydown', this.handleKeydown);
65
- }
66
-
67
- componentWillUnmount() {
68
- window.removeEventListener('keydown', this.handleKeydown);
69
- }
70
- /**
71
- * Prevent browser find opening if you hit cmd+f with cursor
72
- * inside find/replace component
73
- */
74
-
75
-
76
57
  render() {
77
58
  const {
78
59
  popupsMountPoint,
@@ -2,9 +2,8 @@
2
2
  import { css, jsx } from '@emotion/react';
3
3
  import { Component } from 'react';
4
4
  import { gridSize } from '@atlaskit/theme/constants';
5
- import { B400 } from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
6
-
7
- import Item, { itemThemeNamespace } from '@atlaskit/item';
5
+ import { B400 } from '@atlaskit/theme/colors';
6
+ import { ButtonItem } from '@atlaskit/menu';
8
7
  import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
9
8
  import Tooltip from '@atlaskit/tooltip';
10
9
  import { injectIntl } from 'react-intl-next';
@@ -22,30 +21,17 @@ const spacer = css`
22
21
  const menuContainer = css`
23
22
  min-width: ${menuItemDimensions.width}px;
24
23
 
25
- // temporary solution before we migrated off dst/item
26
- & span[class^='ItemParts__Before'] {
27
- margin-right: 4px;
24
+ // temporary solution to retain spacing defined by @atlaskit/Item
25
+ & button {
26
+ min-height: ${gridSize() * 4}px;
27
+ padding: 8px 8px 7px;
28
+
29
+ & > [data-item-elem-before] {
30
+ margin-right: ${gridSize() / 2}px;
31
+ }
28
32
  }
29
33
  `;
30
- const padding = gridSize();
31
34
  export const itemSpacing = gridSize() / 2;
32
- const editorItemTheme = {
33
- borderRadius: 0,
34
- beforeItemSpacing: {
35
- compact: itemSpacing
36
- },
37
- padding: {
38
- compact: {
39
- bottom: padding,
40
- left: padding,
41
- right: padding,
42
- top: padding
43
- }
44
- },
45
- height: {
46
- compact: menuItemDimensions.height
47
- }
48
- };
49
35
 
50
36
  class Dropdown extends Component {
51
37
  render() {
@@ -58,10 +44,9 @@ class Dropdown extends Component {
58
44
  return jsx("div", {
59
45
  css: menuContainer
60
46
  }, items.filter(item => !item.hidden).map((item, idx) => {
61
- const itemContent = jsx(Item, {
47
+ const itemContent = jsx(ButtonItem, {
62
48
  key: idx,
63
- isCompact: true,
64
- elemBefore: this.renderSelected(item, intl),
49
+ iconBefore: this.renderSelected(item, intl),
65
50
  onClick: () => {
66
51
  /**
67
52
  * The order of dispatching the event and hide() is important, because
@@ -74,8 +59,8 @@ class Dropdown extends Component {
74
59
  },
75
60
  "data-testid": item.testId,
76
61
  isDisabled: item.disabled,
77
- theme: {
78
- [itemThemeNamespace]: editorItemTheme
62
+ onMouseDown: e => {
63
+ e.preventDefault();
79
64
  }
80
65
  }, item.title);
81
66