@almadar/ui 4.54.8 → 4.54.9
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/dist/avl/index.cjs +338 -304
- package/dist/avl/index.js +338 -304
- package/dist/components/organisms/avl/AvlTransitionDetail.d.ts +20 -0
- package/package.json +1 -1
package/dist/avl/index.js
CHANGED
|
@@ -62623,246 +62623,91 @@ AvlCosmicZoom.displayName = "AvlCosmicZoom";
|
|
|
62623
62623
|
init_avl_schema_parser();
|
|
62624
62624
|
init_avl_zoom_state();
|
|
62625
62625
|
|
|
62626
|
-
// components/organisms/avl/
|
|
62627
|
-
|
|
62628
|
-
|
|
62629
|
-
|
|
62630
|
-
|
|
62631
|
-
|
|
62632
|
-
|
|
62633
|
-
|
|
62634
|
-
function
|
|
62635
|
-
const
|
|
62636
|
-
|
|
62637
|
-
|
|
62638
|
-
}
|
|
62639
|
-
return { type: node.label, args };
|
|
62640
|
-
}
|
|
62641
|
-
function mapEffectType(label) {
|
|
62642
|
-
const valid = [
|
|
62643
|
-
"render-ui",
|
|
62644
|
-
"set",
|
|
62645
|
-
"persist",
|
|
62646
|
-
"fetch",
|
|
62647
|
-
"emit",
|
|
62648
|
-
"navigate",
|
|
62649
|
-
"notify",
|
|
62650
|
-
"call-service",
|
|
62651
|
-
"spawn",
|
|
62652
|
-
"despawn",
|
|
62653
|
-
"do",
|
|
62654
|
-
"if",
|
|
62655
|
-
"log"
|
|
62656
|
-
];
|
|
62657
|
-
return valid.includes(label) ? label : "log";
|
|
62626
|
+
// components/organisms/avl/AvlTransitionDetail.tsx
|
|
62627
|
+
init_Card();
|
|
62628
|
+
init_Box();
|
|
62629
|
+
init_Stack();
|
|
62630
|
+
init_Typography();
|
|
62631
|
+
init_Badge();
|
|
62632
|
+
init_Accordion();
|
|
62633
|
+
init_CodeBlock();
|
|
62634
|
+
function summarizeArg(node) {
|
|
62635
|
+
const label = node.label;
|
|
62636
|
+
if (label.length <= 32) return label;
|
|
62637
|
+
return `${label.slice(0, 30)}\u2026`;
|
|
62658
62638
|
}
|
|
62659
|
-
|
|
62660
|
-
|
|
62661
|
-
|
|
62662
|
-
|
|
62663
|
-
|
|
62664
|
-
|
|
62665
|
-
const
|
|
62666
|
-
const
|
|
62639
|
+
function flattenEffect(node) {
|
|
62640
|
+
const args = node.children ?? [];
|
|
62641
|
+
const argSummary = args.slice(0, 2).map(summarizeArg).join(" \xB7 ");
|
|
62642
|
+
return { type: node.label, args, argSummary };
|
|
62643
|
+
}
|
|
62644
|
+
var AvlTransitionDetail = ({ data }) => {
|
|
62645
|
+
const effects = useMemo(() => data.effects.map(flattenEffect), [data.effects]);
|
|
62646
|
+
const accordionItems = useMemo(() => {
|
|
62647
|
+
return effects.map((eff, i) => {
|
|
62648
|
+
const code = JSON.stringify(
|
|
62649
|
+
[eff.type, ...eff.args.map((a) => safeParseLabel(a.label))],
|
|
62650
|
+
null,
|
|
62651
|
+
2
|
|
62652
|
+
);
|
|
62653
|
+
return {
|
|
62654
|
+
id: `effect-${i}`,
|
|
62655
|
+
header: /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
62656
|
+
/* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: eff.type }),
|
|
62657
|
+
eff.argSummary ? /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: eff.argSummary }) : null
|
|
62658
|
+
] }),
|
|
62659
|
+
content: /* @__PURE__ */ jsx(CodeBlock, { code, language: "json", maxHeight: "320px" })
|
|
62660
|
+
};
|
|
62661
|
+
});
|
|
62662
|
+
}, [effects]);
|
|
62667
62663
|
const hasGuard = !!data.guard;
|
|
62668
|
-
const hasEffects =
|
|
62664
|
+
const hasEffects = effects.length > 0;
|
|
62669
62665
|
const hasSlots = data.slotTargets.length > 0;
|
|
62670
|
-
|
|
62671
|
-
|
|
62672
|
-
|
|
62673
|
-
|
|
62674
|
-
|
|
62675
|
-
|
|
62676
|
-
|
|
62677
|
-
|
|
62678
|
-
|
|
62679
|
-
|
|
62680
|
-
|
|
62681
|
-
|
|
62682
|
-
|
|
62683
|
-
|
|
62684
|
-
|
|
62685
|
-
|
|
62686
|
-
|
|
62687
|
-
|
|
62688
|
-
|
|
62689
|
-
|
|
62690
|
-
|
|
62691
|
-
|
|
62692
|
-
|
|
62693
|
-
|
|
62694
|
-
|
|
62695
|
-
|
|
62696
|
-
|
|
62697
|
-
"
|
|
62698
|
-
|
|
62699
|
-
|
|
62700
|
-
|
|
62701
|
-
|
|
62702
|
-
|
|
62703
|
-
rx: 12,
|
|
62704
|
-
fill: color,
|
|
62705
|
-
fillOpacity: 0.03
|
|
62706
|
-
}
|
|
62707
|
-
),
|
|
62708
|
-
/* @__PURE__ */ jsx(
|
|
62709
|
-
"rect",
|
|
62710
|
-
{
|
|
62711
|
-
x: CARD_X,
|
|
62712
|
-
y: cardY + headerH - 12,
|
|
62713
|
-
width: CARD_W,
|
|
62714
|
-
height: 12,
|
|
62715
|
-
fill: color,
|
|
62716
|
-
fillOpacity: 0.03
|
|
62717
|
-
}
|
|
62718
|
-
),
|
|
62719
|
-
/* @__PURE__ */ jsx(
|
|
62720
|
-
"rect",
|
|
62721
|
-
{
|
|
62722
|
-
x: CARD_X + 20,
|
|
62723
|
-
y: cardY + 12,
|
|
62724
|
-
width: 140,
|
|
62725
|
-
height: 30,
|
|
62726
|
-
rx: 15,
|
|
62727
|
-
fill: fromColors.fill,
|
|
62728
|
-
stroke: fromColors.border,
|
|
62729
|
-
strokeWidth: 1.5
|
|
62730
|
-
}
|
|
62731
|
-
),
|
|
62732
|
-
/* @__PURE__ */ jsx(
|
|
62733
|
-
"text",
|
|
62734
|
-
{
|
|
62735
|
-
x: CARD_X + 90,
|
|
62736
|
-
y: cardY + 31,
|
|
62737
|
-
textAnchor: "middle",
|
|
62738
|
-
fill: fromColors.border,
|
|
62739
|
-
fontSize: 14,
|
|
62740
|
-
fontWeight: 600,
|
|
62741
|
-
fontFamily: "inherit",
|
|
62742
|
-
children: data.from
|
|
62743
|
-
}
|
|
62744
|
-
),
|
|
62745
|
-
/* @__PURE__ */ jsx(
|
|
62746
|
-
"text",
|
|
62747
|
-
{
|
|
62748
|
-
x: CX,
|
|
62749
|
-
y: cardY + 32,
|
|
62750
|
-
textAnchor: "middle",
|
|
62751
|
-
fill: color,
|
|
62752
|
-
fontSize: 16,
|
|
62753
|
-
opacity: 0.4,
|
|
62754
|
-
fontFamily: "inherit",
|
|
62755
|
-
children: "\u2192"
|
|
62756
|
-
}
|
|
62757
|
-
),
|
|
62758
|
-
/* @__PURE__ */ jsx(
|
|
62759
|
-
"rect",
|
|
62760
|
-
{
|
|
62761
|
-
x: CARD_X + CARD_W - 160,
|
|
62762
|
-
y: cardY + 12,
|
|
62763
|
-
width: 140,
|
|
62764
|
-
height: 30,
|
|
62765
|
-
rx: 15,
|
|
62766
|
-
fill: toColors.fill,
|
|
62767
|
-
stroke: toColors.border,
|
|
62768
|
-
strokeWidth: 1.5
|
|
62769
|
-
}
|
|
62770
|
-
),
|
|
62771
|
-
/* @__PURE__ */ jsx(
|
|
62772
|
-
"text",
|
|
62773
|
-
{
|
|
62774
|
-
x: CARD_X + CARD_W - 90,
|
|
62775
|
-
y: cardY + 31,
|
|
62776
|
-
textAnchor: "middle",
|
|
62777
|
-
fill: toColors.border,
|
|
62778
|
-
fontSize: 14,
|
|
62779
|
-
fontWeight: 600,
|
|
62780
|
-
fontFamily: "inherit",
|
|
62781
|
-
children: data.to
|
|
62782
|
-
}
|
|
62783
|
-
),
|
|
62784
|
-
/* @__PURE__ */ jsx(
|
|
62785
|
-
"line",
|
|
62786
|
-
{
|
|
62787
|
-
x1: CARD_X + 12,
|
|
62788
|
-
y1: cardY + headerH,
|
|
62789
|
-
x2: CARD_X + CARD_W - 12,
|
|
62790
|
-
y2: cardY + headerH,
|
|
62791
|
-
stroke: color,
|
|
62792
|
-
strokeWidth: 0.5,
|
|
62793
|
-
opacity: 0.1
|
|
62794
|
-
}
|
|
62795
|
-
),
|
|
62796
|
-
(() => {
|
|
62797
|
-
const secY = cardY + headerH + sectionGap;
|
|
62798
|
-
return /* @__PURE__ */ jsxs("g", { children: [
|
|
62799
|
-
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "TRIGGER" }),
|
|
62800
|
-
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 14, y: secY + 28, fill: color, fontSize: 14, fontWeight: 600, fontFamily: "inherit", children: data.event }),
|
|
62801
|
-
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 4, y: secY + 28, fill: color, fontSize: 10, opacity: 0.5, children: "\u26A1" })
|
|
62802
|
-
] });
|
|
62803
|
-
})(),
|
|
62804
|
-
hasGuard && data.guard && (() => {
|
|
62805
|
-
const secY = cardY + headerH + sectionGap + triggerH;
|
|
62806
|
-
return /* @__PURE__ */ jsxs("g", { children: [
|
|
62807
|
-
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
|
|
62808
|
-
/* @__PURE__ */ jsx(
|
|
62809
|
-
"polygon",
|
|
62810
|
-
{
|
|
62811
|
-
points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
|
|
62812
|
-
fill: "none",
|
|
62813
|
-
stroke: color,
|
|
62814
|
-
strokeWidth: 1,
|
|
62815
|
-
opacity: 0.5
|
|
62816
|
-
}
|
|
62817
|
-
),
|
|
62818
|
-
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 18, y: secY + 29, fill: color, fontSize: 12, fontWeight: 400, opacity: 0.6, fontFamily: "inherit", children: data.guard.label })
|
|
62819
|
-
] });
|
|
62820
|
-
})(),
|
|
62821
|
-
hasEffects && (() => {
|
|
62822
|
-
const secY = cardY + headerH + sectionGap + triggerH + guardH;
|
|
62823
|
-
return /* @__PURE__ */ jsxs("g", { children: [
|
|
62824
|
-
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
|
|
62825
|
-
effects.map((eff, i) => {
|
|
62826
|
-
const rowY = secY + 22 + i * effectRowH;
|
|
62827
|
-
const effectType = mapEffectType(eff.type);
|
|
62828
|
-
const argsText = eff.args.length > 0 ? eff.args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" \xB7 ") : "";
|
|
62829
|
-
return /* @__PURE__ */ jsxs("g", { children: [
|
|
62830
|
-
/* @__PURE__ */ jsx(
|
|
62831
|
-
AvlEffect,
|
|
62832
|
-
{
|
|
62833
|
-
x: CONTENT_LEFT + 10,
|
|
62834
|
-
y: rowY + 6,
|
|
62835
|
-
effectType,
|
|
62836
|
-
size: 10,
|
|
62837
|
-
showBackground: true
|
|
62838
|
-
}
|
|
62839
|
-
),
|
|
62840
|
-
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
|
|
62841
|
-
argsText && /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28 + eff.type.length * 7 + 8, y: rowY + 10, fill: color, fontSize: 10, fontWeight: 400, opacity: 0.5, fontFamily: "monospace", children: argsText })
|
|
62842
|
-
] }, `eff-${i}`);
|
|
62843
|
-
})
|
|
62844
|
-
] });
|
|
62845
|
-
})(),
|
|
62846
|
-
hasSlots && (() => {
|
|
62847
|
-
const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
|
|
62848
|
-
return /* @__PURE__ */ jsxs("g", { children: [
|
|
62849
|
-
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
|
|
62850
|
-
data.slotTargets.map((slot, i) => {
|
|
62851
|
-
const rowY = secY + 22 + i * 22;
|
|
62852
|
-
return /* @__PURE__ */ jsxs("g", { children: [
|
|
62853
|
-
/* @__PURE__ */ jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
|
|
62854
|
-
/* @__PURE__ */ jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
|
|
62855
|
-
slot.name,
|
|
62856
|
-
": ",
|
|
62857
|
-
slot.pattern
|
|
62858
|
-
] })
|
|
62859
|
-
] }, `slot-${i}`);
|
|
62860
|
-
})
|
|
62861
|
-
] });
|
|
62862
|
-
})()
|
|
62863
|
-
] });
|
|
62666
|
+
return /* @__PURE__ */ jsx(Card, { className: "w-full max-w-3xl mx-auto", shadow: "md", children: /* @__PURE__ */ jsx(Box, { className: "p-6", children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", children: [
|
|
62667
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "md", justify: "center", align: "center", children: [
|
|
62668
|
+
/* @__PURE__ */ jsx(Badge, { variant: "success", size: "lg", children: data.from }),
|
|
62669
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", color: "muted", children: "\u2192" }),
|
|
62670
|
+
/* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "lg", children: data.to })
|
|
62671
|
+
] }),
|
|
62672
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
62673
|
+
/* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: "TRIGGER" }),
|
|
62674
|
+
/* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: /* @__PURE__ */ jsxs(Typography, { variant: "body1", weight: "semibold", children: [
|
|
62675
|
+
"\u26A1 ",
|
|
62676
|
+
data.event
|
|
62677
|
+
] }) })
|
|
62678
|
+
] }),
|
|
62679
|
+
hasGuard && data.guard && /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
62680
|
+
/* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: "GUARD" }),
|
|
62681
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", children: data.guard.label })
|
|
62682
|
+
] }),
|
|
62683
|
+
hasEffects && /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
62684
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "overline", color: "muted", children: [
|
|
62685
|
+
"EFFECTS (",
|
|
62686
|
+
effects.length,
|
|
62687
|
+
")"
|
|
62688
|
+
] }),
|
|
62689
|
+
/* @__PURE__ */ jsx(Accordion, { items: accordionItems, multiple: true })
|
|
62690
|
+
] }),
|
|
62691
|
+
hasSlots && /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
62692
|
+
/* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: "SLOTS" }),
|
|
62693
|
+
/* @__PURE__ */ jsx(VStack, { gap: "xs", children: data.slotTargets.map((slot, i) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
62694
|
+
/* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", children: slot.name }),
|
|
62695
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: slot.pattern })
|
|
62696
|
+
] }, `slot-${i}`)) })
|
|
62697
|
+
] })
|
|
62698
|
+
] }) }) });
|
|
62864
62699
|
};
|
|
62865
|
-
|
|
62700
|
+
AvlTransitionDetail.displayName = "AvlTransitionDetail";
|
|
62701
|
+
function safeParseLabel(label) {
|
|
62702
|
+
if (typeof label !== "string") return label;
|
|
62703
|
+
const trimmed = label.trim();
|
|
62704
|
+
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return label;
|
|
62705
|
+
try {
|
|
62706
|
+
return JSON.parse(trimmed);
|
|
62707
|
+
} catch {
|
|
62708
|
+
return label;
|
|
62709
|
+
}
|
|
62710
|
+
}
|
|
62866
62711
|
|
|
62867
62712
|
// components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
|
|
62868
62713
|
init_Box();
|
|
@@ -63424,83 +63269,31 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
63424
63269
|
paddingRight: 24
|
|
63425
63270
|
},
|
|
63426
63271
|
children: /* @__PURE__ */ jsx(
|
|
63427
|
-
FlowCanvas,
|
|
63428
|
-
{
|
|
63429
|
-
schema: scopedSchema,
|
|
63430
|
-
initialLevel: "trait-expanded",
|
|
63431
|
-
initialOrbital: state.selectedOrbital,
|
|
63432
|
-
onNodeClick: handleCanvasNodeClick,
|
|
63433
|
-
width: "100%",
|
|
63434
|
-
height: "100%"
|
|
63435
|
-
}
|
|
63436
|
-
)
|
|
63437
|
-
}
|
|
63438
|
-
),
|
|
63439
|
-
state.level === "transition" && transitionLevelData && /* @__PURE__ */ jsx(
|
|
63440
|
-
Box,
|
|
63441
|
-
{
|
|
63442
|
-
position: "absolute",
|
|
63443
|
-
style: {
|
|
63444
|
-
inset: 0,
|
|
63445
|
-
paddingTop: 56,
|
|
63446
|
-
paddingBottom: 24,
|
|
63447
|
-
paddingLeft: 24,
|
|
63448
|
-
paddingRight: 24
|
|
63449
|
-
},
|
|
63450
|
-
children: /* @__PURE__ */ jsx(
|
|
63451
|
-
Box,
|
|
63452
|
-
{
|
|
63453
|
-
ref: transformWrapperRef,
|
|
63454
|
-
position: "relative",
|
|
63455
|
-
onPointerDown: handlePointerDown,
|
|
63456
|
-
onPointerMove: handlePointerMove,
|
|
63457
|
-
onPointerUp: handlePointerUp,
|
|
63458
|
-
onPointerCancel: handlePointerUp,
|
|
63459
|
-
style: {
|
|
63460
|
-
width: "100%",
|
|
63461
|
-
height: "100%",
|
|
63462
|
-
cursor: dragStateRef.current ? "grabbing" : "grab",
|
|
63463
|
-
overflow: "hidden"
|
|
63464
|
-
},
|
|
63465
|
-
children: /* @__PURE__ */ jsx(
|
|
63466
|
-
Box,
|
|
63467
|
-
{
|
|
63468
|
-
position: "absolute",
|
|
63469
|
-
style: {
|
|
63470
|
-
inset: 0,
|
|
63471
|
-
transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
|
|
63472
|
-
transformOrigin: "0 0"
|
|
63473
|
-
},
|
|
63474
|
-
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
63475
|
-
AvlTransitionScene,
|
|
63476
|
-
{
|
|
63477
|
-
data: transitionLevelData,
|
|
63478
|
-
color
|
|
63479
|
-
}
|
|
63480
|
-
) })
|
|
63481
|
-
}
|
|
63482
|
-
)
|
|
63272
|
+
FlowCanvas,
|
|
63273
|
+
{
|
|
63274
|
+
schema: scopedSchema,
|
|
63275
|
+
initialLevel: "trait-expanded",
|
|
63276
|
+
initialOrbital: state.selectedOrbital,
|
|
63277
|
+
onNodeClick: handleCanvasNodeClick,
|
|
63278
|
+
width: "100%",
|
|
63279
|
+
height: "100%"
|
|
63483
63280
|
}
|
|
63484
63281
|
)
|
|
63485
63282
|
}
|
|
63486
63283
|
),
|
|
63487
|
-
state.level === "transition" && /* @__PURE__ */
|
|
63284
|
+
state.level === "transition" && transitionLevelData && /* @__PURE__ */ jsx(
|
|
63488
63285
|
Box,
|
|
63489
63286
|
{
|
|
63490
63287
|
position: "absolute",
|
|
63491
63288
|
style: {
|
|
63492
|
-
|
|
63493
|
-
|
|
63494
|
-
|
|
63495
|
-
|
|
63496
|
-
|
|
63497
|
-
|
|
63289
|
+
inset: 0,
|
|
63290
|
+
paddingTop: 56,
|
|
63291
|
+
paddingBottom: 24,
|
|
63292
|
+
paddingLeft: 24,
|
|
63293
|
+
paddingRight: 24,
|
|
63294
|
+
overflowY: "auto"
|
|
63498
63295
|
},
|
|
63499
|
-
children:
|
|
63500
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: "sm" }) }),
|
|
63501
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsx(Icon, { name: "minus", size: "sm" }) }),
|
|
63502
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsx(Icon, { name: "maximize", size: "sm" }) })
|
|
63503
|
-
]
|
|
63296
|
+
children: /* @__PURE__ */ jsx(AvlTransitionDetail, { data: transitionLevelData })
|
|
63504
63297
|
}
|
|
63505
63298
|
)
|
|
63506
63299
|
]
|
|
@@ -63508,6 +63301,247 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
63508
63301
|
);
|
|
63509
63302
|
};
|
|
63510
63303
|
AvlOrbitalsCosmicZoom.displayName = "AvlOrbitalsCosmicZoom";
|
|
63304
|
+
|
|
63305
|
+
// components/organisms/avl/AvlTransitionScene.tsx
|
|
63306
|
+
init_AvlEffect();
|
|
63307
|
+
init_types();
|
|
63308
|
+
var CX = 300;
|
|
63309
|
+
var CARD_W = 440;
|
|
63310
|
+
var CARD_X = CX - CARD_W / 2;
|
|
63311
|
+
var SECTION_LEFT = CARD_X + 16;
|
|
63312
|
+
var CONTENT_LEFT = CARD_X + 24;
|
|
63313
|
+
function flattenEffect2(node) {
|
|
63314
|
+
const args = [];
|
|
63315
|
+
for (const child of node.children ?? []) {
|
|
63316
|
+
args.push(child.label);
|
|
63317
|
+
}
|
|
63318
|
+
return { type: node.label, args };
|
|
63319
|
+
}
|
|
63320
|
+
function mapEffectType(label) {
|
|
63321
|
+
const valid = [
|
|
63322
|
+
"render-ui",
|
|
63323
|
+
"set",
|
|
63324
|
+
"persist",
|
|
63325
|
+
"fetch",
|
|
63326
|
+
"emit",
|
|
63327
|
+
"navigate",
|
|
63328
|
+
"notify",
|
|
63329
|
+
"call-service",
|
|
63330
|
+
"spawn",
|
|
63331
|
+
"despawn",
|
|
63332
|
+
"do",
|
|
63333
|
+
"if",
|
|
63334
|
+
"log"
|
|
63335
|
+
];
|
|
63336
|
+
return valid.includes(label) ? label : "log";
|
|
63337
|
+
}
|
|
63338
|
+
var AvlTransitionScene = ({
|
|
63339
|
+
data,
|
|
63340
|
+
color = "var(--color-primary)"
|
|
63341
|
+
}) => {
|
|
63342
|
+
const fromRole = getStateRole(data.from, true);
|
|
63343
|
+
const toRole = getStateRole(data.to, false, false);
|
|
63344
|
+
const fromColors = STATE_COLORS[fromRole];
|
|
63345
|
+
const toColors = STATE_COLORS[toRole];
|
|
63346
|
+
const hasGuard = !!data.guard;
|
|
63347
|
+
const hasEffects = data.effects.length > 0;
|
|
63348
|
+
const hasSlots = data.slotTargets.length > 0;
|
|
63349
|
+
const effects = data.effects.map(flattenEffect2);
|
|
63350
|
+
const headerH = 52;
|
|
63351
|
+
const sectionGap = 8;
|
|
63352
|
+
const triggerH = 34;
|
|
63353
|
+
const guardH = hasGuard ? 30 + sectionGap : 0;
|
|
63354
|
+
const effectRowH = 28;
|
|
63355
|
+
const effectsH = hasEffects ? 24 + effects.length * effectRowH + sectionGap : 0;
|
|
63356
|
+
const slotsH = hasSlots ? 24 + data.slotTargets.length * 22 + sectionGap : 0;
|
|
63357
|
+
const cardH = headerH + triggerH + guardH + effectsH + slotsH + 16;
|
|
63358
|
+
const cardY = Math.max(20, (400 - cardH) / 2);
|
|
63359
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
63360
|
+
/* @__PURE__ */ jsx(
|
|
63361
|
+
"rect",
|
|
63362
|
+
{
|
|
63363
|
+
x: CARD_X,
|
|
63364
|
+
y: cardY,
|
|
63365
|
+
width: CARD_W,
|
|
63366
|
+
height: cardH,
|
|
63367
|
+
rx: 12,
|
|
63368
|
+
fill: "var(--color-surface, white)",
|
|
63369
|
+
fillOpacity: 0.97,
|
|
63370
|
+
stroke: color,
|
|
63371
|
+
strokeWidth: 0.8,
|
|
63372
|
+
strokeOpacity: 0.2
|
|
63373
|
+
}
|
|
63374
|
+
),
|
|
63375
|
+
/* @__PURE__ */ jsx(
|
|
63376
|
+
"rect",
|
|
63377
|
+
{
|
|
63378
|
+
x: CARD_X,
|
|
63379
|
+
y: cardY,
|
|
63380
|
+
width: CARD_W,
|
|
63381
|
+
height: headerH,
|
|
63382
|
+
rx: 12,
|
|
63383
|
+
fill: color,
|
|
63384
|
+
fillOpacity: 0.03
|
|
63385
|
+
}
|
|
63386
|
+
),
|
|
63387
|
+
/* @__PURE__ */ jsx(
|
|
63388
|
+
"rect",
|
|
63389
|
+
{
|
|
63390
|
+
x: CARD_X,
|
|
63391
|
+
y: cardY + headerH - 12,
|
|
63392
|
+
width: CARD_W,
|
|
63393
|
+
height: 12,
|
|
63394
|
+
fill: color,
|
|
63395
|
+
fillOpacity: 0.03
|
|
63396
|
+
}
|
|
63397
|
+
),
|
|
63398
|
+
/* @__PURE__ */ jsx(
|
|
63399
|
+
"rect",
|
|
63400
|
+
{
|
|
63401
|
+
x: CARD_X + 20,
|
|
63402
|
+
y: cardY + 12,
|
|
63403
|
+
width: 140,
|
|
63404
|
+
height: 30,
|
|
63405
|
+
rx: 15,
|
|
63406
|
+
fill: fromColors.fill,
|
|
63407
|
+
stroke: fromColors.border,
|
|
63408
|
+
strokeWidth: 1.5
|
|
63409
|
+
}
|
|
63410
|
+
),
|
|
63411
|
+
/* @__PURE__ */ jsx(
|
|
63412
|
+
"text",
|
|
63413
|
+
{
|
|
63414
|
+
x: CARD_X + 90,
|
|
63415
|
+
y: cardY + 31,
|
|
63416
|
+
textAnchor: "middle",
|
|
63417
|
+
fill: fromColors.border,
|
|
63418
|
+
fontSize: 14,
|
|
63419
|
+
fontWeight: 600,
|
|
63420
|
+
fontFamily: "inherit",
|
|
63421
|
+
children: data.from
|
|
63422
|
+
}
|
|
63423
|
+
),
|
|
63424
|
+
/* @__PURE__ */ jsx(
|
|
63425
|
+
"text",
|
|
63426
|
+
{
|
|
63427
|
+
x: CX,
|
|
63428
|
+
y: cardY + 32,
|
|
63429
|
+
textAnchor: "middle",
|
|
63430
|
+
fill: color,
|
|
63431
|
+
fontSize: 16,
|
|
63432
|
+
opacity: 0.4,
|
|
63433
|
+
fontFamily: "inherit",
|
|
63434
|
+
children: "\u2192"
|
|
63435
|
+
}
|
|
63436
|
+
),
|
|
63437
|
+
/* @__PURE__ */ jsx(
|
|
63438
|
+
"rect",
|
|
63439
|
+
{
|
|
63440
|
+
x: CARD_X + CARD_W - 160,
|
|
63441
|
+
y: cardY + 12,
|
|
63442
|
+
width: 140,
|
|
63443
|
+
height: 30,
|
|
63444
|
+
rx: 15,
|
|
63445
|
+
fill: toColors.fill,
|
|
63446
|
+
stroke: toColors.border,
|
|
63447
|
+
strokeWidth: 1.5
|
|
63448
|
+
}
|
|
63449
|
+
),
|
|
63450
|
+
/* @__PURE__ */ jsx(
|
|
63451
|
+
"text",
|
|
63452
|
+
{
|
|
63453
|
+
x: CARD_X + CARD_W - 90,
|
|
63454
|
+
y: cardY + 31,
|
|
63455
|
+
textAnchor: "middle",
|
|
63456
|
+
fill: toColors.border,
|
|
63457
|
+
fontSize: 14,
|
|
63458
|
+
fontWeight: 600,
|
|
63459
|
+
fontFamily: "inherit",
|
|
63460
|
+
children: data.to
|
|
63461
|
+
}
|
|
63462
|
+
),
|
|
63463
|
+
/* @__PURE__ */ jsx(
|
|
63464
|
+
"line",
|
|
63465
|
+
{
|
|
63466
|
+
x1: CARD_X + 12,
|
|
63467
|
+
y1: cardY + headerH,
|
|
63468
|
+
x2: CARD_X + CARD_W - 12,
|
|
63469
|
+
y2: cardY + headerH,
|
|
63470
|
+
stroke: color,
|
|
63471
|
+
strokeWidth: 0.5,
|
|
63472
|
+
opacity: 0.1
|
|
63473
|
+
}
|
|
63474
|
+
),
|
|
63475
|
+
(() => {
|
|
63476
|
+
const secY = cardY + headerH + sectionGap;
|
|
63477
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
63478
|
+
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "TRIGGER" }),
|
|
63479
|
+
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 14, y: secY + 28, fill: color, fontSize: 14, fontWeight: 600, fontFamily: "inherit", children: data.event }),
|
|
63480
|
+
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 4, y: secY + 28, fill: color, fontSize: 10, opacity: 0.5, children: "\u26A1" })
|
|
63481
|
+
] });
|
|
63482
|
+
})(),
|
|
63483
|
+
hasGuard && data.guard && (() => {
|
|
63484
|
+
const secY = cardY + headerH + sectionGap + triggerH;
|
|
63485
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
63486
|
+
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
|
|
63487
|
+
/* @__PURE__ */ jsx(
|
|
63488
|
+
"polygon",
|
|
63489
|
+
{
|
|
63490
|
+
points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
|
|
63491
|
+
fill: "none",
|
|
63492
|
+
stroke: color,
|
|
63493
|
+
strokeWidth: 1,
|
|
63494
|
+
opacity: 0.5
|
|
63495
|
+
}
|
|
63496
|
+
),
|
|
63497
|
+
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 18, y: secY + 29, fill: color, fontSize: 12, fontWeight: 400, opacity: 0.6, fontFamily: "inherit", children: data.guard.label })
|
|
63498
|
+
] });
|
|
63499
|
+
})(),
|
|
63500
|
+
hasEffects && (() => {
|
|
63501
|
+
const secY = cardY + headerH + sectionGap + triggerH + guardH;
|
|
63502
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
63503
|
+
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
|
|
63504
|
+
effects.map((eff, i) => {
|
|
63505
|
+
const rowY = secY + 22 + i * effectRowH;
|
|
63506
|
+
const effectType = mapEffectType(eff.type);
|
|
63507
|
+
const argsText = eff.args.length > 0 ? eff.args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" \xB7 ") : "";
|
|
63508
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
63509
|
+
/* @__PURE__ */ jsx(
|
|
63510
|
+
AvlEffect,
|
|
63511
|
+
{
|
|
63512
|
+
x: CONTENT_LEFT + 10,
|
|
63513
|
+
y: rowY + 6,
|
|
63514
|
+
effectType,
|
|
63515
|
+
size: 10,
|
|
63516
|
+
showBackground: true
|
|
63517
|
+
}
|
|
63518
|
+
),
|
|
63519
|
+
/* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
|
|
63520
|
+
argsText && /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28 + eff.type.length * 7 + 8, y: rowY + 10, fill: color, fontSize: 10, fontWeight: 400, opacity: 0.5, fontFamily: "monospace", children: argsText })
|
|
63521
|
+
] }, `eff-${i}`);
|
|
63522
|
+
})
|
|
63523
|
+
] });
|
|
63524
|
+
})(),
|
|
63525
|
+
hasSlots && (() => {
|
|
63526
|
+
const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
|
|
63527
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
63528
|
+
/* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
|
|
63529
|
+
data.slotTargets.map((slot, i) => {
|
|
63530
|
+
const rowY = secY + 22 + i * 22;
|
|
63531
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
63532
|
+
/* @__PURE__ */ jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
|
|
63533
|
+
/* @__PURE__ */ jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
|
|
63534
|
+
slot.name,
|
|
63535
|
+
": ",
|
|
63536
|
+
slot.pattern
|
|
63537
|
+
] })
|
|
63538
|
+
] }, `slot-${i}`);
|
|
63539
|
+
})
|
|
63540
|
+
] });
|
|
63541
|
+
})()
|
|
63542
|
+
] });
|
|
63543
|
+
};
|
|
63544
|
+
AvlTransitionScene.displayName = "AvlTransitionScene";
|
|
63511
63545
|
var AvlClickTarget = ({
|
|
63512
63546
|
x,
|
|
63513
63547
|
y,
|