@almadar/ui 2.19.2 → 2.20.1
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 +4596 -35
- package/dist/avl/index.d.cts +279 -1
- package/dist/avl/index.d.ts +1 -0
- package/dist/avl/index.js +4588 -38
- package/dist/components/organisms/avl/AvlApplicationScene.d.ts +17 -0
- package/dist/components/organisms/avl/AvlClickTarget.d.ts +31 -0
- package/dist/components/organisms/avl/AvlCosmicZoom.d.ts +38 -0
- package/dist/components/organisms/avl/AvlLegend.d.ts +15 -0
- package/dist/components/organisms/avl/AvlOrbitalScene.d.ts +21 -0
- package/dist/components/organisms/avl/AvlTraitScene.d.ts +17 -0
- package/dist/components/organisms/avl/AvlTransitionScene.d.ts +16 -0
- package/dist/components/organisms/avl/avl-schema-parser.d.ts +126 -0
- package/dist/components/organisms/avl/avl-zoom-state.d.ts +60 -0
- package/dist/components/organisms/avl/index.d.ts +14 -0
- package/package.json +2 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvlApplicationScene - Zoom Level 1
|
|
3
|
+
*
|
|
4
|
+
* Shows all orbitals in the application with cross-orbital
|
|
5
|
+
* emit/listen arrows. Each orbital is a clickable AvlOrbitalUnit.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { ApplicationLevelData } from './avl-schema-parser';
|
|
9
|
+
export interface AvlApplicationSceneProps {
|
|
10
|
+
data: ApplicationLevelData;
|
|
11
|
+
color?: string;
|
|
12
|
+
onOrbitalClick?: (orbitalName: string, position: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const AvlApplicationScene: React.FC<AvlApplicationSceneProps>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvlClickTarget
|
|
3
|
+
*
|
|
4
|
+
* Transparent SVG rect overlay that makes AVL atoms clickable.
|
|
5
|
+
* AVL atoms render <g> elements which don't natively support
|
|
6
|
+
* bounding-box click events. This wrapper adds an invisible
|
|
7
|
+
* rect with pointer events and optional hover glow.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
export interface AvlClickTargetProps {
|
|
13
|
+
/** Bounding box position */
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
/** Click handler */
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
/** Hover callback */
|
|
21
|
+
onHover?: (hovering: boolean) => void;
|
|
22
|
+
/** Cursor style (default: pointer) */
|
|
23
|
+
cursor?: string;
|
|
24
|
+
/** Glow color on hover */
|
|
25
|
+
glowColor?: string;
|
|
26
|
+
/** Accessible label */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Children (the AVL atoms to render on top) */
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export declare const AvlClickTarget: React.FC<AvlClickTargetProps>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvlCosmicZoom - Interactive Zoomable Orbital Visualization
|
|
3
|
+
*
|
|
4
|
+
* The host organism that owns the SVG viewport and delegates to
|
|
5
|
+
* scene renderers at each zoom level. Manages animation, pan/zoom,
|
|
6
|
+
* and breadcrumb navigation.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { OrbitalSchema } from '@almadar/core';
|
|
12
|
+
import { type ZoomLevel } from './avl-zoom-state';
|
|
13
|
+
export interface AvlCosmicZoomProps {
|
|
14
|
+
/** The orbital schema (parsed object or JSON string) */
|
|
15
|
+
schema: OrbitalSchema | string;
|
|
16
|
+
/** CSS class for the outer container */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Primary color for the visualization */
|
|
19
|
+
color?: string;
|
|
20
|
+
/** Enable animations (default: true) */
|
|
21
|
+
animated?: boolean;
|
|
22
|
+
/** Pre-select an orbital on mount */
|
|
23
|
+
initialOrbital?: string;
|
|
24
|
+
/** Pre-select a trait on mount */
|
|
25
|
+
initialTrait?: string;
|
|
26
|
+
/** Callback when zoom level changes */
|
|
27
|
+
onZoomChange?: (level: ZoomLevel, context: {
|
|
28
|
+
orbital?: string;
|
|
29
|
+
trait?: string;
|
|
30
|
+
}) => void;
|
|
31
|
+
/** Container width */
|
|
32
|
+
width?: number | string;
|
|
33
|
+
/** Container height */
|
|
34
|
+
height?: number | string;
|
|
35
|
+
/** Coverage data for verification overlay */
|
|
36
|
+
stateCoverage?: Record<string, 'covered' | 'uncovered' | 'partial'>;
|
|
37
|
+
}
|
|
38
|
+
export declare const AvlCosmicZoom: React.FC<AvlCosmicZoomProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvlLegend - Compact legend showing AVL symbol definitions.
|
|
3
|
+
*
|
|
4
|
+
* Each scene passes the set of symbol types it uses, and
|
|
5
|
+
* the legend renders only those symbols with labels.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { ZoomLevel } from './avl-zoom-state';
|
|
9
|
+
export interface AvlLegendProps {
|
|
10
|
+
level: ZoomLevel;
|
|
11
|
+
color?: string;
|
|
12
|
+
x?: number;
|
|
13
|
+
y?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const AvlLegend: React.FC<AvlLegendProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvlOrbitalScene - Zoom Level 2
|
|
3
|
+
*
|
|
4
|
+
* Shows a single orbital: entity nucleus with fields,
|
|
5
|
+
* trait rings, page markers, and external connection arrows.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { OrbitalLevelData } from './avl-schema-parser';
|
|
9
|
+
export interface AvlOrbitalSceneProps {
|
|
10
|
+
data: OrbitalLevelData;
|
|
11
|
+
color?: string;
|
|
12
|
+
/** Currently highlighted trait (before zooming in) */
|
|
13
|
+
highlightedTrait?: string | null;
|
|
14
|
+
onTraitClick?: (traitName: string, position: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}) => void;
|
|
18
|
+
/** Called when a trait tab is hovered/selected (highlight without zoom) */
|
|
19
|
+
onTraitHighlight?: (traitName: string | null) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const AvlOrbitalScene: React.FC<AvlOrbitalSceneProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvlTraitScene - Zoom Level 3
|
|
3
|
+
*
|
|
4
|
+
* Shows a trait's state machine using ELK (elkjs) for automatic
|
|
5
|
+
* node and edge label placement. No label overlap.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { TraitLevelData } from './avl-schema-parser';
|
|
9
|
+
export interface AvlTraitSceneProps {
|
|
10
|
+
data: TraitLevelData;
|
|
11
|
+
color?: string;
|
|
12
|
+
onTransitionClick?: (transitionIndex: number, position: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const AvlTraitScene: React.FC<AvlTraitSceneProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvlTransitionScene - Zoom Level 4
|
|
3
|
+
*
|
|
4
|
+
* Shows a single transition in detail as a vertical flow:
|
|
5
|
+
* FromState -> Event card -> Guard -> Effects -> ToState
|
|
6
|
+
*
|
|
7
|
+
* Labels are placed in cards between arrow segments,
|
|
8
|
+
* never overlapping the lines.
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { TransitionLevelData } from './avl-schema-parser';
|
|
12
|
+
export interface AvlTransitionSceneProps {
|
|
13
|
+
data: TransitionLevelData;
|
|
14
|
+
color?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const AvlTransitionScene: React.FC<AvlTransitionSceneProps>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AVL Schema Parser
|
|
3
|
+
*
|
|
4
|
+
* Pure functions that transform an OrbitalSchema into structured data
|
|
5
|
+
* for each zoom level of the Cosmic Zoom visualization.
|
|
6
|
+
*
|
|
7
|
+
* Imports all types from @almadar/core.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import type { OrbitalSchema } from '@almadar/core';
|
|
12
|
+
export interface ApplicationOrbitalData {
|
|
13
|
+
name: string;
|
|
14
|
+
entityName: string;
|
|
15
|
+
fieldCount: number;
|
|
16
|
+
persistence: string;
|
|
17
|
+
traitNames: string[];
|
|
18
|
+
pageNames: string[];
|
|
19
|
+
position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface CrossLink {
|
|
25
|
+
emitterOrbital: string;
|
|
26
|
+
listenerOrbital: string;
|
|
27
|
+
eventName: string;
|
|
28
|
+
emitterTrait: string;
|
|
29
|
+
listenerTrait: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ApplicationLevelData {
|
|
32
|
+
orbitals: ApplicationOrbitalData[];
|
|
33
|
+
crossLinks: CrossLink[];
|
|
34
|
+
}
|
|
35
|
+
export interface FieldInfo {
|
|
36
|
+
name: string;
|
|
37
|
+
type: string;
|
|
38
|
+
required: boolean;
|
|
39
|
+
hasDefault: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface OrbitalTraitInfo {
|
|
42
|
+
name: string;
|
|
43
|
+
stateCount: number;
|
|
44
|
+
eventCount: number;
|
|
45
|
+
transitionCount: number;
|
|
46
|
+
emits: string[];
|
|
47
|
+
listens: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface OrbitalPageInfo {
|
|
50
|
+
name: string;
|
|
51
|
+
route: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ExternalLink {
|
|
54
|
+
targetOrbital: string;
|
|
55
|
+
eventName: string;
|
|
56
|
+
direction: 'out' | 'in';
|
|
57
|
+
traitName: string;
|
|
58
|
+
}
|
|
59
|
+
export interface OrbitalLevelData {
|
|
60
|
+
name: string;
|
|
61
|
+
entity: {
|
|
62
|
+
name: string;
|
|
63
|
+
fields: FieldInfo[];
|
|
64
|
+
persistence: string;
|
|
65
|
+
};
|
|
66
|
+
traits: OrbitalTraitInfo[];
|
|
67
|
+
pages: OrbitalPageInfo[];
|
|
68
|
+
externalLinks: ExternalLink[];
|
|
69
|
+
}
|
|
70
|
+
export interface TraitStateInfo {
|
|
71
|
+
name: string;
|
|
72
|
+
isInitial?: boolean;
|
|
73
|
+
isTerminal?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface TraitTransitionInfo {
|
|
76
|
+
from: string;
|
|
77
|
+
to: string;
|
|
78
|
+
event: string;
|
|
79
|
+
guard?: unknown;
|
|
80
|
+
effects: Array<{
|
|
81
|
+
type: string;
|
|
82
|
+
args: unknown[];
|
|
83
|
+
}>;
|
|
84
|
+
index: number;
|
|
85
|
+
}
|
|
86
|
+
export interface TraitLevelData {
|
|
87
|
+
name: string;
|
|
88
|
+
linkedEntity: string;
|
|
89
|
+
states: TraitStateInfo[];
|
|
90
|
+
transitions: TraitTransitionInfo[];
|
|
91
|
+
emittedEvents: string[];
|
|
92
|
+
listenedEvents: string[];
|
|
93
|
+
}
|
|
94
|
+
export interface ExprTreeNode {
|
|
95
|
+
label: string;
|
|
96
|
+
type: 'operator' | 'literal' | 'binding';
|
|
97
|
+
children?: ExprTreeNode[];
|
|
98
|
+
}
|
|
99
|
+
export interface SlotTarget {
|
|
100
|
+
name: string;
|
|
101
|
+
pattern: string;
|
|
102
|
+
}
|
|
103
|
+
export interface TransitionLevelData {
|
|
104
|
+
from: string;
|
|
105
|
+
to: string;
|
|
106
|
+
event: string;
|
|
107
|
+
guard: ExprTreeNode | null;
|
|
108
|
+
effects: ExprTreeNode[];
|
|
109
|
+
slotTargets: SlotTarget[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Parse the application-level view: all orbitals with cross-orbital links.
|
|
113
|
+
*/
|
|
114
|
+
export declare function parseApplicationLevel(schema: OrbitalSchema): ApplicationLevelData;
|
|
115
|
+
/**
|
|
116
|
+
* Parse a single orbital's detail view.
|
|
117
|
+
*/
|
|
118
|
+
export declare function parseOrbitalLevel(schema: OrbitalSchema, orbitalName: string): OrbitalLevelData | null;
|
|
119
|
+
/**
|
|
120
|
+
* Parse a trait's state machine for the detail view.
|
|
121
|
+
*/
|
|
122
|
+
export declare function parseTraitLevel(schema: OrbitalSchema, orbitalName: string, traitName: string): TraitLevelData | null;
|
|
123
|
+
/**
|
|
124
|
+
* Parse a single transition for the detail view.
|
|
125
|
+
*/
|
|
126
|
+
export declare function parseTransitionLevel(schema: OrbitalSchema, orbitalName: string, traitName: string, transitionIndex: number): TransitionLevelData | null;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AVL Cosmic Zoom State Machine
|
|
3
|
+
*
|
|
4
|
+
* useReducer-based state machine managing which zoom level is displayed,
|
|
5
|
+
* what is selected, and animation state.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export type ZoomLevel = 'application' | 'orbital' | 'trait' | 'transition';
|
|
10
|
+
export interface ZoomState {
|
|
11
|
+
level: ZoomLevel;
|
|
12
|
+
selectedOrbital: string | null;
|
|
13
|
+
selectedTrait: string | null;
|
|
14
|
+
selectedTransition: number | null;
|
|
15
|
+
animating: boolean;
|
|
16
|
+
animationDirection: 'in' | 'out';
|
|
17
|
+
animationTarget: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
scale: number;
|
|
21
|
+
} | null;
|
|
22
|
+
}
|
|
23
|
+
export type ZoomAction = {
|
|
24
|
+
type: 'ZOOM_INTO_ORBITAL';
|
|
25
|
+
orbital: string;
|
|
26
|
+
targetPosition: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
type: 'ZOOM_INTO_TRAIT';
|
|
32
|
+
trait: string;
|
|
33
|
+
targetPosition: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
type: 'ZOOM_INTO_TRANSITION';
|
|
39
|
+
transitionIndex: number;
|
|
40
|
+
targetPosition: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
} | {
|
|
45
|
+
type: 'ZOOM_OUT';
|
|
46
|
+
} | {
|
|
47
|
+
type: 'ANIMATION_COMPLETE';
|
|
48
|
+
} | {
|
|
49
|
+
type: 'RESET';
|
|
50
|
+
} | {
|
|
51
|
+
type: 'SWITCH_TRAIT';
|
|
52
|
+
trait: string;
|
|
53
|
+
};
|
|
54
|
+
export declare const initialZoomState: ZoomState;
|
|
55
|
+
export declare function zoomReducer(state: ZoomState, action: ZoomAction): ZoomState;
|
|
56
|
+
export interface BreadcrumbSegment {
|
|
57
|
+
label: string;
|
|
58
|
+
level: ZoomLevel;
|
|
59
|
+
}
|
|
60
|
+
export declare function getBreadcrumbs(state: ZoomState): BreadcrumbSegment[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AVL Organisms - Interactive orbital visualizations.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { AvlCosmicZoom, type AvlCosmicZoomProps } from './AvlCosmicZoom';
|
|
7
|
+
export { AvlApplicationScene, type AvlApplicationSceneProps } from './AvlApplicationScene';
|
|
8
|
+
export { AvlOrbitalScene, type AvlOrbitalSceneProps } from './AvlOrbitalScene';
|
|
9
|
+
export { AvlTraitScene, type AvlTraitSceneProps } from './AvlTraitScene';
|
|
10
|
+
export { AvlTransitionScene, type AvlTransitionSceneProps } from './AvlTransitionScene';
|
|
11
|
+
export { AvlClickTarget, type AvlClickTargetProps } from './AvlClickTarget';
|
|
12
|
+
export { AvlLegend, type AvlLegendProps } from './AvlLegend';
|
|
13
|
+
export { parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, type ApplicationLevelData, type OrbitalLevelData, type TraitLevelData, type TransitionLevelData, type CrossLink, type ExprTreeNode, } from './avl-schema-parser';
|
|
14
|
+
export { zoomReducer, initialZoomState, getBreadcrumbs, type ZoomLevel, type ZoomState, type ZoomAction, type BreadcrumbSegment, } from './avl-zoom-state';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.1",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/components/index.js",
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
"@almadar/patterns": ">=2.0.0",
|
|
118
118
|
"@almadar/runtime": ">=2.0.0",
|
|
119
119
|
"clsx": "^2.1.0",
|
|
120
|
+
"elkjs": "0.11.1",
|
|
120
121
|
"leaflet": "1.9.4",
|
|
121
122
|
"lucide-react": "^0.344.0",
|
|
122
123
|
"react-leaflet": "^4.2.1",
|