@tangle-network/agent-app 0.46.26 → 0.46.27
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/README.md +1 -1
- package/dist/studio-react/index.js +16 -2
- package/dist/studio-react/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ pnpm add @tangle-network/agent-eval @tangle-network/agent-integrations
|
|
|
36
36
|
| Peer | Required by | Range |
|
|
37
37
|
|---|---|---|
|
|
38
38
|
| `@tangle-network/agent-eval` | `/eval`, `/eval-campaign`, `/profile`, `/knowledge` | `>=0.170.0 <0.171.0` |
|
|
39
|
-
| `@tangle-network/agent-runtime` | `/runtime`, `/chat-routes` | `>=0.178.0 <0.
|
|
39
|
+
| `@tangle-network/agent-runtime` | `/runtime`, `/chat-routes` | `>=0.178.0 <0.183.0` |
|
|
40
40
|
| `@tangle-network/agent-integrations` | `/integrations` | `>=0.53.55 <0.54.0` |
|
|
41
41
|
| `@tangle-network/agent-interface` | `/interactions`, `/chat-store`, `/harness` | `^1.8.0` |
|
|
42
42
|
| `@tangle-network/sandbox` | `/sandbox` | `>=0.34.0 <0.35.0` |
|
|
@@ -2332,6 +2332,8 @@ function StudioToastProvider({ children }) {
|
|
|
2332
2332
|
const sequence = useRef7(0);
|
|
2333
2333
|
const dismissed = useRef7(/* @__PURE__ */ new Set());
|
|
2334
2334
|
const records = useRef7(/* @__PURE__ */ new Map());
|
|
2335
|
+
const removalTimers = useRef7(/* @__PURE__ */ new Set());
|
|
2336
|
+
const active = useRef7(true);
|
|
2335
2337
|
const leave = useCallback5((id, reason) => {
|
|
2336
2338
|
if (dismissed.current.has(id)) return;
|
|
2337
2339
|
const record = records.current.get(id);
|
|
@@ -2339,13 +2341,16 @@ function StudioToastProvider({ children }) {
|
|
|
2339
2341
|
dismissed.current.add(id);
|
|
2340
2342
|
record.onDismiss?.(reason);
|
|
2341
2343
|
setToasts((current) => current.map((toast2) => toast2.id === id ? { ...toast2, leaving: true } : toast2));
|
|
2342
|
-
window.setTimeout(() => {
|
|
2344
|
+
const timer = window.setTimeout(() => {
|
|
2345
|
+
removalTimers.current.delete(timer);
|
|
2343
2346
|
records.current.delete(id);
|
|
2344
2347
|
setToasts((current) => current.filter((toast2) => toast2.id !== id));
|
|
2345
2348
|
}, 180);
|
|
2349
|
+
removalTimers.current.add(timer);
|
|
2346
2350
|
}, []);
|
|
2347
2351
|
const toast = useCallback5((input) => {
|
|
2348
2352
|
const id = `studio-toast-${++sequence.current}`;
|
|
2353
|
+
if (!active.current) return id;
|
|
2349
2354
|
const record = { ...input, id, leaving: false };
|
|
2350
2355
|
records.current.set(id, record);
|
|
2351
2356
|
setToasts((current) => [...current, record]);
|
|
@@ -2353,7 +2358,16 @@ function StudioToastProvider({ children }) {
|
|
|
2353
2358
|
}, []);
|
|
2354
2359
|
const dismiss = useCallback5((id) => leave(id, "dismissed"), [leave]);
|
|
2355
2360
|
const value = useMemo5(() => ({ toast, dismiss, setDockLift }), [dismiss, toast]);
|
|
2356
|
-
useEffect9(() =>
|
|
2361
|
+
useEffect9(() => {
|
|
2362
|
+
setMounted(true);
|
|
2363
|
+
return () => {
|
|
2364
|
+
active.current = false;
|
|
2365
|
+
for (const timer of removalTimers.current) window.clearTimeout(timer);
|
|
2366
|
+
removalTimers.current.clear();
|
|
2367
|
+
records.current.clear();
|
|
2368
|
+
dismissed.current.clear();
|
|
2369
|
+
};
|
|
2370
|
+
}, []);
|
|
2357
2371
|
return /* @__PURE__ */ jsxs8(StudioToastContext.Provider, { value, children: [
|
|
2358
2372
|
children,
|
|
2359
2373
|
mounted && createPortal3(
|