@atlaskit/editor-core 162.0.1 → 163.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (503) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/cjs/create-editor/ErrorBoundary.js +1 -1
  3. package/dist/cjs/create-editor/ReactEditorView.js +2 -2
  4. package/dist/cjs/editor.js +3 -7
  5. package/dist/cjs/keymaps/index.js +14 -9
  6. package/dist/cjs/labs/next/full-page.js +34 -46
  7. package/dist/cjs/labs/next/presets/cxhtml.js +0 -1
  8. package/dist/cjs/nodeviews/ReactNodeView.js +16 -41
  9. package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +227 -0
  10. package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +21 -0
  11. package/dist/cjs/nodeviews/getPerformanceOptions.js +64 -0
  12. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +16 -6
  13. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +10 -17
  14. package/dist/cjs/plugins/analytics/types/enums.js +2 -0
  15. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +9 -16
  16. package/dist/cjs/plugins/base/index.js +26 -7
  17. package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +141 -76
  18. package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +5 -8
  19. package/dist/cjs/plugins/block-type/commands/block-type.js +21 -9
  20. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +9 -9
  21. package/dist/cjs/plugins/card/nodeviews/genericCard.js +4 -4
  22. package/dist/cjs/plugins/card/pm-plugins/doc.js +53 -6
  23. package/dist/cjs/plugins/card/pm-plugins/main.js +16 -1
  24. package/dist/cjs/plugins/card/styles.js +2 -2
  25. package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +6 -6
  26. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +7 -8
  27. package/dist/cjs/plugins/code-block/styles.js +2 -2
  28. package/dist/cjs/plugins/collab-edit/styles.js +2 -2
  29. package/dist/cjs/plugins/collab-edit/ui/avatars.js +6 -1
  30. package/dist/cjs/plugins/collab-edit/ui/colored-avatar-item.js +4 -5
  31. package/dist/cjs/plugins/collab-edit/ui/invite-to-edit.js +15 -4
  32. package/dist/cjs/plugins/collab-edit/ui/styles.js +10 -14
  33. package/dist/cjs/plugins/date/nodeviews/date.js +30 -75
  34. package/dist/cjs/plugins/date/pm-plugins/main.js +8 -11
  35. package/dist/cjs/plugins/date/styles.js +2 -2
  36. package/dist/cjs/plugins/date/ui/DatePicker/date-picker-input.js +7 -6
  37. package/dist/cjs/plugins/date/ui/DatePicker/index.js +8 -7
  38. package/dist/cjs/plugins/emoji/styles.js +3 -3
  39. package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +13 -16
  40. package/dist/cjs/plugins/expand/ui/styles.js +26 -12
  41. package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +16 -9
  42. package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +9 -6
  43. package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/index.js +7 -3
  44. package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +7 -4
  45. package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +14 -13
  46. package/dist/cjs/plugins/extension/ui/Extension/styles.js +20 -26
  47. package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +14 -17
  48. package/dist/cjs/plugins/extension/ui/styles.js +2 -2
  49. package/dist/cjs/plugins/fake-text-cursor/styles.js +2 -2
  50. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +1 -1
  51. package/dist/cjs/plugins/find-replace/styles.js +2 -2
  52. package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +6 -7
  53. package/dist/cjs/plugins/floating-toolbar/ui/styles.js +7 -1
  54. package/dist/cjs/plugins/grid/styles.js +2 -2
  55. package/dist/cjs/plugins/help-dialog/ui/index.js +134 -40
  56. package/dist/cjs/plugins/help-dialog/ui/styles.js +26 -49
  57. package/dist/cjs/plugins/hyperlink/styles.js +6 -16
  58. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +23 -20
  59. package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +13 -10
  60. package/dist/cjs/plugins/list/commands/index.js +8 -0
  61. package/dist/cjs/plugins/list/pm-plugins/main.js +6 -0
  62. package/dist/cjs/plugins/list/styles.js +2 -2
  63. package/dist/cjs/plugins/list/utils/node.js +4 -3
  64. package/dist/cjs/plugins/media/index.js +9 -40
  65. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +28 -23
  66. package/dist/cjs/plugins/media/pm-plugins/main.js +1 -8
  67. package/dist/cjs/plugins/media/pm-plugins/media-editor-plugin-factory.js +2 -67
  68. package/dist/cjs/plugins/media/styles.js +1 -1
  69. package/dist/cjs/plugins/media/toolbar/index.js +0 -13
  70. package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +1 -1
  71. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +12 -8
  72. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/styled.js +7 -6
  73. package/dist/cjs/plugins/media/utils/media-single.js +8 -4
  74. package/dist/cjs/plugins/mentions/styles.js +2 -2
  75. package/dist/cjs/plugins/panel/styles.js +5 -2
  76. package/dist/cjs/plugins/placeholder/styles.js +2 -2
  77. package/dist/cjs/plugins/placeholder-text/styles.js +2 -2
  78. package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +2 -1
  79. package/dist/cjs/plugins/rule/styles.js +5 -2
  80. package/dist/cjs/plugins/selection/gap-cursor/styles.js +4 -4
  81. package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +13 -30
  82. package/dist/cjs/plugins/status/index.js +9 -12
  83. package/dist/cjs/plugins/status/nodeviews/status.js +43 -126
  84. package/dist/cjs/plugins/status/plugin.js +14 -6
  85. package/dist/cjs/plugins/status/styles.js +2 -2
  86. package/dist/cjs/plugins/table/index.js +1 -1
  87. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +10 -16
  88. package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +2 -2
  89. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +7 -12
  90. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +2 -2
  91. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  92. package/dist/cjs/plugins/tasks-and-decisions/styles.js +2 -2
  93. package/dist/cjs/plugins/type-ahead/constants.js +3 -1
  94. package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +8 -0
  95. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +15 -56
  96. package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +48 -3
  97. package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +4 -1
  98. package/dist/cjs/plugins/unsupported-content/styles.js +2 -2
  99. package/dist/cjs/profiler/render-count.js +1 -3
  100. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
  101. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +0 -1
  102. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +0 -1
  103. package/dist/cjs/ui/Appearance/FullPage/messages.js +2 -2
  104. package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +18 -16
  105. package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +16 -14
  106. package/dist/cjs/ui/ConfigPanel/Fields/TabGroup.js +13 -10
  107. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +15 -4
  108. package/dist/cjs/ui/ConfigPanel/Header.js +30 -30
  109. package/dist/cjs/ui/ContentStyles/index.js +13 -20
  110. package/dist/cjs/ui/ElementBrowser/InsertMenu.js +5 -6
  111. package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +30 -23
  112. package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +51 -47
  113. package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +17 -14
  114. package/dist/cjs/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +18 -18
  115. package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +55 -68
  116. package/dist/cjs/ui/ElementBrowser/hooks/use-container-width.js +10 -11
  117. package/dist/cjs/ui/FloatingToolbar/styles.js +1 -1
  118. package/dist/cjs/ui/LinkSearch/LinkSearchList.js +18 -22
  119. package/dist/cjs/ui/PortalProvider/index.js +3 -3
  120. package/dist/cjs/ui/Resizer/styled.js +7 -5
  121. package/dist/cjs/ui/Toolbar/ToolbarInner.js +5 -3
  122. package/dist/cjs/ui/WithFlash/index.js +9 -17
  123. package/dist/cjs/utils/insert.js +25 -2
  124. package/dist/cjs/utils/performance/components/RenderTracking.js +52 -0
  125. package/dist/cjs/version-wrapper.js +1 -1
  126. package/dist/cjs/version.json +1 -1
  127. package/dist/es2019/create-editor/ErrorBoundary.js +2 -2
  128. package/dist/es2019/create-editor/ReactEditorView.js +1 -1
  129. package/dist/es2019/editor.js +3 -5
  130. package/dist/es2019/keymaps/index.js +10 -4
  131. package/dist/es2019/labs/next/full-page.js +44 -43
  132. package/dist/es2019/labs/next/presets/cxhtml.js +0 -1
  133. package/dist/es2019/nodeviews/ReactNodeView.js +13 -35
  134. package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +216 -0
  135. package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +15 -0
  136. package/dist/es2019/nodeviews/getPerformanceOptions.js +47 -0
  137. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +18 -7
  138. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +5 -5
  139. package/dist/es2019/plugins/analytics/types/enums.js +2 -0
  140. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +12 -7
  141. package/dist/es2019/plugins/base/index.js +24 -5
  142. package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +135 -77
  143. package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +5 -4
  144. package/dist/es2019/plugins/block-type/commands/block-type.js +18 -11
  145. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +10 -6
  146. package/dist/es2019/plugins/card/nodeviews/genericCard.js +5 -5
  147. package/dist/es2019/plugins/card/pm-plugins/doc.js +44 -4
  148. package/dist/es2019/plugins/card/pm-plugins/main.js +17 -1
  149. package/dist/es2019/plugins/card/styles.js +1 -1
  150. package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +6 -6
  151. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +8 -7
  152. package/dist/es2019/plugins/code-block/styles.js +4 -0
  153. package/dist/es2019/plugins/collab-edit/styles.js +1 -1
  154. package/dist/es2019/plugins/collab-edit/ui/avatars.js +6 -2
  155. package/dist/es2019/plugins/collab-edit/ui/colored-avatar-item.js +5 -4
  156. package/dist/es2019/plugins/collab-edit/ui/invite-to-edit.js +9 -5
  157. package/dist/es2019/plugins/collab-edit/ui/styles.js +5 -7
  158. package/dist/es2019/plugins/date/nodeviews/date.js +37 -48
  159. package/dist/es2019/plugins/date/pm-plugins/main.js +8 -10
  160. package/dist/es2019/plugins/date/styles.js +1 -1
  161. package/dist/es2019/plugins/date/ui/DatePicker/date-picker-input.js +8 -4
  162. package/dist/es2019/plugins/date/ui/DatePicker/index.js +9 -5
  163. package/dist/es2019/plugins/emoji/styles.js +1 -2
  164. package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +13 -14
  165. package/dist/es2019/plugins/expand/ui/styles.js +32 -22
  166. package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +17 -11
  167. package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +7 -6
  168. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/index.js +9 -5
  169. package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +5 -3
  170. package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +14 -7
  171. package/dist/es2019/plugins/extension/ui/Extension/styles.js +14 -8
  172. package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +15 -9
  173. package/dist/es2019/plugins/extension/ui/styles.js +2 -1
  174. package/dist/es2019/plugins/fake-text-cursor/styles.js +1 -1
  175. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +1 -1
  176. package/dist/es2019/plugins/find-replace/styles.js +1 -1
  177. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +12 -8
  178. package/dist/es2019/plugins/floating-toolbar/ui/styles.js +7 -1
  179. package/dist/es2019/plugins/grid/styles.js +1 -1
  180. package/dist/es2019/plugins/help-dialog/ui/index.js +132 -37
  181. package/dist/es2019/plugins/help-dialog/ui/styles.js +13 -13
  182. package/dist/es2019/plugins/hyperlink/styles.js +1 -5
  183. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +25 -20
  184. package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +14 -7
  185. package/dist/es2019/plugins/list/commands/index.js +7 -0
  186. package/dist/es2019/plugins/list/pm-plugins/main.js +6 -0
  187. package/dist/es2019/plugins/list/styles.js +1 -1
  188. package/dist/es2019/plugins/list/utils/node.js +4 -3
  189. package/dist/es2019/plugins/media/index.js +1 -28
  190. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +30 -16
  191. package/dist/es2019/plugins/media/pm-plugins/main.js +1 -7
  192. package/dist/es2019/plugins/media/pm-plugins/media-editor-plugin-factory.js +1 -49
  193. package/dist/es2019/plugins/media/styles.js +1 -2
  194. package/dist/es2019/plugins/media/toolbar/index.js +0 -12
  195. package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +0 -1
  196. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +14 -9
  197. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/styled.js +4 -5
  198. package/dist/es2019/plugins/media/utils/media-single.js +9 -5
  199. package/dist/es2019/plugins/mentions/styles.js +1 -1
  200. package/dist/es2019/plugins/panel/styles.js +3 -3
  201. package/dist/es2019/plugins/placeholder/styles.js +1 -1
  202. package/dist/es2019/plugins/placeholder-text/styles.js +1 -1
  203. package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +4 -1
  204. package/dist/es2019/plugins/rule/styles.js +3 -3
  205. package/dist/es2019/plugins/selection/gap-cursor/styles.js +2 -2
  206. package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +4 -20
  207. package/dist/es2019/plugins/status/index.js +1 -5
  208. package/dist/es2019/plugins/status/nodeviews/status.js +45 -82
  209. package/dist/es2019/plugins/status/plugin.js +13 -6
  210. package/dist/es2019/plugins/status/styles.js +1 -7
  211. package/dist/es2019/plugins/table/index.js +1 -1
  212. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +11 -10
  213. package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
  214. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +7 -8
  215. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +1 -1
  216. package/dist/es2019/plugins/table/ui/common-styles.js +4 -0
  217. package/dist/es2019/plugins/tasks-and-decisions/styles.js +1 -1
  218. package/dist/es2019/plugins/type-ahead/constants.js +1 -0
  219. package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +11 -1
  220. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +19 -51
  221. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +41 -3
  222. package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +3 -1
  223. package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
  224. package/dist/es2019/profiler/render-count.js +1 -1
  225. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -0
  226. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +0 -1
  227. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +0 -1
  228. package/dist/es2019/ui/Appearance/FullPage/messages.js +1 -1
  229. package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +19 -16
  230. package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +18 -13
  231. package/dist/es2019/ui/ConfigPanel/Fields/TabGroup.js +14 -8
  232. package/dist/es2019/ui/ConfigPanel/Fields/UserSelect.js +12 -3
  233. package/dist/es2019/ui/ConfigPanel/Header.js +30 -19
  234. package/dist/es2019/ui/ContentStyles/index.js +33 -38
  235. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +5 -6
  236. package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +49 -38
  237. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +54 -33
  238. package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +18 -10
  239. package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +19 -17
  240. package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +132 -119
  241. package/dist/es2019/ui/ElementBrowser/hooks/use-container-width.js +10 -9
  242. package/dist/es2019/ui/FloatingToolbar/styles.js +2 -1
  243. package/dist/es2019/ui/LinkSearch/LinkSearchList.js +14 -9
  244. package/dist/es2019/ui/PortalProvider/index.js +3 -3
  245. package/dist/es2019/ui/Resizer/styled.js +3 -3
  246. package/dist/es2019/ui/Toolbar/ToolbarInner.js +6 -3
  247. package/dist/es2019/ui/WithFlash/index.js +15 -6
  248. package/dist/es2019/utils/insert.js +20 -0
  249. package/dist/es2019/utils/performance/components/RenderTracking.js +37 -0
  250. package/dist/es2019/version-wrapper.js +1 -1
  251. package/dist/es2019/version.json +1 -1
  252. package/dist/esm/create-editor/ErrorBoundary.js +2 -2
  253. package/dist/esm/create-editor/ReactEditorView.js +1 -1
  254. package/dist/esm/editor.js +3 -5
  255. package/dist/esm/keymaps/index.js +7 -4
  256. package/dist/esm/labs/next/full-page.js +38 -36
  257. package/dist/esm/labs/next/presets/cxhtml.js +0 -1
  258. package/dist/esm/nodeviews/ReactNodeView.js +17 -38
  259. package/dist/esm/nodeviews/getInlineNodeViewProducer.js +212 -0
  260. package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +9 -0
  261. package/dist/esm/nodeviews/getPerformanceOptions.js +45 -0
  262. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +17 -7
  263. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +5 -5
  264. package/dist/esm/plugins/analytics/types/enums.js +2 -0
  265. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +9 -9
  266. package/dist/esm/plugins/base/index.js +26 -7
  267. package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +134 -69
  268. package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +5 -4
  269. package/dist/esm/plugins/block-type/commands/block-type.js +19 -9
  270. package/dist/esm/plugins/breakout/ui/LayoutButton.js +9 -6
  271. package/dist/esm/plugins/card/nodeviews/genericCard.js +5 -5
  272. package/dist/esm/plugins/card/pm-plugins/doc.js +47 -4
  273. package/dist/esm/plugins/card/pm-plugins/main.js +15 -1
  274. package/dist/esm/plugins/card/styles.js +1 -1
  275. package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +6 -6
  276. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +8 -9
  277. package/dist/esm/plugins/code-block/styles.js +2 -2
  278. package/dist/esm/plugins/collab-edit/styles.js +1 -1
  279. package/dist/esm/plugins/collab-edit/ui/avatars.js +6 -2
  280. package/dist/esm/plugins/collab-edit/ui/colored-avatar-item.js +5 -4
  281. package/dist/esm/plugins/collab-edit/ui/invite-to-edit.js +9 -5
  282. package/dist/esm/plugins/collab-edit/ui/styles.js +6 -7
  283. package/dist/esm/plugins/date/nodeviews/date.js +30 -71
  284. package/dist/esm/plugins/date/pm-plugins/main.js +8 -9
  285. package/dist/esm/plugins/date/styles.js +1 -1
  286. package/dist/esm/plugins/date/ui/DatePicker/date-picker-input.js +7 -4
  287. package/dist/esm/plugins/date/ui/DatePicker/index.js +8 -5
  288. package/dist/esm/plugins/emoji/styles.js +2 -2
  289. package/dist/esm/plugins/expand/ui/ExpandIconButton.js +13 -15
  290. package/dist/esm/plugins/expand/ui/styles.js +24 -12
  291. package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +18 -11
  292. package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -5
  293. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/index.js +9 -5
  294. package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +5 -3
  295. package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +13 -7
  296. package/dist/esm/plugins/extension/ui/Extension/styles.js +13 -11
  297. package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +15 -9
  298. package/dist/esm/plugins/extension/ui/styles.js +2 -2
  299. package/dist/esm/plugins/fake-text-cursor/styles.js +1 -1
  300. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +1 -1
  301. package/dist/esm/plugins/find-replace/styles.js +1 -1
  302. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +6 -7
  303. package/dist/esm/plugins/floating-toolbar/ui/styles.js +7 -1
  304. package/dist/esm/plugins/grid/styles.js +1 -1
  305. package/dist/esm/plugins/help-dialog/ui/index.js +135 -41
  306. package/dist/esm/plugins/help-dialog/ui/styles.js +13 -13
  307. package/dist/esm/plugins/hyperlink/styles.js +3 -5
  308. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +24 -20
  309. package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +14 -7
  310. package/dist/esm/plugins/list/commands/index.js +7 -0
  311. package/dist/esm/plugins/list/pm-plugins/main.js +6 -0
  312. package/dist/esm/plugins/list/styles.js +1 -1
  313. package/dist/esm/plugins/list/utils/node.js +4 -3
  314. package/dist/esm/plugins/media/index.js +9 -37
  315. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +29 -15
  316. package/dist/esm/plugins/media/pm-plugins/main.js +1 -9
  317. package/dist/esm/plugins/media/pm-plugins/media-editor-plugin-factory.js +1 -58
  318. package/dist/esm/plugins/media/styles.js +1 -1
  319. package/dist/esm/plugins/media/toolbar/index.js +0 -12
  320. package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -1
  321. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +13 -9
  322. package/dist/esm/plugins/media/ui/ResizableMediaSingle/styled.js +4 -3
  323. package/dist/esm/plugins/media/utils/media-single.js +9 -5
  324. package/dist/esm/plugins/mentions/styles.js +1 -1
  325. package/dist/esm/plugins/panel/styles.js +4 -2
  326. package/dist/esm/plugins/placeholder/styles.js +1 -1
  327. package/dist/esm/plugins/placeholder-text/styles.js +1 -1
  328. package/dist/esm/plugins/rule/pm-plugins/input-rule.js +2 -1
  329. package/dist/esm/plugins/rule/styles.js +4 -2
  330. package/dist/esm/plugins/selection/gap-cursor/styles.js +3 -3
  331. package/dist/esm/plugins/selection/pm-plugins/selection-main.js +5 -21
  332. package/dist/esm/plugins/status/index.js +9 -12
  333. package/dist/esm/plugins/status/nodeviews/status.js +37 -115
  334. package/dist/esm/plugins/status/plugin.js +13 -6
  335. package/dist/esm/plugins/status/styles.js +2 -2
  336. package/dist/esm/plugins/table/index.js +1 -1
  337. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +10 -11
  338. package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
  339. package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +7 -10
  340. package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +1 -1
  341. package/dist/esm/plugins/table/ui/common-styles.js +1 -1
  342. package/dist/esm/plugins/tasks-and-decisions/styles.js +1 -1
  343. package/dist/esm/plugins/type-ahead/constants.js +1 -0
  344. package/dist/esm/plugins/type-ahead/ui/InputQuery.js +9 -1
  345. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +18 -56
  346. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +44 -3
  347. package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +3 -1
  348. package/dist/esm/plugins/unsupported-content/styles.js +1 -1
  349. package/dist/esm/profiler/render-count.js +1 -1
  350. package/dist/esm/ui/Appearance/Comment/Toolbar.js +1 -1
  351. package/dist/esm/ui/Appearance/FullPage/FullPage.js +0 -1
  352. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +0 -1
  353. package/dist/esm/ui/Appearance/FullPage/messages.js +1 -1
  354. package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +19 -16
  355. package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +17 -13
  356. package/dist/esm/ui/ConfigPanel/Fields/TabGroup.js +13 -8
  357. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +14 -3
  358. package/dist/esm/ui/ConfigPanel/Header.js +30 -19
  359. package/dist/esm/ui/ContentStyles/index.js +12 -17
  360. package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -6
  361. package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +29 -18
  362. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +50 -35
  363. package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +18 -10
  364. package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +19 -17
  365. package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +53 -52
  366. package/dist/esm/ui/ElementBrowser/hooks/use-container-width.js +9 -8
  367. package/dist/esm/ui/FloatingToolbar/styles.js +1 -1
  368. package/dist/esm/ui/LinkSearch/LinkSearchList.js +14 -9
  369. package/dist/esm/ui/PortalProvider/index.js +3 -3
  370. package/dist/esm/ui/Resizer/styled.js +4 -2
  371. package/dist/esm/ui/Toolbar/ToolbarInner.js +6 -3
  372. package/dist/esm/ui/WithFlash/index.js +8 -8
  373. package/dist/esm/utils/insert.js +20 -0
  374. package/dist/esm/utils/performance/components/RenderTracking.js +39 -0
  375. package/dist/esm/version-wrapper.js +1 -1
  376. package/dist/esm/version.json +1 -1
  377. package/dist/types/editor.d.ts +1 -1
  378. package/dist/types/keymaps/index.d.ts +3 -2
  379. package/dist/types/labs/next/full-page.d.ts +1 -1
  380. package/dist/types/labs/next/mobile.d.ts +1 -1
  381. package/dist/types/nodeviews/ReactNodeView.d.ts +0 -5
  382. package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +23 -0
  383. package/dist/types/nodeviews/getInlineNodeViewProducer.styles.d.ts +1 -0
  384. package/dist/types/nodeviews/getPerformanceOptions.d.ts +19 -0
  385. package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +3 -1
  386. package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +4 -5
  387. package/dist/types/plugins/analytics/types/enums.d.ts +2 -0
  388. package/dist/types/plugins/analytics/types/events.d.ts +11 -3
  389. package/dist/types/plugins/analytics/types/general-events.d.ts +1 -1
  390. package/dist/types/plugins/analytics/types/utils.d.ts +4 -0
  391. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -2
  392. package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +12 -6
  393. package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +3 -3
  394. package/dist/types/plugins/breakout/ui/LayoutButton.d.ts +1 -0
  395. package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -0
  396. package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
  397. package/dist/types/plugins/card/styles.d.ts +1 -1
  398. package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +1 -1
  399. package/dist/types/plugins/collab-edit/styles.d.ts +1 -1
  400. package/dist/types/plugins/collab-edit/ui/avatars.d.ts +1 -0
  401. package/dist/types/plugins/collab-edit/ui/colored-avatar-item.d.ts +3 -2
  402. package/dist/types/plugins/collab-edit/ui/invite-to-edit.d.ts +1 -0
  403. package/dist/types/plugins/collab-edit/ui/styles.d.ts +3 -8
  404. package/dist/types/plugins/date/nodeviews/date.d.ts +3 -15
  405. package/dist/types/plugins/date/styles.d.ts +1 -1
  406. package/dist/types/plugins/date/ui/DatePicker/date-picker-input.d.ts +1 -0
  407. package/dist/types/plugins/date/ui/DatePicker/index.d.ts +1 -0
  408. package/dist/types/plugins/emoji/styles.d.ts +2 -2
  409. package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +5 -3
  410. package/dist/types/plugins/expand/ui/styles.d.ts +2 -1
  411. package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +1 -0
  412. package/dist/types/plugins/extension/ui/Extension/Extension/styles.d.ts +3 -8
  413. package/dist/types/plugins/extension/ui/Extension/InlineExtension/index.d.ts +3 -1
  414. package/dist/types/plugins/extension/ui/Extension/InlineExtension/styles.d.ts +2 -2
  415. package/dist/types/plugins/extension/ui/Extension/Lozenge.d.ts +3 -1
  416. package/dist/types/plugins/extension/ui/Extension/styles.d.ts +6 -6
  417. package/dist/types/plugins/extension/ui/SaveIndicator/SaveIndicator.d.ts +1 -0
  418. package/dist/types/plugins/extension/ui/styles.d.ts +1 -1
  419. package/dist/types/plugins/fake-text-cursor/styles.d.ts +1 -1
  420. package/dist/types/plugins/find-replace/styles.d.ts +1 -1
  421. package/dist/types/plugins/floating-toolbar/ui/styles.d.ts +6 -1
  422. package/dist/types/plugins/grid/styles.d.ts +1 -1
  423. package/dist/types/plugins/help-dialog/ui/index.d.ts +3 -1
  424. package/dist/types/plugins/help-dialog/ui/styles.d.ts +12 -13
  425. package/dist/types/plugins/hyperlink/styles.d.ts +2 -4
  426. package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +4 -2
  427. package/dist/types/plugins/jira-issue/nodeviews/jira-issue.d.ts +3 -2
  428. package/dist/types/plugins/list/styles.d.ts +1 -1
  429. package/dist/types/plugins/list/utils/node.d.ts +0 -1
  430. package/dist/types/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.d.ts +3 -1
  431. package/dist/types/plugins/media/pm-plugins/main.d.ts +0 -1
  432. package/dist/types/plugins/media/pm-plugins/media-editor-plugin-factory.d.ts +1 -3
  433. package/dist/types/plugins/media/types.d.ts +0 -19
  434. package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +3 -1
  435. package/dist/types/plugins/media/ui/ResizableMediaSingle/styled.d.ts +2 -2
  436. package/dist/types/plugins/mentions/styles.d.ts +1 -1
  437. package/dist/types/plugins/panel/styles.d.ts +2 -1
  438. package/dist/types/plugins/placeholder/styles.d.ts +1 -1
  439. package/dist/types/plugins/placeholder-text/styles.d.ts +1 -1
  440. package/dist/types/plugins/rule/styles.d.ts +2 -1
  441. package/dist/types/plugins/selection/gap-cursor/styles.d.ts +1 -1
  442. package/dist/types/plugins/status/nodeviews/status.d.ts +6 -13
  443. package/dist/types/plugins/status/plugin.d.ts +2 -3
  444. package/dist/types/plugins/status/styles.d.ts +1 -1
  445. package/dist/types/plugins/status/ui/statusPicker.d.ts +1 -1
  446. package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +4 -2
  447. package/dist/types/plugins/table/ui/FloatingContextualButton/styles.d.ts +1 -1
  448. package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +3 -2
  449. package/dist/types/plugins/table/ui/FloatingContextualMenu/styles.d.ts +1 -1
  450. package/dist/types/plugins/tasks-and-decisions/styles.d.ts +1 -1
  451. package/dist/types/plugins/type-ahead/constants.d.ts +1 -0
  452. package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +1 -0
  453. package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +26 -0
  454. package/dist/types/plugins/unsupported-content/styles.d.ts +1 -1
  455. package/dist/types/types/editor-appearance-component.d.ts +0 -1
  456. package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +0 -1
  457. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -9
  458. package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
  459. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
  460. package/dist/types/ui/ConfigPanel/ErrorMessage/ErrorImage.d.ts +1 -0
  461. package/dist/types/ui/ConfigPanel/Fields/Boolean.d.ts +2 -2
  462. package/dist/types/ui/ConfigPanel/Fields/TabGroup.d.ts +1 -0
  463. package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
  464. package/dist/types/ui/ConfigPanel/Header.d.ts +3 -3
  465. package/dist/types/ui/ContentStyles/index.d.ts +1 -4
  466. package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +1 -0
  467. package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +1 -0
  468. package/dist/types/ui/ElementBrowser/components/ElementSearch.d.ts +1 -1
  469. package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +2 -1
  470. package/dist/types/ui/ElementBrowser/hooks/use-container-width.d.ts +1 -0
  471. package/dist/types/ui/LinkSearch/LinkSearchList.d.ts +4 -3
  472. package/dist/types/ui/Resizer/styled.d.ts +1 -2
  473. package/dist/types/ui/Toolbar/ToolbarInner.d.ts +3 -1
  474. package/dist/types/ui/ToolbarButton/index.d.ts +3 -3
  475. package/dist/types/ui/ToolbarButton/styles.d.ts +2 -2
  476. package/dist/types/ui/WithFlash/index.d.ts +3 -1
  477. package/dist/types/utils/insert.d.ts +2 -1
  478. package/dist/types/utils/performance/components/RenderTracking.d.ts +13 -0
  479. package/package.json +27 -29
  480. package/dist/cjs/plugins/media/commands/media-editor.js +0 -80
  481. package/dist/cjs/plugins/media/pm-plugins/media-editor.js +0 -106
  482. package/dist/cjs/plugins/media/toolbar/annotation.js +0 -244
  483. package/dist/cjs/plugins/media/ui/MediaEditor.js +0 -88
  484. package/dist/cjs/utils/compare.js +0 -136
  485. package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +0 -83
  486. package/dist/es2019/plugins/media/commands/media-editor.js +0 -46
  487. package/dist/es2019/plugins/media/pm-plugins/media-editor.js +0 -43
  488. package/dist/es2019/plugins/media/toolbar/annotation.js +0 -136
  489. package/dist/es2019/plugins/media/ui/MediaEditor.js +0 -51
  490. package/dist/es2019/utils/compare.js +0 -99
  491. package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +0 -66
  492. package/dist/esm/plugins/media/commands/media-editor.js +0 -59
  493. package/dist/esm/plugins/media/pm-plugins/media-editor.js +0 -90
  494. package/dist/esm/plugins/media/toolbar/annotation.js +0 -218
  495. package/dist/esm/plugins/media/ui/MediaEditor.js +0 -76
  496. package/dist/esm/utils/compare.js +0 -115
  497. package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +0 -68
  498. package/dist/types/plugins/media/commands/media-editor.d.ts +0 -7
  499. package/dist/types/plugins/media/pm-plugins/media-editor.d.ts +0 -3
  500. package/dist/types/plugins/media/toolbar/annotation.d.ts +0 -24
  501. package/dist/types/plugins/media/ui/MediaEditor.d.ts +0 -14
  502. package/dist/types/utils/compare.d.ts +0 -32
  503. package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +0 -30
@@ -27,7 +27,7 @@ import uuid from 'uuid/v4';
27
27
  import { name, version } from './version-wrapper';
28
28
  import { combineExtensionProviders } from '@atlaskit/editor-common/extensions';
29
29
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
30
- import { BaseTheme, WithCreateAnalyticsEvent, WidthProvider, LegacyToNextIntlProvider, IntlLegacyFallbackProvider } from '@atlaskit/editor-common/ui';
30
+ import { BaseTheme, WithCreateAnalyticsEvent, WidthProvider } from '@atlaskit/editor-common/ui';
31
31
  import { getAnalyticsAppearance, startMeasure, stopMeasure, clearMeasure, measureTTI, getTTISeverity } from '@atlaskit/editor-common/utils';
32
32
  import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
33
33
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
@@ -44,7 +44,7 @@ import { combineQuickInsertProviders, extensionProviderToQuickInsertProvider } f
44
44
  import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from './plugins/analytics';
45
45
  import ErrorBoundary from './create-editor/ErrorBoundary';
46
46
  import { createFeatureFlagsFromProps } from './plugins/feature-flags-context/feature-flags-from-props';
47
- import { RenderTracking } from './utils/react-hooks/use-component-renderer-tracking';
47
+ import { RenderTracking } from './utils/performance/components/RenderTracking';
48
48
  var WidthProviderFullHeight = styled(WidthProvider)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n"])));
49
49
 
50
50
  var Editor = /*#__PURE__*/function (_React$Component) {
@@ -517,7 +517,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
517
517
  var renderTracking = (_this$props$performan = this.props.performanceTracking) === null || _this$props$performan === void 0 ? void 0 : (_this$props$performan2 = _this$props$performan.renderTracking) === null || _this$props$performan2 === void 0 ? void 0 : _this$props$performan2.editor;
518
518
  var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
519
519
  var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
520
- var editor = /*#__PURE__*/React.createElement(FabricEditorAnalyticsContext, {
520
+ return /*#__PURE__*/React.createElement(FabricEditorAnalyticsContext, {
521
521
  data: {
522
522
  packageName: name,
523
523
  packageVersion: version,
@@ -588,7 +588,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
588
588
  customSecondaryToolbarComponents: _this5.props.secondaryToolbarComponents,
589
589
  contextPanel: _this5.props.contextPanel,
590
590
  collabEdit: _this5.props.collabEdit,
591
- allowAnnotation: !!_this5.props.annotationProviders,
592
591
  persistScrollGutter: _this5.props.persistScrollGutter,
593
592
  enableToolbarMinWidth: ((_this5$props$featureF = _this5.props.featureFlags) === null || _this5$props$featureF === void 0 ? void 0 : _this5$props$featureF.toolbarMinWidthOverflow) != null ? !!((_this5$props$featureF2 = _this5.props.featureFlags) !== null && _this5$props$featureF2 !== void 0 && _this5$props$featureF2.toolbarMinWidthOverflow) : _this5.props.UNSAFE_allowUndoRedoButtons,
594
593
  useStickyToolbar: _this5.props.useStickyToolbar,
@@ -602,7 +601,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
602
601
  }))))));
603
602
  }
604
603
  }));
605
- return /*#__PURE__*/React.createElement(LegacyToNextIntlProvider, null, /*#__PURE__*/React.createElement(IntlLegacyFallbackProvider, null, editor));
606
604
  }
607
605
  }]);
608
606
 
@@ -2,9 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject;
4
4
 
5
- import React from 'react';
5
+ /** @jsx jsx */
6
+ import React, { Fragment } from 'react';
7
+ import { css, jsx } from '@emotion/react';
6
8
  import { browser } from '@atlaskit/editor-common/utils';
7
- import styled from 'styled-components';
8
9
  import { N400 } from '@atlaskit/theme/colors';
9
10
  export var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
10
11
  export var toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
@@ -76,7 +77,7 @@ var arrowKeysMap = {
76
77
  ARROWUP: "\u2191",
77
78
  ARROWDOWN: "\u2193"
78
79
  };
79
- export var TooltipShortcut = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n"])), N400);
80
+ var tooltipShortcutStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n /* TODO: fix in develop: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E */\n /* stylelint-disable-next-line */\n label: tooltip-shortcut;\n"])), N400);
80
81
 
81
82
  function formatShortcut(keymap) {
82
83
  var shortcut;
@@ -113,7 +114,9 @@ export var ToolTipContent = /*#__PURE__*/React.memo(function (_ref) {
113
114
  shortcutOverride = _ref.shortcutOverride,
114
115
  keymap = _ref.keymap;
115
116
  var shortcut = shortcutOverride || keymap && formatShortcut(keymap);
116
- return shortcut || description ? /*#__PURE__*/React.createElement(React.Fragment, null, description, shortcut && description && "\xA0", shortcut && /*#__PURE__*/React.createElement(TooltipShortcut, null, shortcut)) : null;
117
+ return shortcut || description ? jsx(Fragment, null, description, shortcut && description && "\xA0", shortcut && jsx("span", {
118
+ css: tooltipShortcutStyle
119
+ }, shortcut)) : null;
117
120
  });
118
121
  export function findKeymapByDescription(description) {
119
122
  var matches = ALL.filter(function (keymap) {
@@ -4,9 +4,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
4
4
 
5
5
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
6
6
 
7
+ /** @jsx jsx */
7
8
  import rafSchedule from 'raf-schd';
8
9
  import React from 'react';
9
- import styled from 'styled-components';
10
+ import { css, jsx } from '@emotion/react';
10
11
  import { N30 } from '@atlaskit/theme/colors';
11
12
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
12
13
  import { BaseTheme } from '@atlaskit/editor-common/ui';
@@ -15,38 +16,29 @@ import ContentStyles from '../../ui/ContentStyles';
15
16
  import WidthEmitter from '../../ui/WidthEmitter';
16
17
  import { ClickAreaBlock } from '../../ui/Addon';
17
18
  import { scrollbarStyles } from '../../ui/styles';
18
- import { deprecatedTableFullPageEditorStyles } from '../../plugins/table/ui/common-styles';
19
+ import { tableFullPageEditorStyles } from '../../plugins/table/ui/common-styles';
19
20
  import AvatarsWithPluginState from '../../plugins/collab-edit/ui';
20
21
  import { Editor, EditorContent, useEditorSharedConfig } from './Editor';
21
22
  import { Toolbar } from './Toolbar';
22
23
  import { ContentComponents } from './ContentComponents';
23
24
  import { useCreateAnalyticsHandler } from './internal/hooks/use-analytics';
24
25
  import { ContextPanelWidthProvider } from '../../ui/ContextPanel/context';
25
- var FullPageEditorWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-width: 340px;\n height: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n"])));
26
- FullPageEditorWrapper.displayName = 'FullPageEditorWrapper';
27
- var ScrollContainer = styled(ContentStyles)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-y: scroll;\n position: relative;\n display: flex;\n flex-direction: column;\n scroll-behavior: smooth;\n ", ";\n"])), scrollbarStyles);
28
- ScrollContainer.displayName = 'ScrollContainer';
26
+ var fullPageEditorWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-width: 340px;\n height: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n"])));
27
+ var scrollContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-y: scroll;\n position: relative;\n display: flex;\n flex-direction: column;\n scroll-behavior: smooth;\n ", ";\n"])), scrollbarStyles);
29
28
  var GUTTER_PADDING = 32;
30
29
  var GUTTER_STYLE = {
31
30
  padding: "0 ".concat(GUTTER_PADDING, "px")
32
31
  };
33
- var ContentArea = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n height: 100%;\n box-sizing: border-box;\n"])));
34
- ContentArea.displayName = 'ContentArea';
35
- var EditorContentArea = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n line-height: 24px;\n height: 100%;\n width: 100%;\n max-width: ", "px;\n padding-top: 50px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n padding-bottom: 55px;\n\n & .ProseMirror {\n flex-grow: 1;\n box-sizing: border-box;\n }\n\n && .ProseMirror {\n & > * {\n clear: both;\n }\n > p,\n > ul,\n > ol,\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n clear: none;\n }\n }\n ", ";\n"])), function (_ref) {
36
- var theme = _ref.theme;
37
- return theme.layoutMaxWidth + GUTTER_PADDING * 2;
38
- }, deprecatedTableFullPageEditorStyles);
39
- EditorContentArea.displayName = 'EditorContentArea';
40
- var MainToolbar = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n align-items: center;\n box-shadow: ", ";\n transition: box-shadow 200ms;\n z-index: ", ";\n display: flex;\n height: 80px;\n flex-shrink: 0;\n background-color: white;\n\n & object {\n height: 0 !important;\n }\n"])), function (props) {
41
- return props.showKeyline ? "0 ".concat(akEditorToolbarKeylineHeight, "px 0 0 ").concat(N30) : 'none';
42
- }, akEditorMenuZIndex);
43
- MainToolbar.displayName = 'MainToolbar';
44
- var MainToolbarCustomComponentsSlot = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n"])));
45
- MainToolbarCustomComponentsSlot.displayName = 'MainToolbar';
46
- var SecondaryToolbar = styled.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n flex-shrink: 0;\n display: flex;\n padding: 24px 0;\n"])));
47
- SecondaryToolbar.displayName = 'SecondaryToolbar';
48
- var SidebarArea = styled.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 100%;\n box-sizing: border-box;\n"])));
49
- SidebarArea.displayName = 'SidebarArea';
32
+ var contentArea = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n height: 100%;\n box-sizing: border-box;\n"])));
33
+
34
+ var editorContentArea = function editorContentArea(theme) {
35
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n line-height: 24px;\n height: 100%;\n width: 100%;\n max-width: ", "px;\n padding-top: 50px;\n margin: 0 auto;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n padding-bottom: 55px;\n\n & .ProseMirror {\n flex-grow: 1;\n box-sizing: border-box;\n }\n\n && .ProseMirror {\n & > * {\n clear: both;\n }\n > p,\n > ul,\n > ol,\n > h1,\n > h2,\n > h3,\n > h4,\n > h5,\n > h6 {\n clear: none;\n }\n }\n ", ";\n"])), theme.layoutMaxWidth + GUTTER_PADDING * 2, tableFullPageEditorStyles);
36
+ };
37
+
38
+ var mainToolbar = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n align-items: center;\n box-shadow: 'none';\n\n transition: box-shadow 200ms;\n z-index: ", ";\n display: flex;\n height: 80px;\n flex-shrink: 0;\n background-color: white;\n\n & object {\n height: 0 !important;\n }\n"])), akEditorMenuZIndex);
39
+ var mainToolbarWithKeyline = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n box-shadow: 0 ", "px 0 0 ", "\n"])), mainToolbar, akEditorToolbarKeylineHeight, N30);
40
+ var mainToolbarCustomComponentsSlot = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n"])));
41
+ var sidebarArea = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n height: 100%;\n box-sizing: border-box;\n"])));
50
42
 
51
43
  function useKeyline() {
52
44
  var _React$useState = React.useState(false),
@@ -99,31 +91,41 @@ function FullPage(props) {
99
91
  scrollContainerRef = _useKeyline2[1];
100
92
 
101
93
  var config = useEditorSharedConfig();
102
- return /*#__PURE__*/React.createElement(ContextPanelWidthProvider, null, /*#__PURE__*/React.createElement(Editor, _extends({}, props, {
94
+ return jsx(ContextPanelWidthProvider, null, jsx(Editor, _extends({}, props, {
103
95
  onAnalyticsEvent: handleAnalyticsEvent
104
- }), /*#__PURE__*/React.createElement(BaseTheme, {
96
+ }), jsx(BaseTheme, {
105
97
  dynamicTextSizing: allowDynamicTextSizing
106
- }, /*#__PURE__*/React.createElement(FullPageEditorWrapper, {
98
+ }, jsx("div", {
99
+ css: fullPageEditorWrapper,
107
100
  className: "akEditor"
108
- }, /*#__PURE__*/React.createElement(MainToolbar, {
101
+ }, jsx("div", {
109
102
  "data-testid": "ak-editor-main-toolbar",
110
- showKeyline: showKeyline
111
- }, /*#__PURE__*/React.createElement(Toolbar, {
103
+ css: showKeyline ? mainToolbarWithKeyline : mainToolbar
104
+ }, jsx(Toolbar, {
112
105
  containerElement: scrollContainerRef.current
113
- }), /*#__PURE__*/React.createElement(MainToolbarCustomComponentsSlot, null, !config ? null : /*#__PURE__*/React.createElement(AvatarsWithPluginState, {
106
+ }), jsx("div", {
107
+ css: mainToolbarCustomComponentsSlot
108
+ }, !config ? null : jsx(AvatarsWithPluginState, {
114
109
  editorView: config.editorView,
115
110
  eventDispatcher: config.eventDispatcher,
116
111
  inviteToEditHandler: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.inviteToEditHandler,
117
112
  isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected
118
- }), primaryToolbarComponents)), /*#__PURE__*/React.createElement(ContentArea, null, /*#__PURE__*/React.createElement(ScrollContainer, {
119
- innerRef: scrollContainerRef,
120
- className: "fabric-editor-popup-scroll-parent"
121
- }, /*#__PURE__*/React.createElement(ClickAreaBlock, {
113
+ }), primaryToolbarComponents)), jsx("div", {
114
+ css: contentArea
115
+ }, jsx(ContentStyles, {
116
+ ref: scrollContainerRef,
117
+ className: "fabric-editor-popup-scroll-parent",
118
+ css: scrollContainer
119
+ }, jsx(ClickAreaBlock, {
122
120
  editorView: config === null || config === void 0 ? void 0 : config.editorView
123
- }, /*#__PURE__*/React.createElement(EditorContentArea, null, /*#__PURE__*/React.createElement("div", {
121
+ }, jsx("div", {
122
+ css: editorContentArea
123
+ }, jsx("div", {
124
124
  style: GUTTER_STYLE,
125
125
  className: "ak-editor-content-area"
126
- }, contentComponents, /*#__PURE__*/React.createElement(EditorContent, null), /*#__PURE__*/React.createElement(ContentComponents, null))))), contextPanel && /*#__PURE__*/React.createElement(SidebarArea, null, contextPanel), /*#__PURE__*/React.createElement(WidthEmitter, {
126
+ }, contentComponents, jsx(EditorContent, null), jsx(ContentComponents, null))))), contextPanel && jsx("div", {
127
+ css: sidebarArea
128
+ }, contextPanel), jsx(WidthEmitter, {
127
129
  editorView: config === null || config === void 0 ? void 0 : config.editorView
128
130
  }))))));
129
131
  }
@@ -67,7 +67,6 @@ export function useCXHTMLPreset(_ref) {
67
67
  provider: mediaProvider,
68
68
  allowMediaSingle: true,
69
69
  allowMediaGroup: true,
70
- allowAnnotation: true,
71
70
  allowResizing: true,
72
71
  allowLinking: true,
73
72
  allowResizingInTables: true,
@@ -3,17 +3,12 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  import React from 'react';
6
- import { startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
7
- import { analyticsPluginKey } from '../plugins/analytics/plugin-key';
8
6
  import { createDispatch } from '../event-dispatcher';
9
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../plugins/analytics';
7
+ import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
10
8
  import { analyticsEventKey } from '../plugins/analytics/consts';
11
- import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
12
9
  import { getFeatureFlags } from '../plugins/feature-flags-context';
13
10
  import { ErrorBoundary } from '../ui/ErrorBoundary';
14
- var DEFAULT_SAMPLING_RATE = 100;
15
- var DEFAULT_SLOW_THRESHOLD = 7;
16
- var nodeViewEventsCounter = 0;
11
+ import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from './getPerformanceOptions';
17
12
 
18
13
  var ReactNodeView = /*#__PURE__*/function () {
19
14
  function ReactNodeView(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
@@ -86,27 +81,24 @@ var ReactNodeView = /*#__PURE__*/function () {
86
81
 
87
82
 
88
83
  this.domRef.classList.add("".concat(this.node.type.name, "View-content-wrap"));
89
- var _this$performanceOpti = this.performanceOptions,
90
- samplingRate = _this$performanceOpti.samplingRate,
91
- slowThreshold = _this$performanceOpti.slowThreshold,
92
- trackingEnabled = _this$performanceOpti.enabled;
93
- trackingEnabled && startMeasure("\uD83E\uDD89".concat(this.node.type.name, "::ReactNodeView"));
84
+
85
+ var _getPerformanceOption = getPerformanceOptions(this.view),
86
+ samplingRate = _getPerformanceOption.samplingRate,
87
+ slowThreshold = _getPerformanceOption.slowThreshold,
88
+ trackingEnabled = _getPerformanceOption.trackingEnabled;
89
+
90
+ trackingEnabled && startMeasureReactNodeViewRendered({
91
+ nodeTypeName: this.node.type.name
92
+ });
94
93
  this.renderReactComponent(function () {
95
94
  return _this2.render(_this2.reactComponentProps, _this2.handleRef);
96
95
  });
97
- trackingEnabled && stopMeasure("\uD83E\uDD89".concat(this.node.type.name, "::ReactNodeView"), function (duration) {
98
- if (++nodeViewEventsCounter % samplingRate === 0 && duration > slowThreshold) {
99
- _this2.dispatchAnalyticsEvent({
100
- action: ACTION.REACT_NODEVIEW_RENDERED,
101
- actionSubject: ACTION_SUBJECT.EDITOR,
102
- eventType: EVENT_TYPE.OPERATIONAL,
103
- attributes: {
104
- node: _this2.node.type.name,
105
- duration: duration,
106
- participants: getParticipantsCount(_this2.view.state)
107
- }
108
- });
109
- }
96
+ trackingEnabled && stopMeasureReactNodeViewRendered({
97
+ nodeTypeName: this.node.type.name,
98
+ dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
99
+ editorState: this.view.state,
100
+ samplingRate: samplingRate,
101
+ slowThreshold: slowThreshold
110
102
  });
111
103
  return this;
112
104
  }
@@ -242,19 +234,6 @@ var ReactNodeView = /*#__PURE__*/function () {
242
234
  this.domRef = undefined;
243
235
  this.contentDOM = undefined;
244
236
  }
245
- }, {
246
- key: "performanceOptions",
247
- get: function get() {
248
- var pluginState = analyticsPluginKey.getState(this.view.state);
249
- var nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
250
- var samplingRate = nodeViewTracking.samplingRate || DEFAULT_SAMPLING_RATE;
251
- var slowThreshold = nodeViewTracking.slowThreshold || DEFAULT_SLOW_THRESHOLD;
252
- return {
253
- enabled: !!nodeViewTracking.enabled,
254
- samplingRate: samplingRate,
255
- slowThreshold: slowThreshold
256
- };
257
- }
258
237
  }], [{
259
238
  key: "fromComponent",
260
239
  value: function fromComponent(component, portalProviderAPI, eventDispatcher, props, viewShouldUpdate) {
@@ -0,0 +1,212 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
4
+ import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../plugins/analytics';
5
+ import { analyticsEventKey } from '../plugins/analytics/consts';
6
+ import { ErrorBoundary } from '../ui/ErrorBoundary';
7
+ import { getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from './getPerformanceOptions';
8
+
9
+ function createNodeView(_ref) {
10
+ var nodeViewParams = _ref.nodeViewParams,
11
+ pmPluginFactoryParams = _ref.pmPluginFactoryParams,
12
+ Component = _ref.Component,
13
+ extraComponentProps = _ref.extraComponentProps;
14
+ // We set a variable for the current node which is
15
+ // used for comparisions when doing updates, before being
16
+ // overwritten to the updated node.
17
+ var currentNode = nodeViewParams.node; // First we setup the dom element which will be rendered and "tracked" by prosemirror
18
+ // and also used as a "editor portal" (not react portal) target by the editor
19
+ // portal provider api, for rendering the Component passed.
20
+
21
+ var domRef = document.createElement('span');
22
+ domRef.contentEditable = 'false';
23
+ setDomAttrs(nodeViewParams.node, domRef); // @see ED-3790
24
+ // something gets messed up during mutation processing inside of a
25
+ // nodeView if DOM structure has nested plain "div"s, it doesn't see the
26
+ // difference between them and it kills the nodeView
27
+
28
+ domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "inlineNodeViewOuterContainer"); // This util is shared for tracking rendering, and the ErrorBoundary that
29
+ // is setup to wrap the Component when rendering
30
+ // NOTE: This is not a prosemirror dispatch
31
+
32
+ function dispatchAnalyticsEvent(payload) {
33
+ pmPluginFactoryParams.eventDispatcher.emit(analyticsEventKey, {
34
+ payload: payload
35
+ });
36
+ } // This is called to render the Component into domRef which is inside the
37
+ // prosemirror View.
38
+ // Internally it uses the unstable_renderSubtreeIntoContainer api to render,
39
+ // to the passed dom element (domRef) which means it is automatically
40
+ // "cleaned up" when you do a "re render".
41
+
42
+
43
+ function renderComponent() {
44
+ pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
45
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
46
+ currentNode: currentNode,
47
+ nodeViewParams: nodeViewParams,
48
+ Component: Component,
49
+ extraComponentProps: extraComponentProps
50
+ }), domRef, false, // node views should be rendered with intl context
51
+ true);
52
+ }
53
+
54
+ var _getPerformanceOption = getPerformanceOptions(nodeViewParams.view),
55
+ samplingRate = _getPerformanceOption.samplingRate,
56
+ slowThreshold = _getPerformanceOption.slowThreshold,
57
+ trackingEnabled = _getPerformanceOption.trackingEnabled;
58
+
59
+ trackingEnabled && startMeasureReactNodeViewRendered({
60
+ nodeTypeName: currentNode.type.name
61
+ }); // We render the component while creating the node view
62
+
63
+ renderComponent();
64
+ trackingEnabled && stopMeasureReactNodeViewRendered({
65
+ nodeTypeName: currentNode.type.name,
66
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
67
+ editorState: nodeViewParams.view.state,
68
+ samplingRate: samplingRate,
69
+ slowThreshold: slowThreshold
70
+ }); // https://prosemirror.net/docs/ref/#view.NodeView
71
+
72
+ var nodeView = {
73
+ get dom() {
74
+ return domRef;
75
+ },
76
+
77
+ update: function update(nextNode, _decorations) {
78
+ // Let ProseMirror handle the update if node types are different.
79
+ // This prevents an issue where it was not possible to select the
80
+ // inline node view then replace it by entering text - the node
81
+ // view contents would be deleted but the node view itself would
82
+ // stay in the view and become uneditable.
83
+ if (currentNode.type !== nextNode.type) {
84
+ return false;
85
+ } // On updates, we only set the new attributes if the type, attributes, and marks
86
+ // have changed on the node.
87
+ // NOTE: this could mean attrs changes aren't reflected in the dom,
88
+ // when an attribute key which was previously present is no longer
89
+ // present.
90
+ // ie.
91
+ // -> Original attributes { text: "hello world", color: "red" }
92
+ // -> Updated attributes { color: "blue" }
93
+ // in this case, the dom text attribute will not be cleared.
94
+ //
95
+ // This may not be an issue with any of our current node schemas.
96
+
97
+
98
+ if (!currentNode.sameMarkup(nextNode)) {
99
+ setDomAttrs(nextNode, domRef);
100
+ }
101
+
102
+ currentNode = nextNode;
103
+ renderComponent();
104
+ return true;
105
+ },
106
+ destroy: function destroy() {
107
+ // When prosemirror destroys the node view, we need to clean up
108
+ // what we have previously rendered using the editor portal
109
+ // provider api.
110
+ pmPluginFactoryParams.portalProviderAPI.remove(domRef); // @ts-expect-error Expect an error as domRef is expected to be
111
+ // of HTMLSpanElement type however once the node view has
112
+ // been destroyed no other consumers should still be using it.
113
+
114
+ domRef = undefined;
115
+ }
116
+ };
117
+ return nodeView;
118
+ }
119
+ /**
120
+ * Copies the attributes from a ProseMirror Node to a DOM node.
121
+ * @param node The Prosemirror Node from which to source the attributes
122
+ */
123
+
124
+
125
+ function setDomAttrs(node, element) {
126
+ Object.keys(node.attrs || {}).forEach(function (attr) {
127
+ element.setAttribute(attr, node.attrs[attr]);
128
+ });
129
+ }
130
+
131
+ function getPortalChildren(_ref2) {
132
+ var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
133
+ currentNode = _ref2.currentNode,
134
+ nodeViewParams = _ref2.nodeViewParams,
135
+ Component = _ref2.Component,
136
+ extraComponentProps = _ref2.extraComponentProps;
137
+ return function portalChildren() {
138
+ var _currentNode$type$nam, _currentNode$type;
139
+
140
+ // All inline nodes use `display: inline` to allow for multi-line
141
+ // wrapping. This does produce an issue in Chrome where it is not
142
+ // possible to click select the position after the node,
143
+ // see: https://product-fabric.atlassian.net/browse/ED-12003
144
+ // however this is only a problem for node views that use
145
+ // `display: inline-block` somewhere within the Component.
146
+ // Looking at the below structure, spans with className
147
+ // `inlineNodeViewAddZeroWidthSpace` have pseudo elements that
148
+ // add a zero width space which fixes the problem.
149
+ // Without the additional zero width space before the Component,
150
+ // it is not possible to use the keyboard to range select in Safari.
151
+ //
152
+ // Zero width spaces on either side of the Component also prevent
153
+ // the cursor from appearing inside the node view on all browsers.
154
+ //
155
+ // Note:
156
+ // In future it is worth considering prohibiting the use of `display: inline-block`
157
+ // within inline node view Components however would require a sizable
158
+ // refactor. A test suite to catch any instances of this is ideal however
159
+ // the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
160
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
161
+ component: ACTION_SUBJECT.REACT_NODE_VIEW,
162
+ componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : ACTION_SUBJECT_ID.UNKNOWN_NODE,
163
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent
164
+ }, /*#__PURE__*/React.createElement("span", {
165
+ className: "inlineNodeViewAddZeroWidthSpace"
166
+ }), ZERO_WIDTH_SPACE, /*#__PURE__*/React.createElement(Component, _extends({
167
+ view: nodeViewParams.view,
168
+ getPos: nodeViewParams.getPos,
169
+ node: currentNode
170
+ }, extraComponentProps)), /*#__PURE__*/React.createElement("span", {
171
+ className: "inlineNodeViewAddZeroWidthSpace"
172
+ }));
173
+ };
174
+ } // https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
175
+ // The prosemirror EditorProps has a nodeViews key which has the rough shape:
176
+ // type nodeViews: {
177
+ // [nodeViewName: string]: (node, editorView, getPos, decorations, innerDecorations) => NodeView
178
+ // }
179
+ // So the value of the keys on the nodeViews object, are a function which should return a NodeView.
180
+ // The following type NodeViewProducer, refers to these functions which return a NodeView.
181
+ //
182
+ // So the above type could also be described as
183
+ // type NodeViewProducer = (node, editorView, getPos, decorations, innerDecorations) => NodeView
184
+ // nodeViews: {
185
+ // [nodeViewName: string]: NodeViewProducer
186
+ // }
187
+
188
+
189
+ // This return of this function is intended to be the value of a key
190
+ // in a ProseMirror nodeViews object.
191
+ export function getInlineNodeViewProducer(_ref3) {
192
+ var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
193
+ Component = _ref3.Component,
194
+ extraComponentProps = _ref3.extraComponentProps;
195
+
196
+ function nodeViewProducer() {
197
+ var nodeView = createNodeView({
198
+ nodeViewParams: {
199
+ node: arguments.length <= 0 ? undefined : arguments[0],
200
+ view: arguments.length <= 1 ? undefined : arguments[1],
201
+ getPos: arguments.length <= 2 ? undefined : arguments[2],
202
+ decorations: arguments.length <= 3 ? undefined : arguments[3]
203
+ },
204
+ pmPluginFactoryParams: pmPluginFactoryParams,
205
+ Component: Component,
206
+ extraComponentProps: extraComponentProps
207
+ });
208
+ return nodeView;
209
+ }
210
+
211
+ return nodeViewProducer;
212
+ }
@@ -0,0 +1,9 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject;
4
+
5
+ import { css } from '@emotion/react';
6
+ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils'; // For reasoning behind styles, see comments in:
7
+ // ./getInlineNodeViewProducer -> portalChildren()
8
+
9
+ export var InlineNodeViewSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .inlineNodeViewOuterContainer {\n display: inline;\n }\n\n .inlineNodeViewAddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), ZERO_WIDTH_SPACE);
@@ -0,0 +1,45 @@
1
+ import { startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
2
+ import { getParticipantsCount } from '../plugins/collab-edit/get-participants-count';
3
+ import { analyticsPluginKey } from '../plugins/analytics/plugin-key';
4
+ import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../plugins/analytics'; // This was existing logic when converting from ReactNodeView
5
+ // our current sampling for this event is not bound by node.type
6
+
7
+ export var nodeViewRenderedEventsCounter = 0;
8
+ var DEFAULT_SAMPLING_RATE = 100;
9
+ var DEFAULT_SLOW_THRESHOLD = 7;
10
+ export function getPerformanceOptions(view) {
11
+ var pluginState = analyticsPluginKey.getState(view.state);
12
+ var nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
13
+ var samplingRate = nodeViewTracking.samplingRate || DEFAULT_SAMPLING_RATE;
14
+ var slowThreshold = nodeViewTracking.slowThreshold || DEFAULT_SLOW_THRESHOLD;
15
+ return {
16
+ trackingEnabled: !!nodeViewTracking.enabled,
17
+ samplingRate: samplingRate,
18
+ slowThreshold: slowThreshold
19
+ };
20
+ }
21
+ export function startMeasureReactNodeViewRendered(_ref) {
22
+ var nodeTypeName = _ref.nodeTypeName;
23
+ startMeasure("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"));
24
+ }
25
+ export function stopMeasureReactNodeViewRendered(_ref2) {
26
+ var nodeTypeName = _ref2.nodeTypeName,
27
+ dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
28
+ editorState = _ref2.editorState,
29
+ samplingRate = _ref2.samplingRate,
30
+ slowThreshold = _ref2.slowThreshold;
31
+ stopMeasure("\uD83E\uDD89".concat(nodeTypeName, "::ReactNodeView"), function (duration) {
32
+ if (++nodeViewRenderedEventsCounter % samplingRate === 0 && duration > slowThreshold) {
33
+ dispatchAnalyticsEvent({
34
+ action: ACTION.REACT_NODEVIEW_RENDERED,
35
+ actionSubject: ACTION_SUBJECT.EDITOR,
36
+ eventType: EVENT_TYPE.OPERATIONAL,
37
+ attributes: {
38
+ node: nodeTypeName,
39
+ duration: duration,
40
+ participants: getParticipantsCount(editorState)
41
+ }
42
+ });
43
+ }
44
+ });
45
+ }
@@ -10,13 +10,15 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
10
10
 
11
11
  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; } }
12
12
 
13
+ /** @jsx jsx */
13
14
  import React from 'react';
15
+ import { jsx } from '@emotion/react';
14
16
  import { injectIntl } from 'react-intl-next';
15
17
  import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
16
18
  import ToolbarButton from '../../../../ui/ToolbarButton';
17
19
  import Dropdown from '../../../../ui/Dropdown';
18
20
  import Alignment from '../../../../ui/Alignment';
19
- import { ExpandIconWrapper, Separator, TriggerWrapper, Wrapper } from './styles';
21
+ import { expandIconWrapper, separator, triggerWrapper, wrapper } from './styles';
20
22
  import { IconMap } from './icon-map';
21
23
  import { messages } from './messages';
22
24
  export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
@@ -85,7 +87,9 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
85
87
  disabled = _this$props.disabled,
86
88
  intl = _this$props.intl;
87
89
  var title = intl.formatMessage(messages.alignment);
88
- return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(Dropdown, {
90
+ return jsx("span", {
91
+ css: wrapper
92
+ }, jsx(Dropdown, {
89
93
  mountTo: popupsMountPoint,
90
94
  boundariesElement: popupsBoundariesElement,
91
95
  scrollableElement: popupsScrollableElement,
@@ -94,7 +98,7 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
94
98
  handleEscapeKeydown: this.hide,
95
99
  fitWidth: 112,
96
100
  fitHeight: 80,
97
- trigger: /*#__PURE__*/React.createElement(ToolbarButton, {
101
+ trigger: jsx(ToolbarButton, {
98
102
  spacing: isReducedSpacing ? 'none' : 'default',
99
103
  disabled: disabled,
100
104
  selected: isOpen,
@@ -104,18 +108,24 @@ export var AlignmentToolbar = /*#__PURE__*/function (_React$Component) {
104
108
  "aria-expanded": isOpen,
105
109
  "aria-haspopup": true,
106
110
  onClick: this.toggleOpen,
107
- iconBefore: /*#__PURE__*/React.createElement(TriggerWrapper, null, /*#__PURE__*/React.createElement(IconMap, {
111
+ iconBefore: jsx("div", {
112
+ css: triggerWrapper
113
+ }, jsx(IconMap, {
108
114
  alignment: pluginState.align
109
- }), /*#__PURE__*/React.createElement(ExpandIconWrapper, null, /*#__PURE__*/React.createElement(ExpandIcon, {
115
+ }), jsx("span", {
116
+ css: expandIconWrapper
117
+ }, jsx(ExpandIcon, {
110
118
  label: ""
111
119
  })))
112
120
  })
113
- }, /*#__PURE__*/React.createElement(Alignment, {
121
+ }, jsx(Alignment, {
114
122
  onClick: function onClick(align) {
115
123
  return _this2.changeAlignment(align);
116
124
  },
117
125
  selectedAlignment: pluginState.align
118
- })), /*#__PURE__*/React.createElement(Separator, null));
126
+ })), jsx("span", {
127
+ css: separator
128
+ }));
119
129
  }
120
130
  }]);
121
131
 
@@ -2,9 +2,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
4
 
5
- import styled from 'styled-components';
5
+ import { css } from '@emotion/react';
6
6
  import { N30 } from '@atlaskit/theme/colors';
7
- export var TriggerWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n"])));
8
- export var Separator = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), N30);
9
- export var Wrapper = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n div {\n display: flex;\n }\n"])));
10
- export var ExpandIconWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
7
+ export var triggerWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n"])));
8
+ export var separator = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n"])), N30);
9
+ export var wrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n div {\n display: flex;\n }\n"])));
10
+ export var expandIconWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));