@jetbrains/ring-ui-built 7.0.65 → 7.0.70
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/anchor.js +12 -17
- package/components/_helpers/avatar-info.js +4 -5
- package/components/_helpers/button.classes.js +20 -21
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +26 -32
- package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
- package/components/_helpers/icon-svg.js +9 -12
- package/components/_helpers/input.js +78 -86
- package/components/_helpers/loader-core.js +260 -0
- package/components/_helpers/query-assist-suggestions.js +0 -1
- package/components/_helpers/select-filter.js +19 -26
- package/components/_helpers/services-link.js +9 -12
- package/components/_helpers/sidebar.js +36 -44
- package/components/_helpers/tab-link.js +9 -11
- package/components/_helpers/theme.js +20 -24
- package/components/_helpers/title.js +12 -17
- package/components/alert/alert.js +41 -49
- package/components/alert/container.js +9 -12
- package/components/alert-service/alert-service.js +23 -32
- package/components/analytics/analytics-custom-plugin.js +12 -17
- package/components/analytics/analytics.js +1 -3
- package/components/auth/auth-core.js +128 -170
- package/components/auth/auth.js +3 -10
- package/components/auth/background-flow.js +5 -8
- package/components/auth/down-notification.js +9 -17
- package/components/auth/iframe-flow.js +13 -19
- package/components/auth/request-builder.js +4 -9
- package/components/auth/response-parser.js +9 -12
- package/components/auth/storage.js +12 -18
- package/components/auth/token-validator.js +19 -30
- package/components/auth/window-flow.js +22 -27
- package/components/auth-dialog/auth-dialog.js +40 -48
- package/components/auth-dialog-service/auth-dialog-service.js +10 -13
- package/components/avatar/avatar.figma.js +6 -6
- package/components/avatar/avatar.js +58 -59
- package/components/avatar/fallback-avatar.js +8 -11
- package/components/avatar-stack/avatar-stack.figma.js +10 -11
- package/components/avatar-stack/avatar-stack.js +25 -31
- package/components/banner/banner.js +0 -6
- package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
- package/components/breadcrumbs/breadcrumbs.js +4 -5
- package/components/button/button.figma.js +15 -10
- package/components/button/button.js +59 -64
- package/components/button-group/button-group.js +11 -15
- package/components/button-group/caption.js +0 -1
- package/components/button-set/button-set.js +9 -12
- package/components/button-toolbar/button-toolbar.js +8 -11
- package/components/caret/caret.js +20 -28
- package/components/checkbox/checkbox-group.figma.js +8 -10
- package/components/checkbox/checkbox.figma.js +5 -5
- package/components/checkbox/checkbox.js +27 -35
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/clipboard/clipboard.js +3 -16
- package/components/code/code.js +8 -14
- package/components/collapse/collapse-content.js +10 -15
- package/components/collapse/collapse-control.js +5 -7
- package/components/collapse/collapse.js +9 -11
- package/components/collapse/utils.js +1 -1
- package/components/confirm/confirm.js +17 -26
- package/components/confirm-service/confirm-service.js +30 -31
- package/components/content-layout/content-layout.js +21 -28
- package/components/content-layout/sidebar.js +0 -2
- package/components/contenteditable/contenteditable.js +23 -28
- package/components/control-help/control-help.js +8 -10
- package/components/control-label/control-label.js +12 -17
- package/components/data-list/data-list.js +57 -65
- package/components/data-list/data-list.mock.js +0 -4
- package/components/data-list/item.js +65 -72
- package/components/data-list/selection.js +11 -19
- package/components/data-list/title.js +0 -4
- package/components/date-picker/consts.js +3 -4
- package/components/date-picker/date-input.js +25 -33
- package/components/date-picker/date-picker.js +179 -193
- package/components/date-picker/date-popup.js +135 -127
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +24 -30
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.js +16 -22
- package/components/date-picker/month.js +3 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +0 -1
- package/components/date-picker/years.js +20 -26
- package/components/dialog/dialog-body-scroll-preventer.js +0 -1
- package/components/dialog/dialog.js +73 -83
- package/components/dropdown/anchor.js +0 -4
- package/components/dropdown/dropdown.js +98 -114
- package/components/dropdown-menu/dropdown-menu.js +80 -79
- package/components/editable-heading/editable-heading.js +48 -54
- package/components/error-bubble/error-bubble.figma.js +4 -4
- package/components/error-bubble/error-bubble.js +9 -13
- package/components/error-message/error-message.js +1 -6
- package/components/footer/footer.js +11 -15
- package/components/global/compose-refs.js +1 -4
- package/components/global/compose.js +1 -4
- package/components/global/configuration.js +3 -3
- package/components/global/controls-height.js +0 -1
- package/components/global/create-stateful-context.js +10 -14
- package/components/global/data-tests.js +2 -10
- package/components/global/dom.js +6 -19
- package/components/global/focus-sensor-hoc.js +74 -87
- package/components/global/fuzzy-highlight.js +3 -8
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +5 -6
- package/components/global/listeners.js +2 -11
- package/components/global/memoize.js +0 -2
- package/components/global/normalize-indent.js +2 -6
- package/components/global/promise-with-timeout.js +4 -5
- package/components/global/react-dom-renderer.js +4 -9
- package/components/global/rerender-hoc.js +8 -11
- package/components/global/schedule-raf.js +1 -2
- package/components/global/theme.js +0 -5
- package/components/global/trivial-template-tag.js +1 -6
- package/components/global/url.js +2 -6
- package/components/global/use-event-callback.js +2 -3
- package/components/grid/col.js +7 -18
- package/components/grid/grid.js +9 -14
- package/components/grid/row.js +7 -11
- package/components/group/group.js +9 -12
- package/components/header/header-icon.js +8 -13
- package/components/header/header.js +16 -27
- package/components/header/links.js +7 -10
- package/components/header/logo.js +12 -16
- package/components/header/profile.js +73 -83
- package/components/header/services-link.js +0 -2
- package/components/header/services.js +32 -43
- package/components/header/smart-profile.js +44 -59
- package/components/header/smart-services.js +33 -45
- package/components/header/tray.js +8 -10
- package/components/heading/heading.js +27 -27
- package/components/http/http.js +120 -125
- package/components/http/http.mock.js +6 -10
- package/components/hub-source/hub-source-user.js +6 -13
- package/components/hub-source/hub-source-users-groups.js +8 -12
- package/components/hub-source/hub-source.js +8 -10
- package/components/i18n/i18n-context.js +4 -7
- package/components/i18n/i18n.js +5 -5
- package/components/icon/icon-svg.js +0 -4
- package/components/icon/icon.js +28 -32
- package/components/icon/index.js +0 -4
- package/components/input/input.figma.js +8 -8
- package/components/input/input.js +0 -4
- package/components/island/adaptive-island-hoc.js +19 -23
- package/components/island/content.js +70 -75
- package/components/island/header.js +21 -21
- package/components/island/island.js +11 -14
- package/components/link/clickable-link.js +30 -37
- package/components/link/link.js +27 -29
- package/components/list/list-custom.js +6 -11
- package/components/list/list-item.js +49 -56
- package/components/list/list-separator.js +0 -1
- package/components/list/list-title.js +0 -1
- package/components/list/list-users-groups-source.js +14 -22
- package/components/list/list.classes.js +8 -9
- package/components/list/list.js +387 -404
- package/components/loader/loader-core.js +2 -265
- package/components/loader/loader.d.ts +8 -0
- package/components/loader/loader.js +43 -29
- package/components/loader-inline/loader-inline.js +9 -12
- package/components/loader-screen/loader-screen.js +10 -14
- package/components/login-dialog/login-dialog.js +46 -54
- package/components/login-dialog/service.js +13 -15
- package/components/message/message.js +65 -79
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
- package/components/old-browsers-message/old-browsers-message.js +1 -4
- package/components/old-browsers-message/white-list.js +5 -7
- package/components/pager/pager.js +73 -88
- package/components/panel/panel.js +9 -12
- package/components/permissions/permissions-cache.js +6 -8
- package/components/permissions/permissions.js +19 -21
- package/components/popup/popup.js +136 -145
- package/components/popup/popup.target.js +8 -10
- package/components/popup/position-css.js +19 -27
- package/components/popup/position.js +22 -28
- package/components/popup-menu/popup-menu.js +27 -37
- package/components/progress-bar/progress-bar.js +26 -32
- package/components/query-assist/query-assist-suggestions.js +0 -6
- package/components/query-assist/query-assist.js +432 -468
- package/components/radio/radio-item.js +30 -40
- package/components/radio/radio.js +6 -10
- package/components/scrollable-section/scrollable-section.js +7 -10
- package/components/select/select-filter.js +0 -6
- package/components/select/select-popup.js +155 -174
- package/components/select/select.js +464 -479
- package/components/shortcuts/core.js +40 -45
- package/components/shortcuts/shortcut-title.js +0 -1
- package/components/shortcuts/shortcuts-hoc.js +9 -15
- package/components/shortcuts/shortcuts.js +3 -5
- package/components/slider/slider.js +53 -66
- package/components/slider/slider.utils.js +1 -4
- package/components/storage/storage-local.js +2 -8
- package/components/storage/storage.js +0 -5
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +21 -30
- package/components/table/cell.js +3 -4
- package/components/table/disable-hover-hoc.js +24 -28
- package/components/table/header-cell.js +30 -38
- package/components/table/header.js +20 -28
- package/components/table/multitable.js +81 -101
- package/components/table/row-with-focus-sensor.js +17 -28
- package/components/table/row.js +89 -99
- package/components/table/selection-adapter.js +0 -2
- package/components/table/selection-shortcuts-hoc.js +159 -161
- package/components/table/selection.js +23 -31
- package/components/table/simple-table.js +16 -22
- package/components/table/smart-table.js +19 -26
- package/components/table/table.js +137 -146
- package/components/tabs/collapsible-more.js +34 -47
- package/components/tabs/collapsible-tab.js +28 -33
- package/components/tabs/collapsible-tabs.js +18 -26
- package/components/tabs/custom-item.js +3 -6
- package/components/tabs/dumb-tabs.js +48 -64
- package/components/tabs/smart-tabs.js +14 -23
- package/components/tabs/tab-link.js +0 -2
- package/components/tabs/tab.js +0 -1
- package/components/tabs/tabs.js +0 -7
- package/components/tag/tag.js +30 -35
- package/components/tags-input/tags-input.js +192 -218
- package/components/tags-list/tags-list.js +26 -31
- package/components/text/text.js +16 -19
- package/components/toggle/toggle.js +19 -23
- package/components/tooltip/tooltip.js +110 -121
- package/components/upload/upload.js +19 -28
- package/components/user-agreement/service.js +247 -252
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +23 -32
- package/components/user-card/card.js +0 -5
- package/components/user-card/smart-user-card-tooltip.js +41 -50
- package/components/user-card/tooltip.js +32 -38
- package/components/user-card/user-card.js +0 -5
- package/package.json +9 -3
- package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
|
@@ -1,265 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { getPixelRatio } from '../global/dom.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
var styles = {"canvas":"ring-loader-canvas","animate":"ring-loader-animate","rotation-keyframes":"ring-loader-rotation-keyframes","text":"ring-loader-text"};
|
|
7
|
-
|
|
8
|
-
const INITIAL_TICKS = 100;
|
|
9
|
-
class Particle {
|
|
10
|
-
constructor(_ref) {
|
|
11
|
-
let {
|
|
12
|
-
x,
|
|
13
|
-
y,
|
|
14
|
-
radius,
|
|
15
|
-
color
|
|
16
|
-
} = _ref;
|
|
17
|
-
_defineProperty(this, "radius", void 0);
|
|
18
|
-
_defineProperty(this, "x", void 0);
|
|
19
|
-
_defineProperty(this, "y", void 0);
|
|
20
|
-
_defineProperty(this, "color", void 0);
|
|
21
|
-
_defineProperty(this, "decay", void 0);
|
|
22
|
-
_defineProperty(this, "life", void 0);
|
|
23
|
-
this.radius = radius;
|
|
24
|
-
this.x = x;
|
|
25
|
-
this.y = y;
|
|
26
|
-
this.color = color;
|
|
27
|
-
this.decay = 0.01;
|
|
28
|
-
this.life = 1;
|
|
29
|
-
}
|
|
30
|
-
step() {
|
|
31
|
-
this.life -= this.decay;
|
|
32
|
-
}
|
|
33
|
-
isAlive() {
|
|
34
|
-
return this.life >= 0;
|
|
35
|
-
}
|
|
36
|
-
draw(ctx) {
|
|
37
|
-
const alpha = this.life >= 0 ? this.life : 0;
|
|
38
|
-
ctx.fillStyle = "rgba(".concat(this.color.r, ", ").concat(this.color.g, ", ").concat(this.color.b, ", ").concat(alpha, ")");
|
|
39
|
-
ctx.beginPath();
|
|
40
|
-
ctx.arc(this.x + this.radius, this.y + this.radius, this.radius, 0, Math.PI * 2);
|
|
41
|
-
ctx.fill();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const DETERMINISTIC_VALUE = 0.5;
|
|
45
|
-
function deterministic() {
|
|
46
|
-
return DETERMINISTIC_VALUE;
|
|
47
|
-
}
|
|
48
|
-
class LoaderCore {
|
|
49
|
-
static calculateGradient(startColor, stopColor, position) {
|
|
50
|
-
const calculateChannelValue = (a, b) => a + Math.round((b - a) * position);
|
|
51
|
-
return {
|
|
52
|
-
r: calculateChannelValue(startColor.r, stopColor.r),
|
|
53
|
-
g: calculateChannelValue(startColor.g, stopColor.g),
|
|
54
|
-
b: calculateChannelValue(startColor.b, stopColor.b)
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
constructor(containerNode, props) {
|
|
58
|
-
var _this$ctx;
|
|
59
|
-
_defineProperty(this, "props", void 0);
|
|
60
|
-
_defineProperty(this, "canvas", void 0);
|
|
61
|
-
_defineProperty(this, "textNode", void 0);
|
|
62
|
-
_defineProperty(this, "ctx", void 0);
|
|
63
|
-
_defineProperty(this, "height", void 0);
|
|
64
|
-
_defineProperty(this, "width", void 0);
|
|
65
|
-
_defineProperty(this, "particles", void 0);
|
|
66
|
-
_defineProperty(this, "baseSpeed", void 0);
|
|
67
|
-
_defineProperty(this, "colorIndex", void 0);
|
|
68
|
-
_defineProperty(this, "maxRadius", void 0);
|
|
69
|
-
_defineProperty(this, "minRadius", void 0);
|
|
70
|
-
_defineProperty(this, "colorChangeTick", void 0);
|
|
71
|
-
_defineProperty(this, "x", void 0);
|
|
72
|
-
_defineProperty(this, "y", void 0);
|
|
73
|
-
_defineProperty(this, "radius", void 0);
|
|
74
|
-
_defineProperty(this, "hSpeed", void 0);
|
|
75
|
-
_defineProperty(this, "vSpeed", void 0);
|
|
76
|
-
_defineProperty(this, "radiusSpeed", void 0);
|
|
77
|
-
_defineProperty(this, "tick", void 0);
|
|
78
|
-
_defineProperty(this, "isRunning", void 0);
|
|
79
|
-
this.props = Object.assign({}, LoaderCore.defaultProps, props);
|
|
80
|
-
this.canvas = document.createElement('canvas');
|
|
81
|
-
this.canvas.dataset.test = 'ring-loader';
|
|
82
|
-
this.canvas.classList.add(styles.canvas);
|
|
83
|
-
this.textNode = document.createElement('div');
|
|
84
|
-
this.textNode.dataset.test = 'ring-loader-text';
|
|
85
|
-
this.textNode.classList.add(styles.text);
|
|
86
|
-
this.textNode.textContent = this.props.message ? this.props.message : '';
|
|
87
|
-
containerNode.appendChild(this.canvas);
|
|
88
|
-
containerNode.appendChild(this.textNode);
|
|
89
|
-
const pixelRatio = LoaderCore.getPixelRatio();
|
|
90
|
-
const canvasSize = this.props.size * pixelRatio;
|
|
91
|
-
this.canvas.width = canvasSize;
|
|
92
|
-
this.canvas.height = canvasSize;
|
|
93
|
-
//Fixate canvas physical size to avoid real size scaling
|
|
94
|
-
this.canvas.style.width = "".concat(this.props.size, "px");
|
|
95
|
-
this.canvas.style.height = "".concat(this.props.size, "px");
|
|
96
|
-
this.ctx = this.canvas.getContext('2d');
|
|
97
|
-
(_this$ctx = this.ctx) === null || _this$ctx === void 0 || _this$ctx.scale(pixelRatio, pixelRatio);
|
|
98
|
-
this.height = this.props.size;
|
|
99
|
-
this.width = this.props.size;
|
|
100
|
-
this.particles = [];
|
|
101
|
-
//Configuration
|
|
102
|
-
this.baseSpeed = 1.0;
|
|
103
|
-
this.colorIndex = 0;
|
|
104
|
-
this.maxRadius = 10;
|
|
105
|
-
this.minRadius = 6;
|
|
106
|
-
this.colorChangeTick = 40;
|
|
107
|
-
//State
|
|
108
|
-
this.x = 0;
|
|
109
|
-
this.y = 0;
|
|
110
|
-
this.radius = 8;
|
|
111
|
-
this.hSpeed = 1.5;
|
|
112
|
-
this.vSpeed = 0.5;
|
|
113
|
-
this.radiusSpeed = 0.05;
|
|
114
|
-
this.tick = 0;
|
|
115
|
-
this.prepareInitialState(INITIAL_TICKS);
|
|
116
|
-
this.isRunning = !this.props.stop;
|
|
117
|
-
if (this.isRunning) {
|
|
118
|
-
this.startAnimation();
|
|
119
|
-
} else {
|
|
120
|
-
this.draw();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
static getPixelRatio() {
|
|
124
|
-
return getPixelRatio();
|
|
125
|
-
}
|
|
126
|
-
prepareInitialState(ticks) {
|
|
127
|
-
for (let i = 0; i < ticks; i++) {
|
|
128
|
-
this.step();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
handleLimits(coord, radius, speed, limit) {
|
|
132
|
-
const randomFunc = this.props.deterministic ? deterministic : Math.random;
|
|
133
|
-
const randomizedSpeedChange = randomFunc() - this.baseSpeed / 2;
|
|
134
|
-
if (coord + radius * 2 + this.baseSpeed >= limit) {
|
|
135
|
-
return -(this.baseSpeed + randomizedSpeedChange);
|
|
136
|
-
}
|
|
137
|
-
if (coord <= this.baseSpeed) {
|
|
138
|
-
return this.baseSpeed + randomizedSpeedChange;
|
|
139
|
-
}
|
|
140
|
-
return speed;
|
|
141
|
-
}
|
|
142
|
-
calculateNextCoordinates() {
|
|
143
|
-
this.x += this.hSpeed;
|
|
144
|
-
this.y += this.vSpeed;
|
|
145
|
-
this.hSpeed = this.handleLimits(this.x, this.radius, this.hSpeed, this.width);
|
|
146
|
-
this.vSpeed = this.handleLimits(this.y, this.radius, this.vSpeed, this.height);
|
|
147
|
-
}
|
|
148
|
-
calculateNextRadius() {
|
|
149
|
-
this.radius += this.radiusSpeed;
|
|
150
|
-
if (this.radius > this.maxRadius || this.radius < this.minRadius) {
|
|
151
|
-
this.radiusSpeed = -this.radiusSpeed;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
getNextColor() {
|
|
155
|
-
const colors = this.props.colors;
|
|
156
|
-
const currentColor = colors[this.colorIndex];
|
|
157
|
-
const nextColor = colors[this.colorIndex + 1] || colors[0];
|
|
158
|
-
return LoaderCore.calculateGradient(currentColor, nextColor, this.tick / this.colorChangeTick);
|
|
159
|
-
}
|
|
160
|
-
nextTick() {
|
|
161
|
-
this.tick++;
|
|
162
|
-
if (this.tick > this.colorChangeTick) {
|
|
163
|
-
this.tick = 0;
|
|
164
|
-
this.colorIndex++;
|
|
165
|
-
if (this.colorIndex > this.props.colors.length - 1) {
|
|
166
|
-
this.colorIndex = 0;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
step() {
|
|
171
|
-
this.nextTick();
|
|
172
|
-
this.calculateNextCoordinates();
|
|
173
|
-
this.calculateNextRadius();
|
|
174
|
-
this.particles.forEach(particle => particle.step());
|
|
175
|
-
this.particles.push(new Particle({
|
|
176
|
-
x: this.x,
|
|
177
|
-
y: this.y,
|
|
178
|
-
radius: this.radius,
|
|
179
|
-
color: this.getNextColor()
|
|
180
|
-
}));
|
|
181
|
-
}
|
|
182
|
-
removeDeadParticles() {
|
|
183
|
-
this.particles = this.particles.filter(it => it.isAlive());
|
|
184
|
-
}
|
|
185
|
-
draw() {
|
|
186
|
-
const ctx = this.ctx;
|
|
187
|
-
if (ctx === null) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
ctx.clearRect(0, 0, this.width, this.height);
|
|
191
|
-
this.removeDeadParticles();
|
|
192
|
-
this.particles.forEach(particle => particle.draw(ctx));
|
|
193
|
-
}
|
|
194
|
-
loop() {
|
|
195
|
-
this.step();
|
|
196
|
-
this.draw();
|
|
197
|
-
if (this.isRunning) {
|
|
198
|
-
window.requestAnimationFrame(() => this.loop());
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
updateMessage(text) {
|
|
202
|
-
this.textNode.textContent = text || '';
|
|
203
|
-
}
|
|
204
|
-
stopAnimation() {
|
|
205
|
-
this.isRunning = false;
|
|
206
|
-
this.canvas.classList.remove(styles.animate);
|
|
207
|
-
}
|
|
208
|
-
startAnimation() {
|
|
209
|
-
this.isRunning = true;
|
|
210
|
-
this.canvas.classList.add(styles.animate);
|
|
211
|
-
this.loop();
|
|
212
|
-
}
|
|
213
|
-
destroy() {
|
|
214
|
-
this.isRunning = false;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
_defineProperty(LoaderCore, "defaultProps", {
|
|
218
|
-
size: 64,
|
|
219
|
-
stop: false,
|
|
220
|
-
deterministic: false,
|
|
221
|
-
colors: [{
|
|
222
|
-
r: 215,
|
|
223
|
-
g: 60,
|
|
224
|
-
b: 234
|
|
225
|
-
},
|
|
226
|
-
//#D73CEA
|
|
227
|
-
{
|
|
228
|
-
r: 145,
|
|
229
|
-
g: 53,
|
|
230
|
-
b: 224
|
|
231
|
-
},
|
|
232
|
-
//#9135E0
|
|
233
|
-
{
|
|
234
|
-
r: 88,
|
|
235
|
-
g: 72,
|
|
236
|
-
b: 224
|
|
237
|
-
},
|
|
238
|
-
//#5848F4
|
|
239
|
-
{
|
|
240
|
-
r: 37,
|
|
241
|
-
g: 183,
|
|
242
|
-
b: 255
|
|
243
|
-
},
|
|
244
|
-
//#25B7FF
|
|
245
|
-
{
|
|
246
|
-
r: 89,
|
|
247
|
-
g: 189,
|
|
248
|
-
b: 0
|
|
249
|
-
},
|
|
250
|
-
//#59BD00
|
|
251
|
-
{
|
|
252
|
-
r: 251,
|
|
253
|
-
g: 172,
|
|
254
|
-
b: 2
|
|
255
|
-
},
|
|
256
|
-
//#FBAC02
|
|
257
|
-
{
|
|
258
|
-
r: 227,
|
|
259
|
-
g: 37,
|
|
260
|
-
b: 129
|
|
261
|
-
} //#E32581
|
|
262
|
-
]
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
export { LoaderCore as default };
|
|
1
|
+
import '../global/dom.js';
|
|
2
|
+
export { L as default } from '../_helpers/loader-core.js';
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { type HTMLAttributes, PureComponent } from 'react';
|
|
2
2
|
import LoaderCore, { type LoaderCoreProps } from './loader-core';
|
|
3
|
+
declare module 'csstype' {
|
|
4
|
+
interface Properties {
|
|
5
|
+
'--ring-loader-color-1'?: string;
|
|
6
|
+
'--ring-loader-color-2'?: string;
|
|
7
|
+
'--ring-loader-color-3'?: string;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
3
10
|
export interface LoaderProps extends Partial<LoaderCoreProps>, HTMLAttributes<HTMLElement> {
|
|
4
11
|
'data-test'?: string | null | undefined;
|
|
12
|
+
squares?: boolean;
|
|
5
13
|
}
|
|
6
14
|
/**
|
|
7
15
|
* @name Loader
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
|
-
import
|
|
6
|
-
import 'core
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { L as LoaderCore, s as styles } from '../_helpers/loader-core.js';
|
|
7
5
|
import '../global/dom.js';
|
|
8
6
|
|
|
9
|
-
const _excluded = ["message", "size", "colors", "data-test", "stop", "deterministic"];
|
|
10
7
|
/**
|
|
11
8
|
* @name Loader
|
|
12
9
|
*/
|
|
@@ -14,15 +11,6 @@ const _excluded = ["message", "size", "colors", "data-test", "stop", "determinis
|
|
|
14
11
|
* Displays a large animated loader with an optional caption. Typical use cases: page loading animation, major action animation.
|
|
15
12
|
*/
|
|
16
13
|
class Loader extends PureComponent {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
_defineProperty(this, "loader", void 0);
|
|
20
|
-
_defineProperty(this, "initLoader", el => {
|
|
21
|
-
if (el) {
|
|
22
|
-
this.loader = new LoaderCore(el, this.props);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
14
|
componentDidUpdate(prevProps) {
|
|
27
15
|
if (this.loader) {
|
|
28
16
|
if (!prevProps.stop && this.props.stop) {
|
|
@@ -33,23 +21,49 @@ class Loader extends PureComponent {
|
|
|
33
21
|
}
|
|
34
22
|
}
|
|
35
23
|
componentWillUnmount() {
|
|
36
|
-
|
|
37
|
-
(_this$loader = this.loader) === null || _this$loader === void 0 || _this$loader.destroy();
|
|
24
|
+
this.loader?.destroy();
|
|
38
25
|
}
|
|
26
|
+
loader;
|
|
27
|
+
initLoader = el => {
|
|
28
|
+
if (el) {
|
|
29
|
+
this.loader = new LoaderCore(el, this.props);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
39
32
|
render() {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return
|
|
33
|
+
const {
|
|
34
|
+
message,
|
|
35
|
+
size,
|
|
36
|
+
colors,
|
|
37
|
+
'data-test': dataTest,
|
|
38
|
+
stop,
|
|
39
|
+
deterministic,
|
|
40
|
+
squares,
|
|
41
|
+
...restProps
|
|
42
|
+
} = this.props;
|
|
43
|
+
return squares ? jsxs("div", {
|
|
44
|
+
...restProps,
|
|
45
|
+
children: [jsxs("div", {
|
|
46
|
+
className: classNames(styles.canvas, styles.squares),
|
|
47
|
+
style: {
|
|
48
|
+
'--ring-loader-color-1': colors?.[0] ? `rgb(${colors[0].r}, ${colors[0].g}, ${colors[0].b})` : undefined,
|
|
49
|
+
'--ring-loader-color-2': colors?.[1] ? `rgb(${colors[1].r}, ${colors[1].g}, ${colors[1].b})` : undefined,
|
|
50
|
+
'--ring-loader-color-3': colors?.[2] ? `rgb(${colors[2].r}, ${colors[2].g}, ${colors[2].b})` : undefined
|
|
51
|
+
},
|
|
52
|
+
children: [jsx("div", {
|
|
53
|
+
className: classNames(styles.square, styles.outer)
|
|
54
|
+
}), jsx("div", {
|
|
55
|
+
className: classNames(styles.square, styles.middle)
|
|
56
|
+
}), jsx("div", {
|
|
57
|
+
className: classNames(styles.square, styles.inner)
|
|
58
|
+
})]
|
|
59
|
+
}), message && jsx("div", {
|
|
60
|
+
className: styles.text,
|
|
61
|
+
children: message
|
|
62
|
+
})]
|
|
63
|
+
}) : jsx("div", {
|
|
64
|
+
...restProps,
|
|
51
65
|
ref: this.initLoader
|
|
52
|
-
})
|
|
66
|
+
});
|
|
53
67
|
}
|
|
54
68
|
}
|
|
55
69
|
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
6
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
5
|
|
|
8
6
|
var styles = {"loader":"ring-loader-inline-loader","spin":"ring-loader-inline-spin","pulse":"ring-loader-inline-pulse","children":"ring-loader-inline-children"};
|
|
9
7
|
|
|
10
|
-
const _excluded = ["className", "data-test", "children"];
|
|
11
8
|
/**
|
|
12
9
|
* @name Loader Inline
|
|
13
10
|
*/
|
|
14
11
|
class LoaderInline extends PureComponent {
|
|
15
12
|
render() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
13
|
+
const {
|
|
14
|
+
className,
|
|
15
|
+
'data-test': dataTest,
|
|
16
|
+
children,
|
|
17
|
+
...restProps
|
|
18
|
+
} = this.props;
|
|
23
19
|
const classes = classNames(styles.loader, className);
|
|
24
|
-
const loader = jsx("div",
|
|
20
|
+
const loader = jsx("div", {
|
|
21
|
+
...restProps,
|
|
25
22
|
"data-test": joinDataTestAttributes('ring-loader-inline', dataTest),
|
|
26
23
|
className: classes
|
|
27
|
-
})
|
|
24
|
+
});
|
|
28
25
|
return children ? jsxs(Fragment, {
|
|
29
26
|
children: [loader, jsx("span", {
|
|
30
27
|
className: styles.children,
|
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import Loader from '../loader/loader.js';
|
|
6
|
-
import '
|
|
7
|
-
import '../loader/loader-core.js';
|
|
8
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
5
|
+
import '../_helpers/loader-core.js';
|
|
9
6
|
import '../global/dom.js';
|
|
10
7
|
|
|
11
8
|
var styles = {"loaderScreen":"ring-loader-screen-loaderScreen","loader":"ring-loader-screen-loader","loaderWithoutSpacing":"ring-loader-screen-loaderWithoutSpacing"};
|
|
12
9
|
|
|
13
|
-
const _excluded = ["message", "className", "containerClassName"];
|
|
14
10
|
/**
|
|
15
11
|
* @name Loader Screen
|
|
16
12
|
*/
|
|
17
13
|
class LoaderScreen extends PureComponent {
|
|
18
14
|
render() {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
15
|
+
const {
|
|
16
|
+
message,
|
|
17
|
+
className,
|
|
18
|
+
containerClassName,
|
|
19
|
+
...restProps
|
|
20
|
+
} = this.props;
|
|
26
21
|
const containerClasses = classNames(containerClassName, styles.loaderScreen);
|
|
27
22
|
const loaderClasses = classNames(className, styles.loader, {
|
|
28
23
|
[styles.loaderWithoutSpacing]: !message
|
|
29
24
|
});
|
|
30
25
|
return jsx("div", {
|
|
31
26
|
className: containerClasses,
|
|
32
|
-
children: jsx(Loader,
|
|
27
|
+
children: jsx(Loader, {
|
|
28
|
+
...restProps,
|
|
33
29
|
message: message,
|
|
34
30
|
className: loaderClasses
|
|
35
|
-
})
|
|
31
|
+
})
|
|
36
32
|
});
|
|
37
33
|
}
|
|
38
34
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { Component } from 'react';
|
|
5
3
|
import Dialog from '../dialog/dialog.js';
|
|
6
4
|
import 'classnames';
|
|
7
5
|
import '../_helpers/island.js';
|
|
8
|
-
import '../island/header.js';
|
|
9
6
|
import ContentWrapper from '../island/content.js';
|
|
10
7
|
import LoaderScreen from '../loader-screen/loader-screen.js';
|
|
11
8
|
import { HUB_AUTH_PAGE_OPENED } from '../auth/background-flow.js';
|
|
@@ -15,12 +12,12 @@ import '../island/island.js';
|
|
|
15
12
|
import '../global/data-tests.js';
|
|
16
13
|
import '../island/adaptive-island-hoc.js';
|
|
17
14
|
import '../global/linear-function.js';
|
|
15
|
+
import '../island/header.js';
|
|
18
16
|
import 'element-resize-detector';
|
|
19
17
|
import '../global/schedule-raf.js';
|
|
20
18
|
import '../global/get-uid.js';
|
|
21
19
|
import '../shortcuts/shortcuts.js';
|
|
22
20
|
import '../shortcuts/core.js';
|
|
23
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
24
21
|
import 'combokeys';
|
|
25
22
|
import '../global/sniffer.js';
|
|
26
23
|
import 'sniffr';
|
|
@@ -33,7 +30,6 @@ import 'util-deprecate';
|
|
|
33
30
|
import '../icon/icon.js';
|
|
34
31
|
import '../icon/icon.constants.js';
|
|
35
32
|
import '../_helpers/icon-svg.js';
|
|
36
|
-
import 'core-js/modules/es.string.replace.js';
|
|
37
33
|
import '../global/memoize.js';
|
|
38
34
|
import '../link/clickable-link.js';
|
|
39
35
|
import '../global/controls-height.js';
|
|
@@ -42,13 +38,12 @@ import '../_helpers/button.classes.js';
|
|
|
42
38
|
import '../popup/popup.target.js';
|
|
43
39
|
import '../popup/popup.js';
|
|
44
40
|
import '../popup/position.js';
|
|
45
|
-
import 'core-js/modules/es.array.sort.js';
|
|
46
41
|
import '../popup/popup.consts.js';
|
|
47
42
|
import '../popup/position-css.js';
|
|
48
43
|
import '../_helpers/dialog-body-scroll-preventer.js';
|
|
49
44
|
import 'scrollbar-width';
|
|
50
45
|
import '../loader/loader.js';
|
|
51
|
-
import '../
|
|
46
|
+
import '../_helpers/loader-core.js';
|
|
52
47
|
import '../auth/response-parser.js';
|
|
53
48
|
import '../global/url.js';
|
|
54
49
|
|
|
@@ -63,47 +58,19 @@ const DEFAULT_SHOW_FALLBACK_TIMEOUT = 5000;
|
|
|
63
58
|
* @name Login Dialog
|
|
64
59
|
*/
|
|
65
60
|
class LoginDialog extends Component {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} = event;
|
|
80
|
-
if (!data) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (data === HUB_AUTH_PAGE_OPENED) {
|
|
84
|
-
clearTimeout(this.showFallbackTimout);
|
|
85
|
-
this.setState({
|
|
86
|
-
loading: false,
|
|
87
|
-
loggingIn: false
|
|
88
|
-
});
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (data === HUB_AUTH_PAGE_LOGIN_STARTED) {
|
|
92
|
-
this.setState({
|
|
93
|
-
loading: true,
|
|
94
|
-
loggingIn: true
|
|
95
|
-
});
|
|
96
|
-
this.startFallbackCountdown();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (data.message === HUB_AUTH_PAGE_LOGIN_DIMENSIONS) {
|
|
100
|
-
this.setState({
|
|
101
|
-
height: data.height,
|
|
102
|
-
width: data.width
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
61
|
+
static defaultProps = {
|
|
62
|
+
show: false,
|
|
63
|
+
url: 'about:blank',
|
|
64
|
+
renderFallbackLink: () => null,
|
|
65
|
+
showFallbackTimeout: DEFAULT_SHOW_FALLBACK_TIMEOUT
|
|
66
|
+
};
|
|
67
|
+
state = {
|
|
68
|
+
loading: true,
|
|
69
|
+
loggingIn: false,
|
|
70
|
+
showFallbackLink: false,
|
|
71
|
+
height: DEFAULT_HEIGHT,
|
|
72
|
+
width: DEFAULT_WIDTH
|
|
73
|
+
};
|
|
107
74
|
componentDidMount() {
|
|
108
75
|
window.addEventListener('message', this.onMessage);
|
|
109
76
|
this.startFallbackCountdown();
|
|
@@ -111,11 +78,42 @@ class LoginDialog extends Component {
|
|
|
111
78
|
componentWillUnmount() {
|
|
112
79
|
window.removeEventListener('message', this.onMessage);
|
|
113
80
|
}
|
|
81
|
+
showFallbackTimout;
|
|
114
82
|
startFallbackCountdown() {
|
|
115
83
|
this.showFallbackTimout = window.setTimeout(() => this.setState({
|
|
116
84
|
showFallbackLink: true
|
|
117
85
|
}), this.props.showFallbackTimeout);
|
|
118
86
|
}
|
|
87
|
+
onMessage = event => {
|
|
88
|
+
const {
|
|
89
|
+
data
|
|
90
|
+
} = event;
|
|
91
|
+
if (!data) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (data === HUB_AUTH_PAGE_OPENED) {
|
|
95
|
+
clearTimeout(this.showFallbackTimout);
|
|
96
|
+
this.setState({
|
|
97
|
+
loading: false,
|
|
98
|
+
loggingIn: false
|
|
99
|
+
});
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (data === HUB_AUTH_PAGE_LOGIN_STARTED) {
|
|
103
|
+
this.setState({
|
|
104
|
+
loading: true,
|
|
105
|
+
loggingIn: true
|
|
106
|
+
});
|
|
107
|
+
this.startFallbackCountdown();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (data.message === HUB_AUTH_PAGE_LOGIN_DIMENSIONS) {
|
|
111
|
+
this.setState({
|
|
112
|
+
height: data.height,
|
|
113
|
+
width: data.width
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
};
|
|
119
117
|
render() {
|
|
120
118
|
const {
|
|
121
119
|
show,
|
|
@@ -163,11 +161,5 @@ class LoginDialog extends Component {
|
|
|
163
161
|
});
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
|
-
_defineProperty(LoginDialog, "defaultProps", {
|
|
167
|
-
show: false,
|
|
168
|
-
url: 'about:blank',
|
|
169
|
-
renderFallbackLink: () => null,
|
|
170
|
-
showFallbackTimeout: DEFAULT_SHOW_FALLBACK_TIMEOUT
|
|
171
|
-
});
|
|
172
164
|
|
|
173
165
|
export { LoginDialog as default };
|