@box/box-ai-agent-selector 0.27.1 → 0.29.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
  };
@@ -26,7 +26,7 @@ const t = e({
26
26
  },
27
27
  errorTooltip: {
28
28
  id: "boxAI.agentSelector.errorTooltip",
29
- defaultMessage: "Failed to load available agents"
29
+ defaultMessage: "Failed to load available agents. Try again."
30
30
  },
31
31
  loadingMessage: {
32
32
  id: "boxAI.agentSelector.loadingMessage",
package/i18n/en-US.js CHANGED
@@ -4,7 +4,7 @@ export default {
4
4
  "boxAI.agentSelector.defaultAgent": "Default",
5
5
  "boxAI.agentSelector.defaultStatus": "DEFAULT",
6
6
  "boxAI.agentSelector.errorMessage": "Failed to load available agents. You're currently using your organization's default agent. Click here to retry.",
7
- "boxAI.agentSelector.errorTooltip": "Failed to load available agents",
7
+ "boxAI.agentSelector.errorTooltip": "Failed to load available agents. Try again.",
8
8
  "boxAI.agentSelector.loadingMessage": "Loading available agents",
9
9
  "boxAI.agentSelector.selectAgent": "Select an Agent"
10
10
  }
@@ -9,7 +9,7 @@ boxAI.agentSelector.defaultStatus = DEFAULT
9
9
  # Error message for retry option when the agents failed to load
10
10
  boxAI.agentSelector.errorMessage = Failed to load available agents. You're currently using your organization's default agent. Click here to retry.
11
11
  # Error tooltip content for agent selector when the agents failed to load
12
- boxAI.agentSelector.errorTooltip = Failed to load available agents
12
+ boxAI.agentSelector.errorTooltip = Failed to load available agents. Try again.
13
13
  # Message for loading indicator while loading available agents
14
14
  boxAI.agentSelector.loadingMessage = Loading available agents
15
15
  # Label for the AI agent selector when the user has not selected any agent
@@ -1 +1 @@
1
- [{"id":"boxAI.agentSelector.agent","description":"AI agent label","defaultMessage":"Agent"},{"id":"boxAI.agentSelector.agentList","description":"Aria Label for the list displaying the agents","defaultMessage":"Agent List"},{"id":"boxAI.agentSelector.selectAgent","description":"Label for the AI agent selector when the user has not selected any agent","defaultMessage":"Select an Agent"},{"id":"boxAI.agentSelector.defaultAgent","description":"Label for the default agent used when no other agents are available","defaultMessage":"Default"},{"id":"boxAI.agentSelector.defaultStatus","description":"Status indicator to define whether or not the agent on the list is the default for the enterprise","defaultMessage":"DEFAULT"},{"id":"boxAI.agentSelector.errorMessage","description":"Error message for retry option when the agents failed to load","defaultMessage":"Failed to load available agents. You're currently using your organization's default agent. Click here to retry."},{"id":"boxAI.agentSelector.errorTooltip","description":"Error tooltip content for agent selector when the agents failed to load","defaultMessage":"Failed to load available agents"},{"id":"boxAI.agentSelector.loadingMessage","description":"Message for loading indicator while loading available agents","defaultMessage":"Loading available agents"}]
1
+ [{"id":"boxAI.agentSelector.agent","description":"AI agent label","defaultMessage":"Agent"},{"id":"boxAI.agentSelector.agentList","description":"Aria Label for the list displaying the agents","defaultMessage":"Agent List"},{"id":"boxAI.agentSelector.selectAgent","description":"Label for the AI agent selector when the user has not selected any agent","defaultMessage":"Select an Agent"},{"id":"boxAI.agentSelector.defaultAgent","description":"Label for the default agent used when no other agents are available","defaultMessage":"Default"},{"id":"boxAI.agentSelector.defaultStatus","description":"Status indicator to define whether or not the agent on the list is the default for the enterprise","defaultMessage":"DEFAULT"},{"id":"boxAI.agentSelector.errorMessage","description":"Error message for retry option when the agents failed to load","defaultMessage":"Failed to load available agents. You're currently using your organization's default agent. Click here to retry."},{"id":"boxAI.agentSelector.errorTooltip","description":"Error tooltip content for agent selector when the agents failed to load","defaultMessage":"Failed to load available agents. Try again."},{"id":"boxAI.agentSelector.loadingMessage","description":"Message for loading indicator while loading available agents","defaultMessage":"Loading available agents"}]
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.29.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.8",
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": "6e3fffa688deb1364211bbbc68fbb9098060d97f"
51
51
  }