@box/box-ai-content-answers 1.10.4 → 1.11.1

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
  };