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