Configure vite to copy from src to dist (#2)

* nit

* move

* direct copy lib dir

* nit

* disable treeshake
This commit is contained in:
Chenlei Hu
2024-06-13 23:09:10 -04:00
committed by GitHub
parent c77b5b3f78
commit 3fbb75ce76
57 changed files with 297 additions and 36 deletions

32
src/scripts/ui/dialog.js Normal file
View File

@@ -0,0 +1,32 @@
import { $el } from "../ui.js";
export class ComfyDialog {
constructor() {
this.element = $el("div.comfy-modal", { parent: document.body }, [
$el("div.comfy-modal-content", [$el("p", { $: (p) => (this.textElement = p) }), ...this.createButtons()]),
]);
}
createButtons() {
return [
$el("button", {
type: "button",
textContent: "Close",
onclick: () => this.close(),
}),
];
}
close() {
this.element.style.display = "none";
}
show(html) {
if (typeof html === "string") {
this.textElement.innerHTML = html;
} else {
this.textElement.replaceChildren(html);
}
this.element.style.display = "flex";
}
}