@waterplus-ai/waterbuddy 0.1.78 → 0.1.79
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/index.js +12 -6
- package/package.json +1 -1
package/lib/client/index.js
CHANGED
|
@@ -555,8 +555,9 @@ window.__ModuleLoader__.load({
|
|
|
555
555
|
type: 'button',
|
|
556
556
|
onClick: openPanel,
|
|
557
557
|
title: user ? name : '登录 WaterBuddy',
|
|
558
|
-
|
|
559
|
-
|
|
558
|
+
'data-waterbuddy-account': '',
|
|
559
|
+
style: { display: 'flex', alignItems: 'center', gap: 8, flex: '0 0 auto', width: wide ? 'auto' : 40, maxWidth: wide ? 116 : 40, minHeight: 38, padding: wide ? '5px 9px 5px 6px' : 3, border: user ? '1px solid #e1eafa' : '1px solid transparent', borderRadius: 12, background: user ? '#f5f8ff' : 'transparent', color: 'var(--dsw-text-secondary, #586174)', cursor: 'pointer', textAlign: 'left', transition: 'background .15s ease, border-color .15s ease' },
|
|
560
|
+
children: [user ? jsx(UserAvatar, { user, size: 28 }) : jsx('img', { src: SSO.image, alt: SSO.title, style: { width: 28, height: 28, borderRadius: 8, objectFit: 'contain', padding: 2, boxSizing: 'border-box', flex: '0 0 auto', background: '#fff', border: '1px solid #dce9fb' } }), wide ? jsxs('span', { style: { minWidth: 0, display: 'grid', gap: 1 }, children: [jsx('strong', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', fontSize: 12.5, lineHeight: '16px', color: 'var(--dsw-text-primary, #1f2937)' }, children: user ? name : SSO.title }), jsx('small', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', color: exhausted ? '#b45309' : '#8a94a6', fontSize: 10.5, lineHeight: '14px' }, children: subtitle })] }) : null],
|
|
560
561
|
}),
|
|
561
562
|
open ? jsx('div', { style: { position: 'fixed', inset: 0, zIndex: 1000, background: 'rgba(15, 23, 42, .42)', backdropFilter: 'blur(5px)', display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 16 }, onClick: event => { if (event.target === event.currentTarget) setOpen(false) }, children: jsx('div', { style: { width: 420, maxWidth: 'calc(100vw - 32px)', borderRadius: 22, background: '#fff', overflow: 'hidden', boxShadow: '0 24px 80px rgba(15,23,42,.28)' }, children: user ? userPanel() : jsxs('div', { children: [
|
|
562
563
|
jsxs('div', { style: { position: 'relative', padding: '22px 26px 0', textAlign: 'center' }, children: [
|
|
@@ -1502,10 +1503,15 @@ window.__ModuleLoader__.load({
|
|
|
1502
1503
|
const style = document.createElement('style')
|
|
1503
1504
|
style.dataset.waterbuddy = 'sidebar-footer-layout'
|
|
1504
1505
|
style.textContent = [
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1506
|
+
// 底栏排成一行(账号卡在左、设置与桌宠在右)。
|
|
1507
|
+
//
|
|
1508
|
+
// 旧写法按 `.dshp-panel__foot-area` 这类类名选,而宿主与 dsh-better-sidebar 的类名
|
|
1509
|
+
// 都是**每次构建都变的哈希**(`nArs4W_panel…`,实测已无任何 foot 类),补丁因此静默
|
|
1510
|
+
// 失效、底栏又折行。改成用**我们自己的标记**定位:账号卡(`data-waterbuddy-account`)
|
|
1511
|
+
// 的父级就是底栏区,隔一层也是——`:has()` 在 Tauri 的 WebKit 上有。
|
|
1512
|
+
'*:has(> [data-waterbuddy-account]){flex-direction:row!important;align-items:center!important;flex-wrap:nowrap!important;gap:8px}',
|
|
1513
|
+
'*:has(> * > [data-waterbuddy-account]){flex-direction:row!important;align-items:center!important;flex-wrap:nowrap!important;gap:8px}',
|
|
1514
|
+
'*:has(> [data-waterbuddy-account])>*{min-width:0}',
|
|
1509
1515
|
].join('')
|
|
1510
1516
|
document.head.append(style)
|
|
1511
1517
|
return () => { style.remove() }
|