mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
@@ -5,7 +5,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "tsc && vite build",
|
||||||
"test": "cd tests-ui && npm run test",
|
"test": "cd tests-ui && npm run test",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -193,7 +193,9 @@ function computeSize(size: [number, number]): void {
|
|||||||
|
|
||||||
// Override the compute visible nodes function to allow us to hide/show DOM elements when the node goes offscreen
|
// Override the compute visible nodes function to allow us to hide/show DOM elements when the node goes offscreen
|
||||||
const elementWidgets = new Set();
|
const elementWidgets = new Set();
|
||||||
|
//@ts-ignore
|
||||||
const computeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
|
const computeVisibleNodes = LGraphCanvas.prototype.computeVisibleNodes;
|
||||||
|
//@ts-ignore
|
||||||
LGraphCanvas.prototype.computeVisibleNodes = function (): LGraphNode[] {
|
LGraphCanvas.prototype.computeVisibleNodes = function (): LGraphNode[] {
|
||||||
const visibleNodes = computeVisibleNodes.apply(this, arguments);
|
const visibleNodes = computeVisibleNodes.apply(this, arguments);
|
||||||
for (const node of app.graph._nodes) {
|
for (const node of app.graph._nodes) {
|
||||||
@@ -228,6 +230,7 @@ export function addDomClippingSetting(): void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
LGraphNode.prototype.addDOMWidget = function (
|
LGraphNode.prototype.addDOMWidget = function (
|
||||||
name: string,
|
name: string,
|
||||||
type: string,
|
type: string,
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ export function addValueControlWidgets(node, targetWidget, defaultValue = "rando
|
|||||||
break;
|
break;
|
||||||
case "randomize":
|
case "randomize":
|
||||||
current_index = Math.floor(Math.random() * current_length);
|
current_index = Math.floor(Math.random() * current_length);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -173,6 +174,7 @@ export function addValueControlWidgets(node, targetWidget, defaultValue = "rando
|
|||||||
break;
|
break;
|
||||||
case "randomize":
|
case "randomize":
|
||||||
targetWidget.value = Math.floor(Math.random() * range) * (targetWidget.options.step / 10) + min;
|
targetWidget.value = Math.floor(Math.random() * range) * (targetWidget.options.step / 10) + min;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"downlevelIteration": true,
|
||||||
|
|
||||||
/* AllowJs during migration phase */
|
/* AllowJs during migration phase */
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
@@ -21,7 +22,9 @@
|
|||||||
"paths": {
|
"paths": {
|
||||||
"*": ["src/*"],
|
"*": ["src/*"],
|
||||||
},
|
},
|
||||||
"typeRoots": ["src/types", "node_modules/@types"]
|
"typeRoots": ["src/types", "node_modules/@types"],
|
||||||
|
"outDir": "./dist",
|
||||||
|
"rootDir": "./src",
|
||||||
},
|
},
|
||||||
"include": ["src/**/*", "src/types/**/*.d.ts"],
|
"include": ["src/**/*", "src/types/**/*.d.ts"],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user