@hectasquare/medusa-plugin-category-tree 1.0.2 → 1.0.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.
@@ -159,18 +159,27 @@ export function computeTreeLayout(
159
159
  collect(tree)
160
160
  })
161
161
 
162
- // Style edges to match source branch color if available
162
+ // Style edges to match branch color
163
163
  const styledEdges: Edge[] = edges.map((e) => {
164
164
  const sourceNode = nodeMap.get(e.source)
165
- const branchColor = (sourceNode?.data as any)?.branchColor || "#64748b"
165
+ const targetNode = nodeMap.get(e.target)
166
+ const branchColor =
167
+ (e.data as any)?.branchColor ||
168
+ (targetNode?.data as any)?.branchColor ||
169
+ (sourceNode?.data as any)?.branchColor ||
170
+ "#64748b"
166
171
 
167
172
  return {
168
173
  ...e,
174
+ data: {
175
+ ...e.data,
176
+ branchColor,
177
+ },
169
178
  style: {
179
+ ...e.style,
170
180
  stroke: branchColor,
171
181
  strokeWidth: 2,
172
- opacity: 0.85,
173
- ...e.style,
182
+ opacity: 0.95,
174
183
  },
175
184
  }
176
185
  })