@celljs/ta-web 4.46.3 → 4.47.1
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/assistant/assistant-view.js +2 -1
- package/esm/browser/chat/chat-protocol.d.ts +7 -0
- package/esm/browser/chat/chat-view.js +3 -2
- 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/account-menu.d.ts +2 -0
- package/esm/browser/components/account-menu.js +10 -1
- package/esm/browser/components/app-nav.js +4 -1
- package/esm/browser/components/app-shell-state.js +11 -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 +22 -2
- 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/cloud-sign-in-view.d.ts +1 -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 +31 -10
- package/esm/browser/components/discover-view.d.ts +8 -1
- package/esm/browser/components/discover-view.js +28 -3
- package/esm/browser/components/extension-settings.js +1 -0
- package/esm/browser/components/first-steps-util.d.ts +59 -0
- package/esm/browser/components/first-steps-util.js +74 -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 +1 -1
- package/esm/browser/components/list-rows.d.ts +1 -1
- package/esm/browser/components/list-rows.js +1 -1
- 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-hint.d.ts +6 -0
- package/esm/browser/components/phone-hint.js +63 -0
- 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 +11 -7
- package/esm/browser/components/session-view.js +2 -1
- 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 +1 -0
- 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/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/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 +8 -0
- package/esm/browser/i18n/en/service.js +8 -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 +8 -0
- package/esm/browser/i18n/ja/settings.js +3 -0
- package/esm/browser/i18n/locales.d.ts +24 -1
- package/esm/browser/i18n/messages.d.ts +23 -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 +8 -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 +8 -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/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/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +4 -0
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +7 -0
- package/esm/browser/style/skins.d.ts +1 -1
- package/esm/browser/style/skins.js +1 -1
- package/lib/browser/assistant/assistant-view.js +2 -1
- package/lib/browser/chat/chat-protocol.d.ts +7 -0
- package/lib/browser/chat/chat-view.js +3 -2
- 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/account-menu.d.ts +2 -0
- package/lib/browser/components/account-menu.js +10 -1
- package/lib/browser/components/app-nav.js +3 -0
- package/lib/browser/components/app-shell-state.js +11 -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 +21 -1
- 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/cloud-sign-in-view.d.ts +1 -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 +30 -9
- package/lib/browser/components/discover-view.d.ts +8 -1
- package/lib/browser/components/discover-view.js +27 -2
- package/lib/browser/components/extension-settings.js +1 -0
- package/lib/browser/components/first-steps-util.d.ts +60 -0
- package/lib/browser/components/first-steps-util.js +77 -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 +1 -1
- package/lib/browser/components/list-rows.d.ts +1 -1
- package/lib/browser/components/list-rows.js +1 -1
- 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-hint.d.ts +7 -0
- package/lib/browser/components/phone-hint.js +99 -0
- 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 +10 -6
- package/lib/browser/components/session-view.js +2 -1
- 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 +1 -0
- 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/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/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 +8 -0
- package/lib/browser/i18n/en/service.js +8 -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 +8 -0
- package/lib/browser/i18n/ja/settings.js +3 -0
- package/lib/browser/i18n/locales.d.ts +24 -1
- package/lib/browser/i18n/messages.d.ts +23 -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 +8 -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 +8 -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/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/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +4 -0
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +7 -0
- package/lib/browser/style/skins.d.ts +1 -1
- package/lib/browser/style/skins.js +1 -1
- package/package.json +7 -7
|
@@ -43,6 +43,10 @@ export interface Navigation {
|
|
|
43
43
|
*/
|
|
44
44
|
onOpen: WebPageInfo[];
|
|
45
45
|
setting: NavigationSetting;
|
|
46
|
+
/** Whether Discover lists a page first (discoverFirst); none while the user has all listed (Settings.allFeatures). */
|
|
47
|
+
first?(id: string): boolean;
|
|
48
|
+
/** All features listed in Discover itself, or not. */
|
|
49
|
+
showAll(on: boolean): void;
|
|
46
50
|
pin(id: string): void;
|
|
47
51
|
fold(id: string): void;
|
|
48
52
|
update(setting: NavigationSetting): void;
|
|
@@ -68,6 +72,16 @@ export declare function discoverGroups<T extends {
|
|
|
68
72
|
group: WebPageGroup;
|
|
69
73
|
pages: T[];
|
|
70
74
|
}[];
|
|
75
|
+
/** A feature opened in the last of these days stays in the first list of Discover (docs/design/ta-simple.md 4.2). */
|
|
76
|
+
export declare const DISCOVER_RECENT_DAYS = 30;
|
|
77
|
+
/** What Discover reads of a page to place it: its WebPageInfo. */
|
|
78
|
+
export type DiscoverInfo = Pick<WebPageInfo, 'tier' | 'extensionId' | 'usedAt'>;
|
|
79
|
+
/**
|
|
80
|
+
* Whether Discover lists a page first, or under All features (docs/design/ta-simple.md 4.2): first, one of a package the
|
|
81
|
+
* user added, one for most people (`tier` common), one opened in the last DISCOVER_RECENT_DAYS days; the others wait
|
|
82
|
+
* under All features until used, as the apps of a phone in its library.
|
|
83
|
+
*/
|
|
84
|
+
export declare function discoverFirst(info: DiscoverInfo | undefined, now: number): boolean;
|
|
71
85
|
/** Discover is in the navigation: some pages are under it. */
|
|
72
86
|
export declare function hasDiscover(navigation: Pick<Navigation, 'discover' | 'onOpen'>): boolean;
|
|
73
87
|
export interface PhoneTabLabels {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DISCOVER_GROUPS = exports.ME_TAB = exports.DISCOVER = void 0;
|
|
3
|
+
exports.DISCOVER_RECENT_DAYS = exports.DISCOVER_GROUPS = exports.ME_TAB = exports.DISCOVER = void 0;
|
|
4
4
|
exports.railPages = railPages;
|
|
5
5
|
exports.entryHold = entryHold;
|
|
6
6
|
exports.fixedTabs = fixedTabs;
|
|
7
7
|
exports.places = places;
|
|
8
8
|
exports.arrangeViews = arrangeViews;
|
|
9
9
|
exports.discoverGroups = discoverGroups;
|
|
10
|
+
exports.discoverFirst = discoverFirst;
|
|
10
11
|
exports.hasDiscover = hasDiscover;
|
|
11
12
|
exports.phoneTabs = phoneTabs;
|
|
12
13
|
const lucide_react_1 = require("lucide-react");
|
|
@@ -64,6 +65,17 @@ function discoverGroups(pages) {
|
|
|
64
65
|
const of = (page) => (page.group && exports.DISCOVER_GROUPS.includes(page.group) ? page.group : 'more');
|
|
65
66
|
return exports.DISCOVER_GROUPS.map(group => ({ group, pages: pages.filter(page => of(page) === group) })).filter(entry => entry.pages.length > 0);
|
|
66
67
|
}
|
|
68
|
+
/** A feature opened in the last of these days stays in the first list of Discover (docs/design/ta-simple.md 4.2). */
|
|
69
|
+
exports.DISCOVER_RECENT_DAYS = 30;
|
|
70
|
+
/**
|
|
71
|
+
* Whether Discover lists a page first, or under All features (docs/design/ta-simple.md 4.2): first, one of a package the
|
|
72
|
+
* user added, one for most people (`tier` common), one opened in the last DISCOVER_RECENT_DAYS days; the others wait
|
|
73
|
+
* under All features until used, as the apps of a phone in its library.
|
|
74
|
+
*/
|
|
75
|
+
function discoverFirst(info, now) {
|
|
76
|
+
return (!!info &&
|
|
77
|
+
(!!info.extensionId || info.tier === 'common' || (info.usedAt !== undefined && now - info.usedAt < exports.DISCOVER_RECENT_DAYS * 24 * 60 * 60 * 1000)));
|
|
78
|
+
}
|
|
67
79
|
/** Discover is in the navigation: some pages are under it. */
|
|
68
80
|
function hasDiscover(navigation) {
|
|
69
81
|
return navigation.discover.length > 0 || navigation.onOpen.length > 0;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A line above the message box after a newcomer's first conversation was answered: Ta is on the phone too, a tap shows
|
|
4
|
+
* the code to scan (RelayDialog). Once (FirstStepsUtil.phoneHint), kept for the user on every device.
|
|
5
|
+
*/
|
|
6
|
+
export declare function PhoneHint(): React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=phone-hint.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
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.PhoneHint = PhoneHint;
|
|
37
|
+
const react_1 = require("@celljs/react");
|
|
38
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
39
|
+
const lucide_react_1 = require("lucide-react");
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const device_1 = require("../device/device");
|
|
42
|
+
const web_metrics_1 = require("../extension/web-metrics");
|
|
43
|
+
const hooks_1 = require("../hooks");
|
|
44
|
+
const use_t_1 = require("../i18n/use-t");
|
|
45
|
+
const state_protocol_1 = require("../state/state-protocol");
|
|
46
|
+
const first_steps_util_1 = require("./first-steps-util");
|
|
47
|
+
const icon_1 = require("./icon");
|
|
48
|
+
const people_1 = require("./people");
|
|
49
|
+
const relay_view_1 = require("./relay-view");
|
|
50
|
+
/**
|
|
51
|
+
* A line above the message box after a newcomer's first conversation was answered: Ta is on the phone too, a tap shows
|
|
52
|
+
* the code to scan (RelayDialog). Once (FirstStepsUtil.phoneHint), kept for the user on every device.
|
|
53
|
+
*/
|
|
54
|
+
function PhoneHint() {
|
|
55
|
+
var _a;
|
|
56
|
+
const t = (0, use_t_1.useT)();
|
|
57
|
+
const handheld = (0, device_1.useDevice)(device => device.handheld);
|
|
58
|
+
const state = (0, react_1.useInject)(state_protocol_1.TaState);
|
|
59
|
+
const [workbench, bench] = (0, hooks_1.useWorkbench)();
|
|
60
|
+
const [kept, setKept] = (0, hooks_1.usePersisted)(first_steps_util_1.FirstStepsUtil.STATE);
|
|
61
|
+
const [loaded, setLoaded] = React.useState(false);
|
|
62
|
+
const [paired, setPaired] = React.useState();
|
|
63
|
+
const [pairing, setPairing] = React.useState(false);
|
|
64
|
+
// Pairing is the owner's: one let into their Ta (a collaborator, a guest) is not offered it.
|
|
65
|
+
const owner = React.useContext(people_1.MessagePeople).me === ta_protocol_1.TA_OWNER;
|
|
66
|
+
const online = owner && workbench.status === 'online';
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
void state.load(first_steps_util_1.FirstStepsUtil.STATE).then(() => setLoaded(true), () => undefined);
|
|
69
|
+
}, [state]);
|
|
70
|
+
// The phones paired, asked only once the line could show at all.
|
|
71
|
+
const candidate = loaded && online && first_steps_util_1.FirstStepsUtil.phoneHint(kept, { handheld, paired: 0, now: Date.now() });
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
if (candidate && paired === undefined) {
|
|
74
|
+
bench.relay.getRelay().then(info => setPaired(info.devices.length), () => undefined);
|
|
75
|
+
}
|
|
76
|
+
}, [candidate, paired, bench]);
|
|
77
|
+
const shown = candidate && paired !== undefined && first_steps_util_1.FirstStepsUtil.phoneHint(kept, { handheld, paired, now: Date.now() });
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
if (shown && ((_a = kept.phone) === null || _a === void 0 ? void 0 : _a.at) === undefined) {
|
|
81
|
+
(_b = web_metrics_1.WebMetrics.current) === null || _b === void 0 ? void 0 : _b.own('step:phone-hint');
|
|
82
|
+
setKept(before => ({ ...before, phone: { ...before.phone, at: Date.now() } }));
|
|
83
|
+
}
|
|
84
|
+
}, [shown, (_a = kept.phone) === null || _a === void 0 ? void 0 : _a.at, setKept]);
|
|
85
|
+
const done = () => setKept(before => ({ ...before, phone: { ...before.phone, done: true } }));
|
|
86
|
+
return (React.createElement(React.Fragment, null,
|
|
87
|
+
shown && (React.createElement("div", { className: "ta-phone-hint" },
|
|
88
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.Smartphone, size: 14 }),
|
|
89
|
+
React.createElement("span", { className: "ta-ellipsis" }, t('ta.phoneHint.text')),
|
|
90
|
+
React.createElement("button", { type: "button", className: "ta-link-button", onClick: () => {
|
|
91
|
+
var _a;
|
|
92
|
+
(_a = web_metrics_1.WebMetrics.current) === null || _a === void 0 ? void 0 : _a.own('step:phone-pair');
|
|
93
|
+
setPairing(true);
|
|
94
|
+
done();
|
|
95
|
+
} }, t('ta.phoneHint.pair')),
|
|
96
|
+
React.createElement(icon_1.IconButton, { icon: lucide_react_1.X, label: t('ta.close'), onClick: done }))),
|
|
97
|
+
pairing && React.createElement(relay_view_1.RelayDialog, { onClose: () => setPairing(false) })));
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=phone-hint.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TaRelayDevice } from '@celljs/ta-protocol';
|
|
2
|
+
export declare namespace RelayViewUtil {
|
|
3
|
+
/** The name of the next device paired: `base`, numbered when one paired already has it (`Phone 2`). */
|
|
4
|
+
function nextName(base: string, devices: readonly Pick<TaRelayDevice, 'name'>[]): string;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=relay-view-util.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelayViewUtil = void 0;
|
|
4
|
+
var RelayViewUtil;
|
|
5
|
+
(function (RelayViewUtil) {
|
|
6
|
+
/** The name of the next device paired: `base`, numbered when one paired already has it (`Phone 2`). */
|
|
7
|
+
function nextName(base, devices) {
|
|
8
|
+
const taken = new Set(devices.map(device => device.name));
|
|
9
|
+
let name = base;
|
|
10
|
+
for (let n = 2; taken.has(name); n++) {
|
|
11
|
+
name = `${base} ${n}`;
|
|
12
|
+
}
|
|
13
|
+
return name;
|
|
14
|
+
}
|
|
15
|
+
RelayViewUtil.nextName = nextName;
|
|
16
|
+
})(RelayViewUtil || (exports.RelayViewUtil = RelayViewUtil = {}));
|
|
17
|
+
//# sourceMappingURL=relay-view-util.js.map
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.RelayDialog = RelayDialog;
|
|
37
37
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
38
|
+
const relay_protocol_1 = require("@celljs/ta-relay/lib/common/relay-protocol");
|
|
38
39
|
const lucide_react_1 = require("lucide-react");
|
|
39
40
|
const React = __importStar(require("react"));
|
|
40
41
|
const react_dom_1 = require("react-dom");
|
|
@@ -46,6 +47,7 @@ const busy_1 = require("./busy");
|
|
|
46
47
|
const icon_1 = require("./icon");
|
|
47
48
|
const picture_1 = require("./picture");
|
|
48
49
|
const qr_view_1 = require("./qr-view");
|
|
50
|
+
const relay_view_util_1 = require("./relay-view-util");
|
|
49
51
|
const serve_value_1 = require("./serve-value");
|
|
50
52
|
const settings_controls_1 = require("./settings-controls");
|
|
51
53
|
const RELAY_TOPICS = [ta_protocol_1.TaServeChanges.RELAY];
|
|
@@ -82,7 +84,6 @@ function RelayDialog({ onClose }) {
|
|
|
82
84
|
const [, bench] = (0, hooks_1.useWorkbench)();
|
|
83
85
|
const [, notices] = (0, hooks_1.useNotices)();
|
|
84
86
|
const [link, setLink] = React.useState();
|
|
85
|
-
const [name, setName] = React.useState('');
|
|
86
87
|
const [busy, run] = (0, busy_1.useBusy)();
|
|
87
88
|
// Whether ta serve reached the relay shows as it does (TaServeChanges.RELAY), a moment after pairing.
|
|
88
89
|
const getRelay = React.useCallback(() => bench.relay.getRelay(), [bench]);
|
|
@@ -118,9 +119,9 @@ function RelayDialog({ onClose }) {
|
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
121
|
try {
|
|
121
|
-
|
|
122
|
+
// Named for the user, rather than asked: a name of the phone's, numbered (RelayViewUtil.nextName).
|
|
123
|
+
const paired = await bench.relay.pair((_a = info.relay) !== null && _a !== void 0 ? _a : info.defaultRelay, relay_view_util_1.RelayViewUtil.nextName(t('ta.relay.phone'), info.devices));
|
|
122
124
|
setLink(paired.link);
|
|
123
|
-
setName('');
|
|
124
125
|
void load();
|
|
125
126
|
}
|
|
126
127
|
catch (error) {
|
|
@@ -153,6 +154,12 @@ function RelayDialog({ onClose }) {
|
|
|
153
154
|
link ? (React.createElement("div", { className: "ta-relay-pairing" },
|
|
154
155
|
React.createElement(qr_view_1.QrView, { text: link }),
|
|
155
156
|
React.createElement("p", null, t('ta.relay.scan')),
|
|
157
|
+
React.createElement("p", { className: "ta-relay-download" },
|
|
158
|
+
React.createElement(icon_1.Icon, { icon: lucide_react_1.Download, size: 14 }),
|
|
159
|
+
React.createElement("span", null,
|
|
160
|
+
t('ta.relay.noApp'),
|
|
161
|
+
' ',
|
|
162
|
+
React.createElement("a", { href: relay_protocol_1.RELAY_DOWNLOAD_PAGE, target: "_blank", rel: "noreferrer" }, t('ta.relay.download')))),
|
|
156
163
|
React.createElement("div", { className: "ta-auth-actions" },
|
|
157
164
|
React.createElement("button", { type: "button", className: "ta-button", onClick: () => void run(() => { var _a; return (_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.writeText(link).catch(() => undefined); }) },
|
|
158
165
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Copy, size: 15 }),
|
|
@@ -162,9 +169,6 @@ function RelayDialog({ onClose }) {
|
|
|
162
169
|
React.createElement(RelayPicture, null),
|
|
163
170
|
React.createElement("p", null, t('ta.relay.hint')),
|
|
164
171
|
React.createElement("div", { className: "ta-relay-form" },
|
|
165
|
-
React.createElement("label", { className: "ta-field" },
|
|
166
|
-
React.createElement(lucide_react_1.Smartphone, { size: 15, strokeWidth: 1.75, "aria-hidden": "true" }),
|
|
167
|
-
React.createElement("input", { placeholder: t('ta.relay.phone'), value: name, onChange: event => setName(event.target.value) })),
|
|
168
172
|
React.createElement("button", { type: "button", className: busy ? 'ta-button ta-primary ta-busy' : 'ta-button ta-primary', "aria-busy": busy || undefined, disabled: !info, onClick: () => void run(pair) },
|
|
169
173
|
t('ta.relay.pair'),
|
|
170
174
|
React.createElement(busy_1.BusyMark, { busy: busy }))))),
|
|
@@ -77,6 +77,7 @@ const message_images_1 = require("./message-images");
|
|
|
77
77
|
const message_list_1 = require("./message-list");
|
|
78
78
|
const moved_notice_1 = require("./moved-notice");
|
|
79
79
|
const people_1 = require("./people");
|
|
80
|
+
const phone_hint_1 = require("./phone-hint");
|
|
80
81
|
const session_settings_1 = require("./session-settings");
|
|
81
82
|
const terminal_art_1 = require("./terminal-art");
|
|
82
83
|
const use_stop_times_1 = require("./use-stop-times");
|
|
@@ -426,7 +427,7 @@ function SessionView({ store, server, workspace, info, onClosed, onActivity, lea
|
|
|
426
427
|
widgetsAt('aboveEditor'),
|
|
427
428
|
addons.above,
|
|
428
429
|
React.createElement(voice_call_bar_1.CallBar, { state: callState, call: call })),
|
|
429
|
-
React.createElement(composer_1.Composer, { ref: composer, store: store, server: server, workspace: workspace, working: state.working, compacting: !!state.compacting, commands: settings.commands, cwd: info === null || info === void 0 ? void 0 : info.cwd, actions: composerActions, recentShots: recentShots, onStopTimed: stopTimed, onTyping: onTyping, draft: (info === null || info === void 0 ? void 0 : info.sessionFile) ? drafts_protocol_1.DraftPlaces.chat(info.sessionFile) : undefined, onTalkCall: callable && !callState.active ? (0, voice_call_bar_1.talkCall)(call) : undefined, talkCalls: talkCalls, onError: fail }),
|
|
430
|
+
React.createElement(composer_1.Composer, { above: React.createElement(phone_hint_1.PhoneHint, null), ref: composer, store: store, server: server, workspace: workspace, working: state.working, compacting: !!state.compacting, commands: settings.commands, cwd: info === null || info === void 0 ? void 0 : info.cwd, actions: composerActions, recentShots: recentShots, onStopTimed: stopTimed, onTyping: onTyping, draft: (info === null || info === void 0 ? void 0 : info.sessionFile) ? drafts_protocol_1.DraftPlaces.chat(info.sessionFile) : undefined, onTalkCall: callable && !callState.active ? (0, voice_call_bar_1.talkCall)(call) : undefined, talkCalls: talkCalls, onError: fail }),
|
|
430
431
|
belowComposer,
|
|
431
432
|
widgetsAt('belowEditor'),
|
|
432
433
|
statuses.length > 0 && (React.createElement("div", { className: "ta-statusline" }, statuses.map(([key, text]) => (React.createElement(StatusChip, { key: key, text: text })))))))));
|
|
@@ -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.
|
|
@@ -259,6 +259,7 @@ function useMoreSections(onDialog) {
|
|
|
259
259
|
title: t('ta.settings.about'),
|
|
260
260
|
icon: lucide_react_1.Info,
|
|
261
261
|
order: 1000,
|
|
262
|
+
tier: 'common',
|
|
262
263
|
rows: workbench.server
|
|
263
264
|
? [
|
|
264
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
|
|
@@ -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
|
|
@@ -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
|