fix: replace non-standard removeWidgetByName with manual removal logic

This commit is contained in:
Suzu008
2026-03-24 22:01:45 +08:00
parent 8a335dbaee
commit ca0e42e767
7 changed files with 25 additions and 18 deletions
+1
View File
@@ -114,3 +114,4 @@ yarn-error.log*
node.zip
.vscode/
.claude/
.*/
+7 -7
View File
@@ -204,14 +204,14 @@ app.registerExtension({
name: "cryptio.Settings",
settings: [
{
id: "cryptio.category",
id: "cryptio.category" as any,
name: "CryptIO Settings",
type: "hidden",
defaultValue: "",
category: ["CryptIO🔒"]
},
{
id: "cryptio.download_client_keys",
id: "cryptio.download_client_keys" as any,
name: "Download Client Keys",
type: "boolean",
defaultValue: false,
@@ -228,7 +228,7 @@ app.registerExtension({
}
},
{
id: "cryptio.upload_client_keys",
id: "cryptio.upload_client_keys" as any,
name: "Upload Client Keys",
type: "boolean",
category: ["CryptIO🔒", "Client Keys", "Upload"],
@@ -248,7 +248,7 @@ app.registerExtension({
}
},
{
id: "cryptio.download_server_keys",
id: "cryptio.download_server_keys" as any,
name: "Download Server Keys",
type: "boolean",
defaultValue: false,
@@ -265,7 +265,7 @@ app.registerExtension({
}
},
{
id: "cryptio.upload_server_keys",
id: "cryptio.upload_server_keys" as any,
name: "Upload Server Keys",
type: "boolean",
defaultValue: false,
@@ -284,7 +284,7 @@ app.registerExtension({
}
},
{
id: "cryptio.generate_new_keys",
id: "cryptio.generate_new_keys" as any,
name: "Generate New Client Keys",
type: "boolean",
defaultValue: false,
@@ -301,7 +301,7 @@ app.registerExtension({
}
},
{
id: "cryptio.clear_all_keys",
id: "cryptio.clear_all_keys" as any,
name: "Clear All Keys",
type: "boolean",
defaultValue: false,
+5 -2
View File
@@ -38,8 +38,11 @@ app.registerExtension({
nodeType.prototype.onNodeCreated = function (this: CryptIONode) {
const r = onNodeCreated?.apply(this, arguments);
// 移除默认的upload widget
this.removeWidgetByName("upload")
// Remove default upload widget
const uploadWidgetIndex = this.widgets.findIndex(w => w.name === "upload");
if (uploadWidgetIndex !== -1) {
this.removeWidget(this.widgets[uploadWidgetIndex]);
}
// 添加上传button widget
const uploadWidget = this.addWidget(
"button",
+4 -1
View File
@@ -86,7 +86,10 @@ app.registerExtension({
const r = onNodeCreated?.apply(this, arguments);
// Remove default upload widget
this.removeWidgetByName("upload");
const uploadWidgetIndex = this.widgets.findIndex(w => w.name === "upload");
if (uploadWidgetIndex !== -1) {
this.removeWidget(this.widgets[uploadWidgetIndex]);
}
// Add upload button widget
const uploadWidget = this.addWidget(
+1 -1
View File
@@ -14,7 +14,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@comfyorg/comfyui-frontend-types": "^1.29.0",
"@comfyorg/comfyui-frontend-types": "^1.43.3",
"typescript": "^5.9.3"
}
}
+7 -6
View File
@@ -7,10 +7,11 @@ settings:
importers:
.:
devDependencies:
dependencies:
'@comfyorg/comfyui-frontend-types':
specifier: ^1.29.0
version: 1.29.0(vue@3.5.22(typescript@5.9.3))(zod@3.25.76)
specifier: ^1.43.3
version: 1.43.3(vue@3.5.22(typescript@5.9.3))(zod@3.25.76)
devDependencies:
typescript:
specifier: ^5.9.3
version: 5.9.3
@@ -34,8 +35,8 @@ packages:
resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==}
engines: {node: '>=6.9.0'}
'@comfyorg/comfyui-frontend-types@1.29.0':
resolution: {integrity: sha512-Gf56EsxLQWe6u24WdqG4WRET4FRVLMhApJj98YmuEGxCMpWuHOqn4meFcpV5t7XoonXf07YFs7dWzVPlkkufRA==}
'@comfyorg/comfyui-frontend-types@1.43.3':
resolution: {integrity: sha512-wgtWJqntN1fKbVssdiIMNGNx4qfPCvOBVG74Dgx2aLZrrqeJ3ZsXLFSqmeFJTSH+whKWx7z+MX6la5Hr4BL+pg==}
peerDependencies:
vue: ^3.5.13
zod: ^3.23.8
@@ -132,7 +133,7 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1
'@comfyorg/comfyui-frontend-types@1.29.0(vue@3.5.22(typescript@5.9.3))(zod@3.25.76)':
'@comfyorg/comfyui-frontend-types@1.43.3(vue@3.5.22(typescript@5.9.3))(zod@3.25.76)':
dependencies:
vue: 3.5.22(typescript@5.9.3)
zod: 3.25.76
-1
View File
@@ -21,7 +21,6 @@ export interface CryptIONode {
// Methods
addDOMWidget: (name: string, type: string, element: HTMLElement, options?: any) => any;
removeWidget: (widget: any) => void;
removeWidgetByName: (name: string) => void;
addWidget: (type: string, name: string, value: any, callback?: any, options?: any) => any;
// Lifecycle hooks