@iasiv5/dsh-skins 1.5.25 → 1.5.27

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.
Files changed (2) hide show
  1. package/lib/client.js +52 -16
  2. package/package.json +2 -1
package/lib/client.js CHANGED
@@ -2969,7 +2969,7 @@ ${references.join("\n")}`,
2969
2969
  if (typeof extension !== "string" || !/^[a-z0-9]+$/.test(extension)) {
2970
2970
  throw new RangeError(`builtinAssetUrl: invalid extension ${JSON.stringify(extension)}`);
2971
2971
  }
2972
- const rev = "1.5.25";
2972
+ const rev = "1.5.27";
2973
2973
  return `/dsh-skins/assets/b_${skinId}_${assetKey}.${extension}?v=${rev}`;
2974
2974
  }
2975
2975
 
@@ -3094,11 +3094,20 @@ ${references.join("\n")}`,
3094
3094
  * 灯箱 .dsvm-lightbox 根同带 role/aria 语义,浅色 tint 会把影院式黑遮罩染
3095
3095
  * 成浅毛玻璃、白色控件整体隐形(用户双模式实拍)——影院遮罩归 dsh-m 自有
3096
3096
  * 不变量(0.9.62 起 background !important 自持),此处 :not 双保险、语义
3097
- * 归位。 */
3097
+ * 归位。1.5.26 增补(ADR-0007 amendment):非模态 dialog 钩子
3098
+ * [role="dialog"]:not([aria-modal="true"]):not(.dsvm-lightbox)——
3099
+ * better-sidebar 锚定浮层(Git 提交图悬停卡、行上下文菜单)与其悬浮窗
3100
+ * 壳、chat 用量统计面板、conversation 用量浮卡全部 portal 到 body 的
3101
+ * fixed 浮层,底色吃半透 bg-layer/menu token 且自带 0 blur;官方 token
3102
+ * 值不透明故官方皮肤无症状,皮肤半透后透字(Git 悬停卡主人实拍
3103
+ * 2026-11-03)。2026-11-03 对已装插件与宿主 client 逐面排查:该钩子
3104
+ * 命中面全为浮层、无误染;灯箱本带 aria-modal,:not 三重保险仅属
3105
+ * 与 v1 钩子同构的 belt。 */
3098
3106
  ${scope} { --dsw-menu-surface-fill: rgba(${menu.light}, 0.94); --dsw-alias-menu-group-header-fill: rgba(${menu.light}, 0.94); --dsw-specific-menu: rgba(${menu.light}, 0.94); }
3099
3107
  ${scope}[data-ds-dark-theme] { --dsw-menu-surface-fill: rgba(${menu.dark}, 0.94); --dsw-alias-menu-group-header-fill: rgba(${menu.dark}, 0.94); --dsw-specific-menu: rgba(${menu.dark}, 0.94); }
3100
3108
  ${scope} { --dsw-mask-blur: blur(10px); }
3101
3109
  ${scope} [role="dialog"][aria-modal="true"]:not(.dsvm-lightbox),
3110
+ ${scope} [role="dialog"]:not([aria-modal="true"]):not(.dsvm-lightbox),
3102
3111
  ${scope} .dshm-panel,
3103
3112
  ${scope} .dshm-compat-dialog,
3104
3113
  ${scope} .dshm-dshchip-tip,
@@ -3108,6 +3117,7 @@ ${references.join("\n")}`,
3108
3117
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
3109
3118
  }
3110
3119
  ${scope}[data-ds-dark-theme] [role="dialog"][aria-modal="true"]:not(.dsvm-lightbox),
3120
+ ${scope}[data-ds-dark-theme] [role="dialog"]:not([aria-modal="true"]):not(.dsvm-lightbox),
3111
3121
  ${scope}[data-ds-dark-theme] .dshm-panel,
3112
3122
  ${scope}[data-ds-dark-theme] .dshm-compat-dialog,
3113
3123
  ${scope}[data-ds-dark-theme] .dshm-dshchip-tip,
@@ -3166,6 +3176,10 @@ ${references.join("\n")}`,
3166
3176
  }
3167
3177
 
3168
3178
  // src/client/skins/define-skin.js
3179
+ var FONT_TOKENS = {
3180
+ text: "--dsh-font-family-text-default",
3181
+ code: "--dsh-font-family-code-default"
3182
+ };
3169
3183
  var REQUIRED = [
3170
3184
  "id",
3171
3185
  "label",
@@ -3175,6 +3189,7 @@ ${references.join("\n")}`,
3175
3189
  "anchor",
3176
3190
  "bodyAttribute",
3177
3191
  "riding",
3192
+ "fonts",
3178
3193
  "scrim",
3179
3194
  "blur",
3180
3195
  "glassVar",
@@ -3231,6 +3246,28 @@ ${references.join("\n")}`,
3231
3246
  }
3232
3247
  return wallpaper;
3233
3248
  }
3249
+ function deriveFonts(fonts) {
3250
+ if (fonts === null || typeof fonts !== "object" || Array.isArray(fonts)) {
3251
+ throw new Error("fonts must be an object keyed by font slot");
3252
+ }
3253
+ const derived = {};
3254
+ for (const [slot, value] of Object.entries(fonts)) {
3255
+ if (!Object.hasOwn(FONT_TOKENS, slot)) throw new Error(`Unknown font slot: ${slot}`);
3256
+ const bad = `font slot "${slot}": value must be null, a non-empty string, or { light, dark }`;
3257
+ if (value === null) continue;
3258
+ if (typeof value === "string") {
3259
+ if (value === "") throw new Error(bad);
3260
+ derived[FONT_TOKENS[slot]] = { light: value, dark: value };
3261
+ continue;
3262
+ }
3263
+ const keys = typeof value === "object" && !Array.isArray(value) ? Object.keys(value) : [];
3264
+ if (keys.length !== 2 || !keys.includes("light") || !keys.includes("dark") || typeof value.light !== "string" || value.light === "" || typeof value.dark !== "string" || value.dark === "") {
3265
+ throw new Error(bad);
3266
+ }
3267
+ derived[FONT_TOKENS[slot]] = { light: value.light, dark: value.dark };
3268
+ }
3269
+ return derived;
3270
+ }
3234
3271
  function defineSkin(spec) {
3235
3272
  for (const key of Object.keys(spec)) {
3236
3273
  if (!KNOWN_KEYS.has(key)) throw new Error(`Unknown spec key: ${key}`);
@@ -3249,13 +3286,16 @@ ${references.join("\n")}`,
3249
3286
  spec.backgroundArt ? { art: { mime: spec.backgroundArt.mime, url: spec.backgroundArt.url } } : {},
3250
3287
  spec.builtinAssets ?? {}
3251
3288
  );
3289
+ const fontTokens = deriveFonts(spec.fonts);
3290
+ const constantBase = spec.constantTokens ?? {};
3291
+ const constantTokens = Object.keys(fontTokens).length > 0 || Object.keys(constantBase).length > 0 ? { ...constantBase, ...fontTokens } : null;
3252
3292
  const table = {
3253
3293
  bodyAttribute: spec.bodyAttribute,
3254
3294
  titleBrand: spec.titleBrand,
3255
3295
  favicon: spec.favicon,
3256
3296
  anchor: spec.anchor,
3257
3297
  riding: spec.riding,
3258
- constantTokens: spec.constantTokens ?? null,
3298
+ constantTokens,
3259
3299
  scrim: buildScrim(spec),
3260
3300
  blur: spec.blur,
3261
3301
  glassVar: spec.glassVar,
@@ -3311,6 +3351,8 @@ ${references.join("\n")}`,
3311
3351
  "--dsw-specific-bubble": { light: "rgba(184, 67, 63, 0.10)", dark: "rgba(24, 24, 34, 0.90)" },
3312
3352
  "--dsw-specific-bubble-highlight": { light: "rgba(184, 67, 63, 0.18)", dark: "rgba(40, 40, 56, 0.92)" }
3313
3353
  },
3354
+ // 字体槽位(ADR-0025):宿主跟随。
3355
+ fonts: { text: null, code: null },
3314
3356
  scrim: { kind: "overlay", coefficient: 30, light: "252, 250, 246", dark: "16, 16, 26" },
3315
3357
  blur: { max: 12 },
3316
3358
  glassVar: "--dsh-mrz-glass-blur",
@@ -3486,17 +3528,13 @@ ${references.join("\n")}`,
3486
3528
  "--dsw-alias-interactive-bg-hover-accent": { light: "rgba(140, 206, 63, 0.14)", dark: "rgba(165, 212, 64, 0.16)" },
3487
3529
  "--dsw-specific-bubble": { light: "rgba(0, 138, 191, 0.10)", dark: "rgba(20, 41, 60, 0.90)" },
3488
3530
  "--dsw-specific-bubble-highlight": { light: "rgba(0, 138, 191, 0.18)", dark: "rgba(29, 61, 85, 0.90)" },
3489
- "--dsw-font-family": {
3490
- light: '-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif',
3491
- dark: '-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif'
3492
- },
3493
- "--ds-font-family-code": {
3494
- light: '"JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace',
3495
- dark: '"JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace'
3496
- },
3497
3531
  "--dsh-scrollbar-thumb": { light: "var(--dsw-alias-scrollbar-bg-l2)", dark: "var(--dsw-alias-scrollbar-bg-l2)" },
3498
3532
  "--dsh-scrollbar-thumb-hover": { light: "var(--dsw-alias-scrollbar-hover-l2)", dark: "var(--dsw-alias-scrollbar-hover-l2)" }
3499
3533
  },
3534
+ // 字体槽位(ADR-0025):宿主跟随。JetBrains Mono 历史代码栈封存于
3535
+ // docs/adr/0025-font-slots-and-host-tracking.md「JBM 封存」,一行
3536
+ // code: '<封存栈>' 即复活。
3537
+ fonts: { text: null, code: null },
3500
3538
  scrim: {
3501
3539
  kind: "baked-gradient",
3502
3540
  stops: {
@@ -3657,12 +3695,10 @@ ${references.join("\n")}`,
3657
3695
  "--dsw-alias-interactive-bg-hover": { light: "rgba(101, 83, 216, 0.09)", dark: "rgba(169, 156, 255, 0.11)" },
3658
3696
  "--dsw-alias-interactive-bg-active": { light: "rgba(101, 83, 216, 0.15)", dark: "rgba(169, 156, 255, 0.18)" },
3659
3697
  "--dsw-specific-bubble": { light: "rgba(101, 83, 216, 0.11)", dark: "rgba(60, 48, 108, 0.90)" },
3660
- "--dsw-specific-bubble-highlight": { light: "rgba(101, 83, 216, 0.18)", dark: "rgba(78, 63, 138, 0.92)" },
3661
- "--dsw-font-family": {
3662
- light: '-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif',
3663
- dark: '-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif'
3664
- }
3698
+ "--dsw-specific-bubble-highlight": { light: "rgba(101, 83, 216, 0.18)", dark: "rgba(78, 63, 138, 0.92)" }
3665
3699
  },
3700
+ // 字体槽位(ADR-0025):宿主跟随。
3701
+ fonts: { text: null, code: null },
3666
3702
  scrim: {
3667
3703
  kind: "baked-gradient",
3668
3704
  stops: {
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.25",
5
+ "version": "1.5.27",
6
6
  "homepage": "https://github.com/iasiv5/dsh-skins#readme",
7
7
  "repository": {
8
8
  "type": "git",
@@ -88,6 +88,7 @@
88
88
  "verify:bundle": "node scripts/verify-bundle-guard.mjs",
89
89
  "verify:delivery": "node scripts/verify-delivery.mjs",
90
90
  "verify:hooks": "node scripts/verify-upstream-hooks.mjs",
91
+ "verify:hot-deploy": "bash scripts/verify-hot-deploy-roundtrip.sh",
91
92
  "check": "pnpm run check:lockfile && pnpm run build && node --check lib/client.js && node --check lib/index.js && pnpm run lint && pnpm run test && pnpm run verify:readme && pnpm run verify:bundle && pnpm run verify:hooks && pnpm run verify:delivery && git diff --exit-code -- lib/index.js lib/client.js",
92
93
  "lint": "eslint ."
93
94
  }