@box/box-ai-agent-selector 0.27.1 → 0.28.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.
@@ -1,56 +1,63 @@
1
- import { useFullTextTooltip as u, SmallList as s, Text as c, Status as d } from "@box/blueprint-web";
2
- import { BoxAiLogo as p } from "@box/blueprint-web-assets/icons/Logo";
3
- import { SurfaceStatusSurfaceGray as f } from "@box/blueprint-web-assets/tokens/tokens";
4
- import { useRef as g } from "react";
5
- import { useIntl as A } from "react-intl";
6
- import _ from "./messages.js";
7
- import { jsxs as b, jsx as t, Fragment as I } from "react/jsx-runtime";
8
- import '../../styles/box-ai-agent.css';const h = "_agentListItem_1byz1_1", S = "_thumbnailWrapper_1byz1_6", L = "_agentListItemIcon_1byz1_9", N = "_defaultAgentHeader_1byz1_18", x = "_defaultAgentName_1byz1_22", y = "_defaultAgentStatusWrapper_1byz1_28", a = {
9
- agentListItem: h,
10
- thumbnailWrapper: S,
11
- agentListItemIcon: L,
12
- defaultAgentHeader: N,
13
- defaultAgentName: x,
14
- defaultAgentStatusWrapper: y
1
+ import { useFullTextTooltip as c, SmallList as r, Text as d, Status as p } from "@box/blueprint-web";
2
+ import { BoxAiLogo as f } from "@box/blueprint-web-assets/icons/Logo";
3
+ import { SurfaceStatusSurfaceGray as g } from "@box/blueprint-web-assets/tokens/tokens";
4
+ import { useRef as A, useMemo as _ } from "react";
5
+ import { useIntl as b } from "react-intl";
6
+ import h from "./messages.js";
7
+ import { jsxs as I, jsx as t, Fragment as S } from "react/jsx-runtime";
8
+ import '../../styles/box-ai-agent.css';const L = "_agentListItem_1byz1_1", N = "_thumbnailWrapper_1byz1_6", x = "_agentListItemIcon_1byz1_9", y = "_defaultAgentHeader_1byz1_18", W = "_defaultAgentName_1byz1_22", v = "_defaultAgentStatusWrapper_1byz1_28", a = {
9
+ agentListItem: L,
10
+ thumbnailWrapper: N,
11
+ agentListItemIcon: x,
12
+ defaultAgentHeader: y,
13
+ defaultAgentName: W,
14
+ defaultAgentStatusWrapper: v
15
15
  };
16
- function j({
16
+ function k({
17
17
  agent: e,
18
- onAction: n
18
+ onAction: i
19
19
  }) {
20
20
  const {
21
- formatMessage: i
22
- } = A(), r = e.isEnterpriseDefault, l = g(null), {
23
- Wrapper: m,
24
- wrapperProps: o
25
- } = u({
26
- ref: l,
21
+ formatMessage: m
22
+ } = b(), s = e.isEnterpriseDefault, n = A(null), {
23
+ Wrapper: o,
24
+ wrapperProps: u
25
+ } = c({
26
+ ref: n,
27
27
  textValue: e.name,
28
- skipOverflowCheck: !r
29
- });
30
- return /* @__PURE__ */ b(s.Item, {
28
+ skipOverflowCheck: !s
29
+ }), l = _(() => {
30
+ if (e.imageURL)
31
+ try {
32
+ return new URL(e.imageURL).toString();
33
+ } catch {
34
+ return;
35
+ }
36
+ }, [e]);
37
+ return /* @__PURE__ */ I(r.Item, {
31
38
  className: a.agentListItem,
32
39
  "data-target-id": "SmallList.Item-boxAIAgent",
33
40
  id: e.id,
34
- onAction: n,
35
- children: [/* @__PURE__ */ t(s.Thumbnail, {
41
+ onAction: i,
42
+ children: [/* @__PURE__ */ t(r.Thumbnail, {
36
43
  className: a.thumbnailWrapper,
37
44
  children: /* @__PURE__ */ t("div", {
38
45
  className: a.agentListItemIcon,
39
- children: e.imageURL ? /* @__PURE__ */ t("img", {
46
+ children: l ? /* @__PURE__ */ t("img", {
40
47
  "aria-label": e.name,
41
- src: e.imageURL
42
- }) : /* @__PURE__ */ t(p, {
48
+ src: l
49
+ }) : /* @__PURE__ */ t(f, {
43
50
  "aria-label": e.name
44
51
  })
45
52
  })
46
- }), /* @__PURE__ */ t(s.Header, {
47
- className: r ? a.defaultAgentHeader : void 0,
53
+ }), /* @__PURE__ */ t(r.Header, {
54
+ className: s ? a.defaultAgentHeader : void 0,
48
55
  textValue: e.name,
49
- children: r ? /* @__PURE__ */ t(I, {
50
- children: /* @__PURE__ */ t(m, {
51
- ...o,
52
- children: /* @__PURE__ */ t(c, {
53
- ref: l,
56
+ children: s ? /* @__PURE__ */ t(S, {
57
+ children: /* @__PURE__ */ t(o, {
58
+ ...u,
59
+ children: /* @__PURE__ */ t(d, {
60
+ ref: n,
54
61
  as: "span",
55
62
  className: a.defaultAgentName,
56
63
  variant: "bodyDefaultSemibold",
@@ -58,20 +65,20 @@ function j({
58
65
  })
59
66
  })
60
67
  }) : e.name
61
- }), /* @__PURE__ */ t(s.Actions, {
68
+ }), /* @__PURE__ */ t(r.Actions, {
62
69
  className: a.defaultAgentStatusWrapper,
63
- children: r && /* @__PURE__ */ t(d, {
70
+ children: s && /* @__PURE__ */ t(p, {
64
71
  className: a.defaultAgentStatus,
65
- color: f,
66
- text: i(_.defaultStatus)
72
+ color: g,
73
+ text: m(h.defaultStatus)
67
74
  })
68
- }), e.description && /* @__PURE__ */ t(s.Subtitle, {
75
+ }), e.description && /* @__PURE__ */ t(r.Subtitle, {
69
76
  className: a.agentDescription,
70
77
  children: e.description
71
78
  })]
72
79
  });
73
80
  }
74
81
  export {
75
- j as BoxAiAgent,
76
- j as default
82
+ k as BoxAiAgent,
83
+ k as default
77
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-agent-selector",
3
- "version": "0.27.1",
3
+ "version": "0.28.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^7.31.1",
@@ -11,8 +11,8 @@
11
11
  },
12
12
  "devDependencies": {
13
13
  "@box/babel-plugin-target-attributes": "1.3.0",
14
- "@box/blueprint-web": "^9.18.6",
15
- "@box/blueprint-web-assets": "^4.34.0",
14
+ "@box/blueprint-web": "^9.18.7",
15
+ "@box/blueprint-web-assets": "^4.35.0",
16
16
  "@box/eslint-plugin-blueprint": "^1.0.3",
17
17
  "@box/storybook-utils": "^0.8.3",
18
18
  "react-intl": "^6.4.2"
@@ -47,5 +47,5 @@
47
47
  "sideEffects": [
48
48
  "**/*.css"
49
49
  ],
50
- "gitHead": "e9435014eda5457600235b810a8dd5f1cacdf144"
50
+ "gitHead": "f6ab2a20576eaded5fb37f37c119c9eb031cc86d"
51
51
  }