@next-bricks/ai-portal 0.61.4 → 0.61.5
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/bricks.json +31 -31
- package/dist/chunks/7059.d0080bc9.js +3 -0
- package/dist/chunks/7059.d0080bc9.js.map +1 -0
- package/dist/chunks/9164.ce503deb.js +2 -0
- package/dist/chunks/9164.ce503deb.js.map +1 -0
- package/dist/chunks/elevo-sidebar.7fa9b191.js +3 -0
- package/dist/chunks/elevo-sidebar.7fa9b191.js.map +1 -0
- package/dist/chunks/{main.e666b2e6.js → main.ffd5eb79.js} +2 -2
- package/dist/chunks/{main.e666b2e6.js.map → main.ffd5eb79.js.map} +1 -1
- package/dist/chunks/page-container.068df693.js +2 -0
- package/dist/chunks/page-container.068df693.js.map +1 -0
- package/dist/examples.json +18 -18
- package/dist/index.fb9364a3.js +2 -0
- package/dist/{index.9e75c766.js.map → index.fb9364a3.js.map} +1 -1
- package/dist/manifest.json +204 -191
- package/dist/types.json +2081 -1943
- package/dist-types/elevo-sidebar/ChatHistory.d.ts +1 -1
- package/dist-types/elevo-sidebar/SectionTitle.d.ts +8 -0
- package/dist-types/elevo-sidebar/SpaceNav.d.ts +13 -0
- package/dist-types/elevo-sidebar/i18n.d.ts +4 -1
- package/dist-types/elevo-sidebar/index.d.ts +9 -7
- package/dist-types/elevo-sidebar/interfaces.d.ts +7 -0
- package/package.json +2 -2
- package/dist/chunks/2084.aae5392b.js +0 -3
- package/dist/chunks/2084.aae5392b.js.map +0 -1
- package/dist/chunks/9164.abc412b7.js +0 -2
- package/dist/chunks/9164.abc412b7.js.map +0 -1
- package/dist/chunks/elevo-sidebar.68648b33.js +0 -3
- package/dist/chunks/elevo-sidebar.68648b33.js.map +0 -1
- package/dist/chunks/page-container.08e26095.js +0 -2
- package/dist/chunks/page-container.08e26095.js.map +0 -1
- package/dist/index.9e75c766.js +0 -2
- /package/dist/chunks/{2084.aae5392b.js.LICENSE.txt → 7059.d0080bc9.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{elevo-sidebar.68648b33.js.LICENSE.txt → elevo-sidebar.7fa9b191.js.LICENSE.txt} +0 -0
package/dist/bricks.json
CHANGED
|
@@ -3,41 +3,41 @@
|
|
|
3
3
|
"bricks": [
|
|
4
4
|
"ai-portal.cruise-canvas",
|
|
5
5
|
"ai-portal.chat-box",
|
|
6
|
-
"ai-portal.stat-with-mini-chart",
|
|
7
6
|
"ai-portal.home-container",
|
|
7
|
+
"ai-portal.stat-with-mini-chart",
|
|
8
8
|
"ai-portal.elevo-sidebar",
|
|
9
9
|
"ai-portal.icon-button",
|
|
10
10
|
"ai-portal.show-cases",
|
|
11
11
|
"ai-portal.mcp-tools",
|
|
12
|
-
"ai-portal.ai-employees",
|
|
13
12
|
"ai-portal.chat-stream",
|
|
13
|
+
"ai-portal.ai-employees",
|
|
14
14
|
"ai-portal.ai-agents",
|
|
15
15
|
"ai-portal.call-tool",
|
|
16
16
|
"ai-portal.save-request-store",
|
|
17
17
|
"ai-portal.load-request-store",
|
|
18
18
|
"ai-portal.clear-request-store",
|
|
19
19
|
"ai-portal.set-chat-command",
|
|
20
|
-
"ai-portal.tab-list",
|
|
21
20
|
"ai-portal.page-container",
|
|
22
|
-
"ai-portal.
|
|
21
|
+
"ai-portal.tab-list",
|
|
23
22
|
"ai-portal.dropdown-select",
|
|
23
|
+
"ai-portal.preview-container",
|
|
24
24
|
"ai-portal.action-buttons",
|
|
25
25
|
"ai-portal.goal-card-list",
|
|
26
26
|
"ai-portal.project-conversations",
|
|
27
27
|
"ai-portal.project-knowledges",
|
|
28
28
|
"ai-portal.activity-timeline",
|
|
29
|
-
"ai-portal.chat-input",
|
|
30
|
-
"ai-portal.show-case",
|
|
31
29
|
"ai-portal.elevo-logo",
|
|
30
|
+
"ai-portal.show-case",
|
|
32
31
|
"ai-portal.blank-state",
|
|
33
32
|
"ai-portal.sticky-container",
|
|
34
33
|
"ai-portal.elevo-card",
|
|
35
34
|
"ai-portal.flow-tabs",
|
|
36
35
|
"ai-portal.stage-flow",
|
|
37
36
|
"ai-portal.running-flow",
|
|
37
|
+
"ai-portal.notice-dropdown",
|
|
38
38
|
"ai-portal.notice-list",
|
|
39
39
|
"ai-portal.gantt-chart",
|
|
40
|
-
"ai-portal.
|
|
40
|
+
"ai-portal.chat-input"
|
|
41
41
|
],
|
|
42
42
|
"elements": [],
|
|
43
43
|
"processors": [],
|
|
@@ -91,12 +91,6 @@
|
|
|
91
91
|
"ai-portal.tab-list",
|
|
92
92
|
"ai-portal.sticky-container"
|
|
93
93
|
],
|
|
94
|
-
"ai-portal.ai-employees": [
|
|
95
|
-
"eo-link",
|
|
96
|
-
"eo-icon",
|
|
97
|
-
"ai-portal.tab-list",
|
|
98
|
-
"ai-portal.sticky-container"
|
|
99
|
-
],
|
|
100
94
|
"ai-portal.chat-stream": [
|
|
101
95
|
"eo-icon",
|
|
102
96
|
"eo-button",
|
|
@@ -113,6 +107,12 @@
|
|
|
113
107
|
"basic.copy-to-clipboard",
|
|
114
108
|
"presentational.code-wrapper"
|
|
115
109
|
],
|
|
110
|
+
"ai-portal.ai-employees": [
|
|
111
|
+
"eo-link",
|
|
112
|
+
"eo-icon",
|
|
113
|
+
"ai-portal.tab-list",
|
|
114
|
+
"ai-portal.sticky-container"
|
|
115
|
+
],
|
|
116
116
|
"ai-portal.ai-agents": [
|
|
117
117
|
"eo-icon",
|
|
118
118
|
"eo-link"
|
|
@@ -121,12 +121,6 @@
|
|
|
121
121
|
"eo-link",
|
|
122
122
|
"ai-portal.sticky-container"
|
|
123
123
|
],
|
|
124
|
-
"ai-portal.preview-container": [
|
|
125
|
-
"eo-icon",
|
|
126
|
-
"eo-page-title",
|
|
127
|
-
"eo-main-view",
|
|
128
|
-
"eo-narrow-view"
|
|
129
|
-
],
|
|
130
124
|
"ai-portal.dropdown-select": [
|
|
131
125
|
"eo-popover",
|
|
132
126
|
"eo-icon",
|
|
@@ -135,6 +129,12 @@
|
|
|
135
129
|
"eo-menu-item",
|
|
136
130
|
"eo-input"
|
|
137
131
|
],
|
|
132
|
+
"ai-portal.preview-container": [
|
|
133
|
+
"eo-icon",
|
|
134
|
+
"eo-page-title",
|
|
135
|
+
"eo-main-view",
|
|
136
|
+
"eo-narrow-view"
|
|
137
|
+
],
|
|
138
138
|
"ai-portal.action-buttons": [
|
|
139
139
|
"eo-icon",
|
|
140
140
|
"eo-button"
|
|
@@ -162,11 +162,6 @@
|
|
|
162
162
|
"eo-icon",
|
|
163
163
|
"eo-easyops-avatar"
|
|
164
164
|
],
|
|
165
|
-
"ai-portal.chat-input": [
|
|
166
|
-
"eo-icon",
|
|
167
|
-
"ai-portal.icon-button",
|
|
168
|
-
"eo-actions"
|
|
169
|
-
],
|
|
170
165
|
"ai-portal.show-case": [
|
|
171
166
|
"eo-icon",
|
|
172
167
|
"eo-link"
|
|
@@ -184,6 +179,15 @@
|
|
|
184
179
|
"ai-portal.running-flow": [
|
|
185
180
|
"eo-icon"
|
|
186
181
|
],
|
|
182
|
+
"ai-portal.notice-dropdown": [
|
|
183
|
+
"eo-popover",
|
|
184
|
+
"eo-icon",
|
|
185
|
+
"eo-link",
|
|
186
|
+
"eo-button",
|
|
187
|
+
"eo-counter-badge",
|
|
188
|
+
"ai-portal.icon-button",
|
|
189
|
+
"eo-tooltip"
|
|
190
|
+
],
|
|
187
191
|
"ai-portal.notice-list": [
|
|
188
192
|
"eo-button",
|
|
189
193
|
"eo-icon",
|
|
@@ -197,15 +201,11 @@
|
|
|
197
201
|
"ai-portal.gantt-chart": [
|
|
198
202
|
"eo-icon"
|
|
199
203
|
],
|
|
200
|
-
"ai-portal.
|
|
201
|
-
"eo-popover",
|
|
204
|
+
"ai-portal.chat-input": [
|
|
202
205
|
"eo-icon",
|
|
203
|
-
"eo-link",
|
|
204
|
-
"eo-button",
|
|
205
|
-
"eo-counter-badge",
|
|
206
206
|
"ai-portal.icon-button",
|
|
207
|
-
"eo-
|
|
207
|
+
"eo-actions"
|
|
208
208
|
]
|
|
209
209
|
},
|
|
210
|
-
"filePath": "bricks/ai-portal/dist/index.
|
|
210
|
+
"filePath": "bricks/ai-portal/dist/index.fb9364a3.js"
|
|
211
211
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 7059.d0080bc9.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunk_next_bricks_ai_portal=globalThis.webpackChunk_next_bricks_ai_portal||[]).push([[7059],{5813:(e,t,i)=>{i.d(t,{I:()=>c,K:()=>a,NS:()=>o,t:()=>s});var n=i(67177);let a=function(e){return e.NEW_CHAT="NEW_CHAT",e.LOGOUT="LOGOUT",e.TODAY="TODAY",e.YESTERDAY="YESTERDAY",e.PREVIOUS_7_DAYS="PREVIOUS_7_DAYS",e.PREVIOUS_30_DAYS="PREVIOUS_30_DAYS",e.SWITCH_LANGUAGE="SWITCH_LANGUAGE",e.MY="MY",e.PROJECTS="PROJECTS",e.HISTORY="HISTORY",e.CREATE_PROJECT="CREATE_PROJECT",e.MOVE_TO_PROJECT="MOVE_TO_PROJECT",e.UNTITLED="UNTITLED",e.UNNAMED="UNNAMED",e.BUSINESS_OBJECTS="BUSINESS_OBJECTS",e.SERVICEFLOWS="SERVICEFLOWS",e.COLLABORATION_SPACES="COLLABORATION_SPACES",e}({});const r={[a.NEW_CHAT]:"New chat",[a.LOGOUT]:"Logout",[a.TODAY]:"Today",[a.YESTERDAY]:"Yesterday",[a.PREVIOUS_7_DAYS]:"Previous 7 days",[a.PREVIOUS_30_DAYS]:"Previous 30 days",[a.SWITCH_LANGUAGE]:"中文",[a.MY]:"My",[a.PROJECTS]:"Projects",[a.HISTORY]:"Chats",[a.CREATE_PROJECT]:"Create project",[a.MOVE_TO_PROJECT]:"Move to project",[a.UNTITLED]:"Untitled",[a.UNNAMED]:"Unnamed",[a.BUSINESS_OBJECTS]:"Business objects",[a.SERVICEFLOWS]:"Serviceflows",[a.COLLABORATION_SPACES]:"Collaboration spaces"},l={[a.NEW_CHAT]:"新对话",[a.LOGOUT]:"登出",[a.TODAY]:"今天",[a.YESTERDAY]:"昨天",[a.PREVIOUS_7_DAYS]:"过去7天",[a.PREVIOUS_30_DAYS]:"过去30天",[a.SWITCH_LANGUAGE]:"English",[a.MY]:"我的",[a.PROJECTS]:"项目",[a.HISTORY]:"对话",[a.CREATE_PROJECT]:"创建项目",[a.MOVE_TO_PROJECT]:"移动到项目",[a.UNTITLED]:"无标题",[a.UNNAMED]:"未命名",[a.BUSINESS_OBJECTS]:"业务对象",[a.SERVICEFLOWS]:"业务流",[a.COLLABORATION_SPACES]:"协作空间"},o="bricks/ai-portal/elevo-sidebar",c={en:r,zh:l},s=n.i18n.getFixedT(null,o)},41938:(e,t,i)=>{i.d(t,{c:()=>u});var n=i(89575),a=i(18769),r=i.n(a),l=i(53373),o=i.n(l),c=i(51578),s=i(5813),d=i(70579),p=i(94504);function u(e){let{returnUrl:t,spaceDetail:i,spaceObjects:l,spaceServiceflows:u,spaceLinks:m}=e;const g=(0,a.useRef)(null),[E,h]=(0,a.useState)(!1),[v,f]=(0,a.useState)(!1);return r().createElement(r().Fragment,null,r().createElement(d.EM,{url:t,className:"return-link"},r().createElement("div",{className:"heading"},r().createElement("div",{className:"title"},null==i?void 0:i.name),r().createElement("div",{className:"sub-title"},(0,s.t)(s.K.COLLABORATION_SPACES))),r().createElement(d.Bj,{className:"icon",lib:"lucide",icon:"arrow-left"})),r().createElement("div",{className:"divider"}),r().createElement("div",{className:"history",ref:g},null!=l&&l.length?r().createElement("div",{className:o()("section",{collapsed:E})},r().createElement(c._,{rootRef:g,title:(0,s.t)(s.K.BUSINESS_OBJECTS),collapsed:E,onToggle:()=>h((e=>!e))}),r().createElement("ul",{className:"items"},l.map(((e,t)=>r().createElement("li",{key:t},r().createElement(p.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(d.EM,{className:o()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,null!=u&&u.length?r().createElement("div",{className:o()("section",{collapsed:v})},r().createElement(c._,{rootRef:g,title:(0,s.t)(s.K.SERVICEFLOWS),collapsed:v,onToggle:()=>f((e=>!e))}),r().createElement("ul",{className:"items"},u.map(((e,t)=>r().createElement("li",{key:t},r().createElement(p.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(d.EM,{className:o()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,null!=m&&m.length?r().createElement("div",{className:"space-links"},m.map(((e,t)=>r().createElement(p.k,{key:t,url:e.url,activeIncludes:e.activeIncludes,render:i=>{let{active:a}=i;return r().createElement(d.EM,{key:t,className:o()("link",{active:a}),url:e.url},r().createElement(d.Bj,(0,n.A)({className:"icon"},e.icon)),r().createElement("span",{className:"title"},e.title))}})))):null))}},51578:(e,t,i)=>{i.d(t,{_:()=>s});var n=i(18769),a=i.n(n),r=i(41030),l=i(53373),o=i.n(l),c=i(70579);function s(e){let{rootRef:t,title:i,collapsed:l,children:s,onToggle:d}=e;const p=(0,n.useRef)(null),[u,m]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{if(l)return void m(!1);const e=t.current,i=p.current,n=null==i?void 0:i.nextElementSibling;if(!e||!i||!n)return;const a=(0,r.throttle)((()=>{const e=i.getBoundingClientRect(),t=n.getBoundingClientRect().top-e.top-e.height;m(t<1)}),100);return e.addEventListener("scroll",a),()=>{e.removeEventListener("scroll",a)}}),[l,t]),a().createElement("div",{className:o()("section-title",{sticky:u}),ref:p},a().createElement("div",{className:"section-label",onClick:d},i,a().createElement(c.Bj,{lib:"fa",icon:"angle-down"})),s)}},61408:(e,t,i)=>{i.d(t,{A:()=>o});var n=i(36758),a=i.n(n),r=i(40935),l=i.n(r)()(a());l.push([e.id,':host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.main{flex:1;min-height:0;display:flex;flex-direction:column}.divider{border-top:1px solid rgba(0,0,0,0.06);margin:16px 0}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior="drawer"]){z-index:2;width:0}:host(:not([behavior="drawer"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}.space-links{margin-top:16px}.return-link{display:block}.return-link .heading{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1;min-width:0}.return-link .title,.return-link .sub-title{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.return-link .title{font-weight:500;font-size:18px}.return-link .sub-title{font-size:12px;color:#8c8c8c}.return-link .icon{font-size:16px;color:#8c8c8c}.return-link:not(:hover) .icon{display:none}.return-link::part(link){display:flex;align-items:center;justify-content:center;padding:6px 8px;border-radius:8px;color:#000}.return-link::part(link):hover{background:rgba(0,0,0,0.04)}',""]);const o=l.toString()},70579:(e,t,i)=>{i.d(t,{Bj:()=>a,EM:()=>r,JQ:()=>o,Py:()=>s,qb:()=>l,qu:()=>c});var n=i(30981);const a=(0,n.wrapBrick)("eo-icon"),r=(0,n.wrapBrick)("eo-link"),l=(0,n.wrapBrick)("eo-dropdown-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),o=(0,n.wrapBrick)("eo-easyops-avatar"),c=(0,n.wrapBrick)("eo-mini-actions",{onActionClick:"action.click",onVisibleChange:"visible.change"}),s=(0,n.wrapBrick)("ai-portal.icon-button")},75197:(e,t,i)=>{i.d(t,{D:()=>f});var n=i(89575),a=i(18769),r=i.n(a),l=i(53373),o=i.n(l),c=i(22919);const s=async(e,t)=>(await c.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations",{...t,params:e})).data;var d=i(41030),p=i(5813),u=i(70579),m=i(40177),g=i(65549),E=i(94504),h=i(51578);const v={lib:"fa",icon:"plus"},f=(0,a.forwardRef)(x);function x(e,t){let{historyActions:i,historyUrlTemplate:l,projectUrlTemplate:f,projectActions:x,canAddProject:k,myLinks:b,onActionClick:y,onHistoryClick:S,onProjectActionClick:T,onAddProject:w}=e;const O=(0,a.useRef)(null),[N,C]=(0,a.useState)(!1),[A,_]=(0,a.useState)(null),[I,R]=(0,a.useState)(!1),[P,U]=(0,a.useState)(!1),[L,B]=(0,a.useState)(null),[j,Y]=(0,a.useState)(!1),[D,M]=(0,a.useState)(),[V,J]=(0,a.useState)(),[H,z]=(0,a.useState)(!1),W=(0,a.useRef)(!0),[G,K]=(0,a.useState)([]),F=(0,a.useMemo)((()=>[...null!=i?i:[],{isDropdown:!0,text:(0,p.t)(p.K.MOVE_TO_PROJECT),disabled:!(null!=A&&A.length),items:null==A?void 0:A.map((e=>({event:"move",key:e.instanceId,text:e.name,project:e})))}]),[i,A]);(0,a.useEffect)((()=>{(async()=>{try{const e=await(async()=>(await c.http.get("api/gateway/logic.llm.aiops_service/api/v1/elevo/projects",{params:{page:1,page_size:3e3}})).data)();_(e.list)}catch(e){console.error("Error loading projects:",e),U(!0),_([])}})()}),[]),(0,a.useEffect)((()=>{Promise.all([s({token:V,limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}}),...W.current?[]:[new Promise((e=>setTimeout(e,500)))]]).then((e=>{let[t]=e;W.current=!1,B((e=>[...null!=e?e:[],...t.conversations])),M(t.nextToken)})).catch((e=>{console.error("Error loading chat history:",e),B([]),z(!0)}))}),[V]);const[q,Q]=(0,a.useState)(null),X=(0,a.useRef)(null);(0,a.useEffect)((()=>{const e=X.current,t=O.current;if(!e||!D||!t||j)return;const i=new IntersectionObserver((e=>{for(const t of e)t.isIntersecting&&J(D)}),{root:t});return i.observe(e),()=>{i.disconnect()}}),[D,j]);const Z=(0,a.useRef)(0),$=(0,a.useCallback)((async()=>{try{const e=++Z.current,t=await s({limit:30,onlyOwner:!0,onlyUnrelatedProject:!0},{interceptorParams:{ignoreLoadingBar:!0}});if(e!==Z.current)return;B((e=>{const i=null!=e?e:[],n=t.conversations,a=new Set(n.map((e=>e.conversationId))),r=new Map(n.map((e=>[e.conversationId,e])));let l=!1,o=!1,c=!0;for(const e of i){const t=r.get(e.conversationId);if(!t)break;if(l=!0,o=c&&t!==n[0]||!(0,d.isEqual)(t,e),o)break;c=!1}return l?o?[...n,...i.filter((e=>!a.has(e.conversationId)))]:e:(M(t.nextToken),n)}))}catch(e){console.error("Error pulling chat history:",e)}}),[]);(0,a.useImperativeHandle)(t,(()=>({pull:$,removeProject:e=>{_((t=>t?t.filter((t=>t.instanceId!==e)):t))},addProject:e=>{_((t=>t?[...t,e]:[e]))},moveConversation:e=>{K((t=>[...t,e]))}})),[$]);const ee=(0,a.useMemo)((()=>L&&L.length?L.filter((e=>!G.includes(e.conversationId))):L),[L,G]);return r().createElement("div",{className:"history",ref:O},null!=b&&b.length?r().createElement("div",{className:o()("section",{collapsed:N})},r().createElement(h._,{rootRef:O,title:(0,p.t)(p.K.MY),collapsed:N,onToggle:()=>C((e=>!e))}),r().createElement("ul",{className:"items"},b.map(((e,t)=>r().createElement("li",{key:t},r().createElement(E.k,{url:e.url,activeIncludes:e.activeIncludes,render:t=>{let{active:i}=t;return r().createElement(u.EM,{className:o()("item",{active:i}),url:e.url},r().createElement("div",{className:"item-title"},e.title))}})))))):null,r().createElement("div",{className:o()("section",{collapsed:I})},r().createElement(h._,{rootRef:O,title:(0,p.t)(p.K.PROJECTS),collapsed:I,onToggle:()=>R((e=>!e))},k&&r().createElement(u.Py,{icon:v,variant:"mini-light",tooltip:(0,p.t)(p.K.CREATE_PROJECT),tooltipHoist:!0,className:"button",onClick:w})),r().createElement("ul",{className:"items"},P?r().createElement("li",{className:"error"},"Failed to load project"):A?A.map((e=>{const t=f?(0,g.Q)(f,e):void 0;return r().createElement("li",{key:e.instanceId},r().createElement(E.k,{url:t,render:i=>{let{active:a}=i;return r().createElement(u.EM,(0,n.A)({className:o()("item",{"actions-active":e.instanceId===q,active:a}),onClick:S},t?{url:t}:null),r().createElement("div",{className:"item-title",title:e.name},e.name||(0,p.t)(p.K.UNNAMED)),r().createElement(u.qu,{className:"actions",actions:x,themeVariant:"elevo",onActionClick:t=>{T({action:t.detail,project:e})},onVisibleChange:t=>{Q(t.detail?e.instanceId:null)}}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})))),r().createElement("div",{className:o()("section",{collapsed:j})},r().createElement(h._,{rootRef:O,title:(0,p.t)(p.K.HISTORY),collapsed:j,onToggle:()=>Y((e=>!e))}),r().createElement("ul",{className:"items"},ee?ee.map((e=>{const t=l?(0,g.Q)(l,e):void 0;return r().createElement("li",{key:e.conversationId},r().createElement(E.k,{url:t,render:t=>{let{active:i}=t;return r().createElement(u.EM,(0,n.A)({className:o()("item",{"actions-active":e.conversationId===q,active:i}),onClick:S},l?{url:(0,g.Q)(l,e)}:null),r().createElement("div",{className:"item-title",title:e.title},e.title||(0,p.t)(p.K.UNTITLED)),r().createElement(u.qu,{className:"actions",actions:F,onActionClick:t=>{y({action:t.detail,item:e,project:t.detail.project})},onVisibleChange:t=>{Q(t.detail?e.conversationId:null)}}),!m.QB.includes(e.state)&&r().createElement("div",{className:"working"}))}}))})):r().createElement("li",{className:"loading"},r().createElement(u.Bj,{lib:"antd",theme:"outlined",icon:"loading-3-quarters",spinning:!0})),H?r().createElement("li",{className:"error"},"Failed to load chat history"):null),!j&&D&&r().createElement("div",{className:"load-more",ref:X},r().createElement(u.Bj,{lib:"antd",icon:"loading-3-quarters",spinning:!0}))))}},94504:(e,t,i)=>{i.d(t,{k:()=>r});var n=i(18769),a=i(60128);function r(e){let{url:t,activeIncludes:i,render:r}=e;const[l,o]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{function e(e){if(t){for(const n of[t,...null!=i?i:[]])if((0,a.matchPath)(e.pathname,{path:n,exact:!1}))return void o(!0);o(!1)}else o(!1)}const n=(0,a.getHistory)();return e(n.location),n.listen(e)}),[t,i]),r({active:l})}}}]);
|
|
3
|
+
//# sourceMappingURL=7059.d0080bc9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/7059.d0080bc9.js","mappings":";qMAEO,IAAKA,EAAC,SAADA,GAAC,OAADA,EAAC,oBAADA,EAAC,gBAADA,EAAC,cAADA,EAAC,sBAADA,EAAC,kCAADA,EAAC,oCAADA,EAAC,kCAADA,EAAC,QAADA,EAAC,oBAADA,EAAC,kBAADA,EA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GACvB,GAAKzL,EAAL,CAIA,IAAK,MAAM0L,IAAQ,CAAC1L,KAASmB,QAAAA,EAAkB,IAE7C,IADgBwK,EAAAA,EAAAA,WAAUF,EAAIG,SAAU,CAAEF,OAAMG,OAAO,IAGrD,YADAN,GAAU,GAIdA,GAAU,EARV,MAFEA,GAAU,EAWd,CACA,MAAMO,GAAUC,EAAAA,EAAAA,cAEhB,OADAP,EAAgBM,EAAQE,UACjBF,EAAQG,OAAOT,EAAgB,GACrC,CAACxL,EAAKmB,IAEFC,EAAO,CAAEE,UAClB","sources":["webpack:///./src/elevo-sidebar/i18n.ts","webpack:///./src/elevo-sidebar/SpaceNav.tsx","webpack:///./src/elevo-sidebar/SectionTitle.tsx","webpack:///./src/elevo-sidebar/styles.shadow.css","webpack:///./src/elevo-sidebar/bricks.ts","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/getElevoProjects.js","webpack:///../../node_modules/@next-api-sdk/llm-sdk/dist/esm/api/llm/elevo/listElevoConversations.js","webpack:///./src/elevo-sidebar/ChatHistory.tsx","webpack:///./src/elevo-sidebar/NavLink.tsx"],"sourcesContent":["import { i18n } from \"@next-core/i18n\";\n\nexport enum K {\n NEW_CHAT = \"NEW_CHAT\",\n LOGOUT = \"LOGOUT\",\n TODAY = \"TODAY\",\n YESTERDAY = \"YESTERDAY\",\n PREVIOUS_7_DAYS = \"PREVIOUS_7_DAYS\",\n PREVIOUS_30_DAYS = \"PREVIOUS_30_DAYS\",\n SWITCH_LANGUAGE = \"SWITCH_LANGUAGE\",\n MY = \"MY\",\n PROJECTS = \"PROJECTS\",\n HISTORY = \"HISTORY\",\n CREATE_PROJECT = \"CREATE_PROJECT\",\n MOVE_TO_PROJECT = \"MOVE_TO_PROJECT\",\n UNTITLED = \"UNTITLED\",\n UNNAMED = \"UNNAMED\",\n BUSINESS_OBJECTS = \"BUSINESS_OBJECTS\",\n SERVICEFLOWS = \"SERVICEFLOWS\",\n COLLABORATION_SPACES = \"COLLABORATION_SPACES\",\n}\n\nconst en: Locale = {\n [K.NEW_CHAT]: \"New chat\",\n [K.LOGOUT]: \"Logout\",\n [K.TODAY]: \"Today\",\n [K.YESTERDAY]: \"Yesterday\",\n [K.PREVIOUS_7_DAYS]: \"Previous 7 days\",\n [K.PREVIOUS_30_DAYS]: \"Previous 30 days\",\n [K.SWITCH_LANGUAGE]: \"中文\",\n [K.MY]: \"My\",\n [K.PROJECTS]: \"Projects\",\n [K.HISTORY]: \"Chats\",\n [K.CREATE_PROJECT]: \"Create project\",\n [K.MOVE_TO_PROJECT]: \"Move to project\",\n [K.UNTITLED]: \"Untitled\",\n [K.UNNAMED]: \"Unnamed\",\n [K.BUSINESS_OBJECTS]: \"Business objects\",\n [K.SERVICEFLOWS]: \"Serviceflows\",\n [K.COLLABORATION_SPACES]: \"Collaboration spaces\",\n};\n\nconst zh: Locale = {\n [K.NEW_CHAT]: \"新对话\",\n [K.LOGOUT]: \"登出\",\n [K.TODAY]: \"今天\",\n [K.YESTERDAY]: \"昨天\",\n [K.PREVIOUS_7_DAYS]: \"过去7天\",\n [K.PREVIOUS_30_DAYS]: \"过去30天\",\n [K.SWITCH_LANGUAGE]: \"English\",\n [K.MY]: \"我的\",\n [K.PROJECTS]: \"项目\",\n [K.HISTORY]: \"对话\",\n [K.CREATE_PROJECT]: \"创建项目\",\n [K.MOVE_TO_PROJECT]: \"移动到项目\",\n [K.UNTITLED]: \"无标题\",\n [K.UNNAMED]: \"未命名\",\n [K.BUSINESS_OBJECTS]: \"业务对象\",\n [K.SERVICEFLOWS]: \"业务流\",\n [K.COLLABORATION_SPACES]: \"协作空间\",\n};\n\nexport const NS = \"bricks/ai-portal/elevo-sidebar\";\n\nexport const locales = { en, zh };\n\nexport const t = i18n.getFixedT(null, NS);\n\ntype Locale = { [k in K]: string } & {\n [k in K as `${k}_plural`]?: string;\n};\n","import React, { useRef, useState } from \"react\";\nimport classNames from \"classnames\";\nimport { SectionTitle } from \"./SectionTitle.js\";\nimport { K, t } from \"./i18n.js\";\nimport { WrappedIcon, WrappedLink } from \"./bricks.js\";\nimport { NavLink } from \"./NavLink.js\";\nimport type { SidebarLink } from \"./interfaces.js\";\n\nexport interface SpaceNavProps {\n returnUrl: string;\n spaceDetail: {\n instanceId: string;\n name: string;\n };\n spaceObjects?: SidebarLink[];\n spaceServiceflows?: SidebarLink[];\n spaceLinks?: SidebarLink[];\n}\n\nexport function SpaceNav({\n returnUrl,\n spaceDetail,\n spaceObjects,\n spaceServiceflows,\n spaceLinks,\n}: SpaceNavProps) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [objectsCollapsed, setObjectsCollapsed] = useState(false);\n const [serviceflowsCollapsed, setServiceflowsCollapsed] = useState(false);\n\n return (\n <>\n <WrappedLink url={returnUrl} className=\"return-link\">\n <div className=\"heading\">\n <div className=\"title\">{spaceDetail?.name}</div>\n <div className=\"sub-title\">{t(K.COLLABORATION_SPACES)}</div>\n </div>\n <WrappedIcon className=\"icon\" lib=\"lucide\" icon=\"arrow-left\" />\n </WrappedLink>\n <div className=\"divider\" />\n <div className=\"history\" ref={rootRef}>\n {spaceObjects?.length ? (\n <div\n className={classNames(\"section\", { collapsed: objectsCollapsed })}\n >\n <SectionTitle\n rootRef={rootRef}\n title={t(K.BUSINESS_OBJECTS)}\n collapsed={objectsCollapsed}\n onToggle={() => setObjectsCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {spaceObjects.map((obj, index) => (\n <li key={index}>\n <NavLink\n url={obj.url}\n activeIncludes={obj.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={obj.url}\n >\n <div className=\"item-title\">{obj.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {spaceServiceflows?.length ? (\n <div\n className={classNames(\"section\", {\n collapsed: serviceflowsCollapsed,\n })}\n >\n <SectionTitle\n rootRef={rootRef}\n title={t(K.SERVICEFLOWS)}\n collapsed={serviceflowsCollapsed}\n onToggle={() => setServiceflowsCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {spaceServiceflows.map((obj, index) => (\n <li key={index}>\n <NavLink\n url={obj.url}\n activeIncludes={obj.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={obj.url}\n >\n <div className=\"item-title\">{obj.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n {spaceLinks?.length ? (\n <div className=\"space-links\">\n {spaceLinks.map((link, index) => (\n <NavLink\n key={index}\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n key={index}\n className={classNames(\"link\", { active })}\n url={link.url}\n >\n <WrappedIcon className=\"icon\" {...link.icon} />\n <span className=\"title\">{link.title}</span>\n </WrappedLink>\n )}\n />\n ))}\n </div>\n ) : null}\n </div>\n </>\n );\n}\n","import React, {\n useEffect,\n useRef,\n useState,\n type MutableRefObject,\n type PropsWithChildren,\n} from \"react\";\nimport { throttle } from \"lodash\";\nimport classNames from \"classnames\";\nimport { WrappedIcon } from \"./bricks.js\";\n\nexport interface SectionTitleProps {\n rootRef: MutableRefObject<HTMLDivElement | null>;\n title: string;\n collapsed: boolean;\n onToggle: () => void;\n}\n\nexport function SectionTitle({\n rootRef,\n title,\n collapsed,\n children,\n onToggle,\n}: PropsWithChildren<SectionTitleProps>) {\n const ref = useRef<HTMLDivElement | null>(null);\n const [stickyActive, setStickyActive] = useState(false);\n\n useEffect(() => {\n if (collapsed) {\n setStickyActive(false);\n return;\n }\n const parent = rootRef.current;\n const element = ref.current;\n const sibling = element?.nextElementSibling as HTMLElement | null;\n if (!parent || !element || !sibling) {\n return;\n }\n const onScroll = throttle(() => {\n const rect = element.getBoundingClientRect();\n const siblingRect = sibling.getBoundingClientRect();\n const diff = siblingRect.top - rect.top - rect.height;\n setStickyActive(diff < 1);\n }, 100);\n parent.addEventListener(\"scroll\", onScroll);\n return () => {\n parent.removeEventListener(\"scroll\", onScroll);\n };\n }, [collapsed, rootRef]);\n\n return (\n <div\n className={classNames(\"section-title\", { sticky: stickyActive })}\n ref={ref}\n >\n <div className=\"section-label\" onClick={onToggle}>\n {title}\n <WrappedIcon lib=\"fa\" icon=\"angle-down\" />\n </div>\n {children}\n </div>\n );\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block}:host([hidden]){display:none}*{box-sizing:border-box}.sidebar{position:relative;z-index:2;width:260px;height:100%;background:rgba(246,247,249,0.5);border:1px solid rgba(255,255,255,0.3);border-radius:12px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:23px 11px 0;display:flex;flex-direction:column;transition:transform 0.3s ease-in-out}.logo-bar{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px;margin-left:4px}.main{flex:1;min-height:0;display:flex;flex-direction:column}.divider{border-top:1px solid rgba(0,0,0,0.06);margin:16px 0}.logo-link::part(link){display:block}.logo{vertical-align:middle}.new-chat::part(link){display:flex;gap:0;align-items:center;color:var(--elevo-color-brand);font-size:14px;text-align:left;cursor:pointer}.sidebar .new-chat::part(link){background:#f0f4ff;border-radius:8px;border:1px solid #c9d7ff;padding:9px 13px;font-weight:500;margin-bottom:16px}.sidebar .new-chat::part(link):hover{background:rgba(201,215,255,0.5)}.new-chat-icon{font-size:16px;margin-right:5px}.footer{border-top:1px solid rgba(0,0,0,0.04);padding:9px 12px;margin:0 -12px}.dropdown{display:block}.account{background:none;border:none;border-radius:8px;padding:6px 10px;display:block;width:100%;text-align:left;cursor:pointer}.account:hover{background:rgba(0,0,0,0.04)}.alternative{position:fixed;top:8px;left:8px;padding:6px 10px 6px 8px;display:flex;align-items:center;opacity:0;z-index:2;transition:opacity 0.2s ease-in-out;background:rgba(255,255,255,0);border-radius:8px;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.alternative .new-chat::part(link){padding:4px;margin-left:16px;font-size:12px}.alternative .new-chat::part(link):hover{color:#7891ff}.alternative .new-chat::part(link):active{color:#0911b3}.container{width:270px;padding:10px 0 10px 10px;height:100%;transition:width 0.3s ease-in-out,padding 0.3s ease-in-out}.container.collapsed{width:0;padding:10px 0;overflow:visible}.container.collapsed .sidebar{transform:translateX(-100%)}.container.collapsed .alternative{opacity:1}:host([behavior=\"drawer\"]){z-index:2;width:0}:host(:not([behavior=\"drawer\"])) .alternative .new-chat{display:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0}.link{display:block}.link + .link{margin-top:4px}.link::part(link){display:flex;gap:0;align-items:center;padding:7px 10px;border-radius:8px;color:#000}.link.active::part(link),.link::part(link):hover{background:rgba(0,0,0,0.04)}.link .icon{font-size:16px;margin-right:10px}.link .title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history{flex:1;min-height:0;overflow-y:auto;margin:0 -12px;padding:0 12px}.history ul{list-style:none;margin:0;padding:0}.history .section + .section{margin-top:14px}.history .section-title{display:flex;align-items:center;justify-content:space-between;height:30px;margin-bottom:6px;padding:0 8px;position:sticky;top:0}.history .section-title.sticky::before{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgb(229,228,234);border-radius:8px;z-index:-1}.history .section-label{display:flex;align-items:center;height:24px;padding:0 8px;margin-left:-8px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:12px;color:#8c8c8c;border-radius:8px}.history .section-label eo-icon{vertical-align:middle;margin-left:6px;transition:transform 0.2s ease-in-out}.history .section-label:hover{background:rgba(0,0,0,0.04)}.history .collapsed > ul{display:none}.history .collapsed .section-label eo-icon{transform:rotate(-90deg)}.history .error,.history .loading{display:flex;align-items:center;height:36px;padding:0 8px}.history .loading{justify-content:center}.history .error{color:var(--color-error)}.history .group + .group{margin-top:15px}.history .group-title{font-weight:500;font-size:12px;color:#000;padding:8px;height:36px;line-height:20px}.history .item{display:block}.history .item::part(link){display:flex;align-items:center;padding:0 8px;height:36px;border-radius:8px;color:#000}.history .item.active::part(link){background:rgba(0,0,0,0.06)}.history .item.actions-active::part(link),.history .item::part(link):hover{background:rgba(0,0,0,0.04)}.history .item-title{flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.history .actions{cursor:auto}.history .item:not(:hover):not(.actions-active) .actions{display:none}.history .working{width:8px;height:8px;border-radius:8px;background:var(--elevo-color-brand);margin:0 7px}.history .item.actions-active .working,.history .item:hover .working,.history .item.active .working{display:none}.history .load-more{display:flex;justify-content:center;align-items:center;height:36px}.button{display:flex}.space-links{margin-top:16px}.return-link{display:block}.return-link .heading{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex:1;min-width:0}.return-link .title,.return-link .sub-title{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.return-link .title{font-weight:500;font-size:18px}.return-link .sub-title{font-size:12px;color:#8c8c8c}.return-link .icon{font-size:16px;color:#8c8c8c}.return-link:not(:hover) .icon{display:none}.return-link::part(link){display:flex;align-items:center;justify-content:center;padding:6px 8px;border-radius:8px;color:#000}.return-link::part(link):hover{background:rgba(0,0,0,0.04)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\nimport type {\n EoDropdownActions,\n DropdownActionsProps,\n DropdownActionsEvents,\n DropdownActionsEventsMapping,\n} from \"@next-bricks/basic/dropdown-actions\";\nimport type {\n EoEasyopsAvatar,\n EoEasyopsAvatarProps,\n} from \"@next-bricks/basic/easyops-avatar\";\nimport type {\n EoMiniActions,\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping,\n EoMiniActionsProps,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { IconButton, IconButtonProps } from \"../icon-button\";\n\nexport const WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nexport const WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\nexport const WrappedDropdownActions = wrapBrick<\n EoDropdownActions,\n DropdownActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n DropdownActionsEvents,\n DropdownActionsEventsMapping\n>(\"eo-dropdown-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedEasyopsAvatar = wrapBrick<\n EoEasyopsAvatar,\n EoEasyopsAvatarProps\n>(\"eo-easyops-avatar\");\nexport const WrappedMiniActions = wrapBrick<\n EoMiniActions,\n EoMiniActionsProps & { themeVariant?: \"default\" | \"elevo\" },\n EoMiniActionsEvents,\n EoMiniActionsEventsMapping\n>(\"eo-mini-actions\", {\n onActionClick: \"action.click\",\n onVisibleChange: \"visible.change\",\n});\nexport const WrappedIconButton = wrapBrick<IconButton, IconButtonProps>(\n \"ai-portal.icon-button\"\n);\n","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo项目列表\n * @endpoint list /api/v1/elevo/projects\n */\nexport const ElevoApi_getElevoProjects = async (params, options) => /**! @contract easyops.api.llm.elevo.GetElevoProjects@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/projects\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=getElevoProjects.js.map","import { http } from \"@next-core/http\";\n/**\n * @description 获取elevo会话列表\n * @endpoint GET /api/v1/elevo/conversations\n */\nexport const ElevoApi_listElevoConversations = async (params, options) => /**! @contract easyops.api.llm.elevo.ListElevoConversations@1.0.0 */(await http.get(\"api/gateway/logic.llm.aiops_service/api/v1/elevo/conversations\", {\n ...options,\n params\n})).data;\n//# sourceMappingURL=listElevoConversations.js.map","import React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport classNames from \"classnames\";\nimport {\n ElevoApi_listElevoConversations,\n ElevoApi_getElevoProjects,\n type ElevoApi_ListElevoConversationsRequestParams,\n} from \"@next-api-sdk/llm-sdk\";\nimport type {\n ActionType,\n SimpleActionType,\n} from \"@next-bricks/basic/mini-actions\";\nimport type { GeneralIconProps } from \"@next-bricks/icons/general-icon\";\nimport { isEqual } from \"lodash\";\nimport { K, t } from \"./i18n.js\";\nimport {\n WrappedIcon,\n WrappedLink,\n WrappedMiniActions,\n WrappedIconButton,\n} from \"./bricks.js\";\nimport { DONE_STATES } from \"../shared/constants.js\";\nimport { parseTemplate } from \"../shared/parseTemplate.js\";\nimport type { ConversationState } from \"../shared/interfaces.js\";\nimport type { SidebarLink } from \"./interfaces.js\";\nimport { NavLink } from \"./NavLink.js\";\nimport { SectionTitle } from \"./SectionTitle.js\";\n\nconst ADD_ICON: GeneralIconProps = {\n lib: \"fa\",\n icon: \"plus\",\n};\n\nexport interface HistoryItem {\n conversationId: string;\n title: string;\n startTime: number;\n state?: ConversationState;\n}\n\nexport interface GroupedHistory {\n title: string;\n items: HistoryItem[];\n}\n\nexport interface ActionClickDetail {\n action: SimpleActionType & {\n project?: Project;\n };\n item: HistoryItem;\n project?: Project;\n}\n\nexport interface ProjectActionClickDetail {\n action: SimpleActionType;\n project: Project;\n}\n\nexport interface Project {\n /** 实例ID */\n instanceId: string;\n /** 项目名称 */\n name: string;\n /** 项目描述 */\n description: string;\n /** 状态 */\n state: \"active\" | \"inactive\";\n /** 默认数字人ID */\n defaultAiEmployeeId: string;\n /** 创建者 */\n creator: string;\n /** 创建时间 */\n ctime: string;\n /** 修改时间 */\n mtime: string;\n /** 修改者 */\n modifier: string;\n}\n\nexport interface ChatHistoryProps {\n historyUrlTemplate?: string;\n historyActions?: ActionType[];\n projectUrlTemplate?: string;\n projectActions?: ActionType[];\n canAddProject?: boolean;\n myLinks?: SidebarLink[];\n onActionClick: (detail: ActionClickDetail) => void;\n onHistoryClick: () => void;\n onProjectActionClick: (detail: ProjectActionClickDetail) => void;\n onAddProject: () => void;\n}\n\nexport interface ChatHistoryRef {\n pull: () => void;\n removeProject?: (projectId: string) => void;\n addProject?: (project: Project) => void;\n moveConversation?: (conversationId: string) => void;\n}\n\nexport const ChatHistory = forwardRef(LowLevelChatHistory);\n\nexport function LowLevelChatHistory(\n {\n historyActions,\n historyUrlTemplate,\n projectUrlTemplate,\n projectActions,\n canAddProject,\n myLinks,\n onActionClick,\n onHistoryClick,\n onProjectActionClick,\n onAddProject,\n }: ChatHistoryProps,\n ref: React.Ref<ChatHistoryRef>\n) {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const [myCollapsed, setMyCollapsed] = useState(false);\n const [projects, setProjects] = useState<Project[] | null>(null);\n const [projectsCollapsed, setProjectsCollapsed] = useState(false);\n const [projectsError, setProjectsError] = useState(false);\n const [historyList, setHistoryList] = useState<HistoryItem[] | null>(null);\n const [historyCollapsed, setHistoryCollapsed] = useState(false);\n const [nextToken, setNextToken] = useState<string | undefined>();\n const [loadNextToken, setLoadNextToken] = useState<string | undefined>();\n const [historyError, setHistoryError] = useState(false);\n const initialRef = useRef(true);\n const [movedConversations, setMovedConversations] = useState<string[]>([]);\n\n const mergedHistoryActions = useMemo(\n () =>\n [\n ...(historyActions ?? []),\n {\n isDropdown: true,\n text: t(K.MOVE_TO_PROJECT),\n disabled: !projects?.length,\n items: projects?.map((project) => ({\n event: \"move\",\n key: project.instanceId,\n text: project.name,\n project,\n })),\n },\n ] as ActionType[],\n [historyActions, projects]\n );\n\n useEffect(() => {\n (async () => {\n try {\n const projects = await ElevoApi_getElevoProjects({\n page: 1,\n page_size: 3000,\n });\n setProjects(projects.list as Project[]);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error loading projects:\", error);\n setProjectsError(true);\n setProjects([]);\n }\n })();\n }, []);\n\n useEffect(() => {\n Promise.all([\n ElevoApi_listElevoConversations(\n {\n token: loadNextToken,\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n ),\n ...(initialRef.current\n ? []\n : [\n new Promise((resolve) => setTimeout(resolve, 500)), // Force a minimum delay\n ]),\n ])\n .then(([data]) => {\n initialRef.current = false;\n setHistoryList((prev) => [\n ...(prev ?? []),\n ...(data.conversations as HistoryItem[]),\n ]);\n setNextToken(data.nextToken);\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(\"Error loading chat history:\", error);\n setHistoryList([]);\n setHistoryError(true);\n });\n }, [loadNextToken]);\n\n const [actionsVisible, setActionsVisible] = useState<string | null>(null);\n\n const nextRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n const next = nextRef.current;\n const root = rootRef.current;\n if (!next || !nextToken || !root || historyCollapsed) {\n return;\n }\n const observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n setLoadNextToken(nextToken);\n }\n }\n },\n { root }\n );\n observer.observe(next);\n return () => {\n observer.disconnect();\n };\n }, [nextToken, historyCollapsed]);\n\n const pullIdRef = useRef(0);\n\n const pull = useCallback(async () => {\n try {\n const pullId = ++pullIdRef.current;\n const tempList = await ElevoApi_listElevoConversations(\n {\n limit: 30,\n onlyOwner: true,\n onlyUnrelatedProject: true,\n } as ElevoApi_ListElevoConversationsRequestParams,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n if (pullId !== pullIdRef.current) {\n // Ignore this pull if a newer one has been triggered\n return;\n }\n setHistoryList((prev) => {\n const prevList = prev ?? [];\n const newList = tempList.conversations as HistoryItem[];\n const newIds = new Set(newList.map((item) => item.conversationId));\n const newItemsMap = new Map(\n newList.map((item) => [item.conversationId, item])\n );\n\n let foundIntersection = false;\n let foundChanged = false;\n let isFirst = true;\n for (const item of prevList) {\n const newItem = newItemsMap.get(item.conversationId);\n if (newItem) {\n foundIntersection = true;\n foundChanged =\n (isFirst && newItem !== newList[0]) || !isEqual(newItem, item);\n if (foundChanged) {\n break;\n }\n } else {\n break;\n }\n isFirst = false;\n }\n\n if (!foundIntersection) {\n setNextToken(tempList.nextToken);\n return newList;\n }\n\n if (foundChanged) {\n return [\n ...newList,\n ...prevList.filter((item) => !newIds.has(item.conversationId)),\n ];\n }\n\n return prev;\n });\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(\"Error pulling chat history:\", error);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n pull,\n removeProject: (projectId: string) => {\n setProjects((prev) =>\n prev ? prev.filter((p) => p.instanceId !== projectId) : prev\n );\n },\n addProject: (project: Project) => {\n setProjects((prev) => (prev ? [...prev, project] : [project]));\n },\n moveConversation: (conversationId: string) => {\n setMovedConversations((prev) => [...prev, conversationId]);\n },\n }),\n [pull]\n );\n\n const filteredHistoryList = useMemo(() => {\n if (!historyList || !historyList.length) {\n return historyList;\n }\n return historyList.filter(\n (item) => !movedConversations.includes(item.conversationId)\n );\n }, [historyList, movedConversations]);\n\n return (\n <div className=\"history\" ref={rootRef}>\n {myLinks?.length ? (\n <div className={classNames(\"section\", { collapsed: myCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.MY)}\n collapsed={myCollapsed}\n onToggle={() => setMyCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {myLinks.map((link, index) => (\n <li key={index}>\n <NavLink\n url={link.url}\n activeIncludes={link.activeIncludes}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", { active })}\n url={link.url}\n >\n <div className=\"item-title\">{link.title}</div>\n </WrappedLink>\n )}\n />\n </li>\n ))}\n </ul>\n </div>\n ) : null}\n <div className={classNames(\"section\", { collapsed: projectsCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.PROJECTS)}\n collapsed={projectsCollapsed}\n onToggle={() => setProjectsCollapsed((prev) => !prev)}\n >\n {canAddProject && (\n <WrappedIconButton\n icon={ADD_ICON}\n variant=\"mini-light\"\n tooltip={t(K.CREATE_PROJECT)}\n tooltipHoist={true}\n className=\"button\"\n onClick={onAddProject}\n />\n )}\n </SectionTitle>\n <ul className=\"items\">\n {projectsError ? (\n <li className=\"error\">Failed to load project</li>\n ) : projects ? (\n projects.map((project) => {\n const url = projectUrlTemplate\n ? parseTemplate(projectUrlTemplate, project)\n : undefined;\n return (\n <li key={project.instanceId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n project.instanceId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(url ? { url } : null)}\n >\n <div className=\"item-title\" title={project.name}>\n {project.name || t(K.UNNAMED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={projectActions}\n themeVariant=\"elevo\"\n onActionClick={(e) => {\n onProjectActionClick({ action: e.detail, project });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? project.instanceId : null\n );\n }}\n />\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n </ul>\n </div>\n <div className={classNames(\"section\", { collapsed: historyCollapsed })}>\n <SectionTitle\n rootRef={rootRef}\n title={t(K.HISTORY)}\n collapsed={historyCollapsed}\n onToggle={() => setHistoryCollapsed((prev) => !prev)}\n />\n <ul className=\"items\">\n {filteredHistoryList ? (\n filteredHistoryList.map((item) => {\n const url = historyUrlTemplate\n ? parseTemplate(historyUrlTemplate, item)\n : undefined;\n return (\n <li key={item.conversationId}>\n <NavLink\n url={url}\n render={({ active }) => (\n <WrappedLink\n className={classNames(\"item\", {\n \"actions-active\":\n item.conversationId === actionsVisible,\n active,\n })}\n onClick={onHistoryClick}\n {...(historyUrlTemplate\n ? { url: parseTemplate(historyUrlTemplate, item) }\n : null)}\n >\n <div className=\"item-title\" title={item.title}>\n {item.title || t(K.UNTITLED)}\n </div>\n <WrappedMiniActions\n className=\"actions\"\n actions={mergedHistoryActions}\n onActionClick={(e) => {\n onActionClick({\n action: e.detail,\n item,\n project: (e.detail as { project?: Project })\n .project,\n });\n }}\n onVisibleChange={(e) => {\n setActionsVisible(\n e.detail ? item.conversationId : null\n );\n }}\n />\n {!DONE_STATES.includes(item.state!) && (\n <div className=\"working\"></div>\n )}\n </WrappedLink>\n )}\n />\n </li>\n );\n })\n ) : (\n <li className=\"loading\">\n <WrappedIcon\n lib=\"antd\"\n theme=\"outlined\"\n icon=\"loading-3-quarters\"\n spinning\n />\n </li>\n )}\n {historyError ? (\n <li className=\"error\">Failed to load chat history</li>\n ) : null}\n </ul>\n {!historyCollapsed && nextToken && (\n <div className=\"load-more\" ref={nextRef}>\n <WrappedIcon lib=\"antd\" icon=\"loading-3-quarters\" spinning />\n </div>\n )}\n </div>\n </div>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { getHistory, matchPath } from \"@next-core/runtime\";\nimport type { Location } from \"history\";\n\nexport interface NavLinkProps {\n url?: string;\n activeIncludes?: string[];\n render: (props: { active: boolean }) => React.ReactElement;\n}\n\nexport function NavLink({ url, activeIncludes, render }: NavLinkProps) {\n const [active, setActive] = useState(false);\n\n useEffect(() => {\n function checkLinkActive(loc: Location) {\n if (!url) {\n setActive(false);\n return;\n }\n for (const path of [url, ...(activeIncludes ?? [])]) {\n const matched = matchPath(loc.pathname, { path, exact: false });\n if (matched) {\n setActive(true);\n return;\n }\n }\n setActive(false);\n }\n const history = getHistory();\n checkLinkActive(history.location);\n return history.listen(checkLinkActive);\n }, [url, activeIncludes]);\n\n return render({ active });\n}\n"],"names":["K","en","NEW_CHAT","LOGOUT","TODAY","YESTERDAY","PREVIOUS_7_DAYS","PREVIOUS_30_DAYS","SWITCH_LANGUAGE","MY","PROJECTS","HISTORY","CREATE_PROJECT","MOVE_TO_PROJECT","UNTITLED","UNNAMED","BUSINESS_OBJECTS","SERVICEFLOWS","COLLABORATION_SPACES","zh","NS","locales","t","i18n","getFixedT","SpaceNav","_ref","returnUrl","spaceDetail","spaceObjects","spaceServiceflows","spaceLinks","rootRef","useRef","objectsCollapsed","setObjectsCollapsed","useState","serviceflowsCollapsed","setServiceflowsCollapsed","React","WrappedLink","url","className","name","WrappedIcon","lib","icon","ref","length","classNames","collapsed","SectionTitle","title","onToggle","prev","map","obj","index","key","NavLink","activeIncludes","render","_ref2","active","_ref3","link","_ref4","_extends","children","stickyActive","setStickyActive","useEffect","parent","current","element","sibling","nextElementSibling","onScroll","throttle","rect","getBoundingClientRect","diff","top","height","addEventListener","removeEventListener","sticky","onClick","___CSS_LOADER_EXPORT___","push","module","id","toString","wrapBrick","WrappedDropdownActions","onActionClick","onVisibleChange","WrappedEasyopsAvatar","WrappedMiniActions","WrappedIconButton","ElevoApi_listElevoConversations","async","params","options","http","get","data","ADD_ICON","ChatHistory","forwardRef","LowLevelChatHistory","historyActions","historyUrlTemplate","projectUrlTemplate","projectActions","canAddProject","myLinks","onHistoryClick","onProjectActionClick","onAddProject","myCollapsed","setMyCollapsed","projects","setProjects","projectsCollapsed","setProjectsCollapsed","projectsError","setProjectsError","historyList","setHistoryList","historyCollapsed","setHistoryCollapsed","nextToken","setNextToken","loadNextToken","setLoadNextToken","historyError","setHistoryError","initialRef","movedConversations","setMovedConversations","mergedHistoryActions","useMemo","isDropdown","text","disabled","items","project","event","instanceId","page","page_size","ElevoApi_getElevoProjects","list","error","console","Promise","all","token","limit","onlyOwner","onlyUnrelatedProject","interceptorParams","ignoreLoadingBar","resolve","setTimeout","then","conversations","catch","actionsVisible","setActionsVisible","nextRef","next","root","observer","IntersectionObserver","entries","entry","isIntersecting","observe","disconnect","pullIdRef","pull","useCallback","pullId","tempList","prevList","newList","newIds","Set","item","conversationId","newItemsMap","Map","foundIntersection","foundChanged","isFirst","newItem","isEqual","filter","has","useImperativeHandle","removeProject","projectId","p","addProject","moveConversation","filteredHistoryList","includes","variant","tooltip","tooltipHoist","parseTemplate","undefined","actions","themeVariant","e","action","detail","theme","spinning","_ref5","DONE_STATES","state","setActive","checkLinkActive","loc","path","matchPath","pathname","exact","history","getHistory","location","listen"],"sourceRoot":""}
|