@alauda/doom 1.12.0 → 1.12.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.
|
@@ -118,5 +118,5 @@ export const AIAssistant = ({ open, onOpenChange }) => {
|
|
|
118
118
|
setLoading(false);
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
|
-
return (_jsxs("div", { className: clsx(classes.container, 'rspress-doc', open && classes.open), children: [_jsxs("div", { className: classes.header, children: [_jsxs("div", { className: classes.title, children: [t('ai_assistant'), loggedIn && (_jsxs(_Fragment, { children: [_jsxs("span", { className: classes.username, children: ["(", authInfo.detail.user.name, ")"] }), _jsx(LogoutIcon, { className:
|
|
121
|
+
return (_jsxs("div", { className: clsx(classes.container, 'rspress-doc', open && classes.open), children: [_jsxs("div", { className: classes.header, children: [_jsxs("div", { className: classes.title, children: [t('ai_assistant'), loggedIn && (_jsxs(_Fragment, { children: [_jsxs("span", { className: classes.username, children: ["(", authInfo.detail.user.name, ")"] }), _jsx(LogoutIcon, { className: "ai-assistant-logout", onClick: onLogout }), _jsx(Tooltip, { anchorSelect: ".ai-assistant-logout", children: t('logout') })] }))] }), _jsxs("div", { className: classes.icons, children: [messages.length ? (_jsxs(_Fragment, { children: [_jsx(NewChatIcon, { className: "ai-assistant-new-chat", onClick: onNewChat }), _jsx(Tooltip, { anchorSelect: ".ai-assistant-new-chat", children: t('new_chat') })] })) : null, _jsx(CloseIcon, { className: "ai-assistant-close", onClick: onClose }), _jsx(Tooltip, { anchorSelect: ".ai-assistant-close", children: t('close') })] })] }), messages.length ? (_jsx(Chat, { ref: chatRef, messages: messages })) : (_jsx(Preamble, { loggedIn: loggedIn })), loggedIn && _jsx(ResizableUserInput, { loading: loading, onSend: onSend })] }));
|
|
122
122
|
};
|
|
@@ -8,7 +8,6 @@ import { AIAssistant } from "./AIAssistant/index.js";
|
|
|
8
8
|
import { CloudAuthProvider } from "./context.js";
|
|
9
9
|
import assistantIcon from '@alauda/doom/assets/assistant.svg';
|
|
10
10
|
import { useMemoizedFn, useTranslation } from '@alauda/doom/runtime';
|
|
11
|
-
import classes from '@alauda/doom/styles/intelligence.module.scss';
|
|
12
11
|
const ALLOWED_DOMAINS = new Set(['docs-dev.alauda.cn', 'docs.alauda.io']);
|
|
13
12
|
if (!isProduction()) {
|
|
14
13
|
ALLOWED_DOMAINS.add('localhost');
|
|
@@ -19,7 +18,7 @@ const Intelligence_ = () => {
|
|
|
19
18
|
const toggleOpen = useMemoizedFn(() => {
|
|
20
19
|
setOpen((prev) => !prev);
|
|
21
20
|
});
|
|
22
|
-
return (_jsxs(CloudAuthProvider, { children: [_jsx(AIAssistant, { open: open, onOpenChange: toggleOpen }), open || (_jsx("button", { type: "button", className:
|
|
21
|
+
return (_jsxs(CloudAuthProvider, { children: [_jsx(AIAssistant, { open: open, onOpenChange: toggleOpen }), open || (_jsx("button", { type: "button", className: "intelligence-entry", onClick: toggleOpen, children: _jsx("img", { alt: t('ai_assistant'), src: assistantIcon }) })), _jsx(Tooltip, { anchorSelect: ".intelligence-entry", place: "left", children: t('ai_assistant') })] }));
|
|
23
22
|
};
|
|
24
23
|
const Intelligence = () => {
|
|
25
24
|
const lang = useLang();
|
package/package.json
CHANGED
|
@@ -37,25 +37,7 @@
|
|
|
37
37
|
color: var(--rp-c-text-2);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.logout {
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
margin-left: 8px;
|
|
43
|
-
color: var(--rp-c-text-2);
|
|
44
|
-
outline: none;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
40
|
.icons {
|
|
48
41
|
display: inline-flex;
|
|
49
42
|
align-items: center;
|
|
50
43
|
}
|
|
51
|
-
|
|
52
|
-
.new-chat {
|
|
53
|
-
margin-right: 18px;
|
|
54
|
-
cursor: pointer;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.close {
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
color: var(--rp-c-text-2);
|
|
60
|
-
outline: none;
|
|
61
|
-
}
|
package/styles/intelligence.scss
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
html:root {
|
|
2
|
+
--rt-color-dark: #191d24;
|
|
3
|
+
--rt-color-white: rgba(255, 255, 245, 0.93);
|
|
4
|
+
|
|
5
|
+
--rt-opacity: 1;
|
|
6
|
+
|
|
7
|
+
&.dark {
|
|
8
|
+
--rt-color-dark: #fff;
|
|
9
|
+
--rt-color-white: #213547;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.intelligence-entry {
|
|
14
|
+
position: fixed;
|
|
15
|
+
bottom: 15%;
|
|
16
|
+
right: 0;
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
background-color: var(--rp-c-bg);
|
|
20
|
+
height: 40px;
|
|
21
|
+
border-top-left-radius: 100px;
|
|
22
|
+
border-bottom-left-radius: 100px;
|
|
23
|
+
box-shadow: 0px 0px 12px 0px var(--rp-c-divider);
|
|
24
|
+
padding-left: 10px;
|
|
25
|
+
padding-right: 8px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ai-assistant-logout {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
margin-left: 8px;
|
|
31
|
+
color: var(--rp-c-text-2);
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ai-assistant-new-chat {
|
|
36
|
+
margin-right: 18px;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ai-assistant-close {
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
color: var(--rp-c-text-2);
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
1
46
|
.api-error-alert {
|
|
2
47
|
display: flex;
|
|
3
48
|
align-items: center;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
:global html:root {
|
|
2
|
-
--rt-color-dark: #191d24;
|
|
3
|
-
--rt-color-white: rgba(255, 255, 245, 0.93);
|
|
4
|
-
|
|
5
|
-
--rt-opacity: 1;
|
|
6
|
-
|
|
7
|
-
&.dark {
|
|
8
|
-
--rt-color-dark: #fff;
|
|
9
|
-
--rt-color-white: #213547;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.entry {
|
|
14
|
-
position: fixed;
|
|
15
|
-
bottom: 15%;
|
|
16
|
-
right: 0;
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
background-color: var(--rp-c-bg);
|
|
20
|
-
height: 40px;
|
|
21
|
-
border-top-left-radius: 100px;
|
|
22
|
-
border-bottom-left-radius: 100px;
|
|
23
|
-
box-shadow: 0px 0px 12px 0px var(--rp-c-divider);
|
|
24
|
-
padding-left: 10px;
|
|
25
|
-
padding-right: 8px;
|
|
26
|
-
}
|