How visshon/morphiccanvas works
Main Components Identification
The system should be represented with these primary components:
A. Frontend Layer (Client-Side)
• Next.js Application Container
• Canvas System (FabricJS Integration)
• Search & Filter System
• Context Management
• User Interface Components
Architectural Pattern Representation
┌─ Next.js Application ──────────────────────────┐
• ┌─ Context Layer ─────────────────────────┐ │
• CanvasContext │ │
• FilterContext │ │
• ┘ │
• ┌─ Component Layer ──────────────────────┐ │
• ┌─ Core Components ─┐ ┌─ UI Layer ──┐ │ │
• FabricCanvas │ │ - TextMenu │ │ │
• GlobalSearch │ │ - SearchUI │ │ │
• ┘ └────────────┘ │ │
• ┘ │
• ┌─ Utility Layer ────────────────────────┐ │
• Custom Hooks │ │
• Library Functions │ │
• ┘ │
• ┘
Specific Implementation Details
a. Canvas System:
• FabricCanvas component integration with fabric.js
• Mouse interaction handling through useMouse hook
• Canvas state management via CanvasContext
b. Search System:
• GlobalSearch component architecture
• SearchDialog component hierarchy
• Filter management through FilterContext
c. Shortcut System:
• useShortcut hook integration
• Command handling flow
• Integration with canvas and search features