@homecode/ui 5.9.0 → 5.9.1
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/esm/src/components/Autocomplete/Autocomplete.js +2 -2
- package/dist/esm/src/components/Chat/ChatPrompt.js +3 -3
- package/dist/esm/src/components/Chat/ChatView.js +6 -6
- package/dist/esm/src/components/Chat/ChatView.styl.js +2 -2
- package/dist/esm/src/components/InputFile/InputFile.js +2 -2
- package/package.json +1 -1
|
@@ -36,10 +36,10 @@ import '../Chat/ChatFormattedText.styl.js';
|
|
|
36
36
|
import '../Expand/Expand.styl.js';
|
|
37
37
|
import '../Chat/ChatMessage.styl.js';
|
|
38
38
|
import '../PromptComposer/PromptComposer.js';
|
|
39
|
-
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
40
39
|
import '../Chat/ChatPrompt.styl.js';
|
|
41
|
-
import '../
|
|
40
|
+
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
42
41
|
import '../Chat/ChatView.styl.js';
|
|
42
|
+
import '../TextShimmer/TextShimmer.js';
|
|
43
43
|
import '../Container/Container.js';
|
|
44
44
|
import '../DatePicker/DatePicker.styl.js';
|
|
45
45
|
import 'moment';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
import { useRef, useState } from 'react';
|
|
4
3
|
import { Button } from '../Button/Button.js';
|
|
5
4
|
import { Icon } from '../Icon/Icon.js';
|
|
6
5
|
import { PromptComposer } from '../PromptComposer/PromptComposer.js';
|
|
6
|
+
import S from './ChatPrompt.styl.js';
|
|
7
7
|
import { Select2 } from '../Select/Select2.js';
|
|
8
8
|
import { ThinkingOutline } from '../ThinkingOutline/ThinkingOutline.js';
|
|
9
9
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
10
|
-
import
|
|
10
|
+
import cn from 'classnames';
|
|
11
11
|
|
|
12
12
|
const DEFAULT_MODELS = [
|
|
13
13
|
{ id: 'auto', label: 'Auto Router' },
|
|
@@ -32,7 +32,7 @@ function ChatPrompt({ value, onChange, onSubmit, disabled, isPrompting, placehol
|
|
|
32
32
|
if (!next || disabled)
|
|
33
33
|
return;
|
|
34
34
|
onSubmit(next);
|
|
35
|
-
}, children: jsx(Icon, { type: "arrowUp", className: S.submitIcon }) }), showModelSelector && (jsx(Select2, { className: S.promptModelSelector, label: "", size: "s", disableLabel: true, hideRequiredStar: true, round: true, options: models, value: modelId, disabled: disabled, popupProps: {
|
|
35
|
+
}, children: jsx(Icon, { type: "arrowUp", className: S.submitIcon }) }), showModelSelector && (jsx(Select2, { className: S.promptModelSelector, label: "", size: "s", disableLabel: true, hideRequiredStar: true, round: true, options: models, value: modelId, disabled: disabled, triggerProps: { variant: 'clear' }, popupProps: {
|
|
36
36
|
direction: 'top-right',
|
|
37
37
|
round: true,
|
|
38
38
|
}, onChange: next => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
import { useRef, useEffect } from 'react';
|
|
4
|
-
import { Scroll } from '../Scroll/Scroll.js';
|
|
5
|
-
import { TextShimmer } from '../TextShimmer/TextShimmer.js';
|
|
6
|
-
import { scrollTo } from '../../tools/scroll.js';
|
|
7
3
|
import { ChatMessage } from './ChatMessage.js';
|
|
8
4
|
import S from './ChatView.styl.js';
|
|
5
|
+
import { Scroll } from '../Scroll/Scroll.js';
|
|
6
|
+
import { TextShimmer } from '../TextShimmer/TextShimmer.js';
|
|
7
|
+
import cn from 'classnames';
|
|
9
8
|
import { isPlanMessageContent } from './content.js';
|
|
9
|
+
import { scrollTo } from '../../tools/scroll.js';
|
|
10
10
|
|
|
11
11
|
function ChatView({ messages, isPrompting, promptingLabel = 'Thinking…', emptyLabel = 'Start the conversation', className, messagesClassName, footer, onButtonClick, }) {
|
|
12
12
|
const listRef = useRef(null);
|
|
@@ -16,7 +16,7 @@ function ChatView({ messages, isPrompting, promptingLabel = 'Thinking…', empty
|
|
|
16
16
|
if (scroller)
|
|
17
17
|
scrollTo(scroller, 0, scroller.scrollHeight + 80);
|
|
18
18
|
}, [visible.length, isPrompting]);
|
|
19
|
-
return (jsxs("div", { className: cn(S.root, className), children: [jsxs(Scroll, { y: true, fadeSize: "l", autoHide: true, className: S.messages, innerClassName: cn(S.messagesInner, messagesClassName), onInnerRef: elem => {
|
|
19
|
+
return (jsxs("div", { className: cn(S.root, className), children: [jsxs(Scroll, { y: true, fadeSize: "l", autoHide: true, offset: { y: { after: 30 } }, className: S.messages, innerClassName: cn(S.messagesInner, footer && S.messagesInnerWithPrompt, messagesClassName), onInnerRef: elem => {
|
|
20
20
|
listRef.current = elem;
|
|
21
21
|
}, children: [visible.length === 0 && jsx("div", { className: S.empty, children: emptyLabel }), visible.map((message, index) => {
|
|
22
22
|
const prev = visible[index - 1];
|
|
@@ -24,7 +24,7 @@ function ChatView({ messages, isPrompting, promptingLabel = 'Thinking…', empty
|
|
|
24
24
|
prev.role === message.role &&
|
|
25
25
|
message.role !== 'SYSTEM';
|
|
26
26
|
return (jsx(ChatMessage, { data: message, isStacked: isStacked, isLastMessage: index === visible.length - 1, onButtonClick: onButtonClick }, message.id || `${message.role}-${index}`));
|
|
27
|
-
})] }), isPrompting && (jsx("div", { className: S.status, children: jsx(TextShimmer, { children: promptingLabel }) })), footer && jsx("div", { className: S.
|
|
27
|
+
})] }), footer && (jsxs("div", { className: S.footer, children: [isPrompting && (jsx("div", { className: S.status, children: jsx(TextShimmer, { children: promptingLabel }) })), footer] })), !footer && isPrompting && (jsx("div", { className: S.status, children: jsx(TextShimmer, { children: promptingLabel }) }))] }));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export { ChatView };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".ChatView_root__fRLUe{display:flex;flex-direction:column;height:100%;min-height:0;width:100%}.ChatView_messages__XjC53{flex:1;min-height:0}.ChatView_messagesInner__oRfmN{display:flex;flex-direction:column;padding:var(--p-10) calc(50% - 300px) 0}.ChatView_empty__5yGXV{margin:auto;opacity:.6;padding:24px;text-align:center}.ChatView_status__PpDvZ{font-size:13px;padding:4px 8px 0}.ChatView_footer__huDww{
|
|
4
|
-
var S = {"root":"ChatView_root__fRLUe","messages":"ChatView_messages__XjC53","messagesInner":"ChatView_messagesInner__oRfmN","empty":"ChatView_empty__5yGXV","status":"ChatView_status__PpDvZ","footer":"ChatView_footer__huDww"};
|
|
3
|
+
var css_248z = ".ChatView_root__fRLUe{--prompt-height:80px;display:flex;flex-direction:column;height:100%;min-height:0;position:relative;width:100%}.ChatView_messages__XjC53{flex:1;min-height:0}.ChatView_messagesInner__oRfmN{display:flex;flex-direction:column;height:-moz-fit-content;height:fit-content;min-height:100%;padding:var(--p-10) calc(50% - 300px) 0}.ChatView_messagesInnerWithPrompt__AuC8M{padding-bottom:20px}.ChatView_empty__5yGXV{margin:auto;opacity:.6;padding:24px;text-align:center}.ChatView_status__PpDvZ{font-size:13px;padding:4px 8px 0}.ChatView_footer__huDww{height:-moz-fit-content;height:fit-content;margin-top:calc(var(--p-5)*-1);overflow:visible;padding:0 0 10px}.ChatView_footer__huDww .ChatView_status__PpDvZ{display:flex;font-size:12.8px;font-size:calc(12.8px*var(--dialogue-text-scale, 1));justify-content:center;left:0;padding:6px 14px;pointer-events:none;position:absolute;right:0;top:-32px}";
|
|
4
|
+
var S = {"root":"ChatView_root__fRLUe","messages":"ChatView_messages__XjC53","messagesInner":"ChatView_messagesInner__oRfmN","messagesInnerWithPrompt":"ChatView_messagesInnerWithPrompt__AuC8M","empty":"ChatView_empty__5yGXV","status":"ChatView_status__PpDvZ","footer":"ChatView_footer__huDww"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -39,10 +39,10 @@ import '../Chat/ChatFormattedText.styl.js';
|
|
|
39
39
|
import '../Expand/Expand.styl.js';
|
|
40
40
|
import '../Chat/ChatMessage.styl.js';
|
|
41
41
|
import '../PromptComposer/PromptComposer.js';
|
|
42
|
-
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
43
42
|
import '../Chat/ChatPrompt.styl.js';
|
|
44
|
-
import '../
|
|
43
|
+
import '../ThinkingOutline/ThinkingOutline.styl.js';
|
|
45
44
|
import '../Chat/ChatView.styl.js';
|
|
45
|
+
import '../TextShimmer/TextShimmer.js';
|
|
46
46
|
import '../Container/Container.js';
|
|
47
47
|
import '../DatePicker/DatePicker.styl.js';
|
|
48
48
|
import 'moment';
|