- Notifications
You must be signed in to change notification settings - Fork0
CibiAananth/cuddly-engine
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This project was generated withVite version 4.3.8.
Runnpm run dev
for a dev server. Navigate tohttp://localhost:9000/
. The app will automatically reload if you change any of the source files.
Runnpm run build
to build the project. The build artifacts will be stored in thedist/
directory.
- Create a new file in
src/components/Nodes
folder with the name of the node. For examplesrc/components/Nodes/MyCustomNode.jsx
- Add the node's Settings, Node and NodeBlock components and its factory function. Please refer the existing nodes for the structure.
- Add the new node to
nodeTypes
and it's factory function tonodeCreator
insrc/components/Flow.jsx
The philosophy followed throughout the project is
Keep the components as dumb as possible and move the logic to its corresponding helper functions. This helps in reusing the components in different contexts. For example, the settings for each node is dynamic and bound to the node object so the Sidebar component is kept dumb and simply renders the settings component passed to it.
Colocate the node and its pet components in the same file. For example, the
MessageNode
component and its helper functions are colocated in the same filesrc/components/Nodes/MessageNode.jsx