@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.
- package/.medusa/server/src/admin/components/category-tree/category-products-manager.d.ts +8 -0
- package/.medusa/server/src/admin/components/category-tree/category-products-manager.js +290 -0
- package/.medusa/server/src/admin/components/category-tree/category-tree-canvas.js +6 -1
- package/.medusa/server/src/admin/components/category-tree/custom-edge.js +5 -3
- package/.medusa/server/src/admin/components/category-tree/edit-category-drawer.js +88 -8
- package/.medusa/server/src/admin/components/category-tree/lib/layout-engine.js +12 -4
- package/LICENSE +190 -0
- package/README.md +102 -120
- package/package.json +12 -3
- package/src/admin/components/category-tree/category-products-manager.tsx +749 -0
- package/src/admin/components/category-tree/category-tree-canvas.tsx +11 -2
- package/src/admin/components/category-tree/custom-edge.tsx +6 -2
- package/src/admin/components/category-tree/edit-category-drawer.tsx +427 -166
- package/src/admin/components/category-tree/lib/layout-engine.ts +13 -4
|
@@ -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
|
-
|
|
344
|
-
<div
|
|
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 ? "
|
|
45
|
-
strokeWidth: selected ? 2.
|
|
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
|
/>
|