Editor
シンタックスカラー、行番号、インデント、両軸スクロールに対応した保持型ネイティブコードエディターです。
既定では言語文法を含みません。Rust はリンク済み文法を登録でき、Go / TypeScript は LoadLanguagePack / loadLanguagePack で選択した Tree-sitter Wasm 文法とクエリをまとめた単一の移植可能なパックを読み込めます。
既定では見た目のスタイルを持ちません。文字と行番号の色は継承され、背景、枠線、角丸、余白、構文・差分の配色は追加されません。外観はアプリ側で明示的に指定します。
#インポート
bun add @quickgui/extension-editorimport { createSignal } from "solid-js";
import { Editor, loadLanguagePack } from "@quickgui/extension-editor";// quickgui.config.ts
extensions: ["@quickgui/extension-editor"]#使い方
const [source, setSource] = createSignal("export function answer() { return 42; }\n");
<Editor
value={source()}
language="typescript"
lineNumbers
tabSize={2}
onInput={(event) => setSource(event.value ?? "")}
style={{ width: "100%", height: 360 }}
/>;#シンタックスハイライト
language は同梱の Tree-sitter 文法とハイライトクエリを選択します。クエリのキャプチャは syntaxTheme を通して 8 種類の前景色だけの描画クラスへ変換されるため、色はテキスト寸法を変えません。ソースまたは言語が変わると上限付きドキュメントを再解析し、配色変更では保持済みキャプチャだけを再マッピングします。スクロール時に構文処理は行いません。解析は最大 2 MiB、32 KiB を超える単一行は通常色のまま、キャプチャ数にも上限があり、言語サーバーは不要です。
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Editor
ソースを見るEditor(props: EditorProps): NativeNodeaccessibilityLabelstring—
Declares accessibilityLabel (optional). Reactive JSX expressions update this property in place.
stringソースを見るstyleStyleProp—
disabledboolean—
invalidboolean—
selectedboolean—
groupboolean | string—
Makes this element the group its descendants' `groupHover` and `groupActive` styles follow, like Tailwind's `group`: `true` opens an unnamed group, and a string names it so a descendant can follow it past a nearer group with `groupHover: { group: "name" }`.
boolean | stringソースを見るrolestring—
tabIndexnumber—
focusOnPointerboolean—
overlayboolean—
focusTrapboolean—
restorePreviousFocusboolean—
autoFocusboolean—
aria-modalboolean—
ariaModalboolean—
dismissOnEscapeboolean—
Declares dismissOnEscape (optional). Reactive JSX expressions update this property in place.
booleanソースを見るdismissOnPointerOutsideboolean—
Declares dismissOnPointerOutside (optional). Reactive JSX expressions update this property in place.
booleanソースを見るtooltipstring—
tooltipPlacementPopoverPlacement—
Declares tooltipPlacement (optional). Reactive JSX expressions update this property in place.
PopoverPlacementソースを見るtooltipDelaynumber—
tooltipGapnumber—
tooltipViewportMarginnumber—
Declares tooltipViewportMargin (optional). Reactive JSX expressions update this property in place.
numberソースを見るhitSlopnumber | string—
Declares hitSlop (optional). Reactive JSX expressions update this property in place.
number | stringソースを見るhitSlopTopnumber | string—
Declares hitSlopTop (optional). Reactive JSX expressions update this property in place.
number | stringソースを見るhitSlopRightnumber | string—
Declares hitSlopRight (optional). Reactive JSX expressions update this property in place.
number | stringソースを見るhitSlopBottomnumber | string—
Declares hitSlopBottom (optional). Reactive JSX expressions update this property in place.
number | stringソースを見るhitSlopLeftnumber | string—
Declares hitSlopLeft (optional). Reactive JSX expressions update this property in place.
number | stringソースを見るaria-labelstring—
ariaLabelstring—
ref((node: NativeNode) => void) | NativeNode—
Declares ref (optional). Reactive JSX expressions update this property in place.
((node: NativeNode) => void) | NativeNodeソースを見るonClickEventHandler—
Declares onClick (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonMouseEnterEventHandler—
Declares onMouseEnter (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonMouseLeaveEventHandler—
Declares onMouseLeave (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonPointerEnterEventHandler—
Declares onPointerEnter (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonPointerLeaveEventHandler—
Declares onPointerLeave (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonPointerEventHandler—
Captured pointer stream from press through release/cancel, including outside the element.
EventHandlerソースを見るonInputEventHandler—
Declares onInput (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonChangeEventHandler—
Declares onChange (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonSubmitEventHandler—
Declares onSubmit (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonDismissEventHandler—
Declares onDismiss (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonKeyDownEventHandler—
onKeyUpEventHandler—
Declares onKeyUp (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonMouseDownEventHandler—
Declares onMouseDown (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonMouseUpEventHandler—
Declares onMouseUp (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonMouseMoveEventHandler—
Declares onMouseMove (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonDoubleClickEventHandler—
onWheelEventHandler—
Declares onWheel (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonContextMenuEventHandler—
onPinchEventHandler—
Declares onPinch (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonRotateEventHandler—
Declares onRotate (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonSmartMagnifyEventHandler—
Declares onSmartMagnify (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonPressureEventHandler—
Declares onPressure (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonFocusEventHandler—
Declares onFocus (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonBlurEventHandler—
Declares onBlur (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るkeymapKeymap—
onActionEventHandler—
draggableboolean | DragSource—
onDragStartEventHandler—
Declares onDragStart (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonDragEndEventHandler—
Declares onDragEnd (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るdropKindsDropKind | readonly DropKind[]—
Payload kinds this element accepts, declared ahead of the native drag.
DropKind | readonly DropKind[]ソースを見るonDropEventHandler—
Declares onDrop (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るonFilesDroppedEventHandler—
Declares onFilesDropped (optional). Reactive JSX expressions update this property in place.
EventHandlerソースを見るvaluestring—
languageEditorLanguage—
Declares language (optional). Reactive JSX expressions update this property in place.
EditorLanguageソースを見るlineNumbersboolean—
Declares lineNumbers (optional). Reactive JSX expressions update this property in place.
booleanソースを見るtabSizenumber—
insertSpacesboolean—
Declares insertSpaces (optional). Reactive JSX expressions update this property in place.
booleanソースを見るautoIndentboolean—
Declares autoIndent (optional). Reactive JSX expressions update this property in place.
booleanソースを見るreadOnlyboolean—
contentPaddingContentPadding—
Declares contentPadding (optional). Reactive JSX expressions update this property in place.
ContentPaddingソースを見るgutterPaddingGutterPadding—
Declares gutterPadding (optional). Reactive JSX expressions update this property in place.
GutterPaddingソースを見るgutterBackgroundColorValue—
Declares gutterBackground (optional). Reactive JSX expressions update this property in place.
ColorValueソースを見るgutterColorColorValue—
Declares gutterColor (optional). Reactive JSX expressions update this property in place.
ColorValueソースを見るactiveLineBackgroundColorValue—
Declares activeLineBackground (optional). Reactive JSX expressions update this property in place.
ColorValueソースを見るactiveLineNumberColorColorValue—
Declares activeLineNumberColor (optional). Reactive JSX expressions update this property in place.
ColorValueソースを見るsyntaxThemeSyntaxTheme—
Declares syntaxTheme (optional). Reactive JSX expressions update this property in place.
SyntaxThemeソースを見る