dsh-opencode-palette 2.0.5 → 2.0.6

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 (3) hide show
  1. package/README.md +1 -1
  2. package/lib/client.js +65 -21
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -45,7 +45,7 @@ dsh plugin --profile web add dsh-opencode-palette
45
45
 
46
46
  <h2 align="center"><sub>EXTENSIONS</sub><br>What the opencode themes come with</h2>
47
47
 
48
- **Plenty of fonts.** Typography is its own dimension: apply it to all text or code only, 11–18 px, your pick of code font — orthogonal to color, kept across restarts.
48
+ **Plenty of fonts.** Typography is its own dimension: apply it to all text or code only, 11–24 px, your pick of code font — orthogonal to color, kept across restarts.
49
49
 
50
50
  **A panel you can find.** 38 entries grouped by color family, searchable, and following your DSH interface language (中文 / English).
51
51
 
package/lib/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * dsh-opencode-palette v2.0.5 — 浏览器半(构建产物,勿手改)
2
+ * dsh-opencode-palette v2.0.6 — 浏览器半(构建产物,勿手改)
3
3
  * 数据驱动管线:opencode v1.18.12 官方主题 JSON → 颜色解析 → DSH 适配注入
4
4
  * 面板「检查更新」:dsh-plugin-update 客户端入口经构建期内联(vendor)
5
5
  * 源:src/engine/* + runtime/*.mjs + npm 包 dsh-log / dsh-plugin-update 的客户端入口
@@ -1525,24 +1525,32 @@ function buildTypographyCss(typography) {
1525
1525
  const bodyFont = mode === 'mono' ? codeFont : SANS_STACK
1526
1526
  const lh = size + 9
1527
1527
  const small = size - 1
1528
+ // 标题阶梯跟随 size(size=13 时恰好还原旧固定值 16/15/14,避免默认视觉漂移):
1529
+ // H1 = size+3 / lh+2,H2 = size+2 / lh,H3 = size+1 / lh-1
1530
+ const h1 = size + 3
1531
+ const h1lh = lh + 2
1532
+ const h2 = size + 2
1533
+ const h2lh = lh
1534
+ const h3 = size + 1
1535
+ const h3lh = lh - 1
1528
1536
  return [FONT_FACE_CSS,
1529
1537
  'body,body[data-ds-dark-theme]{',
1530
1538
  '--dsw-font-family:' + bodyFont + ';',
1531
1539
  '--ds-font-family-code:' + codeFont + ';',
1532
- // F4 新卡片字号(DSH 0.1.7 CodeCard .card/.body 只读此变量;size=13 默认恰好还原上游 11px/19px,跟随 11–18 档)
1540
+ // F4 新卡片字号(DSH 0.1.7 CodeCard .card/.body 只读此变量;size=13 默认恰好还原上游 11px/19px,跟随 11–24 档)
1533
1541
  '--dsw-font-markdown-code-block:' + (size - 2) + 'px/' + (size + 6) + 'px var(--ds-font-family-code);',
1534
1542
  '--dsw-font-markdown-base:' + size + 'px/' + lh + 'px var(--dsw-font-family);',
1535
1543
  '--dsw-font-markdown-base-font-size:' + size + 'px;',
1536
1544
  '--dsw-font-markdown-base-line-height:' + lh + 'px;',
1537
- '--dsw-font-markdown-h1:700 16px/24px var(--dsw-font-family);',
1538
- '--dsw-font-markdown-h1-font-size:16px;',
1539
- '--dsw-font-markdown-h1-line-height:24px;',
1540
- '--dsw-font-markdown-h2:700 15px/22px var(--dsw-font-family);',
1541
- '--dsw-font-markdown-h2-font-size:15px;',
1542
- '--dsw-font-markdown-h2-line-height:22px;',
1543
- '--dsw-font-markdown-h3:600 14px/21px var(--dsw-font-family);',
1544
- '--dsw-font-markdown-h3-font-size:14px;',
1545
- '--dsw-font-markdown-h3-line-height:21px;',
1545
+ '--dsw-font-markdown-h1:700 ' + h1 + 'px/' + h1lh + 'px var(--dsw-font-family);',
1546
+ '--dsw-font-markdown-h1-font-size:' + h1 + 'px;',
1547
+ '--dsw-font-markdown-h1-line-height:' + h1lh + 'px;',
1548
+ '--dsw-font-markdown-h2:700 ' + h2 + 'px/' + h2lh + 'px var(--dsw-font-family);',
1549
+ '--dsw-font-markdown-h2-font-size:' + h2 + 'px;',
1550
+ '--dsw-font-markdown-h2-line-height:' + h2lh + 'px;',
1551
+ '--dsw-font-markdown-h3:600 ' + h3 + 'px/' + h3lh + 'px var(--dsw-font-family);',
1552
+ '--dsw-font-markdown-h3-font-size:' + h3 + 'px;',
1553
+ '--dsw-font-markdown-h3-line-height:' + h3lh + 'px;',
1546
1554
  '--dsw-font-markdown-small:' + small + 'px/' + (small + 8) + 'px var(--dsw-font-family);',
1547
1555
  '--dsw-font-markdown-small-font-size:' + small + 'px;',
1548
1556
  '--dsw-font-markdown-small-line-height:' + (small + 8) + 'px;',
@@ -10023,7 +10031,7 @@ const STORAGE_KEY = 'dsh.opencode-palette.v2'
10023
10031
  const LEGACY_STORAGE_KEY = 'dsh.opencode-tui-theme.v2'
10024
10032
  const DEFAULT_STATE = { enabled: true, theme: 'opencode', mode: 'mono', size: 13, fontKey: 'JetBrains Mono' }
10025
10033
  // 构建时由 scripts/build-client.mjs 替换为 package.json 版本(面板底部署小字)
10026
- const PALETTE_VERSION = '2.0.5'
10034
+ const PALETTE_VERSION = '2.0.6'
10027
10035
 
10028
10036
  function getReact() {
10029
10037
  if (typeof require === 'function') { try { return require('react') } catch (e) { /* 动态版无 require */ } }
@@ -10560,6 +10568,36 @@ function createClient(slotTarget) {
10560
10568
  }, tr('fontRetry')) : null,
10561
10569
  ])
10562
10570
  : null
10571
+ // 分组标题:非点击的分区线(替代旧“本机字体 · 90”文本分隔)。
10572
+ // 文本用主题色 var(--dsw-alias-brand-primary)(随当前 opencode 主题走 primary),
10573
+ // 数量做成描边徽章 + 中间细分割线,不再用“·”拼接字符串。
10574
+ const secHeader = function (key, label, count) {
10575
+ const badge = (count === null || count === undefined) ? null : h('span', {
10576
+ key: 'n',
10577
+ style: {
10578
+ fontSize: 11, lineHeight: '16px', padding: '0 7px', borderRadius: 999,
10579
+ border: '1px solid var(--dsw-alias-brand-primary)',
10580
+ color: 'var(--dsw-alias-brand-primary)', background: 'transparent', flex: 'none',
10581
+ },
10582
+ }, String(count))
10583
+ return h('div', {
10584
+ key: key,
10585
+ style: {
10586
+ display: 'flex', alignItems: 'center', gap: 8,
10587
+ padding: '10px 10px 4px', cursor: 'default', userSelect: 'none',
10588
+ },
10589
+ }, [
10590
+ h('span', {
10591
+ key: 't',
10592
+ style: {
10593
+ fontSize: 11, fontWeight: 600, letterSpacing: '.08em', whiteSpace: 'nowrap',
10594
+ color: 'var(--dsw-alias-brand-primary)',
10595
+ },
10596
+ }, label),
10597
+ h('span', { key: 'l', style: { flex: '1 1 auto', height: 1, background: 'var(--dsw-alias-border-l1)', borderRadius: 1 } }),
10598
+ badge,
10599
+ ])
10600
+ }
10563
10601
  const menuItem = function (key, label, onClick) {
10564
10602
  return h('div', {
10565
10603
  key: key,
@@ -10576,11 +10614,11 @@ function createClient(slotTarget) {
10576
10614
  const locals = all.slice(0, 400)
10577
10615
  const rows = []
10578
10616
  if (presets.length > 0) {
10579
- rows.push(menuItem('sec-presets', tr('fontPresets'), function () {}))
10617
+ rows.push(secHeader('sec-presets', tr('fontPresets'), presets.length))
10580
10618
  for (const k of presets) rows.push(fontItem(k))
10581
10619
  }
10582
10620
  if (locals.length > 0) {
10583
- rows.push(menuItem('sec-locals', tr('fontLocals') + ' · ' + all.length, function () {}))
10621
+ rows.push(secHeader('sec-locals', tr('fontLocals'), all.length))
10584
10622
  for (const k of locals) rows.push(fontItem(k))
10585
10623
  }
10586
10624
  if (rows.length === 0) rows.push(menuItem('no-match', tr('fontNoMatch'), function () {}))
@@ -10838,20 +10876,26 @@ function createClient(slotTarget) {
10838
10876
  href: 'https://github.com/FeatherHunter/dsh-opencode-palette',
10839
10877
  target: '_blank', rel: 'noopener noreferrer',
10840
10878
  title: '你的 ⭐是我夜空中最亮的星 🌹',
10841
- style: { color: muted, display: 'inline-flex', cursor: 'pointer', fontSize: 15, lineHeight: 1, textDecoration: 'none' },
10842
- }, '🌟'),
10843
- // ISSUE 入口:消息气泡形态(信息图标认不出「提需求」,气泡才读得出是反馈)
10879
+ style: { display: 'inline-flex', cursor: 'pointer', lineHeight: 1, textDecoration: 'none' },
10880
+ }, h('svg', {
10881
+ width: 15, height: 15, viewBox: '0 0 24 24',
10882
+ style: { display: 'block' },
10883
+ }, h('path', {
10884
+ d: 'M12 2.5l2.92 6.14 6.58.6-4.93 4.4 1.42 6.46L12 16.77l-5.99 3.33 1.42-6.46-4.93-4.4 6.58-.6L12 2.5z',
10885
+ fill: '#FFC53D', stroke: '#B45309', strokeWidth: 1.5, strokeLinecap: 'round', strokeLinejoin: 'round',
10886
+ }))),
10887
+ // ISSUE 入口:彩色消息气泡(信息图标认不出「提需求」,气泡才读得出是反馈;浅底深底都可见的定值配色)
10844
10888
  h('a', {
10845
10889
  href: 'https://github.com/FeatherHunter/dsh-opencode-palette/issues',
10846
10890
  target: '_blank', rel: 'noopener noreferrer',
10847
10891
  title: '任何功能需求、故障、建议、意见都可以提ISSUE',
10848
- style: { color: muted, display: 'inline-flex', cursor: 'pointer' },
10892
+ style: { display: 'inline-flex', cursor: 'pointer' },
10849
10893
  }, h('svg', {
10850
- width: 14, height: 14, viewBox: '0 0 24 24', fill: 'none',
10851
- stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round',
10894
+ width: 14, height: 14, viewBox: '0 0 24 24',
10852
10895
  style: { display: 'block' },
10853
10896
  }, h('path', {
10854
10897
  d: 'M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z',
10898
+ fill: '#7DD3FC', stroke: '#0369A1', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round',
10855
10899
  }))),
10856
10900
  h('span', { style: { color: st.enabled ? 'var(--dsw-alias-state-success-primary)' : muted, fontSize: 12 } },
10857
10901
  st.enabled ? tr('enabled') : tr('disabled')),
@@ -10887,7 +10931,7 @@ function createClient(slotTarget) {
10887
10931
  ], function (v) { props.refresh(v, st.size, st.fontKey); setUi(props.getState()) }),
10888
10932
  dd(sizeOpen, setSizeOpen, sizeRef,
10889
10933
  h('span', null, tr('fontSize') + ' ' + st.size + 'px'),
10890
- [11, 12, 13, 14, 15, 16, 17, 18].map(function (s) {
10934
+ [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24].map(function (s) {
10891
10935
  const on = s === st.size
10892
10936
  return h('div', {
10893
10937
  key: String(s),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-opencode-palette",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "让 DeepSeek Harness 穿上 38 款经典皮肤——东京的霓虹夜色、德古拉的暗红月光、复古工坊的暖黄灯火、黑客帝国的数字雨、玫瑰松林间的风……一键换肤,即点即换,重启不丢。38 legendary skins for DeepSeek Harness — tokyonight's neon dusk, dracula's crimson moon, gruvbox's retro glow, the matrix's digital rain, rose-pine's rosewood calm… one click, instant, persisted.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -36,7 +36,7 @@
36
36
  "dsh-log": "0.2.1"
37
37
  },
38
38
  "engines": {
39
- "dsh": ">=0.1.0-rc.6 <0.2.0-0"
39
+ "dsh": ">=0.2.0-rc.1"
40
40
  },
41
41
  "dsh": {
42
42
  "bundle": {