@adecore/ui 0.31.12 → 0.32.0
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/dist/AccentSwatches.js +290 -13
- package/dist/Banner.js +90 -9
- package/dist/Button.js +114 -22
- package/dist/ButtonGroup.js +62 -8
- package/dist/Checkbox.js +73 -4
- package/dist/ChoiceCards.js +205 -11
- package/dist/CloseButton.js +87 -7
- package/dist/ColorSwatch.js +132 -15
- package/dist/ColorWheelPicker.js +305 -71
- package/dist/ColumnResizeHandle.js +43 -8
- package/dist/DisabledReason.js +27 -8
- package/dist/DockShell.js +144 -37
- package/dist/EmptyState.js +95 -6
- package/dist/ErrorBoundary.js +254 -31
- package/dist/Field.js +349 -31
- package/dist/FileIcon.js +67 -6
- package/dist/Icon.js +38 -6
- package/dist/IconButton.js +176 -20
- package/dist/IconPicker.js +344 -73
- package/dist/Input.js +233 -14
- package/dist/Kbd.js +150 -10
- package/dist/LazyBoundary.js +14 -5
- package/dist/ListRow.js +75 -15
- package/dist/Meter.js +108 -5
- package/dist/MiddleTruncate.js +126 -45
- package/dist/PanelEmpty.js +64 -5
- package/dist/PanelHeader.js +95 -13
- package/dist/Pill.js +114 -19
- package/dist/ProjectSwitcher.js +225 -12
- package/dist/PromptDialog.js +352 -37
- package/dist/SectionLabel.js +62 -8
- package/dist/SegmentBar.js +197 -36
- package/dist/Segmented.js +130 -23
- package/dist/Select.js +310 -19
- package/dist/SelectSearch.js +344 -29
- package/dist/Separator.js +35 -4
- package/dist/ShortcutHints.js +146 -76
- package/dist/Skeleton.js +31 -4
- package/dist/Slider.js +172 -10
- package/dist/SlidingColumn.js +194 -34
- package/dist/Spinner.js +100 -3
- package/dist/Stepper.js +232 -11
- package/dist/Surface.js +62 -8
- package/dist/Switch.js +60 -6
- package/dist/TextMenu.js +212 -17
- package/dist/Tile.js +149 -5
- package/dist/Toasts.js +391 -33
- package/dist/Tooltip.js +153 -16
- package/dist/UIProvider.js +62 -15
- package/dist/Waveform.js +362 -93
- package/dist/Wipe.js +259 -34
- package/dist/ZoomControls.js +356 -14
- package/dist/class-name.js +1 -1
- package/dist/clipboard.js +15 -17
- package/dist/context-menu/index.parts.js +1 -1
- package/dist/dialog/index.parts.js +1 -1
- package/dist/dialog/parts.js +378 -29
- package/dist/dialog-layer.js +51 -18
- package/dist/error-boundary.js +19 -19
- package/dist/error-message.js +1 -1
- package/dist/field-context.js +7 -5
- package/dist/file-icon.js +23 -21
- package/dist/file-tree/helpers.js +133 -119
- package/dist/file-tree/index.parts.js +3 -3
- package/dist/file-tree/parts.js +418 -127
- package/dist/file-tree/style.js +1 -1
- package/dist/file-tree/use-file-tree-shift.js +43 -30
- package/dist/file-tree/use-file-tree.js +60 -18
- package/dist/file-tree/use-slots.js +220 -192
- package/dist/floating.js +2 -2
- package/dist/format/datetime.js +88 -38
- package/dist/format/duration.js +59 -53
- package/dist/format/index.js +1 -1
- package/dist/format/locale.js +76 -56
- package/dist/format/number.js +77 -61
- package/dist/format/regions.js +4 -2
- package/dist/format/time-zone.js +1 -1
- package/dist/icon-button-size.js +12 -2
- package/dist/icon-picker.js +70 -61
- package/dist/index.js +57 -57
- package/dist/key-value-list/index.parts.js +1 -1
- package/dist/key-value-list/parts.js +256 -22
- package/dist/lazy-landings.js +10 -10
- package/dist/lazy.js +84 -71
- package/dist/locales/en.js +80 -80
- package/dist/locales/nl.js +80 -80
- package/dist/locales.js +10 -7
- package/dist/menu/index.parts.js +1 -1
- package/dist/menu/parts.js +882 -44
- package/dist/merge-refs.js +8 -9
- package/dist/middle-truncate.js +24 -25
- package/dist/modality.js +27 -19
- package/dist/placement.js +11 -20
- package/dist/platform.js +6 -6
- package/dist/popover/index.parts.js +1 -1
- package/dist/popover/parts.js +173 -11
- package/dist/popup-layer.js +38 -17
- package/dist/prefetch.js +78 -79
- package/dist/preview-card/index.parts.js +1 -1
- package/dist/project-switcher-row.js +153 -12
- package/dist/select-row.js +69 -5
- package/dist/select-shared.js +6 -6
- package/dist/selection.js +16 -16
- package/dist/seti-icons.js +413 -413
- package/dist/settings/ConfirmDialog.js +55 -8
- package/dist/settings/DetailHeader.js +72 -4
- package/dist/settings/MasterDetail.js +119 -7
- package/dist/settings/SettingsDialog.js +820 -80
- package/dist/settings/SettingsRow.js +205 -18
- package/dist/settings/SettingsSection.js +96 -6
- package/dist/settings/index.js +7 -7
- package/dist/settings/target.js +7 -2
- package/dist/shortcut-hints.js +73 -55
- package/dist/shortcut.js +140 -104
- package/dist/step-places.js +1 -1
- package/dist/tabs/index.parts.js +1 -1
- package/dist/tabs/overflow.js +18 -18
- package/dist/tabs/parts.js +780 -166
- package/dist/testing/dedupe.js +82 -75
- package/dist/testing/fake-source.js +12 -12
- package/dist/testing/index.js +1 -1
- package/dist/toast-store.js +65 -46
- package/dist/tree/index.parts.js +1 -1
- package/dist/tree/parts.js +721 -94
- package/dist/tree/shift.js +28 -22
- package/dist/tree/style.js +2 -2
- package/dist/tree/use-tree-shift.js +178 -117
- package/dist/useAsyncAction.js +23 -19
- package/dist/useColumnResize.js +36 -34
- package/dist/useContentSize.js +62 -18
- package/dist/useMeasuredWidth.js +14 -3
- package/dist/useNow.js +73 -30
- package/dist/wipe-split.js +14 -14
- package/dist/workspace/DropPreview.js +60 -7
- package/dist/workspace/SplitView.js +1025 -441
- package/dist/workspace/TabStrip.js +810 -191
- package/dist/workspace/Workspace.js +276 -26
- package/dist/workspace/context.js +8 -3
- package/dist/workspace/geometry.js +173 -150
- package/dist/workspace/model.js +313 -250
- package/dist/workspace/preview.js +61 -61
- package/dist/zoom.js +2 -2
- package/package.json +1 -1
- package/src/ErrorBoundary.tsx +1 -1
- package/src/Field.tsx +4 -3
- package/src/IconPicker.tsx +3 -3
- package/src/LazyBoundary.tsx +2 -0
- package/src/MiddleTruncate.tsx +2 -2
- package/src/SegmentBar.tsx +2 -2
- package/src/Toasts.tsx +3 -1
- package/src/Tooltip.tsx +7 -10
- package/src/Waveform.tsx +3 -3
- package/src/file-tree/parts.tsx +6 -9
- package/src/file-tree/use-file-tree-shift.tsx +6 -9
- package/src/lazy.tsx +4 -0
- package/src/locales/en.ts +4 -4
- package/src/locales/nl.ts +5 -5
- package/src/settings/SettingsDialog.tsx +1 -1
- package/src/tree/parts.tsx +5 -8
- package/src/useContentSize.ts +3 -3
- package/src/workspace/SplitView.tsx +2 -2
- package/src/workspace/TabStrip.tsx +2 -3
- package/src/workspace/Workspace.tsx +2 -5
|
@@ -1,211 +1,830 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext, useContext,
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
import { useRender } from '@base-ui/react/use-render';
|
|
4
4
|
import { Pin, X } from 'lucide-react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { Icon } from
|
|
8
|
-
import { IconButton } from
|
|
9
|
-
import { Tooltip } from
|
|
7
|
+
import { Icon } from "../Icon.js";
|
|
8
|
+
import { IconButton } from "../IconButton.js";
|
|
9
|
+
import { Tooltip } from "../Tooltip.js";
|
|
10
10
|
import { tabGapAt, tabRevealScrollLeft } from './geometry.js';
|
|
11
11
|
/* Where an arrow, Home or End moves the selection from `index`, wrapping at either end; null for any other key. */
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
function tabIndexForKey(key, index, count) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
switch (key) {
|
|
15
|
+
case 'ArrowRight':
|
|
16
|
+
return (index + 1) % count;
|
|
17
|
+
case 'ArrowLeft':
|
|
18
|
+
return (index + count - 1) % count;
|
|
19
|
+
case 'Home':
|
|
20
|
+
return 0;
|
|
21
|
+
case 'End':
|
|
22
|
+
return count - 1;
|
|
23
|
+
default:
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
25
26
|
}
|
|
26
|
-
export function TabStrip(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
export function TabStrip(t0) {
|
|
28
|
+
const $ = _c(93);
|
|
29
|
+
let className;
|
|
30
|
+
let insertAt;
|
|
31
|
+
let items;
|
|
32
|
+
let onClose;
|
|
33
|
+
let onContextMenu;
|
|
34
|
+
let onDoubleClick;
|
|
35
|
+
let onDragEnd;
|
|
36
|
+
let onDragStart;
|
|
37
|
+
let onTabDragOver;
|
|
38
|
+
let onTabDrop;
|
|
39
|
+
let onValueChange;
|
|
40
|
+
let props;
|
|
41
|
+
let ref;
|
|
42
|
+
let render;
|
|
43
|
+
let renderTab;
|
|
44
|
+
let t1;
|
|
45
|
+
let value;
|
|
46
|
+
if ($[0] !== t0) {
|
|
47
|
+
({
|
|
48
|
+
items,
|
|
49
|
+
value,
|
|
50
|
+
onValueChange,
|
|
51
|
+
renderTab,
|
|
52
|
+
focused: t1,
|
|
53
|
+
insertAt,
|
|
54
|
+
onClose,
|
|
55
|
+
onDoubleClick,
|
|
56
|
+
onContextMenu,
|
|
57
|
+
onDragStart,
|
|
58
|
+
onDragEnd,
|
|
59
|
+
onTabDragOver,
|
|
60
|
+
onTabDrop,
|
|
61
|
+
render,
|
|
62
|
+
className,
|
|
63
|
+
ref,
|
|
64
|
+
...props
|
|
65
|
+
} = t0);
|
|
66
|
+
$[0] = t0;
|
|
67
|
+
$[1] = className;
|
|
68
|
+
$[2] = insertAt;
|
|
69
|
+
$[3] = items;
|
|
70
|
+
$[4] = onClose;
|
|
71
|
+
$[5] = onContextMenu;
|
|
72
|
+
$[6] = onDoubleClick;
|
|
73
|
+
$[7] = onDragEnd;
|
|
74
|
+
$[8] = onDragStart;
|
|
75
|
+
$[9] = onTabDragOver;
|
|
76
|
+
$[10] = onTabDrop;
|
|
77
|
+
$[11] = onValueChange;
|
|
78
|
+
$[12] = props;
|
|
79
|
+
$[13] = ref;
|
|
80
|
+
$[14] = render;
|
|
81
|
+
$[15] = renderTab;
|
|
82
|
+
$[16] = t1;
|
|
83
|
+
$[17] = value;
|
|
84
|
+
} else {
|
|
85
|
+
className = $[1];
|
|
86
|
+
insertAt = $[2];
|
|
87
|
+
items = $[3];
|
|
88
|
+
onClose = $[4];
|
|
89
|
+
onContextMenu = $[5];
|
|
90
|
+
onDoubleClick = $[6];
|
|
91
|
+
onDragEnd = $[7];
|
|
92
|
+
onDragStart = $[8];
|
|
93
|
+
onTabDragOver = $[9];
|
|
94
|
+
onTabDrop = $[10];
|
|
95
|
+
onValueChange = $[11];
|
|
96
|
+
props = $[12];
|
|
97
|
+
ref = $[13];
|
|
98
|
+
render = $[14];
|
|
99
|
+
renderTab = $[15];
|
|
100
|
+
t1 = $[16];
|
|
101
|
+
value = $[17];
|
|
102
|
+
}
|
|
103
|
+
const focused = t1 === undefined ? true : t1;
|
|
104
|
+
const {
|
|
105
|
+
t
|
|
106
|
+
} = useTranslation("ui");
|
|
107
|
+
const strip = useRef(null);
|
|
108
|
+
const closingFocus = useRef(null);
|
|
109
|
+
let t2;
|
|
110
|
+
if ($[18] !== items) {
|
|
111
|
+
t2 = () => {
|
|
112
|
+
if (closingFocus.current && !items.some(item => item.id === closingFocus.current)) {
|
|
113
|
+
closingFocus.current = null;
|
|
114
|
+
const target = strip.current?.querySelector("[aria-selected=\"true\"]") ?? strip.current?.querySelector("[role=\"tab\"]");
|
|
115
|
+
target?.focus({
|
|
116
|
+
preventScroll: true
|
|
117
|
+
});
|
|
118
|
+
}
|
|
47
119
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// Stays set after the active tab changes, as its width can settle frames later; a person's own scroll ends it.
|
|
66
|
-
const revealing = useRef(false);
|
|
67
|
-
const reveal = () => {
|
|
68
|
-
const element = strip.current;
|
|
69
|
-
const selected = element?.querySelector('[aria-selected="true"]');
|
|
70
|
-
if (!revealing.current || !element || !selected) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const container = selected.closest('[data-document-tab]');
|
|
74
|
-
const tab = container && element.contains(container) ? container : selected;
|
|
75
|
-
const fade = parseFloat(getComputedStyle(element).getPropertyValue('--fade-size')) || 0;
|
|
76
|
-
const bounds = element.getBoundingClientRect();
|
|
77
|
-
const rect = tab.getBoundingClientRect();
|
|
78
|
-
const left = tabRevealScrollLeft(element, rect.left - bounds.left - element.clientLeft + element.scrollLeft, rect.width, fade);
|
|
79
|
-
if (left !== element.scrollLeft) {
|
|
80
|
-
element.scrollLeft = left;
|
|
81
|
-
}
|
|
120
|
+
$[18] = items;
|
|
121
|
+
$[19] = t2;
|
|
122
|
+
} else {
|
|
123
|
+
t2 = $[19];
|
|
124
|
+
}
|
|
125
|
+
useLayoutEffect(t2);
|
|
126
|
+
let t3;
|
|
127
|
+
if ($[20] !== onClose) {
|
|
128
|
+
t3 = (id, action) => {
|
|
129
|
+
if (strip.current?.contains(strip.current.ownerDocument.activeElement)) {
|
|
130
|
+
closingFocus.current = id;
|
|
131
|
+
}
|
|
132
|
+
if (action) {
|
|
133
|
+
action();
|
|
134
|
+
} else {
|
|
135
|
+
onClose?.(id);
|
|
136
|
+
}
|
|
82
137
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
138
|
+
$[20] = onClose;
|
|
139
|
+
$[21] = t3;
|
|
140
|
+
} else {
|
|
141
|
+
t3 = $[21];
|
|
142
|
+
}
|
|
143
|
+
const close = t3;
|
|
144
|
+
let t4;
|
|
145
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
146
|
+
t4 = {
|
|
147
|
+
start: false,
|
|
148
|
+
end: false
|
|
149
|
+
};
|
|
150
|
+
$[22] = t4;
|
|
151
|
+
} else {
|
|
152
|
+
t4 = $[22];
|
|
153
|
+
}
|
|
154
|
+
const [edges, setEdges] = useState(t4);
|
|
155
|
+
const [insertion, setInsertion] = useState(0);
|
|
156
|
+
let t5;
|
|
157
|
+
if ($[23] !== insertAt) {
|
|
158
|
+
t5 = () => {
|
|
159
|
+
const element = strip.current;
|
|
160
|
+
if (!element) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const start = element.scrollLeft > 0;
|
|
164
|
+
const end = element.scrollLeft + element.clientWidth < element.scrollWidth - 1;
|
|
165
|
+
setEdges(current => current.start === start && current.end === end ? current : {
|
|
166
|
+
start,
|
|
167
|
+
end
|
|
168
|
+
});
|
|
169
|
+
if (insertAt !== undefined && insertAt !== null) {
|
|
170
|
+
const tabs = Array.from(element.querySelectorAll("[data-document-tab]"));
|
|
171
|
+
const after = tabs[insertAt];
|
|
172
|
+
const last = tabs.at(-1);
|
|
173
|
+
setInsertion(after?.offsetLeft ?? (last ? last.offsetLeft + last.offsetWidth : 0));
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
$[23] = insertAt;
|
|
177
|
+
$[24] = t5;
|
|
178
|
+
} else {
|
|
179
|
+
t5 = $[24];
|
|
180
|
+
}
|
|
181
|
+
const measure = t5;
|
|
182
|
+
const revealing = useRef(false);
|
|
183
|
+
let t6;
|
|
184
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
185
|
+
t6 = () => {
|
|
186
|
+
const element_0 = strip.current;
|
|
187
|
+
const selected = element_0?.querySelector("[aria-selected=\"true\"]");
|
|
188
|
+
if (!revealing.current || !element_0 || !selected) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const container = selected.closest("[data-document-tab]");
|
|
192
|
+
const tab = container && element_0.contains(container) ? container : selected;
|
|
193
|
+
const fade = parseFloat(getComputedStyle(element_0).getPropertyValue("--fade-size")) || 0;
|
|
194
|
+
const bounds = element_0.getBoundingClientRect();
|
|
195
|
+
const rect = tab.getBoundingClientRect();
|
|
196
|
+
const left = tabRevealScrollLeft(element_0, rect.left - bounds.left - element_0.clientLeft + element_0.scrollLeft, rect.width, fade);
|
|
197
|
+
if (left !== element_0.scrollLeft) {
|
|
198
|
+
element_0.scrollLeft = left;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
$[25] = t6;
|
|
202
|
+
} else {
|
|
203
|
+
t6 = $[25];
|
|
204
|
+
}
|
|
205
|
+
const reveal = t6;
|
|
206
|
+
let t7;
|
|
207
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
208
|
+
t7 = () => {
|
|
209
|
+
revealing.current = true;
|
|
210
|
+
};
|
|
211
|
+
$[26] = t7;
|
|
212
|
+
} else {
|
|
213
|
+
t7 = $[26];
|
|
214
|
+
}
|
|
215
|
+
let t8;
|
|
216
|
+
if ($[27] !== value) {
|
|
217
|
+
t8 = [value];
|
|
218
|
+
$[27] = value;
|
|
219
|
+
$[28] = t8;
|
|
220
|
+
} else {
|
|
221
|
+
t8 = $[28];
|
|
222
|
+
}
|
|
223
|
+
useLayoutEffect(t7, t8);
|
|
224
|
+
let t9;
|
|
225
|
+
if ($[29] !== measure) {
|
|
226
|
+
t9 = () => {
|
|
227
|
+
reveal();
|
|
228
|
+
measure();
|
|
229
|
+
};
|
|
230
|
+
$[29] = measure;
|
|
231
|
+
$[30] = t9;
|
|
232
|
+
} else {
|
|
233
|
+
t9 = $[30];
|
|
234
|
+
}
|
|
235
|
+
useLayoutEffect(t9);
|
|
236
|
+
let t10;
|
|
237
|
+
if ($[31] !== measure) {
|
|
238
|
+
t10 = () => {
|
|
239
|
+
const element_1 = strip.current;
|
|
240
|
+
if (!element_1 || typeof ResizeObserver === "undefined") {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const observer = new ResizeObserver(() => {
|
|
87
244
|
reveal();
|
|
88
245
|
measure();
|
|
246
|
+
});
|
|
247
|
+
observer.observe(element_1);
|
|
248
|
+
element_1.querySelectorAll("[data-document-tab]").forEach(tab_0 => observer.observe(tab_0));
|
|
249
|
+
return () => observer.disconnect();
|
|
250
|
+
};
|
|
251
|
+
$[31] = measure;
|
|
252
|
+
$[32] = t10;
|
|
253
|
+
} else {
|
|
254
|
+
t10 = $[32];
|
|
255
|
+
}
|
|
256
|
+
useEffect(t10);
|
|
257
|
+
const gap = _temp2;
|
|
258
|
+
let t11;
|
|
259
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
260
|
+
t11 = index => strip.current?.querySelectorAll("[role=\"tab\"]")[index]?.focus();
|
|
261
|
+
$[33] = t11;
|
|
262
|
+
} else {
|
|
263
|
+
t11 = $[33];
|
|
264
|
+
}
|
|
265
|
+
let t12;
|
|
266
|
+
if ($[34] !== close || $[35] !== items || $[36] !== onClose || $[37] !== onContextMenu || $[38] !== onDoubleClick || $[39] !== onDragEnd || $[40] !== onDragStart || $[41] !== onValueChange || $[42] !== value) {
|
|
267
|
+
t12 = {
|
|
268
|
+
items,
|
|
269
|
+
value,
|
|
270
|
+
onValueChange,
|
|
271
|
+
onClose,
|
|
272
|
+
onDoubleClick,
|
|
273
|
+
onContextMenu,
|
|
274
|
+
onDragStart,
|
|
275
|
+
onDragEnd,
|
|
276
|
+
close,
|
|
277
|
+
focus: t11
|
|
278
|
+
};
|
|
279
|
+
$[34] = close;
|
|
280
|
+
$[35] = items;
|
|
281
|
+
$[36] = onClose;
|
|
282
|
+
$[37] = onContextMenu;
|
|
283
|
+
$[38] = onDoubleClick;
|
|
284
|
+
$[39] = onDragEnd;
|
|
285
|
+
$[40] = onDragStart;
|
|
286
|
+
$[41] = onValueChange;
|
|
287
|
+
$[42] = value;
|
|
288
|
+
$[43] = t12;
|
|
289
|
+
} else {
|
|
290
|
+
t12 = $[43];
|
|
291
|
+
}
|
|
292
|
+
const context = t12;
|
|
293
|
+
const t13 = ref ?? null;
|
|
294
|
+
let t14;
|
|
295
|
+
if ($[44] !== t13) {
|
|
296
|
+
t14 = [strip, t13];
|
|
297
|
+
$[44] = t13;
|
|
298
|
+
$[45] = t14;
|
|
299
|
+
} else {
|
|
300
|
+
t14 = $[45];
|
|
301
|
+
}
|
|
302
|
+
let t15;
|
|
303
|
+
if ($[46] !== props || $[47] !== t) {
|
|
304
|
+
t15 = props["aria-label"] ?? t("workspace.tabs");
|
|
305
|
+
$[46] = props;
|
|
306
|
+
$[47] = t;
|
|
307
|
+
$[48] = t15;
|
|
308
|
+
} else {
|
|
309
|
+
t15 = $[48];
|
|
310
|
+
}
|
|
311
|
+
let t16;
|
|
312
|
+
if ($[49] !== className) {
|
|
313
|
+
t16 = clsx("ade-tab-strip scroll-fade-x", className);
|
|
314
|
+
$[49] = className;
|
|
315
|
+
$[50] = t16;
|
|
316
|
+
} else {
|
|
317
|
+
t16 = $[50];
|
|
318
|
+
}
|
|
319
|
+
const t17 = focused || undefined;
|
|
320
|
+
const t18 = edges.start || undefined;
|
|
321
|
+
const t19 = edges.end || undefined;
|
|
322
|
+
let t20;
|
|
323
|
+
if ($[51] !== measure || $[52] !== props) {
|
|
324
|
+
t20 = event_0 => {
|
|
325
|
+
props.onScroll?.(event_0);
|
|
326
|
+
measure();
|
|
327
|
+
};
|
|
328
|
+
$[51] = measure;
|
|
329
|
+
$[52] = props;
|
|
330
|
+
$[53] = t20;
|
|
331
|
+
} else {
|
|
332
|
+
t20 = $[53];
|
|
333
|
+
}
|
|
334
|
+
let t21;
|
|
335
|
+
let t22;
|
|
336
|
+
if ($[54] !== props) {
|
|
337
|
+
t21 = event_1 => {
|
|
338
|
+
props.onWheel?.(event_1);
|
|
339
|
+
if (event_1.defaultPrevented) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
revealing.current = false;
|
|
343
|
+
if (!event_1.deltaX && event_1.deltaY) {
|
|
344
|
+
event_1.currentTarget.scrollLeft = event_1.currentTarget.scrollLeft + event_1.deltaY;
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
t22 = event_2 => {
|
|
348
|
+
props.onPointerDown?.(event_2);
|
|
349
|
+
if (event_2.target === event_2.currentTarget || event_2.pointerType === "touch") {
|
|
350
|
+
revealing.current = false;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
$[54] = props;
|
|
354
|
+
$[55] = t21;
|
|
355
|
+
$[56] = t22;
|
|
356
|
+
} else {
|
|
357
|
+
t21 = $[55];
|
|
358
|
+
t22 = $[56];
|
|
359
|
+
}
|
|
360
|
+
let t23;
|
|
361
|
+
if ($[57] !== onTabDragOver || $[58] !== props) {
|
|
362
|
+
t23 = event_3 => {
|
|
363
|
+
props.onDragOver?.(event_3);
|
|
364
|
+
if (!event_3.defaultPrevented) {
|
|
365
|
+
onTabDragOver?.(gap(event_3), event_3);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
$[57] = onTabDragOver;
|
|
369
|
+
$[58] = props;
|
|
370
|
+
$[59] = t23;
|
|
371
|
+
} else {
|
|
372
|
+
t23 = $[59];
|
|
373
|
+
}
|
|
374
|
+
let t24;
|
|
375
|
+
if ($[60] !== onTabDrop || $[61] !== props) {
|
|
376
|
+
t24 = event_4 => {
|
|
377
|
+
props.onDrop?.(event_4);
|
|
378
|
+
if (!event_4.defaultPrevented) {
|
|
379
|
+
onTabDrop?.(gap(event_4), event_4);
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
$[60] = onTabDrop;
|
|
383
|
+
$[61] = props;
|
|
384
|
+
$[62] = t24;
|
|
385
|
+
} else {
|
|
386
|
+
t24 = $[62];
|
|
387
|
+
}
|
|
388
|
+
let t25;
|
|
389
|
+
if ($[63] !== context || $[64] !== items || $[65] !== renderTab) {
|
|
390
|
+
let t26;
|
|
391
|
+
if ($[67] !== context || $[68] !== renderTab) {
|
|
392
|
+
t26 = item_0 => /*#__PURE__*/_jsx(TabContext.Provider, {
|
|
393
|
+
value: context,
|
|
394
|
+
children: renderTab ? renderTab(item_0) : /*#__PURE__*/_jsx(DocumentTab, {
|
|
395
|
+
item: item_0
|
|
396
|
+
})
|
|
397
|
+
}, item_0.id);
|
|
398
|
+
$[67] = context;
|
|
399
|
+
$[68] = renderTab;
|
|
400
|
+
$[69] = t26;
|
|
401
|
+
} else {
|
|
402
|
+
t26 = $[69];
|
|
403
|
+
}
|
|
404
|
+
t25 = items.map(t26);
|
|
405
|
+
$[63] = context;
|
|
406
|
+
$[64] = items;
|
|
407
|
+
$[65] = renderTab;
|
|
408
|
+
$[66] = t25;
|
|
409
|
+
} else {
|
|
410
|
+
t25 = $[66];
|
|
411
|
+
}
|
|
412
|
+
let t26;
|
|
413
|
+
if ($[70] !== insertAt || $[71] !== insertion) {
|
|
414
|
+
t26 = insertAt !== undefined && insertAt !== null && /*#__PURE__*/_jsx("span", {
|
|
415
|
+
"aria-hidden": "true",
|
|
416
|
+
className: "ade-tab-insertion",
|
|
417
|
+
style: {
|
|
418
|
+
left: insertion
|
|
419
|
+
}
|
|
89
420
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
element.querySelectorAll('[data-document-tab]').forEach((tab) => observer.observe(tab));
|
|
101
|
-
return () => observer.disconnect();
|
|
102
|
-
});
|
|
103
|
-
const gap = (event) => {
|
|
104
|
-
const rects = Array.from(event.currentTarget.querySelectorAll('[data-document-tab]'), (tab) => tab.getBoundingClientRect());
|
|
105
|
-
return tabGapAt(rects, event.clientX);
|
|
106
|
-
};
|
|
107
|
-
const context = {
|
|
108
|
-
items,
|
|
109
|
-
value,
|
|
110
|
-
onValueChange,
|
|
111
|
-
onClose,
|
|
112
|
-
onDoubleClick,
|
|
113
|
-
onContextMenu,
|
|
114
|
-
onDragStart,
|
|
115
|
-
onDragEnd,
|
|
116
|
-
close,
|
|
117
|
-
focus: (index) => strip.current?.querySelectorAll('[role="tab"]')[index]?.focus()
|
|
118
|
-
};
|
|
119
|
-
return useRender({
|
|
120
|
-
render,
|
|
121
|
-
ref: [strip, ref ?? null],
|
|
122
|
-
defaultTagName: 'div',
|
|
123
|
-
props: {
|
|
124
|
-
...props,
|
|
125
|
-
role: 'tablist',
|
|
126
|
-
'aria-label': props['aria-label'] ?? t('workspace.tabs'),
|
|
127
|
-
className: clsx('ade-tab-strip scroll-fade-x', className),
|
|
128
|
-
'data-focused': focused || undefined,
|
|
129
|
-
'data-fade-start': edges.start || undefined,
|
|
130
|
-
'data-fade-end': edges.end || undefined,
|
|
131
|
-
onScroll: (event) => {
|
|
132
|
-
props.onScroll?.(event);
|
|
133
|
-
measure();
|
|
134
|
-
},
|
|
135
|
-
onWheel: (event) => {
|
|
136
|
-
props.onWheel?.(event);
|
|
137
|
-
if (event.defaultPrevented) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
revealing.current = false;
|
|
141
|
-
if (!event.deltaX && event.deltaY) {
|
|
142
|
-
event.currentTarget.scrollLeft += event.deltaY;
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
onPointerDown: (event) => {
|
|
146
|
-
props.onPointerDown?.(event);
|
|
147
|
-
// A press on the strip itself grabs its scrollbar, and a touch may pan it.
|
|
148
|
-
if (event.target === event.currentTarget || event.pointerType === 'touch') {
|
|
149
|
-
revealing.current = false;
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
onDragOver: (event) => {
|
|
153
|
-
props.onDragOver?.(event);
|
|
154
|
-
if (!event.defaultPrevented) {
|
|
155
|
-
onTabDragOver?.(gap(event), event);
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
onDrop: (event) => {
|
|
159
|
-
props.onDrop?.(event);
|
|
160
|
-
if (!event.defaultPrevented) {
|
|
161
|
-
onTabDrop?.(gap(event), event);
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
children: (_jsxs(_Fragment, { children: [items.map((item) => (_jsx(TabContext.Provider, { value: context, children: renderTab ? renderTab(item) : _jsx(DocumentTab, { item: item }) }, item.id))), insertAt !== undefined && insertAt !== null && _jsx("span", { "aria-hidden": "true", className: "ade-tab-insertion", style: { left: insertion } })] }))
|
|
165
|
-
}
|
|
421
|
+
$[70] = insertAt;
|
|
422
|
+
$[71] = insertion;
|
|
423
|
+
$[72] = t26;
|
|
424
|
+
} else {
|
|
425
|
+
t26 = $[72];
|
|
426
|
+
}
|
|
427
|
+
let t27;
|
|
428
|
+
if ($[73] !== t25 || $[74] !== t26) {
|
|
429
|
+
t27 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
430
|
+
children: [t25, t26]
|
|
166
431
|
});
|
|
432
|
+
$[73] = t25;
|
|
433
|
+
$[74] = t26;
|
|
434
|
+
$[75] = t27;
|
|
435
|
+
} else {
|
|
436
|
+
t27 = $[75];
|
|
437
|
+
}
|
|
438
|
+
let t28;
|
|
439
|
+
if ($[76] !== props || $[77] !== t15 || $[78] !== t16 || $[79] !== t17 || $[80] !== t18 || $[81] !== t19 || $[82] !== t20 || $[83] !== t21 || $[84] !== t22 || $[85] !== t23 || $[86] !== t24 || $[87] !== t27) {
|
|
440
|
+
t28 = {
|
|
441
|
+
...props,
|
|
442
|
+
role: "tablist",
|
|
443
|
+
"aria-label": t15,
|
|
444
|
+
className: t16,
|
|
445
|
+
"data-focused": t17,
|
|
446
|
+
"data-fade-start": t18,
|
|
447
|
+
"data-fade-end": t19,
|
|
448
|
+
onScroll: t20,
|
|
449
|
+
onWheel: t21,
|
|
450
|
+
onPointerDown: t22,
|
|
451
|
+
onDragOver: t23,
|
|
452
|
+
onDrop: t24,
|
|
453
|
+
children: t27
|
|
454
|
+
};
|
|
455
|
+
$[76] = props;
|
|
456
|
+
$[77] = t15;
|
|
457
|
+
$[78] = t16;
|
|
458
|
+
$[79] = t17;
|
|
459
|
+
$[80] = t18;
|
|
460
|
+
$[81] = t19;
|
|
461
|
+
$[82] = t20;
|
|
462
|
+
$[83] = t21;
|
|
463
|
+
$[84] = t22;
|
|
464
|
+
$[85] = t23;
|
|
465
|
+
$[86] = t24;
|
|
466
|
+
$[87] = t27;
|
|
467
|
+
$[88] = t28;
|
|
468
|
+
} else {
|
|
469
|
+
t28 = $[88];
|
|
470
|
+
}
|
|
471
|
+
let t29;
|
|
472
|
+
if ($[89] !== render || $[90] !== t14 || $[91] !== t28) {
|
|
473
|
+
t29 = {
|
|
474
|
+
render,
|
|
475
|
+
ref: t14,
|
|
476
|
+
defaultTagName: "div",
|
|
477
|
+
props: t28
|
|
478
|
+
};
|
|
479
|
+
$[89] = render;
|
|
480
|
+
$[90] = t14;
|
|
481
|
+
$[91] = t28;
|
|
482
|
+
$[92] = t29;
|
|
483
|
+
} else {
|
|
484
|
+
t29 = $[92];
|
|
485
|
+
}
|
|
486
|
+
return useRender(t29);
|
|
487
|
+
}
|
|
488
|
+
function _temp2(event) {
|
|
489
|
+
const rects = Array.from(event.currentTarget.querySelectorAll("[data-document-tab]"), _temp);
|
|
490
|
+
return tabGapAt(rects, event.clientX);
|
|
491
|
+
}
|
|
492
|
+
function _temp(tab_1) {
|
|
493
|
+
return tab_1.getBoundingClientRect();
|
|
167
494
|
}
|
|
168
495
|
const TabContext = createContext(null);
|
|
169
496
|
/** A tab with application-owned metadata and menus, rendered inside TabStrip's renderTab slot. */
|
|
170
|
-
export function DocumentTab(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
497
|
+
export function DocumentTab(t0) {
|
|
498
|
+
const $ = _c(92);
|
|
499
|
+
let className;
|
|
500
|
+
let closeShortcut;
|
|
501
|
+
let item;
|
|
502
|
+
let onClose;
|
|
503
|
+
let onDoubleClick;
|
|
504
|
+
let onDragEnd;
|
|
505
|
+
let onDragStart;
|
|
506
|
+
let props;
|
|
507
|
+
let ref;
|
|
508
|
+
let render;
|
|
509
|
+
if ($[0] !== t0) {
|
|
510
|
+
({
|
|
511
|
+
item,
|
|
512
|
+
onClose,
|
|
513
|
+
closeShortcut,
|
|
514
|
+
onDoubleClick,
|
|
515
|
+
onDragStart,
|
|
516
|
+
onDragEnd,
|
|
517
|
+
className,
|
|
518
|
+
render,
|
|
519
|
+
ref,
|
|
520
|
+
...props
|
|
521
|
+
} = t0);
|
|
522
|
+
$[0] = t0;
|
|
523
|
+
$[1] = className;
|
|
524
|
+
$[2] = closeShortcut;
|
|
525
|
+
$[3] = item;
|
|
526
|
+
$[4] = onClose;
|
|
527
|
+
$[5] = onDoubleClick;
|
|
528
|
+
$[6] = onDragEnd;
|
|
529
|
+
$[7] = onDragStart;
|
|
530
|
+
$[8] = props;
|
|
531
|
+
$[9] = ref;
|
|
532
|
+
$[10] = render;
|
|
533
|
+
} else {
|
|
534
|
+
className = $[1];
|
|
535
|
+
closeShortcut = $[2];
|
|
536
|
+
item = $[3];
|
|
537
|
+
onClose = $[4];
|
|
538
|
+
onDoubleClick = $[5];
|
|
539
|
+
onDragEnd = $[6];
|
|
540
|
+
onDragStart = $[7];
|
|
541
|
+
props = $[8];
|
|
542
|
+
ref = $[9];
|
|
543
|
+
render = $[10];
|
|
544
|
+
}
|
|
545
|
+
const context = useContext(TabContext);
|
|
546
|
+
if (!context) {
|
|
547
|
+
throw new Error("DocumentTab must be rendered inside TabStrip.");
|
|
548
|
+
}
|
|
549
|
+
const {
|
|
550
|
+
t
|
|
551
|
+
} = useTranslation("ui");
|
|
552
|
+
const {
|
|
553
|
+
items,
|
|
554
|
+
value,
|
|
555
|
+
onValueChange
|
|
556
|
+
} = context;
|
|
557
|
+
let t1;
|
|
558
|
+
if ($[11] !== item.id || $[12] !== items) {
|
|
559
|
+
let t2;
|
|
560
|
+
if ($[14] !== item.id) {
|
|
561
|
+
t2 = candidate => candidate.id === item.id;
|
|
562
|
+
$[14] = item.id;
|
|
563
|
+
$[15] = t2;
|
|
564
|
+
} else {
|
|
565
|
+
t2 = $[15];
|
|
174
566
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
567
|
+
t1 = items.findIndex(t2);
|
|
568
|
+
$[11] = item.id;
|
|
569
|
+
$[12] = items;
|
|
570
|
+
$[13] = t1;
|
|
571
|
+
} else {
|
|
572
|
+
t1 = $[13];
|
|
573
|
+
}
|
|
574
|
+
const index = t1;
|
|
575
|
+
let t2;
|
|
576
|
+
if ($[16] !== context || $[17] !== item.id || $[18] !== onClose) {
|
|
577
|
+
t2 = () => context.close(item.id, onClose);
|
|
578
|
+
$[16] = context;
|
|
579
|
+
$[17] = item.id;
|
|
580
|
+
$[18] = onClose;
|
|
581
|
+
$[19] = t2;
|
|
582
|
+
} else {
|
|
583
|
+
t2 = $[19];
|
|
584
|
+
}
|
|
585
|
+
const close = t2;
|
|
586
|
+
const closable = item.closable !== false && (onClose ?? context.onClose) !== undefined;
|
|
587
|
+
let t3;
|
|
588
|
+
if ($[20] !== className) {
|
|
589
|
+
t3 = clsx("ade-document-tab", className);
|
|
590
|
+
$[20] = className;
|
|
591
|
+
$[21] = t3;
|
|
592
|
+
} else {
|
|
593
|
+
t3 = $[21];
|
|
594
|
+
}
|
|
595
|
+
const t4 = item.id === value || undefined;
|
|
596
|
+
const t5 = !!item.detail || undefined;
|
|
597
|
+
let t6;
|
|
598
|
+
if ($[22] !== context || $[23] !== item.id || $[24] !== props) {
|
|
599
|
+
t6 = event => {
|
|
600
|
+
props.onContextMenu?.(event);
|
|
601
|
+
context.onContextMenu?.(item.id, event);
|
|
602
|
+
};
|
|
603
|
+
$[22] = context;
|
|
604
|
+
$[23] = item.id;
|
|
605
|
+
$[24] = props;
|
|
606
|
+
$[25] = t6;
|
|
607
|
+
} else {
|
|
608
|
+
t6 = $[25];
|
|
609
|
+
}
|
|
610
|
+
const t7 = item.hint ?? item.label;
|
|
611
|
+
const t8 = item.id === value;
|
|
612
|
+
const t9 = item.id === value || value === null && index === 0 ? 0 : -1;
|
|
613
|
+
const t10 = !!(onDragStart ?? context.onDragStart);
|
|
614
|
+
let t11;
|
|
615
|
+
if ($[26] !== item.id || $[27] !== onValueChange) {
|
|
616
|
+
t11 = () => onValueChange(item.id);
|
|
617
|
+
$[26] = item.id;
|
|
618
|
+
$[27] = onValueChange;
|
|
619
|
+
$[28] = t11;
|
|
620
|
+
} else {
|
|
621
|
+
t11 = $[28];
|
|
622
|
+
}
|
|
623
|
+
let t12;
|
|
624
|
+
if ($[29] !== context.onDoubleClick || $[30] !== item.id || $[31] !== onDoubleClick) {
|
|
625
|
+
t12 = event_0 => (onDoubleClick ?? context.onDoubleClick)?.(item.id, event_0);
|
|
626
|
+
$[29] = context.onDoubleClick;
|
|
627
|
+
$[30] = item.id;
|
|
628
|
+
$[31] = onDoubleClick;
|
|
629
|
+
$[32] = t12;
|
|
630
|
+
} else {
|
|
631
|
+
t12 = $[32];
|
|
632
|
+
}
|
|
633
|
+
let t13;
|
|
634
|
+
if ($[33] !== context.onDragStart || $[34] !== item.id || $[35] !== onDragStart) {
|
|
635
|
+
t13 = event_1 => {
|
|
636
|
+
event_1.stopPropagation();
|
|
637
|
+
(onDragStart ?? context.onDragStart)?.(item.id, event_1);
|
|
638
|
+
};
|
|
639
|
+
$[33] = context.onDragStart;
|
|
640
|
+
$[34] = item.id;
|
|
641
|
+
$[35] = onDragStart;
|
|
642
|
+
$[36] = t13;
|
|
643
|
+
} else {
|
|
644
|
+
t13 = $[36];
|
|
645
|
+
}
|
|
646
|
+
const t14 = onDragEnd ?? context.onDragEnd;
|
|
647
|
+
let t15;
|
|
648
|
+
if ($[37] !== closable || $[38] !== close || $[39] !== context || $[40] !== index || $[41] !== items || $[42] !== onValueChange) {
|
|
649
|
+
t15 = event_2 => {
|
|
650
|
+
const next = tabIndexForKey(event_2.key, index, items.length);
|
|
651
|
+
if (next !== null) {
|
|
652
|
+
event_2.preventDefault();
|
|
653
|
+
onValueChange(items[next].id);
|
|
654
|
+
context.focus(next);
|
|
655
|
+
} else {
|
|
656
|
+
if (event_2.key === "Delete" && closable) {
|
|
657
|
+
event_2.preventDefault();
|
|
658
|
+
close();
|
|
209
659
|
}
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
$[37] = closable;
|
|
663
|
+
$[38] = close;
|
|
664
|
+
$[39] = context;
|
|
665
|
+
$[40] = index;
|
|
666
|
+
$[41] = items;
|
|
667
|
+
$[42] = onValueChange;
|
|
668
|
+
$[43] = t15;
|
|
669
|
+
} else {
|
|
670
|
+
t15 = $[43];
|
|
671
|
+
}
|
|
672
|
+
let t16;
|
|
673
|
+
if ($[44] !== item.label) {
|
|
674
|
+
t16 = /*#__PURE__*/_jsx("span", {
|
|
675
|
+
className: "truncate",
|
|
676
|
+
children: item.label
|
|
210
677
|
});
|
|
211
|
-
|
|
678
|
+
$[44] = item.label;
|
|
679
|
+
$[45] = t16;
|
|
680
|
+
} else {
|
|
681
|
+
t16 = $[45];
|
|
682
|
+
}
|
|
683
|
+
let t17;
|
|
684
|
+
if ($[46] !== item.unsaved || $[47] !== t) {
|
|
685
|
+
t17 = item.unsaved && /*#__PURE__*/_jsx("span", {
|
|
686
|
+
className: "ade-tab-unsaved",
|
|
687
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
688
|
+
className: "sr-only",
|
|
689
|
+
children: typeof item.unsaved === "string" ? item.unsaved : t("workspace.unsaved")
|
|
690
|
+
})
|
|
691
|
+
});
|
|
692
|
+
$[46] = item.unsaved;
|
|
693
|
+
$[47] = t;
|
|
694
|
+
$[48] = t17;
|
|
695
|
+
} else {
|
|
696
|
+
t17 = $[48];
|
|
697
|
+
}
|
|
698
|
+
let t18;
|
|
699
|
+
if ($[49] !== item.attention || $[50] !== item.detail || $[51] !== item.icon || $[52] !== item.panelId || $[53] !== item.tabId || $[54] !== t10 || $[55] !== t11 || $[56] !== t12 || $[57] !== t13 || $[58] !== t14 || $[59] !== t15 || $[60] !== t16 || $[61] !== t17 || $[62] !== t8 || $[63] !== t9) {
|
|
700
|
+
t18 = /*#__PURE__*/_jsxs("button", {
|
|
701
|
+
type: "button",
|
|
702
|
+
role: "tab",
|
|
703
|
+
id: item.tabId,
|
|
704
|
+
"aria-controls": item.panelId,
|
|
705
|
+
"aria-selected": t8,
|
|
706
|
+
tabIndex: t9,
|
|
707
|
+
className: "ade-document-tab-open",
|
|
708
|
+
draggable: t10,
|
|
709
|
+
onClick: t11,
|
|
710
|
+
onDoubleClick: t12,
|
|
711
|
+
onDragStart: t13,
|
|
712
|
+
onDragEnd: t14,
|
|
713
|
+
onKeyDown: t15,
|
|
714
|
+
children: [item.icon, t16, item.detail, item.attention, t17]
|
|
715
|
+
});
|
|
716
|
+
$[49] = item.attention;
|
|
717
|
+
$[50] = item.detail;
|
|
718
|
+
$[51] = item.icon;
|
|
719
|
+
$[52] = item.panelId;
|
|
720
|
+
$[53] = item.tabId;
|
|
721
|
+
$[54] = t10;
|
|
722
|
+
$[55] = t11;
|
|
723
|
+
$[56] = t12;
|
|
724
|
+
$[57] = t13;
|
|
725
|
+
$[58] = t14;
|
|
726
|
+
$[59] = t15;
|
|
727
|
+
$[60] = t16;
|
|
728
|
+
$[61] = t17;
|
|
729
|
+
$[62] = t8;
|
|
730
|
+
$[63] = t9;
|
|
731
|
+
$[64] = t18;
|
|
732
|
+
} else {
|
|
733
|
+
t18 = $[64];
|
|
734
|
+
}
|
|
735
|
+
let t19;
|
|
736
|
+
if ($[65] !== t18 || $[66] !== t7) {
|
|
737
|
+
t19 = /*#__PURE__*/_jsx(Tooltip, {
|
|
738
|
+
label: t7,
|
|
739
|
+
children: t18
|
|
740
|
+
});
|
|
741
|
+
$[65] = t18;
|
|
742
|
+
$[66] = t7;
|
|
743
|
+
$[67] = t19;
|
|
744
|
+
} else {
|
|
745
|
+
t19 = $[67];
|
|
746
|
+
}
|
|
747
|
+
let t20;
|
|
748
|
+
if ($[68] !== item.pinned) {
|
|
749
|
+
t20 = item.pinned && /*#__PURE__*/_jsx(Icon, {
|
|
750
|
+
icon: Pin,
|
|
751
|
+
size: 12,
|
|
752
|
+
className: "shrink-0 text-text-muted"
|
|
753
|
+
});
|
|
754
|
+
$[68] = item.pinned;
|
|
755
|
+
$[69] = t20;
|
|
756
|
+
} else {
|
|
757
|
+
t20 = $[69];
|
|
758
|
+
}
|
|
759
|
+
let t21;
|
|
760
|
+
if ($[70] !== closable || $[71] !== close || $[72] !== closeShortcut || $[73] !== item.label || $[74] !== t) {
|
|
761
|
+
t21 = closable && /*#__PURE__*/_jsx(IconButton, {
|
|
762
|
+
icon: X,
|
|
763
|
+
size: "2xs",
|
|
764
|
+
label: t("workspace.closeTab", {
|
|
765
|
+
name: item.label
|
|
766
|
+
}),
|
|
767
|
+
kbd: closeShortcut,
|
|
768
|
+
className: "ade-document-tab-close",
|
|
769
|
+
onClick: close
|
|
770
|
+
});
|
|
771
|
+
$[70] = closable;
|
|
772
|
+
$[71] = close;
|
|
773
|
+
$[72] = closeShortcut;
|
|
774
|
+
$[73] = item.label;
|
|
775
|
+
$[74] = t;
|
|
776
|
+
$[75] = t21;
|
|
777
|
+
} else {
|
|
778
|
+
t21 = $[75];
|
|
779
|
+
}
|
|
780
|
+
let t22;
|
|
781
|
+
if ($[76] !== t19 || $[77] !== t20 || $[78] !== t21) {
|
|
782
|
+
t22 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
783
|
+
children: [t19, t20, t21]
|
|
784
|
+
});
|
|
785
|
+
$[76] = t19;
|
|
786
|
+
$[77] = t20;
|
|
787
|
+
$[78] = t21;
|
|
788
|
+
$[79] = t22;
|
|
789
|
+
} else {
|
|
790
|
+
t22 = $[79];
|
|
791
|
+
}
|
|
792
|
+
let t23;
|
|
793
|
+
if ($[80] !== item.id || $[81] !== props || $[82] !== t22 || $[83] !== t3 || $[84] !== t4 || $[85] !== t5 || $[86] !== t6) {
|
|
794
|
+
t23 = {
|
|
795
|
+
...props,
|
|
796
|
+
className: t3,
|
|
797
|
+
"data-document-tab": item.id,
|
|
798
|
+
"data-active": t4,
|
|
799
|
+
"data-detail": t5,
|
|
800
|
+
onContextMenu: t6,
|
|
801
|
+
children: t22
|
|
802
|
+
};
|
|
803
|
+
$[80] = item.id;
|
|
804
|
+
$[81] = props;
|
|
805
|
+
$[82] = t22;
|
|
806
|
+
$[83] = t3;
|
|
807
|
+
$[84] = t4;
|
|
808
|
+
$[85] = t5;
|
|
809
|
+
$[86] = t6;
|
|
810
|
+
$[87] = t23;
|
|
811
|
+
} else {
|
|
812
|
+
t23 = $[87];
|
|
813
|
+
}
|
|
814
|
+
let t24;
|
|
815
|
+
if ($[88] !== ref || $[89] !== render || $[90] !== t23) {
|
|
816
|
+
t24 = {
|
|
817
|
+
render,
|
|
818
|
+
ref,
|
|
819
|
+
defaultTagName: "span",
|
|
820
|
+
props: t23
|
|
821
|
+
};
|
|
822
|
+
$[88] = ref;
|
|
823
|
+
$[89] = render;
|
|
824
|
+
$[90] = t23;
|
|
825
|
+
$[91] = t24;
|
|
826
|
+
} else {
|
|
827
|
+
t24 = $[91];
|
|
828
|
+
}
|
|
829
|
+
return useRender(t24);
|
|
830
|
+
}
|