SourceEditor.svelte

A basic source editor: fuz_code's CodeTextarea, a textarea highlighted as lang, plus the editors' save shortcut and focus handling. The primitive richer editing builds on — stats, clear / restore, and paste stay ContentEditor's.

view source

Declarations
#

SourceEditor
#

SourceEditor.svelte view source

import SourceEditor from '@fuzdev/zzz/SourceEditor.svelte';

value

The source text.

type string
bindable

lang?

The fuz_code language to highlight as — a language registered on syntax_styler_global, like lang_for_path returns; null disables highlighting.

type string | null
optional default null

readonly?

type boolean
optional default false

placeholder?

type string | null
optional

focus_key?

Focuses the textarea when pending_element_to_focus_key equals it, then clears that.

type string | number | null
optional

pending_element_to_focus_key?

type string | number | null
optional bindable

onsave?

Called with the value on Ctrl+S / Cmd+S — see save_shortcut.

type (value: string) => void
optional
snippet parameters
value string

save_shortcut?

Where Ctrl+S / Cmd+S triggers onsave — see SaveShortcutScope.

optional default 'focused'

attrs?

Attributes for the <textarea>.

type HTMLTextareaAttributes
optional

wrapper_attrs?

Attributes for CodeTextarea's wrapper <div>, the box the textarea fills.

type HTMLAttributes<HTMLDivElement>
optional

Depends on
#

Imported by
#