@@ -2,6 +2,7 @@ import { CSSParseRun } from './CSSParseRun';
22import { MixedStyleDeclaration } from './CSSProcessor' ;
33import { CSSPropertiesValidationRegistry } from './CSSPropertiesValidationRegistry' ;
44import { lookupRecord } from './helpers' ;
5+ import { ValidatorsType } from './makepropertiesValidators' ;
56import {
67 ExtraNativeTextStyle ,
78 NativeDirectionalStyleKeys ,
@@ -42,7 +43,15 @@ const extraLongViewStyles: Record<ExtraNativeLongViewStyleKeys, 'block'> = {
4243 shadowRadius : 'block' ,
4344 tintColor : 'block' ,
4445 transformMatrix : 'block' ,
45- translateX : 'block'
46+ gap : 'block' ,
47+ inset : 'block' ,
48+ insetBlock : 'block' ,
49+ insetInline : 'block' ,
50+ paddingBlock : 'block' ,
51+ paddingInline : 'block' ,
52+ marginBlock : 'block' ,
53+ marginInline : 'block' ,
54+ objectFit : 'block'
4655} ;
4756
4857const extraTextStyles : Record < keyof ExtraNativeTextStyle , 'text' > = {
@@ -72,16 +81,16 @@ export class CSSNativeParseRun extends CSSParseRun {
7281
7382 private fillProp < K extends keyof MixedStyleDeclaration > (
7483 key : K ,
75- value : any
84+ value : MixedStyleDeclaration [ K ]
7685 ) : void {
7786 const validator = this . validationMap . getValidatorForProperty (
78- String ( key )
79- ) as any ;
87+ String ( key ) as keyof ValidatorsType
88+ ) ;
8089 if ( validator && 'normalizeNativeValue' in validator ) {
8190 const normalizedValue = validator . normalizeNativeValue ( value ) ;
8291 if ( normalizedValue instanceof ShortMergeRequest ) {
8392 normalizedValue . forEach ( ( [ innerKey , innerValue ] ) => {
84- this . fillProp ( innerKey as any , innerValue ) ;
93+ this . fillProp ( innerKey , innerValue ) ;
8594 } ) ;
8695 } else {
8796 // assume longhand merge
@@ -112,10 +121,8 @@ export class CSSNativeParseRun extends CSSParseRun {
112121
113122 protected fillProcessedProps ( ) : void {
114123 const declaration = this . declaration ;
115- for ( const key of Object . keys ( declaration ) as Array <
116- keyof MixedStyleDeclaration
117- > ) {
118- this . fillProp ( key , this . declaration [ key ] ) ;
124+ for ( const [ key , value ] of Object . entries ( declaration ) ) {
125+ this . fillProp ( key as keyof MixedStyleDeclaration , value ) ;
119126 }
120127 }
121128}
0 commit comments