@hanzo/ui 8.27.15 → 8.27.17
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/NOTICE +19 -0
- package/dist/agents/Attachments.cjs +29 -0
- package/dist/agents/Attachments.d.ts +31 -0
- package/dist/agents/Attachments.d.ts.map +1 -0
- package/dist/agents/Attachments.js +27 -0
- package/dist/agents/Attachments.js.map +1 -0
- package/dist/agents/Choice.cjs +47 -0
- package/dist/agents/Choice.d.ts +34 -0
- package/dist/agents/Choice.d.ts.map +1 -0
- package/dist/agents/Choice.js +44 -0
- package/dist/agents/Choice.js.map +1 -0
- package/dist/agents/Console.cjs +106 -0
- package/dist/agents/Console.d.ts +54 -0
- package/dist/agents/Console.d.ts.map +1 -0
- package/dist/agents/Console.js +104 -0
- package/dist/agents/Console.js.map +1 -0
- package/dist/agents/Feedback.cjs +50 -0
- package/dist/agents/Feedback.d.ts +25 -0
- package/dist/agents/Feedback.d.ts.map +1 -0
- package/dist/agents/Feedback.js +48 -0
- package/dist/agents/Feedback.js.map +1 -0
- package/dist/agents/FileTabs.cjs +63 -0
- package/dist/agents/FileTabs.d.ts +45 -0
- package/dist/agents/FileTabs.d.ts.map +1 -0
- package/dist/agents/FileTabs.js +61 -0
- package/dist/agents/FileTabs.js.map +1 -0
- package/dist/agents/FileTree.cjs +160 -0
- package/dist/agents/FileTree.d.ts +41 -0
- package/dist/agents/FileTree.d.ts.map +1 -0
- package/dist/agents/FileTree.js +157 -0
- package/dist/agents/FileTree.js.map +1 -0
- package/dist/agents/PreviewFrame.cjs +108 -0
- package/dist/agents/PreviewFrame.d.ts +78 -0
- package/dist/agents/PreviewFrame.d.ts.map +1 -0
- package/dist/agents/PreviewFrame.js +105 -0
- package/dist/agents/PreviewFrame.js.map +1 -0
- package/dist/agents/Suggestions.cjs +29 -0
- package/dist/agents/Suggestions.d.ts +28 -0
- package/dist/agents/Suggestions.d.ts.map +1 -0
- package/dist/agents/Suggestions.js +26 -0
- package/dist/agents/Suggestions.js.map +1 -0
- package/dist/agents/Workspace.cjs +103 -0
- package/dist/agents/Workspace.d.ts +104 -0
- package/dist/agents/Workspace.d.ts.map +1 -0
- package/dist/agents/Workspace.js +98 -0
- package/dist/agents/Workspace.js.map +1 -0
- package/dist/agents/bridge.cjs +201 -0
- package/dist/agents/bridge.d.ts +102 -0
- package/dist/agents/bridge.d.ts.map +1 -0
- package/dist/agents/bridge.js +197 -0
- package/dist/agents/bridge.js.map +1 -0
- package/dist/agents/index.cjs +64 -1
- package/dist/agents/index.d.ts +23 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +23 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/log.cjs +75 -0
- package/dist/agents/log.d.ts +58 -0
- package/dist/agents/log.d.ts.map +1 -0
- package/dist/agents/log.js +65 -0
- package/dist/agents/log.js.map +1 -0
- package/dist/agents/tree.cjs +238 -0
- package/dist/agents/tree.d.ts +99 -0
- package/dist/agents/tree.d.ts.map +1 -0
- package/dist/agents/tree.js +226 -0
- package/dist/agents/tree.js.map +1 -0
- package/dist/backends/gui/3d-card.d.ts +6 -6
- package/dist/backends/gui/3d-marquee.d.ts +7 -8
- package/dist/backends/gui/3d-marquee.d.ts.map +1 -1
- package/dist/backends/gui/3d-pin.d.ts +1 -1
- package/dist/backends/gui/alert.d.ts +3 -3
- package/dist/backends/gui/android.d.ts +1 -1
- package/dist/backends/gui/animated-testimonials.d.ts +1 -1
- package/dist/backends/gui/animated-tooltip.d.ts +1 -1
- package/dist/backends/gui/announcement.d.ts +1 -1
- package/dist/backends/gui/banner.d.ts +1 -1
- package/dist/backends/gui/button.d.ts +1 -1
- package/dist/backends/gui/card.d.ts +7 -7
- package/dist/backends/gui/code-editor.cjs +2 -2
- package/dist/backends/gui/code-editor.d.ts +7 -1
- package/dist/backends/gui/code-editor.d.ts.map +1 -1
- package/dist/backends/gui/code-editor.js +2 -2
- package/dist/backends/gui/code-editor.js.map +1 -1
- package/dist/backends/gui/command.d.ts +5 -5
- package/dist/backends/gui/command.d.ts.map +1 -1
- package/dist/backends/gui/context-menu.d.ts +14 -14
- package/dist/backends/gui/context-menu.d.ts.map +1 -1
- package/dist/backends/gui/credit-card.d.ts +1 -1
- package/dist/backends/gui/desktop.d.ts +1 -1
- package/dist/backends/gui/dock.d.ts +3 -3
- package/dist/backends/gui/dropdown-menu.d.ts +16 -16
- package/dist/backends/gui/dropdown-menu.d.ts.map +1 -1
- package/dist/backends/gui/empty.d.ts +6 -6
- package/dist/backends/gui/field.d.ts +3 -3
- package/dist/backends/gui/gantt.d.ts +1 -1
- package/dist/backends/gui/grid-pattern.d.ts +1 -2
- package/dist/backends/gui/grid-pattern.d.ts.map +1 -1
- package/dist/backends/gui/image-zoom.d.ts +1 -1
- package/dist/backends/gui/iphone-15-pro.d.ts +1 -1
- package/dist/backends/gui/item.d.ts +9 -9
- package/dist/backends/gui/list.d.ts +2 -2
- package/dist/backends/gui/macos-dock.d.ts +2 -2
- package/dist/backends/gui/magnetic.d.ts +1 -1
- package/dist/backends/gui/marquee.d.ts +1 -15
- package/dist/backends/gui/marquee.d.ts.map +1 -1
- package/dist/backends/gui/menu-dock.d.ts +1 -1
- package/dist/backends/gui/menubar.d.ts +15 -15
- package/dist/backends/gui/menubar.d.ts.map +1 -1
- package/dist/backends/gui/message-dock.d.ts +1 -1
- package/dist/backends/gui/motion-highlight.d.ts +1 -12
- package/dist/backends/gui/motion-highlight.d.ts.map +1 -1
- package/dist/backends/gui/pagination.d.ts +4 -4
- package/dist/backends/gui/qr-code.d.ts +1 -2
- package/dist/backends/gui/qr-code.d.ts.map +1 -1
- package/dist/backends/gui/scroll-area.d.ts +3 -14
- package/dist/backends/gui/scroll-area.d.ts.map +1 -1
- package/dist/backends/gui/sheet.d.ts +3 -3
- package/dist/backends/gui/sheet.d.ts.map +1 -1
- package/dist/backends/gui/status.d.ts +1 -1
- package/dist/backends/gui/table.d.ts +8 -8
- package/dist/backends/gui/toaster.d.ts +1 -15
- package/dist/backends/gui/toaster.d.ts.map +1 -1
- package/dist/backends/gui/toggle.d.ts +1 -1
- package/dist/backends/gui/video-player.d.ts +1 -1
- package/dist/chat/Composer.cjs +60 -9
- package/dist/chat/Composer.d.ts +42 -2
- package/dist/chat/Composer.d.ts.map +1 -1
- package/dist/chat/Composer.js +61 -11
- package/dist/chat/Composer.js.map +1 -1
- package/dist/chat/EmptyPrompt.cjs +27 -0
- package/dist/chat/EmptyPrompt.d.ts +30 -0
- package/dist/chat/EmptyPrompt.d.ts.map +1 -0
- package/dist/chat/EmptyPrompt.js +24 -0
- package/dist/chat/EmptyPrompt.js.map +1 -0
- package/dist/chat/SessionRail.cjs +97 -0
- package/dist/chat/SessionRail.d.ts +97 -0
- package/dist/chat/SessionRail.d.ts.map +1 -0
- package/dist/chat/SessionRail.js +94 -0
- package/dist/chat/SessionRail.js.map +1 -0
- package/dist/chat/Thread.d.ts +2 -8
- package/dist/chat/Thread.d.ts.map +1 -1
- package/dist/chat/index.cjs +8 -1
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +3 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/gallery.cjs +28 -1
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.html +132 -52
- package/dist/gallery.js +30 -3
- package/dist/gallery.js.map +1 -1
- package/dist/product/BranchSelect.cjs +27 -0
- package/dist/product/BranchSelect.d.ts +27 -0
- package/dist/product/BranchSelect.d.ts.map +1 -0
- package/dist/product/BranchSelect.js +23 -0
- package/dist/product/BranchSelect.js.map +1 -0
- package/dist/product/ChipSelect.cjs +267 -0
- package/dist/product/ChipSelect.d.ts +71 -0
- package/dist/product/ChipSelect.d.ts.map +1 -0
- package/dist/product/ChipSelect.js +265 -0
- package/dist/product/ChipSelect.js.map +1 -0
- package/dist/product/RepoSelect.cjs +75 -0
- package/dist/product/RepoSelect.d.ts +63 -0
- package/dist/product/RepoSelect.d.ts.map +1 -0
- package/dist/product/RepoSelect.js +69 -0
- package/dist/product/RepoSelect.js.map +1 -0
- package/dist/product/chipSelect.logic.cjs +147 -0
- package/dist/product/chipSelect.logic.d.ts +92 -0
- package/dist/product/chipSelect.logic.d.ts.map +1 -0
- package/dist/product/chipSelect.logic.js +138 -0
- package/dist/product/chipSelect.logic.js.map +1 -0
- package/dist/product/index.cjs +23 -1
- package/dist/product/index.d.ts +4 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +7 -0
- package/dist/product/index.js.map +1 -1
- package/dist/styles.css +129 -49
- package/package.json +2 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ChipSelect's decisions, as pure functions over plain values.
|
|
4
|
+
*
|
|
5
|
+
* Paging, pinning and the cursor are the parts of a searchable list that are
|
|
6
|
+
* easy to get subtly wrong and impossible to see wrong in a screenshot: a page
|
|
7
|
+
* that arrives twice lists a row twice, a stale page lands under a newer search,
|
|
8
|
+
* a cursor walks off the end. So they live here, importing nothing, and are
|
|
9
|
+
* tested in node.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PAGE = void 0;
|
|
13
|
+
exports.merge = merge;
|
|
14
|
+
exports.pin = pin;
|
|
15
|
+
exports.narrow = narrow;
|
|
16
|
+
exports.move = move;
|
|
17
|
+
exports.wants = wants;
|
|
18
|
+
exports.near = near;
|
|
19
|
+
exports.frame = frame;
|
|
20
|
+
/**
|
|
21
|
+
* Append a page to what is listed, dropping anything already there.
|
|
22
|
+
*
|
|
23
|
+
* Cursor pagination over a list that moves under it (a repository pushed,
|
|
24
|
+
* reordering by `pushed_at`) hands the same row back on two pages. Keyed by id,
|
|
25
|
+
* the second copy is dropped and the first keeps its place.
|
|
26
|
+
*/
|
|
27
|
+
function merge(listed, page) {
|
|
28
|
+
const seen = new Set(listed.map((i) => i.id));
|
|
29
|
+
const out = listed.slice();
|
|
30
|
+
for (const item of page) {
|
|
31
|
+
if (seen.has(item.id))
|
|
32
|
+
continue;
|
|
33
|
+
seen.add(item.id);
|
|
34
|
+
out.push(item);
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The rows in the order they are drawn: the chosen item first, then the rest
|
|
40
|
+
* without it.
|
|
41
|
+
*
|
|
42
|
+
* The chosen item is pinned only while the search could have matched it — an
|
|
43
|
+
* empty search, or one its label contains — so typing narrows the list instead
|
|
44
|
+
* of leaving an unrelated row stuck on top.
|
|
45
|
+
*/
|
|
46
|
+
function pin(items, chosen, q = '') {
|
|
47
|
+
const rest = items.filter((i) => !chosen || i.id !== chosen.id);
|
|
48
|
+
if (!chosen)
|
|
49
|
+
return rest;
|
|
50
|
+
const needle = q.trim().toLowerCase();
|
|
51
|
+
if (needle && !chosen.label.toLowerCase().includes(needle))
|
|
52
|
+
return rest;
|
|
53
|
+
return [chosen, ...rest];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A literal, case-insensitive substring match on the label and hint — for a
|
|
57
|
+
* list the caller hands over whole (no loader), where the search is ours to
|
|
58
|
+
* apply. Never a compiled pattern: the needle is whatever was typed.
|
|
59
|
+
*/
|
|
60
|
+
function narrow(items, q) {
|
|
61
|
+
const needle = q.trim().toLowerCase();
|
|
62
|
+
if (!needle)
|
|
63
|
+
return items.slice();
|
|
64
|
+
return items.filter((i) => i.label.toLowerCase().includes(needle) || (i.hint ?? '').toLowerCase().includes(needle));
|
|
65
|
+
}
|
|
66
|
+
/** How far PageUp/PageDown travel — roughly what the list shows at once. */
|
|
67
|
+
exports.PAGE = 10;
|
|
68
|
+
/**
|
|
69
|
+
* Where the cursor lands.
|
|
70
|
+
*
|
|
71
|
+
* `from` is -1 before anything is under the cursor; `count` is how many rows
|
|
72
|
+
* are drawn. It stops at the ends rather than wrapping: the list pages in more
|
|
73
|
+
* rows at its end, and a cursor that wrapped to the top would skip the load.
|
|
74
|
+
* Disabled rows are stepped over in the direction of travel.
|
|
75
|
+
*/
|
|
76
|
+
function move(key, from, count, disabled = () => false) {
|
|
77
|
+
if (count <= 0)
|
|
78
|
+
return -1;
|
|
79
|
+
const clamp = (n) => Math.max(0, Math.min(count - 1, n));
|
|
80
|
+
let at;
|
|
81
|
+
let dir;
|
|
82
|
+
switch (key) {
|
|
83
|
+
case 'ArrowDown':
|
|
84
|
+
at = clamp(from + 1);
|
|
85
|
+
dir = 1;
|
|
86
|
+
break;
|
|
87
|
+
case 'ArrowUp':
|
|
88
|
+
at = from < 0 ? 0 : clamp(from - 1);
|
|
89
|
+
dir = -1;
|
|
90
|
+
break;
|
|
91
|
+
case 'Home':
|
|
92
|
+
at = 0;
|
|
93
|
+
dir = 1;
|
|
94
|
+
break;
|
|
95
|
+
case 'End':
|
|
96
|
+
at = count - 1;
|
|
97
|
+
dir = -1;
|
|
98
|
+
break;
|
|
99
|
+
case 'PageDown':
|
|
100
|
+
at = clamp((from < 0 ? 0 : from) + exports.PAGE);
|
|
101
|
+
dir = 1;
|
|
102
|
+
break;
|
|
103
|
+
case 'PageUp':
|
|
104
|
+
at = clamp((from < 0 ? 0 : from) - exports.PAGE);
|
|
105
|
+
dir = -1;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
// Step over disabled rows; if the whole remaining direction is disabled, try
|
|
109
|
+
// the other way; if everything is, nothing is under the cursor.
|
|
110
|
+
for (const d of [dir, -dir]) {
|
|
111
|
+
for (let i = at; i >= 0 && i < count; i += d)
|
|
112
|
+
if (!disabled(i))
|
|
113
|
+
return i;
|
|
114
|
+
}
|
|
115
|
+
return -1;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Whether the list should ask for the next page: there is one, nothing is in
|
|
119
|
+
* flight, and the reader is within `slack` rows of the end — by the cursor, or
|
|
120
|
+
* by having scrolled there.
|
|
121
|
+
*/
|
|
122
|
+
function wants(opts) {
|
|
123
|
+
const { next, loading, at, count, slack = 3 } = opts;
|
|
124
|
+
if (!next || loading)
|
|
125
|
+
return false;
|
|
126
|
+
return at >= count - 1 - slack;
|
|
127
|
+
}
|
|
128
|
+
/** Whether a scroll position is near the bottom of what is scrollable. */
|
|
129
|
+
function near(top, height, content, slack = 48) {
|
|
130
|
+
return top + height >= content - slack;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The list's height while a panel is open, decided once, at open.
|
|
134
|
+
*
|
|
135
|
+
* The panel is placed from its size at open: the popper watches the chip and
|
|
136
|
+
* not the panel (watching the panel loops), so a panel that grows afterwards
|
|
137
|
+
* grows past its own placement — a top-placed panel down over its chip and off
|
|
138
|
+
* the screen. So nothing may resize it while it is open. A list whose length is
|
|
139
|
+
* not known yet — pages from a loader, or rows still loading — takes the whole
|
|
140
|
+
* `ceiling`; a known list its own length, capped there.
|
|
141
|
+
*/
|
|
142
|
+
function frame(opts) {
|
|
143
|
+
const { pending, count, row, ceiling, pad = 8 } = opts;
|
|
144
|
+
if (pending)
|
|
145
|
+
return ceiling;
|
|
146
|
+
return Math.min(ceiling, Math.max(count, 1) * row + pad);
|
|
147
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChipSelect's decisions, as pure functions over plain values.
|
|
3
|
+
*
|
|
4
|
+
* Paging, pinning and the cursor are the parts of a searchable list that are
|
|
5
|
+
* easy to get subtly wrong and impossible to see wrong in a screenshot: a page
|
|
6
|
+
* that arrives twice lists a row twice, a stale page lands under a newer search,
|
|
7
|
+
* a cursor walks off the end. So they live here, importing nothing, and are
|
|
8
|
+
* tested in node.
|
|
9
|
+
*/
|
|
10
|
+
/** Anything a ChipSelect lists: an id it is keyed by and a label it shows. */
|
|
11
|
+
export interface ChipItem {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
/** A quieter second word on the row — `private`, a count. */
|
|
15
|
+
hint?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** One answer from a loader. `next` is the cursor for the page after it; absent, there is none. */
|
|
19
|
+
export interface ChipPage<T> {
|
|
20
|
+
items: T[];
|
|
21
|
+
next?: string | null;
|
|
22
|
+
}
|
|
23
|
+
/** Reads one page: the search, and the cursor a previous page handed back (none for the first). */
|
|
24
|
+
export type ChipLoad<T> = (q: string, after?: string | null) => Promise<ChipPage<T>>;
|
|
25
|
+
/**
|
|
26
|
+
* Append a page to what is listed, dropping anything already there.
|
|
27
|
+
*
|
|
28
|
+
* Cursor pagination over a list that moves under it (a repository pushed,
|
|
29
|
+
* reordering by `pushed_at`) hands the same row back on two pages. Keyed by id,
|
|
30
|
+
* the second copy is dropped and the first keeps its place.
|
|
31
|
+
*/
|
|
32
|
+
export declare function merge<T extends ChipItem>(listed: readonly T[], page: readonly T[]): T[];
|
|
33
|
+
/**
|
|
34
|
+
* The rows in the order they are drawn: the chosen item first, then the rest
|
|
35
|
+
* without it.
|
|
36
|
+
*
|
|
37
|
+
* The chosen item is pinned only while the search could have matched it — an
|
|
38
|
+
* empty search, or one its label contains — so typing narrows the list instead
|
|
39
|
+
* of leaving an unrelated row stuck on top.
|
|
40
|
+
*/
|
|
41
|
+
export declare function pin<T extends ChipItem>(items: readonly T[], chosen: T | null | undefined, q?: string): T[];
|
|
42
|
+
/**
|
|
43
|
+
* A literal, case-insensitive substring match on the label and hint — for a
|
|
44
|
+
* list the caller hands over whole (no loader), where the search is ours to
|
|
45
|
+
* apply. Never a compiled pattern: the needle is whatever was typed.
|
|
46
|
+
*/
|
|
47
|
+
export declare function narrow<T extends ChipItem>(items: readonly T[], q: string): T[];
|
|
48
|
+
/** The keys the list answers, and nothing else. */
|
|
49
|
+
export type Move = 'ArrowDown' | 'ArrowUp' | 'Home' | 'End' | 'PageDown' | 'PageUp';
|
|
50
|
+
/** How far PageUp/PageDown travel — roughly what the list shows at once. */
|
|
51
|
+
export declare const PAGE = 10;
|
|
52
|
+
/**
|
|
53
|
+
* Where the cursor lands.
|
|
54
|
+
*
|
|
55
|
+
* `from` is -1 before anything is under the cursor; `count` is how many rows
|
|
56
|
+
* are drawn. It stops at the ends rather than wrapping: the list pages in more
|
|
57
|
+
* rows at its end, and a cursor that wrapped to the top would skip the load.
|
|
58
|
+
* Disabled rows are stepped over in the direction of travel.
|
|
59
|
+
*/
|
|
60
|
+
export declare function move(key: Move, from: number, count: number, disabled?: (index: number) => boolean): number;
|
|
61
|
+
/**
|
|
62
|
+
* Whether the list should ask for the next page: there is one, nothing is in
|
|
63
|
+
* flight, and the reader is within `slack` rows of the end — by the cursor, or
|
|
64
|
+
* by having scrolled there.
|
|
65
|
+
*/
|
|
66
|
+
export declare function wants(opts: {
|
|
67
|
+
next?: string | null;
|
|
68
|
+
loading: boolean;
|
|
69
|
+
at: number;
|
|
70
|
+
count: number;
|
|
71
|
+
slack?: number;
|
|
72
|
+
}): boolean;
|
|
73
|
+
/** Whether a scroll position is near the bottom of what is scrollable. */
|
|
74
|
+
export declare function near(top: number, height: number, content: number, slack?: number): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The list's height while a panel is open, decided once, at open.
|
|
77
|
+
*
|
|
78
|
+
* The panel is placed from its size at open: the popper watches the chip and
|
|
79
|
+
* not the panel (watching the panel loops), so a panel that grows afterwards
|
|
80
|
+
* grows past its own placement — a top-placed panel down over its chip and off
|
|
81
|
+
* the screen. So nothing may resize it while it is open. A list whose length is
|
|
82
|
+
* not known yet — pages from a loader, or rows still loading — takes the whole
|
|
83
|
+
* `ceiling`; a known list its own length, capped there.
|
|
84
|
+
*/
|
|
85
|
+
export declare function frame(opts: {
|
|
86
|
+
pending: boolean;
|
|
87
|
+
count: number;
|
|
88
|
+
row: number;
|
|
89
|
+
ceiling: number;
|
|
90
|
+
pad?: number;
|
|
91
|
+
}): number;
|
|
92
|
+
//# sourceMappingURL=chipSelect.logic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chipSelect.logic.d.ts","sourceRoot":"","sources":["../../src/product/chipSelect.logic.ts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ACH,wBAAgB,IAAI,CAClB,GAAG,EAAE,IAAI,EACT,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAqB,GACjD,MAAM,CAqCR;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAI1H;AAED,0EAA0E;AAC1E,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAEtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAInH"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChipSelect's decisions, as pure functions over plain values.
|
|
3
|
+
*
|
|
4
|
+
* Paging, pinning and the cursor are the parts of a searchable list that are
|
|
5
|
+
* easy to get subtly wrong and impossible to see wrong in a screenshot: a page
|
|
6
|
+
* that arrives twice lists a row twice, a stale page lands under a newer search,
|
|
7
|
+
* a cursor walks off the end. So they live here, importing nothing, and are
|
|
8
|
+
* tested in node.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Append a page to what is listed, dropping anything already there.
|
|
12
|
+
*
|
|
13
|
+
* Cursor pagination over a list that moves under it (a repository pushed,
|
|
14
|
+
* reordering by `pushed_at`) hands the same row back on two pages. Keyed by id,
|
|
15
|
+
* the second copy is dropped and the first keeps its place.
|
|
16
|
+
*/
|
|
17
|
+
export function merge(listed, page) {
|
|
18
|
+
const seen = new Set(listed.map((i) => i.id));
|
|
19
|
+
const out = listed.slice();
|
|
20
|
+
for (const item of page) {
|
|
21
|
+
if (seen.has(item.id))
|
|
22
|
+
continue;
|
|
23
|
+
seen.add(item.id);
|
|
24
|
+
out.push(item);
|
|
25
|
+
}
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The rows in the order they are drawn: the chosen item first, then the rest
|
|
30
|
+
* without it.
|
|
31
|
+
*
|
|
32
|
+
* The chosen item is pinned only while the search could have matched it — an
|
|
33
|
+
* empty search, or one its label contains — so typing narrows the list instead
|
|
34
|
+
* of leaving an unrelated row stuck on top.
|
|
35
|
+
*/
|
|
36
|
+
export function pin(items, chosen, q = '') {
|
|
37
|
+
const rest = items.filter((i) => !chosen || i.id !== chosen.id);
|
|
38
|
+
if (!chosen)
|
|
39
|
+
return rest;
|
|
40
|
+
const needle = q.trim().toLowerCase();
|
|
41
|
+
if (needle && !chosen.label.toLowerCase().includes(needle))
|
|
42
|
+
return rest;
|
|
43
|
+
return [chosen, ...rest];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A literal, case-insensitive substring match on the label and hint — for a
|
|
47
|
+
* list the caller hands over whole (no loader), where the search is ours to
|
|
48
|
+
* apply. Never a compiled pattern: the needle is whatever was typed.
|
|
49
|
+
*/
|
|
50
|
+
export function narrow(items, q) {
|
|
51
|
+
const needle = q.trim().toLowerCase();
|
|
52
|
+
if (!needle)
|
|
53
|
+
return items.slice();
|
|
54
|
+
return items.filter((i) => i.label.toLowerCase().includes(needle) || (i.hint ?? '').toLowerCase().includes(needle));
|
|
55
|
+
}
|
|
56
|
+
/** How far PageUp/PageDown travel — roughly what the list shows at once. */
|
|
57
|
+
export const PAGE = 10;
|
|
58
|
+
/**
|
|
59
|
+
* Where the cursor lands.
|
|
60
|
+
*
|
|
61
|
+
* `from` is -1 before anything is under the cursor; `count` is how many rows
|
|
62
|
+
* are drawn. It stops at the ends rather than wrapping: the list pages in more
|
|
63
|
+
* rows at its end, and a cursor that wrapped to the top would skip the load.
|
|
64
|
+
* Disabled rows are stepped over in the direction of travel.
|
|
65
|
+
*/
|
|
66
|
+
export function move(key, from, count, disabled = () => false) {
|
|
67
|
+
if (count <= 0)
|
|
68
|
+
return -1;
|
|
69
|
+
const clamp = (n) => Math.max(0, Math.min(count - 1, n));
|
|
70
|
+
let at;
|
|
71
|
+
let dir;
|
|
72
|
+
switch (key) {
|
|
73
|
+
case 'ArrowDown':
|
|
74
|
+
at = clamp(from + 1);
|
|
75
|
+
dir = 1;
|
|
76
|
+
break;
|
|
77
|
+
case 'ArrowUp':
|
|
78
|
+
at = from < 0 ? 0 : clamp(from - 1);
|
|
79
|
+
dir = -1;
|
|
80
|
+
break;
|
|
81
|
+
case 'Home':
|
|
82
|
+
at = 0;
|
|
83
|
+
dir = 1;
|
|
84
|
+
break;
|
|
85
|
+
case 'End':
|
|
86
|
+
at = count - 1;
|
|
87
|
+
dir = -1;
|
|
88
|
+
break;
|
|
89
|
+
case 'PageDown':
|
|
90
|
+
at = clamp((from < 0 ? 0 : from) + PAGE);
|
|
91
|
+
dir = 1;
|
|
92
|
+
break;
|
|
93
|
+
case 'PageUp':
|
|
94
|
+
at = clamp((from < 0 ? 0 : from) - PAGE);
|
|
95
|
+
dir = -1;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
// Step over disabled rows; if the whole remaining direction is disabled, try
|
|
99
|
+
// the other way; if everything is, nothing is under the cursor.
|
|
100
|
+
for (const d of [dir, -dir]) {
|
|
101
|
+
for (let i = at; i >= 0 && i < count; i += d)
|
|
102
|
+
if (!disabled(i))
|
|
103
|
+
return i;
|
|
104
|
+
}
|
|
105
|
+
return -1;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Whether the list should ask for the next page: there is one, nothing is in
|
|
109
|
+
* flight, and the reader is within `slack` rows of the end — by the cursor, or
|
|
110
|
+
* by having scrolled there.
|
|
111
|
+
*/
|
|
112
|
+
export function wants(opts) {
|
|
113
|
+
const { next, loading, at, count, slack = 3 } = opts;
|
|
114
|
+
if (!next || loading)
|
|
115
|
+
return false;
|
|
116
|
+
return at >= count - 1 - slack;
|
|
117
|
+
}
|
|
118
|
+
/** Whether a scroll position is near the bottom of what is scrollable. */
|
|
119
|
+
export function near(top, height, content, slack = 48) {
|
|
120
|
+
return top + height >= content - slack;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The list's height while a panel is open, decided once, at open.
|
|
124
|
+
*
|
|
125
|
+
* The panel is placed from its size at open: the popper watches the chip and
|
|
126
|
+
* not the panel (watching the panel loops), so a panel that grows afterwards
|
|
127
|
+
* grows past its own placement — a top-placed panel down over its chip and off
|
|
128
|
+
* the screen. So nothing may resize it while it is open. A list whose length is
|
|
129
|
+
* not known yet — pages from a loader, or rows still loading — takes the whole
|
|
130
|
+
* `ceiling`; a known list its own length, capped there.
|
|
131
|
+
*/
|
|
132
|
+
export function frame(opts) {
|
|
133
|
+
const { pending, count, row, ceiling, pad = 8 } = opts;
|
|
134
|
+
if (pending)
|
|
135
|
+
return ceiling;
|
|
136
|
+
return Math.min(ceiling, Math.max(count, 1) * row + pad);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=chipSelect.logic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chipSelect.logic.js","sourceRoot":"","sources":["../../src/product/chipSelect.logic.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoBH;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAqB,MAAoB,EAAE,IAAkB;IAChF,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EA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I,CAAA;IACtD,IAAI,OAAO;QAAE,OAAO,OAAO,CAAA;IAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAA;AAC1D,CAAC"}
|
package/dist/product/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
24
24
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.tagTone = exports.TAG_TONES = exports.tokens = exports.ComboBox = exports.DonutRing = exports.Panel = exports.HintButton = exports.MetricCard = exports.LegendDot = exports.UtilBar = exports.MiniBars = exports.MetricSparkline = exports.utilColor = exports.colorForIndex = exports.SERIES = void 0;
|
|
27
|
+
exports.tagTone = exports.TAG_TONES = exports.tokens = exports.branchName = exports.BranchSelect = exports.followable = exports.address = exports.FooterLink = exports.RepoSelect = exports.PAGE = exports.near = exports.wants = exports.move = exports.narrow = exports.pin = exports.merge = exports.frame = exports.ChipSelect = exports.ComboBox = exports.DonutRing = exports.Panel = exports.HintButton = exports.MetricCard = exports.LegendDot = exports.UtilBar = exports.MiniBars = exports.MetricSparkline = exports.utilColor = exports.colorForIndex = exports.SERIES = void 0;
|
|
28
28
|
// Charts — the canonical Sparkline + Donut live here (dependency-free inline SVG:
|
|
29
29
|
// hover tooltips, axis ticks, honest null under 2 real points).
|
|
30
30
|
__exportStar(require("./Charts.cjs"), exports);
|
|
@@ -51,6 +51,28 @@ Object.defineProperty(exports, "DonutRing", { enumerable: true, get: function ()
|
|
|
51
51
|
var ComboBox_1 = require("./ComboBox.cjs");
|
|
52
52
|
Object.defineProperty(exports, "ComboBox", { enumerable: true, get: function () { return ComboBox_1.ComboBox; } });
|
|
53
53
|
__exportStar(require("./combobox/filter.cjs"), exports);
|
|
54
|
+
// ChipSelect — the composer's context chip: a searchable, paged list that opens
|
|
55
|
+
// upward from a small chip. RepoSelect and BranchSelect are it over `owner/name`
|
|
56
|
+
// and branch names, with the data a host loader's and no git host baked in.
|
|
57
|
+
var ChipSelect_1 = require("./ChipSelect.cjs");
|
|
58
|
+
Object.defineProperty(exports, "ChipSelect", { enumerable: true, get: function () { return ChipSelect_1.ChipSelect; } });
|
|
59
|
+
var chipSelect_logic_1 = require("./chipSelect.logic.cjs");
|
|
60
|
+
Object.defineProperty(exports, "frame", { enumerable: true, get: function () { return chipSelect_logic_1.frame; } });
|
|
61
|
+
Object.defineProperty(exports, "merge", { enumerable: true, get: function () { return chipSelect_logic_1.merge; } });
|
|
62
|
+
Object.defineProperty(exports, "pin", { enumerable: true, get: function () { return chipSelect_logic_1.pin; } });
|
|
63
|
+
Object.defineProperty(exports, "narrow", { enumerable: true, get: function () { return chipSelect_logic_1.narrow; } });
|
|
64
|
+
Object.defineProperty(exports, "move", { enumerable: true, get: function () { return chipSelect_logic_1.move; } });
|
|
65
|
+
Object.defineProperty(exports, "wants", { enumerable: true, get: function () { return chipSelect_logic_1.wants; } });
|
|
66
|
+
Object.defineProperty(exports, "near", { enumerable: true, get: function () { return chipSelect_logic_1.near; } });
|
|
67
|
+
Object.defineProperty(exports, "PAGE", { enumerable: true, get: function () { return chipSelect_logic_1.PAGE; } });
|
|
68
|
+
var RepoSelect_1 = require("./RepoSelect.cjs");
|
|
69
|
+
Object.defineProperty(exports, "RepoSelect", { enumerable: true, get: function () { return RepoSelect_1.RepoSelect; } });
|
|
70
|
+
Object.defineProperty(exports, "FooterLink", { enumerable: true, get: function () { return RepoSelect_1.FooterLink; } });
|
|
71
|
+
Object.defineProperty(exports, "address", { enumerable: true, get: function () { return RepoSelect_1.address; } });
|
|
72
|
+
Object.defineProperty(exports, "followable", { enumerable: true, get: function () { return RepoSelect_1.followable; } });
|
|
73
|
+
var BranchSelect_1 = require("./BranchSelect.cjs");
|
|
74
|
+
Object.defineProperty(exports, "BranchSelect", { enumerable: true, get: function () { return BranchSelect_1.BranchSelect; } });
|
|
75
|
+
Object.defineProperty(exports, "branchName", { enumerable: true, get: function () { return BranchSelect_1.branchName; } });
|
|
54
76
|
// The shared shell — brand mark, org scope + switcher, account menu, app header
|
|
55
77
|
// (the console's org-scope contract + switcher hoisted here; hanzoai/ui#36).
|
|
56
78
|
// `surfaces.data` is the ONE canonical cross-surface list every launcher consumes.
|
package/dist/product/index.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ export { SERIES, colorForIndex, utilColor, Sparkline as MetricSparkline, MiniBar
|
|
|
3
3
|
export { Donut as DonutRing, type DonutSegment } from './Donut.js';
|
|
4
4
|
export { ComboBox } from './ComboBox.js';
|
|
5
5
|
export * from './combobox/filter.js';
|
|
6
|
+
export { ChipSelect, type ChipAction, type ChipPlacement, type ChipSelectProps, } from './ChipSelect.js';
|
|
7
|
+
export { frame, merge, pin, narrow, move, wants, near, PAGE, type ChipItem, type ChipLoad, type ChipPage, type Move, } from './chipSelect.logic.js';
|
|
8
|
+
export { RepoSelect, FooterLink, address, followable, type Repo, type RepoItem, type RepoLink, type RepoLoad, type RepoSelectProps, } from './RepoSelect.js';
|
|
9
|
+
export { BranchSelect, branchName, type Branch, type BranchLoad, type BranchSelectProps } from './BranchSelect.js';
|
|
6
10
|
export * from './surfaces.data.js';
|
|
7
11
|
export * from './AppHeader.js';
|
|
8
12
|
export * from './BrandMark.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAA;AAKxB,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,GACN,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,KAAK,IAAI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AAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AASvB,cAAc,UAAU,CAAA;AAKxB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/product/index.js
CHANGED
|
@@ -22,6 +22,13 @@ export { Donut as DonutRing } from './Donut.js';
|
|
|
22
22
|
// option type + matchers from there.
|
|
23
23
|
export { ComboBox } from './ComboBox.js';
|
|
24
24
|
export * from './combobox/filter.js';
|
|
25
|
+
// ChipSelect — the composer's context chip: a searchable, paged list that opens
|
|
26
|
+
// upward from a small chip. RepoSelect and BranchSelect are it over `owner/name`
|
|
27
|
+
// and branch names, with the data a host loader's and no git host baked in.
|
|
28
|
+
export { ChipSelect, } from './ChipSelect.js';
|
|
29
|
+
export { frame, merge, pin, narrow, move, wants, near, PAGE, } from './chipSelect.logic.js';
|
|
30
|
+
export { RepoSelect, FooterLink, address, followable, } from './RepoSelect.js';
|
|
31
|
+
export { BranchSelect, branchName } from './BranchSelect.js';
|
|
25
32
|
// The shared shell — brand mark, org scope + switcher, account menu, app header
|
|
26
33
|
// (the console's org-scope contract + switcher hoisted here; hanzoai/ui#36).
|
|
27
34
|
// `surfaces.data` is the ONE canonical cross-surface list every launcher consumes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAE7E,kFAAkF;AAClF,gEAAgE;AAChE,cAAc,UAAU,CAAA;AAExB,2EAA2E;AAC3E,+EAA+E;AAC/E,4CAA4C;AAC5C,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAA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,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,mFAAmF;AACnF,qFAAqF;AACrF,uEAAuE;AAEvE,iFAAiF;AACjF,kFAAkF;AAClF,kEAAkE;AAClE,cAAc,UAAU,CAAA;AAExB,sEAAsE;AACtE,+EAA+E;AAC/E,8EAA8E;AAC9E,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAE7E,kFAAkF;AAClF,gEAAgE;AAChE,cAAc,UAAU,CAAA;AAExB,2EAA2E;AAC3E,+EAA+E;AAC/E,4CAA4C;AAC5C,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,GACN,MAAM,UAAU,CAAA;AAEjB,6EAA6E;AAC7E,OAAO,EAAE,KAAK,IAAI,SAAS,EAAqB,MAAM,SAAS,CAAA;AAE/D,+EAA+E;AAC/E,8EAA8E;AAC9E,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,cAAc,mBAAmB,CAAA;AAEjC,gFAAgF;AAChF,iFAAiF;AACjF,4EAA4E;AAC5E,OAAO,EACL,UAAU,GAIX,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,GAKL,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO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