@nethru/kit 1.1.4 → 1.1.6
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.
|
@@ -24,12 +24,7 @@ function AiChat({
|
|
|
24
24
|
messages: messages,
|
|
25
25
|
isLoading: isLoading,
|
|
26
26
|
chatContainerRef: chatContainerRef
|
|
27
|
-
}), /*#__PURE__*/_jsx(ChatInput, {
|
|
28
|
-
inputValue: inputValue,
|
|
29
|
-
setInputValue: setInputValue,
|
|
30
|
-
onSend: sendMessage,
|
|
31
|
-
isLoading: isLoading
|
|
32
|
-
})]
|
|
27
|
+
}), /*#__PURE__*/_jsx(ChatInput, {})]
|
|
33
28
|
});
|
|
34
29
|
}
|
|
35
30
|
export default AiChat;
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef, useEffect, useState } from 'react';
|
|
2
2
|
import { Box, FormControl, IconButton, Stack, TextField } from '@mui/material';
|
|
3
3
|
import { Send as SendIcon } from '@mui/icons-material';
|
|
4
|
+
import { useChatContext } from "./contexts/ChatContext";
|
|
4
5
|
import ModelSelect from "./ModelSelect";
|
|
5
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
const ChatInput = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const ChatInput = () => {
|
|
8
|
+
const inputRef = useRef(null);
|
|
9
|
+
const [selectOpen, setSelectOpen] = useState(false);
|
|
10
|
+
const {
|
|
11
|
+
inputValue,
|
|
12
|
+
setInputValue,
|
|
13
|
+
isLoading,
|
|
14
|
+
sendMessage
|
|
15
|
+
} = useChatContext();
|
|
12
16
|
const handleKeyPress = e => {
|
|
13
17
|
if (e.key === 'Enter' && !e.shiftKey) {
|
|
14
18
|
e.preventDefault();
|
|
15
|
-
|
|
19
|
+
sendMessage();
|
|
16
20
|
}
|
|
17
21
|
};
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!isLoading && !selectOpen && inputRef.current) inputRef.current.focus();
|
|
24
|
+
}, [isLoading, selectOpen]);
|
|
18
25
|
return /*#__PURE__*/_jsx(Box, {
|
|
19
26
|
sx: styles.container,
|
|
20
27
|
children: /*#__PURE__*/_jsxs(Stack, {
|
|
21
28
|
sx: styles.textArea,
|
|
22
29
|
children: [/*#__PURE__*/_jsx(TextField, {
|
|
30
|
+
inputRef: inputRef,
|
|
23
31
|
fullWidth: true,
|
|
24
32
|
multiline: true,
|
|
25
33
|
placeholder: "\uBA54\uC2DC\uC9C0\uB97C \uC785\uB825\uD558\uC138\uC694...",
|
|
@@ -41,9 +49,13 @@ const ChatInput = ({
|
|
|
41
49
|
alignItems: "center",
|
|
42
50
|
children: [/*#__PURE__*/_jsx(FormControl, {
|
|
43
51
|
variant: "standard",
|
|
44
|
-
children: /*#__PURE__*/_jsx(ModelSelect, {
|
|
52
|
+
children: /*#__PURE__*/_jsx(ModelSelect, {
|
|
53
|
+
open: selectOpen,
|
|
54
|
+
onOpen: () => setSelectOpen(true),
|
|
55
|
+
onClose: () => setSelectOpen(false)
|
|
56
|
+
})
|
|
45
57
|
}), /*#__PURE__*/_jsx(IconButton, {
|
|
46
|
-
onClick:
|
|
58
|
+
onClick: sendMessage,
|
|
47
59
|
disabled: isLoading || !inputValue.trim(),
|
|
48
60
|
sx: styles.iconButton,
|
|
49
61
|
children: /*#__PURE__*/_jsx(SendIcon, {
|
|
@@ -2,7 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { Box, Divider, MenuItem, Select } from "@mui/material";
|
|
3
3
|
import { useChatContext } from "./contexts/ChatContext";
|
|
4
4
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
export default function ModelSelect(
|
|
5
|
+
export default function ModelSelect({
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
6
8
|
const {
|
|
7
9
|
model,
|
|
8
10
|
setModel,
|
|
@@ -17,7 +19,6 @@ export default function ModelSelect() {
|
|
|
17
19
|
setProvider(findProvider(providers, value)?.provider);
|
|
18
20
|
setModel(findModel(providers, value)?.id);
|
|
19
21
|
};
|
|
20
|
-
console.log(provider, model);
|
|
21
22
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
22
23
|
children: providers.length > 0 && /*#__PURE__*/_jsx(Select, {
|
|
23
24
|
variant: "standard",
|
|
@@ -26,6 +27,7 @@ export default function ModelSelect() {
|
|
|
26
27
|
disableUnderline: true,
|
|
27
28
|
sx: styles.select,
|
|
28
29
|
renderValue: value => findModel(providers, value)?.name,
|
|
30
|
+
...props,
|
|
29
31
|
children: makeOptions(providers)
|
|
30
32
|
})
|
|
31
33
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ReactMarkdown from 'react-markdown';
|
|
2
|
+
import remarkGfm from 'remark-gfm';
|
|
2
3
|
import './MarkdownContent.css';
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
function MarkdownContent({
|
|
@@ -7,6 +8,7 @@ function MarkdownContent({
|
|
|
7
8
|
return /*#__PURE__*/_jsx("div", {
|
|
8
9
|
className: "markdown-content",
|
|
9
10
|
children: /*#__PURE__*/_jsx(ReactMarkdown, {
|
|
11
|
+
remarkPlugins: [remarkGfm],
|
|
10
12
|
children: content
|
|
11
13
|
})
|
|
12
14
|
});
|
|
@@ -738,6 +738,12 @@ export const defaultMessages = [{
|
|
|
738
738
|
// mockSummary2,
|
|
739
739
|
// mockSearchTaskByKeyword,
|
|
740
740
|
{
|
|
741
|
+
"type": "text",
|
|
742
|
+
"value": "현재 등록된 컨테이너 목록은 아래와 같습니다 👇 \n\n| ID | 유형 | 이름 | URL | 활성화 여부 |\n|----|------|------|------|--------------|\n| 00001 | WEB | 와이즈컬렉터3 | [https://wc.nethru.co.kr](https://wc.nethru.co.kr) | ✅ 활성 |\n| 00003 | WEB | 넷스루 홈페이지 | [http://www.nethru.co.kr](http://www.nethru.co.kr) | ✅ 활성 |\n| 00004 | WEB | WC몰 | [https://wcmall.nethru.co.kr](https://wcmall.nethru.co.kr) | ✅ 활성 |\n| 00005 | WEB | Google Arts & Culture | [https://artsandculture.google.com](https://artsandculture.google.com) | ✅ 활성 |\n| 00006 | MOBILE | OmniNotes | [https://www.omnintes.com](https://www.omnintes.com) | ✅ 활성 |\n| 00007 | MOBILE | Plaid | [https://www.plaid.com](https://www.plaid.com) | ✅ 활성 |\n| 00008 | MOBILE | 안드로이드 샘플앱 | [http://www.androidtest.com](http://www.androidtest.com) | ✅ 활성 |\n| 00009 | MOBILE | 엄니노트 | [https://www.omnintes.com](https://www.omnintes.com) | ✅ 활성 |\n| 00026 | WEB | 신수민티스토리 | [https://nethoomru.tistory.com](https://nethoomru.tistory.com) | ✅ 활성 |\n| 00710 | WEB | solmin_test2 | [https://wc-solmin.tistory.com](https://wc-solmin.tistory.com) | ✅ 활성 |\n| 00711 | MOBILE | KB Pay | [https://kbpay.kbcard.com](https://kbpay.kbcard.com) | ✅ 활성 |\n| 00712 | MOBILE | OmniNotes2 | [https://www.omnintes.com](https://www.omnintes.com) | ✅ 활성 |\n| 00715 | WEB | test2 | [https://wc-solmin.tistory.com](https://wc-solmin.tistory.com) | ❌ 비활성 |\n| 00718 | MOBILE | iOS 샘플앱 | [http://www.iostest.com](http://www.iostest.com) | ✅ 활성 |\n| 00742 | MOBILE | 모바일 샘플앱 250903 (iOS 테스트 임시) | [http://www.androidtest.com](http://www.androidtest.com) | ✅ 활성 |\n| 00743 | MOBILE | 요기요 | [https://www.yogiyo.co.kr](https://www.yogiyo.co.kr) | ✅ 활성 |\n| 00744 | MOBILE | 사내 TFT 예제 - KBPay | [https://www.tftex1.co.kr](https://www.tftex1.co.kr) | ✅ 활성 |\n| 00745 | MOBILE | OmniNotes-soomsoom | [https://www.omnintes.com](https://www.omnintes.com) | ✅ 활성 |\n| 00746 | MOBILE | 믿고걸_뉴스 | [http://www.worthskippingnews.com](http://www.worthskippingnews.com) | ✅ 활성 |\n| 00747 | WEB | KB 은행 | [https://www.kbstar.com](https://www.kbstar.com) | ✅ 활성 |\n| 00748 | MOBILE | test251127 | [http://www.test251127.com](http://www.test251127.com) | ❌ 비활성 |\n| 00764 | MOBILE | test749 | [http://w.a.com](http://w.a.com) | ❌ 비활성 |\n| 00765 | MOBILE | test750 | [http://www.test.com](http://www.test.com) | ❌ 비활성 |\n\n총 **24개 컨테이너**가 등록되어 있으며, 이 중 **18개는 활성화**, **6개는 비활성화** 상태입니다. \n\n특정 컨테이너(예: “KB Pay”나 “와이즈컬렉터3”)의 **태스크 목록이나 설정 세부 정보**를 보고 싶으신가요?"
|
|
743
|
+
}, {
|
|
744
|
+
type: "text",
|
|
745
|
+
value: "# Hello\n" + "https://example.org\n" + "```sh\n" + "# Code block\n" + "const func = () => {};\n" + "```\n" + "\n" + "\n" + "~~strike~~ this\n" + "\n" + "[MIT](license) © [Titus Wormer](https://wooorm.com)\n" + "## TODO\n" + "\n" + "* [ ] This\n" + "* [ ] That\n" + "* [x] The other\n" + "\n" + "|Fahrenheit|Celsius|Kelvin|\n" + "|---:|---:|---:|\n" + "|-459.67|-273.15|0|\n" + "|-40|-40|233.15|\n" + "|32|0|273.15|\n" + "|212|100|373.15|\n"
|
|
746
|
+
}, {
|
|
741
747
|
type: 'text',
|
|
742
748
|
value: '안녕하세요! 저는 회사 내부 정보와 다양한 기능에 접근할 수 있는 AI 어시스턴트입니다.\n무엇을 도와드릴까요?'
|
|
743
749
|
}]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nethru/kit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "A React component library by Nethru",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"homepage": ".",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"@nethru/ui": "^2.1.45",
|
|
51
51
|
"highcharts": "^11.3.0",
|
|
52
52
|
"highcharts-react-official": "^3.2.1",
|
|
53
|
-
"react-markdown": "^10.1.0"
|
|
53
|
+
"react-markdown": "^10.1.0",
|
|
54
|
+
"remark-gfm": "^4.0.1"
|
|
54
55
|
},
|
|
55
56
|
"browserslist": {
|
|
56
57
|
"production": [
|