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