@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
@@ -0,0 +1,245 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = void 0;
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+
16
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
+
18
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
+
20
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
+
22
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
+
24
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
+
26
+ var _react = _interopRequireWildcard(require("react"));
27
+
28
+ var _rafSchd = _interopRequireDefault(require("raf-schd"));
29
+
30
+ var _popper = _interopRequireDefault(require("popper.js"));
31
+
32
+ var _helpers = require("./internal/helpers");
33
+
34
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
+
36
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
+
38
+ 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; }
39
+
40
+ 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) { (0, _defineProperty2.default)(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; }
41
+
42
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
43
+
44
+ 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; } }
45
+
46
+ var defaultState = {
47
+ hasExtractedStyles: false,
48
+ // We set these default offsets to prevent a flash of popper content in the wrong position
49
+ // which can cause incorrect height calculations. Popper will calculate these values
50
+ offsets: {
51
+ popper: {
52
+ left: -9999,
53
+ top: -9999,
54
+ position: null
55
+ }
56
+ },
57
+ // fix Safari parent width: https://product-fabric.atlassian.net/browse/ED-1784
58
+ cssPosition: 'absolute',
59
+ originalHeight: null,
60
+ maxHeight: null
61
+ };
62
+
63
+ var Layer = /*#__PURE__*/function (_Component) {
64
+ (0, _inherits2.default)(Layer, _Component);
65
+
66
+ var _super = _createSuper(Layer);
67
+
68
+ // working with extract-react-types
69
+ function Layer(props) {
70
+ var _this;
71
+
72
+ (0, _classCallCheck2.default)(this, Layer);
73
+ _this = _super.call(this, props);
74
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", /*#__PURE__*/_react.default.createRef());
75
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "contentRef", /*#__PURE__*/_react.default.createRef());
76
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "extractStyles", function (state) {
77
+ if (state) {
78
+ var popperHeight = state.offsets.popper.height;
79
+ var left = Math.round(state.offsets.popper.left);
80
+ var top = Math.round(state.offsets.popper.top);
81
+ var cssPosition = 'absolute';
82
+ var originalHeight = _this.state.originalHeight || popperHeight;
83
+
84
+ var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
85
+
86
+ _this.setState({
87
+ // position: fixed or absolute
88
+ cssPosition: cssPosition,
89
+ hasExtractedStyles: true,
90
+ transform: "translate3d(".concat(left, "px, ").concat(top, "px, 0px)"),
91
+ originalHeight: originalHeight,
92
+ maxHeight: maxHeight
93
+ });
94
+ }
95
+ });
96
+ _this.state = defaultState;
97
+ _this.extractStyles = (0, _rafSchd.default)(_this.extractStyles.bind((0, _assertThisInitialized2.default)(_this)));
98
+ return _this;
99
+ }
100
+
101
+ (0, _createClass2.default)(Layer, [{
102
+ key: "componentDidMount",
103
+ value: function componentDidMount() {
104
+ this.applyPopper(this.props);
105
+ }
106
+ }, {
107
+ key: "UNSAFE_componentWillReceiveProps",
108
+ value: function UNSAFE_componentWillReceiveProps(nextProps) {
109
+ this.applyPopper(nextProps);
110
+ }
111
+ }, {
112
+ key: "componentDidUpdate",
113
+ value: function componentDidUpdate(prevProps, prevState) {
114
+ var onPositioned = this.props.onPositioned;
115
+ var hasExtractedStyles = this.state.hasExtractedStyles; // This flag is set the first time the position is calculated from Popper and applied to the content
116
+
117
+ if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
118
+ onPositioned();
119
+ }
120
+ }
121
+ }, {
122
+ key: "componentWillUnmount",
123
+ value: function componentWillUnmount() {
124
+ // this.extractStyles.cancel();
125
+ if (this.popper) {
126
+ this.popper.destroy();
127
+ }
128
+ }
129
+ /* Calculate the max height of the popper if it's height is greater than the viewport to prevent
130
+ * the bottom of the popper not being viewable.
131
+ * Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
132
+ */
133
+
134
+ }, {
135
+ key: "calculateMaxHeight",
136
+ value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
137
+ var DocumentElementClientHeight = 0;
138
+
139
+ if (document.documentElement) {
140
+ DocumentElementClientHeight = document.documentElement.clientHeight;
141
+ }
142
+
143
+ if (cssPosition !== 'fixed') {
144
+ return null;
145
+ }
146
+
147
+ var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
148
+ return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ? // allow some spacing either side of viewport height
149
+ viewportHeight - 12 : null;
150
+ }
151
+ }, {
152
+ key: "applyPopper",
153
+ value: function applyPopper(props) {
154
+ if (!this.targetRef.current || !this.contentRef.current) {
155
+ return;
156
+ }
157
+
158
+ if (this.popper) {
159
+ this.popper.destroy();
160
+ } // "new Popper(...)" operation is very expensive when called on virtual DOM.
161
+ // This condition reduces the number of calls so we can run our tests faster
162
+ // (time was reduced from 100s to 13s).
163
+
164
+
165
+ if (!props.content) {
166
+ return;
167
+ } // we wrap our target in a div so that we can safely get a reference to it, but we pass the
168
+ // actual target to popper
169
+
170
+
171
+ var isAlwaysFixed = false;
172
+ var actualTarget = this.targetRef.current.children[0];
173
+ var popperOpts = {
174
+ placement: (0, _helpers.positionPropToPopperPosition)(props.position),
175
+ onCreate: this.extractStyles,
176
+ onUpdate: this.extractStyles,
177
+ modifiers: {
178
+ applyStyle: {
179
+ enabled: false
180
+ },
181
+ hide: {
182
+ enabled: false
183
+ },
184
+ offset: {
185
+ enabled: true,
186
+ offset: this.props.offset
187
+ },
188
+ flip: {
189
+ enabled: false,
190
+ flipVariations: true,
191
+ boundariesElement: 'viewport',
192
+ padding: 0 // leave 0 pixels between popper and the boundariesElement
193
+
194
+ },
195
+ preventOverflow: {
196
+ enabled: false,
197
+ escapeWithReference: true
198
+ }
199
+ },
200
+ positionFixed: isAlwaysFixed
201
+ };
202
+
203
+ if (actualTarget) {
204
+ this.popper = new _popper.default(actualTarget, this.contentRef.current, popperOpts);
205
+ }
206
+ }
207
+ }, {
208
+ key: "render",
209
+ value: function render() {
210
+ var _this$state = this.state,
211
+ transform = _this$state.transform,
212
+ hasExtractedStyles = _this$state.hasExtractedStyles,
213
+ maxHeight = _this$state.maxHeight;
214
+ var opacity = hasExtractedStyles ? {} : {
215
+ opacity: 0
216
+ };
217
+ return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
218
+ ref: this.targetRef
219
+ }, this.props.children), /*#__PURE__*/_react.default.createElement("div", {
220
+ ref: this.contentRef,
221
+ style: _objectSpread({
222
+ top: 0,
223
+ left: 0,
224
+ position: 'absolute',
225
+ transform: transform,
226
+ maxHeight: maxHeight ? maxHeight : 'auto'
227
+ }, opacity)
228
+ }, this.props.content));
229
+ }
230
+ }]);
231
+ return Layer;
232
+ }(_react.Component);
233
+
234
+ exports.default = Layer;
235
+ (0, _defineProperty2.default)(Layer, "defaultProps", {
236
+ boundariesElement: 'viewport',
237
+ children: null,
238
+ content: null,
239
+ offset: '0, 0',
240
+ position: 'right middle',
241
+ zIndex: 400,
242
+ lockScroll: false,
243
+ isAlwaysFixed: false,
244
+ onPositioned: function onPositioned() {}
245
+ });
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.POSITION_ATTRIBUTE_ENUM = void 0;
7
+ exports.positionPropToPopperPosition = positionPropToPopperPosition;
8
+ var positionMap = {
9
+ 'top left': {
10
+ position: 'top-start',
11
+ animation: 'top'
12
+ },
13
+ 'top center': {
14
+ position: 'top',
15
+ animation: 'top'
16
+ },
17
+ 'top right': {
18
+ position: 'top-end',
19
+ animation: 'top'
20
+ },
21
+ 'right top': {
22
+ position: 'right-start',
23
+ animation: 'right'
24
+ },
25
+ 'right middle': {
26
+ position: 'right',
27
+ animation: 'right'
28
+ },
29
+ 'right bottom': {
30
+ position: 'right-end',
31
+ animation: 'right'
32
+ },
33
+ 'bottom left': {
34
+ position: 'bottom-start',
35
+ animation: 'bottom'
36
+ },
37
+ 'bottom center': {
38
+ position: 'bottom',
39
+ animation: 'bottom'
40
+ },
41
+ 'bottom right': {
42
+ position: 'bottom-end',
43
+ animation: 'bottom'
44
+ },
45
+ 'left top': {
46
+ position: 'left-start',
47
+ animation: 'left'
48
+ },
49
+ 'left middle': {
50
+ position: 'left',
51
+ animation: 'left'
52
+ },
53
+ 'left bottom': {
54
+ position: 'left-end',
55
+ animation: 'left'
56
+ }
57
+ };
58
+ var POSITION_ATTRIBUTE_ENUM = {
59
+ 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'],
60
+ default: 'right middle'
61
+ };
62
+ exports.POSITION_ATTRIBUTE_ENUM = POSITION_ATTRIBUTE_ENUM;
63
+
64
+ function positionToPopper(position) {
65
+ return position && positionMap[position] ? positionMap[position].position : null;
66
+ }
67
+
68
+ function positionPropToPopperPosition(position) {
69
+ return positionToPopper(position) || positionMap[POSITION_ATTRIBUTE_ENUM.default].position;
70
+ }
@@ -76,37 +76,18 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
76
76
  var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
77
77
  var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
78
78
 
79
- if (this.themeMode) {
80
- var childrenWithThemeProviders = function childrenWithThemeProviders() {
81
- return /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
82
- mode: _this2.themeMode
83
- }, children());
84
- };
85
-
86
- this.portals.set(container, {
87
- children: childrenWithThemeProviders,
88
- hasAnalyticsContext: hasAnalyticsContext,
89
- hasIntlContext: hasIntlContext
90
- });
91
-
92
- var _wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
93
-
94
- if (hasIntlContext) {
95
- _wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
96
- value: this.intl
97
- }, _wrappedChildren);
98
- }
99
-
100
- (0, _reactDom.unstable_renderSubtreeIntoContainer)(this.context, _wrappedChildren, container);
101
- return;
102
- }
79
+ var childrenWithThemeProviders = function childrenWithThemeProviders() {
80
+ return /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
81
+ mode: _this2.themeMode
82
+ }, children());
83
+ };
103
84
 
104
85
  this.portals.set(container, {
105
- children: children,
86
+ children: childrenWithThemeProviders,
106
87
  hasAnalyticsContext: hasAnalyticsContext,
107
88
  hasIntlContext: hasIntlContext
108
89
  });
109
- var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, children()) : children();
90
+ var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
110
91
 
111
92
  if (hasIntlContext) {
112
93
  wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.nextMajorVersion = exports.name = void 0;
7
7
  var name = "@atlaskit/editor-core";
8
8
  exports.name = name;
9
- var version = "171.0.0";
9
+ var version = "172.0.1";
10
10
  exports.version = version;
11
11
 
12
12
  var nextMajorVersion = function nextMajorVersion() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "171.0.0",
3
+ "version": "172.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -440,7 +440,11 @@ export class ReactEditorView extends React.Component {
440
440
  });
441
441
 
442
442
  _defineProperty(this, "createEditorView", node => {
443
- measureRender(measurements.PROSEMIRROR_RENDERED, (duration, startTime) => {
443
+ measureRender(measurements.PROSEMIRROR_RENDERED, ({
444
+ duration,
445
+ startTime,
446
+ distortedDuration
447
+ }) => {
444
448
  var _this$props$editorPro7, _this$props$editorPro8, _proseMirrorRenderedT, _proseMirrorRenderedT2;
445
449
 
446
450
  const proseMirrorRenderedTracking = (_this$props$editorPro7 = this.props.editorProps) === null || _this$props$editorPro7 === void 0 ? void 0 : (_this$props$editorPro8 = _this$props$editorPro7.performanceTracking) === null || _this$props$editorPro8 === void 0 ? void 0 : _this$props$editorPro8.proseMirrorRenderedTracking;
@@ -448,7 +452,7 @@ export class ReactEditorView extends React.Component {
448
452
  this.proseMirrorRenderedSeverity = !!forceSeverityTracking || proseMirrorRenderedTracking !== null && proseMirrorRenderedTracking !== void 0 && proseMirrorRenderedTracking.trackSeverity ? getAnalyticsEventSeverity(duration, (_proseMirrorRenderedT = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityNormalThreshold) !== null && _proseMirrorRenderedT !== void 0 ? _proseMirrorRenderedT : PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, (_proseMirrorRenderedT2 = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityDegradedThreshold) !== null && _proseMirrorRenderedT2 !== void 0 ? _proseMirrorRenderedT2 : PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD) : undefined;
449
453
 
450
454
  if (this.view) {
451
- var _getContextIdentifier, _this$experienceStore9, _this$experienceStore10;
455
+ var _getContextIdentifier, _this$experienceStore10;
452
456
 
453
457
  const nodes = getNodesCount(this.view.state.doc);
454
458
  const ttfb = getResponseEndTime();
@@ -461,11 +465,18 @@ export class ReactEditorView extends React.Component {
461
465
  nodes,
462
466
  ttfb,
463
467
  severity: this.proseMirrorRenderedSeverity,
464
- objectId: (_getContextIdentifier = getContextIdentifier(this.editorState)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId
468
+ objectId: (_getContextIdentifier = getContextIdentifier(this.editorState)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId,
469
+ distortedDuration
465
470
  },
466
471
  eventType: EVENT_TYPE.OPERATIONAL
467
472
  });
468
- (_this$experienceStore9 = this.experienceStore) === null || _this$experienceStore9 === void 0 ? void 0 : _this$experienceStore9.mark(EditorExperience.loadEditor, ACTION.PROSEMIRROR_RENDERED, startTime + duration);
473
+
474
+ if (!distortedDuration) {
475
+ var _this$experienceStore9;
476
+
477
+ (_this$experienceStore9 = this.experienceStore) === null || _this$experienceStore9 === void 0 ? void 0 : _this$experienceStore9.mark(EditorExperience.loadEditor, ACTION.PROSEMIRROR_RENDERED, startTime + duration);
478
+ }
479
+
469
480
  (_this$experienceStore10 = this.experienceStore) === null || _this$experienceStore10 === void 0 ? void 0 : _this$experienceStore10.addMetadata(EditorExperience.loadEditor, {
470
481
  nodes,
471
482
  ttfb
@@ -37,11 +37,12 @@ export function getScrollGutterOptions(props) {
37
37
  return undefined;
38
38
  }
39
39
  export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
40
- var _props$performanceTra, _props$featureFlags, _props$performanceTra2, _props$textFormatting;
40
+ var _props$performanceTra, _props$linking, _props$featureFlags, _props$performanceTra2, _props$textFormatting, _props$linking2;
41
41
 
42
42
  const appearance = props.appearance;
43
43
  const isMobile = appearance === 'mobile';
44
44
  const inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
45
+ const cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
45
46
  return {
46
47
  createAnalyticsEvent,
47
48
  typeAhead: {
@@ -50,7 +51,7 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
50
51
  },
51
52
  featureFlags: createFeatureFlagsFromProps(props),
52
53
  paste: {
53
- cardOptions: props.smartLinks || props.UNSAFE_cards,
54
+ cardOptions,
54
55
  sanitizePrivateContent: props.sanitizePrivateContent,
55
56
  plainTextPasteLinkification: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.plainTextPasteLinkification) === true
56
57
  },
@@ -86,7 +87,11 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
86
87
  selection: {
87
88
  useLongPressSelection: false
88
89
  },
89
- cardOptions: props.smartLinks || props.UNSAFE_cards,
90
+ cardOptions,
91
+ hyperlinkOptions: {
92
+ linkPicker: (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.linkPicker,
93
+ cardOptions
94
+ },
90
95
  codeBlock: { ...props.codeBlock,
91
96
  useLongPressSelection: false,
92
97
  appearance: props.appearance,
@@ -102,6 +107,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
102
107
  */
103
108
 
104
109
  export default function createPluginsList(props, prevProps, createAnalyticsEvent) {
110
+ var _props$linking3;
111
+
105
112
  const appearance = props.appearance;
106
113
  const isMobile = appearance === 'mobile';
107
114
  const isComment = appearance === 'comment';
@@ -313,13 +320,17 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
313
320
  }]);
314
321
  }
315
322
 
316
- if (props.smartLinks || props.UNSAFE_cards) {
323
+ if ((_props$linking3 = props.linking) !== null && _props$linking3 !== void 0 && _props$linking3.smartLinks || props.smartLinks || props.UNSAFE_cards) {
324
+ var _props$linking4, _props$linking5;
325
+
317
326
  const fullWidthMode = props.appearance === 'full-width';
318
327
  preset.add([cardPlugin, { ...props.UNSAFE_cards,
319
328
  ...props.smartLinks,
329
+ ...((_props$linking4 = props.linking) === null || _props$linking4 === void 0 ? void 0 : _props$linking4.smartLinks),
320
330
  platform: isMobile ? 'mobile' : 'web',
321
331
  fullWidthMode,
322
- createAnalyticsEvent
332
+ createAnalyticsEvent,
333
+ linkPicker: (_props$linking5 = props.linking) === null || _props$linking5 === void 0 ? void 0 : _props$linking5.linkPicker
323
334
  }]);
324
335
  }
325
336
 
@@ -360,7 +371,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
360
371
 
361
372
 
362
373
  preset.add([toolbarListsIndentationPlugin, {
363
- showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar
374
+ showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar,
375
+ allowHeadingAndParagraphIndentation: !!props.allowIndentation
364
376
  }]);
365
377
  preset.add([insertBlockPlugin, {
366
378
  allowTables: !!props.allowTables,
@@ -408,11 +420,9 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
408
420
  preset.add([viewUpdateSubscriptionPlugin]);
409
421
  }
410
422
 
411
- if (featureFlags.codeBidiWarnings) {
412
- preset.add([codeBidiWarningPlugin, {
413
- appearance: props.appearance
414
- }]);
415
- }
423
+ preset.add([codeBidiWarningPlugin, {
424
+ appearance: props.appearance
425
+ }]);
416
426
 
417
427
  if (featureFlags.floatingToolbarCopyButton) {
418
428
  preset.add(copyButtonPlugin);
@@ -18,7 +18,7 @@ import { getUiComponent } from './create-editor';
18
18
  import EditorActions from './actions';
19
19
  import { ReactEditorView } from './create-editor';
20
20
  import EditorContext from './ui/EditorContext';
21
- import { PortalProvider, PortalProviderWithThemeProviders, PortalRenderer } from './ui/PortalProvider';
21
+ import { PortalProviderWithThemeProviders, PortalRenderer } from './ui/PortalProvider';
22
22
  import { nextMajorVersion } from './version-wrapper';
23
23
  import { ContextAdapter } from './nodeviews/context-adapter';
24
24
  import measurements from './utils/performance/measure-enum';
@@ -27,7 +27,6 @@ import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from './plugin
27
27
  import ErrorBoundary from './create-editor/ErrorBoundary';
28
28
  import { createFeatureFlagsFromProps } from './plugins/feature-flags-context/feature-flags-from-props';
29
29
  import { RenderTracking } from './utils/performance/components/RenderTracking';
30
- import { checkIfMobileBridge } from './utils/check-if-mobile-bridge';
31
30
  const fullHeight = css`
32
31
  height: 100%;
33
32
  `;
@@ -323,8 +322,8 @@ export default class Editor extends React.Component {
323
322
  message: 'To integrate inline comments use experimental annotationProvider – <Editor annotationProviders={{ provider }} />',
324
323
  type: 'removed'
325
324
  },
326
- allowDynamicTextSizing: {
327
- message: 'Dynamic text sizing has been unshipped since 2020. The prop is no longer needed.',
325
+ smartLinks: {
326
+ message: 'To use smartLinks, pass the same object into the smartlinks key of linking - <Editor linking={{ smartLinks: {existing object} }}.',
328
327
  type: 'removed'
329
328
  }
330
329
  };
@@ -362,6 +361,8 @@ export default class Editor extends React.Component {
362
361
  }
363
362
 
364
363
  handleProviders(props) {
364
+ var _linking$smartLinks;
365
+
365
366
  const {
366
367
  emojiProvider,
367
368
  mentionProvider,
@@ -377,7 +378,8 @@ export default class Editor extends React.Component {
377
378
  autoformattingProvider,
378
379
  searchProvider,
379
380
  UNSAFE_cards,
380
- smartLinks
381
+ smartLinks,
382
+ linking
381
383
  } = props;
382
384
  const {
383
385
  extensionProvider,
@@ -394,7 +396,7 @@ export default class Editor extends React.Component {
394
396
  this.providerFactory.setProvider('searchProvider', searchProvider);
395
397
  this.providerFactory.setProvider('presenceProvider', presenceProvider);
396
398
  this.providerFactory.setProvider('macroProvider', macroProvider);
397
- const cardProvider = smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
399
+ const cardProvider = (linking === null || linking === void 0 ? void 0 : (_linking$smartLinks = linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider;
398
400
 
399
401
  if (cardProvider) {
400
402
  this.providerFactory.setProvider('cardProvider', cardProvider);
@@ -428,22 +430,6 @@ export default class Editor extends React.Component {
428
430
  const renderTracking = (_this$props$performan3 = this.props.performanceTracking) === null || _this$props$performan3 === void 0 ? void 0 : (_this$props$performan4 = _this$props$performan3.renderTracking) === null || _this$props$performan4 === void 0 ? void 0 : _this$props$performan4.editor;
429
431
  const renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
430
432
  const useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
431
- /**
432
- * The PortalProviderWithThemeProviders renders portals with atlaskit
433
- * and the deprecated styled components theme providers.
434
- *
435
- * Without this the node views react trees;
436
- * - do not have access to the atlaskit theme via the `useGlobalTheme` hook
437
- * - do not have access to the theme when using the `styled`${({theme}) => theme.}` api.
438
- *
439
- * Added for a mobile regression, which needed to be fixed on master.
440
- * Once this makes it's way to develop, we should consider making it the default
441
- * behaviour.
442
- *
443
- * https://product-fabric.atlassian.net/browse/ED-14204
444
- */
445
-
446
- const EnvironmentDrivenPortalProvider = checkIfMobileBridge() ? PortalProviderWithThemeProviders : PortalProvider;
447
433
  return jsx(FabricEditorAnalyticsContext, {
448
434
  data: {
449
435
  packageName: name,
@@ -467,7 +453,7 @@ export default class Editor extends React.Component {
467
453
  css: fullHeight
468
454
  }, jsx(EditorContext, {
469
455
  editorActions: this.editorActions
470
- }, jsx(ContextAdapter, null, jsx(EnvironmentDrivenPortalProvider, {
456
+ }, jsx(ContextAdapter, null, jsx(PortalProviderWithThemeProviders, {
471
457
  onAnalyticsEvent: this.handleAnalyticsEvent,
472
458
  useAnalyticsContext: this.props.UNSAFE_useAnalyticsContext,
473
459
  render: portalProviderAPI => jsx(Fragment, null, jsx(ReactEditorView, {
@@ -40,7 +40,11 @@ function useCreateEditor(config) {
40
40
 
41
41
  setEditorSharedConfig(editorSharedConfig => {
42
42
  if (!editorSharedConfig) {
43
- measureRender(measurements.PROSEMIRROR_RENDERED, (duration, startTime) => {
43
+ measureRender(measurements.PROSEMIRROR_RENDERED, ({
44
+ duration,
45
+ startTime,
46
+ distortedDuration
47
+ }) => {
44
48
  if (sharedConfig && sharedConfig.dispatch) {
45
49
  sharedConfig.dispatch(analyticsEventKey, {
46
50
  payload: {
@@ -48,6 +52,7 @@ function useCreateEditor(config) {
48
52
  actionSubject: ACTION_SUBJECT.EDITOR,
49
53
  attributes: {
50
54
  duration,
55
+ distortedDuration,
51
56
  startTime,
52
57
  nodes: getNodesCount(sharedConfig.editorView.state.doc),
53
58
  ttfb: getResponseEndTime()
@@ -48,7 +48,7 @@ export function createDefaultPreset(options) {
48
48
  preset.add([annotationPlugin, options.annotationProviders]);
49
49
  }
50
50
 
51
- preset.add([hyperlinkPlugin, options.cardOptions]);
51
+ preset.add([hyperlinkPlugin, options.hyperlinkOptions]);
52
52
  preset.add([textFormattingPlugin, options.textFormatting]);
53
53
  preset.add(widthPlugin);
54
54
  preset.add([quickInsertPlugin, options.quickInsert]);
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { Context as CardContext } from '@atlaskit/smart-card';
4
+ import { SmartCardContext } from '@atlaskit/link-provider';
5
5
  import { default as AnalyticsReactContext } from '@atlaskit/analytics-next-stable-react-context';
6
6
 
7
7
  function useContextMemoized(reactContext) {
@@ -20,7 +20,7 @@ function useContextMemoized(reactContext) {
20
20
  export const ContextAdapter = ({
21
21
  children
22
22
  }) => {
23
- const card = useContextMemoized(CardContext);
23
+ const card = useContextMemoized(SmartCardContext);
24
24
  const analytics = useContextMemoized(AnalyticsReactContext);
25
25
  return /*#__PURE__*/React.createElement(LegacyContextAdapter, {
26
26
  card: card,