From e85e7bc8fa657c10e7d34b1e3065e8f8f546468c Mon Sep 17 00:00:00 2001 From: BennyKok Date: Wed, 27 Sep 2023 16:41:47 +0800 Subject: [PATCH] refactor! renam ui components --- js/{AvatarViewer.js => AvatarPreview.js} | 2 +- js/Container.js | 12 ++++++------ js/{ImageEditor.js => LayerEditor.js} | 2 +- js/{AvatarEditor.js => ShapeFlowEditor.js} | 2 +- js/SideBar.js | 2 +- js/index.js | 12 ++++++------ 6 files changed, 16 insertions(+), 16 deletions(-) rename js/{AvatarViewer.js => AvatarPreview.js} (95%) rename js/{ImageEditor.js => LayerEditor.js} (99%) rename js/{AvatarEditor.js => ShapeFlowEditor.js} (96%) diff --git a/js/AvatarViewer.js b/js/AvatarPreview.js similarity index 95% rename from js/AvatarViewer.js rename to js/AvatarPreview.js index b628db2..c70a53b 100644 --- a/js/AvatarViewer.js +++ b/js/AvatarPreview.js @@ -2,7 +2,7 @@ import { van } from "./van.js"; import { showEditor } from "./state.js"; const { button, iframe, div, img } = van.tags; -export function AvatarViewer() { +export function AvatarPreview() { return div( { class: () => diff --git a/js/Container.js b/js/Container.js index 044b2c7..8aa2c0e 100644 --- a/js/Container.js +++ b/js/Container.js @@ -1,7 +1,7 @@ -import { ImageEditor } from './ImageEditor.js'; -import { AvatarEditor } from './AvatarEditor.js'; +import { LayerEditor } from './LayerEditor.js'; +import { ShapeFlowEditor } from './ShapeFlowEditor.js'; import { van } from './van.js'; -import { AvatarViewer } from './AvatarViewer.js'; +import { AvatarPreview } from './AvatarPreview.js'; import { Loading } from './Loading.js'; import { Alert } from './Alert.js'; const { button, iframe, div, img } = van.tags; @@ -12,9 +12,9 @@ export function Container() { class: 'fixed left-0 top-0 w-full h-full z-[200] pointer-events-none', id: 'avatech-editor', }, - AvatarEditor(), - ImageEditor(), - AvatarViewer(), + ShapeFlowEditor(), + LayerEditor(), + AvatarPreview(), Loading(), Alert(), ); diff --git a/js/ImageEditor.js b/js/LayerEditor.js similarity index 99% rename from js/ImageEditor.js rename to js/LayerEditor.js index 993bcd4..ad232c6 100644 --- a/js/ImageEditor.js +++ b/js/LayerEditor.js @@ -101,7 +101,7 @@ export function drawSegment(clicks) { initModel(); -export function ImageEditor() { +export function LayerEditor() { let realTimeSegment = true; document.addEventListener("keydown", (e) => { if (showImageEditor.val && e.code === "Tab") { diff --git a/js/AvatarEditor.js b/js/ShapeFlowEditor.js similarity index 96% rename from js/AvatarEditor.js rename to js/ShapeFlowEditor.js index 630e1cf..cddfee2 100644 --- a/js/AvatarEditor.js +++ b/js/ShapeFlowEditor.js @@ -2,7 +2,7 @@ import { iframeSrc, showEditor } from "./state.js"; import { van } from "./van.js"; const { button, iframe, div, img, span } = van.tags; -export function AvatarEditor() { +export function ShapeFlowEditor() { return div( { class: "w-full h-full relative", diff --git a/js/SideBar.js b/js/SideBar.js index 44830b8..e3b710e 100644 --- a/js/SideBar.js +++ b/js/SideBar.js @@ -1,4 +1,4 @@ -import { drawSegment, getClicks, updateImagePrompts } from "./ImageEditor.js"; +import { drawSegment, getClicks, updateImagePrompts } from "./LayerEditor.js"; import { imagePrompts, selectedLayer, diff --git a/js/index.js b/js/index.js index 6f51b94..16e7105 100644 --- a/js/index.js +++ b/js/index.js @@ -19,7 +19,7 @@ import { api } from "./api.js"; import { Container } from "./Container.js"; import { loadNpyTensor } from "./onnx.js"; import "https://code.iconify.design/3/3.1.0/iconify.min.js"; -import { drawSegment, getClicks } from "./ImageEditor.js"; +import { drawSegment, getClicks } from "./LayerEditor.js"; /** @type {import( '../../../web/types/litegraph.js').LGraphGroup} */ const recomputeInsideNodesOps = LGraphGroup.prototype.recomputeInsideNodes; @@ -336,11 +336,11 @@ const ext = { BLENDSHAPES_CONFIG(node, inputName, inputData, app) { const btn = node.addWidget("button", "Edit Shape Flow", "", () => { targetNode.val = node; - openInAvatechEditor( - "https://editor.avatech.ai?comfyui=true", - fileName.val - ); - // openInAvatechEditor("http://localhost:3006?comfyui=true", fileName.val); + // openInAvatechEditor( + // "https://editor.avatech.ai?comfyui=true", + // fileName.val + // ); + openInAvatechEditor("http://localhost:3006?comfyui=true", fileName.val); }); btn.serialize = false;