dsh-pighub 0.9.67 → 0.9.68

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
@@ -127,6 +127,13 @@ window.__ModuleLoader__.load({
127
127
  'overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-text-secondary,#9aa4b2)}',
128
128
  '.pighub-gallery-cell.is-locked .pighub-gallery-name{letter-spacing:.12em;color:var(--dsw-alias-text-tertiary,#6b7280)}',
129
129
  '.pighub-gallery-stars{font-size:10px;line-height:1;color:#e8b64c;letter-spacing:.06em}',
130
+ // 主题二级菜单:收起时高度 0,展开用 max-height + opacity 过渡(用户口径 2026-11-14:要平滑动画)
131
+ '.pighub-themelist{max-height:0;opacity:0;overflow:hidden;transition:max-height .2s ease,opacity .2s ease,margin .2s ease;margin:0}',
132
+ '.pighub-themelist.is-open{max-height:240px;opacity:1;margin:4px 0}',
133
+ '.pighub-themerow{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:3px 0}',
134
+ '.pighub-themedel{font-size:11px;padding:2px 8px;border-radius:999px;cursor:pointer;color:#f0b7b7;',
135
+ 'background:transparent;border:1px solid color-mix(in oklab,#7a3b3b 70%,transparent)}',
136
+ '.pighub-themedel.is-disabled{color:var(--dsw-alias-text-tertiary,#6b7280);border-color:transparent;cursor:default}',
130
137
  // 图鉴用的次级按钮(不复用 pighub-iconbtn:那是设置齿轮的专属样式,测试也按它选)
131
138
  // 图鉴按钮排在设置之后(测试按第一个图标按钮选设置),靠 order 摆到左边
132
139
  '.pighub-settings .pighub-ghostbtn{order:-1}',
@@ -737,7 +744,10 @@ window.__ModuleLoader__.load({
737
744
  const name = theme && theme.name ? String(theme.name) : 'classic';
738
745
  const fence = (theme && theme.fence) || {};
739
746
  const file = (which === 'front' ? fence.front : fence.back) || fence.image || '';
740
- if (!file) return '/pighub/pen/pen-fence.png';
747
+ /* classic 的图**不在** assets/themes/classic 里,而是在包内 assets/img,由 /pighub/pen 服务。
748
+ * 早先这里统一拼 /pighub/theme/classic/pen-fence.png → 404 → 默认主题根本没有栏杆
749
+ * (用户 2026-11-14 报「默认的栏杆也没有」)。 */
750
+ if (!file || name === 'classic') return '/pighub/pen/' + encodeURIComponent(file || 'pen-fence.png');
741
751
  return '/pighub/theme/' + encodeURIComponent(name) + '/' + encodeURIComponent(String(file));
742
752
  }
743
753
 
@@ -1718,15 +1728,21 @@ window.__ModuleLoader__.load({
1718
1728
  onClick: () => setThemeMenuOpen((open) => !open),
1719
1729
  }, themeMenuOpen ? '收起' : '更换…'),
1720
1730
  ),
1721
- themeMenuOpen
1722
- ? h('div', { className: 'pighub-themelist' },
1731
+ h('div', { className: 'pighub-themelist' + (themeMenuOpen ? ' is-open' : '') },
1723
1732
  ((data && data.themes) || [{ name: 'classic', title: 'classic(默认)' }]).map((item) =>
1724
1733
  h('div', { key: 'theme-row-' + item.name, className: 'pighub-themerow' },
1725
1734
  h('button', {
1726
1735
  type: 'button',
1727
1736
  className: 'pighub-ghostbtn',
1728
1737
  'aria-pressed': activeTheme.name === item.name ? 'true' : 'false',
1729
- onClick: () => { request({ action: 'theme', name: item.name }).then(apply).catch(() => {}); },
1738
+ onClick: () => {
1739
+ request({ action: 'theme', name: item.name })
1740
+ .then((payload) => {
1741
+ if (payload && payload.ok === false) { set({ phase: 'error', error: String(payload.error || 'theme_failed') }); return; }
1742
+ return load();
1743
+ })
1744
+ .catch((error) => set({ phase: 'error', error: String((error && error.message) || error) }));
1745
+ },
1730
1746
  }, (activeTheme.name === item.name ? '✓ ' : '') + (item.title || item.name)),
1731
1747
  item.name === 'classic'
1732
1748
  ? h('span', { className: 'pighub-themedel is-disabled' }, '内置')
@@ -1734,12 +1750,18 @@ window.__ModuleLoader__.load({
1734
1750
  type: 'button',
1735
1751
  className: 'pighub-themedel',
1736
1752
  title: '删除这个主题(当前主题会回落 classic)',
1737
- onClick: () => { request({ action: 'theme-delete', name: item.name }).then(apply).catch(() => {}); },
1753
+ onClick: () => {
1754
+ request({ action: 'theme-delete', name: item.name })
1755
+ .then((payload) => {
1756
+ if (payload && payload.ok === false) { set({ phase: 'error', error: String(payload.error || 'theme_delete_failed') }); return; }
1757
+ return load();
1758
+ })
1759
+ .catch((error) => set({ phase: 'error', error: String((error && error.message) || error) }));
1760
+ },
1738
1761
  }, '删除'),
1739
1762
  ),
1740
1763
  ),
1741
- )
1742
- : null,
1764
+ ),
1743
1765
  /* 「更换主题包」:用隐藏的 <input type=file accept=.zip> 唤起系统文件选择器(Electron 里就是原生对话框),
1744
1766
  * 选中的 zip 原样 POST 到 /pighub/theme-import;宿主校验并解压后**自动切到新主题**,这里只负责刷新快照。 */
1745
1767
  h('div', { className: 'row' },
package/lib/index.js CHANGED
@@ -44,7 +44,7 @@ export const inject = ['tools'];
44
44
  import { startDesktopPet, stopDesktopPet, syncDesktopPet, desktopPetState, sayOnDesktop, reclaimStaleSessions } from './desktop-pet.js';
45
45
 
46
46
  const here = dirname(fileURLToPath(import.meta.url));
47
- const VERSION = '0.9.67';
47
+ const VERSION = '0.9.68';
48
48
  /** 桌面桌宠的精灵边长(CSS px 基准,= manifest 里 sizeRatio 的中位数)。 */
49
49
  const DESKTOP_PET_SIZE = 96;
50
50
  /** 全局尺寸系数(用户口径 2026-11-13:「整体猪猪缩小到 75% 大小」)。三层一起乘。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-pighub",
3
- "version": "0.9.67",
3
+ "version": "0.9.68",
4
4
  "description": "猪猪库 PigHub 的 DeepSeek Harness 插件:侧边栏猪圈面板、每日一只猪猪、重复获得升星、可拖出的置顶桌宠,数据落在 ~/.PigHub。不内嵌任何上游图片。",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",