@box/box-ai-content-answers 0.129.5 → 0.129.7
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.
|
@@ -1,96 +1,99 @@
|
|
|
1
|
-
import { AgentsProvider as
|
|
2
|
-
import * as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { SPREADSHEET_FILE_EXTENSIONS as
|
|
5
|
-
import
|
|
6
|
-
import { IntelligenceSidebarContext as
|
|
7
|
-
import
|
|
8
|
-
import { jsx as
|
|
9
|
-
const
|
|
10
|
-
var
|
|
1
|
+
import { AgentsProvider as z } from "@box/box-ai-agent-selector";
|
|
2
|
+
import * as F from "react";
|
|
3
|
+
import { useIntl as U } from "react-intl";
|
|
4
|
+
import { SPREADSHEET_FILE_EXTENSIONS as V, INTELLIGENT_QUERY_COMPATIBLE_SPREADSHEET_EXTENSIONS as X } from "../common/constants.js";
|
|
5
|
+
import j from "./content.js";
|
|
6
|
+
import { IntelligenceSidebarContext as B } from "./context.js";
|
|
7
|
+
import g from "./messages.js";
|
|
8
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
9
|
+
const ee = (L) => {
|
|
10
|
+
var C;
|
|
11
11
|
const {
|
|
12
12
|
cache: e,
|
|
13
|
-
contentName:
|
|
14
|
-
elementId:
|
|
13
|
+
contentName: S,
|
|
14
|
+
elementId: f,
|
|
15
15
|
fileExtension: t,
|
|
16
|
-
fileID:
|
|
17
|
-
getSuggestedQuestions:
|
|
18
|
-
isIntelligentQueryMode:
|
|
19
|
-
isFeedbackEnabled:
|
|
20
|
-
isFeedbackFormEnabled:
|
|
16
|
+
fileID: M,
|
|
17
|
+
getSuggestedQuestions: h,
|
|
18
|
+
isIntelligentQueryMode: T,
|
|
19
|
+
isFeedbackEnabled: E,
|
|
20
|
+
isFeedbackFormEnabled: Q,
|
|
21
21
|
isStopResponseEnabled: o = !1,
|
|
22
22
|
items: n,
|
|
23
23
|
itemSize: p,
|
|
24
|
-
localizedQuestions:
|
|
24
|
+
localizedQuestions: _,
|
|
25
25
|
onFeedbackFormSubmit: I,
|
|
26
|
-
onUserInteraction:
|
|
27
|
-
onSelectedAgentCallback:
|
|
28
|
-
recordAction:
|
|
26
|
+
onUserInteraction: b,
|
|
27
|
+
onSelectedAgentCallback: N,
|
|
28
|
+
recordAction: P,
|
|
29
29
|
setCacheValue: i,
|
|
30
30
|
shouldPreinitSession: r = !0,
|
|
31
31
|
setHasQuestions: l,
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
34
|
-
questions: s
|
|
32
|
+
...k
|
|
33
|
+
} = L, {
|
|
34
|
+
questions: s,
|
|
35
|
+
agents: v
|
|
35
36
|
} = e, {
|
|
36
|
-
|
|
37
|
-
} =
|
|
37
|
+
selectedAgent: a
|
|
38
|
+
} = v, {
|
|
39
|
+
formatMessage: u
|
|
40
|
+
} = U(), x = F.useMemo(() => ({
|
|
38
41
|
cache: e,
|
|
39
|
-
contentName:
|
|
40
|
-
elementId:
|
|
42
|
+
contentName: S,
|
|
43
|
+
elementId: f,
|
|
41
44
|
fileExtension: t,
|
|
42
|
-
isFeedbackEnabled:
|
|
43
|
-
isFeedbackFormEnabled:
|
|
45
|
+
isFeedbackEnabled: E,
|
|
46
|
+
isFeedbackFormEnabled: Q,
|
|
44
47
|
isStopResponseEnabled: o,
|
|
45
48
|
items: n,
|
|
46
49
|
itemSize: p,
|
|
47
50
|
onFeedbackFormSubmit: I,
|
|
48
|
-
onUserInteraction:
|
|
49
|
-
onSelectedAgentCallback:
|
|
50
|
-
recordAction:
|
|
51
|
+
onUserInteraction: b,
|
|
52
|
+
onSelectedAgentCallback: N,
|
|
53
|
+
recordAction: P,
|
|
51
54
|
setCacheValue: i,
|
|
52
55
|
shouldPreinitSession: r
|
|
53
|
-
}), [e,
|
|
54
|
-
|
|
55
|
-
l && l(
|
|
56
|
-
}, [
|
|
56
|
+
}), [e, S, f, t, E, Q, o, n, p, I, b, N, P, i, r]), w = s.length > 0;
|
|
57
|
+
F.useEffect(() => {
|
|
58
|
+
l && l(w);
|
|
59
|
+
}, [w, l]);
|
|
57
60
|
let c = s;
|
|
58
61
|
s.length > 0 && !s[s.length - 1].isCompleted && (c = c.slice(0, -1));
|
|
59
|
-
const
|
|
62
|
+
const H = V.includes(t), R = X.includes(t);
|
|
60
63
|
let d = "";
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
i("suggestedQuestions",
|
|
64
|
-
},
|
|
64
|
+
T && R ? d = u(g.welcomeMessageIntelligentQueryNotice) : H && (d = u(g.welcomeMessageSpreadsheetNotice));
|
|
65
|
+
const A = (a == null ? void 0 : a.suggestedQuestions) !== null, y = (q) => {
|
|
66
|
+
i("suggestedQuestions", q);
|
|
67
|
+
}, D = typeof h == "function" ? [] : _, O = ((C = e.suggestedQuestions) == null ? void 0 : C.length) > 0 && !A ? e.suggestedQuestions : D;
|
|
65
68
|
return (
|
|
66
69
|
// IntelligenceSidebarContent is using withApiWrapper that is not passing all provided props,
|
|
67
70
|
// that's why we need to use provider to pass other props
|
|
68
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ m(z, {
|
|
69
72
|
value: e.agents,
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
value:
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
-
cachedSuggestedQuestions: e.suggestedQuestions,
|
|
74
|
-
getSuggestedQuestions:
|
|
73
|
+
children: /* @__PURE__ */ m(B.Provider, {
|
|
74
|
+
value: x,
|
|
75
|
+
children: /* @__PURE__ */ m(j, {
|
|
76
|
+
cachedSuggestedQuestions: A ? [] : e.suggestedQuestions,
|
|
77
|
+
getSuggestedQuestions: h,
|
|
75
78
|
isOpen: !0,
|
|
76
79
|
isStopResponseEnabled: o,
|
|
77
|
-
itemID:
|
|
80
|
+
itemID: M,
|
|
78
81
|
items: n,
|
|
79
|
-
onSuggestedQuestionsFetched:
|
|
82
|
+
onSuggestedQuestionsFetched: y,
|
|
80
83
|
restoredQuestions: c,
|
|
81
84
|
restoredSession: e.encodedSession,
|
|
82
85
|
restoredShouldShowLandingPage: e.shouldShowLandingPage,
|
|
83
86
|
shouldPreinitSession: r,
|
|
84
|
-
suggestedQuestions:
|
|
87
|
+
suggestedQuestions: O,
|
|
85
88
|
warningNotice: d,
|
|
86
|
-
warningNoticeAriaLabel:
|
|
87
|
-
...
|
|
89
|
+
warningNoticeAriaLabel: u(g.welcomeMessageSpreadsheetNoticeAriaLabel),
|
|
90
|
+
...k
|
|
88
91
|
})
|
|
89
92
|
})
|
|
90
93
|
})
|
|
91
94
|
);
|
|
92
95
|
};
|
|
93
96
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
ee as IntelligenceSidebar,
|
|
98
|
+
ee as default
|
|
96
99
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.129.
|
|
3
|
+
"version": "0.129.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.35.0",
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
|
20
|
-
"@box/blueprint-web": "^12.
|
|
20
|
+
"@box/blueprint-web": "^12.12.0",
|
|
21
21
|
"@box/blueprint-web-assets": "^4.53.0",
|
|
22
|
-
"@box/box-ai-agent-selector": "^0.43.
|
|
23
|
-
"@box/item-icon": "^0.9.
|
|
22
|
+
"@box/box-ai-agent-selector": "^0.43.7",
|
|
23
|
+
"@box/item-icon": "^0.9.162",
|
|
24
24
|
"@box/storybook-utils": "^0.13.6",
|
|
25
25
|
"@testing-library/react": "^15.0.6",
|
|
26
26
|
"react": "^18.3.0",
|