Fix typo to permanentlySetValue
This commit is contained in:
parent
0ccb9b2386
commit
7c098c4655
11 changed files with 20 additions and 20 deletions
|
@ -23,7 +23,7 @@ const BooleanPropEditor: React.FC<{
|
|||
|
||||
const onChange = useCallback(
|
||||
(el: React.ChangeEvent<HTMLInputElement>) => {
|
||||
stuff.permenantlySetValue(Boolean(el.target.checked))
|
||||
stuff.permanentlySetValue(Boolean(el.target.checked))
|
||||
},
|
||||
[propConfig, pointerToProp, obj],
|
||||
)
|
||||
|
|
|
@ -29,7 +29,7 @@ const NumberPropEditor: React.FC<{
|
|||
value={stuff.value}
|
||||
temporarilySetValue={stuff.temporarilySetValue}
|
||||
discardTemporaryValue={stuff.discardTemporaryValue}
|
||||
permenantlySetValue={stuff.permenantlySetValue}
|
||||
permanentlySetValue={stuff.permanentlySetValue}
|
||||
range={propConfig.range}
|
||||
nudge={nudge}
|
||||
/>
|
||||
|
|
|
@ -76,7 +76,7 @@ const RgbaPropEditor: React.FC<{
|
|||
const onChange = useCallback(
|
||||
(color: string) => {
|
||||
const rgba = decorateRgba(parseRgbaFromHex(color))
|
||||
stuff.permenantlySetValue(rgba)
|
||||
stuff.permanentlySetValue(rgba)
|
||||
},
|
||||
[stuff],
|
||||
)
|
||||
|
@ -98,7 +98,7 @@ const RgbaPropEditor: React.FC<{
|
|||
permanentlySetValue={(color) => {
|
||||
// console.log('perm')
|
||||
const rgba = decorateRgba(color)
|
||||
stuff.permenantlySetValue(rgba)
|
||||
stuff.permanentlySetValue(rgba)
|
||||
}}
|
||||
discardTemporaryValue={stuff.discardTemporaryValue}
|
||||
/>
|
||||
|
@ -120,7 +120,7 @@ const RgbaPropEditor: React.FC<{
|
|||
value={rgba2hex(stuff.value)}
|
||||
temporarilySetValue={noop}
|
||||
discardTemporaryValue={noop}
|
||||
permenantlySetValue={onChange}
|
||||
permanentlySetValue={onChange}
|
||||
isValid={(v) => !!v.match(/^#?([0-9a-f]{8})$/i)}
|
||||
/>
|
||||
</RowContainer>
|
||||
|
|
|
@ -20,7 +20,7 @@ const StringLiteralPropEditor: React.FC<{
|
|||
|
||||
const onChange = useCallback(
|
||||
(val: string) => {
|
||||
stuff.permenantlySetValue(val)
|
||||
stuff.permanentlySetValue(val)
|
||||
},
|
||||
[propConfig, pointerToProp, obj],
|
||||
)
|
||||
|
|
|
@ -22,7 +22,7 @@ const StringPropEditor: React.FC<{
|
|||
value={stuff.value}
|
||||
temporarilySetValue={stuff.temporarilySetValue}
|
||||
discardTemporaryValue={stuff.discardTemporaryValue}
|
||||
permenantlySetValue={stuff.permenantlySetValue}
|
||||
permanentlySetValue={stuff.permanentlySetValue}
|
||||
/>
|
||||
</SingleRowPropEditor>
|
||||
)
|
||||
|
|
|
@ -23,7 +23,7 @@ interface CommonStuff<T> {
|
|||
|
||||
temporarilySetValue(v: T): void
|
||||
discardTemporaryValue(): void
|
||||
permenantlySetValue(v: T): void
|
||||
permanentlySetValue(v: T): void
|
||||
}
|
||||
|
||||
interface Default<T> extends CommonStuff<T> {
|
||||
|
@ -76,7 +76,7 @@ export function useEditingToolsForPrimitiveProp<
|
|||
currentScrub = null
|
||||
}
|
||||
},
|
||||
permenantlySetValue(v: T): void {
|
||||
permanentlySetValue(v: T): void {
|
||||
if (currentScrub) {
|
||||
currentScrub.capture((api) => {
|
||||
api.set(pointerToProp, v)
|
||||
|
|
|
@ -192,7 +192,7 @@ const CurveEditorPopover: React.FC<
|
|||
tempTransaction = undefined
|
||||
}
|
||||
},
|
||||
permenantlySetValue(newCurve: string): void {
|
||||
permanentlySetValue(newCurve: string): void {
|
||||
if (tempTransaction) {
|
||||
tempTransaction.discard()
|
||||
tempTransaction = undefined
|
||||
|
@ -282,7 +282,7 @@ const CurveEditorPopover: React.FC<
|
|||
props.onRequestClose()
|
||||
}
|
||||
if (e.key === 'Enter') {
|
||||
fns.permenantlySetValue(filter)
|
||||
fns.permanentlySetValue(filter)
|
||||
props.onRequestClose()
|
||||
}
|
||||
}}
|
||||
|
@ -302,7 +302,7 @@ const CurveEditorPopover: React.FC<
|
|||
if (e.key === 'Escape') {
|
||||
props.onRequestClose()
|
||||
} else if (e.key === 'Enter') {
|
||||
fns.permenantlySetValue(preset.value)
|
||||
fns.permanentlySetValue(preset.value)
|
||||
props.onRequestClose()
|
||||
}
|
||||
if (e.key === 'ArrowRight') {
|
||||
|
@ -358,7 +358,7 @@ const CurveEditorPopover: React.FC<
|
|||
ref={optionsRef.current[preset.label]}
|
||||
key={preset.label}
|
||||
onClick={() => {
|
||||
fns.permenantlySetValue(preset.value)
|
||||
fns.permanentlySetValue(preset.value)
|
||||
props.onRequestClose()
|
||||
}}
|
||||
// Temporarily apply on hover
|
||||
|
|
|
@ -57,7 +57,7 @@ const LengthEditorPopover: React.FC<{
|
|||
tempTransaction = undefined
|
||||
}
|
||||
},
|
||||
permenantlySetValue(newLength: number): void {
|
||||
permanentlySetValue(newLength: number): void {
|
||||
if (tempTransaction) {
|
||||
tempTransaction.discard()
|
||||
tempTransaction = undefined
|
||||
|
|
|
@ -55,7 +55,7 @@ const PlayheadPositionPopover: React.FC<{
|
|||
sequence.position = originalPosition
|
||||
}
|
||||
},
|
||||
permenantlySetValue(newPosition: number): void {
|
||||
permanentlySetValue(newPosition: number): void {
|
||||
if (tempPosition) {
|
||||
tempPosition = undefined
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ const BasicNumberInput: React.FC<{
|
|||
value: number
|
||||
temporarilySetValue: (v: number) => void
|
||||
discardTemporaryValue: () => void
|
||||
permenantlySetValue: (v: number) => void
|
||||
permanentlySetValue: (v: number) => void
|
||||
className?: string
|
||||
range?: [min: number, max: number]
|
||||
isValid?: (v: number) => boolean
|
||||
|
@ -167,7 +167,7 @@ const BasicNumberInput: React.FC<{
|
|||
if (curState.valueBeforeEditing === value) {
|
||||
propsRef.current.discardTemporaryValue()
|
||||
} else {
|
||||
propsRef.current.permenantlySetValue(value)
|
||||
propsRef.current.permanentlySetValue(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ const BasicNumberInput: React.FC<{
|
|||
if (curState.valueBeforeDragging === value) {
|
||||
propsRef.current.discardTemporaryValue()
|
||||
} else {
|
||||
propsRef.current.permenantlySetValue(value)
|
||||
propsRef.current.permanentlySetValue(value)
|
||||
}
|
||||
stateRef.current = {mode: 'noFocus'}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ const BasicStringInput: React.FC<{
|
|||
value: string
|
||||
temporarilySetValue: (v: string) => void
|
||||
discardTemporaryValue: () => void
|
||||
permenantlySetValue: (v: string) => void
|
||||
permanentlySetValue: (v: string) => void
|
||||
className?: string
|
||||
isValid?: (v: string) => boolean
|
||||
inputRef?: MutableRefObject<HTMLInputElement | null>
|
||||
|
@ -112,7 +112,7 @@ const BasicStringInput: React.FC<{
|
|||
if (curState.valueBeforeEditing === value) {
|
||||
propsRef.current.discardTemporaryValue()
|
||||
} else {
|
||||
propsRef.current.permenantlySetValue(value)
|
||||
propsRef.current.permanentlySetValue(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue