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