reifyui 0.13.8 → 0.14.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.
- package/README.md +39 -0
- package/dist/agent-chat.cjs +2046 -0
- package/dist/agent-chat.cjs.map +1 -0
- package/dist/agent-chat.d.ts +190 -0
- package/dist/agent-chat.js +1952 -0
- package/dist/agent-chat.js.map +1 -0
- package/dist/chunk-AGSX5YKH.js +177 -0
- package/dist/chunk-AGSX5YKH.js.map +1 -0
- package/dist/chunk-WAND7AYD.js +124 -0
- package/dist/chunk-WAND7AYD.js.map +1 -0
- package/dist/graph.js +2 -1
- package/dist/graph.js.map +1 -1
- package/dist/index.cjs +29 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +34 -11
- package/dist/index.js.map +1 -1
- package/package.json +11 -2
- package/src/agent-chat/components.jsx +777 -0
- package/src/agent-chat/index.d.ts +190 -0
- package/src/agent-chat/index.js +24 -0
- package/src/agent-chat/marks.js +51 -0
- package/src/agent-chat/time.js +55 -0
- package/src/agent-chat/tools.js +357 -0
- package/src/agent-chat/turn.js +476 -0
- package/src/auth/GoogleButton.jsx +24 -4
- package/styles/agent-chat.css +306 -0
- package/dist/chunk-J7SECRIG.js +0 -295
- package/dist/chunk-J7SECRIG.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2363,6 +2363,24 @@ function GoogleButton({ onCredential, onError, divider = true }) {
|
|
|
2363
2363
|
if (!CLIENT_ID || !ref.current) return void 0;
|
|
2364
2364
|
const SRC = "https://accounts.google.com/gsi/client";
|
|
2365
2365
|
let done = false;
|
|
2366
|
+
let drawn = 0;
|
|
2367
|
+
let observer = null;
|
|
2368
|
+
const draw = () => {
|
|
2369
|
+
const g = window.google;
|
|
2370
|
+
if (!g?.accounts?.id || !ref.current) return;
|
|
2371
|
+
const box = ref.current.getBoundingClientRect().width || 320;
|
|
2372
|
+
const width = Math.round(Math.max(200, Math.min(400, box)));
|
|
2373
|
+
if (Math.abs(width - drawn) < 2) return;
|
|
2374
|
+
drawn = width;
|
|
2375
|
+
ref.current.innerHTML = "";
|
|
2376
|
+
g.accounts.id.renderButton(ref.current, {
|
|
2377
|
+
theme: "outline",
|
|
2378
|
+
size: "large",
|
|
2379
|
+
shape: "pill",
|
|
2380
|
+
text: "continue_with",
|
|
2381
|
+
width
|
|
2382
|
+
});
|
|
2383
|
+
};
|
|
2366
2384
|
const render = () => {
|
|
2367
2385
|
if (done) return;
|
|
2368
2386
|
const g = window.google;
|
|
@@ -2376,14 +2394,16 @@ function GoogleButton({ onCredential, onError, divider = true }) {
|
|
|
2376
2394
|
else cb.current.onError?.("Google sign in was cancelled.");
|
|
2377
2395
|
}
|
|
2378
2396
|
});
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2397
|
+
draw();
|
|
2398
|
+
if (typeof ResizeObserver === "function") {
|
|
2399
|
+
observer = new ResizeObserver(() => {
|
|
2400
|
+
try {
|
|
2401
|
+
draw();
|
|
2402
|
+
} catch {
|
|
2403
|
+
}
|
|
2404
|
+
});
|
|
2405
|
+
observer.observe(ref.current);
|
|
2406
|
+
}
|
|
2387
2407
|
} catch {
|
|
2388
2408
|
setFailed(true);
|
|
2389
2409
|
}
|
|
@@ -2407,6 +2427,7 @@ function GoogleButton({ onCredential, onError, divider = true }) {
|
|
|
2407
2427
|
return () => {
|
|
2408
2428
|
s?.removeEventListener("load", render);
|
|
2409
2429
|
window.clearTimeout(check);
|
|
2430
|
+
observer?.disconnect();
|
|
2410
2431
|
};
|
|
2411
2432
|
}, []);
|
|
2412
2433
|
if (!CLIENT_ID || failed) return null;
|