@timbal-ai/timbal-react 0.6.0 → 0.7.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/CHANGELOG.md +37 -0
- package/README.md +24 -5
- package/dist/app.cjs +2282 -738
- package/dist/app.d.cts +4 -1
- package/dist/app.d.ts +4 -1
- package/dist/app.esm.js +58 -5
- package/dist/button-CIKzUrJI.d.cts +18 -0
- package/dist/button-CIKzUrJI.d.ts +18 -0
- package/dist/chart-artifact-BFDz8Tf9.d.ts +756 -0
- package/dist/chart-artifact-bWUa-iSG.d.cts +756 -0
- package/dist/chat.cjs +872 -562
- package/dist/chat.d.cts +2 -2
- package/dist/chat.d.ts +2 -2
- package/dist/chat.esm.js +3 -3
- package/dist/{chunk-4TCJQSIX.esm.js → chunk-2XZ3S4OP.esm.js} +14 -3
- package/dist/chunk-533MK5EA.esm.js +2294 -0
- package/dist/{chunk-OVHR7J3J.esm.js → chunk-7O5VY3TP.esm.js} +38 -11
- package/dist/{chunk-WLTW56MC.esm.js → chunk-N3PYVTY5.esm.js} +2 -2
- package/dist/{chunk-IYENDIRY.esm.js → chunk-TDIJHV4I.esm.js} +1 -1
- package/dist/{chunk-YJQLLFKP.esm.js → chunk-TLUF2RUL.esm.js} +813 -507
- package/dist/{chunk-OFHLFNJH.esm.js → chunk-Z27GBSOT.esm.js} +3 -1
- package/dist/index.cjs +2587 -1016
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.esm.js +57 -7
- package/dist/{layout-CQWngNQ7.d.ts → layout-BTJyU8wd.d.ts} +1 -1
- package/dist/{layout-B9VayJhZ.d.cts → layout-C2G-FcER.d.cts} +1 -1
- package/dist/studio.cjs +1127 -788
- package/dist/studio.d.cts +1 -1
- package/dist/studio.d.ts +1 -1
- package/dist/studio.esm.js +6 -6
- package/dist/{timbal-v2-button-F4-z7m33.d.ts → timbal-v2-button-CNfdwGq4.d.cts} +1 -1
- package/dist/{timbal-v2-button-F4-z7m33.d.cts → timbal-v2-button-CNfdwGq4.d.ts} +1 -1
- package/dist/ui.cjs +12 -3
- package/dist/ui.d.cts +5 -16
- package/dist/ui.d.ts +5 -16
- package/dist/ui.esm.js +2 -2
- package/dist/{welcome-BOizSp5h.d.ts → welcome-BBmB3tl7.d.ts} +4 -3
- package/dist/{welcome--80i_O0p.d.cts → welcome-C89Mgdaw.d.cts} +4 -3
- package/package.json +2 -1
- package/vite/local-dev.mjs +91 -5
- package/dist/chart-artifact-C71dk4xI.d.ts +0 -329
- package/dist/chart-artifact-CPEpOmtV.d.cts +0 -329
- package/dist/chunk-M4V6Q6XO.esm.js +0 -1082
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
studioSidebarEntryItemVariants,
|
|
18
18
|
studioSidebarWidthTransition,
|
|
19
19
|
useShellInsetReporter
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-Z27GBSOT.esm.js";
|
|
21
21
|
import {
|
|
22
22
|
WorkforceSelector
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-N3PYVTY5.esm.js";
|
|
24
24
|
import {
|
|
25
25
|
Composer,
|
|
26
26
|
TimbalChat,
|
|
@@ -43,10 +43,10 @@ import {
|
|
|
43
43
|
studioTopbarIconPillClass,
|
|
44
44
|
studioTopbarPillHeightClass,
|
|
45
45
|
useTimbalRuntime
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-TLUF2RUL.esm.js";
|
|
47
47
|
import {
|
|
48
48
|
PillSegmentedTabs
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-TDIJHV4I.esm.js";
|
|
50
50
|
import {
|
|
51
51
|
Avatar,
|
|
52
52
|
AvatarFallback,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
TooltipContent,
|
|
57
57
|
TooltipTrigger,
|
|
58
58
|
cn
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-2XZ3S4OP.esm.js";
|
|
60
60
|
|
|
61
61
|
// src/hooks/use-workforces.ts
|
|
62
62
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -1452,9 +1452,29 @@ var TimbalStudioShell = ({
|
|
|
1452
1452
|
};
|
|
1453
1453
|
|
|
1454
1454
|
// src/studio/sidebar/mode-toggle.tsx
|
|
1455
|
-
import { useCallback as useCallback6,
|
|
1455
|
+
import { useCallback as useCallback6, useLayoutEffect as useLayoutEffect3, useState as useState7 } from "react";
|
|
1456
1456
|
import { Moon, Sun } from "lucide-react";
|
|
1457
1457
|
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1458
|
+
function readStoredTheme() {
|
|
1459
|
+
if (typeof window === "undefined") return null;
|
|
1460
|
+
try {
|
|
1461
|
+
const value = window.localStorage.getItem(STORAGE_KEYS.theme);
|
|
1462
|
+
return value === "dark" || value === "light" ? value : null;
|
|
1463
|
+
} catch {
|
|
1464
|
+
return null;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
function writeStoredTheme(theme) {
|
|
1468
|
+
if (typeof window === "undefined") return;
|
|
1469
|
+
try {
|
|
1470
|
+
window.localStorage.setItem(STORAGE_KEYS.theme, theme);
|
|
1471
|
+
} catch {
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1474
|
+
function applyDarkClass(isDark) {
|
|
1475
|
+
if (typeof document === "undefined") return;
|
|
1476
|
+
document.documentElement.classList.toggle("dark", isDark);
|
|
1477
|
+
}
|
|
1458
1478
|
var ModeToggle = ({
|
|
1459
1479
|
theme,
|
|
1460
1480
|
setTheme,
|
|
@@ -1463,9 +1483,15 @@ var ModeToggle = ({
|
|
|
1463
1483
|
}) => {
|
|
1464
1484
|
const isControlled = theme !== void 0;
|
|
1465
1485
|
const [internalIsDark, setInternalIsDark] = useState7(false);
|
|
1466
|
-
|
|
1486
|
+
useLayoutEffect3(() => {
|
|
1467
1487
|
if (isControlled) return;
|
|
1468
|
-
|
|
1488
|
+
const stored = readStoredTheme();
|
|
1489
|
+
if (stored) {
|
|
1490
|
+
const isDark2 = stored === "dark";
|
|
1491
|
+
applyDarkClass(isDark2);
|
|
1492
|
+
setInternalIsDark(isDark2);
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1469
1495
|
setInternalIsDark(document.documentElement.classList.contains("dark"));
|
|
1470
1496
|
}, [isControlled]);
|
|
1471
1497
|
const isDark = isControlled ? theme === "dark" : internalIsDark;
|
|
@@ -1475,9 +1501,10 @@ var ModeToggle = ({
|
|
|
1475
1501
|
setTheme(next);
|
|
1476
1502
|
return;
|
|
1477
1503
|
}
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1504
|
+
const isDarkNext = next === "dark";
|
|
1505
|
+
applyDarkClass(isDarkNext);
|
|
1506
|
+
writeStoredTheme(isDarkNext ? "dark" : "light");
|
|
1507
|
+
setInternalIsDark(isDarkNext);
|
|
1481
1508
|
}, [isDark, setTheme]);
|
|
1482
1509
|
return /* @__PURE__ */ jsxs9(
|
|
1483
1510
|
TimbalV2Button,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
studioSecondaryChromeClass,
|
|
3
3
|
studioTopbarPillHeightClass
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TLUF2RUL.esm.js";
|
|
5
5
|
import {
|
|
6
6
|
cn
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2XZ3S4OP.esm.js";
|
|
8
8
|
|
|
9
9
|
// src/chat/workforce-selector.tsx
|
|
10
10
|
import { ChevronDownIcon } from "lucide-react";
|