@rslsp1/fa-app-tools 1.3.2 → 1.3.4

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
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
448
448
  declare function autoLabel(index: number): string;
449
449
  declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
450
450
 
451
- declare const LIB_VERSION = "1.3.2";
451
+ declare const LIB_VERSION = "1.3.4";
452
452
 
453
453
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, 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, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
package/dist/index.d.ts CHANGED
@@ -448,6 +448,6 @@ declare function buildLoopInstruction(rounds: Array<{
448
448
  declare function autoLabel(index: number): string;
449
449
  declare function buildReferenceImageMediaIds(images: SelectedLabImage[]): string[];
450
450
 
451
- declare const LIB_VERSION = "1.3.2";
451
+ declare const LIB_VERSION = "1.3.4";
452
452
 
453
453
  export { AvatarArchitectApp, type AvatarArchitectAppProps, CollapsibleCard, CompactDropdown, type ExtractedCharacter, FaToolsBadge, type FlowSdk, GLOBAL_STYLES, type Generation, 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, groupGenerationsToLabItems, importProjectFromZip, injectXMPMetadata, interpretSdkError, parsePromptFile, parsePromptResponse, useKeyboardNavigation, useOnClickOutside };
package/dist/index.js CHANGED
@@ -2223,6 +2223,13 @@ function autoLabel(index) {
2223
2223
  function buildReferenceImageMediaIds(images) {
2224
2224
  return images.filter((i) => i.sendToImageGen && i.frame.mediaId).map((i) => i.frame.mediaId);
2225
2225
  }
2226
+ function toPromptImages(images) {
2227
+ return images.filter((i) => i.sendToPromptAI && i.frame.base64).map((i) => {
2228
+ const raw = i.frame.base64.includes(",") ? i.frame.base64.split(",")[1] : i.frame.base64;
2229
+ const mimeType = i.frame.base64.startsWith("data:image/png") ? "image/png" : "image/jpeg";
2230
+ return { base64: raw, mimeType };
2231
+ });
2232
+ }
2226
2233
 
2227
2234
  // src/components/labs/LabsTab.tsx
2228
2235
  var import_react19 = require("react");
@@ -2373,7 +2380,8 @@ var LabRemix = ({ services, onResult }) => {
2373
2380
  instruction,
2374
2381
  selected.item.prompt
2375
2382
  );
2376
- const images = selected.sendToPromptAI ? [{ base64: selected.frame.base64, mimeType: "image/png" }] : void 0;
2383
+ const imgs = toPromptImages([selected]);
2384
+ const images = imgs.length ? imgs : void 0;
2377
2385
  const result = await services.generateText(text, { systemInstruction, images });
2378
2386
  setGeneratedPrompt(result);
2379
2387
  } finally {
@@ -2766,7 +2774,7 @@ var LabCompare = ({ services, onResult }) => {
2766
2774
  setIsAnalyzing(true);
2767
2775
  try {
2768
2776
  const { text, systemInstruction } = buildCompareInstruction(filled, instruction);
2769
- const images = filled.filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2777
+ const images = toPromptImages(filled);
2770
2778
  const result = await services.generateText(text, { systemInstruction, images: images.length ? images : void 0 });
2771
2779
  setAnalysis(result);
2772
2780
  setGeneratedPrompt("");
@@ -2934,7 +2942,7 @@ var LabLoop = ({ services, onResult }) => {
2934
2942
  images: r.images
2935
2943
  }));
2936
2944
  const { text, systemInstruction } = buildLoopInstruction(historyForBuilder, currentInstruction);
2937
- const allImages = [...rounds.flatMap((r) => r.images), ...pendingImages].filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2945
+ const allImages = toPromptImages([...rounds.flatMap((r) => r.images), ...pendingImages]);
2938
2946
  const newPrompt = await services.generateText(text, {
2939
2947
  systemInstruction,
2940
2948
  images: allImages.length ? allImages : void 0
@@ -3927,42 +3935,34 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3927
3935
  !projectLoaded && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-white/20 text-[10px] text-center", children: "Baum, Bilder und Einstellungen wiederherstellen" })
3928
3936
  ] }),
3929
3937
  /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col items-center gap-2 w-full max-w-[280px]", children: [
3930
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3931
- "form",
3932
- {
3933
- onSubmit: (e) => {
3934
- e.preventDefault();
3935
- if (hfTokenInput.trim()) setHfToken(hfTokenInput.trim());
3936
- },
3937
- className: "flex gap-2 w-full",
3938
- autoComplete: "on",
3939
- children: [
3940
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { type: "text", name: "username", value: "hf-token", readOnly: true, autoComplete: "username", className: "hidden" }),
3941
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3942
- "input",
3943
- {
3944
- type: "password",
3945
- name: "password",
3946
- autoComplete: "current-password",
3947
- value: hfTokenInput,
3948
- onChange: (e) => setHfTokenInput(e.target.value),
3949
- placeholder: "HF Token (hf_\u2026)",
3950
- className: "flex-1 rounded-xl px-3 text-[11px] font-mono outline-none",
3951
- style: { height: 44, background: "rgba(255,255,255,0.05)", border: "1px solid rgba(255,255,255,0.1)", color: "rgba(255,255,255,0.7)" }
3952
- }
3953
- ),
3954
- hfTokenInput.trim() && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3955
- "button",
3956
- {
3957
- type: "submit",
3958
- className: "px-3 rounded-xl text-[11px] font-bold text-white",
3959
- style: { background: "#f59e0b", height: 44 },
3960
- children: "OK"
3961
- }
3962
- )
3963
- ]
3964
- }
3965
- ),
3938
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex gap-2 w-full", children: [
3939
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3940
+ "input",
3941
+ {
3942
+ type: "password",
3943
+ autoComplete: "current-password",
3944
+ id: "hf-token-input",
3945
+ value: hfTokenInput,
3946
+ onChange: (e) => setHfTokenInput(e.target.value),
3947
+ onKeyDown: (e) => {
3948
+ if (e.key === "Enter" && hfTokenInput.trim()) setHfToken(hfTokenInput.trim());
3949
+ },
3950
+ placeholder: "HF Token (hf_\u2026)",
3951
+ className: "flex-1 rounded-xl px-3 text-[11px] font-mono outline-none",
3952
+ style: { height: 44, background: "rgba(255,255,255,0.05)", border: "1px solid rgba(255,255,255,0.1)", color: "rgba(255,255,255,0.7)" }
3953
+ }
3954
+ ),
3955
+ hfTokenInput.trim() && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3956
+ "button",
3957
+ {
3958
+ type: "button",
3959
+ onClick: () => setHfToken(hfTokenInput.trim()),
3960
+ className: "px-3 rounded-xl text-[11px] font-bold text-white",
3961
+ style: { background: "#f59e0b", height: 44 },
3962
+ children: "OK"
3963
+ }
3964
+ )
3965
+ ] }),
3966
3966
  hfToken && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3967
3967
  "button",
3968
3968
  {
@@ -4628,7 +4628,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4628
4628
  }
4629
4629
 
4630
4630
  // src/index.ts
4631
- var LIB_VERSION = "1.3.2";
4631
+ var LIB_VERSION = "1.3.4";
4632
4632
  // Annotate the CommonJS export names for ESM import in node:
4633
4633
  0 && (module.exports = {
4634
4634
  AvatarArchitectApp,
package/dist/index.mjs CHANGED
@@ -1760,6 +1760,13 @@ function autoLabel(index) {
1760
1760
  function buildReferenceImageMediaIds(images) {
1761
1761
  return images.filter((i) => i.sendToImageGen && i.frame.mediaId).map((i) => i.frame.mediaId);
1762
1762
  }
1763
+ function toPromptImages(images) {
1764
+ return images.filter((i) => i.sendToPromptAI && i.frame.base64).map((i) => {
1765
+ const raw = i.frame.base64.includes(",") ? i.frame.base64.split(",")[1] : i.frame.base64;
1766
+ const mimeType = i.frame.base64.startsWith("data:image/png") ? "image/png" : "image/jpeg";
1767
+ return { base64: raw, mimeType };
1768
+ });
1769
+ }
1763
1770
 
1764
1771
  // src/components/labs/LabsTab.tsx
1765
1772
  import { useState as useState12 } from "react";
@@ -1910,7 +1917,8 @@ var LabRemix = ({ services, onResult }) => {
1910
1917
  instruction,
1911
1918
  selected.item.prompt
1912
1919
  );
1913
- const images = selected.sendToPromptAI ? [{ base64: selected.frame.base64, mimeType: "image/png" }] : void 0;
1920
+ const imgs = toPromptImages([selected]);
1921
+ const images = imgs.length ? imgs : void 0;
1914
1922
  const result = await services.generateText(text, { systemInstruction, images });
1915
1923
  setGeneratedPrompt(result);
1916
1924
  } finally {
@@ -2303,7 +2311,7 @@ var LabCompare = ({ services, onResult }) => {
2303
2311
  setIsAnalyzing(true);
2304
2312
  try {
2305
2313
  const { text, systemInstruction } = buildCompareInstruction(filled, instruction);
2306
- const images = filled.filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2314
+ const images = toPromptImages(filled);
2307
2315
  const result = await services.generateText(text, { systemInstruction, images: images.length ? images : void 0 });
2308
2316
  setAnalysis(result);
2309
2317
  setGeneratedPrompt("");
@@ -2471,7 +2479,7 @@ var LabLoop = ({ services, onResult }) => {
2471
2479
  images: r.images
2472
2480
  }));
2473
2481
  const { text, systemInstruction } = buildLoopInstruction(historyForBuilder, currentInstruction);
2474
- const allImages = [...rounds.flatMap((r) => r.images), ...pendingImages].filter((i) => i.sendToPromptAI).map((i) => ({ base64: i.frame.base64, mimeType: "image/png" }));
2482
+ const allImages = toPromptImages([...rounds.flatMap((r) => r.images), ...pendingImages]);
2475
2483
  const newPrompt = await services.generateText(text, {
2476
2484
  systemInstruction,
2477
2485
  images: allImages.length ? allImages : void 0
@@ -3464,42 +3472,34 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
3464
3472
  !projectLoaded && /* @__PURE__ */ jsx20("span", { className: "text-white/20 text-[10px] text-center", children: "Baum, Bilder und Einstellungen wiederherstellen" })
3465
3473
  ] }),
3466
3474
  /* @__PURE__ */ jsxs18("div", { className: "flex flex-col items-center gap-2 w-full max-w-[280px]", children: [
3467
- /* @__PURE__ */ jsxs18(
3468
- "form",
3469
- {
3470
- onSubmit: (e) => {
3471
- e.preventDefault();
3472
- if (hfTokenInput.trim()) setHfToken(hfTokenInput.trim());
3473
- },
3474
- className: "flex gap-2 w-full",
3475
- autoComplete: "on",
3476
- children: [
3477
- /* @__PURE__ */ jsx20("input", { type: "text", name: "username", value: "hf-token", readOnly: true, autoComplete: "username", className: "hidden" }),
3478
- /* @__PURE__ */ jsx20(
3479
- "input",
3480
- {
3481
- type: "password",
3482
- name: "password",
3483
- autoComplete: "current-password",
3484
- value: hfTokenInput,
3485
- onChange: (e) => setHfTokenInput(e.target.value),
3486
- placeholder: "HF Token (hf_\u2026)",
3487
- className: "flex-1 rounded-xl px-3 text-[11px] font-mono outline-none",
3488
- style: { height: 44, background: "rgba(255,255,255,0.05)", border: "1px solid rgba(255,255,255,0.1)", color: "rgba(255,255,255,0.7)" }
3489
- }
3490
- ),
3491
- hfTokenInput.trim() && /* @__PURE__ */ jsx20(
3492
- "button",
3493
- {
3494
- type: "submit",
3495
- className: "px-3 rounded-xl text-[11px] font-bold text-white",
3496
- style: { background: "#f59e0b", height: 44 },
3497
- children: "OK"
3498
- }
3499
- )
3500
- ]
3501
- }
3502
- ),
3475
+ /* @__PURE__ */ jsxs18("div", { className: "flex gap-2 w-full", children: [
3476
+ /* @__PURE__ */ jsx20(
3477
+ "input",
3478
+ {
3479
+ type: "password",
3480
+ autoComplete: "current-password",
3481
+ id: "hf-token-input",
3482
+ value: hfTokenInput,
3483
+ onChange: (e) => setHfTokenInput(e.target.value),
3484
+ onKeyDown: (e) => {
3485
+ if (e.key === "Enter" && hfTokenInput.trim()) setHfToken(hfTokenInput.trim());
3486
+ },
3487
+ placeholder: "HF Token (hf_\u2026)",
3488
+ className: "flex-1 rounded-xl px-3 text-[11px] font-mono outline-none",
3489
+ style: { height: 44, background: "rgba(255,255,255,0.05)", border: "1px solid rgba(255,255,255,0.1)", color: "rgba(255,255,255,0.7)" }
3490
+ }
3491
+ ),
3492
+ hfTokenInput.trim() && /* @__PURE__ */ jsx20(
3493
+ "button",
3494
+ {
3495
+ type: "button",
3496
+ onClick: () => setHfToken(hfTokenInput.trim()),
3497
+ className: "px-3 rounded-xl text-[11px] font-bold text-white",
3498
+ style: { background: "#f59e0b", height: 44 },
3499
+ children: "OK"
3500
+ }
3501
+ )
3502
+ ] }),
3503
3503
  hfToken && /* @__PURE__ */ jsxs18(
3504
3504
  "button",
3505
3505
  {
@@ -4165,7 +4165,7 @@ function AvatarArchitectApp({ onGenerateImage, onGeneratePrompt, onDownload, onS
4165
4165
  }
4166
4166
 
4167
4167
  // src/index.ts
4168
- var LIB_VERSION = "1.3.2";
4168
+ var LIB_VERSION = "1.3.4";
4169
4169
  export {
4170
4170
  AvatarArchitectApp,
4171
4171
  CollapsibleCard,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslsp1/fa-app-tools",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Shared tools and hooks for Fine Art flow apps",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",