@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.
@@ -62323,14 +62323,17 @@ function FlowCanvasInner({
62323
62323
  trait: nodeData.traitName,
62324
62324
  transition: nodeData.transitionEvent
62325
62325
  });
62326
- } else {
62327
- const orbitalName = nodeData.orbitalName ?? node.id;
62328
- onNodeClick?.({ level: "overview", orbital: orbitalName });
62329
- onNodeSelect?.(orbitalName);
62330
- setExpandedOrbital(orbitalName);
62331
- setLevel("expanded");
62332
- onLevelChange?.("expanded", orbitalName);
62326
+ return;
62327
+ }
62328
+ if (level === "trait-expanded") {
62329
+ return;
62333
62330
  }
62331
+ const orbitalName = nodeData.orbitalName ?? node.id;
62332
+ onNodeClick?.({ level: "overview", orbital: orbitalName });
62333
+ onNodeSelect?.(orbitalName);
62334
+ setExpandedOrbital(orbitalName);
62335
+ setLevel("expanded");
62336
+ onLevelChange?.("expanded", orbitalName);
62334
62337
  }, [level, expandedOrbital, onNodeClick, onNodeSelect, onLevelChange]);
62335
62338
  const handleClosePanel = React96.useCallback(() => {
62336
62339
  setSelectedNode(null);
@@ -62666,287 +62669,132 @@ AvlCosmicZoom.displayName = "AvlCosmicZoom";
62666
62669
  init_avl_schema_parser();
62667
62670
  init_avl_zoom_state();
62668
62671
 
62669
- // components/organisms/avl/AvlTransitionScene.tsx
62670
- init_AvlEffect();
62671
- init_types();
62672
- var CX = 300;
62673
- var CARD_W = 440;
62674
- var CARD_X = CX - CARD_W / 2;
62675
- var SECTION_LEFT = CARD_X + 16;
62676
- var CONTENT_LEFT = CARD_X + 24;
62672
+ // components/organisms/avl/AvlTransitionDetail.tsx
62673
+ init_Card();
62674
+ init_Box();
62675
+ init_Stack();
62676
+ init_Typography();
62677
+ init_Badge();
62678
+ init_Accordion();
62679
+ init_CodeBlock();
62680
+ function summarizeArg(node) {
62681
+ const label = node.label;
62682
+ if (label.length <= 32) return label;
62683
+ return `${label.slice(0, 30)}\u2026`;
62684
+ }
62677
62685
  function flattenEffect(node) {
62678
- const args = [];
62679
- for (const child of node.children ?? []) {
62680
- args.push(child.label);
62686
+ const args = node.children ?? [];
62687
+ const argSummary = args.slice(0, 2).map(summarizeArg).join(" \xB7 ");
62688
+ return { type: node.label, args, argSummary };
62689
+ }
62690
+ var AvlTransitionDetail = ({ data }) => {
62691
+ const effects = React96.useMemo(() => data.effects.map(flattenEffect), [data.effects]);
62692
+ const accordionItems = React96.useMemo(() => {
62693
+ return effects.map((eff, i) => {
62694
+ const code = JSON.stringify(
62695
+ [eff.type, ...eff.args.map((a) => safeParseLabel(a.label))],
62696
+ null,
62697
+ 2
62698
+ );
62699
+ return {
62700
+ id: `effect-${i}`,
62701
+ header: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "center", children: [
62702
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: eff.type }),
62703
+ eff.argSummary ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "muted", children: eff.argSummary }) : null
62704
+ ] }),
62705
+ content: /* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { code, language: "json", maxHeight: "320px" })
62706
+ };
62707
+ });
62708
+ }, [effects]);
62709
+ const hasGuard = !!data.guard;
62710
+ const hasEffects = effects.length > 0;
62711
+ const hasSlots = data.slotTargets.length > 0;
62712
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: "w-full max-w-3xl mx-auto", shadow: "md", children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "p-6", children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "lg", children: [
62713
+ /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", justify: "center", align: "center", children: [
62714
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", size: "lg", children: data.from }),
62715
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h5", color: "muted", children: "\u2192" }),
62716
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "neutral", size: "lg", children: data.to })
62717
+ ] }),
62718
+ /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
62719
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "overline", color: "muted", children: "TRIGGER" }),
62720
+ /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", children: /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "body1", weight: "semibold", children: [
62721
+ "\u26A1 ",
62722
+ data.event
62723
+ ] }) })
62724
+ ] }),
62725
+ hasGuard && data.guard && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
62726
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "overline", color: "muted", children: "GUARD" }),
62727
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "muted", children: data.guard.label })
62728
+ ] }),
62729
+ hasEffects && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
62730
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "overline", color: "muted", children: [
62731
+ "EFFECTS (",
62732
+ effects.length,
62733
+ ")"
62734
+ ] }),
62735
+ /* @__PURE__ */ jsxRuntime.jsx(Accordion, { items: accordionItems, multiple: true })
62736
+ ] }),
62737
+ hasSlots && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
62738
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "overline", color: "muted", children: "SLOTS" }),
62739
+ /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "xs", children: data.slotTargets.map((slot, i) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "center", children: [
62740
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "info", size: "sm", children: slot.name }),
62741
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "muted", children: slot.pattern })
62742
+ ] }, `slot-${i}`)) })
62743
+ ] })
62744
+ ] }) }) });
62745
+ };
62746
+ AvlTransitionDetail.displayName = "AvlTransitionDetail";
62747
+ function safeParseLabel(label) {
62748
+ if (typeof label !== "string") return label;
62749
+ const trimmed = label.trim();
62750
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return label;
62751
+ try {
62752
+ return JSON.parse(trimmed);
62753
+ } catch {
62754
+ return label;
62681
62755
  }
62682
- return { type: node.label, args };
62683
62756
  }
62684
- function mapEffectType(label) {
62685
- const valid = [
62686
- "render-ui",
62687
- "set",
62688
- "persist",
62689
- "fetch",
62690
- "emit",
62691
- "navigate",
62692
- "notify",
62693
- "call-service",
62694
- "spawn",
62695
- "despawn",
62696
- "do",
62697
- "if",
62698
- "log"
62699
- ];
62700
- return valid.includes(label) ? label : "log";
62757
+
62758
+ // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
62759
+ init_Box();
62760
+ init_Stack();
62761
+ init_Typography();
62762
+ init_Button();
62763
+ init_Icon();
62764
+ var UNIT_DISPLAY_W = 240;
62765
+ var UNIT_DISPLAY_H = 160;
62766
+ function layoutOrbitals(count, containerW, containerH) {
62767
+ if (count === 0) return [];
62768
+ if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
62769
+ const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
62770
+ const rows = Math.ceil(count / cols);
62771
+ const edgePad = 24;
62772
+ const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
62773
+ const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
62774
+ const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
62775
+ const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
62776
+ const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
62777
+ const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
62778
+ const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
62779
+ const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
62780
+ const gridW = (cols - 1) * stepX;
62781
+ const gridH = (rows - 1) * stepY;
62782
+ const originX = (containerW - gridW) / 2;
62783
+ const originY = (containerH - gridH) / 2;
62784
+ return Array.from({ length: count }, (_, i) => ({
62785
+ cx: originX + i % cols * stepX,
62786
+ cy: originY + Math.floor(i / cols) * stepY
62787
+ }));
62701
62788
  }
62702
- var AvlTransitionScene = ({
62703
- data,
62704
- color = "var(--color-primary)"
62705
- }) => {
62706
- const fromRole = getStateRole(data.from, true);
62707
- const toRole = getStateRole(data.to, false, false);
62708
- const fromColors = exports.STATE_COLORS[fromRole];
62709
- const toColors = exports.STATE_COLORS[toRole];
62710
- const hasGuard = !!data.guard;
62711
- const hasEffects = data.effects.length > 0;
62712
- const hasSlots = data.slotTargets.length > 0;
62713
- const effects = data.effects.map(flattenEffect);
62714
- const headerH = 52;
62715
- const sectionGap = 8;
62716
- const triggerH = 34;
62717
- const guardH = hasGuard ? 30 + sectionGap : 0;
62718
- const effectRowH = 28;
62719
- const effectsH = hasEffects ? 24 + effects.length * effectRowH + sectionGap : 0;
62720
- const slotsH = hasSlots ? 24 + data.slotTargets.length * 22 + sectionGap : 0;
62721
- const cardH = headerH + triggerH + guardH + effectsH + slotsH + 16;
62722
- const cardY = Math.max(20, (400 - cardH) / 2);
62723
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
62724
- /* @__PURE__ */ jsxRuntime.jsx(
62725
- "rect",
62726
- {
62727
- x: CARD_X,
62728
- y: cardY,
62729
- width: CARD_W,
62730
- height: cardH,
62731
- rx: 12,
62732
- fill: "var(--color-surface, white)",
62733
- fillOpacity: 0.97,
62734
- stroke: color,
62735
- strokeWidth: 0.8,
62736
- strokeOpacity: 0.2
62737
- }
62738
- ),
62739
- /* @__PURE__ */ jsxRuntime.jsx(
62740
- "rect",
62741
- {
62742
- x: CARD_X,
62743
- y: cardY,
62744
- width: CARD_W,
62745
- height: headerH,
62746
- rx: 12,
62747
- fill: color,
62748
- fillOpacity: 0.03
62749
- }
62750
- ),
62751
- /* @__PURE__ */ jsxRuntime.jsx(
62752
- "rect",
62753
- {
62754
- x: CARD_X,
62755
- y: cardY + headerH - 12,
62756
- width: CARD_W,
62757
- height: 12,
62758
- fill: color,
62759
- fillOpacity: 0.03
62760
- }
62761
- ),
62762
- /* @__PURE__ */ jsxRuntime.jsx(
62763
- "rect",
62764
- {
62765
- x: CARD_X + 20,
62766
- y: cardY + 12,
62767
- width: 140,
62768
- height: 30,
62769
- rx: 15,
62770
- fill: fromColors.fill,
62771
- stroke: fromColors.border,
62772
- strokeWidth: 1.5
62773
- }
62774
- ),
62775
- /* @__PURE__ */ jsxRuntime.jsx(
62776
- "text",
62777
- {
62778
- x: CARD_X + 90,
62779
- y: cardY + 31,
62780
- textAnchor: "middle",
62781
- fill: fromColors.border,
62782
- fontSize: 14,
62783
- fontWeight: 600,
62784
- fontFamily: "inherit",
62785
- children: data.from
62786
- }
62787
- ),
62788
- /* @__PURE__ */ jsxRuntime.jsx(
62789
- "text",
62790
- {
62791
- x: CX,
62792
- y: cardY + 32,
62793
- textAnchor: "middle",
62794
- fill: color,
62795
- fontSize: 16,
62796
- opacity: 0.4,
62797
- fontFamily: "inherit",
62798
- children: "\u2192"
62799
- }
62800
- ),
62801
- /* @__PURE__ */ jsxRuntime.jsx(
62802
- "rect",
62803
- {
62804
- x: CARD_X + CARD_W - 160,
62805
- y: cardY + 12,
62806
- width: 140,
62807
- height: 30,
62808
- rx: 15,
62809
- fill: toColors.fill,
62810
- stroke: toColors.border,
62811
- strokeWidth: 1.5
62812
- }
62813
- ),
62814
- /* @__PURE__ */ jsxRuntime.jsx(
62815
- "text",
62816
- {
62817
- x: CARD_X + CARD_W - 90,
62818
- y: cardY + 31,
62819
- textAnchor: "middle",
62820
- fill: toColors.border,
62821
- fontSize: 14,
62822
- fontWeight: 600,
62823
- fontFamily: "inherit",
62824
- children: data.to
62825
- }
62826
- ),
62827
- /* @__PURE__ */ jsxRuntime.jsx(
62828
- "line",
62829
- {
62830
- x1: CARD_X + 12,
62831
- y1: cardY + headerH,
62832
- x2: CARD_X + CARD_W - 12,
62833
- y2: cardY + headerH,
62834
- stroke: color,
62835
- strokeWidth: 0.5,
62836
- opacity: 0.1
62837
- }
62838
- ),
62839
- (() => {
62840
- const secY = cardY + headerH + sectionGap;
62841
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
62842
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "TRIGGER" }),
62843
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 14, y: secY + 28, fill: color, fontSize: 14, fontWeight: 600, fontFamily: "inherit", children: data.event }),
62844
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 4, y: secY + 28, fill: color, fontSize: 10, opacity: 0.5, children: "\u26A1" })
62845
- ] });
62846
- })(),
62847
- hasGuard && data.guard && (() => {
62848
- const secY = cardY + headerH + sectionGap + triggerH;
62849
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
62850
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
62851
- /* @__PURE__ */ jsxRuntime.jsx(
62852
- "polygon",
62853
- {
62854
- points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
62855
- fill: "none",
62856
- stroke: color,
62857
- strokeWidth: 1,
62858
- opacity: 0.5
62859
- }
62860
- ),
62861
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 18, y: secY + 29, fill: color, fontSize: 12, fontWeight: 400, opacity: 0.6, fontFamily: "inherit", children: data.guard.label })
62862
- ] });
62863
- })(),
62864
- hasEffects && (() => {
62865
- const secY = cardY + headerH + sectionGap + triggerH + guardH;
62866
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
62867
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
62868
- effects.map((eff, i) => {
62869
- const rowY = secY + 22 + i * effectRowH;
62870
- const effectType = mapEffectType(eff.type);
62871
- const argsText = eff.args.length > 0 ? eff.args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" \xB7 ") : "";
62872
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
62873
- /* @__PURE__ */ jsxRuntime.jsx(
62874
- exports.AvlEffect,
62875
- {
62876
- x: CONTENT_LEFT + 10,
62877
- y: rowY + 6,
62878
- effectType,
62879
- size: 10,
62880
- showBackground: true
62881
- }
62882
- ),
62883
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
62884
- argsText && /* @__PURE__ */ jsxRuntime.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 })
62885
- ] }, `eff-${i}`);
62886
- })
62887
- ] });
62888
- })(),
62889
- hasSlots && (() => {
62890
- const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
62891
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
62892
- /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
62893
- data.slotTargets.map((slot, i) => {
62894
- const rowY = secY + 22 + i * 22;
62895
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
62896
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
62897
- /* @__PURE__ */ jsxRuntime.jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
62898
- slot.name,
62899
- ": ",
62900
- slot.pattern
62901
- ] })
62902
- ] }, `slot-${i}`);
62903
- })
62904
- ] });
62905
- })()
62906
- ] });
62907
- };
62908
- AvlTransitionScene.displayName = "AvlTransitionScene";
62909
-
62910
- // components/organisms/avl/AvlOrbitalsCosmicZoom.tsx
62911
- init_Box();
62912
- init_Stack();
62913
- init_Typography();
62914
- init_Button();
62915
- init_Icon();
62916
- var UNIT_DISPLAY_W = 240;
62917
- var UNIT_DISPLAY_H = 160;
62918
- function layoutOrbitals(count, containerW, containerH) {
62919
- if (count === 0) return [];
62920
- if (count === 1) return [{ cx: containerW / 2, cy: containerH / 2 }];
62921
- const cols = Math.min(count, Math.ceil(Math.sqrt(count)));
62922
- const rows = Math.ceil(count / cols);
62923
- const edgePad = 24;
62924
- const fitMinCx = UNIT_DISPLAY_W / 2 + edgePad;
62925
- const fitMinCy = UNIT_DISPLAY_H / 2 + edgePad;
62926
- const fitMaxCx = Math.max(fitMinCx, containerW - UNIT_DISPLAY_W / 2 - edgePad);
62927
- const fitMaxCy = Math.max(fitMinCy, containerH - UNIT_DISPLAY_H / 2 - edgePad);
62928
- const fitStepX = cols > 1 ? (fitMaxCx - fitMinCx) / (cols - 1) : 0;
62929
- const fitStepY = rows > 1 ? (fitMaxCy - fitMinCy) / (rows - 1) : 0;
62930
- const stepX = Math.min(fitStepX, UNIT_DISPLAY_W * 3.5);
62931
- const stepY = Math.min(fitStepY, UNIT_DISPLAY_H * 3.5);
62932
- const gridW = (cols - 1) * stepX;
62933
- const gridH = (rows - 1) * stepY;
62934
- const originX = (containerW - gridW) / 2;
62935
- const originY = (containerH - gridH) / 2;
62936
- return Array.from({ length: count }, (_, i) => ({
62937
- cx: originX + i % cols * stepX,
62938
- cy: originY + Math.floor(i / cols) * stepY
62939
- }));
62940
- }
62941
- var avlOczWireId = 0;
62942
- var cosmicWireLog = logger.createLogger("almadar:ui:nan-coord");
62943
- var EventWireOverlay = ({
62944
- orbitalViews,
62945
- crossLinks,
62946
- color,
62947
- animated,
62948
- containerW,
62949
- containerH
62789
+ var avlOczWireId = 0;
62790
+ var cosmicWireLog = logger.createLogger("almadar:ui:nan-coord");
62791
+ var EventWireOverlay = ({
62792
+ orbitalViews,
62793
+ crossLinks,
62794
+ color,
62795
+ animated,
62796
+ containerW,
62797
+ containerH
62950
62798
  }) => {
62951
62799
  const ids = React96__namespace.default.useMemo(() => {
62952
62800
  avlOczWireId += 1;
@@ -63488,62 +63336,10 @@ var AvlOrbitalsCosmicZoom = ({
63488
63336
  paddingTop: 56,
63489
63337
  paddingBottom: 24,
63490
63338
  paddingLeft: 24,
63491
- paddingRight: 24
63492
- },
63493
- children: /* @__PURE__ */ jsxRuntime.jsx(
63494
- Box,
63495
- {
63496
- ref: transformWrapperRef,
63497
- position: "relative",
63498
- onPointerDown: handlePointerDown,
63499
- onPointerMove: handlePointerMove,
63500
- onPointerUp: handlePointerUp,
63501
- onPointerCancel: handlePointerUp,
63502
- style: {
63503
- width: "100%",
63504
- height: "100%",
63505
- cursor: dragStateRef.current ? "grabbing" : "grab",
63506
- overflow: "hidden"
63507
- },
63508
- children: /* @__PURE__ */ jsxRuntime.jsx(
63509
- Box,
63510
- {
63511
- position: "absolute",
63512
- style: {
63513
- inset: 0,
63514
- transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`,
63515
- transformOrigin: "0 0"
63516
- },
63517
- children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 600 400", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(
63518
- AvlTransitionScene,
63519
- {
63520
- data: transitionLevelData,
63521
- color
63522
- }
63523
- ) })
63524
- }
63525
- )
63526
- }
63527
- )
63528
- }
63529
- ),
63530
- state.level === "transition" && /* @__PURE__ */ jsxRuntime.jsxs(
63531
- Box,
63532
- {
63533
- position: "absolute",
63534
- style: {
63535
- top: 12,
63536
- right: 12,
63537
- display: "flex",
63538
- flexDirection: "column",
63539
- gap: 4,
63540
- zIndex: 30
63339
+ paddingRight: 24,
63340
+ overflowY: "auto"
63541
63341
  },
63542
- children: [
63543
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomIn, title: "Zoom in", action: "COSMIC_ZOOM_IN", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "plus", size: "sm" }) }),
63544
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: zoomOut, title: "Zoom out", action: "COSMIC_ZOOM_OUT", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "minus", size: "sm" }) }),
63545
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", size: "sm", onClick: resetZoom, title: "Reset", action: "COSMIC_ZOOM_RESET", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "maximize", size: "sm" }) })
63546
- ]
63342
+ children: /* @__PURE__ */ jsxRuntime.jsx(AvlTransitionDetail, { data: transitionLevelData })
63547
63343
  }
63548
63344
  )
63549
63345
  ]
@@ -63551,6 +63347,247 @@ var AvlOrbitalsCosmicZoom = ({
63551
63347
  );
63552
63348
  };
63553
63349
  AvlOrbitalsCosmicZoom.displayName = "AvlOrbitalsCosmicZoom";
63350
+
63351
+ // components/organisms/avl/AvlTransitionScene.tsx
63352
+ init_AvlEffect();
63353
+ init_types();
63354
+ var CX = 300;
63355
+ var CARD_W = 440;
63356
+ var CARD_X = CX - CARD_W / 2;
63357
+ var SECTION_LEFT = CARD_X + 16;
63358
+ var CONTENT_LEFT = CARD_X + 24;
63359
+ function flattenEffect2(node) {
63360
+ const args = [];
63361
+ for (const child of node.children ?? []) {
63362
+ args.push(child.label);
63363
+ }
63364
+ return { type: node.label, args };
63365
+ }
63366
+ function mapEffectType(label) {
63367
+ const valid = [
63368
+ "render-ui",
63369
+ "set",
63370
+ "persist",
63371
+ "fetch",
63372
+ "emit",
63373
+ "navigate",
63374
+ "notify",
63375
+ "call-service",
63376
+ "spawn",
63377
+ "despawn",
63378
+ "do",
63379
+ "if",
63380
+ "log"
63381
+ ];
63382
+ return valid.includes(label) ? label : "log";
63383
+ }
63384
+ var AvlTransitionScene = ({
63385
+ data,
63386
+ color = "var(--color-primary)"
63387
+ }) => {
63388
+ const fromRole = getStateRole(data.from, true);
63389
+ const toRole = getStateRole(data.to, false, false);
63390
+ const fromColors = exports.STATE_COLORS[fromRole];
63391
+ const toColors = exports.STATE_COLORS[toRole];
63392
+ const hasGuard = !!data.guard;
63393
+ const hasEffects = data.effects.length > 0;
63394
+ const hasSlots = data.slotTargets.length > 0;
63395
+ const effects = data.effects.map(flattenEffect2);
63396
+ const headerH = 52;
63397
+ const sectionGap = 8;
63398
+ const triggerH = 34;
63399
+ const guardH = hasGuard ? 30 + sectionGap : 0;
63400
+ const effectRowH = 28;
63401
+ const effectsH = hasEffects ? 24 + effects.length * effectRowH + sectionGap : 0;
63402
+ const slotsH = hasSlots ? 24 + data.slotTargets.length * 22 + sectionGap : 0;
63403
+ const cardH = headerH + triggerH + guardH + effectsH + slotsH + 16;
63404
+ const cardY = Math.max(20, (400 - cardH) / 2);
63405
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
63406
+ /* @__PURE__ */ jsxRuntime.jsx(
63407
+ "rect",
63408
+ {
63409
+ x: CARD_X,
63410
+ y: cardY,
63411
+ width: CARD_W,
63412
+ height: cardH,
63413
+ rx: 12,
63414
+ fill: "var(--color-surface, white)",
63415
+ fillOpacity: 0.97,
63416
+ stroke: color,
63417
+ strokeWidth: 0.8,
63418
+ strokeOpacity: 0.2
63419
+ }
63420
+ ),
63421
+ /* @__PURE__ */ jsxRuntime.jsx(
63422
+ "rect",
63423
+ {
63424
+ x: CARD_X,
63425
+ y: cardY,
63426
+ width: CARD_W,
63427
+ height: headerH,
63428
+ rx: 12,
63429
+ fill: color,
63430
+ fillOpacity: 0.03
63431
+ }
63432
+ ),
63433
+ /* @__PURE__ */ jsxRuntime.jsx(
63434
+ "rect",
63435
+ {
63436
+ x: CARD_X,
63437
+ y: cardY + headerH - 12,
63438
+ width: CARD_W,
63439
+ height: 12,
63440
+ fill: color,
63441
+ fillOpacity: 0.03
63442
+ }
63443
+ ),
63444
+ /* @__PURE__ */ jsxRuntime.jsx(
63445
+ "rect",
63446
+ {
63447
+ x: CARD_X + 20,
63448
+ y: cardY + 12,
63449
+ width: 140,
63450
+ height: 30,
63451
+ rx: 15,
63452
+ fill: fromColors.fill,
63453
+ stroke: fromColors.border,
63454
+ strokeWidth: 1.5
63455
+ }
63456
+ ),
63457
+ /* @__PURE__ */ jsxRuntime.jsx(
63458
+ "text",
63459
+ {
63460
+ x: CARD_X + 90,
63461
+ y: cardY + 31,
63462
+ textAnchor: "middle",
63463
+ fill: fromColors.border,
63464
+ fontSize: 14,
63465
+ fontWeight: 600,
63466
+ fontFamily: "inherit",
63467
+ children: data.from
63468
+ }
63469
+ ),
63470
+ /* @__PURE__ */ jsxRuntime.jsx(
63471
+ "text",
63472
+ {
63473
+ x: CX,
63474
+ y: cardY + 32,
63475
+ textAnchor: "middle",
63476
+ fill: color,
63477
+ fontSize: 16,
63478
+ opacity: 0.4,
63479
+ fontFamily: "inherit",
63480
+ children: "\u2192"
63481
+ }
63482
+ ),
63483
+ /* @__PURE__ */ jsxRuntime.jsx(
63484
+ "rect",
63485
+ {
63486
+ x: CARD_X + CARD_W - 160,
63487
+ y: cardY + 12,
63488
+ width: 140,
63489
+ height: 30,
63490
+ rx: 15,
63491
+ fill: toColors.fill,
63492
+ stroke: toColors.border,
63493
+ strokeWidth: 1.5
63494
+ }
63495
+ ),
63496
+ /* @__PURE__ */ jsxRuntime.jsx(
63497
+ "text",
63498
+ {
63499
+ x: CARD_X + CARD_W - 90,
63500
+ y: cardY + 31,
63501
+ textAnchor: "middle",
63502
+ fill: toColors.border,
63503
+ fontSize: 14,
63504
+ fontWeight: 600,
63505
+ fontFamily: "inherit",
63506
+ children: data.to
63507
+ }
63508
+ ),
63509
+ /* @__PURE__ */ jsxRuntime.jsx(
63510
+ "line",
63511
+ {
63512
+ x1: CARD_X + 12,
63513
+ y1: cardY + headerH,
63514
+ x2: CARD_X + CARD_W - 12,
63515
+ y2: cardY + headerH,
63516
+ stroke: color,
63517
+ strokeWidth: 0.5,
63518
+ opacity: 0.1
63519
+ }
63520
+ ),
63521
+ (() => {
63522
+ const secY = cardY + headerH + sectionGap;
63523
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
63524
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "TRIGGER" }),
63525
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 14, y: secY + 28, fill: color, fontSize: 14, fontWeight: 600, fontFamily: "inherit", children: data.event }),
63526
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 4, y: secY + 28, fill: color, fontSize: 10, opacity: 0.5, children: "\u26A1" })
63527
+ ] });
63528
+ })(),
63529
+ hasGuard && data.guard && (() => {
63530
+ const secY = cardY + headerH + sectionGap + triggerH;
63531
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
63532
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "GUARD" }),
63533
+ /* @__PURE__ */ jsxRuntime.jsx(
63534
+ "polygon",
63535
+ {
63536
+ points: `${CONTENT_LEFT + 6},${secY + 22} ${CONTENT_LEFT + 2},${secY + 26} ${CONTENT_LEFT + 6},${secY + 30} ${CONTENT_LEFT + 10},${secY + 26}`,
63537
+ fill: "none",
63538
+ stroke: color,
63539
+ strokeWidth: 1,
63540
+ opacity: 0.5
63541
+ }
63542
+ ),
63543
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 18, y: secY + 29, fill: color, fontSize: 12, fontWeight: 400, opacity: 0.6, fontFamily: "inherit", children: data.guard.label })
63544
+ ] });
63545
+ })(),
63546
+ hasEffects && (() => {
63547
+ const secY = cardY + headerH + sectionGap + triggerH + guardH;
63548
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
63549
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "EFFECTS" }),
63550
+ effects.map((eff, i) => {
63551
+ const rowY = secY + 22 + i * effectRowH;
63552
+ const effectType = mapEffectType(eff.type);
63553
+ const argsText = eff.args.length > 0 ? eff.args.map((a) => typeof a === "string" ? a : JSON.stringify(a)).join(" \xB7 ") : "";
63554
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
63555
+ /* @__PURE__ */ jsxRuntime.jsx(
63556
+ exports.AvlEffect,
63557
+ {
63558
+ x: CONTENT_LEFT + 10,
63559
+ y: rowY + 6,
63560
+ effectType,
63561
+ size: 10,
63562
+ showBackground: true
63563
+ }
63564
+ ),
63565
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: CONTENT_LEFT + 28, y: rowY + 10, fill: color, fontSize: 12, fontWeight: 500, opacity: 0.8, fontFamily: "inherit", children: eff.type }),
63566
+ argsText && /* @__PURE__ */ jsxRuntime.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 })
63567
+ ] }, `eff-${i}`);
63568
+ })
63569
+ ] });
63570
+ })(),
63571
+ hasSlots && (() => {
63572
+ const secY = cardY + headerH + sectionGap + triggerH + guardH + effectsH;
63573
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
63574
+ /* @__PURE__ */ jsxRuntime.jsx("text", { x: SECTION_LEFT, y: secY + 12, fill: color, fontSize: 10, fontWeight: 600, opacity: 0.4, fontFamily: "inherit", children: "SLOTS" }),
63575
+ data.slotTargets.map((slot, i) => {
63576
+ const rowY = secY + 22 + i * 22;
63577
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
63578
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: CONTENT_LEFT, y: rowY - 4, width: CARD_W - 56, height: 18, rx: 4, fill: color, fillOpacity: 0.04 }),
63579
+ /* @__PURE__ */ jsxRuntime.jsxs("text", { x: CONTENT_LEFT + 8, y: rowY + 8, fill: color, fontSize: 11, fontFamily: "inherit", children: [
63580
+ slot.name,
63581
+ ": ",
63582
+ slot.pattern
63583
+ ] })
63584
+ ] }, `slot-${i}`);
63585
+ })
63586
+ ] });
63587
+ })()
63588
+ ] });
63589
+ };
63590
+ AvlTransitionScene.displayName = "AvlTransitionScene";
63554
63591
  var AvlClickTarget = ({
63555
63592
  x,
63556
63593
  y,