mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
28 lines
937 B
JavaScript
28 lines
937 B
JavaScript
|
|
||
|
import {keymap, highlightSpecialChars, drawSelection, highlightActiveLine, dropCursor,
|
||
|
rectangularSelection, lineNumbers, highlightActiveLineGutter} from "@codemirror/view"
|
||
|
import {defaultHighlightStyle, syntaxHighlighting, bracketMatching,
|
||
|
foldKeymap} from "@codemirror/language"
|
||
|
import {defaultKeymap, history, historyKeymap} from "@codemirror/commands"
|
||
|
import {EditorState} from "@codemirror/state"
|
||
|
|
||
|
export function viewer() {
|
||
|
return [
|
||
|
lineNumbers(),
|
||
|
highlightActiveLineGutter(),
|
||
|
highlightSpecialChars(),
|
||
|
history(),
|
||
|
drawSelection(),
|
||
|
dropCursor(),
|
||
|
syntaxHighlighting(defaultHighlightStyle, {fallback: true}),
|
||
|
bracketMatching(),
|
||
|
rectangularSelection(),
|
||
|
highlightActiveLine(),
|
||
|
keymap.of([
|
||
|
...defaultKeymap,
|
||
|
...historyKeymap,
|
||
|
...foldKeymap,
|
||
|
]),
|
||
|
EditorState.readOnly.of(true),
|
||
|
];
|
||
|
}
|