@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 $, useEffect as D } from "react";
2
- import { R as a } from "../../../../chunks/types.js";
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";
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 fe = ({
8
- WrappedComponent: f,
9
- createSessionRequest: m,
10
- getAgentConfig: S,
11
- getAIStudioAgents: g,
12
- fetchTimeout: A,
13
- formatCitations: p,
14
- getAnswer: C,
15
- getAnswerStreaming: R,
16
- getSuggestedQuestions: e,
17
- hostAppName: l,
18
- isAgentSelectorEnabled: w,
19
- isAIStudioAgentSelectorEnabled: q,
20
- isCitationsEnabled: n,
21
- isDebugModeEnabled: Q,
22
- isMarkdownEnabled: T,
23
- isOpen: s,
24
- isResetChatEnabled: h,
25
- isStopResponseEnabled: E,
26
- isStreamingEnabled: r,
27
- itemID: o,
28
- itemIDs: u,
29
- items: j,
30
- onCloseModal: U,
31
- onCitationClick: _,
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
40
- }) => {
41
- const [c, k] = $(se, new ee({
42
- item: new te({
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: y,
46
- encodedSession: L
45
+ questions: k,
46
+ encodedSession: v
47
47
  })), {
48
- clearConversation: z,
49
- createSession: B,
50
- fetchAgentConfig: i,
51
- fetchSuggestedQuestions: d,
52
- retryQuestion: F,
53
- sendQuestion: G,
54
- stopQuestion: H
55
- } = I({
56
- contentAnswers: c,
57
- createSessionRequest: m,
58
- dispatchStateUpdate: k,
59
- fetchTimeout: A,
60
- formatCitations: p,
61
- getAgentConfig: S,
62
- getAnswerStreaming: R,
63
- getAnswer: C,
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: n,
66
- isStopResponseEnabled: E,
65
+ isCitationsEnabled: i,
66
+ isStopResponseEnabled: I,
67
67
  isStreamingEnabled: r,
68
68
  itemID: o,
69
- itemIDs: u
69
+ itemIDs: a,
70
+ ...s
70
71
  }), {
71
- encodedSession: J,
72
- error: K,
73
- isLoading: M,
74
- hasRequestInProgress: V = !1,
75
- questions: W,
72
+ encodedSession: F,
73
+ error: G,
74
+ isLoading: H,
75
+ hasRequestInProgress: J = !1,
76
+ questions: K,
76
77
  suggestedQuestions: t
77
- } = c;
78
- D(() => {
79
- s && t.requestState === a.NOT_STARTED && d();
80
- }, [s, d, t.requestState]);
81
- const X = {
82
- createSession: B,
83
- encodedSession: J,
84
- error: K,
85
- getAIStudioAgents: g,
86
- hostAppName: l,
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: V,
89
- isAgentSelectorEnabled: w,
90
- isAIStudioAgentSelectorEnabled: q,
91
- isCitationsEnabled: n,
92
- isDebugModeEnabled: Q,
93
- isMarkdownEnabled: T,
94
- isLoading: M,
95
- isOpen: s,
96
- isResetChatEnabled: h,
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: u,
100
- items: j,
101
- onClearAction: z,
102
- onCloseModal: U,
103
- onCitationClick: _,
104
- onItemClick: v,
105
- onSelectAgent: i,
106
- onAgentEditorToggle: i,
107
- parentItem: x,
108
- questions: W,
109
- retryQuestion: F,
110
- sendQuestion: G,
111
- shouldRenderProviders: N,
112
- stopQuestion: H,
113
- suggestedQuestionsRequestState: e ? t.requestState : a.SUCCESS,
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
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
- fe as ContentAnswersComponent,
124
- fe as default
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",
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.1",
18
+ "@box/blueprint-web": "^9.14.2",
19
19
  "@box/blueprint-web-assets": "^4.31.1",
20
- "@box/box-ai-agent-selector": "^0.22.1",
21
- "@box/item-icon": "^0.9.65",
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": "c4b66b66735e8eb25131583d5f385810b3925d4f"
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: ({ 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;
5
+ export declare const ContentAnswersComponent: (props: ContentAnswersComponentProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default ContentAnswersComponent;