@adecore/ui 0.35.5 → 0.36.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/Button.d.ts +2 -3
- package/dist/Button.js +21 -46
- package/dist/Checkbox.js +1 -1
- package/dist/ChoiceCards.js +2 -2
- package/dist/IconPicker.d.ts +2 -1
- package/dist/IconPicker.js +504 -217
- package/dist/Input.d.ts +5 -3
- package/dist/Input.js +127 -112
- package/dist/Segmented.js +1 -1
- package/dist/SplitButton.d.ts +17 -0
- package/dist/SplitButton.js +237 -0
- package/dist/Stepper.js +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Tile.js +2 -2
- package/dist/button-class.d.ts +6 -0
- package/dist/button-class.js +92 -0
- package/dist/file-tree/empty-lines.d.ts +11 -0
- package/dist/file-tree/empty-lines.js +89 -0
- package/dist/file-tree/highlight.d.ts +4 -0
- package/dist/file-tree/highlight.js +75 -0
- package/dist/file-tree/parts.d.ts +9 -1
- package/dist/file-tree/parts.js +297 -205
- package/dist/file-tree/style.js +13 -0
- package/dist/file-tree/use-empty-lines.d.ts +3 -0
- package/dist/file-tree/use-empty-lines.js +176 -0
- package/dist/file-tree/use-file-tree.js +5 -1
- package/dist/file-tree/use-slots.d.ts +16 -2
- package/dist/file-tree/use-slots.js +186 -43
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/locales/en.d.ts +1 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/nl.d.ts +1 -0
- package/dist/locales/nl.js +1 -0
- package/dist/select-shared.d.ts +1 -1
- package/dist/select-shared.js +1 -1
- package/dist/settings/SettingsDialog.js +1 -1
- package/dist/theme.css +33 -3
- package/package.json +1 -1
- package/src/Button.tsx +3 -36
- package/src/Checkbox.tsx +1 -1
- package/src/ChoiceCards.tsx +2 -2
- package/src/IconPicker.tsx +220 -136
- package/src/Input.tsx +19 -10
- package/src/Segmented.tsx +1 -1
- package/src/SplitButton.tsx +72 -0
- package/src/Stepper.tsx +6 -1
- package/src/Switch.tsx +1 -1
- package/src/Tile.tsx +2 -2
- package/src/button-class.ts +111 -0
- package/src/file-tree/empty-lines.ts +105 -0
- package/src/file-tree/highlight.ts +80 -0
- package/src/file-tree/parts.tsx +42 -11
- package/src/file-tree/style.ts +13 -0
- package/src/file-tree/use-empty-lines.ts +115 -0
- package/src/file-tree/use-file-tree.ts +2 -1
- package/src/file-tree/use-slots.ts +176 -17
- package/src/index.ts +1 -0
- package/src/locales/en.ts +1 -0
- package/src/locales/nl.ts +1 -0
- package/src/select-shared.ts +2 -1
- package/src/settings/SettingsDialog.tsx +1 -1
- package/src/theme.css +33 -3
package/dist/file-tree/parts.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { useRender } from '@base-ui/react/use-render';
|
|
5
5
|
import { FileTree as PierreFileTree } from '@pierre/trees/react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
+
import { Icon } from "../Icon.js";
|
|
8
9
|
import { mergeRefs } from '../merge-refs.js';
|
|
9
10
|
import { directoryHandle, extendsSelection, followFocus, movesFocus, menuTargetsOf, rowPathOf, visibleRows } from './helpers.js';
|
|
11
|
+
import { useEmptyLines } from './use-empty-lines.js';
|
|
10
12
|
import { useFileTreeShift } from "./use-file-tree-shift.js";
|
|
11
13
|
import { useFileTreeSlots } from './use-slots.js';
|
|
12
14
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -14,9 +16,10 @@ function inSlot(event) {
|
|
|
14
16
|
return event.composedPath().some(node => node instanceof HTMLElement && node.hasAttribute('data-tree-slot'));
|
|
15
17
|
}
|
|
16
18
|
export function FileTreeRoot(t0) {
|
|
17
|
-
const $ = _c(
|
|
19
|
+
const $ = _c(104);
|
|
18
20
|
let children;
|
|
19
21
|
let className;
|
|
22
|
+
let emptyLabel;
|
|
20
23
|
let label;
|
|
21
24
|
let model;
|
|
22
25
|
let onActivate;
|
|
@@ -33,7 +36,12 @@ export function FileTreeRoot(t0) {
|
|
|
33
36
|
let renderControl;
|
|
34
37
|
let renderDecoration;
|
|
35
38
|
let resetKey;
|
|
39
|
+
let rowIcon;
|
|
40
|
+
let style;
|
|
36
41
|
let t1;
|
|
42
|
+
let t2;
|
|
43
|
+
let t3;
|
|
44
|
+
let t4;
|
|
37
45
|
let treeProps;
|
|
38
46
|
if ($[0] !== t0) {
|
|
39
47
|
({
|
|
@@ -49,6 +57,11 @@ export function FileTreeRoot(t0) {
|
|
|
49
57
|
onRowDragStart,
|
|
50
58
|
renderControl,
|
|
51
59
|
renderDecoration,
|
|
60
|
+
decorationOrder: t2,
|
|
61
|
+
rowIcon,
|
|
62
|
+
fitContent: t3,
|
|
63
|
+
highlight: t4,
|
|
64
|
+
emptyLabel,
|
|
52
65
|
treeProps,
|
|
53
66
|
render,
|
|
54
67
|
className,
|
|
@@ -56,52 +69,68 @@ export function FileTreeRoot(t0) {
|
|
|
56
69
|
children,
|
|
57
70
|
onClick,
|
|
58
71
|
onKeyDownCapture,
|
|
72
|
+
style,
|
|
59
73
|
...props
|
|
60
74
|
} = t0);
|
|
61
75
|
$[0] = t0;
|
|
62
76
|
$[1] = children;
|
|
63
77
|
$[2] = className;
|
|
64
|
-
$[3] =
|
|
65
|
-
$[4] =
|
|
66
|
-
$[5] =
|
|
67
|
-
$[6] =
|
|
68
|
-
$[7] =
|
|
69
|
-
$[8] =
|
|
70
|
-
$[9] =
|
|
71
|
-
$[10] =
|
|
72
|
-
$[11] =
|
|
73
|
-
$[12] =
|
|
74
|
-
$[13] =
|
|
75
|
-
$[14] =
|
|
76
|
-
$[15] =
|
|
77
|
-
$[16] =
|
|
78
|
-
$[17] =
|
|
79
|
-
$[18] =
|
|
80
|
-
$[19] =
|
|
81
|
-
$[20] =
|
|
78
|
+
$[3] = emptyLabel;
|
|
79
|
+
$[4] = label;
|
|
80
|
+
$[5] = model;
|
|
81
|
+
$[6] = onActivate;
|
|
82
|
+
$[7] = onClick;
|
|
83
|
+
$[8] = onExpandedPathsChange;
|
|
84
|
+
$[9] = onFocusMove;
|
|
85
|
+
$[10] = onKeyDownCapture;
|
|
86
|
+
$[11] = onLoadChildren;
|
|
87
|
+
$[12] = onRowContextMenu;
|
|
88
|
+
$[13] = onRowDragStart;
|
|
89
|
+
$[14] = props;
|
|
90
|
+
$[15] = ref;
|
|
91
|
+
$[16] = render;
|
|
92
|
+
$[17] = renderControl;
|
|
93
|
+
$[18] = renderDecoration;
|
|
94
|
+
$[19] = resetKey;
|
|
95
|
+
$[20] = rowIcon;
|
|
96
|
+
$[21] = style;
|
|
97
|
+
$[22] = t1;
|
|
98
|
+
$[23] = t2;
|
|
99
|
+
$[24] = t3;
|
|
100
|
+
$[25] = t4;
|
|
101
|
+
$[26] = treeProps;
|
|
82
102
|
} else {
|
|
83
103
|
children = $[1];
|
|
84
104
|
className = $[2];
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
emptyLabel = $[3];
|
|
106
|
+
label = $[4];
|
|
107
|
+
model = $[5];
|
|
108
|
+
onActivate = $[6];
|
|
109
|
+
onClick = $[7];
|
|
110
|
+
onExpandedPathsChange = $[8];
|
|
111
|
+
onFocusMove = $[9];
|
|
112
|
+
onKeyDownCapture = $[10];
|
|
113
|
+
onLoadChildren = $[11];
|
|
114
|
+
onRowContextMenu = $[12];
|
|
115
|
+
onRowDragStart = $[13];
|
|
116
|
+
props = $[14];
|
|
117
|
+
ref = $[15];
|
|
118
|
+
render = $[16];
|
|
119
|
+
renderControl = $[17];
|
|
120
|
+
renderDecoration = $[18];
|
|
121
|
+
resetKey = $[19];
|
|
122
|
+
rowIcon = $[20];
|
|
123
|
+
style = $[21];
|
|
124
|
+
t1 = $[22];
|
|
125
|
+
t2 = $[23];
|
|
126
|
+
t3 = $[24];
|
|
127
|
+
t4 = $[25];
|
|
128
|
+
treeProps = $[26];
|
|
103
129
|
}
|
|
104
130
|
const selectionFollowsFocus = t1 === undefined ? true : t1;
|
|
131
|
+
const decorationOrder = t2 === undefined ? "before-status" : t2;
|
|
132
|
+
const fitContent = t3 === undefined ? false : t3;
|
|
133
|
+
const highlight = t4 === undefined ? "" : t4;
|
|
105
134
|
const {
|
|
106
135
|
t
|
|
107
136
|
} = useTranslation("ui");
|
|
@@ -110,83 +139,120 @@ export function FileTreeRoot(t0) {
|
|
|
110
139
|
attach,
|
|
111
140
|
bar
|
|
112
141
|
} = useFileTreeShift(model, resetKey);
|
|
113
|
-
let
|
|
114
|
-
if ($[
|
|
115
|
-
|
|
142
|
+
let t5;
|
|
143
|
+
if ($[27] !== attach || $[28] !== ref) {
|
|
144
|
+
t5 = node => {
|
|
116
145
|
setFrame(node);
|
|
117
146
|
attach(node);
|
|
118
147
|
mergeRefs(ref)(node);
|
|
119
148
|
};
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
149
|
+
$[27] = attach;
|
|
150
|
+
$[28] = ref;
|
|
151
|
+
$[29] = t5;
|
|
123
152
|
} else {
|
|
124
|
-
|
|
153
|
+
t5 = $[29];
|
|
125
154
|
}
|
|
126
|
-
const frameRef =
|
|
127
|
-
let
|
|
128
|
-
if ($[
|
|
129
|
-
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
155
|
+
const frameRef = t5;
|
|
156
|
+
let t6;
|
|
157
|
+
if ($[30] !== fitContent || $[31] !== model) {
|
|
158
|
+
t6 = listener => fitContent ? model.subscribe(listener) : _temp;
|
|
159
|
+
$[30] = fitContent;
|
|
160
|
+
$[31] = model;
|
|
161
|
+
$[32] = t6;
|
|
133
162
|
} else {
|
|
134
|
-
|
|
163
|
+
t6 = $[32];
|
|
135
164
|
}
|
|
136
|
-
const
|
|
137
|
-
let
|
|
138
|
-
if ($[
|
|
139
|
-
|
|
165
|
+
const subscribeToRows = t6;
|
|
166
|
+
let t7;
|
|
167
|
+
if ($[33] !== model) {
|
|
168
|
+
t7 = () => model.getVisibleCount();
|
|
169
|
+
$[33] = model;
|
|
170
|
+
$[34] = t7;
|
|
171
|
+
} else {
|
|
172
|
+
t7 = $[34];
|
|
173
|
+
}
|
|
174
|
+
const countRows = t7;
|
|
175
|
+
const rowCount = useSyncExternalStore(subscribeToRows, countRows, countRows);
|
|
176
|
+
let t8;
|
|
177
|
+
if ($[35] !== label || $[36] !== t) {
|
|
178
|
+
t8 = label ?? t("tree.label");
|
|
179
|
+
$[35] = label;
|
|
180
|
+
$[36] = t;
|
|
181
|
+
$[37] = t8;
|
|
182
|
+
} else {
|
|
183
|
+
t8 = $[37];
|
|
184
|
+
}
|
|
185
|
+
let t9;
|
|
186
|
+
if ($[38] !== decorationOrder || $[39] !== emptyLabel || $[40] !== highlight || $[41] !== rowIcon) {
|
|
187
|
+
t9 = {
|
|
188
|
+
order: decorationOrder,
|
|
189
|
+
rowIcon,
|
|
190
|
+
highlight,
|
|
191
|
+
emptyLabel
|
|
192
|
+
};
|
|
193
|
+
$[38] = decorationOrder;
|
|
194
|
+
$[39] = emptyLabel;
|
|
195
|
+
$[40] = highlight;
|
|
196
|
+
$[41] = rowIcon;
|
|
197
|
+
$[42] = t9;
|
|
198
|
+
} else {
|
|
199
|
+
t9 = $[42];
|
|
200
|
+
}
|
|
201
|
+
const slots = useFileTreeSlots(model, frame, t8, t9);
|
|
202
|
+
const passEmptyLine = useEmptyLines(model, frame, emptyLabel);
|
|
203
|
+
let t10;
|
|
204
|
+
if ($[43] !== onExpandedPathsChange || $[44] !== onLoadChildren) {
|
|
205
|
+
t10 = {
|
|
140
206
|
onLoadChildren,
|
|
141
207
|
onExpandedPathsChange
|
|
142
208
|
};
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
209
|
+
$[43] = onExpandedPathsChange;
|
|
210
|
+
$[44] = onLoadChildren;
|
|
211
|
+
$[45] = t10;
|
|
146
212
|
} else {
|
|
147
|
-
|
|
213
|
+
t10 = $[45];
|
|
148
214
|
}
|
|
149
|
-
const latestLoads = useRef(
|
|
150
|
-
let
|
|
151
|
-
let
|
|
152
|
-
if ($[
|
|
153
|
-
|
|
215
|
+
const latestLoads = useRef(t10);
|
|
216
|
+
let t11;
|
|
217
|
+
let t12;
|
|
218
|
+
if ($[46] !== onExpandedPathsChange || $[47] !== onLoadChildren) {
|
|
219
|
+
t11 = () => {
|
|
154
220
|
latestLoads.current = {
|
|
155
221
|
onLoadChildren,
|
|
156
222
|
onExpandedPathsChange
|
|
157
223
|
};
|
|
158
224
|
};
|
|
159
|
-
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
225
|
+
t12 = [onLoadChildren, onExpandedPathsChange];
|
|
226
|
+
$[46] = onExpandedPathsChange;
|
|
227
|
+
$[47] = onLoadChildren;
|
|
228
|
+
$[48] = t11;
|
|
229
|
+
$[49] = t12;
|
|
164
230
|
} else {
|
|
165
|
-
|
|
166
|
-
|
|
231
|
+
t11 = $[48];
|
|
232
|
+
t12 = $[49];
|
|
167
233
|
}
|
|
168
|
-
useLayoutEffect(
|
|
234
|
+
useLayoutEffect(t11, t12);
|
|
169
235
|
const cancelFocus = useRef(undefined);
|
|
170
|
-
let
|
|
171
|
-
if ($[
|
|
172
|
-
|
|
173
|
-
$[
|
|
236
|
+
let t13;
|
|
237
|
+
if ($[50] === Symbol.for("react.memo_cache_sentinel")) {
|
|
238
|
+
t13 = () => () => cancelFocus.current?.();
|
|
239
|
+
$[50] = t13;
|
|
174
240
|
} else {
|
|
175
|
-
|
|
241
|
+
t13 = $[50];
|
|
176
242
|
}
|
|
177
|
-
let
|
|
178
|
-
if ($[
|
|
179
|
-
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
243
|
+
let t14;
|
|
244
|
+
if ($[51] !== model) {
|
|
245
|
+
t14 = [model];
|
|
246
|
+
$[51] = model;
|
|
247
|
+
$[52] = t14;
|
|
182
248
|
} else {
|
|
183
|
-
|
|
249
|
+
t14 = $[52];
|
|
184
250
|
}
|
|
185
|
-
useEffect(
|
|
186
|
-
let
|
|
187
|
-
let
|
|
188
|
-
if ($[
|
|
189
|
-
|
|
251
|
+
useEffect(t13, t14);
|
|
252
|
+
let t15;
|
|
253
|
+
let t16;
|
|
254
|
+
if ($[53] !== model) {
|
|
255
|
+
t15 = () => {
|
|
190
256
|
let previous = new Set();
|
|
191
257
|
let disposed = false;
|
|
192
258
|
let pending = false;
|
|
@@ -195,8 +261,8 @@ export function FileTreeRoot(t0) {
|
|
|
195
261
|
if (disposed) {
|
|
196
262
|
return;
|
|
197
263
|
}
|
|
198
|
-
const rows = visibleRows(model).filter(
|
|
199
|
-
const known = new Set(rows.map(
|
|
264
|
+
const rows = visibleRows(model).filter(_temp2);
|
|
265
|
+
const known = new Set(rows.map(_temp3));
|
|
200
266
|
const expanded = new Set([...previous].filter(path => !known.has(path)));
|
|
201
267
|
for (const row_1 of rows) {
|
|
202
268
|
if (row_1.isExpanded) {
|
|
@@ -226,19 +292,19 @@ export function FileTreeRoot(t0) {
|
|
|
226
292
|
unsubscribe();
|
|
227
293
|
};
|
|
228
294
|
};
|
|
229
|
-
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
295
|
+
t16 = [model];
|
|
296
|
+
$[53] = model;
|
|
297
|
+
$[54] = t15;
|
|
298
|
+
$[55] = t16;
|
|
233
299
|
} else {
|
|
234
|
-
|
|
235
|
-
|
|
300
|
+
t15 = $[54];
|
|
301
|
+
t16 = $[55];
|
|
236
302
|
}
|
|
237
|
-
useEffect(
|
|
238
|
-
let
|
|
239
|
-
let
|
|
240
|
-
if ($[
|
|
241
|
-
|
|
303
|
+
useEffect(t15, t16);
|
|
304
|
+
let t17;
|
|
305
|
+
let t18;
|
|
306
|
+
if ($[56] !== frame || $[57] !== model || $[58] !== onActivate || $[59] !== onFocusMove || $[60] !== onRowContextMenu || $[61] !== onRowDragStart || $[62] !== passEmptyLine || $[63] !== selectionFollowsFocus) {
|
|
307
|
+
t17 = () => {
|
|
242
308
|
if (frame === null) {
|
|
243
309
|
return;
|
|
244
310
|
}
|
|
@@ -260,20 +326,20 @@ export function FileTreeRoot(t0) {
|
|
|
260
326
|
if (movesFocus(event_0) && selectionFollowsFocus) {
|
|
261
327
|
cancelFocus.current?.();
|
|
262
328
|
cancelFocus.current = followFocus(model, onFocusMove);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
329
|
+
}
|
|
330
|
+
passEmptyLine(event_0);
|
|
331
|
+
if (event_0.key === "Enter" && !event_0.altKey && !event_0.metaKey && !event_0.ctrlKey) {
|
|
332
|
+
const path_4 = model.getFocusedPath();
|
|
333
|
+
if (path_4 === null) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
event_0.preventDefault();
|
|
337
|
+
event_0.stopPropagation();
|
|
338
|
+
const directory = directoryHandle(model, path_4);
|
|
339
|
+
if (directory) {
|
|
340
|
+
directory.toggle();
|
|
341
|
+
} else {
|
|
342
|
+
onActivate?.(path_4);
|
|
277
343
|
}
|
|
278
344
|
}
|
|
279
345
|
};
|
|
@@ -301,134 +367,160 @@ export function FileTreeRoot(t0) {
|
|
|
301
367
|
frame.removeEventListener("dragstart", onDrag);
|
|
302
368
|
};
|
|
303
369
|
};
|
|
304
|
-
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
$[
|
|
370
|
+
t18 = [frame, model, selectionFollowsFocus, passEmptyLine, onActivate, onFocusMove, onRowContextMenu, onRowDragStart];
|
|
371
|
+
$[56] = frame;
|
|
372
|
+
$[57] = model;
|
|
373
|
+
$[58] = onActivate;
|
|
374
|
+
$[59] = onFocusMove;
|
|
375
|
+
$[60] = onRowContextMenu;
|
|
376
|
+
$[61] = onRowDragStart;
|
|
377
|
+
$[62] = passEmptyLine;
|
|
378
|
+
$[63] = selectionFollowsFocus;
|
|
379
|
+
$[64] = t17;
|
|
380
|
+
$[65] = t18;
|
|
314
381
|
} else {
|
|
315
|
-
|
|
316
|
-
|
|
382
|
+
t17 = $[64];
|
|
383
|
+
t18 = $[65];
|
|
317
384
|
}
|
|
318
|
-
useEffect(
|
|
319
|
-
let
|
|
320
|
-
if ($[
|
|
321
|
-
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
385
|
+
useEffect(t17, t18);
|
|
386
|
+
let t19;
|
|
387
|
+
if ($[66] !== className) {
|
|
388
|
+
t19 = clsx("adecore-tree adecore-file-tree", className);
|
|
389
|
+
$[66] = className;
|
|
390
|
+
$[67] = t19;
|
|
324
391
|
} else {
|
|
325
|
-
|
|
392
|
+
t19 = $[67];
|
|
326
393
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
394
|
+
let t20;
|
|
395
|
+
if ($[68] !== fitContent || $[69] !== model || $[70] !== rowCount || $[71] !== style) {
|
|
396
|
+
t20 = fitContent ? {
|
|
397
|
+
...style,
|
|
398
|
+
height: rowCount * model.getItemHeight(),
|
|
399
|
+
maxHeight: "100%"
|
|
400
|
+
} : style;
|
|
401
|
+
$[68] = fitContent;
|
|
402
|
+
$[69] = model;
|
|
403
|
+
$[70] = rowCount;
|
|
404
|
+
$[71] = style;
|
|
405
|
+
$[72] = t20;
|
|
333
406
|
} else {
|
|
334
|
-
|
|
407
|
+
t20 = $[72];
|
|
335
408
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
409
|
+
const t21 = treeProps?.className;
|
|
410
|
+
let t22;
|
|
411
|
+
if ($[73] !== t21) {
|
|
412
|
+
t22 = clsx("adecore-file-tree-host", t21);
|
|
413
|
+
$[73] = t21;
|
|
414
|
+
$[74] = t22;
|
|
415
|
+
} else {
|
|
416
|
+
t22 = $[74];
|
|
417
|
+
}
|
|
418
|
+
let t23;
|
|
419
|
+
if ($[75] !== model || $[76] !== t22 || $[77] !== treeProps) {
|
|
420
|
+
t23 = /*#__PURE__*/_jsx(PierreFileTree, {
|
|
339
421
|
...treeProps,
|
|
340
422
|
model: model,
|
|
341
|
-
className:
|
|
423
|
+
className: t22
|
|
342
424
|
});
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
425
|
+
$[75] = model;
|
|
426
|
+
$[76] = t22;
|
|
427
|
+
$[77] = treeProps;
|
|
428
|
+
$[78] = t23;
|
|
347
429
|
} else {
|
|
348
|
-
|
|
430
|
+
t23 = $[78];
|
|
349
431
|
}
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
let
|
|
353
|
-
if ($[
|
|
354
|
-
|
|
432
|
+
let t24;
|
|
433
|
+
if ($[79] !== renderControl || $[80] !== renderDecoration || $[81] !== rowIcon || $[82] !== slots) {
|
|
434
|
+
let t25;
|
|
435
|
+
if ($[84] !== renderControl || $[85] !== renderDecoration || $[86] !== rowIcon) {
|
|
436
|
+
t25 = t26 => {
|
|
355
437
|
const {
|
|
356
438
|
row: row_2,
|
|
357
439
|
control,
|
|
358
|
-
decoration
|
|
359
|
-
|
|
440
|
+
decoration,
|
|
441
|
+
icon
|
|
442
|
+
} = t26;
|
|
443
|
+
const ownIcon = icon === null ? undefined : rowIcon?.(row_2);
|
|
360
444
|
return /*#__PURE__*/_jsxs("span", {
|
|
361
445
|
style: {
|
|
362
446
|
display: "contents"
|
|
363
447
|
},
|
|
364
|
-
children: [createPortal(renderControl?.(row_2), control), createPortal(renderDecoration?.(row_2), decoration)
|
|
448
|
+
children: [createPortal(renderControl?.(row_2), control), createPortal(renderDecoration?.(row_2), decoration), icon !== null && ownIcon !== undefined && createPortal(/*#__PURE__*/_jsx(Icon, {
|
|
449
|
+
icon: ownIcon,
|
|
450
|
+
size: 14
|
|
451
|
+
}), icon)]
|
|
365
452
|
}, control.slot);
|
|
366
453
|
};
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
454
|
+
$[84] = renderControl;
|
|
455
|
+
$[85] = renderDecoration;
|
|
456
|
+
$[86] = rowIcon;
|
|
457
|
+
$[87] = t25;
|
|
370
458
|
} else {
|
|
371
|
-
|
|
459
|
+
t25 = $[87];
|
|
372
460
|
}
|
|
373
|
-
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
461
|
+
t24 = slots.map(t25);
|
|
462
|
+
$[79] = renderControl;
|
|
463
|
+
$[80] = renderDecoration;
|
|
464
|
+
$[81] = rowIcon;
|
|
465
|
+
$[82] = slots;
|
|
466
|
+
$[83] = t24;
|
|
378
467
|
} else {
|
|
379
|
-
|
|
468
|
+
t24 = $[83];
|
|
380
469
|
}
|
|
381
|
-
let
|
|
382
|
-
if ($[
|
|
383
|
-
|
|
384
|
-
children: [
|
|
470
|
+
let t25;
|
|
471
|
+
if ($[88] !== bar || $[89] !== children || $[90] !== t23 || $[91] !== t24) {
|
|
472
|
+
t25 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
473
|
+
children: [t23, t24, children, bar]
|
|
385
474
|
});
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
475
|
+
$[88] = bar;
|
|
476
|
+
$[89] = children;
|
|
477
|
+
$[90] = t23;
|
|
478
|
+
$[91] = t24;
|
|
479
|
+
$[92] = t25;
|
|
391
480
|
} else {
|
|
392
|
-
|
|
481
|
+
t25 = $[92];
|
|
393
482
|
}
|
|
394
|
-
let
|
|
395
|
-
if ($[
|
|
396
|
-
|
|
483
|
+
let t26;
|
|
484
|
+
if ($[93] !== onClick || $[94] !== onKeyDownCapture || $[95] !== props || $[96] !== t19 || $[97] !== t20 || $[98] !== t25) {
|
|
485
|
+
t26 = {
|
|
397
486
|
...props,
|
|
398
|
-
className:
|
|
487
|
+
className: t19,
|
|
488
|
+
style: t20,
|
|
399
489
|
onClick,
|
|
400
490
|
onKeyDownCapture,
|
|
401
|
-
children:
|
|
491
|
+
children: t25
|
|
402
492
|
};
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
493
|
+
$[93] = onClick;
|
|
494
|
+
$[94] = onKeyDownCapture;
|
|
495
|
+
$[95] = props;
|
|
496
|
+
$[96] = t19;
|
|
497
|
+
$[97] = t20;
|
|
498
|
+
$[98] = t25;
|
|
499
|
+
$[99] = t26;
|
|
409
500
|
} else {
|
|
410
|
-
|
|
501
|
+
t26 = $[99];
|
|
411
502
|
}
|
|
412
|
-
let
|
|
413
|
-
if ($[
|
|
414
|
-
|
|
503
|
+
let t27;
|
|
504
|
+
if ($[100] !== frameRef || $[101] !== render || $[102] !== t26) {
|
|
505
|
+
t27 = {
|
|
415
506
|
render,
|
|
416
507
|
ref: frameRef,
|
|
417
508
|
defaultTagName: "div",
|
|
418
|
-
props:
|
|
509
|
+
props: t26
|
|
419
510
|
};
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
511
|
+
$[100] = frameRef;
|
|
512
|
+
$[101] = render;
|
|
513
|
+
$[102] = t26;
|
|
514
|
+
$[103] = t27;
|
|
424
515
|
} else {
|
|
425
|
-
|
|
516
|
+
t27 = $[103];
|
|
426
517
|
}
|
|
427
|
-
return useRender(
|
|
518
|
+
return useRender(t27);
|
|
428
519
|
}
|
|
429
|
-
function
|
|
520
|
+
function _temp3(row_0) {
|
|
430
521
|
return row_0.path;
|
|
431
522
|
}
|
|
432
|
-
function
|
|
523
|
+
function _temp2(row) {
|
|
433
524
|
return row.kind === "directory";
|
|
434
|
-
}
|
|
525
|
+
}
|
|
526
|
+
function _temp() {}
|
package/dist/file-tree/style.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { treeRowStyle } from '../tree/style.js';
|
|
2
|
+
import { MATCH_HIGHLIGHT } from './highlight.js';
|
|
2
3
|
// beta.6 splits the extension into nested grids; flatten them to truncate the end of the entire name.
|
|
3
4
|
export const FILE_TREE_CSS = `
|
|
4
5
|
${treeRowStyle('[data-type="item"]', 'data-item-selected')}
|
|
@@ -19,6 +20,18 @@ export const FILE_TREE_CSS = `
|
|
|
19
20
|
[data-item-section="content"] :where([data-truncate-group-container], [data-truncate-group-container] div, [data-truncate-container], [data-truncate-container] div) { display: inline; }
|
|
20
21
|
[data-item-section="content"] [data-truncate-content] { direction: ltr; }
|
|
21
22
|
[data-item-section="content"] :where([data-truncate-content="overflow"], [data-truncate-marker-cell], [data-truncate-fill]) { display: none; }
|
|
23
|
+
[data-item-section="git"] { margin-inline-end: var(--adecore-tree-status-space, 0px); }
|
|
24
|
+
::highlight(${MATCH_HIGHLIGHT}) { background-color: var(--match); color: inherit; }
|
|
22
25
|
[data-tree-port] { position: absolute; z-index: 4; display: flex; align-items: center; height: 25px; pointer-events: none; }
|
|
23
26
|
[data-tree-port] > slot { pointer-events: auto; }
|
|
27
|
+
[data-tree-port="icon"] { width: 16px; justify-content: center; }
|
|
28
|
+
[data-tree-port="icon"] > slot { pointer-events: none; }
|
|
29
|
+
[data-own-icon="true"] [data-item-section="icon"] > * { visibility: hidden; }
|
|
30
|
+
[data-own-icon="true"][data-item-type="folder"]:hover [data-item-section="icon"] > * { visibility: visible; }
|
|
31
|
+
[data-tree-port="icon"][data-hover="true"] { visibility: hidden; }
|
|
32
|
+
[data-empty-line="true"] { cursor: default; }
|
|
33
|
+
[data-empty-line="true"] :is([data-item-section="icon"], [data-item-section="git"]) { display: none; }
|
|
34
|
+
[data-empty-line="true"] [data-item-section="content"] { overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
|
|
35
|
+
[data-empty-line="true"] [data-item-section="content"] > * { display: none; }
|
|
36
|
+
[data-empty-line="true"] [data-item-section="content"]::before { content: attr(data-empty-label); }
|
|
24
37
|
`;
|