@rslsp1/fa-app-tools 2.0.19 → 2.0.21

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.
@@ -93,8 +93,9 @@ async function hfBatchArchive(moves, token, summary) {
93
93
  }
94
94
  function tsFromEventPath(repoPath) {
95
95
  const filename = repoPath.split("/").pop() || "";
96
- const iso = filename.replace(/_[^_]+\.json$/, "").replace(/-/g, (m, i) => i > 7 ? ":" : m);
97
- const ts = Date.parse(iso.replace(/T(\d{2}):(\d{2}):(\d{2})\.(\d{3})Z/, "T$1:$2:$3.$4Z"));
96
+ const base = filename.replace(/_[^_]+\.json$/, "");
97
+ const iso = base.replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z$/, "T$1:$2:$3.$4Z");
98
+ const ts = Date.parse(iso);
98
99
  return isNaN(ts) ? 0 : ts;
99
100
  }
100
101
  async function loadHFState(namespace, token) {
@@ -24,7 +24,7 @@ import {
24
24
  setHFToken,
25
25
  tsFromEventPath,
26
26
  writeHFEvent
27
- } from "./chunk-D2WTLDI7.mjs";
27
+ } from "./chunk-I73HODO5.mjs";
28
28
  export {
29
29
  HF_TOKEN_KEY,
30
30
  getHFToken,
package/dist/index.d.mts CHANGED
@@ -614,6 +614,6 @@ declare function findTips(dag: Dag): number[];
614
614
  declare function findForks(dag: Dag): DagFork[];
615
615
  declare function topoSort(events: HFEvent[]): HFEvent[];
616
616
 
617
- declare const LIB_VERSION = "2.0.19";
617
+ declare const LIB_VERSION = "2.0.21";
618
618
 
619
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
@@ -614,6 +614,6 @@ declare function findTips(dag: Dag): number[];
614
614
  declare function findForks(dag: Dag): DagFork[];
615
615
  declare function topoSort(events: HFEvent[]): HFEvent[];
616
616
 
617
- declare const LIB_VERSION = "2.0.19";
617
+ declare const LIB_VERSION = "2.0.21";
618
618
 
619
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
@@ -381,8 +381,9 @@ async function hfBatchArchive(moves, token, summary) {
381
381
  }
382
382
  function tsFromEventPath(repoPath) {
383
383
  const filename = repoPath.split("/").pop() || "";
384
- const iso = filename.replace(/_[^_]+\.json$/, "").replace(/-/g, (m, i) => i > 7 ? ":" : m);
385
- const ts = Date.parse(iso.replace(/T(\d{2}):(\d{2}):(\d{2})\.(\d{3})Z/, "T$1:$2:$3.$4Z"));
384
+ const base = filename.replace(/_[^_]+\.json$/, "");
385
+ const iso = base.replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z$/, "T$1:$2:$3.$4Z");
386
+ const ts = Date.parse(iso);
386
387
  return isNaN(ts) ? 0 : ts;
387
388
  }
388
389
  async function loadHFState(namespace, token) {
@@ -4160,26 +4161,25 @@ function EventMonitor({ events, confirmedEventKeys, galleryItems, imageUploadSta
4160
4161
  "lokal"
4161
4162
  ] })
4162
4163
  ] }),
4163
- isImageEvent && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3 }, children: [
4164
+ isImageEvent && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
4164
4165
  uploadStatus === "done" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
4165
4166
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_done" }),
4166
- "Bild auf HF"
4167
+ "Upload \u2713"
4167
4168
  ] }),
4168
4169
  uploadStatus === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#60a5fa", display: "flex", alignItems: "center", gap: 2 }, children: [
4169
4170
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_upload" }),
4170
- "Bild l\xE4dt\u2026"
4171
+ "l\xE4dt hoch\u2026"
4171
4172
  ] }),
4172
4173
  uploadStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#f87171", display: "flex", alignItems: "center", gap: 2 }, children: [
4173
4174
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_off" }),
4174
- "Bild-Upload fehlgeschlagen"
4175
+ "Upload fehlgeschlagen"
4175
4176
  ] }),
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: [
4177
+ galleryItem?.base64 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
4178
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: [
4179
+ uploadStatus ? "lokal" : "von HF geladen"
4180
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontSize: 9, color: "#f87171", display: "flex", alignItems: "center", gap: 2 }, children: [
4181
4181
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "broken_image" }),
4182
- "kein lokales Bild"
4182
+ uploadStatus === "failed" ? "Binary nicht auf HF" : "wird geladen\u2026"
4183
4183
  ] })
4184
4184
  ] }),
4185
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 })
@@ -4510,12 +4510,12 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4510
4510
  setGalleryItems((prev) => {
4511
4511
  const localOnly = prev.filter((g) => !hfIds.has(g.id));
4512
4512
  const merged = skeletons.map((s) => prev.find((g) => g.id === s.id) ?? s);
4513
- return [...localOnly, ...merged];
4513
+ return [...localOnly, ...merged].sort((a, b) => (b.timestamp ?? 0) - (a.timestamp ?? 0));
4514
4514
  });
4515
4515
  setHistory((prev) => {
4516
4516
  const localOnly = prev.filter((g) => !hfIds.has(g.id));
4517
4517
  const merged = skeletons.map((s) => prev.find((g) => g.id === s.id) ?? s);
4518
- return [...localOnly, ...merged];
4518
+ return [...localOnly, ...merged].sort((a, b) => (b.timestamp ?? 0) - (a.timestamp ?? 0));
4519
4519
  });
4520
4520
  const COOLDOWN_MS = 5 * 60 * 1e3;
4521
4521
  for (const entry of hfState.metadata) {
@@ -6007,7 +6007,7 @@ function FaApp({
6007
6007
  // src/index.ts
6008
6008
  init_hfStateService();
6009
6009
  init_hfStateService();
6010
- var LIB_VERSION = "2.0.19";
6010
+ var LIB_VERSION = "2.0.21";
6011
6011
  // Annotate the CommonJS export names for ESM import in node:
6012
6012
  0 && (module.exports = {
6013
6013
  AvatarArchitectApp,
package/dist/index.mjs CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  setHFToken,
22
22
  tsFromEventPath,
23
23
  writeHFEvent
24
- } from "./chunk-D2WTLDI7.mjs";
24
+ } from "./chunk-I73HODO5.mjs";
25
25
 
26
26
  // src/hooks/useOnClickOutside.ts
27
27
  import { useEffect } from "react";
@@ -1598,7 +1598,7 @@ var ProjectSyncTab = ({
1598
1598
  {
1599
1599
  onClick: async () => {
1600
1600
  try {
1601
- const { hfDownloadProject: hfDownloadProject2 } = await import("./hfStateService-OAECMP4M.mjs");
1601
+ const { hfDownloadProject: hfDownloadProject2 } = await import("./hfStateService-PDBVLFML.mjs");
1602
1602
  const file = await hfDownloadProject2(p.path, hfToken);
1603
1603
  onHfLoad(file);
1604
1604
  } catch (e) {
@@ -3492,26 +3492,25 @@ function EventMonitor({ events, confirmedEventKeys, galleryItems, imageUploadSta
3492
3492
  "lokal"
3493
3493
  ] })
3494
3494
  ] }),
3495
- isImageEvent && /* @__PURE__ */ jsxs18("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3 }, children: [
3495
+ isImageEvent && /* @__PURE__ */ jsxs18("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
3496
3496
  uploadStatus === "done" && /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
3497
3497
  /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_done" }),
3498
- "Bild auf HF"
3498
+ "Upload \u2713"
3499
3499
  ] }),
3500
3500
  uploadStatus === "uploading" && /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#60a5fa", display: "flex", alignItems: "center", gap: 2 }, children: [
3501
3501
  /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_upload" }),
3502
- "Bild l\xE4dt\u2026"
3502
+ "l\xE4dt hoch\u2026"
3503
3503
  ] }),
3504
3504
  uploadStatus === "failed" && /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#f87171", display: "flex", alignItems: "center", gap: 2 }, children: [
3505
3505
  /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "cloud_off" }),
3506
- "Bild-Upload fehlgeschlagen"
3506
+ "Upload fehlgeschlagen"
3507
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: [
3508
+ galleryItem?.base64 ? /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#4ade80", display: "flex", alignItems: "center", gap: 2 }, children: [
3510
3509
  /* @__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: [
3510
+ uploadStatus ? "lokal" : "von HF geladen"
3511
+ ] }) : /* @__PURE__ */ jsxs18("span", { style: { fontSize: 9, color: "#f87171", display: "flex", alignItems: "center", gap: 2 }, children: [
3513
3512
  /* @__PURE__ */ jsx20("span", { className: "material-symbols-outlined", style: { fontSize: 11 }, children: "broken_image" }),
3514
- "kein lokales Bild"
3513
+ uploadStatus === "failed" ? "Binary nicht auf HF" : "wird geladen\u2026"
3515
3514
  ] })
3516
3515
  ] }),
3517
3516
  /* @__PURE__ */ jsx20("div", { style: { fontSize: 9, color: "rgba(255,255,255,0.25)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: payloadPreview })
@@ -3842,12 +3841,12 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3842
3841
  setGalleryItems((prev) => {
3843
3842
  const localOnly = prev.filter((g) => !hfIds.has(g.id));
3844
3843
  const merged = skeletons.map((s) => prev.find((g) => g.id === s.id) ?? s);
3845
- return [...localOnly, ...merged];
3844
+ return [...localOnly, ...merged].sort((a, b) => (b.timestamp ?? 0) - (a.timestamp ?? 0));
3846
3845
  });
3847
3846
  setHistory((prev) => {
3848
3847
  const localOnly = prev.filter((g) => !hfIds.has(g.id));
3849
3848
  const merged = skeletons.map((s) => prev.find((g) => g.id === s.id) ?? s);
3850
- return [...localOnly, ...merged];
3849
+ return [...localOnly, ...merged].sort((a, b) => (b.timestamp ?? 0) - (a.timestamp ?? 0));
3851
3850
  });
3852
3851
  const COOLDOWN_MS = 5 * 60 * 1e3;
3853
3852
  for (const entry of hfState.metadata) {
@@ -4604,7 +4603,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4604
4603
  onClick: async () => {
4605
4604
  setIsLoadingFromHF(true);
4606
4605
  try {
4607
- const { hfListProjects: hfListProjects2, hfDownloadProject: hfDownloadProject2 } = await import("./hfStateService-OAECMP4M.mjs");
4606
+ const { hfListProjects: hfListProjects2, hfDownloadProject: hfDownloadProject2 } = await import("./hfStateService-PDBVLFML.mjs");
4608
4607
  const projects = await hfListProjects2(hfToken);
4609
4608
  if (projects.length > 0) {
4610
4609
  const file = await hfDownloadProject2(projects[0].path, hfToken);
@@ -5337,7 +5336,7 @@ function FaApp({
5337
5336
  }
5338
5337
 
5339
5338
  // src/index.ts
5340
- var LIB_VERSION = "2.0.19";
5339
+ var LIB_VERSION = "2.0.21";
5341
5340
  export {
5342
5341
  AvatarArchitectApp,
5343
5342
  CollapsibleCard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslsp1/fa-app-tools",
3
- "version": "2.0.19",
3
+ "version": "2.0.21",
4
4
  "description": "Shared tools and hooks for Fine Art flow apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",