@celljs/ta-web 4.29.0 → 4.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/browser/chat/chat-view.js +1 -1
- package/esm/browser/components/app-contexts.js +6 -4
- package/esm/browser/components/app-nav.js +4 -4
- package/esm/browser/components/chat-list-row.js +7 -2
- package/esm/browser/components/chat-tag.d.ts +20 -0
- package/esm/browser/components/chat-tag.js +103 -0
- package/esm/browser/components/custom-host.js +1 -1
- package/esm/browser/components/editor-area.js +1 -1
- package/esm/browser/components/launcher-surface.js +1 -1
- package/esm/browser/components/session-view.js +6 -1
- package/esm/browser/extension/extension-view.d.ts +7 -0
- package/esm/browser/extension/extension-view.js +5 -0
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-api-chats.d.ts +29 -0
- package/esm/browser/extension/web-extension-api.d.ts +4 -5
- package/esm/browser/extension/web-extension-context.js +1 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +8 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +3 -2
- package/esm/browser/extension/web-extension-run.js +2 -0
- package/esm/browser/extension/web-extensions-running.d.ts +3 -0
- package/esm/browser/extension/web-extensions-running.js +13 -1
- package/esm/browser/extension/web-extensions.js +5 -1
- package/esm/browser/extension/web-metrics.d.ts +32 -0
- package/esm/browser/extension/web-metrics.js +98 -0
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +6 -0
- package/lib/browser/chat/chat-view.js +1 -1
- package/lib/browser/components/app-contexts.js +6 -4
- package/lib/browser/components/app-nav.js +4 -4
- package/lib/browser/components/chat-list-row.js +7 -2
- package/lib/browser/components/chat-tag.d.ts +21 -0
- package/lib/browser/components/chat-tag.js +142 -0
- package/lib/browser/components/custom-host.js +1 -1
- package/lib/browser/components/editor-area.js +1 -1
- package/lib/browser/components/launcher-surface.js +1 -1
- package/lib/browser/components/session-view.js +6 -1
- package/lib/browser/extension/extension-view.d.ts +7 -0
- package/lib/browser/extension/extension-view.js +6 -1
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-api-chats.d.ts +29 -0
- package/lib/browser/extension/web-extension-api.d.ts +4 -5
- package/lib/browser/extension/web-extension-context.js +1 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +8 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +3 -2
- package/lib/browser/extension/web-extension-run.js +2 -0
- package/lib/browser/extension/web-extensions-running.d.ts +3 -0
- package/lib/browser/extension/web-extensions-running.js +13 -1
- package/lib/browser/extension/web-extensions.js +5 -1
- package/lib/browser/extension/web-metrics.d.ts +33 -0
- package/lib/browser/extension/web-metrics.js +102 -0
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +6 -0
- package/package.json +7 -7
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type TaMetricsBatchItem } from '@celljs/ta-protocol';
|
|
2
|
+
/**
|
|
3
|
+
* What the page counts of the packages (docs/design/ta-metrics.md 4.1): pages opened, web extensions loaded and
|
|
4
|
+
* started, what they drew that threw. In memory, a few additions a record; told to ta serve in one batch every minute
|
|
5
|
+
* or as the page is hidden, never more often than it takes (TA_METRICS_BATCH_MS), at most TA_METRICS_BATCH items.
|
|
6
|
+
* Nothing it does throws to what it counts, and a Ta service of before, which does not take them, is simply not told.
|
|
7
|
+
*/
|
|
8
|
+
export declare class WebMetrics {
|
|
9
|
+
protected readonly send: (batch: TaMetricsBatchItem[]) => Promise<void>;
|
|
10
|
+
/** The package of an extension, by its id or its name; undefined for one not known. */
|
|
11
|
+
protected readonly packageOf: (extension: string) => string | undefined;
|
|
12
|
+
protected readonly now: () => number;
|
|
13
|
+
/** The one of the page: what draws an extension (ExtensionBoundary) counts what threw there. */
|
|
14
|
+
static current?: WebMetrics;
|
|
15
|
+
protected counts: Map<string, TaMetricsBatchItem>;
|
|
16
|
+
protected sent: number;
|
|
17
|
+
protected timer?: ReturnType<typeof setInterval>;
|
|
18
|
+
protected readonly onHidden: () => void;
|
|
19
|
+
constructor(send: (batch: TaMetricsBatchItem[]) => Promise<void>,
|
|
20
|
+
/** The package of an extension, by its id or its name; undefined for one not known. */
|
|
21
|
+
packageOf?: (extension: string) => string | undefined, now?: () => number);
|
|
22
|
+
start(): void;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
/** One of `item` (`page:main`, `web:load`) of the package of `extension`. */
|
|
25
|
+
record(extension: string | undefined, item: string, err?: boolean, ms?: number): void;
|
|
26
|
+
/** What threw where an extension drew (ExtensionBoundary). */
|
|
27
|
+
renderError(extension: string | undefined): void;
|
|
28
|
+
/** What was counted, told when it may be; dropped when the service does not take it. */
|
|
29
|
+
flush(): Promise<void>;
|
|
30
|
+
/** What it holds now, for tests. */
|
|
31
|
+
pending(): TaMetricsBatchItem[];
|
|
32
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { TA_METRICS_BATCH, TA_METRICS_BATCH_MS, TA_METRICS_BOUNDS, TaMetricsUtil } from '@celljs/ta-protocol';
|
|
2
|
+
/** How often the page tells what it counted, when it changed; and when it is hidden, if it may by then. */
|
|
3
|
+
const FLUSH_MS = 60000;
|
|
4
|
+
/**
|
|
5
|
+
* What the page counts of the packages (docs/design/ta-metrics.md 4.1): pages opened, web extensions loaded and
|
|
6
|
+
* started, what they drew that threw. In memory, a few additions a record; told to ta serve in one batch every minute
|
|
7
|
+
* or as the page is hidden, never more often than it takes (TA_METRICS_BATCH_MS), at most TA_METRICS_BATCH items.
|
|
8
|
+
* Nothing it does throws to what it counts, and a Ta service of before, which does not take them, is simply not told.
|
|
9
|
+
*/
|
|
10
|
+
export class WebMetrics {
|
|
11
|
+
constructor(send,
|
|
12
|
+
/** The package of an extension, by its id or its name; undefined for one not known. */
|
|
13
|
+
packageOf = name => name, now = Date.now) {
|
|
14
|
+
this.send = send;
|
|
15
|
+
this.packageOf = packageOf;
|
|
16
|
+
this.now = now;
|
|
17
|
+
this.counts = new Map();
|
|
18
|
+
this.sent = 0;
|
|
19
|
+
this.onHidden = () => {
|
|
20
|
+
if (typeof document !== 'undefined' && document.visibilityState === 'hidden') {
|
|
21
|
+
void this.flush();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
start() {
|
|
26
|
+
var _a;
|
|
27
|
+
WebMetrics.current = this;
|
|
28
|
+
(_a = this.timer) !== null && _a !== void 0 ? _a : (this.timer = setInterval(() => void this.flush(), FLUSH_MS));
|
|
29
|
+
if (typeof document !== 'undefined') {
|
|
30
|
+
document.addEventListener('visibilitychange', this.onHidden);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
dispose() {
|
|
34
|
+
clearInterval(this.timer);
|
|
35
|
+
this.timer = undefined;
|
|
36
|
+
if (typeof document !== 'undefined') {
|
|
37
|
+
document.removeEventListener('visibilitychange', this.onHidden);
|
|
38
|
+
}
|
|
39
|
+
if (WebMetrics.current === this) {
|
|
40
|
+
WebMetrics.current = undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** One of `item` (`page:main`, `web:load`) of the package of `extension`. */
|
|
44
|
+
record(extension, item, err = false, ms) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
try {
|
|
47
|
+
const pkg = extension === undefined ? undefined : this.packageOf(extension);
|
|
48
|
+
if (!pkg) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const key = `${pkg}\u0000${item}`;
|
|
52
|
+
let one = this.counts.get(key);
|
|
53
|
+
if (!one) {
|
|
54
|
+
if (this.counts.size >= TA_METRICS_BATCH) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
one = { pkg, item, n: 0 };
|
|
58
|
+
this.counts.set(key, one);
|
|
59
|
+
}
|
|
60
|
+
one.n++;
|
|
61
|
+
if (err) {
|
|
62
|
+
one.err = ((_a = one.err) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
63
|
+
}
|
|
64
|
+
if (ms !== undefined && Number.isFinite(ms) && ms >= 0) {
|
|
65
|
+
(_b = one.ms) !== null && _b !== void 0 ? _b : (one.ms = new Array(TA_METRICS_BOUNDS.length + 1).fill(0));
|
|
66
|
+
one.ms[TaMetricsUtil.bucket(ms)]++;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (_c) {
|
|
70
|
+
// Never to what it counts.
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** What threw where an extension drew (ExtensionBoundary). */
|
|
74
|
+
renderError(extension) {
|
|
75
|
+
this.record(extension, 'render:view', true);
|
|
76
|
+
}
|
|
77
|
+
/** What was counted, told when it may be; dropped when the service does not take it. */
|
|
78
|
+
async flush() {
|
|
79
|
+
const now = this.now();
|
|
80
|
+
if (this.counts.size === 0 || now - this.sent < TA_METRICS_BATCH_MS) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const batch = [...this.counts.values()];
|
|
84
|
+
this.counts = new Map();
|
|
85
|
+
this.sent = now;
|
|
86
|
+
try {
|
|
87
|
+
await this.send(batch);
|
|
88
|
+
}
|
|
89
|
+
catch (_a) {
|
|
90
|
+
// A Ta service of before, or not there now: dropped, as a minute of counts.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** What it holds now, for tests. */
|
|
94
|
+
pending() {
|
|
95
|
+
return [...this.counts.values()];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=web-metrics.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The list of chats: its search, its rows, the letters and faces of their groups. */
|
|
2
|
-
export declare const CHAT_LIST_STYLE = "\n/* The list of chats: a search, then the chats by directory (a line each under the head of its group) or by day (each with the avatar of its directory) */\n.ta-chats { gap: 8px; }\n/* On a phone a folder opened is pushed over the list (PhoneStack): the same ground and spacing as the list. */\n.ta-chats > .ta-phone-stack > .ta-phone-stack-base, .ta-chats > .ta-phone-stack > .ta-phone-stack-top { gap: 8px; }\n.ta-chats > .ta-phone-stack > .ta-phone-stack-top { background: var(--ta-side); }\n.ta-chats-head { gap: 4px; padding: 0; margin-bottom: 0; }\n.ta-chats-search { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 11px; border-radius: 10px; background: var(--ta-raised); color: var(--ta-muted); border: 1px solid transparent; transition: border-color 120ms, background 120ms; }\n.ta-chats-search:focus-within { border-color: var(--ta-border-field); background: var(--ta-input); }\n.ta-chats-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ta-text); padding: 0; font-size: calc(13.5px * var(--ta-font-scale)); }\n.ta-chats-search input::placeholder { color: var(--ta-muted); }\n.ta-chats-clear { width: 24px; height: 24px; }\n.ta-chips { display: flex; gap: 6px; flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin: 0 -8px; padding: 0 8px 2px; }\n.ta-chips::-webkit-scrollbar { display: none; }\n.ta-chip-filter { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--ta-border); background: transparent; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); white-space: nowrap; transition: background 120ms, color 120ms, border-color 120ms; }\n.ta-chip-filter:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-chip-filter[aria-selected='true'] { background: var(--ta-selected); border-color: transparent; color: var(--ta-text); font-weight: 500; }\n.ta-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone-ink); }\n.ta-chip-count { color: var(--ta-muted); font-variant-numeric: tabular-nums; font-weight: 400; }\n.ta-chat-section + .ta-chat-section { margin-top: 6px; }\n.ta-chats-view { width: 26px; height: 26px; border-radius: 7px; color: var(--ta-muted); }\n.ta-chats-view[aria-pressed='true'] { color: var(--ta-text); background: var(--ta-hover-strong); }\n.ta-chat-group + .ta-chat-group { margin-top: 4px; }\n.ta-chat-group-head { position: relative; display: flex; align-items: center; }\n.ta-chat-group-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 40px 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; text-align: left; }\n.ta-chat-group-toggle:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-chat-group-avatar { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--tone-tint); color: var(--tone-ink); font-size: 11px; font-weight: 600; }\n.ta-chat-group-toggle .ta-host-tag { margin-right: -3px; }\n.ta-chat-group-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-group-count { flex: none; color: var(--ta-muted); font-weight: 400; font-variant-numeric: tabular-nums; }\n.ta-chat-group-chevron { flex: none; color: var(--ta-muted); transition: transform 150ms ease; }\n.ta-chat-group-toggle[aria-expanded='true'] .ta-chat-group-chevron { transform: rotate(90deg); }\n.ta-chat-group-add { position: absolute; right: 6px; top: 50%; width: 26px; height: 26px; transform: translateY(-50%); opacity: 0; }\n.ta-chat-group-head:hover .ta-chat-group-add, .ta-chat-group-add:focus-visible { opacity: 1; }\n.ta-chat-group-toggle .ta-chat-icon, .ta-chat-folder-head .ta-chat-icon { flex: none; border-radius: 6px; }\n.ta-chat-folder-head { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 2px; border-bottom: 1px solid var(--ta-border); color: var(--ta-text); font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; }\n.ta-chat-folder-back { width: 30px; height: 30px; flex: none; }\n.ta-chat-folder-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-item.ta-compact { min-height: 34px; padding: 7px 10px 7px 38px; border-radius: 10px; }\n.ta-chat-row:has(.ta-chat-item.ta-compact) { border-radius: 10px; }\n.ta-compact .ta-chat-title { font-weight: 400; color: var(--ta-body); }\n.ta-chat-section-title { padding: 8px 10px 4px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-chat-fold { display: flex; align-items: center; gap: 4px; width: 100%; margin-top: 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }\n.ta-chat-fold:hover { color: var(--ta-text); }\n.ta-chat-fold svg { transition: transform 0.15s ease; }\n.ta-chat-fold[aria-expanded=\"true\"] svg { transform: rotate(90deg); }\n.ta-chat-removed .ta-chat-item { opacity: 0.72; }\n.ta-chat-group .ta-chat-fold { margin-top: 0; padding-left: 14px; }\n.ta-chat-more { height: 1px; }\n/* Rows out of view are not laid out or painted (their menu opens in a portal, their actions within them). */\n.ta-chat-row { position: relative; border-radius: 12px; content-visibility: auto; contain-intrinsic-size: auto 60px; }\n.ta-chat-row:has(.ta-compact) { contain-intrinsic-size: auto 36px; }\n.ta-chat-row:hover { background: var(--ta-hover); }\n.ta-chat-row.ta-selected { background: var(--ta-selected); }\n.ta-chat-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; color: inherit; }\n.ta-chat-avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--tone-tint); color: var(--tone-ink); font-size: 15px; font-weight: 600; }\n.ta-chat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }\n.ta-chat-line { display: flex; align-items: center; gap: 8px; min-width: 0; }\n.ta-chat-title { flex: 1; min-width: 0; font-size: calc(14px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-time { flex: none; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); font-variant-numeric: tabular-nums; }\n/* After the title, what it is (a group chat with friends): small, green, the title as short as it is so it sits beside it. */\n.ta-chat-title.ta-badged { flex: 0 1 auto; }\n.ta-chat-badge { flex: none; margin-right: auto; margin-left: -2px; height: calc(16px * var(--ta-font-scale)); padding: 0 5px; border-radius: 4px; background: color-mix(in oklab, var(--ta-green) 13%, transparent); color: var(--ta-green); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 500; line-height: calc(16px * var(--ta-font-scale)); white-space: nowrap; }\n.ta-chat-sub { flex: 1; min-width: 0; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-line .ta-spinner { width: 12px; height: 12px; }\n/* Someone to talk to: the double's face, or the face an extension draws for its agent, in place of a letter. */\n.ta-chat-face { flex: none; display: inline-grid; place-items: center; }\n/* A conversation of an extension that is no one to talk to (a brief, a question): its icon on a tile of its tint. */\n.ta-chat-icon { background: var(--ta-tile); color: var(--ta-tile-ink); }\n/* In a row of one line, in the room left of its title, under the letter of its group: the title stays where the others are. */\n.ta-compact .ta-chat-face { margin-left: -28px; }\n/* What goes on in it, at the end of a line: answering (a spinner, on the line under the title), a task that failed or was stopped. */\n.ta-chat-state { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); white-space: nowrap; }\n.ta-chat-state .ta-status { width: 8px; }\n.ta-chat-state.ta-failed { color: color-mix(in srgb, var(--ta-red) 85%, var(--ta-muted)); }\n/* Under the title, as a messaging app: the last thing said, or its directory; how a task ended, before it, as WeChat's [Draft]. */\n.ta-chat-dir { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: top; }\n.ta-chat-dir > svg { flex: none; }\n.ta-chat-flag { margin-right: 3px; }\n.ta-chat-flag.ta-replying { color: var(--ta-secondary); }\n.ta-chat-line > .ta-people { margin-left: 4px; }\n/* Out of the way of the button that takes a row out, as its words are. */\n.ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-line > .ta-people:last-child { margin-right: 28px; }\n.ta-chat-line .ta-people-face { box-shadow: none; background: none; }\n.ta-chat-line .ta-people-face + .ta-people-face { margin-left: -3px; }\n.ta-chat-flag.ta-failed { color: color-mix(in srgb, var(--ta-red) 85%, var(--ta-muted)); }\n.ta-chat-flag.ta-draft { color: var(--ta-red); }\n.ta-chat-flag.ta-waiting, .ta-chat-state.ta-waiting { color: color-mix(in srgb, var(--ta-blue) 85%, var(--ta-muted)); }\n/* Its directory, in place of its time while the pointer is on it. */\n.ta-chat-place { display: none; flex: 0 1 auto; align-items: center; gap: 4px; min-width: 0; max-width: 45%; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-chat-place > svg { flex: none; }\n.ta-chat-place > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n@media (hover: hover) {\n .ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-place { display: inline-flex; }\n .ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-time { display: none; }\n}\n.ta-chats-add { width: 36px; height: 36px; border-radius: 10px; background: var(--ta-raised); }\n/* On the line under the title, at its end; in the middle of a row of one line. */\n.ta-chat-delete { position: absolute; bottom: 7px; right: 8px; width: 26px; height: 26px; opacity: 0; }\n.ta-chat-row:has(.ta-compact) .ta-chat-delete { bottom: auto; top: 50%; width: 30px; height: 30px; transform: translateY(-50%); }\n.ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-sub { padding-right: 28px; }\n.ta-chat-delete:hover:not(:disabled) { color: var(--ta-red); }\n.ta-chat-row:hover .ta-chat-delete, .ta-chat-delete:focus-visible { opacity: 1; }\n/* Taken out, while ta serve closes it: its button stays, turning. */\n.ta-chat-row .ta-chat-delete.ta-icon-button.ta-busy { display: inline-grid; opacity: 1; }\n.ta-chat-row:hover .ta-compact .ta-chat-time, .ta-chat-row:hover .ta-chat-state { visibility: hidden; }\n/*\n * Unseen, as a messenger's unread: an amber dot on the corner of the avatar (before the time in a row of one line), as\n * the agents of the side bar have; it grows in and shrinks away. Cut out of the avatar by the color of the row.\n */\n.ta-chat-avatar-box { position: relative; display: inline-flex; flex: none; }\n.ta-chat-row { --ta-chat-bg: var(--ta-side); }\n.ta-chat-row:hover { --ta-chat-bg: var(--ta-hover); }\n.ta-chat-row.ta-selected { --ta-chat-bg: var(--ta-selected); }\n/* A row that slides past others to its new place (ListMotion) goes over them, in the color of its row. */\n.ta-chat-row[data-moving] { z-index: 1; background: var(--ta-chat-bg); }\n.ta-chat-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ta-yellow); transform: scale(0); opacity: 0; transition: transform 0.24s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.18s ease; }\n.ta-chat-line > .ta-chat-dot:not(.ta-on) { width: 0; margin-left: -8px; }\n.ta-chat-avatar-box > .ta-chat-dot { position: absolute; right: -2px; bottom: -2px; z-index: 1; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--ta-chat-bg); }\n.ta-chat-dot.ta-on { transform: none; opacity: 1; }\n/* A conversation that waits for the user to decide: a blue ? in place of the amber dot, which seeing it does not take away. */\n.ta-chat-dot.ta-asks { display: grid; place-items: center; background: var(--ta-blue); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }\n.ta-chat-line > .ta-chat-dot.ta-asks { width: 13px; height: 13px; }\n.ta-chat-avatar-box > .ta-chat-dot.ta-asks { right: -3px; bottom: -3px; width: 17px; height: 17px; font-size: 10px; }\n/* Only those going on (the row of the double opened the list): a chip that clears it, its count beside its label. */\n.ta-chat-filter { display: flex; padding: 0 2px 2px; }\n.ta-chat-filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 11px; border: 0; border-radius: 14px; background: var(--ta-chip); color: var(--ta-text); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; transition: background 120ms; }\n.ta-chat-filter-chip:hover { background: var(--ta-selected); }\n.ta-chat-filter-chip > svg { color: var(--ta-muted); }\n.ta-chat-filter-count { font-variant-numeric: tabular-nums; color: var(--ta-secondary); }\n/* How many wait for the user to decide, on the entry of the chats: over the corner of its icon. */\n.ta-asks-badge { position: absolute; top: 3px; right: 1px; z-index: 1; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--ta-blue); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; box-shadow: 0 0 0 2px var(--ta-side); }\n.ta-tabbar-icon > .ta-asks-badge { top: -5px; right: -11px; }\n@media (prefers-reduced-motion: reduce) { .ta-chat-dot { transition: opacity 0.18s ease; } }\n/* What came unseen reads as unread: in the color of the text, not muted. */\n.ta-chat-sub.ta-unseen { color: var(--ta-text); }\n/* Above the box: where a new conversation will work (ComposerBox's head), a pill of its directory. */\n.ta-console-head { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 0 6px; }\n.ta-console-head .ta-cwd-chip { max-width: min(100%, 360px); height: 26px; padding: 0 8px 0 7px; background: transparent; }\n.ta-console-head .ta-cwd-chip:hover { background: var(--ta-hover); }\n.ta-console-head .ta-cwd-chip .ta-ellipsis { flex: 0 1 auto; min-width: 0; max-width: none; }\n.ta-cwd-chip { display: inline-flex; align-items: center; gap: 5px; flex: none; max-width: 180px; overflow: hidden; height: 30px; padding: 0 9px 0 10px; border: 0; border-radius: 15px; background: var(--ta-hover); color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); transition: background 120ms, color 120ms; }\n.ta-cwd-chip:hover { background: var(--ta-hover-strong); color: var(--ta-text); }\n.ta-cwd-chip svg { flex: none; }\n@media (max-width: 600px) { .ta-cwd-chip { max-width: 120px; } }\n/* The letters of the list in hues of the agents' faces (yellow, blue, orange, green, violet, pink), drawn as tints of the theme (--ta-tint-<n>, style/tints.ts). */\n.ta-tone-0 { --tone-tint: var(--ta-tint-2); --tone-ink: var(--ta-tint-ink-2); }\n.ta-tone-1 { --tone-tint: var(--ta-tint-0); --tone-ink: var(--ta-tint-ink-0); }\n.ta-tone-2 { --tone-tint: var(--ta-tint-4); --tone-ink: var(--ta-tint-ink-4); }\n.ta-tone-3 { --tone-tint: var(--ta-tint-3); --tone-ink: var(--ta-tint-ink-3); }\n.ta-tone-4 { --tone-tint: var(--ta-tint-5); --tone-ink: var(--ta-tint-ink-5); }\n.ta-tone-5 { --tone-tint: var(--ta-tint-7); --tone-ink: var(--ta-tint-ink-7); }\n/* The partners (PartnersList): agents, friends and group chats, each a section under a small title, rows as the chats. */\n.ta-partners .ta-chat-section-title { display: flex; align-items: center; gap: 6px; }\n.ta-partners .ta-chat-group + .ta-chat-group { margin-top: 6px; }\n.ta-partner-online { position: absolute; left: -1px; bottom: -1px; z-index: 1; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ta-chat-bg); background: var(--ta-green); }\n/* Starting a chat (GroupPicker): agents and friends to tick, the one of a chat it starts from ticked already. */\n.ta-partner-pick { display: flex; flex-direction: column; gap: 10px; min-height: 0; }\n.ta-partner-pick-lead { margin: 0; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-partner-pick-list { display: flex; flex-direction: column; gap: 2px; min-height: 0; max-height: min(56vh, 420px); margin: 0; padding: 0; overflow-y: auto; list-style: none; }\n.ta-partner-pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: none; border-radius: 10px; background: transparent; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; }\n.ta-partner-pick-row:hover:not(:disabled) { background: var(--ta-hover); }\n.ta-partner-pick-row:disabled { cursor: default; }\n.ta-partner-pick-box { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; box-sizing: border-box; border: 1.5px solid var(--ta-border-field); border-radius: 50%; color: #fff; transition: background 0.12s, border-color 0.12s; }\n.ta-partner-pick-box.ta-on { border-color: var(--ta-green); background: var(--ta-green); }\n.ta-partner-pick-row:disabled .ta-partner-pick-box.ta-on { opacity: 0.5; }\n.ta-partner-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-partner-pick-kind { flex: none; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }\n.ta-partner-pick-error { margin: 0; color: var(--ta-red); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-partner-pick-foot { display: flex; justify-content: flex-end; }\n";
|
|
2
|
+
export declare const CHAT_LIST_STYLE = "\n/* The list of chats: a search, then the chats by directory (a line each under the head of its group) or by day (each with the avatar of its directory) */\n.ta-chats { gap: 8px; }\n/* On a phone a folder opened is pushed over the list (PhoneStack): the same ground and spacing as the list. */\n.ta-chats > .ta-phone-stack > .ta-phone-stack-base, .ta-chats > .ta-phone-stack > .ta-phone-stack-top { gap: 8px; }\n.ta-chats > .ta-phone-stack > .ta-phone-stack-top { background: var(--ta-side); }\n.ta-chats-head { gap: 4px; padding: 0; margin-bottom: 0; }\n.ta-chats-search { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 11px; border-radius: 10px; background: var(--ta-raised); color: var(--ta-muted); border: 1px solid transparent; transition: border-color 120ms, background 120ms; }\n.ta-chats-search:focus-within { border-color: var(--ta-border-field); background: var(--ta-input); }\n.ta-chats-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ta-text); padding: 0; font-size: calc(13.5px * var(--ta-font-scale)); }\n.ta-chats-search input::placeholder { color: var(--ta-muted); }\n.ta-chats-clear { width: 24px; height: 24px; }\n.ta-chips { display: flex; gap: 6px; flex: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; margin: 0 -8px; padding: 0 8px 2px; }\n.ta-chips::-webkit-scrollbar { display: none; }\n.ta-chip-filter { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 11px; border-radius: 14px; border: 1px solid var(--ta-border); background: transparent; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); white-space: nowrap; transition: background 120ms, color 120ms, border-color 120ms; }\n.ta-chip-filter:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-chip-filter[aria-selected='true'] { background: var(--ta-selected); border-color: transparent; color: var(--ta-text); font-weight: 500; }\n.ta-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone-ink); }\n.ta-chip-count { color: var(--ta-muted); font-variant-numeric: tabular-nums; font-weight: 400; }\n.ta-chat-section + .ta-chat-section { margin-top: 6px; }\n.ta-chats-view { width: 26px; height: 26px; border-radius: 7px; color: var(--ta-muted); }\n.ta-chats-view[aria-pressed='true'] { color: var(--ta-text); background: var(--ta-hover-strong); }\n.ta-chat-group + .ta-chat-group { margin-top: 4px; }\n.ta-chat-group-head { position: relative; display: flex; align-items: center; }\n.ta-chat-group-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 40px 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; text-align: left; }\n.ta-chat-group-toggle:hover { background: var(--ta-hover); color: var(--ta-text); }\n.ta-chat-group-avatar { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--tone-tint); color: var(--tone-ink); font-size: 11px; font-weight: 600; }\n.ta-chat-group-toggle .ta-host-tag { margin-right: -3px; }\n.ta-chat-group-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-group-count { flex: none; color: var(--ta-muted); font-weight: 400; font-variant-numeric: tabular-nums; }\n.ta-chat-group-chevron { flex: none; color: var(--ta-muted); transition: transform 150ms ease; }\n.ta-chat-group-toggle[aria-expanded='true'] .ta-chat-group-chevron { transform: rotate(90deg); }\n.ta-chat-group-add { position: absolute; right: 6px; top: 50%; width: 26px; height: 26px; transform: translateY(-50%); opacity: 0; }\n.ta-chat-group-head:hover .ta-chat-group-add, .ta-chat-group-add:focus-visible { opacity: 1; }\n.ta-chat-group-toggle .ta-chat-icon, .ta-chat-folder-head .ta-chat-icon { flex: none; border-radius: 6px; }\n.ta-chat-folder-head { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 2px; border-bottom: 1px solid var(--ta-border); color: var(--ta-text); font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; }\n.ta-chat-folder-back { width: 30px; height: 30px; flex: none; }\n.ta-chat-folder-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-item.ta-compact { min-height: 34px; padding: 7px 10px 7px 38px; border-radius: 10px; }\n.ta-chat-row:has(.ta-chat-item.ta-compact) { border-radius: 10px; }\n.ta-compact .ta-chat-title { font-weight: 400; color: var(--ta-body); }\n.ta-chat-section-title { padding: 8px 10px 4px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-chat-fold { display: flex; align-items: center; gap: 4px; width: 100%; margin-top: 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }\n.ta-chat-fold:hover { color: var(--ta-text); }\n.ta-chat-fold svg { transition: transform 0.15s ease; }\n.ta-chat-fold[aria-expanded=\"true\"] svg { transform: rotate(90deg); }\n.ta-chat-removed .ta-chat-item { opacity: 0.72; }\n.ta-chat-group .ta-chat-fold { margin-top: 0; padding-left: 14px; }\n.ta-chat-more { height: 1px; }\n/* Rows out of view are not laid out or painted (their menu opens in a portal, their actions within them). */\n.ta-chat-row { position: relative; border-radius: 12px; content-visibility: auto; contain-intrinsic-size: auto 60px; }\n.ta-chat-row:has(.ta-compact) { contain-intrinsic-size: auto 36px; }\n.ta-chat-row:hover { background: var(--ta-hover); }\n.ta-chat-row.ta-selected { background: var(--ta-selected); }\n.ta-chat-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 9px 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; color: inherit; }\n.ta-chat-avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--tone-tint); color: var(--tone-ink); font-size: 15px; font-weight: 600; }\n.ta-chat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }\n.ta-chat-line { display: flex; align-items: center; gap: 8px; min-width: 0; }\n.ta-chat-title { flex: 1; min-width: 0; font-size: calc(14px * var(--ta-font-scale)); font-weight: 500; color: var(--ta-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-time { flex: none; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); font-variant-numeric: tabular-nums; }\n/* After the title, what it is (a group chat with friends): small, green, the title as short as it is so it sits beside it. */\n.ta-chat-title.ta-badged { flex: 0 1 auto; }\n.ta-chat-tag { display: inline-flex; align-items: center; gap: 2px; }\n.ta-chat-tag.ta-tone-blue { background: color-mix(in oklab, var(--ta-blue) 13%, transparent); color: var(--ta-blue); }\n.ta-chat-tag.ta-tone-gray { background: color-mix(in oklab, var(--ta-muted) 14%, transparent); color: var(--ta-muted); }\n.ta-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }\n.ta-title-line > .ta-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-title-line > .ta-chat-tag { margin: 0; }\n.ta-chat-badge { flex: none; margin-right: auto; margin-left: -2px; height: calc(16px * var(--ta-font-scale)); padding: 0 5px; border-radius: 4px; background: color-mix(in oklab, var(--ta-green) 13%, transparent); color: var(--ta-green); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 500; line-height: calc(16px * var(--ta-font-scale)); white-space: nowrap; }\n.ta-chat-sub { flex: 1; min-width: 0; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-chat-line .ta-spinner { width: 12px; height: 12px; }\n/* Someone to talk to: the double's face, or the face an extension draws for its agent, in place of a letter. */\n.ta-chat-face { flex: none; display: inline-grid; place-items: center; }\n/* A conversation of an extension that is no one to talk to (a brief, a question): its icon on a tile of its tint. */\n.ta-chat-icon { background: var(--ta-tile); color: var(--ta-tile-ink); }\n/* In a row of one line, in the room left of its title, under the letter of its group: the title stays where the others are. */\n.ta-compact .ta-chat-face { margin-left: -28px; }\n/* What goes on in it, at the end of a line: answering (a spinner, on the line under the title), a task that failed or was stopped. */\n.ta-chat-state { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); white-space: nowrap; }\n.ta-chat-state .ta-status { width: 8px; }\n.ta-chat-state.ta-failed { color: color-mix(in srgb, var(--ta-red) 85%, var(--ta-muted)); }\n/* Under the title, as a messaging app: the last thing said, or its directory; how a task ended, before it, as WeChat's [Draft]. */\n.ta-chat-dir { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: top; }\n.ta-chat-dir > svg { flex: none; }\n.ta-chat-flag { margin-right: 3px; }\n.ta-chat-flag.ta-replying { color: var(--ta-secondary); }\n.ta-chat-line > .ta-people { margin-left: 4px; }\n/* Out of the way of the button that takes a row out, as its words are. */\n.ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-line > .ta-people:last-child { margin-right: 28px; }\n.ta-chat-line .ta-people-face { box-shadow: none; background: none; }\n.ta-chat-line .ta-people-face + .ta-people-face { margin-left: -3px; }\n.ta-chat-flag.ta-failed { color: color-mix(in srgb, var(--ta-red) 85%, var(--ta-muted)); }\n.ta-chat-flag.ta-draft { color: var(--ta-red); }\n.ta-chat-flag.ta-waiting, .ta-chat-state.ta-waiting { color: color-mix(in srgb, var(--ta-blue) 85%, var(--ta-muted)); }\n/* Its directory, in place of its time while the pointer is on it. */\n.ta-chat-place { display: none; flex: 0 1 auto; align-items: center; gap: 4px; min-width: 0; max-width: 45%; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); }\n.ta-chat-place > svg { flex: none; }\n.ta-chat-place > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n@media (hover: hover) {\n .ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-place { display: inline-flex; }\n .ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-time { display: none; }\n}\n.ta-chats-add { width: 36px; height: 36px; border-radius: 10px; background: var(--ta-raised); }\n/* On the line under the title, at its end; in the middle of a row of one line. */\n.ta-chat-delete { position: absolute; bottom: 7px; right: 8px; width: 26px; height: 26px; opacity: 0; }\n.ta-chat-row:has(.ta-compact) .ta-chat-delete { bottom: auto; top: 50%; width: 30px; height: 30px; transform: translateY(-50%); }\n.ta-chat-row:hover .ta-chat-item:not(.ta-compact) .ta-chat-sub { padding-right: 28px; }\n.ta-chat-delete:hover:not(:disabled) { color: var(--ta-red); }\n.ta-chat-row:hover .ta-chat-delete, .ta-chat-delete:focus-visible { opacity: 1; }\n/* Taken out, while ta serve closes it: its button stays, turning. */\n.ta-chat-row .ta-chat-delete.ta-icon-button.ta-busy { display: inline-grid; opacity: 1; }\n.ta-chat-row:hover .ta-compact .ta-chat-time, .ta-chat-row:hover .ta-chat-state { visibility: hidden; }\n/*\n * Unseen, as a messenger's unread: an amber dot on the corner of the avatar (before the time in a row of one line), as\n * the agents of the side bar have; it grows in and shrinks away. Cut out of the avatar by the color of the row.\n */\n.ta-chat-avatar-box { position: relative; display: inline-flex; flex: none; }\n.ta-chat-row { --ta-chat-bg: var(--ta-side); }\n.ta-chat-row:hover { --ta-chat-bg: var(--ta-hover); }\n.ta-chat-row.ta-selected { --ta-chat-bg: var(--ta-selected); }\n/* A row that slides past others to its new place (ListMotion) goes over them, in the color of its row. */\n.ta-chat-row[data-moving] { z-index: 1; background: var(--ta-chat-bg); }\n.ta-chat-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ta-yellow); transform: scale(0); opacity: 0; transition: transform 0.24s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.18s ease; }\n.ta-chat-line > .ta-chat-dot:not(.ta-on) { width: 0; margin-left: -8px; }\n.ta-chat-avatar-box > .ta-chat-dot { position: absolute; right: -2px; bottom: -2px; z-index: 1; width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--ta-chat-bg); }\n.ta-chat-dot.ta-on { transform: none; opacity: 1; }\n/* A conversation that waits for the user to decide: a blue ? in place of the amber dot, which seeing it does not take away. */\n.ta-chat-dot.ta-asks { display: grid; place-items: center; background: var(--ta-blue); color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }\n.ta-chat-line > .ta-chat-dot.ta-asks { width: 13px; height: 13px; }\n.ta-chat-avatar-box > .ta-chat-dot.ta-asks { right: -3px; bottom: -3px; width: 17px; height: 17px; font-size: 10px; }\n/* Only those going on (the row of the double opened the list): a chip that clears it, its count beside its label. */\n.ta-chat-filter { display: flex; padding: 0 2px 2px; }\n.ta-chat-filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 11px; border: 0; border-radius: 14px; background: var(--ta-chip); color: var(--ta-text); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; transition: background 120ms; }\n.ta-chat-filter-chip:hover { background: var(--ta-selected); }\n.ta-chat-filter-chip > svg { color: var(--ta-muted); }\n.ta-chat-filter-count { font-variant-numeric: tabular-nums; color: var(--ta-secondary); }\n/* How many wait for the user to decide, on the entry of the chats: over the corner of its icon. */\n.ta-asks-badge { position: absolute; top: 3px; right: 1px; z-index: 1; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px; background: var(--ta-blue); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; box-shadow: 0 0 0 2px var(--ta-side); }\n.ta-tabbar-icon > .ta-asks-badge { top: -5px; right: -11px; }\n@media (prefers-reduced-motion: reduce) { .ta-chat-dot { transition: opacity 0.18s ease; } }\n/* What came unseen reads as unread: in the color of the text, not muted. */\n.ta-chat-sub.ta-unseen { color: var(--ta-text); }\n/* Above the box: where a new conversation will work (ComposerBox's head), a pill of its directory. */\n.ta-console-head { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 0 6px; }\n.ta-console-head .ta-cwd-chip { max-width: min(100%, 360px); height: 26px; padding: 0 8px 0 7px; background: transparent; }\n.ta-console-head .ta-cwd-chip:hover { background: var(--ta-hover); }\n.ta-console-head .ta-cwd-chip .ta-ellipsis { flex: 0 1 auto; min-width: 0; max-width: none; }\n.ta-cwd-chip { display: inline-flex; align-items: center; gap: 5px; flex: none; max-width: 180px; overflow: hidden; height: 30px; padding: 0 9px 0 10px; border: 0; border-radius: 15px; background: var(--ta-hover); color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); transition: background 120ms, color 120ms; }\n.ta-cwd-chip:hover { background: var(--ta-hover-strong); color: var(--ta-text); }\n.ta-cwd-chip svg { flex: none; }\n@media (max-width: 600px) { .ta-cwd-chip { max-width: 120px; } }\n/* The letters of the list in hues of the agents' faces (yellow, blue, orange, green, violet, pink), drawn as tints of the theme (--ta-tint-<n>, style/tints.ts). */\n.ta-tone-0 { --tone-tint: var(--ta-tint-2); --tone-ink: var(--ta-tint-ink-2); }\n.ta-tone-1 { --tone-tint: var(--ta-tint-0); --tone-ink: var(--ta-tint-ink-0); }\n.ta-tone-2 { --tone-tint: var(--ta-tint-4); --tone-ink: var(--ta-tint-ink-4); }\n.ta-tone-3 { --tone-tint: var(--ta-tint-3); --tone-ink: var(--ta-tint-ink-3); }\n.ta-tone-4 { --tone-tint: var(--ta-tint-5); --tone-ink: var(--ta-tint-ink-5); }\n.ta-tone-5 { --tone-tint: var(--ta-tint-7); --tone-ink: var(--ta-tint-ink-7); }\n/* The partners (PartnersList): agents, friends and group chats, each a section under a small title, rows as the chats. */\n.ta-partners .ta-chat-section-title { display: flex; align-items: center; gap: 6px; }\n.ta-partners .ta-chat-group + .ta-chat-group { margin-top: 6px; }\n.ta-partner-online { position: absolute; left: -1px; bottom: -1px; z-index: 1; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ta-chat-bg); background: var(--ta-green); }\n/* Starting a chat (GroupPicker): agents and friends to tick, the one of a chat it starts from ticked already. */\n.ta-partner-pick { display: flex; flex-direction: column; gap: 10px; min-height: 0; }\n.ta-partner-pick-lead { margin: 0; color: var(--ta-secondary); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-partner-pick-list { display: flex; flex-direction: column; gap: 2px; min-height: 0; max-height: min(56vh, 420px); margin: 0; padding: 0; overflow-y: auto; list-style: none; }\n.ta-partner-pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: none; border-radius: 10px; background: transparent; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; }\n.ta-partner-pick-row:hover:not(:disabled) { background: var(--ta-hover); }\n.ta-partner-pick-row:disabled { cursor: default; }\n.ta-partner-pick-box { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; box-sizing: border-box; border: 1.5px solid var(--ta-border-field); border-radius: 50%; color: #fff; transition: background 0.12s, border-color 0.12s; }\n.ta-partner-pick-box.ta-on { border-color: var(--ta-green); background: var(--ta-green); }\n.ta-partner-pick-row:disabled .ta-partner-pick-box.ta-on { opacity: 0.5; }\n.ta-partner-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ta-partner-pick-kind { flex: none; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }\n.ta-partner-pick-error { margin: 0; color: var(--ta-red); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-partner-pick-foot { display: flex; justify-content: flex-end; }\n";
|
|
@@ -61,6 +61,12 @@ export const CHAT_LIST_STYLE = `
|
|
|
61
61
|
.ta-chat-time { flex: none; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-muted); font-variant-numeric: tabular-nums; }
|
|
62
62
|
/* After the title, what it is (a group chat with friends): small, green, the title as short as it is so it sits beside it. */
|
|
63
63
|
.ta-chat-title.ta-badged { flex: 0 1 auto; }
|
|
64
|
+
.ta-chat-tag { display: inline-flex; align-items: center; gap: 2px; }
|
|
65
|
+
.ta-chat-tag.ta-tone-blue { background: color-mix(in oklab, var(--ta-blue) 13%, transparent); color: var(--ta-blue); }
|
|
66
|
+
.ta-chat-tag.ta-tone-gray { background: color-mix(in oklab, var(--ta-muted) 14%, transparent); color: var(--ta-muted); }
|
|
67
|
+
.ta-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
|
|
68
|
+
.ta-title-line > .ta-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
69
|
+
.ta-title-line > .ta-chat-tag { margin: 0; }
|
|
64
70
|
.ta-chat-badge { flex: none; margin-right: auto; margin-left: -2px; height: calc(16px * var(--ta-font-scale)); padding: 0 5px; border-radius: 4px; background: color-mix(in oklab, var(--ta-green) 13%, transparent); color: var(--ta-green); font-size: calc(10.5px * var(--ta-font-scale)); font-weight: 500; line-height: calc(16px * var(--ta-font-scale)); white-space: nowrap; }
|
|
65
71
|
.ta-chat-sub { flex: 1; min-width: 0; font-size: calc(12.5px * var(--ta-font-scale)); color: var(--ta-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
66
72
|
.ta-chat-line .ta-spinner { width: 12px; height: 12px; }
|
|
@@ -74,7 +74,7 @@ function useChat() {
|
|
|
74
74
|
/** What a web extension draws: in its own boundary, so that a failure stays in its place. */
|
|
75
75
|
function Widget({ widget }) {
|
|
76
76
|
const Content = widget.component;
|
|
77
|
-
return (React.createElement(extension_view_1.ExtensionBoundary, { name: web_extension_protocol_1.WebLabelUtil.text(widget.title) || widget.id, resetKey: Content },
|
|
77
|
+
return (React.createElement(extension_view_1.ExtensionBoundary, { name: web_extension_protocol_1.WebLabelUtil.text(widget.title) || widget.id, extension: widget.extension, resetKey: Content },
|
|
78
78
|
React.createElement(Content, null)));
|
|
79
79
|
}
|
|
80
80
|
function Hero({ cwd, onPick }) {
|
|
@@ -39,6 +39,7 @@ const extension_view_1 = require("../extension/extension-view");
|
|
|
39
39
|
const hooks_1 = require("../hooks");
|
|
40
40
|
const code_renderers_1 = require("../markdown/code-renderers");
|
|
41
41
|
const chat_icon_1 = require("./chat-icon");
|
|
42
|
+
const chat_tag_1 = require("./chat-tag");
|
|
42
43
|
const link_1 = require("./link");
|
|
43
44
|
const media_1 = require("./media");
|
|
44
45
|
const secret_peek_1 = require("./secret-peek");
|
|
@@ -57,9 +58,10 @@ function AppContexts({ fileUrl, openLink, children, }) {
|
|
|
57
58
|
React.createElement(extension_view_1.ToolRenderers.Provider, { value: extensions.toolRenderers },
|
|
58
59
|
React.createElement(extension_view_1.SessionAvatars.Provider, { value: extensions.avatars },
|
|
59
60
|
React.createElement(chat_icon_1.ChatIconsProvider, { entries: extensions.chatIcons },
|
|
60
|
-
React.createElement(
|
|
61
|
-
React.createElement(extension_view_1.
|
|
62
|
-
React.createElement(extension_view_1.
|
|
63
|
-
React.createElement(
|
|
61
|
+
React.createElement(chat_tag_1.ChatTagsProvider, { entries: extensions.chatTags },
|
|
62
|
+
React.createElement(extension_view_1.SessionMenus.Provider, { value: extensions.sessionMenus },
|
|
63
|
+
React.createElement(extension_view_1.LoadedExtensions.Provider, { value: extensions.extensions },
|
|
64
|
+
React.createElement(extension_view_1.CallGroup.Provider, { value: extensions.callGroup },
|
|
65
|
+
React.createElement(secret_text_1.SecretPeeks.Provider, { value: secretPeek }, children)))))))))))));
|
|
64
66
|
}
|
|
65
67
|
//# sourceMappingURL=app-contexts.js.map
|
|
@@ -146,11 +146,11 @@ function SidebarView({ view }) {
|
|
|
146
146
|
const arrived = useArrived(view);
|
|
147
147
|
return (React.createElement("section", { className: "ta-side-view", "aria-label": title, "data-arrived": arrived ? '' : undefined },
|
|
148
148
|
React.createElement("header", { className: "ta-chats-head" }, Head ? (React.createElement("div", { className: "ta-side-view-head" },
|
|
149
|
-
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, resetKey: Head },
|
|
149
|
+
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, extension: view.extension, resetKey: Head },
|
|
150
150
|
React.createElement(extension_view_1.ExtensionPart, { component: Head })))) : (React.createElement("span", { className: "ta-chats-title" }, title))),
|
|
151
151
|
React.createElement(connection_bar_1.ConnectionBanner, null),
|
|
152
152
|
React.createElement("div", { className: "ta-side-view-body" },
|
|
153
|
-
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, resetKey: View },
|
|
153
|
+
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, extension: view.extension, resetKey: View },
|
|
154
154
|
React.createElement(extension_view_1.ExtensionPart, { component: View })))));
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
@@ -166,12 +166,12 @@ function PageView({ view, leading }) {
|
|
|
166
166
|
React.createElement("header", { className: `ta-main-head ${view.extension.startsWith('builtin:') ? 'ta-narrow-only' : ''}` },
|
|
167
167
|
pushed ? React.createElement(icon_1.IconButton, { icon: lucide_react_1.ChevronLeft, label: t('ta.back'), onClick: () => pushed.close() }) : leading,
|
|
168
168
|
view.head ? (React.createElement("div", { className: "ta-main-head-view" },
|
|
169
|
-
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, resetKey: view.head },
|
|
169
|
+
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, extension: view.extension, resetKey: view.head },
|
|
170
170
|
React.createElement(extension_view_1.ExtensionPart, { component: view.head })))) : (React.createElement("div", { className: "ta-main-title" },
|
|
171
171
|
React.createElement("span", null, title))),
|
|
172
172
|
React.createElement(workbench_toggle_1.WorkbenchToggle, null)),
|
|
173
173
|
React.createElement("div", { className: "ta-page-body" },
|
|
174
|
-
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, resetKey: View },
|
|
174
|
+
React.createElement(extension_view_1.ExtensionBoundary, { key: view.id, name: title, extension: view.extension, resetKey: View },
|
|
175
175
|
React.createElement(extension_view_1.ExtensionPart, { component: View })))));
|
|
176
176
|
}
|
|
177
177
|
//# sourceMappingURL=app-nav.js.map
|
|
@@ -46,6 +46,7 @@ const message_1 = require("../util/message");
|
|
|
46
46
|
const busy_1 = require("./busy");
|
|
47
47
|
const chat_icon_1 = require("./chat-icon");
|
|
48
48
|
const chat_list_util_1 = require("./chat-list-util");
|
|
49
|
+
const chat_tag_1 = require("./chat-tag");
|
|
49
50
|
const context_menu_1 = require("./context-menu");
|
|
50
51
|
const host_tag_1 = require("./host-tag");
|
|
51
52
|
const icon_1 = require("./icon");
|
|
@@ -168,6 +169,8 @@ exports.ChatItem = React.memo(function ChatItem({ session, source, selected, tim
|
|
|
168
169
|
// The double's conversation is named after it; an agent's has its name (the extension named it so).
|
|
169
170
|
const who = doubleName !== undefined ? { kind: 'double', name: doubleName } : session.group && avatars[session.group] ? { kind: 'agent' } : undefined;
|
|
170
171
|
const title = (who === null || who === void 0 ? void 0 : who.kind) === 'double' ? who.name : chat_list_util_1.ChatListUtil.title(session, t);
|
|
172
|
+
// What an extension says it is, after its name (Work, of a directory marked so); not the double's own.
|
|
173
|
+
const chatTag = (0, chat_tag_1.useChatTag)((who === null || who === void 0 ? void 0 : who.kind) === 'double' ? undefined : session);
|
|
171
174
|
// Held, a row offers what its hover does (its close button shows only on the row shown, on a phone).
|
|
172
175
|
const [menu, openMenu] = (0, context_menu_1.useContextMenu)();
|
|
173
176
|
const onContextMenu = (event) => openMenu(event, context_menu_1.ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: onSelect }], [
|
|
@@ -213,7 +216,8 @@ exports.ChatItem = React.memo(function ChatItem({ session, source, selected, tim
|
|
|
213
216
|
React.createElement("span", { className: "ta-chat-line" },
|
|
214
217
|
who && React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 20, mood: mood }),
|
|
215
218
|
tag,
|
|
216
|
-
React.createElement("span", { className:
|
|
219
|
+
React.createElement("span", { className: `ta-chat-title${chatTag ? ' ta-badged' : ''}` }, title),
|
|
220
|
+
React.createElement(chat_tag_1.ChatTagLabel, { tag: chatTag }),
|
|
217
221
|
viewers,
|
|
218
222
|
state,
|
|
219
223
|
React.createElement(ChatDot, { unseen: !!unseen, asks: asks, onSee: onSee }),
|
|
@@ -224,7 +228,8 @@ exports.ChatItem = React.memo(function ChatItem({ session, source, selected, tim
|
|
|
224
228
|
React.createElement("span", { className: "ta-chat-text" },
|
|
225
229
|
React.createElement("span", { className: "ta-chat-line" },
|
|
226
230
|
tag,
|
|
227
|
-
React.createElement("span", { className:
|
|
231
|
+
React.createElement("span", { className: `ta-chat-title${chatTag ? ' ta-badged' : ''}` }, title),
|
|
232
|
+
React.createElement(chat_tag_1.ChatTagLabel, { tag: chatTag }),
|
|
228
233
|
React.createElement("span", { className: "ta-chat-time" }, removing && handheld ? React.createElement("span", { className: "ta-spinner ta-later" }) : time),
|
|
229
234
|
React.createElement("span", { className: "ta-chat-place" },
|
|
230
235
|
React.createElement(icon_1.Icon, { icon: lucide_react_1.Folder, size: 12 }),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { WebChat, WebChatTag } from '../extension/web-extension-api';
|
|
3
|
+
import type { WebChatTagEntry } from '../extension/web-extension-protocol';
|
|
4
|
+
/** The tags web extensions give conversations (WebExtensionAPI.registerChatTag). */
|
|
5
|
+
export declare namespace ChatTagUtil {
|
|
6
|
+
function changed(): void;
|
|
7
|
+
/** The tag of the first extension that gives one, a few words; an extension that throws gives none. Asked once a conversation until they change. */
|
|
8
|
+
function find(entries: readonly WebChatTagEntry[], chat: WebChat): WebChatTag | undefined;
|
|
9
|
+
}
|
|
10
|
+
/** Gives the lists the tags of the extensions, and draws their rows again when an extension says they changed. */
|
|
11
|
+
export declare function ChatTagsProvider({ entries, children }: {
|
|
12
|
+
entries: readonly WebChatTagEntry[];
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
/** The tag of a conversation, when an extension gives it one. */
|
|
16
|
+
export declare function useChatTag(chat: WebChat | undefined): WebChatTag | undefined;
|
|
17
|
+
/** A tag after the name of a conversation, as a messenger marks a group chat with friends. */
|
|
18
|
+
export declare function ChatTagLabel({ tag }: {
|
|
19
|
+
tag: WebChatTag | undefined;
|
|
20
|
+
}): React.JSX.Element | null;
|
|
21
|
+
//# sourceMappingURL=chat-tag.d.ts.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ChatTagUtil = void 0;
|
|
37
|
+
exports.ChatTagsProvider = ChatTagsProvider;
|
|
38
|
+
exports.useChatTag = useChatTag;
|
|
39
|
+
exports.ChatTagLabel = ChatTagLabel;
|
|
40
|
+
const lucide_react_1 = require("lucide-react");
|
|
41
|
+
const React = __importStar(require("react"));
|
|
42
|
+
const extension_view_1 = require("../extension/extension-view");
|
|
43
|
+
const use_t_1 = require("../i18n/use-t");
|
|
44
|
+
const icon_1 = require("./icon");
|
|
45
|
+
/** The tags web extensions give conversations (WebExtensionAPI.registerChatTag). */
|
|
46
|
+
var ChatTagUtil;
|
|
47
|
+
(function (ChatTagUtil) {
|
|
48
|
+
/** Counts what extensions said changed of their tags: what `find` remembered from before is asked again. */
|
|
49
|
+
let generation = 0;
|
|
50
|
+
const remembered = new WeakMap();
|
|
51
|
+
function changed() {
|
|
52
|
+
generation++;
|
|
53
|
+
}
|
|
54
|
+
ChatTagUtil.changed = changed;
|
|
55
|
+
/** The tag of the first extension that gives one, a few words; an extension that throws gives none. Asked once a conversation until they change. */
|
|
56
|
+
function find(entries, chat) {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
if (entries.length === 0) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
let memo = remembered.get(entries);
|
|
62
|
+
if ((memo === null || memo === void 0 ? void 0 : memo.generation) !== generation) {
|
|
63
|
+
memo = { generation, found: new Map() };
|
|
64
|
+
remembered.set(entries, memo);
|
|
65
|
+
}
|
|
66
|
+
const key = `${(_a = chat.group) !== null && _a !== void 0 ? _a : ''}\n${chat.cwd}\n${(_b = chat.sessionFile) !== null && _b !== void 0 ? _b : ''}`;
|
|
67
|
+
if (memo.found.has(key)) {
|
|
68
|
+
return memo.found.get(key);
|
|
69
|
+
}
|
|
70
|
+
const found = ask(entries, chat);
|
|
71
|
+
memo.found.set(key, found);
|
|
72
|
+
return found;
|
|
73
|
+
}
|
|
74
|
+
ChatTagUtil.find = find;
|
|
75
|
+
function ask(entries, chat) {
|
|
76
|
+
for (const { extension, source } of entries) {
|
|
77
|
+
try {
|
|
78
|
+
const found = source.tag({ sessionFile: chat.sessionFile, cwd: chat.cwd, ...(chat.group ? { group: chat.group } : {}) });
|
|
79
|
+
const text = typeof (found === null || found === void 0 ? void 0 : found.text) === 'string' ? found.text.trim() : '';
|
|
80
|
+
if (text) {
|
|
81
|
+
const tone = (found === null || found === void 0 ? void 0 : found.tone) === 'blue' || (found === null || found === void 0 ? void 0 : found.tone) === 'green' ? found.tone : 'gray';
|
|
82
|
+
return { text: text.slice(0, 16), tone, ...(typeof (found === null || found === void 0 ? void 0 : found.title) === 'string' ? { title: found.title } : {}) };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error(`The web extension ${extension} failed to give a tag:`, error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
})(ChatTagUtil || (exports.ChatTagUtil = ChatTagUtil = {}));
|
|
92
|
+
/** Gives the lists the tags of the extensions, and draws their rows again when an extension says they changed. */
|
|
93
|
+
function ChatTagsProvider({ entries, children }) {
|
|
94
|
+
const [version, setVersion] = React.useState(0);
|
|
95
|
+
const language = (0, use_t_1.useLanguage)();
|
|
96
|
+
const languageShown = React.useRef(language);
|
|
97
|
+
if (languageShown.current !== language) {
|
|
98
|
+
languageShown.current = language;
|
|
99
|
+
ChatTagUtil.changed();
|
|
100
|
+
}
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
const changed = () => {
|
|
103
|
+
ChatTagUtil.changed();
|
|
104
|
+
setVersion(count => count + 1);
|
|
105
|
+
};
|
|
106
|
+
const stops = entries.map(({ source }) => {
|
|
107
|
+
var _a;
|
|
108
|
+
try {
|
|
109
|
+
return (_a = source.subscribe) === null || _a === void 0 ? void 0 : _a.call(source, changed);
|
|
110
|
+
}
|
|
111
|
+
catch (_b) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return () => {
|
|
116
|
+
for (const stop of stops) {
|
|
117
|
+
stop === null || stop === void 0 ? void 0 : stop();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}, [entries]);
|
|
121
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: a new language is a new value, what the tags say read again
|
|
122
|
+
const value = React.useMemo(() => ({ entries: [...entries], version }), [entries, version, language]);
|
|
123
|
+
return React.createElement(extension_view_1.ChatTags.Provider, { value: value }, children);
|
|
124
|
+
}
|
|
125
|
+
/** The tag of a conversation, when an extension gives it one. */
|
|
126
|
+
function useChatTag(chat) {
|
|
127
|
+
const { entries, version } = React.useContext(extension_view_1.ChatTags);
|
|
128
|
+
const { sessionFile, cwd, group } = chat !== null && chat !== void 0 ? chat : { cwd: '' };
|
|
129
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: asked again when an extension said it changed
|
|
130
|
+
return React.useMemo(() => (chat && entries.length ? ChatTagUtil.find(entries, { sessionFile, cwd, ...(group ? { group } : {}) }) : undefined), [entries, version, sessionFile, cwd, group]);
|
|
131
|
+
}
|
|
132
|
+
/** A tag after the name of a conversation, as a messenger marks a group chat with friends. */
|
|
133
|
+
function ChatTagLabel({ tag }) {
|
|
134
|
+
var _a;
|
|
135
|
+
if (!tag) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return (React.createElement("span", { className: `ta-chat-badge ta-chat-tag ta-tone-${(_a = tag.tone) !== null && _a !== void 0 ? _a : 'gray'}`, title: tag.title },
|
|
139
|
+
tag.tone === 'gray' || !tag.tone ? React.createElement(icon_1.Icon, { icon: lucide_react_1.Lock, size: 9 }) : null,
|
|
140
|
+
tag.text));
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=chat-tag.js.map
|
|
@@ -44,7 +44,7 @@ function CustomHost() {
|
|
|
44
44
|
}
|
|
45
45
|
function CustomEntry({ entry, close }) {
|
|
46
46
|
const Component = entry.component;
|
|
47
|
-
return (React.createElement(extension_view_1.ExtensionBoundary, { name: entry.extension, resetKey: Component, fallback: null },
|
|
47
|
+
return (React.createElement(extension_view_1.ExtensionBoundary, { name: entry.extension, extension: entry.extension, resetKey: Component, fallback: null },
|
|
48
48
|
React.createElement(Component, { close: close })));
|
|
49
49
|
}
|
|
50
50
|
//# sourceMappingURL=custom-host.js.map
|
|
@@ -76,7 +76,7 @@ function EditorArea(props) {
|
|
|
76
76
|
const Content = editor.render;
|
|
77
77
|
return (React.createElement("div", { key: editor.id, className: "ta-editor-body", role: "tabpanel", hidden: editor.id !== active },
|
|
78
78
|
React.createElement(editor_actions_1.EditorActionsSlot.Provider, { value: editor.id === active ? slot : null },
|
|
79
|
-
React.createElement(extension_view_1.ExtensionBoundary, { name: web_extension_protocol_1.WebLabelUtil.text(editor.title), resetKey: Content },
|
|
79
|
+
React.createElement(extension_view_1.ExtensionBoundary, { name: web_extension_protocol_1.WebLabelUtil.text(editor.title), extension: editor.extension, resetKey: Content },
|
|
80
80
|
React.createElement(extension_view_1.ExtensionPart, { component: Content })))));
|
|
81
81
|
})));
|
|
82
82
|
}
|
|
@@ -96,7 +96,7 @@ function LauncherSurface({ active = true }) {
|
|
|
96
96
|
const View = view.component;
|
|
97
97
|
const title = web_extension_protocol_1.WebLabelUtil.text(view.title);
|
|
98
98
|
return (React.createElement("section", { key: view.id, className: "ta-launcher-section", "aria-label": title },
|
|
99
|
-
React.createElement(extension_view_1.ExtensionBoundary, { name: title, resetKey: View },
|
|
99
|
+
React.createElement(extension_view_1.ExtensionBoundary, { name: title, extension: view.extension, resetKey: View },
|
|
100
100
|
React.createElement(View, null))));
|
|
101
101
|
}))), top: React.createElement(search_page_1.SearchPage, { input: input, query: query, onQuery: setQuery, onClose: close }) })));
|
|
102
102
|
}
|
|
@@ -56,6 +56,7 @@ const thumbnail_1 = require("../util/thumbnail");
|
|
|
56
56
|
const voice_1 = require("../util/voice");
|
|
57
57
|
const workbench_protocol_1 = require("../workbench-protocol");
|
|
58
58
|
const chat_asks_1 = require("./chat-asks");
|
|
59
|
+
const chat_tag_1 = require("./chat-tag");
|
|
59
60
|
const composer_1 = require("./composer");
|
|
60
61
|
const composer_addons_1 = require("./composer-addons");
|
|
61
62
|
const composer_target_1 = require("./composer-target");
|
|
@@ -251,6 +252,8 @@ function SessionView({ store, server, workspace, info, onClosed, onActivity, lea
|
|
|
251
252
|
const title = (info === null || info === void 0 ? void 0 : info.sessionName) || (info ? message_1.MessageUtil.basename(info.cwd) : t('ta.session.title'));
|
|
252
253
|
const conversation = React.useMemo(() => ({ sessionId: store.sessionId, sessionFile: info === null || info === void 0 ? void 0 : info.sessionFile, cwd: info === null || info === void 0 ? void 0 : info.cwd, kind: 'chat', group: info === null || info === void 0 ? void 0 : info.group, title }), [store.sessionId, info === null || info === void 0 ? void 0 : info.sessionFile, info === null || info === void 0 ? void 0 : info.cwd, info === null || info === void 0 ? void 0 : info.group, title]);
|
|
253
254
|
const addons = (0, composer_addons_1.useComposerAddons)(conversation);
|
|
255
|
+
// What an extension says it is, after its name on top (Work, of a directory marked so).
|
|
256
|
+
const chatTag = (0, chat_tag_1.useChatTag)(info ? { sessionFile: info.sessionFile, cwd: info.cwd, ...(info.group ? { group: info.group } : {}) } : undefined);
|
|
254
257
|
// Finding words in it (ConversationFind): 0 while it does not show, counted up each time it is asked for.
|
|
255
258
|
const [finding, setFinding] = React.useState(0);
|
|
256
259
|
const closeFind = React.useCallback(() => setFinding(0), []);
|
|
@@ -377,7 +380,9 @@ function SessionView({ store, server, workspace, info, onClosed, onActivity, lea
|
|
|
377
380
|
!compact && (React.createElement("header", { className: "ta-session-header" },
|
|
378
381
|
leading,
|
|
379
382
|
React.createElement("div", { className: "ta-session-title" },
|
|
380
|
-
React.createElement("span", { className: "ta-title" },
|
|
383
|
+
chatTag ? (React.createElement("span", { className: "ta-title-line" },
|
|
384
|
+
React.createElement("span", { className: "ta-title" }, title),
|
|
385
|
+
React.createElement(chat_tag_1.ChatTagLabel, { tag: chatTag }))) : (React.createElement("span", { className: "ta-title" }, title)),
|
|
381
386
|
info && (React.createElement("span", { className: "ta-muted ta-path", title: info.cwd }, message_1.MessageUtil.shortPath(info.cwd)))),
|
|
382
387
|
React.createElement(people_1.PeopleFaces, { people: viewing, size: 24, label: t('ta.presence.viewing') }),
|
|
383
388
|
trailing)),
|
|
@@ -12,6 +12,11 @@ export declare const ChatIcons: React.Context<{
|
|
|
12
12
|
entries: WebExtensionsState['chatIcons'];
|
|
13
13
|
version: number;
|
|
14
14
|
}>;
|
|
15
|
+
/** The tags web extensions give conversations, and a count of their changes (ChatTagUtil). */
|
|
16
|
+
export declare const ChatTags: React.Context<{
|
|
17
|
+
entries: WebExtensionsState['chatTags'];
|
|
18
|
+
version: number;
|
|
19
|
+
}>;
|
|
15
20
|
/** The avatars that web extensions registered for the sessions of their groups. */
|
|
16
21
|
export declare const SessionAvatars: React.Context<Record<string, React.ComponentType<import("./web-extension-api").WebAvatarProps>>>;
|
|
17
22
|
/** The group of the conversations calls are answered in (WebExtensionsState.callGroup): shown as the record of a call. */
|
|
@@ -22,6 +27,8 @@ export declare const SessionMenus: React.Context<import("./web-api-menus").WebSe
|
|
|
22
27
|
export declare const LoadedExtensions: React.Context<import("./web-extension-protocol").LoadedWebExtension[]>;
|
|
23
28
|
interface BoundaryProps {
|
|
24
29
|
name: string;
|
|
30
|
+
/** The extension that draws it, by id or name: what threw is counted for its package (WebMetrics). */
|
|
31
|
+
extension?: string;
|
|
25
32
|
/** A new value (a new component) tries again after a failure. */
|
|
26
33
|
resetKey?: unknown;
|
|
27
34
|
/** In place of the error, where it would not fit. */
|
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ExtensionBoundary = exports.LoadedExtensions = exports.SessionMenus = exports.CallGroup = exports.SessionAvatars = exports.ChatIcons = exports.ToolRenderers = exports.MessageRenderers = void 0;
|
|
36
|
+
exports.ExtensionBoundary = exports.LoadedExtensions = exports.SessionMenus = exports.CallGroup = exports.SessionAvatars = exports.ChatTags = exports.ChatIcons = exports.ToolRenderers = exports.MessageRenderers = void 0;
|
|
37
37
|
exports.ExtensionPart = ExtensionPart;
|
|
38
38
|
exports.CustomMessage = CustomMessage;
|
|
39
39
|
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
@@ -42,12 +42,15 @@ const callout_1 = require("../components/callout");
|
|
|
42
42
|
const markdown_1 = require("../components/markdown");
|
|
43
43
|
const use_t_1 = require("../i18n/use-t");
|
|
44
44
|
const message_1 = require("../util/message");
|
|
45
|
+
const web_metrics_1 = require("./web-metrics");
|
|
45
46
|
/** The renderers of custom messages that web extensions registered. */
|
|
46
47
|
exports.MessageRenderers = React.createContext({});
|
|
47
48
|
/** How the calls of the tools of web extensions read (WebExtensionAPI.registerToolRenderer). */
|
|
48
49
|
exports.ToolRenderers = React.createContext([]);
|
|
49
50
|
/** The icons web extensions give conversations of theirs, and a count of their changes (ChatIconUtil). */
|
|
50
51
|
exports.ChatIcons = React.createContext({ entries: [], version: 0 });
|
|
52
|
+
/** The tags web extensions give conversations, and a count of their changes (ChatTagUtil). */
|
|
53
|
+
exports.ChatTags = React.createContext({ entries: [], version: 0 });
|
|
51
54
|
/** The avatars that web extensions registered for the sessions of their groups. */
|
|
52
55
|
exports.SessionAvatars = React.createContext({});
|
|
53
56
|
/** The group of the conversations calls are answered in (WebExtensionsState.callGroup): shown as the record of a call. */
|
|
@@ -66,6 +69,8 @@ class ExtensionBoundary extends React.Component {
|
|
|
66
69
|
return { error };
|
|
67
70
|
}
|
|
68
71
|
componentDidCatch(error) {
|
|
72
|
+
var _a;
|
|
73
|
+
(_a = web_metrics_1.WebMetrics.current) === null || _a === void 0 ? void 0 : _a.renderError(this.props.extension);
|
|
69
74
|
console.error(`${this.props.name} failed:`, error);
|
|
70
75
|
}
|
|
71
76
|
componentDidUpdate(previous) {
|
|
@@ -64,6 +64,7 @@ exports.WEB_ICONS = Object.freeze({
|
|
|
64
64
|
FlaskConical: lucide_react_1.FlaskConical,
|
|
65
65
|
Folder: lucide_react_1.Folder,
|
|
66
66
|
FolderInput: lucide_react_1.FolderInput,
|
|
67
|
+
FolderLock: lucide_react_1.FolderLock,
|
|
67
68
|
FolderOpen: lucide_react_1.FolderOpen,
|
|
68
69
|
FolderPlus: lucide_react_1.FolderPlus,
|
|
69
70
|
FolderSearch: lucide_react_1.FolderSearch,
|