@box/box-ai-content-answers 1.19.3 → 1.20.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/clear-conversation-button.js +15 -16
- package/dist/chunks/stopResponseButton.js +19 -23
- package/dist/chunks/types.js +8 -8
- package/dist/chunks/warning-message.js +15 -16
- package/dist/esm/lib/components/answer/answer-content.js +15 -15
- package/dist/esm/lib/components/answer/answer.js +107 -109
- package/dist/esm/lib/components/answer/citation.js +23 -24
- package/dist/esm/lib/components/answer/copy-button.js +3 -3
- package/dist/esm/lib/components/answer/embed-the-answer-button.js +44 -44
- package/dist/esm/lib/components/answer/feedback-tooltip.js +63 -56
- package/dist/esm/lib/components/answer/inline-error.js +1 -1
- package/dist/esm/lib/components/answer/loading-indicator.js +15 -18
- package/dist/esm/lib/components/answer/references.js +30 -30
- package/dist/esm/lib/components/answer/thumb-buttons.js +95 -96
- package/dist/esm/lib/components/api-wrapper/hooks/useContentAnswers.js +166 -167
- package/dist/esm/lib/components/api-wrapper/reducer.js +1 -1
- package/dist/esm/lib/components/api-wrapper/utils/request.js +8 -8
- package/dist/esm/lib/components/api-wrapper/utils/stream.js +24 -25
- package/dist/esm/lib/components/chat/chat.js +78 -79
- package/dist/esm/lib/components/common/focusInputUtils.js +3 -4
- package/dist/esm/lib/components/common/markdown-react.js +91 -93
- package/dist/esm/lib/components/common/markdown.js +2666 -2696
- package/dist/esm/lib/components/content/content.js +38 -39
- package/dist/esm/lib/components/footer/footer-actions.js +3 -3
- package/dist/esm/lib/components/footer/footer.js +97 -98
- package/dist/esm/lib/components/modal/modal.js +121 -122
- package/dist/esm/lib/components/sidebar/content.js +95 -101
- package/dist/esm/lib/components/sidebar/sidebar.js +82 -83
- package/dist/esm/lib/components/suggested-questions/suggested-questions.js +1 -1
- package/dist/esm/lib/components/suggested-questions/suggestions.js +30 -30
- package/dist/esm/lib/components/welcome-message/contextual-items-message.js +36 -38
- package/dist/esm/lib/components/welcome-message/items-dropdown.js +27 -27
- package/dist/esm/lib/hooks/usePromptFocus.js +13 -14
- package/dist/i18n/en-x-pseudo.js +89 -89
- package/dist/i18n/en-x-pseudo.properties +89 -89
- package/dist/styles/answer-content.css +1 -1
- package/dist/styles/answer.css +1 -1
- package/dist/styles/box-ai-content-answers.css +1 -1
- package/dist/styles/chat.css +1 -1
- package/dist/styles/clear-conversation-button.css +1 -1
- package/dist/styles/content.css +1 -1
- package/dist/styles/content2.css +1 -1
- package/dist/styles/markdown2.css +1 -1
- package/dist/styles/question.css +1 -1
- package/dist/styles/stopResponseButton.css +1 -1
- package/dist/styles/warning-message.css +1 -1
- package/dist/types/lib/components/api-wrapper/hooks/useContentAnswers.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,105 +1,104 @@
|
|
|
1
|
-
import { AgentsProvider as
|
|
2
|
-
import * as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { SPREADSHEET_FILE_EXTENSIONS as
|
|
5
|
-
import
|
|
6
|
-
import { IntelligenceSidebarContext as
|
|
7
|
-
import
|
|
8
|
-
import { jsx as
|
|
9
|
-
const
|
|
10
|
-
var P;
|
|
1
|
+
import { AgentsProvider as U } from "@box/box-ai-agent-selector";
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import { useIntl as V } from "react-intl";
|
|
4
|
+
import { SPREADSHEET_FILE_EXTENSIONS as X, INTELLIGENT_QUERY_COMPATIBLE_SPREADSHEET_EXTENSIONS as j } from "../common/constants.js";
|
|
5
|
+
import G from "./content.js";
|
|
6
|
+
import { IntelligenceSidebarContext as W } from "./context.js";
|
|
7
|
+
import u from "./messages.js";
|
|
8
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
9
|
+
const se = (P) => {
|
|
11
10
|
const {
|
|
12
11
|
cache: e,
|
|
13
|
-
contentName:
|
|
14
|
-
elementId:
|
|
15
|
-
fileExtension:
|
|
16
|
-
fileID:
|
|
17
|
-
getSuggestedQuestions:
|
|
18
|
-
isIntelligentQueryMode:
|
|
19
|
-
isFeedbackEnabled:
|
|
20
|
-
isFeedbackFormEnabled:
|
|
21
|
-
isStopResponseEnabled:
|
|
22
|
-
items:
|
|
23
|
-
itemSize:
|
|
24
|
-
localizedQuestions:
|
|
25
|
-
onFeedbackFormSubmit:
|
|
26
|
-
onUserInteraction:
|
|
27
|
-
onSelectedAgentCallback:
|
|
28
|
-
recordAction:
|
|
12
|
+
contentName: m,
|
|
13
|
+
elementId: S,
|
|
14
|
+
fileExtension: s,
|
|
15
|
+
fileID: F,
|
|
16
|
+
getSuggestedQuestions: f,
|
|
17
|
+
isIntelligentQueryMode: L,
|
|
18
|
+
isFeedbackEnabled: h,
|
|
19
|
+
isFeedbackFormEnabled: p,
|
|
20
|
+
isStopResponseEnabled: n = !1,
|
|
21
|
+
items: o,
|
|
22
|
+
itemSize: E,
|
|
23
|
+
localizedQuestions: T,
|
|
24
|
+
onFeedbackFormSubmit: Q,
|
|
25
|
+
onUserInteraction: I,
|
|
26
|
+
onSelectedAgentCallback: b,
|
|
27
|
+
recordAction: N,
|
|
29
28
|
setCacheValue: i,
|
|
30
|
-
shouldPreinitSession:
|
|
31
|
-
setHasQuestions:
|
|
32
|
-
promptButtonClickHandler:
|
|
33
|
-
embedTheAnswerButtonConfig:
|
|
34
|
-
onClose:
|
|
35
|
-
...
|
|
36
|
-
} =
|
|
37
|
-
questions:
|
|
38
|
-
agents:
|
|
29
|
+
shouldPreinitSession: l = !0,
|
|
30
|
+
setHasQuestions: r,
|
|
31
|
+
promptButtonClickHandler: M,
|
|
32
|
+
embedTheAnswerButtonConfig: k,
|
|
33
|
+
onClose: H,
|
|
34
|
+
..._
|
|
35
|
+
} = P, {
|
|
36
|
+
questions: t,
|
|
37
|
+
agents: v
|
|
39
38
|
} = e, {
|
|
40
|
-
selectedAgent:
|
|
41
|
-
} =
|
|
42
|
-
formatMessage:
|
|
43
|
-
} =
|
|
39
|
+
selectedAgent: x
|
|
40
|
+
} = v, {
|
|
41
|
+
formatMessage: d
|
|
42
|
+
} = V(), R = w.useMemo(() => ({
|
|
44
43
|
cache: e,
|
|
45
|
-
contentName:
|
|
46
|
-
elementId:
|
|
47
|
-
fileExtension:
|
|
48
|
-
isFeedbackEnabled:
|
|
49
|
-
isFeedbackFormEnabled:
|
|
50
|
-
isStopResponseEnabled:
|
|
51
|
-
items:
|
|
52
|
-
itemSize:
|
|
53
|
-
onFeedbackFormSubmit:
|
|
54
|
-
onUserInteraction:
|
|
55
|
-
onSelectedAgentCallback:
|
|
56
|
-
recordAction:
|
|
44
|
+
contentName: m,
|
|
45
|
+
elementId: S,
|
|
46
|
+
fileExtension: s,
|
|
47
|
+
isFeedbackEnabled: h,
|
|
48
|
+
isFeedbackFormEnabled: p,
|
|
49
|
+
isStopResponseEnabled: n,
|
|
50
|
+
items: o,
|
|
51
|
+
itemSize: E,
|
|
52
|
+
onFeedbackFormSubmit: Q,
|
|
53
|
+
onUserInteraction: I,
|
|
54
|
+
onSelectedAgentCallback: b,
|
|
55
|
+
recordAction: N,
|
|
57
56
|
setCacheValue: i,
|
|
58
|
-
shouldPreinitSession:
|
|
59
|
-
}), [e, S,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
const
|
|
57
|
+
shouldPreinitSession: l
|
|
58
|
+
}), [e, m, S, s, h, p, n, o, E, Q, I, b, N, i, l]), A = t.length > 0;
|
|
59
|
+
w.useEffect(() => {
|
|
60
|
+
r && r(A);
|
|
61
|
+
}, [A, r]);
|
|
62
|
+
let a = t;
|
|
63
|
+
t.length > 0 && !t[t.length - 1].isCompleted && (a = a.slice(0, -1));
|
|
64
|
+
const y = X.includes(s), D = j.includes(s);
|
|
66
65
|
let c = "";
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
i("suggestedQuestions",
|
|
70
|
-
},
|
|
66
|
+
L && D ? c = d(u.welcomeMessageIntelligentQueryNotice) : y && (c = d(u.welcomeMessageSpreadsheetNotice));
|
|
67
|
+
const C = x?.suggestedQuestions !== null, O = (z) => {
|
|
68
|
+
i("suggestedQuestions", z);
|
|
69
|
+
}, B = typeof f == "function" ? [] : T, q = e.suggestedQuestions?.length > 0 && !C ? e.suggestedQuestions : B;
|
|
71
70
|
return (
|
|
72
71
|
// IntelligenceSidebarContent is using withApiWrapper that is not passing all provided props,
|
|
73
72
|
// that's why we need to use provider to pass other props
|
|
74
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ g(U, {
|
|
75
74
|
value: e.agents,
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
-
value:
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
cachedSuggestedQuestions:
|
|
80
|
-
embedTheAnswerButtonConfig:
|
|
81
|
-
getSuggestedQuestions:
|
|
75
|
+
children: /* @__PURE__ */ g(W.Provider, {
|
|
76
|
+
value: R,
|
|
77
|
+
children: /* @__PURE__ */ g(G, {
|
|
78
|
+
cachedSuggestedQuestions: C ? [] : e.suggestedQuestions,
|
|
79
|
+
embedTheAnswerButtonConfig: k,
|
|
80
|
+
getSuggestedQuestions: f,
|
|
82
81
|
isOpen: !0,
|
|
83
|
-
isStopResponseEnabled:
|
|
84
|
-
itemID:
|
|
85
|
-
items:
|
|
86
|
-
onClose:
|
|
87
|
-
onSuggestedQuestionsFetched:
|
|
88
|
-
promptButtonClickHandler:
|
|
89
|
-
restoredQuestions:
|
|
82
|
+
isStopResponseEnabled: n,
|
|
83
|
+
itemID: F,
|
|
84
|
+
items: o,
|
|
85
|
+
onClose: H,
|
|
86
|
+
onSuggestedQuestionsFetched: O,
|
|
87
|
+
promptButtonClickHandler: M,
|
|
88
|
+
restoredQuestions: a,
|
|
90
89
|
restoredSession: e.encodedSession,
|
|
91
90
|
restoredShouldShowLandingPage: e.shouldShowLandingPage,
|
|
92
|
-
shouldPreinitSession:
|
|
93
|
-
suggestedQuestions:
|
|
91
|
+
shouldPreinitSession: l,
|
|
92
|
+
suggestedQuestions: q,
|
|
94
93
|
warningNotice: c,
|
|
95
|
-
warningNoticeAriaLabel: u
|
|
96
|
-
...
|
|
94
|
+
warningNoticeAriaLabel: d(u.welcomeMessageSpreadsheetNoticeAriaLabel),
|
|
95
|
+
..._
|
|
97
96
|
})
|
|
98
97
|
})
|
|
99
98
|
})
|
|
100
99
|
);
|
|
101
100
|
};
|
|
102
101
|
export {
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
se as IntelligenceSidebar,
|
|
103
|
+
se as default
|
|
105
104
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Text as N, LoadingIndicator as O } from "@box/blueprint-web";
|
|
2
2
|
import { AlertTriangle as x } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
-
import {
|
|
3
|
+
import { Size4 as _, Gray65 as C } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
4
|
import f from "clsx";
|
|
5
5
|
import * as G from "react";
|
|
6
6
|
import { useIntl as w } from "react-intl";
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { FilterChip as
|
|
1
|
+
import { FilterChip as o } from "@box/blueprint-web";
|
|
2
2
|
import d from "clsx";
|
|
3
|
-
import
|
|
3
|
+
import m from "lodash/noop";
|
|
4
4
|
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
-
import '../../../../styles/suggestions.css';const
|
|
6
|
-
suggestions:
|
|
5
|
+
import '../../../../styles/suggestions.css';const y = "_suggestions_1yvk2_2", w = "_suggestion_1yvk2_2", e = {
|
|
6
|
+
suggestions: y,
|
|
7
7
|
suggestion: w
|
|
8
|
-
},
|
|
9
|
-
askSuggestedQuestion:
|
|
10
|
-
isLoading:
|
|
8
|
+
}, b = ({
|
|
9
|
+
askSuggestedQuestion: i,
|
|
10
|
+
isLoading: g,
|
|
11
11
|
onSuggestedQuestionClick: a,
|
|
12
|
-
onSuggestedQuestionInteraction:
|
|
13
|
-
suggestedQuestions:
|
|
14
|
-
variant:
|
|
12
|
+
onSuggestedQuestionInteraction: r = m,
|
|
13
|
+
suggestedQuestions: p,
|
|
14
|
+
variant: l = "modal"
|
|
15
15
|
}) => {
|
|
16
|
-
const c =
|
|
17
|
-
(
|
|
16
|
+
const c = i?.prompt, u = (s) => {
|
|
17
|
+
(s.key === "ArrowUp" || s.key === "ArrowDown" || s.key === "ArrowLeft" || s.key === "ArrowRight") && s.stopPropagation();
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */ t(
|
|
20
|
-
className: d(
|
|
19
|
+
return /* @__PURE__ */ t(o.Group, {
|
|
20
|
+
className: d(e.suggestions, l === "sidebar" && e.sidebar),
|
|
21
21
|
"data-testid": "content-answers-suggested-questions",
|
|
22
22
|
name: "Singleselect SuggestedQuestions",
|
|
23
|
-
onKeyDown:
|
|
23
|
+
onKeyDown: u,
|
|
24
24
|
type: "single",
|
|
25
25
|
value: c,
|
|
26
|
-
children:
|
|
27
|
-
const
|
|
28
|
-
return /* @__PURE__ */ t(
|
|
29
|
-
className:
|
|
30
|
-
"data-testid": `content-answers-${
|
|
31
|
-
disabled:
|
|
32
|
-
onClick: () => a(
|
|
33
|
-
onFocus:
|
|
34
|
-
onMouseEnter:
|
|
35
|
-
value:
|
|
36
|
-
children: /* @__PURE__ */ t(
|
|
37
|
-
children:
|
|
26
|
+
children: p.map((s) => {
|
|
27
|
+
const n = s.label || s.prompt;
|
|
28
|
+
return /* @__PURE__ */ t(o.ChipButton, {
|
|
29
|
+
className: e.suggestion,
|
|
30
|
+
"data-testid": `content-answers-${s.id}`,
|
|
31
|
+
disabled: g,
|
|
32
|
+
onClick: () => a(s),
|
|
33
|
+
onFocus: r,
|
|
34
|
+
onMouseEnter: r,
|
|
35
|
+
value: n,
|
|
36
|
+
children: /* @__PURE__ */ t(o.Label, {
|
|
37
|
+
children: n
|
|
38
38
|
})
|
|
39
|
-
},
|
|
39
|
+
}, s.id);
|
|
40
40
|
})
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
b as Suggestions,
|
|
45
|
+
b as default
|
|
46
46
|
};
|
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FormattedMessage as
|
|
3
|
-
import { ItemsDropdown as
|
|
1
|
+
import T from "clsx";
|
|
2
|
+
import { FormattedMessage as o } from "react-intl";
|
|
3
|
+
import { ItemsDropdown as _ } from "./items-dropdown.js";
|
|
4
4
|
import m from "./messages.js";
|
|
5
|
-
import { jsxs as
|
|
6
|
-
import '../../../../styles/contextual-items-message.css';const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
shouldShowLandingPage: o,
|
|
5
|
+
import { jsxs as g, jsx as e } from "react/jsx-runtime";
|
|
6
|
+
import '../../../../styles/contextual-items-message.css';const w = "_fileLandingText_16t3n_1", D = "_welcomeFileDataLandingText_16t3n_1", L = "_askQuestionText_16t3n_1", p = "_sidebar_16t3n_4", u = "_itemsDropdown_16t3n_38", t = {
|
|
7
|
+
fileLandingText: w,
|
|
8
|
+
welcomeFileDataLandingText: D,
|
|
9
|
+
askQuestionText: L,
|
|
10
|
+
sidebar: p,
|
|
11
|
+
itemsDropdown: u
|
|
12
|
+
}, Q = ({
|
|
13
|
+
contentName: l,
|
|
14
|
+
isUsedInsideSidebar: r = !1,
|
|
15
|
+
onDropdownOpenChange: d,
|
|
16
|
+
onItemClick: c,
|
|
17
|
+
parentItem: s,
|
|
18
|
+
shouldShowLandingPage: i,
|
|
20
19
|
supportedItems: n
|
|
21
20
|
}) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
[t.
|
|
27
|
-
[t.
|
|
28
|
-
[t.sidebar]: d
|
|
21
|
+
const x = n.length || 1, f = n[0]?.name || l, a = s?.id !== "0" ? s?.name : void 0;
|
|
22
|
+
return /* @__PURE__ */ g("div", {
|
|
23
|
+
className: T({
|
|
24
|
+
[t.askQuestionText]: !i,
|
|
25
|
+
[t.welcomeFileDataLandingText]: i,
|
|
26
|
+
[t.sidebar]: r
|
|
29
27
|
}),
|
|
30
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ e("div", {
|
|
31
29
|
className: t.welcomeText,
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ e("b", {
|
|
31
|
+
children: /* @__PURE__ */ e(o, {
|
|
34
32
|
...m.welcomeAskQuestionLandingText
|
|
35
33
|
})
|
|
36
34
|
})
|
|
37
|
-
}), /* @__PURE__ */
|
|
35
|
+
}), /* @__PURE__ */ e("div", {
|
|
38
36
|
className: t.fileLandingText,
|
|
39
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ e(o, {
|
|
40
38
|
...m.fileLandingText,
|
|
41
39
|
values: {
|
|
42
|
-
firstItemName:
|
|
43
|
-
parentItem:
|
|
44
|
-
numberOfItems:
|
|
45
|
-
files: /* @__PURE__ */
|
|
40
|
+
firstItemName: f,
|
|
41
|
+
parentItem: a && `'${a}'`,
|
|
42
|
+
numberOfItems: x,
|
|
43
|
+
files: /* @__PURE__ */ e(_, {
|
|
46
44
|
className: t.itemsDropdown,
|
|
47
|
-
onDropdownOpenChange:
|
|
48
|
-
onItemClick:
|
|
45
|
+
onDropdownOpenChange: d,
|
|
46
|
+
onItemClick: c,
|
|
49
47
|
supportedItems: n
|
|
50
48
|
})
|
|
51
49
|
}
|
|
@@ -54,6 +52,6 @@ import '../../../../styles/contextual-items-message.css';const D = "_commonWelco
|
|
|
54
52
|
});
|
|
55
53
|
};
|
|
56
54
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
Q as ContextualItemsMessage,
|
|
56
|
+
Q as default
|
|
59
57
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useBreakpoint as
|
|
2
|
-
import { Size5 as
|
|
3
|
-
import { ItemIcon as
|
|
1
|
+
import { useBreakpoint as u, Breakpoint as N, DropdownMenu as e, Link as T, Text as _ } from "@box/blueprint-web";
|
|
2
|
+
import { Size5 as C } from "@box/blueprint-web-assets/tokens/tokens";
|
|
3
|
+
import { ItemIcon as x } from "@box/item-icon";
|
|
4
4
|
import M from "clsx";
|
|
5
|
-
import { useMemo as
|
|
5
|
+
import { useMemo as w, useCallback as F } from "react";
|
|
6
6
|
import { useIntl as H } from "react-intl";
|
|
7
7
|
import r from "./messages.js";
|
|
8
8
|
import { jsxs as s, jsx as n, Fragment as y } from "react/jsx-runtime";
|
|
@@ -13,23 +13,23 @@ import '../../../../styles/items-dropdown.css';const O = "_itemsDropdownTriggerL
|
|
|
13
13
|
itemsDropdownItemName: j,
|
|
14
14
|
itemsDropdownLabel: z
|
|
15
15
|
}, K = ({
|
|
16
|
-
className:
|
|
16
|
+
className: I,
|
|
17
17
|
supportedItems: t = [],
|
|
18
|
-
unsupportedItems:
|
|
19
|
-
noPermissionItems:
|
|
20
|
-
onItemClick:
|
|
21
|
-
onDropdownOpenChange:
|
|
18
|
+
unsupportedItems: c = [],
|
|
19
|
+
noPermissionItems: d = [],
|
|
20
|
+
onItemClick: g,
|
|
21
|
+
onDropdownOpenChange: b
|
|
22
22
|
}) => {
|
|
23
23
|
const {
|
|
24
|
-
formatMessage:
|
|
25
|
-
} = H(), D =
|
|
24
|
+
formatMessage: i
|
|
25
|
+
} = H(), D = u(), h = w(() => D === N.Small, [D]), k = F(({
|
|
26
26
|
id: m,
|
|
27
27
|
name: l
|
|
28
28
|
}) => {
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
numberOfItems: t.length +
|
|
32
|
-
}), [t,
|
|
29
|
+
g?.(m, l);
|
|
30
|
+
}, [g]), L = w(() => t.length > 0 ? r.welcomeMessageFilesLink : r.welcomeMessageItemsLink, [t]), f = w(() => i(L, {
|
|
31
|
+
numberOfItems: t.length + c.length + d.length
|
|
32
|
+
}), [t, c, d, L]), p = (m, l) => l.length === 0 ? null : /* @__PURE__ */ s(y, {
|
|
33
33
|
children: [m && /* @__PURE__ */ n(e.Header, {
|
|
34
34
|
className: o.itemsDropdownLabel,
|
|
35
35
|
children: /* @__PURE__ */ n(_, {
|
|
@@ -37,27 +37,27 @@ import '../../../../styles/items-dropdown.css';const O = "_itemsDropdownTriggerL
|
|
|
37
37
|
color: "textOnLightSecondary",
|
|
38
38
|
children: m
|
|
39
39
|
})
|
|
40
|
-
}), l.map((
|
|
40
|
+
}), l.map((a) => /* @__PURE__ */ s(e.Item, {
|
|
41
41
|
className: o.itemsDropdownItem,
|
|
42
|
-
onClick: () =>
|
|
43
|
-
children: [/* @__PURE__ */ n(
|
|
42
|
+
onClick: () => k(a),
|
|
43
|
+
children: [/* @__PURE__ */ n(x, {
|
|
44
44
|
ariaHidden: !0,
|
|
45
45
|
className: o.itemsDropdownItemIcon,
|
|
46
|
-
dimension:
|
|
47
|
-
iconType:
|
|
46
|
+
dimension: C,
|
|
47
|
+
iconType: a.fileType
|
|
48
48
|
}), /* @__PURE__ */ n(_, {
|
|
49
49
|
as: "span",
|
|
50
50
|
className: o.itemsDropdownItemName,
|
|
51
|
-
children:
|
|
51
|
+
children: a.name
|
|
52
52
|
})]
|
|
53
|
-
},
|
|
53
|
+
}, a.id))]
|
|
54
54
|
});
|
|
55
55
|
return /* @__PURE__ */ s(e.Root, {
|
|
56
56
|
isFullScreenEnabled: h,
|
|
57
|
-
onOpenChange:
|
|
57
|
+
onOpenChange: b,
|
|
58
58
|
children: [/* @__PURE__ */ n(e.Trigger, {
|
|
59
|
-
className: M(
|
|
60
|
-
children: /* @__PURE__ */ n(
|
|
59
|
+
className: M(I, o.itemsDropdownTrigger),
|
|
60
|
+
children: /* @__PURE__ */ n(T, {
|
|
61
61
|
className: o.itemsDropdownTriggerLink,
|
|
62
62
|
href: "#",
|
|
63
63
|
children: f
|
|
@@ -70,9 +70,9 @@ import '../../../../styles/items-dropdown.css';const O = "_itemsDropdownTriggerL
|
|
|
70
70
|
children: [/* @__PURE__ */ n(e.Header.TextContent, {
|
|
71
71
|
title: f
|
|
72
72
|
}), /* @__PURE__ */ n(e.Header.MenuCloseButton, {
|
|
73
|
-
"aria-label":
|
|
73
|
+
"aria-label": i(r.closeItemList)
|
|
74
74
|
})]
|
|
75
|
-
}),
|
|
75
|
+
}), p(null, t), p(i(r.unsupportedFormatLabel), c), p(i(r.noPermissionsLabel), d)]
|
|
76
76
|
})]
|
|
77
77
|
});
|
|
78
78
|
};
|
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { useRef as c, useEffect as u } from "react";
|
|
2
2
|
import { INPUT_TARGET_ID as s } from "../components/footer/constants.js";
|
|
3
|
-
const
|
|
4
|
-
const r = e.querySelector(
|
|
5
|
-
r && (r.focus(),
|
|
6
|
-
},
|
|
3
|
+
const i = (n, e, t) => () => {
|
|
4
|
+
const r = e.querySelector(n);
|
|
5
|
+
r && (r.focus(), t());
|
|
6
|
+
}, l = (n, e, t) => {
|
|
7
7
|
const r = document.querySelector(e);
|
|
8
8
|
if (!r)
|
|
9
9
|
return null;
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const o = new MutationObserver(i(n, r, () => {
|
|
11
|
+
o.disconnect(), t();
|
|
12
12
|
}));
|
|
13
|
-
return
|
|
13
|
+
return o.observe(document, {
|
|
14
14
|
childList: !0,
|
|
15
15
|
subtree: !0
|
|
16
|
-
}),
|
|
16
|
+
}), o;
|
|
17
17
|
};
|
|
18
|
-
function a(
|
|
19
|
-
const e = c(null),
|
|
20
|
-
const
|
|
21
|
-
|
|
18
|
+
function a(n) {
|
|
19
|
+
const e = c(null), t = `[data-target-id="${s}"]`, r = () => {
|
|
20
|
+
const o = document.querySelector(t);
|
|
21
|
+
o ? o.focus() : e?.current || (e.current = l(t, n, () => {
|
|
22
22
|
e.current = null;
|
|
23
23
|
}));
|
|
24
24
|
};
|
|
25
25
|
return u(() => () => {
|
|
26
|
-
|
|
27
|
-
(t = e == null ? void 0 : e.current) == null || t.disconnect();
|
|
26
|
+
e?.current?.disconnect();
|
|
28
27
|
}, [e]), {
|
|
29
28
|
focusPrompt: r
|
|
30
29
|
};
|