@lynn123411/dsh-maple-theme 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DETAILS.md +137 -0
- package/README.md +28 -2
- package/assets/icon.svg +5 -0
- package/cordis.patch.yml +11 -0
- package/lib/client.js +560 -0
- package/lib/client.js.map +7 -0
- package/lib/index.js +36 -0
- package/lib/index.js.map +7 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +94 -4
- package/src/client/binding.ts +69 -0
- package/src/client/card-css.ts +20 -0
- package/src/client/card.tsx +179 -0
- package/src/client/css.d.ts +5 -0
- package/src/client/index.ts +149 -0
- package/src/client/locales.ts +60 -0
- package/src/client/settings.ts +171 -0
- package/src/client/styles/markdown.css +266 -0
- package/src/client/styles/shell.css +83 -0
- package/src/client/styles/tokens.css +119 -0
- package/src/client/tokens.ts +78 -0
- package/src/index.ts +69 -0
package/lib/client.js
ADDED
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({ id: "@lynn123411/dsh-maple-theme", factory: (require) => { var module = { exports: {} }; var exports = module.exports;
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name2 in all)
|
|
9
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/client/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
BUNDLE_CONFIG_SLOT: () => BUNDLE_CONFIG_SLOT,
|
|
25
|
+
BUNDLE_NAME: () => BUNDLE_NAME,
|
|
26
|
+
CODE_ATTRIBUTE: () => CODE_ATTRIBUTE,
|
|
27
|
+
DEFAULT_SETTINGS: () => DEFAULT_SETTINGS,
|
|
28
|
+
HEADING_ATTRIBUTE: () => HEADING_ATTRIBUTE,
|
|
29
|
+
INDICATOR_ATTRIBUTE: () => INDICATOR_ATTRIBUTE,
|
|
30
|
+
MapleThemeCard: () => MapleThemeCard,
|
|
31
|
+
NS: () => NS,
|
|
32
|
+
ROOT_ATTRIBUTE: () => ROOT_ATTRIBUTE,
|
|
33
|
+
ROOT_VARIABLES: () => ROOT_VARIABLES,
|
|
34
|
+
SETTINGS_NAMESPACE: () => SETTINGS_NAMESPACE,
|
|
35
|
+
apply: () => apply,
|
|
36
|
+
applyProjection: () => applyProjection,
|
|
37
|
+
bindProjection: () => bindProjection,
|
|
38
|
+
clampNumber: () => clampNumber,
|
|
39
|
+
clearProjection: () => clearProjection,
|
|
40
|
+
inject: () => inject,
|
|
41
|
+
name: () => name,
|
|
42
|
+
normalizeSettings: () => normalizeSettings,
|
|
43
|
+
projectSettings: () => projectSettings,
|
|
44
|
+
readSettings: () => readSettings
|
|
45
|
+
});
|
|
46
|
+
module.exports = __toCommonJS(index_exports);
|
|
47
|
+
|
|
48
|
+
// src/client/settings.ts
|
|
49
|
+
var ROOT_ATTRIBUTE = "data-maple-theme";
|
|
50
|
+
var HEADING_ATTRIBUTE = "data-maple-heading";
|
|
51
|
+
var INDICATOR_ATTRIBUTE = "data-maple-indicator";
|
|
52
|
+
var CODE_ATTRIBUTE = "data-maple-code";
|
|
53
|
+
var SHELL_ATTRIBUTE = "data-maple-shell";
|
|
54
|
+
var ROOT_VARIABLES = [
|
|
55
|
+
"--maple-hue-light",
|
|
56
|
+
"--maple-hue-dark",
|
|
57
|
+
"--maple-line-height",
|
|
58
|
+
"--maple-p-gap"
|
|
59
|
+
];
|
|
60
|
+
var DEFAULT_SETTINGS = Object.freeze({
|
|
61
|
+
hueLight: 35,
|
|
62
|
+
hueDark: 207,
|
|
63
|
+
lineHeight: 1.75,
|
|
64
|
+
paragraphGap: 10,
|
|
65
|
+
headingColor: "colorful",
|
|
66
|
+
headingIndicator: true,
|
|
67
|
+
codePalette: true,
|
|
68
|
+
shellSkin: true
|
|
69
|
+
});
|
|
70
|
+
function clampNumber(value, min, max, fallback) {
|
|
71
|
+
if (typeof value !== "number" && typeof value !== "string") return fallback;
|
|
72
|
+
if (typeof value === "string" && value.trim() === "") return fallback;
|
|
73
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
74
|
+
if (!Number.isFinite(parsed)) return fallback;
|
|
75
|
+
return Math.min(max, Math.max(min, parsed));
|
|
76
|
+
}
|
|
77
|
+
function normalizeSettings(raw) {
|
|
78
|
+
const source = raw ?? {};
|
|
79
|
+
const heading = source.headingColor;
|
|
80
|
+
return {
|
|
81
|
+
hueLight: clampNumber(source.hueLight, 0, 360, DEFAULT_SETTINGS.hueLight),
|
|
82
|
+
hueDark: clampNumber(source.hueDark, 0, 360, DEFAULT_SETTINGS.hueDark),
|
|
83
|
+
lineHeight: clampNumber(source.lineHeight, 1.4, 2, DEFAULT_SETTINGS.lineHeight),
|
|
84
|
+
paragraphGap: clampNumber(source.paragraphGap, 4, 24, DEFAULT_SETTINGS.paragraphGap),
|
|
85
|
+
headingColor: heading === "colorful" || heading === "accent" || heading === "text" ? heading : DEFAULT_SETTINGS.headingColor,
|
|
86
|
+
headingIndicator: source.headingIndicator ?? DEFAULT_SETTINGS.headingIndicator,
|
|
87
|
+
codePalette: source.codePalette ?? DEFAULT_SETTINGS.codePalette,
|
|
88
|
+
shellSkin: source.shellSkin ?? DEFAULT_SETTINGS.shellSkin
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function projectSettings(settings, enabled = true) {
|
|
92
|
+
if (!enabled) {
|
|
93
|
+
const variables = {};
|
|
94
|
+
for (const name2 of ROOT_VARIABLES) variables[name2] = null;
|
|
95
|
+
return {
|
|
96
|
+
attributes: {
|
|
97
|
+
[ROOT_ATTRIBUTE]: null,
|
|
98
|
+
[HEADING_ATTRIBUTE]: null,
|
|
99
|
+
[INDICATOR_ATTRIBUTE]: null,
|
|
100
|
+
[CODE_ATTRIBUTE]: null,
|
|
101
|
+
[SHELL_ATTRIBUTE]: null
|
|
102
|
+
},
|
|
103
|
+
variables
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
attributes: {
|
|
108
|
+
[ROOT_ATTRIBUTE]: "on",
|
|
109
|
+
[HEADING_ATTRIBUTE]: settings.headingColor,
|
|
110
|
+
[INDICATOR_ATTRIBUTE]: settings.headingIndicator ? "on" : null,
|
|
111
|
+
[CODE_ATTRIBUTE]: settings.codePalette ? "on" : null,
|
|
112
|
+
[SHELL_ATTRIBUTE]: settings.shellSkin ? "on" : null
|
|
113
|
+
},
|
|
114
|
+
variables: {
|
|
115
|
+
"--maple-hue-light": String(settings.hueLight),
|
|
116
|
+
"--maple-hue-dark": String(settings.hueDark),
|
|
117
|
+
"--maple-line-height": String(settings.lineHeight),
|
|
118
|
+
"--maple-p-gap": `${settings.paragraphGap}px`
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function applyProjection(root, projection) {
|
|
123
|
+
for (const [attribute, value] of Object.entries(projection.attributes)) {
|
|
124
|
+
if (value === null) root.removeAttribute(attribute);
|
|
125
|
+
else root.setAttribute(attribute, value);
|
|
126
|
+
}
|
|
127
|
+
for (const [property, value] of Object.entries(projection.variables)) {
|
|
128
|
+
if (value === null) root.style.removeProperty(property);
|
|
129
|
+
else root.style.setProperty(property, value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function clearProjection(root) {
|
|
133
|
+
applyProjection(root, projectSettings(normalizeSettings(void 0), false));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/client/binding.ts
|
|
137
|
+
var SETTINGS_NAMESPACE = "dsh-maple-theme";
|
|
138
|
+
var BUNDLE_CONFIG_SLOT = "plugins.bundle.config";
|
|
139
|
+
var BUNDLE_NAME = "@lynn123411/dsh-maple-theme";
|
|
140
|
+
function readSettings(form) {
|
|
141
|
+
const snapshot = form.getSnapshot();
|
|
142
|
+
if (snapshot.status === "unavailable") return void 0;
|
|
143
|
+
return normalizeSettings(snapshot.value);
|
|
144
|
+
}
|
|
145
|
+
function bindProjection(root, form) {
|
|
146
|
+
const sync = () => {
|
|
147
|
+
const settings = readSettings(form);
|
|
148
|
+
applyProjection(root, projectSettings(settings ?? normalizeSettings(void 0)));
|
|
149
|
+
};
|
|
150
|
+
sync();
|
|
151
|
+
const off = form.subscribe(sync);
|
|
152
|
+
return () => {
|
|
153
|
+
off();
|
|
154
|
+
clearProjection(root);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// src/client/card-css.ts
|
|
159
|
+
var CARD_CSS = `
|
|
160
|
+
.dsh-maple-card{display:flex;flex-direction:column;gap:20px;padding:16px 0}
|
|
161
|
+
.dsh-maple-group{display:flex;flex-direction:column;gap:4px}
|
|
162
|
+
.dsh-maple-group-title{font-size:12px;line-height:18px;font-weight:600;color:var(--dsw-alias-label-tertiary);letter-spacing:.02em}
|
|
163
|
+
.dsh-maple-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:0.5px solid var(--dsw-alias-border-l1)}
|
|
164
|
+
.dsh-maple-row:last-child{border-bottom:0}
|
|
165
|
+
.dsh-maple-row-info{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
166
|
+
.dsh-maple-row-title{font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}
|
|
167
|
+
.dsh-maple-row-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
|
|
168
|
+
.dsh-maple-row-field{flex:none;display:flex;align-items:center;gap:8px}
|
|
169
|
+
.dsh-maple-number{width:88px}
|
|
170
|
+
.dsh-maple-unit{font-size:12px;color:var(--dsw-alias-label-tertiary);min-width:18px}
|
|
171
|
+
.dsh-maple-note{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary);padding-top:12px}
|
|
172
|
+
.dsh-maple-empty{font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary)}
|
|
173
|
+
`;
|
|
174
|
+
|
|
175
|
+
// src/client/card.tsx
|
|
176
|
+
var import_react = require("react");
|
|
177
|
+
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
178
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
179
|
+
var HEADING_OPTIONS = [
|
|
180
|
+
{ value: "colorful", key: "card.headingColorColorful" },
|
|
181
|
+
{ value: "accent", key: "card.headingColorAccent" },
|
|
182
|
+
{ value: "text", key: "card.headingColorText" }
|
|
183
|
+
];
|
|
184
|
+
function Row({ title, hint, children }) {
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-maple-row", children: [
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-maple-row-info", children: [
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-row-title", children: title }),
|
|
188
|
+
hint !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-row-hint", children: hint })
|
|
189
|
+
] }),
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-row-field", children })
|
|
191
|
+
] });
|
|
192
|
+
}
|
|
193
|
+
function NumberField({ value, min, max, step, unit, label, onCommit }) {
|
|
194
|
+
const [text, setText] = (0, import_react.useState)(String(value));
|
|
195
|
+
(0, import_react.useEffect)(() => {
|
|
196
|
+
setText(String(value));
|
|
197
|
+
}, [value]);
|
|
198
|
+
const commit = () => {
|
|
199
|
+
const parsed = Number(text);
|
|
200
|
+
if (!Number.isFinite(parsed)) {
|
|
201
|
+
setText(String(value));
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const clamped = Math.min(max, Math.max(min, Math.round(parsed / step) * step));
|
|
205
|
+
setText(String(clamped));
|
|
206
|
+
if (clamped !== value) onCommit(clamped);
|
|
207
|
+
};
|
|
208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
|
+
import_dsh_client_ui_primitives.Input,
|
|
211
|
+
{
|
|
212
|
+
className: "dsh-maple-number",
|
|
213
|
+
type: "number",
|
|
214
|
+
inputMode: "decimal",
|
|
215
|
+
min,
|
|
216
|
+
max,
|
|
217
|
+
step,
|
|
218
|
+
value: text,
|
|
219
|
+
"aria-label": label,
|
|
220
|
+
onChange: (event) => {
|
|
221
|
+
setText(event.target.value);
|
|
222
|
+
},
|
|
223
|
+
onBlur: commit,
|
|
224
|
+
onKeyDown: (event) => {
|
|
225
|
+
if (event.key === "Enter") {
|
|
226
|
+
event.currentTarget.blur();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsh-maple-unit", children: unit })
|
|
232
|
+
] });
|
|
233
|
+
}
|
|
234
|
+
function MapleThemeCard(props) {
|
|
235
|
+
const { form } = props;
|
|
236
|
+
const t = (key) => props.t(key);
|
|
237
|
+
const [settings, setSettings] = (0, import_react.useState)(() => readSettings(form));
|
|
238
|
+
const [available, setAvailable] = (0, import_react.useState)(() => form.getSnapshot().status !== "unavailable");
|
|
239
|
+
(0, import_react.useEffect)(() => {
|
|
240
|
+
const sync = () => {
|
|
241
|
+
setSettings(readSettings(form));
|
|
242
|
+
setAvailable(form.getSnapshot().status !== "unavailable");
|
|
243
|
+
};
|
|
244
|
+
sync();
|
|
245
|
+
return form.subscribe(sync);
|
|
246
|
+
}, [form]);
|
|
247
|
+
if (!available) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-card", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-empty", children: t("card.unavailable") }) });
|
|
248
|
+
const current = settings ?? DEFAULT_SETTINGS;
|
|
249
|
+
const write = (field, value) => {
|
|
250
|
+
void form.set(field, value);
|
|
251
|
+
};
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-maple-card", children: [
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-maple-group", children: [
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-group-title", children: t("card.colors") }),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.hueLight"), hint: t("card.hueLightHint"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
256
|
+
NumberField,
|
|
257
|
+
{
|
|
258
|
+
value: current.hueLight,
|
|
259
|
+
min: 0,
|
|
260
|
+
max: 360,
|
|
261
|
+
step: 1,
|
|
262
|
+
unit: "\xB0",
|
|
263
|
+
label: t("card.hueLight"),
|
|
264
|
+
onCommit: (next) => {
|
|
265
|
+
write("hueLight", next);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
) }),
|
|
269
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.hueDark"), hint: t("card.hueDarkHint"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
270
|
+
NumberField,
|
|
271
|
+
{
|
|
272
|
+
value: current.hueDark,
|
|
273
|
+
min: 0,
|
|
274
|
+
max: 360,
|
|
275
|
+
step: 1,
|
|
276
|
+
unit: "\xB0",
|
|
277
|
+
label: t("card.hueDark"),
|
|
278
|
+
onCommit: (next) => {
|
|
279
|
+
write("hueDark", next);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
) })
|
|
283
|
+
] }),
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-maple-group", children: [
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-group-title", children: t("card.typography") }),
|
|
286
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.lineHeight"), hint: t("card.lineHeightHint"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
287
|
+
NumberField,
|
|
288
|
+
{
|
|
289
|
+
value: current.lineHeight,
|
|
290
|
+
min: 1.4,
|
|
291
|
+
max: 2,
|
|
292
|
+
step: 0.05,
|
|
293
|
+
unit: "\xD7",
|
|
294
|
+
label: t("card.lineHeight"),
|
|
295
|
+
onCommit: (next) => {
|
|
296
|
+
write("lineHeight", next);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
) }),
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.paragraphGap"), hint: t("card.paragraphGapHint"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
301
|
+
NumberField,
|
|
302
|
+
{
|
|
303
|
+
value: current.paragraphGap,
|
|
304
|
+
min: 4,
|
|
305
|
+
max: 24,
|
|
306
|
+
step: 1,
|
|
307
|
+
unit: "px",
|
|
308
|
+
label: t("card.paragraphGap"),
|
|
309
|
+
onCommit: (next) => {
|
|
310
|
+
write("paragraphGap", next);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
) })
|
|
314
|
+
] }),
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-maple-group", children: [
|
|
316
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-group-title", children: t("card.headings") }),
|
|
317
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.headingColor"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
318
|
+
import_dsh_client_ui_primitives.SegmentedControl,
|
|
319
|
+
{
|
|
320
|
+
id: "dsh-maple-heading",
|
|
321
|
+
value: current.headingColor,
|
|
322
|
+
label: t("card.headingColor"),
|
|
323
|
+
options: HEADING_OPTIONS.map((option) => ({ value: option.value, label: t(option.key) })),
|
|
324
|
+
onChange: (next) => {
|
|
325
|
+
write("headingColor", next);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
) }),
|
|
329
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.headingIndicator"), hint: t("card.headingIndicatorHint"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
330
|
+
import_dsh_client_ui_primitives.Switch,
|
|
331
|
+
{
|
|
332
|
+
checked: current.headingIndicator,
|
|
333
|
+
label: t("card.headingIndicator"),
|
|
334
|
+
onChange: (next) => {
|
|
335
|
+
write("headingIndicator", next);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
) })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-maple-group", children: [
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-group-title", children: t("card.code") }),
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.codePalette"), hint: t("card.codePaletteHint"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
343
|
+
import_dsh_client_ui_primitives.Switch,
|
|
344
|
+
{
|
|
345
|
+
checked: current.codePalette,
|
|
346
|
+
label: t("card.codePalette"),
|
|
347
|
+
onChange: (next) => {
|
|
348
|
+
write("codePalette", next);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
) })
|
|
352
|
+
] }),
|
|
353
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "dsh-maple-group", children: [
|
|
354
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-group-title", children: t("card.shell") }),
|
|
355
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Row, { title: t("card.shellSkin"), hint: t("card.shellSkinHint"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
356
|
+
import_dsh_client_ui_primitives.Switch,
|
|
357
|
+
{
|
|
358
|
+
checked: current.shellSkin,
|
|
359
|
+
label: t("card.shellSkin"),
|
|
360
|
+
onChange: (next) => {
|
|
361
|
+
write("shellSkin", next);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
) })
|
|
365
|
+
] }),
|
|
366
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsh-maple-note", children: t("card.scope") })
|
|
367
|
+
] });
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
// src/client/locales.ts
|
|
371
|
+
var NS = "mapletheme";
|
|
372
|
+
var en = {
|
|
373
|
+
"card.colors": "Colors",
|
|
374
|
+
"card.hueLight": "Light hue",
|
|
375
|
+
"card.hueLightHint": "Base hue the whole light palette is derived from. Maple ships 35 (warm white).",
|
|
376
|
+
"card.hueDark": "Dark hue",
|
|
377
|
+
"card.hueDarkHint": "Base hue the whole dark palette is derived from. Maple ships 207 (cool grey).",
|
|
378
|
+
"card.typography": "Typing",
|
|
379
|
+
"card.lineHeight": "Line height",
|
|
380
|
+
"card.lineHeightHint": "Line height for conversation body text. Tighter than Maple\u2019s 1.8 because chat lines run narrower.",
|
|
381
|
+
"card.paragraphGap": "Paragraph gap",
|
|
382
|
+
"card.paragraphGapHint": "Space between two paragraphs in an answer, in pixels. Looser than Maple\u2019s 8.",
|
|
383
|
+
"card.headings": "Headings",
|
|
384
|
+
"card.headingColor": "Heading color",
|
|
385
|
+
"card.headingColorColorful": "Six colors",
|
|
386
|
+
"card.headingColorAccent": "Accent",
|
|
387
|
+
"card.headingColorText": "Body text",
|
|
388
|
+
"card.headingIndicator": "Level marker",
|
|
389
|
+
"card.headingIndicatorHint": "Show H1\u2013H6 to the left of a heading while the pointer rests on it.",
|
|
390
|
+
"card.code": "Code",
|
|
391
|
+
"card.codePalette": "Maple syntax colors",
|
|
392
|
+
"card.codePaletteHint": "Recolor fenced code blocks with the Maple syntax palette.",
|
|
393
|
+
"card.shell": "Surroundings",
|
|
394
|
+
"card.shellSkin": "Sidebar and tabs",
|
|
395
|
+
"card.shellSkinHint": "Round the sidebar rows and the active tab, drop the seam under the session header, and give the input card Maple paper.",
|
|
396
|
+
"card.scope": "The palette is global; headings, quotes, tables, lists and rules only change inside conversation answers.",
|
|
397
|
+
"card.unavailable": "The Host does not serve this configuration right now."
|
|
398
|
+
};
|
|
399
|
+
var zh = {
|
|
400
|
+
"card.colors": "\u914D\u8272",
|
|
401
|
+
"card.hueLight": "\u6D45\u8272\u57FA\u7840\u8272\u76F8",
|
|
402
|
+
"card.hueLightHint": "\u6D45\u8272\u6574\u5957\u989C\u8272\u7531\u8FD9\u4E2A\u8272\u76F8\u63A8\u5BFC\u3002Maple \u51FA\u5382\u503C\u662F 35\uFF08\u6696\u767D\uFF09\u3002",
|
|
403
|
+
"card.hueDark": "\u6DF1\u8272\u57FA\u7840\u8272\u76F8",
|
|
404
|
+
"card.hueDarkHint": "\u6DF1\u8272\u6574\u5957\u989C\u8272\u7531\u8FD9\u4E2A\u8272\u76F8\u63A8\u5BFC\u3002Maple \u51FA\u5382\u503C\u662F 207\uFF08\u51B7\u7070\uFF09\u3002",
|
|
405
|
+
"card.typography": "\u6253\u5B57\u4F53\u9A8C",
|
|
406
|
+
"card.lineHeight": "\u884C\u9AD8",
|
|
407
|
+
"card.lineHeightHint": "\u5BF9\u8BDD\u6B63\u6587\u7684\u884C\u9AD8\u500D\u6570\u3002\u6BD4 Maple \u7684 1.8 \u7D27\u4E00\u6863\uFF0C\u5BF9\u8BDD\u7684\u884C\u5BBD\u6BD4\u7B14\u8BB0\u7A84\u3002",
|
|
408
|
+
"card.paragraphGap": "\u6BB5\u843D\u95F4\u8DDD",
|
|
409
|
+
"card.paragraphGapHint": "\u4E00\u4E2A\u56DE\u7B54\u91CC\u4E24\u6BB5\u4E4B\u95F4\u7A7A\u591A\u5C11\u50CF\u7D20\u3002\u6BD4 Maple \u7684 8 \u677E\u4E00\u6863\u3002",
|
|
410
|
+
"card.headings": "\u6807\u9898",
|
|
411
|
+
"card.headingColor": "\u6807\u9898\u989C\u8272",
|
|
412
|
+
"card.headingColorColorful": "\u516D\u7EA7\u6362\u8272",
|
|
413
|
+
"card.headingColorAccent": "\u5F3A\u8C03\u8272",
|
|
414
|
+
"card.headingColorText": "\u6B63\u6587\u8272",
|
|
415
|
+
"card.headingIndicator": "\u7B49\u7EA7\u6807\u8BB0",
|
|
416
|
+
"card.headingIndicatorHint": "\u6307\u9488\u505C\u5728\u6807\u9898\u4E0A\u65F6\uFF0C\u5728\u5DE6\u8FB9\u663E\u793A H1\u2013H6\u3002",
|
|
417
|
+
"card.code": "\u4EE3\u7801",
|
|
418
|
+
"card.codePalette": "Maple \u8BED\u6CD5\u914D\u8272",
|
|
419
|
+
"card.codePaletteHint": "\u7528 Maple \u7684\u8C03\u8272\u677F\u7ED9\u56F4\u680F\u4EE3\u7801\u5757\u6362\u8BED\u6CD5\u8272\u3002",
|
|
420
|
+
"card.shell": "\u5468\u8FB9",
|
|
421
|
+
"card.shellSkin": "\u4FA7\u680F\u4E0E\u6807\u7B7E\u6761",
|
|
422
|
+
"card.shellSkinHint": "\u4FA7\u680F\u884C\u4E0E\u6D3B\u52A8\u6807\u7B7E\u6539\u6210\u5706\u89D2\uFF0C\u53BB\u6389\u4F1A\u8BDD\u5934\u90E8\u4E0B\u9762\u90A3\u6761\u63A5\u7F1D\uFF0C\u8F93\u5165\u5361\u6362\u6210 Maple \u7684\u7EB8\u8272\u3002",
|
|
423
|
+
"card.scope": "\u914D\u8272\u662F\u5168\u5C40\u7684\uFF1B\u6807\u9898\u3001\u5F15\u7528\u3001\u8868\u683C\u3001\u5217\u8868\u4E0E\u5206\u9694\u7EBF\u53EA\u5728\u5BF9\u8BDD\u6B63\u6587\u91CC\u6362\u6837\u5B50\u3002",
|
|
424
|
+
"card.unavailable": "\u5BBF\u4E3B\u5F53\u524D\u6CA1\u6709\u63D0\u4F9B\u8FD9\u4EFD\u914D\u7F6E\u3002"
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
// inline-css:/Users/tny/Desktop/work/my-dsh/plugins/dsh-maple-theme/src/client/styles/tokens.css
|
|
428
|
+
var tokens_default = "/* Maple \u88C5\u9970\u5C42\uFF1A\u6807\u9898\u914D\u8272\u3001\u4EE3\u7801\u8BED\u6CD5\u8272\u3001\u6B63\u6587\u6392\u7248\u3002\n *\n * \u914D\u8272\u4EE4\u724C\u672C\u8EAB\u4E0D\u5728\u8FD9\u91CC\u2014\u2014\u5B83\u4EEC\u8D70\u5BBF\u4E3B\u7684\u4E3B\u9898\u901A\u9053\uFF08src/client/tokens.ts +\n * ctx.theme.overrideTokens\uFF09\uFF0C\u7531\u5BBF\u4E3B\u5199\u5230 body \u7684\u884C\u5185\u6837\u5F0F\u4E0A\u3002\u8FD9\u91CC\u53EA\u5269\u4E09\u7C7B\uFF1A\n * \u6309\u5F00\u5173\u5207\u6362\u7684\u6807\u9898\u914D\u8272\u3001shiki \u8BED\u6CD5\u8272\u3001\u4EE5\u53CA\u6B63\u6587\u6392\u7248\u7684\u590D\u5408\u4EE4\u724C\u3002\n *\n * \u6BCF\u4E00\u6761\u90FD\u6302\u5728 `html[data-maple-theme='on']` \u4E0E\u5B83\u81EA\u5DF1\u7684\u5F00\u5173\u5C5E\u6027\u4E0B\u9762\uFF1A\n * \u5173\u6389\u65F6\u6574\u6BB5\u4E0D\u5339\u914D\uFF0C\u4E0D\u5FC5\u8DDF\u5BBF\u4E3B\u4E89\u4F18\u5148\u7EA7\u3002\n */\n\n/* \u6807\u9898\u516D\u8272\uFF1AMaple \u9ED8\u8BA4\u7684 colorful\uFF0C\u9010\u7EA7\u6362\u8272\u3002\u6D45\u8272\u90A3\u4E00\u5217\u6309 4.5:1 \u8C03\u8FC7\u660E\u5EA6\uFF0C\n * \u6DF1\u8272\u7528\u5B83\u81EA\u5DF1\u90A3\u5957\u63D0\u4EAE\u8272\u3002 */\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] {\n --maple-h1: hsl(0 45% 52.5%);\n --maple-h2: hsl(32 70% 37%);\n --maple-h3: hsl(95 75% 29%);\n --maple-h4: hsl(193 94% 31.5%);\n --maple-h5: hsl(260 20% 48%);\n --maple-h6: hsl(156 75% 28%);\n}\n\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] body[data-ds-dark-theme] {\n --maple-h1: hsl(0 44% 68%);\n --maple-h2: hsl(20 40% 68%);\n --maple-h3: hsl(130 32% 68%);\n --maple-h4: hsl(210 80% 72%);\n --maple-h5: hsl(247 65% 82%);\n --maple-h6: hsl(178 40% 64%);\n}\n\n/* \u5F3A\u8C03\u8272\u4E00\u6863\uFF1A\u516D\u7EA7\u6807\u9898\u7EDF\u4E00\u7528\u4E3B\u9898\u7684\u5F3A\u8C03\u8272\uFF0C\u4E0D\u5206\u7EA7\u6362\u8272\u3002\n * \u8FD9\u662F Maple \u7684\u300C\u6807\u9898\u989C\u8272 = \u5F3A\u8C03\u8272\u300D\u5206\u652F\uFF0C\u4E0E\u672C\u4E3B\u9898\u65E2\u6709\u7684\u5F3A\u8C03\u8272\u53D6\u540C\u4E00\u4E2A\u503C\u3002 */\nhtml[data-maple-theme='on'][data-maple-heading='accent'] {\n --maple-heading-color: hsl(35 26% 38%);\n}\n\n/* \u6B63\u6587\u8272\u4E00\u6863\uFF1A\u6807\u9898\u53EA\u9760\u5B57\u53F7\u4E0E\u5B57\u91CD\u533A\u5206\uFF0C\u989C\u8272\u8DDF\u6B63\u6587\u4E00\u81F4\u3002 */\nhtml[data-maple-theme='on'][data-maple-heading='text'] {\n --maple-heading-color: hsl(var(--maple-hue-light, 35) 10% 18%);\n}\n\nhtml[data-maple-theme='on'][data-maple-heading='accent'] body[data-ds-dark-theme] {\n --maple-heading-color: hsl(207 26% 72%);\n}\n\nhtml[data-maple-theme='on'][data-maple-heading='text'] body[data-ds-dark-theme] {\n --maple-heading-color: hsl(var(--maple-hue-dark, 207) 24% 88%);\n}\n\n/* \u4EE3\u7801\u8BED\u6CD5\u8272\uFF1AMaple \u7684 prism \u8C03\u8272\u677F\u843D\u5230\u5BBF\u4E3B\u7684 shiki \u53D8\u91CF\u4E0A\u3002\n * \u5BBF\u4E3B CodeBlock \u53EA\u8BA4 --shiki-token-*\uFF0C\u6362\u8FD9\u4E00\u7EC4\u5C31\u6574\u4F53\u6362\u914D\u8272\u3002 */\nhtml[data-maple-theme='on'][data-maple-code='on'] {\n --shiki-token-keyword: hsl(260 20% 48%);\n --shiki-token-string: hsl(95 75% 29%);\n --shiki-token-string-expression: hsl(95 75% 29%);\n --shiki-token-function: hsl(193 94% 31.5%);\n --shiki-token-constant: hsl(156 75% 28%);\n --shiki-token-parameter: hsl(32 70% 37%);\n --shiki-token-comment: hsl(35 6% 58%);\n --shiki-token-punctuation: hsl(35 7% 46%);\n --shiki-token-link: hsl(162 76% 29%);\n}\n\nhtml[data-maple-theme='on'][data-maple-code='on'] body[data-ds-dark-theme] {\n --shiki-token-keyword: hsl(247 65% 82%);\n --shiki-token-string: hsl(130 32% 68%);\n --shiki-token-string-expression: hsl(130 32% 68%);\n --shiki-token-function: hsl(210 80% 72%);\n --shiki-token-constant: hsl(178 40% 64%);\n --shiki-token-parameter: hsl(20 40% 68%);\n --shiki-token-comment: hsl(207 10% 46%);\n --shiki-token-punctuation: hsl(207 12% 58%);\n --shiki-token-link: hsl(178 30% 62%);\n}\n\n/* \u6B63\u6587\u6392\u7248\uFF1AMarkdownText \u7528 `font: var(--dsw-font-markdown-*)` \u4E00\u6B21\u53D6\u5B57\u53F7\u3001\u884C\u9AD8\u4E0E\u5B57\u65CF\uFF0C\n * \u6240\u4EE5\u6539\u8FD9\u51E0\u6761\u5C31\u591F\uFF0C\u4E0D\u5FC5\u78B0 CSS Modules \u7684\u54C8\u5E0C\u7C7B\u540D\u3002\n *\n * \u884C\u9AD8\u4ECE\u5BBF\u4E3B\u7684\u5B57\u53F7\u8F74\u63A8\uFF0C\u4E0D\u5199\u6B7B\u50CF\u7D20\uFF1A\u5BBF\u4E3B\u628A\u6B63\u6587\u884C\u9AD8\u5199\u6210\u300C24px + \u5B57\u53F7\u589E\u91CF\u300D\uFF0C\n * \u8FD9\u91CC\u6539\u6210\u300C\u5B57\u53F7 \xD7 \u914D\u7F6E\u7684\u884C\u9AD8\u500D\u6570\u300D\u2014\u2014\u4E24\u4E2A\u8F74\u540C\u65F6\u751F\u6548\uFF0C\u7528\u6237\u8C03\u5927\u5B57\u53F7\u65F6\u884C\u9AD8\u8DDF\u7740\u957F\u3002\n *\n * h5 / h6 \u5BBF\u4E3B\u5F52\u5E76\u8FDB base-strong\uFF0C\u6CA1\u6709\u72EC\u7ACB\u4EE4\u724C\uFF0C\u7531 markdown.css \u7528\u5143\u7D20\u9009\u62E9\u5668\u8865\u3002 */\nhtml[data-maple-theme='on'] body {\n --dsw-font-markdown-base:\n var(--dsh-content-font-size, 14px) / calc(var(--dsh-content-font-size, 14px) * var(--maple-line-height, 1.75))\n var(--dsw-font-family);\n --dsw-font-markdown-base-font-size: var(--dsh-content-font-size, 14px);\n --dsw-font-markdown-base-line-height: calc(var(--dsh-content-font-size, 14px) * var(--maple-line-height, 1.75));\n\n --dsw-font-markdown-base-strong:\n 600 var(--dsh-content-font-size, 14px) / calc(var(--dsh-content-font-size, 14px) * var(--maple-line-height, 1.75))\n var(--dsw-font-family);\n --dsw-font-markdown-base-strong-font-size: var(--dsh-content-font-size, 14px);\n --dsw-font-markdown-base-strong-line-height: calc(var(--dsh-content-font-size, 14px) * var(--maple-line-height, 1.75));\n\n --dsw-font-markdown-h1:\n 700 calc(var(--dsh-content-font-size, 14px) * 1.6) / 1.3 var(--dsw-font-family);\n --dsw-font-markdown-h1-font-size: calc(var(--dsh-content-font-size, 14px) * 1.6);\n --dsw-font-markdown-h1-font-weight: 700;\n --dsw-font-markdown-h1-line-height: 1.3;\n\n --dsw-font-markdown-h2:\n 700 calc(var(--dsh-content-font-size, 14px) * 1.5) / 1.3 var(--dsw-font-family);\n --dsw-font-markdown-h2-font-size: calc(var(--dsh-content-font-size, 14px) * 1.5);\n --dsw-font-markdown-h2-font-weight: 700;\n --dsw-font-markdown-h2-line-height: 1.3;\n\n --dsw-font-markdown-h3:\n 600 calc(var(--dsh-content-font-size, 14px) * 1.35) / 1.35 var(--dsw-font-family);\n --dsw-font-markdown-h3-font-size: calc(var(--dsh-content-font-size, 14px) * 1.35);\n --dsw-font-markdown-h3-font-weight: 600;\n --dsw-font-markdown-h3-line-height: 1.35;\n\n --dsw-font-markdown-h4:\n 600 calc(var(--dsh-content-font-size, 14px) * 1.15) / 1.4 var(--dsw-font-family);\n --dsw-font-markdown-h4-font-size: calc(var(--dsh-content-font-size, 14px) * 1.15);\n --dsw-font-markdown-h4-font-weight: 600;\n --dsw-font-markdown-h4-line-height: 1.4;\n}\n";
|
|
429
|
+
|
|
430
|
+
// src/client/tokens.ts
|
|
431
|
+
var THEME_SOURCE = "@lynn123411/dsh-maple-theme";
|
|
432
|
+
var MAPLE_TOKENS = {
|
|
433
|
+
"--dsw-alias-bg-base": { light: "hsl(var(--maple-hue-light, 35) 12% 97%)", dark: "hsl(var(--maple-hue-dark, 207) 6% 11%)" },
|
|
434
|
+
"--dsw-alias-bg-layer-1": { light: "hsl(var(--maple-hue-light, 35) 10% 95%)", dark: "hsl(var(--maple-hue-dark, 207) 10% 13%)" },
|
|
435
|
+
"--dsw-alias-bg-layer-2": { light: "hsl(calc(var(--maple-hue-light, 35) - 18) 8% 93%)", dark: "hsl(calc(var(--maple-hue-dark, 207) - 8) 6% 12%)" },
|
|
436
|
+
"--dsw-alias-bg-overlay": { light: "hsl(var(--maple-hue-light, 35) 10% 94%)", dark: "hsl(var(--maple-hue-dark, 207) 8% 14%)" },
|
|
437
|
+
"--dsw-alias-bg-module-platform": { light: "hsl(var(--maple-hue-light, 35) 13.2% 90.6%)", dark: "hsl(var(--maple-hue-dark, 207) 12% 12.4%)" },
|
|
438
|
+
"--dsw-alias-label-primary": { light: "hsl(var(--maple-hue-light, 35) 10% 18%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88%)" },
|
|
439
|
+
"--dsw-alias-label-secondary": { light: "hsl(var(--maple-hue-light, 35) 8% 35%)", dark: "hsl(var(--maple-hue-dark, 207) 16% 72%)" },
|
|
440
|
+
"--dsw-alias-label-tertiary": { light: "hsl(var(--maple-hue-light, 35) 7% 42%)", dark: "hsl(var(--maple-hue-dark, 207) 12% 58%)" },
|
|
441
|
+
"--dsw-alias-label-caption": { light: "hsl(var(--maple-hue-light, 35) 6% 50%)", dark: "hsl(var(--maple-hue-dark, 207) 10% 46%)" },
|
|
442
|
+
"--dsw-alias-label-dimmed": { light: "hsl(var(--maple-hue-light, 35) 8% 82%)", dark: "hsl(var(--maple-hue-dark, 207) 8% 26%)" },
|
|
443
|
+
"--dsw-alias-label-primary-dimmed": { light: "hsl(var(--maple-hue-light, 35) 9% 27%)", dark: "hsl(var(--maple-hue-dark, 207) 18% 80%)" },
|
|
444
|
+
"--dsw-alias-label-primary-bluish": { light: "hsl(var(--maple-hue-light, 35) 26% 38%)", dark: "hsl(var(--maple-hue-dark, 207) 26% 72%)" },
|
|
445
|
+
"--dsw-alias-label-primary-foreground": { light: "hsl(var(--maple-hue-light, 35) 40% 96%)", dark: "hsl(var(--maple-hue-dark, 207) 10% 9%)" },
|
|
446
|
+
"--dsw-alias-label-primary-inverted": { light: "hsl(var(--maple-hue-light, 35) 40% 96%)", dark: "hsl(var(--maple-hue-dark, 207) 10% 13%)" },
|
|
447
|
+
"--dsw-alias-label-shimmer": { light: "hsl(var(--maple-hue-light, 35) 10% 18% / 30%)", dark: "hsl(0 0% 100% / 45%)" },
|
|
448
|
+
"--dsw-alias-link": { light: "hsl(162 76% 29%)", dark: "hsl(178 30% 62%)" },
|
|
449
|
+
"--dsw-alias-brand-primary": { light: "hsl(var(--maple-hue-light, 35) 26% 38%)", dark: "hsl(var(--maple-hue-dark, 207) 26% 72%)" },
|
|
450
|
+
"--dsw-alias-brand-text": { light: "hsl(var(--maple-hue-light, 35) 10% 18%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88%)" },
|
|
451
|
+
"--dsw-alias-state-business-primary": { light: "hsl(var(--maple-hue-light, 35) 26% 38%)", dark: "hsl(var(--maple-hue-dark, 207) 26% 72%)" },
|
|
452
|
+
"--dsw-alias-state-business-tertiary": { light: "hsl(var(--maple-hue-light, 35) 40% 88%)", dark: "hsl(var(--maple-hue-dark, 207) 18% 22%)" },
|
|
453
|
+
"--dsw-alias-state-error-primary": { light: "hsl(0 45% 48%)", dark: "hsl(0 44% 68%)" },
|
|
454
|
+
"--dsw-alias-state-warn-primary": { light: "hsl(32 70% 37%)", dark: "hsl(20 40% 68%)" },
|
|
455
|
+
"--dsw-alias-state-success-primary": { light: "hsl(95 75% 29%)", dark: "hsl(130 32% 68%)" },
|
|
456
|
+
"--dsw-alias-border-l1": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 10%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 7%)" },
|
|
457
|
+
"--dsw-alias-border-l2": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 16%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 13%)" },
|
|
458
|
+
"--dsw-alias-border-l3": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 20%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 17%)" },
|
|
459
|
+
"--dsw-alias-border-l4": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 26%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 22%)" },
|
|
460
|
+
"--dsw-alias-separator-primary": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 16%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 13%)" },
|
|
461
|
+
"--dsw-alias-interactive-bg-hover": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 7%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 8%)" },
|
|
462
|
+
"--dsw-alias-interactive-bg-active": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 12%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 14%)" },
|
|
463
|
+
"--dsw-alias-interactive-bg-hover-solid": { light: "hsl(var(--maple-hue-light, 35) 12% 93%)", dark: "hsl(var(--maple-hue-dark, 207) 14% 16%)" },
|
|
464
|
+
"--dsw-alias-button-info-fill": { light: "hsl(162 62% 30%)", dark: "hsl(178 34% 34%)" },
|
|
465
|
+
"--dsw-alias-button-info-hover": { light: "hsl(162 62% 24%)", dark: "hsl(178 34% 42%)" },
|
|
466
|
+
"--dsw-alias-brand-primary-new-colorprimary-new-color": { light: "hsl(var(--maple-hue-light, 35) 30% 42%)", dark: "hsl(var(--maple-hue-dark, 207) 30% 66%)" },
|
|
467
|
+
"--dsw-alias-button-primary-fill": { light: "hsl(var(--maple-hue-light, 35) 30% 42%)", dark: "hsl(var(--maple-hue-dark, 207) 30% 66%)" },
|
|
468
|
+
"--dsw-alias-button-primary-hover": { light: "hsl(var(--maple-hue-light, 35) 32% 34%)", dark: "hsl(var(--maple-hue-dark, 207) 32% 76%)" },
|
|
469
|
+
"--dsw-alias-button-floating-fill": { light: "hsl(var(--maple-hue-light, 35) 14% 98.5%)", dark: "hsl(var(--maple-hue-dark, 207) 8% 15%)" },
|
|
470
|
+
"--dsw-alias-button-floating-hover": { light: "hsl(var(--maple-hue-light, 35) 10% 95%)", dark: "hsl(var(--maple-hue-dark, 207) 14% 19%)" },
|
|
471
|
+
"--dsw-alias-markdown-code-block": { light: "hsl(var(--maple-hue-light, 35) 10% 95%)", dark: "hsl(var(--maple-hue-dark, 207) 10% 13%)" },
|
|
472
|
+
"--dsw-alias-markdown-code-block-banner": { light: "hsl(var(--maple-hue-light, 35) 13.2% 90.6%)", dark: "hsl(var(--maple-hue-dark, 207) 8% 15%)" },
|
|
473
|
+
"--dsw-alias-markdown-inline-code": { light: "hsl(var(--maple-hue-light, 35) 14% 94%)", dark: "hsl(var(--maple-hue-dark, 207) 8% 15%)" },
|
|
474
|
+
"--dsw-alias-markdown-tag": { light: "hsl(var(--maple-hue-light, 35) 40% 88%)", dark: "hsl(var(--maple-hue-dark, 207) 14% 20%)" },
|
|
475
|
+
"--dsw-alias-markdown-citation": { light: "hsl(var(--maple-hue-light, 35) 10% 94%)", dark: "hsl(var(--maple-hue-dark, 207) 8% 14%)" },
|
|
476
|
+
"--dsw-alias-scrollbar-bg-l1": { light: "hsl(var(--maple-hue-light, 35) 14% 84%)", dark: "hsl(var(--maple-hue-dark, 207) 10% 25%)" },
|
|
477
|
+
"--dsw-alias-scrollbar-bg-l2": { light: "hsl(var(--maple-hue-light, 35) 20% 78%)", dark: "hsl(var(--maple-hue-dark, 207) 12% 32%)" },
|
|
478
|
+
"--dsw-alias-scrollbar-hover-l2": { light: "hsl(var(--maple-hue-light, 35) 18% 71%)", dark: "hsl(var(--maple-hue-dark, 207) 10% 39%)" },
|
|
479
|
+
"--dsw-alias-menu-icon": { light: "hsl(var(--maple-hue-light, 35) 8% 35%)", dark: "hsl(var(--maple-hue-dark, 207) 18% 80%)" },
|
|
480
|
+
"--dsw-specific-sidebar-fill": { light: "hsl(calc(var(--maple-hue-light, 35) - 18) 8% 93%)", dark: "hsl(calc(var(--maple-hue-dark, 207) - 8) 6% 12%)" },
|
|
481
|
+
"--dsw-specific-sidebar-nav-item-active": { light: "hsl(var(--maple-hue-light, 35) 26% 88%)", dark: "hsl(var(--maple-hue-dark, 207) 14% 19%)" },
|
|
482
|
+
"--dsw-specific-sidebar-nav-item-hover": { light: "hsl(var(--maple-hue-light, 35) 26% 38% / 8%)", dark: "hsl(var(--maple-hue-dark, 207) 24% 88% / 8%)" },
|
|
483
|
+
"--dsw-specific-sidebar-nav-item-active-accent": { light: "hsl(var(--maple-hue-light, 35) 40% 84%)", dark: "hsl(var(--maple-hue-dark, 207) 18% 24%)" },
|
|
484
|
+
"--dsw-specific-tip": { light: "hsl(var(--maple-hue-light, 35) 18% 90%)", dark: "hsl(var(--maple-hue-dark, 207) 12% 18%)" },
|
|
485
|
+
"--dsw-specific-bubble": { light: "hsl(var(--maple-hue-light, 35) 24% 93%)", dark: "hsl(var(--maple-hue-dark, 207) 14% 19%)" },
|
|
486
|
+
"--dsw-specific-bubble-highlight": { light: "hsl(var(--maple-hue-light, 35) 30% 87%)", dark: "hsl(var(--maple-hue-dark, 207) 16% 24%)" },
|
|
487
|
+
"--dsw-specific-input-major": { light: "hsl(var(--maple-hue-light, 35) 14% 98.5%)", dark: "hsl(var(--maple-hue-dark, 207) 8% 15%)" },
|
|
488
|
+
"--dsw-specific-selector": { light: "hsl(var(--maple-hue-light, 35) 14% 94%)", dark: "hsl(var(--maple-hue-dark, 207) 14% 19%)" }
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
// inline-css:/Users/tny/Desktop/work/my-dsh/plugins/dsh-maple-theme/src/client/styles/markdown.css
|
|
492
|
+
var markdown_default = "/* Maple \u6B63\u6587\u5C42\uFF1A\u5BF9\u8BDD\u6D41\u91CC\u7684 markdown \u6392\u7248\u4E0E\u88C5\u9970\u3002\n *\n * \u4F5C\u7528\u8303\u56F4\u53EA\u6709\u4E00\u5904\uFF1A\u52A9\u624B\u56DE\u7B54\u7684\u6B63\u6587\uFF08`[data-chat-flow-kind='assistant-step']`\uFF09\u3002\n * \u63A8\u7406\u5757\u7528\u7684\u662F\u540C\u4E00\u4E2A kind\uFF0C\u4F46\u5B83\u81EA\u5DF1\u5E26 `data-chat-group-part='reasoning'`\uFF0C\u88AB\u6392\u9664\u5728\u5916\u2014\u2014\n * \u63A8\u7406\u884C\u8981\u4FDD\u6301\u5BBF\u4E3B\u7684\u5C0F\u5B57\u53F7\u4E0E\u7D27\u51D1\u884C\u8DDD\uFF0C\u8DDF\u7740\u6B63\u6587\u4E00\u8D77\u653E\u5927\u5C31\u7CCA\u6210\u4E00\u7247\u3002\n * \u5DE5\u5177\u884C\u4E5F\u6392\u9664\uFF1A\u5B83\u7684 flow kind \u662F `tool-call`\uFF0C\u5BBF\u4E3B\u672C\u6765\u5C31\u4E0D\u5728\u91CC\u9762\u653E markdown \u5143\u7D20\u3002\n *\n * \u9009\u62E9\u5668\u4E00\u5F8B\u300C\u5BBF\u4E3B\u7684\u6570\u636E\u5C5E\u6027 + \u5143\u7D20\u540D\u300D\u4E24\u5C42\uFF1A\u5BBF\u4E3B\u6B63\u6587\u7684\u7C7B\u540D\u662F CSS Modules \u7684\u54C8\u5E0C\u4E32\uFF0C\n * \u6362\u4E00\u6B21\u6784\u5EFA\u5C31\u53D8\uFF0C\u4E0D\u80FD\u5F53\u951A\u70B9\u3002\u5178\u578B\u4E00\u6761\u662F\n * `html[data-maple-theme][data-maple-heading][data-chat-flow-kind]:not([data-chat-group-part]) body :where(h2)`\uFF0C\n * \u5C5E\u6027\u4E09\u4E2A\uFF08`html` \u4E0E `body` \u4E24\u4E2A\u5143\u7D20\u4E0D\u8BA1\u5728\u5185\uFF09\u538B\u8FC7\u5BBF\u4E3B module \u6837\u5F0F\u8868\u91CC\u7684\n * `.markdown h2` \u90A3\u4E00\u4E2A\u7C7B\uFF0C\u6240\u4EE5\u4E0D\u9700\u8981 !important\u3002\n */\n\nhtml[data-maple-theme='on'] {\n --maple-p-gap: 10px;\n --maple-underline-offset: 2px;\n --maple-inline-code: hsl(0 45% 48%);\n --maple-quote-bar: hsl(var(--maple-hue-light, 35) 26% 38% / 45%);\n --maple-quote-fill: hsl(var(--maple-hue-light, 35) 20% 95%);\n --maple-table-head: hsl(var(--maple-hue-light, 35) 30% 91%);\n}\n\nhtml[data-maple-theme='on'] body[data-ds-dark-theme] {\n --maple-inline-code: hsl(0 44% 68%);\n --maple-quote-bar: hsl(var(--maple-hue-dark, 207) 30% 72% / 40%);\n --maple-quote-fill: hsl(var(--maple-hue-dark, 207) 10% 14%);\n --maple-table-head: hsl(var(--maple-hue-dark, 207) 12% 17%);\n}\n\n/* \u6BB5\u8DDD\uFF1A\u5BBF\u4E3B\u7684\u6B63\u6587\u5BB9\u5668\u662F\u7EB5\u5411 flex\uFF0C\u5757\u4E0E\u5757\u4E4B\u95F4\u7684\u7A7A\u9699\u7531\u5BB9\u5668\u7684 `gap: 16px` \u7ED9\uFF0C\n * \u6BB5\u843D\u81EA\u5DF1\u7684 margin \u88AB\u5F52\u96F6\u3002\u6240\u4EE5\u8981\u6539\u7684\u662F\u5BB9\u5668\u90A3\u4E00\u4E2A gap\uFF0C\u4E0D\u662F p \u7684 margin\u3002\n * \u5BB9\u5668\u662F\u5305\u4F4F markdown \u6839\u8282\u70B9\u7684\u90A3\u4E2A div\uFF0C\u7528 :has() \u4ECE\u6839\u8282\u70B9\u5F80\u4E0A\u8BA4\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) {\n --maple-gap: var(--maple-p-gap, 10px);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :has(> [class*='markdown']) {\n gap: var(--maple-p-gap, 10px);\n}\n\n/* \u5217\u8868\u9879\u91CC\u7684\u6BB5\u843D\u4ECD\u6309\u5757\u7EA7 margin \u8D70\uFF1A\u5BBF\u4E3B\u7684\u5217\u8868\u6CA1\u6709 gap\uFF0C\u6BB5\u843D\u95F4\u8DDD\u5F52\u96F6\u4F1A\u6324\u6210\u4E00\u5768\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li > p) {\n margin: 4px 0;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(strong) {\n font-weight: 600;\n}\n\n/* \u884C\u5185\u4EE3\u7801\uFF1AMaple \u7528\u6696\u7EA2\u4E00\u8272\u533A\u5206\uFF0C\u4E0D\u518D\u662F\u300C\u52A0\u4E86\u5E95\u7684\u6B63\u6587\u300D\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :not(pre) > code {\n color: var(--maple-inline-code);\n background-color: color-mix(in srgb, var(--maple-inline-code) 8%, transparent);\n border-color: color-mix(in srgb, var(--maple-inline-code) 18%, transparent);\n}\n\n/* \u94FE\u63A5\u4E0B\u5212\u7EBF\u7684\u62AC\u5347\u91CF\uFF1AMaple \u7684 --setting-underline-offset \u9ED8\u8BA4 2px\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(a) {\n text-underline-offset: var(--maple-underline-offset);\n}\n\n/* \u6807\u9898\uFF1A\u5B57\u53F7\u4E0E\u5B57\u91CD\u6765\u81EA tokens.css \u7684\u590D\u5408\u4EE4\u724C\uFF0C\u8FD9\u91CC\u53EA\u8865\u989C\u8272\u3001\u95F4\u8DDD\u4E0E h5/h6\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6) {\n position: relative;\n margin: 28px 0 12px;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) {\n font-size: calc(var(--dsh-content-font-size, 14px) * 1.05);\n font-weight: 600;\n line-height: 1.5;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) {\n font-size: var(--dsh-content-font-size, 14px);\n font-weight: 600;\n line-height: 1.6;\n}\n\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1) { color: var(--maple-h1); }\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h2) { color: var(--maple-h2); }\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h3) { color: var(--maple-h3); }\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h4) { color: var(--maple-h4); }\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5) { color: var(--maple-h5); }\nhtml[data-maple-theme='on'][data-maple-heading='colorful'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) { color: var(--maple-h6); }\n\n/* \u53E6\u4E24\u79CD\u6807\u9898\u914D\u8272\uFF1A\u516D\u7EA7\u7EDF\u4E00\u53D6\u4E00\u4E2A\u8272\uFF0C\u4E0D\u518D\u9010\u7EA7\u6362\u3002\n * \u4EE4\u724C\u5C42\u7ED9\u4E86 --maple-heading-color\uFF0C\u8FD9\u91CC\u6309\u5143\u7D20\u9010\u7EA7\u6302\u4E0A\u2014\u2014\u5BBF\u4E3B\u7528\u7684\u662F\u5143\u7D20\u9009\u62E9\u5668\uFF0C\n * \u4E00\u6B21 :where(h1, h2, \u2026) \u7684\u4F18\u5148\u7EA7\u4E0E\u5B83\u76F8\u540C\uFF0C\u5206\u4E0D\u5F00\u3002 */\nhtml[data-maple-theme='on'][data-maple-heading='accent'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1),\nhtml[data-maple-theme='on'][data-maple-heading='accent'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h2),\nhtml[data-maple-theme='on'][data-maple-heading='accent'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h3),\nhtml[data-maple-theme='on'][data-maple-heading='accent'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h4),\nhtml[data-maple-theme='on'][data-maple-heading='accent'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5),\nhtml[data-maple-theme='on'][data-maple-heading='accent'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) { color: var(--maple-heading-color); }\n\nhtml[data-maple-theme='on'][data-maple-heading='text'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1),\nhtml[data-maple-theme='on'][data-maple-heading='text'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h2),\nhtml[data-maple-theme='on'][data-maple-heading='text'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h3),\nhtml[data-maple-theme='on'][data-maple-heading='text'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h4),\nhtml[data-maple-theme='on'][data-maple-heading='text'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5),\nhtml[data-maple-theme='on'][data-maple-heading='text'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6) { color: var(--maple-heading-color); }\n\n/* \u6807\u9898\u7B49\u7EA7\u6807\u8BB0\uFF1AMaple \u7684 heading-indicator-auto\u2014\u2014\u5E73\u65F6\u770B\u4E0D\u89C1\uFF0C\u60AC\u505C\u65F6\u5728\u5DE6\u4FA7\u6DE1\u5165 H1\u2026H6\u3002 */\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6)::before {\n position: absolute;\n inset-inline-start: -1.9rem;\n top: 0.15em;\n font-size: calc(var(--dsh-content-font-size, 14px) * 0.7);\n font-weight: 500;\n line-height: 1;\n color: var(--dsw-alias-label-caption);\n opacity: 0;\n transition: opacity var(--ds-transition-duration-fast) var(--ds-ease-in-out);\n pointer-events: none;\n}\n\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6):hover::before {\n opacity: 1;\n}\n\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1)::before { content: 'H1'; }\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h2)::before { content: 'H2'; }\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h3)::before { content: 'H3'; }\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h4)::before { content: 'H4'; }\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h5)::before { content: 'H5'; }\nhtml[data-maple-theme='on'][data-maple-indicator='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h6)::before { content: 'H6'; }\n\n/* \u5F15\u7528\uFF1AMaple \u662F\u6D45\u5E95 + \u5DE6\u4FA7\u4E00\u6761\u8272\u5E26\uFF0C\u4E0D\u662F\u5BBF\u4E3B\u7684\u5355\u8FB9\u7AD6\u7EBF\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote) {\n position: relative;\n margin: 14px 0;\n padding: 8px 14px 8px 18px;\n border: 0;\n border-radius: var(--dsw-radius-sm);\n background: var(--maple-quote-fill);\n color: var(--dsw-alias-label-secondary);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote)::before {\n content: '';\n position: absolute;\n inset-block: 8px;\n inset-inline-start: 7px;\n width: 3px;\n border-radius: var(--dsw-radius-xs);\n background: var(--maple-quote-bar);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(blockquote blockquote) {\n margin-inline-end: 0;\n background: color-mix(in srgb, var(--maple-quote-fill) 70%, var(--dsw-alias-bg-base));\n}\n\n/* \u5217\u8868\uFF1AMaple \u7684\u6807\u8BB0\u7528\u7B49\u5BBD\u5B57\u4F53\uFF0C\u5E76\u6309\u5C42\u7EA7\u6362\u5F62\u72B6\uFF08\u5B9E\u5FC3\u5706 \u2192 \u7A7A\u5FC3\u5706 \u2192 \u65B9\u5757\uFF09\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul, ol) {\n margin: var(--maple-p-gap) 0;\n padding-inline-start: 1.35em;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li)::marker {\n font-family: var(--ds-font-family-code);\n color: var(--dsw-alias-state-business-primary);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul) > :where(li)::marker {\n font-size: 0.85em;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul ul, ul ul ul ul, ul ul ul ul ul ul) {\n list-style-type: circle;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(ul ul ul, ul ul ul ul ul) {\n list-style-type: square;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(li) {\n margin: 3px 0;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(input[type='checkbox']) {\n accent-color: var(--dsw-alias-state-business-primary);\n margin-inline-end: 8px;\n}\n\n/* \u8868\u683C\uFF1AMaple \u7684\u8868\u5934\u586B\u4E00\u5C42\u6D45\u5E95\u3001\u5916\u8FB9\u5706\u89D2\u3001\u6A2A\u7EBF\u53EA\u5728\u884C\u4E4B\u95F4\u3002\n * \u5BBF\u4E3B\u7528 border-collapse: collapse\uFF0C\u5706\u89D2\u4F1A\u88AB\u88C1\u6389\uFF0C\u6240\u4EE5\u6539\u6210 separate + \u96F6\u95F4\u8DDD\uFF0C\n * \u53EA\u7ED9\u56DB\u89D2\u7684\u5355\u5143\u683C\u4E0A\u5706\u89D2\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(table) {\n border-collapse: separate;\n border-spacing: 0;\n font-size: calc(var(--dsh-content-font-size, 14px) - 1px);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(th) {\n background: var(--maple-table-head);\n font-weight: 600;\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(thead > tr > th:first-child) {\n border-start-start-radius: var(--dsw-radius-sm);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(thead > tr > th:last-child) {\n border-start-end-radius: var(--dsw-radius-sm);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(tbody > tr:last-child > td:first-child) {\n border-end-start-radius: var(--dsw-radius-sm);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(tbody > tr:last-child > td:last-child) {\n border-end-end-radius: var(--dsw-radius-sm);\n}\n\n/* \u5206\u9694\u7EBF\uFF1AMaple \u662F\u4E00\u6761\u4E24\u7AEF\u6DE1\u51FA\u7684\u6E10\u53D8\uFF0C\u4E0D\u662F\u4E00\u6839\u7B49\u5BBD\u5B9E\u7EBF\uFF0C\u4E0A\u4E0B\u7559\u767D\u4E5F\u66F4\u5927\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(hr) {\n height: 1px;\n margin: 28px 0;\n border: 0;\n background: linear-gradient(\n to right,\n transparent 0%,\n var(--dsw-alias-border-l3) 22%,\n var(--dsw-alias-border-l4) 50%,\n var(--dsw-alias-border-l3) 78%,\n transparent 100%\n );\n}\n\n/* \u4EE3\u7801\u5757\uFF1AMaple \u7ED9\u5B83\u4E00\u5708\u53D1\u4E1D\u8FB9\u6846\u3001\u6BD4\u5BBF\u4E3B\u5C0F\u4E00\u6863\u7684\u5706\u89D2\uFF0C\u6807\u9898\u6761\u7528\u6BD4\u6B63\u6587\u6DF1\u4E00\u6863\u7684\u5E95\u3002\n * \u5BBF\u4E3B\u628A\u5706\u89D2\u6536\u5728\u4E00\u4E2A\u5C40\u90E8\u53D8\u91CF\u91CC\uFF08--dsl-code-block-border-radius\uFF0C\u9ED8\u8BA4 radius-lg\uFF09\uFF0C\n * \u6240\u4EE5\u6362\u5706\u89D2\u53EA\u8981\u6362\u90A3\u4E2A\u53D8\u91CF\uFF0C\u4E0D\u5FC5\u53BB\u5199\u5404\u89D2\u7684 border-radius\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(.md-code-block) {\n border: 0.5px solid var(--dsw-alias-border-l2);\n --dsl-code-block-border-radius: var(--dsw-radius-md);\n}\n\n/* \u6807\u9898\u6761\uFF1AMaple \u7684 code-language \u7528\u7B49\u5BBD\u5B57\u4F53\u3001\u884C\u5185\u4EE3\u7801\u90A3\u4E2A\u6696\u8272\uFF0C\u5B57\u53F7\u5C0F\u4E00\u53F7\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-code-block-banner]) {\n border-bottom: 0.5px solid var(--dsw-alias-border-l1);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-code-block-banner]) :where(div:first-child) {\n font-family: var(--ds-font-family-code);\n letter-spacing: 0.02em;\n color: var(--maple-inline-code);\n}\n\n/* \u884C\u53F7\u680F\uFF1AMaple \u7684\u884C\u53F7\u6BD4\u5BBF\u4E3B\u7684\u518D\u6DE1\u4E00\u6863\uFF0C\u8BA9\u4EE3\u7801\u672C\u8EAB\u66F4\u7A81\u51FA\u3002\n * \u5BBF\u4E3B\u628A\u884C\u53F7\u753B\u5728 `.line::before` \u4E0A\u5E76\u76F4\u63A5\u53D6 --dsw-alias-label-tertiary\uFF0C\u6240\u4EE5\u5728\u884C\u53F7\u5BB9\u5668\u91CC\n * \u628A\u90A3\u4E2A\u53D8\u91CF\u6362\u6210 caption \u4E00\u6863\uFF1B`--dsl-*` \u662F\u7EC4\u4EF6\u81EA\u5DF1\u7684\u5C40\u90E8\u53D8\u91CF\uFF0C\u4E0D\u5728\u8FD9\u91CC\u6539\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where([data-line-numbers]) {\n --dsw-alias-label-tertiary: var(--dsw-alias-label-caption);\n}\n\n/* \u9009\u4E2D\u6587\u5B57\uFF1AMaple \u7528\u5F3A\u8C03\u8272\u7684\u4F4E\u900F\u660E\u5EA6\uFF0C\u4E0D\u662F\u6D4F\u89C8\u5668\u7684\u9ED8\u8BA4\u84DD\u3002 */\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step'] ::selection {\n background: hsl(35 60% 62% / 28%);\n}\n\nhtml[data-maple-theme='on'] [data-chat-flow-kind='assistant-step']:not([data-chat-group-part='reasoning']) :where(h1, h2, h3, h4, h5, h6):first-child {\n margin-top: 0;\n}\n";
|
|
493
|
+
|
|
494
|
+
// inline-css:/Users/tny/Desktop/work/my-dsh/plugins/dsh-maple-theme/src/client/styles/shell.css
|
|
495
|
+
var shell_default = "/* Maple \u5916\u58F3\u5C42\uFF1A\u4FA7\u680F\u3001\u4F1A\u8BDD\u5934\u90E8\u3001\u8F93\u5165\u533A\u4E0E\u6807\u7B7E\u6761\u7684\u89C2\u611F\u3002\n *\n * \u951A\u70B9\u53EA\u6709\u4E00\u6837\u662F\u7A33\u7684\uFF1A`data-slot`\u3002\u5BBF\u4E3B\u7684\u5916\u58F3\u7C7B\u540D\u5168\u662F CSS Modules \u7684\u54C8\u5E0C\u4E32\n * \uFF08`pI_x6G_sidebarCol`\u3001`wSkVaW_tabActive`\uFF09\uFF0C\u6362\u4E00\u6B21\u6784\u5EFA\u5C31\u53D8\uFF1B\u800C `data-slot` \u662F\u5EA7\u4F4D\u6CE8\u518C\u65F6\n * \u5199\u6B7B\u7684\u540D\u5B57\uFF0C\u5C5E\u4E8E\u8DE8\u5305\u5951\u7EA6\u2014\u2014\u63D2\u4EF6\u7684\u5EA7\u4F4D\u5C31\u662F\u9760\u5B83\u8BA4\u7684\u3002\u9700\u8981\u9009\u4E2D\u300C\u88C5\u5EA7\u4F4D\u7684\u90A3\u4E2A\u58F3\u300D\u65F6\u7528\n * `:has(> [data-slot='\u2026'])`\uFF1A\u58F3\u6CA1\u6709\u540D\u5B57\uFF0C\u4F46\u5B83\u7684\u5B69\u5B50\u6709\u3002\u884C\u4E0E\u6807\u7B7E\u53E6\u6709\u5177\u4F53\u5C5E\u6027\uFF1A\n * `[data-row-key^='session:']`\u3001`[data-conversation-tabs] [aria-selected]`\u3002\n *\n * \u8FD9\u4E00\u5C42\u53EA\u6539**\u89C2\u611F**\uFF1A\u5E95\u8272\u3001\u5206\u9694\u7EBF\u3001\u5706\u89D2\u3001\u7559\u767D\u3002\u552F\u72EC\u4E2D\u592E\u5217\u90A3\u4E00\u5708\u5185\u8FB9\u8DDD\u7B97\u662F\u5C3A\u5BF8\u2014\u2014\n * \u5B83\u662F Maple \u5361\u7247\u5F0F\u5E03\u5C40\u7684\u5916\u6CBF\uFF0C\u503C\u56FA\u5B9A\u5728 6px\uFF0C\u4E0D\u53C2\u4E0E\u5BBF\u4E3B\u7684\u4EFB\u4F55\u8BA1\u7B97\u3002\n * \u4E0D\u52A8 grid \u8F68\u9053\u3001\u4E0D\u52A8\u6EDA\u52A8\u5F52\u5C5E\uFF0C\u6240\u4EE5\u6298\u53E0\u3001\u62D6\u5BBD\u3001\u54CD\u5E94\u5F0F\u90FD\u7167\u65E7\u3002\n *\n * \u6574\u5C42\u53D7 `data-maple-shell` \u5F00\u5173\u63A7\u5236\uFF0C\u914D\u7F6E\u9875\u4E0A\u53EF\u4EE5\u6574\u4E2A\u5173\u6389\u56DE\u5230\u5BBF\u4E3B\u539F\u6837\u3002\n */\n\n/* \u4E2D\u592E\u5217\uFF1AMaple \u7684 app-layout-card \u628A\u7F16\u8F91\u533A\u5F53\u6210\u4E00\u5F20\u6D6E\u5728\u4FA7\u680F\u5E95\u8272\u4E0A\u7684\u5361\u7247\uFF0C\n * \u56DB\u5468\u7559\u4E00\u6761\u7A84\u7F1D\uFF08\u5B83\u7684 --app-layout-spacing \u9ED8\u8BA4\u5728 6~8px\uFF09\u3002\u8FD9\u91CC\u7167\u540C\u6837\u601D\u8DEF\uFF0C\n * \u4F46\u53EA\u7ED9\u5185\u8FB9\u8DDD\uFF0C\u4E0D\u52A8 grid \u8F68\u9053\u2014\u2014\u8F68\u9053\u7531\u5BBF\u4E3B\u6309\u62D6\u5BBD\u5B9E\u65F6\u5199\u884C\u5185\u6837\u5F0F\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body :has(> [data-slot='main']) {\n padding: 6px 6px 0;\n box-sizing: border-box;\n}\n\n/* \u4FA7\u680F\u4E0E\u4E2D\u592E\u5361\u7247\u4E4B\u95F4\uFF1A\u5BBF\u4E3B\u7684 0.5px \u51B7\u7070\u5206\u9694\u7EBF\uFF0CMaple \u7528\u7559\u767D\u5206\u5C42\uFF0C\u4E0D\u8981\u8FD9\u6761\u7EBF\u3002\n * \u4E24\u4FA7\u90FD\u8981\u64A4\u2014\u2014\u975E darwin \u753B\u5728\u4FA7\u680F\u7684\u53F3\u8FB9\u6846\u4E0A\uFF0Cdarwin \u753B\u5728\u4E2D\u592E\u5217\u7684\u5DE6\u8FB9\u6846\u4E0A\u3002\n * \u4FA7\u680F\u5E95\u8272\u5DF2\u7531 tokens.css \u7684 --dsw-specific-sidebar-fill \u7ED9\u51FA\uFF08Maple \u7684\u6696\u7070\uFF09\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body :has(> [data-slot='sidebar']) {\n border-right: 0;\n}\n\nhtml[data-maple-theme='on'][data-maple-shell='on'] body :has(> [data-slot='main']) {\n border-left: 0;\n}\n\n/* \u4F1A\u8BDD\u5934\u90E8\uFF1AMaple \u7684\u6807\u9898\u533A\u6CA1\u6709\u90A3\u6761\u8D2F\u7A7F\u7684\u5206\u9694\u7EBF\u3002\n * \u5EA7\u4F4D\u951A\u70B9\u81EA\u5DF1\u662F display: contents\uFF0C\u8FB9\u6846\u753B\u5728\u5B83\u5305\u7740\u7684\u771F <header> \u4E0A\uFF0C\n * \u6240\u4EE5\u8FD9\u91CC\u5F80\u4E0B\u4E00\u5C42\u627E\uFF1B\u6539\u6210 transparent \u800C\u4E0D\u662F none\uFF0C\u907F\u514D\u9AD8\u5EA6\u8DF3 0.5px\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body [data-slot='conversation.header'] header {\n border-bottom-color: transparent;\n}\n\n/* \u6807\u7B7E\u6761\uFF1AMaple \u7684 tab-float \u628A\u6D3B\u52A8\u6807\u7B7E\u505A\u6210\u4E00\u679A\u6D6E\u8D77\u7684\u5706\u89D2\u5757\uFF0C\u5E95\u4E0B\u4E0D\u5E26\u6307\u793A\u6761\u3002\n * \u5BBF\u4E3B\u7684\u6D3B\u52A8\u6307\u793A\u662F `::after` \u7684\u4E00\u6761 2px \u7EBF\uFF0C\u8FD9\u91CC\u64A4\u6389\u5B83\u3001\u6539\u7528\u540C\u5BBD\u7684\u5706\u89D2\u5E95\u3002\n * \u5706\u89D2\u4E0E corner-shape \u5FC5\u987B\u5199\u5728\u540C\u4E00\u7EC4\u58F0\u660E\u91CC\uFF0C\u5426\u5219\u5BBF\u4E3B\u7684 superellipse \u4F1A\u628A\n * \u8FD9\u4E2A\u76F4\u89D2\u5706\u89D2\u63C9\u6210\u65B9\u5706\u5F62\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body [data-conversation-tabs] [aria-selected='true'] {\n border-radius: var(--dsw-radius-sm);\n corner-shape: round;\n background: var(--dsw-alias-interactive-bg-hover-solid);\n}\n\nhtml[data-maple-theme='on'][data-maple-shell='on'] body [data-conversation-tabs] [aria-selected='true']::after {\n opacity: 0;\n}\n\n/* \u8F93\u5165\u533A\uFF1AMaple \u7684\u8F93\u5165\u5361\u662F\u300C\u6BD4\u6B63\u6587\u6D45\u4E00\u6863\u7684\u7EB8\u300D\uFF0C\u5706\u89D2\u53D6\u9762\u677F\u7EA7\u3002\n * \u5BBF\u4E3B\u7684 composer \u5DF2\u7ECF\u662F border: 0 + elevation-soft\uFF08\u6295\u5F71\u5C42\u53EA\u6362\u586B\u5145\u4E0E\u5706\u89D2\uFF0C\u4E0D\u78B0\u9634\u5F71\uFF09\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body [data-composer-card] {\n background: var(--dsw-specific-input-major);\n border-radius: var(--dsw-radius-panel);\n}\n\n/* \u4FA7\u680F\u7684\u5BFC\u822A\u884C\u4E0E\u5DE5\u4F5C\u533A\u884C\uFF1AMaple \u7684\u5217\u8868\u9879\u5E26\u5706\u89D2\uFF0C\u60AC\u505C\u4E0E\u9009\u4E2D\u90FD\u662F\u5706\u89D2\u5757\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body [data-row-key^='session:'],\nhtml[data-maple-theme='on'][data-maple-shell='on'] body [data-row-key^='workspace:'] {\n border-radius: var(--dsw-radius-sm);\n}\n\n/* \u4FA7\u680F\u5E95\u90E8\u5DE5\u5177\u680F\uFF1A\u5BBF\u4E3B\u7684\u51B7\u7070\u6D6E\u5C42\uFF0C\u6362\u6210 Maple \u7684\u7EB8\u8272\u3002\n * \u5EA7\u4F4D\u951A\u70B9\u662F display: contents\uFF0C\u6D82\u5728\u5B83\u4E0D\u4F1A\u89C1\u6548\uFF0C\u5F97\u6D82\u88C5\u5B83\u7684\u90A3\u4E2A\u58F3\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body :has(> [data-slot='shell.bottom']) {\n background: var(--dsw-specific-tip);\n}\n\n/* \u4F1A\u8BDD\u5934\u90E8\u7684\u56FE\u6807\u6309\u94AE\uFF1AMaple \u7684\u56FE\u6807\u6309\u94AE\u662F\u7D27\u51D1\u63A7\u4EF6\u7EA7\u5706\u89D2\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body [data-slot='conversation.session.header.actions'] button {\n border-radius: var(--dsw-radius-sm);\n}\n\n/* \u6EDA\u52A8\u6761\uFF1AMaple \u7684\u6ED1\u5757\u5BBD 12px\u3001\u5706\u5934\uFF0C\u989C\u8272\u53D6\u5B83\u7684\u6696\u7070\uFF08tokens.css \u5DF2\u6362\uFF09\u3002 */\nhtml[data-maple-theme='on'][data-maple-shell='on'] body {\n --dsh-scrollbar-width: 12px;\n}\n";
|
|
496
|
+
|
|
497
|
+
// src/client/index.ts
|
|
498
|
+
var name = "@lynn123411/dsh-maple-theme";
|
|
499
|
+
var inject = ["configForms", "slots", "locale", "theme"];
|
|
500
|
+
var SHEETS = [
|
|
501
|
+
["tokens.css", tokens_default],
|
|
502
|
+
["markdown.css", markdown_default],
|
|
503
|
+
["shell.css", shell_default],
|
|
504
|
+
["card.css", CARD_CSS]
|
|
505
|
+
];
|
|
506
|
+
function injectStyles() {
|
|
507
|
+
if (typeof document === "undefined") return;
|
|
508
|
+
for (const [file, css] of SHEETS) {
|
|
509
|
+
const key = `${name}/${file}`;
|
|
510
|
+
const existing = document.head.querySelector(`style[data-plugin-css="${key}"]`);
|
|
511
|
+
const tag = existing ?? document.createElement("style");
|
|
512
|
+
tag.dataset.plugin = name;
|
|
513
|
+
tag.dataset.pluginCss = key;
|
|
514
|
+
tag.textContent = css;
|
|
515
|
+
if (existing === null) document.head.appendChild(tag);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function removeStyles() {
|
|
519
|
+
if (typeof document === "undefined") return;
|
|
520
|
+
for (const tag of document.head.querySelectorAll(`style[data-plugin="${name}"]`)) tag.remove();
|
|
521
|
+
}
|
|
522
|
+
function apply(ctx) {
|
|
523
|
+
const services = ctx;
|
|
524
|
+
ctx.effect(() => {
|
|
525
|
+
injectStyles();
|
|
526
|
+
return () => {
|
|
527
|
+
removeStyles();
|
|
528
|
+
};
|
|
529
|
+
}, "dsh-maple-theme: stylesheets");
|
|
530
|
+
ctx.effect(
|
|
531
|
+
() => services.theme.overrideTokens(THEME_SOURCE, MAPLE_TOKENS),
|
|
532
|
+
"dsh-maple-theme: palette"
|
|
533
|
+
);
|
|
534
|
+
ctx.effect(
|
|
535
|
+
() => services.locale.register(NS, { zh, en }),
|
|
536
|
+
"dsh-maple-theme: dictionaries"
|
|
537
|
+
);
|
|
538
|
+
ctx.effect(() => {
|
|
539
|
+
if (typeof document === "undefined") return () => {
|
|
540
|
+
};
|
|
541
|
+
return bindProjection(document.documentElement, services.configForms.get(SETTINGS_NAMESPACE));
|
|
542
|
+
}, "dsh-maple-theme: projection");
|
|
543
|
+
ctx.effect(
|
|
544
|
+
() => services.configForms.whileServed([SETTINGS_NAMESPACE], () => services.slots.inject(
|
|
545
|
+
BUNDLE_CONFIG_SLOT,
|
|
546
|
+
() => slotsRegister(services, () => ({
|
|
547
|
+
name: BUNDLE_CONFIG_SLOT,
|
|
548
|
+
key: BUNDLE_NAME,
|
|
549
|
+
locale: NS,
|
|
550
|
+
inject: () => ({ form: services.configForms.get(SETTINGS_NAMESPACE) })
|
|
551
|
+
}))
|
|
552
|
+
)),
|
|
553
|
+
"dsh-maple-theme: plugins page config"
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
function slotsRegister(services, options) {
|
|
557
|
+
return services.slots.register(options(), MapleThemeCard);
|
|
558
|
+
}
|
|
559
|
+
return module.exports; } });
|
|
560
|
+
//# sourceMappingURL=client.js.map
|