@celljs/ta-web 4.19.0 → 4.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/browser/account/device-account.d.ts +65 -1
- package/esm/browser/account/device-account.js +206 -6
- package/esm/browser/assistant/assistant-chat-list.js +2 -1
- package/esm/browser/assistant/call-turn-end.d.ts +55 -0
- package/esm/browser/assistant/call-turn-end.js +68 -0
- package/esm/browser/assistant/realtime-voice.js +3 -3
- package/esm/browser/assistant/voice-call.d.ts +19 -28
- package/esm/browser/assistant/voice-call.js +64 -51
- package/esm/browser/components/account-menu.d.ts +9 -4
- package/esm/browser/components/account-menu.js +59 -20
- package/esm/browser/components/account-view.d.ts +33 -7
- package/esm/browser/components/account-view.js +140 -79
- package/esm/browser/components/app-view.js +2 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/cloud-sign-in-view.js +4 -1
- package/esm/browser/components/dino-look.d.ts +9 -1
- package/esm/browser/components/dino-look.js +46 -1
- package/esm/browser/components/environment-view.js +12 -1
- package/esm/browser/components/face-pictures.d.ts +10 -0
- package/esm/browser/components/face-pictures.js +24 -0
- package/esm/browser/components/face.d.ts +4 -1
- package/esm/browser/components/face.js +16 -1
- package/esm/browser/components/host-view.d.ts +15 -8
- package/esm/browser/components/host-view.js +23 -70
- package/esm/browser/components/me-view.d.ts +2 -2
- package/esm/browser/components/me-view.js +7 -6
- package/esm/browser/components/picture-dialog.d.ts +18 -0
- package/esm/browser/components/picture-dialog.js +116 -0
- package/esm/browser/components/profile-view.d.ts +11 -0
- package/esm/browser/components/profile-view.js +85 -0
- package/esm/browser/components/workbench-view.js +42 -7
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-api-components.d.ts +2 -2
- package/esm/browser/extension/web-api-home.d.ts +13 -0
- package/esm/browser/extension/web-api-home.js +2 -0
- package/esm/browser/extension/web-extension-api.d.ts +4 -4
- package/esm/browser/extension/web-extension-context.js +2 -1
- package/esm/browser/extension/web-home.d.ts +8 -0
- package/esm/browser/extension/web-home.js +20 -0
- package/esm/browser/gateway/console-limits.d.ts +15 -0
- package/esm/browser/gateway/console-limits.js +2 -2
- package/esm/browser/gateway/console-tenant.js +33 -2
- package/esm/browser/gateway/console-updates.d.ts +12 -0
- package/esm/browser/gateway/console-updates.js +76 -0
- package/esm/browser/gateway/console-util.d.ts +7 -1
- package/esm/browser/gateway/console-util.js +18 -0
- package/esm/browser/gateway/console-view.js +9 -2
- package/esm/browser/i18n/locales.d.ts +55 -3
- package/esm/browser/i18n/locales.js +9 -3
- package/esm/browser/i18n/messages-all.d.ts +7 -0
- package/esm/browser/i18n/messages-all.js +14 -0
- package/esm/browser/i18n/messages-ja.js +54 -4
- package/esm/browser/i18n/messages-zh-tw.js +54 -4
- package/esm/browser/i18n/messages.d.ts +56 -8
- package/esm/browser/i18n/messages.js +141 -19
- package/esm/browser/i18n/use-t.js +4 -3
- package/esm/browser/settings/settings.js +3 -1
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +2 -1
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +6 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +11 -0
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +1 -0
- package/esm/browser/util/picture.d.ts +5 -0
- package/esm/browser/util/picture.js +43 -0
- package/esm/browser/util/turn-end.d.ts +8 -0
- package/esm/browser/util/turn-end.js +78 -35
- package/esm/browser/workbench-hosts.d.ts +4 -1
- package/esm/browser/workbench-hosts.js +17 -0
- package/esm/browser/workbench-protocol.d.ts +8 -0
- package/lib/browser/account/device-account.d.ts +65 -1
- package/lib/browser/account/device-account.js +206 -6
- package/lib/browser/assistant/assistant-chat-list.js +2 -1
- package/lib/browser/assistant/call-turn-end.d.ts +56 -0
- package/lib/browser/assistant/call-turn-end.js +72 -0
- package/lib/browser/assistant/realtime-voice.js +3 -3
- package/lib/browser/assistant/voice-call.d.ts +19 -28
- package/lib/browser/assistant/voice-call.js +67 -54
- package/lib/browser/components/account-menu.d.ts +9 -4
- package/lib/browser/components/account-menu.js +57 -18
- package/lib/browser/components/account-view.d.ts +33 -7
- package/lib/browser/components/account-view.js +142 -77
- package/lib/browser/components/app-view.js +1 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/cloud-sign-in-view.js +4 -1
- package/lib/browser/components/dino-look.d.ts +9 -1
- package/lib/browser/components/dino-look.js +48 -1
- package/lib/browser/components/environment-view.js +11 -0
- package/lib/browser/components/face-pictures.d.ts +11 -0
- package/lib/browser/components/face-pictures.js +60 -0
- package/lib/browser/components/face.d.ts +4 -1
- package/lib/browser/components/face.js +16 -1
- package/lib/browser/components/host-view.d.ts +15 -8
- package/lib/browser/components/host-view.js +22 -68
- package/lib/browser/components/me-view.d.ts +2 -2
- package/lib/browser/components/me-view.js +7 -6
- package/lib/browser/components/picture-dialog.d.ts +19 -0
- package/lib/browser/components/picture-dialog.js +153 -0
- package/lib/browser/components/profile-view.d.ts +12 -0
- package/lib/browser/components/profile-view.js +123 -0
- package/lib/browser/components/workbench-view.js +39 -4
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-api-components.d.ts +2 -2
- package/lib/browser/extension/web-api-home.d.ts +14 -0
- package/lib/browser/extension/web-api-home.js +3 -0
- package/lib/browser/extension/web-extension-api.d.ts +4 -4
- package/lib/browser/extension/web-extension-context.js +2 -1
- package/lib/browser/extension/web-home.d.ts +8 -0
- package/lib/browser/extension/web-home.js +54 -1
- package/lib/browser/gateway/console-limits.d.ts +15 -0
- package/lib/browser/gateway/console-limits.js +2 -0
- package/lib/browser/gateway/console-tenant.js +32 -1
- package/lib/browser/gateway/console-updates.d.ts +13 -0
- package/lib/browser/gateway/console-updates.js +113 -0
- package/lib/browser/gateway/console-util.d.ts +7 -1
- package/lib/browser/gateway/console-util.js +18 -0
- package/lib/browser/gateway/console-view.js +9 -2
- package/lib/browser/i18n/locales.d.ts +55 -3
- package/lib/browser/i18n/locales.js +8 -2
- package/lib/browser/i18n/messages-all.d.ts +8 -0
- package/lib/browser/i18n/messages-all.js +17 -0
- package/lib/browser/i18n/messages-ja.js +54 -4
- package/lib/browser/i18n/messages-zh-tw.js +54 -4
- package/lib/browser/i18n/messages.d.ts +56 -8
- package/lib/browser/i18n/messages.js +143 -21
- package/lib/browser/i18n/use-t.js +4 -3
- package/lib/browser/settings/settings.js +3 -1
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +2 -1
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +6 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +11 -0
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +1 -0
- package/lib/browser/util/picture.d.ts +6 -0
- package/lib/browser/util/picture.js +46 -0
- package/lib/browser/util/turn-end.d.ts +8 -0
- package/lib/browser/util/turn-end.js +78 -35
- package/lib/browser/workbench-hosts.d.ts +4 -1
- package/lib/browser/workbench-hosts.js +17 -0
- package/lib/browser/workbench-protocol.d.ts +8 -0
- package/package.json +7 -7
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { Check,
|
|
1
|
+
import { Check, Link2, ScanLine } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import {
|
|
4
|
+
import { DeviceAccount } from '../account/device-account.js';
|
|
5
5
|
import { CodeScan } from '../device/code-scan.js';
|
|
6
6
|
import { ScanError } from '../device/scanner.js';
|
|
7
|
-
import {
|
|
7
|
+
import { useWebExtensions, useWorkbench } from '../hooks.js';
|
|
8
8
|
import { HostUtil } from '../hosts.js';
|
|
9
9
|
import { useT } from '../i18n/use-t.js';
|
|
10
|
-
import { WorkbenchError, WorkbenchUtil } from '../workbench-util.js';
|
|
10
|
+
import { pageHost, WorkbenchError, WorkbenchUtil } from '../workbench-util.js';
|
|
11
11
|
import { AccountAsk } from './account-view.js';
|
|
12
12
|
import { Callout } from './callout.js';
|
|
13
13
|
import { ChatListUtil } from './chat-list-util.js';
|
|
14
|
-
import {
|
|
15
|
-
import { useContextMenu } from './context-menu.js';
|
|
16
|
-
import { Icon, IconButton } from './icon.js';
|
|
14
|
+
import { Icon } from './icon.js';
|
|
17
15
|
import { SwipeRow } from './swipe-row.js';
|
|
18
16
|
import { TaAvatar } from './ta-avatar.js';
|
|
19
17
|
/*
|
|
@@ -27,6 +25,7 @@ export function useAddHost() {
|
|
|
27
25
|
const [busy, setBusy] = React.useState(false);
|
|
28
26
|
const [error, setError] = React.useState();
|
|
29
27
|
const add = React.useCallback(async (text, scanned = false) => {
|
|
28
|
+
var _a;
|
|
30
29
|
const credential = WorkbenchUtil.credential(text);
|
|
31
30
|
// The app has no ta serve of its page to give a token to; a code is always a pairing.
|
|
32
31
|
if (!('pairing' in credential) && (scanned || WorkbenchUtil.isApp())) {
|
|
@@ -37,6 +36,10 @@ export function useAddHost() {
|
|
|
37
36
|
setError(undefined);
|
|
38
37
|
try {
|
|
39
38
|
await bench.signIn(text);
|
|
39
|
+
if ('pairing' in credential) {
|
|
40
|
+
// Signed in to an account: the computer joins it (docs/design/ta-me.md 4).
|
|
41
|
+
(_a = DeviceAccount.current()) === null || _a === void 0 ? void 0 : _a.bringIn(WorkbenchUtil.serverOf(credential, pageHost()));
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
catch (failure) {
|
|
42
45
|
setError(failure instanceof WorkbenchError && failure.reason === 'refused' ? 'ta.hosts.refused' : 'ta.hosts.unreachable');
|
|
@@ -66,7 +69,7 @@ function hostDetail(host) {
|
|
|
66
69
|
return [(_a = host.server) === null || _a === void 0 ? void 0 : _a.user, way].filter(Boolean).join(' · ');
|
|
67
70
|
}
|
|
68
71
|
/** A computer, as a conversation of the list: its letter, its name and the way to it; a finger swipes it to Remove. */
|
|
69
|
-
export function HostRow({ host, current, switching, onPick, onMenu, onRemove }) {
|
|
72
|
+
export function HostRow({ host, detail, current, switching, onPick, onMenu, onRemove }) {
|
|
70
73
|
const t = useT();
|
|
71
74
|
const label = HostUtil.label(host) || t('ta.hosts.thisServer');
|
|
72
75
|
return (React.createElement(SwipeRow, { as: "li", className: `ta-host-row${current ? ' ta-selected' : ''}`, actions: onRemove && [{ key: 'remove', label: t('ta.hosts.remove'), danger: true, run: onRemove }], onContextMenu: onMenu },
|
|
@@ -74,11 +77,11 @@ export function HostRow({ host, current, switching, onPick, onMenu, onRemove })
|
|
|
74
77
|
React.createElement("span", { className: `ta-chat-avatar ta-tone-${ChatListUtil.tone(host.id)}`, "aria-hidden": "true" }, HostUtil.initial({ ...host, name: label })),
|
|
75
78
|
React.createElement("span", { className: "ta-host-text" },
|
|
76
79
|
React.createElement("span", { className: "ta-host-name ta-ellipsis" }, label),
|
|
77
|
-
React.createElement("span", { className: "ta-host-detail ta-ellipsis" }, hostDetail(host))),
|
|
80
|
+
React.createElement("span", { className: "ta-host-detail ta-ellipsis" }, detail !== null && detail !== void 0 ? detail : hostDetail(host))),
|
|
78
81
|
switching ? React.createElement("span", { className: "ta-spinner" }) : current && React.createElement(Icon, { icon: Check, size: 18, className: "ta-host-check" }))));
|
|
79
82
|
}
|
|
80
83
|
/** A link pasted by hand, for where there is no camera or the code cannot be read. */
|
|
81
|
-
function LinkForm({ busy, onSubmit, placeholder, autoFocus }) {
|
|
84
|
+
export function LinkForm({ busy, onSubmit, placeholder, autoFocus, }) {
|
|
82
85
|
const t = useT();
|
|
83
86
|
const [text, setText] = React.useState('');
|
|
84
87
|
return (React.createElement("form", { className: "ta-host-form", onSubmit: event => {
|
|
@@ -90,57 +93,6 @@ function LinkForm({ busy, onSubmit, placeholder, autoFocus }) {
|
|
|
90
93
|
React.createElement("input", { type: "password", autoFocus: autoFocus, placeholder: placeholder, value: text, onChange: event => setText(event.target.value) })),
|
|
91
94
|
React.createElement("button", { type: "submit", className: "ta-button ta-primary", disabled: busy || !text.trim() }, busy ? React.createElement("span", { className: "ta-spinner" }) : t('ta.signin.connect'))));
|
|
92
95
|
}
|
|
93
|
-
/** The computers of this device, the one in use checked: a tap switches, a hold or a right click renames or removes. */
|
|
94
|
-
export function HostsDialog({ onClose }) {
|
|
95
|
-
const t = useT();
|
|
96
|
-
const [{ hosts, host: currentId, switching }, bench] = useWorkbench();
|
|
97
|
-
const [, notices] = useNotices();
|
|
98
|
-
const [menu, openMenu] = useContextMenu();
|
|
99
|
-
const [pasting, setPasting] = React.useState(false);
|
|
100
|
-
const [cloud, setCloud] = React.useState(false);
|
|
101
|
-
const adding = useAddHost();
|
|
102
|
-
useBackLayer(true, onClose);
|
|
103
|
-
React.useEffect(() => {
|
|
104
|
-
const onKey = (event) => event.key === 'Escape' && onClose();
|
|
105
|
-
document.addEventListener('keydown', onKey);
|
|
106
|
-
return () => document.removeEventListener('keydown', onKey);
|
|
107
|
-
}, [onClose]);
|
|
108
|
-
const remove = async (host) => {
|
|
109
|
-
const name = HostUtil.label(host) || t('ta.hosts.thisServer');
|
|
110
|
-
if (await notices.confirm({ title: t('ta.hosts.removeConfirm', { name }), confirmLabel: t('ta.hosts.remove'), danger: true })) {
|
|
111
|
-
bench.forget(host.id);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
const rename = async (host) => {
|
|
115
|
-
var _a;
|
|
116
|
-
const name = await notices.input({ title: t('ta.hosts.rename'), value: HostUtil.label(host), placeholder: (_a = host.server) === null || _a === void 0 ? void 0 : _a.host });
|
|
117
|
-
if (name !== undefined) {
|
|
118
|
-
bench.rename(host.id, name);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
return createPortal(React.createElement("div", { className: "ta-modal-scrim" },
|
|
122
|
-
React.createElement("button", { type: "button", className: "ta-overlay-close", "aria-label": t('ta.close'), tabIndex: -1, onClick: onClose }),
|
|
123
|
-
React.createElement("div", { className: "ta-modal ta-hosts-dialog", role: "dialog", "aria-modal": "true", "aria-label": t('ta.hosts.title') },
|
|
124
|
-
React.createElement("div", { className: "ta-modal-head" },
|
|
125
|
-
React.createElement("span", { className: "ta-modal-title" }, t('ta.hosts.title')),
|
|
126
|
-
React.createElement(IconButton, { icon: X, label: t('ta.close'), onClick: onClose })),
|
|
127
|
-
React.createElement("ul", { className: "ta-host-list", hidden: cloud }, hosts.map(host => (React.createElement(HostRow, { key: host.id, host: host, current: host.id === currentId, switching: host.id === switching, onPick: () => bench.switchTo(host.id), onRemove: () => void remove(host), onMenu: event => openMenu(event, [
|
|
128
|
-
{ label: t('ta.hosts.rename'), run: () => void rename(host) },
|
|
129
|
-
{ label: t('ta.hosts.remove'), run: () => void remove(host) },
|
|
130
|
-
]) })))),
|
|
131
|
-
adding.error && React.createElement(Callout, { level: "error" }, t(adding.error)),
|
|
132
|
-
cloud ? (React.createElement(CloudSignInFlow, { onBack: () => setCloud(false) })) : pasting ? (React.createElement(LinkForm, { busy: adding.busy, autoFocus: true, placeholder: t('ta.signin.pairing'), onSubmit: text => void adding.add(text) })) : (React.createElement("div", { className: "ta-host-actions" },
|
|
133
|
-
adding.canScan && (React.createElement("button", { type: "button", className: "ta-button ta-primary", disabled: adding.busy, onClick: () => void adding.scan() },
|
|
134
|
-
adding.busy ? React.createElement("span", { className: "ta-spinner" }) : React.createElement(Icon, { icon: ScanLine, size: 16 }),
|
|
135
|
-
" ",
|
|
136
|
-
t('ta.hosts.scanShort'))),
|
|
137
|
-
React.createElement("button", { type: "button", className: "ta-button", disabled: adding.busy, onClick: () => setPasting(true) },
|
|
138
|
-
React.createElement(Icon, { icon: ClipboardPaste, size: 16 }),
|
|
139
|
-
" ",
|
|
140
|
-
t('ta.hosts.paste')))),
|
|
141
|
-
!cloud && !pasting && React.createElement(CloudSignInEntry, { onPick: () => setCloud(true) }),
|
|
142
|
-
menu)), document.body);
|
|
143
|
-
}
|
|
144
96
|
/** How long the page waits under the veil for its extensions, the first time on this device, before it shows as it is. */
|
|
145
97
|
const ARRIVAL_MS = 3000;
|
|
146
98
|
/** How long the veil takes to fade. */
|
|
@@ -191,11 +143,10 @@ export function DeviceOverlays() {
|
|
|
191
143
|
React.createElement(PageVeil, null),
|
|
192
144
|
React.createElement(AccountAsk, null)));
|
|
193
145
|
}
|
|
194
|
-
/**
|
|
195
|
-
export function
|
|
146
|
+
/** Connecting a computer on the sign-in: scan the code its Ta shows (in the app), or paste its link or a token. */
|
|
147
|
+
export function ConnectComputer({ error, children }) {
|
|
196
148
|
var _a;
|
|
197
149
|
const t = useT();
|
|
198
|
-
const [{ hosts }, bench] = useWorkbench();
|
|
199
150
|
const adding = useAddHost();
|
|
200
151
|
const [pasting, setPasting] = React.useState(!adding.canScan);
|
|
201
152
|
const shown = (_a = adding.error) !== null && _a !== void 0 ? _a : error;
|
|
@@ -206,11 +157,13 @@ export function AddHostPanel({ error, children }) {
|
|
|
206
157
|
t('ta.hosts.scan'))),
|
|
207
158
|
pasting ? (React.createElement(LinkForm, { busy: adding.busy, autoFocus: !adding.canScan, placeholder: t(WorkbenchUtil.isApp() ? 'ta.signin.pairing' : 'ta.signin.token'), onSubmit: text => void adding.add(text) })) : (React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => setPasting(true) }, t('ta.hosts.paste'))),
|
|
208
159
|
shown && React.createElement(Callout, { level: "error" }, t(shown)),
|
|
209
|
-
children
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
160
|
+
children));
|
|
161
|
+
}
|
|
162
|
+
/** The computers used before, on the sign-in, the latest first: a tap goes back to one. */
|
|
163
|
+
export function SavedHosts() {
|
|
164
|
+
const [{ hosts }, bench] = useWorkbench();
|
|
165
|
+
return (React.createElement(React.Fragment, null, [...hosts]
|
|
166
|
+
.sort((a, b) => b.usedAt - a.usedAt)
|
|
167
|
+
.map(host => (React.createElement(HostRow, { key: host.id, host: host, current: false, switching: false, onPick: () => bench.switchTo(host.id) })))));
|
|
215
168
|
}
|
|
216
169
|
//# sourceMappingURL=host-view.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SettingsSection } from './settings-view.js';
|
|
3
3
|
/**
|
|
4
|
-
* Me, the last tab of a phone, as in a messaging app:
|
|
5
|
-
* connected, then the entries the rail of a computer has in the menu of its account (account-menu.tsx).
|
|
4
|
+
* Me, the last tab of a phone, as in a messaging app: the user's profile (their picture, name and account, which it
|
|
5
|
+
* opens), the machine in use and whether the app is connected, then the entries the rail of a computer has in the menu of its account (account-menu.tsx).
|
|
6
6
|
*/
|
|
7
7
|
export declare function MeView({ onSettings }: {
|
|
8
8
|
onSettings(section?: SettingsSection): void;
|
|
@@ -5,10 +5,11 @@ import { AccountDialogs, AccountFigure, useAccount, useAccountEntries } from './
|
|
|
5
5
|
import { Icon } from './icon.js';
|
|
6
6
|
import { ListGroup, ListRow } from './list-rows.js';
|
|
7
7
|
/**
|
|
8
|
-
* Me, the last tab of a phone, as in a messaging app:
|
|
9
|
-
* connected, then the entries the rail of a computer has in the menu of its account (account-menu.tsx).
|
|
8
|
+
* Me, the last tab of a phone, as in a messaging app: the user's profile (their picture, name and account, which it
|
|
9
|
+
* opens), the machine in use and whether the app is connected, then the entries the rail of a computer has in the menu of its account (account-menu.tsx).
|
|
10
10
|
*/
|
|
11
11
|
export function MeView({ onSettings }) {
|
|
12
|
+
var _a, _b;
|
|
12
13
|
const t = useT();
|
|
13
14
|
const account = useAccount();
|
|
14
15
|
const [dialog, setDialog] = React.useState();
|
|
@@ -16,20 +17,20 @@ export function MeView({ onSettings }) {
|
|
|
16
17
|
return (React.createElement("section", { className: "ta-list-page ta-me", "aria-label": t('ta.me') },
|
|
17
18
|
React.createElement("div", { className: "ta-list-scroll" },
|
|
18
19
|
React.createElement("div", { className: "ta-list-content" },
|
|
19
|
-
React.createElement("button", { type: "button", className: "ta-me-card", "aria-label": t('ta.
|
|
20
|
+
React.createElement("button", { type: "button", className: "ta-me-card", "aria-label": t('ta.me.profile'), onClick: () => setDialog('profile') },
|
|
20
21
|
React.createElement(AccountFigure, { size: 56, className: "ta-account-figure ta-me-figure" }),
|
|
21
22
|
React.createElement("span", { className: "ta-me-text" },
|
|
22
23
|
React.createElement("span", { className: "ta-me-name ta-ellipsis" }, account.name),
|
|
23
|
-
account.machine && React.createElement("span", { className: "ta-me-host ta-ellipsis" }, account.machine),
|
|
24
|
+
((_a = account.account) !== null && _a !== void 0 ? _a : account.machine) && React.createElement("span", { className: "ta-me-host ta-ellipsis" }, (_b = account.account) !== null && _b !== void 0 ? _b : account.machine),
|
|
24
25
|
React.createElement("span", { className: "ta-me-state" },
|
|
25
26
|
React.createElement("span", { className: `ta-account-state ${account.online ? 'ta-ok' : 'ta-warn'}` }),
|
|
26
|
-
t('ta.account.service'),
|
|
27
|
+
account.account && account.machine ? account.machine : t('ta.account.service'),
|
|
27
28
|
" \u00B7 ",
|
|
28
29
|
account.service)),
|
|
29
30
|
React.createElement(Icon, { icon: ChevronRight, size: 18, className: "ta-list-chevron" })),
|
|
30
31
|
groups
|
|
31
32
|
.filter(group => group.length > 0)
|
|
32
33
|
.map(group => (React.createElement(ListGroup, { key: group[0].key }, group.map(entry => { var _a, _b; var _c; return (React.createElement(ListRow, { key: entry.key, icon: entry.danger ? undefined : entry.icon, label: entry.label, detail: (_c = entry.detail) !== null && _c !== void 0 ? _c : (_b = (_a = entry.choices) === null || _a === void 0 ? void 0 : _a.find(choice => choice.checked)) === null || _b === void 0 ? void 0 : _b.label, danger: entry.danger, action: entry.danger || entry.key === 'install', onClick: entry.run })); })))))),
|
|
33
|
-
React.createElement(AccountDialogs, { dialog: dialog, onClose: () => setDialog(undefined) })));
|
|
34
|
+
React.createElement(AccountDialogs, { dialog: dialog, onClose: () => setDialog(undefined), onDialog: setDialog })));
|
|
34
35
|
}
|
|
35
36
|
//# sourceMappingURL=me-view.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the dialog of the user's picture is open: Me and the menu of the account open it, DinoLookHost (dino-look.tsx)
|
|
4
|
+
* shows it. Apart from it, so that what opens it needs no React.
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace PicturePicker {
|
|
7
|
+
function open(): void;
|
|
8
|
+
function close(): void;
|
|
9
|
+
function isOpen(): boolean;
|
|
10
|
+
function subscribe(listener: () => void): () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The picture others see of the user in group chats and among friends (TaRoomServer.setPicture), the double staying the
|
|
14
|
+
* dinosaur: a photo picked or taken, one the double draws as the user describes it, or the dinosaur again.
|
|
15
|
+
*/
|
|
16
|
+
export declare function PictureDialog({ onClose }: {
|
|
17
|
+
onClose(): void;
|
|
18
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { ImagePlus, RotateCcw, Sparkles } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useNotices, useWebExtensions, useWorkbench } from '../hooks.js';
|
|
4
|
+
import { useT } from '../i18n/use-t.js';
|
|
5
|
+
import { PictureUtil } from '../util/picture.js';
|
|
6
|
+
import { Face } from './face.js';
|
|
7
|
+
import { FacePictures } from './face-pictures.js';
|
|
8
|
+
import { Icon } from './icon.js';
|
|
9
|
+
import { DOUBLE_PAGE } from './side-lists.js';
|
|
10
|
+
import { WebDialog } from './web-dialog.js';
|
|
11
|
+
/**
|
|
12
|
+
* Whether the dialog of the user's picture is open: Me and the menu of the account open it, DinoLookHost (dino-look.tsx)
|
|
13
|
+
* shows it. Apart from it, so that what opens it needs no React.
|
|
14
|
+
*/
|
|
15
|
+
export var PicturePicker;
|
|
16
|
+
(function (PicturePicker) {
|
|
17
|
+
const listeners = new Set();
|
|
18
|
+
let shown = false;
|
|
19
|
+
function open() {
|
|
20
|
+
set(true);
|
|
21
|
+
}
|
|
22
|
+
PicturePicker.open = open;
|
|
23
|
+
function close() {
|
|
24
|
+
set(false);
|
|
25
|
+
}
|
|
26
|
+
PicturePicker.close = close;
|
|
27
|
+
function isOpen() {
|
|
28
|
+
return shown;
|
|
29
|
+
}
|
|
30
|
+
PicturePicker.isOpen = isOpen;
|
|
31
|
+
function subscribe(listener) {
|
|
32
|
+
listeners.add(listener);
|
|
33
|
+
return () => listeners.delete(listener);
|
|
34
|
+
}
|
|
35
|
+
PicturePicker.subscribe = subscribe;
|
|
36
|
+
function set(open) {
|
|
37
|
+
shown = open;
|
|
38
|
+
for (const listener of listeners) {
|
|
39
|
+
listener();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
})(PicturePicker || (PicturePicker = {}));
|
|
43
|
+
/**
|
|
44
|
+
* The picture others see of the user in group chats and among friends (TaRoomServer.setPicture), the double staying the
|
|
45
|
+
* dinosaur: a photo picked or taken, one the double draws as the user describes it, or the dinosaur again.
|
|
46
|
+
*/
|
|
47
|
+
export function PictureDialog({ onClose }) {
|
|
48
|
+
const t = useT();
|
|
49
|
+
const [, workbench] = useWorkbench();
|
|
50
|
+
const [extensions, host] = useWebExtensions();
|
|
51
|
+
const [, notices] = useNotices();
|
|
52
|
+
const pictures = React.useContext(FacePictures);
|
|
53
|
+
const mine = !!pictures.pictures[pictures.self];
|
|
54
|
+
const input = React.useRef(null);
|
|
55
|
+
const [busy, setBusy] = React.useState(false);
|
|
56
|
+
const [drawing, setDrawing] = React.useState();
|
|
57
|
+
const set = async (picture) => {
|
|
58
|
+
setBusy(true);
|
|
59
|
+
try {
|
|
60
|
+
await workbench.rooms.setPicture(picture);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
notices.error(error);
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
setBusy(false);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const picked = async (file) => {
|
|
70
|
+
const picture = await PictureUtil.square(file).catch(() => undefined);
|
|
71
|
+
if (picture) {
|
|
72
|
+
await set(picture);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
notices.error(new Error(t('ta.picture.tooLarge')));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const draw = async () => {
|
|
79
|
+
const what = drawing === null || drawing === void 0 ? void 0 : drawing.trim();
|
|
80
|
+
const double = extensions.views.find(view => view.id === DOUBLE_PAGE);
|
|
81
|
+
if (!what || !(double === null || double === void 0 ? void 0 : double.send)) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
onClose();
|
|
85
|
+
host.showPage(DOUBLE_PAGE);
|
|
86
|
+
await double.send(t('ta.picture.drawPrompt', { what })).catch(error => notices.error(error));
|
|
87
|
+
};
|
|
88
|
+
return (React.createElement(WebDialog, { title: t('ta.picture.title'), onClose: onClose },
|
|
89
|
+
React.createElement("div", { className: "ta-picture" },
|
|
90
|
+
React.createElement(Face, { double: true, size: 96 }),
|
|
91
|
+
React.createElement("p", { className: "ta-picture-hint" }, t('ta.picture.hint')),
|
|
92
|
+
drawing === undefined ? (React.createElement("div", { className: "ta-picture-actions" },
|
|
93
|
+
React.createElement("button", { type: "button", className: "ta-button ta-primary ta-wide", disabled: busy, onClick: () => { var _a; return (_a = input.current) === null || _a === void 0 ? void 0 : _a.click(); } },
|
|
94
|
+
React.createElement(Icon, { icon: ImagePlus, size: 16 }),
|
|
95
|
+
t('ta.picture.choose')),
|
|
96
|
+
React.createElement("button", { type: "button", className: "ta-button ta-wide", disabled: busy, onClick: () => setDrawing('') },
|
|
97
|
+
React.createElement(Icon, { icon: Sparkles, size: 16 }),
|
|
98
|
+
t('ta.picture.draw')),
|
|
99
|
+
mine && (React.createElement("button", { type: "button", className: "ta-button ta-wide", disabled: busy, onClick: () => void set(null) },
|
|
100
|
+
React.createElement(Icon, { icon: RotateCcw, size: 16 }),
|
|
101
|
+
t('ta.picture.reset'))))) : (React.createElement("form", { className: "ta-picture-actions", onSubmit: event => {
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
void draw();
|
|
104
|
+
} },
|
|
105
|
+
React.createElement("input", { className: "ta-input", value: drawing, placeholder: t('ta.picture.drawPlaceholder'), autoFocus: true, onChange: event => setDrawing(event.target.value) }),
|
|
106
|
+
React.createElement("button", { type: "submit", className: "ta-button ta-primary ta-wide", disabled: !drawing.trim() }, t('ta.picture.drawSend')))),
|
|
107
|
+
React.createElement("input", { ref: input, type: "file", accept: "image/*", hidden: true, onChange: event => {
|
|
108
|
+
var _a;
|
|
109
|
+
const file = (_a = event.currentTarget.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
110
|
+
event.currentTarget.value = '';
|
|
111
|
+
if (file) {
|
|
112
|
+
void picked(file);
|
|
113
|
+
}
|
|
114
|
+
} }))));
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=picture-dialog.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TaIdentity } from '@celljs/ta-protocol';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** The identity of the computer in use, its name and picture: read once connected, and again when it changes. */
|
|
4
|
+
export declare function useIdentity(): TaIdentity | undefined;
|
|
5
|
+
/** The account in use as a line: "Company account · su", or none while signed out. */
|
|
6
|
+
export declare function useAccountLine(): string | undefined;
|
|
7
|
+
/** The profile, over the page: the picture, the name, and the account, which opens My devices. */
|
|
8
|
+
export declare function ProfileDialog({ onClose, onDevices }: {
|
|
9
|
+
onClose(): void;
|
|
10
|
+
onDevices(): void;
|
|
11
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { CircleUserRound, KeyRound, PenLine } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useAccountInfo, useAccountSide } from '../account/account-side.js';
|
|
4
|
+
import { useNotices, useWorkbench } from '../hooks.js';
|
|
5
|
+
import { useT } from '../i18n/use-t.js';
|
|
6
|
+
import { accountName, useAccountWay } from './account-view.js';
|
|
7
|
+
import { Face } from './face.js';
|
|
8
|
+
import { ListGroup, ListRow } from './list-rows.js';
|
|
9
|
+
import { PicturePicker } from './picture-dialog.js';
|
|
10
|
+
import { WebDialog } from './web-dialog.js';
|
|
11
|
+
/*
|
|
12
|
+
* The user's profile (docs/design/ta-me.md 3): the picture and the name others see of them in group chats and among
|
|
13
|
+
* friends, and the account they are signed in to. One place to change them, which Me and the menu of the account open;
|
|
14
|
+
* the computers of the account share them.
|
|
15
|
+
*/
|
|
16
|
+
const changed = new Set();
|
|
17
|
+
/** The identity of the computer in use, its name and picture: read once connected, and again when it changes. */
|
|
18
|
+
export function useIdentity() {
|
|
19
|
+
const [{ status }, workbench] = useWorkbench();
|
|
20
|
+
const [identity, setIdentity] = React.useState();
|
|
21
|
+
const online = status === 'online';
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (!online) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let live = true;
|
|
27
|
+
const read = () => void Promise.resolve()
|
|
28
|
+
.then(() => workbench.rooms.getIdentity())
|
|
29
|
+
.then(next => live && setIdentity(next), () => undefined);
|
|
30
|
+
read();
|
|
31
|
+
changed.add(read);
|
|
32
|
+
const stop = workbench.onRoomEvent(event => event.type === 'rooms' && read(), { messages: false });
|
|
33
|
+
return () => {
|
|
34
|
+
live = false;
|
|
35
|
+
changed.delete(read);
|
|
36
|
+
stop();
|
|
37
|
+
};
|
|
38
|
+
}, [online, workbench]);
|
|
39
|
+
return identity;
|
|
40
|
+
}
|
|
41
|
+
/** The account in use as a line: "Company account · su", or none while signed out. */
|
|
42
|
+
export function useAccountLine() {
|
|
43
|
+
const side = useAccountSide();
|
|
44
|
+
const { info } = useAccountInfo(side, 15000);
|
|
45
|
+
const way = useAccountWay();
|
|
46
|
+
return (info === null || info === void 0 ? void 0 : info.account) && !info.waiting ? `${way(info.account.id)} · ${accountName(info.account)}` : undefined;
|
|
47
|
+
}
|
|
48
|
+
/** The profile, over the page: the picture, the name, and the account, which opens My devices. */
|
|
49
|
+
export function ProfileDialog({ onClose, onDevices }) {
|
|
50
|
+
var _a;
|
|
51
|
+
const t = useT();
|
|
52
|
+
const [, workbench] = useWorkbench();
|
|
53
|
+
const [, notices] = useNotices();
|
|
54
|
+
const identity = useIdentity();
|
|
55
|
+
const account = useAccountLine();
|
|
56
|
+
const rename = async () => {
|
|
57
|
+
var _a;
|
|
58
|
+
const name = await notices.input({ title: t('ta.me.name'), value: (_a = identity === null || identity === void 0 ? void 0 : identity.name) !== null && _a !== void 0 ? _a : '', placeholder: t('ta.me.nameHint') });
|
|
59
|
+
if ((name === null || name === void 0 ? void 0 : name.trim()) && name.trim() !== (identity === null || identity === void 0 ? void 0 : identity.name)) {
|
|
60
|
+
try {
|
|
61
|
+
await workbench.rooms.setName(name.trim());
|
|
62
|
+
for (const read of changed) {
|
|
63
|
+
read();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
notices.error(error);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return (React.createElement(WebDialog, { title: t('ta.me.profile'), onClose: onClose },
|
|
72
|
+
React.createElement("div", { className: "ta-profile" },
|
|
73
|
+
React.createElement("button", { type: "button", className: "ta-profile-picture", "aria-label": t('ta.picture.title'), onClick: () => PicturePicker.open() },
|
|
74
|
+
React.createElement(Face, { double: true, size: 84 })),
|
|
75
|
+
React.createElement("span", { className: "ta-profile-name ta-ellipsis" }, (_a = identity === null || identity === void 0 ? void 0 : identity.name) !== null && _a !== void 0 ? _a : ''),
|
|
76
|
+
React.createElement(ListGroup, null,
|
|
77
|
+
React.createElement(ListRow, { icon: CircleUserRound, label: t('ta.me.picture'), onClick: () => PicturePicker.open() }),
|
|
78
|
+
React.createElement(ListRow, { icon: PenLine, label: t('ta.me.name'), detail: identity === null || identity === void 0 ? void 0 : identity.name, onClick: () => void rename() }),
|
|
79
|
+
React.createElement(ListRow, { icon: KeyRound, label: t('ta.me.account'), detail: account !== null && account !== void 0 ? account : t('ta.me.noAccount'), onClick: () => {
|
|
80
|
+
onClose();
|
|
81
|
+
onDevices();
|
|
82
|
+
} })),
|
|
83
|
+
React.createElement("p", { className: "ta-profile-hint" }, t('ta.me.profileHint')))));
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=profile-view.js.map
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useAccountInfo, useAccountSide } from '../account/account-side.js';
|
|
3
|
+
import { DeviceAccount } from '../account/device-account.js';
|
|
2
4
|
import { CodeScan } from '../device/code-scan.js';
|
|
3
5
|
import { Device } from '../device/device.js';
|
|
4
|
-
import { usePwa, useSettings } from '../hooks.js';
|
|
6
|
+
import { usePwa, useSettings, useWorkbench } from '../hooks.js';
|
|
5
7
|
import { useT } from '../i18n/use-t.js';
|
|
6
8
|
import { STYLE } from '../style.js';
|
|
7
9
|
import { WorkbenchUtil } from '../workbench-util.js';
|
|
8
|
-
import { AccountAsk,
|
|
10
|
+
import { AccountAsk, AccountWays, RecentAccounts } from './account-view.js';
|
|
9
11
|
import { BuiltInSignIn, CloudSignInEntry, CloudSignInFlow, useBuiltInState } from './cloud-sign-in-view.js';
|
|
10
12
|
import { dinoFavicon } from './dino.js';
|
|
11
|
-
import {
|
|
13
|
+
import { ConnectComputer, SavedHosts } from './host-view.js';
|
|
12
14
|
import { ScanReader } from './scan-screen.js';
|
|
13
15
|
import { SignInAccounts, useSignInWays } from './sign-in-accounts.js';
|
|
14
16
|
import { ConnectPicture } from './sign-in-picture.js';
|
|
@@ -57,6 +59,24 @@ export function SignIn(props) {
|
|
|
57
59
|
React.createElement(ScanReader, null),
|
|
58
60
|
React.createElement(AccountAsk, null)));
|
|
59
61
|
}
|
|
62
|
+
/** The accounts and the computers this device signed in to before, the latest first: a tap goes back to one. */
|
|
63
|
+
function RecentSignIns() {
|
|
64
|
+
const t = useT();
|
|
65
|
+
const [{ hosts }] = useWorkbench();
|
|
66
|
+
const accounts = WorkbenchUtil.isApp() ? DeviceAccount.recent().length : 0;
|
|
67
|
+
if (hosts.length === 0 && accounts === 0) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return (React.createElement("section", { className: "ta-host-saved" },
|
|
71
|
+
React.createElement("h2", null, t('ta.me.recent')),
|
|
72
|
+
React.createElement("ul", { className: "ta-host-list" },
|
|
73
|
+
React.createElement(RecentAccounts, null),
|
|
74
|
+
React.createElement(SavedHosts, null))));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The sign-in (docs/design/ta-me.md 5): the accounts first (a company's, which brings its Ta in the cloud; GitHub),
|
|
78
|
+
* then the accounts and computers signed in to before, then a computer of one's own by its code or link.
|
|
79
|
+
*/
|
|
60
80
|
function SignInPage({ error }) {
|
|
61
81
|
const t = useT();
|
|
62
82
|
const app = WorkbenchUtil.isApp();
|
|
@@ -70,6 +90,10 @@ function SignInPage({ error }) {
|
|
|
70
90
|
const { known: builtIn, settled: builtInSettled } = useBuiltInState();
|
|
71
91
|
// Its ways, or, out of reach from inside the company's network, the way to it.
|
|
72
92
|
const company = !accounts && builtIn && (builtIn.providers.length > 0 || builtIn.unreachable) ? builtIn : undefined;
|
|
93
|
+
// The app's own account: its ways, or where it stands.
|
|
94
|
+
const side = useAccountSide();
|
|
95
|
+
const { info: account, act } = useAccountInfo(app ? side : undefined);
|
|
96
|
+
const refused = error === 'refused' ? (app ? 'ta.signin.pairRefused' : 'ta.signin.refused') : undefined;
|
|
73
97
|
useDocument();
|
|
74
98
|
if (!settled || !builtInSettled) {
|
|
75
99
|
// Drawn once, as it will stay: not a page of a computer, then one of a company's accounts.
|
|
@@ -80,6 +104,15 @@ function SignInPage({ error }) {
|
|
|
80
104
|
React.createElement("div", { className: "ta-card" },
|
|
81
105
|
React.createElement(CloudSignInFlow, { page: true, onBack: () => setCloud(undefined), provider: cloud.provider, typing: cloud.typing }))));
|
|
82
106
|
}
|
|
107
|
+
if (account && (account.signingIn || (account.account && account.waiting))) {
|
|
108
|
+
// The code to enter on the provider's page, or the one another device of the account compares: the whole card.
|
|
109
|
+
return (React.createElement("div", { className: "ta-signin" },
|
|
110
|
+
React.createElement("div", { className: "ta-card" },
|
|
111
|
+
React.createElement(TaAvatar, { size: 72 }),
|
|
112
|
+
React.createElement(AccountWays, { info: account, act: act }))));
|
|
113
|
+
}
|
|
114
|
+
const ways = account && (React.createElement("section", { className: "ta-account-sign-in" },
|
|
115
|
+
React.createElement(AccountWays, { info: account, act: act })));
|
|
83
116
|
if (company) {
|
|
84
117
|
// A build for a deployment: its accounts first, the ways to a computer of one's own under them.
|
|
85
118
|
return (React.createElement("div", { className: "ta-signin" },
|
|
@@ -88,9 +121,10 @@ function SignInPage({ error }) {
|
|
|
88
121
|
React.createElement("h1", null, t('ta.signin.title')),
|
|
89
122
|
React.createElement("p", null, t('ta.cloud.builtInHint')),
|
|
90
123
|
React.createElement(BuiltInSignIn, { known: company, onPick: provider => setCloud({ provider }), onOther: () => setCloud({ typing: true }) }),
|
|
124
|
+
ways,
|
|
125
|
+
React.createElement(RecentSignIns, null),
|
|
91
126
|
React.createElement("div", { className: "ta-sign-in-or" }, t('ta.cloud.orComputer')),
|
|
92
|
-
|
|
93
|
-
React.createElement(AddHostPanel, { error: error === 'refused' ? (app ? 'ta.signin.pairRefused' : 'ta.signin.refused') : undefined }))));
|
|
127
|
+
React.createElement(ConnectComputer, { error: refused }))));
|
|
94
128
|
}
|
|
95
129
|
return (React.createElement("div", { className: "ta-signin" },
|
|
96
130
|
React.createElement("div", { className: "ta-card" },
|
|
@@ -107,7 +141,8 @@ function SignInPage({ error }) {
|
|
|
107
141
|
: 'ta.signin.hint')),
|
|
108
142
|
!accounts && React.createElement(ConnectPicture, { way: way }),
|
|
109
143
|
React.createElement(SignInAccounts, { providers: providers, outcome: outcome }),
|
|
110
|
-
|
|
111
|
-
React.createElement(
|
|
144
|
+
ways,
|
|
145
|
+
React.createElement(ConnectComputer, { error: refused }, !accounts && React.createElement(CloudSignInEntry, { onPick: () => setCloud({}) })),
|
|
146
|
+
React.createElement(RecentSignIns, null))));
|
|
112
147
|
}
|
|
113
148
|
//# sourceMappingURL=workbench-view.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlarmClock, Aperture, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, Bell, BellOff, BookOpen, Bot, Box, Bug, Building2, Calendar, CaseSensitive, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, Code, Coins, Columns2, Contact, Copy, CopyMinus, CornerDownRight, CornerUpLeft, Cpu, Crown, Database, Download, Ellipsis, ExternalLink, Eye, File, FileArchive, FileDiff, FilePlus, Files, FileText, Film, FlaskConical, Folder, FolderInput, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, HardDrive, Hash, Heart, House, Image, ImagePlus, Info, Keyboard, KeyRound, Laptop, LayoutDashboard, Lightbulb, Link, List, ListChecks, ListTodo, ListTree, ListX, LoaderCircle, LocateFixed, Lock, MapIcon, Maximize, Megaphone, MemoryStick, MessageCircle, MessageSquareDot, MessageSquareText, MessagesSquare, Mic, Minus, Monitor, MonitorSmartphone, MousePointer2, MousePointerClick, Package, PackageOpen, Paperclip, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Puzzle, QrCode, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, ScanLine, ScrollText, Search, Send, Server, Share2, Shield, ShieldCheck, Smartphone, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, Target, Text, Timer, Trash2, TrendingDown, TrendingUp, Trophy, Undo2, Unplug, Upload, User, UserPlus, Users, Volume2, WholeWord, Wrench, X, Zap, } from 'lucide-react';
|
|
1
|
+
import { AlarmClock, Aperture, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, ArrowUpDown, Bell, BellOff, BookOpen, Bot, Box, Bug, Building2, Calendar, CaseSensitive, ChartSpline, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsDownUp, ChevronsUpDown, ChevronUp, Circle, CircleAlert, CircleArrowRight, CircleHelp, Clipboard, ClipboardPaste, Clock, Cloud, Code, Coins, Columns2, Contact, Copy, CopyMinus, CornerDownRight, CornerUpLeft, Cpu, Crown, Database, Download, Ellipsis, ExternalLink, Eye, File, FileArchive, FileDiff, FilePlus, Files, FileText, Film, FlaskConical, Folder, FolderInput, FolderOpen, FolderPlus, FolderSearch, FolderTree, Forward, Gamepad2, Gauge, GitBranch, GitCommitHorizontal, Globe, Grip, HardDrive, Hash, Heart, House, Image, ImagePlus, Info, Keyboard, KeyRound, Laptop, LayoutDashboard, Lightbulb, Link, List, ListChecks, ListTodo, ListTree, ListX, LoaderCircle, LocateFixed, Lock, MapIcon, Maximize, Megaphone, MemoryStick, MessageCircle, MessageSquareDot, MessageSquareText, MessagesSquare, Mic, Minus, Monitor, MonitorSmartphone, MousePointer2, MousePointerClick, Package, PackageOpen, Paperclip, Pencil, Phone, Pin, PinOff, Play, Plus, Pointer, Power, Puzzle, QrCode, Radar, RefreshCw, Regex, Replace, ReplaceAll, Rocket, RotateCcw, Rows2, Save, ScanLine, ScrollText, Search, Send, Server, Share2, Shield, ShieldCheck, SlidersHorizontal, Smartphone, Sparkles, Square, SquareMinus, SquarePlus, SquareTerminal, Star, StarOff, Store, Target, Text, Timer, Trash2, TrendingDown, TrendingUp, Trophy, Undo2, Unplug, Upload, User, UserPlus, Users, Volume2, WholeWord, Wrench, X, Zap, } from 'lucide-react';
|
|
2
2
|
/** The icons a web extension gets as `pi.ui.icons`; names are lucide's. Only add: removing one breaks extensions. */
|
|
3
3
|
export const WEB_ICONS = Object.freeze({
|
|
4
4
|
AlarmClock,
|
|
@@ -134,6 +134,7 @@ export const WEB_ICONS = Object.freeze({
|
|
|
134
134
|
Share2,
|
|
135
135
|
Shield,
|
|
136
136
|
ShieldCheck,
|
|
137
|
+
SlidersHorizontal,
|
|
137
138
|
Smartphone,
|
|
138
139
|
Sparkles,
|
|
139
140
|
Square,
|
|
@@ -13,8 +13,8 @@ export interface WebModelPickerProps {
|
|
|
13
13
|
label?: string;
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/**
|
|
16
|
-
* Without
|
|
17
|
-
*
|
|
16
|
+
* Without the coding agents that cannot do without their own tools (`TaSettingsSnapshot.agents`), for what keeps
|
|
17
|
+
* to some of Ta's tools (the front of a call).
|
|
18
18
|
*/
|
|
19
19
|
noAgents?: boolean;
|
|
20
20
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WebHomeEntry } from './web-api-contributions.js';
|
|
2
|
+
/** What the page offers of the rows of the double's home (registerHomeItems), for a list of an extension to show them as its own do. */
|
|
3
|
+
export interface WebHomeUI {
|
|
4
|
+
/** A React hook: the rows extensions add to the double's home (registerHomeItems), in the order they loaded. */
|
|
5
|
+
useHomeItems(): readonly WebHomeEntry[];
|
|
6
|
+
/**
|
|
7
|
+
* Opens a row as the double's list does: the page it shows is that row's while it is in front (useHomeShown), as a
|
|
8
|
+
* conversation shown is the list's. Newer than some Ta apps: `pi.ui.openHome?.(…)`.
|
|
9
|
+
*/
|
|
10
|
+
openHome(entry: WebHomeEntry): Promise<void>;
|
|
11
|
+
/** A React hook: the key of the row whose page is in front (openHome), to show it selected. Newer than some Ta apps. */
|
|
12
|
+
useHomeShown(): string | undefined;
|
|
13
|
+
}
|
|
@@ -7,8 +7,9 @@ import type { Game3DProps } from '../game/game3d-protocol.js';
|
|
|
7
7
|
import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol.js';
|
|
8
8
|
import type { Language, Theme } from '../settings/settings-protocol.js';
|
|
9
9
|
import type { CodeEditorProps, DiffEditorProps, WebComposerProps, WebConversationViewProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebLoadingProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebShareSheetProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebTaskIconProps, WebVoice } from './web-api-components.js';
|
|
10
|
-
import type { WebAsk, WebCallPartner, WebChatIconSource, WebCodeRendererOptions, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor,
|
|
10
|
+
import type { WebAsk, WebCallPartner, WebChatIconSource, WebCodeRendererOptions, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionMenu, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions.js';
|
|
11
11
|
import type { WebDesktop, WebFileDrag } from './web-api-desktop.js';
|
|
12
|
+
import type { WebHomeUI } from './web-api-home.js';
|
|
12
13
|
import type { WebServices } from './web-api-services.js';
|
|
13
14
|
import type { WebTerminal, WebTerminalOptions } from './web-api-terminal.js';
|
|
14
15
|
import type { WebPageInfo } from './web-pages.js';
|
|
@@ -21,6 +22,7 @@ export type { Language, Theme } from '../settings/settings-protocol.js';
|
|
|
21
22
|
export type * from './web-api-components.js';
|
|
22
23
|
export type * from './web-api-contributions.js';
|
|
23
24
|
export type * from './web-api-desktop.js';
|
|
25
|
+
export type * from './web-api-home.js';
|
|
24
26
|
export type * from './web-api-services.js';
|
|
25
27
|
export type * from './web-api-terminal.js';
|
|
26
28
|
export type { WebPageInfo, WebPageState } from './web-pages.js';
|
|
@@ -228,7 +230,7 @@ export interface WebNotifyOptions {
|
|
|
228
230
|
export type { ScreenAction, ScreenItem, ScreenPartSpec, ScreenPartView, ScreenPlace, ScreenScrollable, ScreenScrollTo } from '../screen/screen-protocol.js';
|
|
229
231
|
/** What web extensions see of TaScreen. */
|
|
230
232
|
export type WebScreen = Pick<TaScreen, 'agent' | 'parts' | 'act' | 'element' | 'where' | 'places' | 'go' | 'pageScroll' | 'scroll'>;
|
|
231
|
-
export interface WebExtensionUI {
|
|
233
|
+
export interface WebExtensionUI extends WebHomeUI {
|
|
232
234
|
/** A widget around the message box, as pi's, or a card in the workbench on the right; `undefined` removes it. */
|
|
233
235
|
setWidget(key: string, widget: React.ComponentType | undefined, options?: WidgetOptions): void;
|
|
234
236
|
/**
|
|
@@ -243,8 +245,6 @@ export interface WebExtensionUI {
|
|
|
243
245
|
* them, silent for `done`; without one, a banner that waits for the user's return when it asks or failed.
|
|
244
246
|
*/
|
|
245
247
|
notifySession(notice: WebSessionNotice): void;
|
|
246
|
-
/** A React hook: the rows extensions add to the double's home (registerHomeItems), in the order they loaded. */
|
|
247
|
-
useHomeItems(): readonly WebHomeEntry[];
|
|
248
248
|
/**
|
|
249
249
|
* The double's list is that of the conversations, its tasks and the rows of its home in it (docs/design/ta-partners.md):
|
|
250
250
|
* a sidebar view lists the rest (agents, channels, rooms), not the double. Undefined in Ta apps of before, where a
|