@dodona/papyros
Version:
Scratchpad for multiple programming languages in the browser.
48 lines • 2.35 kB
JavaScript
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 { css, html } from "lit";
import "../code_mirror/CodeEditor";
import { customElement } from "lit/decorators.js";
import { PapyrosElement } from "../PapyrosElement";
let Code = class Code extends PapyrosElement {
static get styles() {
return css `
:host {
width: 100%;
height: 100%;
}
`;
}
render() {
return html `
<p-code-editor
.testLineCount=${this.papyros.test.testLineCount}
.programmingLanguage=${this.papyros.runner.programmingLanguage}
.debug=${this.papyros.debugger.active}
.debugLine=${this.papyros.debugger.debugLine}
.value=${this.papyros.runner.effectiveCode}
.lintingSource=${this.papyros.runner.lintSource.bind(this.papyros.runner)}
.indentLength=${this.papyros.constants.indentationSize}
.translations=${this.papyros.i18n.getTranslations("CodeMirror")}
.theme=${this.papyros.constants.CodeMirrorTheme}
.placeholder=${this.t("Papyros.code_placeholder", {
programmingLanguage: this.papyros.runner.programmingLanguage,
})}
.testLines=${this.papyros.test.testLines}
.testTranslations=${this.papyros.i18n.getTranslations("Papyros.editor.test_code")}
@edit-test-code=${() => this.papyros.test.editTestCode()}
@remove-test-code=${() => (this.papyros.test.testCode = undefined)}
@change=${(e) => (this.papyros.runner.effectiveCode = e.detail)}
></p-code-editor>
`;
}
};
Code = __decorate([
customElement("p-code")
], Code);
export { Code };
//# sourceMappingURL=Code.js.map