std-overworld
Level: Atom | Entity: WorldRegion | Persistence: runtime
3 states, 4 events, 4 transitions
Live Preview
orbital WorldRegionOrbital {
entity WorldRegion [runtime] {
id : string
name : string
description : string
status : string
createdAt : string
}
trait WorldRegionNavigation -> WorldRegion [interaction] {
initial: exploring
state exploring {
INIT -> exploring
(fetch WorldRegion)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "stack", direction: "horizontal", gap: "md", children: [{ type: "icon", name: "map", size: "lg" }, { type: "typography", content: "World Map", variant: "h2" }] }, { type: "status-dot", status: "active", pulse: false, label: "Exploring" }] }, { type: "divider" }, { type: "map-view", markers: [], height: "200px", zoom: 10 }, { type: "data-grid", entity: "WorldRegion", emptyIcon: "compass", emptyTitle: "No worldregions discovered", emptyDescription: "Explore to discover new worldregions.", itemActions: [{ label: "Travel", event: "TRAVEL" }], renderItem: ["fn", "item", { type: "stack", direction: "vertical", gap: "sm", children: [{ type: "stack", direction: "horizontal", justify: "space-between", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "map-pin", size: "sm" }, { type: "typography", variant: "h4", content: "@item.name" }] }, { type: "badge", label: "@item.description" }] }, { type: "typography", variant: "caption", content: "@item.status" }] }] }] })
TRAVEL -> transitioning
(render-ui main { type: "stack", direction: "vertical", gap: "lg", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "md", children: [{ type: "icon", name: "loader", size: "lg" }, { type: "typography", content: "Traveling...", variant: "h2" }] }, { type: "divider" }, { type: "typography", content: "Traveling to the destination worldregions map.", variant: "body" }] })
}
state transitioning {
ARRIVE -> entered
(fetch WorldRegion)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "stack", direction: "horizontal", gap: "md", children: [{ type: "icon", name: "map", size: "lg" }, { type: "typography", content: "WorldRegions Map", variant: "h2" }] }, { type: "status-dot", status: "success", label: "Entered" }] }, { type: "divider" }, { type: "data-grid", entity: "WorldRegion", emptyIcon: "inbox", emptyTitle: "Nothing here", emptyDescription: "This zone is empty.", renderItem: ["fn", "item", { type: "stack", direction: "vertical", gap: "sm", children: [{ type: "stack", direction: "horizontal", justify: "space-between", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "map-pin", size: "sm" }, { type: "typography", variant: "h4", content: "@item.name" }] }, { type: "badge", label: "@item.description" }] }, { type: "typography", variant: "caption", content: "@item.status" }] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Back to Map", event: "BACK", variant: "ghost", icon: "arrow-left" }] }] })
}
state entered {
BACK -> exploring
(fetch WorldRegion)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "stack", direction: "horizontal", gap: "md", children: [{ type: "icon", name: "map", size: "lg" }, { type: "typography", content: "World Map", variant: "h2" }] }, { type: "status-dot", status: "active", pulse: false, label: "Exploring" }] }, { type: "divider" }, { type: "map-view", markers: [], height: "200px", zoom: 10 }, { type: "data-grid", entity: "WorldRegion", emptyIcon: "compass", emptyTitle: "No worldregions discovered", emptyDescription: "Explore to discover new worldregions.", itemActions: [{ label: "Travel", event: "TRAVEL" }], renderItem: ["fn", "item", { type: "stack", direction: "vertical", gap: "sm", children: [{ type: "stack", direction: "horizontal", justify: "space-between", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "sm", align: "center", children: [{ type: "icon", name: "map-pin", size: "sm" }, { type: "typography", variant: "h4", content: "@item.name" }] }, { type: "badge", label: "@item.description" }] }, { type: "typography", variant: "caption", content: "@item.status" }] }] }] })
}
}
page "/worldregions" -> WorldRegionNavigation
}
Loading preview...
Orbital Visualization
Loading visualization...
Entity Fields
| Field | Type | Default |
|---|---|---|
| id | string | - |
| name | string | - |
| description | string | - |
| status | string | "active" |
| createdAt | string | - |
States
| State | Type |
|---|---|
| exploring | Initial |
| transitioning | - |
| entered | - |
Events
| Event | Payload |
|---|---|
| INIT | - |
| TRAVEL | zoneId: string |
| ARRIVE | - |
| BACK | - |
Transitions
| From | Event | To | Effects |
|---|---|---|---|
| exploring | INIT | exploring | 2 effects |
| exploring | TRAVEL | transitioning | 1 effect |
| transitioning | ARRIVE | entered | 2 effects |
| entered | BACK | exploring | 2 effects |