dsh-earnings-clock 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +47 -2
- package/client.js +1078 -0
- package/cordis.patch.yml +3 -0
- package/docs/DETAIL.md +34 -0
- package/icon.svg +18 -0
- package/index.js +9 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +53 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 kenLiaowj
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 今天赚了多少钱 · Earnings Clock
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A small always-on panel **above the composer** in DeepSeek Harness. It turns your preset work hours and daily wage into a live "earned so far today" figure — no more mental math at 15:42 on a Tuesday.
|
|
4
|
+
|
|
5
|
+
输入框上方一条常驻小面板:根据你预设的**上下班时间**与**每日工资**,实时算出今天到目前为止已经赚了多少钱。
|
|
6
|
+
|
|
7
|
+
## Features / 功能
|
|
8
|
+
|
|
9
|
+
- **Live earnings** — recomputed every second from the share of the shift already worked. / **实时金额**:按班次已过比例每秒刷新。
|
|
10
|
+
- **Progress bar** — how much of today's shift (and wage) is done, with a percentage. / **进度条**:今日班次与工资完成度,带百分比。
|
|
11
|
+
- **Phase-aware** — `Not started` / `Remaining` / `Done for today` / `Off duty · overtime` / `Rest day`, with overtime tracked after the end time. / **状态感知**:距上班 / 距下班 / 今日已完成 / 已下班 · 加班(自动统计加班时长)/ 今天休息。
|
|
12
|
+
- **Theme-aware** — built only from `--dsw-alias-*` tokens, so it follows light and dark themes with no hard-coded colors. / **跟随主题**:只用主题 token,深浅色自动适配,零字面颜色。
|
|
13
|
+
- **Bilingual** — Chinese and English through the DSH locale service. / **中英双语**:走 DSH locale 服务。
|
|
14
|
+
- **Settings page** — its own page under Settings, saved automatically. / **自带设置页**:设置里独立一页,修改即时保存。
|
|
15
|
+
|
|
16
|
+
## Install / 安装
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
dsh plugin --profile desktop add dsh-earnings-clock
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or in the SDK/Web GUI: **Settings → Plugins** and install `dsh-earnings-clock`. After installing, reload the page — the panel appears directly above the input box.
|
|
23
|
+
|
|
24
|
+
也可以在 Web GUI 的 **设置 → 插件** 里安装;安装后刷新页面,面板会出现在输入框正上方。
|
|
25
|
+
|
|
26
|
+
## Settings / 设置
|
|
27
|
+
|
|
28
|
+
Open **Settings → Earnings Clock** and fill in:
|
|
29
|
+
|
|
30
|
+
| Field | Meaning |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| Start time | 24-hour `HH:MM`, e.g. `09:00` |
|
|
33
|
+
| End time | Must be later than the start, e.g. `18:00` |
|
|
34
|
+
| Daily wage | Pay for the whole shift, e.g. `800` |
|
|
35
|
+
| Currency | Prefix symbol, e.g. `¥`, `$`, `€` |
|
|
36
|
+
| Weekdays only | When on, Saturdays and Sundays show as rest days |
|
|
37
|
+
|
|
38
|
+
设置 → 今天赚了多少钱:上班时间、下班时间(需晚于上班时间)、每日工资、货币符号、只在工作日计算。修改即时生效并自动保存。
|
|
39
|
+
|
|
40
|
+
## Storage / 数据保存
|
|
41
|
+
|
|
42
|
+
Settings live in the browser's `localStorage` under `dsh-earnings-clock:v1`. Nothing leaves your machine — there is no host config, no network call, no account.
|
|
43
|
+
|
|
44
|
+
设置保存在浏览器 `localStorage`(键 `dsh-earnings-clock:v1`),不上传、不发网络请求。换浏览器或清站点数据会重置,重新填一次即可。
|
|
45
|
+
|
|
46
|
+
## License / 许可
|
|
47
|
+
|
|
48
|
+
[MIT](LICENSE)
|
package/client.js
ADDED
|
@@ -0,0 +1,1078 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: 'dsh-earnings-clock',
|
|
3
|
+
factory(require) {
|
|
4
|
+
const React = require('react');
|
|
5
|
+
const h = React.createElement;
|
|
6
|
+
const { useEffect, useMemo, useState, useSyncExternalStore } = React;
|
|
7
|
+
|
|
8
|
+
/** Locale namespace shared by the metadata files and the Client dictionaries. */
|
|
9
|
+
const NS = 'earningsClock';
|
|
10
|
+
/** Stable ids: dock entry, settings section and its nav icon all reuse it. */
|
|
11
|
+
const SECTION_ID = 'earnings-clock';
|
|
12
|
+
const STORAGE_KEY = 'dsh-earnings-clock:v1';
|
|
13
|
+
|
|
14
|
+
const DEFAULTS = Object.freeze({
|
|
15
|
+
start: '09:00',
|
|
16
|
+
end: '18:00',
|
|
17
|
+
wage: 0,
|
|
18
|
+
currency: '¥',
|
|
19
|
+
weekdaysOnly: true,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// ── dictionaries ────────────────────────────────────────────────────────
|
|
23
|
+
const ZH = {
|
|
24
|
+
'dock.aria': '今天赚了多少钱',
|
|
25
|
+
'dock.tooltip': '{start} – {end},日薪 {wage}',
|
|
26
|
+
'dock.perDay': '日薪 {amount}',
|
|
27
|
+
'dock.worked': '已工作 {time}',
|
|
28
|
+
'dock.before': '距上班 {time}',
|
|
29
|
+
'dock.remaining': '距下班 {time}',
|
|
30
|
+
'dock.overtime': '已下班 · 加班 {time}',
|
|
31
|
+
'dock.done': '今日已完成',
|
|
32
|
+
'dock.notStarted': '还没开始',
|
|
33
|
+
'dock.restTitle': '今天休息',
|
|
34
|
+
'dock.restCaption': '周末不计入工资',
|
|
35
|
+
'dock.unsetTitle': '设置上下班时间与日薪,开始计算今天赚了多少钱',
|
|
36
|
+
'dock.openSettings': '去设置',
|
|
37
|
+
'dock.openSettingsTitle': '打开插件设置',
|
|
38
|
+
'settings.nav': '今天赚了多少钱',
|
|
39
|
+
'settings.title': '今天赚了多少钱',
|
|
40
|
+
'settings.intro': '在这里预设每天的上下班时间与工资。输入框上方会一直显示今天已经赚到的金额、当前进度和距离下班的时间,深浅色主题自动跟随。',
|
|
41
|
+
'settings.start': '上班时间',
|
|
42
|
+
'settings.end': '下班时间',
|
|
43
|
+
'settings.wage': '每日工资',
|
|
44
|
+
'settings.currency': '货币符号',
|
|
45
|
+
'settings.timeHint': '24 小时制,例如 09:00',
|
|
46
|
+
'settings.wageHint': '例如 800',
|
|
47
|
+
'settings.currencyHint': '例如 ¥、$、€',
|
|
48
|
+
'settings.weekdaysOnly': '只在工作日计算',
|
|
49
|
+
'settings.weekdaysOnlyHint': '周六、周日显示为休息日,不计入工资。',
|
|
50
|
+
'settings.preview': '今日预览',
|
|
51
|
+
'settings.previewLine': '现在已赚 {percent}% 的日薪',
|
|
52
|
+
'settings.previewRest': '今天是休息日,不计入工资。',
|
|
53
|
+
'settings.previewUnset': '填写每日工资后开始计算。',
|
|
54
|
+
'settings.invalidRange': '下班时间需要晚于上班时间。',
|
|
55
|
+
'settings.invalidWage': '请输入大于 0 的数字。',
|
|
56
|
+
'settings.autosave': '修改会自动保存',
|
|
57
|
+
'settings.reset': '恢复默认',
|
|
58
|
+
'settings.saved': '已保存',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const EN = {
|
|
62
|
+
'dock.aria': 'Earnings today',
|
|
63
|
+
'dock.tooltip': '{start} – {end}, daily wage {wage}',
|
|
64
|
+
'dock.perDay': 'Daily {amount}',
|
|
65
|
+
'dock.worked': 'Worked {time}',
|
|
66
|
+
'dock.before': 'Starts in {time}',
|
|
67
|
+
'dock.remaining': 'Leaves {time}',
|
|
68
|
+
'dock.overtime': 'Off duty · overtime {time}',
|
|
69
|
+
'dock.done': 'Done for today',
|
|
70
|
+
'dock.notStarted': 'Not started',
|
|
71
|
+
'dock.restTitle': 'Day off',
|
|
72
|
+
'dock.restCaption': 'Weekends are not counted',
|
|
73
|
+
'dock.unsetTitle': 'Set your work hours and daily wage to start counting today’s earnings',
|
|
74
|
+
'dock.openSettings': 'Set up',
|
|
75
|
+
'dock.openSettingsTitle': 'Open plugin settings',
|
|
76
|
+
'settings.nav': 'Earnings Clock',
|
|
77
|
+
'settings.title': 'Earnings Clock',
|
|
78
|
+
'settings.intro': 'Preset your daily work hours and wage here. Above the composer the plugin keeps showing how much you have earned today, the current progress, and the time left until you clock off. Light and dark themes are followed automatically.',
|
|
79
|
+
'settings.start': 'Start time',
|
|
80
|
+
'settings.end': 'End time',
|
|
81
|
+
'settings.wage': 'Daily wage',
|
|
82
|
+
'settings.currency': 'Currency symbol',
|
|
83
|
+
'settings.timeHint': '24-hour clock, e.g. 09:00',
|
|
84
|
+
'settings.wageHint': 'e.g. 800',
|
|
85
|
+
'settings.currencyHint': 'e.g. ¥, $, €',
|
|
86
|
+
'settings.weekdaysOnly': 'Weekdays only',
|
|
87
|
+
'settings.weekdaysOnlyHint': 'Saturdays and Sundays show as a day off and add nothing.',
|
|
88
|
+
'settings.preview': 'Today at a glance',
|
|
89
|
+
'settings.previewLine': '{percent}% of today’s wage earned',
|
|
90
|
+
'settings.previewRest': 'Today is a day off, so nothing is counted.',
|
|
91
|
+
'settings.previewUnset': 'Set a daily wage to start counting.',
|
|
92
|
+
'settings.invalidRange': 'End time must be later than the start time.',
|
|
93
|
+
'settings.invalidWage': 'Enter a number greater than 0.',
|
|
94
|
+
'settings.autosave': 'Changes are saved automatically',
|
|
95
|
+
'settings.reset': 'Reset to defaults',
|
|
96
|
+
'settings.saved': 'Saved',
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const TEXT = { zh: ZH, en: EN };
|
|
100
|
+
|
|
101
|
+
function activeLang(ctx) {
|
|
102
|
+
try {
|
|
103
|
+
const snap = ctx && ctx.locale && typeof ctx.locale.getSnapshot === 'function'
|
|
104
|
+
? ctx.locale.getSnapshot()
|
|
105
|
+
: null;
|
|
106
|
+
const id = snap && typeof snap.active === 'string' ? snap.active.toLowerCase() : 'en';
|
|
107
|
+
return id.indexOf('zh') === 0 ? 'zh' : 'en';
|
|
108
|
+
} catch (error) {
|
|
109
|
+
return 'en';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Prefer the seat's own `t`; fall back to the local dictionary if absent. */
|
|
114
|
+
function makeT(ctx, t) {
|
|
115
|
+
if (typeof t === 'function') return t;
|
|
116
|
+
const dict = TEXT[activeLang(ctx)] || EN;
|
|
117
|
+
return function translate(key, params) {
|
|
118
|
+
let out = Object.prototype.hasOwnProperty.call(dict, key) ? dict[key] : key;
|
|
119
|
+
if (params) {
|
|
120
|
+
out = out.replace(/\{(\w+)\}/g, function (match, name) {
|
|
121
|
+
return params[name] === undefined || params[name] === null ? match : String(params[name]);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return out;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ── settings store (client-local preference) ────────────────────────────
|
|
129
|
+
/** Parse `HH:MM` into minutes after midnight; null when malformed. */
|
|
130
|
+
function parseTime(text) {
|
|
131
|
+
if (typeof text !== 'string') return null;
|
|
132
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(text.trim());
|
|
133
|
+
if (!match) return null;
|
|
134
|
+
const hours = Number(match[1]);
|
|
135
|
+
const minutes = Number(match[2]);
|
|
136
|
+
if (hours > 23 || minutes > 59) return null;
|
|
137
|
+
return hours * 60 + minutes;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function asText(value, fallback) {
|
|
141
|
+
return typeof value === 'string' ? value : typeof value === 'number' ? String(value) : fallback;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function normalize(raw) {
|
|
145
|
+
const source = raw && typeof raw === 'object' ? raw : {};
|
|
146
|
+
const wage = Number(source.wage);
|
|
147
|
+
return {
|
|
148
|
+
start: asText(source.start, DEFAULTS.start),
|
|
149
|
+
end: asText(source.end, DEFAULTS.end),
|
|
150
|
+
wage: Number.isFinite(wage) && wage > 0 ? wage : 0,
|
|
151
|
+
currency: asText(source.currency, DEFAULTS.currency) || DEFAULTS.currency,
|
|
152
|
+
weekdaysOnly: source.weekdaysOnly === undefined ? DEFAULTS.weekdaysOnly : !!source.weekdaysOnly,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function readFromStorage() {
|
|
157
|
+
try {
|
|
158
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
159
|
+
if (!raw) return normalize(DEFAULTS);
|
|
160
|
+
return normalize(JSON.parse(raw));
|
|
161
|
+
} catch (error) {
|
|
162
|
+
return normalize(DEFAULTS);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
let cache = readFromStorage();
|
|
167
|
+
const listeners = new Set();
|
|
168
|
+
|
|
169
|
+
function emit() {
|
|
170
|
+
listeners.forEach(function (listener) {
|
|
171
|
+
try {
|
|
172
|
+
listener();
|
|
173
|
+
} catch (error) {
|
|
174
|
+
/* a broken subscriber must not stop the others */
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function getSettings() {
|
|
180
|
+
return cache;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function subscribeSettings(listener) {
|
|
184
|
+
listeners.add(listener);
|
|
185
|
+
return function unsubscribe() {
|
|
186
|
+
listeners.delete(listener);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function sameSettings(a, b) {
|
|
191
|
+
return a.start === b.start
|
|
192
|
+
&& a.end === b.end
|
|
193
|
+
&& a.wage === b.wage
|
|
194
|
+
&& a.currency === b.currency
|
|
195
|
+
&& a.weekdaysOnly === b.weekdaysOnly;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function writeSettings(patch) {
|
|
199
|
+
const next = normalize(Object.assign({}, cache, patch));
|
|
200
|
+
if (sameSettings(cache, next)) return;
|
|
201
|
+
cache = next;
|
|
202
|
+
try {
|
|
203
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(cache));
|
|
204
|
+
} catch (error) {
|
|
205
|
+
/* private mode / quota: keep the in-memory value so the UI still works */
|
|
206
|
+
}
|
|
207
|
+
emit();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function useSettings() {
|
|
211
|
+
return useSyncExternalStore(subscribeSettings, getSettings, getSettings);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {
|
|
215
|
+
window.addEventListener('storage', function (event) {
|
|
216
|
+
if (event.key !== STORAGE_KEY) return;
|
|
217
|
+
cache = readFromStorage();
|
|
218
|
+
emit();
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// ── clock + money ───────────────────────────────────────────────────────
|
|
223
|
+
function useNow(active) {
|
|
224
|
+
const [now, setNow] = useState(function () {
|
|
225
|
+
return Date.now();
|
|
226
|
+
});
|
|
227
|
+
useEffect(function () {
|
|
228
|
+
if (!active) return undefined;
|
|
229
|
+
const id = window.setInterval(function () {
|
|
230
|
+
setNow(Date.now());
|
|
231
|
+
}, 1000);
|
|
232
|
+
return function () {
|
|
233
|
+
window.clearInterval(id);
|
|
234
|
+
};
|
|
235
|
+
}, [active]);
|
|
236
|
+
return now;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function pad2(value) {
|
|
240
|
+
return value < 10 ? '0' + value : String(value);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** `h:mm:ss` (hours omitted at zero) for countdowns. */
|
|
244
|
+
function formatClock(ms) {
|
|
245
|
+
const total = Math.max(0, Math.floor(ms / 1000));
|
|
246
|
+
const hours = Math.floor(total / 3600);
|
|
247
|
+
const minutes = Math.floor((total % 3600) / 60);
|
|
248
|
+
const seconds = total % 60;
|
|
249
|
+
return (hours > 0 ? hours + ':' : '') + pad2(minutes) + ':' + pad2(seconds);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function formatMoney(currency, amount) {
|
|
253
|
+
const fixed = Math.max(0, Math.round(amount * 100) / 100).toFixed(2);
|
|
254
|
+
const parts = fixed.split('.');
|
|
255
|
+
const grouped = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
256
|
+
return (currency || DEFAULTS.currency) + grouped + '.' + parts[1];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function isWeekend(now) {
|
|
260
|
+
const day = new Date(now).getDay();
|
|
261
|
+
return day === 0 || day === 6;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Project one instant onto the configured workday.
|
|
266
|
+
* Phases: unset → rest → before → working → after.
|
|
267
|
+
*/
|
|
268
|
+
function computeView(settings, now) {
|
|
269
|
+
const startMin = parseTime(settings.start);
|
|
270
|
+
const endMin = parseTime(settings.end);
|
|
271
|
+
const wage = Number(settings.wage);
|
|
272
|
+
const validRange = startMin !== null && endMin !== null && endMin > startMin;
|
|
273
|
+
const configured = validRange && Number.isFinite(wage) && wage > 0;
|
|
274
|
+
const currency = settings.currency || DEFAULTS.currency;
|
|
275
|
+
const view = {
|
|
276
|
+
configured: configured,
|
|
277
|
+
phase: 'unset',
|
|
278
|
+
restDay: false,
|
|
279
|
+
currency: currency,
|
|
280
|
+
wage: configured ? wage : 0,
|
|
281
|
+
progress: 0,
|
|
282
|
+
earned: 0,
|
|
283
|
+
workedMs: 0,
|
|
284
|
+
totalMs: 0,
|
|
285
|
+
msToStart: 0,
|
|
286
|
+
msToEnd: 0,
|
|
287
|
+
overtimeMs: 0,
|
|
288
|
+
rangeInvalid: startMin !== null && endMin !== null && endMin <= startMin,
|
|
289
|
+
};
|
|
290
|
+
if (!configured) return view;
|
|
291
|
+
|
|
292
|
+
const dayStart = new Date(now);
|
|
293
|
+
dayStart.setHours(Math.floor(startMin / 60), startMin % 60, 0, 0);
|
|
294
|
+
const dayEnd = new Date(now);
|
|
295
|
+
dayEnd.setHours(Math.floor(endMin / 60), endMin % 60, 0, 0);
|
|
296
|
+
const totalMs = dayEnd.getTime() - dayStart.getTime();
|
|
297
|
+
view.totalMs = totalMs;
|
|
298
|
+
|
|
299
|
+
if (settings.weekdaysOnly && isWeekend(now)) {
|
|
300
|
+
view.phase = 'rest';
|
|
301
|
+
view.restDay = true;
|
|
302
|
+
return view;
|
|
303
|
+
}
|
|
304
|
+
if (now < dayStart.getTime()) {
|
|
305
|
+
view.phase = 'before';
|
|
306
|
+
view.msToStart = dayStart.getTime() - now;
|
|
307
|
+
return view;
|
|
308
|
+
}
|
|
309
|
+
if (now >= dayEnd.getTime()) {
|
|
310
|
+
view.phase = 'after';
|
|
311
|
+
view.progress = 1;
|
|
312
|
+
view.earned = wage;
|
|
313
|
+
view.workedMs = totalMs;
|
|
314
|
+
view.overtimeMs = now - dayEnd.getTime();
|
|
315
|
+
return view;
|
|
316
|
+
}
|
|
317
|
+
view.phase = 'working';
|
|
318
|
+
view.workedMs = now - dayStart.getTime();
|
|
319
|
+
view.progress = view.workedMs / totalMs;
|
|
320
|
+
view.earned = wage * view.progress;
|
|
321
|
+
view.msToEnd = dayEnd.getTime() - now;
|
|
322
|
+
return view;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// ── open the settings section from the dock ─────────────────────────────
|
|
326
|
+
/**
|
|
327
|
+
* The settings shell publishes its open-section action on the
|
|
328
|
+
* `sidebar.settings` slot registration's store. Reaching it is optional:
|
|
329
|
+
* when the shell is absent the dock simply shows no button.
|
|
330
|
+
*/
|
|
331
|
+
function settingsActions(ctx) {
|
|
332
|
+
try {
|
|
333
|
+
const slots = ctx && ctx.slots;
|
|
334
|
+
if (!slots || typeof slots.entries !== 'function') return undefined;
|
|
335
|
+
const entries = slots.entries('sidebar.settings') || [];
|
|
336
|
+
for (let index = 0; index < entries.length; index += 1) {
|
|
337
|
+
const entry = entries[index];
|
|
338
|
+
const handle = entry && (entry.store || (entry.options && entry.options.store));
|
|
339
|
+
if (!handle || typeof handle.create !== 'function') continue;
|
|
340
|
+
const shell = handle.create();
|
|
341
|
+
if (shell && shell.actions && typeof shell.actions.openSection === 'function') return shell.actions;
|
|
342
|
+
}
|
|
343
|
+
} catch (error) {
|
|
344
|
+
/* no settings shell in this composition */
|
|
345
|
+
}
|
|
346
|
+
return undefined;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// ── shared visual pieces ────────────────────────────────────────────────
|
|
350
|
+
const labelPrimary = 'var(--dsw-alias-label-primary)';
|
|
351
|
+
const labelSecondary = 'var(--dsw-alias-label-secondary)';
|
|
352
|
+
const labelTertiary = 'var(--dsw-alias-label-tertiary)';
|
|
353
|
+
|
|
354
|
+
function GearIcon() {
|
|
355
|
+
return h(
|
|
356
|
+
'svg',
|
|
357
|
+
{
|
|
358
|
+
width: 15,
|
|
359
|
+
height: 15,
|
|
360
|
+
viewBox: '0 0 24 24',
|
|
361
|
+
fill: 'none',
|
|
362
|
+
'aria-hidden': true,
|
|
363
|
+
style: { display: 'block' },
|
|
364
|
+
},
|
|
365
|
+
h('path', {
|
|
366
|
+
d: 'M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z',
|
|
367
|
+
stroke: 'currentColor',
|
|
368
|
+
strokeWidth: 1.7,
|
|
369
|
+
}),
|
|
370
|
+
h('path', {
|
|
371
|
+
d: 'M19.4 13.5a7.6 7.6 0 0 0 0-3l1.7-1.3-1.8-3.1-2 .8a7.6 7.6 0 0 0-2.6-1.5L14.4 3h-3.6l-.3 2.4a7.6 7.6 0 0 0-2.6 1.5l-2-.8L4.1 9.2l1.7 1.3a7.6 7.6 0 0 0 0 3l-1.7 1.3 1.8 3.1 2-.8a7.6 7.6 0 0 0 2.6 1.5l.3 2.4h3.6l.3-2.4a7.6 7.6 0 0 0 2.6-1.5l2 .8 1.8-3.1-1.7-1.3Z',
|
|
372
|
+
stroke: 'currentColor',
|
|
373
|
+
strokeWidth: 1.5,
|
|
374
|
+
strokeLinejoin: 'round',
|
|
375
|
+
}),
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function CurrencyBadge(props) {
|
|
380
|
+
return h(
|
|
381
|
+
'span',
|
|
382
|
+
{
|
|
383
|
+
'aria-hidden': true,
|
|
384
|
+
style: {
|
|
385
|
+
display: 'grid',
|
|
386
|
+
placeItems: 'center',
|
|
387
|
+
flex: 'none',
|
|
388
|
+
width: 22,
|
|
389
|
+
height: 22,
|
|
390
|
+
borderRadius: 999,
|
|
391
|
+
background: 'var(--dsw-alias-brand-primary-soft)',
|
|
392
|
+
color: 'var(--dsw-alias-brand-primary)',
|
|
393
|
+
fontSize: 11,
|
|
394
|
+
fontWeight: 650,
|
|
395
|
+
lineHeight: 1,
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
props.text,
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// ── the dock above the composer ─────────────────────────────────────────
|
|
403
|
+
function EarningsDock(props) {
|
|
404
|
+
const t = makeT(props.ctx, props.t);
|
|
405
|
+
const settings = useSettings();
|
|
406
|
+
const now = useNow(true);
|
|
407
|
+
const view = computeView(settings, now);
|
|
408
|
+
const actions = useMemo(function () {
|
|
409
|
+
return settingsActions(props.ctx);
|
|
410
|
+
}, [props.ctx]);
|
|
411
|
+
|
|
412
|
+
const openSettings = actions
|
|
413
|
+
? function () {
|
|
414
|
+
try {
|
|
415
|
+
actions.openSection(SECTION_ID);
|
|
416
|
+
} catch (error) {
|
|
417
|
+
/* the shell no longer accepts the action */
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
: null;
|
|
421
|
+
|
|
422
|
+
const settingsButton = openSettings
|
|
423
|
+
? h(
|
|
424
|
+
'button',
|
|
425
|
+
{
|
|
426
|
+
type: 'button',
|
|
427
|
+
className: 'ec-icon-button',
|
|
428
|
+
title: t('dock.openSettingsTitle'),
|
|
429
|
+
'aria-label': t('dock.openSettingsTitle'),
|
|
430
|
+
onClick: openSettings,
|
|
431
|
+
},
|
|
432
|
+
h(GearIcon, null),
|
|
433
|
+
)
|
|
434
|
+
: null;
|
|
435
|
+
|
|
436
|
+
const perDay = formatMoney(view.currency, view.wage);
|
|
437
|
+
|
|
438
|
+
if (!view.configured) {
|
|
439
|
+
return h(
|
|
440
|
+
'section',
|
|
441
|
+
{
|
|
442
|
+
className: 'ec-dock',
|
|
443
|
+
'aria-label': t('dock.aria'),
|
|
444
|
+
style: { justifyContent: 'space-between' },
|
|
445
|
+
},
|
|
446
|
+
h(
|
|
447
|
+
'div',
|
|
448
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 10, minWidth: 0, flex: '1 1 auto' } },
|
|
449
|
+
h(CurrencyBadge, { text: settings.currency || DEFAULTS.currency }),
|
|
450
|
+
h(
|
|
451
|
+
'span',
|
|
452
|
+
{
|
|
453
|
+
style: {
|
|
454
|
+
fontSize: 13,
|
|
455
|
+
lineHeight: '18px',
|
|
456
|
+
color: labelSecondary,
|
|
457
|
+
overflow: 'hidden',
|
|
458
|
+
textOverflow: 'ellipsis',
|
|
459
|
+
whiteSpace: 'nowrap',
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
t('dock.unsetTitle'),
|
|
463
|
+
),
|
|
464
|
+
),
|
|
465
|
+
h(
|
|
466
|
+
'div',
|
|
467
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 6, flex: 'none' } },
|
|
468
|
+
openSettings
|
|
469
|
+
? h(
|
|
470
|
+
'button',
|
|
471
|
+
{ type: 'button', className: 'ec-button', onClick: openSettings },
|
|
472
|
+
t('dock.openSettings'),
|
|
473
|
+
)
|
|
474
|
+
: null,
|
|
475
|
+
settingsButton,
|
|
476
|
+
),
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if (view.phase === 'rest') {
|
|
481
|
+
return h(
|
|
482
|
+
'section',
|
|
483
|
+
{
|
|
484
|
+
className: 'ec-dock',
|
|
485
|
+
'aria-label': t('dock.aria'),
|
|
486
|
+
style: { justifyContent: 'space-between' },
|
|
487
|
+
},
|
|
488
|
+
h(
|
|
489
|
+
'div',
|
|
490
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 10, minWidth: 0, flex: '1 1 auto' } },
|
|
491
|
+
h(CurrencyBadge, { text: view.currency }),
|
|
492
|
+
h('span', { style: { fontSize: 13, fontWeight: 550, color: labelPrimary } }, t('dock.restTitle')),
|
|
493
|
+
h(
|
|
494
|
+
'span',
|
|
495
|
+
{
|
|
496
|
+
style: {
|
|
497
|
+
fontSize: 12,
|
|
498
|
+
color: labelTertiary,
|
|
499
|
+
overflow: 'hidden',
|
|
500
|
+
textOverflow: 'ellipsis',
|
|
501
|
+
whiteSpace: 'nowrap',
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
t('dock.restCaption'),
|
|
505
|
+
),
|
|
506
|
+
),
|
|
507
|
+
settingsButton,
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
const percent = Math.round(view.progress * 100);
|
|
512
|
+
let statusText = t('dock.done');
|
|
513
|
+
let statusColor = 'var(--dsw-alias-state-success-primary)';
|
|
514
|
+
let sideCaption = t('dock.worked', { time: formatClock(view.workedMs) });
|
|
515
|
+
if (view.phase === 'before') {
|
|
516
|
+
statusText = t('dock.notStarted');
|
|
517
|
+
statusColor = labelTertiary;
|
|
518
|
+
sideCaption = t('dock.before', { time: formatClock(view.msToStart) });
|
|
519
|
+
} else if (view.phase === 'working') {
|
|
520
|
+
statusText = t('dock.remaining', { time: formatClock(view.msToEnd) });
|
|
521
|
+
statusColor = labelSecondary;
|
|
522
|
+
} else if (view.overtimeMs >= 60000) {
|
|
523
|
+
statusText = t('dock.overtime', { time: formatClock(view.overtimeMs) });
|
|
524
|
+
statusColor = 'var(--dsw-alias-state-warn-primary)';
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
return h(
|
|
528
|
+
'section',
|
|
529
|
+
{
|
|
530
|
+
className: 'ec-dock',
|
|
531
|
+
'aria-label': t('dock.aria'),
|
|
532
|
+
title: t('dock.tooltip', { start: settings.start, end: settings.end, wage: perDay }),
|
|
533
|
+
},
|
|
534
|
+
h(
|
|
535
|
+
'div',
|
|
536
|
+
{ style: { display: 'flex', alignItems: 'baseline', gap: 8, flex: 'none' } },
|
|
537
|
+
h(
|
|
538
|
+
'span',
|
|
539
|
+
{
|
|
540
|
+
style: {
|
|
541
|
+
fontSize: 17,
|
|
542
|
+
fontWeight: 650,
|
|
543
|
+
lineHeight: '22px',
|
|
544
|
+
letterSpacing: '0.01em',
|
|
545
|
+
color: labelPrimary,
|
|
546
|
+
fontVariantNumeric: 'tabular-nums',
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
formatMoney(view.currency, view.earned),
|
|
550
|
+
),
|
|
551
|
+
h(
|
|
552
|
+
'span',
|
|
553
|
+
{ style: { fontSize: 11, color: labelTertiary, whiteSpace: 'nowrap' } },
|
|
554
|
+
t('dock.perDay', { amount: perDay }),
|
|
555
|
+
),
|
|
556
|
+
),
|
|
557
|
+
h(
|
|
558
|
+
'div',
|
|
559
|
+
{
|
|
560
|
+
style: {
|
|
561
|
+
flex: '1 1 150px',
|
|
562
|
+
minWidth: 110,
|
|
563
|
+
display: 'flex',
|
|
564
|
+
flexDirection: 'column',
|
|
565
|
+
gap: 5,
|
|
566
|
+
},
|
|
567
|
+
},
|
|
568
|
+
h(
|
|
569
|
+
'div',
|
|
570
|
+
{
|
|
571
|
+
style: {
|
|
572
|
+
position: 'relative',
|
|
573
|
+
height: 5,
|
|
574
|
+
borderRadius: 999,
|
|
575
|
+
background: 'var(--dsw-alias-bg-layer-3)',
|
|
576
|
+
overflow: 'hidden',
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
h('div', {
|
|
580
|
+
className: 'ec-fill',
|
|
581
|
+
style: {
|
|
582
|
+
position: 'absolute',
|
|
583
|
+
top: 0,
|
|
584
|
+
bottom: 0,
|
|
585
|
+
left: 0,
|
|
586
|
+
width: percent + '%',
|
|
587
|
+
borderRadius: 999,
|
|
588
|
+
background: 'var(--dsw-alias-brand-primary)',
|
|
589
|
+
},
|
|
590
|
+
}),
|
|
591
|
+
),
|
|
592
|
+
h(
|
|
593
|
+
'div',
|
|
594
|
+
{
|
|
595
|
+
style: {
|
|
596
|
+
display: 'flex',
|
|
597
|
+
justifyContent: 'space-between',
|
|
598
|
+
gap: 10,
|
|
599
|
+
fontSize: 11,
|
|
600
|
+
lineHeight: '14px',
|
|
601
|
+
color: labelTertiary,
|
|
602
|
+
fontVariantNumeric: 'tabular-nums',
|
|
603
|
+
},
|
|
604
|
+
},
|
|
605
|
+
h('span', { style: { whiteSpace: 'nowrap' } }, sideCaption),
|
|
606
|
+
h('span', { style: { whiteSpace: 'nowrap' } }, percent + '%'),
|
|
607
|
+
),
|
|
608
|
+
),
|
|
609
|
+
h(
|
|
610
|
+
'div',
|
|
611
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 6, marginLeft: 'auto', flex: 'none' } },
|
|
612
|
+
h(
|
|
613
|
+
'span',
|
|
614
|
+
{
|
|
615
|
+
style: {
|
|
616
|
+
fontSize: 12,
|
|
617
|
+
lineHeight: '18px',
|
|
618
|
+
color: statusColor,
|
|
619
|
+
whiteSpace: 'nowrap',
|
|
620
|
+
fontVariantNumeric: 'tabular-nums',
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
statusText,
|
|
624
|
+
),
|
|
625
|
+
settingsButton,
|
|
626
|
+
),
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// ── settings section ────────────────────────────────────────────────────
|
|
631
|
+
const inputClassName = 'ec-input';
|
|
632
|
+
|
|
633
|
+
function Field(props) {
|
|
634
|
+
return h(
|
|
635
|
+
'label',
|
|
636
|
+
{ style: { display: 'flex', flexDirection: 'column', gap: 6, minWidth: 0 } },
|
|
637
|
+
h('span', { style: { fontSize: 12, lineHeight: '16px', color: labelSecondary } }, props.label),
|
|
638
|
+
props.children,
|
|
639
|
+
props.hint ? h('span', { style: { fontSize: 11, lineHeight: '15px', color: labelTertiary } }, props.hint) : null,
|
|
640
|
+
props.error ? h('span', { style: { fontSize: 11, lineHeight: '15px', color: 'var(--dsw-alias-state-error-primary)' } }, props.error) : null,
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
function EarningsSettings(props) {
|
|
645
|
+
const t = makeT(props.ctx, props.t);
|
|
646
|
+
const settings = useSettings();
|
|
647
|
+
const now = useNow(true);
|
|
648
|
+
const view = computeView(settings, now);
|
|
649
|
+
|
|
650
|
+
const [draft, setDraft] = useState(function () {
|
|
651
|
+
return {
|
|
652
|
+
start: settings.start,
|
|
653
|
+
end: settings.end,
|
|
654
|
+
wage: settings.wage > 0 ? String(settings.wage) : '',
|
|
655
|
+
currency: settings.currency,
|
|
656
|
+
};
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
function updateDraft(patch) {
|
|
660
|
+
setDraft(function (previous) {
|
|
661
|
+
return Object.assign({}, previous, patch);
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
function onTimeChange(key) {
|
|
666
|
+
return function (event) {
|
|
667
|
+
const value = event.target.value;
|
|
668
|
+
updateDraft({ [key]: value });
|
|
669
|
+
if (parseTime(value) !== null) writeSettings({ [key]: value });
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
function onTimeBlur(key) {
|
|
674
|
+
return function () {
|
|
675
|
+
if (parseTime(draft[key]) !== null) return;
|
|
676
|
+
const fallback = key === 'start' ? DEFAULTS.start : DEFAULTS.end;
|
|
677
|
+
updateDraft({ [key]: fallback });
|
|
678
|
+
writeSettings({ [key]: fallback });
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function onWageBlur() {
|
|
683
|
+
const raw = draft.wage.replace(/[,\s]/g, '');
|
|
684
|
+
if (raw === '') {
|
|
685
|
+
writeSettings({ wage: 0 });
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
const value = Number(raw);
|
|
689
|
+
if (Number.isFinite(value) && value >= 0) {
|
|
690
|
+
writeSettings({ wage: value });
|
|
691
|
+
updateDraft({ wage: String(value) });
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
function onCurrencyBlur() {
|
|
696
|
+
const value = draft.currency.trim() || DEFAULTS.currency;
|
|
697
|
+
updateDraft({ currency: value });
|
|
698
|
+
writeSettings({ currency: value });
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function reset() {
|
|
702
|
+
setDraft({
|
|
703
|
+
start: DEFAULTS.start,
|
|
704
|
+
end: DEFAULTS.end,
|
|
705
|
+
wage: '',
|
|
706
|
+
currency: DEFAULTS.currency,
|
|
707
|
+
});
|
|
708
|
+
writeSettings({
|
|
709
|
+
start: DEFAULTS.start,
|
|
710
|
+
end: DEFAULTS.end,
|
|
711
|
+
wage: 0,
|
|
712
|
+
currency: DEFAULTS.currency,
|
|
713
|
+
weekdaysOnly: true,
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
const startMin = parseTime(draft.start);
|
|
718
|
+
const endMin = parseTime(draft.end);
|
|
719
|
+
const rangeError = startMin === null || endMin === null || endMin <= startMin
|
|
720
|
+
? t('settings.invalidRange')
|
|
721
|
+
: '';
|
|
722
|
+
|
|
723
|
+
const rawWage = draft.wage.replace(/[,\s]/g, '');
|
|
724
|
+
const wageNumber = Number(rawWage);
|
|
725
|
+
const wageError = rawWage !== '' && (!Number.isFinite(wageNumber) || wageNumber <= 0)
|
|
726
|
+
? t('settings.invalidWage')
|
|
727
|
+
: '';
|
|
728
|
+
|
|
729
|
+
const perDay = formatMoney(view.currency, view.wage);
|
|
730
|
+
let previewText = t('settings.previewUnset');
|
|
731
|
+
if (view.configured) {
|
|
732
|
+
if (view.phase === 'rest') previewText = t('settings.previewRest');
|
|
733
|
+
else if (view.phase === 'before') previewText = t('dock.before', { time: formatClock(view.msToStart) });
|
|
734
|
+
else if (view.phase === 'working') previewText = t('settings.previewLine', { percent: Math.round(view.progress * 100) });
|
|
735
|
+
else previewText = t('dock.done');
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
return h(
|
|
739
|
+
'div',
|
|
740
|
+
{
|
|
741
|
+
style: {
|
|
742
|
+
maxWidth: 760,
|
|
743
|
+
display: 'flex',
|
|
744
|
+
flexDirection: 'column',
|
|
745
|
+
gap: 16,
|
|
746
|
+
color: labelPrimary,
|
|
747
|
+
},
|
|
748
|
+
},
|
|
749
|
+
h('h2', { style: { margin: 0, fontSize: 18, lineHeight: '26px', fontWeight: 600 } }, t('settings.title')),
|
|
750
|
+
h('p', { style: { margin: 0, fontSize: 13, lineHeight: '20px', color: labelTertiary } }, t('settings.intro')),
|
|
751
|
+
h(
|
|
752
|
+
'div',
|
|
753
|
+
{
|
|
754
|
+
style: {
|
|
755
|
+
display: 'flex',
|
|
756
|
+
flexDirection: 'column',
|
|
757
|
+
gap: 16,
|
|
758
|
+
padding: 16,
|
|
759
|
+
borderRadius: 12,
|
|
760
|
+
border: '1px solid var(--dsw-alias-border-l1)',
|
|
761
|
+
background: 'var(--dsw-alias-bg-layer-1)',
|
|
762
|
+
},
|
|
763
|
+
},
|
|
764
|
+
h(
|
|
765
|
+
'div',
|
|
766
|
+
{ style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(190px, 1fr))', gap: 14 } },
|
|
767
|
+
h(
|
|
768
|
+
Field,
|
|
769
|
+
{ label: t('settings.start'), hint: t('settings.timeHint') },
|
|
770
|
+
h('input', {
|
|
771
|
+
className: inputClassName,
|
|
772
|
+
type: 'text',
|
|
773
|
+
inputMode: 'numeric',
|
|
774
|
+
autoComplete: 'off',
|
|
775
|
+
spellCheck: false,
|
|
776
|
+
maxLength: 5,
|
|
777
|
+
placeholder: '09:00',
|
|
778
|
+
value: draft.start,
|
|
779
|
+
onChange: onTimeChange('start'),
|
|
780
|
+
onBlur: onTimeBlur('start'),
|
|
781
|
+
}),
|
|
782
|
+
),
|
|
783
|
+
h(
|
|
784
|
+
Field,
|
|
785
|
+
{ label: t('settings.end'), hint: t('settings.timeHint') },
|
|
786
|
+
h('input', {
|
|
787
|
+
className: inputClassName,
|
|
788
|
+
type: 'text',
|
|
789
|
+
inputMode: 'numeric',
|
|
790
|
+
autoComplete: 'off',
|
|
791
|
+
spellCheck: false,
|
|
792
|
+
maxLength: 5,
|
|
793
|
+
placeholder: '18:00',
|
|
794
|
+
value: draft.end,
|
|
795
|
+
onChange: onTimeChange('end'),
|
|
796
|
+
onBlur: onTimeBlur('end'),
|
|
797
|
+
}),
|
|
798
|
+
),
|
|
799
|
+
h(
|
|
800
|
+
Field,
|
|
801
|
+
{ label: t('settings.wage'), hint: t('settings.wageHint'), error: wageError },
|
|
802
|
+
h('input', {
|
|
803
|
+
className: inputClassName,
|
|
804
|
+
type: 'text',
|
|
805
|
+
inputMode: 'decimal',
|
|
806
|
+
autoComplete: 'off',
|
|
807
|
+
spellCheck: false,
|
|
808
|
+
maxLength: 14,
|
|
809
|
+
placeholder: '800',
|
|
810
|
+
value: draft.wage,
|
|
811
|
+
onChange: function (event) {
|
|
812
|
+
updateDraft({ wage: event.target.value });
|
|
813
|
+
},
|
|
814
|
+
onBlur: onWageBlur,
|
|
815
|
+
}),
|
|
816
|
+
),
|
|
817
|
+
h(
|
|
818
|
+
Field,
|
|
819
|
+
{ label: t('settings.currency'), hint: t('settings.currencyHint') },
|
|
820
|
+
h('input', {
|
|
821
|
+
className: inputClassName,
|
|
822
|
+
type: 'text',
|
|
823
|
+
autoComplete: 'off',
|
|
824
|
+
spellCheck: false,
|
|
825
|
+
maxLength: 4,
|
|
826
|
+
placeholder: '¥',
|
|
827
|
+
value: draft.currency,
|
|
828
|
+
onChange: function (event) {
|
|
829
|
+
updateDraft({ currency: event.target.value });
|
|
830
|
+
},
|
|
831
|
+
onBlur: onCurrencyBlur,
|
|
832
|
+
}),
|
|
833
|
+
),
|
|
834
|
+
),
|
|
835
|
+
rangeError
|
|
836
|
+
? h('span', { style: { fontSize: 12, lineHeight: '16px', color: 'var(--dsw-alias-state-error-primary)' } }, rangeError)
|
|
837
|
+
: null,
|
|
838
|
+
h(
|
|
839
|
+
'div',
|
|
840
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 12 } },
|
|
841
|
+
h(
|
|
842
|
+
'div',
|
|
843
|
+
{ style: { display: 'flex', flexDirection: 'column', gap: 3, flex: '1 1 auto' } },
|
|
844
|
+
h('span', { style: { fontSize: 13, lineHeight: '18px', color: labelPrimary } }, t('settings.weekdaysOnly')),
|
|
845
|
+
h('span', { style: { fontSize: 11, lineHeight: '15px', color: labelTertiary } }, t('settings.weekdaysOnlyHint')),
|
|
846
|
+
),
|
|
847
|
+
h(
|
|
848
|
+
'button',
|
|
849
|
+
{
|
|
850
|
+
type: 'button',
|
|
851
|
+
role: 'switch',
|
|
852
|
+
className: 'ec-switch',
|
|
853
|
+
'aria-checked': settings.weekdaysOnly ? 'true' : 'false',
|
|
854
|
+
'aria-label': t('settings.weekdaysOnly'),
|
|
855
|
+
'data-on': settings.weekdaysOnly ? 'true' : 'false',
|
|
856
|
+
onClick: function () {
|
|
857
|
+
writeSettings({ weekdaysOnly: !settings.weekdaysOnly });
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
h('span', { className: 'ec-switch-knob' }),
|
|
861
|
+
),
|
|
862
|
+
),
|
|
863
|
+
),
|
|
864
|
+
h(
|
|
865
|
+
'div',
|
|
866
|
+
{
|
|
867
|
+
style: {
|
|
868
|
+
display: 'flex',
|
|
869
|
+
flexDirection: 'column',
|
|
870
|
+
gap: 6,
|
|
871
|
+
padding: '12px 16px',
|
|
872
|
+
borderRadius: 12,
|
|
873
|
+
border: '1px solid var(--dsw-alias-border-l1)',
|
|
874
|
+
background: 'var(--dsw-alias-bg-layer-2)',
|
|
875
|
+
},
|
|
876
|
+
},
|
|
877
|
+
h('span', { style: { fontSize: 11, lineHeight: '15px', color: labelTertiary } }, t('settings.preview')),
|
|
878
|
+
h(
|
|
879
|
+
'div',
|
|
880
|
+
{ style: { display: 'flex', alignItems: 'baseline', gap: 10, flexWrap: 'wrap' } },
|
|
881
|
+
h(
|
|
882
|
+
'span',
|
|
883
|
+
{
|
|
884
|
+
style: {
|
|
885
|
+
fontSize: 22,
|
|
886
|
+
lineHeight: '28px',
|
|
887
|
+
fontWeight: 650,
|
|
888
|
+
fontVariantNumeric: 'tabular-nums',
|
|
889
|
+
},
|
|
890
|
+
},
|
|
891
|
+
view.configured ? formatMoney(view.currency, view.earned) : '—',
|
|
892
|
+
),
|
|
893
|
+
view.configured
|
|
894
|
+
? h('span', { style: { fontSize: 12, color: labelTertiary } }, t('dock.perDay', { amount: perDay }))
|
|
895
|
+
: null,
|
|
896
|
+
),
|
|
897
|
+
h('span', { style: { fontSize: 12, lineHeight: '16px', color: labelSecondary } }, previewText),
|
|
898
|
+
),
|
|
899
|
+
h(
|
|
900
|
+
'div',
|
|
901
|
+
{ style: { display: 'flex', alignItems: 'center', gap: 10, justifyContent: 'space-between', flexWrap: 'wrap' } },
|
|
902
|
+
h(
|
|
903
|
+
'button',
|
|
904
|
+
{ type: 'button', className: 'ec-ghost-button', onClick: reset },
|
|
905
|
+
t('settings.reset'),
|
|
906
|
+
),
|
|
907
|
+
h('span', { style: { fontSize: 11, color: labelTertiary } }, t('settings.autosave')),
|
|
908
|
+
),
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// ── nav icon ────────────────────────────────────────────────────────────
|
|
913
|
+
function NavIcon(props) {
|
|
914
|
+
const size = props && typeof props.size === 'number' ? props.size : 16;
|
|
915
|
+
return h(
|
|
916
|
+
'svg',
|
|
917
|
+
{
|
|
918
|
+
width: size,
|
|
919
|
+
height: size,
|
|
920
|
+
viewBox: '0 0 24 24',
|
|
921
|
+
fill: 'none',
|
|
922
|
+
'aria-hidden': true,
|
|
923
|
+
style: { display: 'block' },
|
|
924
|
+
},
|
|
925
|
+
h('circle', { cx: 12, cy: 12, r: 8.6, stroke: 'currentColor', strokeWidth: 1.8 }),
|
|
926
|
+
h('path', {
|
|
927
|
+
d: 'M12 7.4V12l3.1 1.9',
|
|
928
|
+
stroke: 'currentColor',
|
|
929
|
+
strokeWidth: 1.8,
|
|
930
|
+
strokeLinecap: 'round',
|
|
931
|
+
strokeLinejoin: 'round',
|
|
932
|
+
}),
|
|
933
|
+
h('path', {
|
|
934
|
+
d: 'M16.6 4.5a8.6 8.6 0 0 1 2.9 3.1',
|
|
935
|
+
stroke: 'currentColor',
|
|
936
|
+
strokeWidth: 1.8,
|
|
937
|
+
strokeLinecap: 'round',
|
|
938
|
+
}),
|
|
939
|
+
);
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// ── stylesheet (focus + hover + reduced motion; colors stay on tokens) ──
|
|
943
|
+
const CSS = [
|
|
944
|
+
'.ec-dock{box-sizing:border-box;flex:none;margin:0 auto;',
|
|
945
|
+
'width:calc(100% - var(--dsh-composer-side-clearance,0px) - var(--dsh-composer-side-clearance,0px)',
|
|
946
|
+
' - var(--dsh-composer-dock-inset,0px) - var(--dsh-composer-dock-inset,0px)',
|
|
947
|
+
' - var(--dsh-composer-dock-inset,0px) - var(--dsh-composer-dock-inset,0px));',
|
|
948
|
+
'max-width:calc(var(--dsh-composer-card-max-width,1000px)',
|
|
949
|
+
' - var(--dsh-composer-dock-inset,0px) - var(--dsh-composer-dock-inset,0px)',
|
|
950
|
+
' - var(--dsh-composer-dock-inset,0px) - var(--dsh-composer-dock-inset,0px));',
|
|
951
|
+
'display:flex;align-items:center;gap:12px;flex-wrap:wrap;',
|
|
952
|
+
'padding:8px 12px;border-radius:var(--dsw-radius-lg);',
|
|
953
|
+
'background:var(--dsw-specific-menu);',
|
|
954
|
+
'backdrop-filter:var(--dsw-menu-backdrop-filter);',
|
|
955
|
+
'box-shadow:var(--dsw-elevation-panel);',
|
|
956
|
+
'color:var(--dsw-alias-label-primary)}',
|
|
957
|
+
'.ec-fill{transition:width 1s linear}',
|
|
958
|
+
'.ec-input{box-sizing:border-box;width:100%;height:36px;padding:0 10px;',
|
|
959
|
+
'border-radius:8px;border:1px solid var(--dsw-alias-border-l2);',
|
|
960
|
+
'background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);',
|
|
961
|
+
'font:inherit;font-size:13px;font-variant-numeric:tabular-nums;outline:none;',
|
|
962
|
+
'transition:border-color .15s ease,box-shadow .15s ease}',
|
|
963
|
+
'.ec-input::placeholder{color:var(--dsw-alias-label-tertiary)}',
|
|
964
|
+
'.ec-input:hover{border-color:var(--dsw-alias-border-l3)}',
|
|
965
|
+
'.ec-input:focus{border-color:var(--dsw-alias-brand-primary);',
|
|
966
|
+
'box-shadow:0 0 0 3px var(--dsw-alias-brand-primary-soft)}',
|
|
967
|
+
'.ec-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;',
|
|
968
|
+
'height:26px;padding:0 10px;border-radius:8px;cursor:pointer;white-space:nowrap;',
|
|
969
|
+
'border:1px solid var(--dsw-alias-border-l2);',
|
|
970
|
+
'background:var(--dsw-alias-button-elevated-fill);color:var(--dsw-alias-label-primary);',
|
|
971
|
+
'font:inherit;font-size:12px;line-height:1;transition:background .15s ease}',
|
|
972
|
+
'.ec-button:hover{background:var(--dsw-alias-interactive-bg-hover)}',
|
|
973
|
+
'.ec-icon-button{display:inline-grid;place-items:center;width:24px;height:24px;padding:0;',
|
|
974
|
+
'border:none;border-radius:6px;cursor:pointer;background:transparent;',
|
|
975
|
+
'color:var(--dsw-alias-label-tertiary);transition:background .15s ease,color .15s ease}',
|
|
976
|
+
'.ec-icon-button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}',
|
|
977
|
+
'.ec-ghost-button{height:26px;padding:0 8px;border:none;border-radius:8px;cursor:pointer;',
|
|
978
|
+
'background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:12px;',
|
|
979
|
+
'transition:background .15s ease,color .15s ease}',
|
|
980
|
+
'.ec-ghost-button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}',
|
|
981
|
+
'.ec-switch{position:relative;flex:none;width:36px;height:20px;padding:0;border:none;',
|
|
982
|
+
'border-radius:999px;cursor:pointer;background:var(--dsw-alias-bg-layer-3);',
|
|
983
|
+
'transition:background .15s ease}',
|
|
984
|
+
'.ec-switch[data-on="true"]{background:var(--dsw-alias-brand-primary)}',
|
|
985
|
+
'.ec-switch-knob{position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:999px;',
|
|
986
|
+
'background:var(--dsw-alias-label-primary-foreground);transition:transform .15s ease;display:block}',
|
|
987
|
+
'.ec-switch[data-on="true"] .ec-switch-knob{transform:translateX(16px)}',
|
|
988
|
+
'.ec-button:focus-visible,.ec-icon-button:focus-visible,.ec-ghost-button:focus-visible,',
|
|
989
|
+
'.ec-switch:focus-visible{outline:none;box-shadow:0 0 0 3px var(--dsw-focus-ring-color)}',
|
|
990
|
+
'@media (prefers-reduced-motion: reduce){.ec-fill,.ec-input,.ec-button,.ec-icon-button,',
|
|
991
|
+
'.ec-ghost-button,.ec-switch,.ec-switch-knob{transition:none}}',
|
|
992
|
+
].join('');
|
|
993
|
+
|
|
994
|
+
function injectStyle() {
|
|
995
|
+
try {
|
|
996
|
+
if (document.querySelector('style[data-plugin-css="dsh-earnings-clock"]')) return;
|
|
997
|
+
const style = document.createElement('style');
|
|
998
|
+
style.dataset.plugin = 'dsh-earnings-clock';
|
|
999
|
+
style.dataset.pluginCss = 'dsh-earnings-clock';
|
|
1000
|
+
style.textContent = CSS;
|
|
1001
|
+
document.head.appendChild(style);
|
|
1002
|
+
} catch (error) {
|
|
1003
|
+
/* a missing document only means no CSS polish, not a broken dock */
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
// ── plugin body ─────────────────────────────────────────────────────────
|
|
1008
|
+
function apply(ctx) {
|
|
1009
|
+
try {
|
|
1010
|
+
if (ctx.effect) {
|
|
1011
|
+
ctx.effect(function () {
|
|
1012
|
+
return ctx.locale.register(NS, { zh: ZH, en: EN });
|
|
1013
|
+
}, 'dsh-earnings-clock: dictionaries');
|
|
1014
|
+
} else if (ctx.locale && typeof ctx.locale.register === 'function') {
|
|
1015
|
+
ctx.locale.register(NS, { zh: ZH, en: EN });
|
|
1016
|
+
}
|
|
1017
|
+
} catch (error) {
|
|
1018
|
+
/* the local fallback dictionary still renders usable text */
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
injectStyle();
|
|
1022
|
+
|
|
1023
|
+
ctx.slots.inject('conversation.input.dock', function () {
|
|
1024
|
+
return ctx.slots.register(
|
|
1025
|
+
{ name: 'conversation.input.dock', id: SECTION_ID, order: 30, locale: NS },
|
|
1026
|
+
function (props) {
|
|
1027
|
+
return h(EarningsDock, { t: props.t, ctx: ctx });
|
|
1028
|
+
},
|
|
1029
|
+
);
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
ctx.slots.inject('settings.section', function () {
|
|
1033
|
+
return ctx.slots.register(
|
|
1034
|
+
{
|
|
1035
|
+
name: 'settings.section',
|
|
1036
|
+
id: SECTION_ID,
|
|
1037
|
+
order: 25,
|
|
1038
|
+
label: function () {
|
|
1039
|
+
return makeT(ctx, undefined)('settings.nav');
|
|
1040
|
+
},
|
|
1041
|
+
locale: NS,
|
|
1042
|
+
},
|
|
1043
|
+
function (props) {
|
|
1044
|
+
return h(EarningsSettings, { t: props.t, ctx: ctx });
|
|
1045
|
+
},
|
|
1046
|
+
);
|
|
1047
|
+
});
|
|
1048
|
+
|
|
1049
|
+
ctx.slots.inject('settings.section.icon', function () {
|
|
1050
|
+
return ctx.slots.register(
|
|
1051
|
+
{
|
|
1052
|
+
name: 'settings.section.icon',
|
|
1053
|
+
id: SECTION_ID,
|
|
1054
|
+
order: 25,
|
|
1055
|
+
label: function () {
|
|
1056
|
+
return makeT(ctx, undefined)('settings.nav');
|
|
1057
|
+
},
|
|
1058
|
+
},
|
|
1059
|
+
NavIcon,
|
|
1060
|
+
);
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
return {
|
|
1065
|
+
inject: ['slots', 'locale'],
|
|
1066
|
+
apply: apply,
|
|
1067
|
+
// Pure helpers, exposed for the deterministic smoke test.
|
|
1068
|
+
__internals: {
|
|
1069
|
+
parseTime: parseTime,
|
|
1070
|
+
normalize: normalize,
|
|
1071
|
+
computeView: computeView,
|
|
1072
|
+
formatMoney: formatMoney,
|
|
1073
|
+
formatClock: formatClock,
|
|
1074
|
+
dictionaries: TEXT,
|
|
1075
|
+
},
|
|
1076
|
+
};
|
|
1077
|
+
},
|
|
1078
|
+
});
|
package/cordis.patch.yml
ADDED
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# 今天赚了多少钱 / Earnings Clock
|
|
2
|
+
|
|
3
|
+
输入框上方一条常驻的小面板:根据你在插件设置里预设的**上下班时间**与**每日工资**,实时计算今天到目前为止已经赚到的钱。
|
|
4
|
+
|
|
5
|
+
A small always-on panel above the composer. It converts your preset **work hours** and **daily wage** into a live "earned so far today" figure.
|
|
6
|
+
|
|
7
|
+
## 设置 / Settings
|
|
8
|
+
|
|
9
|
+
打开 **设置 → 今天赚了多少钱**,填写:
|
|
10
|
+
|
|
11
|
+
| 字段 | 说明 |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| 上班时间 | 24 小时制,例如 `09:00` |
|
|
14
|
+
| 下班时间 | 需晚于上班时间,例如 `18:00` |
|
|
15
|
+
| 每日工资 | 这一整个班次的工资,例如 `800` |
|
|
16
|
+
| 货币符号 | 显示在前面的符号,例如 `¥`、`$`、`€` |
|
|
17
|
+
| 只在工作日计算 | 打开后周六、周日显示为休息日,不计入工资 |
|
|
18
|
+
|
|
19
|
+
修改即时生效并自动保存(保存在浏览器本地),无需重启。
|
|
20
|
+
|
|
21
|
+
Open **Settings → Earnings Clock** and fill in the start time, end time, daily wage, currency symbol and the "weekdays only" switch. Changes apply immediately and are saved locally.
|
|
22
|
+
|
|
23
|
+
## 显示内容 / What the dock shows
|
|
24
|
+
|
|
25
|
+
- **今日已赚**:按上班时间到当前时刻占整个班次的比例计算,每秒刷新。
|
|
26
|
+
- **进度条与百分比**:今天的工作时长完成度。
|
|
27
|
+
- **状态**:`距上班` / `距下班` / `今日已完成` / `已下班 · 加班` / `今天休息`。
|
|
28
|
+
- 未配置时显示一条引导,点「去设置」直接打开本页。
|
|
29
|
+
|
|
30
|
+
## 深浅色与语言 / Theme & language
|
|
31
|
+
|
|
32
|
+
面板与设置页只使用主题 token(`--dsw-alias-*`),跟随浅色 / 深色主题;界面文案随 DSH 的语言切换(中文 / English)。
|
|
33
|
+
|
|
34
|
+
The panel and settings page use theme tokens only and follow the light/dark theme; all text follows the active DSH locale (Chinese / English).
|
package/icon.svg
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- dsh-earnings-clock: a coin with a clock hand inside a progress ring.
|
|
3
|
+
The coin is today's wage filling up, the ring is the workday progress. -->
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="ec-coin" x1="7" y1="8" x2="29" y2="30" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#7BE0B0"/>
|
|
7
|
+
<stop offset="1" stop-color="#0E9F6E"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="ec-ring" x1="4" y1="4" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop stop-color="#FFD36E"/>
|
|
11
|
+
<stop offset="1" stop-color="#F5A623"/>
|
|
12
|
+
</linearGradient>
|
|
13
|
+
</defs>
|
|
14
|
+
<circle cx="18" cy="18" r="7.2" stroke="url(#ec-coin)" stroke-width="2.1"/>
|
|
15
|
+
<path d="M18 14.4V18l2.5 1.6" stroke="url(#ec-coin)" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"/>
|
|
16
|
+
<path d="M18 5.6A12.4 12.4 0 0 1 30.4 18" stroke="url(#ec-ring)" stroke-width="2.1" stroke-linecap="round"/>
|
|
17
|
+
<path d="M18 30.4A12.4 12.4 0 0 1 5.6 18" stroke="url(#ec-ring)" stroke-width="2.1" stroke-linecap="round" opacity="0.4"/>
|
|
18
|
+
</svg>
|
package/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host half of the earnings-clock bundle.
|
|
3
|
+
*
|
|
4
|
+
* The plugin is fully client-side on purpose: the work hours / daily wage are
|
|
5
|
+
* a personal display preference, and the browser GUI already persists such
|
|
6
|
+
* preferences locally. Nothing on the Host needs to know them, so this half
|
|
7
|
+
* only makes the bundle loadable.
|
|
8
|
+
*/
|
|
9
|
+
export function apply() {}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-earnings-clock",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shows today's earnings so far above the composer, from preset work hours and a daily wage, in Chinese and English and following the active theme.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "kenLiaowj",
|
|
8
|
+
"homepage": "https://github.com/kenLiaowj/dsh-earnings-clock#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/kenLiaowj/dsh-earnings-clock.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/kenLiaowj/dsh-earnings-clock/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"dsh-plugin",
|
|
18
|
+
"dsh",
|
|
19
|
+
"deepseek-harness",
|
|
20
|
+
"deepseek",
|
|
21
|
+
"earnings",
|
|
22
|
+
"salary",
|
|
23
|
+
"composer",
|
|
24
|
+
"ui"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"dsh": ">=0.2.1"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": "./index.js",
|
|
31
|
+
"./client": "./client.js",
|
|
32
|
+
"./locale/*.json": "./locale/*.json",
|
|
33
|
+
"./icon": "./icon.svg"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"index.js",
|
|
37
|
+
"client.js",
|
|
38
|
+
"cordis.patch.yml",
|
|
39
|
+
"locale/*.json",
|
|
40
|
+
"docs",
|
|
41
|
+
"icon.svg"
|
|
42
|
+
],
|
|
43
|
+
"dsh": {
|
|
44
|
+
"bundle": {
|
|
45
|
+
"patch": "./cordis.patch.yml"
|
|
46
|
+
},
|
|
47
|
+
"client": {
|
|
48
|
+
"platform": "web",
|
|
49
|
+
"immediately": true,
|
|
50
|
+
"inject": [
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|