@cortexkit/opencode-openai-auth 1.8.6 → 1.9.1
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/{index-byz2j6hz.js → index-2f9w48sc.js} +1 -1
- package/dist/{index-zah8t2d2.js → index-5sgqz46z.js} +2 -2
- package/dist/{index-jh90fx7y.js → index-6j3059fy.js} +2 -2
- package/dist/index-6r27fz5a.js +91 -0
- package/dist/{index-kphzmgq6.js → index-96971sba.js} +1 -1
- package/dist/{index-pnvp8hvs.js → index-b79fxcrc.js} +1 -1
- package/dist/{index-5wgxt362.js → index-bvswyxpt.js} +1 -1
- package/dist/index-fqt90tbq.js +76 -0
- package/dist/{index-95s2mw9w.js → index-hpb6k6st.js} +2 -2
- package/dist/{index-25p8t63g.js → index-hyjrm2vw.js} +2 -2
- package/dist/{index-zf649dj2.js → index-k1dfzavn.js} +2 -2
- package/dist/index-mtf8pv2w.js +8 -0
- package/dist/index-mw7fqra8.js +63 -0
- 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/rpc/rpc-dir.js +1 -1
- package/dist/sidebar-state.js +1 -1
- package/dist/token-util-ybe08zph.js +1 -0
- package/dist/{token-j2jmx8k7.js → token-y2zkdr5m.js} +1 -1
- package/dist/tui-preferences.js +1 -1
- package/dist/v2/server.js +2 -2
- package/package.json +2 -2
- package/src/tui-compiled/raw/shared/0332701351b3eeec-format.js +45 -26
- package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +25 -0
- package/src/tui-compiled/raw/shared/352d228be2832bd4-hub.js +20 -1
- package/src/tui-compiled/raw/shared/4825e03209d6ae3e-with-lock.js +37 -10
- package/src/tui-compiled/raw/shared/549daf371622c304-index.tsx +288 -131
- package/src/tui-compiled/raw/shared/7c97ac0cec074ae7-format.js +30 -17
- package/src/tui-compiled/raw/shared/d0f0b6be200311af-insula.js +6 -0
- package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +2 -2
- package/src/tui-compiled/runtime/shared/0332701351b3eeec-format.js +45 -26
- package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +25 -0
- package/src/tui-compiled/runtime/shared/352d228be2832bd4-hub.js +20 -1
- package/src/tui-compiled/runtime/shared/4825e03209d6ae3e-with-lock.js +37 -10
- package/src/tui-compiled/runtime/shared/549daf371622c304-index.js +358 -225
- package/src/tui-compiled/runtime/shared/7c97ac0cec074ae7-format.js +30 -17
- package/src/tui-compiled/runtime/shared/d0f0b6be200311af-insula.js +6 -0
- package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +2 -2
- package/dist/index-a8wbqm6a.js +0 -74
- package/dist/index-n12zjwh9.js +0 -8
- package/dist/index-v6jcz0hz.js +0 -63
- package/dist/index-zne9tzy9.js +0 -91
- package/dist/token-util-7n2nfbyc.js +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createTextNode as _$createTextNode } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
1
2
|
import { createComponent as _$createComponent } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
2
3
|
import { use as _$use } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
3
4
|
import { memo as _$memo } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
@@ -6,7 +7,7 @@ import { insertNode as _$insertNode } from "opentui:runtime-module:%40opentui%2F
|
|
|
6
7
|
import { insert as _$insert } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
7
8
|
import { setProp as _$setProp } from "opentui:runtime-module:%40opentui%2Fsolid";
|
|
8
9
|
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 { createContext, createMemo, createSignal, For, Index, mergeProps, Show, useContext } from "opentui:runtime-module:solid-js";
|
|
10
11
|
import { formatQuota, quotaWindowParts } from "./7c97ac0cec074ae7-format.js";
|
|
11
12
|
const FrameContext = createContext();
|
|
12
13
|
function frameContext() {
|
|
@@ -95,7 +96,16 @@ export function SidebarTextRow(props) {
|
|
|
95
96
|
return (() => {
|
|
96
97
|
var _el$8 = _$createElement("text");
|
|
97
98
|
_$insert(_el$8, () => props.text);
|
|
98
|
-
_$effect(
|
|
99
|
+
_$effect(_p$ => {
|
|
100
|
+
var _v$3 = context.theme[props.tone ?? 'textMuted'],
|
|
101
|
+
_v$4 = props.wrapMode;
|
|
102
|
+
_v$3 !== _p$.e && (_p$.e = _$setProp(_el$8, "fg", _v$3, _p$.e));
|
|
103
|
+
_v$4 !== _p$.t && (_p$.t = _$setProp(_el$8, "wrapMode", _v$4, _p$.t));
|
|
104
|
+
return _p$;
|
|
105
|
+
}, {
|
|
106
|
+
e: undefined,
|
|
107
|
+
t: undefined
|
|
108
|
+
});
|
|
99
109
|
return _el$8;
|
|
100
110
|
})();
|
|
101
111
|
}
|
|
@@ -109,19 +119,23 @@ function barSegments(used, appearance, pace) {
|
|
|
109
119
|
const cells = pct => Math.max(0, Math.min(Math.round(pct / 100 * width), width));
|
|
110
120
|
const usedCells = cells(used);
|
|
111
121
|
const tone = usageTone(used, appearance);
|
|
122
|
+
// Keep the overlay's slot even when empty so live pacing changes reuse nodes.
|
|
112
123
|
const plain = [{
|
|
113
124
|
text: appearance.barFilledChar.repeat(usedCells),
|
|
114
125
|
tone
|
|
126
|
+
}, {
|
|
127
|
+
text: '',
|
|
128
|
+
tone
|
|
115
129
|
}, {
|
|
116
130
|
text: appearance.barEmptyChar.repeat(width - usedCells),
|
|
117
131
|
tone
|
|
118
132
|
}];
|
|
119
133
|
const overlay = pace?.overlay;
|
|
120
|
-
if (!overlay) return plain
|
|
134
|
+
if (!overlay) return plain;
|
|
121
135
|
const paceCells = cells(overlay.percent);
|
|
122
136
|
const lo = Math.min(usedCells, paceCells);
|
|
123
137
|
const hi = Math.max(usedCells, paceCells);
|
|
124
|
-
if (lo === hi) return plain
|
|
138
|
+
if (lo === hi) return plain;
|
|
125
139
|
return [{
|
|
126
140
|
text: appearance.barFilledChar.repeat(lo),
|
|
127
141
|
tone
|
|
@@ -131,37 +145,25 @@ function barSegments(used, appearance, pace) {
|
|
|
131
145
|
}, {
|
|
132
146
|
text: appearance.barEmptyChar.repeat(width - hi),
|
|
133
147
|
tone
|
|
134
|
-
}]
|
|
148
|
+
}];
|
|
135
149
|
}
|
|
136
150
|
function QuotaRow(props) {
|
|
137
151
|
const context = frameContext();
|
|
138
152
|
const [columns, setColumns] = createSignal(0);
|
|
139
153
|
let row;
|
|
140
|
-
const label = () => props.part.name.
|
|
154
|
+
const label = () => props.part.name + ' '.repeat(Math.max(0, props.labelWidth - displayWidth(props.part.name)));
|
|
141
155
|
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
|
|
156
|
+
const hasReading = () => props.part.reading === 'known';
|
|
143
157
|
const used = () => 100 - (props.part.remainingPercent ?? 100);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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);
|
|
158
|
+
// Size notifications can recompute an unchanged fit after text has been flushed
|
|
159
|
+
// for the frame. Keep equal segments, and update fixed slots in place when the
|
|
160
|
+
// bar changes, rather than replacing text nodes during layout.
|
|
161
|
+
const segments = createMemo(() => hasReading() ? barSegments(used(), {
|
|
162
|
+
...context.appearance,
|
|
163
|
+
barWidth: props.barCells
|
|
164
|
+
}, props.pace) : [], undefined, {
|
|
165
|
+
equals: (previous, next) => previous.length === next.length && previous.every((segment, index) => segment.text === next[index]?.text && segment.tone === next[index]?.tone)
|
|
166
|
+
});
|
|
165
167
|
const paceLine = () => {
|
|
166
168
|
const text = props.pace?.text;
|
|
167
169
|
if (!text || columns() <= 0) return text;
|
|
@@ -169,9 +171,7 @@ function QuotaRow(props) {
|
|
|
169
171
|
};
|
|
170
172
|
return [(() => {
|
|
171
173
|
var _el$9 = _$createElement("box"),
|
|
172
|
-
_el$0 = _$createElement("box")
|
|
173
|
-
_el$1 = _$createElement("text"),
|
|
174
|
-
_el$10 = _$createElement("text");
|
|
174
|
+
_el$0 = _$createElement("box");
|
|
175
175
|
_$insertNode(_el$9, _el$0);
|
|
176
176
|
_$use(element => {
|
|
177
177
|
row = element;
|
|
@@ -180,80 +180,139 @@ function QuotaRow(props) {
|
|
|
180
180
|
_$setProp(_el$9, "width", '100%');
|
|
181
181
|
_$setProp(_el$9, "flexDirection", 'row');
|
|
182
182
|
_$setProp(_el$9, "justifyContent", 'space-between');
|
|
183
|
-
_$insertNode(_el$0, _el$1);
|
|
184
|
-
_$insertNode(_el$0, _el$10);
|
|
185
183
|
_$setProp(_el$0, "flexDirection", 'row');
|
|
186
|
-
_$
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
get
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
184
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
185
|
+
get when() {
|
|
186
|
+
return props.labelWidth > 0;
|
|
187
|
+
},
|
|
188
|
+
get children() {
|
|
189
|
+
var _el$1 = _$createElement("text");
|
|
190
|
+
_$setProp(_el$1, "wrapMode", 'none');
|
|
191
|
+
_$setProp(_el$1, "flexShrink", 0);
|
|
192
|
+
_$insert(_el$1, label);
|
|
193
|
+
_$effect(_$p => _$setProp(_el$1, "fg", context.theme.textMuted, _$p));
|
|
194
|
+
return _el$1;
|
|
195
|
+
}
|
|
196
|
+
}), null);
|
|
197
|
+
_$insert(_el$0, _$createComponent(Show, {
|
|
198
|
+
get when() {
|
|
199
|
+
return hasReading();
|
|
200
|
+
},
|
|
201
|
+
get fallback() {
|
|
202
|
+
return (() => {
|
|
203
|
+
var _el$13 = _$createElement("text");
|
|
204
|
+
_$insertNode(_el$13, _$createTextNode(`no reading`));
|
|
205
|
+
_$setProp(_el$13, "wrapMode", 'none');
|
|
206
|
+
_$effect(_$p => _$setProp(_el$13, "fg", context.theme.textMuted, _$p));
|
|
207
|
+
return _el$13;
|
|
208
|
+
})();
|
|
195
209
|
},
|
|
196
|
-
children
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
210
|
+
get children() {
|
|
211
|
+
return _$createComponent(Show, {
|
|
212
|
+
get when() {
|
|
213
|
+
return !props.part.resetSinceReading;
|
|
214
|
+
},
|
|
215
|
+
get fallback() {
|
|
216
|
+
return (() => {
|
|
217
|
+
var _el$15 = _$createElement("text");
|
|
218
|
+
_$insertNode(_el$15, _$createTextNode(`reset since last check`));
|
|
219
|
+
_$setProp(_el$15, "wrapMode", 'none');
|
|
220
|
+
_$effect(_$p => _$setProp(_el$15, "fg", context.theme.textMuted, _$p));
|
|
221
|
+
return _el$15;
|
|
222
|
+
})();
|
|
223
|
+
},
|
|
224
|
+
get children() {
|
|
225
|
+
return [_$createComponent(Show, {
|
|
226
|
+
get when() {
|
|
227
|
+
return props.barCells > 0;
|
|
228
|
+
},
|
|
229
|
+
get children() {
|
|
230
|
+
return _$createComponent(Index, {
|
|
231
|
+
get each() {
|
|
232
|
+
return segments();
|
|
233
|
+
},
|
|
234
|
+
children: segment => (() => {
|
|
235
|
+
var _el$17 = _$createElement("text");
|
|
236
|
+
_$setProp(_el$17, "wrapMode", 'none');
|
|
237
|
+
_$insert(_el$17, () => segment().text);
|
|
238
|
+
_$effect(_p$ => {
|
|
239
|
+
var _v$5 = context.theme[segment().tone],
|
|
240
|
+
_v$6 = segment().text ? undefined : 0;
|
|
241
|
+
_v$5 !== _p$.e && (_p$.e = _$setProp(_el$17, "fg", _v$5, _p$.e));
|
|
242
|
+
_v$6 !== _p$.t && (_p$.t = _$setProp(_el$17, "width", _v$6, _p$.t));
|
|
243
|
+
return _p$;
|
|
244
|
+
}, {
|
|
245
|
+
e: undefined,
|
|
246
|
+
t: undefined
|
|
247
|
+
});
|
|
248
|
+
return _el$17;
|
|
249
|
+
})()
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}), (() => {
|
|
253
|
+
var _el$10 = _$createElement("text");
|
|
254
|
+
_$setProp(_el$10, "wrapMode", 'none');
|
|
255
|
+
_$insert(_el$10, figure);
|
|
256
|
+
_$effect(_$p => _$setProp(_el$10, "fg", context.theme[usageTone(used(), context.appearance)], _$p));
|
|
257
|
+
return _el$10;
|
|
258
|
+
})()];
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}), null);
|
|
206
263
|
_$insert(_el$9, _$createComponent(Show, {
|
|
207
264
|
get when() {
|
|
208
|
-
return showReset();
|
|
265
|
+
return _$memo(() => !!(hasReading() && props.showReset))() && !props.part.resetSinceReading;
|
|
209
266
|
},
|
|
210
267
|
get children() {
|
|
211
|
-
var _el$11 = _$createElement("
|
|
212
|
-
_$setProp(_el$11, "wrapMode", 'none');
|
|
268
|
+
var _el$11 = _$createElement("box");
|
|
213
269
|
_$setProp(_el$11, "flexShrink", 0);
|
|
214
|
-
_$
|
|
215
|
-
_$
|
|
270
|
+
_$setProp(_el$11, "flexDirection", 'row');
|
|
271
|
+
_$setProp(_el$11, "justifyContent", 'flex-end');
|
|
272
|
+
_$insert(_el$11, _$createComponent(Show, {
|
|
273
|
+
get when() {
|
|
274
|
+
return props.part.resetIn;
|
|
275
|
+
},
|
|
276
|
+
get children() {
|
|
277
|
+
var _el$12 = _$createElement("text");
|
|
278
|
+
_$setProp(_el$12, "wrapMode", 'none');
|
|
279
|
+
_$insert(_el$12, () => props.part.resetIn);
|
|
280
|
+
_$effect(_$p => _$setProp(_el$12, "fg", context.theme.textMuted, _$p));
|
|
281
|
+
return _el$12;
|
|
282
|
+
}
|
|
283
|
+
}));
|
|
284
|
+
_$effect(_$p => _$setProp(_el$11, "width", props.resetWidth, _$p));
|
|
216
285
|
return _el$11;
|
|
217
286
|
}
|
|
218
287
|
}), null);
|
|
219
|
-
_$effect(
|
|
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
|
-
});
|
|
288
|
+
_$effect(_$p => _$setProp(_el$0, "flexShrink", props.part.resetSinceReading ? 1 : 0, _$p));
|
|
229
289
|
return _el$9;
|
|
230
290
|
})(), _$createComponent(Show, {
|
|
231
291
|
get when() {
|
|
232
|
-
return paceLine();
|
|
292
|
+
return _$memo(() => !!(hasReading() && !props.part.resetSinceReading))() && paceLine();
|
|
233
293
|
},
|
|
234
294
|
keyed: true,
|
|
235
295
|
children: line => (() => {
|
|
236
|
-
var _el$
|
|
237
|
-
_el$
|
|
238
|
-
|
|
239
|
-
_$
|
|
240
|
-
_$
|
|
241
|
-
_$
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return _el$13;
|
|
296
|
+
var _el$18 = _$createElement("box"),
|
|
297
|
+
_el$20 = _$createElement("text");
|
|
298
|
+
_$insertNode(_el$18, _el$20);
|
|
299
|
+
_$setProp(_el$18, "width", '100%');
|
|
300
|
+
_$setProp(_el$18, "flexDirection", 'row');
|
|
301
|
+
_$insert(_el$18, _$createComponent(Show, {
|
|
302
|
+
get when() {
|
|
303
|
+
return props.labelWidth > 0;
|
|
304
|
+
},
|
|
305
|
+
get children() {
|
|
306
|
+
var _el$19 = _$createElement("text");
|
|
307
|
+
_$insert(_el$19, () => ''.padEnd(props.labelWidth));
|
|
308
|
+
_$effect(_$p => _$setProp(_el$19, "fg", context.theme.textMuted, _$p));
|
|
309
|
+
return _el$19;
|
|
310
|
+
}
|
|
311
|
+
}), _el$20);
|
|
312
|
+
_$setProp(_el$20, "wrapMode", 'none');
|
|
313
|
+
_$insert(_el$20, line);
|
|
314
|
+
_$effect(_$p => _$setProp(_el$20, "fg", context.theme[props.pace?.tone ?? 'textMuted'], _$p));
|
|
315
|
+
return _el$18;
|
|
257
316
|
})()
|
|
258
317
|
})];
|
|
259
318
|
}
|
|
@@ -263,111 +322,161 @@ function CollapsedAccountRow(props) {
|
|
|
263
322
|
let row;
|
|
264
323
|
const hasQuota = () => quotaWindowParts(props.account.quota, {
|
|
265
324
|
now: context.now
|
|
266
|
-
}).windows.
|
|
325
|
+
}).windows.some(part => part.reading === 'known');
|
|
267
326
|
const text = () => hasQuota() ? formatQuota(props.account.quota, {
|
|
268
327
|
now: context.now,
|
|
269
328
|
form: 'narrow'
|
|
270
|
-
}) :
|
|
329
|
+
}) : props.account.emptyQuotaText?.collapsed ?? '\u2014';
|
|
330
|
+
// Reserve an ellipsis, a separator and the trailing indicator before keeping quota.
|
|
331
|
+
const showQuota = () => width() <= 0 || displayWidth(text()) + 4 <= width();
|
|
271
332
|
const label = () => {
|
|
272
333
|
if (width() <= 0) return props.account.label;
|
|
273
|
-
|
|
274
|
-
return fitText(props.account.label, width() - value - 1);
|
|
334
|
+
return fitText(props.account.label, width() - (showQuota() ? displayWidth(text()) + 3 : 2));
|
|
275
335
|
};
|
|
276
336
|
const muted = () => props.account.collapsed?.muted ?? false;
|
|
277
337
|
const quotaTone = () => muted() ? 'textMuted' : props.account.collapsed?.quotaTone ?? 'success';
|
|
278
338
|
return (() => {
|
|
279
|
-
var _el$
|
|
280
|
-
_el$
|
|
281
|
-
|
|
339
|
+
var _el$21 = _$createElement("box"),
|
|
340
|
+
_el$23 = _$createElement("box"),
|
|
341
|
+
_el$26 = _$createElement("text");
|
|
342
|
+
_$insertNode(_el$21, _el$23);
|
|
282
343
|
_$use(element => {
|
|
283
344
|
row = element;
|
|
284
|
-
}, _el$
|
|
285
|
-
_$setProp(_el$
|
|
286
|
-
_$setProp(_el$
|
|
287
|
-
_$setProp(_el$
|
|
288
|
-
_$setProp(_el$
|
|
289
|
-
_$
|
|
290
|
-
_$setProp(_el$17, "flexShrink", 1);
|
|
291
|
-
_$insert(_el$17, label);
|
|
292
|
-
_$insert(_el$16, _$createComponent(Show, {
|
|
345
|
+
}, _el$21);
|
|
346
|
+
_$setProp(_el$21, "onSizeChange", () => setWidth(row?.width ?? 0));
|
|
347
|
+
_$setProp(_el$21, "width", '100%');
|
|
348
|
+
_$setProp(_el$21, "flexDirection", 'row');
|
|
349
|
+
_$setProp(_el$21, "justifyContent", 'space-between');
|
|
350
|
+
_$insert(_el$21, _$createComponent(Show, {
|
|
293
351
|
get when() {
|
|
294
|
-
return
|
|
352
|
+
return label();
|
|
295
353
|
},
|
|
296
|
-
get
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
354
|
+
get children() {
|
|
355
|
+
var _el$22 = _$createElement("text");
|
|
356
|
+
_$setProp(_el$22, "wrapMode", 'none');
|
|
357
|
+
_$setProp(_el$22, "flexShrink", 1);
|
|
358
|
+
_$insert(_el$22, label);
|
|
359
|
+
_$effect(_$p => _$setProp(_el$22, "fg", context.theme[muted() ? 'textMuted' : 'text'], _$p));
|
|
360
|
+
return _el$22;
|
|
361
|
+
}
|
|
362
|
+
}), _el$23);
|
|
363
|
+
_$insertNode(_el$23, _el$26);
|
|
364
|
+
_$setProp(_el$23, "flexDirection", 'row');
|
|
365
|
+
_$setProp(_el$23, "flexShrink", 0);
|
|
366
|
+
_$insert(_el$23, _$createComponent(Show, {
|
|
367
|
+
get when() {
|
|
368
|
+
return showQuota();
|
|
303
369
|
},
|
|
304
370
|
get children() {
|
|
305
|
-
|
|
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, {
|
|
371
|
+
return _$createComponent(Show, {
|
|
311
372
|
get when() {
|
|
312
|
-
return !muted();
|
|
373
|
+
return _$memo(() => !!hasQuota())() && !muted();
|
|
313
374
|
},
|
|
314
375
|
get fallback() {
|
|
315
376
|
return (() => {
|
|
316
|
-
var _el$
|
|
317
|
-
_$insert(_el$
|
|
318
|
-
_$effect(_$p => _$setProp(_el$
|
|
319
|
-
return _el$
|
|
377
|
+
var _el$27 = _$createElement("text");
|
|
378
|
+
_$insert(_el$27, text);
|
|
379
|
+
_$effect(_$p => _$setProp(_el$27, "fg", context.theme.textMuted, _$p));
|
|
380
|
+
return _el$27;
|
|
320
381
|
})();
|
|
321
382
|
},
|
|
322
383
|
get children() {
|
|
323
|
-
var _el$
|
|
324
|
-
_el$
|
|
325
|
-
_$insertNode(_el$
|
|
326
|
-
_$insert(_el$
|
|
327
|
-
_$effect(_$p => _$setProp(_el$
|
|
328
|
-
return _el$
|
|
384
|
+
var _el$24 = _$createElement("text"),
|
|
385
|
+
_el$25 = _$createElement("b");
|
|
386
|
+
_$insertNode(_el$24, _el$25);
|
|
387
|
+
_$insert(_el$25, text);
|
|
388
|
+
_$effect(_$p => _$setProp(_el$24, "fg", context.theme[quotaTone()], _$p));
|
|
389
|
+
return _el$24;
|
|
329
390
|
}
|
|
330
|
-
})
|
|
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;
|
|
391
|
+
});
|
|
334
392
|
}
|
|
335
|
-
}),
|
|
336
|
-
_$
|
|
337
|
-
|
|
393
|
+
}), _el$26);
|
|
394
|
+
_$insert(_el$26, () => showQuota() ? ' ' : '', null);
|
|
395
|
+
_$insert(_el$26, () => props.account.blocked ? '\u2298' : '\u25cf', null);
|
|
396
|
+
_$effect(_p$ => {
|
|
397
|
+
var _v$7 = label() ? 1 : 0,
|
|
398
|
+
_v$8 = context.theme[props.account.indicatorTone];
|
|
399
|
+
_v$7 !== _p$.e && (_p$.e = _$setProp(_el$21, "columnGap", _v$7, _p$.e));
|
|
400
|
+
_v$8 !== _p$.t && (_p$.t = _$setProp(_el$26, "fg", _v$8, _p$.t));
|
|
401
|
+
return _p$;
|
|
402
|
+
}, {
|
|
403
|
+
e: undefined,
|
|
404
|
+
t: undefined
|
|
405
|
+
});
|
|
406
|
+
return _el$21;
|
|
338
407
|
})();
|
|
339
408
|
}
|
|
340
409
|
function AccountBlock(props) {
|
|
341
410
|
const context = frameContext();
|
|
411
|
+
const [columns, setColumns] = createSignal(0);
|
|
412
|
+
let block;
|
|
413
|
+
const rows = () => props.account.groups.flatMap(group => group.rows);
|
|
414
|
+
const labelWidth = () => Math.max(0, ...rows().map(({
|
|
415
|
+
part
|
|
416
|
+
}) => part.name ? Math.max(3, displayWidth(part.name) + 1) : 0));
|
|
417
|
+
const resetWidth = () => Math.max(0, ...rows().map(({
|
|
418
|
+
part
|
|
419
|
+
}) => part.reading === 'unknown' || part.resetSinceReading ? 0 : displayWidth(part.resetIn ?? '')));
|
|
420
|
+
const figureWidth = createMemo(() => Math.max(10, ...rows().filter(({
|
|
421
|
+
part
|
|
422
|
+
}) => part.reading === 'known' && !part.resetSinceReading).map(({
|
|
423
|
+
part
|
|
424
|
+
}) => displayWidth(` ${part.kind === 'budget' && part.figure.startsWith(`${part.name} `) ? part.figure.slice(part.name.length + 1) : part.figure}`))));
|
|
425
|
+
const fit = rowLabelWidth => {
|
|
426
|
+
const desired = context.appearance.barWidth;
|
|
427
|
+
// Four cells still distinguish quarters of a window without sacrificing its reset.
|
|
428
|
+
const minimum = Math.min(4, desired);
|
|
429
|
+
if (columns() <= 0) return {
|
|
430
|
+
barCells: desired,
|
|
431
|
+
showReset: resetWidth() > 0
|
|
432
|
+
};
|
|
433
|
+
const room = columns() - rowLabelWidth - figureWidth();
|
|
434
|
+
const withReset = room - resetWidth() - 1;
|
|
435
|
+
const showReset = resetWidth() > 0 && withReset >= minimum;
|
|
436
|
+
const available = showReset ? withReset : room;
|
|
437
|
+
return {
|
|
438
|
+
barCells: available >= minimum ? Math.min(desired, available) : 0,
|
|
439
|
+
showReset
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
const label = () => {
|
|
443
|
+
const full = `${props.account.label}${props.account.titleSuffix ? ` · ${props.account.titleSuffix}` : ''}`;
|
|
444
|
+
return columns() <= 0 ? full : fitText(full, columns() - displayWidth(props.account.status.text) - 1);
|
|
445
|
+
};
|
|
342
446
|
const age = () => quotaWindowParts(props.account.quota, {
|
|
343
447
|
now: context.now
|
|
344
448
|
}).age;
|
|
345
449
|
const hasRows = () => props.account.groups.some(group => group.rows.length > 0);
|
|
346
450
|
return (() => {
|
|
347
|
-
var _el$
|
|
348
|
-
_el$
|
|
349
|
-
_el$
|
|
350
|
-
_el$
|
|
351
|
-
_el$
|
|
352
|
-
_el$
|
|
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);
|
|
451
|
+
var _el$28 = _$createElement("box"),
|
|
452
|
+
_el$29 = _$createElement("box"),
|
|
453
|
+
_el$30 = _$createElement("text"),
|
|
454
|
+
_el$31 = _$createElement("b"),
|
|
455
|
+
_el$32 = _$createElement("text"),
|
|
456
|
+
_el$33 = _$createElement("b");
|
|
367
457
|
_$insertNode(_el$28, _el$29);
|
|
368
|
-
_$
|
|
369
|
-
|
|
370
|
-
|
|
458
|
+
_$use(element => {
|
|
459
|
+
block = element;
|
|
460
|
+
}, _el$28);
|
|
461
|
+
_$setProp(_el$28, "onSizeChange", () => setColumns(block?.width ?? 0));
|
|
462
|
+
_$setProp(_el$28, "width", '100%');
|
|
463
|
+
_$setProp(_el$28, "flexDirection", 'column');
|
|
464
|
+
_$insertNode(_el$29, _el$30);
|
|
465
|
+
_$insertNode(_el$29, _el$32);
|
|
466
|
+
_$setProp(_el$29, "width", '100%');
|
|
467
|
+
_$setProp(_el$29, "flexDirection", 'row');
|
|
468
|
+
_$setProp(_el$29, "justifyContent", 'space-between');
|
|
469
|
+
_$setProp(_el$29, "columnGap", 1);
|
|
470
|
+
_$insertNode(_el$30, _el$31);
|
|
471
|
+
_$setProp(_el$30, "wrapMode", 'none');
|
|
472
|
+
_$setProp(_el$30, "flexShrink", 1);
|
|
473
|
+
_$insert(_el$31, label);
|
|
474
|
+
_$insertNode(_el$32, _el$33);
|
|
475
|
+
_$setProp(_el$32, "wrapMode", 'none');
|
|
476
|
+
_$setProp(_el$32, "flexShrink", 0);
|
|
477
|
+
_$insert(_el$33, () => props.account.status.text);
|
|
478
|
+
_$insert(_el$28, () => context.beforeQuota?.(props.account), null);
|
|
479
|
+
_$insert(_el$28, _$createComponent(Show, {
|
|
371
480
|
get when() {
|
|
372
481
|
return hasRows();
|
|
373
482
|
},
|
|
@@ -375,7 +484,8 @@ function AccountBlock(props) {
|
|
|
375
484
|
return _$createComponent(SidebarTextRow, {
|
|
376
485
|
get text() {
|
|
377
486
|
return props.account.emptyQuotaText?.expanded ?? '\u2014';
|
|
378
|
-
}
|
|
487
|
+
},
|
|
488
|
+
wrapMode: "none"
|
|
379
489
|
});
|
|
380
490
|
},
|
|
381
491
|
get children() {
|
|
@@ -392,53 +502,68 @@ function AccountBlock(props) {
|
|
|
392
502
|
get text() {
|
|
393
503
|
return group.title ?? '';
|
|
394
504
|
},
|
|
395
|
-
tone: "text"
|
|
505
|
+
tone: "text",
|
|
506
|
+
wrapMode: "none"
|
|
396
507
|
});
|
|
397
508
|
}
|
|
398
509
|
}), _$createComponent(For, {
|
|
399
510
|
get each() {
|
|
400
511
|
return group.rows;
|
|
401
512
|
},
|
|
402
|
-
children: row =>
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
513
|
+
children: row => {
|
|
514
|
+
const rowLabelWidth = () => row.part.name ? labelWidth() : 0;
|
|
515
|
+
const rowFit = createMemo(() => fit(rowLabelWidth()));
|
|
516
|
+
return _$createComponent(QuotaRow, {
|
|
517
|
+
get part() {
|
|
518
|
+
return row.part;
|
|
519
|
+
},
|
|
520
|
+
get pace() {
|
|
521
|
+
return row.pace;
|
|
522
|
+
},
|
|
523
|
+
get labelWidth() {
|
|
524
|
+
return rowLabelWidth();
|
|
525
|
+
},
|
|
526
|
+
get barCells() {
|
|
527
|
+
return rowFit().barCells;
|
|
528
|
+
},
|
|
529
|
+
get resetWidth() {
|
|
530
|
+
return resetWidth();
|
|
531
|
+
},
|
|
532
|
+
get showReset() {
|
|
533
|
+
return rowFit().showReset;
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
}
|
|
413
537
|
})]
|
|
414
538
|
});
|
|
415
539
|
}
|
|
416
540
|
}), null);
|
|
417
|
-
_$insert(_el$
|
|
541
|
+
_$insert(_el$28, _$createComponent(Show, {
|
|
418
542
|
get when() {
|
|
419
543
|
return age();
|
|
420
544
|
},
|
|
421
545
|
children: text => _$createComponent(SidebarTextRow, {
|
|
422
546
|
get text() {
|
|
423
547
|
return text();
|
|
424
|
-
}
|
|
548
|
+
},
|
|
549
|
+
wrapMode: "none"
|
|
425
550
|
})
|
|
426
551
|
}), null);
|
|
427
|
-
_$insert(_el$
|
|
552
|
+
_$insert(_el$28, () => context.afterQuota?.(props.account), null);
|
|
428
553
|
_$effect(_p$ => {
|
|
429
|
-
var _v$
|
|
430
|
-
_v$
|
|
431
|
-
_v$
|
|
432
|
-
_v$
|
|
433
|
-
_v$
|
|
434
|
-
_v$
|
|
554
|
+
var _v$9 = props.marginTop,
|
|
555
|
+
_v$0 = context.theme.text,
|
|
556
|
+
_v$1 = context.theme[props.account.status.tone];
|
|
557
|
+
_v$9 !== _p$.e && (_p$.e = _$setProp(_el$28, "marginTop", _v$9, _p$.e));
|
|
558
|
+
_v$0 !== _p$.t && (_p$.t = _$setProp(_el$30, "fg", _v$0, _p$.t));
|
|
559
|
+
_v$1 !== _p$.a && (_p$.a = _$setProp(_el$32, "fg", _v$1, _p$.a));
|
|
435
560
|
return _p$;
|
|
436
561
|
}, {
|
|
437
562
|
e: undefined,
|
|
438
563
|
t: undefined,
|
|
439
564
|
a: undefined
|
|
440
565
|
});
|
|
441
|
-
return _el$
|
|
566
|
+
return _el$28;
|
|
442
567
|
})();
|
|
443
568
|
}
|
|
444
569
|
|
|
@@ -446,62 +571,73 @@ function AccountBlock(props) {
|
|
|
446
571
|
export function SidebarFrame(props) {
|
|
447
572
|
const hasData = () => props.accounts.length > 0;
|
|
448
573
|
const headerLabel = () => !hasData() ? props.header.badge : `${props.collapsed ? '\u25b6' : '\u25bc'} ${props.header.badge}`;
|
|
449
|
-
|
|
574
|
+
// Missing semantic colors inherit normal text; an unset palette uses terminal defaults.
|
|
575
|
+
const context = mergeProps(props, {
|
|
576
|
+
get theme() {
|
|
577
|
+
const theme = props.theme;
|
|
578
|
+
return {
|
|
579
|
+
...theme,
|
|
580
|
+
textMuted: theme?.textMuted ?? theme?.text,
|
|
581
|
+
accent: theme?.accent ?? theme?.text,
|
|
582
|
+
success: theme?.success ?? theme?.text,
|
|
583
|
+
warning: theme?.warning ?? theme?.text,
|
|
584
|
+
error: theme?.error ?? theme?.text
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
// Inverting an incomplete badge palette can put light text on a light background.
|
|
589
|
+
const invertBadge = () => props.theme?.accent !== undefined && props.theme?.background !== undefined;
|
|
450
590
|
return _$createComponent(FrameContext.Provider, {
|
|
451
|
-
value:
|
|
591
|
+
value: context,
|
|
452
592
|
get children() {
|
|
453
|
-
var _el$
|
|
454
|
-
_el$
|
|
455
|
-
_el$
|
|
456
|
-
_el$
|
|
457
|
-
_el$
|
|
458
|
-
_$insertNode(_el$
|
|
459
|
-
_$setProp(_el$
|
|
460
|
-
_$setProp(_el$
|
|
461
|
-
_$
|
|
462
|
-
_$setProp(_el$
|
|
463
|
-
_$setProp(_el$
|
|
464
|
-
_$setProp(_el$
|
|
465
|
-
_$
|
|
466
|
-
_$setProp(_el$
|
|
467
|
-
_$setProp(_el$31, "flexDirection", 'row');
|
|
468
|
-
_$setProp(_el$31, "justifyContent", 'space-between');
|
|
469
|
-
_$setProp(_el$31, "alignItems", 'center');
|
|
470
|
-
_$setProp(_el$31, "onMouseDown", () => {
|
|
593
|
+
var _el$34 = _$createElement("box"),
|
|
594
|
+
_el$35 = _$createElement("box"),
|
|
595
|
+
_el$36 = _$createElement("box"),
|
|
596
|
+
_el$37 = _$createElement("text"),
|
|
597
|
+
_el$38 = _$createElement("b");
|
|
598
|
+
_$insertNode(_el$34, _el$35);
|
|
599
|
+
_$setProp(_el$34, "width", '100%');
|
|
600
|
+
_$setProp(_el$34, "flexDirection", 'column');
|
|
601
|
+
_$insertNode(_el$35, _el$36);
|
|
602
|
+
_$setProp(_el$35, "width", '100%');
|
|
603
|
+
_$setProp(_el$35, "flexDirection", 'row');
|
|
604
|
+
_$setProp(_el$35, "justifyContent", 'space-between');
|
|
605
|
+
_$setProp(_el$35, "alignItems", 'center');
|
|
606
|
+
_$setProp(_el$35, "onMouseDown", () => {
|
|
471
607
|
if (hasData()) props.onToggle();
|
|
472
608
|
});
|
|
473
|
-
_$insertNode(_el$
|
|
474
|
-
_$setProp(_el$
|
|
475
|
-
_$setProp(_el$
|
|
476
|
-
_$insertNode(_el$
|
|
477
|
-
_$insert(_el$
|
|
478
|
-
_$insert(_el$
|
|
609
|
+
_$insertNode(_el$36, _el$37);
|
|
610
|
+
_$setProp(_el$36, "paddingLeft", 1);
|
|
611
|
+
_$setProp(_el$36, "paddingRight", 1);
|
|
612
|
+
_$insertNode(_el$37, _el$38);
|
|
613
|
+
_$insert(_el$38, headerLabel);
|
|
614
|
+
_$insert(_el$35, _$createComponent(Show, {
|
|
479
615
|
get when() {
|
|
480
616
|
return props.header.version;
|
|
481
617
|
},
|
|
482
618
|
get children() {
|
|
483
|
-
var _el$
|
|
484
|
-
_$insert(_el$
|
|
485
|
-
_$effect(_$p => _$setProp(_el$
|
|
486
|
-
return _el$
|
|
619
|
+
var _el$39 = _$createElement("text");
|
|
620
|
+
_$insert(_el$39, () => props.header.version);
|
|
621
|
+
_$effect(_$p => _$setProp(_el$39, "fg", context.theme.textMuted, _$p));
|
|
622
|
+
return _el$39;
|
|
487
623
|
}
|
|
488
624
|
}), null);
|
|
489
|
-
_$insert(_el$
|
|
625
|
+
_$insert(_el$34, _$createComponent(Show, {
|
|
490
626
|
get when() {
|
|
491
627
|
return _$memo(() => !!props.collapsed)() && hasData();
|
|
492
628
|
},
|
|
493
629
|
get children() {
|
|
494
|
-
return _$createComponent(For, {
|
|
630
|
+
return [_$createComponent(For, {
|
|
495
631
|
get each() {
|
|
496
632
|
return props.accounts;
|
|
497
633
|
},
|
|
498
634
|
children: account => _$createComponent(CollapsedAccountRow, {
|
|
499
635
|
account: account
|
|
500
636
|
})
|
|
501
|
-
});
|
|
637
|
+
}), _$memo(() => props.collapsedSections?.())];
|
|
502
638
|
}
|
|
503
639
|
}), null);
|
|
504
|
-
_$insert(_el$
|
|
640
|
+
_$insert(_el$34, _$createComponent(Show, {
|
|
505
641
|
get when() {
|
|
506
642
|
return !props.collapsed || !hasData();
|
|
507
643
|
},
|
|
@@ -520,9 +656,6 @@ export function SidebarFrame(props) {
|
|
|
520
656
|
},
|
|
521
657
|
children: (account, index) => _$createComponent(AccountBlock, {
|
|
522
658
|
account: account,
|
|
523
|
-
get labelWidth() {
|
|
524
|
-
return labelWidth();
|
|
525
|
-
},
|
|
526
659
|
get marginTop() {
|
|
527
660
|
return index() === 0 ? 0 : 1;
|
|
528
661
|
}
|
|
@@ -535,16 +668,16 @@ export function SidebarFrame(props) {
|
|
|
535
668
|
}
|
|
536
669
|
}), null);
|
|
537
670
|
_$effect(_p$ => {
|
|
538
|
-
var _v$
|
|
539
|
-
_v$
|
|
540
|
-
_v$
|
|
541
|
-
_v$
|
|
671
|
+
var _v$10 = invertBadge() ? props.theme?.accent : undefined,
|
|
672
|
+
_v$11 = invertBadge() ? props.theme?.background : context.theme.accent;
|
|
673
|
+
_v$10 !== _p$.e && (_p$.e = _$setProp(_el$36, "backgroundColor", _v$10, _p$.e));
|
|
674
|
+
_v$11 !== _p$.t && (_p$.t = _$setProp(_el$37, "fg", _v$11, _p$.t));
|
|
542
675
|
return _p$;
|
|
543
676
|
}, {
|
|
544
677
|
e: undefined,
|
|
545
678
|
t: undefined
|
|
546
679
|
});
|
|
547
|
-
return _el$
|
|
680
|
+
return _el$34;
|
|
548
681
|
}
|
|
549
682
|
});
|
|
550
683
|
}
|