@box/box-ai-content-answers 1.11.0 → 1.11.2

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,36 +1,39 @@
1
- import { Tooltip as l, IconButton as s } from "@box/blueprint-web";
2
- import { Trash as c } from "@box/blueprint-web-assets/icons/Line";
3
- import i from "clsx";
4
- import { useIntl as d } from "react-intl";
1
+ import { useBlueprintModernization as c, Tooltip as i, IconButton as d } from "@box/blueprint-web";
2
+ import { Trash as _ } from "@box/blueprint-web-assets/icons/Line";
3
+ import { Trash as m } from "@box/blueprint-web-assets/icons/Medium";
4
+ import b from "clsx";
5
+ import { useIntl as C } from "react-intl";
5
6
  import t from "../esm/lib/components/modal/messages.js";
6
7
  import { jsx as e } from "react/jsx-runtime";
7
- import '../styles/clear-conversation-button.css';const _ = "_BoxAIIconColor_ild3b_1", m = "_modalHeader_ild3b_5", b = "_contentAnswersModal_ild3b_10", C = "_boxAiContentAnswers_ild3b_18", g = "_clearButton_ild3b_26", A = "_contentAnswerModal_ild3b_1", u = "_modalHeaderContainer_ild3b_55", B = "_agentSelectorTrigger_ild3b_63", p = "_agentSelectorContent_ild3b_74", w = {
8
- BoxAIIconColor: _,
9
- modalHeader: m,
10
- contentAnswersModal: b,
11
- boxAiContentAnswers: C,
12
- clearButton: g,
8
+ import '../styles/clear-conversation-button.css';const g = "_BoxAIIconColor_ild3b_1", A = "_modalHeader_ild3b_5", u = "_contentAnswersModal_ild3b_10", p = "_boxAiContentAnswers_ild3b_18", B = "_clearButton_ild3b_26", I = "_contentAnswerModal_ild3b_1", M = "_modalHeaderContainer_ild3b_55", f = "_agentSelectorTrigger_ild3b_63", w = "_agentSelectorContent_ild3b_74", x = {
9
+ BoxAIIconColor: g,
10
+ modalHeader: A,
11
+ contentAnswersModal: u,
12
+ boxAiContentAnswers: p,
13
+ clearButton: B,
13
14
  "modal-close-button": "_modal-close-button_ild3b_30",
14
- contentAnswerModal: A,
15
- modalHeaderContainer: u,
16
- agentSelectorTrigger: B,
17
- agentSelectorContent: p
18
- }, S = ({
15
+ contentAnswerModal: I,
16
+ modalHeaderContainer: M,
17
+ agentSelectorTrigger: f,
18
+ agentSelectorContent: w
19
+ }, j = ({
19
20
  onClick: n,
20
21
  hasRequestInProgress: a,
21
22
  className: r
22
23
  }) => {
23
- const o = d();
24
- return /* @__PURE__ */ e(l, {
24
+ const o = C(), {
25
+ enableModernizedComponents: s
26
+ } = c(), l = s ? m : _;
27
+ return /* @__PURE__ */ e(i, {
25
28
  content: o.formatMessage(t.clearConversationLabel),
26
29
  "data-testid": "clear-conversation-tooltip",
27
30
  variant: "standard",
28
- children: /* @__PURE__ */ e(s, {
31
+ children: /* @__PURE__ */ e(d, {
29
32
  "aria-label": o.formatMessage(t.clearConversationLabel),
30
- className: i(w.clearButton, r),
33
+ className: b(x.clearButton, r),
31
34
  "data-testid": "clear-conversation-button",
32
35
  disabled: a,
33
- icon: c,
36
+ icon: l,
34
37
  onClick: n,
35
38
  size: "small",
36
39
  "data-target-id": "IconButton-clearConversationLabel"
@@ -38,6 +41,6 @@ import '../styles/clear-conversation-button.css';const _ = "_BoxAIIconColor_ild3
38
41
  });
39
42
  };
40
43
  export {
41
- S as C,
42
- w as s
44
+ j as C,
45
+ x as s
43
46
  };
@@ -2,13 +2,13 @@ import * as p from "react";
2
2
  import { useIntl as u } from "react-intl";
3
3
  import { Tooltip as _, Button as m } from "@box/blueprint-web";
4
4
  import { Stop as c } from "@box/blueprint-web-assets/icons/Fill";
5
- import { LOGGER_BASE_CONFIG as l, LOGGER_ACTION_CLICK as g } from "../esm/lib/components/common/constants.js";
5
+ import { LOGGER_BASE_CONFIG as l, LOGGER_ACTION_CLICK as x } from "../esm/lib/components/common/constants.js";
6
6
  import e from "../esm/lib/components/footer/messages.js";
7
7
  import { jsx as r } from "react/jsx-runtime";
8
- import '../styles/stopResponseButton.css';const k = "_questionInput_kn61g_2", B = "_questionInputWithOutPromptLibrary_kn61g_15", b = "_avatar_kn61g_30", d = "_inputAreaButton_kn61g_33", f = "_square_kn61g_49", C = "_textArea_kn61g_56", I = "_error_kn61g_79", q = "_sidebar_kn61g_82", R = "_submitButtonTooltip_kn61g_90", A = "_actionContainer_kn61g_99", O = "_promptButton_kn61g_105", L = {
9
- questionInput: k,
10
- questionInputWithOutPromptLibrary: B,
11
- avatar: b,
8
+ import '../styles/stopResponseButton.css';const B = "_questionInput_w27x6_2", b = "_questionInputWithOutPromptLibrary_w27x6_16", w = "_avatar_w27x6_31", d = "_inputAreaButton_w27x6_34", f = "_square_w27x6_56", C = "_textArea_w27x6_63", I = "_error_w27x6_86", q = "_sidebar_w27x6_89", R = "_submitButtonTooltip_w27x6_97", A = "_actionContainer_w27x6_106", O = "_promptButton_w27x6_112", g = {
9
+ questionInput: B,
10
+ questionInputWithOutPromptLibrary: b,
11
+ avatar: w,
12
12
  inputAreaButton: d,
13
13
  square: f,
14
14
  textArea: C,
@@ -27,7 +27,7 @@ function S({
27
27
  const s = u(), i = p.useCallback(() => {
28
28
  t && t({
29
29
  ...l,
30
- action: g,
30
+ action: x,
31
31
  target: "stopResponse"
32
32
  }), n(o);
33
33
  }, [o, n, t]);
@@ -38,7 +38,7 @@ function S({
38
38
  children: /* @__PURE__ */ r(m, {
39
39
  "aria-label": s.formatMessage(e.stopResponse),
40
40
  "aria-live": "polite",
41
- className: L.inputAreaButton,
41
+ className: g.inputAreaButton,
42
42
  "data-testid": "content-answers-stop-response-button",
43
43
  icon: c,
44
44
  onClick: i,
@@ -49,5 +49,5 @@ function S({
49
49
  }
50
50
  export {
51
51
  S,
52
- L as s
52
+ g as s
53
53
  };
@@ -1,28 +1,31 @@
1
- import { useNotification as l, Tooltip as m, IconButton as d } from "@box/blueprint-web";
2
- import { Clipboard as u } from "@box/blueprint-web-assets/icons/Line";
3
- import { useIntl as b } from "react-intl";
4
- import f from "../../messages.js";
5
- import { LOGGER_BASE_CONFIG as C, LOGGER_ACTION_CLICK as g } from "../common/constants.js";
6
- import { focusInput as y } from "../common/focusInputUtils.js";
7
- import { markdownToHtmlString as T } from "../common/markdown.js";
1
+ import { useNotification as d, useBlueprintModernization as b, Tooltip as u, IconButton as f } from "@box/blueprint-web";
2
+ import { Clipboard as C } from "@box/blueprint-web-assets/icons/Line";
3
+ import { Clipboard as g } from "@box/blueprint-web-assets/icons/Medium";
4
+ import { useIntl as y } from "react-intl";
5
+ import T from "../../messages.js";
6
+ import { LOGGER_BASE_CONFIG as I, LOGGER_ACTION_CLICK as x } from "../common/constants.js";
7
+ import { focusInput as B } from "../common/focusInputUtils.js";
8
+ import { markdownToHtmlString as v } from "../common/markdown.js";
8
9
  import a from "./messages.js";
9
- import { jsx as n } from "react/jsx-runtime";
10
- const N = ({
10
+ import { jsx as p } from "react/jsx-runtime";
11
+ const E = ({
11
12
  answer: t,
12
13
  onAnswerCopy: r,
13
14
  recordAction: e
14
15
  }) => {
15
16
  const {
16
17
  formatMessage: o
17
- } = b(), {
18
+ } = y(), {
18
19
  addNotification: s
19
- } = l(), p = async () => {
20
+ } = d(), {
21
+ enableModernizedComponents: c
22
+ } = b(), l = async () => {
20
23
  if (e && e({
21
- ...C,
22
- action: g,
24
+ ...I,
25
+ action: x,
23
26
  target: "copyToClipboard"
24
27
  }), t && navigator && navigator.clipboard && navigator.clipboard.write) {
25
- const i = T(t), c = new ClipboardItem({
28
+ const i = v(t), n = new ClipboardItem({
26
29
  "text/html": new Blob([i], {
27
30
  type: "text/html"
28
31
  }),
@@ -30,22 +33,22 @@ const N = ({
30
33
  type: "text/plain"
31
34
  })
32
35
  });
33
- await navigator.clipboard.write([c]), s({
36
+ await navigator.clipboard.write([n]), s({
34
37
  sensitivity: "foreground",
35
38
  styledText: o(a.copyToClipboardSucceeded),
36
39
  variant: "success",
37
40
  typeIconAriaLabel: o(a.copyButtonSuccessText),
38
- closeButtonAriaLabel: o(f.closeButtonText)
41
+ closeButtonAriaLabel: o(T.closeButtonText)
39
42
  }), r && r(t);
40
43
  }
41
- y();
42
- };
43
- return /* @__PURE__ */ n(m, {
44
+ B();
45
+ }, m = c ? g : C;
46
+ return /* @__PURE__ */ p(u, {
44
47
  content: o(a.copyToClipboard),
45
- children: /* @__PURE__ */ n(d, {
48
+ children: /* @__PURE__ */ p(f, {
46
49
  "aria-label": o(a.copyToClipboard),
47
- icon: u,
48
- onClick: p,
50
+ icon: m,
51
+ onClick: l,
49
52
  onFocusCapture: (i) => {
50
53
  i.target.matches(":focus-visible") || i.stopPropagation();
51
54
  },
@@ -55,6 +58,6 @@ const N = ({
55
58
  });
56
59
  };
57
60
  export {
58
- N as CopyButton,
59
- N as default
61
+ E as CopyButton,
62
+ E as default
60
63
  };
@@ -1,35 +1,38 @@
1
- import { Tooltip as r, IconButton as s } from "@box/blueprint-web";
2
- import { InfoBadge as a } from "@box/blueprint-web-assets/icons/Line";
3
- import { useEffect as f } from "react";
4
- import { useIntl as i } from "react-intl";
5
- import { LOGGER_BASE_CONFIG as m } from "../common/constants.js";
6
- import c from "./messages.js";
7
- import { jsx as o } from "react/jsx-runtime";
8
- const x = ({
1
+ import { useBlueprintModernization as s, Tooltip as a, IconButton as i } from "@box/blueprint-web";
2
+ import { InfoBadge as f } from "@box/blueprint-web-assets/icons/Line";
3
+ import { InformationCircle as c } from "@box/blueprint-web-assets/icons/Medium";
4
+ import { useEffect as m } from "react";
5
+ import { useIntl as l } from "react-intl";
6
+ import { LOGGER_BASE_CONFIG as p } from "../common/constants.js";
7
+ import d from "./messages.js";
8
+ import { jsx as n } from "react/jsx-runtime";
9
+ const z = ({
9
10
  recordAction: e
10
11
  }) => {
11
12
  const {
12
- formatMessage: n
13
- } = i(), t = n(c.noReferences);
14
- return f(() => {
13
+ formatMessage: t
14
+ } = l(), {
15
+ enableModernizedComponents: r
16
+ } = s(), o = t(d.noReferences);
17
+ return m(() => {
15
18
  e && e({
16
- ...m,
19
+ ...p,
17
20
  target: "noReferences"
18
21
  });
19
- }, [e]), /* @__PURE__ */ o(r, {
22
+ }, [e]), /* @__PURE__ */ n(a, {
20
23
  className: "Answer-NoCitations",
21
- content: t,
24
+ content: o,
22
25
  "data-testid": "content-answers-references-no-references-tooltip",
23
- children: /* @__PURE__ */ o(s, {
24
- "aria-label": t,
26
+ children: /* @__PURE__ */ n(i, {
27
+ "aria-label": o,
25
28
  "data-testid": "content-answers-references-no-references",
26
- icon: a,
29
+ icon: r ? c : f,
27
30
  size: "x-small",
28
31
  "data-target-id": "IconButton-noReferences"
29
32
  })
30
33
  });
31
34
  };
32
35
  export {
33
- x as NoCitationsIcon,
34
- x as default
36
+ z as NoCitationsIcon,
37
+ z as default
35
38
  };
@@ -1,114 +1,120 @@
1
- import { useNotification as W, Tooltip as w, IconButton as y } from "@box/blueprint-web";
2
- import { ThumbUp as $, ThumbDown as j } from "@box/blueprint-web-assets/icons/Fill";
3
- import { ThumbUp as z, ThumbDown as J } from "@box/blueprint-web-assets/icons/Line";
4
- import { useAgents as K } from "@box/box-ai-agent-selector";
1
+ import { useBlueprintModernization as J, useNotification as K, Tooltip as N, IconButton as y } from "@box/blueprint-web";
2
+ import { ThumbUp as Q, ThumbDown as V } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { ThumbUp as X, ThumbDown as Y } from "@box/blueprint-web-assets/icons/Line";
4
+ import { ThumbsUp as Z, ThumbsDown as C } from "@box/blueprint-web-assets/icons/Medium";
5
+ import { ThumbsUp as O, ThumbsDown as q } from "@box/blueprint-web-assets/icons/MediumFilled";
6
+ import { useAgents as k } from "@box/box-ai-agent-selector";
5
7
  import b from "react";
6
- import { useIntl as Q } from "react-intl";
7
- import { LOGGER_BASE_CONFIG as V, LOGGER_ACTION_PROGRAMMATIC as X } from "../common/constants.js";
8
- import { FeedbackTooltip as Y } from "./feedback-tooltip.js";
8
+ import { useIntl as F } from "react-intl";
9
+ import { LOGGER_BASE_CONFIG as tt, LOGGER_ACTION_PROGRAMMATIC as st } from "../common/constants.js";
10
+ import { FeedbackTooltip as at } from "./feedback-tooltip.js";
9
11
  import x from "../../messages.js";
10
- import { focusInput as Z } from "../common/focusInputUtils.js";
11
- import f from "./messages.js";
12
- import { jsxs as g, Fragment as O, jsx as i } from "react/jsx-runtime";
13
- import '../../../../styles/thumb-buttons.css';const C = "_thumbDown_1axcd_1", q = {
14
- thumbDown: C
15
- }, u = {
12
+ import { focusInput as mt } from "../common/focusInputUtils.js";
13
+ import i from "./messages.js";
14
+ import { jsxs as ot, Fragment as lt, jsx as n } from "react/jsx-runtime";
15
+ import '../../../../styles/thumb-buttons.css';const ut = "_thumbDown_1axcd_1", rt = {
16
+ thumbDown: ut
17
+ }, r = {
16
18
  THUMB_UP: "positive",
17
19
  THUMB_DOWN: "negative",
18
20
  NONE: "none"
19
- }, et = ({
21
+ }, Mt = ({
20
22
  feedbackValue: H,
21
- hostAppName: n,
22
- isFeedbackFormEnabled: P = !1,
23
- isFeedbackTooltipOpen: G = !1,
24
- items: _,
25
- onFeedbackFormSubmit: U,
23
+ hostAppName: h,
24
+ isFeedbackFormEnabled: I = !1,
25
+ isFeedbackTooltipOpen: P = !1,
26
+ items: U,
27
+ onFeedbackFormSubmit: D,
26
28
  onFeedbackTooltipOpenChange: s,
27
- prompt: D,
28
- promptType: B,
29
+ prompt: p,
30
+ promptType: _,
29
31
  questionId: a,
30
- recordAction: o,
31
- response: T,
32
+ recordAction: f,
33
+ response: B,
32
34
  setAnswerFeedback: e,
33
- shouldFeedbackFormIncludeFeedbackText: p = !1,
35
+ shouldFeedbackFormIncludeFeedbackText: w = !1,
34
36
  shouldFeedbackIncludePromptData: M = !1,
35
- variant: L
37
+ variant: d
36
38
  }) => {
37
39
  const {
38
- formatMessage: m
39
- } = Q(), {
40
- addNotification: R
41
- } = W(), {
42
- selectedAgent: N
43
- } = K(), r = H, h = b.useMemo(() => _.filter((t) => t.status === "supported").map((t) => t.fileType), [_]), c = b.useCallback((t) => {
44
- r !== t && (e == null || e(a, t), o == null || o({
45
- ...V,
46
- action: X,
40
+ enableModernizedComponents: m
41
+ } = J(), {
42
+ formatMessage: o
43
+ } = F(), {
44
+ addNotification: v
45
+ } = K(), {
46
+ selectedAgent: L
47
+ } = k(), u = H, T = b.useMemo(() => U.filter((t) => t.status === "supported").map((t) => t.fileType), [U]), c = b.useCallback((t) => {
48
+ u !== t && (e == null || e(a, t), f == null || f({
49
+ ...tt,
50
+ action: st,
47
51
  target: "answer_feedback",
48
- component: L,
52
+ component: d,
49
53
  data: {
50
54
  feedback_value: t,
51
- file_types: h,
52
- feature: n,
53
- prompt_type: B
55
+ file_types: T,
56
+ feature: h,
57
+ prompt_type: _
54
58
  }
55
- }), Z());
56
- }, [n, o, r, L, h, a, e, B]), S = ({
59
+ }), mt());
60
+ }, [h, f, u, d, T, a, e, _]), G = ({
57
61
  feedback: t,
58
- feedbackPromptShareConsent: E,
59
- issueType: I
62
+ feedbackPromptShareConsent: j,
63
+ issueType: g
60
64
  }) => {
61
- if (s == null || s(!1, a), !U)
65
+ if (s == null || s(!1, a), !D)
62
66
  return;
63
67
  const l = {
64
- fileTypes: h,
68
+ fileTypes: T,
65
69
  hasPromptData: !1,
66
- hostApp: n,
67
- issueType: I,
70
+ hostApp: h,
71
+ issueType: g,
68
72
  timestamp: Date.now(),
69
73
  questionId: a
70
74
  };
71
- p && (l.feedback = t, l.hasFeedback = !!t), M && E && D && T && (l.hasPromptData = !0, l.prompt = D, l.response = T), N && (l.selectedAgentName = N.name), U(l, () => {
72
- R({
75
+ w && (l.feedback = t, l.hasFeedback = !!t), M && j && p && B && (l.hasPromptData = !0, l.prompt = p, l.response = B), L && (l.selectedAgentName = L.name), D(l, () => {
76
+ v({
73
77
  sensitivity: "foreground",
74
- styledText: m(f.feedbackTooltipConfirmation),
78
+ styledText: o(i.feedbackTooltipConfirmation),
75
79
  variant: "success",
76
- typeIconAriaLabel: m(x.ariaTypeSuccessIconLabel),
77
- closeButtonAriaLabel: m(x.closeButtonText)
80
+ typeIconAriaLabel: o(x.ariaTypeSuccessIconLabel),
81
+ closeButtonAriaLabel: o(x.closeButtonText)
78
82
  });
79
83
  });
80
- }, d = (t) => {
84
+ }, R = (t) => {
81
85
  t || s == null || s(!1, a);
82
- }, v = b.useCallback(() => c(u.THUMB_UP), [c]), A = b.useCallback(() => {
83
- c(u.THUMB_DOWN), s == null || s(!0, a);
84
- }, [c, s, a]);
85
- return /* @__PURE__ */ g(O, {
86
- children: [/* @__PURE__ */ i(w, {
87
- content: m(f.thumbsUpAriaLabel),
88
- children: /* @__PURE__ */ i(y, {
89
- "aria-label": m(f.thumbsUpAriaLabel),
90
- disabled: r === u.THUMB_DOWN,
91
- icon: r === u.THUMB_UP ? $ : z,
92
- onClick: v,
86
+ }, S = b.useCallback(() => c(r.THUMB_UP), [c]), $ = b.useCallback(() => {
87
+ c(r.THUMB_DOWN), s == null || s(!0, a);
88
+ }, [c, s, a]), z = m ? Z : X, A = m ? C : Y, E = m ? O : Q, W = m ? q : V;
89
+ return /* @__PURE__ */ ot(lt, {
90
+ children: [/* @__PURE__ */ n(N, {
91
+ content: o(i.thumbsUpAriaLabel),
92
+ children: /* @__PURE__ */ n(y, {
93
+ "aria-label": o(i.thumbsUpAriaLabel),
94
+ disabled: u === r.THUMB_DOWN,
95
+ icon: u === r.THUMB_UP ? E : z,
96
+ onClick: S,
93
97
  size: "x-small",
98
+ variant: m ? "icon-logo" : "default",
94
99
  "data-target-id": "IconButton-thumbsUpAriaLabel"
95
100
  })
96
- }), /* @__PURE__ */ i(Y, {
97
- isOpen: G,
98
- onOpenChange: d,
99
- onSubmit: S,
100
- shouldIncludeFeedbackText: p,
101
+ }), /* @__PURE__ */ n(at, {
102
+ isOpen: P,
103
+ onOpenChange: R,
104
+ onSubmit: G,
105
+ shouldIncludeFeedbackText: w,
101
106
  shouldIncludePromptShareConsent: M,
102
- shouldShow: P,
103
- children: /* @__PURE__ */ i(w, {
104
- content: m(f.thumbsDownAriaLabel),
105
- children: /* @__PURE__ */ i(y, {
106
- "aria-label": m(f.thumbsDownAriaLabel),
107
- className: q.thumbDown,
108
- disabled: r === u.THUMB_UP,
109
- icon: r === u.THUMB_DOWN ? j : J,
110
- onClick: A,
107
+ shouldShow: I,
108
+ children: /* @__PURE__ */ n(N, {
109
+ content: o(i.thumbsDownAriaLabel),
110
+ children: /* @__PURE__ */ n(y, {
111
+ "aria-label": o(i.thumbsDownAriaLabel),
112
+ className: m ? "" : rt.thumbDown,
113
+ disabled: u === r.THUMB_UP,
114
+ icon: u === r.THUMB_DOWN ? W : A,
115
+ onClick: $,
111
116
  size: "x-small",
117
+ variant: m ? "icon-logo" : "default",
112
118
  "data-target-id": "IconButton-thumbsDownAriaLabel"
113
119
  })
114
120
  })
@@ -116,6 +122,6 @@ import '../../../../styles/thumb-buttons.css';const C = "_thumbDown_1axcd_1", q
116
122
  });
117
123
  };
118
124
  export {
119
- et as ThumbButtons,
120
- et as default
125
+ Mt as ThumbButtons,
126
+ Mt as default
121
127
  };
@@ -1,11 +1,12 @@
1
1
  import "@box/blueprint-web";
2
2
  import "@box/blueprint-web-assets/icons/Line";
3
+ import "@box/blueprint-web-assets/icons/Medium";
3
4
  import "clsx";
4
5
  import "react-intl";
5
6
  import "./messages.js";
6
- import { C, C as n } from "../../../../chunks/clear-conversation-button.js";
7
+ import { C as n, C as s } from "../../../../chunks/clear-conversation-button.js";
7
8
  import "react/jsx-runtime";
8
9
  export {
9
- C as ClearConversationButton,
10
- n as default
10
+ n as ClearConversationButton,
11
+ s as default
11
12
  };
@@ -1,168 +1,171 @@
1
- import { useBreakpoint as X, Breakpoint as Y, Modal as d, TooltipProvider as Z, Tooltip as ee } from "@box/blueprint-web";
2
- import { ArrowsCollapse as oe } from "@box/blueprint-web-assets/icons/Fill";
3
- import { BoxAiLogo as te } from "@box/blueprint-web-assets/icons/Logo";
4
- import { Size8 as v } from "@box/blueprint-web-assets/tokens/tokens";
5
- import { BoxAiAgentSelectorWithApi as se, AgentsProvider as ae } from "@box/box-ai-agent-selector";
6
- import { useState as le, useMemo as re, useCallback as I, useEffect as C } from "react";
7
- import { useIntl as ne } from "react-intl";
8
- import { BoxAiContentAnswers as ie } from "../../box-ai-content-answers.js";
9
- import { A as ce, R as de } from "../../../../chunks/types.js";
10
- import { LOGGER_BASE_CONFIG as p, LOGGER_ACTION_CLICK as me } from "../common/constants.js";
11
- import { s, C as ge } from "../../../../chunks/clear-conversation-button.js";
12
- import fe from "./hooks/useStopPropagationOnEsc.js";
13
- import { Title as ue } from "./title.js";
14
- import S from "./messages.js";
1
+ import { useBlueprintModernization as Y, useBreakpoint as Z, Breakpoint as ee, Modal as m, TooltipProvider as oe, Tooltip as te } from "@box/blueprint-web";
2
+ import { ArrowsCollapse as se } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { BoxAiLogo as ae } from "@box/blueprint-web-assets/icons/Logo";
4
+ import { ArrowsMinimize as re } from "@box/blueprint-web-assets/icons/Medium";
5
+ import { Size8 as S } from "@box/blueprint-web-assets/tokens/tokens";
6
+ import { BoxAiAgentSelectorWithApi as le, AgentsProvider as ne } from "@box/box-ai-agent-selector";
7
+ import { useState as ie, useMemo as ce, useCallback as x, useEffect as p } from "react";
8
+ import { useIntl as de } from "react-intl";
9
+ import { BoxAiContentAnswers as me } from "../../box-ai-content-answers.js";
10
+ import { A as fe, R as ge } from "../../../../chunks/types.js";
11
+ import { LOGGER_BASE_CONFIG as M, LOGGER_ACTION_CLICK as ue } from "../common/constants.js";
12
+ import { s, C as Ce } from "../../../../chunks/clear-conversation-button.js";
13
+ import pe from "./hooks/useStopPropagationOnEsc.js";
14
+ import { Title as Me } from "./title.js";
15
+ import B from "./messages.js";
15
16
  import { jsxs as h, jsx as e } from "react/jsx-runtime";
16
- const Ce = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", pe = (o) => o ? S.collapseModalAriaLabel : S.closeModalAriaLabel, he = (o) => o ? oe : void 0, Me = (o) => {
17
+ const he = (o) => o ? "Modal.Close-collapseContentAnswersModal" : "Modal.Close-closeContentAnswersModal", Te = (o) => o ? B.collapseModalAriaLabel : B.closeModalAriaLabel, be = (o, r) => o ? r ? re : se : void 0, Ae = (o, r) => {
17
18
  const l = o === "collapsible";
18
19
  return {
19
- closeModalLabel: pe(l),
20
- closeModalTargetId: Ce(l),
21
- closeModalIcon: he(l)
20
+ closeModalLabel: Te(l),
21
+ closeModalTargetId: he(l),
22
+ closeModalIcon: be(l, r)
22
23
  };
23
- }, Pe = ({
24
+ }, He = ({
24
25
  children: o,
25
- getAIStudioAgents: l,
26
- hasCustomSuggestedQuestions: x,
27
- hostAppName: m,
26
+ getAIStudioAgents: r,
27
+ hasCustomSuggestedQuestions: l,
28
+ hostAppName: f,
28
29
  isAIStudioAgentSelectorEnabled: g = !1,
29
- isDebugModeEnabled: B,
30
- isStopResponseEnabled: _ = !1,
31
- itemSize: M,
32
- extension: T,
33
- onClearAction: f,
34
- onSelectAgent: k,
35
- onSelectedAgentCallback: P,
36
- promptValue: q,
37
- recordAction: r,
30
+ isDebugModeEnabled: _,
31
+ isStopResponseEnabled: k = !1,
32
+ itemSize: T,
33
+ extension: b,
34
+ onClearAction: u,
35
+ onSelectAgent: P,
36
+ onSelectedAgentCallback: q,
37
+ promptValue: z,
38
+ recordAction: n,
38
39
  setPromptValue: G,
39
40
  shouldRenderProviders: H = !0,
40
- shouldShowLandingPage: z = !1,
41
- stopPropagationOnEsc: F,
42
- variant: b = "closable",
43
- items: i,
44
- parentItem: c,
45
- ...j
41
+ shouldShowLandingPage: F = !1,
42
+ stopPropagationOnEsc: j,
43
+ variant: A = "closable",
44
+ items: c,
45
+ parentItem: d,
46
+ ...D
46
47
  }) => {
47
- var w, E;
48
+ var v, I;
48
49
  const {
49
- open: L,
50
- defaultOpen: D,
51
- onOpenChange: Q,
52
- modal: U,
50
+ enableModernizedComponents: L
51
+ } = Y(), {
52
+ open: R,
53
+ defaultOpen: Q,
54
+ onOpenChange: U,
55
+ modal: W,
53
56
  ...a
54
- } = j, R = ne(), W = X() <= Y.Medium;
55
- fe(F, L);
56
- const u = (E = (w = a == null ? void 0 : a.questions) == null ? void 0 : w[a.questions.length - 1]) == null ? void 0 : E.error, [y, A] = le(!1), {
57
- closeModalLabel: O,
58
- closeModalTargetId: K,
59
- closeModalIcon: $
60
- } = re(() => Me(b), [b]), n = I((t) => {
61
- r && (t.data ?? (t.data = {}), t.data.hostAppName = m, r(t));
62
- }, [m, r]);
63
- C(() => {
64
- i || n({
65
- ...p,
57
+ } = D, O = de(), y = Z() <= ee.Medium;
58
+ pe(j, R);
59
+ const C = (I = (v = a == null ? void 0 : a.questions) == null ? void 0 : v[a.questions.length - 1]) == null ? void 0 : I.error, [K, w] = ie(!1), {
60
+ closeModalLabel: N,
61
+ closeModalTargetId: $,
62
+ closeModalIcon: J
63
+ } = ce(() => Ae(A, L), [A, L]), i = x((t) => {
64
+ n && (t.data ?? (t.data = {}), t.data.hostAppName = f, n(t));
65
+ }, [f, n]);
66
+ p(() => {
67
+ c || i({
68
+ ...M,
66
69
  target: "loaded",
67
70
  data: {
68
- fileSize: M,
69
- fileType: T
71
+ fileSize: T,
72
+ fileType: b
70
73
  }
71
74
  });
72
- }, [n, T, M, i, r]), C(() => {
73
- i && n({
74
- ...p,
75
+ }, [i, b, T, c, n]), p(() => {
76
+ c && i({
77
+ ...M,
75
78
  target: "loaded",
76
79
  data: {
77
- parentItemType: c == null ? void 0 : c.type,
78
- items: i.map((t) => ({
80
+ parentItemType: d == null ? void 0 : d.type,
81
+ items: c.map((t) => ({
79
82
  status: t.status,
80
83
  fileType: t.fileType
81
84
  }))
82
85
  }
83
86
  });
84
- }, [n, c, r]), C(() => {
85
- u && u === ce.AGENT_NOT_FOUND && A(!0);
86
- }, [u]);
87
- const J = () => {
88
- f && (f(), n({
89
- ...p,
90
- action: me,
87
+ }, [i, d, n]), p(() => {
88
+ C && C === fe.AGENT_NOT_FOUND && w(!0);
89
+ }, [C]);
90
+ const V = () => {
91
+ u && (u(), i({
92
+ ...M,
93
+ action: ue,
91
94
  target: "clearChat"
92
95
  }));
93
- }, V = I(async () => (A(!1), l()), [l]), N = /* @__PURE__ */ h(d, {
94
- defaultOpen: D,
95
- modal: U,
96
- onOpenChange: Q,
97
- open: L,
98
- children: [/* @__PURE__ */ e(d.Trigger, {
96
+ }, X = x(async () => (w(!1), r()), [r]), E = /* @__PURE__ */ h(m, {
97
+ defaultOpen: Q,
98
+ modal: W,
99
+ onOpenChange: U,
100
+ open: R,
101
+ children: [/* @__PURE__ */ e(m.Trigger, {
99
102
  children: o
100
- }), /* @__PURE__ */ h(d.Content, {
103
+ }), /* @__PURE__ */ h(m.Content, {
101
104
  className: s.contentAnswersModal,
102
105
  "data-testid": "content-answers-modal",
103
106
  size: "xlarge",
104
- children: [/* @__PURE__ */ e(d.Header, {
107
+ children: [/* @__PURE__ */ e(m.Header, {
105
108
  className: s.modalHeaderContainer,
106
109
  children: /* @__PURE__ */ h("div", {
107
110
  className: s.modalHeader,
108
- children: [!W && /* @__PURE__ */ e(te, {
111
+ children: [!y && /* @__PURE__ */ e(ae, {
109
112
  className: s.BoxAIIconColor,
110
113
  "data-testid": "content-answers-icon-color",
111
- height: v,
112
- width: v
113
- }), /* @__PURE__ */ e(ue, {
114
+ height: S,
115
+ width: S
116
+ }), /* @__PURE__ */ e(Me, {
114
117
  isAIStudioAgentSelectorEnabled: g
115
- }), g && /* @__PURE__ */ e(se, {
118
+ }), g && /* @__PURE__ */ e(le, {
116
119
  contentClassName: s.agentSelectorContent,
117
120
  disabled: a.hasRequestInProgress,
118
- fetcher: V,
119
- hostAppName: m,
120
- onSelectAgent: k,
121
- onSelectedAgentCallback: P,
122
- recordAction: r,
123
- requestState: y ? de.ERROR : void 0,
121
+ fetcher: X,
122
+ hostAppName: f,
123
+ onSelectAgent: P,
124
+ onSelectedAgentCallback: q,
125
+ recordAction: n,
126
+ requestState: K ? ge.ERROR : void 0,
124
127
  shouldHideAgentSelectorOnLoad: !0,
125
128
  triggerChipClassName: s.agentSelectorTrigger,
126
129
  useAgentLocalStorage: !0
127
130
  })]
128
131
  })
129
- }), /* @__PURE__ */ e(ie, {
132
+ }), /* @__PURE__ */ e(me, {
130
133
  className: `box-content-answers-chat-container ${s.boxAiContentAnswers}`,
131
- hasCustomSuggestedQuestions: x,
132
- hostAppName: m,
134
+ hasCustomSuggestedQuestions: l,
135
+ hostAppName: f,
133
136
  isAIStudioAgentSelectorEnabled: g,
134
- isDebugModeEnabled: B,
135
- isStopResponseEnabled: _,
136
- items: i,
137
- parentItem: c,
138
- promptValue: q,
139
- recordAction: n,
137
+ isDebugModeEnabled: _,
138
+ isStopResponseEnabled: k,
139
+ items: c,
140
+ parentItem: d,
141
+ promptValue: z,
142
+ recordAction: i,
140
143
  setPromptValue: G,
141
- shouldShowLandingPage: z,
144
+ shouldShowLandingPage: F,
142
145
  ...a
143
- }), f && /* @__PURE__ */ e(ge, {
146
+ }), u && /* @__PURE__ */ e(Ce, {
144
147
  hasRequestInProgress: a.hasRequestInProgress,
145
- onClick: J
146
- }), /* @__PURE__ */ e(Z, {
147
- children: /* @__PURE__ */ e(ee, {
148
- content: R.formatMessage(O),
148
+ onClick: V
149
+ }), /* @__PURE__ */ e(oe, {
150
+ children: /* @__PURE__ */ e(te, {
151
+ content: O.formatMessage(N),
149
152
  "data-testid": "content-answers-close-modal-tooltip",
150
- children: /* @__PURE__ */ e(d.Close, {
151
- "aria-label": R.formatMessage(O),
153
+ children: /* @__PURE__ */ e(m.Close, {
154
+ "aria-label": O.formatMessage(N),
152
155
  className: s["modal-close-button"],
153
- "data-target-id": K,
154
- icon: $,
156
+ "data-target-id": $,
157
+ icon: J,
155
158
  size: "small"
156
159
  })
157
160
  })
158
161
  })]
159
162
  })]
160
163
  });
161
- return H ? /* @__PURE__ */ e(ae, {
162
- children: N
163
- }) : N;
164
+ return H ? /* @__PURE__ */ e(ne, {
165
+ children: E
166
+ }) : E;
164
167
  };
165
168
  export {
166
- Pe as IntelligenceModal,
167
- Pe as default
169
+ He as IntelligenceModal,
170
+ He as default
168
171
  };
@@ -1,64 +1,65 @@
1
- import { Text as ne, Tooltip as y, IconButton as H } from "@box/blueprint-web";
2
- import { ArrowsExpand as se, XMark as ae } from "@box/blueprint-web-assets/icons/Fill";
3
- import { useAgents as ie, BoxAiAgentSelectorWithApi as re } from "@box/box-ai-agent-selector";
1
+ import { useBlueprintModernization as se, Text as ae, Tooltip as $, IconButton as y } from "@box/blueprint-web";
2
+ import { ArrowsExpand as ie, XMark as re } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { ArrowsMaximize as ce } from "@box/blueprint-web-assets/icons/Medium";
4
+ import { useAgents as de, BoxAiAgentSelectorWithApi as le } from "@box/box-ai-agent-selector";
4
5
  import D from "clsx";
5
- import Q from "lodash/isEqual";
6
+ import H from "lodash/isEqual";
6
7
  import * as b from "react";
7
- import { useIntl as ce } from "react-intl";
8
- import { BoxAiContentAnswers as de } from "../../box-ai-content-answers.js";
9
- import { withApiWrapper as le } from "../api-wrapper/api-wrapper.js";
10
- import { ORIGIN_BOXAI_SIDEBAR as be, EVENT_JS_READY as pe } from "../common/constants.js";
11
- import { mark as Se } from "../common/performance.js";
12
- import { C as Ae } from "../../../../chunks/clear-conversation-button.js";
13
- import { IntelligenceModal as me } from "../modal/modal.js";
14
- import { IntelligenceSidebarContext as he } from "./context.js";
8
+ import { useIntl as be } from "react-intl";
9
+ import { BoxAiContentAnswers as pe } from "../../box-ai-content-answers.js";
10
+ import { withApiWrapper as Se } from "../api-wrapper/api-wrapper.js";
11
+ import { ORIGIN_BOXAI_SIDEBAR as Ae, EVENT_JS_READY as me } from "../common/constants.js";
12
+ import { mark as he } from "../common/performance.js";
13
+ import { C as ue } from "../../../../chunks/clear-conversation-button.js";
14
+ import { IntelligenceModal as Ie } from "../modal/modal.js";
15
+ import { IntelligenceSidebarContext as _e } from "./context.js";
15
16
  import p from "./messages.js";
16
- import Ie from "./title.js";
17
- import { jsxs as h, Fragment as z, jsx as e } from "react/jsx-runtime";
18
- import '../../../../styles/content.css';const ue = "_bcsSidebarBase_1kkpe_2", _e = "_bcsContent_1kkpe_2", Ce = "_bcsBoxAISidebar_1kkpe_2", xe = "_bcsContentHeader_1kkpe_6", ge = "_bcsTitle_1kkpe_15", Be = "_bcsScrollContent_1kkpe_22", fe = "_withModalOpen_1kkpe_32", ke = "_bcsBoxAISidebarAgentSelector_1kkpe_35", we = "_bcsBoxAISidebarAgentSelectorContainer_1kkpe_39", Te = "_bcsBoxAISidebarChatActions_1kkpe_43", Ee = "_bcsBoxAISidebarContent_1kkpe_47", Ne = "_bcsBoxAISidebarExpand_1kkpe_50", ve = "_bcsBoxAISidebarClear_1kkpe_53", Pe = "_bcsBoxAISidebarTitlePart_1kkpe_56", Me = "_bcsBoxAISidebarClose_1kkpe_77", Le = "_sidebarChip_1kkpe_88", Oe = "_bcsContentSubheader_1kkpe_101", Re = "_bcsScrollContentWrapper_1kkpe_110", qe = "_withSubheader_1kkpe_115", Ue = "_expanded_1kkpe_118", t = {
19
- bcsSidebarBase: ue,
20
- bcsContent: _e,
21
- bcsBoxAISidebar: Ce,
22
- bcsContentHeader: xe,
23
- bcsTitle: ge,
24
- bcsScrollContent: Be,
25
- withModalOpen: fe,
26
- bcsBoxAISidebarAgentSelector: ke,
27
- bcsBoxAISidebarAgentSelectorContainer: we,
28
- bcsBoxAISidebarChatActions: Te,
29
- bcsBoxAISidebarContent: Ee,
30
- bcsBoxAISidebarExpand: Ne,
31
- bcsBoxAISidebarClear: ve,
32
- bcsBoxAISidebarTitlePart: Pe,
33
- bcsBoxAISidebarClose: Me,
34
- sidebarChip: Le,
35
- bcsContentSubheader: Oe,
36
- bcsScrollContentWrapper: Re,
37
- withSubheader: qe,
38
- expanded: Ue
39
- }, Ve = `${be}_${pe}`;
40
- Se(Ve);
41
- const We = ({
17
+ import Ce from "./title.js";
18
+ import { jsxs as h, Fragment as Q, jsx as e } from "react/jsx-runtime";
19
+ import '../../../../styles/content.css';const xe = "_bcsSidebarBase_1kkpe_2", ge = "_bcsContent_1kkpe_2", Be = "_bcsBoxAISidebar_1kkpe_2", fe = "_bcsContentHeader_1kkpe_6", ke = "_bcsTitle_1kkpe_15", we = "_bcsScrollContent_1kkpe_22", Te = "_withModalOpen_1kkpe_32", Ee = "_bcsBoxAISidebarAgentSelector_1kkpe_35", Ne = "_bcsBoxAISidebarAgentSelectorContainer_1kkpe_39", Me = "_bcsBoxAISidebarChatActions_1kkpe_43", ve = "_bcsBoxAISidebarContent_1kkpe_47", Pe = "_bcsBoxAISidebarExpand_1kkpe_50", Le = "_bcsBoxAISidebarClear_1kkpe_53", Oe = "_bcsBoxAISidebarTitlePart_1kkpe_56", Re = "_bcsBoxAISidebarClose_1kkpe_77", qe = "_sidebarChip_1kkpe_88", Ue = "_bcsContentSubheader_1kkpe_101", Ve = "_bcsScrollContentWrapper_1kkpe_110", We = "_withSubheader_1kkpe_115", ze = "_expanded_1kkpe_118", t = {
20
+ bcsSidebarBase: xe,
21
+ bcsContent: ge,
22
+ bcsBoxAISidebar: Be,
23
+ bcsContentHeader: fe,
24
+ bcsTitle: ke,
25
+ bcsScrollContent: we,
26
+ withModalOpen: Te,
27
+ bcsBoxAISidebarAgentSelector: Ee,
28
+ bcsBoxAISidebarAgentSelectorContainer: Ne,
29
+ bcsBoxAISidebarChatActions: Me,
30
+ bcsBoxAISidebarContent: ve,
31
+ bcsBoxAISidebarExpand: Pe,
32
+ bcsBoxAISidebarClear: Le,
33
+ bcsBoxAISidebarTitlePart: Oe,
34
+ bcsBoxAISidebarClose: Re,
35
+ sidebarChip: qe,
36
+ bcsContentSubheader: Ue,
37
+ bcsScrollContentWrapper: Ve,
38
+ withSubheader: We,
39
+ expanded: ze
40
+ }, Fe = `${Ae}_${me}`;
41
+ he(Fe);
42
+ const $e = ({
42
43
  actions: f,
43
44
  children: i,
44
45
  className: o,
45
46
  elementId: S = "",
46
- sidebarView: I = "",
47
+ sidebarView: u = "",
47
48
  title: r,
48
49
  subheader: c,
49
50
  ...d
50
51
  }) => {
51
- const A = `${S}${S === "" ? "" : "_"}${I}`, u = `${A}-content`;
52
+ const A = `${S}${S === "" ? "" : "_"}${u}`, I = `${A}-content`;
52
53
  return /* @__PURE__ */ h("div", {
53
54
  "aria-labelledby": A,
54
55
  className: D(t.bcsContent, o),
55
56
  "data-testid": "bcs-content",
56
- id: u,
57
+ id: I,
57
58
  role: "tabpanel",
58
59
  ...d,
59
60
  children: [/* @__PURE__ */ h("div", {
60
61
  className: t.bcsContentHeader,
61
- children: [r && /* @__PURE__ */ e(ne, {
62
+ children: [r && /* @__PURE__ */ e(ae, {
62
63
  as: "h3",
63
64
  className: t.bcsTitle,
64
65
  children: r
@@ -75,59 +76,61 @@ const We = ({
75
76
  })]
76
77
  });
77
78
  };
78
- function Fe(f) {
79
+ function ye(f) {
79
80
  const {
80
81
  createSession: i,
81
82
  encodedSession: o,
82
83
  onClearAction: S,
83
- getAIStudioAgents: I,
84
+ getAIStudioAgents: u,
84
85
  hasRequestInProgress: r,
85
86
  hostAppName: c,
86
87
  isAIStudioAgentSelectorEnabled: d,
87
88
  isLoading: A,
88
- onSelectAgent: u,
89
+ onSelectAgent: I,
89
90
  questions: _,
90
91
  shouldShowLandingPage: N = !0,
91
92
  sendQuestion: C,
92
93
  stopQuestion: k,
93
94
  embedTheAnswerButtonConfig: j,
94
- onClose: v,
95
- ...P
95
+ onClose: M,
96
+ ...v
96
97
  } = f, {
97
98
  formatMessage: l
98
- } = ce(), M = b.useRef(!1), [w, L] = b.useState(!1), {
99
+ } = be(), {
100
+ enableModernizedComponents: J
101
+ } = se(), P = b.useRef(!1), [w, L] = b.useState(!1), {
99
102
  cache: s,
100
103
  contentName: O,
101
- elementId: J,
102
- fileExtension: X,
104
+ elementId: X,
105
+ fileExtension: Y,
103
106
  isFeedbackEnabled: R,
104
107
  isFeedbackFormEnabled: q,
105
108
  isStopResponseEnabled: U,
106
109
  items: T,
107
- itemSize: Y,
110
+ itemSize: G,
108
111
  onFeedbackFormSubmit: V,
109
112
  onUserInteraction: W,
110
- onSelectedAgentCallback: G,
113
+ onSelectedAgentCallback: K,
111
114
  recordAction: m,
112
115
  setCacheValue: x,
113
116
  shouldPreinitSession: g
114
- } = b.useContext(he), {
115
- agents: K,
116
- requestState: Z,
117
+ } = b.useContext(_e), {
118
+ agents: Z,
119
+ requestState: ee,
117
120
  selectedAgent: E
118
- } = ie(), {
121
+ } = de(), {
119
122
  questions: a
120
- } = s, [F, $] = b.useState("");
121
- s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o), Q(s.questions, _) || x("questions", _), Q(s.agents.selectedAgent, E) || x("agents", {
122
- agents: K,
123
- requestState: Z,
123
+ } = s, [z, F] = b.useState("");
124
+ s.shouldShowLandingPage !== N && x("shouldShowLandingPage", N), s.encodedSession !== o && x("encodedSession", o), H(s.questions, _) || x("questions", _), H(s.agents.selectedAgent, E) || x("agents", {
125
+ agents: Z,
126
+ requestState: ee,
124
127
  selectedAgent: E
125
128
  });
126
129
  const B = (n = !1) => {
127
130
  !g && !o && !A && i && i(!0, !1), n && W && W();
128
- }, ee = () => {
129
- L(!1);
130
131
  }, te = () => {
132
+ L(!1);
133
+ }, oe = () => {
131
134
  B(), L(!0);
132
135
  };
133
136
  b.useEffect(() => (g && !o && i && i(!0, !0), o && a.length > 0 && a[a.length - 1].isCompleted === !1 && C({
@@ -147,21 +150,21 @@ function Fe(f) {
147
150
  k();
148
151
  }), []), b.useEffect(() => {
149
152
  const n = a[a.length - 1];
150
- !g && !M.current && o && (n != null && n.isLoading) && (C(n, E, !1), M.current = !0);
153
+ !g && !P.current && o && (n != null && n.isLoading) && (C(n, E, !1), P.current = !0);
151
154
  }, [o]);
152
- const oe = () => /* @__PURE__ */ h("div", {
155
+ const ne = () => /* @__PURE__ */ h("div", {
153
156
  className: t.bcsBoxAISidebarTitlePart,
154
- children: [/* @__PURE__ */ e(Ie, {
157
+ children: [/* @__PURE__ */ e(Ce, {
155
158
  isAIStudioAgentSelectorEnabled: d
156
159
  }), d && /* @__PURE__ */ e("div", {
157
160
  className: t.bcsBoxAISidebarAgentSelector,
158
- children: /* @__PURE__ */ e(re, {
161
+ children: /* @__PURE__ */ e(le, {
159
162
  disabled: r,
160
- fetcher: I,
163
+ fetcher: u,
161
164
  hostAppName: c,
162
165
  onAgentsListOpen: B,
163
- onSelectAgent: u,
164
- onSelectedAgentCallback: G,
166
+ onSelectAgent: I,
167
+ onSelectedAgentCallback: K,
165
168
  recordAction: m,
166
169
  shouldHideAgentSelectorOnLoad: !0,
167
170
  useAgentLocalStorage: !0,
@@ -169,35 +172,35 @@ function Fe(f) {
169
172
  })
170
173
  })]
171
174
  });
172
- return /* @__PURE__ */ h(z, {
173
- children: [/* @__PURE__ */ e(We, {
174
- actions: /* @__PURE__ */ h(z, {
175
- children: [oe(), /* @__PURE__ */ e(Ae, {
175
+ return /* @__PURE__ */ h(Q, {
176
+ children: [/* @__PURE__ */ e($e, {
177
+ actions: /* @__PURE__ */ h(Q, {
178
+ children: [ne(), /* @__PURE__ */ e(ue, {
176
179
  className: t.bcsBoxAISidebarClear,
177
180
  hasRequestInProgress: r,
178
181
  onClick: S
179
- }), /* @__PURE__ */ e(y, {
182
+ }), /* @__PURE__ */ e($, {
180
183
  content: l(p.sidebarBoxAISwitchToModalView),
181
184
  "data-testid": "content-answers-open-modal-tooltip",
182
185
  variant: "standard",
183
- children: /* @__PURE__ */ e(H, {
186
+ children: /* @__PURE__ */ e(y, {
184
187
  "aria-label": l(p.sidebarBoxAISwitchToModalView),
185
188
  className: t.bcsBoxAISidebarExpand,
186
189
  "data-target-id": "IconButton-expandBoxAISidebar",
187
- icon: se,
188
- onClick: te,
190
+ icon: J ? ce : ie,
191
+ onClick: oe,
189
192
  size: "small"
190
193
  })
191
- }), v && /* @__PURE__ */ e(y, {
194
+ }), M && /* @__PURE__ */ e($, {
192
195
  content: l(p.sidebarBoxAIClose),
193
196
  "data-testid": "content-answers-close-tooltip",
194
197
  variant: "standard",
195
- children: /* @__PURE__ */ e(H, {
198
+ children: /* @__PURE__ */ e(y, {
196
199
  "aria-label": l(p.sidebarBoxAIClose),
197
200
  className: t.bcsBoxAISidebarClose,
198
201
  "data-target-id": "IconButton-closeBoxAISidebar",
199
- icon: ae,
200
- onClick: v,
202
+ icon: re,
203
+ onClick: M,
201
204
  size: "small"
202
205
  })
203
206
  })]
@@ -205,11 +208,11 @@ function Fe(f) {
205
208
  className: D(t.bcsBoxAISidebar, {
206
209
  [t.withModalOpen]: w
207
210
  }),
208
- elementId: J,
211
+ elementId: X,
209
212
  sidebarView: "box-ai",
210
213
  children: /* @__PURE__ */ e("div", {
211
214
  className: t.bcsBoxAISidebarContent,
212
- children: /* @__PURE__ */ e(de, {
215
+ children: /* @__PURE__ */ e(pe, {
213
216
  className: t.bcsBoxAISidebarContentAnswers,
214
217
  contentName: O,
215
218
  contentType: l(p.sidebarBoxAIContent),
@@ -222,23 +225,23 @@ function Fe(f) {
222
225
  items: T,
223
226
  onFeedbackFormSubmit: V,
224
227
  onUserIntentToUseAI: B,
225
- promptValue: F,
228
+ promptValue: z,
226
229
  questions: _,
227
230
  recordAction: m,
228
- setPromptValue: $,
231
+ setPromptValue: F,
229
232
  shouldShowLandingPage: s.shouldShowLandingPage,
230
233
  showLoadingIndicator: A && g,
231
234
  stopQuestion: k,
232
235
  submitQuestion: C,
233
236
  variant: "sidebar",
234
- ...P
237
+ ...v
235
238
  })
236
239
  })
237
- }), /* @__PURE__ */ e(me, {
240
+ }), /* @__PURE__ */ e(Ie, {
238
241
  contentName: O,
239
242
  contentType: l(p.sidebarBoxAIContent),
240
- extension: X,
241
- getAIStudioAgents: I,
243
+ extension: Y,
244
+ getAIStudioAgents: u,
242
245
  hasRequestInProgress: r,
243
246
  hostAppName: c,
244
247
  isAIStudioAgentSelectorEnabled: d,
@@ -246,29 +249,29 @@ function Fe(f) {
246
249
  isFeedbackFormEnabled: q,
247
250
  isStopResponseEnabled: U,
248
251
  items: T,
249
- itemSize: Y,
252
+ itemSize: G,
250
253
  onClearAction: S,
251
254
  onFeedbackFormSubmit: V,
252
- onOpenChange: ee,
253
- onSelectAgent: u,
255
+ onOpenChange: te,
256
+ onSelectAgent: I,
254
257
  onUserIntentToUseAI: B,
255
258
  open: w,
256
- promptValue: F,
259
+ promptValue: z,
257
260
  questions: _,
258
261
  recordAction: w ? m : void 0,
259
- setPromptValue: $,
262
+ setPromptValue: F,
260
263
  shouldShowLandingPage: s.shouldShowLandingPage,
261
264
  showLoadingIndicator: !1,
262
265
  stopPropagationOnEsc: !0,
263
266
  stopQuestion: k,
264
267
  submitQuestion: C,
265
268
  variant: "collapsible",
266
- ...P,
269
+ ...v,
267
270
  shouldRenderProviders: !1
268
271
  })]
269
272
  });
270
273
  }
271
- const st = le(Fe);
274
+ const ct = Se(ye);
272
275
  export {
273
- st as default
276
+ ct as default
274
277
  };
@@ -1 +1 @@
1
- ._questionInput_kn61g_2{position:relative;z-index:1;align-items:end;margin:1rem;padding:0;background:#fff;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:1px solid #d3d3d3!important;border-radius:1.25rem!important;box-shadow:0 2px 12px #2222221f}._questionInput_kn61g_2._questionInputWithOutPromptLibrary_kn61g_15{display:flex;flex:1 1 auto;border-radius:1.5rem!important}._questionInput_kn61g_2:hover{background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;border:1px solid rgba(0,0,0,0)!important}._questionInput_kn61g_2:focus-within{box-sizing:unset!important;margin:calc(1rem - 1px);background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;border:2px solid rgba(0,0,0,0)!important}._questionInput_kn61g_2 ._avatar_kn61g_30{margin-bottom:.25rem}._questionInput_kn61g_2 ._inputAreaButton_kn61g_33{position:absolute;right:0;margin-right:.25rem;margin-bottom:.25rem;background:linear-gradient(135deg,#fe03dc,#2784fa);border:0;border-radius:1.5rem!important}._questionInput_kn61g_2 ._inputAreaButton_kn61g_33:disabled{background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_kn61g_2 ._inputAreaButton_kn61g_33:not(:disabled):hover,._questionInput_kn61g_2 ._inputAreaButton_kn61g_33:not(:disabled):active{background:linear-gradient(135deg,#cb02b0,#1f6ac8);border:0}._questionInput_kn61g_2 ._square_kn61g_49{display:inline-block;width:15px;height:15px;background-color:#fff;border-radius:3px}._questionInput_kn61g_2 ._textArea_kn61g_56{gap:0;width:100%;margin:0 1rem 0 0;padding-right:46px;box-shadow:none}._questionInput_kn61g_2 ._textArea_kn61g_56 div{box-shadow:none!important}._questionInput_kn61g_2 ._textArea_kn61g_56 span{padding:.5rem .75rem .75rem;margin-block-start:0}._questionInput_kn61g_2 ._textArea_kn61g_56 textarea{width:100%;margin:.475rem 0;padding:.4rem 1rem;background:inherit;border:none;border-radius:1.25rem;box-shadow:none}._questionInput_kn61g_2 ._textArea_kn61g_56 textarea:not(:disabled):not(:focus-visible):not(._error_kn61g_79):hover{background:inherit}._questionInput_kn61g_2._sidebar_kn61g_82 ._textArea_kn61g_56{padding-right:26px}._questionInput_kn61g_2._sidebar_kn61g_82 ._textArea_kn61g_56 div{align-items:center;height:100%}._submitButtonTooltip_kn61g_90{text-align:center}@media (max-width: 767px){._questionInput_kn61g_2 ._textArea_kn61g_56{margin:0 .75rem 0 0}}._actionContainer_kn61g_99{display:flex;justify-content:space-between;margin:0 0 0 .25rem}._promptButton_kn61g_105{margin-bottom:.25rem;color:#6f6f6f;background-color:#fff!important;border:1px solid rgba(0,0,0,.08)}
1
+ ._questionInput_w27x6_2{position:relative;z-index:1;align-items:end;min-height:3rem;margin:1rem;padding:0;background:#fff;background-clip:padding-box,border-box!important;background-origin:border-box!important;border:1px solid #d3d3d3!important;border-radius:1.25rem!important;box-shadow:0 2px 12px #2222221f}._questionInput_w27x6_2._questionInputWithOutPromptLibrary_w27x6_16{display:flex;flex:1 1 auto;border-radius:1.5rem!important}._questionInput_w27x6_2:hover{background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;border:1px solid rgba(0,0,0,0)!important}._questionInput_w27x6_2:focus-within{box-sizing:unset!important;margin:calc(1rem - 1px);background-image:linear-gradient(#fff,#fff),linear-gradient(135deg,#fe03dc,#2784fa)!important;border:2px solid rgba(0,0,0,0)!important}._questionInput_w27x6_2 ._avatar_w27x6_31{margin-bottom:.25rem}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34{position:absolute;right:0;margin-right:.25rem;margin-bottom:.25rem;background:linear-gradient(135deg,#fe03dc,#2784fa);border:0;border-radius:1.5rem!important}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:disabled{background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):hover,._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):active{background:linear-gradient(135deg,#cb02b0,#1f6ac8);border:0}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):focus,._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):focus-visible{background:linear-gradient(135deg,#fe03dc,#2784fa)}._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):hover:focus,._questionInput_w27x6_2 ._inputAreaButton_w27x6_34:not(:disabled):hover:focus-visible{background:linear-gradient(135deg,#cb02b0,#1f6ac8)}._questionInput_w27x6_2 ._square_w27x6_56{display:inline-block;width:15px;height:15px;background-color:#fff;border-radius:3px}._questionInput_w27x6_2 ._textArea_w27x6_63{gap:0;width:100%;margin:0 1rem 0 0;padding-right:46px;box-shadow:none}._questionInput_w27x6_2 ._textArea_w27x6_63 div{box-shadow:none!important}._questionInput_w27x6_2 ._textArea_w27x6_63 span{padding:.5rem .75rem .75rem;margin-block-start:0}._questionInput_w27x6_2 ._textArea_w27x6_63 textarea{width:100%;margin:.475rem 0;padding:.4rem 1rem;background:inherit;border:none;border-radius:1.25rem;box-shadow:none}._questionInput_w27x6_2 ._textArea_w27x6_63 textarea:not(:disabled):not(:focus-visible):not(._error_w27x6_86):hover{background:inherit}._questionInput_w27x6_2._sidebar_w27x6_89 ._textArea_w27x6_63{padding-right:26px}._questionInput_w27x6_2._sidebar_w27x6_89 ._textArea_w27x6_63 div{align-items:center;height:100%}._submitButtonTooltip_w27x6_97{text-align:center}@media (max-width: 767px){._questionInput_w27x6_2 ._textArea_w27x6_63{margin:0 .75rem 0 0}}._actionContainer_w27x6_106{display:flex;justify-content:space-between;margin:0 0 0 .25rem}._promptButton_w27x6_112{margin-bottom:.25rem;color:#6f6f6f;background-color:#fff!important;border:1px solid rgba(0,0,0,.08)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.56.1",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^12.93.4",
21
- "@box/blueprint-web-assets": "^4.78.0",
22
- "@box/box-ai-agent-selector": "^1.7.0",
23
- "@box/item-icon": "^1.8.0",
24
- "@box/storybook-utils": "^0.14.15",
20
+ "@box/blueprint-web": "^12.93.6",
21
+ "@box/blueprint-web-assets": "^4.79.0",
22
+ "@box/box-ai-agent-selector": "^1.7.2",
23
+ "@box/item-icon": "^1.8.2",
24
+ "@box/storybook-utils": "^0.14.16",
25
25
  "@testing-library/react": "^15.0.6",
26
26
  "react": "^18.3.0",
27
27
  "react-dom": "^18.3.0",