@aicupa/plugin-todo-dependency 1.0.8 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/view/index.html +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicupa/plugin-todo-dependency",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Set and visualize dependencies between todo items",
5
5
  "description_zh": "设置并可视化待办事项之间的依赖关系",
6
6
  "main": "./service",
package/view/index.html CHANGED
@@ -51,7 +51,7 @@
51
51
  border: 2px solid #d9d9d9; border-radius: 10px;
52
52
  padding: 10px 12px; cursor: default;
53
53
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
54
- transition: box-shadow 0.2s, transform 0.15s;
54
+ transition: box-shadow 0.2s, transform 0.15s, opacity 0.25s;
55
55
  display: flex; align-items: flex-start; gap: 8px;
56
56
  }
57
57
  .node:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-1px); }
@@ -509,6 +509,7 @@
509
509
  return visited
510
510
  }
511
511
 
512
+ const nodeElList = []
512
513
  for (const id of nodeIds) {
513
514
  const pos = positions[id]; if (!pos) continue
514
515
  const todo = todoData[id]
@@ -521,8 +522,11 @@
521
522
  } else el.classList.add('not-found')
522
523
  el.style.cssText = `left:${pos.x}px;top:${pos.y}px;width:${NODE_W}px;`
523
524
  el.dataset.id = id
525
+ nodeElList.push({ id, el })
524
526
  el.addEventListener('mouseenter', () => {
525
527
  const chain = collectChain(id)
528
+ const svgRoot = document.getElementById('edgeSvg')
529
+ if (svgRoot) svgRoot.style.zIndex = '10'
526
530
  edgeEls.forEach(e => {
527
531
  if (chain.has(e.from) && chain.has(e.to)) {
528
532
  e.el.style.strokeWidth = '2.5'
@@ -531,12 +535,18 @@
531
535
  e.el.style.opacity = '0.15'
532
536
  }
533
537
  })
538
+ nodeElList.forEach(n => {
539
+ if (!chain.has(n.id)) n.el.style.opacity = '0.5'
540
+ })
534
541
  })
535
542
  el.addEventListener('mouseleave', () => {
543
+ const svgRoot = document.getElementById('edgeSvg')
544
+ if (svgRoot) svgRoot.style.zIndex = ''
536
545
  edgeEls.forEach(e => {
537
546
  e.el.style.strokeWidth = ''
538
547
  e.el.style.opacity = ''
539
548
  })
549
+ nodeElList.forEach(n => { n.el.style.opacity = '' })
540
550
  })
541
551
 
542
552
  if (todo) {