@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 163.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`0ba6e613e60`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ba6e613e60) - [ux] Removed media-editor references in editor-core
8
+ - [`2ec99bf6f9f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ec99bf6f9f) - [ux] ED-14651: removed react-intl v2.
9
+
10
+ ### Minor Changes
11
+
12
+ - [`8767658360f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8767658360f) - Adds support to editor-core analytics types to dispatch operational feature exposure events.
13
+ - [`bceab5fa97d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bceab5fa97d) - ED-14632: Add render count tracking reRendered event in Renderer
14
+ - [`c5ac02c5672`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c5ac02c5672) - [ux] ED-9226 padding fix for numbered list inside table
15
+ - [`16ffd1a95fd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16ffd1a95fd) - [ux] ED-14479 Created getInlineNodeView api and added test suite. Refactored status node view to use new api.
16
+ - [`a94f57c6d61`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a94f57c6d61) - fix integration tests to remove dependency of mediaPicker popup and use native picker
17
+
18
+ ### Patch Changes
19
+
20
+ - [`0863c318a75`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0863c318a75) - [ED-14590] Fix unclickable links on mention team highlight
21
+ - [`ef7b2acee8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ef7b2acee8d) - [ux] ED-14633 Adds editable widgets either side of the cursor when positioned between inline node views to prevent the cursor disappearing or appearing in the wrong position. Also removes old Firefox selection workaround.
22
+ - [`874489b6b05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/874489b6b05) - [ux] Migrate the DateNodeView to the node view producer api, which provides a number of selection fixes.
23
+ - [`44c6c36d8d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/44c6c36d8d9) - ED-14263 replaced styled usages
24
+ - [`523d46ed69d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/523d46ed69d) - ED-11836 Restrict ListsJoined type
25
+ - [`b38234b895c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b38234b895c) - ED-14268 editor-core replace some of styled-components with emotion
26
+ - [`3c24bc606e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3c24bc606e4) - [ux][ed-14191] Stop config panel with tabs overflowing when long dropdown option is selected
27
+ - [`92f9b06ab4b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/92f9b06ab4b) - ED-14269 Migrated css in editor-core to emotion.
28
+ - [`2cfb953f2af`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2cfb953f2af) - ED-14739: Fix backspace issue. When you have a list and have empty paragraphs after the list, if you position the cursor just after the list, the cursor doesn't move going into the list.
29
+ - [`2a8cbf13f57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2a8cbf13f57) - ED-14339 removed ThemeProvider from editor-core
30
+ - [`d175ef22258`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d175ef22258) - Change default analytic value
31
+ - [`5c1bba527ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5c1bba527ee) - [ux] ED-14573 Updated getInlineNodeViewProducer markup and styles to allow multiline node views to wrap across lines and not act as a block element.
32
+ - [`1e2086467f1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1e2086467f1) - [ED-13775] Added resize observer on scroll parent element to realign popup components when template context panel is opened/closed.
33
+ - [`78aec52dea0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/78aec52dea0) - use latest SmartUserPicker in Editor packages
34
+ - [`0dad4610a36`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0dad4610a36) - ED-14268 migrated parts of editor-core to use emotion.
35
+ - [`b060587bd38`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b060587bd38) - [ux][ed-14584] Solve inconsistencies of node insertion via the toolbar. Specifically targeting nodes being inserted into other nodes that cannot contain them. Previously the node being inserted into would split in half, but now the invalid node will insert underneath.
36
+ - [`1b0b4544d74`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1b0b4544d74) - Change default value of FF for experiment
37
+ - [`447feec5678`](https://bitbucket.org/atlassian/atlassian-frontend/commits/447feec5678) - [ED-11900] Make table node top of the quick insert result by adding "table" in the keywords list
38
+ - [`9b5c590caae`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9b5c590caae) - ED-14268 replaced some styled in editor-core
39
+ - [`ea050810214`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea050810214) - EDM-2935: Reimplement change experiment tracking event without localId
40
+ - [`5c6607ee0e7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5c6607ee0e7) - Migrated link, rule, panel and expand styles in editor-common to emotion.
41
+ - [`62edf20ab1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/62edf20ab1e) - Migrates all usage of brand tokens to either selected or information tokens. This change is purely for semantic reasons, there are no visual or behavioural changes.
42
+ - [`1bf958a90f5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1bf958a90f5) - EDM-2892: Fix view switcher casing in feature flags from props.
43
+ - Updated dependencies
44
+
3
45
  ## 162.0.1
4
46
 
5
47
  ### Patch Changes
@@ -268,7 +268,7 @@ var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
268
268
  }, {
269
269
  key: "render",
270
270
  value: function render() {
271
- return /*#__PURE__*/_react.default.createElement(_ui.IntlNextErrorBoundary, null, this.props.children);
271
+ return /*#__PURE__*/_react.default.createElement(_ui.IntlErrorBoundary, null, this.props.children);
272
272
  }
273
273
  }]);
274
274
  return ErrorBoundaryWithEditorView;
@@ -46,7 +46,7 @@ var _utils2 = require("../utils");
46
46
 
47
47
  var _saferTransactions = require("../utils/performance/safer-transactions");
48
48
 
49
- var _useComponentRendererTracking = require("../utils/react-hooks/use-component-renderer-tracking");
49
+ var _RenderTracking = require("../utils/performance/components/RenderTracking");
50
50
 
51
51
  var _nodes = require("../utils/nodes");
52
52
 
@@ -831,7 +831,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
831
831
  var renderTracking = (_this$props$editorPro9 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro9 === void 0 ? void 0 : (_this$props$editorPro10 = _this$props$editorPro9.renderTracking) === null || _this$props$editorPro10 === void 0 ? void 0 : _this$props$editorPro10.reactEditorView;
832
832
  var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
833
833
  var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
834
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_useComponentRendererTracking.RenderTracking, {
834
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_RenderTracking.RenderTracking, {
835
835
  componentProps: this.props,
836
836
  action: _analytics.ACTION.RE_RENDERED,
837
837
  actionSubject: _analytics.ACTION_SUBJECT.REACT_EDITOR_VIEW,
@@ -73,7 +73,7 @@ var _ErrorBoundary = _interopRequireDefault(require("./create-editor/ErrorBounda
73
73
 
74
74
  var _featureFlagsFromProps = require("./plugins/feature-flags-context/feature-flags-from-props");
75
75
 
76
- var _useComponentRendererTracking = require("./utils/react-hooks/use-component-renderer-tracking");
76
+ var _RenderTracking = require("./utils/performance/components/RenderTracking");
77
77
 
78
78
  var _templateObject;
79
79
 
@@ -551,8 +551,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
551
551
  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;
552
552
  var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
553
553
  var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
554
-
555
- var editor = /*#__PURE__*/_react.default.createElement(_analyticsNamespacedContext.FabricEditorAnalyticsContext, {
554
+ return /*#__PURE__*/_react.default.createElement(_analyticsNamespacedContext.FabricEditorAnalyticsContext, {
556
555
  data: {
557
556
  packageName: _versionWrapper.name,
558
557
  packageVersion: _versionWrapper.version,
@@ -562,7 +561,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
562
561
  }
563
562
  }, /*#__PURE__*/_react.default.createElement(_ui.WithCreateAnalyticsEvent, {
564
563
  render: function render(createAnalyticsEvent) {
565
- return (_this5.createAnalyticsEvent = createAnalyticsEvent) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_useComponentRendererTracking.RenderTracking, {
564
+ return (_this5.createAnalyticsEvent = createAnalyticsEvent) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_RenderTracking.RenderTracking, {
566
565
  componentProps: _this5.props,
567
566
  action: _analytics.ACTION.RE_RENDERED,
568
567
  actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
@@ -623,7 +622,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
623
622
  customSecondaryToolbarComponents: _this5.props.secondaryToolbarComponents,
624
623
  contextPanel: _this5.props.contextPanel,
625
624
  collabEdit: _this5.props.collabEdit,
626
- allowAnnotation: !!_this5.props.annotationProviders,
627
625
  persistScrollGutter: _this5.props.persistScrollGutter,
628
626
  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,
629
627
  useStickyToolbar: _this5.props.useStickyToolbar,
@@ -637,8 +635,6 @@ var Editor = /*#__PURE__*/function (_React$Component) {
637
635
  }))))));
638
636
  }
639
637
  }));
640
-
641
- return /*#__PURE__*/_react.default.createElement(_ui.LegacyToNextIntlProvider, null, /*#__PURE__*/_react.default.createElement(_ui.IntlLegacyFallbackProvider, null, editor));
642
638
  }
643
639
  }]);
644
640
  return Editor;
@@ -2,6 +2,8 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
@@ -71,7 +73,7 @@ Object.defineProperty(exports, "RIGHT", {
71
73
  return _consts.RIGHT;
72
74
  }
73
75
  });
74
- exports.TooltipShortcut = exports.ToolTipContent = void 0;
76
+ exports.ToolTipContent = void 0;
75
77
  Object.defineProperty(exports, "UP", {
76
78
  enumerable: true,
77
79
  get: function get() {
@@ -94,11 +96,11 @@ exports.undo = void 0;
94
96
 
95
97
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
96
98
 
97
- var _react = _interopRequireDefault(require("react"));
99
+ var _react = _interopRequireWildcard(require("react"));
98
100
 
99
- var _utils = require("@atlaskit/editor-common/utils");
101
+ var _react2 = require("@emotion/react");
100
102
 
101
- var _styledComponents = _interopRequireDefault(require("styled-components"));
103
+ var _utils = require("@atlaskit/editor-common/utils");
102
104
 
103
105
  var _colors = require("@atlaskit/theme/colors");
104
106
 
@@ -106,6 +108,10 @@ var _consts = require("./consts");
106
108
 
107
109
  var _templateObject;
108
110
 
111
+ 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); }
112
+
113
+ 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; }
114
+
109
115
  var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
110
116
  exports.addAltText = addAltText;
111
117
  var toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
@@ -239,10 +245,7 @@ var arrowKeysMap = {
239
245
  ARROWUP: "\u2191",
240
246
  ARROWDOWN: "\u2193"
241
247
  };
242
-
243
- var TooltipShortcut = _styledComponents.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n border-radius: 2px;\n background-color: ", ";\n padding: 0 2px;\n"])), _colors.N400);
244
-
245
- exports.TooltipShortcut = TooltipShortcut;
248
+ var tooltipShortcutStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), _colors.N400);
246
249
 
247
250
  function formatShortcut(keymap) {
248
251
  var shortcut;
@@ -280,7 +283,9 @@ var ToolTipContent = /*#__PURE__*/_react.default.memo(function (_ref) {
280
283
  shortcutOverride = _ref.shortcutOverride,
281
284
  keymap = _ref.keymap;
282
285
  var shortcut = shortcutOverride || keymap && formatShortcut(keymap);
283
- return shortcut || description ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, description, shortcut && description && "\xA0", shortcut && /*#__PURE__*/_react.default.createElement(TooltipShortcut, null, shortcut)) : null;
286
+ return shortcut || description ? (0, _react2.jsx)(_react.Fragment, null, description, shortcut && description && "\xA0", shortcut && (0, _react2.jsx)("span", {
287
+ css: tooltipShortcutStyle
288
+ }, shortcut)) : null;
284
289
  });
285
290
 
286
291
  exports.ToolTipContent = ToolTipContent;
@@ -17,7 +17,7 @@ var _rafSchd = _interopRequireDefault(require("raf-schd"));
17
17
 
18
18
  var _react = _interopRequireDefault(require("react"));
19
19
 
20
- var _styledComponents = _interopRequireDefault(require("styled-components"));
20
+ var _react2 = require("@emotion/react");
21
21
 
22
22
  var _colors = require("@atlaskit/theme/colors");
23
23
 
@@ -51,44 +51,22 @@ var _context = require("../../ui/ContextPanel/context");
51
51
 
52
52
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
53
53
 
54
- var FullPageEditorWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n min-width: 340px;\n height: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n"])));
55
-
56
- FullPageEditorWrapper.displayName = 'FullPageEditorWrapper';
57
- var ScrollContainer = (0, _styledComponents.default)(_ContentStyles.default)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n overflow-y: scroll;\n position: relative;\n display: flex;\n flex-direction: column;\n scroll-behavior: smooth;\n ", ";\n"])), _styles.scrollbarStyles);
58
- ScrollContainer.displayName = 'ScrollContainer';
54
+ var fullPageEditorWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n min-width: 340px;\n height: 100%;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n"])));
55
+ var scrollContainer = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n overflow-y: scroll;\n position: relative;\n display: flex;\n flex-direction: column;\n scroll-behavior: smooth;\n ", ";\n"])), _styles.scrollbarStyles);
59
56
  var GUTTER_PADDING = 32;
60
57
  var GUTTER_STYLE = {
61
58
  padding: "0 ".concat(GUTTER_PADDING, "px")
62
59
  };
60
+ var contentArea = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n height: 100%;\n box-sizing: border-box;\n"])));
63
61
 
64
- var ContentArea = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n height: 100%;\n box-sizing: border-box;\n"])));
65
-
66
- ContentArea.displayName = 'ContentArea';
67
-
68
- var EditorContentArea = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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) {
69
- var theme = _ref.theme;
70
- return theme.layoutMaxWidth + GUTTER_PADDING * 2;
71
- }, _commonStyles.deprecatedTableFullPageEditorStyles);
72
-
73
- EditorContentArea.displayName = 'EditorContentArea';
74
-
75
- var MainToolbar = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\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) {
76
- return props.showKeyline ? "0 ".concat(_editorSharedStyles.akEditorToolbarKeylineHeight, "px 0 0 ").concat(_colors.N30) : 'none';
77
- }, _editorSharedStyles.akEditorMenuZIndex);
78
-
79
- MainToolbar.displayName = 'MainToolbar';
80
-
81
- var MainToolbarCustomComponentsSlot = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n"])));
82
-
83
- MainToolbarCustomComponentsSlot.displayName = 'MainToolbar';
84
-
85
- var SecondaryToolbar = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\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"])));
86
-
87
- SecondaryToolbar.displayName = 'SecondaryToolbar';
88
-
89
- var SidebarArea = _styledComponents.default.div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n box-sizing: border-box;\n"])));
62
+ var editorContentArea = function editorContentArea(theme) {
63
+ return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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, _commonStyles.tableFullPageEditorStyles);
64
+ };
90
65
 
91
- SidebarArea.displayName = 'SidebarArea';
66
+ var mainToolbar = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\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"])), _editorSharedStyles.akEditorMenuZIndex);
67
+ var mainToolbarWithKeyline = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n box-shadow: 0 ", "px 0 0 ", "\n"])), mainToolbar, _editorSharedStyles.akEditorToolbarKeylineHeight, _colors.N30);
68
+ var mainToolbarCustomComponentsSlot = (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-end;\n flex-grow: 1;\n"])));
69
+ var sidebarArea = (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n height: 100%;\n box-sizing: border-box;\n"])));
92
70
 
93
71
  function useKeyline() {
94
72
  var _React$useState = _react.default.useState(false),
@@ -143,31 +121,41 @@ function FullPage(props) {
143
121
  scrollContainerRef = _useKeyline2[1];
144
122
 
145
123
  var config = (0, _Editor.useEditorSharedConfig)();
146
- return /*#__PURE__*/_react.default.createElement(_context.ContextPanelWidthProvider, null, /*#__PURE__*/_react.default.createElement(_Editor.Editor, (0, _extends2.default)({}, props, {
124
+ return (0, _react2.jsx)(_context.ContextPanelWidthProvider, null, (0, _react2.jsx)(_Editor.Editor, (0, _extends2.default)({}, props, {
147
125
  onAnalyticsEvent: handleAnalyticsEvent
148
- }), /*#__PURE__*/_react.default.createElement(_ui.BaseTheme, {
126
+ }), (0, _react2.jsx)(_ui.BaseTheme, {
149
127
  dynamicTextSizing: allowDynamicTextSizing
150
- }, /*#__PURE__*/_react.default.createElement(FullPageEditorWrapper, {
128
+ }, (0, _react2.jsx)("div", {
129
+ css: fullPageEditorWrapper,
151
130
  className: "akEditor"
152
- }, /*#__PURE__*/_react.default.createElement(MainToolbar, {
131
+ }, (0, _react2.jsx)("div", {
153
132
  "data-testid": "ak-editor-main-toolbar",
154
- showKeyline: showKeyline
155
- }, /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, {
133
+ css: showKeyline ? mainToolbarWithKeyline : mainToolbar
134
+ }, (0, _react2.jsx)(_Toolbar.Toolbar, {
156
135
  containerElement: scrollContainerRef.current
157
- }), /*#__PURE__*/_react.default.createElement(MainToolbarCustomComponentsSlot, null, !config ? null : /*#__PURE__*/_react.default.createElement(_ui2.default, {
136
+ }), (0, _react2.jsx)("div", {
137
+ css: mainToolbarCustomComponentsSlot
138
+ }, !config ? null : (0, _react2.jsx)(_ui2.default, {
158
139
  editorView: config.editorView,
159
140
  eventDispatcher: config.eventDispatcher,
160
141
  inviteToEditHandler: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.inviteToEditHandler,
161
142
  isInviteToEditButtonSelected: collabEdit === null || collabEdit === void 0 ? void 0 : collabEdit.isInviteToEditButtonSelected
162
- }), primaryToolbarComponents)), /*#__PURE__*/_react.default.createElement(ContentArea, null, /*#__PURE__*/_react.default.createElement(ScrollContainer, {
163
- innerRef: scrollContainerRef,
164
- className: "fabric-editor-popup-scroll-parent"
165
- }, /*#__PURE__*/_react.default.createElement(_Addon.ClickAreaBlock, {
143
+ }), primaryToolbarComponents)), (0, _react2.jsx)("div", {
144
+ css: contentArea
145
+ }, (0, _react2.jsx)(_ContentStyles.default, {
146
+ ref: scrollContainerRef,
147
+ className: "fabric-editor-popup-scroll-parent",
148
+ css: scrollContainer
149
+ }, (0, _react2.jsx)(_Addon.ClickAreaBlock, {
166
150
  editorView: config === null || config === void 0 ? void 0 : config.editorView
167
- }, /*#__PURE__*/_react.default.createElement(EditorContentArea, null, /*#__PURE__*/_react.default.createElement("div", {
151
+ }, (0, _react2.jsx)("div", {
152
+ css: editorContentArea
153
+ }, (0, _react2.jsx)("div", {
168
154
  style: GUTTER_STYLE,
169
155
  className: "ak-editor-content-area"
170
- }, contentComponents, /*#__PURE__*/_react.default.createElement(_Editor.EditorContent, null), /*#__PURE__*/_react.default.createElement(_ContentComponents.ContentComponents, null))))), contextPanel && /*#__PURE__*/_react.default.createElement(SidebarArea, null, contextPanel), /*#__PURE__*/_react.default.createElement(_WidthEmitter.default, {
156
+ }, contentComponents, (0, _react2.jsx)(_Editor.EditorContent, null), (0, _react2.jsx)(_ContentComponents.ContentComponents, null))))), contextPanel && (0, _react2.jsx)("div", {
157
+ css: sidebarArea
158
+ }, contextPanel), (0, _react2.jsx)(_WidthEmitter.default, {
171
159
  editorView: config === null || config === void 0 ? void 0 : config.editorView
172
160
  }))))));
173
161
  }
@@ -81,7 +81,6 @@ function useCXHTMLPreset(_ref) {
81
81
  provider: mediaProvider,
82
82
  allowMediaSingle: true,
83
83
  allowMediaGroup: true,
84
- allowAnnotation: true,
85
84
  allowResizing: true,
86
85
  allowLinking: true,
87
86
  allowResizingInTables: true,
@@ -17,25 +17,17 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
17
17
 
18
18
  var _react = _interopRequireDefault(require("react"));
19
19
 
20
- var _utils = require("@atlaskit/editor-common/utils");
21
-
22
- var _pluginKey = require("../plugins/analytics/plugin-key");
23
-
24
20
  var _eventDispatcher = require("../event-dispatcher");
25
21
 
26
22
  var _analytics = require("../plugins/analytics");
27
23
 
28
24
  var _consts = require("../plugins/analytics/consts");
29
25
 
30
- var _getParticipantsCount = require("../plugins/collab-edit/get-participants-count");
31
-
32
26
  var _featureFlagsContext = require("../plugins/feature-flags-context");
33
27
 
34
28
  var _ErrorBoundary = require("../ui/ErrorBoundary");
35
29
 
36
- var DEFAULT_SAMPLING_RATE = 100;
37
- var DEFAULT_SLOW_THRESHOLD = 7;
38
- var nodeViewEventsCounter = 0;
30
+ var _getPerformanceOptions = require("./getPerformanceOptions");
39
31
 
40
32
  var ReactNodeView = /*#__PURE__*/function () {
41
33
  function ReactNodeView(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent) {
@@ -104,27 +96,24 @@ var ReactNodeView = /*#__PURE__*/function () {
104
96
 
105
97
 
106
98
  this.domRef.classList.add("".concat(this.node.type.name, "View-content-wrap"));
107
- var _this$performanceOpti = this.performanceOptions,
108
- samplingRate = _this$performanceOpti.samplingRate,
109
- slowThreshold = _this$performanceOpti.slowThreshold,
110
- trackingEnabled = _this$performanceOpti.enabled;
111
- trackingEnabled && (0, _utils.startMeasure)("\uD83E\uDD89".concat(this.node.type.name, "::ReactNodeView"));
99
+
100
+ var _getPerformanceOption = (0, _getPerformanceOptions.getPerformanceOptions)(this.view),
101
+ samplingRate = _getPerformanceOption.samplingRate,
102
+ slowThreshold = _getPerformanceOption.slowThreshold,
103
+ trackingEnabled = _getPerformanceOption.trackingEnabled;
104
+
105
+ trackingEnabled && (0, _getPerformanceOptions.startMeasureReactNodeViewRendered)({
106
+ nodeTypeName: this.node.type.name
107
+ });
112
108
  this.renderReactComponent(function () {
113
109
  return _this2.render(_this2.reactComponentProps, _this2.handleRef);
114
110
  });
115
- trackingEnabled && (0, _utils.stopMeasure)("\uD83E\uDD89".concat(this.node.type.name, "::ReactNodeView"), function (duration) {
116
- if (++nodeViewEventsCounter % samplingRate === 0 && duration > slowThreshold) {
117
- _this2.dispatchAnalyticsEvent({
118
- action: _analytics.ACTION.REACT_NODEVIEW_RENDERED,
119
- actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
120
- eventType: _analytics.EVENT_TYPE.OPERATIONAL,
121
- attributes: {
122
- node: _this2.node.type.name,
123
- duration: duration,
124
- participants: (0, _getParticipantsCount.getParticipantsCount)(_this2.view.state)
125
- }
126
- });
127
- }
111
+ trackingEnabled && (0, _getPerformanceOptions.stopMeasureReactNodeViewRendered)({
112
+ nodeTypeName: this.node.type.name,
113
+ dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
114
+ editorState: this.view.state,
115
+ samplingRate: samplingRate,
116
+ slowThreshold: slowThreshold
128
117
  });
129
118
  return this;
130
119
  }
@@ -260,20 +249,6 @@ var ReactNodeView = /*#__PURE__*/function () {
260
249
  this.domRef = undefined;
261
250
  this.contentDOM = undefined;
262
251
  }
263
- }, {
264
- key: "performanceOptions",
265
- get: function get() {
266
- var pluginState = _pluginKey.analyticsPluginKey.getState(this.view.state);
267
-
268
- var nodeViewTracking = pluginState && pluginState.performanceTracking ? pluginState.performanceTracking.nodeViewTracking || {} : {};
269
- var samplingRate = nodeViewTracking.samplingRate || DEFAULT_SAMPLING_RATE;
270
- var slowThreshold = nodeViewTracking.slowThreshold || DEFAULT_SLOW_THRESHOLD;
271
- return {
272
- enabled: !!nodeViewTracking.enabled,
273
- samplingRate: samplingRate,
274
- slowThreshold: slowThreshold
275
- };
276
- }
277
252
  }], [{
278
253
  key: "fromComponent",
279
254
  value: function fromComponent(component, portalProviderAPI, eventDispatcher, props, viewShouldUpdate) {
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getInlineNodeViewProducer = getInlineNodeViewProducer;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _utils = require("@atlaskit/editor-common/utils");
15
+
16
+ var _analytics = require("../plugins/analytics");
17
+
18
+ var _consts = require("../plugins/analytics/consts");
19
+
20
+ var _ErrorBoundary = require("../ui/ErrorBoundary");
21
+
22
+ var _getPerformanceOptions = require("./getPerformanceOptions");
23
+
24
+ function createNodeView(_ref) {
25
+ var nodeViewParams = _ref.nodeViewParams,
26
+ pmPluginFactoryParams = _ref.pmPluginFactoryParams,
27
+ Component = _ref.Component,
28
+ extraComponentProps = _ref.extraComponentProps;
29
+ // We set a variable for the current node which is
30
+ // used for comparisions when doing updates, before being
31
+ // overwritten to the updated node.
32
+ var currentNode = nodeViewParams.node; // First we setup the dom element which will be rendered and "tracked" by prosemirror
33
+ // and also used as a "editor portal" (not react portal) target by the editor
34
+ // portal provider api, for rendering the Component passed.
35
+
36
+ var domRef = document.createElement('span');
37
+ domRef.contentEditable = 'false';
38
+ setDomAttrs(nodeViewParams.node, domRef); // @see ED-3790
39
+ // something gets messed up during mutation processing inside of a
40
+ // nodeView if DOM structure has nested plain "div"s, it doesn't see the
41
+ // difference between them and it kills the nodeView
42
+
43
+ domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "inlineNodeViewOuterContainer"); // This util is shared for tracking rendering, and the ErrorBoundary that
44
+ // is setup to wrap the Component when rendering
45
+ // NOTE: This is not a prosemirror dispatch
46
+
47
+ function dispatchAnalyticsEvent(payload) {
48
+ pmPluginFactoryParams.eventDispatcher.emit(_consts.analyticsEventKey, {
49
+ payload: payload
50
+ });
51
+ } // This is called to render the Component into domRef which is inside the
52
+ // prosemirror View.
53
+ // Internally it uses the unstable_renderSubtreeIntoContainer api to render,
54
+ // to the passed dom element (domRef) which means it is automatically
55
+ // "cleaned up" when you do a "re render".
56
+
57
+
58
+ function renderComponent() {
59
+ pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
60
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
61
+ currentNode: currentNode,
62
+ nodeViewParams: nodeViewParams,
63
+ Component: Component,
64
+ extraComponentProps: extraComponentProps
65
+ }), domRef, false, // node views should be rendered with intl context
66
+ true);
67
+ }
68
+
69
+ var _getPerformanceOption = (0, _getPerformanceOptions.getPerformanceOptions)(nodeViewParams.view),
70
+ samplingRate = _getPerformanceOption.samplingRate,
71
+ slowThreshold = _getPerformanceOption.slowThreshold,
72
+ trackingEnabled = _getPerformanceOption.trackingEnabled;
73
+
74
+ trackingEnabled && (0, _getPerformanceOptions.startMeasureReactNodeViewRendered)({
75
+ nodeTypeName: currentNode.type.name
76
+ }); // We render the component while creating the node view
77
+
78
+ renderComponent();
79
+ trackingEnabled && (0, _getPerformanceOptions.stopMeasureReactNodeViewRendered)({
80
+ nodeTypeName: currentNode.type.name,
81
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent,
82
+ editorState: nodeViewParams.view.state,
83
+ samplingRate: samplingRate,
84
+ slowThreshold: slowThreshold
85
+ }); // https://prosemirror.net/docs/ref/#view.NodeView
86
+
87
+ var nodeView = {
88
+ get dom() {
89
+ return domRef;
90
+ },
91
+
92
+ update: function update(nextNode, _decorations) {
93
+ // Let ProseMirror handle the update if node types are different.
94
+ // This prevents an issue where it was not possible to select the
95
+ // inline node view then replace it by entering text - the node
96
+ // view contents would be deleted but the node view itself would
97
+ // stay in the view and become uneditable.
98
+ if (currentNode.type !== nextNode.type) {
99
+ return false;
100
+ } // On updates, we only set the new attributes if the type, attributes, and marks
101
+ // have changed on the node.
102
+ // NOTE: this could mean attrs changes aren't reflected in the dom,
103
+ // when an attribute key which was previously present is no longer
104
+ // present.
105
+ // ie.
106
+ // -> Original attributes { text: "hello world", color: "red" }
107
+ // -> Updated attributes { color: "blue" }
108
+ // in this case, the dom text attribute will not be cleared.
109
+ //
110
+ // This may not be an issue with any of our current node schemas.
111
+
112
+
113
+ if (!currentNode.sameMarkup(nextNode)) {
114
+ setDomAttrs(nextNode, domRef);
115
+ }
116
+
117
+ currentNode = nextNode;
118
+ renderComponent();
119
+ return true;
120
+ },
121
+ destroy: function destroy() {
122
+ // When prosemirror destroys the node view, we need to clean up
123
+ // what we have previously rendered using the editor portal
124
+ // provider api.
125
+ pmPluginFactoryParams.portalProviderAPI.remove(domRef); // @ts-expect-error Expect an error as domRef is expected to be
126
+ // of HTMLSpanElement type however once the node view has
127
+ // been destroyed no other consumers should still be using it.
128
+
129
+ domRef = undefined;
130
+ }
131
+ };
132
+ return nodeView;
133
+ }
134
+ /**
135
+ * Copies the attributes from a ProseMirror Node to a DOM node.
136
+ * @param node The Prosemirror Node from which to source the attributes
137
+ */
138
+
139
+
140
+ function setDomAttrs(node, element) {
141
+ Object.keys(node.attrs || {}).forEach(function (attr) {
142
+ element.setAttribute(attr, node.attrs[attr]);
143
+ });
144
+ }
145
+
146
+ function getPortalChildren(_ref2) {
147
+ var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
148
+ currentNode = _ref2.currentNode,
149
+ nodeViewParams = _ref2.nodeViewParams,
150
+ Component = _ref2.Component,
151
+ extraComponentProps = _ref2.extraComponentProps;
152
+ return function portalChildren() {
153
+ var _currentNode$type$nam, _currentNode$type;
154
+
155
+ // All inline nodes use `display: inline` to allow for multi-line
156
+ // wrapping. This does produce an issue in Chrome where it is not
157
+ // possible to click select the position after the node,
158
+ // see: https://product-fabric.atlassian.net/browse/ED-12003
159
+ // however this is only a problem for node views that use
160
+ // `display: inline-block` somewhere within the Component.
161
+ // Looking at the below structure, spans with className
162
+ // `inlineNodeViewAddZeroWidthSpace` have pseudo elements that
163
+ // add a zero width space which fixes the problem.
164
+ // Without the additional zero width space before the Component,
165
+ // it is not possible to use the keyboard to range select in Safari.
166
+ //
167
+ // Zero width spaces on either side of the Component also prevent
168
+ // the cursor from appearing inside the node view on all browsers.
169
+ //
170
+ // Note:
171
+ // In future it is worth considering prohibiting the use of `display: inline-block`
172
+ // within inline node view Components however would require a sizable
173
+ // refactor. A test suite to catch any instances of this is ideal however
174
+ // the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
175
+ return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.ErrorBoundary, {
176
+ component: _analytics.ACTION_SUBJECT.REACT_NODE_VIEW,
177
+ 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 : _analytics.ACTION_SUBJECT_ID.UNKNOWN_NODE,
178
+ dispatchAnalyticsEvent: dispatchAnalyticsEvent
179
+ }, /*#__PURE__*/_react.default.createElement("span", {
180
+ className: "inlineNodeViewAddZeroWidthSpace"
181
+ }), _utils.ZERO_WIDTH_SPACE, /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
182
+ view: nodeViewParams.view,
183
+ getPos: nodeViewParams.getPos,
184
+ node: currentNode
185
+ }, extraComponentProps)), /*#__PURE__*/_react.default.createElement("span", {
186
+ className: "inlineNodeViewAddZeroWidthSpace"
187
+ }));
188
+ };
189
+ } // https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
190
+ // The prosemirror EditorProps has a nodeViews key which has the rough shape:
191
+ // type nodeViews: {
192
+ // [nodeViewName: string]: (node, editorView, getPos, decorations, innerDecorations) => NodeView
193
+ // }
194
+ // So the value of the keys on the nodeViews object, are a function which should return a NodeView.
195
+ // The following type NodeViewProducer, refers to these functions which return a NodeView.
196
+ //
197
+ // So the above type could also be described as
198
+ // type NodeViewProducer = (node, editorView, getPos, decorations, innerDecorations) => NodeView
199
+ // nodeViews: {
200
+ // [nodeViewName: string]: NodeViewProducer
201
+ // }
202
+
203
+
204
+ // This return of this function is intended to be the value of a key
205
+ // in a ProseMirror nodeViews object.
206
+ function getInlineNodeViewProducer(_ref3) {
207
+ var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
208
+ Component = _ref3.Component,
209
+ extraComponentProps = _ref3.extraComponentProps;
210
+
211
+ function nodeViewProducer() {
212
+ var nodeView = createNodeView({
213
+ nodeViewParams: {
214
+ node: arguments.length <= 0 ? undefined : arguments[0],
215
+ view: arguments.length <= 1 ? undefined : arguments[1],
216
+ getPos: arguments.length <= 2 ? undefined : arguments[2],
217
+ decorations: arguments.length <= 3 ? undefined : arguments[3]
218
+ },
219
+ pmPluginFactoryParams: pmPluginFactoryParams,
220
+ Component: Component,
221
+ extraComponentProps: extraComponentProps
222
+ });
223
+ return nodeView;
224
+ }
225
+
226
+ return nodeViewProducer;
227
+ }