@almadar/ui 4.54.7 → 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.js CHANGED
@@ -62277,14 +62277,17 @@ function FlowCanvasInner({
62277
62277
  trait: nodeData.traitName,
62278
62278
  transition: nodeData.transitionEvent
62279
62279
  });
62280
- } else {
62281
- const orbitalName = nodeData.orbitalName ?? node.id;
62282
- onNodeClick?.({ level: "overview", orbital: orbitalName });
62283
- onNodeSelect?.(orbitalName);
62284
- setExpandedOrbital(orbitalName);
62285
- setLevel("expanded");
62286
- onLevelChange?.("expanded", orbitalName);
62280
+ return;
62281
+ }
62282
+ if (level === "trait-expanded") {
62283
+ return;
62287
62284
  }
62285
+ const orbitalName = nodeData.orbitalName ?? node.id;
62286
+ onNodeClick?.({ level: "overview", orbital: orbitalName });
62287
+ onNodeSelect?.(orbitalName);
62288
+ setExpandedOrbital(orbitalName);
62289
+ setLevel("expanded");
62290
+ onLevelChange?.("expanded", orbitalName);
62288
62291
  }, [level, expandedOrbital, onNodeClick, onNodeSelect, onLevelChange]);
62289
62292
  const handleClosePanel = useCallback(() => {
62290
62293
  setSelectedNode(null);
@@ -62620,287 +62623,132 @@ AvlCosmicZoom.displayName = "AvlCosmicZoom";
62620
62623
  init_avl_schema_parser();
62621
62624
  init_avl_zoom_state();
62622
62625
 
62623
- // components/organisms/avl/AvlTransitionScene.tsx
62624
- init_AvlEffect();
62625
- init_types();
62626
- var CX = 300;
62627
- var CARD_W = 440;
62628
- var CARD_X = CX - CARD_W / 2;
62629
- var SECTION_LEFT = CARD_X + 16;
62630
- var CONTENT_LEFT = CARD_X + 24;
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`;
62638
+ }
62631
62639
  function flattenEffect(node) {
62632
- const args = [];
62633
- for (const child of node.children ?? []) {
62634
- args.push(child.label);
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]);
62663
+ const hasGuard = !!data.guard;
62664
+ const hasEffects = effects.length > 0;
62665
+ const hasSlots = data.slotTargets.length > 0;
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
+ ] }) }) });
62699
+ };
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;
62635
62709
  }
62636
- return { type: node.label, args };
62637
62710
  }
62638
- function mapEffectType(label) {
62639
- const valid = [
62640
- "render-ui",
62641
- "set",
62642
- "persist",
62643
- "fetch",
62644
- "emit",
62645
- "navigate",
62646
- "notify",
62647
- "call-service",
62648
- "spawn",
62649
- "despawn",
62650
- "do",
62651
- "if",
62652
- "log"
62653
- ];
62654
- return valid.includes(label) ? label : "log";
62711
+
62712
+ // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
62713
+ init_Box();
62714
+ init_Stack();
62715
+ init_Typography();
62716
+ init_Button();
62717
+ init_Icon();
62718
+ var UNIT_DISPLAY_W = 240;
62719
+ var UNIT_DISPLAY_H = 160;
62720
+ function layoutOrbitals(count, containerW, containerH) {
62721
+ if (count === 0) return [];
62722
+ if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
62723
+ const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
62724
+ const rows = Math.ceil(count / cols);
62725
+ const edgePad = 24;
62726
+ const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
62727
+ const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
62728
+ const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
62729
+ const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
62730
+ const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
62731
+ const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
62732
+ const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
62733
+ const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
62734
+ const gridW = (cols - 1) * stepX;
62735
+ const gridH = (rows - 1) * stepY;
62736
+ const originX = (containerW - gridW) / 2;
62737
+ const originY = (containerH - gridH) / 2;
62738
+ return Array.from({ length: count }, (_, i) => ({
62739
+ cx: originX + i % cols * stepX,
62740
+ cy: originY + Math.floor(i / cols) * stepY
62741
+ }));
62655
62742
  }
62656
- var AvlTransitionScene = ({
62657
- data,
62658
- color = "var(--color-primary)"
62659
- }) => {
62660
- const fromRole = getStateRole(data.from, true);
62661
- const toRole = getStateRole(data.to, false, false);
62662
- const fromColors = STATE_COLORS[fromRole];
62663
- const toColors = STATE_COLORS[toRole];
62664
- const hasGuard = !!data.guard;
62665
- const hasEffects = data.effects.length > 0;
62666
- const hasSlots = data.slotTargets.length > 0;
62667
- const effects = data.effects.map(flattenEffect);
62668
- const headerH = 52;
62669
- const sectionGap = 8;
62670
- const triggerH = 34;
62671
- const guardH = hasGuard ? 30 + sectionGap : 0;
62672
- const effectRowH = 28;
62673
- const effectsH = hasEffects ? 24 + effects.length * effectRowH + sectionGap : 0;
62674
- const slotsH = hasSlots ? 24 + data.slotTargets.length * 22 + sectionGap : 0;
62675
- const cardH = headerH + triggerH + guardH + effectsH + slotsH + 16;
62676
- const cardY = Math.max(20, (400 - cardH) / 2);
62677
- return /* @__PURE__ */ jsxs("g", { children: [
62678
- /* @__PURE__ */ jsx(
62679
- "rect",
62680
- {
62681
- x: CARD_X,
62682
- y: cardY,
62683
- width: CARD_W,
62684
- height: cardH,
62685
- rx: 12,
62686
- fill: "var(--color-surface, white)",
62687
- fillOpacity: 0.97,
62688
- stroke: color,
62689
- strokeWidth: 0.8,
62690
- strokeOpacity: 0.2
62691
- }
62692
- ),
62693
- /* @__PURE__ */ jsx(
62694
- "rect",
62695
- {
62696
- x: CARD_X,
62697
- y: cardY,
62698
- width: CARD_W,
62699
- height: headerH,
62700
- rx: 12,
62701
- fill: color,
62702
- fillOpacity: 0.03
62703
- }
62704
- ),
62705
- /* @__PURE__ */ jsx(
62706
- "rect",
62707
- {
62708
- x: CARD_X,
62709
- y: cardY + headerH - 12,
62710
- width: CARD_W,
62711
- height: 12,
62712
- fill: color,
62713
- fillOpacity: 0.03
62714
- }
62715
- ),
62716
- /* @__PURE__ */ jsx(
62717
- "rect",
62718
- {
62719
- x: CARD_X + 20,
62720
- y: cardY + 12,
62721
- width: 140,
62722
- height: 30,
62723
- rx: 15,
62724
- fill: fromColors.fill,
62725
- stroke: fromColors.border,
62726
- strokeWidth: 1.5
62727
- }
62728
- ),
62729
- /* @__PURE__ */ jsx(
62730
- "text",
62731
- {
62732
- x: CARD_X + 90,
62733
- y: cardY + 31,
62734
- textAnchor: "middle",
62735
- fill: fromColors.border,
62736
- fontSize: 14,
62737
- fontWeight: 600,
62738
- fontFamily: "inherit",
62739
- children: data.from
62740
- }
62741
- ),
62742
- /* @__PURE__ */ jsx(
62743
- "text",
62744
- {
62745
- x: CX,
62746
- y: cardY + 32,
62747
- textAnchor: "middle",
62748
- fill: color,
62749
- fontSize: 16,
62750
- opacity: 0.4,
62751
- fontFamily: "inherit",
62752
- children: "\u2192"
62753
- }
62754
- ),
62755
- /* @__PURE__ */ jsx(
62756
- "rect",
62757
- {
62758
- x: CARD_X + CARD_W - 160,
62759
- y: cardY + 12,
62760
- width: 140,
62761
- height: 30,
62762
- rx: 15,
62763
- fill: toColors.fill,
62764
- stroke: toColors.border,
62765
- strokeWidth: 1.5
62766
- }
62767
- ),
62768
- /* @__PURE__ */ jsx(
62769
- "text",
62770
- {
62771
- x: CARD_X + CARD_W - 90,
62772
- y: cardY + 31,
62773
- textAnchor: "middle",
62774
- fill: toColors.border,
62775
- fontSize: 14,
62776
- fontWeight: 600,
62777
- fontFamily: "inherit",
62778
- children: data.to
62779
- }
62780
- ),
62781
- /* @__PURE__ */ jsx(
62782
- "line",
62783
- {
62784
- x1: CARD_X + 12,
62785
- y1: cardY + headerH,
62786
- x2: CARD_X + CARD_W - 12,
62787
- y2: cardY + headerH,
62788
- stroke: color,
62789
- strokeWidth: 0.5,
62790
- opacity: 0.1
62791
- }
62792
- ),
62793
- (() => {
62794
- const secY = cardY + headerH + sectionGap;
62795
- return /* @__PURE__ */ jsxs("g", { children: [
62796
- /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "TRIGGER" }),
62797
- /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 14, y: secY + 28, fill: color, fontSize: 14, fontWeight: 600, fontFamily: "inherit", children: data.event }),
62798
- /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 4, y: secY + 28, fill: color, fontSize: 10, opacity: 0.5, children: "\u26A1" })
62799
- ] });
62800
- })(),
62801
- hasGuard && data.guard && (() => {
62802
- const secY = cardY + headerH + sectionGap + triggerH;
62803
- return /* @__PURE__ */ jsxs("g", { children: [
62804
- /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
62805
- /* @__PURE__ */ jsx(
62806
- "polygon",
62807
- {
62808
- points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
62809
- fill: "none",
62810
- stroke: color,
62811
- strokeWidth: 1,
62812
- opacity: 0.5
62813
- }
62814
- ),
62815
- /* @__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 })
62816
- ] });
62817
- })(),
62818
- hasEffects && (() => {
62819
- const secY = cardY + headerH + sectionGap + triggerH + guardH;
62820
- return /* @__PURE__ */ jsxs("g", { children: [
62821
- /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
62822
- effects.map((eff, i) => {
62823
- const rowY = secY + 22 + i * effectRowH;
62824
- const effectType = mapEffectType(eff.type);
62825
- const argsText = eff.args.length > 0 ? eff.args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" \xB7 ") : "";
62826
- return /* @__PURE__ */ jsxs("g", { children: [
62827
- /* @__PURE__ */ jsx(
62828
- AvlEffect,
62829
- {
62830
- x: CONTENT_LEFT + 10,
62831
- y: rowY + 6,
62832
- effectType,
62833
- size: 10,
62834
- showBackground: true
62835
- }
62836
- ),
62837
- /* @__PURE__ */ jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
62838
- 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 })
62839
- ] }, `eff-${i}`);
62840
- })
62841
- ] });
62842
- })(),
62843
- hasSlots && (() => {
62844
- const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
62845
- return /* @__PURE__ */ jsxs("g", { children: [
62846
- /* @__PURE__ */ jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
62847
- data.slotTargets.map((slot, i) => {
62848
- const rowY = secY + 22 + i * 22;
62849
- return /* @__PURE__ */ jsxs("g", { children: [
62850
- /* @__PURE__ */ jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
62851
- /* @__PURE__ */ jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
62852
- slot.name,
62853
- ": ",
62854
- slot.pattern
62855
- ] })
62856
- ] }, `slot-${i}`);
62857
- })
62858
- ] });
62859
- })()
62860
- ] });
62861
- };
62862
- AvlTransitionScene.displayName = "AvlTransitionScene";
62863
-
62864
- // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
62865
- init_Box();
62866
- init_Stack();
62867
- init_Typography();
62868
- init_Button();
62869
- init_Icon();
62870
- var UNIT_DISPLAY_W = 240;
62871
- var UNIT_DISPLAY_H = 160;
62872
- function layoutOrbitals(count, containerW, containerH) {
62873
- if (count === 0) return [];
62874
- if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
62875
- const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
62876
- const rows = Math.ceil(count / cols);
62877
- const edgePad = 24;
62878
- const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
62879
- const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
62880
- const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
62881
- const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
62882
- const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
62883
- const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
62884
- const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
62885
- const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
62886
- const gridW = (cols - 1) * stepX;
62887
- const gridH = (rows - 1) * stepY;
62888
- const originX = (containerW - gridW) / 2;
62889
- const originY = (containerH - gridH) / 2;
62890
- return Array.from({ length: count }, (_, i) => ({
62891
- cx: originX + i % cols * stepX,
62892
- cy: originY + Math.floor(i / cols) * stepY
62893
- }));
62894
- }
62895
- var avlOczWireId = 0;
62896
- var cosmicWireLog = createLogger("almadar:ui:nan-coord");
62897
- var EventWireOverlay = ({
62898
- orbitalViews,
62899
- crossLinks,
62900
- color,
62901
- animated,
62902
- containerW,
62903
- containerH
62743
+ var avlOczWireId = 0;
62744
+ var cosmicWireLog = createLogger("almadar:ui:nan-coord");
62745
+ var EventWireOverlay = ({
62746
+ orbitalViews,
62747
+ crossLinks,
62748
+ color,
62749
+ animated,
62750
+ containerW,
62751
+ containerH
62904
62752
  }) => {
62905
62753
  const ids = React96__default.useMemo(() => {
62906
62754
  avlOczWireId += 1;
@@ -63442,62 +63290,10 @@ var AvlOrbitalsCosmicZoom = ({
63442
63290
  paddingTop: 56,
63443
63291
  paddingBottom: 24,
63444
63292
  paddingLeft: 24,
63445
- paddingRight: 24
63446
- },
63447
- children: /* @__PURE__ */ jsx(
63448
- Box,
63449
- {
63450
- ref: transformWrapperRef,
63451
- position: "relative",
63452
- onPointerDown: handlePointerDown,
63453
- onPointerMove: handlePointerMove,
63454
- onPointerUp: handlePointerUp,
63455
- onPointerCancel: handlePointerUp,
63456
- style: {
63457
- width: "100%",
63458
- height: "100%",
63459
- cursor: dragStateRef.current ? "grabbing" : "grab",
63460
- overflow: "hidden"
63461
- },
63462
- children: /* @__PURE__ */ jsx(
63463
- Box,
63464
- {
63465
- position: "absolute",
63466
- style: {
63467
- inset: 0,
63468
- transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
63469
- transformOrigin: "0 0"
63470
- },
63471
- children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
63472
- AvlTransitionScene,
63473
- {
63474
- data: transitionLevelData,
63475
- color
63476
- }
63477
- ) })
63478
- }
63479
- )
63480
- }
63481
- )
63482
- }
63483
- ),
63484
- state.level === "transition" && /* @__PURE__ */ jsxs(
63485
- Box,
63486
- {
63487
- position: "absolute",
63488
- style: {
63489
- top: 12,
63490
- right: 12,
63491
- display: "flex",
63492
- flexDirection: "column",
63493
- gap: 4,
63494
- zIndex: 30
63293
+ paddingRight: 24,
63294
+ overflowY: "auto"
63495
63295
  },
63496
- children: [
63497
- /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsx(Icon, { name: "plus", size: "sm" }) }),
63498
- /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsx(Icon, { name: "minus", size: "sm" }) }),
63499
- /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsx(Icon, { name: "maximize", size: "sm" }) })
63500
- ]
63296
+ children: /* @__PURE__ */ jsx(AvlTransitionDetail, { data: transitionLevelData })
63501
63297
  }
63502
63298
  )
63503
63299
  ]
@@ -63505,6 +63301,247 @@ var AvlOrbitalsCosmicZoom = ({
63505
63301
  );
63506
63302
  };
63507
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";
63508
63545
  var AvlClickTarget = ({
63509
63546
  x,
63510
63547
  y,