@schemavaults/ui 0.112.1 → 0.113.0
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/components/ui/prompt-input/prompt-input-textarea-sizing.d.ts +91 -0
- package/dist/components/ui/prompt-input/prompt-input-textarea-sizing.js +109 -0
- package/dist/components/ui/prompt-input/prompt-input-textarea-sizing.js.map +1 -0
- package/dist/components/ui/prompt-input/prompt-input-variants.js +3 -1
- package/dist/components/ui/prompt-input/prompt-input-variants.js.map +1 -1
- package/dist/components/ui/prompt-input/prompt-input.d.ts +21 -1
- package/dist/components/ui/prompt-input/prompt-input.js +35 -9
- package/dist/components/ui/prompt-input/prompt-input.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-resize for `<PromptInputTextarea>`, kept free of React and of a real
|
|
3
|
+
* DOM so it can be unit tested: a test stands in for the `<textarea>` and
|
|
4
|
+
* supplies the `scrollHeight` and computed style that only a browser can lay
|
|
5
|
+
* out.
|
|
6
|
+
*
|
|
7
|
+
* Heights are border-box heights — what the textarea measures on the page —
|
|
8
|
+
* unless a name says otherwise.
|
|
9
|
+
*/
|
|
10
|
+
/** The parts of a `<textarea>` the sizing reads and writes. */
|
|
11
|
+
export interface PromptInputTextareaSizingTarget {
|
|
12
|
+
readonly style: {
|
|
13
|
+
height: string;
|
|
14
|
+
overflowY: string;
|
|
15
|
+
};
|
|
16
|
+
/** Content plus padding, as `HTMLElement.scrollHeight` reports it. */
|
|
17
|
+
readonly scrollHeight: number;
|
|
18
|
+
/** Padding-box height, as `HTMLElement.clientHeight` reports it. */
|
|
19
|
+
readonly clientHeight: number;
|
|
20
|
+
/** Border-box height, as `HTMLElement.offsetHeight` reports it. */
|
|
21
|
+
readonly offsetHeight: number;
|
|
22
|
+
}
|
|
23
|
+
/** The computed style properties the sizing reads. */
|
|
24
|
+
export type PromptInputTextareaComputedStyle = Pick<CSSStyleDeclaration, "boxSizing" | "lineHeight" | "fontSize" | "paddingTop" | "paddingBottom" | "borderTopWidth" | "borderBottomWidth">;
|
|
25
|
+
/** What the sizing remembers about one textarea between runs. */
|
|
26
|
+
export interface PromptInputTextareaSizingState {
|
|
27
|
+
/**
|
|
28
|
+
* The inline `height` as the sizing last wrote or saw it. Any other value
|
|
29
|
+
* was set by someone else: in practice the user dragging the resize
|
|
30
|
+
* handle, which the browser applies as an inline `height`.
|
|
31
|
+
*/
|
|
32
|
+
lastInlineHeight: string | null;
|
|
33
|
+
/** The height the user last dragged the textarea to, if they have. */
|
|
34
|
+
userHeightPx: number | null;
|
|
35
|
+
}
|
|
36
|
+
export interface PromptInputTextareaSizingOptions {
|
|
37
|
+
/** Fewest lines of text to show. */
|
|
38
|
+
rows: number;
|
|
39
|
+
/** Where auto-grow stops and the textarea starts scrolling. */
|
|
40
|
+
maxHeightPx: number;
|
|
41
|
+
/** Keep the height the user drags the textarea to as its floor. */
|
|
42
|
+
resizable: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The computed line height in pixels. `normal` depends on the font, so it
|
|
46
|
+
* falls back to the usual 1.2 × font size.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveLineHeightPx(lineHeight: string, fontSize: string): number;
|
|
49
|
+
/**
|
|
50
|
+
* The height that shows `rows` lines of text: the floor `rows` puts under
|
|
51
|
+
* auto-resize. One row needs no floor of its own, because even an empty
|
|
52
|
+
* textarea measures a line tall.
|
|
53
|
+
*/
|
|
54
|
+
export declare function rowsMinHeightPx(rows: number, style: PromptInputTextareaComputedStyle): number;
|
|
55
|
+
export interface PromptInputTextareaHeightInput {
|
|
56
|
+
/**
|
|
57
|
+
* The height the content needs, measured with the textarea collapsed, so
|
|
58
|
+
* it already respects any CSS `min-height`.
|
|
59
|
+
*/
|
|
60
|
+
contentHeightPx: number;
|
|
61
|
+
/** The floor from `rows`. */
|
|
62
|
+
rowsMinHeightPx: number;
|
|
63
|
+
/** The height the user dragged the textarea to, or null. */
|
|
64
|
+
userHeightPx: number | null;
|
|
65
|
+
/** Where auto-grow stops and the textarea starts scrolling. */
|
|
66
|
+
maxHeightPx: number;
|
|
67
|
+
}
|
|
68
|
+
export interface PromptInputTextareaHeight {
|
|
69
|
+
heightPx: number;
|
|
70
|
+
overflowY: "auto" | "hidden";
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Grow with the content between a floor and a cap. The floor is `rows`, or
|
|
74
|
+
* the user's dragged height if that is taller; the cap is `maxHeightPx`, or
|
|
75
|
+
* the floor if that is taller. Past the cap the textarea scrolls.
|
|
76
|
+
*/
|
|
77
|
+
export declare function computePromptInputTextareaHeight({ contentHeightPx, rowsMinHeightPx, userHeightPx, maxHeightPx, }: PromptInputTextareaHeightInput): PromptInputTextareaHeight;
|
|
78
|
+
/**
|
|
79
|
+
* Notice an inline height someone else gave the textarea since the sizing
|
|
80
|
+
* last touched it, and remember it as the user's dragged height. Returns
|
|
81
|
+
* whether there was one.
|
|
82
|
+
*/
|
|
83
|
+
export declare function capturePromptInputTextareaUserResize(target: PromptInputTextareaSizingTarget, state: PromptInputTextareaSizingState): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Run while the user drags the resize handle: remember the new height, and
|
|
86
|
+
* show a scrollbar if it hides some of the content. The next value change
|
|
87
|
+
* sizes the textarea from the content again.
|
|
88
|
+
*/
|
|
89
|
+
export declare function syncPromptInputTextareaUserResize(target: PromptInputTextareaSizingTarget, state: PromptInputTextareaSizingState): void;
|
|
90
|
+
/** Size the textarea to its content. Run whenever the value changes. */
|
|
91
|
+
export declare function sizePromptInputTextarea(target: PromptInputTextareaSizingTarget, style: PromptInputTextareaComputedStyle, { rows, maxHeightPx, resizable }: PromptInputTextareaSizingOptions, state: PromptInputTextareaSizingState): void;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-resize for `<PromptInputTextarea>`, kept free of React and of a real
|
|
3
|
+
* DOM so it can be unit tested: a test stands in for the `<textarea>` and
|
|
4
|
+
* supplies the `scrollHeight` and computed style that only a browser can lay
|
|
5
|
+
* out.
|
|
6
|
+
*
|
|
7
|
+
* Heights are border-box heights — what the textarea measures on the page —
|
|
8
|
+
* unless a name says otherwise.
|
|
9
|
+
*/
|
|
10
|
+
function px(value) {
|
|
11
|
+
const parsed = Number.parseFloat(value);
|
|
12
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The computed line height in pixels. `normal` depends on the font, so it
|
|
16
|
+
* falls back to the usual 1.2 × font size.
|
|
17
|
+
*/
|
|
18
|
+
export function resolveLineHeightPx(lineHeight, fontSize) {
|
|
19
|
+
if (lineHeight.endsWith("px"))
|
|
20
|
+
return px(lineHeight);
|
|
21
|
+
const multiplier = Number.parseFloat(lineHeight);
|
|
22
|
+
return (Number.isFinite(multiplier) ? multiplier : 1.2) * px(fontSize);
|
|
23
|
+
}
|
|
24
|
+
function verticalPaddingPx(style) {
|
|
25
|
+
return px(style.paddingTop) + px(style.paddingBottom);
|
|
26
|
+
}
|
|
27
|
+
function verticalBorderPx(style) {
|
|
28
|
+
return px(style.borderTopWidth) + px(style.borderBottomWidth);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The height that shows `rows` lines of text: the floor `rows` puts under
|
|
32
|
+
* auto-resize. One row needs no floor of its own, because even an empty
|
|
33
|
+
* textarea measures a line tall.
|
|
34
|
+
*/
|
|
35
|
+
export function rowsMinHeightPx(rows, style) {
|
|
36
|
+
if (!Number.isFinite(rows) || rows <= 1)
|
|
37
|
+
return 0;
|
|
38
|
+
return (rows * resolveLineHeightPx(style.lineHeight, style.fontSize) +
|
|
39
|
+
verticalPaddingPx(style) +
|
|
40
|
+
verticalBorderPx(style));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Grow with the content between a floor and a cap. The floor is `rows`, or
|
|
44
|
+
* the user's dragged height if that is taller; the cap is `maxHeightPx`, or
|
|
45
|
+
* the floor if that is taller. Past the cap the textarea scrolls.
|
|
46
|
+
*/
|
|
47
|
+
export function computePromptInputTextareaHeight({ contentHeightPx, rowsMinHeightPx, userHeightPx, maxHeightPx, }) {
|
|
48
|
+
const floorPx = Math.max(rowsMinHeightPx, userHeightPx ?? 0);
|
|
49
|
+
const capPx = Math.max(maxHeightPx, floorPx);
|
|
50
|
+
return {
|
|
51
|
+
heightPx: Math.min(Math.max(contentHeightPx, floorPx), capPx),
|
|
52
|
+
overflowY: contentHeightPx > capPx ? "auto" : "hidden",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Notice an inline height someone else gave the textarea since the sizing
|
|
57
|
+
* last touched it, and remember it as the user's dragged height. Returns
|
|
58
|
+
* whether there was one.
|
|
59
|
+
*/
|
|
60
|
+
export function capturePromptInputTextareaUserResize(target, state) {
|
|
61
|
+
const inlineHeight = target.style.height;
|
|
62
|
+
if (state.lastInlineHeight === null ||
|
|
63
|
+
inlineHeight === state.lastInlineHeight) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
state.lastInlineHeight = inlineHeight;
|
|
67
|
+
// Measured rather than parsed, so CSS min/max-height clamping is included.
|
|
68
|
+
state.userHeightPx = target.offsetHeight;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Run while the user drags the resize handle: remember the new height, and
|
|
73
|
+
* show a scrollbar if it hides some of the content. The next value change
|
|
74
|
+
* sizes the textarea from the content again.
|
|
75
|
+
*/
|
|
76
|
+
export function syncPromptInputTextareaUserResize(target, state) {
|
|
77
|
+
if (!capturePromptInputTextareaUserResize(target, state))
|
|
78
|
+
return;
|
|
79
|
+
target.style.overflowY =
|
|
80
|
+
target.scrollHeight > target.clientHeight ? "auto" : "hidden";
|
|
81
|
+
}
|
|
82
|
+
/** Size the textarea to its content. Run whenever the value changes. */
|
|
83
|
+
export function sizePromptInputTextarea(target, style, { rows, maxHeightPx, resizable }, state) {
|
|
84
|
+
// A drag the resize observer has not reported yet still counts.
|
|
85
|
+
if (resizable) {
|
|
86
|
+
capturePromptInputTextareaUserResize(target, state);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
state.userHeightPx = null;
|
|
90
|
+
}
|
|
91
|
+
// Collapse first, so scrollHeight reports what the content needs rather
|
|
92
|
+
// than the current height.
|
|
93
|
+
target.style.height = "0px";
|
|
94
|
+
const borderPx = verticalBorderPx(style);
|
|
95
|
+
const { heightPx, overflowY } = computePromptInputTextareaHeight({
|
|
96
|
+
contentHeightPx: target.scrollHeight + borderPx,
|
|
97
|
+
rowsMinHeightPx: rowsMinHeightPx(rows, style),
|
|
98
|
+
userHeightPx: state.userHeightPx,
|
|
99
|
+
maxHeightPx,
|
|
100
|
+
});
|
|
101
|
+
const styleHeightPx = style.boxSizing === "content-box"
|
|
102
|
+
? heightPx - verticalPaddingPx(style) - borderPx
|
|
103
|
+
: heightPx;
|
|
104
|
+
target.style.height = `${styleHeightPx}px`;
|
|
105
|
+
target.style.overflowY = overflowY;
|
|
106
|
+
// Read back: the browser normalizes what was written.
|
|
107
|
+
state.lastInlineHeight = target.style.height;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=prompt-input-textarea-sizing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-input-textarea-sizing.js","sourceRoot":"","sources":["../../../../src/components/ui/prompt-input/prompt-input-textarea-sizing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA8CH,SAAS,EAAE,CAAC,KAAa;IACvB,MAAM,MAAM,GAAW,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB,EA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AAwE;IACxE,2BAA2B;IAC3B,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IAC5B,MAAM,QAAQ,GAAW,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,gCAAgC,CAAC;QAC/D,eAAe,EAAE,MAAM,CAAC,YAAY,GAAG,QAAQ;QAC/C,eAAe,EAAE,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC;QAC7C,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,WAAW;KACZ,CAAC,CAAC;IAEH,MAAM,aAAa,GACjB,KAAK,CAAC,SAAS,KAAK,aAAa;QAC/B,CAAC,CAAC,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,GAAG,QAAQ;QAChD,CAAC,CAAC,QAAQ,CAAC;IACf,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,aAAa,IAAI,CAAC;IAC3C,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACnC,sDAAsD;IACtD,KAAK,CAAC,gBAAgB,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;AAC/C,CAAC"}
|
|
@@ -6,7 +6,9 @@ export const promptInputVariantIds = [
|
|
|
6
6
|
"ghost",
|
|
7
7
|
];
|
|
8
8
|
export const promptInputSizeIds = ["sm", "default", "lg"];
|
|
9
|
-
|
|
9
|
+
// `shrink-0`: `overflow-hidden` drops the form's automatic minimum height, so
|
|
10
|
+
// without it a flex column could squeeze the form and clip its toolbar.
|
|
11
|
+
export const promptInputVariants = cva("group/prompt-input relative flex w-full shrink-0 flex-col overflow-hidden ring-offset-background transition-colors focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-60", {
|
|
10
12
|
variants: {
|
|
11
13
|
variant: {
|
|
12
14
|
default: "rounded-md border border-input bg-background",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input-variants.js","sourceRoot":"","sources":["../../../../src/components/ui/prompt-input/prompt-input-variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,UAAU;IACV,QAAQ;IACR,OAAO;CAC6B,CAAC;AAGvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAsC,CAAC;AAG/F,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,
|
|
1
|
+
{"version":3,"file":"prompt-input-variants.js","sourceRoot":"","sources":["../../../../src/components/ui/prompt-input/prompt-input-variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,UAAU;IACV,QAAQ;IACR,OAAO;CAC6B,CAAC;AAGvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAsC,CAAC;AAG/F,8EAA8E;AAC9E,wEAAwE;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CACpC,kQAAkQ,EAClQ;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,8CAA8C;YACvD,QAAQ,EACN,yDAAyD;YAC3D,MAAM,EACJ,+CAA+C;YACjD,KAAK,EACH,gFAAgF;SACtC;QAC9C,IAAI,EAAE;YACJ,EAAE,EAAE,SAAS;YACb,OAAO,EAAE,SAAS;YAClB,EAAE,EAAE,WAAW;SAC0B;KAC5C;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAC;AAIF,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,EAAE,EAAE,uCAAuC;IAC3C,OAAO,EAAE,yCAAyC;IAClD,EAAE,EAAE,uCAAuC;CACF,CAAC;AAE5C,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,EAAE,EAAE,wBAAwB;IAC5B,OAAO,EAAE,wBAAwB;IACjC,EAAE,EAAE,0BAA0B;CACW,CAAC"}
|
|
@@ -63,8 +63,28 @@ export interface PromptInputTextareaProps extends Omit<TextareaHTMLAttributes<HT
|
|
|
63
63
|
* textarea starts scrolling internally. Default: 240.
|
|
64
64
|
*/
|
|
65
65
|
maxHeightPx?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Fewest lines of text to show. Auto-resize never shrinks the textarea
|
|
68
|
+
* below this many rows, nor below the size's `min-h-*`. Default: 1.
|
|
69
|
+
*/
|
|
70
|
+
rows?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Let the user drag the textarea's bottom edge to resize it. The height
|
|
73
|
+
* they choose becomes its new floor: it stays through typing and after
|
|
74
|
+
* the value is cleared, and the textarea still grows with its content
|
|
75
|
+
* above it, up to `maxHeightPx` or the chosen height, whichever is
|
|
76
|
+
* taller. Dragging it smaller lowers the floor, but never below `rows`.
|
|
77
|
+
* Default: false.
|
|
78
|
+
*/
|
|
79
|
+
resizable?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Grow and shrink the textarea with its content. Set to false for a plain
|
|
82
|
+
* textarea whose height comes only from `rows`, CSS and — with
|
|
83
|
+
* `resizable` — the user's drag. Default: true.
|
|
84
|
+
*/
|
|
85
|
+
autoResize?: boolean;
|
|
66
86
|
}
|
|
67
|
-
declare function PromptInputTextarea({ className, submitOnEnter, maxHeightPx, onKeyDown, rows, ref: forwardedRef, ...props }: PromptInputTextareaProps & {
|
|
87
|
+
declare function PromptInputTextarea({ className, submitOnEnter, maxHeightPx, resizable, autoResize, onKeyDown, rows, ref: forwardedRef, ...props }: PromptInputTextareaProps & {
|
|
68
88
|
ref?: Ref<HTMLTextAreaElement>;
|
|
69
89
|
}): ReactElement;
|
|
70
90
|
declare namespace PromptInputTextarea {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useCallback, useContext, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
3
|
+
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import { ArrowUp, Square } from "lucide-react";
|
|
5
5
|
import { cn } from "../../../lib/utils";
|
|
6
6
|
import { Button } from "../button/button";
|
|
7
7
|
import { promptInputSizeIds, promptInputTextareaSizeClass, promptInputToolbarSizeClass, promptInputVariantIds, promptInputVariants, } from "./prompt-input-variants";
|
|
8
|
+
import { sizePromptInputTextarea, syncPromptInputTextareaUserResize, } from "./prompt-input-textarea-sizing";
|
|
8
9
|
const PromptInputContext = createContext(null);
|
|
9
10
|
function usePromptInputContext(component) {
|
|
10
11
|
const ctx = useContext(PromptInputContext);
|
|
@@ -69,9 +70,13 @@ function PromptInput({ value: controlledValue, defaultValue, onValueChange, onSu
|
|
|
69
70
|
return (_jsx(PromptInputContext.Provider, { value: contextValue, children: _jsx("form", { ref: ref, "data-slot": "prompt-input", "data-variant": variant, "data-size": size, "data-loading": isLoading ? "true" : "false", "data-disabled": disabled ? "true" : "false", onSubmit: handleFormSubmit, className: cn(promptInputVariants({ variant, size }), className), ...formProps, children: children }) }));
|
|
70
71
|
}
|
|
71
72
|
PromptInput.displayName = "PromptInput";
|
|
72
|
-
function PromptInputTextarea({ className, submitOnEnter = true, maxHeightPx = 240, onKeyDown, rows = 1, ref: forwardedRef, ...props }) {
|
|
73
|
+
function PromptInputTextarea({ className, submitOnEnter = true, maxHeightPx = 240, resizable = false, autoResize = true, onKeyDown, rows = 1, ref: forwardedRef, ...props }) {
|
|
73
74
|
const ctx = usePromptInputContext("PromptInputTextarea");
|
|
74
75
|
const internalRef = ctx.textareaRef;
|
|
76
|
+
const sizingStateRef = useRef({
|
|
77
|
+
lastInlineHeight: null,
|
|
78
|
+
userHeightPx: null,
|
|
79
|
+
});
|
|
75
80
|
// Merge external ref if the consumer passed one.
|
|
76
81
|
const setRef = useCallback((node) => {
|
|
77
82
|
internalRef.current = node;
|
|
@@ -86,13 +91,34 @@ function PromptInputTextarea({ className, submitOnEnter = true, maxHeightPx = 24
|
|
|
86
91
|
// Auto-resize: recompute height whenever the value changes.
|
|
87
92
|
useLayoutEffect(() => {
|
|
88
93
|
const el = internalRef.current;
|
|
89
|
-
if (el === null)
|
|
94
|
+
if (el === null || !autoResize)
|
|
90
95
|
return;
|
|
91
|
-
el
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
sizePromptInputTextarea(el, getComputedStyle(el), { rows, maxHeightPx, resizable }, sizingStateRef.current);
|
|
97
|
+
}, [
|
|
98
|
+
autoResize,
|
|
99
|
+
ctx.value,
|
|
100
|
+
ctx.size,
|
|
101
|
+
internalRef,
|
|
102
|
+
maxHeightPx,
|
|
103
|
+
resizable,
|
|
104
|
+
rows,
|
|
105
|
+
]);
|
|
106
|
+
// A drag of the resize handle arrives as a new inline height. Watch for it
|
|
107
|
+
// so the scrollbar matches the dragged size straight away; the next value
|
|
108
|
+
// change keeps it as the floor either way. Observing the border box means
|
|
109
|
+
// that toggling the scrollbar does not trigger another observation.
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
const el = internalRef.current;
|
|
112
|
+
if (el === null || !autoResize || !resizable)
|
|
113
|
+
return;
|
|
114
|
+
if (typeof ResizeObserver === "undefined")
|
|
115
|
+
return;
|
|
116
|
+
const observer = new ResizeObserver(() => {
|
|
117
|
+
syncPromptInputTextareaUserResize(el, sizingStateRef.current);
|
|
118
|
+
});
|
|
119
|
+
observer.observe(el, { box: "border-box" });
|
|
120
|
+
return () => observer.disconnect();
|
|
121
|
+
}, [autoResize, internalRef, resizable]);
|
|
96
122
|
const handleChange = useCallback((event) => {
|
|
97
123
|
ctx.setValue(event.target.value);
|
|
98
124
|
}, [ctx]);
|
|
@@ -115,7 +141,7 @@ function PromptInputTextarea({ className, submitOnEnter = true, maxHeightPx = 24
|
|
|
115
141
|
ctx.submit();
|
|
116
142
|
}
|
|
117
143
|
}, [ctx, onKeyDown, submitOnEnter]);
|
|
118
|
-
return (_jsx("textarea", { ref: setRef, "data-slot": "prompt-input-textarea", value: ctx.value, onChange: handleChange, onKeyDown: handleKeyDown, disabled: ctx.disabled, rows: rows, maxLength: ctx.maxLength, className: cn("w-full
|
|
144
|
+
return (_jsx("textarea", { ref: setRef, "data-slot": "prompt-input-textarea", value: ctx.value, onChange: handleChange, onKeyDown: handleKeyDown, disabled: ctx.disabled, rows: rows, maxLength: ctx.maxLength, className: cn("w-full bg-transparent text-foreground placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed", resizable ? "resize-y" : "resize-none", promptInputTextareaSizeClass[ctx.size], className), ...props }));
|
|
119
145
|
}
|
|
120
146
|
PromptInputTextarea.displayName = "PromptInputTextarea";
|
|
121
147
|
function PromptInputToolbar({ className, ref, ...props }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-input.js","sourceRoot":"","sources":["../../../../src/components/ui/prompt-input/prompt-input.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GAaT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,EAAoB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,GAGpB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt-input.js","sourceRoot":"","sources":["../../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