@celljs/ta-web 4.26.0 → 4.28.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 (290) hide show
  1. package/esm/browser/assistant/assistant-role.d.ts +9 -4
  2. package/esm/browser/assistant/assistant-role.js +17 -5
  3. package/esm/browser/assistant/assistant-task-util.d.ts +6 -0
  4. package/esm/browser/assistant/assistant-task-util.js +12 -1
  5. package/esm/browser/assistant/assistant-view.js +4 -1
  6. package/esm/browser/assistant/assistant.d.ts +2 -1
  7. package/esm/browser/assistant/assistant.js +9 -7
  8. package/esm/browser/assistant/call-conversing.d.ts +45 -0
  9. package/esm/browser/assistant/call-conversing.js +91 -0
  10. package/esm/browser/assistant/call-face.d.ts +13 -0
  11. package/esm/browser/assistant/call-face.js +81 -0
  12. package/esm/browser/assistant/call-keeper.d.ts +8 -4
  13. package/esm/browser/assistant/call-keeper.js +32 -11
  14. package/esm/browser/assistant/call-partnering.d.ts +37 -0
  15. package/esm/browser/assistant/call-partnering.js +79 -0
  16. package/esm/browser/assistant/call-scenes.d.ts +25 -0
  17. package/esm/browser/assistant/call-scenes.js +82 -0
  18. package/esm/browser/assistant/call-screen.d.ts +3 -0
  19. package/esm/browser/assistant/call-screen.js +15 -0
  20. package/esm/browser/assistant/mic-sense.d.ts +31 -0
  21. package/esm/browser/assistant/mic-sense.js +119 -0
  22. package/esm/browser/assistant/noise-gate.d.ts +32 -0
  23. package/esm/browser/assistant/noise-gate.js +66 -0
  24. package/esm/browser/assistant/pcm-util.d.ts +10 -0
  25. package/esm/browser/assistant/pcm-util.js +55 -0
  26. package/esm/browser/assistant/read-aloud.d.ts +2 -1
  27. package/esm/browser/assistant/realtime-voice-protocol.d.ts +84 -0
  28. package/esm/browser/assistant/realtime-voice-protocol.js +40 -0
  29. package/esm/browser/assistant/realtime-voice.d.ts +50 -62
  30. package/esm/browser/assistant/realtime-voice.js +213 -134
  31. package/esm/browser/assistant/spoken-timeline.d.ts +27 -0
  32. package/esm/browser/assistant/spoken-timeline.js +49 -0
  33. package/esm/browser/assistant/voice-call-bar.d.ts +9 -2
  34. package/esm/browser/assistant/voice-call-bar.js +81 -31
  35. package/esm/browser/assistant/voice-call-protocol.d.ts +61 -4
  36. package/esm/browser/assistant/voice-call.d.ts +16 -23
  37. package/esm/browser/assistant/voice-call.js +134 -117
  38. package/esm/browser/assistant/voice-reading.d.ts +83 -0
  39. package/esm/browser/assistant/voice-reading.js +150 -0
  40. package/esm/browser/avatar/dino-talk.d.ts +15 -0
  41. package/esm/browser/avatar/dino-talk.js +34 -0
  42. package/esm/browser/components/chat-home.d.ts +6 -4
  43. package/esm/browser/components/chat-home.js +7 -7
  44. package/esm/browser/components/chat-icon.js +9 -5
  45. package/esm/browser/components/chat-list-hooks.d.ts +14 -4
  46. package/esm/browser/components/chat-list-hooks.js +11 -5
  47. package/esm/browser/components/chat-list-row.d.ts +7 -4
  48. package/esm/browser/components/chat-list-row.js +22 -10
  49. package/esm/browser/components/chat-list.js +6 -11
  50. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  51. package/esm/browser/components/conversation-scroll-util.d.ts +8 -1
  52. package/esm/browser/components/conversation-scroll-util.js +21 -0
  53. package/esm/browser/components/conversation-scroll.js +10 -11
  54. package/esm/browser/components/gallery.js +28 -7
  55. package/esm/browser/components/host-view.d.ts +1 -1
  56. package/esm/browser/components/image-pull.d.ts +64 -0
  57. package/esm/browser/components/image-pull.js +202 -0
  58. package/esm/browser/components/kept-call-bar.js +2 -1
  59. package/esm/browser/components/lightbox.d.ts +1 -1
  60. package/esm/browser/components/lightbox.js +57 -2
  61. package/esm/browser/components/markdown.d.ts +3 -1
  62. package/esm/browser/components/markdown.js +8 -4
  63. package/esm/browser/components/partner-row.js +2 -1
  64. package/esm/browser/components/relay-services.d.ts +9 -3
  65. package/esm/browser/components/relay-services.js +73 -35
  66. package/esm/browser/components/session-view.js +4 -2
  67. package/esm/browser/components/settings-parts.js +2 -0
  68. package/esm/browser/components/ta-avatar.d.ts +15 -1
  69. package/esm/browser/components/ta-avatar.js +72 -11
  70. package/esm/browser/components/voice-services.js +6 -1
  71. package/esm/browser/extension/web-api-call.d.ts +64 -2
  72. package/esm/browser/extension/web-api-contributions.d.ts +1 -0
  73. package/esm/browser/extension/web-api-partners.d.ts +2 -0
  74. package/esm/browser/extension/web-extension-api.d.ts +6 -6
  75. package/esm/browser/extension/web-extension-context.js +1 -0
  76. package/esm/browser/extension/web-extension-protocol.d.ts +3 -1
  77. package/esm/browser/extension/web-extension-run.d.ts +3 -2
  78. package/esm/browser/extension/web-extension-run.js +2 -0
  79. package/esm/browser/hosts.d.ts +2 -0
  80. package/esm/browser/hosts.js +22 -3
  81. package/esm/browser/i18n/locales.d.ts +24 -5
  82. package/esm/browser/i18n/messages-ja.js +25 -6
  83. package/esm/browser/i18n/messages-zh-tw.js +25 -6
  84. package/esm/browser/i18n/messages.d.ts +23 -4
  85. package/esm/browser/i18n/messages.js +50 -12
  86. package/esm/browser/markdown/code-renderers.d.ts +2 -0
  87. package/esm/browser/markdown/code-renderers.js +2 -0
  88. package/esm/browser/screen/page-answers.d.ts +2 -1
  89. package/esm/browser/screen/page-answers.js +7 -4
  90. package/esm/browser/settings/settings-protocol.d.ts +2 -0
  91. package/esm/browser/settings/settings-protocol.js +2 -0
  92. package/esm/browser/style/chat-list.d.ts +1 -1
  93. package/esm/browser/style/chat-list.js +1 -1
  94. package/esm/browser/style/conversation.d.ts +1 -1
  95. package/esm/browser/style/conversation.js +6 -1
  96. package/esm/browser/style/device.js +1 -0
  97. package/esm/browser/style/dialogs.d.ts +1 -1
  98. package/esm/browser/style/dialogs.js +1 -1
  99. package/esm/browser/style/layout.d.ts +1 -1
  100. package/esm/browser/style/layout.js +135 -57
  101. package/esm/browser/style/shell.d.ts +1 -1
  102. package/esm/browser/style/shell.js +8 -0
  103. package/esm/browser/style/video-call.d.ts +2 -0
  104. package/esm/browser/style/video-call.js +52 -0
  105. package/esm/browser/style.js +2 -0
  106. package/esm/browser/util/desktop.d.ts +10 -1
  107. package/esm/browser/util/desktop.js +10 -0
  108. package/esm/browser/util/image-pull.d.ts +61 -0
  109. package/esm/browser/util/image-pull.js +88 -0
  110. package/esm/browser/util/spoken.d.ts +3 -3
  111. package/esm/browser/util/spoken.js +4 -4
  112. package/esm/browser/video-call/call-camera.d.ts +59 -0
  113. package/esm/browser/video-call/call-camera.js +188 -0
  114. package/esm/browser/video-call/call-window.d.ts +19 -0
  115. package/esm/browser/video-call/call-window.js +80 -0
  116. package/esm/browser/video-call/clip-plan.d.ts +47 -0
  117. package/esm/browser/video-call/clip-plan.js +60 -0
  118. package/esm/browser/video-call/face-clips.d.ts +33 -0
  119. package/esm/browser/video-call/face-clips.js +93 -0
  120. package/esm/browser/video-call/face-files.d.ts +31 -0
  121. package/esm/browser/video-call/face-files.js +77 -0
  122. package/esm/browser/video-call/video-call-view.d.ts +19 -0
  123. package/esm/browser/video-call/video-call-view.js +214 -0
  124. package/esm/browser/video-call/video-face.d.ts +13 -0
  125. package/esm/browser/video-call/video-face.js +497 -0
  126. package/esm/browser/workbench-hosts.d.ts +1 -0
  127. package/esm/browser/workbench-hosts.js +8 -4
  128. package/esm/browser/workbench-lists.d.ts +16 -1
  129. package/esm/browser/workbench-lists.js +38 -3
  130. package/esm/browser/workbench-protocol.d.ts +2 -0
  131. package/esm/browser/workbench-util.d.ts +5 -0
  132. package/esm/browser/workbench-util.js +18 -0
  133. package/esm/browser/workbench.d.ts +6 -0
  134. package/esm/browser/workbench.js +36 -5
  135. package/lib/browser/assistant/assistant-role.d.ts +9 -4
  136. package/lib/browser/assistant/assistant-role.js +17 -5
  137. package/lib/browser/assistant/assistant-task-util.d.ts +6 -0
  138. package/lib/browser/assistant/assistant-task-util.js +11 -0
  139. package/lib/browser/assistant/assistant-view.js +3 -0
  140. package/lib/browser/assistant/assistant.d.ts +2 -1
  141. package/lib/browser/assistant/assistant.js +9 -7
  142. package/lib/browser/assistant/call-conversing.d.ts +46 -0
  143. package/lib/browser/assistant/call-conversing.js +96 -0
  144. package/lib/browser/assistant/call-face.d.ts +14 -0
  145. package/lib/browser/assistant/call-face.js +117 -0
  146. package/lib/browser/assistant/call-keeper.d.ts +8 -4
  147. package/lib/browser/assistant/call-keeper.js +32 -11
  148. package/lib/browser/assistant/call-partnering.d.ts +38 -0
  149. package/lib/browser/assistant/call-partnering.js +83 -0
  150. package/lib/browser/assistant/call-scenes.d.ts +26 -0
  151. package/lib/browser/assistant/call-scenes.js +85 -0
  152. package/lib/browser/assistant/call-screen.d.ts +3 -0
  153. package/lib/browser/assistant/call-screen.js +15 -0
  154. package/lib/browser/assistant/mic-sense.d.ts +32 -0
  155. package/lib/browser/assistant/mic-sense.js +123 -0
  156. package/lib/browser/assistant/noise-gate.d.ts +33 -0
  157. package/lib/browser/assistant/noise-gate.js +71 -0
  158. package/lib/browser/assistant/pcm-util.d.ts +11 -0
  159. package/lib/browser/assistant/pcm-util.js +58 -0
  160. package/lib/browser/assistant/read-aloud.d.ts +2 -1
  161. package/lib/browser/assistant/realtime-voice-protocol.d.ts +85 -0
  162. package/lib/browser/assistant/realtime-voice-protocol.js +43 -0
  163. package/lib/browser/assistant/realtime-voice.d.ts +50 -62
  164. package/lib/browser/assistant/realtime-voice.js +217 -138
  165. package/lib/browser/assistant/spoken-timeline.d.ts +28 -0
  166. package/lib/browser/assistant/spoken-timeline.js +53 -0
  167. package/lib/browser/assistant/voice-call-bar.d.ts +9 -2
  168. package/lib/browser/assistant/voice-call-bar.js +81 -30
  169. package/lib/browser/assistant/voice-call-protocol.d.ts +61 -4
  170. package/lib/browser/assistant/voice-call.d.ts +16 -23
  171. package/lib/browser/assistant/voice-call.js +134 -117
  172. package/lib/browser/assistant/voice-reading.d.ts +84 -0
  173. package/lib/browser/assistant/voice-reading.js +156 -0
  174. package/lib/browser/avatar/dino-talk.d.ts +16 -0
  175. package/lib/browser/avatar/dino-talk.js +37 -0
  176. package/lib/browser/components/chat-home.d.ts +6 -4
  177. package/lib/browser/components/chat-home.js +8 -9
  178. package/lib/browser/components/chat-icon.js +9 -5
  179. package/lib/browser/components/chat-list-hooks.d.ts +14 -4
  180. package/lib/browser/components/chat-list-hooks.js +12 -6
  181. package/lib/browser/components/chat-list-row.d.ts +7 -4
  182. package/lib/browser/components/chat-list-row.js +23 -12
  183. package/lib/browser/components/chat-list.js +5 -10
  184. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  185. package/lib/browser/components/conversation-scroll-util.d.ts +8 -1
  186. package/lib/browser/components/conversation-scroll-util.js +21 -0
  187. package/lib/browser/components/conversation-scroll.js +10 -11
  188. package/lib/browser/components/gallery.js +28 -7
  189. package/lib/browser/components/host-view.d.ts +1 -1
  190. package/lib/browser/components/image-pull.d.ts +65 -0
  191. package/lib/browser/components/image-pull.js +206 -0
  192. package/lib/browser/components/kept-call-bar.js +2 -1
  193. package/lib/browser/components/lightbox.d.ts +1 -1
  194. package/lib/browser/components/lightbox.js +57 -2
  195. package/lib/browser/components/markdown.d.ts +3 -1
  196. package/lib/browser/components/markdown.js +7 -3
  197. package/lib/browser/components/partner-row.js +2 -1
  198. package/lib/browser/components/relay-services.d.ts +9 -3
  199. package/lib/browser/components/relay-services.js +71 -33
  200. package/lib/browser/components/session-view.js +3 -1
  201. package/lib/browser/components/settings-parts.js +2 -0
  202. package/lib/browser/components/ta-avatar.d.ts +15 -1
  203. package/lib/browser/components/ta-avatar.js +72 -11
  204. package/lib/browser/components/voice-services.js +5 -0
  205. package/lib/browser/extension/web-api-call.d.ts +64 -2
  206. package/lib/browser/extension/web-api-contributions.d.ts +1 -0
  207. package/lib/browser/extension/web-api-partners.d.ts +2 -0
  208. package/lib/browser/extension/web-extension-api.d.ts +6 -6
  209. package/lib/browser/extension/web-extension-context.js +1 -0
  210. package/lib/browser/extension/web-extension-protocol.d.ts +3 -1
  211. package/lib/browser/extension/web-extension-run.d.ts +3 -2
  212. package/lib/browser/extension/web-extension-run.js +2 -0
  213. package/lib/browser/hosts.d.ts +2 -0
  214. package/lib/browser/hosts.js +22 -3
  215. package/lib/browser/i18n/locales.d.ts +24 -5
  216. package/lib/browser/i18n/messages-ja.js +25 -6
  217. package/lib/browser/i18n/messages-zh-tw.js +25 -6
  218. package/lib/browser/i18n/messages.d.ts +23 -4
  219. package/lib/browser/i18n/messages.js +50 -12
  220. package/lib/browser/markdown/code-renderers.d.ts +2 -0
  221. package/lib/browser/markdown/code-renderers.js +3 -1
  222. package/lib/browser/screen/page-answers.d.ts +2 -1
  223. package/lib/browser/screen/page-answers.js +7 -4
  224. package/lib/browser/settings/settings-protocol.d.ts +2 -0
  225. package/lib/browser/settings/settings-protocol.js +2 -0
  226. package/lib/browser/style/chat-list.d.ts +1 -1
  227. package/lib/browser/style/chat-list.js +1 -1
  228. package/lib/browser/style/conversation.d.ts +1 -1
  229. package/lib/browser/style/conversation.js +6 -1
  230. package/lib/browser/style/device.js +1 -0
  231. package/lib/browser/style/dialogs.d.ts +1 -1
  232. package/lib/browser/style/dialogs.js +1 -1
  233. package/lib/browser/style/layout.d.ts +1 -1
  234. package/lib/browser/style/layout.js +135 -57
  235. package/lib/browser/style/shell.d.ts +1 -1
  236. package/lib/browser/style/shell.js +8 -0
  237. package/lib/browser/style/video-call.d.ts +3 -0
  238. package/lib/browser/style/video-call.js +55 -0
  239. package/lib/browser/style.js +2 -0
  240. package/lib/browser/util/desktop.d.ts +10 -1
  241. package/lib/browser/util/desktop.js +10 -0
  242. package/lib/browser/util/image-pull.d.ts +62 -0
  243. package/lib/browser/util/image-pull.js +91 -0
  244. package/lib/browser/util/spoken.d.ts +3 -3
  245. package/lib/browser/util/spoken.js +4 -4
  246. package/lib/browser/video-call/call-camera.d.ts +60 -0
  247. package/lib/browser/video-call/call-camera.js +192 -0
  248. package/lib/browser/video-call/call-window.d.ts +20 -0
  249. package/lib/browser/video-call/call-window.js +83 -0
  250. package/lib/browser/video-call/clip-plan.d.ts +48 -0
  251. package/lib/browser/video-call/clip-plan.js +64 -0
  252. package/lib/browser/video-call/face-clips.d.ts +34 -0
  253. package/lib/browser/video-call/face-clips.js +96 -0
  254. package/lib/browser/video-call/face-files.d.ts +32 -0
  255. package/lib/browser/video-call/face-files.js +82 -0
  256. package/lib/browser/video-call/video-call-view.d.ts +20 -0
  257. package/lib/browser/video-call/video-call-view.js +250 -0
  258. package/lib/browser/video-call/video-face.d.ts +14 -0
  259. package/lib/browser/video-call/video-face.js +533 -0
  260. package/lib/browser/workbench-hosts.d.ts +1 -0
  261. package/lib/browser/workbench-hosts.js +8 -4
  262. package/lib/browser/workbench-lists.d.ts +16 -1
  263. package/lib/browser/workbench-lists.js +38 -3
  264. package/lib/browser/workbench-protocol.d.ts +2 -0
  265. package/lib/browser/workbench-util.d.ts +5 -0
  266. package/lib/browser/workbench-util.js +18 -0
  267. package/lib/browser/workbench.d.ts +6 -0
  268. package/lib/browser/workbench.js +35 -4
  269. package/package.json +7 -7
  270. package/public/faces/README.md +27 -0
  271. package/public/faces/clap.mp4 +0 -0
  272. package/public/faces/dance.mp4 +0 -0
  273. package/public/faces/happy.mp4 +0 -0
  274. package/public/faces/heart.mp4 +0 -0
  275. package/public/faces/idle-1.mp4 +0 -0
  276. package/public/faces/idle-2.mp4 +0 -0
  277. package/public/faces/idle-3.mp4 +0 -0
  278. package/public/faces/laugh.mp4 +0 -0
  279. package/public/faces/lips.json +1 -0
  280. package/public/faces/listening.mp4 +0 -0
  281. package/public/faces/poster.jpg +0 -0
  282. package/public/faces/shy.mp4 +0 -0
  283. package/public/faces/sorry.mp4 +0 -0
  284. package/public/faces/stretch.mp4 +0 -0
  285. package/public/faces/surprised.mp4 +0 -0
  286. package/public/faces/talk-1.mp4 +0 -0
  287. package/public/faces/talk-2.mp4 +0 -0
  288. package/public/faces/think-2.mp4 +0 -0
  289. package/public/faces/thinking.mp4 +0 -0
  290. package/public/faces/wave.mp4 +0 -0
@@ -0,0 +1,150 @@
1
+ import { SpokenTimeline } from './spoken-timeline.js';
2
+ /** How often the captions look where the reading is, in ms. */
3
+ const CAPTION_MS = 80;
4
+ /**
5
+ * What a voice service reads now, on the clock of its sound as it plays (CallReading): it begins where its first sound
6
+ * plays, held as long as the face of a video call asks (RealtimeVoice.hold), and its captions show each sentence as it
7
+ * is heard, by the same timeline the face asks.
8
+ */
9
+ export class VoiceReading {
10
+ constructor(say, pieces, context, holdS,
11
+ /** Whether it is still what plays: once not, its captions stop. */
12
+ live, onPiece) {
13
+ this.say = say;
14
+ this.pieces = pieces;
15
+ this.context = context;
16
+ this.holdS = holdS;
17
+ this.live = live;
18
+ this.onPiece = onPiece;
19
+ /** Its sound as it was put to play: from `at` on the clock of the audio context, `from` seconds into it, for `seconds`. */
20
+ this.played = [];
21
+ this.shown = -1;
22
+ this.timeline = new SpokenTimeline(pieces, SpokenTimeline.pace(pieces.join('')));
23
+ }
24
+ /**
25
+ * How far into its sound it plays: where the sound playing now is in it, or where the last played ended while what
26
+ * comes next is late (the sound stopped short), so that the words, the clip and the mouth wait with the voice.
27
+ */
28
+ now() {
29
+ if (this.startAt === undefined) {
30
+ return -this.holdS;
31
+ }
32
+ const time = this.context.currentTime;
33
+ for (let i = this.played.length - 1; i >= 0; i--) {
34
+ const sound = this.played[i];
35
+ if (sound.at <= time) {
36
+ return sound.from + Math.min(sound.seconds, time - sound.at);
37
+ }
38
+ }
39
+ return time - this.startAt;
40
+ }
41
+ pieceAt(seconds) {
42
+ return this.timeline.at(Math.max(0, seconds));
43
+ }
44
+ /** More of its sound came: when the first of it plays, and how much of it there is. */
45
+ heard(at, seconds) {
46
+ if (this.startAt === undefined) {
47
+ this.startAt = at;
48
+ this.caption();
49
+ }
50
+ this.played.push({ at, from: this.timeline.received, seconds });
51
+ this.timeline.received += seconds;
52
+ }
53
+ /** Its words, more of them as they came (a voice that thinks says them as it goes): its sentences timed again. */
54
+ words(pieces) {
55
+ if (pieces.join('') === this.pieces.join('')) {
56
+ return;
57
+ }
58
+ const { received, said } = this.timeline;
59
+ this.pieces = pieces;
60
+ this.timeline = new SpokenTimeline(pieces, SpokenTimeline.pace(pieces.join('')));
61
+ this.timeline.received = received;
62
+ this.timeline.said = said;
63
+ this.shown = Math.min(this.shown, pieces.length - 1);
64
+ this.lastPieces = undefined;
65
+ }
66
+ /** All of its sound came: the timeline knows how long it is. */
67
+ said() {
68
+ this.timeline.said = true;
69
+ }
70
+ caption() {
71
+ if (!this.onPiece || this.timer) {
72
+ return;
73
+ }
74
+ const tick = () => {
75
+ var _a;
76
+ if (!this.live()) {
77
+ clearInterval(this.timer);
78
+ return;
79
+ }
80
+ const now = this.now();
81
+ // A sentence shown stays until the next is heard, its words timed again or not.
82
+ const index = now < 0 ? -1 : Math.max(this.shown, this.pieceAt(now));
83
+ if (index >= 0 && (index !== this.shown || this.lastPieces !== this.pieces)) {
84
+ this.shown = index;
85
+ this.lastPieces = this.pieces;
86
+ (_a = this.onPiece) === null || _a === void 0 ? void 0 : _a.call(this, [...this.pieces], index);
87
+ }
88
+ };
89
+ this.timer = setInterval(tick, CAPTION_MS);
90
+ tick();
91
+ }
92
+ }
93
+ /** The sound of what a voice reads, for the face of a video call (CallVoice.onSound), and the hold it asks (hold). */
94
+ export class VoiceSoundTap {
95
+ constructor() {
96
+ /** How long each reading waits before it plays, in seconds. */
97
+ this.holdS = 0;
98
+ this.listeners = new Set();
99
+ this.on = (listener) => {
100
+ this.listeners.add(listener);
101
+ return () => this.listeners.delete(listener);
102
+ };
103
+ this.hold = (ms) => {
104
+ var _a, _b;
105
+ this.holdS = Math.max(0, ms) / 1000;
106
+ (_b = (_a = this.voice) === null || _a === void 0 ? void 0 : _a.hold) === null || _b === void 0 ? void 0 : _b.call(_a, ms);
107
+ };
108
+ }
109
+ /** Of a call: the sound of its voice is told here, and the hold asked here goes to it; stops with what it returns. */
110
+ follow(voice) {
111
+ var _a, _b;
112
+ (_a = voice.hold) === null || _a === void 0 ? void 0 : _a.call(voice, this.holdS * 1000);
113
+ this.voice = voice;
114
+ const off = (_b = voice.onSound) === null || _b === void 0 ? void 0 : _b.call(voice, (say, pcm, rate) => this.tell(say, pcm, rate));
115
+ return () => {
116
+ off === null || off === void 0 ? void 0 : off();
117
+ if (this.voice === voice) {
118
+ this.voice = undefined;
119
+ }
120
+ };
121
+ }
122
+ tell(say, pcm, rate = 24000) {
123
+ for (const listener of this.listeners) {
124
+ listener(say, pcm, rate);
125
+ }
126
+ }
127
+ }
128
+ /**
129
+ * What the face of a call reads of its voice, whichever voice the call has now: how loud it plays (RMS, 0 to 1;
130
+ * undefined for the device's, which cannot tell), what it reads on the clock of its sound, and that sound.
131
+ */
132
+ export class CallSounds extends VoiceSoundTap {
133
+ constructor(voiceNow) {
134
+ super();
135
+ this.voiceNow = voiceNow;
136
+ this.level = () => { var _a, _b; return (_b = (_a = this.voiceNow()).level) === null || _b === void 0 ? void 0 : _b.call(_a); };
137
+ this.nowReading = () => { var _a, _b; return (_b = (_a = this.voiceNow()).nowReading) === null || _b === void 0 ? void 0 : _b.call(_a); };
138
+ }
139
+ /** Hears the user cut in while the voice of the call reads, and its sound (follow): stops both with what it returns. */
140
+ heard(voice, cut) {
141
+ var _a;
142
+ const offSound = this.follow(voice);
143
+ const offSpeech = (_a = voice.onSpeech) === null || _a === void 0 ? void 0 : _a.call(voice, cut);
144
+ return () => {
145
+ offSound();
146
+ offSpeech === null || offSpeech === void 0 ? void 0 : offSpeech();
147
+ };
148
+ }
149
+ }
150
+ //# sourceMappingURL=voice-reading.js.map
@@ -0,0 +1,15 @@
1
+ import type { Pose } from './dino-avatar.js';
2
+ /** How long a nod of a close-up that hears the user takes, in seconds. */
3
+ export declare const NOD = 0.55;
4
+ /** How a close-up moves in a call (CallFace): its mouth by the sound it plays, a nod to the words it hears. */
5
+ export declare namespace DinoTalkMotion {
6
+ /**
7
+ * How open the mouth of a close-up in a call is, `dt` seconds after it was `open`, for what plays now as loud as
8
+ * `level` (RMS, 0 to 1): it opens at once with a syllable and closes a little slower, as a mouth does.
9
+ */
10
+ function mouth(open: number, level: number, dt: number): number;
11
+ /** A close-up speaking by the sound it plays: the jaw as open as `open` (0 to 1), the head lifted a little with it. */
12
+ function speak(pose: Pose, open: number): Pose;
13
+ /** A close-up that hears the user nods, `t` seconds into a nod (NOD long). */
14
+ function nod(pose: Pose, t: number): Pose;
15
+ }
@@ -0,0 +1,34 @@
1
+ /** How long a nod of a close-up that hears the user takes, in seconds. */
2
+ export const NOD = 0.55;
3
+ /** How quickly the mouth of a close-up in a call opens with a syllable, and closes after it, in seconds. */
4
+ const MOUTH_OPEN = 0.035;
5
+ const MOUTH_CLOSE = 0.09;
6
+ /** How a close-up moves in a call (CallFace): its mouth by the sound it plays, a nod to the words it hears. */
7
+ export var DinoTalkMotion;
8
+ (function (DinoTalkMotion) {
9
+ /**
10
+ * How open the mouth of a close-up in a call is, `dt` seconds after it was `open`, for what plays now as loud as
11
+ * `level` (RMS, 0 to 1): it opens at once with a syllable and closes a little slower, as a mouth does.
12
+ */
13
+ function mouth(open, level, dt) {
14
+ // Speech plays at an RMS of about 0.05 to 0.3: its square root spreads it over the mouth.
15
+ const goal = Math.min(1, Math.sqrt(Math.max(0, level)) * 2.2);
16
+ const k = 1 - Math.exp(-dt / (goal > open ? MOUTH_OPEN : MOUTH_CLOSE));
17
+ return open + (goal - open) * k;
18
+ }
19
+ DinoTalkMotion.mouth = mouth;
20
+ /** A close-up speaking by the sound it plays: the jaw as open as `open` (0 to 1), the head lifted a little with it. */
21
+ function speak(pose, open) {
22
+ return { ...pose, jaw: 2 + 16 * open, head: pose.head - 2.5 * open };
23
+ }
24
+ DinoTalkMotion.speak = speak;
25
+ /** A close-up that hears the user nods, `t` seconds into a nod (NOD long). */
26
+ function nod(pose, t) {
27
+ if (t < 0 || t >= NOD) {
28
+ return pose;
29
+ }
30
+ return { ...pose, head: pose.head + 7 * Math.sin((t / NOD) * Math.PI), y: pose.y + 1.5 * Math.sin((t / NOD) * Math.PI) };
31
+ }
32
+ DinoTalkMotion.nod = nod;
33
+ })(DinoTalkMotion || (DinoTalkMotion = {}));
34
+ //# sourceMappingURL=dino-talk.js.map
@@ -30,15 +30,17 @@ export declare function ChatDoubleItem({ home, counts, unseen, now }: {
30
30
  * or unpinned as a folder is. What it opens shows as a conversation of the list does, the row selected while its page
31
31
  * or the conversation it stands for is in front.
32
32
  */
33
- export declare function ChatHomeItem({ row, time, home, selected, pinned, onPin, }: {
33
+ export declare const ChatHomeItem: React.MemoExoticComponent<({ row, time, shown, openItem, selected, pinned, onPin, }: {
34
34
  row: ChatHomeRow;
35
35
  time: string;
36
- home: ChatHome;
36
+ /** Its page is in front (ChatHome.shownItem). */
37
+ shown: boolean;
38
+ openItem: ChatHome['openItem'];
37
39
  /** The conversation it stands for is shown (WebHomeItem.sessionFile). */
38
40
  selected: boolean;
39
41
  pinned: boolean;
40
- onPin(pinned: boolean): void;
41
- }): React.JSX.Element;
42
+ onPin(key: string, pinned: boolean): void;
43
+ }) => React.JSX.Element>;
42
44
  /** What a row of a task does to the double's home: marks it seen, deletes it. */
43
45
  export type ChatTaskHome = Pick<ChatHome, 'look' | 'remove'>;
44
46
  /**
@@ -47,7 +47,7 @@ export function ChatDoubleItem({ home, counts, unseen, now }) {
47
47
  * or unpinned as a folder is. What it opens shows as a conversation of the list does, the row selected while its page
48
48
  * or the conversation it stands for is in front.
49
49
  */
50
- export function ChatHomeItem({ row, time, home, selected, pinned, onPin, }) {
50
+ export const ChatHomeItem = React.memo(function ChatHomeItem({ row, time, shown, openItem, selected, pinned, onPin, }) {
51
51
  var _a;
52
52
  const t = useT();
53
53
  const [menu, openMenu] = useContextMenu();
@@ -55,20 +55,20 @@ export function ChatHomeItem({ row, time, home, selected, pinned, onPin, }) {
55
55
  const { item, partner } = row;
56
56
  if (partner) {
57
57
  // A partner's conversation: the row the partners draw it with.
58
- const opens = () => home.openItem(item);
59
- return React.createElement(PartnerRow, { partner: partner, time: time, selected: home.shownItem === partner.key, open: opens, pinned: pinned, onPin: onPin });
58
+ const opens = () => openItem(item);
59
+ return React.createElement(PartnerRow, { partner: partner, time: time, selected: shown, open: opens, pinned: pinned, onPin: pin => onPin(row.key, pin) });
60
60
  }
61
61
  const Glyph = item.icon;
62
62
  const Own = item.face;
63
63
  const open = () => {
64
64
  setOpening(true);
65
65
  void Promise.resolve()
66
- .then(() => home.openItem(item))
66
+ .then(() => openItem(item))
67
67
  .catch(error => console.error(`A row of the home of ${item.extension} failed:`, error))
68
68
  .finally(() => setOpening(false));
69
69
  };
70
- const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(!pinned) };
71
- const current = selected || home.shownItem === item.key;
70
+ const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(row.key, !pinned) };
71
+ const current = selected || shown;
72
72
  return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-home-item${current ? ' ta-selected' : ''}`, "data-row": row.key, "data-unseen": item.unseen ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: open }], [pin])) },
73
73
  React.createElement("button", { type: "button", className: "ta-chat-item", title: item.title, "aria-current": current ? 'true' : undefined, onClick: open },
74
74
  React.createElement("span", { className: "ta-chat-avatar-box" },
@@ -76,7 +76,7 @@ export function ChatHomeItem({ row, time, home, selected, pinned, onPin, }) {
76
76
  React.createElement(Own, { size: 38 }))) : (React.createElement("span", { className: "ta-chat-avatar ta-chat-icon", style: { background: `var(--ta-tint-${item.tone})`, color: `var(--ta-tint-ink-${item.tone})`, width: 38, height: 38 }, "aria-hidden": "true" }, opening ? React.createElement("span", { className: "ta-spinner" }) : React.createElement(Glyph, { size: 18, strokeWidth: 1.8 }))),
77
77
  React.createElement(ChatDot, { unseen: !!item.unseen, asks: false })),
78
78
  React.createElement(RowText, { title: item.title, time: time, line: (_a = item.detail) !== null && _a !== void 0 ? _a : '', unseen: item.unseen }))));
79
- }
79
+ });
80
80
  /**
81
81
  * A task of the double that is no conversation (a team), or one that waits for the user: who does it, what it is at,
82
82
  * when; a blue ? while it waits, an amber dot once it ended unseen. It opens in the main area, its conversation or its
@@ -25,15 +25,19 @@ export var ChatIconUtil;
25
25
  }
26
26
  let memo = remembered.get(entries);
27
27
  if ((memo === null || memo === void 0 ? void 0 : memo.generation) !== generation) {
28
- memo = { generation, found: new Map() };
28
+ memo = { generation, found: new Map(), byChat: new WeakMap() };
29
29
  remembered.set(entries, memo);
30
30
  }
31
- const key = `${(_a = chat.group) !== null && _a !== void 0 ? _a : ''}\n${chat.cwd}\n${(_b = chat.sessionFile) !== null && _b !== void 0 ? _b : ''}`;
32
- if (memo.found.has(key)) {
33
- return memo.found.get(key);
31
+ // The same info of a conversation, asked again by each list and dot as they draw: found without a key made.
32
+ if (memo.byChat.has(chat)) {
33
+ return memo.byChat.get(chat);
34
34
  }
35
- const found = ask(entries, { sessionFile: chat.sessionFile, cwd: chat.cwd, ...(chat.group ? { group: chat.group } : {}) });
35
+ const key = `${(_a = chat.group) !== null && _a !== void 0 ? _a : ''}\n${chat.cwd}\n${(_b = chat.sessionFile) !== null && _b !== void 0 ? _b : ''}`;
36
+ const found = memo.found.has(key)
37
+ ? memo.found.get(key)
38
+ : ask(entries, { sessionFile: chat.sessionFile, cwd: chat.cwd, ...(chat.group ? { group: chat.group } : {}) });
36
39
  memo.found.set(key, found);
40
+ memo.byChat.set(chat, found);
37
41
  return found;
38
42
  }
39
43
  ChatIconUtil.find = find;
@@ -33,10 +33,20 @@ page: string): void;
33
33
  /** A conversation that comes to the top, is pinned or let go slides to its place in the list and in a folder opened, as the others make room. */
34
34
  export declare function useChatListMotion(list: React.RefObject<HTMLElement | null>, folder: React.RefObject<HTMLElement | null>): void;
35
35
  /**
36
- * What the rows of tasks do (ChatTaskItem), the same function and object however often the list draws: a row draws
37
- * again as its task does, not as the list or the page around it does.
36
+ * What the rows do (ChatTaskItem, ChatHomeItem, ChatFolderItem), the same functions and object however often the list
37
+ * draws: a row draws again as what it shows does, not as the list or the page around it does.
38
38
  */
39
- export declare function useTaskRows(onPicked: () => void, home: ChatHome | undefined): {
40
- picked: () => void;
39
+ export declare function useRowCalls(given: {
40
+ onPicked(): void;
41
+ home: ChatHome | undefined;
42
+ openFolder(key: string, archived?: boolean): void;
43
+ pinned: readonly string[];
44
+ onPinned(pinned: string[]): void;
45
+ }): {
46
+ picked(): void;
41
47
  taskHome: ChatTaskHome;
48
+ openItem: ChatHome['openItem'];
49
+ openFolder(key: string, archived?: boolean): void;
50
+ /** Pins or unpins a conversation's file or a folder's key: the last pinned first, as several may be. */
51
+ pinKey(key: string, pin: boolean): void;
42
52
  };
@@ -85,18 +85,24 @@ export function useChatListMotion(list, folder) {
85
85
  useListMotion(folder);
86
86
  }
87
87
  /**
88
- * What the rows of tasks do (ChatTaskItem), the same function and object however often the list draws: a row draws
89
- * again as its task does, not as the list or the page around it does.
88
+ * What the rows do (ChatTaskItem, ChatHomeItem, ChatFolderItem), the same functions and object however often the list
89
+ * draws: a row draws again as what it shows does, not as the list or the page around it does.
90
90
  */
91
- export function useTaskRows(onPicked, home) {
92
- const latest = React.useRef({ onPicked, home });
93
- latest.current = { onPicked, home };
91
+ export function useRowCalls(given) {
92
+ const latest = React.useRef(given);
93
+ latest.current = given;
94
94
  return React.useMemo(() => ({
95
+ pinKey: (key, pin) => {
96
+ const others = latest.current.pinned.filter(other => other !== key);
97
+ latest.current.onPinned(pin ? [key, ...others] : others);
98
+ },
95
99
  picked: () => latest.current.onPicked(),
96
100
  taskHome: {
97
101
  look: (key, at) => { var _a; return (_a = latest.current.home) === null || _a === void 0 ? void 0 : _a.look(key, at); },
98
102
  remove: tasks => { var _a; return (_a = latest.current.home) === null || _a === void 0 ? void 0 : _a.remove(tasks); },
99
103
  },
104
+ openItem: entry => { var _a; var _b; return (_b = (_a = latest.current.home) === null || _a === void 0 ? void 0 : _a.openItem(entry)) !== null && _b !== void 0 ? _b : Promise.resolve(); },
105
+ openFolder: (key, archived) => latest.current.openFolder(key, archived),
100
106
  }), []);
101
107
  }
102
108
  //# sourceMappingURL=chat-list-hooks.js.map
@@ -80,7 +80,7 @@ export declare function ChatDot({ unseen, asks, onSee }: {
80
80
  * of it with what it said; a dot while one of them said something unseen, a spinner while one works. It opens the folder,
81
81
  * and is pinned as a conversation is: from its menu, or a swipe to the left on a phone.
82
82
  */
83
- export declare function ChatFolderItem({ folder, time, selected, unseen, pinned, onOpen, onPin, actions, }: {
83
+ interface ChatFolderProps {
84
84
  folder: ChatFolder;
85
85
  time: string;
86
86
  /** The conversation shown is in it. */
@@ -88,9 +88,12 @@ export declare function ChatFolderItem({ folder, time, selected, unseen, pinned,
88
88
  /** Those of it that said something unseen: its dot, which dragged away sees them all. */
89
89
  unseen: ChatEntry[];
90
90
  pinned: boolean;
91
- onOpen(): void;
92
- onPin(pinned: boolean): void;
91
+ /** It is of the archive. */
92
+ archived?: boolean;
93
+ onOpen(key: string, archived?: boolean): void;
94
+ onPin(key: string, pinned: boolean): void;
93
95
  actions: ChatRowActions;
94
- }): React.JSX.Element;
96
+ }
97
+ export declare const ChatFolderItem: React.MemoExoticComponent<({ folder, time, selected, unseen, pinned, archived, onOpen, onPin, actions, }: ChatFolderProps) => React.JSX.Element>;
95
98
  export declare const ChatItem: React.MemoExoticComponent<({ session, source, selected, time, compact, actions, restorable, task, doubleName, handable, pinned, unseen, asking, draft, }: ItemProps) => React.JSX.Element>;
96
99
  export {};
@@ -71,12 +71,23 @@ export function ChatDot({ unseen, asks, onSee }) {
71
71
  }
72
72
  return (React.createElement(UnseenDrop, { className: unseen ? 'ta-chat-dot ta-on' : 'ta-chat-dot', label: unseen ? t('ta.chat.unseen') : undefined, onDismiss: unseen ? onSee : undefined }));
73
73
  }
74
- /**
75
- * The row of a folder (WebChatIcon.folder), as a messenger folds its subscriptions: its icon, its title, and the latest
76
- * of it with what it said; a dot while one of them said something unseen, a spinner while one works. It opens the folder,
77
- * and is pinned as a conversation is: from its menu, or a swipe to the left on a phone.
78
- */
79
- export function ChatFolderItem({ folder, time, selected, unseen, pinned, onOpen, onPin, actions, }) {
74
+ /** Folders are made again as any conversation changes: one draws again only when what it shows of them does. */
75
+ function sameFolder(a, b) {
76
+ const same = (x, y) => x.length === y.length && x.every((one, i) => one === y[i]);
77
+ return (a.time === b.time &&
78
+ a.selected === b.selected &&
79
+ a.pinned === b.pinned &&
80
+ a.archived === b.archived &&
81
+ a.onOpen === b.onOpen &&
82
+ a.onPin === b.onPin &&
83
+ a.actions === b.actions &&
84
+ same(a.unseen, b.unseen) &&
85
+ a.folder.key === b.folder.key &&
86
+ a.folder.title === b.folder.title &&
87
+ a.folder.icon === b.folder.icon &&
88
+ same(a.folder.sessions, b.folder.sessions));
89
+ }
90
+ export const ChatFolderItem = React.memo(function ChatFolderItem({ folder, time, selected, unseen, pinned, archived, onOpen, onPin, actions, }) {
80
91
  const t = useT();
81
92
  const onSee = () => {
82
93
  for (const session of unseen) {
@@ -88,10 +99,11 @@ export function ChatFolderItem({ folder, time, selected, unseen, pinned, onOpen,
88
99
  const shown = ChatListUtil.preview(latest, latestTitle);
89
100
  const said = shown && SecretTextUtil.plain(t, shown);
90
101
  const working = folder.sessions.some(session => ChatListUtil.isOpen(session) && session.isStreaming);
91
- const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(!pinned) };
102
+ const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(folder.key, !pinned) };
103
+ const open = () => onOpen(folder.key, archived);
92
104
  const [menu, openMenu] = useContextMenu();
93
- return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-folder${selected ? ' ta-selected' : ''}`, "data-row": folder.key, "data-unseen": unseen.length > 0 ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: onOpen }], [pin])) },
94
- React.createElement("button", { type: "button", className: "ta-chat-item", title: `${folder.title} (${folder.sessions.length})`, "aria-current": selected ? 'true' : undefined, onClick: onOpen },
105
+ return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-folder${selected ? ' ta-selected' : ''}`, "data-row": folder.key, "data-unseen": unseen.length > 0 ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: open }], [pin])) },
106
+ React.createElement("button", { type: "button", className: "ta-chat-item", title: `${folder.title} (${folder.sessions.length})`, "aria-current": selected ? 'true' : undefined, onClick: open },
95
107
  React.createElement("span", { className: "ta-chat-avatar-box" },
96
108
  React.createElement(ChatIconTile, { found: folder.icon, size: 38 }),
97
109
  React.createElement(ChatDot, { unseen: unseen.length > 0, asks: false, onSee: onSee })),
@@ -102,7 +114,7 @@ export function ChatFolderItem({ folder, time, selected, unseen, pinned, onOpen,
102
114
  React.createElement("span", { className: "ta-chat-line" },
103
115
  React.createElement("span", { className: `ta-chat-sub${unseen.length > 0 ? ' ta-unseen' : ''}` }, said ? t('ta.chat.folderLatest', { title: latestTitle, said }) : latestTitle),
104
116
  working && React.createElement("span", { className: "ta-chat-state ta-spinner" }))))));
105
- }
117
+ }, sameFolder);
106
118
  export const ChatItem = React.memo(function ChatItem({ session, source, selected, time, compact, actions, restorable, task, doubleName, handable, pinned, unseen, asking, draft, }) {
107
119
  var _a;
108
120
  const t = useT();
@@ -14,7 +14,7 @@ import { ChatBusyUtil } from './chat-busy.js';
14
14
  import { ChatHomeItem, ChatHomeTop, ChatTaskItem } from './chat-home.js';
15
15
  import { ChatHomeUtil } from './chat-home-util.js';
16
16
  import { ChatIconTile, ChatIconUtil } from './chat-icon.js';
17
- import { useChatListMotion, useMinute, useOfferPins, usePageEnd, useReadArchive, useTaskRows } from './chat-list-hooks.js';
17
+ import { useChatListMotion, useMinute, useOfferPins, usePageEnd, useReadArchive, useRowCalls } from './chat-list-hooks.js';
18
18
  import { ChatFolderItem, ChatItem } from './chat-list-row.js';
19
19
  import { CHAT_PAGE, ChatListUtil } from './chat-list-util.js';
20
20
  import { EmptyState } from './empty-state.js';
@@ -52,12 +52,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
52
52
  const sessionMenus = React.useContext(SessionMenus);
53
53
  const latest = React.useRef({ chat, double, onPicked, t, pinned, onPinned, sessionMenus, onLetGo, onUnseen });
54
54
  latest.current = { chat, double, onPicked, t, pinned, onPinned, sessionMenus, onLetGo, onUnseen };
55
- const { picked, taskHome } = useTaskRows(onPicked, home);
56
- // The last pinned first, as several may be: a conversation's file, a folder's key.
57
- const pinKey = React.useCallback((key, pin) => {
58
- const others = latest.current.pinned.filter(other => other !== key);
59
- latest.current.onPinned(pin ? [key, ...others] : others);
60
- }, []);
55
+ const { picked, taskHome, openItem, openFolder: opensFolder, pinKey } = useRowCalls({ onPicked, home, openFolder, pinned, onPinned });
61
56
  const actions = React.useMemo(() => {
62
57
  const pick = (change) => {
63
58
  void change;
@@ -234,7 +229,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
234
229
  });
235
230
  // Into a folder from the top of its list, and back where the list was left.
236
231
  const listScroll = React.useRef(0);
237
- const openFolder = (key, archived) => {
232
+ function openFolder(key, archived) {
238
233
  var _a;
239
234
  var _b;
240
235
  listScroll.current = (_b = (_a = scroller.current) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0;
@@ -244,7 +239,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
244
239
  if (!archivedSaved && pinned.includes(key)) {
245
240
  readArchive();
246
241
  }
247
- };
242
+ }
248
243
  const closeFolder = () => {
249
244
  setFolderShown(current => (handheld && current ? { ...current, open: false } : undefined));
250
245
  setQuery('');
@@ -269,9 +264,9 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
269
264
  setFolderShown(undefined);
270
265
  }
271
266
  }, [folderShown, folder]);
272
- const folderItem = (row, archived) => (React.createElement(ChatFolderItem, { key: row.key, folder: row, time: ChatListUtil.clock(row.updatedAt, now), selected: row.sessions.some(isSelected), unseen: row.sessions.filter(isUnseen), pinned: pinnedKeys.has(row.key), onOpen: () => openFolder(row.key, archived), onPin: pin => pinKey(row.key, pin), actions: actions }));
267
+ const folderItem = (row, archived) => (React.createElement(ChatFolderItem, { key: row.key, folder: row, time: ChatListUtil.clock(row.updatedAt, now), selected: row.sessions.some(isSelected), unseen: row.sessions.filter(isUnseen), pinned: pinnedKeys.has(row.key), archived: archived, onOpen: opensFolder, onPin: pinKey, actions: actions }));
273
268
  const taskItem = (row) => home && (React.createElement(ChatTaskItem, { key: row.key, task: row.task, home: taskHome, unseen: taskUnseen(row.task), time: ChatListUtil.clock(row.updatedAt, now), onPicked: picked }));
274
- const homeItem = (row) => { var _a; return home && (React.createElement(ChatHomeItem, { key: row.key, row: row, time: row.updatedAt ? ChatListUtil.clock(row.updatedAt, now) : '', home: home, selected: !!row.item.sessionFile && isSelected((_a = byFile.get(row.item.sessionFile)) !== null && _a !== void 0 ? _a : row.item.sessionFile), pinned: pinnedKeys.has(row.key), onPin: pin => pinKey(row.key, pin) })); };
269
+ const homeItem = (row) => { var _a; var _b, _c; return home && (React.createElement(ChatHomeItem, { key: row.key, row: row, time: row.updatedAt ? ChatListUtil.clock(row.updatedAt, now) : '', shown: home.shownItem === ((_b = (_a = row.partner) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : row.item.key), openItem: openItem, selected: !!row.item.sessionFile && isSelected((_c = byFile.get(row.item.sessionFile)) !== null && _c !== void 0 ? _c : row.item.sessionFile), pinned: pinnedKeys.has(row.key), onPin: pinKey })); };
275
270
  const rowItem = (row, compact) => ChatListUtil.isFolder(row) ? folderItem(row) : ChatListUtil.isTask(row) ? taskItem(row) : ChatListUtil.isHome(row) ? homeItem(row) : item(row, compact);
276
271
  // The conversation shown is found in the list, however it came to be shown: out of a search that hides it, and scrolled to.
277
272
  const scroller = React.useRef(null);