gui/components/PromptComposer

The reusable prompt-box composer — the DPL prompt field plus all its bells and whistles: the DPL insert toolbar, the Prompt/Negative switch (when the provider supports negatives), the editor with its corner cluster (live DPL status, clear, live preview, and a prompt-settings gear), and the action bar (prompts-per-run, inline image controls, auto-fix, keyword-translate, wrapper, share, random, and generate). It also carries a rotating random suggestion and an inline share panel.

It is deliberately provider- and view-agnostic: it reads/writes only settings and calls back an onGenerate(text) supplied by the parent. That lets it serve BOTH the Home composer (which turns a generate into a prompt list + image batches) and a compact copy atop the Gallery (which streams live placeholders into the grid) with no duplicated UI. The parent's building-block palette reaches the active editor through the imperative insert(token) handle exposed on the ref.

Description:
  • The reusable prompt-box composer — the DPL prompt field plus all its bells and whistles: the DPL insert toolbar, the Prompt/Negative switch (when the provider supports negatives), the editor with its corner cluster (live DPL status, clear, live preview, and a prompt-settings gear), and the action bar (prompts-per-run, inline image controls, auto-fix, keyword-translate, wrapper, share, random, and generate). It also carries a rotating random suggestion and an inline share panel.

    It is deliberately provider- and view-agnostic: it reads/writes only settings and calls back an onGenerate(text) supplied by the parent. That lets it serve BOTH the Home composer (which turns a generate into a prompt list + image batches) and a compact copy atop the Gallery (which streams live placeholders into the grid) with no duplicated UI. The parent's building-block palette reaches the active editor through the imperative insert(token) handle exposed on the ref.

Source:

Methods

(inner) PromptComposer(props) → {JSX.Element}

Description:
  • The reusable prompt-box composer.

Source:
Parameters:
Name Type Description
props object
Properties
Name Type Attributes Description
settings object

The current settings.

setSettings function

Update the settings.

onGenerate function

(text) => Promise|void — run a generation for the effective prompt text (the typed prompt, or the current random suggestion when the box is empty).

compact boolean <optional>

Render the narrower variant (used atop the Gallery).

Returns:
Type
JSX.Element