react-native-css 3.0.0-nightly.8dd703d → 3.0.0-nightly.9c84741
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/compiler/compiler.js +12 -5
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +89 -82
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +10 -10
- package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
- package/dist/commonjs/compiler/pseudo-elements.js +49 -0
- package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
- package/dist/commonjs/compiler/selector-builder.js +124 -80
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +18 -6
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +27 -0
- package/dist/commonjs/compiler/supports.js.map +1 -0
- package/dist/commonjs/components/ActivityIndicator.js +22 -0
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
- package/dist/commonjs/components/Button.js +22 -0
- package/dist/commonjs/components/Button.js.map +1 -0
- package/dist/commonjs/components/FlatList.js +19 -0
- package/dist/commonjs/components/FlatList.js.map +1 -0
- package/dist/commonjs/components/Image.js +17 -0
- package/dist/commonjs/components/Image.js.map +1 -0
- package/dist/commonjs/components/Switch.js +17 -0
- package/dist/commonjs/components/Switch.js.map +1 -0
- package/dist/commonjs/components/TextInput.js +17 -0
- package/dist/commonjs/components/TextInput.js.map +1 -0
- package/dist/commonjs/components/index.js +48 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/components/react-native-safe-area-context.js +17 -0
- package/dist/commonjs/components/react-native-safe-area-context.js.map +1 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js +53 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -0
- package/dist/commonjs/jest/index.js +5 -5
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +6 -3
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/injection-code.js +5 -10
- package/dist/commonjs/metro/injection-code.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +18 -8
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/metro/resolver.js +3 -0
- package/dist/commonjs/metro/resolver.js.map +1 -1
- package/dist/commonjs/poison.pill.js +10 -10
- package/dist/commonjs/runtime/native/api.js +8 -2
- package/dist/commonjs/runtime/native/api.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +4 -2
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +14 -11
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +26 -20
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +11 -0
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/calculate-props.js +25 -8
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/calc.js +97 -57
- package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/index.js +22 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js +32 -0
- package/dist/commonjs/runtime/native/styles/functions/numeric-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/string-functions.js +23 -0
- package/dist/commonjs/runtime/native/styles/functions/string-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +91 -53
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/animation.js +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js +14 -4
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +3 -3
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/utils/objects.js +6 -18
- package/dist/commonjs/runtime/utils/objects.js.map +1 -1
- package/dist/commonjs/runtime/web/api.js.map +1 -1
- package/dist/commonjs/style-collection/index.js +110 -0
- package/dist/commonjs/style-collection/index.js.map +1 -0
- package/dist/commonjs/{runtime/native → style-collection}/root.js +2 -2
- package/dist/commonjs/style-collection/root.js.map +1 -0
- package/dist/module/compiler/compiler.js +12 -5
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +89 -82
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +10 -10
- package/dist/module/compiler/inheritance.test.js.map +1 -1
- package/dist/module/compiler/pseudo-elements.js +44 -0
- package/dist/module/compiler/pseudo-elements.js.map +1 -0
- package/dist/module/compiler/selector-builder.js +124 -80
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +18 -6
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +23 -0
- package/dist/module/compiler/supports.js.map +1 -0
- package/dist/module/components/ActivityIndicator.js +17 -0
- package/dist/module/components/ActivityIndicator.js.map +1 -0
- package/dist/module/components/Button.js +17 -0
- package/dist/module/components/Button.js.map +1 -0
- package/dist/module/components/FlatList.js +14 -0
- package/dist/module/components/FlatList.js.map +1 -0
- package/dist/module/components/Image.js +12 -0
- package/dist/module/components/Image.js.map +1 -0
- package/dist/module/components/Switch.js +12 -0
- package/dist/module/components/Switch.js.map +1 -0
- package/dist/module/components/TextInput.js +12 -0
- package/dist/module/components/TextInput.js.map +1 -0
- package/dist/module/components/index.js +6 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/react-native-safe-area-context.js +4 -0
- package/dist/module/components/react-native-safe-area-context.js.map +1 -0
- package/dist/module/components/react-native-safe-area-context.native.js +36 -0
- package/dist/module/components/react-native-safe-area-context.native.js.map +1 -0
- package/dist/module/jest/index.js +2 -2
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +6 -3
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/injection-code.js +5 -10
- package/dist/module/metro/injection-code.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +18 -8
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/resolver.js +3 -0
- package/dist/module/metro/resolver.js.map +1 -1
- package/dist/module/poison.pill.js +10 -10
- package/dist/module/runtime/native/api.js +2 -1
- package/dist/module/runtime/native/api.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +4 -2
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +15 -12
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +24 -19
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +11 -0
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/styles/calculate-props.js +25 -8
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/calc.js +97 -56
- package/dist/module/runtime/native/styles/functions/calc.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/index.js +2 -0
- package/dist/module/runtime/native/styles/functions/index.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/numeric-functions.js +25 -0
- package/dist/module/runtime/native/styles/functions/numeric-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/string-functions.js +18 -0
- package/dist/module/runtime/native/styles/functions/string-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/transform-functions.js +91 -53
- package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/animation.js +1 -1
- package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js +14 -4
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthands/transform.js +1 -1
- package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +1 -1
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/utils/objects.js +6 -18
- package/dist/module/runtime/utils/objects.js.map +1 -1
- package/dist/module/runtime/web/api.js.map +1 -1
- package/dist/module/style-collection/index.js +95 -0
- package/dist/module/style-collection/index.js.map +1 -0
- package/dist/module/{runtime/native → style-collection}/root.js +2 -2
- package/dist/module/style-collection/root.js.map +1 -0
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +11 -13
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +4 -2
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts +4 -0
- package/dist/typescript/commonjs/src/compiler/pseudo-elements.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +1 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +2 -2
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/supports.d.ts +3 -0
- package/dist/typescript/commonjs/src/compiler/supports.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
- package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Switch.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +4 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/jest/index.d.ts +3 -3
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts +4 -7
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/commonjs/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/{runtime/native → style-collection}/root.d.ts +1 -1
- package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/compiler.d.ts +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +11 -13
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +4 -2
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +4 -0
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +1 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +2 -2
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/supports.d.ts +3 -0
- package/dist/typescript/module/src/compiler/supports.d.ts.map +1 -0
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Button.d.ts +13 -0
- package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
- package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Image.d.ts +8 -0
- package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Switch.d.ts +8 -0
- package/dist/typescript/module/src/components/Switch.d.ts.map +1 -0
- package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +6 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts +2 -0
- package/dist/typescript/module/src/components/react-native-safe-area-context.d.ts.map +1 -0
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +4 -0
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -0
- package/dist/typescript/module/src/jest/index.d.ts +3 -3
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/injection-code.d.ts +4 -7
- package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +4 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts +3 -1
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/numeric-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/string-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/style-collection/index.d.ts +14 -0
- package/dist/typescript/module/src/style-collection/index.d.ts.map +1 -0
- package/dist/typescript/module/src/{runtime/native → style-collection}/root.d.ts +1 -1
- package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
- package/package.json +30 -14
- package/src/compiler/compiler.ts +11 -3
- package/src/compiler/compiler.types.ts +11 -14
- package/src/compiler/declarations.ts +157 -121
- package/src/compiler/inheritance.test.ts +9 -9
- package/src/compiler/pseudo-elements.ts +54 -0
- package/src/compiler/selector-builder.ts +136 -81
- package/src/compiler/stylesheet.ts +26 -11
- package/src/compiler/supports.ts +26 -0
- package/src/components/ActivityIndicator.tsx +27 -0
- package/src/components/Button.tsx +22 -0
- package/src/components/FlatList.tsx +21 -0
- package/src/components/Image.tsx +17 -0
- package/src/components/Switch.tsx +17 -0
- package/src/components/TextInput.tsx +17 -0
- package/src/components/index.tsx +6 -0
- package/src/components/react-native-safe-area-context.native.tsx +40 -0
- package/src/components/react-native-safe-area-context.tsx +1 -0
- package/src/jest/index.ts +3 -2
- package/src/metro/index.ts +8 -6
- package/src/metro/injection-code.ts +6 -10
- package/src/metro/metro-transformer.ts +27 -10
- package/src/metro/resolver.ts +8 -0
- package/src/poison.pill.ts +10 -10
- package/src/runtime/native/api.ts +3 -1
- package/src/runtime/native/conditions/index.ts +4 -2
- package/src/runtime/native/conditions/media-query.ts +16 -12
- package/src/runtime/native/react/rules.ts +27 -17
- package/src/runtime/native/reactivity.ts +12 -0
- package/src/runtime/native/styles/calculate-props.ts +27 -6
- package/src/runtime/native/styles/functions/calc.ts +94 -70
- package/src/runtime/native/styles/functions/index.ts +2 -0
- package/src/runtime/native/styles/functions/numeric-functions.ts +38 -0
- package/src/runtime/native/styles/functions/string-functions.ts +22 -0
- package/src/runtime/native/styles/functions/transform-functions.ts +68 -35
- package/src/runtime/native/styles/shorthands/animation.ts +2 -1
- package/src/runtime/native/styles/shorthands/box-shadow.ts +34 -14
- package/src/runtime/native/styles/shorthands/transform.ts +3 -1
- package/src/runtime/native/styles/variables.ts +5 -1
- package/src/runtime/utils/objects.ts +10 -19
- package/src/runtime/web/api.ts +1 -1
- package/src/style-collection/index.ts +142 -0
- package/src/{runtime/native → style-collection}/root.ts +6 -2
- package/dist/commonjs/compiler/attributes.test.js +0 -20
- package/dist/commonjs/compiler/attributes.test.js.map +0 -1
- package/dist/commonjs/doctor/index.js +0 -6
- package/dist/commonjs/doctor/index.js.map +0 -1
- package/dist/commonjs/runtime/native/injection.js +0 -99
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- package/dist/commonjs/runtime/native/root.js.map +0 -1
- package/dist/module/compiler/attributes.test.js +0 -20
- package/dist/module/compiler/attributes.test.js.map +0 -1
- package/dist/module/doctor/index.js +0 -4
- package/dist/module/doctor/index.js.map +0 -1
- package/dist/module/runtime/native/injection.js +0 -94
- package/dist/module/runtime/native/injection.js.map +0 -1
- package/dist/module/runtime/native/root.js.map +0 -1
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +0 -2
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/doctor/index.d.ts +0 -2
- package/dist/typescript/commonjs/src/doctor/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -16
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/attributes.test.d.ts +0 -2
- package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +0 -1
- package/dist/typescript/module/src/doctor/index.d.ts +0 -2
- package/dist/typescript/module/src/doctor/index.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -16
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/root.d.ts.map +0 -1
- package/src/compiler/attributes.test.ts +0 -28
- package/src/doctor/index.ts +0 -1
- package/src/runtime/native/injection.ts +0 -131
package/src/metro/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ import connect from "connect";
|
|
|
6
6
|
import debug from "debug";
|
|
7
7
|
import type { MetroConfig } from "metro-config";
|
|
8
8
|
|
|
9
|
-
import type { CompilerOptions,
|
|
9
|
+
import type { CompilerOptions, ReactNativeCssStyleSheet } from "../compiler";
|
|
10
10
|
import { compile } from "../compiler/compiler";
|
|
11
11
|
import { getNativeInjectionCode, getWebInjectionCode } from "./injection-code";
|
|
12
12
|
import { nativeResolver, webResolver } from "./resolver";
|
|
@@ -53,16 +53,18 @@ export function withReactNativeCSS<
|
|
|
53
53
|
const originalMiddleware = config.server?.enhanceMiddleware;
|
|
54
54
|
const originalResolver = config.resolver?.resolveRequest;
|
|
55
55
|
|
|
56
|
-
const poisonPillPath = "./poison.pill";
|
|
57
|
-
|
|
58
56
|
return {
|
|
59
57
|
...config,
|
|
60
58
|
transformerPath: require.resolve("./metro-transformer"),
|
|
59
|
+
transformer: {
|
|
60
|
+
...config.transformer,
|
|
61
|
+
reactNativeCSS: options,
|
|
62
|
+
},
|
|
61
63
|
resolver: {
|
|
62
64
|
...config.resolver,
|
|
63
65
|
sourceExts: [...(config?.resolver?.sourceExts || []), "css"],
|
|
64
66
|
resolveRequest: (context, moduleName, platform) => {
|
|
65
|
-
if (moduleName
|
|
67
|
+
if (moduleName.includes("poison.pill")) {
|
|
66
68
|
return { type: "empty" };
|
|
67
69
|
}
|
|
68
70
|
|
|
@@ -95,7 +97,7 @@ export function withReactNativeCSS<
|
|
|
95
97
|
|
|
96
98
|
const nativeCSSFiles = new Map<
|
|
97
99
|
string,
|
|
98
|
-
[string,
|
|
100
|
+
[string, ReactNativeCssStyleSheet]
|
|
99
101
|
>();
|
|
100
102
|
const webCSSFiles = new Set<string>();
|
|
101
103
|
|
|
@@ -161,7 +163,7 @@ export function withReactNativeCSS<
|
|
|
161
163
|
// Let the transformer know that we will handle compilation
|
|
162
164
|
customTransformOptions: {
|
|
163
165
|
...transformOptions.customTransformOptions,
|
|
164
|
-
|
|
166
|
+
reactNativeCSS: options,
|
|
165
167
|
},
|
|
166
168
|
},
|
|
167
169
|
fileBuffer,
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This is a hack around
|
|
2
|
+
* This is a hack around Metro's handling of bundles.
|
|
3
3
|
* When a component is inside a lazy() barrier, it is inside a different JS bundle.
|
|
4
4
|
* So when it updates, it only updates its local bundle, not the global one which contains the CSS files.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* This means that the CSS file will not be re-evaluated when a component in a different bundle updates,
|
|
7
|
+
* breaking tools like Tailwind CSS
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* which is included inside react-native-css's runtime.
|
|
11
|
-
*
|
|
12
|
-
* This is why both of these function add imports for the CSS files.
|
|
9
|
+
* To fix this, we force our code to always import the CSS files, so now the CSS files are in every bundle.
|
|
13
10
|
*/
|
|
14
|
-
|
|
15
11
|
export function getWebInjectionCode(filePaths: string[]) {
|
|
16
12
|
const importStatements = filePaths
|
|
17
13
|
.map((filePath) => `import "${filePath}";`)
|
|
@@ -27,12 +23,12 @@ export function getNativeInjectionCode(
|
|
|
27
23
|
const importStatements = cssFilePaths
|
|
28
24
|
.map((filePath) => `import "${filePath}";`)
|
|
29
25
|
.join("\n");
|
|
30
|
-
|
|
26
|
+
|
|
31
27
|
const contents = values
|
|
32
28
|
.map((value) => `StyleCollection.inject(${JSON.stringify(value)});`)
|
|
33
29
|
.join("\n");
|
|
34
30
|
|
|
35
31
|
return Buffer.from(
|
|
36
|
-
|
|
32
|
+
`import { StyleCollection } from "react-native-css/style-collection";\n${importStatements}\n${contents};export {};`,
|
|
37
33
|
);
|
|
38
34
|
}
|
|
@@ -1,31 +1,48 @@
|
|
|
1
|
+
import { unstable_transformerPath } from "@expo/metro-config";
|
|
1
2
|
import type {
|
|
2
3
|
JsTransformerConfig,
|
|
3
4
|
JsTransformOptions,
|
|
4
5
|
TransformResponse,
|
|
5
6
|
} from "metro-transform-worker";
|
|
6
7
|
|
|
8
|
+
import { compile, type CompilerOptions } from "../compiler";
|
|
9
|
+
import { getNativeInjectionCode } from "./injection-code";
|
|
10
|
+
|
|
7
11
|
const worker =
|
|
8
12
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
9
|
-
require(
|
|
13
|
+
require(unstable_transformerPath) as typeof import("metro-transform-worker");
|
|
10
14
|
|
|
11
|
-
export function transform(
|
|
15
|
+
export async function transform(
|
|
12
16
|
config: JsTransformerConfig,
|
|
13
17
|
projectRoot: string,
|
|
14
18
|
filePath: string,
|
|
15
19
|
data: Buffer,
|
|
16
|
-
options: JsTransformOptions
|
|
20
|
+
options: JsTransformOptions & {
|
|
21
|
+
reactNativeCSS?: CompilerOptions | undefined;
|
|
22
|
+
},
|
|
17
23
|
): Promise<TransformResponse> {
|
|
18
24
|
const isCss = options.type !== "asset" && /\.(s?css|sass)$/.test(filePath);
|
|
19
|
-
const skipCompile =
|
|
20
|
-
options.customTransformOptions &&
|
|
21
|
-
"reactNativeCSSCompile" in options.customTransformOptions &&
|
|
22
|
-
options.customTransformOptions.reactNativeCSSCompile === false;
|
|
23
25
|
|
|
24
|
-
if (
|
|
26
|
+
if (options.platform === "web" || !isCss) {
|
|
25
27
|
return worker.transform(config, projectRoot, filePath, data, options);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
const cssFile = (await worker.transform(config, projectRoot, filePath, data, {
|
|
31
|
+
...options,
|
|
32
|
+
platform: "web",
|
|
33
|
+
})) as TransformResponse & {
|
|
34
|
+
output: [{ data: { css: { code: Buffer } } }];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const css = cssFile.output[0].data.css.code.toString();
|
|
38
|
+
|
|
39
|
+
const productionJS = compile(css, {
|
|
40
|
+
...options.reactNativeCSS,
|
|
41
|
+
filename: filePath,
|
|
42
|
+
projectRoot: projectRoot,
|
|
43
|
+
}).stylesheet();
|
|
44
|
+
|
|
45
|
+
data = Buffer.from(getNativeInjectionCode([], [productionJS]));
|
|
29
46
|
|
|
30
|
-
return worker.transform(config, projectRoot, filePath
|
|
47
|
+
return worker.transform(config, projectRoot, `${filePath}.js`, data, options);
|
|
31
48
|
}
|
package/src/metro/resolver.ts
CHANGED
|
@@ -45,6 +45,14 @@ export function nativeResolver(
|
|
|
45
45
|
return resolver(context, `react-native-css/components`, platform);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
if (moduleName === "react-native-safe-area-context") {
|
|
49
|
+
return resolver(
|
|
50
|
+
context,
|
|
51
|
+
`react-native-css/components/react-native-safe-area-context`,
|
|
52
|
+
platform,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
// We only care about `react-native/Library/Components/<module>.js` components
|
|
49
57
|
const segments = resolution.filePath.split(sep);
|
|
50
58
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
package/src/poison.pill.ts
CHANGED
|
@@ -3,9 +3,9 @@ const canWarn = process.env.NODE_ENV !== "test";
|
|
|
3
3
|
if (canWarn) {
|
|
4
4
|
throw new Error(`react-native-css has encountered a setup error.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
┌───────┐
|
|
7
|
+
│ Metro │
|
|
8
|
+
└───────┘
|
|
9
9
|
|
|
10
10
|
Either your metro.config.js is missing the 'withReactNativeCSS' wrapper OR
|
|
11
11
|
the resolver.resolveRequest function of your config is being overridden, and not calling the parent resolver.
|
|
@@ -19,15 +19,15 @@ module.exports = with3rdPartyPlugin(
|
|
|
19
19
|
)
|
|
20
20
|
\`\`\`
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
┌────────────┐
|
|
23
|
+
│ NativeWind │
|
|
24
|
+
└────────────┘
|
|
25
25
|
|
|
26
|
-
If you are using NativeWind
|
|
26
|
+
If you are using NativeWind follow the Metro instructions above but use 'withNativeWind' instead of 'withReactNativeCSS'.
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
┌────────────────┐
|
|
29
|
+
│ Other bundlers │
|
|
30
|
+
└────────────────┘
|
|
31
31
|
|
|
32
32
|
If you are using another bundler (Vite, Webpack, etc), or non-Metro framework (Next.js, Remix, etc), please ensure you have included 'react-native-css/babel' as a babel preset.
|
|
33
33
|
`);
|
|
@@ -21,7 +21,9 @@ import {
|
|
|
21
21
|
} from "./reactivity";
|
|
22
22
|
import { resolveValue } from "./styles/resolve";
|
|
23
23
|
|
|
24
|
-
export { StyleCollection } from "
|
|
24
|
+
export { StyleCollection } from "react-native-css/style-collection";
|
|
25
|
+
|
|
26
|
+
export { useNativeCss };
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* Generates a new Higher-Order component the wraps the base component and applies the styles.
|
|
@@ -39,10 +39,12 @@ export function testRule(
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
function pseudoClasses(query: PseudoClassesQuery, get: Getter) {
|
|
42
|
-
|
|
42
|
+
// IMPORTANT: active needs: to be first. Modifies a global value
|
|
43
|
+
// that we use to determine if the component should be a pressable
|
|
44
|
+
if (query.a && !get(activeFamily(get))) {
|
|
43
45
|
return false;
|
|
44
46
|
}
|
|
45
|
-
if (query.
|
|
47
|
+
if (query.h && !get(hoverFamily(get))) {
|
|
46
48
|
return false;
|
|
47
49
|
}
|
|
48
50
|
if (query.f && !get(focusFamily(get))) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import { PixelRatio, Platform } from "react-native";
|
|
2
|
+
import { I18nManager, PixelRatio, Platform } from "react-native";
|
|
3
3
|
|
|
4
4
|
import type { MediaCondition } from "../../../compiler";
|
|
5
5
|
import { colorScheme, vh, vw, type Getter } from "../reactivity";
|
|
@@ -34,35 +34,39 @@ function test(mediaQuery: MediaCondition, get: Getter): Boolean {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function testComparison(mediaQuery: MediaCondition, get: Getter): Boolean {
|
|
37
|
-
|
|
38
|
-
const right = mediaQuery[2];
|
|
37
|
+
const value = mediaQuery[2];
|
|
39
38
|
|
|
40
39
|
switch (mediaQuery[1]) {
|
|
40
|
+
case "dir":
|
|
41
|
+
return (I18nManager.isRTL && value === "rtl") || value === "ltr";
|
|
41
42
|
case "hover":
|
|
42
43
|
return true;
|
|
43
44
|
case "platform":
|
|
44
|
-
return
|
|
45
|
+
return value === "native" || value === Platform.OS;
|
|
45
46
|
case "prefers-color-scheme": {
|
|
46
|
-
return
|
|
47
|
+
return value === get(colorScheme);
|
|
47
48
|
}
|
|
48
49
|
case "display-mode":
|
|
49
|
-
return
|
|
50
|
+
return value === "native" || Platform.OS === value;
|
|
50
51
|
case "min-width":
|
|
51
|
-
return typeof
|
|
52
|
+
return typeof value === "number" && get(vw) >= value;
|
|
52
53
|
case "max-width":
|
|
53
|
-
return typeof
|
|
54
|
+
return typeof value === "number" && get(vw) <= value;
|
|
54
55
|
case "min-height":
|
|
55
|
-
return typeof
|
|
56
|
+
return typeof value === "number" && get(vh) >= value;
|
|
56
57
|
case "max-height":
|
|
57
|
-
return typeof
|
|
58
|
+
return typeof value === "number" && get(vh) <= value;
|
|
58
59
|
case "orientation":
|
|
59
|
-
return
|
|
60
|
+
return value === "landscape" ? get(vh) < get(vw) : get(vh) >= get(vw);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
if (typeof
|
|
63
|
+
if (typeof value !== "number") {
|
|
63
64
|
return false;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
let left: number | undefined;
|
|
68
|
+
const right = value;
|
|
69
|
+
|
|
66
70
|
switch (mediaQuery[1]) {
|
|
67
71
|
case "width":
|
|
68
72
|
left = get(vw);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
+
import { StyleCollection } from "react-native-css/style-collection";
|
|
3
|
+
|
|
2
4
|
import type { InlineVariable, StyleRule } from "../../../compiler";
|
|
3
5
|
import { getDeepPath } from "../../utils";
|
|
4
6
|
import { testRule } from "../conditions";
|
|
5
7
|
import { DEFAULT_CONTAINER_NAME } from "../conditions/container-query";
|
|
6
8
|
import type { RenderGuard } from "../conditions/guards";
|
|
7
|
-
import { StyleCollection } from "../injection";
|
|
8
9
|
import {
|
|
9
10
|
activeFamily,
|
|
10
11
|
containerLayoutFamily,
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
hoverFamily,
|
|
13
14
|
VAR_SYMBOL,
|
|
14
15
|
weakFamily,
|
|
16
|
+
type ContainerContextValue,
|
|
15
17
|
type VariableContextValue,
|
|
16
18
|
} from "../reactivity";
|
|
17
19
|
import { stylesFamily } from "../styles";
|
|
@@ -36,11 +38,12 @@ export function updateRules(
|
|
|
36
38
|
|
|
37
39
|
let usesVariables = false;
|
|
38
40
|
|
|
39
|
-
let variables
|
|
40
|
-
let containers
|
|
41
|
+
let variables: VariableContextValue | undefined;
|
|
42
|
+
let containers: ContainerContextValue | undefined;
|
|
41
43
|
const inlineVariables = new Set<InlineVariable>();
|
|
42
44
|
|
|
43
45
|
let animated = false;
|
|
46
|
+
let pressable = false;
|
|
44
47
|
|
|
45
48
|
for (const config of state.configs) {
|
|
46
49
|
const source = currentProps?.[config.source];
|
|
@@ -68,6 +71,11 @@ export function updateRules(
|
|
|
68
71
|
if (target) {
|
|
69
72
|
if (Array.isArray(target)) {
|
|
70
73
|
for (const item of target) {
|
|
74
|
+
// undefined or falsy is allowed in the style array
|
|
75
|
+
if (!item) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
|
|
71
79
|
if (VAR_SYMBOL in item) {
|
|
72
80
|
inlineVariables.add(item);
|
|
73
81
|
} else if (
|
|
@@ -93,13 +101,20 @@ export function updateRules(
|
|
|
93
101
|
}
|
|
94
102
|
|
|
95
103
|
for (let rule of styleRuleSet) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if
|
|
99
|
-
|
|
104
|
+
usesVariables ||= Boolean(rule.dv);
|
|
105
|
+
|
|
106
|
+
// We do this even if the rule doesn't match so we can maintain a consistent render tree
|
|
107
|
+
// We we need to inject React context
|
|
100
108
|
if (rule.a) animated = true;
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
if (rule.v) {
|
|
111
|
+
variables ??= inheritedVariables;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (rule.c) {
|
|
115
|
+
containers ??= inheritedContainers;
|
|
116
|
+
activeFamily(state.ruleEffectGetter);
|
|
117
|
+
}
|
|
103
118
|
|
|
104
119
|
if (
|
|
105
120
|
!testRule(
|
|
@@ -114,11 +129,8 @@ export function updateRules(
|
|
|
114
129
|
}
|
|
115
130
|
|
|
116
131
|
if (rule.v) {
|
|
117
|
-
// We're going to set a value, so we need to create a new object
|
|
118
132
|
if (variables === inheritedVariables) {
|
|
119
133
|
variables = { ...inheritedVariables };
|
|
120
|
-
} else {
|
|
121
|
-
variables ??= { ...inheritedVariables };
|
|
122
134
|
}
|
|
123
135
|
|
|
124
136
|
for (const v of rule.v) {
|
|
@@ -163,7 +175,7 @@ export function updateRules(
|
|
|
163
175
|
|
|
164
176
|
if (process.env.NODE_ENV !== "production") {
|
|
165
177
|
if (isRerender) {
|
|
166
|
-
|
|
178
|
+
const pressable = activeFamily.has(state.ruleEffectGetter);
|
|
167
179
|
|
|
168
180
|
if (Boolean(variables) !== Boolean(state.variables)) {
|
|
169
181
|
console.log(
|
|
@@ -186,11 +198,7 @@ export function updateRules(
|
|
|
186
198
|
}
|
|
187
199
|
}
|
|
188
200
|
|
|
189
|
-
|
|
190
|
-
let pressable =
|
|
191
|
-
process.env.NODE_ENV === "production"
|
|
192
|
-
? undefined
|
|
193
|
-
: activeFamily.has(state.ruleEffectGetter);
|
|
201
|
+
pressable = activeFamily.has(state.ruleEffectGetter);
|
|
194
202
|
|
|
195
203
|
if (!rules.size && !state.stylesObs && !inlineVariables.size) {
|
|
196
204
|
return {
|
|
@@ -199,6 +207,8 @@ export function updateRules(
|
|
|
199
207
|
guards,
|
|
200
208
|
animated,
|
|
201
209
|
pressable,
|
|
210
|
+
variables,
|
|
211
|
+
containers,
|
|
202
212
|
};
|
|
203
213
|
}
|
|
204
214
|
|
|
@@ -209,6 +209,18 @@ export const vh = observable<number>(
|
|
|
209
209
|
(read, value) => value ?? read(dimensions)?.height,
|
|
210
210
|
);
|
|
211
211
|
|
|
212
|
+
Dimensions.addEventListener("change", ({ window }) => {
|
|
213
|
+
observableBatch.current = new Set();
|
|
214
|
+
vw.set(window.width);
|
|
215
|
+
vh.set(window.height);
|
|
216
|
+
|
|
217
|
+
for (const effect of observableBatch.current) {
|
|
218
|
+
effect.run();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
observableBatch.current = undefined;
|
|
222
|
+
});
|
|
223
|
+
|
|
212
224
|
/** Color Scheme **************************************************************/
|
|
213
225
|
|
|
214
226
|
export const colorScheme = observable<ColorSchemeName>(
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type Getter,
|
|
12
12
|
type VariableContextValue,
|
|
13
13
|
} from "../reactivity";
|
|
14
|
+
import { transformKeys } from "./defaults";
|
|
14
15
|
import { resolveValue } from "./resolve";
|
|
15
16
|
|
|
16
17
|
export function calculateProps(
|
|
@@ -28,6 +29,7 @@ export function calculateProps(
|
|
|
28
29
|
let important: Record<string, any> | undefined;
|
|
29
30
|
|
|
30
31
|
const delayedStyles: (() => void)[] = [];
|
|
32
|
+
const transformStyles: (() => void)[] = [];
|
|
31
33
|
|
|
32
34
|
for (const rule of rules) {
|
|
33
35
|
if (VAR_SYMBOL in rule) {
|
|
@@ -67,6 +69,7 @@ export function calculateProps(
|
|
|
67
69
|
inlineVariables,
|
|
68
70
|
inheritedVariables,
|
|
69
71
|
delayedStyles,
|
|
72
|
+
transformStyles,
|
|
70
73
|
guards,
|
|
71
74
|
target,
|
|
72
75
|
topLevelTarget,
|
|
@@ -78,6 +81,10 @@ export function calculateProps(
|
|
|
78
81
|
delayedStyle();
|
|
79
82
|
}
|
|
80
83
|
|
|
84
|
+
for (const transformStyle of transformStyles) {
|
|
85
|
+
transformStyle();
|
|
86
|
+
}
|
|
87
|
+
|
|
81
88
|
return {
|
|
82
89
|
normal,
|
|
83
90
|
guards,
|
|
@@ -91,6 +98,7 @@ export function applyDeclarations(
|
|
|
91
98
|
inlineVariables: InlineVariable,
|
|
92
99
|
inheritedVariables: VariableContextValue,
|
|
93
100
|
delayedStyles: (() => void)[] = [],
|
|
101
|
+
transformStyles: (() => void)[] = [],
|
|
94
102
|
guards: RenderGuard[] = [],
|
|
95
103
|
target: Record<string, any> = {},
|
|
96
104
|
topLevelTarget = target,
|
|
@@ -136,7 +144,7 @@ export function applyDeclarations(
|
|
|
136
144
|
|
|
137
145
|
const shouldDelay = declaration[2];
|
|
138
146
|
|
|
139
|
-
if (shouldDelay) {
|
|
147
|
+
if (shouldDelay || transformKeys.has(prop)) {
|
|
140
148
|
/**
|
|
141
149
|
* We need to delay the resolution of this value until after all
|
|
142
150
|
* styles have been calculated. But another style might override
|
|
@@ -149,9 +157,9 @@ export function applyDeclarations(
|
|
|
149
157
|
const originalValue = value;
|
|
150
158
|
// This needs to be a object with the [prop] so we can discover in transform arrays
|
|
151
159
|
value = { [prop]: true };
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
160
|
+
|
|
161
|
+
if (transformKeys.has(prop)) {
|
|
162
|
+
transformStyles.push(() => {
|
|
155
163
|
value = resolveValue(originalValue, get, {
|
|
156
164
|
inlineVariables,
|
|
157
165
|
inheritedVariables,
|
|
@@ -159,8 +167,21 @@ export function applyDeclarations(
|
|
|
159
167
|
calculateProps,
|
|
160
168
|
});
|
|
161
169
|
applyValue(target, prop, value);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
170
|
+
});
|
|
171
|
+
} else {
|
|
172
|
+
delayedStyles.push(() => {
|
|
173
|
+
if (getDeepPath(target, prop) === value) {
|
|
174
|
+
delete target[prop];
|
|
175
|
+
value = resolveValue(originalValue, get, {
|
|
176
|
+
inlineVariables,
|
|
177
|
+
inheritedVariables,
|
|
178
|
+
renderGuards: guards,
|
|
179
|
+
calculateProps,
|
|
180
|
+
});
|
|
181
|
+
applyValue(target, prop, value);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
164
185
|
} else {
|
|
165
186
|
value = resolveValue(value, get, {
|
|
166
187
|
inlineVariables,
|