@celljs/ta-web 4.46.2 → 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.
- package/esm/browser/account/account-side.d.ts +3 -3
- package/esm/browser/account/account-side.js +11 -21
- package/esm/browser/account/device-account.d.ts +8 -0
- package/esm/browser/account/device-account.js +20 -0
- package/esm/browser/chat/chat-protocol.d.ts +7 -0
- package/esm/browser/chat/chat-view.js +1 -1
- package/esm/browser/chat/chat.d.ts +1 -0
- package/esm/browser/chat/chat.js +15 -3
- package/esm/browser/chat/draft-model.d.ts +1 -1
- package/esm/browser/chat/draft-model.js +2 -2
- package/esm/browser/components/access-view.js +12 -10
- package/esm/browser/components/account-menu.d.ts +2 -0
- package/esm/browser/components/account-menu.js +11 -2
- package/esm/browser/components/account-view.js +9 -5
- package/esm/browser/components/app-nav.js +4 -1
- package/esm/browser/components/app-shell-state.d.ts +2 -0
- package/esm/browser/components/app-update-view.d.ts +2 -0
- package/esm/browser/components/app-update-view.js +37 -0
- package/esm/browser/components/app-view.js +33 -108
- package/esm/browser/components/auth-guide.d.ts +25 -0
- package/esm/browser/components/auth-guide.js +44 -0
- package/esm/browser/components/auth-view.d.ts +2 -0
- package/esm/browser/components/auth-view.js +30 -9
- package/esm/browser/components/chat-list-controls.d.ts +38 -0
- package/esm/browser/components/chat-list-controls.js +46 -0
- package/esm/browser/components/chat-list-hooks.d.ts +19 -0
- package/esm/browser/components/chat-list-hooks.js +52 -0
- package/esm/browser/components/chat-list-rows.d.ts +51 -0
- package/esm/browser/components/chat-list-rows.js +110 -0
- package/esm/browser/components/chat-list-sections.d.ts +36 -0
- package/esm/browser/components/chat-list-sections.js +72 -0
- package/esm/browser/components/chat-list.js +48 -221
- 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/custom-provider-util.d.ts +2 -0
- package/esm/browser/components/custom-provider-util.js +5 -0
- package/esm/browser/components/custom-provider-view.js +33 -12
- package/esm/browser/components/device-sign-in-page.js +4 -5
- package/esm/browser/components/discover-view.d.ts +8 -1
- package/esm/browser/components/discover-view.js +28 -3
- package/esm/browser/components/environment-view.js +60 -62
- package/esm/browser/components/extension-settings.js +1 -0
- package/esm/browser/components/first-steps-util.d.ts +29 -0
- package/esm/browser/components/first-steps-util.js +41 -0
- package/esm/browser/components/first-steps.d.ts +3 -0
- package/esm/browser/components/first-steps.js +36 -0
- package/esm/browser/components/host-view.d.ts +3 -3
- package/esm/browser/components/host-view.js +11 -11
- package/esm/browser/components/me-rows.d.ts +8 -1
- package/esm/browser/components/me-rows.js +3 -3
- package/esm/browser/components/me-view.js +1 -1
- package/esm/browser/components/message-user.js +6 -3
- package/esm/browser/components/model-picker.d.ts +5 -0
- package/esm/browser/components/model-picker.js +10 -1
- package/esm/browser/components/nav-places.d.ts +14 -0
- package/esm/browser/components/nav-places.js +11 -0
- package/esm/browser/components/phone-shell.d.ts +14 -0
- package/esm/browser/components/phone-shell.js +22 -0
- package/esm/browser/components/picture-dialog.js +4 -7
- package/esm/browser/components/profile-view.js +1 -1
- package/esm/browser/components/relay-services.js +4 -7
- package/esm/browser/components/relay-view-util.d.ts +5 -0
- package/esm/browser/components/relay-view-util.js +14 -0
- package/esm/browser/components/relay-view.js +40 -37
- package/esm/browser/components/scan-screen.js +5 -8
- package/esm/browser/components/screen-navigator.d.ts +9 -0
- package/esm/browser/components/screen-navigator.js +84 -0
- package/esm/browser/components/search-page.js +9 -2
- package/esm/browser/components/serve-value.d.ts +27 -0
- package/esm/browser/components/serve-value.js +61 -0
- package/esm/browser/components/serve-watch.d.ts +23 -0
- package/esm/browser/components/serve-watch.js +36 -0
- package/esm/browser/components/settings-choices.js +2 -0
- package/esm/browser/components/settings-controls.d.ts +15 -0
- package/esm/browser/components/settings-controls.js +13 -0
- package/esm/browser/components/settings-more.js +6 -4
- package/esm/browser/components/settings-parts.d.ts +3 -1
- package/esm/browser/components/settings-parts.js +3 -0
- package/esm/browser/components/settings-view.js +37 -11
- package/esm/browser/components/share-friends.js +3 -4
- package/esm/browser/components/share-sheet.js +3 -4
- package/esm/browser/components/tool-view.js +17 -3
- package/esm/browser/device/app-update.d.ts +62 -0
- package/esm/browser/device/app-update.js +144 -0
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-api-contributions.d.ts +6 -1
- package/esm/browser/extension/web-api-partners.d.ts +6 -0
- package/esm/browser/extension/web-api-spec.js +1 -0
- package/esm/browser/extension/web-home.js +9 -0
- package/esm/browser/extension/web-metrics.d.ts +3 -0
- package/esm/browser/extension/web-metrics.js +33 -22
- package/esm/browser/extension/web-pages.d.ts +3 -1
- package/esm/browser/extension/web-pages.js +1 -0
- package/esm/browser/gateway/console-agents.js +11 -15
- package/esm/browser/gateway/console-parts.d.ts +7 -4
- package/esm/browser/gateway/console-parts.js +11 -20
- package/esm/browser/gateway/console-trend.js +2 -2
- package/esm/browser/gateway/console-updates.js +6 -4
- package/esm/browser/gateway/console-view.js +6 -6
- package/esm/browser/i18n/en/account.d.ts +7 -0
- package/esm/browser/i18n/en/account.js +13 -6
- package/esm/browser/i18n/en/chat.d.ts +2 -0
- package/esm/browser/i18n/en/chat.js +2 -0
- package/esm/browser/i18n/en/discover.d.ts +3 -0
- package/esm/browser/i18n/en/discover.js +3 -0
- package/esm/browser/i18n/en/service.d.ts +6 -0
- package/esm/browser/i18n/en/service.js +6 -0
- package/esm/browser/i18n/en/settings.d.ts +3 -0
- package/esm/browser/i18n/en/settings.js +3 -0
- package/esm/browser/i18n/ja/account.js +13 -6
- package/esm/browser/i18n/ja/chat.js +2 -0
- package/esm/browser/i18n/ja/discover.js +3 -0
- package/esm/browser/i18n/ja/service.js +6 -0
- package/esm/browser/i18n/ja/settings.js +3 -0
- package/esm/browser/i18n/locales.d.ts +22 -1
- package/esm/browser/i18n/messages.d.ts +21 -0
- package/esm/browser/i18n/zh/account.js +13 -6
- package/esm/browser/i18n/zh/chat.js +2 -0
- package/esm/browser/i18n/zh/discover.js +3 -0
- package/esm/browser/i18n/zh/service.js +6 -0
- package/esm/browser/i18n/zh/settings.js +3 -0
- package/esm/browser/i18n/zh-tw/account.js +13 -6
- package/esm/browser/i18n/zh-tw/chat.js +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +3 -0
- package/esm/browser/i18n/zh-tw/service.js +6 -0
- package/esm/browser/i18n/zh-tw/settings.js +3 -0
- package/esm/browser/notices/notices.d.ts +2 -0
- package/esm/browser/notices/notices.js +2 -0
- package/esm/browser/partners/group-picker.js +3 -4
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/settings/settings-protocol.d.ts +5 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +4 -3
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +7 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +5 -3
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +1 -1
- package/esm/browser/util/tool.d.ts +5 -0
- package/esm/browser/util/tool.js +21 -3
- package/lib/browser/account/account-side.d.ts +3 -3
- package/lib/browser/account/account-side.js +11 -21
- package/lib/browser/account/device-account.d.ts +8 -0
- package/lib/browser/account/device-account.js +20 -0
- package/lib/browser/chat/chat-protocol.d.ts +7 -0
- package/lib/browser/chat/chat-view.js +1 -1
- package/lib/browser/chat/chat.d.ts +1 -0
- package/lib/browser/chat/chat.js +14 -2
- package/lib/browser/chat/draft-model.d.ts +1 -1
- package/lib/browser/chat/draft-model.js +2 -2
- package/lib/browser/components/access-view.js +12 -10
- package/lib/browser/components/account-menu.d.ts +2 -0
- package/lib/browser/components/account-menu.js +11 -2
- package/lib/browser/components/account-view.js +9 -5
- package/lib/browser/components/app-nav.js +3 -0
- package/lib/browser/components/app-shell-state.d.ts +2 -0
- package/lib/browser/components/app-update-view.d.ts +3 -0
- package/lib/browser/components/app-update-view.js +73 -0
- package/lib/browser/components/app-view.js +30 -105
- package/lib/browser/components/auth-guide.d.ts +26 -0
- package/lib/browser/components/auth-guide.js +47 -0
- package/lib/browser/components/auth-view.d.ts +2 -0
- package/lib/browser/components/auth-view.js +29 -8
- package/lib/browser/components/chat-list-controls.d.ts +39 -0
- package/lib/browser/components/chat-list-controls.js +86 -0
- package/lib/browser/components/chat-list-hooks.d.ts +19 -0
- package/lib/browser/components/chat-list-hooks.js +53 -0
- package/lib/browser/components/chat-list-rows.d.ts +52 -0
- package/lib/browser/components/chat-list-rows.js +147 -0
- package/lib/browser/components/chat-list-sections.d.ts +37 -0
- package/lib/browser/components/chat-list-sections.js +108 -0
- package/lib/browser/components/chat-list.js +44 -217
- 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/custom-provider-util.d.ts +2 -0
- package/lib/browser/components/custom-provider-util.js +5 -0
- package/lib/browser/components/custom-provider-view.js +32 -11
- package/lib/browser/components/device-sign-in-page.js +4 -5
- package/lib/browser/components/discover-view.d.ts +8 -1
- package/lib/browser/components/discover-view.js +27 -2
- package/lib/browser/components/environment-view.js +60 -62
- package/lib/browser/components/extension-settings.js +1 -0
- package/lib/browser/components/first-steps-util.d.ts +30 -0
- package/lib/browser/components/first-steps-util.js +44 -0
- package/lib/browser/components/first-steps.d.ts +4 -0
- package/lib/browser/components/first-steps.js +72 -0
- package/lib/browser/components/host-view.d.ts +3 -3
- package/lib/browser/components/host-view.js +11 -11
- package/lib/browser/components/me-rows.d.ts +8 -1
- package/lib/browser/components/me-rows.js +3 -3
- package/lib/browser/components/me-view.js +1 -1
- package/lib/browser/components/message-user.js +5 -2
- package/lib/browser/components/model-picker.d.ts +5 -0
- package/lib/browser/components/model-picker.js +10 -1
- package/lib/browser/components/nav-places.d.ts +14 -0
- package/lib/browser/components/nav-places.js +13 -1
- package/lib/browser/components/phone-shell.d.ts +14 -0
- package/lib/browser/components/phone-shell.js +23 -0
- package/lib/browser/components/picture-dialog.js +4 -7
- package/lib/browser/components/profile-view.js +1 -1
- package/lib/browser/components/relay-services.js +4 -7
- package/lib/browser/components/relay-view-util.d.ts +6 -0
- package/lib/browser/components/relay-view-util.js +17 -0
- package/lib/browser/components/relay-view.js +38 -35
- package/lib/browser/components/scan-screen.js +5 -8
- package/lib/browser/components/screen-navigator.d.ts +9 -0
- package/lib/browser/components/screen-navigator.js +85 -0
- package/lib/browser/components/search-page.js +8 -1
- package/lib/browser/components/serve-value.d.ts +28 -0
- package/lib/browser/components/serve-value.js +97 -0
- package/lib/browser/components/serve-watch.d.ts +24 -0
- package/lib/browser/components/serve-watch.js +39 -0
- package/lib/browser/components/settings-choices.js +2 -0
- package/lib/browser/components/settings-controls.d.ts +15 -0
- package/lib/browser/components/settings-controls.js +13 -0
- package/lib/browser/components/settings-more.js +6 -4
- package/lib/browser/components/settings-parts.d.ts +3 -1
- package/lib/browser/components/settings-parts.js +3 -0
- package/lib/browser/components/settings-view.js +36 -10
- package/lib/browser/components/share-friends.js +3 -4
- package/lib/browser/components/share-sheet.js +3 -4
- package/lib/browser/components/tool-view.js +17 -3
- package/lib/browser/device/app-update.d.ts +63 -0
- package/lib/browser/device/app-update.js +182 -0
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-api-contributions.d.ts +6 -1
- package/lib/browser/extension/web-api-partners.d.ts +6 -0
- package/lib/browser/extension/web-api-spec.js +1 -0
- package/lib/browser/extension/web-home.js +9 -0
- package/lib/browser/extension/web-metrics.d.ts +3 -0
- package/lib/browser/extension/web-metrics.js +32 -21
- package/lib/browser/extension/web-pages.d.ts +3 -1
- package/lib/browser/extension/web-pages.js +1 -0
- package/lib/browser/gateway/console-agents.js +10 -14
- package/lib/browser/gateway/console-parts.d.ts +7 -4
- package/lib/browser/gateway/console-parts.js +12 -21
- package/lib/browser/gateway/console-trend.js +1 -1
- package/lib/browser/gateway/console-updates.js +5 -3
- package/lib/browser/gateway/console-view.js +5 -5
- package/lib/browser/i18n/en/account.d.ts +7 -0
- package/lib/browser/i18n/en/account.js +13 -6
- package/lib/browser/i18n/en/chat.d.ts +2 -0
- package/lib/browser/i18n/en/chat.js +2 -0
- package/lib/browser/i18n/en/discover.d.ts +3 -0
- package/lib/browser/i18n/en/discover.js +3 -0
- package/lib/browser/i18n/en/service.d.ts +6 -0
- package/lib/browser/i18n/en/service.js +6 -0
- package/lib/browser/i18n/en/settings.d.ts +3 -0
- package/lib/browser/i18n/en/settings.js +3 -0
- package/lib/browser/i18n/ja/account.js +13 -6
- package/lib/browser/i18n/ja/chat.js +2 -0
- package/lib/browser/i18n/ja/discover.js +3 -0
- package/lib/browser/i18n/ja/service.js +6 -0
- package/lib/browser/i18n/ja/settings.js +3 -0
- package/lib/browser/i18n/locales.d.ts +22 -1
- package/lib/browser/i18n/messages.d.ts +21 -0
- package/lib/browser/i18n/zh/account.js +13 -6
- package/lib/browser/i18n/zh/chat.js +2 -0
- package/lib/browser/i18n/zh/discover.js +3 -0
- package/lib/browser/i18n/zh/service.js +6 -0
- package/lib/browser/i18n/zh/settings.js +3 -0
- package/lib/browser/i18n/zh-tw/account.js +13 -6
- package/lib/browser/i18n/zh-tw/chat.js +2 -0
- package/lib/browser/i18n/zh-tw/discover.js +3 -0
- package/lib/browser/i18n/zh-tw/service.js +6 -0
- package/lib/browser/i18n/zh-tw/settings.js +3 -0
- package/lib/browser/notices/notices.d.ts +2 -0
- package/lib/browser/notices/notices.js +3 -1
- package/lib/browser/partners/group-picker.js +3 -4
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/settings/settings-protocol.d.ts +5 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +4 -3
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +7 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +5 -3
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +1 -1
- package/lib/browser/util/tool.d.ts +5 -0
- package/lib/browser/util/tool.js +21 -3
- package/package.json +7 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TaWorkbench } from '../workbench-protocol';
|
|
2
|
+
/** Whether the page is seen, and when it shows again: the document's, but in a test. */
|
|
3
|
+
export interface PageShown {
|
|
4
|
+
shown(): boolean;
|
|
5
|
+
onShow(listener: () => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
/** When what useServeValue shows is read again; what `start` returns stops it. */
|
|
8
|
+
export declare namespace ServeWatch {
|
|
9
|
+
interface Options {
|
|
10
|
+
server: Pick<TaWorkbench, 'onHostChanged' | 'onReconnect'>;
|
|
11
|
+
topics: readonly string[];
|
|
12
|
+
changes?: (listener: () => void) => () => void;
|
|
13
|
+
every?: number;
|
|
14
|
+
read(): void;
|
|
15
|
+
page?: PageShown;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Reads again as ta serve tells one of `topics` changed, as `changes` tells, as the connection comes back, and as
|
|
19
|
+
* the page shows again (what was told while it was hidden; all of it from a ta serve of before, which tells
|
|
20
|
+
* nothing); every `every` ms too while it is seen. Never while it is hidden.
|
|
21
|
+
*/
|
|
22
|
+
function start({ server, topics, changes, every, read, page }: Options): () => void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=serve-watch.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServeWatch = void 0;
|
|
4
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
5
|
+
const DOCUMENT_SHOWN = {
|
|
6
|
+
shown: () => document.visibilityState !== 'hidden',
|
|
7
|
+
onShow: listener => {
|
|
8
|
+
const changed = () => document.visibilityState !== 'hidden' && listener();
|
|
9
|
+
document.addEventListener('visibilitychange', changed);
|
|
10
|
+
return () => document.removeEventListener('visibilitychange', changed);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
/** When what useServeValue shows is read again; what `start` returns stops it. */
|
|
14
|
+
var ServeWatch;
|
|
15
|
+
(function (ServeWatch) {
|
|
16
|
+
/**
|
|
17
|
+
* Reads again as ta serve tells one of `topics` changed, as `changes` tells, as the connection comes back, and as
|
|
18
|
+
* the page shows again (what was told while it was hidden; all of it from a ta serve of before, which tells
|
|
19
|
+
* nothing); every `every` ms too while it is seen. Never while it is hidden.
|
|
20
|
+
*/
|
|
21
|
+
function start({ server, topics, changes, every, read, page = DOCUMENT_SHOWN }) {
|
|
22
|
+
const again = () => page.shown() && read();
|
|
23
|
+
const stops = [
|
|
24
|
+
server.onHostChanged((name, told) => name === ta_protocol_1.TaServeChanges.NAME && told.some(topic => topics.includes(topic)) && again()),
|
|
25
|
+
server.onReconnect(again),
|
|
26
|
+
page.onShow(read),
|
|
27
|
+
...(changes ? [changes(again)] : []),
|
|
28
|
+
];
|
|
29
|
+
const timer = every ? setInterval(again, every) : undefined;
|
|
30
|
+
return () => {
|
|
31
|
+
for (const stop of stops) {
|
|
32
|
+
stop();
|
|
33
|
+
}
|
|
34
|
+
clearInterval(timer);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
ServeWatch.start = start;
|
|
38
|
+
})(ServeWatch || (exports.ServeWatch = ServeWatch = {}));
|
|
39
|
+
//# sourceMappingURL=serve-watch.js.map
|
|
@@ -126,6 +126,8 @@ function navigationRows(navigation, t) {
|
|
|
126
126
|
return t(navigation.setting.pinned.includes(id) ? 'ta.settings.navigation.overflow' : 'ta.settings.navigation.folded');
|
|
127
127
|
};
|
|
128
128
|
return [
|
|
129
|
+
(0, settings_controls_1.row)('all-features', [t('ta.settings.allFeatures'), t('ta.settings.allFeaturesHint'), t('ta.discover.all')], React.createElement(settings_controls_1.Row, { label: t('ta.settings.allFeatures'), description: t('ta.settings.allFeaturesHint') },
|
|
130
|
+
React.createElement(settings_controls_1.Switch, { label: t('ta.settings.allFeatures'), checked: !navigation.first, onChange: navigation.showAll }))),
|
|
129
131
|
...navigation.pages.map(page => {
|
|
130
132
|
const title = web_extension_protocol_1.WebLabelUtil.text(page.title);
|
|
131
133
|
return (0, settings_controls_1.row)(`navigation:${page.id}`, [title, t('ta.settings.navigation')], React.createElement(settings_controls_1.Row, { label: title, description: where(page.id) },
|
|
@@ -65,6 +65,21 @@ export declare namespace SettingsViewUtil {
|
|
|
65
65
|
}, P extends {
|
|
66
66
|
sections: S[];
|
|
67
67
|
}>(parts: P[], query: string): P[];
|
|
68
|
+
/**
|
|
69
|
+
* The sections most people look for (`tier` common, docs/design/ta-simple.md 4.2), in their parts; the parts left.
|
|
70
|
+
* The others are a row away (More settings), and the search finds them.
|
|
71
|
+
*/
|
|
72
|
+
function common<S extends {
|
|
73
|
+
tier?: string;
|
|
74
|
+
}, P extends {
|
|
75
|
+
sections: S[];
|
|
76
|
+
}>(parts: P[]): P[];
|
|
77
|
+
/** How many sections `common` leaves out. */
|
|
78
|
+
function hidden(parts: readonly {
|
|
79
|
+
sections: readonly {
|
|
80
|
+
tier?: string;
|
|
81
|
+
}[];
|
|
82
|
+
}[]): number;
|
|
68
83
|
/**
|
|
69
84
|
* The sections in their parts, in the order of `groups`: a section without a group in the first, those of a part by
|
|
70
85
|
* `order` (default 0), in the order given for the same; parts without a section left out.
|
|
@@ -113,6 +113,19 @@ var SettingsViewUtil;
|
|
|
113
113
|
.filter(part => part.sections.length > 0);
|
|
114
114
|
}
|
|
115
115
|
SettingsViewUtil.filter = filter;
|
|
116
|
+
/**
|
|
117
|
+
* The sections most people look for (`tier` common, docs/design/ta-simple.md 4.2), in their parts; the parts left.
|
|
118
|
+
* The others are a row away (More settings), and the search finds them.
|
|
119
|
+
*/
|
|
120
|
+
function common(parts) {
|
|
121
|
+
return parts.map(part => ({ ...part, sections: part.sections.filter(entry => entry.tier === 'common') })).filter(part => part.sections.length > 0);
|
|
122
|
+
}
|
|
123
|
+
SettingsViewUtil.common = common;
|
|
124
|
+
/** How many sections `common` leaves out. */
|
|
125
|
+
function hidden(parts) {
|
|
126
|
+
return parts.reduce((count, part) => count + part.sections.filter(entry => entry.tier !== 'common').length, 0);
|
|
127
|
+
}
|
|
128
|
+
SettingsViewUtil.hidden = hidden;
|
|
116
129
|
/**
|
|
117
130
|
* The sections in their parts, in the order of `groups`: a section without a group in the first, those of a part by
|
|
118
131
|
* `order` (default 0), in the order given for the same; parts without a section left out.
|
|
@@ -94,7 +94,8 @@ function useMoreSections(onDialog) {
|
|
|
94
94
|
danger: true,
|
|
95
95
|
});
|
|
96
96
|
if (confirmed) {
|
|
97
|
-
|
|
97
|
+
await packageList.remove(pkg);
|
|
98
|
+
notices.notify(t('ta.packages.removed', { name: pkg.name }), { level: 'success' });
|
|
98
99
|
}
|
|
99
100
|
};
|
|
100
101
|
const toggleBuiltin = (name, on) => {
|
|
@@ -133,7 +134,7 @@ function useMoreSections(onDialog) {
|
|
|
133
134
|
return (0, settings_controls_1.row)(`package:${pkg.id}`, [title, summary, pkg.name, t('ta.packages')], React.createElement(settings_controls_1.Row, { icon: icon, label: title, description: error
|
|
134
135
|
? t('ta.packages.failed', { error })
|
|
135
136
|
: [summary, t(pkg.scope === 'project' ? 'ta.packages.scope.project' : 'ta.packages.scope.user')].filter(Boolean).join(' · ') },
|
|
136
|
-
React.createElement(icon_1.IconButton, { icon: lucide_react_1.Trash2, label: t('ta.packages.remove'), busy: busy === `remove:${pkg.id}`, disabled: waits(`remove:${pkg.id}`), onClick: () => void remove(pkg) }),
|
|
137
|
+
React.createElement(icon_1.IconButton, { icon: lucide_react_1.Trash2, label: t('ta.packages.remove'), busy: busy === `remove:${pkg.id}`, disabled: waits(`remove:${pkg.id}`), onClick: () => void run(`remove:${pkg.id}`, () => remove(pkg)) }),
|
|
137
138
|
React.createElement(settings_controls_1.Switch, { label: title, checked: pkg.enabled, disabled: waits(`toggle:${pkg.id}`), onChange: on => run(`toggle:${pkg.id}`, () => packageList.toggle(pkg, on)) })));
|
|
138
139
|
}),
|
|
139
140
|
...(packages.length === 0
|
|
@@ -258,6 +259,7 @@ function useMoreSections(onDialog) {
|
|
|
258
259
|
title: t('ta.settings.about'),
|
|
259
260
|
icon: lucide_react_1.Info,
|
|
260
261
|
order: 1000,
|
|
262
|
+
tier: 'common',
|
|
261
263
|
rows: workbench.server
|
|
262
264
|
? [
|
|
263
265
|
(0, settings_controls_1.row)('version', [t('ta.settings.version'), 'version'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.version'), description: restartTa.update
|
|
@@ -267,8 +269,8 @@ function useMoreSections(onDialog) {
|
|
|
267
269
|
...(restartTa.can
|
|
268
270
|
? [
|
|
269
271
|
(0, settings_controls_1.row)('restart', [t('ta.restart'), t('ta.restart.description'), 'restart', 'update'], React.createElement(settings_controls_1.Row, { label: t('ta.restart'), description: t('ta.restart.description') },
|
|
270
|
-
React.createElement("button", { type: "button", className: `ta-button${restartTa.update || restartTa.release ? ' ta-primary' : ''}`, disabled: restartTa.restarting || ((_a = restartTa.release) === null || _a === void 0 ? void 0 : _a.installing), onClick: () => void (restartTa.release && !restartTa.update ? restartTa.install() : restartTa.restart()) },
|
|
271
|
-
restartTa.restarting || ((_b = restartTa.release) === null || _b === void 0 ? void 0 : _b.installing) ? (React.createElement("span", { className: "ta-spinner" })) : (React.createElement(icon_1.Icon, { icon: lucide_react_1.RotateCw, size: 15 })),
|
|
272
|
+
React.createElement("button", { type: "button", className: `ta-button${restartTa.update || restartTa.release ? ' ta-primary' : ''}`, disabled: restartTa.restarting || ((_a = restartTa.release) === null || _a === void 0 ? void 0 : _a.installing) || waits('restart'), onClick: () => void run('restart', () => (restartTa.release && !restartTa.update ? restartTa.install() : restartTa.restart())) },
|
|
273
|
+
busy === 'restart' || restartTa.restarting || ((_b = restartTa.release) === null || _b === void 0 ? void 0 : _b.installing) ? (React.createElement("span", { className: "ta-spinner" })) : (React.createElement(icon_1.Icon, { icon: lucide_react_1.RotateCw, size: 15 })),
|
|
272
274
|
' ',
|
|
273
275
|
t(restartTa.release && !restartTa.update ? 'ta.release.install' : 'ta.restart.button')))),
|
|
274
276
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TaSettingsScope } from '@celljs/ta-protocol';
|
|
1
|
+
import { type TaSettingsScope, type TaTier } from '@celljs/ta-protocol';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { WebSettingsGroup } from '../extension/web-extension-api';
|
|
4
4
|
import type { Glyph } from './icon';
|
|
@@ -14,6 +14,8 @@ export interface SectionEntry {
|
|
|
14
14
|
order?: number;
|
|
15
15
|
/** A setting of pi's files, of the user or of the project: under the scope of its part (Part.lead). */
|
|
16
16
|
scoped?: boolean;
|
|
17
|
+
/** `common`: shown from the start; the others under More settings (SettingsViewUtil.common). */
|
|
18
|
+
tier?: TaTier;
|
|
17
19
|
}
|
|
18
20
|
export interface Part {
|
|
19
21
|
id: string;
|
|
@@ -75,6 +75,7 @@ function useParts(scope, onScope, onDialog) {
|
|
|
75
75
|
id: 'appearance',
|
|
76
76
|
title: t('ta.settings.appearance'),
|
|
77
77
|
icon: lucide_react_1.Palette,
|
|
78
|
+
tier: 'common',
|
|
78
79
|
rows: [
|
|
79
80
|
(0, settings_controls_1.row)('theme', [t('ta.settings.theme'), 'theme'], React.createElement(settings_controls_1.Row, { label: t('ta.settings.theme'), stacked: true },
|
|
80
81
|
React.createElement(settings_controls_1.Segmented, { label: t('ta.settings.theme'), value: settings.theme, choices: settings_choices_1.THEMES, onChange: theme => store.update({ theme }) }))),
|
|
@@ -108,6 +109,7 @@ function useParts(scope, onScope, onDialog) {
|
|
|
108
109
|
id: 'language',
|
|
109
110
|
title: t('ta.settings.language'),
|
|
110
111
|
icon: lucide_react_1.Languages,
|
|
112
|
+
tier: 'common',
|
|
111
113
|
// A phone has no room for five names side by side: a row each, as its own settings have them.
|
|
112
114
|
rows: handheld
|
|
113
115
|
? settings_choices_1.LANGUAGES.map(choice => {
|
|
@@ -221,6 +223,7 @@ function useParts(scope, onScope, onDialog) {
|
|
|
221
223
|
icon: (_a = settings_choices_1.GROUP_ICONS[group.id]) !== null && _a !== void 0 ? _a : lucide_react_1.Wrench,
|
|
222
224
|
group: 'ta',
|
|
223
225
|
scoped: true,
|
|
226
|
+
...(group.id === 'model' ? { tier: 'common' } : {}),
|
|
224
227
|
rows: snapshot
|
|
225
228
|
? group.keys.flatMap(key => {
|
|
226
229
|
const spec = agent_settings_1.AgentSettingsUtil.spec(key);
|
|
@@ -37,6 +37,8 @@ exports.SettingsView = SettingsView;
|
|
|
37
37
|
const lucide_react_1 = require("lucide-react");
|
|
38
38
|
const React = __importStar(require("react"));
|
|
39
39
|
const device_1 = require("../device/device");
|
|
40
|
+
const web_metrics_1 = require("../extension/web-metrics");
|
|
41
|
+
const hooks_1 = require("../hooks");
|
|
40
42
|
const use_t_1 = require("../i18n/use-t");
|
|
41
43
|
const screen_protocol_1 = require("../screen/screen-protocol");
|
|
42
44
|
const use_screen_part_1 = require("../screen/use-screen-part");
|
|
@@ -63,6 +65,15 @@ function SettingsView({ section, onClose, onMenu, onBack }) {
|
|
|
63
65
|
const [dialog, setDialog] = React.useState();
|
|
64
66
|
const closeDialog = React.useCallback(() => setDialog(undefined), []);
|
|
65
67
|
const parts = (0, settings_parts_1.useParts)(scope, setScope, setDialog);
|
|
68
|
+
const [{ settings }] = (0, hooks_1.useSettings)();
|
|
69
|
+
// The sections most people look for first, the others a row away (docs/design/ta-simple.md 4.2); all of them for a
|
|
70
|
+
// search, for one asked for that is not of those, and for one who has every feature shown.
|
|
71
|
+
const [more, setMore] = React.useState(false);
|
|
72
|
+
React.useEffect(() => { var _a; return (_a = web_metrics_1.WebMetrics.current) === null || _a === void 0 ? void 0 : _a.own(more ? 'page:settings-more' : 'page:settings'); }, [more]);
|
|
73
|
+
const asked = section !== undefined && parts.some(part => part.sections.some(entry => entry.id === section && entry.tier !== 'common'));
|
|
74
|
+
const all = settings.allFeatures || more || asked || !!query.trim();
|
|
75
|
+
const shownParts = all ? parts : settings_controls_1.SettingsViewUtil.common(parts);
|
|
76
|
+
const onMore = all || settings_controls_1.SettingsViewUtil.hidden(parts) === 0 ? undefined : () => setMore(true);
|
|
66
77
|
// What an agent reads of the settings and where it goes in them (docs/design/ta-app-use.md 3); the rows are read as they show.
|
|
67
78
|
(0, use_screen_part_1.useScreenPart)({
|
|
68
79
|
id: 'settings',
|
|
@@ -76,6 +87,9 @@ function SettingsView({ section, onClose, onMenu, onBack }) {
|
|
|
76
87
|
var _a;
|
|
77
88
|
var _b, _c;
|
|
78
89
|
const entry = parts.flatMap(part => part.sections).find(candidate => candidate.id === id);
|
|
90
|
+
if (entry && entry.tier !== 'common' && !all) {
|
|
91
|
+
setMore(true);
|
|
92
|
+
}
|
|
79
93
|
const root = document.querySelector('[data-ta-part="settings"]');
|
|
80
94
|
const link = (_b = root === null || root === void 0 ? void 0 : root.querySelector(`[data-ta-item="${CSS.escape(id !== null && id !== void 0 ? id : '')}"]`)) !== null && _b !== void 0 ? _b : [...((_c = root === null || root === void 0 ? void 0 : root.querySelectorAll('.ta-list-main')) !== null && _c !== void 0 ? _c : [])].find(button => { var _a; return ((_a = button.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === (entry === null || entry === void 0 ? void 0 : entry.title); });
|
|
81
95
|
if (link) {
|
|
@@ -98,11 +112,17 @@ function SettingsView({ section, onClose, onMenu, onBack }) {
|
|
|
98
112
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Search, size: 14 }),
|
|
99
113
|
React.createElement("input", { value: query, placeholder: t('ta.settings.search'), "aria-label": t('ta.settings.search'), onChange: event => setQuery(event.target.value) }),
|
|
100
114
|
query && React.createElement(icon_1.IconButton, { icon: lucide_react_1.X, label: t('ta.close'), onClick: () => setQuery('') })));
|
|
101
|
-
const props = { parts, query, search, section };
|
|
115
|
+
const props = { parts: shownParts, query, search, section, onMore };
|
|
102
116
|
return (React.createElement("section", { className: "ta-settings-page", "aria-label": t('ta.settings'), ...screen_protocol_1.ScreenUtil.part('settings') },
|
|
103
117
|
handheld ? React.createElement(PhoneSettings, { ...props, onBack: onBack !== null && onBack !== void 0 ? onBack : onClose }) : React.createElement(WideSettings, { ...props, onClose: onClose, onMenu: onMenu, onBack: onBack }),
|
|
104
118
|
dialog === 'directory' && React.createElement(working_directory_1.WorkingDirectoryPicker, { onClose: closeDialog })));
|
|
105
119
|
}
|
|
120
|
+
/** The row under the sections that shows the others. */
|
|
121
|
+
function MoreRow({ onMore }) {
|
|
122
|
+
const t = (0, use_t_1.useT)();
|
|
123
|
+
return (React.createElement(list_rows_1.ListGroup, null,
|
|
124
|
+
React.createElement(list_rows_1.ListRow, { icon: lucide_react_1.Settings2, label: t('ta.settings.more'), onClick: onMore })));
|
|
125
|
+
}
|
|
106
126
|
/** The rows of a section, in a card. */
|
|
107
127
|
function SectionRows({ entry }) {
|
|
108
128
|
return entry.rows.length > 0 ? (React.createElement("div", { className: "ta-setting-card" }, entry.rows.map(candidate => (React.createElement(React.Fragment, { key: candidate.key }, candidate.node))))) : null;
|
|
@@ -113,7 +133,7 @@ function SectionRows({ entry }) {
|
|
|
113
133
|
* packages, the settings of ta) and grows, until the user scrolls; marked on the left even when the page
|
|
114
134
|
* cannot scroll it to the top.
|
|
115
135
|
*/
|
|
116
|
-
function WideSettings({ parts, query, search, section, onClose, onMenu, onBack }) {
|
|
136
|
+
function WideSettings({ parts, query, search, section, onMore, onClose, onMenu, onBack }) {
|
|
117
137
|
const t = (0, use_t_1.useT)();
|
|
118
138
|
const [active, setActive] = React.useState(section !== null && section !== void 0 ? section : 'appearance');
|
|
119
139
|
const scroller = React.useRef(null);
|
|
@@ -185,11 +205,15 @@ function WideSettings({ parts, query, search, section, onClose, onMenu, onBack }
|
|
|
185
205
|
search,
|
|
186
206
|
onMenu && React.createElement(icon_1.IconButton, { icon: lucide_react_1.X, label: t('ta.close'), onClick: onClose })),
|
|
187
207
|
React.createElement("div", { className: "ta-settings-body" },
|
|
188
|
-
React.createElement("nav", { className: "ta-settings-toc", "aria-label": t('ta.settings') },
|
|
189
|
-
React.createElement("
|
|
190
|
-
|
|
191
|
-
React.createElement(
|
|
192
|
-
|
|
208
|
+
React.createElement("nav", { className: "ta-settings-toc", "aria-label": t('ta.settings') },
|
|
209
|
+
shown.map(part => (React.createElement("div", { key: part.id, className: "ta-settings-toc-part" },
|
|
210
|
+
React.createElement("button", { type: "button", className: "ta-settings-toc-group", onClick: () => go(part.sections[0].id, 'smooth') }, part.title),
|
|
211
|
+
part.sections.map(entry => (React.createElement("button", { key: entry.id, type: "button", className: `ta-settings-toc-item${active === entry.id ? ' ta-active' : ''}`, "aria-current": active === entry.id || undefined, onClick: () => go(entry.id, 'smooth'), ...screen_protocol_1.ScreenUtil.item(entry.id) },
|
|
212
|
+
React.createElement(icon_1.Icon, { icon: entry.icon, size: 14 }),
|
|
213
|
+
React.createElement("span", { className: "ta-ellipsis" }, entry.title))))))),
|
|
214
|
+
onMore && (React.createElement("button", { type: "button", className: "ta-settings-toc-item", onClick: onMore },
|
|
215
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.Settings2, size: 14 }),
|
|
216
|
+
React.createElement("span", { className: "ta-ellipsis" }, t('ta.settings.more'))))),
|
|
193
217
|
React.createElement("div", { className: "ta-settings-scroll", ref: scroller, onScroll: onScroll },
|
|
194
218
|
React.createElement("div", { className: "ta-settings-content", ref: content },
|
|
195
219
|
shown.length === 0 && React.createElement(empty_state_1.EmptyState, { title: t('ta.settings.noMatch', { query: query.trim() }) }),
|
|
@@ -202,7 +226,8 @@ function WideSettings({ parts, query, search, section, onClose, onMenu, onBack }
|
|
|
202
226
|
React.createElement(icon_1.Icon, { icon: entry.icon, size: 13 }),
|
|
203
227
|
" ",
|
|
204
228
|
entry.title),
|
|
205
|
-
React.createElement(SectionRows, { entry: entry })))); }))))
|
|
229
|
+
React.createElement(SectionRows, { entry: entry })))); })))),
|
|
230
|
+
onMore && React.createElement(MoreRow, { onMore: onMore }))))));
|
|
206
231
|
}
|
|
207
232
|
/** A page of a phone: its head, with the way back and its title, over a list. */
|
|
208
233
|
function PhonePage({ title, onBack, children }) {
|
|
@@ -228,7 +253,7 @@ function PhoneSection({ part, entry, onBack }) {
|
|
|
228
253
|
* section tapped pushed over it as a page of its own; a search lists the rows that match in place. A section
|
|
229
254
|
* Me opened (the theme, the language, about) is that page alone, and back goes to Me.
|
|
230
255
|
*/
|
|
231
|
-
function PhoneSettings({ parts, query, search, section, onBack }) {
|
|
256
|
+
function PhoneSettings({ parts, query, search, section, onMore, onBack }) {
|
|
232
257
|
const t = (0, use_t_1.useT)();
|
|
233
258
|
/** The section pushed over the list, kept while it slides away. */
|
|
234
259
|
const [pushed, setPushed] = React.useState();
|
|
@@ -257,7 +282,8 @@ function PhoneSettings({ parts, query, search, section, onBack }) {
|
|
|
257
282
|
React.createElement(SectionRows, { entry: entry })))))
|
|
258
283
|
: parts.map(part => (React.createElement("section", { key: part.id, className: "ta-settings-phone-group", "aria-label": part.title },
|
|
259
284
|
React.createElement("h2", { className: "ta-settings-phone-caption" }, part.title),
|
|
260
|
-
React.createElement(list_rows_1.ListGroup, null, part.sections.map(entry => (React.createElement(list_rows_1.ListRow, { key: entry.id, icon: entry.icon, label: entry.title, onClick: () => setPushed({ id: entry.id, open: true }) })))))))
|
|
285
|
+
React.createElement(list_rows_1.ListGroup, null, part.sections.map(entry => (React.createElement(list_rows_1.ListRow, { key: entry.id, icon: entry.icon, label: entry.title, onClick: () => setPushed({ id: entry.id, open: true }) }))))))),
|
|
286
|
+
!query.trim() && onMore && React.createElement(MoreRow, { onMore: onMore })));
|
|
261
287
|
return React.createElement(phone_shell_1.PhoneStack, { base: list, top: top && React.createElement(PhoneSection, { ...top, onBack: close }), open: !!top && !!(pushed === null || pushed === void 0 ? void 0 : pushed.open), onClose: close });
|
|
262
288
|
}
|
|
263
289
|
//# sourceMappingURL=settings-view.js.map
|
|
@@ -40,6 +40,7 @@ exports.FriendSends = FriendSends;
|
|
|
40
40
|
exports.ShareToFriends = ShareToFriends;
|
|
41
41
|
const React = __importStar(require("react"));
|
|
42
42
|
const use_t_1 = require("../i18n/use-t");
|
|
43
|
+
const busy_1 = require("./busy");
|
|
43
44
|
const face_1 = require("./face");
|
|
44
45
|
const people_picker_1 = require("./people-picker");
|
|
45
46
|
/** The friends of this Ta, once read; undefined while read, or where they cannot be. */
|
|
@@ -123,16 +124,14 @@ function FriendSends({ sent }) {
|
|
|
123
124
|
function ShareToFriends({ rooms, notices, friends, link, title, onDone, }) {
|
|
124
125
|
const t = (0, use_t_1.useT)();
|
|
125
126
|
const [chosen, setChosen] = React.useState([]);
|
|
126
|
-
const [busy,
|
|
127
|
+
const [busy, run] = (0, busy_1.useBusy)();
|
|
127
128
|
const send = async () => {
|
|
128
|
-
setBusy(true);
|
|
129
129
|
try {
|
|
130
130
|
await rooms.sendToFriends(chosen, { link, title });
|
|
131
131
|
onDone(true);
|
|
132
132
|
}
|
|
133
133
|
catch (reason) {
|
|
134
134
|
notices.error(reason);
|
|
135
|
-
setBusy(false);
|
|
136
135
|
}
|
|
137
136
|
};
|
|
138
137
|
const people = friends.map(friend => ({ key: friend.id, name: friend.name, seed: friend.id, look: friend.look, online: friend.online }));
|
|
@@ -140,7 +139,7 @@ function ShareToFriends({ rooms, notices, friends, link, title, onDone, }) {
|
|
|
140
139
|
React.createElement(people_picker_1.PeoplePicker, { people: people, value: chosen, onChange: setChosen, disabled: busy }),
|
|
141
140
|
React.createElement("div", { className: "ta-share-friends-actions" },
|
|
142
141
|
React.createElement("button", { type: "button", className: "ta-button", onClick: () => onDone() }, t('ta.cancel')),
|
|
143
|
-
React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy || chosen.length === 0, onClick: () => void send
|
|
142
|
+
React.createElement("button", { type: "button", className: `ta-button ta-primary${busy ? ' ta-busy' : ''}`, disabled: busy || chosen.length === 0, onClick: () => void run(send) },
|
|
144
143
|
busy && React.createElement("span", { className: "ta-spinner ta-busy-mark" }),
|
|
145
144
|
React.createElement("span", null, chosen.length ? t('ta.share.sendN', { n: chosen.length }) : t('ta.share.pickFriends'))))));
|
|
146
145
|
}
|
|
@@ -39,6 +39,7 @@ const lucide_react_1 = require("lucide-react");
|
|
|
39
39
|
const React = __importStar(require("react"));
|
|
40
40
|
const share_sheet_compat_1 = require("../extension/share-sheet-compat");
|
|
41
41
|
const use_t_1 = require("../i18n/use-t");
|
|
42
|
+
const busy_1 = require("./busy");
|
|
42
43
|
const empty_state_1 = require("./empty-state");
|
|
43
44
|
const qr_view_1 = require("./qr-view");
|
|
44
45
|
const share_friends_1 = require("./share-friends");
|
|
@@ -66,7 +67,7 @@ function Tile({ icon: Icon, label, onClick, disabled }) {
|
|
|
66
67
|
function ShareSheet({ title, link, error, face, name, gets, invite, notes, password, own, onRenew, onStop, stop, onClose, children, notices, rooms, onRoomEvent, }) {
|
|
67
68
|
const t = (0, use_t_1.useT)();
|
|
68
69
|
const [copied, copy] = useCopied();
|
|
69
|
-
const [stopping,
|
|
70
|
+
const [stopping, run] = (0, busy_1.useBusy)();
|
|
70
71
|
const [picking, setPicking] = React.useState(false);
|
|
71
72
|
const friends = (0, share_friends_1.useShareFriends)(rooms);
|
|
72
73
|
const [sends, setSends] = React.useState(0);
|
|
@@ -77,14 +78,12 @@ function ShareSheet({ title, link, error, face, name, gets, invite, notes, passw
|
|
|
77
78
|
if (!onStop || (stop && !(await notices.confirm({ title: stop.title, message: stop.message, confirmLabel: t('ta.share.stop'), danger: true })))) {
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
|
-
setStopping(true);
|
|
81
81
|
try {
|
|
82
82
|
await onStop();
|
|
83
83
|
onClose();
|
|
84
84
|
}
|
|
85
85
|
catch (reason) {
|
|
86
86
|
notices.error(reason);
|
|
87
|
-
setStopping(false);
|
|
88
87
|
}
|
|
89
88
|
};
|
|
90
89
|
const lines = (notes !== null && notes !== void 0 ? notes : []).filter((line) => !!line);
|
|
@@ -118,7 +117,7 @@ function ShareSheet({ title, link, error, face, name, gets, invite, notes, passw
|
|
|
118
117
|
!picking && React.createElement(share_friends_1.FriendSends, { sent: sent }),
|
|
119
118
|
children,
|
|
120
119
|
lines.length > 0 && (React.createElement("div", { className: "ta-share-notes" }, lines.map(line => (React.createElement("p", { key: line }, line))))),
|
|
121
|
-
onStop && link && (React.createElement("button", { type: "button", className: `ta-share-stop${stopping ? ' ta-busy' : ''}`, disabled: stopping, onClick: () => void end
|
|
120
|
+
onStop && link && (React.createElement("button", { type: "button", className: `ta-share-stop${stopping ? ' ta-busy' : ''}`, disabled: stopping, onClick: () => void run(end) },
|
|
122
121
|
stopping && React.createElement("span", { className: "ta-spinner ta-busy-mark" }),
|
|
123
122
|
React.createElement("span", null, t('ta.share.stop')))))))));
|
|
124
123
|
}
|
|
@@ -158,6 +158,10 @@ function Act({ act, results, runs }) {
|
|
|
158
158
|
return React.createElement(CodemodeView, { id: id, args: args, output: output, status: status, runs: runs, thoughts: thoughts || undefined });
|
|
159
159
|
}
|
|
160
160
|
const own = details(name, args, output, status);
|
|
161
|
+
const subagent = name === 'agent_tool' ? tool_1.ToolUtil.agentSteps(id, output, runs) : [];
|
|
162
|
+
if (!act.nested.length && subagent.length) {
|
|
163
|
+
return (React.createElement(ToolRow, { name: name, args: args, status: status, count: subagent.length, details: stepsBody(subagent, own, thoughts), input: agentInput(output) }));
|
|
164
|
+
}
|
|
161
165
|
if (!act.nested.length) {
|
|
162
166
|
// The same call made more than once in a row: what each did, the earliest first.
|
|
163
167
|
const all = act.earlier.length
|
|
@@ -185,13 +189,16 @@ function Act({ act, results, runs }) {
|
|
|
185
189
|
});
|
|
186
190
|
const failed = steps.some(step => step.status === 'error');
|
|
187
191
|
const script = (0, tool_result_1.agentToolDetails)(args, output, true);
|
|
188
|
-
|
|
192
|
+
// The steps of the subagents a call of the script ran count too, as the line said while they worked.
|
|
193
|
+
const count = steps.reduce((sum, step) => { var _a; return sum + Math.max(1, tool_1.ToolUtil.agentSteps((_a = step.call.id) !== null && _a !== void 0 ? _a : '', step.output, runs).length); }, 0);
|
|
194
|
+
return (React.createElement(ToolRow, { name: name, args: args, status: status === 'done' && failed ? 'error' : status, count: count, details: React.createElement("div", { className: "ta-act-body" },
|
|
189
195
|
thoughts,
|
|
190
196
|
steps.map(step => {
|
|
191
|
-
var _a, _b, _c;
|
|
197
|
+
var _a, _b, _c, _d;
|
|
192
198
|
const nestedArgs = (_a = step.call.arguments) !== null && _a !== void 0 ? _a : {};
|
|
193
199
|
const shown = details((_b = step.call.name) !== null && _b !== void 0 ? _b : '', nestedArgs, step.output, step.status);
|
|
194
|
-
|
|
200
|
+
const stepSubagent = tool_1.ToolUtil.agentSteps((_c = step.call.id) !== null && _c !== void 0 ? _c : '', step.output, runs);
|
|
201
|
+
return (React.createElement(ToolRow, { key: step.call.id, name: (_d = step.call.name) !== null && _d !== void 0 ? _d : '', args: nestedArgs, status: step.status, count: stepSubagent.length, details: stepSubagent.length ? stepsBody(stepSubagent, shown) : shown || undefined, input: agentInput(step.output) }));
|
|
195
202
|
}),
|
|
196
203
|
script && React.createElement(ScriptLine, { script: script })) }));
|
|
197
204
|
}
|
|
@@ -214,6 +221,13 @@ function CodemodeView({ id, args, output, status, runs, thoughts }) {
|
|
|
214
221
|
calls.map(call => (React.createElement(ToolRow, { key: call.key, ...nestedRow(call) }))),
|
|
215
222
|
React.createElement(ScriptLine, { script: script })) }));
|
|
216
223
|
}
|
|
224
|
+
/** A call of another agent that ran subagents: its line opens to the calls they made, then to what it returned. */
|
|
225
|
+
function stepsBody(steps, own, thoughts) {
|
|
226
|
+
return (React.createElement("div", { className: "ta-act-body" },
|
|
227
|
+
thoughts,
|
|
228
|
+
steps.map(step => (React.createElement(ToolRow, { key: step.key, ...nestedRow(step) }))),
|
|
229
|
+
own));
|
|
230
|
+
}
|
|
217
231
|
/** The script itself and what it returned, behind one quiet line at the end of its calls. */
|
|
218
232
|
function ScriptLine({ script }) {
|
|
219
233
|
const t = (0, use_t_1.useT)();
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a build of the phone app says of where its new versions are: `ta-app.json` beside its page. The iPhone app
|
|
3
|
+
* signed for the company has it, written in as it is signed (apps/ta-mobile/scripts/package.ts), and installs its new
|
|
4
|
+
* versions from the internal download page with a tap; the other builds (signed by whoever installs them, Android, a
|
|
5
|
+
* browser) have none, and are told of nothing.
|
|
6
|
+
*/
|
|
7
|
+
export interface AppUpdateSource {
|
|
8
|
+
/** The manifest of the download page, latest.json: version, build and the files of each system. */
|
|
9
|
+
updates: string;
|
|
10
|
+
/** This build's system as the manifest names it: `ios-arm64`. */
|
|
11
|
+
target: string;
|
|
12
|
+
version: string;
|
|
13
|
+
build: number;
|
|
14
|
+
}
|
|
15
|
+
/** A newer build of the app: its version, and the link that installs it. */
|
|
16
|
+
export interface AppUpdateOffer {
|
|
17
|
+
version: string;
|
|
18
|
+
build: number;
|
|
19
|
+
link: string;
|
|
20
|
+
}
|
|
21
|
+
/** What the updates read of the app; tests give their own. */
|
|
22
|
+
export interface AppUpdateEnvironment {
|
|
23
|
+
/** ta-app.json of the app, parsed; undefined where there is none. */
|
|
24
|
+
own(): Promise<unknown>;
|
|
25
|
+
/** The manifest at the address, parsed; throws when it cannot be read (offline, outside the company's network). */
|
|
26
|
+
get(url: string): Promise<unknown>;
|
|
27
|
+
/** Calls the listener each time the app comes back to the front. */
|
|
28
|
+
onForeground(listener: () => void): void;
|
|
29
|
+
/** Opens the link: the system asks the user to install. */
|
|
30
|
+
open(link: string): void;
|
|
31
|
+
}
|
|
32
|
+
export declare namespace AppUpdateUtil {
|
|
33
|
+
const FILE = "ta-app.json";
|
|
34
|
+
function source(value: unknown): AppUpdateSource | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The build of the manifest when it is newer than the app's, with the link that installs it: the itms-services link
|
|
37
|
+
* the manifest gives (iOS), else the address of its file; either only of the site of the manifest.
|
|
38
|
+
*/
|
|
39
|
+
function offer(source: AppUpdateSource, manifest: unknown): AppUpdateOffer | undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Newer versions of the phone app that does not update itself (the iPhone app signed for the company): read from the
|
|
43
|
+
* manifest of its download page as the app starts and each time it comes back to the front, and installed with a tap
|
|
44
|
+
* (the system asks, then puts the new version in its place, nothing lost). Nothing where the app does not say where its
|
|
45
|
+
* new versions are (AppUpdateSource); one not read (offline, outside the company's network) leaves what was known.
|
|
46
|
+
*/
|
|
47
|
+
export declare class AppUpdates {
|
|
48
|
+
protected readonly environment: () => AppUpdateEnvironment | undefined;
|
|
49
|
+
protected current?: AppUpdateOffer;
|
|
50
|
+
protected started: boolean;
|
|
51
|
+
protected source?: Promise<AppUpdateSource | undefined>;
|
|
52
|
+
protected readonly listeners: Set<() => void>;
|
|
53
|
+
constructor(environment?: () => AppUpdateEnvironment | undefined);
|
|
54
|
+
get offer(): AppUpdateOffer | undefined;
|
|
55
|
+
subscribe(listener: () => void): () => void;
|
|
56
|
+
start(): void;
|
|
57
|
+
install(): void;
|
|
58
|
+
protected check(env: AppUpdateEnvironment): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
export declare const AppUpdate: AppUpdates;
|
|
61
|
+
/** The newer version of the phone app to install, while there is one. */
|
|
62
|
+
export declare function useAppUpdate(): AppUpdateOffer | undefined;
|
|
63
|
+
//# sourceMappingURL=app-update.d.ts.map
|