@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,85 +1,90 @@
|
|
1
|
-
import { TooltipProvider as
|
1
|
+
import { TooltipProvider as m, Text as n, Tooltip as s, Status as u } from "@box/blueprint-web";
|
2
2
|
import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
|
3
|
-
import { SurfaceStatusSurfaceGray as
|
4
|
-
import { forwardRef as
|
5
|
-
import { useIntl as
|
6
|
-
import
|
7
|
-
import { jsx as
|
8
|
-
import '../../styles/box-ai-agent.css';const
|
9
|
-
agentListItem:
|
10
|
-
agentInfo:
|
11
|
-
thumbnailWrapper:
|
12
|
-
agentListItemIcon:
|
13
|
-
defaultAgentHeader:
|
14
|
-
agentHeader:
|
15
|
-
defaultAgentName:
|
16
|
-
agentDescription:
|
17
|
-
defaultAgentStatusWrapper:
|
18
|
-
}, w = /* @__PURE__ */
|
19
|
-
agent:
|
20
|
-
},
|
3
|
+
import { SurfaceStatusSurfaceGray as f } from "@box/blueprint-web-assets/tokens/tokens";
|
4
|
+
import { forwardRef as g, useMemo as _ } from "react";
|
5
|
+
import { useIntl as I } from "react-intl";
|
6
|
+
import h from "./messages.js";
|
7
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
8
|
+
import '../../styles/box-ai-agent.css';const q = "_agentListItem_xtqqd_1", A = "_agentInfo_xtqqd_11", x = "_thumbnailWrapper_xtqqd_20", L = "_agentListItemIcon_xtqqd_23", N = "_defaultAgentHeader_xtqqd_33", S = "_agentHeader_xtqqd_44", v = "_defaultAgentName_xtqqd_51", b = "_agentDescription_xtqqd_59", H = "_defaultAgentStatusWrapper_xtqqd_69", a = {
|
9
|
+
agentListItem: q,
|
10
|
+
agentInfo: A,
|
11
|
+
thumbnailWrapper: x,
|
12
|
+
agentListItemIcon: L,
|
13
|
+
defaultAgentHeader: N,
|
14
|
+
agentHeader: S,
|
15
|
+
defaultAgentName: v,
|
16
|
+
agentDescription: b,
|
17
|
+
defaultAgentStatusWrapper: H
|
18
|
+
}, w = /* @__PURE__ */ g(({
|
19
|
+
agent: t
|
20
|
+
}, o) => {
|
21
21
|
const {
|
22
|
-
formatMessage:
|
23
|
-
} =
|
24
|
-
if (
|
22
|
+
formatMessage: c
|
23
|
+
} = I(), r = t.isEnterpriseDefault, d = _(() => {
|
24
|
+
if (t.customIcon)
|
25
|
+
return /* @__PURE__ */ e(t.customIcon, {});
|
26
|
+
if (t.imageURL)
|
25
27
|
try {
|
26
|
-
|
28
|
+
const l = new URL(t.imageURL);
|
29
|
+
return /* @__PURE__ */ e("img", {
|
30
|
+
"aria-label": t.name,
|
31
|
+
src: l.toString()
|
32
|
+
});
|
27
33
|
} catch {
|
28
34
|
return;
|
29
35
|
}
|
30
|
-
|
31
|
-
|
32
|
-
|
36
|
+
else
|
37
|
+
return /* @__PURE__ */ e(p, {
|
38
|
+
"aria-label": t.name
|
39
|
+
});
|
40
|
+
}, [t]);
|
41
|
+
return /* @__PURE__ */ e("div", {
|
42
|
+
ref: o,
|
33
43
|
className: a.agentListItem,
|
34
44
|
"data-target-id": "SmallList.Item-boxAIAgent",
|
35
|
-
id:
|
36
|
-
children: /* @__PURE__ */
|
37
|
-
children: [/* @__PURE__ */
|
45
|
+
id: t.id,
|
46
|
+
children: /* @__PURE__ */ i(m, {
|
47
|
+
children: [/* @__PURE__ */ e("div", {
|
38
48
|
className: a.thumbnailWrapper,
|
39
|
-
children: /* @__PURE__ */
|
49
|
+
children: /* @__PURE__ */ e("div", {
|
40
50
|
className: a.agentListItemIcon,
|
41
|
-
children:
|
42
|
-
"aria-label": e.name,
|
43
|
-
src: s
|
44
|
-
}) : /* @__PURE__ */ t(p, {
|
45
|
-
"aria-label": e.name
|
46
|
-
})
|
51
|
+
children: d
|
47
52
|
})
|
48
|
-
}), /* @__PURE__ */
|
53
|
+
}), /* @__PURE__ */ i("div", {
|
49
54
|
className: a.agentInfo,
|
50
|
-
children: [/* @__PURE__ */
|
55
|
+
children: [/* @__PURE__ */ e(n, {
|
51
56
|
as: "span",
|
52
57
|
className: r ? a.defaultAgentHeader : a.agentHeader,
|
53
|
-
children: r ? /* @__PURE__ */
|
54
|
-
content:
|
55
|
-
children: /* @__PURE__ */
|
58
|
+
children: r ? /* @__PURE__ */ e(s, {
|
59
|
+
content: t.name,
|
60
|
+
children: /* @__PURE__ */ e(n, {
|
56
61
|
as: "span",
|
57
62
|
className: a.defaultAgentName,
|
58
63
|
variant: "subtitle",
|
59
|
-
children:
|
64
|
+
children: t.name
|
60
65
|
})
|
61
|
-
}) : /* @__PURE__ */
|
66
|
+
}) : /* @__PURE__ */ e(n, {
|
62
67
|
as: "span",
|
63
68
|
variant: "subtitle",
|
64
|
-
children:
|
69
|
+
children: t.name
|
65
70
|
})
|
66
|
-
}),
|
67
|
-
content:
|
68
|
-
children: /* @__PURE__ */
|
71
|
+
}), t.description && /* @__PURE__ */ e(s, {
|
72
|
+
content: t.description,
|
73
|
+
children: /* @__PURE__ */ e(n, {
|
69
74
|
as: "span",
|
70
75
|
className: a.agentDescription,
|
71
76
|
variant: "caption",
|
72
|
-
children:
|
77
|
+
children: t.description
|
73
78
|
})
|
74
79
|
})]
|
75
|
-
}), /* @__PURE__ */
|
76
|
-
children: /* @__PURE__ */
|
80
|
+
}), /* @__PURE__ */ e("div", {
|
81
|
+
children: /* @__PURE__ */ e(n, {
|
77
82
|
as: "span",
|
78
83
|
className: a.defaultAgentStatusWrapper,
|
79
|
-
children: r && /* @__PURE__ */
|
84
|
+
children: r && /* @__PURE__ */ e(u, {
|
80
85
|
className: a.defaultAgentStatus,
|
81
|
-
color:
|
82
|
-
text:
|
86
|
+
color: f,
|
87
|
+
text: c(h.defaultStatus)
|
83
88
|
})
|
84
89
|
})
|
85
90
|
})]
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { BoxAiAgentSelectorWithApiProps } from './types';
|
2
|
-
export declare function BoxAiAgentSelectorWithApiContainer({ fetcher, hostAppName, onSelectAgent, onSelectedAgentCallback, recordAction, requestState, disabled, shouldHideAgentSelectorOnLoad, triggerChipClassName, contentClassName, }: BoxAiAgentSelectorWithApiProps): import("react/jsx-runtime").JSX.Element;
|
2
|
+
export declare function BoxAiAgentSelectorWithApiContainer({ fetcher, hostAppName, onSelectAgent, onSelectedAgentCallback, recordAction, requestState, disabled, shouldHideAgentSelectorOnLoad, triggerChipClassName, contentClassName, useAgentLocalStorage, }: BoxAiAgentSelectorWithApiProps): import("react/jsx-runtime").JSX.Element;
|
3
3
|
export default BoxAiAgentSelectorWithApiContainer;
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { BoxAiAgentSelectorWithApiProps } from './types';
|
2
|
-
export declare function BoxAiAgentSelectorWithApi({ fetcher, hostAppName, onSelectAgent, onSelectedAgentCallback, recordAction, requestState: requestStateProp, disabled, onAgentsListOpen, shouldHideAgentSelectorOnLoad, triggerChipClassName, contentClassName,
|
2
|
+
export declare function BoxAiAgentSelectorWithApi({ fetcher, hostAppName, onSelectAgent, onSelectedAgentCallback, recordAction, requestState: requestStateProp, disabled, onAgentsListOpen, shouldHideAgentSelectorOnLoad, triggerChipClassName, contentClassName, useAgentLocalStorage, // All non-Box AI Q&A experiences should pass in false
|
3
|
+
variant, }: BoxAiAgentSelectorWithApiProps): import("react/jsx-runtime").JSX.Element | null;
|
3
4
|
export default BoxAiAgentSelectorWithApi;
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { BoxAiAgentSelectorProps } from './types';
|
2
|
-
export declare function BoxAiAgentSelector({ agents, contentClassName, onErrorAction, recordAction, requestState, disabled, onAgentsListOpen, selectedAgent, triggerChipClassName,
|
2
|
+
export declare function BoxAiAgentSelector({ agents, contentClassName, onErrorAction, recordAction, requestState, disabled, onAgentsListOpen, selectedAgent, triggerChipClassName, useAgentLocalStorage, // All non-Box AI Q&A experiences should pass in true
|
3
|
+
variant, }: BoxAiAgentSelectorProps): import("react/jsx-runtime").JSX.Element;
|
3
4
|
export default BoxAiAgentSelector;
|
@@ -8,6 +8,7 @@ export type AgentType = {
|
|
8
8
|
imageURL?: string;
|
9
9
|
isEnterpriseDefault?: boolean;
|
10
10
|
suggestedQuestions?: string[] | null;
|
11
|
+
customIcon?: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, 'ref'> & React.RefAttributes<SVGSVGElement>>;
|
11
12
|
};
|
12
13
|
export declare enum REQUEST_STATE {
|
13
14
|
NOT_STARTED = "not_started",
|
@@ -82,6 +83,7 @@ export interface BoxAiAgentSelectorWithApiProps {
|
|
82
83
|
*/
|
83
84
|
shouldHideAgentSelectorOnLoad?: boolean;
|
84
85
|
triggerChipClassName?: string;
|
86
|
+
useAgentLocalStorage?: boolean;
|
85
87
|
/**
|
86
88
|
* Styling variant of agent selector
|
87
89
|
* */
|
@@ -118,6 +120,7 @@ export interface BoxAiAgentSelectorProps {
|
|
118
120
|
*/
|
119
121
|
selectedAgent: AgentType | null;
|
120
122
|
triggerChipClassName?: string;
|
123
|
+
useAgentLocalStorage?: boolean;
|
121
124
|
/**
|
122
125
|
* Styling variant of agent selector
|
123
126
|
* */
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@box/box-ai-agent-selector",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.48.0",
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
5
5
|
"peerDependencies": {
|
6
6
|
"@ariakit/react": "^0.4.15",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"devDependencies": {
|
14
14
|
"@ariakit/react": "^0.4.15",
|
15
15
|
"@box/babel-plugin-target-attributes": "1.3.0",
|
16
|
-
"@box/blueprint-web": "^12.
|
16
|
+
"@box/blueprint-web": "^12.34.0",
|
17
17
|
"@box/blueprint-web-assets": "^4.59.0",
|
18
18
|
"@box/eslint-plugin-blueprint": "^1.0.3",
|
19
19
|
"@box/storybook-utils": "^0.13.13",
|