@jetbrains/ring-ui-built 7.0.0-beta.2 → 7.0.0-beta.3
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/_rollupPluginBabelHelpers.js +1 -504
- package/components/_helpers/anchor.js +7 -5
- package/components/_helpers/button__classes.js +15 -13
- package/components/_helpers/caption.js +11 -17
- package/components/_helpers/card.js +92 -96
- package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
- package/components/_helpers/icon__svg.js +27 -23
- package/components/_helpers/input.js +150 -171
- package/components/_helpers/query-assist__suggestions.js +78 -93
- package/components/_helpers/select__filter.js +56 -67
- package/components/_helpers/services-link.js +23 -29
- package/components/_helpers/sidebar.js +91 -93
- package/components/_helpers/tab-link.js +8 -6
- package/components/_helpers/theme.js +41 -50
- package/components/_helpers/title.js +59 -69
- package/components/alert/alert.js +112 -156
- package/components/alert/container.js +32 -39
- package/components/alert-service/alert-service.js +104 -161
- package/components/analytics/analytics.js +12 -20
- package/components/analytics/analytics__custom-plugin.js +52 -68
- package/components/auth/auth.js +2 -27
- package/components/auth/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +742 -1428
- package/components/auth/background-flow.js +84 -121
- package/components/auth/down-notification.js +31 -69
- package/components/auth/iframe-flow.js +70 -123
- package/components/auth/request-builder.js +46 -77
- package/components/auth/response-parser.js +84 -112
- package/components/auth/storage.js +160 -318
- package/components/auth/token-validator.js +132 -227
- package/components/auth/window-flow.js +84 -121
- package/components/auth-dialog/auth-dialog.js +99 -150
- package/components/auth-dialog-service/auth-dialog-service.js +6 -26
- package/components/avatar/avatar-example-datauri.js +1 -1
- package/components/avatar/avatar.js +94 -123
- package/components/avatar/fallback-avatar.js +20 -34
- package/components/badge/badge.js +32 -38
- package/components/breadcrumbs/breadcrumbs.js +13 -17
- package/components/button/button.js +67 -80
- package/components/button-group/button-group.js +27 -36
- package/components/button-set/button-set.js +19 -27
- package/components/button-toolbar/button-toolbar.js +17 -25
- package/components/caret/caret.js +184 -211
- package/components/checkbox/checkbox.js +69 -86
- package/components/clipboard/clipboard-fallback.js +7 -7
- package/components/clipboard/clipboard.js +36 -128
- package/components/code/code.js +83 -151
- package/components/collapse/collapse-content.js +42 -60
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -12
- package/components/collapse/collapse.js +12 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +57 -87
- package/components/confirm-service/confirm-service.js +23 -44
- package/components/content-layout/content-layout.js +41 -56
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.js +38 -46
- package/components/control-help/control-help.js +5 -3
- package/components/control-label/control-label.js +9 -8
- package/components/data-list/data-list.js +113 -156
- package/components/data-list/data-list.mock.js +3 -5
- package/components/data-list/item.js +120 -140
- package/components/data-list/selection.js +77 -135
- package/components/data-list/title.js +2 -10
- package/components/date-picker/consts.js +16 -22
- package/components/date-picker/date-input.js +99 -124
- package/components/date-picker/date-picker.js +140 -184
- package/components/date-picker/date-popup.js +280 -327
- package/components/date-picker/day.js +71 -94
- package/components/date-picker/month-names.js +41 -59
- package/components/date-picker/month-slider.js +42 -61
- package/components/date-picker/month.js +17 -24
- package/components/date-picker/months.js +44 -49
- package/components/date-picker/weekdays.js +12 -21
- package/components/date-picker/years.js +77 -98
- package/components/dialog/dialog.js +151 -187
- package/components/dialog/dialog__body-scroll-preventer.js +0 -3
- package/components/dropdown/anchor.js +0 -6
- package/components/dropdown/dropdown.js +134 -154
- package/components/dropdown-menu/dropdown-menu.js +59 -87
- package/components/editable-heading/editable-heading.js +69 -116
- package/components/error-bubble/error-bubble.js +29 -54
- package/components/error-message/error-message.js +34 -49
- package/components/footer/footer.js +27 -28
- package/components/global/compose.js +1 -8
- package/components/global/composeRefs.d.ts +0 -3
- package/components/global/composeRefs.js +8 -15
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +14 -13
- package/components/global/data-tests.js +7 -12
- package/components/global/dom.js +49 -82
- package/components/global/focus-sensor-hoc.js +99 -106
- package/components/global/fuzzy-highlight.js +23 -34
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +3 -7
- package/components/global/inject-styles.js +7 -14
- package/components/global/listeners.js +28 -47
- package/components/global/memoize.js +6 -10
- package/components/global/normalize-indent.js +19 -46
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +29 -40
- package/components/global/rerender-hoc.js +16 -32
- package/components/global/schedule-raf.js +4 -4
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.js +1 -18
- package/components/global/trivial-template-tag.js +4 -9
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -23
- package/components/global/use-event-callback.js +7 -4
- package/components/grid/col.js +27 -39
- package/components/grid/grid.js +18 -27
- package/components/grid/row.js +23 -30
- package/components/group/group.js +16 -22
- package/components/header/header-icon.js +19 -31
- package/components/header/header.d.ts +0 -1
- package/components/header/header.js +30 -64
- package/components/header/links.js +6 -3
- package/components/header/logo.js +15 -26
- package/components/header/profile.js +124 -150
- package/components/header/services-link.js +1 -3
- package/components/header/services.js +64 -97
- package/components/header/smart-profile.js +101 -178
- package/components/header/smart-services.js +55 -90
- package/components/header/tray.js +21 -30
- package/components/heading/heading.js +21 -20
- package/components/http/http.js +162 -319
- package/components/http/http.mock.js +50 -98
- package/components/hub-source/hub-source.js +77 -182
- package/components/hub-source/hub-source__user.js +9 -37
- package/components/hub-source/hub-source__users-groups.js +34 -60
- package/components/i18n/i18n-context.js +7 -8
- package/components/i18n/i18n.js +3 -6
- package/components/icon/icon.js +60 -74
- package/components/icon/icon__svg.js +0 -5
- package/components/icon/index.js +0 -5
- package/components/input/input.js +1 -11
- package/components/island/adaptive-island-hoc.js +29 -37
- package/components/island/content.js +100 -110
- package/components/island/header.js +56 -66
- package/components/island/island.js +25 -33
- package/components/island-legacy/content-legacy.js +16 -22
- package/components/island-legacy/header-legacy.js +19 -25
- package/components/island-legacy/island-legacy.js +16 -22
- package/components/link/clickableLink.js +33 -42
- package/components/link/link.js +47 -55
- package/components/list/consts.js +2 -2
- package/components/list/list.js +399 -486
- package/components/list/list__custom.js +51 -61
- package/components/list/list__hint.js +9 -17
- package/components/list/list__item.js +147 -178
- package/components/list/list__link.js +38 -47
- package/components/list/list__separator.js +15 -24
- package/components/list/list__title.js +25 -34
- package/components/list/list__users-groups-source.js +55 -121
- package/components/loader/loader.js +38 -60
- package/components/loader/loader__core.js +123 -184
- package/components/loader-inline/loader-inline.js +24 -32
- package/components/loader-screen/loader-screen.js +24 -40
- package/components/login-dialog/login-dialog.js +81 -121
- package/components/login-dialog/service.js +6 -29
- package/components/markdown/markdown.js +16 -24
- package/components/message/message.js +170 -201
- package/components/old-browsers-message/old-browsers-message.js +11 -14
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
- package/components/old-browsers-message/white-list.js +8 -13
- package/components/pager/pager.js +212 -257
- package/components/panel/panel.js +16 -22
- package/components/permissions/permissions.js +118 -161
- package/components/permissions/permissions__cache.js +191 -218
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +237 -288
- package/components/popup/popup.target.js +9 -7
- package/components/popup/position.js +94 -101
- package/components/popup-menu/popup-menu.js +33 -67
- package/components/progress-bar/progress-bar.js +57 -68
- package/components/query-assist/query-assist.js +583 -652
- package/components/query-assist/query-assist__suggestions.js +2 -26
- package/components/radio/radio.js +15 -27
- package/components/radio/radio__item.js +52 -62
- package/components/scrollable-section/scrollable-section.js +22 -32
- package/components/select/select.js +693 -793
- package/components/select/select__filter.js +1 -26
- package/components/select/select__popup.js +316 -413
- package/components/shortcuts/core.js +147 -195
- package/components/shortcuts/shortcut-title.js +6 -10
- package/components/shortcuts/shortcuts-hoc.js +23 -41
- package/components/shortcuts/shortcuts.js +41 -64
- package/components/slider/slider.js +93 -112
- package/components/slider/slider.utils.js +16 -23
- package/components/storage/storage.js +3 -27
- package/components/storage/storage__fallback.js +137 -210
- package/components/storage/storage__local.js +89 -147
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +35 -53
- package/components/table/cell.js +11 -21
- package/components/table/disable-hover-hoc.js +27 -42
- package/components/table/header-cell.js +59 -75
- package/components/table/header.js +89 -110
- package/components/table/multitable.js +83 -89
- package/components/table/row-with-focus-sensor.js +25 -57
- package/components/table/row.js +169 -200
- package/components/table/selection-adapter.js +2 -2
- package/components/table/selection-shortcuts-hoc.js +108 -113
- package/components/table/selection.js +150 -217
- package/components/table/simple-table.js +19 -55
- package/components/table/smart-table.js +42 -76
- package/components/table/table.js +267 -327
- package/components/tabs/collapsible-more.js +47 -73
- package/components/tabs/collapsible-tab.js +32 -36
- package/components/tabs/collapsible-tabs.js +89 -148
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +60 -92
- package/components/tabs/smart-tabs.js +29 -61
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tab.js +15 -24
- package/components/tabs/tabs.js +1 -26
- package/components/tag/tag.d.ts +0 -2
- package/components/tag/tag.js +120 -162
- package/components/tags-input/tags-input.js +222 -304
- package/components/tags-list/tags-list.js +45 -61
- package/components/text/text.js +28 -37
- package/components/toggle/toggle.js +51 -61
- package/components/tooltip/tooltip.js +109 -141
- package/components/user-agreement/service.js +259 -400
- package/components/user-agreement/user-agreement.js +80 -108
- package/components/user-card/card.js +1 -25
- package/components/user-card/smart-user-card-tooltip.js +52 -103
- package/components/user-card/tooltip.js +35 -65
- package/components/user-card/user-card.js +1 -25
- package/package.json +1 -1
- package/components/global/react-render-adapter.d.ts +0 -1
- package/components/global/react-render-adapter.js +0 -6
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
@@ -1,11 +1,11 @@
|
|
1
1
|
import { createContext } from 'react';
|
2
2
|
import { BASE_ANIMATION_DURATION } from './consts.js';
|
3
3
|
|
4
|
-
|
4
|
+
const CollapseContext = /*#__PURE__*/createContext({
|
5
5
|
collapsed: true,
|
6
6
|
duration: BASE_ANIMATION_DURATION,
|
7
7
|
disableAnimation: false,
|
8
|
-
setCollapsed:
|
8
|
+
setCollapsed: () => {},
|
9
9
|
id: ''
|
10
10
|
});
|
11
11
|
|
@@ -3,20 +3,20 @@ import joinDataTestAttributes from '../global/data-tests.js';
|
|
3
3
|
import { CollapseContext } from './collapse-context.js';
|
4
4
|
import { COLLAPSE_CONTROL_TEST_ID } from './consts.js';
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
6
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
7
|
-
import 'core-js/modules/es.array.concat.js';
|
8
6
|
import 'core-js/modules/es.array.reduce.js';
|
9
|
-
import 'core-js/modules/
|
10
|
-
import 'core-js/modules/es.object.to-string.js';
|
7
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
9
|
+
const CollapseControl = _ref => {
|
10
|
+
let {
|
11
|
+
children,
|
12
|
+
'data-test': dataTest
|
13
|
+
} = _ref;
|
14
|
+
const {
|
15
|
+
setCollapsed,
|
16
|
+
collapsed,
|
17
|
+
id
|
18
|
+
} = useContext(CollapseContext);
|
19
|
+
const child = useMemo(() => {
|
20
20
|
if (typeof children === 'function') {
|
21
21
|
return children(collapsed);
|
22
22
|
}
|
@@ -1,25 +1,20 @@
|
|
1
|
-
import
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
2
2
|
import { useState, useId, useCallback } from 'react';
|
3
3
|
import { CollapseContext } from './collapse-context.js';
|
4
4
|
import { BASE_ANIMATION_DURATION } from './consts.js';
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
duration =
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
_useState2 = _slicedToArray(_useState, 2),
|
19
|
-
collapsed = _useState2[0],
|
20
|
-
toggle = _useState2[1];
|
21
|
-
var id = useId();
|
22
|
-
var setCollapsed = useCallback(function () {
|
7
|
+
const Collapse = _ref => {
|
8
|
+
let {
|
9
|
+
children,
|
10
|
+
duration = BASE_ANIMATION_DURATION,
|
11
|
+
disableAnimation = false,
|
12
|
+
className = '',
|
13
|
+
onChange = () => {}
|
14
|
+
} = _ref;
|
15
|
+
const [collapsed, toggle] = useState(true);
|
16
|
+
const id = useId();
|
17
|
+
const setCollapsed = useCallback(() => {
|
23
18
|
toggle(!collapsed);
|
24
19
|
onChange(!collapsed);
|
25
20
|
}, [toggle, onChange, collapsed]);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
const COLLAPSE_CONTROL_TEST_ID = 'ring-collapse-control';
|
2
|
+
const COLLAPSE_CONTENT_CONTAINER_TEST_ID = 'ring-collapse-content-container';
|
3
|
+
const COLLAPSE_CONTENT_TEST_ID = 'ring-collapse-content';
|
4
|
+
const BASE_ANIMATION_DURATION = 200;
|
5
5
|
|
6
6
|
export { BASE_ANIMATION_DURATION, COLLAPSE_CONTENT_CONTAINER_TEST_ID, COLLAPSE_CONTENT_TEST_ID, COLLAPSE_CONTROL_TEST_ID };
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import { _ as _defineProperty
|
2
|
-
import 'core-js/modules/es.symbol.js';
|
1
|
+
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
3
2
|
import 'core-js/modules/es.symbol.description.js';
|
4
|
-
import 'core-js/modules/
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
5
4
|
import { PureComponent } from 'react';
|
6
5
|
import PropTypes from 'prop-types';
|
7
6
|
import Dialog from '../dialog/dialog.js';
|
@@ -15,33 +14,16 @@ import 'react-dom';
|
|
15
14
|
import 'classnames';
|
16
15
|
import '@jetbrains/icons/close';
|
17
16
|
import '../global/get-uid.js';
|
18
|
-
import 'core-js/modules/es.object.to-string.js';
|
19
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
20
17
|
import '../global/data-tests.js';
|
21
18
|
import 'core-js/modules/es.array.reduce.js';
|
22
|
-
import 'core-js/modules/es.object.entries.js';
|
23
19
|
import '../shortcuts/shortcuts.js';
|
24
|
-
import 'core-js/modules/es.array.map.js';
|
25
20
|
import '../shortcuts/core.js';
|
26
|
-
import 'core-js/modules/es.array.find-index.js';
|
27
|
-
import 'core-js/modules/es.array.includes.js';
|
28
|
-
import 'core-js/modules/es.array.slice.js';
|
29
|
-
import 'core-js/modules/es.array.splice.js';
|
30
|
-
import 'core-js/modules/es.object.assign.js';
|
31
21
|
import 'core-js/modules/es.regexp.exec.js';
|
32
|
-
import 'core-js/modules/es.string.includes.js';
|
33
|
-
import 'core-js/modules/es.string.match.js';
|
34
22
|
import 'combokeys';
|
35
23
|
import '../global/sniffer.js';
|
36
24
|
import 'sniffr';
|
37
25
|
import '../tab-trap/tab-trap.js';
|
38
|
-
import 'core-js/modules/es.array.filter.js';
|
39
26
|
import '../global/dom.js';
|
40
|
-
import 'core-js/modules/es.array.iterator.js';
|
41
|
-
import 'core-js/modules/es.set.js';
|
42
|
-
import 'core-js/modules/es.string.split.js';
|
43
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
44
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
45
27
|
import '../popup/popup.target.js';
|
46
28
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
47
29
|
import 'scrollbar-width';
|
@@ -56,82 +38,70 @@ import 'util-deprecate';
|
|
56
38
|
import '../icon/icon__constants.js';
|
57
39
|
import '../_helpers/icon__svg.js';
|
58
40
|
import 'core-js/modules/es.string.replace.js';
|
59
|
-
import 'core-js/modules/es.string.starts-with.js';
|
60
41
|
import '../global/memoize.js';
|
61
|
-
import 'core-js/modules/es.map.js';
|
62
|
-
import 'core-js/modules/es.weak-map.js';
|
63
42
|
import '../link/clickableLink.js';
|
64
43
|
import '../global/controls-height.js';
|
65
44
|
import '../_helpers/button__classes.js';
|
66
45
|
|
67
46
|
var modules_4c9c3a3a = {"light":"light_rui_2ac4","description":"description_rui_f040"};
|
68
47
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
}
|
76
|
-
_this = _callSuper(this, Confirm, [].concat(args));
|
77
|
-
_defineProperty(_this, "onEscPress", function () {
|
78
|
-
if (_this.props.rejectOnEsc) {
|
79
|
-
_this.props.onReject();
|
48
|
+
class Confirm extends PureComponent {
|
49
|
+
constructor() {
|
50
|
+
super(...arguments);
|
51
|
+
_defineProperty(this, "onEscPress", () => {
|
52
|
+
if (this.props.rejectOnEsc) {
|
53
|
+
this.props.onReject();
|
80
54
|
}
|
81
55
|
});
|
82
|
-
return _this;
|
83
56
|
}
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
children:
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
primary: cancelIsDefault,
|
128
|
-
children: rejectLabel
|
129
|
-
})]
|
57
|
+
render() {
|
58
|
+
const {
|
59
|
+
show,
|
60
|
+
className,
|
61
|
+
inProgress,
|
62
|
+
cancelIsDefault,
|
63
|
+
text,
|
64
|
+
description,
|
65
|
+
confirmLabel,
|
66
|
+
rejectLabel,
|
67
|
+
onConfirm,
|
68
|
+
onReject,
|
69
|
+
native
|
70
|
+
} = this.props;
|
71
|
+
return /*#__PURE__*/jsxs(Dialog, {
|
72
|
+
label: text || (typeof description === 'string' ? description : undefined),
|
73
|
+
className: className,
|
74
|
+
onEscPress: this.onEscPress,
|
75
|
+
show: show,
|
76
|
+
trapFocus: true,
|
77
|
+
"data-test": "ring-confirm",
|
78
|
+
native: native,
|
79
|
+
children: [text && /*#__PURE__*/jsx(HeaderWrapper, {
|
80
|
+
children: text
|
81
|
+
}), description && /*#__PURE__*/jsx(ContentWrapper, {
|
82
|
+
children: /*#__PURE__*/jsx("div", {
|
83
|
+
className: modules_4c9c3a3a.description,
|
84
|
+
children: description
|
85
|
+
})
|
86
|
+
}), /*#__PURE__*/jsxs(Panel, {
|
87
|
+
children: [/*#__PURE__*/jsx(Button, {
|
88
|
+
"data-test": "confirm-ok-button",
|
89
|
+
primary: !cancelIsDefault,
|
90
|
+
loader: inProgress,
|
91
|
+
disabled: inProgress,
|
92
|
+
onClick: onConfirm,
|
93
|
+
children: confirmLabel
|
94
|
+
}), /*#__PURE__*/jsx(Button, {
|
95
|
+
"data-test": "confirm-reject-button",
|
96
|
+
onClick: onReject,
|
97
|
+
disabled: inProgress,
|
98
|
+
primary: cancelIsDefault,
|
99
|
+
children: rejectLabel
|
130
100
|
})]
|
131
|
-
})
|
132
|
-
}
|
133
|
-
}
|
134
|
-
}
|
101
|
+
})]
|
102
|
+
});
|
103
|
+
}
|
104
|
+
}
|
135
105
|
_defineProperty(Confirm, "propTypes", {
|
136
106
|
className: PropTypes.string,
|
137
107
|
text: PropTypes.string,
|
@@ -154,8 +124,8 @@ _defineProperty(Confirm, "defaultProps", {
|
|
154
124
|
cancelIsDefault: false,
|
155
125
|
confirmLabel: 'OK',
|
156
126
|
rejectLabel: 'Cancel',
|
157
|
-
onConfirm:
|
158
|
-
onReject:
|
127
|
+
onConfirm: () => {},
|
128
|
+
onReject: () => {}
|
159
129
|
});
|
160
130
|
|
161
131
|
export { Confirm as default };
|
@@ -1,13 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
import 'core-js/modules/es.symbol.js';
|
1
|
+
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
3
2
|
import 'core-js/modules/es.symbol.description.js';
|
4
|
-
import 'core-js/modules/es.object.to-string.js';
|
5
|
-
import 'core-js/modules/es.promise.js';
|
6
3
|
import { createRoot } from 'react-dom/client';
|
7
4
|
import Confirm from '../confirm/confirm.js';
|
8
5
|
import { ControlsHeightContext, getGlobalControlsHeight } from '../global/controls-height.js';
|
9
6
|
import { jsx } from 'react/jsx-runtime';
|
10
|
-
import 'core-js/modules/
|
7
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
11
8
|
import 'react';
|
12
9
|
import 'prop-types';
|
13
10
|
import '../dialog/dialog.js';
|
@@ -17,7 +14,6 @@ import '@jetbrains/icons/close';
|
|
17
14
|
import '../island/island.js';
|
18
15
|
import '../global/data-tests.js';
|
19
16
|
import 'core-js/modules/es.array.reduce.js';
|
20
|
-
import 'core-js/modules/es.object.entries.js';
|
21
17
|
import '../island/adaptive-island-hoc.js';
|
22
18
|
import '../global/linear-function.js';
|
23
19
|
import '../_helpers/island.js';
|
@@ -26,29 +22,14 @@ import '../island/content.js';
|
|
26
22
|
import 'element-resize-detector';
|
27
23
|
import '../global/schedule-raf.js';
|
28
24
|
import '../global/get-uid.js';
|
29
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
30
25
|
import '../shortcuts/shortcuts.js';
|
31
|
-
import 'core-js/modules/es.array.map.js';
|
32
26
|
import '../shortcuts/core.js';
|
33
|
-
import 'core-js/modules/es.array.find-index.js';
|
34
|
-
import 'core-js/modules/es.array.includes.js';
|
35
|
-
import 'core-js/modules/es.array.slice.js';
|
36
|
-
import 'core-js/modules/es.array.splice.js';
|
37
|
-
import 'core-js/modules/es.object.assign.js';
|
38
27
|
import 'core-js/modules/es.regexp.exec.js';
|
39
|
-
import 'core-js/modules/es.string.includes.js';
|
40
|
-
import 'core-js/modules/es.string.match.js';
|
41
28
|
import 'combokeys';
|
42
29
|
import '../global/sniffer.js';
|
43
30
|
import 'sniffr';
|
44
31
|
import '../tab-trap/tab-trap.js';
|
45
|
-
import 'core-js/modules/es.array.filter.js';
|
46
32
|
import '../global/dom.js';
|
47
|
-
import 'core-js/modules/es.array.iterator.js';
|
48
|
-
import 'core-js/modules/es.set.js';
|
49
|
-
import 'core-js/modules/es.string.split.js';
|
50
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
51
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
52
33
|
import '../button/button.js';
|
53
34
|
import '@jetbrains/icons/chevron-down';
|
54
35
|
import '../icon/icon.js';
|
@@ -56,10 +37,7 @@ import 'util-deprecate';
|
|
56
37
|
import '../icon/icon__constants.js';
|
57
38
|
import '../_helpers/icon__svg.js';
|
58
39
|
import 'core-js/modules/es.string.replace.js';
|
59
|
-
import 'core-js/modules/es.string.starts-with.js';
|
60
40
|
import '../global/memoize.js';
|
61
|
-
import 'core-js/modules/es.map.js';
|
62
|
-
import 'core-js/modules/es.weak-map.js';
|
63
41
|
import '../link/clickableLink.js';
|
64
42
|
import '../_helpers/button__classes.js';
|
65
43
|
import '../popup/popup.target.js';
|
@@ -67,15 +45,16 @@ import '../_helpers/dialog__body-scroll-preventer.js';
|
|
67
45
|
import 'scrollbar-width';
|
68
46
|
import '../panel/panel.js';
|
69
47
|
|
70
|
-
|
71
|
-
|
72
|
-
|
48
|
+
const _excluded = ["buttonsHeight"];
|
49
|
+
const containerElement = document.createElement('div');
|
50
|
+
const reactRoot = createRoot(containerElement);
|
73
51
|
/**
|
74
52
|
* Renders Confirm into virtual node to skip maintaining container
|
75
53
|
*/
|
76
54
|
function renderConfirm(props) {
|
77
|
-
|
78
|
-
|
55
|
+
const {
|
56
|
+
buttonsHeight = getGlobalControlsHeight()
|
57
|
+
} = props,
|
79
58
|
restProps = _objectWithoutProperties(props, _excluded);
|
80
59
|
reactRoot.render( /*#__PURE__*/jsx(ControlsHeightContext.Provider, {
|
81
60
|
value: buttonsHeight,
|
@@ -83,17 +62,17 @@ function renderConfirm(props) {
|
|
83
62
|
}));
|
84
63
|
}
|
85
64
|
function confirm(_ref) {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
confirmLabel =
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
return new Promise(
|
96
|
-
|
65
|
+
let {
|
66
|
+
text,
|
67
|
+
description,
|
68
|
+
confirmLabel = 'OK',
|
69
|
+
rejectLabel = 'Cancel',
|
70
|
+
cancelIsDefault,
|
71
|
+
onBeforeConfirm,
|
72
|
+
buttonsHeight
|
73
|
+
} = _ref;
|
74
|
+
return new Promise((resolve, reject) => {
|
75
|
+
const props = {
|
97
76
|
text,
|
98
77
|
description,
|
99
78
|
confirmLabel,
|
@@ -101,17 +80,17 @@ function confirm(_ref) {
|
|
101
80
|
cancelIsDefault,
|
102
81
|
buttonsHeight,
|
103
82
|
show: true,
|
104
|
-
onConfirm:
|
83
|
+
onConfirm: () => {
|
105
84
|
if (onBeforeConfirm) {
|
106
85
|
renderConfirm(_objectSpread2(_objectSpread2({}, props), {}, {
|
107
86
|
inProgress: true
|
108
87
|
}));
|
109
|
-
return Promise.resolve(onBeforeConfirm()).then(
|
88
|
+
return Promise.resolve(onBeforeConfirm()).then(() => {
|
110
89
|
renderConfirm(_objectSpread2(_objectSpread2({}, props), {}, {
|
111
90
|
show: false
|
112
91
|
}));
|
113
92
|
resolve();
|
114
|
-
}).catch(
|
93
|
+
}).catch(err => {
|
115
94
|
renderConfirm(_objectSpread2(_objectSpread2({}, props), {}, {
|
116
95
|
show: false
|
117
96
|
}));
|
@@ -123,7 +102,7 @@ function confirm(_ref) {
|
|
123
102
|
}));
|
124
103
|
return resolve();
|
125
104
|
},
|
126
|
-
onReject:
|
105
|
+
onReject: () => {
|
127
106
|
renderConfirm(_objectSpread2(_objectSpread2({}, props), {}, {
|
128
107
|
show: false
|
129
108
|
}));
|
@@ -1,71 +1,56 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import 'core-js/modules/
|
3
|
-
import '
|
4
|
-
import 'core-js/modules/es.object.to-string.js';
|
5
|
-
import 'core-js/modules/es.promise.js';
|
6
|
-
import { Children, cloneElement, Component } from 'react';
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
|
+
import { Component, Children, cloneElement } from 'react';
|
7
4
|
import PropTypes from 'prop-types';
|
8
5
|
import classNames from 'classnames';
|
9
6
|
import { m as modules_b8a9dd4f, S as Sidebar } from '../_helpers/sidebar.js';
|
10
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
11
8
|
import 'react-waypoint';
|
12
9
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
19
|
-
args[_key] = arguments[_key];
|
20
|
-
}
|
21
|
-
_this = _callSuper(this, ContentLayout, [].concat(args));
|
22
|
-
_defineProperty(_this, "state", {
|
10
|
+
const _excluded = ["children", "className", "contentClassName", "responsive"];
|
11
|
+
class ContentLayout extends Component {
|
12
|
+
constructor() {
|
13
|
+
super(...arguments);
|
14
|
+
_defineProperty(this, "state", {
|
23
15
|
contentNode: null
|
24
16
|
});
|
25
|
-
_defineProperty(
|
26
|
-
|
17
|
+
_defineProperty(this, "saveContentNode", contentNode => {
|
18
|
+
this.setState({
|
27
19
|
contentNode
|
28
20
|
});
|
29
21
|
});
|
30
|
-
return _this;
|
31
22
|
}
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
children: contentChildren
|
64
|
-
})]
|
65
|
-
}));
|
66
|
-
}
|
67
|
-
}]);
|
68
|
-
}(Component);
|
23
|
+
render() {
|
24
|
+
const _this$props = this.props,
|
25
|
+
{
|
26
|
+
children,
|
27
|
+
className,
|
28
|
+
contentClassName,
|
29
|
+
responsive
|
30
|
+
} = _this$props,
|
31
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
32
|
+
const classes = classNames(modules_b8a9dd4f.contentLayout, className, {
|
33
|
+
[modules_b8a9dd4f.contentLayoutResponsive]: responsive
|
34
|
+
});
|
35
|
+
const contentClasses = classNames(modules_b8a9dd4f.contentLayoutContent, contentClassName);
|
36
|
+
const childrenArray = Children.toArray(children);
|
37
|
+
const sidebarChild = childrenArray.filter(child => child != null && typeof child === 'object' && 'type' in child && child.type === Sidebar)[0];
|
38
|
+
const sidebar = sidebarChild && /*#__PURE__*/cloneElement(sidebarChild, {
|
39
|
+
contentNode: this.state.contentNode
|
40
|
+
});
|
41
|
+
const contentChildren = childrenArray.filter(child => child !== sidebarChild);
|
42
|
+
return /*#__PURE__*/jsxs("div", _objectSpread2(_objectSpread2({
|
43
|
+
"data-test": "content-layout"
|
44
|
+
}, restProps), {}, {
|
45
|
+
className: classes,
|
46
|
+
children: [sidebar, /*#__PURE__*/jsx("main", {
|
47
|
+
className: contentClasses,
|
48
|
+
ref: this.saveContentNode,
|
49
|
+
children: contentChildren
|
50
|
+
})]
|
51
|
+
}));
|
52
|
+
}
|
53
|
+
}
|
69
54
|
_defineProperty(ContentLayout, "propTypes", {
|
70
55
|
children: PropTypes.node,
|
71
56
|
className: PropTypes.string,
|