@jetbrains/ring-ui-built 7.0.0-beta.1 → 7.0.0-beta.3

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 (241) hide show
  1. package/components/_helpers/_rollupPluginBabelHelpers.js +1 -504
  2. package/components/_helpers/anchor.js +7 -5
  3. package/components/_helpers/button__classes.js +15 -13
  4. package/components/_helpers/caption.js +11 -17
  5. package/components/_helpers/card.js +92 -96
  6. package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
  7. package/components/_helpers/header.js +1 -1
  8. package/components/_helpers/icon__svg.js +27 -23
  9. package/components/_helpers/input.js +150 -171
  10. package/components/_helpers/query-assist__suggestions.js +78 -93
  11. package/components/_helpers/select__filter.js +56 -67
  12. package/components/_helpers/services-link.js +23 -29
  13. package/components/_helpers/sidebar.js +91 -93
  14. package/components/_helpers/tab-link.js +8 -6
  15. package/components/_helpers/theme.js +55 -51
  16. package/components/_helpers/title.js +59 -69
  17. package/components/alert/alert.js +112 -156
  18. package/components/alert/container.js +32 -39
  19. package/components/alert-service/alert-service.js +104 -161
  20. package/components/analytics/analytics.js +12 -20
  21. package/components/analytics/analytics__custom-plugin.js +52 -68
  22. package/components/auth/auth.js +2 -27
  23. package/components/auth/auth__core.d.ts +1 -1
  24. package/components/auth/auth__core.js +742 -1428
  25. package/components/auth/background-flow.js +84 -121
  26. package/components/auth/down-notification.js +31 -69
  27. package/components/auth/iframe-flow.js +70 -123
  28. package/components/auth/request-builder.js +46 -77
  29. package/components/auth/response-parser.js +84 -112
  30. package/components/auth/storage.js +160 -318
  31. package/components/auth/token-validator.js +132 -227
  32. package/components/auth/window-flow.js +84 -121
  33. package/components/auth-dialog/auth-dialog.js +99 -150
  34. package/components/auth-dialog-service/auth-dialog-service.js +6 -26
  35. package/components/avatar/avatar-example-datauri.js +1 -1
  36. package/components/avatar/avatar.js +94 -123
  37. package/components/avatar/fallback-avatar.js +20 -34
  38. package/components/badge/badge.js +32 -38
  39. package/components/breadcrumbs/breadcrumbs.js +13 -17
  40. package/components/button/button.js +67 -80
  41. package/components/button-group/button-group.js +27 -36
  42. package/components/button-set/button-set.js +19 -27
  43. package/components/button-toolbar/button-toolbar.js +17 -25
  44. package/components/caret/caret.js +184 -211
  45. package/components/checkbox/checkbox.js +69 -86
  46. package/components/clipboard/clipboard-fallback.js +7 -7
  47. package/components/clipboard/clipboard.js +36 -128
  48. package/components/code/code.js +83 -151
  49. package/components/collapse/collapse-content.js +42 -60
  50. package/components/collapse/collapse-context.js +2 -2
  51. package/components/collapse/collapse-control.js +12 -12
  52. package/components/collapse/collapse.js +12 -17
  53. package/components/collapse/consts.js +4 -4
  54. package/components/collapse/utils.js +1 -3
  55. package/components/confirm/confirm.js +57 -87
  56. package/components/confirm-service/confirm-service.js +23 -44
  57. package/components/content-layout/content-layout.js +41 -56
  58. package/components/content-layout/sidebar.js +1 -1
  59. package/components/contenteditable/contenteditable.js +38 -46
  60. package/components/control-help/control-help.js +5 -3
  61. package/components/control-label/control-label.js +9 -8
  62. package/components/data-list/data-list.js +113 -156
  63. package/components/data-list/data-list.mock.js +3 -5
  64. package/components/data-list/item.js +120 -140
  65. package/components/data-list/selection.js +77 -135
  66. package/components/data-list/title.js +2 -10
  67. package/components/date-picker/consts.js +16 -22
  68. package/components/date-picker/date-input.js +99 -124
  69. package/components/date-picker/date-picker.js +140 -184
  70. package/components/date-picker/date-popup.js +280 -327
  71. package/components/date-picker/day.js +71 -94
  72. package/components/date-picker/month-names.js +41 -59
  73. package/components/date-picker/month-slider.js +42 -61
  74. package/components/date-picker/month.js +17 -24
  75. package/components/date-picker/months.js +44 -49
  76. package/components/date-picker/weekdays.js +12 -21
  77. package/components/date-picker/years.js +77 -98
  78. package/components/dialog/dialog.js +151 -187
  79. package/components/dialog/dialog__body-scroll-preventer.js +0 -3
  80. package/components/dropdown/anchor.js +0 -6
  81. package/components/dropdown/dropdown.js +134 -154
  82. package/components/dropdown-menu/dropdown-menu.js +59 -87
  83. package/components/editable-heading/editable-heading.js +69 -116
  84. package/components/error-bubble/error-bubble.js +29 -54
  85. package/components/error-message/error-message.js +34 -49
  86. package/components/footer/footer.js +27 -28
  87. package/components/global/compose.js +1 -8
  88. package/components/global/composeRefs.d.ts +0 -3
  89. package/components/global/composeRefs.js +8 -15
  90. package/components/global/controls-height.js +2 -2
  91. package/components/global/create-stateful-context.js +14 -13
  92. package/components/global/data-tests.js +7 -12
  93. package/components/global/dom.js +49 -82
  94. package/components/global/focus-sensor-hoc.js +99 -106
  95. package/components/global/fuzzy-highlight.js +23 -34
  96. package/components/global/get-event-key.js +8 -8
  97. package/components/global/get-uid.js +3 -7
  98. package/components/global/inject-styles.js +7 -14
  99. package/components/global/listeners.js +28 -47
  100. package/components/global/memoize.js +6 -10
  101. package/components/global/normalize-indent.js +19 -46
  102. package/components/global/promise-with-timeout.js +6 -8
  103. package/components/global/prop-types.js +3 -5
  104. package/components/global/react-dom-renderer.js +29 -40
  105. package/components/global/rerender-hoc.js +16 -32
  106. package/components/global/schedule-raf.js +4 -4
  107. package/components/global/sniffer.js +1 -1
  108. package/components/global/theme.d.ts +3 -0
  109. package/components/global/theme.js +2 -19
  110. package/components/global/trivial-template-tag.js +4 -9
  111. package/components/global/typescript-utils.js +2 -6
  112. package/components/global/url.js +20 -23
  113. package/components/global/use-event-callback.js +7 -4
  114. package/components/grid/col.js +27 -39
  115. package/components/grid/grid.js +18 -27
  116. package/components/grid/row.js +23 -30
  117. package/components/group/group.js +16 -22
  118. package/components/header/header-icon.js +19 -31
  119. package/components/header/header.d.ts +0 -1
  120. package/components/header/header.js +30 -64
  121. package/components/header/links.d.ts +2 -0
  122. package/components/header/links.js +20 -0
  123. package/components/header/logo.js +15 -26
  124. package/components/header/profile.js +124 -150
  125. package/components/header/services-link.js +1 -3
  126. package/components/header/services.js +64 -97
  127. package/components/header/smart-profile.js +101 -178
  128. package/components/header/smart-services.js +55 -90
  129. package/components/header/tray.js +21 -30
  130. package/components/heading/heading.js +21 -20
  131. package/components/http/http.js +162 -319
  132. package/components/http/http.mock.js +50 -98
  133. package/components/hub-source/hub-source.js +77 -182
  134. package/components/hub-source/hub-source__user.js +9 -37
  135. package/components/hub-source/hub-source__users-groups.js +34 -60
  136. package/components/i18n/i18n-context.js +7 -8
  137. package/components/i18n/i18n.js +3 -6
  138. package/components/icon/icon.js +60 -74
  139. package/components/icon/icon__svg.js +0 -5
  140. package/components/icon/index.js +0 -5
  141. package/components/input/input.js +1 -11
  142. package/components/island/adaptive-island-hoc.js +29 -37
  143. package/components/island/content.js +100 -110
  144. package/components/island/header.js +56 -66
  145. package/components/island/island.js +25 -33
  146. package/components/island-legacy/content-legacy.js +16 -22
  147. package/components/island-legacy/header-legacy.js +19 -25
  148. package/components/island-legacy/island-legacy.js +16 -22
  149. package/components/link/clickableLink.js +33 -42
  150. package/components/link/link.js +47 -55
  151. package/components/list/consts.js +2 -2
  152. package/components/list/list.js +399 -486
  153. package/components/list/list__custom.js +51 -61
  154. package/components/list/list__hint.js +9 -17
  155. package/components/list/list__item.js +147 -178
  156. package/components/list/list__link.js +38 -47
  157. package/components/list/list__separator.js +15 -24
  158. package/components/list/list__title.js +25 -34
  159. package/components/list/list__users-groups-source.js +55 -121
  160. package/components/loader/loader.js +38 -60
  161. package/components/loader/loader__core.js +123 -184
  162. package/components/loader-inline/loader-inline.js +24 -32
  163. package/components/loader-screen/loader-screen.js +24 -40
  164. package/components/login-dialog/login-dialog.js +81 -121
  165. package/components/login-dialog/service.js +6 -29
  166. package/components/markdown/markdown.js +16 -24
  167. package/components/message/message.js +170 -201
  168. package/components/old-browsers-message/old-browsers-message.js +11 -14
  169. package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
  170. package/components/old-browsers-message/white-list.js +8 -13
  171. package/components/pager/pager.js +212 -257
  172. package/components/panel/panel.js +16 -22
  173. package/components/permissions/permissions.js +118 -161
  174. package/components/permissions/permissions__cache.js +191 -218
  175. package/components/popup/popup.consts.js +1 -1
  176. package/components/popup/popup.js +237 -288
  177. package/components/popup/popup.target.js +9 -7
  178. package/components/popup/position.js +94 -101
  179. package/components/popup-menu/popup-menu.js +33 -67
  180. package/components/progress-bar/progress-bar.js +57 -68
  181. package/components/query-assist/query-assist.js +583 -652
  182. package/components/query-assist/query-assist__suggestions.js +2 -26
  183. package/components/radio/radio.js +15 -27
  184. package/components/radio/radio__item.js +52 -62
  185. package/components/scrollable-section/scrollable-section.js +53 -0
  186. package/components/select/select.js +701 -796
  187. package/components/select/select__filter.js +1 -26
  188. package/components/select/select__popup.js +316 -413
  189. package/components/shortcuts/core.js +147 -195
  190. package/components/shortcuts/shortcut-title.js +6 -10
  191. package/components/shortcuts/shortcuts-hoc.js +23 -41
  192. package/components/shortcuts/shortcuts.js +41 -64
  193. package/components/slider/slider.js +93 -112
  194. package/components/slider/slider.utils.js +16 -23
  195. package/components/storage/storage.js +3 -27
  196. package/components/storage/storage__fallback.js +137 -210
  197. package/components/storage/storage__local.js +89 -147
  198. package/components/style.css +1 -1
  199. package/components/tab-trap/tab-trap.js +35 -53
  200. package/components/table/cell.js +11 -21
  201. package/components/table/disable-hover-hoc.js +27 -42
  202. package/components/table/header-cell.js +59 -75
  203. package/components/table/header.js +89 -110
  204. package/components/table/multitable.js +83 -89
  205. package/components/table/row-with-focus-sensor.js +25 -57
  206. package/components/table/row.js +169 -200
  207. package/components/table/selection-adapter.js +2 -2
  208. package/components/table/selection-shortcuts-hoc.js +108 -113
  209. package/components/table/selection.js +150 -217
  210. package/components/table/simple-table.js +19 -55
  211. package/components/table/smart-table.js +42 -76
  212. package/components/table/table.js +267 -327
  213. package/components/tabs/collapsible-more.js +47 -73
  214. package/components/tabs/collapsible-tab.js +32 -36
  215. package/components/tabs/collapsible-tabs.js +89 -148
  216. package/components/tabs/custom-item.js +4 -2
  217. package/components/tabs/dumb-tabs.js +60 -92
  218. package/components/tabs/smart-tabs.js +29 -61
  219. package/components/tabs/tab-link.js +1 -3
  220. package/components/tabs/tab.js +15 -24
  221. package/components/tabs/tabs.js +1 -26
  222. package/components/tag/tag.d.ts +0 -2
  223. package/components/tag/tag.js +120 -162
  224. package/components/tags-input/tags-input.js +222 -304
  225. package/components/tags-list/tags-list.js +45 -61
  226. package/components/text/text.js +28 -37
  227. package/components/toggle/toggle.js +51 -61
  228. package/components/tooltip/tooltip.js +109 -141
  229. package/components/user-agreement/service.js +259 -400
  230. package/components/user-agreement/user-agreement.js +80 -108
  231. package/components/user-card/card.js +1 -25
  232. package/components/user-card/smart-user-card-tooltip.js +52 -103
  233. package/components/user-card/tooltip.js +35 -65
  234. package/components/user-card/user-card.js +1 -25
  235. package/package.json +1 -1
  236. package/components/global/react-render-adapter.d.ts +0 -1
  237. package/components/global/react-render-adapter.js +0 -6
  238. package/components/header/scrollable-section.js +0 -47
  239. package/components/header/tray-icon.d.ts +0 -1
  240. package/components/header/tray-icon.js +0 -26
  241. /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
@@ -1,5 +1,5 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, d as _objectSpread2, e as _classCallCheck, f as _callSuper, g as _asyncToGenerator, h as _regeneratorRuntime } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
1
+ import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
3
  import { PureComponent } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import '../auth/auth.js';
@@ -8,21 +8,13 @@ import Profile from './profile.js';
8
8
  import { jsx } from 'react/jsx-runtime';
9
9
  import Auth, { USER_CHANGED_EVENT, LOGOUT_POSTPONED_EVENT, USER_CHANGE_POSTPONED_EVENT } from '../auth/auth__core.js';
10
10
  import '../auth/window-flow.js';
11
- import 'core-js/modules/es.object.to-string.js';
12
- import 'core-js/modules/es.promise.js';
13
11
  import '../auth/response-parser.js';
14
- import 'core-js/modules/es.array.index-of.js';
15
12
  import 'core-js/modules/es.regexp.exec.js';
16
- import 'core-js/modules/es.regexp.to-string.js';
17
13
  import 'core-js/modules/es.string.replace.js';
18
- import 'core-js/modules/web.dom-collections.for-each.js';
19
14
  import 'es6-error';
20
15
  import '../global/url.js';
21
- import 'core-js/modules/es.string.match.js';
22
16
  import '../auth/down-notification.js';
23
- import 'core-js/modules/es.array.filter.js';
24
17
  import '../alert/alert.js';
25
- import 'core-js/modules/es.object.values.js';
26
18
  import 'classnames';
27
19
  import '@jetbrains/icons/exception';
28
20
  import '@jetbrains/icons/checkmark';
@@ -32,20 +24,11 @@ import '../icon/icon.js';
32
24
  import 'util-deprecate';
33
25
  import '../icon/icon__constants.js';
34
26
  import '../_helpers/icon__svg.js';
35
- import 'core-js/modules/es.string.starts-with.js';
36
27
  import '../global/memoize.js';
37
- import 'core-js/modules/es.array.iterator.js';
38
- import 'core-js/modules/es.map.js';
39
- import 'core-js/modules/es.weak-map.js';
40
- import 'core-js/modules/web.dom-collections.iterator.js';
41
28
  import '../loader-inline/loader-inline.js';
42
29
  import '../global/data-tests.js';
43
30
  import 'core-js/modules/es.array.reduce.js';
44
- import 'core-js/modules/es.object.entries.js';
45
31
  import '../global/dom.js';
46
- import 'core-js/modules/es.object.assign.js';
47
- import 'core-js/modules/es.set.js';
48
- import 'core-js/modules/es.string.split.js';
49
32
  import '../button/button.js';
50
33
  import '@jetbrains/icons/chevron-down';
51
34
  import '../link/clickableLink.js';
@@ -58,13 +41,7 @@ import '../popup/popup.js';
58
41
  import '../global/get-uid.js';
59
42
  import '../global/schedule-raf.js';
60
43
  import '../shortcuts/shortcuts.js';
61
- import 'core-js/modules/es.array.map.js';
62
44
  import '../shortcuts/core.js';
63
- import 'core-js/modules/es.array.find-index.js';
64
- import 'core-js/modules/es.array.includes.js';
65
- import 'core-js/modules/es.array.slice.js';
66
- import 'core-js/modules/es.array.splice.js';
67
- import 'core-js/modules/es.string.includes.js';
68
45
  import 'combokeys';
69
46
  import '../global/sniffer.js';
70
47
  import 'sniffr';
@@ -77,13 +54,11 @@ import '../link/link.js';
77
54
  import '../_helpers/link.js';
78
55
  import '../group/group.js';
79
56
  import 'react-dom/client';
80
- import 'core-js/modules/es.string.search.js';
81
57
  import 'core-js/modules/web.url.js';
82
58
  import 'core-js/modules/web.url.to-json.js';
83
59
  import 'core-js/modules/web.url-search-params.js';
84
60
  import '../global/listeners.js';
85
61
  import '../http/http.js';
86
- import 'core-js/modules/es.reflect.delete-property.js';
87
62
  import '../global/promise-with-timeout.js';
88
63
  import '../i18n/i18n.js';
89
64
  import '../auth/storage.js';
@@ -97,12 +72,9 @@ import '../auth/background-flow.js';
97
72
  import '../auth/token-validator.js';
98
73
  import '../avatar/avatar.js';
99
74
  import '../avatar/fallback-avatar.js';
100
- import 'core-js/modules/es.array.from.js';
101
75
  import '../dropdown-menu/dropdown-menu.js';
102
76
  import '../list/list.js';
103
- import 'core-js/modules/es.symbol.js';
104
77
  import 'core-js/modules/es.symbol.description.js';
105
- import 'core-js/modules/es.array.find.js';
106
78
  import 'react-virtualized/dist/es/List';
107
79
  import 'react-virtualized/dist/es/AutoSizer';
108
80
  import 'react-virtualized/dist/es/WindowScroller';
@@ -132,166 +104,117 @@ import '../popup-menu/popup-menu.js';
132
104
  import '../i18n/i18n-context.js';
133
105
  import '../_helpers/header.js';
134
106
 
135
- var _excluded = ["auth", "profileUrl"];
136
- var CERTIFICATE_MISMATCH_HEADER = 'x-client-certificate-token-mismatch';
137
- var SmartProfile = /*#__PURE__*/function (_PureComponent) {
138
- function SmartProfile() {
139
- var _this;
140
- _classCallCheck(this, SmartProfile);
141
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
142
- args[_key] = arguments[_key];
143
- }
144
- _this = _callSuper(this, SmartProfile, [].concat(args));
145
- _defineProperty(_this, "state", {
107
+ const _excluded = ["auth", "profileUrl"];
108
+ const CERTIFICATE_MISMATCH_HEADER = 'x-client-certificate-token-mismatch';
109
+ class SmartProfile extends PureComponent {
110
+ constructor() {
111
+ super(...arguments);
112
+ _defineProperty(this, "state", {
146
113
  user: null,
147
114
  size: Profile.defaultProps.size,
148
115
  isLogoutPostponed: false,
149
116
  isUserChangePostponed: false
150
117
  });
151
- _defineProperty(_this, "login", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
152
- return _regeneratorRuntime().wrap(function _callee$(_context) {
153
- while (1) switch (_context.prev = _context.next) {
154
- case 0:
155
- _this.setState({
156
- loading: true
157
- });
158
- _context.prev = 1;
159
- _context.next = 4;
160
- return _this.props.auth.login();
161
- case 4:
162
- _context.next = 8;
163
- break;
164
- case 6:
165
- _context.prev = 6;
166
- _context.t0 = _context["catch"](1);
167
- case 8:
168
- _context.prev = 8;
169
- _this.setState({
170
- loading: false
171
- });
172
- return _context.finish(8);
173
- case 11:
174
- case "end":
175
- return _context.stop();
176
- }
177
- }, _callee, null, [[1, 6, 8, 11]]);
178
- })));
179
- _defineProperty(_this, "logout", function () {
180
- return _this.props.auth.logout();
181
- });
182
- _defineProperty(_this, "switchUser", function () {
183
- return _this.props.auth.switchUser();
118
+ _defineProperty(this, "login", async () => {
119
+ this.setState({
120
+ loading: true
121
+ });
122
+ try {
123
+ await this.props.auth.login();
124
+ } catch (err) {
125
+ // do nothing
126
+ } finally {
127
+ this.setState({
128
+ loading: false
129
+ });
130
+ }
184
131
  });
185
- _defineProperty(_this, "onRevertPostponement", function () {
186
- if (_this.state.isLogoutPostponed) {
187
- _this.props.auth.login();
132
+ _defineProperty(this, "logout", () => this.props.auth.logout());
133
+ _defineProperty(this, "switchUser", () => this.props.auth.switchUser());
134
+ _defineProperty(this, "onRevertPostponement", () => {
135
+ if (this.state.isLogoutPostponed) {
136
+ this.props.auth.login();
188
137
  }
189
- if (_this.state.isUserChangePostponed) {
190
- _this.props.auth.updateUser();
138
+ if (this.state.isUserChangePostponed) {
139
+ this.props.auth.updateUser();
191
140
  }
192
141
  });
193
- return _this;
194
142
  }
195
- _inherits(SmartProfile, _PureComponent);
196
- return _createClass(SmartProfile, [{
197
- key: "componentDidMount",
198
- value: function componentDidMount() {
199
- this.requestUser();
200
- }
201
- }, {
202
- key: "requestUser",
203
- value: function () {
204
- var _requestUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
205
- var _this2 = this;
206
- var auth, user;
207
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
208
- while (1) switch (_context2.prev = _context2.next) {
209
- case 0:
210
- _context2.prev = 0;
211
- auth = this.props.auth;
212
- _context2.next = 4;
213
- return auth.requestUser();
214
- case 4:
215
- user = _context2.sent;
216
- this.checkUserCertificateMismatch(user);
217
- this.setState({
218
- user
219
- });
220
- auth.addListener(USER_CHANGED_EVENT, function (newUser) {
221
- _this2.setState({
222
- user: newUser,
223
- isLogoutPostponed: false,
224
- isUserChangePostponed: false
225
- });
226
- });
227
- auth.addListener(LOGOUT_POSTPONED_EVENT, function () {
228
- _this2.setState({
229
- isLogoutPostponed: true
230
- });
231
- });
232
- auth.addListener(USER_CHANGE_POSTPONED_EVENT, function () {
233
- _this2.setState({
234
- isUserChangePostponed: true
235
- });
236
- });
237
- _context2.next = 14;
238
- break;
239
- case 12:
240
- _context2.prev = 12;
241
- _context2.t0 = _context2["catch"](0);
242
- case 14:
243
- case "end":
244
- return _context2.stop();
245
- }
246
- }, _callee2, this, [[0, 12]]);
247
- }));
248
- function requestUser() {
249
- return _requestUser.apply(this, arguments);
250
- }
251
- return requestUser;
252
- }()
253
- }, {
254
- key: "checkUserCertificateMismatch",
255
- value: function checkUserCertificateMismatch(user) {
256
- var _userMeta$headers;
257
- var _this$props = this.props,
258
- auth = _this$props.auth,
259
- translations = _this$props.translations;
260
- var userMeta = auth.http.getMetaForResponse(user);
261
- if (userMeta !== null && userMeta !== void 0 && (_userMeta$headers = userMeta.headers) !== null && _userMeta$headers !== void 0 && _userMeta$headers.has(CERTIFICATE_MISMATCH_HEADER)) {
262
- var message = (translations === null || translations === void 0 ? void 0 : translations.certificateMismatch) || "You are authenticated as ".concat(user.login || user.name, ". To authenticate with the client certificate for your account, log out, then click the \"Log in with certificate\" option on the login page.");
263
- alertService.warning(message, 0);
264
- }
143
+ componentDidMount() {
144
+ this.requestUser();
145
+ }
146
+ async requestUser() {
147
+ try {
148
+ const {
149
+ auth
150
+ } = this.props;
151
+ const user = await auth.requestUser();
152
+ this.checkUserCertificateMismatch(user);
153
+ this.setState({
154
+ user
155
+ });
156
+ auth.addListener(USER_CHANGED_EVENT, newUser => {
157
+ this.setState({
158
+ user: newUser,
159
+ isLogoutPostponed: false,
160
+ isUserChangePostponed: false
161
+ });
162
+ });
163
+ auth.addListener(LOGOUT_POSTPONED_EVENT, () => {
164
+ this.setState({
165
+ isLogoutPostponed: true
166
+ });
167
+ });
168
+ auth.addListener(USER_CHANGE_POSTPONED_EVENT, () => {
169
+ this.setState({
170
+ isUserChangePostponed: true
171
+ });
172
+ });
173
+ } catch (e) {
174
+ // noop
265
175
  }
266
- }, {
267
- key: "render",
268
- value: function render() {
269
- var _this$state = this.state,
270
- user = _this$state.user,
271
- loading = _this$state.loading,
272
- isLogoutPostponed = _this$state.isLogoutPostponed,
273
- isUserChangePostponed = _this$state.isUserChangePostponed;
274
- var _this$props2 = this.props,
275
- auth = _this$props2.auth,
276
- profileUrl = _this$props2.profileUrl,
277
- props = _objectWithoutProperties(_this$props2, _excluded);
278
- var url = profileUrl || (user ? "".concat(auth.config.serverUri, "users/").concat(user.id) : '');
279
- return /*#__PURE__*/jsx(Profile, _objectSpread2({
280
- onLogin: this.login,
281
- onLogout: this.logout,
282
- onSwitchUser: this.switchUser,
283
- loading: loading,
284
- user: user,
285
- profileUrl: url,
286
- showApplyChangedUser: isUserChangePostponed,
287
- showLogIn: isLogoutPostponed,
288
- showLogOut: !isLogoutPostponed,
289
- showSwitchUser: auth._canShowDialogs() && !isLogoutPostponed && !isUserChangePostponed,
290
- onRevertPostponement: this.onRevertPostponement
291
- }, props));
176
+ }
177
+ checkUserCertificateMismatch(user) {
178
+ var _userMeta$headers;
179
+ const {
180
+ auth,
181
+ translations
182
+ } = this.props;
183
+ const userMeta = auth.http.getMetaForResponse(user);
184
+ if (userMeta !== null && userMeta !== void 0 && (_userMeta$headers = userMeta.headers) !== null && _userMeta$headers !== void 0 && _userMeta$headers.has(CERTIFICATE_MISMATCH_HEADER)) {
185
+ const message = (translations === null || translations === void 0 ? void 0 : translations.certificateMismatch) || "You are authenticated as ".concat(user.login || user.name, ". To authenticate with the client certificate for your account, log out, then click the \"Log in with certificate\" option on the login page.");
186
+ alertService.warning(message, 0);
292
187
  }
293
- }]);
294
- }(PureComponent);
188
+ }
189
+ render() {
190
+ const {
191
+ user,
192
+ loading,
193
+ isLogoutPostponed,
194
+ isUserChangePostponed
195
+ } = this.state;
196
+ const _this$props = this.props,
197
+ {
198
+ auth,
199
+ profileUrl
200
+ } = _this$props,
201
+ props = _objectWithoutProperties(_this$props, _excluded);
202
+ const url = profileUrl || (user ? "".concat(auth.config.serverUri, "users/").concat(user.id) : '');
203
+ return /*#__PURE__*/jsx(Profile, _objectSpread2({
204
+ onLogin: this.login,
205
+ onLogout: this.logout,
206
+ onSwitchUser: this.switchUser,
207
+ loading: loading,
208
+ user: user,
209
+ profileUrl: url,
210
+ showApplyChangedUser: isUserChangePostponed,
211
+ showLogIn: isLogoutPostponed,
212
+ showLogOut: !isLogoutPostponed,
213
+ showSwitchUser: auth._canShowDialogs() && !isLogoutPostponed && !isUserChangePostponed,
214
+ onRevertPostponement: this.onRevertPostponement
215
+ }, props));
216
+ }
217
+ }
295
218
  _defineProperty(SmartProfile, "propTypes", {
296
219
  auth: PropTypes.instanceOf(Auth).isRequired,
297
220
  className: PropTypes.string,
@@ -1,5 +1,5 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, d as _objectSpread2, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.concat.js';
1
+ import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
3
  import { Component } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import '../auth/auth.js';
@@ -8,25 +8,16 @@ import Services from './services.js';
8
8
  import { jsx } from 'react/jsx-runtime';
9
9
  import Auth from '../auth/auth__core.js';
10
10
  import '../auth/window-flow.js';
11
- import 'core-js/modules/es.object.to-string.js';
12
- import 'core-js/modules/es.promise.js';
13
11
  import '../auth/response-parser.js';
14
- import 'core-js/modules/es.array.index-of.js';
15
12
  import 'core-js/modules/es.regexp.exec.js';
16
- import 'core-js/modules/es.regexp.to-string.js';
17
13
  import 'core-js/modules/es.string.replace.js';
18
- import 'core-js/modules/web.dom-collections.for-each.js';
19
14
  import 'es6-error';
20
15
  import '../global/url.js';
21
- import 'core-js/modules/es.string.match.js';
22
16
  import '../auth/down-notification.js';
23
- import 'core-js/modules/es.array.filter.js';
24
17
  import '../alert-service/alert-service.js';
25
- import 'core-js/modules/es.array.map.js';
26
18
  import 'react-dom/client';
27
19
  import '../global/get-uid.js';
28
20
  import '../alert/alert.js';
29
- import 'core-js/modules/es.object.values.js';
30
21
  import 'classnames';
31
22
  import '@jetbrains/icons/exception';
32
23
  import '@jetbrains/icons/checkmark';
@@ -36,20 +27,11 @@ import '../icon/icon.js';
36
27
  import 'util-deprecate';
37
28
  import '../icon/icon__constants.js';
38
29
  import '../_helpers/icon__svg.js';
39
- import 'core-js/modules/es.string.starts-with.js';
40
30
  import '../global/memoize.js';
41
- import 'core-js/modules/es.array.iterator.js';
42
- import 'core-js/modules/es.map.js';
43
- import 'core-js/modules/es.weak-map.js';
44
- import 'core-js/modules/web.dom-collections.iterator.js';
45
31
  import '../loader-inline/loader-inline.js';
46
32
  import '../global/data-tests.js';
47
33
  import 'core-js/modules/es.array.reduce.js';
48
- import 'core-js/modules/es.object.entries.js';
49
34
  import '../global/dom.js';
50
- import 'core-js/modules/es.object.assign.js';
51
- import 'core-js/modules/es.set.js';
52
- import 'core-js/modules/es.string.split.js';
53
35
  import '../button/button.js';
54
36
  import '@jetbrains/icons/chevron-down';
55
37
  import '../link/clickableLink.js';
@@ -62,11 +44,6 @@ import '../popup/popup.js';
62
44
  import '../global/schedule-raf.js';
63
45
  import '../shortcuts/shortcuts.js';
64
46
  import '../shortcuts/core.js';
65
- import 'core-js/modules/es.array.find-index.js';
66
- import 'core-js/modules/es.array.includes.js';
67
- import 'core-js/modules/es.array.slice.js';
68
- import 'core-js/modules/es.array.splice.js';
69
- import 'core-js/modules/es.string.includes.js';
70
47
  import 'combokeys';
71
48
  import '../global/sniffer.js';
72
49
  import 'sniffr';
@@ -78,7 +55,6 @@ import '../alert/container.js';
78
55
  import '../link/link.js';
79
56
  import '../_helpers/link.js';
80
57
  import '../group/group.js';
81
- import 'core-js/modules/es.reflect.delete-property.js';
82
58
  import '@jetbrains/icons/services-20px';
83
59
  import '../dropdown/dropdown.js';
84
60
  import '../global/typescript-utils.js';
@@ -87,7 +63,6 @@ import '@jetbrains/icons/chevron-10px';
87
63
  import './header-icon.js';
88
64
  import '../_helpers/header.js';
89
65
  import '../_helpers/services-link.js';
90
- import 'core-js/modules/es.string.search.js';
91
66
  import 'core-js/modules/web.url.js';
92
67
  import 'core-js/modules/web.url.to-json.js';
93
68
  import 'core-js/modules/web.url-search-params.js';
@@ -104,86 +79,76 @@ import 'simply-uuid';
104
79
  import '../auth/background-flow.js';
105
80
  import '../auth/token-validator.js';
106
81
 
107
- var _excluded = ["auth"];
82
+ const _excluded = ["auth"];
108
83
  function noop() {}
109
- var SmartServices = /*#__PURE__*/function (_Component) {
110
- function SmartServices() {
111
- var _this;
112
- _classCallCheck(this, SmartServices);
113
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
114
- args[_key] = arguments[_key];
115
- }
116
- _this = _callSuper(this, SmartServices, [].concat(args));
117
- _defineProperty(_this, "state", {
84
+ class SmartServices extends Component {
85
+ constructor() {
86
+ super(...arguments);
87
+ _defineProperty(this, "state", {
118
88
  visible: true,
119
89
  loading: false,
120
90
  services: null
121
91
  });
122
- _defineProperty(_this, "http", void 0);
123
- _defineProperty(_this, "stopLoading", function () {
124
- _this.setState({
92
+ _defineProperty(this, "http", void 0);
93
+ _defineProperty(this, "stopLoading", () => {
94
+ this.setState({
125
95
  loading: false
126
96
  });
127
97
  });
128
- _defineProperty(_this, "getServicesContent", function () {
98
+ _defineProperty(this, "getServicesContent", () => {
129
99
  var _this$getServices;
130
- _this.setState({
100
+ this.setState({
131
101
  loading: true
132
102
  });
133
- (_this$getServices = _this.getServices(SmartServices.allFields)) === null || _this$getServices === void 0 || _this$getServices.then(function (services) {
134
- _this.setState({
103
+ (_this$getServices = this.getServices(SmartServices.allFields)) === null || _this$getServices === void 0 || _this$getServices.then(services => {
104
+ this.setState({
135
105
  services
136
106
  });
137
- _this.stopLoading();
138
- }).catch(_this.stopLoading);
107
+ this.stopLoading();
108
+ }).catch(this.stopLoading);
139
109
  });
140
- return _this;
141
110
  }
142
- _inherits(SmartServices, _Component);
143
- return _createClass(SmartServices, [{
144
- key: "componentDidMount",
145
- value: function componentDidMount() {
146
- var _this$getServices2,
147
- _this2 = this;
148
- var auth = this.props.auth;
149
- this.http = new HTTP(auth, auth.getAPIPath());
150
- (_this$getServices2 = this.getServices(SmartServices.countFields)) === null || _this$getServices2 === void 0 || _this$getServices2.then(function (services) {
151
- if (!services.length) {
152
- _this2.setState({
153
- visible: false
154
- });
155
- }
156
- }).catch(noop);
157
- }
158
- }, {
159
- key: "getServices",
160
- value: function getServices(fields) {
161
- var _this$http;
162
- return (_this$http = this.http) === null || _this$http === void 0 ? void 0 : _this$http.get("services/header?fields=".concat(fields));
163
- }
164
- }, {
165
- key: "render",
166
- value: function render() {
167
- var _this$state = this.state,
168
- services = _this$state.services,
169
- visible = _this$state.visible,
170
- loading = _this$state.loading;
171
- var _this$props = this.props,
172
- auth = _this$props.auth,
173
- props = _objectWithoutProperties(_this$props, _excluded);
174
- if (!visible) {
175
- return null;
111
+ componentDidMount() {
112
+ var _this$getServices2;
113
+ const {
114
+ auth
115
+ } = this.props;
116
+ this.http = new HTTP(auth, auth.getAPIPath());
117
+ (_this$getServices2 = this.getServices(SmartServices.countFields)) === null || _this$getServices2 === void 0 || _this$getServices2.then(services => {
118
+ if (!services.length) {
119
+ this.setState({
120
+ visible: false
121
+ });
176
122
  }
177
- return /*#__PURE__*/jsx(Services, _objectSpread2(_objectSpread2({}, props), {}, {
178
- clientId: auth.config.clientId,
179
- initShown: true,
180
- loading: loading,
181
- onClick: this.getServicesContent,
182
- services: services
183
- }));
123
+ }).catch(noop);
124
+ }
125
+ getServices(fields) {
126
+ var _this$http;
127
+ return (_this$http = this.http) === null || _this$http === void 0 ? void 0 : _this$http.get("services/header?fields=".concat(fields));
128
+ }
129
+ render() {
130
+ const {
131
+ services,
132
+ visible,
133
+ loading
134
+ } = this.state;
135
+ const _this$props = this.props,
136
+ {
137
+ auth
138
+ } = _this$props,
139
+ props = _objectWithoutProperties(_this$props, _excluded);
140
+ if (!visible) {
141
+ return null;
184
142
  }
185
- }]);
186
- }(Component);
143
+ return /*#__PURE__*/jsx(Services, _objectSpread2(_objectSpread2({}, props), {}, {
144
+ clientId: auth.config.clientId,
145
+ initShown: true,
146
+ loading: loading,
147
+ onClick: this.getServicesContent,
148
+ services: services
149
+ }));
150
+ }
151
+ }
187
152
  _defineProperty(SmartServices, "propTypes", {
188
153
  auth: PropTypes.instanceOf(Auth).isRequired
189
154
  });
@@ -1,39 +1,30 @@
1
- import { _ as _defineProperty, a as _inherits, b as _createClass, c as _objectWithoutProperties, d as _objectSpread2, e as _classCallCheck, f as _callSuper } from '../_helpers/_rollupPluginBabelHelpers.js';
2
- import 'core-js/modules/es.array.map.js';
3
- import { Children, Component } from 'react';
1
+ import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
2
+ import { Component, Children } from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import classNames from 'classnames';
6
5
  import { m as modules_47759f5e } from '../_helpers/header.js';
7
6
  import { jsx } from 'react/jsx-runtime';
8
7
 
9
- var _excluded = ["children", "className"];
10
- var wrapChild = function wrapChild(child) {
11
- return child && /*#__PURE__*/jsx("div", {
12
- className: modules_47759f5e.trayItem,
13
- children: child
14
- });
15
- };
16
- var Tray = /*#__PURE__*/function (_Component) {
17
- function Tray() {
18
- _classCallCheck(this, Tray);
19
- return _callSuper(this, Tray, arguments);
8
+ const _excluded = ["children", "className"];
9
+ const wrapChild = child => child && /*#__PURE__*/jsx("div", {
10
+ className: modules_47759f5e.trayItem,
11
+ children: child
12
+ });
13
+ class Tray extends Component {
14
+ render() {
15
+ const _this$props = this.props,
16
+ {
17
+ children,
18
+ className
19
+ } = _this$props,
20
+ restProps = _objectWithoutProperties(_this$props, _excluded);
21
+ const classes = classNames(modules_47759f5e.tray, className);
22
+ return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
23
+ className: classes,
24
+ children: Children.map(children, wrapChild)
25
+ }));
20
26
  }
21
- _inherits(Tray, _Component);
22
- return _createClass(Tray, [{
23
- key: "render",
24
- value: function render() {
25
- var _this$props = this.props,
26
- children = _this$props.children,
27
- className = _this$props.className,
28
- restProps = _objectWithoutProperties(_this$props, _excluded);
29
- var classes = classNames(modules_47759f5e.tray, className);
30
- return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
31
- className: classes,
32
- children: Children.map(children, wrapChild)
33
- }));
34
- }
35
- }]);
36
- }(Component);
27
+ }
37
28
  _defineProperty(Tray, "propTypes", {
38
29
  className: PropTypes.string,
39
30
  children: PropTypes.node