@iblai/iblai-js 2.45.1 → 2.47.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/dist/web-containers/source/_virtual/index2.js +2 -2
- package/dist/web-containers/source/_virtual/index3.js +2 -2
- package/dist/web-containers/source/ai-message-bubble.js +1 -1
- package/dist/web-containers/source/ai-message-bubble.js.map +1 -1
- package/dist/web-containers/source/ai-message-download.js +3 -39
- package/dist/web-containers/source/ai-message-download.js.map +1 -1
- package/dist/web-containers/source/canvas/canvas-export-handlers.js +3 -1
- package/dist/web-containers/source/canvas/canvas-export-handlers.js.map +1 -1
- package/dist/web-containers/source/canvas-export-handlers.js +3 -1
- package/dist/web-containers/source/canvas-export-handlers.js.map +1 -1
- package/dist/web-containers/source/chat/ai-message-bubble.js +1 -1
- package/dist/web-containers/source/chat/ai-message-bubble.js.map +1 -1
- package/dist/web-containers/source/chat/ai-message-download.js +3 -39
- package/dist/web-containers/source/chat/ai-message-download.js.map +1 -1
- package/dist/web-containers/source/chat/chat-download-dialog.js +144 -0
- package/dist/web-containers/source/chat/chat-download-dialog.js.map +1 -0
- package/dist/web-containers/source/chat/chat-export.js +57 -0
- package/dist/web-containers/source/chat/chat-export.js.map +1 -0
- package/dist/web-containers/source/chat/chat-host-context.js.map +1 -1
- package/dist/web-containers/source/chat/chat-transcript.js +13 -9
- package/dist/web-containers/source/chat/chat-transcript.js.map +1 -1
- package/dist/web-containers/source/chat/use-whole-chat.js +63 -0
- package/dist/web-containers/source/chat/use-whole-chat.js.map +1 -0
- package/dist/web-containers/source/chat-download-dialog.js +144 -0
- package/dist/web-containers/source/chat-download-dialog.js.map +1 -0
- package/dist/web-containers/source/chat-export.js +57 -0
- package/dist/web-containers/source/chat-export.js.map +1 -0
- package/dist/web-containers/source/chat-host-context.js.map +1 -1
- package/dist/web-containers/source/chat-transcript.js +13 -9
- package/dist/web-containers/source/chat-transcript.js.map +1 -1
- package/dist/web-containers/source/components/canvas/canvas-export-handlers.js +3 -1
- package/dist/web-containers/source/components/canvas/canvas-export-handlers.js.map +1 -1
- package/dist/web-containers/source/components/chat/ai-message-bubble.js +1 -1
- package/dist/web-containers/source/components/chat/ai-message-bubble.js.map +1 -1
- package/dist/web-containers/source/components/chat/ai-message-download.js +3 -39
- package/dist/web-containers/source/components/chat/ai-message-download.js.map +1 -1
- package/dist/web-containers/source/components/chat/chat-download-dialog.js +144 -0
- package/dist/web-containers/source/components/chat/chat-download-dialog.js.map +1 -0
- package/dist/web-containers/source/components/chat/chat-export.js +57 -0
- package/dist/web-containers/source/components/chat/chat-export.js.map +1 -0
- package/dist/web-containers/source/components/chat/chat-host-context.js.map +1 -1
- package/dist/web-containers/source/components/chat/chat-transcript.js +13 -9
- package/dist/web-containers/source/components/chat/chat-transcript.js.map +1 -1
- package/dist/web-containers/source/components/chat/use-whole-chat.js +63 -0
- package/dist/web-containers/source/components/chat/use-whole-chat.js.map +1 -0
- package/dist/web-containers/source/components/welcome-chat-new.js +24 -5
- package/dist/web-containers/source/components/welcome-chat-new.js.map +1 -1
- package/dist/web-containers/source/en.json.js +19 -1
- package/dist/web-containers/source/en.json.js.map +1 -1
- package/dist/web-containers/source/es.json.js +19 -1
- package/dist/web-containers/source/es.json.js.map +1 -1
- package/dist/web-containers/source/fr.json.js +19 -1
- package/dist/web-containers/source/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/en.json.js +19 -1
- package/dist/web-containers/source/i18n/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/es.json.js +19 -1
- package/dist/web-containers/source/i18n/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/fr.json.js +19 -1
- package/dist/web-containers/source/i18n/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/zh.json.js +19 -1
- package/dist/web-containers/source/i18n/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/index2.js +2 -2
- package/dist/web-containers/source/index3.js +2 -2
- package/dist/web-containers/source/labels.js +289 -23
- package/dist/web-containers/source/labels.js.map +1 -1
- package/dist/web-containers/source/messages/en.json.js +19 -1
- package/dist/web-containers/source/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/messages/es.json.js +19 -1
- package/dist/web-containers/source/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/messages/fr.json.js +19 -1
- package/dist/web-containers/source/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/messages/zh.json.js +19 -1
- package/dist/web-containers/source/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/next/index.js +2 -0
- package/dist/web-containers/source/next/index.js.map +1 -1
- package/dist/web-containers/source/node_modules/.pnpm/css-mediaquery@0.1.2/node_modules/css-mediaquery/index.js +1 -1
- package/dist/web-containers/source/node_modules/.pnpm/matchmediaquery@0.4.2/node_modules/matchmediaquery/index.js +1 -1
- package/dist/web-containers/source/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
- package/dist/web-containers/source/tsconfig.tsbuildinfo +1 -1
- package/dist/web-containers/source/use-whole-chat.js +63 -0
- package/dist/web-containers/source/use-whole-chat.js.map +1 -0
- package/dist/web-containers/source/web-containers/tsconfig.tsbuildinfo +1 -1
- package/dist/web-containers/source/welcome-chat-new.js +24 -5
- package/dist/web-containers/source/welcome-chat-new.js.map +1 -1
- package/dist/web-containers/source/zh.json.js +19 -1
- package/dist/web-containers/source/zh.json.js.map +1 -1
- package/package.json +5 -5
|
@@ -2,49 +2,13 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useChatT } from './chat-host-context.js';
|
|
4
4
|
import { Tooltip, TooltipTrigger, TooltipContent } from '../ui/tooltip.js';
|
|
5
|
-
import {
|
|
6
|
-
import { Button } from './ui/button.js';
|
|
7
|
-
import { Label } from '../ui/label.js';
|
|
8
|
-
import { RadioGroup, RadioGroupItem } from './ui/radio-group.js';
|
|
9
|
-
import { sanitizeFilename } from '../canvas/canvas-utils.js';
|
|
10
|
-
import { downloadBlob } from '../canvas/canvas-export-handlers.js';
|
|
11
|
-
import { buildTranscript, buildMessageTranscript } from './chat-transcript.js';
|
|
5
|
+
import { ChatDownloadDialog } from './chat-download-dialog.js';
|
|
12
6
|
import Download from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/download.js';
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
downloadBlob(new Blob([text], { type: 'text/plain;charset=utf-8' }), filename);
|
|
16
|
-
};
|
|
17
|
-
function AIMessageDownload({ message, messages, mentorName }) {
|
|
8
|
+
function AIMessageDownload({ message, messages, mentorName, tenantKey, sessionId }) {
|
|
18
9
|
const t = useChatT();
|
|
19
10
|
const [isOpen, setIsOpen] = useState(false);
|
|
20
|
-
|
|
21
|
-
const labels = {
|
|
22
|
-
header: t('chat.chatAiMessageDownload.transcriptHeader', { mentorName }),
|
|
23
|
-
roleUser: t('chat.chatAiMessageDownload.roleUser'),
|
|
24
|
-
roleAi: mentorName || t('chat.chatAiMessageDownload.roleAi'),
|
|
25
|
-
};
|
|
26
|
-
const filename = (prefix) => `${sanitizeFilename(`${prefix}-${mentorName}-${new Date().toISOString().slice(0, 10)}`)}.txt`;
|
|
27
|
-
const handleDownload = () => {
|
|
28
|
-
const text = scope === 'chat'
|
|
29
|
-
? buildTranscript(messages, labels)
|
|
30
|
-
: buildMessageTranscript(message, labels);
|
|
31
|
-
download(text, filename(scope));
|
|
32
|
-
setIsOpen(false);
|
|
33
|
-
};
|
|
34
|
-
// Always reopen on the default choice rather than the last one used.
|
|
35
|
-
const handleOpenChange = (open) => {
|
|
36
|
-
if (open)
|
|
37
|
-
setScope('chat');
|
|
38
|
-
setIsOpen(open);
|
|
39
|
-
};
|
|
40
|
-
return (jsxs(Fragment, { children: [jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs("button", { onClick: () => handleOpenChange(true), className: "text-gray-500 hover:text-gray-700", children: [jsx("span", { className: "sr-only", children: t('chat.chatAiMessageDownload.downloadThisChat') }), jsx(Download, { className: "h-4 w-4" })] }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: t('chat.chatAiMessageDownload.download') })] }), jsx(Dialog, { open: isOpen, onOpenChange: handleOpenChange, children: jsxs(DialogContent, { className: "max-w-md", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { className: "ibl-dialog-title", children: t('chat.chatAiMessageDownload.dialogTitle') }), jsx(DialogDescription, { className: "sr-only", children: t('chat.chatAiMessageDownload.dialogDescription') })] }), jsx(RadioGroup, { value: scope, onValueChange: (value) => setScope(value), className: "gap-5 py-2", children: [
|
|
41
|
-
['chat', 'entireChat', 'entireChatDescription'],
|
|
42
|
-
['message', 'thisMessage', 'thisMessageDescription'],
|
|
43
|
-
].map(([value, labelKey, descriptionKey]) => (jsxs("div", { className: "flex items-start space-x-3", children: [jsx(RadioGroupItem, { value: value, id: `download-scope-${value}`,
|
|
44
|
-
// Explicit utilities, not `.ibl-outline-primary`: tailwind-merge
|
|
45
|
-
// can only drop the item's built-in `border-primary`/`text-primary`
|
|
46
|
-
// when the override is a real utility class.
|
|
47
|
-
className: "mt-0.5 border-[#2563EB] text-[#2563EB]" }), jsxs("div", { className: "grid gap-1", children: [jsx(Label, { htmlFor: `download-scope-${value}`, className: "cursor-pointer font-medium", children: t(`chat.chatAiMessageDownload.${labelKey}`) }), jsx("p", { className: "text-muted-foreground text-sm", children: t(`chat.chatAiMessageDownload.${descriptionKey}`) })] })] }, value))) }), jsx(DialogFooter, { className: "mt-2", children: jsx(Button, { onClick: handleDownload, className: "ibl-button-primary", children: t('chat.chatAiMessageDownload.downloadButton') }) })] }) })] }));
|
|
11
|
+
return (jsxs(Fragment, { children: [jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsxs("button", { onClick: () => setIsOpen(true), className: "text-gray-500 hover:text-gray-700", children: [jsx("span", { className: "sr-only", children: t('chat.chatAiMessageDownload.downloadThisChat') }), jsx(Download, { className: "h-4 w-4" })] }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: t('chat.chatAiMessageDownload.download') })] }), jsx(ChatDownloadDialog, { open: isOpen, onOpenChange: setIsOpen, mentorName: mentorName, message: message, messages: messages, tenantKey: tenantKey, sessionId: sessionId })] }));
|
|
48
12
|
}
|
|
49
13
|
|
|
50
14
|
export { AIMessageDownload };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-message-download.js","sources":["../../../../../../../src/components/chat/ai-message-download.tsx"],"sourcesContent":[null],"names":["_jsxs","
|
|
1
|
+
{"version":3,"file":"ai-message-download.js","sources":["../../../../../../../src/components/chat/ai-message-download.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AAmBM,SAAU,iBAAiB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAS,EAAA;AAC9F,IAAA,MAAM,CAAC,GAAG,QAAQ,EAAE;IACpB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAE3C,QACEA,4BACEA,IAAA,CAAC,OAAO,eACNC,GAAA,CAAC,cAAc,IAAC,OAAO,EAAA,IAAA,EAAA,QAAA,EACrBD,iBAAQ,OAAO,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,EAAC,mCAAmC,EAAA,QAAA,EAAA,CACnFC,cAAM,SAAS,EAAC,SAAS,EAAA,QAAA,EAAE,CAAC,CAAC,6CAA6C,CAAC,GAAQ,EACnFA,GAAA,CAAC,QAAQ,EAAA,EAAC,SAAS,EAAC,SAAS,EAAA,CAAG,IACzB,EAAA,CACM,EACjBA,IAAC,cAAc,EAAA,EAAC,SAAS,EAAC,qBAAqB,YAC5C,CAAC,CAAC,qCAAqC,CAAC,EAAA,CAC1B,IACT,EAEVA,GAAA,CAAC,kBAAkB,EAAA,EACjB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,SAAS,EACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EAAA,CACpB,CAAA,EAAA,CACD;AAEP;;;;"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
3
|
+
import { useChatT, useChatHost } from './chat-host-context.js';
|
|
4
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from './ui/dialog.js';
|
|
5
|
+
import { Button } from './ui/button.js';
|
|
6
|
+
import { cn } from '../../lib/utils.js';
|
|
7
|
+
import { Label } from '../ui/label.js';
|
|
8
|
+
import { RadioGroup, RadioGroupItem } from './ui/radio-group.js';
|
|
9
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './ui/select.js';
|
|
10
|
+
import { downloadBlob } from '../canvas/canvas-export-handlers.js';
|
|
11
|
+
import { buildExcelExport, buildTextExport, chatExportFilename } from './chat-export.js';
|
|
12
|
+
import { useWholeChat } from './use-whole-chat.js';
|
|
13
|
+
import LoaderCircle from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/loader-circle.js';
|
|
14
|
+
|
|
15
|
+
const RADIO_ITEM_CLASS =
|
|
16
|
+
// Explicit utilities, not `.ibl-outline-primary`: tailwind-merge can only
|
|
17
|
+
// drop the item's built-in `border-primary`/`text-primary` when the
|
|
18
|
+
// override is a real utility class.
|
|
19
|
+
'mt-0.5 border-[#2563EB] text-[#2563EB]';
|
|
20
|
+
const NO_MESSAGES = [];
|
|
21
|
+
const FORMATS = {
|
|
22
|
+
txt: { label: 'formatText', description: 'formatTextDescription' },
|
|
23
|
+
xlsx: { label: 'formatExcel', description: 'formatExcelDescription' },
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Download / Export dialog for a conversation. The whole chat is read from
|
|
27
|
+
* the backend as soon as the dialog opens, and an Excel file is built as soon
|
|
28
|
+
* as its contents are known, so pressing Save hands over a finished file in
|
|
29
|
+
* the same click: Safari only lets a download start from the click itself.
|
|
30
|
+
*/
|
|
31
|
+
function ChatDownloadDialog(props) {
|
|
32
|
+
const { open, onOpenChange } = props;
|
|
33
|
+
return (jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsx(DialogContent, { className: "max-w-md", "data-testid": "chat-download-dialog", children: open && jsx(DownloadBody, { ...props }) }) }));
|
|
34
|
+
}
|
|
35
|
+
function DownloadBody({ onOpenChange, mentorName, message, messages = NO_MESSAGES, tenantKey, username, sessionId, saveFile, }) {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
const t = useChatT();
|
|
38
|
+
const host = useChatHost();
|
|
39
|
+
const save = (_b = saveFile !== null && saveFile !== void 0 ? saveFile : (_a = host.config) === null || _a === void 0 ? void 0 : _a.saveFile) !== null && _b !== void 0 ? _b : downloadBlob;
|
|
40
|
+
const canChooseScope = !!message;
|
|
41
|
+
const [scope, setScope] = useState('chat');
|
|
42
|
+
const [format, setFormat] = useState('txt');
|
|
43
|
+
const [prepared, setPrepared] = useState(null);
|
|
44
|
+
const [saving, setSaving] = useState(false);
|
|
45
|
+
const [saveFailed, setSaveFailed] = useState(false);
|
|
46
|
+
const whole = useWholeChat({
|
|
47
|
+
enabled: true,
|
|
48
|
+
org: tenantKey !== null && tenantKey !== void 0 ? tenantKey : host.tenantKey,
|
|
49
|
+
username: username === undefined ? host.username : username,
|
|
50
|
+
sessionId,
|
|
51
|
+
});
|
|
52
|
+
const chatFailed = whole.status === 'error';
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (chatFailed && canChooseScope)
|
|
55
|
+
setScope('message');
|
|
56
|
+
}, [chatFailed, canChooseScope]);
|
|
57
|
+
const labels = useMemo(() => ({
|
|
58
|
+
header: t('chat.chatAiMessageDownload.transcriptHeader', { mentorName }),
|
|
59
|
+
roleUser: t('chat.chatAiMessageDownload.roleUser'),
|
|
60
|
+
roleAi: mentorName || t('chat.chatAiMessageDownload.roleAi'),
|
|
61
|
+
columnTime: t('chat.chatAiMessageDownload.columnTime'),
|
|
62
|
+
columnFrom: t('chat.chatAiMessageDownload.columnFrom'),
|
|
63
|
+
columnMessage: t('chat.chatAiMessageDownload.columnMessage'),
|
|
64
|
+
}), [t, mentorName]);
|
|
65
|
+
const messageSource = useMemo(() => (message ? [message] : NO_MESSAGES), [message]);
|
|
66
|
+
const chatSource = whole.messages.length > 0 ? whole.messages : messages;
|
|
67
|
+
const source = scope === 'message' ? messageSource : chatSource;
|
|
68
|
+
const sourceReady = scope === 'message' || whole.status === 'ready';
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (format !== 'xlsx' || !sourceReady)
|
|
71
|
+
return;
|
|
72
|
+
let cancelled = false;
|
|
73
|
+
buildExcelExport(source, labels).then((blob) => {
|
|
74
|
+
if (!cancelled)
|
|
75
|
+
setPrepared({ source, labels, blob });
|
|
76
|
+
}, () => {
|
|
77
|
+
if (!cancelled)
|
|
78
|
+
setPrepared({ source, labels, failed: true });
|
|
79
|
+
});
|
|
80
|
+
return () => {
|
|
81
|
+
cancelled = true;
|
|
82
|
+
};
|
|
83
|
+
}, [format, sourceReady, source, labels]);
|
|
84
|
+
const excel = format === 'xlsx' && (prepared === null || prepared === void 0 ? void 0 : prepared.source) === source && prepared.labels === labels
|
|
85
|
+
? prepared
|
|
86
|
+
: null;
|
|
87
|
+
const fileReady = format === 'txt' || !!(excel === null || excel === void 0 ? void 0 : excel.blob);
|
|
88
|
+
const canSave = sourceReady && !(scope === 'chat' && chatFailed) && fileReady && !saving;
|
|
89
|
+
// Synchronous from click to `save`: an `await` in between loses Safari's
|
|
90
|
+
// user activation and the download is blocked.
|
|
91
|
+
const handleSave = () => {
|
|
92
|
+
const blob = format === 'txt' ? buildTextExport(source, labels) : excel === null || excel === void 0 ? void 0 : excel.blob;
|
|
93
|
+
setSaveFailed(false);
|
|
94
|
+
let result;
|
|
95
|
+
try {
|
|
96
|
+
result = save(blob, chatExportFilename(scope, mentorName, format));
|
|
97
|
+
}
|
|
98
|
+
catch (_a) {
|
|
99
|
+
setSaveFailed(true);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (!result) {
|
|
103
|
+
onOpenChange(false);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
setSaving(true);
|
|
107
|
+
result.then(() => onOpenChange(false), () => {
|
|
108
|
+
setSaving(false);
|
|
109
|
+
setSaveFailed(true);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
let status = null;
|
|
113
|
+
if (scope === 'chat' && whole.status === 'loading') {
|
|
114
|
+
status = { busy: true, text: t('chat.chatAiMessageDownload.gettingWholeChat') };
|
|
115
|
+
}
|
|
116
|
+
else if (chatFailed) {
|
|
117
|
+
status = {
|
|
118
|
+
busy: false,
|
|
119
|
+
text: t(canChooseScope
|
|
120
|
+
? 'chat.chatAiMessageDownload.wholeChatErrorMessageStillWorks'
|
|
121
|
+
: 'chat.chatAiMessageDownload.wholeChatError'),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
else if (excel === null || excel === void 0 ? void 0 : excel.failed) {
|
|
125
|
+
status = { busy: false, text: t('chat.chatAiMessageDownload.fileError') };
|
|
126
|
+
}
|
|
127
|
+
else if (format === 'xlsx' && sourceReady && !excel) {
|
|
128
|
+
status = { busy: true, text: t('chat.chatAiMessageDownload.preparingFile') };
|
|
129
|
+
}
|
|
130
|
+
if (saveFailed) {
|
|
131
|
+
status = { busy: false, text: t('chat.chatAiMessageDownload.saveError') };
|
|
132
|
+
}
|
|
133
|
+
return (jsxs(Fragment, { children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { className: "ibl-dialog-title", children: t(canChooseScope
|
|
134
|
+
? 'chat.chatAiMessageDownload.dialogTitle'
|
|
135
|
+
: 'chat.chatAiMessageDownload.exportTitle') }), jsx(DialogDescription, { className: "sr-only", children: t('chat.chatAiMessageDownload.formatDialogDescription') })] }), canChooseScope && (jsx(RadioGroup, { value: scope, onValueChange: (value) => setScope(value), className: "gap-5 py-2", "aria-label": t('chat.chatAiMessageDownload.scopeLabel'), children: [
|
|
136
|
+
['chat', 'entireChat', 'entireChatDescription'],
|
|
137
|
+
['message', 'thisMessage', 'thisMessageDescription'],
|
|
138
|
+
].map(([value, labelKey, descriptionKey]) => (jsxs("div", { className: "flex items-start space-x-3", children: [jsx(RadioGroupItem, { value: value, id: `download-scope-${value}`, disabled: value === 'chat' && chatFailed, className: RADIO_ITEM_CLASS }), jsxs("div", { className: "grid gap-1", children: [jsx(Label, { htmlFor: `download-scope-${value}`, className: "cursor-pointer font-medium", children: t(`chat.chatAiMessageDownload.${labelKey}`) }), jsx("p", { className: "text-muted-foreground text-sm", children: t(`chat.chatAiMessageDownload.${descriptionKey}`) })] })] }, value))) })), jsxs("div", { className: "grid gap-2 py-2", children: [jsx(Label, { htmlFor: "download-format", className: "font-medium", children: t('chat.chatAiMessageDownload.formatLabel') }), jsxs(Select, { value: format, onValueChange: (value) => setFormat(value), children: [jsx(SelectTrigger, { id: "download-format", "aria-describedby": "download-format-description", children: jsx(SelectValue, { children: t(`chat.chatAiMessageDownload.${FORMATS[format].label}`) }) }), jsx(SelectContent, { className: "z-[60] bg-white", children: Object.keys(FORMATS).map((value) => (jsx(SelectItem, { value: value, children: jsxs("span", { className: "grid gap-0.5", children: [jsx("span", { children: t(`chat.chatAiMessageDownload.${FORMATS[value].label}`) }), jsx("span", { className: "text-muted-foreground text-xs", children: t(`chat.chatAiMessageDownload.${FORMATS[value].description}`) })] }) }, value))) })] }), jsx("p", { id: "download-format-description", className: "text-muted-foreground text-sm", children: t(`chat.chatAiMessageDownload.${FORMATS[format].description}`) })] }), jsxs("div", { className: "mt-2 flex items-center justify-between gap-3", children: [status && (jsxs("p", { role: status.busy ? 'status' : 'alert', "data-testid": "chat-download-status", className: cn('flex min-w-0 flex-1 items-center gap-2 text-[13px] leading-snug', status.busy ? 'text-muted-foreground' : 'text-red-600'), children: [status.busy && jsx(LoaderCircle, { className: "h-4 w-4 shrink-0 animate-spin", "aria-hidden": true }), jsx("span", { className: "min-w-0", children: status.text })] })), jsxs(Button, { onClick: handleSave, disabled: !canSave, className: "ibl-button-primary ml-auto shrink-0", children: [saving && jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin", "aria-hidden": true }), t(canChooseScope
|
|
139
|
+
? 'chat.chatAiMessageDownload.downloadButton'
|
|
140
|
+
: 'chat.chatAiMessageDownload.exportButton')] })] })] }));
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { ChatDownloadDialog };
|
|
144
|
+
//# sourceMappingURL=chat-download-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-download-dialog.js","sources":["../../../../../../../src/components/chat/chat-download-dialog.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","_Fragment","Loader2"],"mappings":";;;;;;;;;;;;;;AA0DA,MAAM,gBAAgB;AACpB;AACA;AACA;AACA,wCAAwC;AAS1C,MAAM,WAAW,GAAc,EAAE;AAEjC,MAAM,OAAO,GAAG;IACd,GAAG,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,uBAAuB,EAAE;IAClE,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB,EAAE;CACc;AAErF;;;;;AAKG;AACG,SAAU,kBAAkB,CAAC,KAA8B,EAAA;AAC/D,IAAA,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,KAAK;AACpC,IAAA,QACEA,GAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAA,QAAA,EAG5CA,IAAC,aAAa,EAAA,EAAC,SAAS,EAAC,UAAU,EAAA,aAAA,EAAa,sBAAsB,EAAA,QAAA,EACnE,IA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CACT,EACTA,WAAG,EAAE,EAAC,6BAA6B,EAAC,SAAS,EAAC,+BAA+B,EAAA,QAAA,EAC1E,CAAC,CAAC,8BAA8B,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAA,CAAE,CAAC,GAC7D,CAAA,EAAA,CACA,EAENC,cAAK,SAAS,EAAC,8CAA8C,EAAA,QAAA,EAAA,CAC1D,MAAM,KACLA,IAAA,CAAA,GAAA,EAAA,EACE,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ,GAAG,OAAO,iBAC1B,sBAAsB,EAClC,SAAS,EAAE,EAAE,CACX,iEAAiE,EACjE,MAAM,CAAC,IAAI,GAAG,uBAAuB,GAAG,cAAc,CACvD,EAAA,QAAA,EAAA,CAEA,MAAM,CAAC,IAAI,IAAID,GAAA,CAACG,YAAO,IAAC,SAAS,EAAC,+BAA+B,EAAA,aAAA,EAAA,IAAA,EAAA,CAAe,EACjFH,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,SAAS,EAAA,QAAA,EAAE,MAAM,CAAC,IAAI,EAAA,CAAQ,CAAA,EAAA,CAC5C,CACL,EACDC,IAAA,CAAC,MAAM,EAAA,EACL,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,CAAC,OAAO,EAClB,SAAS,EAAC,qCAAqC,aAE9C,MAAM,IAAID,IAACG,YAAO,EAAA,EAAC,SAAS,EAAC,2BAA2B,wBAAe,EACvE,CAAC,CACA;AACE,kCAAE;AACF,kCAAE,yCAAyC,CAC9C,IACM,CAAA,EAAA,CACL,CAAA,EAAA,CACL;AAEP;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { sanitizeFilename } from '../canvas/canvas-utils.js';
|
|
2
|
+
import { isTranscribable, flattenMarkdown, speakerLabel, buildTranscript } from './chat-transcript.js';
|
|
3
|
+
|
|
4
|
+
const XLSX_MIME = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
5
|
+
/** `<chat|message>-<agent name>-<YYYY-MM-DD>.<txt|xlsx>` */
|
|
6
|
+
const chatExportFilename = (scope, mentorName, format, date = new Date()) => `${sanitizeFilename(`${scope}-${mentorName}-${date.toISOString().slice(0, 10)}`)}.${format}`;
|
|
7
|
+
const buildTextExport = (messages, labels) => new Blob([buildTranscript(messages, labels)], { type: 'text/plain;charset=utf-8' });
|
|
8
|
+
const chatExportRows = (messages, labels) => messages.filter(isTranscribable).map((message) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return ({
|
|
11
|
+
time: (_a = message.timestamp) !== null && _a !== void 0 ? _a : '',
|
|
12
|
+
from: speakerLabel(message, labels),
|
|
13
|
+
message: flattenMarkdown(message.content),
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* One sheet, a header row (Time / From / Message), one row per message. The
|
|
18
|
+
* message cell wraps so its line breaks show inside the cell.
|
|
19
|
+
*/
|
|
20
|
+
const buildExcelExport = async (messages, labels) => {
|
|
21
|
+
// Loaded on demand: only an Excel export needs the writer.
|
|
22
|
+
const { default: writeXlsxFile } = await import('write-excel-file/browser');
|
|
23
|
+
const blob = await writeXlsxFile(chatExportRows(messages, labels), {
|
|
24
|
+
sheet: 'Chat',
|
|
25
|
+
columns: [
|
|
26
|
+
{ header: labels.columnTime, width: 26, cell: (row) => row.time },
|
|
27
|
+
{ header: labels.columnFrom, width: 24, cell: (row) => row.from },
|
|
28
|
+
{
|
|
29
|
+
header: labels.columnMessage,
|
|
30
|
+
width: 100,
|
|
31
|
+
cell: (row) => ({ value: row.message, wrap: true }),
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}).toBlob();
|
|
35
|
+
return blob.type ? blob : new Blob([blob], { type: XLSX_MIME });
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A raw message from the session history endpoint, reduced to what an export
|
|
39
|
+
* reads. The live chat's own normalizer (web-utils `normalizeSessionResults`)
|
|
40
|
+
* isn't exported, and an export needs only role, text and time.
|
|
41
|
+
*/
|
|
42
|
+
const historyResultToMessage = (result) => {
|
|
43
|
+
var _a, _b, _c, _d, _e;
|
|
44
|
+
const content = Array.isArray(result.content)
|
|
45
|
+
? ((_b = (_a = result.content.find((item) => item === null || item === void 0 ? void 0 : item.text)) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '')
|
|
46
|
+
: ((_c = result.content) !== null && _c !== void 0 ? _c : '');
|
|
47
|
+
return {
|
|
48
|
+
id: String((_d = result.id) !== null && _d !== void 0 ? _d : ''),
|
|
49
|
+
role: result.type === 'human' ? 'user' : result.type === 'system' ? 'system' : 'assistant',
|
|
50
|
+
content: typeof content === 'string' ? content : '',
|
|
51
|
+
timestamp: (_e = result.timestamp) !== null && _e !== void 0 ? _e : '',
|
|
52
|
+
visible: true,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { buildExcelExport, buildTextExport, chatExportFilename, chatExportRows, historyResultToMessage };
|
|
57
|
+
//# sourceMappingURL=chat-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-export.js","sources":["../../../../../../../src/components/chat/chat-export.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AA8BA,MAAM,SAAS,GAAG,mEAAmE;AAErF;AACO,MAAM,kBAAkB,GAAG,CAChC,KAAsB,EACtB,UAAkB,EAClB,MAAwB,EACxB,IAAA,GAAa,IAAI,IAAI,EAAE,KAEvB,GAAG,gBAAgB,CAAC,CAAA,EAAG,KAAK,IAAI,UAAU,CAAA,CAAA,EAAI,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA,CAAE,CAAC,CAAA,CAAA,EAAI,MAAM;AAErF,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAE,MAAwB,KAC3E,IAAI,IAAI,CAAC,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,0BA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,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AACjE;AAEA;;;;AAIG;AACI,MAAM,sBAAsB,GAAG,CAAC,MAA2B,KAAa;;IAC7E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO;WACvC,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAuB,KAAK,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,IAAI,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE;WACxE,CAAA,EAAA,GAAA,MAAM,CAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE,CAAC;IAC1B,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,CAAA,EAAA,GAAA,MAAM,CAAC,EAAE,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE,CAAC;QAC3B,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,QAAQ,GAAG,QAAQ,GAAG,WAAW;AAC1F,QAAA,OAAO,EAAE,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE;AACnD,QAAA,SAAS,EAAE,CAAA,EAAA,GAAA,MAAM,CAAC,SAAS,mCAAI,EAAE;AACjC,QAAA,OAAO,EAAE,IAAI;KACd;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-host-context.js","sources":["../../../../../../../src/components/chat/chat-host-context.tsx"],"sourcesContent":[null],"names":["_jsx","ChatMarkdown"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"chat-host-context.js","sources":["../../../../../../../src/components/chat/chat-host-context.tsx"],"sourcesContent":[null],"names":["_jsx","ChatMarkdown"],"mappings":";;;;;;AA6QO,MAAM,qBAAqB,GAA2B;AAC3D,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,gBAAgB,EAAE,IAAI;AACtB,IAAA,MAAM,EAAE,IAAI;;AAGR,SAAU,mBAAmB,CAAC,QAAuB,EAAA;AACzD,IAAA,MAAM,QAAQ,GAAG,EAAE,GAAG,qBAAqB,EAAE;IAC7C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAA2B,EAAE;QACjE,IAAI,CAAA,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,MAAA,GAAA,MAAA,GAAR,QAAQ,CAAG,GAAG,CAAC,MAAK,KAAK;AAAE,YAAA,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK;IACtD;AACA,IAAA,OAAO,QAAQ;AACjB;AAEA,MAAM,YAAY,GAAkB;AAClC,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,aAAa,EAAE,KAAK;AACpB,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,QAAQ,EAAE,qBAAqB;AAC/B,IAAA,KAAK,EAAE,EAAE;CACV;AAED,MAAM,eAAe,GAAG,aAAa,CAAuB,IAAI,C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E,aAAA,GAAyB,IAAI,KACpD,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,OAAO,EAAE,EACjD,CAAC,IAAI,CAAC,CACP;AACH;AAEA;;;AAGG;SACa,eAAe,GAAA;;AAC7B,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE;IAChC,OAAO,CAAA,EAAA,GAAA,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,MAAA,GAAA,MAAA,GAAN,MAAM,CAAE,iBAAiB,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAIC,QAAY;AAClD;;;;"}
|
|
@@ -5,8 +5,10 @@ const SEPARATOR = '----';
|
|
|
5
5
|
* Links keep their URL — a plain-text transcript has nowhere else to put it.
|
|
6
6
|
*/
|
|
7
7
|
const flattenInlineSegment = (segment) => segment
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
// No brackets inside the groups: a scan can't run past the next `[` or
|
|
9
|
+
// `(`, which keeps these linear on input like `![\![\…` (CodeQL ReDoS).
|
|
10
|
+
.replace(/!\[([^[\]]*)\]\([^()]*\)/g, '$1')
|
|
11
|
+
.replace(/\[([^[\]]*)\]\(([^()]*)\)/g, '$1 ($2)')
|
|
10
12
|
.replace(/(\*\*|__)(.*?)\1/g, '$2')
|
|
11
13
|
.replace(/(\*|_)(.*?)\1/g, '$2');
|
|
12
14
|
/**
|
|
@@ -49,19 +51,21 @@ const flattenMarkdown = (content) => {
|
|
|
49
51
|
.filter((line) => line !== null)
|
|
50
52
|
.join('\n');
|
|
51
53
|
};
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Messages that belong in a transcript: visible, non-system, with text. Saved
|
|
56
|
+
* history carries tool-call-only assistant turns whose content is empty.
|
|
57
|
+
*/
|
|
58
|
+
const isTranscribable = (message) => { var _a; return message.visible !== false && message.role !== 'system' && !!((_a = message.content) === null || _a === void 0 ? void 0 : _a.trim()); };
|
|
59
|
+
const speakerLabel = (message, labels) => message.role === 'user' ? labels.roleUser : labels.roleAi;
|
|
54
60
|
const renderMessage = (message, labels) => {
|
|
55
|
-
const
|
|
56
|
-
return `[${
|
|
61
|
+
const time = message.timestamp ? ` ${message.timestamp}` : '';
|
|
62
|
+
return `[${speakerLabel(message, labels)}]${time}\n${flattenMarkdown(message.content)}\n\n${SEPARATOR}\n`;
|
|
57
63
|
};
|
|
58
64
|
/** Build the plain-text transcript for a whole conversation. */
|
|
59
65
|
const buildTranscript = (messages, labels) => `${labels.header}\n\n${messages
|
|
60
66
|
.filter(isTranscribable)
|
|
61
67
|
.map((message) => renderMessage(message, labels))
|
|
62
68
|
.join('\n')}`;
|
|
63
|
-
/** Build the plain-text transcript for a single message. */
|
|
64
|
-
const buildMessageTranscript = (message, labels) => buildTranscript([message], labels);
|
|
65
69
|
|
|
66
|
-
export {
|
|
70
|
+
export { buildTranscript, flattenMarkdown, isTranscribable, speakerLabel };
|
|
67
71
|
//# sourceMappingURL=chat-transcript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-transcript.js","sources":["../../../../../../../src/components/chat/chat-transcript.ts"],"sourcesContent":[null],"names":[],"mappings":"AAeA,MAAM,SAAS,GAAG,MAAM;AAExB;;;;AAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,OAAe,KAC3C
|
|
1
|
+
{"version":3,"file":"chat-transcript.js","sources":["../../../../../../../src/components/chat/chat-transcript.ts"],"sourcesContent":[null],"names":[],"mappings":"AAeA,MAAM,SAAS,GAAG,MAAM;AAExB;;;;AAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,OAAe,KAC3C;;;AAGG,KAAA,OAAO,CAAC,2BAA2B,EAAE,IAAI;AACzC,KAAA,OAAO,CAAC,4BAA4B,EAAE,SAAS;AAC/C,KAAA,OAAO,CAAC,mBAAmB,EAAE,IAAI;AACjC,KAAA,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC;AAEpC;;;;AAIG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A,EAAA,CAAA,CAC3D,OAAA,OAAO,CAAC,OAAO,KAAK,KAAK,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,EAAC,CAAA,EAAA,GAAA,OAAO,CAAC,OAAO,0CAAE,IAAI,EAAE,CAAA,CAAA;AAE9E,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAE,MAAwB,KACrE,OAAO,CAAC,IAAI,KAAK,MAAM,GAAG,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC;AAErD,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAE,MAAwB,KAAY;AAC3E,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,CAAA,CAAA,EAAI,OAAO,CAAC,SAAS,CAAA,CAAE,GAAG,EAAE;AAC7D,IAAA,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA,CAAA,EAAI,IAAI,KAAK,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA,IAAA,EAAO,SAAS,IAAI;AAC3G,CAAC;AAED;AACO,MAAM,eAAe,GAAG,CAAC,QAAmB,EAAE,MAAwB,KAC3E,CAAA,EAAG,MAAM,CAAC,MAAM,OAAO;KACpB,MAAM,CAAC,eAAe;AACtB,KAAA,GAAG,CAAC,CAAC,OAAO,KAAK,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC;AAC/C,KAAA,IAAI,CAAC,IAAI,CAAC,CAAA;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useLazyGetSessionIdQuery } from '@iblai/data-layer';
|
|
3
|
+
import { historyResultToMessage } from './chat-export.js';
|
|
4
|
+
|
|
5
|
+
const WHOLE_CHAT_PAGE_SIZE = 100;
|
|
6
|
+
// A runaway `next` link must not loop forever; 50 pages is 5000 messages.
|
|
7
|
+
const WHOLE_CHAT_MAX_PAGES = 50;
|
|
8
|
+
const IDLE = { status: 'idle', messages: [] };
|
|
9
|
+
/**
|
|
10
|
+
* Every saved message of a session. The chat only holds the pages the user
|
|
11
|
+
* scrolled to, so an export reads the whole history itself. A session the
|
|
12
|
+
* backend has never saved (404) or an anonymous chat yields `ready` with no
|
|
13
|
+
* messages — the caller then falls back to what it already has on screen.
|
|
14
|
+
*/
|
|
15
|
+
function useWholeChat({ enabled, org, username, sessionId }) {
|
|
16
|
+
const [readSession] = useLazyGetSessionIdQuery();
|
|
17
|
+
const [state, setState] = useState(IDLE);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!org || !username || !sessionId) {
|
|
20
|
+
setState({ status: 'ready', messages: [] });
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let cancelled = false;
|
|
24
|
+
setState({ status: 'loading', messages: [] });
|
|
25
|
+
const load = async () => {
|
|
26
|
+
var _a, _b, _c;
|
|
27
|
+
// The endpoint pages newest-first, and each page lists newest-first.
|
|
28
|
+
const newestFirst = [];
|
|
29
|
+
for (let page = 1; page <= WHOLE_CHAT_MAX_PAGES; page++) {
|
|
30
|
+
const result = (await readSession({
|
|
31
|
+
org,
|
|
32
|
+
userId: username,
|
|
33
|
+
sessionId,
|
|
34
|
+
page,
|
|
35
|
+
pageSize: WHOLE_CHAT_PAGE_SIZE,
|
|
36
|
+
}));
|
|
37
|
+
if (result.error) {
|
|
38
|
+
if (result.error.status === 404)
|
|
39
|
+
break;
|
|
40
|
+
throw result.error;
|
|
41
|
+
}
|
|
42
|
+
newestFirst.push(...((_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.results) !== null && _b !== void 0 ? _b : []));
|
|
43
|
+
if (!((_c = result.data) === null || _c === void 0 ? void 0 : _c.next))
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
return newestFirst.reverse().map(historyResultToMessage);
|
|
47
|
+
};
|
|
48
|
+
load().then((messages) => {
|
|
49
|
+
if (!cancelled)
|
|
50
|
+
setState({ status: 'ready', messages });
|
|
51
|
+
}, () => {
|
|
52
|
+
if (!cancelled)
|
|
53
|
+
setState({ status: 'error', messages: [] });
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
cancelled = true;
|
|
57
|
+
};
|
|
58
|
+
}, [enabled, org, username, sessionId, readSession]);
|
|
59
|
+
return state;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { WHOLE_CHAT_MAX_PAGES, WHOLE_CHAT_PAGE_SIZE, useWholeChat };
|
|
63
|
+
//# sourceMappingURL=use-whole-chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-whole-chat.js","sources":["../../../../../../../src/components/chat/use-whole-chat.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAQO,MAAM,oBAAoB,GAAG;AACpC;AACO,MAAM,oBAAoB,GAAG;AAkBpC,MAAM,IAAI,GAAc,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;AAOxD;;;;;AAKG;AACG,SAAU,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAoB,EAAA;AAClF,IAAA,MAAM,CAAC,WAAW,CAAC,GAAG,wBAAwB,EAAE;IAChD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAY,IAAI,CAAC;IAEnD,SAAS,CAAC,MAAK;QAKb,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,EAAE;YACnC,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;YAC3C;QACF;QACA,IAAI,SAAS,GAAG,KAAK;QACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC7C,QAAA,MAAM,IAAI,GAAG,YAAW;;;YAEtB,MAAM,WAAW,GAA0B,EAAE;AAC7C,YAAA,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,IA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AW,CAAC,CAAC;AAEpD,IAAA,OAAO,KAAK;AACd;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
3
|
import { useMediaQuery } from '../node_modules/.pnpm/react-responsive@10.0.1_react@19.1.0/node_modules/react-responsive/dist/esm/index.js';
|
|
3
4
|
import { AppSyncBanner } from './welcome-chat/app-sync-banner.js';
|
|
4
5
|
import { useExploreMentorsList, EXPLORE_MENTORS_SECTION_ID, ExploreMentors } from './welcome-chat/explore-mentors.js';
|
|
@@ -12,6 +13,7 @@ import { WelcomeMessage } from './welcome-chat/welcome-message.js';
|
|
|
12
13
|
import { ProjectLandingPage } from './projects/project-landing-page.js';
|
|
13
14
|
import { useChatHost, useChatT } from './chat/chat-host-context.js';
|
|
14
15
|
import { useChatMentorSettings } from './chat/hooks/use-chat-mentor-settings.js';
|
|
16
|
+
import ChevronUp from '../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/chevron-up.js';
|
|
15
17
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
16
18
|
|
|
17
19
|
/** Width of the centred empty-state composer (#2586 design). */
|
|
@@ -34,6 +36,21 @@ function WelcomeChatNew({ mentorName, sessionId, enabledGuidedPrompts, onSubmit,
|
|
|
34
36
|
skip: !showExploreMentors || embedMode || !!projectId,
|
|
35
37
|
});
|
|
36
38
|
const hasExploreMentors = showExploreMentors && !!((_d = exploreMentors === null || exploreMentors === void 0 ? void 0 : exploreMentors.results) === null || _d === void 0 ? void 0 : _d.length);
|
|
39
|
+
const showExploreButton = hasExploreMentors && !isPhone;
|
|
40
|
+
const rootRef = useRef(null);
|
|
41
|
+
const exploreButtonRef = useRef(null);
|
|
42
|
+
const [exploreInView, setExploreInView] = useState(false);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const section = showExploreButton ? document.getElementById(EXPLORE_MENTORS_SECTION_ID) : null;
|
|
45
|
+
if (!section)
|
|
46
|
+
return;
|
|
47
|
+
// Any visible part counts: on the first screen the section starts below the fold, and
|
|
48
|
+
// when Explore is too short for the button to reach the top, the section's top stays
|
|
49
|
+
// low in the view, so a stricter margin would never report it in view.
|
|
50
|
+
const observer = new IntersectionObserver(([entry]) => setExploreInView(entry.isIntersecting));
|
|
51
|
+
observer.observe(section);
|
|
52
|
+
return () => observer.disconnect();
|
|
53
|
+
}, [showExploreButton]);
|
|
37
54
|
const showConversationStarters = ((_e = host.showConversationStarters) !== null && _e !== void 0 ? _e : false) && host.features.suggestedPrompts;
|
|
38
55
|
const { data: project } = useGetUserProjectDetailsQuery({
|
|
39
56
|
tenantKey,
|
|
@@ -54,13 +71,15 @@ function WelcomeChatNew({ mentorName, sessionId, enabledGuidedPrompts, onSubmit,
|
|
|
54
71
|
// The centred composer is 640px wide (#2586), or narrower when the tenant's
|
|
55
72
|
// chat area is.
|
|
56
73
|
const composerMaxWidth = Math.min(chatAreaMaxWidth, EMPTY_STATE_COMPOSER_WIDTH);
|
|
57
|
-
return (jsxs("div", { className: "flex h-full flex-col", "data-testid": "chat-empty-state", children: [tenantKey === (config === null || config === void 0 ? void 0 : config.mainTenantKey) && (config === null || config === void 0 ? void 0 : config.appSyncBanner) && jsx(AppSyncBanner, {}), jsxs("div", { className: "relative flex min-h-full w-full flex-1 shrink-0 flex-col md:justify-center md:pb-[83px]", children: [jsxs("div", { className: "flex flex-1 flex-col items-center justify-center px-4 md:flex-none", children: [jsx(WelcomeHeading, { mentorName: mentorName }), jsx("div", { className: "w-full max-w-[640px] text-center md:mb-6", children: jsx(WelcomeMessage, { aiWelcomeMessage: aiWelcomeMessage, sessionId: sessionId, username: username, tenantKey: tenantKey, mentorUniqueId: mentorUniqueId, token: axdToken, isNewSession: isNewSession, className: "text-[15px] leading-[22px] text-gray-600 md:text-base md:leading-6" }) })] }), jsxs("div", { className: "mx-auto w-full", style: { maxWidth: `${composerMaxWidth}px` }, children: [jsx(ChatInputForm, { variant: "redesign", sessionId: sessionId, onSubmit: onSubmit, stopGenerating: stopGenerating, onScreenSharingClick: onScreenSharingClick, isScreenSharingModalOpen: isScreenSharingModalOpen, onPhoneCallClick: onPhoneCallClick, tenantKey: tenantKey, username: username !== null && username !== void 0 ? username : '', setMessage: setMessage, enableSafetyDisclaimer: enableSafetyDisclaimer, isPreviewMode: isPreviewMode, enableWebBrowsing: enableWebBrowsing, isStreaming: isStreaming, updateSessionTools: updateSessionTools, setSessionTools: setSessionTools, activeTools: activeTools, screenSharing: screenSharing, deepResearch: deepResearch, studyMode: studyMode, imageGeneration: imageGeneration, codeInterpreter: codeInterpreter, promptsIsEnabled: promptsIsEnabled, googleSlidesIsEnabled: googleSlidesIsEnabled, googleDocumentIsEnabled: googleDocumentIsEnabled, artifactsEnabled: artifactsEnabled, isConnecting: isConnecting, compactMode: compactMode,
|
|
74
|
+
return (jsxs("div", { ref: rootRef, className: "flex h-full flex-col", "data-testid": "chat-empty-state", children: [tenantKey === (config === null || config === void 0 ? void 0 : config.mainTenantKey) && (config === null || config === void 0 ? void 0 : config.appSyncBanner) && jsx(AppSyncBanner, {}), jsxs("div", { className: "relative flex min-h-full w-full flex-1 shrink-0 flex-col md:justify-center md:pb-[83px]", children: [jsxs("div", { className: "flex flex-1 flex-col items-center justify-center px-4 md:flex-none", children: [jsx(WelcomeHeading, { mentorName: mentorName }), jsx("div", { className: "w-full max-w-[640px] text-center md:mb-6", children: jsx(WelcomeMessage, { aiWelcomeMessage: aiWelcomeMessage, sessionId: sessionId, username: username, tenantKey: tenantKey, mentorUniqueId: mentorUniqueId, token: axdToken, isNewSession: isNewSession, className: "text-[15px] leading-[22px] text-gray-600 md:text-base md:leading-6" }) })] }), jsxs("div", { className: "mx-auto w-full", style: { maxWidth: `${composerMaxWidth}px` }, children: [jsx(ChatInputForm, { variant: "redesign", sessionId: sessionId, onSubmit: onSubmit, stopGenerating: stopGenerating, onScreenSharingClick: onScreenSharingClick, isScreenSharingModalOpen: isScreenSharingModalOpen, onPhoneCallClick: onPhoneCallClick, tenantKey: tenantKey, username: username !== null && username !== void 0 ? username : '', setMessage: setMessage, enableSafetyDisclaimer: enableSafetyDisclaimer, isPreviewMode: isPreviewMode, enableWebBrowsing: enableWebBrowsing, isStreaming: isStreaming, updateSessionTools: updateSessionTools, setSessionTools: setSessionTools, activeTools: activeTools, screenSharing: screenSharing, deepResearch: deepResearch, studyMode: studyMode, imageGeneration: imageGeneration, codeInterpreter: codeInterpreter, promptsIsEnabled: promptsIsEnabled, googleSlidesIsEnabled: googleSlidesIsEnabled, googleDocumentIsEnabled: googleDocumentIsEnabled, artifactsEnabled: artifactsEnabled, isConnecting: isConnecting, compactMode: compactMode,
|
|
58
75
|
// Phones: up to four guided-prompt rows above the pinned composer.
|
|
59
|
-
promptsAbove: showConversationStarters && isPhone ? (jsx(ConversationStarters, { layout: "rows", onTemplateSelect: onSubmit, enabledGuidedPrompts: enabledGuidedPrompts, sessionId: sessionId })) : undefined }), showConversationStarters && !isPhone && (jsx(ConversationStarters, { layout: "wrap", className: "mt-4 px-4", onTemplateSelect: onSubmit, enabledGuidedPrompts: enabledGuidedPrompts, sessionId: sessionId }))] }),
|
|
76
|
+
promptsAbove: showConversationStarters && isPhone ? (jsx(ConversationStarters, { layout: "rows", onTemplateSelect: onSubmit, enabledGuidedPrompts: enabledGuidedPrompts, sessionId: sessionId })) : undefined }), showConversationStarters && !isPhone && (jsx(ConversationStarters, { layout: "wrap", className: "mt-4 px-4", onTemplateSelect: onSubmit, enabledGuidedPrompts: enabledGuidedPrompts, sessionId: sessionId }))] }), showExploreButton && (jsxs("button", { ref: exploreButtonRef, type: "button", onClick: () => {
|
|
60
77
|
var _a;
|
|
61
|
-
return (_a =
|
|
62
|
-
|
|
63
|
-
|
|
78
|
+
return (_a = (exploreInView ? rootRef : exploreButtonRef).current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
79
|
+
behavior: 'smooth',
|
|
80
|
+
block: 'start',
|
|
81
|
+
});
|
|
82
|
+
}, className: "absolute bottom-4 left-1/2 flex h-9 -translate-x-1/2 items-center gap-1.5 rounded-full px-3.5 text-[13px] font-medium text-gray-600 hover:bg-gray-100", children: [t('chat.welcomeChatExploreMentors.exploreAgents'), exploreInView ? (jsx(ChevronUp, { className: "h-4 w-4", "aria-hidden": "true" })) : (jsx(ChevronDown, { className: "h-4 w-4", "aria-hidden": "true" }))] }))] }), showExploreMentors && (jsx("div", { className: "pt-8 pb-12", children: jsx(ExploreMentors, {}) }))] }));
|
|
64
83
|
}
|
|
65
84
|
|
|
66
85
|
export { WelcomeChatNew };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcome-chat-new.js","sources":["../../../../../../src/components/welcome-chat-new.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"welcome-chat-new.js","sources":["../../../../../../src/components/welcome-chat-new.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA;AACA,MAAM,0BAA0B,GAAG,GAAG;SAuCtB,cAAc,CAAC,EAC7B,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,QAAQ,EACR,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,aAAa,EACb,YAAY,EACZ,SAAS,EACT,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,GAAG,cAAc,CAAC,OAAO,EACzC,YAAY,GAAG,IAAI,EACnB,gBAAgB,GAAG,EAAE,EACrB,YAAY,GA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EAAA,CACpB,CACH,CAAA,EAAA,CACG,EAIL,iBAAiB,KAChBC,iBACE,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,MAAK;;AACZ,4BAAA,OAAA,MAAA,CAAC,aAAa,GAAG,OAAO,GAAG,gBAAgB,EAAE,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,cAAc,CAAC;AACnE,gCAAA,QAAQ,EAAE,QAAQ;AAClB,gCAAA,KAAK,EAAE,OAAO;AACf,6BAAA,CAAC;yBAAA,EAEJ,SAAS,EAAC,uJAAuJ,EAAA,QAAA,EAAA,CAEhK,CAAC,CAAC,8CAA8C,CAAC,EACjD,aAAa,IACZD,GAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAC,SAAS,EAAA,aAAA,EAAa,MAAM,EAAA,CAAG,KAEpDA,IAAC,WAAW,EAAA,EAAC,SAAS,EAAC,SAAS,EAAA,aAAA,EAAa,MAAM,EAAA,CAAG,CACvD,CAAA,EAAA,CACM,CACV,CAAA,EAAA,CACG,EAGL,kBAAkB,KACjBA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,YAAY,EAAA,QAAA,EACzBA,GAAA,CAAC,cAAc,EAAA,EAAA,CAAG,EAAA,CACd,CACP,CAAA,EAAA,CAQG;AAEV;;;;"}
|
|
@@ -7230,6 +7230,7 @@ var chat = {
|
|
|
7230
7230
|
download: "Download",
|
|
7231
7231
|
dialogTitle: "Download Chat",
|
|
7232
7232
|
dialogDescription: "Choose what you would like to download as a text file.",
|
|
7233
|
+
formatDialogDescription: "Choose what to download and the type of file.",
|
|
7233
7234
|
entireChat: "Entire chat",
|
|
7234
7235
|
entireChatDescription: "Every message in this conversation.",
|
|
7235
7236
|
thisMessage: "This message only",
|
|
@@ -7237,7 +7238,24 @@ var chat = {
|
|
|
7237
7238
|
downloadButton: "Download",
|
|
7238
7239
|
transcriptHeader: "Chat with {mentorName}",
|
|
7239
7240
|
roleUser: "You",
|
|
7240
|
-
roleAi: "AI"
|
|
7241
|
+
roleAi: "AI",
|
|
7242
|
+
scopeLabel: "What to download",
|
|
7243
|
+
formatLabel: "File type",
|
|
7244
|
+
formatText: "Text (.txt)",
|
|
7245
|
+
formatTextDescription: "Plain text that opens anywhere.",
|
|
7246
|
+
formatExcel: "Excel (.xlsx)",
|
|
7247
|
+
formatExcelDescription: "A spreadsheet with one row per message.",
|
|
7248
|
+
exportTitle: "Export Chat",
|
|
7249
|
+
exportButton: "Export",
|
|
7250
|
+
gettingWholeChat: "Getting the whole chat…",
|
|
7251
|
+
preparingFile: "Getting your file ready…",
|
|
7252
|
+
wholeChatError: "We couldn't get this chat. Please try again.",
|
|
7253
|
+
wholeChatErrorMessageStillWorks: "We couldn't get the whole chat. You can still download this message.",
|
|
7254
|
+
fileError: "We couldn't make the Excel file. Please try again.",
|
|
7255
|
+
saveError: "We couldn't save the file. Please try again.",
|
|
7256
|
+
columnTime: "Time",
|
|
7257
|
+
columnFrom: "From",
|
|
7258
|
+
columnMessage: "Message"
|
|
7241
7259
|
},
|
|
7242
7260
|
chatAiMessageRating: {
|
|
7243
7261
|
positiveFeedbackSrOnly: "Positive Feedback Thumbs Up",
|