UNPKG

@dodona/papyros

Version:

Scratchpad for multiple programming languages in the browser.

48 lines 2.09 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { customElement } from "lit/decorators.js"; import { CodeMirrorEditor } from "./CodeMirrorEditor"; import { drawSelection, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, lineNumbers, } from "@codemirror/view"; import { defaultKeymap, history, historyKeymap } from "@codemirror/commands"; import { bracketMatching, foldGutter, indentOnInput } from "@codemirror/language"; import { EditorState } from "@codemirror/state"; import { highlightSelectionMatches } from "@codemirror/search"; import { css } from "lit"; let FileEditor = class FileEditor extends CodeMirrorEditor { static get styles() { return css ` :host { width: 100%; height: 100%; } `; } constructor() { super(); this.configure({ fileExtensions: [ lineNumbers(), highlightSpecialChars(), history(), foldGutter(), drawSelection(), EditorState.allowMultipleSelections.of(true), indentOnInput(), bracketMatching(), highlightSelectionMatches(), highlightActiveLineGutter(), highlightActiveLine(), keymap.of([...defaultKeymap, ...historyKeymap]), ], }); } }; FileEditor = __decorate([ customElement("p-file-editor") ], FileEditor); export { FileEditor }; //# sourceMappingURL=FileEditor.js.map