@qilin-agent/client-ui-theme 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +26 -26
- package/lib/client.js +8 -134
- package/lib/index.js +8 -20
- package/lib/types/boot-theme.d.ts +2 -3
- package/lib/types/client/index.d.ts +0 -11
- package/lib/types/client/locales.d.ts +0 -10
- package/lib/types/client/settings-store.d.ts +1 -3
- package/lib/types/index.d.ts +1 -1
- package/lib/types/theme-settings.d.ts +0 -10
- package/package.json +12 -12
- package/lib/types/client/LineSpacingRow.d.ts +0 -16
package/README.i18n.yaml
CHANGED
|
@@ -3,53 +3,53 @@
|
|
|
3
3
|
# After editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/client/ui-theme/README.md
|
|
5
5
|
/:
|
|
6
|
-
en:
|
|
7
|
-
zh:
|
|
8
|
-
/qilin-client-ui-theme:
|
|
9
|
-
en:
|
|
10
|
-
zh:
|
|
11
|
-
/qilin-client-ui-theme/summary:
|
|
12
|
-
en:
|
|
13
|
-
zh:
|
|
14
|
-
/qilin-client-ui-theme/table-of-contents:
|
|
6
|
+
en: 18d10eea2587ecea
|
|
7
|
+
zh: 8c99f34b34a14770
|
|
8
|
+
/qilin-agent-client-ui-theme:
|
|
9
|
+
en: ab0a967b786d021a
|
|
10
|
+
zh: 70b6e02e2dbb7898
|
|
11
|
+
/qilin-agent-client-ui-theme/summary:
|
|
12
|
+
en: d68f0b52d2444553
|
|
13
|
+
zh: 5ff4fd22114b8ba0
|
|
14
|
+
/qilin-agent-client-ui-theme/table-of-contents:
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
17
|
-
/qilin-client-ui-theme/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
20
|
-
/qilin-client-ui-theme/use-this-package/typography:
|
|
17
|
+
/qilin-agent-client-ui-theme/use-this-package:
|
|
18
|
+
en: 5d1ec38a4bc6cac5
|
|
19
|
+
zh: 9ac70dce67027d62
|
|
20
|
+
/qilin-agent-client-ui-theme/use-this-package/typography:
|
|
21
21
|
en: 9c8769f8d5f577ed
|
|
22
22
|
zh: 38c1a3bb2c59b339
|
|
23
|
-
/qilin-client-ui-theme/use-this-package/registering-a-theme:
|
|
23
|
+
/qilin-agent-client-ui-theme/use-this-package/registering-a-theme:
|
|
24
24
|
en: 2cd32ccaba33b3e9
|
|
25
25
|
zh: 53ea78d19929ea02
|
|
26
|
-
/qilin-client-ui-theme/use-this-package/pre-plugin-palette:
|
|
26
|
+
/qilin-agent-client-ui-theme/use-this-package/pre-plugin-palette:
|
|
27
27
|
en: b52e06f7361f25c9
|
|
28
28
|
zh: 646a91ae6d7560db
|
|
29
|
-
/qilin-client-ui-theme/understand-the-implementation:
|
|
29
|
+
/qilin-agent-client-ui-theme/understand-the-implementation:
|
|
30
30
|
en: 460f4de94a496f39
|
|
31
31
|
zh: a36858899ecb4603
|
|
32
|
-
/qilin-client-ui-theme/understand-the-implementation/stylesheets:
|
|
33
|
-
en:
|
|
34
|
-
zh:
|
|
35
|
-
/qilin-client-ui-theme/understand-the-implementation/scrollbar-rebinding:
|
|
32
|
+
/qilin-agent-client-ui-theme/understand-the-implementation/stylesheets:
|
|
33
|
+
en: 11aa52511f22aba7
|
|
34
|
+
zh: 99abdb26e3596578
|
|
35
|
+
/qilin-agent-client-ui-theme/understand-the-implementation/scrollbar-rebinding:
|
|
36
36
|
en: 998f0fa103ee6ea5
|
|
37
37
|
zh: 13cae6dc8abd62e6
|
|
38
|
-
/qilin-client-ui-theme/understand-the-implementation/preference-persistence:
|
|
38
|
+
/qilin-agent-client-ui-theme/understand-the-implementation/preference-persistence:
|
|
39
39
|
en: f9e859d360a94bf1
|
|
40
40
|
zh: f42721a507576338
|
|
41
|
-
/qilin-client-ui-theme/further-exploration:
|
|
41
|
+
/qilin-agent-client-ui-theme/further-exploration:
|
|
42
42
|
en: fdd4b91eeaf53ac7
|
|
43
43
|
zh: 715b9706ea7a2717
|
|
44
|
-
/qilin-client-ui-theme/model-experience:
|
|
44
|
+
/qilin-agent-client-ui-theme/model-experience:
|
|
45
45
|
en: 3120df665299c634
|
|
46
46
|
zh: 1d9f365d091d0d2a
|
|
47
|
-
/qilin-client-ui-theme/model-experience/kv-cache-effect:
|
|
47
|
+
/qilin-agent-client-ui-theme/model-experience/kv-cache-effect:
|
|
48
48
|
en: ca75c51c89c2c9b0
|
|
49
49
|
zh: de54f3467ef3b9be
|
|
50
|
-
/qilin-client-ui-theme/known-limitations-and-deferred-work:
|
|
50
|
+
/qilin-agent-client-ui-theme/known-limitations-and-deferred-work:
|
|
51
51
|
en: 0d328dbced31a041
|
|
52
52
|
zh: 2951de356ba6bb82
|
|
53
|
-
/qilin-client-ui-theme/known-limitations-and-deferred-work/dev-note:
|
|
53
|
+
/qilin-agent-client-ui-theme/known-limitations-and-deferred-work/dev-note:
|
|
54
54
|
en: e67f633dc6fe7773
|
|
55
55
|
zh: 3bb0c20c93f16f98
|
package/lib/client.js
CHANGED
|
@@ -912,14 +912,11 @@ window.__ModuleLoader__.load({
|
|
|
912
912
|
const THEME_PREFERENCE_FIELD = "preference";
|
|
913
913
|
/** Field carrying the conversation content font size. */
|
|
914
914
|
const FONT_SIZE_FIELD = "fontSize";
|
|
915
|
-
/** Field carrying the conversation content leading adjustment. */
|
|
916
|
-
const LEADING_FIELD = "leading";
|
|
917
915
|
/** Default preference when the user-settings document has no override. */
|
|
918
916
|
const DEFAULT_PREFERENCE = "system";
|
|
919
917
|
Schema.object({
|
|
920
918
|
[THEME_PREFERENCE_FIELD]: Schema.union([...THEME_PREFERENCES]).default(DEFAULT_PREFERENCE),
|
|
921
|
-
[FONT_SIZE_FIELD]: Schema.number().step(1).min(10).max(22).default(14)
|
|
922
|
-
[LEADING_FIELD]: Schema.number().step(1).min(-2).max(8).default(0)
|
|
919
|
+
[FONT_SIZE_FIELD]: Schema.number().step(1).min(10).max(22).default(14)
|
|
923
920
|
});
|
|
924
921
|
/**
|
|
925
922
|
* Narrow one wire or registry value to a persistable preference.
|
|
@@ -1018,70 +1015,6 @@ window.__ModuleLoader__.load({
|
|
|
1018
1015
|
});
|
|
1019
1016
|
}
|
|
1020
1017
|
//#endregion
|
|
1021
|
-
//#region lib/types/client/LineSpacingRow.js
|
|
1022
|
-
/**
|
|
1023
|
-
* Line-spacing preference row registered into the General section item slot:
|
|
1024
|
-
* the same cell rhythm as the font-size row, with a stepper pill carrying the
|
|
1025
|
-
* leading adjustment instead of an absolute size. The value is a signed px
|
|
1026
|
-
* delta over each tier's shipped line height, so 0 renders the typography the
|
|
1027
|
-
* theme ships. The displayed value follows the persisted setting, never the
|
|
1028
|
-
* click echo.
|
|
1029
|
-
*/
|
|
1030
|
-
/**
|
|
1031
|
-
* Render the line-spacing row.
|
|
1032
|
-
* @param props - composed slot props.
|
|
1033
|
-
* @returns the row element tree.
|
|
1034
|
-
*/
|
|
1035
|
-
function LineSpacingRow({ t, setLeading, useStore }) {
|
|
1036
|
-
const leading = useStore((s) => s.leading);
|
|
1037
|
-
return (0, react_jsx_runtime.jsxs)("div", {
|
|
1038
|
-
className: settings_row_module_css_default.row,
|
|
1039
|
-
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
1040
|
-
className: settings_row_module_css_default.rowText,
|
|
1041
|
-
children: [(0, react_jsx_runtime.jsx)("div", {
|
|
1042
|
-
className: settings_row_module_css_default.title,
|
|
1043
|
-
children: t("leading.title")
|
|
1044
|
-
}), (0, react_jsx_runtime.jsx)("div", {
|
|
1045
|
-
className: settings_row_module_css_default.desc,
|
|
1046
|
-
children: t("leading.description")
|
|
1047
|
-
})]
|
|
1048
|
-
}), (0, react_jsx_runtime.jsxs)("div", {
|
|
1049
|
-
className: settings_row_module_css_default.control,
|
|
1050
|
-
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
1051
|
-
className: settings_row_module_css_default.stepper,
|
|
1052
|
-
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
1053
|
-
className: settings_row_module_css_default.value,
|
|
1054
|
-
children: leading > 0 ? `+${leading}` : `${leading}`
|
|
1055
|
-
}), (0, react_jsx_runtime.jsxs)("span", {
|
|
1056
|
-
className: settings_row_module_css_default.arrows,
|
|
1057
|
-
children: [(0, react_jsx_runtime.jsx)("button", {
|
|
1058
|
-
type: "button",
|
|
1059
|
-
className: settings_row_module_css_default.arrow,
|
|
1060
|
-
"aria-label": t("leading.increase"),
|
|
1061
|
-
disabled: leading >= 8,
|
|
1062
|
-
onClick: () => {
|
|
1063
|
-
setLeading(leading + 1);
|
|
1064
|
-
},
|
|
1065
|
-
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconChevronUpOutline14, { size: 9 })
|
|
1066
|
-
}), (0, react_jsx_runtime.jsx)("button", {
|
|
1067
|
-
type: "button",
|
|
1068
|
-
className: settings_row_module_css_default.arrow,
|
|
1069
|
-
"aria-label": t("leading.decrease"),
|
|
1070
|
-
disabled: leading <= -2,
|
|
1071
|
-
onClick: () => {
|
|
1072
|
-
setLeading(leading - 1);
|
|
1073
|
-
},
|
|
1074
|
-
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconChevronDownOutline14, { size: 9 })
|
|
1075
|
-
})]
|
|
1076
|
-
})]
|
|
1077
|
-
}), (0, react_jsx_runtime.jsx)("span", {
|
|
1078
|
-
className: settings_row_module_css_default.unit,
|
|
1079
|
-
children: t("leading.unit")
|
|
1080
|
-
})]
|
|
1081
|
-
})]
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
//#endregion
|
|
1085
1018
|
//#region ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
1086
1019
|
function r(e) {
|
|
1087
1020
|
var t, f, n = "";
|
|
@@ -1199,13 +1132,11 @@ window.__ModuleLoader__.load({
|
|
|
1199
1132
|
return (0, _qilin_agent_client_store.defineStore)({
|
|
1200
1133
|
init: () => ({
|
|
1201
1134
|
fontSize: 14,
|
|
1202
|
-
leading: 0,
|
|
1203
1135
|
revision: -1
|
|
1204
1136
|
}),
|
|
1205
|
-
actions: { sync: (d, fontSize,
|
|
1137
|
+
actions: { sync: (d, fontSize, revision) => {
|
|
1206
1138
|
if (revision <= d.revision) return;
|
|
1207
1139
|
d.fontSize = fontSize;
|
|
1208
|
-
d.leading = leading;
|
|
1209
1140
|
d.revision = revision;
|
|
1210
1141
|
} }
|
|
1211
1142
|
});
|
|
@@ -1230,7 +1161,7 @@ window.__ModuleLoader__.load({
|
|
|
1230
1161
|
var scrollbar_css_default = "body{--qilin-scrollbar-thumb:var(--qilin-alias-scrollbar-bg-l1);--qilin-scrollbar-thumb-hover:var(--qilin-alias-scrollbar-hover-l1);--qilin-scrollbar-thumb-border:0px;--qilin-scrollbar-track-margin:0px;--qilin-scrollbar-width:8px}@supports not selector(::-webkit-scrollbar){body,body *{scrollbar-width:thin;scrollbar-color:var(--qilin-scrollbar-thumb) transparent}}::-webkit-scrollbar{width:var(--qilin-scrollbar-width);height:var(--qilin-scrollbar-width)}::-webkit-scrollbar-track{margin-block:var(--qilin-scrollbar-track-margin);background:0 0}::-webkit-scrollbar-thumb{border:var(--qilin-scrollbar-thumb-border) solid transparent;corner-shape:round;background:var(--qilin-scrollbar-thumb);background-clip:content-box;border-radius:999px}::-webkit-scrollbar-thumb:hover{background-color:var(--qilin-scrollbar-thumb-hover)}::-webkit-scrollbar-corner{background:0 0}";
|
|
1231
1162
|
//#endregion
|
|
1232
1163
|
//#region \0qilin-inline-css:/home/runner/work/QiLin/QiLin/packages/client/ui-theme/src/styles/gradient-shadow-text.css.mjs
|
|
1233
|
-
var gradient_shadow_text_css_default = "body{--qilin-linear-gradient-think:linear-gradient(180deg, #fff 20.19%, #fff0 100%);--qilin-linear-think-select:linear-gradient(180deg, #f5f6f7 20.19%, #f5f6f700 100%);--qilin-shadow-lv1:0 2px 4px 0 #0000000d;--qilin-shadow-lv1-blur:0 4px 12px 0 #00000005;--qilin-shadow-lv2:0 4px 12px 0 #00000005, 0 2px 8px 0 #0000000a;--qilin-shadow-lv3:0 0 1px 0 #0003, 0 0 4px 0 #00000005, 0 12px 32px 0 #00000014;--qilin-elevation-stroke-color:var(--qilin-alias-border-l4);--qilin-mask-blur:blur(2px)}body,body *{--qilin-elevation-stroke:0 0 0 .5px var(--qilin-elevation-stroke-color);--qilin-elevation-panel:var(--qilin-elevation-stroke), 0 3px 8px 0 #00000008, 0 0 16px 0 #00000005;--qilin-elevation-prominent:var(--qilin-elevation-stroke), 0 3px 8px 0 #0000000a, 0 0 20px 0 #0000000d;--qilin-elevation-soft:var(--qilin-elevation-stroke), 0 4px 16px 0 #00000008, 0 0 24px 0 #00000008}body[data-ds-dark-theme]{--qilin-linear-gradient-think:linear-gradient(180deg, #151517 20.19%, #15151700 100%);--qilin-linear-think-select:linear-gradient(180deg, #232325 20.19%, #23232500 100%)}body{--qilin-content-font-delta:calc(var(--qilin-content-font-size,14px) - 14px);--qilin-content-font-size-secondary:min(calc(var(--qilin-content-font-size,14px) - 1px), max(13px, calc(var(--qilin-content-font-size,14px) - 2px)));--qilin-content-font-delta-secondary:calc(var(--qilin-content-font-size-secondary) - 13px);--qilin-content-leading:0px;--qilin-font-markdown-h1:700 calc(21px + var(--qilin-content-font-delta)) / calc(30px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-h1-font-family:var(--qilin-font-family);--qilin-font-markdown-h1-font-weight:700;--qilin-font-markdown-h1-line-height:calc(30px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-h1-font-size:calc(21px + var(--qilin-content-font-delta));--qilin-font-markdown-h1-font-style:normal;--qilin-font-markdown-h2:700 calc(19px + var(--qilin-content-font-delta)) / calc(28px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-h2-font-family:var(--qilin-font-family);--qilin-font-markdown-h2-font-weight:700;--qilin-font-markdown-h2-line-height:calc(28px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-h2-font-size:calc(19px + var(--qilin-content-font-delta));--qilin-font-markdown-h2-font-style:normal;--qilin-font-markdown-h3:700 calc(18px + var(--qilin-content-font-delta)) / calc(26px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-h3-font-family:var(--qilin-font-family);--qilin-font-markdown-h3-font-weight:700;--qilin-font-markdown-h3-line-height:calc(26px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-h3-font-size:calc(18px + var(--qilin-content-font-delta));--qilin-font-markdown-h3-font-style:normal;--qilin-font-markdown-h4:600 var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-h4-font-family:var(--qilin-font-family);--qilin-font-markdown-h4-font-weight:600;--qilin-font-markdown-h4-line-height:calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-h4-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-h4-font-style:normal;--qilin-font-markdown-base:var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-base-font-family:var(--qilin-font-family);--qilin-font-markdown-base-font-weight:400;--qilin-font-markdown-base-line-height:calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-base-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-font-style:normal;--qilin-font-markdown-base-strong:600 var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-base-strong-font-family:var(--qilin-font-family);--qilin-font-markdown-base-strong-font-weight:600;--qilin-font-markdown-base-strong-line-height:calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-base-strong-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-strong-font-style:normal;--qilin-font-markdown-base-italic:italic var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-base-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-base-italic-font-weight:400;--qilin-font-markdown-base-italic-line-height:calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-base-italic-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-italic-font-style:italic;--qilin-font-markdown-base-strong-italic:italic 600 var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-base-strong-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-base-strong-italic-font-weight:600;--qilin-font-markdown-base-strong-italic-line-height:calc(24px + var(--qilin-content-font-delta) + var(--qilin-content-leading));--qilin-font-markdown-base-strong-italic-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-strong-italic-font-style:italic;--qilin-font-markdown-table:var(--qilin-content-font-size-secondary,13px)/calc(22px + var(--qilin-content-font-delta-secondary,0px) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-table-font-family:var(--qilin-font-family);--qilin-font-markdown-table-font-weight:400;--qilin-font-markdown-table-line-height:calc(22px + var(--qilin-content-font-delta-secondary,0px) + var(--qilin-content-leading));--qilin-font-markdown-table-font-size:var(--qilin-content-font-size-secondary,13px);--qilin-font-markdown-table-font-style:normal;--qilin-font-markdown-table-head:500 var(--qilin-content-font-size-secondary,13px)/calc(22px + var(--qilin-content-font-delta-secondary,0px) + var(--qilin-content-leading)) var(--qilin-font-family);--qilin-font-markdown-table-head-font-family:var(--qilin-font-family);--qilin-font-markdown-table-head-font-weight:500;--qilin-font-markdown-table-head-line-height:calc(22px + var(--qilin-content-font-delta-secondary,0px) + var(--qilin-content-leading));--qilin-font-markdown-table-head-font-size:var(--qilin-content-font-size-secondary,13px);--qilin-font-markdown-table-head-font-style:normal;--qilin-font-markdown-small:12px/20px var(--qilin-font-family);--qilin-font-markdown-small-font-family:var(--qilin-font-family);--qilin-font-markdown-small-font-weight:400;--qilin-font-markdown-small-line-height:20px;--qilin-font-markdown-small-font-size:12px;--qilin-font-markdown-small-font-style:normal;--qilin-font-markdown-small-strong:600 12px/20px var(--qilin-font-family);--qilin-font-markdown-small-strong-font-family:var(--qilin-font-family);--qilin-font-markdown-small-strong-font-weight:600;--qilin-font-markdown-small-strong-line-height:20px;--qilin-font-markdown-small-strong-font-size:12px;--qilin-font-markdown-small-strong-font-style:normal;--qilin-font-markdown-small-italic:italic 12px/20px var(--qilin-font-family);--qilin-font-markdown-small-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-small-italic-font-weight:400;--qilin-font-markdown-small-italic-line-height:20px;--qilin-font-markdown-small-italic-font-size:12px;--qilin-font-markdown-small-italic-font-style:italic;--qilin-font-markdown-small-strong-italic:italic 600 12px/20px var(--qilin-font-family);--qilin-font-markdown-small-strong-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-small-strong-italic-font-weight:600;--qilin-font-markdown-small-strong-italic-line-height:20px;--qilin-font-markdown-small-strong-italic-font-size:12px;--qilin-font-markdown-small-strong-italic-font-style:italic;--qilin-font-markdown-code:12px/19px var(--ds-font-family-code);--qilin-font-markdown-code-font-family:var(--ds-font-family-code);--qilin-font-markdown-code-font-weight:400;--qilin-font-markdown-code-line-height:19px;--qilin-font-markdown-code-font-size:12px;--qilin-font-markdown-code-font-style:normal;--qilin-font-markdown-code-block:11px/19px var(--ds-font-family-code);--qilin-font-markdown-code-block-font-family:var(--ds-font-family-code);--qilin-font-markdown-code-block-font-weight:400;--qilin-font-markdown-code-block-line-height:19px;--qilin-font-markdown-code-block-font-size:11px;--qilin-font-markdown-code-block-font-style:normal;--qilin-font-markdown-code-block-small:11px/16px var(--ds-font-family-code);--qilin-font-markdown-code-block-small-font-family:var(--ds-font-family-code);--qilin-font-markdown-code-block-small-font-weight:400;--qilin-font-markdown-code-block-small-line-height:16px;--qilin-font-markdown-code-block-small-font-size:11px;--qilin-font-markdown-code-block-small-font-style:normal;--qilin-font-xl-24:600 24px/32px var(--qilin-font-family);--qilin-font-xl-24-font-family:var(--qilin-font-family);--qilin-font-xl-24-font-weight:600;--qilin-font-xl-24-line-height:32px;--qilin-font-xl-24-font-size:24px;--qilin-font-xl-24-font-style:normal;--qilin-font-l-20:500 20px/28px var(--qilin-font-family);--qilin-font-l-20-font-family:var(--qilin-font-family);--qilin-font-l-20-font-weight:500;--qilin-font-l-20-line-height:28px;--qilin-font-l-20-font-size:20px;--qilin-font-l-20-font-style:normal;--qilin-font-m-18:500 16px/28px var(--qilin-font-family);--qilin-font-m-18-font-family:var(--qilin-font-family);--qilin-font-m-18-font-weight:500;--qilin-font-m-18-line-height:28px;--qilin-font-m-18-font-size:16px;--qilin-font-m-18-font-style:normal;--qilin-font-base-16:16px/24px var(--qilin-font-family);--qilin-font-base-16-font-family:var(--qilin-font-family);--qilin-font-base-16-font-weight:400;--qilin-font-base-16-line-height:24px;--qilin-font-base-16-font-size:16px;--qilin-font-base-16-font-style:normal;--qilin-font-base-strong-16:500 16px/24px var(--qilin-font-family);--qilin-font-base-strong-16-font-family:var(--qilin-font-family);--qilin-font-base-strong-16-font-weight:500;--qilin-font-base-strong-16-line-height:24px;--qilin-font-base-strong-16-font-size:16px;--qilin-font-base-strong-16-font-style:normal;--qilin-font-s-14:14px/22px var(--qilin-font-family);--qilin-font-s-14-font-family:var(--qilin-font-family);--qilin-font-s-14-font-weight:400;--qilin-font-s-14-line-height:22px;--qilin-font-s-14-font-size:14px;--qilin-font-s-14-font-style:normal;--qilin-font-s-strong-14:500 14px/22px var(--qilin-font-family);--qilin-font-s-strong-14-font-family:var(--qilin-font-family);--qilin-font-s-strong-14-font-weight:500;--qilin-font-s-strong-14-line-height:22px;--qilin-font-s-strong-14-font-size:14px;--qilin-font-s-strong-14-font-style:normal;--qilin-font-xs-13:13px/20px var(--qilin-font-family);--qilin-font-xs-13-font-family:var(--qilin-font-family);--qilin-font-xs-13-font-weight:400;--qilin-font-xs-13-line-height:20px;--qilin-font-xs-13-font-size:13px;--qilin-font-xs-13-font-style:normal;--qilin-font-xs-strong-13:500 13px/20px var(--qilin-font-family);--qilin-font-xs-strong-13-font-family:var(--qilin-font-family);--qilin-font-xs-strong-13-font-weight:500;--qilin-font-xs-strong-13-line-height:20px;--qilin-font-xs-strong-13-font-size:13px;--qilin-font-xs-strong-13-font-style:normal;--qilin-font-xxs-12:12px/18px var(--qilin-font-family);--qilin-font-xxs-12-font-family:var(--qilin-font-family);--qilin-font-xxs-12-font-weight:400;--qilin-font-xxs-12-line-height:18px;--qilin-font-xxs-12-font-size:12px;--qilin-font-xxs-12-font-style:normal;--qilin-font-xxs-strong-12:500 12px/18px var(--qilin-font-family);--qilin-font-xxs-strong-12-font-family:var(--qilin-font-family);--qilin-font-xxs-strong-12-font-weight:500;--qilin-font-xxs-strong-12-line-height:18px;--qilin-font-xxs-strong-12-font-size:12px;--qilin-font-xxs-strong-12-font-style:normal;--qilin-font-xxxs-11:11px/14px var(--qilin-font-family);--qilin-font-xxxs-11-font-family:var(--qilin-font-family);--qilin-font-xxxs-11-font-weight:400;--qilin-font-xxxs-11-line-height:14px;--qilin-font-xxxs-11-font-size:11px;--qilin-font-xxxs-11-font-style:normal;--qilin-font-xxxs-strong-11:500 11px/14px var(--qilin-font-family);--qilin-font-xxxs-strong-11-font-family:var(--qilin-font-family);--qilin-font-xxxs-strong-11-font-weight:500;--qilin-font-xxxs-strong-11-line-height:14px;--qilin-font-xxxs-strong-11-font-size:11px;--qilin-font-xxxs-strong-11-font-style:normal}";
|
|
1164
|
+
var gradient_shadow_text_css_default = "body{--qilin-linear-gradient-think:linear-gradient(180deg, #fff 20.19%, #fff0 100%);--qilin-linear-think-select:linear-gradient(180deg, #f5f6f7 20.19%, #f5f6f700 100%);--qilin-shadow-lv1:0 2px 4px 0 #0000000d;--qilin-shadow-lv1-blur:0 4px 12px 0 #00000005;--qilin-shadow-lv2:0 4px 12px 0 #00000005, 0 2px 8px 0 #0000000a;--qilin-shadow-lv3:0 0 1px 0 #0003, 0 0 4px 0 #00000005, 0 12px 32px 0 #00000014;--qilin-elevation-stroke-color:var(--qilin-alias-border-l4);--qilin-mask-blur:blur(2px)}body,body *{--qilin-elevation-stroke:0 0 0 .5px var(--qilin-elevation-stroke-color);--qilin-elevation-panel:var(--qilin-elevation-stroke), 0 3px 8px 0 #00000008, 0 0 16px 0 #00000005;--qilin-elevation-prominent:var(--qilin-elevation-stroke), 0 3px 8px 0 #0000000a, 0 0 20px 0 #0000000d;--qilin-elevation-soft:var(--qilin-elevation-stroke), 0 4px 16px 0 #00000008, 0 0 24px 0 #00000008}body[data-ds-dark-theme]{--qilin-linear-gradient-think:linear-gradient(180deg, #151517 20.19%, #15151700 100%);--qilin-linear-think-select:linear-gradient(180deg, #232325 20.19%, #23232500 100%)}body{--qilin-content-font-delta:calc(var(--qilin-content-font-size,14px) - 14px);--qilin-content-font-size-secondary:min(calc(var(--qilin-content-font-size,14px) - 1px), max(13px, calc(var(--qilin-content-font-size,14px) - 2px)));--qilin-content-font-delta-secondary:calc(var(--qilin-content-font-size-secondary) - 13px);--qilin-font-markdown-h1:700 calc(21px + var(--qilin-content-font-delta)) / calc(30px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-h1-font-family:var(--qilin-font-family);--qilin-font-markdown-h1-font-weight:700;--qilin-font-markdown-h1-line-height:calc(30px + var(--qilin-content-font-delta));--qilin-font-markdown-h1-font-size:calc(21px + var(--qilin-content-font-delta));--qilin-font-markdown-h1-font-style:normal;--qilin-font-markdown-h2:700 calc(19px + var(--qilin-content-font-delta)) / calc(28px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-h2-font-family:var(--qilin-font-family);--qilin-font-markdown-h2-font-weight:700;--qilin-font-markdown-h2-line-height:calc(28px + var(--qilin-content-font-delta));--qilin-font-markdown-h2-font-size:calc(19px + var(--qilin-content-font-delta));--qilin-font-markdown-h2-font-style:normal;--qilin-font-markdown-h3:700 calc(18px + var(--qilin-content-font-delta)) / calc(26px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-h3-font-family:var(--qilin-font-family);--qilin-font-markdown-h3-font-weight:700;--qilin-font-markdown-h3-line-height:calc(26px + var(--qilin-content-font-delta));--qilin-font-markdown-h3-font-size:calc(18px + var(--qilin-content-font-delta));--qilin-font-markdown-h3-font-style:normal;--qilin-font-markdown-h4:600 var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-h4-font-family:var(--qilin-font-family);--qilin-font-markdown-h4-font-weight:600;--qilin-font-markdown-h4-line-height:calc(24px + var(--qilin-content-font-delta));--qilin-font-markdown-h4-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-h4-font-style:normal;--qilin-font-markdown-base:var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-base-font-family:var(--qilin-font-family);--qilin-font-markdown-base-font-weight:400;--qilin-font-markdown-base-line-height:calc(24px + var(--qilin-content-font-delta));--qilin-font-markdown-base-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-font-style:normal;--qilin-font-markdown-base-strong:600 var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-base-strong-font-family:var(--qilin-font-family);--qilin-font-markdown-base-strong-font-weight:600;--qilin-font-markdown-base-strong-line-height:calc(24px + var(--qilin-content-font-delta));--qilin-font-markdown-base-strong-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-strong-font-style:normal;--qilin-font-markdown-base-italic:italic var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-base-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-base-italic-font-weight:400;--qilin-font-markdown-base-italic-line-height:calc(24px + var(--qilin-content-font-delta));--qilin-font-markdown-base-italic-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-italic-font-style:italic;--qilin-font-markdown-base-strong-italic:italic 600 var(--qilin-content-font-size,14px) / calc(24px + var(--qilin-content-font-delta)) var(--qilin-font-family);--qilin-font-markdown-base-strong-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-base-strong-italic-font-weight:600;--qilin-font-markdown-base-strong-italic-line-height:calc(24px + var(--qilin-content-font-delta));--qilin-font-markdown-base-strong-italic-font-size:var(--qilin-content-font-size,14px);--qilin-font-markdown-base-strong-italic-font-style:italic;--qilin-font-markdown-table:var(--qilin-content-font-size-secondary,13px)/calc(22px + var(--qilin-content-font-delta-secondary,0px)) var(--qilin-font-family);--qilin-font-markdown-table-font-family:var(--qilin-font-family);--qilin-font-markdown-table-font-weight:400;--qilin-font-markdown-table-line-height:calc(22px + var(--qilin-content-font-delta-secondary,0px));--qilin-font-markdown-table-font-size:var(--qilin-content-font-size-secondary,13px);--qilin-font-markdown-table-font-style:normal;--qilin-font-markdown-table-head:500 var(--qilin-content-font-size-secondary,13px)/calc(22px + var(--qilin-content-font-delta-secondary,0px)) var(--qilin-font-family);--qilin-font-markdown-table-head-font-family:var(--qilin-font-family);--qilin-font-markdown-table-head-font-weight:500;--qilin-font-markdown-table-head-line-height:calc(22px + var(--qilin-content-font-delta-secondary,0px));--qilin-font-markdown-table-head-font-size:var(--qilin-content-font-size-secondary,13px);--qilin-font-markdown-table-head-font-style:normal;--qilin-font-markdown-small:12px/20px var(--qilin-font-family);--qilin-font-markdown-small-font-family:var(--qilin-font-family);--qilin-font-markdown-small-font-weight:400;--qilin-font-markdown-small-line-height:20px;--qilin-font-markdown-small-font-size:12px;--qilin-font-markdown-small-font-style:normal;--qilin-font-markdown-small-strong:600 12px/20px var(--qilin-font-family);--qilin-font-markdown-small-strong-font-family:var(--qilin-font-family);--qilin-font-markdown-small-strong-font-weight:600;--qilin-font-markdown-small-strong-line-height:20px;--qilin-font-markdown-small-strong-font-size:12px;--qilin-font-markdown-small-strong-font-style:normal;--qilin-font-markdown-small-italic:italic 12px/20px var(--qilin-font-family);--qilin-font-markdown-small-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-small-italic-font-weight:400;--qilin-font-markdown-small-italic-line-height:20px;--qilin-font-markdown-small-italic-font-size:12px;--qilin-font-markdown-small-italic-font-style:italic;--qilin-font-markdown-small-strong-italic:italic 600 12px/20px var(--qilin-font-family);--qilin-font-markdown-small-strong-italic-font-family:var(--qilin-font-family);--qilin-font-markdown-small-strong-italic-font-weight:600;--qilin-font-markdown-small-strong-italic-line-height:20px;--qilin-font-markdown-small-strong-italic-font-size:12px;--qilin-font-markdown-small-strong-italic-font-style:italic;--qilin-font-markdown-code:12px/19px var(--ds-font-family-code);--qilin-font-markdown-code-font-family:var(--ds-font-family-code);--qilin-font-markdown-code-font-weight:400;--qilin-font-markdown-code-line-height:19px;--qilin-font-markdown-code-font-size:12px;--qilin-font-markdown-code-font-style:normal;--qilin-font-markdown-code-block:11px/19px var(--ds-font-family-code);--qilin-font-markdown-code-block-font-family:var(--ds-font-family-code);--qilin-font-markdown-code-block-font-weight:400;--qilin-font-markdown-code-block-line-height:19px;--qilin-font-markdown-code-block-font-size:11px;--qilin-font-markdown-code-block-font-style:normal;--qilin-font-markdown-code-block-small:11px/16px var(--ds-font-family-code);--qilin-font-markdown-code-block-small-font-family:var(--ds-font-family-code);--qilin-font-markdown-code-block-small-font-weight:400;--qilin-font-markdown-code-block-small-line-height:16px;--qilin-font-markdown-code-block-small-font-size:11px;--qilin-font-markdown-code-block-small-font-style:normal;--qilin-font-xl-24:600 24px/32px var(--qilin-font-family);--qilin-font-xl-24-font-family:var(--qilin-font-family);--qilin-font-xl-24-font-weight:600;--qilin-font-xl-24-line-height:32px;--qilin-font-xl-24-font-size:24px;--qilin-font-xl-24-font-style:normal;--qilin-font-l-20:500 20px/28px var(--qilin-font-family);--qilin-font-l-20-font-family:var(--qilin-font-family);--qilin-font-l-20-font-weight:500;--qilin-font-l-20-line-height:28px;--qilin-font-l-20-font-size:20px;--qilin-font-l-20-font-style:normal;--qilin-font-m-18:500 16px/28px var(--qilin-font-family);--qilin-font-m-18-font-family:var(--qilin-font-family);--qilin-font-m-18-font-weight:500;--qilin-font-m-18-line-height:28px;--qilin-font-m-18-font-size:16px;--qilin-font-m-18-font-style:normal;--qilin-font-base-16:16px/24px var(--qilin-font-family);--qilin-font-base-16-font-family:var(--qilin-font-family);--qilin-font-base-16-font-weight:400;--qilin-font-base-16-line-height:24px;--qilin-font-base-16-font-size:16px;--qilin-font-base-16-font-style:normal;--qilin-font-base-strong-16:500 16px/24px var(--qilin-font-family);--qilin-font-base-strong-16-font-family:var(--qilin-font-family);--qilin-font-base-strong-16-font-weight:500;--qilin-font-base-strong-16-line-height:24px;--qilin-font-base-strong-16-font-size:16px;--qilin-font-base-strong-16-font-style:normal;--qilin-font-s-14:14px/22px var(--qilin-font-family);--qilin-font-s-14-font-family:var(--qilin-font-family);--qilin-font-s-14-font-weight:400;--qilin-font-s-14-line-height:22px;--qilin-font-s-14-font-size:14px;--qilin-font-s-14-font-style:normal;--qilin-font-s-strong-14:500 14px/22px var(--qilin-font-family);--qilin-font-s-strong-14-font-family:var(--qilin-font-family);--qilin-font-s-strong-14-font-weight:500;--qilin-font-s-strong-14-line-height:22px;--qilin-font-s-strong-14-font-size:14px;--qilin-font-s-strong-14-font-style:normal;--qilin-font-xs-13:13px/20px var(--qilin-font-family);--qilin-font-xs-13-font-family:var(--qilin-font-family);--qilin-font-xs-13-font-weight:400;--qilin-font-xs-13-line-height:20px;--qilin-font-xs-13-font-size:13px;--qilin-font-xs-13-font-style:normal;--qilin-font-xs-strong-13:500 13px/20px var(--qilin-font-family);--qilin-font-xs-strong-13-font-family:var(--qilin-font-family);--qilin-font-xs-strong-13-font-weight:500;--qilin-font-xs-strong-13-line-height:20px;--qilin-font-xs-strong-13-font-size:13px;--qilin-font-xs-strong-13-font-style:normal;--qilin-font-xxs-12:12px/18px var(--qilin-font-family);--qilin-font-xxs-12-font-family:var(--qilin-font-family);--qilin-font-xxs-12-font-weight:400;--qilin-font-xxs-12-line-height:18px;--qilin-font-xxs-12-font-size:12px;--qilin-font-xxs-12-font-style:normal;--qilin-font-xxs-strong-12:500 12px/18px var(--qilin-font-family);--qilin-font-xxs-strong-12-font-family:var(--qilin-font-family);--qilin-font-xxs-strong-12-font-weight:500;--qilin-font-xxs-strong-12-line-height:18px;--qilin-font-xxs-strong-12-font-size:12px;--qilin-font-xxs-strong-12-font-style:normal;--qilin-font-xxxs-11:11px/14px var(--qilin-font-family);--qilin-font-xxxs-11-font-family:var(--qilin-font-family);--qilin-font-xxxs-11-font-weight:400;--qilin-font-xxxs-11-line-height:14px;--qilin-font-xxxs-11-font-size:11px;--qilin-font-xxxs-11-font-style:normal;--qilin-font-xxxs-strong-11:500 11px/14px var(--qilin-font-family);--qilin-font-xxxs-strong-11-font-family:var(--qilin-font-family);--qilin-font-xxxs-strong-11-font-weight:500;--qilin-font-xxxs-strong-11-line-height:14px;--qilin-font-xxxs-strong-11-font-size:11px;--qilin-font-xxxs-strong-11-font-style:normal}";
|
|
1234
1165
|
//#endregion
|
|
1235
1166
|
//#region \0qilin-inline-css:/home/runner/work/QiLin/QiLin/packages/client/ui-theme/src/styles/shiki.css.mjs
|
|
1236
1167
|
var shiki_css_default = ":root{--shiki-foreground:var(--qilin-alias-label-primary);--shiki-background:var(--qilin-alias-markdown-code-block);--shiki-token-constant:#1c7ed6;--shiki-token-string:#2f9e44;--shiki-token-comment:#868e96;--shiki-token-keyword:#d6336c;--shiki-token-parameter:#e8590c;--shiki-token-function:#6741d9;--shiki-token-string-expression:#2b8a3e;--shiki-token-punctuation:#495057;--shiki-token-link:#1971c2}body[data-ds-dark-theme]{--shiki-token-constant:#4dabf7;--shiki-token-string:#69db7c;--shiki-token-comment:#adb5bd;--shiki-token-keyword:#faa2c1;--shiki-token-parameter:#ffa94d;--shiki-token-function:#b197fc;--shiki-token-string-expression:#8ce99a;--shiki-token-punctuation:#ced4da;--shiki-token-link:#74c0fc}";
|
|
@@ -1277,12 +1208,7 @@ window.__ModuleLoader__.load({
|
|
|
1277
1208
|
"fontSize.description": "仅影响会话内容的字号",
|
|
1278
1209
|
"fontSize.unit": "px",
|
|
1279
1210
|
"fontSize.increase": "增大字号",
|
|
1280
|
-
"fontSize.decrease": "减小字号"
|
|
1281
|
-
"leading.title": "行间距",
|
|
1282
|
-
"leading.description": "在默认行高上增减会话正文的行间距,0 为默认",
|
|
1283
|
-
"leading.unit": "px",
|
|
1284
|
-
"leading.increase": "增大行间距",
|
|
1285
|
-
"leading.decrease": "减小行间距"
|
|
1211
|
+
"fontSize.decrease": "减小字号"
|
|
1286
1212
|
};
|
|
1287
1213
|
/** English dictionary, checked complete against the zh key set. */
|
|
1288
1214
|
const en = {
|
|
@@ -1294,12 +1220,7 @@ window.__ModuleLoader__.load({
|
|
|
1294
1220
|
"fontSize.description": "Only affects conversation content",
|
|
1295
1221
|
"fontSize.unit": "px",
|
|
1296
1222
|
"fontSize.increase": "Increase font size",
|
|
1297
|
-
"fontSize.decrease": "Decrease font size"
|
|
1298
|
-
"leading.title": "Line spacing",
|
|
1299
|
-
"leading.description": "Adds or removes pixels from the default line height of message text; 0 is the default",
|
|
1300
|
-
"leading.unit": "px",
|
|
1301
|
-
"leading.increase": "Increase line spacing",
|
|
1302
|
-
"leading.decrease": "Decrease line spacing"
|
|
1223
|
+
"fontSize.decrease": "Decrease font size"
|
|
1303
1224
|
};
|
|
1304
1225
|
//#endregion
|
|
1305
1226
|
//#region lib/types/client/index.js
|
|
@@ -1424,7 +1345,6 @@ window.__ModuleLoader__.load({
|
|
|
1424
1345
|
themes = [...BUILTIN_THEMES];
|
|
1425
1346
|
preference;
|
|
1426
1347
|
fontSize = bootstrapFontSize();
|
|
1427
|
-
leading = bootstrapLeading();
|
|
1428
1348
|
revision = 0;
|
|
1429
1349
|
snapshot;
|
|
1430
1350
|
media;
|
|
@@ -1503,27 +1423,13 @@ window.__ModuleLoader__.load({
|
|
|
1503
1423
|
this.host.set(FONT_SIZE_FIELD, px);
|
|
1504
1424
|
this.publish();
|
|
1505
1425
|
}
|
|
1506
|
-
/**
|
|
1507
|
-
* Change the conversation content leading adjustment — the only leading
|
|
1508
|
-
* write entry. Accepted values are written through the settings scope and
|
|
1509
|
-
* emit `theme/change`.
|
|
1510
|
-
* @param px - integer px within LEADING_MIN..LEADING_MAX; out-of-range or fractional values throw.
|
|
1511
|
-
*/
|
|
1512
|
-
setLeading(px) {
|
|
1513
|
-
if (!Number.isInteger(px) || px < -2 || px > 8) throw new Error(`leading ${px} is outside -2..8`);
|
|
1514
|
-
if (this.leading === px) return;
|
|
1515
|
-
this.leading = px;
|
|
1516
|
-
this.host.set(LEADING_FIELD, px);
|
|
1517
|
-
this.publish();
|
|
1518
|
-
}
|
|
1519
1426
|
/** Adopt the scope's accepted durable preference without writing it back. */
|
|
1520
1427
|
adopt() {
|
|
1521
1428
|
const section = this.host.getSnapshot().value;
|
|
1522
1429
|
if (section === void 0) return;
|
|
1523
|
-
if (this.preference === section.preference && this.fontSize === section.fontSize
|
|
1430
|
+
if (this.preference === section.preference && this.fontSize === section.fontSize) return;
|
|
1524
1431
|
this.preference = section.preference;
|
|
1525
1432
|
this.fontSize = section.fontSize;
|
|
1526
|
-
this.leading = section.leading;
|
|
1527
1433
|
this.publish();
|
|
1528
1434
|
}
|
|
1529
1435
|
/**
|
|
@@ -1583,7 +1489,6 @@ window.__ModuleLoader__.load({
|
|
|
1583
1489
|
return Object.freeze({
|
|
1584
1490
|
preference: this.preference,
|
|
1585
1491
|
fontSize: this.fontSize,
|
|
1586
|
-
leading: this.leading,
|
|
1587
1492
|
active: this.composeActive(active),
|
|
1588
1493
|
themes: Object.freeze([...this.themes]),
|
|
1589
1494
|
revision: this.revision
|
|
@@ -1625,20 +1530,6 @@ window.__ModuleLoader__.load({
|
|
|
1625
1530
|
return Number.isInteger(parsed) && parsed >= 10 && parsed <= 22 ? parsed : 14;
|
|
1626
1531
|
}
|
|
1627
1532
|
/**
|
|
1628
|
-
* Read the leading adjustment the Host boot script wrote on `body` before any
|
|
1629
|
-
* plugin ran, so the initial snapshot matches first paint and ui-layout's
|
|
1630
|
-
* presenter does not flash the schema default while the settings read is in
|
|
1631
|
-
* flight. Non-browser runs and mounts without the boot script fall back to the
|
|
1632
|
-
* schema default; the durable settings adoption still lands afterwards.
|
|
1633
|
-
*/
|
|
1634
|
-
function bootstrapLeading() {
|
|
1635
|
-
/* v8 ignore next -- needs a documentless run (node e2e booting the client tree), not constructible under jsdom */
|
|
1636
|
-
if (typeof document === "undefined") return 0;
|
|
1637
|
-
const raw = document.body.style.getPropertyValue("--qilin-content-leading");
|
|
1638
|
-
const parsed = Number.parseInt(raw, 10);
|
|
1639
|
-
return Number.isInteger(parsed) && parsed >= -2 && parsed <= 8 ? parsed : 0;
|
|
1640
|
-
}
|
|
1641
|
-
/**
|
|
1642
1533
|
* Runtime shape check for one override layer (model-authored callers pass
|
|
1643
1534
|
* untyped JS through the dynamic-package façade, so the static type cannot
|
|
1644
1535
|
* enforce the pair shape there). Returns a defensive per-token copy so later
|
|
@@ -1694,12 +1585,10 @@ window.__ModuleLoader__.load({
|
|
|
1694
1585
|
const appearanceStore = createAppearanceRowStore();
|
|
1695
1586
|
let appearanceBound;
|
|
1696
1587
|
let fontSizeBound;
|
|
1697
|
-
let leadingBound;
|
|
1698
1588
|
const sync = (snapshot) => {
|
|
1699
|
-
const { preference, fontSize,
|
|
1589
|
+
const { preference, fontSize, revision } = snapshot;
|
|
1700
1590
|
appearanceBound?.sync(preference, revision);
|
|
1701
|
-
fontSizeBound?.sync(fontSize,
|
|
1702
|
-
leadingBound?.sync(fontSize, leading, revision);
|
|
1591
|
+
fontSizeBound?.sync(fontSize, revision);
|
|
1703
1592
|
};
|
|
1704
1593
|
ctx.on("theme/change", sync);
|
|
1705
1594
|
const appearanceInjected = (actions) => {
|
|
@@ -1732,21 +1621,6 @@ window.__ModuleLoader__.load({
|
|
|
1732
1621
|
locale: SETTINGS_NS,
|
|
1733
1622
|
inject: fontSizeInjected
|
|
1734
1623
|
}, FontSizeRow));
|
|
1735
|
-
const leadingInjected = (actions) => {
|
|
1736
|
-
leadingBound = actions;
|
|
1737
|
-
sync(theme.getTheme());
|
|
1738
|
-
return { setLeading: (px) => {
|
|
1739
|
-
theme.setLeading(px);
|
|
1740
|
-
} };
|
|
1741
|
-
};
|
|
1742
|
-
ctx.slots.inject("settings.general.item", () => ctx.slots.register({
|
|
1743
|
-
name: "settings.general.item",
|
|
1744
|
-
id: "line-spacing",
|
|
1745
|
-
order: 13,
|
|
1746
|
-
store: typographyStore,
|
|
1747
|
-
locale: SETTINGS_NS,
|
|
1748
|
-
inject: leadingInjected
|
|
1749
|
-
}, LineSpacingRow));
|
|
1750
1624
|
}
|
|
1751
1625
|
//#endregion
|
|
1752
1626
|
exports.SETTINGS_NS = SETTINGS_NS;
|
package/lib/index.js
CHANGED
|
@@ -13,8 +13,6 @@ const THEME_SETTINGS_NAMESPACE = "ui-theme";
|
|
|
13
13
|
const THEME_PREFERENCE_FIELD = "preference";
|
|
14
14
|
/** Field carrying the conversation content font size. */
|
|
15
15
|
const FONT_SIZE_FIELD = "fontSize";
|
|
16
|
-
/** Field carrying the conversation content leading adjustment. */
|
|
17
|
-
const LEADING_FIELD = "leading";
|
|
18
16
|
/** Default preference when the user-settings document has no override. */
|
|
19
17
|
const DEFAULT_PREFERENCE = "system";
|
|
20
18
|
/** Smallest accepted content font size (px). */
|
|
@@ -23,24 +21,17 @@ const FONT_SIZE_MIN = 10;
|
|
|
23
21
|
const FONT_SIZE_MAX = 22;
|
|
24
22
|
/** Content font size when the user-settings document has no override (px). */
|
|
25
23
|
const DEFAULT_FONT_SIZE = 14;
|
|
26
|
-
/** Tightest accepted leading adjustment (px). */
|
|
27
|
-
const LEADING_MIN = -2;
|
|
28
|
-
/** Loosest accepted leading adjustment (px). */
|
|
29
|
-
const LEADING_MAX = 8;
|
|
30
|
-
/** Leading adjustment when the user-settings document has no override (px). */
|
|
31
|
-
const DEFAULT_LEADING = 0;
|
|
32
24
|
/** Durable theme schema; also the wire envelope the browser scope validates against. */
|
|
33
25
|
const ThemeSettingsSchema = z.object({
|
|
34
26
|
[THEME_PREFERENCE_FIELD]: z.union([...THEME_PREFERENCES]).default(DEFAULT_PREFERENCE),
|
|
35
|
-
[FONT_SIZE_FIELD]: z.number().step(1).min(10).max(22).default(14)
|
|
36
|
-
[LEADING_FIELD]: z.number().step(1).min(-2).max(8).default(0)
|
|
27
|
+
[FONT_SIZE_FIELD]: z.number().step(1).min(10).max(22).default(14)
|
|
37
28
|
});
|
|
38
29
|
//#endregion
|
|
39
30
|
//#region lib/types/boot-theme.js
|
|
40
31
|
/**
|
|
41
32
|
* Theme bootstrap row for the browser's pre-plugin interval. Each index
|
|
42
33
|
* render embeds the current durable built-in preference, content font size,
|
|
43
|
-
* and
|
|
34
|
+
* and content font size. Head CSS colors the document canvas before script
|
|
44
35
|
* execution; the body script installs the palette selector and both content
|
|
45
36
|
* axes that ui-layout's ThemePresenter adopts after the client plugin tree
|
|
46
37
|
* activates.
|
|
@@ -56,7 +47,7 @@ function bootThemeStyle(preference) {
|
|
|
56
47
|
return `${light}@media(prefers-color-scheme:dark){${dark}}`;
|
|
57
48
|
}
|
|
58
49
|
/** Build the body script that installs the palette selector, font size, and leading. */
|
|
59
|
-
function bootThemeBodyScript(preference, fontSize
|
|
50
|
+
function bootThemeBodyScript(preference, fontSize) {
|
|
60
51
|
return `(() => {
|
|
61
52
|
const preference = ${JSON.stringify(preference)}
|
|
62
53
|
const systemDark = preference === 'system'
|
|
@@ -66,7 +57,6 @@ function bootThemeBodyScript(preference, fontSize, leading) {
|
|
|
66
57
|
document.documentElement.dataset.dsThemeSource = preference
|
|
67
58
|
document.body.toggleAttribute('data-ds-dark-theme', dark)
|
|
68
59
|
document.body.style.setProperty('--qilin-content-font-size', ${JSON.stringify(`${fontSize}px`)})
|
|
69
|
-
document.body.style.setProperty('--qilin-content-leading', ${JSON.stringify(`${leading}px`)})
|
|
70
60
|
})()`;
|
|
71
61
|
}
|
|
72
62
|
/**
|
|
@@ -75,17 +65,16 @@ function bootThemeBodyScript(preference, fontSize, leading) {
|
|
|
75
65
|
* content font size and leading before the shell mount and module script.
|
|
76
66
|
* @param preference - Current Host-backed built-in preference.
|
|
77
67
|
* @param fontSize - Current Host-backed content font size in px.
|
|
78
|
-
* @param leading - Current Host-backed leading adjustment in px.
|
|
79
68
|
* @returns head style and body script rows in execution order.
|
|
80
69
|
*/
|
|
81
|
-
function bootThemeInjections(preference = DEFAULT_PREFERENCE, fontSize = 14
|
|
70
|
+
function bootThemeInjections(preference = DEFAULT_PREFERENCE, fontSize = 14) {
|
|
82
71
|
return [{
|
|
83
72
|
kind: "style",
|
|
84
73
|
text: bootThemeStyle(preference)
|
|
85
74
|
}, {
|
|
86
75
|
kind: "script",
|
|
87
76
|
placement: "body",
|
|
88
|
-
text: bootThemeBodyScript(preference, fontSize
|
|
77
|
+
text: bootThemeBodyScript(preference, fontSize)
|
|
89
78
|
}];
|
|
90
79
|
}
|
|
91
80
|
//#endregion
|
|
@@ -96,8 +85,7 @@ const THEME_NAMESPACE = THEME_SETTINGS_NAMESPACE;
|
|
|
96
85
|
function readSection(ctx) {
|
|
97
86
|
const fallback = {
|
|
98
87
|
preference: DEFAULT_PREFERENCE,
|
|
99
|
-
fontSize: 14
|
|
100
|
-
leading: 0
|
|
88
|
+
fontSize: 14
|
|
101
89
|
};
|
|
102
90
|
const settings = ctx.get("settings");
|
|
103
91
|
if (settings === void 0) return fallback;
|
|
@@ -117,8 +105,8 @@ function apply(ctx) {
|
|
|
117
105
|
});
|
|
118
106
|
ctx.on("webserver/index-inject", (table) => {
|
|
119
107
|
const section = readSection(ctx);
|
|
120
|
-
table.push(...bootThemeInjections(section.preference, section.fontSize
|
|
108
|
+
table.push(...bootThemeInjections(section.preference, section.fontSize));
|
|
121
109
|
}, { prepend: true });
|
|
122
110
|
}
|
|
123
111
|
//#endregion
|
|
124
|
-
export { DEFAULT_FONT_SIZE,
|
|
112
|
+
export { DEFAULT_FONT_SIZE, DEFAULT_PREFERENCE, FONT_SIZE_FIELD, FONT_SIZE_MAX, FONT_SIZE_MIN, THEME_PREFERENCES, THEME_PREFERENCE_FIELD, THEME_SETTINGS_NAMESPACE, apply };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme bootstrap row for the browser's pre-plugin interval. Each index
|
|
3
3
|
* render embeds the current durable built-in preference, content font size,
|
|
4
|
-
* and
|
|
4
|
+
* and content font size. Head CSS colors the document canvas before script
|
|
5
5
|
* execution; the body script installs the palette selector and both content
|
|
6
6
|
* axes that ui-layout's ThemePresenter adopts after the client plugin tree
|
|
7
7
|
* activates.
|
|
@@ -14,8 +14,7 @@ import { type ThemePreference } from './theme-settings.ts';
|
|
|
14
14
|
* content font size and leading before the shell mount and module script.
|
|
15
15
|
* @param preference - Current Host-backed built-in preference.
|
|
16
16
|
* @param fontSize - Current Host-backed content font size in px.
|
|
17
|
-
* @param leading - Current Host-backed leading adjustment in px.
|
|
18
17
|
* @returns head style and body script rows in execution order.
|
|
19
18
|
*/
|
|
20
|
-
export declare function bootThemeInjections(preference?: ThemePreference, fontSize?: number
|
|
19
|
+
export declare function bootThemeInjections(preference?: ThemePreference, fontSize?: number): IndexInjection[];
|
|
21
20
|
//# sourceMappingURL=boot-theme.d.ts.map
|
|
@@ -12,7 +12,6 @@ import type { ConfigForm } from '@qilin-agent/client-ui-settings/client';
|
|
|
12
12
|
import { type ThemeKey } from './locales.ts';
|
|
13
13
|
import { type ThemePreference, type ThemeSettings } from '../theme-settings.ts';
|
|
14
14
|
export type { FontSizeRowComponentProps, FontSizeRowInjected } from './FontSizeRow.tsx';
|
|
15
|
-
export type { LineSpacingRowComponentProps, LineSpacingRowInjected } from './LineSpacingRow.tsx';
|
|
16
15
|
export type { AppearanceRowComponentProps, AppearanceRowInjected } from './AppearanceRow.tsx';
|
|
17
16
|
export type { AppearanceRowState, TypographyRowState } from './settings-store.ts';
|
|
18
17
|
export type { ThemeKey } from './locales.ts';
|
|
@@ -58,8 +57,6 @@ export interface ThemeSnapshot {
|
|
|
58
57
|
preference: ThemePreference;
|
|
59
58
|
/** Conversation content font size in px (integer within FONT_SIZE_MIN..FONT_SIZE_MAX). */
|
|
60
59
|
fontSize: number;
|
|
61
|
-
/** Leading added to every content line box, in px (integer within LEADING_MIN..LEADING_MAX). */
|
|
62
|
-
leading: number;
|
|
63
60
|
/**
|
|
64
61
|
* The resolved active theme (`system` resolved via prefers-color-scheme)
|
|
65
62
|
* with override layers folded into its tokens (seq order, later layers win
|
|
@@ -115,7 +112,6 @@ export declare class ThemeRuntime {
|
|
|
115
112
|
private themes;
|
|
116
113
|
private preference;
|
|
117
114
|
private fontSize;
|
|
118
|
-
private leading;
|
|
119
115
|
private revision;
|
|
120
116
|
private snapshot;
|
|
121
117
|
private readonly media;
|
|
@@ -152,13 +148,6 @@ export declare class ThemeRuntime {
|
|
|
152
148
|
* @param px - integer px within FONT_SIZE_MIN..FONT_SIZE_MAX; out-of-range or fractional values throw.
|
|
153
149
|
*/
|
|
154
150
|
setFontSize(px: number): void;
|
|
155
|
-
/**
|
|
156
|
-
* Change the conversation content leading adjustment — the only leading
|
|
157
|
-
* write entry. Accepted values are written through the settings scope and
|
|
158
|
-
* emit `theme/change`.
|
|
159
|
-
* @param px - integer px within LEADING_MIN..LEADING_MAX; out-of-range or fractional values throw.
|
|
160
|
-
*/
|
|
161
|
-
setLeading(px: number): void;
|
|
162
151
|
/** Adopt the scope's accepted durable preference without writing it back. */
|
|
163
152
|
private adopt;
|
|
164
153
|
/**
|
|
@@ -10,11 +10,6 @@ export declare const zh: {
|
|
|
10
10
|
'fontSize.unit': string;
|
|
11
11
|
'fontSize.increase': string;
|
|
12
12
|
'fontSize.decrease': string;
|
|
13
|
-
'leading.title': string;
|
|
14
|
-
'leading.description': string;
|
|
15
|
-
'leading.unit': string;
|
|
16
|
-
'leading.increase': string;
|
|
17
|
-
'leading.decrease': string;
|
|
18
13
|
};
|
|
19
14
|
/** The settings.theme namespace key union. */
|
|
20
15
|
export type ThemeKey = keyof typeof zh;
|
|
@@ -29,10 +24,5 @@ export declare const en: {
|
|
|
29
24
|
'fontSize.unit': string;
|
|
30
25
|
'fontSize.increase': string;
|
|
31
26
|
'fontSize.decrease': string;
|
|
32
|
-
'leading.title': string;
|
|
33
|
-
'leading.description': string;
|
|
34
|
-
'leading.unit': string;
|
|
35
|
-
'leading.increase': string;
|
|
36
|
-
'leading.decrease': string;
|
|
37
27
|
};
|
|
38
28
|
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -25,14 +25,12 @@ export declare function createAppearanceRowStore(): EngineStoreHandle<Appearance
|
|
|
25
25
|
export interface TypographyRowState {
|
|
26
26
|
/** Persisted content font size in px. */
|
|
27
27
|
fontSize: number;
|
|
28
|
-
/** Persisted leading adjustment in px; 0 keeps the shipped line heights. */
|
|
29
|
-
leading: number;
|
|
30
28
|
/** Service revision; -1 until first sync so revision 0 lands as a change. */
|
|
31
29
|
revision: number;
|
|
32
30
|
}
|
|
33
31
|
/** Declared action shape giving the exported factory a stable return type. */
|
|
34
32
|
type TypographyRowActions = {
|
|
35
|
-
sync: (draft: TypographyRowState, fontSize: number,
|
|
33
|
+
sync: (draft: TypographyRowState, fontSize: number, revision: number) => void;
|
|
36
34
|
};
|
|
37
35
|
/**
|
|
38
36
|
* Declares the shared typography-row state and write surface.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Host registration for the browser theme preference and pre-plugin palette. */
|
|
2
2
|
import type { Context } from '@qilin-agent/kylin';
|
|
3
|
-
export { DEFAULT_FONT_SIZE,
|
|
3
|
+
export { DEFAULT_FONT_SIZE, DEFAULT_PREFERENCE, FONT_SIZE_FIELD, FONT_SIZE_MAX, FONT_SIZE_MIN, THEME_PREFERENCE_FIELD, THEME_PREFERENCES, THEME_SETTINGS_NAMESPACE, type ThemePreference, type ThemeSettings, } from './theme-settings.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Register the durable theme section when the optional settings service is
|
|
6
6
|
* composed, and answer every index injection collection with the current
|
|
@@ -8,8 +8,6 @@ export declare const THEME_SETTINGS_NAMESPACE = "ui-theme";
|
|
|
8
8
|
export declare const THEME_PREFERENCE_FIELD = "preference";
|
|
9
9
|
/** Field carrying the conversation content font size. */
|
|
10
10
|
export declare const FONT_SIZE_FIELD = "fontSize";
|
|
11
|
-
/** Field carrying the conversation content leading adjustment. */
|
|
12
|
-
export declare const LEADING_FIELD = "leading";
|
|
13
11
|
/** Theme preference persisted by the product Appearance row. */
|
|
14
12
|
export type ThemePreference = typeof THEME_PREFERENCES[number];
|
|
15
13
|
/** Default preference when the user-settings document has no override. */
|
|
@@ -20,20 +18,12 @@ export declare const FONT_SIZE_MIN = 10;
|
|
|
20
18
|
export declare const FONT_SIZE_MAX = 22;
|
|
21
19
|
/** Content font size when the user-settings document has no override (px). */
|
|
22
20
|
export declare const DEFAULT_FONT_SIZE = 14;
|
|
23
|
-
/** Tightest accepted leading adjustment (px). */
|
|
24
|
-
export declare const LEADING_MIN = -2;
|
|
25
|
-
/** Loosest accepted leading adjustment (px). */
|
|
26
|
-
export declare const LEADING_MAX = 8;
|
|
27
|
-
/** Leading adjustment when the user-settings document has no override (px). */
|
|
28
|
-
export declare const DEFAULT_LEADING = 0;
|
|
29
21
|
/** Durable theme section shared by the Host schema and the browser scope. */
|
|
30
22
|
export interface ThemeSettings {
|
|
31
23
|
/** Selected built-in preference. */
|
|
32
24
|
preference: ThemePreference;
|
|
33
25
|
/** Conversation content font size in px (integer within {@link FONT_SIZE_MIN}..{@link FONT_SIZE_MAX}). */
|
|
34
26
|
fontSize: number;
|
|
35
|
-
/** Leading added to every content line box, in px (integer within {@link LEADING_MIN}..{@link LEADING_MAX}). */
|
|
36
|
-
leading: number;
|
|
37
27
|
}
|
|
38
28
|
/** Durable theme schema; also the wire envelope the browser scope validates against. */
|
|
39
29
|
export declare const ThemeSettingsSchema: z<ThemeSettings>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/client-ui-theme",
|
|
3
3
|
"description": "Theme plugin: Host bootstrap for the pre-plugin palette; DOM-free ThemeRuntime for light/dark/system state; --qilin-* token styles and Appearance settings row",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -50,17 +50,17 @@
|
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"clsx": "^2.0.0",
|
|
52
52
|
"@qilin-agent/kylin": "~4.0.3",
|
|
53
|
-
"@qilin-agent/api-remotes": "3.1.
|
|
54
|
-
"@qilin-agent/client-
|
|
55
|
-
"@qilin-agent/client-
|
|
56
|
-
"@qilin-agent/client-
|
|
57
|
-
"@qilin-agent/client-test-runtime": "3.1.
|
|
58
|
-
"@qilin-agent/client-ui-
|
|
59
|
-
"@qilin-agent/client-ui-settings": "3.1.
|
|
60
|
-
"@qilin-agent/client-ui-
|
|
61
|
-
"@qilin-agent/
|
|
62
|
-
"@qilin-agent/
|
|
63
|
-
"@qilin-agent/
|
|
53
|
+
"@qilin-agent/api-remotes": "3.1.5",
|
|
54
|
+
"@qilin-agent/client-locale": "3.1.5",
|
|
55
|
+
"@qilin-agent/client-store": "3.1.5",
|
|
56
|
+
"@qilin-agent/client-connection": "3.1.5",
|
|
57
|
+
"@qilin-agent/client-test-runtime": "3.1.5",
|
|
58
|
+
"@qilin-agent/client-ui-renderer": "3.1.5",
|
|
59
|
+
"@qilin-agent/client-ui-settings": "3.1.5",
|
|
60
|
+
"@qilin-agent/client-ui-slots": "3.1.5",
|
|
61
|
+
"@qilin-agent/client-ui-primitives": "3.1.5",
|
|
62
|
+
"@qilin-agent/host-webserver": "3.1.5",
|
|
63
|
+
"@qilin-agent/settings": "3.1.5"
|
|
64
64
|
},
|
|
65
65
|
"files": [
|
|
66
66
|
"lib/index.js",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { PropsLocale, PropsRuntime, PropsStore } from '@qilin-agent/client-ui-slots';
|
|
2
|
-
import type { createTypographyRowStore } from './settings-store.ts';
|
|
3
|
-
/** Injected business face: the preference write (t rides the standard locale seat). */
|
|
4
|
-
export interface LineSpacingRowInjected {
|
|
5
|
-
/** Change the content leading adjustment (integer px within LEADING_MIN..LEADING_MAX). */
|
|
6
|
-
setLeading: (px: number) => void;
|
|
7
|
-
}
|
|
8
|
-
/** Full component props: runtime share + store share + locale seat + injected face. */
|
|
9
|
-
export type LineSpacingRowComponentProps = PropsRuntime<'settings.general.item'> & PropsStore<ReturnType<typeof createTypographyRowStore>> & PropsLocale<'settings.theme'> & LineSpacingRowInjected;
|
|
10
|
-
/**
|
|
11
|
-
* Render the line-spacing row.
|
|
12
|
-
* @param props - composed slot props.
|
|
13
|
-
* @returns the row element tree.
|
|
14
|
-
*/
|
|
15
|
-
export declare function LineSpacingRow({ t, setLeading, useStore }: LineSpacingRowComponentProps): import("react").JSX.Element;
|
|
16
|
-
//# sourceMappingURL=LineSpacingRow.d.ts.map
|