DocumentEditor

High-level editor for a Document.

Provides access to fields and pages, mutation helpers, and validation. Mutations write through to the underlying Document and may trigger condition re-evaluation, visibility changes, and dependent formula updates.

Properties

Link copied to clipboard

In-memory record of events captured while editing.

Link copied to clipboard
abstract val error: Live<Error?>

Reactive error stream; when non-null, validate returns invalid.

Link copied to clipboard
abstract val fields: FieldCollection

Collection interface to access and locate component editors.

Link copied to clipboard
abstract var id: String

Stable identifier; assigning updates the underlying document.

Link copied to clipboard
abstract var identifier: String

Optional external identifier; assigning updates the underlying document.

Link copied to clipboard
abstract var name: String

Human-readable document name; assigning updates the underlying document.

Link copied to clipboard
abstract val pages: PageCollection

Page collection with navigation and visibility controls.

Link copied to clipboard
abstract var stage: Stage

Current workflow stage; assigning updates the underlying document.

Link copied to clipboard
abstract val views: List<View>

All views aggregated from the document's files. Read-only snapshot.

Functions

Link copied to clipboard
fun DocumentEditor.append(fieldId: String, targetIndex: Int, cellUpdates: Map<Column, Any?>, rowId: String? = null, schemaId: String? = null, parentPath: String? = null)

Appends a new row to a table at a specified target index.

Link copied to clipboard

Applies a change log to the document editor.

Link copied to clipboard
fun DocumentEditor.columnsFor(fieldId: String, schemaId: String? = null): List<Column>?

Retrieves the columns for a specific table field.

Link copied to clipboard
abstract fun <R> get(key: String): R

Fetch an arbitrary top-level value from the document, cast to R.

Link copied to clipboard
abstract fun integrity(): FieldsValidity

Validate data integrity across fields. Implementation typically aggregates per-component validity for the active scope.

Link copied to clipboard
fun DocumentEditor.move(fieldId: String, rowId: String, toIndex: Int, schemaId: String? = null)

Moves a table row to a new position within the table.

Link copied to clipboard
fun DocumentEditor.remove(fieldId: String, rowId: String, schemaId: String? = null)

Removes a specific row from a table.

Link copied to clipboard
abstract fun resolveConditions()

Recompute conditional logic (hide/disable, etc.). Updates component/page visibility and may trigger dependent value recomputation.

Link copied to clipboard
abstract fun set(key: String, value: Any?)

Set an arbitrary top-level key/value on the document. May affect conditions or formulas that reference the key.

Link copied to clipboard
abstract fun toDocument(): Document

Return the underlying mutable Document reference.

Link copied to clipboard
abstract fun toJsonObject(): JsonObject
Link copied to clipboard
abstract fun toJsonString(): String
Link copied to clipboard
abstract fun toMap(): MutableMap<String, Any?>
Link copied to clipboard
fun DocumentEditor.update(fieldId: String, cellUpdates: Map<Column, Any?>, rowId: String? = null, schemaId: String? = null)

Updates a table row with new cell values.

Link copied to clipboard
abstract fun validate(): FieldsValidity

Validates the current state of the fields within the document editor. This method ensures data consistency and checks the overall integrity of the fields, typically aggregating validity across individual components within the active scope or context.