@iasiv5/dsh-skins 1.5.29 → 1.5.31

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/lib/client.js CHANGED
@@ -1851,7 +1851,10 @@ ${references.join("\n")}`,
1851
1851
  '[data-slot="sidebar.footer.action"]>*{flex:none;min-width:0}',
1852
1852
  ".dsh-skins-switcher-wrap{width:100%}",
1853
1853
  ".dsh-skins-switcher-wrap.rail{display:flex;justify-content:center}",
1854
- ".dsh-skins-switcher-btn{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:calc(100% + 4px);height:42px;margin:4px -2px;padding:0 10px 0 8px;border:0;border-radius:12px;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:22px;cursor:pointer;overflow:hidden}",
1854
+ // 2026-11-09(对齐 dsh-m issue #55):弃 width+4px/margin -2px/10-8 不对称 padding 的全宽外溢
1855
+ // trick,改宿主规范形——border-inline 透明边吃 paint-inset + padding 9/9,内容起点 8+3+9=20px
1856
+ // 与官方面板行/设置行/dsh-m 入口同刻度(原 14px,dsh-m 对齐后本条成为唯一 6px 出列者,主人截图实证)
1857
+ ".dsh-skins-switcher-btn{box-sizing:border-box;display:flex;align-items:center;gap:8px;width:100%;height:42px;margin:4px 0;padding:0 9px;border:0;border-inline:var(--dsh-sidebar-paint-inset,3px) solid transparent;border-radius:var(--dsw-radius-md,12px);background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:22px;cursor:pointer;overflow:hidden}",
1855
1858
  ".dsh-skins-switcher-wrap.rail .dsh-skins-switcher-btn{width:36px;height:36px;margin:8px 0 10px;padding:0;justify-content:center;border-radius:50%;gap:0}",
1856
1859
  ".dsh-skins-switcher-btn:hover{background:var(--dsw-alias-interactive-bg-hover)}",
1857
1860
  ".dsh-skins-switcher-btn.on,.dsh-skins-switcher-btn[aria-expanded=true]{background:var(--dsw-specific-sidebar-nav-item-active)}",
@@ -2973,7 +2976,7 @@ ${references.join("\n")}`,
2973
2976
  if (typeof extension !== "string" || !/^[a-z0-9]+$/.test(extension)) {
2974
2977
  throw new RangeError(`builtinAssetUrl: invalid extension ${JSON.stringify(extension)}`);
2975
2978
  }
2976
- const rev = "1.5.29";
2979
+ const rev = "1.5.31";
2977
2980
  return `/dsh-skins/assets/b_${skinId}_${assetKey}.${extension}?v=${rev}`;
2978
2981
  }
2979
2982
 
package/lib/index.js CHANGED
@@ -1183,10 +1183,31 @@ function decodeDisplayName(request) {
1183
1183
  throw codedError("FILENAME_INVALID", "x-filename 不是合法的 encodeURIComponent 输出");
1184
1184
  }
1185
1185
  }
1186
+ function createOfficialRejection(ctx) {
1187
+ return (request) => {
1188
+ let connection, reject;
1189
+ try {
1190
+ connection = ctx?.get?.("connection");
1191
+ reject = connection?.requestRejection;
1192
+ } catch {
1193
+ return void 0;
1194
+ }
1195
+ if (typeof reject !== "function") return void 0;
1196
+ try {
1197
+ return reject.call(connection, { headers: request.headers }) ?? void 0;
1198
+ } catch {
1199
+ return 403;
1200
+ }
1201
+ };
1202
+ }
1186
1203
  function mountPersonalizationRoutes(host, options) {
1187
- const { store, assetsBasePath = "/dsh-skins/assets", trustedHosts = [], serveBuiltinAsset } = options;
1204
+ const { store, assetsBasePath = "/dsh-skins/assets", trustedHosts = [], rejection, serveBuiltinAsset } = options;
1188
1205
  const disposers = [];
1189
1206
  const fence = (request, response) => {
1207
+ if (rejection !== void 0 && rejection(request) !== void 0) {
1208
+ sendJson(response, 403, { error: "trusted DSH Web request required" });
1209
+ return false;
1210
+ }
1190
1211
  if (isTrustedRequest(request, typeof trustedHosts === "function" ? trustedHosts() : trustedHosts)) return true;
1191
1212
  sendJson(response, 403, { error: "trusted DSH Web request required" });
1192
1213
  return false;
@@ -1402,6 +1423,7 @@ function apply(ctx) {
1402
1423
  return mountPersonalizationRoutes(hostContext, {
1403
1424
  store: personalization,
1404
1425
  trustedHosts: () => resolveTrustedHosts(ctx),
1426
+ rejection: createOfficialRejection(ctx),
1405
1427
  serveBuiltinAsset
1406
1428
  });
1407
1429
  }, "dsh-skins: personalization routes");
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iasiv5/dsh-skins",
3
3
  "description": "DSH Web 皮肤插件:多套品牌皮肤侧栏热切换。",
4
4
  "icon": "./icon.svg",
5
- "version": "1.5.29",
5
+ "version": "1.5.31",
6
6
  "homepage": "https://github.com/iasiv5/dsh-skins#readme",
7
7
  "repository": {
8
8
  "type": "git",