@hectasquare/medusa-plugin-category-tree 1.0.2 → 1.0.5

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.
@@ -228,6 +228,9 @@ const CanvasInner: React.FC = () => {
228
228
  source: cat.parent_category_id,
229
229
  target: cat.id,
230
230
  type: "smoothstep",
231
+ data: {
232
+ branchColor: cat.branch_color,
233
+ },
231
234
  style: {
232
235
  stroke: cat.branch_color || "#64748b",
233
236
  strokeWidth: 2,
@@ -11,10 +11,13 @@ export const CustomSmoothStepEdge = memo((props: EdgeProps) => {
11
11
  sourcePosition,
12
12
  targetPosition,
13
13
  style = {},
14
+ data,
14
15
  markerEnd,
15
16
  selected,
16
17
  } = props
17
18
 
19
+ const branchColor = (data as any)?.branchColor || (style as any)?.stroke || "#64748b"
20
+
18
21
  const [edgePath] = getSmoothStepPath({
19
22
  sourceX,
20
23
  sourceY,
@@ -41,8 +44,9 @@ export const CustomSmoothStepEdge = memo((props: EdgeProps) => {
41
44
  markerEnd={markerEnd}
42
45
  style={{
43
46
  ...style,
44
- stroke: selected ? "var(--bg-interactive, #3b82f6)" : "var(--border-strong, #cbd5e1)",
45
- strokeWidth: selected ? 2.5 : 1.75,
47
+ stroke: selected ? "#2563eb" : branchColor,
48
+ strokeWidth: selected ? 2.75 : 2,
49
+ strokeOpacity: 0.95,
46
50
  transition: "stroke 0.2s, stroke-width 0.2s",
47
51
  }}
48
52
  />