@box/box-ai-content-answers 0.142.3 → 0.142.5

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.
@@ -7,10 +7,10 @@ import { ArrowUp as it } from "@box/blueprint-web-assets/icons/Fill";
7
7
  import { BubbleStar as st } from "@box/blueprint-web-assets/icons/Medium";
8
8
  import { useAgents as lt } from "@box/box-ai-agent-selector";
9
9
  import { getAIAgentConfig as X } from "../common/agentUtils.js";
10
- import { isDebugModeTrigger as mt, isEnterTrigger as ct } from "../common/keyInputUtils.js";
11
- import { TEXT_AREA as m, INPUT_TARGET_ID as pt } from "./constants.js";
10
+ import { isDebugModeTrigger as mt, isEnterTrigger as pt } from "../common/keyInputUtils.js";
11
+ import { TEXT_AREA as m, INPUT_TARGET_ID as ct } from "./constants.js";
12
12
  import { FooterActions as ut } from "./footer-actions.js";
13
- import { s as c, S as ft } from "../../../../chunks/stopResponseButton.js";
13
+ import { s as p, S as ft } from "../../../../chunks/stopResponseButton.js";
14
14
  import { U as dt } from "../../../../chunks/types.js";
15
15
  import s from "./messages.js";
16
16
  import { LOGGER_BASE_CONFIG as I, LOGGER_ACTION_CLICK as bt, LOGGER_ACTION_KEYPRESS as ht } from "../common/constants.js";
@@ -30,11 +30,11 @@ const Xt = ({
30
30
  recordAction: n,
31
31
  sendQuestion: v,
32
32
  setAskSuggestedQuestion: x,
33
- toggleDebugMode: p,
34
- promptButtonClickHandler: O,
33
+ toggleDebugMode: c,
34
+ promptButtonClickHandler: y,
35
35
  variant: F = "modal"
36
36
  }) => {
37
- const y = F === "sidebar", i = tt(), K = at(), a = r.useRef(null), U = K <= rt.Medium && !y ? m.MAX_ROWS_MOBILE : m.MAX_ROWS, [f, A] = r.useState(!0), [W, R] = r.useState(!1), {
37
+ const O = F === "sidebar", i = tt(), K = at(), a = r.useRef(null), U = K <= rt.Medium && !O ? m.MAX_ROWS_MOBILE : m.MAX_ROWS, [f, A] = r.useState(!0), [W, R] = r.useState(!1), {
38
38
  selectedAgent: E
39
39
  } = lt(), {
40
40
  answer: j,
@@ -56,21 +56,21 @@ const Xt = ({
56
56
  const q = X(h, E);
57
57
  v(e, q), a.current.value = "", A(!0), R(!1);
58
58
  }
59
- N && p && p();
59
+ N && c && c();
60
60
  }
61
- }, [E, d, o, a, h, N, v, p]), V = r.useCallback((t) => {
61
+ }, [E, d, o, a, h, N, v, c]), V = r.useCallback((t) => {
62
62
  t.preventDefault(), !o && !f && n && n({
63
63
  ...I,
64
64
  action: bt,
65
65
  target: "ask"
66
66
  }), b();
67
67
  }, [o, f, n, b]), J = r.useCallback((t) => {
68
- B && p && mt(t) && p(), ct(t) && (t.preventDefault(), !o && !f && n && n({
68
+ B && c && mt(t) && c(), pt(t) && (t.preventDefault(), !o && !f && n && n({
69
69
  ...I,
70
70
  action: ht,
71
71
  target: "ask"
72
72
  }), b());
73
- }, [B, o, f, n, b, p]), Z = r.useCallback((t) => {
73
+ }, [B, o, f, n, b, c]), Z = r.useCallback((t) => {
74
74
  const e = X(h, E);
75
75
  G(t, e);
76
76
  }, [E, h, G]);
@@ -87,15 +87,16 @@ const Xt = ({
87
87
  }, [u == null ? void 0 : u.id]);
88
88
  const $ = r.useCallback((t) => {
89
89
  a.current && (a.current.value = t, M(), d());
90
- }, [M, d]), k = !!O, z = () => /* @__PURE__ */ l(T.Group, {
90
+ }, [M, d]), k = !!y, z = () => /* @__PURE__ */ l(T.Group, {
91
91
  name: "prompt-library",
92
92
  type: "single",
93
93
  children: /* @__PURE__ */ _(T.ChipButton, {
94
94
  "aria-label": i.formatMessage(s.openPromptLibraryBtn),
95
- className: c.promptButton,
95
+ className: p.promptButton,
96
+ "data-target-id": "open-prompt-library-button",
96
97
  "data-testid": "open-prompt-library-button",
97
98
  onClick: () => {
98
- O($);
99
+ y($);
99
100
  },
100
101
  value: "add-prompt",
101
102
  children: [/* @__PURE__ */ l(T.Icon, {
@@ -115,7 +116,7 @@ const Xt = ({
115
116
  variant: "standard",
116
117
  children: /* @__PURE__ */ l(nt, {
117
118
  "aria-label": i.formatMessage(s.ask),
118
- className: c.inputAreaButton,
119
+ className: p.inputAreaButton,
119
120
  "data-testid": "content-answers-submit-button",
120
121
  disabled: f || o,
121
122
  icon: it,
@@ -133,11 +134,11 @@ const Xt = ({
133
134
  onRetryQuestion: Z,
134
135
  recordAction: n
135
136
  }), /* @__PURE__ */ _("div", {
136
- className: g(c.questionInput, y && c.sidebar, !k && c.questionInputWithOutPromptLibrary),
137
+ className: g(p.questionInput, O && p.sidebar, !k && p.questionInputWithOutPromptLibrary),
137
138
  children: [/* @__PURE__ */ l(et, {
138
139
  ref: a,
139
- className: c.textArea,
140
- "data-target-id": pt,
140
+ className: p.textArea,
141
+ "data-target-id": ct,
141
142
  "data-testid": "content-answers-question-input",
142
143
  error: W && i.formatMessage(s.maxCharactersReachedError, {
143
144
  characterLimit: m.MAX_LENGTH
@@ -150,7 +151,7 @@ const Xt = ({
150
151
  onKeyDown: J,
151
152
  placeholder: i.formatMessage(s.askQuestionPlaceholder)
152
153
  }), k && /* @__PURE__ */ _("div", {
153
- className: c.actionContainer,
154
+ className: p.actionContainer,
154
155
  children: [z(), w("small")]
155
156
  }), !k && w("large")]
156
157
  })]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/box-ai-content-answers",
3
- "version": "0.142.3",
3
+ "version": "0.142.5",
4
4
  "peerDependencies": {
5
5
  "@box/blueprint-web": "^7.8.0",
6
6
  "@box/blueprint-web-assets": "^4.56.1",
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@box/babel-plugin-target-attributes": "1.3.0",
20
- "@box/blueprint-web": "^12.51.0",
21
- "@box/blueprint-web-assets": "^4.62.0",
22
- "@box/box-ai-agent-selector": "^0.50.3",
23
- "@box/item-icon": "^0.17.3",
24
- "@box/storybook-utils": "^0.13.17",
20
+ "@box/blueprint-web": "^12.51.1",
21
+ "@box/blueprint-web-assets": "^4.63.0",
22
+ "@box/box-ai-agent-selector": "^0.50.4",
23
+ "@box/item-icon": "^0.17.4",
24
+ "@box/storybook-utils": "^0.13.18",
25
25
  "@testing-library/react": "^15.0.6",
26
26
  "react": "^18.3.0",
27
27
  "react-dom": "^18.3.0",