mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-16 00:03:29 +00:00
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:
@@ -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 +1,2 @@
|
||||
export * from "./debounce";
|
||||
export * from "./on";
|
||||
|
||||
Reference in New Issue
Block a user