@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,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
|
/*
|
|
@@ -5,29 +6,262 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
5
6
|
* there. Every item is a subgrid of the list, so the names line up across rows and a hairline runs
|
|
6
7
|
* under both columns.
|
|
7
8
|
*/
|
|
8
|
-
export function KeyValueListRoot(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
export function KeyValueListRoot(t0) {
|
|
10
|
+
const $ = _c(16);
|
|
11
|
+
let className;
|
|
12
|
+
let props;
|
|
13
|
+
let ref;
|
|
14
|
+
let render;
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== t0) {
|
|
17
|
+
({
|
|
18
|
+
divided: t1,
|
|
19
|
+
render,
|
|
20
|
+
className,
|
|
21
|
+
ref,
|
|
22
|
+
...props
|
|
23
|
+
} = t0);
|
|
24
|
+
$[0] = t0;
|
|
25
|
+
$[1] = className;
|
|
26
|
+
$[2] = props;
|
|
27
|
+
$[3] = ref;
|
|
28
|
+
$[4] = render;
|
|
29
|
+
$[5] = t1;
|
|
30
|
+
} else {
|
|
31
|
+
className = $[1];
|
|
32
|
+
props = $[2];
|
|
33
|
+
ref = $[3];
|
|
34
|
+
render = $[4];
|
|
35
|
+
t1 = $[5];
|
|
36
|
+
}
|
|
37
|
+
const divided = t1 === undefined ? false : t1;
|
|
38
|
+
const t2 = divided ? "divide-y divide-border-soft *:py-1.5" : "gap-y-1";
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[6] !== className || $[7] !== t2) {
|
|
41
|
+
t3 = clsx("grid min-w-0 grid-cols-[fit-content(40%)_minmax(0,1fr)] gap-x-3 text-xs", t2, className);
|
|
42
|
+
$[6] = className;
|
|
43
|
+
$[7] = t2;
|
|
44
|
+
$[8] = t3;
|
|
45
|
+
} else {
|
|
46
|
+
t3 = $[8];
|
|
47
|
+
}
|
|
48
|
+
let t4;
|
|
49
|
+
if ($[9] !== props || $[10] !== t3) {
|
|
50
|
+
t4 = {
|
|
51
|
+
...props,
|
|
52
|
+
className: t3
|
|
53
|
+
};
|
|
54
|
+
$[9] = props;
|
|
55
|
+
$[10] = t3;
|
|
56
|
+
$[11] = t4;
|
|
57
|
+
} else {
|
|
58
|
+
t4 = $[11];
|
|
59
|
+
}
|
|
60
|
+
let t5;
|
|
61
|
+
if ($[12] !== ref || $[13] !== render || $[14] !== t4) {
|
|
62
|
+
t5 = {
|
|
63
|
+
render,
|
|
64
|
+
ref,
|
|
65
|
+
defaultTagName: "dl",
|
|
66
|
+
props: t4
|
|
67
|
+
};
|
|
68
|
+
$[12] = ref;
|
|
69
|
+
$[13] = render;
|
|
70
|
+
$[14] = t4;
|
|
71
|
+
$[15] = t5;
|
|
72
|
+
} else {
|
|
73
|
+
t5 = $[15];
|
|
74
|
+
}
|
|
75
|
+
return useRender(t5);
|
|
18
76
|
}
|
|
19
|
-
export function KeyValueListItem(
|
|
20
|
-
|
|
77
|
+
export function KeyValueListItem(t0) {
|
|
78
|
+
const $ = _c(14);
|
|
79
|
+
let className;
|
|
80
|
+
let props;
|
|
81
|
+
let ref;
|
|
82
|
+
let render;
|
|
83
|
+
if ($[0] !== t0) {
|
|
84
|
+
({
|
|
85
|
+
render,
|
|
86
|
+
className,
|
|
87
|
+
ref,
|
|
88
|
+
...props
|
|
89
|
+
} = t0);
|
|
90
|
+
$[0] = t0;
|
|
91
|
+
$[1] = className;
|
|
92
|
+
$[2] = props;
|
|
93
|
+
$[3] = ref;
|
|
94
|
+
$[4] = render;
|
|
95
|
+
} else {
|
|
96
|
+
className = $[1];
|
|
97
|
+
props = $[2];
|
|
98
|
+
ref = $[3];
|
|
99
|
+
render = $[4];
|
|
100
|
+
}
|
|
101
|
+
let t1;
|
|
102
|
+
if ($[5] !== className) {
|
|
103
|
+
t1 = clsx("col-span-2 grid grid-cols-subgrid", className);
|
|
104
|
+
$[5] = className;
|
|
105
|
+
$[6] = t1;
|
|
106
|
+
} else {
|
|
107
|
+
t1 = $[6];
|
|
108
|
+
}
|
|
109
|
+
let t2;
|
|
110
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
111
|
+
t2 = {
|
|
112
|
+
...props,
|
|
113
|
+
className: t1
|
|
114
|
+
};
|
|
115
|
+
$[7] = props;
|
|
116
|
+
$[8] = t1;
|
|
117
|
+
$[9] = t2;
|
|
118
|
+
} else {
|
|
119
|
+
t2 = $[9];
|
|
120
|
+
}
|
|
121
|
+
let t3;
|
|
122
|
+
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
123
|
+
t3 = {
|
|
124
|
+
render,
|
|
125
|
+
ref,
|
|
126
|
+
defaultTagName: "div",
|
|
127
|
+
props: t2
|
|
128
|
+
};
|
|
129
|
+
$[10] = ref;
|
|
130
|
+
$[11] = render;
|
|
131
|
+
$[12] = t2;
|
|
132
|
+
$[13] = t3;
|
|
133
|
+
} else {
|
|
134
|
+
t3 = $[13];
|
|
135
|
+
}
|
|
136
|
+
return useRender(t3);
|
|
21
137
|
}
|
|
22
|
-
export function KeyValueListName(
|
|
23
|
-
|
|
138
|
+
export function KeyValueListName(t0) {
|
|
139
|
+
const $ = _c(14);
|
|
140
|
+
let className;
|
|
141
|
+
let props;
|
|
142
|
+
let ref;
|
|
143
|
+
let render;
|
|
144
|
+
if ($[0] !== t0) {
|
|
145
|
+
({
|
|
146
|
+
render,
|
|
147
|
+
className,
|
|
148
|
+
ref,
|
|
149
|
+
...props
|
|
150
|
+
} = t0);
|
|
151
|
+
$[0] = t0;
|
|
152
|
+
$[1] = className;
|
|
153
|
+
$[2] = props;
|
|
154
|
+
$[3] = ref;
|
|
155
|
+
$[4] = render;
|
|
156
|
+
} else {
|
|
157
|
+
className = $[1];
|
|
158
|
+
props = $[2];
|
|
159
|
+
ref = $[3];
|
|
160
|
+
render = $[4];
|
|
161
|
+
}
|
|
162
|
+
let t1;
|
|
163
|
+
if ($[5] !== className) {
|
|
164
|
+
t1 = clsx("min-w-0 break-words text-text-faint", className);
|
|
165
|
+
$[5] = className;
|
|
166
|
+
$[6] = t1;
|
|
167
|
+
} else {
|
|
168
|
+
t1 = $[6];
|
|
169
|
+
}
|
|
170
|
+
let t2;
|
|
171
|
+
if ($[7] !== props || $[8] !== t1) {
|
|
172
|
+
t2 = {
|
|
173
|
+
...props,
|
|
174
|
+
className: t1
|
|
175
|
+
};
|
|
176
|
+
$[7] = props;
|
|
177
|
+
$[8] = t1;
|
|
178
|
+
$[9] = t2;
|
|
179
|
+
} else {
|
|
180
|
+
t2 = $[9];
|
|
181
|
+
}
|
|
182
|
+
let t3;
|
|
183
|
+
if ($[10] !== ref || $[11] !== render || $[12] !== t2) {
|
|
184
|
+
t3 = {
|
|
185
|
+
render,
|
|
186
|
+
ref,
|
|
187
|
+
defaultTagName: "dt",
|
|
188
|
+
props: t2
|
|
189
|
+
};
|
|
190
|
+
$[10] = ref;
|
|
191
|
+
$[11] = render;
|
|
192
|
+
$[12] = t2;
|
|
193
|
+
$[13] = t3;
|
|
194
|
+
} else {
|
|
195
|
+
t3 = $[13];
|
|
196
|
+
}
|
|
197
|
+
return useRender(t3);
|
|
24
198
|
}
|
|
25
199
|
/* Selectable, unlike the interface around it, so a long value can be copied. */
|
|
26
|
-
export function KeyValueListValue(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
200
|
+
export function KeyValueListValue(t0) {
|
|
201
|
+
const $ = _c(16);
|
|
202
|
+
let className;
|
|
203
|
+
let props;
|
|
204
|
+
let ref;
|
|
205
|
+
let render;
|
|
206
|
+
let t1;
|
|
207
|
+
if ($[0] !== t0) {
|
|
208
|
+
({
|
|
209
|
+
mono: t1,
|
|
210
|
+
render,
|
|
211
|
+
className,
|
|
212
|
+
ref,
|
|
213
|
+
...props
|
|
214
|
+
} = t0);
|
|
215
|
+
$[0] = t0;
|
|
216
|
+
$[1] = className;
|
|
217
|
+
$[2] = props;
|
|
218
|
+
$[3] = ref;
|
|
219
|
+
$[4] = render;
|
|
220
|
+
$[5] = t1;
|
|
221
|
+
} else {
|
|
222
|
+
className = $[1];
|
|
223
|
+
props = $[2];
|
|
224
|
+
ref = $[3];
|
|
225
|
+
render = $[4];
|
|
226
|
+
t1 = $[5];
|
|
227
|
+
}
|
|
228
|
+
const mono = t1 === undefined ? false : t1;
|
|
229
|
+
const t2 = mono && "font-mono text-code";
|
|
230
|
+
let t3;
|
|
231
|
+
if ($[6] !== className || $[7] !== t2) {
|
|
232
|
+
t3 = clsx("min-w-0 break-words text-text select-text", t2, className);
|
|
233
|
+
$[6] = className;
|
|
234
|
+
$[7] = t2;
|
|
235
|
+
$[8] = t3;
|
|
236
|
+
} else {
|
|
237
|
+
t3 = $[8];
|
|
238
|
+
}
|
|
239
|
+
let t4;
|
|
240
|
+
if ($[9] !== props || $[10] !== t3) {
|
|
241
|
+
t4 = {
|
|
242
|
+
...props,
|
|
243
|
+
className: t3
|
|
244
|
+
};
|
|
245
|
+
$[9] = props;
|
|
246
|
+
$[10] = t3;
|
|
247
|
+
$[11] = t4;
|
|
248
|
+
} else {
|
|
249
|
+
t4 = $[11];
|
|
250
|
+
}
|
|
251
|
+
let t5;
|
|
252
|
+
if ($[12] !== ref || $[13] !== render || $[14] !== t4) {
|
|
253
|
+
t5 = {
|
|
254
|
+
render,
|
|
255
|
+
ref,
|
|
256
|
+
defaultTagName: "dd",
|
|
257
|
+
props: t4
|
|
258
|
+
};
|
|
259
|
+
$[12] = ref;
|
|
260
|
+
$[13] = render;
|
|
261
|
+
$[14] = t4;
|
|
262
|
+
$[15] = t5;
|
|
263
|
+
} else {
|
|
264
|
+
t5 = $[15];
|
|
265
|
+
}
|
|
266
|
+
return useRender(t5);
|
|
267
|
+
}
|
package/dist/lazy-landings.js
CHANGED
|
@@ -2,17 +2,17 @@ let landings = 0;
|
|
|
2
2
|
const listeners = new Set();
|
|
3
3
|
/* Called once per module, when a `LoadedComponent` first has it. */
|
|
4
4
|
export function noteLanding() {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
landings += 1;
|
|
6
|
+
for (const listener of listeners) {
|
|
7
|
+
listener();
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
10
|
export function subscribeLandings(listener) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
listeners.add(listener);
|
|
12
|
+
return () => {
|
|
13
|
+
listeners.delete(listener);
|
|
14
|
+
};
|
|
15
15
|
}
|
|
16
16
|
export function readLandings() {
|
|
17
|
-
|
|
18
|
-
}
|
|
17
|
+
return landings;
|
|
18
|
+
}
|
package/dist/lazy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { Suspense, lazy, useState, useSyncExternalStore } from 'react';
|
|
3
3
|
import { noteLanding } from './lazy-landings.js';
|
|
4
4
|
import { prefetcher } from './prefetch.js';
|
|
@@ -7,30 +7,31 @@ import { prefetcher } from './prefetch.js';
|
|
|
7
7
|
* prefetcher already has, which shows the fallback and mounts a dialog already open; a component
|
|
8
8
|
* that is here is drawn straight away instead.
|
|
9
9
|
*/
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
export class LoadedComponent {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
return component;
|
|
27
|
-
}
|
|
28
|
-
subscribe(listener) {
|
|
29
|
-
this.listeners.add(listener);
|
|
30
|
-
return () => {
|
|
31
|
-
this.listeners.delete(listener);
|
|
32
|
-
};
|
|
12
|
+
current = null;
|
|
13
|
+
listeners = new Set();
|
|
14
|
+
loader;
|
|
15
|
+
constructor(loader) {
|
|
16
|
+
this.loader = loader;
|
|
17
|
+
}
|
|
18
|
+
async load() {
|
|
19
|
+
const component = await this.loader();
|
|
20
|
+
if (this.current === null) {
|
|
21
|
+
this.current = component;
|
|
22
|
+
for (const listener of this.listeners) {
|
|
23
|
+
listener();
|
|
24
|
+
}
|
|
25
|
+
noteLanding();
|
|
33
26
|
}
|
|
27
|
+
return component;
|
|
28
|
+
}
|
|
29
|
+
subscribe(listener) {
|
|
30
|
+
this.listeners.add(listener);
|
|
31
|
+
return () => {
|
|
32
|
+
this.listeners.delete(listener);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
34
35
|
}
|
|
35
36
|
const openErrorListeners = new Set();
|
|
36
37
|
/*
|
|
@@ -39,22 +40,23 @@ const openErrorListeners = new Set();
|
|
|
39
40
|
* module at the same moment, so an app can answer the one without being woken by the other.
|
|
40
41
|
*/
|
|
41
42
|
export function onLazyOpenError(listener) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
openErrorListeners.add(listener);
|
|
44
|
+
return () => {
|
|
45
|
+
openErrorListeners.delete(listener);
|
|
46
|
+
};
|
|
46
47
|
}
|
|
47
48
|
/* Only a render loads through here; the prefetcher calls `loaded.load()` itself, so its failures report nothing. */
|
|
48
49
|
async function open(loaded) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
throw error;
|
|
50
|
+
try {
|
|
51
|
+
return {
|
|
52
|
+
default: await loaded.load()
|
|
53
|
+
};
|
|
54
|
+
} catch (error) {
|
|
55
|
+
for (const listener of openErrorListeners) {
|
|
56
|
+
listener(error);
|
|
57
57
|
}
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
58
60
|
}
|
|
59
61
|
/*
|
|
60
62
|
* `React.lazy` for a module that exports its component by name, `default` included. Every module
|
|
@@ -62,49 +64,60 @@ async function open(loaded) {
|
|
|
62
64
|
* its first opening once the app calls `prefetcher.prefetchEverything()`.
|
|
63
65
|
*/
|
|
64
66
|
export function lazyNamed(load, name) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
67
|
+
const loaded = new LoadedComponent(async () => (await load())[name]);
|
|
68
|
+
prefetcher.register(() => loaded.load());
|
|
69
|
+
const Lazy = lazy(() => open(loaded));
|
|
70
|
+
// Once `loaded` has it, `Lazy` never committed anything, so switching over remounts nothing.
|
|
71
|
+
const LazyNamed = props => {
|
|
72
|
+
// `loaded` fills in place; compiled, the element drawn before the module landed would stay.
|
|
73
|
+
'use no memo';
|
|
74
|
+
|
|
75
|
+
const Component = loaded.current ?? Lazy;
|
|
76
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
77
|
+
...props
|
|
77
78
|
});
|
|
79
|
+
};
|
|
80
|
+
return Object.assign(LazyNamed, {
|
|
81
|
+
preload: async () => {
|
|
82
|
+
await loaded.load();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
78
85
|
}
|
|
79
86
|
/* Stays true after the first opening, so every close after it still has something mounted to animate. */
|
|
80
87
|
function useOpenedOnce(open) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
const [opened, setOpened] = useState(open);
|
|
89
|
+
if (open && !opened) {
|
|
90
|
+
setOpened(true);
|
|
91
|
+
}
|
|
92
|
+
return opened || open;
|
|
86
93
|
}
|
|
87
94
|
/*
|
|
88
95
|
* A dialog that keeps its own open state. Once its module is here, prefetched or opened, it stays
|
|
89
96
|
* mounted closed, so its first opening animates like every other; before that, opening loads it.
|
|
90
97
|
*/
|
|
91
98
|
export function lazyDialog(load, name, useStore, isOpen) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
const loaded = new LoadedComponent(async () => (await load())[name]);
|
|
100
|
+
prefetcher.register(() => loaded.load());
|
|
101
|
+
const Dialog = lazy(() => open(loaded));
|
|
102
|
+
const subscribe = listener => loaded.subscribe(listener);
|
|
103
|
+
const isLoaded = () => loaded.current !== null;
|
|
104
|
+
const LazyDialog = () => {
|
|
105
|
+
// As in `lazyNamed`: what `loaded` holds is read again on every render.
|
|
106
|
+
'use no memo';
|
|
107
|
+
|
|
108
|
+
const opened = useOpenedOnce(useStore(isOpen));
|
|
109
|
+
useSyncExternalStore(subscribe, isLoaded);
|
|
110
|
+
const Loaded = loaded.current;
|
|
111
|
+
if (Loaded) {
|
|
112
|
+
return /*#__PURE__*/_jsx(Loaded, {});
|
|
113
|
+
}
|
|
114
|
+
if (!opened) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
return /*#__PURE__*/_jsx(Suspense, {
|
|
118
|
+
fallback: null,
|
|
119
|
+
children: /*#__PURE__*/_jsx(Dialog, {})
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
return LazyDialog;
|
|
123
|
+
}
|
package/dist/locales/en.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
controls: {
|
|
30
|
-
stepper: {
|
|
31
|
-
smaller: 'Smaller',
|
|
32
|
-
larger: 'Larger',
|
|
33
|
-
smallerFor: '{{label}}: smaller',
|
|
34
|
-
largerFor: '{{label}}: larger'
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
select: {
|
|
38
|
-
search: 'Search',
|
|
39
|
-
noMatch: 'No option matches “{{query}}”'
|
|
40
|
-
},
|
|
41
|
-
iconPicker: {
|
|
42
|
-
label: 'Icon',
|
|
43
|
-
none: 'No icon',
|
|
44
|
-
search: 'Find an icon',
|
|
45
|
-
clear: 'Clear search',
|
|
46
|
-
noMatch: 'No icon matches “{{query}}”'
|
|
47
|
-
},
|
|
48
|
-
zoom: {
|
|
49
|
-
out: 'Zoom out',
|
|
50
|
-
in: 'Zoom in',
|
|
51
|
-
presets: 'Zoom presets',
|
|
52
|
-
fit: 'Zoom to fit',
|
|
53
|
-
fitEverything: 'Fit everything'
|
|
54
|
-
},
|
|
55
|
-
waveform: {
|
|
56
|
-
position: '{{time}} of {{duration}}'
|
|
57
|
-
},
|
|
58
|
-
projectSwitcher: {
|
|
59
|
-
label: 'Projects',
|
|
60
|
-
recent: 'Recent projects',
|
|
61
|
-
actionsFor: 'Actions for {{name}}'
|
|
62
|
-
},
|
|
63
|
-
tabs: {
|
|
64
|
-
more: 'More',
|
|
65
|
-
close: 'Close tab'
|
|
66
|
-
},
|
|
67
|
-
tree: {
|
|
68
|
-
label: 'Files',
|
|
69
|
-
expand: 'Expand',
|
|
70
|
-
collapse: 'Collapse'
|
|
71
|
-
},
|
|
72
|
-
workspace: {
|
|
73
|
-
tabs: 'Open views',
|
|
74
|
-
unsaved: 'Unsaved changes',
|
|
75
|
-
closeTab: 'Close {{name}}',
|
|
76
|
-
resize: 'Resize panels',
|
|
77
|
-
pane: 'Panel',
|
|
78
|
-
movePane: 'Move panel',
|
|
79
|
-
maximize: 'Maximize panel',
|
|
80
|
-
restore: 'Restore panels'
|
|
2
|
+
action: {
|
|
3
|
+
cancel: 'Cancel',
|
|
4
|
+
copy: 'Copy',
|
|
5
|
+
copyError: 'Copy error',
|
|
6
|
+
dismiss: 'Dismiss',
|
|
7
|
+
reload: 'Reload',
|
|
8
|
+
retry: 'Try again',
|
|
9
|
+
select: 'Select',
|
|
10
|
+
selectAll: 'Select all'
|
|
11
|
+
},
|
|
12
|
+
accent: {
|
|
13
|
+
more: 'More colors'
|
|
14
|
+
},
|
|
15
|
+
settings: {
|
|
16
|
+
title: 'Settings',
|
|
17
|
+
section: 'Settings section',
|
|
18
|
+
sections: 'Settings sections',
|
|
19
|
+
close: 'Close settings',
|
|
20
|
+
failed: 'Could not show this settings page',
|
|
21
|
+
search: {
|
|
22
|
+
placeholder: 'Search settings',
|
|
23
|
+
clear: 'Clear search',
|
|
24
|
+
none: 'No results for “{{query}}”',
|
|
25
|
+
results: 'Search results',
|
|
26
|
+
pane: 'Section'
|
|
81
27
|
}
|
|
82
|
-
}
|
|
28
|
+
},
|
|
29
|
+
controls: {
|
|
30
|
+
stepper: {
|
|
31
|
+
smaller: 'Smaller',
|
|
32
|
+
larger: 'Larger',
|
|
33
|
+
smallerFor: '{{label}}: smaller',
|
|
34
|
+
largerFor: '{{label}}: larger'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
select: {
|
|
38
|
+
search: 'Search',
|
|
39
|
+
noMatch: 'No match for “{{query}}”'
|
|
40
|
+
},
|
|
41
|
+
iconPicker: {
|
|
42
|
+
label: 'Icon',
|
|
43
|
+
none: 'No icon',
|
|
44
|
+
search: 'Search icons',
|
|
45
|
+
clear: 'Clear search',
|
|
46
|
+
noMatch: 'No icon matches “{{query}}”'
|
|
47
|
+
},
|
|
48
|
+
zoom: {
|
|
49
|
+
out: 'Zoom out',
|
|
50
|
+
in: 'Zoom in',
|
|
51
|
+
presets: 'Zoom presets',
|
|
52
|
+
fit: 'Zoom to fit',
|
|
53
|
+
fitEverything: 'Fit everything'
|
|
54
|
+
},
|
|
55
|
+
waveform: {
|
|
56
|
+
position: '{{time}} of {{duration}}'
|
|
57
|
+
},
|
|
58
|
+
projectSwitcher: {
|
|
59
|
+
label: 'Projects',
|
|
60
|
+
recent: 'Recent projects',
|
|
61
|
+
actionsFor: 'Actions for {{name}}'
|
|
62
|
+
},
|
|
63
|
+
tabs: {
|
|
64
|
+
more: 'More',
|
|
65
|
+
close: 'Close tab'
|
|
66
|
+
},
|
|
67
|
+
tree: {
|
|
68
|
+
label: 'Files',
|
|
69
|
+
expand: 'Expand',
|
|
70
|
+
collapse: 'Collapse'
|
|
71
|
+
},
|
|
72
|
+
workspace: {
|
|
73
|
+
tabs: 'Open views',
|
|
74
|
+
unsaved: 'Unsaved changes',
|
|
75
|
+
closeTab: 'Close {{name}}',
|
|
76
|
+
resize: 'Resize panels',
|
|
77
|
+
pane: 'Panel',
|
|
78
|
+
movePane: 'Move panel',
|
|
79
|
+
maximize: 'Maximize panel',
|
|
80
|
+
restore: 'Restore panels'
|
|
81
|
+
}
|
|
82
|
+
};
|