dsh-theme-escook 1.0.3 → 1.0.4
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/client/client.bundle.js +368 -0
- package/client/client.js +9 -0
- package/package.json +6 -3
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
// 自动构建产物,请修改 client/client.js 后运行 npm run build。
|
|
2
|
+
window.__ModuleLoader__.load({
|
|
3
|
+
id: "dsh-theme-escook",
|
|
4
|
+
factory: (require) => {
|
|
5
|
+
const module = { exports: {} };
|
|
6
|
+
const exports = module.exports;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
|
|
25
|
+
// client/client.js
|
|
26
|
+
var client_exports = {};
|
|
27
|
+
__export(client_exports, {
|
|
28
|
+
THEME_SCHEMES: () => THEME_SCHEMES,
|
|
29
|
+
apply: () => apply,
|
|
30
|
+
default: () => activate
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(client_exports);
|
|
33
|
+
var THEME_SCHEMES = {
|
|
34
|
+
"dark": {
|
|
35
|
+
name: "escook Dark (\u7ECF\u5178\u6697\u9ED1 \xB7 \u6807\u5FD7\u6696\u9633\u6A59)",
|
|
36
|
+
desc: "VS Code \u5F6C\u54E5\u7ECF\u5178\u6696\u8C03\u6781\u5BA2\u6DF1\u7070\u642D\u914D\u6807\u5FD7\u6696\u9633\u6A59\uFF0C\u6B63\u7EDF\u8010\u770B\u957F\u6548\u62A4\u773C",
|
|
37
|
+
type: "dark",
|
|
38
|
+
colorPreview: "#ef820c",
|
|
39
|
+
bgPreview: "#252526",
|
|
40
|
+
css: `
|
|
41
|
+
:root, html, body, body[data-ds-dark-theme], [data-theme="escook-dark"] {
|
|
42
|
+
--dsw-alias-bg-base: #252526 !important;
|
|
43
|
+
--dsw-alias-bg-layer-1: #202021 !important;
|
|
44
|
+
--dsw-alias-bg-layer-2: #29292c !important;
|
|
45
|
+
--dsw-alias-bg-layer-3: #2d2d30 !important;
|
|
46
|
+
--dsw-alias-bg-module-platform: #2d2d30 !important;
|
|
47
|
+
--dsw-alias-bg-multi-select: #2d2d30 !important;
|
|
48
|
+
--dsw-alias-bg-overlay: #333333 !important;
|
|
49
|
+
--dsw-specific-selector: #2d2d30 !important;
|
|
50
|
+
--dsw-alias-bg-mask-1: rgba(18, 18, 20, 0.75) !important;
|
|
51
|
+
--dsw-specific-sidebar-fill: #202021 !important;
|
|
52
|
+
--dsw-specific-sidebar-nav-item-hover: rgba(239, 130, 12, 0.1) !important;
|
|
53
|
+
--dsw-specific-sidebar-nav-item-active: rgba(239, 130, 12, 0.2) !important;
|
|
54
|
+
--dsw-specific-sidebar-nav-item-active-accent: #ef820c !important;
|
|
55
|
+
--dsw-specific-input-major: #29292c !important;
|
|
56
|
+
--dsw-specific-bubble: #29292c !important;
|
|
57
|
+
--dsw-specific-menu: #202021 !important;
|
|
58
|
+
--dsw-hovercard-bg: #29292c !important;
|
|
59
|
+
--dsw-alias-tooltip-bg: #1c1c1d !important;
|
|
60
|
+
--dsw-alias-button-elevated-fill: #2f2f33 !important;
|
|
61
|
+
--dsw-alias-button-floating-hover: #38383c !important;
|
|
62
|
+
--dsw-alias-brand-primary: #ef820c !important;
|
|
63
|
+
--dsw-alias-button-primary-fill: #ef820c !important;
|
|
64
|
+
--dsw-alias-button-primary-hover: #ff9940 !important;
|
|
65
|
+
--dsw-alias-label-primary-foreground: #ffffff !important;
|
|
66
|
+
--dsw-alias-label-primary: #fafafa !important;
|
|
67
|
+
--dsw-alias-label-secondary: #cccccc !important;
|
|
68
|
+
--dsw-alias-label-tertiary: #888888 !important;
|
|
69
|
+
--dsw-alias-label-dimmed: #555555 !important;
|
|
70
|
+
--dsw-alias-label-caption: #888888 !important;
|
|
71
|
+
--dsw-alias-interactive-bg-hover: rgba(239, 130, 12, 0.1) !important;
|
|
72
|
+
--dsw-alias-interactive-bg-active: rgba(239, 130, 12, 0.2) !important;
|
|
73
|
+
--dsw-alias-border-l1: #333333 !important;
|
|
74
|
+
--dsw-alias-border-l2: #2a2a2a !important;
|
|
75
|
+
--dsw-alias-border-l3: #3e3e3e !important;
|
|
76
|
+
--dsw-alias-border-l4: #555555 !important;
|
|
77
|
+
--dsw-alias-markdown-code-block: #1c1c1d !important;
|
|
78
|
+
--dsw-alias-markdown-code-block-banner: #252526 !important;
|
|
79
|
+
--dsw-alias-scrollbar-bg-l2: #333333 !important;
|
|
80
|
+
--dsw-alias-scrollbar-hover-l2: #ef820c !important;
|
|
81
|
+
}
|
|
82
|
+
body, body[data-ds-dark-theme] { background-color: #252526 !important; color: #fafafa !important; }
|
|
83
|
+
pre, code, [class*="codeBlock"] {
|
|
84
|
+
background-color: #1c1c1d !important;
|
|
85
|
+
color: #fafafa !important;
|
|
86
|
+
border-color: #333333 !important;
|
|
87
|
+
}
|
|
88
|
+
[class*="selector"], [class*="themeCube"] {
|
|
89
|
+
color: #fafafa !important;
|
|
90
|
+
background-color: #2d2d30 !important;
|
|
91
|
+
}
|
|
92
|
+
[class*="selected"], [class*="themeCube"]:hover {
|
|
93
|
+
border-color: #ef820c !important;
|
|
94
|
+
}
|
|
95
|
+
`
|
|
96
|
+
},
|
|
97
|
+
"dark-soft": {
|
|
98
|
+
name: "escook Dark Soft (\u67D4\u548C\u6697\u9ED1 \xB7 \u67D4\u5149\u5976\u674F\u9EC4)",
|
|
99
|
+
desc: "Ayu \u7ECF\u5178\u6DF1\u6D77\u84DD\u7070\u5E95\u8272\u642D\u914D\u6E29\u6DA6\u5976\u674F\u9EC4\uFF0C\u7EC6\u817B\u67D4\u548C\u957F\u6548\u9632\u75B2\u52B3",
|
|
100
|
+
type: "dark",
|
|
101
|
+
colorPreview: "#ffcc66",
|
|
102
|
+
bgPreview: "#1f2430",
|
|
103
|
+
css: `
|
|
104
|
+
:root, html, body, body[data-ds-dark-theme], [data-theme="escook-dark-soft"] {
|
|
105
|
+
--dsw-alias-bg-base: #1f2430 !important;
|
|
106
|
+
--dsw-alias-bg-layer-1: #191e28 !important;
|
|
107
|
+
--dsw-alias-bg-layer-2: #232834 !important;
|
|
108
|
+
--dsw-alias-bg-layer-3: #262c3b !important;
|
|
109
|
+
--dsw-alias-bg-module-platform: #262c3b !important;
|
|
110
|
+
--dsw-alias-bg-multi-select: #262c3b !important;
|
|
111
|
+
--dsw-alias-bg-overlay: #333a4c !important;
|
|
112
|
+
--dsw-specific-selector: #262c3b !important;
|
|
113
|
+
--dsw-alias-bg-mask-1: rgba(16, 20, 28, 0.7) !important;
|
|
114
|
+
--dsw-specific-sidebar-fill: #191e28 !important;
|
|
115
|
+
--dsw-specific-sidebar-nav-item-hover: rgba(255, 204, 102, 0.1) !important;
|
|
116
|
+
--dsw-specific-sidebar-nav-item-active: rgba(255, 204, 102, 0.18) !important;
|
|
117
|
+
--dsw-specific-sidebar-nav-item-active-accent: #ffcc66 !important;
|
|
118
|
+
--dsw-specific-input-major: #232834 !important;
|
|
119
|
+
--dsw-specific-bubble: #232834 !important;
|
|
120
|
+
--dsw-specific-menu: #191e28 !important;
|
|
121
|
+
--dsw-hovercard-bg: #191e28 !important;
|
|
122
|
+
--dsw-alias-tooltip-bg: #171b24 !important;
|
|
123
|
+
--dsw-alias-button-elevated-fill: #2b3140 !important;
|
|
124
|
+
--dsw-alias-button-floating-hover: #333a4c !important;
|
|
125
|
+
--dsw-alias-brand-primary: #ffcc66 !important;
|
|
126
|
+
--dsw-alias-button-primary-fill: #ffcc66 !important;
|
|
127
|
+
--dsw-alias-button-primary-hover: #ffd580 !important;
|
|
128
|
+
--dsw-alias-label-primary-foreground: #1f2430 !important;
|
|
129
|
+
--dsw-alias-label-primary: #cbccc6 !important;
|
|
130
|
+
--dsw-alias-label-secondary: #969aa4 !important;
|
|
131
|
+
--dsw-alias-label-tertiary: #707a8c !important;
|
|
132
|
+
--dsw-alias-label-dimmed: #515764 !important;
|
|
133
|
+
--dsw-alias-label-caption: #707a8c !important;
|
|
134
|
+
--dsw-alias-interactive-bg-hover: rgba(255, 204, 102, 0.1) !important;
|
|
135
|
+
--dsw-alias-interactive-bg-active: rgba(255, 204, 102, 0.18) !important;
|
|
136
|
+
--dsw-alias-border-l1: #373e4c !important;
|
|
137
|
+
--dsw-alias-border-l2: #2d3340 !important;
|
|
138
|
+
--dsw-alias-border-l3: #444c5e !important;
|
|
139
|
+
--dsw-alias-border-l4: #515764 !important;
|
|
140
|
+
--dsw-alias-markdown-code-block: #171b24 !important;
|
|
141
|
+
--dsw-alias-markdown-code-block-banner: #1f2430 !important;
|
|
142
|
+
--dsw-alias-scrollbar-bg-l2: #373e4c !important;
|
|
143
|
+
--dsw-alias-scrollbar-hover-l2: #ffcc66 !important;
|
|
144
|
+
}
|
|
145
|
+
body, body[data-ds-dark-theme] { background-color: #1f2430 !important; color: #cbccc6 !important; }
|
|
146
|
+
pre, code, [class*="codeBlock"] {
|
|
147
|
+
background-color: #171b24 !important;
|
|
148
|
+
color: #cbccc6 !important;
|
|
149
|
+
border-color: #373e4c !important;
|
|
150
|
+
}
|
|
151
|
+
[class*="selector"], [class*="themeCube"] {
|
|
152
|
+
color: #cbccc6 !important;
|
|
153
|
+
background-color: #262c3b !important;
|
|
154
|
+
}
|
|
155
|
+
[class*="selected"], [class*="themeCube"]:hover {
|
|
156
|
+
border-color: #ffcc66 !important;
|
|
157
|
+
}
|
|
158
|
+
`
|
|
159
|
+
},
|
|
160
|
+
"light": {
|
|
161
|
+
name: "escook Light (\u7ECF\u5178\u6D45\u8272 \xB7 \u5178\u96C5\u7D2B\u7F57\u5170)",
|
|
162
|
+
desc: "Solarized \u7ECF\u5178\u62A4\u773C\u6696\u7C73\u767D\u642D\u914D\u5178\u96C5\u7D2B\u7F57\u5170\u4E0E\u9752\u58A8\u6587\u672C\uFF0C\u6E29\u6DA6\u7EB8\u8D28\u4E66\u5377\u611F",
|
|
163
|
+
type: "light",
|
|
164
|
+
colorPreview: "#705697",
|
|
165
|
+
bgPreview: "#fdf6e3",
|
|
166
|
+
css: `
|
|
167
|
+
:root, html, body, body[data-ds-dark-theme], [data-theme="escook-light"] {
|
|
168
|
+
--dsw-alias-bg-base: #fdf6e3 !important;
|
|
169
|
+
--dsw-alias-bg-layer-1: #f8f0d8 !important;
|
|
170
|
+
--dsw-alias-bg-layer-2: #ffffff !important;
|
|
171
|
+
--dsw-alias-bg-layer-3: #eee8d5 !important;
|
|
172
|
+
--dsw-alias-bg-module-platform: #eee8d5 !important;
|
|
173
|
+
--dsw-alias-bg-multi-select: #eee8d5 !important;
|
|
174
|
+
--dsw-alias-bg-overlay: #e3dac6 !important;
|
|
175
|
+
--dsw-specific-selector: #eee8d5 !important;
|
|
176
|
+
--dsw-alias-bg-mask-1: rgba(50, 40, 60, 0.25) !important;
|
|
177
|
+
--dsw-specific-sidebar-fill: #f8f0d8 !important;
|
|
178
|
+
--dsw-specific-sidebar-nav-item-hover: rgba(112, 86, 151, 0.08) !important;
|
|
179
|
+
--dsw-specific-sidebar-nav-item-active: rgba(112, 86, 151, 0.16) !important;
|
|
180
|
+
--dsw-specific-sidebar-nav-item-active-accent: #705697 !important;
|
|
181
|
+
--dsw-specific-input-major: #ffffff !important;
|
|
182
|
+
--dsw-specific-bubble: #ffffff !important;
|
|
183
|
+
--dsw-specific-menu: #ffffff !important;
|
|
184
|
+
--dsw-hovercard-bg: #ffffff !important;
|
|
185
|
+
--dsw-alias-tooltip-bg: #2b2638 !important;
|
|
186
|
+
--dsw-alias-button-elevated-fill: #f4ecce !important;
|
|
187
|
+
--dsw-alias-button-floating-hover: #ece2c4 !important;
|
|
188
|
+
--dsw-alias-brand-primary: #705697 !important;
|
|
189
|
+
--dsw-alias-button-primary-fill: #705697 !important;
|
|
190
|
+
--dsw-alias-button-primary-hover: #876cad !important;
|
|
191
|
+
--dsw-alias-label-primary-foreground: #ffffff !important;
|
|
192
|
+
--dsw-alias-label-primary: #586e75 !important;
|
|
193
|
+
--dsw-alias-label-secondary: #657b83 !important;
|
|
194
|
+
--dsw-alias-label-tertiary: #93a1a1 !important;
|
|
195
|
+
--dsw-alias-label-dimmed: #b58900 !important;
|
|
196
|
+
--dsw-alias-label-caption: #93a1a1 !important;
|
|
197
|
+
--dsw-alias-interactive-bg-hover: rgba(112, 86, 151, 0.08) !important;
|
|
198
|
+
--dsw-alias-interactive-bg-active: rgba(112, 86, 151, 0.15) !important;
|
|
199
|
+
--dsw-alias-border-l1: #e3dac6 !important;
|
|
200
|
+
--dsw-alias-border-l2: #ece3cf !important;
|
|
201
|
+
--dsw-alias-border-l3: #d8ceb8 !important;
|
|
202
|
+
--dsw-alias-border-l4: #b58900 !important;
|
|
203
|
+
--dsw-alias-markdown-code-block: #f5eed8 !important;
|
|
204
|
+
--dsw-alias-markdown-code-block-banner: #ebe4cc !important;
|
|
205
|
+
--dsw-alias-scrollbar-bg-l2: #e3dac6 !important;
|
|
206
|
+
--dsw-alias-scrollbar-hover-l2: #705697 !important;
|
|
207
|
+
}
|
|
208
|
+
body, body[data-ds-dark-theme] { background-color: #fdf6e3 !important; color: #586e75 !important; }
|
|
209
|
+
pre, code, [class*="codeBlock"] {
|
|
210
|
+
background-color: #f5eed8 !important;
|
|
211
|
+
color: #586e75 !important;
|
|
212
|
+
border-color: #e3dac6 !important;
|
|
213
|
+
}
|
|
214
|
+
[class*="selector"], [class*="themeCube"] {
|
|
215
|
+
color: #586e75 !important;
|
|
216
|
+
background-color: #eee8d5 !important;
|
|
217
|
+
}
|
|
218
|
+
[class*="selected"], [class*="themeCube"]:hover {
|
|
219
|
+
border-color: #705697 !important;
|
|
220
|
+
}
|
|
221
|
+
`
|
|
222
|
+
},
|
|
223
|
+
"light-soft": {
|
|
224
|
+
name: "escook Light Soft (\u67D4\u548C\u6D45\u8272 \xB7 \u6D3B\u529B\u67D4\u548C\u6A59)",
|
|
225
|
+
desc: "\u73B0\u4EE3\u6781\u7B80\u6E05\u900F\u6D45\u7070\u642D\u914D\u67D4\u548C\u6D3B\u529B\u6A59\uFF0C\u660E\u4EAE\u6E05\u723D\u4E0D\u523A\u773C",
|
|
226
|
+
type: "light",
|
|
227
|
+
colorPreview: "#ff9940",
|
|
228
|
+
bgPreview: "#fafafa",
|
|
229
|
+
css: `
|
|
230
|
+
:root, html, body, body[data-ds-dark-theme], [data-theme="escook-light-soft"] {
|
|
231
|
+
--dsw-alias-bg-base: #fafafa !important;
|
|
232
|
+
--dsw-alias-bg-layer-1: #f2f2f2 !important;
|
|
233
|
+
--dsw-alias-bg-layer-2: #ffffff !important;
|
|
234
|
+
--dsw-alias-bg-layer-3: #e8e8e8 !important;
|
|
235
|
+
--dsw-alias-bg-module-platform: #e8e8e8 !important;
|
|
236
|
+
--dsw-alias-bg-multi-select: #e8e8e8 !important;
|
|
237
|
+
--dsw-alias-bg-overlay: #dcdcdc !important;
|
|
238
|
+
--dsw-specific-selector: #e8e8e8 !important;
|
|
239
|
+
--dsw-alias-bg-mask-1: rgba(0, 0, 0, 0.2) !important;
|
|
240
|
+
--dsw-specific-sidebar-fill: #f2f2f2 !important;
|
|
241
|
+
--dsw-specific-sidebar-nav-item-hover: rgba(255, 153, 64, 0.08) !important;
|
|
242
|
+
--dsw-specific-sidebar-nav-item-active: rgba(255, 153, 64, 0.16) !important;
|
|
243
|
+
--dsw-specific-sidebar-nav-item-active-accent: #ff9940 !important;
|
|
244
|
+
--dsw-specific-input-major: #ffffff !important;
|
|
245
|
+
--dsw-specific-bubble: #ffffff !important;
|
|
246
|
+
--dsw-specific-menu: #ffffff !important;
|
|
247
|
+
--dsw-hovercard-bg: #ffffff !important;
|
|
248
|
+
--dsw-alias-tooltip-bg: #2d3748 !important;
|
|
249
|
+
--dsw-alias-button-elevated-fill: #eaeaea !important;
|
|
250
|
+
--dsw-alias-button-floating-hover: #e0e0e0 !important;
|
|
251
|
+
--dsw-alias-brand-primary: #ff9940 !important;
|
|
252
|
+
--dsw-alias-button-primary-fill: #ff9940 !important;
|
|
253
|
+
--dsw-alias-button-primary-hover: #f58220 !important;
|
|
254
|
+
--dsw-alias-label-primary-foreground: #ffffff !important;
|
|
255
|
+
--dsw-alias-label-primary: #2d3748 !important;
|
|
256
|
+
--dsw-alias-label-secondary: #4a5568 !important;
|
|
257
|
+
--dsw-alias-label-tertiary: #718096 !important;
|
|
258
|
+
--dsw-alias-label-dimmed: #a0aec0 !important;
|
|
259
|
+
--dsw-alias-label-caption: #718096 !important;
|
|
260
|
+
--dsw-alias-interactive-bg-hover: rgba(255, 153, 64, 0.08) !important;
|
|
261
|
+
--dsw-alias-interactive-bg-active: rgba(255, 153, 64, 0.15) !important;
|
|
262
|
+
--dsw-alias-border-l1: #dcdcdc !important;
|
|
263
|
+
--dsw-alias-border-l2: #e8e8e8 !important;
|
|
264
|
+
--dsw-alias-border-l3: #d0d0d0 !important;
|
|
265
|
+
--dsw-alias-border-l4: #a0aec0 !important;
|
|
266
|
+
--dsw-alias-markdown-code-block: #f0f2f5 !important;
|
|
267
|
+
--dsw-alias-markdown-code-block-banner: #e6e9ee !important;
|
|
268
|
+
--dsw-alias-scrollbar-bg-l2: #dcdcdc !important;
|
|
269
|
+
--dsw-alias-scrollbar-hover-l2: #ff9940 !important;
|
|
270
|
+
}
|
|
271
|
+
body, body[data-ds-dark-theme] { background-color: #fafafa !important; color: #2d3748 !important; }
|
|
272
|
+
pre, code, [class*="codeBlock"] {
|
|
273
|
+
background-color: #f0f2f5 !important;
|
|
274
|
+
color: #2d3748 !important;
|
|
275
|
+
border-color: #dcdcdc !important;
|
|
276
|
+
}
|
|
277
|
+
[class*="selector"], [class*="themeCube"] {
|
|
278
|
+
color: #2d3748 !important;
|
|
279
|
+
background-color: #e8e8e8 !important;
|
|
280
|
+
}
|
|
281
|
+
[class*="selected"], [class*="themeCube"]:hover {
|
|
282
|
+
border-color: #ff9940 !important;
|
|
283
|
+
}
|
|
284
|
+
`
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
function activate(context) {
|
|
288
|
+
if (typeof window !== "undefined" && window.__DSH_BUILTIN_THEMES__) {
|
|
289
|
+
console.info("\u{1F338} [dsh-theme-escook] \u68C0\u6D4B\u5230\u5F53\u524D\u5904\u4E8E DSH Desktop \u684C\u9762\u7AEF\uFF0C\u6B63\u5728\u5C06\u63D2\u4EF6\u6700\u65B0\u4E3B\u9898\u77E9\u9635\u70ED\u540C\u6B65\u81F3\u5BA2\u6237\u7AEF...");
|
|
290
|
+
const builtin = window.__DSH_BUILTIN_THEMES__;
|
|
291
|
+
if (typeof builtin.registerThemes === "function") {
|
|
292
|
+
builtin.registerThemes(THEME_SCHEMES);
|
|
293
|
+
}
|
|
294
|
+
const themeController2 = {
|
|
295
|
+
schemes: Object.keys(THEME_SCHEMES),
|
|
296
|
+
setScheme(key) {
|
|
297
|
+
builtin.apply(key);
|
|
298
|
+
},
|
|
299
|
+
getCurrentScheme() {
|
|
300
|
+
return builtin.getCurrent();
|
|
301
|
+
},
|
|
302
|
+
dispose() {
|
|
303
|
+
if (window.__ESCOOK_THEME__ === themeController2) {
|
|
304
|
+
delete window.__ESCOOK_THEME__;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
window.__ESCOOK_THEME__ = themeController2;
|
|
309
|
+
return themeController2;
|
|
310
|
+
}
|
|
311
|
+
const styleId = "dsh-theme-escook-styles";
|
|
312
|
+
const storageKey = "dsh_theme_escook_scheme";
|
|
313
|
+
let styleEl = document.getElementById(styleId);
|
|
314
|
+
function applyScheme(key) {
|
|
315
|
+
const validKey = THEME_SCHEMES[key] ? key : "dark-soft";
|
|
316
|
+
const scheme = THEME_SCHEMES[validKey];
|
|
317
|
+
if (!styleEl) {
|
|
318
|
+
styleEl = document.createElement("style");
|
|
319
|
+
styleEl.id = styleId;
|
|
320
|
+
document.head.appendChild(styleEl);
|
|
321
|
+
}
|
|
322
|
+
styleEl.textContent = scheme.css;
|
|
323
|
+
document.documentElement.setAttribute("data-dsh-theme", `escook-${validKey}`);
|
|
324
|
+
try {
|
|
325
|
+
localStorage.setItem(storageKey, validKey);
|
|
326
|
+
} catch (e) {
|
|
327
|
+
}
|
|
328
|
+
console.info(`\u{1F338} [dsh-theme-escook] \u5F53\u524D\u6FC0\u6D3B\u914D\u8272: ${scheme.name}`);
|
|
329
|
+
}
|
|
330
|
+
let savedScheme = "dark-soft";
|
|
331
|
+
try {
|
|
332
|
+
savedScheme = localStorage.getItem(storageKey) || localStorage.getItem("dsh_selected_theme") || "dark-soft";
|
|
333
|
+
} catch (e) {
|
|
334
|
+
}
|
|
335
|
+
applyScheme(savedScheme);
|
|
336
|
+
const themeController = {
|
|
337
|
+
schemes: Object.keys(THEME_SCHEMES),
|
|
338
|
+
setScheme(key) {
|
|
339
|
+
applyScheme(key);
|
|
340
|
+
},
|
|
341
|
+
getCurrentScheme() {
|
|
342
|
+
try {
|
|
343
|
+
return localStorage.getItem(storageKey) || "dark-soft";
|
|
344
|
+
} catch (e) {
|
|
345
|
+
return "dark-soft";
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
dispose() {
|
|
349
|
+
if (styleEl && styleEl.parentNode) {
|
|
350
|
+
styleEl.parentNode.removeChild(styleEl);
|
|
351
|
+
}
|
|
352
|
+
document.documentElement.removeAttribute("data-dsh-theme");
|
|
353
|
+
if (window.__ESCOOK_THEME__ === themeController) {
|
|
354
|
+
delete window.__ESCOOK_THEME__;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
window.__ESCOOK_THEME__ = themeController;
|
|
359
|
+
return themeController;
|
|
360
|
+
}
|
|
361
|
+
var apply = (context) => {
|
|
362
|
+
const controller = activate(context);
|
|
363
|
+
return () => controller.dispose();
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
return module.exports;
|
|
367
|
+
}
|
|
368
|
+
});
|
package/client/client.js
CHANGED
|
@@ -275,6 +275,9 @@ export default function activate(context) {
|
|
|
275
275
|
},
|
|
276
276
|
dispose() {
|
|
277
277
|
// 由桌面端原生管理生命周期
|
|
278
|
+
if (window.__ESCOOK_THEME__ === themeController) {
|
|
279
|
+
delete window.__ESCOOK_THEME__;
|
|
280
|
+
}
|
|
278
281
|
}
|
|
279
282
|
};
|
|
280
283
|
window.__ESCOOK_THEME__ = themeController;
|
|
@@ -335,3 +338,9 @@ export default function activate(context) {
|
|
|
335
338
|
window.__ESCOOK_THEME__ = themeController;
|
|
336
339
|
return themeController;
|
|
337
340
|
}
|
|
341
|
+
|
|
342
|
+
// 宿主以 Cordis 插件对象激活模块,卸载时释放本插件拥有的资源。
|
|
343
|
+
export const apply = (context) => {
|
|
344
|
+
const controller = activate(context);
|
|
345
|
+
return () => controller.dispose();
|
|
346
|
+
};
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-theme-escook",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "🌸 彬哥の经典主题 (escook-theme) for DeepSeek Harness — 优雅暗夜紫调与琥珀金高亮美学主题",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"
|
|
9
|
+
"build": "node scripts/build-client.mjs",
|
|
10
|
+
"prepack": "npm run build && npm test",
|
|
11
|
+
"test": "node --test test/client-entry.test.mjs test/runtime-compatibility.test.mjs test/host-loader.test.mjs && node test/verify-themes.mjs"
|
|
10
12
|
},
|
|
11
13
|
"exports": {
|
|
12
14
|
".": "./lib/index.js",
|
|
13
|
-
"./client": "./client/client.js",
|
|
15
|
+
"./client": "./client/client.bundle.js",
|
|
14
16
|
"./package.json": "./package.json"
|
|
15
17
|
},
|
|
16
18
|
"author": "Simon-yyy",
|
|
@@ -55,6 +57,7 @@
|
|
|
55
57
|
"@deepseek-ai/dsh-client-ui-theme": ">=0.0.1-rc.1 <0.1.0 || >=0.1.0-rc.1 <0.2.0-0 || >=0.2.0-rc.2 <0.3.0-0"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
60
|
+
"esbuild": "^0.28.2",
|
|
58
61
|
"semver": "^7.7.2"
|
|
59
62
|
},
|
|
60
63
|
"publishConfig": {
|