@cortexkit/opencode-openai-auth 1.8.4 → 1.8.5
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/dist/bin.js +2 -2
- package/dist/{codex-request-C78nXs79.d.ts → codex-request-By530v1D.d.ts} +2 -1
- package/dist/{index-hvmj07f7.js → index-8x42xzxb.js} +20 -20
- package/dist/{index-t8248wa4.js → index-a7xv52hy.js} +1 -1
- package/dist/{index-k7zb6wa7.js → index-g5hv0tda.js} +1 -1
- package/dist/{index-pg5c6by3.js → index-jh90fx7y.js} +1 -1
- package/dist/index-n12zjwh9.js +8 -0
- package/dist/{index-e7gekawr.js → index-rmc6hwg6.js} +1 -1
- package/dist/{index-nsdjapq1.js → index-zah8t2d2.js} +1 -1
- package/dist/{index-1htk005d.js → index-zf649dj2.js} +1 -1
- package/dist/index-zne9tzy9.js +91 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/rpc/port-file.js +1 -1
- package/dist/rpc/protocol.js +1 -1
- package/dist/rpc/rpc-client.js +1 -1
- package/dist/sidebar-state.js +1 -1
- package/dist/tui-preferences.js +1 -1
- package/dist/tui.d.ts +1 -20
- package/dist/v2/server.d.ts +1 -1
- package/dist/v2/server.js +2 -2
- package/package.json +2 -2
- package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +20 -6
- package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +25 -0
- package/src/tui-compiled/raw/shared/30f5bc480f31f51c-roster.js +1 -1
- package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +55 -5
- package/src/tui-compiled/raw/shared/4825e03209d6ae3e-with-lock.js +1 -1
- package/src/tui-compiled/raw/shared/549daf371622c304-index.tsx +497 -0
- package/src/tui-compiled/raw/shared/7c97ac0cec074ae7-format.js +208 -0
- package/src/tui-compiled/raw/shared/b4ad0d49429f0096-map.js +98 -0
- package/src/tui-compiled/raw/shared/b717cdcce3966455-projection.js +90 -0
- package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +3 -1
- package/src/tui-compiled/raw/tui.tsx +233 -634
- package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +20 -6
- package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +25 -0
- package/src/tui-compiled/runtime/shared/30f5bc480f31f51c-roster.js +1 -1
- package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +55 -5
- package/src/tui-compiled/runtime/shared/4825e03209d6ae3e-with-lock.js +1 -1
- package/src/tui-compiled/runtime/shared/549daf371622c304-index.js +550 -0
- package/src/tui-compiled/runtime/shared/7c97ac0cec074ae7-format.js +208 -0
- package/src/tui-compiled/runtime/shared/b4ad0d49429f0096-map.js +98 -0
- package/src/tui-compiled/runtime/shared/b717cdcce3966455-projection.js +90 -0
- package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +3 -1
- package/src/tui-compiled/runtime/tui.js +258 -879
- package/dist/index-a5h82jha.js +0 -8
- package/dist/index-kemp2vh4.js +0 -91
- /package/dist/{index-hnmbhgk4.js → index-95s2mw9w.js} +0 -0
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
2
|
+
import { use as _$use } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
3
|
+
import { memo as _$memo } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
4
|
+
import { effect as _$effect } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
5
|
+
import { insertNode as _$insertNode } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
6
|
+
import { insert as _$insert } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
7
|
+
import { setProp as _$setProp } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
8
|
+
import { createElement as _$createElement } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
9
|
+
import { createContext, createMemo, createSignal, For, Show, useContext } from "opentui:runtime-module:solid-js";
|
|
10
|
+
import { formatQuota, quotaWindowParts } from "./7c97ac0cec074ae7-format.js";
|
|
11
|
+
const FrameContext = createContext();
|
|
12
|
+
function frameContext() {
|
|
13
|
+
const context = useContext(FrameContext);
|
|
14
|
+
if (!context) throw new Error('Sidebar primitives must be inside SidebarFrame');
|
|
15
|
+
return context;
|
|
16
|
+
}
|
|
17
|
+
function displayWidth(text) {
|
|
18
|
+
const bun = globalThis.Bun;
|
|
19
|
+
return bun?.stringWidth ? bun.stringWidth(text) : Array.from(text).length;
|
|
20
|
+
}
|
|
21
|
+
function fitText(text, columns) {
|
|
22
|
+
if (displayWidth(text) <= columns) return text;
|
|
23
|
+
if (columns < 1) return '';
|
|
24
|
+
let kept = '';
|
|
25
|
+
let used = 0;
|
|
26
|
+
for (const char of text) {
|
|
27
|
+
const width = displayWidth(char);
|
|
28
|
+
if (used + width > columns - 1) break;
|
|
29
|
+
kept += char;
|
|
30
|
+
used += width;
|
|
31
|
+
}
|
|
32
|
+
return `${kept}\u2026`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** A heading and its plugin-owned rows, with the frame's section spacing. */
|
|
36
|
+
export function SidebarSection(props) {
|
|
37
|
+
const context = frameContext();
|
|
38
|
+
return [(() => {
|
|
39
|
+
var _el$ = _$createElement("box"),
|
|
40
|
+
_el$2 = _$createElement("text"),
|
|
41
|
+
_el$3 = _$createElement("b");
|
|
42
|
+
_$insertNode(_el$, _el$2);
|
|
43
|
+
_$setProp(_el$, "width", '100%');
|
|
44
|
+
_$setProp(_el$, "marginTop", 1);
|
|
45
|
+
_$insertNode(_el$2, _el$3);
|
|
46
|
+
_$insert(_el$3, () => props.title);
|
|
47
|
+
_$effect(_$p => _$setProp(_el$2, "fg", context.theme.text, _$p));
|
|
48
|
+
return _el$;
|
|
49
|
+
})(), _$memo(() => props.children)];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Keep labels whole and reserve one blank cell before an ellipsized value. */
|
|
53
|
+
export function SidebarStatRow(props) {
|
|
54
|
+
const context = frameContext();
|
|
55
|
+
const [width, setWidth] = createSignal(0);
|
|
56
|
+
let row;
|
|
57
|
+
const value = () => width() <= 0 ? props.value : fitText(props.value, width() - displayWidth(props.label) - 1);
|
|
58
|
+
return (() => {
|
|
59
|
+
var _el$4 = _$createElement("box"),
|
|
60
|
+
_el$5 = _$createElement("text"),
|
|
61
|
+
_el$6 = _$createElement("text"),
|
|
62
|
+
_el$7 = _$createElement("b");
|
|
63
|
+
_$insertNode(_el$4, _el$5);
|
|
64
|
+
_$insertNode(_el$4, _el$6);
|
|
65
|
+
_$use(element => {
|
|
66
|
+
row = element;
|
|
67
|
+
}, _el$4);
|
|
68
|
+
_$setProp(_el$4, "onSizeChange", () => setWidth(row?.width ?? 0));
|
|
69
|
+
_$setProp(_el$4, "width", '100%');
|
|
70
|
+
_$setProp(_el$4, "flexDirection", 'row');
|
|
71
|
+
_$setProp(_el$4, "justifyContent", 'space-between');
|
|
72
|
+
_$setProp(_el$4, "columnGap", 1);
|
|
73
|
+
_$setProp(_el$5, "wrapMode", 'none');
|
|
74
|
+
_$setProp(_el$5, "flexShrink", 0);
|
|
75
|
+
_$insert(_el$5, () => props.label);
|
|
76
|
+
_$insertNode(_el$6, _el$7);
|
|
77
|
+
_$setProp(_el$6, "wrapMode", 'none');
|
|
78
|
+
_$setProp(_el$6, "flexShrink", 1);
|
|
79
|
+
_$insert(_el$7, value);
|
|
80
|
+
_$effect(_p$ => {
|
|
81
|
+
var _v$ = context.theme.textMuted,
|
|
82
|
+
_v$2 = context.theme[props.tone ?? 'text'];
|
|
83
|
+
_v$ !== _p$.e && (_p$.e = _$setProp(_el$5, "fg", _v$, _p$.e));
|
|
84
|
+
_v$2 !== _p$.t && (_p$.t = _$setProp(_el$6, "fg", _v$2, _p$.t));
|
|
85
|
+
return _p$;
|
|
86
|
+
}, {
|
|
87
|
+
e: undefined,
|
|
88
|
+
t: undefined
|
|
89
|
+
});
|
|
90
|
+
return _el$4;
|
|
91
|
+
})();
|
|
92
|
+
}
|
|
93
|
+
export function SidebarTextRow(props) {
|
|
94
|
+
const context = frameContext();
|
|
95
|
+
return (() => {
|
|
96
|
+
var _el$8 = _$createElement("text");
|
|
97
|
+
_$insert(_el$8, () => props.text);
|
|
98
|
+
_$effect(_$p => _$setProp(_el$8, "fg", context.theme[props.tone ?? 'textMuted'], _$p));
|
|
99
|
+
return _el$8;
|
|
100
|
+
})();
|
|
101
|
+
}
|
|
102
|
+
function usageTone(used, appearance) {
|
|
103
|
+
if (used >= appearance.errorThreshold) return 'error';
|
|
104
|
+
if (used >= appearance.warnThreshold) return 'warning';
|
|
105
|
+
return 'success';
|
|
106
|
+
}
|
|
107
|
+
function barSegments(used, appearance, pace) {
|
|
108
|
+
const width = appearance.barWidth;
|
|
109
|
+
const cells = pct => Math.max(0, Math.min(Math.round(pct / 100 * width), width));
|
|
110
|
+
const usedCells = cells(used);
|
|
111
|
+
const tone = usageTone(used, appearance);
|
|
112
|
+
const plain = [{
|
|
113
|
+
text: appearance.barFilledChar.repeat(usedCells),
|
|
114
|
+
tone
|
|
115
|
+
}, {
|
|
116
|
+
text: appearance.barEmptyChar.repeat(width - usedCells),
|
|
117
|
+
tone
|
|
118
|
+
}];
|
|
119
|
+
const overlay = pace?.overlay;
|
|
120
|
+
if (!overlay) return plain.filter(segment => segment.text.length > 0);
|
|
121
|
+
const paceCells = cells(overlay.percent);
|
|
122
|
+
const lo = Math.min(usedCells, paceCells);
|
|
123
|
+
const hi = Math.max(usedCells, paceCells);
|
|
124
|
+
if (lo === hi) return plain.filter(segment => segment.text.length > 0);
|
|
125
|
+
return [{
|
|
126
|
+
text: appearance.barFilledChar.repeat(lo),
|
|
127
|
+
tone
|
|
128
|
+
}, {
|
|
129
|
+
text: (overlay.kind === 'deficit' ? '\u2593' : '\u2592').repeat(hi - lo),
|
|
130
|
+
tone: overlay.kind === 'deficit' ? 'error' : 'success'
|
|
131
|
+
}, {
|
|
132
|
+
text: appearance.barEmptyChar.repeat(width - hi),
|
|
133
|
+
tone
|
|
134
|
+
}].filter(segment => segment.text.length > 0);
|
|
135
|
+
}
|
|
136
|
+
function QuotaRow(props) {
|
|
137
|
+
const context = frameContext();
|
|
138
|
+
const [columns, setColumns] = createSignal(0);
|
|
139
|
+
let row;
|
|
140
|
+
const label = () => props.part.name.padEnd(props.labelWidth);
|
|
141
|
+
const figure = () => ` ${props.part.kind === 'budget' && props.part.figure.startsWith(`${props.part.name} `) ? props.part.figure.slice(props.part.name.length + 1) : props.part.figure}`;
|
|
142
|
+
const reset = () => props.part.resetIn ?? (props.part.resetSinceReading ? 'reset' : undefined);
|
|
143
|
+
const used = () => 100 - (props.part.remainingPercent ?? 100);
|
|
144
|
+
const fit = () => {
|
|
145
|
+
const barWidth = context.appearance.barWidth;
|
|
146
|
+
const resetWidth = displayWidth(reset() ?? '');
|
|
147
|
+
if (columns() <= 0) return {
|
|
148
|
+
barCells: barWidth,
|
|
149
|
+
showReset: resetWidth > 0
|
|
150
|
+
};
|
|
151
|
+
const fixed = displayWidth(label()) + displayWidth(figure());
|
|
152
|
+
if (resetWidth > 0 && fixed + barWidth + 1 + resetWidth <= columns()) return {
|
|
153
|
+
barCells: barWidth,
|
|
154
|
+
showReset: true
|
|
155
|
+
};
|
|
156
|
+
const room = columns() - fixed;
|
|
157
|
+
return {
|
|
158
|
+
barCells: room >= barWidth ? barWidth : room >= 3 ? room : 0,
|
|
159
|
+
showReset: false
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
// Stable fits keep existing bar nodes alive through the first measurement.
|
|
163
|
+
const barCells = createMemo(() => fit().barCells);
|
|
164
|
+
const showReset = createMemo(() => fit().showReset);
|
|
165
|
+
const paceLine = () => {
|
|
166
|
+
const text = props.pace?.text;
|
|
167
|
+
if (!text || columns() <= 0) return text;
|
|
168
|
+
return fitText(text, columns() - props.labelWidth);
|
|
169
|
+
};
|
|
170
|
+
return [(() => {
|
|
171
|
+
var _el$9 = _$createElement("box"),
|
|
172
|
+
_el$0 = _$createElement("box"),
|
|
173
|
+
_el$1 = _$createElement("text"),
|
|
174
|
+
_el$10 = _$createElement("text");
|
|
175
|
+
_$insertNode(_el$9, _el$0);
|
|
176
|
+
_$use(element => {
|
|
177
|
+
row = element;
|
|
178
|
+
}, _el$9);
|
|
179
|
+
_$setProp(_el$9, "onSizeChange", () => setColumns(row?.width ?? 0));
|
|
180
|
+
_$setProp(_el$9, "width", '100%');
|
|
181
|
+
_$setProp(_el$9, "flexDirection", 'row');
|
|
182
|
+
_$setProp(_el$9, "justifyContent", 'space-between');
|
|
183
|
+
_$insertNode(_el$0, _el$1);
|
|
184
|
+
_$insertNode(_el$0, _el$10);
|
|
185
|
+
_$setProp(_el$0, "flexDirection", 'row');
|
|
186
|
+
_$setProp(_el$0, "flexShrink", 0);
|
|
187
|
+
_$setProp(_el$1, "wrapMode", 'none');
|
|
188
|
+
_$insert(_el$1, label);
|
|
189
|
+
_$insert(_el$0, _$createComponent(For, {
|
|
190
|
+
get each() {
|
|
191
|
+
return barSegments(used(), {
|
|
192
|
+
...context.appearance,
|
|
193
|
+
barWidth: barCells()
|
|
194
|
+
}, props.pace);
|
|
195
|
+
},
|
|
196
|
+
children: segment => (() => {
|
|
197
|
+
var _el$12 = _$createElement("text");
|
|
198
|
+
_$setProp(_el$12, "wrapMode", 'none');
|
|
199
|
+
_$insert(_el$12, () => segment.text);
|
|
200
|
+
_$effect(_$p => _$setProp(_el$12, "fg", context.theme[segment.tone], _$p));
|
|
201
|
+
return _el$12;
|
|
202
|
+
})()
|
|
203
|
+
}), _el$10);
|
|
204
|
+
_$setProp(_el$10, "wrapMode", 'none');
|
|
205
|
+
_$insert(_el$10, figure);
|
|
206
|
+
_$insert(_el$9, _$createComponent(Show, {
|
|
207
|
+
get when() {
|
|
208
|
+
return showReset();
|
|
209
|
+
},
|
|
210
|
+
get children() {
|
|
211
|
+
var _el$11 = _$createElement("text");
|
|
212
|
+
_$setProp(_el$11, "wrapMode", 'none');
|
|
213
|
+
_$setProp(_el$11, "flexShrink", 0);
|
|
214
|
+
_$insert(_el$11, reset);
|
|
215
|
+
_$effect(_$p => _$setProp(_el$11, "fg", context.theme.textMuted, _$p));
|
|
216
|
+
return _el$11;
|
|
217
|
+
}
|
|
218
|
+
}), null);
|
|
219
|
+
_$effect(_p$ => {
|
|
220
|
+
var _v$3 = context.theme.textMuted,
|
|
221
|
+
_v$4 = context.theme[usageTone(used(), context.appearance)];
|
|
222
|
+
_v$3 !== _p$.e && (_p$.e = _$setProp(_el$1, "fg", _v$3, _p$.e));
|
|
223
|
+
_v$4 !== _p$.t && (_p$.t = _$setProp(_el$10, "fg", _v$4, _p$.t));
|
|
224
|
+
return _p$;
|
|
225
|
+
}, {
|
|
226
|
+
e: undefined,
|
|
227
|
+
t: undefined
|
|
228
|
+
});
|
|
229
|
+
return _el$9;
|
|
230
|
+
})(), _$createComponent(Show, {
|
|
231
|
+
get when() {
|
|
232
|
+
return paceLine();
|
|
233
|
+
},
|
|
234
|
+
keyed: true,
|
|
235
|
+
children: line => (() => {
|
|
236
|
+
var _el$13 = _$createElement("box"),
|
|
237
|
+
_el$14 = _$createElement("text"),
|
|
238
|
+
_el$15 = _$createElement("text");
|
|
239
|
+
_$insertNode(_el$13, _el$14);
|
|
240
|
+
_$insertNode(_el$13, _el$15);
|
|
241
|
+
_$setProp(_el$13, "width", '100%');
|
|
242
|
+
_$setProp(_el$13, "flexDirection", 'row');
|
|
243
|
+
_$insert(_el$14, () => ''.padEnd(props.labelWidth));
|
|
244
|
+
_$setProp(_el$15, "wrapMode", 'none');
|
|
245
|
+
_$insert(_el$15, line);
|
|
246
|
+
_$effect(_p$ => {
|
|
247
|
+
var _v$5 = context.theme.textMuted,
|
|
248
|
+
_v$6 = context.theme[props.pace?.tone ?? 'textMuted'];
|
|
249
|
+
_v$5 !== _p$.e && (_p$.e = _$setProp(_el$14, "fg", _v$5, _p$.e));
|
|
250
|
+
_v$6 !== _p$.t && (_p$.t = _$setProp(_el$15, "fg", _v$6, _p$.t));
|
|
251
|
+
return _p$;
|
|
252
|
+
}, {
|
|
253
|
+
e: undefined,
|
|
254
|
+
t: undefined
|
|
255
|
+
});
|
|
256
|
+
return _el$13;
|
|
257
|
+
})()
|
|
258
|
+
})];
|
|
259
|
+
}
|
|
260
|
+
function CollapsedAccountRow(props) {
|
|
261
|
+
const context = frameContext();
|
|
262
|
+
const [width, setWidth] = createSignal(0);
|
|
263
|
+
let row;
|
|
264
|
+
const hasQuota = () => quotaWindowParts(props.account.quota, {
|
|
265
|
+
now: context.now
|
|
266
|
+
}).windows.length > 0;
|
|
267
|
+
const text = () => hasQuota() ? formatQuota(props.account.quota, {
|
|
268
|
+
now: context.now,
|
|
269
|
+
form: 'narrow'
|
|
270
|
+
}) : null;
|
|
271
|
+
const label = () => {
|
|
272
|
+
if (width() <= 0) return props.account.label;
|
|
273
|
+
const value = text() === null ? displayWidth(props.account.emptyQuotaText?.collapsed ?? '\u2014') : displayWidth(text() ?? '') + 2;
|
|
274
|
+
return fitText(props.account.label, width() - value - 1);
|
|
275
|
+
};
|
|
276
|
+
const muted = () => props.account.collapsed?.muted ?? false;
|
|
277
|
+
const quotaTone = () => muted() ? 'textMuted' : props.account.collapsed?.quotaTone ?? 'success';
|
|
278
|
+
return (() => {
|
|
279
|
+
var _el$16 = _$createElement("box"),
|
|
280
|
+
_el$17 = _$createElement("text");
|
|
281
|
+
_$insertNode(_el$16, _el$17);
|
|
282
|
+
_$use(element => {
|
|
283
|
+
row = element;
|
|
284
|
+
}, _el$16);
|
|
285
|
+
_$setProp(_el$16, "onSizeChange", () => setWidth(row?.width ?? 0));
|
|
286
|
+
_$setProp(_el$16, "width", '100%');
|
|
287
|
+
_$setProp(_el$16, "flexDirection", 'row');
|
|
288
|
+
_$setProp(_el$16, "justifyContent", 'space-between');
|
|
289
|
+
_$setProp(_el$17, "wrapMode", 'none');
|
|
290
|
+
_$setProp(_el$17, "flexShrink", 1);
|
|
291
|
+
_$insert(_el$17, label);
|
|
292
|
+
_$insert(_el$16, _$createComponent(Show, {
|
|
293
|
+
get when() {
|
|
294
|
+
return text() !== null;
|
|
295
|
+
},
|
|
296
|
+
get fallback() {
|
|
297
|
+
return (() => {
|
|
298
|
+
var _el$22 = _$createElement("text");
|
|
299
|
+
_$insert(_el$22, () => props.account.emptyQuotaText?.collapsed ?? '\u2014');
|
|
300
|
+
_$effect(_$p => _$setProp(_el$22, "fg", context.theme.textMuted, _$p));
|
|
301
|
+
return _el$22;
|
|
302
|
+
})();
|
|
303
|
+
},
|
|
304
|
+
get children() {
|
|
305
|
+
var _el$18 = _$createElement("box"),
|
|
306
|
+
_el$21 = _$createElement("text");
|
|
307
|
+
_$insertNode(_el$18, _el$21);
|
|
308
|
+
_$setProp(_el$18, "flexDirection", 'row');
|
|
309
|
+
_$setProp(_el$18, "flexShrink", 0);
|
|
310
|
+
_$insert(_el$18, _$createComponent(Show, {
|
|
311
|
+
get when() {
|
|
312
|
+
return !muted();
|
|
313
|
+
},
|
|
314
|
+
get fallback() {
|
|
315
|
+
return (() => {
|
|
316
|
+
var _el$23 = _$createElement("text");
|
|
317
|
+
_$insert(_el$23, text);
|
|
318
|
+
_$effect(_$p => _$setProp(_el$23, "fg", context.theme.textMuted, _$p));
|
|
319
|
+
return _el$23;
|
|
320
|
+
})();
|
|
321
|
+
},
|
|
322
|
+
get children() {
|
|
323
|
+
var _el$19 = _$createElement("text"),
|
|
324
|
+
_el$20 = _$createElement("b");
|
|
325
|
+
_$insertNode(_el$19, _el$20);
|
|
326
|
+
_$insert(_el$20, text);
|
|
327
|
+
_$effect(_$p => _$setProp(_el$19, "fg", context.theme[quotaTone()], _$p));
|
|
328
|
+
return _el$19;
|
|
329
|
+
}
|
|
330
|
+
}), _el$21);
|
|
331
|
+
_$insert(_el$21, () => props.account.blocked ? ' \u2298' : ' \u25cf');
|
|
332
|
+
_$effect(_$p => _$setProp(_el$21, "fg", context.theme[props.account.indicatorTone], _$p));
|
|
333
|
+
return _el$18;
|
|
334
|
+
}
|
|
335
|
+
}), null);
|
|
336
|
+
_$effect(_$p => _$setProp(_el$17, "fg", context.theme[muted() ? 'textMuted' : 'text'], _$p));
|
|
337
|
+
return _el$16;
|
|
338
|
+
})();
|
|
339
|
+
}
|
|
340
|
+
function AccountBlock(props) {
|
|
341
|
+
const context = frameContext();
|
|
342
|
+
const age = () => quotaWindowParts(props.account.quota, {
|
|
343
|
+
now: context.now
|
|
344
|
+
}).age;
|
|
345
|
+
const hasRows = () => props.account.groups.some(group => group.rows.length > 0);
|
|
346
|
+
return (() => {
|
|
347
|
+
var _el$24 = _$createElement("box"),
|
|
348
|
+
_el$25 = _$createElement("box"),
|
|
349
|
+
_el$26 = _$createElement("text"),
|
|
350
|
+
_el$27 = _$createElement("b"),
|
|
351
|
+
_el$28 = _$createElement("text"),
|
|
352
|
+
_el$29 = _$createElement("b");
|
|
353
|
+
_$insertNode(_el$24, _el$25);
|
|
354
|
+
_$setProp(_el$24, "width", '100%');
|
|
355
|
+
_$setProp(_el$24, "flexDirection", 'column');
|
|
356
|
+
_$insertNode(_el$25, _el$26);
|
|
357
|
+
_$insertNode(_el$25, _el$28);
|
|
358
|
+
_$setProp(_el$25, "width", '100%');
|
|
359
|
+
_$setProp(_el$25, "flexDirection", 'row');
|
|
360
|
+
_$setProp(_el$25, "justifyContent", 'space-between');
|
|
361
|
+
_$insertNode(_el$26, _el$27);
|
|
362
|
+
_$insert(_el$27, () => props.account.label, null);
|
|
363
|
+
_$insert(_el$27, (() => {
|
|
364
|
+
var _c$ = _$memo(() => !!props.account.titleSuffix);
|
|
365
|
+
return () => _c$() ? ` · ${props.account.titleSuffix}` : '';
|
|
366
|
+
})(), null);
|
|
367
|
+
_$insertNode(_el$28, _el$29);
|
|
368
|
+
_$insert(_el$29, () => props.account.status.text);
|
|
369
|
+
_$insert(_el$24, () => context.beforeQuota?.(props.account), null);
|
|
370
|
+
_$insert(_el$24, _$createComponent(Show, {
|
|
371
|
+
get when() {
|
|
372
|
+
return hasRows();
|
|
373
|
+
},
|
|
374
|
+
get fallback() {
|
|
375
|
+
return _$createComponent(SidebarTextRow, {
|
|
376
|
+
get text() {
|
|
377
|
+
return props.account.emptyQuotaText?.expanded ?? '\u2014';
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
get children() {
|
|
382
|
+
return _$createComponent(For, {
|
|
383
|
+
get each() {
|
|
384
|
+
return props.account.groups;
|
|
385
|
+
},
|
|
386
|
+
children: group => [_$createComponent(Show, {
|
|
387
|
+
get when() {
|
|
388
|
+
return group.title;
|
|
389
|
+
},
|
|
390
|
+
get children() {
|
|
391
|
+
return _$createComponent(SidebarTextRow, {
|
|
392
|
+
get text() {
|
|
393
|
+
return group.title ?? '';
|
|
394
|
+
},
|
|
395
|
+
tone: "text"
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
}), _$createComponent(For, {
|
|
399
|
+
get each() {
|
|
400
|
+
return group.rows;
|
|
401
|
+
},
|
|
402
|
+
children: row => _$createComponent(QuotaRow, {
|
|
403
|
+
get part() {
|
|
404
|
+
return row.part;
|
|
405
|
+
},
|
|
406
|
+
get pace() {
|
|
407
|
+
return row.pace;
|
|
408
|
+
},
|
|
409
|
+
get labelWidth() {
|
|
410
|
+
return props.labelWidth;
|
|
411
|
+
}
|
|
412
|
+
})
|
|
413
|
+
})]
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
}), null);
|
|
417
|
+
_$insert(_el$24, _$createComponent(Show, {
|
|
418
|
+
get when() {
|
|
419
|
+
return age();
|
|
420
|
+
},
|
|
421
|
+
children: text => _$createComponent(SidebarTextRow, {
|
|
422
|
+
get text() {
|
|
423
|
+
return text();
|
|
424
|
+
}
|
|
425
|
+
})
|
|
426
|
+
}), null);
|
|
427
|
+
_$insert(_el$24, () => context.afterQuota?.(props.account), null);
|
|
428
|
+
_$effect(_p$ => {
|
|
429
|
+
var _v$7 = props.marginTop,
|
|
430
|
+
_v$8 = context.theme.text,
|
|
431
|
+
_v$9 = context.theme[props.account.status.tone];
|
|
432
|
+
_v$7 !== _p$.e && (_p$.e = _$setProp(_el$24, "marginTop", _v$7, _p$.e));
|
|
433
|
+
_v$8 !== _p$.t && (_p$.t = _$setProp(_el$26, "fg", _v$8, _p$.t));
|
|
434
|
+
_v$9 !== _p$.a && (_p$.a = _$setProp(_el$28, "fg", _v$9, _p$.a));
|
|
435
|
+
return _p$;
|
|
436
|
+
}, {
|
|
437
|
+
e: undefined,
|
|
438
|
+
t: undefined,
|
|
439
|
+
a: undefined
|
|
440
|
+
});
|
|
441
|
+
return _el$24;
|
|
442
|
+
})();
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/** Borderless, controlled presentation; host registration and provider policy stay in the plugin. */
|
|
446
|
+
export function SidebarFrame(props) {
|
|
447
|
+
const hasData = () => props.accounts.length > 0;
|
|
448
|
+
const headerLabel = () => !hasData() ? props.header.badge : `${props.collapsed ? '\u25b6' : '\u25bc'} ${props.header.badge}`;
|
|
449
|
+
const labelWidth = () => Math.max(3, ...props.accounts.flatMap(account => account.groups.flatMap(group => group.rows.map(row => row.part.name.length + 1))));
|
|
450
|
+
return _$createComponent(FrameContext.Provider, {
|
|
451
|
+
value: props,
|
|
452
|
+
get children() {
|
|
453
|
+
var _el$30 = _$createElement("box"),
|
|
454
|
+
_el$31 = _$createElement("box"),
|
|
455
|
+
_el$32 = _$createElement("box"),
|
|
456
|
+
_el$33 = _$createElement("text"),
|
|
457
|
+
_el$34 = _$createElement("b");
|
|
458
|
+
_$insertNode(_el$30, _el$31);
|
|
459
|
+
_$setProp(_el$30, "width", '100%');
|
|
460
|
+
_$setProp(_el$30, "flexDirection", 'column');
|
|
461
|
+
_$setProp(_el$30, "paddingTop", 1);
|
|
462
|
+
_$setProp(_el$30, "paddingBottom", 1);
|
|
463
|
+
_$setProp(_el$30, "paddingLeft", 1);
|
|
464
|
+
_$setProp(_el$30, "paddingRight", 1);
|
|
465
|
+
_$insertNode(_el$31, _el$32);
|
|
466
|
+
_$setProp(_el$31, "width", '100%');
|
|
467
|
+
_$setProp(_el$31, "flexDirection", 'row');
|
|
468
|
+
_$setProp(_el$31, "justifyContent", 'space-between');
|
|
469
|
+
_$setProp(_el$31, "alignItems", 'center');
|
|
470
|
+
_$setProp(_el$31, "onMouseDown", () => {
|
|
471
|
+
if (hasData()) props.onToggle();
|
|
472
|
+
});
|
|
473
|
+
_$insertNode(_el$32, _el$33);
|
|
474
|
+
_$setProp(_el$32, "paddingLeft", 1);
|
|
475
|
+
_$setProp(_el$32, "paddingRight", 1);
|
|
476
|
+
_$insertNode(_el$33, _el$34);
|
|
477
|
+
_$insert(_el$34, headerLabel);
|
|
478
|
+
_$insert(_el$31, _$createComponent(Show, {
|
|
479
|
+
get when() {
|
|
480
|
+
return props.header.version;
|
|
481
|
+
},
|
|
482
|
+
get children() {
|
|
483
|
+
var _el$35 = _$createElement("text");
|
|
484
|
+
_$insert(_el$35, () => props.header.version);
|
|
485
|
+
_$effect(_$p => _$setProp(_el$35, "fg", props.theme.textMuted, _$p));
|
|
486
|
+
return _el$35;
|
|
487
|
+
}
|
|
488
|
+
}), null);
|
|
489
|
+
_$insert(_el$30, _$createComponent(Show, {
|
|
490
|
+
get when() {
|
|
491
|
+
return _$memo(() => !!props.collapsed)() && hasData();
|
|
492
|
+
},
|
|
493
|
+
get children() {
|
|
494
|
+
return _$createComponent(For, {
|
|
495
|
+
get each() {
|
|
496
|
+
return props.accounts;
|
|
497
|
+
},
|
|
498
|
+
children: account => _$createComponent(CollapsedAccountRow, {
|
|
499
|
+
account: account
|
|
500
|
+
})
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}), null);
|
|
504
|
+
_$insert(_el$30, _$createComponent(Show, {
|
|
505
|
+
get when() {
|
|
506
|
+
return !props.collapsed || !hasData();
|
|
507
|
+
},
|
|
508
|
+
get children() {
|
|
509
|
+
return [_$createComponent(Show, {
|
|
510
|
+
get when() {
|
|
511
|
+
return _$memo(() => !!props.showQuota)() && hasData();
|
|
512
|
+
},
|
|
513
|
+
get children() {
|
|
514
|
+
return _$createComponent(SidebarSection, {
|
|
515
|
+
title: "Quota",
|
|
516
|
+
get children() {
|
|
517
|
+
return _$createComponent(For, {
|
|
518
|
+
get each() {
|
|
519
|
+
return props.accounts;
|
|
520
|
+
},
|
|
521
|
+
children: (account, index) => _$createComponent(AccountBlock, {
|
|
522
|
+
account: account,
|
|
523
|
+
get labelWidth() {
|
|
524
|
+
return labelWidth();
|
|
525
|
+
},
|
|
526
|
+
get marginTop() {
|
|
527
|
+
return index() === 0 ? 0 : 1;
|
|
528
|
+
}
|
|
529
|
+
})
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
}), _$memo(() => props.sections?.())];
|
|
535
|
+
}
|
|
536
|
+
}), null);
|
|
537
|
+
_$effect(_p$ => {
|
|
538
|
+
var _v$0 = props.theme.accent,
|
|
539
|
+
_v$1 = props.theme.background;
|
|
540
|
+
_v$0 !== _p$.e && (_p$.e = _$setProp(_el$32, "backgroundColor", _v$0, _p$.e));
|
|
541
|
+
_v$1 !== _p$.t && (_p$.t = _$setProp(_el$33, "fg", _v$1, _p$.t));
|
|
542
|
+
return _p$;
|
|
543
|
+
}, {
|
|
544
|
+
e: undefined,
|
|
545
|
+
t: undefined
|
|
546
|
+
});
|
|
547
|
+
return _el$30;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|