How smartxworks/sunmao-ui works
Core Architecture Components
a. Core Layer (packages/core)
• Application Manager
• Component Registry
• Trait System
• Scope Management
• Module System
b. Runtime Layer (packages/runtime)
• Component Renderer
• State Management
• Event Handling
• Service Layer
• Trait Implementation
c. Editor Layer (packages/editor)
• Visual Editor Interface
• Component Form Management
• Operations Manager
• Validation System
• Structure Tree
d. Component Libraries
• Arco Components (packages/arco-lib)
• Chakra UI Components (packages/chakra-ui-lib)
Key Relationships and Data Flow
┌─────────────────────────────────────────────────────────┐
• Editor Layer │
• ┤
• ┌─────────────┐ ┌──────────────┐ ┌────────────────┐ │
• Component │ │Operation │ │Validation │ │
• Editor UI │◄─►│Manager │◄─►│System │ │
• ┘ └──────────────┘ └────────────────┘ │
• ▲ ▲ ▲ │
• ┼────────────────┼──────────────────┼───────────┘
┌─────────┼────────────────┼──────────────────┼───────────┐
• ▼ ▼ ▼ │
• ┌─────────────┐ ┌──────────────┐ ┌────────────────┐ │
• Component │ │State │ │Event │ │
• Runtime │◄─►│Manager │◄─►│Handler │ │
• ┘ └──────────────┘ └────────────────┘ │
• Runtime Layer │
• ┘
• ▲ ▲ ▲
┌─────────┼─────────────────┼──────────────────┼──────────┐
• ▼ ▼ ▼ │
• ┌─────────────┐ ┌──────────────┐ ┌────────────────┐ │
• Component │ │Trait │ │Module │ │
• Registry │◄─►│System │◄─►│System │ │
• ┘ └──────────────┘ └────────────────┘ │
• Core Layer │
• ┘
• ▲ ▲
┌─────────┼─────────────────┼────────────┐
• ▼ ▼ │
• ┌─────────────┐ ┌──────────────┐ │
• Arco UI │ │Chakra UI │ │
• Components │ │Components │ │
• ┘ └──────────────┘ │
• Component Libraries │
• ┘
Important Elements
• Blue: Core system components
• Green: Runtime components
• Orange: Editor components
• Purple: Component libraries
• Connection types:
• Double lines: Data flow
• Labels:
• Clear component names
• Interface points
• Data flow direction
• Key operations