@rslsp1/fa-app-tools 2.0.18 → 2.0.19
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +81 -17
- package/dist/index.mjs +81 -17
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -584,6 +584,7 @@ interface HFStateResult {
|
|
|
584
584
|
pendingBufferCount: number;
|
|
585
585
|
eventCount: number;
|
|
586
586
|
localOnlyCount: number;
|
|
587
|
+
confirmedEventKeys: Set<string>;
|
|
587
588
|
forks: Array<{
|
|
588
589
|
parentTs: number;
|
|
589
590
|
childTs: number[];
|
|
@@ -613,6 +614,6 @@ declare function findTips(dag: Dag): number[];
|
|
|
613
614
|
declare function findForks(dag: Dag): DagFork[];
|
|
614
615
|
declare function topoSort(events: HFEvent[]): HFEvent[];
|
|
615
616
|
|
|
616
|
-
declare const LIB_VERSION = "2.0.
|
|
617
|
+
declare const LIB_VERSION = "2.0.19";
|
|
617
618
|
|
|
618
619
|
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type DagFork, type ExtractedCharacter, FaApp, type FaAppProps, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, type HFEvent, type HFEventVersion, type HFFileInfo$1 as HFFileInfo, type HFMetadataEntry, type HFStateMeta, type HFStateResult, type HFStateSnapshot, HistoryPanel, type ImageAddedPayload, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, type MetadataUpdatedPayload, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type TagUpsertedPayload, type WorkspaceTags, applyEvent, applyEvents, autoLabel, buildBlendInstruction, buildCompareInstruction, buildDag, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, findForks, findTips, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, getHFToken, getSessionClientId, groupGenerationsToLabItems, hfBatchArchive, hfBootstrapFromLegacy, hfDeleteProject, hfDownloadProject, hfListDir, hfListProjects, hfLoadImageAsBase64, hfUploadImage, hfUploadProjectForm, hfUploadSmallFile, importProjectFromZip, injectXMPMetadata, interpretSdkError, loadHFState, loadPendingEvents, parsePromptFile, parsePromptResponse, setHFToken, topoSort, tsFromEventPath, useHFState, useKeyboardNavigation, useOnClickOutside, writeHFEvent };
|
package/dist/index.d.ts
CHANGED
|
@@ -584,6 +584,7 @@ interface HFStateResult {
|
|
|
584
584
|
pendingBufferCount: number;
|
|
585
585
|
eventCount: number;
|
|
586
586
|
localOnlyCount: number;
|
|
587
|
+
confirmedEventKeys: Set<string>;
|
|
587
588
|
forks: Array<{
|
|
588
589
|
parentTs: number;
|
|
589
590
|
childTs: number[];
|
|
@@ -613,6 +614,6 @@ declare function findTips(dag: Dag): number[];
|
|
|
613
614
|
declare function findForks(dag: Dag): DagFork[];
|
|
614
615
|
declare function topoSort(events: HFEvent[]): HFEvent[];
|
|
615
616
|
|
|
616
|
-
declare const LIB_VERSION = "2.0.
|
|
617
|
+
declare const LIB_VERSION = "2.0.19";
|
|
617
618
|
|
|
618
619
|
export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type DagFork, type ExtractedCharacter, FaApp, type FaAppProps, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, type HFEvent, type HFEventVersion, type HFFileInfo$1 as HFFileInfo, type HFMetadataEntry, type HFStateMeta, type HFStateResult, type HFStateSnapshot, HistoryPanel, type ImageAddedPayload, InspectPanel, LIB_VERSION, LabBlend, LabCompare, type LabFrame, LabImagePicker, type LabItem, LabLoop, LabRemix, type LabServices, LabsTab, ListView, type MediaItem, MediaLibrary, type MetadataUpdatedPayload, PillButton, type ProjectMeta, type ProjectSettings, ProjectSyncTab, PromptTab, SectionLabel, type SelectedLabImage, type SelectedTag, SetupPanel, type SyncDiff, TagManagerPanel, type TagOption, type TagUpsertedPayload, type WorkspaceTags, applyEvent, applyEvents, autoLabel, buildBlendInstruction, buildCompareInstruction, buildDag, buildFallbackPrompt, buildGenerationPrompt, buildImageGenerationOptions, buildLoopInstruction, buildPromptTabPayload, buildReferenceImageMediaIds, buildRemixInstruction, buildScanInstruction, cleanAiResponse, createFlowServices, exportProjectToZip, findForks, findTips, formatTreeToMarkdown, frameToGeneration, getFormattedTimestamp, getHFToken, getSessionClientId, groupGenerationsToLabItems, hfBatchArchive, hfBootstrapFromLegacy, hfDeleteProject, hfDownloadProject, hfListDir, hfListProjects, hfLoadImageAsBase64, hfUploadImage, hfUploadProjectForm, hfUploadSmallFile, importProjectFromZip, injectXMPMetadata, interpretSdkError, loadHFState, loadPendingEvents, parsePromptFile, parsePromptResponse, setHFToken, topoSort, tsFromEventPath, useHFState, useKeyboardNavigation, useOnClickOutside, writeHFEvent };
|
package/dist/index.js
CHANGED
|
@@ -2738,6 +2738,7 @@ function useHFState(token, namespace) {
|
|
|
2738
2738
|
error,
|
|
2739
2739
|
pendingBufferCount,
|
|
2740
2740
|
localOnlyCount,
|
|
2741
|
+
confirmedEventKeys: knownEventPaths.current,
|
|
2741
2742
|
eventCount,
|
|
2742
2743
|
forks,
|
|
2743
2744
|
writeEvent,
|
|
@@ -4126,33 +4127,74 @@ var EVENT_TYPE_COLORS = {
|
|
|
4126
4127
|
metadata_updated: "#34d399",
|
|
4127
4128
|
probe: "#fbbf24"
|
|
4128
4129
|
};
|
|
4129
|
-
function EventMonitor({ events }) {
|
|
4130
|
+
function EventMonitor({ events, confirmedEventKeys, galleryItems, imageUploadStatus }) {
|
|
4130
4131
|
if (!events.length) {
|
|
4131
4132
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { padding: "12px 14px", fontSize: 12, color: "rgba(255,255,255,0.3)", fontStyle: "italic" }, children: "Noch keine Events geladen." });
|
|
4132
4133
|
}
|
|
4133
4134
|
const sorted = [...events].sort((a, b) => b.ts - a.ts).slice(0, 30);
|
|
4134
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { padding: "8px
|
|
4135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { padding: "6px 8px 4px" }, children: [
|
|
4135
4136
|
sorted.map((e, i) => {
|
|
4136
|
-
const
|
|
4137
|
+
const eKey = `${e.ts}_${e.clientId}`;
|
|
4138
|
+
const isConfirmed = confirmedEventKeys.has(eKey);
|
|
4139
|
+
const typeColor = EVENT_TYPE_COLORS[e.type] || "rgba(255,255,255,0.5)";
|
|
4137
4140
|
const date = new Date(e.ts);
|
|
4138
4141
|
const timeStr = date.toLocaleTimeString("de-DE", { hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
4139
|
-
const
|
|
4142
|
+
const isImageEvent = e.type === "image_added";
|
|
4143
|
+
const imgId = isImageEvent ? e.payload?.id : void 0;
|
|
4144
|
+
const galleryItem = imgId ? galleryItems.find((g) => g.id === imgId) : void 0;
|
|
4145
|
+
const uploadStatus = imgId ? imageUploadStatus.get(imgId) : void 0;
|
|
4140
4146
|
const payloadStr = JSON.stringify(e.payload ?? {});
|
|
4141
|
-
const payloadPreview = payloadStr.length >
|
|
4142
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap:
|
|
4143
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { fontSize:
|
|
4144
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4147
|
+
const payloadPreview = payloadStr.length > 70 ? payloadStr.slice(0, 70) + "\u2026" : payloadStr;
|
|
4148
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", gap: 7, alignItems: "flex-start", padding: "6px 2px", borderBottom: "1px solid rgba(255,255,255,0.05)" }, children: [
|
|
4149
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { width: 36, height: 36, flexShrink: 0, borderRadius: 4, overflow: "hidden", background: "rgba(255,255,255,0.05)", display: "flex", alignItems: "center", justifyContent: "center" }, children: isImageEvent ? galleryItem?.base64 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("img", { src: galleryItem.base64, style: { width: "100%", height: "100%", objectFit: "cover" } }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 18, color: "rgba(255,255,255,0.2)" }, children: "image" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 16, color: "rgba(255,255,255,0.15)" }, children: e.type === "tag_upserted" ? "label" : e.type === "metadata_updated" ? "edit_note" : "data_object" }) }),
|
|
4150
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4151
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3 }, children: [
|
|
4152
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { fontSize: 11, fontWeight: 700, color: typeColor }, children: e.type }),
|
|
4153
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { fontSize: 9, color: "rgba(255,255,255,0.25)", fontVariantNumeric: "tabular-nums" }, children: timeStr }),
|
|
4154
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { flex: 1 } }),
|
|
4155
|
+
isConfirmed ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
4156
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "check_circle" }),
|
|
4157
|
+
"HF"
|
|
4158
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: "#fbbf24", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "schedule" }),
|
|
4160
|
+
"lokal"
|
|
4161
|
+
] })
|
|
4162
|
+
] }),
|
|
4163
|
+
isImageEvent && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3 }, children: [
|
|
4164
|
+
uploadStatus === "done" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
4165
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_done" }),
|
|
4166
|
+
"Bild auf HF"
|
|
4167
|
+
] }),
|
|
4168
|
+
uploadStatus === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#60a5fa", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
4169
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_upload" }),
|
|
4170
|
+
"Bild l\xE4dt\u2026"
|
|
4171
|
+
] }),
|
|
4172
|
+
uploadStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#f87171", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_off" }),
|
|
4174
|
+
"Bild-Upload fehlgeschlagen"
|
|
4175
|
+
] }),
|
|
4176
|
+
!uploadStatus && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { fontSize: 9, color: "rgba(255,255,255,0.2)" }, children: "Bild-Upload unbekannt (anderes Ger\xE4t?)" }),
|
|
4177
|
+
galleryItem?.base64 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#4ade80", marginLeft: 6, display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "photo" }),
|
|
4179
|
+
"lokal vorhanden"
|
|
4180
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#f87171", marginLeft: 6, display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
4181
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "broken_image" }),
|
|
4182
|
+
"kein lokales Bild"
|
|
4183
|
+
] })
|
|
4184
|
+
] }),
|
|
4185
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { fontSize: 9, color: "rgba(255,255,255,0.25)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: payloadPreview })
|
|
4186
|
+
] })
|
|
4187
|
+
] }, `${eKey}_${i}`);
|
|
4148
4188
|
}),
|
|
4149
4189
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { padding: "6px 0 2px", fontSize: 9, color: "rgba(255,255,255,0.2)", textAlign: "right" }, children: [
|
|
4150
4190
|
events.length,
|
|
4151
|
-
" Events gesamt"
|
|
4191
|
+
" Events gesamt \xB7 ",
|
|
4192
|
+
[...confirmedEventKeys].length,
|
|
4193
|
+
" auf HF best\xE4tigt"
|
|
4152
4194
|
] })
|
|
4153
4195
|
] });
|
|
4154
4196
|
}
|
|
4155
|
-
function HFTestTab({ token, namespace, galleryItems, allEvents = [] }) {
|
|
4197
|
+
function HFTestTab({ token, namespace, galleryItems, allEvents = [], confirmedEventKeys = /* @__PURE__ */ new Set(), imageUploadStatus = /* @__PURE__ */ new Map() }) {
|
|
4156
4198
|
const [selected, setSelected] = (0, import_react22.useState)(null);
|
|
4157
4199
|
const [results, setResults] = (0, import_react22.useState)({});
|
|
4158
4200
|
const [expanded, setExpanded] = (0, import_react22.useState)({});
|
|
@@ -4211,7 +4253,15 @@ function HFTestTab({ token, namespace, galleryItems, allEvents = [] }) {
|
|
|
4211
4253
|
title: "Event Monitor",
|
|
4212
4254
|
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 16 }, children: "bolt" }),
|
|
4213
4255
|
defaultOpen: true,
|
|
4214
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4256
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4257
|
+
EventMonitor,
|
|
4258
|
+
{
|
|
4259
|
+
events: allEvents,
|
|
4260
|
+
confirmedEventKeys,
|
|
4261
|
+
galleryItems,
|
|
4262
|
+
imageUploadStatus
|
|
4263
|
+
}
|
|
4264
|
+
)
|
|
4215
4265
|
}
|
|
4216
4266
|
) }),
|
|
4217
4267
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -4368,10 +4418,12 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4368
4418
|
localOnlyCount,
|
|
4369
4419
|
eventCount,
|
|
4370
4420
|
allEvents: hfAllEvents,
|
|
4421
|
+
confirmedEventKeys: hfConfirmedKeys,
|
|
4371
4422
|
writeEvent: hfWriteEvent,
|
|
4372
4423
|
refresh: refreshHF,
|
|
4373
4424
|
hasStateZip
|
|
4374
4425
|
} = useHFState(hfToken, effectiveNamespace);
|
|
4426
|
+
const [imageUploadStatus, setImageUploadStatus] = (0, import_react23.useState)(/* @__PURE__ */ new Map());
|
|
4375
4427
|
const [bootstrapLog, setBootstrapLog] = (0, import_react23.useState)([]);
|
|
4376
4428
|
const [isBootstrapping, setIsBootstrapping] = (0, import_react23.useState)(false);
|
|
4377
4429
|
const syncTopSlot = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
@@ -4733,8 +4785,10 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4733
4785
|
});
|
|
4734
4786
|
console.log("[HF] handleGenerateImage \u2014 condition check:", { hfToken: !!hfToken, base64: !!base64, effectiveNamespace });
|
|
4735
4787
|
if (hfToken && base64 && effectiveNamespace) {
|
|
4736
|
-
|
|
4788
|
+
setImageUploadStatus((m) => new Map(m).set(genId, "uploading"));
|
|
4789
|
+
hfUploadImage(base64, genId, hfToken).then(() => setImageUploadStatus((m) => new Map(m).set(genId, "done"))).catch((e) => {
|
|
4737
4790
|
console.error("[HF] hfUploadImage failed:", e);
|
|
4791
|
+
setImageUploadStatus((m) => new Map(m).set(genId, "failed"));
|
|
4738
4792
|
});
|
|
4739
4793
|
const entry = {
|
|
4740
4794
|
id: genId,
|
|
@@ -5561,7 +5615,17 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
5561
5615
|
onTagMove: handleTagMove
|
|
5562
5616
|
}
|
|
5563
5617
|
),
|
|
5564
|
-
activeTab === "hftest" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
5618
|
+
activeTab === "hftest" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "absolute inset-0", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
5619
|
+
HFTestTab,
|
|
5620
|
+
{
|
|
5621
|
+
token: hfToken,
|
|
5622
|
+
namespace: effectiveNamespace,
|
|
5623
|
+
galleryItems,
|
|
5624
|
+
allEvents: hfAllEvents,
|
|
5625
|
+
confirmedEventKeys: hfConfirmedKeys,
|
|
5626
|
+
imageUploadStatus
|
|
5627
|
+
}
|
|
5628
|
+
) })
|
|
5565
5629
|
] })
|
|
5566
5630
|
] }),
|
|
5567
5631
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex border-t border-white/10 bg-black shrink-0", style: { height: 56, paddingBottom: "env(safe-area-inset-bottom, 0px)" }, children: [
|
|
@@ -5943,7 +6007,7 @@ function FaApp({
|
|
|
5943
6007
|
// src/index.ts
|
|
5944
6008
|
init_hfStateService();
|
|
5945
6009
|
init_hfStateService();
|
|
5946
|
-
var LIB_VERSION = "2.0.
|
|
6010
|
+
var LIB_VERSION = "2.0.19";
|
|
5947
6011
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5948
6012
|
0 && (module.exports = {
|
|
5949
6013
|
AvatarArchitectApp,
|
package/dist/index.mjs
CHANGED
|
@@ -2070,6 +2070,7 @@ function useHFState(token, namespace) {
|
|
|
2070
2070
|
error,
|
|
2071
2071
|
pendingBufferCount,
|
|
2072
2072
|
localOnlyCount,
|
|
2073
|
+
confirmedEventKeys: knownEventPaths.current,
|
|
2073
2074
|
eventCount,
|
|
2074
2075
|
forks,
|
|
2075
2076
|
writeEvent,
|
|
@@ -3458,33 +3459,74 @@ var EVENT_TYPE_COLORS = {
|
|
|
3458
3459
|
metadata_updated: "#34d399",
|
|
3459
3460
|
probe: "#fbbf24"
|
|
3460
3461
|
};
|
|
3461
|
-
function EventMonitor({ events }) {
|
|
3462
|
+
function EventMonitor({ events, confirmedEventKeys, galleryItems, imageUploadStatus }) {
|
|
3462
3463
|
if (!events.length) {
|
|
3463
3464
|
return /* @__PURE__ */ jsx20("div", { style: { padding: "12px 14px", fontSize: 12, color: "rgba(255,255,255,0.3)", fontStyle: "italic" }, children: "Noch keine Events geladen." });
|
|
3464
3465
|
}
|
|
3465
3466
|
const sorted = [...events].sort((a, b) => b.ts - a.ts).slice(0, 30);
|
|
3466
|
-
return /* @__PURE__ */ jsxs18("div", { style: { padding: "8px
|
|
3467
|
+
return /* @__PURE__ */ jsxs18("div", { style: { padding: "6px 8px 4px" }, children: [
|
|
3467
3468
|
sorted.map((e, i) => {
|
|
3468
|
-
const
|
|
3469
|
+
const eKey = `${e.ts}_${e.clientId}`;
|
|
3470
|
+
const isConfirmed = confirmedEventKeys.has(eKey);
|
|
3471
|
+
const typeColor = EVENT_TYPE_COLORS[e.type] || "rgba(255,255,255,0.5)";
|
|
3469
3472
|
const date = new Date(e.ts);
|
|
3470
3473
|
const timeStr = date.toLocaleTimeString("de-DE", { hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
3471
|
-
const
|
|
3474
|
+
const isImageEvent = e.type === "image_added";
|
|
3475
|
+
const imgId = isImageEvent ? e.payload?.id : void 0;
|
|
3476
|
+
const galleryItem = imgId ? galleryItems.find((g) => g.id === imgId) : void 0;
|
|
3477
|
+
const uploadStatus = imgId ? imageUploadStatus.get(imgId) : void 0;
|
|
3472
3478
|
const payloadStr = JSON.stringify(e.payload ?? {});
|
|
3473
|
-
const payloadPreview = payloadStr.length >
|
|
3474
|
-
return /* @__PURE__ */ jsxs18("div", { style: { display: "flex", gap:
|
|
3475
|
-
/* @__PURE__ */ jsx20("span", { style: { fontSize:
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3479
|
+
const payloadPreview = payloadStr.length > 70 ? payloadStr.slice(0, 70) + "\u2026" : payloadStr;
|
|
3480
|
+
return /* @__PURE__ */ jsxs18("div", { style: { display: "flex", gap: 7, alignItems: "flex-start", padding: "6px 2px", borderBottom: "1px solid rgba(255,255,255,0.05)" }, children: [
|
|
3481
|
+
/* @__PURE__ */ jsx20("div", { style: { width: 36, height: 36, flexShrink: 0, borderRadius: 4, overflow: "hidden", background: "rgba(255,255,255,0.05)", display: "flex", alignItems: "center", justifyContent: "center" }, children: isImageEvent ? galleryItem?.base64 ? /* @__PURE__ */ jsx20("img", { src: galleryItem.base64, style: { width: "100%", height: "100%", objectFit: "cover" } }) : /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 18, color: "rgba(255,255,255,0.2)" }, children: "image" }) : /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 16, color: "rgba(255,255,255,0.15)" }, children: e.type === "tag_upserted" ? "label" : e.type === "metadata_updated" ? "edit_note" : "data_object" }) }),
|
|
3482
|
+
/* @__PURE__ */ jsxs18("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
3483
|
+
/* @__PURE__ */ jsxs18("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3 }, children: [
|
|
3484
|
+
/* @__PURE__ */ jsx20("span", { style: { fontSize: 11, fontWeight: 700, color: typeColor }, children: e.type }),
|
|
3485
|
+
/* @__PURE__ */ jsx20("span", { style: { fontSize: 9, color: "rgba(255,255,255,0.25)", fontVariantNumeric: "tabular-nums" }, children: timeStr }),
|
|
3486
|
+
/* @__PURE__ */ jsx20("div", { style: { flex: 1 } }),
|
|
3487
|
+
isConfirmed ? /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, fontWeight: 700, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3488
|
+
/* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "check_circle" }),
|
|
3489
|
+
"HF"
|
|
3490
|
+
] }) : /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, fontWeight: 700, color: "#fbbf24", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3491
|
+
/* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "schedule" }),
|
|
3492
|
+
"lokal"
|
|
3493
|
+
] })
|
|
3494
|
+
] }),
|
|
3495
|
+
isImageEvent && /* @__PURE__ */ jsxs18("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3 }, children: [
|
|
3496
|
+
uploadStatus === "done" && /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3497
|
+
/* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_done" }),
|
|
3498
|
+
"Bild auf HF"
|
|
3499
|
+
] }),
|
|
3500
|
+
uploadStatus === "uploading" && /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#60a5fa", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3501
|
+
/* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_upload" }),
|
|
3502
|
+
"Bild l\xE4dt\u2026"
|
|
3503
|
+
] }),
|
|
3504
|
+
uploadStatus === "failed" && /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#f87171", display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3505
|
+
/* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_off" }),
|
|
3506
|
+
"Bild-Upload fehlgeschlagen"
|
|
3507
|
+
] }),
|
|
3508
|
+
!uploadStatus && /* @__PURE__ */ jsx20("span", { style: { fontSize: 9, color: "rgba(255,255,255,0.2)" }, children: "Bild-Upload unbekannt (anderes Ger\xE4t?)" }),
|
|
3509
|
+
galleryItem?.base64 ? /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#4ade80", marginLeft: 6, display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3510
|
+
/* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "photo" }),
|
|
3511
|
+
"lokal vorhanden"
|
|
3512
|
+
] }) : /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#f87171", marginLeft: 6, display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3513
|
+
/* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "broken_image" }),
|
|
3514
|
+
"kein lokales Bild"
|
|
3515
|
+
] })
|
|
3516
|
+
] }),
|
|
3517
|
+
/* @__PURE__ */ jsx20("div", { style: { fontSize: 9, color: "rgba(255,255,255,0.25)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: payloadPreview })
|
|
3518
|
+
] })
|
|
3519
|
+
] }, `${eKey}_${i}`);
|
|
3480
3520
|
}),
|
|
3481
3521
|
/* @__PURE__ */ jsxs18("div", { style: { padding: "6px 0 2px", fontSize: 9, color: "rgba(255,255,255,0.2)", textAlign: "right" }, children: [
|
|
3482
3522
|
events.length,
|
|
3483
|
-
" Events gesamt"
|
|
3523
|
+
" Events gesamt \xB7 ",
|
|
3524
|
+
[...confirmedEventKeys].length,
|
|
3525
|
+
" auf HF best\xE4tigt"
|
|
3484
3526
|
] })
|
|
3485
3527
|
] });
|
|
3486
3528
|
}
|
|
3487
|
-
function HFTestTab({ token, namespace, galleryItems, allEvents = [] }) {
|
|
3529
|
+
function HFTestTab({ token, namespace, galleryItems, allEvents = [], confirmedEventKeys = /* @__PURE__ */ new Set(), imageUploadStatus = /* @__PURE__ */ new Map() }) {
|
|
3488
3530
|
const [selected, setSelected] = useState15(null);
|
|
3489
3531
|
const [results, setResults] = useState15({});
|
|
3490
3532
|
const [expanded, setExpanded] = useState15({});
|
|
@@ -3543,7 +3585,15 @@ function HFTestTab({ token, namespace, galleryItems, allEvents = [] }) {
|
|
|
3543
3585
|
title: "Event Monitor",
|
|
3544
3586
|
icon: /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 16 }, children: "bolt" }),
|
|
3545
3587
|
defaultOpen: true,
|
|
3546
|
-
children: /* @__PURE__ */ jsx20(
|
|
3588
|
+
children: /* @__PURE__ */ jsx20(
|
|
3589
|
+
EventMonitor,
|
|
3590
|
+
{
|
|
3591
|
+
events: allEvents,
|
|
3592
|
+
confirmedEventKeys,
|
|
3593
|
+
galleryItems,
|
|
3594
|
+
imageUploadStatus
|
|
3595
|
+
}
|
|
3596
|
+
)
|
|
3547
3597
|
}
|
|
3548
3598
|
) }),
|
|
3549
3599
|
/* @__PURE__ */ jsx20(
|
|
@@ -3700,10 +3750,12 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
3700
3750
|
localOnlyCount,
|
|
3701
3751
|
eventCount,
|
|
3702
3752
|
allEvents: hfAllEvents,
|
|
3753
|
+
confirmedEventKeys: hfConfirmedKeys,
|
|
3703
3754
|
writeEvent: hfWriteEvent,
|
|
3704
3755
|
refresh: refreshHF,
|
|
3705
3756
|
hasStateZip
|
|
3706
3757
|
} = useHFState(hfToken, effectiveNamespace);
|
|
3758
|
+
const [imageUploadStatus, setImageUploadStatus] = useState16(/* @__PURE__ */ new Map());
|
|
3707
3759
|
const [bootstrapLog, setBootstrapLog] = useState16([]);
|
|
3708
3760
|
const [isBootstrapping, setIsBootstrapping] = useState16(false);
|
|
3709
3761
|
const syncTopSlot = /* @__PURE__ */ jsxs19(Fragment9, { children: [
|
|
@@ -4065,8 +4117,10 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4065
4117
|
});
|
|
4066
4118
|
console.log("[HF] handleGenerateImage \u2014 condition check:", { hfToken: !!hfToken, base64: !!base64, effectiveNamespace });
|
|
4067
4119
|
if (hfToken && base64 && effectiveNamespace) {
|
|
4068
|
-
|
|
4120
|
+
setImageUploadStatus((m) => new Map(m).set(genId, "uploading"));
|
|
4121
|
+
hfUploadImage(base64, genId, hfToken).then(() => setImageUploadStatus((m) => new Map(m).set(genId, "done"))).catch((e) => {
|
|
4069
4122
|
console.error("[HF] hfUploadImage failed:", e);
|
|
4123
|
+
setImageUploadStatus((m) => new Map(m).set(genId, "failed"));
|
|
4070
4124
|
});
|
|
4071
4125
|
const entry = {
|
|
4072
4126
|
id: genId,
|
|
@@ -4893,7 +4947,17 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
|
|
|
4893
4947
|
onTagMove: handleTagMove
|
|
4894
4948
|
}
|
|
4895
4949
|
),
|
|
4896
|
-
activeTab === "hftest" && /* @__PURE__ */ jsx21("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsx21(
|
|
4950
|
+
activeTab === "hftest" && /* @__PURE__ */ jsx21("div", { className: "absolute inset-0", children: /* @__PURE__ */ jsx21(
|
|
4951
|
+
HFTestTab,
|
|
4952
|
+
{
|
|
4953
|
+
token: hfToken,
|
|
4954
|
+
namespace: effectiveNamespace,
|
|
4955
|
+
galleryItems,
|
|
4956
|
+
allEvents: hfAllEvents,
|
|
4957
|
+
confirmedEventKeys: hfConfirmedKeys,
|
|
4958
|
+
imageUploadStatus
|
|
4959
|
+
}
|
|
4960
|
+
) })
|
|
4897
4961
|
] })
|
|
4898
4962
|
] }),
|
|
4899
4963
|
/* @__PURE__ */ jsx21("div", { className: "flex border-t border-white/10 bg-black shrink-0", style: { height: 56, paddingBottom: "env(safe-area-inset-bottom, 0px)" }, children: [
|
|
@@ -5273,7 +5337,7 @@ function FaApp({
|
|
|
5273
5337
|
}
|
|
5274
5338
|
|
|
5275
5339
|
// src/index.ts
|
|
5276
|
-
var LIB_VERSION = "2.0.
|
|
5340
|
+
var LIB_VERSION = "2.0.19";
|
|
5277
5341
|
export {
|
|
5278
5342
|
AvatarArchitectApp,
|
|
5279
5343
|
CollapsibleCard,
|