react-native-css 3.0.0-nightly.26b272f → 3.0.0-nightly.46bc0ab
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/atRules.js +15 -2
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +103 -80
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/keyframes.js +1 -1
- package/dist/commonjs/compiler/keyframes.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +14 -8
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- 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/TextInput.js +17 -0
- package/dist/commonjs/components/TextInput.js.map +1 -0
- package/dist/commonjs/components/index.js +40 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/jest/index.js +21 -14
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +2 -0
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/injection.js +19 -18
- package/dist/commonjs/runtime/native/injection.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +13 -8
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/react/useNativeCss.js +2 -2
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reanimated.js +17 -0
- package/dist/commonjs/runtime/native/reanimated.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js +5 -2
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/defaults.js +1 -1
- package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
- package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
- package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{filters.js → functions/filters.js} +3 -3
- package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js +61 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +3 -3
- package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +83 -0
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/resolve.js +21 -44
- package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
- package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{animation.js → shorthands/animation.js} +5 -36
- package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{border.js → shorthands/border.js} +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +3 -3
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
- package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/units.js +1 -1
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/utils/objects.js +14 -6
- package/dist/commonjs/runtime/utils/objects.js.map +1 -1
- package/dist/module/compiler/atRules.js +15 -2
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +100 -77
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/keyframes.js +1 -1
- package/dist/module/compiler/keyframes.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +14 -8
- package/dist/module/compiler/stylesheet.js.map +1 -1
- 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/TextInput.js +12 -0
- package/dist/module/components/TextInput.js.map +1 -0
- package/dist/module/components/index.js +5 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/jest/index.js +20 -14
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +2 -0
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/injection.js +19 -18
- package/dist/module/runtime/native/injection.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +13 -8
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reanimated.js +13 -0
- package/dist/module/runtime/native/reanimated.js.map +1 -0
- package/dist/module/runtime/native/styles/calculate-props.js +6 -3
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/defaults.js +1 -1
- package/dist/module/runtime/native/styles/defaults.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
- package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
- package/dist/module/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
- package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
- package/dist/module/runtime/native/styles/{filters.js → functions/filters.js} +2 -2
- package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/index.js +8 -0
- package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
- package/dist/module/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +1 -1
- package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/transform-functions.js +76 -0
- package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/resolve.js +20 -44
- package/dist/module/runtime/native/styles/resolve.js.map +1 -1
- package/dist/module/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
- package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
- package/dist/module/runtime/native/styles/{animation.js → shorthands/animation.js} +3 -34
- package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
- package/dist/module/runtime/native/styles/{border.js → shorthands/border.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
- package/dist/module/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +2 -2
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
- package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
- package/dist/module/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/module/runtime/native/styles/units.js +1 -1
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/utils/objects.js +14 -6
- package/dist/module/runtime/utils/objects.js.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +1 -3
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +9 -9
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- 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/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 +5 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +11 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.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/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/reanimated.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +1 -3
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +9 -9
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- 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/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 +5 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +11 -1
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/injection.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/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reanimated.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/reanimated.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
- package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
- package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/compiler/atRules.ts +16 -2
- package/src/compiler/compiler.types.ts +1 -3
- package/src/compiler/declarations.ts +182 -95
- package/src/compiler/keyframes.ts +1 -1
- package/src/compiler/stylesheet.ts +17 -7
- 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/TextInput.tsx +17 -0
- package/src/components/index.tsx +5 -0
- package/src/jest/index.ts +22 -13
- package/src/runtime/native/conditions/media-query.ts +2 -0
- package/src/runtime/native/injection.ts +31 -30
- package/src/runtime/native/react/rules.ts +14 -5
- package/src/runtime/native/react/useNativeCss.ts +1 -1
- package/src/runtime/native/reanimated.ts +22 -0
- package/src/runtime/native/styles/calculate-props.ts +4 -3
- package/src/runtime/native/styles/defaults.ts +1 -0
- package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
- package/src/runtime/native/styles/{calc.ts → functions/calc.ts} +2 -2
- package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
- package/src/runtime/native/styles/functions/index.ts +5 -0
- package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
- package/src/runtime/native/styles/functions/transform-functions.ts +51 -0
- package/src/runtime/native/styles/resolve.ts +20 -63
- package/src/runtime/native/styles/{shorthand.ts → shorthands/_handler.ts} +5 -5
- package/src/runtime/native/styles/{animation.ts → shorthands/animation.ts} +4 -63
- package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
- package/src/runtime/native/styles/{box-shadow.ts → shorthands/box-shadow.ts} +3 -3
- package/src/runtime/native/styles/shorthands/index.ts +5 -0
- package/src/runtime/native/styles/{text-shadow.ts → shorthands/text-shadow.ts} +1 -1
- package/src/runtime/native/styles/{transform.ts → shorthands/transform.ts} +1 -1
- package/src/runtime/native/styles/units.ts +1 -1
- package/src/runtime/utils/objects.ts +14 -4
- package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
- package/dist/module/runtime/native/styles/animation.js.map +0 -1
- package/dist/module/runtime/native/styles/border.js.map +0 -1
- package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/calc.js.map +0 -1
- package/dist/module/runtime/native/styles/filters.js.map +0 -1
- package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/transform.js.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
- /package/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
- /package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
|
@@ -62,12 +62,16 @@ const propertyRename: Record<string, string> = {
|
|
|
62
62
|
"background-image": "experimental_backgroundImage",
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
// TODO: We need a better way to handle this
|
|
65
66
|
const unparsedRuntimeParsing = new Set([
|
|
66
67
|
"animation",
|
|
68
|
+
"border",
|
|
69
|
+
"box-shadow",
|
|
67
70
|
"text-shadow",
|
|
68
71
|
"transform",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
72
|
+
"scale",
|
|
73
|
+
"rotate",
|
|
74
|
+
"translate",
|
|
71
75
|
]);
|
|
72
76
|
|
|
73
77
|
const parsers: {
|
|
@@ -142,7 +146,7 @@ const parsers: {
|
|
|
142
146
|
"border-width": parseBorderWidth,
|
|
143
147
|
"bottom": parseSizeDeclaration,
|
|
144
148
|
"box-shadow": parseBoxShadow,
|
|
145
|
-
"caret-color":
|
|
149
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
146
150
|
"color": parseFontColorDeclaration,
|
|
147
151
|
"column-gap": parseGap,
|
|
148
152
|
"container": parseContainer,
|
|
@@ -263,9 +267,9 @@ export function parseDeclaration(
|
|
|
263
267
|
}
|
|
264
268
|
|
|
265
269
|
if (declaration.property === "unparsed") {
|
|
266
|
-
|
|
270
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
267
271
|
} else if (declaration.property === "custom") {
|
|
268
|
-
|
|
272
|
+
parseCustomDeclaration(declaration, builder);
|
|
269
273
|
} else {
|
|
270
274
|
parseWithParser(declaration, builder);
|
|
271
275
|
}
|
|
@@ -666,22 +670,22 @@ function parseTransform(
|
|
|
666
670
|
) {
|
|
667
671
|
builder.addDescriptor("transform", [
|
|
668
672
|
{},
|
|
669
|
-
"
|
|
673
|
+
"transform",
|
|
670
674
|
value.flatMap((t): StyleDescriptor[] => {
|
|
671
675
|
switch (t.type) {
|
|
672
676
|
case "perspective":
|
|
673
|
-
return [[{}, "
|
|
677
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
674
678
|
case "translate":
|
|
675
679
|
return [
|
|
676
680
|
[
|
|
677
681
|
{},
|
|
678
|
-
"
|
|
682
|
+
"translateX",
|
|
679
683
|
parseLengthOrCoercePercentageToRuntime(t.value[0], builder),
|
|
680
684
|
],
|
|
681
685
|
[
|
|
682
686
|
[
|
|
683
687
|
{},
|
|
684
|
-
"
|
|
688
|
+
"translateY",
|
|
685
689
|
parseLengthOrCoercePercentageToRuntime(t.value[1], builder),
|
|
686
690
|
],
|
|
687
691
|
],
|
|
@@ -690,7 +694,7 @@ function parseTransform(
|
|
|
690
694
|
return [
|
|
691
695
|
[
|
|
692
696
|
{},
|
|
693
|
-
"
|
|
697
|
+
"translateX",
|
|
694
698
|
parseLengthOrCoercePercentageToRuntime(t.value, builder),
|
|
695
699
|
],
|
|
696
700
|
];
|
|
@@ -698,22 +702,22 @@ function parseTransform(
|
|
|
698
702
|
return [
|
|
699
703
|
[
|
|
700
704
|
{},
|
|
701
|
-
"
|
|
705
|
+
"translateY",
|
|
702
706
|
parseLengthOrCoercePercentageToRuntime(t.value, builder),
|
|
703
707
|
],
|
|
704
708
|
];
|
|
705
709
|
case "rotate":
|
|
706
|
-
return [[{}, "
|
|
710
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
707
711
|
case "rotateX":
|
|
708
|
-
return [[{}, "
|
|
712
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
709
713
|
case "rotateY":
|
|
710
|
-
return [[{}, "
|
|
714
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
711
715
|
case "rotateZ":
|
|
712
|
-
return [[{}, "
|
|
716
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
713
717
|
case "scale":
|
|
714
718
|
return [
|
|
715
|
-
[{}, "
|
|
716
|
-
[{}, "
|
|
719
|
+
[{}, "scaleX", parseLength(t.value[0], builder)],
|
|
720
|
+
[{}, "scaleY", parseLength(t.value[1], builder)],
|
|
717
721
|
];
|
|
718
722
|
case "scaleX":
|
|
719
723
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
@@ -762,21 +766,29 @@ function parseRotate(
|
|
|
762
766
|
{ value }: DeclarationType<"rotate">,
|
|
763
767
|
builder: StylesheetBuilder,
|
|
764
768
|
) {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
769
|
+
if (value.x) {
|
|
770
|
+
builder.addDescriptor("rotateX", [
|
|
771
|
+
{},
|
|
772
|
+
"rotateX",
|
|
773
|
+
parseAngle(value.angle, builder),
|
|
774
|
+
]);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
if (value.y) {
|
|
778
|
+
builder.addDescriptor("rotateY", [
|
|
779
|
+
{},
|
|
780
|
+
"rotateY",
|
|
781
|
+
parseAngle(value.angle, builder),
|
|
782
|
+
]);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
if (value.z) {
|
|
786
|
+
builder.addDescriptor("rotateZ", [
|
|
787
|
+
{},
|
|
788
|
+
"rotateZ",
|
|
789
|
+
parseAngle(value.angle, builder),
|
|
790
|
+
]);
|
|
791
|
+
}
|
|
780
792
|
}
|
|
781
793
|
|
|
782
794
|
function parseScale(
|
|
@@ -853,7 +865,11 @@ function parseZIndex(
|
|
|
853
865
|
}
|
|
854
866
|
}
|
|
855
867
|
|
|
856
|
-
function parseContainerType(
|
|
868
|
+
function parseContainerType(
|
|
869
|
+
_declaration: DeclarationType<"container-type">,
|
|
870
|
+
builder: StylesheetBuilder,
|
|
871
|
+
) {
|
|
872
|
+
builder.addContainer(["___default___"]);
|
|
857
873
|
return;
|
|
858
874
|
}
|
|
859
875
|
|
|
@@ -873,7 +889,7 @@ function parseContainer(
|
|
|
873
889
|
return;
|
|
874
890
|
}
|
|
875
891
|
|
|
876
|
-
export function
|
|
892
|
+
export function parseUnparsedDeclaration(
|
|
877
893
|
declaration: Extract<Declaration, { property: "unparsed" }>,
|
|
878
894
|
builder: StylesheetBuilder,
|
|
879
895
|
) {
|
|
@@ -900,24 +916,15 @@ export function parseDeclarationUnparsed(
|
|
|
900
916
|
builder.descriptorProperty = property;
|
|
901
917
|
|
|
902
918
|
if (unparsedRuntimeParsing.has(property)) {
|
|
903
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
919
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
904
920
|
|
|
905
921
|
if (property === "animation") {
|
|
906
|
-
builder.addDescriptor("animation", [
|
|
907
|
-
{},
|
|
908
|
-
`@${toRNProperty(property)}`,
|
|
909
|
-
args,
|
|
910
|
-
]);
|
|
922
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
911
923
|
} else {
|
|
912
|
-
builder.addDescriptor(property, [
|
|
913
|
-
{},
|
|
914
|
-
`@${toRNProperty(property)}`,
|
|
915
|
-
args,
|
|
916
|
-
1,
|
|
917
|
-
]);
|
|
924
|
+
builder.addDescriptor(property, [{}, toRNProperty(property), args, 1]);
|
|
918
925
|
}
|
|
919
926
|
} else {
|
|
920
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
927
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
921
928
|
|
|
922
929
|
builder.addDescriptor(property, value);
|
|
923
930
|
|
|
@@ -931,26 +938,31 @@ export function parseDeclarationUnparsed(
|
|
|
931
938
|
}
|
|
932
939
|
}
|
|
933
940
|
|
|
934
|
-
export function
|
|
941
|
+
export function parseCustomDeclaration(
|
|
935
942
|
declaration: Extract<Declaration, { property: "custom" }>,
|
|
936
943
|
builder: StylesheetBuilder,
|
|
937
944
|
) {
|
|
938
945
|
const property = declaration.value.name;
|
|
939
|
-
|
|
946
|
+
|
|
947
|
+
if (property === "-webkit-line-clamp") {
|
|
948
|
+
builder.addDescriptor(
|
|
949
|
+
property,
|
|
950
|
+
parseUnparsed(declaration.value.value, builder, property),
|
|
951
|
+
);
|
|
952
|
+
} else if (property === "-rn-ripple-style") {
|
|
953
|
+
builder.addDescriptor(
|
|
954
|
+
property,
|
|
955
|
+
parseUnparsed(declaration.value.value, builder, property) ===
|
|
956
|
+
"borderless",
|
|
957
|
+
);
|
|
958
|
+
} else if (
|
|
940
959
|
validProperties.has(property) ||
|
|
941
960
|
property.startsWith("--") ||
|
|
942
961
|
property.startsWith("-rn-")
|
|
943
962
|
) {
|
|
944
|
-
builder.setWarningProperty(property);
|
|
945
963
|
builder.addDescriptor(
|
|
946
964
|
property,
|
|
947
|
-
parseUnparsed(declaration.value.value, builder,
|
|
948
|
-
);
|
|
949
|
-
} else if (property === "-webkit-line-clamp") {
|
|
950
|
-
builder.addMapping({ [property]: ["numberOfLines"] });
|
|
951
|
-
builder.addDescriptor(
|
|
952
|
-
property,
|
|
953
|
-
parseUnparsed(declaration.value.value, builder, allowAuto.has(property)),
|
|
965
|
+
parseUnparsed(declaration.value.value, builder, property),
|
|
954
966
|
);
|
|
955
967
|
} else {
|
|
956
968
|
builder.addWarning("property", declaration.value.name);
|
|
@@ -960,9 +972,13 @@ export function parseDeclarationCustom(
|
|
|
960
972
|
export function reduceParseUnparsed(
|
|
961
973
|
tokenOrValues: TokenOrValue[],
|
|
962
974
|
builder: StylesheetBuilder,
|
|
975
|
+
property: string,
|
|
976
|
+
allowAuto: boolean,
|
|
963
977
|
): StyleDescriptor {
|
|
964
978
|
const result = tokenOrValues
|
|
965
|
-
.map((tokenOrValue) =>
|
|
979
|
+
.map((tokenOrValue) =>
|
|
980
|
+
parseUnparsed(tokenOrValue, builder, property, allowAuto),
|
|
981
|
+
)
|
|
966
982
|
.filter((v) => v !== undefined);
|
|
967
983
|
|
|
968
984
|
if (result.length === 0) {
|
|
@@ -981,6 +997,8 @@ export function reduceParseUnparsed(
|
|
|
981
997
|
}
|
|
982
998
|
}
|
|
983
999
|
|
|
1000
|
+
// Groups are the tokens grouped together by comma location
|
|
1001
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
984
1002
|
groups = groups.flatMap((group): StyleDescriptor[] => {
|
|
985
1003
|
if (!Array.isArray(group)) {
|
|
986
1004
|
return [];
|
|
@@ -996,6 +1014,17 @@ export function reduceParseUnparsed(
|
|
|
996
1014
|
} else {
|
|
997
1015
|
return [first];
|
|
998
1016
|
}
|
|
1017
|
+
} else if (
|
|
1018
|
+
// This is a special case for <ratio> values
|
|
1019
|
+
group.includes("/") &&
|
|
1020
|
+
group.every((item) =>
|
|
1021
|
+
typeof item === "string" && item === "/"
|
|
1022
|
+
? item
|
|
1023
|
+
: typeof item === "number",
|
|
1024
|
+
)
|
|
1025
|
+
) {
|
|
1026
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
1027
|
+
return [group.join(" ")];
|
|
999
1028
|
} else {
|
|
1000
1029
|
return [group];
|
|
1001
1030
|
}
|
|
@@ -1007,11 +1036,13 @@ export function reduceParseUnparsed(
|
|
|
1007
1036
|
export function unparsedFunction(
|
|
1008
1037
|
token: Extract<TokenOrValue, { type: "function" }>,
|
|
1009
1038
|
builder: StylesheetBuilder,
|
|
1039
|
+
property: string,
|
|
1040
|
+
allowAuto: boolean,
|
|
1010
1041
|
): StyleFunction {
|
|
1011
1042
|
return [
|
|
1012
1043
|
{},
|
|
1013
|
-
token.value.name,
|
|
1014
|
-
reduceParseUnparsed(token.value.arguments, builder),
|
|
1044
|
+
toRNProperty(token.value.name),
|
|
1045
|
+
reduceParseUnparsed(token.value.arguments, builder, property, allowAuto),
|
|
1015
1046
|
];
|
|
1016
1047
|
}
|
|
1017
1048
|
|
|
@@ -1028,7 +1059,8 @@ export function parseUnparsed(
|
|
|
1028
1059
|
| undefined
|
|
1029
1060
|
| null,
|
|
1030
1061
|
builder: StylesheetBuilder,
|
|
1031
|
-
|
|
1062
|
+
property: string,
|
|
1063
|
+
allowAuto = allowAutoProperties.has(property),
|
|
1032
1064
|
): StyleDescriptor {
|
|
1033
1065
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
1034
1066
|
return;
|
|
@@ -1051,7 +1083,12 @@ export function parseUnparsed(
|
|
|
1051
1083
|
}
|
|
1052
1084
|
|
|
1053
1085
|
if (Array.isArray(tokenOrValue)) {
|
|
1054
|
-
const args = reduceParseUnparsed(
|
|
1086
|
+
const args = reduceParseUnparsed(
|
|
1087
|
+
tokenOrValue,
|
|
1088
|
+
builder,
|
|
1089
|
+
property,
|
|
1090
|
+
allowAuto,
|
|
1091
|
+
);
|
|
1055
1092
|
if (!args) return;
|
|
1056
1093
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
1057
1094
|
return args;
|
|
@@ -1059,11 +1096,21 @@ export function parseUnparsed(
|
|
|
1059
1096
|
|
|
1060
1097
|
switch (tokenOrValue.type) {
|
|
1061
1098
|
case "unresolved-color": {
|
|
1062
|
-
return parseUnresolvedColor(
|
|
1099
|
+
return parseUnresolvedColor(
|
|
1100
|
+
tokenOrValue.value,
|
|
1101
|
+
builder,
|
|
1102
|
+
property,
|
|
1103
|
+
allowAuto,
|
|
1104
|
+
);
|
|
1063
1105
|
}
|
|
1064
1106
|
case "var": {
|
|
1065
1107
|
let args: StyleDescriptor = tokenOrValue.value.name.ident.slice(2);
|
|
1066
|
-
const fallback = parseUnparsed(
|
|
1108
|
+
const fallback = parseUnparsed(
|
|
1109
|
+
tokenOrValue.value.fallback,
|
|
1110
|
+
builder,
|
|
1111
|
+
property,
|
|
1112
|
+
allowAuto,
|
|
1113
|
+
);
|
|
1067
1114
|
if (fallback !== undefined) {
|
|
1068
1115
|
args = [args, fallback];
|
|
1069
1116
|
}
|
|
@@ -1072,44 +1119,53 @@ export function parseUnparsed(
|
|
|
1072
1119
|
}
|
|
1073
1120
|
case "function": {
|
|
1074
1121
|
switch (tokenOrValue.value.name) {
|
|
1075
|
-
case "translate":
|
|
1076
|
-
case "rotate":
|
|
1077
|
-
case "rotateX":
|
|
1078
|
-
case "rotateY":
|
|
1079
|
-
case "skewX":
|
|
1080
|
-
case "skewY":
|
|
1081
|
-
case "scale":
|
|
1082
|
-
case "scaleX":
|
|
1083
|
-
case "scaleY":
|
|
1084
|
-
case "translateX":
|
|
1085
|
-
case "translateY":
|
|
1086
|
-
tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
|
|
1087
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
1088
1122
|
case "blur":
|
|
1089
1123
|
case "brightness":
|
|
1090
1124
|
case "contrast":
|
|
1091
1125
|
case "cubic-bezier":
|
|
1092
1126
|
case "drop-shadow":
|
|
1093
1127
|
case "fontScale":
|
|
1128
|
+
case "getPixelSizeForLayoutSize":
|
|
1094
1129
|
case "grayscale":
|
|
1095
1130
|
case "hsl":
|
|
1096
1131
|
case "hsla":
|
|
1097
1132
|
case "hue-rotate":
|
|
1098
1133
|
case "invert":
|
|
1099
|
-
case "linear-gradient":
|
|
1100
1134
|
case "opacity":
|
|
1101
1135
|
case "pixelScale":
|
|
1102
|
-
case "pixelSizeForLayoutSize":
|
|
1103
1136
|
case "platformColor":
|
|
1104
|
-
case "radial-gradient":
|
|
1105
1137
|
case "rgb":
|
|
1106
1138
|
case "rgba":
|
|
1139
|
+
case "rotate":
|
|
1140
|
+
case "rotateX":
|
|
1141
|
+
case "rotateY":
|
|
1107
1142
|
case "roundToNearestPixel":
|
|
1108
1143
|
case "saturate":
|
|
1144
|
+
case "scale":
|
|
1145
|
+
case "scaleX":
|
|
1146
|
+
case "scaleY":
|
|
1109
1147
|
case "sepia":
|
|
1110
1148
|
case "shadow":
|
|
1149
|
+
case "skewX":
|
|
1150
|
+
case "skewY":
|
|
1111
1151
|
case "steps":
|
|
1112
|
-
|
|
1152
|
+
case "translate":
|
|
1153
|
+
case "translateX":
|
|
1154
|
+
case "translateY":
|
|
1155
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
1156
|
+
case "linear-gradient":
|
|
1157
|
+
case "radial-gradient":
|
|
1158
|
+
// These are special as React Native requires the '-' in their name
|
|
1159
|
+
return [
|
|
1160
|
+
{},
|
|
1161
|
+
tokenOrValue.value.name,
|
|
1162
|
+
reduceParseUnparsed(
|
|
1163
|
+
tokenOrValue.value.arguments,
|
|
1164
|
+
builder,
|
|
1165
|
+
property,
|
|
1166
|
+
allowAuto,
|
|
1167
|
+
),
|
|
1168
|
+
];
|
|
1113
1169
|
case "hairlineWidth":
|
|
1114
1170
|
return [{}, tokenOrValue.value.name, []];
|
|
1115
1171
|
case "calc":
|
|
@@ -1120,6 +1176,7 @@ export function parseUnparsed(
|
|
|
1120
1176
|
tokenOrValue.value.name,
|
|
1121
1177
|
tokenOrValue.value.arguments,
|
|
1122
1178
|
builder,
|
|
1179
|
+
property,
|
|
1123
1180
|
);
|
|
1124
1181
|
default: {
|
|
1125
1182
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
@@ -1152,6 +1209,8 @@ export function parseUnparsed(
|
|
|
1152
1209
|
return true;
|
|
1153
1210
|
} else if (value === "false") {
|
|
1154
1211
|
return false;
|
|
1212
|
+
} else if (value === "infinity") {
|
|
1213
|
+
return Number.MAX_SAFE_INTEGER;
|
|
1155
1214
|
} else {
|
|
1156
1215
|
return value;
|
|
1157
1216
|
}
|
|
@@ -1168,11 +1227,16 @@ export function parseUnparsed(
|
|
|
1168
1227
|
return parseDimension(tokenOrValue.value, builder);
|
|
1169
1228
|
case "comma":
|
|
1170
1229
|
return CommaSeparator as unknown as StyleDescriptor;
|
|
1230
|
+
case "delim": {
|
|
1231
|
+
if (tokenOrValue.value.value === "/") {
|
|
1232
|
+
return tokenOrValue.value.value;
|
|
1233
|
+
}
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1171
1236
|
case "at-keyword":
|
|
1172
1237
|
case "hash":
|
|
1173
1238
|
case "id-hash":
|
|
1174
1239
|
case "unquoted-url":
|
|
1175
|
-
case "delim":
|
|
1176
1240
|
case "white-space":
|
|
1177
1241
|
case "comment":
|
|
1178
1242
|
case "colon":
|
|
@@ -1254,7 +1318,12 @@ export function parseLength(
|
|
|
1254
1318
|
} else if (length.value === -Infinity) {
|
|
1255
1319
|
return -9999;
|
|
1256
1320
|
} else {
|
|
1257
|
-
|
|
1321
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
1322
|
+
const value = Math.max(
|
|
1323
|
+
Math.min(length.value, Number.MAX_SAFE_INTEGER),
|
|
1324
|
+
Number.MIN_SAFE_INTEGER,
|
|
1325
|
+
);
|
|
1326
|
+
return round(value);
|
|
1258
1327
|
}
|
|
1259
1328
|
}
|
|
1260
1329
|
case "rem":
|
|
@@ -1432,7 +1501,7 @@ export function parseSize(
|
|
|
1432
1501
|
return;
|
|
1433
1502
|
}
|
|
1434
1503
|
|
|
1435
|
-
export function
|
|
1504
|
+
export function parseColorOrAutoDeclaration(
|
|
1436
1505
|
{ value }: { value: ColorOrAuto },
|
|
1437
1506
|
builder: StylesheetBuilder,
|
|
1438
1507
|
) {
|
|
@@ -2399,7 +2468,6 @@ export function parseSVGPaint(
|
|
|
2399
2468
|
return;
|
|
2400
2469
|
}
|
|
2401
2470
|
|
|
2402
|
-
builder.addMapping({ [property]: [property] });
|
|
2403
2471
|
builder.addDescriptor(property, parsedValue);
|
|
2404
2472
|
}
|
|
2405
2473
|
|
|
@@ -2420,7 +2488,7 @@ export function parseDimensionPercentageFor_LengthValue(
|
|
|
2420
2488
|
}
|
|
2421
2489
|
}
|
|
2422
2490
|
|
|
2423
|
-
const
|
|
2491
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
2424
2492
|
|
|
2425
2493
|
export function parseEnv(
|
|
2426
2494
|
value: EnvironmentVariable,
|
|
@@ -2438,7 +2506,7 @@ export function parseEnv(
|
|
|
2438
2506
|
"var",
|
|
2439
2507
|
[
|
|
2440
2508
|
`--react-native-css-${value.name.value}`,
|
|
2441
|
-
parseUnparsed(value.fallback, builder),
|
|
2509
|
+
parseUnparsed(value.fallback, builder, value.name.value),
|
|
2442
2510
|
],
|
|
2443
2511
|
1,
|
|
2444
2512
|
];
|
|
@@ -2461,8 +2529,9 @@ export function parseCalcFn(
|
|
|
2461
2529
|
name: string,
|
|
2462
2530
|
tokens: TokenOrValue[],
|
|
2463
2531
|
builder: StylesheetBuilder,
|
|
2532
|
+
property: string,
|
|
2464
2533
|
): StyleDescriptor {
|
|
2465
|
-
const args = parseCalcArguments(tokens, builder);
|
|
2534
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
2466
2535
|
if (args) {
|
|
2467
2536
|
return [{}, name, args];
|
|
2468
2537
|
}
|
|
@@ -2473,6 +2542,7 @@ export function parseCalcFn(
|
|
|
2473
2542
|
export function parseCalcArguments(
|
|
2474
2543
|
[...args]: TokenOrValue[],
|
|
2475
2544
|
builder: StylesheetBuilder,
|
|
2545
|
+
property: string,
|
|
2476
2546
|
) {
|
|
2477
2547
|
const parsed: StyleDescriptor[] = [];
|
|
2478
2548
|
|
|
@@ -2487,7 +2557,7 @@ export function parseCalcArguments(
|
|
|
2487
2557
|
case "var":
|
|
2488
2558
|
case "function":
|
|
2489
2559
|
case "unresolved-color": {
|
|
2490
|
-
const value = parseUnparsed(arg, builder);
|
|
2560
|
+
const value = parseUnparsed(arg, builder, property);
|
|
2491
2561
|
|
|
2492
2562
|
if (value === undefined) {
|
|
2493
2563
|
return undefined;
|
|
@@ -2563,7 +2633,7 @@ export function parseCalcArguments(
|
|
|
2563
2633
|
// Then drop the surrounding parenthesis
|
|
2564
2634
|
.slice(1, -1);
|
|
2565
2635
|
|
|
2566
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
2636
|
+
parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
|
|
2567
2637
|
|
|
2568
2638
|
break;
|
|
2569
2639
|
}
|
|
@@ -2616,6 +2686,8 @@ export function parseTranslateProp(
|
|
|
2616
2686
|
export function parseUnresolvedColor(
|
|
2617
2687
|
color: UnresolvedColor,
|
|
2618
2688
|
builder: StylesheetBuilder,
|
|
2689
|
+
property: string,
|
|
2690
|
+
allowAuto: boolean,
|
|
2619
2691
|
): StyleDescriptor {
|
|
2620
2692
|
switch (color.type) {
|
|
2621
2693
|
case "rgb":
|
|
@@ -2626,26 +2698,31 @@ export function parseUnresolvedColor(
|
|
|
2626
2698
|
round(color.r * 255),
|
|
2627
2699
|
round(color.g * 255),
|
|
2628
2700
|
round(color.b * 255),
|
|
2629
|
-
parseUnparsed(color.alpha, builder),
|
|
2701
|
+
parseUnparsed(color.alpha, builder, property),
|
|
2630
2702
|
],
|
|
2631
2703
|
];
|
|
2632
2704
|
case "hsl":
|
|
2633
2705
|
return [
|
|
2634
2706
|
{},
|
|
2635
2707
|
color.type,
|
|
2636
|
-
[
|
|
2708
|
+
[
|
|
2709
|
+
color.h,
|
|
2710
|
+
color.s,
|
|
2711
|
+
color.l,
|
|
2712
|
+
parseUnparsed(color.alpha, builder, property),
|
|
2713
|
+
],
|
|
2637
2714
|
];
|
|
2638
2715
|
case "light-dark": {
|
|
2639
2716
|
const extraRule = builder.extendRule({
|
|
2640
2717
|
m: [["=", "prefers-color-scheme", "dark"]],
|
|
2641
2718
|
});
|
|
2642
2719
|
builder.addUnnamedDescriptor(
|
|
2643
|
-
reduceParseUnparsed(color.dark, builder),
|
|
2720
|
+
reduceParseUnparsed(color.dark, builder, property, allowAuto),
|
|
2644
2721
|
false,
|
|
2645
2722
|
extraRule,
|
|
2646
2723
|
);
|
|
2647
2724
|
builder.addExtraRule(extraRule);
|
|
2648
|
-
return reduceParseUnparsed(color.light, builder);
|
|
2725
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
2649
2726
|
}
|
|
2650
2727
|
default:
|
|
2651
2728
|
color satisfies never;
|
|
@@ -2891,7 +2968,7 @@ function parseGradient(
|
|
|
2891
2968
|
case "linear": {
|
|
2892
2969
|
return [
|
|
2893
2970
|
{},
|
|
2894
|
-
"
|
|
2971
|
+
"linear-gradient",
|
|
2895
2972
|
[
|
|
2896
2973
|
parseLineDirection(gradient.direction, builder),
|
|
2897
2974
|
...gradient.items.map((item) => parseGradientItem(item, builder)),
|
|
@@ -2968,6 +3045,16 @@ function parseFilter(
|
|
|
2968
3045
|
[value.type]: parseAngle(value.value, builder),
|
|
2969
3046
|
} as unknown as StyleDescriptor;
|
|
2970
3047
|
case "drop-shadow":
|
|
3048
|
+
return [
|
|
3049
|
+
{},
|
|
3050
|
+
toRNProperty(value.type),
|
|
3051
|
+
[
|
|
3052
|
+
parseLength(value.value.xOffset, builder),
|
|
3053
|
+
parseLength(value.value.yOffset, builder),
|
|
3054
|
+
parseLength(value.value.blur, builder),
|
|
3055
|
+
parseColor(value.value.color, builder),
|
|
3056
|
+
],
|
|
3057
|
+
] as unknown as StyleDescriptor;
|
|
2971
3058
|
case "url":
|
|
2972
3059
|
return;
|
|
2973
3060
|
}
|
|
@@ -32,6 +32,8 @@ const staticDeclarations = new WeakMap<
|
|
|
32
32
|
|
|
33
33
|
const extraRules = new WeakMap<StyleRule, Partial<StyleRule>[]>();
|
|
34
34
|
|
|
35
|
+
const keywords = new Set(["unset"]);
|
|
36
|
+
|
|
35
37
|
export class StylesheetBuilder {
|
|
36
38
|
animationFrames?: AnimationKeyframes_V2[];
|
|
37
39
|
animationDeclarations: StyleDeclaration[] = [];
|
|
@@ -50,6 +52,7 @@ export class StylesheetBuilder {
|
|
|
50
52
|
private ruleTemplate: StyleRule = {
|
|
51
53
|
s: [],
|
|
52
54
|
},
|
|
55
|
+
// Any default mapping should be included in the @prop parsing
|
|
53
56
|
private mapping: StyleRuleMapping = {},
|
|
54
57
|
public descriptorProperty?: string,
|
|
55
58
|
private shared: {
|
|
@@ -339,7 +342,10 @@ export class StylesheetBuilder {
|
|
|
339
342
|
const [delayed, usesVariables] = postProcessStyleFunction(value);
|
|
340
343
|
|
|
341
344
|
rule.d ??= [];
|
|
342
|
-
if (
|
|
345
|
+
if (
|
|
346
|
+
value[1].startsWith("animation") ||
|
|
347
|
+
value[1].startsWith("transition")
|
|
348
|
+
) {
|
|
343
349
|
rule.a ??= true;
|
|
344
350
|
}
|
|
345
351
|
|
|
@@ -404,17 +410,21 @@ export class StylesheetBuilder {
|
|
|
404
410
|
propPath = property;
|
|
405
411
|
}
|
|
406
412
|
|
|
407
|
-
if (
|
|
413
|
+
if (forceTuple && !Array.isArray(propPath)) {
|
|
414
|
+
propPath = [propPath];
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (isStyleFunction(value) || Array.isArray(propPath)) {
|
|
408
418
|
if (delayed) {
|
|
409
419
|
declarations.push([value, propPath, 1]);
|
|
410
420
|
} else {
|
|
411
421
|
declarations.push([value, propPath]);
|
|
412
422
|
}
|
|
413
|
-
} else if (forceTuple || Array.isArray(propPath)) {
|
|
414
|
-
declarations.push([value, propPath]);
|
|
415
423
|
} else if (Array.isArray(value) && value.some(isStyleFunction)) {
|
|
416
424
|
declarations.push([value, propPath]);
|
|
417
|
-
} else {
|
|
425
|
+
} else if (typeof value === "string" && keywords.has(value)) {
|
|
426
|
+
declarations.push([value, propPath]);
|
|
427
|
+
} else if (typeof propPath === "string") {
|
|
418
428
|
let staticDeclarationRecord = staticDeclarations.get(declarations);
|
|
419
429
|
if (!staticDeclarationRecord) {
|
|
420
430
|
staticDeclarationRecord = {};
|
|
@@ -431,7 +441,7 @@ export class StylesheetBuilder {
|
|
|
431
441
|
return;
|
|
432
442
|
}
|
|
433
443
|
|
|
434
|
-
if (!this.rule.d && !this.rule.v) {
|
|
444
|
+
if (!this.rule.d && !this.rule.v && !this.rule.c) {
|
|
435
445
|
return;
|
|
436
446
|
}
|
|
437
447
|
|
|
@@ -611,7 +621,7 @@ function postProcessStyleFunction(value: StyleDescriptor): [
|
|
|
611
621
|
let [shouldDelay, usesVariables] = postProcessStyleFunction(value[2]);
|
|
612
622
|
|
|
613
623
|
usesVariables ||= value[1] === "var";
|
|
614
|
-
shouldDelay ||= value[3] === 1;
|
|
624
|
+
shouldDelay ||= value[3] === 1 || usesVariables;
|
|
615
625
|
|
|
616
626
|
if (shouldDelay) {
|
|
617
627
|
return [true, usesVariables];
|