fix: migrate deprecated legacy API imports to comfyAPI (#10)

This commit is contained in:
Dariusz L
2026-11-11 05:01:34 +01:00
parent 8266a04238
commit b3d12d2c47
5 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { app } from "../../../../../scripts/app.js";
import { $el } from "../../../../../scripts/ui.js";
const { $el } = window.comfyAPI.ui;
import { getSvgIcon } from "../../utils/icon_utils.js";
import { startSplitterDrag } from "../utils/splitter_drag.js";
import { syncElementAttributes } from "../utils/dom_patch_utils.js";
+4 -4
View File
@@ -1,6 +1,6 @@
import { app } from "../../../../scripts/app.js";
import { api } from "../../../../scripts/api.js";
import { $el } from "../../../../scripts/ui.js";
const { $el } = window.comfyAPI.ui;
import { createModuleLogger } from "../log_system/log_funcs.js";
import { logger as frontendLogger } from "../log_system/logger.js";
import { loadStylesWhenNeeded } from "../utils/css_loader.js";
@@ -1252,9 +1252,9 @@ export class ModelResolver {
async registerTopbarButton() {
// Try to use new ComfyUI button system (like ComfyUI Manager does)
try {
// Dynamic imports for ComfyUI's button components
const { ComfyButtonGroup } = await import("../../../../scripts/ui/components/buttonGroup.js");
const { ComfyButton } = await import("../../../../scripts/ui/components/button.js");
// Access ComfyUI's button components from comfyAPI
const { ComfyButtonGroup } = window.comfyAPI.buttonGroup;
const { ComfyButton } = window.comfyAPI.button;
// Create button group with Model Resolver button
const ModelResolverButton = new ComfyButton({
+1 -1
View File
@@ -1,4 +1,4 @@
import { $el, ComfyDialog } from "../../../../scripts/ui.js";
const { $el, ComfyDialog } = window.comfyAPI.ui;
import { api } from "../../../../scripts/api.js";
import { safeStorage } from "./utils/html_utils.js";
import { showNotification as showNotificationUtils } from "../utils/notification_utils.js";
+1 -1
View File
@@ -1,5 +1,5 @@
import { app } from "../../../../../scripts/app.js";
import { $el } from "../../../../../scripts/ui.js";
const { $el } = window.comfyAPI.ui;
import { getSvgIcon } from "../../utils/icon_utils.js";
import { isSidebarButtonActive } from "../utils/dom_patch_utils.js";
import { safeStorage } from "../utils/html_utils.js";
+2 -2
View File
@@ -1,5 +1,5 @@
// @ts-ignore
import { $el } from "../../../scripts/ui.js";
const { $el } = window.comfyAPI.ui;
import { createModuleLogger } from "../log_system/log_funcs.js";
import { withErrorHandling, createValidationError, createNetworkError } from "./error_handler.js";
const log = createModuleLogger('resource_manager');