@adecore/ui 0.31.12 → 0.33.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/Stepper.js
CHANGED
|
@@ -1,18 +1,239 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Minus, Plus } from 'lucide-react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { ButtonGroup } from
|
|
5
|
+
import { ButtonGroup } from "./ButtonGroup.js";
|
|
6
6
|
import { formatFixed } from './format/number.js';
|
|
7
|
-
import { IconButton } from
|
|
7
|
+
import { IconButton } from "./IconButton.js";
|
|
8
8
|
import { placesOf } from './step-places.js';
|
|
9
9
|
/* A number between minus and plus, in one sunken group so the three read as a single control. */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
export function Stepper(t0) {
|
|
12
|
+
const $ = _c(58);
|
|
13
|
+
const {
|
|
14
|
+
value,
|
|
15
|
+
onValueChange,
|
|
16
|
+
min,
|
|
17
|
+
max,
|
|
18
|
+
step,
|
|
19
|
+
decimals: t1,
|
|
20
|
+
unit,
|
|
21
|
+
label,
|
|
22
|
+
className,
|
|
23
|
+
ref
|
|
24
|
+
} = t0;
|
|
25
|
+
let t2;
|
|
26
|
+
if ($[0] !== step || $[1] !== t1) {
|
|
27
|
+
t2 = t1 === undefined ? placesOf(step) : t1;
|
|
28
|
+
$[0] = step;
|
|
29
|
+
$[1] = t1;
|
|
30
|
+
$[2] = t2;
|
|
31
|
+
} else {
|
|
32
|
+
t2 = $[2];
|
|
33
|
+
}
|
|
34
|
+
const decimals = t2;
|
|
35
|
+
const {
|
|
36
|
+
t
|
|
37
|
+
} = useTranslation("ui");
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[3] !== decimals || $[4] !== unit) {
|
|
40
|
+
t3 = amount => /*#__PURE__*/_jsxs(_Fragment, {
|
|
41
|
+
children: [formatFixed(amount, decimals), unit && /*#__PURE__*/_jsx("span", {
|
|
42
|
+
className: "text-text-muted",
|
|
43
|
+
children: unit
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
$[3] = decimals;
|
|
47
|
+
$[4] = unit;
|
|
48
|
+
$[5] = t3;
|
|
49
|
+
} else {
|
|
50
|
+
t3 = $[5];
|
|
51
|
+
}
|
|
52
|
+
const reading = t3;
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[6] !== max || $[7] !== min || $[8] !== onValueChange || $[9] !== step || $[10] !== value) {
|
|
55
|
+
t4 = direction => {
|
|
56
|
+
const next = Math.round((value + direction * step) * 100) / 100;
|
|
57
|
+
onValueChange(Math.min(max, Math.max(min, next)));
|
|
16
58
|
};
|
|
17
|
-
|
|
18
|
-
|
|
59
|
+
$[6] = max;
|
|
60
|
+
$[7] = min;
|
|
61
|
+
$[8] = onValueChange;
|
|
62
|
+
$[9] = step;
|
|
63
|
+
$[10] = value;
|
|
64
|
+
$[11] = t4;
|
|
65
|
+
} else {
|
|
66
|
+
t4 = $[11];
|
|
67
|
+
}
|
|
68
|
+
const nudge = t4;
|
|
69
|
+
let t5;
|
|
70
|
+
if ($[12] !== className) {
|
|
71
|
+
t5 = clsx("shrink-0 rounded-lg bg-surface-sunken p-0.5", className);
|
|
72
|
+
$[12] = className;
|
|
73
|
+
$[13] = t5;
|
|
74
|
+
} else {
|
|
75
|
+
t5 = $[13];
|
|
76
|
+
}
|
|
77
|
+
let t6;
|
|
78
|
+
if ($[14] !== label || $[15] !== t) {
|
|
79
|
+
t6 = t("controls.stepper.smallerFor", {
|
|
80
|
+
label
|
|
81
|
+
});
|
|
82
|
+
$[14] = label;
|
|
83
|
+
$[15] = t;
|
|
84
|
+
$[16] = t6;
|
|
85
|
+
} else {
|
|
86
|
+
t6 = $[16];
|
|
87
|
+
}
|
|
88
|
+
let t7;
|
|
89
|
+
if ($[17] !== t) {
|
|
90
|
+
t7 = t("controls.stepper.smaller");
|
|
91
|
+
$[17] = t;
|
|
92
|
+
$[18] = t7;
|
|
93
|
+
} else {
|
|
94
|
+
t7 = $[18];
|
|
95
|
+
}
|
|
96
|
+
const t8 = value <= min;
|
|
97
|
+
let t9;
|
|
98
|
+
if ($[19] !== nudge) {
|
|
99
|
+
t9 = () => nudge(-1);
|
|
100
|
+
$[19] = nudge;
|
|
101
|
+
$[20] = t9;
|
|
102
|
+
} else {
|
|
103
|
+
t9 = $[20];
|
|
104
|
+
}
|
|
105
|
+
let t10;
|
|
106
|
+
if ($[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9) {
|
|
107
|
+
t10 = /*#__PURE__*/_jsx(IconButton, {
|
|
108
|
+
icon: Minus,
|
|
109
|
+
size: "sm",
|
|
110
|
+
label: t6,
|
|
111
|
+
tooltip: t7,
|
|
112
|
+
disabled: t8,
|
|
113
|
+
onClick: t9
|
|
114
|
+
});
|
|
115
|
+
$[21] = t6;
|
|
116
|
+
$[22] = t7;
|
|
117
|
+
$[23] = t8;
|
|
118
|
+
$[24] = t9;
|
|
119
|
+
$[25] = t10;
|
|
120
|
+
} else {
|
|
121
|
+
t10 = $[25];
|
|
122
|
+
}
|
|
123
|
+
let t11;
|
|
124
|
+
if ($[26] !== min || $[27] !== reading) {
|
|
125
|
+
t11 = /*#__PURE__*/_jsx("span", {
|
|
126
|
+
className: "invisible col-start-1 row-start-1",
|
|
127
|
+
children: reading(min)
|
|
128
|
+
});
|
|
129
|
+
$[26] = min;
|
|
130
|
+
$[27] = reading;
|
|
131
|
+
$[28] = t11;
|
|
132
|
+
} else {
|
|
133
|
+
t11 = $[28];
|
|
134
|
+
}
|
|
135
|
+
let t12;
|
|
136
|
+
if ($[29] !== max || $[30] !== reading) {
|
|
137
|
+
t12 = /*#__PURE__*/_jsx("span", {
|
|
138
|
+
className: "invisible col-start-1 row-start-1",
|
|
139
|
+
children: reading(max)
|
|
140
|
+
});
|
|
141
|
+
$[29] = max;
|
|
142
|
+
$[30] = reading;
|
|
143
|
+
$[31] = t12;
|
|
144
|
+
} else {
|
|
145
|
+
t12 = $[31];
|
|
146
|
+
}
|
|
147
|
+
let t13;
|
|
148
|
+
if ($[32] !== reading || $[33] !== value) {
|
|
149
|
+
t13 = /*#__PURE__*/_jsx("span", {
|
|
150
|
+
className: "col-start-1 row-start-1",
|
|
151
|
+
"aria-live": "polite",
|
|
152
|
+
children: reading(value)
|
|
153
|
+
});
|
|
154
|
+
$[32] = reading;
|
|
155
|
+
$[33] = value;
|
|
156
|
+
$[34] = t13;
|
|
157
|
+
} else {
|
|
158
|
+
t13 = $[34];
|
|
159
|
+
}
|
|
160
|
+
let t14;
|
|
161
|
+
if ($[35] !== t11 || $[36] !== t12 || $[37] !== t13) {
|
|
162
|
+
t14 = /*#__PURE__*/_jsxs("span", {
|
|
163
|
+
className: "grid min-w-10 px-1 text-center text-xs text-text tabular-nums",
|
|
164
|
+
children: [t11, t12, t13]
|
|
165
|
+
});
|
|
166
|
+
$[35] = t11;
|
|
167
|
+
$[36] = t12;
|
|
168
|
+
$[37] = t13;
|
|
169
|
+
$[38] = t14;
|
|
170
|
+
} else {
|
|
171
|
+
t14 = $[38];
|
|
172
|
+
}
|
|
173
|
+
let t15;
|
|
174
|
+
if ($[39] !== label || $[40] !== t) {
|
|
175
|
+
t15 = t("controls.stepper.largerFor", {
|
|
176
|
+
label
|
|
177
|
+
});
|
|
178
|
+
$[39] = label;
|
|
179
|
+
$[40] = t;
|
|
180
|
+
$[41] = t15;
|
|
181
|
+
} else {
|
|
182
|
+
t15 = $[41];
|
|
183
|
+
}
|
|
184
|
+
let t16;
|
|
185
|
+
if ($[42] !== t) {
|
|
186
|
+
t16 = t("controls.stepper.larger");
|
|
187
|
+
$[42] = t;
|
|
188
|
+
$[43] = t16;
|
|
189
|
+
} else {
|
|
190
|
+
t16 = $[43];
|
|
191
|
+
}
|
|
192
|
+
const t17 = value >= max;
|
|
193
|
+
let t18;
|
|
194
|
+
if ($[44] !== nudge) {
|
|
195
|
+
t18 = () => nudge(1);
|
|
196
|
+
$[44] = nudge;
|
|
197
|
+
$[45] = t18;
|
|
198
|
+
} else {
|
|
199
|
+
t18 = $[45];
|
|
200
|
+
}
|
|
201
|
+
let t19;
|
|
202
|
+
if ($[46] !== t15 || $[47] !== t16 || $[48] !== t17 || $[49] !== t18) {
|
|
203
|
+
t19 = /*#__PURE__*/_jsx(IconButton, {
|
|
204
|
+
icon: Plus,
|
|
205
|
+
size: "sm",
|
|
206
|
+
label: t15,
|
|
207
|
+
tooltip: t16,
|
|
208
|
+
disabled: t17,
|
|
209
|
+
onClick: t18
|
|
210
|
+
});
|
|
211
|
+
$[46] = t15;
|
|
212
|
+
$[47] = t16;
|
|
213
|
+
$[48] = t17;
|
|
214
|
+
$[49] = t18;
|
|
215
|
+
$[50] = t19;
|
|
216
|
+
} else {
|
|
217
|
+
t19 = $[50];
|
|
218
|
+
}
|
|
219
|
+
let t20;
|
|
220
|
+
if ($[51] !== label || $[52] !== ref || $[53] !== t10 || $[54] !== t14 || $[55] !== t19 || $[56] !== t5) {
|
|
221
|
+
t20 = /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
222
|
+
ref: ref,
|
|
223
|
+
className: t5,
|
|
224
|
+
role: "group",
|
|
225
|
+
"aria-label": label,
|
|
226
|
+
children: [t10, t14, t19]
|
|
227
|
+
});
|
|
228
|
+
$[51] = label;
|
|
229
|
+
$[52] = ref;
|
|
230
|
+
$[53] = t10;
|
|
231
|
+
$[54] = t14;
|
|
232
|
+
$[55] = t19;
|
|
233
|
+
$[56] = t5;
|
|
234
|
+
$[57] = t20;
|
|
235
|
+
} else {
|
|
236
|
+
t20 = $[57];
|
|
237
|
+
}
|
|
238
|
+
return t20;
|
|
239
|
+
}
|
package/dist/Surface.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import clsx from 'clsx';
|
|
2
3
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
4
|
const FLOAT = 'border border-border bg-[color-mix(in_srgb,var(--surface-raised)_88%,transparent)] shadow-float backdrop-blur-[14px]';
|
|
@@ -6,11 +7,64 @@ const FLOAT = 'border border-border bg-[color-mix(in_srgb,var(--surface-raised)_
|
|
|
6
7
|
* chip over a scrolling thread. It brings the ground, the border and the shadow; the caller brings
|
|
7
8
|
* the shape (radius, padding, height) and the position.
|
|
8
9
|
*/
|
|
9
|
-
export function Surface(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export function Surface(t0) {
|
|
11
|
+
const $ = _c(14);
|
|
12
|
+
let className;
|
|
13
|
+
let props;
|
|
14
|
+
let ref;
|
|
15
|
+
let render;
|
|
16
|
+
if ($[0] !== t0) {
|
|
17
|
+
({
|
|
18
|
+
render,
|
|
19
|
+
className,
|
|
20
|
+
ref,
|
|
21
|
+
...props
|
|
22
|
+
} = t0);
|
|
23
|
+
$[0] = t0;
|
|
24
|
+
$[1] = className;
|
|
25
|
+
$[2] = props;
|
|
26
|
+
$[3] = ref;
|
|
27
|
+
$[4] = render;
|
|
28
|
+
} else {
|
|
29
|
+
className = $[1];
|
|
30
|
+
props = $[2];
|
|
31
|
+
ref = $[3];
|
|
32
|
+
render = $[4];
|
|
33
|
+
}
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[5] !== className) {
|
|
36
|
+
t1 = clsx(FLOAT, className);
|
|
37
|
+
$[5] = className;
|
|
38
|
+
$[6] = t1;
|
|
39
|
+
} else {
|
|
40
|
+
t1 = $[6];
|
|
41
|
+
}
|
|
42
|
+
let t2;
|
|
43
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
44
|
+
t2 = {
|
|
45
|
+
...props,
|
|
46
|
+
className: t1
|
|
47
|
+
};
|
|
48
|
+
$[7] = props;
|
|
49
|
+
$[8] = t1;
|
|
50
|
+
$[9] = t2;
|
|
51
|
+
} else {
|
|
52
|
+
t2 = $[9];
|
|
53
|
+
}
|
|
54
|
+
let t3;
|
|
55
|
+
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
56
|
+
t3 = {
|
|
57
|
+
render,
|
|
58
|
+
ref,
|
|
59
|
+
defaultTagName: "div",
|
|
60
|
+
props: t2
|
|
61
|
+
};
|
|
62
|
+
$[10] = ref;
|
|
63
|
+
$[11] = render;
|
|
64
|
+
$[12] = t2;
|
|
65
|
+
$[13] = t3;
|
|
66
|
+
} else {
|
|
67
|
+
t3 = $[13];
|
|
68
|
+
}
|
|
69
|
+
return useRender(t3);
|
|
70
|
+
}
|
package/dist/Switch.js
CHANGED
|
@@ -1,9 +1,63 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Switch as BaseSwitch } from '@base-ui/react/switch';
|
|
4
4
|
/* On or off, as a switch rather than a checkbox: a setting that takes effect the moment it flips. */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export function Switch(t0) {
|
|
7
|
+
const $ = _c(12);
|
|
8
|
+
const {
|
|
9
|
+
checked,
|
|
10
|
+
onCheckedChange,
|
|
11
|
+
label,
|
|
12
|
+
disabled,
|
|
13
|
+
className,
|
|
14
|
+
ref
|
|
15
|
+
} = t0;
|
|
16
|
+
let t1;
|
|
17
|
+
if ($[0] !== onCheckedChange) {
|
|
18
|
+
t1 = next => onCheckedChange(next);
|
|
19
|
+
$[0] = onCheckedChange;
|
|
20
|
+
$[1] = t1;
|
|
21
|
+
} else {
|
|
22
|
+
t1 = $[1];
|
|
23
|
+
}
|
|
24
|
+
let t2;
|
|
25
|
+
if ($[2] !== className) {
|
|
26
|
+
t2 = clsx("relative inline-flex h-5 w-9 shrink-0 rounded-full bg-border-strong p-0.5 transition-colors data-checked:bg-accent data-disabled:opacity-50", className);
|
|
27
|
+
$[2] = className;
|
|
28
|
+
$[3] = t2;
|
|
29
|
+
} else {
|
|
30
|
+
t2 = $[3];
|
|
31
|
+
}
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t3 = /*#__PURE__*/_jsx(BaseSwitch.Thumb, {
|
|
35
|
+
className: "block h-4 w-4 rounded-full bg-surface-raised shadow-raised transition-transform data-checked:translate-x-4"
|
|
36
|
+
});
|
|
37
|
+
$[4] = t3;
|
|
38
|
+
} else {
|
|
39
|
+
t3 = $[4];
|
|
40
|
+
}
|
|
41
|
+
let t4;
|
|
42
|
+
if ($[5] !== checked || $[6] !== disabled || $[7] !== label || $[8] !== ref || $[9] !== t1 || $[10] !== t2) {
|
|
43
|
+
t4 = /*#__PURE__*/_jsx(BaseSwitch.Root, {
|
|
44
|
+
ref: ref,
|
|
45
|
+
checked: checked,
|
|
46
|
+
onCheckedChange: t1,
|
|
47
|
+
"aria-label": label,
|
|
48
|
+
disabled: disabled,
|
|
49
|
+
className: t2,
|
|
50
|
+
children: t3
|
|
51
|
+
});
|
|
52
|
+
$[5] = checked;
|
|
53
|
+
$[6] = disabled;
|
|
54
|
+
$[7] = label;
|
|
55
|
+
$[8] = ref;
|
|
56
|
+
$[9] = t1;
|
|
57
|
+
$[10] = t2;
|
|
58
|
+
$[11] = t4;
|
|
59
|
+
} else {
|
|
60
|
+
t4 = $[11];
|
|
61
|
+
}
|
|
62
|
+
return t4;
|
|
63
|
+
}
|
package/dist/TextMenu.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
3
|
import { Copy, Scan } from 'lucide-react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { copyText } from './clipboard.js';
|
|
6
|
-
import { Icon } from
|
|
7
|
-
import { Kbd } from
|
|
6
|
+
import { Icon } from "./Icon.js";
|
|
7
|
+
import { Kbd } from "./Kbd.js";
|
|
8
8
|
import { mergeRefs } from './merge-refs.js';
|
|
9
|
-
import { ContextMenuRoot, ContextMenuTrigger, MenuItem, MenuPopup, MenuSeparator } from
|
|
9
|
+
import { ContextMenuRoot, ContextMenuTrigger, MenuItem, MenuPopup, MenuSeparator } from "./menu/parts.js";
|
|
10
10
|
import { isApplePlatform } from './platform.js';
|
|
11
11
|
import { selectAllWithin, selectionWithin } from './selection.js';
|
|
12
12
|
import { EDIT_SHORTCUTS, matchesShortcut } from './shortcut.js';
|
|
@@ -15,17 +15,212 @@ import { EDIT_SHORTCUTS, matchesShortcut } from './shortcut.js';
|
|
|
15
15
|
* for the whole of it, on Cmd+A as well. Anywhere text can be selected a right-click has to offer
|
|
16
16
|
* to copy it, and an app that draws every menu itself offers nothing at all without one of these.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
export function TextMenu(t0) {
|
|
20
|
+
const $ = _c(40);
|
|
21
|
+
let children;
|
|
22
|
+
let items;
|
|
23
|
+
let ref;
|
|
24
|
+
let rest;
|
|
25
|
+
if ($[0] !== t0) {
|
|
26
|
+
({
|
|
27
|
+
children,
|
|
28
|
+
items,
|
|
29
|
+
ref,
|
|
30
|
+
...rest
|
|
31
|
+
} = t0);
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
$[1] = children;
|
|
34
|
+
$[2] = items;
|
|
35
|
+
$[3] = ref;
|
|
36
|
+
$[4] = rest;
|
|
37
|
+
} else {
|
|
38
|
+
children = $[1];
|
|
39
|
+
items = $[2];
|
|
40
|
+
ref = $[3];
|
|
41
|
+
rest = $[4];
|
|
42
|
+
}
|
|
43
|
+
const {
|
|
44
|
+
t
|
|
45
|
+
} = useTranslation("ui");
|
|
46
|
+
const host = useRef(null);
|
|
47
|
+
const [selection, setSelection] = useState("");
|
|
48
|
+
let t1;
|
|
49
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
50
|
+
t1 = event => {
|
|
51
|
+
if (!matchesShortcut(EDIT_SHORTCUTS.selectAll, event, isApplePlatform())) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
selectAllWithin(host.current);
|
|
29
56
|
};
|
|
30
|
-
|
|
31
|
-
}
|
|
57
|
+
$[5] = t1;
|
|
58
|
+
} else {
|
|
59
|
+
t1 = $[5];
|
|
60
|
+
}
|
|
61
|
+
const onKeyDown = t1;
|
|
62
|
+
let t2;
|
|
63
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
64
|
+
t2 = open => setSelection(open ? selectionWithin(host.current) : "");
|
|
65
|
+
$[6] = t2;
|
|
66
|
+
} else {
|
|
67
|
+
t2 = $[6];
|
|
68
|
+
}
|
|
69
|
+
let t3;
|
|
70
|
+
if ($[7] !== ref) {
|
|
71
|
+
t3 = mergeRefs(host, ref);
|
|
72
|
+
$[7] = ref;
|
|
73
|
+
$[8] = t3;
|
|
74
|
+
} else {
|
|
75
|
+
t3 = $[8];
|
|
76
|
+
}
|
|
77
|
+
let t4;
|
|
78
|
+
if ($[9] !== children || $[10] !== rest || $[11] !== t3) {
|
|
79
|
+
t4 = /*#__PURE__*/_jsx(ContextMenuTrigger, {
|
|
80
|
+
...rest,
|
|
81
|
+
ref: t3,
|
|
82
|
+
onKeyDown: onKeyDown,
|
|
83
|
+
children: children
|
|
84
|
+
});
|
|
85
|
+
$[9] = children;
|
|
86
|
+
$[10] = rest;
|
|
87
|
+
$[11] = t3;
|
|
88
|
+
$[12] = t4;
|
|
89
|
+
} else {
|
|
90
|
+
t4 = $[12];
|
|
91
|
+
}
|
|
92
|
+
const t5 = selection === "";
|
|
93
|
+
let t6;
|
|
94
|
+
if ($[13] !== selection) {
|
|
95
|
+
t6 = () => copyText(selection);
|
|
96
|
+
$[13] = selection;
|
|
97
|
+
$[14] = t6;
|
|
98
|
+
} else {
|
|
99
|
+
t6 = $[14];
|
|
100
|
+
}
|
|
101
|
+
let t7;
|
|
102
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
103
|
+
t7 = /*#__PURE__*/_jsx(Icon, {
|
|
104
|
+
icon: Copy,
|
|
105
|
+
size: 14
|
|
106
|
+
});
|
|
107
|
+
$[15] = t7;
|
|
108
|
+
} else {
|
|
109
|
+
t7 = $[15];
|
|
110
|
+
}
|
|
111
|
+
let t8;
|
|
112
|
+
if ($[16] !== t) {
|
|
113
|
+
t8 = t("action.copy");
|
|
114
|
+
$[16] = t;
|
|
115
|
+
$[17] = t8;
|
|
116
|
+
} else {
|
|
117
|
+
t8 = $[17];
|
|
118
|
+
}
|
|
119
|
+
let t9;
|
|
120
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
|
+
t9 = /*#__PURE__*/_jsx(Kbd, {
|
|
122
|
+
shortcut: EDIT_SHORTCUTS.copy
|
|
123
|
+
});
|
|
124
|
+
$[18] = t9;
|
|
125
|
+
} else {
|
|
126
|
+
t9 = $[18];
|
|
127
|
+
}
|
|
128
|
+
let t10;
|
|
129
|
+
if ($[19] !== t5 || $[20] !== t6 || $[21] !== t8) {
|
|
130
|
+
t10 = /*#__PURE__*/_jsxs(MenuItem, {
|
|
131
|
+
disabled: t5,
|
|
132
|
+
onClick: t6,
|
|
133
|
+
children: [t7, " ", t8, " ", t9]
|
|
134
|
+
});
|
|
135
|
+
$[19] = t5;
|
|
136
|
+
$[20] = t6;
|
|
137
|
+
$[21] = t8;
|
|
138
|
+
$[22] = t10;
|
|
139
|
+
} else {
|
|
140
|
+
t10 = $[22];
|
|
141
|
+
}
|
|
142
|
+
let t11;
|
|
143
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
144
|
+
t11 = /*#__PURE__*/_jsx(MenuSeparator, {});
|
|
145
|
+
$[23] = t11;
|
|
146
|
+
} else {
|
|
147
|
+
t11 = $[23];
|
|
148
|
+
}
|
|
149
|
+
let t12;
|
|
150
|
+
let t13;
|
|
151
|
+
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
152
|
+
t12 = () => selectAllWithin(host.current);
|
|
153
|
+
t13 = /*#__PURE__*/_jsx(Icon, {
|
|
154
|
+
icon: Scan,
|
|
155
|
+
size: 14
|
|
156
|
+
});
|
|
157
|
+
$[24] = t12;
|
|
158
|
+
$[25] = t13;
|
|
159
|
+
} else {
|
|
160
|
+
t12 = $[24];
|
|
161
|
+
t13 = $[25];
|
|
162
|
+
}
|
|
163
|
+
let t14;
|
|
164
|
+
if ($[26] !== t) {
|
|
165
|
+
t14 = t("action.selectAll");
|
|
166
|
+
$[26] = t;
|
|
167
|
+
$[27] = t14;
|
|
168
|
+
} else {
|
|
169
|
+
t14 = $[27];
|
|
170
|
+
}
|
|
171
|
+
let t15;
|
|
172
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
173
|
+
t15 = /*#__PURE__*/_jsx(Kbd, {
|
|
174
|
+
shortcut: EDIT_SHORTCUTS.selectAll
|
|
175
|
+
});
|
|
176
|
+
$[28] = t15;
|
|
177
|
+
} else {
|
|
178
|
+
t15 = $[28];
|
|
179
|
+
}
|
|
180
|
+
let t16;
|
|
181
|
+
if ($[29] !== t14) {
|
|
182
|
+
t16 = /*#__PURE__*/_jsxs(MenuItem, {
|
|
183
|
+
onClick: t12,
|
|
184
|
+
children: [t13, " ", t14, " ", t15]
|
|
185
|
+
});
|
|
186
|
+
$[29] = t14;
|
|
187
|
+
$[30] = t16;
|
|
188
|
+
} else {
|
|
189
|
+
t16 = $[30];
|
|
190
|
+
}
|
|
191
|
+
let t17;
|
|
192
|
+
if ($[31] !== items) {
|
|
193
|
+
t17 = items !== undefined && /*#__PURE__*/_jsxs(_Fragment, {
|
|
194
|
+
children: [/*#__PURE__*/_jsx(MenuSeparator, {}), items]
|
|
195
|
+
});
|
|
196
|
+
$[31] = items;
|
|
197
|
+
$[32] = t17;
|
|
198
|
+
} else {
|
|
199
|
+
t17 = $[32];
|
|
200
|
+
}
|
|
201
|
+
let t18;
|
|
202
|
+
if ($[33] !== t10 || $[34] !== t16 || $[35] !== t17) {
|
|
203
|
+
t18 = /*#__PURE__*/_jsxs(MenuPopup, {
|
|
204
|
+
children: [t10, t11, t16, t17]
|
|
205
|
+
});
|
|
206
|
+
$[33] = t10;
|
|
207
|
+
$[34] = t16;
|
|
208
|
+
$[35] = t17;
|
|
209
|
+
$[36] = t18;
|
|
210
|
+
} else {
|
|
211
|
+
t18 = $[36];
|
|
212
|
+
}
|
|
213
|
+
let t19;
|
|
214
|
+
if ($[37] !== t18 || $[38] !== t4) {
|
|
215
|
+
t19 = /*#__PURE__*/_jsxs(ContextMenuRoot, {
|
|
216
|
+
onOpenChange: t2,
|
|
217
|
+
children: [t4, t18]
|
|
218
|
+
});
|
|
219
|
+
$[37] = t18;
|
|
220
|
+
$[38] = t4;
|
|
221
|
+
$[39] = t19;
|
|
222
|
+
} else {
|
|
223
|
+
t19 = $[39];
|
|
224
|
+
}
|
|
225
|
+
return t19;
|
|
226
|
+
}
|