@hanzo/app 0.2.50 → 0.2.51
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/assets/memoji/art.svg +22 -0
- package/assets/memoji/cyber.svg +22 -0
- package/assets/memoji/data.svg +22 -0
- package/assets/memoji/des.svg +22 -0
- package/assets/memoji/dev.svg +22 -0
- package/assets/memoji/doc.svg +22 -0
- package/assets/memoji/edu.svg +22 -0
- package/assets/memoji/fin.svg +22 -0
- package/assets/memoji/gov.svg +22 -0
- package/assets/memoji/huma.svg +22 -0
- package/assets/memoji/lang.svg +22 -0
- package/assets/memoji/law.svg +22 -0
- package/assets/memoji/mana.svg +22 -0
- package/assets/memoji/mark.svg +22 -0
- package/assets/memoji/mu.svg +22 -0
- package/assets/memoji/opera.svg +22 -0
- package/assets/memoji/rev.svg +22 -0
- package/assets/memoji/sal.svg +22 -0
- package/assets/memoji/sci.svg +22 -0
- package/assets/memoji/su.svg +22 -0
- package/assets/memoji/vi.svg +22 -0
- package/dist/Chat.js +1 -1
- package/dist/TeamPreview.d.ts +3 -3
- package/dist/TeamPreview.js +230 -167
- package/dist/bots/Bots.js +1 -1
- package/dist/workday.d.ts +199 -0
- package/dist/workday.js +561 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256" role="img" aria-label="vi">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="g-vi" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#a5b4fc"/><stop offset="1" stop-color="#4338ca"/></linearGradient>
|
|
4
|
+
<radialGradient id="f-vi" cx=".36" cy=".3" r=".8"><stop offset="0" stop-color="#e0a27d"/><stop offset="1" stop-color="#b2744f"/></radialGradient>
|
|
5
|
+
<clipPath id="c-vi"><circle cx="128" cy="128" r="128"/></clipPath>
|
|
6
|
+
</defs>
|
|
7
|
+
<g clip-path="url(#c-vi)">
|
|
8
|
+
<rect width="256" height="256" fill="url(#g-vi)"/>
|
|
9
|
+
<circle cx="84" cy="64" r="70" fill="#fff" opacity=".13"/>
|
|
10
|
+
<path d="M26 256 C30 214 66 196 128 196 C190 196 226 214 230 256 Z" fill="#4338ca"/><path d="M26 256 C30 214 66 196 128 196 C100 214 96 240 98 256 Z" fill="#554adc" opacity=".5"/><path d="M104 196 L128 226 L152 196 Z" fill="#e0e7ff"/><path d="M120 214 L136 214 L142 252 L128 262 L114 252 Z" fill="#ef4444"/><path d="M120 206 L136 206 L132 216 L124 216 Z" fill="#dc2626"/><circle cx="182" cy="226" r="16" fill="#f8fafc"/><g transform="translate(172 216) scale(.83)" fill="none" stroke="#3730a3" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3l2 7 7 2-7 2-2 7-2-7-7-2 7-2z"/></g>
|
|
11
|
+
<rect x="110" y="168" width="36" height="36" rx="14" fill="#ad6f4a"/>
|
|
12
|
+
<ellipse cx="68" cy="128" rx="9" ry="13" fill="#bc7e59"/><ellipse cx="188" cy="128" rx="9" ry="13" fill="#bc7e59"/>
|
|
13
|
+
<ellipse cx="128" cy="120" rx="58" ry="62" fill="url(#f-vi)"/>
|
|
14
|
+
<path d="M70 116 C64 68 96 44 132 46 C168 48 192 70 186 116 C180 98 168 84 150 80 C130 92 96 90 70 116 Z" fill="#111827"/><path d="M96 66 C118 56 146 56 168 70" stroke="#252c3b" stroke-width="5" stroke-linecap="round" fill="none"/>
|
|
15
|
+
<g stroke="#19202f" stroke-width="5" stroke-linecap="round" fill="none"><path d="M90 106 Q104 98 118 104"/><path d="M138 104 Q152 98 166 106"/></g>
|
|
16
|
+
<g fill="#1f2937"><ellipse cx="104" cy="126" rx="7.5" ry="9"/><ellipse cx="152" cy="126" rx="7.5" ry="9"/></g><g fill="#fff"><circle cx="107" cy="122" r="2.8"/><circle cx="155" cy="122" r="2.8"/></g>
|
|
17
|
+
<ellipse cx="88" cy="146" rx="11" ry="7" fill="#f87171" opacity=".28"/><ellipse cx="168" cy="146" rx="11" ry="7" fill="#f87171" opacity=".28"/>
|
|
18
|
+
<path d="M126 134 Q132 140 126 144" stroke="#935530" stroke-width="3.5" fill="none" stroke-linecap="round" opacity=".7"/>
|
|
19
|
+
<path d="M110 154 Q128 172 146 154" stroke="#7c2d12" stroke-width="5" fill="#fff" stroke-linecap="round" stroke-linejoin="round"/>
|
|
20
|
+
|
|
21
|
+
</g>
|
|
22
|
+
</svg>
|
package/dist/Chat.js
CHANGED
|
@@ -777,7 +777,7 @@ function Thread({ placeholder = message(), initial, anonymous = false, heading,
|
|
|
777
777
|
// `kept` changing: when the reader opens another Recent, `open` moves first and
|
|
778
778
|
// `kept` follows it a render later (the hook takes `thread` in an effect), and
|
|
779
779
|
// reopening the stale `kept` then sent the two chasing each other until React
|
|
780
|
-
// stopped the page (
|
|
780
|
+
// stopped the page (React error 185).
|
|
781
781
|
const minted = useRef(kept);
|
|
782
782
|
useEffect(() => {
|
|
783
783
|
if (kept === minted.current)
|
package/dist/TeamPreview.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type PreviewProps } from './preview.js';
|
|
2
2
|
/**
|
|
3
|
-
* Hanzo Team's workspace, playing. From
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Hanzo Team's workspace, playing. From 600px of its own width it is the
|
|
4
|
+
* desktop app (the rail, the workspace's column, the channel); narrower, or
|
|
5
|
+
* told `phone`, the phone app: the channel, with the rail and the column as a
|
|
6
6
|
* drawer. A host (the landing's hero) can pause it, hear when it ends, and fit
|
|
7
7
|
* it to a device's screen (`PreviewProps`).
|
|
8
8
|
*/
|
package/dist/TeamPreview.js
CHANGED
|
@@ -1,127 +1,41 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { AtSign, ChevronDown, Flame, Hash, Headphones, Heart, Image as Picture,
|
|
5
|
-
import { phrase } from '@hanzo/i18n';
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { AtSign, CalendarCheck, Check, ChevronDown, Eye, FileSpreadsheet, FileText, Flame, GitMerge, GitPullRequest, Hash, Headphones, Heart, Image as Picture, Laugh, Mail, Menu, Mic, PartyPopper, Plus, Presentation, Rocket, Search, SendHorizontal, Smile, SquarePen, ThumbsUp, X, } from 'lucide-react';
|
|
6
5
|
import { useI18n } from '@hanzo/i18n/react';
|
|
7
|
-
import { Text, View, XStack, YStack } from '@hanzo/ui';
|
|
6
|
+
import { Avatar as Monogram, Text, View, XStack, YStack } from '@hanzo/ui';
|
|
8
7
|
import { Face } from './cast.js';
|
|
9
|
-
import { md,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
import { md, useHost, usePlay, useStage, useStill } from './preview.js';
|
|
9
|
+
import { DAY, HOME, ORGS, SCENE, STILL, agent, channelOf, frame, orgOf, pace, who } from './workday.js';
|
|
10
|
+
/**
|
|
11
|
+
* Hanzo Team, playing: a working day in the workspace, laid out the way a team
|
|
12
|
+
* chat is read. hanzo.team's landing and hanzo.ai's /team open on it, and
|
|
13
|
+
* hanzo.ai's hero plays it in its cycle; one component for every host.
|
|
14
|
+
*
|
|
15
|
+
* Far left, the organizations a person belongs to (one active, "+" under them,
|
|
16
|
+
* the reader at the foot); then the workspace's column: its name, Channels
|
|
17
|
+
* (bold and counted when unread), Direct messages with who is here, and the
|
|
18
|
+
* org's Agents; then the channel: its name and topic, who is in it, the huddle,
|
|
19
|
+
* the messages with their cards, reactions and threads, who is typing, and the
|
|
20
|
+
* composer. A thread opens beside the channel when there is room, over it when
|
|
21
|
+
* not.
|
|
22
|
+
*
|
|
23
|
+
* The day is `./workday`: more than five minutes of people and agents working
|
|
24
|
+
* together before it plays again. It plays while on screen and the pointer is
|
|
25
|
+
* elsewhere. Pressing an org or a channel plays that room's own scene, an
|
|
26
|
+
* agent's question or a draft answers a press, and from then on the reader
|
|
27
|
+
* drives: nothing loops over them. A reader who asked for less motion, the
|
|
28
|
+
* server and the first paint get one whole frame: #eng with the pull request
|
|
29
|
+
* merged.
|
|
30
|
+
*
|
|
31
|
+
* People wear their initials (`Face`, as the app draws a person with no
|
|
32
|
+
* picture); agents wear the crew's memoji, `/memoji/<id>.svg`, from this
|
|
33
|
+
* package's assets. The chrome is monochrome; the faces carry the colour.
|
|
34
|
+
*/
|
|
21
35
|
/** A reaction's mark: monochrome, as the rest of the chrome. */
|
|
22
|
-
const MARKS = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
id: 'acme',
|
|
26
|
-
name: 'Acme',
|
|
27
|
-
mark: 'A',
|
|
28
|
-
channels: [
|
|
29
|
-
{ id: 'general', topic: phrase('Everything Acme') },
|
|
30
|
-
{ id: 'launch', topic: phrase('Shipping the pricing page this week') },
|
|
31
|
-
{ id: 'design', topic: phrase('Screens, mocks and taste'), unread: 2 },
|
|
32
|
-
],
|
|
33
|
-
people: ['zoe', 'sam', 'ada'],
|
|
34
|
-
agents: ['des', 'dev'],
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
id: 'friday',
|
|
38
|
-
name: 'Friday Club',
|
|
39
|
-
mark: 'F',
|
|
40
|
-
channels: [
|
|
41
|
-
{ id: 'side-project', topic: phrase('Building a recipe app, for fun') },
|
|
42
|
-
{ id: 'game-night', topic: phrase('Who is in this week'), unread: 5 },
|
|
43
|
-
],
|
|
44
|
-
people: ['mina', 'theo', 'ada'],
|
|
45
|
-
agents: ['maya', 'vi'],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: 'lab',
|
|
49
|
-
name: 'Night Lab',
|
|
50
|
-
mark: 'N',
|
|
51
|
-
channels: [
|
|
52
|
-
{ id: 'general', topic: phrase('Late ideas, early prototypes') },
|
|
53
|
-
{ id: 'ideas', topic: phrase('Half-baked, on purpose'), unread: 1 },
|
|
54
|
-
],
|
|
55
|
-
people: ['theo', 'zoe'],
|
|
56
|
-
agents: ['vi', 'dev'],
|
|
57
|
-
},
|
|
58
|
-
];
|
|
59
|
-
const org = (id) => ORGS.find((o) => o.id === id) ?? ORGS[0];
|
|
60
|
-
/** The channel each org opens on. */
|
|
61
|
-
const HOME = { acme: 'launch', friday: 'side-project', lab: 'general' };
|
|
62
|
-
const ACME = [
|
|
63
|
-
{ kind: 'say', who: 'zoe', text: phrase('Pricing page is on the preview link. Tear it apart.'), replies: 3, wait: 600 },
|
|
64
|
-
{ kind: 'say', who: 'sam', text: phrase('Love it. @des can the plan cards line up?'), wait: 1500 },
|
|
65
|
-
{ kind: 'typing', who: 'des', wait: 1200 },
|
|
66
|
-
{ kind: 'say', who: 'des', text: phrase('Done. Every price sits on one baseline now.'), file: 'plan-cards.png', wait: 1100 },
|
|
67
|
-
{ kind: 'react', mark: 'flame', count: 3, wait: 1300 },
|
|
68
|
-
{ kind: 'say', who: 'ada', text: phrase('@dev ship it when the checks pass.'), wait: 1300 },
|
|
69
|
-
{ kind: 'typing', who: 'dev', wait: 1200 },
|
|
70
|
-
{ kind: 'say', who: 'dev', text: phrase('Checks passed. It is live.'), wait: 1000 },
|
|
71
|
-
{ kind: 'react', mark: 'thumbs', count: 4, wait: 1000 },
|
|
72
|
-
];
|
|
73
|
-
const FRIDAY = [
|
|
74
|
-
{ kind: 'say', who: 'mina', text: phrase('Who is in for the recipe app tonight?'), wait: 700 },
|
|
75
|
-
{ kind: 'say', who: 'theo', text: phrase('In. @maya can you set up the board?'), wait: 1400 },
|
|
76
|
-
{ kind: 'typing', who: 'maya', wait: 1200 },
|
|
77
|
-
{ kind: 'say', who: 'maya', text: phrase('Board is ready: sign-in, recipes and search, a card each.'), wait: 1000 },
|
|
78
|
-
{ kind: 'react', mark: 'heart', count: 5, wait: 1100 },
|
|
79
|
-
{ kind: 'say', who: 'ada', text: phrase('Bringing snacks.'), replies: 2, wait: 1300 },
|
|
80
|
-
];
|
|
81
|
-
/** What each room says when it is opened by hand. */
|
|
82
|
-
const ROOMS = {
|
|
83
|
-
'acme/launch': ACME,
|
|
84
|
-
'acme/general': [
|
|
85
|
-
{ kind: 'say', who: 'ada', text: phrase('Standup moved to 10 today.'), wait: 300 },
|
|
86
|
-
{ kind: 'say', who: 'zoe', text: phrase('Works for me.'), wait: 900 },
|
|
87
|
-
{ kind: 'react', mark: 'thumbs', count: 2, wait: 800 },
|
|
88
|
-
],
|
|
89
|
-
'acme/design': [
|
|
90
|
-
{ kind: 'say', who: 'sam', text: phrase('@des a darker hover on the cards?'), wait: 300 },
|
|
91
|
-
{ kind: 'typing', who: 'des', wait: 800 },
|
|
92
|
-
{ kind: 'say', who: 'des', text: phrase('Tried it. The mock is in Drive, side by side with the old one.'), file: 'hover.png', wait: 1000 },
|
|
93
|
-
],
|
|
94
|
-
'friday/side-project': FRIDAY,
|
|
95
|
-
'friday/game-night': [
|
|
96
|
-
{ kind: 'say', who: 'theo', text: phrase('Game night Thursday?'), wait: 300 },
|
|
97
|
-
{ kind: 'say', who: 'mina', text: phrase('Yes. @vi can you find a time that works for all of us?'), wait: 1000 },
|
|
98
|
-
{ kind: 'typing', who: 'vi', wait: 800 },
|
|
99
|
-
{ kind: 'say', who: 'vi', text: phrase('Thursday at 8 works for everyone. It is on your calendars.'), wait: 1000 },
|
|
100
|
-
],
|
|
101
|
-
'lab/general': [
|
|
102
|
-
{ kind: 'say', who: 'zoe', text: phrase('What if the app planned the week for you?'), wait: 300 },
|
|
103
|
-
{ kind: 'typing', who: 'dev', wait: 800 },
|
|
104
|
-
{ kind: 'say', who: 'dev', text: phrase('I can have a first version running by morning.'), wait: 1000 },
|
|
105
|
-
{ kind: 'react', mark: 'flame', count: 2, wait: 900 },
|
|
106
|
-
],
|
|
107
|
-
'lab/ideas': [
|
|
108
|
-
{ kind: 'say', who: 'theo', text: phrase('A bot that waters the plants.'), wait: 300 },
|
|
109
|
-
{ kind: 'say', who: 'zoe', text: phrase('Filed under someday.'), wait: 1000 },
|
|
110
|
-
],
|
|
111
|
-
};
|
|
112
|
-
/** The whole script: Acme's launch, then the switch to Friday Club. */
|
|
113
|
-
const SCRIPT = [...ACME, { kind: 'org', org: 'friday', wait: 2600 }, ...FRIDAY, { kind: 'rest', wait: 2600 }];
|
|
114
|
-
/** A reaction under a message: its mark and how many. */
|
|
115
|
-
function Reaction({ mark, count }) {
|
|
116
|
-
const Mark = MARKS[mark] ?? Heart;
|
|
117
|
-
return (_jsxs(XStack, { "data-motion": "rise", items: "center", gap: 4, px: 8, py: 2, rounded: 9999, borderWidth: 1, borderColor: "$ink", bg: "$hover", "$platform-web": { borderRadius: '9999px' }, children: [_jsx(Mark, { size: 12, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$ink", "data-i18n-ltr": true, children: count })] }));
|
|
118
|
-
}
|
|
119
|
-
/** One message: the face, the name (an agent tagged), the words, a file, its reactions and its thread. */
|
|
120
|
-
function Message({ who, file, replies, reactions, children }) {
|
|
121
|
-
const { t } = useI18n();
|
|
122
|
-
const w = WHO[who];
|
|
123
|
-
return (_jsxs(XStack, { "data-motion": "rise", gap: 10, items: "flex-start", children: [_jsx(Face, { name: w.name, size: 32, person: !w.agent }), _jsxs(YStack, { flex: 1, minW: 0, gap: 4, children: [_jsxs(XStack, { items: "center", gap: 6, children: [_jsx(Text, { fontSize: "$2", fontWeight: "700", color: "$ink", numberOfLines: 1, children: w.name }), w.agent ? (_jsx(Text, { fontSize: 10, lineHeight: 14, px: 6, rounded: 6, bg: "$hover", color: "$soft", "$platform-web": { borderRadius: '6px' }, children: t('Agent') })) : null] }), _jsx(Text, { fontSize: "$2", lineHeight: "$3", color: "$ink", children: children }), file ? (_jsxs(XStack, { self: "flex-start", items: "center", gap: 8, mt: 2, px: 10, py: 8, rounded: 10, borderWidth: 1, borderColor: "$edge", bg: "$panel", "$platform-web": { borderRadius: '10px' }, children: [_jsx(XStack, { width: 34, height: 26, rounded: 6, items: "center", justify: "center", bg: "$raised", "$platform-web": { borderRadius: '6px' }, children: _jsx(Picture, { size: 14, color: "var(--muted-foreground)", "aria-hidden": true }) }), _jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "$soft", "data-i18n-ltr": true, children: file })] })) : null, reactions.length ? (_jsx(XStack, { gap: 6, mt: 2, children: reactions.map((r, i) => (_jsx(Reaction, { mark: r.mark, count: r.count }, i))) })) : null, replies ? (_jsxs(XStack, { items: "center", gap: 6, mt: 2, children: [_jsx(MessageSquareText, { size: 13, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", children: t('{count} replies', { count: replies }) })] })) : null] })] }));
|
|
124
|
-
}
|
|
36
|
+
const MARKS = { thumbs: ThumbsUp, heart: Heart, flame: Flame, rocket: Rocket, eyes: Eye, laugh: Laugh, party: PartyPopper, check: Check };
|
|
37
|
+
/** A file's mark, by what it is. */
|
|
38
|
+
const FILES = { doc: FileText, deck: Presentation, sheet: FileSpreadsheet, image: Picture };
|
|
125
39
|
/** A button drawn as one of the workspace's rows: the press, the hover, the focus ring. */
|
|
126
40
|
const ROW = {
|
|
127
41
|
borderWidth: 0,
|
|
@@ -129,79 +43,228 @@ const ROW = {
|
|
|
129
43
|
hoverStyle: { bg: '$hover' },
|
|
130
44
|
focusVisibleStyle: { outlineWidth: 2, outlineStyle: 'solid', outlineColor: 'var(--ring)', outlineOffset: -2 },
|
|
131
45
|
};
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
46
|
+
/** The fade a list takes where it runs out of room. */
|
|
47
|
+
const TOP = { maskImage: 'linear-gradient(to bottom, transparent, black 48px)', WebkitMaskImage: 'linear-gradient(to bottom, transparent, black 48px)' };
|
|
48
|
+
const FOOT = { maskImage: 'linear-gradient(to bottom, black 82%, transparent)', WebkitMaskImage: 'linear-gradient(to bottom, black 82%, transparent)' };
|
|
49
|
+
/** The reader, at the rail's foot. */
|
|
50
|
+
const ME = 'ada';
|
|
51
|
+
/** How wide the preview must be to draw the workspace's column (below: the phone app). */
|
|
52
|
+
const DESK = 560;
|
|
53
|
+
/** The workspace's column: narrower while the preview is. */
|
|
54
|
+
const breadth = (width) => (width && width < 700 ? 176 : width && width < 820 ? 200 : 232);
|
|
55
|
+
/** How wide the preview must be for the channel's header to show who is in it. */
|
|
56
|
+
const FACES = 900;
|
|
57
|
+
/** "1 reply", "3 replies". */
|
|
58
|
+
const replies = (t, n) => (n === 1 ? t('1 reply') : t('{count} replies', { count: n }));
|
|
59
|
+
/** How wide it must be for a thread to stand beside the channel rather than over it. */
|
|
60
|
+
const ROOM = 1000;
|
|
61
|
+
/** A person's initials or an agent's memoji. */
|
|
62
|
+
function Avatar({ id, size }) {
|
|
63
|
+
if (!agent(id))
|
|
64
|
+
return _jsx(Face, { name: who(id).name, size: size, person: true });
|
|
65
|
+
return (_jsx(View, { render: _jsx("img", { src: `/memoji/${id}.svg`, alt: "", width: size, height: size, loading: "lazy", decoding: "async" }), width: size, height: size, shrink: 0, rounded: 9999, display: "block", "$platform-web": { borderRadius: '9999px' } }));
|
|
66
|
+
}
|
|
67
|
+
/** A dot that says someone is here now; hollow when away, pulsing while they work. */
|
|
68
|
+
function Here({ away, busy }) {
|
|
69
|
+
return (_jsx(View, { "data-motion": busy ? 'pulse' : undefined, width: 8, height: 8, shrink: 0, rounded: 9999, borderWidth: away ? 1.5 : 0, borderColor: "$soft", bg: away ? 'transparent' : 'var(--state-online)', "$platform-web": { borderRadius: '9999px' } }));
|
|
70
|
+
}
|
|
71
|
+
/** A line of a message with its mentions set apart: `@dev` reads as the agent's name. */
|
|
72
|
+
function Said({ text }) {
|
|
73
|
+
return (_jsx(_Fragment, { children: text.split(/(@[a-z]+)/).map((part, i) => /^@[a-z]+$/.test(part) ? (_jsx(Text, { render: "span", fontWeight: "600", color: "$ink", bg: "$raised", px: 3, rounded: 4, "$platform-web": { borderRadius: '4px' }, children: `@${who(part.slice(1)).name}` }, i)) : (part)) }));
|
|
74
|
+
}
|
|
75
|
+
/** The frame every card in a message stands in. */
|
|
76
|
+
function Frame({ children }) {
|
|
77
|
+
return (_jsx(YStack, { "data-motion": "rise", self: "flex-start", width: "100%", maxW: 420, mt: 4, gap: 8, p: 12, rounded: 12, borderWidth: 1, borderColor: "$edge", bg: "$panel", "$platform-web": { borderRadius: '12px' }, children: children }));
|
|
78
|
+
}
|
|
79
|
+
/** A small round state: a check once done, an empty ring before. */
|
|
80
|
+
function Tick({ done }) {
|
|
81
|
+
return (_jsx(XStack, { width: 16, height: 16, shrink: 0, rounded: 9999, items: "center", justify: "center", borderWidth: 1, borderColor: done ? '$ink' : '$edge', bg: done ? '$ink' : 'transparent', "$platform-web": { borderRadius: '9999px', transition: 'background-color 260ms ease, border-color 260ms ease' }, children: done ? _jsx(Check, { size: 10, strokeWidth: 3, color: "var(--background)", "aria-hidden": true }) : null }));
|
|
82
|
+
}
|
|
83
|
+
/** A pill-shaped control a card offers; inked once it is the answer. */
|
|
84
|
+
function Choice({ on, faded, label, onPress }) {
|
|
85
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button", "aria-pressed": on, onClick: onPress }), items: "center", gap: 6, px: 12, py: 5, rounded: 9999, borderWidth: 1, borderColor: on ? '$ink' : '$edge', bg: on ? '$ink' : 'transparent', opacity: faded ? 0.5 : 1, cursor: "pointer", hoverStyle: { borderColor: '$ink' }, focusVisibleStyle: ROW.focusVisibleStyle, "$platform-web": { borderRadius: '9999px', transition: 'background-color 240ms ease, border-color 240ms ease, opacity 240ms ease' }, children: [on ? _jsx(Check, { size: 12, color: "var(--background)", strokeWidth: 2.6, "aria-hidden": true }) : null, _jsx(Text, { fontSize: "$1", fontWeight: "500", color: on ? '$background' : '$ink', children: label })] }));
|
|
86
|
+
}
|
|
87
|
+
/** What a message carries: a pull request, a draft, a file, a meeting, a list, a question, design options. */
|
|
88
|
+
function Attachment({ card, onPick }) {
|
|
89
|
+
const { t } = useI18n();
|
|
90
|
+
switch (card.kind) {
|
|
91
|
+
case 'pr': {
|
|
92
|
+
const merged = card.state === 'merged';
|
|
93
|
+
const Mark = merged ? GitMerge : GitPullRequest;
|
|
94
|
+
const state = merged ? t('Merged') : card.state === 'passed' ? t('Checks passed') : t('Review requested');
|
|
95
|
+
return (_jsxs(Frame, { children: [_jsxs(XStack, { items: "center", gap: 8, children: [_jsx(Mark, { size: 15, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "$soft", "data-i18n-ltr": true, children: `${card.repo} #${card.number}` })] }), _jsx(Text, { fontSize: "$2", lineHeight: "$3", fontWeight: "600", color: "$ink", children: t(card.title) }), _jsxs(XStack, { items: "center", gap: 10, flexWrap: "wrap", children: [_jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "$soft", "data-i18n-ltr": true, children: `+${card.add} −${card.del}` }), _jsxs(XStack, { "data-motion": "rise", items: "center", gap: 5, px: 8, py: 2, rounded: 9999, borderWidth: 1, borderColor: card.state === 'review' ? '$edge' : '$ink', bg: merged ? '$ink' : 'transparent', "$platform-web": { borderRadius: '9999px' }, children: [card.state === 'review' ? null : _jsx(Check, { size: 11, strokeWidth: 3, color: merged ? 'var(--background)' : 'var(--foreground)', "aria-hidden": true }), _jsx(Text, { fontSize: 11, lineHeight: 16, fontWeight: "600", color: merged ? '$background' : '$ink', children: state })] }, card.state)] })] }));
|
|
96
|
+
}
|
|
97
|
+
case 'draft':
|
|
98
|
+
return (_jsxs(Frame, { children: [_jsxs(XStack, { items: "center", gap: 8, children: [_jsx(Mail, { size: 14, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$1", color: "$soft", numberOfLines: 1, children: t('To: {to}', { to: t(card.to) }) }), _jsx(Text, { fontSize: 11, fontWeight: "600", color: card.sent ? '$ink' : '$soft', children: card.sent ? t('Sent') : t('Draft') })] }), _jsx(Text, { "data-motion": "rise", fontSize: "$2", lineHeight: "$3", color: "$ink", children: t(card.body) }, card.body), card.sent ? null : (_jsx(XStack, { gap: 8, children: _jsx(Choice, { on: false, faded: false, label: t('Send'), onPress: () => onPick({ sent: true }) }) }))] }));
|
|
99
|
+
case 'file': {
|
|
100
|
+
const Mark = FILES[card.type];
|
|
101
|
+
return (_jsx(Frame, { children: _jsxs(XStack, { items: "center", gap: 10, children: [_jsx(XStack, { width: 36, height: 36, shrink: 0, rounded: 8, items: "center", justify: "center", bg: "$raised", "$platform-web": { borderRadius: '8px' }, children: _jsx(Mark, { size: 17, color: "var(--foreground)", "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, "data-i18n-ltr": true, children: card.name }), card.detail ? (_jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: t(card.detail) })) : null] })] }) }));
|
|
102
|
+
}
|
|
103
|
+
case 'meeting':
|
|
104
|
+
return (_jsx(Frame, { children: _jsxs(XStack, { items: "center", gap: 10, children: [_jsx(XStack, { width: 36, height: 36, shrink: 0, rounded: 8, items: "center", justify: "center", bg: "$ink", "$platform-web": { borderRadius: '8px' }, children: _jsx(CalendarCheck, { size: 17, color: "var(--background)", "aria-hidden": true }) }), _jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$2", fontWeight: "600", color: "$ink", numberOfLines: 1, children: t(card.title) }), _jsx(Text, { fontSize: "$1", lineHeight: 16, color: "$soft", children: t('{when} · on everyone’s calendar', { when: t(card.when) }) })] })] }) }));
|
|
105
|
+
case 'list':
|
|
106
|
+
return (_jsxs(Frame, { children: [_jsx(Text, { fontSize: "$1", fontWeight: "700", color: "$ink", children: t(card.title) }), _jsx(YStack, { gap: 6, children: card.items.map((item, i) => (_jsxs(XStack, { items: "center", gap: 8, children: [card.done ? _jsx(Tick, { done: card.done.includes(i) }) : _jsx(View, { width: 5, height: 5, shrink: 0, rounded: 9999, bg: "$soft", mx: 5, "$platform-web": { borderRadius: '9999px' } }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$2", lineHeight: "$2", color: "$ink", children: t(item) })] }, item))) })] }));
|
|
107
|
+
case 'ask':
|
|
108
|
+
return (_jsx(Frame, { children: _jsx(XStack, { gap: 8, flexWrap: "wrap", children: card.options.map((o, i) => (_jsx(Choice, { on: card.picked === i, faded: card.picked !== undefined && card.picked !== i, label: t(o), onPress: () => onPick({ picked: i }) }, o))) }) }));
|
|
109
|
+
case 'options':
|
|
110
|
+
return (_jsxs(Frame, { children: [_jsx(Text, { fontFamily: "$mono", fontSize: "$1", color: "$soft", "data-i18n-ltr": true, children: card.file }), _jsx(XStack, { gap: 8, children: card.options.map((o, i) => {
|
|
111
|
+
const on = card.picked === i;
|
|
112
|
+
return (_jsxs(YStack, { render: _jsx("button", { type: "button", "aria-pressed": on, "aria-label": t('Option {name}', { name: o }), onClick: () => onPick({ picked: i }) }), flex: 1, gap: 5, p: 8, rounded: 8, borderWidth: on ? 2 : 1, borderColor: on ? '$ink' : '$edge', bg: "$background", opacity: card.picked !== undefined && !on ? 0.55 : 1, cursor: "pointer", focusVisibleStyle: ROW.focusVisibleStyle, "$platform-web": { borderRadius: '8px', transition: 'opacity 240ms ease, border-color 240ms ease' }, children: [_jsxs(XStack, { items: "center", justify: "space-between", children: [_jsx(Text, { fontSize: "$1", fontWeight: "700", color: "$ink", "data-i18n-ltr": true, children: o }), on ? _jsx(Check, { size: 12, strokeWidth: 3, color: "var(--foreground)", "aria-hidden": true }) : null] }), _jsx(XStack, { gap: 4, children: [0, 1, 2].map((c) => (_jsxs(YStack, { flex: 1, gap: 3, p: 4, rounded: 4, borderWidth: 1, borderColor: "$edge", "$platform-web": { borderRadius: '4px' }, children: [_jsx(View, { height: 4, width: "70%", rounded: 2, bg: "$raised" }), Array.from({ length: i ? 2 : 4 }, (_, k) => (_jsx(View, { height: 3, width: "90%", rounded: 2, bg: "$hover" }, k)))] }, c))) })] }, o));
|
|
113
|
+
}) })] }));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** The reactions under a message; a count that changes lands again. */
|
|
117
|
+
function Reactions({ list }) {
|
|
118
|
+
return (_jsx(XStack, { gap: 6, mt: 4, flexWrap: "wrap", children: list.map((r) => {
|
|
119
|
+
const Mark = MARKS[r.mark];
|
|
120
|
+
return (_jsxs(XStack, { "data-motion": "rise", items: "center", gap: 4, px: 8, py: 2, rounded: 9999, borderWidth: 1, borderColor: "$edge", bg: "$hover", "$platform-web": { borderRadius: '9999px' }, children: [_jsx(Mark, { size: 12, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$ink", "data-i18n-ltr": true, children: r.n })] }, `${r.mark}:${r.n}`));
|
|
121
|
+
}) }));
|
|
122
|
+
}
|
|
123
|
+
/** A message's name line: the name, an agent's tag, the time. */
|
|
124
|
+
function Byline({ id, time }) {
|
|
125
|
+
const { t } = useI18n();
|
|
126
|
+
return (_jsxs(XStack, { items: "center", gap: 6, minW: 0, children: [_jsx(Text, { fontSize: "$2", fontWeight: "700", color: "$ink", numberOfLines: 1, children: who(id).name }), agent(id) ? (_jsx(Text, { fontSize: 10, lineHeight: 15, fontWeight: "600", px: 5, rounded: 4, bg: "$raised", color: "$soft", "$platform-web": { borderRadius: '4px' }, children: t('Agent') })) : null, _jsx(Text, { fontSize: 11, color: "$faint", "data-i18n-ltr": true, children: time })] }));
|
|
127
|
+
}
|
|
128
|
+
/** "9:41 AM", in the reader's language, for a minute of the sample day. */
|
|
129
|
+
function useClock() {
|
|
130
|
+
const { locale } = useI18n();
|
|
131
|
+
const time = useMemo(() => new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit' }), [locale]);
|
|
132
|
+
return (minute) => time.format(new Date(2026, 9, 29, Math.floor(minute / 60), minute % 60));
|
|
133
|
+
}
|
|
134
|
+
/** One message: the face (or nothing, under the same author's last), the words, its card, reactions and thread. */
|
|
135
|
+
function Post({ m, grouped, onThread, onPick }) {
|
|
136
|
+
const { t } = useI18n();
|
|
137
|
+
const clock = useClock();
|
|
138
|
+
const last = m.replies[m.replies.length - 1];
|
|
139
|
+
const faces = [...new Set(m.replies.map((r) => r.who))].slice(0, 3);
|
|
140
|
+
return (_jsxs(XStack, { "data-motion": "rise", gap: 10, items: "flex-start", pt: grouped ? 0 : 8, children: [_jsx(View, { width: 34, shrink: 0, items: "center", children: grouped ? null : _jsx(Avatar, { id: m.who, size: 34 }) }), _jsxs(YStack, { flex: 1, minW: 0, gap: 2, children: [grouped ? null : _jsx(Byline, { id: m.who, time: clock(m.time) }), _jsx(Text, { fontSize: "$2", lineHeight: "$3", color: "$ink", children: _jsx(Said, { text: t(m.text) }) }), m.card ? _jsx(Attachment, { card: m.card, onPick: onPick }) : null, m.reactions.length ? _jsx(Reactions, { list: m.reactions }) : null, m.replies.length ? (_jsxs(XStack, { render: _jsx("button", { type: "button", onClick: onThread, "aria-label": t('Open the thread: {replies}', { replies: replies(t, m.replies.length) }) }), self: "flex-start", items: "center", gap: 6, mt: 4, px: 4, py: 3, rounded: 8, bg: "transparent", ...ROW, "$platform-web": { borderRadius: '8px' }, children: [_jsx(XStack, { children: faces.map((f, i) => (_jsx(View, { marginInlineStart: i ? -5 : 0, rounded: 9999, borderWidth: 1.5, borderColor: "var(--background)", "$platform-web": { borderRadius: '9999px' }, children: _jsx(Avatar, { id: f, size: 18 }) }, f))) }), _jsx(Text, { fontSize: "$1", fontWeight: "700", color: "$ink", children: replies(t, m.replies.length) }), _jsx(Text, { fontSize: "$1", color: "$faint", numberOfLines: 1, children: last ? t('Last reply {time}', { time: clock(last.time) }) : null })] })) : null] })] }));
|
|
141
|
+
}
|
|
142
|
+
/** A count of what is unread, inked. */
|
|
143
|
+
function Count({ n }) {
|
|
144
|
+
return (_jsx(Text, { "data-motion": "rise", fontSize: 10, lineHeight: 16, minW: 18, px: 5, rounded: 9999, bg: "$ink", color: "$background", fontWeight: "700", text: "center", "$platform-web": { borderRadius: '9999px' }, "data-i18n-ltr": true, children: n }, n));
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* An organization's tile: its initial in its own hue, as the app's org chooser
|
|
148
|
+
* draws it (@hanzo/ui `Avatar`, seeded on the org's id). The active one wears a
|
|
149
|
+
* ring in that hue; the others what is unread there.
|
|
150
|
+
*/
|
|
151
|
+
function Tile({ org, on, n, size, onPress }) {
|
|
152
|
+
const { t } = useI18n();
|
|
153
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button", "aria-pressed": on, "aria-label": n ? t('Open {org}, {count} unread', { org: org.name, count: n }) : t('Open {org}', { org: org.name }), onClick: onPress }), position: "relative", shrink: 0, p: 2, rounded: 10, borderWidth: 2, borderColor: on ? '$ink' : 'transparent', bg: "transparent", cursor: "pointer", opacity: on ? 1 : 0.8, hoverStyle: { opacity: 1 }, focusVisibleStyle: ROW.focusVisibleStyle, "$platform-web": { borderRadius: '10px', transition: 'opacity 200ms ease, border-color 260ms ease' }, children: [_jsx(Monogram, { size: size, shape: "rounded", name: org.name, colorSeed: org.id, variant: on ? 'outline' : 'soft' }), n ? (_jsx(View, { position: "absolute", t: -7, insetInlineEnd: -8, children: _jsx(Count, { n: n }) })) : null] }));
|
|
154
|
+
}
|
|
155
|
+
/** Three dots that take turns, beside who is typing. */
|
|
156
|
+
function Dots() {
|
|
157
|
+
return (_jsx(XStack, { gap: 3, "aria-hidden": true, children: ['0ms', '200ms', '400ms'].map((delay) => (_jsx(View, { "data-motion": "pulse", width: 4, height: 4, rounded: 9999, bg: "$soft", "$platform-web": { borderRadius: '9999px', animationDelay: delay } }, delay))) }));
|
|
135
158
|
}
|
|
136
159
|
/**
|
|
137
|
-
* Hanzo Team's workspace, playing. From
|
|
138
|
-
*
|
|
139
|
-
*
|
|
160
|
+
* Hanzo Team's workspace, playing. From 600px of its own width it is the
|
|
161
|
+
* desktop app (the rail, the workspace's column, the channel); narrower, or
|
|
162
|
+
* told `phone`, the phone app: the channel, with the rail and the column as a
|
|
140
163
|
* drawer. A host (the landing's hero) can pause it, hear when it ends, and fit
|
|
141
164
|
* it to a device's screen (`PreviewProps`).
|
|
142
165
|
*/
|
|
143
166
|
export function TeamPreview(props) {
|
|
144
|
-
const { compact } = props;
|
|
167
|
+
const { compact, phone } = props;
|
|
145
168
|
const { t, dir } = useI18n();
|
|
146
169
|
const still = useStill();
|
|
147
170
|
const { box, seen, width, visible, held, hold } = useStage();
|
|
148
171
|
const { live, end } = useHost(props);
|
|
149
|
-
|
|
172
|
+
// It always lays itself out by its own width, so it fits a page's column, a
|
|
173
|
+
// hero's half and a device's screen alike; the window decides only before it
|
|
174
|
+
// is measured (the server's render and the first paint).
|
|
175
|
+
const desk = phone ? false : width ? width >= DESK : null;
|
|
176
|
+
const roomy = desk !== false && width >= ROOM;
|
|
150
177
|
const [driven, setDriven] = useState(false);
|
|
151
178
|
const loop = useRef(true);
|
|
152
179
|
const [replay, setReplay] = useState(0);
|
|
153
|
-
// The room the reader opened
|
|
180
|
+
// The room the reader opened, the rooms they have read, and what they set by hand.
|
|
154
181
|
const [opened, setOpened] = useState(null);
|
|
155
182
|
const [read, setRead] = useState([]);
|
|
183
|
+
const [hand, setHand] = useState({});
|
|
184
|
+
const [threadHand, setThreadHand] = useState(undefined);
|
|
156
185
|
const [drawer, setDrawer] = useState(false);
|
|
157
186
|
useEffect(() => {
|
|
158
187
|
loop.current = !driven;
|
|
159
188
|
}, [driven]);
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
const
|
|
165
|
-
//
|
|
166
|
-
const
|
|
167
|
-
const
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
189
|
+
// The phone's channel strip keeps the open channel in view, scrolling itself and never the page.
|
|
190
|
+
const strip = useRef(null);
|
|
191
|
+
const lines = useMemo(() => (opened ? (SCENE[opened] ?? pace([{ kind: 'open', room: opened, time: 9 * 60 }])) : DAY), [opened]);
|
|
192
|
+
const run = seen && !still;
|
|
193
|
+
const at = usePlay(lines, run, replay, { visible, held, loop, live, end });
|
|
194
|
+
// Before it plays, and under reduced motion, the day stands at its still frame.
|
|
195
|
+
const upto = opened || run ? at : STILL;
|
|
196
|
+
const f = useMemo(() => frame(lines, upto), [lines, upto]);
|
|
197
|
+
const here = f.room;
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
const row = strip.current;
|
|
200
|
+
const chip = row?.querySelector('[aria-pressed="true"]');
|
|
201
|
+
if (!row || !chip)
|
|
202
|
+
return;
|
|
203
|
+
row.scrollTo({ left: chip.offsetLeft - (row.clientWidth - chip.offsetWidth) / 2, behavior: still ? 'auto' : 'smooth' });
|
|
204
|
+
}, [here, still]);
|
|
205
|
+
const o = orgOf(here);
|
|
206
|
+
const channel = channelOf(here);
|
|
171
207
|
const topic = o.channels.find((c) => c.id === channel)?.topic ?? '';
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
208
|
+
const messages = (f.rooms[here] ?? []).map((m) => (hand[m.id] && m.card ? { ...m, card: { ...m.card, ...hand[m.id] } } : m));
|
|
209
|
+
const thread = threadHand === undefined ? f.thread : threadHand;
|
|
210
|
+
const parent = thread ? messages.find((m) => m.id === thread) : undefined;
|
|
211
|
+
const typing = f.typing;
|
|
212
|
+
const huddle = f.huddle[here] ?? [];
|
|
213
|
+
const unread = (room) => (room === here || read.includes(room) ? 0 : (f.unread[room] ?? 0));
|
|
214
|
+
/** What is unread across an org's channels. */
|
|
215
|
+
const waiting = (org) => ORGS.find((x) => x.id === org)?.channels.reduce((n, c) => n + unread(`${org}/${c.id}`), 0) ?? 0;
|
|
216
|
+
const members = [...o.people.slice(0, 2), ...o.agents.slice(0, 2)];
|
|
217
|
+
/** The reader takes over: nothing loops over what they set. */
|
|
218
|
+
const go = (room) => {
|
|
182
219
|
setDriven(true);
|
|
183
220
|
setDrawer(false);
|
|
184
|
-
|
|
185
|
-
|
|
221
|
+
setThreadHand(undefined);
|
|
222
|
+
setOpened(room);
|
|
223
|
+
setRead((r) => (r.includes(room) ? r : [...r, room]));
|
|
186
224
|
setReplay((n) => n + 1);
|
|
187
225
|
};
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
return (_jsxs(XStack, {
|
|
200
|
-
}), _jsx(
|
|
201
|
-
const
|
|
202
|
-
|
|
226
|
+
const pick = (id) => (patch) => {
|
|
227
|
+
setDriven(true);
|
|
228
|
+
setHand((h) => ({ ...h, [id]: { ...h[id], ...patch } }));
|
|
229
|
+
};
|
|
230
|
+
const openThread = (id) => {
|
|
231
|
+
setDriven(true);
|
|
232
|
+
setThreadHand(id);
|
|
233
|
+
};
|
|
234
|
+
/** The organizations a person belongs to: the active one marked, "+" under them, the reader at the foot. */
|
|
235
|
+
const rail = (_jsxs(YStack, { items: "center", gap: 12, py: 12, width: 60, height: "100%", shrink: 0, borderColor: "$edge", borderInlineEndWidth: 1, bg: "$sunken", children: [ORGS.map((x) => {
|
|
236
|
+
const on = x.id === o.id;
|
|
237
|
+
return (_jsxs(XStack, { position: "relative", items: "center", justify: "center", children: [_jsx(View, { position: "absolute", insetInlineStart: -8, width: 4, height: on ? 28 : 0, rounded: 9999, bg: "$ink", "$platform-web": { borderRadius: '9999px', transition: still ? 'none' : 'height 260ms ease' } }), _jsx(Tile, { org: x, on: on, n: on ? 0 : waiting(x.id), size: "xl", onPress: () => go(HOME[x.id]) })] }, x.id));
|
|
238
|
+
}), _jsx(XStack, { width: 32, height: 32, rounded: 8, items: "center", justify: "center", borderWidth: 1, borderColor: "$edge", "$platform-web": { borderRadius: '8px' }, children: _jsx(Plus, { size: 15, color: "var(--muted-foreground)", "aria-hidden": true }) }), _jsx(View, { flex: 1 }), _jsxs(View, { position: "relative", children: [_jsx(Avatar, { id: ME, size: 30 }), _jsx(View, { position: "absolute", b: -1, insetInlineEnd: -1, rounded: 9999, borderWidth: 2, borderColor: "$sunken", "$platform-web": { borderRadius: '9999px' }, children: _jsx(Here, {}) })] })] }));
|
|
239
|
+
const heading = (label) => (_jsxs(XStack, { items: "center", gap: 4, px: 8, pt: 12, pb: 3, children: [_jsx(ChevronDown, { size: 12, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", fontWeight: "600", color: "$soft", children: label })] }));
|
|
240
|
+
/** The workspace's column: its name, search, the channels, the direct messages and the agents. */
|
|
241
|
+
const column = (_jsxs(YStack, { "data-motion": "rise", flex: 1, minH: 0, overflow: "hidden", px: 8, py: 10, "$platform-web": FOOT, children: [_jsxs(XStack, { items: "center", gap: 6, px: 8, pb: 10, children: [_jsx(Text, { fontSize: "$4", fontWeight: "700", color: "$ink", numberOfLines: 1, children: o.name }), _jsx(ChevronDown, { size: 14, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(View, { flex: 1 }), _jsx(XStack, { width: 28, height: 28, rounded: 8, items: "center", justify: "center", bg: "$raised", "$platform-web": { borderRadius: '8px' }, children: _jsx(SquarePen, { size: 14, color: "var(--foreground)", "aria-hidden": true }) })] }), _jsxs(XStack, { items: "center", gap: 6, mx: 4, mb: 4, px: 10, height: 28, rounded: 8, borderWidth: 1, borderColor: "$edge", "$platform-web": { borderRadius: '8px' }, children: [_jsx(Search, { size: 12, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$1", color: "$faint", numberOfLines: 1, children: t('Search {org}', { org: o.name }) })] }), heading(t('Channels')), o.channels.map((c) => {
|
|
242
|
+
const room = `${o.id}/${c.id}`;
|
|
243
|
+
const on = room === here;
|
|
244
|
+
const n = unread(room);
|
|
245
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button", "aria-pressed": on, "aria-label": t('Open #{channel}', { channel: c.id }), onClick: () => go(room) }), items: "center", gap: 6, px: 10, py: 4, rounded: 8, bg: on ? '$raised' : 'transparent', ...ROW, "$platform-web": { borderRadius: '8px', textAlign: 'start' }, children: [_jsx(Hash, { size: 13, color: on || n ? 'var(--foreground)' : 'var(--muted-foreground)', "aria-hidden": true }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$2", lineHeight: 20, fontWeight: on || n ? '700' : '400', color: on || n ? '$ink' : '$soft', numberOfLines: 1, "data-i18n-ltr": true, children: c.id }), n ? _jsx(Count, { n: n }) : null] }, c.id));
|
|
246
|
+
}), heading(t('Direct messages')), o.people.map((p, i) => (_jsxs(XStack, { items: "center", gap: 8, px: 10, py: 3, children: [_jsx(Avatar, { id: p, size: 20 }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$2", color: "$soft", numberOfLines: 1, children: who(p).name }), _jsx(Here, { away: i === o.people.length - 1, busy: typing?.who === p })] }, p))), heading(t('Agents')), o.agents.map((a) => (_jsxs(XStack, { items: "center", gap: 8, px: 10, py: 3, children: [_jsx(Avatar, { id: a, size: 20 }), _jsx(Text, { flex: 1, minW: 0, fontSize: "$2", color: "$soft", numberOfLines: 1, children: t('{name} · {role}', { name: who(a).name, role: t(who(a).role ?? '') }) }), _jsx(Here, { busy: typing?.who === a })] }, a)))] }, o.id));
|
|
247
|
+
const title = (_jsxs(YStack, { flex: 1, minW: 0, children: [_jsxs(XStack, { items: "center", gap: 3, children: [_jsx(Hash, { size: 15, color: "var(--foreground)", "aria-hidden": true }), _jsx(Text, { fontSize: "$3", fontWeight: "700", color: "$ink", numberOfLines: 1, "data-i18n-ltr": true, children: channel }), _jsx(ChevronDown, { size: 13, color: "var(--muted-foreground)", "aria-hidden": true })] }), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: t(topic) })] }));
|
|
248
|
+
/** A conversation's messages, the oldest leaving the top; a run of one author's lines shares one face. */
|
|
249
|
+
const list = (items, threads) => (_jsx(YStack, { flex: 1, minH: 0, overflow: "hidden", justify: "flex-end", gap: 6, px: 16, pt: 8, pb: 4, "$platform-web": TOP, children: items.map((m, i) => {
|
|
250
|
+
const before = items[i - 1];
|
|
251
|
+
const grouped = !!before && before.who === m.who && !before.card && !before.replies.length && m.time - before.time < 5;
|
|
252
|
+
return _jsx(Post, { m: m, grouped: grouped, onThread: threads ? () => openThread(m.id) : undefined, onPick: pick(m.id) }, m.id);
|
|
253
|
+
}) }));
|
|
254
|
+
const composer = (placeholder) => (_jsxs(YStack, { mx: 12, mb: 12, gap: 8, px: 12, py: 10, rounded: 12, borderWidth: 1, borderColor: "$edge", bg: "$panel", "$platform-web": { borderRadius: '12px' }, children: [_jsx(Text, { fontSize: "$2", color: "$faint", numberOfLines: 1, children: placeholder }), _jsxs(XStack, { items: "center", gap: 12, children: [_jsx(Plus, { size: 15, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(AtSign, { size: 15, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Smile, { size: 15, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(Mic, { size: 15, color: "var(--muted-foreground)", "aria-hidden": true }), _jsx(View, { flex: 1 }), _jsx(SendHorizontal, { size: 15, color: "var(--muted-foreground)", "aria-hidden": true, "data-i18n-mirror": true })] })] }));
|
|
255
|
+
/** The thread a message started: the message, its replies, a reply box. */
|
|
256
|
+
const side = parent ? (_jsxs(YStack, { flex: 1, minH: 0, bg: "var(--background)", children: [_jsxs(XStack, { items: "center", gap: 8, px: 14, minH: 52, borderBottomWidth: 1, borderColor: "$edge", children: [_jsxs(YStack, { flex: 1, minW: 0, children: [_jsx(Text, { fontSize: "$3", fontWeight: "700", color: "$ink", children: t('Thread') }), _jsx(Text, { fontSize: "$1", color: "$soft", "data-i18n-ltr": true, children: `#${channel}` })] }), _jsx(XStack, { render: _jsx("button", { type: "button", "aria-label": t('Close the thread'), onClick: () => openThread(null) }), width: 28, height: 28, rounded: 8, items: "center", justify: "center", bg: "transparent", ...ROW, "$platform-web": { borderRadius: '8px' }, children: _jsx(X, { size: 15, color: "var(--muted-foreground)", "aria-hidden": true }) })] }), _jsxs(YStack, { flex: 1, minH: 0, overflow: "hidden", justify: "flex-end", gap: 6, px: 14, pt: 8, pb: 4, "$platform-web": TOP, children: [_jsx(Post, { m: { ...parent, replies: [] }, grouped: false, onPick: pick(parent.id) }), _jsxs(XStack, { items: "center", gap: 8, py: 6, children: [_jsx(Text, { fontSize: "$1", color: "$soft", children: replies(t, parent.replies.length) }), _jsx(View, { flex: 1, height: 1, bg: "$edge" })] }), parent.replies.map((r, i) => (_jsx(Post, { m: { id: `${parent.id}/${i}`, who: r.who, text: r.text, time: r.time, reactions: [], replies: [] }, grouped: false, onPick: () => undefined }, i)))] }), composer(t('Reply…'))] }, parent.id)) : null;
|
|
257
|
+
return (_jsxs(View, { ref: box, "data-slot": "team-preview", role: "group", "aria-label": t('Hanzo Team, playing a sample workspace'), ...hold, display: "grid", position: "relative", height: compact ? '100%' : 620, overflow: "hidden", bg: "var(--background)", gridTemplateColumns: "minmax(0, 1fr)", ...md(desk, {
|
|
258
|
+
height: compact ? '100%' : 640,
|
|
259
|
+
gridTemplateColumns: `60px ${breadth(width)}px minmax(0, 1fr)${roomy && parent ? ' 300px' : ''}`,
|
|
260
|
+
}), "$platform-web": { textAlign: 'start' }, children: [_jsx(YStack, { display: "none", ...md(desk, { display: 'flex' }), minH: 0, children: rail }), _jsx(YStack, { display: "none", ...md(desk, { display: 'flex' }), minH: 0, borderColor: "$edge", borderInlineEndWidth: 1, bg: "$sunken", children: column }), _jsxs(YStack, { minW: 0, minH: 0, position: "relative", children: [_jsxs(XStack, { items: "center", gap: 10, px: 14, minH: 52, borderBottomWidth: 1, borderColor: "$edge", children: [_jsx(XStack, { ...md(desk, { display: 'none' }), children: _jsx(XStack, { render: _jsx("button", { type: "button", "aria-expanded": drawer, "aria-label": t('Channels in {org}', { org: o.name }), onClick: () => setDrawer(!drawer) }), width: 32, height: 32, rounded: 8, items: "center", justify: "center", bg: "transparent", ...ROW, "$platform-web": { borderRadius: '8px' }, children: _jsx(Menu, { size: 17, color: "var(--foreground)", "aria-hidden": true }) }) }), title, _jsxs(XStack, { display: "none", ...(width >= FACES ? { display: 'flex' } : {}), items: "center", children: [members.map((p, i) => (_jsx(View, { marginInlineStart: i ? -6 : 0, rounded: 9999, borderWidth: 2, borderColor: "var(--background)", "$platform-web": { borderRadius: '9999px' }, children: _jsx(Avatar, { id: p, size: 22 }) }, p))), _jsx(Text, { fontSize: "$1", color: "$soft", marginInlineStart: 6, "data-i18n-ltr": true, children: o.people.length + o.agents.length })] }), _jsxs(XStack, { "data-motion": "rise", items: "center", gap: 6, px: 10, height: 30, rounded: 8, borderWidth: 1, borderColor: huddle.length ? '$ink' : '$edge', bg: huddle.length ? '$ink' : 'transparent', "$platform-web": { borderRadius: '8px' }, children: [huddle.length ? _jsx(View, { "data-motion": "pulse", width: 7, height: 7, rounded: 9999, bg: "var(--state-online)", "$platform-web": { borderRadius: '9999px' } }) : null, _jsx(Headphones, { size: 14, color: huddle.length ? 'var(--background)' : 'var(--foreground)', "aria-hidden": true }), _jsx(Text, { display: "none", ...md(desk, { display: 'flex' }), fontSize: "$1", fontWeight: "600", color: huddle.length ? '$background' : '$ink', children: huddle.length ? t('Huddle · {count}', { count: huddle.length }) : t('Huddle') })] }, huddle.length ? 'on' : 'off')] }), _jsxs(YStack, { ...md(desk, { display: 'none' }), gap: 8, pt: 10, pb: 8, borderBottomWidth: 1, borderColor: "$edge", children: [_jsxs(XStack, { items: "center", gap: 10, px: 12, "$platform-web": { overflowX: 'auto', scrollbarWidth: 'none' }, children: [ORGS.map((x) => (_jsx(Tile, { org: x, on: x.id === o.id, n: x.id === o.id ? 0 : waiting(x.id), size: "lg", onPress: () => go(HOME[x.id]) }, x.id))), _jsx(Text, { "data-motion": "rise", fontSize: "$3", fontWeight: "700", color: "$ink", numberOfLines: 1, marginInlineStart: 4, children: o.name }, o.id)] }), _jsx(XStack, { ref: strip, gap: 6, px: 12, "$platform-web": { overflowX: 'auto', scrollbarWidth: 'none' }, children: o.channels.map((c) => {
|
|
261
|
+
const room = `${o.id}/${c.id}`;
|
|
262
|
+
const on = room === here;
|
|
263
|
+
const n = unread(room);
|
|
264
|
+
return (_jsxs(XStack, { render: _jsx("button", { type: "button", "aria-pressed": on, "aria-label": t('Open #{channel}', { channel: c.id }), onClick: () => go(room) }), shrink: 0, items: "center", gap: 5, px: 10, height: 28, rounded: 9999, borderWidth: 1, borderColor: on ? '$ink' : '$edge', bg: on ? '$ink' : 'transparent', cursor: "pointer", focusVisibleStyle: ROW.focusVisibleStyle, "$platform-web": { borderRadius: '9999px' }, children: [_jsx(Text, { fontSize: "$1", fontWeight: on || n ? '700' : '500', color: on ? '$background' : n ? '$ink' : '$soft', "data-i18n-ltr": true, children: `#${c.id}` }), n && !on ? _jsx(Count, { n: n }) : null] }, c.id));
|
|
265
|
+
}) })] }), list(messages, true), _jsx(XStack, { items: "center", gap: 6, px: 18, minH: 20, children: typing && typing.room === here ? (_jsxs(_Fragment, { children: [_jsx(Dots, {}), _jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: t('{name} is typing…', { name: who(typing.who).name }) })] })) : null }), composer(t('Message #{channel}', { channel })), side && !roomy ? (_jsx(YStack, { "data-motion": "rise", position: "absolute", t: 0, b: 0, insetInlineEnd: 0, width: "100%", maxW: 420, borderColor: "$edge", borderInlineStartWidth: 1, bg: "var(--background)", boxShadow: "0 24px 60px -24px color-mix(in srgb, var(--pure-black) 60%, transparent)", children: side })) : null, _jsxs(XStack, { "aria-hidden": !drawer, position: "absolute", t: 0, b: 0, insetInlineStart: 0, width: "88%", maxW: 340, bg: "var(--background)", borderColor: "$edge", borderInlineEndWidth: 1, boxShadow: "0 24px 60px -24px color-mix(in srgb, var(--pure-black) 60%, transparent)", pointerEvents: drawer ? 'auto' : 'none', ...md(desk, { display: 'none' }), "$platform-web": {
|
|
203
266
|
transform: drawer ? 'none' : `translateX(calc((100% + 32px) * ${dir === 'rtl' ? 1 : -1}))`,
|
|
204
267
|
transition: still ? 'none' : 'transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1)',
|
|
205
268
|
visibility: drawer ? 'visible' : 'hidden',
|
|
206
|
-
}, children: [
|
|
269
|
+
}, children: [rail, _jsx(YStack, { flex: 1, minW: 0, bg: "$sunken", children: column })] })] }), side && roomy ? (_jsx(YStack, { minW: 0, minH: 0, borderColor: "$edge", borderInlineStartWidth: 1, children: side })) : null] }));
|
|
207
270
|
}
|
package/dist/bots/Bots.js
CHANGED
|
@@ -153,7 +153,7 @@ const EXAMPLE_ACTIONS = {
|
|
|
153
153
|
'Code Reviewer': {
|
|
154
154
|
title: 'Computer',
|
|
155
155
|
status: 'Done',
|
|
156
|
-
summary: 'Analyzed pull request
|
|
156
|
+
summary: 'Analyzed pull request 142 for architectural consistency, security considerations, and edge cases.',
|
|
157
157
|
tasks: [
|
|
158
158
|
'Verified zero memory leaks and confirmed strict typing',
|
|
159
159
|
'Validated test suite passes across all target environments',
|