Board kit command

element.getStyle

Read style

Reads the style fields the elements use, or a new element's defaults for a kind, without changing anything; null marks a field the elements differ on. Also answers the colour palette.

Kit
Board 0.1.0 (.kboard)
Changes the document
no
Acts on
ids (a list of ids), which a run step’s on fills

Parameters

Parameters of element.getStyle
NameTypeRequiredDescription
idsstring[]noThe elements (instead of kind)
kind"shape" | "text" | "stroke" | "connector" | "image" | "card" | "frame"noA new element's kind, for its defaults (instead of ids)
shapeStyle"default" | "sticky" | "mind-node" | "flow-node" | "image-placeholder"noThe new shape's role

Call through board_run

text
board_run {
  "path": "<file>.kboard",
  "steps": [{ "command": "element.getStyle" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: ids, kind, shapeStyle. board_run answers the step’s result in completed[i].result.

Result

Result of element.getStyle
NameTypeRequiredDescription
fieldsstring[]yesThe style fields the elements use, in element.style order
paletteobject[]yes
styleobjectyesEach field's value; null where the elements differ
Result JSON Schema
json
{
  "additionalProperties": false,
  "properties": {
    "fields": {
      "description": "The style fields the elements use, in element.style order",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "palette": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "fill": {
            "type": "string"
          },
          "stroke": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "fill",
          "stroke",
          "token"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "style": {
      "additionalProperties": true,
      "description": "Each field's value; null where the elements differ",
      "type": "object"
    }
  },
  "required": [
    "fields",
    "palette",
    "style"
  ],
  "type": "object"
}

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "ids": {
      "description": "The elements (instead of kind)",
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-khp-types": [
        "Element"
      ]
    },
    "kind": {
      "description": "A new element's kind, for its defaults (instead of ids)",
      "enum": [
        "shape",
        "text",
        "stroke",
        "connector",
        "image",
        "card",
        "frame"
      ],
      "type": "string"
    },
    "shapeStyle": {
      "description": "The new shape's role",
      "enum": [
        "default",
        "sticky",
        "mind-node",
        "flow-node",
        "image-placeholder"
      ],
      "type": "string"
    }
  },
  "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.