mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-21 23:09:39 +00:00
build
This commit is contained in:
@@ -41,7 +41,7 @@ var LiteGraph = global.LiteGraph = {
|
||||
DEFAULT_POSITION: [100,100],//default node position
|
||||
node_images_path: "",
|
||||
|
||||
VALID_SHAPES: ["box","round","circle"],
|
||||
VALID_SHAPES: ["box","round"], //,"circle"
|
||||
|
||||
BOX_SHAPE: 1,
|
||||
ROUND_SHAPE: 2,
|
||||
|
||||
4
build/litegraph.min.js
vendored
4
build/litegraph.min.js
vendored
@@ -2,8 +2,8 @@
|
||||
this));b.event&&b.event.constructor!==MouseEvent&&b.event.constructor!==CustomEvent&&(console.error("Event passed to ContextMenu is not of type MouseEvent or CustomEvent. Ignoring it."),b.event=null);var k=document.createElement("div");k.className="litegraph litecontextmenu litemenubar-panel";k.style.minWidth=100;k.style.minHeight=100;k.style.pointerEvents="none";setTimeout(function(){k.style.pointerEvents="auto"},100);k.addEventListener("mouseup",function(a){a.preventDefault();return!0},!0);k.addEventListener("contextmenu",
|
||||
function(a){if(2!=a.button)return!1;a.preventDefault();return!1},!0);k.addEventListener("mousedown",function(a){if(2==a.button)return e.close(),a.preventDefault(),!0},!0);this.root=k;if(b.title){var c=document.createElement("div");c.className="litemenu-title";c.innerHTML=b.title;k.appendChild(c)}var c=0,d;for(d in a){var f=a.constructor==Array?a[d]:d;null!=f&&f.constructor!==String&&(f=void 0===f.content?String(f):f.content);this.addItem(f,a[d],b);c++}k.addEventListener("mouseleave",function(a){e.lock||
|
||||
e.close(a)});d=document;b.event&&(d=b.event.target.ownerDocument);d||(d=document);d.body.appendChild(k);c=b.left||0;d=b.top||0;if(b.event){c=b.event.pageX-10;d=b.event.pageY-10;b.title&&(d-=20);b.parentMenu&&(c=b.parentMenu.root.getBoundingClientRect(),c=c.left+c.width);var f=document.body.getBoundingClientRect(),h=k.getBoundingClientRect();c>f.width-h.width-10&&(c=f.width-h.width-10);d>f.height-h.height-10&&(d=f.height-h.height-10)}k.style.left=c+"px";k.style.top=d+"px"}var h=d.LiteGraph={NODE_TITLE_HEIGHT:16,
|
||||
NODE_SLOT_HEIGHT:15,NODE_WIDTH:140,NODE_MIN_WIDTH:50,NODE_COLLAPSED_RADIUS:10,NODE_COLLAPSED_WIDTH:80,CANVAS_GRID_SIZE:10,NODE_TITLE_COLOR:"#222",NODE_DEFAULT_COLOR:"#999",NODE_DEFAULT_BGCOLOR:"#444",NODE_DEFAULT_BOXCOLOR:"#AEF",NODE_DEFAULT_SHAPE:"box",MAX_NUMBER_OF_NODES:1E3,DEFAULT_POSITION:[100,100],node_images_path:"",VALID_SHAPES:["box","round","circle"],BOX_SHAPE:1,ROUND_SHAPE:2,CIRCLE_SHAPE:3,INPUT:1,OUTPUT:2,EVENT:-1,ACTION:-1,ALWAYS:0,ON_EVENT:1,NEVER:2,ON_TRIGGER:3,proxy:null,debug:!1,
|
||||
throw_errors:!0,allow_scripts:!0,registered_node_types:{},node_types_by_file_extension:{},Nodes:{},registerNodeType:function(a,b){if(!b.prototype)throw"Cannot register a simple object, it must be a class with a prototype";b.type=a;h.debug&&console.log("Node registered: "+a);a.split("/");var e=b.constructor.name,k=a.lastIndexOf("/");b.category=a.substr(0,k);b.title||(b.title=e);if(b.prototype)for(var c in LGraphNode.prototype)b.prototype[c]||(b.prototype[c]=LGraphNode.prototype[c]);Object.defineProperty(b.prototype,
|
||||
NODE_SLOT_HEIGHT:15,NODE_WIDTH:140,NODE_MIN_WIDTH:50,NODE_COLLAPSED_RADIUS:10,NODE_COLLAPSED_WIDTH:80,CANVAS_GRID_SIZE:10,NODE_TITLE_COLOR:"#222",NODE_DEFAULT_COLOR:"#999",NODE_DEFAULT_BGCOLOR:"#444",NODE_DEFAULT_BOXCOLOR:"#AEF",NODE_DEFAULT_SHAPE:"box",MAX_NUMBER_OF_NODES:1E3,DEFAULT_POSITION:[100,100],node_images_path:"",VALID_SHAPES:["box","round"],BOX_SHAPE:1,ROUND_SHAPE:2,CIRCLE_SHAPE:3,INPUT:1,OUTPUT:2,EVENT:-1,ACTION:-1,ALWAYS:0,ON_EVENT:1,NEVER:2,ON_TRIGGER:3,proxy:null,debug:!1,throw_errors:!0,
|
||||
allow_scripts:!0,registered_node_types:{},node_types_by_file_extension:{},Nodes:{},registerNodeType:function(a,b){if(!b.prototype)throw"Cannot register a simple object, it must be a class with a prototype";b.type=a;h.debug&&console.log("Node registered: "+a);a.split("/");var e=b.constructor.name,k=a.lastIndexOf("/");b.category=a.substr(0,k);b.title||(b.title=e);if(b.prototype)for(var c in LGraphNode.prototype)b.prototype[c]||(b.prototype[c]=LGraphNode.prototype[c]);Object.defineProperty(b.prototype,
|
||||
"shape",{set:function(a){switch(a){case "box":this._shape=h.BOX_SHAPE;break;case "round":this._shape=h.ROUND_SHAPE;break;case "circle":this._shape=h.CIRCLE_SHAPE;break;default:this._shape=a}},get:function(a){return this._shape},enumerable:!0});this.registered_node_types[a]=b;b.constructor.name&&(this.Nodes[e]=b);b.prototype.onPropertyChange&&console.warn("LiteGraph node class "+a+" has onPropertyChange method, it must be called onPropertyChanged with d at the end");if(b.supported_extensions)for(c in b.supported_extensions)this.node_types_by_file_extension[b.supported_extensions[c].toLowerCase()]=
|
||||
b},addNodeMethod:function(a,b){LGraphNode.prototype[a]=b;for(var e in this.registered_node_types){var k=this.registered_node_types[e];k.prototype[a]&&(k.prototype["_"+a]=k.prototype[a]);k.prototype[a]=b}},createNode:function(a,b,e){var k=this.registered_node_types[a];if(!k)return h.debug&&console.log('GraphNode type "'+a+'" not registered.'),null;b=b||k.title||a;k=new k(name);k.type=a;k.title||(k.title=b);k.properties||(k.properties={});k.properties_info||(k.properties_info=[]);k.flags||(k.flags=
|
||||
{});k.size||(k.size=k.computeSize());k.pos||(k.pos=h.DEFAULT_POSITION.concat());k.mode||(k.mode=h.ALWAYS);if(e)for(var c in e)k[c]=e[c];return k},getNodeType:function(a){return this.registered_node_types[a]},getNodeTypesInCategory:function(a){var b=[],e;for(e in this.registered_node_types)""==a?null==this.registered_node_types[e].category&&b.push(this.registered_node_types[e]):this.registered_node_types[e].category==a&&b.push(this.registered_node_types[e]);return b},getNodeTypesCategories:function(){var a=
|
||||
|
||||
Reference in New Issue
Block a user