codemirror option for text widgets & danbooru tag autocomplete

This commit is contained in:
space-nuko
2023-05-24 11:47:08 -05:00
parent 6bbd18a261
commit 18c63c9f2e
15 changed files with 100697 additions and 25 deletions

View File

@@ -3,8 +3,9 @@ import { LGraphCanvas, LiteGraph, Subgraph } from '@litegraph-ts/core';
import layoutStates from './stores/layoutStates';
import { get } from 'svelte/store';
import workflowState from './stores/workflowState';
import DanbooruTags from './DanbooruTags';
export function configureLitegraph(isMobile: boolean = false) {
function configureLitegraph(isMobile: boolean = false) {
LiteGraph.catch_exceptions = false;
// Must be enabled, otherwise subgraphs won't work (because of non-unique node/link IDs)
@@ -26,10 +27,18 @@ export function configureLitegraph(isMobile: boolean = false) {
}
Subgraph.default_lgraph_factory = () => new ComfyGraph;
(window as any).LiteGraph = LiteGraph;
(window as any).LGraphCanvas = LGraphCanvas;
(window as any).layoutStates = layoutStates;
(window as any).workflowState = workflowState;
(window as any).svelteGet = get;
}
function configureGlobals() {
const win = window as any
win.LiteGraph = LiteGraph;
win.LGraphCanvas = LGraphCanvas;
win.layoutStates = layoutStates;
win.workflowState = workflowState;
win.svelteGet = get;
}
export default async function init(isMobile: boolean = false) {
configureLitegraph(isMobile);
configureGlobals();
}