@box/box-ai-agent-selector 0.47.14 → 0.48.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/esm/lib/box-ai-agent-selector-with-api-container.js +13 -10
- package/dist/esm/lib/box-ai-agent-selector-with-api.js +15 -12
- package/dist/esm/lib/box-ai-agent-selector.js +976 -974
- package/dist/esm/lib/box-ai-agent.js +58 -53
- package/dist/types/lib/box-ai-agent-selector-with-api-container.d.ts +1 -1
- package/dist/types/lib/box-ai-agent-selector-with-api.d.ts +2 -1
- package/dist/types/lib/box-ai-agent-selector.d.ts +2 -1
- package/dist/types/lib/types.d.ts +3 -0
- package/package.json +2 -2
@@ -1,12 +1,12 @@
|
|
1
1
|
import "./box-ai-agent-selector.js";
|
2
|
-
import { BoxAiAgentSelectorWithApi as
|
2
|
+
import { BoxAiAgentSelectorWithApi as c } from "./box-ai-agent-selector-with-api.js";
|
3
3
|
import { jsx as r } from "react/jsx-runtime";
|
4
|
-
import { AgentsProvider as
|
4
|
+
import { AgentsProvider as s } from "./contexts/context.js";
|
5
5
|
import "./constants.js";
|
6
6
|
import "../../chunks/types.js";
|
7
7
|
import "./contexts/actions.js";
|
8
8
|
import "./hooks/useLocalStorageAIAgents.js";
|
9
|
-
function
|
9
|
+
function j({
|
10
10
|
fetcher: t,
|
11
11
|
hostAppName: o,
|
12
12
|
onSelectAgent: i,
|
@@ -16,11 +16,13 @@ function W({
|
|
16
16
|
disabled: n,
|
17
17
|
shouldHideAgentSelectorOnLoad: A = !0,
|
18
18
|
triggerChipClassName: f,
|
19
|
-
contentClassName:
|
19
|
+
contentClassName: l,
|
20
|
+
useAgentLocalStorage: a = !1
|
21
|
+
// All non-Box AI Q&A experiences should pass in false
|
20
22
|
}) {
|
21
|
-
return /* @__PURE__ */ r(
|
22
|
-
children: /* @__PURE__ */ r(
|
23
|
-
contentClassName:
|
23
|
+
return /* @__PURE__ */ r(s, {
|
24
|
+
children: /* @__PURE__ */ r(c, {
|
25
|
+
contentClassName: l,
|
24
26
|
disabled: n,
|
25
27
|
fetcher: t,
|
26
28
|
hostAppName: o,
|
@@ -29,11 +31,12 @@ function W({
|
|
29
31
|
recordAction: m,
|
30
32
|
requestState: p,
|
31
33
|
shouldHideAgentSelectorOnLoad: A,
|
32
|
-
triggerChipClassName: f
|
34
|
+
triggerChipClassName: f,
|
35
|
+
useAgentLocalStorage: a
|
33
36
|
})
|
34
37
|
});
|
35
38
|
}
|
36
39
|
export {
|
37
|
-
|
38
|
-
|
40
|
+
j as BoxAiAgentSelectorWithApiContainer,
|
41
|
+
j as default
|
39
42
|
};
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { useState as
|
2
|
-
import { BoxAiAgentSelector as
|
1
|
+
import { useState as x, useCallback as c, useEffect as T } from "react";
|
2
|
+
import { BoxAiAgentSelector as D } from "./box-ai-agent-selector.js";
|
3
3
|
import { LOGGER_BASE_CONFIG as g, LOGGER_TARGET as h } from "./constants.js";
|
4
4
|
import { ACTIONS as S } from "./contexts/actions.js";
|
5
|
-
import { useAgentsDispatch as
|
5
|
+
import { useAgentsDispatch as F, useAgents as Q } from "./contexts/context.js";
|
6
6
|
import { R as r } from "../../chunks/types.js";
|
7
|
-
import { jsx as
|
8
|
-
function
|
7
|
+
import { jsx as d } from "react/jsx-runtime";
|
8
|
+
function z({
|
9
9
|
fetcher: m,
|
10
10
|
hostAppName: A,
|
11
11
|
onSelectAgent: f,
|
@@ -17,13 +17,15 @@ function W({
|
|
17
17
|
shouldHideAgentSelectorOnLoad: O,
|
18
18
|
triggerChipClassName: N,
|
19
19
|
contentClassName: I,
|
20
|
-
|
20
|
+
useAgentLocalStorage: L = !1,
|
21
|
+
// All non-Box AI Q&A experiences should pass in false
|
22
|
+
variant: U = "modal"
|
21
23
|
}) {
|
22
|
-
const e =
|
24
|
+
const e = F(), {
|
23
25
|
agents: R,
|
24
26
|
requestState: i,
|
25
27
|
selectedAgent: t
|
26
|
-
} =
|
28
|
+
} = Q(), [l, a] = x(!1), o = c((s) => {
|
27
29
|
u && (s.data ?? (s.data = {}), s.data.hostAppName = A, u(s));
|
28
30
|
}, [A, u]), _ = c(async () => {
|
29
31
|
e({
|
@@ -65,7 +67,7 @@ function W({
|
|
65
67
|
f && f(t);
|
66
68
|
}, [f, t == null ? void 0 : t.id]), T(() => {
|
67
69
|
n && n(t);
|
68
|
-
}, [n, t == null ? void 0 : t.id]), O && !
|
70
|
+
}, [n, t == null ? void 0 : t.id]), O && !l || i === r.SUCCESS && R.length <= 1 ? null : /* @__PURE__ */ d(D, {
|
69
71
|
agents: R,
|
70
72
|
contentClassName: I,
|
71
73
|
disabled: p,
|
@@ -75,10 +77,11 @@ function W({
|
|
75
77
|
requestState: i,
|
76
78
|
selectedAgent: t,
|
77
79
|
triggerChipClassName: N,
|
78
|
-
|
80
|
+
useAgentLocalStorage: L,
|
81
|
+
variant: U
|
79
82
|
});
|
80
83
|
}
|
81
84
|
export {
|
82
|
-
|
83
|
-
|
85
|
+
z as BoxAiAgentSelectorWithApi,
|
86
|
+
z as default
|
84
87
|
};
|