@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
@@ -11,8 +11,9 @@ import { RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '../../ui/
11
11
  import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
12
12
  import { addAnalytics, ACTION_SUBJECT_ID } from '../analytics';
13
13
  import { buildVisitedLinkPayload } from '../../utils/linking-utils';
14
- /* type guard for edit links */
14
+ import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
15
15
 
16
+ /* type guard for edit links */
16
17
  function isEditLink(linkMark) {
17
18
  return linkMark.pos !== undefined;
18
19
  }
@@ -41,7 +42,7 @@ function getLinkText(activeLinkMark, state) {
41
42
  return activeLinkMark.node.text;
42
43
  }
43
44
 
44
- export const getToolbarConfig = (state, intl, providerFactory, cardOptions) => {
45
+ export const getToolbarConfig = options => (state, intl, providerFactory) => {
45
46
  const {
46
47
  formatMessage
47
48
  } = intl;
@@ -95,7 +96,7 @@ export const getToolbarConfig = (state, intl, providerFactory, cardOptions) => {
95
96
  intl: intl,
96
97
  editorView: editorView,
97
98
  editorState: state,
98
- cardOptions: cardOptions,
99
+ cardOptions: options === null || options === void 0 ? void 0 : options.cardOptions,
99
100
  providerFactory: providerFactory // platform={} // TODO: pass platform
100
101
 
101
102
  });
@@ -133,7 +134,9 @@ export const getToolbarConfig = (state, intl, providerFactory, cardOptions) => {
133
134
  title: labelUnlink,
134
135
  icon: UnlinkIcon,
135
136
  tabIndex: null
136
- }]
137
+ }, ...(state && showCopyButton(state) ? [{
138
+ type: 'separator'
139
+ }, getCopyButtonConfig(state, intl.formatMessage, hyperLinkToolbar.nodeType)] : [])]
137
140
  };
138
141
  }
139
142
 
@@ -162,11 +165,14 @@ export const getToolbarConfig = (state, intl, providerFactory, cardOptions) => {
162
165
  return /*#__PURE__*/React.createElement(HyperlinkAddToolbar, {
163
166
  view: view,
164
167
  key: idx,
168
+ linkPickerOptions: options === null || options === void 0 ? void 0 : options.linkPicker,
165
169
  displayUrl: link,
166
170
  displayText: displayText || '',
167
171
  providerFactory: providerFactory,
168
172
  onSubmit: (href, title = '', displayText, inputMethod) => {
169
- isEditLink(activeLinkMark) ? updateLink(href, displayText || title, activeLinkMark.pos)(view.state, view.dispatch) : insertLinkWithAnalytics(inputMethod, activeLinkMark.from, activeLinkMark.to, href, title, displayText, !!(cardOptions && cardOptions.provider))(view.state, view.dispatch);
173
+ var _options$cardOptions;
174
+
175
+ isEditLink(activeLinkMark) ? updateLink(href, displayText || title, activeLinkMark.pos)(view.state, view.dispatch) : insertLinkWithAnalytics(inputMethod, activeLinkMark.from, activeLinkMark.to, href, title, displayText, !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider))(view.state, view.dispatch);
170
176
  view.focus();
171
177
  }
172
178
  });
@@ -21,9 +21,11 @@ const hyperlinkPlugin = options => ({
21
21
  },
22
22
 
23
23
  pmPlugins() {
24
+ var _options$cardOptions;
25
+
24
26
  // Skip analytics if card provider is available, as they will be
25
27
  // sent on handleRejected upon attempting to resolve smart link.
26
- const skipAnalytics = !!options && !!options.provider;
28
+ const skipAnalytics = !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider);
27
29
  return [{
28
30
  name: 'hyperlink',
29
31
  plugin: ({
@@ -73,9 +75,7 @@ const hyperlinkPlugin = options => ({
73
75
  }
74
76
 
75
77
  }],
76
- floatingToolbar: (state, intl, providerFactory) => {
77
- return getToolbarConfig(state, intl, providerFactory, options);
78
- }
78
+ floatingToolbar: getToolbarConfig(options)
79
79
  }
80
80
  });
81
81
 
@@ -0,0 +1,24 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useCallback } from 'react';
3
+ import { LinkPicker } from '@atlaskit/link-picker';
4
+ import { hideLinkToolbar as cardHideLinkToolbar } from '../../../card/pm-plugins/actions';
5
+ import { hideLinkToolbar } from '../../commands';
6
+ import { useEscapeClickaway } from './useEscapeClickaway';
7
+ export const EditorLinkPicker = ({
8
+ view,
9
+ ...restProps
10
+ }) => {
11
+ const onEscape = useCallback(() => {
12
+ hideLinkToolbar()(view.state, view.dispatch);
13
+ view.dispatch(cardHideLinkToolbar(view.state.tr));
14
+ }, [view]);
15
+ const onClickAway = useCallback(() => {
16
+ hideLinkToolbar()(view.state, view.dispatch);
17
+ }, [view]);
18
+ const ref = useEscapeClickaway(onEscape, onClickAway);
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ ref: ref
21
+ }, /*#__PURE__*/React.createElement(LinkPicker, _extends({}, restProps, {
22
+ onCancel: onEscape
23
+ })));
24
+ };
@@ -0,0 +1,28 @@
1
+ import { useEffect, useRef } from 'react';
2
+ export const useEscapeClickaway = (onEscape, onClickAway) => {
3
+ const ref = useRef(null);
4
+ useEffect(() => {
5
+ const handleClickAway = event => {
6
+ const el = ref.current;
7
+
8
+ if (event.target instanceof Element && el && !el.contains(event.target)) {
9
+ onClickAway();
10
+ }
11
+ };
12
+
13
+ const handleKeydown = event => {
14
+ if (event.key === 'Escape') {
15
+ event.preventDefault();
16
+ onEscape();
17
+ }
18
+ };
19
+
20
+ document.addEventListener('mousedown', handleClickAway);
21
+ document.addEventListener('keydown', handleKeydown);
22
+ return () => {
23
+ document.removeEventListener('mousedown', handleClickAway);
24
+ document.removeEventListener('keydown', handleKeydown);
25
+ };
26
+ }, [onClickAway, onEscape]);
27
+ return ref;
28
+ };
@@ -1,11 +1,30 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
3
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
3
4
  import HyperlinkAddToolbarComp from './HyperlinkAddToolbar';
5
+ import { INPUT_METHOD } from '../../../analytics';
4
6
  import { stateKey as pluginKey } from '../../pm-plugins/main';
5
7
  import WithPluginState from '../../../../ui/WithPluginState';
8
+ import { getFeatureFlags } from '../../../feature-flags-context';
9
+ import { EditorLinkPicker } from '../EditorLinkPicker';
10
+
11
+ /**
12
+ * Wraps around the editor's onSubmit handler so that the plugin can interface with the link picker
13
+ */
14
+ const onSubmitInterface = onSubmit => ({
15
+ url,
16
+ title,
17
+ displayText,
18
+ rawUrl,
19
+ meta
20
+ }) => {
21
+ onSubmit(url, title !== null && title !== void 0 ? title : rawUrl, displayText || undefined, meta.inputMethod === 'manual' ? INPUT_METHOD.MANUAL : INPUT_METHOD.TYPEAHEAD);
22
+ };
23
+
6
24
  export default class HyperlinkAddToolbar extends React.PureComponent {
7
25
  render() {
8
26
  const {
27
+ linkPickerOptions = {},
9
28
  onSubmit,
10
29
  displayText,
11
30
  displayUrl,
@@ -25,15 +44,37 @@ export default class HyperlinkAddToolbar extends React.PureComponent {
25
44
  },
26
45
  render: ({
27
46
  hyperlinkPluginState
28
- }) => /*#__PURE__*/React.createElement(HyperlinkAddToolbarComp, {
29
- activityProvider: activityProvider,
30
- searchProvider: searchProvider,
31
- onSubmit: onSubmit,
32
- displayText: displayText,
33
- displayUrl: displayUrl,
34
- pluginState: hyperlinkPluginState,
35
- view: view
36
- })
47
+ }) => {
48
+ var _linkPickerOptions$pl;
49
+
50
+ const {
51
+ lpLinkPicker
52
+ } = getFeatureFlags(view.state);
53
+ /**
54
+ * If activityProvider or searchProvider are present then only enable if there are plugins supplied to
55
+ * faciliate providing link search capabilities
56
+ */
57
+
58
+ if (lpLinkPicker && (!activityProvider && !searchProvider || Boolean(linkPickerOptions === null || linkPickerOptions === void 0 ? void 0 : (_linkPickerOptions$pl = linkPickerOptions.plugins) === null || _linkPickerOptions$pl === void 0 ? void 0 : _linkPickerOptions$pl.length))) {
59
+ return /*#__PURE__*/React.createElement(EditorLinkPicker, _extends({
60
+ view: view
61
+ }, linkPickerOptions, {
62
+ url: displayUrl,
63
+ displayText: displayText,
64
+ onSubmit: onSubmitInterface(onSubmit)
65
+ }));
66
+ }
67
+
68
+ return /*#__PURE__*/React.createElement(HyperlinkAddToolbarComp, {
69
+ activityProvider: activityProvider,
70
+ searchProvider: searchProvider,
71
+ onSubmit: onSubmit,
72
+ displayText: displayText,
73
+ displayUrl: displayUrl,
74
+ pluginState: hyperlinkPluginState,
75
+ view: view
76
+ });
77
+ }
37
78
  })
38
79
  });
39
80
  }
@@ -1,10 +1,9 @@
1
1
  import { toggleBlockMark } from '../../../commands';
2
2
  import { createAnalyticsDispatch } from './utils';
3
- import { INDENT_DIRECTION } from '../../analytics';
3
+ import { INDENT_DIRECTION, INPUT_METHOD } from '../../analytics';
4
4
  import getAttrsWithChangesRecorder from '../../../utils/getAttrsWithChangesRecorder';
5
- const MAX_INDENTATION_LEVEL = 6;
6
-
7
- const isIndentationAllowed = (schema, node) => {
5
+ export const MAX_INDENTATION_LEVEL = 6;
6
+ export const isIndentationAllowed = (schema, node) => {
8
7
  const {
9
8
  nodes: {
10
9
  paragraph,
@@ -31,7 +30,6 @@ const isIndentationAllowed = (schema, node) => {
31
30
  * @param getNewIndentationAttrs Function to handle new indentation level
32
31
  */
33
32
 
34
-
35
33
  function createIndentationCommand(getNewIndentationAttrs) {
36
34
  return (state, dispatch) => {
37
35
  const {
@@ -41,7 +39,11 @@ function createIndentationCommand(getNewIndentationAttrs) {
41
39
  };
42
40
  }
43
41
 
44
- function createIndentationCommandWithAnalytics(getNewIndentationAttrs, direction) {
42
+ function createIndentationCommandWithAnalytics({
43
+ getNewIndentationAttrs,
44
+ direction,
45
+ inputMethod
46
+ }) {
45
47
  // Create a new getAttrs function to record the changes
46
48
  const {
47
49
  getAttrs,
@@ -53,7 +55,12 @@ function createIndentationCommandWithAnalytics(getNewIndentationAttrs, direction
53
55
  const indentationCommand = createIndentationCommand(getAttrs); // Return a new command where we change dispatch for our analytics dispatch
54
56
 
55
57
  return (state, dispatch) => {
56
- return indentationCommand(state, createAnalyticsDispatch(getAndResetAttrsChanges, state, dispatch));
58
+ return indentationCommand(state, createAnalyticsDispatch({
59
+ getAttrsChanges: getAndResetAttrsChanges,
60
+ inputMethod,
61
+ state,
62
+ dispatch
63
+ }));
57
64
  };
58
65
  }
59
66
  /**
@@ -85,7 +92,11 @@ const getIndentAttrs = oldAttr => {
85
92
  }; // Otherwise, increase the level by one
86
93
  };
87
94
 
88
- export const indent = createIndentationCommandWithAnalytics(getIndentAttrs, INDENT_DIRECTION.INDENT);
95
+ export const getIndentCommand = (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
96
+ getNewIndentationAttrs: getIndentAttrs,
97
+ direction: INDENT_DIRECTION.INDENT,
98
+ inputMethod
99
+ });
89
100
  /**
90
101
  * Get new level for outdent
91
102
  * @param oldAttr Old attributes for the mark, undefined if the mark doesn't exit
@@ -112,5 +123,9 @@ const getOutdentAttrs = oldAttr => {
112
123
  }; // Decrease the level on other cases
113
124
  };
114
125
 
115
- export const outdent = createIndentationCommandWithAnalytics(getOutdentAttrs, INDENT_DIRECTION.OUTDENT);
126
+ export const getOutdentCommand = (inputMethod = INPUT_METHOD.KEYBOARD) => createIndentationCommandWithAnalytics({
127
+ getNewIndentationAttrs: getOutdentAttrs,
128
+ direction: INDENT_DIRECTION.OUTDENT,
129
+ inputMethod
130
+ });
116
131
  export const removeIndentation = (state, dispatch) => toggleBlockMark(state.schema.marks.indentation, () => false)(state, dispatch);
@@ -1,4 +1,4 @@
1
- import { addAnalytics, INDENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '../../analytics';
1
+ import { addAnalytics, INDENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics';
2
2
  const indentTypes = {
3
3
  paragraph: INDENT_TYPE.PARAGRAPH,
4
4
  heading: INDENT_TYPE.HEADING
@@ -40,7 +40,12 @@ export function getPrevIndentLevel(prevAttrs) {
40
40
  * @returns
41
41
  */
42
42
 
43
- export function createAnalyticsDispatch(getAttrsChanges, state, dispatch) {
43
+ export function createAnalyticsDispatch({
44
+ getAttrsChanges,
45
+ inputMethod,
46
+ state,
47
+ dispatch
48
+ }) {
44
49
  return tr => {
45
50
  let currentTr = tr;
46
51
  const changes = getAttrsChanges(); // Get all attributes changes
@@ -66,7 +71,7 @@ export function createAnalyticsDispatch(getAttrsChanges, state, dispatch) {
66
71
  actionSubjectId: ACTION_SUBJECT_ID.FORMAT_INDENT,
67
72
  eventType: EVENT_TYPE.TRACK,
68
73
  attributes: {
69
- inputMethod: INPUT_METHOD.KEYBOARD,
74
+ inputMethod,
70
75
  previousIndentationLevel: getPrevIndentLevel(prevAttrs),
71
76
  newIndentLevel: getNewIndentLevel(prevAttrs, newAttrs),
72
77
  direction,
@@ -1,18 +1,19 @@
1
1
  import { keymap } from 'prosemirror-keymap';
2
2
  import * as keymaps from '../../../keymaps';
3
3
  import { isTextSelection } from '../../../utils';
4
- import { indent, outdent } from '../commands';
4
+ import { getIndentCommand, getOutdentCommand } from '../commands';
5
+ import { INPUT_METHOD } from '../../analytics';
5
6
  export function keymapPlugin() {
6
7
  const list = {};
7
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.indent), indent, list);
8
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.outdent), outdent, list);
8
+ keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.indent), getIndentCommand(INPUT_METHOD.KEYBOARD), list);
9
+ keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.outdent), getOutdentCommand(INPUT_METHOD.KEYBOARD), list);
9
10
  keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.backspace), (state, dispatch) => {
10
11
  const {
11
12
  selection
12
13
  } = state;
13
14
 
14
15
  if (isTextSelection(selection) && selection.$cursor && selection.$cursor.parentOffset === 0) {
15
- return dispatch ? outdent(state, dispatch) : false;
16
+ return dispatch ? getOutdentCommand(INPUT_METHOD.KEYBOARD)(state, dispatch) : false;
16
17
  }
17
18
 
18
19
  return false;
@@ -10,6 +10,7 @@ import { toolbarMessages } from './toolbar-messages';
10
10
  import commonMessages from '../../messages';
11
11
  import { setPresetLayout, deleteActiveLayoutNode, getPresetLayout } from './actions';
12
12
  import { hoverDecoration } from '../base/pm-plugins/decoration';
13
+ import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
13
14
  const LAYOUT_TYPES = [{
14
15
  id: 'editor.layout.twoEquals',
15
16
  type: 'two_equal',
@@ -84,7 +85,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
84
85
  title: layoutToolbarTitle,
85
86
  getDomRef: view => findDomRefAtPos(pos, view.domAtPos.bind(view)),
86
87
  nodeType,
87
- items: [...layoutTypes.map(i => buildLayoutButton(intl, i, currentLayout)), ...(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(i => buildLayoutButton(intl, i, currentLayout)) : []), separator, deleteButton]
88
+ items: [...layoutTypes.map(i => buildLayoutButton(intl, i, currentLayout)), ...(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(i => buildLayoutButton(intl, i, currentLayout)) : []), ...(state && showCopyButton(state) ? [separator, getCopyButtonConfig(state, intl.formatMessage, nodeType)] : []), separator, deleteButton]
88
89
  };
89
90
  }
90
91
 
@@ -21,6 +21,7 @@ import { FilePreviewItem } from './filePreviewItem';
21
21
  import { downloadMedia, removeMediaGroupNode } from './utils';
22
22
  import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard } from './commands';
23
23
  import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
24
+ import { getCopyButtonConfig, showCopyButton } from '../../copy-button/toolbar';
24
25
 
25
26
  const remove = (state, dispatch) => {
26
27
  if (dispatch) {
@@ -90,7 +91,9 @@ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState) => {
90
91
  title: intl.formatMessage(messages.download)
91
92
  }, {
92
93
  type: 'separator'
93
- }, {
94
+ }, ...(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, mediaGroup), {
95
+ type: 'separator'
96
+ }] : []), {
94
97
  id: 'editor.media.delete',
95
98
  type: 'button',
96
99
  appearance: 'danger',
@@ -156,7 +159,9 @@ const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState) => {
156
159
  title: intl.formatMessage(messages.download)
157
160
  }, {
158
161
  type: 'separator'
159
- }, {
162
+ }, ...(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, mediaInline), {
163
+ type: 'separator'
164
+ }] : []), {
160
165
  id: 'editor.media.delete',
161
166
  type: 'button',
162
167
  appearance: 'danger',
@@ -262,7 +267,9 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
262
267
  onClick: remove,
263
268
  testId: 'media-toolbar-remove-button'
264
269
  };
265
- const items = [...toolbarButtons, removeButton];
270
+ const items = [...toolbarButtons, ...(state && showCopyButton(state) ? [getCopyButtonConfig(state, intl.formatMessage, mediaSingle), {
271
+ type: 'separator'
272
+ }] : []), removeButton];
266
273
  return items;
267
274
  };
268
275
 
@@ -1,6 +1,6 @@
1
1
  import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
2
2
  import { isSpecialMention } from '@atlaskit/mention/resource';
3
- import { name as packageName, version as packageVersion } from '../../version.json';
3
+ import { name as packageName, version as packageVersion } from '../../version-wrapper';
4
4
  import { isTeamType } from './utils';
5
5
  const componentName = 'mention';
6
6
  export const buildAnalyticsPayload = (actionSubject, action, eventType, sessionId, otherAttributes = {}) => ({
@@ -16,7 +16,7 @@ import { DEFAULT_BORDER_COLOR } from '../../ui/ColorPalette/Palettes';
16
16
  import { PanelType } from '@atlaskit/adf-schema';
17
17
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID, withAnalytics } from '../analytics';
18
18
  import { messages } from './message';
19
- import { getCopyButtonConfig, showCopyButton } from '../copy-button/utils';
19
+ import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar';
20
20
  export const panelIconMap = {
21
21
  [PanelType.INFO]: {
22
22
  shortName: ':info:',
@@ -1,10 +1,14 @@
1
+ import { findParentNodeOfType } from 'prosemirror-utils';
1
2
  import { insertSliceIntoRangeSelectionInsideList, insertSliceInsideOfPanelNodeSelected, insertSliceAtNodeEdge, insertSliceIntoEmptyNode } from './lists';
2
3
  import { isListNode } from '../../list/utils/node';
3
4
  import { isSelectionInsidePanel, isEmptyNode, isCursorSelectionAtTextStartOrEnd } from '../util';
4
5
  export function insertSliceForLists({
5
6
  tr,
6
- slice
7
+ slice,
8
+ schema
7
9
  }) {
10
+ var _slice$content$firstC;
11
+
8
12
  const {
9
13
  selection,
10
14
  selection: {
@@ -42,9 +46,17 @@ export function insertSliceForLists({
42
46
  tr,
43
47
  slice
44
48
  });
45
- }
49
+ } // When pasting a single list item into an action or decision, we skip the special "insert at node edge"
50
+ // logic so that prosemirror pastes the list's content into the action/decision, rather than
51
+ // pasting a whole list node directly after the action/decision item. (But we still preserve the
52
+ // existing "insert at" node edge" behaviour if dealing with a list with more than one item, so that
53
+ // it still inserts whole list node after the action/decision item).
54
+
55
+
56
+ const pastingIntoActionOrDecision = Boolean(findParentNodeOfType([schema.nodes.taskList, schema.nodes.decisionList])(selection));
57
+ const oneListItem = slice.content.childCount === 1 && isListNode(slice.content.firstChild) && ((_slice$content$firstC = slice.content.firstChild) === null || _slice$content$firstC === void 0 ? void 0 : _slice$content$firstC.childCount) === 1;
46
58
 
47
- if (isCursorSelectionAtTextStartOrEnd(selection)) {
59
+ if (!(pastingIntoActionOrDecision && oneListItem) && isCursorSelectionAtTextStartOrEnd(selection)) {
48
60
  return insertSliceAtNodeEdge({
49
61
  tr,
50
62
  slice
@@ -104,6 +104,29 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
104
104
  dispatch(tr);
105
105
  }
106
106
 
107
+ return true;
108
+ };
109
+ }
110
+ export function handlePastePanelIntoList(slice) {
111
+ return (state, dispatch) => {
112
+ const {
113
+ schema,
114
+ tr
115
+ } = state;
116
+ const {
117
+ selection
118
+ } = tr; // Check this pasting action is related to copy content from panel node into a selected the list node
119
+
120
+ const selectionParentListNode = selection.$to.node(selection.$to.depth - 1);
121
+ const panelNode = slice.content.firstChild;
122
+
123
+ if (!dispatch || !selectionParentListNode || (selectionParentListNode === null || selectionParentListNode === void 0 ? void 0 : selectionParentListNode.type) !== schema.nodes.listItem || !panelNode || (panelNode === null || panelNode === void 0 ? void 0 : panelNode.type) !== schema.nodes.panel || (panelNode === null || panelNode === void 0 ? void 0 : panelNode.content.firstChild) === undefined) {
124
+ return false;
125
+ } // Paste the panel node contents extracted instead of pasting the entire panel node
126
+
127
+
128
+ tr.replaceSelection(slice).scrollIntoView();
129
+ dispatch(tr);
107
130
  return true;
108
131
  };
109
132
  } // If we paste a link onto some selected text, apply the link as a mark
@@ -646,7 +669,8 @@ export function handleRichText(slice) {
646
669
  panel
647
670
  } = state.schema.nodes;
648
671
  const {
649
- selection
672
+ selection,
673
+ schema
650
674
  } = state;
651
675
  const firstChildOfSlice = (_slice$content = slice.content) === null || _slice$content === void 0 ? void 0 : _slice$content.firstChild;
652
676
  const lastChildOfSlice = (_slice$content2 = slice.content) === null || _slice$content2 === void 0 ? void 0 : _slice$content2.lastChild; // In case user is pasting inline code,
@@ -678,7 +702,8 @@ export function handleRichText(slice) {
678
702
  if (isSliceContentListNodes || isTargetPanelEmpty) {
679
703
  insertSliceForLists({
680
704
  tr,
681
- slice
705
+ slice,
706
+ schema
682
707
  });
683
708
  } else if (noNeedForSafeInsert) {
684
709
  tr.replaceSelection(slice);
@@ -1,6 +1,6 @@
1
1
  import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents, withAnalytics } from '../../analytics';
2
2
  import { getPasteSource } from '../util';
3
- import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption } from '../handlers';
3
+ import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption, handlePastePanelIntoList } from '../handlers';
4
4
  import { pipe } from '../../../utils';
5
5
  import { findParentNode } from 'prosemirror-utils';
6
6
  import { mapSlice } from '../../../utils/slice';
@@ -242,6 +242,9 @@ export const handleMarkdownWithAnalytics = (view, event, slice) => pipe(handleMa
242
242
  export const handleRichTextWithAnalytics = (view, event, slice) => pipe(handleRichText, pasteCommandWithAnalytics(view, event, slice, {
243
243
  type: PasteTypes.richText
244
244
  }))(slice);
245
+ export const handlePastePanelIntoListWithAnalytics = (view, event, slice) => pipe(handlePastePanelIntoList, pasteCommandWithAnalytics(view, event, slice, {
246
+ type: PasteTypes.richText
247
+ }))(slice);
245
248
  export const handleExpandWithAnalytics = (view, event, slice) => pipe(handleExpandPasteInTable, pasteCommandWithAnalytics(view, event, slice, {
246
249
  type: PasteTypes.richText
247
250
  }))(slice);
@@ -252,7 +255,12 @@ export const handlePasteLinkOnSelectedTextWithAnalytics = (view, event, slice, t
252
255
  type,
253
256
  hyperlinkPasteOnText: true
254
257
  }))(slice);
255
- export const createPasteMeasurePayload = (view, duration, content) => {
258
+ export const createPasteMeasurePayload = ({
259
+ view,
260
+ duration,
261
+ content,
262
+ distortedDuration
263
+ }) => {
256
264
  const pasteIntoNode = getActionSubjectId(view);
257
265
  return {
258
266
  action: ACTION.PASTED_TIMED,
@@ -261,7 +269,8 @@ export const createPasteMeasurePayload = (view, duration, content) => {
261
269
  attributes: {
262
270
  pasteIntoNode,
263
271
  content,
264
- time: duration
272
+ time: duration,
273
+ distortedDuration
265
274
  }
266
275
  };
267
276
  };
@@ -12,7 +12,7 @@ import { linkifyContent } from '../../hyperlink/utils';
12
12
  import { transformSliceNestedExpandToExpand } from '../../expand/utils';
13
13
  import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
14
14
  import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
15
- import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics } from './analytics';
15
+ import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelIntoListWithAnalytics } from './analytics';
16
16
  import { analyticsPluginKey, PasteTypes } from '../../analytics';
17
17
  import { insideTable, measurements } from '../../../utils';
18
18
  import { measureRender } from '@atlaskit/editor-common/utils';
@@ -139,8 +139,16 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
139
139
  const content = getContentNodeTypes(slice.content);
140
140
  const pasteId = uuid();
141
141
  const measureName = `${measurements.PASTE}_${pasteId}`;
142
- measureRender(measureName, duration => {
143
- const payload = createPasteMeasurePayload(view, duration, content);
142
+ measureRender(measureName, ({
143
+ duration,
144
+ distortedDuration
145
+ }) => {
146
+ const payload = createPasteMeasurePayload({
147
+ view,
148
+ duration,
149
+ content,
150
+ distortedDuration
151
+ });
144
152
 
145
153
  if (payload) {
146
154
  dispatchAnalyticsEvent(payload);
@@ -195,7 +203,15 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
195
203
  let markdownSlice;
196
204
 
197
205
  if (isPlainText) {
198
- markdownSlice = getMarkdownSlice(text, slice.openStart, slice.openEnd);
206
+ var _markdownSlice;
207
+
208
+ markdownSlice = getMarkdownSlice(text, slice.openStart, slice.openEnd); // https://product-fabric.atlassian.net/browse/ED-15134
209
+ // Lists are not allowed within Blockquotes at this time. Attempting to
210
+ // paste a markdown list ie. ">- foo" will yeild a markdownSlice of size 0.
211
+ // Rather then blocking the paste action with no UI feedback, this will instead
212
+ // force a "paste as plain text" action by clearing the markdownSlice.
213
+
214
+ markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
199
215
 
200
216
  if (markdownSlice) {
201
217
  // linkify text prior to converting to macro
@@ -322,6 +338,10 @@ export function createPlugin(schema, dispatchAnalyticsEvent, plainTextPasteLinki
322
338
  return true;
323
339
  }
324
340
 
341
+ if (handlePastePanelIntoListWithAnalytics(view, event, slice)(state, dispatch)) {
342
+ return true;
343
+ }
344
+
325
345
  return handleRichTextWithAnalytics(view, event, slice)(state, dispatch);
326
346
  }
327
347
 
@@ -1,4 +1,4 @@
1
- import { name as packageName, version as packageVersion } from '../../version.json';
1
+ import { name as packageName, version as packageVersion } from '../../version-wrapper';
2
2
  export const FABRIC_CHANNEL = 'fabric-elements';
3
3
  export const createStatusAnalyticsAndFire = createAnalyticsEvent => payload => {
4
4
  if (createAnalyticsEvent && payload) {
@@ -15,7 +15,7 @@ import tableMessages from './ui/messages';
15
15
  import { messages as ContextualMenuMessages } from './ui/FloatingContextualMenu/ContextualMenu';
16
16
  import { findParentDomRefOfType } from 'prosemirror-utils';
17
17
  import { closestElement } from '../../utils/dom';
18
- import { getCopyButtonConfig, showCopyButton } from '../copy-button/utils'; // TODO: ED-14403 investigate why these translations don't work
18
+ import { getCopyButtonConfig, showCopyButton } from '../copy-button/toolbar'; // TODO: ED-14403 investigate why these translations don't work
19
19
 
20
20
  export const messages = defineMessages({
21
21
  tableOptions: {
@@ -500,6 +500,8 @@ export const tableStyles = props => {
500
500
  /* Table */
501
501
  .${ClassName.TABLE_NODE_WRAPPER} > table {
502
502
  table-layout: fixed;
503
+ // Fixes Chrome border clipping bug ED-15245
504
+ background: ${tableBorderColor(props)};
503
505
 
504
506
  .${ClassName.COLUMN_CONTROLS_DECORATIONS} + * {
505
507
  margin-top: 0;