Preskoči na vsebino

std-movement

Level: Atom | Entity: MovableEntity | Persistence: runtime

3 states, 7 events, 7 transitions

Live Preview

orbital MovableEntityOrbital {
entity MovableEntity [runtime] {
id : string
name : string
description : string
status : string
createdAt : string
x : number
y : number
}
trait MovableEntityMovement -> MovableEntity [interaction] {
initial: idle
state idle {
INIT -> idle
(fetch MovableEntity)
(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: "move", size: "lg" }, { type: "typography", content: "MovableEntitys Movement", variant: "h2" }] }, { type: "status-dot", status: "inactive", label: "Idle" }] }, { type: "divider" }, { type: "simple-grid", columns: 2, children: [{ type: "stat-display", label: "X", value: ["object/get", ["array/first", "@entity"], "x"] }, { type: "stat-display", label: "Y", value: ["object/get", ["array/first", "@entity"], "y"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Move", event: "MOVE", variant: "primary", icon: "navigation" }] }] })
MOVE -> moving
(fetch MovableEntity)
(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: "move", size: "lg" }, { type: "typography", content: "MovableEntitys Movement", variant: "h2" }] }, { type: "status-dot", status: "active", pulse: true, label: "Moving" }] }, { type: "divider" }, { type: "simple-grid", columns: 2, children: [{ type: "stat-display", label: "X", value: ["object/get", ["array/first", "@entity"], "x"] }, { type: "stat-display", label: "Y", value: ["object/get", ["array/first", "@entity"], "y"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Stop", event: "STOP", variant: "danger", icon: "square" }] }] })
}
state moving {
STOP -> idle
(fetch MovableEntity)
(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: "move", size: "lg" }, { type: "typography", content: "MovableEntitys Movement", variant: "h2" }] }, { type: "status-dot", status: "inactive", label: "Idle" }] }, { type: "divider" }, { type: "simple-grid", columns: 2, children: [{ type: "stat-display", label: "X", value: ["object/get", ["array/first", "@entity"], "x"] }, { type: "stat-display", label: "Y", value: ["object/get", ["array/first", "@entity"], "y"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Move", event: "MOVE", variant: "primary", icon: "navigation" }] }] })
COLLISION -> colliding
(render-ui modal { type: "stack", direction: "vertical", gap: "md", children: [{ type: "stack", direction: "horizontal", gap: "sm", children: [{ type: "icon", name: "alert-triangle", size: "md" }, { type: "typography", content: "Collision Detected", variant: "h3" }] }, { type: "divider" }, { type: "typography", content: "A collision has been detected. Resolve to continue.", variant: "body" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Cancel", event: "CANCEL", variant: "ghost" }, { type: "button", label: "Resolve", event: "RESOLVE", variant: "primary", icon: "check" }] }] })
}
state colliding {
RESOLVE -> idle
(render-ui modal null)
(fetch MovableEntity)
(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: "move", size: "lg" }, { type: "typography", content: "MovableEntitys Movement", variant: "h2" }] }, { type: "status-dot", status: "inactive", label: "Idle" }] }, { type: "divider" }, { type: "simple-grid", columns: 2, children: [{ type: "stat-display", label: "X", value: ["object/get", ["array/first", "@entity"], "x"] }, { type: "stat-display", label: "Y", value: ["object/get", ["array/first", "@entity"], "y"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Move", event: "MOVE", variant: "primary", icon: "navigation" }] }] })
CANCEL -> idle
(render-ui modal null)
(fetch MovableEntity)
(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: "move", size: "lg" }, { type: "typography", content: "MovableEntitys Movement", variant: "h2" }] }, { type: "status-dot", status: "inactive", label: "Idle" }] }, { type: "divider" }, { type: "simple-grid", columns: 2, children: [{ type: "stat-display", label: "X", value: ["object/get", ["array/first", "@entity"], "x"] }, { type: "stat-display", label: "Y", value: ["object/get", ["array/first", "@entity"], "y"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Move", event: "MOVE", variant: "primary", icon: "navigation" }] }] })
CLOSE -> idle
(render-ui modal null)
(fetch MovableEntity)
(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: "move", size: "lg" }, { type: "typography", content: "MovableEntitys Movement", variant: "h2" }] }, { type: "status-dot", status: "inactive", label: "Idle" }] }, { type: "divider" }, { type: "simple-grid", columns: 2, children: [{ type: "stat-display", label: "X", value: ["object/get", ["array/first", "@entity"], "x"] }, { type: "stat-display", label: "Y", value: ["object/get", ["array/first", "@entity"], "y"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Move", event: "MOVE", variant: "primary", icon: "navigation" }] }] })
}
}
page "/movableentitys" -> MovableEntityMovement
}
Loading preview...

Orbital Visualization

Loading visualization...

Entity Fields

FieldTypeDefault
idstring-
namestring-
descriptionstring-
statusstring"active"
createdAtstring-
xnumber0
ynumber0

States

StateType
idleInitial
moving-
colliding-

Events

EventPayload
INIT-
MOVEx: number, y: number
STOP-
COLLISIONtargetId: string
RESOLVE-
CANCEL-
CLOSE-

Transitions

FromEventToEffects
idleINITidle2 effects
idleMOVEmoving2 effects
movingSTOPidle2 effects
movingCOLLISIONcolliding1 effect
collidingRESOLVEidle3 effects
collidingCANCELidle3 effects
collidingCLOSEidle3 effects