Skip to content

Text Editor Panel ​

Purpose ​

textEditorPanel is a thin renderer-policy shell around tiptapPanel. It selects the only active renderer, forwards Tiptap config and object binding, and warns when selected content declares an unsupported legacy renderer.

When to use ​

Use it when persisted content may contain renderer metadata and users need an explicit migration warning. Use tiptapPanel directly when no renderer-policy layer is needed.

Prerequisites and ownership ​

  • Tiptap is the only supported defaultEditor.
  • Object binding uses the same selection event and attributeName prerequisites as Tiptap.
  • The shell owns config normalization, persisted renderer inspection, renderer choice, and one warning per object/renderer load cycle.
  • Tiptap owns all editor UI, content behavior, dirty state, and persistence.

Capability map ​

AreaSupported behavior
Renderer policyNormalizes omitted defaultEditor to tiptap
DelegationForwards editorConfig.tiptap and request to a Tiptap wrapper
Persisted inspectionParses JSON strings or objects and reads top-level renderer
Legacy fallbackKeeps Tiptap active and emits a warning for a different persisted renderer
Warning controlWarns once for the selected object and unsupported renderer during a load cycle
EditingEntirely the downstream Tiptap contract

Behavioral model ​

The shell merges component and panel config, forcing the current renderer policy to Tiptap. When object-bound, it inspects the already selected object's target attribute for renderer metadata. A different renderer does not load an alternative editor: Tiptap remains active, the user is warned, and Tiptap normalizes that foreign wrapper to an empty document.

Alternatives, defaults, and precedence ​

  • defaultEditor defaults to and only accepts tiptap.
  • Panel editorConfig overrides directly supplied component config.
  • editorConfig.tiptap is passed through to Tiptap; its defaults and prerequisites remain unchanged.
  • Persisted metadata never overrides the active renderer in the current implementation.

Limitations ​

  • This is not a multi-editor selector. No Editor.js renderer remains.
  • Unsupported persisted content is not converted. Saving the empty Tiptap document rewrites the attribute as a Tiptap wrapper and can discard the legacy payload.
  • Renderer inspection needs both a selection event and target tiptap.attributeName; standalone content has no persisted renderer probe.
  • The runnable standalone fixture verifies shell-to-Tiptap delegation only. It has no object binding, persistence, or legacy-renderer warning cycle.

Minimal configuration ​

json
{
  "id": "text-editor",
  "type": "textEditorPanel",
  "editorConfig": {
    "defaultEditor": "tiptap",
    "tiptap": {
      "placeholder": "Write text..."
    }
  }
}

Scenario: edit selected content with legacy detection ​

json
{
  "id": "operation-text",
  "type": "textEditorPanel",
  "request": {
    "getSelectedObjectForEventId": "operations--selected"
  },
  "editorConfig": {
    "defaultEditor": "tiptap",
    "tiptap": {
      "readOnly": false,
      "attributeName": "textualInstruction",
      "dataFormat": "json",
      "placeholder": "Enter work instructions...",
      "minHeight": 500
    }
  }
}

Expected result: Tiptap loads normal Tiptap/plain content. If the selected attribute contains a wrapper such as { "renderer": "editorjs", ... }, the shell warns and shows an empty Tiptap document. The user must decide whether to save and overwrite it.

Runnable demos ​

Open the standalone Text Editor shell

This registered fixture renders the actual textEditorPanel type with defaultEditor: "tiptap" and a nested Tiptap initialContent document. Edits remain in browser state: the fixture deliberately omits request and attributeName, so it does not pretend that standalone changes are persisted or that selected-object and legacy-warning behavior are covered.

Exact parameter reference ​

Next, test one normal Tiptap wrapper and one disposable legacy wrapper. Do not save the legacy case until the overwrite behavior is acceptable.