std-dialogue-box
Level: Atom | Entity: DialogueBox | Persistence: runtime
2 states, 5 events, 5 transitions
Live Preview
schema.orb
{
"name": "DialogueBoxOrbital",
"orbitals": [
{
"name": "DialogueBoxOrbital",
"entity": {
"name": "DialogueBox",
"persistence": "runtime",
"fields": [
{
"name": "id",
"type": "string"
},
{
"name": "name",
"type": "string"
},
{
"name": "description",
"type": "string"
},
{
"name": "status",
"type": "string",
"default": "active",
"values": [
"active",
"inactive",
"pending"
]
},
{
"name": "createdAt",
"type": "string"
},
{
"name": "speaker",
"type": "string",
"default": "Narrator"
},
{
"name": "text",
"type": "string",
"default": "Welcome, adventurer. Your journey begins here."
}
]
},
"traits": [
{
"name": "DialogueBoxDialogue",
"linkedEntity": "DialogueBox",
"category": "interaction",
"stateMachine": {
"states": [
{
"name": "talking",
"isInitial": true
},
{
"name": "idle"
}
],
"events": [
{
"key": "INIT",
"name": "Initialize"
},
{
"key": "ADVANCE",
"name": "Advance"
},
{
"key": "CHOICE",
"name": "Choice",
"payload": [
{
"name": "choiceId",
"type": "string",
"required": true
}
]
},
{
"key": "COMPLETE",
"name": "Complete"
},
{
"key": "START_DIALOGUE",
"name": "Start Dialogue"
}
],
"transitions": [
{
"from": "talking",
"to": "talking",
"event": "INIT",
"effects": [
[
"fetch",
"DialogueBox"
],
[
"set",
"@entity.speaker",
"Narrator"
],
[
"set",
"@entity.text",
"Welcome, adventurer. Your journey begins here."
],
[
"render-ui",
"main",
{
"type": "dialogue-box",
"dialogue": {
"speaker": "@entity.speaker",
"text": "@entity.text"
},
"typewriterSpeed": 30,
"position": "bottom"
}
]
]
},
{
"from": "talking",
"to": "talking",
"event": "ADVANCE",
"effects": [
[
"fetch",
"DialogueBox"
],
[
"render-ui",
"main",
{
"type": "dialogue-box",
"dialogue": {
"speaker": "@entity.speaker",
"text": "@entity.text"
},
"typewriterSpeed": 30,
"position": "bottom"
}
]
]
},
{
"from": "talking",
"to": "talking",
"event": "CHOICE",
"effects": [
[
"render-ui",
"main",
{
"type": "dialogue-box",
"dialogue": {
"speaker": "@entity.speaker",
"text": "@entity.text"
},
"typewriterSpeed": 30,
"position": "bottom"
}
]
]
},
{
"from": "talking",
"to": "idle",
"event": "COMPLETE",
"effects": [
[
"render-ui",
"main",
{
"type": "stack",
"direction": "vertical",
"gap": "md",
"align": "center",
"children": [
{
"type": "typography",
"content": "Dialogue complete",
"variant": "caption"
},
{
"type": "button",
"label": "New Dialogue",
"event": "START_DIALOGUE",
"variant": "primary",
"icon": "message-circle"
}
]
}
]
]
},
{
"from": "idle",
"to": "talking",
"event": "START_DIALOGUE",
"effects": [
[
"fetch",
"DialogueBox"
],
[
"render-ui",
"main",
{
"type": "dialogue-box",
"dialogue": {
"speaker": "@entity.speaker",
"text": "@entity.text"
},
"typewriterSpeed": 30,
"position": "bottom"
}
]
]
}
]
}
}
],
"pages": [
{
"name": "DialogueBoxDialoguePage",
"path": "/dialogueboxs",
"traits": [
{
"ref": "DialogueBoxDialogue"
}
]
}
]
}
],
"description": "RPG dialogue atom using the `dialogue-box` pattern. Shows speaker, portrait, typewriter text, and choices."
}
Loading preview...
Orbital Visualization
Loading visualization...
Entity Fields
| Field | Type | Default |
|---|---|---|
| id | string | - |
| name | string | - |
| description | string | - |
| status | string | "active" |
| createdAt | string | - |
| speaker | string | "Narrator" |
| text | string | "Welcome, adventurer. Your journey begins here." |
States
| State | Type |
|---|---|
| talking | Initial |
| idle | - |
Events
| Event | Payload |
|---|---|
| INIT | - |
| ADVANCE | - |
| CHOICE | choiceId: string |
| COMPLETE | - |
| START_DIALOGUE | - |
Transitions
| From | Event | To | Effects |
|---|---|---|---|
| talking | INIT | talking | 4 effects |
| talking | ADVANCE | talking | 2 effects |
| talking | CHOICE | talking | 1 effect |
| talking | COMPLETE | idle | 1 effect |
| idle | START_DIALOGUE | talking | 2 effects |