@240xu/dsh-message-ops 0.11.5 → 0.11.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/client.js +20 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@240xu/dsh-message-ops",
3
- "version": "0.11.5",
3
+ "version": "0.11.6",
4
4
  "description": "DSH web 插件:消息级回滚 / 删除 / 恢复(补 dsh 官方没有的部分)。分支与导出用官方内置能力。",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/client.js CHANGED
@@ -425,13 +425,25 @@ window.__ModuleLoader__.load({
425
425
  }
426
426
 
427
427
  // 头部按钮图标:三叉分支(git-branch 风格,16x16)。
428
- const BRANCH_PATH = 'M5 2.5a2 2 0 1 1-.9 3.78v3.44a2 2 0 1 1-1.2 0V6.28A2 2 0 1 1 5 2.5Zm0 1.2a.8.8 0 1 0 0 1.6.8.8 0 0 0 0-1.6ZM3.5 11.5a.8.8 0 1 0 1.6 0 .8.8 0 0 0-1.6 0ZM12.5 2.5a2 2 0 0 1 .6 3.9v.85c0 1.9-1.54 3.44-3.44 3.44H8.03a2 2 0 1 1 0-1.2h1.63a2.24 2.24 0 0 0 2.24-2.24V6.4a2 2 0 0 1 .6-3.9Zm0 1.2a.8.8 0 1 0 0 1.6.8.8 0 0 0 0-1.6Z'
428
+ // ⚠️ 这条 path 是按**描边**(stroke)设计的:圆点用 arc 画、连接线用
429
+ // `v3.44` / `V6.28` / `v.85` 这类**零宽度线段**。若用 fill 渲染,线段没有
430
+ // 面积 → 整条分支线消失,只剩几个孤立色块(0.11.x 实测症状:
431
+ // 「那个 svg 渲染有问题」)。必须 stroke + round cap/join。
432
+ const BRANCH_PATHS = [
433
+ 'M5 2.5a2 2 0 1 1-.9 3.78v3.44a2 2 0 1 1-1.2 0V6.28A2 2 0 1 1 5 2.5Zm0 1.2a.8.8 0 1 0 0 1.6.8.8 0 0 0 0-1.6ZM3.5 11.5a.8.8 0 1 0 1.6 0 .8.8 0 0 0-1.6 0ZM12.5 2.5a2 2 0 0 1 .6 3.9v.85c0 1.9-1.54 3.44-3.44 3.44H8.03a2 2 0 1 1 0-1.2h1.63a2.24 2.24 0 0 0 2.24-2.24V6.4a2 2 0 0 1 .6-3.9Zm0 1.2a.8.8 0 1 0 0 1.6.8.8 0 0 0 0-1.6Z',
434
+ ]
429
435
 
430
436
  function BranchIcon() {
431
437
  return React.createElement('svg', {
432
438
  width: 16, height: 16, viewBox: '0 0 16 16', fill: 'none',
433
439
  xmlns: 'http://www.w3.org/2000/svg',
434
- }, React.createElement('path', { d: BRANCH_PATH, fill: 'currentColor' }))
440
+ 'aria-hidden': 'true', focusable: 'false',
441
+ }, React.createElement('path', {
442
+ d: BRANCH_PATHS[0],
443
+ stroke: 'currentColor', strokeWidth: 1.4,
444
+ strokeLinecap: 'round', strokeLinejoin: 'round',
445
+ fill: 'none',
446
+ }))
435
447
  }
436
448
 
437
449
  // --- 共享对话框 -------------------------------------------------------------
@@ -758,8 +770,11 @@ window.__ModuleLoader__.load({
758
770
  const tag = document.createElement('style')
759
771
  tag.id = 'dsh-message-ops-panel-style'
760
772
  tag.textContent = [
761
- '.mopsPanelScrim{position:fixed;inset:0;z-index:1200;background:rgba(15,17,21,.18);display:flex;justify-content:flex-end}',
762
- '.mopsPanel{width:560px;max-width:100vw;height:100%;display:flex;flex-direction:column;background:var(--dsw-alias-bg-primary,#fff);color:var(--dsw-alias-label-primary,#0f1115);border-left:1px solid var(--dsw-alias-border-l2,#e6e6e6);box-shadow:-16px 0 48px rgba(15,17,21,.14);font-family:inherit;font-size:13px;line-height:1.45}',
773
+ '.mopsPanelScrim{position:fixed;inset:0;z-index:1200;background:rgba(15,17,21,.28);display:flex;align-items:center;justify-content:center;padding:24px;animation:mopsFade .12s ease-out}',
774
+ '@keyframes mopsFade{from{opacity:0}to{opacity:1}}',
775
+ '@keyframes mopsRise{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}',
776
+ '.mopsPanel{width:560px;max-width:min(560px,100%);height:min(760px,100%);max-height:100%;display:flex;flex-direction:column;background:var(--dsw-alias-bg-primary,#fff);color:var(--dsw-alias-label-primary,#0f1115);border:1px solid var(--dsw-alias-border-l2,#e6e6e6);box-shadow:0 24px 64px rgba(15,17,21,.24);font-family:inherit;font-size:13px;line-height:1.45;animation:mopsRise .16s cubic-bezier(.2,.8,.3,1)}',
777
+ '@media(prefers-reduced-motion:reduce){.mopsPanelScrim,.mopsPanel{animation:none}}',
763
778
  '.mopsPanel *{box-sizing:border-box}',
764
779
  '.mopsPanel button{font:inherit;color:inherit;border-radius:0}',
765
780
  '.mopsPanelHead{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 18px 12px;border-bottom:1px solid var(--dsw-alias-border-l2,#e6e6e6)}',
@@ -825,7 +840,7 @@ window.__ModuleLoader__.load({
825
840
  '.mopsTrashMain{flex:1;min-width:0}',
826
841
  '.mopsTrashTitle{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
827
842
  '.mopsTrashMeta{font-size:10px;color:var(--dsw-alias-label-tertiary,#8a8a8e);margin-top:2px}',
828
- '@media(max-width:760px){.mopsPanel{width:100vw;border-left:0}.mopsDetail{max-height:42%}}',
843
+ '@media(max-width:760px){.mopsPanelScrim{padding:0}.mopsPanel{width:100%;height:100%;max-width:100%;max-height:100%;border:0}.mopsDetail{max-height:42%}}',
829
844
  ].join('')
830
845
  document.head.appendChild(tag)
831
846
  } catch { /* style failure must not break the panel */ }