@designa8/vibedesign-stripe-deepseek-85ea 0.1.0 → 0.1.1
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/README.md +1 -1
- package/dist/index.cjs +39 -21
- package/dist/index.js +39 -21
- package/package.json +1 -1
- package/src/atoms/PaymentRoutingCanvas/PaymentRoutingCanvas.tsx +26 -8
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @designa8/vibedesign-stripe-deepseek-85ea
|
|
2
2
|
|
|
3
|
-
Complete design system generated by Atoms Design, version **0.1.
|
|
3
|
+
Complete design system generated by Atoms Design, version **0.1.1**.
|
|
4
4
|
Tokens, atoms, molecules, organisms, and templates — import from the package root;
|
|
5
5
|
never hardcode visual values in consumer code.
|
|
6
6
|
|
package/dist/index.cjs
CHANGED
|
@@ -12277,6 +12277,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12277
12277
|
const [panelOpen, setPanelOpen] = React62.useState(true);
|
|
12278
12278
|
const [zoom, setZoom] = React62.useState(1);
|
|
12279
12279
|
const [fit, setFit] = React62.useState(1);
|
|
12280
|
+
const [planeHeight, setPlaneHeight] = React62.useState(PLANE_H);
|
|
12280
12281
|
const [pan, setPan] = React62.useState({ x: 0, y: 0 });
|
|
12281
12282
|
const [issuesOpen, setIssuesOpen] = React62.useState(false);
|
|
12282
12283
|
const [priority, setPriority] = React62.useState([
|
|
@@ -12303,8 +12304,16 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12303
12304
|
if (!plane) return;
|
|
12304
12305
|
const measure = () => {
|
|
12305
12306
|
const width = plane.clientWidth;
|
|
12306
|
-
|
|
12307
|
-
|
|
12307
|
+
const height = plane.clientHeight;
|
|
12308
|
+
if (!width || !height) return;
|
|
12309
|
+
setFit(
|
|
12310
|
+
Math.min(
|
|
12311
|
+
1,
|
|
12312
|
+
(width - PLANE_PAD * 2) / SCENE_W,
|
|
12313
|
+
(height - PLANE_PAD * 2) / SCENE_H
|
|
12314
|
+
)
|
|
12315
|
+
);
|
|
12316
|
+
setPlaneHeight(height);
|
|
12308
12317
|
};
|
|
12309
12318
|
measure();
|
|
12310
12319
|
const observer = new ResizeObserver(measure);
|
|
@@ -12476,7 +12485,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12476
12485
|
else if (ref) ref.current = node;
|
|
12477
12486
|
},
|
|
12478
12487
|
className: cn54(
|
|
12479
|
-
"flex w-full flex-col overflow-hidden rounded-lg border border-hairline bg-surface shadow-card",
|
|
12488
|
+
"flex min-h-0 w-full flex-col overflow-hidden rounded-lg border border-hairline bg-surface shadow-card",
|
|
12480
12489
|
className
|
|
12481
12490
|
),
|
|
12482
12491
|
"data-simulating": replaying || void 0,
|
|
@@ -12532,7 +12541,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12532
12541
|
] })
|
|
12533
12542
|
] }),
|
|
12534
12543
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex min-h-0 flex-1 items-stretch", children: [
|
|
12535
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
12544
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
12536
12545
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
12537
12546
|
"div",
|
|
12538
12547
|
{
|
|
@@ -12558,11 +12567,13 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12558
12567
|
}
|
|
12559
12568
|
},
|
|
12560
12569
|
className: cn54(
|
|
12561
|
-
"relative min-w-0 flex-1 cursor-grab overflow-hidden bg-canvas",
|
|
12570
|
+
"relative min-h-0 min-w-0 flex-1 cursor-grab overflow-hidden bg-canvas",
|
|
12562
12571
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue focus-visible:ring-inset"
|
|
12563
12572
|
),
|
|
12564
12573
|
style: {
|
|
12565
|
-
height
|
|
12574
|
+
// Grows with the host height, never collapses below the
|
|
12575
|
+
// stand-alone look when the parent has no explicit height.
|
|
12576
|
+
minHeight: PLANE_H,
|
|
12566
12577
|
backgroundImage: "radial-gradient(var(--color-hairline) 1px, transparent 1px)",
|
|
12567
12578
|
backgroundSize: "16px 16px"
|
|
12568
12579
|
},
|
|
@@ -12574,7 +12585,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12574
12585
|
style: {
|
|
12575
12586
|
width: SCENE_W,
|
|
12576
12587
|
height: SCENE_H,
|
|
12577
|
-
transform: `translate(${PLANE_PAD + pan.x}px, ${Math.max((
|
|
12588
|
+
transform: `translate(${PLANE_PAD + pan.x}px, ${Math.max((planeHeight - SCENE_H * scale) / 2, 0) + pan.y}px) scale(${scale})`,
|
|
12578
12589
|
transformOrigin: "0 0",
|
|
12579
12590
|
transition: "transform 200ms ease-out"
|
|
12580
12591
|
},
|
|
@@ -12735,22 +12746,29 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12735
12746
|
] })
|
|
12736
12747
|
] })
|
|
12737
12748
|
] }),
|
|
12738
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12739
|
-
|
|
12749
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12750
|
+
"div",
|
|
12740
12751
|
{
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
+
className: "flex min-h-0 shrink-0 flex-col self-stretch border-l border-hairline",
|
|
12753
|
+
style: { width: PANEL_W },
|
|
12754
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
12755
|
+
NodeConfigPanel,
|
|
12756
|
+
{
|
|
12757
|
+
open: panelOpen,
|
|
12758
|
+
nodeType: focusedNode?.type ?? "condition",
|
|
12759
|
+
title: focusedNode?.title ?? "Select a node",
|
|
12760
|
+
rule: priority[0]?.label ?? "",
|
|
12761
|
+
priorities: priority,
|
|
12762
|
+
fallbackEnabled,
|
|
12763
|
+
onClose: closePanel,
|
|
12764
|
+
onPrioritiesChange: setPriority,
|
|
12765
|
+
onFallbackChange: setFallbackEnabled,
|
|
12766
|
+
onRemove: () => setPanelOpen(false),
|
|
12767
|
+
onSave: () => setPanelOpen(true)
|
|
12768
|
+
}
|
|
12769
|
+
)
|
|
12752
12770
|
}
|
|
12753
|
-
)
|
|
12771
|
+
)
|
|
12754
12772
|
] }),
|
|
12755
12773
|
ReactDOM10.createPortal(
|
|
12756
12774
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
package/dist/index.js
CHANGED
|
@@ -12141,6 +12141,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12141
12141
|
const [panelOpen, setPanelOpen] = React62.useState(true);
|
|
12142
12142
|
const [zoom, setZoom] = React62.useState(1);
|
|
12143
12143
|
const [fit, setFit] = React62.useState(1);
|
|
12144
|
+
const [planeHeight, setPlaneHeight] = React62.useState(PLANE_H);
|
|
12144
12145
|
const [pan, setPan] = React62.useState({ x: 0, y: 0 });
|
|
12145
12146
|
const [issuesOpen, setIssuesOpen] = React62.useState(false);
|
|
12146
12147
|
const [priority, setPriority] = React62.useState([
|
|
@@ -12167,8 +12168,16 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12167
12168
|
if (!plane) return;
|
|
12168
12169
|
const measure = () => {
|
|
12169
12170
|
const width = plane.clientWidth;
|
|
12170
|
-
|
|
12171
|
-
|
|
12171
|
+
const height = plane.clientHeight;
|
|
12172
|
+
if (!width || !height) return;
|
|
12173
|
+
setFit(
|
|
12174
|
+
Math.min(
|
|
12175
|
+
1,
|
|
12176
|
+
(width - PLANE_PAD * 2) / SCENE_W,
|
|
12177
|
+
(height - PLANE_PAD * 2) / SCENE_H
|
|
12178
|
+
)
|
|
12179
|
+
);
|
|
12180
|
+
setPlaneHeight(height);
|
|
12172
12181
|
};
|
|
12173
12182
|
measure();
|
|
12174
12183
|
const observer = new ResizeObserver(measure);
|
|
@@ -12340,7 +12349,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12340
12349
|
else if (ref) ref.current = node;
|
|
12341
12350
|
},
|
|
12342
12351
|
className: cn54(
|
|
12343
|
-
"flex w-full flex-col overflow-hidden rounded-lg border border-hairline bg-surface shadow-card",
|
|
12352
|
+
"flex min-h-0 w-full flex-col overflow-hidden rounded-lg border border-hairline bg-surface shadow-card",
|
|
12344
12353
|
className
|
|
12345
12354
|
),
|
|
12346
12355
|
"data-simulating": replaying || void 0,
|
|
@@ -12396,7 +12405,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12396
12405
|
] })
|
|
12397
12406
|
] }),
|
|
12398
12407
|
/* @__PURE__ */ jsxs59("div", { className: "flex min-h-0 flex-1 items-stretch", children: [
|
|
12399
|
-
/* @__PURE__ */ jsxs59("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
12408
|
+
/* @__PURE__ */ jsxs59("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
12400
12409
|
/* @__PURE__ */ jsxs59(
|
|
12401
12410
|
"div",
|
|
12402
12411
|
{
|
|
@@ -12422,11 +12431,13 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12422
12431
|
}
|
|
12423
12432
|
},
|
|
12424
12433
|
className: cn54(
|
|
12425
|
-
"relative min-w-0 flex-1 cursor-grab overflow-hidden bg-canvas",
|
|
12434
|
+
"relative min-h-0 min-w-0 flex-1 cursor-grab overflow-hidden bg-canvas",
|
|
12426
12435
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue focus-visible:ring-inset"
|
|
12427
12436
|
),
|
|
12428
12437
|
style: {
|
|
12429
|
-
height
|
|
12438
|
+
// Grows with the host height, never collapses below the
|
|
12439
|
+
// stand-alone look when the parent has no explicit height.
|
|
12440
|
+
minHeight: PLANE_H,
|
|
12430
12441
|
backgroundImage: "radial-gradient(var(--color-hairline) 1px, transparent 1px)",
|
|
12431
12442
|
backgroundSize: "16px 16px"
|
|
12432
12443
|
},
|
|
@@ -12438,7 +12449,7 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12438
12449
|
style: {
|
|
12439
12450
|
width: SCENE_W,
|
|
12440
12451
|
height: SCENE_H,
|
|
12441
|
-
transform: `translate(${PLANE_PAD + pan.x}px, ${Math.max((
|
|
12452
|
+
transform: `translate(${PLANE_PAD + pan.x}px, ${Math.max((planeHeight - SCENE_H * scale) / 2, 0) + pan.y}px) scale(${scale})`,
|
|
12442
12453
|
transformOrigin: "0 0",
|
|
12443
12454
|
transition: "transform 200ms ease-out"
|
|
12444
12455
|
},
|
|
@@ -12599,22 +12610,29 @@ var PaymentRoutingCanvas = React62.forwardRef(
|
|
|
12599
12610
|
] })
|
|
12600
12611
|
] })
|
|
12601
12612
|
] }),
|
|
12602
|
-
/* @__PURE__ */ jsx62(
|
|
12603
|
-
|
|
12613
|
+
/* @__PURE__ */ jsx62(
|
|
12614
|
+
"div",
|
|
12604
12615
|
{
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
|
|
12615
|
-
|
|
12616
|
+
className: "flex min-h-0 shrink-0 flex-col self-stretch border-l border-hairline",
|
|
12617
|
+
style: { width: PANEL_W },
|
|
12618
|
+
children: /* @__PURE__ */ jsx62(
|
|
12619
|
+
NodeConfigPanel,
|
|
12620
|
+
{
|
|
12621
|
+
open: panelOpen,
|
|
12622
|
+
nodeType: focusedNode?.type ?? "condition",
|
|
12623
|
+
title: focusedNode?.title ?? "Select a node",
|
|
12624
|
+
rule: priority[0]?.label ?? "",
|
|
12625
|
+
priorities: priority,
|
|
12626
|
+
fallbackEnabled,
|
|
12627
|
+
onClose: closePanel,
|
|
12628
|
+
onPrioritiesChange: setPriority,
|
|
12629
|
+
onFallbackChange: setFallbackEnabled,
|
|
12630
|
+
onRemove: () => setPanelOpen(false),
|
|
12631
|
+
onSave: () => setPanelOpen(true)
|
|
12632
|
+
}
|
|
12633
|
+
)
|
|
12616
12634
|
}
|
|
12617
|
-
)
|
|
12635
|
+
)
|
|
12618
12636
|
] }),
|
|
12619
12637
|
ReactDOM10.createPortal(
|
|
12620
12638
|
/* @__PURE__ */ jsxs59(
|
package/package.json
CHANGED
|
@@ -23,6 +23,7 @@ const CONDITION_X = 316;
|
|
|
23
23
|
const PROCESSOR_X = 632;
|
|
24
24
|
const SCENE_W = 860;
|
|
25
25
|
const SCENE_H = 342;
|
|
26
|
+
/** Minimum plane height, used when the host gives the canvas no explicit height. */
|
|
26
27
|
const PLANE_H = 372;
|
|
27
28
|
const PLANE_PAD = 18;
|
|
28
29
|
const PANEL_W = 296;
|
|
@@ -287,6 +288,8 @@ export const PaymentRoutingCanvas = React.forwardRef<
|
|
|
287
288
|
const [panelOpen, setPanelOpen] = React.useState(true);
|
|
288
289
|
const [zoom, setZoom] = React.useState(1);
|
|
289
290
|
const [fit, setFit] = React.useState(1);
|
|
291
|
+
/** Measured plane height — the scene centres against this, not a constant. */
|
|
292
|
+
const [planeHeight, setPlaneHeight] = React.useState(PLANE_H);
|
|
290
293
|
const [pan, setPan] = React.useState({ x: 0, y: 0 });
|
|
291
294
|
const [issuesOpen, setIssuesOpen] = React.useState(false);
|
|
292
295
|
const [priority, setPriority] = React.useState<ConfigPriority[]>([
|
|
@@ -316,8 +319,18 @@ export const PaymentRoutingCanvas = React.forwardRef<
|
|
|
316
319
|
if (!plane) return;
|
|
317
320
|
const measure = () => {
|
|
318
321
|
const width = plane.clientWidth;
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
const height = plane.clientHeight;
|
|
323
|
+
if (!width || !height) return;
|
|
324
|
+
// Fit the scene into the plane on BOTH axes so a taller host height
|
|
325
|
+
// widens the fitted scene instead of leaving dead space.
|
|
326
|
+
setFit(
|
|
327
|
+
Math.min(
|
|
328
|
+
1,
|
|
329
|
+
(width - PLANE_PAD * 2) / SCENE_W,
|
|
330
|
+
(height - PLANE_PAD * 2) / SCENE_H,
|
|
331
|
+
),
|
|
332
|
+
);
|
|
333
|
+
setPlaneHeight(height);
|
|
321
334
|
};
|
|
322
335
|
measure();
|
|
323
336
|
const observer = new ResizeObserver(measure);
|
|
@@ -519,7 +532,7 @@ export const PaymentRoutingCanvas = React.forwardRef<
|
|
|
519
532
|
else if (ref) ref.current = node;
|
|
520
533
|
}}
|
|
521
534
|
className={cn(
|
|
522
|
-
"flex w-full flex-col overflow-hidden rounded-lg border border-hairline bg-surface shadow-card",
|
|
535
|
+
"flex min-h-0 w-full flex-col overflow-hidden rounded-lg border border-hairline bg-surface shadow-card",
|
|
523
536
|
className,
|
|
524
537
|
)}
|
|
525
538
|
data-simulating={replaying || undefined}
|
|
@@ -576,7 +589,7 @@ export const PaymentRoutingCanvas = React.forwardRef<
|
|
|
576
589
|
</div>
|
|
577
590
|
|
|
578
591
|
<div className="flex min-h-0 flex-1 items-stretch">
|
|
579
|
-
<div className="flex min-w-0 flex-1 flex-col">
|
|
592
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col">
|
|
580
593
|
<div
|
|
581
594
|
ref={planeRef}
|
|
582
595
|
role="application"
|
|
@@ -600,11 +613,13 @@ export const PaymentRoutingCanvas = React.forwardRef<
|
|
|
600
613
|
}
|
|
601
614
|
}}
|
|
602
615
|
className={cn(
|
|
603
|
-
"relative min-w-0 flex-1 cursor-grab overflow-hidden bg-canvas",
|
|
616
|
+
"relative min-h-0 min-w-0 flex-1 cursor-grab overflow-hidden bg-canvas",
|
|
604
617
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-blue focus-visible:ring-inset",
|
|
605
618
|
)}
|
|
606
619
|
style={{
|
|
607
|
-
height
|
|
620
|
+
// Grows with the host height, never collapses below the
|
|
621
|
+
// stand-alone look when the parent has no explicit height.
|
|
622
|
+
minHeight: PLANE_H,
|
|
608
623
|
backgroundImage:
|
|
609
624
|
"radial-gradient(var(--color-hairline) 1px, transparent 1px)",
|
|
610
625
|
backgroundSize: "16px 16px",
|
|
@@ -616,7 +631,7 @@ export const PaymentRoutingCanvas = React.forwardRef<
|
|
|
616
631
|
width: SCENE_W,
|
|
617
632
|
height: SCENE_H,
|
|
618
633
|
transform: `translate(${PLANE_PAD + pan.x}px, ${
|
|
619
|
-
Math.max((
|
|
634
|
+
Math.max((planeHeight - SCENE_H * scale) / 2, 0) + pan.y
|
|
620
635
|
}px) scale(${scale})`,
|
|
621
636
|
transformOrigin: "0 0",
|
|
622
637
|
transition: "transform 200ms ease-out",
|
|
@@ -796,7 +811,10 @@ export const PaymentRoutingCanvas = React.forwardRef<
|
|
|
796
811
|
</div>
|
|
797
812
|
</div>
|
|
798
813
|
|
|
799
|
-
<div
|
|
814
|
+
<div
|
|
815
|
+
className="flex min-h-0 shrink-0 flex-col self-stretch border-l border-hairline"
|
|
816
|
+
style={{ width: PANEL_W }}
|
|
817
|
+
>
|
|
800
818
|
<NodeConfigPanel
|
|
801
819
|
open={panelOpen}
|
|
802
820
|
nodeType={focusedNode?.type ?? "condition"}
|