@@ -47,7 +47,6 @@ import {
47
47
} from "lucide-react" ;
48
48
import { type FC , useEffect , useId , useRef , useState } from "react" ;
49
49
import type { AutofillBuildParameter } from "utils/richParameters" ;
50
- import { maskText } from "utils/text" ;
51
50
import * as Yup from "yup" ;
52
51
53
52
interface DynamicParameterProps {
@@ -82,7 +81,7 @@ export const DynamicParameter: FC<DynamicParameterProps> = ({
82
81
/>
83
82
< div className = "max-w-lg" >
84
83
{ parameter . form_type === "input" ||
85
- parameter . form_type === "textarea" ? (
84
+ parameter . form_type === "textarea" ? (
86
85
< DebouncedParameterField
87
86
id = { id }
88
87
parameter = { parameter }
@@ -313,16 +312,13 @@ const DebouncedParameterField: FC<DebouncedParameterFieldProps> = ({
313
312
314
313
switch ( parameter . form_type ) {
315
314
case "textarea" : {
316
- const shouldMask = parameter . styling ?. mask_input && ! showMaskedInput ;
317
- const displayValue = shouldMask ? maskText ( localValue ) : localValue ;
318
-
319
315
return (
320
316
< div className = "relative" >
321
317
< Textarea
322
318
ref = { textareaRef }
323
319
id = { id }
324
320
className = "overflow-y-auto max-h-[500px]"
325
- value = { displayValue }
321
+ value = { localValue }
326
322
onChange = { ( e ) => {
327
323
const target = e . currentTarget ;
328
324
target . style . height = "auto" ;
@@ -355,7 +351,12 @@ const DebouncedParameterField: FC<DebouncedParameterFieldProps> = ({
355
351
}
356
352
357
353
case "input" : {
358
- const inputType = parameter . type === "number" ? "number" : "text" ;
354
+ const inputType =
355
+ parameter . type === "number"
356
+ ? "number"
357
+ : parameter . styling ?. mask_input && ! showMaskedInput
358
+ ? "password"
359
+ : "text" ;
359
360
const inputProps : Record < string , unknown > = { } ;
360
361
361
362
if ( parameter . type === "number" ) {
@@ -371,18 +372,12 @@ const DebouncedParameterField: FC<DebouncedParameterFieldProps> = ({
371
372
}
372
373
}
373
374
374
- const shouldMask =
375
- parameter . styling ?. mask_input &&
376
- ! showMaskedInput &&
377
- parameter . type !== "number" ;
378
- const displayValue = shouldMask ? maskText ( localValue ) : localValue ;
379
-
380
375
return (
381
376
< div className = "relative" >
382
377
< Input
383
378
id = { id }
384
379
type = { inputType }
385
- value = { displayValue }
380
+ value = { localValue }
386
381
onChange = { ( e ) => {
387
382
setLocalValue ( e . target . value ) ;
388
383
} }
@@ -686,11 +681,10 @@ const ParameterDiagnostics: FC<ParameterDiagnosticsProps> = ({
686
681
return (
687
682
< div
688
683
key = { `parameter-diagnostic-${ diagnostic . summary } -${ index } ` }
689
- className = { `text-xs px-1 ${
690
- diagnostic . severity === "error"
684
+ className = { `text-xs px-1 ${ diagnostic . severity === "error"
691
685
? "text-content-destructive"
692
686
: "text-content-warning"
693
- } `}
687
+ } `}
694
688
>
695
689
< p className = "font-medium" > { diagnostic . summary } </ p >
696
690
{ diagnostic . detail && < p className = "m-0" > { diagnostic . detail } </ p > }
@@ -745,7 +739,7 @@ const isValidParameterOption = (
745
739
if ( Array . isArray ( parsed ) ) {
746
740
values = parsed ;
747
741
}
748
- } catch ( e ) {
742
+ } catch {
749
743
return false ;
750
744
}
751
745
@@ -947,11 +941,10 @@ export const Diagnostics: FC<DiagnosticsProps> = ({ diagnostics }) => {
947
941
< div
948
942
key = { `diagnostic-${ diagnostic . summary } -${ index } ` }
949
943
className = { `text-xs font-semibold flex flex-col rounded-md border px-3.5 py-3.5 border-solid
950
- ${
951
- diagnostic . severity === "error"
952
- ? "text-content-primary border-border-destructive bg-content-destructive/15"
953
- : "text-content-primary border-border-warning bg-content-warning/15"
954
- } `}
944
+ ${ diagnostic . severity === "error"
945
+ ? "text-content-primary border-border-destructive bg-content-destructive/15"
946
+ : "text-content-primary border-border-warning bg-content-warning/15"
947
+ } `}
955
948
>
956
949
< div className = "flex flex-row items-start" >
957
950
{ diagnostic . severity === "error" && (
0 commit comments