@celljs/ta-web 4.43.0 → 4.44.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.
Files changed (171) hide show
  1. package/esm/browser/apps/app-window.js +2 -2
  2. package/esm/browser/assistant/assistant-chat-list.js +2 -1
  3. package/esm/browser/assistant/assistant-extension.js +16 -2
  4. package/esm/browser/assistant/assistant-protocol.d.ts +6 -0
  5. package/esm/browser/assistant/assistant-task-source.js +3 -0
  6. package/esm/browser/assistant/assistant-task-util.d.ts +2 -0
  7. package/esm/browser/assistant/assistant-task-util.js +5 -0
  8. package/esm/browser/assistant/assistant.d.ts +3 -0
  9. package/esm/browser/assistant/assistant.js +26 -2
  10. package/esm/browser/components/app-shell-hooks.d.ts +2 -1
  11. package/esm/browser/components/app-shell-hooks.js +4 -3
  12. package/esm/browser/components/app-shell-state.js +2 -2
  13. package/esm/browser/components/chat-list-row.js +4 -4
  14. package/esm/browser/components/chat-list-util.d.ts +2 -2
  15. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  16. package/esm/browser/components/custom-host.d.ts +4 -1
  17. package/esm/browser/components/custom-host.js +8 -2
  18. package/esm/browser/components/earlier-messages.d.ts +4 -1
  19. package/esm/browser/components/earlier-messages.js +5 -2
  20. package/esm/browser/components/host-view.d.ts +1 -1
  21. package/esm/browser/components/message-list.js +2 -1
  22. package/esm/browser/components/message-steps.js +8 -5
  23. package/esm/browser/components/settings-choices.d.ts +2 -1
  24. package/esm/browser/components/settings-choices.js +2 -1
  25. package/esm/browser/components/settings-parts.js +23 -3
  26. package/esm/browser/components/share-dialog.js +1 -1
  27. package/esm/browser/components/share-friends.d.ts +18 -2
  28. package/esm/browser/components/share-friends.js +62 -4
  29. package/esm/browser/components/share-sheet.d.ts +4 -3
  30. package/esm/browser/components/share-sheet.js +11 -3
  31. package/esm/browser/extension/web-api-chats.d.ts +23 -0
  32. package/esm/browser/extension/web-api-skins.d.ts +95 -0
  33. package/esm/browser/extension/web-api-skins.js +2 -0
  34. package/esm/browser/extension/web-api-spec.js +2 -0
  35. package/esm/browser/extension/web-extension-api.d.ts +4 -25
  36. package/esm/browser/extension/web-extension-context.js +1 -0
  37. package/esm/browser/extension/web-extension-protocol.d.ts +3 -1
  38. package/esm/browser/extension/web-extension-protocol.js +1 -0
  39. package/esm/browser/extension/web-extension-run.d.ts +3 -2
  40. package/esm/browser/extension/web-extension-run.js +3 -0
  41. package/esm/browser/extension/web-share-ui.js +6 -1
  42. package/esm/browser/i18n/en/assistant.d.ts +4 -0
  43. package/esm/browser/i18n/en/assistant.js +4 -0
  44. package/esm/browser/i18n/en/common.d.ts +0 -3
  45. package/esm/browser/i18n/en/common.js +0 -3
  46. package/esm/browser/i18n/en/discover.d.ts +4 -1
  47. package/esm/browser/i18n/en/discover.js +4 -1
  48. package/esm/browser/i18n/en/settings.d.ts +8 -0
  49. package/esm/browser/i18n/en/settings.js +8 -0
  50. package/esm/browser/i18n/ja/assistant.js +4 -0
  51. package/esm/browser/i18n/ja/common.js +0 -3
  52. package/esm/browser/i18n/ja/discover.js +4 -1
  53. package/esm/browser/i18n/ja/settings.js +8 -0
  54. package/esm/browser/i18n/locales.d.ts +17 -5
  55. package/esm/browser/i18n/messages.d.ts +16 -4
  56. package/esm/browser/i18n/zh/assistant.js +4 -0
  57. package/esm/browser/i18n/zh/common.js +0 -3
  58. package/esm/browser/i18n/zh/discover.js +4 -1
  59. package/esm/browser/i18n/zh/settings.js +8 -0
  60. package/esm/browser/i18n/zh-tw/assistant.js +4 -0
  61. package/esm/browser/i18n/zh-tw/common.js +0 -3
  62. package/esm/browser/i18n/zh-tw/discover.js +4 -1
  63. package/esm/browser/i18n/zh-tw/settings.js +8 -0
  64. package/esm/browser/links/clipboard-links.d.ts +4 -8
  65. package/esm/browser/links/clipboard-links.js +9 -51
  66. package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
  67. package/esm/browser/settings/settings-protocol.d.ts +24 -0
  68. package/esm/browser/settings/settings-protocol.js +9 -0
  69. package/esm/browser/settings/settings.d.ts +4 -1
  70. package/esm/browser/settings/settings.js +16 -3
  71. package/esm/browser/skin/skin-layer.d.ts +8 -0
  72. package/esm/browser/skin/skin-layer.js +118 -0
  73. package/esm/browser/skin/skin-util.d.ts +40 -0
  74. package/esm/browser/skin/skin-util.js +120 -0
  75. package/esm/browser/style/conversation.d.ts +1 -1
  76. package/esm/browser/style/conversation.js +3 -2
  77. package/esm/browser/style/skins.d.ts +9 -0
  78. package/esm/browser/style/skins.js +107 -0
  79. package/esm/browser/style/surfaces.d.ts +1 -1
  80. package/esm/browser/style/surfaces.js +8 -0
  81. package/esm/browser/style.js +2 -0
  82. package/esm/browser/util/fresh-rows.d.ts +21 -0
  83. package/esm/browser/util/fresh-rows.js +36 -0
  84. package/esm/browser/util/process.d.ts +12 -22
  85. package/esm/browser/util/process.js +49 -39
  86. package/lib/browser/apps/app-window.js +2 -2
  87. package/lib/browser/assistant/assistant-chat-list.js +2 -1
  88. package/lib/browser/assistant/assistant-extension.js +15 -1
  89. package/lib/browser/assistant/assistant-protocol.d.ts +6 -0
  90. package/lib/browser/assistant/assistant-task-source.js +3 -0
  91. package/lib/browser/assistant/assistant-task-util.d.ts +2 -0
  92. package/lib/browser/assistant/assistant-task-util.js +5 -0
  93. package/lib/browser/assistant/assistant.d.ts +3 -0
  94. package/lib/browser/assistant/assistant.js +26 -2
  95. package/lib/browser/components/app-shell-hooks.d.ts +2 -1
  96. package/lib/browser/components/app-shell-hooks.js +4 -3
  97. package/lib/browser/components/app-shell-state.js +2 -2
  98. package/lib/browser/components/chat-list-row.js +4 -4
  99. package/lib/browser/components/chat-list-util.d.ts +2 -2
  100. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  101. package/lib/browser/components/custom-host.d.ts +4 -1
  102. package/lib/browser/components/custom-host.js +8 -2
  103. package/lib/browser/components/earlier-messages.d.ts +4 -1
  104. package/lib/browser/components/earlier-messages.js +5 -2
  105. package/lib/browser/components/host-view.d.ts +1 -1
  106. package/lib/browser/components/message-list.js +2 -1
  107. package/lib/browser/components/message-steps.js +8 -5
  108. package/lib/browser/components/settings-choices.d.ts +2 -1
  109. package/lib/browser/components/settings-choices.js +2 -1
  110. package/lib/browser/components/settings-parts.js +21 -1
  111. package/lib/browser/components/share-dialog.js +1 -1
  112. package/lib/browser/components/share-friends.d.ts +18 -2
  113. package/lib/browser/components/share-friends.js +65 -4
  114. package/lib/browser/components/share-sheet.d.ts +4 -3
  115. package/lib/browser/components/share-sheet.js +10 -2
  116. package/lib/browser/extension/web-api-chats.d.ts +23 -0
  117. package/lib/browser/extension/web-api-skins.d.ts +96 -0
  118. package/lib/browser/extension/web-api-skins.js +3 -0
  119. package/lib/browser/extension/web-api-spec.js +2 -0
  120. package/lib/browser/extension/web-extension-api.d.ts +4 -25
  121. package/lib/browser/extension/web-extension-context.js +1 -0
  122. package/lib/browser/extension/web-extension-protocol.d.ts +3 -1
  123. package/lib/browser/extension/web-extension-protocol.js +1 -0
  124. package/lib/browser/extension/web-extension-run.d.ts +3 -2
  125. package/lib/browser/extension/web-extension-run.js +3 -0
  126. package/lib/browser/extension/web-share-ui.js +6 -1
  127. package/lib/browser/i18n/en/assistant.d.ts +4 -0
  128. package/lib/browser/i18n/en/assistant.js +4 -0
  129. package/lib/browser/i18n/en/common.d.ts +0 -3
  130. package/lib/browser/i18n/en/common.js +0 -3
  131. package/lib/browser/i18n/en/discover.d.ts +4 -1
  132. package/lib/browser/i18n/en/discover.js +4 -1
  133. package/lib/browser/i18n/en/settings.d.ts +8 -0
  134. package/lib/browser/i18n/en/settings.js +8 -0
  135. package/lib/browser/i18n/ja/assistant.js +4 -0
  136. package/lib/browser/i18n/ja/common.js +0 -3
  137. package/lib/browser/i18n/ja/discover.js +4 -1
  138. package/lib/browser/i18n/ja/settings.js +8 -0
  139. package/lib/browser/i18n/locales.d.ts +17 -5
  140. package/lib/browser/i18n/messages.d.ts +16 -4
  141. package/lib/browser/i18n/zh/assistant.js +4 -0
  142. package/lib/browser/i18n/zh/common.js +0 -3
  143. package/lib/browser/i18n/zh/discover.js +4 -1
  144. package/lib/browser/i18n/zh/settings.js +8 -0
  145. package/lib/browser/i18n/zh-tw/assistant.js +4 -0
  146. package/lib/browser/i18n/zh-tw/common.js +0 -3
  147. package/lib/browser/i18n/zh-tw/discover.js +4 -1
  148. package/lib/browser/i18n/zh-tw/settings.js +8 -0
  149. package/lib/browser/links/clipboard-links.d.ts +4 -8
  150. package/lib/browser/links/clipboard-links.js +10 -52
  151. package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
  152. package/lib/browser/settings/settings-protocol.d.ts +24 -0
  153. package/lib/browser/settings/settings-protocol.js +10 -1
  154. package/lib/browser/settings/settings.d.ts +4 -1
  155. package/lib/browser/settings/settings.js +16 -3
  156. package/lib/browser/skin/skin-layer.d.ts +9 -0
  157. package/lib/browser/skin/skin-layer.js +154 -0
  158. package/lib/browser/skin/skin-util.d.ts +41 -0
  159. package/lib/browser/skin/skin-util.js +123 -0
  160. package/lib/browser/style/conversation.d.ts +1 -1
  161. package/lib/browser/style/conversation.js +3 -2
  162. package/lib/browser/style/skins.d.ts +10 -0
  163. package/lib/browser/style/skins.js +110 -0
  164. package/lib/browser/style/surfaces.d.ts +1 -1
  165. package/lib/browser/style/surfaces.js +8 -0
  166. package/lib/browser/style.js +2 -0
  167. package/lib/browser/util/fresh-rows.d.ts +22 -0
  168. package/lib/browser/util/fresh-rows.js +40 -0
  169. package/lib/browser/util/process.d.ts +12 -22
  170. package/lib/browser/util/process.js +49 -40
  171. package/package.json +7 -7
@@ -63,12 +63,14 @@ function Tile({ icon: Icon, label, onClick, disabled }) {
63
63
  React.createElement(Icon, { size: 20 })),
64
64
  React.createElement("span", { className: "ta-share-tile-label" }, label)));
65
65
  }
66
- function ShareSheet({ title, link, error, face, name, gets, invite, notes, password, own, onRenew, onStop, stop, onClose, children, notices, rooms, }) {
66
+ function ShareSheet({ title, link, error, face, name, gets, invite, notes, password, own, onRenew, onStop, stop, onClose, children, notices, rooms, onRoomEvent, }) {
67
67
  const t = (0, use_t_1.useT)();
68
68
  const [copied, copy] = useCopied();
69
69
  const [stopping, setStopping] = React.useState(false);
70
70
  const [picking, setPicking] = React.useState(false);
71
71
  const friends = (0, share_friends_1.useShareFriends)(rooms);
72
+ const [sends, setSends] = React.useState(0);
73
+ const sent = (0, share_friends_1.useFriendSends)(rooms, own ? undefined : link, sends, onRoomEvent);
72
74
  const canFriends = !own && !!(friends === null || friends === void 0 ? void 0 : friends.length);
73
75
  const canSend = !own && typeof navigator !== 'undefined' && typeof navigator.share === 'function';
74
76
  const end = async () => {
@@ -103,11 +105,17 @@ function ShareSheet({ title, link, error, face, name, gets, invite, notes, passw
103
105
  " ",
104
106
  React.createElement("code", null, password)),
105
107
  React.createElement("button", { type: "button", className: "ta-button", onClick: () => copy(password, 'password') }, copied === 'password' ? t('ta.share.copied') : t('ta.share.copyPassword')))),
106
- picking && link && friends ? (React.createElement(share_friends_1.ShareToFriends, { rooms: rooms, notices: notices, friends: friends, link: link, title: name || title, onDone: () => setPicking(false) })) : (React.createElement("div", { className: "ta-share-tiles" },
108
+ picking && link && friends ? (React.createElement(share_friends_1.ShareToFriends, { rooms: rooms, notices: notices, friends: friends, link: link, title: name || title, onDone: done => {
109
+ setPicking(false);
110
+ if (done) {
111
+ setSends(n => n + 1);
112
+ }
113
+ } })) : (React.createElement("div", { className: "ta-share-tiles" },
107
114
  canFriends && React.createElement(Tile, { icon: lucide_react_1.Send, label: t('ta.share.friends'), disabled: !link, onClick: () => setPicking(true) }),
108
115
  React.createElement(Tile, { icon: copied === 'link' ? lucide_react_1.Check : lucide_react_1.Copy, label: copied === 'link' ? t('ta.share.copied') : t('ta.share.copy'), disabled: !link, onClick: () => link && copy((0, share_sheet_compat_1.shareMessage)(invite, link), 'link') }),
109
116
  canSend && (React.createElement(Tile, { icon: lucide_react_1.Share2, label: t('ta.share.apps'), disabled: !link, onClick: () => link && void navigator.share({ title: name || title, text: invite, url: link }).catch(() => undefined) })),
110
117
  onRenew && React.createElement(Tile, { icon: lucide_react_1.RefreshCw, label: t('ta.share.renew'), disabled: !link, onClick: onRenew }))),
118
+ !picking && React.createElement(share_friends_1.FriendSends, { sent: sent }),
111
119
  children,
112
120
  lines.length > 0 && (React.createElement("div", { className: "ta-share-notes" }, lines.map(line => (React.createElement("p", { key: line }, line))))),
113
121
  onStop && link && (React.createElement("button", { type: "button", className: `ta-share-stop${stopping ? ' ta-busy' : ''}`, disabled: stopping, onClick: () => void end() },
@@ -78,4 +78,27 @@ export interface WebChatIconSource {
78
78
  /** What `icon` answers changed: the lists draw their rows again. */
79
79
  subscribe?(listener: () => void): () => void;
80
80
  }
81
+ /** What a session still opening is shown as (`switchSession`): the head of its conversation, till it comes. */
82
+ export interface WebSessionOpening {
83
+ title?: string;
84
+ cwd?: string;
85
+ /** Its session file, when known: what the device kept of the conversation shows while it opens, and while the computer cannot be reached. */
86
+ sessionFile?: string;
87
+ }
88
+ /** What a notice of an extension has besides its message (WebExtensionUI.notify). */
89
+ export interface WebNotifyOptions {
90
+ action?: {
91
+ label: string;
92
+ run(): void;
93
+ };
94
+ key?: string;
95
+ /** Ta did it for the user: drawn with the double's face, the message as its head (`修改了设置`). */
96
+ ta?: boolean;
97
+ /** What it changed, a row each under the message: `{ label: '通话字幕', before: '关', after: '开' }`, or a name alone. */
98
+ changes?: {
99
+ label?: string;
100
+ before?: string;
101
+ after: string;
102
+ }[];
103
+ }
81
104
  //# sourceMappingURL=web-api-chats.d.ts.map
@@ -0,0 +1,96 @@
1
+ import type * as React from 'react';
2
+ import type { SkinGlass } from '../settings/settings-protocol';
3
+ import type { WebLabel } from './web-api-contributions';
4
+ /** Light glass with dark words, or dark glass with light words. */
5
+ export type WebSkinTone = 'light' | 'dark';
6
+ /** How much of the picture the columns of Ta let through: clear, soft (the default), or focus, nearly solid (Settings → Appearance). */
7
+ export type WebSkinGlass = SkinGlass;
8
+ /**
9
+ * The colours of a tone of a skin, each a CSS colour without alpha; Ta makes every surface, word and line of its
10
+ * columns from them (docs/design/ta-skins.md 3). Any it leaves out is Ta's own.
11
+ */
12
+ export interface WebSkinColors {
13
+ /** What the picture shows before it draws (it loads, it starts again), under it, and the window's own colour. */
14
+ base: string;
15
+ /** The glass of the columns, made more or less clear by the user's choice (WebSkinGlass). */
16
+ glass?: string;
17
+ /** Words: titles in it, the body and the quieter lines mixed toward the glass. */
18
+ ink?: string;
19
+ /** What stands out: the brand buttons, links, what is chosen. */
20
+ accent?: string;
21
+ }
22
+ /** A rectangle of the window, in CSS pixels. */
23
+ export interface WebSkinRect {
24
+ left: number;
25
+ top: number;
26
+ right: number;
27
+ bottom: number;
28
+ }
29
+ /** Where the picture is under Ta now (WebSkinBackdropProps.areas). */
30
+ export interface WebSkinAreas {
31
+ /** Where words are read (the conversation, the message box, the settings): the picture is calmest behind them. */
32
+ read: WebSkinRect[];
33
+ /** Where columns cover it (the list of chats, the workbench, the navigation): what matters is not put there. */
34
+ cover: WebSkinRect[];
35
+ }
36
+ /** What a backdrop is given: it draws the whole window, behind every column of Ta, and never takes the pointer. */
37
+ export interface WebSkinBackdropProps {
38
+ /** The tone Ta shows in now. */
39
+ tone: WebSkinTone;
40
+ /** How clear the user wants the glass. */
41
+ glass: WebSkinGlass;
42
+ /**
43
+ * Sets the tone of Ta while the skin shows (its night, its day), as a theme of the settings would; undefined gives
44
+ * it back to `WebSkin.tone`, else the user's theme. Ta switches once, not to and fro: tell it a new tone only past a margin.
45
+ */
46
+ setTone(tone: WebSkinTone | undefined): void;
47
+ /** Where words are read and where columns cover the picture, now: read it each frame, it costs little. */
48
+ areas(): WebSkinAreas;
49
+ /** It has drawn its first frame: Ta fades it in over its picture (`keep`) and lets the one before go. */
50
+ ready(): void;
51
+ /**
52
+ * A small picture of how it looks now (a `data:` URL of a JPEG some 480 pixels wide): kept on this device, shown
53
+ * under it the next time while it loads, or while it starts again, so that the window never shows blank.
54
+ */
55
+ keep(picture: string): void;
56
+ }
57
+ /**
58
+ * A look of Ta: a picture behind it, which its columns show through as glass (`registerSkin`). The user picks it
59
+ * in Settings → Appearance, as the theme; Ta draws the glass, the words, the title bar and the window in its colours,
60
+ * so a skin is its picture and a few colours, never styles of Ta's own classes.
61
+ */
62
+ export interface WebSkin {
63
+ /** Unique among the skins of the extension. */
64
+ id: string;
65
+ title: WebLabel;
66
+ /** Drawn behind Ta, the size of the window: a picture, a 3D world (`ui.Game3D`), anything. */
67
+ backdrop: React.ComponentType<WebSkinBackdropProps>;
68
+ /** Its colours in each tone. */
69
+ colors: {
70
+ light: WebSkinColors;
71
+ dark: WebSkinColors;
72
+ };
73
+ /** Its tone while its backdrop sets none; default the user's theme. */
74
+ tone?: WebSkinTone;
75
+ /**
76
+ * Its backdrop softens itself behind the columns and the words (`areas`), as a 3D world does in its last pass: the
77
+ * page does not blur it again, which would cost a blur of the window at each of its frames. Without, the page blurs
78
+ * what is behind its columns, which a still picture costs nothing.
79
+ */
80
+ softens?: boolean;
81
+ }
82
+ export interface WebSkinsAPI {
83
+ /**
84
+ * A look of Ta: a picture behind it and the colours of its glass (docs/design/ta-skins.md), which the user picks in
85
+ * Settings → Appearance. Newer than some Ta apps: `pi.registerSkin?.(…)`.
86
+ */
87
+ registerSkin(skin: WebSkin): void;
88
+ }
89
+ /** A skin of an extension, as Ta lists them. */
90
+ export interface WebSkinEntry {
91
+ /** `<package name>/<skin id>`: what the settings keep, the same on every device. */
92
+ id: string;
93
+ extension: string;
94
+ skin: WebSkin;
95
+ }
96
+ //# sourceMappingURL=web-api-skins.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=web-api-skins.js.map
@@ -184,6 +184,8 @@ exports.WEB_API_SPEC = {
184
184
  registerToolRenderer: page,
185
185
  registerComposerAddon: page,
186
186
  registerRoomAddon: page,
187
+ // Its backdrop is drawn behind the page, given functions: only in the page.
188
+ registerSkin: page,
187
189
  registerOpener: page,
188
190
  registerSearch: page,
189
191
  registerPartners: page,
@@ -6,7 +6,7 @@ import type { ScreenPartSpec, TaScreen } from '../screen/screen-protocol';
6
6
  import type { Language, Theme } from '../settings/settings-protocol';
7
7
  import type { WebCodeRendererOptions, WebCodeRendererProps } from './web-api-code';
8
8
  import type { CodeEditorProps, DiffEditorProps, WebAvatarProps, WebChatImagesProps, 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';
9
- import type { WebAsk, WebCallsAPI, WebChatIconSource, WebChatTagsAPI, WebComposerAddon, WebCustomMessage, WebHomeSource, WebInitiative, WebMenuItem, WebOpener, WebOpenerOptions, WebRoomAddon, WebRoomAddonEntry, WebSearchSource, WebSessionNotice, WebSettingsSection, WebShareTarget, WebTaskEntry, WebTaskRemoval, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebViewInfo, WidgetOptions } from './web-api-contributions';
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';
10
10
  import type { WebDesktop, WebDeviceUI, WebFileDrag } from './web-api-desktop';
11
11
  import type { WebEditorsUI } from './web-api-editors';
12
12
  import type { WebFileViews, WebFileViewsUI } from './web-api-file-views';
@@ -16,6 +16,7 @@ import type { WebHosts } from './web-api-hosts';
16
16
  import type { WebFileRef, WebMenus, WebShareUI } from './web-api-menus';
17
17
  import type { WebPlayUI } from './web-api-play';
18
18
  import type { WebServices } from './web-api-services';
19
+ import type { WebSkinsAPI } from './web-api-skins';
19
20
  import type { WebPackageStorage } from './web-api-storage';
20
21
  import type { WebTargetsAPI } from './web-api-targets';
21
22
  import type { WebTerminal, WebTerminalOptions } from './web-api-terminal';
@@ -39,6 +40,7 @@ export type * from './web-api-hosts';
39
40
  export type * from './web-api-menus';
40
41
  export type * from './web-api-play';
41
42
  export type * from './web-api-services';
43
+ export type * from './web-api-skins';
42
44
  export type * from './web-api-storage';
43
45
  export type * from './web-api-targets';
44
46
  export type * from './web-api-terminal';
@@ -47,7 +49,7 @@ export type { WebPageInfo, WebPageState } from './web-pages';
47
49
  * What a web extension gets: the web client's side of pi's extension API, its names where they mean the same. A web
48
50
  * extension is one ES module without imports, the `web` part of a pi package (TaWebExtensionInfo): a {@link WebExtensionFactory}.
49
51
  */
50
- export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus, WebFileViews, WebCallsAPI, WebChatTagsAPI, WebTargetsAPI, WebHostAPI {
52
+ export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus, WebFileViews, WebCallsAPI, WebChatTagsAPI, WebTargetsAPI, WebHostAPI, WebSkinsAPI {
51
53
  /** The React of the page: an extension brings no React of its own. */
52
54
  readonly React: typeof React;
53
55
  readonly ui: WebExtensionUI;
@@ -179,34 +181,11 @@ export interface WebExtensionAPI extends WebServices, WebPartnersAPI, WebMenus,
179
181
  /** Output of the terminals this page opened (terminals.openTerminal); with `exitCode`, the terminal ended. Stops when the extension unloads. */
180
182
  onTerminalData(listener: (terminalId: string, data: string, exitCode?: number) => void): () => void;
181
183
  }
182
- /** What a session still opening is shown as (`switchSession`): the head of its conversation, till it comes. */
183
- export interface WebSessionOpening {
184
- title?: string;
185
- cwd?: string;
186
- /** Its session file, when known: what the device kept of the conversation shows while it opens, and while the computer cannot be reached. */
187
- sessionFile?: string;
188
- }
189
184
  /** An icon, drawn at `size` pixels in `currentColor`. */
190
185
  export type WebIcon = React.ComponentType<{
191
186
  size?: number | string;
192
187
  strokeWidth?: number | string;
193
188
  }>;
194
- /** What a notice of an extension has besides its message (WebExtensionUI.notify). */
195
- export interface WebNotifyOptions {
196
- action?: {
197
- label: string;
198
- run(): void;
199
- };
200
- key?: string;
201
- /** Ta did it for the user: drawn with the double's face, the message as its head (`修改了设置`). */
202
- ta?: boolean;
203
- /** What it changed, a row each under the message: `{ label: '通话字幕', before: '关', after: '开' }`, or a name alone. */
204
- changes?: {
205
- label?: string;
206
- before?: string;
207
- after: string;
208
- }[];
209
- }
210
189
  /** What web extensions see of TaScreen. */
211
190
  export type WebScreen = Pick<TaScreen, 'agent' | 'parts' | 'act' | 'element' | 'where' | 'places' | 'go' | 'pageScroll' | 'scroll'>;
212
191
  export interface WebExtensionUI extends WebHomeUI, WebPartnersUI, WebEditorsUI, WebDeviceUI, WebPlayUI, WebShareUI, WebFileViewsUI, WebHostUI {
@@ -232,6 +232,7 @@ class WebExtensionContext {
232
232
  registerSearch: source => register(() => run.searches.push(source)),
233
233
  registerComposerAddon: addon => register(() => run.composerAddons.push(addon)),
234
234
  registerRoomAddon: addon => register(() => run.roomAddons.push(addon)),
235
+ registerSkin: skin => register(() => run.skins.push(skin)),
235
236
  registerSettings: section => register(() => run.settingsSections.push(section)),
236
237
  registerSessionMenu: menu => register(() => run.sessionMenus.push(web_extension_run_1.WebExtensionRunUtil.menu(run, menu))),
237
238
  registerFileMenu: menu => register(() => run.fileMenus.push(web_extension_run_1.WebExtensionRunUtil.menu(run, menu))),
@@ -2,7 +2,7 @@ import type { TaEvent, TaTemporaryFrom, TaWebExtensionInfo } from '@celljs/ta-pr
2
2
  import type * as React from 'react';
3
3
  import type { MessageId } from '../i18n/messages';
4
4
  import type { BlockSpeech } from '../util/spoken';
5
- import type { WebAvatarProps, WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebFileMenu, WebFileView, WebHomeEntry, WebIcon, WebImage, WebInitiative, WebLabel, WebLinkDescriber, WebMenuItem, WebOpener, WebPageGroup, WebRoomAddonEntry, WebSearchSource, WebSessionMenu, WebSessionOpening, WebSettingsSection, WebShareItem, WebShareTarget, WebShareWay, WebTool, WebToolRendererResolver, WebViewLocation, WebViewPreview, WidgetOptions } from './web-extension-api';
5
+ import type { WebAvatarProps, WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebCodeRendererProps, WebComposerAddon, WebCustomMessage, WebEditor, WebExtensionFactory, WebFileMenu, WebFileView, WebHomeEntry, WebIcon, WebImage, WebInitiative, WebLabel, WebLinkDescriber, WebMenuItem, WebOpener, WebPageGroup, WebRoomAddonEntry, WebSearchSource, WebSessionMenu, WebSessionOpening, WebSettingsSection, WebShareItem, WebShareTarget, WebShareWay, WebSkinEntry, WebTool, WebToolRendererResolver, WebViewLocation, WebViewPreview, WidgetOptions } from './web-extension-api';
6
6
  import type { WebHomeBoard } from './web-home';
7
7
  import type { PageUsage, WebPageInfo } from './web-pages';
8
8
  import type { WebPartnerBoard } from './web-partners';
@@ -117,6 +117,8 @@ export interface WebExtensionsState {
117
117
  composerAddons: WebComposerAddonEntry[];
118
118
  /** What extensions add to the rooms (WebExtensionAPI.registerRoomAddon). */
119
119
  roomAddons: WebRoomAddonEntry[];
120
+ /** The looks extensions give Ta (WebExtensionAPI.registerSkin), in the order they loaded. */
121
+ skins: WebSkinEntry[];
120
122
  /** The sections extensions add to the settings (WebExtensionAPI.registerSettings). */
121
123
  settingsSections: WebSettingsEntry[];
122
124
  renderers: Record<string, React.ComponentType<{
@@ -13,6 +13,7 @@ var WebExtensionsStateUtil;
13
13
  widgets: [],
14
14
  composerAddons: [],
15
15
  roomAddons: [],
16
+ skins: [],
16
17
  settingsSections: [],
17
18
  renderers: {},
18
19
  codeRenderers: {},
@@ -1,6 +1,6 @@
1
1
  import type { TaEvent } from '@celljs/ta-protocol';
2
2
  import type * as React from 'react';
3
- import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebCodeRendererOptions, WebComposerAddon, WebFileMenu, WebFileView, WebHomeSource, WebInitiative, WebLinkDescriber, WebMenuItem, WebOpener, WebOpenerOptions, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebShareWay, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api';
3
+ import type { WebCallMouth, WebCallMoves, WebCallPartner, WebChatIconSource, WebChatTagSource, WebCodeMenu, WebCodeRendererOptions, WebComposerAddon, WebFileMenu, WebFileView, WebHomeSource, WebInitiative, WebLinkDescriber, WebMenuItem, WebOpener, WebOpenerOptions, WebPartnerSource, WebRoomAddon, WebSearchSource, WebSessionMenu, WebSettingsSection, WebShareWay, WebSkin, WebTaskSource, WebTool, WebToolRendererResolver, WebView, WebVoice, WidgetOptions } from './web-extension-api';
4
4
  import type { LoadedWebExtension, WebExtensionsState } from './web-extension-protocol';
5
5
  /** What an extension registered through its API: all of it goes when it stops. */
6
6
  export interface WebRegistrations {
@@ -37,6 +37,7 @@ export interface WebRegistrations {
37
37
  searches: WebSearchSource[];
38
38
  composerAddons: WebComposerAddon[];
39
39
  roomAddons: WebRoomAddon[];
40
+ skins: WebSkin[];
40
41
  fileViews: WebFileView[];
41
42
  settingsSections: WebSettingsSection[];
42
43
  handlers: {
@@ -83,6 +84,6 @@ export declare namespace WebExtensionRunUtil {
83
84
  */
84
85
  function voice(run: WebExtensionRun, voice: WebVoice): WebVoice;
85
86
  /** What the extensions that run registered, as the page shows it: the first of a message type or a tool name wins. */
86
- function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'linkDescribers' | 'sessionMenus' | 'fileMenus' | 'fileViews' | 'codeMenus' | 'shareWays' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'codePointable' | 'callPartner' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
87
+ function collect(runs: readonly WebExtensionRun[], onOpen: (id: string) => boolean): Pick<WebExtensionsState, 'openers' | 'specificOpeners' | 'linkDescribers' | 'sessionMenus' | 'fileMenus' | 'fileViews' | 'codeMenus' | 'shareWays' | 'extensions' | 'views' | 'widgets' | 'composerAddons' | 'roomAddons' | 'skins' | 'settingsSections' | 'renderers' | 'codeRenderers' | 'codeSpeech' | 'codePointable' | 'callPartner' | 'callGroup' | 'callMouth' | 'callMoves' | 'avatars' | 'chatIcons' | 'chatTags' | 'initiatives' | 'tools' | 'toolRenderers' | 'searches'>;
87
88
  }
88
89
  //# sourceMappingURL=web-extension-run.d.ts.map
@@ -118,6 +118,7 @@ var WebExtensionRunUtil;
118
118
  searches: [],
119
119
  composerAddons: [],
120
120
  roomAddons: [],
121
+ skins: [],
121
122
  fileViews: [],
122
123
  settingsSections: [],
123
124
  handlers: [],
@@ -261,6 +262,8 @@ var WebExtensionRunUtil;
261
262
  }); })),
262
263
  composerAddons: runs.flatMap(run => run.composerAddons.map((addon, index) => ({ id: `${run.loaded.id}/${index}`, extension: run.loaded.id, addon }))),
263
264
  roomAddons: runs.flatMap(run => run.roomAddons.map((addon, index) => ({ id: `${run.loaded.id}/${index}`, extension: run.loaded.id, addon }))),
265
+ // By the name of the package, which the settings keep: the same on every device.
266
+ skins: runs.flatMap(run => run.skins.map(skin => ({ id: `${run.loaded.name}/${skin.id}`, extension: run.loaded.name, skin }))),
264
267
  settingsSections: runs.flatMap(run => run.settingsSections.map((section, index) => ({ id: `${run.loaded.id}/${index}`, extension: run.loaded.id, section }))),
265
268
  renderers,
266
269
  codeRenderers,
@@ -41,7 +41,12 @@ const share_sheet_1 = require("../components/share-sheet");
41
41
  * (`share`, its tiles the ways to share), and handing an extension on. None of it does anything once it stopped.
42
42
  */
43
43
  function shareUI(host, stopped) {
44
- const sheet = (props) => React.createElement(share_sheet_1.ShareSheet, { ...props, notices: host.notices, rooms: host.workbench.rooms });
44
+ const sheet = (props) => React.createElement(share_sheet_1.ShareSheet, {
45
+ ...props,
46
+ notices: host.notices,
47
+ rooms: host.workbench.rooms,
48
+ onRoomEvent: listener => host.workbench.onRoomEvent(listener, { messages: false }),
49
+ });
45
50
  return {
46
51
  shareExtension: target => !stopped() && host.extensions.share(target),
47
52
  share: item => !stopped() && host.extensions.shareItem(item),
@@ -24,6 +24,9 @@ export declare const ASSISTANT_EN: {
24
24
  'ta.assistant.speakStopShort': string;
25
25
  'ta.assistant.poke': string;
26
26
  'ta.assistant.stop': string;
27
+ 'ta.assistant.pauseTasks': string;
28
+ 'ta.assistant.resumeTasks': string;
29
+ 'ta.assistant.pausedTasks': string;
27
30
  'ta.assistant.restart': string;
28
31
  'ta.assistant.restartTitle': string;
29
32
  'ta.assistant.restartHint': string;
@@ -78,6 +81,7 @@ export declare const ASSISTANT_EN: {
78
81
  'ta.task.verdictFail': string;
79
82
  'ta.task.branch': string;
80
83
  'ta.task.stopped': string;
84
+ 'ta.task.paused': string;
81
85
  'ta.task.waiting': string;
82
86
  'ta.task.waitingPermission': string;
83
87
  'ta.task.waitingQuestion': string;
@@ -27,6 +27,9 @@ exports.ASSISTANT_EN = {
27
27
  'ta.assistant.speakStopShort': 'Stop',
28
28
  'ta.assistant.poke': 'Poke Ta',
29
29
  'ta.assistant.stop': 'Stop',
30
+ 'ta.assistant.pauseTasks': 'Pause all tasks',
31
+ 'ta.assistant.resumeTasks': 'Resume paused tasks ({count})',
32
+ 'ta.assistant.pausedTasks': 'Paused {count} tasks',
30
33
  'ta.assistant.restart': 'Start over',
31
34
  'ta.assistant.restartTitle': 'Start a new conversation with the double?',
32
35
  'ta.assistant.restartHint': 'The current one stays in its session file; the tasks go on.',
@@ -81,6 +84,7 @@ exports.ASSISTANT_EN = {
81
84
  'ta.task.verdictFail': 'Check failed',
82
85
  'ta.task.branch': 'Branch {branch}',
83
86
  'ta.task.stopped': 'Stopped',
87
+ 'ta.task.paused': 'Paused',
84
88
  'ta.task.waiting': 'Waiting for you',
85
89
  'ta.task.waitingPermission': 'Waiting for you to allow',
86
90
  'ta.task.waitingQuestion': 'Waiting for your answer',
@@ -57,9 +57,6 @@ export declare const COMMON_EN: {
57
57
  'ta.clip.pasteMany': string;
58
58
  'ta.clip.pick': string;
59
59
  'ta.clip.open': string;
60
- 'ta.clip.maybe': string;
61
- 'ta.clip.maybeDetail': string;
62
- 'ta.clip.none': string;
63
60
  'ta.link.notFound': string;
64
61
  'ta.terminal.openLink': string;
65
62
  'ta.terminal.openLinkMac': string;
@@ -61,9 +61,6 @@ exports.COMMON_EN = {
61
61
  'ta.clip.pasteMany': '{count} links of Ta in what you pasted',
62
62
  'ta.clip.pick': 'Tap one to open it',
63
63
  'ta.clip.open': 'Open',
64
- 'ta.clip.maybe': 'There is a link in the clipboard',
65
- 'ta.clip.maybeDetail': 'An invite or a share of Ta opens with Open',
66
- 'ta.clip.none': 'No link of Ta in the clipboard',
67
64
  'ta.link.notFound': '{path} is not there.',
68
65
  'ta.terminal.openLink': 'Ctrl + click to open',
69
66
  'ta.terminal.openLinkMac': 'Cmd + click to open',
@@ -46,7 +46,10 @@ export declare const DISCOVER_EN: {
46
46
  'ta.share.friends': string;
47
47
  'ta.share.pickFriends': string;
48
48
  'ta.share.sendN': string;
49
- 'ta.share.sentTo': string;
49
+ 'ta.share.sentTitle': string;
50
+ 'ta.share.sent': string;
51
+ 'ta.share.got': string;
52
+ 'ta.share.opened': string;
50
53
  'ta.share.renew': string;
51
54
  'ta.share.passwordApart': string;
52
55
  'ta.share.copyPassword': string;
@@ -50,7 +50,10 @@ exports.DISCOVER_EN = {
50
50
  'ta.share.friends': 'Ta friends',
51
51
  'ta.share.pickFriends': 'Pick friends',
52
52
  'ta.share.sendN': 'Send to {n}',
53
- 'ta.share.sentTo': 'Sent to {n}: it waits in their Ta',
53
+ 'ta.share.sentTitle': 'Sent to these friends',
54
+ 'ta.share.sent': 'Sent',
55
+ 'ta.share.got': 'Received',
56
+ 'ta.share.opened': 'Opened',
54
57
  'ta.share.renew': 'New link',
55
58
  'ta.share.passwordApart': 'Tell them the password apart:',
56
59
  'ta.share.copyPassword': 'Copy password',
@@ -60,6 +60,14 @@ export declare const SETTINGS_EN: {
60
60
  'ta.settings.diagramStyle.sketch': string;
61
61
  'ta.settings.diagramStyle.colour': string;
62
62
  'ta.settings.diagramStyle.motion': string;
63
+ 'ta.settings.skin': string;
64
+ 'ta.settings.skinHint': string;
65
+ 'ta.settings.skin.none': string;
66
+ 'ta.settings.glass': string;
67
+ 'ta.settings.glassHint': string;
68
+ 'ta.settings.glass.clear': string;
69
+ 'ta.settings.glass.soft': string;
70
+ 'ta.settings.glass.focus': string;
63
71
  'ta.settings.fontSize': string;
64
72
  'ta.settings.fontSizeHint': string;
65
73
  'ta.settings.chatFontSize': string;
@@ -63,6 +63,14 @@ exports.SETTINGS_EN = {
63
63
  'ta.settings.diagramStyle.sketch': 'Sketch',
64
64
  'ta.settings.diagramStyle.colour': 'Colour',
65
65
  'ta.settings.diagramStyle.motion': 'Motion',
66
+ 'ta.settings.skin': 'Skin',
67
+ 'ta.settings.skinHint': 'A picture behind Ta, its columns glass over it.',
68
+ 'ta.settings.skin.none': 'None',
69
+ 'ta.settings.glass': 'Glass',
70
+ 'ta.settings.glassHint': 'How much of the skin shows through.',
71
+ 'ta.settings.glass.clear': 'Clear',
72
+ 'ta.settings.glass.soft': 'Soft',
73
+ 'ta.settings.glass.focus': 'Focus',
66
74
  'ta.settings.fontSize': 'Font size',
67
75
  'ta.settings.fontSizeHint': 'The text of the whole page.',
68
76
  'ta.settings.chatFontSize': 'Conversation font size',
@@ -26,6 +26,9 @@ exports.ASSISTANT_JA = {
26
26
  'ta.assistant.speakStopShort': '停止',
27
27
  'ta.assistant.poke': 'Ta をつついてみる',
28
28
  'ta.assistant.stop': '停止',
29
+ 'ta.assistant.pauseTasks': 'すべてのタスクを一時停止',
30
+ 'ta.assistant.resumeTasks': '一時停止したタスクを再開({count})',
31
+ 'ta.assistant.pausedTasks': '{count} 件のタスクを一時停止しました',
29
32
  'ta.assistant.restart': 'やり直す',
30
33
  'ta.assistant.restartTitle': '分身との新しい会話を始めますか?',
31
34
  'ta.assistant.restartHint': '現在の会話はセッションファイルに保存され、タスクは続行します。',
@@ -80,6 +83,7 @@ exports.ASSISTANT_JA = {
80
83
  'ta.task.verdictFail': 'チェック不合格',
81
84
  'ta.task.branch': 'ブランチ {branch}',
82
85
  'ta.task.stopped': '停止',
86
+ 'ta.task.paused': '一時停止中',
83
87
  'ta.task.waiting': 'あなたの対応が必要',
84
88
  'ta.task.waitingPermission': '許可を待っています',
85
89
  'ta.task.waitingQuestion': '回答を待っています',
@@ -59,9 +59,6 @@ exports.COMMON_JA = {
59
59
  'ta.clip.pasteMany': '貼り付けた内容に Ta のリンクが {count} 件あります',
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_JA = {
48
48
  'ta.share.friends': 'Ta の友だち',
49
49
  'ta.share.pickFriends': '友だちを選択',
50
50
  'ta.share.sendN': '{n} 人に送信',
51
- 'ta.share.sentTo': '{n} 人の友だちに送りました。相手の Ta で開くのを待っています',
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': 'パスワードをコピー',
@@ -62,6 +62,14 @@ exports.SETTINGS_JA = {
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': '会話のフォントサイズ',