@celljs/ta-web 4.18.0 → 4.20.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/account-side.d.ts +13 -0
- package/esm/browser/account/account-side.js +74 -0
- package/esm/browser/account/device-account.d.ts +69 -0
- package/esm/browser/account/device-account.js +215 -0
- package/esm/browser/assistant/assistant-chat-list.js +2 -1
- package/esm/browser/components/account-menu.d.ts +1 -1
- package/esm/browser/components/account-menu.js +7 -2
- package/esm/browser/components/account-view.d.ts +17 -0
- package/esm/browser/components/account-view.js +216 -0
- package/esm/browser/components/app-view.js +4 -4
- package/esm/browser/components/cloud-sign-in-view.d.ts +5 -1
- package/esm/browser/components/cloud-sign-in-view.js +1 -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 +3 -1
- package/esm/browser/components/host-view.js +7 -0
- package/esm/browser/components/picture-dialog.d.ts +18 -0
- package/esm/browser/components/picture-dialog.js +116 -0
- package/esm/browser/components/workbench-view.js +5 -1
- package/esm/browser/extension/icons.js +2 -1
- 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/hosts.d.ts +5 -0
- package/esm/browser/hosts.js +11 -0
- package/esm/browser/i18n/locales.d.ts +69 -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 +64 -0
- package/esm/browser/i18n/messages-zh-tw.js +64 -0
- package/esm/browser/i18n/messages.d.ts +70 -8
- package/esm/browser/i18n/messages.js +161 -11
- package/esm/browser/i18n/use-t.js +4 -3
- package/esm/browser/settings/settings.js +3 -1
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +31 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +5 -0
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +2 -1
- 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/workbench-hosts.d.ts +7 -0
- package/esm/browser/workbench-hosts.js +20 -0
- package/esm/browser/workbench-protocol.d.ts +8 -1
- package/esm/browser/workbench-services.d.ts +2 -1
- package/esm/browser/workbench-services.js +3 -0
- package/esm/browser/workbench-util.d.ts +1 -1
- package/lib/browser/account/account-side.d.ts +14 -0
- package/lib/browser/account/account-side.js +111 -0
- package/lib/browser/account/device-account.d.ts +70 -0
- package/lib/browser/account/device-account.js +219 -0
- package/lib/browser/assistant/assistant-chat-list.js +2 -1
- package/lib/browser/components/account-menu.d.ts +1 -1
- package/lib/browser/components/account-menu.js +6 -1
- package/lib/browser/components/account-view.d.ts +18 -0
- package/lib/browser/components/account-view.js +255 -0
- package/lib/browser/components/app-view.js +2 -2
- package/lib/browser/components/cloud-sign-in-view.d.ts +5 -1
- package/lib/browser/components/cloud-sign-in-view.js +1 -0
- 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 +3 -1
- package/lib/browser/components/host-view.js +8 -0
- package/lib/browser/components/picture-dialog.d.ts +19 -0
- package/lib/browser/components/picture-dialog.js +153 -0
- package/lib/browser/components/workbench-view.js +5 -1
- package/lib/browser/extension/icons.js +1 -0
- 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/hosts.d.ts +5 -0
- package/lib/browser/hosts.js +11 -0
- package/lib/browser/i18n/locales.d.ts +69 -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 +64 -0
- package/lib/browser/i18n/messages-zh-tw.js +64 -0
- package/lib/browser/i18n/messages.d.ts +70 -8
- package/lib/browser/i18n/messages.js +163 -13
- package/lib/browser/i18n/use-t.js +4 -3
- package/lib/browser/settings/settings.js +3 -1
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +31 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +5 -0
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +2 -1
- 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/workbench-hosts.d.ts +7 -0
- package/lib/browser/workbench-hosts.js +20 -0
- package/lib/browser/workbench-protocol.d.ts +8 -1
- package/lib/browser/workbench-services.d.ts +2 -1
- package/lib/browser/workbench-services.js +3 -0
- package/lib/browser/workbench-util.d.ts +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PictureUtil = void 0;
|
|
4
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
5
|
+
/** Sides of the square tried, largest first, and qualities of each, till one fits a picture of Ta (TA_PICTURE.maxChars). */
|
|
6
|
+
const SIDES = [192, 160, 128, 96];
|
|
7
|
+
const QUALITIES = [0.86, 0.76, 0.66];
|
|
8
|
+
/** The picture the user gives themselves (TaRoomServer.setPicture), made of a photo. */
|
|
9
|
+
var PictureUtil;
|
|
10
|
+
(function (PictureUtil) {
|
|
11
|
+
/** The middle square of a photo, as a JPEG small enough; undefined when none is. */
|
|
12
|
+
async function square(file) {
|
|
13
|
+
const bitmap = await createImageBitmap(file);
|
|
14
|
+
try {
|
|
15
|
+
const side = Math.min(bitmap.width, bitmap.height);
|
|
16
|
+
const left = (bitmap.width - side) / 2;
|
|
17
|
+
const top = (bitmap.height - side) / 2;
|
|
18
|
+
for (const size of SIDES) {
|
|
19
|
+
const canvas = document.createElement('canvas');
|
|
20
|
+
canvas.width = size;
|
|
21
|
+
canvas.height = size;
|
|
22
|
+
const context = canvas.getContext('2d');
|
|
23
|
+
if (!context) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
// What is clear in a PNG shows white, not black, in a JPEG.
|
|
27
|
+
context.fillStyle = '#fff';
|
|
28
|
+
context.fillRect(0, 0, size, size);
|
|
29
|
+
context.imageSmoothingQuality = 'high';
|
|
30
|
+
context.drawImage(bitmap, left, top, side, side, 0, 0, size, size);
|
|
31
|
+
for (const quality of QUALITIES) {
|
|
32
|
+
const url = canvas.toDataURL('image/jpeg', quality);
|
|
33
|
+
if (url.length <= ta_protocol_1.TA_PICTURE.maxChars) {
|
|
34
|
+
return url;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
bitmap.close();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
PictureUtil.square = square;
|
|
45
|
+
})(PictureUtil || (exports.PictureUtil = PictureUtil = {}));
|
|
46
|
+
//# sourceMappingURL=picture.js.map
|
|
@@ -11,6 +11,13 @@ export declare abstract class WorkbenchHosts extends WorkbenchLists {
|
|
|
11
11
|
/** What was kept of the computers dropped, being taken off the device. */
|
|
12
12
|
protected forgetting: Promise<unknown>;
|
|
13
13
|
signIn(given: string | Credential): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* A way into a computer of the user's account came (docs/design/ta-account.md): kept in the list of computers;
|
|
16
|
+
* used at once when none is.
|
|
17
|
+
*/
|
|
18
|
+
addAccountHost(link: string, account: string): Promise<void>;
|
|
19
|
+
/** The computers the account brought: those of `account`, or all of them when the device left the account. */
|
|
20
|
+
forgetAccountHosts(account?: string): void;
|
|
14
21
|
switchTo(hostId: string): void;
|
|
15
22
|
forget(hostId: string): void;
|
|
16
23
|
rename(hostId: string, name: string): void;
|
|
@@ -28,6 +28,26 @@ class WorkbenchHosts extends workbench_lists_1.WorkbenchLists {
|
|
|
28
28
|
this.keepHosts(hosts_1.HostUtil.use(this.list, id, credential, Date.now(), { user: server.user, host: server.host }));
|
|
29
29
|
this.load(id);
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* A way into a computer of the user's account came (docs/design/ta-account.md): kept in the list of computers;
|
|
33
|
+
* used at once when none is.
|
|
34
|
+
*/
|
|
35
|
+
async addAccountHost(link, account) {
|
|
36
|
+
const credential = workbench_util_1.WorkbenchUtil.credential(link);
|
|
37
|
+
const id = workbench_util_1.WorkbenchUtil.serverOf(credential, (0, workbench_util_1.pageHost)());
|
|
38
|
+
if (this.current.status === 'signed-out' && !this.list.current) {
|
|
39
|
+
this.keepHosts(hosts_1.HostUtil.keep(this.list, id, credential, account, Date.now()));
|
|
40
|
+
await this.signIn(credential);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.keepHosts(hosts_1.HostUtil.keep(this.list, id, credential, account, Date.now()));
|
|
44
|
+
}
|
|
45
|
+
/** The computers the account brought: those of `account`, or all of them when the device left the account. */
|
|
46
|
+
forgetAccountHosts(account) {
|
|
47
|
+
for (const host of this.list.hosts.filter(one => one.account && (account === undefined || one.account === account))) {
|
|
48
|
+
this.forget(host.id);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
31
51
|
switchTo(hostId) {
|
|
32
52
|
const host = this.list.hosts.find(one => one.id === hostId);
|
|
33
53
|
if (!host || (hostId === this.current.host && this.current.status !== 'signed-out')) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SessionStore, SessionStoreOptions } from '@celljs/ta-client';
|
|
2
|
-
import type { TaAccessServer, TaAuthEvent, TaAuthServer, TaDesktopEvent, TaGatewayServer, TaPackageServer, TaRelayServer, TaRemoteEvent, TaRemoteServer, TaRoomEvent, TaRoomServer, TaSavedSessionInfo, TaScreenShareServer, TaServer, TaServerInfo, TaSessionInfo, TaSettingsServer, TaTerminalServer, TaVoiceEvent, TaVoiceServer, TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
2
|
+
import type { TaAccessServer, TaAccountServer, TaAuthEvent, TaAuthServer, TaDesktopEvent, TaGatewayServer, TaPackageServer, TaRelayServer, TaRemoteEvent, TaRemoteServer, TaRoomEvent, TaRoomServer, TaSavedSessionInfo, TaScreenShareServer, TaServer, TaServerInfo, TaSessionInfo, TaSettingsServer, TaTerminalServer, TaVoiceEvent, TaVoiceServer, TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
3
3
|
import type { RelayPairing } from '@celljs/ta-relay';
|
|
4
4
|
export declare const TaWorkbench: unique symbol;
|
|
5
5
|
/**
|
|
@@ -26,6 +26,8 @@ export interface SavedHost {
|
|
|
26
26
|
name?: string;
|
|
27
27
|
/** Who and which machine answered the last time. */
|
|
28
28
|
server?: Pick<TaServerInfo, 'user' | 'host'>;
|
|
29
|
+
/** A computer of the user's account (docs/design/ta-account.md), by its id there: added and removed with it. */
|
|
30
|
+
account?: string;
|
|
29
31
|
addedAt: number;
|
|
30
32
|
usedAt: number;
|
|
31
33
|
}
|
|
@@ -100,6 +102,7 @@ export interface TaWorkbench {
|
|
|
100
102
|
/** Behind `ta gateway` only. */
|
|
101
103
|
readonly gateway: TaGatewayServer;
|
|
102
104
|
readonly relay: TaRelayServer;
|
|
105
|
+
readonly account: TaAccountServer;
|
|
103
106
|
readonly remote: TaRemoteServer;
|
|
104
107
|
/** Desktops of other computers (docs/design/ta-desktop-remote.md). */
|
|
105
108
|
readonly screenShare: TaScreenShareServer;
|
|
@@ -127,6 +130,10 @@ export interface TaWorkbench {
|
|
|
127
130
|
forget(hostId: string): void;
|
|
128
131
|
/** Names a host on this device; an empty name gives it back its own. */
|
|
129
132
|
rename(hostId: string, name: string): void;
|
|
133
|
+
/** A way into a computer of the user's account (docs/design/ta-account.md): kept, used at once when none is. */
|
|
134
|
+
addAccountHost(link: string, account: string): Promise<void>;
|
|
135
|
+
/** The computers the account brought: those of `account`, or all when the device left the account. */
|
|
136
|
+
forgetAccountHosts(account?: string): void;
|
|
130
137
|
/** Forgets the computer in use and loads the page again, at the sign-in, with the other computers kept. */
|
|
131
138
|
signOut(): void;
|
|
132
139
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TaConnection } from '@celljs/ta-client';
|
|
2
|
-
import { type TaAccessServer, type TaAuthEvent, type TaAuthServer, type TaDesktopEvent, type TaGatewayServer, type TaPackageServer, type TaRelayServer, type TaRemoteEvent, type TaRemoteServer, type TaRoomEvent, type TaRoomServer, type TaRoomWatch, type TaScreenShareServer, type TaServer, type TaSettingsServer, type TaTerminalServer, type TaVoiceEvent, type TaVoiceServer, type TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
2
|
+
import { type TaAccessServer, type TaAccountServer, type TaAuthEvent, type TaAuthServer, type TaDesktopEvent, type TaGatewayServer, type TaPackageServer, type TaRelayServer, type TaRemoteEvent, type TaRemoteServer, type TaRoomEvent, type TaRoomServer, type TaRoomWatch, type TaScreenShareServer, type TaServer, type TaSettingsServer, type TaTerminalServer, type TaVoiceEvent, type TaVoiceServer, type TaWorkspaceServer } from '@celljs/ta-protocol';
|
|
3
3
|
import type { WorkbenchCalls } from './workbench-calls';
|
|
4
4
|
import type { ServiceName } from './workbench-util';
|
|
5
5
|
/** The services of the workbench, and the listeners of what its connection tells. */
|
|
@@ -26,6 +26,7 @@ export declare abstract class WorkbenchServices {
|
|
|
26
26
|
get auth(): TaAuthServer;
|
|
27
27
|
get access(): TaAccessServer;
|
|
28
28
|
get gateway(): TaGatewayServer;
|
|
29
|
+
get account(): TaAccountServer;
|
|
29
30
|
get relay(): TaRelayServer;
|
|
30
31
|
get remote(): TaRemoteServer;
|
|
31
32
|
get screenShare(): TaScreenShareServer;
|
|
@@ -26,7 +26,7 @@ export interface KeptLists {
|
|
|
26
26
|
sessions: TaSessionInfo[];
|
|
27
27
|
saved: TaSavedSessionInfo[];
|
|
28
28
|
}
|
|
29
|
-
export type ServiceName = 'server' | 'workspace' | 'terminals' | 'settings' | 'packages' | 'auth' | 'access' | 'gateway' | 'relay' | 'remote' | 'screenShare' | 'rooms' | 'voice';
|
|
29
|
+
export type ServiceName = 'server' | 'account' | 'workspace' | 'terminals' | 'settings' | 'packages' | 'auth' | 'access' | 'gateway' | 'relay' | 'remote' | 'screenShare' | 'rooms' | 'voice';
|
|
30
30
|
/**
|
|
31
31
|
* A conversation opens with about this much of its latest messages (a screen or two: the images of the user's
|
|
32
32
|
* come apart, TaShownImage), its earlier ones loaded as much at a time when scrolled to.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-web",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.20.0",
|
|
4
4
|
"description": "The web client of ta serve: sessions, streaming messages, tool runs with diffs, and dialogs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@celljs/core": "4.
|
|
37
|
-
"@celljs/react": "4.
|
|
38
|
-
"@celljs/ta-client": "4.
|
|
39
|
-
"@celljs/ta-protocol": "4.
|
|
40
|
-
"@celljs/ta-relay": "4.
|
|
41
|
-
"@celljs/widget": "4.
|
|
36
|
+
"@celljs/core": "4.20.0",
|
|
37
|
+
"@celljs/react": "4.20.0",
|
|
38
|
+
"@celljs/ta-client": "4.20.0",
|
|
39
|
+
"@celljs/ta-protocol": "4.20.0",
|
|
40
|
+
"@celljs/ta-relay": "4.20.0",
|
|
41
|
+
"@celljs/widget": "4.20.0",
|
|
42
42
|
"@types/three": "^0.187.0",
|
|
43
43
|
"@xterm/addon-fit": "^0.11.0",
|
|
44
44
|
"@xterm/addon-unicode11": "^0.9.0",
|