@aiwayds/dsh-opentui 0.11.0 → 0.12.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/CHANGELOG.md +15 -0
- package/dist/client/index.js +611 -531
- 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,
|
|
@@ -51244,10 +51254,11 @@ function clampAlpha(value) {
|
|
|
51244
51254
|
return Math.max(0, Math.min(255, Math.round(value)));
|
|
51245
51255
|
}
|
|
51246
51256
|
function resolvePanelChrome(theme) {
|
|
51257
|
+
const content = theme.background.content ?? theme.background.surface;
|
|
51247
51258
|
return {
|
|
51248
|
-
titleBand: fadeColor(
|
|
51259
|
+
titleBand: fadeColor(content, theme.background.raised, 0.5),
|
|
51249
51260
|
navBand: theme.background.raised,
|
|
51250
|
-
content
|
|
51261
|
+
content,
|
|
51251
51262
|
divider: theme.border.base.color
|
|
51252
51263
|
};
|
|
51253
51264
|
}
|
|
@@ -51260,6 +51271,20 @@ function fadeColor(from, to, t) {
|
|
|
51260
51271
|
const mix = (a, b) => a + (b - a) * progress;
|
|
51261
51272
|
return RGBA14.fromValues(mix(from.r, to.r), mix(from.g, to.g), mix(from.b, to.b), to.a);
|
|
51262
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
|
+
}
|
|
51263
51288
|
function fadeTheme(theme, t) {
|
|
51264
51289
|
const progress = clamp012(t);
|
|
51265
51290
|
if (progress >= 1)
|
|
@@ -51274,6 +51299,7 @@ function fadeTheme(theme, t) {
|
|
|
51274
51299
|
background: {
|
|
51275
51300
|
surface,
|
|
51276
51301
|
raised: mix(theme.background.raised),
|
|
51302
|
+
content: mix(theme.background.content),
|
|
51277
51303
|
scrim: mix(theme.background.scrim)
|
|
51278
51304
|
},
|
|
51279
51305
|
text: {
|
|
@@ -51284,7 +51310,11 @@ function fadeTheme(theme, t) {
|
|
|
51284
51310
|
disabled: mix(theme.text.disabled),
|
|
51285
51311
|
danger: mix(theme.text.danger),
|
|
51286
51312
|
warning: mix(theme.text.warning),
|
|
51287
|
-
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)
|
|
51288
51318
|
},
|
|
51289
51319
|
row: {
|
|
51290
51320
|
activeBg: mix(theme.row.activeBg),
|
|
@@ -51299,7 +51329,50 @@ function fadeTheme(theme, t) {
|
|
|
51299
51329
|
identity: [mix(theme.identity[0]), mix(theme.identity[1])]
|
|
51300
51330
|
};
|
|
51301
51331
|
}
|
|
51302
|
-
|
|
51332
|
+
function dimTheme(theme, factor) {
|
|
51333
|
+
const level = clamp012(factor);
|
|
51334
|
+
if (level >= 1)
|
|
51335
|
+
return theme;
|
|
51336
|
+
const dim = (color) => RGBA14.fromValues(color.r * level, color.g * level, color.b * level, color.a);
|
|
51337
|
+
const border = (token) => ({
|
|
51338
|
+
style: token.style,
|
|
51339
|
+
color: dim(token.color)
|
|
51340
|
+
});
|
|
51341
|
+
return {
|
|
51342
|
+
background: {
|
|
51343
|
+
surface: dim(theme.background.surface),
|
|
51344
|
+
raised: dim(theme.background.raised),
|
|
51345
|
+
content: dim(theme.background.content),
|
|
51346
|
+
scrim: dim(theme.background.scrim)
|
|
51347
|
+
},
|
|
51348
|
+
text: {
|
|
51349
|
+
base: dim(theme.text.base),
|
|
51350
|
+
muted: dim(theme.text.muted),
|
|
51351
|
+
faint: dim(theme.text.faint),
|
|
51352
|
+
accent: dim(theme.text.accent),
|
|
51353
|
+
disabled: dim(theme.text.disabled),
|
|
51354
|
+
danger: dim(theme.text.danger),
|
|
51355
|
+
warning: dim(theme.text.warning),
|
|
51356
|
+
success: dim(theme.text.success),
|
|
51357
|
+
code: dim(theme.text.code),
|
|
51358
|
+
user: dim(theme.text.user),
|
|
51359
|
+
system: dim(theme.text.system),
|
|
51360
|
+
heading: dim(theme.text.heading)
|
|
51361
|
+
},
|
|
51362
|
+
row: {
|
|
51363
|
+
activeBg: dim(theme.row.activeBg),
|
|
51364
|
+
activeFg: dim(theme.row.activeFg)
|
|
51365
|
+
},
|
|
51366
|
+
border: {
|
|
51367
|
+
base: border(theme.border.base),
|
|
51368
|
+
focused: border(theme.border.focused),
|
|
51369
|
+
warning: border(theme.border.warning)
|
|
51370
|
+
},
|
|
51371
|
+
attributes: theme.attributes,
|
|
51372
|
+
identity: [dim(theme.identity[0]), dim(theme.identity[1])]
|
|
51373
|
+
};
|
|
51374
|
+
}
|
|
51375
|
+
var PanelKitContext, PanelKeyRoutingContext, STATIC_MOTION, MIN_CONTRAST = 4.5;
|
|
51303
51376
|
var init_theme4 = __esm(() => {
|
|
51304
51377
|
init_server();
|
|
51305
51378
|
init_contracts();
|
|
@@ -51595,7 +51668,7 @@ function Panel(props) {
|
|
|
51595
51668
|
return props.fadeIn === false ? 1 : driver.progress();
|
|
51596
51669
|
return current === "closed" ? 0 : 1;
|
|
51597
51670
|
};
|
|
51598
|
-
const theme = createMemo(() => fadeTheme(baseTheme(), fadeProgress()));
|
|
51671
|
+
const theme = createMemo(() => dimTheme(fadeTheme(baseTheme(), fadeProgress()), props.dim ?? 1));
|
|
51599
51672
|
let pending = false;
|
|
51600
51673
|
async function requestClose() {
|
|
51601
51674
|
const current = phase();
|
|
@@ -51676,52 +51749,80 @@ function Panel(props) {
|
|
|
51676
51749
|
const frameToken = () => resolveFrameToken(theme(), props.tone, props.border);
|
|
51677
51750
|
const titleTint = () => resolveTitleColor(theme(), props.tone);
|
|
51678
51751
|
const header = () => {
|
|
51679
|
-
if (props.header)
|
|
51680
|
-
return
|
|
51752
|
+
if (props.header) {
|
|
51753
|
+
return (() => {
|
|
51754
|
+
var _el$ = createElement("box");
|
|
51755
|
+
setProp(_el$, "flexDirection", "column");
|
|
51756
|
+
setProp(_el$, "flexShrink", 0);
|
|
51757
|
+
insert(_el$, () => props.header);
|
|
51758
|
+
effect((_p$) => {
|
|
51759
|
+
var _v$ = inset(), _v$2 = inset();
|
|
51760
|
+
_v$ !== _p$.e && (_p$.e = setProp(_el$, "paddingLeft", _v$, _p$.e));
|
|
51761
|
+
_v$2 !== _p$.t && (_p$.t = setProp(_el$, "paddingRight", _v$2, _p$.t));
|
|
51762
|
+
return _p$;
|
|
51763
|
+
}, {
|
|
51764
|
+
e: undefined,
|
|
51765
|
+
t: undefined
|
|
51766
|
+
});
|
|
51767
|
+
return _el$;
|
|
51768
|
+
})();
|
|
51769
|
+
}
|
|
51681
51770
|
const width = Math.max(1, innerWidth() - inset() * 2);
|
|
51682
51771
|
const layered = props.layered === true;
|
|
51683
51772
|
return (() => {
|
|
51684
|
-
var _el$ = createElement("box"), _el$
|
|
51685
|
-
insertNode(_el$, _el$2);
|
|
51686
|
-
setProp(_el$, "flexDirection", "column");
|
|
51687
|
-
setProp(_el$, "flexShrink", 0);
|
|
51773
|
+
var _el$2 = createElement("box"), _el$3 = createElement("box"), _el$4 = createElement("box"), _el$5 = createElement("text"), _el$6 = createElement("text");
|
|
51688
51774
|
insertNode(_el$2, _el$3);
|
|
51689
|
-
|
|
51690
|
-
setProp(_el$2, "flexDirection", "row");
|
|
51691
|
-
setProp(_el$2, "justifyContent", "space-between");
|
|
51775
|
+
setProp(_el$2, "flexDirection", "column");
|
|
51692
51776
|
setProp(_el$2, "flexShrink", 0);
|
|
51693
|
-
|
|
51694
|
-
setProp(_el$
|
|
51695
|
-
|
|
51696
|
-
|
|
51697
|
-
|
|
51777
|
+
insertNode(_el$3, _el$4);
|
|
51778
|
+
setProp(_el$3, "flexDirection", "column");
|
|
51779
|
+
setProp(_el$3, "flexShrink", 0);
|
|
51780
|
+
setProp(_el$3, "border", layered ? ["bottom"] : undefined);
|
|
51781
|
+
setProp(_el$3, "borderStyle", "single");
|
|
51782
|
+
insertNode(_el$4, _el$5);
|
|
51783
|
+
insertNode(_el$4, _el$6);
|
|
51784
|
+
setProp(_el$4, "flexDirection", "row");
|
|
51785
|
+
setProp(_el$4, "justifyContent", "space-between");
|
|
51786
|
+
setProp(_el$4, "flexShrink", 0);
|
|
51787
|
+
insert(_el$5, () => truncate2(props.title, Math.max(1, width - 4)));
|
|
51788
|
+
insertNode(_el$6, createTextNode(`esc`));
|
|
51789
|
+
insert(_el$2, createComponent2(Show, {
|
|
51698
51790
|
get when() {
|
|
51699
51791
|
return props.subtitle;
|
|
51700
51792
|
},
|
|
51701
51793
|
get children() {
|
|
51702
|
-
var _el$
|
|
51703
|
-
|
|
51704
|
-
|
|
51794
|
+
var _el$8 = createElement("box"), _el$9 = createElement("text");
|
|
51795
|
+
insertNode(_el$8, _el$9);
|
|
51796
|
+
setProp(_el$8, "flexDirection", "column");
|
|
51797
|
+
setProp(_el$8, "flexShrink", 0);
|
|
51798
|
+
setProp(_el$9, "wrapMode", "none");
|
|
51799
|
+
insert(_el$9, () => truncate2(props.subtitle ?? "", width));
|
|
51705
51800
|
effect((_p$) => {
|
|
51706
|
-
var _v$ = theme().text.muted, _v$
|
|
51707
|
-
_v$ !== _p$.e && (_p$.e = setProp(_el$
|
|
51708
|
-
_v$
|
|
51801
|
+
var _v$3 = inset(), _v$4 = inset(), _v$5 = theme().text.muted, _v$6 = theme().attributes.subtitle;
|
|
51802
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$8, "paddingLeft", _v$3, _p$.e));
|
|
51803
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$8, "paddingRight", _v$4, _p$.t));
|
|
51804
|
+
_v$5 !== _p$.a && (_p$.a = setProp(_el$9, "fg", _v$5, _p$.a));
|
|
51805
|
+
_v$6 !== _p$.o && (_p$.o = setProp(_el$9, "attributes", _v$6, _p$.o));
|
|
51709
51806
|
return _p$;
|
|
51710
51807
|
}, {
|
|
51711
51808
|
e: undefined,
|
|
51712
|
-
t: undefined
|
|
51809
|
+
t: undefined,
|
|
51810
|
+
a: undefined,
|
|
51811
|
+
o: undefined
|
|
51713
51812
|
});
|
|
51714
|
-
return _el$
|
|
51813
|
+
return _el$8;
|
|
51715
51814
|
}
|
|
51716
51815
|
}), null);
|
|
51717
51816
|
effect((_p$) => {
|
|
51718
|
-
var _v$
|
|
51719
|
-
_v$
|
|
51720
|
-
_v$
|
|
51721
|
-
_v$
|
|
51722
|
-
_v$
|
|
51723
|
-
_v$
|
|
51724
|
-
_v$
|
|
51817
|
+
var _v$7 = layered ? resolvePanelChrome(theme()).titleBand : undefined, _v$8 = resolvePanelChrome(theme()).divider, _v$9 = inset(), _v$0 = inset(), _v$1 = titleTint(), _v$10 = theme().attributes.title, _v$11 = theme().text.muted, _v$12 = theme().attributes.keyHint;
|
|
51818
|
+
_v$7 !== _p$.e && (_p$.e = setProp(_el$2, "backgroundColor", _v$7, _p$.e));
|
|
51819
|
+
_v$8 !== _p$.t && (_p$.t = setProp(_el$3, "borderColor", _v$8, _p$.t));
|
|
51820
|
+
_v$9 !== _p$.a && (_p$.a = setProp(_el$4, "paddingLeft", _v$9, _p$.a));
|
|
51821
|
+
_v$0 !== _p$.o && (_p$.o = setProp(_el$4, "paddingRight", _v$0, _p$.o));
|
|
51822
|
+
_v$1 !== _p$.i && (_p$.i = setProp(_el$5, "fg", _v$1, _p$.i));
|
|
51823
|
+
_v$10 !== _p$.n && (_p$.n = setProp(_el$5, "attributes", _v$10, _p$.n));
|
|
51824
|
+
_v$11 !== _p$.s && (_p$.s = setProp(_el$6, "fg", _v$11, _p$.s));
|
|
51825
|
+
_v$12 !== _p$.h && (_p$.h = setProp(_el$6, "attributes", _v$12, _p$.h));
|
|
51725
51826
|
return _p$;
|
|
51726
51827
|
}, {
|
|
51727
51828
|
e: undefined,
|
|
@@ -51729,9 +51830,11 @@ function Panel(props) {
|
|
|
51729
51830
|
a: undefined,
|
|
51730
51831
|
o: undefined,
|
|
51731
51832
|
i: undefined,
|
|
51732
|
-
n: undefined
|
|
51833
|
+
n: undefined,
|
|
51834
|
+
s: undefined,
|
|
51835
|
+
h: undefined
|
|
51733
51836
|
});
|
|
51734
|
-
return _el
|
|
51837
|
+
return _el$2;
|
|
51735
51838
|
})();
|
|
51736
51839
|
};
|
|
51737
51840
|
const scrimColor = () => resolveScrimColor(baseTheme(), props.scrimAlpha ?? resolveScrimAlpha(baseTheme().background.scrim.toInts()[3], props.depth ?? 0));
|
|
@@ -51743,26 +51846,26 @@ function Panel(props) {
|
|
|
51743
51846
|
return createComponent2(PanelKeyRoutingContext.Provider, {
|
|
51744
51847
|
value: router,
|
|
51745
51848
|
get children() {
|
|
51746
|
-
var _el$
|
|
51747
|
-
insertNode(_el$
|
|
51748
|
-
setProp(_el$
|
|
51749
|
-
setProp(_el$
|
|
51750
|
-
setProp(_el$
|
|
51751
|
-
setProp(_el$
|
|
51752
|
-
insertNode(_el$
|
|
51753
|
-
setProp(_el$
|
|
51754
|
-
setProp(_el$
|
|
51755
|
-
setProp(_el$
|
|
51756
|
-
insertNode(_el$
|
|
51757
|
-
setProp(_el$
|
|
51758
|
-
setProp(_el$
|
|
51759
|
-
setProp(_el$
|
|
51760
|
-
setProp(_el$
|
|
51761
|
-
insert(_el$
|
|
51762
|
-
setProp(_el$
|
|
51763
|
-
setProp(_el$
|
|
51764
|
-
setProp(_el$
|
|
51765
|
-
insert(_el$
|
|
51849
|
+
var _el$0 = createElement("box"), _el$1 = createElement("box"), _el$10 = createElement("box"), _el$11 = createElement("box");
|
|
51850
|
+
insertNode(_el$0, _el$1);
|
|
51851
|
+
setProp(_el$0, "position", "absolute");
|
|
51852
|
+
setProp(_el$0, "left", 0);
|
|
51853
|
+
setProp(_el$0, "top", 0);
|
|
51854
|
+
setProp(_el$0, "alignItems", "center");
|
|
51855
|
+
insertNode(_el$1, _el$10);
|
|
51856
|
+
setProp(_el$1, "flexShrink", 0);
|
|
51857
|
+
setProp(_el$1, "border", ["top", "bottom", "left", "right"]);
|
|
51858
|
+
setProp(_el$1, "paddingTop", 1);
|
|
51859
|
+
insertNode(_el$10, _el$11);
|
|
51860
|
+
setProp(_el$10, "flexDirection", "column");
|
|
51861
|
+
setProp(_el$10, "flexGrow", 1);
|
|
51862
|
+
setProp(_el$10, "flexShrink", 1);
|
|
51863
|
+
setProp(_el$10, "paddingBottom", 1);
|
|
51864
|
+
insert(_el$10, header, _el$11);
|
|
51865
|
+
setProp(_el$11, "flexDirection", "column");
|
|
51866
|
+
setProp(_el$11, "flexGrow", 1);
|
|
51867
|
+
setProp(_el$11, "flexShrink", 1);
|
|
51868
|
+
insert(_el$11, createComponent2(PanelKitContext.Provider, {
|
|
51766
51869
|
get value() {
|
|
51767
51870
|
return {
|
|
51768
51871
|
theme,
|
|
@@ -51775,22 +51878,22 @@ function Panel(props) {
|
|
|
51775
51878
|
}
|
|
51776
51879
|
}));
|
|
51777
51880
|
effect((_p$) => {
|
|
51778
|
-
var _v$
|
|
51779
|
-
_v$
|
|
51780
|
-
_v$
|
|
51781
|
-
_v$
|
|
51782
|
-
_v$
|
|
51783
|
-
_v$
|
|
51784
|
-
_v$
|
|
51785
|
-
_v$
|
|
51786
|
-
_v$
|
|
51787
|
-
_v$
|
|
51788
|
-
_v$
|
|
51789
|
-
_v$
|
|
51790
|
-
_v$
|
|
51791
|
-
_v$
|
|
51792
|
-
_v$
|
|
51793
|
-
_v$
|
|
51881
|
+
var _v$13 = dimensions().width, _v$14 = dimensions().height, _v$15 = 3000 + (props.depth ?? 0), _v$16 = props.align === "top" ? undefined : "center", _v$17 = props.align === "top" ? Math.floor(dimensions().height / 4) : 0, _v$18 = props.scrim === false ? undefined : scrimColor(), _v$19 = frameWidth(), _v$20 = frameHeight(), _v$21 = Math.max(1, dimensions().width - 2), _v$22 = heightLimit(), _v$23 = theme().background.surface, _v$24 = frameToken().style, _v$25 = frameToken().color, _v$26 = inset(), _v$27 = inset();
|
|
51882
|
+
_v$13 !== _p$.e && (_p$.e = setProp(_el$0, "width", _v$13, _p$.e));
|
|
51883
|
+
_v$14 !== _p$.t && (_p$.t = setProp(_el$0, "height", _v$14, _p$.t));
|
|
51884
|
+
_v$15 !== _p$.a && (_p$.a = setProp(_el$0, "zIndex", _v$15, _p$.a));
|
|
51885
|
+
_v$16 !== _p$.o && (_p$.o = setProp(_el$0, "justifyContent", _v$16, _p$.o));
|
|
51886
|
+
_v$17 !== _p$.i && (_p$.i = setProp(_el$0, "paddingTop", _v$17, _p$.i));
|
|
51887
|
+
_v$18 !== _p$.n && (_p$.n = setProp(_el$0, "backgroundColor", _v$18, _p$.n));
|
|
51888
|
+
_v$19 !== _p$.s && (_p$.s = setProp(_el$1, "width", _v$19, _p$.s));
|
|
51889
|
+
_v$20 !== _p$.h && (_p$.h = setProp(_el$1, "height", _v$20, _p$.h));
|
|
51890
|
+
_v$21 !== _p$.r && (_p$.r = setProp(_el$1, "maxWidth", _v$21, _p$.r));
|
|
51891
|
+
_v$22 !== _p$.d && (_p$.d = setProp(_el$1, "maxHeight", _v$22, _p$.d));
|
|
51892
|
+
_v$23 !== _p$.l && (_p$.l = setProp(_el$1, "backgroundColor", _v$23, _p$.l));
|
|
51893
|
+
_v$24 !== _p$.u && (_p$.u = setProp(_el$1, "borderStyle", _v$24, _p$.u));
|
|
51894
|
+
_v$25 !== _p$.c && (_p$.c = setProp(_el$1, "borderColor", _v$25, _p$.c));
|
|
51895
|
+
_v$26 !== _p$.w && (_p$.w = setProp(_el$11, "paddingLeft", _v$26, _p$.w));
|
|
51896
|
+
_v$27 !== _p$.m && (_p$.m = setProp(_el$11, "paddingRight", _v$27, _p$.m));
|
|
51794
51897
|
return _p$;
|
|
51795
51898
|
}, {
|
|
51796
51899
|
e: undefined,
|
|
@@ -51809,7 +51912,7 @@ function Panel(props) {
|
|
|
51809
51912
|
w: undefined,
|
|
51810
51913
|
m: undefined
|
|
51811
51914
|
});
|
|
51812
|
-
return _el$
|
|
51915
|
+
return _el$0;
|
|
51813
51916
|
}
|
|
51814
51917
|
});
|
|
51815
51918
|
}
|
|
@@ -52169,6 +52272,8 @@ function toneColor(theme, tone, active) {
|
|
|
52169
52272
|
switch (tone) {
|
|
52170
52273
|
case "muted":
|
|
52171
52274
|
return theme.text.muted;
|
|
52275
|
+
case "system":
|
|
52276
|
+
return theme.text.system;
|
|
52172
52277
|
case "warning":
|
|
52173
52278
|
return theme.text.warning;
|
|
52174
52279
|
case "danger":
|
|
@@ -52177,6 +52282,19 @@ function toneColor(theme, tone, active) {
|
|
|
52177
52282
|
return theme.text.base;
|
|
52178
52283
|
}
|
|
52179
52284
|
}
|
|
52285
|
+
function descriptionColor(theme, tone) {
|
|
52286
|
+
switch (tone) {
|
|
52287
|
+
case "code":
|
|
52288
|
+
return theme.text.code;
|
|
52289
|
+
case "system":
|
|
52290
|
+
return theme.text.system;
|
|
52291
|
+
default:
|
|
52292
|
+
return theme.text.muted;
|
|
52293
|
+
}
|
|
52294
|
+
}
|
|
52295
|
+
function badgeColor(theme, tone) {
|
|
52296
|
+
return tone === "user" ? theme.text.user : theme.text.accent;
|
|
52297
|
+
}
|
|
52180
52298
|
function List(props) {
|
|
52181
52299
|
const theme = useControlTheme();
|
|
52182
52300
|
const [state, setState] = createSignal({
|
|
@@ -52375,7 +52493,7 @@ function List(props) {
|
|
|
52375
52493
|
setProp(_el$7, "wrapMode", "none");
|
|
52376
52494
|
insert(_el$7, headers);
|
|
52377
52495
|
effect((_p$) => {
|
|
52378
|
-
var _v$ = theme().attributes.group, _v$2 = theme().text.
|
|
52496
|
+
var _v$ = theme().attributes.group, _v$2 = theme().text.heading;
|
|
52379
52497
|
_v$ !== _p$.e && (_p$.e = setProp(_el$7, "attributes", _v$, _p$.e));
|
|
52380
52498
|
_v$2 !== _p$.t && (_p$.t = setProp(_el$7, "fg", _v$2, _p$.t));
|
|
52381
52499
|
return _p$;
|
|
@@ -52393,7 +52511,7 @@ function List(props) {
|
|
|
52393
52511
|
var _el$1 = createElement("text");
|
|
52394
52512
|
insert(_el$1, () => row.group.label ?? row.group.id);
|
|
52395
52513
|
effect((_p$) => {
|
|
52396
|
-
var _v$3 = theme().attributes.group, _v$4 = theme().text.
|
|
52514
|
+
var _v$3 = theme().attributes.group, _v$4 = theme().text.heading;
|
|
52397
52515
|
_v$3 !== _p$.e && (_p$.e = setProp(_el$1, "attributes", _v$3, _p$.e));
|
|
52398
52516
|
_v$4 !== _p$.t && (_p$.t = setProp(_el$1, "fg", _v$4, _p$.t));
|
|
52399
52517
|
return _p$;
|
|
@@ -52459,6 +52577,15 @@ function ListRowView(props) {
|
|
|
52459
52577
|
const labelBudget = props.width === undefined ? undefined : props.width - prefixCells - suffixCells;
|
|
52460
52578
|
const hasColumns = props.columns !== undefined && props.columns.length > 0;
|
|
52461
52579
|
const label = hasColumns ? "" : labelBudget === undefined ? item.label : truncateCells(item.label, labelBudget, "tail");
|
|
52580
|
+
const descriptionRightAligned = () => item.description !== undefined && item.descriptionAlign === "right" && !hasColumns && props.width !== undefined && props.width > 0;
|
|
52581
|
+
const descriptionGap = () => {
|
|
52582
|
+
if (item.description === undefined)
|
|
52583
|
+
return "";
|
|
52584
|
+
if (!descriptionRightAligned())
|
|
52585
|
+
return " ";
|
|
52586
|
+
const used = prefixCells + stringWidth2(label) + stringWidth2(item.description);
|
|
52587
|
+
return " ".repeat(Math.max(1, (props.width ?? 0) - used));
|
|
52588
|
+
};
|
|
52462
52589
|
const columnText = () => {
|
|
52463
52590
|
if (!hasColumns)
|
|
52464
52591
|
return "";
|
|
@@ -52488,7 +52615,7 @@ function ListRowView(props) {
|
|
|
52488
52615
|
var _el$12 = createElement("text"), _el$13 = createTextNode(` `);
|
|
52489
52616
|
insertNode(_el$12, _el$13);
|
|
52490
52617
|
insert(_el$12, () => item.badge, _el$13);
|
|
52491
|
-
effect((_$p) => setProp(_el$12, "fg", active() ? theme().row.activeFg : theme().
|
|
52618
|
+
effect((_$p) => setProp(_el$12, "fg", active() ? theme().row.activeFg : badgeColor(theme(), item.badgeTone), _$p));
|
|
52492
52619
|
return _el$12;
|
|
52493
52620
|
}
|
|
52494
52621
|
}), _el$16);
|
|
@@ -52515,8 +52642,8 @@ function ListRowView(props) {
|
|
|
52515
52642
|
},
|
|
52516
52643
|
get children() {
|
|
52517
52644
|
var _el$15 = createElement("text");
|
|
52518
|
-
insert(_el$15, () =>
|
|
52519
|
-
effect((_$p) => setProp(_el$15, "fg", disabled ? theme().text.disabled : active() ? theme().row.activeFg : theme().
|
|
52645
|
+
insert(_el$15, () => descriptionGap() + (item.description ?? ""));
|
|
52646
|
+
effect((_$p) => setProp(_el$15, "fg", disabled ? theme().text.disabled : active() ? theme().row.activeFg : descriptionColor(theme(), item.descriptionTone), _$p));
|
|
52520
52647
|
return _el$15;
|
|
52521
52648
|
}
|
|
52522
52649
|
}), _el$16);
|
|
@@ -52758,7 +52885,7 @@ function PanelActions(props) {
|
|
|
52758
52885
|
setProp(_el$12, "wrapMode", "none");
|
|
52759
52886
|
insert(_el$12, () => props.hint);
|
|
52760
52887
|
effect((_p$) => {
|
|
52761
|
-
var _v$12 = theme().text.
|
|
52888
|
+
var _v$12 = theme().text.system, _v$13 = theme().attributes.keyHint;
|
|
52762
52889
|
_v$12 !== _p$.e && (_p$.e = setProp(_el$12, "fg", _v$12, _p$.e));
|
|
52763
52890
|
_v$13 !== _p$.t && (_p$.t = setProp(_el$12, "attributes", _v$13, _p$.t));
|
|
52764
52891
|
return _p$;
|
|
@@ -52900,11 +53027,11 @@ function ConfirmDialog(props) {
|
|
|
52900
53027
|
insert(_el$, (() => {
|
|
52901
53028
|
var _c$ = memo2(() => typeof props.message === "string");
|
|
52902
53029
|
return () => _c$() ? (() => {
|
|
52903
|
-
var _el$
|
|
52904
|
-
setProp(_el$
|
|
52905
|
-
insert(_el$
|
|
52906
|
-
effect((_$p) => setProp(_el$
|
|
52907
|
-
return _el$
|
|
53030
|
+
var _el$5 = createElement("text");
|
|
53031
|
+
setProp(_el$5, "wrapMode", "word");
|
|
53032
|
+
insert(_el$5, () => props.message);
|
|
53033
|
+
effect((_$p) => setProp(_el$5, "fg", messageTone(), _$p));
|
|
53034
|
+
return _el$5;
|
|
52908
53035
|
})() : props.message;
|
|
52909
53036
|
})(), _el$2);
|
|
52910
53037
|
setProp(_el$2, "flexDirection", "row");
|
|
@@ -52924,8 +53051,8 @@ function ConfirmDialog(props) {
|
|
|
52924
53051
|
setProp(_el$3, "flexDirection", "row");
|
|
52925
53052
|
setProp(_el$3, "justifyContent", "flex-end");
|
|
52926
53053
|
setProp(_el$3, "flexShrink", 0);
|
|
52927
|
-
insertNode(_el$4, createTextNode(`\u2190\u2192 \u9009\u62E9 \xB7 Enter \u786E\u8BA4 \xB7 Esc \u53D6\u6D88`));
|
|
52928
53054
|
setProp(_el$4, "wrapMode", "none");
|
|
53055
|
+
insert(_el$4, () => `\u2190\u2192 \u9009\u62E9 \xB7 Enter \u786E\u8BA4 \xB7 Esc ${props.cancelLabel ?? "Cancel"}`);
|
|
52929
53056
|
effect((_p$) => {
|
|
52930
53057
|
var _v$ = theme().text.muted, _v$2 = theme().attributes.keyHint;
|
|
52931
53058
|
_v$ !== _p$.e && (_p$.e = setProp(_el$4, "fg", _v$, _p$.e));
|
|
@@ -52941,10 +53068,10 @@ function ConfirmDialog(props) {
|
|
|
52941
53068
|
function ConfirmButton(props) {
|
|
52942
53069
|
const token = () => props.state().focused ? props.theme().border.focused : props.theme().border.base;
|
|
52943
53070
|
return (() => {
|
|
52944
|
-
var _el$
|
|
52945
|
-
setProp(_el$
|
|
52946
|
-
setProp(_el$
|
|
52947
|
-
insert(_el$
|
|
53071
|
+
var _el$6 = createElement("box");
|
|
53072
|
+
setProp(_el$6, "flexShrink", 0);
|
|
53073
|
+
setProp(_el$6, "border", ["top", "right", "bottom", "left"]);
|
|
53074
|
+
insert(_el$6, createComponent2(Button, {
|
|
52948
53075
|
get label() {
|
|
52949
53076
|
return props.state().label;
|
|
52950
53077
|
},
|
|
@@ -52952,7 +53079,7 @@ function ConfirmButton(props) {
|
|
|
52952
53079
|
return props.state().variant;
|
|
52953
53080
|
},
|
|
52954
53081
|
get keyHint() {
|
|
52955
|
-
return props.state().keyHint;
|
|
53082
|
+
return props.state().keyHint || undefined;
|
|
52956
53083
|
},
|
|
52957
53084
|
get disabled() {
|
|
52958
53085
|
return props.state().disabled;
|
|
@@ -52966,14 +53093,14 @@ function ConfirmButton(props) {
|
|
|
52966
53093
|
}));
|
|
52967
53094
|
effect((_p$) => {
|
|
52968
53095
|
var _v$3 = token().style, _v$4 = token().color;
|
|
52969
|
-
_v$3 !== _p$.e && (_p$.e = setProp(_el$
|
|
52970
|
-
_v$4 !== _p$.t && (_p$.t = setProp(_el$
|
|
53096
|
+
_v$3 !== _p$.e && (_p$.e = setProp(_el$6, "borderStyle", _v$3, _p$.e));
|
|
53097
|
+
_v$4 !== _p$.t && (_p$.t = setProp(_el$6, "borderColor", _v$4, _p$.t));
|
|
52971
53098
|
return _p$;
|
|
52972
53099
|
}, {
|
|
52973
53100
|
e: undefined,
|
|
52974
53101
|
t: undefined
|
|
52975
53102
|
});
|
|
52976
|
-
return _el$
|
|
53103
|
+
return _el$6;
|
|
52977
53104
|
})();
|
|
52978
53105
|
}
|
|
52979
53106
|
var init_confirm = __esm(() => {
|
|
@@ -52985,7 +53112,6 @@ var init_confirm = __esm(() => {
|
|
|
52985
53112
|
init_index_bun();
|
|
52986
53113
|
init_index_bun();
|
|
52987
53114
|
init_index_bun();
|
|
52988
|
-
init_index_bun();
|
|
52989
53115
|
init_server();
|
|
52990
53116
|
init_theme4();
|
|
52991
53117
|
init_button();
|
|
@@ -53089,11 +53215,36 @@ function inTree(root, node) {
|
|
|
53089
53215
|
}
|
|
53090
53216
|
function PanelStack(props) {
|
|
53091
53217
|
const renderer = useRenderer();
|
|
53218
|
+
const panelTheme = usePanelTheme();
|
|
53092
53219
|
const [layers, setLayers] = createSignal([]);
|
|
53093
53220
|
const handles = new Map;
|
|
53094
53221
|
let counter = 0;
|
|
53095
53222
|
let baseFocus = null;
|
|
53096
53223
|
const maxDepth = () => props.maxDepth ?? 4;
|
|
53224
|
+
const layerScrimAlpha = (index) => {
|
|
53225
|
+
const entry = layers()[index];
|
|
53226
|
+
if (!entry || entry.options.scrim === false)
|
|
53227
|
+
return 0;
|
|
53228
|
+
return entry.options.scrimAlpha ?? resolveScrimAlpha(panelTheme().background.scrim.toInts()[3], index);
|
|
53229
|
+
};
|
|
53230
|
+
const dimFor = (index) => {
|
|
53231
|
+
let left = 1;
|
|
53232
|
+
for (let above = index + 1;above < layers().length; above += 1) {
|
|
53233
|
+
left *= 1 - layerScrimAlpha(above) / 255;
|
|
53234
|
+
}
|
|
53235
|
+
return left;
|
|
53236
|
+
};
|
|
53237
|
+
const pageScrimAlpha = (index) => {
|
|
53238
|
+
if (index !== 0 || layers().length < 2)
|
|
53239
|
+
return;
|
|
53240
|
+
if (layers()[0]?.options.scrimAlpha !== undefined)
|
|
53241
|
+
return;
|
|
53242
|
+
let left = 1;
|
|
53243
|
+
for (let at = 0;at < layers().length; at += 1) {
|
|
53244
|
+
left *= 1 - layerScrimAlpha(at) / 255;
|
|
53245
|
+
}
|
|
53246
|
+
return Math.round((1 - left) * 255);
|
|
53247
|
+
};
|
|
53097
53248
|
const restore = (target) => {
|
|
53098
53249
|
queueMicrotask(() => {
|
|
53099
53250
|
if (layers().length > 0)
|
|
@@ -53221,7 +53372,7 @@ function PanelStack(props) {
|
|
|
53221
53372
|
title: options.title,
|
|
53222
53373
|
tone: options.tone ?? "warning",
|
|
53223
53374
|
size: "medium",
|
|
53224
|
-
height:
|
|
53375
|
+
height: 12,
|
|
53225
53376
|
onClose: () => {
|
|
53226
53377
|
if (settled)
|
|
53227
53378
|
return;
|
|
@@ -53257,6 +53408,15 @@ function PanelStack(props) {
|
|
|
53257
53408
|
get active() {
|
|
53258
53409
|
return index() === layers().length - 1;
|
|
53259
53410
|
},
|
|
53411
|
+
get scrim() {
|
|
53412
|
+
return memo2(() => index() === 0)() ? entry.options.scrim : false;
|
|
53413
|
+
},
|
|
53414
|
+
get scrimAlpha() {
|
|
53415
|
+
return memo2(() => index() === 0)() ? pageScrimAlpha(index()) : entry.options.scrimAlpha;
|
|
53416
|
+
},
|
|
53417
|
+
get dim() {
|
|
53418
|
+
return dimFor(index());
|
|
53419
|
+
},
|
|
53260
53420
|
onClose: () => {
|
|
53261
53421
|
entry.options.onClose?.();
|
|
53262
53422
|
removeEntry(entry.id);
|
|
@@ -53285,6 +53445,7 @@ var init_stack = __esm(() => {
|
|
|
53285
53445
|
init_server();
|
|
53286
53446
|
init_confirm();
|
|
53287
53447
|
init_panel();
|
|
53448
|
+
init_theme4();
|
|
53288
53449
|
PanelStackContext = createContext(undefined);
|
|
53289
53450
|
});
|
|
53290
53451
|
|
|
@@ -55401,7 +55562,7 @@ var init_agents_panel = __esm(() => {
|
|
|
55401
55562
|
import { TextAttributes as TextAttributes11 } from "@opentui/core";
|
|
55402
55563
|
function resolveVersion() {
|
|
55403
55564
|
try {
|
|
55404
|
-
return "0.
|
|
55565
|
+
return "0.12.1";
|
|
55405
55566
|
} catch {
|
|
55406
55567
|
return "dev";
|
|
55407
55568
|
}
|
|
@@ -55596,209 +55757,100 @@ function buildSectionRows(id, ctx) {
|
|
|
55596
55757
|
return buildCommandRows(id);
|
|
55597
55758
|
}
|
|
55598
55759
|
}
|
|
55599
|
-
function draftKey(row) {
|
|
55600
|
-
const write = row.write;
|
|
55601
|
-
if (write === undefined)
|
|
55602
|
-
return row.id;
|
|
55603
|
-
if (write.via === "settings")
|
|
55604
|
-
return `settings:${write.ns}.${write.path.join(".")}`;
|
|
55605
|
-
if (write.key === "footerHints") {
|
|
55606
|
-
const segment = row.id.startsWith("footerHints.") ? row.id.slice("footerHints.".length) : row.id;
|
|
55607
|
-
return `footerHints.${segment}`;
|
|
55608
|
-
}
|
|
55609
|
-
return `config:${write.key}`;
|
|
55610
|
-
}
|
|
55611
55760
|
function settingsBackView(view) {
|
|
55612
55761
|
return view === "editor" ? "browse" : "close";
|
|
55613
55762
|
}
|
|
55614
|
-
function
|
|
55615
|
-
|
|
55616
|
-
|
|
55617
|
-
|
|
55618
|
-
|
|
55619
|
-
|
|
55620
|
-
if (sameAsSnapshot) {
|
|
55621
|
-
delete next[key];
|
|
55622
|
-
return next;
|
|
55763
|
+
async function writeSetting(row, value, deps) {
|
|
55764
|
+
if (row.detail !== undefined) {
|
|
55765
|
+
return {
|
|
55766
|
+
ok: false,
|
|
55767
|
+
error: `\u2718 ${row.label} \u4E0D\u53EF\u7F16\u8F91`
|
|
55768
|
+
};
|
|
55623
55769
|
}
|
|
55624
|
-
|
|
55625
|
-
|
|
55626
|
-
|
|
55627
|
-
|
|
55628
|
-
|
|
55629
|
-
|
|
55630
|
-
|
|
55631
|
-
|
|
55632
|
-
return draft ? "on" : "off";
|
|
55633
|
-
return String(draft);
|
|
55634
|
-
}
|
|
55635
|
-
function isDirty(drafts) {
|
|
55636
|
-
return Object.keys(drafts).length > 0;
|
|
55637
|
-
}
|
|
55638
|
-
async function commitSettingsDrafts(deps) {
|
|
55639
|
-
const saved = [];
|
|
55640
|
-
const attempted = [];
|
|
55641
|
-
const written = new Set;
|
|
55642
|
-
let document = deps.document;
|
|
55643
|
-
let refreshFailed = false;
|
|
55644
|
-
let liveMerged = deps.merged;
|
|
55645
|
-
for (const row of deps.rows) {
|
|
55646
|
-
const key = draftKey(row);
|
|
55647
|
-
if (written.has(key))
|
|
55648
|
-
continue;
|
|
55649
|
-
const value = deps.drafts[key];
|
|
55650
|
-
if (value === undefined)
|
|
55651
|
-
continue;
|
|
55652
|
-
written.add(key);
|
|
55653
|
-
attempted.push(key);
|
|
55654
|
-
if (row.detail !== undefined) {
|
|
55655
|
-
for (const child of row.detail) {
|
|
55656
|
-
if (deps.drafts[draftKey(child)] !== undefined) {
|
|
55657
|
-
return {
|
|
55658
|
-
ok: false,
|
|
55659
|
-
saved,
|
|
55660
|
-
attempted,
|
|
55661
|
-
error: `\u2718 ${child.label} \u4E0D\u53EF\u7F16\u8F91`,
|
|
55662
|
-
...document !== undefined ? {
|
|
55663
|
-
document
|
|
55664
|
-
} : {}
|
|
55665
|
-
};
|
|
55666
|
-
}
|
|
55667
|
-
}
|
|
55668
|
-
}
|
|
55669
|
-
if (!row.editable || row.write === undefined) {
|
|
55770
|
+
if (!row.editable || row.write === undefined) {
|
|
55771
|
+
return {
|
|
55772
|
+
ok: false,
|
|
55773
|
+
error: `\u2718 ${row.label} \u4E0D\u53EF\u7F16\u8F91`
|
|
55774
|
+
};
|
|
55775
|
+
}
|
|
55776
|
+
if (row.write.via === "config") {
|
|
55777
|
+
if (!deps.local)
|
|
55670
55778
|
return {
|
|
55671
55779
|
ok: false,
|
|
55672
|
-
|
|
55673
|
-
attempted,
|
|
55674
|
-
error: `\u2718 ${row.label} \u4E0D\u53EF\u7F16\u8F91`,
|
|
55675
|
-
...document !== undefined ? {
|
|
55676
|
-
document
|
|
55677
|
-
} : {}
|
|
55780
|
+
error: "\u2718 \u672C\u5730\u504F\u597D\u5F53\u524D\u4E0D\u53EF\u5199"
|
|
55678
55781
|
};
|
|
55679
|
-
|
|
55680
|
-
|
|
55681
|
-
|
|
55682
|
-
return {
|
|
55683
|
-
ok: false,
|
|
55684
|
-
saved,
|
|
55685
|
-
attempted,
|
|
55686
|
-
error: "\u2718 \u672C\u5730\u504F\u597D\u5F53\u524D\u4E0D\u53EF\u5199",
|
|
55687
|
-
...document !== undefined ? {
|
|
55688
|
-
document
|
|
55689
|
-
} : {}
|
|
55690
|
-
};
|
|
55691
|
-
}
|
|
55692
|
-
const hints = footerHintsFromConfig(liveMerged.footerHints) ?? DEFAULT_FOOTER_HINTS;
|
|
55693
|
-
const plan = planLocalWrite(row, value, hints);
|
|
55694
|
-
if (!plan.ok) {
|
|
55695
|
-
return {
|
|
55696
|
-
ok: false,
|
|
55697
|
-
saved,
|
|
55698
|
-
attempted,
|
|
55699
|
-
error: `\u2718 ${plan.error}`,
|
|
55700
|
-
...document !== undefined ? {
|
|
55701
|
-
document
|
|
55702
|
-
} : {}
|
|
55703
|
-
};
|
|
55704
|
-
}
|
|
55705
|
-
try {
|
|
55706
|
-
deps.seam.configSave?.(plan.patch);
|
|
55707
|
-
} catch (error) {
|
|
55708
|
-
return {
|
|
55709
|
-
ok: false,
|
|
55710
|
-
saved,
|
|
55711
|
-
attempted,
|
|
55712
|
-
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`,
|
|
55713
|
-
...document !== undefined ? {
|
|
55714
|
-
document
|
|
55715
|
-
} : {}
|
|
55716
|
-
};
|
|
55717
|
-
}
|
|
55718
|
-
liveMerged = {
|
|
55719
|
-
...liveMerged,
|
|
55720
|
-
...plan.patch
|
|
55721
|
-
};
|
|
55722
|
-
applySettingsLive(row, plan.applied, hints, deps.themes);
|
|
55723
|
-
saved.push(row.label);
|
|
55724
|
-
continue;
|
|
55725
|
-
}
|
|
55726
|
-
if (!deps.host) {
|
|
55782
|
+
const hints = footerHintsFromConfig(deps.merged.footerHints) ?? DEFAULT_FOOTER_HINTS;
|
|
55783
|
+
const plan = planLocalWrite(row, value, hints);
|
|
55784
|
+
if (!plan.ok)
|
|
55727
55785
|
return {
|
|
55728
55786
|
ok: false,
|
|
55729
|
-
|
|
55730
|
-
attempted,
|
|
55731
|
-
error: "\u2718 \u5BBF\u4E3B\u8BBE\u7F6E\u5F53\u524D\u4E0D\u53EF\u5199",
|
|
55732
|
-
...document !== undefined ? {
|
|
55733
|
-
document
|
|
55734
|
-
} : {}
|
|
55787
|
+
error: `\u2718 ${plan.error}`
|
|
55735
55788
|
};
|
|
55736
|
-
|
|
55737
|
-
|
|
55738
|
-
|
|
55789
|
+
try {
|
|
55790
|
+
deps.seam.configSave?.(plan.patch);
|
|
55791
|
+
} catch (error) {
|
|
55739
55792
|
return {
|
|
55740
55793
|
ok: false,
|
|
55741
|
-
|
|
55742
|
-
attempted,
|
|
55743
|
-
error: `\u2718 ${plan.error}`,
|
|
55744
|
-
...document !== undefined ? {
|
|
55745
|
-
document
|
|
55746
|
-
} : {}
|
|
55794
|
+
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`
|
|
55747
55795
|
};
|
|
55748
55796
|
}
|
|
55749
|
-
|
|
55750
|
-
|
|
55751
|
-
|
|
55752
|
-
|
|
55753
|
-
|
|
55754
|
-
|
|
55755
|
-
|
|
55756
|
-
|
|
55757
|
-
|
|
55758
|
-
|
|
55759
|
-
|
|
55760
|
-
}
|
|
55761
|
-
|
|
55762
|
-
|
|
55763
|
-
|
|
55764
|
-
|
|
55765
|
-
|
|
55766
|
-
|
|
55767
|
-
|
|
55768
|
-
|
|
55769
|
-
|
|
55770
|
-
|
|
55771
|
-
|
|
55772
|
-
|
|
55773
|
-
|
|
55774
|
-
|
|
55775
|
-
|
|
55776
|
-
|
|
55777
|
-
|
|
55778
|
-
|
|
55779
|
-
|
|
55780
|
-
|
|
55781
|
-
|
|
55782
|
-
|
|
55783
|
-
|
|
55784
|
-
|
|
55785
|
-
|
|
55786
|
-
|
|
55797
|
+
applySettingsLive(row, plan.applied, hints, deps.themes);
|
|
55798
|
+
return {
|
|
55799
|
+
ok: true,
|
|
55800
|
+
label: row.label,
|
|
55801
|
+
patch: plan.patch
|
|
55802
|
+
};
|
|
55803
|
+
}
|
|
55804
|
+
if (!deps.host)
|
|
55805
|
+
return {
|
|
55806
|
+
ok: false,
|
|
55807
|
+
error: "\u2718 \u5BBF\u4E3B\u8BBE\u7F6E\u5F53\u524D\u4E0D\u53EF\u5199"
|
|
55808
|
+
};
|
|
55809
|
+
const plan = planHostWrite(row, value);
|
|
55810
|
+
if (!plan.ok)
|
|
55811
|
+
return {
|
|
55812
|
+
ok: false,
|
|
55813
|
+
error: `\u2718 ${plan.error}`
|
|
55814
|
+
};
|
|
55815
|
+
const face = deps.seam.settings;
|
|
55816
|
+
if (face === undefined)
|
|
55817
|
+
return {
|
|
55818
|
+
ok: false,
|
|
55819
|
+
error: "\u2718 \u5BBF\u4E3B settings \u63A5\u53E3\u4E0D\u53EF\u7528"
|
|
55820
|
+
};
|
|
55821
|
+
let document = deps.document;
|
|
55822
|
+
let refreshFailed = false;
|
|
55823
|
+
try {
|
|
55824
|
+
const outcome = await commitHostWrite({
|
|
55825
|
+
mutate: (ns, ops, revision) => face.mutate(ns, ops, revision),
|
|
55826
|
+
describe: () => face.describe(),
|
|
55827
|
+
ns: plan.ns,
|
|
55828
|
+
ops: plan.ops,
|
|
55829
|
+
revision: currentHostRevision(document, plan.ns)
|
|
55830
|
+
});
|
|
55831
|
+
if (outcome.document !== undefined)
|
|
55832
|
+
document = outcome.document;
|
|
55833
|
+
if (!outcome.result.ok) {
|
|
55834
|
+
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}`;
|
|
55787
55835
|
return {
|
|
55788
55836
|
ok: false,
|
|
55789
|
-
|
|
55790
|
-
attempted,
|
|
55791
|
-
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`,
|
|
55837
|
+
error: message,
|
|
55792
55838
|
...document !== undefined ? {
|
|
55793
55839
|
document
|
|
55794
55840
|
} : {}
|
|
55795
55841
|
};
|
|
55796
55842
|
}
|
|
55843
|
+
if (outcome.refreshFailed === true)
|
|
55844
|
+
refreshFailed = true;
|
|
55845
|
+
} catch (error) {
|
|
55846
|
+
return {
|
|
55847
|
+
ok: false,
|
|
55848
|
+
error: `\u2718 \u5199\u5165\u5931\u8D25\uFF1A${error instanceof Error ? error.message : String(error)}`
|
|
55849
|
+
};
|
|
55797
55850
|
}
|
|
55798
55851
|
return {
|
|
55799
55852
|
ok: true,
|
|
55800
|
-
|
|
55801
|
-
attempted,
|
|
55853
|
+
label: row.label,
|
|
55802
55854
|
...document !== undefined ? {
|
|
55803
55855
|
document
|
|
55804
55856
|
} : {},
|
|
@@ -55823,15 +55875,17 @@ function bodyPageSize(panelRows) {
|
|
|
55823
55875
|
const rows = Number.isFinite(panelRows) ? Math.floor(panelRows) : 24;
|
|
55824
55876
|
return Math.max(MIN_BODY_PAGE, Math.min(MAX_BODY_PAGE, rows - SETTINGS_FIXED_CHROME_ROWS));
|
|
55825
55877
|
}
|
|
55826
|
-
function rowListItems(rows
|
|
55878
|
+
function rowListItems(rows) {
|
|
55827
55879
|
return rows.map((row) => ({
|
|
55828
55880
|
id: row.id,
|
|
55829
55881
|
label: row.label,
|
|
55830
|
-
description:
|
|
55882
|
+
description: row.value,
|
|
55883
|
+
descriptionTone: "code",
|
|
55831
55884
|
...row.editable ? {
|
|
55832
|
-
badge: "\u270E"
|
|
55885
|
+
badge: "\u270E",
|
|
55886
|
+
badgeTone: "user"
|
|
55833
55887
|
} : {
|
|
55834
|
-
tone: "
|
|
55888
|
+
tone: "system"
|
|
55835
55889
|
},
|
|
55836
55890
|
...row.kind === "jump" ? {
|
|
55837
55891
|
badge: "\u203A"
|
|
@@ -55842,6 +55896,8 @@ function SettingsModalBody(props) {
|
|
|
55842
55896
|
const themeFace = () => props.themes;
|
|
55843
55897
|
const theme = usePanelTheme();
|
|
55844
55898
|
const chrome = () => resolvePanelChrome(theme());
|
|
55899
|
+
const contentBg = () => theme().background.content;
|
|
55900
|
+
const role = (fg) => withContrastFloor(fg, contentBg(), theme().text.base);
|
|
55845
55901
|
const [view, setView] = createSignal("browse");
|
|
55846
55902
|
const [pane, setPane] = createSignal("nav");
|
|
55847
55903
|
const [sectionIndex, setSectionIndex] = createSignal(0);
|
|
@@ -55849,7 +55905,6 @@ function SettingsModalBody(props) {
|
|
|
55849
55905
|
const [editorRow, setEditorRow] = createSignal(undefined);
|
|
55850
55906
|
const [editorValue, setEditorValue] = createSignal("");
|
|
55851
55907
|
const [optionCursor, setOptionCursor] = createSignal(0);
|
|
55852
|
-
const [drafts, setDrafts] = createSignal({});
|
|
55853
55908
|
const [merged, setMerged] = createSignal({});
|
|
55854
55909
|
const [profile, setProfile] = createSignal({});
|
|
55855
55910
|
const [workspace, setWorkspace] = createSignal({});
|
|
@@ -55888,7 +55943,22 @@ function SettingsModalBody(props) {
|
|
|
55888
55943
|
const currentSection = createMemo(() => sections()[sectionIndex()] ?? sections()[0]);
|
|
55889
55944
|
const currentRows = createMemo(() => currentSection().rows);
|
|
55890
55945
|
const currentRow = createMemo(() => currentRows()[rowIndex()]);
|
|
55891
|
-
const
|
|
55946
|
+
const savedLabels = [];
|
|
55947
|
+
let statusTimer;
|
|
55948
|
+
function flashSaved(label) {
|
|
55949
|
+
setStatus(`\u5DF2\u4FDD\u5B58 \xB7 ${label}`);
|
|
55950
|
+
if (statusTimer !== undefined)
|
|
55951
|
+
clearTimeout(statusTimer);
|
|
55952
|
+
statusTimer = setTimeout(() => {
|
|
55953
|
+
statusTimer = undefined;
|
|
55954
|
+
setStatus(undefined);
|
|
55955
|
+
}, 1500);
|
|
55956
|
+
}
|
|
55957
|
+
onCleanup(() => {
|
|
55958
|
+
if (statusTimer !== undefined)
|
|
55959
|
+
clearTimeout(statusTimer);
|
|
55960
|
+
statusTimer = undefined;
|
|
55961
|
+
});
|
|
55892
55962
|
const dimensions = useTerminalDimensions();
|
|
55893
55963
|
const panelRows = createMemo(() => settingsPanelRows(dimensions().height));
|
|
55894
55964
|
const pageSize = createMemo(() => bodyPageSize(panelRows()));
|
|
@@ -55934,14 +56004,16 @@ function SettingsModalBody(props) {
|
|
|
55934
56004
|
setView("browse");
|
|
55935
56005
|
setPane("rows");
|
|
55936
56006
|
setEditorRow(undefined);
|
|
55937
|
-
|
|
56007
|
+
setError(undefined);
|
|
55938
56008
|
}
|
|
55939
56009
|
function openRow(row) {
|
|
55940
56010
|
setError(undefined);
|
|
55941
56011
|
setStatus(undefined);
|
|
55942
56012
|
if (row.kind === "jump") {
|
|
55943
|
-
|
|
56013
|
+
const command = row.command ?? "";
|
|
55944
56014
|
props.onRequestClose();
|
|
56015
|
+
if (command !== "")
|
|
56016
|
+
props.onCommand?.(command);
|
|
55945
56017
|
return;
|
|
55946
56018
|
}
|
|
55947
56019
|
if (row.kind === "toggle") {
|
|
@@ -55949,8 +56021,7 @@ function SettingsModalBody(props) {
|
|
|
55949
56021
|
setStatus(row.note ?? "\u8BE5\u884C\u53EA\u8BFB");
|
|
55950
56022
|
return;
|
|
55951
56023
|
}
|
|
55952
|
-
|
|
55953
|
-
setDrafts((current) => stageDraft(current, row, next));
|
|
56024
|
+
applyRowValue(row, row.value !== "on");
|
|
55954
56025
|
return;
|
|
55955
56026
|
}
|
|
55956
56027
|
if (row.kind === "submenu") {
|
|
@@ -55964,21 +56035,65 @@ function SettingsModalBody(props) {
|
|
|
55964
56035
|
return;
|
|
55965
56036
|
}
|
|
55966
56037
|
setEditorRow(row);
|
|
55967
|
-
setEditorValue(row.kind === "number" && (row.value === "n/a" || row.value === "(unset)") ? "" :
|
|
56038
|
+
setEditorValue(row.kind === "number" && (row.value === "n/a" || row.value === "(unset)") ? "" : row.value);
|
|
55968
56039
|
if (row.kind === "enum") {
|
|
55969
56040
|
const options = row.options ?? [];
|
|
55970
|
-
const at = options.indexOf(
|
|
56041
|
+
const at = options.indexOf(row.value);
|
|
55971
56042
|
setOptionCursor(at >= 0 ? at : 0);
|
|
55972
56043
|
}
|
|
55973
56044
|
setView("editor");
|
|
55974
56045
|
}
|
|
56046
|
+
async function applyRowValue(row, value) {
|
|
56047
|
+
if (busy())
|
|
56048
|
+
return false;
|
|
56049
|
+
setBusy(true);
|
|
56050
|
+
setError(undefined);
|
|
56051
|
+
setStatus(undefined);
|
|
56052
|
+
try {
|
|
56053
|
+
const result = await writeSetting(row, value, {
|
|
56054
|
+
seam: props.seam,
|
|
56055
|
+
...props.themes !== undefined ? {
|
|
56056
|
+
themes: props.themes
|
|
56057
|
+
} : {},
|
|
56058
|
+
merged: merged(),
|
|
56059
|
+
...document() !== undefined ? {
|
|
56060
|
+
document: document()
|
|
56061
|
+
} : {},
|
|
56062
|
+
local: writable().local,
|
|
56063
|
+
host: writable().host
|
|
56064
|
+
});
|
|
56065
|
+
if (result.document !== undefined)
|
|
56066
|
+
setDocument(result.document);
|
|
56067
|
+
if (!result.ok) {
|
|
56068
|
+
setError(result.error ?? "\u2718 \u5199\u5165\u5931\u8D25");
|
|
56069
|
+
return false;
|
|
56070
|
+
}
|
|
56071
|
+
reloadLocal();
|
|
56072
|
+
if (result.patch !== undefined)
|
|
56073
|
+
setMerged((current) => ({
|
|
56074
|
+
...current,
|
|
56075
|
+
...result.patch
|
|
56076
|
+
}));
|
|
56077
|
+
reloadHost();
|
|
56078
|
+
if (result.refreshFailed === true) {
|
|
56079
|
+
setError("\u26A0 \u5DF2\u5199\u5165\uFF0C\u4F46\u8BBE\u7F6E\u5237\u65B0\u5931\u8D25\uFF08\u663E\u793A\u7684\u4ECD\u662F\u65E7\u6587\u6863\uFF09");
|
|
56080
|
+
return true;
|
|
56081
|
+
}
|
|
56082
|
+
savedLabels.push(row.label);
|
|
56083
|
+
flashSaved(row.label);
|
|
56084
|
+
props.onApplied?.([...savedLabels]);
|
|
56085
|
+
return true;
|
|
56086
|
+
} finally {
|
|
56087
|
+
setBusy(false);
|
|
56088
|
+
}
|
|
56089
|
+
}
|
|
55975
56090
|
function moveOptionCursor(delta) {
|
|
55976
56091
|
const options = editorRow()?.options ?? [];
|
|
55977
56092
|
if (options.length === 0)
|
|
55978
56093
|
return;
|
|
55979
56094
|
setOptionCursor((current) => ((current + delta) % options.length + options.length) % options.length);
|
|
55980
56095
|
}
|
|
55981
|
-
function chooseOption() {
|
|
56096
|
+
async function chooseOption() {
|
|
55982
56097
|
const row = editorRow();
|
|
55983
56098
|
if (row === undefined)
|
|
55984
56099
|
return;
|
|
@@ -55986,14 +56101,8 @@ function SettingsModalBody(props) {
|
|
|
55986
56101
|
if (option === undefined)
|
|
55987
56102
|
return;
|
|
55988
56103
|
setEditorValue(option);
|
|
55989
|
-
|
|
55990
|
-
|
|
55991
|
-
}
|
|
55992
|
-
function stageEditorValue(value) {
|
|
55993
|
-
const row = editorRow();
|
|
55994
|
-
if (row === undefined)
|
|
55995
|
-
return;
|
|
55996
|
-
setDrafts((current) => stageDraft(current, row, value));
|
|
56104
|
+
if (await applyRowValue(row, option))
|
|
56105
|
+
backToSection();
|
|
55997
56106
|
}
|
|
55998
56107
|
function stepValue(direction) {
|
|
55999
56108
|
const row = editorRow();
|
|
@@ -56007,9 +56116,8 @@ function SettingsModalBody(props) {
|
|
|
56007
56116
|
if (row.max !== undefined)
|
|
56008
56117
|
next = Math.min(row.max, next);
|
|
56009
56118
|
setEditorValue(String(next));
|
|
56010
|
-
stageEditorValue(next);
|
|
56011
56119
|
}
|
|
56012
|
-
function commitEditor() {
|
|
56120
|
+
async function commitEditor() {
|
|
56013
56121
|
const row = editorRow();
|
|
56014
56122
|
if (row === undefined)
|
|
56015
56123
|
return;
|
|
@@ -56019,110 +56127,34 @@ function SettingsModalBody(props) {
|
|
|
56019
56127
|
setError(`\u2718 ${parsed.error}`);
|
|
56020
56128
|
return;
|
|
56021
56129
|
}
|
|
56022
|
-
|
|
56023
|
-
|
|
56024
|
-
|
|
56130
|
+
if (await applyRowValue(row, parsed.value))
|
|
56131
|
+
backToSection();
|
|
56132
|
+
return;
|
|
56025
56133
|
}
|
|
56026
|
-
|
|
56134
|
+
if (await applyRowValue(row, editorValue()))
|
|
56135
|
+
backToSection();
|
|
56027
56136
|
}
|
|
56028
56137
|
function cancelEditor() {
|
|
56029
|
-
const row = editorRow();
|
|
56030
|
-
if (row !== undefined) {
|
|
56031
|
-
setDrafts((current) => {
|
|
56032
|
-
const next = {
|
|
56033
|
-
...current
|
|
56034
|
-
};
|
|
56035
|
-
delete next[draftKey(row)];
|
|
56036
|
-
return next;
|
|
56037
|
-
});
|
|
56038
|
-
}
|
|
56039
56138
|
backToSection();
|
|
56040
56139
|
}
|
|
56041
|
-
function discardAndClose() {
|
|
56042
|
-
setDrafts({});
|
|
56043
|
-
props.onRequestClose();
|
|
56044
|
-
}
|
|
56045
56140
|
const panels = usePanels();
|
|
56046
|
-
let
|
|
56047
|
-
async function
|
|
56048
|
-
if (
|
|
56049
|
-
discardAndClose();
|
|
56050
|
-
return;
|
|
56051
|
-
}
|
|
56052
|
-
if (confirmingDiscard)
|
|
56141
|
+
let confirmingExit = false;
|
|
56142
|
+
async function requestExitConfirm() {
|
|
56143
|
+
if (confirmingExit)
|
|
56053
56144
|
return;
|
|
56054
|
-
|
|
56145
|
+
confirmingExit = true;
|
|
56055
56146
|
try {
|
|
56056
|
-
const
|
|
56057
|
-
|
|
56058
|
-
|
|
56059
|
-
|
|
56060
|
-
|
|
56061
|
-
|
|
56062
|
-
destructive: true,
|
|
56063
|
-
tone: "danger"
|
|
56147
|
+
const exit = await panels.confirm({
|
|
56148
|
+
title: "\u9000\u51FA\u8BBE\u7F6E\uFF1F",
|
|
56149
|
+
message: "\u6240\u6709\u6539\u52A8\u5DF2\u5373\u65F6\u4FDD\u5B58\u3002",
|
|
56150
|
+
confirmLabel: "\u786E\u8BA4\u9000\u51FA",
|
|
56151
|
+
cancelLabel: "\u8FD4\u56DE",
|
|
56152
|
+
destructive: true
|
|
56064
56153
|
});
|
|
56065
|
-
if (
|
|
56066
|
-
|
|
56154
|
+
if (exit)
|
|
56155
|
+
props.onRequestClose();
|
|
56067
56156
|
} catch {} finally {
|
|
56068
|
-
|
|
56069
|
-
}
|
|
56070
|
-
}
|
|
56071
|
-
async function confirm() {
|
|
56072
|
-
if (busy())
|
|
56073
|
-
return;
|
|
56074
|
-
if (!dirty()) {
|
|
56075
|
-
props.onRequestClose();
|
|
56076
|
-
return;
|
|
56077
|
-
}
|
|
56078
|
-
setBusy(true);
|
|
56079
|
-
setError(undefined);
|
|
56080
|
-
try {
|
|
56081
|
-
const result = await commitSettingsDrafts({
|
|
56082
|
-
seam: props.seam,
|
|
56083
|
-
...props.themes !== undefined ? {
|
|
56084
|
-
themes: props.themes
|
|
56085
|
-
} : {},
|
|
56086
|
-
rows: sections().flatMap((section) => section.rows),
|
|
56087
|
-
drafts: drafts(),
|
|
56088
|
-
merged: merged(),
|
|
56089
|
-
...document() !== undefined ? {
|
|
56090
|
-
document: document()
|
|
56091
|
-
} : {},
|
|
56092
|
-
local: writable().local,
|
|
56093
|
-
host: writable().host
|
|
56094
|
-
});
|
|
56095
|
-
if (result.document !== undefined)
|
|
56096
|
-
setDocument(result.document);
|
|
56097
|
-
if (!result.ok) {
|
|
56098
|
-
const attempted = new Set(result.attempted);
|
|
56099
|
-
reloadLocal();
|
|
56100
|
-
await reloadHost();
|
|
56101
|
-
setDrafts((current) => {
|
|
56102
|
-
const next = {};
|
|
56103
|
-
for (const [key, value] of Object.entries(current)) {
|
|
56104
|
-
if (!attempted.has(key))
|
|
56105
|
-
next[key] = value;
|
|
56106
|
-
}
|
|
56107
|
-
return next;
|
|
56108
|
-
});
|
|
56109
|
-
setError(result.error ?? "\u2718 \u5199\u5165\u5931\u8D25");
|
|
56110
|
-
return;
|
|
56111
|
-
}
|
|
56112
|
-
setDrafts({});
|
|
56113
|
-
reloadLocal();
|
|
56114
|
-
await reloadHost();
|
|
56115
|
-
if (result.refreshFailed === true) {
|
|
56116
|
-
setError("\u26A0 \u5DF2\u5199\u5165\uFF0C\u4F46\u8BBE\u7F6E\u5237\u65B0\u5931\u8D25\uFF08\u663E\u793A\u7684\u4ECD\u662F\u65E7\u6587\u6863\uFF09");
|
|
56117
|
-
return;
|
|
56118
|
-
}
|
|
56119
|
-
if (result.saved.length > 0) {
|
|
56120
|
-
setStatus(settingsSummary(result.saved));
|
|
56121
|
-
props.onApplied?.(result.saved);
|
|
56122
|
-
}
|
|
56123
|
-
props.onRequestClose();
|
|
56124
|
-
} finally {
|
|
56125
|
-
setBusy(false);
|
|
56157
|
+
confirmingExit = false;
|
|
56126
56158
|
}
|
|
56127
56159
|
}
|
|
56128
56160
|
const registerKeys = useControlKeys();
|
|
@@ -56227,7 +56259,7 @@ function SettingsModalBody(props) {
|
|
|
56227
56259
|
escape: () => {
|
|
56228
56260
|
const next = settingsBackView(view());
|
|
56229
56261
|
if (next === "close") {
|
|
56230
|
-
|
|
56262
|
+
requestExitConfirm();
|
|
56231
56263
|
return true;
|
|
56232
56264
|
}
|
|
56233
56265
|
backToSection();
|
|
@@ -56281,14 +56313,6 @@ function SettingsModalBody(props) {
|
|
|
56281
56313
|
title: "Settings: last row",
|
|
56282
56314
|
group: "Settings",
|
|
56283
56315
|
run: () => pageRows("end")
|
|
56284
|
-
}, {
|
|
56285
|
-
bind: "ctrl+s",
|
|
56286
|
-
title: "Settings: commit",
|
|
56287
|
-
group: "Settings",
|
|
56288
|
-
run: () => {
|
|
56289
|
-
confirm();
|
|
56290
|
-
return true;
|
|
56291
|
-
}
|
|
56292
56316
|
}]
|
|
56293
56317
|
}));
|
|
56294
56318
|
onMount(() => {
|
|
@@ -56315,10 +56339,12 @@ function SettingsModalBody(props) {
|
|
|
56315
56339
|
const navItems = createMemo(() => sections().map((section) => ({
|
|
56316
56340
|
id: section.id,
|
|
56317
56341
|
label: section.label,
|
|
56318
|
-
description: `${section.rows.length}
|
|
56342
|
+
description: `${section.rows.length}`,
|
|
56343
|
+
descriptionTone: "system",
|
|
56344
|
+
descriptionAlign: "right"
|
|
56319
56345
|
})));
|
|
56320
56346
|
const rowWidth = () => settingsRowWidth(dimensions().width, dimensions().height);
|
|
56321
|
-
const rowItems = createMemo(() => rowListItems(visibleRows()
|
|
56347
|
+
const rowItems = createMemo(() => rowListItems(visibleRows()));
|
|
56322
56348
|
const activeRowId = () => currentRow()?.id;
|
|
56323
56349
|
const pageIndicator = () => {
|
|
56324
56350
|
const total = currentRows().length;
|
|
@@ -56329,7 +56355,7 @@ function SettingsModalBody(props) {
|
|
|
56329
56355
|
return ` ${start + 1}-${Math.min(start + size, total)}/${total}`;
|
|
56330
56356
|
};
|
|
56331
56357
|
return (() => {
|
|
56332
|
-
var _el$ = createElement("box"), _el$0 = createElement("box"), _el$1 = createElement("box"), _el$10 = createElement("
|
|
56358
|
+
var _el$ = createElement("box"), _el$0 = createElement("box"), _el$1 = createElement("box"), _el$10 = createElement("text"), _el$12 = createElement("text");
|
|
56333
56359
|
insertNode(_el$, _el$0);
|
|
56334
56360
|
setProp(_el$, "flexDirection", "column");
|
|
56335
56361
|
setProp(_el$, "flexGrow", 1);
|
|
@@ -56401,13 +56427,13 @@ function SettingsModalBody(props) {
|
|
|
56401
56427
|
get children() {
|
|
56402
56428
|
var _el$8 = createElement("text");
|
|
56403
56429
|
insert(_el$8, () => ` ${currentRow().note}`);
|
|
56404
|
-
effect((_$p) => setProp(_el$8, "fg", theme().text.muted, _$p));
|
|
56430
|
+
effect((_$p) => setProp(_el$8, "fg", role(theme().text.muted), _$p));
|
|
56405
56431
|
return _el$8;
|
|
56406
56432
|
}
|
|
56407
56433
|
}), (() => {
|
|
56408
56434
|
var _el$9 = createElement("text");
|
|
56409
56435
|
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()}`);
|
|
56410
|
-
effect((_$p) => setProp(_el$9, "fg", theme().text.muted, _$p));
|
|
56436
|
+
effect((_$p) => setProp(_el$9, "fg", role(theme().text.muted), _$p));
|
|
56411
56437
|
return _el$9;
|
|
56412
56438
|
})()];
|
|
56413
56439
|
}
|
|
@@ -56431,84 +56457,68 @@ function SettingsModalBody(props) {
|
|
|
56431
56457
|
return Math.max(1, pageSize() - 2);
|
|
56432
56458
|
},
|
|
56433
56459
|
onValue: setEditorValue,
|
|
56434
|
-
onStage: stageEditorValue,
|
|
56435
56460
|
onStep: stepValue,
|
|
56436
|
-
onCommit: commitEditor,
|
|
56461
|
+
onCommit: () => void commitEditor(),
|
|
56437
56462
|
onCancel: cancelEditor
|
|
56438
56463
|
});
|
|
56439
56464
|
}
|
|
56440
56465
|
}), null);
|
|
56441
56466
|
effect((_p$) => {
|
|
56442
|
-
var _v$ = chrome().navBand, _v$2 = chrome().divider, _v$3 = chrome().titleBand, _v$
|
|
56467
|
+
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);
|
|
56443
56468
|
_v$ !== _p$.e && (_p$.e = setProp(_el$3, "backgroundColor", _v$, _p$.e));
|
|
56444
56469
|
_v$2 !== _p$.t && (_p$.t = setProp(_el$4, "backgroundColor", _v$2, _p$.t));
|
|
56445
|
-
_v$3 !== _p$.a && (_p$.a = setProp(_el$
|
|
56446
|
-
_v$4 !== _p$.o && (_p$.o = setProp(_el$
|
|
56447
|
-
_v$5 !== _p$.i && (_p$.i = setProp(_el$7, "
|
|
56470
|
+
_v$3 !== _p$.a && (_p$.a = setProp(_el$5, "backgroundColor", _v$3, _p$.a));
|
|
56471
|
+
_v$4 !== _p$.o && (_p$.o = setProp(_el$6, "backgroundColor", _v$4, _p$.o));
|
|
56472
|
+
_v$5 !== _p$.i && (_p$.i = setProp(_el$7, "attributes", _v$5, _p$.i));
|
|
56473
|
+
_v$6 !== _p$.n && (_p$.n = setProp(_el$7, "fg", _v$6, _p$.n));
|
|
56448
56474
|
return _p$;
|
|
56449
56475
|
}, {
|
|
56450
56476
|
e: undefined,
|
|
56451
56477
|
t: undefined,
|
|
56452
56478
|
a: undefined,
|
|
56453
56479
|
o: undefined,
|
|
56454
|
-
i: undefined
|
|
56480
|
+
i: undefined,
|
|
56481
|
+
n: undefined
|
|
56455
56482
|
});
|
|
56456
56483
|
return _el$2;
|
|
56457
56484
|
}
|
|
56458
56485
|
}), _el$0);
|
|
56459
56486
|
insertNode(_el$0, _el$1);
|
|
56460
56487
|
insertNode(_el$0, _el$12);
|
|
56461
|
-
setProp(_el$0, "flexDirection", "
|
|
56488
|
+
setProp(_el$0, "flexDirection", "row");
|
|
56489
|
+
setProp(_el$0, "justifyContent", "space-between");
|
|
56462
56490
|
setProp(_el$0, "flexShrink", 0);
|
|
56491
|
+
setProp(_el$0, "gap", 2);
|
|
56463
56492
|
insertNode(_el$1, _el$10);
|
|
56464
|
-
insertNode(_el$1, _el$11);
|
|
56465
|
-
setProp(_el$1, "flexDirection", "row");
|
|
56466
|
-
setProp(_el$1, "justifyContent", "space-between");
|
|
56467
56493
|
setProp(_el$1, "flexShrink", 0);
|
|
56468
|
-
setProp(_el$1, "
|
|
56469
|
-
setProp(_el$
|
|
56470
|
-
|
|
56471
|
-
setProp(_el$10, "
|
|
56472
|
-
|
|
56473
|
-
|
|
56474
|
-
keyHint: "esc",
|
|
56475
|
-
variant: "ghost",
|
|
56476
|
-
onPress: () => void requestDiscardOrClose()
|
|
56477
|
-
}));
|
|
56478
|
-
setProp(_el$11, "flexShrink", 0);
|
|
56479
|
-
setProp(_el$11, "border", ["left", "right"]);
|
|
56480
|
-
setProp(_el$11, "borderStyle", "single");
|
|
56481
|
-
insert(_el$11, createComponent2(Button, {
|
|
56482
|
-
label: "\u786E\u5B9A",
|
|
56483
|
-
keyHint: "ctrl+s",
|
|
56484
|
-
variant: "primary",
|
|
56485
|
-
get disabled() {
|
|
56486
|
-
return busy();
|
|
56487
|
-
},
|
|
56488
|
-
onPress: () => void confirm()
|
|
56489
|
-
}));
|
|
56490
|
-
insertNode(_el$12, _el$13);
|
|
56491
|
-
setProp(_el$12, "flexDirection", "row");
|
|
56492
|
-
setProp(_el$12, "justifyContent", "flex-end");
|
|
56493
|
-
setProp(_el$13, "wrapMode", "none");
|
|
56494
|
-
insert(_el$13, () => error() ?? status() ?? (dirty() ? `\u672A\u63D0\u4EA4\uFF1A${Object.keys(drafts()).length} \u9879 \xB7 \u786E\u5B9A\u63D0\u4EA4 / \u53D6\u6D88\u4E22\u5F03` : "\u65E0\u672A\u63D0\u4EA4\u6539\u52A8"));
|
|
56494
|
+
setProp(_el$1, "border", ["left", "right"]);
|
|
56495
|
+
setProp(_el$1, "borderStyle", "single");
|
|
56496
|
+
insertNode(_el$10, createTextNode(`esc \u8FD4\u56DE`));
|
|
56497
|
+
setProp(_el$10, "wrapMode", "none");
|
|
56498
|
+
setProp(_el$12, "wrapMode", "none");
|
|
56499
|
+
insert(_el$12, () => error() ?? status() ?? "\u6539\u52A8\u5DF2\u5373\u65F6\u4FDD\u5B58");
|
|
56495
56500
|
effect((_p$) => {
|
|
56496
|
-
var _v$
|
|
56497
|
-
_v$
|
|
56498
|
-
_v$
|
|
56499
|
-
_v$
|
|
56500
|
-
_v$
|
|
56501
|
+
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;
|
|
56502
|
+
_v$7 !== _p$.e && (_p$.e = setProp(_el$1, "borderColor", _v$7, _p$.e));
|
|
56503
|
+
_v$8 !== _p$.t && (_p$.t = setProp(_el$10, "fg", _v$8, _p$.t));
|
|
56504
|
+
_v$9 !== _p$.a && (_p$.a = setProp(_el$10, "attributes", _v$9, _p$.a));
|
|
56505
|
+
_v$0 !== _p$.o && (_p$.o = setProp(_el$12, "fg", _v$0, _p$.o));
|
|
56506
|
+
_v$1 !== _p$.i && (_p$.i = setProp(_el$12, "attributes", _v$1, _p$.i));
|
|
56501
56507
|
return _p$;
|
|
56502
56508
|
}, {
|
|
56503
56509
|
e: undefined,
|
|
56504
56510
|
t: undefined,
|
|
56505
56511
|
a: undefined,
|
|
56506
|
-
o: undefined
|
|
56512
|
+
o: undefined,
|
|
56513
|
+
i: undefined
|
|
56507
56514
|
});
|
|
56508
56515
|
return _el$;
|
|
56509
56516
|
})();
|
|
56510
56517
|
}
|
|
56511
56518
|
function EditorView(props) {
|
|
56519
|
+
const theme = usePanelTheme();
|
|
56520
|
+
const contentBg = () => theme().background.content;
|
|
56521
|
+
const role = (fg) => withContrastFloor(fg, contentBg(), theme().text.base);
|
|
56512
56522
|
let catcher;
|
|
56513
56523
|
const options = () => props.row.options ?? [];
|
|
56514
56524
|
const optionLimit = () => Math.max(1, props.optionRows);
|
|
@@ -56529,23 +56539,24 @@ function EditorView(props) {
|
|
|
56529
56539
|
return ` ${start + 1}-${Math.min(start + limit, total)}/${total}`;
|
|
56530
56540
|
};
|
|
56531
56541
|
return (() => {
|
|
56532
|
-
var _el$
|
|
56533
|
-
insertNode(_el$
|
|
56534
|
-
insertNode(_el$
|
|
56535
|
-
setProp(_el$
|
|
56536
|
-
setProp(_el$
|
|
56537
|
-
insert(_el$
|
|
56538
|
-
insert(_el$
|
|
56542
|
+
var _el$13 = createElement("box"), _el$14 = createElement("text"), _el$22 = createElement("text");
|
|
56543
|
+
insertNode(_el$13, _el$14);
|
|
56544
|
+
insertNode(_el$13, _el$22);
|
|
56545
|
+
setProp(_el$13, "flexDirection", "column");
|
|
56546
|
+
setProp(_el$13, "flexGrow", 1);
|
|
56547
|
+
insert(_el$14, () => `${props.row.label} \u2014 ${props.row.kind === "number" ? "\u8F93\u5165\u6574\u6570" : props.row.kind === "enum" ? "\u9009\u62E9\u503C" : "\u67E5\u770B"}`);
|
|
56548
|
+
insert(_el$13, createComponent2(Show, {
|
|
56539
56549
|
get when() {
|
|
56540
56550
|
return props.row.note !== undefined;
|
|
56541
56551
|
},
|
|
56542
56552
|
get children() {
|
|
56543
|
-
var _el$
|
|
56544
|
-
insert(_el$
|
|
56545
|
-
|
|
56553
|
+
var _el$15 = createElement("text");
|
|
56554
|
+
insert(_el$15, () => ` ${props.row.note}`);
|
|
56555
|
+
effect((_$p) => setProp(_el$15, "fg", role(theme().text.system), _$p));
|
|
56556
|
+
return _el$15;
|
|
56546
56557
|
}
|
|
56547
|
-
}), _el$
|
|
56548
|
-
insert(_el$
|
|
56558
|
+
}), _el$22);
|
|
56559
|
+
insert(_el$13, createComponent2(Show, {
|
|
56549
56560
|
get when() {
|
|
56550
56561
|
return props.row.kind === "submenu";
|
|
56551
56562
|
},
|
|
@@ -56555,92 +56566,133 @@ function EditorView(props) {
|
|
|
56555
56566
|
return props.row.detail ?? [];
|
|
56556
56567
|
},
|
|
56557
56568
|
children: (child) => (() => {
|
|
56558
|
-
var _el$
|
|
56559
|
-
insertNode(_el$
|
|
56560
|
-
setProp(_el$
|
|
56561
|
-
insert(_el$
|
|
56562
|
-
insert(_el$
|
|
56569
|
+
var _el$23 = createElement("box"), _el$24 = createElement("text");
|
|
56570
|
+
insertNode(_el$23, _el$24);
|
|
56571
|
+
setProp(_el$23, "flexDirection", "column");
|
|
56572
|
+
insert(_el$24, () => ` ${child.label} ${child.value}`);
|
|
56573
|
+
insert(_el$23, createComponent2(Show, {
|
|
56563
56574
|
get when() {
|
|
56564
56575
|
return child.note !== undefined;
|
|
56565
56576
|
},
|
|
56566
56577
|
get children() {
|
|
56567
|
-
var _el$
|
|
56568
|
-
insert(_el$
|
|
56569
|
-
|
|
56578
|
+
var _el$25 = createElement("text");
|
|
56579
|
+
insert(_el$25, () => ` ${child.note}`);
|
|
56580
|
+
effect((_$p) => setProp(_el$25, "fg", role(theme().text.system), _$p));
|
|
56581
|
+
return _el$25;
|
|
56570
56582
|
}
|
|
56571
56583
|
}), null);
|
|
56572
|
-
|
|
56584
|
+
effect((_$p) => setProp(_el$24, "fg", role(theme().text.base), _$p));
|
|
56585
|
+
return _el$23;
|
|
56573
56586
|
})()
|
|
56574
56587
|
});
|
|
56575
56588
|
}
|
|
56576
|
-
}), _el$
|
|
56577
|
-
insert(_el$
|
|
56589
|
+
}), _el$22);
|
|
56590
|
+
insert(_el$13, createComponent2(Show, {
|
|
56578
56591
|
get when() {
|
|
56579
56592
|
return props.row.kind === "enum";
|
|
56580
56593
|
},
|
|
56581
56594
|
get children() {
|
|
56582
|
-
var _el$
|
|
56583
|
-
setProp(_el$
|
|
56584
|
-
insert(_el$
|
|
56595
|
+
var _el$16 = createElement("box");
|
|
56596
|
+
setProp(_el$16, "flexDirection", "column");
|
|
56597
|
+
insert(_el$16, createComponent2(For, {
|
|
56585
56598
|
get each() {
|
|
56586
56599
|
return visibleOptions();
|
|
56587
56600
|
},
|
|
56588
56601
|
children: (option, index) => (() => {
|
|
56589
|
-
var _el$
|
|
56590
|
-
insertNode(_el$
|
|
56591
|
-
|
|
56592
|
-
setProp(_el$
|
|
56602
|
+
var _el$26 = createElement("box"), _el$27 = createElement("text"), _el$28 = createElement("text");
|
|
56603
|
+
insertNode(_el$26, _el$27);
|
|
56604
|
+
insertNode(_el$26, _el$28);
|
|
56605
|
+
setProp(_el$26, "flexDirection", "row");
|
|
56606
|
+
setProp(_el$26, "onMouseUp", () => {
|
|
56593
56607
|
props.onValue(option);
|
|
56594
56608
|
props.onCommit();
|
|
56595
56609
|
});
|
|
56596
|
-
insert(_el$
|
|
56597
|
-
|
|
56610
|
+
insert(_el$27, () => optionStart() + index() === props.cursor ? "\u25B8 " : " ");
|
|
56611
|
+
insert(_el$28, option);
|
|
56612
|
+
insert(_el$26, createComponent2(Show, {
|
|
56613
|
+
get when() {
|
|
56614
|
+
return option === props.row.value;
|
|
56615
|
+
},
|
|
56616
|
+
get children() {
|
|
56617
|
+
var _el$29 = createElement("text");
|
|
56618
|
+
insertNode(_el$29, createTextNode(` (current)`));
|
|
56619
|
+
effect((_$p) => setProp(_el$29, "fg", role(theme().text.system), _$p));
|
|
56620
|
+
return _el$29;
|
|
56621
|
+
}
|
|
56622
|
+
}), null);
|
|
56623
|
+
effect((_p$) => {
|
|
56624
|
+
var _v$15 = role(theme().text.accent), _v$16 = role(theme().text.code);
|
|
56625
|
+
_v$15 !== _p$.e && (_p$.e = setProp(_el$27, "fg", _v$15, _p$.e));
|
|
56626
|
+
_v$16 !== _p$.t && (_p$.t = setProp(_el$28, "fg", _v$16, _p$.t));
|
|
56627
|
+
return _p$;
|
|
56628
|
+
}, {
|
|
56629
|
+
e: undefined,
|
|
56630
|
+
t: undefined
|
|
56631
|
+
});
|
|
56632
|
+
return _el$26;
|
|
56598
56633
|
})()
|
|
56599
56634
|
}), null);
|
|
56600
|
-
insert(_el$
|
|
56635
|
+
insert(_el$16, createComponent2(Show, {
|
|
56601
56636
|
get when() {
|
|
56602
56637
|
return optionIndicator() !== "";
|
|
56603
56638
|
},
|
|
56604
56639
|
get children() {
|
|
56605
|
-
var _el$
|
|
56606
|
-
insert(_el$
|
|
56607
|
-
|
|
56640
|
+
var _el$17 = createElement("text");
|
|
56641
|
+
insert(_el$17, optionIndicator);
|
|
56642
|
+
effect((_$p) => setProp(_el$17, "fg", role(theme().text.system), _$p));
|
|
56643
|
+
return _el$17;
|
|
56608
56644
|
}
|
|
56609
56645
|
}), null);
|
|
56610
|
-
return _el$
|
|
56646
|
+
return _el$16;
|
|
56611
56647
|
}
|
|
56612
|
-
}), _el$
|
|
56613
|
-
insert(_el$
|
|
56648
|
+
}), _el$22);
|
|
56649
|
+
insert(_el$13, createComponent2(Show, {
|
|
56614
56650
|
get when() {
|
|
56615
56651
|
return props.row.kind === "number" || props.row.kind === "text";
|
|
56616
56652
|
},
|
|
56617
56653
|
get children() {
|
|
56618
|
-
var _el$
|
|
56619
|
-
insertNode(_el$
|
|
56620
|
-
insertNode(_el$
|
|
56621
|
-
insertNode(_el$
|
|
56622
|
-
setProp(_el$
|
|
56623
|
-
insert(_el$
|
|
56624
|
-
insert(_el$
|
|
56654
|
+
var _el$18 = createElement("box"), _el$19 = createElement("text"), _el$20 = createElement("text"), _el$21 = createElement("input");
|
|
56655
|
+
insertNode(_el$18, _el$19);
|
|
56656
|
+
insertNode(_el$18, _el$20);
|
|
56657
|
+
insertNode(_el$18, _el$21);
|
|
56658
|
+
setProp(_el$18, "flexDirection", "row");
|
|
56659
|
+
insert(_el$19, () => `${props.row.kind === "number" ? "\u6570\u503C" : "\u503C"}: `);
|
|
56660
|
+
insert(_el$20, () => props.value);
|
|
56625
56661
|
use((renderable) => {
|
|
56626
56662
|
catcher = renderable;
|
|
56627
56663
|
setTimeout(() => {
|
|
56628
56664
|
if (catcher !== undefined && catcher.isDestroyed !== true)
|
|
56629
56665
|
catcher.focus();
|
|
56630
56666
|
}, 1);
|
|
56631
|
-
}, _el$
|
|
56632
|
-
setProp(_el$
|
|
56633
|
-
setProp(_el$
|
|
56634
|
-
|
|
56635
|
-
|
|
56667
|
+
}, _el$21);
|
|
56668
|
+
setProp(_el$21, "flexGrow", 1);
|
|
56669
|
+
setProp(_el$21, "onInput", (next) => props.onValue(next));
|
|
56670
|
+
setProp(_el$21, "onSubmit", () => props.onCommit());
|
|
56671
|
+
effect((_p$) => {
|
|
56672
|
+
var _v$10 = role(theme().text.muted), _v$11 = role(theme().text.code), _v$12 = props.value;
|
|
56673
|
+
_v$10 !== _p$.e && (_p$.e = setProp(_el$19, "fg", _v$10, _p$.e));
|
|
56674
|
+
_v$11 !== _p$.t && (_p$.t = setProp(_el$20, "fg", _v$11, _p$.t));
|
|
56675
|
+
_v$12 !== _p$.a && (_p$.a = setProp(_el$21, "value", _v$12, _p$.a));
|
|
56676
|
+
return _p$;
|
|
56677
|
+
}, {
|
|
56678
|
+
e: undefined,
|
|
56679
|
+
t: undefined,
|
|
56680
|
+
a: undefined
|
|
56636
56681
|
});
|
|
56637
|
-
|
|
56638
|
-
effect((_$p) => setProp(_el$22, "value", props.value, _$p));
|
|
56639
|
-
return _el$19;
|
|
56682
|
+
return _el$18;
|
|
56640
56683
|
}
|
|
56641
|
-
}), _el$
|
|
56642
|
-
insert(_el$
|
|
56643
|
-
|
|
56684
|
+
}), _el$22);
|
|
56685
|
+
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");
|
|
56686
|
+
effect((_p$) => {
|
|
56687
|
+
var _v$13 = role(theme().text.heading), _v$14 = role(theme().text.faint);
|
|
56688
|
+
_v$13 !== _p$.e && (_p$.e = setProp(_el$14, "fg", _v$13, _p$.e));
|
|
56689
|
+
_v$14 !== _p$.t && (_p$.t = setProp(_el$22, "fg", _v$14, _p$.t));
|
|
56690
|
+
return _p$;
|
|
56691
|
+
}, {
|
|
56692
|
+
e: undefined,
|
|
56693
|
+
t: undefined
|
|
56694
|
+
});
|
|
56695
|
+
return _el$13;
|
|
56644
56696
|
})();
|
|
56645
56697
|
}
|
|
56646
56698
|
function SettingsModalHost(props) {
|
|
@@ -56679,7 +56731,7 @@ function SettingsModalHost(props) {
|
|
|
56679
56731
|
})), {
|
|
56680
56732
|
id: "settings-modal",
|
|
56681
56733
|
title: "Settings",
|
|
56682
|
-
subtitle: "\u5206\u8282\u5BFC\u822A \xB7
|
|
56734
|
+
subtitle: "\u5206\u8282\u5BFC\u822A \xB7 \u5373\u65F6\u4FDD\u5B58 \xB7 Esc \u9010\u5C42\u8FD4\u56DE",
|
|
56683
56735
|
size: "xlarge",
|
|
56684
56736
|
rows: settingsPanelRows(dimensions().height),
|
|
56685
56737
|
layered: true,
|
|
@@ -56694,10 +56746,10 @@ function SettingsModalHost(props) {
|
|
|
56694
56746
|
setOpen(true);
|
|
56695
56747
|
});
|
|
56696
56748
|
return (() => {
|
|
56697
|
-
var _el$
|
|
56698
|
-
setProp(_el$
|
|
56699
|
-
setProp(_el$
|
|
56700
|
-
return _el$
|
|
56749
|
+
var _el$31 = createElement("box");
|
|
56750
|
+
setProp(_el$31, "height", 0);
|
|
56751
|
+
setProp(_el$31, "flexShrink", 0);
|
|
56752
|
+
return _el$31;
|
|
56701
56753
|
})();
|
|
56702
56754
|
}
|
|
56703
56755
|
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;
|
|
@@ -56711,6 +56763,7 @@ var init_settings_modal = __esm(() => {
|
|
|
56711
56763
|
init_index_bun();
|
|
56712
56764
|
init_index_bun();
|
|
56713
56765
|
init_index_bun();
|
|
56766
|
+
init_index_bun();
|
|
56714
56767
|
init_server();
|
|
56715
56768
|
init_index_bun();
|
|
56716
56769
|
init_src2();
|
|
@@ -57056,29 +57109,60 @@ function createClipboardAdapter(clipboard) {
|
|
|
57056
57109
|
}
|
|
57057
57110
|
var init_clipboard2 = () => {};
|
|
57058
57111
|
|
|
57112
|
+
// ../tui-base/src/theme/contrast.ts
|
|
57113
|
+
function relativeLuminance3(color) {
|
|
57114
|
+
const [r, g, b] = color.toInts();
|
|
57115
|
+
const channel = (value) => {
|
|
57116
|
+
const c = value / 255;
|
|
57117
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
57118
|
+
};
|
|
57119
|
+
return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
|
|
57120
|
+
}
|
|
57121
|
+
function contrastRatio3(a, b) {
|
|
57122
|
+
const la = relativeLuminance3(a);
|
|
57123
|
+
const lb = relativeLuminance3(b);
|
|
57124
|
+
const hi = Math.max(la, lb);
|
|
57125
|
+
const lo = Math.min(la, lb);
|
|
57126
|
+
return (hi + 0.05) / (lo + 0.05);
|
|
57127
|
+
}
|
|
57128
|
+
function ensureContrast(foreground, background, min = 4.5, fallback = foreground) {
|
|
57129
|
+
return contrastRatio3(foreground, background) >= min ? foreground : fallback;
|
|
57130
|
+
}
|
|
57131
|
+
|
|
57059
57132
|
// ../tui-base/src/context/panel-kit-host.tsx
|
|
57060
57133
|
import { RGBA as RGBA15, TextAttributes as TextAttributes12 } from "@opentui/core";
|
|
57061
57134
|
function projectPanelTheme(theme) {
|
|
57062
57135
|
const primary = theme.text.action.primary;
|
|
57136
|
+
const raised = theme.background.raised;
|
|
57137
|
+
const markdown = theme.markdown;
|
|
57138
|
+
const feedback = theme.text.feedback;
|
|
57139
|
+
const interactive = theme.hue.interactive;
|
|
57140
|
+
const content = raised?.base ?? theme.background.base;
|
|
57141
|
+
const readable = (color) => ensureContrast(color, content, 4.5, theme.text.base);
|
|
57063
57142
|
return {
|
|
57064
57143
|
background: {
|
|
57065
57144
|
surface: theme.background.base,
|
|
57066
|
-
raised: theme.background.
|
|
57145
|
+
raised: raised?.high ?? theme.background.base,
|
|
57146
|
+
content,
|
|
57067
57147
|
scrim: RGBA15.fromInts(0, 0, 0, 150)
|
|
57068
57148
|
},
|
|
57069
57149
|
text: {
|
|
57070
57150
|
base: theme.text.base,
|
|
57071
|
-
muted: theme.text.muted,
|
|
57072
|
-
faint: theme.text.faint,
|
|
57073
|
-
accent:
|
|
57074
|
-
disabled: primary.
|
|
57075
|
-
danger: theme.text.
|
|
57076
|
-
warning: theme.text.
|
|
57077
|
-
success: theme.text.
|
|
57151
|
+
muted: readable(theme.text.muted),
|
|
57152
|
+
faint: readable(theme.text.faint),
|
|
57153
|
+
accent: readable(interactive?.[500] ?? theme.text.base),
|
|
57154
|
+
disabled: primary?.disabled ?? theme.text.muted,
|
|
57155
|
+
danger: readable(feedback?.error?.base ?? theme.text.base),
|
|
57156
|
+
warning: readable(feedback?.warning?.base ?? theme.text.base),
|
|
57157
|
+
success: readable(feedback?.success?.base ?? theme.text.base),
|
|
57158
|
+
code: readable(markdown?.code ?? theme.text.base),
|
|
57159
|
+
user: readable(primary?.base ?? theme.text.base),
|
|
57160
|
+
system: readable(feedback?.info?.base ?? theme.text.muted),
|
|
57161
|
+
heading: readable(markdown?.heading ?? theme.text.base)
|
|
57078
57162
|
},
|
|
57079
57163
|
row: {
|
|
57080
57164
|
activeBg: theme.background.action.primary.focused,
|
|
57081
|
-
activeFg: primary.
|
|
57165
|
+
activeFg: primary?.focused ?? theme.text.base
|
|
57082
57166
|
},
|
|
57083
57167
|
border: {
|
|
57084
57168
|
base: {
|
|
@@ -57087,11 +57171,11 @@ function projectPanelTheme(theme) {
|
|
|
57087
57171
|
},
|
|
57088
57172
|
focused: {
|
|
57089
57173
|
style: "heavy",
|
|
57090
|
-
color: theme.border.base
|
|
57174
|
+
color: interactive?.[500] ?? theme.border.base
|
|
57091
57175
|
},
|
|
57092
57176
|
warning: {
|
|
57093
57177
|
style: "single",
|
|
57094
|
-
color: theme.text.
|
|
57178
|
+
color: feedback?.warning?.base ?? theme.text.base
|
|
57095
57179
|
}
|
|
57096
57180
|
},
|
|
57097
57181
|
attributes: {
|
|
@@ -58199,16 +58283,12 @@ function V2SessionPage(props) {
|
|
|
58199
58283
|
},
|
|
58200
58284
|
themes: themeFace,
|
|
58201
58285
|
onCommand: (command) => {
|
|
58202
|
-
|
|
58203
|
-
if (node !== undefined) {
|
|
58204
|
-
node.setText(command + " ");
|
|
58205
|
-
node.gotoLineEnd();
|
|
58206
|
-
}
|
|
58286
|
+
slash.interceptSubmit(command);
|
|
58207
58287
|
},
|
|
58208
58288
|
onClosed: (summary) => {
|
|
58209
58289
|
if (summary !== undefined)
|
|
58210
58290
|
sayLine(summary);
|
|
58211
|
-
if (composerRef && !composerRef.focused())
|
|
58291
|
+
if (dialog.stack.length === 0 && composerRef && !composerRef.focused())
|
|
58212
58292
|
composerRef.focus();
|
|
58213
58293
|
}
|
|
58214
58294
|
}),
|