@sudobility/writing_ui
v0.1.5
Published
React web editor components for Fadewright: ScriptEditor (speed view, controlled contenteditable) and ElementStylePicker over a writing_core document
Readme
@sudobility/writing_ui
React editor components for Fadewright screenplays: a ScriptEditor that renders a @sudobility/writing_core document as template-styled lines (speed view, not paginated) and edits it through core commands, plus an ElementStylePicker.
Status: local packages only, not published. Depends on ../writing_core by path.
Usage
import { ScriptEditor, ElementStylePicker, type ScriptEditorHost } from '@sudobility/writing_ui';
function Editor({ host }: { host: ScriptEditorHost }) {
return (
<>
<ElementStylePicker host={host} />
<ScriptEditor host={host} />
</>
);
}ScriptEditorHost (src/host.ts) matches a screenwriter_lib document session: model, execute, undo/redo, subscribe, remoteCursors, setLocalCursor.
API
ScriptEditorprops:host,readOnly?,className?,placeholder?.ElementStylePickerprops:host,className?,disabled?.useEditorSelection(host)— the editor's current selection.
Development
bun installbun run demo— local demo (no server) at http://localhost:5183bun run typecheck,bun run test:unit
Courier Prime is bundled under the SIL Open Font License (assets/fonts/OFL.txt).
License
BUSL-1.1
