@box/box-ai-content-answers 0.131.1 → 0.132.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/README.md CHANGED
@@ -10,6 +10,11 @@
10
10
 
11
11
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
12
12
 
13
+ ## Notice: Upcoming Deprecation
14
+
15
+ This package will soon be deprecated as we transition to the new AX (Agentic) interface. A separate version intended for third-party developers will be released in the foresable future. We recommend using this package with caution, as it may no longer receive updates or support.
16
+
17
+
13
18
  # box-ai-content-answers
14
19
 
15
20
  This library was generated with [@box/automation](../../automation//README.md). General overview on how to perform tasks on the generated library can be found in [run-tasks](https://nx.dev/core-features/run-tasks) Nx documentation.
@@ -47,7 +52,7 @@ All commands used with Nx can be found in `project.json` file within your packag
47
52
 
48
53
  ## Ownership
49
54
 
50
- Code of the feature belongs to webapp-eng. Responsibilities of owning team include control over code quality, providing guidelines for changes, and alignment with other teams regarding changes. It would be a good practice to consult which team, owning or requesting, will be responsible for implementing changes to code.
55
+ Code of the feature belongs to #ai-experiences. Responsibilities of owning team include control over code quality, providing guidelines for changes, and alignment with other teams regarding changes. It would be a good practice to consult which team, owning or requesting, will be responsible for implementing changes to code.
51
56
 
52
57
  ## Translations
53
58
 
@@ -1,10 +1,10 @@
1
- import { useReducer as oe, useEffect as ie } from "react";
1
+ import { useReducer as ne, useEffect as oe } from "react";
2
2
  import { R as m } from "../../../../chunks/types.js";
3
- import { useContentAnswers as re } from "./hooks/useContentAnswers.js";
4
- import { ContentAnswersRecord as de, ContentAnswersItemRecord as ae } from "./records.js";
5
- import ue from "./reducer.js";
6
- import { jsx as ge } from "react/jsx-runtime";
7
- const pe = (t) => {
3
+ import { useContentAnswers as ie } from "./hooks/useContentAnswers.js";
4
+ import { ContentAnswersRecord as re, ContentAnswersItemRecord as de } from "./records.js";
5
+ import ae from "./reducer.js";
6
+ import { jsx as ue } from "react/jsx-runtime";
7
+ const Ce = (t) => {
8
8
  const {
9
9
  WrappedComponent: f,
10
10
  cachedSuggestedQuestions: r = [],
@@ -22,44 +22,43 @@ const pe = (t) => {
22
22
  isDebugModeEnabled: q,
23
23
  isMarkdownEnabled: T,
24
24
  isOpen: n,
25
- isResetChatEnabled: I,
26
- isStopResponseEnabled: L,
25
+ isStopResponseEnabled: I,
27
26
  isStreamingEnabled: a,
28
27
  itemID: o,
29
28
  items: u,
30
- onCitationClick: P,
31
- onCloseModal: k,
32
- onItemClick: D,
33
- onSuggestedQuestionsFetched: N,
34
- parentItem: O,
35
- restoredQuestions: j = [],
36
- restoredSession: v = null,
37
- restoredShouldShowLandingPage: M = !0,
38
- sendErrorLog: U,
39
- shouldRenderProviders: _ = !0,
40
- suggestedQuestions: x,
41
- warningNotice: F,
42
- warningNoticeAriaLabel: y
43
- } = t, [g, W] = oe(ue, new de({
44
- item: new ae({
29
+ onCitationClick: L,
30
+ onCloseModal: P,
31
+ onItemClick: k,
32
+ onSuggestedQuestionsFetched: D,
33
+ parentItem: N,
34
+ restoredQuestions: O = [],
35
+ restoredSession: j = null,
36
+ restoredShouldShowLandingPage: v = !0,
37
+ sendErrorLog: M,
38
+ shouldRenderProviders: U = !0,
39
+ suggestedQuestions: _,
40
+ warningNotice: x,
41
+ warningNoticeAriaLabel: F
42
+ } = t, [g, y] = ne(ae, new re({
43
+ item: new de({
45
44
  id: o
46
45
  }),
47
- questions: j,
48
- encodedSession: v,
49
- shouldShowLandingPage: M
46
+ questions: O,
47
+ encodedSession: j,
48
+ shouldShowLandingPage: v
50
49
  })), {
51
- clearConversation: z,
52
- createSession: B,
50
+ clearConversation: W,
51
+ createSession: z,
53
52
  fetchAgentConfig: c,
54
53
  fetchSuggestedQuestions: S,
55
- retryQuestion: G,
56
- sendQuestion: H,
57
- setAnswerFeedback: J,
58
- stopQuestion: K
59
- } = re({
54
+ retryQuestion: B,
55
+ sendQuestion: G,
56
+ setAnswerFeedback: H,
57
+ stopQuestion: J
58
+ } = ie({
60
59
  contentAnswers: g,
61
60
  createSessionRequest: A,
62
- dispatchStateUpdate: W,
61
+ dispatchStateUpdate: y,
63
62
  fetchTimeout: h,
64
63
  formatCitations: C,
65
64
  getAgentConfig: w,
@@ -67,71 +66,70 @@ const pe = (t) => {
67
66
  getAnswer: Q,
68
67
  getSuggestedQuestions: s,
69
68
  isCitationsEnabled: d,
70
- isStopResponseEnabled: L,
69
+ isStopResponseEnabled: I,
71
70
  isStreamingEnabled: a,
72
71
  itemID: o,
73
72
  items: u,
74
- onSuggestedQuestionsFetched: N,
75
- sendErrorLog: U,
73
+ onSuggestedQuestionsFetched: D,
74
+ sendErrorLog: M,
76
75
  ...t
77
76
  }), {
78
- encodedSession: V,
79
- error: X,
80
- isLoading: Y,
81
- hasRequestInProgress: Z = !1,
82
- questions: $,
83
- shouldShowLandingPage: ee,
77
+ encodedSession: K,
78
+ error: V,
79
+ isLoading: X,
80
+ hasRequestInProgress: Y = !1,
81
+ questions: Z,
82
+ shouldShowLandingPage: $,
84
83
  suggestedQuestions: e
85
84
  } = g;
86
- ie(() => {
85
+ oe(() => {
87
86
  n && e.requestState === m.NOT_STARTED && S();
88
87
  }, [n, S, e.requestState]);
89
- const te = r.length > 0;
90
- let i = x, l = m.SUCCESS;
91
- te ? i = r : s && (i = e.suggestions, l = e.requestState);
92
- const se = Object.fromEntries(Object.entries({
93
- createSession: B,
94
- encodedSession: V,
95
- error: X,
88
+ const ee = r.length > 0;
89
+ let i = _, l = m.SUCCESS;
90
+ ee ? i = r : s && (i = e.suggestions, l = e.requestState);
91
+ const te = Object.fromEntries(Object.entries({
92
+ createSession: z,
93
+ encodedSession: K,
94
+ error: V,
96
95
  getAIStudioAgents: p,
97
96
  hostAppName: R,
98
97
  hasCustomSuggestedQuestions: !!s,
99
- hasRequestInProgress: Z,
98
+ hasRequestInProgress: Y,
100
99
  isAIStudioAgentSelectorEnabled: b,
101
100
  isCitationsEnabled: d,
102
101
  isDebugModeEnabled: q,
103
102
  isMarkdownEnabled: T,
104
- isLoading: Y,
103
+ isLoading: X,
105
104
  isOpen: n,
106
- isResetChatEnabled: I,
107
105
  isStreamingEnabled: a,
108
106
  itemID: o,
109
107
  items: u,
110
- onClearAction: z,
111
- onCloseModal: k,
112
- onCitationClick: P,
113
- onItemClick: D,
108
+ onClearAction: W,
109
+ onCloseModal: P,
110
+ onCitationClick: L,
111
+ onItemClick: k,
114
112
  onSelectAgent: c,
115
113
  onAgentEditorToggle: c,
116
- parentItem: O,
117
- questions: $,
118
- retryQuestion: G,
119
- sendQuestion: H,
120
- setAnswerFeedback: J,
121
- shouldRenderProviders: _,
122
- shouldShowLandingPage: ee,
123
- stopQuestion: K,
114
+ parentItem: N,
115
+ questions: Z,
116
+ retryQuestion: B,
117
+ sendQuestion: G,
118
+ setAnswerFeedback: H,
119
+ shouldRenderProviders: U,
120
+ shouldShowLandingPage: $,
121
+ stopQuestion: J,
124
122
  suggestedQuestionsRequestState: l,
125
123
  suggestedQuestions: i,
126
- warningNotice: F,
127
- warningNoticeAriaLabel: y
128
- }).filter(([Se, ne]) => ne !== void 0));
129
- return /* @__PURE__ */ ge(f, {
124
+ warningNotice: x,
125
+ warningNoticeAriaLabel: F
126
+ }).filter(([ce, se]) => se !== void 0));
127
+ return /* @__PURE__ */ ue(f, {
130
128
  ...t,
131
- ...se
129
+ ...te
132
130
  });
133
131
  };
134
132
  export {
135
- pe as ContentAnswersComponent,
136
- pe as default
133
+ Ce as ContentAnswersComponent,
134
+ Ce as default
137
135
  };
@@ -1,76 +1,75 @@
1
- import { useBreakpoint as X, Breakpoint as Y, Modal as c, TooltipProvider as Z, Tooltip as $ } from "@box/blueprint-web";
2
- import { ArrowsCollapse as ee } from "@box/blueprint-web-assets/icons/Fill";
3
- import { BoxAiLogo as oe } from "@box/blueprint-web-assets/icons/Logo";
1
+ import { useBreakpoint as V, Breakpoint as X, Modal as c, TooltipProvider as Y, Tooltip as Z } from "@box/blueprint-web";
2
+ import { ArrowsCollapse as $ } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { BoxAiLogo as ee } from "@box/blueprint-web-assets/icons/Logo";
4
4
  import { Size8 as w } from "@box/blueprint-web-assets/tokens/tokens";
5
- import { BoxAiAgentSelectorWithApi as te, AgentsProvider as se } from "@box/box-ai-agent-selector";
6
- import { useState as ae, useMemo as le, useCallback as S, useEffect as u } from "react";
7
- import { useIntl as re } from "react-intl";
8
- import { BoxAiContentAnswers as ne } from "../../box-ai-content-answers.js";
9
- import { A as ie, R as de } from "../../../../chunks/types.js";
10
- import { LOGGER_BASE_CONFIG as C, LOGGER_ACTION_CLICK as ce } from "../common/constants.js";
11
- import { s, C as me } from "../../../../chunks/clear-conversation-button.js";
12
- import fe from "./hooks/useStopPropagationOnEsc.js";
13
- import { Title as ge } from "./title.js";
5
+ import { BoxAiAgentSelectorWithApi as oe, AgentsProvider as te } from "@box/box-ai-agent-selector";
6
+ import { useState as se, useMemo as ae, useCallback as S, useEffect as C } from "react";
7
+ import { useIntl as le } from "react-intl";
8
+ import { BoxAiContentAnswers as re } from "../../box-ai-content-answers.js";
9
+ import { A as ne, R as ie } from "../../../../chunks/types.js";
10
+ import { LOGGER_BASE_CONFIG as p, LOGGER_ACTION_CLICK as de } from "../common/constants.js";
11
+ import { s, C as ce } from "../../../../chunks/clear-conversation-button.js";
12
+ import me from "./hooks/useStopPropagationOnEsc.js";
13
+ import { Title as fe } from "./title.js";
14
14
  import x from "./messages.js";
15
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
16
- const ue = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", Ce = (o) => o ? x.collapseModalAriaLabel : x.closeModalAriaLabel, pe = (o) => o ? ee : void 0, Me = (o) => {
15
+ import { jsxs as M, jsx as e } from "react/jsx-runtime";
16
+ const ge = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", ue = (o) => o ? x.collapseModalAriaLabel : x.closeModalAriaLabel, Ce = (o) => o ? $ : void 0, pe = (o) => {
17
17
  const a = o === "collapsible";
18
18
  return {
19
- closeModalLabel: Ce(a),
20
- closeModalTargetId: ue(a),
21
- closeModalIcon: pe(a)
19
+ closeModalLabel: ue(a),
20
+ closeModalTargetId: ge(a),
21
+ closeModalIcon: Ce(a)
22
22
  };
23
- }, ke = ({
23
+ }, _e = ({
24
24
  children: o,
25
25
  getAIStudioAgents: a,
26
26
  hasCustomSuggestedQuestions: B,
27
27
  hostAppName: m,
28
28
  isAIStudioAgentSelectorEnabled: f = !1,
29
29
  isDebugModeEnabled: I,
30
- isResetChatEnabled: _,
31
- isStopResponseEnabled: k = !1,
32
- itemSize: M,
33
- extension: h,
34
- onClearAction: T,
35
- onSelectAgent: G,
36
- onSelectedAgentCallback: P,
30
+ isStopResponseEnabled: _ = !1,
31
+ itemSize: h,
32
+ extension: T,
33
+ onClearAction: g,
34
+ onSelectAgent: k,
35
+ onSelectedAgentCallback: G,
37
36
  recordAction: l,
38
- shouldRenderProviders: q = !0,
39
- shouldShowLandingPage: H = !1,
40
- stopPropagationOnEsc: z,
37
+ shouldRenderProviders: P = !0,
38
+ shouldShowLandingPage: q = !1,
39
+ stopPropagationOnEsc: H,
41
40
  variant: b = "closable",
42
41
  items: i,
43
42
  parentItem: d,
44
- ...F
43
+ ...z
45
44
  }) => {
46
45
  var E, v;
47
46
  const {
48
- open: A,
49
- defaultOpen: j,
50
- onOpenChange: D,
51
- modal: Q,
47
+ open: L,
48
+ defaultOpen: F,
49
+ onOpenChange: j,
50
+ modal: D,
52
51
  ...r
53
- } = F, L = re(), U = X() <= Y.Medium;
54
- fe(z, A);
55
- const g = (v = (E = r == null ? void 0 : r.questions) == null ? void 0 : E[r.questions.length - 1]) == null ? void 0 : v.error, [W, O] = ae(!1), {
52
+ } = z, O = le(), Q = V() <= X.Medium;
53
+ me(H, L);
54
+ const u = (v = (E = r == null ? void 0 : r.questions) == null ? void 0 : E[r.questions.length - 1]) == null ? void 0 : v.error, [U, A] = se(!1), {
56
55
  closeModalLabel: N,
57
- closeModalTargetId: y,
58
- closeModalIcon: K
59
- } = le(() => Me(b), [b]), n = S((t) => {
56
+ closeModalTargetId: W,
57
+ closeModalIcon: y
58
+ } = ae(() => pe(b), [b]), n = S((t) => {
60
59
  l && (t.data ?? (t.data = {}), t.data.hostAppName = m, l(t));
61
60
  }, [m, l]);
62
- u(() => {
61
+ C(() => {
63
62
  i || n({
64
- ...C,
63
+ ...p,
65
64
  target: "loaded",
66
65
  data: {
67
- fileSize: M,
68
- fileType: h
66
+ fileSize: h,
67
+ fileType: T
69
68
  }
70
69
  });
71
- }, [n, h, M, i, l]), u(() => {
70
+ }, [n, T, h, i, l]), C(() => {
72
71
  i && n({
73
- ...C,
72
+ ...p,
74
73
  target: "loaded",
75
74
  data: {
76
75
  parentItemType: d == null ? void 0 : d.type,
@@ -80,84 +79,84 @@ const ue = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-c
80
79
  }))
81
80
  }
82
81
  });
83
- }, [n, d, l]), u(() => {
84
- g && g === ie.AGENT_NOT_FOUND && O(!0);
85
- }, [g]);
86
- const J = () => {
87
- T && (T(), n({
88
- ...C,
89
- action: ce,
82
+ }, [n, d, l]), C(() => {
83
+ u && u === ne.AGENT_NOT_FOUND && A(!0);
84
+ }, [u]);
85
+ const K = () => {
86
+ g && (g(), n({
87
+ ...p,
88
+ action: de,
90
89
  target: "clearChat"
91
90
  }));
92
- }, V = S(async () => (O(!1), a()), [a]), R = /* @__PURE__ */ p(c, {
93
- defaultOpen: j,
94
- modal: Q,
95
- onOpenChange: D,
96
- open: A,
91
+ }, J = S(async () => (A(!1), a()), [a]), R = /* @__PURE__ */ M(c, {
92
+ defaultOpen: F,
93
+ modal: D,
94
+ onOpenChange: j,
95
+ open: L,
97
96
  children: [/* @__PURE__ */ e(c.Trigger, {
98
97
  children: o
99
- }), /* @__PURE__ */ p(c.Content, {
98
+ }), /* @__PURE__ */ M(c.Content, {
100
99
  className: s.contentAnswersModal,
101
100
  "data-testid": "content-answers-modal",
102
101
  size: "xlarge",
103
102
  children: [/* @__PURE__ */ e(c.Header, {
104
103
  className: s.modalHeaderContainer,
105
- children: /* @__PURE__ */ p("div", {
104
+ children: /* @__PURE__ */ M("div", {
106
105
  className: s.modalHeader,
107
- children: [!U && /* @__PURE__ */ e(oe, {
106
+ children: [!Q && /* @__PURE__ */ e(ee, {
108
107
  className: s.BoxAIIconColor,
109
108
  "data-testid": "content-answers-icon-color",
110
109
  height: w,
111
110
  width: w
112
- }), /* @__PURE__ */ e(ge, {
111
+ }), /* @__PURE__ */ e(fe, {
113
112
  isAIStudioAgentSelectorEnabled: f
114
- }), f && /* @__PURE__ */ e(te, {
113
+ }), f && /* @__PURE__ */ e(oe, {
115
114
  contentClassName: s.agentSelectorContent,
116
115
  disabled: r.hasRequestInProgress,
117
- fetcher: V,
116
+ fetcher: J,
118
117
  hostAppName: m,
119
- onSelectAgent: G,
120
- onSelectedAgentCallback: P,
118
+ onSelectAgent: k,
119
+ onSelectedAgentCallback: G,
121
120
  recordAction: l,
122
- requestState: W ? de.ERROR : void 0,
121
+ requestState: U ? ie.ERROR : void 0,
123
122
  shouldHideAgentSelectorOnLoad: !0,
124
123
  triggerChipClassName: s.agentSelectorTrigger
125
124
  })]
126
125
  })
127
- }), /* @__PURE__ */ e(ne, {
126
+ }), /* @__PURE__ */ e(re, {
128
127
  className: s.boxAiContentAnswers,
129
128
  hasCustomSuggestedQuestions: B,
130
129
  hostAppName: m,
131
130
  isAIStudioAgentSelectorEnabled: f,
132
131
  isDebugModeEnabled: I,
133
- isStopResponseEnabled: k,
132
+ isStopResponseEnabled: _,
134
133
  items: i,
135
134
  parentItem: d,
136
135
  recordAction: n,
137
- shouldShowLandingPage: H,
136
+ shouldShowLandingPage: q,
138
137
  ...r
139
- }), _ && /* @__PURE__ */ e(me, {
140
- onClick: J
141
- }), /* @__PURE__ */ e(Z, {
142
- children: /* @__PURE__ */ e($, {
143
- content: L.formatMessage(N),
138
+ }), g && /* @__PURE__ */ e(ce, {
139
+ onClick: K
140
+ }), /* @__PURE__ */ e(Y, {
141
+ children: /* @__PURE__ */ e(Z, {
142
+ content: O.formatMessage(N),
144
143
  "data-testid": "content-answers-close-modal-tooltip",
145
144
  children: /* @__PURE__ */ e(c.Close, {
146
- "aria-label": L.formatMessage(N),
145
+ "aria-label": O.formatMessage(N),
147
146
  className: s["modal-close-button"],
148
- "data-target-id": y,
149
- icon: K,
147
+ "data-target-id": W,
148
+ icon: y,
150
149
  size: "small"
151
150
  })
152
151
  })
153
152
  })]
154
153
  })]
155
154
  });
156
- return q ? /* @__PURE__ */ e(se, {
155
+ return P ? /* @__PURE__ */ e(te, {
157
156
  children: R
158
157
  }) : R;
159
158
  };
160
159
  export {
161
- ke as IntelligenceModal,
162
- ke as default
160
+ _e as IntelligenceModal,
161
+ _e as default
163
162
  };
@@ -1,42 +1,42 @@
1
- import { Text as X, Tooltip as Z, IconButton as ee } from "@box/blueprint-web";
2
- import { ArrowsExpand as te } from "@box/blueprint-web-assets/icons/Fill";
3
- import { useAgents as ne, BoxAiAgentSelectorWithApi as oe } from "@box/box-ai-agent-selector";
4
- import H from "clsx";
5
- import $ from "lodash/isEqual";
1
+ import { Text as K, Tooltip as X, IconButton as Z } from "@box/blueprint-web";
2
+ import { ArrowsExpand as ee } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { useAgents as te, BoxAiAgentSelectorWithApi as ne } from "@box/box-ai-agent-selector";
4
+ import y from "clsx";
5
+ import F from "lodash/isEqual";
6
6
  import * as u from "react";
7
- import { useIntl as se } from "react-intl";
8
- import { BoxAiContentAnswers as ae } from "../../box-ai-content-answers.js";
9
- import { withApiWrapper as ie } from "../api-wrapper/api-wrapper.js";
10
- import { ORIGIN_BOXAI_SIDEBAR as re, EVENT_JS_READY as ce } from "../common/constants.js";
11
- import { mark as de } from "../common/performance.js";
12
- import { C as le } from "../../../../chunks/clear-conversation-button.js";
13
- import { IntelligenceModal as be } from "../modal/modal.js";
14
- import { IntelligenceSidebarContext as Se } from "./context.js";
15
- import x from "./messages.js";
16
- import ue from "./title.js";
17
- import { jsxs as p, Fragment as y, jsx as e } from "react/jsx-runtime";
18
- import '../../../../styles/content.css';const pe = "_bcsSidebarBase_gfv6u_2", Ae = "_bcsContent_gfv6u_2", ge = "_bcsBoxAISidebar_gfv6u_2", he = "_bcsContentHeader_gfv6u_6", me = "_bcsTitle_gfv6u_15", fe = "_bcsScrollContent_gfv6u_22", _e = "_withModalOpen_gfv6u_32", Ie = "_bcsBoxAISidebarAgentSelector_gfv6u_35", Ce = "_bcsBoxAISidebarAgentSelectorContainer_gfv6u_39", xe = "_bcsBoxAISidebarChatActions_gfv6u_43", Be = "_bcsBoxAISidebarContent_gfv6u_47", ve = "_bcsBoxAISidebarExpand_gfv6u_50", we = "_bcsBoxAISidebarTitlePart_gfv6u_53", Te = "_sidebarChip_gfv6u_77", Ee = "_bcsContentSubheader_gfv6u_90", Ne = "_bcsScrollContentWrapper_gfv6u_99", Pe = "_withSubheader_gfv6u_104", Me = "_expanded_gfv6u_107", t = {
19
- bcsSidebarBase: pe,
20
- bcsContent: Ae,
21
- bcsBoxAISidebar: ge,
22
- bcsContentHeader: he,
23
- bcsTitle: me,
24
- bcsScrollContent: fe,
25
- withModalOpen: _e,
26
- bcsBoxAISidebarAgentSelector: Ie,
27
- bcsBoxAISidebarAgentSelectorContainer: Ce,
7
+ import { useIntl as oe } from "react-intl";
8
+ import { BoxAiContentAnswers as se } from "../../box-ai-content-answers.js";
9
+ import { withApiWrapper as ae } from "../api-wrapper/api-wrapper.js";
10
+ import { ORIGIN_BOXAI_SIDEBAR as ie, EVENT_JS_READY as re } from "../common/constants.js";
11
+ import { mark as ce } from "../common/performance.js";
12
+ import { C as de } from "../../../../chunks/clear-conversation-button.js";
13
+ import { IntelligenceModal as le } from "../modal/modal.js";
14
+ import { IntelligenceSidebarContext as be } from "./context.js";
15
+ import C from "./messages.js";
16
+ import Se from "./title.js";
17
+ import { jsxs as p, Fragment as $, jsx as e } from "react/jsx-runtime";
18
+ import '../../../../styles/content.css';const ue = "_bcsSidebarBase_gfv6u_2", pe = "_bcsContent_gfv6u_2", Ae = "_bcsBoxAISidebar_gfv6u_2", ge = "_bcsContentHeader_gfv6u_6", he = "_bcsTitle_gfv6u_15", me = "_bcsScrollContent_gfv6u_22", fe = "_withModalOpen_gfv6u_32", _e = "_bcsBoxAISidebarAgentSelector_gfv6u_35", Ie = "_bcsBoxAISidebarAgentSelectorContainer_gfv6u_39", xe = "_bcsBoxAISidebarChatActions_gfv6u_43", Ce = "_bcsBoxAISidebarContent_gfv6u_47", Be = "_bcsBoxAISidebarExpand_gfv6u_50", ve = "_bcsBoxAISidebarTitlePart_gfv6u_53", we = "_sidebarChip_gfv6u_77", Te = "_bcsContentSubheader_gfv6u_90", Ee = "_bcsScrollContentWrapper_gfv6u_99", Ne = "_withSubheader_gfv6u_104", Pe = "_expanded_gfv6u_107", t = {
19
+ bcsSidebarBase: ue,
20
+ bcsContent: pe,
21
+ bcsBoxAISidebar: Ae,
22
+ bcsContentHeader: ge,
23
+ bcsTitle: he,
24
+ bcsScrollContent: me,
25
+ withModalOpen: fe,
26
+ bcsBoxAISidebarAgentSelector: _e,
27
+ bcsBoxAISidebarAgentSelectorContainer: Ie,
28
28
  bcsBoxAISidebarChatActions: xe,
29
- bcsBoxAISidebarContent: Be,
30
- bcsBoxAISidebarExpand: ve,
31
- bcsBoxAISidebarTitlePart: we,
32
- sidebarChip: Te,
33
- bcsContentSubheader: Ee,
34
- bcsScrollContentWrapper: Ne,
35
- withSubheader: Pe,
36
- expanded: Me
37
- }, Le = `${re}_${ce}`;
38
- de(Le);
39
- const Oe = ({
29
+ bcsBoxAISidebarContent: Ce,
30
+ bcsBoxAISidebarExpand: Be,
31
+ bcsBoxAISidebarTitlePart: ve,
32
+ sidebarChip: we,
33
+ bcsContentSubheader: Te,
34
+ bcsScrollContentWrapper: Ee,
35
+ withSubheader: Ne,
36
+ expanded: Pe
37
+ }, Me = `${ie}_${re}`;
38
+ ce(Me);
39
+ const Le = ({
40
40
  actions: B,
41
41
  children: i,
42
42
  className: n,
@@ -49,14 +49,14 @@ const Oe = ({
49
49
  const b = `${d}${d === "" ? "" : "_"}${A}`, g = `${b}-content`;
50
50
  return /* @__PURE__ */ p("div", {
51
51
  "aria-labelledby": b,
52
- className: H(t.bcsContent, n),
52
+ className: y(t.bcsContent, n),
53
53
  "data-testid": "bcs-content",
54
54
  id: g,
55
55
  role: "tabpanel",
56
56
  ...c,
57
57
  children: [/* @__PURE__ */ p("div", {
58
58
  className: t.bcsContentHeader,
59
- children: [l && /* @__PURE__ */ e(X, {
59
+ children: [l && /* @__PURE__ */ e(K, {
60
60
  as: "h3",
61
61
  className: t.bcsTitle,
62
62
  children: l
@@ -73,7 +73,7 @@ const Oe = ({
73
73
  })]
74
74
  });
75
75
  };
76
- function Re(B) {
76
+ function Oe(B) {
77
77
  const {
78
78
  createSession: i,
79
79
  encodedSession: n,
@@ -83,49 +83,48 @@ function Re(B) {
83
83
  hostAppName: r,
84
84
  isAIStudioAgentSelectorEnabled: c,
85
85
  isLoading: b,
86
- isResetChatEnabled: g,
87
- onSelectAgent: N,
86
+ onSelectAgent: g,
88
87
  questions: h,
89
- shouldShowLandingPage: P = !0,
88
+ shouldShowLandingPage: N = !0,
90
89
  sendQuestion: m,
91
90
  stopQuestion: v,
92
- ...M
91
+ ...P
93
92
  } = B, {
94
93
  formatMessage: f
95
- } = se(), L = u.useRef(!1), [w, O] = u.useState(!1), {
94
+ } = oe(), M = u.useRef(!1), [w, L] = u.useState(!1), {
96
95
  cache: s,
97
- contentName: R,
98
- elementId: V,
99
- fileExtension: Q,
100
- isFeedbackEnabled: k,
101
- isFeedbackFormEnabled: q,
102
- isStopResponseEnabled: U,
96
+ contentName: O,
97
+ elementId: H,
98
+ fileExtension: V,
99
+ isFeedbackEnabled: R,
100
+ isFeedbackFormEnabled: k,
101
+ isStopResponseEnabled: q,
103
102
  items: T,
104
- itemSize: D,
105
- onFeedbackFormSubmit: W,
106
- onUserInteraction: F,
107
- onSelectedAgentCallback: j,
103
+ itemSize: Q,
104
+ onFeedbackFormSubmit: U,
105
+ onUserInteraction: W,
106
+ onSelectedAgentCallback: D,
108
107
  recordAction: S,
109
108
  setCacheValue: _,
110
109
  shouldPreinitSession: I
111
- } = u.useContext(Se), {
112
- agents: z,
113
- requestState: J,
110
+ } = u.useContext(be), {
111
+ agents: j,
112
+ requestState: z,
114
113
  selectedAgent: E
115
- } = ne(), {
114
+ } = te(), {
116
115
  questions: a
117
116
  } = s;
118
- s.shouldShowLandingPage !== P && _("shouldShowLandingPage", P), s.encodedSession !== n && _("encodedSession", n), $(s.questions, h) || _("questions", h), $(s.agents.selectedAgent, E) || _("agents", {
119
- agents: z,
120
- requestState: J,
117
+ s.shouldShowLandingPage !== N && _("shouldShowLandingPage", N), s.encodedSession !== n && _("encodedSession", n), F(s.questions, h) || _("questions", h), F(s.agents.selectedAgent, E) || _("agents", {
118
+ agents: j,
119
+ requestState: z,
121
120
  selectedAgent: E
122
121
  });
123
- const C = (o = !1) => {
124
- !I && !n && !b && i && i(!0, !1), o && F && F();
122
+ const x = (o = !1) => {
123
+ !I && !n && !b && i && i(!0, !1), o && W && W();
124
+ }, J = () => {
125
+ L(!1);
125
126
  }, Y = () => {
126
- O(!1);
127
- }, G = () => {
128
- C(), O(!0);
127
+ x(), L(!0);
129
128
  };
130
129
  u.useEffect(() => (I && !n && i && i(!0, !0), n && a.length > 0 && a[a.length - 1].isCompleted === !1 && m({
131
130
  prompt: a[a.length - 1].prompt
@@ -144,65 +143,65 @@ function Re(B) {
144
143
  v();
145
144
  }), []), u.useEffect(() => {
146
145
  const o = a[a.length - 1];
147
- !I && !L.current && n && (o != null && o.isLoading) && (m(o, E, !1), L.current = !0);
146
+ !I && !M.current && n && (o != null && o.isLoading) && (m(o, E, !1), M.current = !0);
148
147
  }, [n]);
149
- const K = () => /* @__PURE__ */ p("div", {
148
+ const G = () => /* @__PURE__ */ p("div", {
150
149
  className: t.bcsBoxAISidebarTitlePart,
151
- children: [/* @__PURE__ */ e(ue, {
150
+ children: [/* @__PURE__ */ e(Se, {
152
151
  isAIStudioAgentSelectorEnabled: c
153
152
  }), c && /* @__PURE__ */ e("div", {
154
153
  className: t.bcsBoxAISidebarAgentSelector,
155
- children: /* @__PURE__ */ e(oe, {
154
+ children: /* @__PURE__ */ e(ne, {
156
155
  disabled: l,
157
156
  fetcher: A,
158
157
  hostAppName: r,
159
- onAgentsListOpen: C,
160
- onSelectAgent: N,
161
- onSelectedAgentCallback: j,
158
+ onAgentsListOpen: x,
159
+ onSelectAgent: g,
160
+ onSelectedAgentCallback: D,
162
161
  recordAction: S,
163
162
  shouldHideAgentSelectorOnLoad: !0,
164
163
  variant: "sidebar"
165
164
  })
166
165
  })]
167
166
  });
168
- return /* @__PURE__ */ p(y, {
169
- children: [/* @__PURE__ */ e(Oe, {
170
- actions: /* @__PURE__ */ p(y, {
171
- children: [K(), g && /* @__PURE__ */ e(le, {
167
+ return /* @__PURE__ */ p($, {
168
+ children: [/* @__PURE__ */ e(Le, {
169
+ actions: /* @__PURE__ */ p($, {
170
+ children: [G(), /* @__PURE__ */ e(de, {
172
171
  onClick: d
173
- }), /* @__PURE__ */ e(Z, {
174
- content: f(x.sidebarBoxAISwitchToModalView),
172
+ }), /* @__PURE__ */ e(X, {
173
+ content: f(C.sidebarBoxAISwitchToModalView),
175
174
  "data-testid": "content-answers-open-modal-tooltip",
176
175
  variant: "standard",
177
- children: /* @__PURE__ */ e(ee, {
178
- "aria-label": f(x.sidebarBoxAISwitchToModalView),
176
+ children: /* @__PURE__ */ e(Z, {
177
+ "aria-label": f(C.sidebarBoxAISwitchToModalView),
179
178
  className: t.bcsBoxAISidebarExpand,
180
179
  "data-target-id": "IconButton-expandBoxAISidebar",
181
- icon: te,
182
- onClick: G,
180
+ icon: ee,
181
+ onClick: Y,
183
182
  size: "small"
184
183
  })
185
184
  })]
186
185
  }),
187
- className: H(t.bcsBoxAISidebar, {
186
+ className: y(t.bcsBoxAISidebar, {
188
187
  [t.withModalOpen]: w
189
188
  }),
190
- elementId: V,
189
+ elementId: H,
191
190
  sidebarView: "box-ai",
192
191
  children: /* @__PURE__ */ e("div", {
193
192
  className: t.bcsBoxAISidebarContent,
194
- children: /* @__PURE__ */ e(ae, {
193
+ children: /* @__PURE__ */ e(se, {
195
194
  className: t.bcsBoxAISidebarContentAnswers,
196
- contentName: R,
197
- contentType: f(x.sidebarBoxAIContent),
195
+ contentName: O,
196
+ contentType: f(C.sidebarBoxAIContent),
198
197
  hostAppName: r,
199
198
  isAIStudioAgentSelectorEnabled: c,
200
- isFeedbackEnabled: k,
201
- isFeedbackFormEnabled: q,
202
- isStopResponseEnabled: U,
199
+ isFeedbackEnabled: R,
200
+ isFeedbackFormEnabled: k,
201
+ isStopResponseEnabled: q,
203
202
  items: T,
204
- onFeedbackFormSubmit: W,
205
- onUserIntentToUseAI: C,
203
+ onFeedbackFormSubmit: U,
204
+ onUserIntentToUseAI: x,
206
205
  questions: h,
207
206
  recordAction: S,
208
207
  shouldShowLandingPage: s.shouldShowLandingPage,
@@ -210,28 +209,27 @@ function Re(B) {
210
209
  stopQuestion: v,
211
210
  submitQuestion: m,
212
211
  variant: "sidebar",
213
- ...M
212
+ ...P
214
213
  })
215
214
  })
216
- }), /* @__PURE__ */ e(be, {
217
- contentName: R,
218
- contentType: f(x.sidebarBoxAIContent),
219
- extension: Q,
215
+ }), /* @__PURE__ */ e(le, {
216
+ contentName: O,
217
+ contentType: f(C.sidebarBoxAIContent),
218
+ extension: V,
220
219
  getAIStudioAgents: A,
221
220
  hasRequestInProgress: l,
222
221
  hostAppName: r,
223
222
  isAIStudioAgentSelectorEnabled: c,
224
- isFeedbackEnabled: k,
225
- isFeedbackFormEnabled: q,
226
- isResetChatEnabled: g,
227
- isStopResponseEnabled: U,
223
+ isFeedbackEnabled: R,
224
+ isFeedbackFormEnabled: k,
225
+ isStopResponseEnabled: q,
228
226
  items: T,
229
- itemSize: D,
227
+ itemSize: Q,
230
228
  onClearAction: d,
231
- onFeedbackFormSubmit: W,
232
- onOpenChange: Y,
233
- onSelectAgent: N,
234
- onUserIntentToUseAI: C,
229
+ onFeedbackFormSubmit: U,
230
+ onOpenChange: J,
231
+ onSelectAgent: g,
232
+ onUserIntentToUseAI: x,
235
233
  open: w,
236
234
  questions: h,
237
235
  recordAction: w ? S : void 0,
@@ -241,12 +239,12 @@ function Re(B) {
241
239
  stopQuestion: v,
242
240
  submitQuestion: m,
243
241
  variant: "collapsible",
244
- ...M,
242
+ ...P,
245
243
  shouldRenderProviders: !1
246
244
  })]
247
245
  });
248
246
  }
249
- const Xe = ie(Re);
247
+ const Ke = ae(Oe);
250
248
  export {
251
- Xe as default
249
+ Ke as default
252
250
  };
@@ -16,8 +16,6 @@ export type IntelligenceModalProps = ModalProps & Omit<BoxAiContentAnswersProps,
16
16
  isAIStudioAgentSelectorEnabled?: boolean;
17
17
  /** Flag to enable or disable the debug mode via CTRL+SHIFT+X */
18
18
  isDebugModeEnabled?: boolean;
19
- /** Flag to enable or disable the reset chat button */
20
- isResetChatEnabled?: boolean;
21
19
  isStopResponseEnabled?: boolean;
22
20
  /** Extension of the item used for QA. This is used for log purposes */
23
21
  extension?: string;
@@ -25,7 +25,6 @@ export interface IntelligenceSidebarProps {
25
25
  isFeedbackFormEnabled: boolean;
26
26
  isIntelligentQueryMode: boolean;
27
27
  isMarkdownEnabled: boolean;
28
- isResetChatEnabled: boolean;
29
28
  isStopResponseEnabled?: boolean;
30
29
  isStreamingEnabled: boolean;
31
30
  items: Array<ItemType>;
@@ -49,7 +49,6 @@ export declare const defaultIntelligenceSidebarProps: {
49
49
  };
50
50
  isCitationsEnabled: boolean;
51
51
  isAIStudioAgentSelectorEnabled: boolean;
52
- isResetChatEnabled: boolean;
53
52
  isFeedbackEnabled: boolean;
54
53
  };
55
54
  export declare const DefaultIntelligenceSidebar: (props: IntelligenceSidebarProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "0.131.1",
3
+ "version": "0.132.0",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.35.0",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^12.17.0",
21
- "@box/blueprint-web-assets": "^4.54.0",
22
- "@box/box-ai-agent-selector": "^0.44.1",
23
- "@box/item-icon": "^0.9.168",
24
- "@box/storybook-utils": "^0.13.7",
20
+ "@box/blueprint-web": "^12.17.1",
21
+ "@box/blueprint-web-assets": "^4.55.0",
22
+ "@box/box-ai-agent-selector": "^0.44.2",
23
+ "@box/item-icon": "^0.9.169",
24
+ "@box/storybook-utils": "^0.13.8",
25
25
  "@testing-library/react": "^15.0.6",
26
26
  "react": "^18.3.0",
27
27
  "react-dom": "^18.3.0",