@box/box-ai-content-answers 0.80.9 → 0.81.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.
@@ -9,26 +9,26 @@ import { BoxAiContentAnswers as Y } from "../../box-ai-content-answers.js";
9
9
  import { AgentsProvider as Z } from "../../contexts/AgentsContext.js";
10
10
  import { A as y, R as ee } from "../../../../chunks/types.js";
11
11
  import { AgentSelector as te } from "../agents/agent-selector.js";
12
- import { LOGGER_BASE_CONFIG as L, LOGGER_ACTION_CLICK as oe } from "../common/constants.js";
13
- import { s as t, C as re } from "../../../../chunks/clear-conversation-button.js";
14
- import se from "./hooks/useStopPropagationOnEsc.js";
12
+ import { LOGGER_BASE_CONFIG as b, LOGGER_ACTION_CLICK as oe } from "../common/constants.js";
13
+ import { s as t, C as se } from "../../../../chunks/clear-conversation-button.js";
14
+ import re from "./hooks/useStopPropagationOnEsc.js";
15
15
  import f from "./messages.js";
16
16
  import { jsxs as g, jsx as e } from "react/jsx-runtime";
17
- const Re = ({
18
- children: _,
17
+ const ve = ({
18
+ children: L,
19
19
  getAIStudioAgents: p,
20
- hasCustomSuggestedQuestions: b,
20
+ hasCustomSuggestedQuestions: _,
21
21
  hostAppName: m,
22
- isAgentSelectorEnabled: C,
22
+ isAgentSelectorEnabled: u,
23
23
  isAIStudioAgentSelectorEnabled: i,
24
24
  isDebugModeEnabled: x,
25
25
  isResetChatEnabled: k,
26
26
  isStopResponseEnabled: w = !1,
27
- itemSize: u,
27
+ itemSize: C,
28
28
  extension: h,
29
29
  onClearAction: A,
30
30
  onSelectAgent: B,
31
- recordAction: o,
31
+ recordAction: s,
32
32
  shouldRenderProviders: S = !0,
33
33
  stopPropagationOnEsc: G,
34
34
  variant: N = "closable",
@@ -38,39 +38,39 @@ const Re = ({
38
38
  const {
39
39
  open: O,
40
40
  defaultOpen: P,
41
- onOpenChange: H,
42
- modal: q,
43
- ...r
41
+ onOpenChange: q,
42
+ modal: H,
43
+ ...o
44
44
  } = I, c = X(), z = U() <= W.Medium;
45
- se(G, O);
46
- const d = (M = (E = r == null ? void 0 : r.questions) == null ? void 0 : E[r.questions.length - 1]) == null ? void 0 : M.error, [F, v] = l.useState(!1), s = l.useCallback((a) => {
47
- o && (a.data ?? (a.data = {}), a.data.hostAppName = m, o(a));
48
- }, [m, o]);
45
+ re(G, O);
46
+ const d = (M = (E = o == null ? void 0 : o.questions) == null ? void 0 : E[o.questions.length - 1]) == null ? void 0 : M.error, [F, R] = l.useState(!1), r = l.useCallback((a) => {
47
+ s && (a.data ?? (a.data = {}), a.data.hostAppName = m, s(a));
48
+ }, [m, s]);
49
49
  l.useEffect(() => {
50
- s({
51
- ...L,
50
+ r({
51
+ ...b,
52
52
  target: "loaded",
53
53
  data: {
54
- fileSize: u,
54
+ fileSize: C,
55
55
  fileType: h
56
56
  }
57
57
  });
58
- }, [s, h, u, o]), l.useEffect(() => {
59
- d && d === y.AGENT_NOT_FOUND && v(!0);
58
+ }, [r, h, C, s]), l.useEffect(() => {
59
+ d && d === y.AGENT_NOT_FOUND && R(!0);
60
60
  }, [d]);
61
61
  const j = () => {
62
- A && (A(), s({
63
- ...L,
62
+ A && (A(), r({
63
+ ...b,
64
64
  action: oe,
65
65
  target: "clearChat"
66
66
  }));
67
- }, Q = l.useCallback(async () => (v(!1), p()), [p]), R = /* @__PURE__ */ g(n, {
67
+ }, Q = l.useCallback(async () => (R(!1), p()), [p]), v = /* @__PURE__ */ g(n, {
68
68
  defaultOpen: P,
69
- modal: q,
70
- onOpenChange: H,
69
+ modal: H,
70
+ onOpenChange: q,
71
71
  open: O,
72
72
  children: [/* @__PURE__ */ e(n.Trigger, {
73
- children: _
73
+ children: L
74
74
  }), /* @__PURE__ */ g(n.Content, {
75
75
  className: t.contentAnswersModal,
76
76
  "data-testid": "content-answers-modal",
@@ -88,20 +88,21 @@ const Re = ({
88
88
  as: "span",
89
89
  variant: "titleMedium",
90
90
  children: c.formatMessage(f.contentAnswersTitle)
91
- }), !i && C && /* @__PURE__ */ e(te, {
91
+ }), !i && u && /* @__PURE__ */ e(te, {
92
92
  onSelectAgent: B,
93
- recordAction: s
93
+ recordAction: r
94
94
  }), i && /* @__PURE__ */ e(J, {
95
95
  contentClassName: t.agentSelectorContent,
96
+ disabled: o.hasRequestInProgress,
96
97
  fetcher: Q,
97
98
  hostAppName: m,
98
- recordAction: o,
99
+ recordAction: s,
99
100
  requestState: F ? ee.ERROR : void 0,
100
101
  shouldHideAgentSelectorOnLoad: !0,
101
102
  triggerChipClassName: t.agentSelectorTrigger
102
103
  })]
103
104
  })
104
- }), k && /* @__PURE__ */ e(re, {
105
+ }), k && /* @__PURE__ */ e(se, {
105
106
  onClick: j
106
107
  }), /* @__PURE__ */ e(n.Close, {
107
108
  "aria-label": N === "collapsible" ? c.formatMessage(f.collapseModalAriaLabel) : c.formatMessage(f.closeModalAriaLabel),
@@ -110,23 +111,23 @@ const Re = ({
110
111
  size: "small"
111
112
  }), /* @__PURE__ */ e(Y, {
112
113
  className: t.boxAiContentAnswers,
113
- hasCustomSuggestedQuestions: b,
114
- isAgentSelectorEnabled: !i && C,
114
+ hasCustomSuggestedQuestions: _,
115
+ isAgentSelectorEnabled: !i && u,
115
116
  isAIStudioAgentSelectorEnabled: i,
116
117
  isDebugModeEnabled: x,
117
118
  isStopResponseEnabled: w,
118
- recordAction: s,
119
- ...r
119
+ recordAction: r,
120
+ ...o
120
121
  })]
121
122
  })]
122
123
  });
123
124
  return S ? /* @__PURE__ */ e(V, {
124
125
  children: /* @__PURE__ */ e(Z, {
125
- children: R
126
+ children: v
126
127
  })
127
- }) : R;
128
+ }) : v;
128
129
  };
129
130
  export {
130
- Re as IntelligenceModal,
131
- Re as default
131
+ ve as IntelligenceModal,
132
+ ve as default
132
133
  };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "0.80.9",
3
+ "version": "0.81.0",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.16.0",
7
- "@box/box-ai-agent-selector": "^0.15.2",
7
+ "@box/box-ai-agent-selector": "^0.20.0",
8
8
  "@box/item-icon": "^0.9.44",
9
9
  "highlight.js": "^11.9.0",
10
10
  "immutable": "^4.0.0",
@@ -56,5 +56,5 @@
56
56
  "**/*.css"
57
57
  ],
58
58
  "license": "SEE LICENSE IN LICENSE",
59
- "gitHead": "269daefe249d377603b1715be3fe85622fa5bb55"
59
+ "gitHead": "51e1c20f42df2619c51a5643f8bac80baa6c6081"
60
60
  }