@celljs/ta-web 4.47.0 → 4.48.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/assistant/assistant-role.d.ts +1 -1
- package/esm/browser/assistant/assistant-role.js +1 -1
- package/esm/browser/assistant/assistant-task-source.js +6 -1
- package/esm/browser/assistant/assistant-task-util.d.ts +1 -0
- package/esm/browser/assistant/assistant-task-util.js +9 -3
- package/esm/browser/assistant/assistant-view.js +5 -2
- package/esm/browser/chat/chat-view.js +2 -1
- package/esm/browser/cloud/cloud-sign-in.d.ts +26 -4
- package/esm/browser/cloud/cloud-sign-in.js +88 -18
- package/esm/browser/components/app-nav.d.ts +3 -1
- package/esm/browser/components/app-nav.js +3 -3
- package/esm/browser/components/app-shell-state.js +11 -0
- package/esm/browser/components/app-view.js +16 -6
- package/esm/browser/components/asks-badge.d.ts +12 -0
- package/esm/browser/components/asks-badge.js +17 -1
- package/esm/browser/components/chat-list-row.d.ts +4 -1
- package/esm/browser/components/chat-list-row.js +7 -1
- package/esm/browser/components/chats-dot.d.ts +4 -1
- package/esm/browser/components/chats-dot.js +6 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +2 -1
- package/esm/browser/components/cloud-sign-in-view.js +28 -5
- package/esm/browser/components/composer-box-protocol.d.ts +5 -3
- package/esm/browser/components/composer-box.js +11 -11
- package/esm/browser/components/composer.d.ts +8 -1
- package/esm/browser/components/composer.js +57 -34
- package/esm/browser/components/discover-view.js +1 -1
- package/esm/browser/components/first-steps-util.d.ts +30 -0
- package/esm/browser/components/first-steps-util.js +36 -3
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/lightbox.d.ts +15 -1
- package/esm/browser/components/lightbox.js +14 -2
- package/esm/browser/components/link.js +8 -3
- package/esm/browser/components/list-rows.d.ts +1 -1
- package/esm/browser/components/list-rows.js +1 -1
- package/esm/browser/components/markdown.d.ts +4 -2
- package/esm/browser/components/markdown.js +13 -4
- package/esm/browser/components/media.d.ts +6 -0
- package/esm/browser/components/media.js +9 -1
- package/esm/browser/components/message-images.d.ts +5 -0
- package/esm/browser/components/message-images.js +40 -4
- package/esm/browser/components/message-user.js +4 -2
- package/esm/browser/components/partner-row.js +4 -4
- package/esm/browser/components/phone-hint.d.ts +6 -0
- package/esm/browser/components/phone-hint.js +63 -0
- package/esm/browser/components/phone-shell.d.ts +2 -0
- package/esm/browser/components/phone-shell.js +2 -2
- package/esm/browser/components/sending.d.ts +19 -0
- package/esm/browser/components/sending.js +27 -0
- package/esm/browser/components/session-view.js +5 -3
- package/esm/browser/components/settings-choices.js +1 -0
- package/esm/browser/components/settings-parts.js +28 -17
- package/esm/browser/components/share-dialog.js +3 -2
- package/esm/browser/components/share-item-sheet.js +1 -1
- package/esm/browser/components/share-sheet.d.ts +4 -2
- package/esm/browser/components/share-sheet.js +16 -2
- package/esm/browser/components/sign-in-accounts.js +7 -1
- package/esm/browser/components/unseen-drop.d.ts +2 -2
- package/esm/browser/components/unseen-drop.js +1 -1
- package/esm/browser/device/app-badge.d.ts +8 -0
- package/esm/browser/device/app-badge.js +28 -0
- package/esm/browser/device/code-scan.js +1 -1
- package/esm/browser/extension/web-api-code.d.ts +26 -0
- package/esm/browser/extension/web-api-components.d.ts +31 -0
- package/esm/browser/extension/web-api-menus.d.ts +15 -0
- package/esm/browser/extension/web-api-messages.d.ts +15 -0
- package/esm/browser/extension/web-api-messages.js +2 -0
- package/esm/browser/extension/web-api-partners.d.ts +16 -0
- package/esm/browser/extension/web-api-spec.js +1 -0
- package/esm/browser/extension/web-extension-api.d.ts +7 -13
- package/esm/browser/extension/web-extension-context.js +2 -0
- package/esm/browser/extension/web-session-notices.js +11 -2
- package/esm/browser/extension/web-share-ui.js +1 -0
- package/esm/browser/extension/web-share.js +3 -3
- package/esm/browser/extension/web-sharing.js +1 -1
- package/esm/browser/i18n/en/assistant.d.ts +2 -0
- package/esm/browser/i18n/en/assistant.js +2 -0
- package/esm/browser/i18n/en/chat.d.ts +11 -0
- package/esm/browser/i18n/en/chat.js +13 -2
- package/esm/browser/i18n/en/common.d.ts +4 -0
- package/esm/browser/i18n/en/common.js +4 -0
- package/esm/browser/i18n/en/service.d.ts +7 -0
- package/esm/browser/i18n/en/service.js +7 -0
- package/esm/browser/i18n/en/settings.d.ts +6 -0
- package/esm/browser/i18n/en/settings.js +8 -2
- package/esm/browser/i18n/ja/assistant.js +2 -0
- package/esm/browser/i18n/ja/chat.js +13 -2
- package/esm/browser/i18n/ja/common.js +4 -0
- package/esm/browser/i18n/ja/service.js +7 -0
- package/esm/browser/i18n/ja/settings.js +10 -4
- package/esm/browser/i18n/locales.d.ts +31 -1
- package/esm/browser/i18n/messages.d.ts +30 -0
- package/esm/browser/i18n/zh/assistant.js +2 -0
- package/esm/browser/i18n/zh/chat.js +13 -2
- package/esm/browser/i18n/zh/common.js +4 -0
- package/esm/browser/i18n/zh/service.js +7 -0
- package/esm/browser/i18n/zh/settings.js +8 -2
- package/esm/browser/i18n/zh-tw/assistant.js +2 -0
- package/esm/browser/i18n/zh-tw/chat.js +13 -2
- package/esm/browser/i18n/zh-tw/common.js +4 -0
- package/esm/browser/i18n/zh-tw/service.js +7 -0
- package/esm/browser/i18n/zh-tw/settings.js +8 -2
- package/esm/browser/links/links.js +1 -1
- package/esm/browser/notices/session-notices.d.ts +4 -4
- package/esm/browser/notices/session-notices.js +3 -6
- package/esm/browser/partners/partners-util.d.ts +6 -0
- package/esm/browser/partners/partners-util.js +22 -0
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/settings/agent-settings.d.ts +2 -0
- package/esm/browser/settings/agent-settings.js +2 -0
- package/esm/browser/settings/settings-protocol.d.ts +8 -0
- package/esm/browser/settings/settings-protocol.js +5 -0
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +3 -0
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +8 -3
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +10 -1
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +18 -0
- package/esm/browser/style/phone.d.ts +1 -1
- package/esm/browser/style/phone.js +2 -0
- package/esm/browser/style/skins.d.ts +1 -1
- package/esm/browser/style/skins.js +1 -1
- package/esm/browser/util/composer.d.ts +18 -3
- package/esm/browser/util/composer.js +31 -5
- package/esm/browser/util/desktop.d.ts +8 -1
- package/esm/browser/util/desktop.js +10 -0
- package/esm/browser/util/image-shrink.d.ts +5 -1
- package/esm/browser/util/image-shrink.js +1 -1
- package/esm/browser/util/markdown.d.ts +3 -5
- package/esm/browser/util/markdown.js +5 -29
- package/esm/browser/util/process.js +2 -2
- package/lib/browser/assistant/assistant-role.d.ts +1 -1
- package/lib/browser/assistant/assistant-role.js +1 -1
- package/lib/browser/assistant/assistant-task-source.js +5 -0
- package/lib/browser/assistant/assistant-task-util.d.ts +1 -0
- package/lib/browser/assistant/assistant-task-util.js +8 -2
- package/lib/browser/assistant/assistant-view.js +5 -2
- package/lib/browser/chat/chat-view.js +2 -1
- package/lib/browser/cloud/cloud-sign-in.d.ts +26 -4
- package/lib/browser/cloud/cloud-sign-in.js +89 -19
- package/lib/browser/components/app-nav.d.ts +3 -1
- package/lib/browser/components/app-nav.js +2 -2
- package/lib/browser/components/app-shell-state.js +11 -0
- package/lib/browser/components/app-view.js +16 -6
- package/lib/browser/components/asks-badge.d.ts +12 -0
- package/lib/browser/components/asks-badge.js +19 -1
- package/lib/browser/components/chat-list-row.d.ts +4 -1
- package/lib/browser/components/chat-list-row.js +7 -1
- package/lib/browser/components/chats-dot.d.ts +4 -1
- package/lib/browser/components/chats-dot.js +6 -2
- package/lib/browser/components/cloud-sign-in-view.d.ts +2 -1
- package/lib/browser/components/cloud-sign-in-view.js +28 -5
- package/lib/browser/components/composer-box-protocol.d.ts +5 -3
- package/lib/browser/components/composer-box.js +11 -11
- package/lib/browser/components/composer.d.ts +8 -1
- package/lib/browser/components/composer.js +56 -33
- package/lib/browser/components/discover-view.js +1 -1
- package/lib/browser/components/first-steps-util.d.ts +30 -0
- package/lib/browser/components/first-steps-util.js +37 -4
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/lightbox.d.ts +15 -1
- package/lib/browser/components/lightbox.js +15 -2
- package/lib/browser/components/link.js +8 -3
- package/lib/browser/components/list-rows.d.ts +1 -1
- package/lib/browser/components/list-rows.js +1 -1
- package/lib/browser/components/markdown.d.ts +4 -2
- package/lib/browser/components/markdown.js +11 -2
- package/lib/browser/components/media.d.ts +6 -0
- package/lib/browser/components/media.js +10 -2
- package/lib/browser/components/message-images.d.ts +5 -0
- package/lib/browser/components/message-images.js +40 -4
- package/lib/browser/components/message-user.js +4 -2
- package/lib/browser/components/partner-row.js +4 -4
- package/lib/browser/components/phone-hint.d.ts +7 -0
- package/lib/browser/components/phone-hint.js +99 -0
- package/lib/browser/components/phone-shell.d.ts +2 -0
- package/lib/browser/components/phone-shell.js +1 -1
- package/lib/browser/components/sending.d.ts +20 -0
- package/lib/browser/components/sending.js +63 -0
- package/lib/browser/components/session-view.js +5 -3
- package/lib/browser/components/settings-choices.js +1 -0
- package/lib/browser/components/settings-parts.js +26 -15
- package/lib/browser/components/share-dialog.js +3 -2
- package/lib/browser/components/share-item-sheet.js +1 -1
- package/lib/browser/components/share-sheet.d.ts +4 -2
- package/lib/browser/components/share-sheet.js +16 -2
- package/lib/browser/components/sign-in-accounts.js +7 -1
- package/lib/browser/components/unseen-drop.d.ts +2 -2
- package/lib/browser/components/unseen-drop.js +1 -1
- package/lib/browser/device/app-badge.d.ts +9 -0
- package/lib/browser/device/app-badge.js +31 -0
- package/lib/browser/device/code-scan.js +1 -1
- package/lib/browser/extension/web-api-code.d.ts +26 -0
- package/lib/browser/extension/web-api-components.d.ts +31 -0
- package/lib/browser/extension/web-api-menus.d.ts +15 -0
- package/lib/browser/extension/web-api-messages.d.ts +16 -0
- package/lib/browser/extension/web-api-messages.js +3 -0
- package/lib/browser/extension/web-api-partners.d.ts +16 -0
- package/lib/browser/extension/web-api-spec.js +1 -0
- package/lib/browser/extension/web-extension-api.d.ts +7 -13
- package/lib/browser/extension/web-extension-context.js +2 -0
- package/lib/browser/extension/web-session-notices.js +10 -1
- package/lib/browser/extension/web-share-ui.js +1 -0
- package/lib/browser/extension/web-share.js +3 -3
- package/lib/browser/extension/web-sharing.js +1 -1
- package/lib/browser/i18n/en/assistant.d.ts +2 -0
- package/lib/browser/i18n/en/assistant.js +2 -0
- package/lib/browser/i18n/en/chat.d.ts +11 -0
- package/lib/browser/i18n/en/chat.js +13 -2
- package/lib/browser/i18n/en/common.d.ts +4 -0
- package/lib/browser/i18n/en/common.js +4 -0
- package/lib/browser/i18n/en/service.d.ts +7 -0
- package/lib/browser/i18n/en/service.js +7 -0
- package/lib/browser/i18n/en/settings.d.ts +6 -0
- package/lib/browser/i18n/en/settings.js +8 -2
- package/lib/browser/i18n/ja/assistant.js +2 -0
- package/lib/browser/i18n/ja/chat.js +13 -2
- package/lib/browser/i18n/ja/common.js +4 -0
- package/lib/browser/i18n/ja/service.js +7 -0
- package/lib/browser/i18n/ja/settings.js +10 -4
- package/lib/browser/i18n/locales.d.ts +31 -1
- package/lib/browser/i18n/messages.d.ts +30 -0
- package/lib/browser/i18n/zh/assistant.js +2 -0
- package/lib/browser/i18n/zh/chat.js +13 -2
- package/lib/browser/i18n/zh/common.js +4 -0
- package/lib/browser/i18n/zh/service.js +7 -0
- package/lib/browser/i18n/zh/settings.js +8 -2
- package/lib/browser/i18n/zh-tw/assistant.js +2 -0
- package/lib/browser/i18n/zh-tw/chat.js +13 -2
- package/lib/browser/i18n/zh-tw/common.js +4 -0
- package/lib/browser/i18n/zh-tw/service.js +7 -0
- package/lib/browser/i18n/zh-tw/settings.js +8 -2
- package/lib/browser/links/links.js +1 -1
- package/lib/browser/notices/session-notices.d.ts +4 -4
- package/lib/browser/notices/session-notices.js +3 -6
- package/lib/browser/partners/partners-util.d.ts +6 -0
- package/lib/browser/partners/partners-util.js +22 -0
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/settings/agent-settings.d.ts +2 -0
- package/lib/browser/settings/agent-settings.js +3 -1
- package/lib/browser/settings/settings-protocol.d.ts +8 -0
- package/lib/browser/settings/settings-protocol.js +6 -1
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +3 -0
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +8 -3
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +10 -1
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +18 -0
- package/lib/browser/style/phone.d.ts +1 -1
- package/lib/browser/style/phone.js +2 -0
- package/lib/browser/style/skins.d.ts +1 -1
- package/lib/browser/style/skins.js +1 -1
- package/lib/browser/util/composer.d.ts +18 -3
- package/lib/browser/util/composer.js +31 -5
- package/lib/browser/util/desktop.d.ts +8 -1
- package/lib/browser/util/desktop.js +10 -0
- package/lib/browser/util/image-shrink.d.ts +5 -1
- package/lib/browser/util/image-shrink.js +1 -1
- package/lib/browser/util/markdown.d.ts +3 -5
- package/lib/browser/util/markdown.js +5 -29
- package/lib/browser/util/process.js +1 -1
- package/package.json +7 -7
- package/esm/browser/util/share-link.d.ts +0 -21
- package/esm/browser/util/share-link.js +0 -61
- package/lib/browser/util/share-link.d.ts +0 -22
- package/lib/browser/util/share-link.js +0 -64
|
@@ -5,9 +5,10 @@ import { useDevice } from '../device/device.js';
|
|
|
5
5
|
import { WebLabelUtil } from '../extension/web-extension-protocol.js';
|
|
6
6
|
import { useSettings, useSettingsServer, useWebExtensions, useWorkbench } from '../hooks.js';
|
|
7
7
|
import { useT } from '../i18n/use-t.js';
|
|
8
|
-
import { AGENT_SETTINGS_GROUPS, AgentSettingsUtil } from '../settings/agent-settings.js';
|
|
9
|
-
import { CHAT_ARCHIVE_CHOICES, CHAT_FOLD_CHOICES, MAX_TASKS_CHOICES, NO_SKIN } from '../settings/settings-protocol.js';
|
|
8
|
+
import { AGENT_SETTINGS_GROUPS, AgentSettingsUtil, QUEUE_SETTINGS, ShortcutUtil } from '../settings/agent-settings.js';
|
|
9
|
+
import { CHAT_ARCHIVE_CHOICES, CHAT_FOLD_CHOICES, MAX_TASKS_CHOICES, NO_SKIN, SEND_WHILE_WORKING } from '../settings/settings-protocol.js';
|
|
10
10
|
import { SkinUtil } from '../skin/skin-util.js';
|
|
11
|
+
import { ComposerUtil } from '../util/composer.js';
|
|
11
12
|
import { Voice } from '../util/voice.js';
|
|
12
13
|
import { AgentControl, ScopeBar, useAgentSettings } from './agent-settings-view.js';
|
|
13
14
|
import { useNavigation } from './app-nav.js';
|
|
@@ -181,27 +182,37 @@ export function useParts(scope, onScope, onDialog) {
|
|
|
181
182
|
!agent.offline && !snapshot && !agent.error && React.createElement(Loading, { compact: true, label: t('ta.settings.loading') }),
|
|
182
183
|
locked && React.createElement("div", { className: "ta-settings-note" }, t('ta.settings.untrusted')),
|
|
183
184
|
agent.error && React.createElement("div", { className: "ta-banner ta-banner-error" }, t('ta.settings.failed', { error: agent.error }))));
|
|
184
|
-
|
|
185
|
+
// Of this device, in the section of what pi does with the messages sent while Ta works: one place for the queue.
|
|
186
|
+
const own = {
|
|
187
|
+
[QUEUE_SETTINGS]: [
|
|
188
|
+
row('send-while-working', [t('ta.settings.sendWhileWorking'), t('ta.settings.sendWhileWorkingHint', ComposerUtil.keyNames(ShortcutUtil.isMac()))], React.createElement(Row, { label: t('ta.settings.sendWhileWorking'), description: t('ta.settings.sendWhileWorkingHint', ComposerUtil.keyNames(ShortcutUtil.isMac())), stacked: true },
|
|
189
|
+
React.createElement(Segmented, { label: t('ta.settings.sendWhileWorking'), value: settings.sendWhileWorking, choices: SEND_WHILE_WORKING.map(value => ({ value, label: t(`ta.settings.sendWhileWorking.${value}`) })), onChange: value => store.update({ sendWhileWorking: value }) }))),
|
|
190
|
+
],
|
|
191
|
+
};
|
|
192
|
+
const ta = AGENT_SETTINGS_GROUPS.map(group => { var _a, _b; return ({
|
|
185
193
|
id: group.id,
|
|
186
194
|
title: t(group.title),
|
|
187
195
|
icon: (_a = GROUP_ICONS[group.id]) !== null && _a !== void 0 ? _a : Wrench,
|
|
188
196
|
group: 'ta',
|
|
189
197
|
scoped: true,
|
|
190
198
|
...(group.id === 'model' ? { tier: 'common' } : {}),
|
|
191
|
-
rows:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
rows: [
|
|
200
|
+
...((_b = own[group.id]) !== null && _b !== void 0 ? _b : []),
|
|
201
|
+
...(snapshot
|
|
202
|
+
? group.keys.flatMap(key => {
|
|
203
|
+
const spec = AgentSettingsUtil.spec(key);
|
|
204
|
+
if (!spec) {
|
|
205
|
+
return [];
|
|
206
|
+
}
|
|
207
|
+
const label = t(AgentSettingsUtil.label(key));
|
|
208
|
+
const hint = AgentSettingsUtil.hint(key);
|
|
209
|
+
return [
|
|
210
|
+
row(key, [label, hint && t(hint), key], React.createElement(Row, { label: label, description: hint && t(hint), modified: snapshot[scope][key] !== undefined },
|
|
211
|
+
React.createElement(AgentControl, { spec: spec, scope: scope, snapshot: snapshot, disabled: locked, onChange: changes => agent.update(scope, changes) }))),
|
|
212
|
+
];
|
|
213
|
+
})
|
|
214
|
+
: []),
|
|
215
|
+
],
|
|
205
216
|
}); });
|
|
206
217
|
// Ta's scoped sections first in its part, under their scope; each part's own sections before those of extensions.
|
|
207
218
|
const sections = [...web.filter(entry => entry.group !== 'ta'), ...ta, ...web.filter(entry => entry.group === 'ta'), ...more];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ShareLinkUtil } from '@celljs/ta-protocol/lib/common/share-link';
|
|
1
2
|
import { Package } from 'lucide-react';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { useNotices, useWebExtensions, useWorkbench } from '../hooks.js';
|
|
4
5
|
import { useT } from '../i18n/use-t.js';
|
|
5
|
-
import { ShareLinkUtil } from '../util/share-link.js';
|
|
6
6
|
import { ShareItemSheet } from './share-item-sheet.js';
|
|
7
7
|
import { ShareSheet } from './share-sheet.js';
|
|
8
8
|
/** The link of an extension: of its source when it is published, else of the relay, made by this computer. */
|
|
@@ -35,10 +35,11 @@ export function ShareDialog({ target, onClose }) {
|
|
|
35
35
|
const t = useT();
|
|
36
36
|
const [, bench] = useWorkbench();
|
|
37
37
|
const [, notices] = useNotices();
|
|
38
|
+
const [{ shareWays }] = useWebExtensions();
|
|
38
39
|
const [shared, error] = useShared(target);
|
|
39
40
|
const packageId = target.packageId;
|
|
40
41
|
const days = (shared === null || shared === void 0 ? void 0 : shared.relayed) ? Math.max(1, Math.round((shared.expiresAt - Date.now()) / 86400000)) : 0;
|
|
41
|
-
return (React.createElement(ShareSheet, { title: t('ta.share.title', { name: target.title }), link: shared === null || shared === void 0 ? void 0 : shared.link, error: error === undefined ? undefined : error || t('ta.share.cannot'), face: React.createElement(Package, { size: 22 }), name: target.title, gets: t('ta.share.extensionGets'), invite: t('ta.share.extensionInvite', { name: target.title }), notes: [(shared === null || shared === void 0 ? void 0 : shared.relayed) ? t('ta.share.relayed', { days, size: Math.round(shared.maxBytes / 1024 / 1024) }) : t('ta.share.published')], onStop: (shared === null || shared === void 0 ? void 0 : shared.relayed) && packageId ? () => bench.relay.unsharePackage(packageId) : undefined, stop: { title: t('ta.share.stopTitle', { name: target.title }), message: t('ta.share.stopHint') }, onClose: onClose, notices: notices, rooms: bench.rooms, onRoomEvent: listener => bench.onRoomEvent(listener, { messages: false }) }));
|
|
42
|
+
return (React.createElement(ShareSheet, { title: t('ta.share.title', { name: target.title }), link: shared === null || shared === void 0 ? void 0 : shared.link, error: error === undefined ? undefined : error || t('ta.share.cannot'), face: React.createElement(Package, { size: 22 }), name: target.title, icon: "Package", gets: t('ta.share.extensionGets'), invite: t('ta.share.extensionInvite', { name: target.title }), notes: [(shared === null || shared === void 0 ? void 0 : shared.relayed) ? t('ta.share.relayed', { days, size: Math.round(shared.maxBytes / 1024 / 1024) }) : t('ta.share.published')], onStop: (shared === null || shared === void 0 ? void 0 : shared.relayed) && packageId ? () => bench.relay.unsharePackage(packageId) : undefined, stop: { title: t('ta.share.stopTitle', { name: target.title }), message: t('ta.share.stopHint') }, onClose: onClose, notices: notices, rooms: bench.rooms, onRoomEvent: listener => bench.onRoomEvent(listener, { messages: false }), ways: () => shareWays }));
|
|
42
43
|
}
|
|
43
44
|
/** The share asked for by a web extension, over the page: an extension handed on, or the share sheet of something. */
|
|
44
45
|
export function ShareHost() {
|
|
@@ -33,7 +33,7 @@ export function ShareItemSheet({ item, ways, onClose }) {
|
|
|
33
33
|
React.createElement(Icon, { size: 22 })),
|
|
34
34
|
React.createElement("span", { className: "ta-share-who-text" },
|
|
35
35
|
React.createElement("strong", { className: "ta-share-name" }, name),
|
|
36
|
-
React.createElement("span", { className: "ta-share-gets" }, item.kind === 'file' ? t('ta.share.itemFile') : t('ta.share.itemWork'))))),
|
|
36
|
+
React.createElement("span", { className: "ta-share-gets" }, item.kind === 'file' ? t('ta.share.itemFile') : item.kind === 'link' ? item.gets : t('ta.share.itemWork'))))),
|
|
37
37
|
taking.length ? (React.createElement("div", { className: "ta-share-tiles" }, taking.map(way => (React.createElement(Tile, { key: way.key, icon: way.icon, label: WebShareUtil.label(way), onClick: () => pick(way) }))))) : (React.createElement(EmptyState, { title: t('ta.share.noWay'), compact: true })))));
|
|
38
38
|
}
|
|
39
39
|
//# sourceMappingURL=share-item-sheet.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TaRoomEvent, TaRoomServer } from '@celljs/ta-protocol';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type { WebIcon, WebShareSheetProps } from '../extension/web-extension-api.js';
|
|
3
|
+
import type { WebIcon, WebShareSheetProps, WebShareWay } from '../extension/web-extension-api.js';
|
|
4
4
|
import type { TaNotices } from '../notices/notices-protocol.js';
|
|
5
5
|
/** One of the actions under the code, as the share sheets of phones: a round icon over a word. */
|
|
6
6
|
export declare function Tile({ icon: Icon, label, onClick, disabled }: {
|
|
@@ -19,5 +19,7 @@ export interface ShareSheetServices {
|
|
|
19
19
|
notices: TaNotices;
|
|
20
20
|
rooms: TaRoomServer;
|
|
21
21
|
onRoomEvent?(listener: (event: TaRoomEvent) => void): () => void;
|
|
22
|
+
/** The ways to share (registerShareWay): one that takes a link sends it into chats, friends' and group chats alike. */
|
|
23
|
+
ways?(): readonly WebShareWay[];
|
|
22
24
|
}
|
|
23
|
-
export declare function ShareSheet({ title, link, error, face, name, gets, invite, notes, password, own, onRenew, onStop, stop, onClose, children, notices, rooms, onRoomEvent, }: WebShareSheetProps & ShareSheetServices): React.JSX.Element;
|
|
25
|
+
export declare function ShareSheet({ title, link, error, face, name, icon, gets, invite, notes, password, own, onRenew, onStop, stop, onClose, children, notices, rooms, onRoomEvent, ways, }: WebShareSheetProps & ShareSheetServices): React.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Check, Copy, KeyRound, RefreshCw, Send, Share2 } from 'lucide-react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { shareMessage } from '../extension/share-sheet-compat.js';
|
|
4
|
+
import { WebShareUtil } from '../extension/web-share.js';
|
|
4
5
|
import { useT } from '../i18n/use-t.js';
|
|
5
6
|
import { useBusy } from './busy.js';
|
|
6
7
|
import { EmptyState } from './empty-state.js';
|
|
@@ -27,7 +28,7 @@ export function Tile({ icon: Icon, label, onClick, disabled }) {
|
|
|
27
28
|
React.createElement(Icon, { size: 20 })),
|
|
28
29
|
React.createElement("span", { className: "ta-share-tile-label" }, label)));
|
|
29
30
|
}
|
|
30
|
-
export function ShareSheet({ title, link, error, face, name, gets, invite, notes, password, own, onRenew, onStop, stop, onClose, children, notices, rooms, onRoomEvent, }) {
|
|
31
|
+
export function ShareSheet({ title, link, error, face, name, icon, gets, invite, notes, password, own, onRenew, onStop, stop, onClose, children, notices, rooms, onRoomEvent, ways, }) {
|
|
31
32
|
const t = useT();
|
|
32
33
|
const [copied, copy] = useCopied();
|
|
33
34
|
const [stopping, run] = useBusy();
|
|
@@ -35,7 +36,19 @@ export function ShareSheet({ title, link, error, face, name, gets, invite, notes
|
|
|
35
36
|
const friends = useShareFriends(rooms);
|
|
36
37
|
const [sends, setSends] = React.useState(0);
|
|
37
38
|
const sent = useFriendSends(rooms, own ? undefined : link, sends, onRoomEvent);
|
|
38
|
-
|
|
39
|
+
// Sent into chats as a card, to friends and group chats alike, where a way takes a link (ta-rooms); else sealed for friends alone.
|
|
40
|
+
const chatItem = link && !own ? { kind: 'link', link, title: name || title, invite, ...(gets ? { gets } : {}), ...(icon ? { icon } : {}) } : undefined;
|
|
41
|
+
const chatWay = chatItem ? ways === null || ways === void 0 ? void 0 : ways().find(way => way.accepts(chatItem)) : undefined;
|
|
42
|
+
const toChats = () => {
|
|
43
|
+
if (!chatWay || !chatItem) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
onClose();
|
|
47
|
+
Promise.resolve()
|
|
48
|
+
.then(() => chatWay.share(chatItem))
|
|
49
|
+
.catch(reason => notices.error(reason));
|
|
50
|
+
};
|
|
51
|
+
const canFriends = !own && !chatWay && !!(friends === null || friends === void 0 ? void 0 : friends.length);
|
|
39
52
|
const canSend = !own && typeof navigator !== 'undefined' && typeof navigator.share === 'function';
|
|
40
53
|
const end = async () => {
|
|
41
54
|
if (!onStop || (stop && !(await notices.confirm({ title: stop.title, message: stop.message, confirmLabel: t('ta.share.stop'), danger: true })))) {
|
|
@@ -73,6 +86,7 @@ export function ShareSheet({ title, link, error, face, name, gets, invite, notes
|
|
|
73
86
|
setSends(n => n + 1);
|
|
74
87
|
}
|
|
75
88
|
} })) : (React.createElement("div", { className: "ta-share-tiles" },
|
|
89
|
+
chatWay && React.createElement(Tile, { icon: chatWay.icon, label: WebShareUtil.label(chatWay), onClick: toChats }),
|
|
76
90
|
canFriends && React.createElement(Tile, { icon: Send, label: t('ta.share.friends'), disabled: !link, onClick: () => setPicking(true) }),
|
|
77
91
|
React.createElement(Tile, { icon: copied === 'link' ? Check : Copy, label: copied === 'link' ? t('ta.share.copied') : t('ta.share.copy'), disabled: !link, onClick: () => link && copy(shareMessage(invite, link), 'link') }),
|
|
78
92
|
canSend && (React.createElement(Tile, { icon: Share2, label: t('ta.share.apps'), disabled: !link, onClick: () => link && void navigator.share({ title: name || title, text: invite, url: link }).catch(() => undefined) })),
|
|
@@ -78,7 +78,13 @@ function usePolledSignIn(onFailed) {
|
|
|
78
78
|
window.open(url, '_blank');
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
|
-
|
|
81
|
+
// Refused or too late there: this page says so, and the button signs in anew.
|
|
82
|
+
onProgress: progress => {
|
|
83
|
+
if (progress.failed) {
|
|
84
|
+
signIn.stop();
|
|
85
|
+
onFailed();
|
|
86
|
+
}
|
|
87
|
+
},
|
|
82
88
|
});
|
|
83
89
|
running.current = signIn;
|
|
84
90
|
void signIn
|
|
@@ -27,8 +27,8 @@ export declare namespace UnseenDropUtil {
|
|
|
27
27
|
function neck(from: Point, r: number, to: Point, R: number): string;
|
|
28
28
|
function distance(a: Point, b: Point): number;
|
|
29
29
|
}
|
|
30
|
-
/** The colour of what is dragged: amber of something unseen, blue of what waits for the user to decide. */
|
|
31
|
-
export type DropTone = 'unseen' | 'asks';
|
|
30
|
+
/** The colour of what is dragged: amber of something unseen, blue of what waits for the user to decide, red of what people said. */
|
|
31
|
+
export type DropTone = 'unseen' | 'asks' | 'people';
|
|
32
32
|
/**
|
|
33
33
|
* The amber dot of a tab that has something unseen, or the blue count of what waits for the user (AsksBadge, its
|
|
34
34
|
* `children`). A finger, or the mouse, drags it off as a drop of water, as QQ's unread: stretched past its neck and
|
|
@@ -61,7 +61,7 @@ class DropOverlay {
|
|
|
61
61
|
this.dot = document.createElementNS(SVG, 'circle');
|
|
62
62
|
this.bridge = document.createElementNS(SVG, 'path');
|
|
63
63
|
this.drop = document.createElementNS(SVG, 'circle');
|
|
64
|
-
this.svg.setAttribute('class', tone === '
|
|
64
|
+
this.svg.setAttribute('class', tone === 'unseen' ? 'ta-unseen-drag' : `ta-unseen-drag ta-${tone}`);
|
|
65
65
|
this.svg.setAttribute('aria-hidden', 'true');
|
|
66
66
|
this.dot.setAttribute('cx', String(origin.x));
|
|
67
67
|
this.dot.setAttribute('cy', String(origin.y));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The number on the icon of Ta, as a messenger's: the messages of people the user has not seen, the red number of the
|
|
3
|
+
* chats' tab. Ta Desktop's Dock, the app on iOS (TaPush.swift, which the computer's pushes set too while the app is
|
|
4
|
+
* closed), or an installed web page (the Badging API); 0 takes it off. Nothing where there is no icon.
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace AppBadge {
|
|
7
|
+
function set(count: number, scope?: object): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DesktopUtil } from '../util/desktop.js';
|
|
2
|
+
/**
|
|
3
|
+
* The number on the icon of Ta, as a messenger's: the messages of people the user has not seen, the red number of the
|
|
4
|
+
* chats' tab. Ta Desktop's Dock, the app on iOS (TaPush.swift, which the computer's pushes set too while the app is
|
|
5
|
+
* closed), or an installed web page (the Badging API); 0 takes it off. Nothing where there is no icon.
|
|
6
|
+
*/
|
|
7
|
+
export var AppBadge;
|
|
8
|
+
(function (AppBadge) {
|
|
9
|
+
function set(count, scope = globalThis) {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
const value = Math.max(0, Math.floor(count) || 0);
|
|
12
|
+
const desktop = DesktopUtil.badge(scope);
|
|
13
|
+
if (desktop) {
|
|
14
|
+
desktop(value);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { webkit, navigator } = scope;
|
|
18
|
+
const app = (_a = webkit === null || webkit === void 0 ? void 0 : webkit.messageHandlers) === null || _a === void 0 ? void 0 : _a.taPush;
|
|
19
|
+
if (app) {
|
|
20
|
+
app.postMessage({ action: 'badge', count: value });
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const done = value ? (_b = navigator === null || navigator === void 0 ? void 0 : navigator.setAppBadge) === null || _b === void 0 ? void 0 : _b.call(navigator, value) : (_c = navigator === null || navigator === void 0 ? void 0 : navigator.clearAppBadge) === null || _c === void 0 ? void 0 : _c.call(navigator);
|
|
24
|
+
void (done === null || done === void 0 ? void 0 : done.catch(() => undefined));
|
|
25
|
+
}
|
|
26
|
+
AppBadge.set = set;
|
|
27
|
+
})(AppBadge || (AppBadge = {}));
|
|
28
|
+
//# sourceMappingURL=app-badge.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ShareLinkUtil } from '@celljs/ta-protocol/lib/common/share-link';
|
|
1
2
|
import { message } from '../i18n/messages.js';
|
|
2
|
-
import { ShareLinkUtil } from '../util/share-link.js';
|
|
3
3
|
import { WorkbenchUtil } from '../workbench-util.js';
|
|
4
4
|
import { CodeVision } from './code-vision.js';
|
|
5
5
|
import { MiniProgram } from './mini-program.js';
|
|
@@ -9,6 +9,32 @@ export interface WebCodeRendererOptions {
|
|
|
9
9
|
spoken?(code: string): string | undefined;
|
|
10
10
|
pointable?: boolean;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* The files a text said on another computer names (a line of a group chat, docs/design/ta-local-refs.md), as they came
|
|
14
|
+
* with it, by the path the text names each by (LocalRefs.localPath): `ui.Markdown` with them shows and opens those, and
|
|
15
|
+
* looks for no file of this computer.
|
|
16
|
+
*/
|
|
17
|
+
export interface WebMarkdownFiles {
|
|
18
|
+
/** Whether the file of a path came with the text. */
|
|
19
|
+
has(path: string): boolean;
|
|
20
|
+
/** A URL of one that came, a picture or a video it shows; rejects while it cannot come (its sender away). */
|
|
21
|
+
url(path: string): Promise<string>;
|
|
22
|
+
/** Opens one that came, as the chat opens its files. */
|
|
23
|
+
open(path: string): void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* What `ui.Markdown` draws: `text` as the conversations show it; `inline`: in a line; `send`, `answer`: a group chat's
|
|
27
|
+
* (newer); `whole`: WebCodeRendererProps.whole; `files`: of a text said on another computer, the files that came with it
|
|
28
|
+
* (newer; older apps look for them on their own computer).
|
|
29
|
+
*/
|
|
30
|
+
export interface WebMarkdownProps {
|
|
31
|
+
text: string;
|
|
32
|
+
inline?: boolean;
|
|
33
|
+
send?: WebCodeRendererProps['send'];
|
|
34
|
+
answer?: string;
|
|
35
|
+
whole?: boolean;
|
|
36
|
+
files?: WebMarkdownFiles;
|
|
37
|
+
}
|
|
12
38
|
/** A fenced block of the language of a code renderer (WebExtensionAPI.registerCodeRenderer). */
|
|
13
39
|
export interface WebCodeRendererProps {
|
|
14
40
|
/** Its lines, as written. */
|
|
@@ -35,6 +35,8 @@ export interface WebShareSheetProps {
|
|
|
35
35
|
/** Who or what goes, as the other will see it: a face or an icon (44 px), and a name. */
|
|
36
36
|
face?: React.ReactNode;
|
|
37
37
|
name?: string;
|
|
38
|
+
/** An icon of the page (WEB_ICONS) for what goes, on its card where it is sent into a chat: `Package` for an extension. */
|
|
39
|
+
icon?: string;
|
|
38
40
|
/** What the other gets, in a line: "They add it as an agent of their own". */
|
|
39
41
|
gets?: string;
|
|
40
42
|
/**
|
|
@@ -214,10 +216,32 @@ export interface WebChatImagesProps {
|
|
|
214
216
|
thumb?: string;
|
|
215
217
|
width: number;
|
|
216
218
|
height: number;
|
|
219
|
+
original?: WebChatOriginal;
|
|
217
220
|
}[];
|
|
218
221
|
/** What they are, for who cannot see them. */
|
|
219
222
|
alt?: string;
|
|
220
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* The picture as it was picked, of one shown made smaller (WebChatImagesProps): 查看原图 with its size at the bottom left
|
|
226
|
+
* of the picture opened, as WeChat has it; `load` gives its URL once here (undefined when it cannot come now).
|
|
227
|
+
*/
|
|
228
|
+
export interface WebChatOriginal {
|
|
229
|
+
bytes: number;
|
|
230
|
+
load(): Promise<string | undefined>;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* WebExtensionUI.Sending: a message of the user on its way, as a messenger shows it: a spinner beside it while it goes
|
|
234
|
+
* (`progress`, 0 to 1, when known), a red mark and a line to send it again or take it back once it did not (`failed`, why).
|
|
235
|
+
*/
|
|
236
|
+
export interface WebSendingProps {
|
|
237
|
+
failed?: string;
|
|
238
|
+
progress?: number;
|
|
239
|
+
onResend?(): void;
|
|
240
|
+
onDiscard?(): void;
|
|
241
|
+
/** In place of the line under one that did not go (发送失败 · 重发 · 删除). */
|
|
242
|
+
line?: React.ReactNode;
|
|
243
|
+
children?: React.ReactNode;
|
|
244
|
+
}
|
|
221
245
|
export interface WebImageViewerProps {
|
|
222
246
|
src: string;
|
|
223
247
|
alt?: string;
|
|
@@ -418,6 +442,13 @@ export interface WebComposerImage {
|
|
|
418
442
|
/** In pixels, when the box shrank it (`images` with limits). */
|
|
419
443
|
width?: number;
|
|
420
444
|
height?: number;
|
|
445
|
+
/** The picture as it was picked, when the box made it smaller (`images` with limits): for 查看原图. */
|
|
446
|
+
original?: {
|
|
447
|
+
data: string;
|
|
448
|
+
mimeType: string;
|
|
449
|
+
width: number;
|
|
450
|
+
height: number;
|
|
451
|
+
};
|
|
421
452
|
}
|
|
422
453
|
/** How the message box shrinks the pictures it hands on: their longest side in pixels, their bytes at most. */
|
|
423
454
|
export interface WebComposerImageLimits {
|
|
@@ -57,6 +57,21 @@ export type WebShareItem = {
|
|
|
57
57
|
} | {
|
|
58
58
|
kind: 'file';
|
|
59
59
|
file: WebFileRef;
|
|
60
|
+
} | {
|
|
61
|
+
/**
|
|
62
|
+
* A link from the share sheet (`ui.ShareSheet`: an extension, a conversation, a card, an invitation), to send
|
|
63
|
+
* into chats as a card (docs/design/ta-links.md 4.1): its Send to friends is the way that takes it.
|
|
64
|
+
*/
|
|
65
|
+
kind: 'link';
|
|
66
|
+
link: string;
|
|
67
|
+
/** Who or what goes, as the sheet names it. */
|
|
68
|
+
title: string;
|
|
69
|
+
/** What the other reads with the link (WebShareSheetProps.invite). */
|
|
70
|
+
invite: string;
|
|
71
|
+
/** What the other gets, in a line. */
|
|
72
|
+
gets?: string;
|
|
73
|
+
/** An icon of the page (WEB_ICONS) for what it is. */
|
|
74
|
+
icon?: string;
|
|
60
75
|
};
|
|
61
76
|
/**
|
|
62
77
|
* A way to share (registerShareWay): a tile of the share sheet, for what it takes. Send to friends and group chats,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Part of the web extension API (web-extension-api.ts, which exports it all): what a chat an extension draws (a group
|
|
3
|
+
* chat, a channel) shows as the conversations of the page do, the pictures of a message and a message on its way.
|
|
4
|
+
*/
|
|
5
|
+
import type * as React from 'react';
|
|
6
|
+
import type { WebChatImagesProps, WebSendingProps } from './web-api-components.js';
|
|
7
|
+
export interface WebMessagesUI {
|
|
8
|
+
/**
|
|
9
|
+
* The pictures of a message of a chat the extension draws, as a conversation shows the user's (`thumb` blurred till
|
|
10
|
+
* `src`; 查看原图 of one shown made smaller, `original`). Newer than some apps.
|
|
11
|
+
*/
|
|
12
|
+
readonly ChatImages?: React.ComponentType<WebChatImagesProps>;
|
|
13
|
+
/** A message of the user on its way, around it: a spinner beside it while it goes, a red mark and 重发 / 删除 once it did not. Newer than some apps. */
|
|
14
|
+
readonly Sending?: React.ComponentType<WebSendingProps>;
|
|
15
|
+
}
|
|
@@ -69,10 +69,26 @@ export interface WebPartnerChat {
|
|
|
69
69
|
seenAt?: number;
|
|
70
70
|
/** What was said last, with who said it where it is not the partner. */
|
|
71
71
|
last?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Before {@link last}, in red while it is unseen, as WeChat's `[Someone @ you]`: what of it is for the user. Newer than
|
|
74
|
+
* some Ta apps.
|
|
75
|
+
*/
|
|
76
|
+
flag?: string;
|
|
72
77
|
/** `Date.now()` time of it: where the conversation is in the double's list. */
|
|
73
78
|
at?: number;
|
|
74
79
|
/** Said since the user last looked: the amber dot. */
|
|
75
80
|
unseen?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* With {@link unseen}, how many messages people sent that the user has not seen (a friend, a group chat): a red
|
|
83
|
+
* number on its face in place of the amber dot, and counted on the tab of the chats, as WeChat's. Newer than some Ta
|
|
84
|
+
* apps.
|
|
85
|
+
*/
|
|
86
|
+
count?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Marks what was said seen, as the user drags its number (or dot) away, from its row or from the tab of the chats
|
|
89
|
+
* with all the others; without it, it stays till opened. Newer than some Ta apps.
|
|
90
|
+
*/
|
|
91
|
+
see?(): void;
|
|
76
92
|
/** Answers now: the green dot that breathes. */
|
|
77
93
|
busy?: boolean;
|
|
78
94
|
/** Waits for the user to answer: the blue ?. */
|
|
@@ -91,6 +91,7 @@ export const WEB_UI_SPEC = {
|
|
|
91
91
|
PictureCards: component(B),
|
|
92
92
|
ImageViewer: component(B),
|
|
93
93
|
ChatImages: component(B),
|
|
94
|
+
Sending: component(B),
|
|
94
95
|
QrCode: component(B),
|
|
95
96
|
// Its host is functions that take functions: only in the page, for now (docs/design/ta-works.md stage 2 opens it).
|
|
96
97
|
WorkFrame: page,
|
|
@@ -4,8 +4,8 @@ import type { Mood } from '../avatar/dino-avatar.js';
|
|
|
4
4
|
import type { DeviceState } from '../device/device-protocol.js';
|
|
5
5
|
import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol.js';
|
|
6
6
|
import type { Language, Theme } from '../settings/settings-protocol.js';
|
|
7
|
-
import type { WebCodeRendererOptions, WebCodeRendererProps } from './web-api-code.js';
|
|
8
|
-
import type { CodeEditorProps, DiffEditorProps, WebAvatarProps,
|
|
7
|
+
import type { WebCodeRendererOptions, WebCodeRendererProps, WebMarkdownProps } from './web-api-code.js';
|
|
8
|
+
import type { CodeEditorProps, DiffEditorProps, WebAvatarProps, WebComposerProps, WebConversationViewProps, WebDialogProps, WebEmptyProps, WebFaceProps, WebFolderPickerProps, WebFullScreenProps, WebGroupFaceProps, WebHoldToTalkProps, WebImageViewerProps, WebLoadingProps, WebModelPickerProps, WebPictureCardsProps, WebPictureProps, WebSelectBarProps, WebSelectCheckProps, WebShareSheetProps, WebStackProps, WebSwipeRowProps, WebSwitchProps, WebTaskIconProps, WebVoice } from './web-api-components.js';
|
|
9
9
|
import type { WebAsk, WebCallsAPI, WebChatIconSource, WebChatTagsAPI, WebComposerAddon, WebCustomMessage, WebHomeSource, WebInitiative, WebMenuItem, WebNotifyOptions, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionNotice, WebSessionOpening, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions.js';
|
|
10
10
|
import type { WebDesktop, WebDeviceUI, WebFileDrag, WebviewTabEvent } from './web-api-desktop.js';
|
|
11
11
|
import type { WebEditorsUI } from './web-api-editors.js';
|
|
@@ -14,6 +14,7 @@ import type { WebHomeUI, WebPartnersAPI, WebPartnersUI } from './web-api-home.js
|
|
|
14
14
|
import type { WebHostAPI, WebHostUI } from './web-api-host.js';
|
|
15
15
|
import type { WebHosts } from './web-api-hosts.js';
|
|
16
16
|
import type { WebFileRef, WebMenus, WebShareUI } from './web-api-menus.js';
|
|
17
|
+
import type { WebMessagesUI } from './web-api-messages.js';
|
|
17
18
|
import type { WebPlayUI } from './web-api-play.js';
|
|
18
19
|
import type { WebServices } from './web-api-services.js';
|
|
19
20
|
import type { WebSkinsAPI } from './web-api-skins.js';
|
|
@@ -38,6 +39,7 @@ export type * from './web-api-home.js';
|
|
|
38
39
|
export type * from './web-api-host.js';
|
|
39
40
|
export type * from './web-api-hosts.js';
|
|
40
41
|
export type * from './web-api-menus.js';
|
|
42
|
+
export type * from './web-api-messages.js';
|
|
41
43
|
export type * from './web-api-play.js';
|
|
42
44
|
export type * from './web-api-services.js';
|
|
43
45
|
export type * from './web-api-skins.js';
|
|
@@ -188,7 +190,7 @@ export type WebIcon = React.ComponentType<{
|
|
|
188
190
|
}>;
|
|
189
191
|
/** What web extensions see of TaScreen. */
|
|
190
192
|
export type WebScreen = Pick<TaScreen, 'agent' | 'parts' | 'act' | 'element' | 'where' | 'places' | 'go' | 'pageScroll' | 'scroll'>;
|
|
191
|
-
export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI, WebDeviceUI, WebPlayUI, WebShareUI, WebFileViewsUI, WebHostUI {
|
|
193
|
+
export interface WebExtensionUI extends WebMessagesUI, WebHomeUI, WebPartnersUI, WebEditorsUI, WebDeviceUI, WebPlayUI, WebShareUI, WebFileViewsUI, WebHostUI {
|
|
192
194
|
/** A widget around the message box, as pi's, or a card in the workbench on the right; `undefined` removes it. */
|
|
193
195
|
setWidget(key: string, widget: React.ComponentType | undefined, options?: WidgetOptions): void;
|
|
194
196
|
/**
|
|
@@ -477,14 +479,8 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
|
|
|
477
479
|
* meeting written down); let it go when it stops. Newer than some Ta apps: `pi.ui.keepAwake?.()`.
|
|
478
480
|
*/
|
|
479
481
|
readonly keepAwake?: () => () => void;
|
|
480
|
-
/** As the conversations show it
|
|
481
|
-
readonly Markdown: React.ComponentType<
|
|
482
|
-
text: string;
|
|
483
|
-
inline?: boolean;
|
|
484
|
-
send?: WebCodeRendererProps['send'];
|
|
485
|
-
answer?: string;
|
|
486
|
-
whole?: boolean;
|
|
487
|
-
}>;
|
|
482
|
+
/** As the conversations show it (WebMarkdownProps). */
|
|
483
|
+
readonly Markdown: React.ComponentType<WebMarkdownProps>;
|
|
488
484
|
/**
|
|
489
485
|
* A conversation to read, drawn as those of the page are, with what extensions draw in them (cards, plots,
|
|
490
486
|
* 3D); nothing in it acts. Newer than some Ta apps: `pi.ui.Conversation ?? …`.
|
|
@@ -558,8 +554,6 @@ export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI,
|
|
|
558
554
|
* fit / actual size below it, and the pictures beside it at its sides when given (`onPrevious` / `onNext`). It fills its parent (a column of flex).
|
|
559
555
|
*/
|
|
560
556
|
readonly ImageViewer: React.ComponentType<WebImageViewerProps>;
|
|
561
|
-
/** The pictures of a message of a chat the extension draws, as a conversation shows the user's (`thumb` blurred till `src`). Newer than some apps. */
|
|
562
|
-
readonly ChatImages?: React.ComponentType<WebChatImagesProps>;
|
|
563
557
|
/** A QR code of a text (a link to scan with a phone), black on white whatever the theme; `label` for a screen reader. */
|
|
564
558
|
readonly QrCode: React.ComponentType<{
|
|
565
559
|
text: string;
|
|
@@ -28,6 +28,7 @@ import { PhoneStack } from '../components/phone-shell.js';
|
|
|
28
28
|
import { Picture, PictureCards } from '../components/picture.js';
|
|
29
29
|
import { QrView } from '../components/qr-view.js';
|
|
30
30
|
import { SelectBar, SelectCheck } from '../components/select-bar.js';
|
|
31
|
+
import { Sending } from '../components/sending.js';
|
|
31
32
|
import { Switch } from '../components/settings-controls.js';
|
|
32
33
|
import { SwipeRow } from '../components/swipe-row.js';
|
|
33
34
|
import { TaAvatar } from '../components/ta-avatar.js';
|
|
@@ -431,6 +432,7 @@ export class WebExtensionContext {
|
|
|
431
432
|
PictureCards,
|
|
432
433
|
ImageViewer,
|
|
433
434
|
ChatImages,
|
|
435
|
+
Sending,
|
|
434
436
|
QrCode: QrView,
|
|
435
437
|
WorkFrame,
|
|
436
438
|
WorkSenses,
|
|
@@ -11,7 +11,7 @@ import { Autowired, Component } from '@celljs/core';
|
|
|
11
11
|
import { TaAssistant } from '../assistant/assistant-protocol.js';
|
|
12
12
|
import { ChatListUtil } from '../components/chat-list-util.js';
|
|
13
13
|
import { DOUBLE_PAGE } from '../components/side-lists.js';
|
|
14
|
-
import { Device } from '../device/device.js';
|
|
14
|
+
import { Device, nativePlugin } from '../device/device.js';
|
|
15
15
|
import { translator } from '../i18n/use-t.js';
|
|
16
16
|
import { Chime } from '../notices/chime.js';
|
|
17
17
|
import { TaNotices } from '../notices/notices-protocol.js';
|
|
@@ -96,7 +96,11 @@ export var WebSessionNoticeUtil;
|
|
|
96
96
|
const state = deps.extensions.state;
|
|
97
97
|
const assistant = deps.assistant();
|
|
98
98
|
const double = isDouble(notice, assistant);
|
|
99
|
-
const looking =
|
|
99
|
+
const looking = notice.view
|
|
100
|
+
? state.page === notice.view && !state.pageHidden
|
|
101
|
+
: double
|
|
102
|
+
? state.page === DOUBLE_PAGE
|
|
103
|
+
: state.conversationShown && !!notice.sessionId && state.sessionId === notice.sessionId;
|
|
100
104
|
const task = !!notice.sessionId && !!(assistant === null || assistant === void 0 ? void 0 : assistant.taskOf(notice.sessionId)) && !((_a = assistant.taskOf(notice.sessionId)) === null || _a === void 0 ? void 0 : _a.takenOver);
|
|
101
105
|
return { focused: focused(), looking, task, system: systemAllowed(), quiet: Device.state.touch };
|
|
102
106
|
}
|
|
@@ -193,10 +197,15 @@ export var WebSessionNoticeUtil;
|
|
|
193
197
|
}
|
|
194
198
|
},
|
|
195
199
|
chime: (level, way) => {
|
|
200
|
+
var _a;
|
|
196
201
|
// Ta Desktop's notice of the system, from its main process, sounds of its own but for an answer.
|
|
197
202
|
if (way !== 'system' || !DesktopUtil.notices() || level === 'done') {
|
|
198
203
|
tone.play(level);
|
|
199
204
|
}
|
|
205
|
+
// A phone in hand buzzes too, as a messenger's in front; a page away buzzes nothing.
|
|
206
|
+
if (Device.state.touch && focused()) {
|
|
207
|
+
(_a = nativePlugin('Haptics')) === null || _a === void 0 ? void 0 : _a('impact', { style: 'MEDIUM' }).catch(() => undefined);
|
|
208
|
+
}
|
|
200
209
|
},
|
|
201
210
|
};
|
|
202
211
|
}
|
|
@@ -10,6 +10,7 @@ export function shareUI(host, stopped) {
|
|
|
10
10
|
notices: host.notices,
|
|
11
11
|
rooms: host.workbench.rooms,
|
|
12
12
|
onRoomEvent: listener => host.workbench.onRoomEvent(listener, { messages: false }),
|
|
13
|
+
ways: () => host.extensions.state.shareWays,
|
|
13
14
|
});
|
|
14
15
|
return {
|
|
15
16
|
shareExtension: target => !stopped() && host.extensions.share(target),
|
|
@@ -25,13 +25,13 @@ export var WebShareUtil;
|
|
|
25
25
|
/** What it is called: the title a work gives itself, the name of a file; '' for a block that says nothing. */
|
|
26
26
|
function name(item) {
|
|
27
27
|
var _a;
|
|
28
|
-
return item.kind === 'file' ? item.file.name : ((_a = TaWorkTitle.of(item.language, item.code)) !== null && _a !== void 0 ? _a : '');
|
|
28
|
+
return item.kind === 'file' ? item.file.name : item.kind === 'link' ? item.title : ((_a = TaWorkTitle.of(item.language, item.code)) !== null && _a !== void 0 ? _a : '');
|
|
29
29
|
}
|
|
30
30
|
WebShareUtil.name = name;
|
|
31
31
|
/** The name of its icon (WEB_ICONS): that of the kind of work, a file's. */
|
|
32
32
|
function icon(item) {
|
|
33
|
-
var _a;
|
|
34
|
-
return item.kind === 'file' ? 'FileText' : ((_a = TA_WORK_BLOCKS[item.language]) !== null &&
|
|
33
|
+
var _a, _b;
|
|
34
|
+
return item.kind === 'file' ? 'FileText' : item.kind === 'link' ? ((_a = item.icon) !== null && _a !== void 0 ? _a : 'Link') : ((_b = TA_WORK_BLOCKS[item.language]) !== null && _b !== void 0 ? _b : 'Sparkles');
|
|
35
35
|
}
|
|
36
36
|
WebShareUtil.icon = icon;
|
|
37
37
|
function label(way) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ShareLinkUtil } from '@celljs/ta-protocol/lib/common/share-link';
|
|
1
2
|
import { message } from '../i18n/messages.js';
|
|
2
|
-
import { ShareLinkUtil } from '../util/share-link.js';
|
|
3
3
|
/** Extensions opened from links and the market without installing (ta-launcher.md): fetched, loaded, shown. */
|
|
4
4
|
export class WebSharing {
|
|
5
5
|
constructor(host) {
|
|
@@ -78,6 +78,8 @@ export declare const ASSISTANT_EN: {
|
|
|
78
78
|
'ta.task.running': string;
|
|
79
79
|
'ta.task.done': string;
|
|
80
80
|
'ta.task.failed': string;
|
|
81
|
+
'ta.task.deadEndFiltered': string;
|
|
82
|
+
'ta.task.deadEndEmpty': string;
|
|
81
83
|
'ta.task.verdictPass': string;
|
|
82
84
|
'ta.task.verdictFail': string;
|
|
83
85
|
'ta.task.branch': string;
|
|
@@ -78,6 +78,8 @@ export const ASSISTANT_EN = {
|
|
|
78
78
|
'ta.task.running': 'Running',
|
|
79
79
|
'ta.task.done': 'Done',
|
|
80
80
|
'ta.task.failed': 'Failed',
|
|
81
|
+
'ta.task.deadEndFiltered': 'Not done: the model service filtered the reply (tried once more)',
|
|
82
|
+
'ta.task.deadEndEmpty': 'Not done: the model stopped with no output (tried once more)',
|
|
81
83
|
'ta.task.verdictPass': 'Check passed',
|
|
82
84
|
'ta.task.verdictFail': 'Check failed',
|
|
83
85
|
'ta.task.branch': 'Branch {branch}',
|