@celljs/ta-web 4.43.0 → 4.45.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/apps/app-window.js +2 -2
- package/esm/browser/assistant/assistant-chat-list.js +2 -1
- package/esm/browser/assistant/assistant-extension.js +16 -2
- package/esm/browser/assistant/assistant-protocol.d.ts +6 -0
- package/esm/browser/assistant/assistant-task-source.js +3 -0
- package/esm/browser/assistant/assistant-task-util.d.ts +2 -0
- package/esm/browser/assistant/assistant-task-util.js +5 -0
- package/esm/browser/assistant/assistant.d.ts +3 -0
- package/esm/browser/assistant/assistant.js +26 -2
- package/esm/browser/components/app-shell-hooks.d.ts +2 -1
- package/esm/browser/components/app-shell-hooks.js +4 -3
- package/esm/browser/components/app-shell-state.js +2 -2
- package/esm/browser/components/chat-list-row.js +4 -4
- package/esm/browser/components/chat-list-util.d.ts +2 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/custom-host.d.ts +4 -1
- package/esm/browser/components/custom-host.js +8 -2
- package/esm/browser/components/earlier-messages.d.ts +4 -1
- package/esm/browser/components/earlier-messages.js +5 -2
- package/esm/browser/components/hearing-host.d.ts +2 -1
- package/esm/browser/components/hearing-host.js +10 -7
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/message-list.js +2 -1
- package/esm/browser/components/message-steps.js +8 -5
- package/esm/browser/components/settings-choices.d.ts +2 -1
- package/esm/browser/components/settings-choices.js +2 -1
- package/esm/browser/components/settings-parts.js +23 -3
- package/esm/browser/components/share-dialog.js +1 -1
- package/esm/browser/components/share-friends.d.ts +18 -2
- package/esm/browser/components/share-friends.js +62 -4
- package/esm/browser/components/share-sheet.d.ts +4 -3
- package/esm/browser/components/share-sheet.js +11 -3
- package/esm/browser/extension/web-api-chats.d.ts +23 -0
- package/esm/browser/extension/web-api-desktop.d.ts +14 -0
- package/esm/browser/extension/web-api-skins.d.ts +95 -0
- package/esm/browser/extension/web-api-skins.js +2 -0
- package/esm/browser/extension/web-api-spec.js +3 -0
- package/esm/browser/extension/web-extension-api.d.ts +11 -26
- package/esm/browser/extension/web-extension-context.js +4 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +3 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +3 -2
- package/esm/browser/extension/web-extension-run.js +3 -0
- package/esm/browser/extension/web-share-ui.js +6 -1
- package/esm/browser/i18n/en/assistant.d.ts +4 -0
- package/esm/browser/i18n/en/assistant.js +4 -0
- package/esm/browser/i18n/en/chat.d.ts +1 -0
- package/esm/browser/i18n/en/chat.js +1 -0
- package/esm/browser/i18n/en/common.d.ts +0 -3
- package/esm/browser/i18n/en/common.js +0 -3
- package/esm/browser/i18n/en/discover.d.ts +4 -1
- package/esm/browser/i18n/en/discover.js +4 -1
- package/esm/browser/i18n/en/service.js +1 -1
- package/esm/browser/i18n/en/settings.d.ts +8 -0
- package/esm/browser/i18n/en/settings.js +8 -0
- package/esm/browser/i18n/en/tools.d.ts +5 -0
- package/esm/browser/i18n/en/tools.js +5 -0
- package/esm/browser/i18n/ja/assistant.js +4 -0
- package/esm/browser/i18n/ja/chat.js +1 -0
- package/esm/browser/i18n/ja/common.js +0 -3
- package/esm/browser/i18n/ja/discover.js +4 -1
- package/esm/browser/i18n/ja/service.js +1 -1
- package/esm/browser/i18n/ja/settings.js +8 -0
- package/esm/browser/i18n/ja/tools.js +5 -0
- package/esm/browser/i18n/locales.d.ts +23 -5
- package/esm/browser/i18n/messages.d.ts +22 -4
- package/esm/browser/i18n/zh/assistant.js +4 -0
- package/esm/browser/i18n/zh/chat.js +1 -0
- package/esm/browser/i18n/zh/common.js +0 -3
- package/esm/browser/i18n/zh/discover.js +4 -1
- package/esm/browser/i18n/zh/service.js +1 -1
- package/esm/browser/i18n/zh/settings.js +8 -0
- package/esm/browser/i18n/zh/tools.js +5 -0
- package/esm/browser/i18n/zh-tw/assistant.js +4 -0
- package/esm/browser/i18n/zh-tw/chat.js +1 -0
- package/esm/browser/i18n/zh-tw/common.js +0 -3
- package/esm/browser/i18n/zh-tw/discover.js +4 -1
- package/esm/browser/i18n/zh-tw/service.js +1 -1
- package/esm/browser/i18n/zh-tw/settings.js +8 -0
- package/esm/browser/i18n/zh-tw/tools.js +5 -0
- package/esm/browser/links/clipboard-links.d.ts +4 -8
- package/esm/browser/links/clipboard-links.js +9 -51
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/settings/settings-protocol.d.ts +24 -0
- package/esm/browser/settings/settings-protocol.js +9 -0
- package/esm/browser/settings/settings.d.ts +4 -1
- package/esm/browser/settings/settings.js +16 -3
- package/esm/browser/skin/skin-layer.d.ts +8 -0
- package/esm/browser/skin/skin-layer.js +118 -0
- package/esm/browser/skin/skin-util.d.ts +40 -0
- package/esm/browser/skin/skin-util.js +120 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +3 -2
- package/esm/browser/style/skins.d.ts +9 -0
- package/esm/browser/style/skins.js +107 -0
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +8 -0
- package/esm/browser/style.js +2 -0
- package/esm/browser/util/desktop.d.ts +11 -1
- package/esm/browser/util/desktop.js +30 -0
- package/esm/browser/util/fresh-rows.d.ts +21 -0
- package/esm/browser/util/fresh-rows.js +36 -0
- package/esm/browser/util/process.d.ts +12 -22
- package/esm/browser/util/process.js +49 -39
- package/esm/browser/util/tool.js +15 -5
- package/esm/browser/util/voice.js +10 -2
- package/lib/browser/apps/app-window.js +2 -2
- package/lib/browser/assistant/assistant-chat-list.js +2 -1
- package/lib/browser/assistant/assistant-extension.js +15 -1
- package/lib/browser/assistant/assistant-protocol.d.ts +6 -0
- package/lib/browser/assistant/assistant-task-source.js +3 -0
- package/lib/browser/assistant/assistant-task-util.d.ts +2 -0
- package/lib/browser/assistant/assistant-task-util.js +5 -0
- package/lib/browser/assistant/assistant.d.ts +3 -0
- package/lib/browser/assistant/assistant.js +26 -2
- package/lib/browser/components/app-shell-hooks.d.ts +2 -1
- package/lib/browser/components/app-shell-hooks.js +4 -3
- package/lib/browser/components/app-shell-state.js +2 -2
- package/lib/browser/components/chat-list-row.js +4 -4
- package/lib/browser/components/chat-list-util.d.ts +2 -2
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/custom-host.d.ts +4 -1
- package/lib/browser/components/custom-host.js +8 -2
- package/lib/browser/components/earlier-messages.d.ts +4 -1
- package/lib/browser/components/earlier-messages.js +5 -2
- package/lib/browser/components/hearing-host.d.ts +2 -1
- package/lib/browser/components/hearing-host.js +9 -6
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/message-list.js +2 -1
- package/lib/browser/components/message-steps.js +8 -5
- package/lib/browser/components/settings-choices.d.ts +2 -1
- package/lib/browser/components/settings-choices.js +2 -1
- package/lib/browser/components/settings-parts.js +21 -1
- package/lib/browser/components/share-dialog.js +1 -1
- package/lib/browser/components/share-friends.d.ts +18 -2
- package/lib/browser/components/share-friends.js +65 -4
- package/lib/browser/components/share-sheet.d.ts +4 -3
- package/lib/browser/components/share-sheet.js +10 -2
- package/lib/browser/extension/web-api-chats.d.ts +23 -0
- package/lib/browser/extension/web-api-desktop.d.ts +14 -0
- package/lib/browser/extension/web-api-skins.d.ts +96 -0
- package/lib/browser/extension/web-api-skins.js +3 -0
- package/lib/browser/extension/web-api-spec.js +3 -0
- package/lib/browser/extension/web-extension-api.d.ts +11 -26
- package/lib/browser/extension/web-extension-context.js +4 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +3 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +3 -2
- package/lib/browser/extension/web-extension-run.js +3 -0
- package/lib/browser/extension/web-share-ui.js +6 -1
- package/lib/browser/i18n/en/assistant.d.ts +4 -0
- package/lib/browser/i18n/en/assistant.js +4 -0
- package/lib/browser/i18n/en/chat.d.ts +1 -0
- package/lib/browser/i18n/en/chat.js +1 -0
- package/lib/browser/i18n/en/common.d.ts +0 -3
- package/lib/browser/i18n/en/common.js +0 -3
- package/lib/browser/i18n/en/discover.d.ts +4 -1
- package/lib/browser/i18n/en/discover.js +4 -1
- package/lib/browser/i18n/en/service.js +1 -1
- package/lib/browser/i18n/en/settings.d.ts +8 -0
- package/lib/browser/i18n/en/settings.js +8 -0
- package/lib/browser/i18n/en/tools.d.ts +5 -0
- package/lib/browser/i18n/en/tools.js +5 -0
- package/lib/browser/i18n/ja/assistant.js +4 -0
- package/lib/browser/i18n/ja/chat.js +1 -0
- package/lib/browser/i18n/ja/common.js +0 -3
- package/lib/browser/i18n/ja/discover.js +4 -1
- package/lib/browser/i18n/ja/service.js +1 -1
- package/lib/browser/i18n/ja/settings.js +8 -0
- package/lib/browser/i18n/ja/tools.js +5 -0
- package/lib/browser/i18n/locales.d.ts +23 -5
- package/lib/browser/i18n/messages.d.ts +22 -4
- package/lib/browser/i18n/zh/assistant.js +4 -0
- package/lib/browser/i18n/zh/chat.js +1 -0
- package/lib/browser/i18n/zh/common.js +0 -3
- package/lib/browser/i18n/zh/discover.js +4 -1
- package/lib/browser/i18n/zh/service.js +1 -1
- package/lib/browser/i18n/zh/settings.js +8 -0
- package/lib/browser/i18n/zh/tools.js +5 -0
- package/lib/browser/i18n/zh-tw/assistant.js +4 -0
- package/lib/browser/i18n/zh-tw/chat.js +1 -0
- package/lib/browser/i18n/zh-tw/common.js +0 -3
- package/lib/browser/i18n/zh-tw/discover.js +4 -1
- package/lib/browser/i18n/zh-tw/service.js +1 -1
- package/lib/browser/i18n/zh-tw/settings.js +8 -0
- package/lib/browser/i18n/zh-tw/tools.js +5 -0
- package/lib/browser/links/clipboard-links.d.ts +4 -8
- package/lib/browser/links/clipboard-links.js +10 -52
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/settings/settings-protocol.d.ts +24 -0
- package/lib/browser/settings/settings-protocol.js +10 -1
- package/lib/browser/settings/settings.d.ts +4 -1
- package/lib/browser/settings/settings.js +16 -3
- package/lib/browser/skin/skin-layer.d.ts +9 -0
- package/lib/browser/skin/skin-layer.js +154 -0
- package/lib/browser/skin/skin-util.d.ts +41 -0
- package/lib/browser/skin/skin-util.js +123 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +3 -2
- package/lib/browser/style/skins.d.ts +10 -0
- package/lib/browser/style/skins.js +110 -0
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +8 -0
- package/lib/browser/style.js +2 -0
- package/lib/browser/util/desktop.d.ts +11 -1
- package/lib/browser/util/desktop.js +30 -0
- package/lib/browser/util/fresh-rows.d.ts +22 -0
- package/lib/browser/util/fresh-rows.js +40 -0
- package/lib/browser/util/process.d.ts +12 -22
- package/lib/browser/util/process.js +49 -40
- package/lib/browser/util/tool.js +15 -5
- package/lib/browser/util/voice.js +10 -2
- package/package.json +7 -7
|
@@ -59,9 +59,6 @@ exports.COMMON_ZH_TW = {
|
|
|
59
59
|
'ta.clip.pasteMany': '貼上的內容裡有 {count} 個 Ta 連結',
|
|
60
60
|
'ta.clip.pick': '點一個開啟',
|
|
61
61
|
'ta.clip.open': '開啟',
|
|
62
|
-
'ta.clip.maybe': '剪貼簿裡有個連結',
|
|
63
|
-
'ta.clip.maybeDetail': '是 Ta 的邀請或分享的話,點「開啟」就能開啟',
|
|
64
|
-
'ta.clip.none': '剪貼簿裡沒有 Ta 的連結',
|
|
65
62
|
'ta.link.notFound': '{path} 不存在。',
|
|
66
63
|
'ta.terminal.openLink': 'Ctrl + 點選開啟',
|
|
67
64
|
'ta.terminal.openLinkMac': 'Cmd + 點選開啟',
|
|
@@ -48,7 +48,10 @@ exports.DISCOVER_ZH_TW = {
|
|
|
48
48
|
'ta.share.friends': 'Ta 好友',
|
|
49
49
|
'ta.share.pickFriends': '選擇好友',
|
|
50
50
|
'ta.share.sendN': '傳送給 {n} 位',
|
|
51
|
-
'ta.share.
|
|
51
|
+
'ta.share.sentTitle': '傳給了這些好友',
|
|
52
|
+
'ta.share.sent': '已傳出',
|
|
53
|
+
'ta.share.got': '已收到',
|
|
54
|
+
'ta.share.opened': '已開啟',
|
|
52
55
|
'ta.share.renew': '換新連結',
|
|
53
56
|
'ta.share.passwordApart': '密碼請另行告訴對方:',
|
|
54
57
|
'ta.share.copyPassword': '複製密碼',
|
|
@@ -264,6 +264,6 @@ exports.SERVICE_ZH_TW = {
|
|
|
264
264
|
'ta.relay.unpair': '取消配對',
|
|
265
265
|
'ta.relay.unpairConfirm': '取消配對 {name}?它將無法再連到這台電腦上的 Ta。',
|
|
266
266
|
'ta.relay.keepAwake': '讓電腦保持喚醒',
|
|
267
|
-
'ta.relay.keepAwakeHint': '
|
|
267
|
+
'ta.relay.keepAwakeHint': '插著電源時一直不睡眠,下班把電腦留在公司,手機晚上也連得上;用電池時,只在有任務在跑或手機連過後的 30 分鐘內不睡眠。螢幕照常熄滅、鎖定,合上蓋子仍會睡眠。',
|
|
268
268
|
};
|
|
269
269
|
//# sourceMappingURL=service.js.map
|
|
@@ -62,6 +62,14 @@ exports.SETTINGS_ZH_TW = {
|
|
|
62
62
|
'ta.settings.diagramStyle.sketch': '草圖',
|
|
63
63
|
'ta.settings.diagramStyle.colour': '彩色',
|
|
64
64
|
'ta.settings.diagramStyle.motion': '動效',
|
|
65
|
+
'ta.settings.skin': '皮膚',
|
|
66
|
+
'ta.settings.skinHint': 'Ta 背後的畫面,各欄像玻璃一樣透出它。',
|
|
67
|
+
'ta.settings.skin.none': '無',
|
|
68
|
+
'ta.settings.glass': '玻璃',
|
|
69
|
+
'ta.settings.glassHint': '透出多少皮膚的畫面。',
|
|
70
|
+
'ta.settings.glass.clear': '清透',
|
|
71
|
+
'ta.settings.glass.soft': '柔和',
|
|
72
|
+
'ta.settings.glass.focus': '專注',
|
|
65
73
|
'ta.settings.fontSize': '字型大小',
|
|
66
74
|
'ta.settings.fontSizeHint': '整個頁面的文字。',
|
|
67
75
|
'ta.settings.chatFontSize': '對話字型大小',
|
|
@@ -35,6 +35,11 @@ exports.TOOLS_ZH_TW = {
|
|
|
35
35
|
'ta.tool.verb.deleteScheduled': '取消定時任務',
|
|
36
36
|
'ta.tool.verb.publish': '發布',
|
|
37
37
|
'ta.tool.verb.editImage': '編輯圖片',
|
|
38
|
+
'ta.tool.verb.generateImage': '生成圖片',
|
|
39
|
+
'ta.tool.verb.generateVideo': '生成影片',
|
|
40
|
+
'ta.tool.verb.findTools': '查找工具',
|
|
41
|
+
'ta.tool.verb.callTool': '呼叫工具',
|
|
42
|
+
'ta.tool.verb.notify': '傳送通知',
|
|
38
43
|
'ta.tool.verb.click': '點擊',
|
|
39
44
|
'ta.tool.verb.doubleClick': '雙擊',
|
|
40
45
|
'ta.tool.verb.rightClick': '右鍵點擊',
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { MessageId } from '../i18n/messages';
|
|
2
2
|
import type { TaNotices } from '../notices/notices-protocol';
|
|
3
3
|
import { type FoundLink } from './link-text';
|
|
4
|
-
/** What the Ta app on a phone posts to its page of the clipboard (`ta-clipboard`): a link may be there, or the text read when asked. */
|
|
5
|
-
export declare const CLIPBOARD_EVENT = "ta-clipboard";
|
|
6
4
|
/** What ClipboardLinks uses of the page. */
|
|
7
5
|
export interface ClipboardLinksHost {
|
|
8
6
|
/** The links of Ta in a text (TaLinks.find). */
|
|
@@ -40,9 +38,9 @@ export declare class SeenLinks {
|
|
|
40
38
|
*
|
|
41
39
|
* Cheap and quiet: nothing runs on a timer; the clipboard is read when the page comes to the front, at most once a
|
|
42
40
|
* second, and only where it may be read without asking the user (Ta Desktop; a browser that was allowed; the Ta app of
|
|
43
|
-
* Android, when it changed). The Ta app of iOS
|
|
44
|
-
*
|
|
45
|
-
* never offered back.
|
|
41
|
+
* Android, when it changed). The Ta app of iOS looks at nothing as Ta comes back: iOS tells without asking only that some
|
|
42
|
+
* web link is there, any link copied on the phone or on a Mac near it, so it offers a link of Ta when pasted, as a
|
|
43
|
+
* browser does. A text read is looked through once (LinkText); what the user copied in Ta itself is never offered back.
|
|
46
44
|
*/
|
|
47
45
|
export declare class ClipboardLinks {
|
|
48
46
|
protected readonly host: ClipboardLinksHost;
|
|
@@ -70,10 +68,8 @@ export declare class ClipboardLinks {
|
|
|
70
68
|
protected fresh(text: string): FoundLink[];
|
|
71
69
|
/** Pasted into any box of Ta: offered, unless the box opened it (a box for links). */
|
|
72
70
|
protected pasted(text: string): void;
|
|
73
|
-
/** Copied in Ta: never offered back, and the app of
|
|
71
|
+
/** Copied in Ta: never offered back, and the app of Android counts the clipboard as seen. */
|
|
74
72
|
protected mine(text: string, scope: Window & typeof globalThis): void;
|
|
75
|
-
/** What the Ta app of iOS said: a link may be in the clipboard, or the text read once the user tapped Open. */
|
|
76
|
-
protected heard(detail: unknown, scope: Window & typeof globalThis): void;
|
|
77
73
|
/** One notice: the words the link came with and what it is, and Open; for several, a button each. */
|
|
78
74
|
protected offer(found: readonly FoundLink[], from: From): void;
|
|
79
75
|
/** A button of several: its kind, or its words where two are of one kind. */
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClipboardLinks = exports.SeenLinks =
|
|
3
|
+
exports.ClipboardLinks = exports.SeenLinks = void 0;
|
|
4
4
|
const link_text_1 = require("./link-text");
|
|
5
|
-
/** What the Ta app on a phone posts to its page of the clipboard (`ta-clipboard`): a link may be there, or the text read when asked. */
|
|
6
|
-
exports.CLIPBOARD_EVENT = 'ta-clipboard';
|
|
7
5
|
/**
|
|
8
6
|
* The links of Ta offered once (docs/design/ta-links.md 7): kept by a hash of each, never the link, whose fragment holds
|
|
9
7
|
* its key; the newest {@link SeenLinks.MAX}, in the storage of the device.
|
|
@@ -69,9 +67,9 @@ SeenLinks.MAX = 200;
|
|
|
69
67
|
*
|
|
70
68
|
* Cheap and quiet: nothing runs on a timer; the clipboard is read when the page comes to the front, at most once a
|
|
71
69
|
* second, and only where it may be read without asking the user (Ta Desktop; a browser that was allowed; the Ta app of
|
|
72
|
-
* Android, when it changed). The Ta app of iOS
|
|
73
|
-
*
|
|
74
|
-
* never offered back.
|
|
70
|
+
* Android, when it changed). The Ta app of iOS looks at nothing as Ta comes back: iOS tells without asking only that some
|
|
71
|
+
* web link is there, any link copied on the phone or on a Mac near it, so it offers a link of Ta when pasted, as a
|
|
72
|
+
* browser does. A text read is looked through once (LinkText); what the user copied in Ta itself is never offered back.
|
|
75
73
|
*/
|
|
76
74
|
class ClipboardLinks {
|
|
77
75
|
constructor(host, seen = new SeenLinks(ClipboardLinks.storage())) {
|
|
@@ -90,13 +88,11 @@ class ClipboardLinks {
|
|
|
90
88
|
const visible = () => doc.visibilityState === 'visible' && this.check(scope);
|
|
91
89
|
const paste = (event) => { var _a; var _b; return this.pasted((_b = (_a = event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/plain')) !== null && _b !== void 0 ? _b : ''); };
|
|
92
90
|
const copy = (event) => this.mine(ClipboardLinks.selected(scope, event.target), scope);
|
|
93
|
-
const native = (event) => this.heard(event.detail, scope);
|
|
94
91
|
scope.addEventListener('focus', check);
|
|
95
92
|
doc.addEventListener('visibilitychange', visible);
|
|
96
93
|
doc.addEventListener('paste', paste, true);
|
|
97
94
|
doc.addEventListener('copy', copy, true);
|
|
98
95
|
doc.addEventListener('cut', copy, true);
|
|
99
|
-
scope.addEventListener(exports.CLIPBOARD_EVENT, native);
|
|
100
96
|
const stopOpen = this.host.onOpen(url => {
|
|
101
97
|
this.opened.add(url);
|
|
102
98
|
this.seen.add([url]);
|
|
@@ -109,7 +105,6 @@ class ClipboardLinks {
|
|
|
109
105
|
doc.removeEventListener('paste', paste, true);
|
|
110
106
|
doc.removeEventListener('copy', copy, true);
|
|
111
107
|
doc.removeEventListener('cut', copy, true);
|
|
112
|
-
scope.removeEventListener(exports.CLIPBOARD_EVENT, native);
|
|
113
108
|
stopOpen();
|
|
114
109
|
unwrap();
|
|
115
110
|
};
|
|
@@ -121,8 +116,8 @@ class ClipboardLinks {
|
|
|
121
116
|
}
|
|
122
117
|
/** Ta came to the front: what was copied meanwhile, where it may be read without asking. */
|
|
123
118
|
check(scope = window) {
|
|
124
|
-
var _a
|
|
125
|
-
var
|
|
119
|
+
var _a;
|
|
120
|
+
var _b;
|
|
126
121
|
const now = Date.now();
|
|
127
122
|
if (!this.ready || !this.host.enabled() || scope.document.visibilityState === 'hidden' || now - this.lastCheck < ClipboardLinks.THROTTLE_MS) {
|
|
128
123
|
return;
|
|
@@ -130,13 +125,10 @@ class ClipboardLinks {
|
|
|
130
125
|
this.lastCheck = now;
|
|
131
126
|
const native = scope;
|
|
132
127
|
if (native.taClipboardAndroid) {
|
|
133
|
-
this.take((
|
|
134
|
-
}
|
|
135
|
-
else if ((_b = (_a = native.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.taClipboard) {
|
|
136
|
-
native.webkit.messageHandlers.taClipboard.postMessage('peek');
|
|
128
|
+
this.take((_b = native.taClipboardAndroid.read()) !== null && _b !== void 0 ? _b : '', 'clipboard');
|
|
137
129
|
}
|
|
138
130
|
else if (this.readable && scope.document.hasFocus()) {
|
|
139
|
-
(
|
|
131
|
+
(_a = scope.navigator.clipboard) === null || _a === void 0 ? void 0 : _a.readText().then(text => this.take(text, 'clipboard'), () => undefined);
|
|
140
132
|
}
|
|
141
133
|
}
|
|
142
134
|
/** A text of the clipboard or pasted: its links of Ta not offered before, offered now. */
|
|
@@ -172,7 +164,7 @@ class ClipboardLinks {
|
|
|
172
164
|
}
|
|
173
165
|
}, ClipboardLinks.PASTE_WAIT_MS);
|
|
174
166
|
}
|
|
175
|
-
/** Copied in Ta: never offered back, and the app of
|
|
167
|
+
/** Copied in Ta: never offered back, and the app of Android counts the clipboard as seen. */
|
|
176
168
|
mine(text, scope) {
|
|
177
169
|
if (text) {
|
|
178
170
|
this.lastText = text;
|
|
@@ -180,41 +172,7 @@ class ClipboardLinks {
|
|
|
180
172
|
}
|
|
181
173
|
const native = scope;
|
|
182
174
|
// Once the clipboard holds it: the copy event comes before.
|
|
183
|
-
setTimeout(() => {
|
|
184
|
-
var _a, _b, _c, _d;
|
|
185
|
-
(_c = (_b = (_a = native.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.taClipboard) === null || _c === void 0 ? void 0 : _c.postMessage('mine');
|
|
186
|
-
(_d = native.taClipboardAndroid) === null || _d === void 0 ? void 0 : _d.mine();
|
|
187
|
-
}, 50);
|
|
188
|
-
}
|
|
189
|
-
/** What the Ta app of iOS said: a link may be in the clipboard, or the text read once the user tapped Open. */
|
|
190
|
-
heard(detail, scope) {
|
|
191
|
-
const said = (detail !== null && detail !== void 0 ? detail : {});
|
|
192
|
-
if (said.url === true && this.ready && this.host.enabled()) {
|
|
193
|
-
this.host.notices.notify(this.host.say('ta.clip.maybe'), {
|
|
194
|
-
level: 'info',
|
|
195
|
-
key: ClipboardLinks.KEY,
|
|
196
|
-
detail: this.host.say('ta.clip.maybeDetail'),
|
|
197
|
-
action: {
|
|
198
|
-
label: this.host.say('ta.clip.open'),
|
|
199
|
-
run: () => { var _a, _b, _c; return (_c = (_b = (_a = scope.webkit) === null || _a === void 0 ? void 0 : _a.messageHandlers) === null || _b === void 0 ? void 0 : _b.taClipboard) === null || _c === void 0 ? void 0 : _c.postMessage('read'); },
|
|
200
|
-
},
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
else if (typeof said.text === 'string') {
|
|
204
|
-
// The user asked: offered again if seen, opened at once when it is one.
|
|
205
|
-
const found = this.host.find(said.text);
|
|
206
|
-
this.lastText = said.text;
|
|
207
|
-
this.seen.add(found.map(link => link.url));
|
|
208
|
-
if (found.length === 1) {
|
|
209
|
-
this.host.open(found[0].url);
|
|
210
|
-
}
|
|
211
|
-
else if (found.length) {
|
|
212
|
-
this.offer(found, 'clipboard');
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
this.host.notices.notify(this.host.say('ta.clip.none'), { level: 'info', key: ClipboardLinks.KEY });
|
|
216
|
-
}
|
|
217
|
-
}
|
|
175
|
+
setTimeout(() => { var _a; return (_a = native.taClipboardAndroid) === null || _a === void 0 ? void 0 : _a.mine(); }, 50);
|
|
218
176
|
}
|
|
219
177
|
/** One notice: the words the link came with and what it is, and Open; for several, a button each. */
|
|
220
178
|
offer(found, from) {
|