dsh-skill-hub 0.3.2 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-skill-hub",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "In-GUI skill hub for DeepSeek Harness (dsh): browse the full local skill catalog from the official ctx.skills registry (every root + third-party providers), toggle skills on/off, inspect bodies, surface frontmatter diagnostics, and scaffold new skills — plus a codex-style skill market (built-in catalog, upstream update checks, one-click update-all) with tracked source sync. The full manager beyond the read-only dsh-skill-manager browser.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -129,34 +129,34 @@ function injectDotsViaDOM(modelByName: Map<string, boolean>, modelColor: string,
129
129
  const run = (): void => {
130
130
  const options = document.querySelectorAll('[role="option"]')
131
131
  for (const opt of options) {
132
- // 已注入则跳过(由 data 属性标记)
133
132
  if (opt.querySelector('[data-skill-dot]') !== null) continue
134
- // 技能名在 .itemName 中,取文本匹配 catalog
135
133
  const nameEl = opt.querySelector('[class*="itemName"]') as HTMLElement | null
136
134
  if (nameEl === null) continue
137
135
  const name = (nameEl.textContent ?? '').trim()
138
136
  if (name.length === 0) continue
139
- if (!modelByName.has(name) && nameEl.textContent !== name) continue // 保守:仅处理已知名
140
137
  const color = (modelByName.get(name) ?? true) ? modelColor : userColor
138
+ // 复刻旧版 icon 槽:16×16 容器居中 6px 点,与升级前 `dotIcon` 在 `itemIcon` 内的效果一致
139
+ const wrapper = document.createElement('span')
140
+ wrapper.setAttribute('data-skill-dot', '')
141
+ wrapper.setAttribute('aria-hidden', 'true')
142
+ wrapper.style.width = '16px'
143
+ wrapper.style.height = '16px'
144
+ wrapper.style.display = 'inline-flex'
145
+ wrapper.style.justifyContent = 'center'
146
+ wrapper.style.alignItems = 'center'
147
+ wrapper.style.flex = 'none'
141
148
  const dot = document.createElement('span')
142
- dot.setAttribute('data-skill-dot', '')
143
- dot.setAttribute('aria-hidden', 'true')
144
149
  dot.style.display = 'inline-block'
145
150
  dot.style.width = '6px'
146
151
  dot.style.height = '6px'
147
152
  dot.style.borderRadius = '3px'
148
153
  dot.style.background = color
149
154
  dot.style.flex = 'none'
150
- // 插在名称前;若存在 icon 槽则插在其后,兼容旧版结构
151
- const iconEl = opt.querySelector('[class*="itemIcon"]')
152
- if (iconEl !== null && iconEl.nextSibling !== null) {
153
- iconEl.parentElement?.insertBefore(dot, iconEl.nextSibling)
154
- } else {
155
- nameEl.parentElement?.insertBefore(dot, nameEl)
156
- }
155
+ wrapper.appendChild(dot)
156
+ // 新版无 icon 槽,直接插在名称前,与旧版 `itemIcon` 位置一致
157
+ nameEl.parentElement?.insertBefore(wrapper, nameEl)
157
158
  }
158
159
  }
159
- // 菜单由 React 异步渲染,需等下一帧
160
160
  requestAnimationFrame(() => setTimeout(run, 0))
161
161
  }
162
162