mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
2 lines
No EOL
1.1 KiB
JavaScript
2 lines
No EOL
1.1 KiB
JavaScript
"use strict";(self.webpackChunkmy_application=self.webpackChunkmy_application||[]).push([[8819],{8819:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});const o='customElements.define(\n\t"code-view-monaco",\n\tclass CodeViewMonaco extends HTMLElement {\n\t\t_monacoEditor;\n\t\t/** @type HTMLElement */\n\t\t_editor;\n\n\t\tconstructor() {\n\t\t\tsuper();\n\n\t\t\tconst shadowRoot = this.attachShadow({ mode: "open" });\n\n\t\t\t// Copy over editor styles\n\t\t\tconst styles = document.querySelectorAll(\n\t\t\t\t"link[rel=\'stylesheet\'][data-name^=\'vs/\']"\n\t\t\t);\n\t\t\tfor (const style of styles) {\n\t\t\t\tshadowRoot.appendChild(style.cloneNode(true));\n\t\t\t}\n\n\t\t\tconst template = /** @type HTMLTemplateElement */ (\n\t\t\t\tdocument.getElementById("editor-template")\n\t\t\t);\n\t\t\tshadowRoot.appendChild(template.content.cloneNode(true));\n\n\t\t\tthis._editor = shadowRoot.querySelector("#container");\n\t\t\tthis._monacoEditor = monaco.editor.create(this._editor, {\n\t\t\t\tautomaticLayout: true,\n\t\t\t\tlanguage: "html",\n\n\t\t\t\tvalue: `<div>Hello World</div>`,\n\t\t\t});\n\t\t}\n\t}\n);\n'}}]);
|
|
//# sourceMappingURL=8819.js.map
|