@rslsp1/fa-app-tools 1.3.15 → 1.3.16

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 CHANGED
@@ -309,12 +309,13 @@ interface AvatarArchitectAppProps {
309
309
  onDownload: (base64: string, mimeType: string, filename: string) => Promise<void>;
310
310
  onSelectMedia: () => Promise<MediaItem[]>;
311
311
  buildInfo?: string;
312
+ initialHfToken?: string;
312
313
  onFetchServerProjects?: () => Promise<ProjectMeta[]>;
313
314
  onServerSave?: (zipBase64: string, name: string) => Promise<ProjectMeta>;
314
315
  onServerLoad?: (id: string) => Promise<File>;
315
316
  onServerDelete?: (id: string) => Promise<void>;
316
317
  }
317
- declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
318
+ declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, initialHfToken, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
318
319
 
319
320
  interface FaAppProps {
320
321
  onGenerateImage: (params: Record<string, any>) => Promise<{
@@ -517,6 +518,6 @@ declare function hfLoadMetadata(token: string): Promise<any[]>;
517
518
  declare function hfUploadImage(base64: string, id: string, token: string, mimeType?: string): Promise<void>;
518
519
  declare function hfLoadImageAsBase64(id: string, token: string): Promise<string | null>;
519
520
 
520
- declare const LIB_VERSION = "1.3.15";
521
+ declare const LIB_VERSION = "1.3.16";
521
522
 
522
523
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaApp, type FaAppProps, 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
@@ -309,12 +309,13 @@ interface AvatarArchitectAppProps {
309
309
  onDownload: (base64: string, mimeType: string, filename: string) => Promise<void>;
310
310
  onSelectMedia: () => Promise<MediaItem[]>;
311
311
  buildInfo?: string;
312
+ initialHfToken?: string;
312
313
  onFetchServerProjects?: () => Promise<ProjectMeta[]>;
313
314
  onServerSave?: (zipBase64: string, name: string) => Promise<ProjectMeta>;
314
315
  onServerLoad?: (id: string) => Promise<File>;
315
316
  onServerDelete?: (id: string) => Promise<void>;
316
317
  }
317
- declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
318
+ declare function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, initialHfToken, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }: AvatarArchitectAppProps): react_jsx_runtime.JSX.Element;
318
319
 
319
320
  interface FaAppProps {
320
321
  onGenerateImage: (params: Record<string, any>) => Promise<{
@@ -517,6 +518,6 @@ declare function hfLoadMetadata(token: string): Promise<any[]>;
517
518
  declare function hfUploadImage(base64: string, id: string, token: string, mimeType?: string): Promise<void>;
518
519
  declare function hfLoadImageAsBase64(id: string, token: string): Promise<string | null>;
519
520
 
520
- declare const LIB_VERSION = "1.3.15";
521
+ declare const LIB_VERSION = "1.3.16";
521
522
 
522
523
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaApp, type FaAppProps, 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
@@ -3451,7 +3451,7 @@ function TagManagerPanel({ workspaceTags, onTagCreate, onTagUpdate, onTagDelete,
3451
3451
 
3452
3452
  // src/components/AvatarArchitectApp.tsx
3453
3453
  var import_jsx_runtime20 = require("react/jsx-runtime");
3454
- function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }) {
3454
+ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, initialHfToken, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }) {
3455
3455
  (0, import_react21.useEffect)(() => {
3456
3456
  const id = "flow-styles";
3457
3457
  if (!document.getElementById(id)) {
@@ -3470,8 +3470,8 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3470
3470
  }
3471
3471
  });
3472
3472
  const [projectLoaded, setProjectLoaded] = (0, import_react21.useState)(false);
3473
- const [hfToken, setHfToken] = (0, import_react21.useState)("");
3474
- const [hfTokenInput, setHfTokenInput] = (0, import_react21.useState)("");
3473
+ const [hfToken, setHfToken] = (0, import_react21.useState)(initialHfToken || "");
3474
+ const [hfTokenInput, setHfTokenInput] = (0, import_react21.useState)(initialHfToken || "");
3475
3475
  const [isLoadingFromHF, setIsLoadingFromHF] = (0, import_react21.useState)(false);
3476
3476
  const [hfMetadata, setHfMetadata] = (0, import_react21.useState)([]);
3477
3477
  const hfTagSaveTimer = (0, import_react21.useRef)(null);
@@ -4255,7 +4255,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4255
4255
  !projectLoaded && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-white/20 text-[10px] text-center", children: "Baum, Bilder und Einstellungen wiederherstellen" })
4256
4256
  ] }),
4257
4257
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col items-center gap-2 w-full max-w-[280px]", children: [
4258
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex gap-2 w-full", children: [
4258
+ !initialHfToken && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex gap-2 w-full", children: [
4259
4259
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4260
4260
  "input",
4261
4261
  {
@@ -4954,39 +4954,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4954
4954
  }
4955
4955
 
4956
4956
  // src/components/FaApp.tsx
4957
- var import_react22 = require("react");
4958
- init_hfStateService();
4959
4957
  var import_jsx_runtime21 = require("react/jsx-runtime");
4960
- function TokenDialog({ onSubmit }) {
4961
- const [value, setValue] = (0, import_react22.useState)("");
4962
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { minHeight: "100vh", background: "#0e0e0e", display: "flex", alignItems: "center", justifyContent: "center", padding: 16 }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { width: "100%", maxWidth: 400, background: "#171717", border: "1px solid #262626", borderRadius: 8, padding: 24, position: "relative", overflow: "hidden" }, children: [
4963
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: 3, background: "linear-gradient(to right, #3b82f6, #a855f7, #ec4899)" } }),
4964
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { style: { marginBottom: 20 }, children: [
4965
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { color: "#fff", fontSize: 14, fontWeight: 700, marginBottom: 4 }, children: "Lib Token" }),
4966
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { color: "#525252", fontSize: 11, fontFamily: "monospace" }, children: "Kein Token konfiguriert \u2014 bitte manuell eingeben" })
4967
- ] }),
4968
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4969
- "input",
4970
- {
4971
- type: "password",
4972
- value,
4973
- onChange: (e) => setValue(e.target.value),
4974
- onKeyDown: (e) => e.key === "Enter" && value.trim() && onSubmit(value.trim()),
4975
- placeholder: "Token eingeben\u2026",
4976
- autoFocus: true,
4977
- style: { width: "100%", background: "#000", border: "1px solid #404040", borderRadius: 4, color: "#fff", padding: "10px 12px", fontSize: 12, fontFamily: "monospace", outline: "none", boxSizing: "border-box", marginBottom: 12 }
4978
- }
4979
- ),
4980
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4981
- "button",
4982
- {
4983
- onClick: () => value.trim() && onSubmit(value.trim()),
4984
- style: { width: "100%", background: "#3b82f6", border: "none", borderRadius: 4, color: "#fff", padding: "10px", fontSize: 12, fontWeight: 700, cursor: "pointer", fontFamily: "inherit" },
4985
- children: "Best\xE4tigen"
4986
- }
4987
- )
4988
- ] }) });
4989
- }
4990
4958
  function FaApp({
4991
4959
  onGenerateImage,
4992
4960
  onGeneratePrompt,
@@ -5003,14 +4971,6 @@ function FaApp({
5003
4971
  onServerDelete,
5004
4972
  buildInfo
5005
4973
  }) {
5006
- const [token, setToken] = (0, import_react22.useState)(libToken || "");
5007
- (0, import_react22.useEffect)(() => {
5008
- if (libToken) setToken(libToken);
5009
- }, [libToken]);
5010
- (0, import_react22.useEffect)(() => {
5011
- if (token) setHFToken(token);
5012
- }, [token]);
5013
- if (!token) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TokenDialog, { onSubmit: setToken });
5014
4974
  const wrappedPrompt = async (text, options) => {
5015
4975
  const result = await onGeneratePrompt(text, options);
5016
4976
  return result.text;
@@ -5022,6 +4982,7 @@ function FaApp({
5022
4982
  onGeneratePrompt: wrappedPrompt,
5023
4983
  onDownload,
5024
4984
  onSelectMedia,
4985
+ initialHfToken: libToken,
5025
4986
  onFetchServerProjects,
5026
4987
  onServerSave,
5027
4988
  onServerLoad,
@@ -5033,7 +4994,7 @@ function FaApp({
5033
4994
 
5034
4995
  // src/index.ts
5035
4996
  init_hfStateService();
5036
- var LIB_VERSION = "1.3.15";
4997
+ var LIB_VERSION = "1.3.16";
5037
4998
  // Annotate the CommonJS export names for ESM import in node:
5038
4999
  0 && (module.exports = {
5039
5000
  AvatarArchitectApp,
package/dist/index.mjs CHANGED
@@ -2893,7 +2893,7 @@ function TagManagerPanel({ workspaceTags, onTagCreate, onTagUpdate, onTagDelete,
2893
2893
 
2894
2894
  // src/components/AvatarArchitectApp.tsx
2895
2895
  import { Fragment as Fragment9, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
2896
- function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }) {
2896
+ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onSelectMedia, buildInfo, initialHfToken, onFetchServerProjects, onServerSave, onServerLoad, onServerDelete }) {
2897
2897
  useEffect5(() => {
2898
2898
  const id = "flow-styles";
2899
2899
  if (!document.getElementById(id)) {
@@ -2912,8 +2912,8 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
2912
2912
  }
2913
2913
  });
2914
2914
  const [projectLoaded, setProjectLoaded] = useState14(false);
2915
- const [hfToken, setHfToken] = useState14("");
2916
- const [hfTokenInput, setHfTokenInput] = useState14("");
2915
+ const [hfToken, setHfToken] = useState14(initialHfToken || "");
2916
+ const [hfTokenInput, setHfTokenInput] = useState14(initialHfToken || "");
2917
2917
  const [isLoadingFromHF, setIsLoadingFromHF] = useState14(false);
2918
2918
  const [hfMetadata, setHfMetadata] = useState14([]);
2919
2919
  const hfTagSaveTimer = useRef6(null);
@@ -3697,7 +3697,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3697
3697
  !projectLoaded && /* @__PURE__ */ jsx20("span", { className: "text-white/20 text-[10px] text-center", children: "Baum, Bilder und Einstellungen wiederherstellen" })
3698
3698
  ] }),
3699
3699
  /* @__PURE__ */ jsxs18("div", { className: "flex flex-col items-center gap-2 w-full max-w-[280px]", children: [
3700
- /* @__PURE__ */ jsxs18("div", { className: "flex gap-2 w-full", children: [
3700
+ !initialHfToken && /* @__PURE__ */ jsxs18("div", { className: "flex gap-2 w-full", children: [
3701
3701
  /* @__PURE__ */ jsx20(
3702
3702
  "input",
3703
3703
  {
@@ -4396,38 +4396,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4396
4396
  }
4397
4397
 
4398
4398
  // src/components/FaApp.tsx
4399
- import { useState as useState15, useEffect as useEffect6 } from "react";
4400
- import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4401
- function TokenDialog({ onSubmit }) {
4402
- const [value, setValue] = useState15("");
4403
- return /* @__PURE__ */ jsx21("div", { style: { minHeight: "100vh", background: "#0e0e0e", display: "flex", alignItems: "center", justifyContent: "center", padding: 16 }, children: /* @__PURE__ */ jsxs19("div", { style: { width: "100%", maxWidth: 400, background: "#171717", border: "1px solid #262626", borderRadius: 8, padding: 24, position: "relative", overflow: "hidden" }, children: [
4404
- /* @__PURE__ */ jsx21("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: 3, background: "linear-gradient(to right, #3b82f6, #a855f7, #ec4899)" } }),
4405
- /* @__PURE__ */ jsxs19("div", { style: { marginBottom: 20 }, children: [
4406
- /* @__PURE__ */ jsx21("div", { style: { color: "#fff", fontSize: 14, fontWeight: 700, marginBottom: 4 }, children: "Lib Token" }),
4407
- /* @__PURE__ */ jsx21("div", { style: { color: "#525252", fontSize: 11, fontFamily: "monospace" }, children: "Kein Token konfiguriert \u2014 bitte manuell eingeben" })
4408
- ] }),
4409
- /* @__PURE__ */ jsx21(
4410
- "input",
4411
- {
4412
- type: "password",
4413
- value,
4414
- onChange: (e) => setValue(e.target.value),
4415
- onKeyDown: (e) => e.key === "Enter" && value.trim() && onSubmit(value.trim()),
4416
- placeholder: "Token eingeben\u2026",
4417
- autoFocus: true,
4418
- style: { width: "100%", background: "#000", border: "1px solid #404040", borderRadius: 4, color: "#fff", padding: "10px 12px", fontSize: 12, fontFamily: "monospace", outline: "none", boxSizing: "border-box", marginBottom: 12 }
4419
- }
4420
- ),
4421
- /* @__PURE__ */ jsx21(
4422
- "button",
4423
- {
4424
- onClick: () => value.trim() && onSubmit(value.trim()),
4425
- style: { width: "100%", background: "#3b82f6", border: "none", borderRadius: 4, color: "#fff", padding: "10px", fontSize: 12, fontWeight: 700, cursor: "pointer", fontFamily: "inherit" },
4426
- children: "Best\xE4tigen"
4427
- }
4428
- )
4429
- ] }) });
4430
- }
4399
+ import { jsx as jsx21 } from "react/jsx-runtime";
4431
4400
  function FaApp({
4432
4401
  onGenerateImage,
4433
4402
  onGeneratePrompt,
@@ -4444,14 +4413,6 @@ function FaApp({
4444
4413
  onServerDelete,
4445
4414
  buildInfo
4446
4415
  }) {
4447
- const [token, setToken] = useState15(libToken || "");
4448
- useEffect6(() => {
4449
- if (libToken) setToken(libToken);
4450
- }, [libToken]);
4451
- useEffect6(() => {
4452
- if (token) setHFToken(token);
4453
- }, [token]);
4454
- if (!token) return /* @__PURE__ */ jsx21(TokenDialog, { onSubmit: setToken });
4455
4416
  const wrappedPrompt = async (text, options) => {
4456
4417
  const result = await onGeneratePrompt(text, options);
4457
4418
  return result.text;
@@ -4463,6 +4424,7 @@ function FaApp({
4463
4424
  onGeneratePrompt: wrappedPrompt,
4464
4425
  onDownload,
4465
4426
  onSelectMedia,
4427
+ initialHfToken: libToken,
4466
4428
  onFetchServerProjects,
4467
4429
  onServerSave,
4468
4430
  onServerLoad,
@@ -4473,7 +4435,7 @@ function FaApp({
4473
4435
  }
4474
4436
 
4475
4437
  // src/index.ts
4476
- var LIB_VERSION = "1.3.15";
4438
+ var LIB_VERSION = "1.3.16";
4477
4439
  export {
4478
4440
  AvatarArchitectApp,
4479
4441
  CollapsibleCard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslsp1/fa-app-tools",
3
- "version": "1.3.15",
3
+ "version": "1.3.16",
4
4
  "description": "Shared tools and hooks for Fine Art flow apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",