@box/box-ai-content-answers 0.150.0 → 0.152.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/markdown.module.js +19 -0
- package/dist/esm/lib/components/answer/answer.js +123 -127
- package/dist/esm/lib/components/answer/messages.js +4 -0
- package/dist/esm/lib/components/answer/thumb-buttons.js +31 -31
- package/dist/esm/lib/components/common/inline-citation.js +47 -0
- package/dist/esm/lib/components/common/markdown-react.js +81 -59
- package/dist/esm/lib/components/common/markdown.js +723 -721
- package/dist/esm/lib/utils/inlineCitationsUtils.js +36 -0
- package/dist/i18n/bn-IN.js +1 -0
- package/dist/i18n/bn-IN.properties +2 -0
- package/dist/i18n/da-DK.js +1 -0
- package/dist/i18n/da-DK.properties +2 -0
- package/dist/i18n/de-DE.js +1 -0
- package/dist/i18n/de-DE.properties +2 -0
- package/dist/i18n/en-AU.js +1 -0
- package/dist/i18n/en-AU.properties +2 -0
- package/dist/i18n/en-CA.js +1 -0
- package/dist/i18n/en-CA.properties +2 -0
- package/dist/i18n/en-GB.js +1 -0
- package/dist/i18n/en-GB.properties +2 -0
- package/dist/i18n/en-US.js +1 -0
- package/dist/i18n/en-US.properties +2 -0
- package/dist/i18n/en-x-pseudo.js +79 -78
- package/dist/i18n/en-x-pseudo.properties +80 -78
- package/dist/i18n/es-419.js +1 -0
- package/dist/i18n/es-419.properties +2 -0
- package/dist/i18n/es-ES.js +1 -0
- package/dist/i18n/es-ES.properties +2 -0
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fi-FI.properties +2 -0
- package/dist/i18n/fr-CA.js +1 -0
- package/dist/i18n/fr-CA.properties +2 -0
- package/dist/i18n/fr-FR.js +1 -0
- package/dist/i18n/fr-FR.properties +2 -0
- package/dist/i18n/hi-IN.js +1 -0
- package/dist/i18n/hi-IN.properties +2 -0
- package/dist/i18n/it-IT.js +1 -0
- package/dist/i18n/it-IT.properties +2 -0
- package/dist/i18n/ja-JP.js +1 -0
- package/dist/i18n/ja-JP.properties +2 -0
- package/dist/i18n/json/src/lib/components/answer/messages.json +1 -1
- package/dist/i18n/ko-KR.js +1 -0
- package/dist/i18n/ko-KR.properties +2 -0
- package/dist/i18n/nb-NO.js +1 -0
- package/dist/i18n/nb-NO.properties +2 -0
- package/dist/i18n/nl-NL.js +1 -0
- package/dist/i18n/nl-NL.properties +2 -0
- package/dist/i18n/pl-PL.js +1 -0
- package/dist/i18n/pl-PL.properties +2 -0
- package/dist/i18n/pt-BR.js +1 -0
- package/dist/i18n/pt-BR.properties +2 -0
- package/dist/i18n/ru-RU.js +1 -0
- package/dist/i18n/ru-RU.properties +2 -0
- package/dist/i18n/sv-SE.js +1 -0
- package/dist/i18n/sv-SE.properties +2 -0
- package/dist/i18n/tr-TR.js +1 -0
- package/dist/i18n/tr-TR.properties +2 -0
- package/dist/i18n/zh-CN.js +1 -0
- package/dist/i18n/zh-CN.properties +2 -0
- package/dist/i18n/zh-TW.js +1 -0
- package/dist/i18n/zh-TW.properties +2 -0
- package/dist/styles/markdown.css +1 -7
- package/dist/styles/markdown2.css +7 -0
- package/dist/types/lib/components/answer/answer.d.ts +1 -2
- package/dist/types/lib/components/answer/messages.d.ts +5 -0
- package/dist/types/lib/components/answer/stories/shared.d.ts +15 -3
- package/dist/types/lib/components/common/inline-citation.d.ts +7 -0
- package/dist/types/lib/utils/inlineCitationsUtils.d.ts +17 -0
- package/package.json +3 -3
- package/dist/esm/lib/utils/getBoxLinks.js +0 -13
- 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
|
|
2
|
-
import { AlertTriangle as
|
|
3
|
-
import { Gray65 as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useIntl as
|
|
7
|
-
import { A as
|
|
8
|
-
import {
|
|
9
|
-
import { MediaContainer as
|
|
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
|
|
13
|
-
import { LoadingIndicator as
|
|
14
|
-
import
|
|
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
|
|
18
|
-
import '../../../../styles/answer.css';const at = "_answer_140hd_1", it = "_alertIcon_140hd_5",
|
|
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:
|
|
22
|
-
footer:
|
|
21
|
+
error: ct,
|
|
22
|
+
footer: lt,
|
|
23
23
|
copyButtonContainer: dt,
|
|
24
|
-
feedbackButtonsContainer:
|
|
25
|
-
shouldHaveMarginTop:
|
|
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([
|
|
32
|
-
answer:
|
|
33
|
-
citations:
|
|
34
|
-
error:
|
|
35
|
-
contentType:
|
|
36
|
-
hostAppName:
|
|
37
|
-
feedbackValue:
|
|
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:
|
|
40
|
-
isFeedbackEnabled:
|
|
41
|
-
isFeedbackFormEnabled:
|
|
42
|
-
isFeedbackTooltipOpen:
|
|
43
|
-
isInlineCitationsEnabled:
|
|
44
|
-
isLoading:
|
|
45
|
-
isMarkdownEnabled:
|
|
46
|
-
items:
|
|
47
|
-
onAnswerCopy:
|
|
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:
|
|
50
|
-
onFeedbackTooltipOpenChange:
|
|
51
|
-
promptType:
|
|
52
|
-
recordAction:
|
|
53
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
54
|
-
useAnimation:
|
|
55
|
-
variant:
|
|
56
|
-
isReactMarkdownEnabled:
|
|
57
|
-
setAnswerFeedback:
|
|
58
|
-
questionId:
|
|
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
|
|
61
|
-
formatMessage:
|
|
62
|
-
} =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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:
|
|
82
|
+
height: N,
|
|
86
83
|
role: "presentation",
|
|
87
|
-
width:
|
|
88
|
-
}),
|
|
84
|
+
width: N
|
|
85
|
+
}), V = () => /* @__PURE__ */ l(q, {
|
|
89
86
|
as: "p",
|
|
90
|
-
className:
|
|
87
|
+
className: o.error,
|
|
91
88
|
color: "textOnLightSecondary",
|
|
92
89
|
"data-testid": "content-answers-error",
|
|
93
90
|
variant: "caption",
|
|
94
|
-
children: [
|
|
95
|
-
}),
|
|
96
|
-
className:
|
|
97
|
-
[
|
|
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: [
|
|
100
|
-
className:
|
|
96
|
+
children: [b ? /* @__PURE__ */ n("div", {
|
|
97
|
+
className: o.feedbackButtonsContainer,
|
|
101
98
|
children: /* @__PURE__ */ n(st, {
|
|
102
|
-
feedbackValue:
|
|
103
|
-
hostAppName:
|
|
104
|
-
isFeedbackFormEnabled:
|
|
105
|
-
isFeedbackTooltipOpen:
|
|
106
|
-
items:
|
|
107
|
-
onFeedbackFormSubmit:
|
|
108
|
-
onFeedbackTooltipOpenChange:
|
|
109
|
-
promptType:
|
|
110
|
-
questionId:
|
|
111
|
-
recordAction:
|
|
112
|
-
setAnswerFeedback:
|
|
113
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
114
|
-
variant:
|
|
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:
|
|
114
|
+
className: o.copyButtonContainer,
|
|
118
115
|
children: /* @__PURE__ */ n(ot, {
|
|
119
|
-
answer:
|
|
120
|
-
onAnswerCopy:
|
|
121
|
-
recordAction:
|
|
116
|
+
answer: t,
|
|
117
|
+
onAnswerCopy: C,
|
|
118
|
+
recordAction: i
|
|
122
119
|
})
|
|
123
120
|
})]
|
|
124
|
-
}) :
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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:
|
|
128
|
+
className: o.answer,
|
|
133
129
|
"data-testid": "content-answers-answer",
|
|
134
|
-
children: [
|
|
130
|
+
children: [E && /* @__PURE__ */ n(nt, {}), !h && !E && /* @__PURE__ */ n(g, {
|
|
135
131
|
className: "answer",
|
|
136
|
-
variant:
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
isUsedInsideSidebar:
|
|
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:
|
|
142
|
-
isMarkdownEnabled:
|
|
143
|
-
isReactMarkdownEnabled:
|
|
144
|
-
variant:
|
|
145
|
-
}),
|
|
146
|
-
className:
|
|
147
|
-
[
|
|
148
|
-
[
|
|
149
|
-
[
|
|
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: [
|
|
153
|
-
citations:
|
|
148
|
+
children: [e && V(), O && !e && /* @__PURE__ */ n(rt, {
|
|
149
|
+
citations: R,
|
|
154
150
|
onCitationClick: M,
|
|
155
|
-
recordAction:
|
|
156
|
-
}),
|
|
151
|
+
recordAction: i
|
|
152
|
+
}), j()]
|
|
157
153
|
})]
|
|
158
154
|
})
|
|
159
|
-
}),
|
|
160
|
-
contentType:
|
|
161
|
-
error:
|
|
162
|
-
recordAction:
|
|
163
|
-
variant:
|
|
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
|
-
|
|
169
|
-
|
|
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
|
|
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
|
|
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:
|
|
20
|
+
feedbackValue: w,
|
|
21
21
|
hostAppName: n,
|
|
22
|
-
isFeedbackFormEnabled:
|
|
23
|
-
isFeedbackTooltipOpen:
|
|
22
|
+
isFeedbackFormEnabled: y = !1,
|
|
23
|
+
isFeedbackTooltipOpen: x = !1,
|
|
24
24
|
items: U,
|
|
25
25
|
onFeedbackFormSubmit: h,
|
|
26
26
|
onFeedbackTooltipOpenChange: s,
|
|
27
|
-
promptType:
|
|
27
|
+
promptType: D,
|
|
28
28
|
questionId: a,
|
|
29
29
|
recordAction: i,
|
|
30
30
|
setAnswerFeedback: o,
|
|
31
|
-
shouldFeedbackFormIncludeFeedbackText:
|
|
32
|
-
variant:
|
|
31
|
+
shouldFeedbackFormIncludeFeedbackText: B = !1,
|
|
32
|
+
variant: T
|
|
33
33
|
}) => {
|
|
34
34
|
const {
|
|
35
35
|
formatMessage: m
|
|
36
|
-
} =
|
|
36
|
+
} = j(), {
|
|
37
37
|
addNotification: H
|
|
38
|
-
} =
|
|
39
|
-
selectedAgent:
|
|
40
|
-
} =
|
|
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:
|
|
45
|
+
component: T,
|
|
46
46
|
data: {
|
|
47
47
|
feedback_value: t,
|
|
48
48
|
file_types: _,
|
|
49
49
|
feature: n,
|
|
50
|
-
prompt_type:
|
|
50
|
+
prompt_type: D
|
|
51
51
|
}
|
|
52
52
|
}), Q());
|
|
53
|
-
}, [n, i, l,
|
|
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
|
-
|
|
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(
|
|
72
|
-
closeButtonAriaLabel: m(
|
|
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(
|
|
81
|
+
children: [/* @__PURE__ */ f(L, {
|
|
82
82
|
content: m(r.thumbsUpAriaLabel),
|
|
83
|
-
children: /* @__PURE__ */ f(
|
|
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 ?
|
|
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:
|
|
92
|
+
isOpen: x,
|
|
93
93
|
onOpenChange: d,
|
|
94
94
|
onSubmit: G,
|
|
95
|
-
shouldIncludeFeedbackText:
|
|
96
|
-
shouldShow:
|
|
97
|
-
children: /* @__PURE__ */ f(
|
|
95
|
+
shouldIncludeFeedbackText: B,
|
|
96
|
+
shouldShow: y,
|
|
97
|
+
children: /* @__PURE__ */ f(L, {
|
|
98
98
|
content: m(r.thumbsDownAriaLabel),
|
|
99
|
-
children: /* @__PURE__ */ f(
|
|
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 ?
|
|
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
|
+
};
|