@box/box-ai-content-answers 1.3.0 → 1.5.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 +24 -22
- package/dist/esm/lib/components/modal/clear-conversation-button.js +4 -3
- package/dist/esm/lib/components/sidebar/content.js +168 -152
- package/dist/esm/lib/components/sidebar/messages.js +4 -0
- package/dist/esm/lib/components/sidebar/sidebar.js +26 -24
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/bn-IN.properties +2 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/da-DK.properties +2 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/de-DE.properties +2 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-AU.properties +2 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-CA.properties +2 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-GB.properties +2 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +89 -88
- package/dist/i18n/en-x-pseudo.properties +90 -88
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-419.properties +2 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/es-ES.properties +2 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fi-FI.properties +2 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-CA.properties +2 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/fr-FR.properties +2 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/hi-IN.properties +2 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/it-IT.properties +2 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/ja-JP.properties +2 -0
- package/dist/i18n/json/src/lib/components/sidebar/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/ko-KR.properties +2 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nb-NO.properties +2 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/nl-NL.properties +2 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pl-PL.properties +2 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/pt-BR.properties +2 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/ru-RU.properties +2 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/sv-SE.properties +2 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/tr-TR.properties +2 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-CN.properties +2 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/i18n/zh-TW.properties +2 -0
- package/dist/styles/content.css +1 -1
- package/dist/types/lib/components/modal/clear-conversation-button.d.ts +2 -1
- package/dist/types/lib/components/sidebar/content.d.ts +1 -0
- package/dist/types/lib/components/sidebar/messages.d.ts +5 -0
- package/dist/types/lib/components/sidebar/sidebar.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import { Tooltip as
|
|
2
|
-
import { Trash as
|
|
3
|
-
import
|
|
1
|
+
import { Tooltip as l, IconButton as s } from "@box/blueprint-web";
|
|
2
|
+
import { Trash as c } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import i from "clsx";
|
|
4
|
+
import { useIntl as d } from "react-intl";
|
|
4
5
|
import t from "../esm/lib/components/modal/messages.js";
|
|
5
6
|
import { jsx as e } from "react/jsx-runtime";
|
|
6
|
-
import '../styles/clear-conversation-button.css';const
|
|
7
|
-
BoxAIIconColor:
|
|
8
|
-
modalHeader:
|
|
9
|
-
contentAnswersModal:
|
|
10
|
-
boxAiContentAnswers:
|
|
11
|
-
clearButton:
|
|
7
|
+
import '../styles/clear-conversation-button.css';const _ = "_BoxAIIconColor_ild3b_1", m = "_modalHeader_ild3b_5", b = "_contentAnswersModal_ild3b_10", C = "_boxAiContentAnswers_ild3b_18", g = "_clearButton_ild3b_26", A = "_contentAnswerModal_ild3b_1", u = "_modalHeaderContainer_ild3b_55", B = "_agentSelectorTrigger_ild3b_63", p = "_agentSelectorContent_ild3b_74", w = {
|
|
8
|
+
BoxAIIconColor: _,
|
|
9
|
+
modalHeader: m,
|
|
10
|
+
contentAnswersModal: b,
|
|
11
|
+
boxAiContentAnswers: C,
|
|
12
|
+
clearButton: g,
|
|
12
13
|
"modal-close-button": "_modal-close-button_ild3b_30",
|
|
13
|
-
contentAnswerModal:
|
|
14
|
-
modalHeaderContainer:
|
|
15
|
-
agentSelectorTrigger:
|
|
16
|
-
agentSelectorContent:
|
|
17
|
-
},
|
|
14
|
+
contentAnswerModal: A,
|
|
15
|
+
modalHeaderContainer: u,
|
|
16
|
+
agentSelectorTrigger: B,
|
|
17
|
+
agentSelectorContent: p
|
|
18
|
+
}, S = ({
|
|
18
19
|
onClick: n,
|
|
19
|
-
hasRequestInProgress: a
|
|
20
|
+
hasRequestInProgress: a,
|
|
21
|
+
className: r
|
|
20
22
|
}) => {
|
|
21
|
-
const o =
|
|
22
|
-
return /* @__PURE__ */ e(
|
|
23
|
+
const o = d();
|
|
24
|
+
return /* @__PURE__ */ e(l, {
|
|
23
25
|
content: o.formatMessage(t.clearConversationLabel),
|
|
24
26
|
"data-testid": "clear-conversation-tooltip",
|
|
25
27
|
variant: "standard",
|
|
26
|
-
children: /* @__PURE__ */ e(
|
|
28
|
+
children: /* @__PURE__ */ e(s, {
|
|
27
29
|
"aria-label": o.formatMessage(t.clearConversationLabel),
|
|
28
|
-
className:
|
|
30
|
+
className: i(w.clearButton, r),
|
|
29
31
|
"data-testid": "clear-conversation-button",
|
|
30
32
|
disabled: a,
|
|
31
|
-
icon:
|
|
33
|
+
icon: c,
|
|
32
34
|
onClick: n,
|
|
33
35
|
size: "small",
|
|
34
36
|
"data-target-id": "IconButton-clearConversationLabel"
|
|
@@ -36,6 +38,6 @@ import '../styles/clear-conversation-button.css';const i = "_BoxAIIconColor_ild3
|
|
|
36
38
|
});
|
|
37
39
|
};
|
|
38
40
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
S as C,
|
|
42
|
+
w as s
|
|
41
43
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "@box/blueprint-web";
|
|
2
2
|
import "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import "clsx";
|
|
3
4
|
import "react-intl";
|
|
4
5
|
import "./messages.js";
|
|
5
|
-
import { C as
|
|
6
|
+
import { C, C as n } from "../../../../chunks/clear-conversation-button.js";
|
|
6
7
|
import "react/jsx-runtime";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
C as ClearConversationButton,
|
|
10
|
+
n as default
|
|
10
11
|
};
|
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { ArrowsExpand as
|
|
3
|
-
import { useAgents as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import { useIntl as
|
|
8
|
-
import { BoxAiContentAnswers as
|
|
9
|
-
import { withApiWrapper as
|
|
10
|
-
import { ORIGIN_BOXAI_SIDEBAR as
|
|
11
|
-
import { mark as
|
|
12
|
-
import { C as
|
|
13
|
-
import { IntelligenceModal as
|
|
14
|
-
import { IntelligenceSidebarContext as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { jsxs as
|
|
18
|
-
import '../../../../styles/content.css';const
|
|
19
|
-
bcsSidebarBase:
|
|
20
|
-
bcsContent:
|
|
21
|
-
bcsBoxAISidebar:
|
|
22
|
-
bcsContentHeader:
|
|
23
|
-
bcsTitle:
|
|
24
|
-
bcsScrollContent:
|
|
25
|
-
withModalOpen:
|
|
26
|
-
bcsBoxAISidebarAgentSelector:
|
|
27
|
-
bcsBoxAISidebarAgentSelectorContainer:
|
|
28
|
-
bcsBoxAISidebarChatActions:
|
|
29
|
-
bcsBoxAISidebarContent:
|
|
30
|
-
bcsBoxAISidebarExpand:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
import { Text as te, Tooltip as $, IconButton as y } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowsExpand as oe, XMark as ne } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { useAgents as se, BoxAiAgentSelectorWithApi as ae } from "@box/box-ai-agent-selector";
|
|
4
|
+
import Q from "clsx";
|
|
5
|
+
import H from "lodash/isEqual";
|
|
6
|
+
import * as h from "react";
|
|
7
|
+
import { useIntl as ie } from "react-intl";
|
|
8
|
+
import { BoxAiContentAnswers as re } from "../../box-ai-content-answers.js";
|
|
9
|
+
import { withApiWrapper as ce } from "../api-wrapper/api-wrapper.js";
|
|
10
|
+
import { ORIGIN_BOXAI_SIDEBAR as de, EVENT_JS_READY as le } from "../common/constants.js";
|
|
11
|
+
import { mark as be } from "../common/performance.js";
|
|
12
|
+
import { C as Se } from "../../../../chunks/clear-conversation-button.js";
|
|
13
|
+
import { IntelligenceModal as pe } from "../modal/modal.js";
|
|
14
|
+
import { IntelligenceSidebarContext as Ae } from "./context.js";
|
|
15
|
+
import b from "./messages.js";
|
|
16
|
+
import he from "./title.js";
|
|
17
|
+
import { jsxs as m, Fragment as V, jsx as e } from "react/jsx-runtime";
|
|
18
|
+
import '../../../../styles/content.css';const me = "_bcsSidebarBase_1kkpe_2", Ie = "_bcsContent_1kkpe_2", _e = "_bcsBoxAISidebar_1kkpe_2", ue = "_bcsContentHeader_1kkpe_6", Ce = "_bcsTitle_1kkpe_15", xe = "_bcsScrollContent_1kkpe_22", ge = "_withModalOpen_1kkpe_32", Be = "_bcsBoxAISidebarAgentSelector_1kkpe_35", fe = "_bcsBoxAISidebarAgentSelectorContainer_1kkpe_39", ke = "_bcsBoxAISidebarChatActions_1kkpe_43", we = "_bcsBoxAISidebarContent_1kkpe_47", Te = "_bcsBoxAISidebarExpand_1kkpe_50", Ee = "_bcsBoxAISidebarClear_1kkpe_53", Ne = "_bcsBoxAISidebarTitlePart_1kkpe_56", ve = "_bcsBoxAISidebarClose_1kkpe_77", Me = "_sidebarChip_1kkpe_88", Pe = "_bcsContentSubheader_1kkpe_101", Le = "_bcsScrollContentWrapper_1kkpe_110", Oe = "_withSubheader_1kkpe_115", Re = "_expanded_1kkpe_118", t = {
|
|
19
|
+
bcsSidebarBase: me,
|
|
20
|
+
bcsContent: Ie,
|
|
21
|
+
bcsBoxAISidebar: _e,
|
|
22
|
+
bcsContentHeader: ue,
|
|
23
|
+
bcsTitle: Ce,
|
|
24
|
+
bcsScrollContent: xe,
|
|
25
|
+
withModalOpen: ge,
|
|
26
|
+
bcsBoxAISidebarAgentSelector: Be,
|
|
27
|
+
bcsBoxAISidebarAgentSelectorContainer: fe,
|
|
28
|
+
bcsBoxAISidebarChatActions: ke,
|
|
29
|
+
bcsBoxAISidebarContent: we,
|
|
30
|
+
bcsBoxAISidebarExpand: Te,
|
|
31
|
+
bcsBoxAISidebarClear: Ee,
|
|
32
|
+
bcsBoxAISidebarTitlePart: Ne,
|
|
33
|
+
bcsBoxAISidebarClose: ve,
|
|
34
|
+
sidebarChip: Me,
|
|
35
|
+
bcsContentSubheader: Pe,
|
|
36
|
+
bcsScrollContentWrapper: Le,
|
|
37
|
+
withSubheader: Oe,
|
|
38
|
+
expanded: Re
|
|
39
|
+
}, qe = `${de}_${le}`;
|
|
40
|
+
be(qe);
|
|
41
|
+
const Ue = ({
|
|
42
|
+
actions: f,
|
|
41
43
|
children: i,
|
|
42
|
-
className:
|
|
43
|
-
elementId:
|
|
44
|
-
sidebarView:
|
|
44
|
+
className: o,
|
|
45
|
+
elementId: S = "",
|
|
46
|
+
sidebarView: I = "",
|
|
45
47
|
title: r,
|
|
46
48
|
subheader: c,
|
|
47
49
|
...d
|
|
48
50
|
}) => {
|
|
49
|
-
const
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
"aria-labelledby":
|
|
52
|
-
className:
|
|
51
|
+
const p = `${S}${S === "" ? "" : "_"}${I}`, _ = `${p}-content`;
|
|
52
|
+
return /* @__PURE__ */ m("div", {
|
|
53
|
+
"aria-labelledby": p,
|
|
54
|
+
className: Q(t.bcsContent, o),
|
|
53
55
|
"data-testid": "bcs-content",
|
|
54
|
-
id:
|
|
56
|
+
id: _,
|
|
55
57
|
role: "tabpanel",
|
|
56
58
|
...d,
|
|
57
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ m("div", {
|
|
58
60
|
className: t.bcsContentHeader,
|
|
59
|
-
children: [r && /* @__PURE__ */ e(
|
|
61
|
+
children: [r && /* @__PURE__ */ e(te, {
|
|
60
62
|
as: "h3",
|
|
61
63
|
className: t.bcsTitle,
|
|
62
64
|
children: r
|
|
63
|
-
}),
|
|
65
|
+
}), f]
|
|
64
66
|
}), c && /* @__PURE__ */ e("div", {
|
|
65
67
|
className: t.bcsContentSubheader,
|
|
66
68
|
children: c
|
|
@@ -73,182 +75,196 @@ const Oe = ({
|
|
|
73
75
|
})]
|
|
74
76
|
});
|
|
75
77
|
};
|
|
76
|
-
function
|
|
78
|
+
function We(f) {
|
|
77
79
|
const {
|
|
78
80
|
createSession: i,
|
|
79
|
-
encodedSession:
|
|
80
|
-
onClearAction:
|
|
81
|
-
getAIStudioAgents:
|
|
81
|
+
encodedSession: o,
|
|
82
|
+
onClearAction: S,
|
|
83
|
+
getAIStudioAgents: I,
|
|
82
84
|
hasRequestInProgress: r,
|
|
83
85
|
hostAppName: c,
|
|
84
86
|
isAIStudioAgentSelectorEnabled: d,
|
|
85
|
-
isLoading:
|
|
86
|
-
onSelectAgent:
|
|
87
|
-
questions:
|
|
87
|
+
isLoading: p,
|
|
88
|
+
onSelectAgent: _,
|
|
89
|
+
questions: u,
|
|
88
90
|
shouldShowLandingPage: N = !0,
|
|
89
|
-
sendQuestion:
|
|
90
|
-
stopQuestion:
|
|
91
|
-
embedTheAnswerButtonConfig:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
sendQuestion: C,
|
|
92
|
+
stopQuestion: k,
|
|
93
|
+
embedTheAnswerButtonConfig: z,
|
|
94
|
+
onClose: v,
|
|
95
|
+
...M
|
|
96
|
+
} = f, {
|
|
97
|
+
formatMessage: l
|
|
98
|
+
} = ie(), P = h.useRef(!1), [w, L] = h.useState(!1), {
|
|
96
99
|
cache: s,
|
|
97
100
|
contentName: O,
|
|
98
|
-
elementId:
|
|
99
|
-
fileExtension:
|
|
101
|
+
elementId: D,
|
|
102
|
+
fileExtension: j,
|
|
100
103
|
isFeedbackEnabled: R,
|
|
101
|
-
isFeedbackFormEnabled:
|
|
102
|
-
isStopResponseEnabled:
|
|
104
|
+
isFeedbackFormEnabled: q,
|
|
105
|
+
isStopResponseEnabled: U,
|
|
103
106
|
items: T,
|
|
104
|
-
itemSize:
|
|
105
|
-
onFeedbackFormSubmit:
|
|
106
|
-
onUserInteraction:
|
|
107
|
-
onSelectedAgentCallback:
|
|
108
|
-
recordAction:
|
|
109
|
-
setCacheValue:
|
|
110
|
-
shouldPreinitSession:
|
|
111
|
-
} =
|
|
112
|
-
agents:
|
|
113
|
-
requestState:
|
|
107
|
+
itemSize: J,
|
|
108
|
+
onFeedbackFormSubmit: W,
|
|
109
|
+
onUserInteraction: F,
|
|
110
|
+
onSelectedAgentCallback: X,
|
|
111
|
+
recordAction: A,
|
|
112
|
+
setCacheValue: x,
|
|
113
|
+
shouldPreinitSession: g
|
|
114
|
+
} = h.useContext(Ae), {
|
|
115
|
+
agents: Y,
|
|
116
|
+
requestState: G,
|
|
114
117
|
selectedAgent: E
|
|
115
|
-
} =
|
|
118
|
+
} = se(), {
|
|
116
119
|
questions: a
|
|
117
120
|
} = s;
|
|
118
|
-
s.shouldShowLandingPage !== N &&
|
|
119
|
-
agents:
|
|
120
|
-
requestState:
|
|
121
|
+
s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o), H(s.questions, u) || x("questions", u), H(s.agents.selectedAgent, E) || x("agents", {
|
|
122
|
+
agents: Y,
|
|
123
|
+
requestState: G,
|
|
121
124
|
selectedAgent: E
|
|
122
125
|
});
|
|
123
|
-
const
|
|
124
|
-
!
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
126
|
+
const B = (n = !1) => {
|
|
127
|
+
!g && !o && !p && i && i(!0, !1), n && F && F();
|
|
128
|
+
}, K = () => {
|
|
129
|
+
L(!1);
|
|
130
|
+
}, Z = () => {
|
|
131
|
+
B(), L(!0);
|
|
129
132
|
};
|
|
130
|
-
|
|
133
|
+
h.useEffect(() => (g && !o && i && i(!0, !0), o && a.length > 0 && a[a.length - 1].isCompleted === !1 && C({
|
|
131
134
|
prompt: a[a.length - 1].prompt
|
|
132
|
-
}),
|
|
135
|
+
}), A && A({
|
|
133
136
|
action: "programmatic",
|
|
134
137
|
component: "sidebar",
|
|
135
138
|
feature: "answers",
|
|
136
139
|
target: "loaded",
|
|
137
140
|
data: {
|
|
138
|
-
items: T.map((
|
|
139
|
-
status:
|
|
140
|
-
fileType:
|
|
141
|
+
items: T.map((n) => ({
|
|
142
|
+
status: n.status,
|
|
143
|
+
fileType: n.fileType
|
|
141
144
|
}))
|
|
142
145
|
}
|
|
143
146
|
}), () => {
|
|
144
|
-
|
|
145
|
-
}), []),
|
|
146
|
-
const
|
|
147
|
-
!
|
|
148
|
-
}, [
|
|
149
|
-
const
|
|
147
|
+
k();
|
|
148
|
+
}), []), h.useEffect(() => {
|
|
149
|
+
const n = a[a.length - 1];
|
|
150
|
+
!g && !P.current && o && (n != null && n.isLoading) && (C(n, E, !1), P.current = !0);
|
|
151
|
+
}, [o]);
|
|
152
|
+
const ee = () => /* @__PURE__ */ m("div", {
|
|
150
153
|
className: t.bcsBoxAISidebarTitlePart,
|
|
151
|
-
children: [/* @__PURE__ */ e(
|
|
154
|
+
children: [/* @__PURE__ */ e(he, {
|
|
152
155
|
isAIStudioAgentSelectorEnabled: d
|
|
153
156
|
}), d && /* @__PURE__ */ e("div", {
|
|
154
157
|
className: t.bcsBoxAISidebarAgentSelector,
|
|
155
|
-
children: /* @__PURE__ */ e(
|
|
158
|
+
children: /* @__PURE__ */ e(ae, {
|
|
156
159
|
disabled: r,
|
|
157
|
-
fetcher:
|
|
160
|
+
fetcher: I,
|
|
158
161
|
hostAppName: c,
|
|
159
|
-
onAgentsListOpen:
|
|
160
|
-
onSelectAgent:
|
|
161
|
-
onSelectedAgentCallback:
|
|
162
|
-
recordAction:
|
|
162
|
+
onAgentsListOpen: B,
|
|
163
|
+
onSelectAgent: _,
|
|
164
|
+
onSelectedAgentCallback: X,
|
|
165
|
+
recordAction: A,
|
|
163
166
|
shouldHideAgentSelectorOnLoad: !0,
|
|
164
167
|
useAgentLocalStorage: !0,
|
|
165
168
|
variant: "sidebar"
|
|
166
169
|
})
|
|
167
170
|
})]
|
|
168
171
|
});
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
children: [/* @__PURE__ */ e(
|
|
171
|
-
actions: /* @__PURE__ */
|
|
172
|
-
children: [
|
|
172
|
+
return /* @__PURE__ */ m(V, {
|
|
173
|
+
children: [/* @__PURE__ */ e(Ue, {
|
|
174
|
+
actions: /* @__PURE__ */ m(V, {
|
|
175
|
+
children: [ee(), /* @__PURE__ */ e(Se, {
|
|
176
|
+
className: t.bcsBoxAISidebarClear,
|
|
173
177
|
hasRequestInProgress: r,
|
|
174
|
-
onClick:
|
|
175
|
-
}), /* @__PURE__ */ e(
|
|
176
|
-
content:
|
|
178
|
+
onClick: S
|
|
179
|
+
}), /* @__PURE__ */ e($, {
|
|
180
|
+
content: l(b.sidebarBoxAISwitchToModalView),
|
|
177
181
|
"data-testid": "content-answers-open-modal-tooltip",
|
|
178
182
|
variant: "standard",
|
|
179
|
-
children: /* @__PURE__ */ e(
|
|
180
|
-
"aria-label":
|
|
183
|
+
children: /* @__PURE__ */ e(y, {
|
|
184
|
+
"aria-label": l(b.sidebarBoxAISwitchToModalView),
|
|
181
185
|
className: t.bcsBoxAISidebarExpand,
|
|
182
186
|
"data-target-id": "IconButton-expandBoxAISidebar",
|
|
183
|
-
icon:
|
|
184
|
-
onClick:
|
|
187
|
+
icon: oe,
|
|
188
|
+
onClick: Z,
|
|
189
|
+
size: "small"
|
|
190
|
+
})
|
|
191
|
+
}), v && /* @__PURE__ */ e($, {
|
|
192
|
+
content: l(b.sidebarBoxAIClose),
|
|
193
|
+
"data-testid": "content-answers-close-tooltip",
|
|
194
|
+
variant: "standard",
|
|
195
|
+
children: /* @__PURE__ */ e(y, {
|
|
196
|
+
"aria-label": l(b.sidebarBoxAIClose),
|
|
197
|
+
className: t.bcsBoxAISidebarClose,
|
|
198
|
+
"data-target-id": "IconButton-closeBoxAISidebar",
|
|
199
|
+
icon: ne,
|
|
200
|
+
onClick: v,
|
|
185
201
|
size: "small"
|
|
186
202
|
})
|
|
187
203
|
})]
|
|
188
204
|
}),
|
|
189
|
-
className:
|
|
205
|
+
className: Q(t.bcsBoxAISidebar, {
|
|
190
206
|
[t.withModalOpen]: w
|
|
191
207
|
}),
|
|
192
|
-
elementId:
|
|
208
|
+
elementId: D,
|
|
193
209
|
sidebarView: "box-ai",
|
|
194
210
|
children: /* @__PURE__ */ e("div", {
|
|
195
211
|
className: t.bcsBoxAISidebarContent,
|
|
196
|
-
children: /* @__PURE__ */ e(
|
|
212
|
+
children: /* @__PURE__ */ e(re, {
|
|
197
213
|
className: t.bcsBoxAISidebarContentAnswers,
|
|
198
214
|
contentName: O,
|
|
199
|
-
contentType:
|
|
200
|
-
embedTheAnswerButtonConfig:
|
|
215
|
+
contentType: l(b.sidebarBoxAIContent),
|
|
216
|
+
embedTheAnswerButtonConfig: z,
|
|
201
217
|
hostAppName: c,
|
|
202
218
|
isAIStudioAgentSelectorEnabled: d,
|
|
203
219
|
isFeedbackEnabled: R,
|
|
204
|
-
isFeedbackFormEnabled:
|
|
205
|
-
isStopResponseEnabled:
|
|
220
|
+
isFeedbackFormEnabled: q,
|
|
221
|
+
isStopResponseEnabled: U,
|
|
206
222
|
items: T,
|
|
207
|
-
onFeedbackFormSubmit:
|
|
208
|
-
onUserIntentToUseAI:
|
|
209
|
-
questions:
|
|
210
|
-
recordAction:
|
|
223
|
+
onFeedbackFormSubmit: W,
|
|
224
|
+
onUserIntentToUseAI: B,
|
|
225
|
+
questions: u,
|
|
226
|
+
recordAction: A,
|
|
211
227
|
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
212
|
-
showLoadingIndicator:
|
|
213
|
-
stopQuestion:
|
|
214
|
-
submitQuestion:
|
|
228
|
+
showLoadingIndicator: p && g,
|
|
229
|
+
stopQuestion: k,
|
|
230
|
+
submitQuestion: C,
|
|
215
231
|
variant: "sidebar",
|
|
216
|
-
...
|
|
232
|
+
...M
|
|
217
233
|
})
|
|
218
234
|
})
|
|
219
|
-
}), /* @__PURE__ */ e(
|
|
235
|
+
}), /* @__PURE__ */ e(pe, {
|
|
220
236
|
contentName: O,
|
|
221
|
-
contentType:
|
|
222
|
-
extension:
|
|
223
|
-
getAIStudioAgents:
|
|
237
|
+
contentType: l(b.sidebarBoxAIContent),
|
|
238
|
+
extension: j,
|
|
239
|
+
getAIStudioAgents: I,
|
|
224
240
|
hasRequestInProgress: r,
|
|
225
241
|
hostAppName: c,
|
|
226
242
|
isAIStudioAgentSelectorEnabled: d,
|
|
227
243
|
isFeedbackEnabled: R,
|
|
228
|
-
isFeedbackFormEnabled:
|
|
229
|
-
isStopResponseEnabled:
|
|
244
|
+
isFeedbackFormEnabled: q,
|
|
245
|
+
isStopResponseEnabled: U,
|
|
230
246
|
items: T,
|
|
231
|
-
itemSize:
|
|
232
|
-
onClearAction:
|
|
233
|
-
onFeedbackFormSubmit:
|
|
234
|
-
onOpenChange:
|
|
235
|
-
onSelectAgent:
|
|
236
|
-
onUserIntentToUseAI:
|
|
247
|
+
itemSize: J,
|
|
248
|
+
onClearAction: S,
|
|
249
|
+
onFeedbackFormSubmit: W,
|
|
250
|
+
onOpenChange: K,
|
|
251
|
+
onSelectAgent: _,
|
|
252
|
+
onUserIntentToUseAI: B,
|
|
237
253
|
open: w,
|
|
238
|
-
questions:
|
|
239
|
-
recordAction: w ?
|
|
254
|
+
questions: u,
|
|
255
|
+
recordAction: w ? A : void 0,
|
|
240
256
|
shouldShowLandingPage: s.shouldShowLandingPage,
|
|
241
257
|
showLoadingIndicator: !1,
|
|
242
258
|
stopPropagationOnEsc: !0,
|
|
243
|
-
stopQuestion:
|
|
244
|
-
submitQuestion:
|
|
259
|
+
stopQuestion: k,
|
|
260
|
+
submitQuestion: C,
|
|
245
261
|
variant: "collapsible",
|
|
246
|
-
...
|
|
262
|
+
...M,
|
|
247
263
|
shouldRenderProviders: !1
|
|
248
264
|
})]
|
|
249
265
|
});
|
|
250
266
|
}
|
|
251
|
-
const
|
|
267
|
+
const ot = ce(We);
|
|
252
268
|
export {
|
|
253
|
-
|
|
269
|
+
ot as default
|
|
254
270
|
};
|
|
@@ -16,6 +16,10 @@ const t = e({
|
|
|
16
16
|
id: "contentAnswersSidebar.sidebarBoxAISwitchToModalView",
|
|
17
17
|
defaultMessage: "Switch to modal view"
|
|
18
18
|
},
|
|
19
|
+
sidebarBoxAIClose: {
|
|
20
|
+
id: "contentAnswersSidebar.sidebarBoxAIClose",
|
|
21
|
+
defaultMessage: "Close"
|
|
22
|
+
},
|
|
19
23
|
sidebarBoxAIContent: {
|
|
20
24
|
id: "contentAnswersSidebar.sidebarBoxAIContent",
|
|
21
25
|
defaultMessage: "content"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AgentsProvider as
|
|
1
|
+
import { AgentsProvider as V } from "@box/box-ai-agent-selector";
|
|
2
2
|
import * as F from "react";
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { SPREADSHEET_FILE_EXTENSIONS as
|
|
5
|
-
import
|
|
6
|
-
import { IntelligenceSidebarContext as
|
|
3
|
+
import { useIntl as X } from "react-intl";
|
|
4
|
+
import { SPREADSHEET_FILE_EXTENSIONS as j, INTELLIGENT_QUERY_COMPATIBLE_SPREADSHEET_EXTENSIONS as G } from "../common/constants.js";
|
|
5
|
+
import W from "./content.js";
|
|
6
|
+
import { IntelligenceSidebarContext as Y } from "./context.js";
|
|
7
7
|
import g from "./messages.js";
|
|
8
8
|
import { jsx as m } from "react/jsx-runtime";
|
|
9
|
-
const
|
|
9
|
+
const oe = (L) => {
|
|
10
10
|
var P;
|
|
11
11
|
const {
|
|
12
12
|
cache: e,
|
|
@@ -31,15 +31,16 @@ const te = (L) => {
|
|
|
31
31
|
setHasQuestions: l,
|
|
32
32
|
promptButtonClickHandler: H,
|
|
33
33
|
embedTheAnswerButtonConfig: _,
|
|
34
|
-
|
|
34
|
+
onClose: v,
|
|
35
|
+
...x
|
|
35
36
|
} = L, {
|
|
36
37
|
questions: s,
|
|
37
|
-
agents:
|
|
38
|
+
agents: R
|
|
38
39
|
} = e, {
|
|
39
40
|
selectedAgent: a
|
|
40
|
-
} =
|
|
41
|
+
} = R, {
|
|
41
42
|
formatMessage: u
|
|
42
|
-
} =
|
|
43
|
+
} = X(), y = F.useMemo(() => ({
|
|
43
44
|
cache: e,
|
|
44
45
|
contentName: S,
|
|
45
46
|
elementId: f,
|
|
@@ -61,20 +62,20 @@ const te = (L) => {
|
|
|
61
62
|
}, [w, l]);
|
|
62
63
|
let d = s;
|
|
63
64
|
s.length > 0 && !s[s.length - 1].isCompleted && (d = d.slice(0, -1));
|
|
64
|
-
const
|
|
65
|
+
const D = j.includes(t), O = G.includes(t);
|
|
65
66
|
let c = "";
|
|
66
|
-
M &&
|
|
67
|
-
const A = (a == null ? void 0 : a.suggestedQuestions) !== null,
|
|
68
|
-
i("suggestedQuestions",
|
|
69
|
-
},
|
|
67
|
+
M && O ? c = u(g.welcomeMessageIntelligentQueryNotice) : D && (c = u(g.welcomeMessageSpreadsheetNotice));
|
|
68
|
+
const A = (a == null ? void 0 : a.suggestedQuestions) !== null, B = (U) => {
|
|
69
|
+
i("suggestedQuestions", U);
|
|
70
|
+
}, q = typeof h == "function" ? [] : k, z = ((P = e.suggestedQuestions) == null ? void 0 : P.length) > 0 && !A ? e.suggestedQuestions : q;
|
|
70
71
|
return (
|
|
71
72
|
// IntelligenceSidebarContent is using withApiWrapper that is not passing all provided props,
|
|
72
73
|
// that's why we need to use provider to pass other props
|
|
73
|
-
/* @__PURE__ */ m(
|
|
74
|
+
/* @__PURE__ */ m(V, {
|
|
74
75
|
value: e.agents,
|
|
75
|
-
children: /* @__PURE__ */ m(
|
|
76
|
-
value:
|
|
77
|
-
children: /* @__PURE__ */ m(
|
|
76
|
+
children: /* @__PURE__ */ m(Y.Provider, {
|
|
77
|
+
value: y,
|
|
78
|
+
children: /* @__PURE__ */ m(W, {
|
|
78
79
|
cachedSuggestedQuestions: A ? [] : e.suggestedQuestions,
|
|
79
80
|
embedTheAnswerButtonConfig: _,
|
|
80
81
|
getSuggestedQuestions: h,
|
|
@@ -82,22 +83,23 @@ const te = (L) => {
|
|
|
82
83
|
isStopResponseEnabled: o,
|
|
83
84
|
itemID: T,
|
|
84
85
|
items: n,
|
|
85
|
-
|
|
86
|
+
onClose: v,
|
|
87
|
+
onSuggestedQuestionsFetched: B,
|
|
86
88
|
promptButtonClickHandler: H,
|
|
87
89
|
restoredQuestions: d,
|
|
88
90
|
restoredSession: e.encodedSession,
|
|
89
91
|
restoredShouldShowLandingPage: e.shouldShowLandingPage,
|
|
90
92
|
shouldPreinitSession: r,
|
|
91
|
-
suggestedQuestions:
|
|
93
|
+
suggestedQuestions: z,
|
|
92
94
|
warningNotice: c,
|
|
93
95
|
warningNoticeAriaLabel: u(g.welcomeMessageSpreadsheetNoticeAriaLabel),
|
|
94
|
-
...
|
|
96
|
+
...x
|
|
95
97
|
})
|
|
96
98
|
})
|
|
97
99
|
})
|
|
98
100
|
);
|
|
99
101
|
};
|
|
100
102
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
oe as IntelligenceSidebar,
|
|
104
|
+
oe as default
|
|
103
105
|
};
|
package/dist/i18n/bn-IN.js
CHANGED
|
@@ -85,6 +85,7 @@ export default {
|
|
|
85
85
|
"boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "আপনি নিজের স্প্রেডশিটে সরল ও জটিল প্রশ্ন, উভয়ই Box AI-কে জিজ্ঞাসা করতে পারেন: মোট হিসাব, গড়পড়তা, উন্নত তুলনা, ট্রেন্ড বিশ্লেষণ এবং আরও অনেক কিছু। আজই এটি ব্যবহার করে করুন!",
|
|
86
86
|
"boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "বেশি টেক্সট থাকা ফাইলে স্প্রেডশীট সাপোর্ট সবচেয়ে ভালো কাজ করে",
|
|
87
87
|
"boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "স্প্রেডশীট সাপোর্ট বিজ্ঞপ্তি ব্যানার",
|
|
88
|
+
"contentAnswersSidebar.sidebarBoxAIClose": "বন্ধ করুন",
|
|
88
89
|
"contentAnswersSidebar.sidebarBoxAIContent": "বিষয়বস্তু",
|
|
89
90
|
"contentAnswersSidebar.sidebarBoxAISwitchToModalView": "মোডাল ভিউতে সুইচ করুন"
|
|
90
91
|
}
|
|
@@ -170,6 +170,8 @@ boxui.contentAnswers.welcomeMessageIntelligentQueryNotice = আপনি নি
|
|
|
170
170
|
boxui.contentAnswers.welcomeMessageSpreadsheetNotice = বেশি টেক্সট থাকা ফাইলে স্প্রেডশীট সাপোর্ট সবচেয়ে ভালো কাজ করে
|
|
171
171
|
# Aria label for the icon inside spreadsheet notification
|
|
172
172
|
boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel = স্প্রেডশীট সাপোর্ট বিজ্ঞপ্তি ব্যানার
|
|
173
|
+
# Label for button that closes the Box AI Sidebar
|
|
174
|
+
contentAnswersSidebar.sidebarBoxAIClose = বন্ধ করুন
|
|
173
175
|
# Generic Box AI content type opened used in welcome message and placeholder
|
|
174
176
|
contentAnswersSidebar.sidebarBoxAIContent = বিষয়বস্তু
|
|
175
177
|
# Label for button that triggers switch to Box AI Modal
|
package/dist/i18n/da-DK.js
CHANGED
|
@@ -85,6 +85,7 @@ export default {
|
|
|
85
85
|
"boxui.contentAnswers.welcomeMessageIntelligentQueryNotice": "Du kan stille Box AI både enkle og komplekse spørgsmål i dit regneark: totaltællinger, gennemsnit, avancerede sammenligninger, trendanalyser og så videre. Prøv det i dag!",
|
|
86
86
|
"boxui.contentAnswers.welcomeMessageSpreadsheetNotice": "Regnearkssupport virker bedst med de teksttunge filer",
|
|
87
87
|
"boxui.contentAnswers.welcomeMessageSpreadsheetNoticeAriaLabel": "banner til meddelelse om regnearksstøtte",
|
|
88
|
+
"contentAnswersSidebar.sidebarBoxAIClose": "Luk",
|
|
88
89
|
"contentAnswersSidebar.sidebarBoxAIContent": "Indhold",
|
|
89
90
|
"contentAnswersSidebar.sidebarBoxAISwitchToModalView": "Skift til modal visning"
|
|
90
91
|
}
|