@jetbrains/ring-ui-built 8.0.0-beta.4 → 8.0.0-beta.5

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.
Files changed (65) hide show
  1. package/components/_helpers/alert.js +3 -0
  2. package/components/_helpers/caption.js +1 -1
  3. package/components/_helpers/header.js +1 -1
  4. package/components/_helpers/table.js +1 -1
  5. package/components/alert/alert-actions.d.ts +4 -0
  6. package/components/alert/alert-actions.js +51 -0
  7. package/components/alert/alert-heading.d.ts +4 -0
  8. package/components/alert/alert-heading.js +62 -0
  9. package/components/alert/alert.d.ts +14 -1
  10. package/components/alert/alert.js +43 -25
  11. package/components/alert-service/alert-service.d.ts +2 -1
  12. package/components/alert-service/alert-service.js +15 -5
  13. package/components/auth/auth-core.d.ts +5 -9
  14. package/components/auth/auth-core.js +71 -17
  15. package/components/auth/auth.js +7 -1
  16. package/components/auth/down-notification.js +7 -1
  17. package/components/auth/storage.js +7 -1
  18. package/components/clipboard/clipboard.js +7 -1
  19. package/components/date-picker/consts.d.ts +1 -0
  20. package/components/date-picker/date-input.js +3 -2
  21. package/components/header/header.js +7 -1
  22. package/components/header/smart-profile.js +7 -1
  23. package/components/http/http.d.ts +2 -2
  24. package/components/http/http.js +2 -2
  25. package/components/i18n/i18n.d.ts +1 -0
  26. package/components/i18n/i18n.js +2 -0
  27. package/components/internal/reorder-animation-context.js +159 -0
  28. package/components/internal/reorder-handle.js +750 -0
  29. package/components/internal/reorder-layout-context.js +141 -0
  30. package/components/internal/table-header.js +221 -645
  31. package/components/internal/{virtual-items.js → virtualization.js} +29 -14
  32. package/components/old-browsers-message/white-list.js +2 -2
  33. package/components/storage/storage-local.js +7 -1
  34. package/components/storage/storage.js +7 -1
  35. package/components/style.css +1 -1
  36. package/components/table/default-item-renderer.d.ts +7 -1
  37. package/components/table/default-item-renderer.js +119 -67
  38. package/components/table/internal/reorder-animation-context.d.ts +21 -0
  39. package/components/table/internal/reorder-handle.d.ts +9 -0
  40. package/components/table/internal/reorder-layout-context.d.ts +16 -0
  41. package/components/table/internal/table-header.d.ts +1 -4
  42. package/components/table/internal/{virtual-items.d.ts → virtualization.d.ts} +10 -3
  43. package/components/table/item-virtualization.d.ts +5 -3
  44. package/components/table/item-virtualization.js +13 -11
  45. package/components/table/reorder-animation.d.ts +37 -0
  46. package/components/table/reorder-animation.js +18 -0
  47. package/components/table/reorder-item-layout.d.ts +32 -0
  48. package/components/table/reorder-item-layout.js +57 -0
  49. package/components/table/table-const.d.ts +0 -32
  50. package/components/table/table-const.js +1 -8
  51. package/components/table/table-primitives.d.ts +43 -0
  52. package/components/table/table-primitives.js +62 -5
  53. package/components/table/table-props.d.ts +29 -5
  54. package/components/table/table.d.ts +31 -5
  55. package/components/table/table.js +177 -170
  56. package/components/user-agreement/service.js +7 -1
  57. package/components/user-card/card.js +7 -1
  58. package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
  59. package/components/user-card/smart-user-card-tooltip.js +7 -1
  60. package/components/user-card/tooltip.js +7 -1
  61. package/components/user-card/user-card.js +7 -1
  62. package/components/util-stories.d.ts +2 -2
  63. package/package.json +2 -2
  64. package/components/internal/column-animation.js +0 -133
  65. package/components/table/internal/column-animation.d.ts +0 -16
@@ -12,8 +12,9 @@ import '../global/get-uid.js';
12
12
  import '../alert/alert.js';
13
13
  import 'classnames';
14
14
  import '@jetbrains/icons/exception';
15
- import '@jetbrains/icons/checkmark';
15
+ import '@jetbrains/icons/success';
16
16
  import '@jetbrains/icons/warning';
17
+ import '@jetbrains/icons/info-filled';
17
18
  import '@jetbrains/icons/close';
18
19
  import '../icon/icon.js';
19
20
  import 'util-deprecate';
@@ -32,6 +33,11 @@ import '../global/controls-height.js';
32
33
  import '../global/configuration.js';
33
34
  import '../_helpers/button.classes.js';
34
35
  import '../_helpers/theme.js';
36
+ import '../alert/alert-heading.js';
37
+ import '../heading/heading.js';
38
+ import '../_helpers/heading.js';
39
+ import '../_helpers/alert.js';
40
+ import '../alert/alert-actions.js';
35
41
  import '../alert/container.js';
36
42
  import 'react-dom';
37
43
  import '../link/link.js';
@@ -11,8 +11,9 @@ import '../alert/container.js';
11
11
  import 'react-dom';
12
12
  import 'classnames';
13
13
  import '@jetbrains/icons/exception';
14
- import '@jetbrains/icons/checkmark';
14
+ import '@jetbrains/icons/success';
15
15
  import '@jetbrains/icons/warning';
16
+ import '@jetbrains/icons/info-filled';
16
17
  import '@jetbrains/icons/close';
17
18
  import '../icon/icon.js';
18
19
  import 'util-deprecate';
@@ -30,6 +31,11 @@ import '../global/controls-height.js';
30
31
  import '../global/configuration.js';
31
32
  import '../_helpers/button.classes.js';
32
33
  import '../_helpers/theme.js';
34
+ import '../alert/alert-heading.js';
35
+ import '../heading/heading.js';
36
+ import '../_helpers/heading.js';
37
+ import '../_helpers/alert.js';
38
+ import '../alert/alert-actions.js';
33
39
  import '../_helpers/link.js';
34
40
 
35
41
  var styles = {"title":"ring-down-notification-title","error":"ring-down-notification-error"};
@@ -6,8 +6,9 @@ import '../alert/alert.js';
6
6
  import 'react';
7
7
  import 'classnames';
8
8
  import '@jetbrains/icons/exception';
9
- import '@jetbrains/icons/checkmark';
9
+ import '@jetbrains/icons/success';
10
10
  import '@jetbrains/icons/warning';
11
+ import '@jetbrains/icons/info-filled';
11
12
  import '@jetbrains/icons/close';
12
13
  import '../icon/icon.js';
13
14
  import 'util-deprecate';
@@ -27,6 +28,11 @@ import '../global/controls-height.js';
27
28
  import '../global/configuration.js';
28
29
  import '../_helpers/button.classes.js';
29
30
  import '../_helpers/theme.js';
31
+ import '../alert/alert-heading.js';
32
+ import '../heading/heading.js';
33
+ import '../_helpers/heading.js';
34
+ import '../_helpers/alert.js';
35
+ import '../alert/alert-actions.js';
30
36
  import '../alert/container.js';
31
37
  import 'react-dom';
32
38
 
@@ -6,8 +6,9 @@ import '../alert/alert.js';
6
6
  import 'react';
7
7
  import 'classnames';
8
8
  import '@jetbrains/icons/exception';
9
- import '@jetbrains/icons/checkmark';
9
+ import '@jetbrains/icons/success';
10
10
  import '@jetbrains/icons/warning';
11
+ import '@jetbrains/icons/info-filled';
11
12
  import '@jetbrains/icons/close';
12
13
  import '../icon/icon.js';
13
14
  import 'util-deprecate';
@@ -27,6 +28,11 @@ import '../global/controls-height.js';
27
28
  import '../global/configuration.js';
28
29
  import '../_helpers/button.classes.js';
29
30
  import '../_helpers/theme.js';
31
+ import '../alert/alert-heading.js';
32
+ import '../heading/heading.js';
33
+ import '../_helpers/heading.js';
34
+ import '../_helpers/alert.js';
35
+ import '../alert/alert-actions.js';
30
36
  import '../alert/container.js';
31
37
  import 'react-dom';
32
38
 
@@ -34,6 +34,7 @@ export interface DateInputTranslations {
34
34
  addSecondDate?: string;
35
35
  addTime?: string;
36
36
  selectName?: string;
37
+ selectDate?: string;
37
38
  }
38
39
  export interface DateSpecificPopupProps {
39
40
  withTime?: false | undefined;
@@ -93,6 +93,7 @@ class DateInput extends React.PureComponent {
93
93
  locale
94
94
  } = this.props;
95
95
  const {
96
+ messages,
96
97
  translate
97
98
  } = this.context;
98
99
  let displayText = '';
@@ -105,7 +106,7 @@ class DateInput extends React.PureComponent {
105
106
  } else if (name === 'time') {
106
107
  displayText = time || '';
107
108
  }
108
- const placeholder = ((_translations$addFirs, _translations$addSeco, _translations$addTime, _translations$selectN) => {
109
+ const placeholder = ((_translations$addFirs, _translations$addSeco, _translations$addTime, _ref, _ref2, _ref3, _translations$selectD) => {
109
110
  switch (name) {
110
111
  case 'from':
111
112
  return fromPlaceholder || ((_translations$addFirs = translations?.addFirstDate) !== null && _translations$addFirs !== void 0 ? _translations$addFirs : translate('addFirstDate'));
@@ -114,7 +115,7 @@ class DateInput extends React.PureComponent {
114
115
  case 'time':
115
116
  return timePlaceholder || ((_translations$addTime = translations?.addTime) !== null && _translations$addTime !== void 0 ? _translations$addTime : translate('addTime'));
116
117
  default:
117
- return ((_translations$selectN = translations?.selectName) !== null && _translations$selectN !== void 0 ? _translations$selectN : translate('selectName')).replace('%name%', name).replace('{{name}}', name);
118
+ return ((_ref = (_ref2 = (_ref3 = (_translations$selectD = translations?.selectDate) !== null && _translations$selectD !== void 0 ? _translations$selectD : translations?.selectName) !== null && _ref3 !== void 0 ? _ref3 : messages.selectDate) !== null && _ref2 !== void 0 ? _ref2 : messages.selectName) !== null && _ref !== void 0 ? _ref : translate('selectDate')).replace('%name%', name).replace('{{name}}', name);
118
119
  }
119
120
  })();
120
121
  const classes = classNames(styles.filter, name !== 'time' && styles[`${name}Input`], divider && (name === 'from' || name === 'time') && styles[`${name}InputWithDivider`], 'ring-js-shortcuts');
@@ -79,10 +79,16 @@ import '../alert-service/alert-service.js';
79
79
  import 'react-dom/client';
80
80
  import '../alert/alert.js';
81
81
  import '@jetbrains/icons/exception';
82
- import '@jetbrains/icons/checkmark';
82
+ import '@jetbrains/icons/success';
83
83
  import '@jetbrains/icons/warning';
84
+ import '@jetbrains/icons/info-filled';
84
85
  import '@jetbrains/icons/close';
85
86
  import '../loader-inline/loader-inline.js';
87
+ import '../alert/alert-heading.js';
88
+ import '../heading/heading.js';
89
+ import '../_helpers/heading.js';
90
+ import '../_helpers/alert.js';
91
+ import '../alert/alert-actions.js';
86
92
  import '../alert/container.js';
87
93
  import '../auth/auth.js';
88
94
  import '../auth/window-flow.js';
@@ -9,8 +9,9 @@ import '../global/get-uid.js';
9
9
  import '../alert/alert.js';
10
10
  import 'classnames';
11
11
  import '@jetbrains/icons/exception';
12
- import '@jetbrains/icons/checkmark';
12
+ import '@jetbrains/icons/success';
13
13
  import '@jetbrains/icons/warning';
14
+ import '@jetbrains/icons/info-filled';
14
15
  import '@jetbrains/icons/close';
15
16
  import '../icon/icon.js';
16
17
  import 'util-deprecate';
@@ -29,6 +30,11 @@ import '../global/controls-height.js';
29
30
  import '../global/configuration.js';
30
31
  import '../_helpers/button.classes.js';
31
32
  import '../_helpers/theme.js';
33
+ import '../alert/alert-heading.js';
34
+ import '../heading/heading.js';
35
+ import '../_helpers/heading.js';
36
+ import '../_helpers/alert.js';
37
+ import '../alert/alert-actions.js';
32
38
  import '../alert/container.js';
33
39
  import 'react-dom';
34
40
  import '../avatar/avatar.js';
@@ -20,7 +20,7 @@ export interface RequestParams<RawBody extends boolean = true | false> extends F
20
20
  export type RequestParamsWithoutMethod<RawBody extends boolean = boolean> = Omit<RequestParams<RawBody>, 'method'>;
21
21
  export interface HTTPAuth {
22
22
  requestToken(): Promise<string | null> | string | null;
23
- forceTokenUpdate(): Promise<string | null>;
23
+ forceTokenUpdate(failedToken?: string | null): Promise<string | null>;
24
24
  }
25
25
  export default class HTTP implements Partial<HTTPAuth> {
26
26
  baseUrl: string | null | undefined;
@@ -28,7 +28,7 @@ export default class HTTP implements Partial<HTTPAuth> {
28
28
  fetchConfig: RequestInit;
29
29
  requestToken?: () => Promise<string | null> | string | null;
30
30
  shouldRefreshToken?: (error: string) => boolean;
31
- forceTokenUpdate?: () => Promise<string | null>;
31
+ forceTokenUpdate?: (failedToken?: string | null) => Promise<string | null>;
32
32
  constructor(auth?: HTTPAuth, baseUrl?: string | null | undefined, fetchConfig?: RequestInit);
33
33
  setAuth: (auth: HTTPAuth) => void;
34
34
  setBaseUrl: (baseUrl: string | null | undefined) => void;
@@ -54,7 +54,7 @@ class HTTP {
54
54
  setAuth = auth => {
55
55
  this.requestToken = () => auth.requestToken();
56
56
  this.shouldRefreshToken = auth.constructor.shouldRefreshToken;
57
- this.forceTokenUpdate = () => auth.forceTokenUpdate();
57
+ this.forceTokenUpdate = failedToken => auth.forceTokenUpdate(failedToken);
58
58
  };
59
59
  setBaseUrl = baseUrl => {
60
60
  this.baseUrl = baseUrl;
@@ -170,7 +170,7 @@ class HTTP {
170
170
  }
171
171
  const shouldRefreshToken = typeof error.data.error === 'string' ? this.shouldRefreshToken?.(error.data.error) : false;
172
172
  if (shouldRefreshToken) {
173
- token = await this.forceTokenUpdate?.();
173
+ token = await this.forceTokenUpdate?.(token);
174
174
  response = await this._performRequest(url, token, params);
175
175
  return this._processResponse(response);
176
176
  }
@@ -23,6 +23,7 @@ export declare function getTranslations(): Partial<{
23
23
  addSecondDate: string;
24
24
  addTime: string;
25
25
  selectName: string;
26
+ selectDate: string;
26
27
  setDate: string;
27
28
  setDateTime: string;
28
29
  setPeriod: string;
@@ -18,6 +18,7 @@ var addFirstDate = "Add first date";
18
18
  var addSecondDate = "Add second date";
19
19
  var addTime = "Add time";
20
20
  var selectName = "Select {{name}}";
21
+ var selectDate = "Select a date";
21
22
  var setDate = "Set a date";
22
23
  var setDateTime = "Set date and time";
23
24
  var setPeriod = "Set a period";
@@ -70,6 +71,7 @@ var defaultMessages = {
70
71
  addSecondDate: addSecondDate,
71
72
  addTime: addTime,
72
73
  selectName: selectName,
74
+ selectDate: selectDate,
73
75
  setDate: setDate,
74
76
  setDateTime: setDateTime,
75
77
  setPeriod: setPeriod,
@@ -0,0 +1,159 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { createContext, useState, useRef, useEffect } from 'react';
3
+ import { parseCssDuration } from '../global/parse-css-duration.js';
4
+ import { requestAnimationFrameWithCleanup, setTimeoutWithCleanup } from '../global/schedule-with-cleanup.js';
5
+ import { s as styles } from '../_helpers/table.js';
6
+
7
+ /** How long to wait for the data to change after {@link expectReorder} is called. */
8
+ const pendingReorderTimeoutMs = 1000;
9
+ const ReorderAnimationContext = /*#__PURE__*/createContext({
10
+ reorderAnimation: null,
11
+ expectReorder: () => {}
12
+ });
13
+ function useReorderAnimationContextValue(t0) {
14
+ const $ = c(20);
15
+ if ($[0] !== "669a1fb3f5ac9a1cdad72a7fc204b97d9b35bce2182bb3bb8f0bd0acb524b958") {
16
+ for (let $i = 0; $i < 20; $i += 1) {
17
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
18
+ }
19
+ $[0] = "669a1fb3f5ac9a1cdad72a7fc204b97d9b35bce2182bb3bb8f0bd0acb524b958";
20
+ }
21
+ const {
22
+ noColumnReorderAnimation,
23
+ noItemReorderAnimation,
24
+ tableRef,
25
+ data,
26
+ columns
27
+ } = t0;
28
+ const [reorderAnimation, setReorderAnimation] = useState(null);
29
+ const pendingReorderRef = useRef(null);
30
+ let t1;
31
+ if ($[1] !== columns || $[2] !== data || $[3] !== noColumnReorderAnimation || $[4] !== noItemReorderAnimation) {
32
+ t1 = function expectReorder(reorderSpec) {
33
+ const isColumn = reorderSpec.direction === "columns";
34
+ if (isColumn && noColumnReorderAnimation || !isColumn && noItemReorderAnimation) {
35
+ return;
36
+ }
37
+ if (pendingReorderRef.current) {
38
+ window.clearTimeout(pendingReorderRef.current.timerId);
39
+ }
40
+ const timerId = window.setTimeout(() => {
41
+ pendingReorderRef.current = null;
42
+ }, pendingReorderTimeoutMs);
43
+ pendingReorderRef.current = {
44
+ ...reorderSpec,
45
+ timerId,
46
+ columns,
47
+ data
48
+ };
49
+ };
50
+ $[1] = columns;
51
+ $[2] = data;
52
+ $[3] = noColumnReorderAnimation;
53
+ $[4] = noItemReorderAnimation;
54
+ $[5] = t1;
55
+ } else {
56
+ t1 = $[5];
57
+ }
58
+ const expectReorder = t1;
59
+ let t2;
60
+ let t3;
61
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
62
+ t2 = () => () => {
63
+ if (pendingReorderRef.current) {
64
+ window.clearTimeout(pendingReorderRef.current.timerId);
65
+ pendingReorderRef.current = null;
66
+ }
67
+ };
68
+ t3 = [];
69
+ $[6] = t2;
70
+ $[7] = t3;
71
+ } else {
72
+ t2 = $[6];
73
+ t3 = $[7];
74
+ }
75
+ useEffect(t2, t3);
76
+ let t4;
77
+ let t5;
78
+ if ($[8] !== columns || $[9] !== data || $[10] !== tableRef) {
79
+ t4 = () => {
80
+ const table = tableRef.current;
81
+ const pendingReorder = pendingReorderRef.current;
82
+ if (!table || !pendingReorder) {
83
+ return;
84
+ }
85
+ const {
86
+ direction,
87
+ data: pendingData,
88
+ columns: pendingColumns
89
+ } = pendingReorder;
90
+ const isColumn_0 = direction === "columns";
91
+ if (isColumn_0 && columns === pendingColumns || !isColumn_0 && data === pendingData) {
92
+ return;
93
+ }
94
+ pendingReorderRef.current = null;
95
+ const {
96
+ fromIndex,
97
+ insertionIndex
98
+ } = pendingReorder;
99
+ const index = fromIndex < insertionIndex ? insertionIndex - 1 : insertionIndex;
100
+ return requestAnimationFrameWithCleanup(() => setReorderAnimation(prev => prev == null ? {
101
+ direction,
102
+ index,
103
+ phase: "initial",
104
+ className: styles.reorderAnimationInitial
105
+ } : prev));
106
+ };
107
+ t5 = [data, columns, tableRef];
108
+ $[8] = columns;
109
+ $[9] = data;
110
+ $[10] = tableRef;
111
+ $[11] = t4;
112
+ $[12] = t5;
113
+ } else {
114
+ t4 = $[11];
115
+ t5 = $[12];
116
+ }
117
+ useEffect(t4, t5);
118
+ let t6;
119
+ let t7;
120
+ if ($[13] !== reorderAnimation || $[14] !== tableRef) {
121
+ t6 = () => {
122
+ if (reorderAnimation?.phase === "initial") {
123
+ return requestAnimationFrameWithCleanup(() => setReorderAnimation(prev_0 => prev_0 === reorderAnimation ? {
124
+ ...prev_0,
125
+ phase: "fade-out",
126
+ className: styles.reorderAnimationFadeOut
127
+ } : prev_0));
128
+ }
129
+ if (reorderAnimation?.phase === "fade-out") {
130
+ const fadeOutMs = parseCssDuration(window.getComputedStyle(tableRef.current).getPropertyValue("--reorder-animation-fade-out-duration"));
131
+ return setTimeoutWithCleanup(() => setReorderAnimation(prev_1 => prev_1 === reorderAnimation ? null : prev_1), fadeOutMs);
132
+ }
133
+ };
134
+ t7 = [reorderAnimation, tableRef];
135
+ $[13] = reorderAnimation;
136
+ $[14] = tableRef;
137
+ $[15] = t6;
138
+ $[16] = t7;
139
+ } else {
140
+ t6 = $[15];
141
+ t7 = $[16];
142
+ }
143
+ useEffect(t6, t7);
144
+ let t8;
145
+ if ($[17] !== expectReorder || $[18] !== reorderAnimation) {
146
+ t8 = {
147
+ reorderAnimation,
148
+ expectReorder
149
+ };
150
+ $[17] = expectReorder;
151
+ $[18] = reorderAnimation;
152
+ $[19] = t8;
153
+ } else {
154
+ t8 = $[19];
155
+ }
156
+ return t8;
157
+ }
158
+
159
+ export { ReorderAnimationContext, useReorderAnimationContextValue };