@rslsp1/fa-app-tools 1.3.8 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -18
- package/dist/index.mjs +24 -18
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -479,6 +479,6 @@ declare function hfLoadMetadata(token: string): Promise<any[]>;
|
|
|
479
479
|
declare function hfUploadImage(base64: string, id: string, token: string, mimeType?: string): Promise<void>;
|
|
480
480
|
declare function hfLoadImageAsBase64(id: string, token: string): Promise<string | null>;
|
|
481
481
|
|
|
482
|
-
declare const LIB_VERSION = "1.3.
|
|
482
|
+
declare const LIB_VERSION = "1.3.9";
|
|
483
483
|
|
|
484
484
|
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, type HFMetadataEntry, HistoryPanel, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type WorkspaceTags, autoLabel, buildBlendInstruction, buildCompareInstruction, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, getHFToken, groupGenerationsToLabItems, hfDeleteProject, hfDownloadProject, hfListProjects, hfLoadImageAsBase64, hfLoadMetadata, hfLoadTags, hfSaveMetadata, hfSaveTags, hfUploadImage, hfUploadProjectForm, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, setHFToken, useKeyboardNavigation, useOnClickOutside };
|
package/dist/index.d.ts
CHANGED
|
@@ -479,6 +479,6 @@ declare function hfLoadMetadata(token: string): Promise<any[]>;
|
|
|
479
479
|
declare function hfUploadImage(base64: string, id: string, token: string, mimeType?: string): Promise<void>;
|
|
480
480
|
declare function hfLoadImageAsBase64(id: string, token: string): Promise<string | null>;
|
|
481
481
|
|
|
482
|
-
declare const LIB_VERSION = "1.3.
|
|
482
|
+
declare const LIB_VERSION = "1.3.9";
|
|
483
483
|
|
|
484
484
|
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, type HFMetadataEntry, HistoryPanel, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type WorkspaceTags, autoLabel, buildBlendInstruction, buildCompareInstruction, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, getHFToken, groupGenerationsToLabItems, hfDeleteProject, hfDownloadProject, hfListProjects, hfLoadImageAsBase64, hfLoadMetadata, hfLoadTags, hfSaveMetadata, hfSaveTags, hfUploadImage, hfUploadProjectForm, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, setHFToken, useKeyboardNavigation, useOnClickOutside };
|
package/dist/index.js
CHANGED
|
@@ -4024,13 +4024,15 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4024
4024
|
(0, import_react21.useEffect)(() => {
|
|
4025
4025
|
if (activeTab === "setup" || activeTab === "sync") fetchServerProjects();
|
|
4026
4026
|
}, [activeTab]);
|
|
4027
|
-
(0, import_react21.
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4027
|
+
const [isHfRefreshing, setIsHfRefreshing] = (0, import_react21.useState)(false);
|
|
4028
|
+
const loadFromHF = (0, import_react21.useCallback)(async (token) => {
|
|
4029
|
+
setIsHfRefreshing(true);
|
|
4030
|
+
try {
|
|
4031
|
+
hfLoadTags(token).then((tags) => {
|
|
4032
|
+
if (tags?.by_category) setWorkspaceTags(tags);
|
|
4033
|
+
}).catch(() => {
|
|
4034
|
+
});
|
|
4035
|
+
const entries = await hfLoadMetadata(token);
|
|
4034
4036
|
if (!Array.isArray(entries) || entries.length === 0) return;
|
|
4035
4037
|
setHfMetadata(entries);
|
|
4036
4038
|
const skeletons = entries.map((e) => ({
|
|
@@ -4047,20 +4049,20 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4047
4049
|
setHistory(skeletons);
|
|
4048
4050
|
if (skeletons.length > 0) setCurrentResult(skeletons[0]);
|
|
4049
4051
|
for (const entry of entries) {
|
|
4050
|
-
hfLoadImageAsBase64(entry.id,
|
|
4052
|
+
hfLoadImageAsBase64(entry.id, token).then((b64) => {
|
|
4051
4053
|
if (!b64) return;
|
|
4052
4054
|
const prefix = `data:${entry.mimeType || "image/jpeg"};base64,`;
|
|
4053
|
-
setGalleryItems((prev) => prev.map(
|
|
4054
|
-
|
|
4055
|
-
));
|
|
4056
|
-
setHistory((prev) => prev.map(
|
|
4057
|
-
(g) => g.id === entry.id ? { ...g, base64: prefix + b64 } : g
|
|
4058
|
-
));
|
|
4055
|
+
setGalleryItems((prev) => prev.map((g) => g.id === entry.id ? { ...g, base64: prefix + b64 } : g));
|
|
4056
|
+
setHistory((prev) => prev.map((g) => g.id === entry.id ? { ...g, base64: prefix + b64 } : g));
|
|
4059
4057
|
}).catch(() => {
|
|
4060
4058
|
});
|
|
4061
4059
|
}
|
|
4062
|
-
}
|
|
4063
|
-
|
|
4060
|
+
} finally {
|
|
4061
|
+
setIsHfRefreshing(false);
|
|
4062
|
+
}
|
|
4063
|
+
}, []);
|
|
4064
|
+
(0, import_react21.useEffect)(() => {
|
|
4065
|
+
if (hfToken) loadFromHF(hfToken);
|
|
4064
4066
|
}, [hfToken]);
|
|
4065
4067
|
(0, import_react21.useEffect)(() => {
|
|
4066
4068
|
if (!hfToken || !workspaceTags) return;
|
|
@@ -4411,7 +4413,10 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4411
4413
|
] })
|
|
4412
4414
|
] }),
|
|
4413
4415
|
mobileTab === "browse" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col flex-1 min-h-0", children: [
|
|
4414
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.
|
|
4416
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex border-b border-white/5 shrink-0", style: { height: 52 }, children: [
|
|
4417
|
+
["history", "gallery", "inspect"].map((tab) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: () => setActiveTab(tab), className: `flex-1 flex items-center justify-center gap-1.5 transition-colors text-[11px] font-bold uppercase tracking-wide ${activeTab === tab ? "text-white border-b-2 border-white" : "text-white/30"}`, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined text-[20px]", children: tab === "history" ? "history" : tab === "gallery" ? "photo_library" : "info" }) }, tab)),
|
|
4418
|
+
hfToken && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: () => loadFromHF(hfToken), disabled: isHfRefreshing, className: "w-12 flex items-center justify-center text-white/20 active:text-white transition-colors disabled:opacity-30", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: `material-symbols-outlined text-[20px]${isHfRefreshing ? " animate-spin" : ""}`, children: "sync" }) })
|
|
4419
|
+
] }),
|
|
4415
4420
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 overflow-hidden relative", children: [
|
|
4416
4421
|
activeTab === "history" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(HistoryPanel, { history, currentResultId: currentResult?.id || null, onSelect: (g) => {
|
|
4417
4422
|
setCurrentResult(g);
|
|
@@ -4800,6 +4805,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4800
4805
|
setActiveTab(tab);
|
|
4801
4806
|
setIsRightCollapsed(false);
|
|
4802
4807
|
}, className: `flex-1 flex items-center justify-center relative transition-colors ${activeTab === tab ? "text-white" : "text-white/20"}`, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined text-[20px]", children: tab === "history" ? "history" : tab === "gallery" ? "photo_library" : tab === "inspect" ? "info" : tab === "setup" ? "settings" : tab === "sync" ? "cloud_sync" : "label" }) }, tab)) }),
|
|
4808
|
+
hfToken && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: () => loadFromHF(hfToken), disabled: isHfRefreshing, className: "w-10 flex items-center justify-center text-white/20 hover:text-white/60 transition-colors disabled:opacity-30", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: `material-symbols-outlined text-[18px]${isHfRefreshing ? " animate-spin" : ""}`, children: "sync" }) }),
|
|
4803
4809
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { onClick: () => setIsRightCollapsed(!isRightCollapsed), className: "w-10 flex items-center justify-center text-white/20 hover:text-white", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined text-[18px]", children: isRightCollapsed ? "chevron_left" : "chevron_right" }) })
|
|
4804
4810
|
] }),
|
|
4805
4811
|
!isRightCollapsed && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 overflow-hidden relative", children: [
|
|
@@ -4865,7 +4871,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4865
4871
|
|
|
4866
4872
|
// src/index.ts
|
|
4867
4873
|
init_hfStateService();
|
|
4868
|
-
var LIB_VERSION = "1.3.
|
|
4874
|
+
var LIB_VERSION = "1.3.9";
|
|
4869
4875
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4870
4876
|
0 && (module.exports = {
|
|
4871
4877
|
AvatarArchitectApp,
|
package/dist/index.mjs
CHANGED
|
@@ -3467,13 +3467,15 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
3467
3467
|
useEffect5(() => {
|
|
3468
3468
|
if (activeTab === "setup" || activeTab === "sync") fetchServerProjects();
|
|
3469
3469
|
}, [activeTab]);
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3470
|
+
const [isHfRefreshing, setIsHfRefreshing] = useState14(false);
|
|
3471
|
+
const loadFromHF = useCallback(async (token) => {
|
|
3472
|
+
setIsHfRefreshing(true);
|
|
3473
|
+
try {
|
|
3474
|
+
hfLoadTags(token).then((tags) => {
|
|
3475
|
+
if (tags?.by_category) setWorkspaceTags(tags);
|
|
3476
|
+
}).catch(() => {
|
|
3477
|
+
});
|
|
3478
|
+
const entries = await hfLoadMetadata(token);
|
|
3477
3479
|
if (!Array.isArray(entries) || entries.length === 0) return;
|
|
3478
3480
|
setHfMetadata(entries);
|
|
3479
3481
|
const skeletons = entries.map((e) => ({
|
|
@@ -3490,20 +3492,20 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
3490
3492
|
setHistory(skeletons);
|
|
3491
3493
|
if (skeletons.length > 0) setCurrentResult(skeletons[0]);
|
|
3492
3494
|
for (const entry of entries) {
|
|
3493
|
-
hfLoadImageAsBase64(entry.id,
|
|
3495
|
+
hfLoadImageAsBase64(entry.id, token).then((b64) => {
|
|
3494
3496
|
if (!b64) return;
|
|
3495
3497
|
const prefix = `data:${entry.mimeType || "image/jpeg"};base64,`;
|
|
3496
|
-
setGalleryItems((prev) => prev.map(
|
|
3497
|
-
|
|
3498
|
-
));
|
|
3499
|
-
setHistory((prev) => prev.map(
|
|
3500
|
-
(g) => g.id === entry.id ? { ...g, base64: prefix + b64 } : g
|
|
3501
|
-
));
|
|
3498
|
+
setGalleryItems((prev) => prev.map((g) => g.id === entry.id ? { ...g, base64: prefix + b64 } : g));
|
|
3499
|
+
setHistory((prev) => prev.map((g) => g.id === entry.id ? { ...g, base64: prefix + b64 } : g));
|
|
3502
3500
|
}).catch(() => {
|
|
3503
3501
|
});
|
|
3504
3502
|
}
|
|
3505
|
-
}
|
|
3506
|
-
|
|
3503
|
+
} finally {
|
|
3504
|
+
setIsHfRefreshing(false);
|
|
3505
|
+
}
|
|
3506
|
+
}, []);
|
|
3507
|
+
useEffect5(() => {
|
|
3508
|
+
if (hfToken) loadFromHF(hfToken);
|
|
3507
3509
|
}, [hfToken]);
|
|
3508
3510
|
useEffect5(() => {
|
|
3509
3511
|
if (!hfToken || !workspaceTags) return;
|
|
@@ -3854,7 +3856,10 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
3854
3856
|
] })
|
|
3855
3857
|
] }),
|
|
3856
3858
|
mobileTab === "browse" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col flex-1 min-h-0", children: [
|
|
3857
|
-
/* @__PURE__ */
|
|
3859
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex border-b border-white/5 shrink-0", style: { height: 52 }, children: [
|
|
3860
|
+
["history", "gallery", "inspect"].map((tab) => /* @__PURE__ */ jsx20("button", { onClick: () => setActiveTab(tab), className: `flex-1 flex items-center justify-center gap-1.5 transition-colors text-[11px] font-bold uppercase tracking-wide ${activeTab === tab ? "text-white border-b-2 border-white" : "text-white/30"}`, children: /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined text-[20px]", children: tab === "history" ? "history" : tab === "gallery" ? "photo_library" : "info" }) }, tab)),
|
|
3861
|
+
hfToken && /* @__PURE__ */ jsx20("button", { onClick: () => loadFromHF(hfToken), disabled: isHfRefreshing, className: "w-12 flex items-center justify-center text-white/20 active:text-white transition-colors disabled:opacity-30", children: /* @__PURE__ */ jsx20("span", { className: `material-symbols-outlined text-[20px]${isHfRefreshing ? " animate-spin" : ""}`, children: "sync" }) })
|
|
3862
|
+
] }),
|
|
3858
3863
|
/* @__PURE__ */ jsxs18("div", { className: "flex-1 overflow-hidden relative", children: [
|
|
3859
3864
|
activeTab === "history" && /* @__PURE__ */ jsx20(HistoryPanel, { history, currentResultId: currentResult?.id || null, onSelect: (g) => {
|
|
3860
3865
|
setCurrentResult(g);
|
|
@@ -4243,6 +4248,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4243
4248
|
setActiveTab(tab);
|
|
4244
4249
|
setIsRightCollapsed(false);
|
|
4245
4250
|
}, className: `flex-1 flex items-center justify-center relative transition-colors ${activeTab === tab ? "text-white" : "text-white/20"}`, children: /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined text-[20px]", children: tab === "history" ? "history" : tab === "gallery" ? "photo_library" : tab === "inspect" ? "info" : tab === "setup" ? "settings" : tab === "sync" ? "cloud_sync" : "label" }) }, tab)) }),
|
|
4251
|
+
hfToken && /* @__PURE__ */ jsx20("button", { onClick: () => loadFromHF(hfToken), disabled: isHfRefreshing, className: "w-10 flex items-center justify-center text-white/20 hover:text-white/60 transition-colors disabled:opacity-30", children: /* @__PURE__ */ jsx20("span", { className: `material-symbols-outlined text-[18px]${isHfRefreshing ? " animate-spin" : ""}`, children: "sync" }) }),
|
|
4246
4252
|
/* @__PURE__ */ jsx20("button", { onClick: () => setIsRightCollapsed(!isRightCollapsed), className: "w-10 flex items-center justify-center text-white/20 hover:text-white", children: /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined text-[18px]", children: isRightCollapsed ? "chevron_left" : "chevron_right" }) })
|
|
4247
4253
|
] }),
|
|
4248
4254
|
!isRightCollapsed && /* @__PURE__ */ jsxs18("div", { className: "flex-1 overflow-hidden relative", children: [
|
|
@@ -4307,7 +4313,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4307
4313
|
}
|
|
4308
4314
|
|
|
4309
4315
|
// src/index.ts
|
|
4310
|
-
var LIB_VERSION = "1.3.
|
|
4316
|
+
var LIB_VERSION = "1.3.9";
|
|
4311
4317
|
export {
|
|
4312
4318
|
AvatarArchitectApp,
|
|
4313
4319
|
CollapsibleCard,
|