@uipath/apollo-react 7.6.1 → 7.8.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/canvas/components/Guardrails/components/guardrail-action-section.cjs +2 -2
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts +2 -1
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/guardrail-action-section.js +2 -2
- package/dist/canvas/components/Guardrails/guardrail-builder.cjs +2 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts +2 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/guardrail-builder.js +2 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/chat/locales/en.cjs +1 -1
- package/dist/chat/locales/en.d.ts.map +1 -1
- package/dist/chat/locales/en.js +1 -1
- package/dist/chat/stories/chat-story-fixtures.d.ts +1 -1
- package/dist/chat/stories/chat-story-fixtures.d.ts.map +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/chat/wind/composer/chat-composer.cjs +1 -3
- package/dist/chat/wind/composer/chat-composer.d.ts.map +1 -1
- package/dist/chat/wind/composer/chat-composer.js +2 -4
- package/dist/chat/wind/composer/chat-dropzone.cjs +29 -25
- package/dist/chat/wind/composer/chat-dropzone.d.ts +1 -1
- package/dist/chat/wind/composer/chat-dropzone.d.ts.map +1 -1
- package/dist/chat/wind/composer/chat-dropzone.js +20 -26
- package/dist/chat/wind/history/chat-history.d.ts.map +1 -1
- package/dist/chat/wind/history/history-panel.cjs +18 -7
- package/dist/chat/wind/history/history-panel.d.ts.map +1 -1
- package/dist/chat/wind/history/history-panel.js +19 -8
- package/dist/chat/wind/layout/full-screen-layout.cjs +0 -6
- package/dist/chat/wind/layout/full-screen-layout.d.ts.map +1 -1
- package/dist/chat/wind/layout/full-screen-layout.js +0 -6
- package/dist/chat/wind/layout/regions.cjs +1 -1
- package/dist/chat/wind/layout/regions.js +1 -1
- package/dist/chat/wind/messages/message-attachments.cjs +3 -20
- package/dist/chat/wind/messages/message-attachments.d.ts +0 -4
- package/dist/chat/wind/messages/message-attachments.d.ts.map +1 -1
- package/dist/chat/wind/messages/message-attachments.js +2 -10
- package/dist/chat/wind/messages/message-list.cjs +4 -0
- package/dist/chat/wind/messages/message-list.d.ts.map +1 -1
- package/dist/chat/wind/messages/message-list.js +4 -0
- package/dist/chat/wind/renderers/chat-code-block.cjs +169 -0
- package/dist/chat/wind/renderers/chat-code-block.d.ts +10 -0
- package/dist/chat/wind/renderers/chat-code-block.d.ts.map +1 -0
- package/dist/chat/wind/renderers/chat-code-block.js +125 -0
- package/dist/chat/wind/renderers/markdown-renderer.cjs +4 -3
- package/dist/chat/wind/renderers/markdown-renderer.d.ts.map +1 -1
- package/dist/chat/wind/renderers/markdown-renderer.js +4 -3
- package/dist/chat/wind/renderers/tool-call-renderer.cjs +13 -17
- package/dist/chat/wind/renderers/tool-call-renderer.d.ts.map +1 -1
- package/dist/chat/wind/renderers/tool-call-renderer.js +13 -17
- package/dist/chat/wind/renderers/tree-renderer.cjs +14 -9
- package/dist/chat/wind/renderers/tree-renderer.d.ts.map +1 -1
- package/dist/chat/wind/renderers/tree-renderer.js +13 -8
- package/package.json +3 -3
- package/dist/chat/wind/renderers/code-block-actions.cjs +0 -176
- package/dist/chat/wind/renderers/code-block-actions.d.ts +0 -9
- package/dist/chat/wind/renderers/code-block-actions.d.ts.map +0 -1
- package/dist/chat/wind/renderers/code-block-actions.js +0 -132
- package/dist/chat/wind/renderers/disclosure-tree.cjs +0 -136
- package/dist/chat/wind/renderers/disclosure-tree.d.ts +0 -22
- package/dist/chat/wind/renderers/disclosure-tree.d.ts.map +0 -1
- package/dist/chat/wind/renderers/disclosure-tree.js +0 -92
|
@@ -120,7 +120,6 @@ function WindChatComposer() {
|
|
|
120
120
|
status: isResponseInFlight ? 'streaming' : 'idle',
|
|
121
121
|
onStop: canStopResponse ? stop : void 0,
|
|
122
122
|
submitDisabled: skeletonLoader,
|
|
123
|
-
density: spacing.compactMode ? 'compact' : 'comfortable',
|
|
124
123
|
attachments: items,
|
|
125
124
|
onRemoveAttachment: (item)=>{
|
|
126
125
|
const index = items.findIndex(({ id })=>id === item.id);
|
|
@@ -142,8 +141,7 @@ function WindChatComposer() {
|
|
|
142
141
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.ChatComposerInputGroup, {
|
|
143
142
|
children: [
|
|
144
143
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.ChatComposerAttachments, {
|
|
145
|
-
className: "gap-2 [&_[data-slot=attachment-
|
|
146
|
-
onPointerOver: message_attachments_cjs_namespaceObject.titleTruncatedChip
|
|
144
|
+
className: "gap-2 [&_[data-slot=attachment-action]]:size-5 [&_[data-slot=attachment-media]]:rounded-sm [&_[data-slot=attachment-media]]:bg-transparent [&_[data-slot=attachment]]:min-w-0 [&_[data-slot=attachment]]:max-w-[calc(50%-4px)] [&_[data-slot=attachment]]:gap-1.5 [&_[data-slot=attachment]]:rounded-lg [&_[data-slot=attachment][data-size=sm]]:p-1 [&_[data-slot=attachment][data-size=sm]_[data-slot=attachment-media]]:w-5"
|
|
147
145
|
}),
|
|
148
146
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.ChatComposerTextarea, {
|
|
149
147
|
ref: textarea,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/composer/chat-composer.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/composer/chat-composer.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,gBAAgB,4CAkJ/B"}
|
|
@@ -11,7 +11,7 @@ import { useChatState } from "../../headless/providers/chat-state-provider.js";
|
|
|
11
11
|
import { useError } from "../../headless/providers/error-provider.js";
|
|
12
12
|
import { useLoading } from "../../headless/providers/loading-provider.js";
|
|
13
13
|
import { AutopilotChatEvent, AutopilotChatInternalEvent } from "../../service/index.js";
|
|
14
|
-
import { AttachmentTypeIcon
|
|
14
|
+
import { AttachmentTypeIcon } from "../messages/message-attachments.js";
|
|
15
15
|
import { useMarkdownStrings } from "../renderers/markdown-renderer.js";
|
|
16
16
|
import { useComposerStrings } from "./composer-strings.js";
|
|
17
17
|
const promptText = (prompt)=>'string' == typeof prompt ? prompt : prompt?.content ?? '';
|
|
@@ -82,7 +82,6 @@ function WindChatComposer() {
|
|
|
82
82
|
status: isResponseInFlight ? 'streaming' : 'idle',
|
|
83
83
|
onStop: canStopResponse ? stop : void 0,
|
|
84
84
|
submitDisabled: skeletonLoader,
|
|
85
|
-
density: spacing.compactMode ? 'compact' : 'comfortable',
|
|
86
85
|
attachments: items,
|
|
87
86
|
onRemoveAttachment: (item)=>{
|
|
88
87
|
const index = items.findIndex(({ id })=>id === item.id);
|
|
@@ -104,8 +103,7 @@ function WindChatComposer() {
|
|
|
104
103
|
/*#__PURE__*/ jsxs(ChatComposerInputGroup, {
|
|
105
104
|
children: [
|
|
106
105
|
/*#__PURE__*/ jsx(ChatComposerAttachments, {
|
|
107
|
-
className: "gap-2 [&_[data-slot=attachment-
|
|
108
|
-
onPointerOver: titleTruncatedChip
|
|
106
|
+
className: "gap-2 [&_[data-slot=attachment-action]]:size-5 [&_[data-slot=attachment-media]]:rounded-sm [&_[data-slot=attachment-media]]:bg-transparent [&_[data-slot=attachment]]:min-w-0 [&_[data-slot=attachment]]:max-w-[calc(50%-4px)] [&_[data-slot=attachment]]:gap-1.5 [&_[data-slot=attachment]]:rounded-lg [&_[data-slot=attachment][data-size=sm]]:p-1 [&_[data-slot=attachment][data-size=sm]_[data-slot=attachment-media]]:w-5"
|
|
109
107
|
}),
|
|
110
108
|
/*#__PURE__*/ jsx(ChatComposerTextarea, {
|
|
111
109
|
ref: textarea,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
3
12
|
(()=>{
|
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -29,57 +38,52 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
39
|
const react_namespaceObject = require("@lingui/react");
|
|
31
40
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
41
|
+
const external_react_namespaceObject = require("react");
|
|
42
|
+
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
32
43
|
const use_attachment_intake_cjs_namespaceObject = require("../../headless/hooks/use-attachment-intake.cjs");
|
|
44
|
+
const use_attachment_limits_cjs_namespaceObject = require("../../headless/hooks/use-attachment-limits.cjs");
|
|
33
45
|
const attachments_provider_cjs_namespaceObject = require("../../headless/providers/attachments-provider.cjs");
|
|
34
46
|
const chat_state_provider_cjs_namespaceObject = require("../../headless/providers/chat-state-provider.cjs");
|
|
35
47
|
const carriesFiles = (data)=>Array.from(data?.types ?? []).includes('Files');
|
|
36
|
-
function filesFrom(data) {
|
|
37
|
-
const files = Array.from(data?.files ?? []);
|
|
38
|
-
if (files.length > 0) return files;
|
|
39
|
-
return Array.from(data?.items ?? []).filter((item)=>'file' === item.kind).map((item)=>item.getAsFile()).filter((file)=>null !== file);
|
|
40
|
-
}
|
|
41
48
|
function WindChatDropzone({ disabled, children }) {
|
|
42
49
|
const { _ } = (0, react_namespaceObject.useLingui)();
|
|
43
50
|
const { disabledFeatures, allowedAttachments } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
44
51
|
const { attachments } = (0, attachments_provider_cjs_namespaceObject.useAttachments)();
|
|
45
52
|
const takeFiles = (0, use_attachment_intake_cjs_namespaceObject.useAttachmentIntake)();
|
|
46
53
|
const inactive = disabled || !!disabledFeatures.attachments;
|
|
47
|
-
const accept = (0, use_attachment_intake_cjs_namespaceObject.getAcceptedFileTypes)(allowedAttachments.types)
|
|
54
|
+
const accept = external_react_default().useMemo(()=>(0, use_attachment_intake_cjs_namespaceObject.getAcceptedFileTypes)(allowedAttachments.types), [
|
|
55
|
+
allowedAttachments.types
|
|
56
|
+
]);
|
|
57
|
+
const limitHints = (0, use_attachment_limits_cjs_namespaceObject.useDropzoneLimitHints)(allowedAttachments);
|
|
58
|
+
const dropHint = _({
|
|
59
|
+
id: 'autopilot-chat.dropzone.overlay-title'
|
|
60
|
+
});
|
|
61
|
+
const strings = external_react_default().useMemo(()=>({
|
|
62
|
+
dropHint,
|
|
63
|
+
...limitHints
|
|
64
|
+
}), [
|
|
65
|
+
dropHint,
|
|
66
|
+
limitHints
|
|
67
|
+
]);
|
|
48
68
|
const maxCount = allowedAttachments.maxCount || void 0;
|
|
49
69
|
const remaining = void 0 === maxCount ? void 0 : Math.max(0, maxCount - attachments.length);
|
|
50
70
|
const swallowDrop = (event)=>{
|
|
51
71
|
if (inactive && carriesFiles(event.dataTransfer)) event.preventDefault();
|
|
52
72
|
};
|
|
53
|
-
const paste = (event)=>{
|
|
54
|
-
if (inactive) return;
|
|
55
|
-
const files = filesFrom(event.clipboardData);
|
|
56
|
-
if (0 === files.length) return;
|
|
57
|
-
const { accepted, rejected } = (0, apollo_wind_namespaceObject.validateFiles)(files, {
|
|
58
|
-
accept,
|
|
59
|
-
maxSize: allowedAttachments.maxSize,
|
|
60
|
-
maxFiles: remaining
|
|
61
|
-
});
|
|
62
|
-
if (accepted.length > 0) event.preventDefault();
|
|
63
|
-
takeFiles(accepted, rejected);
|
|
64
|
-
};
|
|
65
73
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DropzoneOverlay, {
|
|
66
74
|
"data-slot": "wind-chat-dropzone",
|
|
67
|
-
className: "flex min-h-0 flex-1 flex-col",
|
|
75
|
+
className: "flex min-h-0 flex-1 flex-col [&_[data-slot=dropzone-overlay]]:px-6 [&_[data-slot=dropzone-overlay]]:text-center",
|
|
68
76
|
disabled: inactive,
|
|
69
77
|
accept: accept,
|
|
70
78
|
maxSize: allowedAttachments.maxSize,
|
|
71
79
|
maxFiles: remaining,
|
|
72
80
|
onDragOver: swallowDrop,
|
|
73
81
|
onDrop: swallowDrop,
|
|
74
|
-
|
|
82
|
+
enablePaste: true,
|
|
75
83
|
onFiles: (accepted, rejected)=>{
|
|
76
84
|
takeFiles(accepted, rejected);
|
|
77
85
|
},
|
|
78
|
-
strings:
|
|
79
|
-
dropHint: _({
|
|
80
|
-
id: 'autopilot-chat.dropzone.overlay-title'
|
|
81
|
-
})
|
|
82
|
-
},
|
|
86
|
+
strings: strings,
|
|
83
87
|
children: children
|
|
84
88
|
});
|
|
85
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-dropzone.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/composer/chat-dropzone.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"chat-dropzone.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/composer/chat-dropzone.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CA+CA"}
|
|
@@ -1,57 +1,51 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useLingui } from "@lingui/react";
|
|
3
|
-
import { DropzoneOverlay
|
|
3
|
+
import { DropzoneOverlay } from "@uipath/apollo-wind";
|
|
4
|
+
import react from "react";
|
|
4
5
|
import { getAcceptedFileTypes, useAttachmentIntake } from "../../headless/hooks/use-attachment-intake.js";
|
|
6
|
+
import { useDropzoneLimitHints } from "../../headless/hooks/use-attachment-limits.js";
|
|
5
7
|
import { useAttachments } from "../../headless/providers/attachments-provider.js";
|
|
6
8
|
import { useChatState } from "../../headless/providers/chat-state-provider.js";
|
|
7
9
|
const carriesFiles = (data)=>Array.from(data?.types ?? []).includes('Files');
|
|
8
|
-
function filesFrom(data) {
|
|
9
|
-
const files = Array.from(data?.files ?? []);
|
|
10
|
-
if (files.length > 0) return files;
|
|
11
|
-
return Array.from(data?.items ?? []).filter((item)=>'file' === item.kind).map((item)=>item.getAsFile()).filter((file)=>null !== file);
|
|
12
|
-
}
|
|
13
10
|
function WindChatDropzone({ disabled, children }) {
|
|
14
11
|
const { _ } = useLingui();
|
|
15
12
|
const { disabledFeatures, allowedAttachments } = useChatState();
|
|
16
13
|
const { attachments } = useAttachments();
|
|
17
14
|
const takeFiles = useAttachmentIntake();
|
|
18
15
|
const inactive = disabled || !!disabledFeatures.attachments;
|
|
19
|
-
const accept = getAcceptedFileTypes(allowedAttachments.types)
|
|
16
|
+
const accept = react.useMemo(()=>getAcceptedFileTypes(allowedAttachments.types), [
|
|
17
|
+
allowedAttachments.types
|
|
18
|
+
]);
|
|
19
|
+
const limitHints = useDropzoneLimitHints(allowedAttachments);
|
|
20
|
+
const dropHint = _({
|
|
21
|
+
id: 'autopilot-chat.dropzone.overlay-title'
|
|
22
|
+
});
|
|
23
|
+
const strings = react.useMemo(()=>({
|
|
24
|
+
dropHint,
|
|
25
|
+
...limitHints
|
|
26
|
+
}), [
|
|
27
|
+
dropHint,
|
|
28
|
+
limitHints
|
|
29
|
+
]);
|
|
20
30
|
const maxCount = allowedAttachments.maxCount || void 0;
|
|
21
31
|
const remaining = void 0 === maxCount ? void 0 : Math.max(0, maxCount - attachments.length);
|
|
22
32
|
const swallowDrop = (event)=>{
|
|
23
33
|
if (inactive && carriesFiles(event.dataTransfer)) event.preventDefault();
|
|
24
34
|
};
|
|
25
|
-
const paste = (event)=>{
|
|
26
|
-
if (inactive) return;
|
|
27
|
-
const files = filesFrom(event.clipboardData);
|
|
28
|
-
if (0 === files.length) return;
|
|
29
|
-
const { accepted, rejected } = validateFiles(files, {
|
|
30
|
-
accept,
|
|
31
|
-
maxSize: allowedAttachments.maxSize,
|
|
32
|
-
maxFiles: remaining
|
|
33
|
-
});
|
|
34
|
-
if (accepted.length > 0) event.preventDefault();
|
|
35
|
-
takeFiles(accepted, rejected);
|
|
36
|
-
};
|
|
37
35
|
return /*#__PURE__*/ jsx(DropzoneOverlay, {
|
|
38
36
|
"data-slot": "wind-chat-dropzone",
|
|
39
|
-
className: "flex min-h-0 flex-1 flex-col",
|
|
37
|
+
className: "flex min-h-0 flex-1 flex-col [&_[data-slot=dropzone-overlay]]:px-6 [&_[data-slot=dropzone-overlay]]:text-center",
|
|
40
38
|
disabled: inactive,
|
|
41
39
|
accept: accept,
|
|
42
40
|
maxSize: allowedAttachments.maxSize,
|
|
43
41
|
maxFiles: remaining,
|
|
44
42
|
onDragOver: swallowDrop,
|
|
45
43
|
onDrop: swallowDrop,
|
|
46
|
-
|
|
44
|
+
enablePaste: true,
|
|
47
45
|
onFiles: (accepted, rejected)=>{
|
|
48
46
|
takeFiles(accepted, rejected);
|
|
49
47
|
},
|
|
50
|
-
strings:
|
|
51
|
-
dropHint: _({
|
|
52
|
-
id: 'autopilot-chat.dropzone.overlay-title'
|
|
53
|
-
})
|
|
54
|
-
},
|
|
48
|
+
strings: strings,
|
|
55
49
|
children: children
|
|
56
50
|
});
|
|
57
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-history.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/history/chat-history.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-history.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/history/chat-history.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUvD,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,IAAI,GACL,EAAE;IACD,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,iBAAiB,CAAC;CACzB,2CA2BA"}
|
|
@@ -42,10 +42,11 @@ const external_react_namespaceObject = require("react");
|
|
|
42
42
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
43
43
|
const chat_state_provider_cjs_namespaceObject = require("../../headless/providers/chat-state-provider.cjs");
|
|
44
44
|
const external_history_item_cjs_namespaceObject = require("./history-item.cjs");
|
|
45
|
-
function EmptyMessage({
|
|
46
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
function EmptyMessage({ title }) {
|
|
46
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.EmptyState, {
|
|
47
|
+
size: "compact",
|
|
48
|
+
title: title,
|
|
49
|
+
className: "flex-1"
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
@@ -56,6 +57,14 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
56
57
|
const searchLabel = _({
|
|
57
58
|
id: 'autopilot-chat.history.search-placeholder'
|
|
58
59
|
});
|
|
60
|
+
const searchStrings = external_react_default().useMemo(()=>({
|
|
61
|
+
clear: _({
|
|
62
|
+
id: 'autopilot-chat.history.search-clear'
|
|
63
|
+
})
|
|
64
|
+
}), [
|
|
65
|
+
_
|
|
66
|
+
]);
|
|
67
|
+
const searchInput = external_react_default().useRef(null);
|
|
59
68
|
const renderList = ()=>{
|
|
60
69
|
if (showSearchSkeleton) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
61
70
|
"data-slot": "wind-chat-history-skeleton",
|
|
@@ -67,7 +76,7 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
67
76
|
}, index))
|
|
68
77
|
});
|
|
69
78
|
if (noSearchResults) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyMessage, {
|
|
70
|
-
|
|
79
|
+
title: _({
|
|
71
80
|
id: 'autopilot-chat.history.no-results'
|
|
72
81
|
})
|
|
73
82
|
});
|
|
@@ -107,9 +116,11 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
107
116
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
108
117
|
className: "shrink-0 px-2",
|
|
109
118
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Search, {
|
|
119
|
+
ref: searchInput,
|
|
110
120
|
value: searchQuery,
|
|
111
121
|
onChange: setSearchQuery,
|
|
112
|
-
|
|
122
|
+
onClear: ()=>searchInput.current?.focus(),
|
|
123
|
+
strings: searchStrings,
|
|
113
124
|
placeholder: searchLabel,
|
|
114
125
|
"aria-label": searchLabel,
|
|
115
126
|
disabled: !historyOpen
|
|
@@ -123,7 +134,7 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
123
134
|
})
|
|
124
135
|
]
|
|
125
136
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(EmptyMessage, {
|
|
126
|
-
|
|
137
|
+
title: _({
|
|
127
138
|
id: 'autopilot-chat.history.empty'
|
|
128
139
|
})
|
|
129
140
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history-panel.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/history/history-panel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"history-panel.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/history/history-panel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAa9E,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,OAAO,EACP,kBAAkB,GACnB,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,kBAAkB,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9D,2CAwGA"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useLingui } from "@lingui/react";
|
|
3
|
-
import { Search, Skeleton, Spinner, cn } from "@uipath/apollo-wind";
|
|
3
|
+
import { EmptyState, Search, Skeleton, Spinner, cn } from "@uipath/apollo-wind";
|
|
4
4
|
import react from "react";
|
|
5
5
|
import { useChatState } from "../../headless/providers/chat-state-provider.js";
|
|
6
6
|
import { HistoryItem } from "./history-item.js";
|
|
7
|
-
function EmptyMessage({
|
|
8
|
-
return /*#__PURE__*/ jsx(
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
function EmptyMessage({ title }) {
|
|
8
|
+
return /*#__PURE__*/ jsx(EmptyState, {
|
|
9
|
+
size: "compact",
|
|
10
|
+
title: title,
|
|
11
|
+
className: "flex-1"
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
@@ -18,6 +19,14 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
18
19
|
const searchLabel = _({
|
|
19
20
|
id: 'autopilot-chat.history.search-placeholder'
|
|
20
21
|
});
|
|
22
|
+
const searchStrings = react.useMemo(()=>({
|
|
23
|
+
clear: _({
|
|
24
|
+
id: 'autopilot-chat.history.search-clear'
|
|
25
|
+
})
|
|
26
|
+
}), [
|
|
27
|
+
_
|
|
28
|
+
]);
|
|
29
|
+
const searchInput = react.useRef(null);
|
|
21
30
|
const renderList = ()=>{
|
|
22
31
|
if (showSearchSkeleton) return /*#__PURE__*/ jsx("div", {
|
|
23
32
|
"data-slot": "wind-chat-history-skeleton",
|
|
@@ -29,7 +38,7 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
29
38
|
}, index))
|
|
30
39
|
});
|
|
31
40
|
if (noSearchResults) return /*#__PURE__*/ jsx(EmptyMessage, {
|
|
32
|
-
|
|
41
|
+
title: _({
|
|
33
42
|
id: 'autopilot-chat.history.no-results'
|
|
34
43
|
})
|
|
35
44
|
});
|
|
@@ -69,9 +78,11 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
69
78
|
/*#__PURE__*/ jsx("div", {
|
|
70
79
|
className: "shrink-0 px-2",
|
|
71
80
|
children: /*#__PURE__*/ jsx(Search, {
|
|
81
|
+
ref: searchInput,
|
|
72
82
|
value: searchQuery,
|
|
73
83
|
onChange: setSearchQuery,
|
|
74
|
-
|
|
84
|
+
onClear: ()=>searchInput.current?.focus(),
|
|
85
|
+
strings: searchStrings,
|
|
75
86
|
placeholder: searchLabel,
|
|
76
87
|
"aria-label": searchLabel,
|
|
77
88
|
disabled: !historyOpen
|
|
@@ -85,7 +96,7 @@ function HistoryPanel({ className, history, scrollContainerRef }) {
|
|
|
85
96
|
})
|
|
86
97
|
]
|
|
87
98
|
}) : /*#__PURE__*/ jsx(EmptyMessage, {
|
|
88
|
-
|
|
99
|
+
title: _({
|
|
89
100
|
id: 'autopilot-chat.history.empty'
|
|
90
101
|
})
|
|
91
102
|
})
|
|
@@ -38,7 +38,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
39
|
const external_react_namespaceObject = require("react");
|
|
40
40
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
41
|
-
const chat_state_provider_cjs_namespaceObject = require("../../headless/providers/chat-state-provider.cjs");
|
|
42
41
|
const index_cjs_namespaceObject = require("../../service/index.cjs");
|
|
43
42
|
const first_run_cjs_namespaceObject = require("../first-run/first-run.cjs");
|
|
44
43
|
const chat_header_cjs_namespaceObject = require("../header/chat-header.cjs");
|
|
@@ -53,7 +52,6 @@ const sizes = {
|
|
|
53
52
|
function FullScreenLayout({ layout }) {
|
|
54
53
|
const firstRunShown = (0, first_run_cjs_namespaceObject.useFirstRunShown)();
|
|
55
54
|
const settingsClose = (0, chat_settings_cjs_namespaceObject.useSettingsClose)();
|
|
56
|
-
const { historyOpen } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
57
55
|
const [content, setContent] = external_react_default().useState(null);
|
|
58
56
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
59
57
|
className: "flex h-full min-h-0 w-full flex-col",
|
|
@@ -86,10 +84,6 @@ function FullScreenLayout({ layout }) {
|
|
|
86
84
|
})
|
|
87
85
|
]
|
|
88
86
|
}),
|
|
89
|
-
layout.historyAvailable && historyOpen && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
90
|
-
"aria-hidden": true,
|
|
91
|
-
className: "w-[calc(var(--chat-drawer-width)+2rem)] shrink-0"
|
|
92
|
-
}),
|
|
93
87
|
layout.settingsAvailable && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_settings_cjs_namespaceObject.ChatSettings, {
|
|
94
88
|
layout: layout,
|
|
95
89
|
onClose: settingsClose.close
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full-screen-layout.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/layout/full-screen-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAmBpE,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"full-screen-layout.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/layout/full-screen-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAmBpE,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,2CAwClE"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import react from "react";
|
|
3
|
-
import { useChatState } from "../../headless/providers/chat-state-provider.js";
|
|
4
3
|
import { CHAT_DRAWER_WIDTH_FULL_SCREEN, CHAT_WIDTH_FULL_SCREEN_MAX_WIDTH } from "../../service/index.js";
|
|
5
4
|
import { FirstRun, useFirstRunShown } from "../first-run/first-run.js";
|
|
6
5
|
import { WindChatHeader } from "../header/chat-header.js";
|
|
@@ -15,7 +14,6 @@ const sizes = {
|
|
|
15
14
|
function FullScreenLayout({ layout }) {
|
|
16
15
|
const firstRunShown = useFirstRunShown();
|
|
17
16
|
const settingsClose = useSettingsClose();
|
|
18
|
-
const { historyOpen } = useChatState();
|
|
19
17
|
const [content, setContent] = react.useState(null);
|
|
20
18
|
return /*#__PURE__*/ jsxs("div", {
|
|
21
19
|
className: "flex h-full min-h-0 w-full flex-col",
|
|
@@ -48,10 +46,6 @@ function FullScreenLayout({ layout }) {
|
|
|
48
46
|
})
|
|
49
47
|
]
|
|
50
48
|
}),
|
|
51
|
-
layout.historyAvailable && historyOpen && /*#__PURE__*/ jsx("div", {
|
|
52
|
-
"aria-hidden": true,
|
|
53
|
-
className: "w-[calc(var(--chat-drawer-width)+2rem)] shrink-0"
|
|
54
|
-
}),
|
|
55
49
|
layout.settingsAvailable && /*#__PURE__*/ jsx(ChatSettings, {
|
|
56
50
|
layout: layout,
|
|
57
51
|
onClose: settingsClose.close
|
|
@@ -31,7 +31,7 @@ const chat_composer_cjs_namespaceObject = require("../composer/chat-composer.cjs
|
|
|
31
31
|
function ComposerRegion() {
|
|
32
32
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
33
33
|
"data-slot": "wind-chat-composer",
|
|
34
|
-
className: "flex shrink-0 flex-col",
|
|
34
|
+
className: "flex shrink-0 flex-col pt-1",
|
|
35
35
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(chat_composer_cjs_namespaceObject.WindChatComposer, {})
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -3,7 +3,7 @@ import { WindChatComposer } from "../composer/chat-composer.js";
|
|
|
3
3
|
function ComposerRegion() {
|
|
4
4
|
return /*#__PURE__*/ jsx("div", {
|
|
5
5
|
"data-slot": "wind-chat-composer",
|
|
6
|
-
className: "flex shrink-0 flex-col",
|
|
6
|
+
className: "flex shrink-0 flex-col pt-1",
|
|
7
7
|
children: /*#__PURE__*/ jsx(WindChatComposer, {})
|
|
8
8
|
});
|
|
9
9
|
}
|
|
@@ -24,11 +24,8 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
MessageAttachments: ()=>MessageAttachments,
|
|
28
|
-
CHIP_CLASSES: ()=>CHIP_CLASSES,
|
|
29
27
|
AttachmentTypeIcon: ()=>AttachmentTypeIcon,
|
|
30
|
-
|
|
31
|
-
titleTruncatedChip: ()=>titleTruncatedChip
|
|
28
|
+
MessageAttachments: ()=>MessageAttachments
|
|
32
29
|
});
|
|
33
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
31
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
@@ -45,19 +42,11 @@ function AttachmentTypeIcon({ name }) {
|
|
|
45
42
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {});
|
|
46
43
|
}
|
|
47
44
|
const CHIP_CLASSES = 'min-w-0 max-w-[calc(50cqw-4px)] gap-1.5 rounded-lg';
|
|
48
|
-
const CHIP_MEDIA_CLASSES = 'w-5
|
|
49
|
-
function titleTruncatedChip(event) {
|
|
50
|
-
const chip = event.target.closest('[data-slot="attachment"]');
|
|
51
|
-
const title = chip?.querySelector('[data-slot="attachment-title"]');
|
|
52
|
-
if (!chip || !title) return;
|
|
53
|
-
if (title.scrollWidth > title.clientWidth) chip.title = title.textContent ?? '';
|
|
54
|
-
else chip.removeAttribute('title');
|
|
55
|
-
}
|
|
45
|
+
const CHIP_MEDIA_CLASSES = 'group-data-[size=xs]/attachment:w-5 rounded-sm bg-transparent';
|
|
56
46
|
function MessageAttachments({ attachments, align = 'start' }) {
|
|
57
47
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.AttachmentGroup, {
|
|
58
48
|
"data-slot": "wind-chat-message-attachments",
|
|
59
49
|
className: (0, apollo_wind_namespaceObject.cn)('gap-2', 'end' === align && 'justify-end-safe'),
|
|
60
|
-
onPointerOver: titleTruncatedChip,
|
|
61
50
|
children: attachments.map((attachment)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Attachment, {
|
|
62
51
|
size: "xs",
|
|
63
52
|
className: CHIP_CLASSES,
|
|
@@ -78,16 +67,10 @@ function MessageAttachments({ attachments, align = 'start' }) {
|
|
|
78
67
|
});
|
|
79
68
|
}
|
|
80
69
|
exports.AttachmentTypeIcon = __webpack_exports__.AttachmentTypeIcon;
|
|
81
|
-
exports.CHIP_CLASSES = __webpack_exports__.CHIP_CLASSES;
|
|
82
|
-
exports.CHIP_MEDIA_CLASSES = __webpack_exports__.CHIP_MEDIA_CLASSES;
|
|
83
70
|
exports.MessageAttachments = __webpack_exports__.MessageAttachments;
|
|
84
|
-
exports.titleTruncatedChip = __webpack_exports__.titleTruncatedChip;
|
|
85
71
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
86
72
|
"AttachmentTypeIcon",
|
|
87
|
-
"
|
|
88
|
-
"CHIP_MEDIA_CLASSES",
|
|
89
|
-
"MessageAttachments",
|
|
90
|
-
"titleTruncatedChip"
|
|
73
|
+
"MessageAttachments"
|
|
91
74
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
92
75
|
Object.defineProperty(exports, '__esModule', {
|
|
93
76
|
value: true
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import { type AutopilotChatFileInfo } from '../../service';
|
|
3
2
|
export declare function AttachmentTypeIcon({ name }: {
|
|
4
3
|
name: string;
|
|
5
4
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare const CHIP_CLASSES = "min-w-0 max-w-[calc(50cqw-4px)] gap-1.5 rounded-lg";
|
|
7
|
-
export declare const CHIP_MEDIA_CLASSES = "w-5! rounded-sm bg-transparent";
|
|
8
|
-
export declare function titleTruncatedChip(event: React.PointerEvent<HTMLElement>): void;
|
|
9
5
|
export declare function MessageAttachments({ attachments, align, }: {
|
|
10
6
|
attachments: AutopilotChatFileInfo[];
|
|
11
7
|
align?: 'start' | 'end';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-attachments.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/messages/message-attachments.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-attachments.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/messages/message-attachments.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,qBAAqB,EAAyB,MAAM,eAAe,CAAC;AAUlF,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,2CAG5D;AAeD,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,KAAe,GAChB,EAAE;IACD,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CACzB,2CAyBA"}
|
|
@@ -13,19 +13,11 @@ function AttachmentTypeIcon({ name }) {
|
|
|
13
13
|
return /*#__PURE__*/ jsx(Icon, {});
|
|
14
14
|
}
|
|
15
15
|
const CHIP_CLASSES = 'min-w-0 max-w-[calc(50cqw-4px)] gap-1.5 rounded-lg';
|
|
16
|
-
const CHIP_MEDIA_CLASSES = 'w-5
|
|
17
|
-
function titleTruncatedChip(event) {
|
|
18
|
-
const chip = event.target.closest('[data-slot="attachment"]');
|
|
19
|
-
const title = chip?.querySelector('[data-slot="attachment-title"]');
|
|
20
|
-
if (!chip || !title) return;
|
|
21
|
-
if (title.scrollWidth > title.clientWidth) chip.title = title.textContent ?? '';
|
|
22
|
-
else chip.removeAttribute('title');
|
|
23
|
-
}
|
|
16
|
+
const CHIP_MEDIA_CLASSES = 'group-data-[size=xs]/attachment:w-5 rounded-sm bg-transparent';
|
|
24
17
|
function MessageAttachments({ attachments, align = 'start' }) {
|
|
25
18
|
return /*#__PURE__*/ jsx(AttachmentGroup, {
|
|
26
19
|
"data-slot": "wind-chat-message-attachments",
|
|
27
20
|
className: cn('gap-2', 'end' === align && 'justify-end-safe'),
|
|
28
|
-
onPointerOver: titleTruncatedChip,
|
|
29
21
|
children: attachments.map((attachment)=>/*#__PURE__*/ jsxs(Attachment, {
|
|
30
22
|
size: "xs",
|
|
31
23
|
className: CHIP_CLASSES,
|
|
@@ -45,4 +37,4 @@ function MessageAttachments({ attachments, align = 'start' }) {
|
|
|
45
37
|
}, `${attachment.name}-${attachment.size}`))
|
|
46
38
|
});
|
|
47
39
|
}
|
|
48
|
-
export { AttachmentTypeIcon,
|
|
40
|
+
export { AttachmentTypeIcon, MessageAttachments };
|
|
@@ -53,6 +53,8 @@ const index_cjs_namespaceObject = require("../../service/index.cjs");
|
|
|
53
53
|
const suggestion_list_cjs_namespaceObject = require("../first-run/suggestion-list.cjs");
|
|
54
54
|
const external_chat_message_cjs_namespaceObject = require("./chat-message.cjs");
|
|
55
55
|
const external_thinking_row_cjs_namespaceObject = require("./thinking-row.cjs");
|
|
56
|
+
const ANCHOR_PEEK = 12;
|
|
57
|
+
const COMPACT_ANCHOR_PEEK = 0;
|
|
56
58
|
function InitialLoading() {
|
|
57
59
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
58
60
|
"data-slot": "wind-chat-messages-skeleton",
|
|
@@ -220,6 +222,7 @@ function Transcript({ contentClassName, transcript }) {
|
|
|
220
222
|
function MessageList({ className, contentClassName }) {
|
|
221
223
|
const { autoScroll } = (0, chat_scroll_provider_cjs_namespaceObject.useChatScroll)();
|
|
222
224
|
const { skeletonLoader } = (0, loading_provider_cjs_namespaceObject.useLoading)();
|
|
225
|
+
const { spacing } = (0, chat_state_provider_cjs_namespaceObject.useChatState)();
|
|
223
226
|
const transcript = (0, use_chat_messages_cjs_namespaceObject.useChatMessages)();
|
|
224
227
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
225
228
|
"data-slot": "wind-chat-messages",
|
|
@@ -227,6 +230,7 @@ function MessageList({ className, contentClassName }) {
|
|
|
227
230
|
children: skeletonLoader ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InitialLoading, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.MessageScrollerProvider, {
|
|
228
231
|
autoScroll: autoScroll,
|
|
229
232
|
defaultScrollPosition: "end",
|
|
233
|
+
scrollPreviousItemPeek: spacing.compactMode ? COMPACT_ANCHOR_PEEK : ANCHOR_PEEK,
|
|
230
234
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.MessageScroller, {
|
|
231
235
|
className: "flex-1",
|
|
232
236
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Transcript, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-list.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/messages/message-list.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-list.d.ts","sourceRoot":"","sources":["../../../../src/chat/wind/messages/message-list.tsx"],"names":[],"mappings":"AA6QA,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,gBAAgB,GACjB,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,2CA4BA"}
|
|
@@ -15,6 +15,8 @@ import { AutopilotChatMode, AutopilotChatRole, CHAT_MESSAGE_MAX_PADDING } from "
|
|
|
15
15
|
import { SuggestionList } from "../first-run/suggestion-list.js";
|
|
16
16
|
import { ChatMessage } from "./chat-message.js";
|
|
17
17
|
import { ThinkingRow } from "./thinking-row.js";
|
|
18
|
+
const ANCHOR_PEEK = 12;
|
|
19
|
+
const COMPACT_ANCHOR_PEEK = 0;
|
|
18
20
|
function InitialLoading() {
|
|
19
21
|
return /*#__PURE__*/ jsxs("div", {
|
|
20
22
|
"data-slot": "wind-chat-messages-skeleton",
|
|
@@ -182,6 +184,7 @@ function Transcript({ contentClassName, transcript }) {
|
|
|
182
184
|
function MessageList({ className, contentClassName }) {
|
|
183
185
|
const { autoScroll } = useChatScroll();
|
|
184
186
|
const { skeletonLoader } = useLoading();
|
|
187
|
+
const { spacing } = useChatState();
|
|
185
188
|
const transcript = useChatMessages();
|
|
186
189
|
return /*#__PURE__*/ jsx("div", {
|
|
187
190
|
"data-slot": "wind-chat-messages",
|
|
@@ -189,6 +192,7 @@ function MessageList({ className, contentClassName }) {
|
|
|
189
192
|
children: skeletonLoader ? /*#__PURE__*/ jsx(InitialLoading, {}) : /*#__PURE__*/ jsx(MessageScrollerProvider, {
|
|
190
193
|
autoScroll: autoScroll,
|
|
191
194
|
defaultScrollPosition: "end",
|
|
195
|
+
scrollPreviousItemPeek: spacing.compactMode ? COMPACT_ANCHOR_PEEK : ANCHOR_PEEK,
|
|
192
196
|
children: /*#__PURE__*/ jsx(MessageScroller, {
|
|
193
197
|
className: "flex-1",
|
|
194
198
|
children: /*#__PURE__*/ jsx(Transcript, {
|