@zaofan/dsh-qqbot 1.11.7 → 1.11.8

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.
@@ -587,14 +587,11 @@ window.__ModuleLoader__.load({
587
587
  if (document.getElementById(EXT_UI_CSS_ID)) return
588
588
  var s = document.createElement('style')
589
589
  s.id = EXT_UI_CSS_ID
590
- s.textContent = ''
591
- + '.qqs-ext-cards{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;'
592
- + '-webkit-overflow-scrolling:touch;scrollbar-width:none;'
593
- + 'scroll-snap-type:x proximity;padding:2px 0 6px}'
594
- + '.qqs-ext-cards::-webkit-scrollbar{display:none}'
595
- + '.qqs-ext-card{flex:0 0 auto;scroll-snap-align:start;min-width:220px;max-width:320px}'
596
- + '.qqs-top-tabs{scrollbar-width:none}'
590
+ // ★ 2026-10-27:内嵌卡片那条已删(改顶栏页签),这里只留页签/整页卡片需要的样式
591
+ s.textContent =
592
+ '.qqs-top-tabs{scrollbar-width:none}'
597
593
  + '.qqs-top-tabs::-webkit-scrollbar{display:none}'
594
+ + '.qqs-ext-card{flex:0 0 auto;scroll-snap-align:start;min-width:220px;max-width:320px}'
598
595
  + '.qqs-ext-page-card{display:block;min-width:260px}'
599
596
  document.head.appendChild(s)
600
597
  // 鼠标滚轮 → 横向滚动(2026-10-26 主人实测"不能横滑"):
@@ -1226,12 +1223,7 @@ window.__ModuleLoader__.load({
1226
1223
  // ② 扩展脚本报错只白自己那张卡,不整页崩
1227
1224
  var EXT_UI_LIST = '/api/qqbot-settings/ext-ui/list'
1228
1225
  var EXT_UI_FILE = '/api/qqbot-settings/ext-ui/file?f='
1229
- function extUiText(extId, f) {
1230
- return fetch(EXT_UI_FILE + encodeURIComponent(f) + '&id=' + encodeURIComponent(extId))
1231
- .then(function (r) { return r.json() })
1232
- .then(function (j) { return j && j.ok ? String(j.text || '') : '' })
1233
- .catch(function () { return '' })
1234
- }
1226
+ // ★ 2026-10-27 删:extUiText 只被 mountExtUiCards 用过(已删),成死代码。
1235
1227
  function extUiApi(extId) {
1236
1228
  return {
1237
1229
  extId: extId,
@@ -1265,46 +1257,11 @@ window.__ModuleLoader__.load({
1265
1257
  + '.qqs-ext-page-card{display:block}'
1266
1258
  document.head.appendChild(s)
1267
1259
  }
1268
- function mountExtUiCards() {
1269
- injectExtUiCss()
1270
- var box = document.getElementById('qqs-ext-cards')
1271
- if (!box) return
1272
- fetch(EXT_UI_LIST).then(function (r) { return r.json() }).then(function (j) {
1273
- if (!j || !j.ok) return
1274
- var list = (j.items || []).filter(function (x) { return x.slot === 'settings' })
1275
- if (!list.length) { box.style.display = 'none'; return }
1276
- box.style.display = ''
1277
- // 幂等:卡片数量没变就不重挂(避免每次 setState 都把扩展的 DOM 冲掉)
1278
- var sig = list.map(function (x) { return x.extId }).join(',')
1279
- if (box.getAttribute('data-sig') === sig) return
1280
- box.setAttribute('data-sig', sig)
1281
- box.innerHTML = ''
1282
- list.forEach(function (it) {
1283
- var host = document.createElement('div')
1284
- host.className = 'qqs-ext-card'
1285
- var sr = host.attachShadow({ mode: 'open' })
1286
- box.appendChild(host)
1287
- Promise.all([
1288
- extUiText(it.extId, 'card.html'),
1289
- it.files && it.files.indexOf('card.css') >= 0 ? extUiText(it.extId, 'card.css') : Promise.resolve(''),
1290
- it.files && it.files.indexOf('card.js') >= 0 ? extUiText(it.extId, 'card.js') : Promise.resolve(''),
1291
- ]).then(function (res) {
1292
- sr.innerHTML = '<style>' + (res[1] || '') + '</style>' + (res[0] || '')
1293
- if (!res[2]) return
1294
- try {
1295
- // Function 而不是 eval:作用域干净,且把 qqbotExt 作为形参传进去
1296
- new Function('qqbotExt', 'shadowRoot', res[2])(extUiApi(it.extId), sr)
1297
- } catch (e) {
1298
- var d = document.createElement('div')
1299
- d.style.cssText = 'color:#c33;font-size:12px;padding:4px 0'
1300
- d.textContent = '卡片脚本出错: ' + (e && e.message ? e.message : e)
1301
- sr.appendChild(d)
1302
- }
1303
- })
1304
- })
1305
- }).catch(function () { /* 静默:扩展 UI 挂了不该影响设置页本体 */ })
1306
- }
1307
- setTimeout(function () { try { mountExtUiCards() } catch (e) { /* ignore */ } }, 0)
1260
+ // ★ 2026-10-27 删:这是第一版「把扩展卡片内嵌在设置页内容区」的实现。
1261
+ // 后来改成顶栏页签(ExtCardPage + Shadow DOM),两套并存会导致
1262
+ // 同一张卡在设置页出现两次;而且这里用的还是闭包内那个旧 extUiApi
1263
+ // (没有 getConfig/setConfig)→ 卡片报 'qqbotExt.getConfig is not a function'。
1264
+ // 统一走顶栏页签后删掉。
1308
1265
 
1309
1266
  return h('div', { style: { maxWidth: 720 } },
1310
1267
  h('h2', { style: { margin: '0 0 6px' } }, 'QQ 机器人设置'),
@@ -1317,8 +1274,8 @@ window.__ModuleLoader__.load({
1317
1274
  h(SButton, { variant: 'ghost', onClick: load }, '放弃修改(重新读取)'),
1318
1275
  msg ? h('span', { style: { fontSize: 13, color: T.text2 } }, msg) : null,
1319
1276
  close ? h(SButton, { variant: 'ghost', onClick: close }, '完成') : null),
1320
- // ★ 扩展卡片挂载点:横向可滑动,样式见文件末尾注入的 .qqs-ext-cards
1321
- h('div', { id: 'qqs-ext-cards', className: 'qqs-ext-cards' }))
1277
+ // ★ 2026-10-27:这里原来挂 #qqs-ext-cards(内嵌卡片),已改为顶栏页签,容器不需要了
1278
+ null)
1322
1279
  }
1323
1280
 
1324
1281
  // ── ⑥ QQ 群管理(单开大卡片; P3+ 设计系统版: 横排 Tab + 状态条 + 表格 + 空状态 + 预留接口位) ──
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaofan/dsh-qqbot",
3
- "version": "1.11.7",
3
+ "version": "1.11.8",
4
4
  "description": "QQ Bot IM channel plugin for deepseek-harness (dsh)",
5
5
  "type": "module",
6
6
  "main": "./entry.js",