Audience: Contributor
On-disk element schemas, &def metadata, DbInit catalog rows, and property-panel editor inference.
See also: Overview · Models · Operations
Schemas under server/main/src/schema/lokakrt.com/schema/ declare both validation (AJV) and authoring UX (palette, defaults, editors) via LokAkrt extensions (&def, &subCategory, &hint).
server/main/src/schema/lokakrt.com/schema/
html/<name>/schema.json[+ children.json]
ionic/<name>/schema.json[+ children.json]
lokakrt/<name>/schema.json[+ children.json]
builder/<name>/schema.json # e.g. lkt-block — not DbInit-upserted
prop/{layout|ionic|html}/*.prop.json
css/*.schema.json
page.schema.json # generated union of all element $ids
value.schema.json
$id must be https://lokakrt.com/schema/<category>/<folder>/schema.json.
$schema, $id, title&subCategory — palette group (basic, layout, form, text, …)type: "object", required: ["type"], usually additionalProperties: falseproperties.type.const — runtime type stringproperties.props.items.anyOf — allowed props ($ref + overlays)properties.children — nesting policy (omit = leaf; items: true = unrestricted; items.anyOf = restricted). A few lokakrt hosts put children at the schema root instead — treat that the same for policy classification.&def — LokAkrt metadata&def fields| Field | Purpose |
|---|---|
children |
URL to children.json or inline default tree |
palette: false |
Hide from Insert; still nestable / resolvable |
render |
Codegen profile (kind, tag, children, attrAliases, booleanAttrs, modelBinding, layoutWrapper, overlayChildren, chromeClassTokens, …) — see SchemaRenderDef in common/script/element-template/types.ts |
{
"$ref": "https://lokakrt.com/schema/prop/schema.json",
"&def": {
"type": "attr",
"group": "appearance",
"groupIdx": 0,
"editorIdx": 1
},
"$defs": {
"name": { "type": "string", "const": "fill" },
"rawType": { "$ref": "https://lokakrt.com/schema/prop/ionic/fill.button.schema.json" }
}
}
Or a full shared prop file: { "$ref": "https://lokakrt.com/schema/prop/layout/flex-justify.prop.json" }.
&hint: true on a prop marks the canvas label field (hintField in the catalog).
prop/schema.json — name, type (attr|css|url|none), value, fallback, variance, resultExpr, responsivevalue.schema.json — { raw } and/or { expr, interval? }Shared libraries: prop/layout/*, prop/ionic/*, prop/html/*, css/*.
DbInitService (startup) walks AJV schemas for html / ionic / lokakrt only (skips builder/). For each element it:
type.const, &subCategory, &hint → hint_field&def with inferred options from rawType:
enum → selectOptionsboolean → toggleOptionsnumber → rangeOptions$ref → propDefinitionFields[ref]() (colors, spacing, …)&def.children into definition.childrenelement row (definition JSON)allowed_child_elements stays default ["*"] and is not derived from schema anyOf.
EditorModel.type (common/projects/lokakrt/dynamic/.../editor.model.ts):
editorType (normalized to EditorType)colorOptions → mediaOptions → buttonGroupOptions → selectOptions → rangeOptions/varianceOptions → toggleOptions → languageOptionshtml: true → rich-text, else textClosed EditorType set (keep UI registry in sync):
buttonGroup | toggle | language | color | media | select | slider | spacing | gridColumn | chartSeries | chartPalette | chartField | gradient | text | rich-text
Lazy Angular widgets: ui/main/src/app/dynamic/element-editors/editor/editor-registry.ts (EDITOR_COMPONENT_LOADERS).
type === 'css' or group in style set (typography, layout, dimensions, background, border, size, grid, ionic, chart, appearance, …) → Stylegroup === 'dataSource' → DatapageId / tab)Grouping keys on &def: group, parentGroup, groupIdx, subGroupIdx, editorIdx.
ion-button (restricted children + attr overlays)properties.type.const: "ion-button"&def.children → ionic/button/children.json (default text node)properties.children.items.anyOf → text, ion-badge, ion-icon, ion-label, ion-textcolor, fill, shape, …lkt-form (unrestricted + render component)&def.render: { kind: "component", tag: "lkt-form", children: true, modelBinding: true }lokakrt/form/children.jsonitems: true)text (leaf)properties.children&hint on html proptext nodeflex-justify.prop.json (button group editor)Shared layout prop with &def.buttonGroupOptions targeting CSS justify-content. EditorModel infers buttonGroup without an explicit editorType.