dsh-ustc-quota 1.1.46 → 1.1.47
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 +1 -0
- package/client.js +33 -3
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,6 +112,7 @@ key-c 8.7/30 29% 8.7/70 12% 11.1/100 11%
|
|
|
112
112
|
- 右侧位置会在对话区右侧**预留一条槽**:插件给对话列加右侧内边距(约列宽的 26%,封顶 34%),正文与轮次导航条整体左移,卡片占住这条槽——因此不遮挡正文、不遮挡轮次导航条、也不遮挡右侧原生按钮。上沿从「对话 / 轨迹 / 看板」选项卡下的分隔线以下 6px 开始。
|
|
113
113
|
- 窄窗口或打开侧栏时槽宽自动收窄(下限 140px),卡片始终可见;如果连正文最小宽度都不够,则允许卡片比常规更窄,而不是消失。
|
|
114
114
|
- 换边不重新加载:两处卡片共用同一份已取到的数据。底色用左侧边栏的底色(`--dsw-specific-sidebar-fill`),阴影与左侧一致。
|
|
115
|
+
- 右侧卡片与其它插件的右侧卡片(如 Codex Advisor)会自动上下排开,不会重叠;测量一时失败时退回固定位置显示,不会整块消失。
|
|
115
116
|
## 更新
|
|
116
117
|
|
|
117
118
|
- 标题「USTC 词元额度」右侧显示灰色小字版本号;点击版本号可手动检查更新;
|
package/client.js
CHANGED
|
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
const UPDATE_ENDPOINT = 'plugins/dsh-ustc-quota/update';
|
|
12
12
|
const UPDATE_APPLY_ENDPOINT = 'plugins/dsh-ustc-quota/update/apply';
|
|
13
13
|
const WINDOW_IDS = ['3h', '12h', '24h'];
|
|
14
|
-
const CLIENT_VERSION = '1.1.
|
|
14
|
+
const CLIENT_VERSION = '1.1.47';
|
|
15
15
|
const UPDATE_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
16
16
|
const CLIENT_VERSION_KEY = `${NS}:client-version`;
|
|
17
17
|
const CLIENT_RELOAD_KEY = `${NS}:client-reload`;
|
|
@@ -1232,7 +1232,22 @@ window.__ModuleLoader__.load({
|
|
|
1232
1232
|
const leftEdge = Math.round(boundaryRight) + DOCK_GAP;
|
|
1233
1233
|
const rightEdge = Math.round(rightLimit) - DOCK_GAP;
|
|
1234
1234
|
const span = rightEdge - leftEdge;
|
|
1235
|
-
if (span < 40)
|
|
1235
|
+
if (span < 40) {
|
|
1236
|
+
// Measurement can fail transiently (column re-mounts, first paint). Never
|
|
1237
|
+
// hide the card: anchor it to the column's right edge with a sane width and
|
|
1238
|
+
// let the next measurement refine it.
|
|
1239
|
+
const fallbackTop = Math.round(columnRect.top) + 40;
|
|
1240
|
+
const fallbackWidth = Math.min(300, Math.max(220, Math.round(columnRect.width * 0.24)));
|
|
1241
|
+
return {
|
|
1242
|
+
top: fallbackTop,
|
|
1243
|
+
left: Math.max(0, Math.round(columnRect.right) - fallbackWidth - 12),
|
|
1244
|
+
width: fallbackWidth,
|
|
1245
|
+
naturalSpan: fallbackWidth,
|
|
1246
|
+
columnWidth: Math.round(columnRect.width),
|
|
1247
|
+
maxHeight: Math.max(120, Math.round(columnRect.height) - 60),
|
|
1248
|
+
fallback: true,
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1236
1251
|
|
|
1237
1252
|
// Vertical bound: below the conversation tab strip, above the column bottom.
|
|
1238
1253
|
let contentTop = Math.round(columnRect.top) + DOCK_GAP;
|
|
@@ -1246,8 +1261,23 @@ window.__ModuleLoader__.load({
|
|
|
1246
1261
|
}
|
|
1247
1262
|
|
|
1248
1263
|
const floored = span < 240;
|
|
1264
|
+
let stackTop = contentTop;
|
|
1265
|
+
try {
|
|
1266
|
+
// Other plugins place their own right docks with the same anchor; stack below
|
|
1267
|
+
// any of them that already occupy this band so the cards never overlap.
|
|
1268
|
+
for (const node of document.querySelectorAll('[data-codex-advisor-dock="right"]')) {
|
|
1269
|
+
const rect = node.getBoundingClientRect();
|
|
1270
|
+
if (rect.height <= 0 || rect.width <= 0) continue;
|
|
1271
|
+
if (rect.bottom > stackTop && rect.top < columnRect.bottom) {
|
|
1272
|
+
stackTop = Math.max(stackTop, Math.round(rect.bottom) + DOCK_GAP);
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
} catch {
|
|
1276
|
+
// Stacking is best-effort; a broken neighbour must not break this card.
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1249
1279
|
return {
|
|
1250
|
-
top:
|
|
1280
|
+
top: stackTop,
|
|
1251
1281
|
left: floored ? Math.max(0, rightEdge - 240) : leftEdge,
|
|
1252
1282
|
width: floored ? 240 : span,
|
|
1253
1283
|
naturalSpan: span,
|
package/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const ROUTE_PATH = '/plugins/dsh-ustc-quota/snapshot';
|
|
|
22
22
|
const UPDATE_PATH = '/plugins/dsh-ustc-quota/update';
|
|
23
23
|
const UPDATE_APPLY_PATH = '/plugins/dsh-ustc-quota/update/apply';
|
|
24
24
|
const UPDATE_TOKEN_TTL_MS = 30 * 60 * 1000;
|
|
25
|
-
const PLUGIN_VERSION = '1.1.
|
|
25
|
+
const PLUGIN_VERSION = '1.1.47';
|
|
26
26
|
const KEY_INFO_PATH = 'key/info';
|
|
27
27
|
const USER_INFO_PATH = 'user/info';
|
|
28
28
|
const DISCOVERY_TTL_MS = 30000;
|
package/package.json
CHANGED