@box/box-ai-agent-selector 0.17.11 → 0.17.13

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,27 +1,28 @@
1
- import { useState as O, useCallback as m, useEffect as f } from "react";
2
- import { BoxAiAgentSelector as N } from "./box-ai-agent-selector.js";
3
- import { LOGGER_BASE_CONFIG as u, LOGGER_TARGET as a } from "./constants.js";
1
+ import { useState as N, useCallback as m, useEffect as f } from "react";
2
+ import { BoxAiAgentSelector as h } from "./box-ai-agent-selector.js";
3
+ import { LOGGER_BASE_CONFIG as a, LOGGER_TARGET as u } from "./constants.js";
4
4
  import { ACTIONS as E } from "./contexts/actions.js";
5
- import { useAgentsDispatch as h, useAgents as I } from "./contexts/context.js";
5
+ import { useAgentsDispatch as I, useAgents as L } from "./contexts/context.js";
6
6
  import { R as i } from "../../chunks/types.js";
7
- import { jsx as L } from "react/jsx-runtime";
8
- function F({
7
+ import { jsx as d } from "react/jsx-runtime";
8
+ function H({
9
9
  fetcher: R,
10
10
  hostAppName: _,
11
- onSelectAgent: T,
12
- recordAction: n,
11
+ onSelectAgent: o,
12
+ recordAction: T,
13
13
  requestState: s,
14
14
  shouldHideAgentSelectorOnLoad: g,
15
- triggerChipClassName: G,
16
- contentClassName: l
15
+ triggerChipClassName: l,
16
+ contentClassName: G,
17
+ variant: p = "modal"
17
18
  }) {
18
- const e = h(), {
19
+ const e = I(), {
19
20
  agents: c,
20
21
  requestState: S,
21
- selectedAgent: o
22
- } = I(), [p, C] = O(!1), r = m((t) => {
23
- n && (t.data ?? (t.data = {}), t.data.hostAppName = _, n(t));
24
- }, [_, n]), A = m(async () => {
22
+ selectedAgent: n
23
+ } = L(), [C, O] = N(!1), r = m((t) => {
24
+ T && (t.data ?? (t.data = {}), t.data.hostAppName = _, T(t));
25
+ }, [_, T]), A = m(async () => {
25
26
  e({
26
27
  type: E.SET_REQUEST_STATE,
27
28
  requestState: i.IN_PROGRESS
@@ -32,22 +33,22 @@ function F({
32
33
  type: E.SET_AGENT_LIST,
33
34
  agents: t.agents
34
35
  }), r({
35
- ...u,
36
- target: a.LOADED_AGENTS
36
+ ...a,
37
+ target: u.LOADED_AGENTS
37
38
  });
38
39
  } catch {
39
40
  e({
40
41
  type: E.SET_REQUEST_STATE,
41
42
  requestState: i.ERROR
42
43
  }), r({
43
- ...u,
44
- target: a.ERROR_LOADING_AGENTS
44
+ ...a,
45
+ target: u.ERROR_LOADING_AGENTS
45
46
  });
46
47
  }
47
48
  }, [e, r, R]);
48
49
  return f(() => {
49
50
  A().finally(() => {
50
- C(!0);
51
+ O(!0);
51
52
  });
52
53
  }, [A]), f(() => {
53
54
  s && s !== S && (s !== i.SUCCESS && e({
@@ -58,18 +59,19 @@ function F({
58
59
  requestState: s
59
60
  }));
60
61
  }, [e, S, s]), f(() => {
61
- T && T(o);
62
- }, [T, o]), g && !p || S === i.SUCCESS && c.length <= 1 ? null : /* @__PURE__ */ L(N, {
62
+ o && o(n);
63
+ }, [o, n]), g && !C || S === i.SUCCESS && c.length <= 1 ? null : /* @__PURE__ */ d(h, {
63
64
  agents: c,
64
- contentClassName: l,
65
+ contentClassName: G,
65
66
  onErrorAction: A,
66
67
  recordAction: r,
67
68
  requestState: S,
68
- selectedAgent: o,
69
- triggerChipClassName: G
69
+ selectedAgent: n,
70
+ triggerChipClassName: l,
71
+ variant: p
70
72
  });
71
73
  }
72
74
  export {
73
- F as BoxAiAgentSelectorWithApi,
74
- F as default
75
+ H as BoxAiAgentSelectorWithApi,
76
+ H as default
75
77
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-agent-selector",
3
- "version": "0.17.11",
3
+ "version": "0.17.13",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^7.31.1",
@@ -10,7 +10,7 @@
10
10
  "react-intl": "^6.4.2"
11
11
  },
12
12
  "devDependencies": {
13
- "@box/blueprint-web": "^9.3.0",
13
+ "@box/blueprint-web": "^9.3.1",
14
14
  "@box/blueprint-web-assets": "^4.30.1",
15
15
  "@box/eslint-plugin-blueprint": "^1.0.3",
16
16
  "@box/storybook-utils": "^0.8.0",
@@ -46,5 +46,5 @@
46
46
  "sideEffects": [
47
47
  "**/*.css"
48
48
  ],
49
- "gitHead": "29dec29dc19e7235bfa317927d92bfc14d5047e0"
49
+ "gitHead": "c8de9173fa02b04d639e329138a97a388c0d3bef"
50
50
  }
@@ -1,3 +1,3 @@
1
1
  import { type BoxAiAgentSelectorWithApiProps } from './types';
2
- export declare function BoxAiAgentSelectorWithApi({ fetcher, hostAppName, onSelectAgent, recordAction, requestState: requestStateProp, shouldHideAgentSelectorOnLoad, triggerChipClassName, contentClassName, }: BoxAiAgentSelectorWithApiProps): import("react/jsx-runtime").JSX.Element | null;
2
+ export declare function BoxAiAgentSelectorWithApi({ fetcher, hostAppName, onSelectAgent, recordAction, requestState: requestStateProp, shouldHideAgentSelectorOnLoad, triggerChipClassName, contentClassName, variant, }: BoxAiAgentSelectorWithApiProps): import("react/jsx-runtime").JSX.Element | null;
3
3
  export default BoxAiAgentSelectorWithApi;
@@ -73,6 +73,10 @@ export interface BoxAiAgentSelectorWithApiProps {
73
73
  */
74
74
  shouldHideAgentSelectorOnLoad?: boolean;
75
75
  triggerChipClassName?: string;
76
+ /**
77
+ * Styling variant of agent selector
78
+ * */
79
+ variant?: StyleVariant;
76
80
  }
77
81
  export interface BoxAiAgentSelectorProps {
78
82
  contentClassName?: string;