@axiom-lattice/react-sdk 2.1.94 → 2.1.95
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.js +168 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -171
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -220,8 +220,8 @@ var AuthProvider = ({
|
|
|
220
220
|
onLoginSuccess?.(userData, tenantList || []);
|
|
221
221
|
return { requiresTenantSelection, hasTenants };
|
|
222
222
|
} catch (err) {
|
|
223
|
-
const
|
|
224
|
-
setError(
|
|
223
|
+
const message28 = err instanceof Error ? err.message : "Login failed";
|
|
224
|
+
setError(message28);
|
|
225
225
|
throw err;
|
|
226
226
|
} finally {
|
|
227
227
|
setIsLoading(false);
|
|
@@ -245,8 +245,8 @@ var AuthProvider = ({
|
|
|
245
245
|
}
|
|
246
246
|
return { message: data.message || "Registration successful!", token: data.data?.token };
|
|
247
247
|
} catch (err) {
|
|
248
|
-
const
|
|
249
|
-
setError(
|
|
248
|
+
const message28 = err instanceof Error ? err.message : "Registration failed";
|
|
249
|
+
setError(message28);
|
|
250
250
|
throw err;
|
|
251
251
|
} finally {
|
|
252
252
|
setIsLoading(false);
|
|
@@ -305,8 +305,8 @@ var AuthProvider = ({
|
|
|
305
305
|
}
|
|
306
306
|
onTenantSelected?.(tenantData);
|
|
307
307
|
} catch (err) {
|
|
308
|
-
const
|
|
309
|
-
setError(
|
|
308
|
+
const message28 = err instanceof Error ? err.message : "Failed to select tenant";
|
|
309
|
+
setError(message28);
|
|
310
310
|
throw err;
|
|
311
311
|
} finally {
|
|
312
312
|
setIsLoading(false);
|
|
@@ -345,8 +345,8 @@ var AuthProvider = ({
|
|
|
345
345
|
setTenants(tenantList);
|
|
346
346
|
sessionStorage.setItem("lattice_tenants", JSON.stringify(tenantList));
|
|
347
347
|
} catch (err) {
|
|
348
|
-
const
|
|
349
|
-
setError(
|
|
348
|
+
const message28 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
349
|
+
setError(message28);
|
|
350
350
|
} finally {
|
|
351
351
|
setIsLoading(false);
|
|
352
352
|
}
|
|
@@ -376,8 +376,8 @@ var AuthProvider = ({
|
|
|
376
376
|
setUser(data);
|
|
377
377
|
sessionStorage.setItem("lattice_user", JSON.stringify(data));
|
|
378
378
|
} catch (err) {
|
|
379
|
-
const
|
|
380
|
-
setError(
|
|
379
|
+
const message28 = err instanceof Error ? err.message : "Failed to refresh user";
|
|
380
|
+
setError(message28);
|
|
381
381
|
} finally {
|
|
382
382
|
setIsLoading(false);
|
|
383
383
|
}
|
|
@@ -413,8 +413,8 @@ var AuthProvider = ({
|
|
|
413
413
|
const result = await response.json();
|
|
414
414
|
return result;
|
|
415
415
|
} catch (err) {
|
|
416
|
-
const
|
|
417
|
-
setError(
|
|
416
|
+
const message28 = err instanceof Error ? err.message : "Failed to change password";
|
|
417
|
+
setError(message28);
|
|
418
418
|
throw err;
|
|
419
419
|
} finally {
|
|
420
420
|
setIsLoading(false);
|
|
@@ -633,7 +633,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
633
633
|
throw new Error("Thread ID is required to send messages");
|
|
634
634
|
}
|
|
635
635
|
const { input, command, streaming = true } = data;
|
|
636
|
-
const { message:
|
|
636
|
+
const { message: message28, files, ...rest } = input || {};
|
|
637
637
|
setState((prev) => ({
|
|
638
638
|
...prev,
|
|
639
639
|
isLoading: true,
|
|
@@ -642,7 +642,7 @@ function useChat(threadId, assistantId, options = {}) {
|
|
|
642
642
|
}));
|
|
643
643
|
const userMessage = {
|
|
644
644
|
id: (0, import_uuid.v4)(),
|
|
645
|
-
content:
|
|
645
|
+
content: message28 || command?.resume?.message || "",
|
|
646
646
|
files,
|
|
647
647
|
role: "human"
|
|
648
648
|
};
|
|
@@ -1649,8 +1649,8 @@ function convertThreadToConversationThread(thread, label) {
|
|
|
1649
1649
|
function getThreadMetadata(label) {
|
|
1650
1650
|
return label ? { label } : {};
|
|
1651
1651
|
}
|
|
1652
|
-
function generateLabelFromMessage(
|
|
1653
|
-
const cleanMessage =
|
|
1652
|
+
function generateLabelFromMessage(message28) {
|
|
1653
|
+
const cleanMessage = message28.replace(/```attachments[\s\S]*?```/g, "").trim();
|
|
1654
1654
|
if (!cleanMessage) {
|
|
1655
1655
|
return "";
|
|
1656
1656
|
}
|
|
@@ -2123,7 +2123,7 @@ function AgentThreadProvider({
|
|
|
2123
2123
|
throw new Error("Thread ID is required to send messages");
|
|
2124
2124
|
}
|
|
2125
2125
|
const { input, command, streaming = true, mode } = data;
|
|
2126
|
-
const { message:
|
|
2126
|
+
const { message: message28, files, ...rest } = input || {};
|
|
2127
2127
|
setState((prev) => ({
|
|
2128
2128
|
...prev,
|
|
2129
2129
|
isLoading: true,
|
|
@@ -2132,7 +2132,7 @@ function AgentThreadProvider({
|
|
|
2132
2132
|
}));
|
|
2133
2133
|
const userMessage = {
|
|
2134
2134
|
id: (0, import_uuid2.v4)(),
|
|
2135
|
-
content:
|
|
2135
|
+
content: message28 || command?.resume?.message || "",
|
|
2136
2136
|
files,
|
|
2137
2137
|
role: "human"
|
|
2138
2138
|
};
|
|
@@ -2150,8 +2150,8 @@ function AgentThreadProvider({
|
|
|
2150
2150
|
]
|
|
2151
2151
|
}));
|
|
2152
2152
|
const isFirstMessage = messageCountRef.current === 0;
|
|
2153
|
-
if (isFirstMessage &&
|
|
2154
|
-
const label = generateLabelFromMessage(
|
|
2153
|
+
if (isFirstMessage && message28 && conversationContext) {
|
|
2154
|
+
const label = generateLabelFromMessage(message28);
|
|
2155
2155
|
if (label) {
|
|
2156
2156
|
conversationContext.updateThread({
|
|
2157
2157
|
id: threadId,
|
|
@@ -4048,8 +4048,8 @@ function useTenants(options) {
|
|
|
4048
4048
|
const { data } = await response.json();
|
|
4049
4049
|
setTenants(data || []);
|
|
4050
4050
|
} catch (err) {
|
|
4051
|
-
const
|
|
4052
|
-
setError(
|
|
4051
|
+
const message28 = err instanceof Error ? err.message : "Failed to fetch tenants";
|
|
4052
|
+
setError(message28);
|
|
4053
4053
|
} finally {
|
|
4054
4054
|
setIsLoading(false);
|
|
4055
4055
|
}
|
|
@@ -4091,8 +4091,8 @@ function useUsers(options) {
|
|
|
4091
4091
|
const { data } = await response.json();
|
|
4092
4092
|
setUsers(data || []);
|
|
4093
4093
|
} catch (err) {
|
|
4094
|
-
const
|
|
4095
|
-
setError(
|
|
4094
|
+
const message28 = err instanceof Error ? err.message : "Failed to fetch users";
|
|
4095
|
+
setError(message28);
|
|
4096
4096
|
} finally {
|
|
4097
4097
|
setIsLoading(false);
|
|
4098
4098
|
}
|
|
@@ -13451,11 +13451,11 @@ var ConfirmFeedback = ({
|
|
|
13451
13451
|
data,
|
|
13452
13452
|
interactive = true
|
|
13453
13453
|
}) => {
|
|
13454
|
-
const { message:
|
|
13454
|
+
const { message: message28, type, config, feedback, options } = data ?? {};
|
|
13455
13455
|
const { sendMessage } = useAgentChat();
|
|
13456
13456
|
const [clicked, setClicked] = (0, import_react42.useState)(false);
|
|
13457
13457
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_antd23.Space, { direction: "vertical", style: { width: "100%" }, children: [
|
|
13458
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MDResponse, { content:
|
|
13458
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MDResponse, { content: message28 }),
|
|
13459
13459
|
options ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_antd23.Space, { style: { justifyContent: "flex-end", width: "100%" }, children: options?.map((option) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
13460
13460
|
import_antd23.Button,
|
|
13461
13461
|
{
|
|
@@ -13778,7 +13778,7 @@ var useSideAppOpener = () => {
|
|
|
13778
13778
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
13779
13779
|
var { Text: Text16 } = import_antd25.Typography;
|
|
13780
13780
|
var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = true }) => {
|
|
13781
|
-
const { dataSource, message:
|
|
13781
|
+
const { dataSource, message: message28 } = data ?? {};
|
|
13782
13782
|
const [expandedRowKeys, setExpandedRowKeys] = (0, import_react45.useState)([]);
|
|
13783
13783
|
const openSideApp = useSideAppOpener();
|
|
13784
13784
|
const processedData = dataSource?.map((item, index) => ({
|
|
@@ -13877,7 +13877,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
13877
13877
|
type: "text/csv;charset=utf-8;"
|
|
13878
13878
|
});
|
|
13879
13879
|
const link = document.createElement("a");
|
|
13880
|
-
const filename = `${
|
|
13880
|
+
const filename = `${message28 || "data"}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`;
|
|
13881
13881
|
link.href = URL.createObjectURL(blob);
|
|
13882
13882
|
link.download = filename;
|
|
13883
13883
|
document.body.appendChild(link);
|
|
@@ -13898,7 +13898,7 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
13898
13898
|
tableLayout: "fixed",
|
|
13899
13899
|
style: { width: "100% !important" },
|
|
13900
13900
|
title: () => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_antd25.Flex, { justify: "space-between", align: "center", children: [
|
|
13901
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_antd25.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text16, { strong: true, style: { fontSize: 16 }, children:
|
|
13901
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_antd25.Space, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text16, { strong: true, style: { fontSize: 16 }, children: message28 || "" }) }),
|
|
13902
13902
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_antd25.Space, { children: [
|
|
13903
13903
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
13904
13904
|
import_antd25.Button,
|
|
@@ -13920,8 +13920,8 @@ var GenericDataTable = ({ data, interactive = true, default_open_in_side_app = t
|
|
|
13920
13920
|
onClick: () => {
|
|
13921
13921
|
openSideApp({
|
|
13922
13922
|
component_key: "generic_data_table",
|
|
13923
|
-
message:
|
|
13924
|
-
data: { dataSource, message:
|
|
13923
|
+
message: message28 || "",
|
|
13924
|
+
data: { dataSource, message: message28 }
|
|
13925
13925
|
});
|
|
13926
13926
|
},
|
|
13927
13927
|
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons12.ExpandAltOutlined, {})
|
|
@@ -15695,6 +15695,8 @@ var ShareModal = ({
|
|
|
15695
15695
|
onUpdated
|
|
15696
15696
|
}) => {
|
|
15697
15697
|
const { shareFile } = useWorkspaceContext();
|
|
15698
|
+
const { config: shellConfig } = useLatticeChatShellContext();
|
|
15699
|
+
const baseURL = (shellConfig?.baseURL ?? "").replace(/\/$/, "");
|
|
15698
15700
|
const isEditMode = !!existingToken;
|
|
15699
15701
|
const [state, setState] = (0, import_react51.useState)(isEditMode ? "edit" : "creating");
|
|
15700
15702
|
const [token, setToken] = (0, import_react51.useState)(existingToken ?? "");
|
|
@@ -15736,13 +15738,18 @@ var ShareModal = ({
|
|
|
15736
15738
|
shareFile
|
|
15737
15739
|
]);
|
|
15738
15740
|
const handleCopy = (0, import_react51.useCallback)(() => {
|
|
15739
|
-
const fullUrl = `${
|
|
15740
|
-
|
|
15741
|
+
const fullUrl = `${baseURL}${url}`;
|
|
15742
|
+
const titleText = title ? `${title}
|
|
15743
|
+
` : "";
|
|
15744
|
+
const pwdText = visibility === "password" && password ? `Password: ${password}
|
|
15745
|
+
` : "";
|
|
15746
|
+
navigator.clipboard.writeText(`${titleText}${fullUrl}
|
|
15747
|
+
${pwdText}`.trim());
|
|
15741
15748
|
import_antd34.message.success("Copied to clipboard");
|
|
15742
|
-
}, [url]);
|
|
15749
|
+
}, [url, baseURL, title, visibility, password]);
|
|
15743
15750
|
const handleOpen = (0, import_react51.useCallback)(() => {
|
|
15744
|
-
window.open(url
|
|
15745
|
-
}, [url]);
|
|
15751
|
+
window.open(`${baseURL}${url}`, "_blank");
|
|
15752
|
+
}, [url, baseURL]);
|
|
15746
15753
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
15747
15754
|
import_antd34.Modal,
|
|
15748
15755
|
{
|
|
@@ -15809,7 +15816,7 @@ var ShareModal = ({
|
|
|
15809
15816
|
!isEditMode && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd34.Button, { type: "primary", block: true, onClick: handleShare, children: "Create Share" })
|
|
15810
15817
|
] }),
|
|
15811
15818
|
state === "result" && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_antd34.Space, { direction: "vertical", style: { width: "100%" }, size: "middle", children: [
|
|
15812
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd34.Input, { value: url
|
|
15819
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd34.Input, { value: `${baseURL}${url}`, readOnly: true, style: { fontFamily: "monospace" } }),
|
|
15813
15820
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_antd34.Space, { children: [
|
|
15814
15821
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd34.Button, { icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons21.CopyOutlined, {}), onClick: handleCopy, children: "Copy" }),
|
|
15815
15822
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd34.Button, { type: "primary", icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_icons21.LinkOutlined, {}), onClick: handleOpen, children: "Open" })
|
|
@@ -16467,7 +16474,7 @@ var import_ErrorBoundary = __toESM(require("antd/es/alert/ErrorBoundary"));
|
|
|
16467
16474
|
var import_react54 = require("react");
|
|
16468
16475
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
16469
16476
|
var LazyBubble = ({
|
|
16470
|
-
message:
|
|
16477
|
+
message: message28,
|
|
16471
16478
|
renderContent,
|
|
16472
16479
|
autoLoadRightPanel
|
|
16473
16480
|
}) => {
|
|
@@ -16498,10 +16505,10 @@ var LazyBubble = ({
|
|
|
16498
16505
|
autoLoadRightPanel?.();
|
|
16499
16506
|
}, []);
|
|
16500
16507
|
const getPlaceholder = () => {
|
|
16501
|
-
const estimatedHeight =
|
|
16508
|
+
const estimatedHeight = message28.content ? Math.min(100, message28.content.length / 5) : 100;
|
|
16502
16509
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { style: { height: `${estimatedHeight}px`, minHeight: "50px" } });
|
|
16503
16510
|
};
|
|
16504
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(
|
|
16511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_ErrorBoundary.default, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ref, style: { width: "100%" }, children: isVisible || wasEverVisible ? renderContent(message28) : getPlaceholder() }) });
|
|
16505
16512
|
};
|
|
16506
16513
|
var MemoizedBubbleList = (0, import_react54.memo)(
|
|
16507
16514
|
({
|
|
@@ -16532,8 +16539,8 @@ var MessageList = ({
|
|
|
16532
16539
|
messageLengthRef.current = messages?.length;
|
|
16533
16540
|
}
|
|
16534
16541
|
}, [messages?.length]);
|
|
16535
|
-
const renderContent = (0, import_react54.useCallback)((
|
|
16536
|
-
const { content } =
|
|
16542
|
+
const renderContent = (0, import_react54.useCallback)((message28) => {
|
|
16543
|
+
const { content } = message28;
|
|
16537
16544
|
try {
|
|
16538
16545
|
const json = JSON.parse(content);
|
|
16539
16546
|
if (json.action && json.message) {
|
|
@@ -16541,7 +16548,7 @@ var MessageList = ({
|
|
|
16541
16548
|
}
|
|
16542
16549
|
} catch (error) {
|
|
16543
16550
|
}
|
|
16544
|
-
const tool_calls_md =
|
|
16551
|
+
const tool_calls_md = message28.tool_calls?.map((tool_call) => {
|
|
16545
16552
|
return `\`\`\`tool_call
|
|
16546
16553
|
${JSON.stringify(tool_call)}
|
|
16547
16554
|
\`\`\``;
|
|
@@ -16550,17 +16557,17 @@ ${JSON.stringify(tool_call)}
|
|
|
16550
16557
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_antd40.Space, { direction: "vertical", style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(MDResponse, { content: content_md }) });
|
|
16551
16558
|
}, []);
|
|
16552
16559
|
const items = (0, import_react54.useMemo)(
|
|
16553
|
-
() => messages.map((
|
|
16554
|
-
key:
|
|
16555
|
-
role:
|
|
16560
|
+
() => messages.map((message28, index) => ({
|
|
16561
|
+
key: message28.id,
|
|
16562
|
+
role: message28.role,
|
|
16556
16563
|
typing: false,
|
|
16557
16564
|
content: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
16558
16565
|
LazyBubble,
|
|
16559
16566
|
{
|
|
16560
|
-
message:
|
|
16567
|
+
message: message28,
|
|
16561
16568
|
renderContent,
|
|
16562
16569
|
autoLoadRightPanel: () => {
|
|
16563
|
-
const { content, role: role2 } =
|
|
16570
|
+
const { content, role: role2 } = message28;
|
|
16564
16571
|
const isNewAddedMessage = messageLengthRef.current > 1 && messageLengthRef.current + 1 === messages.length;
|
|
16565
16572
|
if (index === messages.length - 1 && isNewAddedMessage && role2 === "ai") {
|
|
16566
16573
|
try {
|
|
@@ -22936,12 +22943,12 @@ var formatDate3 = (timestamp) => {
|
|
|
22936
22943
|
});
|
|
22937
22944
|
};
|
|
22938
22945
|
var MailboxDetailModal = ({
|
|
22939
|
-
message:
|
|
22946
|
+
message: message28,
|
|
22940
22947
|
visible,
|
|
22941
22948
|
onClose
|
|
22942
22949
|
}) => {
|
|
22943
22950
|
const { styles } = useStyles14();
|
|
22944
|
-
if (!
|
|
22951
|
+
if (!message28) return null;
|
|
22945
22952
|
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
22946
22953
|
import_antd71.Modal,
|
|
22947
22954
|
{
|
|
@@ -22964,12 +22971,12 @@ var MailboxDetailModal = ({
|
|
|
22964
22971
|
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.modalContent, children: [
|
|
22965
22972
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.header, children: [
|
|
22966
22973
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: styles.messageIcon, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react24.Mail, { size: 20 }) }),
|
|
22967
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Text36, { className: styles.messageId, children:
|
|
22968
|
-
!
|
|
22974
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Text36, { className: styles.messageId, children: message28.id }),
|
|
22975
|
+
!message28.read && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_antd71.Tag, { color: "red", children: "Unread" })
|
|
22969
22976
|
] }),
|
|
22970
22977
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Title11, { level: 4, className: styles.title, children: [
|
|
22971
22978
|
"Message from ",
|
|
22972
|
-
|
|
22979
|
+
message28.from
|
|
22973
22980
|
] }),
|
|
22974
22981
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.metaSection, children: [
|
|
22975
22982
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -22979,11 +22986,11 @@ var MailboxDetailModal = ({
|
|
|
22979
22986
|
"div",
|
|
22980
22987
|
{
|
|
22981
22988
|
className: styles.avatar,
|
|
22982
|
-
style: { background: getAvatarColor7(
|
|
22983
|
-
children: getInitials7(
|
|
22989
|
+
style: { background: getAvatarColor7(message28.from) },
|
|
22990
|
+
children: getInitials7(message28.from)
|
|
22984
22991
|
}
|
|
22985
22992
|
),
|
|
22986
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children:
|
|
22993
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: message28.from })
|
|
22987
22994
|
] })
|
|
22988
22995
|
] }),
|
|
22989
22996
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.metaItem, children: [
|
|
@@ -22993,29 +23000,29 @@ var MailboxDetailModal = ({
|
|
|
22993
23000
|
"div",
|
|
22994
23001
|
{
|
|
22995
23002
|
className: styles.avatar,
|
|
22996
|
-
style: { background: getAvatarColor7(
|
|
22997
|
-
children: getInitials7(
|
|
23003
|
+
style: { background: getAvatarColor7(message28.to) },
|
|
23004
|
+
children: getInitials7(message28.to)
|
|
22998
23005
|
}
|
|
22999
23006
|
),
|
|
23000
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children:
|
|
23007
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: message28.to })
|
|
23001
23008
|
] })
|
|
23002
23009
|
] }),
|
|
23003
23010
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.metaItem, children: [
|
|
23004
23011
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Text36, { className: styles.metaLabel, children: "Time" }),
|
|
23005
23012
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.metaValue, children: [
|
|
23006
23013
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react24.Calendar, { size: 14 }),
|
|
23007
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: formatDate3(
|
|
23014
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { children: formatDate3(message28.timestamp) })
|
|
23008
23015
|
] })
|
|
23009
23016
|
] }),
|
|
23010
23017
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.metaItem, children: [
|
|
23011
23018
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Text36, { className: styles.metaLabel, children: "Type" }),
|
|
23012
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: styles.metaValue, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_antd71.Tag, { color:
|
|
23019
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: styles.metaValue, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_antd71.Tag, { color: message28.type === "broadcast" ? "blue" : "default", children: message28.type }) })
|
|
23013
23020
|
] })
|
|
23014
23021
|
] }),
|
|
23015
23022
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_antd71.Divider, {}),
|
|
23016
23023
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: styles.contentSection, children: [
|
|
23017
23024
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Text36, { className: styles.contentLabel, children: "Message Content" }),
|
|
23018
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: styles.contentBox, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Paragraph2, { className: styles.messageContent, children:
|
|
23025
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: styles.contentBox, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Paragraph2, { className: styles.messageContent, children: message28.content }) })
|
|
23019
23026
|
] })
|
|
23020
23027
|
] })
|
|
23021
23028
|
}
|
|
@@ -23244,26 +23251,26 @@ var MessageGroupComponent = ({ group, styles, defaultExpanded = true, onMessageC
|
|
|
23244
23251
|
]
|
|
23245
23252
|
}
|
|
23246
23253
|
),
|
|
23247
|
-
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((
|
|
23254
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.listGroupContent, children: group.messages.map((message28) => /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
23248
23255
|
"div",
|
|
23249
23256
|
{
|
|
23250
|
-
className: `${styles.listItem} ${!
|
|
23251
|
-
onClick: () => onMessageClick(
|
|
23257
|
+
className: `${styles.listItem} ${!message28.read ? styles.listItemUnread : ""}`,
|
|
23258
|
+
onClick: () => onMessageClick(message28),
|
|
23252
23259
|
children: [
|
|
23253
|
-
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.listItemIcon, children: !
|
|
23260
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.listItemIcon, children: !message28.read ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.unreadBadge }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react25.Circle, { size: 8, style: { color: "#d9d9d9" } }) }),
|
|
23254
23261
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: styles.listItemContent, children: [
|
|
23255
|
-
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(
|
|
23262
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: styles.listItemPreview, children: getMessagePreview(message28.content) }),
|
|
23256
23263
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: styles.listItemMeta, children: [
|
|
23257
23264
|
"To: ",
|
|
23258
|
-
|
|
23265
|
+
message28.to,
|
|
23259
23266
|
" \u2022 ",
|
|
23260
|
-
|
|
23267
|
+
message28.type
|
|
23261
23268
|
] })
|
|
23262
23269
|
] }),
|
|
23263
|
-
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.listItemRight, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: styles.listItemDate, children: formatDate4(
|
|
23270
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: styles.listItemRight, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: styles.listItemDate, children: formatDate4(message28.timestamp) }) })
|
|
23264
23271
|
]
|
|
23265
23272
|
},
|
|
23266
|
-
|
|
23273
|
+
message28.id
|
|
23267
23274
|
)) })
|
|
23268
23275
|
] });
|
|
23269
23276
|
};
|
|
@@ -23274,12 +23281,12 @@ var MailboxPanel = ({ data }) => {
|
|
|
23274
23281
|
const { teamMailbox = [] } = data || {};
|
|
23275
23282
|
const messageGroups = (0, import_react73.useMemo)(() => {
|
|
23276
23283
|
const groupsMap = /* @__PURE__ */ new Map();
|
|
23277
|
-
teamMailbox.forEach((
|
|
23278
|
-
const sender =
|
|
23284
|
+
teamMailbox.forEach((message28) => {
|
|
23285
|
+
const sender = message28.from;
|
|
23279
23286
|
if (!groupsMap.has(sender)) {
|
|
23280
23287
|
groupsMap.set(sender, []);
|
|
23281
23288
|
}
|
|
23282
|
-
groupsMap.get(sender).push(
|
|
23289
|
+
groupsMap.get(sender).push(message28);
|
|
23283
23290
|
});
|
|
23284
23291
|
const groups = Array.from(groupsMap.entries()).map(([sender, messages]) => ({
|
|
23285
23292
|
sender,
|
|
@@ -23296,8 +23303,8 @@ var MailboxPanel = ({ data }) => {
|
|
|
23296
23303
|
return groups;
|
|
23297
23304
|
}, [teamMailbox]);
|
|
23298
23305
|
const totalUnread = teamMailbox.filter((m) => !m.read).length;
|
|
23299
|
-
const handleMessageClick = (
|
|
23300
|
-
setSelectedMessage(
|
|
23306
|
+
const handleMessageClick = (message28) => {
|
|
23307
|
+
setSelectedMessage(message28);
|
|
23301
23308
|
setModalVisible(true);
|
|
23302
23309
|
};
|
|
23303
23310
|
const handleCloseModal = () => {
|
|
@@ -25141,11 +25148,11 @@ var StreamingHTMLRenderer = ({
|
|
|
25141
25148
|
if (!iframe || event.source !== iframe.contentWindow) {
|
|
25142
25149
|
return;
|
|
25143
25150
|
}
|
|
25144
|
-
const
|
|
25145
|
-
if (!
|
|
25151
|
+
const message28 = event.data;
|
|
25152
|
+
if (!message28 || typeof message28 !== "object") {
|
|
25146
25153
|
return;
|
|
25147
25154
|
}
|
|
25148
|
-
switch (
|
|
25155
|
+
switch (message28.type) {
|
|
25149
25156
|
case "iframe-ready":
|
|
25150
25157
|
console.log("[StreamingHTMLRenderer] Iframe ready");
|
|
25151
25158
|
isReadyRef.current = true;
|
|
@@ -25160,26 +25167,26 @@ var StreamingHTMLRenderer = ({
|
|
|
25160
25167
|
}
|
|
25161
25168
|
break;
|
|
25162
25169
|
case "iframe-height":
|
|
25163
|
-
if (typeof
|
|
25164
|
-
setIframeHeight(
|
|
25170
|
+
if (typeof message28.height === "number" && message28.height > 0) {
|
|
25171
|
+
setIframeHeight(message28.height);
|
|
25165
25172
|
}
|
|
25166
25173
|
break;
|
|
25167
25174
|
case "iframe-error": {
|
|
25168
25175
|
const streamingError = {
|
|
25169
25176
|
type: "RENDER_ERROR",
|
|
25170
|
-
message:
|
|
25177
|
+
message: message28.error || "Unknown iframe error"
|
|
25171
25178
|
};
|
|
25172
25179
|
onError?.(streamingError);
|
|
25173
25180
|
break;
|
|
25174
25181
|
}
|
|
25175
25182
|
case "widget-prompt":
|
|
25176
|
-
if (typeof
|
|
25177
|
-
onPrompt?.(
|
|
25183
|
+
if (typeof message28.text === "string") {
|
|
25184
|
+
onPrompt?.(message28.text);
|
|
25178
25185
|
}
|
|
25179
25186
|
break;
|
|
25180
25187
|
case "widget-open-link":
|
|
25181
|
-
if (typeof
|
|
25182
|
-
window.open(
|
|
25188
|
+
if (typeof message28.url === "string") {
|
|
25189
|
+
window.open(message28.url, "_blank", "noopener,noreferrer");
|
|
25183
25190
|
}
|
|
25184
25191
|
break;
|
|
25185
25192
|
}
|
|
@@ -28294,8 +28301,8 @@ var TopologyRuntimeView = () => {
|
|
|
28294
28301
|
setRuns((prev) => prev.filter((r) => r.id !== runId));
|
|
28295
28302
|
setSelectedRun((prev) => prev?.id === runId ? null : prev);
|
|
28296
28303
|
} catch (err) {
|
|
28297
|
-
const
|
|
28298
|
-
setError(
|
|
28304
|
+
const message28 = err instanceof Error ? err.message : "Failed to delete run";
|
|
28305
|
+
setError(message28);
|
|
28299
28306
|
}
|
|
28300
28307
|
}, [del]);
|
|
28301
28308
|
const refreshRuns = (0, import_react91.useCallback)(async () => {
|
|
@@ -31534,7 +31541,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
31534
31541
|
import_antd91.Button,
|
|
31535
31542
|
{
|
|
31536
31543
|
block: true,
|
|
31537
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.
|
|
31544
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.MessagesSquare, { size: 14 }),
|
|
31538
31545
|
onClick: openCreateForm,
|
|
31539
31546
|
children: "Connect"
|
|
31540
31547
|
}
|
|
@@ -31543,7 +31550,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
31543
31550
|
const renderRightContent = () => {
|
|
31544
31551
|
if (formMode === "view" && !selectedId) {
|
|
31545
31552
|
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: styles.emptyState, children: [
|
|
31546
|
-
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.
|
|
31553
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.MessagesSquare, { size: 40, style: { opacity: 0.25, marginBottom: 16 } }),
|
|
31547
31554
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(Text49, { style: { fontSize: 14, color: "var(--color-text-secondary, #666)" }, children: "Select a channel from the left or add a new one" })
|
|
31548
31555
|
] });
|
|
31549
31556
|
}
|
|
@@ -31605,7 +31612,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
31605
31612
|
import_antd91.Button,
|
|
31606
31613
|
{
|
|
31607
31614
|
type: "primary",
|
|
31608
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.
|
|
31615
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.MessagesSquare, { size: 14 }),
|
|
31609
31616
|
loading: qrLoading,
|
|
31610
31617
|
onClick: fetchQrCode,
|
|
31611
31618
|
children: "Get QR Code"
|
|
@@ -31815,7 +31822,7 @@ var PersonalAssistantChannelModal = ({
|
|
|
31815
31822
|
import_antd91.Modal,
|
|
31816
31823
|
{
|
|
31817
31824
|
title: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
31818
|
-
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.
|
|
31825
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_lucide_react35.MessagesSquare, { size: 18 }),
|
|
31819
31826
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("span", { children: "Connect Channels" })
|
|
31820
31827
|
] }),
|
|
31821
31828
|
open,
|
|
@@ -32021,7 +32028,7 @@ var PersonalAssistantPage = () => {
|
|
|
32021
32028
|
HeaderIconButton,
|
|
32022
32029
|
{
|
|
32023
32030
|
ariaLabel: "Channel settings",
|
|
32024
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react36.
|
|
32031
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react36.MessagesSquare, { size: 16 }),
|
|
32025
32032
|
onClick: () => setChannelModalOpen(true)
|
|
32026
32033
|
}
|
|
32027
32034
|
),
|
|
@@ -32211,7 +32218,7 @@ var FileView = ({ parsed }) => {
|
|
|
32211
32218
|
const baseURL = shellConfig?.baseURL ?? "";
|
|
32212
32219
|
const resourcePath = decodeURIComponent(parsed.payload);
|
|
32213
32220
|
const params = new URLSearchParams({
|
|
32214
|
-
path: `/${resourcePath}`
|
|
32221
|
+
path: resourcePath.startsWith("/") ? resourcePath : `/${resourcePath}`
|
|
32215
32222
|
});
|
|
32216
32223
|
if (parsed.assistantId) params.set("assistantId", parsed.assistantId);
|
|
32217
32224
|
const url = `${baseURL}/api/workspaces/${parsed.workspaceId}/projects/${parsed.projectId}/viewfile?${params}`;
|
|
@@ -32301,8 +32308,15 @@ var SharesPage = ({ client }) => {
|
|
|
32301
32308
|
(0, import_react105.useEffect)(() => {
|
|
32302
32309
|
loadShares();
|
|
32303
32310
|
}, []);
|
|
32304
|
-
const handleCopy = (
|
|
32305
|
-
|
|
32311
|
+
const handleCopy = (record) => {
|
|
32312
|
+
const baseURL = client.baseURL ?? "";
|
|
32313
|
+
const fullUrl = `${baseURL.replace(/\/$/, "")}/s/${record.token}`;
|
|
32314
|
+
const titleText = record.title ? `${record.title}
|
|
32315
|
+
` : `${record.address.resourcePath.split("/").pop() || "file"}
|
|
32316
|
+
`;
|
|
32317
|
+
const pwdText = record.visibility === "password" ? "Password protected\n" : "";
|
|
32318
|
+
navigator.clipboard.writeText(`${titleText}${fullUrl}
|
|
32319
|
+
${pwdText}`.trim());
|
|
32306
32320
|
import_antd95.message.success("Copied");
|
|
32307
32321
|
};
|
|
32308
32322
|
const handleRevoke = async (token) => {
|
|
@@ -32355,7 +32369,7 @@ var SharesPage = ({ client }) => {
|
|
|
32355
32369
|
key: "copy",
|
|
32356
32370
|
icon: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_icons44.CopyOutlined, {}),
|
|
32357
32371
|
label: "Copy Link",
|
|
32358
|
-
onClick: () => handleCopy(
|
|
32372
|
+
onClick: () => handleCopy(r)
|
|
32359
32373
|
},
|
|
32360
32374
|
...r.revoked ? [] : [
|
|
32361
32375
|
{
|
|
@@ -33550,7 +33564,15 @@ var MODAL_BODY_STYLE = {
|
|
|
33550
33564
|
flexDirection: "column",
|
|
33551
33565
|
gap: 12
|
|
33552
33566
|
};
|
|
33553
|
-
var PinToMenuButton = ({
|
|
33567
|
+
var PinToMenuButton = ({
|
|
33568
|
+
assistantId,
|
|
33569
|
+
contentType = "agent",
|
|
33570
|
+
contentConfig: externalContentConfig,
|
|
33571
|
+
isMatch,
|
|
33572
|
+
size = "small",
|
|
33573
|
+
label,
|
|
33574
|
+
block
|
|
33575
|
+
}) => {
|
|
33554
33576
|
const workspaceCtx = import_react109.default.useContext(WorkspaceContext);
|
|
33555
33577
|
const { config } = useLatticeChatShellContext();
|
|
33556
33578
|
const { post, get, del } = useApi();
|
|
@@ -33561,8 +33583,9 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33561
33583
|
const [isPinned, setIsPinned] = (0, import_react109.useState)(false);
|
|
33562
33584
|
const [pinnedItemId, setPinnedItemId] = (0, import_react109.useState)(null);
|
|
33563
33585
|
const [checking, setChecking] = (0, import_react109.useState)(true);
|
|
33586
|
+
const hasTarget = contentType === "agent" ? !!assistantId : !!externalContentConfig;
|
|
33564
33587
|
const checkPinned = (0, import_react109.useCallback)(async () => {
|
|
33565
|
-
if (!
|
|
33588
|
+
if (!hasTarget || !config.enableCustomMenu) {
|
|
33566
33589
|
setChecking(false);
|
|
33567
33590
|
return;
|
|
33568
33591
|
}
|
|
@@ -33572,8 +33595,11 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33572
33595
|
"/api/menu-items?menuTarget=workspace"
|
|
33573
33596
|
);
|
|
33574
33597
|
if (json.success && json.data?.records) {
|
|
33598
|
+
const matchFn = isMatch ?? ((cfg) => {
|
|
33599
|
+
return contentType === "agent" && cfg.agentId === assistantId;
|
|
33600
|
+
});
|
|
33575
33601
|
const pinned = json.data.records.find(
|
|
33576
|
-
(item) => item.
|
|
33602
|
+
(item) => item.contentType === contentType && matchFn(item.contentConfig)
|
|
33577
33603
|
);
|
|
33578
33604
|
if (pinned) {
|
|
33579
33605
|
setIsPinned(true);
|
|
@@ -33587,11 +33613,11 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33587
33613
|
} finally {
|
|
33588
33614
|
setChecking(false);
|
|
33589
33615
|
}
|
|
33590
|
-
}, [
|
|
33616
|
+
}, [hasTarget, config.enableCustomMenu, get, contentType, assistantId, isMatch]);
|
|
33591
33617
|
(0, import_react109.useEffect)(() => {
|
|
33592
33618
|
checkPinned();
|
|
33593
33619
|
}, [checkPinned]);
|
|
33594
|
-
if (!
|
|
33620
|
+
if (!hasTarget || !config.enableCustomMenu) return null;
|
|
33595
33621
|
const handlePin = async () => {
|
|
33596
33622
|
if (!name.trim()) {
|
|
33597
33623
|
import_antd98.message.warning("Please enter a menu name");
|
|
@@ -33599,14 +33625,19 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33599
33625
|
}
|
|
33600
33626
|
setLoading(true);
|
|
33601
33627
|
try {
|
|
33628
|
+
const contentConfig = contentType === "agent" ? {
|
|
33629
|
+
agentId: assistantId,
|
|
33630
|
+
workspaceId: workspaceCtx?.workspaceId || void 0,
|
|
33631
|
+
projectId: workspaceCtx?.projectId || void 0
|
|
33632
|
+
} : {
|
|
33633
|
+
...externalContentConfig,
|
|
33634
|
+
workspaceId: workspaceCtx?.workspaceId || void 0,
|
|
33635
|
+
projectId: workspaceCtx?.projectId || void 0
|
|
33636
|
+
};
|
|
33602
33637
|
const body = {
|
|
33603
33638
|
menuTarget: "workspace",
|
|
33604
|
-
contentType
|
|
33605
|
-
contentConfig
|
|
33606
|
-
agentId: assistantId,
|
|
33607
|
-
workspaceId: workspaceCtx?.workspaceId || void 0,
|
|
33608
|
-
projectId: workspaceCtx?.projectId || void 0
|
|
33609
|
-
},
|
|
33639
|
+
contentType,
|
|
33640
|
+
contentConfig,
|
|
33610
33641
|
group: group.trim() || void 0,
|
|
33611
33642
|
name: name.trim(),
|
|
33612
33643
|
sortOrder: 0
|
|
@@ -33653,11 +33684,23 @@ var PinToMenuButton = ({ assistantId }) => {
|
|
|
33653
33684
|
}
|
|
33654
33685
|
};
|
|
33655
33686
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
33656
|
-
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_antd98.Tooltip, { title: isPinned ? "Unpin from Menu" : "Pin to Menu", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
33687
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_antd98.Tooltip, { title: isPinned ? "Unpin from Menu" : "Pin to Menu", children: label ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
33657
33688
|
import_antd98.Button,
|
|
33658
33689
|
{
|
|
33659
33690
|
type: "text",
|
|
33660
|
-
size
|
|
33691
|
+
size,
|
|
33692
|
+
block,
|
|
33693
|
+
icon: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_lucide_react38.Pin, { size: 14, fill: "currentColor" }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_lucide_react38.Pin, { size: 14 }),
|
|
33694
|
+
onClick: handleClick,
|
|
33695
|
+
loading: checking || loading && isPinned,
|
|
33696
|
+
children: label
|
|
33697
|
+
}
|
|
33698
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
33699
|
+
import_antd98.Button,
|
|
33700
|
+
{
|
|
33701
|
+
type: "text",
|
|
33702
|
+
size,
|
|
33703
|
+
block,
|
|
33661
33704
|
icon: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_lucide_react38.Pin, { size: 14, fill: "currentColor" }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_lucide_react38.Pin, { size: 14 }),
|
|
33662
33705
|
onClick: handleClick,
|
|
33663
33706
|
loading: checking || loading && isPinned
|
|
@@ -34124,6 +34167,7 @@ var useStyles22 = (0, import_antd_style39.createStyles)(({ token, css }) => ({
|
|
|
34124
34167
|
container: css`
|
|
34125
34168
|
height: 100%;
|
|
34126
34169
|
overflow-y: auto;
|
|
34170
|
+
overflow-x: hidden;
|
|
34127
34171
|
padding: 12px;
|
|
34128
34172
|
font-size: 13px;
|
|
34129
34173
|
background: transparent;
|
|
@@ -34194,7 +34238,8 @@ var useStyles22 = (0, import_antd_style39.createStyles)(({ token, css }) => ({
|
|
|
34194
34238
|
display: flex;
|
|
34195
34239
|
align-items: center;
|
|
34196
34240
|
gap: 8px;
|
|
34197
|
-
|
|
34241
|
+
flex: 1;
|
|
34242
|
+
min-width: 0;
|
|
34198
34243
|
padding: 5px 8px;
|
|
34199
34244
|
border-radius: 4px;
|
|
34200
34245
|
cursor: pointer;
|
|
@@ -34349,7 +34394,6 @@ var FileDirectoryPanel = ({
|
|
|
34349
34394
|
const { styles } = useStyles22();
|
|
34350
34395
|
const { currentAssistant } = useAssistantContext();
|
|
34351
34396
|
const { getFileViewUrl } = useWorkspaceContext();
|
|
34352
|
-
const { post } = useApi();
|
|
34353
34397
|
const [sharePath, setSharePath] = (0, import_react111.useState)(null);
|
|
34354
34398
|
const renderEntry = import_react111.default.useCallback((entry, depth) => {
|
|
34355
34399
|
const entryName = getEntryName(entry);
|
|
@@ -34408,6 +34452,18 @@ var FileDirectoryPanel = ({
|
|
|
34408
34452
|
]
|
|
34409
34453
|
}
|
|
34410
34454
|
),
|
|
34455
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
34456
|
+
PinToMenuButton,
|
|
34457
|
+
{
|
|
34458
|
+
contentType: "file",
|
|
34459
|
+
contentConfig: {
|
|
34460
|
+
resourcePath: entry.path,
|
|
34461
|
+
assistantId: currentAssistant?.id || "",
|
|
34462
|
+
fileName: entry.path.split("/").pop() || entry.path
|
|
34463
|
+
},
|
|
34464
|
+
isMatch: (cfg) => cfg.resourcePath === entry.path
|
|
34465
|
+
}
|
|
34466
|
+
),
|
|
34411
34467
|
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
34412
34468
|
import_antd100.Dropdown,
|
|
34413
34469
|
{
|
|
@@ -34437,32 +34493,6 @@ var FileDirectoryPanel = ({
|
|
|
34437
34493
|
icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_icons46.LinkOutlined, {}),
|
|
34438
34494
|
label: "Share",
|
|
34439
34495
|
onClick: () => setSharePath(entry.path)
|
|
34440
|
-
},
|
|
34441
|
-
{
|
|
34442
|
-
key: "pin",
|
|
34443
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_lucide_react40.Pin, { size: 14 }),
|
|
34444
|
-
label: "Pin to Menu",
|
|
34445
|
-
onClick: async () => {
|
|
34446
|
-
try {
|
|
34447
|
-
const fileName = entry.path.split("/").pop() || entry.path;
|
|
34448
|
-
await post("/api/menu-items", {
|
|
34449
|
-
menuTarget: "workspace",
|
|
34450
|
-
contentType: "file",
|
|
34451
|
-
contentConfig: {
|
|
34452
|
-
resourcePath: entry.path,
|
|
34453
|
-
workspaceId: workspaceId || "",
|
|
34454
|
-
projectId: projectId || "",
|
|
34455
|
-
assistantId: currentAssistant?.id || "",
|
|
34456
|
-
fileName
|
|
34457
|
-
},
|
|
34458
|
-
name: fileName,
|
|
34459
|
-
sortOrder: 0
|
|
34460
|
-
});
|
|
34461
|
-
import_antd100.message.success(`Pinned "${fileName}" to menu`);
|
|
34462
|
-
} catch {
|
|
34463
|
-
import_antd100.message.error("Failed to pin to menu");
|
|
34464
|
-
}
|
|
34465
|
-
}
|
|
34466
34496
|
}
|
|
34467
34497
|
]
|
|
34468
34498
|
},
|