@atlaskit/editor-common 63.0.1 → 66.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 (295) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/dist/cjs/i18n/cs.js +3 -3
  3. package/dist/cjs/i18n/da.js +3 -3
  4. package/dist/cjs/i18n/de.js +3 -3
  5. package/dist/cjs/i18n/en_ZZ.js +27 -0
  6. package/dist/cjs/i18n/es.js +3 -3
  7. package/dist/cjs/i18n/fi.js +3 -3
  8. package/dist/cjs/i18n/fr.js +3 -3
  9. package/dist/cjs/i18n/hu.js +3 -3
  10. package/dist/cjs/i18n/it.js +3 -3
  11. package/dist/cjs/i18n/ja.js +3 -3
  12. package/dist/cjs/i18n/ko.js +3 -3
  13. package/dist/cjs/i18n/nb.js +3 -3
  14. package/dist/cjs/i18n/nl.js +3 -3
  15. package/dist/cjs/i18n/pl.js +3 -3
  16. package/dist/cjs/i18n/pt_BR.js +3 -3
  17. package/dist/cjs/i18n/ru.js +3 -3
  18. package/dist/cjs/i18n/sv.js +3 -3
  19. package/dist/cjs/i18n/th.js +3 -3
  20. package/dist/cjs/i18n/tr.js +3 -3
  21. package/dist/cjs/i18n/uk.js +3 -3
  22. package/dist/cjs/i18n/vi.js +3 -3
  23. package/dist/cjs/i18n/zh.js +3 -2
  24. package/dist/cjs/i18n/zh_TW.js +3 -3
  25. package/dist/cjs/index.js +1 -29
  26. package/dist/cjs/normalize-feature-flags.js +40 -4
  27. package/dist/cjs/{ui/IntlLegacyFallbackProvider → safe-plugin}/index.js +17 -35
  28. package/dist/cjs/styles/index.js +0 -8
  29. package/dist/cjs/styles/shared/annotation.js +25 -17
  30. package/dist/cjs/styles/shared/block-marks.js +2 -2
  31. package/dist/cjs/styles/shared/blockquote.js +2 -2
  32. package/dist/cjs/styles/shared/code-mark.js +9 -5
  33. package/dist/cjs/styles/shared/column-layout.js +2 -2
  34. package/dist/cjs/styles/shared/date.js +2 -2
  35. package/dist/cjs/styles/shared/headings.js +5 -2
  36. package/dist/cjs/styles/shared/indentation.js +2 -2
  37. package/dist/cjs/styles/shared/link.js +2 -2
  38. package/dist/cjs/styles/shared/lists.js +4 -2
  39. package/dist/cjs/styles/shared/media-single.js +2 -2
  40. package/dist/cjs/styles/shared/panel.js +7 -4
  41. package/dist/cjs/styles/shared/paragraph.js +2 -2
  42. package/dist/cjs/styles/shared/rule.js +5 -2
  43. package/dist/cjs/styles/shared/shadow.js +2 -2
  44. package/dist/cjs/styles/shared/table.js +37 -33
  45. package/dist/cjs/styles/shared/task-decision.js +2 -2
  46. package/dist/cjs/styles/shared/text-color.js +2 -2
  47. package/dist/cjs/styles/shared/whitespace.js +2 -2
  48. package/dist/cjs/types/collab.js +5 -0
  49. package/dist/cjs/ui/BaseTheme/index.js +27 -11
  50. package/dist/cjs/ui/Caption/index.js +10 -7
  51. package/dist/cjs/ui/Expand/index.js +84 -46
  52. package/dist/cjs/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +9 -9
  53. package/dist/cjs/ui/MediaSingle/index.js +15 -8
  54. package/dist/cjs/ui/MediaSingle/link.js +4 -6
  55. package/dist/cjs/ui/MediaSingle/styled.js +23 -20
  56. package/dist/cjs/ui/Mention/index.js +1 -3
  57. package/dist/cjs/ui/Mention/mention-with-profilecard.js +33 -194
  58. package/dist/cjs/ui/Mention/mention-with-providers.js +1 -5
  59. package/dist/cjs/ui/Messages/index.js +25 -22
  60. package/dist/cjs/ui/Popup/index.js +15 -1
  61. package/dist/cjs/ui/UnsupportedBlock/index.js +9 -6
  62. package/dist/cjs/ui/UnsupportedInline/index.js +8 -6
  63. package/dist/cjs/ui/WidthProvider/index.js +8 -9
  64. package/dist/cjs/ui/clear-next-sibling-margin-top.js +4 -5
  65. package/dist/cjs/ui/index.js +24 -34
  66. package/dist/cjs/utils/compare-props.js +136 -0
  67. package/dist/cjs/utils/index.js +23 -1
  68. package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +47 -0
  69. package/dist/cjs/utils/validator.js +1 -1
  70. package/dist/cjs/version.json +1 -1
  71. package/dist/es2019/i18n/cs.js +3 -3
  72. package/dist/es2019/i18n/da.js +3 -3
  73. package/dist/es2019/i18n/de.js +3 -3
  74. package/dist/es2019/i18n/en_ZZ.js +19 -0
  75. package/dist/es2019/i18n/es.js +3 -3
  76. package/dist/es2019/i18n/fi.js +3 -3
  77. package/dist/es2019/i18n/fr.js +3 -3
  78. package/dist/es2019/i18n/hu.js +3 -3
  79. package/dist/es2019/i18n/it.js +3 -3
  80. package/dist/es2019/i18n/ja.js +3 -3
  81. package/dist/es2019/i18n/ko.js +3 -3
  82. package/dist/es2019/i18n/nb.js +3 -3
  83. package/dist/es2019/i18n/nl.js +3 -3
  84. package/dist/es2019/i18n/pl.js +3 -3
  85. package/dist/es2019/i18n/pt_BR.js +3 -3
  86. package/dist/es2019/i18n/ru.js +3 -3
  87. package/dist/es2019/i18n/sv.js +3 -3
  88. package/dist/es2019/i18n/th.js +3 -3
  89. package/dist/es2019/i18n/tr.js +3 -3
  90. package/dist/es2019/i18n/uk.js +3 -3
  91. package/dist/es2019/i18n/vi.js +3 -3
  92. package/dist/es2019/i18n/zh.js +3 -2
  93. package/dist/es2019/i18n/zh_TW.js +3 -3
  94. package/dist/es2019/index.js +2 -7
  95. package/dist/es2019/normalize-feature-flags.js +40 -4
  96. package/dist/es2019/safe-plugin/index.js +10 -0
  97. package/dist/es2019/styles/index.js +0 -1
  98. package/dist/es2019/styles/shared/annotation.js +11 -11
  99. package/dist/es2019/styles/shared/block-marks.js +3 -2
  100. package/dist/es2019/styles/shared/blockquote.js +1 -1
  101. package/dist/es2019/styles/shared/code-mark.js +14 -11
  102. package/dist/es2019/styles/shared/column-layout.js +1 -1
  103. package/dist/es2019/styles/shared/date.js +1 -1
  104. package/dist/es2019/styles/shared/headings.js +8 -8
  105. package/dist/es2019/styles/shared/indentation.js +1 -1
  106. package/dist/es2019/styles/shared/link.js +1 -1
  107. package/dist/es2019/styles/shared/lists.js +19 -1
  108. package/dist/es2019/styles/shared/media-single.js +1 -1
  109. package/dist/es2019/styles/shared/panel.js +15 -15
  110. package/dist/es2019/styles/shared/paragraph.js +1 -1
  111. package/dist/es2019/styles/shared/rule.js +3 -3
  112. package/dist/es2019/styles/shared/shadow.js +1 -1
  113. package/dist/es2019/styles/shared/table.js +23 -13
  114. package/dist/es2019/styles/shared/task-decision.js +1 -1
  115. package/dist/es2019/styles/shared/text-color.js +1 -1
  116. package/dist/es2019/styles/shared/whitespace.js +1 -1
  117. package/dist/es2019/types/collab.js +1 -0
  118. package/dist/es2019/ui/BaseTheme/index.js +16 -5
  119. package/dist/es2019/ui/Caption/index.js +11 -5
  120. package/dist/es2019/ui/Expand/index.js +97 -67
  121. package/dist/es2019/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +1 -1
  122. package/dist/es2019/ui/MediaSingle/index.js +15 -9
  123. package/dist/es2019/ui/MediaSingle/link.js +3 -4
  124. package/dist/es2019/ui/MediaSingle/styled.js +13 -12
  125. package/dist/es2019/ui/Mention/index.js +1 -3
  126. package/dist/es2019/ui/Mention/mention-with-profilecard.js +33 -146
  127. package/dist/es2019/ui/Mention/mention-with-providers.js +1 -5
  128. package/dist/es2019/ui/Messages/index.js +30 -22
  129. package/dist/es2019/ui/Popup/index.js +16 -1
  130. package/dist/es2019/ui/UnsupportedBlock/index.js +9 -6
  131. package/dist/es2019/ui/UnsupportedInline/index.js +8 -5
  132. package/dist/es2019/ui/WidthProvider/index.js +10 -8
  133. package/dist/es2019/ui/clear-next-sibling-margin-top.js +2 -2
  134. package/dist/es2019/ui/index.js +4 -6
  135. package/dist/es2019/utils/compare-props.js +99 -0
  136. package/dist/es2019/utils/index.js +3 -1
  137. package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +36 -0
  138. package/dist/es2019/utils/validator.js +1 -1
  139. package/dist/es2019/version.json +1 -1
  140. package/dist/esm/i18n/cs.js +3 -3
  141. package/dist/esm/i18n/da.js +3 -3
  142. package/dist/esm/i18n/de.js +3 -3
  143. package/dist/esm/i18n/en_ZZ.js +19 -0
  144. package/dist/esm/i18n/es.js +3 -3
  145. package/dist/esm/i18n/fi.js +3 -3
  146. package/dist/esm/i18n/fr.js +3 -3
  147. package/dist/esm/i18n/hu.js +3 -3
  148. package/dist/esm/i18n/it.js +3 -3
  149. package/dist/esm/i18n/ja.js +3 -3
  150. package/dist/esm/i18n/ko.js +3 -3
  151. package/dist/esm/i18n/nb.js +3 -3
  152. package/dist/esm/i18n/nl.js +3 -3
  153. package/dist/esm/i18n/pl.js +3 -3
  154. package/dist/esm/i18n/pt_BR.js +3 -3
  155. package/dist/esm/i18n/ru.js +3 -3
  156. package/dist/esm/i18n/sv.js +3 -3
  157. package/dist/esm/i18n/th.js +3 -3
  158. package/dist/esm/i18n/tr.js +3 -3
  159. package/dist/esm/i18n/uk.js +3 -3
  160. package/dist/esm/i18n/vi.js +3 -3
  161. package/dist/esm/i18n/zh.js +3 -2
  162. package/dist/esm/i18n/zh_TW.js +3 -3
  163. package/dist/esm/index.js +2 -7
  164. package/dist/esm/normalize-feature-flags.js +39 -4
  165. package/dist/esm/{ui/IntlLegacyFallbackProvider → safe-plugin}/index.js +13 -31
  166. package/dist/esm/styles/index.js +0 -1
  167. package/dist/esm/styles/shared/annotation.js +21 -17
  168. package/dist/esm/styles/shared/block-marks.js +2 -2
  169. package/dist/esm/styles/shared/blockquote.js +1 -1
  170. package/dist/esm/styles/shared/code-mark.js +9 -6
  171. package/dist/esm/styles/shared/column-layout.js +1 -1
  172. package/dist/esm/styles/shared/date.js +1 -1
  173. package/dist/esm/styles/shared/headings.js +4 -2
  174. package/dist/esm/styles/shared/indentation.js +1 -1
  175. package/dist/esm/styles/shared/link.js +1 -1
  176. package/dist/esm/styles/shared/lists.js +3 -2
  177. package/dist/esm/styles/shared/media-single.js +1 -1
  178. package/dist/esm/styles/shared/panel.js +6 -4
  179. package/dist/esm/styles/shared/paragraph.js +1 -1
  180. package/dist/esm/styles/shared/rule.js +4 -2
  181. package/dist/esm/styles/shared/shadow.js +1 -1
  182. package/dist/esm/styles/shared/table.js +37 -33
  183. package/dist/esm/styles/shared/task-decision.js +1 -1
  184. package/dist/esm/styles/shared/text-color.js +1 -1
  185. package/dist/esm/styles/shared/whitespace.js +1 -1
  186. package/dist/esm/types/collab.js +1 -0
  187. package/dist/esm/ui/BaseTheme/index.js +23 -12
  188. package/dist/esm/ui/Caption/index.js +10 -5
  189. package/dist/esm/ui/Expand/index.js +79 -42
  190. package/dist/esm/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.js +7 -7
  191. package/dist/esm/ui/MediaSingle/index.js +16 -9
  192. package/dist/esm/ui/MediaSingle/link.js +2 -3
  193. package/dist/esm/ui/MediaSingle/styled.js +17 -10
  194. package/dist/esm/ui/Mention/index.js +1 -3
  195. package/dist/esm/ui/Mention/mention-with-profilecard.js +33 -189
  196. package/dist/esm/ui/Mention/mention-with-providers.js +1 -5
  197. package/dist/esm/ui/Messages/index.js +26 -20
  198. package/dist/esm/ui/Popup/index.js +16 -1
  199. package/dist/esm/ui/UnsupportedBlock/index.js +9 -5
  200. package/dist/esm/ui/UnsupportedInline/index.js +8 -5
  201. package/dist/esm/ui/WidthProvider/index.js +7 -6
  202. package/dist/esm/ui/clear-next-sibling-margin-top.js +2 -2
  203. package/dist/esm/ui/index.js +4 -6
  204. package/dist/esm/utils/compare-props.js +115 -0
  205. package/dist/esm/utils/index.js +3 -1
  206. package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +37 -0
  207. package/dist/esm/utils/validator.js +1 -1
  208. package/dist/esm/version.json +1 -1
  209. package/dist/types/__tests_external__/page-objects/Editor.d.ts +0 -1
  210. package/dist/types/__tests_external__/page-objects/EditorMedia.d.ts +0 -1
  211. package/dist/types/__tests_external__/page-objects/EditorSmartLink.d.ts +0 -1
  212. package/dist/types/__tests_external__/page-objects/Renderer.d.ts +0 -1
  213. package/dist/types/collab/types.d.ts +14 -2
  214. package/dist/types/collab.d.ts +1 -1
  215. package/dist/types/extensions/types/field-definitions.d.ts +1 -1
  216. package/dist/types/i18n/cs.d.ts +2 -2
  217. package/dist/types/i18n/da.d.ts +2 -2
  218. package/dist/types/i18n/de.d.ts +2 -2
  219. package/dist/types/i18n/en_ZZ.d.ts +19 -0
  220. package/dist/types/i18n/es.d.ts +2 -2
  221. package/dist/types/i18n/fi.d.ts +2 -2
  222. package/dist/types/i18n/fr.d.ts +2 -2
  223. package/dist/types/i18n/hu.d.ts +2 -2
  224. package/dist/types/i18n/it.d.ts +2 -2
  225. package/dist/types/i18n/ja.d.ts +2 -2
  226. package/dist/types/i18n/ko.d.ts +2 -2
  227. package/dist/types/i18n/nb.d.ts +2 -2
  228. package/dist/types/i18n/nl.d.ts +2 -2
  229. package/dist/types/i18n/pl.d.ts +2 -2
  230. package/dist/types/i18n/pt_BR.d.ts +2 -2
  231. package/dist/types/i18n/ru.d.ts +2 -2
  232. package/dist/types/i18n/sv.d.ts +2 -2
  233. package/dist/types/i18n/th.d.ts +2 -2
  234. package/dist/types/i18n/tr.d.ts +2 -2
  235. package/dist/types/i18n/uk.d.ts +2 -2
  236. package/dist/types/i18n/vi.d.ts +2 -2
  237. package/dist/types/i18n/zh.d.ts +2 -2
  238. package/dist/types/i18n/zh_TW.d.ts +2 -2
  239. package/dist/types/index.d.ts +1 -14
  240. package/dist/types/normalize-feature-flags.d.ts +6 -3
  241. package/dist/types/safe-plugin/index.d.ts +6 -0
  242. package/dist/types/styles/index.d.ts +0 -1
  243. package/dist/types/styles/shared/annotation.d.ts +5 -4
  244. package/dist/types/styles/shared/block-marks.d.ts +1 -1
  245. package/dist/types/styles/shared/blockquote.d.ts +1 -1
  246. package/dist/types/styles/shared/code-mark.d.ts +2 -1
  247. package/dist/types/styles/shared/column-layout.d.ts +1 -1
  248. package/dist/types/styles/shared/date.d.ts +1 -1
  249. package/dist/types/styles/shared/headings.d.ts +2 -1
  250. package/dist/types/styles/shared/indentation.d.ts +1 -1
  251. package/dist/types/styles/shared/link.d.ts +1 -1
  252. package/dist/types/styles/shared/lists.d.ts +1 -1
  253. package/dist/types/styles/shared/media-single.d.ts +1 -1
  254. package/dist/types/styles/shared/panel.d.ts +1 -1
  255. package/dist/types/styles/shared/paragraph.d.ts +1 -1
  256. package/dist/types/styles/shared/rule.d.ts +2 -1
  257. package/dist/types/styles/shared/shadow.d.ts +1 -1
  258. package/dist/types/styles/shared/table.d.ts +2 -1
  259. package/dist/types/styles/shared/task-decision.d.ts +1 -1
  260. package/dist/types/styles/shared/text-color.d.ts +1 -1
  261. package/dist/types/styles/shared/whitespace.d.ts +1 -1
  262. package/dist/types/types/collab.d.ts +8 -0
  263. package/dist/types/types/index.d.ts +1 -0
  264. package/dist/types/ui/Caption/index.d.ts +3 -1
  265. package/dist/types/ui/Expand/index.d.ts +12 -10
  266. package/dist/types/ui/{IntlNextErrorBoundary → IntlErrorBoundary}/index.d.ts +1 -1
  267. package/dist/types/ui/MediaSingle/index.d.ts +4 -1
  268. package/dist/types/ui/MediaSingle/link.d.ts +1 -2
  269. package/dist/types/ui/MediaSingle/styled.d.ts +10 -5
  270. package/dist/types/ui/Mention/index.d.ts +0 -3
  271. package/dist/types/ui/Mention/mention-with-profilecard.d.ts +2 -25
  272. package/dist/types/ui/Mention/mention-with-providers.d.ts +0 -3
  273. package/dist/types/ui/Messages/index.d.ts +5 -3
  274. package/dist/types/ui/Popup/index.d.ts +3 -0
  275. package/dist/types/ui/UnsupportedBlock/index.d.ts +1 -0
  276. package/dist/types/ui/UnsupportedInline/index.d.ts +1 -0
  277. package/dist/types/ui/WidthProvider/index.d.ts +3 -1
  278. package/dist/types/ui/clear-next-sibling-margin-top.d.ts +1 -2
  279. package/dist/types/ui/index.d.ts +5 -7
  280. package/dist/types/utils/compare-props.d.ts +32 -0
  281. package/dist/types/utils/getModeFromTheme.d.ts +1 -1
  282. package/dist/types/utils/index.d.ts +4 -0
  283. package/dist/types/utils/performance/hooks/use-component-render-tracking/index.d.ts +19 -0
  284. package/package.json +20 -19
  285. package/safe-plugin/package.json +7 -0
  286. package/dist/cjs/styles/shared/inline-nodes.js +0 -17
  287. package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +0 -67
  288. package/dist/es2019/styles/shared/inline-nodes.js +0 -7
  289. package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +0 -21
  290. package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +0 -24
  291. package/dist/esm/styles/shared/inline-nodes.js +0 -7
  292. package/dist/esm/ui/LegacyToNextIntlProvider/index.js +0 -51
  293. package/dist/types/styles/shared/inline-nodes.d.ts +0 -2
  294. package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +0 -8
  295. package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +0 -8
@@ -1,4 +1,4 @@
1
- import { css } from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
  import { tableCellContentDomSelector, tableCellSelector, tableHeaderSelector, tablePrefixSelector } from '@atlaskit/adf-schema';
3
3
  import { akEditorBreakoutPadding, akEditorFullWidthLayoutWidth, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, akEditorTableToolbar, akEditorTableToolbarDark, akEditorWideLayoutWidth, getTableCellBackgroundDarkModeColors, overflowShadow } from '@atlaskit/editor-shared-styles';
4
4
  import { DN20 } from '@atlaskit/theme/colors';
@@ -26,7 +26,8 @@ export const TableSharedCssClassName = {
26
26
  TABLE_CELL_WRAPPER: tableCellSelector,
27
27
  TABLE_HEADER_CELL_WRAPPER: tableHeaderSelector
28
28
  };
29
- const tableSharedStyle = css`
29
+
30
+ const tableSharedStyle = props => css`
30
31
  .${TableSharedCssClassName.TABLE_CONTAINER} {
31
32
  position: relative;
32
33
  margin: 0 auto ${tableMarginBottom}px;
@@ -43,17 +44,25 @@ const tableSharedStyle = css`
43
44
  padding-left: ${akEditorTableNumberColumnWidth - 1}px;
44
45
  clear: both;
45
46
  }
47
+ .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table {
48
+ margin: ${tableMarginTop}px 0 0 0;
49
+ }
50
+
51
+ .${TableSharedCssClassName.TABLE_CONTAINER} > table,
52
+ .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
53
+ margin: ${tableMarginTop}px ${tableMarginSides}px 0 0;
54
+ }
55
+
46
56
  /* avoid applying styles to nested tables (possible via extensions) */
47
57
  .${TableSharedCssClassName.TABLE_CONTAINER} > table,
48
58
  .${TableSharedCssClassName.TABLE_NODE_WRAPPER} > table,
49
59
  .${TableSharedCssClassName.TABLE_STICKY_WRAPPER} > table {
50
60
  border-collapse: collapse;
51
- margin: ${tableMarginTop}px ${tableMarginSides}px 0 0;
52
61
  border: ${tableCellBorderWidth}px solid
53
62
  ${themed({
54
63
  light: akEditorTableBorder,
55
64
  dark: akEditorTableBorderDark
56
- })};
65
+ })(props)};
57
66
  table-layout: fixed;
58
67
  font-size: 1em;
59
68
  width: 100%;
@@ -85,7 +94,7 @@ const tableSharedStyle = css`
85
94
  ${themed({
86
95
  light: akEditorTableBorder,
87
96
  dark: akEditorTableBorderDark
88
- })};
97
+ })(props)};
89
98
  border-right-width: 0;
90
99
  border-bottom-width: 0;
91
100
  padding: ${tableCellPadding}px;
@@ -94,7 +103,7 @@ const tableSharedStyle = css`
94
103
 
95
104
  ${themed({
96
105
  dark: getTableCellBackgroundDarkModeColors
97
- })};
106
+ })(props)};
98
107
 
99
108
  > *:first-child {
100
109
  margin-top: 0;
@@ -117,7 +126,7 @@ const tableSharedStyle = css`
117
126
  background-color: ${themed({
118
127
  light: akEditorTableToolbar,
119
128
  dark: akEditorTableToolbarDark
120
- })};
129
+ })(props)};
121
130
  text-align: left;
122
131
 
123
132
  /* only apply this styling to codeblocks in default background headercells */
@@ -128,7 +137,7 @@ const tableSharedStyle = css`
128
137
  background: themed({
129
138
  light: 'rgb(235, 237, 240)',
130
139
  dark: 'rgb(36, 47, 66)'
131
- }),
140
+ })(props),
132
141
  width: `${gridSize()}px`
133
142
  })};
134
143
  background-attachment: local, scroll, scroll;
@@ -136,13 +145,13 @@ const tableSharedStyle = css`
136
145
  background-color: ${themed({
137
146
  light: 'rgb(235, 237, 240)',
138
147
  dark: 'rgb(36, 47, 66)'
139
- })};
148
+ })(props)};
140
149
 
141
150
  .line-number-gutter {
142
151
  background-color: ${themed({
143
152
  light: 'rgb(226, 229, 233)',
144
153
  dark: DN20
145
- })};
154
+ })(props)};
146
155
  }
147
156
 
148
157
  /* this is only relevant to the element taken care of by renderer */
@@ -151,20 +160,20 @@ const tableSharedStyle = css`
151
160
  background: themed({
152
161
  light: 'rgb(235, 237, 240)',
153
162
  dark: 'rgb(36, 47, 66)'
154
- }),
163
+ })(props),
155
164
  width: `${gridSize()}px`
156
165
  })}!important;
157
166
 
158
167
  background-color: ${themed({
159
168
  light: 'rgb(235, 237, 240)',
160
169
  dark: 'rgb(36, 47, 66)'
161
- })}!important;
170
+ })(props)}!important;
162
171
 
163
172
  // selector lives inside @atlaskit/code
164
173
  --ds--code--line-number-bg-color: ${themed({
165
174
  light: 'rgb(226, 229, 233)',
166
175
  dark: DN20
167
- })};
176
+ })(props)};
168
177
  }
169
178
  }
170
179
  }
@@ -172,6 +181,7 @@ const tableSharedStyle = css`
172
181
  }
173
182
  }
174
183
  `;
184
+
175
185
  export const calcTableWidth = (layout, containerWidth, addControllerPadding = true) => {
176
186
  switch (layout) {
177
187
  case 'full-width':
@@ -1,4 +1,4 @@
1
- import { css } from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
  import { akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
3
3
  export const TaskDecisionSharedCssClassName = {
4
4
  DECISION_CONTAINER: 'decisionItemView-content-wrap'
@@ -1,4 +1,4 @@
1
- import { css } from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
  export const textColorStyles = css`
3
3
  .fabric-text-color-mark {
4
4
  color: var(--custom-text-color, inherit);
@@ -1,4 +1,4 @@
1
- import { css } from 'styled-components';
1
+ import { css } from '@emotion/react';
2
2
  const whitespaceSharedStyles = css`
3
3
  word-wrap: break-word;
4
4
  white-space: pre-wrap;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,9 @@
1
1
  import React, { useMemo } from 'react';
2
- import { ThemeProvider } from 'styled-components';
2
+ import { ThemeProvider } from '@emotion/react';
3
+ import { ThemeProvider as DeprecatedThemeProvider } from 'styled-components';
3
4
  import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
4
- import { fontSize } from '@atlaskit/theme/constants';
5
+ import { useGlobalTheme } from '@atlaskit/theme/components';
6
+ import { CHANNEL, fontSize } from '@atlaskit/theme/constants';
5
7
  import { WidthConsumer } from '../WidthProvider';
6
8
 
7
9
  function mapBreakpointToFontSize(breakpoint) {
@@ -35,13 +37,22 @@ export function BaseThemeWrapper({
35
37
  baseFontSize,
36
38
  children
37
39
  }) {
40
+ const {
41
+ mode
42
+ } = useGlobalTheme();
38
43
  const memoizedTheme = useMemo(() => ({
39
44
  baseFontSize: dynamicTextSizing ? mapBreakpointToFontSize(breakpoint) : baseFontSize || mapBreakpointToFontSize('S'),
40
- layoutMaxWidth: dynamicTextSizing ? mapBreakpointToLayoutMaxWidth(breakpoint) : akEditorDefaultLayoutWidth
41
- }), [breakpoint, dynamicTextSizing, baseFontSize]);
45
+ layoutMaxWidth: dynamicTextSizing ? mapBreakpointToLayoutMaxWidth(breakpoint) : akEditorDefaultLayoutWidth,
46
+ // Below is used for editor dark mode.
47
+ [CHANNEL]: {
48
+ mode
49
+ }
50
+ }), [breakpoint, dynamicTextSizing, baseFontSize, mode]);
42
51
  return /*#__PURE__*/React.createElement(ThemeProvider, {
43
52
  theme: memoizedTheme
44
- }, children);
53
+ }, /*#__PURE__*/React.createElement(DeprecatedThemeProvider, {
54
+ theme: memoizedTheme
55
+ }, children));
45
56
  }
46
57
  export function BaseTheme({
47
58
  children,
@@ -1,16 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
2
4
  import React from 'react';
5
+ import { css, jsx } from '@emotion/react';
3
6
  import { injectIntl } from 'react-intl-next';
4
- import styled from 'styled-components';
5
7
  import { N200, N400 } from '@atlaskit/theme/colors';
6
8
  import { messages } from './messages';
7
- const CaptionWrapper = styled.div`
9
+ const captionWrapperStyle = css`
8
10
  margin-top: 8px;
9
11
  text-align: center;
10
12
  position: relative;
11
13
  color: ${N400};
12
14
  `;
13
- const Placeholder = styled.p`
15
+ const placeholderStyle = css`
14
16
  color: ${N200};
15
17
  position: absolute;
16
18
  top: 0;
@@ -28,10 +30,14 @@ export class CaptionComponent extends React.Component {
28
30
  }
29
31
  } = this.props;
30
32
  const showPlaceholder = !selected && !hasContent;
31
- return /*#__PURE__*/React.createElement(CaptionWrapper, _extends({
33
+ return jsx("div", _extends({
32
34
  "data-media-caption": true,
33
35
  "data-testid": "media-caption"
34
- }, dataAttributes), showPlaceholder ? /*#__PURE__*/React.createElement(Placeholder, null, formatMessage(messages.placeholder)) : null, children);
36
+ }, dataAttributes, {
37
+ css: captionWrapperStyle
38
+ }), showPlaceholder ? jsx("p", {
39
+ css: placeholderStyle
40
+ }, formatMessage(messages.placeholder)) : null, children);
35
41
  }
36
42
 
37
43
  }
@@ -1,5 +1,9 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
4
+ import React, { forwardRef } from 'react';
5
+ import { css, jsx } from '@emotion/react';
1
6
  import { defineMessages } from 'react-intl-next';
2
- import styled, { css } from 'styled-components';
3
7
  import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
4
8
  import * as colors from '@atlaskit/theme/colors';
5
9
  import { themed } from '@atlaskit/theme/components';
@@ -38,13 +42,22 @@ const EXPAND_EXPANDED_BORDER_COLOR = themed({
38
42
  light: colors.N40A,
39
43
  dark: colors.DN50
40
44
  });
41
- export const ExpandIconWrapper = styled.div`
45
+ export const ExpandIconWrapper = ({
46
+ children,
47
+ expanded
48
+ }) => {
49
+ return jsx("div", {
50
+ css: props => expanded ? [expandIconWrapperStyle(props), expandIconWrapperExpandedStyle] : expandIconWrapperStyle(props)
51
+ }, children);
52
+ };
53
+
54
+ const expandIconWrapperStyle = props => css`
42
55
  cursor: pointer;
43
56
  display: flex;
44
57
  color: ${themed({
45
58
  light: colors.N90,
46
59
  dark: '#d9dde3'
47
- })};
60
+ })(props)};
48
61
  border-radius: ${gridSize() / 2}px;
49
62
  width: 24px;
50
63
  height: 24px;
@@ -54,69 +67,85 @@ export const ExpandIconWrapper = styled.div`
54
67
  }
55
68
 
56
69
  svg {
57
- ${props => props.expanded ? 'transform: rotate(90deg);' : ''}
58
70
  transition: transform 0.2s ${akEditorSwoopCubicBezier};
59
71
  }
60
72
  `;
61
- export const ExpandLayoutWrapper = styled.div`
73
+
74
+ const expandIconWrapperExpandedStyle = css`
75
+ svg {
76
+ transform: rotate(90deg);
77
+ }
78
+ `;
79
+ export const expandLayoutWrapperStyle = css`
62
80
  width: ${gridSize() * 3}px;
63
81
  height: ${gridSize() * 3}px;
64
82
  `;
65
- const ContainerStyles = css`
66
- border-width: 1px;
67
- border-style: solid;
68
- border-color: ${({
69
- expanded,
70
- focused
71
- }) => {
72
- const expandedBorderColor = expanded ? EXPAND_EXPANDED_BORDER_COLOR : EXPAND_COLLAPSED_BORDER_COLOR;
73
- return focused ? EXPAND_FOCUSED_BORDER_COLOR : expandedBorderColor;
74
- }};
75
- border-radius: ${BORDER_RADIUS}px;
76
- min-height: 25px;
77
- background: ${({
78
- expanded
79
- }) => !expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND};
80
- margin: ${props => `${gridSize() / 2 / fontSize()}rem ${// Only only these margins if the expand isn't editable
81
- // and is the root level expand.
82
- props['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : `0`} 0`};
83
+ export const ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef((props, ref) => {
84
+ const {
85
+ children,
86
+ ...rest
87
+ } = props;
88
+ return jsx("div", _extends({
89
+ css: expandLayoutWrapperStyle
90
+ }, rest, {
91
+ ref: ref
92
+ }), children);
93
+ });
83
94
 
84
- transition: background 0.3s ${akEditorSwoopCubicBezier},
85
- border-color 0.3s ${akEditorSwoopCubicBezier};
86
- padding: ${gridSize}px;
95
+ const containerStyles = styleProps => {
96
+ const {
97
+ expanded,
98
+ focused
99
+ } = styleProps;
100
+ const marginTop = `${gridSize() / 2 / fontSize()}rem`;
101
+ const marginBottom = 0; // Only only these margins if the expand isn't editable
102
+ // and is the root level expand.
87
103
 
88
- &:hover {
89
- border: 1px solid ${themed({
90
- light: colors.N50A,
91
- dark: colors.DN50
92
- })};
93
- background: ${EXPAND_SELECTED_BACKGROUND};
94
- }
104
+ const marginHorizontal = styleProps['data-node-type'] === 'expand' ? `-${akLayoutGutterOffset}px` : 0;
105
+ const margin = `${marginTop} ${marginHorizontal} ${marginBottom}`;
106
+ return themeProps => css`
107
+ border-width: 1px;
108
+ border-style: solid;
109
+ border-color: ${focused ? EXPAND_FOCUSED_BORDER_COLOR : expanded ? EXPAND_EXPANDED_BORDER_COLOR(themeProps) : EXPAND_COLLAPSED_BORDER_COLOR};
110
+ border-radius: ${BORDER_RADIUS}px;
111
+ min-height: 25px;
112
+ background: ${!expanded ? EXPAND_COLLAPSED_BACKGROUND : EXPAND_SELECTED_BACKGROUND(themeProps)};
113
+ margin: ${margin};
114
+
115
+ transition: background 0.3s ${akEditorSwoopCubicBezier},
116
+ border-color 0.3s ${akEditorSwoopCubicBezier};
117
+ padding: ${gridSize()}px;
118
+
119
+ &:hover {
120
+ border: 1px solid
121
+ ${themed({
122
+ light: colors.N50A,
123
+ dark: colors.DN50
124
+ })(themeProps)};
125
+ background: ${EXPAND_SELECTED_BACKGROUND(themeProps)};
126
+ }
95
127
 
96
- td > &:first-child {
97
- margin-top: 0;
128
+ td > &:first-child {
129
+ margin-top: 0;
130
+ }
131
+ `;
132
+ };
133
+
134
+ const contentStyles = styleProps => themeProps => css`
135
+ padding-top: ${styleProps.expanded ? gridSize() : 0}px;
136
+ padding-right: ${gridSize()}px;
137
+ padding-left: ${gridSize() * 4 - gridSize() / 2}px;
138
+ display: flow-root;
139
+
140
+ // The follow rules inside @supports block are added as a part of ED-8893
141
+ // The fix is targeting mobile bridge on iOS 12 or below,
142
+ // We should consider remove this fix when we no longer support iOS 12
143
+ @supports not (display: flow-root) {
144
+ width: 100%;
145
+ box-sizing: border-box;
98
146
  }
99
- `;
100
- const ContentStyles = css`
101
- ${({
102
- expanded
103
- }) => {
104
- return css`
105
- padding-top: ${expanded ? gridSize() : 0}px;
106
- padding-right: ${gridSize()}px;
107
- padding-left: ${gridSize() * 4 - gridSize() / 2}px;
108
- display: table;
109
- display: flow-root;
110
-
111
- // The follow rules inside @supports block are added as a part of ED-8893
112
- // The fix is targeting mobile bridge on iOS 12 or below,
113
- // We should consider remove this fix when we no longer support iOS 12
114
- @supports not (display: flow-root) {
115
- width: 100%;
116
- box-sizing: border-box;
117
- }
118
-
119
- ${!expanded ? `
147
+
148
+ ${!styleProps.expanded ? `
120
149
  .expand-content-wrapper, .nestedExpand-content-wrapper {
121
150
  /* We visually hide the content here to preserve the content during copy+paste */
122
151
  width: 100%;
@@ -128,10 +157,9 @@ const ContentStyles = css`
128
157
  user-select: none;
129
158
  }
130
159
  ` : ''}
131
- `;
132
- }};
133
160
  `;
134
- const TitleInputStyles = css`
161
+
162
+ const titleInputStyles = props => css`
135
163
  outline: none;
136
164
  border: none;
137
165
  font-size: ${relativeFontSizeToBase16(fontSize())};
@@ -140,7 +168,7 @@ const TitleInputStyles = css`
140
168
  color: ${themed({
141
169
  light: colors.N200A,
142
170
  dark: colors.DN600
143
- })};
171
+ })(props)};
144
172
  background: transparent;
145
173
  display: flex;
146
174
  flex: 1;
@@ -152,10 +180,11 @@ const TitleInputStyles = css`
152
180
  color: ${themed({
153
181
  light: colors.N200A,
154
182
  dark: colors.DN600
155
- })};
183
+ })(props)};
156
184
  }
157
185
  `;
158
- const TitleContainerStyles = css`
186
+
187
+ const titleContainerStyles = props => css`
159
188
  padding: 0;
160
189
  display: flex;
161
190
  align-items: flex-start;
@@ -166,7 +195,7 @@ const TitleContainerStyles = css`
166
195
  color: ${themed({
167
196
  light: colors.N300A,
168
197
  dark: colors.DN600
169
- })};
198
+ })(props)};
170
199
  overflow: hidden;
171
200
  cursor: pointer;
172
201
  // Prevent browser selection being inside the title container
@@ -176,9 +205,10 @@ const TitleContainerStyles = css`
176
205
  outline: 0;
177
206
  }
178
207
  `;
208
+
179
209
  export const sharedExpandStyles = {
180
- TitleInputStyles,
181
- TitleContainerStyles,
182
- ContainerStyles,
183
- ContentStyles
210
+ titleInputStyles,
211
+ titleContainerStyles,
212
+ containerStyles,
213
+ contentStyles
184
214
  };
@@ -9,7 +9,7 @@ const isMissingIntlProviderInAncestryError = err => {
9
9
  return err === null || err === void 0 ? void 0 : (_err$toString = err.toString()) === null || _err$toString === void 0 ? void 0 : _err$toString.includes('<IntlProvider> needs to exist in the component ancestry');
10
10
  };
11
11
 
12
- export class IntlNextErrorBoundary extends React.Component {
12
+ export class IntlErrorBoundary extends React.Component {
13
13
  constructor(...args) {
14
14
  super(...args);
15
15
 
@@ -1,8 +1,10 @@
1
+ /** @jsx jsx */
1
2
  import React from 'react';
3
+ import { jsx } from '@emotion/react';
2
4
  import classnames from 'classnames';
3
5
  import { akEditorMediaResizeHandlerPaddingWide, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
4
6
  import { calcPxFromPct } from './grid';
5
- import { MediaSingleWrapper, MediaWrapper } from './styled';
7
+ import { MediaSingleDimensionHelper, MediaWrapper } from './styled';
6
8
  export const DEFAULT_IMAGE_WIDTH = 250;
7
9
  export const DEFAULT_IMAGE_HEIGHT = 200;
8
10
  export const wrappedLayouts = ['wrap-left', 'wrap-right', 'align-end', 'align-start'];
@@ -21,7 +23,8 @@ export default function MediaSingle({
21
23
  nodeType = 'mediaSingle',
22
24
  fullWidthMode,
23
25
  lineLength,
24
- hasFallbackContainer = true
26
+ hasFallbackContainer = true,
27
+ handleMediaSingleRef
25
28
  }) {
26
29
  const children = React.Children.toArray(propsChildren);
27
30
 
@@ -73,12 +76,15 @@ export default function MediaSingle({
73
76
  }
74
77
 
75
78
  const [media, caption] = children;
76
- return /*#__PURE__*/React.createElement(MediaSingleWrapper, {
77
- width: width,
78
- layout: layout,
79
- containerWidth: containerWidth,
80
- pctWidth: pctWidth,
81
- fullWidthMode: fullWidthMode,
79
+ return jsx("div", {
80
+ ref: handleMediaSingleRef,
81
+ css: MediaSingleDimensionHelper({
82
+ width,
83
+ layout,
84
+ containerWidth,
85
+ pctWidth,
86
+ fullWidthMode
87
+ }),
82
88
  "data-layout": layout,
83
89
  "data-width": pctWidth,
84
90
  "data-node-type": nodeType,
@@ -86,7 +92,7 @@ export default function MediaSingle({
86
92
  'is-loading': isLoading,
87
93
  'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
88
94
  })
89
- }, /*#__PURE__*/React.createElement(MediaWrapper, {
95
+ }, jsx(MediaWrapper, {
90
96
  hasFallbackContainer: hasFallbackContainer,
91
97
  height: mediaWrapperHeight,
92
98
  paddingBottom: paddingBottom
@@ -1,5 +1,5 @@
1
- import styled from 'styled-components';
2
- export const MediaLink = styled.a`
1
+ import { css } from '@emotion/react';
2
+ export const mediaLinkStyle = css`
3
3
  position: absolute;
4
4
  background: transparent;
5
5
  top: 0;
@@ -9,5 +9,4 @@ export const MediaLink = styled.a`
9
9
  cursor: pointer;
10
10
  width: 100%;
11
11
  height: 100%;
12
- `;
13
- MediaLink.displayName = 'MediaLink';
12
+ `;
@@ -1,4 +1,6 @@
1
- import styled, { css } from 'styled-components';
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { css, jsx } from '@emotion/react';
2
4
  import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
3
5
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
4
6
 
@@ -156,24 +158,20 @@ const RenderFallbackContainer = ({
156
158
  ` : ''}
157
159
  `;
158
160
 
159
- export const MediaWrapper = styled.div`
161
+ export const mediaWrapperStyle = props => css`
160
162
  position: relative;
161
163
 
162
- ${RenderFallbackContainer}
164
+ ${RenderFallbackContainer(props)}
163
165
 
164
166
  /* Editor */
165
167
  & > figure {
166
- position: ${({
167
- hasFallbackContainer
168
- }) => hasFallbackContainer ? 'absolute' : 'relative'};
168
+ position: ${props.hasFallbackContainer ? 'absolute' : 'relative'};
169
169
  height: 100%;
170
170
  width: 100%;
171
171
  }
172
172
 
173
173
  & > div {
174
- position: ${({
175
- hasFallbackContainer
176
- }) => hasFallbackContainer ? 'absolute' : 'relative'};
174
+ position: ${props.hasFallbackContainer ? 'absolute' : 'relative'};
177
175
  height: 100%;
178
176
  width: 100%;
179
177
  }
@@ -192,7 +190,10 @@ export const MediaWrapper = styled.div`
192
190
  }
193
191
  }
194
192
  `;
195
- export const MediaSingleWrapper = styled.div`
196
- ${MediaSingleDimensionHelper};
197
- `;
193
+ export const MediaWrapper = ({
194
+ children,
195
+ ...rest
196
+ }) => jsx("div", {
197
+ css: mediaWrapperStyle(rest)
198
+ }, children);
198
199
  MediaWrapper.displayName = 'WrapperMediaSingle';
@@ -11,7 +11,6 @@ export default class Mention extends PureComponent {
11
11
  accessLevel,
12
12
  eventHandlers,
13
13
  id,
14
- portal,
15
14
  text
16
15
  } = this.props;
17
16
  const {
@@ -24,8 +23,7 @@ export default class Mention extends PureComponent {
24
23
  accessLevel: accessLevel,
25
24
  eventHandlers: eventHandlers,
26
25
  mentionProvider: mentionProvider,
27
- profilecardProvider: profilecardProvider,
28
- portal: portal
26
+ profilecardProvider: profilecardProvider
29
27
  });
30
28
  });
31
29