@hanzo/app 0.3.94 → 0.3.96
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/Account.d.ts +9 -3
- package/dist/Account.js +142 -141
- package/dist/App.js +71 -37
- package/dist/Bar.js +1 -1
- package/dist/Betas.d.ts +1 -1
- package/dist/Betas.js +16 -22
- package/dist/Board.js +114 -48
- package/dist/CalScheduler.d.ts +1 -0
- package/dist/CalScheduler.js +223 -57
- package/dist/Chat.js +432 -153
- package/dist/Contacts.js +35 -31
- package/dist/ContextMenu.js +126 -42
- package/dist/Directory.js +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/Drive.js +351 -119
- package/dist/Gate.js +156 -13
- package/dist/Home.js +31 -53
- package/dist/Inbox.js +29 -15
- package/dist/InlineRename.d.ts +6 -0
- package/dist/InlineRename.js +41 -0
- package/dist/Learning.js +132 -13
- package/dist/Market.js +13 -9
- package/dist/Meet.d.ts +5 -0
- package/dist/Meet.js +75 -51
- package/dist/MoreMenu.d.ts +19 -0
- package/dist/MoreMenu.js +33 -0
- package/dist/NeedMoreUsage.js +2 -2
- package/dist/OrgSwitcher.js +6 -2
- package/dist/PreferencesDialog.js +5 -2
- package/dist/Rail.d.ts +73 -7
- package/dist/Rail.js +372 -111
- package/dist/Recents.js +77 -24
- package/dist/RightPane.js +2 -2
- package/dist/Search.d.ts +13 -1
- package/dist/Search.js +366 -50
- package/dist/Setup.js +34 -5
- package/dist/Shared.js +12 -12
- package/dist/Shell.d.ts +10 -0
- package/dist/Shell.js +258 -158
- package/dist/Sidebar.d.ts +14 -3
- package/dist/Sidebar.js +411 -129
- package/dist/SkipLink.d.ts +8 -0
- package/dist/SkipLink.js +11 -0
- package/dist/Start.js +51 -52
- package/dist/Terminals.js +159 -11
- package/dist/ToBottom.js +1 -1
- package/dist/Upgrade.d.ts +8 -3
- package/dist/Upgrade.js +194 -103
- package/dist/Usage.d.ts +1 -1
- package/dist/Usage.js +186 -82
- package/dist/WalletPill.js +8 -2
- package/dist/Work.js +162 -53
- package/dist/archive.d.ts +8 -0
- package/dist/archive.js +16 -0
- package/dist/bots/Bots.js +16 -1
- package/dist/bots/ComputerDialog.js +53 -26
- package/dist/bots/ConnectorsDialog.js +34 -15
- package/dist/bots/Make.js +5 -1
- package/dist/bots/Panel.js +37 -31
- package/dist/bots/Roster.d.ts +4 -1
- package/dist/bots/Roster.js +71 -25
- package/dist/bots/Thread.js +54 -27
- package/dist/bots/face.js +9 -3
- package/dist/bots/grid.d.ts +36 -0
- package/dist/bots/grid.js +91 -0
- package/dist/bots/ink.d.ts +1 -1
- package/dist/bots/ink.js +1 -1
- package/dist/bots/kit.d.ts +9 -4
- package/dist/bots/kit.js +3 -2
- package/dist/chord.d.ts +13 -0
- package/dist/chord.js +30 -1
- package/dist/crew.js +47 -4
- package/dist/ground.d.ts +2 -2
- package/dist/ground.js +3 -3
- package/dist/help.d.ts +7 -3
- package/dist/help.js +19 -14
- package/dist/keys.d.ts +28 -0
- package/dist/keys.js +58 -0
- package/dist/lib/arrival.d.ts +5 -0
- package/dist/lib/arrival.js +10 -0
- package/dist/lib/betas.d.ts +2 -0
- package/dist/lib/betas.js +10 -0
- package/dist/lib/branch.d.ts +11 -0
- package/dist/lib/branch.js +11 -0
- package/dist/lib/chatPreferences.d.ts +1 -1
- package/dist/lib/chatPreferences.js +1 -1
- package/dist/lib/dev-mode.d.ts +18 -0
- package/dist/lib/dev-mode.js +102 -0
- package/dist/lib/durable.d.ts +1 -1
- package/dist/lib/durable.js +1 -1
- package/dist/lib/info-hint.d.ts +7 -0
- package/dist/lib/info-hint.js +8 -0
- package/dist/lib/model-picker.d.ts +2 -0
- package/dist/lib/model-picker.js +12 -0
- package/dist/lib/owners.d.ts +5 -0
- package/dist/lib/owners.js +15 -0
- package/dist/lib/pay.d.ts +2 -0
- package/dist/lib/pay.js +4 -0
- package/dist/lib/todo.d.ts +7 -1
- package/dist/lib/todo.js +41 -29
- package/dist/look.js +39 -8
- package/dist/rail-open.d.ts +9 -0
- package/dist/rail-open.js +34 -0
- package/dist/renaming.d.ts +10 -0
- package/dist/renaming.js +25 -0
- package/dist/seek.d.ts +6 -1
- package/dist/seek.js +13 -0
- package/dist/thread.d.ts +2 -1
- package/dist/thread.js +85 -44
- package/package.json +11 -11
package/dist/Recents.js
CHANGED
|
@@ -17,7 +17,7 @@ import * as studio from '@hanzo/studio';
|
|
|
17
17
|
import { DropdownMenu } from '@hanzo/ui';
|
|
18
18
|
import { SidebarItem, StatusDot } from '@hanzo/ui/chat';
|
|
19
19
|
import { useKept } from './kept.js';
|
|
20
|
-
import { app } from './lib/host.js';
|
|
20
|
+
import { app, design } from './lib/host.js';
|
|
21
21
|
import { site } from './where.js';
|
|
22
22
|
import { ago, arrange, chats, designs, hasUnreadUpdate, MENUS, PINNED, PLAIN, runs, SINCE, UNFILED, UNTITLED, UNTITLED_RUN, viewOf } from './recent.js';
|
|
23
23
|
import { ConversationMenu, ThreadRow, useThreadList } from './thread.js';
|
|
@@ -72,39 +72,89 @@ export function Recents({ host, mode, thread, onOpen, onNew, }) {
|
|
|
72
72
|
/** Design's Recents: Studio's conversations, each opened in Design at its own address (@hanzo/studio `path`). */
|
|
73
73
|
function Designs({ host, view, keep }) {
|
|
74
74
|
const { rows: made, error } = useMade(host);
|
|
75
|
-
const
|
|
75
|
+
const [meta, setMeta] = useKept('hanzo.design.meta', {});
|
|
76
|
+
const metaRef = useRef(meta);
|
|
77
|
+
metaRef.current = meta;
|
|
78
|
+
const patchMeta = (id, patch) => {
|
|
79
|
+
const next = {
|
|
80
|
+
...(metaRef.current ?? {}),
|
|
81
|
+
[id]: { ...(metaRef.current?.[id] ?? {}), ...patch },
|
|
82
|
+
};
|
|
83
|
+
metaRef.current = next;
|
|
84
|
+
setMeta(next);
|
|
85
|
+
};
|
|
86
|
+
const visibleMade = useMemo(() => made
|
|
87
|
+
.filter((m) => !meta?.[m.id]?.deleted)
|
|
88
|
+
.filter((m) => (view.status === 'archived' ? Boolean(meta?.[m.id]?.archived) : !meta?.[m.id]?.archived)), [made, meta, view.status]);
|
|
89
|
+
const rows = useMemo(() => designs(visibleMade).map((r) => ({
|
|
90
|
+
...r,
|
|
91
|
+
title: meta?.[r.id]?.title || r.title,
|
|
92
|
+
status: view.status === 'archived' ? 'archived' : r.status,
|
|
93
|
+
...(meta?.[r.id]?.pinned ? { pinned: true } : {}),
|
|
94
|
+
})), [visibleMade, meta, view.status]);
|
|
95
|
+
const byId = useMemo(() => new Map(rows.map((r) => [
|
|
96
|
+
r.id,
|
|
97
|
+
{
|
|
98
|
+
id: r.id,
|
|
99
|
+
title: r.title || UNTITLED,
|
|
100
|
+
updatedAt: r.at,
|
|
101
|
+
pinned: Boolean(meta?.[r.id]?.pinned),
|
|
102
|
+
archived: Boolean(meta?.[r.id]?.archived),
|
|
103
|
+
},
|
|
104
|
+
])), [rows, meta]);
|
|
105
|
+
const designActions = useMemo(() => ({
|
|
106
|
+
pin: async (t) => {
|
|
107
|
+
patchMeta(t.id, { pinned: !t.pinned });
|
|
108
|
+
return true;
|
|
109
|
+
},
|
|
110
|
+
archive: async (t) => {
|
|
111
|
+
patchMeta(t.id, { archived: !t.archived });
|
|
112
|
+
return true;
|
|
113
|
+
},
|
|
114
|
+
rename: async (t, next) => {
|
|
115
|
+
const title = next.trim();
|
|
116
|
+
if (!title || title === (t.title ?? ''))
|
|
117
|
+
return true;
|
|
118
|
+
patchMeta(t.id, { title });
|
|
119
|
+
return true;
|
|
120
|
+
},
|
|
121
|
+
remove: async (t) => {
|
|
122
|
+
patchMeta(t.id, { deleted: true });
|
|
123
|
+
return true;
|
|
124
|
+
},
|
|
125
|
+
}), []);
|
|
126
|
+
const designHref = (id) => new URL(site(design(studio.path({ kind: 'chat', id }))), window.location.href).href;
|
|
76
127
|
const failed = useMemo(() => (error ? new Error(error) : null), [error]);
|
|
77
128
|
const at = studio.route(host.path);
|
|
78
129
|
const held = at.kind === 'chat' ? at.id : null;
|
|
79
|
-
return (_jsx(List, { mode: "design", rows: rows, view: view, keep: keep, open: (r) => r.id === held, reading: false, error: failed, onOpen: (r) => host.go(studio.path({ kind: 'chat', id: r.id })) }));
|
|
130
|
+
return (_jsx(List, { mode: "design", rows: rows, view: view, keep: keep, open: (r) => r.id === held, reading: false, error: failed, onOpen: (r) => host.go(studio.path({ kind: 'chat', id: r.id })), threads: byId, held: held, onNew: () => host.go(''), customActions: designActions, hrefOf: designHref }));
|
|
80
131
|
}
|
|
132
|
+
const EMPTY_SEEN = {};
|
|
81
133
|
/** Chat's Recents: the conversation store alone, the archived ones when the view asks for them. */
|
|
82
134
|
function Chats({ thread, view, keep, onOpen, onNew, }) {
|
|
83
135
|
const store = useThreadList(view.status === 'archived', thread);
|
|
84
136
|
const rows = useMemo(() => chats(store.threads), [store.threads]);
|
|
85
137
|
const byId = useMemo(() => new Map(store.threads.map((t) => [t.id, t])), [store.threads]);
|
|
86
|
-
const [seenAt, setSeenAt] = useKept('hanzo.chat.seen.v1',
|
|
138
|
+
const [seenAt, setSeenAt] = useKept('hanzo.chat.seen.v1', EMPTY_SEEN);
|
|
87
139
|
const seenRef = useRef(seenAt);
|
|
88
140
|
seenRef.current = seenAt;
|
|
89
141
|
useEffect(() => {
|
|
90
142
|
if (!store.threads.length)
|
|
91
143
|
return;
|
|
92
|
-
const
|
|
93
|
-
const current = seenRef.current ?? {};
|
|
144
|
+
const current = seenRef.current ?? EMPTY_SEEN;
|
|
94
145
|
let changed = false;
|
|
95
146
|
const next = { ...current };
|
|
96
147
|
for (const item of store.threads) {
|
|
148
|
+
const parsedTs = item.updatedAt ? Date.parse(item.updatedAt) : Number.NaN;
|
|
149
|
+
const itemTs = Number.isFinite(parsedTs) && parsedTs > 0 ? parsedTs : 1;
|
|
97
150
|
if (item.id === thread) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if ((next[item.id] ?? 0) < target) {
|
|
101
|
-
next[item.id] = target;
|
|
151
|
+
if ((next[item.id] ?? 0) < itemTs) {
|
|
152
|
+
next[item.id] = itemTs;
|
|
102
153
|
changed = true;
|
|
103
154
|
}
|
|
104
155
|
}
|
|
105
156
|
else if (next[item.id] === undefined) {
|
|
106
|
-
|
|
107
|
-
next[item.id] = Number.isFinite(ts) ? ts : now;
|
|
157
|
+
next[item.id] = itemTs;
|
|
108
158
|
changed = true;
|
|
109
159
|
}
|
|
110
160
|
}
|
|
@@ -204,7 +254,8 @@ function Runs({ host, view, keep, onOpen }) {
|
|
|
204
254
|
return true;
|
|
205
255
|
},
|
|
206
256
|
}), [host]);
|
|
207
|
-
|
|
257
|
+
const runHref = (id) => new URL(site(app(id)), window.location.href).href;
|
|
258
|
+
return (_jsx(List, { mode: "dev", rows: rows, view: view, keep: keep, open: (row) => row.id === run, reading: store.loading && !store.value.length, error: store.error, onOpen: onOpen, threads: byId, held: run, onNew: () => host.go(''), customActions: devActions, hrefOf: runHref }));
|
|
208
259
|
}
|
|
209
260
|
function List({ mode, rows, view, keep, open, reading, error, onOpen, threads, held = null, onNew, customActions, hrefOf, unreadIds, }) {
|
|
210
261
|
const { t } = useI18n();
|
|
@@ -223,45 +274,47 @@ function List({ mode, rows, view, keep, open, reading, error, onOpen, threads, h
|
|
|
223
274
|
const one = threads?.get(r.id);
|
|
224
275
|
const isUnread = Boolean(r.kind === 'chat' && !open(r) && unreadIds?.has(r.id));
|
|
225
276
|
const age = ago(r.at, new Date(), t);
|
|
226
|
-
const when = age ? (_jsx(SizableText, { "data-slot": "row-age",
|
|
277
|
+
const when = age ? (_jsx(SizableText, { "data-slot": "row-age", size: "$1", color: "var(--muted-foreground)", children: age })) : null;
|
|
227
278
|
// A Design conversation's dot is there while it works or when it failed; at rest it wears its age alone.
|
|
228
279
|
const settled = r.kind === 'design' && r.status === 'done';
|
|
229
280
|
const rowAside = r.kind === 'design' ? (_jsxs(XStack, { items: "center", gap: "$1.5", children: [when, settled ? null : _jsx(StatusDot, { status: DOTS[r.status] ?? 'idle' })] })) : r.kind === 'dev' ? (_jsxs(XStack, { items: "center", gap: "$1.5", children: [when, r.pr ? _jsx(GitPullRequest, { size: 13, color: "var(--state-success)", "aria-hidden": true }) : null, _jsx(StatusDot, { status: DOTS[r.status] ?? 'idle' })] })) : isUnread || when ? (_jsxs(XStack, { items: "center", gap: "$1.5", children: [when, isUnread ? (_jsx(XStack, { "data-slot": "thread-unread-dot", width: 6, height: 6, rounded: 999, bg: "var(--foreground)", "aria-hidden": true })) : null] })) : undefined;
|
|
230
|
-
const item = (_jsx(SidebarItem, { "data-kind": r.kind, active: open(r), rounded: 8, minH: 29,
|
|
281
|
+
const item = (_jsx(SidebarItem, { "data-kind": r.kind, active: open(r), rounded: 8, minH: 29, minW: 0, width: "100%", overflow: "hidden", pl: "$2", pr: one || rowAside ? 68 : '$2', focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)', outlineOffset: -2 },
|
|
231
282
|
// A thumb's 44 on a touch screen; a conversation's ⋯ is a thumb wide there and always there: the title stops short of it.
|
|
232
|
-
$touchable: one ? { minH: 44,
|
|
283
|
+
$touchable: one ? { minH: 44, pr: 68 } : { minH: 44 }, "$max-sm": one ? { minH: 44, pr: 68 } : { minH: 44 }, onKeyDown: (e) => {
|
|
233
284
|
if (e.key !== 'Enter' && e.key !== ' ')
|
|
234
285
|
return;
|
|
235
286
|
e.preventDefault?.();
|
|
236
287
|
onOpen(r);
|
|
237
|
-
}, onPress: () => onOpen(r), children:
|
|
288
|
+
}, onPress: () => onOpen(r), children: named(r.title) }));
|
|
238
289
|
if (one)
|
|
239
290
|
return (_jsx(ThreadRow, { t: one, active: open(r), aside: rowAside, children: item }, r.id));
|
|
240
291
|
return (_jsxs(YStack, { role: "listitem", position: "relative", children: [item, rowAside ? (_jsx(XStack, { position: "absolute", insetInlineEnd: "$2.5", t: 0, b: 0, items: "center", pointerEvents: "none", children: rowAside })) : null] }, r.id));
|
|
241
292
|
};
|
|
242
293
|
// The view menu stands at the end of the Recents heading: the target's own, quiet until the pointer is near.
|
|
243
|
-
const menu = (_jsx(DropdownMenu, { minWidth: 200, trigger: _jsx(XStack, { render: "button", "aria-label": t('Recents view'), width: 26, height: 26, rounded: "$2", items: "center", justify: "center", cursor: "pointer", opacity: narrowed ? 1 : 0, "$group-hover": { opacity: 1 }, focusStyle: { opacity: 1 }, $touchable: { opacity: 1 }, hoverStyle: { bg: '$hover' }, bg: narrowed ? '$
|
|
244
|
-
/** A section's heading: quiet
|
|
245
|
-
const heading = (title, id, lead = false) => (_jsxs(XStack, { group: true, items: "center", justify: "space-between",
|
|
294
|
+
const menu = (_jsx(DropdownMenu, { minWidth: 200, trigger: _jsx(XStack, { render: "button", "aria-label": t('Recents view'), width: 26, height: 26, rounded: "$2", items: "center", justify: "center", cursor: "pointer", opacity: narrowed ? 1 : 0, "$group-hover": { opacity: 1 }, focusStyle: { opacity: 1 }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, $touchable: { opacity: 1, minW: 44, minH: 44 }, "$max-sm": { opacity: 1, minW: 44, minH: 44 }, borderWidth: 1, borderColor: narrowed ? 'var(--border-strong)' : 'transparent', transition: "quickest", hoverStyle: { bg: '$hover', borderColor: 'var(--border-strong)' }, bg: narrowed ? '$raised' : 'transparent', children: _jsx(ListFilter, { size: 14, color: narrowed ? 'var(--foreground)' : 'var(--muted-foreground)', "aria-hidden": true }) }), items: items(mode, view, keep, t, Boolean(threads)) }));
|
|
295
|
+
/** A section's heading: quiet label, the Recents one carrying the count and the menu. */
|
|
296
|
+
const heading = (title, id, lead = false) => (_jsxs(XStack, { group: true, items: "center", justify: "space-between", minH: 26, paddingInlineStart: "$2", paddingInlineEnd: "$1", mt: "$2.5", shrink: 0, children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(SizableText, { id: id, size: "$1", fontWeight: "500", color: "var(--muted-foreground)", children: title }), lead && running ? (_jsx(XStack, { "aria-label": t('{n} running', { n: running }), minW: 18, height: 18, px: "$1.5", rounded: 999, items: "center", justify: "center", bg: "$edge", borderWidth: 1, borderColor: "$borderColor", children: _jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", "aria-hidden": true, "data-i18n-ltr": true, children: String(running) }) })) : null] }), _jsxs(XStack, { items: "center", gap: 2, children: [lead && threads && rows.length > 0 ? (_jsx(XStack, { render: "button", "aria-label": t('Select multiple'), ...{ title: t('Select multiple') }, width: 26, height: 26, rounded: "$2", items: "center", justify: "center", cursor: "pointer", opacity: 0, "$group-hover": { opacity: 1 }, focusStyle: { opacity: 1 }, focusVisibleStyle: { opacity: 1, outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, $touchable: { opacity: 1, minW: 44, minH: 44 }, "$max-sm": { opacity: 1, minW: 44, minH: 44 }, borderWidth: 1, borderColor: "transparent", transition: "quickest", hoverStyle: { bg: '$hover', borderColor: 'var(--border-strong)' }, onClick: () => {
|
|
246
297
|
if (typeof window !== 'undefined')
|
|
247
298
|
window.dispatchEvent(new CustomEvent('hanzo:recents-select'));
|
|
248
|
-
}, children: _jsx(CheckSquare, { size: 13, "aria-hidden": true }) })) : null, lead ? menu : null] })] }));
|
|
299
|
+
}, children: _jsx(CheckSquare, { size: 13, color: "var(--muted-foreground)", "aria-hidden": true }) })) : null, lead ? menu : null] })] }));
|
|
249
300
|
const loose = groups.filter((g) => g.title !== PINNED);
|
|
250
301
|
const pinned = groups.find((g) => g.title === PINNED);
|
|
251
302
|
const note = reading ? (_jsx(Note, { children: t(mode === 'chat' ? 'Reading your chats…' : 'Reading your runs…') })) : error ? null : view.status === 'archived' ? (_jsx(Note, { children: t('No archived chats.') })) : narrowed ? (_jsx(Note, { children: t('Nothing in this view.') })) : (_jsx(Note, { children: t(mode === 'chat' ? 'No chats yet.' : mode === 'design' ? 'Nothing made yet.' : 'No runs yet.') }));
|
|
252
303
|
// Each list of conversations holds its own menu (thread.tsx): the view menu
|
|
253
304
|
// in the Recents heading between them is a menu of its own, never inside one.
|
|
254
|
-
const menus = (rows, primary = true) => threads ? (_jsx(ConversationMenu, { threads: threads, active: held, onGone: onNew, customActions: customActions, hrefOf: hrefOf, primary: primary, children: _jsx(YStack, { children: rows }) })) : (rows);
|
|
305
|
+
const menus = (rows, primary = true) => threads ? (_jsx(ConversationMenu, { threads: threads, active: held, onGone: onNew, customActions: customActions, canShare: mode === 'chat', hrefOf: hrefOf, primary: primary, children: _jsx(YStack, { children: rows }) })) : (rows);
|
|
255
306
|
const rest = loose.length
|
|
256
307
|
? loose.map((g) => {
|
|
257
308
|
if (!g.title) {
|
|
258
309
|
return (_jsx(YStack, { role: "list", "aria-label": t('All'), gap: 1, children: g.rows.map(row) }, "all"));
|
|
259
310
|
}
|
|
260
311
|
const isShut = Boolean(collapsedGroups[g.title]);
|
|
261
|
-
return (_jsxs(YStack, { gap: 1, pt: "$1", children: [_jsxs(XStack, { render: "button", "aria-expanded": !isShut,
|
|
312
|
+
return (_jsxs(YStack, { gap: 1, pt: "$1", children: [_jsxs(XStack, { render: "button", "aria-expanded": !isShut, onClick: () => setCollapsedGroups((prev) => ({ ...prev, [g.title]: !prev[g.title] })), items: "center", gap: "$1", px: "$2", py: "$0.5", rounded: "$2", cursor: "pointer", transition: "quickest", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, self: "flex-start", children: [_jsx(SizableText, { size: "$1", color: "$soft", children: head(g.title) }), isShut ? _jsx(ChevronRight, { size: 11, color: "var(--muted-foreground)", "aria-hidden": true }) : _jsx(ChevronDown, { size: 11, color: "var(--muted-foreground)", "aria-hidden": true })] }), isShut ? null : (_jsx(YStack, { role: "list", "aria-label": head(g.title), gap: 1, children: g.rows.map(row) }))] }, g.title));
|
|
262
313
|
})
|
|
263
314
|
: pinned
|
|
264
315
|
? null
|
|
265
316
|
: note;
|
|
266
|
-
return (_jsx(YStack, { "data-slot": "recents", flex: 1, minH: 0, children: _jsxs(ScrollView, { flex: 1, showsVerticalScrollIndicator: false, ...{ overscrollBehavior: 'contain' }, children: [error ? _jsx(Note, { children: error.message }) : null, _jsxs(YStack, { role: "list", "aria-labelledby": label, gap: 1, children: [pinned ? (_jsxs(YStack, { role: "listitem", gap: 1, children: [
|
|
317
|
+
return (_jsx(YStack, { "data-slot": "recents", flex: 1, minH: 0, children: _jsxs(ScrollView, { flex: 1, showsVerticalScrollIndicator: false, ...{ overscrollBehavior: 'contain' }, children: [error ? _jsx(Note, { children: error.message }) : null, _jsxs(YStack, { role: "list", "aria-labelledby": label, gap: 1, children: [pinned ? (_jsxs(YStack, { role: "listitem", gap: 1, children: [_jsxs(XStack, { render: "button", "data-slot": "pinned-group-toggle", "aria-expanded": !collapsedGroups[PINNED], onClick: () => setCollapsedGroups((prev) => ({ ...prev, [PINNED]: !prev[PINNED] })), items: "center", justify: "space-between", minH: 26, px: "$2", mt: "$2.5", rounded: "$2", cursor: "pointer", transition: "quickest", hoverStyle: { bg: '$hover' }, focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)' }, "$max-sm": { minH: 44 }, children: [_jsxs(XStack, { items: "center", gap: "$1.5", children: [_jsx(SizableText, { size: "$1", fontWeight: "500", color: "var(--muted-foreground)", children: t(PINNED) }), _jsx(SizableText, { size: "$1", color: "$hint", "aria-hidden": true, "data-i18n-ltr": true, children: String(pinned.rows.length) })] }), collapsedGroups[PINNED] ? (_jsx(ChevronRight, { size: 12, color: "var(--muted-foreground)", "aria-hidden": true })) : (_jsx(ChevronDown, { size: 12, color: "var(--muted-foreground)", "aria-hidden": true }))] }), collapsedGroups[PINNED]
|
|
318
|
+
? null
|
|
319
|
+
: menus(_jsx(YStack, { role: "list", "aria-label": t(PINNED), gap: 1, children: pinned.rows.map(row) }), !loose.length)] })) : null, _jsxs(YStack, { role: "listitem", gap: 1, children: [heading(t('Recents'), label, true), menus(rest, true)] })] })] }) }));
|
|
267
320
|
}
|
package/dist/RightPane.js
CHANGED
|
@@ -221,7 +221,7 @@ export function useSections({ at, said, held, deck, onCreate }) {
|
|
|
221
221
|
{
|
|
222
222
|
id: 'outputs',
|
|
223
223
|
title: t('Outputs'),
|
|
224
|
-
action: (_jsx(Box, { render: "button", "aria-label": t('Create a file or site'),
|
|
224
|
+
action: (_jsx(Box, { render: _jsx("button", { type: "button" }), "aria-label": t('Create a file or site'), onClick: onCreate, p: "$1", rounded: "$2", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: _jsx(Plus, { size: 16, "aria-hidden": true }) })),
|
|
225
225
|
lead: { title: t('Create a file or site'), run: onCreate },
|
|
226
226
|
entries: made.map(row),
|
|
227
227
|
},
|
|
@@ -253,7 +253,7 @@ export function OutputsCard({ sections, label, onOpen, onClose, }) {
|
|
|
253
253
|
window.addEventListener('keydown', onKeyDown);
|
|
254
254
|
return () => window.removeEventListener('keydown', onKeyDown);
|
|
255
255
|
}, [onClose]);
|
|
256
|
-
return (_jsx(YStack, { "data-slot": "summary", role: "complementary", "aria-label": label, width: 268, shrink: 0, self: "flex-start", mt: 12, marginInlineEnd: 12, rounded: 12, borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", bg: "var(--side-fill, var(--card))", overflow: "hidden", children: sections.map((s, i) => (_jsxs(YStack, { px: 12, py: 10, gap: 2, borderTopWidth: i ? 1 : 0, borderColor: "var(--pane-edge, var(--border))", children: [_jsxs(XStack, { items: "center", justify: "space-between", minH: 26, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: s.title }), s.action] }), s.lead ? (_jsx(XStack, { render: "button",
|
|
256
|
+
return (_jsx(YStack, { "data-slot": "summary", role: "complementary", "aria-label": label, width: 268, shrink: 0, self: "flex-start", mt: 12, marginInlineEnd: 12, rounded: 12, borderWidth: 1, borderColor: "var(--pane-edge, var(--border))", bg: "var(--side-fill, var(--card))", overflow: "hidden", children: sections.map((s, i) => (_jsxs(YStack, { px: 12, py: 10, gap: 2, borderTopWidth: i ? 1 : 0, borderColor: "var(--pane-edge, var(--border))", children: [_jsxs(XStack, { items: "center", justify: "space-between", minH: 26, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", children: s.title }), s.action] }), s.lead ? (_jsx(XStack, { render: _jsx("button", { type: "button" }), onClick: s.lead.run, items: "center", minH: 28, px: 6, mx: -6, rounded: "$2", borderWidth: 0, bg: "transparent", cursor: "pointer", hoverStyle: { bg: '$hover' }, children: _jsx(Text, { fontSize: "$2", color: "var(--text-secondary, var(--muted-foreground))", numberOfLines: 1, children: s.lead.title }) })) : null, s.entries.map((e) => (_jsxs(XStack, { render: _jsx("button", { type: "button" }), onClick: e.open
|
|
257
257
|
? () => {
|
|
258
258
|
onOpen?.();
|
|
259
259
|
e.open?.();
|
package/dist/Search.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type Say } from '@hanzo/i18n';
|
|
3
3
|
import { type Host } from '@hanzo/build';
|
|
4
|
-
import {
|
|
4
|
+
import type { ShortcutKeys } from '@hanzo/ui';
|
|
5
5
|
import { type Place } from './lib/host.js';
|
|
6
6
|
import { type Hit } from './seek.js';
|
|
7
|
+
export interface RecentJump {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
where?: string;
|
|
11
|
+
at: number;
|
|
12
|
+
}
|
|
13
|
+
/** The jumps after this one: it goes first, once, and only the last few are kept. */
|
|
14
|
+
export declare function recorded(prev: RecentJump[], item: {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
where?: string;
|
|
18
|
+
}, at: number): RecentJump[];
|
|
7
19
|
/** A row: what it is called (in the reader's words), its glyph, where it lives, and what pressing it does. */
|
|
8
20
|
export interface Action extends Hit {
|
|
9
21
|
icon?: ReactNode;
|