@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
package/dist/SelectSearch.js
CHANGED
|
@@ -1,39 +1,354 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Combobox } from '@base-ui/react/combobox';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { ChevronDown, Search } from 'lucide-react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { Icon } from
|
|
8
|
-
import { MENU_LABEL } from
|
|
7
|
+
import { Icon } from "./Icon.js";
|
|
8
|
+
import { MENU_LABEL } from "./menu/parts.js";
|
|
9
9
|
import { renderPositioner } from './popup-layer.js';
|
|
10
|
-
import { RowContent } from
|
|
10
|
+
import { RowContent } from "./select-row.js";
|
|
11
11
|
import { isGroup, rowClassName, triggerClassName } from './select-shared.js';
|
|
12
12
|
/* The `Select` with a search field on top of its options, for lists too long to scan. A combobox of Base UI brings the filtering and the keyboard. */
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
export function SelectSearch(t0) {
|
|
15
|
+
const $ = _c(67);
|
|
16
|
+
const {
|
|
17
|
+
value,
|
|
18
|
+
onValueChange,
|
|
19
|
+
items,
|
|
20
|
+
label,
|
|
21
|
+
placeholder,
|
|
22
|
+
searchPlaceholder,
|
|
23
|
+
size: t1,
|
|
24
|
+
variant: t2,
|
|
25
|
+
disabled,
|
|
26
|
+
align: t3,
|
|
27
|
+
truncateValue: t4,
|
|
28
|
+
className,
|
|
29
|
+
ref
|
|
30
|
+
} = t0;
|
|
31
|
+
const size = t1 === undefined ? "md" : t1;
|
|
32
|
+
const variant = t2 === undefined ? "outlined" : t2;
|
|
33
|
+
const align = t3 === undefined ? "start" : t3;
|
|
34
|
+
const truncateValue = t4 === undefined ? true : t4;
|
|
35
|
+
const {
|
|
36
|
+
t
|
|
37
|
+
} = useTranslation("ui");
|
|
38
|
+
const [query, setQuery] = useState("");
|
|
39
|
+
const groups = items.length > 0 && isGroup(items[0]) ? items : null;
|
|
40
|
+
let flat;
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[0] !== groups || $[1] !== items) {
|
|
43
|
+
flat = groups ? groups.flatMap(_temp) : items;
|
|
44
|
+
t5 = new Map(flat.map(_temp2));
|
|
45
|
+
$[0] = groups;
|
|
46
|
+
$[1] = items;
|
|
47
|
+
$[2] = flat;
|
|
48
|
+
$[3] = t5;
|
|
49
|
+
} else {
|
|
50
|
+
flat = $[2];
|
|
51
|
+
t5 = $[3];
|
|
52
|
+
}
|
|
53
|
+
const byValue = t5;
|
|
54
|
+
let t6;
|
|
55
|
+
if ($[4] !== byValue || $[5] !== value) {
|
|
56
|
+
t6 = value === null ? null : byValue.get(value) ?? null;
|
|
57
|
+
$[4] = byValue;
|
|
58
|
+
$[5] = value;
|
|
59
|
+
$[6] = t6;
|
|
60
|
+
} else {
|
|
61
|
+
t6 = $[6];
|
|
62
|
+
}
|
|
63
|
+
const selected = t6;
|
|
64
|
+
let t7;
|
|
65
|
+
if ($[7] !== flat || $[8] !== groups) {
|
|
66
|
+
t7 = groups ? groups.map(_temp4) : flat.map(_temp5);
|
|
67
|
+
$[7] = flat;
|
|
68
|
+
$[8] = groups;
|
|
69
|
+
$[9] = t7;
|
|
70
|
+
} else {
|
|
71
|
+
t7 = $[9];
|
|
72
|
+
}
|
|
73
|
+
const comboboxItems = t7;
|
|
74
|
+
let t8;
|
|
75
|
+
if ($[10] !== searchPlaceholder || $[11] !== t) {
|
|
76
|
+
t8 = searchPlaceholder ?? t("select.search");
|
|
77
|
+
$[10] = searchPlaceholder;
|
|
78
|
+
$[11] = t;
|
|
79
|
+
$[12] = t8;
|
|
80
|
+
} else {
|
|
81
|
+
t8 = $[12];
|
|
82
|
+
}
|
|
83
|
+
const searchLabel = t8;
|
|
84
|
+
let t9;
|
|
85
|
+
if ($[13] !== byValue || $[14] !== value) {
|
|
86
|
+
t9 = itemValue => {
|
|
87
|
+
const item_2 = byValue.get(itemValue);
|
|
88
|
+
return /*#__PURE__*/_jsx(Combobox.Item, {
|
|
89
|
+
className: rowClassName(item_2),
|
|
90
|
+
value: item_2.value,
|
|
91
|
+
disabled: item_2.disabled,
|
|
92
|
+
children: /*#__PURE__*/_jsx(RowContent, {
|
|
93
|
+
item: item_2,
|
|
94
|
+
picked: item_2.value === value,
|
|
95
|
+
text: /*#__PURE__*/_jsx("span", {
|
|
96
|
+
className: "truncate",
|
|
97
|
+
children: item_2.label
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
}, item_2.value);
|
|
101
|
+
};
|
|
102
|
+
$[13] = byValue;
|
|
103
|
+
$[14] = value;
|
|
104
|
+
$[15] = t9;
|
|
105
|
+
} else {
|
|
106
|
+
t9 = $[15];
|
|
107
|
+
}
|
|
108
|
+
const renderRow = t9;
|
|
109
|
+
let t10;
|
|
110
|
+
if ($[16] !== byValue) {
|
|
111
|
+
t10 = itemValue_0 => byValue.get(itemValue_0)?.label ?? itemValue_0;
|
|
112
|
+
$[16] = byValue;
|
|
113
|
+
$[17] = t10;
|
|
114
|
+
} else {
|
|
115
|
+
t10 = $[17];
|
|
116
|
+
}
|
|
117
|
+
let t11;
|
|
118
|
+
if ($[18] !== onValueChange) {
|
|
119
|
+
t11 = next => {
|
|
120
|
+
if (next !== null) {
|
|
121
|
+
onValueChange(next);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
$[18] = onValueChange;
|
|
125
|
+
$[19] = t11;
|
|
126
|
+
} else {
|
|
127
|
+
t11 = $[19];
|
|
128
|
+
}
|
|
129
|
+
let t12;
|
|
130
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
131
|
+
t12 = open => {
|
|
132
|
+
if (!open) {
|
|
133
|
+
setQuery("");
|
|
134
|
+
}
|
|
27
135
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
136
|
+
$[20] = t12;
|
|
137
|
+
} else {
|
|
138
|
+
t12 = $[20];
|
|
139
|
+
}
|
|
140
|
+
let t13;
|
|
141
|
+
if ($[21] !== className || $[22] !== size || $[23] !== variant) {
|
|
142
|
+
t13 = triggerClassName(size, variant, className);
|
|
143
|
+
$[21] = className;
|
|
144
|
+
$[22] = size;
|
|
145
|
+
$[23] = variant;
|
|
146
|
+
$[24] = t13;
|
|
147
|
+
} else {
|
|
148
|
+
t13 = $[24];
|
|
149
|
+
}
|
|
150
|
+
const t14 = selected?.icon;
|
|
151
|
+
const t15 = truncateValue && "truncate";
|
|
152
|
+
let t16;
|
|
153
|
+
if ($[25] !== t15) {
|
|
154
|
+
t16 = clsx(t15);
|
|
155
|
+
$[25] = t15;
|
|
156
|
+
$[26] = t16;
|
|
157
|
+
} else {
|
|
158
|
+
t16 = $[26];
|
|
159
|
+
}
|
|
160
|
+
let t17;
|
|
161
|
+
if ($[27] !== placeholder || $[28] !== selected?.label || $[29] !== t) {
|
|
162
|
+
t17 = selected?.label ?? placeholder ?? t("action.select");
|
|
163
|
+
$[27] = placeholder;
|
|
164
|
+
$[28] = selected?.label;
|
|
165
|
+
$[29] = t;
|
|
166
|
+
$[30] = t17;
|
|
167
|
+
} else {
|
|
168
|
+
t17 = $[30];
|
|
169
|
+
}
|
|
170
|
+
let t18;
|
|
171
|
+
if ($[31] !== t16 || $[32] !== t17) {
|
|
172
|
+
t18 = /*#__PURE__*/_jsx("span", {
|
|
173
|
+
className: t16,
|
|
174
|
+
children: t17
|
|
175
|
+
});
|
|
176
|
+
$[31] = t16;
|
|
177
|
+
$[32] = t17;
|
|
178
|
+
$[33] = t18;
|
|
179
|
+
} else {
|
|
180
|
+
t18 = $[33];
|
|
181
|
+
}
|
|
182
|
+
let t19;
|
|
183
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
184
|
+
t19 = /*#__PURE__*/_jsx("span", {
|
|
185
|
+
className: "ml-auto flex shrink-0 pl-1",
|
|
186
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
187
|
+
icon: ChevronDown,
|
|
188
|
+
size: 14
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
$[34] = t19;
|
|
192
|
+
} else {
|
|
193
|
+
t19 = $[34];
|
|
194
|
+
}
|
|
195
|
+
let t20;
|
|
196
|
+
if ($[35] !== label || $[36] !== ref || $[37] !== t13 || $[38] !== t14 || $[39] !== t18) {
|
|
197
|
+
t20 = /*#__PURE__*/_jsxs(Combobox.Trigger, {
|
|
198
|
+
ref: ref,
|
|
199
|
+
"aria-label": label,
|
|
200
|
+
className: t13,
|
|
201
|
+
children: [t14, t18, t19]
|
|
202
|
+
});
|
|
203
|
+
$[35] = label;
|
|
204
|
+
$[36] = ref;
|
|
205
|
+
$[37] = t13;
|
|
206
|
+
$[38] = t14;
|
|
207
|
+
$[39] = t18;
|
|
208
|
+
$[40] = t20;
|
|
209
|
+
} else {
|
|
210
|
+
t20 = $[40];
|
|
211
|
+
}
|
|
212
|
+
let t21;
|
|
213
|
+
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
214
|
+
t21 = /*#__PURE__*/_jsx(Icon, {
|
|
215
|
+
icon: Search,
|
|
216
|
+
size: 14,
|
|
217
|
+
className: "shrink-0 text-text-faint"
|
|
218
|
+
});
|
|
219
|
+
$[41] = t21;
|
|
220
|
+
} else {
|
|
221
|
+
t21 = $[41];
|
|
222
|
+
}
|
|
223
|
+
let t22;
|
|
224
|
+
if ($[42] !== searchLabel) {
|
|
225
|
+
t22 = /*#__PURE__*/_jsxs("label", {
|
|
226
|
+
className: "flex shrink-0 items-center gap-2 border-b border-border px-3",
|
|
227
|
+
children: [t21, /*#__PURE__*/_jsx(Combobox.Input, {
|
|
228
|
+
"aria-label": searchLabel,
|
|
229
|
+
placeholder: searchLabel,
|
|
230
|
+
className: "h-9 min-w-0 flex-1 bg-transparent text-sm text-text outline-none placeholder:text-text-faint"
|
|
231
|
+
})]
|
|
232
|
+
});
|
|
233
|
+
$[42] = searchLabel;
|
|
234
|
+
$[43] = t22;
|
|
235
|
+
} else {
|
|
236
|
+
t22 = $[43];
|
|
237
|
+
}
|
|
238
|
+
let t23;
|
|
239
|
+
if ($[44] !== query || $[45] !== t) {
|
|
240
|
+
t23 = t("select.noMatch", {
|
|
241
|
+
query
|
|
242
|
+
});
|
|
243
|
+
$[44] = query;
|
|
244
|
+
$[45] = t;
|
|
245
|
+
$[46] = t23;
|
|
246
|
+
} else {
|
|
247
|
+
t23 = $[46];
|
|
248
|
+
}
|
|
249
|
+
let t24;
|
|
250
|
+
if ($[47] !== t23) {
|
|
251
|
+
t24 = /*#__PURE__*/_jsx(Combobox.Empty, {
|
|
252
|
+
className: "px-3 py-4 text-center text-xs text-text-faint empty:hidden",
|
|
253
|
+
children: t23
|
|
254
|
+
});
|
|
255
|
+
$[47] = t23;
|
|
256
|
+
$[48] = t24;
|
|
257
|
+
} else {
|
|
258
|
+
t24 = $[48];
|
|
259
|
+
}
|
|
260
|
+
let t25;
|
|
261
|
+
if ($[49] !== groups || $[50] !== renderRow) {
|
|
262
|
+
t25 = /*#__PURE__*/_jsx(Combobox.List, {
|
|
263
|
+
className: "min-h-0 overflow-auto",
|
|
264
|
+
children: groups ? group_1 => /*#__PURE__*/_jsxs(Combobox.Group, {
|
|
265
|
+
items: group_1.items,
|
|
266
|
+
children: [/*#__PURE__*/_jsx(Combobox.GroupLabel, {
|
|
267
|
+
className: MENU_LABEL,
|
|
268
|
+
children: group_1.value
|
|
269
|
+
}), /*#__PURE__*/_jsx(Combobox.Collection, {
|
|
270
|
+
children: renderRow
|
|
271
|
+
})]
|
|
272
|
+
}, group_1.value) : renderRow
|
|
273
|
+
});
|
|
274
|
+
$[49] = groups;
|
|
275
|
+
$[50] = renderRow;
|
|
276
|
+
$[51] = t25;
|
|
277
|
+
} else {
|
|
278
|
+
t25 = $[51];
|
|
279
|
+
}
|
|
280
|
+
let t26;
|
|
281
|
+
if ($[52] !== t22 || $[53] !== t24 || $[54] !== t25) {
|
|
282
|
+
t26 = /*#__PURE__*/_jsxs(Combobox.Popup, {
|
|
283
|
+
className: "menu-popup flex max-h-96 flex-col",
|
|
284
|
+
children: [t22, t24, t25]
|
|
285
|
+
});
|
|
286
|
+
$[52] = t22;
|
|
287
|
+
$[53] = t24;
|
|
288
|
+
$[54] = t25;
|
|
289
|
+
$[55] = t26;
|
|
290
|
+
} else {
|
|
291
|
+
t26 = $[55];
|
|
292
|
+
}
|
|
293
|
+
let t27;
|
|
294
|
+
if ($[56] !== align || $[57] !== t26) {
|
|
295
|
+
t27 = /*#__PURE__*/_jsx(Combobox.Portal, {
|
|
296
|
+
children: /*#__PURE__*/_jsx(Combobox.Positioner, {
|
|
297
|
+
className: "popup-positioner",
|
|
298
|
+
render: renderPositioner,
|
|
299
|
+
side: "bottom",
|
|
300
|
+
align: align,
|
|
301
|
+
sideOffset: 6,
|
|
302
|
+
children: t26
|
|
303
|
+
})
|
|
304
|
+
});
|
|
305
|
+
$[56] = align;
|
|
306
|
+
$[57] = t26;
|
|
307
|
+
$[58] = t27;
|
|
308
|
+
} else {
|
|
309
|
+
t27 = $[58];
|
|
310
|
+
}
|
|
311
|
+
let t28;
|
|
312
|
+
if ($[59] !== comboboxItems || $[60] !== disabled || $[61] !== t10 || $[62] !== t11 || $[63] !== t20 || $[64] !== t27 || $[65] !== value) {
|
|
313
|
+
t28 = /*#__PURE__*/_jsxs(Combobox.Root, {
|
|
314
|
+
items: comboboxItems,
|
|
315
|
+
value: value,
|
|
316
|
+
disabled: disabled,
|
|
317
|
+
autoHighlight: true,
|
|
318
|
+
itemToStringLabel: t10,
|
|
319
|
+
onValueChange: t11,
|
|
320
|
+
onInputValueChange: setQuery,
|
|
321
|
+
onOpenChange: t12,
|
|
322
|
+
children: [t20, t27]
|
|
323
|
+
});
|
|
324
|
+
$[59] = comboboxItems;
|
|
325
|
+
$[60] = disabled;
|
|
326
|
+
$[61] = t10;
|
|
327
|
+
$[62] = t11;
|
|
328
|
+
$[63] = t20;
|
|
329
|
+
$[64] = t27;
|
|
330
|
+
$[65] = value;
|
|
331
|
+
$[66] = t28;
|
|
332
|
+
} else {
|
|
333
|
+
t28 = $[66];
|
|
334
|
+
}
|
|
335
|
+
return t28;
|
|
336
|
+
}
|
|
337
|
+
function _temp5(item_1) {
|
|
338
|
+
return item_1.value;
|
|
339
|
+
}
|
|
340
|
+
function _temp4(group_0) {
|
|
341
|
+
return {
|
|
342
|
+
value: group_0.label,
|
|
343
|
+
items: group_0.items.map(_temp3)
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
function _temp3(item_0) {
|
|
347
|
+
return item_0.value;
|
|
348
|
+
}
|
|
349
|
+
function _temp2(item) {
|
|
350
|
+
return [item.value, item];
|
|
39
351
|
}
|
|
352
|
+
function _temp(group) {
|
|
353
|
+
return group.items;
|
|
354
|
+
}
|
package/dist/Separator.js
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
/* A hairline between two groups of controls in a toolbar-like row. No margin of its own: the row's gap
|
|
4
4
|
puts 8px on either side, which makes it read as a divider. Between groups of menu rows it is `Menu.Separator`. */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export function Separator(t0) {
|
|
7
|
+
const $ = _c(6);
|
|
8
|
+
const {
|
|
9
|
+
orientation: t1,
|
|
10
|
+
className,
|
|
11
|
+
ref
|
|
12
|
+
} = t0;
|
|
13
|
+
const orientation = t1 === undefined ? "vertical" : t1;
|
|
14
|
+
const t2 = orientation === "vertical" ? "h-4 w-px" : "h-px w-full";
|
|
15
|
+
let t3;
|
|
16
|
+
if ($[0] !== className || $[1] !== t2) {
|
|
17
|
+
t3 = clsx(t2, "shrink-0 bg-border", className);
|
|
18
|
+
$[0] = className;
|
|
19
|
+
$[1] = t2;
|
|
20
|
+
$[2] = t3;
|
|
21
|
+
} else {
|
|
22
|
+
t3 = $[2];
|
|
23
|
+
}
|
|
24
|
+
let t4;
|
|
25
|
+
if ($[3] !== ref || $[4] !== t3) {
|
|
26
|
+
t4 = /*#__PURE__*/_jsx("span", {
|
|
27
|
+
ref: ref,
|
|
28
|
+
"aria-hidden": true,
|
|
29
|
+
className: t3
|
|
30
|
+
});
|
|
31
|
+
$[3] = ref;
|
|
32
|
+
$[4] = t3;
|
|
33
|
+
$[5] = t4;
|
|
34
|
+
} else {
|
|
35
|
+
t4 = $[5];
|
|
36
|
+
}
|
|
37
|
+
return t4;
|
|
38
|
+
}
|
package/dist/ShortcutHints.js
CHANGED
|
@@ -1,36 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { isApplePlatform } from './platform.js';
|
|
5
5
|
import { formatShortcut } from './shortcut.js';
|
|
6
6
|
import { ModifierHold, placeHint, shortcutHintTargets } from './shortcut-hints.js';
|
|
7
7
|
/* Whether a person can see the button now: on screen, not faded out, and not under a dialog or another node. */
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
const isSeen = (element, rect) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return
|
|
10
|
+
if (rect.width === 0 || rect.height === 0 || rect.bottom <= 0 || rect.right <= 0 || rect.top >= window.innerHeight || rect.left >= window.innerWidth) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
if (!element.checkVisibility({
|
|
14
|
+
opacityProperty: true,
|
|
15
|
+
visibilityProperty: true
|
|
16
|
+
})) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const hit = document.elementFromPoint((rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2);
|
|
20
|
+
return hit !== null && element.contains(hit);
|
|
17
21
|
};
|
|
18
|
-
const measureHints =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
id: target.id,
|
|
29
|
-
text: formatShortcut(target.shortcut, apple),
|
|
30
|
-
style: { left: placement.left, right: placement.right, top: placement.top, translate: `${placement.translateX} ${placement.translateY}` }
|
|
31
|
-
});
|
|
22
|
+
const measureHints = apple => {
|
|
23
|
+
const viewport = {
|
|
24
|
+
width: window.innerWidth,
|
|
25
|
+
height: window.innerHeight
|
|
26
|
+
};
|
|
27
|
+
const hints = [];
|
|
28
|
+
for (const [element, target] of shortcutHintTargets()) {
|
|
29
|
+
const rect = element.getBoundingClientRect();
|
|
30
|
+
if (!isSeen(element, rect)) {
|
|
31
|
+
continue;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
const placement = placeHint(rect, viewport);
|
|
34
|
+
hints.push({
|
|
35
|
+
id: target.id,
|
|
36
|
+
text: formatShortcut(target.shortcut, apple),
|
|
37
|
+
style: {
|
|
38
|
+
left: placement.left,
|
|
39
|
+
right: placement.right,
|
|
40
|
+
top: placement.top,
|
|
41
|
+
translate: `${placement.translateX} ${placement.translateY}`
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return hints;
|
|
34
46
|
};
|
|
35
47
|
/*
|
|
36
48
|
* Every visible button's shortcut, under the button, for as long as the modifier is held on its own.
|
|
@@ -38,57 +50,115 @@ const measureHints = (apple) => {
|
|
|
38
50
|
* itself still takes the hints down. An embedded page (`<webview>`) has the keyboard to itself and shows none.
|
|
39
51
|
*/
|
|
40
52
|
export function ShortcutHints() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
53
|
+
const $ = _c(10);
|
|
54
|
+
const [shown, setShown] = useState(false);
|
|
55
|
+
let t0;
|
|
56
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57
|
+
t0 = [];
|
|
58
|
+
$[0] = t0;
|
|
59
|
+
} else {
|
|
60
|
+
t0 = $[0];
|
|
61
|
+
}
|
|
62
|
+
const [hints, setHints] = useState(t0);
|
|
63
|
+
const holdRef = useRef(null);
|
|
64
|
+
let t1;
|
|
65
|
+
let t2;
|
|
66
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
67
|
+
t1 = () => {
|
|
68
|
+
const hold = new ModifierHold(isApplePlatform(), setShown);
|
|
69
|
+
holdRef.current = hold;
|
|
70
|
+
const onKeyDown = e => hold.keyDown(e);
|
|
71
|
+
const onKeyUp = e_0 => hold.keyUp(e_0);
|
|
72
|
+
const cancel = () => hold.cancel();
|
|
73
|
+
window.addEventListener("keydown", onKeyDown, true);
|
|
74
|
+
window.addEventListener("keyup", onKeyUp, true);
|
|
75
|
+
window.addEventListener("pointerdown", cancel, true);
|
|
76
|
+
window.addEventListener("wheel", cancel, {
|
|
77
|
+
capture: true,
|
|
78
|
+
passive: true
|
|
79
|
+
});
|
|
80
|
+
window.addEventListener("blur", cancel);
|
|
81
|
+
return () => {
|
|
82
|
+
window.removeEventListener("keydown", onKeyDown, true);
|
|
83
|
+
window.removeEventListener("keyup", onKeyUp, true);
|
|
84
|
+
window.removeEventListener("pointerdown", cancel, true);
|
|
85
|
+
window.removeEventListener("wheel", cancel, true);
|
|
86
|
+
window.removeEventListener("blur", cancel);
|
|
87
|
+
hold.cancel();
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
t2 = [];
|
|
91
|
+
$[1] = t1;
|
|
92
|
+
$[2] = t2;
|
|
93
|
+
} else {
|
|
94
|
+
t1 = $[1];
|
|
95
|
+
t2 = $[2];
|
|
96
|
+
}
|
|
97
|
+
useEffect(t1, t2);
|
|
98
|
+
let t3;
|
|
99
|
+
let t4;
|
|
100
|
+
if ($[3] !== shown) {
|
|
101
|
+
t3 = () => {
|
|
102
|
+
if (!shown) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const apple = isApplePlatform();
|
|
106
|
+
let frame = 0;
|
|
107
|
+
let last = "";
|
|
108
|
+
const measure = () => {
|
|
109
|
+
if (document.activeElement?.tagName === "WEBVIEW") {
|
|
110
|
+
holdRef.current?.cancel();
|
|
111
|
+
return;
|
|
69
112
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
const next = measureHints(apple);
|
|
114
|
+
const signature = JSON.stringify(next);
|
|
115
|
+
if (signature !== last) {
|
|
116
|
+
last = signature;
|
|
117
|
+
setHints(next);
|
|
118
|
+
}
|
|
119
|
+
frame = requestAnimationFrame(measure);
|
|
120
|
+
};
|
|
121
|
+
measure();
|
|
122
|
+
return () => cancelAnimationFrame(frame);
|
|
123
|
+
};
|
|
124
|
+
t4 = [shown];
|
|
125
|
+
$[3] = shown;
|
|
126
|
+
$[4] = t3;
|
|
127
|
+
$[5] = t4;
|
|
128
|
+
} else {
|
|
129
|
+
t3 = $[4];
|
|
130
|
+
t4 = $[5];
|
|
131
|
+
}
|
|
132
|
+
useLayoutEffect(t3, t4);
|
|
133
|
+
if (!shown) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
let t5;
|
|
137
|
+
if ($[6] !== hints) {
|
|
138
|
+
t5 = hints.map(_temp);
|
|
139
|
+
$[6] = hints;
|
|
140
|
+
$[7] = t5;
|
|
141
|
+
} else {
|
|
142
|
+
t5 = $[7];
|
|
143
|
+
}
|
|
144
|
+
let t6;
|
|
145
|
+
if ($[8] !== t5) {
|
|
146
|
+
t6 = createPortal(/*#__PURE__*/_jsx("div", {
|
|
147
|
+
"aria-hidden": true,
|
|
148
|
+
className: "pointer-events-none fixed inset-0 z-(--z-shortcut-hints)",
|
|
149
|
+
children: t5
|
|
150
|
+
}), document.body);
|
|
151
|
+
$[8] = t5;
|
|
152
|
+
$[9] = t6;
|
|
153
|
+
} else {
|
|
154
|
+
t6 = $[9];
|
|
155
|
+
}
|
|
156
|
+
return t6;
|
|
94
157
|
}
|
|
158
|
+
function _temp(hint) {
|
|
159
|
+
return /*#__PURE__*/_jsx("kbd", {
|
|
160
|
+
className: "absolute rounded-md bg-text px-1.5 font-sans text-xs/tight font-medium whitespace-nowrap text-surface shadow-float",
|
|
161
|
+
style: hint.style,
|
|
162
|
+
children: hint.text
|
|
163
|
+
}, hint.id);
|
|
164
|
+
}
|