dsh-plugin-image-workbench 1.1.7 → 1.1.9

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-plugin-image-workbench",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "type": "module",
5
5
  "description": "Bluxe手绘工坊 · 生图工作台(图文 / 摄影):DSH 侧栏图像生成工作台,默认使用内置本地账号池,亦支持任意 OpenAI 兼容接口(Base URL / API Key / 模型);可自定义工作台名称与图片存储目录。",
6
6
  "main": "./host.js",
@@ -21,13 +21,15 @@
21
21
  letter-spacing:0;line-height:1.6;color:#1f9d6b;background:#e8f6ef;border:1px solid #bfe8d4;
22
22
  text-decoration:none;white-space:nowrap;transition:background .15s,color .15s}
23
23
  header .gh-link:hover{background:#d7efe2;color:#17845a}
24
- /* 顶部竖滚轮播提示条:标题右侧、操作按钮左侧的空白区 */
25
- .header-ad{flex:1 1 200px;min-width:0;max-width:440px;display:flex;align-items:center;gap:8px;
24
+ /* 顶部竖滚轮播提示条:标题右侧、操作按钮左侧。宽度贴合当前这条提示(跟着轮播伸缩),不拉满 */
25
+ .header-ad{flex:0 1 auto;min-width:0;max-width:440px;display:flex;align-items:center;gap:8px;
26
26
  margin:0 4px;height:30px;padding:0 10px;background:#f3fbf7;border:1px solid #d7efe2;border-radius:8px;overflow:hidden}
27
27
  .header-ad .ad-tag{flex:none;font-size:10px;font-weight:600;color:#fff;background:#1f9d6b;
28
28
  padding:2px 7px;border-radius:10px;letter-spacing:.5px}
29
- .header-ad .ad-view{flex:1;min-width:0;height:20px;overflow:hidden;position:relative}
30
- .header-ad .ad-track{display:flex;flex-direction:column;transition:transform .7s ease}
29
+ .header-ad .ad-view{flex:0 1 auto;min-width:0;height:20px;overflow:hidden;position:relative;
30
+ transition:width .45s ease}
31
+ /* width:max-content:每条按自己的文字撑开,宽度动画时不会互相挤出省略号 */
32
+ .header-ad .ad-track{display:flex;flex-direction:column;width:max-content;transition:transform .7s ease}
31
33
  .header-ad .ad-item{height:20px;line-height:20px;font-size:12px;color:#2f6b50;white-space:nowrap;
32
34
  overflow:hidden;text-overflow:ellipsis}
33
35
  /* 右上角「更多功能」下拉 */
@@ -286,6 +288,9 @@
286
288
  .pill{display:inline-flex;align-items:center;gap:6px;background:#f7f5ff;border:1px solid var(--line);
287
289
  border-radius:12px;padding:3px 9px;font-size:11px;color:var(--ink-2)}
288
290
  .footer-note{margin-top:12px;font-size:10.5px;color:var(--ink-3);line-height:1.6}
291
+ /* 左栏底部版本号:左栏与中/右栏同高,版本钉在卡片左下角 */
292
+ .panel.left{align-self:stretch;display:flex;flex-direction:column}
293
+ .ver-foot{margin-top:auto;padding-top:12px;font-size:11px;color:var(--ink-3);opacity:.7}
289
294
  .strip-wrap{display:flex;align-items:center;gap:6px}
290
295
  .strip{position:relative;flex:1;display:flex;gap:8px;overflow-x:auto;padding:6px 2px;min-height:100px;scroll-behavior:smooth}
291
296
  .strip::-webkit-scrollbar{height:8px}
@@ -348,10 +353,11 @@
348
353
  .head-acts .status{margin:0;max-width:220px;overflow:hidden;text-overflow:ellipsis;
349
354
  white-space:nowrap;font-size:11.5px;line-height:1.3}
350
355
  .head-acts .ha-sep{width:1px;height:20px;background:var(--line);margin:0 3px;flex:none}
351
- /* 空间不够时:提示条留在标题同一行的右侧空档,操作区独占第二行,别把标题挤变形 */
352
- @media (max-width:1360px){
356
+ /* 空间不够时:提示条留在标题同一行的右侧空档,操作区独占第二行,别把标题挤变形。
357
+ 断点 1520 = 单行放得下最长提示条(文字 306px + 外壳 65px)的宽度,再窄就换行。 */
358
+ @media (max-width:1520px){
353
359
  header{flex-wrap:wrap;row-gap:8px}
354
- .header-ad{order:1;flex:1 1 160px}
360
+ .header-ad{order:1;flex:0 1 auto}
355
361
  .head-acts{order:2;flex:1 0 100%;margin-left:0;flex-wrap:wrap;justify-content:flex-start}
356
362
  .head-acts .pool-chip{margin-left:auto}
357
363
  }
@@ -612,7 +618,7 @@
612
618
  <div class="header-ad" id="headerAd" title="使用提示">
613
619
  <span class="ad-tag">提示</span>
614
620
  <div class="ad-view"><div class="ad-track" id="adTrack">
615
- <div class="ad-item" id="adSamples" title="刚安装成功时,缩略图会在后台自动补齐,补完刷新就是真图">缩略图先同步,渐变是占位</div>
621
+ <div class="ad-item" id="adSamples" title="刚安装成功时,缩略图会在后台自动补齐,补完刷新就是真图">刚安装完需要点时间同步图型、风格、主题色缩略图。</div>
616
622
  <div class="ad-item">如果不知道怎么上手,可以试着直接点击「批量出图」。</div>
617
623
  <div class="ad-item">使用过程中有任何问题,可以多看看公众号详细介绍。</div>
618
624
  <div class="ad-item">如果发现其他问题,估计作者也搞不定,就直接问 AI 吧。</div>
@@ -668,6 +674,7 @@
668
674
  </div>
669
675
  <div class="status" id="splitStatus"></div>
670
676
  <div class="md" id="docRaw" style="display:none"></div>
677
+ <div class="ver-foot" id="verFoot" title="当前工作台版本"></div>
671
678
  </section>
672
679
 
673
680
  <!-- 配图工坊 -->
@@ -4682,22 +4689,39 @@ setInterval(refreshPool, 10000);
4682
4689
  if(items < 2) return;
4683
4690
  track.appendChild(track.children[0].cloneNode(true)); // 克隆首条,衔接更顺
4684
4691
  var h = 20, idx = 0, HOLD = 5200, EASE = 720;
4692
+
4693
+ /* 绿框宽度贴合当前这条提示的文字宽(每条长短不同,跟着轮播一起伸缩),
4694
+ 免得短提示后面拖一条空绿。track 是 width:max-content,
4695
+ 这里只需把 .ad-view 的宽度对准当前条,其余交给 CSS 过渡。 */
4696
+ var view = track.parentElement;
4697
+ function textW(el){
4698
+ var r = document.createRange(); r.selectNodeContents(el);
4699
+ return Math.ceil(r.getBoundingClientRect().width);
4700
+ }
4701
+ var ws = Array.prototype.map.call(track.children, textW);
4702
+ function fit(){ view.style.width = ws[idx] + 'px'; }
4703
+ view.style.transition = 'none'; // 首次直接落位,不播缩放入场
4704
+ fit();
4705
+ requestAnimationFrame(function(){ view.style.transition = ''; });
4706
+
4685
4707
  setInterval(function(){
4686
4708
  idx++;
4687
4709
  track.style.transform = 'translateY(' + (-idx*h) + 'px)';
4710
+ fit();
4688
4711
  if(idx === items){
4689
4712
  setTimeout(function(){
4690
4713
  track.style.transition = 'none';
4691
4714
  idx = 0;
4692
4715
  track.style.transform = 'translateY(0)';
4716
+ fit();
4693
4717
  void track.offsetHeight; // 强制回流后恢复过渡
4694
4718
  track.style.transition = '';
4695
4719
  }, EASE);
4696
4720
  }
4697
4721
  }, HOLD);
4698
4722
 
4699
- /* 缩略图那条只改 hover 文案、不动文字和节点:条数一变,上面的计数就错位,
4700
- 文字一长就被 440px 的框截成省略号。具体差多少张放在 title 里。 */
4723
+ /* 缩略图那条只改 hover 文案、不动文字和节点:条数一变,上面的位移计数就错位。
4724
+ 具体差多少张放在 title 里。 */
4701
4725
  var el = document.getElementById('adSamples');
4702
4726
  if(!el) return;
4703
4727
  fetch('/api/samples', {cache: 'no-store'})
@@ -4710,6 +4734,17 @@ setInterval(refreshPool, 10000);
4710
4734
  })
4711
4735
  .catch(function(){}); // 状态读不到就保持默认说明,不影响轮播
4712
4736
  })();
4737
+
4738
+ /* 左下角版本号:/health 返回插件版本(取自 package.json),读不到就留空 */
4739
+ (function(){
4740
+ fetch('/health', {cache: 'no-store'})
4741
+ .then(function(r){ return r.ok ? r.json() : null; })
4742
+ .then(function(d){
4743
+ var el = document.getElementById('verFoot');
4744
+ if (el && d && d.version) el.textContent = 'v' + d.version;
4745
+ })
4746
+ .catch(function(){});
4747
+ })();
4713
4748
  </script>
4714
4749
 
4715
4750
  <script>