@gallop.software/studio 1.4.7 → 1.5.0

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.
@@ -4282,7 +4282,9 @@ function StudioDetailView() {
4282
4282
  const [showR2SetupModal, setShowR2SetupModal] = useState8(false);
4283
4283
  const [alertMessage, setAlertMessage] = useState8(null);
4284
4284
  const [showCopied, setShowCopied] = useState8(false);
4285
+ const [generatingFavicon, setGeneratingFavicon] = useState8(false);
4285
4286
  const isActionInProgress = actionState.showProgress;
4287
+ const isFaviconSource = focusedItem ? focusedItem.name.toLowerCase() === "favicon.png" || focusedItem.name.toLowerCase() === "favicon.jpg" : false;
4286
4288
  if (!focusedItem) return null;
4287
4289
  const isImage = isImageFile(focusedItem.name);
4288
4290
  const isVideo = isVideoFile(focusedItem.name);
@@ -4329,6 +4331,39 @@ function StudioDetailView() {
4329
4331
  }
4330
4332
  }
4331
4333
  };
4334
+ const handleGenerateFavicons = async () => {
4335
+ if (!focusedItem) return;
4336
+ setGeneratingFavicon(true);
4337
+ try {
4338
+ const response = await fetch("/api/studio/generate-favicon", {
4339
+ method: "POST",
4340
+ headers: { "Content-Type": "application/json" },
4341
+ body: JSON.stringify({
4342
+ imagePath: "/" + focusedItem.path.replace(/^public\//, "")
4343
+ })
4344
+ });
4345
+ const data = await response.json();
4346
+ if (response.ok && data.success) {
4347
+ setAlertMessage({
4348
+ title: "Favicons Generated",
4349
+ message: data.message + " Files saved to src/app/"
4350
+ });
4351
+ } else {
4352
+ setAlertMessage({
4353
+ title: "Generation Failed",
4354
+ message: data.error || data.message || "Failed to generate favicons"
4355
+ });
4356
+ }
4357
+ } catch (error) {
4358
+ console.error("Favicon generation error:", error);
4359
+ setAlertMessage({
4360
+ title: "Generation Failed",
4361
+ message: "An error occurred while generating favicons"
4362
+ });
4363
+ } finally {
4364
+ setGeneratingFavicon(false);
4365
+ }
4366
+ };
4332
4367
  const renderMedia = () => {
4333
4368
  if (isImage) {
4334
4369
  return /* @__PURE__ */ jsx8("img", { css: styles8.image, src: imageSrc, alt: focusedItem.name });
@@ -4475,6 +4510,18 @@ function StudioDetailView() {
4475
4510
  ]
4476
4511
  }
4477
4512
  ),
4513
+ isFaviconSource && /* @__PURE__ */ jsxs8(
4514
+ "button",
4515
+ {
4516
+ css: styles8.actionBtn,
4517
+ onClick: handleGenerateFavicons,
4518
+ disabled: generatingFavicon || focusedItem.isProtected,
4519
+ children: [
4520
+ /* @__PURE__ */ jsx8("svg", { css: styles8.actionIcon, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx8("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" }) }),
4521
+ generatingFavicon ? "Generating..." : "Generate Favicons"
4522
+ ]
4523
+ }
4524
+ ),
4478
4525
  /* @__PURE__ */ jsxs8(
4479
4526
  "button",
4480
4527
  {
@@ -6104,4 +6151,4 @@ export {
6104
6151
  StudioUI,
6105
6152
  StudioUI_default as default
6106
6153
  };
6107
- //# sourceMappingURL=StudioUI-TP2Y3ZEL.mjs.map
6154
+ //# sourceMappingURL=StudioUI-7QQIKNTF.mjs.map