@box/box-ai-content-answers 0.150.0 → 0.151.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.
Files changed (46) hide show
  1. package/dist/chunks/markdown.module.js +19 -0
  2. package/dist/esm/lib/components/answer/answer.js +123 -127
  3. package/dist/esm/lib/components/answer/messages.js +4 -0
  4. package/dist/esm/lib/components/answer/thumb-buttons.js +31 -31
  5. package/dist/esm/lib/components/common/inline-citation.js +47 -0
  6. package/dist/esm/lib/components/common/markdown-react.js +81 -59
  7. package/dist/esm/lib/components/common/markdown.js +723 -721
  8. package/dist/esm/lib/utils/inlineCitationsUtils.js +36 -0
  9. package/dist/i18n/bn-IN.js +1 -0
  10. package/dist/i18n/da-DK.js +1 -0
  11. package/dist/i18n/de-DE.js +1 -0
  12. package/dist/i18n/en-AU.js +1 -0
  13. package/dist/i18n/en-CA.js +1 -0
  14. package/dist/i18n/en-GB.js +1 -0
  15. package/dist/i18n/en-US.js +1 -0
  16. package/dist/i18n/en-US.properties +2 -0
  17. package/dist/i18n/en-x-pseudo.js +1 -0
  18. package/dist/i18n/es-419.js +1 -0
  19. package/dist/i18n/es-ES.js +1 -0
  20. package/dist/i18n/fi-FI.js +1 -0
  21. package/dist/i18n/fr-CA.js +1 -0
  22. package/dist/i18n/fr-FR.js +1 -0
  23. package/dist/i18n/hi-IN.js +1 -0
  24. package/dist/i18n/it-IT.js +1 -0
  25. package/dist/i18n/ja-JP.js +1 -0
  26. package/dist/i18n/json/src/lib/components/answer/messages.json +1 -1
  27. package/dist/i18n/ko-KR.js +1 -0
  28. package/dist/i18n/nb-NO.js +1 -0
  29. package/dist/i18n/nl-NL.js +1 -0
  30. package/dist/i18n/pl-PL.js +1 -0
  31. package/dist/i18n/pt-BR.js +1 -0
  32. package/dist/i18n/ru-RU.js +1 -0
  33. package/dist/i18n/sv-SE.js +1 -0
  34. package/dist/i18n/tr-TR.js +1 -0
  35. package/dist/i18n/zh-CN.js +1 -0
  36. package/dist/i18n/zh-TW.js +1 -0
  37. package/dist/styles/markdown.css +1 -7
  38. package/dist/styles/markdown2.css +7 -0
  39. package/dist/types/lib/components/answer/answer.d.ts +1 -2
  40. package/dist/types/lib/components/answer/messages.d.ts +5 -0
  41. package/dist/types/lib/components/answer/stories/shared.d.ts +15 -3
  42. package/dist/types/lib/components/common/inline-citation.d.ts +7 -0
  43. package/dist/types/lib/utils/inlineCitationsUtils.d.ts +17 -0
  44. package/package.json +1 -1
  45. package/dist/esm/lib/utils/getBoxLinks.js +0 -13
  46. package/dist/types/lib/utils/getBoxLinks.d.ts +0 -15
@@ -0,0 +1,19 @@
1
+ import '../styles/markdown.css';const n = "_markdownContent_hd94b_1", i = "_inlineParagraph_hd94b_5", t = "_tableWrapper_hd94b_11", e = "_hljs_hd94b_38", l = "_hljsLanguage_hd94b_50", _ = "_hljsContent_hd94b_63", a = "_hljsLine_hd94b_68", o = "_hljsLineNumber_hd94b_73", h = "_hljsLineContent_hd94b_85", s = "_inlineCitationGroup_hd94b_90", b = {
2
+ markdownContent: n,
3
+ inlineParagraph: i,
4
+ tableWrapper: t,
5
+ hljs: e,
6
+ hljsLanguage: l,
7
+ hljsContent: _,
8
+ hljsLine: a,
9
+ hljsLineNumber: o,
10
+ hljsLineContent: h,
11
+ inlineCitationGroup: s,
12
+ "inline-citation-chip-button": "_inline-citation-chip-button_hd94b_95",
13
+ "inline-citation-file-icon": "_inline-citation-file-icon_hd94b_104",
14
+ "bp-filter-chip-label": "_bp-filter-chip-label_hd94b_109",
15
+ "inline-citation-filename-label": "_inline-citation-filename-label_hd94b_110"
16
+ };
17
+ export {
18
+ b as s
19
+ };
@@ -1,170 +1,166 @@
1
- import { Text as J } from "@box/blueprint-web";
2
- import { AlertTriangle as K } from "@box/blueprint-web-assets/icons/Line";
3
- import { Gray65 as Q, Size4 as g } from "@box/blueprint-web-assets/tokens/tokens";
4
- import S from "clsx";
5
- import * as f from "react";
6
- import { useIntl as X } from "react-intl";
7
- import { A as e } from "../../../../chunks/types.js";
8
- import { extractBoxLinks as Y, extractFileNames as Z } from "../../utils/getBoxLinks.js";
9
- import { MediaContainer as R } from "../common/media-container.js";
1
+ import { Text as q } from "@box/blueprint-web";
2
+ import { AlertTriangle as J } from "@box/blueprint-web-assets/icons/Line";
3
+ import { Gray65 as K, Size4 as N } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import I from "clsx";
5
+ import { memo as Q, useState as X, useEffect as S, useMemo as Y } from "react";
6
+ import { useIntl as Z } from "react-intl";
7
+ import { A as r } from "../../../../chunks/types.js";
8
+ import { injectInlineCitation as $ } from "../../utils/inlineCitationsUtils.js";
9
+ import { MediaContainer as g } from "../common/media-container.js";
10
10
  import { AnswerContent as tt } from "./answer-content.js";
11
11
  import { CopyButton as ot } from "./copy-button.js";
12
- import { InlineError as nt } from "./inline-error.js";
13
- import { LoadingIndicator as et } from "./loading-indicator.js";
14
- import h from "./messages.js";
12
+ import { InlineError as et } from "./inline-error.js";
13
+ import { LoadingIndicator as nt } from "./loading-indicator.js";
14
+ import f from "./messages.js";
15
15
  import { References as rt } from "./references.js";
16
16
  import { ThumbButtons as st } from "./thumb-buttons.js";
17
- import { jsxs as d, jsx as n } from "react/jsx-runtime";
18
- import '../../../../styles/answer.css';const at = "_answer_140hd_1", it = "_alertIcon_140hd_5", lt = "_error_140hd_8", ct = "_footer_140hd_12", dt = "_copyButtonContainer_140hd_18", ft = "_feedbackButtonsContainer_140hd_19", ut = "_shouldHaveMarginTop_140hd_23", mt = "_shouldUseAnimation_140hd_26", _t = "_shouldAnimateHeight_140hd_30", ht = "_footerButtons_140hd_34", Et = "_iconAvatar_140hd_40", pt = "_buttonsVisible_140hd_56", t = {
17
+ import { jsxs as l, jsx as n } from "react/jsx-runtime";
18
+ import '../../../../styles/answer.css';const at = "_answer_140hd_1", it = "_alertIcon_140hd_5", ct = "_error_140hd_8", lt = "_footer_140hd_12", dt = "_copyButtonContainer_140hd_18", ut = "_feedbackButtonsContainer_140hd_19", ft = "_shouldHaveMarginTop_140hd_23", mt = "_shouldUseAnimation_140hd_26", _t = "_shouldAnimateHeight_140hd_30", ht = "_footerButtons_140hd_34", Et = "_iconAvatar_140hd_40", pt = "_buttonsVisible_140hd_56", o = {
19
19
  answer: at,
20
20
  alertIcon: it,
21
- error: lt,
22
- footer: ct,
21
+ error: ct,
22
+ footer: lt,
23
23
  copyButtonContainer: dt,
24
- feedbackButtonsContainer: ft,
25
- shouldHaveMarginTop: ut,
24
+ feedbackButtonsContainer: ut,
25
+ shouldHaveMarginTop: ft,
26
26
  shouldUseAnimation: mt,
27
27
  shouldAnimateHeight: _t,
28
28
  footerButtons: ht,
29
29
  iconAvatar: Et,
30
30
  buttonsVisible: pt
31
- }, Nt = /* @__PURE__ */ new Set([e.RATE_LIMITING, e.NO_CONTENT, e.PRECONDITION_FAILED, e.GENERAL, e.AGENT_NOT_FOUND]), Dt = /* @__PURE__ */ f.memo(({
32
- answer: r,
33
- citations: T,
34
- error: o,
35
- contentType: A,
36
- hostAppName: u,
37
- feedbackValue: b,
31
+ }, Nt = /* @__PURE__ */ new Set([r.RATE_LIMITING, r.NO_CONTENT, r.PRECONDITION_FAILED, r.GENERAL, r.AGENT_NOT_FOUND]), Lt = /* @__PURE__ */ Q(({
32
+ answer: t,
33
+ citations: R,
34
+ error: e,
35
+ contentType: T,
36
+ hostAppName: d,
37
+ feedbackValue: A,
38
38
  isCitationsEnabled: O = !1,
39
- isCompleted: a = !1,
40
- isFeedbackEnabled: B = !1,
41
- isFeedbackFormEnabled: w,
42
- isFeedbackTooltipOpen: E,
43
- isInlineCitationsEnabled: P = !1,
44
- isLoading: C = !1,
45
- isMarkdownEnabled: L = !1,
46
- items: m = [],
47
- onAnswerCopy: v,
39
+ isCompleted: s = !1,
40
+ isFeedbackEnabled: b = !1,
41
+ isFeedbackFormEnabled: B,
42
+ isFeedbackTooltipOpen: m,
43
+ isInlineCitationsEnabled: _ = !1,
44
+ isLoading: P = !1,
45
+ isMarkdownEnabled: w = !1,
46
+ items: a = [],
47
+ onAnswerCopy: C,
48
48
  onCitationClick: M,
49
- onFeedbackFormSubmit: y,
50
- onFeedbackTooltipOpenChange: D,
51
- promptType: F,
52
- recordAction: c,
53
- shouldFeedbackFormIncludeFeedbackText: H,
54
- useAnimation: U = !0,
55
- variant: i = "modal",
56
- isReactMarkdownEnabled: k,
57
- setAnswerFeedback: x,
58
- questionId: G
49
+ onFeedbackFormSubmit: v,
50
+ onFeedbackTooltipOpenChange: y,
51
+ promptType: D,
52
+ recordAction: i,
53
+ shouldFeedbackFormIncludeFeedbackText: F,
54
+ useAnimation: H = !0,
55
+ variant: c = "modal",
56
+ isReactMarkdownEnabled: L,
57
+ setAnswerFeedback: U,
58
+ questionId: x
59
59
  }) => {
60
- const p = Nt.has(o), N = C && !r && !o, [V, $] = f.useState(a), {
61
- formatMessage: _
62
- } = X();
63
- f.useEffect(() => {
64
- if (r && c && a) {
65
- const s = Y(r), l = Z(r);
66
- (s.length > 0 || l.length > 0) && c({
67
- action: "programmatic",
68
- component: i,
69
- feature: "answers",
70
- target: "links_detected",
71
- data: {
72
- hostAppName: u,
73
- linkCount: s.length,
74
- fileNameCount: l.length
75
- }
76
- });
77
- }
78
- }, [r, i, u, a]), f.useEffect(() => {
79
- setTimeout(() => $(a), 0);
80
- }, [a]);
81
- const I = () => /* @__PURE__ */ n(K, {
82
- className: t.alertIcon,
83
- color: Q,
60
+ const h = Nt.has(e), E = P && !t && !e, [k, G] = X(s), {
61
+ formatMessage: u
62
+ } = Z();
63
+ S(() => {
64
+ t && i && s && a.some((W) => t.includes(W.name)) && i({
65
+ action: "programmatic",
66
+ component: c,
67
+ feature: "answers",
68
+ target: "links_detected",
69
+ data: {
70
+ hostAppName: d,
71
+ linkCount: a.length,
72
+ fileNameCount: a.length
73
+ }
74
+ });
75
+ }, [t, c, d, s, i, a]), S(() => {
76
+ setTimeout(() => G(s), 0);
77
+ }, [s]);
78
+ const p = () => /* @__PURE__ */ n(J, {
79
+ className: o.alertIcon,
80
+ color: K,
84
81
  "data-testid": "content-answers-error-alert-icon",
85
- height: g,
82
+ height: N,
86
83
  role: "presentation",
87
- width: g
88
- }), j = () => /* @__PURE__ */ d(J, {
84
+ width: N
85
+ }), V = () => /* @__PURE__ */ l(q, {
89
86
  as: "p",
90
- className: t.error,
87
+ className: o.error,
91
88
  color: "textOnLightSecondary",
92
89
  "data-testid": "content-answers-error",
93
90
  variant: "caption",
94
- children: [o === e.RESPONSE_INTERRUPTED && _(h.responseInterruptedError), o === e.RESPONSE_FAILED && _(h.responseFailedError), o === e.RESPONSE_STOPPED && _(h.responseStoppedError), o !== e.RESPONSE_STOPPED && I()]
95
- }), z = () => o !== e.RESPONSE_STOPPED ? /* @__PURE__ */ d("div", {
96
- className: S(t.footerButtons, "footer-buttons-container", {
97
- [t.buttonsVisible]: E
91
+ children: [e === r.RESPONSE_INTERRUPTED && u(f.responseInterruptedError), e === r.RESPONSE_FAILED && u(f.responseFailedError), e === r.RESPONSE_STOPPED && u(f.responseStoppedError), e !== r.RESPONSE_STOPPED && p()]
92
+ }), j = () => e !== r.RESPONSE_STOPPED ? /* @__PURE__ */ l("div", {
93
+ className: I(o.footerButtons, "footer-buttons-container", {
94
+ [o.buttonsVisible]: m
98
95
  }),
99
- children: [B ? /* @__PURE__ */ n("div", {
100
- className: t.feedbackButtonsContainer,
96
+ children: [b ? /* @__PURE__ */ n("div", {
97
+ className: o.feedbackButtonsContainer,
101
98
  children: /* @__PURE__ */ n(st, {
102
- feedbackValue: b,
103
- hostAppName: u,
104
- isFeedbackFormEnabled: w,
105
- isFeedbackTooltipOpen: E,
106
- items: m,
107
- onFeedbackFormSubmit: y,
108
- onFeedbackTooltipOpenChange: D,
109
- promptType: F,
110
- questionId: G,
111
- recordAction: c,
112
- setAnswerFeedback: x,
113
- shouldFeedbackFormIncludeFeedbackText: H,
114
- variant: i
99
+ feedbackValue: A,
100
+ hostAppName: d,
101
+ isFeedbackFormEnabled: B,
102
+ isFeedbackTooltipOpen: m,
103
+ items: a,
104
+ onFeedbackFormSubmit: v,
105
+ onFeedbackTooltipOpenChange: y,
106
+ promptType: D,
107
+ questionId: x,
108
+ recordAction: i,
109
+ setAnswerFeedback: U,
110
+ shouldFeedbackFormIncludeFeedbackText: F,
111
+ variant: c
115
112
  })
116
113
  }) : null, /* @__PURE__ */ n("div", {
117
- className: t.copyButtonContainer,
114
+ className: o.copyButtonContainer,
118
115
  children: /* @__PURE__ */ n(ot, {
119
- answer: r,
120
- onAnswerCopy: v,
121
- recordAction: c
116
+ answer: t,
117
+ onAnswerCopy: C,
118
+ recordAction: i
122
119
  })
123
120
  })]
124
- }) : r ? null : I(), W = (s) => (!m || !a || !P || m.forEach((l) => {
125
- if (s.includes(l.name)) {
126
- const q = `${window.location.origin}/file/${l.id}`;
127
- s = s.replaceAll(l.name, `[${l.name}](${q})`);
128
- }
129
- }), s);
130
- return /* @__PURE__ */ d("div", {
121
+ }) : t ? null : p(), z = Y(() => t && $(t, {
122
+ items: a,
123
+ isCompleted: s,
124
+ isInlineCitationsEnabled: _
125
+ }), [t, a, s, _]);
126
+ return /* @__PURE__ */ l("div", {
131
127
  "aria-live": "polite",
132
- className: t.answer,
128
+ className: o.answer,
133
129
  "data-testid": "content-answers-answer",
134
- children: [N && /* @__PURE__ */ n(et, {}), !p && !N && /* @__PURE__ */ n(R, {
130
+ children: [E && /* @__PURE__ */ n(nt, {}), !h && !E && /* @__PURE__ */ n(g, {
135
131
  className: "answer",
136
- variant: i,
137
- children: /* @__PURE__ */ d(R.Content, {
138
- isUsedInsideSidebar: i === "sidebar",
132
+ variant: c,
133
+ children: /* @__PURE__ */ l(g.Content, {
134
+ isUsedInsideSidebar: c === "sidebar",
139
135
  variant: "answer",
140
136
  children: [/* @__PURE__ */ n(tt, {
141
- answer: W(r),
142
- isMarkdownEnabled: L,
143
- isReactMarkdownEnabled: k,
144
- variant: i
145
- }), a && /* @__PURE__ */ d("div", {
146
- className: S(t.footer, {
147
- [t.shouldHaveMarginTop]: r,
148
- [t.shouldAnimateHeight]: V,
149
- [t.shouldUseAnimation]: U
137
+ answer: z,
138
+ isMarkdownEnabled: w,
139
+ isReactMarkdownEnabled: L,
140
+ variant: c
141
+ }), s && /* @__PURE__ */ l("div", {
142
+ className: I(o.footer, {
143
+ [o.shouldHaveMarginTop]: t,
144
+ [o.shouldAnimateHeight]: k,
145
+ [o.shouldUseAnimation]: H
150
146
  }),
151
147
  "data-testid": "content-answers-answer-footer",
152
- children: [o && j(), O && !o && /* @__PURE__ */ n(rt, {
153
- citations: T,
148
+ children: [e && V(), O && !e && /* @__PURE__ */ n(rt, {
149
+ citations: R,
154
150
  onCitationClick: M,
155
- recordAction: c
156
- }), z()]
151
+ recordAction: i
152
+ }), j()]
157
153
  })]
158
154
  })
159
- }), p && /* @__PURE__ */ n(nt, {
160
- contentType: A,
161
- error: o,
162
- recordAction: c,
163
- variant: i
155
+ }), h && /* @__PURE__ */ n(et, {
156
+ contentType: T,
157
+ error: e,
158
+ recordAction: i,
159
+ variant: c
164
160
  })]
165
161
  });
166
162
  });
167
163
  export {
168
- Dt as Answer,
169
- Dt as default
164
+ Lt as Answer,
165
+ Lt as default
170
166
  };
@@ -123,6 +123,10 @@ const t = e({
123
123
  thumbsDownAriaLabel: {
124
124
  id: "boxAI.contentAnswers.thumbsDownAriaLabel",
125
125
  defaultMessage: "Not helpful"
126
+ },
127
+ inlineCitationAriaLabel: {
128
+ id: "boxAI.contentAnswers.inlineCitationAriaLabel",
129
+ defaultMessage: "Open {fileName} in new tab"
126
130
  }
127
131
  });
128
132
  export {
@@ -1,12 +1,12 @@
1
+ import { useNotification as A, Tooltip as L, IconButton as p } from "@box/blueprint-web";
2
+ import { ThumbUp as E, ThumbDown as I } from "@box/blueprint-web-assets/icons/Fill";
3
+ import { ThumbUp as S, ThumbDown as W } from "@box/blueprint-web-assets/icons/Line";
4
+ import { useAgents as $ } from "@box/box-ai-agent-selector";
1
5
  import b from "react";
2
- import { useIntl as A } from "react-intl";
3
- import { useNotification as E, Tooltip as p, IconButton as M } from "@box/blueprint-web";
4
- import { ThumbUp as I, ThumbDown as S } from "@box/blueprint-web-assets/icons/Fill";
5
- import { ThumbUp as W, ThumbDown as $ } from "@box/blueprint-web-assets/icons/Line";
6
- import { useAgents as j } from "@box/box-ai-agent-selector";
6
+ import { useIntl as j } from "react-intl";
7
7
  import { LOGGER_BASE_CONFIG as z, LOGGER_ACTION_PROGRAMMATIC as J } from "../common/constants.js";
8
8
  import { FeedbackTooltip as K } from "./feedback-tooltip.js";
9
- import L from "../../messages.js";
9
+ import N from "../../messages.js";
10
10
  import { focusInput as Q } from "../common/focusInputUtils.js";
11
11
  import r from "./messages.js";
12
12
  import { jsxs as V, Fragment as X, jsx as f } from "react/jsx-runtime";
@@ -17,40 +17,40 @@ import '../../../../styles/thumb-buttons.css';const Y = "_thumbDown_1axcd_1", Z
17
17
  THUMB_DOWN: "negative",
18
18
  NONE: "none"
19
19
  }, rt = ({
20
- feedbackValue: y,
20
+ feedbackValue: w,
21
21
  hostAppName: n,
22
- isFeedbackFormEnabled: N = !1,
23
- isFeedbackTooltipOpen: w = !1,
22
+ isFeedbackFormEnabled: y = !1,
23
+ isFeedbackTooltipOpen: x = !1,
24
24
  items: U,
25
25
  onFeedbackFormSubmit: h,
26
26
  onFeedbackTooltipOpenChange: s,
27
- promptType: x,
27
+ promptType: D,
28
28
  questionId: a,
29
29
  recordAction: i,
30
30
  setAnswerFeedback: o,
31
- shouldFeedbackFormIncludeFeedbackText: D = !1,
32
- variant: B
31
+ shouldFeedbackFormIncludeFeedbackText: B = !1,
32
+ variant: T
33
33
  }) => {
34
34
  const {
35
35
  formatMessage: m
36
- } = A(), {
36
+ } = j(), {
37
37
  addNotification: H
38
- } = E(), {
39
- selectedAgent: T
40
- } = j(), l = y, _ = b.useMemo(() => U.filter((t) => t.status === "supported").map((t) => t.fileType), [U]), e = b.useCallback((t) => {
38
+ } = A(), {
39
+ selectedAgent: M
40
+ } = $(), l = w, _ = b.useMemo(() => U.filter((t) => t.status === "supported").map((t) => t.fileType), [U]), e = b.useCallback((t) => {
41
41
  l !== t && (o == null || o(a, t), i == null || i({
42
42
  ...z,
43
43
  action: J,
44
44
  target: "answer_feedback",
45
- component: B,
45
+ component: T,
46
46
  data: {
47
47
  feedback_value: t,
48
48
  file_types: _,
49
49
  feature: n,
50
- prompt_type: x
50
+ prompt_type: D
51
51
  }
52
52
  }), Q());
53
- }, [n, i, l, B, _, a, o]), G = ({
53
+ }, [n, i, l, T, _, a, o, D]), G = ({
54
54
  feedback: t,
55
55
  issueType: v
56
56
  }) => {
@@ -63,13 +63,13 @@ import '../../../../styles/thumb-buttons.css';const Y = "_thumbDown_1axcd_1", Z
63
63
  timestamp: Date.now(),
64
64
  questionId: a
65
65
  };
66
- D && (c.feedback = t, c.hasFeedback = !!t), T && (c.selectedAgentName = T.name), h(c, () => {
66
+ B && (c.feedback = t, c.hasFeedback = !!t), M && (c.selectedAgentName = M.name), h(c, () => {
67
67
  H({
68
68
  sensitivity: "foreground",
69
69
  styledText: m(r.feedbackTooltipConfirmation),
70
70
  variant: "success",
71
- typeIconAriaLabel: m(L.ariaTypeSuccessIconLabel),
72
- closeButtonAriaLabel: m(L.closeButtonText)
71
+ typeIconAriaLabel: m(N.ariaTypeSuccessIconLabel),
72
+ closeButtonAriaLabel: m(N.closeButtonText)
73
73
  });
74
74
  });
75
75
  }, d = (t) => {
@@ -78,29 +78,29 @@ import '../../../../styles/thumb-buttons.css';const Y = "_thumbDown_1axcd_1", Z
78
78
  e(u.THUMB_DOWN), s == null || s(!0, a);
79
79
  }, [e, s, a]);
80
80
  return /* @__PURE__ */ V(X, {
81
- children: [/* @__PURE__ */ f(p, {
81
+ children: [/* @__PURE__ */ f(L, {
82
82
  content: m(r.thumbsUpAriaLabel),
83
- children: /* @__PURE__ */ f(M, {
83
+ children: /* @__PURE__ */ f(p, {
84
84
  "aria-label": m(r.thumbsUpAriaLabel),
85
85
  disabled: l === u.THUMB_DOWN,
86
- icon: l === u.THUMB_UP ? I : W,
86
+ icon: l === u.THUMB_UP ? E : S,
87
87
  onClick: P,
88
88
  size: "x-small",
89
89
  "data-target-id": "IconButton-thumbsUpAriaLabel"
90
90
  })
91
91
  }), /* @__PURE__ */ f(K, {
92
- isOpen: w,
92
+ isOpen: x,
93
93
  onOpenChange: d,
94
94
  onSubmit: G,
95
- shouldIncludeFeedbackText: D,
96
- shouldShow: N,
97
- children: /* @__PURE__ */ f(p, {
95
+ shouldIncludeFeedbackText: B,
96
+ shouldShow: y,
97
+ children: /* @__PURE__ */ f(L, {
98
98
  content: m(r.thumbsDownAriaLabel),
99
- children: /* @__PURE__ */ f(M, {
99
+ children: /* @__PURE__ */ f(p, {
100
100
  "aria-label": m(r.thumbsDownAriaLabel),
101
101
  className: Z.thumbDown,
102
102
  disabled: l === u.THUMB_UP,
103
- icon: l === u.THUMB_DOWN ? S : $,
103
+ icon: l === u.THUMB_DOWN ? I : W,
104
104
  onClick: R,
105
105
  size: "x-small",
106
106
  "data-target-id": "IconButton-thumbsDownAriaLabel"
@@ -0,0 +1,47 @@
1
+ import { FilterChip as t, Tooltip as a } from "@box/blueprint-web";
2
+ import { File as r } from "@box/blueprint-web-assets/icons/Medium";
3
+ import { useCallback as s, useMemo as c } from "react";
4
+ import { useIntl as m } from "react-intl";
5
+ import { isBoxDomain as p } from "../../utils/inlineCitationsUtils.js";
6
+ import d from "../answer/messages.js";
7
+ import { s as u } from "../../../../chunks/markdown.module.js";
8
+ import { jsx as i, jsxs as f } from "react/jsx-runtime";
9
+ const A = ({
10
+ fileName: n,
11
+ href: o
12
+ }) => {
13
+ const {
14
+ formatMessage: e
15
+ } = m(), l = s(() => {
16
+ window.open(o, "_blank", "noopener,noreferrer");
17
+ }, [o]);
18
+ return c(() => p(o), [o]) ? /* @__PURE__ */ i(t.Group, {
19
+ className: u.inlineCitationGroup,
20
+ name: "inline-citation-interactive",
21
+ type: "single",
22
+ children: /* @__PURE__ */ i(a, {
23
+ content: n,
24
+ children: /* @__PURE__ */ f(t.ChipButton, {
25
+ "aria-label": e(d.inlineCitationAriaLabel, {
26
+ fileName: n
27
+ }),
28
+ className: "inline-citation-chip-button",
29
+ "data-testid": "inline-citation-chip",
30
+ onClick: l,
31
+ value: "interactive",
32
+ children: [/* @__PURE__ */ i(t.Icon, {
33
+ className: "inline-citation-file-icon",
34
+ icon: r
35
+ }), /* @__PURE__ */ i(t.Label, {
36
+ className: "inline-citation-filename-label",
37
+ children: n
38
+ })]
39
+ })
40
+ })
41
+ }) : /* @__PURE__ */ i("span", {
42
+ children: n
43
+ });
44
+ };
45
+ export {
46
+ A as default
47
+ };