@atlaskit/editor-common 60.2.0 → 62.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 (244) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/card/package.json +7 -0
  3. package/dist/cjs/card/cardOptions.js +5 -0
  4. package/dist/cjs/emoji.js +23 -0
  5. package/dist/cjs/extensions/extension-fields-helpers.js +1 -1
  6. package/dist/cjs/extensions/index.js +46 -40
  7. package/dist/cjs/extensions/manifest-helpers.js +3 -1
  8. package/dist/cjs/extensions/module-helpers.js +3 -1
  9. package/dist/cjs/extensions/types/field-definitions.js +7 -1
  10. package/dist/cjs/extensions/types/index.js +14 -8
  11. package/dist/cjs/extensions.js +38 -32
  12. package/dist/cjs/i18n/cs.js +1 -0
  13. package/dist/cjs/i18n/da.js +1 -0
  14. package/dist/cjs/i18n/de.js +1 -0
  15. package/dist/cjs/i18n/es.js +1 -0
  16. package/dist/cjs/i18n/fi.js +1 -0
  17. package/dist/cjs/i18n/fr.js +1 -0
  18. package/dist/cjs/i18n/hu.js +1 -0
  19. package/dist/cjs/i18n/index.js +26 -26
  20. package/dist/cjs/i18n/it.js +1 -0
  21. package/dist/cjs/i18n/ja.js +1 -0
  22. package/dist/cjs/i18n/ko.js +1 -0
  23. package/dist/cjs/i18n/nb.js +1 -0
  24. package/dist/cjs/i18n/nl.js +1 -0
  25. package/dist/cjs/i18n/pl.js +1 -0
  26. package/dist/cjs/i18n/pt_BR.js +1 -0
  27. package/dist/cjs/i18n/ru.js +1 -0
  28. package/dist/cjs/i18n/sv.js +1 -0
  29. package/dist/cjs/i18n/th.js +1 -0
  30. package/dist/cjs/i18n/tr.js +1 -0
  31. package/dist/cjs/i18n/uk.js +1 -0
  32. package/dist/cjs/i18n/vi.js +1 -0
  33. package/dist/cjs/i18n/zh.js +1 -1
  34. package/dist/cjs/i18n/zh_TW.js +1 -0
  35. package/dist/cjs/in-product.js +14 -14
  36. package/dist/cjs/index.js +330 -300
  37. package/dist/cjs/mention.js +23 -0
  38. package/dist/cjs/messages/codeBidiWarning.js +21 -0
  39. package/dist/cjs/messages/index.js +8 -0
  40. package/dist/cjs/messages/link.js +2 -2
  41. package/dist/cjs/messages/unsupportedContent.js +2 -2
  42. package/dist/cjs/provider-factory/context.js +1 -1
  43. package/dist/cjs/provider-factory.js +6 -6
  44. package/dist/cjs/provider-helpers/promise-helpers.js +1 -1
  45. package/dist/cjs/styles/index.js +86 -80
  46. package/dist/cjs/styles/shared/annotation.js +1 -1
  47. package/dist/cjs/styles/shared/media-single.js +1 -1
  48. package/dist/cjs/styles/shared/panel.js +90 -37
  49. package/dist/cjs/styles/shared/table.js +2 -2
  50. package/dist/cjs/type-ahead/index.js +1 -1
  51. package/dist/cjs/types/annotation/emitter.js +1 -1
  52. package/dist/cjs/ufo/experience-store.js +3 -2
  53. package/dist/cjs/ufo/index.js +4 -4
  54. package/dist/cjs/ui/BaseTheme/index.js +2 -2
  55. package/dist/cjs/ui/Caption/index.js +2 -2
  56. package/dist/cjs/ui/Caption/messages.js +2 -2
  57. package/dist/cjs/ui/Expand/index.js +3 -3
  58. package/dist/cjs/ui/IntlLegacyFallbackProvider/index.js +60 -0
  59. package/dist/cjs/ui/IntlNextErrorBoundary/index.js +90 -0
  60. package/dist/cjs/ui/LegacyToNextIntlProvider/index.js +67 -0
  61. package/dist/cjs/ui/MediaSingle/grid.js +2 -2
  62. package/dist/cjs/ui/MediaSingle/index.js +2 -1
  63. package/dist/cjs/ui/MediaSingle/styled.js +1 -1
  64. package/dist/cjs/ui/Messages/index.js +1 -1
  65. package/dist/cjs/ui/Popup/index.js +1 -1
  66. package/dist/cjs/ui/Popup/utils.js +5 -5
  67. package/dist/cjs/ui/UnsupportedBlock/index.js +2 -2
  68. package/dist/cjs/ui/UnsupportedInline/index.js +2 -2
  69. package/dist/cjs/ui/WidthProvider/index.js +2 -2
  70. package/dist/cjs/ui/index.js +92 -62
  71. package/dist/cjs/utils/analytics.js +6 -5
  72. package/dist/cjs/utils/breakout.js +1 -1
  73. package/dist/cjs/utils/compareNodes.js +6 -0
  74. package/dist/cjs/utils/date.js +3 -4
  75. package/dist/cjs/utils/index.js +123 -109
  76. package/dist/cjs/utils/performance/measure-tti.js +2 -2
  77. package/dist/cjs/utils/performance/measure.js +1 -1
  78. package/dist/cjs/utils/table.js +1 -1
  79. package/dist/cjs/utils/validate-using-spec.js +1 -1
  80. package/dist/cjs/utils/validator.js +13 -16
  81. package/dist/cjs/version.json +1 -1
  82. package/dist/es2019/card/cardOptions.js +1 -0
  83. package/dist/es2019/emoji.js +2 -0
  84. package/dist/es2019/extensions/index.js +1 -1
  85. package/dist/es2019/extensions/types/field-definitions.js +3 -0
  86. package/dist/es2019/extensions/types/index.js +1 -1
  87. package/dist/es2019/extensions.js +1 -1
  88. package/dist/es2019/i18n/cs.js +1 -0
  89. package/dist/es2019/i18n/da.js +1 -0
  90. package/dist/es2019/i18n/de.js +1 -0
  91. package/dist/es2019/i18n/es.js +1 -0
  92. package/dist/es2019/i18n/fi.js +1 -0
  93. package/dist/es2019/i18n/fr.js +1 -0
  94. package/dist/es2019/i18n/hu.js +1 -0
  95. package/dist/es2019/i18n/it.js +1 -0
  96. package/dist/es2019/i18n/ja.js +1 -0
  97. package/dist/es2019/i18n/ko.js +1 -0
  98. package/dist/es2019/i18n/nb.js +1 -0
  99. package/dist/es2019/i18n/nl.js +1 -0
  100. package/dist/es2019/i18n/pl.js +1 -0
  101. package/dist/es2019/i18n/pt_BR.js +1 -0
  102. package/dist/es2019/i18n/ru.js +1 -0
  103. package/dist/es2019/i18n/sv.js +1 -0
  104. package/dist/es2019/i18n/th.js +1 -0
  105. package/dist/es2019/i18n/tr.js +1 -0
  106. package/dist/es2019/i18n/uk.js +1 -0
  107. package/dist/es2019/i18n/vi.js +1 -0
  108. package/dist/es2019/i18n/zh.js +1 -1
  109. package/dist/es2019/i18n/zh_TW.js +1 -0
  110. package/dist/es2019/index.js +26 -8
  111. package/dist/es2019/mention.js +2 -0
  112. package/dist/es2019/messages/codeBidiWarning.js +12 -0
  113. package/dist/es2019/messages/index.js +1 -0
  114. package/dist/es2019/messages/link.js +1 -1
  115. package/dist/es2019/messages/unsupportedContent.js +1 -1
  116. package/dist/es2019/styles/index.js +4 -2
  117. package/dist/es2019/styles/shared/media-single.js +10 -0
  118. package/dist/es2019/styles/shared/panel.js +97 -38
  119. package/dist/es2019/styles/shared/table.js +1 -0
  120. package/dist/es2019/ufo/experience-store.js +2 -1
  121. package/dist/es2019/ui/Caption/index.js +1 -1
  122. package/dist/es2019/ui/Caption/messages.js +1 -1
  123. package/dist/es2019/ui/Expand/index.js +1 -1
  124. package/dist/es2019/ui/IntlLegacyFallbackProvider/index.js +21 -0
  125. package/dist/es2019/ui/IntlNextErrorBoundary/index.js +43 -0
  126. package/dist/es2019/ui/LegacyToNextIntlProvider/index.js +24 -0
  127. package/dist/es2019/ui/UnsupportedBlock/index.js +1 -1
  128. package/dist/es2019/ui/UnsupportedInline/index.js +1 -1
  129. package/dist/es2019/ui/index.js +12 -4
  130. package/dist/es2019/utils/compareNodes.js +6 -0
  131. package/dist/es2019/utils/date.js +2 -3
  132. package/dist/es2019/utils/index.js +2 -1
  133. package/dist/es2019/utils/validator.js +11 -13
  134. package/dist/es2019/version.json +1 -1
  135. package/dist/esm/card/cardOptions.js +1 -0
  136. package/dist/esm/emoji.js +2 -0
  137. package/dist/esm/extensions/index.js +1 -1
  138. package/dist/esm/extensions/types/field-definitions.js +3 -0
  139. package/dist/esm/extensions/types/index.js +1 -1
  140. package/dist/esm/extensions.js +1 -1
  141. package/dist/esm/i18n/cs.js +1 -0
  142. package/dist/esm/i18n/da.js +1 -0
  143. package/dist/esm/i18n/de.js +1 -0
  144. package/dist/esm/i18n/es.js +1 -0
  145. package/dist/esm/i18n/fi.js +1 -0
  146. package/dist/esm/i18n/fr.js +1 -0
  147. package/dist/esm/i18n/hu.js +1 -0
  148. package/dist/esm/i18n/it.js +1 -0
  149. package/dist/esm/i18n/ja.js +1 -0
  150. package/dist/esm/i18n/ko.js +1 -0
  151. package/dist/esm/i18n/nb.js +1 -0
  152. package/dist/esm/i18n/nl.js +1 -0
  153. package/dist/esm/i18n/pl.js +1 -0
  154. package/dist/esm/i18n/pt_BR.js +1 -0
  155. package/dist/esm/i18n/ru.js +1 -0
  156. package/dist/esm/i18n/sv.js +1 -0
  157. package/dist/esm/i18n/th.js +1 -0
  158. package/dist/esm/i18n/tr.js +1 -0
  159. package/dist/esm/i18n/uk.js +1 -0
  160. package/dist/esm/i18n/vi.js +1 -0
  161. package/dist/esm/i18n/zh.js +1 -1
  162. package/dist/esm/i18n/zh_TW.js +1 -0
  163. package/dist/esm/index.js +26 -8
  164. package/dist/esm/mention.js +2 -0
  165. package/dist/esm/messages/codeBidiWarning.js +12 -0
  166. package/dist/esm/messages/index.js +1 -0
  167. package/dist/esm/messages/link.js +1 -1
  168. package/dist/esm/messages/unsupportedContent.js +1 -1
  169. package/dist/esm/styles/index.js +4 -2
  170. package/dist/esm/styles/shared/media-single.js +1 -1
  171. package/dist/esm/styles/shared/panel.js +84 -37
  172. package/dist/esm/styles/shared/table.js +1 -1
  173. package/dist/esm/ufo/experience-store.js +2 -1
  174. package/dist/esm/ui/Caption/index.js +1 -1
  175. package/dist/esm/ui/Caption/messages.js +1 -1
  176. package/dist/esm/ui/Expand/index.js +1 -1
  177. package/dist/esm/ui/IntlLegacyFallbackProvider/index.js +45 -0
  178. package/dist/esm/ui/IntlNextErrorBoundary/index.js +73 -0
  179. package/dist/esm/ui/LegacyToNextIntlProvider/index.js +51 -0
  180. package/dist/esm/ui/UnsupportedBlock/index.js +1 -1
  181. package/dist/esm/ui/UnsupportedInline/index.js +1 -1
  182. package/dist/esm/ui/index.js +12 -4
  183. package/dist/esm/utils/compareNodes.js +6 -0
  184. package/dist/esm/utils/date.js +2 -3
  185. package/dist/esm/utils/index.js +2 -1
  186. package/dist/esm/utils/validator.js +12 -15
  187. package/dist/esm/version.json +1 -1
  188. package/dist/types/card/cardOptions.d.ts +9 -0
  189. package/dist/types/card/index.d.ts +1 -9
  190. package/dist/types/collab.d.ts +1 -1
  191. package/dist/types/emoji.d.ts +3 -0
  192. package/dist/types/extensions/index.d.ts +1 -1
  193. package/dist/types/extensions/types/extension-handler.d.ts +7 -2
  194. package/dist/types/extensions/types/extension-parameters.d.ts +1 -0
  195. package/dist/types/extensions/types/field-definitions.d.ts +2 -0
  196. package/dist/types/extensions/types/index.d.ts +1 -1
  197. package/dist/types/extensions.d.ts +1 -1
  198. package/dist/types/i18n/cs.d.ts +1 -0
  199. package/dist/types/i18n/da.d.ts +1 -0
  200. package/dist/types/i18n/de.d.ts +1 -0
  201. package/dist/types/i18n/es.d.ts +1 -0
  202. package/dist/types/i18n/fi.d.ts +1 -0
  203. package/dist/types/i18n/fr.d.ts +1 -0
  204. package/dist/types/i18n/hu.d.ts +1 -0
  205. package/dist/types/i18n/it.d.ts +1 -0
  206. package/dist/types/i18n/ja.d.ts +1 -0
  207. package/dist/types/i18n/ko.d.ts +1 -0
  208. package/dist/types/i18n/nb.d.ts +1 -0
  209. package/dist/types/i18n/nl.d.ts +1 -0
  210. package/dist/types/i18n/pl.d.ts +1 -0
  211. package/dist/types/i18n/pt_BR.d.ts +1 -0
  212. package/dist/types/i18n/ru.d.ts +1 -0
  213. package/dist/types/i18n/sv.d.ts +1 -0
  214. package/dist/types/i18n/th.d.ts +1 -0
  215. package/dist/types/i18n/tr.d.ts +1 -0
  216. package/dist/types/i18n/uk.d.ts +1 -0
  217. package/dist/types/i18n/vi.d.ts +1 -0
  218. package/dist/types/i18n/zh.d.ts +1 -0
  219. package/dist/types/i18n/zh_TW.d.ts +1 -0
  220. package/dist/types/index.d.ts +6 -2
  221. package/dist/types/mention.d.ts +2 -0
  222. package/dist/types/messages/codeBidiWarning.d.ts +11 -0
  223. package/dist/types/messages/index.d.ts +1 -0
  224. package/dist/types/provider-factory.d.ts +1 -0
  225. package/dist/types/styles/index.d.ts +1 -1
  226. package/dist/types/styles/shared/panel.d.ts +2 -0
  227. package/dist/types/ufo/experience-store.d.ts +3 -2
  228. package/dist/types/ui/Caption/index.d.ts +4 -4
  229. package/dist/types/ui/IntlLegacyFallbackProvider/index.d.ts +8 -0
  230. package/dist/types/ui/IntlNextErrorBoundary/index.d.ts +15 -0
  231. package/dist/types/ui/LegacyToNextIntlProvider/index.d.ts +8 -0
  232. package/dist/types/ui/UnsupportedBlock/index.d.ts +3 -3
  233. package/dist/types/ui/UnsupportedInline/index.d.ts +3 -3
  234. package/dist/types/ui/index.d.ts +3 -0
  235. package/dist/types/ui/unsupported-content-helper.d.ts +2 -2
  236. package/dist/types/utils/date.d.ts +3 -3
  237. package/dist/types/utils/index.d.ts +1 -0
  238. package/emoji/package.json +7 -0
  239. package/mention/package.json +7 -0
  240. package/package.json +30 -19
  241. package/provider-helpers/package.json +7 -0
  242. package/types/package.json +7 -0
  243. package/ui/package.json +7 -0
  244. package/utils/package.json +7 -0
@@ -1,9 +1,10 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
 
3
4
  var _templateObject;
4
5
 
5
6
  import { css } from 'styled-components';
6
- import { hexToRgba, PanelType } from '@atlaskit/adf-schema';
7
+ import { PanelType } from '@atlaskit/adf-schema';
7
8
  import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
8
9
  import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
9
10
  import { emojiImage, emojiSprite } from '@atlaskit/emoji';
@@ -18,22 +19,67 @@ var lightPanelColor = {
18
19
  warning: colors.Y50,
19
20
  error: colors.R50
20
21
  };
21
- var darkPanelOpacity = 0.64;
22
- var darkPanelColor = {
23
- info: colors.B500,
24
- note: colors.P500,
25
- tip: colors.G500,
26
- success: colors.G500,
27
- warning: colors.Y500,
28
- error: colors.R500
29
- };
30
- var darkPanelBorderColor = {
31
- info: colors.B400,
32
- note: colors.P400,
33
- tip: colors.G400,
34
- success: colors.G400,
35
- warning: colors.Y400,
36
- error: colors.R400
22
+ var darkPanelColors = {
23
+ // standard panels
24
+ info: '#0C294F',
25
+ error: "#441C13",
26
+ warning: "#413001",
27
+ tip: "#052E21",
28
+ success: "#052E21",
29
+ note: "#282249",
30
+ // Reds
31
+ R900: '#601D16',
32
+ // Red Saturated
33
+ R100S: "#FFEFEB",
34
+ R300S: "#FFB5A3",
35
+ R500S: "#FF6B47",
36
+ R800S: "#C4320E",
37
+ R1200S: "#441C13",
38
+ // Yellows
39
+ Y900: '#533F04',
40
+ // Yellow Saturated
41
+ Y100S: "#FFF3D1",
42
+ Y300S: "#FFDC7A",
43
+ Y500S: "#FFC933",
44
+ Y800S: "#D8A003",
45
+ Y1200S: "#413001",
46
+ // Greens
47
+ G900: '#164B35',
48
+ // Green Saturated
49
+ G100S: "#E3FCF0",
50
+ G300S: "#95EEC5",
51
+ G400S: "#60DCA8",
52
+ G900S: "#086848",
53
+ G1200S: "#052E21",
54
+ // Blues
55
+ B900: '#09326C',
56
+ // Saturated Blues
57
+ B100S: '#E5F0FF',
58
+ B300S: '#A3C9FF',
59
+ B500S: '#4794FF',
60
+ B800S: '#0055CC',
61
+ B1200S: '#0C294F',
62
+ // Purples
63
+ P900: "#352C63",
64
+ // Purple Saturated
65
+ P100S: "#EEEBFF",
66
+ P300S: "#CCC3FE",
67
+ P500S: "#A292F7",
68
+ P800S: "#5E49CA",
69
+ P1200S: "#282249",
70
+ // Teals
71
+ T900: '#1D474C',
72
+ // Teal Saturated
73
+ T100S: "#DBFAFF",
74
+ T300S: "#78EBFC",
75
+ T400S: "#3AD6EE",
76
+ T900S: "#056270",
77
+ T1200S: "#0B3037",
78
+ // Dark Mode Alpha
79
+ DNA20A: 'rgba(150, 176, 210, 0.53)',
80
+ DNA40A: 'rgba(134, 156, 180, 0.29)',
81
+ DNA80A: '#161A1D',
82
+ TextColor: '#D9DDE3'
37
83
  };
38
84
  var lightIconColor = {
39
85
  info: colors.B400,
@@ -50,16 +96,21 @@ var darkIconColor = {
50
96
  success: colors.G200,
51
97
  warning: colors.Y100,
52
98
  error: colors.R200
53
- };
54
- var darkTextColor = {
55
- info: colors.B75,
56
- note: colors.P75,
57
- tip: colors.G75,
58
- success: colors.G75,
59
- warning: colors.Y75,
60
- error: colors.R75
61
- };
62
- var verticalAlignment = -((gridSize() * 3 - akEditorCustomIconSize) / 2);
99
+ }; // New custom icons are a little smaller than predefined icons.
100
+ // To fix alignment issues with custom icons, vertical alignment is updated.
101
+
102
+ var panelEmojiSpriteVerticalAlignment = -(gridSize() * 3 - akEditorCustomIconSize) / 2;
103
+ var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
104
+ export var getPanelBackgroundDarkModeColors = [[colors.B50, darkPanelColors.B1200S], [colors.B75, darkPanelColors.B900], [colors.B100, darkPanelColors.B800S], [colors.N0, darkPanelColors.DNA80A], [colors.N20, darkPanelColors.DNA40A], [colors.N60, darkPanelColors.DNA20A], [colors.T50, darkPanelColors.T1200S], [colors.T75, darkPanelColors.T900], [colors.T100, darkPanelColors.T900S], [colors.G50, darkPanelColors.G1200S], [colors.G75, darkPanelColors.G900], [colors.G200, darkPanelColors.G900S], [colors.Y50, darkPanelColors.Y1200S], [colors.Y75, darkPanelColors.Y900], [colors.Y200, darkPanelColors.Y800S], [colors.R50, darkPanelColors.R1200S], [colors.R75, darkPanelColors.R900], [colors.R100, darkPanelColors.R800S], [colors.P50, darkPanelColors.P1200S], [colors.P75, darkPanelColors.P900], [colors.P100, darkPanelColors.P800S]].map(function (_ref) {
105
+ var _ref2 = _slicedToArray(_ref, 2),
106
+ colorName = _ref2[0],
107
+ colorValue = _ref2[1];
108
+
109
+ return getPanelDarkModeCSS(colorName, colorValue);
110
+ }).join('\n');
111
+ export function getPanelDarkModeCSS(colorName, colorValue) {
112
+ return "\n &[data-panel-color=\"".concat(colorName, "\"] {\n background-color: ").concat(colorValue, " !important; // !important to override default style color\n color: ").concat(darkPanelColors.TextColor, ";\n }\n ");
113
+ }
63
114
  var prefix = 'ak-editor-panel';
64
115
  export var PanelSharedCssClassName = {
65
116
  prefix: prefix,
@@ -97,7 +148,7 @@ var iconDynamicStyles = function iconDynamicStyles(panelType) {
97
148
  export var getPanelTypeBackground = function getPanelTypeBackground(panelType) {
98
149
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
99
150
  var light = lightPanelColor[panelType];
100
- var dark = hexToRgba(darkPanelColor[panelType], darkPanelOpacity);
151
+ var dark = darkPanelColors[panelType];
101
152
  var background = themed({
102
153
  light: light,
103
154
  dark: dark
@@ -108,18 +159,14 @@ export var getPanelTypeBackground = function getPanelTypeBackground(panelType) {
108
159
  var mainDynamicStyles = function mainDynamicStyles(panelType) {
109
160
  return function (props) {
110
161
  var background = getPanelTypeBackground(panelType, props);
111
- var darkText = darkTextColor[panelType];
112
- var darkBorder = '1px solid ' + darkPanelBorderColor[panelType];
113
- var border = themed({
114
- light: 'none',
115
- dark: darkBorder
116
- })(props);
117
162
  var text = themed({
118
163
  light: 'inherit',
119
- dark: darkText
164
+ dark: darkPanelColors.TextColor
120
165
  })(props);
121
- return "\n background-color: ".concat(background, ";\n border: ").concat(border, ";\n color: ").concat(text, ";\n ");
166
+ return "\n background-color: ".concat(background, ";\n color: ").concat(text, ";\n ");
122
167
  };
123
168
  };
124
169
 
125
- export var panelSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline;\n }\n\n .", ", .", " {\n vertical-align: ", "px;\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n }\n"])), PanelSharedCssClassName.prefix, borderRadius(), blockNodesVerticalMargin, gridSize(), akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, gridSize() * 3, gridSize() * 3, gridSize(), iconDynamicStyles(PanelType.INFO), emojiSprite, emojiImage, verticalAlignment, PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.SUCCESS));
170
+ export var panelSharedStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n margin: ", " 0 0;\n padding: ", "px;\n min-width: ", "px;\n display: flex;\n position: relative;\n align-items: baseline;\n word-break: break-word;\n\n ", "\n\n .", " {\n flex-shrink: 0;\n height: ", "px;\n width: ", "px;\n box-sizing: content-box;\n padding-right: ", "px;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n ", "\n\n > span {\n vertical-align: middle;\n display: inline;\n }\n\n .", " {\n vertical-align: ", "px;\n }\n\n .", " {\n vertical-align: ", "px;\n\n // Vertical align only works for inline-block elements in Firefox\n @-moz-document url-prefix() {\n img {\n display: inline-block;\n }\n }\n }\n }\n\n .ak-editor-panel__content {\n margin: 1px 0 1px;\n flex: 1 0 0;\n /*\n https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox\n The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn\u2019t compute to zero. The minimum size of a flex item is equal to the size of its contents.\n */\n min-width: 0;\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", "\n\n .", " {\n ", "\n }\n }\n\n &[data-panel-type='", "'] {\n ", ";\n }\n }\n"])), PanelSharedCssClassName.prefix, borderRadius(), blockNodesVerticalMargin, gridSize(), akEditorTableCellMinWidth, mainDynamicStyles(PanelType.INFO), PanelSharedCssClassName.icon, gridSize() * 3, gridSize() * 3, gridSize(), iconDynamicStyles(PanelType.INFO), emojiSprite, panelEmojiSpriteVerticalAlignment, emojiImage, panelEmojiImageVerticalAlignment, PanelType.NOTE, mainDynamicStyles(PanelType.NOTE), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.NOTE), PanelType.TIP, mainDynamicStyles(PanelType.TIP), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.TIP), PanelType.WARNING, mainDynamicStyles(PanelType.WARNING), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.WARNING), PanelType.ERROR, mainDynamicStyles(PanelType.ERROR), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.ERROR), PanelType.SUCCESS, mainDynamicStyles(PanelType.SUCCESS), PanelSharedCssClassName.icon, iconDynamicStyles(PanelType.SUCCESS), PanelType.CUSTOM, themed({
171
+ dark: getPanelBackgroundDarkModeColors
172
+ }));
@@ -29,7 +29,7 @@ export var TableSharedCssClassName = {
29
29
  TABLE_CELL_NODEVIEW_CONTENT_DOM: tableCellContentDomSelector,
30
30
  TABLE_CELL_WRAPPER: tableCellSelector
31
31
  };
32
- var tableSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n margin: ", "px ", "px 0 0;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: white;\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, tableCellBorderWidth, themed({
32
+ var tableSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n margin: 0 auto ", "px;\n box-sizing: border-box;\n\n /**\n * Fix block top alignment inside table cells.\n */\n .decisionItemView-content-wrap:first-child > div {\n margin-top: 0;\n }\n }\n .", "[data-number-column='true'] {\n padding-left: ", "px;\n clear: both;\n }\n /* avoid applying styles to nested tables (possible via extensions) */\n .", " > table,\n .", " > table,\n .", " > table {\n border-collapse: collapse;\n margin: ", "px ", "px 0 0;\n border: ", "px solid\n ", ";\n table-layout: fixed;\n font-size: 1em;\n width: 100%;\n\n &[data-autosize='true'] {\n table-layout: auto;\n }\n\n & {\n * {\n box-sizing: border-box;\n }\n hr {\n box-sizing: content-box;\n }\n\n tbody {\n border-bottom: none;\n }\n th td {\n background-color: white;\n }\n th,\n td {\n min-width: ", "px;\n font-weight: normal;\n vertical-align: top;\n border: 1px solid\n ", ";\n border-right-width: 0;\n border-bottom-width: 0;\n padding: ", "px;\n /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */\n ", "\n\n ", ";\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n th p:not(:first-of-type),\n td p:not(:first-of-type) {\n margin-top: 12px;\n }\n }\n th {\n background-color: ", ";\n text-align: left;\n\n /* only apply this styling to codeblocks in default background headercells */\n /* TODO this needs to be overhauled as it relies on unsafe selectors */\n &:not([style]) {\n .code-block {\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n background-color: ", ";\n\n .line-number-gutter {\n background-color: ", ";\n }\n\n /* this is only relevant to the element taken care of by renderer */\n > [data-ds--code--code-block] {\n background-image: ", "!important;\n\n background-color: ", "!important;\n\n // selector lives inside @atlaskit/code\n --ds--code--line-number-bg-color: ", ";\n }\n }\n }\n }\n }\n }\n"])), TableSharedCssClassName.TABLE_CONTAINER, tableMarginBottom, TableSharedCssClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth - 1, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableMarginTop, tableMarginSides, tableCellBorderWidth, themed({
33
33
  light: akEditorTableBorder,
34
34
  dark: akEditorTableBorderDark
35
35
  }), tableCellMinWidth, themed({
@@ -15,6 +15,7 @@ export var EditorExperience;
15
15
  EditorExperience["loadEditor"] = "load";
16
16
  EditorExperience["typing"] = "type";
17
17
  EditorExperience["interaction"] = "interact";
18
+ EditorExperience["editSession"] = "editSession";
18
19
  })(EditorExperience || (EditorExperience = {}));
19
20
 
20
21
  export var RELIABILITY_INTERVAL = 30000;
@@ -76,7 +77,7 @@ export var ExperienceStore = /*#__PURE__*/function () {
76
77
  value: function success(experienceId, metadata) {
77
78
  var _this$getActive;
78
79
 
79
- (_this$getActive = this.getActive(experienceId)) === null || _this$getActive === void 0 ? void 0 : _this$getActive.success({
80
+ return (_this$getActive = this.getActive(experienceId)) === null || _this$getActive === void 0 ? void 0 : _this$getActive.success({
80
81
  metadata: metadata
81
82
  });
82
83
  }
@@ -13,7 +13,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
13
13
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
14
 
15
15
  import React from 'react';
16
- import { injectIntl } from 'react-intl';
16
+ import { injectIntl } from 'react-intl-next';
17
17
  import styled from 'styled-components';
18
18
  import { N200, N400 } from '@atlaskit/theme/colors';
19
19
  import { messages } from './messages';
@@ -1,4 +1,4 @@
1
- import { defineMessages } from 'react-intl';
1
+ import { defineMessages } from 'react-intl-next';
2
2
  export var messages = defineMessages({
3
3
  placeholder: {
4
4
  id: 'fabric.editor.captionPlaceholder',
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
4
4
 
5
- import { defineMessages } from 'react-intl';
5
+ import { defineMessages } from 'react-intl-next';
6
6
  import styled, { css } from 'styled-components';
7
7
  import { akEditorLineHeight, akEditorSwoopCubicBezier, akLayoutGutterOffset, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
8
8
  import * as colors from '@atlaskit/theme/colors';
@@ -0,0 +1,45 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
+
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+
10
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
+
12
+ import React from 'react';
13
+ import { IntlProvider, intlShape } from 'react-intl';
14
+ export var IntlLegacyFallbackProvider = /*#__PURE__*/function (_React$Component) {
15
+ _inherits(IntlLegacyFallbackProvider, _React$Component);
16
+
17
+ var _super = _createSuper(IntlLegacyFallbackProvider);
18
+
19
+ function IntlLegacyFallbackProvider() {
20
+ _classCallCheck(this, IntlLegacyFallbackProvider);
21
+
22
+ return _super.apply(this, arguments);
23
+ }
24
+
25
+ _createClass(IntlLegacyFallbackProvider, [{
26
+ key: "render",
27
+ value: function render() {
28
+ var oldIntl = this.context.intl;
29
+
30
+ if (!oldIntl) {
31
+ return /*#__PURE__*/React.createElement(IntlProvider, {
32
+ locale: "en"
33
+ }, this.props.children);
34
+ }
35
+
36
+ return this.props.children;
37
+ }
38
+ }]);
39
+
40
+ return IntlLegacyFallbackProvider;
41
+ }(React.Component);
42
+
43
+ _defineProperty(IntlLegacyFallbackProvider, "contextTypes", {
44
+ intl: intlShape
45
+ });
@@ -0,0 +1,73 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+
13
+ import React from 'react';
14
+ import { IntlProvider } from 'react-intl-next';
15
+ export var REACT_INTL_ERROR_MESSAGE = '<IntlProvider> needs to exist in the component ancestry';
16
+
17
+ var isMissingIntlProviderInAncestryError = function isMissingIntlProviderInAncestryError(err) {
18
+ var _err$toString;
19
+
20
+ 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');
21
+ };
22
+
23
+ export var IntlNextErrorBoundary = /*#__PURE__*/function (_React$Component) {
24
+ _inherits(IntlNextErrorBoundary, _React$Component);
25
+
26
+ var _super = _createSuper(IntlNextErrorBoundary);
27
+
28
+ function IntlNextErrorBoundary() {
29
+ var _this;
30
+
31
+ _classCallCheck(this, IntlNextErrorBoundary);
32
+
33
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
34
+ args[_key] = arguments[_key];
35
+ }
36
+
37
+ _this = _super.call.apply(_super, [this].concat(args));
38
+
39
+ _defineProperty(_assertThisInitialized(_this), "state", {
40
+ missingIntlProviderInAncestry: false
41
+ });
42
+
43
+ return _this;
44
+ }
45
+
46
+ _createClass(IntlNextErrorBoundary, [{
47
+ key: "componentDidCatch",
48
+ value: function componentDidCatch(error, errorInfo) {
49
+ // if missing IntlProvider in ancestry, we setup a fallback IntlProvider ourselves
50
+ if (isMissingIntlProviderInAncestryError(error)) {
51
+ this.setState({
52
+ missingIntlProviderInAncestry: true
53
+ });
54
+ } else {
55
+ // else we re-propagate the non-react-intl-next error
56
+ throw error;
57
+ }
58
+ }
59
+ }, {
60
+ key: "render",
61
+ value: function render() {
62
+ if (this.state.missingIntlProviderInAncestry) {
63
+ return /*#__PURE__*/React.createElement(IntlProvider, {
64
+ locale: "en"
65
+ }, this.props.children);
66
+ }
67
+
68
+ return this.props.children;
69
+ }
70
+ }]);
71
+
72
+ return IntlNextErrorBoundary;
73
+ }(React.Component);
@@ -0,0 +1,51 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
+
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9
+
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11
+
12
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
+
14
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
+
16
+ import React from 'react';
17
+ import { intlShape } from 'react-intl';
18
+ import { createIntl, RawIntlProvider } from 'react-intl-next';
19
+ export var LegacyToNextIntlProvider = /*#__PURE__*/function (_React$Component) {
20
+ _inherits(LegacyToNextIntlProvider, _React$Component);
21
+
22
+ var _super = _createSuper(LegacyToNextIntlProvider);
23
+
24
+ function LegacyToNextIntlProvider() {
25
+ _classCallCheck(this, LegacyToNextIntlProvider);
26
+
27
+ return _super.apply(this, arguments);
28
+ }
29
+
30
+ _createClass(LegacyToNextIntlProvider, [{
31
+ key: "render",
32
+ value: function render() {
33
+ var oldIntl = this.context.intl;
34
+
35
+ if (oldIntl) {
36
+ var nextIntl = createIntl(_objectSpread({}, oldIntl));
37
+ return /*#__PURE__*/React.createElement(RawIntlProvider, {
38
+ value: nextIntl
39
+ }, this.props.children);
40
+ }
41
+
42
+ return this.props.children;
43
+ }
44
+ }]);
45
+
46
+ return LegacyToNextIntlProvider;
47
+ }(React.Component);
48
+
49
+ _defineProperty(LegacyToNextIntlProvider, "contextTypes", {
50
+ intl: intlShape
51
+ });
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
3
3
  var _templateObject;
4
4
 
5
5
  import React, { useCallback, useRef } from 'react';
6
- import { injectIntl } from 'react-intl';
6
+ import { injectIntl } from 'react-intl-next';
7
7
  import styled from 'styled-components';
8
8
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
9
9
  import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
3
3
  var _templateObject;
4
4
 
5
5
  import React, { useCallback, useRef } from 'react';
6
- import { injectIntl } from 'react-intl';
6
+ import { injectIntl } from 'react-intl-next';
7
7
  import styled from 'styled-components';
8
8
  import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
9
9
  import QuestionsIcon from '@atlaskit/icon/glyph/question-circle';
@@ -1,10 +1,15 @@
1
- export { default as Emoji } from './Emoji';
1
+ // TODO: ED-13875 Remove Emoji & EmojiProps exports once root entry point for editor-common has been removed
2
+ export { default as Emoji } from './Emoji'; //exported from ./src/emoji.ts
3
+
4
+ //exported from ./src/emoji.ts
2
5
  export { default as Caption } from './Caption';
3
6
  export { default as MediaSingle, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, shouldAddDefaultWrappedWidth } from './MediaSingle';
4
7
  export { MediaSingleDimensionHelper } from './MediaSingle/styled';
5
8
  export { layoutSupportsWidth, calcPxFromColumns, calcPctFromPx, calcPxFromPct, calcColumnsFromPx, snapToGrid } from './MediaSingle/grid';
6
- export { MediaLink } from './MediaSingle/link';
7
- export { default as Mention } from './Mention';
9
+ export { MediaLink } from './MediaSingle/link'; // TODO: ED-13875 Remove Mention export once root entry point for editor-common has been removed
10
+
11
+ export { default as Mention } from './Mention'; //exported from ./src/mention.ts
12
+
8
13
  export { default as Popup, findOverflowScrollParent } from './Popup';
9
14
  export { default as UnsupportedBlock } from './UnsupportedBlock';
10
15
  export { default as UnsupportedInline } from './UnsupportedInline';
@@ -15,4 +20,7 @@ export { default as overflowShadow, shadowClassNames } from './OverflowShadow';
15
20
  export { WithCreateAnalyticsEvent } from './WithCreateAnalyticsEvent';
16
21
  export { messages as expandMessages, sharedExpandStyles, ExpandIconWrapper, ExpandLayoutWrapper } from './Expand';
17
22
  export { ErrorMessage, HelperMessage, ValidMessage } from './Messages';
18
- export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
23
+ export { ClearNextSiblingMarginTop } from './clear-next-sibling-margin-top';
24
+ export { IntlNextErrorBoundary, REACT_INTL_ERROR_MESSAGE } from './IntlNextErrorBoundary';
25
+ export { IntlLegacyFallbackProvider } from './IntlLegacyFallbackProvider';
26
+ export { LegacyToNextIntlProvider } from './LegacyToNextIntlProvider';
@@ -135,6 +135,12 @@ function compareValue(valueA, valueB) {
135
135
  return 0;
136
136
  }
137
137
 
138
+ if (typeof valueA === 'string' && typeof valueB === 'string') {
139
+ return valueA.localeCompare(valueB, window.navigator.language, {
140
+ caseFirst: 'upper'
141
+ });
142
+ }
143
+
138
144
  return valueA > valueB ? 1 : -1;
139
145
  }
140
146
  /**
@@ -70,9 +70,8 @@ export var timestampToTaskContext = function timestampToTaskContext(timestamp, i
70
70
  var sameYear = givenDate.getUTCFullYear() === curDate.getUTCFullYear();
71
71
 
72
72
  if (intl && [-1, 0, 1].indexOf(distance) > -1) {
73
- return capitalizeFirstLetter(intl.formatRelative(givenDate, {
74
- units: 'day',
75
- now: Number(todayTimestampInUTC())
73
+ return capitalizeFirstLetter(intl.formatRelativeTime(distance, 'day', {
74
+ numeric: 'auto'
76
75
  }));
77
76
  }
78
77
 
@@ -22,4 +22,5 @@ export { ZERO_WIDTH_SPACE } from './whitespace';
22
22
  export { shouldForceTracking } from './should-force-tracking';
23
23
  export { getModeFromTheme } from './getModeFromTheme';
24
24
  export { sniffUserBrowserExtensions } from './browser-extensions';
25
- export { RenderCountProfiler } from './profiler/render-count';
25
+ export { RenderCountProfiler } from './profiler/render-count';
26
+ export { validateADFEntity, validationErrorHandler } from './validate-using-spec';
@@ -15,7 +15,7 @@ export var ADFStages = {
15
15
  * It's important that this order follows the marks rank defined here:
16
16
  * https://product-fabric.atlassian.net/wiki/spaces/E/pages/11174043/Document+structure#Documentstructure-Rank
17
17
  */
18
- export var markOrder = ['link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'confluenceInlineComment', 'annotation', 'dataConsumer'];
18
+ export var markOrder = ['fragment', 'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'confluenceInlineComment', 'annotation', 'dataConsumer'];
19
19
  export var isSubSupType = function isSubSupType(type) {
20
20
  return type === 'sub' || type === 'sup';
21
21
  };
@@ -348,7 +348,7 @@ export var getValidNode = function getValidNode(originalNode) {
348
348
 
349
349
  case 'caption':
350
350
  {
351
- if (content && adfStage === 'stage0') {
351
+ if (content) {
352
352
  return {
353
353
  type: type,
354
354
  content: content
@@ -640,23 +640,12 @@ export var getValidNode = function getValidNode(originalNode) {
640
640
  case 'panel':
641
641
  {
642
642
  if (attrs && content) {
643
- var panelType = attrs.panelType,
644
- panelIcon = attrs.panelIcon,
645
- panelColor = attrs.panelColor;
643
+ var panelType = attrs.panelType;
646
644
 
647
645
  if (Object.values(PanelType).includes(panelType)) {
648
- // TODO: ED-10445 remove stage0 check
649
- var _attrs = adfStage === 'stage0' ? {
650
- panelType: panelType,
651
- panelIcon: panelIcon,
652
- panelColor: panelColor
653
- } : {
654
- panelType: panelType
655
- };
656
-
657
646
  return {
658
647
  type: type,
659
- attrs: _attrs,
648
+ attrs: attrs,
660
649
  content: content
661
650
  };
662
651
  }
@@ -991,6 +980,14 @@ export var getValidMark = function getValidMark(mark) {
991
980
  attrs: attrs
992
981
  };
993
982
  }
983
+
984
+ case 'fragment':
985
+ {
986
+ return {
987
+ type: type,
988
+ attrs: attrs
989
+ };
990
+ }
994
991
  }
995
992
  }
996
993
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "60.2.0",
3
+ "version": "62.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,9 @@
1
+ import { Providers } from '../provider-factory';
2
+ export interface CardOptions {
3
+ provider?: Providers['cardProvider'];
4
+ resolveBeforeMacros?: string[];
5
+ allowBlockCards?: boolean;
6
+ allowEmbeds?: boolean;
7
+ allowResizing?: boolean;
8
+ useAlternativePreloader?: boolean;
9
+ }
@@ -1,9 +1 @@
1
- import { Providers } from '../provider-factory';
2
- export interface CardOptions {
3
- provider?: Providers['cardProvider'];
4
- resolveBeforeMacros?: string[];
5
- allowBlockCards?: boolean;
6
- allowEmbeds?: boolean;
7
- allowResizing?: boolean;
8
- useAlternativePreloader?: boolean;
9
- }
1
+ export type { CardOptions } from './cardOptions';
@@ -1 +1 @@
1
- export type { CollabEditProvider, CollabEventPresenceData, CollabEvent, CollabEventConnectionData, CollabEventData, CollabEventInitData, CollabEventRemoteData, CollabEventTelepointerData, CollabParticipant, CollabSendableSelection, } from './collab/types';
1
+ export type { CollabEditProvider, CollabEventPresenceData, CollabEvent, CollabEventConnectionData, CollabEventData, CollabEventInitData, CollabEventRemoteData, CollabEventTelepointerData, CollabParticipant, CollabSendableSelection, CollabEventLocalStepData, } from './collab/types';
@@ -0,0 +1,3 @@
1
+ export { default as Emoji } from './ui/Emoji';
2
+ export type { EmojiProps } from './ui/Emoji';
3
+ export { EmojiSharedCssClassName } from './styles/shared/emoji';
@@ -1,4 +1,4 @@
1
- export { isFieldset, isTabGroup, isExpand, isDateRange } from './types';
1
+ export { isFieldset, isTabGroup, isTabField, isExpand, isDateRange, } from './types';
2
2
  export type { Extension, ExtensionAutoConvertHandler, ExtensionComponentProps, ExtensionHandler, ExtensionHandlers, ExtensionKey, ExtensionManifest, ExtensionModule, ExtensionModuleAction, ExtensionModuleActionHandler, ExtensionModuleActionObject, ExtensionModuleNode, ExtensionModuleNodes, ExtensionModules, ExtensionParams, ExtensionProvider, ExtensionQuickInsertModule, ExtensionType, ExtensionToolbarButton, ContextualToolbar, ToolbarItem, Icon, MaybeADFEntity, MenuItem, MenuItemMap, UpdateExtension, Parameters, ParametersWithDuplicateFields, BooleanField, CustomField, CustomFieldResolver, UserFieldContext, UserField, UserFieldContextProvider, ColorField, DateField, DateRangeField, DateRangeResult, EnumField, EnumCheckboxField, EnumRadioField, EnumSelectField, ExpandField, FieldDefinition, DynamicFieldDefinitions, Fieldset, GroupingField, NativeField, NestedFieldDefinition, NumberField, Option, StringField, StringOneLineField, StringMultilineField, TabGroupField, TabField, FieldHandlerLink, OnSaveCallback, ExtensionAPI, TransformBefore, TransformAfter, ReferenceEntity, ParametersGetter, AsyncParametersGetter, } from './types';
3
3
  export { getExtensionKeyAndNodeKey, resolveImport } from './manifest-helpers';
4
4
  export { default as DefaultExtensionProvider } from './default-extension-provider';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ADFEntity } from '@atlaskit/adf-utils';
2
3
  import { Parameters } from './extension-parameters';
3
4
  export interface ExtensionParams<T extends Parameters> {
@@ -16,7 +17,9 @@ export declare type ExtensionAPI<T extends Parameters = Parameters> = {
16
17
  editInContextPanel: (transformBefore: TransformBefore<T>, transformAfter: TransformAfter<T>) => void;
17
18
  _editInLegacyMacroBrowser: () => void;
18
19
  doc: {
19
- insertAfter: (localId: string, adf: ADFEntity) => void;
20
+ insertAfter: (localId: string, adf: ADFEntity, options?: {
21
+ allowSelectionToNewNode?: boolean;
22
+ }) => void;
20
23
  scrollTo: (localId: string) => void;
21
24
  };
22
25
  };
@@ -28,6 +31,8 @@ export interface Extension<T extends Parameters = Parameters> {
28
31
  export interface ExtensionHandlers<T extends Parameters = any> {
29
32
  [key: string]: Extension<T> | ExtensionHandler<T>;
30
33
  }
31
- export declare type ReferenceEntity = ADFEntity | Object;
34
+ export declare type ReferenceEntity = {
35
+ [prop: string]: ADFEntity | Object;
36
+ };
32
37
  export declare type ParametersGetter<T extends Parameters = Parameters> = TransformBefore<T>;
33
38
  export declare type AsyncParametersGetter<T extends Parameters = Parameters> = TransformAfter<T>;
@@ -1,4 +1,5 @@
1
1
  export declare type Parameters = {
2
2
  [key: string]: any;
3
+ lastIndexOf?: never;
3
4
  };
4
5
  export declare type ParametersWithDuplicateFields = Array<Parameters>;