@epam/ai-dial-conversation-input 1.3.0-dev.70 → 1.3.0-dev.83

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 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAalE,wIAAwI;AACxI,eAAO,MAAM,KAAK,oGAkwCjB,CAAC"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAalE,wIAAwI;AACxI,eAAO,MAAM,KAAK,oGAwwCjB,CAAC"}
package/index.js CHANGED
@@ -2161,7 +2161,9 @@ var Xt = {
2161
2161
  R(() => {
2162
2162
  ft == null || pn.current === t || (pn.current = t, X.current?.setSelectionRange(ft, ft), Wt(ft));
2163
2163
  }, [J]);
2164
- let { attachments: mn, buildAttachments: hn, addAttachments: gn, resetAttachments: _n, handleRemove: vn, handleRetry: yn, handleExpand: bn, hasBlockedAttachments: xn } = Me({
2164
+ let mn = B(J);
2165
+ mn.current = J;
2166
+ let { attachments: hn, buildAttachments: gn, addAttachments: _n, resetAttachments: vn, handleRemove: yn, handleRetry: bn, handleExpand: xn, hasBlockedAttachments: Sn } = Me({
2165
2167
  initialAttachments: we,
2166
2168
  onUploadAttachment: a,
2167
2169
  onAttachmentsChange: p,
@@ -2172,31 +2174,30 @@ var Xt = {
2172
2174
  pendingAttachments: me,
2173
2175
  onPendingAttachmentsConsumed: he,
2174
2176
  onExpandPastedText: L((e) => {
2175
- Y((t) => t ? `${t}\n${e}` : e);
2176
- }, [Y]),
2177
+ let t = mn.current, n = t ? `${t}\n${e}` : e;
2178
+ mn.current = n, Y(n), u?.(n);
2179
+ }, [Y, u]),
2177
2180
  maximumAttachmentsAmount: xt,
2178
2181
  baseAttachmentsAmount: Je.length,
2179
2182
  onAttachmentsLimitExceeded: Tt
2180
- }), Sn = L((e) => {
2181
- gn(hn([e]));
2182
- }, [gn, hn]), Cn = B(!1), wn = B(J);
2183
- wn.current = J;
2184
- let [Tn, En] = V({
2183
+ }), Cn = L((e) => {
2184
+ _n(gn([e]));
2185
+ }, [_n, gn]), wn = B(!1), [Tn, En] = V({
2185
2186
  text: "",
2186
2187
  revision: 0
2187
2188
  }), { state: Dn, analyserNodeRef: On, errorMessage: kn, startRecording: An, stopRecording: jn, discardRecording: Mn } = nt({
2188
- onAttachAudio: Sn,
2189
+ onAttachAudio: Cn,
2189
2190
  onTranscribeAudio: ze,
2190
2191
  onTranscript: L((e) => {
2191
2192
  let t = e.trim();
2192
2193
  if (t) {
2193
- let e = wn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2194
- wn.current = n, Y(n), En((e) => ({
2194
+ let e = mn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2195
+ mn.current = n, Y(n), En((e) => ({
2195
2196
  text: t,
2196
2197
  revision: e.revision + 1
2197
2198
  })), Pt.notifyChange(), u?.(n);
2198
2199
  }
2199
- Cn.current = !0;
2200
+ wn.current = !0;
2200
2201
  }, [
2201
2202
  Y,
2202
2203
  Pt,
@@ -2205,9 +2206,9 @@ var Xt = {
2205
2206
  errorLabel: Ue
2206
2207
  }), $ = Dn === Xe.Recording || Dn === Xe.Processing;
2207
2208
  R(() => {
2208
- (Dn === Xe.Error || Dn === Xe.Idle && Cn.current) && (Cn.current = !1, X.current?.focus());
2209
+ (Dn === Xe.Error || Dn === Xe.Idle && wn.current) && (wn.current = !1, X.current?.focus());
2209
2210
  }, [Dn, X]);
2210
- let Nn = B(null), Pn = B(null), Fn = Et && Dt, { handlePaste: In } = ue(gn, Fn ? ge : Infinity), Ln = L((e) => {
2211
+ let Nn = B(null), Pn = B(null), Fn = Et && Dt, { handlePaste: In } = ue(_n, Fn ? ge : Infinity), Ln = L((e) => {
2211
2212
  if (!Fn) {
2212
2213
  let t = e.clipboardData.getData("text/plain");
2213
2214
  t.length >= ye && kt?.(t.length, ye);
@@ -2221,7 +2222,7 @@ var Xt = {
2221
2222
  kt,
2222
2223
  In,
2223
2224
  G
2224
- ]), Rn = J.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !Pe && !$, [Bn, Vn] = V([]);
2225
+ ]), Rn = J.trim().length > 0 || hn.length > 0, zn = Rn && !Sn && !Pe && !$, [Bn, Vn] = V([]);
2225
2226
  R(() => {
2226
2227
  Vn([]);
2227
2228
  }, [(et ?? []).map((e) => e.id).join("|")]);
@@ -2240,14 +2241,14 @@ var Xt = {
2240
2241
  kt?.(J.length, ye);
2241
2242
  return;
2242
2243
  }
2243
- let e = J, t = mn;
2244
+ let e = J, t = hn;
2244
2245
  Y(""), Pt.reset();
2245
2246
  try {
2246
2247
  await i?.(e, t), t.forEach((e) => {
2247
2248
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
2248
- }), _n([]);
2249
+ }), vn([]);
2249
2250
  } catch {
2250
- Y(e), _n(t);
2251
+ Y(e), vn(t);
2251
2252
  }
2252
2253
  }, qn = (e) => We === rt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
2253
2254
  if (!Bt || e.nativeEvent.isComposing) return !1;
@@ -2281,8 +2282,8 @@ var Xt = {
2281
2282
  }, Xn = (e) => {
2282
2283
  let t = Array.from(e.target.files ?? []);
2283
2284
  if (t.length === 0) return;
2284
- let n = hn(t);
2285
- e.target.value = "", gn(n);
2285
+ let n = gn(t);
2286
+ e.target.value = "", _n(n);
2286
2287
  }, Zn = z(() => {
2287
2288
  let e = [];
2288
2289
  return Q != null && e.push({
@@ -2435,13 +2436,13 @@ var Xt = {
2435
2436
  style: Lt,
2436
2437
  className: l(q.wrapper, W && q.wrapperDisabled, W && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", de, H.wrapper),
2437
2438
  children: [
2438
- (Je.length > 0 || mn.length > 0) && /* @__PURE__ */ F(se, {
2439
- attachments: [...Je, ...mn],
2439
+ (Je.length > 0 || hn.length > 0) && /* @__PURE__ */ F(se, {
2440
+ attachments: [...Je, ...hn],
2440
2441
  onRemove: (e) => {
2441
- Je.some((t) => t.id === e) ? Qe?.(e) : vn(e);
2442
+ Je.some((t) => t.id === e) ? Qe?.(e) : yn(e);
2442
2443
  },
2443
- onRetry: yn,
2444
- onExpand: bn,
2444
+ onRetry: bn,
2445
+ onExpand: xn,
2445
2446
  labels: {
2446
2447
  removeLabel: E,
2447
2448
  retryLabel: D,
@@ -2451,10 +2452,10 @@ var Xt = {
2451
2452
  },
2452
2453
  styles: {
2453
2454
  ...ce,
2454
- className: l(mn.length > 6 && "-me-4", ce?.className)
2455
+ className: l(hn.length > 6 && "-me-4", ce?.className)
2455
2456
  },
2456
2457
  onAttachmentClick: yt == null ? void 0 : (e) => {
2457
- let t = [...Je, ...mn].find((t) => t.id === e);
2458
+ let t = [...Je, ...hn].find((t) => t.id === e);
2458
2459
  t != null && yt(t);
2459
2460
  }
2460
2461
  }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-conversation-input",
3
3
  "description": "Conversation message input with model selection, attachments, voice input, and edit mode",
4
- "version": "1.3.0-dev.70",
4
+ "version": "1.3.0-dev.83",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -19,10 +19,10 @@
19
19
  "dependencies": {
20
20
  "react-window": "^2.2.7",
21
21
  "@tabler/icons-react": "^3.44.0",
22
- "@epam/ai-dial-attachment-input": "1.3.0-dev.70"
22
+ "@epam/ai-dial-attachment-input": "1.3.0-dev.83"
23
23
  },
24
24
  "peerDependencies": {
25
- "@epam/ai-dial-chat-shared": "1.3.0-dev.70",
25
+ "@epam/ai-dial-chat-shared": "1.3.0-dev.83",
26
26
  "react": "^19.2.8",
27
27
  "@epam/ai-dial-ui-kit": "^0.16.0-dev.11"
28
28
  },