Skip to content

Editor Overview

The Elucim editor is a drop-in React workspace for building normalized ElucimDocument scenes visually. It edits the same JSON/YAML-compatible document model that <DslRenderer> renders: elements live in the document tree, motion lives in timelines and state machines, and generated polish can be reviewed before it changes the scene.

Terminal window
pnpm add @elucim/editor @elucim/core @elucim/dsl react react-dom
import { ElucimEditor } from '@elucim/editor';
export function App() {
return <ElucimEditor style={{ width: '100vw', height: '100vh' }} />;
}

This opens the full editor shell with an Objects/Create/Polish dock, canvas, inspector, zoom controls, minimap, and the motion panel.

Elucim editor in dark mode showing dense canvas, Objects, inspector, and motion panel Elucim editor in light mode showing dense canvas, Objects, inspector, and motion panel

Pass an initialDocument to open an existing normalized scene. Edits are emitted through onDocumentChange as normalized ElucimDocument output.

import { ElucimEditor } from '@elucim/editor';
import type { ElucimDocument } from '@elucim/dsl';
const scene: ElucimDocument = {
version: '2.0',
scene: {
type: 'player',
width: 1280,
height: 720,
fps: 60,
background: '$background',
children: ['title', 'node'],
},
elements: {
title: {
id: 'title',
type: 'text',
role: 'title',
props: { type: 'text', content: 'Energy transfer', x: 640, y: 96, fill: '$title', fontSize: 44, textAnchor: 'middle' },
},
node: {
id: 'node',
type: 'circle',
role: 'concept',
props: { type: 'circle', cx: 640, cy: 360, r: 84, fill: '$surface', stroke: '$accent', strokeWidth: 3 },
},
},
timelines: {
intro: {
id: 'intro',
duration: 60,
tracks: [
{ target: 'title', property: 'opacity', keyframes: [{ frame: 0, value: 0 }, { frame: 60, value: 1 }] },
],
},
},
metadata: { title: 'Energy transfer', intent: 'Show the main concept before adding detail.' },
};
export function App() {
return (
<ElucimEditor
initialDocument={scene}
initialFrame="last"
onDocumentChange={(doc, details) => {
saveDocument(doc);
if (details.warnings.length > 0) showCompatibilityWarnings(details.warnings);
}}
style={{ width: '100vw', height: '100vh' }}
/>
);
}

initialFrame can be a frame number or 'last', which is useful when opening generated documents with reveal timelines.

The editor no longer asks you to switch between broad Design, Animate, State Machine, and Polish workspace presets. The persistent shell keeps the same core surfaces visible so the document model stays obvious:

SurfaceUse it for
ObjectsBrowse the scene tree, select Objects, inspect generated IDs, understand groups, and reorder scene structure.
CreateAdd template Objects to the scene. Templates become normal Elucim Document elements.
PolishReview scene metadata, selected-object intent, validation warnings, compatibility notes, polish diagnostics, and suggested document nudges.
InspectorEdit the selected canvas or Object’s static properties, layout, style, transforms, and group details.
TimelineEdit animation timelines, property tracks, keyframes, easing, and preview frames.
Animations motion tabAuthor timeline-based motion for Objects.
State machines motion tabWire timelines into Entry/state/Exit flows, transitions, trigger inputs, keyboard/click events, and preview behavior.

Normalized documents open with motion visible so existing animations are immediately inspectable. New blank editor sessions emphasize Objects and the inspector first.

The current editor shell is a docked scene-editing UI:

RegionPurpose
Top barShow/hide toggles for the left panel, inspector, and timeline.
Left dockObjects for scene structure, Create for element templates, and Polish for diagnostics and nudges.
CanvasPan/zoom stage with grid, selection overlay, context menu, minimap, and zoom controls.
InspectorContextual properties for the canvas or selected element.
Motion panelAnimations and State machines motion tabs for timeline editing and state-machine graphs.

The left dock, inspector, and timeline are resizable. Hidden regions can be restored from the top bar or the collapsed rail.

Open Create in the left dock and choose from the template palette:

CategoryTemplates
PresentationTitle, Subtitle, Hero Card, Metric, Callout
ShapeRectangle, Circle, Polygon, Image
LineLine, Bezier Curve
TextText, LaTeX
MathAxes, Function Plot, Vector, Vector Field, Matrix
DataBar Chart, Graph

Templates insert normal scene Objects with sensible tokenized colors. Select the new Object and use the inspector for static properties, then use timelines/state machines for motion.

  • Click an element to select it; Shift/Ctrl/Cmd+click toggles multi-selection.
  • Drag selected elements to move them; Alt+drag duplicates first, then drags the copy.
  • Drag handles to resize; Shift+drag constrains uniform resizing.
  • Use Objects or the right-click context menu for grouping, clipboard actions, layer order, align, and distribute.
  • Double-click an item in Objects to rename it. Renames are mapped back into normalized output where possible.
Selected Object in the editor with Objects, inspector, and selection handles Selected Object in the editor light theme with Objects, inspector, and selection handles

Motion is not authored as wrapper JSX. Use:

  1. Animations in the motion panel for timeline property tracks and keyframes on opacity, translate, scale, rotate, fill, or stroke.
  2. State machines in the motion panel to decide when timelines run and how users can move through animated states.
  3. Preview controls to scrub frames, play animation, or trigger state-machine events.
Dense editor timeline with animation tracks and keyframes Dense editor timeline in light mode with animation tracks and keyframes

For host applications, prefer onDocumentChange; it gives you the normalized output document. The toolbar Save, Open, and Copy actions are convenience UI for local JSON workflows. Imported Elucim Document JSON is validated and migrated into the editor working shape; output is restored to normalized document JSON when emitted.

ShortcutAction
Delete / BackspaceDelete selected elements
Ctrl+ZUndo
Ctrl+Y / Ctrl+Shift+ZRedo
Ctrl+ASelect all elements
Ctrl+DDuplicate selected elements
Ctrl+C / Ctrl+VCopy / paste selected elements
Ctrl+G / Ctrl+Shift+GGroup / ungroup
Ctrl+] / Ctrl+[Bring forward / send backward
Ctrl+Shift+] / Ctrl+Shift+[Bring to front / send to back
Arrow keysNudge selected elements by 1px
Shift+Arrow keysNudge by 10px
Ctrl+= / Ctrl+-Zoom in / out
Ctrl+0 / Ctrl+1Fit to view / 100% zoom
Space (hold)Pan mode
EscapeDeselect and return to select tool