@box/box-ai-content-answers 0.148.10 → 0.148.12
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/esm/index.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { BoxAiContentAnswers as r } from "./lib/box-ai-content-answers.js";
|
|
2
|
-
import { AnswerContent as
|
|
3
|
-
import { References as
|
|
4
|
-
import { withApiWrapper as
|
|
5
|
-
import { C as
|
|
6
|
-
import { IntelligenceModal as
|
|
7
|
-
import { IntelligenceSidebar as
|
|
8
|
-
import {
|
|
9
|
-
import { usePromptFocus as
|
|
10
|
-
import { A as
|
|
2
|
+
import { AnswerContent as E } from "./lib/components/answer/answer-content.js";
|
|
3
|
+
import { References as p } from "./lib/components/answer/references.js";
|
|
4
|
+
import { withApiWrapper as n } from "./lib/components/api-wrapper/api-wrapper.js";
|
|
5
|
+
import { C as _ } from "../chunks/clear-conversation-button.js";
|
|
6
|
+
import { IntelligenceModal as A } from "./lib/components/modal/modal.js";
|
|
7
|
+
import { IntelligenceSidebar as m } from "./lib/components/sidebar/sidebar.js";
|
|
8
|
+
import { AI_AGENTS_LOCAL_STORAGE_KEY as S, APP_MODE as P } from "./lib/constants.js";
|
|
9
|
+
import { usePromptFocus as C } from "./lib/hooks/usePromptFocus.js";
|
|
10
|
+
import { A as l, C as I, F as N, R as U, S as c, U as u } from "../chunks/types.js";
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
S as AI_AGENTS_LOCAL_STORAGE_KEY,
|
|
13
|
+
l as ANSWER_ERROR,
|
|
14
|
+
P as APP_MODE,
|
|
15
|
+
E as AnswerContent,
|
|
15
16
|
r as BoxAiContentAnswers,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
I as CONTENT_ERROR,
|
|
18
|
+
_ as ClearConversationButton,
|
|
19
|
+
N as FeedbackIssueType,
|
|
20
|
+
A as IntelligenceModal,
|
|
21
|
+
m as IntelligenceSidebar,
|
|
22
|
+
U as REQUEST_STATE,
|
|
23
|
+
p as References,
|
|
24
|
+
c as SUGGESTED_QUESTION_PROMPT_TYPE,
|
|
25
|
+
u as USER_INPUT_PROMPT_TYPE,
|
|
26
|
+
C as usePromptFocus,
|
|
27
|
+
n as withApiWrapper
|
|
27
28
|
};
|
|
@@ -10,14 +10,14 @@ import { A as ne, R as ie } from "../../../../chunks/types.js";
|
|
|
10
10
|
import { LOGGER_BASE_CONFIG as p, LOGGER_ACTION_CLICK as de } from "../common/constants.js";
|
|
11
11
|
import { s, C as ce } from "../../../../chunks/clear-conversation-button.js";
|
|
12
12
|
import me from "./hooks/useStopPropagationOnEsc.js";
|
|
13
|
-
import { Title as
|
|
13
|
+
import { Title as ge } from "./title.js";
|
|
14
14
|
import S from "./messages.js";
|
|
15
15
|
import { jsxs as M, jsx as e } from "react/jsx-runtime";
|
|
16
|
-
const
|
|
16
|
+
const fe = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", ue = (o) => o ? S.collapseModalAriaLabel : S.closeModalAriaLabel, Ce = (o) => o ? $ : void 0, pe = (o) => {
|
|
17
17
|
const l = o === "collapsible";
|
|
18
18
|
return {
|
|
19
19
|
closeModalLabel: ue(l),
|
|
20
|
-
closeModalTargetId:
|
|
20
|
+
closeModalTargetId: fe(l),
|
|
21
21
|
closeModalIcon: Ce(l)
|
|
22
22
|
};
|
|
23
23
|
}, _e = ({
|
|
@@ -25,37 +25,37 @@ const ge = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
|
|
|
25
25
|
getAIStudioAgents: l,
|
|
26
26
|
hasCustomSuggestedQuestions: x,
|
|
27
27
|
hostAppName: m,
|
|
28
|
-
isAIStudioAgentSelectorEnabled:
|
|
28
|
+
isAIStudioAgentSelectorEnabled: g = !1,
|
|
29
29
|
isDebugModeEnabled: B,
|
|
30
30
|
isStopResponseEnabled: _ = !1,
|
|
31
31
|
itemSize: h,
|
|
32
32
|
extension: T,
|
|
33
|
-
onClearAction:
|
|
33
|
+
onClearAction: f,
|
|
34
34
|
onSelectAgent: k,
|
|
35
35
|
onSelectedAgentCallback: P,
|
|
36
36
|
recordAction: r,
|
|
37
37
|
shouldRenderProviders: q = !0,
|
|
38
38
|
shouldShowLandingPage: G = !1,
|
|
39
39
|
stopPropagationOnEsc: H,
|
|
40
|
-
variant:
|
|
40
|
+
variant: L = "closable",
|
|
41
41
|
items: i,
|
|
42
42
|
parentItem: d,
|
|
43
43
|
...z
|
|
44
44
|
}) => {
|
|
45
45
|
var E, v;
|
|
46
46
|
const {
|
|
47
|
-
open:
|
|
47
|
+
open: R,
|
|
48
48
|
defaultOpen: F,
|
|
49
49
|
onOpenChange: j,
|
|
50
50
|
modal: D,
|
|
51
51
|
...a
|
|
52
|
-
} = z,
|
|
53
|
-
me(H,
|
|
54
|
-
const u = (v = (E = a == null ? void 0 : a.questions) == null ? void 0 : E[a.questions.length - 1]) == null ? void 0 : v.error, [U,
|
|
55
|
-
closeModalLabel:
|
|
52
|
+
} = z, b = le(), Q = V() <= X.Medium;
|
|
53
|
+
me(H, R);
|
|
54
|
+
const u = (v = (E = a == null ? void 0 : a.questions) == null ? void 0 : E[a.questions.length - 1]) == null ? void 0 : v.error, [U, A] = se(!1), {
|
|
55
|
+
closeModalLabel: O,
|
|
56
56
|
closeModalTargetId: W,
|
|
57
57
|
closeModalIcon: y
|
|
58
|
-
} = ae(() => pe(
|
|
58
|
+
} = ae(() => pe(L), [L]), n = I((t) => {
|
|
59
59
|
r && (t.data ?? (t.data = {}), t.data.hostAppName = m, r(t));
|
|
60
60
|
}, [m, r]);
|
|
61
61
|
C(() => {
|
|
@@ -80,19 +80,19 @@ const ge = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
}, [n, d, r]), C(() => {
|
|
83
|
-
u && u === ne.AGENT_NOT_FOUND &&
|
|
83
|
+
u && u === ne.AGENT_NOT_FOUND && A(!0);
|
|
84
84
|
}, [u]);
|
|
85
85
|
const K = () => {
|
|
86
|
-
|
|
86
|
+
f && (f(), n({
|
|
87
87
|
...p,
|
|
88
88
|
action: de,
|
|
89
89
|
target: "clearChat"
|
|
90
90
|
}));
|
|
91
|
-
}, J = I(async () => (
|
|
91
|
+
}, J = I(async () => (A(!1), l()), [l]), N = /* @__PURE__ */ M(c, {
|
|
92
92
|
defaultOpen: F,
|
|
93
93
|
modal: D,
|
|
94
94
|
onOpenChange: j,
|
|
95
|
-
open:
|
|
95
|
+
open: R,
|
|
96
96
|
children: [/* @__PURE__ */ e(c.Trigger, {
|
|
97
97
|
children: o
|
|
98
98
|
}), /* @__PURE__ */ M(c.Content, {
|
|
@@ -108,9 +108,9 @@ const ge = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
|
|
|
108
108
|
"data-testid": "content-answers-icon-color",
|
|
109
109
|
height: w,
|
|
110
110
|
width: w
|
|
111
|
-
}), /* @__PURE__ */ e(
|
|
112
|
-
isAIStudioAgentSelectorEnabled:
|
|
113
|
-
}),
|
|
111
|
+
}), /* @__PURE__ */ e(ge, {
|
|
112
|
+
isAIStudioAgentSelectorEnabled: g
|
|
113
|
+
}), g && /* @__PURE__ */ e(oe, {
|
|
114
114
|
contentClassName: s.agentSelectorContent,
|
|
115
115
|
disabled: a.hasRequestInProgress,
|
|
116
116
|
fetcher: J,
|
|
@@ -120,14 +120,15 @@ const ge = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
|
|
|
120
120
|
recordAction: r,
|
|
121
121
|
requestState: U ? ie.ERROR : void 0,
|
|
122
122
|
shouldHideAgentSelectorOnLoad: !0,
|
|
123
|
-
triggerChipClassName: s.agentSelectorTrigger
|
|
123
|
+
triggerChipClassName: s.agentSelectorTrigger,
|
|
124
|
+
useAgentLocalStorage: !0
|
|
124
125
|
})]
|
|
125
126
|
})
|
|
126
127
|
}), /* @__PURE__ */ e(re, {
|
|
127
128
|
className: s.boxAiContentAnswers,
|
|
128
129
|
hasCustomSuggestedQuestions: x,
|
|
129
130
|
hostAppName: m,
|
|
130
|
-
isAIStudioAgentSelectorEnabled:
|
|
131
|
+
isAIStudioAgentSelectorEnabled: g,
|
|
131
132
|
isDebugModeEnabled: B,
|
|
132
133
|
isStopResponseEnabled: _,
|
|
133
134
|
items: i,
|
|
@@ -135,15 +136,15 @@ const ge = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
|
|
|
135
136
|
recordAction: n,
|
|
136
137
|
shouldShowLandingPage: G,
|
|
137
138
|
...a
|
|
138
|
-
}),
|
|
139
|
+
}), f && /* @__PURE__ */ e(ce, {
|
|
139
140
|
hasRequestInProgress: a.hasRequestInProgress,
|
|
140
141
|
onClick: K
|
|
141
142
|
}), /* @__PURE__ */ e(Y, {
|
|
142
143
|
children: /* @__PURE__ */ e(Z, {
|
|
143
|
-
content:
|
|
144
|
+
content: b.formatMessage(O),
|
|
144
145
|
"data-testid": "content-answers-close-modal-tooltip",
|
|
145
146
|
children: /* @__PURE__ */ e(c.Close, {
|
|
146
|
-
"aria-label":
|
|
147
|
+
"aria-label": b.formatMessage(O),
|
|
147
148
|
className: s["modal-close-button"],
|
|
148
149
|
"data-target-id": W,
|
|
149
150
|
icon: y,
|
|
@@ -14,12 +14,12 @@ import { IntelligenceModal as le } from "../modal/modal.js";
|
|
|
14
14
|
import { IntelligenceSidebarContext as be } from "./context.js";
|
|
15
15
|
import C from "./messages.js";
|
|
16
16
|
import Se from "./title.js";
|
|
17
|
-
import { jsxs as
|
|
18
|
-
import '../../../../styles/content.css';const ue = "_bcsSidebarBase_gfv6u_2",
|
|
17
|
+
import { jsxs as A, Fragment as $, jsx as e } from "react/jsx-runtime";
|
|
18
|
+
import '../../../../styles/content.css';const ue = "_bcsSidebarBase_gfv6u_2", Ae = "_bcsContent_gfv6u_2", ge = "_bcsBoxAISidebar_gfv6u_2", pe = "_bcsContentHeader_gfv6u_6", he = "_bcsTitle_gfv6u_15", me = "_bcsScrollContent_gfv6u_22", fe = "_withModalOpen_gfv6u_32", _e = "_bcsBoxAISidebarAgentSelector_gfv6u_35", Ie = "_bcsBoxAISidebarAgentSelectorContainer_gfv6u_39", xe = "_bcsBoxAISidebarChatActions_gfv6u_43", Ce = "_bcsBoxAISidebarContent_gfv6u_47", Be = "_bcsBoxAISidebarExpand_gfv6u_50", ve = "_bcsBoxAISidebarTitlePart_gfv6u_53", we = "_sidebarChip_gfv6u_77", Te = "_bcsContentSubheader_gfv6u_90", Ee = "_bcsScrollContentWrapper_gfv6u_99", Ne = "_withSubheader_gfv6u_104", Pe = "_expanded_gfv6u_107", t = {
|
|
19
19
|
bcsSidebarBase: ue,
|
|
20
|
-
bcsContent:
|
|
21
|
-
bcsBoxAISidebar:
|
|
22
|
-
bcsContentHeader:
|
|
20
|
+
bcsContent: Ae,
|
|
21
|
+
bcsBoxAISidebar: ge,
|
|
22
|
+
bcsContentHeader: pe,
|
|
23
23
|
bcsTitle: he,
|
|
24
24
|
bcsScrollContent: me,
|
|
25
25
|
withModalOpen: fe,
|
|
@@ -34,27 +34,27 @@ import '../../../../styles/content.css';const ue = "_bcsSidebarBase_gfv6u_2", pe
|
|
|
34
34
|
bcsScrollContentWrapper: Ee,
|
|
35
35
|
withSubheader: Ne,
|
|
36
36
|
expanded: Pe
|
|
37
|
-
},
|
|
38
|
-
ce(
|
|
39
|
-
const
|
|
37
|
+
}, Le = `${ie}_${re}`;
|
|
38
|
+
ce(Le);
|
|
39
|
+
const Me = ({
|
|
40
40
|
actions: B,
|
|
41
41
|
children: i,
|
|
42
42
|
className: n,
|
|
43
43
|
elementId: l = "",
|
|
44
|
-
sidebarView:
|
|
44
|
+
sidebarView: g = "",
|
|
45
45
|
title: r,
|
|
46
46
|
subheader: c,
|
|
47
47
|
...d
|
|
48
48
|
}) => {
|
|
49
|
-
const b = `${l}${l === "" ? "" : "_"}${
|
|
50
|
-
return /* @__PURE__ */
|
|
49
|
+
const b = `${l}${l === "" ? "" : "_"}${g}`, p = `${b}-content`;
|
|
50
|
+
return /* @__PURE__ */ A("div", {
|
|
51
51
|
"aria-labelledby": b,
|
|
52
52
|
className: y(t.bcsContent, n),
|
|
53
53
|
"data-testid": "bcs-content",
|
|
54
|
-
id:
|
|
54
|
+
id: p,
|
|
55
55
|
role: "tabpanel",
|
|
56
56
|
...d,
|
|
57
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ A("div", {
|
|
58
58
|
className: t.bcsContentHeader,
|
|
59
59
|
children: [r && /* @__PURE__ */ e(K, {
|
|
60
60
|
as: "h3",
|
|
@@ -78,12 +78,12 @@ function Oe(B) {
|
|
|
78
78
|
createSession: i,
|
|
79
79
|
encodedSession: n,
|
|
80
80
|
onClearAction: l,
|
|
81
|
-
getAIStudioAgents:
|
|
81
|
+
getAIStudioAgents: g,
|
|
82
82
|
hasRequestInProgress: r,
|
|
83
83
|
hostAppName: c,
|
|
84
84
|
isAIStudioAgentSelectorEnabled: d,
|
|
85
85
|
isLoading: b,
|
|
86
|
-
onSelectAgent:
|
|
86
|
+
onSelectAgent: p,
|
|
87
87
|
questions: h,
|
|
88
88
|
shouldShowLandingPage: N = !0,
|
|
89
89
|
sendQuestion: m,
|
|
@@ -91,7 +91,7 @@ function Oe(B) {
|
|
|
91
91
|
...P
|
|
92
92
|
} = B, {
|
|
93
93
|
formatMessage: f
|
|
94
|
-
} = oe(),
|
|
94
|
+
} = oe(), L = u.useRef(!1), [w, M] = u.useState(!1), {
|
|
95
95
|
cache: s,
|
|
96
96
|
contentName: O,
|
|
97
97
|
elementId: H,
|
|
@@ -122,9 +122,9 @@ function Oe(B) {
|
|
|
122
122
|
const x = (o = !1) => {
|
|
123
123
|
!I && !n && !b && i && i(!0, !1), o && W && W();
|
|
124
124
|
}, J = () => {
|
|
125
|
-
|
|
125
|
+
M(!1);
|
|
126
126
|
}, Y = () => {
|
|
127
|
-
x(),
|
|
127
|
+
x(), M(!0);
|
|
128
128
|
};
|
|
129
129
|
u.useEffect(() => (I && !n && i && i(!0, !0), n && a.length > 0 && a[a.length - 1].isCompleted === !1 && m({
|
|
130
130
|
prompt: a[a.length - 1].prompt
|
|
@@ -143,9 +143,9 @@ function Oe(B) {
|
|
|
143
143
|
v();
|
|
144
144
|
}), []), u.useEffect(() => {
|
|
145
145
|
const o = a[a.length - 1];
|
|
146
|
-
!I && !
|
|
146
|
+
!I && !L.current && n && (o != null && o.isLoading) && (m(o, E, !1), L.current = !0);
|
|
147
147
|
}, [n]);
|
|
148
|
-
const G = () => /* @__PURE__ */
|
|
148
|
+
const G = () => /* @__PURE__ */ A("div", {
|
|
149
149
|
className: t.bcsBoxAISidebarTitlePart,
|
|
150
150
|
children: [/* @__PURE__ */ e(Se, {
|
|
151
151
|
isAIStudioAgentSelectorEnabled: d
|
|
@@ -153,20 +153,21 @@ function Oe(B) {
|
|
|
153
153
|
className: t.bcsBoxAISidebarAgentSelector,
|
|
154
154
|
children: /* @__PURE__ */ e(ne, {
|
|
155
155
|
disabled: r,
|
|
156
|
-
fetcher:
|
|
156
|
+
fetcher: g,
|
|
157
157
|
hostAppName: c,
|
|
158
158
|
onAgentsListOpen: x,
|
|
159
|
-
onSelectAgent:
|
|
159
|
+
onSelectAgent: p,
|
|
160
160
|
onSelectedAgentCallback: D,
|
|
161
161
|
recordAction: S,
|
|
162
162
|
shouldHideAgentSelectorOnLoad: !0,
|
|
163
|
+
useAgentLocalStorage: !0,
|
|
163
164
|
variant: "sidebar"
|
|
164
165
|
})
|
|
165
166
|
})]
|
|
166
167
|
});
|
|
167
|
-
return /* @__PURE__ */
|
|
168
|
-
children: [/* @__PURE__ */ e(
|
|
169
|
-
actions: /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ A($, {
|
|
169
|
+
children: [/* @__PURE__ */ e(Me, {
|
|
170
|
+
actions: /* @__PURE__ */ A($, {
|
|
170
171
|
children: [G(), /* @__PURE__ */ e(de, {
|
|
171
172
|
hasRequestInProgress: r,
|
|
172
173
|
onClick: l
|
|
@@ -217,7 +218,7 @@ function Oe(B) {
|
|
|
217
218
|
contentName: O,
|
|
218
219
|
contentType: f(C.sidebarBoxAIContent),
|
|
219
220
|
extension: V,
|
|
220
|
-
getAIStudioAgents:
|
|
221
|
+
getAIStudioAgents: g,
|
|
221
222
|
hasRequestInProgress: r,
|
|
222
223
|
hostAppName: c,
|
|
223
224
|
isAIStudioAgentSelectorEnabled: d,
|
|
@@ -229,7 +230,7 @@ function Oe(B) {
|
|
|
229
230
|
onClearAction: l,
|
|
230
231
|
onFeedbackFormSubmit: U,
|
|
231
232
|
onOpenChange: J,
|
|
232
|
-
onSelectAgent:
|
|
233
|
+
onSelectAgent: p,
|
|
233
234
|
onUserIntentToUseAI: x,
|
|
234
235
|
open: w,
|
|
235
236
|
questions: h,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.148.
|
|
3
|
+
"version": "0.148.12",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.56.1",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
20
|
-
"@box/blueprint-web": "^12.68.
|
|
20
|
+
"@box/blueprint-web": "^12.68.2",
|
|
21
21
|
"@box/blueprint-web-assets": "^4.66.0",
|
|
22
|
-
"@box/box-ai-agent-selector": "^0.58.
|
|
23
|
-
"@box/item-icon": "^0.23.
|
|
22
|
+
"@box/box-ai-agent-selector": "^0.58.12",
|
|
23
|
+
"@box/item-icon": "^0.23.11",
|
|
24
24
|
"@box/storybook-utils": "^0.14.2",
|
|
25
25
|
"@testing-library/react": "^15.0.6",
|
|
26
26
|
"react": "^18.3.0",
|