@jetbrains/ring-ui 5.0.35 → 5.0.37
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/date-picker/date-popup.js +3 -1
- package/components/editable-heading/editable-heading.css +69 -0
- package/components/editable-heading/editable-heading.d.ts +21 -0
- package/components/editable-heading/editable-heading.js +34 -0
- package/components/input/input.css +2 -0
- package/components/query-assist/query-assist.js +1 -1
- package/dist/_helpers/_rollupPluginBabelHelpers.js +0 -4
- package/dist/_helpers/anchor.js +0 -1
- package/dist/_helpers/card.js +0 -3
- package/dist/_helpers/dialog__body-scroll-preventer.js +0 -11
- package/dist/_helpers/footer.js +2 -13
- package/dist/_helpers/query-assist__suggestions.js +0 -10
- package/dist/_helpers/select__filter.js +0 -11
- package/dist/_helpers/services-link.js +0 -2
- package/dist/_helpers/sidebar.js +0 -12
- package/dist/_helpers/theme.js +0 -3
- package/dist/_helpers/title.js +0 -9
- package/dist/alert/alert.js +2 -32
- package/dist/alert/container.js +0 -5
- package/dist/alert-service/alert-service.js +0 -26
- package/dist/analytics/analytics.js +0 -22
- package/dist/analytics/analytics__custom-plugin.js +0 -38
- package/dist/analytics/analytics__fus-plugin.js +0 -20
- package/dist/analytics/analytics__ga-plugin.js +0 -13
- package/dist/analytics/analytics__plugin-utils.js +0 -8
- package/dist/analytics-ng/analytics-ng.js +3 -9
- package/dist/auth/auth.js +2 -3
- package/dist/auth/auth__core.js +30 -243
- package/dist/auth/background-flow.js +2 -25
- package/dist/auth/down-notification.js +0 -7
- package/dist/auth/iframe-flow.js +2 -26
- package/dist/auth/landing.js +2 -6
- package/dist/auth/request-builder.js +0 -11
- package/dist/auth/response-parser.js +4 -26
- package/dist/auth/storage.js +4 -60
- package/dist/auth/token-validator.js +6 -42
- package/dist/auth/window-flow.js +2 -34
- package/dist/auth-dialog/auth-dialog.js +2 -12
- package/dist/auth-dialog-service/auth-dialog-service.js +2 -4
- package/dist/auth-ng/auth-ng.js +6 -22
- package/dist/auth-ng/auth-ng.mock.js +0 -4
- package/dist/autofocus-ng/autofocus-ng.js +0 -5
- package/dist/avatar/avatar.js +4 -17
- package/dist/avatar/fallback-avatar.js +2 -9
- package/dist/avatar-editor-ng/avatar-editor-ng.js +1 -17
- package/dist/badge/badge.js +0 -3
- package/dist/button/button.js +0 -8
- package/dist/button-group/button-group.js +0 -3
- package/dist/button-group/caption.js +0 -2
- package/dist/button-group-ng/button-group-ng.js +0 -4
- package/dist/button-ng/button-ng.js +3 -21
- package/dist/button-set/button-set.js +0 -3
- package/dist/button-set-ng/button-set-ng.js +0 -2
- package/dist/button-toolbar/button-toolbar.js +0 -3
- package/dist/button-toolbar-ng/button-toolbar-ng.js +0 -2
- package/dist/caret/caret.js +2 -53
- package/dist/checkbox/checkbox.js +0 -12
- package/dist/code/code.js +3 -25
- package/dist/compiler-ng/compiler-ng.js +0 -5
- package/dist/confirm/confirm.js +0 -6
- package/dist/confirm-service/confirm-service.js +10 -8
- package/dist/content-layout/content-layout.js +0 -7
- package/dist/contenteditable/contenteditable.js +6 -13
- package/dist/data-list/data-list.js +4 -28
- package/dist/data-list/item.js +0 -15
- package/dist/data-list/selection.js +0 -27
- package/dist/date-picker/consts.js +0 -7
- package/dist/date-picker/date-input.js +0 -20
- package/dist/date-picker/date-picker.js +2 -36
- package/dist/date-picker/date-popup.js +21 -72
- package/dist/date-picker/day.js +0 -14
- package/dist/date-picker/month-names.js +0 -9
- package/dist/date-picker/month-slider.js +0 -10
- package/dist/date-picker/month.js +2 -4
- package/dist/date-picker/months.js +6 -13
- package/dist/date-picker/years.js +0 -14
- package/dist/dialog/dialog.js +0 -19
- package/dist/dialog-ng/dialog-ng.js +17 -105
- package/dist/docked-panel-ng/docked-panel-ng.js +6 -29
- package/dist/dropdown/dropdown.js +2 -33
- package/dist/dropdown-menu/dropdown-menu.js +4 -8
- package/dist/editable-heading/editable-heading.d.ts +21 -0
- package/dist/editable-heading/editable-heading.js +85 -0
- package/dist/error-bubble/error-bubble.js +2 -4
- package/dist/error-message/error-message.js +0 -3
- package/dist/footer-ng/footer-ng.js +0 -13
- package/dist/form-ng/form-ng.js +1 -21
- package/dist/global/angular-component-factory.js +0 -10
- package/dist/global/compose.js +0 -1
- package/dist/global/composeRefs.js +0 -1
- package/dist/global/controls-height.js +0 -2
- package/dist/global/create-stateful-context.js +0 -5
- package/dist/global/data-tests.js +0 -4
- package/dist/global/dom.js +2 -11
- package/dist/global/focus-sensor-hoc.js +4 -33
- package/dist/global/fuzzy-highlight.js +2 -16
- package/dist/global/get-event-key.js +8 -17
- package/dist/global/get-uid.js +0 -2
- package/dist/global/linear-function.js +0 -2
- package/dist/global/listeners.js +0 -13
- package/dist/global/memoize.js +0 -2
- package/dist/global/normalize-indent.js +2 -5
- package/dist/global/react-dom-renderer.js +0 -8
- package/dist/global/react-render-adapter.js +0 -7
- package/dist/global/rerender-hoc.js +0 -7
- package/dist/global/ring-angular-component.js +0 -5
- package/dist/global/schedule-raf.js +0 -5
- package/dist/global/trivial-template-tag.js +2 -3
- package/dist/global/url.js +0 -27
- package/dist/grid/col.js +0 -4
- package/dist/grid/grid.js +0 -3
- package/dist/grid/row.js +0 -5
- package/dist/group/group.js +0 -3
- package/dist/header/header.js +0 -5
- package/dist/header/logo.js +0 -4
- package/dist/header/profile.js +0 -7
- package/dist/header/services.js +0 -11
- package/dist/header/smart-profile.js +4 -18
- package/dist/header/smart-services.js +0 -17
- package/dist/header/tray-icon.js +2 -3
- package/dist/header/tray.js +0 -3
- package/dist/heading/heading.js +0 -5
- package/dist/http/http.js +20 -65
- package/dist/http/http.mock.js +2 -14
- package/dist/hub-source/hub-source.js +0 -32
- package/dist/hub-source/hub-source__user.js +0 -1
- package/dist/hub-source/hub-source__users-groups.js +0 -12
- package/dist/icon/icon.js +0 -13
- package/dist/icon/icon__constants.js +0 -4
- package/dist/icon/icon__svg.js +0 -10
- package/dist/icon-ng/icon-ng.js +2 -7
- package/dist/input/input.js +0 -30
- package/dist/input-ng/input-ng.js +0 -17
- package/dist/island/adaptive-island-hoc.js +0 -7
- package/dist/island/content.js +0 -25
- package/dist/island/header.js +0 -7
- package/dist/island/island.js +0 -4
- package/dist/island-legacy/content-legacy.js +0 -2
- package/dist/island-legacy/header-legacy.js +0 -2
- package/dist/island-legacy/island-legacy.js +0 -2
- package/dist/island-ng/island-content-ng.js +0 -3
- package/dist/link/clickableLink.js +2 -10
- package/dist/link/link.js +2 -9
- package/dist/link-ng/link-ng.js +0 -2
- package/dist/list/consts.js +0 -4
- package/dist/list/list.js +6 -128
- package/dist/list/list__custom.js +0 -4
- package/dist/list/list__hint.js +0 -3
- package/dist/list/list__item.js +0 -8
- package/dist/list/list__link.js +2 -3
- package/dist/list/list__separator.js +0 -1
- package/dist/list/list__title.js +0 -1
- package/dist/list/list__users-groups-source.js +4 -17
- package/dist/loader/loader.js +0 -10
- package/dist/loader/loader__core.js +6 -70
- package/dist/loader-inline/loader-inline.js +0 -3
- package/dist/loader-ng/loader-ng.js +0 -7
- package/dist/loader-screen/loader-screen.js +0 -3
- package/dist/loader-screen-ng/loader-screen-ng.js +2 -14
- package/dist/login-dialog/login-dialog.js +0 -15
- package/dist/login-dialog/service.js +2 -4
- package/dist/markdown/code.js +0 -2
- package/dist/markdown/heading.js +0 -1
- package/dist/markdown/link.js +0 -1
- package/dist/markdown/markdown.js +0 -2
- package/dist/message/message.js +0 -24
- package/dist/message-bundle-ng/message-bundle-ng.js +2 -45
- package/dist/old-browsers-message/old-browsers-message.js +2 -21
- package/dist/old-browsers-message/white-list.js +2 -6
- package/dist/pager/pager.js +2 -39
- package/dist/panel/panel.js +0 -3
- package/dist/permissions/permissions.js +1 -43
- package/dist/permissions/permissions__cache.js +12 -63
- package/dist/permissions-ng/permissions-ng.js +11 -19
- package/dist/place-under-ng/place-under-ng.js +0 -19
- package/dist/popup/popup.consts.js +0 -11
- package/dist/popup/popup.js +6 -68
- package/dist/popup/position.js +8 -30
- package/dist/popup-menu/popup-menu.js +4 -13
- package/dist/progress-bar/progress-bar.js +0 -14
- package/dist/promised-click-ng/promised-click-ng.js +3 -22
- package/dist/query-assist/query-assist.js +17 -201
- package/dist/radio/radio.js +0 -6
- package/dist/radio/radio__item.js +0 -9
- package/dist/radio-ng/radio-ng.js +0 -4
- package/dist/save-field-ng/save-field-ng.js +1 -37
- package/dist/select/select.js +18 -208
- package/dist/select/select__popup.js +4 -76
- package/dist/select-ng/select-ng.js +18 -74
- package/dist/select-ng/select-ng__lazy.js +2 -17
- package/dist/select-ng/select-ng__options.js +3 -29
- package/dist/shortcuts/core.js +4 -56
- package/dist/shortcuts/shortcuts-hoc.js +0 -4
- package/dist/shortcuts/shortcuts.js +0 -10
- package/dist/shortcuts-hint-ng/shortcuts-hint-ng.js +0 -13
- package/dist/shortcuts-ng/shortcuts-ng.js +16 -46
- package/dist/sidebar-ng/sidebar-ng.js +2 -12
- package/dist/storage/storage.js +2 -5
- package/dist/storage/storage__fallback.js +2 -48
- package/dist/storage/storage__local.js +0 -23
- package/dist/style.css +1 -1
- package/dist/tab-trap/tab-trap.js +0 -37
- package/dist/table/cell.js +0 -2
- package/dist/table/disable-hover-hoc.js +0 -9
- package/dist/table/header-cell.js +0 -8
- package/dist/table/header.js +0 -16
- package/dist/table/multitable.js +0 -23
- package/dist/table/row-with-focus-sensor.js +0 -12
- package/dist/table/row.js +0 -18
- package/dist/table/selection-adapter.js +0 -2
- package/dist/table/selection-shortcuts-hoc.js +8 -42
- package/dist/table/selection.js +0 -50
- package/dist/table/smart-table.js +0 -9
- package/dist/table/table.js +6 -37
- package/dist/table-legacy-ng/table-legacy-ng.js +12 -42
- package/dist/table-legacy-ng/table-legacy-ng__selection-navigate-actions.js +0 -31
- package/dist/table-legacy-ng/table-legacy-ng__selection.js +0 -32
- package/dist/table-legacy-ng/table-legacy-ng__toolbar.js +2 -5
- package/dist/tabs/collapsible-more.js +0 -5
- package/dist/tabs/collapsible-tab.js +0 -4
- package/dist/tabs/collapsible-tabs.js +8 -28
- package/dist/tabs/dumb-tabs.js +0 -8
- package/dist/tabs/smart-tabs.js +0 -6
- package/dist/tabs/tab-link.js +0 -1
- package/dist/tabs/tab.js +0 -2
- package/dist/tabs-ng/tabs-ng.js +13 -29
- package/dist/tag/tag.js +0 -24
- package/dist/tags-input/tags-input.js +0 -76
- package/dist/tags-list/tags-list.js +0 -6
- package/dist/template-ng/template-ng.js +0 -12
- package/dist/text/text.js +0 -3
- package/dist/theme-ng/theme-ng.js +0 -8
- package/dist/title-ng/title-ng.js +6 -17
- package/dist/toggle/toggle.js +0 -4
- package/dist/tooltip/tooltip.js +4 -35
- package/dist/tooltip-ng/tooltip-ng.js +2 -8
- package/dist/user-agreement/service.js +0 -62
- package/dist/user-agreement/user-agreement.js +0 -8
- package/dist/user-card/smart-user-card-tooltip.js +2 -8
- package/dist/user-card/tooltip.js +0 -3
- package/package.json +22 -22
package/dist/alert/alert.js
CHANGED
|
@@ -44,14 +44,11 @@ const ANIMATION_TIME = 500;
|
|
|
44
44
|
/**
|
|
45
45
|
* @name Alert
|
|
46
46
|
*/
|
|
47
|
-
|
|
48
47
|
/**
|
|
49
48
|
* List of available alert types.
|
|
50
49
|
* @enum {string}
|
|
51
50
|
*/
|
|
52
|
-
|
|
53
51
|
var AlertType;
|
|
54
|
-
|
|
55
52
|
(function (AlertType) {
|
|
56
53
|
AlertType["ERROR"] = "error";
|
|
57
54
|
AlertType["MESSAGE"] = "message";
|
|
@@ -63,8 +60,6 @@ var AlertType;
|
|
|
63
60
|
* Lookup table of alert type to icon modifier.
|
|
64
61
|
* @type {Object.<AlertType, string>}
|
|
65
62
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
63
|
const TypeToIcon = {
|
|
69
64
|
[AlertType.ERROR]: exceptionIcon,
|
|
70
65
|
[AlertType.SUCCESS]: checkmarkIcon,
|
|
@@ -74,7 +69,6 @@ const TypeToIcon = {
|
|
|
74
69
|
* Lookup table of alert type to icon color.
|
|
75
70
|
* @type {Object.<AlertType, Icon.Color>}
|
|
76
71
|
*/
|
|
77
|
-
|
|
78
72
|
const TypeToIconColor = {
|
|
79
73
|
[AlertType.ERROR]: Color.RED,
|
|
80
74
|
[AlertType.SUCCESS]: Color.GREEN,
|
|
@@ -85,62 +79,49 @@ const TypeToIconColor = {
|
|
|
85
79
|
* @name Alert
|
|
86
80
|
* @extends {ReactComponent}
|
|
87
81
|
*/
|
|
88
|
-
|
|
89
82
|
/**
|
|
90
83
|
* **Alert** is a component for displaying contextual notifications. If you want to display a stack of notifications, use **Alerts** instead.
|
|
91
84
|
*/
|
|
92
|
-
|
|
93
85
|
class Alert extends PureComponent {
|
|
94
86
|
constructor() {
|
|
95
87
|
super(...arguments);
|
|
96
|
-
|
|
97
88
|
_defineProperty(this, "state", {
|
|
98
89
|
height: null
|
|
99
90
|
});
|
|
100
|
-
|
|
101
91
|
_defineProperty(this, "node", void 0);
|
|
102
|
-
|
|
103
92
|
_defineProperty(this, "hideTimeout", void 0);
|
|
104
|
-
|
|
105
93
|
_defineProperty(this, "closeRequest", event => {
|
|
106
94
|
this.startCloseAnimation();
|
|
107
95
|
return this.props.onCloseRequest(event);
|
|
108
96
|
});
|
|
109
|
-
|
|
110
97
|
_defineProperty(this, "startCloseAnimation", () => {
|
|
111
98
|
const height = getRect(this.node).height;
|
|
112
99
|
this.setState({
|
|
113
100
|
height
|
|
114
101
|
});
|
|
115
102
|
});
|
|
116
|
-
|
|
117
103
|
_defineProperty(this, "_handleCaptionsLinksClick", evt => {
|
|
118
104
|
if (evt.target instanceof Element && evt.target.matches('a')) {
|
|
119
105
|
this.closeRequest(evt);
|
|
120
106
|
}
|
|
121
107
|
});
|
|
122
|
-
|
|
123
108
|
_defineProperty(this, "storeAlertRef", node => {
|
|
124
109
|
this.node = node;
|
|
125
110
|
});
|
|
126
111
|
}
|
|
127
|
-
|
|
128
112
|
componentDidMount() {
|
|
129
113
|
if (this.props.timeout > 0) {
|
|
130
114
|
this.hideTimeout = window.setTimeout(this.closeRequest, this.props.timeout);
|
|
131
115
|
}
|
|
132
116
|
}
|
|
133
|
-
|
|
134
117
|
componentDidUpdate() {
|
|
135
118
|
if (this.props.isClosing) {
|
|
136
119
|
this._close();
|
|
137
120
|
}
|
|
138
121
|
}
|
|
139
|
-
|
|
140
122
|
componentWillUnmount() {
|
|
141
123
|
clearTimeout(this.hideTimeout);
|
|
142
124
|
}
|
|
143
|
-
|
|
144
125
|
_close() {
|
|
145
126
|
this.startCloseAnimation();
|
|
146
127
|
setTimeout(() => {
|
|
@@ -152,7 +133,6 @@ class Alert extends PureComponent {
|
|
|
152
133
|
* @private
|
|
153
134
|
*/
|
|
154
135
|
|
|
155
|
-
|
|
156
136
|
/**
|
|
157
137
|
* @private
|
|
158
138
|
*/
|
|
@@ -161,7 +141,8 @@ class Alert extends PureComponent {
|
|
|
161
141
|
className: classNames(modules_e02b3280.caption, this.props.captionClassName, {
|
|
162
142
|
[modules_e02b3280.withCloseButton]: this.props.closeable
|
|
163
143
|
}),
|
|
164
|
-
onClick: this._handleCaptionsLinksClick
|
|
144
|
+
onClick: this._handleCaptionsLinksClick
|
|
145
|
+
// We only process clicks on `a` elements, see above
|
|
165
146
|
,
|
|
166
147
|
role: "presentation"
|
|
167
148
|
}, this.props.children);
|
|
@@ -170,11 +151,8 @@ class Alert extends PureComponent {
|
|
|
170
151
|
* @private
|
|
171
152
|
* @return {XML|string}
|
|
172
153
|
*/
|
|
173
|
-
|
|
174
|
-
|
|
175
154
|
_getIcon() {
|
|
176
155
|
const glyph = TypeToIcon[this.props.type];
|
|
177
|
-
|
|
178
156
|
if (glyph) {
|
|
179
157
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
180
158
|
glyph: glyph,
|
|
@@ -186,10 +164,8 @@ class Alert extends PureComponent {
|
|
|
186
164
|
className: modules_e02b3280.loader
|
|
187
165
|
});
|
|
188
166
|
}
|
|
189
|
-
|
|
190
167
|
return '';
|
|
191
168
|
}
|
|
192
|
-
|
|
193
169
|
render() {
|
|
194
170
|
const {
|
|
195
171
|
type,
|
|
@@ -229,12 +205,9 @@ class Alert extends PureComponent {
|
|
|
229
205
|
onClick: this.closeRequest
|
|
230
206
|
}) : '');
|
|
231
207
|
}
|
|
232
|
-
|
|
233
208
|
}
|
|
234
|
-
|
|
235
209
|
_defineProperty(Alert, "propTypes", {
|
|
236
210
|
timeout: PropTypes.number,
|
|
237
|
-
|
|
238
211
|
/**
|
|
239
212
|
* Fires when alert starts closing if timeout is out or user clicks "Close" button
|
|
240
213
|
*/
|
|
@@ -242,7 +215,6 @@ _defineProperty(Alert, "propTypes", {
|
|
|
242
215
|
onClose: PropTypes.func,
|
|
243
216
|
isShaking: PropTypes.bool,
|
|
244
217
|
isClosing: PropTypes.bool,
|
|
245
|
-
|
|
246
218
|
/**
|
|
247
219
|
* Whether an alert is rendered inside an **Alerts** container
|
|
248
220
|
* or standalone.
|
|
@@ -257,7 +229,6 @@ _defineProperty(Alert, "propTypes", {
|
|
|
257
229
|
closeButtonClassName: PropTypes.string,
|
|
258
230
|
'data-test': PropTypes.string
|
|
259
231
|
});
|
|
260
|
-
|
|
261
232
|
_defineProperty(Alert, "defaultProps", {
|
|
262
233
|
theme: Theme.DARK,
|
|
263
234
|
closeable: true,
|
|
@@ -270,7 +241,6 @@ _defineProperty(Alert, "defaultProps", {
|
|
|
270
241
|
onClose: () => {},
|
|
271
242
|
onCloseRequest: () => {}
|
|
272
243
|
});
|
|
273
|
-
|
|
274
244
|
_defineProperty(Alert, "Type", AlertType);
|
|
275
245
|
|
|
276
246
|
export { ANIMATION_TIME, AlertType, Alert as default };
|
package/dist/alert/container.js
CHANGED
|
@@ -15,11 +15,9 @@ class Alerts extends PureComponent {
|
|
|
15
15
|
} = this.props;
|
|
16
16
|
const classes = classNames(modules_fc8df42d.alertContainer, className);
|
|
17
17
|
const show = Children.count(children) > 0;
|
|
18
|
-
|
|
19
18
|
if (!show) {
|
|
20
19
|
return null;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", _extends({
|
|
24
22
|
"data-test": "alert-container",
|
|
25
23
|
className: classes,
|
|
@@ -28,16 +26,13 @@ class Alerts extends PureComponent {
|
|
|
28
26
|
if (! /*#__PURE__*/isValidElement(child)) {
|
|
29
27
|
return child;
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
const alertClassNames = classNames(modules_fc8df42d.alertInContainer, child.props.className);
|
|
33
30
|
return /*#__PURE__*/cloneElement(child, {
|
|
34
31
|
className: alertClassNames
|
|
35
32
|
});
|
|
36
33
|
})), document.body);
|
|
37
34
|
}
|
|
38
|
-
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
_defineProperty(Alerts, "propTypes", {
|
|
42
37
|
children: PropTypes.node,
|
|
43
38
|
className: PropTypes.string
|
|
@@ -43,25 +43,19 @@ import '../popup/popup.consts.js';
|
|
|
43
43
|
/**
|
|
44
44
|
* @name Alert Service
|
|
45
45
|
*/
|
|
46
|
-
|
|
47
46
|
class AlertService {
|
|
48
47
|
constructor() {
|
|
49
48
|
_defineProperty(this, "defaultTimeout", 0);
|
|
50
|
-
|
|
51
49
|
_defineProperty(this, "showingAlerts", []);
|
|
52
|
-
|
|
53
50
|
_defineProperty(this, "containerElement", document.createElement('div'));
|
|
54
51
|
}
|
|
55
|
-
|
|
56
52
|
_getShowingAlerts() {
|
|
57
53
|
return [...this.showingAlerts];
|
|
58
54
|
}
|
|
59
|
-
|
|
60
55
|
renderAlertContainer(alerts) {
|
|
61
56
|
if (alerts.length === 0) {
|
|
62
57
|
return /*#__PURE__*/React.createElement("span", null);
|
|
63
58
|
}
|
|
64
|
-
|
|
65
59
|
return /*#__PURE__*/React.createElement(Alerts, null, alerts.map(alert => {
|
|
66
60
|
const {
|
|
67
61
|
message,
|
|
@@ -76,36 +70,27 @@ class AlertService {
|
|
|
76
70
|
/**
|
|
77
71
|
* Renders alert container into virtual node to skip maintaining container
|
|
78
72
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
73
|
renderAlerts() {
|
|
82
74
|
render(this.renderAlertContainer(this.showingAlerts), this.containerElement);
|
|
83
75
|
}
|
|
84
|
-
|
|
85
76
|
findSameAlert(message, type) {
|
|
86
77
|
return this.showingAlerts.filter(it => it.type === type && it.message === message)[0];
|
|
87
78
|
}
|
|
88
|
-
|
|
89
79
|
startAlertClosing(alert) {
|
|
90
80
|
alert.isClosing = true;
|
|
91
81
|
this.renderAlerts();
|
|
92
82
|
}
|
|
93
|
-
|
|
94
83
|
remove(key) {
|
|
95
84
|
const alertToClose = this.showingAlerts.filter(alert => alert.key === key)[0];
|
|
96
|
-
|
|
97
85
|
if (!alertToClose) {
|
|
98
86
|
return;
|
|
99
87
|
}
|
|
100
|
-
|
|
101
88
|
this.startAlertClosing(alertToClose);
|
|
102
89
|
}
|
|
103
|
-
|
|
104
90
|
removeWithoutAnimation(key) {
|
|
105
91
|
this.showingAlerts = this.showingAlerts.filter(alert => alert.key !== key);
|
|
106
92
|
this.renderAlerts();
|
|
107
93
|
}
|
|
108
|
-
|
|
109
94
|
stopShakingWhenAnimationDone(shakingAlert) {
|
|
110
95
|
setTimeout(() => {
|
|
111
96
|
shakingAlert.showWithAnimation = false;
|
|
@@ -113,7 +98,6 @@ class AlertService {
|
|
|
113
98
|
this.renderAlerts();
|
|
114
99
|
}, ANIMATION_TIME);
|
|
115
100
|
}
|
|
116
|
-
|
|
117
101
|
addAlert(message, type) {
|
|
118
102
|
let timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.defaultTimeout;
|
|
119
103
|
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
@@ -123,14 +107,12 @@ class AlertService {
|
|
|
123
107
|
...restOptions
|
|
124
108
|
} = options;
|
|
125
109
|
const sameAlert = this.findSameAlert(message, type);
|
|
126
|
-
|
|
127
110
|
if (sameAlert) {
|
|
128
111
|
sameAlert.isShaking = true;
|
|
129
112
|
this.renderAlerts();
|
|
130
113
|
this.stopShakingWhenAnimationDone(sameAlert);
|
|
131
114
|
return sameAlert.key;
|
|
132
115
|
}
|
|
133
|
-
|
|
134
116
|
const alert = {
|
|
135
117
|
key: getUID('alert-service-'),
|
|
136
118
|
message,
|
|
@@ -151,33 +133,25 @@ class AlertService {
|
|
|
151
133
|
this.renderAlerts();
|
|
152
134
|
return alert.key;
|
|
153
135
|
}
|
|
154
|
-
|
|
155
136
|
setDefaultTimeout(timeout) {
|
|
156
137
|
this.defaultTimeout = timeout;
|
|
157
138
|
}
|
|
158
|
-
|
|
159
139
|
error(message, timeout) {
|
|
160
140
|
return this.addAlert(message, Alert.Type.ERROR, timeout);
|
|
161
141
|
}
|
|
162
|
-
|
|
163
142
|
message(message, timeout) {
|
|
164
143
|
return this.addAlert(message, Alert.Type.MESSAGE, timeout);
|
|
165
144
|
}
|
|
166
|
-
|
|
167
145
|
warning(message, timeout) {
|
|
168
146
|
return this.addAlert(message, Alert.Type.WARNING, timeout);
|
|
169
147
|
}
|
|
170
|
-
|
|
171
148
|
successMessage(message, timeout) {
|
|
172
149
|
return this.addAlert(message, Alert.Type.SUCCESS, timeout);
|
|
173
150
|
}
|
|
174
|
-
|
|
175
151
|
loadingMessage(message, timeout) {
|
|
176
152
|
return this.addAlert(message, Alert.Type.LOADING, timeout);
|
|
177
153
|
}
|
|
178
|
-
|
|
179
154
|
}
|
|
180
|
-
|
|
181
155
|
const alertService = new AlertService();
|
|
182
156
|
|
|
183
157
|
export { alertService as default };
|
|
@@ -6,47 +6,36 @@ import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
|
6
6
|
class Analytics {
|
|
7
7
|
constructor() {
|
|
8
8
|
_defineProperty(this, "_plugins", void 0);
|
|
9
|
-
|
|
10
9
|
this._plugins = [];
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
config(plugins) {
|
|
14
12
|
this._plugins = plugins;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
track(rawTrackingData, additionalData) {
|
|
18
15
|
if (!rawTrackingData) {
|
|
19
16
|
return;
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
let splitIdx = rawTrackingData.indexOf(':');
|
|
23
|
-
|
|
24
19
|
if (splitIdx < 0) {
|
|
25
20
|
splitIdx = rawTrackingData.indexOf('_');
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
if (splitIdx < 0) {
|
|
29
23
|
splitIdx = rawTrackingData.length;
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
const category = rawTrackingData.substr(0, splitIdx);
|
|
33
26
|
const subcategory = rawTrackingData.substr(splitIdx + 1);
|
|
34
27
|
this.trackEvent(category, subcategory, additionalData);
|
|
35
28
|
}
|
|
36
|
-
|
|
37
29
|
trackPageView(path) {
|
|
38
30
|
this._plugins.forEach(plugin => {
|
|
39
31
|
plugin.trackPageView(path);
|
|
40
32
|
});
|
|
41
33
|
}
|
|
42
|
-
|
|
43
34
|
trackEvent(category, action, additionalData) {
|
|
44
35
|
const subaction = additionalData ? action + this._buildSuffix(additionalData) : null;
|
|
45
|
-
|
|
46
36
|
this._plugins.forEach(plugin => {
|
|
47
37
|
if (plugin.serializeAdditionalInfo) {
|
|
48
38
|
plugin.trackEvent(category, action);
|
|
49
|
-
|
|
50
39
|
if (subaction) {
|
|
51
40
|
plugin.trackEvent(category, subaction);
|
|
52
41
|
}
|
|
@@ -55,21 +44,17 @@ class Analytics {
|
|
|
55
44
|
}
|
|
56
45
|
});
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
trackShortcutEvent(category, action, additionalData) {
|
|
60
48
|
this.trackEvent(category, action, additionalData);
|
|
61
49
|
this.trackEvent('ring-shortcut', `${category}$${action}`, additionalData);
|
|
62
50
|
}
|
|
63
|
-
|
|
64
51
|
trackEntityProperties(entityName, entity, propertiesNames, additionalData) {
|
|
65
52
|
for (let i = 0; i < propertiesNames.length; ++i) {
|
|
66
53
|
const keys = propertiesNames[i].split('.');
|
|
67
54
|
let value = entity;
|
|
68
|
-
|
|
69
55
|
if (!keys.length) {
|
|
70
56
|
continue;
|
|
71
57
|
}
|
|
72
|
-
|
|
73
58
|
for (let j = 0; j < keys.length; ++j) {
|
|
74
59
|
if (typeof value === 'object' && value != null && value.hasOwnProperty(keys[j])) {
|
|
75
60
|
value = value[keys[j]];
|
|
@@ -78,33 +63,26 @@ class Analytics {
|
|
|
78
63
|
break;
|
|
79
64
|
}
|
|
80
65
|
}
|
|
81
|
-
|
|
82
66
|
if (typeof value === 'string') {
|
|
83
67
|
value = value.toLowerCase().replace(/[._]+/g, '-');
|
|
84
68
|
}
|
|
85
|
-
|
|
86
69
|
const resultAction = `${keys.join('-')}__${value}`;
|
|
87
70
|
this.trackEvent(entityName, resultAction, additionalData);
|
|
88
71
|
}
|
|
89
72
|
}
|
|
90
|
-
|
|
91
73
|
_buildSuffix(additionalData) {
|
|
92
74
|
if (!additionalData) {
|
|
93
75
|
return '';
|
|
94
76
|
}
|
|
95
|
-
|
|
96
77
|
let suffix = '';
|
|
97
78
|
let key;
|
|
98
|
-
|
|
99
79
|
for (key in additionalData) {
|
|
100
80
|
if (additionalData.hasOwnProperty(key)) {
|
|
101
81
|
suffix += `__${key}$${additionalData[key]}`;
|
|
102
82
|
}
|
|
103
83
|
}
|
|
104
|
-
|
|
105
84
|
return suffix;
|
|
106
85
|
}
|
|
107
|
-
|
|
108
86
|
}
|
|
109
87
|
var analyticsInstance = new Analytics();
|
|
110
88
|
|
|
@@ -8,21 +8,13 @@ const DEFAULT_FLUSH_MAX_PACK_SIZE = 100;
|
|
|
8
8
|
class AnalyticsCustomPlugin {
|
|
9
9
|
constructor(send, isDevelopment, flushInterval, flushingAllowedChecker) {
|
|
10
10
|
_defineProperty(this, "_data", void 0);
|
|
11
|
-
|
|
12
11
|
_defineProperty(this, "_flush", void 0);
|
|
13
|
-
|
|
14
12
|
_defineProperty(this, "_isDevelopment", void 0);
|
|
15
|
-
|
|
16
13
|
_defineProperty(this, "_flushInterval", void 0);
|
|
17
|
-
|
|
18
14
|
_defineProperty(this, "_flushMaxPackSize", void 0);
|
|
19
|
-
|
|
20
15
|
_defineProperty(this, "_lastPagePath", void 0);
|
|
21
|
-
|
|
22
16
|
_defineProperty(this, "_hasSendSchedule", void 0);
|
|
23
|
-
|
|
24
17
|
_defineProperty(this, "_lastPageViewTime", void 0);
|
|
25
|
-
|
|
26
18
|
this._data = [];
|
|
27
19
|
this.config({
|
|
28
20
|
send,
|
|
@@ -39,71 +31,50 @@ class AnalyticsCustomPlugin {
|
|
|
39
31
|
* @property {function} config.flushingAllowedChecker
|
|
40
32
|
* @property {number} config.flushMaxPackSize
|
|
41
33
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
34
|
config(config) {
|
|
45
35
|
const checkFlushingAllowed = typeof config.flushingAllowedChecker === 'function' ? config.flushingAllowedChecker : () => true;
|
|
46
|
-
|
|
47
36
|
this._flush = () => {
|
|
48
37
|
if (this._data.length > 0 && checkFlushingAllowed()) {
|
|
49
38
|
config.send(this._data);
|
|
50
39
|
this._data = [];
|
|
51
40
|
}
|
|
52
41
|
};
|
|
53
|
-
|
|
54
42
|
this._isDevelopment = config.isDevelopment;
|
|
55
43
|
this._flushInterval = config.flushInterval || DEFAULT_FLUSH_INTERVAL;
|
|
56
44
|
this._flushMaxPackSize = config.flushMaxPackSize || DEFAULT_FLUSH_MAX_PACK_SIZE;
|
|
57
45
|
}
|
|
58
|
-
|
|
59
46
|
trackEvent(category, action) {
|
|
60
47
|
this._processEvent(category, action);
|
|
61
48
|
}
|
|
62
|
-
|
|
63
49
|
trackPageView(path) {
|
|
64
50
|
if (this._lastPagePath === path) {
|
|
65
51
|
return;
|
|
66
52
|
}
|
|
67
|
-
|
|
68
53
|
this._trackPageViewAdditionalInfo(path);
|
|
69
|
-
|
|
70
54
|
this._processEvent('ring-page', path);
|
|
71
|
-
|
|
72
55
|
this._processEvent('ring-navigator_user-agent', AnalyticsPluginUtils.getUserAgentPresentation());
|
|
73
|
-
|
|
74
56
|
this._processEvent('ring-navigator_platform', AnalyticsPluginUtils.npeSaveLowerCase(navigator.platform));
|
|
75
|
-
|
|
76
57
|
this._processEvent('ring-navigator_lang', AnalyticsPluginUtils.npeSaveLowerCase(navigator.language));
|
|
77
|
-
|
|
78
58
|
this._processEvent('ring-device-pixel-ratio', AnalyticsPluginUtils.getDevicePixelRatioPresentation());
|
|
79
|
-
|
|
80
59
|
this._processEvent('ring-screen-width', AnalyticsPluginUtils.getScreenWidthPresentation());
|
|
81
60
|
}
|
|
82
|
-
|
|
83
61
|
_initSendSchedule() {
|
|
84
62
|
window.addEventListener('beforeunload', () => {
|
|
85
63
|
var _this$_flush;
|
|
86
|
-
|
|
87
64
|
this._trackPageViewAdditionalInfo();
|
|
88
|
-
|
|
89
65
|
return (_this$_flush = this._flush) === null || _this$_flush === void 0 ? void 0 : _this$_flush.call(this);
|
|
90
66
|
});
|
|
91
|
-
|
|
92
67
|
if (this._flush != null) {
|
|
93
68
|
setInterval(this._flush, this._flushInterval);
|
|
94
69
|
}
|
|
95
|
-
|
|
96
70
|
this._hasSendSchedule = true;
|
|
97
71
|
}
|
|
98
|
-
|
|
99
72
|
_processEvent(rawCategory, rawAction) {
|
|
100
73
|
if (!this._hasSendSchedule && this._flush) {
|
|
101
74
|
this._initSendSchedule();
|
|
102
75
|
}
|
|
103
|
-
|
|
104
76
|
const category = AnalyticsPluginUtils.reformatString(rawCategory, true);
|
|
105
77
|
const action = AnalyticsPluginUtils.reformatString(rawAction);
|
|
106
|
-
|
|
107
78
|
if (this._isDevelopment) {
|
|
108
79
|
console.log('TRACKING DATA = ', category, action); // eslint-disable-line no-console
|
|
109
80
|
}
|
|
@@ -113,36 +84,27 @@ class AnalyticsCustomPlugin {
|
|
|
113
84
|
action
|
|
114
85
|
});
|
|
115
86
|
}
|
|
116
|
-
|
|
117
87
|
_trackPageViewAdditionalInfo(newPagePath) {
|
|
118
88
|
const currentTime = new Date().getTime();
|
|
119
|
-
|
|
120
89
|
if (this._lastPagePath) {
|
|
121
90
|
if (this._lastPageViewTime) {
|
|
122
91
|
const duration = AnalyticsPluginUtils.getPageViewDurationPresentation(currentTime - this._lastPageViewTime);
|
|
123
|
-
|
|
124
92
|
this._processEvent(`ring-pageview-duration_${this._lastPagePath}`, duration);
|
|
125
93
|
}
|
|
126
94
|
}
|
|
127
|
-
|
|
128
95
|
this._lastPageViewTime = currentTime;
|
|
129
96
|
this._lastPagePath = newPagePath;
|
|
130
97
|
}
|
|
131
|
-
|
|
132
98
|
_addDataToFlushingPack(sendingData) {
|
|
133
99
|
this._data.push(sendingData);
|
|
134
|
-
|
|
135
100
|
if (this._flushMaxPackSize != null && this._data.length >= this._flushMaxPackSize) {
|
|
136
101
|
var _this$_flush2;
|
|
137
|
-
|
|
138
102
|
(_this$_flush2 = this._flush) === null || _this$_flush2 === void 0 ? void 0 : _this$_flush2.call(this);
|
|
139
103
|
}
|
|
140
104
|
}
|
|
141
|
-
|
|
142
105
|
get serializeAdditionalInfo() {
|
|
143
106
|
return true;
|
|
144
107
|
}
|
|
145
|
-
|
|
146
108
|
}
|
|
147
109
|
|
|
148
110
|
export { AnalyticsCustomPlugin as default };
|
|
@@ -15,11 +15,9 @@ import 'sniffr';
|
|
|
15
15
|
* }} config
|
|
16
16
|
* @constructor
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
18
|
class AnalyticsFUSPlugin {
|
|
20
19
|
constructor(_ref) {
|
|
21
20
|
var _window$fusra, _window;
|
|
22
|
-
|
|
23
21
|
let {
|
|
24
22
|
productId,
|
|
25
23
|
productBuild,
|
|
@@ -27,39 +25,29 @@ class AnalyticsFUSPlugin {
|
|
|
27
25
|
isDevelopment = false,
|
|
28
26
|
groups = []
|
|
29
27
|
} = _ref;
|
|
30
|
-
|
|
31
28
|
_defineProperty(this, "_recorderVersion", void 0);
|
|
32
|
-
|
|
33
29
|
_defineProperty(this, "_lastPagePath", void 0);
|
|
34
|
-
|
|
35
30
|
_defineProperty(this, "_groups", void 0);
|
|
36
|
-
|
|
37
31
|
if (!productId && !isDevelopment) {
|
|
38
32
|
return;
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
((i, s, o, g, r) => {
|
|
42
35
|
var _firstScript$parentNo;
|
|
43
|
-
|
|
44
36
|
i[r] = i[r] || function addArgumentsToQueueForWaitingTheScriptLoading() {
|
|
45
37
|
const fn = i[r];
|
|
46
|
-
|
|
47
38
|
if (fn != null) {
|
|
48
39
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
40
|
args[_key] = arguments[_key];
|
|
50
41
|
}
|
|
51
|
-
|
|
52
42
|
(fn.query = fn.query || []).push(args);
|
|
53
43
|
}
|
|
54
44
|
};
|
|
55
|
-
|
|
56
45
|
const script = document.createElement(o);
|
|
57
46
|
script.async = true;
|
|
58
47
|
script.src = g;
|
|
59
48
|
const firstScript = document.getElementsByTagName(o)[0];
|
|
60
49
|
(_firstScript$parentNo = firstScript.parentNode) === null || _firstScript$parentNo === void 0 ? void 0 : _firstScript$parentNo.insertBefore(script, firstScript);
|
|
61
50
|
})(window, document, 'script', '//resources.jetbrains.com/storage/fus/api/fus-reporting-api.js', 'fusra');
|
|
62
|
-
|
|
63
51
|
(_window$fusra = (_window = window).fusra) === null || _window$fusra === void 0 ? void 0 : _window$fusra.call(_window, 'init', {
|
|
64
52
|
recorderCode: productId,
|
|
65
53
|
recorderVersion,
|
|
@@ -72,18 +60,14 @@ class AnalyticsFUSPlugin {
|
|
|
72
60
|
this._recorderVersion = recorderVersion;
|
|
73
61
|
this._groups = groups;
|
|
74
62
|
}
|
|
75
|
-
|
|
76
63
|
trackEvent(category, action, additionalInfo) {
|
|
77
64
|
this._processEvent(category, action, additionalInfo);
|
|
78
65
|
}
|
|
79
|
-
|
|
80
66
|
trackPageView(path) {
|
|
81
67
|
if (this._lastPagePath === path) {
|
|
82
68
|
return;
|
|
83
69
|
}
|
|
84
|
-
|
|
85
70
|
this._lastPagePath = path;
|
|
86
|
-
|
|
87
71
|
this._processEvent('ring.page.view', 'open', {
|
|
88
72
|
path,
|
|
89
73
|
browser: AnalyticsPluginUtils.getUserAgentPresentation(),
|
|
@@ -94,15 +78,12 @@ class AnalyticsFUSPlugin {
|
|
|
94
78
|
screen: AnalyticsPluginUtils.getScreenWidthPresentation()
|
|
95
79
|
});
|
|
96
80
|
}
|
|
97
|
-
|
|
98
81
|
get serializeAdditionalInfo() {
|
|
99
82
|
return false;
|
|
100
83
|
}
|
|
101
|
-
|
|
102
84
|
_processEvent(category, action, additionalInfo) {
|
|
103
85
|
const groupId = category.replace(/[-]/g, '.');
|
|
104
86
|
const group = (this._groups || []).filter(currentGroup => currentGroup.id === groupId)[0];
|
|
105
|
-
|
|
106
87
|
if (group && window.fusra) {
|
|
107
88
|
window.fusra('event', {
|
|
108
89
|
groupId,
|
|
@@ -112,7 +93,6 @@ class AnalyticsFUSPlugin {
|
|
|
112
93
|
});
|
|
113
94
|
}
|
|
114
95
|
}
|
|
115
|
-
|
|
116
96
|
}
|
|
117
97
|
|
|
118
98
|
export { AnalyticsFUSPlugin as default };
|
|
@@ -8,20 +8,15 @@ class AnalyticsGAPlugin {
|
|
|
8
8
|
if (!gaId && !isDevelopment) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
((i, s, o, g, r) => {
|
|
13
12
|
var _m$parentNode;
|
|
14
|
-
|
|
15
13
|
i.GoogleAnalyticsObject = r;
|
|
16
|
-
|
|
17
14
|
i[r] = i[r] || function addArgumentsToQueueForWaitingTheScriptLoading() {
|
|
18
15
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
16
|
args[_key] = arguments[_key];
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
(i[r].q = i[r].q || []).push(args);
|
|
23
19
|
};
|
|
24
|
-
|
|
25
20
|
i[r].l = Number(new Date());
|
|
26
21
|
const a = s.createElement(o);
|
|
27
22
|
const m = s.getElementsByTagName(o)[0];
|
|
@@ -32,11 +27,8 @@ class AnalyticsGAPlugin {
|
|
|
32
27
|
/**
|
|
33
28
|
* UA-57284711-1 - ga key for development purpose
|
|
34
29
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
30
|
const key = gaId || 'UA-57284711-1';
|
|
38
31
|
/* global ga */
|
|
39
|
-
|
|
40
32
|
if (cookielessUserIdentifier) {
|
|
41
33
|
ga('create', key, {
|
|
42
34
|
storage: 'none',
|
|
@@ -50,12 +42,10 @@ class AnalyticsGAPlugin {
|
|
|
50
42
|
cookieDomain: 'none'
|
|
51
43
|
} : gaCookieParams);
|
|
52
44
|
}
|
|
53
|
-
|
|
54
45
|
ga('set', 'anonymizeIp', true);
|
|
55
46
|
ga('set', 'location', domain || '/');
|
|
56
47
|
ga('set', 'allowAdFeatures', false);
|
|
57
48
|
}
|
|
58
|
-
|
|
59
49
|
trackEvent(category, action) {
|
|
60
50
|
if (window.ga != null) {
|
|
61
51
|
const eventOptions = {
|
|
@@ -65,17 +55,14 @@ class AnalyticsGAPlugin {
|
|
|
65
55
|
ga('send', 'event', eventOptions);
|
|
66
56
|
}
|
|
67
57
|
}
|
|
68
|
-
|
|
69
58
|
trackPageView(path) {
|
|
70
59
|
if (window.ga != null) {
|
|
71
60
|
ga('send', 'pageview', path);
|
|
72
61
|
}
|
|
73
62
|
}
|
|
74
|
-
|
|
75
63
|
get serializeAdditionalInfo() {
|
|
76
64
|
return true;
|
|
77
65
|
}
|
|
78
|
-
|
|
79
66
|
}
|
|
80
67
|
|
|
81
68
|
export { AnalyticsGAPlugin as default };
|