@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.
- package/components/_helpers/_rollupPluginBabelHelpers.js +1 -504
- package/components/_helpers/anchor.js +7 -5
- package/components/_helpers/button__classes.js +15 -13
- package/components/_helpers/caption.js +11 -17
- package/components/_helpers/card.js +92 -96
- package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
- package/components/_helpers/header.js +1 -1
- package/components/_helpers/icon__svg.js +27 -23
- package/components/_helpers/input.js +150 -171
- package/components/_helpers/query-assist__suggestions.js +78 -93
- package/components/_helpers/select__filter.js +56 -67
- package/components/_helpers/services-link.js +23 -29
- package/components/_helpers/sidebar.js +91 -93
- package/components/_helpers/tab-link.js +8 -6
- package/components/_helpers/theme.js +55 -51
- package/components/_helpers/title.js +59 -69
- package/components/alert/alert.js +112 -156
- package/components/alert/container.js +32 -39
- package/components/alert-service/alert-service.js +104 -161
- package/components/analytics/analytics.js +12 -20
- package/components/analytics/analytics__custom-plugin.js +52 -68
- package/components/auth/auth.js +2 -27
- package/components/auth/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +742 -1428
- package/components/auth/background-flow.js +84 -121
- package/components/auth/down-notification.js +31 -69
- package/components/auth/iframe-flow.js +70 -123
- package/components/auth/request-builder.js +46 -77
- package/components/auth/response-parser.js +84 -112
- package/components/auth/storage.js +160 -318
- package/components/auth/token-validator.js +132 -227
- package/components/auth/window-flow.js +84 -121
- package/components/auth-dialog/auth-dialog.js +99 -150
- package/components/auth-dialog-service/auth-dialog-service.js +6 -26
- package/components/avatar/avatar-example-datauri.js +1 -1
- package/components/avatar/avatar.js +94 -123
- package/components/avatar/fallback-avatar.js +20 -34
- package/components/badge/badge.js +32 -38
- package/components/breadcrumbs/breadcrumbs.js +13 -17
- package/components/button/button.js +67 -80
- package/components/button-group/button-group.js +27 -36
- package/components/button-set/button-set.js +19 -27
- package/components/button-toolbar/button-toolbar.js +17 -25
- package/components/caret/caret.js +184 -211
- package/components/checkbox/checkbox.js +69 -86
- package/components/clipboard/clipboard-fallback.js +7 -7
- package/components/clipboard/clipboard.js +36 -128
- package/components/code/code.js +83 -151
- package/components/collapse/collapse-content.js +42 -60
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -12
- package/components/collapse/collapse.js +12 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +57 -87
- package/components/confirm-service/confirm-service.js +23 -44
- package/components/content-layout/content-layout.js +41 -56
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.js +38 -46
- package/components/control-help/control-help.js +5 -3
- package/components/control-label/control-label.js +9 -8
- package/components/data-list/data-list.js +113 -156
- package/components/data-list/data-list.mock.js +3 -5
- package/components/data-list/item.js +120 -140
- package/components/data-list/selection.js +77 -135
- package/components/data-list/title.js +2 -10
- package/components/date-picker/consts.js +16 -22
- package/components/date-picker/date-input.js +99 -124
- package/components/date-picker/date-picker.js +140 -184
- package/components/date-picker/date-popup.js +280 -327
- package/components/date-picker/day.js +71 -94
- package/components/date-picker/month-names.js +41 -59
- package/components/date-picker/month-slider.js +42 -61
- package/components/date-picker/month.js +17 -24
- package/components/date-picker/months.js +44 -49
- package/components/date-picker/weekdays.js +12 -21
- package/components/date-picker/years.js +77 -98
- package/components/dialog/dialog.js +151 -187
- package/components/dialog/dialog__body-scroll-preventer.js +0 -3
- package/components/dropdown/anchor.js +0 -6
- package/components/dropdown/dropdown.js +134 -154
- package/components/dropdown-menu/dropdown-menu.js +59 -87
- package/components/editable-heading/editable-heading.js +69 -116
- package/components/error-bubble/error-bubble.js +29 -54
- package/components/error-message/error-message.js +34 -49
- package/components/footer/footer.js +27 -28
- package/components/global/compose.js +1 -8
- package/components/global/composeRefs.d.ts +0 -3
- package/components/global/composeRefs.js +8 -15
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +14 -13
- package/components/global/data-tests.js +7 -12
- package/components/global/dom.js +49 -82
- package/components/global/focus-sensor-hoc.js +99 -106
- package/components/global/fuzzy-highlight.js +23 -34
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +3 -7
- package/components/global/inject-styles.js +7 -14
- package/components/global/listeners.js +28 -47
- package/components/global/memoize.js +6 -10
- package/components/global/normalize-indent.js +19 -46
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +29 -40
- package/components/global/rerender-hoc.js +16 -32
- package/components/global/schedule-raf.js +4 -4
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.d.ts +3 -0
- package/components/global/theme.js +2 -19
- package/components/global/trivial-template-tag.js +4 -9
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -23
- package/components/global/use-event-callback.js +7 -4
- package/components/grid/col.js +27 -39
- package/components/grid/grid.js +18 -27
- package/components/grid/row.js +23 -30
- package/components/group/group.js +16 -22
- package/components/header/header-icon.js +19 -31
- package/components/header/header.d.ts +0 -1
- package/components/header/header.js +30 -64
- package/components/header/links.d.ts +2 -0
- package/components/header/links.js +20 -0
- package/components/header/logo.js +15 -26
- package/components/header/profile.js +124 -150
- package/components/header/services-link.js +1 -3
- package/components/header/services.js +64 -97
- package/components/header/smart-profile.js +101 -178
- package/components/header/smart-services.js +55 -90
- package/components/header/tray.js +21 -30
- package/components/heading/heading.js +21 -20
- package/components/http/http.js +162 -319
- package/components/http/http.mock.js +50 -98
- package/components/hub-source/hub-source.js +77 -182
- package/components/hub-source/hub-source__user.js +9 -37
- package/components/hub-source/hub-source__users-groups.js +34 -60
- package/components/i18n/i18n-context.js +7 -8
- package/components/i18n/i18n.js +3 -6
- package/components/icon/icon.js +60 -74
- package/components/icon/icon__svg.js +0 -5
- package/components/icon/index.js +0 -5
- package/components/input/input.js +1 -11
- package/components/island/adaptive-island-hoc.js +29 -37
- package/components/island/content.js +100 -110
- package/components/island/header.js +56 -66
- package/components/island/island.js +25 -33
- package/components/island-legacy/content-legacy.js +16 -22
- package/components/island-legacy/header-legacy.js +19 -25
- package/components/island-legacy/island-legacy.js +16 -22
- package/components/link/clickableLink.js +33 -42
- package/components/link/link.js +47 -55
- package/components/list/consts.js +2 -2
- package/components/list/list.js +399 -486
- package/components/list/list__custom.js +51 -61
- package/components/list/list__hint.js +9 -17
- package/components/list/list__item.js +147 -178
- package/components/list/list__link.js +38 -47
- package/components/list/list__separator.js +15 -24
- package/components/list/list__title.js +25 -34
- package/components/list/list__users-groups-source.js +55 -121
- package/components/loader/loader.js +38 -60
- package/components/loader/loader__core.js +123 -184
- package/components/loader-inline/loader-inline.js +24 -32
- package/components/loader-screen/loader-screen.js +24 -40
- package/components/login-dialog/login-dialog.js +81 -121
- package/components/login-dialog/service.js +6 -29
- package/components/markdown/markdown.js +16 -24
- package/components/message/message.js +170 -201
- package/components/old-browsers-message/old-browsers-message.js +11 -14
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
- package/components/old-browsers-message/white-list.js +8 -13
- package/components/pager/pager.js +212 -257
- package/components/panel/panel.js +16 -22
- package/components/permissions/permissions.js +118 -161
- package/components/permissions/permissions__cache.js +191 -218
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +237 -288
- package/components/popup/popup.target.js +9 -7
- package/components/popup/position.js +94 -101
- package/components/popup-menu/popup-menu.js +33 -67
- package/components/progress-bar/progress-bar.js +57 -68
- package/components/query-assist/query-assist.js +583 -652
- package/components/query-assist/query-assist__suggestions.js +2 -26
- package/components/radio/radio.js +15 -27
- package/components/radio/radio__item.js +52 -62
- package/components/scrollable-section/scrollable-section.js +53 -0
- package/components/select/select.js +701 -796
- package/components/select/select__filter.js +1 -26
- package/components/select/select__popup.js +316 -413
- package/components/shortcuts/core.js +147 -195
- package/components/shortcuts/shortcut-title.js +6 -10
- package/components/shortcuts/shortcuts-hoc.js +23 -41
- package/components/shortcuts/shortcuts.js +41 -64
- package/components/slider/slider.js +93 -112
- package/components/slider/slider.utils.js +16 -23
- package/components/storage/storage.js +3 -27
- package/components/storage/storage__fallback.js +137 -210
- package/components/storage/storage__local.js +89 -147
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +35 -53
- package/components/table/cell.js +11 -21
- package/components/table/disable-hover-hoc.js +27 -42
- package/components/table/header-cell.js +59 -75
- package/components/table/header.js +89 -110
- package/components/table/multitable.js +83 -89
- package/components/table/row-with-focus-sensor.js +25 -57
- package/components/table/row.js +169 -200
- package/components/table/selection-adapter.js +2 -2
- package/components/table/selection-shortcuts-hoc.js +108 -113
- package/components/table/selection.js +150 -217
- package/components/table/simple-table.js +19 -55
- package/components/table/smart-table.js +42 -76
- package/components/table/table.js +267 -327
- package/components/tabs/collapsible-more.js +47 -73
- package/components/tabs/collapsible-tab.js +32 -36
- package/components/tabs/collapsible-tabs.js +89 -148
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +60 -92
- package/components/tabs/smart-tabs.js +29 -61
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tab.js +15 -24
- package/components/tabs/tabs.js +1 -26
- package/components/tag/tag.d.ts +0 -2
- package/components/tag/tag.js +120 -162
- package/components/tags-input/tags-input.js +222 -304
- package/components/tags-list/tags-list.js +45 -61
- package/components/text/text.js +28 -37
- package/components/toggle/toggle.js +51 -61
- package/components/tooltip/tooltip.js +109 -141
- package/components/user-agreement/service.js +259 -400
- package/components/user-agreement/user-agreement.js +80 -108
- package/components/user-card/card.js +1 -25
- package/components/user-card/smart-user-card-tooltip.js +52 -103
- package/components/user-card/tooltip.js +35 -65
- package/components/user-card/user-card.js +1 -25
- package/package.json +1 -1
- package/components/global/react-render-adapter.d.ts +0 -1
- package/components/global/react-render-adapter.js +0 -6
- package/components/header/scrollable-section.js +0 -47
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
- /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
@@ -1,7 +1,7 @@
|
|
1
|
-
import { _ as _defineProperty
|
2
|
-
import 'core-js/modules/es.array.concat.js';
|
1
|
+
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
3
2
|
import 'core-js/modules/es.regexp.exec.js';
|
4
3
|
import 'core-js/modules/es.string.replace.js';
|
4
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
5
5
|
import { Component } from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import classNames from 'classnames';
|
@@ -13,8 +13,6 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
13
|
import ContentWrapper from '../island/content.js';
|
14
14
|
import '../global/data-tests.js';
|
15
15
|
import 'core-js/modules/es.array.reduce.js';
|
16
|
-
import 'core-js/modules/es.object.entries.js';
|
17
|
-
import 'core-js/modules/es.object.to-string.js';
|
18
16
|
import '../island/adaptive-island-hoc.js';
|
19
17
|
import '../global/linear-function.js';
|
20
18
|
import '../_helpers/island.js';
|
@@ -24,28 +22,13 @@ import '../global/schedule-raf.js';
|
|
24
22
|
import 'react-dom';
|
25
23
|
import '@jetbrains/icons/close';
|
26
24
|
import '../global/get-uid.js';
|
27
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
28
25
|
import '../shortcuts/shortcuts.js';
|
29
|
-
import 'core-js/modules/es.array.map.js';
|
30
26
|
import '../shortcuts/core.js';
|
31
|
-
import 'core-js/modules/es.array.find-index.js';
|
32
|
-
import 'core-js/modules/es.array.includes.js';
|
33
|
-
import 'core-js/modules/es.array.slice.js';
|
34
|
-
import 'core-js/modules/es.array.splice.js';
|
35
|
-
import 'core-js/modules/es.object.assign.js';
|
36
|
-
import 'core-js/modules/es.string.includes.js';
|
37
|
-
import 'core-js/modules/es.string.match.js';
|
38
27
|
import 'combokeys';
|
39
28
|
import '../global/sniffer.js';
|
40
29
|
import 'sniffr';
|
41
30
|
import '../tab-trap/tab-trap.js';
|
42
|
-
import 'core-js/modules/es.array.filter.js';
|
43
31
|
import '../global/dom.js';
|
44
|
-
import 'core-js/modules/es.array.iterator.js';
|
45
|
-
import 'core-js/modules/es.set.js';
|
46
|
-
import 'core-js/modules/es.string.split.js';
|
47
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
48
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
49
32
|
import '../popup/popup.target.js';
|
50
33
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
51
34
|
import 'scrollbar-width';
|
@@ -54,10 +37,7 @@ import '../icon/icon.js';
|
|
54
37
|
import 'util-deprecate';
|
55
38
|
import '../icon/icon__constants.js';
|
56
39
|
import '../_helpers/icon__svg.js';
|
57
|
-
import 'core-js/modules/es.string.starts-with.js';
|
58
40
|
import '../global/memoize.js';
|
59
|
-
import 'core-js/modules/es.map.js';
|
60
|
-
import 'core-js/modules/es.weak-map.js';
|
61
41
|
import '../link/clickableLink.js';
|
62
42
|
import '../global/controls-height.js';
|
63
43
|
import '../_helpers/button__classes.js';
|
@@ -65,138 +45,107 @@ import '../_helpers/heading.js';
|
|
65
45
|
|
66
46
|
var modules_ae521deb = {"light":"light_rui_2ac4","dialog":"dialog_rui_e5f9","content":"content_rui_e5f9 font_rui_f295","button":"button_rui_e5f9","firstButton":"firstButton_rui_e5f9 button_rui_e5f9","title":"title_rui_e5f9","logo":"logo_rui_e5f9","error":"error_rui_e5f9"};
|
67
47
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
73
|
-
args[_key] = arguments[_key];
|
74
|
-
}
|
75
|
-
_this = _callSuper(this, AuthDialog, [].concat(args));
|
76
|
-
_defineProperty(_this, "state", {
|
48
|
+
class AuthDialog extends Component {
|
49
|
+
constructor() {
|
50
|
+
super(...arguments);
|
51
|
+
_defineProperty(this, "state", {
|
77
52
|
retrying: false
|
78
53
|
});
|
79
|
-
_defineProperty(
|
80
|
-
if (
|
81
|
-
|
54
|
+
_defineProperty(this, "onEscPress", () => {
|
55
|
+
if (this.props.cancelOnEsc) {
|
56
|
+
this.props.onCancel();
|
57
|
+
}
|
58
|
+
});
|
59
|
+
_defineProperty(this, "onRetryPress", async () => {
|
60
|
+
if (!this.props.onTryAgain || this.state.retrying) {
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
this.setState({
|
64
|
+
retrying: true
|
65
|
+
});
|
66
|
+
try {
|
67
|
+
await this.props.onTryAgain();
|
68
|
+
} catch (e) {
|
69
|
+
// do nothing, error is handled in onTryAgain
|
70
|
+
} finally {
|
71
|
+
this.setState({
|
72
|
+
retrying: false
|
73
|
+
});
|
82
74
|
}
|
83
75
|
});
|
84
|
-
_defineProperty(_this, "onRetryPress", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
85
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
86
|
-
while (1) switch (_context.prev = _context.next) {
|
87
|
-
case 0:
|
88
|
-
if (!(!_this.props.onTryAgain || _this.state.retrying)) {
|
89
|
-
_context.next = 2;
|
90
|
-
break;
|
91
|
-
}
|
92
|
-
return _context.abrupt("return");
|
93
|
-
case 2:
|
94
|
-
_this.setState({
|
95
|
-
retrying: true
|
96
|
-
});
|
97
|
-
_context.prev = 3;
|
98
|
-
_context.next = 6;
|
99
|
-
return _this.props.onTryAgain();
|
100
|
-
case 6:
|
101
|
-
_context.next = 10;
|
102
|
-
break;
|
103
|
-
case 8:
|
104
|
-
_context.prev = 8;
|
105
|
-
_context.t0 = _context["catch"](3);
|
106
|
-
case 10:
|
107
|
-
_context.prev = 10;
|
108
|
-
_this.setState({
|
109
|
-
retrying: false
|
110
|
-
});
|
111
|
-
return _context.finish(10);
|
112
|
-
case 13:
|
113
|
-
case "end":
|
114
|
-
return _context.stop();
|
115
|
-
}
|
116
|
-
}, _callee, null, [[3, 8, 10, 13]]);
|
117
|
-
})));
|
118
|
-
return _this;
|
119
76
|
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
children: tryAgainLabel
|
188
|
-
}), /*#__PURE__*/jsx(Button, {
|
189
|
-
className: modules_ae521deb.button,
|
190
|
-
"data-test": "auth-dialog-cancel-button",
|
191
|
-
onClick: onCancel,
|
192
|
-
children: cancelLabel
|
193
|
-
})]
|
194
|
-
})
|
77
|
+
componentDidMount() {
|
78
|
+
window.addEventListener('online', this.onRetryPress);
|
79
|
+
}
|
80
|
+
componentWillUnmount() {
|
81
|
+
window.removeEventListener('online', this.onRetryPress);
|
82
|
+
}
|
83
|
+
render() {
|
84
|
+
const {
|
85
|
+
show,
|
86
|
+
className,
|
87
|
+
errorMessage,
|
88
|
+
serviceImage,
|
89
|
+
serviceName,
|
90
|
+
loginCaption,
|
91
|
+
loginToCaption,
|
92
|
+
confirmLabel,
|
93
|
+
cancelLabel,
|
94
|
+
tryAgainLabel,
|
95
|
+
onConfirm,
|
96
|
+
onCancel,
|
97
|
+
onTryAgain
|
98
|
+
} = this.props;
|
99
|
+
const {
|
100
|
+
retrying
|
101
|
+
} = this.state;
|
102
|
+
const defaultTitle = serviceName ? loginToCaption : loginCaption;
|
103
|
+
const title = (this.props.title || defaultTitle).replace('%serviceName%', serviceName !== null && serviceName !== void 0 ? serviceName : '').replace('{{serviceName}}', serviceName !== null && serviceName !== void 0 ? serviceName : '');
|
104
|
+
return /*#__PURE__*/jsx(Dialog, {
|
105
|
+
label: title,
|
106
|
+
"data-test": "ring-auth-dialog",
|
107
|
+
className: className,
|
108
|
+
contentClassName: classNames(className, modules_ae521deb.dialog),
|
109
|
+
onEscPress: this.onEscPress,
|
110
|
+
show: show,
|
111
|
+
trapFocus: true,
|
112
|
+
children: /*#__PURE__*/jsx(ContentWrapper, {
|
113
|
+
children: /*#__PURE__*/jsxs("div", {
|
114
|
+
className: modules_ae521deb.content,
|
115
|
+
children: [serviceImage && /*#__PURE__*/jsx("img", {
|
116
|
+
alt: "".concat(serviceName, " logo"),
|
117
|
+
className: modules_ae521deb.logo,
|
118
|
+
src: serviceImage
|
119
|
+
}), /*#__PURE__*/jsx(H2, {
|
120
|
+
className: modules_ae521deb.title,
|
121
|
+
children: title
|
122
|
+
}), errorMessage && /*#__PURE__*/jsx("div", {
|
123
|
+
className: modules_ae521deb.error,
|
124
|
+
children: errorMessage
|
125
|
+
}), /*#__PURE__*/jsx(Button, {
|
126
|
+
primary: true,
|
127
|
+
className: modules_ae521deb.firstButton,
|
128
|
+
"data-test": "auth-dialog-confirm-button",
|
129
|
+
onClick: onConfirm,
|
130
|
+
children: confirmLabel
|
131
|
+
}), onTryAgain && /*#__PURE__*/jsx(Button, {
|
132
|
+
className: modules_ae521deb.button,
|
133
|
+
"data-test": "auth-dialog-retry-button",
|
134
|
+
onClick: () => this.onRetryPress(),
|
135
|
+
loader: retrying,
|
136
|
+
disabled: retrying,
|
137
|
+
children: tryAgainLabel
|
138
|
+
}), /*#__PURE__*/jsx(Button, {
|
139
|
+
className: modules_ae521deb.button,
|
140
|
+
"data-test": "auth-dialog-cancel-button",
|
141
|
+
onClick: onCancel,
|
142
|
+
children: cancelLabel
|
143
|
+
})]
|
195
144
|
})
|
196
|
-
})
|
197
|
-
}
|
198
|
-
}
|
199
|
-
}
|
145
|
+
})
|
146
|
+
});
|
147
|
+
}
|
148
|
+
}
|
200
149
|
_defineProperty(AuthDialog, "propTypes", {
|
201
150
|
className: PropTypes.string,
|
202
151
|
title: PropTypes.string,
|
@@ -222,8 +171,8 @@ _defineProperty(AuthDialog, "defaultProps", {
|
|
222
171
|
cancelOnEsc: true,
|
223
172
|
confirmLabel: 'Log in',
|
224
173
|
cancelLabel: 'Remain a guest',
|
225
|
-
onConfirm:
|
226
|
-
onCancel:
|
174
|
+
onConfirm: () => {},
|
175
|
+
onCancel: () => {}
|
227
176
|
});
|
228
177
|
|
229
178
|
export { AuthDialog as default };
|
@@ -1,19 +1,17 @@
|
|
1
|
-
import {
|
1
|
+
import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import { createRoot } from 'react-dom/client';
|
3
3
|
import { ControlsHeightContext, getGlobalControlsHeight } from '../global/controls-height.js';
|
4
4
|
import AuthDialog from '../auth-dialog/auth-dialog.js';
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
6
6
|
import 'react';
|
7
|
-
import 'core-js/modules/es.array.concat.js';
|
8
7
|
import 'core-js/modules/es.regexp.exec.js';
|
9
8
|
import 'core-js/modules/es.string.replace.js';
|
9
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
10
10
|
import 'prop-types';
|
11
11
|
import 'classnames';
|
12
12
|
import '../island/island.js';
|
13
13
|
import '../global/data-tests.js';
|
14
14
|
import 'core-js/modules/es.array.reduce.js';
|
15
|
-
import 'core-js/modules/es.object.entries.js';
|
16
|
-
import 'core-js/modules/es.object.to-string.js';
|
17
15
|
import '../island/adaptive-island-hoc.js';
|
18
16
|
import '../global/linear-function.js';
|
19
17
|
import '../_helpers/island.js';
|
@@ -25,38 +23,20 @@ import '../dialog/dialog.js';
|
|
25
23
|
import 'react-dom';
|
26
24
|
import '@jetbrains/icons/close';
|
27
25
|
import '../global/get-uid.js';
|
28
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
29
26
|
import '../shortcuts/shortcuts.js';
|
30
|
-
import 'core-js/modules/es.array.map.js';
|
31
27
|
import '../shortcuts/core.js';
|
32
|
-
import 'core-js/modules/es.array.find-index.js';
|
33
|
-
import 'core-js/modules/es.array.includes.js';
|
34
|
-
import 'core-js/modules/es.array.slice.js';
|
35
|
-
import 'core-js/modules/es.array.splice.js';
|
36
|
-
import 'core-js/modules/es.object.assign.js';
|
37
|
-
import 'core-js/modules/es.string.includes.js';
|
38
|
-
import 'core-js/modules/es.string.match.js';
|
39
28
|
import 'combokeys';
|
40
29
|
import '../global/sniffer.js';
|
41
30
|
import 'sniffr';
|
42
31
|
import '../tab-trap/tab-trap.js';
|
43
|
-
import 'core-js/modules/es.array.filter.js';
|
44
32
|
import '../global/dom.js';
|
45
|
-
import 'core-js/modules/es.array.iterator.js';
|
46
|
-
import 'core-js/modules/es.set.js';
|
47
|
-
import 'core-js/modules/es.string.split.js';
|
48
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
49
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
50
33
|
import '../button/button.js';
|
51
34
|
import '@jetbrains/icons/chevron-down';
|
52
35
|
import '../icon/icon.js';
|
53
36
|
import 'util-deprecate';
|
54
37
|
import '../icon/icon__constants.js';
|
55
38
|
import '../_helpers/icon__svg.js';
|
56
|
-
import 'core-js/modules/es.string.starts-with.js';
|
57
39
|
import '../global/memoize.js';
|
58
|
-
import 'core-js/modules/es.map.js';
|
59
|
-
import 'core-js/modules/es.weak-map.js';
|
60
40
|
import '../link/clickableLink.js';
|
61
41
|
import '../_helpers/button__classes.js';
|
62
42
|
import '../popup/popup.target.js';
|
@@ -65,8 +45,8 @@ import 'scrollbar-width';
|
|
65
45
|
import '../heading/heading.js';
|
66
46
|
import '../_helpers/heading.js';
|
67
47
|
|
68
|
-
|
69
|
-
|
48
|
+
const containerElement = document.createElement('div');
|
49
|
+
const reactRoot = createRoot(containerElement);
|
70
50
|
/**
|
71
51
|
* Renders AuthDialog into virtual node to skip maintaining container
|
72
52
|
*/
|
@@ -77,11 +57,11 @@ function renderAuthDialog(props) {
|
|
77
57
|
}));
|
78
58
|
}
|
79
59
|
function showAuthDialog() {
|
80
|
-
|
60
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
81
61
|
renderAuthDialog(_objectSpread2(_objectSpread2({}, props), {}, {
|
82
62
|
show: true
|
83
63
|
}));
|
84
|
-
return
|
64
|
+
return () => {
|
85
65
|
renderAuthDialog({
|
86
66
|
show: false
|
87
67
|
});
|
@@ -1,4 +1,4 @@
|
|
1
1
|
// Taken from https://hub.jetbrains.com/api/rest/avatar/default?username=Jet%20Brains&dpr=2&size=56
|
2
|
-
|
2
|
+
const avatarDataUri = "data:image/svg+xml,".concat(encodeURIComponent("\n<svg viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <linearGradient id=\"gradient\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stop-color=\"#D50F6B\" offset=\"0\"/>\n <stop stop-color=\"#E73AE8\" offset=\"1\"/>\n </linearGradient>\n </defs>\n <g>\n <rect fill=\"url(#gradient)\"\n x=\"0\" y=\"0\" width=\"40\" height=\"40\"\n rx=\"3\" ry=\"3\"/>\n <text x=\"5\" y=\"19\"\n font-family=\"Arial, Helvetica, sans-serif\"\n font-size=\"15px\"\n letter-spacing=\"1\"\n fill=\"#FFFFFF\">\n <tspan>JB</tspan>\n <tspan x=\"6\" y=\"28\">_</tspan>\n </text>\n </g>\n</svg>\n"));
|
3
3
|
|
4
4
|
export { avatarDataUri };
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import 'core-js/modules/
|
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 classNames from 'classnames';
|
@@ -7,28 +7,13 @@ import { isDataURI, parseQueryString, encodeURL } from '../global/url.js';
|
|
7
7
|
import { getPixelRatio } from '../global/dom.js';
|
8
8
|
import FallbackAvatar from './fallback-avatar.js';
|
9
9
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
10
|
-
import 'core-js/modules/es.array.index-of.js';
|
11
10
|
import 'core-js/modules/es.regexp.exec.js';
|
12
|
-
import 'core-js/modules/es.string.match.js';
|
13
11
|
import 'core-js/modules/es.string.replace.js';
|
14
|
-
import 'core-js/modules/es.array.filter.js';
|
15
|
-
import 'core-js/modules/es.array.iterator.js';
|
16
|
-
import 'core-js/modules/es.object.assign.js';
|
17
|
-
import 'core-js/modules/es.object.entries.js';
|
18
|
-
import 'core-js/modules/es.object.to-string.js';
|
19
|
-
import 'core-js/modules/es.set.js';
|
20
|
-
import 'core-js/modules/es.string.split.js';
|
21
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
22
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
23
|
-
import 'core-js/modules/es.array.from.js';
|
24
|
-
import 'core-js/modules/es.array.map.js';
|
25
|
-
import 'core-js/modules/es.array.slice.js';
|
26
12
|
import '../global/get-uid.js';
|
27
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
28
13
|
|
29
14
|
var modules_61ca8c75 = {"light":"light_rui_2ac4","avatar":"avatar_rui_006c","subavatar":"subavatar_rui_006c","empty":"empty_rui_006c"};
|
30
15
|
|
31
|
-
|
16
|
+
const _excluded = ["size", "url", "dpr", "style", "round", "subavatar", "subavatarSize", "username", "skipParams"];
|
32
17
|
var Size;
|
33
18
|
(function (Size) {
|
34
19
|
Size[Size["Size18"] = 18] = "Size18";
|
@@ -40,126 +25,112 @@ var Size;
|
|
40
25
|
Size[Size["Size48"] = 48] = "Size48";
|
41
26
|
Size[Size["Size56"] = 56] = "Size56";
|
42
27
|
})(Size || (Size = {}));
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
48
|
-
args[_key] = arguments[_key];
|
49
|
-
}
|
50
|
-
_this = _callSuper(this, Avatar, [].concat(args));
|
51
|
-
_defineProperty(_this, "state", {
|
28
|
+
class Avatar extends PureComponent {
|
29
|
+
constructor() {
|
30
|
+
super(...arguments);
|
31
|
+
_defineProperty(this, "state", {
|
52
32
|
errorUrl: ''
|
53
33
|
});
|
54
|
-
_defineProperty(
|
55
|
-
|
56
|
-
errorUrl:
|
34
|
+
_defineProperty(this, "handleError", () => {
|
35
|
+
this.setState({
|
36
|
+
errorUrl: this.props.url
|
57
37
|
});
|
58
38
|
});
|
59
|
-
_defineProperty(
|
60
|
-
|
39
|
+
_defineProperty(this, "handleSuccess", () => {
|
40
|
+
this.setState({
|
61
41
|
errorUrl: ''
|
62
42
|
});
|
63
43
|
});
|
64
|
-
return _this;
|
65
44
|
}
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
var _queryParams = _objectSpread2(_objectSpread2({}, parseQueryString(_query)), {}, {
|
127
|
-
dpr,
|
128
|
-
subavatarSizeString
|
129
|
-
});
|
130
|
-
subavatarSrc = skipParams ? subavatar : encodeURL(_urlStart, _queryParams);
|
131
|
-
return /*#__PURE__*/jsxs("div", {
|
132
|
-
children: [/*#__PURE__*/jsx("img", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
133
|
-
onError: this.handleError,
|
134
|
-
onLoad: this.handleSuccess,
|
135
|
-
className: classNames(modules_61ca8c75.avatar, this.props.className),
|
136
|
-
style: styleObj,
|
137
|
-
src: src,
|
138
|
-
alt: "User avatar"
|
139
|
-
})), /*#__PURE__*/jsx("img", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
140
|
-
"data-test": "avatar",
|
141
|
-
onError: this.handleError,
|
142
|
-
onLoad: this.handleSuccess,
|
143
|
-
className: classNames(modules_61ca8c75.subavatar),
|
144
|
-
style: styleObjGroup,
|
145
|
-
src: subavatarSrc,
|
146
|
-
alt: "Subavatar"
|
147
|
-
}))]
|
148
|
-
});
|
149
|
-
} else {
|
150
|
-
return /*#__PURE__*/jsx("img", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
151
|
-
"data-test": "avatar",
|
45
|
+
render() {
|
46
|
+
const _this$props = this.props,
|
47
|
+
{
|
48
|
+
size,
|
49
|
+
url,
|
50
|
+
dpr,
|
51
|
+
style,
|
52
|
+
round,
|
53
|
+
subavatar,
|
54
|
+
subavatarSize,
|
55
|
+
username,
|
56
|
+
skipParams
|
57
|
+
} = _this$props,
|
58
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
59
|
+
const sizeString = "".concat(size, "px");
|
60
|
+
const subavatarSizeString = "".concat(subavatarSize, "px");
|
61
|
+
const borderRadius = size <= Size.Size18 ? 'var(--ring-border-radius-small)' : 'var(--ring-border-radius)';
|
62
|
+
const styleObj = _objectSpread2({
|
63
|
+
borderRadius: round ? '50%' : borderRadius,
|
64
|
+
height: sizeString,
|
65
|
+
width: sizeString
|
66
|
+
}, style);
|
67
|
+
const styleObjGroup = _objectSpread2({
|
68
|
+
borderRadius: '2px',
|
69
|
+
height: subavatarSizeString,
|
70
|
+
width: subavatarSizeString
|
71
|
+
}, style);
|
72
|
+
if (!url || this.state.errorUrl === url) {
|
73
|
+
return /*#__PURE__*/jsx("span", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
74
|
+
"data-test": "avatar",
|
75
|
+
className: classNames(modules_61ca8c75.avatar, this.props.className, {
|
76
|
+
[modules_61ca8c75.empty]: username == null
|
77
|
+
}),
|
78
|
+
style: styleObj,
|
79
|
+
children: username != null && /*#__PURE__*/jsx(FallbackAvatar, {
|
80
|
+
size: size,
|
81
|
+
round: round,
|
82
|
+
username: username
|
83
|
+
})
|
84
|
+
}));
|
85
|
+
}
|
86
|
+
let src = url;
|
87
|
+
if (!skipParams && !isDataURI(url)) {
|
88
|
+
const [urlStart, query] = url.split('?');
|
89
|
+
const queryParams = _objectSpread2(_objectSpread2({}, parseQueryString(query)), {}, {
|
90
|
+
dpr,
|
91
|
+
size
|
92
|
+
});
|
93
|
+
src = encodeURL(urlStart, queryParams);
|
94
|
+
}
|
95
|
+
let subavatarSrc = null;
|
96
|
+
if (subavatar && !isDataURI(subavatar)) {
|
97
|
+
const [urlStart, query] = subavatar.split('?');
|
98
|
+
const queryParams = _objectSpread2(_objectSpread2({}, parseQueryString(query)), {}, {
|
99
|
+
dpr,
|
100
|
+
subavatarSizeString
|
101
|
+
});
|
102
|
+
subavatarSrc = skipParams ? subavatar : encodeURL(urlStart, queryParams);
|
103
|
+
return /*#__PURE__*/jsxs("div", {
|
104
|
+
children: [/*#__PURE__*/jsx("img", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
152
105
|
onError: this.handleError,
|
153
106
|
onLoad: this.handleSuccess,
|
154
107
|
className: classNames(modules_61ca8c75.avatar, this.props.className),
|
155
108
|
style: styleObj,
|
156
109
|
src: src,
|
157
110
|
alt: "User avatar"
|
158
|
-
}))
|
159
|
-
|
111
|
+
})), /*#__PURE__*/jsx("img", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
112
|
+
"data-test": "avatar",
|
113
|
+
onError: this.handleError,
|
114
|
+
onLoad: this.handleSuccess,
|
115
|
+
className: classNames(modules_61ca8c75.subavatar),
|
116
|
+
style: styleObjGroup,
|
117
|
+
src: subavatarSrc,
|
118
|
+
alt: "Subavatar"
|
119
|
+
}))]
|
120
|
+
});
|
121
|
+
} else {
|
122
|
+
return /*#__PURE__*/jsx("img", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
123
|
+
"data-test": "avatar",
|
124
|
+
onError: this.handleError,
|
125
|
+
onLoad: this.handleSuccess,
|
126
|
+
className: classNames(modules_61ca8c75.avatar, this.props.className),
|
127
|
+
style: styleObj,
|
128
|
+
src: src,
|
129
|
+
alt: "User avatar"
|
130
|
+
}));
|
160
131
|
}
|
161
|
-
}
|
162
|
-
}
|
132
|
+
}
|
133
|
+
}
|
163
134
|
_defineProperty(Avatar, "propTypes", {
|
164
135
|
dpr: PropTypes.number,
|
165
136
|
className: PropTypes.string,
|