@fastyoke/lcap-codeeditor
v0.1.0
Published
Code editor peer package for the FastYoke SDK's <SmartField /> resolver. Lazy-loaded when an annotation row's @ui/component = 'code'.
Maintainers
Readme
@fastyoke/lcap-codeeditor
Code editor peer package for the FastYoke SDK's
<SmartField /> resolver.
When this package loads
<SmartField /> lazy-imports this package when an annotation
row carries:
{ "field_type": "longtext", "ui_config_json": { "@ui/component": "code" } }If the package isn't installed, <SmartField /> falls back to
a plain <TextArea /> with a one-time console.warn. Storage
shape is identical (raw string), so swapping is non-destructive.
Install
npm install @fastyoke/lcap-codeeditorPeer-deps @fastyoke/sdk@^0.3.0, react@^18, react-dom@^18.
Public API
import { CodeEditor } from '@fastyoke/lcap-codeeditor';You typically don't import this directly; <SmartField />
mounts it for you. Honors @ui/code_language as a
data-language attribute the host can layer highlighting on.
Implementation status
v0.1.0 (current) — styled <textarea> with monospace
font, padded gutter for line numbers, and Tab-key soft-tab
capture (so Tab inserts indentation instead of moving focus).
Spell-check / autocorrect / autocapitalize are disabled.
v0.2.0 (planned) — CodeMirror 6 integration
(@codemirror/state + @codemirror/view + per-language
lazy chunks indexed by @ui/code_language). Drop-in
replacement; the catalog contract stays identical so
<SmartField /> consumers don't need changes.
License
MIT.
