@atlaskit/editor-core 171.0.1 → 172.0.2

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 (302) hide show
  1. package/CHANGELOG.md +100 -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/tasks-and-decisions/pm-plugins/keymaps.js +43 -32
  58. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +33 -13
  59. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +122 -0
  60. package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
  61. package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
  62. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +7 -1
  63. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +40 -19
  64. package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +10 -0
  65. package/dist/cjs/types/browser.js +6 -0
  66. package/dist/cjs/ui/Addon/click-area-helper.js +40 -19
  67. package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
  68. package/dist/cjs/ui/ContentStyles/index.js +1 -3
  69. package/dist/cjs/ui/DropList/index.js +215 -0
  70. package/dist/cjs/ui/Dropdown/index.js +2 -5
  71. package/dist/cjs/ui/DropdownMenu/index.js +140 -86
  72. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +25 -14
  73. package/dist/cjs/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +2 -2
  74. package/dist/cjs/ui/ElementBrowser/components/ElementList/utils.js +28 -1
  75. package/dist/cjs/ui/ElementBrowser/constants.js +2 -7
  76. package/dist/cjs/ui/Layer/index.js +245 -0
  77. package/dist/cjs/ui/Layer/internal/helpers.js +70 -0
  78. package/dist/cjs/ui/PortalProvider/index.js +21 -31
  79. package/dist/cjs/version-wrapper.js +1 -1
  80. package/dist/cjs/version.json +1 -1
  81. package/dist/es2019/create-editor/ReactEditorView.js +15 -4
  82. package/dist/es2019/create-editor/create-plugins-list.js +21 -11
  83. package/dist/es2019/editor.js +9 -23
  84. package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +6 -1
  85. package/dist/es2019/labs/next/presets/default.js +1 -1
  86. package/dist/es2019/nodeviews/context-adapter.js +2 -2
  87. package/dist/es2019/plugins/analytics/plugin.js +19 -4
  88. package/dist/es2019/plugins/base/index.js +3 -3
  89. package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +70 -0
  90. package/dist/es2019/plugins/card/index.js +1 -1
  91. package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -2
  92. package/dist/es2019/plugins/card/toolbar.js +10 -5
  93. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +5 -1
  94. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -7
  95. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +1 -2
  96. package/dist/es2019/plugins/code-block/actions.js +12 -0
  97. package/dist/es2019/plugins/code-block/index.js +4 -0
  98. package/dist/es2019/plugins/code-block/nodeviews/code-block.js +1 -1
  99. package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
  100. package/dist/es2019/plugins/code-block/pm-plugins/main.js +1 -21
  101. package/dist/es2019/plugins/code-block/styles.js +2 -159
  102. package/dist/es2019/plugins/code-block/toolbar.js +8 -0
  103. package/dist/es2019/plugins/code-block/ui/class-names.js +1 -2
  104. package/dist/es2019/plugins/copy-button/commands.js +35 -15
  105. package/dist/es2019/plugins/copy-button/toolbar.js +29 -0
  106. package/dist/es2019/plugins/copy-button/utils.js +15 -27
  107. package/dist/es2019/plugins/expand/toolbar.js +4 -1
  108. package/dist/es2019/plugins/extension/toolbar.js +4 -1
  109. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +1 -1
  110. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
  111. package/dist/es2019/plugins/extension/ui/Extension/styles.js +1 -3
  112. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +27 -15
  113. package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
  114. package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -19
  115. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +14 -29
  116. package/dist/es2019/plugins/hyperlink/Toolbar.js +11 -5
  117. package/dist/es2019/plugins/hyperlink/index.js +4 -4
  118. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +24 -0
  119. package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
  120. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -9
  121. package/dist/es2019/plugins/indentation/commands/index.js +24 -9
  122. package/dist/es2019/plugins/indentation/commands/utils.js +8 -3
  123. package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +5 -4
  124. package/dist/es2019/plugins/layout/toolbar.js +2 -1
  125. package/dist/es2019/plugins/media/toolbar/index.js +10 -3
  126. package/dist/es2019/plugins/mentions/analytics.js +1 -1
  127. package/dist/es2019/plugins/panel/toolbar.js +1 -1
  128. package/dist/es2019/plugins/paste/edge-cases/index.js +15 -3
  129. package/dist/es2019/plugins/paste/handlers.js +27 -2
  130. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +12 -3
  131. package/dist/es2019/plugins/paste/pm-plugins/main.js +24 -4
  132. package/dist/es2019/plugins/status/analytics.js +1 -1
  133. package/dist/es2019/plugins/table/toolbar.js +1 -1
  134. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +10 -10
  135. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +23 -4
  136. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +104 -0
  137. package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
  138. package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
  139. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +7 -1
  140. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -16
  141. package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
  142. package/dist/es2019/types/browser.js +2 -0
  143. package/dist/es2019/ui/Addon/click-area-helper.js +37 -18
  144. package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
  145. package/dist/es2019/ui/ContentStyles/index.js +5 -9
  146. package/dist/es2019/ui/DropList/index.js +186 -0
  147. package/dist/es2019/ui/Dropdown/index.js +2 -6
  148. package/dist/es2019/ui/DropdownMenu/index.js +124 -75
  149. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +11 -22
  150. package/dist/es2019/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
  151. package/dist/es2019/ui/ElementBrowser/components/ElementList/utils.js +26 -2
  152. package/dist/es2019/ui/ElementBrowser/constants.js +1 -4
  153. package/dist/es2019/ui/Layer/index.js +195 -0
  154. package/dist/es2019/ui/Layer/internal/helpers.js +62 -0
  155. package/dist/es2019/ui/PortalProvider/index.js +18 -28
  156. package/dist/es2019/version-wrapper.js +1 -1
  157. package/dist/es2019/version.json +1 -1
  158. package/dist/esm/create-editor/ReactEditorView.js +13 -4
  159. package/dist/esm/create-editor/create-plugins-list.js +21 -12
  160. package/dist/esm/editor.js +9 -23
  161. package/dist/esm/labs/next/internal/hooks/use-editor/index.js +6 -1
  162. package/dist/esm/labs/next/presets/default.js +1 -1
  163. package/dist/esm/nodeviews/context-adapter.js +2 -2
  164. package/dist/esm/plugins/analytics/plugin.js +24 -11
  165. package/dist/esm/plugins/base/index.js +3 -3
  166. package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +72 -0
  167. package/dist/esm/plugins/card/index.js +1 -1
  168. package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -2
  169. package/dist/esm/plugins/card/toolbar.js +11 -5
  170. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +5 -1
  171. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +7 -7
  172. package/dist/esm/plugins/clipboard/pm-plugins/main.js +1 -2
  173. package/dist/esm/plugins/code-block/actions.js +12 -0
  174. package/dist/esm/plugins/code-block/index.js +6 -0
  175. package/dist/esm/plugins/code-block/nodeviews/code-block.js +2 -4
  176. package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
  177. package/dist/esm/plugins/code-block/pm-plugins/main.js +1 -20
  178. package/dist/esm/plugins/code-block/styles.js +4 -32
  179. package/dist/esm/plugins/code-block/toolbar.js +8 -0
  180. package/dist/esm/plugins/code-block/ui/class-names.js +1 -2
  181. package/dist/esm/plugins/copy-button/commands.js +35 -15
  182. package/dist/esm/plugins/copy-button/toolbar.js +31 -0
  183. package/dist/esm/plugins/copy-button/utils.js +14 -29
  184. package/dist/esm/plugins/expand/toolbar.js +6 -2
  185. package/dist/esm/plugins/extension/toolbar.js +4 -1
  186. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +1 -1
  187. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
  188. package/dist/esm/plugins/extension/ui/Extension/styles.js +3 -4
  189. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +28 -16
  190. package/dist/esm/plugins/feedback-dialog/index.js +1 -1
  191. package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -21
  192. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +8 -27
  193. package/dist/esm/plugins/hyperlink/Toolbar.js +144 -135
  194. package/dist/esm/plugins/hyperlink/index.js +4 -4
  195. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +26 -0
  196. package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
  197. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +46 -5
  198. package/dist/esm/plugins/indentation/commands/index.js +30 -9
  199. package/dist/esm/plugins/indentation/commands/utils.js +12 -8
  200. package/dist/esm/plugins/indentation/pm-plugins/keymap.js +5 -4
  201. package/dist/esm/plugins/layout/toolbar.js +2 -1
  202. package/dist/esm/plugins/media/toolbar/index.js +12 -5
  203. package/dist/esm/plugins/mentions/analytics.js +1 -1
  204. package/dist/esm/plugins/panel/toolbar.js +1 -1
  205. package/dist/esm/plugins/paste/edge-cases/index.js +15 -3
  206. package/dist/esm/plugins/paste/handlers.js +23 -2
  207. package/dist/esm/plugins/paste/pm-plugins/analytics.js +13 -3
  208. package/dist/esm/plugins/paste/pm-plugins/main.js +23 -4
  209. package/dist/esm/plugins/status/analytics.js +1 -1
  210. package/dist/esm/plugins/table/toolbar.js +1 -1
  211. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +37 -31
  212. package/dist/esm/plugins/toolbar-lists-indentation/index.js +32 -13
  213. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +105 -0
  214. package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +18 -12
  215. package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
  216. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +7 -1
  217. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -20
  218. package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
  219. package/dist/esm/types/browser.js +2 -0
  220. package/dist/esm/ui/Addon/click-area-helper.js +37 -18
  221. package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
  222. package/dist/esm/ui/ContentStyles/index.js +2 -4
  223. package/dist/esm/ui/DropList/index.js +203 -0
  224. package/dist/esm/ui/Dropdown/index.js +2 -6
  225. package/dist/esm/ui/DropdownMenu/index.js +134 -88
  226. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +27 -17
  227. package/dist/esm/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
  228. package/dist/esm/ui/ElementBrowser/components/ElementList/utils.js +26 -2
  229. package/dist/esm/ui/ElementBrowser/constants.js +1 -4
  230. package/dist/esm/ui/Layer/index.js +228 -0
  231. package/dist/esm/ui/Layer/internal/helpers.js +62 -0
  232. package/dist/esm/ui/PortalProvider/index.js +21 -31
  233. package/dist/esm/version-wrapper.js +1 -1
  234. package/dist/esm/version.json +1 -1
  235. package/dist/types/labs/next/presets/default.d.ts +2 -0
  236. package/dist/types/plugins/analytics/plugin.d.ts +5 -1
  237. package/dist/types/plugins/analytics/types/cut-copy-events.d.ts +2 -0
  238. package/dist/types/plugins/analytics/types/general-events.d.ts +1 -0
  239. package/dist/types/plugins/analytics/types/paste-events.d.ts +1 -0
  240. package/dist/types/plugins/base/index.d.ts +1 -1
  241. package/dist/types/plugins/base/pm-plugins/{fix-chrome-spell-checking.d.ts → disable-spell-checking.d.ts} +0 -0
  242. package/dist/types/plugins/card/index.d.ts +2 -7
  243. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +2 -1
  244. package/dist/types/plugins/card/toolbar.d.ts +3 -5
  245. package/dist/types/plugins/card/types.d.ts +2 -0
  246. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +4 -1
  247. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +2 -1
  248. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +3 -0
  249. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
  250. package/dist/types/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.d.ts +11 -0
  251. package/dist/types/plugins/code-block/styles.d.ts +0 -1
  252. package/dist/types/plugins/code-block/ui/class-names.d.ts +0 -1
  253. package/dist/types/plugins/copy-button/commands.d.ts +2 -2
  254. package/dist/types/plugins/copy-button/toolbar.d.ts +7 -0
  255. package/dist/types/plugins/copy-button/utils.d.ts +7 -6
  256. package/dist/types/plugins/floating-toolbar/types.d.ts +1 -2
  257. package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
  258. package/dist/types/plugins/hyperlink/index.d.ts +2 -2
  259. package/dist/types/plugins/hyperlink/types.d.ts +30 -0
  260. package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -0
  261. package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.d.ts +2 -0
  262. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +4 -3
  263. package/dist/types/plugins/indentation/commands/index.d.ts +6 -2
  264. package/dist/types/plugins/indentation/commands/utils.d.ts +8 -2
  265. package/dist/types/plugins/paste/edge-cases/index.d.ts +3 -2
  266. package/dist/types/plugins/paste/handlers.d.ts +1 -0
  267. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +7 -1
  268. package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +5 -0
  269. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -1
  270. package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +14 -0
  271. package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
  272. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
  273. package/dist/types/types/browser.d.ts +10 -0
  274. package/dist/types/types/editor-props.d.ts +6 -5
  275. package/dist/types/types/feature-flags.d.ts +29 -24
  276. package/dist/types/types/index.d.ts +1 -0
  277. package/dist/types/ui/Addon/click-area-helper.d.ts +10 -0
  278. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
  279. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  280. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  281. package/dist/types/ui/DropList/index.d.ts +22 -0
  282. package/dist/types/ui/Dropdown/index.d.ts +2 -1
  283. package/dist/types/ui/DropdownMenu/index.d.ts +0 -1
  284. package/dist/types/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +1 -1
  285. package/dist/types/ui/ElementBrowser/components/ElementList/utils.d.ts +1 -0
  286. package/dist/types/ui/ElementBrowser/constants.d.ts +1 -3
  287. package/dist/types/ui/Layer/index.d.ts +47 -0
  288. package/dist/types/ui/Layer/internal/helpers.d.ts +5 -0
  289. package/dist/types/ui/PortalProvider/index.d.ts +2 -1
  290. package/package.json +23 -18
  291. package/tsconfig.json +1 -2
  292. package/dist/cjs/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -37
  293. package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +0 -195
  294. package/dist/cjs/utils/check-if-mobile-bridge.js +0 -19
  295. package/dist/es2019/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -22
  296. package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +0 -152
  297. package/dist/es2019/utils/check-if-mobile-bridge.js +0 -12
  298. package/dist/esm/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -24
  299. package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +0 -178
  300. package/dist/esm/utils/check-if-mobile-bridge.js +0 -12
  301. package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +0 -48
  302. package/dist/types/utils/check-if-mobile-bridge.d.ts +0 -1
@@ -0,0 +1,228 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+
11
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
+
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+
15
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
16
+
17
+ import React, { Component } from 'react';
18
+ import rafSchedule from 'raf-schd';
19
+ import Popper from 'popper.js'; // eslint-disable-line import/extensions
20
+
21
+ import { positionPropToPopperPosition } from './internal/helpers';
22
+ var defaultState = {
23
+ hasExtractedStyles: false,
24
+ // We set these default offsets to prevent a flash of popper content in the wrong position
25
+ // which can cause incorrect height calculations. Popper will calculate these values
26
+ offsets: {
27
+ popper: {
28
+ left: -9999,
29
+ top: -9999,
30
+ position: null
31
+ }
32
+ },
33
+ // fix Safari parent width: https://product-fabric.atlassian.net/browse/ED-1784
34
+ cssPosition: 'absolute',
35
+ originalHeight: null,
36
+ maxHeight: null
37
+ };
38
+
39
+ var Layer = /*#__PURE__*/function (_Component) {
40
+ _inherits(Layer, _Component);
41
+
42
+ var _super = _createSuper(Layer);
43
+
44
+ // working with extract-react-types
45
+ function Layer(props) {
46
+ var _this;
47
+
48
+ _classCallCheck(this, Layer);
49
+
50
+ _this = _super.call(this, props);
51
+
52
+ _defineProperty(_assertThisInitialized(_this), "targetRef", /*#__PURE__*/React.createRef());
53
+
54
+ _defineProperty(_assertThisInitialized(_this), "contentRef", /*#__PURE__*/React.createRef());
55
+
56
+ _defineProperty(_assertThisInitialized(_this), "extractStyles", function (state) {
57
+ if (state) {
58
+ var popperHeight = state.offsets.popper.height;
59
+ var left = Math.round(state.offsets.popper.left);
60
+ var top = Math.round(state.offsets.popper.top);
61
+ var cssPosition = 'absolute';
62
+ var originalHeight = _this.state.originalHeight || popperHeight;
63
+
64
+ var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
65
+
66
+ _this.setState({
67
+ // position: fixed or absolute
68
+ cssPosition: cssPosition,
69
+ hasExtractedStyles: true,
70
+ transform: "translate3d(".concat(left, "px, ").concat(top, "px, 0px)"),
71
+ originalHeight: originalHeight,
72
+ maxHeight: maxHeight
73
+ });
74
+ }
75
+ });
76
+
77
+ _this.state = defaultState;
78
+ _this.extractStyles = rafSchedule(_this.extractStyles.bind(_assertThisInitialized(_this)));
79
+ return _this;
80
+ }
81
+
82
+ _createClass(Layer, [{
83
+ key: "componentDidMount",
84
+ value: function componentDidMount() {
85
+ this.applyPopper(this.props);
86
+ }
87
+ }, {
88
+ key: "UNSAFE_componentWillReceiveProps",
89
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
90
+ this.applyPopper(nextProps);
91
+ }
92
+ }, {
93
+ key: "componentDidUpdate",
94
+ value: function componentDidUpdate(prevProps, prevState) {
95
+ var onPositioned = this.props.onPositioned;
96
+ var hasExtractedStyles = this.state.hasExtractedStyles; // This flag is set the first time the position is calculated from Popper and applied to the content
97
+
98
+ if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
99
+ onPositioned();
100
+ }
101
+ }
102
+ }, {
103
+ key: "componentWillUnmount",
104
+ value: function componentWillUnmount() {
105
+ // this.extractStyles.cancel();
106
+ if (this.popper) {
107
+ this.popper.destroy();
108
+ }
109
+ }
110
+ /* Calculate the max height of the popper if it's height is greater than the viewport to prevent
111
+ * the bottom of the popper not being viewable.
112
+ * Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
113
+ */
114
+
115
+ }, {
116
+ key: "calculateMaxHeight",
117
+ value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
118
+ var DocumentElementClientHeight = 0;
119
+
120
+ if (document.documentElement) {
121
+ DocumentElementClientHeight = document.documentElement.clientHeight;
122
+ }
123
+
124
+ if (cssPosition !== 'fixed') {
125
+ return null;
126
+ }
127
+
128
+ var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
129
+ return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ? // allow some spacing either side of viewport height
130
+ viewportHeight - 12 : null;
131
+ }
132
+ }, {
133
+ key: "applyPopper",
134
+ value: function applyPopper(props) {
135
+ if (!this.targetRef.current || !this.contentRef.current) {
136
+ return;
137
+ }
138
+
139
+ if (this.popper) {
140
+ this.popper.destroy();
141
+ } // "new Popper(...)" operation is very expensive when called on virtual DOM.
142
+ // This condition reduces the number of calls so we can run our tests faster
143
+ // (time was reduced from 100s to 13s).
144
+
145
+
146
+ if (!props.content) {
147
+ return;
148
+ } // we wrap our target in a div so that we can safely get a reference to it, but we pass the
149
+ // actual target to popper
150
+
151
+
152
+ var isAlwaysFixed = false;
153
+ var actualTarget = this.targetRef.current.children[0];
154
+ var popperOpts = {
155
+ placement: positionPropToPopperPosition(props.position),
156
+ onCreate: this.extractStyles,
157
+ onUpdate: this.extractStyles,
158
+ modifiers: {
159
+ applyStyle: {
160
+ enabled: false
161
+ },
162
+ hide: {
163
+ enabled: false
164
+ },
165
+ offset: {
166
+ enabled: true,
167
+ offset: this.props.offset
168
+ },
169
+ flip: {
170
+ enabled: false,
171
+ flipVariations: true,
172
+ boundariesElement: 'viewport',
173
+ padding: 0 // leave 0 pixels between popper and the boundariesElement
174
+
175
+ },
176
+ preventOverflow: {
177
+ enabled: false,
178
+ escapeWithReference: true
179
+ }
180
+ },
181
+ positionFixed: isAlwaysFixed
182
+ };
183
+
184
+ if (actualTarget) {
185
+ this.popper = new Popper(actualTarget, this.contentRef.current, popperOpts);
186
+ }
187
+ }
188
+ }, {
189
+ key: "render",
190
+ value: function render() {
191
+ var _this$state = this.state,
192
+ transform = _this$state.transform,
193
+ hasExtractedStyles = _this$state.hasExtractedStyles,
194
+ maxHeight = _this$state.maxHeight;
195
+ var opacity = hasExtractedStyles ? {} : {
196
+ opacity: 0
197
+ };
198
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
199
+ ref: this.targetRef
200
+ }, this.props.children), /*#__PURE__*/React.createElement("div", {
201
+ ref: this.contentRef,
202
+ style: _objectSpread({
203
+ top: 0,
204
+ left: 0,
205
+ position: 'absolute',
206
+ transform: transform,
207
+ maxHeight: maxHeight ? maxHeight : 'auto'
208
+ }, opacity)
209
+ }, this.props.content));
210
+ }
211
+ }]);
212
+
213
+ return Layer;
214
+ }(Component);
215
+
216
+ _defineProperty(Layer, "defaultProps", {
217
+ boundariesElement: 'viewport',
218
+ children: null,
219
+ content: null,
220
+ offset: '0, 0',
221
+ position: 'right middle',
222
+ zIndex: 400,
223
+ lockScroll: false,
224
+ isAlwaysFixed: false,
225
+ onPositioned: function onPositioned() {}
226
+ });
227
+
228
+ export { Layer as default };
@@ -0,0 +1,62 @@
1
+ var positionMap = {
2
+ 'top left': {
3
+ position: 'top-start',
4
+ animation: 'top'
5
+ },
6
+ 'top center': {
7
+ position: 'top',
8
+ animation: 'top'
9
+ },
10
+ 'top right': {
11
+ position: 'top-end',
12
+ animation: 'top'
13
+ },
14
+ 'right top': {
15
+ position: 'right-start',
16
+ animation: 'right'
17
+ },
18
+ 'right middle': {
19
+ position: 'right',
20
+ animation: 'right'
21
+ },
22
+ 'right bottom': {
23
+ position: 'right-end',
24
+ animation: 'right'
25
+ },
26
+ 'bottom left': {
27
+ position: 'bottom-start',
28
+ animation: 'bottom'
29
+ },
30
+ 'bottom center': {
31
+ position: 'bottom',
32
+ animation: 'bottom'
33
+ },
34
+ 'bottom right': {
35
+ position: 'bottom-end',
36
+ animation: 'bottom'
37
+ },
38
+ 'left top': {
39
+ position: 'left-start',
40
+ animation: 'left'
41
+ },
42
+ 'left middle': {
43
+ position: 'left',
44
+ animation: 'left'
45
+ },
46
+ 'left bottom': {
47
+ position: 'left-end',
48
+ animation: 'left'
49
+ }
50
+ };
51
+ export var POSITION_ATTRIBUTE_ENUM = {
52
+ values: ['top left', 'top center', 'top right', 'right top', 'right middle', 'right bottom', 'bottom left', 'bottom center', 'bottom right', 'left top', 'left middle', 'left bottom'],
53
+ default: 'right middle'
54
+ };
55
+
56
+ function positionToPopper(position) {
57
+ return position && positionMap[position] ? positionMap[position].position : null;
58
+ }
59
+
60
+ export function positionPropToPopperPosition(position) {
61
+ return positionToPopper(position) || positionMap[POSITION_ATTRIBUTE_ENUM.default].position;
62
+ }
@@ -54,38 +54,19 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
54
54
 
55
55
  var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
56
56
  var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
57
-
58
- if (this.themeMode) {
59
- var childrenWithThemeProviders = function childrenWithThemeProviders() {
60
- return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
61
- mode: _this2.themeMode
62
- }, children());
63
- };
64
-
65
- this.portals.set(container, {
66
- children: childrenWithThemeProviders,
67
- hasAnalyticsContext: hasAnalyticsContext,
68
- hasIntlContext: hasIntlContext
69
- });
70
-
71
- var _wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
72
-
73
- if (hasIntlContext) {
74
- _wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
75
- value: this.intl
76
- }, _wrappedChildren);
77
- }
78
-
79
- unstable_renderSubtreeIntoContainer(this.context, _wrappedChildren, container);
80
- return;
81
- }
82
-
83
57
  this.portals.set(container, {
84
58
  children: children,
85
59
  hasAnalyticsContext: hasAnalyticsContext,
86
60
  hasIntlContext: hasIntlContext
87
61
  });
88
- var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, children()) : children();
62
+
63
+ var childrenWithThemeProviders = function childrenWithThemeProviders() {
64
+ return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
65
+ mode: _this2.themeMode
66
+ }, children());
67
+ };
68
+
69
+ var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
89
70
 
90
71
  if (hasIntlContext) {
91
72
  wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
@@ -103,8 +84,10 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
103
84
  value: function forceUpdate(_ref) {
104
85
  var _this3 = this;
105
86
 
106
- var intl = _ref.intl;
87
+ var intl = _ref.intl,
88
+ themeMode = _ref.themeMode;
107
89
  this.intl = intl;
90
+ this.themeMode = themeMode;
108
91
  this.portals.forEach(function (portal, container) {
109
92
  if (!portal.hasAnalyticsContext && !_this3.useAnalyticsContext && !portal.hasIntlContext) {
110
93
  return;
@@ -112,14 +95,20 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
112
95
 
113
96
  var wrappedChildren = portal.children();
114
97
 
98
+ var childrenWithThemeProviders = function childrenWithThemeProviders() {
99
+ return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
100
+ mode: themeMode
101
+ }, wrappedChildren);
102
+ };
103
+
115
104
  if (portal.hasAnalyticsContext && _this3.useAnalyticsContext) {
116
- wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, wrappedChildren);
105
+ wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders());
117
106
  }
118
107
 
119
108
  if (portal.hasIntlContext) {
120
109
  wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
121
110
  value: _this3.intl
122
- }, wrappedChildren);
111
+ }, childrenWithThemeProviders());
123
112
  }
124
113
 
125
114
  unstable_renderSubtreeIntoContainer(_this3.context, wrappedChildren, container);
@@ -186,7 +175,8 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
186
175
  key: "componentDidUpdate",
187
176
  value: function componentDidUpdate() {
188
177
  this.portalProviderAPI.forceUpdate({
189
- intl: this.props.intl
178
+ intl: this.props.intl,
179
+ themeMode: this.props.themeMode
190
180
  });
191
181
  }
192
182
  }]);
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "171.0.1";
2
+ export var version = "172.0.2";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "171.0.1",
3
+ "version": "172.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -15,6 +15,7 @@ import { CodeBlockOptions } from '../../../plugins/code-block/types';
15
15
  import { SelectionPluginOptions } from '../../../plugins/selection/types';
16
16
  import { CardOptions } from '@atlaskit/editor-common/card';
17
17
  import { TypeAheadPluginOptions } from '../../../plugins/type-ahead';
18
+ import { HyperlinkPluginOptions } from '../../../plugins/hyperlink/types';
18
19
  interface EditorPresetDefaultProps {
19
20
  children?: React.ReactNode;
20
21
  }
@@ -30,6 +31,7 @@ export declare type DefaultPresetPluginOptions = {
30
31
  codeBlock?: CodeBlockOptions;
31
32
  selection?: SelectionPluginOptions;
32
33
  cardOptions?: CardOptions;
34
+ hyperlinkOptions?: HyperlinkPluginOptions;
33
35
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
34
36
  typeAhead?: TypeAheadPluginOptions;
35
37
  };
@@ -7,5 +7,9 @@ interface AnalyticsPluginOptions {
7
7
  performanceTracking?: PerformanceTracking;
8
8
  }
9
9
  declare const analyticsPlugin: (options: AnalyticsPluginOptions) => EditorPlugin;
10
- export declare function extendPayload(payload: AnalyticsEventPayload, duration: number): AnalyticsEventPayload<void>;
10
+ export declare function extendPayload({ payload, duration, distortedDuration, }: {
11
+ payload: AnalyticsEventPayload;
12
+ duration: number;
13
+ distortedDuration: boolean;
14
+ }): AnalyticsEventPayload<void>;
11
15
  export default analyticsPlugin;
@@ -2,6 +2,8 @@ import { TrackAEP } from './utils';
2
2
  import { ACTION, ACTION_SUBJECT } from './enums';
3
3
  declare type CopyAEP = TrackAEP<ACTION.COPIED, ACTION_SUBJECT.DOCUMENT, undefined, {
4
4
  content: string[];
5
+ inputMethod?: string;
6
+ nodeType?: string;
5
7
  }, undefined>;
6
8
  declare type CutAEP = TrackAEP<ACTION.CUT, ACTION_SUBJECT.DOCUMENT, undefined, {
7
9
  content: string[];
@@ -41,6 +41,7 @@ declare type EditorPerfAEP = OperationalAEPWithObjectId<ACTION.EDITOR_MOUNTED |
41
41
  nodes?: Record<string, number>;
42
42
  ttfb?: number;
43
43
  severity?: SEVERITY;
44
+ distortedDuration?: boolean;
44
45
  }, undefined>;
45
46
  declare type EditorTTIAEP = OperationalAEP<ACTION.EDITOR_TTI, ACTION_SUBJECT.EDITOR, undefined, {
46
47
  tti: number;
@@ -33,6 +33,7 @@ declare type PastedTimedAEP = PasteBaseOperationalAEP<ACTION.PASTED_TIMED, {
33
33
  pasteIntoNode: PASTE_ACTION_SUBJECT_ID;
34
34
  content: Array<string>;
35
35
  time: number;
36
+ distortedDuration: boolean;
36
37
  }, undefined>;
37
38
  export declare type PasteEventPayload = PasteAEP | PasteAsPlainAEP | PastedTimedAEP;
38
39
  export {};
@@ -8,6 +8,6 @@ export interface BasePluginOptions {
8
8
  browserFreezeTracking?: BrowserFreezetracking;
9
9
  ufo?: boolean;
10
10
  }
11
- export declare const isChromeWithSelectionBug: boolean;
11
+ export declare const isChromeWithSelectionBug: any;
12
12
  declare const basePlugin: (options?: BasePluginOptions | undefined) => EditorPlugin;
13
13
  export default basePlugin;
@@ -1,9 +1,4 @@
1
1
  import { EditorPlugin } from '../../types';
2
- import { CardOptions } from '@atlaskit/editor-common/card';
3
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
- declare const cardPlugin: (options: CardOptions & {
5
- platform: 'mobile' | 'web';
6
- fullWidthMode?: boolean;
7
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
8
- }) => EditorPlugin;
2
+ import { CardPluginOptions } from './types';
3
+ declare const cardPlugin: (options: CardPluginOptions) => EditorPlugin;
9
4
  export default cardPlugin;
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import { Node as PMNode } from 'prosemirror-model';
3
3
  import { EditorView } from 'prosemirror-view';
4
4
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import { Context as SmartCardContext, CardPlatform } from '@atlaskit/smart-card';
5
+ import { CardPlatform } from '@atlaskit/smart-card';
6
+ import { SmartCardContext } from '@atlaskit/link-provider';
6
7
  import { getPosHandler, ReactComponentProps } from '../../../nodeviews';
7
8
  import { EventDispatcher } from '../../../event-dispatcher';
8
9
  import { DispatchAnalyticsEvent } from '../../../plugins/analytics';
@@ -1,9 +1,7 @@
1
- import { IntlShape } from 'react-intl-next';
2
- import { EditorState } from 'prosemirror-state';
3
1
  import { Command } from '../../types';
4
- import { FloatingToolbarConfig } from '../floating-toolbar/types';
2
+ import { FloatingToolbarHandler } from '../floating-toolbar/types';
5
3
  import { CardOptions } from '@atlaskit/editor-common/card';
6
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
+ import { LinkPickerOptions } from '../hyperlink/types';
7
5
  export declare const removeCard: Command;
8
6
  export declare const visitCardLink: Command;
9
- export declare const floatingToolbar: (cardOptions: CardOptions, platform?: import("json-ld-types").JsonLd.Primitives.Platforms | undefined) => (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory) => FloatingToolbarConfig | undefined;
7
+ export declare const floatingToolbar: (cardOptions: CardOptions, platform?: import("json-ld-types").JsonLd.Primitives.Platforms | undefined, linkPickerOptions?: LinkPickerOptions | undefined) => FloatingToolbarHandler;
@@ -3,6 +3,7 @@ import { CardProvider, CardAppearance, CardAdf } from '@atlaskit/editor-common/p
3
3
  import { SmartLinkEvents } from '@atlaskit/smart-card';
4
4
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
5
5
  import { CardOptions } from '@atlaskit/editor-common/card';
6
+ import { LinkPickerOptions } from '../hyperlink/types';
6
7
  export declare type CardInfo = {
7
8
  title?: string;
8
9
  url?: string;
@@ -32,6 +33,7 @@ export declare type CardPluginOptions = CardOptions & {
32
33
  platform: 'mobile' | 'web';
33
34
  fullWidthMode?: boolean;
34
35
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
36
+ linkPicker?: LinkPickerOptions;
35
37
  };
36
38
  export declare type SetProvider = {
37
39
  type: 'SET_PROVIDER';
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { EditorView } from 'prosemirror-view';
3
3
  import { Node } from 'prosemirror-model';
4
4
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
+ import { LinkPickerOptions } from '../../hyperlink/types';
5
6
  import { Command } from '../../../types';
6
7
  import { FloatingToolbarItem, FloatingToolbarConfig } from '../../floating-toolbar/types';
7
8
  export declare type EditLinkToolbarProps = {
@@ -11,6 +12,7 @@ export declare type EditLinkToolbarProps = {
11
12
  text: string;
12
13
  node: Node;
13
14
  onSubmit?: (href: string, text?: string) => void;
15
+ linkPickerOptions?: LinkPickerOptions;
14
16
  };
15
17
  export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProps> {
16
18
  componentDidUpdate(prevProps: EditLinkToolbarProps): void;
@@ -19,8 +21,9 @@ export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProp
19
21
  render(): JSX.Element;
20
22
  }
21
23
  export declare const editLink: Command;
22
- export declare const buildEditLinkToolbar: ({ providerFactory, node, }: {
24
+ export declare const buildEditLinkToolbar: ({ providerFactory, node, linkPicker, }: {
23
25
  providerFactory: ProviderFactory;
24
26
  node: Node;
27
+ linkPicker?: LinkPickerOptions | undefined;
25
28
  }) => FloatingToolbarItem<Command>;
26
29
  export declare const editLinkToolbarConfig: Partial<FloatingToolbarConfig>;
@@ -2,7 +2,8 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { IntlShape } from 'react-intl-next';
4
4
  import { EditorState } from 'prosemirror-state';
5
- import { CardContext, CardPlatform } from '@atlaskit/smart-card';
5
+ import { CardPlatform } from '@atlaskit/smart-card';
6
+ import { CardContext } from '@atlaskit/link-provider';
6
7
  import { EditorView } from 'prosemirror-view';
7
8
  import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
8
9
  export interface LinkToolbarAppearanceProps {
@@ -1,7 +1,9 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { EditorState } from 'prosemirror-state';
2
3
  import { EditorView } from 'prosemirror-view';
3
4
  import { PMPluginFactoryParams } from '../../../types';
4
5
  import { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
6
+ import { AnalyticsEventPayload } from '../../../plugins/analytics';
5
7
  import { ACTION } from '../../analytics/types/enums';
6
8
  import { DOMSerializer } from 'prosemirror-model';
7
9
  import type { Schema } from 'prosemirror-model';
@@ -14,3 +16,4 @@ export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPlugi
14
16
  */
15
17
  export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
16
18
  export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
19
+ export declare const getAnalyticsPayload: (state: EditorState, action: ACTION.CUT | ACTION.COPIED) => AnalyticsEventPayload | undefined;
@@ -18,4 +18,4 @@ export declare class CodeBlockView {
18
18
  target: Element;
19
19
  }): boolean;
20
20
  }
21
- export declare const codeBlockNodeView: () => (node: Node, view: EditorView, getPos: getPosHandler) => CodeBlockView;
21
+ export declare const codeBlockNodeView: (node: Node, view: EditorView, getPos: getPosHandler) => CodeBlockView;
@@ -0,0 +1,11 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import { PluginKey } from 'prosemirror-state';
3
+ import type { EditorState, Transaction } from 'prosemirror-state';
4
+ export declare const copySelectionPluginKey: PluginKey<any, any>;
5
+ declare type CodeBlockCopySelectionPluginState = {
6
+ decorationStartAndEnd?: [start: number, end: number];
7
+ };
8
+ export declare function codeBlockCopySelectionPlugin(): SafePlugin<CodeBlockCopySelectionPluginState, any>;
9
+ export declare function provideVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
10
+ export declare function removeVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
11
+ export {};
@@ -1,3 +1,2 @@
1
1
  import { ThemeProps } from '@atlaskit/theme/types';
2
- export declare const highlightingCodeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
3
2
  export declare const codeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -1,5 +1,4 @@
1
1
  export declare const codeBlockClassNames: {
2
2
  gutter: string;
3
3
  content: string;
4
- highlighting: string;
5
4
  };
@@ -1,4 +1,4 @@
1
1
  import { Command } from '../../types';
2
2
  import { NodeType } from 'prosemirror-model';
3
- export declare const copy: (nodeType: NodeType) => Command;
4
- export declare const resetCopiedState: (nodeType: NodeType, onMouseLeave?: Command | undefined) => Command;
3
+ export declare const createToolbarCopyCommand: (nodeType: NodeType | Array<NodeType>) => Command;
4
+ export declare const resetCopiedState: (nodeType: NodeType | Array<NodeType>, onMouseLeave?: Command | undefined) => Command;
@@ -0,0 +1,7 @@
1
+ import { NodeType } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
+ import { IntlShape } from 'react-intl-next';
4
+ import { Command } from '../../../src/types';
5
+ import { FloatingToolbarItem } from '../floating-toolbar/types';
6
+ export declare const getCopyButtonConfig: (state: EditorState, formatMessage: IntlShape['formatMessage'], nodeType: NodeType | Array<NodeType>, onMouseEnter?: Command | undefined, onMouseLeave?: Command | undefined) => FloatingToolbarItem<Command>;
7
+ export declare const showCopyButton: (state?: EditorState<any> | undefined) => import("prosemirror-state").Plugin<any, any> | undefined;
@@ -1,7 +1,8 @@
1
1
  import { NodeType } from 'prosemirror-model';
2
- import { EditorState } from 'prosemirror-state';
3
- import { IntlShape } from 'react-intl-next';
4
- import { Command } from '../../../src/types';
5
- import { FloatingToolbarItem } from '../floating-toolbar/types';
6
- export declare const getCopyButtonConfig: (state: EditorState, formatMessage: IntlShape['formatMessage'], nodeType: NodeType, onMouseEnter?: Command | undefined, onMouseLeave?: Command | undefined) => FloatingToolbarItem<Command>;
7
- export declare const showCopyButton: (state?: EditorState<any> | undefined) => import("prosemirror-state").Plugin<any, any> | undefined;
2
+ import { Schema, Node as PMNode } from 'prosemirror-model';
3
+ import { Transaction } from 'prosemirror-state';
4
+ export declare function getSelectedNodeOrNodeParentByNodeType({ nodeType, selection, }: {
5
+ nodeType: NodeType | Array<NodeType>;
6
+ selection: Transaction['selection'];
7
+ }): import("prosemirror-utils").ContentNodeWithPos | undefined;
8
+ export declare const toDOM: (node: PMNode, schema: Schema) => Node;