Rename NonCompound to Simple

https://github.com/theatre-js/theatre/pull/118#discussion_r846633461
This commit is contained in:
Aria Minaei 2022-04-10 20:51:45 +02:00
parent a5cf72cd57
commit c1cd25b906
6 changed files with 16 additions and 16 deletions

View file

@ -701,7 +701,7 @@ type DeepPartialCompound<Props extends IValidCompoundProps> = {
}
type DeepPartial<Conf extends PropTypeConfig> =
Conf extends PropTypeConfig_AllNonCompounds
Conf extends PropTypeConfig_AllSimples
? Conf['valueType']
: Conf extends PropTypeConfig_Compound<infer T>
? DeepPartialCompound<T>
@ -721,7 +721,7 @@ export interface PropTypeConfig_Enum extends IBasePropType<'enum', {}> {
defaultCase: string
}
export type PropTypeConfig_AllNonCompounds =
export type PropTypeConfig_AllSimples =
| PropTypeConfig_Number
| PropTypeConfig_Boolean
| PropTypeConfig_String
@ -729,6 +729,6 @@ export type PropTypeConfig_AllNonCompounds =
| PropTypeConfig_Rgba
export type PropTypeConfig =
| PropTypeConfig_AllNonCompounds
| PropTypeConfig_AllSimples
| PropTypeConfig_Compound<$IntentionalAny>
| PropTypeConfig_Enum

View file

@ -1,7 +1,7 @@
import type {
IBasePropType,
PropTypeConfig,
PropTypeConfig_AllNonCompounds,
PropTypeConfig_AllSimples,
PropTypeConfig_Compound,
PropTypeConfig_Enum,
} from '@theatre/core/propTypes'
@ -37,7 +37,7 @@ export function getPropConfigByPath(
* @returns value if it matches the prop's type
* otherwise returns the default value for the prop
*/
export function valueInProp<PropConfig extends PropTypeConfig_AllNonCompounds>(
export function valueInProp<PropConfig extends PropTypeConfig_AllSimples>(
value: unknown,
propConfig: PropConfig,
): PropConfig extends IBasePropType<$IntentionalAny, $IntentionalAny, infer T>

View file

@ -9,7 +9,7 @@ import type {SequenceTrackId} from '@theatre/shared/utils/ids'
import {getPointerParts} from '@theatre/dataverse'
import type {
PropTypeConfig,
PropTypeConfig_AllNonCompounds,
PropTypeConfig_AllSimples,
PropTypeConfig_Compound,
} from '@theatre/core/propTypes'
import type {PathToProp} from '@theatre/shared/src/utils/addresses'
@ -54,7 +54,7 @@ function forEachDeepSimplePropOfCompoundProp(
propType: PropTypeConfig_Compound<$IntentionalAny>,
path: Array<string | number>,
callback: (
propType: PropTypeConfig_AllNonCompounds,
propType: PropTypeConfig_AllSimples,
path: Array<string | number>,
) => void,
) {
@ -105,7 +105,7 @@ export default function createTransactionPrivateApi(
const setStaticOrKeyframeProp = <T>(
value: T,
propConfig: PropTypeConfig_AllNonCompounds,
propConfig: PropTypeConfig_AllSimples,
path: PathToProp,
) => {
if (value === undefined || value === null) {

View file

@ -16,7 +16,7 @@ import {
isPropConfigComposite,
valueInProp,
} from '@theatre/shared/propTypes/utils'
import type {PropTypeConfig_AllNonCompounds} from '@theatre/core/propTypes'
import type {PropTypeConfig_AllSimples} from '@theatre/core/propTypes'
export type ExtremumSpace = {
fromValueSpace: (v: number) => number
@ -37,7 +37,7 @@ const BasicKeyframedTrack: React.FC<{
const propConfig = getPropConfigByPath(
sheetObject.template.config,
pathToProp,
)! as PropTypeConfig_AllNonCompounds
)! as PropTypeConfig_AllSimples
if (isPropConfigComposite(propConfig)) {
console.error(`Composite prop types cannot be keyframed`)
@ -127,7 +127,7 @@ type Extremums = [min: number, max: number]
function calculateScalarExtremums(
keyframes: Keyframe[],
propConfig: PropTypeConfig_AllNonCompounds,
propConfig: PropTypeConfig_AllSimples,
): Extremums {
let min = Infinity,
max = -Infinity

View file

@ -15,7 +15,7 @@ import CurveHandle from './CurveHandle'
import GraphEditorDotScalar from './GraphEditorDotScalar'
import GraphEditorDotNonScalar from './GraphEditorDotNonScalar'
import GraphEditorNonScalarDash from './GraphEditorNonScalarDash'
import type {PropTypeConfig_AllNonCompounds} from '@theatre/core/propTypes'
import type {PropTypeConfig_AllSimples} from '@theatre/core/propTypes'
const Container = styled.g`
/* position: absolute; */
@ -33,7 +33,7 @@ const KeyframeEditor: React.FC<{
extremumSpace: ExtremumSpace
isScalar: boolean
color: keyof typeof graphEditorColors
propConfig: PropTypeConfig_AllNonCompounds
propConfig: PropTypeConfig_AllSimples
}> = (props) => {
const {index, trackData, isScalar} = props
const cur = trackData.keyframes[index]

View file

@ -1,7 +1,7 @@
import type {} from '@theatre/core/projects/store/types/SheetState_Historic'
import type {
PropTypeConfig,
PropTypeConfig_AllNonCompounds,
PropTypeConfig_AllSimples,
PropTypeConfig_Compound,
} from '@theatre/core/propTypes'
import type SheetObject from '@theatre/core/sheetObjects/SheetObject'
@ -53,7 +53,7 @@ export type SequenceEditorTree_PrimitiveProp =
sheetObject: SheetObject
pathToProp: PathToProp
trackId: SequenceTrackId
propConf: PropTypeConfig_AllNonCompounds
propConf: PropTypeConfig_AllSimples
}
export type SequenceEditorTree_AllRowTypes =
@ -231,7 +231,7 @@ export const calculateSequenceEditorTree = (
sheetObject: SheetObject,
trackId: SequenceTrackId,
pathToProp: PathToProp,
propConf: PropTypeConfig_AllNonCompounds,
propConf: PropTypeConfig_AllSimples,
arrayOfChildren: Array<
SequenceEditorTree_PrimitiveProp | SequenceEditorTree_PropWithChildren
>,