MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / BaseTextInput

Function BaseTextInput

source code/components/BaseTextInput.tsx:24–137  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

22 * A base component for text inputs that handles rendering and basic input
23 */
24export function BaseTextInput(t0) {
25 const $ = _c(14);
26 const {
27 inputState,
28 children,
29 terminalFocus,
30 invert,
31 hidePlaceholderText,
32 ...props
33 } = t0;
34 const {
35 onInput,
36 renderedValue,
37 cursorLine,
38 cursorColumn
39 } = inputState;
40 const t1 = Boolean(props.focus && props.showCursor && terminalFocus);
41 let t2;
42 if ($[0] !== cursorColumn || $[1] !== cursorLine || $[2] !== t1) {
43 t2 = {
44 line: cursorLine,
45 column: cursorColumn,
46 active: t1
47 };
48 $[0] = cursorColumn;
49 $[1] = cursorLine;
50 $[2] = t1;
51 $[3] = t2;
52 } else {
53 t2 = $[3];
54 }
55 const cursorRef = useDeclaredCursor(t2);
56 const {
57 wrappedOnInput,
58 isPasting: t3
59 } = usePasteHandler({
60 onPaste: props.onPaste,
61 onInput: (input, key) => {
62 if (isPasting && key.return) {
63 return;
64 }
65 onInput(input, key);
66 },
67 onImagePaste: props.onImagePaste
68 });
69 const isPasting = t3;
70 const {
71 onIsPastingChange
72 } = props;
73 React.useEffect(() => {
74 if (onIsPastingChange) {
75 onIsPastingChange(isPasting);
76 }
77 }, [isPasting, onIsPastingChange]);
78 const {
79 showPlaceholder,
80 renderedPlaceholder
81 } = renderPlaceholder({

Callers

nothing calls this directly

Calls 6

useDeclaredCursorFunction · 0.85
usePasteHandlerFunction · 0.85
onInputFunction · 0.85
renderPlaceholderFunction · 0.85
useInputFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected