Board kit command
element.move
Move
Moves the elements by delta or so the selection's top-left lands at `to`; with reparent each element joins the frame its centre lands in.
- Kit
- Board 0.1.0 (.kboard)
- Changes the document
- yes
- Acts on
ids(a list of ids), which a run step’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
delta | number[] | object | no | [dx, dy] to move by |
ids | string[] | yes | The elements; what is inside them moves along |
reparent | boolean | no | Each moved element takes the frame its centre lands in (and leaves a frame it is moved out of) |
to | number[] | object | no | [x, y] for the selection's top-left corner (instead of delta) |
Call through board_run
text
board_run {
"path": "<file>.kboard",
"steps": [{ "command": "element.move", "params": { "ids": <string[]> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: delta, reparent, to. board_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
json
{
"additionalProperties": false,
"properties": {
"delta": {
"description": "[dx, dy] to move by",
"oneOf": [
{
"items": {
"description": "One component",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
},
"type": "array"
},
{
"additionalProperties": false,
"properties": {
"x": {
"description": "One component",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
},
"y": {
"description": "One component",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
}
},
"required": [
"x",
"y"
],
"type": "object"
}
]
},
"ids": {
"description": "The elements; what is inside them moves along",
"items": {
"type": "string"
},
"type": "array",
"x-khp-types": [
"Element"
]
},
"reparent": {
"description": "Each moved element takes the frame its centre lands in (and leaves a frame it is moved out of)",
"type": "boolean"
},
"to": {
"description": "[x, y] for the selection's top-left corner (instead of delta)",
"oneOf": [
{
"items": {
"description": "One component",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
},
"type": "array"
},
{
"additionalProperties": false,
"properties": {
"x": {
"description": "One component",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
},
"y": {
"description": "One component",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
}
},
"required": [
"x",
"y"
],
"type": "object"
}
]
}
},
"required": [
"ids"
],
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (board_commands through @kition/[email protected], built from KitionAI/kition-board@e78c190). As data: commands.jsonl.