@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/file-icon.js
CHANGED
|
@@ -6,18 +6,20 @@ const SPRITE_ELEMENT_ID = 'adecore-ui-file-icon-sprite';
|
|
|
6
6
|
sprite brings the rules that color it. Everything drawn beside a tree calls `fileIconFor`, so a tab,
|
|
7
7
|
a picker row and a tree row never disagree about what a file is. */
|
|
8
8
|
export const FILE_TREE_ICONS = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
set: 'none',
|
|
10
|
+
spriteSheet: SETI_SPRITE_SHEET,
|
|
11
|
+
remap: {
|
|
12
|
+
'file-tree-icon-file': SETI_DEFAULT_SYMBOL
|
|
13
|
+
},
|
|
14
|
+
byFileName: SETI_BY_FILE_NAME,
|
|
15
|
+
byFileExtension: SETI_BY_FILE_EXTENSION,
|
|
16
|
+
byFileNameContains: SETI_BY_FILE_NAME_CONTAINS
|
|
15
17
|
};
|
|
16
18
|
let resolver = null;
|
|
17
19
|
/* Built on the first icon rather than on import, so a bundle that never draws one never builds it. */
|
|
18
20
|
const resolveIcon = (...args) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
resolver ??= createFileTreeIconResolver(FILE_TREE_ICONS);
|
|
22
|
+
return resolver.resolveIcon(...args);
|
|
21
23
|
};
|
|
22
24
|
/*
|
|
23
25
|
* The id of the `<symbol>` the set gives a file, in the sprite `mountFileIconSprite` puts in the
|
|
@@ -26,19 +28,19 @@ const resolveIcon = (...args) => {
|
|
|
26
28
|
* `ts`). Anything else falls back to the generic file icon, a directory included: the tree marks a
|
|
27
29
|
* folder with its chevron, not a glyph.
|
|
28
30
|
*/
|
|
29
|
-
export const fileIconFor =
|
|
31
|
+
export const fileIconFor = path => resolveIcon('file-tree-icon-file', path).name;
|
|
30
32
|
/* The tree carries the sprite into its own shadow root, out of reach of anything that draws an
|
|
31
33
|
icon next to it, so the document gets a copy of the same sheet to point `<use>` at. */
|
|
32
34
|
export const mountFileIconSprite = () => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
35
|
+
if (document.getElementById(SPRITE_ELEMENT_ID) !== null) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const holder = document.createElement('div');
|
|
39
|
+
holder.innerHTML = SETI_SPRITE_SHEET;
|
|
40
|
+
const sprite = holder.firstElementChild;
|
|
41
|
+
if (sprite === null) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
sprite.id = SPRITE_ELEMENT_ID;
|
|
45
|
+
(document.body ?? document.documentElement).append(sprite);
|
|
46
|
+
};
|
|
@@ -2,175 +2,189 @@ import { nameOrder } from '../format/locale.js';
|
|
|
2
2
|
// Expanded folders can reveal more flattened rows; cap custom-key cycles.
|
|
3
3
|
const EXPANSION_PASSES = 32;
|
|
4
4
|
export function directoryHandle(model, path) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const item = model.getItem(path);
|
|
6
|
+
return item?.isDirectory() ? item : null;
|
|
7
7
|
}
|
|
8
8
|
export function pathOfRow(row) {
|
|
9
|
-
|
|
9
|
+
return row.isFlattened ? row.flattenedSegments?.findLast(segment => segment.isTerminal)?.path ?? row.path : row.path;
|
|
10
10
|
}
|
|
11
11
|
export function visibleRows(model) {
|
|
12
|
-
|
|
12
|
+
return model.getVisibleRows(0, model.getVisibleCount()).map(row => ({
|
|
13
|
+
...row,
|
|
14
|
+
path: pathOfRow(row)
|
|
15
|
+
}));
|
|
13
16
|
}
|
|
14
17
|
/* The `count` rows from `start` and one on each side, for a neighbor's selection, without copying the whole list. */
|
|
15
18
|
export function visibleRowsAround(model, start, count) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const first = Math.max(0, start - 1);
|
|
20
|
+
const last = Math.min(model.getVisibleCount() - 1, start + count);
|
|
21
|
+
if (last < first) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
return model.getVisibleRows(first, last).map(row => ({
|
|
25
|
+
...row,
|
|
26
|
+
path: pathOfRow(row)
|
|
27
|
+
}));
|
|
22
28
|
}
|
|
23
29
|
export function applyExpansion(model, collapsed, keyOf) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
for (let pass = 0; pass < EXPANSION_PASSES; pass++) {
|
|
31
|
+
const {
|
|
32
|
+
collapse,
|
|
33
|
+
expand
|
|
34
|
+
} = expansionChanges(visibleRows(model), collapsed, keyOf);
|
|
35
|
+
if (collapse.length === 0 && expand.length === 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
for (const path of collapse) {
|
|
39
|
+
directoryHandle(model, path)?.collapse();
|
|
40
|
+
}
|
|
41
|
+
for (const path of expand) {
|
|
42
|
+
directoryHandle(model, path)?.expand();
|
|
35
43
|
}
|
|
44
|
+
}
|
|
36
45
|
}
|
|
37
46
|
export function resetExpandedPaths(model, paths, expanded) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
model.resetPaths(paths, {
|
|
48
|
+
initialExpandedPaths: [...expanded]
|
|
49
|
+
});
|
|
50
|
+
// @pierre/trees beta.6 restores expansion with its default sort, so custom sorting needs a second pass.
|
|
51
|
+
for (const path of expanded) {
|
|
52
|
+
directoryHandle(model, path)?.expand();
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
55
|
export function rowPathOf(event) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
56
|
+
for (const node of event.nativeEvent.composedPath()) {
|
|
57
|
+
const path = node instanceof HTMLElement ? node.dataset.itemPath : undefined;
|
|
58
|
+
if (path) {
|
|
59
|
+
return path;
|
|
50
60
|
}
|
|
51
|
-
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
52
63
|
}
|
|
53
64
|
export function menuTargetsOf(row, selected) {
|
|
54
|
-
|
|
65
|
+
return selected.includes(row) && selected.length > 1 ? [...selected] : [row];
|
|
55
66
|
}
|
|
56
67
|
export function extendsSelection(event) {
|
|
57
|
-
|
|
68
|
+
return event.shiftKey || event.metaKey || event.ctrlKey;
|
|
58
69
|
}
|
|
59
70
|
const FOCUS_KEYS = new Set(['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End']);
|
|
60
71
|
export function movesFocus(event) {
|
|
61
|
-
|
|
72
|
+
return FOCUS_KEYS.has(event.key) && !event.shiftKey && !event.metaKey && !event.ctrlKey && !event.altKey;
|
|
62
73
|
}
|
|
63
74
|
export function selectOnly(model, path) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const item = path === null ? null : model.getItem(path);
|
|
70
|
-
if (item && !item.isSelected()) {
|
|
71
|
-
item.select();
|
|
75
|
+
for (const selected of model.getSelectedPaths()) {
|
|
76
|
+
if (selected !== path) {
|
|
77
|
+
model.getItem(selected)?.deselect();
|
|
72
78
|
}
|
|
79
|
+
}
|
|
80
|
+
const item = path === null ? null : model.getItem(path);
|
|
81
|
+
if (item && !item.isSelected()) {
|
|
82
|
+
item.select();
|
|
83
|
+
}
|
|
73
84
|
}
|
|
74
85
|
export function followFocus(model, onMoved) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
const from = model.getFocusedPath();
|
|
87
|
+
const timer = window.setTimeout(() => {
|
|
88
|
+
const path = model.getFocusedPath();
|
|
89
|
+
selectOnly(model, path);
|
|
90
|
+
if (path !== null && path !== from) {
|
|
91
|
+
onMoved?.(path);
|
|
92
|
+
}
|
|
93
|
+
}, 0);
|
|
94
|
+
return () => window.clearTimeout(timer);
|
|
84
95
|
}
|
|
85
96
|
export function focusRow(model, path) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
97
|
+
const selector = `[data-type="item"][data-item-path="${CSS.escape(path)}"]:not([data-item-parked="true"])`;
|
|
98
|
+
const row = model.getFileTreeContainer()?.shadowRoot?.querySelector(selector) ?? null;
|
|
99
|
+
row?.focus();
|
|
100
|
+
return row !== null;
|
|
90
101
|
}
|
|
91
102
|
export function ancestorDirsOf(treePath) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
const segments = treePath.split('/').filter(segment => segment !== '');
|
|
104
|
+
segments.pop();
|
|
105
|
+
const dirs = [];
|
|
106
|
+
let prefix = '';
|
|
107
|
+
for (const segment of segments) {
|
|
108
|
+
prefix = `${prefix}${segment}/`;
|
|
109
|
+
dirs.push(prefix);
|
|
110
|
+
}
|
|
111
|
+
return dirs;
|
|
101
112
|
}
|
|
102
113
|
export function withoutClosedBranches(open, known) {
|
|
103
|
-
|
|
114
|
+
return new Set([...open].filter(path => ancestorDirsOf(path).every(dir => open.has(dir) || !known.has(dir))));
|
|
104
115
|
}
|
|
105
116
|
export function newlyExpanded(before, after) {
|
|
106
|
-
|
|
117
|
+
return [...after].filter(path => !before.has(path));
|
|
107
118
|
}
|
|
108
119
|
export function mergeExpanded(remembered, reported, known) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
120
|
+
const merged = new Set(reported);
|
|
121
|
+
for (const path of remembered) {
|
|
122
|
+
if (!known.has(path)) {
|
|
123
|
+
merged.add(path);
|
|
114
124
|
}
|
|
115
|
-
|
|
125
|
+
}
|
|
126
|
+
return merged;
|
|
116
127
|
}
|
|
117
128
|
export function compareRows(left, right) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
return nameOrder(leftSegment, rightSegment);
|
|
129
|
+
const shared = Math.min(left.segments.length, right.segments.length);
|
|
130
|
+
for (let i = 0; i < shared; i++) {
|
|
131
|
+
const leftSegment = left.segments[i];
|
|
132
|
+
const rightSegment = right.segments[i];
|
|
133
|
+
if (leftSegment === rightSegment) {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const leftIsDirectory = left.isDirectory || i < left.segments.length - 1;
|
|
137
|
+
const rightIsDirectory = right.isDirectory || i < right.segments.length - 1;
|
|
138
|
+
if (leftIsDirectory !== rightIsDirectory) {
|
|
139
|
+
return leftIsDirectory ? -1 : 1;
|
|
131
140
|
}
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
return nameOrder(leftSegment, rightSegment);
|
|
142
|
+
}
|
|
143
|
+
// One path is the head of the other, so the shorter one is the directory the longer one sits in.
|
|
144
|
+
return left.segments.length - right.segments.length;
|
|
134
145
|
}
|
|
135
146
|
export function dirPathOf(rowPath) {
|
|
136
|
-
|
|
147
|
+
return rowPath.endsWith('/') ? rowPath.slice(0, -1) : rowPath;
|
|
137
148
|
}
|
|
138
149
|
function plainKey(rowPath) {
|
|
139
|
-
|
|
150
|
+
return dirPathOf(rowPath);
|
|
140
151
|
}
|
|
141
152
|
export function collapsedPathsOf(rows, keyOf = plainKey) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
153
|
+
return rows.flatMap(row => {
|
|
154
|
+
const key = row.kind === 'directory' && !row.isExpanded ? keyOf(row.path) : null;
|
|
155
|
+
return key === null ? [] : [key];
|
|
156
|
+
});
|
|
146
157
|
}
|
|
147
158
|
export function mergeCollapsedPaths(current, rows, keyOf = plainKey) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
159
|
+
const known = new Set(rows.flatMap(row => row.kind === 'directory' ? [keyOf(row.path)] : []));
|
|
160
|
+
const folded = new Set(collapsedPathsOf(rows, keyOf));
|
|
161
|
+
const next = current.filter(dir => !known.has(dir) || folded.has(dir));
|
|
162
|
+
const existing = new Set(current);
|
|
163
|
+
for (const dir of folded) {
|
|
164
|
+
if (!existing.has(dir)) {
|
|
165
|
+
next.push(dir);
|
|
156
166
|
}
|
|
157
|
-
|
|
158
|
-
|
|
167
|
+
}
|
|
168
|
+
// Selection also notifies subscribers; unchanged folds must not restart the shared-state cycle.
|
|
169
|
+
return next.length === current.length && next.every((dir, index) => dir === current[index]) ? current : next;
|
|
159
170
|
}
|
|
160
171
|
export function expansionChanges(rows, collapsed, keyOf = plainKey) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
changes.collapse.push(row.path);
|
|
170
|
-
}
|
|
171
|
-
if (!folded && !row.isExpanded) {
|
|
172
|
-
changes.expand.push(row.path);
|
|
173
|
-
}
|
|
172
|
+
const changes = {
|
|
173
|
+
collapse: [],
|
|
174
|
+
expand: []
|
|
175
|
+
};
|
|
176
|
+
for (const row of rows) {
|
|
177
|
+
const key = row.kind === 'directory' ? keyOf(row.path) : null;
|
|
178
|
+
if (key === null) {
|
|
179
|
+
continue;
|
|
174
180
|
}
|
|
175
|
-
|
|
176
|
-
|
|
181
|
+
const folded = collapsed.has(key);
|
|
182
|
+
if (folded && row.isExpanded) {
|
|
183
|
+
changes.collapse.push(row.path);
|
|
184
|
+
}
|
|
185
|
+
if (!folded && !row.isExpanded) {
|
|
186
|
+
changes.expand.push(row.path);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return changes;
|
|
190
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FileTreeRoot as Root } from
|
|
2
|
-
export { TreeCheckbox as Checkbox, TreeControl as Control, TreeDecoration as Decoration } from
|
|
3
|
-
export { ancestorDirsOf, applyExpansion, collapsedPathsOf, compareRows, directoryHandle, dirPathOf, expansionChanges, extendsSelection, focusRow, followFocus, menuTargetsOf, mergeCollapsedPaths, mergeExpanded, movesFocus, newlyExpanded, pathOfRow, resetExpandedPaths, rowPathOf, selectOnly, visibleRows, withoutClosedBranches } from './helpers.js';
|
|
1
|
+
export { FileTreeRoot as Root } from "./parts.js";
|
|
2
|
+
export { TreeCheckbox as Checkbox, TreeControl as Control, TreeDecoration as Decoration } from "../tree/parts.js";
|
|
3
|
+
export { ancestorDirsOf, applyExpansion, collapsedPathsOf, compareRows, directoryHandle, dirPathOf, expansionChanges, extendsSelection, focusRow, followFocus, menuTargetsOf, mergeCollapsedPaths, mergeExpanded, movesFocus, newlyExpanded, pathOfRow, resetExpandedPaths, rowPathOf, selectOnly, visibleRows, withoutClosedBranches } from './helpers.js';
|