@box/box-ai-agent-selector 0.35.0 → 0.35.2

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/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { BoxAiAgentSelector as t } from "./lib/box-ai-agent-selector.js";
2
2
  import { BoxAiAgentSelectorWithApi as A } from "./lib/box-ai-agent-selector-with-api.js";
3
3
  import { BoxAiAgentSelectorWithApiContainer as p } from "./lib/box-ai-agent-selector-with-api-container.js";
4
- import { ACTIONS as n } from "./lib/contexts/actions.js";
5
- import { AgentsProvider as f, useAgents as g, useAgentsDispatch as m } from "./lib/contexts/context.js";
6
- import { R as c } from "../chunks/types.js";
4
+ import { R as n } from "../chunks/types.js";
5
+ import { ACTIONS as f } from "./lib/contexts/actions.js";
6
+ import { AgentsProvider as m, useAgents as S, useAgentsDispatch as c } from "./lib/contexts/context.js";
7
7
  export {
8
- n as ACTIONS,
9
- f as AgentsProvider,
8
+ f as ACTIONS,
9
+ m as AgentsProvider,
10
10
  t as BoxAiAgentSelector,
11
11
  A as BoxAiAgentSelectorWithApi,
12
12
  p as BoxAiAgentSelectorWithApiContainer,
13
- c as REQUEST_STATE,
14
- g as useAgents,
15
- m as useAgentsDispatch
13
+ n as REQUEST_STATE,
14
+ S as useAgents,
15
+ c as useAgentsDispatch
16
16
  };
@@ -1,32 +1,35 @@
1
+ import "./box-ai-agent-selector.js";
1
2
  import { BoxAiAgentSelectorWithApi as c } from "./box-ai-agent-selector-with-api.js";
2
- import { AgentsProvider as l } from "./contexts/context.js";
3
3
  import { jsx as r } from "react/jsx-runtime";
4
- function d({
4
+ import { AgentsProvider as l } from "./contexts/context.js";
5
+ import "../../chunks/types.js";
6
+ import "./contexts/actions.js";
7
+ function s({
5
8
  fetcher: t,
6
- hostAppName: e,
7
- onSelectAgent: o,
8
- recordAction: i,
9
- requestState: n,
10
- disabled: A,
11
- shouldHideAgentSelectorOnLoad: m = !0,
12
- triggerChipClassName: p,
9
+ hostAppName: o,
10
+ onSelectAgent: i,
11
+ recordAction: e,
12
+ requestState: m,
13
+ disabled: n,
14
+ shouldHideAgentSelectorOnLoad: p = !0,
15
+ triggerChipClassName: A,
13
16
  contentClassName: f
14
17
  }) {
15
18
  return /* @__PURE__ */ r(l, {
16
19
  children: /* @__PURE__ */ r(c, {
17
20
  contentClassName: f,
18
- disabled: A,
21
+ disabled: n,
19
22
  fetcher: t,
20
- hostAppName: e,
21
- onSelectAgent: o,
22
- recordAction: i,
23
- requestState: n,
24
- shouldHideAgentSelectorOnLoad: m,
25
- triggerChipClassName: p
23
+ hostAppName: o,
24
+ onSelectAgent: i,
25
+ recordAction: e,
26
+ requestState: m,
27
+ shouldHideAgentSelectorOnLoad: p,
28
+ triggerChipClassName: A
26
29
  })
27
30
  });
28
31
  }
29
32
  export {
30
- d as BoxAiAgentSelectorWithApiContainer,
31
- d as default
33
+ s as BoxAiAgentSelectorWithApiContainer,
34
+ s as default
32
35
  };
@@ -8,10 +8,10 @@ import Mt from "clsx";
8
8
  import { useIntl as hi } from "react-intl";
9
9
  import { BoxAiAgent as bi } from "./box-ai-agent.js";
10
10
  import { LOGGER_BASE_CONFIG as an, LOGGER_ACTION_CLICK as cn, LOGGER_TARGET as ln } from "./constants.js";
11
- import { ACTIONS as yi } from "./contexts/actions.js";
12
- import { useAgentsDispatch as Si } from "./contexts/context.js";
11
+ import { useAgentsDispatch as yi } from "./contexts/context.js";
13
12
  import Qe from "./messages.js";
14
13
  import { R as fn } from "../../chunks/types.js";
14
+ import { ACTIONS as Si } from "./contexts/actions.js";
15
15
  import '../../styles/box-ai-agent-selector.css';var wi = Object.defineProperty, Ei = Object.defineProperties, xi = Object.getOwnPropertyDescriptors, Wt = Object.getOwnPropertySymbols, Xr = Object.prototype.hasOwnProperty, Jr = Object.prototype.propertyIsEnumerable, dr = (e, t, r) => t in e ? wi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, O = (e, t) => {
16
16
  for (var r in t || (t = {}))
17
17
  Xr.call(t, r) && dr(e, r, t[r]);
@@ -4626,7 +4626,7 @@ function Hc({
4626
4626
  var D;
4627
4627
  const {
4628
4628
  formatMessage: f
4629
- } = hi(), [c, l] = X(!1), p = o === fn.ERROR, [b, g] = X(p), E = Si(), w = o === fn.SUCCESS, P = o === fn.IN_PROGRESS, h = f(Qe.selectAgent), m = f(Qe.defaultAgent);
4629
+ } = hi(), [c, l] = X(!1), p = o === fn.ERROR, [b, g] = X(p), E = yi(), w = o === fn.SUCCESS, P = o === fn.IN_PROGRESS, h = f(Qe.selectAgent), m = f(Qe.defaultAgent);
4630
4630
  let y = "";
4631
4631
  w ? y = (u == null ? void 0 : u.name) || h : p && (y = m);
4632
4632
  const C = Y(null), {
@@ -4645,7 +4645,7 @@ function Hc({
4645
4645
  }, [c, n]);
4646
4646
  const S = xe((v) => {
4647
4647
  l(!1), E({
4648
- type: yi.SET_SELECTED_AGENT,
4648
+ type: Si.SET_SELECTED_AGENT,
4649
4649
  id: v.id
4650
4650
  }), n && n({
4651
4651
  ...an,
@@ -1,38 +1,39 @@
1
- import { useContext as e, useReducer as g, createContext as r } from "react";
1
+ import "./actions.js";
2
+ import { useContext as e, useReducer as p, createContext as r } from "react";
2
3
  import { defaultState as n } from "./constants.js";
3
- import { agentsReducer as m } from "./reducer.js";
4
+ import { agentsReducer as f } from "./reducer.js";
4
5
  import { jsx as t } from "react/jsx-runtime";
5
6
  const o = /* @__PURE__ */ r(n), s = /* @__PURE__ */ r(() => {
6
7
  });
7
- function v() {
8
+ function h() {
8
9
  return e(o);
9
10
  }
10
- function h() {
11
+ function C() {
11
12
  return e(s);
12
13
  }
13
- function C({
14
+ function P({
14
15
  children: u,
15
- value: c
16
+ value: i
16
17
  }) {
17
18
  const [{
18
- agents: i,
19
+ agents: c,
19
20
  requestState: a,
20
21
  selectedAgent: d
21
- }, f] = g(m, c || n);
22
+ }, m] = p(f, i || n);
22
23
  return /* @__PURE__ */ t(o.Provider, {
23
24
  value: {
24
- agents: i,
25
+ agents: c,
25
26
  requestState: a,
26
27
  selectedAgent: d
27
28
  },
28
29
  children: /* @__PURE__ */ t(s.Provider, {
29
- value: f,
30
+ value: m,
30
31
  children: u
31
32
  })
32
33
  });
33
34
  }
34
35
  export {
35
- C as AgentsProvider,
36
- v as useAgents,
37
- h as useAgentsDispatch
36
+ P as AgentsProvider,
37
+ h as useAgents,
38
+ C as useAgentsDispatch
38
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-agent-selector",
3
- "version": "0.35.0",
3
+ "version": "0.35.2",
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": "^10.4.0",
16
+ "@box/blueprint-web": "^11.0.0",
17
17
  "@box/blueprint-web-assets": "^4.39.0",
18
18
  "@box/eslint-plugin-blueprint": "^1.0.3",
19
19
  "@box/storybook-utils": "^0.9.0",