@box/box-ai-content-answers 0.85.3 → 0.85.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.
|
@@ -1,125 +1,127 @@
|
|
|
1
|
-
import { useReducer as
|
|
2
|
-
import { R as
|
|
3
|
-
import { useContentAnswers as
|
|
4
|
-
import { ContentAnswersRecord as
|
|
5
|
-
import
|
|
1
|
+
import { useReducer as Z, useEffect as $ } from "react";
|
|
2
|
+
import { R as c } from "../../../../chunks/types.js";
|
|
3
|
+
import { useContentAnswers as ee } from "./hooks/useContentAnswers.js";
|
|
4
|
+
import { ContentAnswersRecord as te, ContentAnswersItemRecord as se } from "./records.js";
|
|
5
|
+
import ne from "./reducer.js";
|
|
6
6
|
import { jsx as oe } from "react/jsx-runtime";
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
item: new
|
|
7
|
+
const me = (s) => {
|
|
8
|
+
const {
|
|
9
|
+
WrappedComponent: m,
|
|
10
|
+
createSessionRequest: S,
|
|
11
|
+
fetchTimeout: l,
|
|
12
|
+
formatCitations: A,
|
|
13
|
+
getAIStudioAgents: f,
|
|
14
|
+
getAgentConfig: C,
|
|
15
|
+
getAnswer: p,
|
|
16
|
+
getAnswerStreaming: E,
|
|
17
|
+
getSuggestedQuestions: e,
|
|
18
|
+
hostAppName: w,
|
|
19
|
+
isAIStudioAgentSelectorEnabled: Q,
|
|
20
|
+
isAgentSelectorEnabled: R,
|
|
21
|
+
isCitationsEnabled: i,
|
|
22
|
+
isDebugModeEnabled: b,
|
|
23
|
+
isMarkdownEnabled: h,
|
|
24
|
+
isOpen: n,
|
|
25
|
+
isResetChatEnabled: q,
|
|
26
|
+
isStopResponseEnabled: I,
|
|
27
|
+
isStreamingEnabled: r,
|
|
28
|
+
itemID: o,
|
|
29
|
+
itemIDs: a,
|
|
30
|
+
items: T,
|
|
31
|
+
onCitationClick: D,
|
|
32
|
+
onCloseModal: N,
|
|
33
|
+
onItemClick: O,
|
|
34
|
+
parentItem: j,
|
|
35
|
+
restoredQuestions: k = [],
|
|
36
|
+
restoredSession: v = null,
|
|
37
|
+
shouldRenderProviders: M = !0,
|
|
38
|
+
suggestedQuestions: U,
|
|
39
|
+
warningNotice: _,
|
|
40
|
+
warningNoticeAriaLabel: x
|
|
41
|
+
} = s, [d, L] = Z(ne, new te({
|
|
42
|
+
item: new se({
|
|
43
43
|
id: o
|
|
44
44
|
}),
|
|
45
|
-
questions:
|
|
46
|
-
encodedSession:
|
|
45
|
+
questions: k,
|
|
46
|
+
encodedSession: v
|
|
47
47
|
})), {
|
|
48
|
-
clearConversation:
|
|
49
|
-
createSession:
|
|
50
|
-
fetchAgentConfig:
|
|
51
|
-
fetchSuggestedQuestions:
|
|
52
|
-
retryQuestion:
|
|
53
|
-
sendQuestion:
|
|
54
|
-
stopQuestion:
|
|
55
|
-
} =
|
|
56
|
-
contentAnswers:
|
|
57
|
-
createSessionRequest:
|
|
58
|
-
dispatchStateUpdate:
|
|
59
|
-
fetchTimeout:
|
|
60
|
-
formatCitations:
|
|
61
|
-
getAgentConfig:
|
|
62
|
-
getAnswerStreaming:
|
|
63
|
-
getAnswer:
|
|
48
|
+
clearConversation: P,
|
|
49
|
+
createSession: y,
|
|
50
|
+
fetchAgentConfig: u,
|
|
51
|
+
fetchSuggestedQuestions: g,
|
|
52
|
+
retryQuestion: W,
|
|
53
|
+
sendQuestion: z,
|
|
54
|
+
stopQuestion: B
|
|
55
|
+
} = ee({
|
|
56
|
+
contentAnswers: d,
|
|
57
|
+
createSessionRequest: S,
|
|
58
|
+
dispatchStateUpdate: L,
|
|
59
|
+
fetchTimeout: l,
|
|
60
|
+
formatCitations: A,
|
|
61
|
+
getAgentConfig: C,
|
|
62
|
+
getAnswerStreaming: E,
|
|
63
|
+
getAnswer: p,
|
|
64
64
|
getSuggestedQuestions: e,
|
|
65
|
-
isCitationsEnabled:
|
|
66
|
-
isStopResponseEnabled:
|
|
65
|
+
isCitationsEnabled: i,
|
|
66
|
+
isStopResponseEnabled: I,
|
|
67
67
|
isStreamingEnabled: r,
|
|
68
68
|
itemID: o,
|
|
69
|
-
itemIDs:
|
|
69
|
+
itemIDs: a,
|
|
70
|
+
...s
|
|
70
71
|
}), {
|
|
71
|
-
encodedSession:
|
|
72
|
-
error:
|
|
73
|
-
isLoading:
|
|
74
|
-
hasRequestInProgress:
|
|
75
|
-
questions:
|
|
72
|
+
encodedSession: F,
|
|
73
|
+
error: G,
|
|
74
|
+
isLoading: H,
|
|
75
|
+
hasRequestInProgress: J = !1,
|
|
76
|
+
questions: K,
|
|
76
77
|
suggestedQuestions: t
|
|
77
|
-
} =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, [
|
|
81
|
-
const
|
|
82
|
-
createSession:
|
|
83
|
-
encodedSession:
|
|
84
|
-
error:
|
|
85
|
-
getAIStudioAgents:
|
|
86
|
-
hostAppName:
|
|
78
|
+
} = d;
|
|
79
|
+
$(() => {
|
|
80
|
+
n && t.requestState === c.NOT_STARTED && g();
|
|
81
|
+
}, [n, g, t.requestState]);
|
|
82
|
+
const V = {
|
|
83
|
+
createSession: y,
|
|
84
|
+
encodedSession: F,
|
|
85
|
+
error: G,
|
|
86
|
+
getAIStudioAgents: f,
|
|
87
|
+
hostAppName: w,
|
|
87
88
|
hasCustomSuggestedQuestions: !!e,
|
|
88
|
-
hasRequestInProgress:
|
|
89
|
-
isAgentSelectorEnabled:
|
|
90
|
-
isAIStudioAgentSelectorEnabled:
|
|
91
|
-
isCitationsEnabled:
|
|
92
|
-
isDebugModeEnabled:
|
|
93
|
-
isMarkdownEnabled:
|
|
94
|
-
isLoading:
|
|
95
|
-
isOpen:
|
|
96
|
-
isResetChatEnabled:
|
|
89
|
+
hasRequestInProgress: J,
|
|
90
|
+
isAgentSelectorEnabled: R,
|
|
91
|
+
isAIStudioAgentSelectorEnabled: Q,
|
|
92
|
+
isCitationsEnabled: i,
|
|
93
|
+
isDebugModeEnabled: b,
|
|
94
|
+
isMarkdownEnabled: h,
|
|
95
|
+
isLoading: H,
|
|
96
|
+
isOpen: n,
|
|
97
|
+
isResetChatEnabled: q,
|
|
97
98
|
isStreamingEnabled: r,
|
|
98
99
|
itemID: o,
|
|
99
|
-
itemIDs:
|
|
100
|
-
items:
|
|
101
|
-
onClearAction:
|
|
102
|
-
onCloseModal:
|
|
103
|
-
onCitationClick:
|
|
104
|
-
onItemClick:
|
|
105
|
-
onSelectAgent:
|
|
106
|
-
onAgentEditorToggle:
|
|
107
|
-
parentItem:
|
|
108
|
-
questions:
|
|
109
|
-
retryQuestion:
|
|
110
|
-
sendQuestion:
|
|
111
|
-
shouldRenderProviders:
|
|
112
|
-
stopQuestion:
|
|
113
|
-
suggestedQuestionsRequestState: e ? t.requestState :
|
|
114
|
-
suggestedQuestions: e ? t.suggestions :
|
|
115
|
-
warningNotice:
|
|
116
|
-
warningNoticeAriaLabel:
|
|
117
|
-
},
|
|
118
|
-
return /* @__PURE__ */ oe(
|
|
119
|
-
...
|
|
100
|
+
itemIDs: a,
|
|
101
|
+
items: T,
|
|
102
|
+
onClearAction: P,
|
|
103
|
+
onCloseModal: N,
|
|
104
|
+
onCitationClick: D,
|
|
105
|
+
onItemClick: O,
|
|
106
|
+
onSelectAgent: u,
|
|
107
|
+
onAgentEditorToggle: u,
|
|
108
|
+
parentItem: j,
|
|
109
|
+
questions: K,
|
|
110
|
+
retryQuestion: W,
|
|
111
|
+
sendQuestion: z,
|
|
112
|
+
shouldRenderProviders: M,
|
|
113
|
+
stopQuestion: B,
|
|
114
|
+
suggestedQuestionsRequestState: e ? t.requestState : c.SUCCESS,
|
|
115
|
+
suggestedQuestions: e ? t.suggestions : U,
|
|
116
|
+
warningNotice: _,
|
|
117
|
+
warningNoticeAriaLabel: x
|
|
118
|
+
}, X = Object.fromEntries(Object.entries(V).filter(([ie, Y]) => Y !== void 0));
|
|
119
|
+
return /* @__PURE__ */ oe(m, {
|
|
120
|
+
...X,
|
|
121
|
+
...s
|
|
120
122
|
});
|
|
121
123
|
};
|
|
122
124
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
me as ContentAnswersComponent,
|
|
126
|
+
me as default
|
|
125
127
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "0.85.
|
|
3
|
+
"version": "0.85.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@box/blueprint-web": "^7.8.0",
|
|
6
6
|
"@box/blueprint-web-assets": "^4.16.0",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"remarkable": "^2.0.1"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@box/blueprint-web": "^9.14.
|
|
18
|
+
"@box/blueprint-web": "^9.14.2",
|
|
19
19
|
"@box/blueprint-web-assets": "^4.31.1",
|
|
20
|
-
"@box/box-ai-agent-selector": "^0.22.
|
|
21
|
-
"@box/item-icon": "^0.9.
|
|
20
|
+
"@box/box-ai-agent-selector": "^0.22.2",
|
|
21
|
+
"@box/item-icon": "^0.9.66",
|
|
22
22
|
"@box/storybook-utils": "^0.8.1",
|
|
23
23
|
"@testing-library/react": "^15.0.6",
|
|
24
24
|
"react": "^18.3.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"**/*.css"
|
|
57
57
|
],
|
|
58
58
|
"license": "SEE LICENSE IN LICENSE",
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "4068413b6e84b82b36e267acc61c9276b3b692fb"
|
|
60
60
|
}
|
|
@@ -2,5 +2,5 @@ import { type ApiWrapperProps } from './types';
|
|
|
2
2
|
export type ContentAnswersComponentProps = ApiWrapperProps & {
|
|
3
3
|
WrappedComponent: React.ComponentType<ApiWrapperProps>;
|
|
4
4
|
};
|
|
5
|
-
export declare const ContentAnswersComponent: (
|
|
5
|
+
export declare const ContentAnswersComponent: (props: ContentAnswersComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default ContentAnswersComponent;
|