Skip to content

Allow passing config.root.modelElement etc. in the configuration to define the model root #20029

@niegowski

Description

@niegowski

Describe the task

Currently the model root element name is always $root — it is hardcoded throughout the engine and cannot be changed by the integrator. This task introduces a config.root.modelElement option (and potentially other config.root.* options) that allows configuring the root element name used when the editor is initialized.

This is a prerequisite for editors that need a custom root schema — for example, a root that restricts or extends what content is allowed at the top level differently from the default $root. It is also the foundation that makes #20026 meaningful: fixing hardcoded $root checks is only useful once the root name can actually differ.

Definition of Done

  • config.root.modelElement is accepted — the editor reads this option during initialization and uses it as the model root element name instead of $root.
  • Editor constructor uses the configured root name — the editor constructor reads config.root.modelElement and passes it when creating the model root, instead of hardcoding '$root'.
    • This one applies to all editors (classic, …).
  • Backward compatible — omitting config.root.modelElement results in identical behavior to today ($root is used).
  • Documented — the new config option is described in the API docs with a usage example.
  • Automated tests cover initialization with a custom root name, schema registration, and data round-trip.

Metadata

Metadata

Assignees

Labels

squad:coreIssue to be handled by the Core team.type:taskThis issue reports a chore (non-production change) and other types of "todos".

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions