-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path268.e2a184bf.css.map
1 lines (1 loc) · 2.37 KB
/
268.e2a184bf.css.map
1
{"version":3,"file":"268.e2a184bf.css","mappings":"AAkFA,QACA,cACA,YACA,gBACA,iBACA,CACA,uBAEA,gBADA,kBACA,aACA","sources":["webpack:///../components/repl/components/editor.marko"],"sourcesContent":["import { load, setModelMarkers, createEditor, createModel } from \"../../../utils/monaco\"\n\nstatic export const loading = load();\n\nclass {\n onMount() {\n const editorEl = this.getEl(\"editor\");\n this.editor = createEditor(editorEl);\n this.resizeObserver = new ResizeObserver(entries => {\n this.editor.layout();\n });\n this.resizeObserver.observe(editorEl);\n this.sync();\n }\n\n onUpdate() {\n this.sync();\n }\n\n onDestroy() {\n this.editor.dispose();\n this.resizeObserver.disconnect();\n }\n\n sync() {\n const { filename } = this.input;\n const language = filename.substring(filename.indexOf(\".\")+1);\n\n if (this.prevLanguage !== language) {\n if (this.model) {\n this.model.dispose();\n }\n\n this.model = createModel(this.input.value, language);\n this.editor.setModel(this.model);\n this.editor.layout();\n this.model.onDidChangeContent(() => {\n const value = this.model.getValue();\n if (value !== this.input.value) {\n this.input.valueChange(value);\n this.isUpdating = true;\n }\n\n if (this.hasErrorMarkers) {\n setModelMarkers(this.model, null, []);\n this.hasErrorMarkers = false;\n }\n });\n } else if (!this.isUpdating) {\n this.model.setValue(this.input.value);\n } else {\n this.isUpdating = false;\n }\n\n this.prevLanguage = language;\n this.prevFilename = filename;\n }\n\n focus(lineNumber, column) {\n this.editor.focus();\n this.editor.setPosition({\n lineNumber,\n column\n });\n }\n\n showError({ line, column, message }) {\n this.hasErrorMarkers = true;\n setModelMarkers(this.model, null, [\n {\n startLineNumber: line,\n startColumn: column,\n endLineNumber: line,\n endColumn: column,\n message,\n severity: 8\n }\n ]);\n }\n}\n\nstyle {\n .editor {\n display: block;\n height: 100%;\n padding-top: 8px;\n position:relative;\n }\n .editor .monaco-editor {\n position:absolute;\n top:0; bottom:0; right:0; left:0;\n }\n}\n\n<div.editor key=\"editor\" no-update/>\n"],"names":[],"sourceRoot":""}