@zero-library/chat-agent 2.0.2 → 2.0.3
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/index.cjs.js +17 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +9 -8
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +17 -9
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs.js
CHANGED
|
@@ -210,6 +210,7 @@ var init_IndexQuote = __esm({
|
|
|
210
210
|
if (!el) return;
|
|
211
211
|
const previous = el.previousElementSibling;
|
|
212
212
|
if (!previous) return;
|
|
213
|
+
console.log("previous", previous, el);
|
|
213
214
|
previous.appendChild(el);
|
|
214
215
|
}, []);
|
|
215
216
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: "inline-block m-l-8", children: [
|
|
@@ -501,7 +502,8 @@ var defaultLayout = {
|
|
|
501
502
|
headerTitle: true,
|
|
502
503
|
headerConversationListBtn: true,
|
|
503
504
|
headerNewConversationBtn: true,
|
|
504
|
-
headerCloseBtn: false
|
|
505
|
+
headerCloseBtn: false,
|
|
506
|
+
disclaimerNotice: true
|
|
505
507
|
};
|
|
506
508
|
function createChatStore() {
|
|
507
509
|
const config = valtio.proxy({
|
|
@@ -895,7 +897,6 @@ init_Context();
|
|
|
895
897
|
var styles_module_default = {
|
|
896
898
|
loadingMessage: "styles_module_loadingMessage",
|
|
897
899
|
nsConversations: "styles_module_nsConversations",
|
|
898
|
-
nsBody: "styles_module_nsBody",
|
|
899
900
|
nsBodyWidth: "styles_module_nsBodyWidth",
|
|
900
901
|
nsBubbleList: "styles_module_nsBubbleList",
|
|
901
902
|
nsAgentHeader: "styles_module_nsAgentHeader",
|
|
@@ -965,7 +966,6 @@ var AgentHeader_default = () => {
|
|
|
965
966
|
const chatStore = useChatStore();
|
|
966
967
|
const agentState = valtio.useSnapshot(chatStore.agent);
|
|
967
968
|
const configState = valtio.useSnapshot(chatStore.config);
|
|
968
|
-
valtio.useSnapshot(chatStore.conversations);
|
|
969
969
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "space-between", align: "center", className: styles_module_default.nsAgentHeader, children: [
|
|
970
970
|
/* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 4, align: "center", children: [
|
|
971
971
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1170,7 +1170,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
|
|
|
1170
1170
|
label: "\u{1F914} \u63A8\u8350\u95EE\u9898:",
|
|
1171
1171
|
children: agentState.active.recommendQuestions.map(({ question, id }) => ({
|
|
1172
1172
|
key: id,
|
|
1173
|
-
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.
|
|
1173
|
+
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), className: classNames2__default.default(styles_module_default.chatWelcomePrompts, "text-ellipsis"), children: question })
|
|
1174
1174
|
}))
|
|
1175
1175
|
}
|
|
1176
1176
|
]
|
|
@@ -1198,7 +1198,7 @@ var BubbleListItems_default = ({ avatar = true }) => {
|
|
|
1198
1198
|
vertical: true,
|
|
1199
1199
|
items: chatMessage?.questionList.map(({ question, id }) => ({
|
|
1200
1200
|
key: id,
|
|
1201
|
-
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.
|
|
1201
|
+
description: /* @__PURE__ */ jsxRuntime.jsx("span", { onClick: () => chatStore.sendMessage(question), children: question })
|
|
1202
1202
|
}))
|
|
1203
1203
|
}
|
|
1204
1204
|
),
|
|
@@ -1667,7 +1667,8 @@ var SenderPromptsItems_default = () => {
|
|
|
1667
1667
|
var styles_module_default3 = {
|
|
1668
1668
|
nsPreviewHeader: "styles_module_nsPreviewHeader",
|
|
1669
1669
|
nsPreviewHeaderTitle: "styles_module_nsPreviewHeaderTitle",
|
|
1670
|
-
|
|
1670
|
+
nsChatSenderHeader: "styles_module_nsChatSenderHeader",
|
|
1671
|
+
nsDisclaimerNotice: "styles_module_nsDisclaimerNotice"
|
|
1671
1672
|
};
|
|
1672
1673
|
var layouts_default = react.forwardRef(({ theme, params, hooks, layout, defaultAgent }, ref) => {
|
|
1673
1674
|
const chatStore = react.useMemo(() => createChatStore(), []);
|
|
@@ -1774,7 +1775,7 @@ var layouts_default = react.forwardRef(({ theme, params, hooks, layout, defaultA
|
|
|
1774
1775
|
] }),
|
|
1775
1776
|
/* @__PURE__ */ jsxRuntime.jsx(antd.Splitter.Panel, { collapsible: false, resizable: false, size: hasPreView ? 400 : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { vertical: true, className: classNames2__default.default("height-full"), children: [
|
|
1776
1777
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.header, DefaultComponent: AgentHeader_default }),
|
|
1777
|
-
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: classNames2__default.default("full-scroll"
|
|
1778
|
+
/* @__PURE__ */ jsxRuntime.jsx(antd.Flex, { vertical: true, className: classNames2__default.default("full-scroll"), children: /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { justify: "center", vertical: true, gap: 24, className: classNames2__default.default("height-full p-t-8 p-b-8", styles_module_default.nsBodyWidth), children: [
|
|
1778
1779
|
common.shouldRender(configState.layout.messageList) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "full-scroll", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1779
1780
|
common.RenderWrapper,
|
|
1780
1781
|
{
|
|
@@ -1786,7 +1787,7 @@ var layouts_default = react.forwardRef(({ theme, params, hooks, layout, defaultA
|
|
|
1786
1787
|
common.RenderWrapper,
|
|
1787
1788
|
{
|
|
1788
1789
|
control: configState.layout.senderHeader,
|
|
1789
|
-
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default3.
|
|
1790
|
+
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles_module_default3.nsChatSenderHeader, children: [
|
|
1790
1791
|
"\u6211\u662F ",
|
|
1791
1792
|
agentState.active.name
|
|
1792
1793
|
] })
|
|
@@ -1800,7 +1801,14 @@ var layouts_default = react.forwardRef(({ theme, params, hooks, layout, defaultA
|
|
|
1800
1801
|
DefaultComponent: SenderPromptsItems_default
|
|
1801
1802
|
}
|
|
1802
1803
|
),
|
|
1803
|
-
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.sender, DefaultComponent: ChatSender_default2 })
|
|
1804
|
+
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.sender, DefaultComponent: ChatSender_default2 }),
|
|
1805
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1806
|
+
common.RenderWrapper,
|
|
1807
|
+
{
|
|
1808
|
+
control: configState.layout.disclaimerNotice,
|
|
1809
|
+
DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles_module_default3.nsDisclaimerNotice, children: "\u5185\u5BB9\u7531AI\u751F\u6210\uFF0C\u4EC5\u4F9B\u53C2\u8003\uFF0C\u8BF7\u4ED4\u7EC6\u7504\u522B" })
|
|
1810
|
+
}
|
|
1811
|
+
)
|
|
1804
1812
|
] }),
|
|
1805
1813
|
/* @__PURE__ */ jsxRuntime.jsx(common.RenderWrapper, { control: configState.layout.senderFooter, DefaultComponent: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) })
|
|
1806
1814
|
] }) })
|