MCPcopy Create free account
hub / github.com/csskit/csskit / connectedCallback

Method connectedCallback

website/script/index.js:232–253  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230 ];
231
232 async connectedCallback() {
233 let doc =
234 await (codeFromUrl.has()
235 ? codeFromUrl.get()
236 : codeFromLocal.has()
237 ? codeFromLocal.get()
238 : this.textContent);
239 this.view = new EditorView({
240 extensions: this.extensions,
241 parent: this.shadowRoot,
242 root: this.shadowRoot,
243 doc,
244 });
245 requestAnimationFrame(() =>
246 this.dispatchEvent(new EditorChangeEvent(this.code))
247 );
248 this.ownerDocument.addEventListener("diagnostic", this);
249 this.ownerDocument.addEventListener("viewer-highlight", this);
250 this.ownerDocument.addEventListener("load-code", this);
251 this.addEventListener("focusout", this);
252 this.addEventListener("focusin", this);
253 }
254
255 handleEvent(event) {
256 if (event.type == "diagnostic") {

Callers

nothing calls this directly

Calls 2

hasMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected