Fix typo to permanentlySetValue

This commit is contained in:
Cole Lawrence 2022-04-20 11:32:22 -04:00
parent 0ccb9b2386
commit 7c098c4655
11 changed files with 20 additions and 20 deletions

View file

@ -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],
)

View file

@ -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}
/>

View file

@ -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>

View file

@ -20,7 +20,7 @@ const StringLiteralPropEditor: React.FC<{
const onChange = useCallback(
(val: string) => {
stuff.permenantlySetValue(val)
stuff.permanentlySetValue(val)
},
[propConfig, pointerToProp, obj],
)

View file

@ -22,7 +22,7 @@ const StringPropEditor: React.FC<{
value={stuff.value}
temporarilySetValue={stuff.temporarilySetValue}
discardTemporaryValue={stuff.discardTemporaryValue}
permenantlySetValue={stuff.permenantlySetValue}
permanentlySetValue={stuff.permanentlySetValue}
/>
</SingleRowPropEditor>
)

View file

@ -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)

View file

@ -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

View file

@ -57,7 +57,7 @@ const LengthEditorPopover: React.FC<{
tempTransaction = undefined
}
},
permenantlySetValue(newLength: number): void {
permanentlySetValue(newLength: number): void {
if (tempTransaction) {
tempTransaction.discard()
tempTransaction = undefined

View file

@ -55,7 +55,7 @@ const PlayheadPositionPopover: React.FC<{
sequence.position = originalPosition
}
},
permenantlySetValue(newPosition: number): void {
permanentlySetValue(newPosition: number): void {
if (tempPosition) {
tempPosition = undefined
}

View file

@ -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'}
}

View file

@ -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)
}
}
}