dsh-ds-balance 1.1.0 → 2.0.0-alpha.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/README.md +13 -7
- package/README_en.md +13 -7
- package/lib/client.js +37 -88
- package/lib/types/client/index.d.ts +3 -3
- package/lib/types/client/locales.d.ts +0 -3
- package/lib/types/client/settings/BalanceSettingsCard.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
> [!NOTE]
|
|
28
28
|
> **余额读自 DeepSeek 官方 `GET /user/balance`**,不是估算。凭据只经 DSH 的凭据通道解析:API Key 不会出现在设置文件里,也不会返回给界面。
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
余额要有地方看,但不该占地方。左边栏底部一个常驻的状态环,点开是三段金额与数据新鲜度;要改配置,进侧边栏**插件(Plugins)**页里本插件的详情页。
|
|
31
31
|
|
|
32
32
|
<p align="center">
|
|
33
33
|
<img src="assets/sidebar-popover.png" alt="左边栏底部的「DeepSeek 余额」条目与展开的余额浮层" width="360">
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
|---|---|---|
|
|
42
42
|
| 侧栏圆环 | 常驻左边栏底部的状态环 + 名称,**环里填了多少 = 余额离该币种预警线还有多远** | 扫一眼就知道还剩多少、离预警线多远 |
|
|
43
43
|
| 余额浮层 | 点条目展开:总额、赠送 / 充值拆分、数据新鲜度、手动刷新(带冷却) | 核对具体数字,以及数据是几分钟前的 |
|
|
44
|
-
| 设置卡片 | 连接 / 展示 / 阈值 /
|
|
44
|
+
| 设置卡片 | 连接 / 展示 / 阈值 / 刷新四组,默认四组全展开,各自可折叠 | 换端点、换币种、调预警线、调节奏 |
|
|
45
45
|
|
|
46
46
|
三种界面的分工是死的:**圆环回答「大概还剩多少」,浮层回答「具体是多少」,卡片回答「怎么算」。**
|
|
47
47
|
|
|
48
48
|
<p align="center">
|
|
49
|
-
<img src="assets/settings-card.png" alt="
|
|
49
|
+
<img src="assets/settings-card.png" alt="插件页里的「DeepSeek 余额」卡片" width="360">
|
|
50
50
|
<br>
|
|
51
|
-
<em
|
|
51
|
+
<em>卡片就是这四组:默认全展开,各自可折叠;组里有填错的项时那一组会自己展开。</em>
|
|
52
52
|
</p>
|
|
53
53
|
|
|
54
54
|
## 能力
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
- 余额按设定的周期自动刷新,界面读的是缓存 —— 开着界面不会反复去打上游接口。
|
|
58
58
|
- 浮层给出总额、赠送 / 充值拆分、数据是多久之前的,以及一个带冷却的手动刷新。
|
|
59
59
|
- 多币种:显示哪个币种由账户决定;设置里选的币种账户里没有时,浮层会说明并给一键改用。
|
|
60
|
-
-
|
|
60
|
+
- 设置卡片分四组、默认全展开、各自可折叠;组里有填错的项时,那一组会自己展开。
|
|
61
61
|
- 凭据默认继承官方模型页配好的那一份,不必重填;徽标只报「已配置密钥。/ 未配置密钥。」(官方卡片同款),
|
|
62
62
|
只读时不给编辑,并说明原因。
|
|
63
63
|
- 颜色只表达状态(正常 / 偏低 / 告急),与金额大小无关;读法与理由见「[圆环怎么读](#圆环怎么读)」。
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
npm install -g @deepseek-ai/dsh@alpha # 本插件承诺支持的线
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
兼容性不是推断出来的:每周由 [compat.yml](.github/workflows/compat.yml) 在 `alpha` 与 `next` 两条线上换包实跑一遍现有测试。当前结论与红了怎么办见 [兼容性](docs/PUBLISHING.md#兼容性)
|
|
78
|
+
兼容性不是推断出来的:每周由 [compat.yml](.github/workflows/compat.yml) 在 `alpha` 与 `next` 两条线上换包实跑一遍现有测试。当前结论与红了怎么办见 [兼容性](docs/PUBLISHING.md#兼容性)。配置界面注册在宿主的 `plugins.bundle.config` 槽,**该槽由 DSH 0.1.6 引入**(下限的真源是 [package.json](package.json) 的 `engines.dsh`,现查 `node scripts/compat-swap.mjs check`):更早的宿主上圆环与浮层照常工作,但**插件页里不会出现配置区**(静默,不报错)—— 这就是分水岭。
|
|
79
79
|
|
|
80
80
|
### 从 npm 安装
|
|
81
81
|
|
|
@@ -106,7 +106,13 @@ dsh plugin --profile web add "$PWD"
|
|
|
106
106
|
|
|
107
107
|
## 配置
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
打开侧边栏 **插件(Plugins)** →「已安装(Installed)」组,点进 **dsh-ds-balance** 的详情页;配置表单直接铺在那一页上,四组默认全展开、各自可折叠:
|
|
110
|
+
|
|
111
|
+
<p align="center">
|
|
112
|
+
<img src="assets/settings-cards-position.png" alt="Plugins 页列表里「DeepSeek 余额」的位置" width="480">
|
|
113
|
+
<br>
|
|
114
|
+
<em>Plugins 页列表里的位置:<code>dsh-ds-balance</code> 与其他已安装插件并排;点进它的详情页才是上面那张配置表单。</em>
|
|
115
|
+
</p>
|
|
110
116
|
|
|
111
117
|
- **连接**:API 地址与凭据,两项都默认留空 —— 地址留空即用 DeepSeek 官方端点,凭据继承官方模型页那一份、只读不可改;
|
|
112
118
|
二级「自定义设置」里只放凭据引用名。
|
package/README_en.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
> [!NOTE]
|
|
28
28
|
> **The balance is read from the official `GET /user/balance`** — not estimated. The credential is resolved only through DSH's credential channel: the API key never lands in a settings file and is never returned to the UI.
|
|
29
29
|
|
|
30
|
-
The balance needs somewhere to live that does not take up room. A permanent status ring at the bottom of the sidebar; click it for the three amounts and the freshness of the data. Anything you want to configure lives on the
|
|
30
|
+
The balance needs somewhere to live that does not take up room. A permanent status ring at the bottom of the sidebar; click it for the three amounts and the freshness of the data. Anything you want to configure lives on the plugin's details page under **Plugins → Installed**.
|
|
31
31
|
|
|
32
32
|
<p align="center">
|
|
33
33
|
<img src="assets/sidebar-popover_en.png" alt="The DeepSeek balance entry at the bottom of the sidebar, with its popover open" width="360">
|
|
@@ -41,14 +41,14 @@ The balance needs somewhere to live that does not take up room. A permanent stat
|
|
|
41
41
|
|---|---|---|
|
|
42
42
|
| Sidebar ring | A status ring plus label at the bottom of the sidebar; **how full it is = how far the balance is from that currency's warning line** | Seeing at a glance how much is left and how close it is to the warning line |
|
|
43
43
|
| Balance popover | Click the entry: total, granted / topped-up split, data freshness, manual refresh (with cooldown) | Checking the exact figures, and how many minutes old they are |
|
|
44
|
-
| Settings card | Connection / Display / Thresholds / Refresh,
|
|
44
|
+
| Settings card | Connection / Display / Thresholds / Refresh, all expanded by default, each collapsible | Changing the endpoint, the currency, the warning lines, the cadence |
|
|
45
45
|
|
|
46
46
|
The division of labour is fixed: **the ring answers "roughly how much is left", the popover answers "exactly how much", and the card answers "how is that computed".**
|
|
47
47
|
|
|
48
48
|
<p align="center">
|
|
49
|
-
<img src="assets/settings-card_en.png" alt="The DeepSeek balance card
|
|
49
|
+
<img src="assets/settings-card_en.png" alt="The DeepSeek balance card on the Plugins page" width="360">
|
|
50
50
|
<br>
|
|
51
|
-
<em>
|
|
51
|
+
<em>The card is those four groups: all expanded by default, each collapsible; a group holding a bad value opens itself.</em>
|
|
52
52
|
</p>
|
|
53
53
|
|
|
54
54
|
## Capabilities
|
|
@@ -57,7 +57,7 @@ The division of labour is fixed: **the ring answers "roughly how much is left",
|
|
|
57
57
|
- The balance refreshes on its own schedule and the UI reads a cache — leaving the interface open does not hammer the upstream.
|
|
58
58
|
- The popover shows the total, the granted / topped-up split, how old the data is, and a manual refresh with a cooldown.
|
|
59
59
|
- Multiple currencies: the account decides which currency is shown; when the one chosen in settings is absent, the popover explains and offers a one-click switch.
|
|
60
|
-
- The settings card has four
|
|
60
|
+
- The settings card has four groups, all expanded by default and each collapsible; a group holding a bad value opens itself.
|
|
61
61
|
- The credential is inherited from the official model settings by default, so there is nothing to re-enter; where it comes from is on a badge
|
|
62
62
|
(a key is configured / no key is configured, exactly the official card's wording), and a read-only field explains itself instead of offering an edit.
|
|
63
63
|
- Colour carries state only (normal / low / critical), never an amount; see "[Reading the ring](#reading-the-ring)".
|
|
@@ -75,7 +75,7 @@ Install the host by **naming the version line explicitly**: the `latest` tag of
|
|
|
75
75
|
npm install -g @deepseek-ai/dsh@alpha # the line this plugin promises to support
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Compatibility is measured, not inferred: every week [compat.yml](.github/workflows/compat.yml) swaps packages onto the `alpha` and `next` lines and reruns the existing tests. The current verdict, and what to do when it goes red, are in [Compatibility](docs/PUBLISHING.md#兼容性).
|
|
78
|
+
Compatibility is measured, not inferred: every week [compat.yml](.github/workflows/compat.yml) swaps packages onto the `alpha` and `next` lines and reruns the existing tests. The current verdict, and what to do when it goes red, are in [Compatibility](docs/PUBLISHING.md#兼容性). The configuration UI registers into the Host's `plugins.bundle.config` slot, which **arrives with DSH 0.1.6** (the floor's single source is `engines.dsh` in [package.json](package.json); check it live with `node scripts/compat-swap.mjs check`): on an earlier Host the ring and the popover keep working, but the configuration area never appears on the Plugins page (silently, with no error) — that is the watershed.
|
|
79
79
|
|
|
80
80
|
### From npm
|
|
81
81
|
|
|
@@ -106,7 +106,13 @@ The repository carries the GitHub topic [`dsh-plugin`](https://github.com/topics
|
|
|
106
106
|
|
|
107
107
|
## Configuration
|
|
108
108
|
|
|
109
|
-
Open **
|
|
109
|
+
Open **Plugins → Installed** and step into the **dsh-ds-balance** details page. The form runs straight down that page, four groups all expanded by default and each collapsible:
|
|
110
|
+
|
|
111
|
+
<p align="center">
|
|
112
|
+
<img src="assets/settings-cards-position_en.png" alt="Where the DeepSeek balance entry sits in the Plugins list" width="480">
|
|
113
|
+
<br>
|
|
114
|
+
<em>Where it sits: the Plugins page's list view, with <code>dsh-ds-balance</code> alongside the other installed plugins; the details page behind it carries the form shown above.</em>
|
|
115
|
+
</p>
|
|
110
116
|
|
|
111
117
|
- **Connection**: the API base URL and the credential, both blank by default — a blank URL means the official DeepSeek endpoint, and the credential is inherited from the official model page and is read-only.
|
|
112
118
|
The nested "Customised settings" holds only the credential reference name.
|
package/lib/client.js
CHANGED
|
@@ -34,24 +34,6 @@ var import_react6 = require("react");
|
|
|
34
34
|
|
|
35
35
|
// src/client/settings/BalanceSettingsCard.tsx
|
|
36
36
|
var import_react4 = require("react");
|
|
37
|
-
|
|
38
|
-
// node_modules/clsx/dist/clsx.mjs
|
|
39
|
-
function r(e) {
|
|
40
|
-
var t, f, n = "";
|
|
41
|
-
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
42
|
-
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
43
|
-
var o = e.length;
|
|
44
|
-
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
45
|
-
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
46
|
-
return n;
|
|
47
|
-
}
|
|
48
|
-
function clsx() {
|
|
49
|
-
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
50
|
-
return n;
|
|
51
|
-
}
|
|
52
|
-
var clsx_default = clsx;
|
|
53
|
-
|
|
54
|
-
// src/client/settings/BalanceSettingsCard.tsx
|
|
55
37
|
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
56
38
|
|
|
57
39
|
// src/client/locales.ts
|
|
@@ -79,8 +61,6 @@ var zh = {
|
|
|
79
61
|
"state.empty": "\u5C1A\u672A\u914D\u7F6E",
|
|
80
62
|
"state.noKey": "\u5C1A\u672A\u586B\u5199 API Key",
|
|
81
63
|
"state.noBalance": "\u6682\u65E0\u4F59\u989D",
|
|
82
|
-
"settings.title": "DeepSeek \u4F59\u989D",
|
|
83
|
-
"settings.description": "\u914D\u7F6E\u8D26\u6237\u8FDE\u63A5\u3001\u5237\u65B0\u8282\u594F\u4E0E\u9884\u8B66\u9608\u503C\u3002",
|
|
84
64
|
"settings.group.connection": "\u8FDE\u63A5",
|
|
85
65
|
"settings.group.refresh": "\u5237\u65B0",
|
|
86
66
|
"settings.group.display": "\u5C55\u793A",
|
|
@@ -121,7 +101,6 @@ var zh = {
|
|
|
121
101
|
"settings.test.fail": "\u8FDE\u63A5\u5931\u8D25\uFF1A{message}",
|
|
122
102
|
"settings.save": "\u4FDD\u5B58",
|
|
123
103
|
"settings.saving": "\u4FDD\u5B58\u4E2D\u2026",
|
|
124
|
-
"settings.discard": "\u653E\u5F03\u4FEE\u6539",
|
|
125
104
|
"settings.failed": "\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
126
105
|
"settings.readOnly": "\u5F53\u524D\u914D\u7F6E\u53EA\u8BFB\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u4FEE\u6539\u3002",
|
|
127
106
|
"settings.unsaved": "\u672A\u4FDD\u5B58",
|
|
@@ -159,8 +138,6 @@ var en = {
|
|
|
159
138
|
"state.empty": "Not configured",
|
|
160
139
|
"state.noKey": "API key missing",
|
|
161
140
|
"state.noBalance": "No balance",
|
|
162
|
-
"settings.title": "DeepSeek balance",
|
|
163
|
-
"settings.description": "Connection, refresh cadence, and warning thresholds.",
|
|
164
141
|
"settings.group.connection": "Connection",
|
|
165
142
|
"settings.group.refresh": "Refresh",
|
|
166
143
|
"settings.group.display": "Display",
|
|
@@ -197,7 +174,6 @@ var en = {
|
|
|
197
174
|
"settings.test.fail": "Connection failed: {message}",
|
|
198
175
|
"settings.save": "Save",
|
|
199
176
|
"settings.saving": "Saving\u2026",
|
|
200
|
-
"settings.discard": "Discard",
|
|
201
177
|
"settings.failed": "Saving failed. Try again.",
|
|
202
178
|
"settings.readOnly": "This configuration is read-only.",
|
|
203
179
|
"settings.unsaved": "Unsaved",
|
|
@@ -218,6 +194,24 @@ function interpolate(template, params) {
|
|
|
218
194
|
|
|
219
195
|
// src/client/settings/fields.tsx
|
|
220
196
|
var import_react = require("react");
|
|
197
|
+
|
|
198
|
+
// node_modules/clsx/dist/clsx.mjs
|
|
199
|
+
function r(e) {
|
|
200
|
+
var t, f, n = "";
|
|
201
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
202
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
203
|
+
var o = e.length;
|
|
204
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
205
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
206
|
+
return n;
|
|
207
|
+
}
|
|
208
|
+
function clsx() {
|
|
209
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
210
|
+
return n;
|
|
211
|
+
}
|
|
212
|
+
var clsx_default = clsx;
|
|
213
|
+
|
|
214
|
+
// src/client/settings/fields.tsx
|
|
221
215
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
222
216
|
|
|
223
217
|
// src/client/settings/fields.module.css
|
|
@@ -891,22 +885,11 @@ function useCredentialState(ref) {
|
|
|
891
885
|
|
|
892
886
|
// src/client/settings/BalanceSettingsCard.module.css
|
|
893
887
|
var BalanceSettingsCard_default = {
|
|
894
|
-
|
|
895
|
-
cardOpen: "BalanceSettingsCard_cardOpen",
|
|
896
|
-
header: "BalanceSettingsCard_header",
|
|
897
|
-
headText: "BalanceSettingsCard_headText",
|
|
898
|
-
name: "BalanceSettingsCard_name",
|
|
899
|
-
description: "BalanceSettingsCard_description",
|
|
900
|
-
chevronWrap: "BalanceSettingsCard_chevronWrap",
|
|
901
|
-
chevron: "BalanceSettingsCard_chevron",
|
|
902
|
-
chevronOpen: "BalanceSettingsCard_chevronOpen",
|
|
903
|
-
pending: "BalanceSettingsCard_pending",
|
|
904
|
-
body: "BalanceSettingsCard_body",
|
|
888
|
+
form: "BalanceSettingsCard_form",
|
|
905
889
|
readOnly: "BalanceSettingsCard_readOnly",
|
|
906
890
|
footer: "BalanceSettingsCard_footer",
|
|
907
891
|
failed: "BalanceSettingsCard_failed",
|
|
908
892
|
notice: "BalanceSettingsCard_notice",
|
|
909
|
-
discard: "BalanceSettingsCard_discard",
|
|
910
893
|
save: "BalanceSettingsCard_save"
|
|
911
894
|
};
|
|
912
895
|
|
|
@@ -922,10 +905,10 @@ var CREDENTIAL_BADGE = {
|
|
|
922
905
|
overridden: "settings.credential.configured"
|
|
923
906
|
};
|
|
924
907
|
var DEFAULT_GROUP_OPEN = {
|
|
925
|
-
connection:
|
|
926
|
-
display:
|
|
927
|
-
thresholds:
|
|
928
|
-
refresh:
|
|
908
|
+
connection: true,
|
|
909
|
+
display: true,
|
|
910
|
+
thresholds: true,
|
|
911
|
+
refresh: true
|
|
929
912
|
};
|
|
930
913
|
var GROUP_FIELDS = {
|
|
931
914
|
connection: ["apiKey", "apiKeyRef", "baseUrl"],
|
|
@@ -953,24 +936,13 @@ function isFilled(value) {
|
|
|
953
936
|
}
|
|
954
937
|
function BalanceSettingsCard({ t, scope }) {
|
|
955
938
|
const form = useConfigForm(scope);
|
|
956
|
-
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
957
939
|
const [groupOpen, setGroupOpen] = (0, import_react4.useState)(DEFAULT_GROUP_OPEN);
|
|
958
|
-
const saveStarted = (0, import_react4.useRef)(false);
|
|
959
940
|
const toggleGroup = (key) => {
|
|
960
941
|
setGroupOpen((current) => ({ ...current, [key]: !current[key] }));
|
|
961
942
|
};
|
|
962
943
|
const groupOpenNow = (key) => groupOpen[key] || GROUP_FIELDS[key].some((name) => form.field(name).invalid) || key === "thresholds" && THRESHOLD_PAIRS.some((pair) => !form.thresholdPairOk(pair.currency));
|
|
963
944
|
const { writable, dirty, invalid, saving, failed } = form.state;
|
|
964
945
|
const disabled = !writable || saving;
|
|
965
|
-
(0, import_react4.useEffect)(() => {
|
|
966
|
-
if (saving) {
|
|
967
|
-
saveStarted.current = true;
|
|
968
|
-
return;
|
|
969
|
-
}
|
|
970
|
-
if (!saveStarted.current) return;
|
|
971
|
-
saveStarted.current = false;
|
|
972
|
-
if (!dirty && !failed) setOpen(false);
|
|
973
|
-
}, [dirty, failed, saving]);
|
|
974
946
|
const credentialStatus = (name) => {
|
|
975
947
|
const state = form.field(name);
|
|
976
948
|
if (state.stored) return { label: t("settings.overridden"), tone: "neutral" };
|
|
@@ -1105,27 +1077,9 @@ function BalanceSettingsCard({ t, scope }) {
|
|
|
1105
1077
|
] });
|
|
1106
1078
|
const testResult = form.test.ok === null ? null : form.test.ok ? { ok: true, text: t("settings.test.ok") } : { ok: false, text: interpolate(t("settings.test.fail"), { message: form.test.message }) };
|
|
1107
1079
|
const footerNote = failed ? { text: t("settings.failed"), className: BalanceSettingsCard_default.failed } : invalid ? { text: t("settings.invalid"), className: BalanceSettingsCard_default.notice } : null;
|
|
1108
|
-
return
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
{
|
|
1112
|
-
type: "button",
|
|
1113
|
-
className: BalanceSettingsCard_default.header,
|
|
1114
|
-
"aria-expanded": open,
|
|
1115
|
-
onClick: () => {
|
|
1116
|
-
setOpen(!open);
|
|
1117
|
-
},
|
|
1118
|
-
children: [
|
|
1119
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: BalanceSettingsCard_default.headText, children: [
|
|
1120
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: BalanceSettingsCard_default.name, children: t("settings.title") }),
|
|
1121
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: BalanceSettingsCard_default.description, children: t("settings.description") })
|
|
1122
|
-
] }),
|
|
1123
|
-
dirty ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tag, { tone: "neutral", className: BalanceSettingsCard_default.pending, children: t("settings.unsaved") }) : null,
|
|
1124
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: BalanceSettingsCard_default.chevronWrap, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconChevronDownOutline14, { className: clsx_default(BalanceSettingsCard_default.chevron, open && BalanceSettingsCard_default.chevronOpen) }) })
|
|
1125
|
-
]
|
|
1126
|
-
}
|
|
1127
|
-
),
|
|
1128
|
-
open ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: BalanceSettingsCard_default.body, children: [
|
|
1080
|
+
return (
|
|
1081
|
+
// 页面把这一格渲染在自己的 <section> 里:无外框的一列控件,所以根节点是 div、不是 li。
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: BalanceSettingsCard_default.form, children: [
|
|
1129
1083
|
writable ? null : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: BalanceSettingsCard_default.readOnly, role: "status", children: t("settings.readOnly") }),
|
|
1130
1084
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
1131
1085
|
FieldGroup,
|
|
@@ -1224,16 +1178,6 @@ function BalanceSettingsCard({ t, scope }) {
|
|
|
1224
1178
|
),
|
|
1225
1179
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: BalanceSettingsCard_default.footer, children: [
|
|
1226
1180
|
footerNote === null ? null : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: footerNote.className, role: "status", children: footerNote.text }),
|
|
1227
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1228
|
-
"button",
|
|
1229
|
-
{
|
|
1230
|
-
type: "button",
|
|
1231
|
-
className: BalanceSettingsCard_default.discard,
|
|
1232
|
-
disabled: !dirty || saving,
|
|
1233
|
-
onClick: form.discard,
|
|
1234
|
-
children: t("settings.discard")
|
|
1235
|
-
}
|
|
1236
|
-
),
|
|
1237
1181
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1238
1182
|
"button",
|
|
1239
1183
|
{
|
|
@@ -1247,8 +1191,8 @@ function BalanceSettingsCard({ t, scope }) {
|
|
|
1247
1191
|
}
|
|
1248
1192
|
)
|
|
1249
1193
|
] })
|
|
1250
|
-
] })
|
|
1251
|
-
|
|
1194
|
+
] })
|
|
1195
|
+
);
|
|
1252
1196
|
}
|
|
1253
1197
|
|
|
1254
1198
|
// src/client/sidebar/SidebarBalance.tsx
|
|
@@ -2026,13 +1970,18 @@ function SidebarSeatComponent(props) {
|
|
|
2026
1970
|
);
|
|
2027
1971
|
}
|
|
2028
1972
|
function SettingsSeatComponent(props) {
|
|
2029
|
-
|
|
1973
|
+
switch (props.seat.view) {
|
|
1974
|
+
case "page":
|
|
1975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(BalanceSettingsCard, { t: props.seat.t, scope: props.scope });
|
|
1976
|
+
case "summary":
|
|
1977
|
+
return null;
|
|
1978
|
+
}
|
|
2030
1979
|
}
|
|
2031
1980
|
function apply(ctx) {
|
|
2032
1981
|
ctx.effect(() => ctx.locale.register(NS, { zh, en }), "ds-balance: dictionaries");
|
|
2033
1982
|
const scope = adaptScope(ctx.settingsScope.bind({ namespace: SETTINGS_NAMESPACE }));
|
|
2034
|
-
ctx.slots.inject("
|
|
2035
|
-
{ name: "
|
|
1983
|
+
ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register(
|
|
1984
|
+
{ name: "plugins.bundle.config", key: "dsh-ds-balance", locale: NS },
|
|
2036
1985
|
(seat) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SettingsSeatComponent, { seat, scope })
|
|
2037
1986
|
));
|
|
2038
1987
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register(
|
|
@@ -2040,7 +1989,7 @@ function apply(ctx) {
|
|
|
2040
1989
|
(seat) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SidebarSeatComponent, { seat, scope })
|
|
2041
1990
|
));
|
|
2042
1991
|
}
|
|
2043
|
-
var __dsbCss = "/* src/client/settings/fields.module.css */\n.fields_group {\n padding: 12px 0 0;\n}\n.fields_groupLast {\n padding-bottom: 12px;\n}\n.fields_groupNote {\n margin: 4px 0 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.fields_fields {\n display: flex;\n flex-direction: column;\n}\n.fields_fields > * + * {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n.fields_details {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n margin-top: 12px;\n padding-top: 12px;\n}\n.fields_detailsSummary {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n list-style: none;\n}\n.fields_detailsSummary::-webkit-details-marker {\n display: none;\n}\n.fields_detailsSummary::before {\n content: \"\";\n flex: none;\n width: 5px;\n height: 5px;\n border-right: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n transform: translate(-0.5px, -1px) rotate(-45deg);\n transition: transform 120ms ease;\n}\n.fields_details[open] > .fields_detailsSummary::before {\n transform: translate(-0.5px, -1px) rotate(45deg);\n}\n.fields_detailsBody {\n padding-top: 10px;\n}\n.fields_field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 12px 0;\n}\n.fields_row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 0;\n}\n.fields_rowText {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding-right: 48px;\n}\n.fields_rowTitleLine {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.fields_rowTitle {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 500;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_head {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.fields_label {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 500;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_badges {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n.fields_reset {\n border: none;\n background: none;\n padding: 0;\n font: inherit;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n.fields_reset:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n}\n.fields_reset:disabled {\n cursor: default;\n}\n.fields_input {\n box-sizing: border-box;\n width: 100%;\n height: 34px;\n padding: 0 12px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-3);\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_input:focus-visible {\n outline: none;\n border-color: var(--dsw-alias-brand-primary);\n}\n.fields_input:disabled {\n color: var(--dsw-alias-label-tertiary);\n opacity: 0.6;\n cursor: default;\n}\ninput.fields_inputStatic,\ninput.fields_inputStatic:hover,\ninput.fields_inputStatic:focus,\ninput.fields_inputStatic:focus-visible,\ninput.fields_inputStatic:active {\n border-color: var(--dsw-alias-border-l4);\n background: var(--dsw-alias-bg-layer-3);\n outline: none;\n box-shadow: none;\n cursor: default;\n pointer-events: none;\n}\n.fields_inputInvalid {\n box-sizing: border-box;\n width: 100%;\n height: 34px;\n padding: 0 12px;\n border: 1px solid var(--dsw-alias-state-error-primary);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-3);\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_inputInvalid:focus-visible {\n outline: none;\n border-color: var(--dsw-alias-brand-primary);\n}\n.fields_inputInvalid:disabled {\n color: var(--dsw-alias-label-tertiary);\n cursor: default;\n}\n.fields_inputWithAction {\n position: relative;\n display: flex;\n align-items: center;\n}\n.fields_inputWithAction .fields_input,\n.fields_inputWithAction .fields_inputInvalid {\n padding-right: 38px;\n}\n.fields_reveal {\n position: absolute;\n right: 4px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: none;\n border-radius: 999px;\n corner-shape: round;\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n.fields_reveal:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n}\n.fields_revealOn {\n color: var(--dsw-alias-label-primary);\n}\n.fields_reveal:disabled {\n cursor: default;\n opacity: 0.4;\n}\n.fields_selectorAnchor {\n flex: none;\n}\n.fields_selector {\n display: inline-flex;\n align-items: center;\n gap: 12px;\n flex: none;\n max-width: 100%;\n height: 36px;\n padding: 0 14px;\n border: none;\n border-radius: 18px;\n background: var(--dsw-alias-bg-module-platform);\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n color: var(--dsw-alias-label-primary);\n text-align: left;\n cursor: pointer;\n}\n.fields_selector:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.fields_selector:disabled {\n color: var(--dsw-alias-label-tertiary);\n cursor: default;\n}\n.fields_selectorChevron {\n flex: none;\n}\n.fields_hint {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.fields_pairNote {\n display: flex;\n align-items: center;\n gap: 6px;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-warn-primary);\n}\n.fields_pairNote::before {\n content: \"\";\n flex: none;\n width: 5px;\n height: 5px;\n border-radius: 999px;\n corner-shape: round;\n background: currentColor;\n}\n.fields_invalid {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-error-primary);\n}\n.fields_actions {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.fields_actionButton {\n appearance: none;\n border: 0.5px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 5px 14px;\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n cursor: pointer;\n background: none;\n color: var(--dsw-alias-label-secondary);\n}\n.fields_actionButton:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n border-color: var(--dsw-alias-label-dimmed);\n}\n.fields_actionButton:disabled {\n opacity: 0.4;\n cursor: default;\n}\n.fields_actionButton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n.fields_resultOk {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-success-primary);\n}\n.fields_resultFail {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* src/client/settings/BalanceSettingsCard.module.css */\n.BalanceSettingsCard_card {\n list-style: none;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 16px;\n background: var(--dsw-alias-bg-layer-3);\n transition: border-color .16s, background .16s;\n}\n.BalanceSettingsCard_card:hover {\n border-color: var(--dsw-alias-label-dimmed);\n}\n.BalanceSettingsCard_cardOpen {\n background: var(--dsw-alias-bg-layer-2);\n border-color: var(--dsw-alias-label-dimmed);\n}\n.BalanceSettingsCard_header {\n width: 100%;\n appearance: none;\n border: 0;\n background: none;\n font: inherit;\n color: inherit;\n text-align: left;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 14px 16px;\n border-radius: 12px;\n}\n.BalanceSettingsCard_header:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: -2px;\n}\n.BalanceSettingsCard_headText {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.BalanceSettingsCard_name {\n font-size: 15px;\n font-weight: 600;\n line-height: 1.4;\n color: var(--dsw-alias-label-primary);\n}\n.BalanceSettingsCard_description {\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalanceSettingsCard_chevronWrap {\n flex: none;\n display: inline-flex;\n align-items: center;\n}\n.BalanceSettingsCard_chevron {\n color: var(--dsw-alias-label-tertiary);\n transition: transform .16s;\n}\n.BalanceSettingsCard_chevronOpen {\n transform: rotate(180deg);\n}\n.BalanceSettingsCard_pending {\n flex: none;\n}\n.BalanceSettingsCard_body {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n margin: 0 16px;\n padding-bottom: 0;\n}\n.BalanceSettingsCard_readOnly {\n margin: 12px 0 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalanceSettingsCard_footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 12px 0;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n.BalanceSettingsCard_failed {\n flex: 1;\n min-width: 0;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-error-primary);\n}\n.BalanceSettingsCard_notice {\n flex: 1;\n min-width: 0;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalanceSettingsCard_discard,\n.BalanceSettingsCard_save {\n appearance: none;\n border: 0.5px solid transparent;\n border-radius: 8px;\n padding: 5px 14px;\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n cursor: pointer;\n}\n.BalanceSettingsCard_discard {\n border-color: var(--dsw-alias-border-l2);\n background: none;\n color: var(--dsw-alias-label-secondary);\n}\n.BalanceSettingsCard_discard:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n border-color: var(--dsw-alias-label-dimmed);\n}\n.BalanceSettingsCard_save {\n background: var(--dsw-alias-label-primary);\n color: var(--dsw-alias-bg-layer-3);\n}\n.BalanceSettingsCard_discard:disabled,\n.BalanceSettingsCard_save:disabled {\n opacity: 0.4;\n cursor: default;\n}\n.BalanceSettingsCard_discard:focus-visible,\n.BalanceSettingsCard_save:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n/* src/client/sidebar/BalancePopover.module.css */\n.BalancePopover_panel {\n position: fixed;\n z-index: 1100;\n box-sizing: border-box;\n width: max-content;\n min-width: min(300px, calc(100vw - 24px));\n max-width: min(440px, calc(100vw - 24px));\n padding: 16px;\n border: 0;\n border-radius: 12px;\n background: var(--dsw-specific-menu);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent);\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n cursor: default;\n}\n.BalancePopover_title {\n display: flex;\n justify-content: space-between;\n gap: 16px;\n margin-bottom: 8px;\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n}\n.BalancePopover_titleLabel {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n.BalancePopover_titleLabel svg {\n flex: none;\n width: 14px;\n height: auto;\n}\n.BalancePopover_titleRule {\n margin-bottom: 10px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n.BalancePopover_details {\n display: grid;\n grid-template-columns: minmax(76px, auto) minmax(0, 1fr);\n gap: 6px 16px;\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_details dt,\n.BalancePopover_details dd {\n min-width: 0;\n margin: 0;\n}\n.BalancePopover_details dd {\n color: var(--dsw-alias-label-secondary);\n font-variant-numeric: tabular-nums;\n text-align: right;\n}\n.BalancePopover_notice {\n margin-top: 12px;\n}\n.BalancePopover_noticeText {\n margin: 0 0 8px;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_noticeActions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n}\n.BalancePopover_footer {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 12px;\n}\n.BalancePopover_updated {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_status {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: right;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_refresh {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: none;\n border-radius: 999px;\n corner-shape: round;\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n.BalancePopover_refresh:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n}\n.BalancePopover_refresh:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n.BalancePopover_refresh:disabled {\n opacity: 0.4;\n cursor: default;\n}\n.BalancePopover_refresh[data-cooling] {\n color: var(--dsw-alias-label-caption);\n}\n.BalancePopover_refresh[data-refreshing] svg {\n animation: BalancePopover_balance-refresh-spin 900ms linear infinite;\n}\n@keyframes BalancePopover_balance-refresh-spin {\n to {\n transform: rotate(360deg);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .BalancePopover_refresh[data-refreshing] svg {\n animation-duration: 2400ms;\n }\n}\n\n/* src/client/sidebar/PercentRing.module.css */\n.PercentRing_ring {\n display: block;\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.PercentRing_ring[data-state=done] {\n color: var(--dsw-alias-state-success-primary);\n}\n.PercentRing_ring[data-state=warning] {\n color: var(--dsw-alias-state-warn-primary);\n}\n.PercentRing_ring[data-state=error] {\n color: var(--dsw-alias-state-error-primary);\n}\n.PercentRing_track {\n fill: none;\n stroke: var(--dsw-alias-border-l3);\n stroke-width: 2;\n}\n.PercentRing_fill {\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n}\n.PercentRing_cross {\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n}\n\n/* src/client/sidebar/SidebarBalance.module.css */\n.SidebarBalance_root {\n position: relative;\n display: flex;\n min-width: 0;\n}\n.SidebarBalance_root[data-mode=wide] {\n flex: none;\n width: calc(100% + 4px);\n margin: 4px -2px 0;\n}\n.SidebarBalance_root[data-mode=rail] {\n flex: none;\n margin: 8px 0 0;\n}\n.SidebarBalance_trigger {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 14px;\n line-height: 22px;\n cursor: pointer;\n overflow: hidden;\n}\n.SidebarBalance_trigger:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.SidebarBalance_trigger:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: -2px;\n}\n.SidebarBalance_root[data-mode=wide] .SidebarBalance_trigger {\n flex: none;\n gap: 8px;\n width: 100%;\n height: 42px;\n padding: 0 10px 0 8px;\n border-radius: 12px;\n}\n.SidebarBalance_root[data-mode=rail] .SidebarBalance_trigger {\n flex: none;\n justify-content: center;\n width: 36px;\n height: 36px;\n padding: 0;\n border-radius: 50%;\n corner-shape: round;\n}\n.SidebarBalance_icon {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n}\n.SidebarBalance_label {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.SidebarBalance_marker {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* src/client/sidebar/footer-stack.module.css */\ndiv:has(> [data-slot=\"sidebar.footer.action\"]) {\n flex-direction: column;\n}\n";
|
|
1992
|
+
var __dsbCss = "/* src/client/settings/fields.module.css */\n.fields_group {\n padding: 12px 0 0;\n}\n.fields_groupLast {\n padding-bottom: 12px;\n}\n.fields_groupNote {\n margin: 4px 0 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.fields_fields {\n display: flex;\n flex-direction: column;\n}\n.fields_fields > * + * {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n.fields_details {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n margin-top: 12px;\n padding-top: 12px;\n}\n.fields_detailsSummary {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n list-style: none;\n}\n.fields_detailsSummary::-webkit-details-marker {\n display: none;\n}\n.fields_detailsSummary::before {\n content: \"\";\n flex: none;\n width: 5px;\n height: 5px;\n border-right: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n transform: translate(-0.5px, -1px) rotate(-45deg);\n transition: transform 120ms ease;\n}\n.fields_details[open] > .fields_detailsSummary::before {\n transform: translate(-0.5px, -1px) rotate(45deg);\n}\n.fields_detailsBody {\n padding-top: 10px;\n}\n.fields_field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 12px 0;\n}\n.fields_row {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 0;\n}\n.fields_rowText {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding-right: 48px;\n}\n.fields_rowTitleLine {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.fields_rowTitle {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 500;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_head {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.fields_label {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 500;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_badges {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n.fields_reset {\n border: none;\n background: none;\n padding: 0;\n font: inherit;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-secondary);\n cursor: pointer;\n}\n.fields_reset:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n}\n.fields_reset:disabled {\n cursor: default;\n}\n.fields_input {\n box-sizing: border-box;\n width: 100%;\n height: 34px;\n padding: 0 12px;\n border: 0.5px solid var(--dsw-alias-border-l4);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-3);\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_input:focus-visible {\n outline: none;\n border-color: var(--dsw-alias-brand-primary);\n}\n.fields_input:disabled {\n color: var(--dsw-alias-label-tertiary);\n opacity: 0.6;\n cursor: default;\n}\ninput.fields_inputStatic,\ninput.fields_inputStatic:hover,\ninput.fields_inputStatic:focus,\ninput.fields_inputStatic:focus-visible,\ninput.fields_inputStatic:active {\n border-color: var(--dsw-alias-border-l4);\n background: var(--dsw-alias-bg-layer-3);\n outline: none;\n box-shadow: none;\n cursor: default;\n pointer-events: none;\n}\n.fields_inputInvalid {\n box-sizing: border-box;\n width: 100%;\n height: 34px;\n padding: 0 12px;\n border: 1px solid var(--dsw-alias-state-error-primary);\n border-radius: 8px;\n background: var(--dsw-alias-bg-layer-3);\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n color: var(--dsw-alias-label-primary);\n}\n.fields_inputInvalid:focus-visible {\n outline: none;\n border-color: var(--dsw-alias-brand-primary);\n}\n.fields_inputInvalid:disabled {\n color: var(--dsw-alias-label-tertiary);\n cursor: default;\n}\n.fields_inputWithAction {\n position: relative;\n display: flex;\n align-items: center;\n}\n.fields_inputWithAction .fields_input,\n.fields_inputWithAction .fields_inputInvalid {\n padding-right: 38px;\n}\n.fields_reveal {\n position: absolute;\n right: 4px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: none;\n border-radius: 999px;\n corner-shape: round;\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n.fields_reveal:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n}\n.fields_revealOn {\n color: var(--dsw-alias-label-primary);\n}\n.fields_reveal:disabled {\n cursor: default;\n opacity: 0.4;\n}\n.fields_selectorAnchor {\n flex: none;\n}\n.fields_selector {\n display: inline-flex;\n align-items: center;\n gap: 12px;\n flex: none;\n max-width: 100%;\n height: 36px;\n padding: 0 14px;\n border: none;\n border-radius: 18px;\n background: var(--dsw-alias-bg-module-platform);\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n color: var(--dsw-alias-label-primary);\n text-align: left;\n cursor: pointer;\n}\n.fields_selector:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.fields_selector:disabled {\n color: var(--dsw-alias-label-tertiary);\n cursor: default;\n}\n.fields_selectorChevron {\n flex: none;\n}\n.fields_hint {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.fields_pairNote {\n display: flex;\n align-items: center;\n gap: 6px;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-warn-primary);\n}\n.fields_pairNote::before {\n content: \"\";\n flex: none;\n width: 5px;\n height: 5px;\n border-radius: 999px;\n corner-shape: round;\n background: currentColor;\n}\n.fields_invalid {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-error-primary);\n}\n.fields_actions {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.fields_actionButton {\n appearance: none;\n border: 0.5px solid var(--dsw-alias-border-l2);\n border-radius: 8px;\n padding: 5px 14px;\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n cursor: pointer;\n background: none;\n color: var(--dsw-alias-label-secondary);\n}\n.fields_actionButton:hover:not(:disabled) {\n color: var(--dsw-alias-label-primary);\n border-color: var(--dsw-alias-label-dimmed);\n}\n.fields_actionButton:disabled {\n opacity: 0.4;\n cursor: default;\n}\n.fields_actionButton:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n.fields_resultOk {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-success-primary);\n}\n.fields_resultFail {\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-error-primary);\n}\n\n/* src/client/settings/BalanceSettingsCard.module.css */\n.BalanceSettingsCard_form {\n display: flex;\n flex-direction: column;\n}\n.BalanceSettingsCard_readOnly {\n margin: 0 0 12px;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalanceSettingsCard_footer {\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 16px;\n}\n.BalanceSettingsCard_failed {\n flex: 1;\n min-width: 0;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-state-error-primary);\n}\n.BalanceSettingsCard_notice {\n flex: 1;\n min-width: 0;\n margin: 0;\n font-size: 12px;\n line-height: 1.5;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalanceSettingsCard_save {\n appearance: none;\n border: 0.5px solid transparent;\n border-radius: 8px;\n padding: 5px 14px;\n font: inherit;\n font-size: 13px;\n line-height: 1.5;\n cursor: pointer;\n background: var(--dsw-alias-label-primary);\n color: var(--dsw-alias-bg-layer-3);\n}\n.BalanceSettingsCard_save:disabled {\n opacity: 0.4;\n cursor: default;\n}\n.BalanceSettingsCard_save:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n\n/* src/client/sidebar/BalancePopover.module.css */\n.BalancePopover_panel {\n position: fixed;\n z-index: 1100;\n box-sizing: border-box;\n width: max-content;\n min-width: min(300px, calc(100vw - 24px));\n max-width: min(440px, calc(100vw - 24px));\n padding: 16px;\n border: 0;\n border-radius: 12px;\n background: var(--dsw-specific-menu);\n --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);\n box-shadow: var(--dsw-elevation-prominent);\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-secondary);\n cursor: default;\n}\n.BalancePopover_title {\n display: flex;\n justify-content: space-between;\n gap: 16px;\n margin-bottom: 8px;\n color: var(--dsw-alias-label-primary);\n font-weight: 500;\n}\n.BalancePopover_titleLabel {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n.BalancePopover_titleLabel svg {\n flex: none;\n width: 14px;\n height: auto;\n}\n.BalancePopover_titleRule {\n margin-bottom: 10px;\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n.BalancePopover_details {\n display: grid;\n grid-template-columns: minmax(76px, auto) minmax(0, 1fr);\n gap: 6px 16px;\n margin: 0;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_details dt,\n.BalancePopover_details dd {\n min-width: 0;\n margin: 0;\n}\n.BalancePopover_details dd {\n color: var(--dsw-alias-label-secondary);\n font-variant-numeric: tabular-nums;\n text-align: right;\n}\n.BalancePopover_notice {\n margin-top: 12px;\n}\n.BalancePopover_noticeText {\n margin: 0 0 8px;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_noticeActions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n}\n.BalancePopover_footer {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 12px;\n}\n.BalancePopover_updated {\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_status {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: right;\n color: var(--dsw-alias-label-tertiary);\n}\n.BalancePopover_refresh {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n border: none;\n border-radius: 999px;\n corner-shape: round;\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n.BalancePopover_refresh:hover:not(:disabled) {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-secondary);\n}\n.BalancePopover_refresh:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: 1px;\n}\n.BalancePopover_refresh:disabled {\n opacity: 0.4;\n cursor: default;\n}\n.BalancePopover_refresh[data-cooling] {\n color: var(--dsw-alias-label-caption);\n}\n.BalancePopover_refresh[data-refreshing] svg {\n animation: BalancePopover_balance-refresh-spin 900ms linear infinite;\n}\n@keyframes BalancePopover_balance-refresh-spin {\n to {\n transform: rotate(360deg);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .BalancePopover_refresh[data-refreshing] svg {\n animation-duration: 2400ms;\n }\n}\n\n/* src/client/sidebar/PercentRing.module.css */\n.PercentRing_ring {\n display: block;\n flex: none;\n color: var(--dsw-alias-label-tertiary);\n}\n.PercentRing_ring[data-state=done] {\n color: var(--dsw-alias-state-success-primary);\n}\n.PercentRing_ring[data-state=warning] {\n color: var(--dsw-alias-state-warn-primary);\n}\n.PercentRing_ring[data-state=error] {\n color: var(--dsw-alias-state-error-primary);\n}\n.PercentRing_track {\n fill: none;\n stroke: var(--dsw-alias-border-l3);\n stroke-width: 2;\n}\n.PercentRing_fill {\n fill: none;\n stroke: currentColor;\n stroke-width: 2;\n stroke-linecap: round;\n}\n.PercentRing_cross {\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linecap: round;\n}\n\n/* src/client/sidebar/SidebarBalance.module.css */\n.SidebarBalance_root {\n position: relative;\n display: flex;\n min-width: 0;\n}\n.SidebarBalance_root[data-mode=wide] {\n flex: none;\n width: calc(100% + 4px);\n margin: 4px -2px 0;\n}\n.SidebarBalance_root[data-mode=rail] {\n flex: none;\n margin: 8px 0 0;\n}\n.SidebarBalance_trigger {\n display: flex;\n align-items: center;\n box-sizing: border-box;\n border: none;\n background: transparent;\n color: var(--dsw-alias-label-primary);\n font-family: inherit;\n font-size: 14px;\n line-height: 22px;\n cursor: pointer;\n overflow: hidden;\n}\n.SidebarBalance_trigger:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n}\n.SidebarBalance_trigger:focus-visible {\n outline: 2px solid var(--dsw-alias-brand-primary);\n outline-offset: -2px;\n}\n.SidebarBalance_root[data-mode=wide] .SidebarBalance_trigger {\n flex: none;\n gap: 8px;\n width: 100%;\n height: 42px;\n padding: 0 10px 0 8px;\n border-radius: 12px;\n}\n.SidebarBalance_root[data-mode=rail] .SidebarBalance_trigger {\n flex: none;\n justify-content: center;\n width: 36px;\n height: 36px;\n padding: 0;\n border-radius: 50%;\n corner-shape: round;\n}\n.SidebarBalance_icon {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n}\n.SidebarBalance_label {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.SidebarBalance_marker {\n display: inline-flex;\n flex: none;\n align-items: center;\n justify-content: center;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* src/client/sidebar/footer-stack.module.css */\ndiv:has(> [data-slot=\"sidebar.footer.action\"]) {\n flex-direction: column;\n}\n";
|
|
2044
1993
|
var __dsbTagId = "dsh-ds-balance/client.css";
|
|
2045
1994
|
if (typeof document !== 'undefined' && document.querySelector('style[data-plugin-css="' + __dsbTagId + '"]') === null) {
|
|
2046
1995
|
var __dsbTag = document.createElement('style');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 浏览器半边入口:注册词典、Plugins 页里的配置卡片与左下角条目。
|
|
3
3
|
*
|
|
4
|
-
* 这两半各占一个 slot
|
|
5
|
-
*
|
|
4
|
+
* 这两半各占一个 slot,互不依赖;配置卡片挂在 `plugins.bundle.config` 上,
|
|
5
|
+
* 宿主按**包名**取这一格,设置命名空间只用来绑作用域。
|
|
6
6
|
* @module dsh-ds-balance/client
|
|
7
7
|
*/
|
|
8
8
|
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
@@ -28,8 +28,6 @@ export declare const zh: {
|
|
|
28
28
|
readonly 'state.empty': "尚未配置";
|
|
29
29
|
readonly 'state.noKey': "尚未填写 API Key";
|
|
30
30
|
readonly 'state.noBalance': "暂无余额";
|
|
31
|
-
readonly 'settings.title': "DeepSeek 余额";
|
|
32
|
-
readonly 'settings.description': "配置账户连接、刷新节奏与预警阈值。";
|
|
33
31
|
readonly 'settings.group.connection': "连接";
|
|
34
32
|
readonly 'settings.group.refresh': "刷新";
|
|
35
33
|
readonly 'settings.group.display': "展示";
|
|
@@ -66,7 +64,6 @@ export declare const zh: {
|
|
|
66
64
|
readonly 'settings.test.fail': "连接失败:{message}";
|
|
67
65
|
readonly 'settings.save': "保存";
|
|
68
66
|
readonly 'settings.saving': "保存中…";
|
|
69
|
-
readonly 'settings.discard': "放弃修改";
|
|
70
67
|
readonly 'settings.failed': "保存失败,请重试。";
|
|
71
68
|
readonly 'settings.readOnly': "当前配置只读,无法保存修改。";
|
|
72
69
|
readonly 'settings.unsaved': "未保存";
|
package/lib/version.d.ts
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
/** 线上 schema 版本。响应里逐条回传,消费方据此判断兼容性。 */
|
|
9
9
|
export declare const SCHEMA_VERSION = 1;
|
|
10
10
|
/** 插件版本。与 `package.json` 的 `version` 一致(有测试兜底)。 */
|
|
11
|
-
export declare const PLUGIN_VERSION = "
|
|
11
|
+
export declare const PLUGIN_VERSION = "2.0.0-alpha.0";
|
|
12
12
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ds-balance",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "DSH plugin: shows the DeepSeek account balance at the bottom of the sidebar, with a configuration card
|
|
3
|
+
"version": "2.0.0-alpha.0",
|
|
4
|
+
"description": "DSH plugin: shows the DeepSeek account balance at the bottom of the sidebar, with a configuration card on the Plugins page.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
7
7
|
"deepseek-harness",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"LICENSE"
|
|
44
44
|
],
|
|
45
45
|
"engines": {
|
|
46
|
-
"dsh": "^0.1.6-alpha.
|
|
46
|
+
"dsh": "^0.1.6-alpha.2",
|
|
47
47
|
"node": ">=20"
|
|
48
48
|
},
|
|
49
49
|
"dsh": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"client": {
|
|
54
54
|
"platform": "web",
|
|
55
55
|
"inject": [
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager"
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
},
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
70
70
|
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.1",
|
|
71
71
|
"@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.1",
|
|
72
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.6-alpha.2",
|
|
72
73
|
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.1",
|
|
73
74
|
"@deepseek-ai/dsh-client-ui-settings": "^0.1.6-alpha.1",
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.6-alpha.1",
|
|
75
75
|
"@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.1",
|
|
76
76
|
"@deepseek-ai/dsh-credentials": "^0.1.6-alpha.1",
|
|
77
77
|
"@deepseek-ai/dsh-home-paths": "^0.1.6-alpha.1",
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
86
86
|
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.1",
|
|
87
87
|
"@deepseek-ai/dsh-client-locale": "^0.1.6-alpha.1",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.6-alpha.2",
|
|
88
89
|
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.6-alpha.1",
|
|
89
90
|
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.6-alpha.1",
|
|
90
91
|
"@deepseek-ai/dsh-client-ui-settings": "^0.1.6-alpha.1",
|
|
91
|
-
"@deepseek-ai/dsh-client-ui-settings-plugins": "^0.1.6-alpha.1",
|
|
92
92
|
"@deepseek-ai/dsh-client-ui-sidebar": "^0.1.6-alpha.1",
|
|
93
93
|
"@deepseek-ai/dsh-client-ui-slots": "^0.1.6-alpha.1",
|
|
94
94
|
"@deepseek-ai/dsh-credentials": "^0.1.6-alpha.1",
|