Refactor, cleanup

This commit is contained in:
Zef Hemel
2025-06-12 20:30:01 +02:00
parent b942ebabad
commit 8d3dc4cc4e
120 changed files with 1139 additions and 1101 deletions
+6 -6
View File
@@ -13,7 +13,7 @@ import {
moveCursorIntoText,
} from "./widget_util.ts";
import { expandMarkdown } from "../markdown.ts";
import { LuaStackFrame, LuaTable } from "../space_lua/runtime.ts";
import { LuaStackFrame, LuaTable } from "../../lib/space_lua/runtime.ts";
import { isBlockMarkdown, jsonToMDTable } from "../markdown_util.ts";
import { activeWidgets } from "./code_widget.ts";
@@ -55,6 +55,11 @@ export class LuaWidget extends WidgetType {
super();
}
override get estimatedHeight(): number {
const cacheItem = this.client.getWidgetCache(this.cacheKey);
return cacheItem ? cacheItem.height : -1;
}
toDOM(): HTMLElement {
const wrapperSpan = document.createElement("span");
wrapperSpan.className = "sb-lua-wrapper";
@@ -260,11 +265,6 @@ export class LuaWidget extends WidgetType {
return container;
}
override get estimatedHeight(): number {
const cacheItem = this.client.getWidgetCache(this.cacheKey);
return cacheItem ? cacheItem.height : -1;
}
override eq(other: WidgetType): boolean {
return (
other instanceof LuaWidget &&