@aiwayds/dsh-opentui 0.10.2 → 0.12.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/CHANGELOG.md +18 -0
- package/dist/client/index.js +593 -505
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -51032,9 +51032,10 @@ var init_contracts = __esm(() => {
|
|
|
51032
51032
|
|
|
51033
51033
|
// ../panel-kit/src/fallback.ts
|
|
51034
51034
|
import { RGBA as RGBA13, TextAttributes as TextAttributes10 } from "@opentui/core";
|
|
51035
|
-
var surface, raised, base2, muted, faint, accent, disabled, danger, warning, success, FALLBACK_THEME;
|
|
51035
|
+
var surface, content, raised, base2, muted, faint, accent, disabled, danger, warning, success, code, user, system, heading, FALLBACK_THEME;
|
|
51036
51036
|
var init_fallback = __esm(() => {
|
|
51037
51037
|
surface = RGBA13.fromHex("#1a1b26");
|
|
51038
|
+
content = RGBA13.fromHex("#1f2335");
|
|
51038
51039
|
raised = RGBA13.fromHex("#24283b");
|
|
51039
51040
|
base2 = RGBA13.fromHex("#c0caf5");
|
|
51040
51041
|
muted = RGBA13.fromHex("#a9b1d6");
|
|
@@ -51044,10 +51045,15 @@ var init_fallback = __esm(() => {
|
|
|
51044
51045
|
danger = RGBA13.fromHex("#f7768e");
|
|
51045
51046
|
warning = RGBA13.fromHex("#e0af68");
|
|
51046
51047
|
success = RGBA13.fromHex("#9ece6a");
|
|
51048
|
+
code = RGBA13.fromHex("#c3e88d");
|
|
51049
|
+
user = RGBA13.fromHex("#c0caf5");
|
|
51050
|
+
system = RGBA13.fromHex("#82aaff");
|
|
51051
|
+
heading = RGBA13.fromHex("#c099ff");
|
|
51047
51052
|
FALLBACK_THEME = Object.freeze({
|
|
51048
51053
|
background: {
|
|
51049
51054
|
surface,
|
|
51050
51055
|
raised,
|
|
51056
|
+
content,
|
|
51051
51057
|
scrim: RGBA13.fromInts(0, 0, 0, 150)
|
|
51052
51058
|
},
|
|
51053
51059
|
text: {
|
|
@@ -51058,7 +51064,11 @@ var init_fallback = __esm(() => {
|
|
|
51058
51064
|
disabled,
|
|
51059
51065
|
danger,
|
|
51060
51066
|
warning,
|
|
51061
|
-
success
|
|
51067
|
+
success,
|
|
51068
|
+
code,
|
|
51069
|
+
user,
|
|
51070
|
+
system,
|
|
51071
|
+
heading
|
|
51062
51072
|
},
|
|
51063
51073
|
row: {
|
|
51064
51074
|
activeBg: accent,
|
|
@@ -51243,6 +51253,15 @@ function clampAlpha(value) {
|
|
|
51243
51253
|
return 0;
|
|
51244
51254
|
return Math.max(0, Math.min(255, Math.round(value)));
|
|
51245
51255
|
}
|
|
51256
|
+
function resolvePanelChrome(theme) {
|
|
51257
|
+
const content = theme.background.content ?? theme.background.surface;
|
|
51258
|
+
return {
|
|
51259
|
+
titleBand: fadeColor(content, theme.background.raised, 0.5),
|
|
51260
|
+
navBand: theme.background.raised,
|
|
51261
|
+
content,
|
|
51262
|
+
divider: theme.border.base.color
|
|
51263
|
+
};
|
|
51264
|
+
}
|
|
51246
51265
|
function fadeColor(from, to, t) {
|
|
51247
51266
|
const progress = clamp012(t);
|
|
51248
51267
|
if (progress >= 1)
|
|
@@ -51252,6 +51271,20 @@ function fadeColor(from, to, t) {
|
|
|
51252
51271
|
const mix = (a, b) => a + (b - a) * progress;
|
|
51253
51272
|
return RGBA14.fromValues(mix(from.r, to.r), mix(from.g, to.g), mix(from.b, to.b), to.a);
|
|
51254
51273
|
}
|
|
51274
|
+
function srgbToLinear2(channel) {
|
|
51275
|
+
return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;
|
|
51276
|
+
}
|
|
51277
|
+
function relativeLuminance2(color) {
|
|
51278
|
+
return 0.2126 * srgbToLinear2(color.r) + 0.7152 * srgbToLinear2(color.g) + 0.0722 * srgbToLinear2(color.b);
|
|
51279
|
+
}
|
|
51280
|
+
function contrastRatio2(a, b) {
|
|
51281
|
+
const la = relativeLuminance2(a);
|
|
51282
|
+
const lb = relativeLuminance2(b);
|
|
51283
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
51284
|
+
}
|
|
51285
|
+
function withContrastFloor(fg, bg, fallback) {
|
|
51286
|
+
return contrastRatio2(fg, bg) < MIN_CONTRAST ? fallback : fg;
|
|
51287
|
+
}
|
|
51255
51288
|
function fadeTheme(theme, t) {
|
|
51256
51289
|
const progress = clamp012(t);
|
|
51257
51290
|
if (progress >= 1)
|
|
@@ -51266,6 +51299,7 @@ function fadeTheme(theme, t) {
|
|
|
51266
51299
|
background: {
|
|
51267
51300
|
surface,
|
|
51268
51301
|
raised: mix(theme.background.raised),
|
|
51302
|
+
content: mix(theme.background.content),
|
|
51269
51303
|
scrim: mix(theme.background.scrim)
|
|
51270
51304
|
},
|
|
51271
51305
|
text: {
|
|
@@ -51276,7 +51310,11 @@ function fadeTheme(theme, t) {
|
|
|
51276
51310
|
disabled: mix(theme.text.disabled),
|
|
51277
51311
|
danger: mix(theme.text.danger),
|
|
51278
51312
|
warning: mix(theme.text.warning),
|
|
51279
|
-
success: mix(theme.text.success)
|
|
51313
|
+
success: mix(theme.text.success),
|
|
51314
|
+
code: mix(theme.text.code),
|
|
51315
|
+
user: mix(theme.text.user),
|
|
51316
|
+
system: mix(theme.text.system),
|
|
51317
|
+
heading: mix(theme.text.heading)
|
|
51280
51318
|
},
|
|
51281
51319
|
row: {
|
|
51282
51320
|
activeBg: mix(theme.row.activeBg),
|
|
@@ -51291,7 +51329,7 @@ function fadeTheme(theme, t) {
|
|
|
51291
51329
|
identity: [mix(theme.identity[0]), mix(theme.identity[1])]
|
|
51292
51330
|
};
|
|
51293
51331
|
}
|
|
51294
|
-
var PanelKitContext, PanelKeyRoutingContext, STATIC_MOTION;
|
|
51332
|
+
var PanelKitContext, PanelKeyRoutingContext, STATIC_MOTION, MIN_CONTRAST = 4.5;
|
|
51295
51333
|
var init_theme4 = __esm(() => {
|
|
51296
51334
|
init_server();
|
|
51297
51335
|
init_contracts();
|
|
@@ -51537,6 +51575,11 @@ function resolvePanelHeightLimit(maxHeight, terminalHeight) {
|
|
|
51537
51575
|
const rows = maxHeight ?? terminalHeight - 4;
|
|
51538
51576
|
return Math.max(3, Math.min(Math.floor(rows), terminalHeight - 4));
|
|
51539
51577
|
}
|
|
51578
|
+
function resolvePanelRows(rows, terminalHeight) {
|
|
51579
|
+
if (rows === undefined || !Number.isFinite(rows))
|
|
51580
|
+
return;
|
|
51581
|
+
return resolvePanelHeightLimit(rows, terminalHeight);
|
|
51582
|
+
}
|
|
51540
51583
|
function Panel(props) {
|
|
51541
51584
|
const dimensions = useTerminalDimensions();
|
|
51542
51585
|
const kit = usePanelKit();
|
|
@@ -51545,7 +51588,12 @@ function Panel(props) {
|
|
|
51545
51588
|
const [phase, setPhase] = createSignal(motionDegraded(motion()) ? "open" : "entering");
|
|
51546
51589
|
const frameWidth = () => resolvePanelWidth(props.size, props.width, dimensions().width);
|
|
51547
51590
|
const heightLimit = () => resolvePanelHeightLimit(props.maxHeight, dimensions().height);
|
|
51548
|
-
const frameHeight = () =>
|
|
51591
|
+
const frameHeight = () => {
|
|
51592
|
+
const fixed = resolvePanelRows(props.rows, dimensions().height);
|
|
51593
|
+
if (fixed !== undefined)
|
|
51594
|
+
return fixed;
|
|
51595
|
+
return props.height === undefined ? undefined : Math.min(props.height, heightLimit());
|
|
51596
|
+
};
|
|
51549
51597
|
const innerWidth = () => Math.max(1, frameWidth() - 2);
|
|
51550
51598
|
const inset = () => resolvePanelMetrics(innerWidth(), (frameHeight() ?? heightLimit()) - 2).compact ? 1 : 3;
|
|
51551
51599
|
let notified = false;
|
|
@@ -51661,6 +51709,7 @@ function Panel(props) {
|
|
|
51661
51709
|
if (props.header)
|
|
51662
51710
|
return props.header;
|
|
51663
51711
|
const width = Math.max(1, innerWidth() - inset() * 2);
|
|
51712
|
+
const layered = props.layered === true;
|
|
51664
51713
|
return (() => {
|
|
51665
51714
|
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("text"), _el$4 = createElement("text");
|
|
51666
51715
|
insertNode(_el$, _el$2);
|
|
@@ -51671,6 +51720,8 @@ function Panel(props) {
|
|
|
51671
51720
|
setProp(_el$2, "flexDirection", "row");
|
|
51672
51721
|
setProp(_el$2, "justifyContent", "space-between");
|
|
51673
51722
|
setProp(_el$2, "flexShrink", 0);
|
|
51723
|
+
setProp(_el$2, "border", layered ? ["bottom"] : undefined);
|
|
51724
|
+
setProp(_el$2, "borderStyle", "single");
|
|
51674
51725
|
insert(_el$3, () => truncate2(props.title, Math.max(1, width - 4)));
|
|
51675
51726
|
insertNode(_el$4, createTextNode(`esc`));
|
|
51676
51727
|
insert(_el$, createComponent2(Show, {
|
|
@@ -51694,17 +51745,21 @@ function Panel(props) {
|
|
|
51694
51745
|
}
|
|
51695
51746
|
}), null);
|
|
51696
51747
|
effect((_p$) => {
|
|
51697
|
-
var _v$3 =
|
|
51698
|
-
_v$3 !== _p$.e && (_p$.e = setProp(_el
|
|
51699
|
-
_v$4 !== _p$.t && (_p$.t = setProp(_el$
|
|
51700
|
-
_v$5 !== _p$.a && (_p$.a = setProp(_el$
|
|
51701
|
-
_v$6 !== _p$.o && (_p$.o = setProp(_el$
|
|
51748
|
+
var _v$3 = layered ? resolvePanelChrome(theme()).titleBand : undefined, _v$4 = resolvePanelChrome(theme()).divider, _v$5 = titleTint(), _v$6 = theme().attributes.title, _v$7 = theme().text.muted, _v$8 = theme().attributes.keyHint;
|
|
51749
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$, "backgroundColor", _v$3, _p$.e));
|
|
51750
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$2, "borderColor", _v$4, _p$.t));
|
|
51751
|
+
_v$5 !== _p$.a && (_p$.a = setProp(_el$3, "fg", _v$5, _p$.a));
|
|
51752
|
+
_v$6 !== _p$.o && (_p$.o = setProp(_el$3, "attributes", _v$6, _p$.o));
|
|
51753
|
+
_v$7 !== _p$.i && (_p$.i = setProp(_el$4, "fg", _v$7, _p$.i));
|
|
51754
|
+
_v$8 !== _p$.n && (_p$.n = setProp(_el$4, "attributes", _v$8, _p$.n));
|
|
51702
51755
|
return _p$;
|
|
51703
51756
|
}, {
|
|
51704
51757
|
e: undefined,
|
|
51705
51758
|
t: undefined,
|
|
51706
51759
|
a: undefined,
|
|
51707
|
-
o: undefined
|
|
51760
|
+
o: undefined,
|
|
51761
|
+
i: undefined,
|
|
51762
|
+
n: undefined
|
|
51708
51763
|
});
|
|
51709
51764
|
return _el$;
|
|
51710
51765
|
})();
|
|
@@ -51750,22 +51805,22 @@ function Panel(props) {
|
|
|
51750
51805
|
}
|
|
51751
51806
|
}));
|
|
51752
51807
|
effect((_p$) => {
|
|
51753
|
-
var _v$
|
|
51754
|
-
_v$
|
|
51755
|
-
_v$
|
|
51756
|
-
_v$
|
|
51757
|
-
_v$
|
|
51758
|
-
_v$
|
|
51759
|
-
_v$
|
|
51760
|
-
_v$
|
|
51761
|
-
_v$
|
|
51762
|
-
_v$
|
|
51763
|
-
_v$
|
|
51764
|
-
_v$
|
|
51765
|
-
_v$
|
|
51766
|
-
_v$
|
|
51767
|
-
_v$
|
|
51768
|
-
_v$
|
|
51808
|
+
var _v$9 = dimensions().width, _v$0 = dimensions().height, _v$1 = 3000 + (props.depth ?? 0), _v$10 = props.align === "top" ? undefined : "center", _v$11 = props.align === "top" ? Math.floor(dimensions().height / 4) : 0, _v$12 = props.scrim === false ? undefined : scrimColor(), _v$13 = frameWidth(), _v$14 = frameHeight(), _v$15 = Math.max(1, dimensions().width - 2), _v$16 = heightLimit(), _v$17 = theme().background.surface, _v$18 = frameToken().style, _v$19 = frameToken().color, _v$20 = inset(), _v$21 = inset();
|
|
51809
|
+
_v$9 !== _p$.e && (_p$.e = setProp(_el$7, "width", _v$9, _p$.e));
|
|
51810
|
+
_v$0 !== _p$.t && (_p$.t = setProp(_el$7, "height", _v$0, _p$.t));
|
|
51811
|
+
_v$1 !== _p$.a && (_p$.a = setProp(_el$7, "zIndex", _v$1, _p$.a));
|
|
51812
|
+
_v$10 !== _p$.o && (_p$.o = setProp(_el$7, "justifyContent", _v$10, _p$.o));
|
|
51813
|
+
_v$11 !== _p$.i && (_p$.i = setProp(_el$7, "paddingTop", _v$11, _p$.i));
|
|
51814
|
+
_v$12 !== _p$.n && (_p$.n = setProp(_el$7, "backgroundColor", _v$12, _p$.n));
|
|
51815
|
+
_v$13 !== _p$.s && (_p$.s = setProp(_el$8, "width", _v$13, _p$.s));
|
|
51816
|
+
_v$14 !== _p$.h && (_p$.h = setProp(_el$8, "height", _v$14, _p$.h));
|
|
51817
|
+
_v$15 !== _p$.r && (_p$.r = setProp(_el$8, "maxWidth", _v$15, _p$.r));
|
|
51818
|
+
_v$16 !== _p$.d && (_p$.d = setProp(_el$8, "maxHeight", _v$16, _p$.d));
|
|
51819
|
+
_v$17 !== _p$.l && (_p$.l = setProp(_el$8, "backgroundColor", _v$17, _p$.l));
|
|
51820
|
+
_v$18 !== _p$.u && (_p$.u = setProp(_el$8, "borderStyle", _v$18, _p$.u));
|
|
51821
|
+
_v$19 !== _p$.c && (_p$.c = setProp(_el$8, "borderColor", _v$19, _p$.c));
|
|
51822
|
+
_v$20 !== _p$.w && (_p$.w = setProp(_el$9, "paddingLeft", _v$20, _p$.w));
|
|
51823
|
+
_v$21 !== _p$.m && (_p$.m = setProp(_el$9, "paddingRight", _v$21, _p$.m));
|
|
51769
51824
|
return _p$;
|
|
51770
51825
|
}, {
|
|
51771
51826
|
e: undefined,
|
|
@@ -52144,6 +52199,8 @@ function toneColor(theme, tone, active) {
|
|
|
52144
52199
|
switch (tone) {
|
|
52145
52200
|
case "muted":
|
|
52146
52201
|
return theme.text.muted;
|
|
52202
|
+
case "system":
|
|
52203
|
+
return theme.text.system;
|
|
52147
52204
|
case "warning":
|
|
52148
52205
|
return theme.text.warning;
|
|
52149
52206
|
case "danger":
|
|
@@ -52152,6 +52209,19 @@ function toneColor(theme, tone, active) {
|
|
|
52152
52209
|
return theme.text.base;
|
|
52153
52210
|
}
|
|
52154
52211
|
}
|
|
52212
|
+
function descriptionColor(theme, tone) {
|
|
52213
|
+
switch (tone) {
|
|
52214
|
+
case "code":
|
|
52215
|
+
return theme.text.code;
|
|
52216
|
+
case "system":
|
|
52217
|
+
return theme.text.system;
|
|
52218
|
+
default:
|
|
52219
|
+
return theme.text.muted;
|
|
52220
|
+
}
|
|
52221
|
+
}
|
|
52222
|
+
function badgeColor(theme, tone) {
|
|
52223
|
+
return tone === "user" ? theme.text.user : theme.text.accent;
|
|
52224
|
+
}
|
|
52155
52225
|
function List(props) {
|
|
52156
52226
|
const theme = useControlTheme();
|
|
52157
52227
|
const [state, setState] = createSignal({
|
|
@@ -52350,7 +52420,7 @@ function List(props) {
|
|
|
52350
52420
|
setProp(_el$7, "wrapMode", "none");
|
|
52351
52421
|
insert(_el$7, headers);
|
|
52352
52422
|
effect((_p$) => {
|
|
52353
|
-
var _v$ = theme().attributes.group, _v$2 = theme().text.
|
|
52423
|
+
var _v$ = theme().attributes.group, _v$2 = theme().text.heading;
|
|
52354
52424
|
_v$ !== _p$.e && (_p$.e = setProp(_el$7, "attributes", _v$, _p$.e));
|
|
52355
52425
|
_v$2 !== _p$.t && (_p$.t = setProp(_el$7, "fg", _v$2, _p$.t));
|
|
52356
52426
|
return _p$;
|
|
@@ -52368,7 +52438,7 @@ function List(props) {
|
|
|
52368
52438
|
var _el$1 = createElement("text");
|
|
52369
52439
|
insert(_el$1, () => row.group.label ?? row.group.id);
|
|
52370
52440
|
effect((_p$) => {
|
|
52371
|
-
var _v$3 = theme().attributes.group, _v$4 = theme().text.
|
|
52441
|
+
var _v$3 = theme().attributes.group, _v$4 = theme().text.heading;
|
|
52372
52442
|
_v$3 !== _p$.e && (_p$.e = setProp(_el$1, "attributes", _v$3, _p$.e));
|
|
52373
52443
|
_v$4 !== _p$.t && (_p$.t = setProp(_el$1, "fg", _v$4, _p$.t));
|
|
52374
52444
|
return _p$;
|
|
@@ -52463,7 +52533,7 @@ function ListRowView(props) {
|
|
|
52463
52533
|
var _el$12 = createElement("text"), _el$13 = createTextNode(` `);
|
|
52464
52534
|
insertNode(_el$12, _el$13);
|
|
52465
52535
|
insert(_el$12, () => item.badge, _el$13);
|
|
52466
|
-
effect((_$p) => setProp(_el$12, "fg", active() ? theme().row.activeFg : theme().
|
|
52536
|
+
effect((_$p) => setProp(_el$12, "fg", active() ? theme().row.activeFg : badgeColor(theme(), item.badgeTone), _$p));
|
|
52467
52537
|
return _el$12;
|
|
52468
52538
|
}
|
|
52469
52539
|
}), _el$16);
|
|
@@ -52491,7 +52561,7 @@ function ListRowView(props) {
|
|
|
52491
52561
|
get children() {
|
|
52492
52562
|
var _el$15 = createElement("text");
|
|
52493
52563
|
insert(_el$15, () => " " + item.description);
|
|
52494
|
-
effect((_$p) => setProp(_el$15, "fg", disabled ? theme().text.disabled : active() ? theme().row.activeFg : theme().
|
|
52564
|
+
effect((_$p) => setProp(_el$15, "fg", disabled ? theme().text.disabled : active() ? theme().row.activeFg : descriptionColor(theme(), item.descriptionTone), _$p));
|
|
52495
52565
|
return _el$15;
|
|
52496
52566
|
}
|
|
52497
52567
|
}), _el$16);
|
|
@@ -52733,7 +52803,7 @@ function PanelActions(props) {
|
|
|
52733
52803
|
setProp(_el$12, "wrapMode", "none");
|
|
52734
52804
|
insert(_el$12, () => props.hint);
|
|
52735
52805
|
effect((_p$) => {
|
|
52736
|
-
var _v$12 = theme().text.
|
|
52806
|
+
var _v$12 = theme().text.system, _v$13 = theme().attributes.keyHint;
|
|
52737
52807
|
_v$12 !== _p$.e && (_p$.e = setProp(_el$12, "fg", _v$12, _p$.e));
|
|
52738
52808
|
_v$13 !== _p$.t && (_p$.t = setProp(_el$12, "attributes", _v$13, _p$.t));
|
|
52739
52809
|
return _p$;
|
|
@@ -52789,6 +52859,7 @@ function createConfirmModel(props) {
|
|
|
52789
52859
|
return true;
|
|
52790
52860
|
switch (id) {
|
|
52791
52861
|
case "enter":
|
|
52862
|
+
case "space":
|
|
52792
52863
|
choose(active());
|
|
52793
52864
|
return true;
|
|
52794
52865
|
case "escape":
|
|
@@ -52796,6 +52867,8 @@ function createConfirmModel(props) {
|
|
|
52796
52867
|
return true;
|
|
52797
52868
|
case "left":
|
|
52798
52869
|
case "right":
|
|
52870
|
+
case "tab":
|
|
52871
|
+
case "shift+tab":
|
|
52799
52872
|
setActive((current) => current === "confirm" ? "cancel" : "confirm");
|
|
52800
52873
|
return true;
|
|
52801
52874
|
default:
|
|
@@ -52806,7 +52879,7 @@ function createConfirmModel(props) {
|
|
|
52806
52879
|
cancel: {
|
|
52807
52880
|
label: props.cancelLabel ?? "Cancel",
|
|
52808
52881
|
variant: "ghost",
|
|
52809
|
-
keyHint: "esc",
|
|
52882
|
+
keyHint: active() === "cancel" && !settled() ? "esc / enter" : "esc",
|
|
52810
52883
|
disabled: settled(),
|
|
52811
52884
|
focused: active() === "cancel" && !settled(),
|
|
52812
52885
|
onPress: () => choose("cancel")
|
|
@@ -52814,7 +52887,7 @@ function createConfirmModel(props) {
|
|
|
52814
52887
|
confirm: {
|
|
52815
52888
|
label: props.confirmLabel ?? "Confirm",
|
|
52816
52889
|
variant: props.destructive || props.tone === "danger" ? "danger" : "primary",
|
|
52817
|
-
keyHint: "enter",
|
|
52890
|
+
keyHint: active() === "confirm" && !settled() ? "enter" : "",
|
|
52818
52891
|
disabled: settled(),
|
|
52819
52892
|
focused: active() === "confirm" && !settled(),
|
|
52820
52893
|
onPress: () => choose("confirm")
|
|
@@ -52834,15 +52907,26 @@ function ConfirmDialog(props) {
|
|
|
52834
52907
|
const registerKeys = useControlKeys();
|
|
52835
52908
|
const commands = () => ({
|
|
52836
52909
|
enter: () => model.command("enter"),
|
|
52910
|
+
space: () => model.command("space"),
|
|
52837
52911
|
escape: () => model.command("escape"),
|
|
52838
52912
|
left: () => model.command("left"),
|
|
52839
|
-
right: () => model.command("right")
|
|
52913
|
+
right: () => model.command("right"),
|
|
52914
|
+
tab: () => model.command("tab"),
|
|
52915
|
+
"shift+tab": () => model.command("shift+tab")
|
|
52840
52916
|
});
|
|
52841
52917
|
onMount(() => {
|
|
52842
52918
|
const dispose = registerKeys(commands());
|
|
52843
52919
|
if (typeof dispose === "function")
|
|
52844
52920
|
onCleanup(dispose);
|
|
52845
52921
|
});
|
|
52922
|
+
useKeyboard((key) => {
|
|
52923
|
+
if (key.name !== "tab")
|
|
52924
|
+
return;
|
|
52925
|
+
if (model.command(key.shift ? "shift+tab" : "tab")) {
|
|
52926
|
+
key.preventDefault();
|
|
52927
|
+
key.stopPropagation();
|
|
52928
|
+
}
|
|
52929
|
+
});
|
|
52846
52930
|
const cancel = () => model.buttons().cancel;
|
|
52847
52931
|
const confirm = () => model.buttons().confirm;
|
|
52848
52932
|
const messageTone = () => {
|
|
@@ -52854,65 +52938,87 @@ function ConfirmDialog(props) {
|
|
|
52854
52938
|
return tokens.text.warning;
|
|
52855
52939
|
};
|
|
52856
52940
|
return (() => {
|
|
52857
|
-
var _el$ = createElement("box"), _el$2 = createElement("box");
|
|
52941
|
+
var _el$ = createElement("box"), _el$2 = createElement("box"), _el$3 = createElement("box"), _el$4 = createElement("text");
|
|
52858
52942
|
insertNode(_el$, _el$2);
|
|
52943
|
+
insertNode(_el$, _el$3);
|
|
52859
52944
|
setProp(_el$, "flexDirection", "column");
|
|
52860
|
-
setProp(_el$, "gap", 1);
|
|
52861
52945
|
insert(_el$, (() => {
|
|
52862
52946
|
var _c$ = memo2(() => typeof props.message === "string");
|
|
52863
52947
|
return () => _c$() ? (() => {
|
|
52864
|
-
var _el$
|
|
52865
|
-
setProp(_el$
|
|
52866
|
-
insert(_el$
|
|
52867
|
-
effect((_$p) => setProp(_el$
|
|
52868
|
-
return _el$
|
|
52948
|
+
var _el$6 = createElement("text");
|
|
52949
|
+
setProp(_el$6, "wrapMode", "word");
|
|
52950
|
+
insert(_el$6, () => props.message);
|
|
52951
|
+
effect((_$p) => setProp(_el$6, "fg", messageTone(), _$p));
|
|
52952
|
+
return _el$6;
|
|
52869
52953
|
})() : props.message;
|
|
52870
52954
|
})(), _el$2);
|
|
52871
52955
|
setProp(_el$2, "flexDirection", "row");
|
|
52872
52956
|
setProp(_el$2, "justifyContent", "flex-end");
|
|
52873
52957
|
setProp(_el$2, "gap", 2);
|
|
52958
|
+
setProp(_el$2, "flexShrink", 0);
|
|
52874
52959
|
setProp(_el$2, "marginTop", 1);
|
|
52875
|
-
insert(_el$2, createComponent2(
|
|
52876
|
-
|
|
52877
|
-
|
|
52878
|
-
|
|
52879
|
-
|
|
52880
|
-
|
|
52881
|
-
|
|
52882
|
-
get keyHint() {
|
|
52883
|
-
return cancel().keyHint;
|
|
52884
|
-
},
|
|
52885
|
-
get disabled() {
|
|
52886
|
-
return cancel().disabled;
|
|
52887
|
-
},
|
|
52888
|
-
get focused() {
|
|
52889
|
-
return cancel().focused;
|
|
52890
|
-
},
|
|
52891
|
-
get onPress() {
|
|
52892
|
-
return cancel().onPress;
|
|
52893
|
-
}
|
|
52960
|
+
insert(_el$2, createComponent2(ConfirmButton, {
|
|
52961
|
+
state: cancel,
|
|
52962
|
+
theme
|
|
52963
|
+
}), null);
|
|
52964
|
+
insert(_el$2, createComponent2(ConfirmButton, {
|
|
52965
|
+
state: confirm,
|
|
52966
|
+
theme
|
|
52894
52967
|
}), null);
|
|
52895
|
-
|
|
52968
|
+
insertNode(_el$3, _el$4);
|
|
52969
|
+
setProp(_el$3, "flexDirection", "row");
|
|
52970
|
+
setProp(_el$3, "justifyContent", "flex-end");
|
|
52971
|
+
setProp(_el$3, "flexShrink", 0);
|
|
52972
|
+
insertNode(_el$4, createTextNode(`\u2190\u2192 \u9009\u62E9 \xB7 Enter \u786E\u8BA4 \xB7 Esc \u53D6\u6D88`));
|
|
52973
|
+
setProp(_el$4, "wrapMode", "none");
|
|
52974
|
+
effect((_p$) => {
|
|
52975
|
+
var _v$ = theme().text.muted, _v$2 = theme().attributes.keyHint;
|
|
52976
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$4, "fg", _v$, _p$.e));
|
|
52977
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$4, "attributes", _v$2, _p$.t));
|
|
52978
|
+
return _p$;
|
|
52979
|
+
}, {
|
|
52980
|
+
e: undefined,
|
|
52981
|
+
t: undefined
|
|
52982
|
+
});
|
|
52983
|
+
return _el$;
|
|
52984
|
+
})();
|
|
52985
|
+
}
|
|
52986
|
+
function ConfirmButton(props) {
|
|
52987
|
+
const token = () => props.state().focused ? props.theme().border.focused : props.theme().border.base;
|
|
52988
|
+
return (() => {
|
|
52989
|
+
var _el$7 = createElement("box");
|
|
52990
|
+
setProp(_el$7, "flexShrink", 0);
|
|
52991
|
+
setProp(_el$7, "border", ["left", "right"]);
|
|
52992
|
+
insert(_el$7, createComponent2(Button, {
|
|
52896
52993
|
get label() {
|
|
52897
|
-
return
|
|
52994
|
+
return props.state().label;
|
|
52898
52995
|
},
|
|
52899
52996
|
get variant() {
|
|
52900
|
-
return
|
|
52997
|
+
return props.state().variant;
|
|
52901
52998
|
},
|
|
52902
52999
|
get keyHint() {
|
|
52903
|
-
return
|
|
53000
|
+
return props.state().keyHint;
|
|
52904
53001
|
},
|
|
52905
53002
|
get disabled() {
|
|
52906
|
-
return
|
|
53003
|
+
return props.state().disabled;
|
|
52907
53004
|
},
|
|
52908
53005
|
get focused() {
|
|
52909
|
-
return
|
|
53006
|
+
return props.state().focused;
|
|
52910
53007
|
},
|
|
52911
53008
|
get onPress() {
|
|
52912
|
-
return
|
|
53009
|
+
return props.state().onPress;
|
|
52913
53010
|
}
|
|
52914
|
-
})
|
|
52915
|
-
|
|
53011
|
+
}));
|
|
53012
|
+
effect((_p$) => {
|
|
53013
|
+
var _v$3 = token().style, _v$4 = token().color;
|
|
53014
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$7, "borderStyle", _v$3, _p$.e));
|
|
53015
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$7, "borderColor", _v$4, _p$.t));
|
|
53016
|
+
return _p$;
|
|
53017
|
+
}, {
|
|
53018
|
+
e: undefined,
|
|
53019
|
+
t: undefined
|
|
53020
|
+
});
|
|
53021
|
+
return _el$7;
|
|
52916
53022
|
})();
|
|
52917
53023
|
}
|
|
52918
53024
|
var init_confirm = __esm(() => {
|
|
@@ -52923,6 +53029,8 @@ var init_confirm = __esm(() => {
|
|
|
52923
53029
|
init_index_bun();
|
|
52924
53030
|
init_index_bun();
|
|
52925
53031
|
init_index_bun();
|
|
53032
|
+
init_index_bun();
|
|
53033
|
+
init_index_bun();
|
|
52926
53034
|
init_server();
|
|
52927
53035
|
init_theme4();
|
|
52928
53036
|
init_button();
|
|
@@ -55338,7 +55446,7 @@ var init_agents_panel = __esm(() => {
|
|
|
55338
55446
|
import { TextAttributes as TextAttributes11 } from "@opentui/core";
|
|
55339
55447
|
function resolveVersion() {
|
|
55340
55448
|
try {
|
|
55341
|
-
return "0.
|
|
55449
|
+
return "0.12.0";
|
|
55342
55450
|
} catch {
|
|
55343
55451
|
return "dev";
|
|
55344
55452
|
}
|
|
@@ -55533,209 +55641,100 @@ function buildSectionRows(id, ctx) {
|
|
|
55533
55641
|
return buildCommandRows(id);
|
|
55534
55642
|
}
|
|
55535
55643
|
}
|
|
55536
|
-
function draftKey(row) {
|
|
55537
|
-
const write = row.write;
|
|
55538
|
-
if (write === undefined)
|
|
55539
|
-
return row.id;
|
|
55540
|
-
if (write.via === "settings")
|
|
55541
|
-
return `settings:${write.ns}.${write.path.join(".")}`;
|
|
55542
|
-
if (write.key === "footerHints") {
|
|
55543
|
-
const segment = row.id.startsWith("footerHints.") ? row.id.slice("footerHints.".length) : row.id;
|
|
55544
|
-
return `footerHints.${segment}`;
|
|
55545
|
-
}
|
|
55546
|
-
return `config:${write.key}`;
|
|
55547
|
-
}
|
|
55548
55644
|
function settingsBackView(view) {
|
|
55549
55645
|
return view === "editor" ? "browse" : "close";
|
|
55550
55646
|
}
|
|
55551
|
-
function
|
|
55552
|
-
|
|
55553
|
-
|
|
55554
|
-
|
|
55555
|
-
|
|
55556
|
-
|
|
55557
|
-
if (sameAsSnapshot) {
|
|
55558
|
-
delete next[key];
|
|
55559
|
-
return next;
|
|
55647
|
+
async function writeSetting(row, value, deps) {
|
|
55648
|
+
if (row.detail !== undefined) {
|
|
55649
|
+
return {
|
|
55650
|
+
ok: false,
|
|
55651
|
+
error: `\u2718 ${row.label} \u4E0D\u53EF\u7F16\u8F91`
|
|
55652
|
+
};
|
|
55560
55653
|
}
|
|
55561
|
-
|
|
55562
|
-
|
|
55563
|
-
|
|
55564
|
-
|
|
55565
|
-
|
|
55566
|
-
|
|
55567
|
-
|
|
55568
|
-
|
|
55569
|
-
return draft ? "on" : "off";
|
|
55570
|
-
return String(draft);
|
|
55571
|
-
}
|
|
55572
|
-
function isDirty(drafts) {
|
|
55573
|
-
return Object.keys(drafts).length > 0;
|
|
55574
|
-
}
|
|
55575
|
-
async function commitSettingsDrafts(deps) {
|
|
55576
|
-
const saved = [];
|
|
55577
|
-
const attempted = [];
|
|
55578
|
-
const written = new Set;
|
|
55579
|
-
let document = deps.document;
|
|
55580
|
-
let refreshFailed = false;
|
|
55581
|
-
let liveMerged = deps.merged;
|
|
55582
|
-
for (const row of deps.rows) {
|
|
55583
|
-
const key = draftKey(row);
|
|
55584
|
-
if (written.has(key))
|
|
55585
|
-
continue;
|
|
55586
|
-
const value = deps.drafts[key];
|
|
55587
|
-
if (value === undefined)
|
|
55588
|
-
continue;
|
|
55589
|
-
written.add(key);
|
|
55590
|
-
attempted.push(key);
|
|
55591
|
-
if (row.detail !== undefined) {
|
|
55592
|
-
for (const child of row.detail) {
|
|
55593
|
-
if (deps.drafts[draftKey(child)] !== undefined) {
|
|
55594
|
-
return {
|
|
55595
|
-
ok: false,
|
|
55596
|
-
saved,
|
|
55597
|
-
attempted,
|
|
55598
|
-
error: `\u2718 ${child.label} \u4E0D\u53EF\u7F16\u8F91`,
|
|
55599
|
-
...document !== undefined ? {
|
|
55600
|
-
document
|
|
55601
|
-
} : {}
|
|
55602
|
-
};
|
|
55603
|
-
}
|
|
55604
|
-
}
|
|
55605
|
-
}
|
|
55606
|
-
if (!row.editable || row.write === undefined) {
|
|
55607
|
-
return {
|
|
55608
|
-
ok: false,
|
|
55609
|
-
saved,
|
|
55610
|
-
attempted,
|
|
55611
|
-
error: `\u2718 ${row.label} \u4E0D\u53EF\u7F16\u8F91`,
|
|
55612
|
-
...document !== undefined ? {
|
|
55613
|
-
document
|
|
55614
|
-
} : {}
|
|
55615
|
-
};
|
|
55616
|
-
}
|
|
55617
|
-
if (row.write.via === "config") {
|
|
55618
|
-
if (!deps.local) {
|
|
55619
|
-
return {
|
|
55620
|
-
ok: false,
|
|
55621
|
-
saved,
|
|
55622
|
-
attempted,
|
|
55623
|
-
error: "\u2718 \u672C\u5730\u504F\u597D\u5F53\u524D\u4E0D\u53EF\u5199",
|
|
55624
|
-
...document !== undefined ? {
|
|
55625
|
-
document
|
|
55626
|
-
} : {}
|
|
55627
|
-
};
|
|
55628
|
-
}
|
|
55629
|
-
const hints = footerHintsFromConfig(liveMerged.footerHints) ?? DEFAULT_FOOTER_HINTS;
|
|
55630
|
-
const plan = planLocalWrite(row, value, hints);
|
|
55631
|
-
if (!plan.ok) {
|
|
55632
|
-
return {
|
|
55633
|
-
ok: false,
|
|
55634
|
-
saved,
|
|
55635
|
-
attempted,
|
|
55636
|
-
error: `\u2718 ${plan.error}`,
|
|
55637
|
-
...document !== undefined ? {
|
|
55638
|
-
document
|
|
55639
|
-
} : {}
|
|
55640
|
-
};
|
|
55641
|
-
}
|
|
55642
|
-
try {
|
|
55643
|
-
deps.seam.configSave?.(plan.patch);
|
|
55644
|
-
} catch (error) {
|
|
55645
|
-
return {
|
|
55646
|
-
ok: false,
|
|
55647
|
-
saved,
|
|
55648
|
-
attempted,
|
|
55649
|
-
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`,
|
|
55650
|
-
...document !== undefined ? {
|
|
55651
|
-
document
|
|
55652
|
-
} : {}
|
|
55653
|
-
};
|
|
55654
|
-
}
|
|
55655
|
-
liveMerged = {
|
|
55656
|
-
...liveMerged,
|
|
55657
|
-
...plan.patch
|
|
55658
|
-
};
|
|
55659
|
-
applySettingsLive(row, plan.applied, hints, deps.themes);
|
|
55660
|
-
saved.push(row.label);
|
|
55661
|
-
continue;
|
|
55662
|
-
}
|
|
55663
|
-
if (!deps.host) {
|
|
55654
|
+
if (!row.editable || row.write === undefined) {
|
|
55655
|
+
return {
|
|
55656
|
+
ok: false,
|
|
55657
|
+
error: `\u2718 ${row.label} \u4E0D\u53EF\u7F16\u8F91`
|
|
55658
|
+
};
|
|
55659
|
+
}
|
|
55660
|
+
if (row.write.via === "config") {
|
|
55661
|
+
if (!deps.local)
|
|
55664
55662
|
return {
|
|
55665
55663
|
ok: false,
|
|
55666
|
-
|
|
55667
|
-
attempted,
|
|
55668
|
-
error: "\u2718 \u5BBF\u4E3B\u8BBE\u7F6E\u5F53\u524D\u4E0D\u53EF\u5199",
|
|
55669
|
-
...document !== undefined ? {
|
|
55670
|
-
document
|
|
55671
|
-
} : {}
|
|
55664
|
+
error: "\u2718 \u672C\u5730\u504F\u597D\u5F53\u524D\u4E0D\u53EF\u5199"
|
|
55672
55665
|
};
|
|
55673
|
-
|
|
55674
|
-
const plan =
|
|
55675
|
-
if (!plan.ok)
|
|
55666
|
+
const hints = footerHintsFromConfig(deps.merged.footerHints) ?? DEFAULT_FOOTER_HINTS;
|
|
55667
|
+
const plan = planLocalWrite(row, value, hints);
|
|
55668
|
+
if (!plan.ok)
|
|
55676
55669
|
return {
|
|
55677
55670
|
ok: false,
|
|
55678
|
-
|
|
55679
|
-
attempted,
|
|
55680
|
-
error: `\u2718 ${plan.error}`,
|
|
55681
|
-
...document !== undefined ? {
|
|
55682
|
-
document
|
|
55683
|
-
} : {}
|
|
55671
|
+
error: `\u2718 ${plan.error}`
|
|
55684
55672
|
};
|
|
55685
|
-
|
|
55686
|
-
|
|
55687
|
-
|
|
55673
|
+
try {
|
|
55674
|
+
deps.seam.configSave?.(plan.patch);
|
|
55675
|
+
} catch (error) {
|
|
55688
55676
|
return {
|
|
55689
55677
|
ok: false,
|
|
55690
|
-
|
|
55691
|
-
attempted,
|
|
55692
|
-
error: "\u2718 \u5BBF\u4E3B settings \u63A5\u53E3\u4E0D\u53EF\u7528",
|
|
55693
|
-
...document !== undefined ? {
|
|
55694
|
-
document
|
|
55695
|
-
} : {}
|
|
55678
|
+
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`
|
|
55696
55679
|
};
|
|
55697
55680
|
}
|
|
55698
|
-
|
|
55699
|
-
|
|
55700
|
-
|
|
55701
|
-
|
|
55702
|
-
|
|
55703
|
-
|
|
55704
|
-
|
|
55705
|
-
|
|
55706
|
-
|
|
55707
|
-
|
|
55708
|
-
|
|
55709
|
-
|
|
55710
|
-
|
|
55711
|
-
|
|
55712
|
-
|
|
55713
|
-
|
|
55714
|
-
|
|
55715
|
-
|
|
55716
|
-
|
|
55717
|
-
|
|
55718
|
-
|
|
55719
|
-
|
|
55720
|
-
|
|
55721
|
-
|
|
55722
|
-
|
|
55723
|
-
|
|
55681
|
+
applySettingsLive(row, plan.applied, hints, deps.themes);
|
|
55682
|
+
return {
|
|
55683
|
+
ok: true,
|
|
55684
|
+
label: row.label,
|
|
55685
|
+
patch: plan.patch
|
|
55686
|
+
};
|
|
55687
|
+
}
|
|
55688
|
+
if (!deps.host)
|
|
55689
|
+
return {
|
|
55690
|
+
ok: false,
|
|
55691
|
+
error: "\u2718 \u5BBF\u4E3B\u8BBE\u7F6E\u5F53\u524D\u4E0D\u53EF\u5199"
|
|
55692
|
+
};
|
|
55693
|
+
const plan = planHostWrite(row, value);
|
|
55694
|
+
if (!plan.ok)
|
|
55695
|
+
return {
|
|
55696
|
+
ok: false,
|
|
55697
|
+
error: `\u2718 ${plan.error}`
|
|
55698
|
+
};
|
|
55699
|
+
const face = deps.seam.settings;
|
|
55700
|
+
if (face === undefined)
|
|
55701
|
+
return {
|
|
55702
|
+
ok: false,
|
|
55703
|
+
error: "\u2718 \u5BBF\u4E3B settings \u63A5\u53E3\u4E0D\u53EF\u7528"
|
|
55704
|
+
};
|
|
55705
|
+
let document = deps.document;
|
|
55706
|
+
let refreshFailed = false;
|
|
55707
|
+
try {
|
|
55708
|
+
const outcome = await commitHostWrite({
|
|
55709
|
+
mutate: (ns, ops, revision) => face.mutate(ns, ops, revision),
|
|
55710
|
+
describe: () => face.describe(),
|
|
55711
|
+
ns: plan.ns,
|
|
55712
|
+
ops: plan.ops,
|
|
55713
|
+
revision: currentHostRevision(document, plan.ns)
|
|
55714
|
+
});
|
|
55715
|
+
if (outcome.document !== undefined)
|
|
55716
|
+
document = outcome.document;
|
|
55717
|
+
if (!outcome.result.ok) {
|
|
55718
|
+
const message = outcome.result.conflict ? outcome.attempts === 1 ? "\u2718 \u51B2\u7A81\uFF1A\u8BBE\u7F6E\u5DF2\u88AB\u5176\u5B83\u5BA2\u6237\u7AEF\u4FEE\u6539\uFF0C\u4E14 settings/describe \u5931\u8D25 \u2014 \u6CA1\u6709\u6700\u65B0 revision\uFF0C\u672A\u91CD\u8BD5\u5199\u5165" : "\u2718 \u51B2\u7A81\uFF1A\u8BBE\u7F6E\u5DF2\u88AB\u5176\u5B83\u5BA2\u6237\u7AEF\u4FEE\u6539\uFF0C\u91CD\u8BD5\u4E00\u6B21\u4ECD\u51B2\u7A81\uFF08\u672A\u5199\u5165\uFF09" : `\u2718 ${outcome.result.error}`;
|
|
55724
55719
|
return {
|
|
55725
55720
|
ok: false,
|
|
55726
|
-
|
|
55727
|
-
attempted,
|
|
55728
|
-
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`,
|
|
55721
|
+
error: message,
|
|
55729
55722
|
...document !== undefined ? {
|
|
55730
55723
|
document
|
|
55731
55724
|
} : {}
|
|
55732
55725
|
};
|
|
55733
55726
|
}
|
|
55727
|
+
if (outcome.refreshFailed === true)
|
|
55728
|
+
refreshFailed = true;
|
|
55729
|
+
} catch (error) {
|
|
55730
|
+
return {
|
|
55731
|
+
ok: false,
|
|
55732
|
+
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`
|
|
55733
|
+
};
|
|
55734
55734
|
}
|
|
55735
55735
|
return {
|
|
55736
55736
|
ok: true,
|
|
55737
|
-
|
|
55738
|
-
attempted,
|
|
55737
|
+
label: row.label,
|
|
55739
55738
|
...document !== undefined ? {
|
|
55740
55739
|
document
|
|
55741
55740
|
} : {},
|
|
@@ -55744,24 +55743,33 @@ async function commitSettingsDrafts(deps) {
|
|
|
55744
55743
|
} : {}
|
|
55745
55744
|
};
|
|
55746
55745
|
}
|
|
55746
|
+
function settingsPanelRows(terminalRows) {
|
|
55747
|
+
const rows = Number.isFinite(terminalRows) ? Math.floor(terminalRows) : 24;
|
|
55748
|
+
const upper = Math.max(3, rows - 4);
|
|
55749
|
+
const target = Math.round(rows * SETTINGS_PANEL_RATIO);
|
|
55750
|
+
return Math.max(Math.min(SETTINGS_PANEL_MIN_ROWS, upper), Math.min(target, upper));
|
|
55751
|
+
}
|
|
55747
55752
|
function settingsRowWidth(terminalWidth, terminalHeight) {
|
|
55748
55753
|
const frame = resolvePanelWidth("xlarge", undefined, terminalWidth);
|
|
55749
|
-
const
|
|
55754
|
+
const frameRows = settingsPanelRows(terminalHeight);
|
|
55755
|
+
const inset = resolvePanelMetrics(frame - 2, Math.max(3, frameRows - 2)).compact ? 1 : 3;
|
|
55750
55756
|
return Math.max(16, frame - 2 - inset * 2 - 2 - NAV_WIDTH - 2);
|
|
55751
55757
|
}
|
|
55752
|
-
function bodyPageSize(
|
|
55753
|
-
const rows = Number.isFinite(
|
|
55754
|
-
return Math.max(MIN_BODY_PAGE, Math.min(MAX_BODY_PAGE, rows -
|
|
55758
|
+
function bodyPageSize(panelRows) {
|
|
55759
|
+
const rows = Number.isFinite(panelRows) ? Math.floor(panelRows) : 24;
|
|
55760
|
+
return Math.max(MIN_BODY_PAGE, Math.min(MAX_BODY_PAGE, rows - SETTINGS_FIXED_CHROME_ROWS));
|
|
55755
55761
|
}
|
|
55756
|
-
function rowListItems(rows
|
|
55762
|
+
function rowListItems(rows) {
|
|
55757
55763
|
return rows.map((row) => ({
|
|
55758
55764
|
id: row.id,
|
|
55759
55765
|
label: row.label,
|
|
55760
|
-
description:
|
|
55766
|
+
description: row.value,
|
|
55767
|
+
descriptionTone: "code",
|
|
55761
55768
|
...row.editable ? {
|
|
55762
|
-
badge: "\u270E"
|
|
55769
|
+
badge: "\u270E",
|
|
55770
|
+
badgeTone: "user"
|
|
55763
55771
|
} : {
|
|
55764
|
-
tone: "
|
|
55772
|
+
tone: "system"
|
|
55765
55773
|
},
|
|
55766
55774
|
...row.kind === "jump" ? {
|
|
55767
55775
|
badge: "\u203A"
|
|
@@ -55770,6 +55778,10 @@ function rowListItems(rows, drafts) {
|
|
|
55770
55778
|
}
|
|
55771
55779
|
function SettingsModalBody(props) {
|
|
55772
55780
|
const themeFace = () => props.themes;
|
|
55781
|
+
const theme = usePanelTheme();
|
|
55782
|
+
const chrome = () => resolvePanelChrome(theme());
|
|
55783
|
+
const contentBg = () => theme().background.content;
|
|
55784
|
+
const role = (fg) => withContrastFloor(fg, contentBg(), theme().text.base);
|
|
55773
55785
|
const [view, setView] = createSignal("browse");
|
|
55774
55786
|
const [pane, setPane] = createSignal("nav");
|
|
55775
55787
|
const [sectionIndex, setSectionIndex] = createSignal(0);
|
|
@@ -55777,7 +55789,6 @@ function SettingsModalBody(props) {
|
|
|
55777
55789
|
const [editorRow, setEditorRow] = createSignal(undefined);
|
|
55778
55790
|
const [editorValue, setEditorValue] = createSignal("");
|
|
55779
55791
|
const [optionCursor, setOptionCursor] = createSignal(0);
|
|
55780
|
-
const [drafts, setDrafts] = createSignal({});
|
|
55781
55792
|
const [merged, setMerged] = createSignal({});
|
|
55782
55793
|
const [profile, setProfile] = createSignal({});
|
|
55783
55794
|
const [workspace, setWorkspace] = createSignal({});
|
|
@@ -55816,9 +55827,25 @@ function SettingsModalBody(props) {
|
|
|
55816
55827
|
const currentSection = createMemo(() => sections()[sectionIndex()] ?? sections()[0]);
|
|
55817
55828
|
const currentRows = createMemo(() => currentSection().rows);
|
|
55818
55829
|
const currentRow = createMemo(() => currentRows()[rowIndex()]);
|
|
55819
|
-
const
|
|
55830
|
+
const savedLabels = [];
|
|
55831
|
+
let statusTimer;
|
|
55832
|
+
function flashSaved(label) {
|
|
55833
|
+
setStatus(`\u5DF2\u4FDD\u5B58 \xB7 ${label}`);
|
|
55834
|
+
if (statusTimer !== undefined)
|
|
55835
|
+
clearTimeout(statusTimer);
|
|
55836
|
+
statusTimer = setTimeout(() => {
|
|
55837
|
+
statusTimer = undefined;
|
|
55838
|
+
setStatus(undefined);
|
|
55839
|
+
}, 1500);
|
|
55840
|
+
}
|
|
55841
|
+
onCleanup(() => {
|
|
55842
|
+
if (statusTimer !== undefined)
|
|
55843
|
+
clearTimeout(statusTimer);
|
|
55844
|
+
statusTimer = undefined;
|
|
55845
|
+
});
|
|
55820
55846
|
const dimensions = useTerminalDimensions();
|
|
55821
|
-
const
|
|
55847
|
+
const panelRows = createMemo(() => settingsPanelRows(dimensions().height));
|
|
55848
|
+
const pageSize = createMemo(() => bodyPageSize(panelRows()));
|
|
55822
55849
|
const rowWindowStart = createMemo(() => {
|
|
55823
55850
|
const total = currentRows().length;
|
|
55824
55851
|
const size = pageSize();
|
|
@@ -55861,14 +55888,16 @@ function SettingsModalBody(props) {
|
|
|
55861
55888
|
setView("browse");
|
|
55862
55889
|
setPane("rows");
|
|
55863
55890
|
setEditorRow(undefined);
|
|
55864
|
-
|
|
55891
|
+
setError(undefined);
|
|
55865
55892
|
}
|
|
55866
55893
|
function openRow(row) {
|
|
55867
55894
|
setError(undefined);
|
|
55868
55895
|
setStatus(undefined);
|
|
55869
55896
|
if (row.kind === "jump") {
|
|
55870
|
-
|
|
55897
|
+
const command = row.command ?? "";
|
|
55871
55898
|
props.onRequestClose();
|
|
55899
|
+
if (command !== "")
|
|
55900
|
+
props.onCommand?.(command);
|
|
55872
55901
|
return;
|
|
55873
55902
|
}
|
|
55874
55903
|
if (row.kind === "toggle") {
|
|
@@ -55876,8 +55905,7 @@ function SettingsModalBody(props) {
|
|
|
55876
55905
|
setStatus(row.note ?? "\u8BE5\u884C\u53EA\u8BFB");
|
|
55877
55906
|
return;
|
|
55878
55907
|
}
|
|
55879
|
-
|
|
55880
|
-
setDrafts((current) => stageDraft(current, row, next));
|
|
55908
|
+
applyRowValue(row, row.value !== "on");
|
|
55881
55909
|
return;
|
|
55882
55910
|
}
|
|
55883
55911
|
if (row.kind === "submenu") {
|
|
@@ -55891,21 +55919,65 @@ function SettingsModalBody(props) {
|
|
|
55891
55919
|
return;
|
|
55892
55920
|
}
|
|
55893
55921
|
setEditorRow(row);
|
|
55894
|
-
setEditorValue(row.kind === "number" && (row.value === "n/a" || row.value === "(unset)") ? "" :
|
|
55922
|
+
setEditorValue(row.kind === "number" && (row.value === "n/a" || row.value === "(unset)") ? "" : row.value);
|
|
55895
55923
|
if (row.kind === "enum") {
|
|
55896
55924
|
const options = row.options ?? [];
|
|
55897
|
-
const at = options.indexOf(
|
|
55925
|
+
const at = options.indexOf(row.value);
|
|
55898
55926
|
setOptionCursor(at >= 0 ? at : 0);
|
|
55899
55927
|
}
|
|
55900
55928
|
setView("editor");
|
|
55901
55929
|
}
|
|
55930
|
+
async function applyRowValue(row, value) {
|
|
55931
|
+
if (busy())
|
|
55932
|
+
return false;
|
|
55933
|
+
setBusy(true);
|
|
55934
|
+
setError(undefined);
|
|
55935
|
+
setStatus(undefined);
|
|
55936
|
+
try {
|
|
55937
|
+
const result = await writeSetting(row, value, {
|
|
55938
|
+
seam: props.seam,
|
|
55939
|
+
...props.themes !== undefined ? {
|
|
55940
|
+
themes: props.themes
|
|
55941
|
+
} : {},
|
|
55942
|
+
merged: merged(),
|
|
55943
|
+
...document() !== undefined ? {
|
|
55944
|
+
document: document()
|
|
55945
|
+
} : {},
|
|
55946
|
+
local: writable().local,
|
|
55947
|
+
host: writable().host
|
|
55948
|
+
});
|
|
55949
|
+
if (result.document !== undefined)
|
|
55950
|
+
setDocument(result.document);
|
|
55951
|
+
if (!result.ok) {
|
|
55952
|
+
setError(result.error ?? "\u2718 \u5199\u5165\u5931\u8D25");
|
|
55953
|
+
return false;
|
|
55954
|
+
}
|
|
55955
|
+
reloadLocal();
|
|
55956
|
+
if (result.patch !== undefined)
|
|
55957
|
+
setMerged((current) => ({
|
|
55958
|
+
...current,
|
|
55959
|
+
...result.patch
|
|
55960
|
+
}));
|
|
55961
|
+
reloadHost();
|
|
55962
|
+
if (result.refreshFailed === true) {
|
|
55963
|
+
setError("\u26A0 \u5DF2\u5199\u5165\uFF0C\u4F46\u8BBE\u7F6E\u5237\u65B0\u5931\u8D25\uFF08\u663E\u793A\u7684\u4ECD\u662F\u65E7\u6587\u6863\uFF09");
|
|
55964
|
+
return true;
|
|
55965
|
+
}
|
|
55966
|
+
savedLabels.push(row.label);
|
|
55967
|
+
flashSaved(row.label);
|
|
55968
|
+
props.onApplied?.([...savedLabels]);
|
|
55969
|
+
return true;
|
|
55970
|
+
} finally {
|
|
55971
|
+
setBusy(false);
|
|
55972
|
+
}
|
|
55973
|
+
}
|
|
55902
55974
|
function moveOptionCursor(delta) {
|
|
55903
55975
|
const options = editorRow()?.options ?? [];
|
|
55904
55976
|
if (options.length === 0)
|
|
55905
55977
|
return;
|
|
55906
55978
|
setOptionCursor((current) => ((current + delta) % options.length + options.length) % options.length);
|
|
55907
55979
|
}
|
|
55908
|
-
function chooseOption() {
|
|
55980
|
+
async function chooseOption() {
|
|
55909
55981
|
const row = editorRow();
|
|
55910
55982
|
if (row === undefined)
|
|
55911
55983
|
return;
|
|
@@ -55913,14 +55985,8 @@ function SettingsModalBody(props) {
|
|
|
55913
55985
|
if (option === undefined)
|
|
55914
55986
|
return;
|
|
55915
55987
|
setEditorValue(option);
|
|
55916
|
-
|
|
55917
|
-
|
|
55918
|
-
}
|
|
55919
|
-
function stageEditorValue(value) {
|
|
55920
|
-
const row = editorRow();
|
|
55921
|
-
if (row === undefined)
|
|
55922
|
-
return;
|
|
55923
|
-
setDrafts((current) => stageDraft(current, row, value));
|
|
55988
|
+
if (await applyRowValue(row, option))
|
|
55989
|
+
backToSection();
|
|
55924
55990
|
}
|
|
55925
55991
|
function stepValue(direction) {
|
|
55926
55992
|
const row = editorRow();
|
|
@@ -55934,9 +56000,8 @@ function SettingsModalBody(props) {
|
|
|
55934
56000
|
if (row.max !== undefined)
|
|
55935
56001
|
next = Math.min(row.max, next);
|
|
55936
56002
|
setEditorValue(String(next));
|
|
55937
|
-
stageEditorValue(next);
|
|
55938
56003
|
}
|
|
55939
|
-
function commitEditor() {
|
|
56004
|
+
async function commitEditor() {
|
|
55940
56005
|
const row = editorRow();
|
|
55941
56006
|
if (row === undefined)
|
|
55942
56007
|
return;
|
|
@@ -55946,110 +56011,34 @@ function SettingsModalBody(props) {
|
|
|
55946
56011
|
setError(`\u2718 ${parsed.error}`);
|
|
55947
56012
|
return;
|
|
55948
56013
|
}
|
|
55949
|
-
|
|
55950
|
-
|
|
55951
|
-
|
|
56014
|
+
if (await applyRowValue(row, parsed.value))
|
|
56015
|
+
backToSection();
|
|
56016
|
+
return;
|
|
55952
56017
|
}
|
|
55953
|
-
|
|
56018
|
+
if (await applyRowValue(row, editorValue()))
|
|
56019
|
+
backToSection();
|
|
55954
56020
|
}
|
|
55955
56021
|
function cancelEditor() {
|
|
55956
|
-
const row = editorRow();
|
|
55957
|
-
if (row !== undefined) {
|
|
55958
|
-
setDrafts((current) => {
|
|
55959
|
-
const next = {
|
|
55960
|
-
...current
|
|
55961
|
-
};
|
|
55962
|
-
delete next[draftKey(row)];
|
|
55963
|
-
return next;
|
|
55964
|
-
});
|
|
55965
|
-
}
|
|
55966
56022
|
backToSection();
|
|
55967
56023
|
}
|
|
55968
|
-
function discardAndClose() {
|
|
55969
|
-
setDrafts({});
|
|
55970
|
-
props.onRequestClose();
|
|
55971
|
-
}
|
|
55972
56024
|
const panels = usePanels();
|
|
55973
|
-
let
|
|
55974
|
-
async function
|
|
55975
|
-
if (
|
|
55976
|
-
discardAndClose();
|
|
55977
|
-
return;
|
|
55978
|
-
}
|
|
55979
|
-
if (confirmingDiscard)
|
|
56025
|
+
let confirmingExit = false;
|
|
56026
|
+
async function requestExitConfirm() {
|
|
56027
|
+
if (confirmingExit)
|
|
55980
56028
|
return;
|
|
55981
|
-
|
|
56029
|
+
confirmingExit = true;
|
|
55982
56030
|
try {
|
|
55983
|
-
const
|
|
55984
|
-
|
|
55985
|
-
|
|
55986
|
-
|
|
55987
|
-
confirmLabel: "\u4E22\u5F03",
|
|
56031
|
+
const exit = await panels.confirm({
|
|
56032
|
+
title: "\u9000\u51FA\u8BBE\u7F6E\uFF1F",
|
|
56033
|
+
message: "\u6240\u6709\u6539\u52A8\u5DF2\u5373\u65F6\u4FDD\u5B58\u3002",
|
|
56034
|
+
confirmLabel: "\u9000\u51FA",
|
|
55988
56035
|
cancelLabel: "\u53D6\u6D88",
|
|
55989
|
-
destructive: true
|
|
55990
|
-
tone: "danger"
|
|
56036
|
+
destructive: true
|
|
55991
56037
|
});
|
|
55992
|
-
if (
|
|
55993
|
-
|
|
56038
|
+
if (exit)
|
|
56039
|
+
props.onRequestClose();
|
|
55994
56040
|
} catch {} finally {
|
|
55995
|
-
|
|
55996
|
-
}
|
|
55997
|
-
}
|
|
55998
|
-
async function confirm() {
|
|
55999
|
-
if (busy())
|
|
56000
|
-
return;
|
|
56001
|
-
if (!dirty()) {
|
|
56002
|
-
props.onRequestClose();
|
|
56003
|
-
return;
|
|
56004
|
-
}
|
|
56005
|
-
setBusy(true);
|
|
56006
|
-
setError(undefined);
|
|
56007
|
-
try {
|
|
56008
|
-
const result = await commitSettingsDrafts({
|
|
56009
|
-
seam: props.seam,
|
|
56010
|
-
...props.themes !== undefined ? {
|
|
56011
|
-
themes: props.themes
|
|
56012
|
-
} : {},
|
|
56013
|
-
rows: sections().flatMap((section) => section.rows),
|
|
56014
|
-
drafts: drafts(),
|
|
56015
|
-
merged: merged(),
|
|
56016
|
-
...document() !== undefined ? {
|
|
56017
|
-
document: document()
|
|
56018
|
-
} : {},
|
|
56019
|
-
local: writable().local,
|
|
56020
|
-
host: writable().host
|
|
56021
|
-
});
|
|
56022
|
-
if (result.document !== undefined)
|
|
56023
|
-
setDocument(result.document);
|
|
56024
|
-
if (!result.ok) {
|
|
56025
|
-
const attempted = new Set(result.attempted);
|
|
56026
|
-
reloadLocal();
|
|
56027
|
-
await reloadHost();
|
|
56028
|
-
setDrafts((current) => {
|
|
56029
|
-
const next = {};
|
|
56030
|
-
for (const [key, value] of Object.entries(current)) {
|
|
56031
|
-
if (!attempted.has(key))
|
|
56032
|
-
next[key] = value;
|
|
56033
|
-
}
|
|
56034
|
-
return next;
|
|
56035
|
-
});
|
|
56036
|
-
setError(result.error ?? "\u2718 \u5199\u5165\u5931\u8D25");
|
|
56037
|
-
return;
|
|
56038
|
-
}
|
|
56039
|
-
setDrafts({});
|
|
56040
|
-
reloadLocal();
|
|
56041
|
-
await reloadHost();
|
|
56042
|
-
if (result.refreshFailed === true) {
|
|
56043
|
-
setError("\u26A0 \u5DF2\u5199\u5165\uFF0C\u4F46\u8BBE\u7F6E\u5237\u65B0\u5931\u8D25\uFF08\u663E\u793A\u7684\u4ECD\u662F\u65E7\u6587\u6863\uFF09");
|
|
56044
|
-
return;
|
|
56045
|
-
}
|
|
56046
|
-
if (result.saved.length > 0) {
|
|
56047
|
-
setStatus(settingsSummary(result.saved));
|
|
56048
|
-
props.onApplied?.(result.saved);
|
|
56049
|
-
}
|
|
56050
|
-
props.onRequestClose();
|
|
56051
|
-
} finally {
|
|
56052
|
-
setBusy(false);
|
|
56041
|
+
confirmingExit = false;
|
|
56053
56042
|
}
|
|
56054
56043
|
}
|
|
56055
56044
|
const registerKeys = useControlKeys();
|
|
@@ -56154,7 +56143,7 @@ function SettingsModalBody(props) {
|
|
|
56154
56143
|
escape: () => {
|
|
56155
56144
|
const next = settingsBackView(view());
|
|
56156
56145
|
if (next === "close") {
|
|
56157
|
-
|
|
56146
|
+
requestExitConfirm();
|
|
56158
56147
|
return true;
|
|
56159
56148
|
}
|
|
56160
56149
|
backToSection();
|
|
@@ -56208,14 +56197,6 @@ function SettingsModalBody(props) {
|
|
|
56208
56197
|
title: "Settings: last row",
|
|
56209
56198
|
group: "Settings",
|
|
56210
56199
|
run: () => pageRows("end")
|
|
56211
|
-
}, {
|
|
56212
|
-
bind: "ctrl+s",
|
|
56213
|
-
title: "Settings: commit",
|
|
56214
|
-
group: "Settings",
|
|
56215
|
-
run: () => {
|
|
56216
|
-
confirm();
|
|
56217
|
-
return true;
|
|
56218
|
-
}
|
|
56219
56200
|
}]
|
|
56220
56201
|
}));
|
|
56221
56202
|
onMount(() => {
|
|
@@ -56242,10 +56223,11 @@ function SettingsModalBody(props) {
|
|
|
56242
56223
|
const navItems = createMemo(() => sections().map((section) => ({
|
|
56243
56224
|
id: section.id,
|
|
56244
56225
|
label: section.label,
|
|
56245
|
-
description: `${section.rows.length}
|
|
56226
|
+
description: `${section.rows.length}`,
|
|
56227
|
+
descriptionTone: "system"
|
|
56246
56228
|
})));
|
|
56247
56229
|
const rowWidth = () => settingsRowWidth(dimensions().width, dimensions().height);
|
|
56248
|
-
const rowItems = createMemo(() => rowListItems(visibleRows()
|
|
56230
|
+
const rowItems = createMemo(() => rowListItems(visibleRows()));
|
|
56249
56231
|
const activeRowId = () => currentRow()?.id;
|
|
56250
56232
|
const pageIndicator = () => {
|
|
56251
56233
|
const total = currentRows().length;
|
|
@@ -56256,7 +56238,8 @@ function SettingsModalBody(props) {
|
|
|
56256
56238
|
return ` ${start + 1}-${Math.min(start + size, total)}/${total}`;
|
|
56257
56239
|
};
|
|
56258
56240
|
return (() => {
|
|
56259
|
-
var _el$ = createElement("box");
|
|
56241
|
+
var _el$ = createElement("box"), _el$0 = createElement("box"), _el$1 = createElement("box"), _el$10 = createElement("text"), _el$12 = createElement("text");
|
|
56242
|
+
insertNode(_el$, _el$0);
|
|
56260
56243
|
setProp(_el$, "flexDirection", "column");
|
|
56261
56244
|
setProp(_el$, "flexGrow", 1);
|
|
56262
56245
|
setProp(_el$, "flexShrink", 1);
|
|
@@ -56266,13 +56249,13 @@ function SettingsModalBody(props) {
|
|
|
56266
56249
|
return pageSize() + 3;
|
|
56267
56250
|
},
|
|
56268
56251
|
get children() {
|
|
56269
|
-
var _el$2 = createElement("box"), _el$3 = createElement("box"), _el$4 = createElement("box"), _el$5 = createElement("text");
|
|
56252
|
+
var _el$2 = createElement("box"), _el$3 = createElement("box"), _el$4 = createElement("box"), _el$5 = createElement("box"), _el$6 = createElement("box"), _el$7 = createElement("text");
|
|
56270
56253
|
insertNode(_el$2, _el$3);
|
|
56271
56254
|
insertNode(_el$2, _el$4);
|
|
56255
|
+
insertNode(_el$2, _el$5);
|
|
56272
56256
|
setProp(_el$2, "flexDirection", "row");
|
|
56273
56257
|
setProp(_el$2, "flexGrow", 1);
|
|
56274
56258
|
setProp(_el$2, "flexShrink", 1);
|
|
56275
|
-
setProp(_el$2, "gap", 2);
|
|
56276
56259
|
setProp(_el$3, "flexDirection", "column");
|
|
56277
56260
|
setProp(_el$3, "width", 20);
|
|
56278
56261
|
setProp(_el$3, "flexShrink", 0);
|
|
@@ -56287,12 +56270,17 @@ function SettingsModalBody(props) {
|
|
|
56287
56270
|
pageSize: 8,
|
|
56288
56271
|
filterable: false
|
|
56289
56272
|
}));
|
|
56290
|
-
|
|
56291
|
-
setProp(_el$4, "
|
|
56292
|
-
|
|
56293
|
-
setProp(_el$
|
|
56294
|
-
|
|
56295
|
-
|
|
56273
|
+
setProp(_el$4, "width", 1);
|
|
56274
|
+
setProp(_el$4, "flexShrink", 0);
|
|
56275
|
+
insertNode(_el$5, _el$6);
|
|
56276
|
+
setProp(_el$5, "flexDirection", "column");
|
|
56277
|
+
setProp(_el$5, "flexGrow", 1);
|
|
56278
|
+
setProp(_el$5, "flexShrink", 1);
|
|
56279
|
+
setProp(_el$5, "paddingLeft", 1);
|
|
56280
|
+
insertNode(_el$6, _el$7);
|
|
56281
|
+
setProp(_el$6, "flexShrink", 0);
|
|
56282
|
+
insert(_el$7, () => currentSection().label);
|
|
56283
|
+
insert(_el$5, createComponent2(Show, {
|
|
56296
56284
|
get when() {
|
|
56297
56285
|
return editorRow() === undefined;
|
|
56298
56286
|
},
|
|
@@ -56320,18 +56308,20 @@ function SettingsModalBody(props) {
|
|
|
56320
56308
|
return currentRow()?.note !== undefined;
|
|
56321
56309
|
},
|
|
56322
56310
|
get children() {
|
|
56323
|
-
var _el$
|
|
56324
|
-
insert(_el$
|
|
56325
|
-
|
|
56311
|
+
var _el$8 = createElement("text");
|
|
56312
|
+
insert(_el$8, () => ` ${currentRow().note}`);
|
|
56313
|
+
effect((_$p) => setProp(_el$8, "fg", role(theme().text.muted), _$p));
|
|
56314
|
+
return _el$8;
|
|
56326
56315
|
}
|
|
56327
56316
|
}), (() => {
|
|
56328
|
-
var _el$
|
|
56329
|
-
insert(_el$
|
|
56330
|
-
|
|
56317
|
+
var _el$9 = createElement("text");
|
|
56318
|
+
insert(_el$9, () => `${pane() === "nav" ? "\u2191\u2193 \u9009\u62E9\u5206\u8282 \xB7 \u2192/Enter \u8FDB\u5165\u5185\u5BB9" : "\u2191\u2193 \u9009\u62E9\u884C \xB7 Enter \u7F16\u8F91 \xB7 \u2190/Esc \u8FD4\u56DE"}${pageIndicator()}`);
|
|
56319
|
+
effect((_$p) => setProp(_el$9, "fg", role(theme().text.muted), _$p));
|
|
56320
|
+
return _el$9;
|
|
56331
56321
|
})()];
|
|
56332
56322
|
}
|
|
56333
56323
|
}), null);
|
|
56334
|
-
insert(_el$
|
|
56324
|
+
insert(_el$5, createComponent2(Show, {
|
|
56335
56325
|
get when() {
|
|
56336
56326
|
return editorRow() !== undefined;
|
|
56337
56327
|
},
|
|
@@ -56347,46 +56337,71 @@ function SettingsModalBody(props) {
|
|
|
56347
56337
|
return optionCursor();
|
|
56348
56338
|
},
|
|
56349
56339
|
get optionRows() {
|
|
56350
|
-
return Math.max(1, pageSize() -
|
|
56340
|
+
return Math.max(1, pageSize() - 2);
|
|
56351
56341
|
},
|
|
56352
56342
|
onValue: setEditorValue,
|
|
56353
|
-
onStage: stageEditorValue,
|
|
56354
56343
|
onStep: stepValue,
|
|
56355
|
-
onCommit: commitEditor,
|
|
56344
|
+
onCommit: () => void commitEditor(),
|
|
56356
56345
|
onCancel: cancelEditor
|
|
56357
56346
|
});
|
|
56358
56347
|
}
|
|
56359
56348
|
}), null);
|
|
56360
|
-
effect((
|
|
56349
|
+
effect((_p$) => {
|
|
56350
|
+
var _v$ = chrome().navBand, _v$2 = chrome().divider, _v$3 = contentBg(), _v$4 = chrome().titleBand, _v$5 = TextAttributes11.BOLD, _v$6 = role(theme().text.heading);
|
|
56351
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$3, "backgroundColor", _v$, _p$.e));
|
|
56352
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$4, "backgroundColor", _v$2, _p$.t));
|
|
56353
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$5, "backgroundColor", _v$3, _p$.a));
|
|
56354
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$6, "backgroundColor", _v$4, _p$.o));
|
|
56355
|
+
_v$5 !== _p$.i && (_p$.i = setProp(_el$7, "attributes", _v$5, _p$.i));
|
|
56356
|
+
_v$6 !== _p$.n && (_p$.n = setProp(_el$7, "fg", _v$6, _p$.n));
|
|
56357
|
+
return _p$;
|
|
56358
|
+
}, {
|
|
56359
|
+
e: undefined,
|
|
56360
|
+
t: undefined,
|
|
56361
|
+
a: undefined,
|
|
56362
|
+
o: undefined,
|
|
56363
|
+
i: undefined,
|
|
56364
|
+
n: undefined
|
|
56365
|
+
});
|
|
56361
56366
|
return _el$2;
|
|
56362
56367
|
}
|
|
56363
|
-
}),
|
|
56364
|
-
|
|
56365
|
-
|
|
56366
|
-
|
|
56367
|
-
|
|
56368
|
-
|
|
56369
|
-
|
|
56370
|
-
|
|
56371
|
-
|
|
56372
|
-
|
|
56373
|
-
|
|
56374
|
-
|
|
56375
|
-
|
|
56376
|
-
|
|
56377
|
-
|
|
56378
|
-
|
|
56379
|
-
|
|
56380
|
-
|
|
56381
|
-
|
|
56382
|
-
|
|
56383
|
-
|
|
56384
|
-
|
|
56385
|
-
|
|
56368
|
+
}), _el$0);
|
|
56369
|
+
insertNode(_el$0, _el$1);
|
|
56370
|
+
insertNode(_el$0, _el$12);
|
|
56371
|
+
setProp(_el$0, "flexDirection", "row");
|
|
56372
|
+
setProp(_el$0, "justifyContent", "space-between");
|
|
56373
|
+
setProp(_el$0, "flexShrink", 0);
|
|
56374
|
+
setProp(_el$0, "gap", 2);
|
|
56375
|
+
insertNode(_el$1, _el$10);
|
|
56376
|
+
setProp(_el$1, "flexShrink", 0);
|
|
56377
|
+
setProp(_el$1, "border", ["left", "right"]);
|
|
56378
|
+
setProp(_el$1, "borderStyle", "single");
|
|
56379
|
+
insertNode(_el$10, createTextNode(`esc \u8FD4\u56DE`));
|
|
56380
|
+
setProp(_el$10, "wrapMode", "none");
|
|
56381
|
+
setProp(_el$12, "wrapMode", "none");
|
|
56382
|
+
insert(_el$12, () => error() ?? status() ?? "\u6539\u52A8\u5DF2\u5373\u65F6\u4FDD\u5B58");
|
|
56383
|
+
effect((_p$) => {
|
|
56384
|
+
var _v$7 = chrome().divider, _v$8 = theme().text.muted, _v$9 = theme().attributes.keyHint, _v$0 = role(error() !== undefined ? theme().text.danger : theme().text.system), _v$1 = theme().attributes.keyHint;
|
|
56385
|
+
_v$7 !== _p$.e && (_p$.e = setProp(_el$1, "borderColor", _v$7, _p$.e));
|
|
56386
|
+
_v$8 !== _p$.t && (_p$.t = setProp(_el$10, "fg", _v$8, _p$.t));
|
|
56387
|
+
_v$9 !== _p$.a && (_p$.a = setProp(_el$10, "attributes", _v$9, _p$.a));
|
|
56388
|
+
_v$0 !== _p$.o && (_p$.o = setProp(_el$12, "fg", _v$0, _p$.o));
|
|
56389
|
+
_v$1 !== _p$.i && (_p$.i = setProp(_el$12, "attributes", _v$1, _p$.i));
|
|
56390
|
+
return _p$;
|
|
56391
|
+
}, {
|
|
56392
|
+
e: undefined,
|
|
56393
|
+
t: undefined,
|
|
56394
|
+
a: undefined,
|
|
56395
|
+
o: undefined,
|
|
56396
|
+
i: undefined
|
|
56397
|
+
});
|
|
56386
56398
|
return _el$;
|
|
56387
56399
|
})();
|
|
56388
56400
|
}
|
|
56389
56401
|
function EditorView(props) {
|
|
56402
|
+
const theme = usePanelTheme();
|
|
56403
|
+
const contentBg = () => theme().background.content;
|
|
56404
|
+
const role = (fg) => withContrastFloor(fg, contentBg(), theme().text.base);
|
|
56390
56405
|
let catcher;
|
|
56391
56406
|
const options = () => props.row.options ?? [];
|
|
56392
56407
|
const optionLimit = () => Math.max(1, props.optionRows);
|
|
@@ -56407,23 +56422,24 @@ function EditorView(props) {
|
|
|
56407
56422
|
return ` ${start + 1}-${Math.min(start + limit, total)}/${total}`;
|
|
56408
56423
|
};
|
|
56409
56424
|
return (() => {
|
|
56410
|
-
var _el$
|
|
56411
|
-
insertNode(_el$
|
|
56412
|
-
insertNode(_el$
|
|
56413
|
-
setProp(_el$
|
|
56414
|
-
setProp(_el$
|
|
56415
|
-
insert(_el$
|
|
56416
|
-
insert(_el$
|
|
56425
|
+
var _el$13 = createElement("box"), _el$14 = createElement("text"), _el$22 = createElement("text");
|
|
56426
|
+
insertNode(_el$13, _el$14);
|
|
56427
|
+
insertNode(_el$13, _el$22);
|
|
56428
|
+
setProp(_el$13, "flexDirection", "column");
|
|
56429
|
+
setProp(_el$13, "flexGrow", 1);
|
|
56430
|
+
insert(_el$14, () => `${props.row.label} \u2014 ${props.row.kind === "number" ? "\u8F93\u5165\u6574\u6570" : props.row.kind === "enum" ? "\u9009\u62E9\u503C" : "\u67E5\u770B"}`);
|
|
56431
|
+
insert(_el$13, createComponent2(Show, {
|
|
56417
56432
|
get when() {
|
|
56418
56433
|
return props.row.note !== undefined;
|
|
56419
56434
|
},
|
|
56420
56435
|
get children() {
|
|
56421
|
-
var _el$
|
|
56422
|
-
insert(_el$
|
|
56423
|
-
|
|
56436
|
+
var _el$15 = createElement("text");
|
|
56437
|
+
insert(_el$15, () => ` ${props.row.note}`);
|
|
56438
|
+
effect((_$p) => setProp(_el$15, "fg", role(theme().text.system), _$p));
|
|
56439
|
+
return _el$15;
|
|
56424
56440
|
}
|
|
56425
|
-
}), _el$
|
|
56426
|
-
insert(_el$
|
|
56441
|
+
}), _el$22);
|
|
56442
|
+
insert(_el$13, createComponent2(Show, {
|
|
56427
56443
|
get when() {
|
|
56428
56444
|
return props.row.kind === "submenu";
|
|
56429
56445
|
},
|
|
@@ -56433,96 +56449,138 @@ function EditorView(props) {
|
|
|
56433
56449
|
return props.row.detail ?? [];
|
|
56434
56450
|
},
|
|
56435
56451
|
children: (child) => (() => {
|
|
56436
|
-
var _el$
|
|
56437
|
-
insertNode(_el$
|
|
56438
|
-
setProp(_el$
|
|
56439
|
-
insert(_el$
|
|
56440
|
-
insert(_el$
|
|
56452
|
+
var _el$23 = createElement("box"), _el$24 = createElement("text");
|
|
56453
|
+
insertNode(_el$23, _el$24);
|
|
56454
|
+
setProp(_el$23, "flexDirection", "column");
|
|
56455
|
+
insert(_el$24, () => ` ${child.label} ${child.value}`);
|
|
56456
|
+
insert(_el$23, createComponent2(Show, {
|
|
56441
56457
|
get when() {
|
|
56442
56458
|
return child.note !== undefined;
|
|
56443
56459
|
},
|
|
56444
56460
|
get children() {
|
|
56445
|
-
var _el$
|
|
56446
|
-
insert(_el$
|
|
56447
|
-
|
|
56461
|
+
var _el$25 = createElement("text");
|
|
56462
|
+
insert(_el$25, () => ` ${child.note}`);
|
|
56463
|
+
effect((_$p) => setProp(_el$25, "fg", role(theme().text.system), _$p));
|
|
56464
|
+
return _el$25;
|
|
56448
56465
|
}
|
|
56449
56466
|
}), null);
|
|
56450
|
-
|
|
56467
|
+
effect((_$p) => setProp(_el$24, "fg", role(theme().text.base), _$p));
|
|
56468
|
+
return _el$23;
|
|
56451
56469
|
})()
|
|
56452
56470
|
});
|
|
56453
56471
|
}
|
|
56454
|
-
}), _el$
|
|
56455
|
-
insert(_el$
|
|
56472
|
+
}), _el$22);
|
|
56473
|
+
insert(_el$13, createComponent2(Show, {
|
|
56456
56474
|
get when() {
|
|
56457
56475
|
return props.row.kind === "enum";
|
|
56458
56476
|
},
|
|
56459
56477
|
get children() {
|
|
56460
|
-
var _el$
|
|
56461
|
-
setProp(_el$
|
|
56462
|
-
insert(_el$
|
|
56478
|
+
var _el$16 = createElement("box");
|
|
56479
|
+
setProp(_el$16, "flexDirection", "column");
|
|
56480
|
+
insert(_el$16, createComponent2(For, {
|
|
56463
56481
|
get each() {
|
|
56464
56482
|
return visibleOptions();
|
|
56465
56483
|
},
|
|
56466
56484
|
children: (option, index) => (() => {
|
|
56467
|
-
var _el$
|
|
56468
|
-
insertNode(_el$
|
|
56469
|
-
|
|
56470
|
-
setProp(_el$
|
|
56485
|
+
var _el$26 = createElement("box"), _el$27 = createElement("text"), _el$28 = createElement("text");
|
|
56486
|
+
insertNode(_el$26, _el$27);
|
|
56487
|
+
insertNode(_el$26, _el$28);
|
|
56488
|
+
setProp(_el$26, "flexDirection", "row");
|
|
56489
|
+
setProp(_el$26, "onMouseUp", () => {
|
|
56471
56490
|
props.onValue(option);
|
|
56472
56491
|
props.onCommit();
|
|
56473
56492
|
});
|
|
56474
|
-
insert(_el$
|
|
56475
|
-
|
|
56493
|
+
insert(_el$27, () => optionStart() + index() === props.cursor ? "\u25B8 " : " ");
|
|
56494
|
+
insert(_el$28, option);
|
|
56495
|
+
insert(_el$26, createComponent2(Show, {
|
|
56496
|
+
get when() {
|
|
56497
|
+
return option === props.row.value;
|
|
56498
|
+
},
|
|
56499
|
+
get children() {
|
|
56500
|
+
var _el$29 = createElement("text");
|
|
56501
|
+
insertNode(_el$29, createTextNode(` (current)`));
|
|
56502
|
+
effect((_$p) => setProp(_el$29, "fg", role(theme().text.system), _$p));
|
|
56503
|
+
return _el$29;
|
|
56504
|
+
}
|
|
56505
|
+
}), null);
|
|
56506
|
+
effect((_p$) => {
|
|
56507
|
+
var _v$15 = role(theme().text.accent), _v$16 = role(theme().text.code);
|
|
56508
|
+
_v$15 !== _p$.e && (_p$.e = setProp(_el$27, "fg", _v$15, _p$.e));
|
|
56509
|
+
_v$16 !== _p$.t && (_p$.t = setProp(_el$28, "fg", _v$16, _p$.t));
|
|
56510
|
+
return _p$;
|
|
56511
|
+
}, {
|
|
56512
|
+
e: undefined,
|
|
56513
|
+
t: undefined
|
|
56514
|
+
});
|
|
56515
|
+
return _el$26;
|
|
56476
56516
|
})()
|
|
56477
56517
|
}), null);
|
|
56478
|
-
insert(_el$
|
|
56518
|
+
insert(_el$16, createComponent2(Show, {
|
|
56479
56519
|
get when() {
|
|
56480
56520
|
return optionIndicator() !== "";
|
|
56481
56521
|
},
|
|
56482
56522
|
get children() {
|
|
56483
|
-
var _el$
|
|
56484
|
-
insert(_el$
|
|
56485
|
-
|
|
56523
|
+
var _el$17 = createElement("text");
|
|
56524
|
+
insert(_el$17, optionIndicator);
|
|
56525
|
+
effect((_$p) => setProp(_el$17, "fg", role(theme().text.system), _$p));
|
|
56526
|
+
return _el$17;
|
|
56486
56527
|
}
|
|
56487
56528
|
}), null);
|
|
56488
|
-
return _el$
|
|
56529
|
+
return _el$16;
|
|
56489
56530
|
}
|
|
56490
|
-
}), _el$
|
|
56491
|
-
insert(_el$
|
|
56531
|
+
}), _el$22);
|
|
56532
|
+
insert(_el$13, createComponent2(Show, {
|
|
56492
56533
|
get when() {
|
|
56493
56534
|
return props.row.kind === "number" || props.row.kind === "text";
|
|
56494
56535
|
},
|
|
56495
56536
|
get children() {
|
|
56496
|
-
var _el$
|
|
56497
|
-
insertNode(_el$
|
|
56498
|
-
insertNode(_el$
|
|
56499
|
-
insertNode(_el$
|
|
56500
|
-
setProp(_el$
|
|
56501
|
-
insert(_el$
|
|
56502
|
-
insert(_el$
|
|
56537
|
+
var _el$18 = createElement("box"), _el$19 = createElement("text"), _el$20 = createElement("text"), _el$21 = createElement("input");
|
|
56538
|
+
insertNode(_el$18, _el$19);
|
|
56539
|
+
insertNode(_el$18, _el$20);
|
|
56540
|
+
insertNode(_el$18, _el$21);
|
|
56541
|
+
setProp(_el$18, "flexDirection", "row");
|
|
56542
|
+
insert(_el$19, () => `${props.row.kind === "number" ? "\u6570\u503C" : "\u503C"}: `);
|
|
56543
|
+
insert(_el$20, () => props.value);
|
|
56503
56544
|
use((renderable) => {
|
|
56504
56545
|
catcher = renderable;
|
|
56505
56546
|
setTimeout(() => {
|
|
56506
56547
|
if (catcher !== undefined && catcher.isDestroyed !== true)
|
|
56507
56548
|
catcher.focus();
|
|
56508
56549
|
}, 1);
|
|
56509
|
-
}, _el$
|
|
56510
|
-
setProp(_el$
|
|
56511
|
-
setProp(_el$
|
|
56512
|
-
|
|
56513
|
-
|
|
56550
|
+
}, _el$21);
|
|
56551
|
+
setProp(_el$21, "flexGrow", 1);
|
|
56552
|
+
setProp(_el$21, "onInput", (next) => props.onValue(next));
|
|
56553
|
+
setProp(_el$21, "onSubmit", () => props.onCommit());
|
|
56554
|
+
effect((_p$) => {
|
|
56555
|
+
var _v$10 = role(theme().text.muted), _v$11 = role(theme().text.code), _v$12 = props.value;
|
|
56556
|
+
_v$10 !== _p$.e && (_p$.e = setProp(_el$19, "fg", _v$10, _p$.e));
|
|
56557
|
+
_v$11 !== _p$.t && (_p$.t = setProp(_el$20, "fg", _v$11, _p$.t));
|
|
56558
|
+
_v$12 !== _p$.a && (_p$.a = setProp(_el$21, "value", _v$12, _p$.a));
|
|
56559
|
+
return _p$;
|
|
56560
|
+
}, {
|
|
56561
|
+
e: undefined,
|
|
56562
|
+
t: undefined,
|
|
56563
|
+
a: undefined
|
|
56514
56564
|
});
|
|
56515
|
-
|
|
56516
|
-
effect((_$p) => setProp(_el$14, "value", props.value, _$p));
|
|
56517
|
-
return _el$11;
|
|
56565
|
+
return _el$18;
|
|
56518
56566
|
}
|
|
56519
|
-
}), _el$
|
|
56520
|
-
insert(_el$
|
|
56521
|
-
|
|
56567
|
+
}), _el$22);
|
|
56568
|
+
insert(_el$22, () => props.row.kind === "enum" ? "\u2191\u2193 \u9009\u62E9 \xB7 Enter/Space \u4FDD\u5B58\u5E76\u8FD4\u56DE \xB7 Esc \u8FD4\u56DE" : "Enter \u4FDD\u5B58\u5E76\u8FD4\u56DE \xB7 Esc \u8FD4\u56DE \xB7 \u5DE6/\u53F3 \u8C03\u6574\u6570\u503C");
|
|
56569
|
+
effect((_p$) => {
|
|
56570
|
+
var _v$13 = role(theme().text.heading), _v$14 = role(theme().text.faint);
|
|
56571
|
+
_v$13 !== _p$.e && (_p$.e = setProp(_el$14, "fg", _v$13, _p$.e));
|
|
56572
|
+
_v$14 !== _p$.t && (_p$.t = setProp(_el$22, "fg", _v$14, _p$.t));
|
|
56573
|
+
return _p$;
|
|
56574
|
+
}, {
|
|
56575
|
+
e: undefined,
|
|
56576
|
+
t: undefined
|
|
56577
|
+
});
|
|
56578
|
+
return _el$13;
|
|
56522
56579
|
})();
|
|
56523
56580
|
}
|
|
56524
56581
|
function SettingsModalHost(props) {
|
|
56525
56582
|
const panels = usePanels();
|
|
56583
|
+
const dimensions = useTerminalDimensions();
|
|
56526
56584
|
const [, setOpen] = useSettingsPanelOpenState();
|
|
56527
56585
|
let summary;
|
|
56528
56586
|
let handle;
|
|
@@ -56556,8 +56614,10 @@ function SettingsModalHost(props) {
|
|
|
56556
56614
|
})), {
|
|
56557
56615
|
id: "settings-modal",
|
|
56558
56616
|
title: "Settings",
|
|
56559
|
-
subtitle: "\u5206\u8282\u5BFC\u822A \xB7
|
|
56617
|
+
subtitle: "\u5206\u8282\u5BFC\u822A \xB7 \u5373\u65F6\u4FDD\u5B58 \xB7 Esc \u9010\u5C42\u8FD4\u56DE",
|
|
56560
56618
|
size: "xlarge",
|
|
56619
|
+
rows: settingsPanelRows(dimensions().height),
|
|
56620
|
+
layered: true,
|
|
56561
56621
|
onClose: () => {
|
|
56562
56622
|
handle = undefined;
|
|
56563
56623
|
setLayerHandle(undefined);
|
|
@@ -56569,13 +56629,13 @@ function SettingsModalHost(props) {
|
|
|
56569
56629
|
setOpen(true);
|
|
56570
56630
|
});
|
|
56571
56631
|
return (() => {
|
|
56572
|
-
var _el$
|
|
56573
|
-
setProp(_el$
|
|
56574
|
-
setProp(_el$
|
|
56575
|
-
return _el$
|
|
56632
|
+
var _el$31 = createElement("box");
|
|
56633
|
+
setProp(_el$31, "height", 0);
|
|
56634
|
+
setProp(_el$31, "flexShrink", 0);
|
|
56635
|
+
return _el$31;
|
|
56576
56636
|
})();
|
|
56577
56637
|
}
|
|
56578
|
-
var SETTINGS_SECTIONS, COMMAND_SECTIONS, NAV_WIDTH = 20, MIN_BODY_PAGE = 4, MAX_BODY_PAGE =
|
|
56638
|
+
var SETTINGS_SECTIONS, COMMAND_SECTIONS, NAV_WIDTH = 20, SETTINGS_PANEL_RATIO = 0.75, SETTINGS_PANEL_MIN_ROWS = 18, MIN_BODY_PAGE = 4, MAX_BODY_PAGE = 24, SETTINGS_FIXED_CHROME_ROWS = 12;
|
|
56579
56639
|
var init_settings_modal = __esm(() => {
|
|
56580
56640
|
init_index_bun();
|
|
56581
56641
|
init_index_bun();
|
|
@@ -56586,6 +56646,7 @@ var init_settings_modal = __esm(() => {
|
|
|
56586
56646
|
init_index_bun();
|
|
56587
56647
|
init_index_bun();
|
|
56588
56648
|
init_index_bun();
|
|
56649
|
+
init_index_bun();
|
|
56589
56650
|
init_server();
|
|
56590
56651
|
init_index_bun();
|
|
56591
56652
|
init_src2();
|
|
@@ -56931,29 +56992,60 @@ function createClipboardAdapter(clipboard) {
|
|
|
56931
56992
|
}
|
|
56932
56993
|
var init_clipboard2 = () => {};
|
|
56933
56994
|
|
|
56995
|
+
// ../tui-base/src/theme/contrast.ts
|
|
56996
|
+
function relativeLuminance3(color) {
|
|
56997
|
+
const [r, g, b] = color.toInts();
|
|
56998
|
+
const channel = (value) => {
|
|
56999
|
+
const c = value / 255;
|
|
57000
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
57001
|
+
};
|
|
57002
|
+
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
|
|
57003
|
+
}
|
|
57004
|
+
function contrastRatio3(a, b) {
|
|
57005
|
+
const la = relativeLuminance3(a);
|
|
57006
|
+
const lb = relativeLuminance3(b);
|
|
57007
|
+
const hi = Math.max(la, lb);
|
|
57008
|
+
const lo = Math.min(la, lb);
|
|
57009
|
+
return (hi + 0.05) / (lo + 0.05);
|
|
57010
|
+
}
|
|
57011
|
+
function ensureContrast(foreground, background, min = 4.5, fallback = foreground) {
|
|
57012
|
+
return contrastRatio3(foreground, background) >= min ? foreground : fallback;
|
|
57013
|
+
}
|
|
57014
|
+
|
|
56934
57015
|
// ../tui-base/src/context/panel-kit-host.tsx
|
|
56935
57016
|
import { RGBA as RGBA15, TextAttributes as TextAttributes12 } from "@opentui/core";
|
|
56936
57017
|
function projectPanelTheme(theme) {
|
|
56937
57018
|
const primary = theme.text.action.primary;
|
|
57019
|
+
const raised = theme.background.raised;
|
|
57020
|
+
const markdown = theme.markdown;
|
|
57021
|
+
const feedback = theme.text.feedback;
|
|
57022
|
+
const interactive = theme.hue.interactive;
|
|
57023
|
+
const content = raised?.base ?? theme.background.base;
|
|
57024
|
+
const readable = (color) => ensureContrast(color, content, 4.5, theme.text.base);
|
|
56938
57025
|
return {
|
|
56939
57026
|
background: {
|
|
56940
57027
|
surface: theme.background.base,
|
|
56941
|
-
raised: theme.background.
|
|
57028
|
+
raised: raised?.high ?? theme.background.base,
|
|
57029
|
+
content,
|
|
56942
57030
|
scrim: RGBA15.fromInts(0, 0, 0, 150)
|
|
56943
57031
|
},
|
|
56944
57032
|
text: {
|
|
56945
57033
|
base: theme.text.base,
|
|
56946
|
-
muted: theme.text.muted,
|
|
56947
|
-
faint: theme.text.faint,
|
|
56948
|
-
accent:
|
|
56949
|
-
disabled: primary.
|
|
56950
|
-
danger: theme.text.
|
|
56951
|
-
warning: theme.text.
|
|
56952
|
-
success: theme.text.
|
|
57034
|
+
muted: readable(theme.text.muted),
|
|
57035
|
+
faint: readable(theme.text.faint),
|
|
57036
|
+
accent: readable(interactive?.[500] ?? theme.text.base),
|
|
57037
|
+
disabled: primary?.disabled ?? theme.text.muted,
|
|
57038
|
+
danger: readable(feedback?.error?.base ?? theme.text.base),
|
|
57039
|
+
warning: readable(feedback?.warning?.base ?? theme.text.base),
|
|
57040
|
+
success: readable(feedback?.success?.base ?? theme.text.base),
|
|
57041
|
+
code: readable(markdown?.code ?? theme.text.base),
|
|
57042
|
+
user: readable(primary?.base ?? theme.text.base),
|
|
57043
|
+
system: readable(feedback?.info?.base ?? theme.text.muted),
|
|
57044
|
+
heading: readable(markdown?.heading ?? theme.text.base)
|
|
56953
57045
|
},
|
|
56954
57046
|
row: {
|
|
56955
57047
|
activeBg: theme.background.action.primary.focused,
|
|
56956
|
-
activeFg: primary.
|
|
57048
|
+
activeFg: primary?.focused ?? theme.text.base
|
|
56957
57049
|
},
|
|
56958
57050
|
border: {
|
|
56959
57051
|
base: {
|
|
@@ -56962,11 +57054,11 @@ function projectPanelTheme(theme) {
|
|
|
56962
57054
|
},
|
|
56963
57055
|
focused: {
|
|
56964
57056
|
style: "heavy",
|
|
56965
|
-
color: theme.border.base
|
|
57057
|
+
color: interactive?.[500] ?? theme.border.base
|
|
56966
57058
|
},
|
|
56967
57059
|
warning: {
|
|
56968
57060
|
style: "single",
|
|
56969
|
-
color: theme.text.
|
|
57061
|
+
color: feedback?.warning?.base ?? theme.text.base
|
|
56970
57062
|
}
|
|
56971
57063
|
},
|
|
56972
57064
|
attributes: {
|
|
@@ -58074,16 +58166,12 @@ function V2SessionPage(props) {
|
|
|
58074
58166
|
},
|
|
58075
58167
|
themes: themeFace,
|
|
58076
58168
|
onCommand: (command) => {
|
|
58077
|
-
|
|
58078
|
-
if (node !== undefined) {
|
|
58079
|
-
node.setText(command + " ");
|
|
58080
|
-
node.gotoLineEnd();
|
|
58081
|
-
}
|
|
58169
|
+
slash.interceptSubmit(command);
|
|
58082
58170
|
},
|
|
58083
58171
|
onClosed: (summary) => {
|
|
58084
58172
|
if (summary !== undefined)
|
|
58085
58173
|
sayLine(summary);
|
|
58086
|
-
if (composerRef && !composerRef.focused())
|
|
58174
|
+
if (dialog.stack.length === 0 && composerRef && !composerRef.focused())
|
|
58087
58175
|
composerRef.focus();
|
|
58088
58176
|
}
|
|
58089
58177
|
}),
|