A controlled CodeMirror 6 editor for DPL boxes (the prompt, the negative prompt, the wrapper
Start/End). It behaves like a <textarea> — value + onChange(next) so the parent owns
state — but adds DPL syntax highlighting and a brace-aware autocomplete dropdown of every
list / generator token. Line wrapping is on; height is driven by CSS (.dpl-editor).
The catalog is read lazily per-completion (so browser-local custom blocks show up without a
remount), and edits made while the parent re-renders don't echo back into the document (the
latest value is tracked in a ref and compared before re-dispatching).
- Description:
A controlled CodeMirror 6 editor for DPL boxes (the prompt, the negative prompt, the wrapper Start/End). It behaves like a
<textarea>—value+onChange(next)so the parent owns state — but adds DPL syntax highlighting and a brace-aware autocomplete dropdown of every list / generator token. Line wrapping is on; height is driven by CSS (.dpl-editor).The catalog is read lazily per-completion (so browser-local custom blocks show up without a remount), and edits made while the parent re-renders don't echo back into the document (the latest
valueis tracked in a ref and compared before re-dispatching).
- Source:
Methods
(inner) DplEditor(props) → {JSX.Element}
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object |
Properties
|
||||||||||||||||||||||||||||
|
Returns:
- Type
- JSX.Element