Image Generator Demo: UI/UX (#58)

This PR updates the UI/UX of the Image Generator Demo.

* Hierarchy moved to the left of the editor view instead of overlaying
  it
* Hierarchy can now be resized
* Bevy canvas resizes trigger a screen-capture update
* Transform Toolbar now centered over the editor view instead of the
  entire viewport
* Added Prompt and Seed text fields, with a refresh button for the Seed
This commit is contained in:
Danny McGee
2024-02-28 03:17:45 -05:00
committed by GitHub
parent 343919a9f5
commit d6c5d5d5bd
5 changed files with 268 additions and 65 deletions
+21
View File
@@ -0,0 +1,21 @@
import { type Fn } from "@storyteller/utility";
import { LitElement } from "lit";
import { debounce as _debounce, type DebounceSettings } from "lodash";
import { getMethodDescriptor } from "./internal";
export function debounce(wait: number, options?: DebounceSettings) {
return <T extends LitElement>(proto: T, propName: keyof T, desc: PropertyDescriptor) => {
const method = (desc?.value as Fn<any[], any>)
?? getMethodDescriptor(proto, propName)?.value
?? (() => {});
const updated: PropertyDescriptor = {
value: _debounce(method, wait, options),
}
Object.defineProperty(proto, propName, updated);
return updated;
}
}
+1
View File
@@ -1 +1,2 @@
export * from "./debounce";
export * from "./on";