mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 17:40:09 +00:00
[Refactor] Move type extensions out of LG (SoC) (#2303)
Co-authored-by: huchenlei <huchenlei@proton.me>
This commit is contained in:
8
package-lock.json
generated
8
package-lock.json
generated
@@ -11,7 +11,7 @@
|
||||
"dependencies": {
|
||||
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
|
||||
"@comfyorg/comfyui-electron-types": "^0.4.11",
|
||||
"@comfyorg/litegraph": "^0.8.60",
|
||||
"@comfyorg/litegraph": "^0.8.61",
|
||||
"@primevue/themes": "^4.0.5",
|
||||
"@sentry/vue": "^8.48.0",
|
||||
"@tiptap/core": "^2.10.4",
|
||||
@@ -1942,9 +1942,9 @@
|
||||
"license": "GPL-3.0-only"
|
||||
},
|
||||
"node_modules/@comfyorg/litegraph": {
|
||||
"version": "0.8.60",
|
||||
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.8.60.tgz",
|
||||
"integrity": "sha512-LkZalBcka1xVxkL7JnkF/1EzyvspLyrSthzyN9ZumWJw7kAaZkO9omraXv2t/UiFsqwMr5M/AV5UY915Vq8cxQ==",
|
||||
"version": "0.8.61",
|
||||
"resolved": "https://registry.npmjs.org/@comfyorg/litegraph/-/litegraph-0.8.61.tgz",
|
||||
"integrity": "sha512-7DroJ0PLgI9TFvQR//6rf0NRXRvV60hapxVX5lmKzNn4Mn2Ni/JsB2ypNLKeSU5sacNyu8QT3W5Jdpafl7lcnA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
"dependencies": {
|
||||
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
|
||||
"@comfyorg/comfyui-electron-types": "^0.4.11",
|
||||
"@comfyorg/litegraph": "^0.8.60",
|
||||
"@comfyorg/litegraph": "^0.8.61",
|
||||
"@primevue/themes": "^4.0.5",
|
||||
"@sentry/vue": "^8.48.0",
|
||||
"@tiptap/core": "^2.10.4",
|
||||
|
||||
@@ -272,7 +272,7 @@ LGraphCanvas.prototype.computeVisibleNodes = function (): LGraphNode[] {
|
||||
w.element.hidden = actualHidden
|
||||
w.element.style.display = actualHidden ? 'none' : null
|
||||
if (actualHidden && !wasHidden) {
|
||||
w.options.onHide?.(w)
|
||||
w.options.onHide?.(w as DOMWidget<HTMLElement, object>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +367,6 @@ export const useLitegraphService = () => {
|
||||
const w = node.widgets[node.widgets.length - 1]
|
||||
shiftY = w.last_y
|
||||
if (w.computeSize) {
|
||||
// @ts-expect-error requires 1 param
|
||||
shiftY += w.computeSize()[1] + 4
|
||||
// @ts-expect-error computedHeight only exists for DOMWidget
|
||||
} else if (w.computedHeight) {
|
||||
|
||||
14
src/types/litegraph-augmentation.d.ts
vendored
14
src/types/litegraph-augmentation.d.ts
vendored
@@ -1,10 +1,24 @@
|
||||
import '@comfyorg/litegraph'
|
||||
import type { LLink } from '@comfyorg/litegraph'
|
||||
|
||||
import type { DOMWidget } from '@/scripts/domWidget'
|
||||
import type { ComfyNodeDef } from '@/types/apiTypes'
|
||||
|
||||
import type { NodeId } from './comfyWorkflow'
|
||||
|
||||
/** ComfyUI extensions of litegraph */
|
||||
declare module '@comfyorg/litegraph/dist/types/widgets' {
|
||||
interface IWidgetOptions {
|
||||
/** Currently used by DOM widgets only. Declaring here reduces complexity. */
|
||||
onHide?: (widget: DOMWidget) => void
|
||||
}
|
||||
|
||||
interface IBaseWidget {
|
||||
onRemove?: () => void
|
||||
beforeQueued?: () => unknown
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ComfyUI extensions of litegraph
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user