@tangle-network/agent-app 1.0.5 → 1.0.7

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.
@@ -2,7 +2,7 @@ import {
2
2
  ReasoningRow,
3
3
  chatToolCallPart,
4
4
  resolveToolPresentation
5
- } from "../chunk-DDYWECBU.js";
5
+ } from "../chunk-TGSVYWIF.js";
6
6
  import "../chunk-UHSUY6H6.js";
7
7
  import "../chunk-3HUFJ5LO.js";
8
8
  import "../chunk-7PULOECS.js";
@@ -8433,16 +8433,38 @@ function ApiAccessPanel({
8433
8433
  }
8434
8434
 
8435
8435
  // src/web-react/agent-setup-block.tsx
8436
- import { useState as useState28 } from "react";
8437
- import { jsx as jsx30, jsxs as jsxs29 } from "react/jsx-runtime";
8436
+ import { Check } from "lucide-react";
8437
+ import { useEffect as useEffect20, useRef as useRef20, useState as useState28 } from "react";
8438
+ import { Fragment as Fragment11, jsx as jsx30, jsxs as jsxs29 } from "react/jsx-runtime";
8438
8439
  function AgentSetupBlock({ productName, setupUrl, markdown, description, className }) {
8439
8440
  const [notice, setNotice] = useState28(null);
8441
+ const [copied, setCopied] = useState28(false);
8442
+ const copiedResetTimer = useRef20(null);
8443
+ const mounted = useRef20(true);
8440
8444
  const prompt = markdown ?? `Set up ${productName} for me. Fetch ${setupUrl} and follow every step in it.`;
8445
+ useEffect20(() => {
8446
+ mounted.current = true;
8447
+ return () => {
8448
+ mounted.current = false;
8449
+ if (copiedResetTimer.current !== null) clearTimeout(copiedResetTimer.current);
8450
+ };
8451
+ }, []);
8441
8452
  async function copy() {
8442
8453
  try {
8443
8454
  await navigator.clipboard.writeText(prompt);
8455
+ if (!mounted.current) return;
8456
+ if (copiedResetTimer.current !== null) clearTimeout(copiedResetTimer.current);
8457
+ setCopied(true);
8444
8458
  setNotice("Copied. Paste it into your coding agent.");
8459
+ copiedResetTimer.current = setTimeout(() => {
8460
+ setCopied(false);
8461
+ copiedResetTimer.current = null;
8462
+ }, 2e3);
8445
8463
  } catch {
8464
+ if (!mounted.current) return;
8465
+ if (copiedResetTimer.current !== null) clearTimeout(copiedResetTimer.current);
8466
+ copiedResetTimer.current = null;
8467
+ setCopied(false);
8446
8468
  setNotice(`Clipboard unavailable. Open ${setupUrl} and copy it from there.`);
8447
8469
  }
8448
8470
  }
@@ -8459,8 +8481,11 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
8459
8481
  {
8460
8482
  type: "button",
8461
8483
  onClick: copy,
8462
- className: "inline-flex items-center justify-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",
8463
- children: "Copy setup prompt"
8484
+ className: "inline-flex items-center justify-center gap-2 rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",
8485
+ children: copied ? /* @__PURE__ */ jsxs29(Fragment11, { children: [
8486
+ /* @__PURE__ */ jsx30(Check, { "aria-hidden": "true", className: "h-4 w-4" }),
8487
+ "Copied"
8488
+ ] }) : "Copy setup prompt"
8464
8489
  }
8465
8490
  )
8466
8491
  ] }),
@@ -8710,4 +8735,4 @@ export {
8710
8735
  AgentProfileChoices,
8711
8736
  ComposerProfilePill
8712
8737
  };
8713
- //# sourceMappingURL=chunk-DDYWECBU.js.map
8738
+ //# sourceMappingURL=chunk-TGSVYWIF.js.map