@almadar/ui 5.1.5 → 5.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/avl/index.cjs
CHANGED
|
@@ -58382,9 +58382,25 @@ function detectScreenSize(viewportWidth) {
|
|
|
58382
58382
|
}
|
|
58383
58383
|
|
|
58384
58384
|
// components/molecules/avl/avl-preview-converter.ts
|
|
58385
|
-
var
|
|
58386
|
-
var
|
|
58387
|
-
var
|
|
58385
|
+
var OVERVIEW_GAP_X = 160;
|
|
58386
|
+
var OVERVIEW_GAP_Y = 240;
|
|
58387
|
+
var EXPANDED_GAP_X = 160;
|
|
58388
|
+
var EXPANDED_GAP_Y = 240;
|
|
58389
|
+
var CARD_CHROME_Y = 120;
|
|
58390
|
+
function computeSpacing(screenSize = "wide") {
|
|
58391
|
+
const preset = SCREEN_SIZE_PRESETS[screenSize];
|
|
58392
|
+
return {
|
|
58393
|
+
x: preset.width + OVERVIEW_GAP_X,
|
|
58394
|
+
y: preset.minHeight + CARD_CHROME_Y + OVERVIEW_GAP_Y
|
|
58395
|
+
};
|
|
58396
|
+
}
|
|
58397
|
+
function computeExpandedSpacing(screenSize = "wide") {
|
|
58398
|
+
const preset = SCREEN_SIZE_PRESETS[screenSize];
|
|
58399
|
+
return {
|
|
58400
|
+
x: preset.width + EXPANDED_GAP_X,
|
|
58401
|
+
y: preset.minHeight + CARD_CHROME_Y + EXPANDED_GAP_Y
|
|
58402
|
+
};
|
|
58403
|
+
}
|
|
58388
58404
|
function getOrbitals(schema) {
|
|
58389
58405
|
return schema.orbitals ?? [];
|
|
58390
58406
|
}
|
|
@@ -58573,12 +58589,13 @@ function extractTraitWires(orbitals, scope) {
|
|
|
58573
58589
|
function findCrossLinks(orbitals) {
|
|
58574
58590
|
return extractTraitWires(orbitals, "cross-orbital");
|
|
58575
58591
|
}
|
|
58576
|
-
function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus) {
|
|
58592
|
+
function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize) {
|
|
58577
58593
|
const orbitals = getOrbitals(schema);
|
|
58578
58594
|
const nodes = [];
|
|
58579
58595
|
const edges = [];
|
|
58580
58596
|
const count = orbitals.length;
|
|
58581
58597
|
const cols = layoutHint === "pipeline" ? count : Math.ceil(Math.sqrt(count));
|
|
58598
|
+
const spacing = computeSpacing(screenSize);
|
|
58582
58599
|
for (let i = 0; i < orbitals.length; i++) {
|
|
58583
58600
|
const orb = orbitals[i];
|
|
58584
58601
|
const entityInfo = getEntityInfo(orb);
|
|
@@ -58638,7 +58655,7 @@ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbit
|
|
|
58638
58655
|
nodes.push({
|
|
58639
58656
|
id: orb.name,
|
|
58640
58657
|
type: "preview",
|
|
58641
|
-
position: { x: col *
|
|
58658
|
+
position: { x: col * spacing.x, y: row * spacing.y },
|
|
58642
58659
|
data: {
|
|
58643
58660
|
orbitalName: orb.name,
|
|
58644
58661
|
patterns: initPatterns,
|
|
@@ -58702,9 +58719,10 @@ function collectUITransitions(orbital, filter) {
|
|
|
58702
58719
|
}
|
|
58703
58720
|
return out;
|
|
58704
58721
|
}
|
|
58705
|
-
function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData) {
|
|
58722
|
+
function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData, screenSize) {
|
|
58706
58723
|
const nodes = [];
|
|
58707
58724
|
const edges = [];
|
|
58725
|
+
const spacing = computeExpandedSpacing(screenSize);
|
|
58708
58726
|
const stateRepresentativeMap = /* @__PURE__ */ new Map();
|
|
58709
58727
|
for (const entry of transitions) {
|
|
58710
58728
|
const key = `${entry.traitName}:${entry.transition.to}`;
|
|
@@ -58730,7 +58748,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
|
|
|
58730
58748
|
nodes.push({
|
|
58731
58749
|
id: nodeId,
|
|
58732
58750
|
type: "preview",
|
|
58733
|
-
position: { x: col *
|
|
58751
|
+
position: { x: col * spacing.x, y: row * spacing.y },
|
|
58734
58752
|
data: {
|
|
58735
58753
|
orbitalName,
|
|
58736
58754
|
traitName: entry.traitName,
|
|
@@ -58758,7 +58776,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
|
|
|
58758
58776
|
nodes.push({
|
|
58759
58777
|
id: nodeId,
|
|
58760
58778
|
type: "preview",
|
|
58761
|
-
position: { x: col *
|
|
58779
|
+
position: { x: col * spacing.x, y: row * spacing.y },
|
|
58762
58780
|
data: {
|
|
58763
58781
|
orbitalName,
|
|
58764
58782
|
traitName: group.representative.traitName,
|
|
@@ -58813,7 +58831,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
|
|
|
58813
58831
|
}
|
|
58814
58832
|
return { nodes, edges };
|
|
58815
58833
|
}
|
|
58816
|
-
function orbitalToExpandedGraph(schema, orbitalName, mockData) {
|
|
58834
|
+
function orbitalToExpandedGraph(schema, orbitalName, mockData, screenSize) {
|
|
58817
58835
|
const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
|
|
58818
58836
|
if (!orbital) return { nodes: [], edges: [] };
|
|
58819
58837
|
const entityInfo = getEntityInfo(orbital);
|
|
@@ -58853,10 +58871,11 @@ function orbitalToExpandedGraph(schema, orbitalName, mockData) {
|
|
|
58853
58871
|
entityInfo.name,
|
|
58854
58872
|
organismTransitions,
|
|
58855
58873
|
groupedBehaviors,
|
|
58856
|
-
mockData
|
|
58874
|
+
mockData,
|
|
58875
|
+
screenSize
|
|
58857
58876
|
);
|
|
58858
58877
|
}
|
|
58859
|
-
function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
|
|
58878
|
+
function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData, screenSize) {
|
|
58860
58879
|
const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
|
|
58861
58880
|
if (!orbital) return { nodes: [], edges: [] };
|
|
58862
58881
|
const entityInfo = getEntityInfo(orbital);
|
|
@@ -58870,7 +58889,8 @@ function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
|
|
|
58870
58889
|
entityInfo.name,
|
|
58871
58890
|
transitions,
|
|
58872
58891
|
[],
|
|
58873
|
-
mockData
|
|
58892
|
+
mockData,
|
|
58893
|
+
screenSize
|
|
58874
58894
|
);
|
|
58875
58895
|
}
|
|
58876
58896
|
var TRAIT_CARD_SPACING_X = 480;
|
|
@@ -63489,9 +63509,9 @@ function FlowCanvasInner({
|
|
|
63489
63509
|
const { composeNodes, composeEdges, overviewNodes, overviewEdges, expandedNodes, expandedEdges, behaviorExpandedNodes, behaviorExpandedEdges, traitExpandedNodes, traitExpandedEdges } = React98.useMemo(() => {
|
|
63490
63510
|
const t = perfStart("compose-graph");
|
|
63491
63511
|
const compose = composeLevel === "behavior" && behaviorEntries?.length ? behaviorsToComposeGraph(behaviorEntries, behaviorWires ?? [], layoutHint) : { nodes: [], edges: [] };
|
|
63492
|
-
const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus);
|
|
63493
|
-
const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData) : { nodes: [], edges: [] };
|
|
63494
|
-
const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData) : { nodes: [], edges: [] };
|
|
63512
|
+
const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize);
|
|
63513
|
+
const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData, screenSize) : { nodes: [], edges: [] };
|
|
63514
|
+
const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData, screenSize) : { nodes: [], edges: [] };
|
|
63495
63515
|
const traitExpanded = expandedOrbital ? orbitalToTraitGraph(parsedSchema, expandedOrbital) : { nodes: [], edges: [] };
|
|
63496
63516
|
perfEnd("compose-graph", t, {
|
|
63497
63517
|
composeNodes: compose.nodes.length,
|
|
@@ -63513,7 +63533,7 @@ function FlowCanvasInner({
|
|
|
63513
63533
|
traitExpandedNodes: traitExpanded.nodes,
|
|
63514
63534
|
traitExpandedEdges: traitExpanded.edges
|
|
63515
63535
|
};
|
|
63516
|
-
}, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus]);
|
|
63536
|
+
}, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus, screenSize]);
|
|
63517
63537
|
const activeNodes = atBehaviorLevel && composeNodes.length > 0 ? composeNodes : level === "overview" ? overviewNodes : level === "behavior-expanded" ? behaviorExpandedNodes : level === "trait-expanded" ? traitExpandedNodes : expandedNodes;
|
|
63518
63538
|
const activeEdges = atBehaviorLevel && composeEdges.length > 0 ? composeEdges : level === "overview" ? overviewEdges : level === "behavior-expanded" ? behaviorExpandedEdges : level === "trait-expanded" ? traitExpandedEdges : expandedEdges;
|
|
63519
63539
|
const [nodes, setNodes, onNodesChange] = react.useNodesState(activeNodes);
|
|
@@ -63524,7 +63544,7 @@ function FlowCanvasInner({
|
|
|
63524
63544
|
setNodes(activeNodes);
|
|
63525
63545
|
setEdges(activeEdges);
|
|
63526
63546
|
requestAnimationFrame(() => {
|
|
63527
|
-
reactFlow.fitView({ duration: 300, padding: 0.
|
|
63547
|
+
reactFlow.fitView({ duration: 300, padding: 0.25 });
|
|
63528
63548
|
});
|
|
63529
63549
|
}, [activeNodes, activeEdges, setNodes, setEdges, reactFlow]);
|
|
63530
63550
|
const visibleEdges = React98.useMemo(() => {
|
|
@@ -63705,7 +63725,7 @@ function FlowCanvasInner({
|
|
|
63705
63725
|
minZoom: 0.1,
|
|
63706
63726
|
maxZoom: 2,
|
|
63707
63727
|
fitView: true,
|
|
63708
|
-
fitViewOptions: { padding: 0.
|
|
63728
|
+
fitViewOptions: { padding: 0.25 },
|
|
63709
63729
|
nodesDraggable: true,
|
|
63710
63730
|
elementsSelectable: true,
|
|
63711
63731
|
proOptions: { hideAttribution: true },
|
|
@@ -63762,7 +63782,7 @@ function FlowCanvasInner({
|
|
|
63762
63782
|
onClick: () => {
|
|
63763
63783
|
pickScreenSize(size);
|
|
63764
63784
|
requestAnimationFrame(() => {
|
|
63765
|
-
reactFlow.fitView({ duration: 300, padding: 0.
|
|
63785
|
+
reactFlow.fitView({ duration: 300, padding: 0.25 });
|
|
63766
63786
|
});
|
|
63767
63787
|
},
|
|
63768
63788
|
className: `px-2 py-1 text-[11px] font-medium rounded cursor-pointer border-none transition-colors ${active ? "bg-primary text-primary-foreground" : "bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
|
package/dist/avl/index.d.cts
CHANGED
|
@@ -846,6 +846,22 @@ declare const AvlBindingEdge: React__default.FC<EdgeProps>;
|
|
|
846
846
|
* from the L1 grid. Not used by the canvas tab today.
|
|
847
847
|
*/
|
|
848
848
|
type ViewLevel = 'overview' | 'expanded' | 'behavior-expanded' | 'trait-expanded';
|
|
849
|
+
/**
|
|
850
|
+
* Screen size preset for OrbPreview rendering inside nodes.
|
|
851
|
+
*
|
|
852
|
+
* Aligned with the four-breakpoint responsiveness audit:
|
|
853
|
+
* mobile — phone portrait (≤640px)
|
|
854
|
+
* tablet — iPad / small landscape (641–1024px)
|
|
855
|
+
* laptop — 13–15" notebook (1025–1440px)
|
|
856
|
+
* wide — desktop / monitor (≥1441px)
|
|
857
|
+
*
|
|
858
|
+
* Preset widths are representative viewport widths within each range; the
|
|
859
|
+
* preview renders at exactly this width so the embedded UI experiences
|
|
860
|
+
* the same media-query / container-query behavior it would at the real
|
|
861
|
+
* viewport. `minHeight` only floors the preview frame; vertical sizing is
|
|
862
|
+
* content-driven (BrowserPlayground height="auto").
|
|
863
|
+
*/
|
|
864
|
+
type ScreenSize = 'mobile' | 'tablet' | 'laptop' | 'wide';
|
|
849
865
|
/**
|
|
850
866
|
* An interactive element inside a render-ui pattern that fires an event.
|
|
851
867
|
* For example, a button with `event: "CHECKOUT"` is an event source.
|
|
@@ -1041,7 +1057,7 @@ interface EventEdgeData extends Record<string, unknown> {
|
|
|
1041
1057
|
*/
|
|
1042
1058
|
declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<string, unknown[]>, behaviorMeta?: Record<string, {
|
|
1043
1059
|
layer: string;
|
|
1044
|
-
}>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']
|
|
1060
|
+
}>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>, screenSize?: ScreenSize): {
|
|
1045
1061
|
nodes: Node<PreviewNodeData>[];
|
|
1046
1062
|
edges: Edge<EventEdgeData>[];
|
|
1047
1063
|
};
|
|
@@ -1056,7 +1072,7 @@ declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<
|
|
|
1056
1072
|
* anonymous `INIT` peers (STUDIO-1). Drill into a grouped card to reach
|
|
1057
1073
|
* L3 (`orbitalAliasToExpandedGraph`).
|
|
1058
1074
|
*/
|
|
1059
|
-
declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]
|
|
1075
|
+
declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]>, screenSize?: ScreenSize): {
|
|
1060
1076
|
nodes: Node<PreviewNodeData>[];
|
|
1061
1077
|
edges: Edge<EventEdgeData>[];
|
|
1062
1078
|
};
|
package/dist/avl/index.js
CHANGED
|
@@ -58333,9 +58333,25 @@ function detectScreenSize(viewportWidth) {
|
|
|
58333
58333
|
}
|
|
58334
58334
|
|
|
58335
58335
|
// components/molecules/avl/avl-preview-converter.ts
|
|
58336
|
-
var
|
|
58337
|
-
var
|
|
58338
|
-
var
|
|
58336
|
+
var OVERVIEW_GAP_X = 160;
|
|
58337
|
+
var OVERVIEW_GAP_Y = 240;
|
|
58338
|
+
var EXPANDED_GAP_X = 160;
|
|
58339
|
+
var EXPANDED_GAP_Y = 240;
|
|
58340
|
+
var CARD_CHROME_Y = 120;
|
|
58341
|
+
function computeSpacing(screenSize = "wide") {
|
|
58342
|
+
const preset = SCREEN_SIZE_PRESETS[screenSize];
|
|
58343
|
+
return {
|
|
58344
|
+
x: preset.width + OVERVIEW_GAP_X,
|
|
58345
|
+
y: preset.minHeight + CARD_CHROME_Y + OVERVIEW_GAP_Y
|
|
58346
|
+
};
|
|
58347
|
+
}
|
|
58348
|
+
function computeExpandedSpacing(screenSize = "wide") {
|
|
58349
|
+
const preset = SCREEN_SIZE_PRESETS[screenSize];
|
|
58350
|
+
return {
|
|
58351
|
+
x: preset.width + EXPANDED_GAP_X,
|
|
58352
|
+
y: preset.minHeight + CARD_CHROME_Y + EXPANDED_GAP_Y
|
|
58353
|
+
};
|
|
58354
|
+
}
|
|
58339
58355
|
function getOrbitals(schema) {
|
|
58340
58356
|
return schema.orbitals ?? [];
|
|
58341
58357
|
}
|
|
@@ -58524,12 +58540,13 @@ function extractTraitWires(orbitals, scope) {
|
|
|
58524
58540
|
function findCrossLinks(orbitals) {
|
|
58525
58541
|
return extractTraitWires(orbitals, "cross-orbital");
|
|
58526
58542
|
}
|
|
58527
|
-
function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus) {
|
|
58543
|
+
function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize) {
|
|
58528
58544
|
const orbitals = getOrbitals(schema);
|
|
58529
58545
|
const nodes = [];
|
|
58530
58546
|
const edges = [];
|
|
58531
58547
|
const count = orbitals.length;
|
|
58532
58548
|
const cols = layoutHint === "pipeline" ? count : Math.ceil(Math.sqrt(count));
|
|
58549
|
+
const spacing = computeSpacing(screenSize);
|
|
58533
58550
|
for (let i = 0; i < orbitals.length; i++) {
|
|
58534
58551
|
const orb = orbitals[i];
|
|
58535
58552
|
const entityInfo = getEntityInfo(orb);
|
|
@@ -58589,7 +58606,7 @@ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbit
|
|
|
58589
58606
|
nodes.push({
|
|
58590
58607
|
id: orb.name,
|
|
58591
58608
|
type: "preview",
|
|
58592
|
-
position: { x: col *
|
|
58609
|
+
position: { x: col * spacing.x, y: row * spacing.y },
|
|
58593
58610
|
data: {
|
|
58594
58611
|
orbitalName: orb.name,
|
|
58595
58612
|
patterns: initPatterns,
|
|
@@ -58653,9 +58670,10 @@ function collectUITransitions(orbital, filter) {
|
|
|
58653
58670
|
}
|
|
58654
58671
|
return out;
|
|
58655
58672
|
}
|
|
58656
|
-
function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData) {
|
|
58673
|
+
function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData, screenSize) {
|
|
58657
58674
|
const nodes = [];
|
|
58658
58675
|
const edges = [];
|
|
58676
|
+
const spacing = computeExpandedSpacing(screenSize);
|
|
58659
58677
|
const stateRepresentativeMap = /* @__PURE__ */ new Map();
|
|
58660
58678
|
for (const entry of transitions) {
|
|
58661
58679
|
const key = `${entry.traitName}:${entry.transition.to}`;
|
|
@@ -58681,7 +58699,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
|
|
|
58681
58699
|
nodes.push({
|
|
58682
58700
|
id: nodeId,
|
|
58683
58701
|
type: "preview",
|
|
58684
|
-
position: { x: col *
|
|
58702
|
+
position: { x: col * spacing.x, y: row * spacing.y },
|
|
58685
58703
|
data: {
|
|
58686
58704
|
orbitalName,
|
|
58687
58705
|
traitName: entry.traitName,
|
|
@@ -58709,7 +58727,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
|
|
|
58709
58727
|
nodes.push({
|
|
58710
58728
|
id: nodeId,
|
|
58711
58729
|
type: "preview",
|
|
58712
|
-
position: { x: col *
|
|
58730
|
+
position: { x: col * spacing.x, y: row * spacing.y },
|
|
58713
58731
|
data: {
|
|
58714
58732
|
orbitalName,
|
|
58715
58733
|
traitName: group.representative.traitName,
|
|
@@ -58764,7 +58782,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
|
|
|
58764
58782
|
}
|
|
58765
58783
|
return { nodes, edges };
|
|
58766
58784
|
}
|
|
58767
|
-
function orbitalToExpandedGraph(schema, orbitalName, mockData) {
|
|
58785
|
+
function orbitalToExpandedGraph(schema, orbitalName, mockData, screenSize) {
|
|
58768
58786
|
const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
|
|
58769
58787
|
if (!orbital) return { nodes: [], edges: [] };
|
|
58770
58788
|
const entityInfo = getEntityInfo(orbital);
|
|
@@ -58804,10 +58822,11 @@ function orbitalToExpandedGraph(schema, orbitalName, mockData) {
|
|
|
58804
58822
|
entityInfo.name,
|
|
58805
58823
|
organismTransitions,
|
|
58806
58824
|
groupedBehaviors,
|
|
58807
|
-
mockData
|
|
58825
|
+
mockData,
|
|
58826
|
+
screenSize
|
|
58808
58827
|
);
|
|
58809
58828
|
}
|
|
58810
|
-
function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
|
|
58829
|
+
function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData, screenSize) {
|
|
58811
58830
|
const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
|
|
58812
58831
|
if (!orbital) return { nodes: [], edges: [] };
|
|
58813
58832
|
const entityInfo = getEntityInfo(orbital);
|
|
@@ -58821,7 +58840,8 @@ function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
|
|
|
58821
58840
|
entityInfo.name,
|
|
58822
58841
|
transitions,
|
|
58823
58842
|
[],
|
|
58824
|
-
mockData
|
|
58843
|
+
mockData,
|
|
58844
|
+
screenSize
|
|
58825
58845
|
);
|
|
58826
58846
|
}
|
|
58827
58847
|
var TRAIT_CARD_SPACING_X = 480;
|
|
@@ -63440,9 +63460,9 @@ function FlowCanvasInner({
|
|
|
63440
63460
|
const { composeNodes, composeEdges, overviewNodes, overviewEdges, expandedNodes, expandedEdges, behaviorExpandedNodes, behaviorExpandedEdges, traitExpandedNodes, traitExpandedEdges } = useMemo(() => {
|
|
63441
63461
|
const t = perfStart("compose-graph");
|
|
63442
63462
|
const compose = composeLevel === "behavior" && behaviorEntries?.length ? behaviorsToComposeGraph(behaviorEntries, behaviorWires ?? [], layoutHint) : { nodes: [], edges: [] };
|
|
63443
|
-
const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus);
|
|
63444
|
-
const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData) : { nodes: [], edges: [] };
|
|
63445
|
-
const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData) : { nodes: [], edges: [] };
|
|
63463
|
+
const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize);
|
|
63464
|
+
const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData, screenSize) : { nodes: [], edges: [] };
|
|
63465
|
+
const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData, screenSize) : { nodes: [], edges: [] };
|
|
63446
63466
|
const traitExpanded = expandedOrbital ? orbitalToTraitGraph(parsedSchema, expandedOrbital) : { nodes: [], edges: [] };
|
|
63447
63467
|
perfEnd("compose-graph", t, {
|
|
63448
63468
|
composeNodes: compose.nodes.length,
|
|
@@ -63464,7 +63484,7 @@ function FlowCanvasInner({
|
|
|
63464
63484
|
traitExpandedNodes: traitExpanded.nodes,
|
|
63465
63485
|
traitExpandedEdges: traitExpanded.edges
|
|
63466
63486
|
};
|
|
63467
|
-
}, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus]);
|
|
63487
|
+
}, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus, screenSize]);
|
|
63468
63488
|
const activeNodes = atBehaviorLevel && composeNodes.length > 0 ? composeNodes : level === "overview" ? overviewNodes : level === "behavior-expanded" ? behaviorExpandedNodes : level === "trait-expanded" ? traitExpandedNodes : expandedNodes;
|
|
63469
63489
|
const activeEdges = atBehaviorLevel && composeEdges.length > 0 ? composeEdges : level === "overview" ? overviewEdges : level === "behavior-expanded" ? behaviorExpandedEdges : level === "trait-expanded" ? traitExpandedEdges : expandedEdges;
|
|
63470
63490
|
const [nodes, setNodes, onNodesChange] = useNodesState(activeNodes);
|
|
@@ -63475,7 +63495,7 @@ function FlowCanvasInner({
|
|
|
63475
63495
|
setNodes(activeNodes);
|
|
63476
63496
|
setEdges(activeEdges);
|
|
63477
63497
|
requestAnimationFrame(() => {
|
|
63478
|
-
reactFlow.fitView({ duration: 300, padding: 0.
|
|
63498
|
+
reactFlow.fitView({ duration: 300, padding: 0.25 });
|
|
63479
63499
|
});
|
|
63480
63500
|
}, [activeNodes, activeEdges, setNodes, setEdges, reactFlow]);
|
|
63481
63501
|
const visibleEdges = useMemo(() => {
|
|
@@ -63656,7 +63676,7 @@ function FlowCanvasInner({
|
|
|
63656
63676
|
minZoom: 0.1,
|
|
63657
63677
|
maxZoom: 2,
|
|
63658
63678
|
fitView: true,
|
|
63659
|
-
fitViewOptions: { padding: 0.
|
|
63679
|
+
fitViewOptions: { padding: 0.25 },
|
|
63660
63680
|
nodesDraggable: true,
|
|
63661
63681
|
elementsSelectable: true,
|
|
63662
63682
|
proOptions: { hideAttribution: true },
|
|
@@ -63713,7 +63733,7 @@ function FlowCanvasInner({
|
|
|
63713
63733
|
onClick: () => {
|
|
63714
63734
|
pickScreenSize(size);
|
|
63715
63735
|
requestAnimationFrame(() => {
|
|
63716
|
-
reactFlow.fitView({ duration: 300, padding: 0.
|
|
63736
|
+
reactFlow.fitView({ duration: 300, padding: 0.25 });
|
|
63717
63737
|
});
|
|
63718
63738
|
},
|
|
63719
63739
|
className: `px-2 py-1 text-[11px] font-medium rounded cursor-pointer border-none transition-colors ${active ? "bg-primary text-primary-foreground" : "bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { Node, Edge } from '@xyflow/react';
|
|
16
16
|
import type { OrbitalSchema } from '@almadar/core';
|
|
17
|
-
import type { PreviewNodeData, EventEdgeData } from './avl-preview-types';
|
|
17
|
+
import type { PreviewNodeData, EventEdgeData, ScreenSize } from './avl-preview-types';
|
|
18
18
|
/**
|
|
19
19
|
* Build a React Flow graph for the overview level.
|
|
20
20
|
* Each orbital gets one node showing its INIT transition's UI.
|
|
21
21
|
*/
|
|
22
22
|
export declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<string, unknown[]>, behaviorMeta?: Record<string, {
|
|
23
23
|
layer: string;
|
|
24
|
-
}>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']
|
|
24
|
+
}>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>, screenSize?: ScreenSize): {
|
|
25
25
|
nodes: Node<PreviewNodeData>[];
|
|
26
26
|
edges: Edge<EventEdgeData>[];
|
|
27
27
|
};
|
|
@@ -36,7 +36,7 @@ export declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?:
|
|
|
36
36
|
* anonymous `INIT` peers (STUDIO-1). Drill into a grouped card to reach
|
|
37
37
|
* L3 (`orbitalAliasToExpandedGraph`).
|
|
38
38
|
*/
|
|
39
|
-
export declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]
|
|
39
|
+
export declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]>, screenSize?: ScreenSize): {
|
|
40
40
|
nodes: Node<PreviewNodeData>[];
|
|
41
41
|
edges: Edge<EventEdgeData>[];
|
|
42
42
|
};
|
|
@@ -47,7 +47,7 @@ export declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalNam
|
|
|
47
47
|
* `orbitalToExpandedGraph` but scoped to traits where
|
|
48
48
|
* `sourceBehavior.alias === alias`. STUDIO-1.
|
|
49
49
|
*/
|
|
50
|
-
export declare function orbitalAliasToExpandedGraph(schema: OrbitalSchema, orbitalName: string, alias: string, mockData?: Record<string, unknown[]
|
|
50
|
+
export declare function orbitalAliasToExpandedGraph(schema: OrbitalSchema, orbitalName: string, alias: string, mockData?: Record<string, unknown[]>, screenSize?: ScreenSize): {
|
|
51
51
|
nodes: Node<PreviewNodeData>[];
|
|
52
52
|
edges: Edge<EventEdgeData>[];
|
|
53
53
|
};
|