@epam/ai-dial-conversation-input 1.2.0-dev.327 → 1.2.0-dev.336
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/components/Input/Input.d.ts.map +1 -1
- package/index.js +129 -126
- package/models/Input.d.ts +11 -11
- package/package.json +4 -4
|
@@ -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,
|
|
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,oGAquCjB,CAAC"}
|
package/index.js
CHANGED
|
@@ -2088,44 +2088,47 @@ var Kt = {
|
|
|
2088
2088
|
}), { isMenuOpen: zt, query: Bt, activeWordStart: Q, dismiss: Vt, closeOnOutsidePress: Ht, handleCaretMove: Ut, handleValueChange: Wt, listboxId: Gt, overlayRef: Kt, activeOptionId: qt, moveActiveOption: Jt, getActiveOption: Yt } = Fe({
|
|
2089
2089
|
config: G,
|
|
2090
2090
|
message: Y
|
|
2091
|
-
}), Xt = ()
|
|
2091
|
+
}), Xt = B(Ut);
|
|
2092
|
+
Xt.current = Ut;
|
|
2093
|
+
let Qt = () => {
|
|
2092
2094
|
Ut(Z.current?.selectionStart ?? Y.length);
|
|
2093
|
-
},
|
|
2095
|
+
}, $t = () => {
|
|
2094
2096
|
requestAnimationFrame(() => {
|
|
2095
|
-
|
|
2097
|
+
let e = Z.current;
|
|
2098
|
+
Xt.current(e?.selectionStart ?? e?.value.length ?? 0);
|
|
2096
2099
|
});
|
|
2097
|
-
},
|
|
2100
|
+
}, en = (e) => {
|
|
2098
2101
|
e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Ut(e.currentTarget.selectionStart ?? Y.length);
|
|
2099
|
-
},
|
|
2100
|
-
let e =
|
|
2102
|
+
}, tn = G?.emptyQueryHint != null, nn = G != null && Q != null ? Q + G.triggerPrefix.length : null, rn = nn != null && Y.slice(nn).split("\n", 1)[0] !== "", an = tn && zt && Bt === "" && nn != null && !rn, on = G != null && zt ? Q ?? 0 : null, sn = B(null), cn = B(null), [ln, un] = V(null), dn = L(() => {
|
|
2103
|
+
let e = sn.current, t = cn.current;
|
|
2101
2104
|
if (e == null || t == null) {
|
|
2102
|
-
|
|
2105
|
+
un(null);
|
|
2103
2106
|
return;
|
|
2104
2107
|
}
|
|
2105
2108
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
2106
|
-
|
|
2109
|
+
un({
|
|
2107
2110
|
left: n.left - r.left,
|
|
2108
2111
|
top: n.top - r.top
|
|
2109
2112
|
});
|
|
2110
2113
|
}, []);
|
|
2111
2114
|
De(() => {
|
|
2112
|
-
|
|
2115
|
+
dn();
|
|
2113
2116
|
}, [
|
|
2114
|
-
|
|
2115
|
-
|
|
2117
|
+
dn,
|
|
2118
|
+
on,
|
|
2116
2119
|
Y
|
|
2117
2120
|
]), R(() => {
|
|
2118
|
-
if (
|
|
2121
|
+
if (on == null) return;
|
|
2119
2122
|
let e = Z.current;
|
|
2120
2123
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
2121
|
-
let t = new ResizeObserver(
|
|
2124
|
+
let t = new ResizeObserver(dn);
|
|
2122
2125
|
return t.observe(e), () => t.disconnect();
|
|
2123
2126
|
}, [
|
|
2124
|
-
|
|
2127
|
+
on,
|
|
2125
2128
|
Z,
|
|
2126
|
-
|
|
2129
|
+
dn
|
|
2127
2130
|
]);
|
|
2128
|
-
let
|
|
2131
|
+
let fn = L((e) => {
|
|
2129
2132
|
if (G == null || (Vt(), !e?.consumeQuery) || (e.returnFocus !== !1 && Z.current?.focus(), Q == null)) return;
|
|
2130
2133
|
let t = `${G.triggerPrefix}${Bt}`, n = Q + t.length;
|
|
2131
2134
|
if (Y.slice(Q, n) !== t) return;
|
|
@@ -2141,11 +2144,11 @@ var Kt = {
|
|
|
2141
2144
|
q,
|
|
2142
2145
|
u,
|
|
2143
2146
|
Z
|
|
2144
|
-
]),
|
|
2147
|
+
]), pn = B(void 0);
|
|
2145
2148
|
R(() => {
|
|
2146
|
-
ft == null ||
|
|
2149
|
+
ft == null || pn.current === t || (pn.current = t, Z.current?.setSelectionRange(ft, ft), Ut(ft));
|
|
2147
2150
|
}, [Y]);
|
|
2148
|
-
let { attachments:
|
|
2151
|
+
let { attachments: mn, buildAttachments: hn, addAttachments: gn, resetAttachments: _n, handleRemove: vn, handleRetry: yn, handleExpand: bn, hasBlockedAttachments: xn } = Ae({
|
|
2149
2152
|
initialAttachments: we,
|
|
2150
2153
|
onUploadAttachment: a,
|
|
2151
2154
|
onAttachmentsChange: p,
|
|
@@ -2161,84 +2164,84 @@ var Kt = {
|
|
|
2161
2164
|
maximumAttachmentsAmount: Tt,
|
|
2162
2165
|
baseAttachmentsAmount: Ze.length,
|
|
2163
2166
|
onAttachmentsLimitExceeded: Et
|
|
2164
|
-
}),
|
|
2165
|
-
hn(
|
|
2166
|
-
}, [
|
|
2167
|
-
|
|
2168
|
-
let [
|
|
2167
|
+
}), Sn = L((e) => {
|
|
2168
|
+
gn(hn([e]));
|
|
2169
|
+
}, [gn, hn]), Cn = B(!1), wn = B(Y);
|
|
2170
|
+
wn.current = Y;
|
|
2171
|
+
let [Tn, En] = V({
|
|
2169
2172
|
text: "",
|
|
2170
2173
|
revision: 0
|
|
2171
|
-
}), { state:
|
|
2172
|
-
onAttachAudio:
|
|
2174
|
+
}), { state: Dn, analyserNodeRef: On, errorMessage: kn, startRecording: An, stopRecording: jn, discardRecording: Mn } = $e({
|
|
2175
|
+
onAttachAudio: Sn,
|
|
2173
2176
|
onTranscribeAudio: Ve,
|
|
2174
2177
|
onTranscript: L((e) => {
|
|
2175
2178
|
let t = e.trim();
|
|
2176
2179
|
if (t) {
|
|
2177
|
-
let e =
|
|
2178
|
-
|
|
2180
|
+
let e = wn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
2181
|
+
wn.current = n, X(n), En((e) => ({
|
|
2179
2182
|
text: t,
|
|
2180
2183
|
revision: e.revision + 1
|
|
2181
2184
|
})), q.notifyChange(), u?.(n);
|
|
2182
2185
|
}
|
|
2183
|
-
|
|
2186
|
+
Cn.current = !0;
|
|
2184
2187
|
}, [
|
|
2185
2188
|
X,
|
|
2186
2189
|
q,
|
|
2187
2190
|
u
|
|
2188
2191
|
]),
|
|
2189
2192
|
errorLabel: Ye
|
|
2190
|
-
}), $ =
|
|
2193
|
+
}), $ = Dn === qe.Recording || Dn === qe.Processing;
|
|
2191
2194
|
R(() => {
|
|
2192
|
-
(
|
|
2193
|
-
}, [
|
|
2194
|
-
let
|
|
2195
|
-
if (!
|
|
2195
|
+
(Dn === qe.Error || Dn === qe.Idle && Cn.current) && (Cn.current = !1, Z.current?.focus());
|
|
2196
|
+
}, [Dn, Z]);
|
|
2197
|
+
let Nn = B(null), Pn = B(null), Fn = Dt && Ot, { handlePaste: In } = le(gn, Fn ? ve : Infinity), Ln = L((e) => {
|
|
2198
|
+
if (!Fn) {
|
|
2196
2199
|
let t = e.clipboardData.getData("text/plain");
|
|
2197
2200
|
t.length >= ye && At?.(t.length, ye);
|
|
2198
2201
|
}
|
|
2199
|
-
|
|
2202
|
+
In(e);
|
|
2200
2203
|
}, [
|
|
2201
|
-
|
|
2204
|
+
Fn,
|
|
2202
2205
|
ye,
|
|
2203
2206
|
At,
|
|
2204
|
-
|
|
2205
|
-
]),
|
|
2207
|
+
In
|
|
2208
|
+
]), Rn = Y.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !Ie && !$, [Bn, Vn] = V([]);
|
|
2206
2209
|
R(() => {
|
|
2207
|
-
|
|
2210
|
+
Vn([]);
|
|
2208
2211
|
}, [(rt ?? []).map((e) => e.id).join("|")]);
|
|
2209
|
-
let
|
|
2212
|
+
let Hn = z(() => {
|
|
2210
2213
|
let e = rt ?? [];
|
|
2211
|
-
return at ? e.filter((e) => e.isSelected || !
|
|
2214
|
+
return at ? e.filter((e) => e.isSelected || !Bn.includes(e.id)) : e;
|
|
2212
2215
|
}, [
|
|
2213
2216
|
rt,
|
|
2214
|
-
|
|
2217
|
+
Bn,
|
|
2215
2218
|
at
|
|
2216
|
-
]),
|
|
2217
|
-
|
|
2218
|
-
}, [rt, it]),
|
|
2219
|
+
]), Un = L((e) => {
|
|
2220
|
+
Vn((t) => t.includes(e) ? t : [...t, e]), rt?.find((t) => t.id === e)?.isSelected && it?.(e);
|
|
2221
|
+
}, [rt, it]), Wn = be === void 0 || xe != null, Gn = Le && !s, Kn = async () => {
|
|
2219
2222
|
if (Ie || $) return;
|
|
2220
2223
|
if (Y.length >= ye) {
|
|
2221
2224
|
At?.(Y.length, ye);
|
|
2222
2225
|
return;
|
|
2223
2226
|
}
|
|
2224
|
-
let e = Y, t =
|
|
2227
|
+
let e = Y, t = mn;
|
|
2225
2228
|
X(""), q.reset();
|
|
2226
2229
|
try {
|
|
2227
2230
|
await i?.(e, t), t.forEach((e) => {
|
|
2228
2231
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2229
|
-
}),
|
|
2232
|
+
}), _n([]);
|
|
2230
2233
|
} catch {
|
|
2231
|
-
X(e),
|
|
2234
|
+
X(e), _n(t);
|
|
2232
2235
|
}
|
|
2233
|
-
},
|
|
2236
|
+
}, qn = (e) => Xe === et.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
|
|
2234
2237
|
if (!zt || e.nativeEvent.isComposing) return !1;
|
|
2235
2238
|
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Vt(), !0;
|
|
2236
2239
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Jt(e.key === "ArrowDown" ? Pe.Next : Pe.Previous), !0;
|
|
2237
2240
|
if (e.key !== "Enter" || e.shiftKey) return !1;
|
|
2238
2241
|
let t = Yt();
|
|
2239
|
-
return t == null ?
|
|
2240
|
-
},
|
|
2241
|
-
if (!$ && !Rt(e) && !
|
|
2242
|
+
return t == null ? qn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
|
|
2243
|
+
}, Yn = (e) => {
|
|
2244
|
+
if (!$ && !Rt(e) && !Jn(e)) {
|
|
2242
2245
|
if (!e.nativeEvent.isComposing && !W && !s) {
|
|
2243
2246
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2244
2247
|
let t = e.currentTarget.selectionStart ?? 0, n = q.navigate(e.key === "ArrowUp" ? "up" : "down", Y, t);
|
|
@@ -2257,24 +2260,24 @@ var Kt = {
|
|
|
2257
2260
|
}
|
|
2258
2261
|
}
|
|
2259
2262
|
}
|
|
2260
|
-
e.key === "Enter" &&
|
|
2263
|
+
e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !W && Kn());
|
|
2261
2264
|
}
|
|
2262
|
-
},
|
|
2265
|
+
}, Xn = (e) => {
|
|
2263
2266
|
let t = Array.from(e.target.files ?? []);
|
|
2264
2267
|
if (t.length === 0) return;
|
|
2265
|
-
let n =
|
|
2266
|
-
e.target.value = "",
|
|
2267
|
-
},
|
|
2268
|
+
let n = hn(t);
|
|
2269
|
+
e.target.value = "", gn(n);
|
|
2270
|
+
}, Zn = z(() => {
|
|
2268
2271
|
let e = [];
|
|
2269
|
-
return
|
|
2270
|
-
offset:
|
|
2272
|
+
return on != null && e.push({
|
|
2273
|
+
offset: on,
|
|
2271
2274
|
node: /* @__PURE__ */ P("span", {
|
|
2272
|
-
ref:
|
|
2275
|
+
ref: sn,
|
|
2273
2276
|
"aria-hidden": !0,
|
|
2274
2277
|
className: "inline-block h-[1lh] w-0 align-text-top"
|
|
2275
2278
|
}, "caret-marker")
|
|
2276
|
-
}),
|
|
2277
|
-
offset:
|
|
2279
|
+
}), an && G != null && nn != null && e.push({
|
|
2280
|
+
offset: nn,
|
|
2278
2281
|
node: /* @__PURE__ */ P("span", {
|
|
2279
2282
|
className: K.commandHint,
|
|
2280
2283
|
"aria-hidden": !0,
|
|
@@ -2283,16 +2286,16 @@ var Kt = {
|
|
|
2283
2286
|
}, "command-hint")
|
|
2284
2287
|
}), e;
|
|
2285
2288
|
}, [
|
|
2289
|
+
on,
|
|
2286
2290
|
an,
|
|
2287
|
-
rn,
|
|
2288
2291
|
G,
|
|
2289
|
-
|
|
2290
|
-
]),
|
|
2292
|
+
nn
|
|
2293
|
+
]), Qn = It || Zn.length > 0, { mirrorRef: $n, selectionRects: er, updateSelectionRects: tr } = He({
|
|
2291
2294
|
textareaRef: Z,
|
|
2292
2295
|
message: Y,
|
|
2293
|
-
isMirrorActive:
|
|
2294
|
-
}),
|
|
2295
|
-
className: l(K.textarea,
|
|
2296
|
+
isMirrorActive: Qn
|
|
2297
|
+
}), nr = /* @__PURE__ */ P("textarea", {
|
|
2298
|
+
className: l(K.textarea, Qn && K.textareaMentionMode, I?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
|
|
2296
2299
|
ref: Z,
|
|
2297
2300
|
autoFocus: mt,
|
|
2298
2301
|
value: Y,
|
|
@@ -2301,12 +2304,12 @@ var Kt = {
|
|
|
2301
2304
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2302
2305
|
Wt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
|
|
2303
2306
|
},
|
|
2304
|
-
onSelect:
|
|
2305
|
-
onFocus:
|
|
2306
|
-
onClick:
|
|
2307
|
-
onKeyDown:
|
|
2308
|
-
onKeyUp:
|
|
2309
|
-
onPaste:
|
|
2307
|
+
onSelect: tr,
|
|
2308
|
+
onFocus: $t,
|
|
2309
|
+
onClick: Qt,
|
|
2310
|
+
onKeyDown: Yn,
|
|
2311
|
+
onKeyUp: en,
|
|
2312
|
+
onPaste: Ln,
|
|
2310
2313
|
placeholder: m,
|
|
2311
2314
|
"aria-label": h,
|
|
2312
2315
|
"aria-autocomplete": G == null ? void 0 : "list",
|
|
@@ -2316,12 +2319,12 @@ var Kt = {
|
|
|
2316
2319
|
disabled: W,
|
|
2317
2320
|
readOnly: $,
|
|
2318
2321
|
rows: 1
|
|
2319
|
-
}),
|
|
2322
|
+
}), rr = G == null ? nr : /* @__PURE__ */ F(N, { children: [nr, /* @__PURE__ */ P("div", {
|
|
2320
2323
|
"aria-hidden": !0,
|
|
2321
2324
|
className: l("pointer-events-none absolute", I?.fontClassName || "dial-body-paragraph-text"),
|
|
2322
2325
|
style: {
|
|
2323
|
-
left:
|
|
2324
|
-
top:
|
|
2326
|
+
left: ln?.left ?? 0,
|
|
2327
|
+
top: ln?.top ?? 0
|
|
2325
2328
|
},
|
|
2326
2329
|
children: /* @__PURE__ */ P(v, {
|
|
2327
2330
|
open: zt,
|
|
@@ -2340,7 +2343,7 @@ var Kt = {
|
|
|
2340
2343
|
children: G.renderMenu({
|
|
2341
2344
|
query: Bt,
|
|
2342
2345
|
caretPosition: Q ?? 0,
|
|
2343
|
-
close:
|
|
2346
|
+
close: fn,
|
|
2344
2347
|
listboxId: Gt,
|
|
2345
2348
|
activeOptionId: qt
|
|
2346
2349
|
})
|
|
@@ -2350,13 +2353,13 @@ var Kt = {
|
|
|
2350
2353
|
className: "inline-block h-[1lh] w-0"
|
|
2351
2354
|
})
|
|
2352
2355
|
})
|
|
2353
|
-
})] }),
|
|
2354
|
-
ref:
|
|
2356
|
+
})] }), ir = /* @__PURE__ */ F("div", {
|
|
2357
|
+
ref: cn,
|
|
2355
2358
|
className: "relative -me-1 -ms-1 w-[calc(100%+8px)]",
|
|
2356
|
-
children: [
|
|
2357
|
-
ref:
|
|
2359
|
+
children: [Qn && /* @__PURE__ */ F("div", {
|
|
2360
|
+
ref: $n,
|
|
2358
2361
|
className: l(K.textarea, I?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden whitespace-pre-wrap pe-1 ps-1 [overflow-wrap:anywhere]"),
|
|
2359
|
-
children: [ze(Y, Ft,
|
|
2362
|
+
children: [ze(Y, Ft, Zn, K.mentionHighlight, K.mentionHighlightUnsupported), er.map((e, t) => /* @__PURE__ */ P("div", {
|
|
2360
2363
|
"aria-hidden": !0,
|
|
2361
2364
|
className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
|
|
2362
2365
|
style: {
|
|
@@ -2366,9 +2369,9 @@ var Kt = {
|
|
|
2366
2369
|
height: e.height
|
|
2367
2370
|
}
|
|
2368
2371
|
}, `selection-${t}`))]
|
|
2369
|
-
}),
|
|
2370
|
-
}),
|
|
2371
|
-
onAttachClick: Oe ? void 0 : () =>
|
|
2372
|
+
}), rr]
|
|
2373
|
+
}), ar = Te ? void 0 : /* @__PURE__ */ P(pt, {
|
|
2374
|
+
onAttachClick: Oe ? void 0 : () => Nn.current?.click(),
|
|
2372
2375
|
attachLabel: y,
|
|
2373
2376
|
addMenuTitle: C,
|
|
2374
2377
|
menuTitle: w,
|
|
@@ -2377,7 +2380,7 @@ var Kt = {
|
|
|
2377
2380
|
isDisabled: W || $,
|
|
2378
2381
|
chatSettings: nt,
|
|
2379
2382
|
extraMenuItems: Lt,
|
|
2380
|
-
onRecordVoice: Be && Dt && !s && !$ ? () =>
|
|
2383
|
+
onRecordVoice: Be && Dt && !s && !$ ? () => An(Je.Attachment) : void 0,
|
|
2381
2384
|
recordVoiceLabel: ie,
|
|
2382
2385
|
toolsMenuItems: at ? rt : void 0,
|
|
2383
2386
|
onToolToggle: it,
|
|
@@ -2385,15 +2388,15 @@ var Kt = {
|
|
|
2385
2388
|
toolsBackLabel: st,
|
|
2386
2389
|
menuOverlays: lt,
|
|
2387
2390
|
getCaretPosition: () => Z.current?.selectionStart ?? Y.length
|
|
2388
|
-
}),
|
|
2391
|
+
}), or = ke === tt.Inline && (!Mt || je), sr = ar && /* @__PURE__ */ P("div", {
|
|
2389
2392
|
className: l("flex", H.addCluster),
|
|
2390
|
-
children:
|
|
2391
|
-
}),
|
|
2393
|
+
children: ar
|
|
2394
|
+
}), cr = Hn.length > 0 && it != null && /* @__PURE__ */ P("div", {
|
|
2392
2395
|
className: l("min-w-0 flex-1", H.toolsChips),
|
|
2393
2396
|
children: /* @__PURE__ */ P(ht, {
|
|
2394
|
-
items:
|
|
2397
|
+
items: Hn,
|
|
2395
2398
|
onToolToggle: it,
|
|
2396
|
-
onToolDismiss:
|
|
2399
|
+
onToolDismiss: Un,
|
|
2397
2400
|
canRemove: at,
|
|
2398
2401
|
removeLabel: ct?.removeLabel,
|
|
2399
2402
|
stateOnLabel: ct?.stateOnLabel,
|
|
@@ -2401,17 +2404,17 @@ var Kt = {
|
|
|
2401
2404
|
})
|
|
2402
2405
|
});
|
|
2403
2406
|
return /* @__PURE__ */ F("div", {
|
|
2404
|
-
ref:
|
|
2407
|
+
ref: Pn,
|
|
2405
2408
|
style: J,
|
|
2406
2409
|
className: l(K.wrapper, W && K.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),
|
|
2407
2410
|
children: [
|
|
2408
|
-
(Ze.length > 0 ||
|
|
2409
|
-
attachments: [...Ze, ...
|
|
2411
|
+
(Ze.length > 0 || mn.length > 0) && /* @__PURE__ */ P(se, {
|
|
2412
|
+
attachments: [...Ze, ...mn],
|
|
2410
2413
|
onRemove: (e) => {
|
|
2411
|
-
Ze.some((t) => t.id === e) ? Qe?.(e) :
|
|
2414
|
+
Ze.some((t) => t.id === e) ? Qe?.(e) : vn(e);
|
|
2412
2415
|
},
|
|
2413
|
-
onRetry:
|
|
2414
|
-
onExpand:
|
|
2416
|
+
onRetry: yn,
|
|
2417
|
+
onExpand: bn,
|
|
2415
2418
|
labels: {
|
|
2416
2419
|
removeLabel: E,
|
|
2417
2420
|
retryLabel: D,
|
|
@@ -2421,58 +2424,58 @@ var Kt = {
|
|
|
2421
2424
|
},
|
|
2422
2425
|
styles: {
|
|
2423
2426
|
...ce,
|
|
2424
|
-
className: l(
|
|
2427
|
+
className: l(mn.length > 6 && "-me-4 w-[calc(100%+1rem)]", ce?.className)
|
|
2425
2428
|
},
|
|
2426
2429
|
onAttachmentClick: Ct == null ? void 0 : (e) => {
|
|
2427
|
-
let t = [...Ze, ...
|
|
2430
|
+
let t = [...Ze, ...mn].find((t) => t.id === e);
|
|
2428
2431
|
t != null && Ct(t);
|
|
2429
2432
|
}
|
|
2430
2433
|
}),
|
|
2431
2434
|
!Te && /* @__PURE__ */ P("input", {
|
|
2432
|
-
ref:
|
|
2435
|
+
ref: Nn,
|
|
2433
2436
|
type: "file",
|
|
2434
2437
|
multiple: !0,
|
|
2435
2438
|
accept: S,
|
|
2436
2439
|
className: "sr-only",
|
|
2437
2440
|
"aria-hidden": !0,
|
|
2438
2441
|
tabIndex: -1,
|
|
2439
|
-
onChange:
|
|
2442
|
+
onChange: Xn
|
|
2440
2443
|
}),
|
|
2441
|
-
|
|
2442
|
-
text:
|
|
2444
|
+
kn && /* @__PURE__ */ P(b, {
|
|
2445
|
+
text: kn,
|
|
2443
2446
|
className: "min-w-0 break-words px-1"
|
|
2444
2447
|
}),
|
|
2445
2448
|
$ && /* @__PURE__ */ P(bt, {
|
|
2446
2449
|
embedded: !0,
|
|
2447
|
-
state:
|
|
2448
|
-
analyserNodeRef:
|
|
2449
|
-
onStop:
|
|
2450
|
-
onDiscard:
|
|
2451
|
-
attachButton:
|
|
2450
|
+
state: Dn,
|
|
2451
|
+
analyserNodeRef: On,
|
|
2452
|
+
onStop: jn,
|
|
2453
|
+
onDiscard: Mn,
|
|
2454
|
+
attachButton: ar,
|
|
2452
2455
|
stopLabel: ae,
|
|
2453
2456
|
discardLabel: oe,
|
|
2454
2457
|
processingLabel: Ge
|
|
2455
2458
|
}),
|
|
2456
|
-
!$ && U &&
|
|
2457
|
-
!$ && !U &&
|
|
2459
|
+
!$ && U && ir,
|
|
2460
|
+
!$ && !U && or && cr && /* @__PURE__ */ P("div", {
|
|
2458
2461
|
className: "flex",
|
|
2459
|
-
children:
|
|
2462
|
+
children: cr
|
|
2460
2463
|
}),
|
|
2461
2464
|
!$ && !U && /* @__PURE__ */ F("div", {
|
|
2462
|
-
className: l("flex items-center gap-2",
|
|
2465
|
+
className: l("flex items-center gap-2", or ? "flex-nowrap" : "flex-wrap", H.actionRow),
|
|
2463
2466
|
children: [
|
|
2464
|
-
|
|
2467
|
+
or && sr,
|
|
2465
2468
|
/* @__PURE__ */ P("div", {
|
|
2466
|
-
className: l("flex min-w-0 items-center self-stretch",
|
|
2467
|
-
children:
|
|
2469
|
+
className: l("flex min-w-0 items-center self-stretch", or ? "flex-1" : "w-full", H.textareaWrap),
|
|
2470
|
+
children: ir
|
|
2468
2471
|
}),
|
|
2469
|
-
!
|
|
2470
|
-
!
|
|
2472
|
+
!or && sr,
|
|
2473
|
+
!or && cr,
|
|
2471
2474
|
/* @__PURE__ */ P("div", {
|
|
2472
2475
|
className: l("ms-auto flex flex-shrink-0 items-center gap-2", H.footerActions),
|
|
2473
2476
|
children: Me ? Me({
|
|
2474
|
-
canSend:
|
|
2475
|
-
onSend:
|
|
2477
|
+
canSend: zn,
|
|
2478
|
+
onSend: Kn
|
|
2476
2479
|
}) : /* @__PURE__ */ F(N, { children: [
|
|
2477
2480
|
kt,
|
|
2478
2481
|
/* @__PURE__ */ P(Zt, {
|
|
@@ -2490,7 +2493,7 @@ var Kt = {
|
|
|
2490
2493
|
onPickerToggle: () => Pt((e) => !e),
|
|
2491
2494
|
onPickerOpenChange: Pt
|
|
2492
2495
|
}),
|
|
2493
|
-
|
|
2496
|
+
Gn && /* @__PURE__ */ P(x, {
|
|
2494
2497
|
icon: /* @__PURE__ */ P(he, {
|
|
2495
2498
|
size: g.LG,
|
|
2496
2499
|
stroke: _,
|
|
@@ -2499,17 +2502,17 @@ var Kt = {
|
|
|
2499
2502
|
"aria-label": re,
|
|
2500
2503
|
tooltipProps: { tooltip: re },
|
|
2501
2504
|
className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
|
|
2502
|
-
onClick: () =>
|
|
2505
|
+
onClick: () => An(Je.Dictation),
|
|
2503
2506
|
disabled: W || s
|
|
2504
2507
|
}),
|
|
2505
2508
|
s && o ? /* @__PURE__ */ P(St, {
|
|
2506
2509
|
onStop: o,
|
|
2507
2510
|
ariaLabel: ne
|
|
2508
2511
|
}) : !s && /* @__PURE__ */ P(xt, {
|
|
2509
|
-
onSend:
|
|
2510
|
-
isDisabled: !
|
|
2512
|
+
onSend: Kn,
|
|
2513
|
+
isDisabled: !Wn || !zn,
|
|
2511
2514
|
ariaLabel: A,
|
|
2512
|
-
sendTooltip:
|
|
2515
|
+
sendTooltip: Rn ? j : te ?? j
|
|
2513
2516
|
})
|
|
2514
2517
|
] })
|
|
2515
2518
|
})
|
|
@@ -2520,7 +2523,7 @@ var Kt = {
|
|
|
2520
2523
|
role: "status",
|
|
2521
2524
|
"aria-live": "polite",
|
|
2522
2525
|
"aria-atomic": "true",
|
|
2523
|
-
children: /* @__PURE__ */ P("span", { children:
|
|
2526
|
+
children: /* @__PURE__ */ P("span", { children: Tn.text }, Tn.revision)
|
|
2524
2527
|
})
|
|
2525
2528
|
]
|
|
2526
2529
|
});
|
package/models/Input.d.ts
CHANGED
|
@@ -534,22 +534,22 @@ export interface InputProps {
|
|
|
534
534
|
*/
|
|
535
535
|
caretPositionOverride?: number;
|
|
536
536
|
/**
|
|
537
|
-
* Host-injected slash-command menu. When provided,
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
537
|
+
* Host-injected slash-command menu. When provided, an overlay opens above
|
|
538
|
+
* the input whenever the whitespace-delimited word at the caret becomes
|
|
539
|
+
* `triggerPrefix` alone or followed by a whitespace-free, prefix-free
|
|
540
|
+
* query — anywhere in the textarea, whether it was empty or already held
|
|
541
|
+
* text, and whether the word was typed or pasted. It stays open while that
|
|
542
|
+
* word keeps matching, and closes on unmatch, Escape, or an outside click.
|
|
543
|
+
* Escape is the one dismissal that latches: the menu stays closed over that
|
|
544
|
+
* same word until it stops matching and the trigger is typed or pasted
|
|
545
|
+
* again. An outside click only
|
|
546
546
|
* closes it for the moment — typing/deleting within the same still-matching
|
|
547
547
|
* word, or moving the caret back into it (a click, or refocusing the
|
|
548
548
|
* textarea), reopens it with no need to retype the trigger. A message can
|
|
549
549
|
* hold more than one command-shaped word at once; the menu always tracks
|
|
550
550
|
* whichever one the caret is actually in, re-evaluated on every such caret
|
|
551
|
-
* move rather than assumed from whichever word was active before.
|
|
552
|
-
*
|
|
551
|
+
* move rather than assumed from whichever word was active before. A paste
|
|
552
|
+
* that leaves any other word at the caret (e.g. `/s sdf`) inserts as a
|
|
553
553
|
* regular paste and opens nothing. Selection typically goes through
|
|
554
554
|
* `ctx.close({ consumeQuery: true })`, which removes the `/query` text from
|
|
555
555
|
* the textarea. Absent disables the mechanism.
|
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.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.336",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,12 +19,12 @@
|
|
|
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.2.0-dev.
|
|
22
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.336"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.336",
|
|
26
26
|
"react": "^19.2.8",
|
|
27
|
-
"@epam/ai-dial-ui-kit": "^0.15.0
|
|
27
|
+
"@epam/ai-dial-ui-kit": "^0.15.0"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|