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
|
@@ -13,6 +13,7 @@ var _declarations = require("./declarations.js");
|
|
|
13
13
|
var _keyframes = require("./keyframes.js");
|
|
14
14
|
var _mediaQuery = require("./media-query.js");
|
|
15
15
|
var _stylesheet = require("./stylesheet.js");
|
|
16
|
+
var _supports = require("./supports.js");
|
|
16
17
|
/* eslint-disable */
|
|
17
18
|
|
|
18
19
|
const defaultLogger = (0, _debug.debug)("react-native-css:compiler");
|
|
@@ -89,10 +90,10 @@ function compile(code, options = {}) {
|
|
|
89
90
|
|
|
90
91
|
// Use the lightningcss library to traverse the CSS AST and extract style declarations and animations
|
|
91
92
|
(0, _lightningcss.transform)({
|
|
92
|
-
filename: "style.css",
|
|
93
|
-
// This is ignored, but required
|
|
94
93
|
code: typeof code === "string" ? new TextEncoder().encode(code) : code,
|
|
95
|
-
visitor
|
|
94
|
+
visitor,
|
|
95
|
+
filename: options.filename ?? "style.css",
|
|
96
|
+
projectRoot: options.projectRoot ?? process.cwd()
|
|
96
97
|
});
|
|
97
98
|
return {
|
|
98
99
|
stylesheet: () => builder.getNativeStyleSheet(),
|
|
@@ -186,6 +187,13 @@ function extractRule(rule, builder) {
|
|
|
186
187
|
extractRule(layerRule, builder);
|
|
187
188
|
}
|
|
188
189
|
break;
|
|
190
|
+
case "supports":
|
|
191
|
+
if ((0, _supports.supportsConditionValid)(rule.value.condition)) {
|
|
192
|
+
for (const layerRule of rule.value.rules) {
|
|
193
|
+
extractRule(layerRule, builder);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
break;
|
|
189
197
|
case "custom":
|
|
190
198
|
case "font-face":
|
|
191
199
|
case "font-palette-values":
|
|
@@ -198,7 +206,6 @@ function extractRule(rule, builder) {
|
|
|
198
206
|
case "unknown":
|
|
199
207
|
case "import":
|
|
200
208
|
case "page":
|
|
201
|
-
case "supports":
|
|
202
209
|
case "counter-style":
|
|
203
210
|
case "moz-document":
|
|
204
211
|
case "nesting":
|
|
@@ -264,7 +271,7 @@ function extractContainer(containerRule, builder) {
|
|
|
264
271
|
m: (0, _containerQuery.parseContainerCondition)(containerRule.condition, builder)
|
|
265
272
|
};
|
|
266
273
|
if (containerRule.name) {
|
|
267
|
-
query.n = containerRule.name
|
|
274
|
+
query.n = `c:${containerRule.name}`;
|
|
268
275
|
}
|
|
269
276
|
builder.addContainerQuery(query);
|
|
270
277
|
for (const rule of containerRule.rules) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_nodeUtil","require","_debug","_lightningcss","_atRules","_containerQuery","_declarations","_keyframes","_mediaQuery","_stylesheet","defaultLogger","debug","compile","code","options","logger","isLoggerEnabled","enabled","Boolean","features","Object","assign","selectorPrefix","startsWith","slice","JSON","stringify","process","env","NODE_ENV","toString","builder","StylesheetBuilder","customAtRules","body","visitor","Rule","rule","maybeMutateReactNativeOptions","StyleSheetExit","sheet","rules","length","inspect","depth","colors","compact","extractRule","stripUnusedVariables","onVarUsage","token","type","value","arguments","forEach","varUsage","add","name","ident","fallback","fallbackValues","varObj","Declaration","decl","property","lightningcss","filename","
|
|
1
|
+
{"version":3,"names":["_nodeUtil","require","_debug","_lightningcss","_atRules","_containerQuery","_declarations","_keyframes","_mediaQuery","_stylesheet","_supports","defaultLogger","debug","compile","code","options","logger","isLoggerEnabled","enabled","Boolean","features","Object","assign","selectorPrefix","startsWith","slice","JSON","stringify","process","env","NODE_ENV","toString","builder","StylesheetBuilder","customAtRules","body","visitor","Rule","rule","maybeMutateReactNativeOptions","StyleSheetExit","sheet","rules","length","inspect","depth","colors","compact","extractRule","stripUnusedVariables","onVarUsage","token","type","value","arguments","forEach","varUsage","add","name","ident","fallback","fallbackValues","varObj","Declaration","decl","property","lightningcss","TextEncoder","encode","filename","projectRoot","cwd","stylesheet","getNativeStyleSheet","warnings","getWarnings","extractKeyFrames","extractContainer","extractMedia","declarationBlock","declarations","newNestedRule","declaration","parseDeclaration","applyRuleToSelectors","importantDeclarations","important","mapping","parsePropAtRule","fork","selectors","newRule","nestedRule","layerRule","supportsConditionValid","condition","mediaRule","media","mediaQuery","query","mediaQueries","mediaType","qualifier","push","m","parseMediaQuery","containerRule","parseContainerCondition","n","addContainerQuery"],"sourceRoot":"../../../src","sources":["compiler/compiler.ts"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAWA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAtBA;;AAwBA,MAAMU,aAAa,GAAG,IAAAC,YAAK,EAAC,2BAA2B,CAAC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAACC,IAAqB,EAAEC,OAAwB,GAAG,CAAC,CAAC,EAAE;EAC5E,MAAM;IAAEC,MAAM,GAAGL;EAAc,CAAC,GAAGI,OAAO;EAC1C,MAAME,eAAe,GACnB,SAAS,IAAID,MAAM,GAAGA,MAAM,CAACE,OAAO,GAAGC,OAAO,CAACH,MAAM,CAAC;EAExD,MAAMI,QAAQ,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEP,OAAO,CAACK,QAAQ,CAAC;EAEpD,IAAIL,OAAO,CAACQ,cAAc,IAAIR,OAAO,CAACQ,cAAc,CAACC,UAAU,CAAC,GAAG,CAA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WAAW,CAACV,IAAI,EAAEN,OAAO,CAAC;EAC5B;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS6C,gBAAgBA,CACvB6B,aAA4B,EAC5B1E,OAA0B,EAC1B;EACAA,OAAO,GAAGA,OAAO,CAACyD,IAAI,CAAC,WAAW,CAAC;;EAEnC;EACA,MAAMU,KAAqB,GAAG;IAC5BK,CAAC,EAAE,IAAAG,uCAAuB,EAACD,aAAa,CAACX,SAAS,EAAE/D,OAAO;EAC7D,CAAC;EAED,IAAI0E,aAAa,CAAChD,IAAI,EAAE;IACtByC,KAAK,CAACS,CAAC,GAAG,KAAKF,aAAa,CAAChD,IAAI,EAAE;EACrC;EAEA1B,OAAO,CAAC6E,iBAAiB,CAACV,KAAK,CAAC;EAEhC,KAAK,MAAM7D,IAAI,IAAIoE,aAAa,CAAChE,KAAK,EAAE;IACtCM,WAAW,CAACV,IAAI,EAAEN,OAAO,CAAC;EAC5B;AACF","ignoreList":[]}
|
|
@@ -112,6 +112,7 @@ const parsers = {
|
|
|
112
112
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
113
113
|
"border-block-start": parseBorderBlockStart,
|
|
114
114
|
"border-block-start-color": parseColorDeclaration,
|
|
115
|
+
"border-block-start-style": parseBorderStyleDeclaration,
|
|
115
116
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
116
117
|
"border-block-style": parseBorderBlockStyle,
|
|
117
118
|
"border-block-width": parseBorderBlockWidth,
|
|
@@ -261,6 +262,7 @@ const parsers = {
|
|
|
261
262
|
"translate": parseTranslate,
|
|
262
263
|
"user-select": parseUserSelect,
|
|
263
264
|
"vertical-align": parseVerticalAlign,
|
|
265
|
+
"visibility": parseVisibility,
|
|
264
266
|
"width": parseSizeDeclaration,
|
|
265
267
|
"z-index": parseZIndex
|
|
266
268
|
};
|
|
@@ -381,54 +383,54 @@ function parseBorderSide({
|
|
|
381
383
|
function parseBorderBlock({
|
|
382
384
|
value
|
|
383
385
|
}, builder) {
|
|
384
|
-
builder.addDescriptor("border-
|
|
385
|
-
builder.addDescriptor("border-
|
|
386
|
-
builder.addDescriptor("border-
|
|
387
|
-
builder.addDescriptor("border-bottom-width", parseBorderSideWidth(value.width, builder));
|
|
386
|
+
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
387
|
+
builder.addDescriptor("border-block-width", parseBorderSideWidth(value.width, builder));
|
|
388
|
+
builder.addDescriptor("border-block-style", parseBorderStyle(value.style, builder));
|
|
388
389
|
}
|
|
389
390
|
function parseBorderBlockStart({
|
|
390
391
|
value
|
|
391
392
|
}, builder) {
|
|
392
|
-
builder.addDescriptor("border-
|
|
393
|
-
builder.addDescriptor("border-
|
|
393
|
+
builder.addDescriptor("border-block-start-color", parseColor(value.color, builder));
|
|
394
|
+
builder.addDescriptor("border-block-start-width", parseBorderSideWidth(value.width, builder));
|
|
394
395
|
}
|
|
395
396
|
function parseBorderBlockEnd({
|
|
396
397
|
value
|
|
397
398
|
}, builder) {
|
|
398
|
-
builder.addDescriptor("border-
|
|
399
|
-
builder.addDescriptor("border-
|
|
399
|
+
builder.addDescriptor("border-block-end-color", parseColor(value.color, builder));
|
|
400
|
+
builder.addDescriptor("border-block-end-width", parseBorderSideWidth(value.width, builder));
|
|
400
401
|
}
|
|
401
402
|
function parseBorderInline({
|
|
402
403
|
value
|
|
403
404
|
}, builder) {
|
|
404
|
-
builder.addDescriptor("border-
|
|
405
|
-
builder.addDescriptor("border-
|
|
406
|
-
builder.addDescriptor("border-
|
|
407
|
-
builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
|
|
405
|
+
builder.addDescriptor("border-inline-color", parseColor(value.color, builder));
|
|
406
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(value.width, builder));
|
|
407
|
+
builder.addDescriptor("border-inline-style", parseBorderStyle(value.style, builder));
|
|
408
408
|
}
|
|
409
409
|
function parseBorderInlineStart({
|
|
410
410
|
value
|
|
411
411
|
}, builder) {
|
|
412
|
-
builder.addDescriptor("border-
|
|
413
|
-
builder.addDescriptor("border-
|
|
412
|
+
builder.addDescriptor("border-inline-start-color", parseColor(value.color, builder));
|
|
413
|
+
builder.addDescriptor("border-inline-start-width", parseBorderSideWidth(value.width, builder));
|
|
414
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(value.style, builder));
|
|
414
415
|
}
|
|
415
416
|
function parseBorderInlineEnd({
|
|
416
417
|
value
|
|
417
418
|
}, builder) {
|
|
418
|
-
builder.addDescriptor("border-
|
|
419
|
-
builder.addDescriptor("border-
|
|
419
|
+
builder.addDescriptor("border-inline-end-color", parseColor(value.color, builder));
|
|
420
|
+
builder.addDescriptor("border-inline-end-width", parseBorderSideWidth(value.width, builder));
|
|
421
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(value.style, builder));
|
|
420
422
|
}
|
|
421
423
|
function parseBorderInlineWidth(declaration, builder) {
|
|
422
|
-
builder.addDescriptor("border-
|
|
423
|
-
builder.addDescriptor("border-right-width", parseBorderSideWidth(declaration.value.end, builder));
|
|
424
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
424
425
|
}
|
|
425
426
|
function parseBorderInlineStyle(declaration, builder) {
|
|
426
427
|
if (typeof declaration.value === "string") {
|
|
427
|
-
builder.addDescriptor(
|
|
428
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value, builder));
|
|
428
429
|
} else if (declaration.value.start === declaration.value.end) {
|
|
429
|
-
builder.addDescriptor(
|
|
430
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value.start, builder));
|
|
430
431
|
} else {
|
|
431
|
-
builder.
|
|
432
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(declaration.value.start, builder));
|
|
433
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(declaration.value.end, builder));
|
|
432
434
|
}
|
|
433
435
|
}
|
|
434
436
|
function parseFlexFlow({
|
|
@@ -678,6 +680,12 @@ function parseCustomDeclaration(declaration, builder) {
|
|
|
678
680
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
679
681
|
} else if (property === "-rn-ripple-style") {
|
|
680
682
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property) === "borderless");
|
|
683
|
+
} else if (property === "object-fit") {
|
|
684
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
685
|
+
parseObjectFit(declaration.value, builder);
|
|
686
|
+
} else if (property === "object-position") {
|
|
687
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
688
|
+
parseObjectPosition(declaration.value, builder);
|
|
681
689
|
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
682
690
|
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
683
691
|
} else {
|
|
@@ -775,43 +783,44 @@ function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoPro
|
|
|
775
783
|
case "function":
|
|
776
784
|
{
|
|
777
785
|
switch (tokenOrValue.value.name) {
|
|
778
|
-
case "translate":
|
|
779
|
-
case "rotate":
|
|
780
|
-
case "rotateX":
|
|
781
|
-
case "rotateY":
|
|
782
|
-
case "skewX":
|
|
783
|
-
case "skewY":
|
|
784
|
-
case "scale":
|
|
785
|
-
case "scaleX":
|
|
786
|
-
case "scaleY":
|
|
787
|
-
case "translateX":
|
|
788
|
-
case "translateY":
|
|
789
|
-
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
790
786
|
case "blur":
|
|
791
787
|
case "brightness":
|
|
792
788
|
case "contrast":
|
|
793
789
|
case "cubic-bezier":
|
|
794
790
|
case "drop-shadow":
|
|
795
791
|
case "fontScale":
|
|
792
|
+
case "getPixelSizeForLayoutSize":
|
|
796
793
|
case "grayscale":
|
|
797
794
|
case "hsl":
|
|
798
795
|
case "hsla":
|
|
799
796
|
case "hue-rotate":
|
|
800
797
|
case "invert":
|
|
801
|
-
case "linear-gradient":
|
|
802
798
|
case "opacity":
|
|
803
799
|
case "pixelScale":
|
|
804
|
-
case "getPixelSizeForLayoutSize":
|
|
805
800
|
case "platformColor":
|
|
806
|
-
case "radial-gradient":
|
|
807
801
|
case "rgb":
|
|
808
802
|
case "rgba":
|
|
803
|
+
case "rotate":
|
|
804
|
+
case "rotateX":
|
|
805
|
+
case "rotateY":
|
|
809
806
|
case "roundToNearestPixel":
|
|
810
807
|
case "saturate":
|
|
808
|
+
case "scale":
|
|
809
|
+
case "scaleX":
|
|
810
|
+
case "scaleY":
|
|
811
811
|
case "sepia":
|
|
812
812
|
case "shadow":
|
|
813
|
+
case "skewX":
|
|
814
|
+
case "skewY":
|
|
813
815
|
case "steps":
|
|
816
|
+
case "translate":
|
|
817
|
+
case "translateX":
|
|
818
|
+
case "translateY":
|
|
814
819
|
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
820
|
+
case "linear-gradient":
|
|
821
|
+
case "radial-gradient":
|
|
822
|
+
// These are special as React Native requires the '-' in their name
|
|
823
|
+
return [{}, tokenOrValue.value.name, reduceParseUnparsed(tokenOrValue.value.arguments, builder, property, allowAuto)];
|
|
815
824
|
case "hairlineWidth":
|
|
816
825
|
return [{}, tokenOrValue.value.name, []];
|
|
817
826
|
case "calc":
|
|
@@ -840,7 +849,7 @@ function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoPro
|
|
|
840
849
|
builder.addWarning("value", value);
|
|
841
850
|
return;
|
|
842
851
|
}
|
|
843
|
-
if (value === "inherit") {
|
|
852
|
+
if (value === "inherit" || value === "initial") {
|
|
844
853
|
builder.addWarning("value", value);
|
|
845
854
|
return;
|
|
846
855
|
} else if (value === "currentcolor") {
|
|
@@ -1491,26 +1500,27 @@ function parseBorderStyle(value, builder) {
|
|
|
1491
1500
|
return undefined;
|
|
1492
1501
|
}
|
|
1493
1502
|
function parseBorderBlockWidth(declaration, builder) {
|
|
1494
|
-
|
|
1495
|
-
|
|
1503
|
+
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
1504
|
+
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
1505
|
+
if (start === end) {
|
|
1506
|
+
builder.addDescriptor("border-block-width", start);
|
|
1507
|
+
} else {
|
|
1508
|
+
builder.addDescriptor("border-block-start-width", start);
|
|
1509
|
+
builder.addDescriptor("border-block-end-width", end);
|
|
1510
|
+
}
|
|
1496
1511
|
}
|
|
1497
1512
|
function parseBorderBlockStyle(declaration, builder) {
|
|
1498
|
-
|
|
1499
|
-
|
|
1513
|
+
const start = parseBorderStyle(declaration.value.start, builder);
|
|
1514
|
+
const end = parseBorderStyle(declaration.value.end, builder);
|
|
1515
|
+
if (start == end) {
|
|
1516
|
+
builder.addDescriptor("border-block-style", start);
|
|
1500
1517
|
} else {
|
|
1501
|
-
builder.
|
|
1518
|
+
builder.addDescriptor("border-block-start-style", start);
|
|
1519
|
+
builder.addDescriptor("border-block-end-style", end);
|
|
1502
1520
|
}
|
|
1503
1521
|
}
|
|
1504
1522
|
function parseBorderSideWidthDeclaration(declaration, builder) {
|
|
1505
|
-
|
|
1506
|
-
builder.addDescriptor(`border-${declaration.property.includes("start") ? "top" : "bottom"}-width`, parseBorderSideWidth(declaration.value, builder));
|
|
1507
|
-
return;
|
|
1508
|
-
} else if (declaration.property.includes("inline")) {
|
|
1509
|
-
builder.addDescriptor(`border-${declaration.property.includes("start") ? "left" : "right"}-width`, parseBorderSideWidth(declaration.value, builder));
|
|
1510
|
-
return;
|
|
1511
|
-
} else {
|
|
1512
|
-
return parseBorderSideWidth(declaration.value, builder);
|
|
1513
|
-
}
|
|
1523
|
+
builder.addDescriptor(declaration.property, parseBorderSideWidth(declaration.value, builder));
|
|
1514
1524
|
}
|
|
1515
1525
|
function parseBorderSideWidth(value, builder) {
|
|
1516
1526
|
if (value.type === "length") {
|
|
@@ -1828,8 +1838,7 @@ function parseCalcFn(name, tokens, builder, property) {
|
|
|
1828
1838
|
}
|
|
1829
1839
|
function parseCalcArguments([...args], builder, property) {
|
|
1830
1840
|
const parsed = [];
|
|
1831
|
-
|
|
1832
|
-
for (const [currentIndex, arg] of args.entries()) {
|
|
1841
|
+
for (const arg of args) {
|
|
1833
1842
|
switch (arg.type) {
|
|
1834
1843
|
case "env":
|
|
1835
1844
|
{
|
|
@@ -1875,44 +1884,21 @@ function parseCalcArguments([...args], builder, property) {
|
|
|
1875
1884
|
}
|
|
1876
1885
|
break;
|
|
1877
1886
|
case "percentage":
|
|
1878
|
-
|
|
1879
|
-
if (mode !== "percentage") return;
|
|
1880
|
-
parsed.push(`${arg.value.value * 100}%`);
|
|
1887
|
+
parsed.push(`${round(arg.value.value * 100)}%`);
|
|
1881
1888
|
break;
|
|
1882
1889
|
case "number":
|
|
1883
1890
|
{
|
|
1884
|
-
|
|
1885
|
-
if (mode !== "number") return;
|
|
1886
|
-
parsed.push(arg.value.value);
|
|
1891
|
+
parsed.push(round(arg.value.value));
|
|
1887
1892
|
break;
|
|
1888
1893
|
}
|
|
1889
1894
|
case "parenthesis-block":
|
|
1890
1895
|
{
|
|
1891
|
-
|
|
1892
|
-
* If we have a parenthesis block, we just treat it as a nested calc function
|
|
1893
|
-
* Because there could be multiple parenthesis blocks, this is recursive
|
|
1894
|
-
*/
|
|
1895
|
-
let closeParenthesisIndex = -1;
|
|
1896
|
-
for (let index = args.length - 1; index > 0; index--) {
|
|
1897
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1898
|
-
const value = args[index];
|
|
1899
|
-
if (value.type === "token" && value.value.type === "close-parenthesis") {
|
|
1900
|
-
closeParenthesisIndex = index;
|
|
1901
|
-
break;
|
|
1902
|
-
}
|
|
1903
|
-
}
|
|
1904
|
-
if (closeParenthesisIndex === -1) {
|
|
1905
|
-
return;
|
|
1906
|
-
}
|
|
1907
|
-
const innerCalcArgs = args
|
|
1908
|
-
// Extract the inner calcArgs including the parenthesis. This mutates args
|
|
1909
|
-
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
1910
|
-
// Then drop the surrounding parenthesis
|
|
1911
|
-
.slice(1, -1);
|
|
1912
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
|
|
1896
|
+
parsed.push("(");
|
|
1913
1897
|
break;
|
|
1914
1898
|
}
|
|
1915
1899
|
case "close-parenthesis":
|
|
1900
|
+
parsed.push(")");
|
|
1901
|
+
break;
|
|
1916
1902
|
case "string":
|
|
1917
1903
|
case "function":
|
|
1918
1904
|
case "ident":
|
|
@@ -2025,7 +2011,7 @@ function addTransitionValue(declaration, builder) {
|
|
|
2025
2011
|
}
|
|
2026
2012
|
case "transition-property":
|
|
2027
2013
|
{
|
|
2028
|
-
builder.addDescriptor(declaration.property, declaration.value.map(v => v.property).filter(v => v in parsers || v === "all" || v === "none").map(v => (0, _selectors.toRNProperty)(v)));
|
|
2014
|
+
builder.addDescriptor(declaration.property, declaration.value.map(v => v.property).filter(v => v in parsers && !["visibility"].includes(v) || v === "all" || v === "none").map(v => (0, _selectors.toRNProperty)(v)));
|
|
2029
2015
|
return;
|
|
2030
2016
|
}
|
|
2031
2017
|
case "transition-duration":
|
|
@@ -2157,6 +2143,27 @@ function parseGradientItem(item, builder) {
|
|
|
2157
2143
|
return parseLength(item.value, builder);
|
|
2158
2144
|
}
|
|
2159
2145
|
}
|
|
2146
|
+
function parseObjectFit(declaration, builder) {
|
|
2147
|
+
builder.addMapping({
|
|
2148
|
+
"object-fit": "contentFit"
|
|
2149
|
+
});
|
|
2150
|
+
builder.addDescriptor("object-fit", parseUnparsed(declaration.value, builder, "object-fit"));
|
|
2151
|
+
}
|
|
2152
|
+
function parseObjectPosition(declaration, builder) {
|
|
2153
|
+
builder.addMapping({
|
|
2154
|
+
"object-position": "contentPosition"
|
|
2155
|
+
});
|
|
2156
|
+
builder.addDescriptor("object-position", [{}, "join", [parseUnparsed(declaration.value, builder, "object-position"), " "]]);
|
|
2157
|
+
}
|
|
2158
|
+
function parseVisibility(declaration, builder) {
|
|
2159
|
+
if (declaration.value === "visible") {
|
|
2160
|
+
builder.addDescriptor("opacity", 1);
|
|
2161
|
+
} else if (declaration.value === "hidden") {
|
|
2162
|
+
builder.addDescriptor("opacity", 0);
|
|
2163
|
+
} else {
|
|
2164
|
+
builder.addWarning("value", declaration.value);
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2160
2167
|
function parseFilter(declaration, builder) {
|
|
2161
2168
|
if (declaration.value.type === "none") {
|
|
2162
2169
|
return "unset";
|