@celljs/ta-web 4.46.3 → 4.47.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.
Files changed (183) hide show
  1. package/esm/browser/chat/chat-protocol.d.ts +7 -0
  2. package/esm/browser/chat/chat-view.js +1 -1
  3. package/esm/browser/chat/chat.d.ts +1 -0
  4. package/esm/browser/chat/chat.js +15 -3
  5. package/esm/browser/chat/draft-model.d.ts +1 -1
  6. package/esm/browser/chat/draft-model.js +2 -2
  7. package/esm/browser/components/account-menu.d.ts +2 -0
  8. package/esm/browser/components/account-menu.js +10 -1
  9. package/esm/browser/components/app-nav.js +4 -1
  10. package/esm/browser/components/app-update-view.d.ts +2 -0
  11. package/esm/browser/components/app-update-view.js +37 -0
  12. package/esm/browser/components/app-view.js +22 -2
  13. package/esm/browser/components/auth-guide.d.ts +25 -0
  14. package/esm/browser/components/auth-guide.js +44 -0
  15. package/esm/browser/components/auth-view.d.ts +2 -0
  16. package/esm/browser/components/auth-view.js +30 -9
  17. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  18. package/esm/browser/components/custom-provider-util.d.ts +2 -0
  19. package/esm/browser/components/custom-provider-util.js +5 -0
  20. package/esm/browser/components/custom-provider-view.js +31 -10
  21. package/esm/browser/components/discover-view.d.ts +8 -1
  22. package/esm/browser/components/discover-view.js +28 -3
  23. package/esm/browser/components/extension-settings.js +1 -0
  24. package/esm/browser/components/first-steps-util.d.ts +29 -0
  25. package/esm/browser/components/first-steps-util.js +41 -0
  26. package/esm/browser/components/first-steps.d.ts +3 -0
  27. package/esm/browser/components/first-steps.js +36 -0
  28. package/esm/browser/components/host-view.d.ts +1 -1
  29. package/esm/browser/components/me-rows.d.ts +8 -1
  30. package/esm/browser/components/me-rows.js +3 -3
  31. package/esm/browser/components/me-view.js +1 -1
  32. package/esm/browser/components/message-user.js +6 -3
  33. package/esm/browser/components/model-picker.d.ts +5 -0
  34. package/esm/browser/components/model-picker.js +10 -1
  35. package/esm/browser/components/nav-places.d.ts +14 -0
  36. package/esm/browser/components/nav-places.js +11 -0
  37. package/esm/browser/components/relay-view-util.d.ts +5 -0
  38. package/esm/browser/components/relay-view-util.js +14 -0
  39. package/esm/browser/components/relay-view.js +11 -7
  40. package/esm/browser/components/settings-choices.js +2 -0
  41. package/esm/browser/components/settings-controls.d.ts +15 -0
  42. package/esm/browser/components/settings-controls.js +13 -0
  43. package/esm/browser/components/settings-more.js +1 -0
  44. package/esm/browser/components/settings-parts.d.ts +3 -1
  45. package/esm/browser/components/settings-parts.js +3 -0
  46. package/esm/browser/components/settings-view.js +37 -11
  47. package/esm/browser/device/app-update.d.ts +62 -0
  48. package/esm/browser/device/app-update.js +144 -0
  49. package/esm/browser/extension/icons.js +2 -1
  50. package/esm/browser/extension/web-api-contributions.d.ts +6 -1
  51. package/esm/browser/extension/web-api-partners.d.ts +6 -0
  52. package/esm/browser/extension/web-api-spec.js +1 -0
  53. package/esm/browser/extension/web-home.js +9 -0
  54. package/esm/browser/extension/web-metrics.d.ts +3 -0
  55. package/esm/browser/extension/web-metrics.js +33 -22
  56. package/esm/browser/extension/web-pages.d.ts +3 -1
  57. package/esm/browser/extension/web-pages.js +1 -0
  58. package/esm/browser/i18n/en/account.d.ts +7 -0
  59. package/esm/browser/i18n/en/account.js +13 -6
  60. package/esm/browser/i18n/en/chat.d.ts +2 -0
  61. package/esm/browser/i18n/en/chat.js +2 -0
  62. package/esm/browser/i18n/en/discover.d.ts +3 -0
  63. package/esm/browser/i18n/en/discover.js +3 -0
  64. package/esm/browser/i18n/en/service.d.ts +6 -0
  65. package/esm/browser/i18n/en/service.js +6 -0
  66. package/esm/browser/i18n/en/settings.d.ts +3 -0
  67. package/esm/browser/i18n/en/settings.js +3 -0
  68. package/esm/browser/i18n/ja/account.js +13 -6
  69. package/esm/browser/i18n/ja/chat.js +2 -0
  70. package/esm/browser/i18n/ja/discover.js +3 -0
  71. package/esm/browser/i18n/ja/service.js +6 -0
  72. package/esm/browser/i18n/ja/settings.js +3 -0
  73. package/esm/browser/i18n/locales.d.ts +22 -1
  74. package/esm/browser/i18n/messages.d.ts +21 -0
  75. package/esm/browser/i18n/zh/account.js +13 -6
  76. package/esm/browser/i18n/zh/chat.js +2 -0
  77. package/esm/browser/i18n/zh/discover.js +3 -0
  78. package/esm/browser/i18n/zh/service.js +6 -0
  79. package/esm/browser/i18n/zh/settings.js +3 -0
  80. package/esm/browser/i18n/zh-tw/account.js +13 -6
  81. package/esm/browser/i18n/zh-tw/chat.js +2 -0
  82. package/esm/browser/i18n/zh-tw/discover.js +3 -0
  83. package/esm/browser/i18n/zh-tw/service.js +6 -0
  84. package/esm/browser/i18n/zh-tw/settings.js +3 -0
  85. package/esm/browser/notices/notices.d.ts +2 -0
  86. package/esm/browser/notices/notices.js +2 -0
  87. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  88. package/esm/browser/settings/settings-protocol.d.ts +5 -0
  89. package/esm/browser/settings/settings-protocol.js +2 -0
  90. package/esm/browser/style/dialogs.d.ts +1 -1
  91. package/esm/browser/style/dialogs.js +7 -0
  92. package/lib/browser/chat/chat-protocol.d.ts +7 -0
  93. package/lib/browser/chat/chat-view.js +1 -1
  94. package/lib/browser/chat/chat.d.ts +1 -0
  95. package/lib/browser/chat/chat.js +14 -2
  96. package/lib/browser/chat/draft-model.d.ts +1 -1
  97. package/lib/browser/chat/draft-model.js +2 -2
  98. package/lib/browser/components/account-menu.d.ts +2 -0
  99. package/lib/browser/components/account-menu.js +10 -1
  100. package/lib/browser/components/app-nav.js +3 -0
  101. package/lib/browser/components/app-update-view.d.ts +3 -0
  102. package/lib/browser/components/app-update-view.js +73 -0
  103. package/lib/browser/components/app-view.js +21 -1
  104. package/lib/browser/components/auth-guide.d.ts +26 -0
  105. package/lib/browser/components/auth-guide.js +47 -0
  106. package/lib/browser/components/auth-view.d.ts +2 -0
  107. package/lib/browser/components/auth-view.js +29 -8
  108. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  109. package/lib/browser/components/custom-provider-util.d.ts +2 -0
  110. package/lib/browser/components/custom-provider-util.js +5 -0
  111. package/lib/browser/components/custom-provider-view.js +30 -9
  112. package/lib/browser/components/discover-view.d.ts +8 -1
  113. package/lib/browser/components/discover-view.js +27 -2
  114. package/lib/browser/components/extension-settings.js +1 -0
  115. package/lib/browser/components/first-steps-util.d.ts +30 -0
  116. package/lib/browser/components/first-steps-util.js +44 -0
  117. package/lib/browser/components/first-steps.d.ts +4 -0
  118. package/lib/browser/components/first-steps.js +72 -0
  119. package/lib/browser/components/host-view.d.ts +1 -1
  120. package/lib/browser/components/me-rows.d.ts +8 -1
  121. package/lib/browser/components/me-rows.js +3 -3
  122. package/lib/browser/components/me-view.js +1 -1
  123. package/lib/browser/components/message-user.js +5 -2
  124. package/lib/browser/components/model-picker.d.ts +5 -0
  125. package/lib/browser/components/model-picker.js +10 -1
  126. package/lib/browser/components/nav-places.d.ts +14 -0
  127. package/lib/browser/components/nav-places.js +13 -1
  128. package/lib/browser/components/relay-view-util.d.ts +6 -0
  129. package/lib/browser/components/relay-view-util.js +17 -0
  130. package/lib/browser/components/relay-view.js +10 -6
  131. package/lib/browser/components/settings-choices.js +2 -0
  132. package/lib/browser/components/settings-controls.d.ts +15 -0
  133. package/lib/browser/components/settings-controls.js +13 -0
  134. package/lib/browser/components/settings-more.js +1 -0
  135. package/lib/browser/components/settings-parts.d.ts +3 -1
  136. package/lib/browser/components/settings-parts.js +3 -0
  137. package/lib/browser/components/settings-view.js +36 -10
  138. package/lib/browser/device/app-update.d.ts +63 -0
  139. package/lib/browser/device/app-update.js +182 -0
  140. package/lib/browser/extension/icons.js +1 -0
  141. package/lib/browser/extension/web-api-contributions.d.ts +6 -1
  142. package/lib/browser/extension/web-api-partners.d.ts +6 -0
  143. package/lib/browser/extension/web-api-spec.js +1 -0
  144. package/lib/browser/extension/web-home.js +9 -0
  145. package/lib/browser/extension/web-metrics.d.ts +3 -0
  146. package/lib/browser/extension/web-metrics.js +32 -21
  147. package/lib/browser/extension/web-pages.d.ts +3 -1
  148. package/lib/browser/extension/web-pages.js +1 -0
  149. package/lib/browser/i18n/en/account.d.ts +7 -0
  150. package/lib/browser/i18n/en/account.js +13 -6
  151. package/lib/browser/i18n/en/chat.d.ts +2 -0
  152. package/lib/browser/i18n/en/chat.js +2 -0
  153. package/lib/browser/i18n/en/discover.d.ts +3 -0
  154. package/lib/browser/i18n/en/discover.js +3 -0
  155. package/lib/browser/i18n/en/service.d.ts +6 -0
  156. package/lib/browser/i18n/en/service.js +6 -0
  157. package/lib/browser/i18n/en/settings.d.ts +3 -0
  158. package/lib/browser/i18n/en/settings.js +3 -0
  159. package/lib/browser/i18n/ja/account.js +13 -6
  160. package/lib/browser/i18n/ja/chat.js +2 -0
  161. package/lib/browser/i18n/ja/discover.js +3 -0
  162. package/lib/browser/i18n/ja/service.js +6 -0
  163. package/lib/browser/i18n/ja/settings.js +3 -0
  164. package/lib/browser/i18n/locales.d.ts +22 -1
  165. package/lib/browser/i18n/messages.d.ts +21 -0
  166. package/lib/browser/i18n/zh/account.js +13 -6
  167. package/lib/browser/i18n/zh/chat.js +2 -0
  168. package/lib/browser/i18n/zh/discover.js +3 -0
  169. package/lib/browser/i18n/zh/service.js +6 -0
  170. package/lib/browser/i18n/zh/settings.js +3 -0
  171. package/lib/browser/i18n/zh-tw/account.js +13 -6
  172. package/lib/browser/i18n/zh-tw/chat.js +2 -0
  173. package/lib/browser/i18n/zh-tw/discover.js +3 -0
  174. package/lib/browser/i18n/zh-tw/service.js +6 -0
  175. package/lib/browser/i18n/zh-tw/settings.js +3 -0
  176. package/lib/browser/notices/notices.d.ts +2 -0
  177. package/lib/browser/notices/notices.js +3 -1
  178. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  179. package/lib/browser/settings/settings-protocol.d.ts +5 -0
  180. package/lib/browser/settings/settings-protocol.js +2 -0
  181. package/lib/browser/style/dialogs.d.ts +1 -1
  182. package/lib/browser/style/dialogs.js +7 -0
  183. package/package.json +7 -7
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AppUpdate = exports.AppUpdates = exports.AppUpdateUtil = void 0;
37
+ exports.useAppUpdate = useAppUpdate;
38
+ const React = __importStar(require("react"));
39
+ const device_1 = require("./device");
40
+ var AppUpdateUtil;
41
+ (function (AppUpdateUtil) {
42
+ AppUpdateUtil.FILE = 'ta-app.json';
43
+ function source(value) {
44
+ const one = value;
45
+ if (!one || typeof one !== 'object' || typeof one.updates !== 'string' || !one.updates.startsWith('https://')) {
46
+ return undefined;
47
+ }
48
+ if (typeof one.target !== 'string' || typeof one.version !== 'string' || !Number.isFinite(one.build)) {
49
+ return undefined;
50
+ }
51
+ return { updates: one.updates, target: one.target, version: one.version, build: Number(one.build) };
52
+ }
53
+ AppUpdateUtil.source = source;
54
+ /**
55
+ * The build of the manifest when it is newer than the app's, with the link that installs it: the itms-services link
56
+ * the manifest gives (iOS), else the address of its file; either only of the site of the manifest.
57
+ */
58
+ function offer(source, manifest) {
59
+ var _a;
60
+ const one = manifest;
61
+ const file = (_a = one === null || one === void 0 ? void 0 : one.files) === null || _a === void 0 ? void 0 : _a[source.target];
62
+ if (typeof (one === null || one === void 0 ? void 0 : one.version) !== 'string' || typeof one.build !== 'number' || !(one.build > source.build) || !file) {
63
+ return undefined;
64
+ }
65
+ const link = linkOf(source.updates, file);
66
+ return link ? { version: one.version, build: one.build, link } : undefined;
67
+ }
68
+ AppUpdateUtil.offer = offer;
69
+ function linkOf(updates, file) {
70
+ var _a;
71
+ const site = new URL(updates).origin;
72
+ if (typeof file.install === 'string') {
73
+ const install = parse(file.install);
74
+ const manifest = (install === null || install === void 0 ? void 0 : install.protocol) === 'itms-services:' ? parse((_a = install.searchParams.get('url')) !== null && _a !== void 0 ? _a : '') : undefined;
75
+ return (manifest === null || manifest === void 0 ? void 0 : manifest.origin) === site ? file.install : undefined;
76
+ }
77
+ const at = typeof file.path === 'string' ? parse(file.path, updates) : undefined;
78
+ return (at === null || at === void 0 ? void 0 : at.origin) === site ? at.href : undefined;
79
+ }
80
+ function parse(url, base) {
81
+ try {
82
+ return new URL(url, base);
83
+ }
84
+ catch (_a) {
85
+ return undefined;
86
+ }
87
+ }
88
+ })(AppUpdateUtil || (exports.AppUpdateUtil = AppUpdateUtil = {}));
89
+ /**
90
+ * Newer versions of the phone app that does not update itself (the iPhone app signed for the company): read from the
91
+ * manifest of its download page as the app starts and each time it comes back to the front, and installed with a tap
92
+ * (the system asks, then puts the new version in its place, nothing lost). Nothing where the app does not say where its
93
+ * new versions are (AppUpdateSource); one not read (offline, outside the company's network) leaves what was known.
94
+ */
95
+ class AppUpdates {
96
+ constructor(environment = browser) {
97
+ this.environment = environment;
98
+ this.started = false;
99
+ this.listeners = new Set();
100
+ }
101
+ get offer() {
102
+ this.start();
103
+ return this.current;
104
+ }
105
+ subscribe(listener) {
106
+ this.listeners.add(listener);
107
+ return () => this.listeners.delete(listener);
108
+ }
109
+ start() {
110
+ if (this.started) {
111
+ return;
112
+ }
113
+ this.started = true;
114
+ const env = this.environment();
115
+ if (!env) {
116
+ return;
117
+ }
118
+ void this.check(env);
119
+ env.onForeground(() => void this.check(env));
120
+ }
121
+ install() {
122
+ var _a;
123
+ if (this.current) {
124
+ (_a = this.environment()) === null || _a === void 0 ? void 0 : _a.open(this.current.link);
125
+ }
126
+ }
127
+ async check(env) {
128
+ var _a;
129
+ var _b;
130
+ (_b = this.source) !== null && _b !== void 0 ? _b : (this.source = env.own().then(AppUpdateUtil.source, () => undefined));
131
+ const source = await this.source;
132
+ if (!source) {
133
+ return;
134
+ }
135
+ const manifest = await env.get(source.updates).catch(() => undefined);
136
+ if (manifest === undefined) {
137
+ return;
138
+ }
139
+ const offer = AppUpdateUtil.offer(source, manifest);
140
+ if ((offer === null || offer === void 0 ? void 0 : offer.build) !== ((_a = this.current) === null || _a === void 0 ? void 0 : _a.build)) {
141
+ this.current = offer;
142
+ for (const listener of this.listeners) {
143
+ listener();
144
+ }
145
+ }
146
+ }
147
+ }
148
+ exports.AppUpdates = AppUpdates;
149
+ /** The Ta app (Capacitor): its own file read from its page, the manifest by its HTTP plugin (no CORS there); none in a browser. */
150
+ function browser() {
151
+ const http = typeof window === 'undefined' ? undefined : (0, device_1.nativePlugin)('CapacitorHttp');
152
+ if (!http) {
153
+ return undefined;
154
+ }
155
+ return {
156
+ own: async () => {
157
+ const response = await fetch(new URL(AppUpdateUtil.FILE, document.baseURI), { cache: 'no-store' });
158
+ return response.ok ? response.json() : undefined;
159
+ },
160
+ get: async (url) => {
161
+ const response = (await http('get', { url, responseType: 'json', headers: { 'Cache-Control': 'no-cache' } }));
162
+ if (!response || !(Number(response.status) < 400)) {
163
+ throw new Error(`${url}: ${response === null || response === void 0 ? void 0 : response.status}`);
164
+ }
165
+ return typeof response.data === 'string' ? JSON.parse(response.data) : response.data;
166
+ },
167
+ onForeground: listener => document.addEventListener('visibilitychange', () => {
168
+ if (document.visibilityState === 'visible') {
169
+ listener();
170
+ }
171
+ }),
172
+ open: link => {
173
+ window.location.href = link;
174
+ },
175
+ };
176
+ }
177
+ exports.AppUpdate = new AppUpdates();
178
+ /** The newer version of the phone app to install, while there is one. */
179
+ function useAppUpdate() {
180
+ return React.useSyncExternalStore(listener => exports.AppUpdate.subscribe(listener), () => exports.AppUpdate.offer, () => undefined);
181
+ }
182
+ //# sourceMappingURL=app-update.js.map
@@ -70,6 +70,7 @@ exports.WEB_ICONS = Object.freeze({
70
70
  Ellipsis: lucide_react_1.Ellipsis,
71
71
  ExternalLink: lucide_react_1.ExternalLink,
72
72
  Eye: lucide_react_1.Eye,
73
+ EyeOff: lucide_react_1.EyeOff,
73
74
  File: lucide_react_1.File,
74
75
  FileArchive: lucide_react_1.FileArchive,
75
76
  FileDiff: lucide_react_1.FileDiff,
@@ -1,5 +1,5 @@
1
1
  /** Part of the web extension API (web-extension-api.ts, which exports it all): what an extension registers, and what the page tells it of them. */
2
- import type { TaRoomInfo } from '@celljs/ta-protocol';
2
+ import type { TaRoomInfo, TaTier } from '@celljs/ta-protocol';
3
3
  import type * as React from 'react';
4
4
  import type { WebIcon } from './web-extension-api';
5
5
  export type * from './web-api-call';
@@ -23,6 +23,11 @@ export interface WebSettingsSection {
23
23
  group?: WebSettingsGroup;
24
24
  /** Smaller first among those of extensions in its group, then as registered; default 100 (negative: before Ta's). */
25
25
  order?: number;
26
+ /**
27
+ * `common` for a section most people look for (docs/design/ta-simple.md 4.2), shown from the start; the others (the
28
+ * default) a row away, under More settings, and found by the search. Newer than some Ta apps, which show all.
29
+ */
30
+ tier?: TaTier;
26
31
  rows: WebSettingRow[];
27
32
  /** A store of Settings → Storage (TaStorageInfo.id): its rows show under it there; older Ta apps list it as a section. */
28
33
  storage?: string;
@@ -169,6 +169,12 @@ export interface WebPartnersUI {
169
169
  * Ta apps: `pi.ui.openPartner?.(…)`.
170
170
  */
171
171
  openPartner(id: string, kind?: WebPartnerKind): Promise<boolean>;
172
+ /**
173
+ * The partners of every extension as the page lists them, now and each time they change, until the function it
174
+ * returns is called: for what follows who the user works with (Screenshot mask hides the names of friends). Newer
175
+ * than some Ta apps: `pi.ui.onPartners?.(…)`.
176
+ */
177
+ onPartners(listener: (partners: readonly WebPartnerEntry[]) => void): () => void;
172
178
  /**
173
179
  * Picks people as every picker of Ta does (WebPeoplePickerProps): never a `<select>` or checkboxes of one's own.
174
180
  * Newer than some Ta apps: `pi.ui.PeoplePicker` may be missing.
@@ -157,6 +157,7 @@ exports.WEB_UI_SPEC = {
157
157
  openHome: page,
158
158
  startGroup: page,
159
159
  openPartner: page,
160
+ onPartners: page,
160
161
  };
161
162
  /** What each member of `pi` needs and how it crosses: one entry each, the only place it is said (3.2). */
162
163
  exports.WEB_API_SPEC = {
@@ -71,6 +71,15 @@ var WebHomeUtil;
71
71
  await partner.open();
72
72
  return true;
73
73
  },
74
+ onPartners: listener => {
75
+ const tell = () => {
76
+ if (!stopped()) {
77
+ listener(extensions.partners.partners());
78
+ }
79
+ };
80
+ tell();
81
+ return extensions.partners.subscribe(tell);
82
+ },
74
83
  PeoplePicker: people_picker_1.PeoplePicker,
75
84
  };
76
85
  }
@@ -23,6 +23,9 @@ export declare class WebMetrics {
23
23
  dispose(): void;
24
24
  /** One of `item` (`page:main`, `web:load`) of the package of `extension`. */
25
25
  record(extension: string | undefined, item: string, err?: boolean, ms?: number): void;
26
+ /** One of `item` of Ta's own pages (`page:settings`, `step:first-reply`), in TA_METRICS_OWN. */
27
+ own(item: string, ms?: number): void;
28
+ protected add(pkg: string, item: string, err: boolean, ms: number | undefined): void;
26
29
  /** What threw where an extension drew (ExtensionBoundary). */
27
30
  renderError(extension: string | undefined): void;
28
31
  /** What was counted, told when it may be; dropped when the service does not take it. */
@@ -45,34 +45,45 @@ class WebMetrics {
45
45
  }
46
46
  /** One of `item` (`page:main`, `web:load`) of the package of `extension`. */
47
47
  record(extension, item, err = false, ms) {
48
- var _a, _b;
49
48
  try {
50
49
  const pkg = extension === undefined ? undefined : this.packageOf(extension);
51
- if (!pkg) {
52
- return;
53
- }
54
- const key = `${pkg}\u0000${item}`;
55
- let one = this.counts.get(key);
56
- if (!one) {
57
- if (this.counts.size >= ta_protocol_1.TA_METRICS_BATCH) {
58
- return;
59
- }
60
- one = { pkg, item, n: 0 };
61
- this.counts.set(key, one);
62
- }
63
- one.n++;
64
- if (err) {
65
- one.err = ((_a = one.err) !== null && _a !== void 0 ? _a : 0) + 1;
66
- }
67
- if (ms !== undefined && Number.isFinite(ms) && ms >= 0) {
68
- (_b = one.ms) !== null && _b !== void 0 ? _b : (one.ms = new Array(ta_protocol_1.TA_METRICS_BOUNDS.length + 1).fill(0));
69
- one.ms[ta_protocol_1.TaMetricsUtil.bucket(ms)]++;
50
+ if (pkg) {
51
+ this.add(pkg, item, err, ms);
70
52
  }
71
53
  }
72
- catch (_c) {
54
+ catch (_a) {
73
55
  // Never to what it counts.
74
56
  }
75
57
  }
58
+ /** One of `item` of Ta's own pages (`page:settings`, `step:first-reply`), in TA_METRICS_OWN. */
59
+ own(item, ms) {
60
+ try {
61
+ this.add(ta_protocol_1.TA_METRICS_OWN, item, false, ms);
62
+ }
63
+ catch (_a) {
64
+ // Never to what it counts.
65
+ }
66
+ }
67
+ add(pkg, item, err, ms) {
68
+ var _a, _b;
69
+ const key = `${pkg}\u0000${item}`;
70
+ let one = this.counts.get(key);
71
+ if (!one) {
72
+ if (this.counts.size >= ta_protocol_1.TA_METRICS_BATCH) {
73
+ return;
74
+ }
75
+ one = { pkg, item, n: 0 };
76
+ this.counts.set(key, one);
77
+ }
78
+ one.n++;
79
+ if (err) {
80
+ one.err = ((_a = one.err) !== null && _a !== void 0 ? _a : 0) + 1;
81
+ }
82
+ if (ms !== undefined && Number.isFinite(ms) && ms >= 0) {
83
+ (_b = one.ms) !== null && _b !== void 0 ? _b : (one.ms = new Array(ta_protocol_1.TA_METRICS_BOUNDS.length + 1).fill(0));
84
+ one.ms[ta_protocol_1.TaMetricsUtil.bucket(ms)]++;
85
+ }
86
+ }
76
87
  /** What threw where an extension drew (ExtensionBoundary). */
77
88
  renderError(extension) {
78
89
  this.record(extension, 'render:view', true);
@@ -1,4 +1,4 @@
1
- import type { TaTemporaryInfo, TaWebExtensionInfo } from '@celljs/ta-protocol';
1
+ import type { TaTemporaryInfo, TaTier, TaWebExtensionInfo } from '@celljs/ta-protocol';
2
2
  import type { StateSpec } from '../state/state-protocol';
3
3
  import type { WebIcon } from './web-extension-api';
4
4
  import { type WebViewEntry } from './web-extension-protocol';
@@ -42,6 +42,8 @@ export interface WebPageInfo {
42
42
  category?: string;
43
43
  /** Its group under Discover: WebView.group, or `pi.group` of its package for one started on open (TaWebExtensionInfo.group). */
44
44
  group?: string;
45
+ /** `pi.tier` of its package (TaWebExtensionInfo.tier): who it is for, as Discover lists it (DiscoverUtil.split). */
46
+ tier?: TaTier;
45
47
  /** For a page of a temporary package: `id` is that of its web extension, for `packages.updateTemporaryPackage` and the rest. */
46
48
  temporary?: TaTemporaryInfo & {
47
49
  id: string;
@@ -63,6 +63,7 @@ var WebPagesUtil;
63
63
  const own = (info) => ({
64
64
  ...(info && info.origin !== 'builtin' ? { extensionId: info.id, source: info.source } : {}),
65
65
  ...((info === null || info === void 0 ? void 0 : info.category) ? { category: info.category } : {}),
66
+ ...((info === null || info === void 0 ? void 0 : info.tier) ? { tier: info.tier } : {}),
66
67
  });
67
68
  const lazy = new Set(onOpen.map(entry => entry.info.id));
68
69
  const pages = views
@@ -87,6 +87,7 @@ export declare const ACCOUNT_EN: {
87
87
  'ta.presence.owner': string;
88
88
  'ta.account': string;
89
89
  'ta.account.service': string;
90
+ 'ta.account.thisComputer': string;
90
91
  'ta.account.menu': string;
91
92
  'ta.me': string;
92
93
  'ta.auth.title': string;
@@ -156,6 +157,12 @@ export declare const ACCOUNT_EN: {
156
157
  'ta.auth.waiting': string;
157
158
  'ta.auth.done': string;
158
159
  'ta.auth.failed': string;
160
+ 'ta.auth.keyGuide': string;
161
+ 'ta.auth.keyPage': string;
162
+ 'ta.auth.pricing': string;
163
+ 'ta.auth.keyRefused': string;
164
+ 'ta.auth.keyAgain': string;
165
+ 'ta.auth.more': string;
159
166
  'ta.auth.none': string;
160
167
  'ta.auth.search': string;
161
168
  'ta.auth.accountsTitle': string;
@@ -4,20 +4,20 @@ exports.ACCOUNT_EN = void 0;
4
4
  /** The words of the account: signing in, who may come in, the devices, the vault, in ICU format. English is the source and the fallback. */
5
5
  exports.ACCOUNT_EN = {
6
6
  'ta.signin.title': 'Connect to Ta',
7
- 'ta.signin.hint': 'Run ta serve --web in a terminal, which opens this page signed in, or paste the token from ~/.ta/agent/serve.json.',
8
- 'ta.signin.token': 'Access token',
7
+ 'ta.signin.hint': 'Run ta serve --web on the computer, which opens this page signed in, or paste the connection code (the token in ~/.ta/agent/serve.json on the computer).',
8
+ 'ta.signin.token': 'Connection code',
9
9
  'ta.signin.connect': 'Connect',
10
- 'ta.signin.refused': 'The Ta service did not accept the token, or it is not running.',
10
+ 'ta.signin.refused': 'The Ta on the computer did not accept the connection code, or it is not running.',
11
11
  'ta.signin.pairHint': 'On your computer, run ta pair <relay> and paste the link it prints here. What goes through the relay is encrypted end to end.',
12
12
  'ta.signin.pairing': 'Pairing link',
13
13
  'ta.signin.pairRefused': 'Your Ta does not know this device: it may have been unpaired. Run ta pair again.',
14
- 'ta.signin.accountsHint': 'Sign in with your account, or paste the access token of the Ta service.',
14
+ 'ta.signin.accountsHint': 'Sign in with your account, or paste the connection code of the Ta on your computer.',
15
15
  'ta.signin.with': 'Continue with {name}',
16
16
  'ta.signin.wechat': 'WeChat',
17
17
  'ta.signin.orToken': 'or',
18
18
  'ta.signin.denied': '{account} may not use this Ta yet. Its owner can let you in under Settings, Access.',
19
19
  'ta.signin.failed': 'Signing in did not finish. Try again.',
20
- 'ta.signin.hintRemote': 'Open the sign-in link of your Ta service or gateway, or paste its access token.',
20
+ 'ta.signin.hintRemote': 'Open the sign-in link of your Ta or gateway, or paste its connection code.',
21
21
  'ta.access.title': 'Access',
22
22
  'ta.access.bind': 'Sign in with your account',
23
23
  'ta.access.bindHint': 'Lets in the account you sign in with, so that it signs you in next time, on any device.',
@@ -90,7 +90,8 @@ exports.ACCOUNT_EN = {
90
90
  'ta.presence.more': ' +{count}',
91
91
  'ta.presence.owner': 'Owner',
92
92
  'ta.account': 'Account',
93
- 'ta.account.service': 'Ta service',
93
+ 'ta.account.service': 'Computer',
94
+ 'ta.account.thisComputer': 'This computer',
94
95
  // The settings view and the menu of the account
95
96
  'ta.account.menu': 'Account and settings',
96
97
  'ta.me': 'Me',
@@ -161,6 +162,12 @@ exports.ACCOUNT_EN = {
161
162
  'ta.auth.waiting': 'Waiting…',
162
163
  'ta.auth.done': 'Signed in to {name}',
163
164
  'ta.auth.failed': 'Could not sign in: {message}',
165
+ 'ta.auth.keyGuide': 'Create a key on the site of {name} and paste it here; you pay for what you use.',
166
+ 'ta.auth.keyPage': 'Create a key',
167
+ 'ta.auth.pricing': 'Prices',
168
+ 'ta.auth.keyRefused': '{name} did not take this key, so it was not saved. Copy it again.',
169
+ 'ta.auth.keyAgain': 'Type it again',
170
+ 'ta.auth.more': 'More providers ({count})',
164
171
  'ta.auth.none': 'No matching providers',
165
172
  'ta.auth.search': 'Search providers',
166
173
  'ta.auth.accountsTitle': 'Model accounts',
@@ -89,6 +89,8 @@ export declare const CHAT_EN: {
89
89
  'ta.message.sendFailed': string;
90
90
  'ta.message.resend': string;
91
91
  'ta.message.discard': string;
92
+ 'ta.message.noModel': string;
93
+ 'ta.message.connectModel': string;
92
94
  'ta.message.selectText': string;
93
95
  'ta.message.copyFrom': string;
94
96
  'ta.message.copiedFrom': string;
@@ -92,6 +92,8 @@ exports.CHAT_EN = {
92
92
  'ta.message.sendFailed': 'Not sent',
93
93
  'ta.message.resend': 'Send again',
94
94
  'ta.message.discard': 'Delete',
95
+ 'ta.message.noModel': 'No model connected yet, so Ta cannot answer',
96
+ 'ta.message.connectModel': 'Connect a model',
95
97
  'ta.message.selectText': 'Select text',
96
98
  'ta.message.copyFrom': 'Copy from here to the end',
97
99
  'ta.message.copiedFrom': '{count, plural, one {Copied # message} other {Copied # messages}} as Markdown',
@@ -95,6 +95,9 @@ export declare const DISCOVER_EN: {
95
95
  'ta.launcher.place.discover': string;
96
96
  'ta.launcher.place.launcher': string;
97
97
  'ta.launcher.place.list': string;
98
+ 'ta.discover.all': string;
99
+ 'ta.discover.showAll': string;
100
+ 'ta.discover.allHint': string;
98
101
  'ta.discover.empty': string;
99
102
  'ta.discover.emptyHint': string;
100
103
  'ta.discover.hint': string;
@@ -99,6 +99,9 @@ exports.DISCOVER_EN = {
99
99
  'ta.launcher.place.discover': 'Under Discover',
100
100
  'ta.launcher.place.launcher': 'Quick open',
101
101
  'ta.launcher.place.list': 'In a list',
102
+ 'ta.discover.all': 'All features',
103
+ 'ta.discover.showAll': 'List every feature in Discover',
104
+ 'ta.discover.allHint': 'A feature you use shows in Discover by itself, and comes back here after 30 days unused.',
102
105
  'ta.discover.empty': 'Nothing here yet',
103
106
  'ta.discover.emptyHint': 'The features extensions add come here',
104
107
  'ta.discover.hint': 'Right-click a feature to put it in the navigation.',
@@ -29,6 +29,10 @@ export declare const SERVICE_EN: {
29
29
  'ta.update.readyDetail': string;
30
30
  'ta.update.later': string;
31
31
  'ta.update.restartTo': string;
32
+ 'ta.appUpdate.available': string;
33
+ 'ta.appUpdate.detail': string;
34
+ 'ta.appUpdate.update': string;
35
+ 'ta.appUpdate.installTo': string;
32
36
  'ta.release.available': string;
33
37
  'ta.release.detail': string;
34
38
  'ta.release.install': string;
@@ -255,6 +259,8 @@ export declare const SERVICE_EN: {
255
259
  'ta.relay.phone': string;
256
260
  'ta.relay.pair': string;
257
261
  'ta.relay.scan': string;
262
+ 'ta.relay.noApp': string;
263
+ 'ta.relay.download': string;
258
264
  'ta.relay.done': string;
259
265
  'ta.relay.devices': string;
260
266
  'ta.relay.online': string;
@@ -33,6 +33,10 @@ exports.SERVICE_EN = {
33
33
  'ta.update.readyDetail': 'Restart Ta to use it. Running tasks carry on after it.',
34
34
  'ta.update.later': 'Later',
35
35
  'ta.update.restartTo': 'Restart to use {version}',
36
+ 'ta.appUpdate.available': 'Ta {version} is out',
37
+ 'ta.appUpdate.detail': 'Tap Update, then Install in the dialog: Ta closes and the new version takes its place, nothing lost.',
38
+ 'ta.appUpdate.update': 'Update',
39
+ 'ta.appUpdate.installTo': 'Update to Ta {version}',
36
40
  'ta.release.available': 'Ta {version} is out',
37
41
  'ta.release.detail': 'Runs {command}; running tasks carry on after the restart.',
38
42
  'ta.release.install': 'Update and restart',
@@ -260,6 +264,8 @@ exports.SERVICE_EN = {
260
264
  'ta.relay.phone': 'Phone',
261
265
  'ta.relay.pair': 'Pair a device',
262
266
  'ta.relay.scan': 'Scan it with the Ta app on the phone. The code works once; keep it to yourself.',
267
+ 'ta.relay.noApp': 'No Ta on the phone yet? Scan the code with its camera, or',
268
+ 'ta.relay.download': 'download Ta',
263
269
  'ta.relay.done': 'Done',
264
270
  'ta.relay.devices': 'Paired devices',
265
271
  'ta.relay.online': 'Connected · {relay}',
@@ -160,6 +160,9 @@ export declare const SETTINGS_EN: {
160
160
  'ta.settings.recentShotsOpenSettings': string;
161
161
  'ta.settings.clipboardLinks': string;
162
162
  'ta.settings.clipboardLinksHint': string;
163
+ 'ta.settings.allFeatures': string;
164
+ 'ta.settings.allFeaturesHint': string;
165
+ 'ta.settings.more': string;
163
166
  'ta.settings.navigation': string;
164
167
  'ta.settings.navigation.show': string;
165
168
  'ta.settings.navigation.inNav': string;
@@ -163,6 +163,9 @@ exports.SETTINGS_EN = {
163
163
  'ta.settings.recentShotsOpenSettings': 'Open System Settings',
164
164
  'ta.settings.clipboardLinks': 'Spot links of Ta you copy',
165
165
  'ta.settings.clipboardLinksHint': 'Copied a message with an invite or a share of Ta? Back in Ta, it shows what it is with Open; so does pasting it anywhere in Ta. The clipboard is read only as you come back, and nothing of it is kept. On iPhone, only once you tap Open',
166
+ 'ta.settings.allFeatures': 'Show all features',
167
+ 'ta.settings.allFeaturesHint': 'Every feature in Discover and every section here; off, only the common ones and those you use',
168
+ 'ta.settings.more': 'More settings',
166
169
  'ta.settings.navigation': 'Navigation',
167
170
  'ta.settings.navigation.show': 'In the navigation',
168
171
  'ta.settings.navigation.inNav': 'In the navigation',
@@ -3,20 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ACCOUNT_JA = void 0;
4
4
  exports.ACCOUNT_JA = {
5
5
  'ta.signin.title': 'Ta に接続',
6
- 'ta.signin.hint': 'ターミナルで ta serve --web を実行します。このページが自動的に開かれてサインインされます。また、~/.ta/agent/serve.json からトークンを貼り付けることもできます。',
7
- 'ta.signin.token': 'アクセストークン',
6
+ 'ta.signin.hint': 'コンピューターで ta serve --web を実行すると、このページがサインイン済みで開きます。接続コード(コンピューターの ~/.ta/agent/serve.json にある token)を貼り付けることもできます。',
7
+ 'ta.signin.token': '接続コード',
8
8
  'ta.signin.connect': '接続',
9
- 'ta.signin.refused': 'Ta サービスがトークンを受け入れませんでした。または実行されていません。',
9
+ 'ta.signin.refused': 'コンピューターの Ta が接続コードを受け入れませんでした。または実行されていません。',
10
10
  'ta.signin.pairHint': 'コンピューター上で ta pair <リレー> を実行して、それが出力するリンクをここに貼り付けます。リレーを通じた内容はエンドツーエンドで暗号化されます。',
11
11
  'ta.signin.pairing': 'ペアリングリンク',
12
12
  'ta.signin.pairRefused': 'あなたの Ta はこのデバイスを認識しません。ペアリングが解除されている可能性があります。ta pair をもう一度実行してください。',
13
- 'ta.signin.accountsHint': 'アカウントでサインインするか、Ta サービスのアクセストークンを貼り付けてください。',
13
+ 'ta.signin.accountsHint': 'アカウントでサインインするか、コンピューターの Ta の接続コードを貼り付けてください。',
14
14
  'ta.signin.with': '{name} で続行',
15
15
  'ta.signin.wechat': 'WeChat',
16
16
  'ta.signin.orToken': 'または',
17
17
  'ta.signin.denied': '{account} はまだこの Ta を使用できません。この Ta の所有者が「設定 → アクセス」で許可できます。',
18
18
  'ta.signin.failed': 'サインインが完了しませんでした。もう一度試してください。',
19
- 'ta.signin.hintRemote': 'Ta サービスまたはゲートウェイのサインインリンクを開くか、アクセストークンを貼り付けてください。',
19
+ 'ta.signin.hintRemote': 'Ta またはゲートウェイのサインインリンクを開くか、接続コードを貼り付けてください。',
20
20
  'ta.access.title': 'アクセス',
21
21
  'ta.access.bind': 'アカウントでサインイン',
22
22
  'ta.access.bindHint': 'サインインに使用するアカウントを許可するため、次回以降は任意のデバイスでサインインできます。',
@@ -88,7 +88,8 @@ exports.ACCOUNT_JA = {
88
88
  'ta.presence.more': '他 {count} 人',
89
89
  'ta.presence.owner': '所有者',
90
90
  'ta.account': 'アカウント',
91
- 'ta.account.service': 'Ta サービス',
91
+ 'ta.account.service': 'コンピューター',
92
+ 'ta.account.thisComputer': 'このコンピューター',
92
93
  'ta.account.menu': 'アカウントと設定',
93
94
  'ta.me': '私',
94
95
  'ta.auth.title': 'モデルサービスにサインイン',
@@ -158,6 +159,12 @@ exports.ACCOUNT_JA = {
158
159
  'ta.auth.waiting': '待機中…',
159
160
  'ta.auth.done': '{name} にサインインしました',
160
161
  'ta.auth.failed': 'サインインできませんでした:{message}',
162
+ 'ta.auth.keyGuide': '{name} のサイトで Key を作成して、ここに貼り付けてください。料金は使った分だけです。',
163
+ 'ta.auth.keyPage': 'Key を作成',
164
+ 'ta.auth.pricing': '料金',
165
+ 'ta.auth.keyRefused': '{name} がこの Key を受け付けなかったため、保存していません。もう一度コピーしてください。',
166
+ 'ta.auth.keyAgain': 'もう一度入力',
167
+ 'ta.auth.more': 'ほかのサービス({count} 件)',
161
168
  'ta.auth.none': '一致するプロバイダーがありません',
162
169
  'ta.auth.search': 'プロバイダーを検索',
163
170
  'ta.auth.accountsTitle': 'モデルアカウント',
@@ -91,6 +91,8 @@ exports.CHAT_JA = {
91
91
  'ta.message.sendFailed': '送信されませんでした',
92
92
  'ta.message.resend': 'もう一度送信',
93
93
  'ta.message.discard': '削除',
94
+ 'ta.message.noModel': 'モデルにまだ接続していないため、Ta は答えられません',
95
+ 'ta.message.connectModel': 'モデルに接続',
94
96
  'ta.message.selectText': 'テキストを選択',
95
97
  'ta.message.copyFrom': 'ここから最後までコピー',
96
98
  'ta.message.copiedFrom': '{count} 件のメッセージを Markdown でコピーしました',
@@ -97,6 +97,9 @@ exports.DISCOVER_JA = {
97
97
  'ta.launcher.place.discover': '「見つける」へ',
98
98
  'ta.launcher.place.launcher': 'クイックオープン',
99
99
  'ta.launcher.place.list': 'リストに',
100
+ 'ta.discover.all': 'すべての機能',
101
+ 'ta.discover.showAll': '見つけるにすべての機能を表示',
102
+ 'ta.discover.allHint': '使った機能は自動で見つけるに表示され、30 日使わないとここに戻ります。',
100
103
  'ta.discover.empty': 'ここはまだ何もありません',
101
104
  'ta.discover.emptyHint': '拡張機能が提供する機能はここにあります',
102
105
  'ta.discover.hint': '機能を右クリックするとナビゲーションバーに置けます。',
@@ -31,6 +31,10 @@ exports.SERVICE_JA = {
31
31
  'ta.update.readyDetail': 'Ta を再起動すると反映されます。実行中のタスクは再起動後に続きます。',
32
32
  'ta.update.later': 'あとで',
33
33
  'ta.update.restartTo': '再起動して {version} を使う',
34
+ 'ta.appUpdate.available': 'Ta {version} が出ました',
35
+ 'ta.appUpdate.detail': '「更新」をタップし、表示されたダイアログで「インストール」を選ぶと、Ta が閉じて新しいバージョンに入れ替わります。データは残ります。',
36
+ 'ta.appUpdate.update': '更新',
37
+ 'ta.appUpdate.installTo': 'Ta {version} に更新',
34
38
  'ta.release.available': '新しいバージョン {version} があります',
35
39
  'ta.release.detail': '{command} を実行します。実行中のタスクは再起動後に続きます。',
36
40
  'ta.release.install': '更新して再起動',
@@ -257,6 +261,8 @@ exports.SERVICE_JA = {
257
261
  'ta.relay.phone': 'スマホ',
258
262
  'ta.relay.pair': 'デバイスをペアリング',
259
263
  'ta.relay.scan': 'スマホの Ta アプリでスキャンしてください。ペアリングコードは一度だけ表示されます。他人に共有しないでください。',
264
+ 'ta.relay.noApp': 'Ta をまだ入れていない場合は、スマホのカメラでこのコードを読み取るか、',
265
+ 'ta.relay.download': 'Ta をダウンロード',
260
266
  'ta.relay.done': '完了',
261
267
  'ta.relay.devices': 'ペアリング済みデバイス',
262
268
  'ta.relay.online': '接続済み · {relay}',
@@ -162,6 +162,9 @@ exports.SETTINGS_JA = {
162
162
  'ta.settings.recentShotsOpenSettings': 'システム設定を開く',
163
163
  'ta.settings.clipboardLinks': 'コピーした Ta のリンクを見つける',
164
164
  'ta.settings.clipboardLinksHint': 'Ta の招待や共有のリンクを含む内容をコピーすると、Ta に戻ったときに何かを示し、「開く」で開けます。Ta のどこに貼り付けても同じです。クリップボードは戻った瞬間に一度だけ読み、内容は保存しません。iPhone では「開く」をタップしたときだけ読みます',
165
+ 'ta.settings.allFeatures': 'すべての機能を表示',
166
+ 'ta.settings.allFeaturesHint': '見つけるにすべての機能、設定にすべての項目を表示します。オフでは、よく使うものと使ったものだけ',
167
+ 'ta.settings.more': 'その他の設定',
165
168
  'ta.settings.navigation': 'ナビゲーション',
166
169
  'ta.settings.navigation.show': 'ナビゲーションバーに表示',
167
170
  'ta.settings.navigation.inNav': 'ナビゲーションバーに',