@adecore/ui 0.50.1 → 0.50.3
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.
|
@@ -80,9 +80,28 @@ export function CommandPaletteVirtualList({
|
|
|
80
80
|
}
|
|
81
81
|
const highlight = (index_0, reason) => {
|
|
82
82
|
const row = itemRows[index_0];
|
|
83
|
-
if (row
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
if (row === undefined || reason === 'pointer') {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// The first item of a group brings its label along, so the list never opens on half a label.
|
|
87
|
+
const label = row > 0 && rows[row - 1].index === -1 ? row - 1 : null;
|
|
88
|
+
if (reason === 'none') {
|
|
89
|
+
const target = label ?? row;
|
|
90
|
+
if (target === 0) {
|
|
91
|
+
virtualizer.scrollToOffset(0);
|
|
92
|
+
} else {
|
|
93
|
+
virtualizer.scrollToIndex(target, {
|
|
94
|
+
align: 'start'
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
virtualizer.scrollToIndex(row, {
|
|
100
|
+
align: 'auto'
|
|
101
|
+
});
|
|
102
|
+
if (label !== null) {
|
|
103
|
+
virtualizer.scrollToIndex(label, {
|
|
104
|
+
align: 'auto'
|
|
86
105
|
});
|
|
87
106
|
}
|
|
88
107
|
};
|
|
@@ -92,7 +111,7 @@ export function CommandPaletteVirtualList({
|
|
|
92
111
|
scroll.current = null;
|
|
93
112
|
}
|
|
94
113
|
};
|
|
95
|
-
}, [scroll, virtualizer, itemRows]);
|
|
114
|
+
}, [scroll, virtualizer, itemRows, rows]);
|
|
96
115
|
const visible = virtualizer.getVirtualItems();
|
|
97
116
|
const visibleGroups = new Map();
|
|
98
117
|
for (const item of visible) {
|
package/dist/theme.css
CHANGED
|
@@ -842,7 +842,8 @@
|
|
|
842
842
|
min-width: 0;
|
|
843
843
|
min-height: 0;
|
|
844
844
|
overflow: hidden;
|
|
845
|
-
|
|
845
|
+
/* Rounded where it meets the window's top, square where it stands on the window's bottom. */
|
|
846
|
+
border-radius: 0 12px 0 0;
|
|
846
847
|
/* The surface its regions draw, so no lighter ground shows where the rounded edge cuts them. Roomy shows its gaps in it. */
|
|
847
848
|
background: var(--surface);
|
|
848
849
|
box-shadow: 0 0 0 1px var(--border), var(--sheet-shadow);
|
|
@@ -881,6 +882,8 @@
|
|
|
881
882
|
.ade-workspace-sidebar[data-auto], .ade-workspace-side-panel[data-auto] { display: contents; }
|
|
882
883
|
.ade-workspace[data-layout="roomy"],
|
|
883
884
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { background: var(--separator); }
|
|
885
|
+
/* The gaps already set the sheet apart, and a shadow over them reads as a smudge. */
|
|
886
|
+
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { box-shadow: 0 0 0 1px var(--border); }
|
|
884
887
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-center { gap: 8px; }
|
|
885
888
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-sidebar:not([data-auto]) { margin-right: 8px; }
|
|
886
889
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-side-panel:not([data-auto]) { margin-left: 8px; }
|
package/package.json
CHANGED
|
@@ -90,8 +90,29 @@ export function CommandPaletteVirtualList<ItemValue, Group extends { items: read
|
|
|
90
90
|
const highlight = (index: number, reason: string): void => {
|
|
91
91
|
const row = itemRows[index];
|
|
92
92
|
|
|
93
|
-
if (row
|
|
94
|
-
|
|
93
|
+
if (row === undefined || reason === 'pointer') {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// The first item of a group brings its label along, so the list never opens on half a label.
|
|
98
|
+
const label = row > 0 && rows[row - 1]!.index === -1 ? row - 1 : null;
|
|
99
|
+
|
|
100
|
+
if (reason === 'none') {
|
|
101
|
+
const target = label ?? row;
|
|
102
|
+
|
|
103
|
+
if (target === 0) {
|
|
104
|
+
virtualizer.scrollToOffset(0);
|
|
105
|
+
} else {
|
|
106
|
+
virtualizer.scrollToIndex(target, { align: 'start' });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
virtualizer.scrollToIndex(row, { align: 'auto' });
|
|
113
|
+
|
|
114
|
+
if (label !== null) {
|
|
115
|
+
virtualizer.scrollToIndex(label, { align: 'auto' });
|
|
95
116
|
}
|
|
96
117
|
};
|
|
97
118
|
|
|
@@ -102,7 +123,7 @@ export function CommandPaletteVirtualList<ItemValue, Group extends { items: read
|
|
|
102
123
|
scroll.current = null;
|
|
103
124
|
}
|
|
104
125
|
};
|
|
105
|
-
}, [scroll, virtualizer, itemRows]);
|
|
126
|
+
}, [scroll, virtualizer, itemRows, rows]);
|
|
106
127
|
|
|
107
128
|
const visible = virtualizer.getVirtualItems();
|
|
108
129
|
const visibleGroups = new Map<number, typeof visible>();
|
package/src/theme.css
CHANGED
|
@@ -842,7 +842,8 @@
|
|
|
842
842
|
min-width: 0;
|
|
843
843
|
min-height: 0;
|
|
844
844
|
overflow: hidden;
|
|
845
|
-
|
|
845
|
+
/* Rounded where it meets the window's top, square where it stands on the window's bottom. */
|
|
846
|
+
border-radius: 0 12px 0 0;
|
|
846
847
|
/* The surface its regions draw, so no lighter ground shows where the rounded edge cuts them. Roomy shows its gaps in it. */
|
|
847
848
|
background: var(--surface);
|
|
848
849
|
box-shadow: 0 0 0 1px var(--border), var(--sheet-shadow);
|
|
@@ -881,6 +882,8 @@
|
|
|
881
882
|
.ade-workspace-sidebar[data-auto], .ade-workspace-side-panel[data-auto] { display: contents; }
|
|
882
883
|
.ade-workspace[data-layout="roomy"],
|
|
883
884
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { background: var(--separator); }
|
|
885
|
+
/* The gaps already set the sheet apart, and a shadow over them reads as a smudge. */
|
|
886
|
+
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet { box-shadow: 0 0 0 1px var(--border); }
|
|
884
887
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-center { gap: 8px; }
|
|
885
888
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-sheet > .ade-workspace-sidebar:not([data-auto]) { margin-right: 8px; }
|
|
886
889
|
.ade-workspace[data-layout="roomy"] > .ade-workspace-side-panel:not([data-auto]) { margin-left: 8px; }
|
|
@@ -85,8 +85,8 @@ export function Workspace({
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
// The
|
|
89
|
-
const context = { layout, edges: { top: !hasToolbar, right:
|
|
88
|
+
// The sheet's right edge is rounded, so panes along it keep their corners, whatever stands beside the sheet.
|
|
89
|
+
const context = { layout, edges: { top: !hasToolbar, right: false, bottom: true, left: !leftOpen } };
|
|
90
90
|
|
|
91
91
|
return (
|
|
92
92
|
<WorkspaceContext value={context}>
|