@celljs/ta-web 4.13.1 → 4.14.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 (85) hide show
  1. package/README.en.md +2 -2
  2. package/README.md +2 -2
  3. package/esm/browser/assistant/assistant-extension.js +3 -2
  4. package/esm/browser/assistant/assistant-state.js +2 -2
  5. package/esm/browser/components/app-view.js +4 -0
  6. package/esm/browser/components/chat-asks.d.ts +8 -0
  7. package/esm/browser/components/chat-asks.js +10 -0
  8. package/esm/browser/components/chat-list.js +11 -1
  9. package/esm/browser/components/composer-box.d.ts +2 -0
  10. package/esm/browser/components/composer-box.js +2 -1
  11. package/esm/browser/components/composer.d.ts +3 -1
  12. package/esm/browser/components/composer.js +16 -4
  13. package/esm/browser/components/face.d.ts +13 -1
  14. package/esm/browser/components/face.js +16 -1
  15. package/esm/browser/components/host-view.d.ts +1 -1
  16. package/esm/browser/components/message-list.js +20 -1
  17. package/esm/browser/components/people.d.ts +32 -0
  18. package/esm/browser/components/people.js +71 -0
  19. package/esm/browser/components/session-view.d.ts +1 -1
  20. package/esm/browser/components/session-view.js +56 -36
  21. package/esm/browser/components/settings-parts.js +14 -3
  22. package/esm/browser/components/sign-in-setup.d.ts +16 -0
  23. package/esm/browser/components/sign-in-setup.js +116 -0
  24. package/esm/browser/components/use-seen-chats.d.ts +2 -0
  25. package/esm/browser/components/use-seen-chats.js +2 -2
  26. package/esm/browser/extension/web-api-components.d.ts +12 -0
  27. package/esm/browser/extension/web-extension-api.d.ts +2 -2
  28. package/esm/browser/i18n/locales.d.ts +35 -1
  29. package/esm/browser/i18n/messages.d.ts +34 -0
  30. package/esm/browser/i18n/messages.js +69 -0
  31. package/esm/browser/presence/presence-reporter.d.ts +32 -0
  32. package/esm/browser/presence/presence-reporter.js +71 -0
  33. package/esm/browser/style/conversation.d.ts +1 -1
  34. package/esm/browser/style/conversation.js +24 -0
  35. package/esm/browser/style/layout.d.ts +1 -1
  36. package/esm/browser/style/layout.js +8 -0
  37. package/esm/browser/style/pages.d.ts +1 -1
  38. package/esm/browser/style/pages.js +8 -0
  39. package/esm/browser/workbench-protocol.d.ts +9 -0
  40. package/esm/browser/workbench-util.d.ts +2 -0
  41. package/esm/browser/workbench-util.js +18 -0
  42. package/esm/browser/workbench.d.ts +3 -0
  43. package/esm/browser/workbench.js +14 -4
  44. package/lib/browser/assistant/assistant-extension.js +3 -2
  45. package/lib/browser/assistant/assistant-state.js +1 -1
  46. package/lib/browser/components/app-view.js +4 -0
  47. package/lib/browser/components/chat-asks.d.ts +8 -0
  48. package/lib/browser/components/chat-asks.js +10 -0
  49. package/lib/browser/components/chat-list.js +11 -1
  50. package/lib/browser/components/composer-box.d.ts +2 -0
  51. package/lib/browser/components/composer-box.js +2 -1
  52. package/lib/browser/components/composer.d.ts +3 -1
  53. package/lib/browser/components/composer.js +16 -4
  54. package/lib/browser/components/face.d.ts +13 -1
  55. package/lib/browser/components/face.js +16 -1
  56. package/lib/browser/components/host-view.d.ts +1 -1
  57. package/lib/browser/components/message-list.js +19 -0
  58. package/lib/browser/components/people.d.ts +33 -0
  59. package/lib/browser/components/people.js +109 -0
  60. package/lib/browser/components/session-view.d.ts +1 -1
  61. package/lib/browser/components/session-view.js +56 -36
  62. package/lib/browser/components/settings-parts.js +14 -3
  63. package/lib/browser/components/sign-in-setup.d.ts +17 -0
  64. package/lib/browser/components/sign-in-setup.js +153 -0
  65. package/lib/browser/components/use-seen-chats.d.ts +2 -0
  66. package/lib/browser/components/use-seen-chats.js +3 -2
  67. package/lib/browser/extension/web-api-components.d.ts +12 -0
  68. package/lib/browser/extension/web-extension-api.d.ts +2 -2
  69. package/lib/browser/i18n/locales.d.ts +35 -1
  70. package/lib/browser/i18n/messages.d.ts +34 -0
  71. package/lib/browser/i18n/messages.js +69 -0
  72. package/lib/browser/presence/presence-reporter.d.ts +33 -0
  73. package/lib/browser/presence/presence-reporter.js +75 -0
  74. package/lib/browser/style/conversation.d.ts +1 -1
  75. package/lib/browser/style/conversation.js +24 -0
  76. package/lib/browser/style/layout.d.ts +1 -1
  77. package/lib/browser/style/layout.js +8 -0
  78. package/lib/browser/style/pages.d.ts +1 -1
  79. package/lib/browser/style/pages.js +8 -0
  80. package/lib/browser/workbench-protocol.d.ts +9 -0
  81. package/lib/browser/workbench-util.d.ts +2 -0
  82. package/lib/browser/workbench-util.js +18 -0
  83. package/lib/browser/workbench.d.ts +3 -0
  84. package/lib/browser/workbench.js +14 -4
  85. package/package.json +10 -10
@@ -467,6 +467,12 @@ export const LAYOUT_STYLE = `
467
467
  .ta-chat-dir { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: top; }
468
468
  .ta-chat-dir > svg { flex: none; }
469
469
  .ta-chat-flag { margin-right: 3px; }
470
+ .ta-chat-flag.ta-replying { color: var(--ta-secondary); }
471
+ .ta-chat-line > .ta-people { margin-left: 4px; }
472
+ /* Out of the way of the button that takes a row out, as its words are. */
473
+ .ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-line > .ta-people:last-child { margin-right: 28px; }
474
+ .ta-chat-line .ta-people-face { box-shadow: none; background: none; }
475
+ .ta-chat-line .ta-people-face + .ta-people-face { margin-left: -3px; }
470
476
  .ta-chat-flag.ta-failed { color: color-mix(in srgb, var(--ta-red) 85%, var(--ta-muted)); }
471
477
  .ta-chat-flag.ta-waiting, .ta-chat-state.ta-waiting { color: color-mix(in srgb, var(--ta-blue) 85%, var(--ta-muted)); }
472
478
  /* Its directory, in place of its time while the pointer is on it. */
@@ -534,6 +540,7 @@ export const LAYOUT_STYLE = `
534
540
  .ta-modal-head { display: flex; align-items: center; justify-content: space-between; padding-left: 2px; }
535
541
  .ta-modal-title { font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; }
536
542
  .ta-web-dialog { width: min(480px, 100%); gap: 14px; padding: 16px 18px 18px; }
543
+ .ta-web-dialog > :not(.ta-modal-head) { min-height: 0; overflow-y: auto; }
537
544
  .ta-web-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }
538
545
  .ta-folder-bar { display: flex; align-items: center; gap: 6px; }
539
546
  .ta-folder-bar .ta-field input { font-family: var(--ta-mono); font-size: calc(12.5px * var(--ta-font-scale)); }
@@ -595,6 +602,7 @@ body:has(.ta-folder) .ta-remote-status { display: none; }
595
602
  .ta-thread-item.ta-settled { content-visibility: auto; }
596
603
  /* Above the messages while the earlier ones of a long conversation load, as it is scrolled up. */
597
604
  .ta-earlier { display: flex; justify-content: center; padding: 12px 0; }
605
+ .ta-earlier-idle .ta-spinner { visibility: hidden; animation: none; }
598
606
 
599
607
  /* Model accounts: the sign-in page, the dialog and a sign-in under way */
600
608
  .ta-login-card { width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
@@ -1,2 +1,2 @@
1
1
  /** The settings page, the menus of the account, the lists of Discover and Me, and the fade of what streams in. */
2
- export declare const PAGES_STYLE = "\n/* The settings: a page of the main area, a table of contents in two levels beside the sections */\n.ta-settings-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }\n.ta-settings-head { justify-content: flex-start; gap: 10px; border-bottom: 1px solid var(--ta-border-muted); }\n.ta-settings-title { flex: none; font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; padding-left: 8px; }\n.ta-settings-search { flex: 1; max-width: 420px; height: 32px; margin: 0 auto; display: flex; align-items: center; gap: 6px; color: var(--ta-muted); }\n.ta-settings-search input { color: var(--ta-text); }\n.ta-settings-search .ta-icon-button { width: 22px; height: 22px; }\n.ta-settings-body { flex: 1; min-height: 0; display: flex; }\n.ta-settings-toc { flex: none; width: 200px; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--ta-border-muted); }\n.ta-settings-toc-part { display: flex; flex-direction: column; gap: 1px; }\n.ta-settings-toc-group { border: 0; background: none; text-align: left; padding: 2px 10px 4px; font-size: calc(12px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-muted); }\n.ta-settings-toc-group:hover { color: var(--ta-text); }\n.ta-settings-toc-item { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: calc(13px * var(--ta-font-scale)); color: var(--ta-secondary); transition: background 120ms, color 120ms; }\n.ta-settings-toc-item .ta-icon { flex: none; color: var(--ta-muted); }\n.ta-settings-toc-item:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-settings-toc-item.ta-active { background: var(--ta-selected); color: var(--ta-text); font-weight: 500; }\n.ta-settings-scroll { flex: 1; min-width: 0; overflow-y: auto; scroll-padding-top: 16px; }\n.ta-settings-content { max-width: 720px; margin: 0 auto; padding: 18px 24px calc(48px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 28px; }\n.ta-settings-content:has(> .ta-empty) { min-height: 100%; box-sizing: border-box; }\n.ta-settings-part { display: flex; flex-direction: column; gap: 18px; }\n.ta-settings-part-title { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: calc(18px * var(--ta-font-scale)); font-weight: 650; letter-spacing: -0.01em; }\n.ta-settings-part-hint { font-size: calc(12px * var(--ta-font-scale)); font-weight: 400; color: var(--ta-muted); }\n.ta-settings-scope { display: flex; flex-direction: column; gap: 6px; }\n.ta-settings-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--ta-raised); align-self: flex-start; max-width: 100%; }\n.ta-settings-tab { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }\n.ta-settings-tab:hover { color: var(--ta-text); }\n.ta-settings-tab.ta-active { background: var(--ta-segment); color: var(--ta-text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--ta-border); }\n.ta-settings-file { padding: 0 4px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); overflow-wrap: anywhere; }\n.ta-settings-note { padding: 10px 14px; border-radius: 10px; border: 1px dashed var(--ta-border); font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-secondary); }\n.ta-setting-row { position: relative; }\n.ta-setting-row.ta-modified::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 0 2px 2px 0; background: var(--ta-blue); }\n.ta-setting-control { gap: 6px; }\n.ta-setting-reset { width: 26px; height: 26px; }\n.ta-setting-row:not(:hover):not(:focus-within) .ta-setting-reset { opacity: 0; }\n.ta-setting-row:not(.ta-stacked) > .ta-setting-text { flex: 1 1 240px; }\n.ta-setting-row:not(.ta-stacked):has(> .ta-setting-icon) > .ta-setting-text { flex-basis: 160px; }\n.ta-setting-row:not(.ta-stacked) { flex-wrap: wrap; row-gap: 8px; }\n.ta-select, .ta-setting-input, .ta-setting-control .ta-model-field { width: 200px; height: 30px; font-size: calc(12.5px * var(--ta-font-scale)); padding: 0 8px; }\n.ta-select { appearance: auto; cursor: pointer; }\n.ta-setting-input::placeholder { color: var(--ta-muted); }\n/* The settings of a phone (PhoneSettings): the sections listed as Me's rows, each a page of grouped rows. */\n.ta-head-balance { flex: none; width: 32px; }\n.ta-settings-phone > .ta-list-head { padding-left: calc(6px + env(safe-area-inset-left)); padding-right: calc(6px + env(safe-area-inset-right)); }\n.ta-settings-phone .ta-list-content { gap: 20px; padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }\n.ta-settings-phone .ta-settings-search { flex: none; max-width: none; height: 38px; margin: 0; padding: 0 10px; border-radius: 10px; border-color: var(--ta-border-muted); background: var(--ta-list-cell); font-size: calc(15px * var(--ta-font-scale)); }\n.ta-settings-phone-group { display: flex; flex-direction: column; gap: 6px; }\n.ta-settings-phone-caption { margin: 0 4px; font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-settings-phone .ta-setting-card { border-radius: 12px; border-color: var(--ta-border-muted); background: var(--ta-list-cell); }\n.ta-settings-phone .ta-setting-row { min-height: 52px; padding: 12px 16px; gap: 12px; }\n.ta-settings-phone .ta-setting-row:not(.ta-stacked) > .ta-setting-text { flex: 1 1 0; }\n.ta-settings-phone .ta-setting-label { font-size: calc(15px * var(--ta-font-scale)); font-weight: 400; }\n.ta-settings-phone .ta-setting-description { margin-top: 2px; font-size: calc(13px * var(--ta-font-scale)); line-height: 1.4; }\n.ta-settings-phone .ta-setting-row.ta-stacked { gap: 10px; }\n.ta-settings-phone .ta-segmented button { height: 32px; }\n.ta-settings-phone .ta-settings-note { border-radius: 12px; }\n.ta-keys { display: inline-flex; gap: 3px; flex: none; }\n.ta-kbd { min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 5px; border: 1px solid var(--ta-border); border-bottom-width: 2px; background: var(--ta-raised); font: 500 calc(11px * var(--ta-font-scale)) var(--ta-sans); color: var(--ta-secondary); }\n\n/* The menus of the account at the foot of the rail */\n.ta-account-menu .ta-account-item { width: 100%; }\n.ta-account-menu .ta-account-item.ta-on { background: var(--ta-hover); }\n.ta-account-menu .ta-account-item:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-menu-chevron { color: var(--ta-muted) !important; }\n.ta-menu-check { width: 15px; flex: none; display: grid; place-items: center; color: var(--ta-text); }\n.ta-account-menu .ta-kbd { height: 18px; min-width: 18px; font-size: calc(10.5px * var(--ta-font-scale)); }\n.ta-submenu-anchor { position: relative; }\n.ta-submenu { left: calc(100% + 8px); bottom: auto; top: -6px; width: 180px; }\n@media (max-width: 860px), (max-height: 500px) and (pointer: coarse) {\n .ta-settings-toc { display: none; }\n .ta-settings-content { padding: 14px 14px calc(32px + env(safe-area-inset-bottom)); }\n /* No table of contents: the last section, jumped to from the menu of the account, still scrolls to the top. */\n .ta-settings-scroll { container-type: size; }\n .ta-settings-part:last-child > .ta-setting-section:last-child { min-height: calc(100cqh - 48px - env(safe-area-inset-bottom)); }\n .ta-settings-title { padding-left: 0; }\n .ta-settings-search { margin: 0; }\n .ta-setting-row:has(.ta-select, .ta-setting-input, .ta-model-field) .ta-setting-control { width: 100%; }\n .ta-setting-row .ta-select, .ta-setting-row .ta-setting-input, .ta-setting-row .ta-model-field { flex: 1; width: auto; min-width: 0; }\n .ta-setting-reset { opacity: 1 !important; }\n .ta-submenu { left: 12px; right: auto; top: auto; bottom: calc(100% + 4px); width: 200px; }\n}\n/* Discover and Me: rows in rounded groups, as the settings of a phone (list-rows.tsx) */\n.ta-list-page { flex: 1; min-height: 0; display: flex; flex-direction: column; --ta-list-bg: var(--ta-main); --ta-list-cell: var(--ta-side); background: var(--ta-list-bg); }\n:root[data-theme='light'] .ta-list-page { --ta-list-bg: var(--ta-side); --ta-list-cell: var(--ta-card); }\n.ta-list-head { border-bottom: 1px solid var(--ta-border-muted); }\n.ta-list-scroll { flex: 1; min-height: 0; overflow-y: auto; }\n.ta-list-content { max-width: 640px; margin: 0 auto; padding: 20px 20px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }\n.ta-list-group { display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--ta-border-muted); background: var(--ta-list-cell); overflow: hidden; }\n.ta-list-row { position: relative; display: flex; align-items: center; min-height: 48px; }\n.ta-list-row + .ta-list-row::before { content: ''; position: absolute; top: 0; right: 0; left: 46px; height: 1px; background: var(--ta-border-muted); }\n.ta-list-main { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; background: none; text-align: left; font-size: calc(14.5px * var(--ta-font-scale)); color: var(--ta-text); transition: background 120ms; }\n.ta-list-main:hover { background: var(--ta-hover); }\n.ta-list-main:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-list-icon { flex: none; color: var(--ta-secondary); }\n.ta-list-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-list-detail { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(13.5px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-list-chevron { flex: none; color: var(--ta-muted); }\n/* In place of the chevron while the page opens: as wide. */\n.ta-list-busy { margin: 0 1.5px; }\n.ta-list-trailing { flex: none; margin-right: 8px; color: var(--ta-muted); }\n/* WebView.mark of a page under Discover: before its pin, as WeChat shows who posted last by Moments. */\n.ta-list-mark { flex: none; display: inline-flex; align-items: center; margin-right: 2px; pointer-events: none; }\n.ta-list-row.ta-action .ta-list-main { justify-content: center; }\n.ta-list-row.ta-action .ta-list-label { flex: none; }\n.ta-list-row.ta-danger .ta-list-main { color: var(--ta-red); }\n.ta-list-row.ta-danger + .ta-list-row::before, .ta-list-row + .ta-list-row.ta-danger::before { left: 0; }\n.ta-list-hint { margin: -6px 4px 0; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-me-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 16px; border-radius: 12px; border: 1px solid var(--ta-border-muted); background: var(--ta-list-cell); font: inherit; text-align: left; color: inherit; transition: background 120ms; }\n.ta-me-card:hover, .ta-me-card:active { background: var(--ta-hover); }\n.ta-me-card:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-account-figure.ta-me-figure { border-radius: 16px; }\n.ta-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.35; }\n.ta-me-name { font-size: calc(18px * var(--ta-font-scale)); font-weight: 650; color: var(--ta-text); }\n.ta-me-host { font-size: calc(13px * var(--ta-font-scale)); color: var(--ta-secondary); }\n.ta-me-state { display: flex; align-items: center; gap: 6px; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); font-variant-numeric: tabular-nums; }\n/* The computers of this device (host-view.tsx): rows as the conversations, a sheet from the bottom on a phone */\n.ta-hosts-dialog { width: min(420px, 100%); gap: 12px; }\n.ta-hosts-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-host-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }\n.ta-host-row { border-radius: 12px; --ta-swipe-bg: var(--ta-card); }\n.ta-host-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 12px; background: var(--ta-card); font: inherit; text-align: left; color: var(--ta-text); transition: background 120ms; }\n.ta-host-item:hover, .ta-host-item:active { background: var(--ta-hover); }\n.ta-host-row.ta-selected .ta-host-item { background: var(--ta-selected); }\n.ta-host-item:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-host-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }\n.ta-host-name { font-size: calc(14.5px * var(--ta-font-scale)); font-weight: 600; }\n.ta-host-detail { font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-host-check { flex: none; color: var(--ta-green); }\n.ta-host-actions { display: flex; gap: 8px; }\n.ta-host-actions .ta-button { flex: 1; height: 40px; justify-content: center; gap: 6px; }\n.ta-host-form { display: flex; gap: 8px; width: 100%; animation: ta-in 200ms var(--ta-ease) both; }\n.ta-host-form .ta-field { flex: 1; height: 40px; }\n.ta-host-form .ta-button { height: 40px; min-width: 72px; justify-content: center; }\n.ta-scan-button { height: 46px; gap: 8px; font-size: calc(15px * var(--ta-font-scale)); justify-content: center; }\n.ta-link-button { padding: 4px 8px; border: 0; background: none; font: inherit; font-size: calc(13.5px * var(--ta-font-scale)); color: var(--ta-secondary); }\n.ta-link-button:hover { color: var(--ta-text); }\n.ta-host-saved { width: 100%; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; text-align: left; animation: ta-in 260ms var(--ta-ease) both; }\n.ta-host-saved h2 { margin: 0 4px; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-signin .ta-host-item { background: var(--ta-main); }\n.ta-signin .ta-host-item:hover, .ta-signin .ta-host-item:active { background: var(--ta-hover); }\n.ta-sign-in-accounts { display: flex; flex-direction: column; gap: 8px; width: 100%; animation: ta-in 200ms var(--ta-ease) both; }\n.ta-sign-in-account { height: 42px; gap: 8px; text-decoration: none; font-size: calc(14.5px * var(--ta-font-scale)); }\n.ta-sign-in-account:hover { background: var(--ta-hover); }\n.ta-sign-in-account[aria-busy='true'] { pointer-events: none; opacity: 0.7; }\n.ta-sign-in-mark { flex: none; }\n.ta-sign-in-or { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-sign-in-or::before, .ta-sign-in-or::after { content: ''; flex: 1; height: 1px; background: var(--ta-border); }\n.ta-access-account { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }\n.ta-access-avatar { width: 22px; height: 22px; flex: none; border-radius: 50%; object-fit: cover; }\n.ta-access-avatar.ta-chat-avatar { font-size: calc(11px * var(--ta-font-scale)); }\n.ta-access-bind { display: flex; flex-wrap: wrap; gap: 8px; }\n.ta-environment-chooser { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }\n.ta-environment-own { display: flex; flex-direction: column; gap: 8px; animation: ta-in 200ms var(--ta-ease) both; }\n.ta-environment-own .ta-button { align-self: flex-end; }\n.ta-environment-hint { margin: 0; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: 1.5; }\n.ta-environment-card { gap: 14px; }\n/* While the page loads again for another computer: which one, at once, over all. */\n.ta-switching { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--ta-main); color: var(--ta-secondary); font-size: calc(14px * var(--ta-font-scale)); animation: ta-fade 140ms ease-out both; }\n/* Me has no head: the card under the status bar. */\n.ta-me .ta-list-content { padding-top: calc(20px + env(safe-area-inset-top)); }\n@media (max-width: 860px), (max-height: 500px) and (pointer: coarse) {\n .ta-list-content { padding: 14px 12px calc(24px + env(safe-area-inset-bottom)); }\n .ta-me .ta-list-content { padding-top: calc(14px + env(safe-area-inset-top)); }\n}\n\n/* Streaming: what comes in fades in where it will stay; nothing already shown moves or draws again. */\n.ta-thread-new { animation: ta-in 220ms var(--ta-ease); }\n/* Words ta said on the way move from the reply into the steps when a tool follows them: they were on the screen, so they do not fade in again. */\n.ta-turn-live > .ta-markdown > *, .ta-process-active .ta-process-steps > :not(.ta-more, .ta-step-text), .ta-turn-live .ta-turn-head > .ta-process-head, .ta-turn-live .ta-turn-head > .ta-run-status { animation: ta-fade 240ms ease-out; }\n.ta-run-line { animation: ta-fade 200ms ease-out; }\n.ta-scroll { overflow-anchor: none; }\n/* The scroll bar held while a reply comes in: the thread keeps its height (ConversationScroller), what grows past it waits. */\n.ta-scroll-held { overflow-y: clip; }\n.ta-scroll-held > * { flex-shrink: 0; }\n/* The look of the double: it walks above, the kinds of dinosaur below, then the ways it walks */\n.ta-look { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }\n.ta-look-stage { height: 120px; flex: none; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }\n.ta-look-figure, .ta-look-walk { border-radius: 12px; background: var(--ta-raised); display: grid; place-items: center; }\n/* Wide enough for the walk to and fro (half the width of the dinosaur to either side of the middle, and itself). */\n.ta-look-walk { min-width: 220px; overflow: hidden; }\n.ta-look-label { font-size: calc(12px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-secondary); }\n.ta-look-kinds { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }\n.ta-look-kind { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 7px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: transparent; color: var(--ta-text); font-size: calc(12px * var(--ta-font-scale)); transition: background 120ms, border-color 120ms; }\n.ta-look-kind:hover { background: var(--ta-hover); }\n.ta-look-kind.ta-on { border-color: var(--ta-green); background: color-mix(in srgb, var(--ta-green) 8%, transparent); }\n.ta-look-name { max-width: 100%; }\n/* The voice replies are read with: its list, and a button to listen to it. */\n.ta-voice-picker { display: flex; align-items: center; gap: 8px; width: 100%; }\n.ta-voice-picker .ta-select { flex: 1; min-width: 0; }\n.ta-voice-picker .ta-button { flex: none; }\n.ta-look-premium { position: absolute; top: 4px; left: 4px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 8px; background: linear-gradient(135deg, #FCD866, #D98E14); color: #4a2c00; font-size: calc(10px * var(--ta-font-scale)); font-weight: 600; line-height: calc(14px * var(--ta-font-scale)); }\n/* Scan, as WeChat's: the camera over everything, a green glow sweeping down, round buttons on it; a photo for Ta asks on a sheet. */\n.ta-scan { position: fixed; inset: 0; z-index: 55; overflow: hidden; background: #000; color: #fff; animation: ta-fade 160ms ease-out; -webkit-user-select: none; user-select: none; }\n.ta-scan-video, .ta-scan-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }\n.ta-scan-mirrored { transform: scaleX(-1); }\n.ta-scan-line { position: absolute; left: 0; right: 0; top: 16%; height: 22%; pointer-events: none; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--ta-green) 40%, transparent) 88%, color-mix(in srgb, var(--ta-green) 90%, transparent) 100%); -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 30%, transparent 100%); animation: ta-scan-sweep 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }\n@keyframes ta-scan-sweep { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(220%); opacity: 0; } }\n.ta-scan-dot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #fff; background: var(--ta-green); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); animation: ta-scan-pop 260ms var(--ta-ease) both; }\n@keyframes ta-scan-pop { from { transform: scale(0.3); opacity: 0; } }\n.ta-scan-problem { position: absolute; top: 42%; left: 32px; right: 32px; margin: 0; text-align: center; color: rgba(255, 255, 255, 0.85); font-size: calc(15px * var(--ta-font-scale)); line-height: calc(22px * var(--ta-font-scale)); }\n.ta-scan-top { position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 18px; right: 18px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }\n.ta-scan-round { pointer-events: auto; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.32); color: #fff; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }\n.ta-scan-bottom { position: absolute; left: 18px; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 28px); display: flex; align-items: center; gap: 12px; }\n.ta-scan-side, .ta-scan-ask { border: 0; color: #fff; background: rgba(48, 48, 48, 0.58); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); transition: transform 120ms, background 120ms; }\n.ta-scan-side { flex: none; width: 62px; height: 62px; display: grid; place-items: center; padding: 0; border-radius: 50%; }\n.ta-scan-ask { flex: 1; min-width: 0; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 14px; border-radius: 31px; }\n.ta-scan-side:active, .ta-scan-ask:active { transform: scale(0.96); background: rgba(70, 70, 70, 0.66); }\n.ta-scan-side:disabled, .ta-scan-ask:disabled { opacity: 0.45; }\n.ta-scan-ask-title { display: flex; align-items: center; gap: 6px; font-size: calc(17px * var(--ta-font-scale)); font-weight: 600; line-height: calc(24px * var(--ta-font-scale)); }\n.ta-scan-ask-hint { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, 0.62); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }\n.ta-scan-sheet { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--ta-card); color: var(--ta-text); box-shadow: var(--ta-shadow-pop); animation: ta-in 220ms var(--ta-ease); }\n:root[data-keyboard] .ta-scan-sheet { bottom: var(--ta-keyboard, 0px); padding-bottom: 12px; }\n.ta-scan-sheet-title { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; }\n.ta-scan-chips { display: flex; flex-wrap: wrap; gap: 8px; }\n.ta-scan-chip { padding: 8px 14px; border: 1px solid var(--ta-border); border-radius: 999px; background: var(--ta-main); color: var(--ta-text); font-size: calc(14px * var(--ta-font-scale)); }\n.ta-scan-chip:active { background: var(--ta-hover); }\n.ta-scan-field { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border: 1px solid var(--ta-border); border-radius: 22px; background: var(--ta-main); }\n.ta-scan-field input { flex: 1; min-width: 0; height: 36px; border: 0; outline: none; background: transparent; color: var(--ta-text); font-size: max(16px, calc(15px * var(--ta-font-scale))); }\n.ta-scan-send { flex: none; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--ta-text); color: var(--ta-main); }\n.ta-scan-send:disabled { opacity: 0.5; }\n";
2
+ export declare const PAGES_STYLE = "\n/* The settings: a page of the main area, a table of contents in two levels beside the sections */\n.ta-settings-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }\n.ta-settings-head { justify-content: flex-start; gap: 10px; border-bottom: 1px solid var(--ta-border-muted); }\n.ta-settings-title { flex: none; font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; padding-left: 8px; }\n.ta-settings-search { flex: 1; max-width: 420px; height: 32px; margin: 0 auto; display: flex; align-items: center; gap: 6px; color: var(--ta-muted); }\n.ta-settings-search input { color: var(--ta-text); }\n.ta-settings-search .ta-icon-button { width: 22px; height: 22px; }\n.ta-settings-body { flex: 1; min-height: 0; display: flex; }\n.ta-settings-toc { flex: none; width: 200px; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--ta-border-muted); }\n.ta-settings-toc-part { display: flex; flex-direction: column; gap: 1px; }\n.ta-settings-toc-group { border: 0; background: none; text-align: left; padding: 2px 10px 4px; font-size: calc(12px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-muted); }\n.ta-settings-toc-group:hover { color: var(--ta-text); }\n.ta-settings-toc-item { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: calc(13px * var(--ta-font-scale)); color: var(--ta-secondary); transition: background 120ms, color 120ms; }\n.ta-settings-toc-item .ta-icon { flex: none; color: var(--ta-muted); }\n.ta-settings-toc-item:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-settings-toc-item.ta-active { background: var(--ta-selected); color: var(--ta-text); font-weight: 500; }\n.ta-settings-scroll { flex: 1; min-width: 0; overflow-y: auto; scroll-padding-top: 16px; }\n.ta-settings-content { max-width: 720px; margin: 0 auto; padding: 18px 24px calc(48px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 28px; }\n.ta-settings-content:has(> .ta-empty) { min-height: 100%; box-sizing: border-box; }\n.ta-settings-part { display: flex; flex-direction: column; gap: 18px; }\n.ta-settings-part-title { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: calc(18px * var(--ta-font-scale)); font-weight: 650; letter-spacing: -0.01em; }\n.ta-settings-part-hint { font-size: calc(12px * var(--ta-font-scale)); font-weight: 400; color: var(--ta-muted); }\n.ta-settings-scope { display: flex; flex-direction: column; gap: 6px; }\n.ta-settings-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--ta-raised); align-self: flex-start; max-width: 100%; }\n.ta-settings-tab { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }\n.ta-settings-tab:hover { color: var(--ta-text); }\n.ta-settings-tab.ta-active { background: var(--ta-segment); color: var(--ta-text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--ta-border); }\n.ta-settings-file { padding: 0 4px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); overflow-wrap: anywhere; }\n.ta-settings-note { padding: 10px 14px; border-radius: 10px; border: 1px dashed var(--ta-border); font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-secondary); }\n.ta-setting-row { position: relative; }\n.ta-setting-row.ta-modified::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 0 2px 2px 0; background: var(--ta-blue); }\n.ta-setting-control { gap: 6px; }\n.ta-setting-reset { width: 26px; height: 26px; }\n.ta-setting-row:not(:hover):not(:focus-within) .ta-setting-reset { opacity: 0; }\n.ta-setting-row:not(.ta-stacked) > .ta-setting-text { flex: 1 1 240px; }\n.ta-setting-row:not(.ta-stacked):has(> .ta-setting-icon) > .ta-setting-text { flex-basis: 160px; }\n.ta-setting-row:not(.ta-stacked) { flex-wrap: wrap; row-gap: 8px; }\n.ta-select, .ta-setting-input, .ta-setting-control .ta-model-field { width: 200px; height: 30px; font-size: calc(12.5px * var(--ta-font-scale)); padding: 0 8px; }\n.ta-select { appearance: auto; cursor: pointer; }\n.ta-setting-input::placeholder { color: var(--ta-muted); }\n/* The settings of a phone (PhoneSettings): the sections listed as Me's rows, each a page of grouped rows. */\n.ta-head-balance { flex: none; width: 32px; }\n.ta-settings-phone > .ta-list-head { padding-left: calc(6px + env(safe-area-inset-left)); padding-right: calc(6px + env(safe-area-inset-right)); }\n.ta-settings-phone .ta-list-content { gap: 20px; padding-left: calc(12px + env(safe-area-inset-left)); padding-right: calc(12px + env(safe-area-inset-right)); }\n.ta-settings-phone .ta-settings-search { flex: none; max-width: none; height: 38px; margin: 0; padding: 0 10px; border-radius: 10px; border-color: var(--ta-border-muted); background: var(--ta-list-cell); font-size: calc(15px * var(--ta-font-scale)); }\n.ta-settings-phone-group { display: flex; flex-direction: column; gap: 6px; }\n.ta-settings-phone-caption { margin: 0 4px; font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-settings-phone .ta-setting-card { border-radius: 12px; border-color: var(--ta-border-muted); background: var(--ta-list-cell); }\n.ta-settings-phone .ta-setting-row { min-height: 52px; padding: 12px 16px; gap: 12px; }\n.ta-settings-phone .ta-setting-row:not(.ta-stacked) > .ta-setting-text { flex: 1 1 0; }\n.ta-settings-phone .ta-setting-label { font-size: calc(15px * var(--ta-font-scale)); font-weight: 400; }\n.ta-settings-phone .ta-setting-description { margin-top: 2px; font-size: calc(13px * var(--ta-font-scale)); line-height: 1.4; }\n.ta-settings-phone .ta-setting-row.ta-stacked { gap: 10px; }\n.ta-settings-phone .ta-segmented button { height: 32px; }\n.ta-settings-phone .ta-settings-note { border-radius: 12px; }\n.ta-keys { display: inline-flex; gap: 3px; flex: none; }\n.ta-kbd { min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 5px; border: 1px solid var(--ta-border); border-bottom-width: 2px; background: var(--ta-raised); font: 500 calc(11px * var(--ta-font-scale)) var(--ta-sans); color: var(--ta-secondary); }\n\n/* The menus of the account at the foot of the rail */\n.ta-account-menu .ta-account-item { width: 100%; }\n.ta-account-menu .ta-account-item.ta-on { background: var(--ta-hover); }\n.ta-account-menu .ta-account-item:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-menu-chevron { color: var(--ta-muted) !important; }\n.ta-menu-check { width: 15px; flex: none; display: grid; place-items: center; color: var(--ta-text); }\n.ta-account-menu .ta-kbd { height: 18px; min-width: 18px; font-size: calc(10.5px * var(--ta-font-scale)); }\n.ta-submenu-anchor { position: relative; }\n.ta-submenu { left: calc(100% + 8px); bottom: auto; top: -6px; width: 180px; }\n@media (max-width: 860px), (max-height: 500px) and (pointer: coarse) {\n .ta-settings-toc { display: none; }\n .ta-settings-content { padding: 14px 14px calc(32px + env(safe-area-inset-bottom)); }\n /* No table of contents: the last section, jumped to from the menu of the account, still scrolls to the top. */\n .ta-settings-scroll { container-type: size; }\n .ta-settings-part:last-child > .ta-setting-section:last-child { min-height: calc(100cqh - 48px - env(safe-area-inset-bottom)); }\n .ta-settings-title { padding-left: 0; }\n .ta-settings-search { margin: 0; }\n .ta-setting-row:has(.ta-select, .ta-setting-input, .ta-model-field) .ta-setting-control { width: 100%; }\n .ta-setting-row .ta-select, .ta-setting-row .ta-setting-input, .ta-setting-row .ta-model-field { flex: 1; width: auto; min-width: 0; }\n .ta-setting-reset { opacity: 1 !important; }\n .ta-submenu { left: 12px; right: auto; top: auto; bottom: calc(100% + 4px); width: 200px; }\n}\n/* Discover and Me: rows in rounded groups, as the settings of a phone (list-rows.tsx) */\n.ta-list-page { flex: 1; min-height: 0; display: flex; flex-direction: column; --ta-list-bg: var(--ta-main); --ta-list-cell: var(--ta-side); background: var(--ta-list-bg); }\n:root[data-theme='light'] .ta-list-page { --ta-list-bg: var(--ta-side); --ta-list-cell: var(--ta-card); }\n.ta-list-head { border-bottom: 1px solid var(--ta-border-muted); }\n.ta-list-scroll { flex: 1; min-height: 0; overflow-y: auto; }\n.ta-list-content { max-width: 640px; margin: 0 auto; padding: 20px 20px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }\n.ta-list-group { display: flex; flex-direction: column; border-radius: 12px; border: 1px solid var(--ta-border-muted); background: var(--ta-list-cell); overflow: hidden; }\n.ta-list-row { position: relative; display: flex; align-items: center; min-height: 48px; }\n.ta-list-row + .ta-list-row::before { content: ''; position: absolute; top: 0; right: 0; left: 46px; height: 1px; background: var(--ta-border-muted); }\n.ta-list-main { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; gap: 12px; padding: 0 14px; border: 0; background: none; text-align: left; font-size: calc(14.5px * var(--ta-font-scale)); color: var(--ta-text); transition: background 120ms; }\n.ta-list-main:hover { background: var(--ta-hover); }\n.ta-list-main:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-list-icon { flex: none; color: var(--ta-secondary); }\n.ta-list-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-list-detail { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(13.5px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-list-chevron { flex: none; color: var(--ta-muted); }\n/* In place of the chevron while the page opens: as wide. */\n.ta-list-busy { margin: 0 1.5px; }\n.ta-list-trailing { flex: none; margin-right: 8px; color: var(--ta-muted); }\n/* WebView.mark of a page under Discover: before its pin, as WeChat shows who posted last by Moments. */\n.ta-list-mark { flex: none; display: inline-flex; align-items: center; margin-right: 2px; pointer-events: none; }\n.ta-list-row.ta-action .ta-list-main { justify-content: center; }\n.ta-list-row.ta-action .ta-list-label { flex: none; }\n.ta-list-row.ta-danger .ta-list-main { color: var(--ta-red); }\n.ta-list-row.ta-danger + .ta-list-row::before, .ta-list-row + .ta-list-row.ta-danger::before { left: 0; }\n.ta-list-hint { margin: -6px 4px 0; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-me-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 16px; border-radius: 12px; border: 1px solid var(--ta-border-muted); background: var(--ta-list-cell); font: inherit; text-align: left; color: inherit; transition: background 120ms; }\n.ta-me-card:hover, .ta-me-card:active { background: var(--ta-hover); }\n.ta-me-card:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-account-figure.ta-me-figure { border-radius: 16px; }\n.ta-me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.35; }\n.ta-me-name { font-size: calc(18px * var(--ta-font-scale)); font-weight: 650; color: var(--ta-text); }\n.ta-me-host { font-size: calc(13px * var(--ta-font-scale)); color: var(--ta-secondary); }\n.ta-me-state { display: flex; align-items: center; gap: 6px; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); font-variant-numeric: tabular-nums; }\n/* The computers of this device (host-view.tsx): rows as the conversations, a sheet from the bottom on a phone */\n.ta-hosts-dialog { width: min(420px, 100%); gap: 12px; }\n.ta-hosts-dialog .ta-modal-title { font-size: calc(16px * var(--ta-font-scale)); }\n.ta-host-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }\n.ta-host-row { border-radius: 12px; --ta-swipe-bg: var(--ta-card); }\n.ta-host-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 12px; background: var(--ta-card); font: inherit; text-align: left; color: var(--ta-text); transition: background 120ms; }\n.ta-host-item:hover, .ta-host-item:active { background: var(--ta-hover); }\n.ta-host-row.ta-selected .ta-host-item { background: var(--ta-selected); }\n.ta-host-item:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }\n.ta-host-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }\n.ta-host-name { font-size: calc(14.5px * var(--ta-font-scale)); font-weight: 600; }\n.ta-host-detail { font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-host-check { flex: none; color: var(--ta-green); }\n.ta-host-actions { display: flex; gap: 8px; }\n.ta-host-actions .ta-button { flex: 1; height: 40px; justify-content: center; gap: 6px; }\n.ta-host-form { display: flex; gap: 8px; width: 100%; animation: ta-in 200ms var(--ta-ease) both; }\n.ta-host-form .ta-field { flex: 1; height: 40px; }\n.ta-host-form .ta-button { height: 40px; min-width: 72px; justify-content: center; }\n.ta-scan-button { height: 46px; gap: 8px; font-size: calc(15px * var(--ta-font-scale)); justify-content: center; }\n.ta-link-button { padding: 4px 8px; border: 0; background: none; font: inherit; font-size: calc(13.5px * var(--ta-font-scale)); color: var(--ta-secondary); }\n.ta-link-button:hover { color: var(--ta-text); }\n.ta-host-saved { width: 100%; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; text-align: left; animation: ta-in 260ms var(--ta-ease) both; }\n.ta-host-saved h2 { margin: 0 4px; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-muted); }\n.ta-signin .ta-host-item { background: var(--ta-main); }\n.ta-signin .ta-host-item:hover, .ta-signin .ta-host-item:active { background: var(--ta-hover); }\n.ta-sign-in-accounts { display: flex; flex-direction: column; gap: 8px; width: 100%; animation: ta-in 200ms var(--ta-ease) both; }\n.ta-sign-in-account { height: 42px; gap: 8px; text-decoration: none; font-size: calc(14.5px * var(--ta-font-scale)); }\n.ta-sign-in-account:hover { background: var(--ta-hover); }\n.ta-sign-in-account[aria-busy='true'] { pointer-events: none; opacity: 0.7; }\n.ta-sign-in-mark { flex: none; }\n.ta-sign-in-or { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-sign-in-or::before, .ta-sign-in-or::after { content: ''; flex: 1; height: 1px; background: var(--ta-border); }\n.ta-access-account { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }\n.ta-access-avatar { width: 22px; height: 22px; flex: none; border-radius: 50%; object-fit: cover; }\n.ta-access-avatar.ta-chat-avatar { font-size: calc(11px * var(--ta-font-scale)); }\n.ta-access-bind { display: flex; flex-wrap: wrap; gap: 8px; }\n.ta-sign-in-name { display: inline-flex; align-items: center; gap: 6px; }\n.ta-sign-in-callbacks { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }\n.ta-sign-in-callback { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--ta-hover); }\n.ta-sign-in-callback code { flex: 1; min-width: 0; font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-sign-in-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }\n.ta-sign-in-field { display: flex; flex-direction: column; gap: 4px; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-sign-in-field .ta-input { height: 32px; }\n.ta-sign-in-actions { display: flex; justify-content: flex-end; gap: 8px; }\n.ta-environment-chooser { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }\n.ta-environment-own { display: flex; flex-direction: column; gap: 8px; animation: ta-in 200ms var(--ta-ease) both; }\n.ta-environment-own .ta-button { align-self: flex-end; }\n.ta-environment-hint { margin: 0; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: 1.5; }\n.ta-environment-card { gap: 14px; }\n/* While the page loads again for another computer: which one, at once, over all. */\n.ta-switching { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--ta-main); color: var(--ta-secondary); font-size: calc(14px * var(--ta-font-scale)); animation: ta-fade 140ms ease-out both; }\n/* Me has no head: the card under the status bar. */\n.ta-me .ta-list-content { padding-top: calc(20px + env(safe-area-inset-top)); }\n@media (max-width: 860px), (max-height: 500px) and (pointer: coarse) {\n .ta-list-content { padding: 14px 12px calc(24px + env(safe-area-inset-bottom)); }\n .ta-me .ta-list-content { padding-top: calc(14px + env(safe-area-inset-top)); }\n}\n\n/* Streaming: what comes in fades in where it will stay; nothing already shown moves or draws again. */\n.ta-thread-new { animation: ta-in 220ms var(--ta-ease); }\n/* Words ta said on the way move from the reply into the steps when a tool follows them: they were on the screen, so they do not fade in again. */\n.ta-turn-live > .ta-markdown > *, .ta-process-active .ta-process-steps > :not(.ta-more, .ta-step-text), .ta-turn-live .ta-turn-head > .ta-process-head, .ta-turn-live .ta-turn-head > .ta-run-status { animation: ta-fade 240ms ease-out; }\n.ta-run-line { animation: ta-fade 200ms ease-out; }\n.ta-scroll { overflow-anchor: none; }\n/* The scroll bar held while a reply comes in: the thread keeps its height (ConversationScroller), what grows past it waits. */\n.ta-scroll-held { overflow-y: clip; }\n.ta-scroll-held > * { flex-shrink: 0; }\n/* The look of the double: it walks above, the kinds of dinosaur below, then the ways it walks */\n.ta-look { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; }\n.ta-look-stage { height: 120px; flex: none; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }\n.ta-look-figure, .ta-look-walk { border-radius: 12px; background: var(--ta-raised); display: grid; place-items: center; }\n/* Wide enough for the walk to and fro (half the width of the dinosaur to either side of the middle, and itself). */\n.ta-look-walk { min-width: 220px; overflow: hidden; }\n.ta-look-label { font-size: calc(12px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-secondary); }\n.ta-look-kinds { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }\n.ta-look-kind { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 7px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: transparent; color: var(--ta-text); font-size: calc(12px * var(--ta-font-scale)); transition: background 120ms, border-color 120ms; }\n.ta-look-kind:hover { background: var(--ta-hover); }\n.ta-look-kind.ta-on { border-color: var(--ta-green); background: color-mix(in srgb, var(--ta-green) 8%, transparent); }\n.ta-look-name { max-width: 100%; }\n/* The voice replies are read with: its list, and a button to listen to it. */\n.ta-voice-picker { display: flex; align-items: center; gap: 8px; width: 100%; }\n.ta-voice-picker .ta-select { flex: 1; min-width: 0; }\n.ta-voice-picker .ta-button { flex: none; }\n.ta-look-premium { position: absolute; top: 4px; left: 4px; display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 8px; background: linear-gradient(135deg, #FCD866, #D98E14); color: #4a2c00; font-size: calc(10px * var(--ta-font-scale)); font-weight: 600; line-height: calc(14px * var(--ta-font-scale)); }\n/* Scan, as WeChat's: the camera over everything, a green glow sweeping down, round buttons on it; a photo for Ta asks on a sheet. */\n.ta-scan { position: fixed; inset: 0; z-index: 55; overflow: hidden; background: #000; color: #fff; animation: ta-fade 160ms ease-out; -webkit-user-select: none; user-select: none; }\n.ta-scan-video, .ta-scan-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }\n.ta-scan-mirrored { transform: scaleX(-1); }\n.ta-scan-line { position: absolute; left: 0; right: 0; top: 16%; height: 22%; pointer-events: none; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--ta-green) 40%, transparent) 88%, color-mix(in srgb, var(--ta-green) 90%, transparent) 100%); -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 60% 100% at 50% 100%, #000 30%, transparent 100%); animation: ta-scan-sweep 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }\n@keyframes ta-scan-sweep { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(220%); opacity: 0; } }\n.ta-scan-dot { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid #fff; background: var(--ta-green); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); animation: ta-scan-pop 260ms var(--ta-ease) both; }\n@keyframes ta-scan-pop { from { transform: scale(0.3); opacity: 0; } }\n.ta-scan-problem { position: absolute; top: 42%; left: 32px; right: 32px; margin: 0; text-align: center; color: rgba(255, 255, 255, 0.85); font-size: calc(15px * var(--ta-font-scale)); line-height: calc(22px * var(--ta-font-scale)); }\n.ta-scan-top { position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 18px; right: 18px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }\n.ta-scan-round { pointer-events: auto; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.32); color: #fff; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }\n.ta-scan-bottom { position: absolute; left: 18px; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 28px); display: flex; align-items: center; gap: 12px; }\n.ta-scan-side, .ta-scan-ask { border: 0; color: #fff; background: rgba(48, 48, 48, 0.58); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); transition: transform 120ms, background 120ms; }\n.ta-scan-side { flex: none; width: 62px; height: 62px; display: grid; place-items: center; padding: 0; border-radius: 50%; }\n.ta-scan-ask { flex: 1; min-width: 0; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 14px; border-radius: 31px; }\n.ta-scan-side:active, .ta-scan-ask:active { transform: scale(0.96); background: rgba(70, 70, 70, 0.66); }\n.ta-scan-side:disabled, .ta-scan-ask:disabled { opacity: 0.45; }\n.ta-scan-ask-title { display: flex; align-items: center; gap: 6px; font-size: calc(17px * var(--ta-font-scale)); font-weight: 600; line-height: calc(24px * var(--ta-font-scale)); }\n.ta-scan-ask-hint { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, 0.62); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }\n.ta-scan-sheet { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--ta-card); color: var(--ta-text); box-shadow: var(--ta-shadow-pop); animation: ta-in 220ms var(--ta-ease); }\n:root[data-keyboard] .ta-scan-sheet { bottom: var(--ta-keyboard, 0px); padding-bottom: 12px; }\n.ta-scan-sheet-title { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; }\n.ta-scan-chips { display: flex; flex-wrap: wrap; gap: 8px; }\n.ta-scan-chip { padding: 8px 14px; border: 1px solid var(--ta-border); border-radius: 999px; background: var(--ta-main); color: var(--ta-text); font-size: calc(14px * var(--ta-font-scale)); }\n.ta-scan-chip:active { background: var(--ta-hover); }\n.ta-scan-field { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border: 1px solid var(--ta-border); border-radius: 22px; background: var(--ta-main); }\n.ta-scan-field input { flex: 1; min-width: 0; height: 36px; border: 0; outline: none; background: transparent; color: var(--ta-text); font-size: max(16px, calc(15px * var(--ta-font-scale))); }\n.ta-scan-send { flex: none; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--ta-text); color: var(--ta-main); }\n.ta-scan-send:disabled { opacity: 0.5; }\n";
@@ -152,6 +152,14 @@ export const PAGES_STYLE = `
152
152
  .ta-access-avatar { width: 22px; height: 22px; flex: none; border-radius: 50%; object-fit: cover; }
153
153
  .ta-access-avatar.ta-chat-avatar { font-size: calc(11px * var(--ta-font-scale)); }
154
154
  .ta-access-bind { display: flex; flex-wrap: wrap; gap: 8px; }
155
+ .ta-sign-in-name { display: inline-flex; align-items: center; gap: 6px; }
156
+ .ta-sign-in-callbacks { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
157
+ .ta-sign-in-callback { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 4px 4px 10px; border-radius: 8px; background: var(--ta-hover); }
158
+ .ta-sign-in-callback code { flex: 1; min-width: 0; font-size: calc(12.5px * var(--ta-font-scale)); }
159
+ .ta-sign-in-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
160
+ .ta-sign-in-field { display: flex; flex-direction: column; gap: 4px; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); }
161
+ .ta-sign-in-field .ta-input { height: 32px; }
162
+ .ta-sign-in-actions { display: flex; justify-content: flex-end; gap: 8px; }
155
163
  .ta-environment-chooser { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }
156
164
  .ta-environment-own { display: flex; flex-direction: column; gap: 8px; animation: ta-in 200ms var(--ta-ease) both; }
157
165
  .ta-environment-own .ta-button { align-self: flex-end; }
@@ -65,6 +65,13 @@ export interface WorkbenchState {
65
65
  archived?: TaSavedSessionInfo[];
66
66
  }
67
67
  /** The web client's side of `ta serve`: one connection and the open sessions. */
68
+ /** What this page is at, for the others in the same Ta (PresenceReporter). */
69
+ export interface WorkbenchPresence {
70
+ /** The conversation in front of the user, the page seen; none otherwise. */
71
+ look(sessionId: string | undefined): void;
72
+ /** What the box of a conversation holds now: typing while it holds something and keys come. */
73
+ type(sessionId: string, typing: boolean): void;
74
+ }
68
75
  export interface TaWorkbench {
69
76
  readonly state: WorkbenchState;
70
77
  readonly server: TaServer;
@@ -79,6 +86,8 @@ export interface TaWorkbench {
79
86
  readonly relay: TaRelayServer;
80
87
  readonly remote: TaRemoteServer;
81
88
  readonly rooms: TaRoomServer;
89
+ /** What this page tells the others in the same Ta it is at (TaPresenceServer). */
90
+ readonly presence: WorkbenchPresence;
82
91
  subscribe(listener: (state: WorkbenchState) => void): () => void;
83
92
  /** Signs in with the token of the URL fragment (`ta serve --web`) or the one this page used before. */
84
93
  start(): Promise<void>;
@@ -40,6 +40,8 @@ export declare class WorkbenchError extends Error {
40
40
  export declare namespace WorkbenchUtil {
41
41
  /** A pairing link (`ta pair`) or else a token. */
42
42
  function credential(text: string): Credential;
43
+ /** What a page was opened to sign in with, in its fragment: `token`, or `pair` (a pairing link); undefined for neither or one not whole. */
44
+ function fromFragment(fragment: URLSearchParams): Credential | undefined;
43
45
  /**
44
46
  * Whether the ta serve in use runs on another machine than this browser: reached through a relay, from
45
47
  * the app, or at an address that is not this machine's. A sign-in there cannot come back to it by itself.
@@ -52,6 +52,24 @@ export var WorkbenchUtil;
52
52
  }
53
53
  }
54
54
  WorkbenchUtil.credential = credential;
55
+ /** What a page was opened to sign in with, in its fragment: `token`, or `pair` (a pairing link); undefined for neither or one not whole. */
56
+ function fromFragment(fragment) {
57
+ const token = fragment.get('token');
58
+ if (token) {
59
+ return { token };
60
+ }
61
+ const pair = fragment.get('pair');
62
+ if (!pair) {
63
+ return undefined;
64
+ }
65
+ try {
66
+ return { pairing: RelayPairingUtil.parse(pair) };
67
+ }
68
+ catch (_a) {
69
+ return undefined;
70
+ }
71
+ }
72
+ WorkbenchUtil.fromFragment = fromFragment;
55
73
  /**
56
74
  * Whether the ta serve in use runs on another machine than this browser: reached through a relay, from
57
75
  * the app, or at an address that is not this machine's. A sign-in there cannot come back to it by itself.
@@ -1,6 +1,7 @@
1
1
  import { SessionStore, type SessionStoreOptions, TaConnection } from '@celljs/ta-client';
2
2
  import { type TaAccessServer, type TaAuthEvent, type TaAuthServer, type TaGatewayServer, type TaPackageServer, type TaRelayServer, type TaRemoteEvent, type TaRemoteServer, type TaRoomEvent, type TaRoomServer, type TaRoomWatch, type TaServer, type TaServerInfo, type TaSessionInfo, type TaSettingsServer, type TaTerminalServer, type TaWorkspaceServer } from '@celljs/ta-protocol';
3
3
  import { type HostList } from './hosts.js';
4
+ import { PresenceReporter } from './presence/presence-reporter.js';
4
5
  import { WorkbenchCalls } from './workbench-calls.js';
5
6
  import { type Credential, TaWorkbench, type WorkbenchState } from './workbench-protocol.js';
6
7
  import { type ServiceName } from './workbench-util.js';
@@ -8,6 +9,8 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
8
9
  protected list: HostList;
9
10
  protected current: WorkbenchState;
10
11
  protected connection?: TaConnection;
12
+ /** On the connection of the time, only while it is open: what it was at goes again once it opens (resend). */
13
+ readonly presence: PresenceReporter;
11
14
  protected retryTimer?: ReturnType<typeof setTimeout>;
12
15
  /** While ta serve is not running: the next attempt, which `reconnect` makes at once. */
13
16
  protected retry?: () => void;
@@ -10,6 +10,7 @@ import { TA_WEBSOCKET_PATH, TaErrorCode, TaRoomWatchUtil, } from '@celljs/ta-pro
10
10
  import { RelaySocket } from '@celljs/ta-relay';
11
11
  import { HostUtil } from './hosts.js';
12
12
  import { deviceValues, OfflineKeys } from './offline/device-values.js';
13
+ import { PresenceReporter } from './presence/presence-reporter.js';
13
14
  import { DEFAULT_SETTINGS } from './settings/settings-protocol.js';
14
15
  import { StateUtil } from './state/state-protocol.js';
15
16
  import { WorkbenchCalls } from './workbench-calls.js';
@@ -19,6 +20,12 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
19
20
  constructor() {
20
21
  this.list = WorkbenchUtil.readHosts(storage());
21
22
  this.current = { status: 'connecting', hosts: this.list.hosts, host: this.list.current, sessions: [], saved: [] };
23
+ /** On the connection of the time, only while it is open: what it was at goes again once it opens (resend). */
24
+ this.presence = new PresenceReporter(state => {
25
+ if (this.connection && this.current.status === 'online') {
26
+ this.connection.presence.report(state).catch(() => undefined);
27
+ }
28
+ });
22
29
  this.attempts = 0;
23
30
  this.graceMs = GRACE_MS;
24
31
  /** What was kept of the computers dropped, being taken off the device. */
@@ -138,13 +145,13 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
138
145
  }
139
146
  async start() {
140
147
  this.watchWake();
141
- const fromUrl = new URLSearchParams(location.hash.slice(1)).get('token');
148
+ const fragment = new URLSearchParams(location.hash.slice(1));
149
+ // A token of `ta serve --web`, or a pairing link: the page of a relay opened for one let in from a browser (docs/design/ta-team.md 8.3).
150
+ const fromUrl = WorkbenchUtil.fromFragment(fragment);
142
151
  if (fromUrl) {
143
152
  // Out of the address bar, the history and bookmarks.
144
153
  history.replaceState(null, '', location.pathname + location.search);
145
- }
146
- if (fromUrl) {
147
- this.keepHosts(HostUtil.use(this.list, WorkbenchUtil.serverOf({ token: fromUrl }, pageHost()), { token: fromUrl }, Date.now()));
154
+ this.keepHosts(HostUtil.use(this.list, WorkbenchUtil.serverOf(fromUrl, pageHost()), fromUrl, Date.now()));
148
155
  }
149
156
  const host = this.list.hosts.find(one => one.id === this.list.current);
150
157
  if (host) {
@@ -348,6 +355,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
348
355
  return;
349
356
  }
350
357
  this.update({ status: 'online', retryAt: undefined });
358
+ this.presence.resend();
351
359
  void this.refresh();
352
360
  void this.watchRemote(connection);
353
361
  this.roomsWatched = undefined;
@@ -362,6 +370,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
362
370
  // Through a relay the computer has let the page in once the socket is open, and no gateway is behind
363
371
  // it: the calls of the page go now, with the one that reads who it is, not a round trip after it.
364
372
  this.update({ status: 'online', error: undefined, retryAt: undefined });
373
+ this.presence.resend();
365
374
  }
366
375
  let server;
367
376
  try {
@@ -380,6 +389,7 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
380
389
  }
381
390
  this.keepHosts(HostUtil.use(this.list, WorkbenchUtil.serverOf(credential, pageHost()), credential, Date.now(), { user: server.user, host: server.host }));
382
391
  this.update({ status: 'online', error: undefined, retryAt: undefined, server });
392
+ this.presence.resend();
383
393
  await this.refresh();
384
394
  }
385
395
  /** A connection to the computer of `credential`, not opened yet, and whether that computer refused it once it failed. */
@@ -135,8 +135,9 @@ let AssistantWebExtension = class AssistantWebExtension {
135
135
  remove,
136
136
  asking: task => {
137
137
  var _a;
138
- const info = this.workbench.state.sessions.find(each => each.sessionId === task.sessionId);
139
- return info && ((_a = chat_asks_1.ChatAskUtil.asking(info, this.persisted.get(chat_asks_1.LET_GO_ASKS))) === null || _a === void 0 ? void 0 : _a.question);
138
+ const { sessions, saved } = this.workbench.state;
139
+ const entry = chat_asks_1.ChatAskUtil.entryOf(sessions, saved, task);
140
+ return entry && ((_a = chat_asks_1.ChatAskUtil.asking(entry, this.persisted.get(chat_asks_1.LET_GO_ASKS))) === null || _a === void 0 ? void 0 : _a.question);
140
141
  },
141
142
  watchAsking: listener => {
142
143
  const stops = [this.workbench.subscribe(() => listener()), this.persisted.subscribe(() => listener())];
@@ -9,7 +9,7 @@ const state_protocol_1 = require("../state/state-protocol");
9
9
  exports.ASSISTANT_NAME_STATE = { key: 'assistant.name', tier: 'user', initial: '', parse: state_protocol_1.StateUtil.string };
10
10
  /** The kind of dinosaur the double is and how it walks: the figure of the account follows it, in every browser. */
11
11
  exports.ASSISTANT_SPECIES_STATE = {
12
- key: 'assistant.species',
12
+ key: ta_protocol_1.TA_DOUBLE_LOOK.key,
13
13
  tier: 'user',
14
14
  initial: dino_species_1.DinoSpecies.DEFAULT,
15
15
  parse: value => dino_species_1.DinoSpecies.IDS.find(id => id === value),
@@ -86,6 +86,7 @@ const share_dialog_1 = require("./share-dialog");
86
86
  const side_lists_1 = require("./side-lists");
87
87
  const split_pane_1 = require("./split-pane");
88
88
  const surface_flyout_1 = require("./surface-flyout");
89
+ const use_seen_chats_1 = require("./use-seen-chats");
89
90
  const workbench_toggle_1 = require("./workbench-toggle");
90
91
  const workbench_view_1 = require("./workbench-view");
91
92
  /**
@@ -303,6 +304,9 @@ function AppShell() {
303
304
  React.useEffect(() => host.setConversationShown(conversationShown), [host, conversationShown]);
304
305
  // What the user has seen is kept here, whichever list or tab is out: one read from the agents' list is seen too.
305
306
  const { seen: seenChats, looking } = (0, assistant_chat_list_1.useSeenConversations)(workbench.sessions, conversationShown ? store === null || store === void 0 ? void 0 : store.sessionId : undefined, (view === null || view === void 0 ? void 0 : view.id) === side_lists_1.DOUBLE_PAGE && settings === undefined && (!phone || screenOpen || view === tabView));
307
+ // The others in the same Ta see who looks at a conversation with them (TaSessionInfo.people), while the page is seen.
308
+ const pageVisible = (0, use_seen_chats_1.usePageVisible)();
309
+ React.useEffect(() => bench.presence.look(pageVisible ? looking : undefined), [bench, pageVisible, looking]);
306
310
  const state = (0, react_1.useInject)(state_protocol_1.TaState);
307
311
  const { pageShown } = extensions;
308
312
  // biome-ignore lint/correctness/useExhaustiveDependencies: follows the pages shown
@@ -29,6 +29,14 @@ export declare namespace ChatAskUtil {
29
29
  function letGo(before: LetGoAsks, file: string, at: number): LetGoAsks;
30
30
  /** What it still asks the user: none once answered or let go. */
31
31
  function asking(entry: AskingEntry, letGo: LetGoAsks): TaAsking | undefined;
32
+ /**
33
+ * What the lists know of the conversation of a session: as the server tells it while open, by its id or its file;
34
+ * from its file once closed (closed while idle, what it asked stays there, as the saved ones of the chats show).
35
+ */
36
+ function entryOf(sessions: readonly TaSessionInfo[], saved: readonly TaSavedSessionInfo[], session: {
37
+ sessionId: string;
38
+ sessionFile?: string;
39
+ }): AskingEntry | undefined;
32
40
  /** Whether it waits for the user: it asks, or a dialog of it waits. */
33
41
  function waits(entry: AskingEntry, letGo: LetGoAsks): boolean;
34
42
  /** How many of the conversations the list shows wait for the user: the count on the tab of the chats. */
@@ -56,6 +56,16 @@ var ChatAskUtil;
56
56
  return asking && asking.at > ((_a = letGo[fileOf(entry)]) !== null && _a !== void 0 ? _a : -1) ? asking : undefined;
57
57
  }
58
58
  ChatAskUtil.asking = asking;
59
+ /**
60
+ * What the lists know of the conversation of a session: as the server tells it while open, by its id or its file;
61
+ * from its file once closed (closed while idle, what it asked stays there, as the saved ones of the chats show).
62
+ */
63
+ function entryOf(sessions, saved, session) {
64
+ const { sessionId, sessionFile } = session;
65
+ const open = sessions.find(each => each.sessionId === sessionId || (!!sessionFile && each.sessionFile === sessionFile));
66
+ return open !== null && open !== void 0 ? open : (sessionFile ? saved.find(each => each.sessionFile === sessionFile) : undefined);
67
+ }
68
+ ChatAskUtil.entryOf = entryOf;
59
69
  /** Whether it waits for the user: it asks, or a dialog of it waits. */
60
70
  function waits(entry, letGo) {
61
71
  return !!entry.waiting || !!asking(entry, letGo);
@@ -53,6 +53,7 @@ const context_menu_1 = require("./context-menu");
53
53
  const empty_state_1 = require("./empty-state");
54
54
  const host_tag_1 = require("./host-tag");
55
55
  const icon_1 = require("./icon");
56
+ const people_1 = require("./people");
56
57
  const swipe_row_1 = require("./swipe-row");
57
58
  const ta_avatar_1 = require("./ta-avatar");
58
59
  /** The list by directory or package, else by day; in any browser. */
@@ -300,7 +301,8 @@ var ChatListUtil;
300
301
  a.cwd === b.cwd &&
301
302
  a.group === b.group &&
302
303
  (isOpen(a) && a.isStreaming) === (isOpen(b) && b.isStreaming) &&
303
- (isOpen(a) && !!a.waiting) === (isOpen(b) && !!b.waiting));
304
+ (isOpen(a) && !!a.waiting) === (isOpen(b) && !!b.waiting) &&
305
+ people_1.PresenceUtil.same(isOpen(a) ? a.people : undefined, isOpen(b) ? b.people : undefined));
304
306
  const x = before.source;
305
307
  const y = after.source;
306
308
  const sameSource = x === y || (x.key === y.key && x.label === y.label && x.title === y.title && x.host === y.host && x.initial === y.initial && x.tone === y.tone);
@@ -431,6 +433,11 @@ const ChatItem = React.memo(function ChatItem({ session, source, selected, time,
431
433
  const asks = waiting || (!!asking && !streaming);
432
434
  const mood = asks ? 'attention' : streaming ? 'working' : 'idle';
433
435
  const state = React.createElement(ChatState, { streaming: streaming, waiting: waiting, task: task });
436
+ // Others in the same Ta: their faces while they look at it, and whose message it answers.
437
+ const people = ChatListUtil.isOpen(session) ? session.people : undefined;
438
+ const viewers = React.createElement(people_1.PeopleFaces, { people: people_1.PresenceUtil.viewing(people), size: 14, max: 3 });
439
+ const askers = streaming ? people_1.PresenceUtil.asked(people) : [];
440
+ const replying = askers.length > 0 && (React.createElement("span", { className: "ta-chat-flag ta-replying" }, t('ta.chat.replyingFor', { names: people_1.PresenceUtil.names(askers, t('ta.presence.separator'), count => t('ta.presence.more', { count })) })));
434
441
  // As in a messaging app, the last thing said; its directory before the first, and on hover in place of its time.
435
442
  const said = ChatListUtil.preview(session, title);
436
443
  const place = who ? message_1.MessageUtil.basename(session.cwd) : source.label;
@@ -441,6 +448,7 @@ const ChatItem = React.memo(function ChatItem({ session, source, selected, time,
441
448
  who && React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 20, mood: mood }),
442
449
  tag,
443
450
  React.createElement("span", { className: "ta-chat-title" }, title),
451
+ viewers,
444
452
  state,
445
453
  React.createElement(ChatDot, { unseen: !!unseen, asks: asks }),
446
454
  React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time)))) : (React.createElement(React.Fragment, null,
@@ -466,12 +474,14 @@ const ChatItem = React.memo(function ChatItem({ session, source, selected, time,
466
474
  "[",
467
475
  t('ta.chat.asking'),
468
476
  "]"),
477
+ replying,
469
478
  ended && !streaming && !asks && (React.createElement("span", { className: `ta-chat-flag ta-${ended}` },
470
479
  "[",
471
480
  t(ended === 'failed' ? 'ta.task.failed' : 'ta.task.stopped'),
472
481
  "]")), (_a = (asks && !waiting ? asking : said)) !== null && _a !== void 0 ? _a : (React.createElement("span", { className: "ta-chat-dir" },
473
482
  React.createElement(icon_1.Icon, { icon: lucide_react_1.Folder, size: 12 }),
474
483
  place))),
484
+ viewers,
475
485
  streaming && React.createElement("span", { className: "ta-chat-state ta-spinner" })))))),
476
486
  handheld ? null : onRestore ? (React.createElement(icon_1.IconButton, { className: "ta-chat-delete", icon: lucide_react_1.Undo2, label: t('ta.chat.restore'), onClick: onRestore })) : (React.createElement(icon_1.IconButton, { className: "ta-chat-delete", icon: lucide_react_1.Trash2, label: t('ta.sidebar.closeTitle'), busy: removing, onClick: onRemove }))));
477
487
  }, ChatListUtil.sameRow);
@@ -80,6 +80,8 @@ export interface ComposerBoxProps {
80
80
  onTalkSent?(): void;
81
81
  onListening?(listening: boolean): void;
82
82
  autoFocus?: boolean;
83
+ /** What the user typed changed: the text now. */
84
+ onTextChange?(text: string): void;
83
85
  /** The directory of the conversation: files dragged in from it become `@` references relative to it. */
84
86
  cwd?: string;
85
87
  onError(error: unknown): void;
@@ -87,7 +87,7 @@ function talkTarget(target) {
87
87
  }
88
88
  exports.ComposerBox = React.forwardRef(function ComposerBox(props, ref) {
89
89
  var _a;
90
- const { placeholder, working = false, onStop, onSend, commands = [], onMentionQuery, mentions, mentionLabel, images: takesImages, recentShots, actions = [], above, head, after, voiceSends, talkPlace, onTalkSent, onListening, autoFocus, cwd, onError, } = props;
90
+ const { placeholder, working = false, onStop, onSend, commands = [], onMentionQuery, mentions, mentionLabel, images: takesImages, recentShots, actions = [], above, head, after, voiceSends, talkPlace, onTalkSent, onListening, autoFocus, onTextChange, cwd, onError, } = props;
91
91
  const t = (0, use_t_1.useT)();
92
92
  const [text, setText] = React.useState('');
93
93
  const [caret, setCaret] = React.useState(0);
@@ -530,6 +530,7 @@ exports.ComposerBox = React.forwardRef(function ComposerBox(props, ref) {
530
530
  talkMode && React.createElement(voice_talk_1.TalkBar, { talk: talk }),
531
531
  React.createElement("textarea", { ref: input, hidden: talkMode, rows: 1, value: text, autoFocus: autoFocus, enterKeyHint: "send", "aria-label": t('ta.composer.label'), "aria-controls": items.length ? menuId : undefined, "aria-activedescendant": items.length ? `${menuId}-${selected}` : undefined, placeholder: listening ? t('ta.composer.listening') : placeholder, onChange: event => {
532
532
  setText(event.target.value);
533
+ onTextChange === null || onTextChange === void 0 ? void 0 : onTextChange(event.target.value);
533
534
  setCaret(event.target.selectionStart);
534
535
  setSelected(0);
535
536
  }, onSelect: event => setCaret(event.currentTarget.selectionStart), onKeyDown: onKeyDown, onPaste: onPaste, onFocus: () => {
@@ -1,5 +1,5 @@
1
1
  import type { SessionStore } from '@celljs/ta-client';
2
- import type { TaServer, TaSlashCommand, TaWorkspaceServer } from '@celljs/ta-protocol';
2
+ import { type TaServer, type TaSlashCommand, type TaWorkspaceServer } from '@celljs/ta-protocol';
3
3
  import * as React from 'react';
4
4
  import { type ComposerImage, type ComposerQueued } from '../util/composer';
5
5
  import { type ComposerAction, type ComposerBoxHandle } from './composer-box';
@@ -41,6 +41,8 @@ export interface ComposerProps {
41
41
  onStop?(): void;
42
42
  /** A stop of the session's run pressed here ended (or failed): how long it took (useStopTimes). */
43
43
  onStopTimed?(timing: StopTiming): void;
44
+ /** The user types (the box holds something and a key came), or no longer (it is empty, or sent). */
45
+ onTyping?(typing: boolean): void;
44
46
  onError(error: unknown): void;
45
47
  }
46
48
  /**
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Composer = void 0;
37
37
  exports.QueuedMessages = QueuedMessages;
38
+ const ta_protocol_1 = require("@celljs/ta-protocol");
38
39
  const lucide_react_1 = require("lucide-react");
39
40
  const React = __importStar(require("react"));
40
41
  const assistant_task_util_1 = require("../assistant/assistant-task-util");
@@ -42,8 +43,10 @@ const device_1 = require("../device/device");
42
43
  const use_t_1 = require("../i18n/use-t");
43
44
  const composer_1 = require("../util/composer");
44
45
  const composer_box_1 = require("./composer-box");
46
+ const face_1 = require("./face");
45
47
  const icon_1 = require("./icon");
46
48
  const message_list_1 = require("./message-list");
49
+ const people_1 = require("./people");
47
50
  const stop_times_1 = require("./stop-times");
48
51
  const FILE_LIMIT = 20;
49
52
  const FILE_DELAY_MS = 120;
@@ -99,7 +102,7 @@ function useQueue(store, working) {
99
102
  * and Alt+Enter queues a follow-up; Escape stops it.
100
103
  */
101
104
  exports.Composer = React.forwardRef(function Composer(props, ref) {
102
- const { store, onSubmit, head, after, voiceSends, recentShots, talkPlace, onTalkSent, onListening, server, workspace, working, commands, cwd, actions, placeholder, above, onSending, onStop, onStopTimed, onError, } = props;
105
+ const { store, onSubmit, head, after, voiceSends, recentShots, talkPlace, onTalkSent, onListening, server, workspace, working, commands, cwd, actions, placeholder, above, onSending, onStop, onStopTimed, onTyping, onError, } = props;
103
106
  // A finger: the keyboard opens on focus, over the conversation, and there are no keys to name.
104
107
  const touch = (0, device_1.useDevice)(device => device.touch);
105
108
  const t = (0, use_t_1.useT)();
@@ -139,6 +142,7 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
139
142
  const send = (message, images, followUp) => {
140
143
  var _a;
141
144
  onSending === null || onSending === void 0 ? void 0 : onSending();
145
+ onTyping === null || onTyping === void 0 ? void 0 : onTyping(false);
142
146
  const prompt = { clientMessageId: crypto.randomUUID(), message, images: images.length ? images : undefined };
143
147
  if (!store) {
144
148
  return (_a = onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(message, prompt.images)) !== null && _a !== void 0 ? _a : Promise.resolve();
@@ -174,30 +178,38 @@ exports.Composer = React.forwardRef(function Composer(props, ref) {
174
178
  }, onError);
175
179
  };
176
180
  const waiting = composer_1.ComposerUtil.queued(queue);
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,
181
+ 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, onTextChange: onTyping && (text => onTyping(!!text.trim())), cwd: cwd, onError: onError, above: React.createElement(React.Fragment, null,
178
182
  above,
179
183
  waiting.length > 0 && React.createElement(QueuedMessages, { waiting: waiting, onTakeBack: takeBack, onRemove: remove })) }));
180
184
  });
181
185
  /** What waits to be sent, tucked on top of the box: as the conversation will show it, the package that sent it apart. */
182
186
  function QueuedMessages({ waiting, onTakeBack, onRemove, }) {
183
187
  const t = (0, use_t_1.useT)();
188
+ const { me, ownerName } = React.useContext(people_1.MessagePeople);
184
189
  return (React.createElement("div", { className: "ta-queue", "aria-live": "polite" },
185
190
  waiting.length > 1 && (React.createElement("div", { className: "ta-queue-head" },
186
191
  React.createElement("span", null, t('ta.composer.queue.count', { count: waiting.length })),
187
192
  React.createElement("button", { type: "button", className: "ta-queue-all", onClick: onTakeBack, title: t('ta.composer.queue.takeBackTitle') }, t('ta.composer.queue.takeBackAll')))),
188
193
  waiting.map(entry => {
194
+ var _a, _b, _c;
189
195
  const note = assistant_task_util_1.AssistantTaskUtil.noteOf(entry.text);
190
196
  const shown = words(entry.text);
191
197
  const text = note ? t('ta.task.ended', { title: note.title, status: t(`ta.task.${note.status}`) }) : shown.text || shown.copied;
192
198
  const kind = t(entry.kind === 'steering' ? 'ta.composer.queue.steering' : 'ta.composer.queue.followUp');
199
+ // Another's waits as theirs: they take it back, or the owner of the Ta removes it (ta serve holds to it too).
200
+ const author = ta_protocol_1.TaMessageAuthor.of(entry.text);
201
+ const mine = ((_a = author === null || author === void 0 ? void 0 : author.id) !== null && _a !== void 0 ? _a : ta_protocol_1.TA_OWNER) === me;
193
202
  return (React.createElement("div", { key: `${entry.kind}-${entry.index}-${entry.text}`, className: "ta-queue-row" },
194
203
  React.createElement("span", { className: "ta-queue-kind", title: kind },
195
204
  React.createElement(icon_1.Icon, { icon: entry.kind === 'steering' ? lucide_react_1.CornerDownRight : lucide_react_1.Clock3, size: 13 }),
196
205
  React.createElement("span", null, kind)),
206
+ !mine && (React.createElement("span", { className: "ta-origin" },
207
+ React.createElement(face_1.Face, { seed: (_b = author === null || author === void 0 ? void 0 : author.id) !== null && _b !== void 0 ? _b : ta_protocol_1.TA_OWNER, size: 14, double: !author }),
208
+ React.createElement("span", { className: "ta-origin-name" }, (_c = author === null || author === void 0 ? void 0 : author.name) !== null && _c !== void 0 ? _c : (ownerName || t('ta.presence.owner'))))),
197
209
  !note && React.createElement(message_list_1.MessageOrigin, { blocks: blocksOf(entry.text) }),
198
210
  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') },
211
+ React.createElement("span", { className: "ta-queue-actions", hidden: !mine && me !== ta_protocol_1.TA_OWNER },
212
+ !note && mine && (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
213
  React.createElement(icon_1.Icon, { icon: lucide_react_1.PenLine, size: 13 }))),
202
214
  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
215
  React.createElement(icon_1.Icon, { icon: lucide_react_1.X, size: 13 })))));
@@ -8,14 +8,26 @@ export interface FaceProps {
8
8
  working?: boolean;
9
9
  /** A dot at its corner: green online, grey not; none without. */
10
10
  online?: boolean;
11
+ /**
12
+ * The owner of this Ta: the close-up of its double, the dinosaur the user picked (as the account and the navigation
13
+ * show it), which changes with it; `face` and `seed` stand for it where the page cannot draw it.
14
+ */
15
+ double?: boolean;
16
+ /**
17
+ * Another Ta, as its double looks (TaRoomMember.look, TaFriend.look): the close-up of that dinosaur. One this page
18
+ * does not know is drawn by `face` and `seed`.
19
+ */
20
+ look?: string;
11
21
  }
12
22
  /** One face; the eyes, cheeks and mouth are the same on every shape. */
13
- export declare function Face({ face: given, seed, size, working, online }: FaceProps): React.JSX.Element;
23
+ export declare function Face(props: FaceProps): React.JSX.Element;
14
24
  export interface GroupFaceProps {
15
25
  /** Those of the group, the one in front first: their faces, or their ids (`seed` of {@link Face}). */
16
26
  members: readonly {
17
27
  face?: number;
18
28
  seed?: string;
29
+ look?: string;
30
+ double?: boolean;
19
31
  working?: boolean;
20
32
  }[];
21
33
  size: number;