@jetbrains/ring-ui-built 7.0.0-beta.4 → 7.0.0-beta.6
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/button__classes.js +11 -10
- package/components/_helpers/input.js +1 -1
- package/components/_helpers/query-assist__suggestions.js +1 -1
- package/components/auth/auth.js +0 -3
- package/components/auth/auth__core.js +4 -4
- package/components/auth/iframe-flow.js +1 -1
- package/components/auth/storage.js +3 -6
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.js +1 -1
- package/components/button/button.js +30 -32
- package/components/button/button__classes.d.ts +1 -1
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.js +1 -1
- package/components/data-list/data-list.js +1 -1
- package/components/data-list/item.js +1 -1
- package/components/date-picker/date-input.js +1 -1
- package/components/date-picker/date-popup.js +1 -1
- package/components/dialog/dialog.js +1 -1
- package/components/form/form.js +1 -1
- package/components/header/header-icon.js +1 -1
- package/components/header/header.js +0 -3
- package/components/header/profile.js +1 -1
- package/components/header/smart-profile.js +0 -3
- package/components/input/input-legacy.js +1 -1
- package/components/input/input.js +1 -1
- package/components/input-size/input-size.js +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.js +1 -1
- package/components/message/message.js +2 -2
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +17 -16
- package/components/query-assist/query-assist.js +2 -2
- package/components/select/select.d.ts +3 -0
- package/components/select/select.js +16 -5
- package/components/select/select__filter.js +1 -1
- package/components/storage/storage.d.ts +2 -3
- package/components/storage/storage.js +2 -21
- package/components/style.css +1 -1
- package/components/tags-input/tags-input.js +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/user-agreement/service.d.ts +2 -1
- package/components/user-agreement/service.js +2 -5
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.js +1 -1
- package/package.json +1 -2
- package/components/storage/storage__fallback.d.ts +0 -79
- package/components/storage/storage__fallback.js +0 -180
@@ -19,7 +19,7 @@ import 'core-js/modules/es.string.replace.js';
|
|
19
19
|
import 'core-js/modules/es.string.trim.js';
|
20
20
|
import '@jetbrains/icons/chevron-down';
|
21
21
|
import '@jetbrains/icons/close-12px';
|
22
|
-
import '
|
22
|
+
import 'dequal';
|
23
23
|
import '../dropdown/dropdown.js';
|
24
24
|
import '../global/data-tests.js';
|
25
25
|
import '../global/typescript-utils.js';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
|
+
import Storage from '../storage/storage';
|
2
3
|
import { UserAgreementAttrs, UserAgreementTranslations } from './user-agreement';
|
3
4
|
export declare const showMessage = "userAgreementShow";
|
4
5
|
export declare const hideMessage = "userAgreementHide";
|
@@ -42,7 +43,7 @@ export default class UserAgreementService {
|
|
42
43
|
interval: number;
|
43
44
|
container: HTMLDivElement;
|
44
45
|
reactRoot: import("react-dom/client").Root;
|
45
|
-
storage:
|
46
|
+
storage: Storage;
|
46
47
|
checkingPromise: Promise<[Agreement, Consent]> | null;
|
47
48
|
guest: boolean | null | undefined;
|
48
49
|
userAgreement: Agreement;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import { createRoot } from 'react-dom/client';
|
4
|
-
import
|
4
|
+
import LocalStorage from '../storage/storage__local.js';
|
5
5
|
import alertService from '../alert-service/alert-service.js';
|
6
6
|
import Link from '../link/link.js';
|
7
7
|
import Alert from '../alert/alert.js';
|
@@ -9,9 +9,6 @@ import Group from '../group/group.js';
|
|
9
9
|
import { ControlsHeightContext, getGlobalControlsHeight } from '../global/controls-height.js';
|
10
10
|
import UserAgreement from './user-agreement.js';
|
11
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
12
|
-
import '../storage/storage__local.js';
|
13
|
-
import '../storage/storage__fallback.js';
|
14
|
-
import 'deep-equal';
|
15
12
|
import '../global/get-uid.js';
|
16
13
|
import '../alert/container.js';
|
17
14
|
import 'react';
|
@@ -91,7 +88,7 @@ class UserAgreementService {
|
|
91
88
|
_defineProperty(this, "interval", ONE_HOUR);
|
92
89
|
_defineProperty(this, "container", document.createElement('div'));
|
93
90
|
_defineProperty(this, "reactRoot", createRoot(this.container));
|
94
|
-
_defineProperty(this, "storage", new
|
91
|
+
_defineProperty(this, "storage", new LocalStorage());
|
95
92
|
_defineProperty(this, "checkingPromise", null);
|
96
93
|
_defineProperty(this, "guest", false);
|
97
94
|
_defineProperty(this, "userAgreement", DEFAULT_AGREEMENT);
|
@@ -32,8 +32,8 @@ import '../popup/popup.target.js';
|
|
32
32
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
33
33
|
import 'scrollbar-width';
|
34
34
|
import '@jetbrains/icons/chevron-down';
|
35
|
-
import '../icon/icon.js';
|
36
35
|
import 'util-deprecate';
|
36
|
+
import '../icon/icon.js';
|
37
37
|
import '../icon/icon__constants.js';
|
38
38
|
import '../_helpers/icon__svg.js';
|
39
39
|
import 'core-js/modules/es.string.replace.js';
|
@@ -32,9 +32,9 @@ import '@jetbrains/icons/close';
|
|
32
32
|
import '../loader-inline/loader-inline.js';
|
33
33
|
import '../button/button.js';
|
34
34
|
import '@jetbrains/icons/chevron-down';
|
35
|
+
import 'util-deprecate';
|
35
36
|
import '../global/controls-height.js';
|
36
37
|
import '../_helpers/button__classes.js';
|
37
|
-
import 'util-deprecate';
|
38
38
|
import '../_helpers/icon__svg.js';
|
39
39
|
import '../global/memoize.js';
|
40
40
|
import '../_helpers/theme.js';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jetbrains/ring-ui-built",
|
3
|
-
"version": "7.0.0-beta.
|
3
|
+
"version": "7.0.0-beta.6",
|
4
4
|
"description": "JetBrains UI library",
|
5
5
|
"author": "JetBrains",
|
6
6
|
"license": "Apache-2.0",
|
@@ -93,7 +93,6 @@
|
|
93
93
|
"classnames": "^2.5.1",
|
94
94
|
"combokeys": "^3.0.1",
|
95
95
|
"date-fns": "^3.6.0",
|
96
|
-
"deep-equal": "^2.2.3",
|
97
96
|
"element-resize-detector": "^1.2.4",
|
98
97
|
"es6-error": "^4.1.1",
|
99
98
|
"fastdom": "^1.0.12",
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import { StorageInterface, StorageConfig } from './storage';
|
2
|
-
/**
|
3
|
-
* @prop {string} cookieName
|
4
|
-
*
|
5
|
-
* @param {{cookieName: string}} config
|
6
|
-
* @param {{checkDelay: number}} config
|
7
|
-
* @param {{type: string}} config
|
8
|
-
* @return {FallbackStorage}
|
9
|
-
* @constructor
|
10
|
-
*/
|
11
|
-
export default class FallbackStorage implements StorageInterface {
|
12
|
-
static DEFAULT_COOKIE_NAME: string;
|
13
|
-
static DEFAULT_SESSION_COOKIE_NAME: string;
|
14
|
-
static DEFAULT_CHECK_DELAY: number;
|
15
|
-
static COOKIE_EXPIRES: number;
|
16
|
-
/**
|
17
|
-
* Maximum storage size
|
18
|
-
* @see http://browsercookielimits.squawky.net/
|
19
|
-
* @type {number}
|
20
|
-
*/
|
21
|
-
static QUOTA: number;
|
22
|
-
/**
|
23
|
-
* @param {string} name
|
24
|
-
* @param {string} value
|
25
|
-
* @param {number} days
|
26
|
-
* @private
|
27
|
-
*/
|
28
|
-
private static _createCookie;
|
29
|
-
/**
|
30
|
-
*
|
31
|
-
* @param {string} name
|
32
|
-
* @return {string}
|
33
|
-
* @private
|
34
|
-
*/
|
35
|
-
private static _readCookie;
|
36
|
-
cookieName: string;
|
37
|
-
checkDelay: number;
|
38
|
-
expires: number | null;
|
39
|
-
constructor(config?: StorageConfig);
|
40
|
-
/**
|
41
|
-
* @return {Promise}
|
42
|
-
* @private
|
43
|
-
*/
|
44
|
-
private _read;
|
45
|
-
/**
|
46
|
-
* @param data
|
47
|
-
* @return {Promise}
|
48
|
-
* @private
|
49
|
-
*/
|
50
|
-
private _write;
|
51
|
-
/**
|
52
|
-
* @param {string} key
|
53
|
-
* @return {Promise}
|
54
|
-
*/
|
55
|
-
get(key: string): Promise<any>;
|
56
|
-
/**
|
57
|
-
* @param {string} key
|
58
|
-
* @param {object} value
|
59
|
-
* @return {Promise}
|
60
|
-
*/
|
61
|
-
set<T>(key: string, value: T | null): Promise<T | null>;
|
62
|
-
/**
|
63
|
-
* @param {string} key
|
64
|
-
* @return {Promise}
|
65
|
-
*/
|
66
|
-
remove(key: string): Promise<void>;
|
67
|
-
/**
|
68
|
-
*
|
69
|
-
* @param {function(string, value)} callback
|
70
|
-
* @return {Promise}
|
71
|
-
*/
|
72
|
-
each<R>(callback: (item: string, value: unknown) => R | Promise<R>): Promise<Awaited<R>[]>;
|
73
|
-
/**
|
74
|
-
* @param {string} key
|
75
|
-
* @param {Function} callback
|
76
|
-
* @return {Function}
|
77
|
-
*/
|
78
|
-
on<T>(key: string, callback: (value: T | null) => void): () => void;
|
79
|
-
}
|
@@ -1,180 +0,0 @@
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
|
-
import deepEqual from 'deep-equal';
|
4
|
-
|
5
|
-
const DEFAULT_CHECK_DELAY = 3000;
|
6
|
-
const COOKIE_EXPIRES = 365;
|
7
|
-
const QUOTA = 4093;
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
9
|
-
const SECONDS_IN_DAY = 24 * 60 * 60 * 1000;
|
10
|
-
/**
|
11
|
-
* @prop {string} cookieName
|
12
|
-
*
|
13
|
-
* @param {{cookieName: string}} config
|
14
|
-
* @param {{checkDelay: number}} config
|
15
|
-
* @param {{type: string}} config
|
16
|
-
* @return {FallbackStorage}
|
17
|
-
* @constructor
|
18
|
-
*/
|
19
|
-
class FallbackStorage {
|
20
|
-
/**
|
21
|
-
* @param {string} name
|
22
|
-
* @param {string} value
|
23
|
-
* @param {number} days
|
24
|
-
* @private
|
25
|
-
*/
|
26
|
-
static _createCookie(name, value, days) {
|
27
|
-
let date;
|
28
|
-
let expires;
|
29
|
-
if (days) {
|
30
|
-
date = new Date();
|
31
|
-
date.setTime(date.getTime() + days * SECONDS_IN_DAY);
|
32
|
-
expires = "; expires=".concat(date.toUTCString());
|
33
|
-
} else {
|
34
|
-
expires = ';';
|
35
|
-
}
|
36
|
-
document.cookie = "".concat(name, "=").concat(value).concat(expires, "; path=/");
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
*
|
40
|
-
* @param {string} name
|
41
|
-
* @return {string}
|
42
|
-
* @private
|
43
|
-
*/
|
44
|
-
static _readCookie(name) {
|
45
|
-
const nameEQ = "".concat(name, "=");
|
46
|
-
const cookies = document.cookie.split(';');
|
47
|
-
let cookie;
|
48
|
-
for (let i = 0; i < cookies.length; i++) {
|
49
|
-
cookie = cookies[i];
|
50
|
-
while (cookie.charAt(0) === ' ') {
|
51
|
-
cookie = cookie.substring(1, cookie.length);
|
52
|
-
}
|
53
|
-
if (cookie.indexOf(nameEQ) === 0) {
|
54
|
-
return cookie.substring(nameEQ.length, cookie.length);
|
55
|
-
}
|
56
|
-
}
|
57
|
-
return undefined;
|
58
|
-
}
|
59
|
-
constructor() {
|
60
|
-
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
61
|
-
_defineProperty(this, "cookieName", void 0);
|
62
|
-
_defineProperty(this, "checkDelay", void 0);
|
63
|
-
_defineProperty(this, "expires", void 0);
|
64
|
-
const session = config.type === 'session';
|
65
|
-
this.cookieName = config.cookieName || (session ? FallbackStorage.DEFAULT_SESSION_COOKIE_NAME : FallbackStorage.DEFAULT_COOKIE_NAME);
|
66
|
-
this.checkDelay = config.checkDelay || FallbackStorage.DEFAULT_CHECK_DELAY;
|
67
|
-
this.expires = session ? FallbackStorage.COOKIE_EXPIRES : null;
|
68
|
-
}
|
69
|
-
/**
|
70
|
-
* @return {Promise}
|
71
|
-
* @private
|
72
|
-
*/
|
73
|
-
_read() {
|
74
|
-
return new Promise((resolve, reject) => {
|
75
|
-
const rawData = FallbackStorage._readCookie(this.cookieName);
|
76
|
-
if (rawData != null) {
|
77
|
-
resolve(JSON.parse(decodeURIComponent(rawData)));
|
78
|
-
} else {
|
79
|
-
reject();
|
80
|
-
}
|
81
|
-
}).catch(() => ({}));
|
82
|
-
}
|
83
|
-
/**
|
84
|
-
* @param data
|
85
|
-
* @return {Promise}
|
86
|
-
* @private
|
87
|
-
*/
|
88
|
-
_write(data) {
|
89
|
-
return new Promise(resolve => {
|
90
|
-
const stringData = encodeURIComponent(JSON.stringify(data));
|
91
|
-
FallbackStorage._createCookie(this.cookieName, stringData === '{}' ? '' : stringData, this.expires);
|
92
|
-
return resolve(data);
|
93
|
-
});
|
94
|
-
}
|
95
|
-
/**
|
96
|
-
* @param {string} key
|
97
|
-
* @return {Promise}
|
98
|
-
*/
|
99
|
-
get(key) {
|
100
|
-
return this._read().then(data => data[key] || null);
|
101
|
-
}
|
102
|
-
/**
|
103
|
-
* @param {string} key
|
104
|
-
* @param {object} value
|
105
|
-
* @return {Promise}
|
106
|
-
*/
|
107
|
-
async set(key, value) {
|
108
|
-
const data = await this._read();
|
109
|
-
if (key) {
|
110
|
-
if (value != null) {
|
111
|
-
data[key] = value;
|
112
|
-
} else {
|
113
|
-
Reflect.deleteProperty(data, key);
|
114
|
-
}
|
115
|
-
}
|
116
|
-
await this._write(data);
|
117
|
-
return value;
|
118
|
-
}
|
119
|
-
/**
|
120
|
-
* @param {string} key
|
121
|
-
* @return {Promise}
|
122
|
-
*/
|
123
|
-
async remove(key) {
|
124
|
-
await this.set(key, null);
|
125
|
-
}
|
126
|
-
/**
|
127
|
-
*
|
128
|
-
* @param {function(string, value)} callback
|
129
|
-
* @return {Promise}
|
130
|
-
*/
|
131
|
-
each(callback) {
|
132
|
-
if (typeof callback !== 'function') {
|
133
|
-
return Promise.reject(new Error('Callback is not a function'));
|
134
|
-
}
|
135
|
-
return this._read().then(data => {
|
136
|
-
const promises = [];
|
137
|
-
for (const key in data) {
|
138
|
-
if (data.hasOwnProperty(key)) {
|
139
|
-
promises.push(callback(key, data[key]));
|
140
|
-
}
|
141
|
-
}
|
142
|
-
return Promise.all(promises);
|
143
|
-
});
|
144
|
-
}
|
145
|
-
/**
|
146
|
-
* @param {string} key
|
147
|
-
* @param {Function} callback
|
148
|
-
* @return {Function}
|
149
|
-
*/
|
150
|
-
on(key, callback) {
|
151
|
-
let stop = false;
|
152
|
-
const checkForChange = oldValue => {
|
153
|
-
this.get(key).then(newValue => {
|
154
|
-
if (stop) {
|
155
|
-
return;
|
156
|
-
}
|
157
|
-
if (!deepEqual(oldValue, newValue)) {
|
158
|
-
callback(newValue);
|
159
|
-
}
|
160
|
-
window.setTimeout(() => checkForChange(oldValue), this.checkDelay);
|
161
|
-
});
|
162
|
-
};
|
163
|
-
this.get(key).then(checkForChange);
|
164
|
-
return () => {
|
165
|
-
stop = true;
|
166
|
-
};
|
167
|
-
}
|
168
|
-
}
|
169
|
-
_defineProperty(FallbackStorage, "DEFAULT_COOKIE_NAME", 'localStorage');
|
170
|
-
_defineProperty(FallbackStorage, "DEFAULT_SESSION_COOKIE_NAME", 'sessionStorage');
|
171
|
-
_defineProperty(FallbackStorage, "DEFAULT_CHECK_DELAY", DEFAULT_CHECK_DELAY);
|
172
|
-
_defineProperty(FallbackStorage, "COOKIE_EXPIRES", COOKIE_EXPIRES);
|
173
|
-
/**
|
174
|
-
* Maximum storage size
|
175
|
-
* @see http://browsercookielimits.squawky.net/
|
176
|
-
* @type {number}
|
177
|
-
*/
|
178
|
-
_defineProperty(FallbackStorage, "QUOTA", QUOTA);
|
179
|
-
|
180
|
-
export { FallbackStorage as default };
|