@jetbrains/ring-ui 5.0.102 → 5.0.104

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.
@@ -40,12 +40,12 @@ export default class HTTP implements Partial<HTTPAuth> {
40
40
  private _storeRequestMeta;
41
41
  private _processResponse;
42
42
  private static _isErrorStatus;
43
- fetch: (url: string, params?: FetchParams) => Promise<any>;
43
+ fetch: <T = any>(url: string, params?: FetchParams) => Promise<T>;
44
44
  authorizedFetch(...args: Parameters<HTTP['_performRequest']>): Promise<any>;
45
- request: (url: string, params?: RequestParams) => Promise<any>;
45
+ request: <T = any>(url: string, params?: RequestParams) => Promise<T>;
46
46
  getMetaForResponse: (response: object) => Partial<Response> | undefined;
47
- get: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
48
- post: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
49
- delete: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
50
- put: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
47
+ get: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
48
+ post: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
49
+ delete: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
50
+ put: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
51
51
  }
@@ -123,6 +123,8 @@ export default class HTTP {
123
123
  static _isErrorStatus(status) {
124
124
  return status < STATUS_OK_IF_MORE_THAN || status >= STATUS_BAD_IF_MORE_THAN;
125
125
  }
126
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
127
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
126
128
  fetch = async (url, params = {}) => {
127
129
  const { body, query = {}, ...fetchConfig } = params;
128
130
  const response = await this._fetch(this._makeRequestUrl(url, query), {
@@ -136,6 +138,8 @@ export default class HTTP {
136
138
  const response = await this._performRequest(...args);
137
139
  return this._processResponse(response);
138
140
  }
141
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
142
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
139
143
  request = async (url, params) => {
140
144
  let token = await this.requestToken?.();
141
145
  let response = await this._performRequest(url, token, params);
@@ -159,18 +163,26 @@ export default class HTTP {
159
163
  }
160
164
  };
161
165
  getMetaForResponse = (response) => this._requestsMeta.get(response);
166
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
167
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
162
168
  get = (url, params) => (this.request(url, {
163
169
  ...params,
164
170
  method: 'GET'
165
171
  }));
172
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
173
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
166
174
  post = (url, params) => (this.request(url, {
167
175
  ...params,
168
176
  method: 'POST'
169
177
  }));
178
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
179
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
170
180
  delete = (url, params) => (this.request(url, {
171
181
  ...params,
172
182
  method: 'DELETE'
173
183
  }));
184
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
185
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
174
186
  put = (url, params) => (this.request(url, {
175
187
  ...params,
176
188
  method: 'PUT'
@@ -15,10 +15,10 @@ export interface UserCardWording {
15
15
  banned: string;
16
16
  online: string;
17
17
  offline: string;
18
- copyToClipboard: string;
19
- copiedToClipboard: string;
20
- copingToClipboardError: string;
21
- unverified: string;
18
+ copyToClipboard?: string;
19
+ copiedToClipboard?: string;
20
+ copingToClipboardError?: string;
21
+ unverified?: string;
22
22
  }
23
23
  export interface UserCardProps extends HTMLAttributes<HTMLDivElement> {
24
24
  user: UserCardUser;
@@ -46,11 +46,12 @@ export default class UserCard extends PureComponent {
46
46
  }
47
47
  };
48
48
  copyEmail = () => {
49
- const { user, wording } = this.props;
50
- clipboard.copyText(user.email || '', wording.copiedToClipboard, wording.copingToClipboardError);
49
+ const wording = { ...UserCard.defaultProps.wording, ...this.props.wording };
50
+ clipboard.copyText(this.props.user.email || '', wording.copiedToClipboard, wording.copingToClipboardError);
51
51
  };
52
52
  render() {
53
- const { children, info, className, user, wording, avatarInfo, ...restProps } = this.props;
53
+ const { children, info, className, user, avatarInfo, ...restProps } = this.props;
54
+ const wording = { ...UserCard.defaultProps.wording, ...this.props.wording };
54
55
  const classes = classNames(className, {});
55
56
  const userActiveStatusClasses = classNames(styles.userActiveStatus, user.online ? styles.online : '');
56
57
  return (<div className={classes} {...restProps}>
@@ -16,11 +16,11 @@ class UserCard extends PureComponent {
16
16
  constructor() {
17
17
  super(...arguments);
18
18
  _defineProperty(this, "copyEmail", () => {
19
- const {
20
- user,
21
- wording
22
- } = this.props;
23
- clipboard.copyText(user.email || '', wording.copiedToClipboard, wording.copingToClipboardError);
19
+ const wording = {
20
+ ...UserCard.defaultProps.wording,
21
+ ...this.props.wording
22
+ };
23
+ clipboard.copyText(this.props.user.email || '', wording.copiedToClipboard, wording.copingToClipboardError);
24
24
  });
25
25
  }
26
26
  render() {
@@ -29,10 +29,13 @@ class UserCard extends PureComponent {
29
29
  info,
30
30
  className,
31
31
  user,
32
- wording,
33
32
  avatarInfo,
34
33
  ...restProps
35
34
  } = this.props;
35
+ const wording = {
36
+ ...UserCard.defaultProps.wording,
37
+ ...this.props.wording
38
+ };
36
39
  const classes = classNames(className, {});
37
40
  const userActiveStatusClasses = classNames(modules_a4196c17.userActiveStatus, user.online ? modules_a4196c17.online : '');
38
41
  return /*#__PURE__*/React.createElement("div", _extends({
@@ -40,12 +40,12 @@ export default class HTTP implements Partial<HTTPAuth> {
40
40
  private _storeRequestMeta;
41
41
  private _processResponse;
42
42
  private static _isErrorStatus;
43
- fetch: (url: string, params?: FetchParams) => Promise<any>;
43
+ fetch: <T = any>(url: string, params?: FetchParams) => Promise<T>;
44
44
  authorizedFetch(...args: Parameters<HTTP['_performRequest']>): Promise<any>;
45
- request: (url: string, params?: RequestParams) => Promise<any>;
45
+ request: <T = any>(url: string, params?: RequestParams) => Promise<T>;
46
46
  getMetaForResponse: (response: object) => Partial<Response> | undefined;
47
- get: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
48
- post: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
49
- delete: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
50
- put: (url: string, params?: RequestParamsWithoutMethod) => Promise<any>;
47
+ get: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
48
+ post: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
49
+ delete: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
50
+ put: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
51
51
  }
package/dist/http/http.js CHANGED
@@ -203,10 +203,15 @@ class HTTP {
203
203
  static _isErrorStatus(status) {
204
204
  return status < STATUS_OK_IF_MORE_THAN || status >= STATUS_BAD_IF_MORE_THAN;
205
205
  }
206
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
207
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
208
+
206
209
  async authorizedFetch() {
207
210
  const response = await this._performRequest(...arguments);
208
211
  return this._processResponse(response);
209
212
  }
213
+ // TODO: Replace any to never/unknown in next release and remove eslint-disable
214
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
210
215
  }
211
216
 
212
217
  export { CODE, HTTPError, HTTP as default, defaultFetchConfig };
@@ -15,10 +15,10 @@ export interface UserCardWording {
15
15
  banned: string;
16
16
  online: string;
17
17
  offline: string;
18
- copyToClipboard: string;
19
- copiedToClipboard: string;
20
- copingToClipboardError: string;
21
- unverified: string;
18
+ copyToClipboard?: string;
19
+ copiedToClipboard?: string;
20
+ copingToClipboardError?: string;
21
+ unverified?: string;
22
22
  }
23
23
  export interface UserCardProps extends HTMLAttributes<HTMLDivElement> {
24
24
  user: UserCardUser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "5.0.102",
3
+ "version": "5.0.104",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -84,19 +84,19 @@
84
84
  "@rollup/plugin-replace": "^5.0.2",
85
85
  "@storybook/addon-a11y": "6.5.16",
86
86
  "@storybook/addon-docs": "6.5.16",
87
- "@storybook/addon-essentials": "6.5.15",
87
+ "@storybook/addon-essentials": "6.5.16",
88
88
  "@storybook/addon-storyshots": "6.5.16",
89
89
  "@storybook/addon-storyshots-puppeteer": "6.5.16",
90
90
  "@storybook/addon-storysource": "6.5.16",
91
91
  "@storybook/addons": "6.5.16",
92
92
  "@storybook/builder-webpack5": "6.5.16",
93
- "@storybook/client-api": "6.5.15",
93
+ "@storybook/client-api": "6.5.16",
94
94
  "@storybook/core": "6.5.16",
95
95
  "@storybook/html": "6.5.16",
96
- "@storybook/manager-webpack5": "6.5.15",
96
+ "@storybook/manager-webpack5": "6.5.16",
97
97
  "@storybook/react": "6.5.16",
98
98
  "@storybook/source-loader": "6.5.16",
99
- "@storybook/theming": "6.5.15",
99
+ "@storybook/theming": "6.5.16",
100
100
  "@testing-library/react": "^13.4.0",
101
101
  "@testing-library/user-event": "^14.4.3",
102
102
  "@types/chai": "^4.3.4",
@@ -125,7 +125,7 @@
125
125
  "core-js": "^3.27.2",
126
126
  "cpy-cli": "^3.1.1",
127
127
  "enzyme": "^3.11.0",
128
- "eslint": "^8.32.0",
128
+ "eslint": "^8.33.0",
129
129
  "eslint-import-resolver-webpack": "^0.13.2",
130
130
  "eslint-plugin-angular": "^4.1.0",
131
131
  "eslint-plugin-bdd": "^2.1.1",
@@ -151,14 +151,14 @@
151
151
  "merge-options": "^3.0.4",
152
152
  "mocha": "^10.2.0",
153
153
  "pinst": "^3.0.0",
154
- "puppeteer": "^19.6.1",
154
+ "puppeteer": "^19.6.2",
155
155
  "raw-loader": "^4.0.2",
156
156
  "react": "^18.2.0",
157
157
  "react-dom": "^18.2.0",
158
158
  "react-test-renderer": "^18.2.0",
159
159
  "regenerator-runtime": "^0.13.11",
160
160
  "rimraf": "^4.1.2",
161
- "rollup": "^3.11.0",
161
+ "rollup": "^3.12.0",
162
162
  "rollup-plugin-clear": "^2.0.7",
163
163
  "rollup-plugin-styles": "^4.0.0",
164
164
  "sinon": "^15.0.1",
@@ -240,7 +240,7 @@
240
240
  "postcss-font-family-system-ui": "^5.0.0",
241
241
  "postcss-loader": "^7.0.2",
242
242
  "postcss-modules-values-replace": "^3.4.0",
243
- "postcss-preset-env": "^8.0.0",
243
+ "postcss-preset-env": "^8.0.1",
244
244
  "prop-types": "^15.8.1",
245
245
  "react-markdown": "^8.0.5",
246
246
  "react-movable": "^3.0.4",