@box/box-ai-content-answers 1.19.4 → 1.21.0
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/chunks/clear-conversation-button.js +15 -16
- package/dist/chunks/stopResponseButton.js +19 -23
- package/dist/chunks/types.js +8 -8
- package/dist/chunks/warning-message.js +15 -16
- package/dist/esm/lib/components/answer/answer-content.js +15 -15
- package/dist/esm/lib/components/answer/answer.js +107 -109
- package/dist/esm/lib/components/answer/citation.js +23 -24
- package/dist/esm/lib/components/answer/copy-button.js +3 -3
- package/dist/esm/lib/components/answer/embed-the-answer-button.js +44 -44
- package/dist/esm/lib/components/answer/feedback-tooltip.js +63 -56
- package/dist/esm/lib/components/answer/inline-error.js +1 -1
- package/dist/esm/lib/components/answer/loading-indicator.js +15 -18
- package/dist/esm/lib/components/answer/references.js +30 -30
- package/dist/esm/lib/components/answer/thumb-buttons.js +95 -96
- package/dist/esm/lib/components/api-wrapper/hooks/useContentAnswers.js +166 -167
- package/dist/esm/lib/components/api-wrapper/reducer.js +1 -1
- package/dist/esm/lib/components/api-wrapper/utils/request.js +8 -8
- package/dist/esm/lib/components/api-wrapper/utils/stream.js +24 -25
- package/dist/esm/lib/components/chat/chat.js +78 -79
- package/dist/esm/lib/components/common/focusInputUtils.js +3 -4
- package/dist/esm/lib/components/common/markdown-react.js +91 -93
- package/dist/esm/lib/components/common/markdown.js +2666 -2696
- package/dist/esm/lib/components/content/content.js +38 -39
- package/dist/esm/lib/components/footer/footer-actions.js +3 -3
- package/dist/esm/lib/components/footer/footer.js +97 -98
- package/dist/esm/lib/components/modal/modal.js +121 -122
- package/dist/esm/lib/components/sidebar/content.js +95 -101
- package/dist/esm/lib/components/sidebar/sidebar.js +82 -83
- package/dist/esm/lib/components/suggested-questions/suggested-questions.js +1 -1
- package/dist/esm/lib/components/suggested-questions/suggestions.js +30 -30
- package/dist/esm/lib/components/welcome-message/contextual-items-message.js +36 -38
- package/dist/esm/lib/components/welcome-message/items-dropdown.js +27 -27
- package/dist/esm/lib/hooks/usePromptFocus.js +13 -14
- package/dist/i18n/en-x-pseudo.js +89 -89
- package/dist/i18n/en-x-pseudo.properties +89 -89
- package/dist/styles/answer-content.css +1 -1
- package/dist/styles/answer.css +1 -1
- package/dist/styles/box-ai-content-answers.css +1 -1
- package/dist/styles/chat.css +1 -1
- package/dist/styles/clear-conversation-button.css +1 -1
- package/dist/styles/content.css +1 -1
- package/dist/styles/content2.css +1 -1
- package/dist/styles/markdown2.css +1 -1
- package/dist/styles/question.css +1 -1
- package/dist/styles/stopResponseButton.css +1 -1
- package/dist/styles/warning-message.css +1 -1
- package/dist/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,70 +1,69 @@
|
|
|
1
|
-
import { useBlueprintModernization as
|
|
2
|
-
import { ArrowsCollapse as
|
|
3
|
-
import { BoxAiLogo as
|
|
4
|
-
import { ArrowsMinimize as
|
|
5
|
-
import { Size8 as
|
|
6
|
-
import { BoxAiAgentSelectorWithApi as
|
|
7
|
-
import { useState as
|
|
8
|
-
import { useIntl as
|
|
9
|
-
import { BoxAiContentAnswers as
|
|
10
|
-
import { A as
|
|
11
|
-
import { LOGGER_BASE_CONFIG as M, LOGGER_ACTION_CLICK as
|
|
12
|
-
import { s, C as
|
|
13
|
-
import
|
|
14
|
-
import { Title as
|
|
15
|
-
import
|
|
1
|
+
import { useBlueprintModernization as V, useBreakpoint as X, Breakpoint as Y, Modal as c, TooltipProvider as Z, Tooltip as ee } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsCollapse as oe } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { BoxAiLogo as te } from "@box/blueprint-web-assets/icons/Logo";
|
|
4
|
+
import { ArrowsMinimize as ae } from "@box/blueprint-web-assets/icons/Medium";
|
|
5
|
+
import { Size8 as E } from "@box/blueprint-web-assets/tokens/tokens";
|
|
6
|
+
import { BoxAiAgentSelectorWithApi as se, AgentsProvider as re } from "@box/box-ai-agent-selector";
|
|
7
|
+
import { useState as le, useMemo as ne, useCallback as v, useEffect as C } from "react";
|
|
8
|
+
import { useIntl as ie } from "react-intl";
|
|
9
|
+
import { BoxAiContentAnswers as de } from "../../box-ai-content-answers.js";
|
|
10
|
+
import { A as ce, R as me } from "../../../../chunks/types.js";
|
|
11
|
+
import { LOGGER_BASE_CONFIG as M, LOGGER_ACTION_CLICK as ge } from "../common/constants.js";
|
|
12
|
+
import { s as t, C as pe } from "../../../../chunks/clear-conversation-button.js";
|
|
13
|
+
import fe from "./hooks/useStopPropagationOnEsc.js";
|
|
14
|
+
import { Title as ue } from "./title.js";
|
|
15
|
+
import S from "./messages.js";
|
|
16
16
|
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const Ce = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", Me = (o) => o ? S.collapseModalAriaLabel : S.closeModalAriaLabel, he = (o, a) => o ? a ? ae : oe : void 0, Te = (o, a) => {
|
|
18
|
+
const s = o === "collapsible";
|
|
19
19
|
return {
|
|
20
|
-
closeModalLabel:
|
|
21
|
-
closeModalTargetId:
|
|
22
|
-
closeModalIcon:
|
|
20
|
+
closeModalLabel: Me(s),
|
|
21
|
+
closeModalTargetId: Ce(s),
|
|
22
|
+
closeModalIcon: he(s, a)
|
|
23
23
|
};
|
|
24
|
-
},
|
|
24
|
+
}, ze = ({
|
|
25
25
|
children: o,
|
|
26
|
-
getAIStudioAgents:
|
|
27
|
-
hasCustomSuggestedQuestions:
|
|
28
|
-
hostAppName:
|
|
26
|
+
getAIStudioAgents: a,
|
|
27
|
+
hasCustomSuggestedQuestions: s,
|
|
28
|
+
hostAppName: m,
|
|
29
29
|
isAIStudioAgentSelectorEnabled: g = !1,
|
|
30
|
-
isDebugModeEnabled:
|
|
31
|
-
isStopResponseEnabled:
|
|
30
|
+
isDebugModeEnabled: x,
|
|
31
|
+
isStopResponseEnabled: B = !1,
|
|
32
32
|
itemSize: T,
|
|
33
33
|
extension: b,
|
|
34
|
-
onClearAction:
|
|
34
|
+
onClearAction: p,
|
|
35
35
|
onSelectAgent: P,
|
|
36
|
-
onSelectedAgentCallback:
|
|
37
|
-
promptValue:
|
|
38
|
-
recordAction:
|
|
39
|
-
setPromptValue:
|
|
40
|
-
shouldRenderProviders:
|
|
41
|
-
shouldShowLandingPage:
|
|
42
|
-
stopPropagationOnEsc:
|
|
36
|
+
onSelectedAgentCallback: _,
|
|
37
|
+
promptValue: k,
|
|
38
|
+
recordAction: r,
|
|
39
|
+
setPromptValue: q,
|
|
40
|
+
shouldRenderProviders: z = !0,
|
|
41
|
+
shouldShowLandingPage: G = !1,
|
|
42
|
+
stopPropagationOnEsc: y,
|
|
43
43
|
variant: A = "closable",
|
|
44
|
-
items:
|
|
45
|
-
parentItem:
|
|
46
|
-
...
|
|
44
|
+
items: i,
|
|
45
|
+
parentItem: f,
|
|
46
|
+
...H
|
|
47
47
|
}) => {
|
|
48
|
-
var v, I;
|
|
49
48
|
const {
|
|
50
|
-
enableModernizedComponents:
|
|
51
|
-
} =
|
|
52
|
-
open:
|
|
53
|
-
defaultOpen:
|
|
54
|
-
onOpenChange:
|
|
55
|
-
modal:
|
|
56
|
-
...
|
|
57
|
-
} =
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
closeModalLabel:
|
|
61
|
-
closeModalTargetId:
|
|
62
|
-
closeModalIcon:
|
|
63
|
-
} =
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
enableModernizedComponents: I
|
|
50
|
+
} = V(), {
|
|
51
|
+
open: L,
|
|
52
|
+
defaultOpen: F,
|
|
53
|
+
onOpenChange: j,
|
|
54
|
+
modal: D,
|
|
55
|
+
...d
|
|
56
|
+
} = H, R = ie(), Q = X() <= Y.Medium;
|
|
57
|
+
fe(y, L);
|
|
58
|
+
const u = d?.questions?.[d.questions.length - 1]?.error, [U, O] = le(!1), {
|
|
59
|
+
closeModalLabel: w,
|
|
60
|
+
closeModalTargetId: W,
|
|
61
|
+
closeModalIcon: K
|
|
62
|
+
} = ne(() => Te(A, I), [A, I]), l = v((n) => {
|
|
63
|
+
r && (n.data ??= {}, n.data.hostAppName = m, r(n));
|
|
64
|
+
}, [m, r]);
|
|
65
|
+
C(() => {
|
|
66
|
+
i || l({
|
|
68
67
|
...M,
|
|
69
68
|
target: "loaded",
|
|
70
69
|
data: {
|
|
@@ -72,100 +71,100 @@ const he = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
|
|
|
72
71
|
fileType: b
|
|
73
72
|
}
|
|
74
73
|
});
|
|
75
|
-
}, [
|
|
76
|
-
|
|
74
|
+
}, [l, b, T, i, r]), C(() => {
|
|
75
|
+
i && l({
|
|
77
76
|
...M,
|
|
78
77
|
target: "loaded",
|
|
79
78
|
data: {
|
|
80
|
-
parentItemType:
|
|
81
|
-
items:
|
|
82
|
-
status:
|
|
83
|
-
fileType:
|
|
79
|
+
parentItemType: f?.type,
|
|
80
|
+
items: i.map((n) => ({
|
|
81
|
+
status: n.status,
|
|
82
|
+
fileType: n.fileType
|
|
84
83
|
}))
|
|
85
84
|
}
|
|
86
85
|
});
|
|
87
|
-
}, [
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
const
|
|
91
|
-
|
|
86
|
+
}, [l, f, r]), C(() => {
|
|
87
|
+
u && u === ce.AGENT_NOT_FOUND && O(!0);
|
|
88
|
+
}, [u]);
|
|
89
|
+
const $ = () => {
|
|
90
|
+
p && (p(), l({
|
|
92
91
|
...M,
|
|
93
|
-
action:
|
|
92
|
+
action: ge,
|
|
94
93
|
target: "clearChat"
|
|
95
94
|
}));
|
|
96
|
-
},
|
|
97
|
-
defaultOpen:
|
|
98
|
-
modal:
|
|
99
|
-
onOpenChange:
|
|
100
|
-
open:
|
|
101
|
-
children: [/* @__PURE__ */ e(
|
|
95
|
+
}, J = v(async () => (O(!1), a()), [a]), N = /* @__PURE__ */ h(c, {
|
|
96
|
+
defaultOpen: F,
|
|
97
|
+
modal: D,
|
|
98
|
+
onOpenChange: j,
|
|
99
|
+
open: L,
|
|
100
|
+
children: [/* @__PURE__ */ e(c.Trigger, {
|
|
102
101
|
children: o
|
|
103
|
-
}), /* @__PURE__ */ h(
|
|
104
|
-
className:
|
|
102
|
+
}), /* @__PURE__ */ h(c.Content, {
|
|
103
|
+
className: t.contentAnswersModal,
|
|
105
104
|
"data-testid": "content-answers-modal",
|
|
106
105
|
size: "xlarge",
|
|
107
|
-
children: [/* @__PURE__ */ e(
|
|
108
|
-
className:
|
|
106
|
+
children: [/* @__PURE__ */ e(c.Header, {
|
|
107
|
+
className: t.modalHeaderContainer,
|
|
109
108
|
children: /* @__PURE__ */ h("div", {
|
|
110
|
-
className:
|
|
111
|
-
children: [!
|
|
112
|
-
className:
|
|
109
|
+
className: t.modalHeader,
|
|
110
|
+
children: [!Q && /* @__PURE__ */ e(te, {
|
|
111
|
+
className: t.BoxAIIconColor,
|
|
113
112
|
"data-testid": "content-answers-icon-color",
|
|
114
|
-
height:
|
|
115
|
-
width:
|
|
116
|
-
}), /* @__PURE__ */ e(
|
|
113
|
+
height: E,
|
|
114
|
+
width: E
|
|
115
|
+
}), /* @__PURE__ */ e(ue, {
|
|
117
116
|
isAIStudioAgentSelectorEnabled: g
|
|
118
|
-
}), g && /* @__PURE__ */ e(
|
|
119
|
-
contentClassName:
|
|
120
|
-
disabled:
|
|
121
|
-
fetcher:
|
|
122
|
-
hostAppName:
|
|
117
|
+
}), g && /* @__PURE__ */ e(se, {
|
|
118
|
+
contentClassName: t.agentSelectorContent,
|
|
119
|
+
disabled: d.hasRequestInProgress,
|
|
120
|
+
fetcher: J,
|
|
121
|
+
hostAppName: m,
|
|
123
122
|
onSelectAgent: P,
|
|
124
|
-
onSelectedAgentCallback:
|
|
125
|
-
recordAction:
|
|
126
|
-
requestState:
|
|
123
|
+
onSelectedAgentCallback: _,
|
|
124
|
+
recordAction: r,
|
|
125
|
+
requestState: U ? me.ERROR : void 0,
|
|
127
126
|
shouldHideAgentSelectorOnLoad: !0,
|
|
128
|
-
triggerChipClassName:
|
|
127
|
+
triggerChipClassName: t.agentSelectorTrigger,
|
|
129
128
|
useAgentLocalStorage: !0
|
|
130
129
|
})]
|
|
131
130
|
})
|
|
132
|
-
}), /* @__PURE__ */ e(
|
|
133
|
-
className: `box-content-answers-chat-container ${
|
|
134
|
-
hasCustomSuggestedQuestions:
|
|
135
|
-
hostAppName:
|
|
131
|
+
}), /* @__PURE__ */ e(de, {
|
|
132
|
+
className: `box-content-answers-chat-container ${t.boxAiContentAnswers}`,
|
|
133
|
+
hasCustomSuggestedQuestions: s,
|
|
134
|
+
hostAppName: m,
|
|
136
135
|
isAIStudioAgentSelectorEnabled: g,
|
|
137
|
-
isDebugModeEnabled:
|
|
138
|
-
isStopResponseEnabled:
|
|
139
|
-
items:
|
|
140
|
-
parentItem:
|
|
141
|
-
promptValue:
|
|
142
|
-
recordAction:
|
|
143
|
-
setPromptValue:
|
|
144
|
-
shouldShowLandingPage:
|
|
145
|
-
...
|
|
146
|
-
}),
|
|
147
|
-
hasRequestInProgress:
|
|
148
|
-
onClick:
|
|
149
|
-
}), /* @__PURE__ */ e(
|
|
150
|
-
children: /* @__PURE__ */ e(
|
|
151
|
-
content:
|
|
136
|
+
isDebugModeEnabled: x,
|
|
137
|
+
isStopResponseEnabled: B,
|
|
138
|
+
items: i,
|
|
139
|
+
parentItem: f,
|
|
140
|
+
promptValue: k,
|
|
141
|
+
recordAction: l,
|
|
142
|
+
setPromptValue: q,
|
|
143
|
+
shouldShowLandingPage: G,
|
|
144
|
+
...d
|
|
145
|
+
}), p && /* @__PURE__ */ e(pe, {
|
|
146
|
+
hasRequestInProgress: d.hasRequestInProgress,
|
|
147
|
+
onClick: $
|
|
148
|
+
}), /* @__PURE__ */ e(Z, {
|
|
149
|
+
children: /* @__PURE__ */ e(ee, {
|
|
150
|
+
content: R.formatMessage(w),
|
|
152
151
|
"data-testid": "content-answers-close-modal-tooltip",
|
|
153
|
-
children: /* @__PURE__ */ e(
|
|
154
|
-
"aria-label":
|
|
155
|
-
className:
|
|
156
|
-
"data-target-id":
|
|
157
|
-
icon:
|
|
152
|
+
children: /* @__PURE__ */ e(c.Close, {
|
|
153
|
+
"aria-label": R.formatMessage(w),
|
|
154
|
+
className: t["modal-close-button"],
|
|
155
|
+
"data-target-id": W,
|
|
156
|
+
icon: K,
|
|
158
157
|
size: "small"
|
|
159
158
|
})
|
|
160
159
|
})
|
|
161
160
|
})]
|
|
162
161
|
})]
|
|
163
162
|
});
|
|
164
|
-
return
|
|
165
|
-
children:
|
|
166
|
-
}) :
|
|
163
|
+
return z ? /* @__PURE__ */ e(re, {
|
|
164
|
+
children: N
|
|
165
|
+
}) : N;
|
|
167
166
|
};
|
|
168
167
|
export {
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
ze as IntelligenceModal,
|
|
169
|
+
ze as default
|
|
171
170
|
};
|
|
@@ -1,69 +1,63 @@
|
|
|
1
|
-
import { useBlueprintModernization as se, Text as ae, Tooltip as
|
|
2
|
-
import { ArrowsExpand as
|
|
1
|
+
import { useBlueprintModernization as se, Text as ae, Tooltip as Q, IconButton as $ } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsExpand as re, XMark as ie } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
3
|
import { ArrowsMaximize as ce } from "@box/blueprint-web-assets/icons/Medium";
|
|
4
4
|
import { useAgents as de, BoxAiAgentSelectorWithApi as le } from "@box/box-ai-agent-selector";
|
|
5
5
|
import D from "clsx";
|
|
6
|
-
import
|
|
6
|
+
import y from "lodash/isEqual";
|
|
7
7
|
import * as b from "react";
|
|
8
8
|
import { useIntl as be } from "react-intl";
|
|
9
9
|
import { BoxAiContentAnswers as pe } from "../../box-ai-content-answers.js";
|
|
10
10
|
import { withApiWrapper as Se } from "../api-wrapper/api-wrapper.js";
|
|
11
11
|
import { ORIGIN_BOXAI_SIDEBAR as Ae, EVENT_JS_READY as me } from "../common/constants.js";
|
|
12
|
-
import { mark as
|
|
13
|
-
import { C as
|
|
14
|
-
import { IntelligenceModal as
|
|
15
|
-
import { IntelligenceSidebarContext as
|
|
12
|
+
import { mark as ue } from "../common/performance.js";
|
|
13
|
+
import { C as Ie } from "../../../../chunks/clear-conversation-button.js";
|
|
14
|
+
import { IntelligenceModal as he } from "../modal/modal.js";
|
|
15
|
+
import { IntelligenceSidebarContext as Ce } from "./context.js";
|
|
16
16
|
import p from "./messages.js";
|
|
17
|
-
import
|
|
18
|
-
import { jsxs as
|
|
19
|
-
import '../../../../styles/content.css';const xe = "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
expanded: ze
|
|
40
|
-
}, Fe = `${Ae}_${me}`;
|
|
41
|
-
he(Fe);
|
|
42
|
-
const $e = ({
|
|
43
|
-
actions: f,
|
|
44
|
-
children: i,
|
|
17
|
+
import ge from "./title.js";
|
|
18
|
+
import { jsxs as u, Fragment as H, jsx as e } from "react/jsx-runtime";
|
|
19
|
+
import '../../../../styles/content.css';const xe = "_bcsContent_1kkpe_2", fe = "_bcsBoxAISidebar_1kkpe_2", _e = "_bcsContentHeader_1kkpe_6", Be = "_bcsTitle_1kkpe_15", ke = "_bcsScrollContent_1kkpe_22", we = "_withModalOpen_1kkpe_32", Te = "_bcsBoxAISidebarAgentSelector_1kkpe_35", Ee = "_bcsBoxAISidebarContent_1kkpe_47", Ne = "_bcsBoxAISidebarExpand_1kkpe_50", Me = "_bcsBoxAISidebarClear_1kkpe_53", ve = "_bcsBoxAISidebarTitlePart_1kkpe_56", Pe = "_bcsBoxAISidebarClose_1kkpe_77", Le = "_bcsContentSubheader_1kkpe_101", Oe = "_bcsScrollContentWrapper_1kkpe_110", t = {
|
|
20
|
+
bcsContent: xe,
|
|
21
|
+
bcsBoxAISidebar: fe,
|
|
22
|
+
bcsContentHeader: _e,
|
|
23
|
+
bcsTitle: Be,
|
|
24
|
+
bcsScrollContent: ke,
|
|
25
|
+
withModalOpen: we,
|
|
26
|
+
bcsBoxAISidebarAgentSelector: Te,
|
|
27
|
+
bcsBoxAISidebarContent: Ee,
|
|
28
|
+
bcsBoxAISidebarExpand: Ne,
|
|
29
|
+
bcsBoxAISidebarClear: Me,
|
|
30
|
+
bcsBoxAISidebarTitlePart: ve,
|
|
31
|
+
bcsBoxAISidebarClose: Pe,
|
|
32
|
+
bcsContentSubheader: Le,
|
|
33
|
+
bcsScrollContentWrapper: Oe
|
|
34
|
+
}, Re = `${Ae}_${me}`;
|
|
35
|
+
ue(Re);
|
|
36
|
+
const qe = ({
|
|
37
|
+
actions: B,
|
|
38
|
+
children: r,
|
|
45
39
|
className: o,
|
|
46
40
|
elementId: S = "",
|
|
47
|
-
sidebarView:
|
|
48
|
-
title:
|
|
41
|
+
sidebarView: I = "",
|
|
42
|
+
title: i,
|
|
49
43
|
subheader: c,
|
|
50
44
|
...d
|
|
51
45
|
}) => {
|
|
52
|
-
const A = `${S}${S === "" ? "" : "_"}${
|
|
53
|
-
return /* @__PURE__ */
|
|
46
|
+
const A = `${S}${S === "" ? "" : "_"}${I}`, h = `${A}-content`;
|
|
47
|
+
return /* @__PURE__ */ u("div", {
|
|
54
48
|
"aria-labelledby": A,
|
|
55
49
|
className: D(t.bcsContent, o),
|
|
56
50
|
"data-testid": "bcs-content",
|
|
57
|
-
id:
|
|
51
|
+
id: h,
|
|
58
52
|
role: "tabpanel",
|
|
59
53
|
...d,
|
|
60
|
-
children: [/* @__PURE__ */
|
|
54
|
+
children: [/* @__PURE__ */ u("div", {
|
|
61
55
|
className: t.bcsContentHeader,
|
|
62
|
-
children: [
|
|
56
|
+
children: [i && /* @__PURE__ */ e(ae, {
|
|
63
57
|
as: "h3",
|
|
64
58
|
className: t.bcsTitle,
|
|
65
|
-
children:
|
|
66
|
-
}),
|
|
59
|
+
children: i
|
|
60
|
+
}), B]
|
|
67
61
|
}), c && /* @__PURE__ */ e("div", {
|
|
68
62
|
className: t.bcsContentSubheader,
|
|
69
63
|
children: c
|
|
@@ -71,35 +65,35 @@ const $e = ({
|
|
|
71
65
|
className: t.bcsScrollContentWrapper,
|
|
72
66
|
children: /* @__PURE__ */ e("div", {
|
|
73
67
|
className: t.bcsScrollContent,
|
|
74
|
-
children:
|
|
68
|
+
children: r
|
|
75
69
|
})
|
|
76
70
|
})]
|
|
77
71
|
});
|
|
78
72
|
};
|
|
79
|
-
function
|
|
73
|
+
function Ue(B) {
|
|
80
74
|
const {
|
|
81
|
-
createSession:
|
|
75
|
+
createSession: r,
|
|
82
76
|
encodedSession: o,
|
|
83
77
|
onClearAction: S,
|
|
84
|
-
getAIStudioAgents:
|
|
85
|
-
hasRequestInProgress:
|
|
78
|
+
getAIStudioAgents: I,
|
|
79
|
+
hasRequestInProgress: i,
|
|
86
80
|
hostAppName: c,
|
|
87
81
|
isAIStudioAgentSelectorEnabled: d,
|
|
88
82
|
isLoading: A,
|
|
89
|
-
onSelectAgent:
|
|
90
|
-
questions:
|
|
83
|
+
onSelectAgent: h,
|
|
84
|
+
questions: C,
|
|
91
85
|
shouldShowLandingPage: N = !0,
|
|
92
|
-
sendQuestion:
|
|
86
|
+
sendQuestion: g,
|
|
93
87
|
stopQuestion: k,
|
|
94
88
|
embedTheAnswerButtonConfig: j,
|
|
95
89
|
onClose: M,
|
|
96
90
|
...v
|
|
97
|
-
} =
|
|
91
|
+
} = B, {
|
|
98
92
|
formatMessage: l
|
|
99
93
|
} = be(), {
|
|
100
94
|
enableModernizedComponents: J
|
|
101
95
|
} = se(), P = b.useRef(!1), [w, L] = b.useState(!1), {
|
|
102
|
-
cache:
|
|
96
|
+
cache: n,
|
|
103
97
|
contentName: O,
|
|
104
98
|
elementId: X,
|
|
105
99
|
fileExtension: Y,
|
|
@@ -113,57 +107,57 @@ function ye(f) {
|
|
|
113
107
|
onSelectedAgentCallback: K,
|
|
114
108
|
recordAction: m,
|
|
115
109
|
setCacheValue: x,
|
|
116
|
-
shouldPreinitSession:
|
|
117
|
-
} = b.useContext(
|
|
110
|
+
shouldPreinitSession: f
|
|
111
|
+
} = b.useContext(Ce), {
|
|
118
112
|
agents: Z,
|
|
119
113
|
requestState: ee,
|
|
120
114
|
selectedAgent: E
|
|
121
115
|
} = de(), {
|
|
122
|
-
questions:
|
|
123
|
-
} =
|
|
124
|
-
|
|
116
|
+
questions: s
|
|
117
|
+
} = n, [z, F] = b.useState("");
|
|
118
|
+
n.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), n.encodedSession !== o && x("encodedSession", o), y(n.questions, C) || x("questions", C), y(n.agents.selectedAgent, E) || x("agents", {
|
|
125
119
|
agents: Z,
|
|
126
120
|
requestState: ee,
|
|
127
121
|
selectedAgent: E
|
|
128
122
|
});
|
|
129
|
-
const
|
|
130
|
-
!
|
|
123
|
+
const _ = (a = !1) => {
|
|
124
|
+
!f && !o && !A && r && r(!0, !1), a && W && W();
|
|
131
125
|
}, te = () => {
|
|
132
126
|
L(!1);
|
|
133
127
|
}, oe = () => {
|
|
134
|
-
|
|
128
|
+
_(), L(!0);
|
|
135
129
|
};
|
|
136
|
-
b.useEffect(() => (
|
|
137
|
-
prompt:
|
|
130
|
+
b.useEffect(() => (f && !o && r && r(!0, !0), o && s.length > 0 && s[s.length - 1].isCompleted === !1 && g({
|
|
131
|
+
prompt: s[s.length - 1].prompt
|
|
138
132
|
}), m && m({
|
|
139
133
|
action: "programmatic",
|
|
140
134
|
component: "sidebar",
|
|
141
135
|
feature: "answers",
|
|
142
136
|
target: "loaded",
|
|
143
137
|
data: {
|
|
144
|
-
items: T.map((
|
|
145
|
-
status:
|
|
146
|
-
fileType:
|
|
138
|
+
items: T.map((a) => ({
|
|
139
|
+
status: a.status,
|
|
140
|
+
fileType: a.fileType
|
|
147
141
|
}))
|
|
148
142
|
}
|
|
149
143
|
}), () => {
|
|
150
144
|
k();
|
|
151
145
|
}), []), b.useEffect(() => {
|
|
152
|
-
const
|
|
153
|
-
!
|
|
146
|
+
const a = s[s.length - 1];
|
|
147
|
+
!f && !P.current && o && a?.isLoading && (g(a, E, !1), P.current = !0);
|
|
154
148
|
}, [o]);
|
|
155
|
-
const ne = () => /* @__PURE__ */
|
|
149
|
+
const ne = () => /* @__PURE__ */ u("div", {
|
|
156
150
|
className: t.bcsBoxAISidebarTitlePart,
|
|
157
|
-
children: [/* @__PURE__ */ e(
|
|
151
|
+
children: [/* @__PURE__ */ e(ge, {
|
|
158
152
|
isAIStudioAgentSelectorEnabled: d
|
|
159
153
|
}), d && /* @__PURE__ */ e("div", {
|
|
160
154
|
className: t.bcsBoxAISidebarAgentSelector,
|
|
161
155
|
children: /* @__PURE__ */ e(le, {
|
|
162
|
-
disabled:
|
|
163
|
-
fetcher:
|
|
156
|
+
disabled: i,
|
|
157
|
+
fetcher: I,
|
|
164
158
|
hostAppName: c,
|
|
165
|
-
onAgentsListOpen:
|
|
166
|
-
onSelectAgent:
|
|
159
|
+
onAgentsListOpen: _,
|
|
160
|
+
onSelectAgent: h,
|
|
167
161
|
onSelectedAgentCallback: K,
|
|
168
162
|
recordAction: m,
|
|
169
163
|
shouldHideAgentSelectorOnLoad: !0,
|
|
@@ -172,34 +166,34 @@ function ye(f) {
|
|
|
172
166
|
})
|
|
173
167
|
})]
|
|
174
168
|
});
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
children: [/* @__PURE__ */ e(
|
|
177
|
-
actions: /* @__PURE__ */
|
|
178
|
-
children: [ne(), /* @__PURE__ */ e(
|
|
169
|
+
return /* @__PURE__ */ u(H, {
|
|
170
|
+
children: [/* @__PURE__ */ e(qe, {
|
|
171
|
+
actions: /* @__PURE__ */ u(H, {
|
|
172
|
+
children: [ne(), /* @__PURE__ */ e(Ie, {
|
|
179
173
|
className: t.bcsBoxAISidebarClear,
|
|
180
|
-
hasRequestInProgress:
|
|
174
|
+
hasRequestInProgress: i,
|
|
181
175
|
onClick: S
|
|
182
|
-
}), /* @__PURE__ */ e(
|
|
176
|
+
}), /* @__PURE__ */ e(Q, {
|
|
183
177
|
content: l(p.sidebarBoxAISwitchToModalView),
|
|
184
178
|
"data-testid": "content-answers-open-modal-tooltip",
|
|
185
179
|
variant: "standard",
|
|
186
|
-
children: /* @__PURE__ */ e(
|
|
180
|
+
children: /* @__PURE__ */ e($, {
|
|
187
181
|
"aria-label": l(p.sidebarBoxAISwitchToModalView),
|
|
188
182
|
className: t.bcsBoxAISidebarExpand,
|
|
189
183
|
"data-target-id": "IconButton-expandBoxAISidebar",
|
|
190
|
-
icon: J ? ce :
|
|
184
|
+
icon: J ? ce : re,
|
|
191
185
|
onClick: oe,
|
|
192
186
|
size: "small"
|
|
193
187
|
})
|
|
194
|
-
}), M && /* @__PURE__ */ e(
|
|
188
|
+
}), M && /* @__PURE__ */ e(Q, {
|
|
195
189
|
content: l(p.sidebarBoxAIClose),
|
|
196
190
|
"data-testid": "content-answers-close-tooltip",
|
|
197
191
|
variant: "standard",
|
|
198
|
-
children: /* @__PURE__ */ e(
|
|
192
|
+
children: /* @__PURE__ */ e($, {
|
|
199
193
|
"aria-label": l(p.sidebarBoxAIClose),
|
|
200
194
|
className: t.bcsBoxAISidebarClose,
|
|
201
195
|
"data-target-id": "IconButton-closeBoxAISidebar",
|
|
202
|
-
icon:
|
|
196
|
+
icon: ie,
|
|
203
197
|
onClick: M,
|
|
204
198
|
size: "small"
|
|
205
199
|
})
|
|
@@ -224,25 +218,25 @@ function ye(f) {
|
|
|
224
218
|
isStopResponseEnabled: U,
|
|
225
219
|
items: T,
|
|
226
220
|
onFeedbackFormSubmit: V,
|
|
227
|
-
onUserIntentToUseAI:
|
|
221
|
+
onUserIntentToUseAI: _,
|
|
228
222
|
promptValue: z,
|
|
229
|
-
questions:
|
|
223
|
+
questions: C,
|
|
230
224
|
recordAction: m,
|
|
231
225
|
setPromptValue: F,
|
|
232
|
-
shouldShowLandingPage:
|
|
233
|
-
showLoadingIndicator: A &&
|
|
226
|
+
shouldShowLandingPage: n.shouldShowLandingPage,
|
|
227
|
+
showLoadingIndicator: A && f,
|
|
234
228
|
stopQuestion: k,
|
|
235
|
-
submitQuestion:
|
|
229
|
+
submitQuestion: g,
|
|
236
230
|
variant: "sidebar",
|
|
237
231
|
...v
|
|
238
232
|
})
|
|
239
233
|
})
|
|
240
|
-
}), /* @__PURE__ */ e(
|
|
234
|
+
}), /* @__PURE__ */ e(he, {
|
|
241
235
|
contentName: O,
|
|
242
236
|
contentType: l(p.sidebarBoxAIContent),
|
|
243
237
|
extension: Y,
|
|
244
|
-
getAIStudioAgents:
|
|
245
|
-
hasRequestInProgress:
|
|
238
|
+
getAIStudioAgents: I,
|
|
239
|
+
hasRequestInProgress: i,
|
|
246
240
|
hostAppName: c,
|
|
247
241
|
isAIStudioAgentSelectorEnabled: d,
|
|
248
242
|
isFeedbackEnabled: R,
|
|
@@ -253,25 +247,25 @@ function ye(f) {
|
|
|
253
247
|
onClearAction: S,
|
|
254
248
|
onFeedbackFormSubmit: V,
|
|
255
249
|
onOpenChange: te,
|
|
256
|
-
onSelectAgent:
|
|
257
|
-
onUserIntentToUseAI:
|
|
250
|
+
onSelectAgent: h,
|
|
251
|
+
onUserIntentToUseAI: _,
|
|
258
252
|
open: w,
|
|
259
253
|
promptValue: z,
|
|
260
|
-
questions:
|
|
254
|
+
questions: C,
|
|
261
255
|
recordAction: w ? m : void 0,
|
|
262
256
|
setPromptValue: F,
|
|
263
|
-
shouldShowLandingPage:
|
|
257
|
+
shouldShowLandingPage: n.shouldShowLandingPage,
|
|
264
258
|
showLoadingIndicator: !1,
|
|
265
259
|
stopPropagationOnEsc: !0,
|
|
266
260
|
stopQuestion: k,
|
|
267
|
-
submitQuestion:
|
|
261
|
+
submitQuestion: g,
|
|
268
262
|
variant: "collapsible",
|
|
269
263
|
...v,
|
|
270
264
|
shouldRenderProviders: !1
|
|
271
265
|
})]
|
|
272
266
|
});
|
|
273
267
|
}
|
|
274
|
-
const
|
|
268
|
+
const ot = Se(Ue);
|
|
275
269
|
export {
|
|
276
|
-
|
|
270
|
+
ot as default
|
|
277
271
|
};
|