@celljs/ta-web 4.12.0 → 4.13.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 (229) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +1 -1
  3. package/esm/browser/assistant/assistant-extension.js +14 -0
  4. package/esm/browser/assistant/assistant-initiative.d.ts +27 -0
  5. package/esm/browser/assistant/assistant-initiative.js +76 -0
  6. package/esm/browser/assistant/assistant-task-source.d.ts +7 -0
  7. package/esm/browser/assistant/assistant-task-source.js +12 -2
  8. package/esm/browser/assistant/assistant-view.js +5 -4
  9. package/esm/browser/assistant/assistant.d.ts +5 -0
  10. package/esm/browser/assistant/assistant.js +25 -6
  11. package/esm/browser/components/app-nav.d.ts +3 -1
  12. package/esm/browser/components/app-nav.js +5 -2
  13. package/esm/browser/components/app-view.js +18 -9
  14. package/esm/browser/components/asks-badge.d.ts +5 -0
  15. package/esm/browser/components/asks-badge.js +8 -0
  16. package/esm/browser/components/chat-asks.d.ts +46 -0
  17. package/esm/browser/components/chat-asks.js +101 -0
  18. package/esm/browser/components/chat-list.d.ts +7 -1
  19. package/esm/browser/components/chat-list.js +46 -17
  20. package/esm/browser/components/composer-addon-util.d.ts +11 -0
  21. package/esm/browser/components/composer-addon-util.js +40 -0
  22. package/esm/browser/components/composer-addons.d.ts +1 -7
  23. package/esm/browser/components/composer-addons.js +1 -27
  24. package/esm/browser/components/composer.d.ts +7 -1
  25. package/esm/browser/components/composer.js +33 -20
  26. package/esm/browser/components/connection-bar.js +31 -12
  27. package/esm/browser/components/conversation-scroll-util.d.ts +5 -0
  28. package/esm/browser/components/conversation-scroll-util.js +18 -0
  29. package/esm/browser/components/conversation-scroll.d.ts +12 -2
  30. package/esm/browser/components/conversation-scroll.js +68 -5
  31. package/esm/browser/components/discover-view.js +5 -1
  32. package/esm/browser/components/earlier-messages.d.ts +10 -3
  33. package/esm/browser/components/earlier-messages.js +14 -8
  34. package/esm/browser/components/folder-picker.d.ts +2 -0
  35. package/esm/browser/components/folder-picker.js +7 -0
  36. package/esm/browser/components/host-view.d.ts +1 -1
  37. package/esm/browser/components/markdown.js +4 -2
  38. package/esm/browser/components/media.js +4 -39
  39. package/esm/browser/components/mermaid-view.js +45 -3
  40. package/esm/browser/components/message-footer.d.ts +2 -0
  41. package/esm/browser/components/message-footer.js +8 -1
  42. package/esm/browser/components/message-list.d.ts +12 -0
  43. package/esm/browser/components/message-list.js +156 -25
  44. package/esm/browser/components/phone-shell.d.ts +7 -2
  45. package/esm/browser/components/phone-shell.js +7 -3
  46. package/esm/browser/components/relay-services.d.ts +24 -0
  47. package/esm/browser/components/relay-services.js +249 -0
  48. package/esm/browser/components/relay-view.js +17 -1
  49. package/esm/browser/components/remote-hosts.js +1 -1
  50. package/esm/browser/components/session-view.js +16 -4
  51. package/esm/browser/components/settings-controls.js +3 -3
  52. package/esm/browser/components/settings-parts.js +13 -1
  53. package/esm/browser/components/ta-avatar.js +6 -0
  54. package/esm/browser/components/tool-result.d.ts +13 -0
  55. package/esm/browser/components/tool-result.js +138 -0
  56. package/esm/browser/components/tool-view.js +5 -15
  57. package/esm/browser/components/web-composer.js +2 -1
  58. package/esm/browser/extension/extension-view.d.ts +3 -1
  59. package/esm/browser/extension/extension-view.js +7 -0
  60. package/esm/browser/extension/icons.js +9 -1
  61. package/esm/browser/extension/web-api-components.d.ts +3 -3
  62. package/esm/browser/extension/web-api-contributions.d.ts +119 -0
  63. package/esm/browser/extension/web-extension-api.d.ts +23 -46
  64. package/esm/browser/extension/web-extension-context.d.ts +6 -1
  65. package/esm/browser/extension/web-extension-context.js +63 -6
  66. package/esm/browser/extension/web-extension-protocol.d.ts +5 -1
  67. package/esm/browser/extension/web-extension-protocol.js +1 -0
  68. package/esm/browser/extension/web-extension-run.d.ts +3 -2
  69. package/esm/browser/extension/web-extension-run.js +3 -0
  70. package/esm/browser/extension/web-extensions.d.ts +2 -8
  71. package/esm/browser/extension/web-extensions.js +9 -35
  72. package/esm/browser/extension/web-page-list.d.ts +25 -0
  73. package/esm/browser/extension/web-page-list.js +35 -0
  74. package/esm/browser/extension/web-session-notices.d.ts +6 -1
  75. package/esm/browser/extension/web-session-notices.js +30 -4
  76. package/esm/browser/extension/web-sharing.d.ts +5 -2
  77. package/esm/browser/extension/web-sharing.js +10 -1
  78. package/esm/browser/i18n/locales.d.ts +69 -3
  79. package/esm/browser/i18n/messages.d.ts +68 -2
  80. package/esm/browser/i18n/messages.js +138 -6
  81. package/esm/browser/markdown/code-renderers.d.ts +4 -0
  82. package/esm/browser/markdown/code-renderers.js +4 -0
  83. package/esm/browser/markdown/lazy.d.ts +8 -0
  84. package/esm/browser/markdown/lazy.js +35 -0
  85. package/esm/browser/markdown/mermaid.d.ts +15 -3
  86. package/esm/browser/markdown/mermaid.js +45 -6
  87. package/esm/browser/notices/notices-protocol.d.ts +5 -0
  88. package/esm/browser/notices/notices.d.ts +19 -0
  89. package/esm/browser/notices/notices.js +85 -2
  90. package/esm/browser/notices/session-notices.d.ts +5 -2
  91. package/esm/browser/notices/session-notices.js +10 -1
  92. package/esm/browser/style/base.d.ts +1 -1
  93. package/esm/browser/style/base.js +2 -1
  94. package/esm/browser/style/conversation.d.ts +1 -1
  95. package/esm/browser/style/conversation.js +51 -0
  96. package/esm/browser/style/device.js +3 -0
  97. package/esm/browser/style/layout.d.ts +1 -1
  98. package/esm/browser/style/layout.js +24 -9
  99. package/esm/browser/style/pages.d.ts +1 -1
  100. package/esm/browser/style/pages.js +2 -0
  101. package/esm/browser/style/phone.d.ts +1 -1
  102. package/esm/browser/style/phone.js +2 -0
  103. package/esm/browser/style/shell.d.ts +1 -1
  104. package/esm/browser/style/shell.js +14 -3
  105. package/esm/browser/util/desktop.d.ts +18 -1
  106. package/esm/browser/util/desktop.js +13 -0
  107. package/esm/browser/util/process.d.ts +26 -1
  108. package/esm/browser/util/process.js +79 -5
  109. package/esm/browser/util/progress.d.ts +6 -1
  110. package/esm/browser/util/progress.js +11 -2
  111. package/esm/browser/util/scroll-rest.d.ts +10 -0
  112. package/esm/browser/util/scroll-rest.js +44 -0
  113. package/esm/browser/util/tool-result.d.ts +32 -0
  114. package/esm/browser/util/tool-result.js +85 -0
  115. package/esm/browser/util/tool.js +7 -0
  116. package/lib/browser/assistant/assistant-extension.js +14 -0
  117. package/lib/browser/assistant/assistant-initiative.d.ts +28 -0
  118. package/lib/browser/assistant/assistant-initiative.js +80 -0
  119. package/lib/browser/assistant/assistant-task-source.d.ts +7 -0
  120. package/lib/browser/assistant/assistant-task-source.js +12 -2
  121. package/lib/browser/assistant/assistant-view.js +3 -2
  122. package/lib/browser/assistant/assistant.d.ts +5 -0
  123. package/lib/browser/assistant/assistant.js +24 -5
  124. package/lib/browser/components/app-nav.d.ts +3 -1
  125. package/lib/browser/components/app-nav.js +5 -2
  126. package/lib/browser/components/app-view.js +17 -8
  127. package/lib/browser/components/asks-badge.d.ts +6 -0
  128. package/lib/browser/components/asks-badge.js +44 -0
  129. package/lib/browser/components/chat-asks.d.ts +47 -0
  130. package/lib/browser/components/chat-asks.js +104 -0
  131. package/lib/browser/components/chat-list.d.ts +7 -1
  132. package/lib/browser/components/chat-list.js +46 -17
  133. package/lib/browser/components/composer-addon-util.d.ts +12 -0
  134. package/lib/browser/components/composer-addon-util.js +76 -0
  135. package/lib/browser/components/composer-addons.d.ts +1 -7
  136. package/lib/browser/components/composer-addons.js +2 -29
  137. package/lib/browser/components/composer.d.ts +7 -1
  138. package/lib/browser/components/composer.js +33 -19
  139. package/lib/browser/components/connection-bar.js +30 -11
  140. package/lib/browser/components/conversation-scroll-util.d.ts +5 -0
  141. package/lib/browser/components/conversation-scroll-util.js +18 -0
  142. package/lib/browser/components/conversation-scroll.d.ts +12 -2
  143. package/lib/browser/components/conversation-scroll.js +68 -5
  144. package/lib/browser/components/discover-view.js +5 -1
  145. package/lib/browser/components/earlier-messages.d.ts +10 -3
  146. package/lib/browser/components/earlier-messages.js +16 -9
  147. package/lib/browser/components/folder-picker.d.ts +2 -0
  148. package/lib/browser/components/folder-picker.js +7 -0
  149. package/lib/browser/components/host-view.d.ts +1 -1
  150. package/lib/browser/components/markdown.js +3 -1
  151. package/lib/browser/components/media.js +3 -38
  152. package/lib/browser/components/mermaid-view.js +45 -3
  153. package/lib/browser/components/message-footer.d.ts +2 -0
  154. package/lib/browser/components/message-footer.js +8 -0
  155. package/lib/browser/components/message-list.d.ts +12 -0
  156. package/lib/browser/components/message-list.js +153 -20
  157. package/lib/browser/components/phone-shell.d.ts +7 -2
  158. package/lib/browser/components/phone-shell.js +7 -3
  159. package/lib/browser/components/relay-services.d.ts +25 -0
  160. package/lib/browser/components/relay-services.js +286 -0
  161. package/lib/browser/components/relay-view.js +17 -1
  162. package/lib/browser/components/remote-hosts.js +1 -1
  163. package/lib/browser/components/session-view.js +15 -3
  164. package/lib/browser/components/settings-controls.js +3 -3
  165. package/lib/browser/components/settings-parts.js +13 -1
  166. package/lib/browser/components/ta-avatar.js +6 -0
  167. package/lib/browser/components/tool-result.d.ts +14 -0
  168. package/lib/browser/components/tool-result.js +175 -0
  169. package/lib/browser/components/tool-view.js +10 -20
  170. package/lib/browser/components/web-composer.js +2 -1
  171. package/lib/browser/extension/extension-view.d.ts +3 -1
  172. package/lib/browser/extension/extension-view.js +8 -1
  173. package/lib/browser/extension/icons.js +8 -0
  174. package/lib/browser/extension/web-api-components.d.ts +3 -3
  175. package/lib/browser/extension/web-api-contributions.d.ts +119 -0
  176. package/lib/browser/extension/web-extension-api.d.ts +23 -46
  177. package/lib/browser/extension/web-extension-context.d.ts +6 -1
  178. package/lib/browser/extension/web-extension-context.js +63 -6
  179. package/lib/browser/extension/web-extension-protocol.d.ts +5 -1
  180. package/lib/browser/extension/web-extension-protocol.js +1 -0
  181. package/lib/browser/extension/web-extension-run.d.ts +3 -2
  182. package/lib/browser/extension/web-extension-run.js +3 -0
  183. package/lib/browser/extension/web-extensions.d.ts +2 -8
  184. package/lib/browser/extension/web-extensions.js +9 -35
  185. package/lib/browser/extension/web-page-list.d.ts +26 -0
  186. package/lib/browser/extension/web-page-list.js +39 -0
  187. package/lib/browser/extension/web-session-notices.d.ts +6 -1
  188. package/lib/browser/extension/web-session-notices.js +30 -4
  189. package/lib/browser/extension/web-sharing.d.ts +5 -2
  190. package/lib/browser/extension/web-sharing.js +10 -1
  191. package/lib/browser/i18n/locales.d.ts +69 -3
  192. package/lib/browser/i18n/messages.d.ts +68 -2
  193. package/lib/browser/i18n/messages.js +138 -6
  194. package/lib/browser/markdown/code-renderers.d.ts +4 -0
  195. package/lib/browser/markdown/code-renderers.js +5 -1
  196. package/lib/browser/markdown/lazy.d.ts +8 -0
  197. package/lib/browser/markdown/lazy.js +37 -1
  198. package/lib/browser/markdown/mermaid.d.ts +15 -3
  199. package/lib/browser/markdown/mermaid.js +44 -5
  200. package/lib/browser/notices/notices-protocol.d.ts +5 -0
  201. package/lib/browser/notices/notices.d.ts +19 -0
  202. package/lib/browser/notices/notices.js +84 -1
  203. package/lib/browser/notices/session-notices.d.ts +5 -2
  204. package/lib/browser/notices/session-notices.js +10 -1
  205. package/lib/browser/style/base.d.ts +1 -1
  206. package/lib/browser/style/base.js +2 -1
  207. package/lib/browser/style/conversation.d.ts +1 -1
  208. package/lib/browser/style/conversation.js +51 -0
  209. package/lib/browser/style/device.js +3 -0
  210. package/lib/browser/style/layout.d.ts +1 -1
  211. package/lib/browser/style/layout.js +24 -9
  212. package/lib/browser/style/pages.d.ts +1 -1
  213. package/lib/browser/style/pages.js +2 -0
  214. package/lib/browser/style/phone.d.ts +1 -1
  215. package/lib/browser/style/phone.js +2 -0
  216. package/lib/browser/style/shell.d.ts +1 -1
  217. package/lib/browser/style/shell.js +14 -3
  218. package/lib/browser/util/desktop.d.ts +18 -1
  219. package/lib/browser/util/desktop.js +13 -0
  220. package/lib/browser/util/process.d.ts +26 -1
  221. package/lib/browser/util/process.js +79 -5
  222. package/lib/browser/util/progress.d.ts +6 -1
  223. package/lib/browser/util/progress.js +11 -2
  224. package/lib/browser/util/scroll-rest.d.ts +11 -0
  225. package/lib/browser/util/scroll-rest.js +47 -0
  226. package/lib/browser/util/tool-result.d.ts +33 -0
  227. package/lib/browser/util/tool-result.js +88 -0
  228. package/lib/browser/util/tool.js +7 -0
  229. package/package.json +7 -7
@@ -33,38 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.ComposerAddonUtil = void 0;
37
36
  exports.useComposerAddons = useComposerAddons;
38
37
  const React = __importStar(require("react"));
39
38
  const extension_view_1 = require("../extension/extension-view");
40
39
  const hooks_1 = require("../hooks");
41
- var ComposerAddonUtil;
42
- (function (ComposerAddonUtil) {
43
- function action(entry) {
44
- const { items, ...rest } = entry;
45
- return items ? { ...rest, items: items.map(action) } : rest;
46
- }
47
- ComposerAddonUtil.action = action;
48
- /** The entries of each addon, a section each; an addon that fails adds none. */
49
- function actions(addons, conversation) {
50
- if (!conversation) {
51
- return [];
52
- }
53
- return addons.flatMap(({ id, addon }) => {
54
- var _a;
55
- var _b;
56
- try {
57
- const entries = (_b = (_a = addon.actions) === null || _a === void 0 ? void 0 : _a.call(addon, conversation)) !== null && _b !== void 0 ? _b : [];
58
- return entries.length > 0 ? [entries.map(action)] : [];
59
- }
60
- catch (error) {
61
- console.error(`The composer addon ${id} failed:`, error);
62
- return [];
63
- }
64
- });
65
- }
66
- ComposerAddonUtil.actions = actions;
67
- })(ComposerAddonUtil || (exports.ComposerAddonUtil = ComposerAddonUtil = {}));
40
+ const composer_addon_util_1 = require("./composer-addon-util");
68
41
  /**
69
42
  * What web extensions add to the message box of a conversation (registerComposerAddon): sections of its +
70
43
  * menu, and what each draws above the box, in its own boundary.
@@ -81,7 +54,7 @@ function useComposerAddons(conversation) {
81
54
  }
82
55
  };
83
56
  }, [composerAddons]);
84
- const actions = ComposerAddonUtil.actions(composerAddons, conversation);
57
+ const actions = composer_addon_util_1.ComposerAddonUtil.actions(composerAddons, conversation);
85
58
  const above = conversation &&
86
59
  composerAddons.map(({ id, addon }) => {
87
60
  const Above = addon.above;
@@ -1,7 +1,7 @@
1
1
  import type { SessionStore } from '@celljs/ta-client';
2
2
  import type { TaServer, TaSlashCommand, TaWorkspaceServer } from '@celljs/ta-protocol';
3
3
  import * as React from 'react';
4
- import { type ComposerImage } from '../util/composer';
4
+ import { type ComposerImage, type ComposerQueued } from '../util/composer';
5
5
  import { type ComposerAction, type ComposerBoxHandle } from './composer-box';
6
6
  import type { TalkPlace } from './held-talk';
7
7
  import { type StopTiming } from './stop-times';
@@ -48,4 +48,10 @@ export interface ComposerProps {
48
48
  * and Alt+Enter queues a follow-up; Escape stops it.
49
49
  */
50
50
  export declare const Composer: React.ForwardRefExoticComponent<ComposerProps & React.RefAttributes<ComposerBoxHandle>>;
51
+ /** What waits to be sent, tucked on top of the box: as the conversation will show it, the package that sent it apart. */
52
+ export declare function QueuedMessages({ waiting, onTakeBack, onRemove, }: {
53
+ waiting: ComposerQueued[];
54
+ onTakeBack(): void;
55
+ onRemove(entry: ComposerQueued, back: boolean): void;
56
+ }): React.JSX.Element;
51
57
  //# sourceMappingURL=composer.d.ts.map
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Composer = void 0;
37
+ exports.QueuedMessages = QueuedMessages;
37
38
  const lucide_react_1 = require("lucide-react");
38
39
  const React = __importStar(require("react"));
39
40
  const assistant_task_util_1 = require("../assistant/assistant-task-util");
@@ -42,12 +43,16 @@ const use_t_1 = require("../i18n/use-t");
42
43
  const composer_1 = require("../util/composer");
43
44
  const composer_box_1 = require("./composer-box");
44
45
  const icon_1 = require("./icon");
46
+ const message_list_1 = require("./message-list");
45
47
  const stop_times_1 = require("./stop-times");
46
48
  const FILE_LIMIT = 20;
47
49
  const FILE_DELAY_MS = 120;
48
50
  const EMPTY_QUEUE = { steering: [], followUp: [] };
49
51
  /** What the user said of what waited: not the notes of the tasks that ended, which they did not write. */
50
- const said = (texts) => texts.filter(text => !assistant_task_util_1.AssistantTaskUtil.noteOf(text));
52
+ const said = (texts) => texts.filter(text => !assistant_task_util_1.AssistantTaskUtil.noteOf(text)).map(text => words(text).copied);
53
+ /** A waiting message as the user sees it in the conversation: without its context, the package it came from apart. */
54
+ const blocksOf = (text) => [{ type: 'text', text }];
55
+ const words = (text) => (0, message_list_1.userWords)(blocksOf(text));
51
56
  /** The files for an `@` being typed; a server without file search answers with an error, and the menu says so. */
52
57
  function useFiles(workspace, cwd, query) {
53
58
  const t = (0, use_t_1.useT)();
@@ -164,29 +169,38 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
164
169
  server.removeQueued(store.sessionId, entry.kind, entry.index).then(removed => {
165
170
  var _a;
166
171
  if (removed && back) {
167
- (_a = box.current) === null || _a === void 0 ? void 0 : _a.setText(composer_1.ComposerUtil.restore({ steering: [entry.text], followUp: [] }, box.current.text()));
172
+ (_a = box.current) === null || _a === void 0 ? void 0 : _a.setText(composer_1.ComposerUtil.restore({ steering: said([entry.text]), followUp: [] }, box.current.text()));
168
173
  }
169
174
  }, onError);
170
175
  };
171
176
  const waiting = composer_1.ComposerUtil.queued(queue);
172
177
  return (React.createElement(composer_box_1.ComposerBox, { ref: box, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : t(composer_1.ComposerUtil.placeholderKey(working, touch)), working: working, onStop: stop, onSend: send, commands: listed, onMentionQuery: setQuery, mentions: files, mentionLabel: t('ta.composer.mentionFile'), images: true, recentShots: recentShots, actions: actions, head: head, after: after, voiceSends: voiceSends, talkPlace: talkPlace, onTalkSent: onTalkSent, onListening: onListening, autoFocus: !touch, cwd: cwd, onError: onError, above: React.createElement(React.Fragment, null,
173
178
  above,
174
- waiting.length > 0 && (React.createElement("div", { className: "ta-queue", "aria-live": "polite" },
175
- React.createElement("div", { className: "ta-queue-head" },
176
- React.createElement("span", null, t('ta.composer.queue.count', { count: waiting.length })),
177
- React.createElement("button", { type: "button", className: "ta-queue-all", onClick: takeBack, title: t('ta.composer.queue.takeBackTitle') }, t('ta.composer.queue.takeBackAll'))),
178
- waiting.map(entry => {
179
- const note = assistant_task_util_1.AssistantTaskUtil.noteOf(entry.text);
180
- const text = note ? t('ta.task.ended', { title: note.title, status: t(`ta.task.${note.status}`) }) : entry.text;
181
- return (React.createElement("div", { key: `${entry.kind}-${entry.index}-${entry.text}`, className: "ta-queue-row" },
182
- React.createElement("span", { className: "ta-queue-kind", title: t(entry.kind === 'steering' ? 'ta.composer.queue.steering' : 'ta.composer.queue.followUp') },
183
- React.createElement(icon_1.Icon, { icon: entry.kind === 'steering' ? lucide_react_1.CornerDownRight : lucide_react_1.Clock3, size: 13 })),
184
- React.createElement("span", { className: "ta-ellipsis ta-queue-text", title: text }, text),
185
- React.createElement("span", { className: "ta-queue-actions" },
186
- !note && (React.createElement("button", { type: "button", className: "ta-icon-button", onClick: () => remove(entry, true), title: t('ta.composer.queue.editTitle'), "aria-label": t('ta.composer.queue.editTitle') },
187
- React.createElement(icon_1.Icon, { icon: lucide_react_1.Undo2, size: 13 }))),
188
- React.createElement("button", { type: "button", className: "ta-icon-button", onClick: () => remove(entry, false), title: t('ta.composer.queue.remove'), "aria-label": t('ta.composer.queue.remove') },
189
- React.createElement(icon_1.Icon, { icon: lucide_react_1.X, size: 13 })))));
190
- })))) }));
179
+ waiting.length > 0 && React.createElement(QueuedMessages, { waiting: waiting, onTakeBack: takeBack, onRemove: remove })) }));
191
180
  });
181
+ /** What waits to be sent, tucked on top of the box: as the conversation will show it, the package that sent it apart. */
182
+ function QueuedMessages({ waiting, onTakeBack, onRemove, }) {
183
+ const t = (0, use_t_1.useT)();
184
+ return (React.createElement("div", { className: "ta-queue", "aria-live": "polite" },
185
+ waiting.length > 1 && (React.createElement("div", { className: "ta-queue-head" },
186
+ React.createElement("span", null, t('ta.composer.queue.count', { count: waiting.length })),
187
+ React.createElement("button", { type: "button", className: "ta-queue-all", onClick: onTakeBack, title: t('ta.composer.queue.takeBackTitle') }, t('ta.composer.queue.takeBackAll')))),
188
+ waiting.map(entry => {
189
+ const note = assistant_task_util_1.AssistantTaskUtil.noteOf(entry.text);
190
+ const shown = words(entry.text);
191
+ const text = note ? t('ta.task.ended', { title: note.title, status: t(`ta.task.${note.status}`) }) : shown.text || shown.copied;
192
+ const kind = t(entry.kind === 'steering' ? 'ta.composer.queue.steering' : 'ta.composer.queue.followUp');
193
+ return (React.createElement("div", { key: `${entry.kind}-${entry.index}-${entry.text}`, className: "ta-queue-row" },
194
+ React.createElement("span", { className: "ta-queue-kind", title: kind },
195
+ React.createElement(icon_1.Icon, { icon: entry.kind === 'steering' ? lucide_react_1.CornerDownRight : lucide_react_1.Clock3, size: 13 }),
196
+ React.createElement("span", null, kind)),
197
+ !note && React.createElement(message_list_1.MessageOrigin, { blocks: blocksOf(entry.text) }),
198
+ React.createElement("span", { className: "ta-ellipsis ta-queue-text", title: text }, text),
199
+ React.createElement("span", { className: "ta-queue-actions" },
200
+ !note && (React.createElement("button", { type: "button", className: "ta-icon-button", onClick: () => onRemove(entry, true), title: t('ta.composer.queue.editTitle'), "aria-label": t('ta.composer.queue.editTitle') },
201
+ React.createElement(icon_1.Icon, { icon: lucide_react_1.PenLine, size: 13 }))),
202
+ React.createElement("button", { type: "button", className: "ta-icon-button", onClick: () => onRemove(entry, false), title: t('ta.composer.queue.remove'), "aria-label": t('ta.composer.queue.remove') },
203
+ React.createElement(icon_1.Icon, { icon: lucide_react_1.X, size: 13 })))));
204
+ })));
205
+ }
192
206
  //# sourceMappingURL=composer.js.map
@@ -116,7 +116,7 @@ function usePressed() {
116
116
  function useConnectionNotice() {
117
117
  const t = (0, use_t_1.useT)();
118
118
  const [{ offlineShown, error, retryAt, status }, workbench] = (0, hooks_1.useWorkbench)();
119
- const [{ notDoneAt }] = (0, hooks_1.useNotices)();
119
+ const [{ notDoneAt, outdated }] = (0, hooks_1.useNotices)();
120
120
  // Something the user did did not happen: no notice over the page, this row says it. Offline, it shows at once.
121
121
  const notDone = useRecent(notDoneAt, NOT_DONE_MS);
122
122
  const online = status === 'online';
@@ -128,6 +128,8 @@ function useConnectionNotice() {
128
128
  const brief = error === 'away' ? t('ta.connection.awayBrief') : error === 'unreachable' ? t('ta.connection.unreachableBrief') : t('ta.connection.lost');
129
129
  return {
130
130
  phase,
131
+ // Below what the connection says: an outdated page reloads once it can.
132
+ outdated: !!outdated && phase === 'none',
131
133
  back: phase === 'back' || phase === 'leaving',
132
134
  notDone: phase === 'notDone',
133
135
  text,
@@ -167,18 +169,30 @@ function useWidth(body, content) {
167
169
  */
168
170
  function ConnectionBar() {
169
171
  const t = (0, use_t_1.useT)();
170
- const { phase, back, notDone, text, seconds, trying, retry } = useConnectionNotice();
172
+ const { phase, outdated, back, notDone, text, seconds, trying, retry } = useConnectionNotice();
171
173
  const body = React.useRef(null);
172
- const shown = phase === 'none' ? undefined : notDone ? 'notDone' : back ? 'back' : 'offline';
174
+ const shown = outdated ? 'outdated' : phase === 'none' ? undefined : notDone ? 'notDone' : back ? 'back' : 'offline';
173
175
  const width = useWidth(body, shown);
174
- if (phase === 'none') {
176
+ if (shown === undefined) {
175
177
  return null;
176
178
  }
177
- const classes = ['ta-connection', back && 'ta-connection-back', notDone && 'ta-connection-notdone', phase === 'leaving' && 'ta-connection-leaving'];
179
+ const classes = [
180
+ 'ta-connection',
181
+ back && 'ta-connection-back',
182
+ notDone && 'ta-connection-notdone',
183
+ outdated && 'ta-connection-outdated',
184
+ phase === 'leaving' && 'ta-connection-leaving',
185
+ ];
178
186
  // The border of the bar is around the body.
179
187
  const style = width === undefined ? undefined : { width: width + 2 };
180
188
  return (React.createElement("div", { className: classes.filter(Boolean).join(' '), role: "status", style: style },
181
- React.createElement("div", { className: "ta-connection-body", ref: body, key: shown }, notDone ? (React.createElement(React.Fragment, null,
189
+ React.createElement("div", { className: "ta-connection-body", ref: body, key: shown }, outdated ? (React.createElement(React.Fragment, null,
190
+ React.createElement(icon_1.Icon, { icon: lucide_react_1.CircleArrowUp, size: 15, className: "ta-level-icon" }),
191
+ React.createElement("span", { className: "ta-connection-text" }, t('ta.connection.outdated')),
192
+ React.createElement("button", { type: "button", className: "ta-connection-retry", onClick: () => location.reload() },
193
+ React.createElement(icon_1.Icon, { icon: lucide_react_1.RotateCw, size: 13 }),
194
+ " ",
195
+ t('ta.connection.reload')))) : notDone ? (React.createElement(React.Fragment, null,
182
196
  React.createElement(icon_1.Icon, { icon: lucide_react_1.CircleAlert, size: 15, className: "ta-level-icon" }),
183
197
  React.createElement("span", { className: "ta-connection-text" }, t('ta.connection.notDone')))) : back ? (React.createElement(React.Fragment, null,
184
198
  React.createElement(icon_1.Icon, { icon: lucide_react_1.CircleCheck, size: 15, className: "ta-level-icon" }),
@@ -199,20 +213,25 @@ function ConnectionBar() {
199
213
  function ConnectionBanner() {
200
214
  const t = (0, use_t_1.useT)();
201
215
  const handheld = (0, device_1.useDevice)(device => device.handheld);
202
- const { phase, back, notDone, text, brief, trying, retry } = useConnectionNotice();
216
+ const { phase, outdated, back, notDone, text, brief, trying, retry } = useConnectionNotice();
203
217
  if (!handheld) {
204
218
  return null;
205
219
  }
206
- const open = phase === 'offline' || phase === 'back' || notDone;
220
+ const open = phase === 'offline' || phase === 'back' || notDone || outdated;
207
221
  const quiet = back || notDone;
208
- const classes = ['ta-connection-banner', open && 'ta-open', back && 'ta-connection-back'];
222
+ const classes = ['ta-connection-banner', open && 'ta-open', back && 'ta-connection-back', outdated && 'ta-connection-outdated'];
209
223
  // Always there, empty while closed, so that it opens with a transition.
210
224
  return (React.createElement("div", { className: classes.filter(Boolean).join(' '), role: "status", "aria-hidden": !open },
211
- React.createElement("div", { className: "ta-connection-banner-inner" }, phase !== 'none' && (React.createElement("button", { type: "button", className: "ta-connection-banner-row", disabled: quiet || trying, tabIndex: open ? undefined : -1, title: quiet ? undefined : text, onClick: retry },
225
+ React.createElement("div", { className: "ta-connection-banner-inner" }, outdated ? (React.createElement("button", { type: "button", className: "ta-connection-banner-row", onClick: () => location.reload() },
226
+ React.createElement(icon_1.Icon, { icon: lucide_react_1.CircleArrowUp, size: 16, className: "ta-level-icon" }),
227
+ React.createElement("span", { className: "ta-connection-banner-text" }, t('ta.connection.outdated')),
228
+ React.createElement("span", { className: "ta-connection-banner-action" },
229
+ React.createElement(icon_1.Icon, { icon: lucide_react_1.RotateCw, size: 14 }),
230
+ t('ta.connection.reload')))) : (phase !== 'none' && (React.createElement("button", { type: "button", className: "ta-connection-banner-row", disabled: quiet || trying, tabIndex: open ? undefined : -1, title: quiet ? undefined : text, onClick: retry },
212
231
  React.createElement(icon_1.Icon, { icon: notDone ? lucide_react_1.CircleAlert : back ? lucide_react_1.CircleCheck : lucide_react_1.WifiOff, size: 16, className: "ta-level-icon" }),
213
232
  React.createElement("span", { className: "ta-connection-banner-text" }, notDone ? t('ta.connection.notDone') : back ? t('ta.connection.back') : brief),
214
233
  !quiet && (React.createElement("span", { className: "ta-connection-banner-action" },
215
234
  trying ? React.createElement("span", { className: "ta-spinner" }) : React.createElement(icon_1.Icon, { icon: lucide_react_1.RotateCw, size: 14 }),
216
- trying ? t('ta.connection.retrying') : t('ta.connection.retry'))))))));
235
+ trying ? t('ta.connection.retrying') : t('ta.connection.retry')))))))));
217
236
  }
218
237
  //# sourceMappingURL=connection-bar.js.map
@@ -13,6 +13,11 @@ export interface ScrollRow {
13
13
  export declare namespace ScrollUtil {
14
14
  /** The first of `rows` (in order, as laid out) in a view scrolled to `top`; past what says earlier rows load. */
15
15
  function firstRow(rows: ArrayLike<ScrollRow>, top: number): ScrollRow | undefined;
16
+ /**
17
+ * The row read in a view scrolled to `top`, `height` high: the first that starts in it, which keeps its place as
18
+ * the row above it (only partly in sight) grows or shrinks; else the one over all of the view (firstRow).
19
+ */
20
+ function readRow(rows: ArrayLike<ScrollRow>, top: number, height: number): ScrollRow | undefined;
16
21
  }
17
22
  /**
18
23
  * A view gliding where it goes rather than jumping there: each frame it goes the share of the way left it would
@@ -21,6 +21,24 @@ var ScrollUtil;
21
21
  return ((_b = (_a = rows[low]) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.scrollSkip) !== undefined && low + 1 < rows.length ? rows[low + 1] : rows[low];
22
22
  }
23
23
  ScrollUtil.firstRow = firstRow;
24
+ /**
25
+ * The row read in a view scrolled to `top`, `height` high: the first that starts in it, which keeps its place as
26
+ * the row above it (only partly in sight) grows or shrinks; else the one over all of the view (firstRow).
27
+ */
28
+ function readRow(rows, top, height) {
29
+ const first = firstRow(rows, top);
30
+ if (!first || first.offsetTop >= top) {
31
+ return first;
32
+ }
33
+ for (let index = 0; index < rows.length; index++) {
34
+ if (rows[index] === first) {
35
+ const next = rows[index + 1];
36
+ return next && next.offsetTop < top + height ? next : first;
37
+ }
38
+ }
39
+ return first;
40
+ }
41
+ ScrollUtil.readRow = readRow;
24
42
  })(ScrollUtil || (exports.ScrollUtil = ScrollUtil = {}));
25
43
  /**
26
44
  * A view gliding where it goes rather than jumping there: each frame it goes the share of the way left it would
@@ -82,7 +82,7 @@ export declare class ConversationScroller {
82
82
  /** When the user last moved the view by hand (HAND_MS). */
83
83
  private handAt;
84
84
  private touchY;
85
- /** The row at the top of the view while it does not follow, and how far it starts below the top of the view. */
85
+ /** What the user reads while the view does not follow (ScrollAnchor). */
86
86
  private anchor;
87
87
  /** What the user just opened or closed, and how far it was below the top of the view. */
88
88
  private toggled;
@@ -151,8 +151,18 @@ export declare class ConversationScroller {
151
151
  private see;
152
152
  private toBottomNow;
153
153
  private moveTo;
154
- /** The first row in the view, while it does not follow. */
154
+ /** What the user reads, while the view does not follow (ScrollAnchor). */
155
155
  private remember;
156
+ /** Where the anchor is now, from the top of the thread; undefined once it is gone. */
157
+ private anchorAt;
158
+ /**
159
+ * What moved above the anchor before the view heard of it, kept out of sight. The scroll of a frame comes before
160
+ * the observer of sizes: rows drawn in front of the view meanwhile (earlier messages, a diagram drawn) would
161
+ * else be taken as where the user is, and what they read would go down by all of them.
162
+ */
163
+ private keepAnchor;
164
+ /** The first part of `row` (a row begun above the view) that starts in the view, as deep as it takes to find one. */
165
+ private partIn;
156
166
  private offsetOf;
157
167
  /** Whether what `element` opened goes on past the bottom of the view. */
158
168
  private past;
@@ -28,6 +28,8 @@ const TOGGLE = '[aria-expanded], summary';
28
28
  * follow its answer.
29
29
  */
30
30
  const SCROLL_END_MS = 150;
31
+ /** How deep in a row taller than the view its part read is looked for. */
32
+ const PART_DEPTH = 8;
31
33
  /** At most this share of the view is left to glide: more coming at once (a block, what came while away) jumps the rest. */
32
34
  const GLIDE_MAX = 0.5;
33
35
  function hasScrollEnd() {
@@ -241,6 +243,7 @@ class ConversationScroller {
241
243
  }
242
244
  scrolled() {
243
245
  const { view } = this;
246
+ this.keepAnchor();
244
247
  const top = view.scrollTop;
245
248
  const moved = top - this.top;
246
249
  this.top = top;
@@ -385,8 +388,8 @@ class ConversationScroller {
385
388
  }
386
389
  // The row read where it was, the bottom of the view kept to the message box. From the row rather than the
387
390
  // view: the browser may have pulled the view up meanwhile, the thread shorter than where it was.
388
- const anchor = this.anchor;
389
- this.moveTo(((anchor === null || anchor === void 0 ? void 0 : anchor.row.isConnected) ? anchor.row.offsetTop - anchor.offset : this.top) + shrunk);
391
+ const at = this.anchor && this.anchorAt(this.anchor);
392
+ this.moveTo((at === undefined ? this.top : at - this.anchor.offset) + shrunk);
390
393
  this.remember();
391
394
  }
392
395
  /**
@@ -514,15 +517,75 @@ class ConversationScroller {
514
517
  }
515
518
  this.top = view.scrollTop;
516
519
  }
517
- /** The first row in the view, while it does not follow. */
520
+ /** What the user reads, while the view does not follow (ScrollAnchor). */
518
521
  remember() {
519
522
  if (this.following) {
520
523
  this.anchor = undefined;
521
524
  this.see();
522
525
  return;
523
526
  }
524
- const row = conversation_scroll_util_1.ScrollUtil.firstRow(this.thread.children, this.view.scrollTop);
525
- this.anchor = row ? { row, offset: row.offsetTop - this.view.scrollTop } : undefined;
527
+ const { view } = this;
528
+ const top = view.scrollTop;
529
+ const row = conversation_scroll_util_1.ScrollUtil.readRow(this.thread.children, top, view.clientHeight);
530
+ if (!row) {
531
+ this.anchor = undefined;
532
+ return;
533
+ }
534
+ // A row taller than the view, begun above it: what of it starts in the view keeps its place, so that what
535
+ // grows in the part of the row above it (a diagram drawn, a part laid out) does not move what is read.
536
+ const part = row.offsetTop < top && isElement(row) ? this.partIn(row) : undefined;
537
+ const at = part ? top + this.offsetOf(part) : row.offsetTop;
538
+ this.anchor = { row, part, offset: at - top, at };
539
+ }
540
+ /** Where the anchor is now, from the top of the thread; undefined once it is gone. */
541
+ anchorAt(anchor) {
542
+ var _a;
543
+ if (((_a = anchor.part) === null || _a === void 0 ? void 0 : _a.isConnected) && anchor.row.isConnected) {
544
+ return this.view.scrollTop + this.offsetOf(anchor.part);
545
+ }
546
+ return anchor.row.isConnected ? anchor.row.offsetTop : undefined;
547
+ }
548
+ /**
549
+ * What moved above the anchor before the view heard of it, kept out of sight. The scroll of a frame comes before
550
+ * the observer of sizes: rows drawn in front of the view meanwhile (earlier messages, a diagram drawn) would
551
+ * else be taken as where the user is, and what they read would go down by all of them.
552
+ */
553
+ keepAnchor() {
554
+ const anchor = this.anchor;
555
+ if (this.following || !anchor || this.toggled || this.heading !== undefined) {
556
+ return;
557
+ }
558
+ const at = this.anchorAt(anchor);
559
+ const drift = at === undefined ? 0 : at - anchor.at;
560
+ if (Math.abs(drift) >= 1) {
561
+ this.view.scrollTop += drift;
562
+ this.top += drift;
563
+ }
564
+ }
565
+ /** The first part of `row` (a row begun above the view) that starts in the view, as deep as it takes to find one. */
566
+ partIn(row) {
567
+ const top = this.view.getBoundingClientRect().top;
568
+ const bottom = top + this.view.clientHeight;
569
+ let node = row;
570
+ for (let depth = 0; depth < PART_DEPTH; depth++) {
571
+ let inside;
572
+ for (const child of node.children) {
573
+ const box = child.getBoundingClientRect();
574
+ if (box.bottom <= top || box.height === 0) {
575
+ continue;
576
+ }
577
+ if (box.top >= top) {
578
+ return box.top < bottom ? child : undefined;
579
+ }
580
+ inside = child;
581
+ break;
582
+ }
583
+ if (!inside) {
584
+ return undefined;
585
+ }
586
+ node = inside;
587
+ }
588
+ return undefined;
526
589
  }
527
590
  offsetOf(element) {
528
591
  return element.getBoundingClientRect().top - this.view.getBoundingClientRect().top;
@@ -63,12 +63,16 @@ function DiscoverView({ pages, onOpenPages, onOpen, onPin, onSettings, onScan, l
63
63
  pages.map(page => {
64
64
  var _a;
65
65
  const title = web_extension_protocol_1.WebLabelUtil.text(page.title);
66
+ const Mark = page.mark;
66
67
  return (React.createElement(list_rows_1.ListRow, { key: page.id, icon: (_a = page.icon) !== null && _a !== void 0 ? _a : lucide_react_1.PanelTop, label: title, onClick: () => onOpen(page.id), onContextMenu: event => openMenu(event, [
67
68
  { label: t('ta.nav.open'), run: () => onOpen(page.id) },
68
69
  { label: t('ta.nav.pin'), run: () => onPin(page.id) },
69
70
  '-',
70
71
  { label: t('ta.nav.settings'), run: onSettings },
71
- ]), trailing: React.createElement(icon_1.IconButton, { icon: lucide_react_1.Pin, label: `${t('ta.nav.pin')} · ${title}`, className: "ta-list-trailing", onClick: () => onPin(page.id) }) }));
72
+ ]), trailing: React.createElement(React.Fragment, null,
73
+ Mark && (React.createElement("span", { className: "ta-list-mark" },
74
+ React.createElement(Mark, null))),
75
+ React.createElement(icon_1.IconButton, { icon: lucide_react_1.Pin, label: `${t('ta.nav.pin')} · ${title}`, className: "ta-list-trailing", onClick: () => onPin(page.id) })) }));
72
76
  }),
73
77
  onOpenPages.map(page => { var _a; return (React.createElement(list_rows_1.ListRow, { key: page.id, icon: (_a = page.icon) !== null && _a !== void 0 ? _a : lucide_react_1.PanelTop, label: page.title, onClick: () => onOpen(page.id), onContextMenu: event => openMenu(event, [
74
78
  { label: t('ta.nav.open'), run: () => onOpen(page.id) },
@@ -1,6 +1,9 @@
1
1
  import type { SessionMessage, SessionState, SessionStore } from '@celljs/ta-client';
2
2
  import * as React from 'react';
3
- /** How many rows of a conversation are drawn when it shows (from its end), and how many more each time the view nears the top of them. */
3
+ /**
4
+ * How many rows of a conversation are drawn when it shows (from its end), and how many more each time the view nears
5
+ * the top of them: a few at a time, each in a frame of its own, for a fling through them not to stutter.
6
+ */
4
7
  export declare const ROW_WINDOW: {
5
8
  first: number;
6
9
  more: number;
@@ -46,12 +49,16 @@ export declare namespace EarlierUtil {
46
49
  * How many messages were asked, so that earlier ones loaded in front do not count as sent: the view
47
50
  * goes to a message sent, and to the bottom of a conversation loaded again.
48
51
  */
49
- function asked(messages: readonly SessionMessage[], start: number, isAsk: (message: SessionMessage) => boolean, previous?: AskedCount): AskedCount & {
52
+ function asked(messages: readonly SessionMessage[], start: number, isAsk: AskTest, previous?: AskedCount): AskedCount & {
50
53
  count: number;
51
54
  };
52
55
  }
56
+ /** Whether the message at `index` of `messages` is one the user asked: a row of its own, where the view goes when sent. */
57
+ export type AskTest = (message: SessionMessage, index: number, messages: readonly SessionMessage[]) => boolean;
58
+ /** A message of the user, not one given to the agent on the way (ProcessUtil.steered), which is a step of its turn. */
59
+ export declare const isAsk: AskTest;
53
60
  /** EarlierUtil.asked for a view: `isAsk` should be the same function each render. */
54
- export declare function useAsked(state: SessionState, isAsk?: (message: SessionMessage) => boolean): number;
61
+ export declare function useAsked(state: SessionState, test?: AskTest): number;
55
62
  export declare function useRowWindow(): RowWindow;
56
63
  /**
57
64
  * The earlier messages of a long conversation, loaded as the view of `ref` nears the top of its thread
@@ -33,15 +33,19 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.EarlierUtil = exports.ROW_WINDOW = void 0;
36
+ exports.isAsk = exports.EarlierUtil = exports.ROW_WINDOW = void 0;
37
37
  exports.useAsked = useAsked;
38
38
  exports.useRowWindow = useRowWindow;
39
39
  exports.useEarlierMessages = useEarlierMessages;
40
40
  const React = __importStar(require("react"));
41
+ const process_1 = require("../util/process");
41
42
  /** Closer than this many heights of the view to the top of the thread, the earlier messages load. */
42
- const NEAR_TOP = 1.5;
43
- /** How many rows of a conversation are drawn when it shows (from its end), and how many more each time the view nears the top of them. */
44
- exports.ROW_WINDOW = { first: 12, more: 24 };
43
+ const NEAR_TOP = 2;
44
+ /**
45
+ * How many rows of a conversation are drawn when it shows (from its end), and how many more each time the view nears
46
+ * the top of them: a few at a time, each in a frame of its own, for a fling through them not to stutter.
47
+ */
48
+ exports.ROW_WINDOW = { first: 12, more: 8 };
45
49
  var EarlierUtil;
46
50
  (function (EarlierUtil) {
47
51
  /**
@@ -76,15 +80,17 @@ var EarlierUtil;
76
80
  }
77
81
  EarlierUtil.asked = asked;
78
82
  })(EarlierUtil || (exports.EarlierUtil = EarlierUtil = {}));
79
- const isUser = (message) => message.role === 'user';
83
+ /** A message of the user, not one given to the agent on the way (ProcessUtil.steered), which is a step of its turn. */
84
+ const isAsk = (message, index, messages) => message.role === 'user' && !process_1.ProcessUtil.steered(messages, index);
85
+ exports.isAsk = isAsk;
80
86
  /** EarlierUtil.asked for a view: `isAsk` should be the same function each render. */
81
- function useAsked(state, isAsk = isUser) {
87
+ function useAsked(state, test = exports.isAsk) {
82
88
  const previous = React.useRef(undefined);
83
89
  return React.useMemo(() => {
84
- const next = EarlierUtil.asked(state.messages, state.start, isAsk, previous.current);
90
+ const next = EarlierUtil.asked(state.messages, state.start, test, previous.current);
85
91
  previous.current = next;
86
92
  return next.count;
87
- }, [state.messages, state.start, isAsk]);
93
+ }, [state.messages, state.start, test]);
88
94
  }
89
95
  function useRowWindow() {
90
96
  const [rows, setRows] = React.useState(exports.ROW_WINDOW.first);
@@ -95,7 +101,8 @@ function useRowWindow() {
95
101
  }
96
102
  // Not again before the list drew them.
97
103
  hidden.current = 0;
98
- setRows(count => count + exports.ROW_WINDOW.more);
104
+ // Drawn as the page has time, not in the frame of a scroll.
105
+ React.startTransition(() => setRows(count => count + exports.ROW_WINDOW.more));
99
106
  return true;
100
107
  }, []);
101
108
  return React.useMemo(() => ({ rows, hidden, more }), [rows, more]);
@@ -16,6 +16,8 @@ export declare namespace RemoteHostsUtil {
16
16
  function problem(read: Exclude<TaLocation.HostInput, {
17
17
  host: string;
18
18
  }>, input: string, t: Translate): string;
19
+ /** `user@host:port` with a place to break after each `@`, `.` and `:`: on a phone a long host wraps there, not mid-word. */
20
+ function breakable(host: string): React.ReactNode;
19
21
  }
20
22
  export declare namespace FolderPickerUtil {
21
23
  /** The directory above; undefined at a root (`/`, `C:\`, the root of a host). */
@@ -54,6 +54,13 @@ var RemoteHostsUtil;
54
54
  return read.error === 'options' ? t('ta.remote.options', { options: read.options.join(' ') }) : t('ta.remote.invalid', { host: input.trim() });
55
55
  }
56
56
  RemoteHostsUtil.problem = problem;
57
+ /** `user@host:port` with a place to break after each `@`, `.` and `:`: on a phone a long host wraps there, not mid-word. */
58
+ function breakable(host) {
59
+ return host.split(/(?<=[@.:])/).map((part, index) => (React.createElement(React.Fragment, { key: index },
60
+ index > 0 && React.createElement("wbr", null),
61
+ part)));
62
+ }
63
+ RemoteHostsUtil.breakable = breakable;
57
64
  })(RemoteHostsUtil || (exports.RemoteHostsUtil = RemoteHostsUtil = {}));
58
65
  var FolderPickerUtil;
59
66
  (function (FolderPickerUtil) {