@frankieai/react 0.2.5 → 0.2.6
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/dist/frankie.css +1 -1
- package/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/FrankieChatPage.tsx +13 -2
- package/src/styles/frankie.css +6 -1
- package/src/widget.test.tsx +34 -1
package/dist/index.js
CHANGED
|
@@ -1333,7 +1333,7 @@ function FrankieInline({ className, style, ...panelProps }) {
|
|
|
1333
1333
|
|
|
1334
1334
|
// src/components/chat/FrankieChatPage.tsx
|
|
1335
1335
|
import { useCallback as useCallback3, useEffect as useEffect6, useRef as useRef5, useState as useState7 } from "react";
|
|
1336
|
-
import { History, Menu, Plus as Plus2, Settings, X as X5 } from "lucide-react";
|
|
1336
|
+
import { ChevronsLeft, ChevronsRight, History, Menu, Plus as Plus2, Settings, X as X5 } from "lucide-react";
|
|
1337
1337
|
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1338
1338
|
function PageEmptyState() {
|
|
1339
1339
|
const { config } = useFrankie();
|
|
@@ -1360,6 +1360,13 @@ function PageChrome({ showHistory, navigation, currentId, onSelect, onNew, ...pa
|
|
|
1360
1360
|
const [historyError, setHistoryError] = useState7("");
|
|
1361
1361
|
const [historyLoading, setHistoryLoading] = useState7(false);
|
|
1362
1362
|
const [drawerOpen, setDrawerOpen] = useState7(false);
|
|
1363
|
+
const [collapsed, setCollapsed] = useState7(() => {
|
|
1364
|
+
try {
|
|
1365
|
+
return window.localStorage.getItem("frankie.history-collapsed") === "1";
|
|
1366
|
+
} catch {
|
|
1367
|
+
return false;
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1363
1370
|
const [query, setQuery] = useState7("");
|
|
1364
1371
|
const dialog = useRef5(null);
|
|
1365
1372
|
const menu = useRef5(null);
|
|
@@ -1391,6 +1398,12 @@ function PageChrome({ showHistory, navigation, currentId, onSelect, onNew, ...pa
|
|
|
1391
1398
|
requestVersion.current++;
|
|
1392
1399
|
};
|
|
1393
1400
|
}, [refresh, busy]);
|
|
1401
|
+
useEffect6(() => {
|
|
1402
|
+
try {
|
|
1403
|
+
window.localStorage.setItem("frankie.history-collapsed", collapsed ? "1" : "0");
|
|
1404
|
+
} catch {
|
|
1405
|
+
}
|
|
1406
|
+
}, [collapsed]);
|
|
1394
1407
|
useEffect6(() => {
|
|
1395
1408
|
const node = dialog.current;
|
|
1396
1409
|
if (drawerOpen) {
|
|
@@ -1436,7 +1449,10 @@ function PageChrome({ showHistory, navigation, currentId, onSelect, onNew, ...pa
|
|
|
1436
1449
|
navigation ? /* @__PURE__ */ jsx17("div", { className: "frankie-host-navigation", children: navigation }) : null
|
|
1437
1450
|
] });
|
|
1438
1451
|
return /* @__PURE__ */ jsxs7("div", { className: "frankie-page-shell" + (resolveMode(theme?.mode) === "dark" ? " dark" : ""), style: themeToCssVars(theme), children: [
|
|
1439
|
-
showHistory ? /* @__PURE__ */
|
|
1452
|
+
showHistory ? /* @__PURE__ */ jsxs7("aside", { className: "frankie-history-desktop" + (collapsed ? " frankie-history-collapsed" : ""), children: [
|
|
1453
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: "frankie-history-toggle", "aria-label": collapsed ? "Expand conversations" : "Collapse conversations", "aria-expanded": !collapsed, onClick: () => setCollapsed((value) => !value), children: collapsed ? /* @__PURE__ */ jsx17(ChevronsRight, { size: 16 }) : /* @__PURE__ */ jsx17(ChevronsLeft, { size: 16 }) }),
|
|
1454
|
+
collapsed ? null : history
|
|
1455
|
+
] }) : null,
|
|
1440
1456
|
/* @__PURE__ */ jsxs7("div", { className: "frankie-page-main", children: [
|
|
1441
1457
|
/* @__PURE__ */ jsxs7("header", { className: "frankie-page-header", children: [
|
|
1442
1458
|
/* @__PURE__ */ jsxs7("div", { children: [
|