@celljs/ta-web 4.46.3 → 4.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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-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 +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 +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/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/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 +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/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/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +7 -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/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-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 +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 +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/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/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 +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/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/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +7 -0
- package/package.json +7 -7
|
@@ -80,6 +80,11 @@ export interface Settings {
|
|
|
80
80
|
clipboardLinks: boolean;
|
|
81
81
|
/** Which pages of web extensions are in the navigation, and which under Discover. */
|
|
82
82
|
navigation: NavigationSetting;
|
|
83
|
+
/**
|
|
84
|
+
* Every feature listed in Discover and every section of the settings shown (docs/design/ta-simple.md 4.2); off, those
|
|
85
|
+
* for most people and those the user used, the rest a row away (All features, More settings).
|
|
86
|
+
*/
|
|
87
|
+
allFeatures: boolean;
|
|
83
88
|
/** How long an extension started on open keeps running once left, before it stops (ta-launcher.md). */
|
|
84
89
|
keepAliveMinutes: number;
|
|
85
90
|
/** The conversations of the list not updated for these days are folded at its end; 0, none. */
|
|
@@ -46,6 +46,7 @@ export const DEFAULT_SETTINGS = {
|
|
|
46
46
|
trustedDomains: [],
|
|
47
47
|
clipboardLinks: true,
|
|
48
48
|
navigation: DEFAULT_NAVIGATION,
|
|
49
|
+
allFeatures: false,
|
|
49
50
|
keepAliveMinutes: 5,
|
|
50
51
|
chatFoldDays: 7,
|
|
51
52
|
chatArchiveDays: 30,
|
|
@@ -98,6 +99,7 @@ export var SettingsUtil;
|
|
|
98
99
|
trustedDomains: strings(kept.trustedDomains),
|
|
99
100
|
clipboardLinks: kept.clipboardLinks !== false,
|
|
100
101
|
navigation: NavigationUtil.parse(kept.navigation),
|
|
102
|
+
allFeatures: kept.allFeatures === true,
|
|
101
103
|
keepAliveMinutes: choice(kept.keepAliveMinutes, KEEP_ALIVE_CHOICES, DEFAULT_SETTINGS.keepAliveMinutes),
|
|
102
104
|
chatFoldDays: choice(kept.chatFoldDays, CHAT_FOLD_CHOICES, DEFAULT_SETTINGS.chatFoldDays),
|
|
103
105
|
chatArchiveDays: choice(kept.chatArchiveDays, CHAT_ARCHIVE_CHOICES, DEFAULT_SETTINGS.chatArchiveDays),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Dialogs and sheets, the picker of machines, rows far up a conversation, the sign-in to model accounts, Ta on a phone. */
|
|
2
|
-
export declare const DIALOGS_STYLE = "\n/* A dialog in the middle of the page; a sheet from the bottom on a phone */\n.ta-modal-scrim { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 12px 12px; background: rgba(0, 0, 0, 0.32); animation: ta-fade 140ms ease-out; }\n.ta-modal { position: relative; z-index: 1; width: min(520px, 100%); max-height: 76vh; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border-radius: 14px; border: 1px solid var(--ta-border); background: var(--ta-card); box-shadow: var(--ta-shadow-pop); }\n.ta-modal-head { display: flex; align-items: center; justify-content: space-between; padding-left: 2px; }\n.ta-modal-title { font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; }\n.ta-web-dialog { width: min(480px, 100%); gap: 14px; padding: 16px 18px 18px; }\n.ta-web-dialog > :not(.ta-modal-head) { min-height: 0; overflow-y: auto; }\n.ta-web-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-folder-bar { display: flex; align-items: center; gap: 6px; }\n/* The path on a touch screen: its folders as buttons, scrolled to the last; it fills the bar as the field does. */\n.ta-folder-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; height: var(--ta-input-height); padding: 0 6px; overflow-x: auto; scrollbar-width: none; border-radius: 8px; background: var(--ta-input); border: 1px solid var(--ta-border-field); white-space: nowrap; }\n.ta-folder-crumbs::-webkit-scrollbar { display: none; }\n.ta-folder-crumbs[data-clipped] { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }\n.ta-folder-crumb { flex: none; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-folder-crumb:active { background: var(--ta-hover); }\n.ta-folder-crumb.ta-current { color: var(--ta-text); font-weight: 600; }\n.ta-folder-crumb-sep { flex: none; color: var(--ta-muted); }\n.ta-folder-machines .ta-chip-filter { flex: none; max-width: 70%; }\n.ta-folder-list { list-style: none; flex: none; height: min(340px, 44vh); overflow-y: auto; margin: 0; padding: 4px; border: 1px solid var(--ta-border-muted); border-radius: 10px; }\n.ta-folder-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ta-body); font-size: calc(13px * var(--ta-font-scale)); text-align: left; }\n.ta-folder-item:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-folder-item > .ta-icon:first-child, .ta-folder-chevron { color: var(--ta-muted); }\n.ta-folder-chevron { opacity: 0; }\n.ta-folder-item:hover .ta-folder-chevron { opacity: 1; }\n.ta-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-folder-note { display: flex; justify-content: center; padding: 28px 8px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-folder-failed { color: var(--ta-red); font-size: calc(12.5px * var(--ta-font-scale)); overflow-wrap: anywhere; }\n.ta-folder-note { gap: 8px; align-items: center; }\n.ta-folder-step { color: var(--ta-secondary); }\n.ta-folder-unreachable { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; text-align: center; font-size: calc(13px * var(--ta-font-scale)); color: var(--ta-text); }\n.ta-folder-unreachable span { max-width: 100%; color: var(--ta-muted); font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); overflow-wrap: anywhere; }\n/* The machines of the picker: this one, the hosts of ssh, + another */\n.ta-modal.ta-folder { width: min(640px, 100%); }\n.ta-folder-machines { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; margin: 0; padding: 0 0 2px; gap: 6px; scrollbar-width: none; }\n.ta-folder-machines::-webkit-scrollbar { display: none; }\n.ta-folder-machines .ta-icon-button { flex: none; width: 28px; height: 28px; border-radius: 14px; }\n/* A host to add: a row of its own under the machines, as wide as the path, what it may be said under it. */\n.ta-folder-add { display: flex; flex-direction: column; gap: 6px; }\n.ta-folder-add-row { display: flex; align-items: center; gap: 8px; }\n.ta-folder-add-row .ta-button { flex: none; height: var(--ta-input-height); }\n.ta-folder-add-hint { padding: 0 2px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); overflow-wrap: anywhere; }\n.ta-remote-state { display: inline-flex; align-items: center; gap: 6px; }\n.ta-remote-light { width: 7px; height: 7px; border-radius: 50%; background: var(--ta-border-field); flex: none; }\n.ta-remote-light.ta-on { background: var(--ta-green); }\n.ta-remote-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ta-green); flex: none; }\n/* The host of a directory of another machine, before its name */\n.ta-host-tag { display: inline-flex; align-items: center; gap: 3px; flex: none; box-sizing: border-box; max-width: 120px; height: 17px; padding: 0 5px 0 4px; margin-right: 5px; border-radius: 5px; background: color-mix(in srgb, var(--ta-blue) 11%, transparent); color: color-mix(in srgb, var(--ta-blue) 82%, var(--ta-text)); font-size: calc(11px * var(--ta-font-scale)); font-weight: 500; line-height: calc(17px * var(--ta-font-scale)); white-space: nowrap; vertical-align: middle; }\n.ta-host-tag > svg { flex: none; }\n.ta-host-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }\n/* In a narrow chip the host gives way before the name of the folder, and both stay inside it. */\n.ta-cwd-chip .ta-host-tag { flex: 0 10 auto; min-width: 0; margin: 0 0 0 2px; }\n.ta-cwd-chip .ta-ellipsis { flex: none; max-width: 60%; }\n/* What ssh asks */\n.ta-remote-prompt { width: min(440px, 100%); gap: 12px; }\n.ta-remote-prompt .ta-confirm-title { display: flex; align-items: center; gap: 8px; }\n.ta-remote-message { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--ta-hover); color: var(--ta-body); font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow-y: auto; }\n@media (max-width: 860px), (max-height: 500px) and (pointer: coarse), (max-height: 500px) and (hover: none) {\n .ta-modal-scrim { align-items: flex-end; padding: 0; }\n .ta-modal { max-height: 88dvh; border-radius: 16px 16px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); animation: ta-up 260ms var(--ta-ease); }\n .ta-chat-row:hover .ta-compact .ta-chat-time, .ta-chat-row:hover .ta-chat-state { visibility: visible; }\n .ta-chat-row:not(.ta-selected) .ta-chat-delete { display: none; }\n .ta-chat-row.ta-selected .ta-chat-delete { opacity: 1; }\n .ta-chat-row.ta-selected .ta-compact .ta-chat-time, .ta-chat-row.ta-selected .ta-chat-state { visibility: hidden; }\n .ta-chat-row.ta-selected .ta-chat-item:not(.ta-compact) .ta-chat-sub { padding-right: 28px; }\n .ta-folder-chevron { opacity: 1; }\n}\n/* A tap leaves no hover behind on a folder; a press shows. */\n@media (pointer: coarse), (hover: none) {\n .ta-folder-item:hover { background: transparent; color: var(--ta-body); }\n .ta-folder-item:active { background: var(--ta-hover); color: var(--ta-text); }\n}\n\n/* Performance (t6): rows far up the conversation skip layout and paint until they come into view */\n.ta-thread-item { display: flex; flex-direction: column; min-width: 0; contain-intrinsic-size: auto 160px; }\n/* A message nothing is drawn of (pi's note of a changed prompt) takes no gap: the first message does not move down when it comes. */\n.ta-thread-item:empty { display: none; }\n.ta-thread-item.ta-settled { content-visibility: auto; }\n/* Above the messages while the earlier ones of a long conversation load, as it is scrolled up. */\n.ta-earlier { display: flex; justify-content: center; padding: 12px 0; }\n.ta-earlier-idle .ta-spinner { visibility: hidden; animation: none; }\n\n/* Model accounts: the sign-in page, the dialog and a sign-in under way */\n.ta-login-card { width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }\n.ta-login-card h1 { margin: 6px 0 0; font-size: calc(20px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-text); }\n.ta-login-card > p { margin: 0 0 6px; color: var(--ta-secondary); font-size: calc(13.5px * var(--ta-font-scale)); line-height: 1.6; }\n.ta-login-card .ta-auth-panel { width: 100%; text-align: left; }\n.ta-login-card .ta-auth-list { max-height: min(46vh, 420px); }\n.ta-login-later { margin-top: 2px; border: 0; background: none; color: var(--ta-muted); font: inherit; font-size: calc(13px * var(--ta-font-scale)); cursor: pointer; }\n.ta-login-later:hover { color: var(--ta-text); }\n.ta-login-card .ta-pic-cards { margin-top: 4px; }\n.ta-auth-dialog { width: min(520px, 100%); gap: 12px; padding: 16px 18px 18px; }\n.ta-auth-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-auth-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }\n.ta-auth-list { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 56vh; }\n.ta-auth-group h3 { margin: 0 0 4px; padding: 0 10px; font-size: calc(12px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-auth-row { display: flex; align-items: center; gap: 4px; }\n.ta-auth-item { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ta-body); font: inherit; font-size: calc(13.5px * var(--ta-font-scale)); text-align: left; cursor: pointer; }\n.ta-auth-item:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-auth-item > .ta-icon:last-child { color: var(--ta-muted); }\n.ta-auth-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-text); }\n.ta-auth-kind { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--ta-raised); color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); }\n.ta-auth-note { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }\n.ta-auth-on { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: var(--ta-green); font-size: calc(12px * var(--ta-font-scale)); max-width: 45%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.ta-auth-item .ta-auth-on + .ta-icon { margin-left: 0; }\n.ta-auth-item > .ta-auth-kind + .ta-icon { margin-left: auto; }\n.ta-auth-flow { display: flex; flex-direction: column; gap: 14px; text-align: left; }\n.ta-auth-flow-head { display: flex; align-items: center; gap: 8px; }\n.ta-auth-flow-title { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-text); }\n.ta-auth-step { display: flex; flex-direction: column; gap: 10px; }\n.ta-auth-step p { margin: 0; color: var(--ta-body); font-size: calc(13.5px * var(--ta-font-scale)); line-height: 1.6; }\n.ta-auth-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n.ta-auth-code { align-self: flex-start; padding: 8px 14px; border-radius: 10px; background: var(--ta-raised); color: var(--ta-text); font-family: var(--ta-mono); font-size: calc(20px * var(--ta-font-scale)); letter-spacing: 0.12em; user-select: all; }\n.ta-auth-options { display: flex; flex-direction: column; gap: 2px; }\n.ta-auth-link { display: block; margin-top: 4px; color: var(--ta-link, var(--ta-brand)); word-break: break-all; }\n/* The sign-in comes in step by step; its pictures answer the pointer */\n@keyframes ta-rise { from { transform: translateY(10px); opacity: 0; } }\n@keyframes ta-key-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; transform: translateY(-1.5px); } }\n@keyframes ta-tick { from { stroke-dashoffset: 12; } }\n@keyframes ta-code-in { from { letter-spacing: 0.4em; opacity: 0; } }\n.ta-login-card > * { animation: ta-rise 420ms var(--ta-ease) both; }\n.ta-login-card > :nth-child(2) { animation-delay: 60ms; }\n.ta-login-card > :nth-child(3) { animation-delay: 100ms; }\n.ta-login-card > :nth-child(4) { animation-delay: 150ms; }\n.ta-login-card > :nth-child(5) { animation-delay: 220ms; }\n.ta-login-card .ta-pic-card:hover .ta-pic-tick { stroke-dasharray: 12; animation: ta-tick 420ms var(--ta-ease) both; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot { animation: ta-key-dot 900ms ease-in-out infinite; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot:nth-child(n+8) { animation-delay: 90ms; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot:nth-child(n+10) { animation-delay: 180ms; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot:nth-child(n+12) { animation-delay: 270ms; }\n.ta-auth-flow > *, .ta-auth-panel > *, .ta-auth-group { animation: ta-in 260ms var(--ta-ease) both; }\n.ta-auth-code { animation: ta-code-in 420ms var(--ta-ease) both; }\n.ta-auth-item { transition: background 120ms, color 120ms, transform 120ms var(--ta-ease); }\n.ta-auth-item:hover > .ta-icon:last-child { transform: translateX(2px); transition: transform 160ms var(--ta-ease); }\n/* Ta on a phone: a picture of the way through the relay, the code to scan, the devices */\n@keyframes ta-qr-in { from { transform: scale(.94); opacity: 0; } }\n.ta-relay-dialog { width: min(440px, 100%); gap: 14px; padding: 16px 18px 18px; }\n.ta-relay-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-relay-start, .ta-relay-pairing { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; animation: ta-in 260ms var(--ta-ease) both; }\n.ta-relay-start p, .ta-relay-pairing p { margin: 0; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.6; }\n.ta-relay-pic { width: 100%; max-width: 320px; border-radius: 0; }\n.ta-relay-form { display: flex; gap: 8px; width: 100%; }\n.ta-relay-form .ta-field { flex: 1; }\n.ta-qr { width: 220px; height: 220px; border-radius: 12px; animation: ta-qr-in 320ms var(--ta-ease) both; }\n.ta-relay-state { margin-left: 8px; font-weight: 400; color: var(--ta-muted); }\n.ta-relay-state::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--ta-muted); vertical-align: middle; }\n.ta-relay-state.ta-on::before { background: var(--ta-green); }\n.ta-relay-device { gap: 10px; height: 38px; padding: 0 4px 0 10px; color: var(--ta-muted); }\n.ta-relay-device .ta-auth-note { flex: none; margin-left: auto; }\n.ta-relay-awake { display: flex; align-items: center; gap: 12px; padding: 0 4px 0 10px; }\n.ta-relay-awake-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }\n.ta-relay-awake-text .ta-auth-note { white-space: normal; line-height: 1.5; }\n/* The account and its devices (account-view.tsx) */\n.ta-account-dialog { width: min(440px, 100%); gap: 14px; padding: 16px 18px 18px; overflow-y: auto; }\n.ta-account-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-account-hint { margin: 0; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.55; }\n.ta-account-ways, .ta-account-signing { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }\n.ta-account-signing p { margin: 0; text-align: center; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-account-waiting { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 2px; text-align: center; }\n.ta-account-waiting strong { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; }\n.ta-account-waiting p { margin: 0; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.55; }\n.ta-account-code { padding: 12px 22px; border-radius: 14px; background: var(--ta-hover); font-family: var(--ta-mono); font-size: calc(30px * var(--ta-font-scale)); font-weight: 600; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; color: var(--ta-text); white-space: nowrap; }\n.ta-account-devices { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n.ta-account-device { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 6px 6px 8px; border-radius: 12px; }\n.ta-account-device.ta-waiting { background: var(--ta-hover); }\n.ta-account-device-icon { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ta-hover); color: var(--ta-secondary); }\n.ta-account-device.ta-waiting .ta-account-device-icon { background: var(--ta-card); }\n.ta-account-dot { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ta-muted); box-shadow: 0 0 0 2px var(--ta-card); }\n.ta-account-dot.ta-on { background: var(--ta-green); }\n.ta-account-device-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; font-size: calc(14px * var(--ta-font-scale)); }\n.ta-account-device-detail { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-account-device-actions { flex: none; display: flex; align-items: center; gap: 6px; }\n.ta-account-device-actions .ta-button { height: 30px; padding: 0 12px; }\n.ta-account-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--ta-border-muted); }\n.ta-account-who { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-account-foot .ta-button { height: 30px; padding: 0 12px; }\n.ta-account-sign-in { display: flex; width: 100%; flex-direction: column; gap: 12px; text-align: left; }\n.ta-account-signed { display: flex; width: 100%; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0; text-align: center; }\n.ta-account-signed .ta-account-who { font-size: calc(14px * var(--ta-font-scale)); color: var(--ta-text); }\n.ta-account-others { display: flex; flex-direction: column; gap: 6px; }\n.ta-account-others h2 { margin: 0 4px; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-account-recent-mark { display: grid; place-items: center; background: var(--ta-hover); color: var(--ta-text); }\n.ta-account-ask { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 58; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; width: min(420px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 16px; border: 1px solid var(--ta-border); background: var(--ta-card); box-shadow: var(--ta-shadow-pop); transform: translateX(-50%); animation: ta-fade 160ms ease-out; }\n.ta-account-ask-text { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; }\n.ta-account-ask-text strong { max-width: 100%; font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; }\n.ta-account-ask .ta-account-code { padding: 4px 10px; border-radius: 8px; font-size: calc(20px * var(--ta-font-scale)); }\n.ta-account-ask-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }\n.ta-account-ask-actions .ta-link-button { margin-right: auto; }\n";
|
|
2
|
+
export declare const DIALOGS_STYLE = "\n/* A dialog in the middle of the page; a sheet from the bottom on a phone */\n.ta-modal-scrim { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 12px 12px; background: rgba(0, 0, 0, 0.32); animation: ta-fade 140ms ease-out; }\n.ta-modal { position: relative; z-index: 1; width: min(520px, 100%); max-height: 76vh; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border-radius: 14px; border: 1px solid var(--ta-border); background: var(--ta-card); box-shadow: var(--ta-shadow-pop); }\n.ta-modal-head { display: flex; align-items: center; justify-content: space-between; padding-left: 2px; }\n.ta-modal-title { font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; }\n.ta-web-dialog { width: min(480px, 100%); gap: 14px; padding: 16px 18px 18px; }\n.ta-web-dialog > :not(.ta-modal-head) { min-height: 0; overflow-y: auto; }\n.ta-web-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-folder-bar { display: flex; align-items: center; gap: 6px; }\n/* The path on a touch screen: its folders as buttons, scrolled to the last; it fills the bar as the field does. */\n.ta-folder-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; height: var(--ta-input-height); padding: 0 6px; overflow-x: auto; scrollbar-width: none; border-radius: 8px; background: var(--ta-input); border: 1px solid var(--ta-border-field); white-space: nowrap; }\n.ta-folder-crumbs::-webkit-scrollbar { display: none; }\n.ta-folder-crumbs[data-clipped] { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }\n.ta-folder-crumb { flex: none; height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-folder-crumb:active { background: var(--ta-hover); }\n.ta-folder-crumb.ta-current { color: var(--ta-text); font-weight: 600; }\n.ta-folder-crumb-sep { flex: none; color: var(--ta-muted); }\n.ta-folder-machines .ta-chip-filter { flex: none; max-width: 70%; }\n.ta-folder-list { list-style: none; flex: none; height: min(340px, 44vh); overflow-y: auto; margin: 0; padding: 4px; border: 1px solid var(--ta-border-muted); border-radius: 10px; }\n.ta-folder-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ta-body); font-size: calc(13px * var(--ta-font-scale)); text-align: left; }\n.ta-folder-item:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-folder-item > .ta-icon:first-child, .ta-folder-chevron { color: var(--ta-muted); }\n.ta-folder-chevron { opacity: 0; }\n.ta-folder-item:hover .ta-folder-chevron { opacity: 1; }\n.ta-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-folder-note { display: flex; justify-content: center; padding: 28px 8px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-folder-failed { color: var(--ta-red); font-size: calc(12.5px * var(--ta-font-scale)); overflow-wrap: anywhere; }\n.ta-folder-note { gap: 8px; align-items: center; }\n.ta-folder-step { color: var(--ta-secondary); }\n.ta-folder-unreachable { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; text-align: center; font-size: calc(13px * var(--ta-font-scale)); color: var(--ta-text); }\n.ta-folder-unreachable span { max-width: 100%; color: var(--ta-muted); font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); overflow-wrap: anywhere; }\n/* The machines of the picker: this one, the hosts of ssh, + another */\n.ta-modal.ta-folder { width: min(640px, 100%); }\n.ta-folder-machines { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; margin: 0; padding: 0 0 2px; gap: 6px; scrollbar-width: none; }\n.ta-folder-machines::-webkit-scrollbar { display: none; }\n.ta-folder-machines .ta-icon-button { flex: none; width: 28px; height: 28px; border-radius: 14px; }\n/* A host to add: a row of its own under the machines, as wide as the path, what it may be said under it. */\n.ta-folder-add { display: flex; flex-direction: column; gap: 6px; }\n.ta-folder-add-row { display: flex; align-items: center; gap: 8px; }\n.ta-folder-add-row .ta-button { flex: none; height: var(--ta-input-height); }\n.ta-folder-add-hint { padding: 0 2px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); overflow-wrap: anywhere; }\n.ta-remote-state { display: inline-flex; align-items: center; gap: 6px; }\n.ta-remote-light { width: 7px; height: 7px; border-radius: 50%; background: var(--ta-border-field); flex: none; }\n.ta-remote-light.ta-on { background: var(--ta-green); }\n.ta-remote-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ta-green); flex: none; }\n/* The host of a directory of another machine, before its name */\n.ta-host-tag { display: inline-flex; align-items: center; gap: 3px; flex: none; box-sizing: border-box; max-width: 120px; height: 17px; padding: 0 5px 0 4px; margin-right: 5px; border-radius: 5px; background: color-mix(in srgb, var(--ta-blue) 11%, transparent); color: color-mix(in srgb, var(--ta-blue) 82%, var(--ta-text)); font-size: calc(11px * var(--ta-font-scale)); font-weight: 500; line-height: calc(17px * var(--ta-font-scale)); white-space: nowrap; vertical-align: middle; }\n.ta-host-tag > svg { flex: none; }\n.ta-host-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }\n/* In a narrow chip the host gives way before the name of the folder, and both stay inside it. */\n.ta-cwd-chip .ta-host-tag { flex: 0 10 auto; min-width: 0; margin: 0 0 0 2px; }\n.ta-cwd-chip .ta-ellipsis { flex: none; max-width: 60%; }\n/* What ssh asks */\n.ta-remote-prompt { width: min(440px, 100%); gap: 12px; }\n.ta-remote-prompt .ta-confirm-title { display: flex; align-items: center; gap: 8px; }\n.ta-remote-message { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--ta-hover); color: var(--ta-body); font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 160px; overflow-y: auto; }\n@media (max-width: 860px), (max-height: 500px) and (pointer: coarse), (max-height: 500px) and (hover: none) {\n .ta-modal-scrim { align-items: flex-end; padding: 0; }\n .ta-modal { max-height: 88dvh; border-radius: 16px 16px 0 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); animation: ta-up 260ms var(--ta-ease); }\n .ta-chat-row:hover .ta-compact .ta-chat-time, .ta-chat-row:hover .ta-chat-state { visibility: visible; }\n .ta-chat-row:not(.ta-selected) .ta-chat-delete { display: none; }\n .ta-chat-row.ta-selected .ta-chat-delete { opacity: 1; }\n .ta-chat-row.ta-selected .ta-compact .ta-chat-time, .ta-chat-row.ta-selected .ta-chat-state { visibility: hidden; }\n .ta-chat-row.ta-selected .ta-chat-item:not(.ta-compact) .ta-chat-sub { padding-right: 28px; }\n .ta-folder-chevron { opacity: 1; }\n}\n/* A tap leaves no hover behind on a folder; a press shows. */\n@media (pointer: coarse), (hover: none) {\n .ta-folder-item:hover { background: transparent; color: var(--ta-body); }\n .ta-folder-item:active { background: var(--ta-hover); color: var(--ta-text); }\n}\n\n/* Performance (t6): rows far up the conversation skip layout and paint until they come into view */\n.ta-thread-item { display: flex; flex-direction: column; min-width: 0; contain-intrinsic-size: auto 160px; }\n/* A message nothing is drawn of (pi's note of a changed prompt) takes no gap: the first message does not move down when it comes. */\n.ta-thread-item:empty { display: none; }\n.ta-thread-item.ta-settled { content-visibility: auto; }\n/* Above the messages while the earlier ones of a long conversation load, as it is scrolled up. */\n.ta-earlier { display: flex; justify-content: center; padding: 12px 0; }\n.ta-earlier-idle .ta-spinner { visibility: hidden; animation: none; }\n\n/* Model accounts: the sign-in page, the dialog and a sign-in under way */\n.ta-login-card { width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }\n.ta-login-card h1 { margin: 6px 0 0; font-size: calc(20px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-text); }\n.ta-login-card > p { margin: 0 0 6px; color: var(--ta-secondary); font-size: calc(13.5px * var(--ta-font-scale)); line-height: 1.6; }\n.ta-login-card .ta-auth-panel { width: 100%; text-align: left; }\n.ta-login-card .ta-auth-list { max-height: min(46vh, 420px); }\n.ta-login-later { margin-top: 2px; border: 0; background: none; color: var(--ta-muted); font: inherit; font-size: calc(13px * var(--ta-font-scale)); cursor: pointer; }\n.ta-login-later:hover { color: var(--ta-text); }\n.ta-login-card .ta-pic-cards { margin-top: 4px; }\n.ta-auth-dialog { width: min(520px, 100%); gap: 12px; padding: 16px 18px 18px; }\n.ta-auth-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-auth-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }\n.ta-auth-list { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 56vh; }\n.ta-auth-group h3 { margin: 0 0 4px; padding: 0 10px; font-size: calc(12px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-auth-row { display: flex; align-items: center; gap: 4px; }\n.ta-auth-item { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ta-body); font: inherit; font-size: calc(13.5px * var(--ta-font-scale)); text-align: left; cursor: pointer; }\n.ta-auth-item:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-auth-item > .ta-icon:last-child { color: var(--ta-muted); }\n.ta-auth-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-text); }\n.ta-auth-kind { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--ta-raised); color: var(--ta-muted); font-size: calc(11.5px * var(--ta-font-scale)); }\n.ta-auth-note { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }\n.ta-auth-on { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: var(--ta-green); font-size: calc(12px * var(--ta-font-scale)); max-width: 45%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.ta-auth-item .ta-auth-on + .ta-icon { margin-left: 0; }\n.ta-auth-item > .ta-auth-kind + .ta-icon { margin-left: auto; }\n.ta-auth-flow { display: flex; flex-direction: column; gap: 14px; text-align: left; }\n.ta-auth-flow-head { display: flex; align-items: center; gap: 8px; }\n.ta-auth-flow-title { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-text); }\n.ta-auth-step { display: flex; flex-direction: column; gap: 10px; }\n.ta-auth-step p { margin: 0; color: var(--ta-body); font-size: calc(13.5px * var(--ta-font-scale)); line-height: 1.6; }\n.ta-auth-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n.ta-auth-code { align-self: flex-start; padding: 8px 14px; border-radius: 10px; background: var(--ta-raised); color: var(--ta-text); font-family: var(--ta-mono); font-size: calc(20px * var(--ta-font-scale)); letter-spacing: 0.12em; user-select: all; }\n.ta-auth-options { display: flex; flex-direction: column; gap: 2px; }\n.ta-auth-link { display: block; margin-top: 4px; color: var(--ta-link, var(--ta-brand)); word-break: break-all; }\n.ta-auth-step .ta-auth-guide { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-auth-guide .ta-auth-link { display: inline; margin: 0; }\n.ta-auth-more .ta-auth-name { color: var(--ta-muted); }\n.ta-auth-more > .ta-icon:last-child { margin-left: auto; }\n/* The sign-in comes in step by step; its pictures answer the pointer */\n@keyframes ta-rise { from { transform: translateY(10px); opacity: 0; } }\n@keyframes ta-key-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; transform: translateY(-1.5px); } }\n@keyframes ta-tick { from { stroke-dashoffset: 12; } }\n@keyframes ta-code-in { from { letter-spacing: 0.4em; opacity: 0; } }\n.ta-login-card > * { animation: ta-rise 420ms var(--ta-ease) both; }\n.ta-login-card > :nth-child(2) { animation-delay: 60ms; }\n.ta-login-card > :nth-child(3) { animation-delay: 100ms; }\n.ta-login-card > :nth-child(4) { animation-delay: 150ms; }\n.ta-login-card > :nth-child(5) { animation-delay: 220ms; }\n.ta-login-card .ta-pic-card:hover .ta-pic-tick { stroke-dasharray: 12; animation: ta-tick 420ms var(--ta-ease) both; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot { animation: ta-key-dot 900ms ease-in-out infinite; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot:nth-child(n+8) { animation-delay: 90ms; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot:nth-child(n+10) { animation-delay: 180ms; }\n.ta-login-card .ta-pic-card:hover .ta-pic-dot:nth-child(n+12) { animation-delay: 270ms; }\n.ta-auth-flow > *, .ta-auth-panel > *, .ta-auth-group { animation: ta-in 260ms var(--ta-ease) both; }\n.ta-auth-code { animation: ta-code-in 420ms var(--ta-ease) both; }\n.ta-auth-item { transition: background 120ms, color 120ms, transform 120ms var(--ta-ease); }\n.ta-auth-item:hover > .ta-icon:last-child { transform: translateX(2px); transition: transform 160ms var(--ta-ease); }\n/* Ta on a phone: a picture of the way through the relay, the code to scan, the devices */\n@keyframes ta-qr-in { from { transform: scale(.94); opacity: 0; } }\n.ta-relay-dialog { width: min(440px, 100%); gap: 14px; padding: 16px 18px 18px; }\n.ta-relay-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-relay-start, .ta-relay-pairing { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; animation: ta-in 260ms var(--ta-ease) both; }\n.ta-relay-start p, .ta-relay-pairing p { margin: 0; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.6; }\n.ta-relay-pic { width: 100%; max-width: 320px; border-radius: 0; }\n.ta-relay-form { display: flex; gap: 8px; width: 100%; }\n.ta-relay-form .ta-field { flex: 1; }\n.ta-relay-form { justify-content: center; }\n.ta-relay-pairing .ta-relay-download { display: inline-flex; align-items: center; gap: 6px; color: var(--ta-muted); }\n.ta-relay-download a { color: var(--ta-link, var(--ta-brand)); }\n.ta-qr { width: 220px; height: 220px; border-radius: 12px; animation: ta-qr-in 320ms var(--ta-ease) both; }\n.ta-relay-state { margin-left: 8px; font-weight: 400; color: var(--ta-muted); }\n.ta-relay-state::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--ta-muted); vertical-align: middle; }\n.ta-relay-state.ta-on::before { background: var(--ta-green); }\n.ta-relay-device { gap: 10px; height: 38px; padding: 0 4px 0 10px; color: var(--ta-muted); }\n.ta-relay-device .ta-auth-note { flex: none; margin-left: auto; }\n.ta-relay-awake { display: flex; align-items: center; gap: 12px; padding: 0 4px 0 10px; }\n.ta-relay-awake-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }\n.ta-relay-awake-text .ta-auth-note { white-space: normal; line-height: 1.5; }\n/* The account and its devices (account-view.tsx) */\n.ta-account-dialog { width: min(440px, 100%); gap: 14px; padding: 16px 18px 18px; overflow-y: auto; }\n.ta-account-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-account-hint { margin: 0; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.55; }\n.ta-account-ways, .ta-account-signing { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }\n.ta-account-signing p { margin: 0; text-align: center; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-account-waiting { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 2px; text-align: center; }\n.ta-account-waiting strong { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; }\n.ta-account-waiting p { margin: 0; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: 1.55; }\n.ta-account-code { padding: 12px 22px; border-radius: 14px; background: var(--ta-hover); font-family: var(--ta-mono); font-size: calc(30px * var(--ta-font-scale)); font-weight: 600; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; color: var(--ta-text); white-space: nowrap; }\n.ta-account-devices { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }\n.ta-account-device { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 6px 6px 8px; border-radius: 12px; }\n.ta-account-device.ta-waiting { background: var(--ta-hover); }\n.ta-account-device-icon { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ta-hover); color: var(--ta-secondary); }\n.ta-account-device.ta-waiting .ta-account-device-icon { background: var(--ta-card); }\n.ta-account-dot { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ta-muted); box-shadow: 0 0 0 2px var(--ta-card); }\n.ta-account-dot.ta-on { background: var(--ta-green); }\n.ta-account-device-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; font-size: calc(14px * var(--ta-font-scale)); }\n.ta-account-device-detail { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-account-device-actions { flex: none; display: flex; align-items: center; gap: 6px; }\n.ta-account-device-actions .ta-button { height: 30px; padding: 0 12px; }\n.ta-account-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--ta-border-muted); }\n.ta-account-who { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-account-foot .ta-button { height: 30px; padding: 0 12px; }\n.ta-account-sign-in { display: flex; width: 100%; flex-direction: column; gap: 12px; text-align: left; }\n.ta-account-signed { display: flex; width: 100%; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0; text-align: center; }\n.ta-account-signed .ta-account-who { font-size: calc(14px * var(--ta-font-scale)); color: var(--ta-text); }\n.ta-account-others { display: flex; flex-direction: column; gap: 6px; }\n.ta-account-others h2 { margin: 0 4px; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-account-recent-mark { display: grid; place-items: center; background: var(--ta-hover); color: var(--ta-text); }\n.ta-account-ask { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 58; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; width: min(420px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 16px; border: 1px solid var(--ta-border); background: var(--ta-card); box-shadow: var(--ta-shadow-pop); transform: translateX(-50%); animation: ta-fade 160ms ease-out; }\n.ta-account-ask-text { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; }\n.ta-account-ask-text strong { max-width: 100%; font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; }\n.ta-account-ask .ta-account-code { padding: 4px 10px; border-radius: 8px; font-size: calc(20px * var(--ta-font-scale)); }\n.ta-account-ask-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }\n.ta-account-ask-actions .ta-link-button { margin-right: auto; }\n";
|
|
@@ -115,6 +115,10 @@ export const DIALOGS_STYLE = `
|
|
|
115
115
|
.ta-auth-code { align-self: flex-start; padding: 8px 14px; border-radius: 10px; background: var(--ta-raised); color: var(--ta-text); font-family: var(--ta-mono); font-size: calc(20px * var(--ta-font-scale)); letter-spacing: 0.12em; user-select: all; }
|
|
116
116
|
.ta-auth-options { display: flex; flex-direction: column; gap: 2px; }
|
|
117
117
|
.ta-auth-link { display: block; margin-top: 4px; color: var(--ta-link, var(--ta-brand)); word-break: break-all; }
|
|
118
|
+
.ta-auth-step .ta-auth-guide { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
119
|
+
.ta-auth-guide .ta-auth-link { display: inline; margin: 0; }
|
|
120
|
+
.ta-auth-more .ta-auth-name { color: var(--ta-muted); }
|
|
121
|
+
.ta-auth-more > .ta-icon:last-child { margin-left: auto; }
|
|
118
122
|
/* The sign-in comes in step by step; its pictures answer the pointer */
|
|
119
123
|
@keyframes ta-rise { from { transform: translateY(10px); opacity: 0; } }
|
|
120
124
|
@keyframes ta-key-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; transform: translateY(-1.5px); } }
|
|
@@ -143,6 +147,9 @@ export const DIALOGS_STYLE = `
|
|
|
143
147
|
.ta-relay-pic { width: 100%; max-width: 320px; border-radius: 0; }
|
|
144
148
|
.ta-relay-form { display: flex; gap: 8px; width: 100%; }
|
|
145
149
|
.ta-relay-form .ta-field { flex: 1; }
|
|
150
|
+
.ta-relay-form { justify-content: center; }
|
|
151
|
+
.ta-relay-pairing .ta-relay-download { display: inline-flex; align-items: center; gap: 6px; color: var(--ta-muted); }
|
|
152
|
+
.ta-relay-download a { color: var(--ta-link, var(--ta-brand)); }
|
|
146
153
|
.ta-qr { width: 220px; height: 220px; border-radius: 12px; animation: ta-qr-in 320ms var(--ta-ease) both; }
|
|
147
154
|
.ta-relay-state { margin-left: 8px; font-weight: 400; color: var(--ta-muted); }
|
|
148
155
|
.ta-relay-state::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--ta-muted); vertical-align: middle; }
|
|
@@ -20,6 +20,8 @@ export interface ChatDraft {
|
|
|
20
20
|
/** Of this first message and its opening (openId, clientMessageId): sent again, it opens and runs once. */
|
|
21
21
|
id: string;
|
|
22
22
|
failed?: string;
|
|
23
|
+
/** The code of the error it failed with (OutboxMessage.code). */
|
|
24
|
+
code?: string;
|
|
23
25
|
heldAt?: number;
|
|
24
26
|
};
|
|
25
27
|
}
|
|
@@ -78,6 +80,11 @@ export interface TaChat {
|
|
|
78
80
|
resendDraft(): Promise<void>;
|
|
79
81
|
/** Takes back the first message that failed. */
|
|
80
82
|
discardDraft(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Sends again what failed for want of a model (TaErrorCode.NOT_SIGNED_IN), the first message of a new
|
|
85
|
+
* conversation or those of the one shown: the user has just connected one (SIGNED_IN_EVENT).
|
|
86
|
+
*/
|
|
87
|
+
resendSignedOut(): Promise<void>;
|
|
81
88
|
/** Stops the run of the conversation still opening, once it is there. */
|
|
82
89
|
stopDraft(): void;
|
|
83
90
|
/**
|
|
@@ -117,7 +117,7 @@ function DraftView({ draft, menu, aboveComposer, belowComposer }) {
|
|
|
117
117
|
content: [{ type: 'text', text: sending.message }, ...((_a = sending.images) !== null && _a !== void 0 ? _a : [])],
|
|
118
118
|
timestamp: Date.now(),
|
|
119
119
|
};
|
|
120
|
-
return ta_client_1.SessionStore.withSent(ta_client_1.SessionReducer.initial(), [{ id: 'draft', message, failed: sending.failed }]);
|
|
120
|
+
return ta_client_1.SessionStore.withSent(ta_client_1.SessionReducer.initial(), [{ id: 'draft', message, failed: sending.failed, code: sending.code }]);
|
|
121
121
|
}, [sending]);
|
|
122
122
|
const outbox = React.useMemo(() => ({ resend: () => void chat.resendDraft(), discard: () => chat.discardDraft() }), [chat]);
|
|
123
123
|
return (React.createElement("section", { className: "ta-session" },
|
|
@@ -20,6 +20,7 @@ export declare class TaChatImpl extends ChatShown implements TaChat {
|
|
|
20
20
|
protected holdDraft(sending: NonNullable<ChatDraft['sending']>): boolean;
|
|
21
21
|
resendDraft(): Promise<void>;
|
|
22
22
|
discardDraft(): void;
|
|
23
|
+
resendSignedOut(): Promise<void>;
|
|
23
24
|
stopDraft(): void;
|
|
24
25
|
show(session: string | Promise<string>, opening?: ChatOpening): Promise<void>;
|
|
25
26
|
/** A session the caller still opens: its place shows now, under a key no session has. */
|
package/lib/browser/chat/chat.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.TaChatImpl = void 0;
|
|
|
10
10
|
const core_1 = require("@celljs/core");
|
|
11
11
|
const ta_client_1 = require("@celljs/ta-client");
|
|
12
12
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
13
|
+
const notices_1 = require("../notices/notices");
|
|
13
14
|
const state_protocol_1 = require("../state/state-protocol");
|
|
14
15
|
const frame_1 = require("../util/frame");
|
|
15
16
|
const chat_protocol_1 = require("./chat-protocol");
|
|
@@ -36,6 +37,9 @@ let TaChatImpl = class TaChatImpl extends chat_shown_1.ChatShown {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
});
|
|
40
|
+
if (typeof window !== 'undefined') {
|
|
41
|
+
window.addEventListener(notices_1.SIGNED_IN_EVENT, () => void this.resendSignedOut());
|
|
42
|
+
}
|
|
39
43
|
}
|
|
40
44
|
if (this.current.store || this.current.draft) {
|
|
41
45
|
return;
|
|
@@ -151,7 +155,8 @@ let TaChatImpl = class TaChatImpl extends chat_shown_1.ChatShown {
|
|
|
151
155
|
// No conversation: the message stays, marked, to send again; for a lost connection, once it is back.
|
|
152
156
|
const failed = this.current.draft;
|
|
153
157
|
if ((failed === null || failed === void 0 ? void 0 : failed.sending) && !(chat_util_1.ChatUtil.lost(error) && this.holdDraft(failed.sending))) {
|
|
154
|
-
|
|
158
|
+
const code = ta_protocol_1.TaErrorUtil.code(error);
|
|
159
|
+
this.update({ draft: { ...failed, sending: { ...failed.sending, failed: chat_util_1.ChatUtil.message(error), ...(code ? { code } : {}) } } });
|
|
155
160
|
}
|
|
156
161
|
return;
|
|
157
162
|
}
|
|
@@ -191,7 +196,7 @@ let TaChatImpl = class TaChatImpl extends chat_shown_1.ChatShown {
|
|
|
191
196
|
}
|
|
192
197
|
// With its id: one that opened before the failure was told is not opened again.
|
|
193
198
|
this.stopping = false;
|
|
194
|
-
this.update({ draft: { ...draft, sending: { ...draft.sending, failed: undefined, heldAt: undefined } } });
|
|
199
|
+
this.update({ draft: { ...draft, sending: { ...draft.sending, failed: undefined, code: undefined, heldAt: undefined } } });
|
|
195
200
|
return this.openDraft();
|
|
196
201
|
}
|
|
197
202
|
discardDraft() {
|
|
@@ -201,6 +206,13 @@ let TaChatImpl = class TaChatImpl extends chat_shown_1.ChatShown {
|
|
|
201
206
|
this.update({ draft: { ...draft, sending: undefined } });
|
|
202
207
|
}
|
|
203
208
|
}
|
|
209
|
+
async resendSignedOut() {
|
|
210
|
+
var _a, _b, _c;
|
|
211
|
+
if (((_b = (_a = this.current.draft) === null || _a === void 0 ? void 0 : _a.sending) === null || _b === void 0 ? void 0 : _b.code) === ta_protocol_1.TaErrorCode.NOT_SIGNED_IN) {
|
|
212
|
+
await this.resendDraft();
|
|
213
|
+
}
|
|
214
|
+
await ((_c = this.current.store) === null || _c === void 0 ? void 0 : _c.resendFailed(ta_protocol_1.TaErrorCode.NOT_SIGNED_IN));
|
|
215
|
+
}
|
|
204
216
|
stopDraft() {
|
|
205
217
|
var _a;
|
|
206
218
|
if ((_a = this.current.draft) === null || _a === void 0 ? void 0 : _a.sending) {
|
|
@@ -3,7 +3,7 @@ import type { ComposerAction } from '../components/composer-box-protocol';
|
|
|
3
3
|
import type { Translate } from '../i18n/use-t';
|
|
4
4
|
import type { ChatDraft } from './chat-protocol';
|
|
5
5
|
export declare namespace DraftModelUtil {
|
|
6
|
-
/** The model entry of the + of a new conversation: the models with credentials, the picked one checked, else
|
|
6
|
+
/** The model entry of the + of a new conversation: the models with credentials, the picked one checked, else the one it would work with. */
|
|
7
7
|
function action(snapshot: TaSettingsSnapshot, picked: string | undefined, pick: (model: string) => void, t: Translate): ComposerAction;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -39,9 +39,9 @@ const React = __importStar(require("react"));
|
|
|
39
39
|
const model_picker_1 = require("../components/model-picker");
|
|
40
40
|
var DraftModelUtil;
|
|
41
41
|
(function (DraftModelUtil) {
|
|
42
|
-
/** The model entry of the + of a new conversation: the models with credentials, the picked one checked, else
|
|
42
|
+
/** The model entry of the + of a new conversation: the models with credentials, the picked one checked, else the one it would work with. */
|
|
43
43
|
function action(snapshot, picked, pick, t) {
|
|
44
|
-
return model_picker_1.ModelPickerUtil.action(snapshot, picked !== null && picked !== void 0 ? picked : model_picker_1.ModelPickerUtil.
|
|
44
|
+
return model_picker_1.ModelPickerUtil.action(snapshot, picked !== null && picked !== void 0 ? picked : model_picker_1.ModelPickerUtil.initialModel(snapshot), pick, t);
|
|
45
45
|
}
|
|
46
46
|
DraftModelUtil.action = action;
|
|
47
47
|
})(DraftModelUtil || (exports.DraftModelUtil = DraftModelUtil = {}));
|
|
@@ -43,6 +43,8 @@ export declare function useAccount(): {
|
|
|
43
43
|
name: string;
|
|
44
44
|
account: string | undefined;
|
|
45
45
|
service: string;
|
|
46
|
+
/** What the line of the connection calls the computer Ta runs on: this one, or another. */
|
|
47
|
+
computer: string;
|
|
46
48
|
};
|
|
47
49
|
export interface AccountMenuProps {
|
|
48
50
|
/** Shows the settings view, at a section. */
|
|
@@ -42,6 +42,7 @@ const lucide_react_1 = require("lucide-react");
|
|
|
42
42
|
const React = __importStar(require("react"));
|
|
43
43
|
const account_side_1 = require("../account/account-side");
|
|
44
44
|
const device_account_1 = require("../account/device-account");
|
|
45
|
+
const app_update_1 = require("../device/app-update");
|
|
45
46
|
const device_1 = require("../device/device");
|
|
46
47
|
const web_extension_protocol_1 = require("../extension/web-extension-protocol");
|
|
47
48
|
const hooks_1 = require("../hooks");
|
|
@@ -70,6 +71,7 @@ function useAccountEntries(onSettings, onDialog) {
|
|
|
70
71
|
// A finger has no keys to learn; a phone is not the computer that pairs phones.
|
|
71
72
|
const { touch, handheld } = (0, device_1.useDevice)();
|
|
72
73
|
const restartTa = (0, serve_restart_1.useRestartTa)();
|
|
74
|
+
const appUpdate = (0, app_update_1.useAppUpdate)();
|
|
73
75
|
// The vault, while its package is on: the one place for the sign-ins, keys and personal details of the account.
|
|
74
76
|
const vault = (0, secret_peek_1.useSecretPeek)().manage;
|
|
75
77
|
const [, notices] = (0, hooks_1.useNotices)();
|
|
@@ -120,6 +122,9 @@ function useAccountEntries(onSettings, onDialog) {
|
|
|
120
122
|
if (update) {
|
|
121
123
|
entry('restart', t('ta.update.restartTo', { version: serve_restart_1.ServeRestartUtil.label(update) }), lucide_react_1.RotateCw, () => void restartTa.restart(), { action: true });
|
|
122
124
|
}
|
|
125
|
+
if (appUpdate) {
|
|
126
|
+
entry('appUpdate', t('ta.appUpdate.installTo', { version: appUpdate.version }), lucide_react_1.Download, () => app_update_1.AppUpdate.install(), { action: true });
|
|
127
|
+
}
|
|
123
128
|
entry('install', t('ta.pwa.install'), lucide_react_1.Download, () => void pwa.install(), { action: true });
|
|
124
129
|
// As WeChat's: the account in use kept, with its computers, to come back to in one tap (docs/design/ta-me.md 4).
|
|
125
130
|
entry('signIn', t('ta.me.signIn'), lucide_react_1.LogIn, () => onDialog('signIn'));
|
|
@@ -129,11 +134,13 @@ function useAccountEntries(onSettings, onDialog) {
|
|
|
129
134
|
vault: Boolean(vault),
|
|
130
135
|
own: own.map(view => view.id),
|
|
131
136
|
update: Boolean(update),
|
|
137
|
+
appUpdate: Boolean(appUpdate),
|
|
132
138
|
installable: installable && !standalone,
|
|
133
139
|
switchAccount: app && signedIn,
|
|
134
140
|
// The account is who the user is, not one of their devices (docs/design/ta-me.md 4).
|
|
135
141
|
signIn: Boolean(info) && !signedIn,
|
|
136
142
|
pairPhone: !app && !handheld,
|
|
143
|
+
signOut: signedIn || workbench_util_1.WorkbenchUtil.elsewhere(host),
|
|
137
144
|
}).map(group => group.map(key => entries[key]));
|
|
138
145
|
}
|
|
139
146
|
/** What the entries of the account open over the page. */
|
|
@@ -194,6 +201,8 @@ function useAccount() {
|
|
|
194
201
|
name: (_c = name !== null && name !== void 0 ? name : server === null || server === void 0 ? void 0 : server.user) !== null && _c !== void 0 ? _c : t('ta.account'),
|
|
195
202
|
account: account !== null && account !== void 0 ? account : undefined,
|
|
196
203
|
service: server && online ? `${state} · v${server.version}` : state,
|
|
204
|
+
/** What the line of the connection calls the computer Ta runs on: this one, or another. */
|
|
205
|
+
computer: t(workbench_util_1.WorkbenchUtil.elsewhere(host) ? 'ta.account.service' : 'ta.account.thisComputer'),
|
|
197
206
|
};
|
|
198
207
|
}
|
|
199
208
|
/** Moves the focus through the items of a menu with the arrow keys. */
|
|
@@ -247,7 +256,7 @@ function AccountMenu({ onSettings, active }) {
|
|
|
247
256
|
((_a = account.account) !== null && _a !== void 0 ? _a : account.machine) && React.createElement("span", { className: "ta-account-sub ta-ellipsis" }, (_b = account.account) !== null && _b !== void 0 ? _b : account.machine))),
|
|
248
257
|
React.createElement("div", { className: "ta-account-service", title: account.server ? `Ta v${account.server.version}` : undefined },
|
|
249
258
|
React.createElement("span", { className: `ta-account-state ${account.online ? 'ta-ok' : 'ta-warn'}` }),
|
|
250
|
-
React.createElement("span", { className: "ta-account-service-name" },
|
|
259
|
+
React.createElement("span", { className: "ta-account-service-name" }, account.computer),
|
|
251
260
|
React.createElement("span", { className: "ta-account-service-state" }, account.service)),
|
|
252
261
|
groups
|
|
253
262
|
.filter(group => group.length > 0)
|
|
@@ -70,10 +70,13 @@ function useNavigation(views) {
|
|
|
70
70
|
const onOpen = React.useMemo(() => pages.filter(page => page.onOpen && page.place === 'discover'), [pages]);
|
|
71
71
|
// The pages a page lists (a game, on the Games page) are there, not in the navigation or under Discover.
|
|
72
72
|
const listed = React.useMemo(() => new Set(pages.filter(page => page.place === 'list').map(page => page.id)), [pages]);
|
|
73
|
+
const infos = React.useMemo(() => new Map(pages.map(page => [page.id, page])), [pages]);
|
|
73
74
|
return {
|
|
74
75
|
...(0, nav_places_1.places)(views.filter(view => !listed.has(view.id)), setting, handheld, onOpen.length > 0),
|
|
75
76
|
onOpen,
|
|
76
77
|
setting,
|
|
78
|
+
...(settings.allFeatures ? {} : { first: (id) => (0, nav_places_1.discoverFirst)(infos.get(id), Date.now()) }),
|
|
79
|
+
showAll: on => store.update({ allFeatures: on }),
|
|
77
80
|
pin: id => update(navigation_1.NavigationUtil.pin(setting, id)),
|
|
78
81
|
fold: id => update(navigation_1.NavigationUtil.fold(setting, id)),
|
|
79
82
|
update,
|
|
@@ -0,0 +1,73 @@
|
|
|
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.AppUpdateNotices = AppUpdateNotices;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const app_update_1 = require("../device/app-update");
|
|
39
|
+
const hooks_1 = require("../hooks");
|
|
40
|
+
const use_t_1 = require("../i18n/use-t");
|
|
41
|
+
const workbench_util_1 = require("../workbench-util");
|
|
42
|
+
/** The version of the phone app the user put off installing (Later): not told of again on this device. */
|
|
43
|
+
const LATER_KEY = 'ta.appUpdate.later';
|
|
44
|
+
/** Tells once of each newer version of the phone app that does not update itself (AppUpdates), with Update and Later. */
|
|
45
|
+
function AppUpdateNotices() {
|
|
46
|
+
const t = (0, use_t_1.useT)();
|
|
47
|
+
const [, notices] = (0, hooks_1.useNotices)();
|
|
48
|
+
const offer = (0, app_update_1.useAppUpdate)();
|
|
49
|
+
const told = React.useRef(undefined);
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
var _a;
|
|
52
|
+
if (told.current && told.current.version !== (offer === null || offer === void 0 ? void 0 : offer.version)) {
|
|
53
|
+
notices.dismiss(told.current.id);
|
|
54
|
+
told.current = undefined;
|
|
55
|
+
}
|
|
56
|
+
if (!offer || told.current || ((_a = (0, workbench_util_1.storage)()) === null || _a === void 0 ? void 0 : _a.getItem(LATER_KEY)) === offer.version) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const { version } = offer;
|
|
60
|
+
told.current = {
|
|
61
|
+
version,
|
|
62
|
+
id: notices.notify(t('ta.appUpdate.available', { version }), {
|
|
63
|
+
detail: t('ta.appUpdate.detail'),
|
|
64
|
+
key: 'ta-app-update',
|
|
65
|
+
sticky: true,
|
|
66
|
+
actions: [{ label: t('ta.update.later'), run: () => { var _a; return (_a = (0, workbench_util_1.storage)()) === null || _a === void 0 ? void 0 : _a.setItem(LATER_KEY, version); } }],
|
|
67
|
+
action: { label: t('ta.appUpdate.update'), run: () => app_update_1.AppUpdate.install() },
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
}, [offer, notices, t]);
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=app-update-view.js.map
|
|
@@ -45,6 +45,7 @@ const app_contexts_1 = require("./app-contexts");
|
|
|
45
45
|
const app_nav_1 = require("./app-nav");
|
|
46
46
|
const app_shell_hooks_1 = require("./app-shell-hooks");
|
|
47
47
|
const app_shell_state_1 = require("./app-shell-state");
|
|
48
|
+
const app_update_view_1 = require("./app-update-view");
|
|
48
49
|
const auth_view_1 = require("./auth-view");
|
|
49
50
|
const board_1 = require("./board");
|
|
50
51
|
const chat_asks_1 = require("./chat-asks");
|
|
@@ -57,6 +58,7 @@ const discover_view_1 = require("./discover-view");
|
|
|
57
58
|
const editor_area_1 = require("./editor-area");
|
|
58
59
|
const entry_holds_1 = require("./entry-holds");
|
|
59
60
|
const environment_view_1 = require("./environment-view");
|
|
61
|
+
const first_steps_1 = require("./first-steps");
|
|
60
62
|
const host_view_1 = require("./host-view");
|
|
61
63
|
const icon_1 = require("./icon");
|
|
62
64
|
const kept_call_bar_1 = require("./kept-call-bar");
|
|
@@ -102,12 +104,27 @@ function AppShell() {
|
|
|
102
104
|
window.addEventListener(notices_1.SIGN_IN_EVENT, ask);
|
|
103
105
|
return () => window.removeEventListener(notices_1.SIGN_IN_EVENT, ask);
|
|
104
106
|
}, [reloadProviders]);
|
|
107
|
+
// Models now where there were none (a key, an account, an agent installed meanwhile): the page of sign-in is done
|
|
108
|
+
// with, and what failed for want of one goes (TaChat.resendSignedOut).
|
|
109
|
+
const signedIn = providers && auth_view_1.AuthUtil.signedIn(providers);
|
|
110
|
+
const hadModels = React.useRef(undefined);
|
|
111
|
+
React.useEffect(() => {
|
|
112
|
+
if (signedIn === undefined) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (signedIn && hadModels.current === false) {
|
|
116
|
+
setAsked(false);
|
|
117
|
+
window.dispatchEvent(new Event(notices_1.SIGNED_IN_EVENT));
|
|
118
|
+
}
|
|
119
|
+
hadModels.current = signedIn;
|
|
120
|
+
}, [signedIn]);
|
|
105
121
|
const doubleId = side_lists_1.DOUBLE_PAGE;
|
|
106
122
|
// Where Ta's agents read the page to be, and go (docs/design/ta-app-use.md 3): set below as it renders.
|
|
107
123
|
const screenShell = (0, screen_navigator_1.useScreenNavigator)();
|
|
108
124
|
const inCall = (0, entry_holds_1.useCallGoingOn)();
|
|
109
125
|
// The chats' tab, and the double's on the rail, have the amber dot while a row of the double's list has one, as a
|
|
110
126
|
// messenger's; what waits for the user to decide is counted there until answered.
|
|
127
|
+
(0, first_steps_1.useFirstSteps)(workbench.status === 'online', workbench.sessions, workbench.saved);
|
|
111
128
|
const { listed: listedChats, unseen: chatsUnseen } = (0, chats_dot_1.useChatsDot)({
|
|
112
129
|
sessions: workbench.sessions,
|
|
113
130
|
saved: workbench.saved,
|
|
@@ -133,6 +150,8 @@ function AppShell() {
|
|
|
133
150
|
}, onSignedIn: () => {
|
|
134
151
|
setAsked(false);
|
|
135
152
|
reloadProviders();
|
|
153
|
+
// What failed for want of a model goes now (TaChat.resendSignedOut).
|
|
154
|
+
window.dispatchEvent(new Event(notices_1.SIGNED_IN_EVENT));
|
|
136
155
|
}, onProviders: reloadProviders }));
|
|
137
156
|
}
|
|
138
157
|
// What the columns beside the conversation and the editors take, so that the editors never take more than the conversation.
|
|
@@ -188,6 +207,7 @@ function AppShell() {
|
|
|
188
207
|
React.createElement(link_dialog_1.LinkDialog, null),
|
|
189
208
|
React.createElement(remote_prompts_1.RemotePrompts, null),
|
|
190
209
|
React.createElement(serve_restart_1.ServeRestartNotices, null),
|
|
210
|
+
React.createElement(app_update_view_1.AppUpdateNotices, null),
|
|
191
211
|
React.createElement(host_view_1.DeviceOverlays, null),
|
|
192
212
|
codeScan && React.createElement(scan_screen_1.ScanHost, { onCode: text => void codeScan.open(text), onAsk: askDouble }),
|
|
193
213
|
React.createElement(share_dialog_1.ShareHost, null),
|
|
@@ -232,7 +252,7 @@ function AppShell() {
|
|
|
232
252
|
showPage(id);
|
|
233
253
|
}
|
|
234
254
|
};
|
|
235
|
-
const discoverView = (leading) => (React.createElement(discover_view_1.DiscoverView, { pages: navigation.discover, onOpenPages: navigation.onOpen, onOpen: openDiscovered, onPin: pinDiscovered, onSettings: () => openSettings('navigation'), onScan: codeScan && (() => void codeScan.scan()), leading: leading }));
|
|
255
|
+
const discoverView = (leading) => (React.createElement(discover_view_1.DiscoverView, { pages: navigation.discover, onOpenPages: navigation.onOpen, onOpen: openDiscovered, onPin: pinDiscovered, onSettings: () => openSettings('navigation'), onScan: codeScan && (() => void codeScan.scan()), leading: leading, first: navigation.first, onAllFeatures: navigation.showAll }));
|
|
236
256
|
const keptPages = entry_holds_1.EntryHoldUtil.kept(extensions.kept, inCall, tabView);
|
|
237
257
|
const holds = entry_holds_1.EntryHoldUtil.holds({
|
|
238
258
|
double: () => {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TaAuthProvider } from '@celljs/ta-protocol';
|
|
2
|
+
/** Where a newcomer gets a key of a provider of models, and what it costs: the pages of the provider. */
|
|
3
|
+
export interface AuthGuide {
|
|
4
|
+
/** The page that makes keys. */
|
|
5
|
+
keys: string;
|
|
6
|
+
/** The prices, paid by use. */
|
|
7
|
+
pricing: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Which providers of keys the page of models puts first, by the language of the page, and how to get their keys
|
|
11
|
+
* (docs/design/ta-simple.md 5, 3 and 8): one a newcomer can pay for and reach from where that language is spoken.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace AuthGuideUtil {
|
|
14
|
+
function guide(providerId: string): AuthGuide | undefined;
|
|
15
|
+
/** The ids of the providers of keys put first for `language` (a locale, `zh-CN`). */
|
|
16
|
+
function recommended(language: string): string[];
|
|
17
|
+
/**
|
|
18
|
+
* The providers of keys as the page lists them before a search: those recommended for `language`, in their order,
|
|
19
|
+
* and those the user added or signed in to, first; the others under "more".
|
|
20
|
+
*/
|
|
21
|
+
function split(keys: TaAuthProvider[], language: string): {
|
|
22
|
+
first: TaAuthProvider[];
|
|
23
|
+
more: TaAuthProvider[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=auth-guide.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthGuideUtil = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Which providers of keys the page of models puts first, by the language of the page, and how to get their keys
|
|
6
|
+
* (docs/design/ta-simple.md 5, 3 and 8): one a newcomer can pay for and reach from where that language is spoken.
|
|
7
|
+
*/
|
|
8
|
+
var AuthGuideUtil;
|
|
9
|
+
(function (AuthGuideUtil) {
|
|
10
|
+
const GUIDES = {
|
|
11
|
+
deepseek: { keys: 'https://platform.deepseek.com/api_keys', pricing: 'https://api-docs.deepseek.com/quick_start/pricing' },
|
|
12
|
+
'moonshotai-cn': { keys: 'https://platform.kimi.com/console/api-keys', pricing: 'https://platform.kimi.com/docs/pricing/chat' },
|
|
13
|
+
openai: { keys: 'https://platform.openai.com/api-keys', pricing: 'https://openai.com/api/pricing/' },
|
|
14
|
+
anthropic: { keys: 'https://platform.claude.com/settings/keys', pricing: 'https://claude.com/pricing' },
|
|
15
|
+
google: { keys: 'https://aistudio.google.com/apikey', pricing: 'https://ai.google.dev/gemini-api/docs/pricing' },
|
|
16
|
+
};
|
|
17
|
+
/** By the first part of the language (`zh`), or the whole of it (`zh-TW`); English for the others. */
|
|
18
|
+
const RECOMMENDED = {
|
|
19
|
+
zh: ['deepseek', 'moonshotai-cn'],
|
|
20
|
+
'zh-TW': ['deepseek', 'openai', 'google'],
|
|
21
|
+
en: ['openai', 'anthropic', 'google'],
|
|
22
|
+
ja: ['openai', 'anthropic', 'google'],
|
|
23
|
+
};
|
|
24
|
+
function guide(providerId) {
|
|
25
|
+
return GUIDES[providerId];
|
|
26
|
+
}
|
|
27
|
+
AuthGuideUtil.guide = guide;
|
|
28
|
+
/** The ids of the providers of keys put first for `language` (a locale, `zh-CN`). */
|
|
29
|
+
function recommended(language) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
return (_b = (_a = RECOMMENDED[language]) !== null && _a !== void 0 ? _a : RECOMMENDED[language.split('-')[0]]) !== null && _b !== void 0 ? _b : RECOMMENDED.en;
|
|
32
|
+
}
|
|
33
|
+
AuthGuideUtil.recommended = recommended;
|
|
34
|
+
/**
|
|
35
|
+
* The providers of keys as the page lists them before a search: those recommended for `language`, in their order,
|
|
36
|
+
* and those the user added or signed in to, first; the others under "more".
|
|
37
|
+
*/
|
|
38
|
+
function split(keys, language) {
|
|
39
|
+
const ids = recommended(language);
|
|
40
|
+
const own = (provider) => !!provider.custom || !!provider.configured;
|
|
41
|
+
const picked = ids.map(id => keys.find(provider => provider.id === id && !own(provider))).filter((one) => !!one);
|
|
42
|
+
const first = [...keys.filter(own), ...picked];
|
|
43
|
+
return { first, more: keys.filter(provider => !first.includes(provider)) };
|
|
44
|
+
}
|
|
45
|
+
AuthGuideUtil.split = split;
|
|
46
|
+
})(AuthGuideUtil || (exports.AuthGuideUtil = AuthGuideUtil = {}));
|
|
47
|
+
//# sourceMappingURL=auth-guide.js.map
|
|
@@ -33,6 +33,8 @@ export declare namespace AuthUtil {
|
|
|
33
33
|
};
|
|
34
34
|
result?: 'done' | 'failed' | 'cancelled';
|
|
35
35
|
error?: string;
|
|
36
|
+
/** The service refused the key typed in, which was not kept: another one is to be typed. */
|
|
37
|
+
refused?: boolean;
|
|
36
38
|
}
|
|
37
39
|
function reduce(state: FlowState, event: TaAuthEvent): FlowState;
|
|
38
40
|
}
|