@axiom-lattice/react-sdk 2.1.26 → 2.1.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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +25 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4757,7 +4757,8 @@ var DEFAULT_CONFIG = {
|
|
|
4757
4757
|
timeout: 3e5,
|
|
4758
4758
|
headers: {},
|
|
4759
4759
|
enableThreadCreation: true,
|
|
4760
|
-
enableThreadList: true
|
|
4760
|
+
enableThreadList: true,
|
|
4761
|
+
showSideMenu: true
|
|
4761
4762
|
};
|
|
4762
4763
|
var LatticeChatShellContext = (0, import_react20.createContext)({
|
|
4763
4764
|
config: DEFAULT_CONFIG,
|
|
@@ -6655,6 +6656,9 @@ var AgentConversations = ({
|
|
|
6655
6656
|
);
|
|
6656
6657
|
};
|
|
6657
6658
|
|
|
6659
|
+
// src/components/Chat/LatticeChatView.tsx
|
|
6660
|
+
var import_react38 = require("react");
|
|
6661
|
+
|
|
6658
6662
|
// src/components/Chat/ChatSidebar.tsx
|
|
6659
6663
|
var import_react37 = require("react");
|
|
6660
6664
|
var import_antd34 = require("antd");
|
|
@@ -9932,6 +9936,8 @@ var ChatSidebar = ({
|
|
|
9932
9936
|
// src/components/Chat/LatticeChatView.tsx
|
|
9933
9937
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
9934
9938
|
var LatticeChatView = (props) => {
|
|
9939
|
+
const shellContext = (0, import_react38.useContext)(LatticeChatShellContext);
|
|
9940
|
+
const { showSideMenu } = shellContext.config;
|
|
9935
9941
|
const { assistantId, thread } = useConversationContext();
|
|
9936
9942
|
const { currentAssistant } = useAssistantContext();
|
|
9937
9943
|
const {
|
|
@@ -9953,7 +9959,7 @@ var LatticeChatView = (props) => {
|
|
|
9953
9959
|
assistant_id: assistantId,
|
|
9954
9960
|
name: currentAssistant?.name,
|
|
9955
9961
|
description: currentAssistant?.description,
|
|
9956
|
-
menu: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChatSidebar, {})
|
|
9962
|
+
menu: showSideMenu ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChatSidebar, {}) : void 0
|
|
9957
9963
|
}
|
|
9958
9964
|
)
|
|
9959
9965
|
}
|
|
@@ -9961,7 +9967,7 @@ var LatticeChatView = (props) => {
|
|
|
9961
9967
|
};
|
|
9962
9968
|
|
|
9963
9969
|
// src/components/Chat/SettingsModal.tsx
|
|
9964
|
-
var
|
|
9970
|
+
var import_react39 = require("react");
|
|
9965
9971
|
var import_antd35 = require("antd");
|
|
9966
9972
|
var import_icons22 = require("@ant-design/icons");
|
|
9967
9973
|
var import_antd_style14 = require("antd-style");
|
|
@@ -10328,7 +10334,7 @@ var SettingsModal = ({
|
|
|
10328
10334
|
}) => {
|
|
10329
10335
|
const { styles } = useStyles5();
|
|
10330
10336
|
const { config: shellConfig, updateConfigValue } = useLatticeChatShellContext();
|
|
10331
|
-
const [connections, setConnections] = (0,
|
|
10337
|
+
const [connections, setConnections] = (0, import_react39.useState)(() => {
|
|
10332
10338
|
if (typeof window !== "undefined") {
|
|
10333
10339
|
try {
|
|
10334
10340
|
const stored = localStorage.getItem("lattice_server_connections");
|
|
@@ -10351,21 +10357,21 @@ var SettingsModal = ({
|
|
|
10351
10357
|
}
|
|
10352
10358
|
return [];
|
|
10353
10359
|
});
|
|
10354
|
-
const [serverConfigs, setServerConfigs] = (0,
|
|
10355
|
-
const connectionsRef = (0,
|
|
10356
|
-
(0,
|
|
10360
|
+
const [serverConfigs, setServerConfigs] = (0, import_react39.useState)({});
|
|
10361
|
+
const connectionsRef = (0, import_react39.useRef)(connections);
|
|
10362
|
+
(0, import_react39.useEffect)(() => {
|
|
10357
10363
|
connectionsRef.current = connections;
|
|
10358
10364
|
}, [connections]);
|
|
10359
|
-
const [activeTabKey, setActiveTabKey] = (0,
|
|
10365
|
+
const [activeTabKey, setActiveTabKey] = (0, import_react39.useState)(
|
|
10360
10366
|
connections.length > 0 ? connections[0].id : ""
|
|
10361
10367
|
);
|
|
10362
|
-
const [activeMenu, setActiveMenu] = (0,
|
|
10363
|
-
const [loading, setLoading] = (0,
|
|
10364
|
-
const [showAddServerModal, setShowAddServerModal] = (0,
|
|
10365
|
-
const [newServerUrl, setNewServerUrl] = (0,
|
|
10366
|
-
const [newServerName, setNewServerName] = (0,
|
|
10367
|
-
const [newServerApiKey, setNewServerApiKey] = (0,
|
|
10368
|
-
const [addingServer, setAddingServer] = (0,
|
|
10368
|
+
const [activeMenu, setActiveMenu] = (0, import_react39.useState)("environment");
|
|
10369
|
+
const [loading, setLoading] = (0, import_react39.useState)(false);
|
|
10370
|
+
const [showAddServerModal, setShowAddServerModal] = (0, import_react39.useState)(false);
|
|
10371
|
+
const [newServerUrl, setNewServerUrl] = (0, import_react39.useState)("");
|
|
10372
|
+
const [newServerName, setNewServerName] = (0, import_react39.useState)("");
|
|
10373
|
+
const [newServerApiKey, setNewServerApiKey] = (0, import_react39.useState)("");
|
|
10374
|
+
const [addingServer, setAddingServer] = (0, import_react39.useState)(false);
|
|
10369
10375
|
const saveConnections = (newConnections) => {
|
|
10370
10376
|
setConnections(newConnections);
|
|
10371
10377
|
if (typeof window !== "undefined") {
|
|
@@ -10555,7 +10561,7 @@ var SettingsModal = ({
|
|
|
10555
10561
|
console.error("Failed to load models configuration:", error);
|
|
10556
10562
|
}
|
|
10557
10563
|
};
|
|
10558
|
-
(0,
|
|
10564
|
+
(0, import_react39.useEffect)(() => {
|
|
10559
10565
|
if (open && activeTabKey) {
|
|
10560
10566
|
initializeServerConfig(activeTabKey);
|
|
10561
10567
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
@@ -10564,7 +10570,7 @@ var SettingsModal = ({
|
|
|
10564
10570
|
}
|
|
10565
10571
|
}
|
|
10566
10572
|
}, [open, activeTabKey]);
|
|
10567
|
-
(0,
|
|
10573
|
+
(0, import_react39.useEffect)(() => {
|
|
10568
10574
|
if (open && activeTabKey) {
|
|
10569
10575
|
const connection = connections.find((c) => c.id === activeTabKey);
|
|
10570
10576
|
if (connection?.connected) {
|
|
@@ -11298,8 +11304,9 @@ var AgentServerSetting = () => {
|
|
|
11298
11304
|
// src/components/Chat/LatticeChatShell.tsx
|
|
11299
11305
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
11300
11306
|
var LatticeChatShell = (props) => {
|
|
11307
|
+
const { initialConfig } = props;
|
|
11301
11308
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(LatticeChatShellContextProvider, { ...props, children: [
|
|
11302
|
-
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AssistantContextProvider, { autoLoad: true, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(LatticeChatView, {}) }) }),
|
|
11309
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId: initialConfig?.assistantId, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(LatticeChatView, {}) }) }),
|
|
11303
11310
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(AgentServerSetting, {})
|
|
11304
11311
|
] });
|
|
11305
11312
|
};
|