@almadar/ui 4.54.8 → 4.54.10

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.js CHANGED
@@ -62053,30 +62053,39 @@ var TraitCardNodeInner = (props) => {
62053
62053
  /* @__PURE__ */ jsx(Typography, { variant: "h6", weight: "semibold", children: traitName }),
62054
62054
  linkedEntity ? /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: linkedEntity }) : null
62055
62055
  ] }),
62056
- traitLevelData ? /* @__PURE__ */ jsx(
62057
- "svg",
62058
- {
62059
- viewBox: `0 0 ${SCENE_WIDTH} ${SCENE_HEIGHT}`,
62060
- style: { width: "100%", height: "auto", display: "block" },
62061
- children: /* @__PURE__ */ jsx(
62062
- AvlTraitScene,
62063
- {
62064
- data: traitLevelData,
62065
- onTransitionClick: (idx) => {
62066
- const t = transitions[idx];
62067
- if (!t) return;
62068
- selectTransition({
62069
- orbitalName,
62070
- traitName,
62071
- transitionEvent: t.event,
62072
- fromState: t.fromState,
62073
- toState: t.toState,
62074
- index: idx
62075
- });
62056
+ traitLevelData ? (
62057
+ // `nodrag` + `nowheel` tell xyflow to skip its drag/wheel
62058
+ // handlers on this element, so transition-arc clicks inside
62059
+ // the SVG actually reach React's onClick handlers instead of
62060
+ // being swallowed by the node-drag behavior. `nopan` keeps the
62061
+ // ReactFlow canvas from panning when the user scrolls or
62062
+ // pans within the trait card.
62063
+ /* @__PURE__ */ jsx(
62064
+ "svg",
62065
+ {
62066
+ viewBox: `0 0 ${SCENE_WIDTH} ${SCENE_HEIGHT}`,
62067
+ className: "nodrag nopan nowheel",
62068
+ style: { width: "100%", height: "auto", display: "block" },
62069
+ children: /* @__PURE__ */ jsx(
62070
+ AvlTraitScene,
62071
+ {
62072
+ data: traitLevelData,
62073
+ onTransitionClick: (idx) => {
62074
+ const t = transitions[idx];
62075
+ if (!t) return;
62076
+ selectTransition({
62077
+ orbitalName,
62078
+ traitName,
62079
+ transitionEvent: t.event,
62080
+ fromState: t.fromState,
62081
+ toState: t.toState,
62082
+ index: idx
62083
+ });
62084
+ }
62076
62085
  }
62077
- }
62078
- )
62079
- }
62086
+ )
62087
+ }
62088
+ )
62080
62089
  ) : /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "No state machine" })
62081
62090
  ] })
62082
62091
  ]
@@ -62623,287 +62632,132 @@ AvlCosmicZoom.displayName = "AvlCosmicZoom";
62623
62632
  init_avl_schema_parser();
62624
62633
  init_avl_zoom_state();
62625
62634
 
62626
- // components/organisms/avl/AvlTransitionScene.tsx
62627
- init_AvlEffect();
62628
- init_types();
62629
- var CX = 300;
62630
- var CARD_W = 440;
62631
- var CARD_X = CX - CARD_W / 2;
62632
- var SECTION_LEFT = CARD_X + 16;
62633
- var CONTENT_LEFT = CARD_X + 24;
62635
+ // components/organisms/avl/AvlTransitionDetail.tsx
62636
+ init_Card();
62637
+ init_Box();
62638
+ init_Stack();
62639
+ init_Typography();
62640
+ init_Badge();
62641
+ init_Accordion();
62642
+ init_CodeBlock();
62643
+ function summarizeArg(node) {
62644
+ const label = node.label;
62645
+ if (label.length <= 32) return label;
62646
+ return `${label.slice(0, 30)}\u2026`;
62647
+ }
62634
62648
  function flattenEffect(node) {
62635
- const args = [];
62636
- for (const child of node.children ?? []) {
62637
- args.push(child.label);
62649
+ const args = node.children ?? [];
62650
+ const argSummary = args.slice(0, 2).map(summarizeArg).join(" \xB7 ");
62651
+ return { type: node.label, args, argSummary };
62652
+ }
62653
+ var AvlTransitionDetail = ({ data }) => {
62654
+ const effects = useMemo(() => data.effects.map(flattenEffect), [data.effects]);
62655
+ const accordionItems = useMemo(() => {
62656
+ return effects.map((eff, i) => {
62657
+ const code = JSON.stringify(
62658
+ [eff.type, ...eff.args.map((a) => safeParseLabel(a.label))],
62659
+ null,
62660
+ 2
62661
+ );
62662
+ return {
62663
+ id: `effect-${i}`,
62664
+ header: /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
62665
+ /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: eff.type }),
62666
+ eff.argSummary ? /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: eff.argSummary }) : null
62667
+ ] }),
62668
+ content: /* @__PURE__ */ jsx(CodeBlock, { code, language: "json", maxHeight: "320px" })
62669
+ };
62670
+ });
62671
+ }, [effects]);
62672
+ const hasGuard = !!data.guard;
62673
+ const hasEffects = effects.length > 0;
62674
+ const hasSlots = data.slotTargets.length > 0;
62675
+ 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: [
62676
+ /* @__PURE__ */ jsxs(HStack, { gap: "md", justify: "center", align: "center", children: [
62677
+ /* @__PURE__ */ jsx(Badge, { variant: "success", size: "lg", children: data.from }),
62678
+ /* @__PURE__ */ jsx(Typography, { variant: "h5", color: "muted", children: "\u2192" }),
62679
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", size: "lg", children: data.to })
62680
+ ] }),
62681
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
62682
+ /* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: "TRIGGER" }),
62683
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: /* @__PURE__ */ jsxs(Typography, { variant: "body1", weight: "semibold", children: [
62684
+ "\u26A1 ",
62685
+ data.event
62686
+ ] }) })
62687
+ ] }),
62688
+ hasGuard && data.guard && /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
62689
+ /* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: "GUARD" }),
62690
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", children: data.guard.label })
62691
+ ] }),
62692
+ hasEffects && /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
62693
+ /* @__PURE__ */ jsxs(Typography, { variant: "overline", color: "muted", children: [
62694
+ "EFFECTS (",
62695
+ effects.length,
62696
+ ")"
62697
+ ] }),
62698
+ /* @__PURE__ */ jsx(Accordion, { items: accordionItems, multiple: true })
62699
+ ] }),
62700
+ hasSlots && /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
62701
+ /* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: "SLOTS" }),
62702
+ /* @__PURE__ */ jsx(VStack, { gap: "xs", children: data.slotTargets.map((slot, i) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
62703
+ /* @__PURE__ */ jsx(Badge, { variant: "info", size: "sm", children: slot.name }),
62704
+ /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: slot.pattern })
62705
+ ] }, `slot-${i}`)) })
62706
+ ] })
62707
+ ] }) }) });
62708
+ };
62709
+ AvlTransitionDetail.displayName = "AvlTransitionDetail";
62710
+ function safeParseLabel(label) {
62711
+ if (typeof label !== "string") return label;
62712
+ const trimmed = label.trim();
62713
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return label;
62714
+ try {
62715
+ return JSON.parse(trimmed);
62716
+ } catch {
62717
+ return label;
62638
62718
  }
62639
- return { type: node.label, args };
62640
62719
  }
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";
62720
+
62721
+ // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
62722
+ init_Box();
62723
+ init_Stack();
62724
+ init_Typography();
62725
+ init_Button();
62726
+ init_Icon();
62727
+ var UNIT_DISPLAY_W = 240;
62728
+ var UNIT_DISPLAY_H = 160;
62729
+ function layoutOrbitals(count, containerW, containerH) {
62730
+ if (count === 0) return [];
62731
+ if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
62732
+ const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
62733
+ const rows = Math.ceil(count / cols);
62734
+ const edgePad = 24;
62735
+ const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
62736
+ const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
62737
+ const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
62738
+ const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
62739
+ const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
62740
+ const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
62741
+ const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
62742
+ const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
62743
+ const gridW = (cols - 1) * stepX;
62744
+ const gridH = (rows - 1) * stepY;
62745
+ const originX = (containerW - gridW) / 2;
62746
+ const originY = (containerH - gridH) / 2;
62747
+ return Array.from({ length: count }, (_, i) => ({
62748
+ cx: originX + i % cols * stepX,
62749
+ cy: originY + Math.floor(i / cols) * stepY
62750
+ }));
62658
62751
  }
62659
- var AvlTransitionScene = ({
62660
- data,
62661
- color = "var(--color-primary)"
62662
- }) => {
62663
- const fromRole = getStateRole(data.from, true);
62664
- const toRole = getStateRole(data.to, false, false);
62665
- const fromColors = STATE_COLORS[fromRole];
62666
- const toColors = STATE_COLORS[toRole];
62667
- const hasGuard = !!data.guard;
62668
- const hasEffects = data.effects.length > 0;
62669
- const hasSlots = data.slotTargets.length > 0;
62670
- const effects = data.effects.map(flattenEffect);
62671
- const headerH = 52;
62672
- const sectionGap = 8;
62673
- const triggerH = 34;
62674
- const guardH = hasGuard ? 30 + sectionGap : 0;
62675
- const effectRowH = 28;
62676
- const effectsH = hasEffects ? 24 + effects.length * effectRowH + sectionGap : 0;
62677
- const slotsH = hasSlots ? 24 + data.slotTargets.length * 22 + sectionGap : 0;
62678
- const cardH = headerH + triggerH + guardH + effectsH + slotsH + 16;
62679
- const cardY = Math.max(20, (400 - cardH) / 2);
62680
- return /* @__PURE__ */ jsxs("g", { children: [
62681
- /* @__PURE__ */ jsx(
62682
- "rect",
62683
- {
62684
- x: CARD_X,
62685
- y: cardY,
62686
- width: CARD_W,
62687
- height: cardH,
62688
- rx: 12,
62689
- fill: "var(--color-surface, white)",
62690
- fillOpacity: 0.97,
62691
- stroke: color,
62692
- strokeWidth: 0.8,
62693
- strokeOpacity: 0.2
62694
- }
62695
- ),
62696
- /* @__PURE__ */ jsx(
62697
- "rect",
62698
- {
62699
- x: CARD_X,
62700
- y: cardY,
62701
- width: CARD_W,
62702
- height: headerH,
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
- ] });
62864
- };
62865
- AvlTransitionScene.displayName = "AvlTransitionScene";
62866
-
62867
- // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
62868
- init_Box();
62869
- init_Stack();
62870
- init_Typography();
62871
- init_Button();
62872
- init_Icon();
62873
- var UNIT_DISPLAY_W = 240;
62874
- var UNIT_DISPLAY_H = 160;
62875
- function layoutOrbitals(count, containerW, containerH) {
62876
- if (count === 0) return [];
62877
- if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
62878
- const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
62879
- const rows = Math.ceil(count / cols);
62880
- const edgePad = 24;
62881
- const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
62882
- const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
62883
- const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
62884
- const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
62885
- const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
62886
- const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
62887
- const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
62888
- const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
62889
- const gridW = (cols - 1) * stepX;
62890
- const gridH = (rows - 1) * stepY;
62891
- const originX = (containerW - gridW) / 2;
62892
- const originY = (containerH - gridH) / 2;
62893
- return Array.from({ length: count }, (_, i) => ({
62894
- cx: originX + i % cols * stepX,
62895
- cy: originY + Math.floor(i / cols) * stepY
62896
- }));
62897
- }
62898
- var avlOczWireId = 0;
62899
- var cosmicWireLog = createLogger("almadar:ui:nan-coord");
62900
- var EventWireOverlay = ({
62901
- orbitalViews,
62902
- crossLinks,
62903
- color,
62904
- animated,
62905
- containerW,
62906
- containerH
62752
+ var avlOczWireId = 0;
62753
+ var cosmicWireLog = createLogger("almadar:ui:nan-coord");
62754
+ var EventWireOverlay = ({
62755
+ orbitalViews,
62756
+ crossLinks,
62757
+ color,
62758
+ animated,
62759
+ containerW,
62760
+ containerH
62907
62761
  }) => {
62908
62762
  const ids = React96__default.useMemo(() => {
62909
62763
  avlOczWireId += 1;
@@ -63445,62 +63299,10 @@ var AvlOrbitalsCosmicZoom = ({
63445
63299
  paddingTop: 56,
63446
63300
  paddingBottom: 24,
63447
63301
  paddingLeft: 24,
63448
- paddingRight: 24
63302
+ paddingRight: 24,
63303
+ overflowY: "auto"
63449
63304
  },
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
- )
63483
- }
63484
- )
63485
- }
63486
- ),
63487
- state.level === "transition" && /* @__PURE__ */ jsxs(
63488
- Box,
63489
- {
63490
- position: "absolute",
63491
- style: {
63492
- top: 12,
63493
- right: 12,
63494
- display: "flex",
63495
- flexDirection: "column",
63496
- gap: 4,
63497
- zIndex: 30
63498
- },
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
- ]
63305
+ children: /* @__PURE__ */ jsx(AvlTransitionDetail, { data: transitionLevelData })
63504
63306
  }
63505
63307
  )
63506
63308
  ]
@@ -63508,6 +63310,247 @@ var AvlOrbitalsCosmicZoom = ({
63508
63310
  );
63509
63311
  };
63510
63312
  AvlOrbitalsCosmicZoom.displayName = "AvlOrbitalsCosmicZoom";
63313
+
63314
+ // components/organisms/avl/AvlTransitionScene.tsx
63315
+ init_AvlEffect();
63316
+ init_types();
63317
+ var CX = 300;
63318
+ var CARD_W = 440;
63319
+ var CARD_X = CX - CARD_W / 2;
63320
+ var SECTION_LEFT = CARD_X + 16;
63321
+ var CONTENT_LEFT = CARD_X + 24;
63322
+ function flattenEffect2(node) {
63323
+ const args = [];
63324
+ for (const child of node.children ?? []) {
63325
+ args.push(child.label);
63326
+ }
63327
+ return { type: node.label, args };
63328
+ }
63329
+ function mapEffectType(label) {
63330
+ const valid = [
63331
+ "render-ui",
63332
+ "set",
63333
+ "persist",
63334
+ "fetch",
63335
+ "emit",
63336
+ "navigate",
63337
+ "notify",
63338
+ "call-service",
63339
+ "spawn",
63340
+ "despawn",
63341
+ "do",
63342
+ "if",
63343
+ "log"
63344
+ ];
63345
+ return valid.includes(label) ? label : "log";
63346
+ }
63347
+ var AvlTransitionScene = ({
63348
+ data,
63349
+ color = "var(--color-primary)"
63350
+ }) => {
63351
+ const fromRole = getStateRole(data.from, true);
63352
+ const toRole = getStateRole(data.to, false, false);
63353
+ const fromColors = STATE_COLORS[fromRole];
63354
+ const toColors = STATE_COLORS[toRole];
63355
+ const hasGuard = !!data.guard;
63356
+ const hasEffects = data.effects.length > 0;
63357
+ const hasSlots = data.slotTargets.length > 0;
63358
+ const effects = data.effects.map(flattenEffect2);
63359
+ const headerH = 52;
63360
+ const sectionGap = 8;
63361
+ const triggerH = 34;
63362
+ const guardH = hasGuard ? 30 + sectionGap : 0;
63363
+ const effectRowH = 28;
63364
+ const effectsH = hasEffects ? 24 + effects.length * effectRowH + sectionGap : 0;
63365
+ const slotsH = hasSlots ? 24 + data.slotTargets.length * 22 + sectionGap : 0;
63366
+ const cardH = headerH + triggerH + guardH + effectsH + slotsH + 16;
63367
+ const cardY = Math.max(20, (400 - cardH) / 2);
63368
+ return /* @__PURE__ */ jsxs("g", { children: [
63369
+ /* @__PURE__ */ jsx(
63370
+ "rect",
63371
+ {
63372
+ x: CARD_X,
63373
+ y: cardY,
63374
+ width: CARD_W,
63375
+ height: cardH,
63376
+ rx: 12,
63377
+ fill: "var(--color-surface, white)",
63378
+ fillOpacity: 0.97,
63379
+ stroke: color,
63380
+ strokeWidth: 0.8,
63381
+ strokeOpacity: 0.2
63382
+ }
63383
+ ),
63384
+ /* @__PURE__ */ jsx(
63385
+ "rect",
63386
+ {
63387
+ x: CARD_X,
63388
+ y: cardY,
63389
+ width: CARD_W,
63390
+ height: headerH,
63391
+ rx: 12,
63392
+ fill: color,
63393
+ fillOpacity: 0.03
63394
+ }
63395
+ ),
63396
+ /* @__PURE__ */ jsx(
63397
+ "rect",
63398
+ {
63399
+ x: CARD_X,
63400
+ y: cardY + headerH - 12,
63401
+ width: CARD_W,
63402
+ height: 12,
63403
+ fill: color,
63404
+ fillOpacity: 0.03
63405
+ }
63406
+ ),
63407
+ /* @__PURE__ */ jsx(
63408
+ "rect",
63409
+ {
63410
+ x: CARD_X + 20,
63411
+ y: cardY + 12,
63412
+ width: 140,
63413
+ height: 30,
63414
+ rx: 15,
63415
+ fill: fromColors.fill,
63416
+ stroke: fromColors.border,
63417
+ strokeWidth: 1.5
63418
+ }
63419
+ ),
63420
+ /* @__PURE__ */ jsx(
63421
+ "text",
63422
+ {
63423
+ x: CARD_X + 90,
63424
+ y: cardY + 31,
63425
+ textAnchor: "middle",
63426
+ fill: fromColors.border,
63427
+ fontSize: 14,
63428
+ fontWeight: 600,
63429
+ fontFamily: "inherit",
63430
+ children: data.from
63431
+ }
63432
+ ),
63433
+ /* @__PURE__ */ jsx(
63434
+ "text",
63435
+ {
63436
+ x: CX,
63437
+ y: cardY + 32,
63438
+ textAnchor: "middle",
63439
+ fill: color,
63440
+ fontSize: 16,
63441
+ opacity: 0.4,
63442
+ fontFamily: "inherit",
63443
+ children: "\u2192"
63444
+ }
63445
+ ),
63446
+ /* @__PURE__ */ jsx(
63447
+ "rect",
63448
+ {
63449
+ x: CARD_X + CARD_W - 160,
63450
+ y: cardY + 12,
63451
+ width: 140,
63452
+ height: 30,
63453
+ rx: 15,
63454
+ fill: toColors.fill,
63455
+ stroke: toColors.border,
63456
+ strokeWidth: 1.5
63457
+ }
63458
+ ),
63459
+ /* @__PURE__ */ jsx(
63460
+ "text",
63461
+ {
63462
+ x: CARD_X + CARD_W - 90,
63463
+ y: cardY + 31,
63464
+ textAnchor: "middle",
63465
+ fill: toColors.border,
63466
+ fontSize: 14,
63467
+ fontWeight: 600,
63468
+ fontFamily: "inherit",
63469
+ children: data.to
63470
+ }
63471
+ ),
63472
+ /* @__PURE__ */ jsx(
63473
+ "line",
63474
+ {
63475
+ x1: CARD_X + 12,
63476
+ y1: cardY + headerH,
63477
+ x2: CARD_X + CARD_W - 12,
63478
+ y2: cardY + headerH,
63479
+ stroke: color,
63480
+ strokeWidth: 0.5,
63481
+ opacity: 0.1
63482
+ }
63483
+ ),
63484
+ (() => {
63485
+ const secY = cardY + headerH + sectionGap;
63486
+ return /* @__PURE__ */ jsxs("g", { children: [
63487
+ /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "TRIGGER" }),
63488
+ /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 14, y: secY + 28, fill: color, fontSize: 14, fontWeight: 600, fontFamily: "inherit", children: data.event }),
63489
+ /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 4, y: secY + 28, fill: color, fontSize: 10, opacity: 0.5, children: "\u26A1" })
63490
+ ] });
63491
+ })(),
63492
+ hasGuard && data.guard && (() => {
63493
+ const secY = cardY + headerH + sectionGap + triggerH;
63494
+ return /* @__PURE__ */ jsxs("g", { children: [
63495
+ /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
63496
+ /* @__PURE__ */ jsx(
63497
+ "polygon",
63498
+ {
63499
+ points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
63500
+ fill: "none",
63501
+ stroke: color,
63502
+ strokeWidth: 1,
63503
+ opacity: 0.5
63504
+ }
63505
+ ),
63506
+ /* @__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 })
63507
+ ] });
63508
+ })(),
63509
+ hasEffects && (() => {
63510
+ const secY = cardY + headerH + sectionGap + triggerH + guardH;
63511
+ return /* @__PURE__ */ jsxs("g", { children: [
63512
+ /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
63513
+ effects.map((eff, i) => {
63514
+ const rowY = secY + 22 + i * effectRowH;
63515
+ const effectType = mapEffectType(eff.type);
63516
+ const argsText = eff.args.length > 0 ? eff.args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" \xB7 ") : "";
63517
+ return /* @__PURE__ */ jsxs("g", { children: [
63518
+ /* @__PURE__ */ jsx(
63519
+ AvlEffect,
63520
+ {
63521
+ x: CONTENT_LEFT + 10,
63522
+ y: rowY + 6,
63523
+ effectType,
63524
+ size: 10,
63525
+ showBackground: true
63526
+ }
63527
+ ),
63528
+ /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
63529
+ 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 })
63530
+ ] }, `eff-${i}`);
63531
+ })
63532
+ ] });
63533
+ })(),
63534
+ hasSlots && (() => {
63535
+ const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
63536
+ return /* @__PURE__ */ jsxs("g", { children: [
63537
+ /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
63538
+ data.slotTargets.map((slot, i) => {
63539
+ const rowY = secY + 22 + i * 22;
63540
+ return /* @__PURE__ */ jsxs("g", { children: [
63541
+ /* @__PURE__ */ jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
63542
+ /* @__PURE__ */ jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
63543
+ slot.name,
63544
+ ": ",
63545
+ slot.pattern
63546
+ ] })
63547
+ ] }, `slot-${i}`);
63548
+ })
63549
+ ] });
63550
+ })()
63551
+ ] });
63552
+ };
63553
+ AvlTransitionScene.displayName = "AvlTransitionScene";
63511
63554
  var AvlClickTarget = ({
63512
63555
  x,
63513
63556
  y,