@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.
@@ -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,
@@ -340,8 +343,14 @@ const CanvasInner: React.FC = () => {
340
343
  }
341
344
 
342
345
  return (
343
- <div className="relative w-full h-[calc(100vh-56px)] overflow-hidden bg-[#fafafa] dark:bg-[#09090b]">
344
- <div className="absolute top-4 left-1/2 -translate-x-1/2 z-30 pointer-events-none">
346
+ <div className="relative w-full h-[calc(100vh-56px)] overflow-hidden bg-[#fafafa] dark:bg-[#09090b]">
347
+ <div
348
+ className={`absolute top-4 left-1/2 -translate-x-1/2 z-10 transition-all duration-200 pointer-events-none ${
349
+ editDrawerOpen || createDrawerOpen
350
+ ? "opacity-0 -translate-y-6 scale-95 pointer-events-none"
351
+ : "opacity-100"
352
+ }`}
353
+ >
345
354
  <CanvasDock
346
355
  salesChannels={salesChannels}
347
356
  selectedStorefront={selectedStorefront}
@@ -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
  />