@box/box-ai-content-answers 2.1.38 → 2.1.40
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/answer-content.js +1 -32
- package/dist/chunks/answer.js +1 -183
- package/dist/chunks/box-ai-content-answers.js +1 -78
- package/dist/chunks/chat.js +1 -116
- package/dist/chunks/citation.js +1 -124
- package/dist/chunks/clear-conversation-button.js +1 -37
- package/dist/chunks/content.js +1 -89
- package/dist/chunks/content2.js +1 -213
- package/dist/chunks/contextual-items-message.js +1 -43
- package/dist/chunks/embed-the-answer-button.js +1 -52
- package/dist/chunks/feedback-tooltip.js +1 -130
- package/dist/chunks/footer-actions.js +1 -44
- package/dist/chunks/inline-error.js +1 -63
- package/dist/chunks/items-dropdown.js +1 -67
- package/dist/chunks/markdown.js +6 -6776
- package/dist/chunks/markdown.module.js +1 -13
- package/dist/chunks/media-container.js +1 -32
- package/dist/chunks/question.js +1 -29
- package/dist/chunks/references.js +1 -43
- package/dist/chunks/stopResponseButton.js +1 -45
- package/dist/chunks/suggested-questions.js +1 -70
- package/dist/chunks/suggestions.js +1 -35
- package/dist/chunks/thinkingBubble.js +1 -111
- package/dist/chunks/thumb-buttons.js +1 -103
- package/dist/chunks/types.js +1 -14
- package/dist/chunks/unsupported-items-notice.js +1 -25
- package/dist/chunks/warning-message.js +1 -21
- package/dist/esm/index.js +1 -11
- package/dist/esm/lib/box-ai-content-answers.js +1 -2
- package/dist/esm/lib/components/answer/answer-content.js +1 -2
- package/dist/esm/lib/components/answer/answer.js +1 -2
- package/dist/esm/lib/components/answer/citation.js +1 -2
- package/dist/esm/lib/components/answer/constants.js +1 -2
- package/dist/esm/lib/components/answer/copy-button.js +1 -46
- package/dist/esm/lib/components/answer/embed-the-answer-button.js +1 -2
- package/dist/esm/lib/components/answer/feedback-tooltip.js +1 -2
- package/dist/esm/lib/components/answer/inline-error.js +1 -2
- package/dist/esm/lib/components/answer/loading-indicator.js +1 -29
- package/dist/esm/lib/components/answer/messages.js +1 -148
- package/dist/esm/lib/components/answer/no-citations.js +1 -29
- package/dist/esm/lib/components/answer/references.js +1 -2
- package/dist/esm/lib/components/answer/thumb-buttons.js +1 -2
- package/dist/esm/lib/components/api-wrapper/actions.js +1 -2
- package/dist/esm/lib/components/api-wrapper/api-wrapper.js +1 -8
- package/dist/esm/lib/components/api-wrapper/constants.js +1 -30
- package/dist/esm/lib/components/api-wrapper/content-answers-component.js +1 -83
- package/dist/esm/lib/components/api-wrapper/hooks/useContentAnswers.js +1 -211
- package/dist/esm/lib/components/api-wrapper/records.js +1 -38
- package/dist/esm/lib/components/api-wrapper/reducer.js +1 -42
- package/dist/esm/lib/components/api-wrapper/utils/format.js +1 -13
- package/dist/esm/lib/components/api-wrapper/utils/request.js +1 -12
- package/dist/esm/lib/components/api-wrapper/utils/stream.js +2 -116
- package/dist/esm/lib/components/api-wrapper/utils/typed-record.js +1 -3
- package/dist/esm/lib/components/chat/chat.js +1 -2
- package/dist/esm/lib/components/chat/index.js +1 -2
- package/dist/esm/lib/components/common/agentUtils.js +1 -5
- package/dist/esm/lib/components/common/constants.js +1 -19
- package/dist/esm/lib/components/common/focusInputUtils.js +1 -5
- package/dist/esm/lib/components/common/inline-citation.js +1 -24
- package/dist/esm/lib/components/common/keyInputUtils.js +1 -3
- package/dist/esm/lib/components/common/markdown-react.js +1 -97
- package/dist/esm/lib/components/common/markdown.js +1 -2
- package/dist/esm/lib/components/common/media-container.js +1 -2
- package/dist/esm/lib/components/common/mock-data.js +1 -305
- package/dist/esm/lib/components/common/performance.js +1 -3
- package/dist/esm/lib/components/content/content.js +1 -2
- package/dist/esm/lib/components/content/index.js +1 -2
- package/dist/esm/lib/components/footer/constants.js +1 -12
- package/dist/esm/lib/components/footer/footer-actions.js +1 -2
- package/dist/esm/lib/components/footer/footer.js +1 -151
- package/dist/esm/lib/components/footer/index.js +1 -2
- package/dist/esm/lib/components/footer/messages.js +1 -36
- package/dist/esm/lib/components/footer/stopResponseButton.js +1 -2
- package/dist/esm/lib/components/modal/clear-conversation-button.js +1 -2
- package/dist/esm/lib/components/modal/hooks/useEventListeners.js +1 -10
- package/dist/esm/lib/components/modal/hooks/useStopPropagationOnEsc.js +1 -19
- package/dist/esm/lib/components/modal/messages.js +1 -20
- package/dist/esm/lib/components/modal/modal.js +1 -143
- package/dist/esm/lib/components/modal/title.js +1 -14
- package/dist/esm/lib/components/modal-error/index.js +1 -2
- package/dist/esm/lib/components/modal-error/messages.js +1 -16
- package/dist/esm/lib/components/modal-error/modal-error.js +1 -33
- package/dist/esm/lib/components/question/question.js +1 -2
- package/dist/esm/lib/components/sidebar/content.js +1 -2
- package/dist/esm/lib/components/sidebar/context.js +1 -16
- package/dist/esm/lib/components/sidebar/messages.js +1 -28
- package/dist/esm/lib/components/sidebar/sidebar.js +1 -80
- package/dist/esm/lib/components/sidebar/title.js +1 -14
- package/dist/esm/lib/components/suggested-questions/messages.js +1 -16
- package/dist/esm/lib/components/suggested-questions/mocks.js +1 -36
- package/dist/esm/lib/components/suggested-questions/suggested-questions.js +1 -2
- package/dist/esm/lib/components/suggested-questions/suggestions.js +1 -2
- package/dist/esm/lib/components/thinkingBubble/boxAILoadingIndicator.js +11 -277
- package/dist/esm/lib/components/thinkingBubble/messages.js +1 -24
- package/dist/esm/lib/components/thinkingBubble/thinkingBubble.js +1 -2
- package/dist/esm/lib/components/welcome-message/contextual-items-message.js +1 -2
- package/dist/esm/lib/components/welcome-message/items-dropdown.js +1 -2
- package/dist/esm/lib/components/welcome-message/messages.js +10 -52
- package/dist/esm/lib/components/welcome-message/unsupported-items-notice.js +1 -2
- package/dist/esm/lib/components/welcome-message/warning-message.js +1 -2
- package/dist/esm/lib/components/welcome-message/welcome-message.js +1 -53
- package/dist/esm/lib/constants.js +1 -9
- package/dist/esm/lib/hooks/usePromptFocus.js +1 -28
- package/dist/esm/lib/messages.js +1 -56
- package/dist/esm/lib/utils/constants.js +1 -2
- package/dist/esm/lib/utils/inlineCitationsUtils.js +1 -18
- package/package.json +11 -11
|
@@ -1,152 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "clsx";
|
|
3
|
-
import { useId as n } from "react";
|
|
4
|
-
import { useIntl as r } from "react-intl";
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
var o = ({ className: o, height: s = 24, width: c = 24 }) => {
|
|
7
|
-
let { formatMessage: l } = r(), u = n().replace(/:/g, ""), d = `blueGradient-${u}`, f = `purpleGradient-${u}`, p = `magentaGradient-${u}`, m = `whiteBorder-${u}`, h = `clip1-${u}`, g = `clip2-${u}`;
|
|
8
|
-
return /* @__PURE__ */ a("svg", {
|
|
9
|
-
"aria-label": l(e.loadingAnswer),
|
|
10
|
-
"aria-live": "polite",
|
|
11
|
-
className: t("boxai-loading", o),
|
|
12
|
-
height: s,
|
|
13
|
-
role: "status",
|
|
14
|
-
viewBox: "0 0 400 400",
|
|
15
|
-
width: c,
|
|
16
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ a("defs", { children: [
|
|
19
|
-
/* @__PURE__ */ a("linearGradient", {
|
|
20
|
-
id: p,
|
|
21
|
-
x1: "0%",
|
|
22
|
-
x2: "100%",
|
|
23
|
-
y1: "0%",
|
|
24
|
-
y2: "100%",
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ i("stop", {
|
|
27
|
-
offset: "0%",
|
|
28
|
-
style: {
|
|
29
|
-
stopColor: "#FF80FF",
|
|
30
|
-
stopOpacity: 1
|
|
31
|
-
}
|
|
32
|
-
}),
|
|
33
|
-
/* @__PURE__ */ i("stop", {
|
|
34
|
-
offset: "50%",
|
|
35
|
-
style: {
|
|
36
|
-
stopColor: "#FF00FF",
|
|
37
|
-
stopOpacity: 1
|
|
38
|
-
}
|
|
39
|
-
}),
|
|
40
|
-
/* @__PURE__ */ i("stop", {
|
|
41
|
-
offset: "100%",
|
|
42
|
-
style: {
|
|
43
|
-
stopColor: "#CC00CC",
|
|
44
|
-
stopOpacity: 1
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
]
|
|
48
|
-
}),
|
|
49
|
-
/* @__PURE__ */ a("linearGradient", {
|
|
50
|
-
id: f,
|
|
51
|
-
x1: "0%",
|
|
52
|
-
x2: "100%",
|
|
53
|
-
y1: "0%",
|
|
54
|
-
y2: "100%",
|
|
55
|
-
children: [
|
|
56
|
-
/* @__PURE__ */ i("stop", {
|
|
57
|
-
offset: "0%",
|
|
58
|
-
style: {
|
|
59
|
-
stopColor: "#BB66EE",
|
|
60
|
-
stopOpacity: 1
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
63
|
-
/* @__PURE__ */ i("stop", {
|
|
64
|
-
offset: "50%",
|
|
65
|
-
style: {
|
|
66
|
-
stopColor: "#9933CC",
|
|
67
|
-
stopOpacity: 1
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ i("stop", {
|
|
71
|
-
offset: "100%",
|
|
72
|
-
style: {
|
|
73
|
-
stopColor: "#7722AA",
|
|
74
|
-
stopOpacity: 1
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
}),
|
|
79
|
-
/* @__PURE__ */ a("linearGradient", {
|
|
80
|
-
id: d,
|
|
81
|
-
x1: "0%",
|
|
82
|
-
x2: "100%",
|
|
83
|
-
y1: "0%",
|
|
84
|
-
y2: "100%",
|
|
85
|
-
children: [
|
|
86
|
-
/* @__PURE__ */ i("stop", {
|
|
87
|
-
offset: "0%",
|
|
88
|
-
style: {
|
|
89
|
-
stopColor: "#77BBFF",
|
|
90
|
-
stopOpacity: 1
|
|
91
|
-
}
|
|
92
|
-
}),
|
|
93
|
-
/* @__PURE__ */ i("stop", {
|
|
94
|
-
offset: "50%",
|
|
95
|
-
style: {
|
|
96
|
-
stopColor: "#3399FF",
|
|
97
|
-
stopOpacity: 1
|
|
98
|
-
}
|
|
99
|
-
}),
|
|
100
|
-
/* @__PURE__ */ i("stop", {
|
|
101
|
-
offset: "100%",
|
|
102
|
-
style: {
|
|
103
|
-
stopColor: "#0077DD",
|
|
104
|
-
stopOpacity: 1
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
}),
|
|
109
|
-
/* @__PURE__ */ a("filter", {
|
|
110
|
-
height: "140%",
|
|
111
|
-
id: m,
|
|
112
|
-
width: "140%",
|
|
113
|
-
x: "-20%",
|
|
114
|
-
y: "-20%",
|
|
115
|
-
children: [
|
|
116
|
-
/* @__PURE__ */ i("feMorphology", {
|
|
117
|
-
in: "SourceAlpha",
|
|
118
|
-
operator: "dilate",
|
|
119
|
-
radius: "5",
|
|
120
|
-
result: "expanded"
|
|
121
|
-
}),
|
|
122
|
-
/* @__PURE__ */ i("feFlood", {
|
|
123
|
-
floodColor: "white",
|
|
124
|
-
floodOpacity: "1",
|
|
125
|
-
result: "whiteColor"
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ i("feComposite", {
|
|
128
|
-
in: "whiteColor",
|
|
129
|
-
in2: "expanded",
|
|
130
|
-
operator: "in",
|
|
131
|
-
result: "whiteBorder"
|
|
132
|
-
}),
|
|
133
|
-
/* @__PURE__ */ i("feComposite", {
|
|
134
|
-
in: "SourceGraphic",
|
|
135
|
-
in2: "whiteBorder",
|
|
136
|
-
operator: "over"
|
|
137
|
-
})
|
|
138
|
-
]
|
|
139
|
-
}),
|
|
140
|
-
/* @__PURE__ */ i("clipPath", {
|
|
141
|
-
id: h,
|
|
142
|
-
children: /* @__PURE__ */ i("path", { d: "M0,200 L400,200 L400,400 L0,400 z" })
|
|
143
|
-
}),
|
|
144
|
-
/* @__PURE__ */ i("clipPath", {
|
|
145
|
-
id: g,
|
|
146
|
-
children: /* @__PURE__ */ i("path", { d: "M0,0 L400,0 L400,200 L0,200 z" })
|
|
147
|
-
})
|
|
148
|
-
] }),
|
|
149
|
-
/* @__PURE__ */ i("style", { children: `
|
|
1
|
+
import messages from"../answer/messages.js";import clsx from"clsx";import{useId}from"react";import{useIntl}from"react-intl";import{jsx,jsxs}from"react/jsx-runtime";var BoxAILoadingIndicator=({className,height=24,width=24})=>{let{formatMessage}=useIntl(),id=useId().replace(/:/g,``),blueGradientId=`blueGradient-${id}`,purpleGradientId=`purpleGradient-${id}`,magentaGradientId=`magentaGradient-${id}`,whiteBorderId=`whiteBorder-${id}`,clip1Id=`clip1-${id}`,clip2Id=`clip2-${id}`;return jsxs(`svg`,{"aria-label":formatMessage(messages.loadingAnswer),"aria-live":`polite`,className:clsx(`boxai-loading`,className),height,role:`status`,viewBox:`0 0 400 400`,width,xmlns:`http://www.w3.org/2000/svg`,children:[jsxs(`defs`,{children:[jsxs(`linearGradient`,{id:magentaGradientId,x1:`0%`,x2:`100%`,y1:`0%`,y2:`100%`,children:[jsx(`stop`,{offset:`0%`,style:{stopColor:`#FF80FF`,stopOpacity:1}}),jsx(`stop`,{offset:`50%`,style:{stopColor:`#FF00FF`,stopOpacity:1}}),jsx(`stop`,{offset:`100%`,style:{stopColor:`#CC00CC`,stopOpacity:1}})]}),jsxs(`linearGradient`,{id:purpleGradientId,x1:`0%`,x2:`100%`,y1:`0%`,y2:`100%`,children:[jsx(`stop`,{offset:`0%`,style:{stopColor:`#BB66EE`,stopOpacity:1}}),jsx(`stop`,{offset:`50%`,style:{stopColor:`#9933CC`,stopOpacity:1}}),jsx(`stop`,{offset:`100%`,style:{stopColor:`#7722AA`,stopOpacity:1}})]}),jsxs(`linearGradient`,{id:blueGradientId,x1:`0%`,x2:`100%`,y1:`0%`,y2:`100%`,children:[jsx(`stop`,{offset:`0%`,style:{stopColor:`#77BBFF`,stopOpacity:1}}),jsx(`stop`,{offset:`50%`,style:{stopColor:`#3399FF`,stopOpacity:1}}),jsx(`stop`,{offset:`100%`,style:{stopColor:`#0077DD`,stopOpacity:1}})]}),jsxs(`filter`,{height:`140%`,id:whiteBorderId,width:`140%`,x:`-20%`,y:`-20%`,children:[jsx(`feMorphology`,{in:`SourceAlpha`,operator:`dilate`,radius:`5`,result:`expanded`}),jsx(`feFlood`,{floodColor:`white`,floodOpacity:`1`,result:`whiteColor`}),jsx(`feComposite`,{in:`whiteColor`,in2:`expanded`,operator:`in`,result:`whiteBorder`}),jsx(`feComposite`,{in:`SourceGraphic`,in2:`whiteBorder`,operator:`over`})]}),jsx(`clipPath`,{id:clip1Id,children:jsx(`path`,{d:`M0,200 L400,200 L400,400 L0,400 z`})}),jsx(`clipPath`,{id:clip2Id,children:jsx(`path`,{d:`M0,0 L400,0 L400,200 L0,200 z`})})]}),jsx(`style`,{children:`
|
|
150
2
|
.boxai-loading .ring {
|
|
151
3
|
fill: none;
|
|
152
4
|
stroke-width: 28;
|
|
@@ -155,21 +7,21 @@ var o = ({ className: o, height: s = 24, width: c = 24 }) => {
|
|
|
155
7
|
animation-timing-function: ease-in-out;
|
|
156
8
|
animation-iteration-count: infinite;
|
|
157
9
|
opacity: 0;
|
|
158
|
-
filter: url(#${
|
|
10
|
+
filter: url(#${whiteBorderId});
|
|
159
11
|
}
|
|
160
12
|
.boxai-loading .ring-two {
|
|
161
13
|
fill: none;
|
|
162
14
|
stroke-width: 28;
|
|
163
15
|
stroke-linecap: round;
|
|
164
16
|
opacity: 1;
|
|
165
|
-
filter: url(#${
|
|
166
|
-
}
|
|
167
|
-
.boxai-loading .blue-ring { stroke: url(#${
|
|
168
|
-
.boxai-loading .blue-ring-two { stroke: url(#${
|
|
169
|
-
.boxai-loading .purple-ring { stroke: url(#${
|
|
170
|
-
.boxai-loading .purple-ring-two { stroke: url(#${
|
|
171
|
-
.boxai-loading .magenta-ring { stroke: url(#${
|
|
172
|
-
.boxai-loading .magenta-ring-two { stroke: url(#${
|
|
17
|
+
filter: url(#${whiteBorderId});
|
|
18
|
+
}
|
|
19
|
+
.boxai-loading .blue-ring { stroke: url(#${blueGradientId}); animation-name: blue-draw, blue-fade; }
|
|
20
|
+
.boxai-loading .blue-ring-two { stroke: url(#${blueGradientId}); }
|
|
21
|
+
.boxai-loading .purple-ring { stroke: url(#${purpleGradientId}); animation-name: purple-draw, purple-fade; }
|
|
22
|
+
.boxai-loading .purple-ring-two { stroke: url(#${purpleGradientId}); }
|
|
23
|
+
.boxai-loading .magenta-ring { stroke: url(#${magentaGradientId}); animation-name: magenta-draw, magenta-fade; }
|
|
24
|
+
.boxai-loading .magenta-ring-two { stroke: url(#${magentaGradientId}); }
|
|
173
25
|
.boxai-loading .bg-rings { opacity: 0.2; }
|
|
174
26
|
|
|
175
27
|
@keyframes magenta-draw {
|
|
@@ -202,122 +54,4 @@ var o = ({ className: o, height: s = 24, width: c = 24 }) => {
|
|
|
202
54
|
35%, 80% { opacity: 1; }
|
|
203
55
|
87%, 100% { opacity: 0; }
|
|
204
56
|
}
|
|
205
|
-
` }),
|
|
206
|
-
/* @__PURE__ */ a("g", {
|
|
207
|
-
className: "bg-rings",
|
|
208
|
-
children: [/* @__PURE__ */ a("g", {
|
|
209
|
-
clipPath: `url(#${h})`,
|
|
210
|
-
children: [
|
|
211
|
-
/* @__PURE__ */ i("ellipse", {
|
|
212
|
-
className: "ring-two blue-ring-two",
|
|
213
|
-
cx: "200",
|
|
214
|
-
cy: "200",
|
|
215
|
-
rx: "80",
|
|
216
|
-
ry: "160",
|
|
217
|
-
transform: "rotate(-60, 200, 200)"
|
|
218
|
-
}),
|
|
219
|
-
/* @__PURE__ */ i("ellipse", {
|
|
220
|
-
className: "ring-two purple-ring-two",
|
|
221
|
-
cx: "200",
|
|
222
|
-
cy: "200",
|
|
223
|
-
rx: "80",
|
|
224
|
-
ry: "160",
|
|
225
|
-
transform: "rotate(60, 200, 200)"
|
|
226
|
-
}),
|
|
227
|
-
/* @__PURE__ */ i("ellipse", {
|
|
228
|
-
className: "ring-two magenta-ring-two",
|
|
229
|
-
cx: "200",
|
|
230
|
-
cy: "200",
|
|
231
|
-
rx: "80",
|
|
232
|
-
ry: "160"
|
|
233
|
-
})
|
|
234
|
-
]
|
|
235
|
-
}), /* @__PURE__ */ a("g", {
|
|
236
|
-
clipPath: `url(#${g})`,
|
|
237
|
-
children: [
|
|
238
|
-
/* @__PURE__ */ i("ellipse", {
|
|
239
|
-
className: "ring-two magenta-ring-two",
|
|
240
|
-
cx: "200",
|
|
241
|
-
cy: "200",
|
|
242
|
-
rx: "80",
|
|
243
|
-
ry: "160"
|
|
244
|
-
}),
|
|
245
|
-
/* @__PURE__ */ i("ellipse", {
|
|
246
|
-
className: "ring-two blue-ring-two",
|
|
247
|
-
cx: "200",
|
|
248
|
-
cy: "200",
|
|
249
|
-
rx: "80",
|
|
250
|
-
ry: "160",
|
|
251
|
-
transform: "rotate(-60, 200, 200)"
|
|
252
|
-
}),
|
|
253
|
-
/* @__PURE__ */ i("ellipse", {
|
|
254
|
-
className: "ring-two purple-ring-two",
|
|
255
|
-
cx: "200",
|
|
256
|
-
cy: "200",
|
|
257
|
-
rx: "80",
|
|
258
|
-
ry: "160",
|
|
259
|
-
transform: "rotate(60, 200, 200)"
|
|
260
|
-
})
|
|
261
|
-
]
|
|
262
|
-
})]
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ a("g", {
|
|
265
|
-
clipPath: `url(#${h})`,
|
|
266
|
-
children: [
|
|
267
|
-
/* @__PURE__ */ i("ellipse", {
|
|
268
|
-
className: "ring blue-ring",
|
|
269
|
-
cx: "200",
|
|
270
|
-
cy: "200",
|
|
271
|
-
rx: "80",
|
|
272
|
-
ry: "160",
|
|
273
|
-
transform: "rotate(-60, 200, 200)"
|
|
274
|
-
}),
|
|
275
|
-
/* @__PURE__ */ i("ellipse", {
|
|
276
|
-
className: "ring purple-ring",
|
|
277
|
-
cx: "200",
|
|
278
|
-
cy: "200",
|
|
279
|
-
rx: "80",
|
|
280
|
-
ry: "160",
|
|
281
|
-
transform: "rotate(60, 200, 200)"
|
|
282
|
-
}),
|
|
283
|
-
/* @__PURE__ */ i("ellipse", {
|
|
284
|
-
className: "ring magenta-ring",
|
|
285
|
-
cx: "200",
|
|
286
|
-
cy: "200",
|
|
287
|
-
rx: "80",
|
|
288
|
-
ry: "160"
|
|
289
|
-
})
|
|
290
|
-
]
|
|
291
|
-
}),
|
|
292
|
-
/* @__PURE__ */ a("g", {
|
|
293
|
-
clipPath: `url(#${g})`,
|
|
294
|
-
children: [
|
|
295
|
-
/* @__PURE__ */ i("ellipse", {
|
|
296
|
-
className: "ring magenta-ring",
|
|
297
|
-
cx: "200",
|
|
298
|
-
cy: "200",
|
|
299
|
-
rx: "80",
|
|
300
|
-
ry: "160"
|
|
301
|
-
}),
|
|
302
|
-
/* @__PURE__ */ i("ellipse", {
|
|
303
|
-
className: "ring blue-ring",
|
|
304
|
-
cx: "200",
|
|
305
|
-
cy: "200",
|
|
306
|
-
rx: "80",
|
|
307
|
-
ry: "160",
|
|
308
|
-
transform: "rotate(-60, 200, 200)"
|
|
309
|
-
}),
|
|
310
|
-
/* @__PURE__ */ i("ellipse", {
|
|
311
|
-
className: "ring purple-ring",
|
|
312
|
-
cx: "200",
|
|
313
|
-
cy: "200",
|
|
314
|
-
rx: "80",
|
|
315
|
-
ry: "160",
|
|
316
|
-
transform: "rotate(60, 200, 200)"
|
|
317
|
-
})
|
|
318
|
-
]
|
|
319
|
-
})
|
|
320
|
-
]
|
|
321
|
-
});
|
|
322
|
-
};
|
|
323
|
-
export { o as BoxAILoadingIndicator, o as default };
|
|
57
|
+
`}),jsxs(`g`,{className:`bg-rings`,children:[jsxs(`g`,{clipPath:`url(#${clip1Id})`,children:[jsx(`ellipse`,{className:`ring-two blue-ring-two`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(-60, 200, 200)`}),jsx(`ellipse`,{className:`ring-two purple-ring-two`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(60, 200, 200)`}),jsx(`ellipse`,{className:`ring-two magenta-ring-two`,cx:`200`,cy:`200`,rx:`80`,ry:`160`})]}),jsxs(`g`,{clipPath:`url(#${clip2Id})`,children:[jsx(`ellipse`,{className:`ring-two magenta-ring-two`,cx:`200`,cy:`200`,rx:`80`,ry:`160`}),jsx(`ellipse`,{className:`ring-two blue-ring-two`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(-60, 200, 200)`}),jsx(`ellipse`,{className:`ring-two purple-ring-two`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(60, 200, 200)`})]})]}),jsxs(`g`,{clipPath:`url(#${clip1Id})`,children:[jsx(`ellipse`,{className:`ring blue-ring`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(-60, 200, 200)`}),jsx(`ellipse`,{className:`ring purple-ring`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(60, 200, 200)`}),jsx(`ellipse`,{className:`ring magenta-ring`,cx:`200`,cy:`200`,rx:`80`,ry:`160`})]}),jsxs(`g`,{clipPath:`url(#${clip2Id})`,children:[jsx(`ellipse`,{className:`ring magenta-ring`,cx:`200`,cy:`200`,rx:`80`,ry:`160`}),jsx(`ellipse`,{className:`ring blue-ring`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(-60, 200, 200)`}),jsx(`ellipse`,{className:`ring purple-ring`,cx:`200`,cy:`200`,rx:`80`,ry:`160`,transform:`rotate(60, 200, 200)`})]})]})};export{BoxAILoadingIndicator,BoxAILoadingIndicator as default};
|
|
@@ -1,24 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var t = e({
|
|
3
|
-
thinkingInProgress: {
|
|
4
|
-
id: "boxui.contentAnswers.thinkingInProgress",
|
|
5
|
-
defaultMessage: "Thinking..."
|
|
6
|
-
},
|
|
7
|
-
thinkingCompleted: {
|
|
8
|
-
id: "boxui.contentAnswers.thinkingCompleted",
|
|
9
|
-
defaultMessage: "Thinking Complete"
|
|
10
|
-
},
|
|
11
|
-
thinkingContentScrollableArea: {
|
|
12
|
-
id: "boxui.contentAnswers.thinkingContentScrollableArea",
|
|
13
|
-
defaultMessage: "Thinking content scrollable area"
|
|
14
|
-
},
|
|
15
|
-
expandThinkingContent: {
|
|
16
|
-
id: "boxui.contentAnswers.expandThinkingContent",
|
|
17
|
-
defaultMessage: "Expand"
|
|
18
|
-
},
|
|
19
|
-
collapseThinkingContent: {
|
|
20
|
-
id: "boxui.contentAnswers.collapseThinkingContent",
|
|
21
|
-
defaultMessage: "Collapse"
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
export { t as default };
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({thinkingInProgress:{id:`boxui.contentAnswers.thinkingInProgress`,defaultMessage:`Thinking...`},thinkingCompleted:{id:`boxui.contentAnswers.thinkingCompleted`,defaultMessage:`Thinking Complete`},thinkingContentScrollableArea:{id:`boxui.contentAnswers.thinkingContentScrollableArea`,defaultMessage:`Thinking content scrollable area`},expandThinkingContent:{id:`boxui.contentAnswers.expandThinkingContent`,defaultMessage:`Expand`},collapseThinkingContent:{id:`boxui.contentAnswers.collapseThinkingContent`,defaultMessage:`Collapse`}});export{messages as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as ThinkingBubble, e as default };
|
|
1
|
+
import{t as ThinkingBubble}from"../../../../chunks/thinkingBubble.js";export{ThinkingBubble,ThinkingBubble as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as ContextualItemsMessage, e as default };
|
|
1
|
+
import{t as ContextualItemsMessage}from"../../../../chunks/contextual-items-message.js";export{ContextualItemsMessage,ContextualItemsMessage as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as ItemsDropdown, e as default };
|
|
1
|
+
import{t as ItemsDropdown}from"../../../../chunks/items-dropdown.js";export{ItemsDropdown,ItemsDropdown as default};
|
|
@@ -1,52 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
welcomeAskQuestionText: {
|
|
12
|
-
id: "boxAI.contentAnswers.welcomeAskQuestionText",
|
|
13
|
-
defaultMessage: "Welcome to Box AI. Ask questions about {numberOfItems, plural, =1 {{firstItemName}} other {these {files}}}{parentItem, select, undefined {} other { in {parentItem}}}."
|
|
14
|
-
},
|
|
15
|
-
welcomeAskQuestionLandingText: {
|
|
16
|
-
id: "boxAI.contentAnswers.welcomeAskQuestionLandingText",
|
|
17
|
-
defaultMessage: "Welcome to Box AI"
|
|
18
|
-
},
|
|
19
|
-
fileLandingText: {
|
|
20
|
-
id: "boxAI.contentAnswers.fileLandingText",
|
|
21
|
-
defaultMessage: "{numberOfItems, plural, =1 {{firstItemName}} other {{files}}}{parentItem, select, undefined {} other { in {parentItem}}}"
|
|
22
|
-
},
|
|
23
|
-
welcomeMessageFilesLink: {
|
|
24
|
-
id: "boxAI.contentAnswers.welcomeMessageFilesLink",
|
|
25
|
-
defaultMessage: "{numberOfItems, plural,\n one {# file}\n other {# files}\n }"
|
|
26
|
-
},
|
|
27
|
-
welcomeMessageItemsLink: {
|
|
28
|
-
id: "boxAI.contentAnswers.welcomeMessageItemsLink",
|
|
29
|
-
defaultMessage: "{numberOfItems, plural,\n one {# item}\n other {# items}\n }"
|
|
30
|
-
},
|
|
31
|
-
welcomeClearChatText: {
|
|
32
|
-
id: "boxAI.contentAnswers.welcomeClearChatText",
|
|
33
|
-
defaultMessage: "Chat cleared when you close {type}"
|
|
34
|
-
},
|
|
35
|
-
unsupportedItems: {
|
|
36
|
-
id: "boxAI.contentAnswers.unsupportedItems",
|
|
37
|
-
defaultMessage: "{numberOfFiles, plural,\n one {{files} is unavailable for Box AI}\n other {{files} are unavailable for Box AI}\n }"
|
|
38
|
-
},
|
|
39
|
-
unsupportedFormatLabel: {
|
|
40
|
-
id: "boxAI.contentAnswers.unsupportedFormatLabel",
|
|
41
|
-
defaultMessage: "Unsupported format"
|
|
42
|
-
},
|
|
43
|
-
noPermissionsLabel: {
|
|
44
|
-
id: "boxAI.contentAnswers.noPermissionsLabel",
|
|
45
|
-
defaultMessage: "No Box AI permissions"
|
|
46
|
-
},
|
|
47
|
-
closeItemList: {
|
|
48
|
-
id: "boxAi.contentAnswers.closeItemList",
|
|
49
|
-
defaultMessage: "Close file items list"
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
export { t as default };
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({largeFileSizeWarningTitle:{id:`boxAI.contentAnswers.largeFileSizeWarningTitle`,defaultMessage:`Box AI won’t be able to access the entire content, which might affect its answers.`},largeFileSizeWarningDescription:{id:`boxAI.contentAnswers.largeFileSizeWarningDescription`,defaultMessage:`The content of {numberOfItems, plural, =1 {this file} other {one or more files}} is too large for Box AI to process.`},welcomeAskQuestionText:{id:`boxAI.contentAnswers.welcomeAskQuestionText`,defaultMessage:`Welcome to Box AI. Ask questions about {numberOfItems, plural, =1 {{firstItemName}} other {these {files}}}{parentItem, select, undefined {} other { in {parentItem}}}.`},welcomeAskQuestionLandingText:{id:`boxAI.contentAnswers.welcomeAskQuestionLandingText`,defaultMessage:`Welcome to Box AI`},fileLandingText:{id:`boxAI.contentAnswers.fileLandingText`,defaultMessage:`{numberOfItems, plural, =1 {{firstItemName}} other {{files}}}{parentItem, select, undefined {} other { in {parentItem}}}`},welcomeMessageFilesLink:{id:`boxAI.contentAnswers.welcomeMessageFilesLink`,defaultMessage:`{numberOfItems, plural,
|
|
2
|
+
one {# file}
|
|
3
|
+
other {# files}
|
|
4
|
+
}`},welcomeMessageItemsLink:{id:`boxAI.contentAnswers.welcomeMessageItemsLink`,defaultMessage:`{numberOfItems, plural,
|
|
5
|
+
one {# item}
|
|
6
|
+
other {# items}
|
|
7
|
+
}`},welcomeClearChatText:{id:`boxAI.contentAnswers.welcomeClearChatText`,defaultMessage:`Chat cleared when you close {type}`},unsupportedItems:{id:`boxAI.contentAnswers.unsupportedItems`,defaultMessage:`{numberOfFiles, plural,
|
|
8
|
+
one {{files} is unavailable for Box AI}
|
|
9
|
+
other {{files} are unavailable for Box AI}
|
|
10
|
+
}`},unsupportedFormatLabel:{id:`boxAI.contentAnswers.unsupportedFormatLabel`,defaultMessage:`Unsupported format`},noPermissionsLabel:{id:`boxAI.contentAnswers.noPermissionsLabel`,defaultMessage:`No Box AI permissions`},closeItemList:{id:`boxAi.contentAnswers.closeItemList`,defaultMessage:`Close file items list`}});export{messages as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as UnsupportedItemsNotice, e as default };
|
|
1
|
+
import{t as UnsupportedItemsNotice}from"../../../../chunks/unsupported-items-notice.js";export{UnsupportedItemsNotice,UnsupportedItemsNotice as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { e as WarningMessage };
|
|
1
|
+
import{t as WarningMessage}from"../../../../chunks/warning-message.js";export{WarningMessage};
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import t from "./messages.js";
|
|
3
|
-
import { t as n } from "../../../../chunks/contextual-items-message.js";
|
|
4
|
-
import { n as r, t as i } from "../../../../chunks/warning-message.js";
|
|
5
|
-
import { t as a } from "../../../../chunks/unsupported-items-notice.js";
|
|
6
|
-
import { useMemo as o } from "react";
|
|
7
|
-
import { useIntl as s } from "react-intl";
|
|
8
|
-
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
-
var d = ({ contentName: d, contentType: f, isFileSizeError: p = !1, items: m = [], parentItem: h, onItemClick: g, shouldShowLandingPage: _, variant: v = "modal", warningNotice: y, warningNoticeAriaLabel: b, warningNoticeDescription: x, welcomeMessageClearText: S, onDropdownOpenChange: C }) => {
|
|
10
|
-
let w = v === "sidebar", { formatMessage: T } = s(), E = o(() => m.filter((e) => e.status === "supported"), [m]), D = o(() => m.filter((e) => e.status === "unsupported"), [m]), O = o(() => m.filter((e) => e.status === "no_permission"), [m]), k = E.length || 1, A = () => /* @__PURE__ */ l(n, {
|
|
11
|
-
contentName: d,
|
|
12
|
-
isUsedInsideSidebar: w,
|
|
13
|
-
onDropdownOpenChange: C,
|
|
14
|
-
onItemClick: g,
|
|
15
|
-
parentItem: h,
|
|
16
|
-
shouldShowLandingPage: _,
|
|
17
|
-
supportedItems: E
|
|
18
|
-
});
|
|
19
|
-
return /* @__PURE__ */ l("div", {
|
|
20
|
-
className: r.welcomeMessage,
|
|
21
|
-
"data-testid": "content-answers-welcome-message",
|
|
22
|
-
children: /* @__PURE__ */ l(e, {
|
|
23
|
-
className: "welcomeMessage",
|
|
24
|
-
variant: v,
|
|
25
|
-
children: /* @__PURE__ */ l(e.Content, {
|
|
26
|
-
isUsedInsideSidebar: w,
|
|
27
|
-
variant: "welcomeMessage",
|
|
28
|
-
children: _ ? /* @__PURE__ */ u(c, { children: [A(), !p && !y && D.length === 0 && O.length === 0 ? null : /* @__PURE__ */ u("div", {
|
|
29
|
-
className: r.warnings,
|
|
30
|
-
children: [
|
|
31
|
-
p && /* @__PURE__ */ l(i, {
|
|
32
|
-
ariaLabel: T(t.largeFileSizeWarningTitle, { numberOfItems: k }),
|
|
33
|
-
description: T(t.largeFileSizeWarningDescription, { numberOfItems: k }),
|
|
34
|
-
title: T(t.largeFileSizeWarningTitle, { numberOfItems: k })
|
|
35
|
-
}),
|
|
36
|
-
y && /* @__PURE__ */ l(i, {
|
|
37
|
-
ariaLabel: b,
|
|
38
|
-
description: x,
|
|
39
|
-
title: y
|
|
40
|
-
}),
|
|
41
|
-
(D.length > 0 || O.length > 0) && /* @__PURE__ */ l(a, {
|
|
42
|
-
noPermissionsItems: O,
|
|
43
|
-
onDropdownOpenChange: C,
|
|
44
|
-
onItemClick: g,
|
|
45
|
-
unsupportedItems: D
|
|
46
|
-
})
|
|
47
|
-
]
|
|
48
|
-
})] }) : A()
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
export { d as WelcomeMessage, d as default };
|
|
1
|
+
import{t as MediaContainer}from"../../../../chunks/media-container.js";import messages from"./messages.js";import{t as ContextualItemsMessage}from"../../../../chunks/contextual-items-message.js";import{n as welcome_message_module_default,t as WarningMessage}from"../../../../chunks/warning-message.js";import{t as UnsupportedItemsNotice}from"../../../../chunks/unsupported-items-notice.js";import{useMemo}from"react";import{useIntl}from"react-intl";import{Fragment,jsx,jsxs}from"react/jsx-runtime";var WelcomeMessage=({contentName,contentType,isFileSizeError=!1,items=[],parentItem,onItemClick,shouldShowLandingPage,variant=`modal`,warningNotice,warningNoticeAriaLabel,warningNoticeDescription,welcomeMessageClearText,onDropdownOpenChange})=>{let hasSidebarVariant=variant===`sidebar`,{formatMessage}=useIntl(),supportedItems=useMemo(()=>items.filter(item=>item.status===`supported`),[items]),unsupportedItems=useMemo(()=>items.filter(item=>item.status===`unsupported`),[items]),noPermissionItems=useMemo(()=>items.filter(item=>item.status===`no_permission`),[items]),numberOfItems=supportedItems.length||1,renderContextualItemsMessage=()=>jsx(ContextualItemsMessage,{contentName,isUsedInsideSidebar:hasSidebarVariant,onDropdownOpenChange,onItemClick,parentItem,shouldShowLandingPage,supportedItems});return jsx(`div`,{className:welcome_message_module_default.welcomeMessage,"data-testid":`content-answers-welcome-message`,children:jsx(MediaContainer,{className:`welcomeMessage`,variant,children:jsx(MediaContainer.Content,{isUsedInsideSidebar:hasSidebarVariant,variant:`welcomeMessage`,children:shouldShowLandingPage?jsxs(Fragment,{children:[renderContextualItemsMessage(),!isFileSizeError&&!warningNotice&&unsupportedItems.length===0&&noPermissionItems.length===0?null:jsxs(`div`,{className:welcome_message_module_default.warnings,children:[isFileSizeError&&jsx(WarningMessage,{ariaLabel:formatMessage(messages.largeFileSizeWarningTitle,{numberOfItems}),description:formatMessage(messages.largeFileSizeWarningDescription,{numberOfItems}),title:formatMessage(messages.largeFileSizeWarningTitle,{numberOfItems})}),warningNotice&&jsx(WarningMessage,{ariaLabel:warningNoticeAriaLabel,description:warningNoticeDescription,title:warningNotice}),(unsupportedItems.length>0||noPermissionItems.length>0)&&jsx(UnsupportedItemsNotice,{noPermissionsItems:noPermissionItems,onDropdownOpenChange,onItemClick,unsupportedItems})]})]}):renderContextualItemsMessage()})})})};export{WelcomeMessage,WelcomeMessage as default};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
PREVIEW_MODAL: "preview_modal",
|
|
3
|
-
PREVIEW_SIDEBAR: "preview_sidebar",
|
|
4
|
-
ITEM_LIST_MODAL: "item_list_modal",
|
|
5
|
-
HUBS_MODAL: "hubs_modal",
|
|
6
|
-
NOTES_MODAL: "notes_modal",
|
|
7
|
-
QUICK_ACTIONS: "quick_actions"
|
|
8
|
-
}, t = "aiAgent";
|
|
9
|
-
export { t as AI_AGENTS_LOCAL_STORAGE_KEY, e as APP_MODE };
|
|
1
|
+
var APP_MODE={PREVIEW_MODAL:`preview_modal`,PREVIEW_SIDEBAR:`preview_sidebar`,ITEM_LIST_MODAL:`item_list_modal`,HUBS_MODAL:`hubs_modal`,NOTES_MODAL:`notes_modal`,QUICK_ACTIONS:`quick_actions`},AI_AGENTS_LOCAL_STORAGE_KEY=`aiAgent`;export{AI_AGENTS_LOCAL_STORAGE_KEY,APP_MODE};
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useEffect as t, useRef as n } from "react";
|
|
3
|
-
var r = (e, t, n) => () => {
|
|
4
|
-
let r = t.querySelector(e);
|
|
5
|
-
r && (r.focus(), n());
|
|
6
|
-
}, i = (e, t, n) => {
|
|
7
|
-
let i = document.querySelector(t);
|
|
8
|
-
if (!i) return null;
|
|
9
|
-
let a = new MutationObserver(r(e, i, () => {
|
|
10
|
-
a.disconnect(), n();
|
|
11
|
-
}));
|
|
12
|
-
return a.observe(document, {
|
|
13
|
-
childList: !0,
|
|
14
|
-
subtree: !0
|
|
15
|
-
}), a;
|
|
16
|
-
};
|
|
17
|
-
function a(r) {
|
|
18
|
-
let a = n(null), o = `[data-target-id="${e}"]`;
|
|
19
|
-
return t(() => () => {
|
|
20
|
-
a?.current?.disconnect();
|
|
21
|
-
}, [a]), { focusPrompt: () => {
|
|
22
|
-
let e = document.querySelector(o);
|
|
23
|
-
e ? e.focus() : a?.current || (a.current = i(o, r, () => {
|
|
24
|
-
a.current = null;
|
|
25
|
-
}));
|
|
26
|
-
} };
|
|
27
|
-
}
|
|
28
|
-
export { a as usePromptFocus };
|
|
1
|
+
import{INPUT_TARGET_ID}from"../components/footer/constants.js";import{useEffect,useRef}from"react";var getMutationObserverCallback=(promptSelector,sidebar,callback)=>()=>{let element=sidebar.querySelector(promptSelector);element&&(element.focus(),callback())},getBoxAISidebarPromptObserver=(promptSelector,containerElementSelector,callback)=>{let sidebar=document.querySelector(containerElementSelector);if(!sidebar)return null;let observer=new MutationObserver(getMutationObserverCallback(promptSelector,sidebar,()=>{observer.disconnect(),callback()}));return observer.observe(document,{childList:!0,subtree:!0}),observer};function usePromptFocus(containerSelector){let boxAISidebarPromptObserver=useRef(null),promptSelector=`[data-target-id="${INPUT_TARGET_ID}"]`;return useEffect(()=>()=>{boxAISidebarPromptObserver?.current?.disconnect()},[boxAISidebarPromptObserver]),{focusPrompt:()=>{let boxAISidebarPromptTexarea=document.querySelector(promptSelector);boxAISidebarPromptTexarea?boxAISidebarPromptTexarea.focus():boxAISidebarPromptObserver?.current||(boxAISidebarPromptObserver.current=getBoxAISidebarPromptObserver(promptSelector,containerSelector,()=>{boxAISidebarPromptObserver.current=null}))}}}export{usePromptFocus};
|
package/dist/esm/lib/messages.js
CHANGED
|
@@ -1,56 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
var t = e({
|
|
3
|
-
ariaTypeSuccessIconLabel: {
|
|
4
|
-
id: "boxAI.contentAnswers.ariaTypeSuccessIconLabel",
|
|
5
|
-
defaultMessage: "success"
|
|
6
|
-
},
|
|
7
|
-
cancel: {
|
|
8
|
-
id: "boxAI.contentAnswers.cancel",
|
|
9
|
-
defaultMessage: "Cancel"
|
|
10
|
-
},
|
|
11
|
-
closeButtonText: {
|
|
12
|
-
id: "boxAI.popup.closeButtonText",
|
|
13
|
-
defaultMessage: "Close"
|
|
14
|
-
},
|
|
15
|
-
contentAnswersTitle: {
|
|
16
|
-
id: "boxAI.contentAnswers.contentAnswersTitle",
|
|
17
|
-
defaultMessage: "Box AI"
|
|
18
|
-
},
|
|
19
|
-
continueAnyway: {
|
|
20
|
-
id: "boxAI.contentAnswers.continueAnyway",
|
|
21
|
-
defaultMessage: "Continue anyway"
|
|
22
|
-
},
|
|
23
|
-
defaultTooltip: {
|
|
24
|
-
id: "boxAI.contentAnswers.defaultTooltip",
|
|
25
|
-
defaultMessage: "Get instant answers about this document using Box AI"
|
|
26
|
-
},
|
|
27
|
-
disabledTooltipFileNotCompatible: {
|
|
28
|
-
id: "boxAI.contentAnswers.disabledTooltipFileNotCompatible",
|
|
29
|
-
defaultMessage: "Box AI is not currently supported for this file type"
|
|
30
|
-
},
|
|
31
|
-
disabledTooltipAINotAvailable: {
|
|
32
|
-
id: "boxAI.contentAnswers.disabledTooltipAINotAvailable",
|
|
33
|
-
defaultMessage: "Box AI doesn't have permission to access this file"
|
|
34
|
-
},
|
|
35
|
-
disabledTooltipPermissionsFailed: {
|
|
36
|
-
id: "boxAI.contentAnswers.disabledTooltipPermissionsFailed",
|
|
37
|
-
defaultMessage: "Unable to check permissions at this time. Reload this page to try again"
|
|
38
|
-
},
|
|
39
|
-
disabledTooltipPermissionsLoading: {
|
|
40
|
-
id: "boxAI.contentAnswers.disabledTooltipPermissionsLoading",
|
|
41
|
-
defaultMessage: "Checking permissions..."
|
|
42
|
-
},
|
|
43
|
-
hasQuestionsTooltip: {
|
|
44
|
-
id: "boxAI.contentAnswers.hasQuestionsTooltip",
|
|
45
|
-
defaultMessage: "Return to Box AI"
|
|
46
|
-
},
|
|
47
|
-
loading: {
|
|
48
|
-
id: "boxAI.contentAnswers.loading",
|
|
49
|
-
defaultMessage: "Loading..."
|
|
50
|
-
},
|
|
51
|
-
userAvatar: {
|
|
52
|
-
id: "boxAI.contentAnswers.userAvatar",
|
|
53
|
-
defaultMessage: "User avatar"
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
export { t as default };
|
|
1
|
+
import{defineMessages}from"react-intl";var messages=defineMessages({ariaTypeSuccessIconLabel:{id:`boxAI.contentAnswers.ariaTypeSuccessIconLabel`,defaultMessage:`success`},cancel:{id:`boxAI.contentAnswers.cancel`,defaultMessage:`Cancel`},closeButtonText:{id:`boxAI.popup.closeButtonText`,defaultMessage:`Close`},contentAnswersTitle:{id:`boxAI.contentAnswers.contentAnswersTitle`,defaultMessage:`Box AI`},continueAnyway:{id:`boxAI.contentAnswers.continueAnyway`,defaultMessage:`Continue anyway`},defaultTooltip:{id:`boxAI.contentAnswers.defaultTooltip`,defaultMessage:`Get instant answers about this document using Box AI`},disabledTooltipFileNotCompatible:{id:`boxAI.contentAnswers.disabledTooltipFileNotCompatible`,defaultMessage:`Box AI is not currently supported for this file type`},disabledTooltipAINotAvailable:{id:`boxAI.contentAnswers.disabledTooltipAINotAvailable`,defaultMessage:`Box AI doesn't have permission to access this file`},disabledTooltipPermissionsFailed:{id:`boxAI.contentAnswers.disabledTooltipPermissionsFailed`,defaultMessage:`Unable to check permissions at this time. Reload this page to try again`},disabledTooltipPermissionsLoading:{id:`boxAI.contentAnswers.disabledTooltipPermissionsLoading`,defaultMessage:`Checking permissions...`},hasQuestionsTooltip:{id:`boxAI.contentAnswers.hasQuestionsTooltip`,defaultMessage:`Return to Box AI`},loading:{id:`boxAI.contentAnswers.loading`,defaultMessage:`Loading...`},userAvatar:{id:`boxAI.contentAnswers.userAvatar`,defaultMessage:`User avatar`}});export{messages as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
export { e as BOX_SUPPORTED_FILE_EXTENSIONS };
|
|
1
|
+
var BOX_SUPPORTED_FILE_EXTENSIONS=`aac.aif.aifc.aiff.amr.au.flac.m4a.mp3.ogg.ra.wav.wma.3ds.box3d.dae.dwg.dxf.fbx.mtl.obj.ply.stl.as.as3.asm.bat.boxnote.c.cc.cmake.cpp.cs.css.cxx.diff.doc.docx.eml.erb.groovy.h.haml.hh.hpp.htm.html.java.js.json.jww.less.log.m.make.md.ml.msg.olk14Message.pdf.php.pl.properties.py.rb.rst.sass.scala.scm.script.sh.sml.sql.vb.vi.vim.wpd.xhtml.xml.xsd.xsl.xbd.xdw.pyc.ai.boxcanvas.indd.odg.psd.svg.arw.bmp.cr2.dcm.dicm.dicom.dng.eps.exr.gif.heic.indd.indml.indt.inx.jpeg.jpg.nef.png.svg.tif.tiff.tga.svs.fodp.gslide.gslides.key.keynote.odp.otp.pez.pot.ppt.pptx.csv.fods.gsheet.numbers.ods.tsv.xls.xlsm.xlsx.xlsb.3g2.3gp.avi.fla.flv.m2v.m2ts.m4v.mkv.mov.mpeg.mpg.mts.swf.ogg.qt.ts`.split(`.`);export{BOX_SUPPORTED_FILE_EXTENSIONS};
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
try {
|
|
3
|
-
let { hostname: t } = new URL(e);
|
|
4
|
-
return t.endsWith(".box.com") || t.endsWith(".box.net");
|
|
5
|
-
} catch {
|
|
6
|
-
return !1;
|
|
7
|
-
}
|
|
8
|
-
}, t = (e) => e.includes(".box.com") || e.includes(".box.net"), n = (e, t = {}) => {
|
|
9
|
-
let { items: n = [], isCompleted: r = !0, isInlineCitationsEnabled: i = !0, baseUrl: a = typeof window < "u" ? window.location.origin : "" } = t;
|
|
10
|
-
if (!n.length || !r || !i) return e;
|
|
11
|
-
let o = e;
|
|
12
|
-
return n.forEach((e) => {
|
|
13
|
-
if (!e.name || !e.id || e.type !== "file") return;
|
|
14
|
-
let t = `${a}/file/${e.id}`, n = e.name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), r = RegExp(`\\b${n}\\b`, "gi");
|
|
15
|
-
o = o.replace(r, `[${e.name}](${t})`);
|
|
16
|
-
}), o;
|
|
17
|
-
};
|
|
18
|
-
export { n as default, n as injectInlineCitation, t as isBoxCitation, e as isBoxDomain };
|
|
1
|
+
var isBoxDomain=url=>{try{let{hostname}=new URL(url);return hostname.endsWith(`.box.com`)||hostname.endsWith(`.box.net`)}catch{return!1}},isBoxCitation=url=>url.includes(`.box.com`)||url.includes(`.box.net`),injectInlineCitation=(text,options={})=>{let{items=[],isCompleted=!0,isInlineCitationsEnabled=!0,baseUrl=typeof window<`u`?window.location.origin:``}=options;if(!items.length||!isCompleted||!isInlineCitationsEnabled)return text;let processedText=text;return items.forEach(item=>{if(!item.name||!item.id||item.type!==`file`)return;let fileURL=`${baseUrl}/file/${item.id}`,escapedFileName=item.name.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),regex=RegExp(`\\b${escapedFileName}\\b`,`gi`);processedText=processedText.replace(regex,`[${item.name}](${fileURL})`)}),processedText};export{injectInlineCitation as default,injectInlineCitation,isBoxCitation,isBoxDomain};
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-ai-content-answers",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.40",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@box/blueprint-web": "^16.13.
|
|
6
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
7
|
-
"@box/box-ai-agent-selector": "^2.1.
|
|
8
|
-
"@box/item-icon": "^3.2.
|
|
5
|
+
"@box/blueprint-web": "^16.13.2",
|
|
6
|
+
"@box/blueprint-web-assets": "^5.5.11",
|
|
7
|
+
"@box/box-ai-agent-selector": "^2.1.37",
|
|
8
|
+
"@box/item-icon": "^3.2.35",
|
|
9
9
|
"formik": "^2.0.3",
|
|
10
10
|
"highlight.js": "^11.9.0",
|
|
11
11
|
"immutable": ">3.0.0",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"remarkable": "^2.0.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@box/babel-plugin-target-attributes": "2.1.
|
|
20
|
-
"@box/blueprint-web": "^16.13.
|
|
21
|
-
"@box/blueprint-web-assets": "^5.5.
|
|
22
|
-
"@box/box-ai-agent-selector": "^2.1.
|
|
23
|
-
"@box/item-icon": "^3.2.
|
|
24
|
-
"@box/storybook-utils": "^1.1.
|
|
19
|
+
"@box/babel-plugin-target-attributes": "2.1.11",
|
|
20
|
+
"@box/blueprint-web": "^16.13.2",
|
|
21
|
+
"@box/blueprint-web-assets": "^5.5.11",
|
|
22
|
+
"@box/box-ai-agent-selector": "^2.1.37",
|
|
23
|
+
"@box/item-icon": "^3.2.35",
|
|
24
|
+
"@box/storybook-utils": "^1.1.35",
|
|
25
25
|
"@testing-library/react": "^15.0.6",
|
|
26
26
|
"immutable": "^3.8.1",
|
|
27
27
|
"react": "^18.3.0",
|