@apteva/apteva-kit 0.1.94 → 0.1.95
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/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -9
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2271,12 +2271,14 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
2271
2271
|
const handleChange = (e) => {
|
|
2272
2272
|
setText(e.target.value);
|
|
2273
2273
|
e.target.style.height = "auto";
|
|
2274
|
-
|
|
2274
|
+
const scrollHeight = e.target.scrollHeight;
|
|
2275
|
+
e.target.style.height = `${scrollHeight}px`;
|
|
2275
2276
|
const hasNewline = e.target.value.includes("\n");
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2277
|
+
const singleLineHeight = 36;
|
|
2278
|
+
const isOverflowing = scrollHeight > singleLineHeight;
|
|
2279
|
+
if (!isMultiLine && (hasNewline || isOverflowing)) {
|
|
2278
2280
|
setIsMultiLine(true);
|
|
2279
|
-
} else if (isMultiLine && !hasNewline &&
|
|
2281
|
+
} else if (isMultiLine && !hasNewline && !isOverflowing && e.target.value.length < 20) {
|
|
2280
2282
|
setIsMultiLine(false);
|
|
2281
2283
|
}
|
|
2282
2284
|
};
|
|
@@ -2358,7 +2360,7 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
2358
2360
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2359
2361
|
"div",
|
|
2360
2362
|
{
|
|
2361
|
-
className: "apteva-composer
|
|
2363
|
+
className: "apteva-composer",
|
|
2362
2364
|
style: {
|
|
2363
2365
|
gridTemplateColumns: "auto 1fr auto",
|
|
2364
2366
|
gridTemplateAreas: isMultiLine ? '"textarea textarea textarea" "plus . send"' : '"plus textarea send"',
|
|
@@ -2438,9 +2440,9 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
2438
2440
|
"button",
|
|
2439
2441
|
{
|
|
2440
2442
|
onClick: onStop,
|
|
2441
|
-
className: "apteva-composer-stop-btn
|
|
2443
|
+
className: "apteva-composer-stop-btn",
|
|
2442
2444
|
title: "Stop generation",
|
|
2443
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg",
|
|
2445
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "2", y: "2", width: "10", height: "10", rx: "1", fill: "currentColor" }) })
|
|
2444
2446
|
}
|
|
2445
2447
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2446
2448
|
"button",
|
|
@@ -2744,9 +2746,9 @@ function CommandComposer({
|
|
|
2744
2746
|
"button",
|
|
2745
2747
|
{
|
|
2746
2748
|
onClick: onStop,
|
|
2747
|
-
className: "apteva-composer-stop-btn
|
|
2749
|
+
className: "apteva-composer-stop-btn",
|
|
2748
2750
|
title: "Stop generation",
|
|
2749
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg",
|
|
2751
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "2", y: "2", width: "10", height: "10", rx: "1", fill: "currentColor" }) })
|
|
2750
2752
|
}
|
|
2751
2753
|
),
|
|
2752
2754
|
(state === "success" || state === "error") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|