react-native-css 3.0.0-nightly.fa5e95b → 3.0.0-preview.1
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/compiler.js +13 -8
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +323 -176
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +12 -12
- package/dist/commonjs/compiler/inheritance.test.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/pseudo-elements.js +49 -0
- package/dist/commonjs/compiler/pseudo-elements.js.map +1 -0
- package/dist/commonjs/compiler/selector-builder.js +501 -0
- package/dist/commonjs/compiler/selector-builder.js.map +1 -0
- package/dist/commonjs/compiler/selectors.js +10 -6
- package/dist/commonjs/compiler/selectors.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +63 -25
- 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 +24 -18
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +7 -4
- 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 +29 -4
- package/dist/commonjs/runtime/native/api.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
- package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js +7 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +6 -40
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +16 -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/react/useNativeCss.js +2 -2
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +12 -25
- package/dist/commonjs/runtime/native/reactivity.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 +29 -9
- 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/functions/calc.js +125 -0
- 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 +83 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
- 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/{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/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 +121 -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} +6 -37
- 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/shorthands/box-shadow.js +50 -0
- 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/{transform.js → shorthands/transform.js} +1 -1
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/units.js +11 -9
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +3 -2
- package/dist/commonjs/runtime/native/styles/variables.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/commonjs/runtime/utils/specificity.js +2 -1
- package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
- package/dist/commonjs/runtime/web/api.js +18 -0
- 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/style-collection/root.js +29 -0
- package/dist/commonjs/style-collection/root.js.map +1 -0
- package/dist/module/compiler/atRules.js +15 -2
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +13 -8
- 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 +314 -172
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +12 -12
- package/dist/module/compiler/inheritance.test.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/pseudo-elements.js +44 -0
- package/dist/module/compiler/pseudo-elements.js.map +1 -0
- package/dist/module/compiler/selector-builder.js +496 -0
- package/dist/module/compiler/selector-builder.js.map +1 -0
- package/dist/module/compiler/selectors.js +10 -6
- package/dist/module/compiler/selectors.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +61 -23
- 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 +23 -18
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +7 -4
- 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 +23 -4
- package/dist/module/runtime/native/api.js.map +1 -1
- package/dist/module/runtime/native/conditions/attributes.js +38 -0
- package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/module/runtime/native/conditions/container-query.js +7 -0
- package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +6 -40
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +17 -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/react/useNativeCss.js +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +11 -24
- package/dist/module/runtime/native/reactivity.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 +30 -10
- 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/functions/calc.js +120 -0
- 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 +10 -0
- package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
- 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/{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/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 +114 -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} +16 -6
- 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/{transform.js → shorthands/transform.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/module/runtime/native/styles/units.js +12 -9
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +2 -1
- package/dist/module/runtime/native/styles/variables.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/module/runtime/utils/specificity.js +2 -1
- package/dist/module/runtime/utils/specificity.js.map +1 -1
- package/dist/module/runtime/web/api.js +18 -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/style-collection/root.js +25 -0
- package/dist/module/style-collection/root.js.map +1 -0
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- 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 +26 -17
- 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 +24 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +7 -7
- 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 +13 -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 +16 -2
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.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/reactivity.d.ts +1 -11
- package/dist/typescript/commonjs/src/runtime/native/reactivity.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 +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/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 +8 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- 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/{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/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 +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/native/styles/units.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/utils/specificity.d.ts +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/web/api.d.ts +9 -3
- 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/style-collection/root.d.ts +11 -0
- package/dist/typescript/commonjs/src/style-collection/root.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- 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 +26 -17
- 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 +24 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +7 -7
- 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 +13 -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 +16 -2
- package/dist/typescript/module/src/runtime/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/index.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/reactivity.d.ts +1 -11
- package/dist/typescript/module/src/runtime/native/reactivity.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 +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/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 +8 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- 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/{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/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 +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/native/styles/units.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/utils/specificity.d.ts +1 -0
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/web/api.d.ts +9 -3
- 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/style-collection/root.d.ts +11 -0
- package/dist/typescript/module/src/style-collection/root.d.ts.map +1 -0
- package/package.json +30 -15
- package/src/compiler/atRules.ts +16 -2
- package/src/compiler/compiler.ts +12 -10
- package/src/compiler/compiler.types.ts +11 -14
- package/src/compiler/declarations.ts +518 -215
- package/src/compiler/inheritance.test.ts +10 -10
- package/src/compiler/keyframes.ts +1 -1
- package/src/compiler/pseudo-elements.ts +54 -0
- package/src/compiler/selector-builder.ts +586 -0
- package/src/compiler/selectors.ts +20 -6
- package/src/compiler/stylesheet.ts +93 -33
- 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 +26 -17
- package/src/metro/index.ts +12 -7
- 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 → api.tsx} +34 -5
- package/src/runtime/native/conditions/attributes.ts +52 -0
- package/src/runtime/native/conditions/container-query.ts +5 -0
- package/src/runtime/native/conditions/index.ts +7 -59
- package/src/runtime/native/conditions/media-query.ts +18 -12
- package/src/runtime/native/react/rules.ts +27 -17
- package/src/runtime/native/react/useNativeCss.ts +1 -1
- package/src/runtime/native/reactivity.ts +13 -33
- package/src/runtime/native/reanimated.ts +22 -0
- package/src/runtime/native/styles/calculate-props.ts +30 -8
- 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/functions/calc.ts +121 -0
- package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
- package/src/runtime/native/styles/functions/index.ts +7 -0
- package/src/runtime/native/styles/functions/numeric-functions.ts +38 -0
- package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
- package/src/runtime/native/styles/functions/string-functions.ts +22 -0
- package/src/runtime/native/styles/functions/transform-functions.ts +84 -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 -62
- package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
- package/src/runtime/native/styles/shorthands/box-shadow.ts +74 -0
- 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} +4 -2
- package/src/runtime/native/styles/units.ts +14 -9
- package/src/runtime/native/styles/variables.ts +5 -5
- package/src/runtime/utils/objects.ts +16 -4
- package/src/runtime/utils/specificity.ts +1 -0
- package/src/runtime/web/{api.ts → api.tsx} +29 -3
- package/src/style-collection/index.ts +142 -0
- package/src/style-collection/root.ts +37 -0
- 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 -98
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- 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 +0 -40
- package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/calc.js +0 -85
- 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/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 -93
- package/dist/module/runtime/native/injection.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 +0 -79
- 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/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/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/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/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/src/compiler/attributes.test.ts +0 -28
- package/src/doctor/index.ts +0 -1
- package/src/runtime/native/injection.ts +0 -131
- package/src/runtime/native/styles/box-shadow.ts +0 -54
- package/src/runtime/native/styles/calc.ts +0 -97
|
@@ -13,24 +13,26 @@ exports.parseAlignItems = parseAlignItems;
|
|
|
13
13
|
exports.parseAlignSelf = parseAlignSelf;
|
|
14
14
|
exports.parseAngle = parseAngle;
|
|
15
15
|
exports.parseAspectRatio = parseAspectRatio;
|
|
16
|
-
exports.
|
|
16
|
+
exports.parseBackfaceVisibility = parseBackfaceVisibility;
|
|
17
17
|
exports.parseBorderBlockWidth = parseBorderBlockWidth;
|
|
18
|
+
exports.parseBorderInlineStyle = parseBorderInlineStyle;
|
|
18
19
|
exports.parseBorderInlineWidth = parseBorderInlineWidth;
|
|
19
20
|
exports.parseBorderSideWidth = parseBorderSideWidth;
|
|
20
21
|
exports.parseBorderSideWidthDeclaration = parseBorderSideWidthDeclaration;
|
|
21
22
|
exports.parseBorderStyle = parseBorderStyle;
|
|
22
23
|
exports.parseBorderStyleDeclaration = parseBorderStyleDeclaration;
|
|
23
24
|
exports.parseBoxShadow = parseBoxShadow;
|
|
25
|
+
exports.parseBoxSizing = parseBoxSizing;
|
|
24
26
|
exports.parseCalcArguments = parseCalcArguments;
|
|
25
27
|
exports.parseCalcFn = parseCalcFn;
|
|
26
28
|
exports.parseColor = parseColor;
|
|
27
29
|
exports.parseColorDeclaration = parseColorDeclaration;
|
|
28
|
-
exports.
|
|
30
|
+
exports.parseColorOrAutoDeclaration = parseColorOrAutoDeclaration;
|
|
31
|
+
exports.parseCustomDeclaration = parseCustomDeclaration;
|
|
29
32
|
exports.parseDeclaration = parseDeclaration;
|
|
30
|
-
exports.parseDeclarationCustom = parseDeclarationCustom;
|
|
31
|
-
exports.parseDeclarationUnparsed = parseDeclarationUnparsed;
|
|
32
33
|
exports.parseDimension = parseDimension;
|
|
33
34
|
exports.parseDimensionPercentageFor_LengthValue = parseDimensionPercentageFor_LengthValue;
|
|
35
|
+
exports.parseDirection = parseDirection;
|
|
34
36
|
exports.parseDisplay = parseDisplay;
|
|
35
37
|
exports.parseEnv = parseEnv;
|
|
36
38
|
exports.parseFontColorDeclaration = parseFontColorDeclaration;
|
|
@@ -47,6 +49,7 @@ exports.parseJustifyContent = parseJustifyContent;
|
|
|
47
49
|
exports.parseLength = parseLength;
|
|
48
50
|
exports.parseLengthDeclaration = parseLengthDeclaration;
|
|
49
51
|
exports.parseLengthOrCoercePercentageToRuntime = parseLengthOrCoercePercentageToRuntime;
|
|
52
|
+
exports.parseLengthPercentageDeclaration = parseLengthPercentageDeclaration;
|
|
50
53
|
exports.parseLengthPercentageOrAuto = parseLengthPercentageOrAuto;
|
|
51
54
|
exports.parseLengthPercentageOrAutoDeclaration = parseLengthPercentageOrAutoDeclaration;
|
|
52
55
|
exports.parseLineHeight = parseLineHeight;
|
|
@@ -60,6 +63,7 @@ exports.parseSize = parseSize;
|
|
|
60
63
|
exports.parseSize2DDimensionPercentage = parseSize2DDimensionPercentage;
|
|
61
64
|
exports.parseSize2DDimensionPercentageDeclaration = parseSize2DDimensionPercentageDeclaration;
|
|
62
65
|
exports.parseSizeDeclaration = parseSizeDeclaration;
|
|
66
|
+
exports.parseSizeWithAutoDeclaration = parseSizeWithAutoDeclaration;
|
|
63
67
|
exports.parseTextAlign = parseTextAlign;
|
|
64
68
|
exports.parseTextDecorationLine = parseTextDecorationLine;
|
|
65
69
|
exports.parseTextDecorationLineDeclaration = parseTextDecorationLineDeclaration;
|
|
@@ -68,6 +72,7 @@ exports.parseTextShadow = parseTextShadow;
|
|
|
68
72
|
exports.parseTime = parseTime;
|
|
69
73
|
exports.parseTranslateProp = parseTranslateProp;
|
|
70
74
|
exports.parseUnparsed = parseUnparsed;
|
|
75
|
+
exports.parseUnparsedDeclaration = parseUnparsedDeclaration;
|
|
71
76
|
exports.parseUnresolvedColor = parseUnresolvedColor;
|
|
72
77
|
exports.parseUserSelect = parseUserSelect;
|
|
73
78
|
exports.parseVerticalAlign = parseVerticalAlign;
|
|
@@ -78,13 +83,15 @@ var _colorjs = _interopRequireDefault(require("colorjs.io"));
|
|
|
78
83
|
var _keyframes = require("./keyframes.js");
|
|
79
84
|
var _selectors = require("./selectors.js");
|
|
80
85
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
81
|
-
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto
|
|
86
|
+
// cSpell:ignore rcap,vmin,svmin,lvmin,dvmin,cqmin,vmax,svmax,lvmax,dvmax,cqmax,currentcolor,oklab,oklch,prophoto,squircle,oldstyle,nums
|
|
82
87
|
|
|
83
88
|
const CommaSeparator = Symbol("CommaSeparator");
|
|
84
89
|
const propertyRename = {
|
|
85
90
|
"background-image": "experimental_backgroundImage"
|
|
86
91
|
};
|
|
87
|
-
|
|
92
|
+
|
|
93
|
+
// TODO: We need a better way to handle this
|
|
94
|
+
const unparsedRuntimeParsing = new Set(["animation", "border", "box-shadow", "text-shadow", "transform", "scale", "rotate", "translate"]);
|
|
88
95
|
const parsers = {
|
|
89
96
|
"align-content": parseAlignContent,
|
|
90
97
|
"align-items": parseAlignItems,
|
|
@@ -99,42 +106,51 @@ const parsers = {
|
|
|
99
106
|
"animation-play-state": addAnimationValue,
|
|
100
107
|
"animation-timing-function": addAnimationValue,
|
|
101
108
|
"aspect-ratio": parseAspectRatio,
|
|
109
|
+
"backface-visibility": parseBackfaceVisibility,
|
|
102
110
|
"background-color": parseColorDeclaration,
|
|
103
111
|
"background-image": parseBackgroundImage,
|
|
104
112
|
"block-size": parseSizeDeclaration,
|
|
105
113
|
"border": parseBorder,
|
|
106
114
|
"border-block": parseBorderBlock,
|
|
107
|
-
"border-block-color":
|
|
115
|
+
"border-block-color": parseBorderColor,
|
|
108
116
|
"border-block-end": parseBorderBlockEnd,
|
|
109
117
|
"border-block-end-color": parseColorDeclaration,
|
|
110
118
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
111
119
|
"border-block-start": parseBorderBlockStart,
|
|
112
120
|
"border-block-start-color": parseColorDeclaration,
|
|
121
|
+
"border-block-start-style": parseBorderStyleDeclaration,
|
|
113
122
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
123
|
+
"border-block-style": parseBorderBlockStyle,
|
|
114
124
|
"border-block-width": parseBorderBlockWidth,
|
|
115
125
|
"border-bottom": parseBorderSide,
|
|
116
126
|
"border-bottom-color": parseColorDeclaration,
|
|
117
127
|
"border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
118
128
|
"border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
129
|
+
"border-bottom-style": parseBorderStyleDeclaration,
|
|
119
130
|
"border-bottom-width": parseBorderSideWidthDeclaration,
|
|
120
131
|
"border-color": parseBorderColor,
|
|
121
132
|
"border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
122
133
|
"border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
123
134
|
"border-inline": parseBorderInline,
|
|
124
|
-
"border-inline-color":
|
|
135
|
+
"border-inline-color": parseBorderColor,
|
|
125
136
|
"border-inline-end": parseBorderInlineEnd,
|
|
126
137
|
"border-inline-end-color": parseColorDeclaration,
|
|
138
|
+
"border-inline-end-style": parseBorderInlineStyle,
|
|
127
139
|
"border-inline-end-width": parseBorderSideWidthDeclaration,
|
|
128
140
|
"border-inline-start": parseBorderInlineStart,
|
|
129
141
|
"border-inline-start-color": parseColorDeclaration,
|
|
142
|
+
"border-inline-start-style": parseBorderInlineStyle,
|
|
130
143
|
"border-inline-start-width": parseBorderSideWidthDeclaration,
|
|
144
|
+
"border-inline-style": parseBorderInlineStyle,
|
|
131
145
|
"border-inline-width": parseBorderInlineWidth,
|
|
132
146
|
"border-left": parseBorderSide,
|
|
133
147
|
"border-left-color": parseColorDeclaration,
|
|
148
|
+
"border-left-style": parseBorderStyleDeclaration,
|
|
134
149
|
"border-left-width": parseBorderSideWidthDeclaration,
|
|
135
150
|
"border-radius": parseBorderRadius,
|
|
136
151
|
"border-right": parseBorderSide,
|
|
137
152
|
"border-right-color": parseColorDeclaration,
|
|
153
|
+
"border-right-style": parseBorderStyleDeclaration,
|
|
138
154
|
"border-right-width": parseBorderSideWidthDeclaration,
|
|
139
155
|
"border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
140
156
|
"border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
@@ -143,21 +159,24 @@ const parsers = {
|
|
|
143
159
|
"border-top-color": parseColorDeclaration,
|
|
144
160
|
"border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
145
161
|
"border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
162
|
+
"border-top-style": parseBorderStyleDeclaration,
|
|
146
163
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
147
164
|
"border-width": parseBorderWidth,
|
|
148
|
-
"bottom":
|
|
165
|
+
"bottom": parseSizeWithAutoDeclaration,
|
|
149
166
|
"box-shadow": parseBoxShadow,
|
|
150
|
-
"
|
|
167
|
+
"box-sizing": parseBoxSizing,
|
|
168
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
151
169
|
"color": parseFontColorDeclaration,
|
|
152
170
|
"column-gap": parseGap,
|
|
153
171
|
"container": parseContainer,
|
|
154
172
|
"container-name": parseContainerName,
|
|
155
173
|
"container-type": parseContainerType,
|
|
156
174
|
"display": parseDisplay,
|
|
175
|
+
"direction": parseDirection,
|
|
157
176
|
"fill": parseSVGPaint,
|
|
158
177
|
"filter": parseFilter,
|
|
159
178
|
"flex": parseFlex,
|
|
160
|
-
"flex-basis":
|
|
179
|
+
"flex-basis": parseLengthPercentageDeclaration,
|
|
161
180
|
"flex-direction": ({
|
|
162
181
|
value
|
|
163
182
|
}) => value,
|
|
@@ -182,26 +201,26 @@ const parsers = {
|
|
|
182
201
|
"inline-size": parseSizeDeclaration,
|
|
183
202
|
"inset": parseInset,
|
|
184
203
|
"inset-block": parseInsetBlock,
|
|
185
|
-
"inset-block-end":
|
|
186
|
-
"inset-block-start":
|
|
204
|
+
"inset-block-end": parseLengthPercentageDeclaration,
|
|
205
|
+
"inset-block-start": parseLengthPercentageDeclaration,
|
|
187
206
|
"inset-inline": parseInsetInline,
|
|
188
|
-
"inset-inline-end":
|
|
189
|
-
"inset-inline-start":
|
|
207
|
+
"inset-inline-end": parseLengthPercentageDeclaration,
|
|
208
|
+
"inset-inline-start": parseLengthPercentageDeclaration,
|
|
190
209
|
"justify-content": parseJustifyContent,
|
|
191
|
-
"left":
|
|
210
|
+
"left": parseSizeWithAutoDeclaration,
|
|
192
211
|
"letter-spacing": parseLetterSpacing,
|
|
193
212
|
"line-height": parseLineHeightDeclaration,
|
|
194
213
|
"margin": parseMargin,
|
|
195
214
|
"margin-block": parseMarginBlock,
|
|
196
215
|
"margin-block-end": parseLengthPercentageOrAutoDeclaration,
|
|
197
216
|
"margin-block-start": parseLengthPercentageOrAutoDeclaration,
|
|
198
|
-
"margin-bottom":
|
|
217
|
+
"margin-bottom": parseSizeWithAutoDeclaration,
|
|
199
218
|
"margin-inline": parseMarginInline,
|
|
200
219
|
"margin-inline-end": parseLengthPercentageOrAutoDeclaration,
|
|
201
220
|
"margin-inline-start": parseLengthPercentageOrAutoDeclaration,
|
|
202
|
-
"margin-left":
|
|
203
|
-
"margin-right":
|
|
204
|
-
"margin-top":
|
|
221
|
+
"margin-left": parseSizeWithAutoDeclaration,
|
|
222
|
+
"margin-right": parseSizeWithAutoDeclaration,
|
|
223
|
+
"margin-top": parseSizeWithAutoDeclaration,
|
|
205
224
|
"max-block-size": parseSizeDeclaration,
|
|
206
225
|
"max-height": parseSizeDeclaration,
|
|
207
226
|
"max-inline-size": parseSizeDeclaration,
|
|
@@ -212,21 +231,24 @@ const parsers = {
|
|
|
212
231
|
"min-width": parseSizeDeclaration,
|
|
213
232
|
"opacity": ({
|
|
214
233
|
value
|
|
215
|
-
}) => value,
|
|
234
|
+
}) => round(value),
|
|
235
|
+
"outline-color": parseColorDeclaration,
|
|
236
|
+
"outline-style": parseOutlineStyle,
|
|
237
|
+
"outline-width": parseBorderSideWidthDeclaration,
|
|
216
238
|
"overflow": parseOverflow,
|
|
217
239
|
"padding": parsePadding,
|
|
218
240
|
"padding-block": parsePaddingBlock,
|
|
219
|
-
"padding-block-end":
|
|
220
|
-
"padding-block-start":
|
|
241
|
+
"padding-block-end": parseLengthPercentageDeclaration,
|
|
242
|
+
"padding-block-start": parseLengthPercentageDeclaration,
|
|
221
243
|
"padding-bottom": parseSizeDeclaration,
|
|
222
244
|
"padding-inline": parsePaddingInline,
|
|
223
|
-
"padding-inline-end":
|
|
224
|
-
"padding-inline-start":
|
|
245
|
+
"padding-inline-end": parseLengthPercentageDeclaration,
|
|
246
|
+
"padding-inline-start": parseLengthPercentageDeclaration,
|
|
225
247
|
"padding-left": parseSizeDeclaration,
|
|
226
248
|
"padding-right": parseSizeDeclaration,
|
|
227
249
|
"padding-top": parseSizeDeclaration,
|
|
228
250
|
"position": parsePosition,
|
|
229
|
-
"right":
|
|
251
|
+
"right": parseSizeWithAutoDeclaration,
|
|
230
252
|
"rotate": parseRotate,
|
|
231
253
|
"row-gap": parseGap,
|
|
232
254
|
"scale": parseScale,
|
|
@@ -241,7 +263,7 @@ const parsers = {
|
|
|
241
263
|
"text-transform": ({
|
|
242
264
|
value
|
|
243
265
|
}) => value.case,
|
|
244
|
-
"top":
|
|
266
|
+
"top": parseSizeWithAutoDeclaration,
|
|
245
267
|
"transform": parseTransform,
|
|
246
268
|
"transition": addTransitionValue,
|
|
247
269
|
"transition-delay": addTransitionValue,
|
|
@@ -251,6 +273,7 @@ const parsers = {
|
|
|
251
273
|
"translate": parseTranslate,
|
|
252
274
|
"user-select": parseUserSelect,
|
|
253
275
|
"vertical-align": parseVerticalAlign,
|
|
276
|
+
"visibility": parseVisibility,
|
|
254
277
|
"width": parseSizeDeclaration,
|
|
255
278
|
"z-index": parseZIndex
|
|
256
279
|
};
|
|
@@ -266,9 +289,9 @@ function parseDeclaration(declaration, builder) {
|
|
|
266
289
|
return;
|
|
267
290
|
}
|
|
268
291
|
if (declaration.property === "unparsed") {
|
|
269
|
-
|
|
292
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
270
293
|
} else if (declaration.property === "custom") {
|
|
271
|
-
|
|
294
|
+
parseCustomDeclaration(declaration, builder);
|
|
272
295
|
} else {
|
|
273
296
|
parseWithParser(declaration, builder);
|
|
274
297
|
}
|
|
@@ -322,15 +345,25 @@ function parseBorderRadius({
|
|
|
322
345
|
"border-top-right-radius": parseSize2DDimensionPercentage(value.topRight, builder)
|
|
323
346
|
});
|
|
324
347
|
}
|
|
325
|
-
function parseBorderColor({
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
348
|
+
function parseBorderColor(declaration, builder) {
|
|
349
|
+
switch (declaration.property) {
|
|
350
|
+
case "border-color":
|
|
351
|
+
builder.addShorthand("border-color", {
|
|
352
|
+
"border-top-color": parseColor(declaration.value.top, builder),
|
|
353
|
+
"border-bottom-color": parseColor(declaration.value.bottom, builder),
|
|
354
|
+
"border-left-color": parseColor(declaration.value.left, builder),
|
|
355
|
+
"border-right-color": parseColor(declaration.value.right, builder)
|
|
356
|
+
});
|
|
357
|
+
break;
|
|
358
|
+
case "border-block-color":
|
|
359
|
+
builder.addDescriptor("border-top-color", parseColor(declaration.value.start, builder));
|
|
360
|
+
builder.addDescriptor("border-bottom-color", parseColor(declaration.value.end, builder));
|
|
361
|
+
break;
|
|
362
|
+
case "border-inline-color":
|
|
363
|
+
builder.addDescriptor("border-left-color", parseColor(declaration.value.start, builder));
|
|
364
|
+
builder.addDescriptor("border-right-color", parseColor(declaration.value.end, builder));
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
334
367
|
}
|
|
335
368
|
function parseBorderWidth({
|
|
336
369
|
value
|
|
@@ -361,46 +394,55 @@ function parseBorderSide({
|
|
|
361
394
|
function parseBorderBlock({
|
|
362
395
|
value
|
|
363
396
|
}, builder) {
|
|
364
|
-
builder.addDescriptor("border-
|
|
365
|
-
builder.addDescriptor("border-
|
|
366
|
-
builder.addDescriptor("border-
|
|
367
|
-
builder.addDescriptor("border-bottom-width", parseBorderSideWidth(value.width, builder));
|
|
397
|
+
builder.addDescriptor("border-block-color", parseColor(value.color, builder));
|
|
398
|
+
builder.addDescriptor("border-block-width", parseBorderSideWidth(value.width, builder));
|
|
399
|
+
builder.addDescriptor("border-block-style", parseBorderStyle(value.style, builder));
|
|
368
400
|
}
|
|
369
401
|
function parseBorderBlockStart({
|
|
370
402
|
value
|
|
371
403
|
}, builder) {
|
|
372
|
-
builder.addDescriptor("border-
|
|
373
|
-
builder.addDescriptor("border-
|
|
404
|
+
builder.addDescriptor("border-block-start-color", parseColor(value.color, builder));
|
|
405
|
+
builder.addDescriptor("border-block-start-width", parseBorderSideWidth(value.width, builder));
|
|
374
406
|
}
|
|
375
407
|
function parseBorderBlockEnd({
|
|
376
408
|
value
|
|
377
409
|
}, builder) {
|
|
378
|
-
builder.addDescriptor("border-
|
|
379
|
-
builder.addDescriptor("border-
|
|
410
|
+
builder.addDescriptor("border-block-end-color", parseColor(value.color, builder));
|
|
411
|
+
builder.addDescriptor("border-block-end-width", parseBorderSideWidth(value.width, builder));
|
|
380
412
|
}
|
|
381
413
|
function parseBorderInline({
|
|
382
414
|
value
|
|
383
415
|
}, builder) {
|
|
384
|
-
builder.addDescriptor("border-
|
|
385
|
-
builder.addDescriptor("border-
|
|
386
|
-
builder.addDescriptor("border-
|
|
387
|
-
builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
|
|
416
|
+
builder.addDescriptor("border-inline-color", parseColor(value.color, builder));
|
|
417
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(value.width, builder));
|
|
418
|
+
builder.addDescriptor("border-inline-style", parseBorderStyle(value.style, builder));
|
|
388
419
|
}
|
|
389
420
|
function parseBorderInlineStart({
|
|
390
421
|
value
|
|
391
422
|
}, builder) {
|
|
392
|
-
builder.addDescriptor("border-
|
|
393
|
-
builder.addDescriptor("border-
|
|
423
|
+
builder.addDescriptor("border-inline-start-color", parseColor(value.color, builder));
|
|
424
|
+
builder.addDescriptor("border-inline-start-width", parseBorderSideWidth(value.width, builder));
|
|
425
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(value.style, builder));
|
|
394
426
|
}
|
|
395
427
|
function parseBorderInlineEnd({
|
|
396
428
|
value
|
|
397
429
|
}, builder) {
|
|
398
|
-
builder.addDescriptor("border-
|
|
399
|
-
builder.addDescriptor("border-
|
|
430
|
+
builder.addDescriptor("border-inline-end-color", parseColor(value.color, builder));
|
|
431
|
+
builder.addDescriptor("border-inline-end-width", parseBorderSideWidth(value.width, builder));
|
|
432
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(value.style, builder));
|
|
400
433
|
}
|
|
401
434
|
function parseBorderInlineWidth(declaration, builder) {
|
|
402
|
-
builder.addDescriptor("border-
|
|
403
|
-
|
|
435
|
+
builder.addDescriptor("border-inline-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
436
|
+
}
|
|
437
|
+
function parseBorderInlineStyle(declaration, builder) {
|
|
438
|
+
if (typeof declaration.value === "string") {
|
|
439
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value, builder));
|
|
440
|
+
} else if (declaration.value.start === declaration.value.end) {
|
|
441
|
+
builder.addDescriptor(declaration.property, parseBorderStyle(declaration.value.start, builder));
|
|
442
|
+
} else {
|
|
443
|
+
builder.addDescriptor("border-inline-start-style", parseBorderStyle(declaration.value.start, builder));
|
|
444
|
+
builder.addDescriptor("border-inline-end-style", parseBorderStyle(declaration.value.end, builder));
|
|
445
|
+
}
|
|
404
446
|
}
|
|
405
447
|
function parseFlexFlow({
|
|
406
448
|
value
|
|
@@ -437,16 +479,24 @@ function parseMarginBlock({
|
|
|
437
479
|
value
|
|
438
480
|
}, builder) {
|
|
439
481
|
builder.addShorthand("margin-block", {
|
|
440
|
-
"margin-block-start": parseLengthPercentageOrAuto(value.blockStart, builder
|
|
441
|
-
|
|
482
|
+
"margin-block-start": parseLengthPercentageOrAuto(value.blockStart, builder, {
|
|
483
|
+
allowAuto: true
|
|
484
|
+
}),
|
|
485
|
+
"margin-block-end": parseLengthPercentageOrAuto(value.blockEnd, builder, {
|
|
486
|
+
allowAuto: true
|
|
487
|
+
})
|
|
442
488
|
});
|
|
443
489
|
}
|
|
444
490
|
function parseMarginInline({
|
|
445
491
|
value
|
|
446
492
|
}, builder) {
|
|
447
493
|
builder.addShorthand("margin-inline", {
|
|
448
|
-
"margin-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder
|
|
449
|
-
|
|
494
|
+
"margin-inline-start": parseLengthPercentageOrAuto(value.inlineStart, builder, {
|
|
495
|
+
allowAuto: true
|
|
496
|
+
}),
|
|
497
|
+
"margin-inline-end": parseLengthPercentageOrAuto(value.inlineEnd, builder, {
|
|
498
|
+
allowAuto: true
|
|
499
|
+
})
|
|
450
500
|
});
|
|
451
501
|
}
|
|
452
502
|
function parsePadding({
|
|
@@ -488,26 +538,26 @@ function parseFont({
|
|
|
488
538
|
function parseTransform({
|
|
489
539
|
value
|
|
490
540
|
}, builder) {
|
|
491
|
-
builder.addDescriptor("transform", [{}, "
|
|
541
|
+
builder.addDescriptor("transform", [{}, "transform", value.flatMap(t => {
|
|
492
542
|
switch (t.type) {
|
|
493
543
|
case "perspective":
|
|
494
|
-
return [[{}, "
|
|
544
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
495
545
|
case "translate":
|
|
496
|
-
return [[{}, "
|
|
546
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value[0], builder)], [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value[1], builder)]]];
|
|
497
547
|
case "translateX":
|
|
498
|
-
return [[{}, "
|
|
548
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
499
549
|
case "translateY":
|
|
500
|
-
return [[{}, "
|
|
550
|
+
return [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
501
551
|
case "rotate":
|
|
502
|
-
return [[{}, "
|
|
552
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
503
553
|
case "rotateX":
|
|
504
|
-
return [[{}, "
|
|
554
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
505
555
|
case "rotateY":
|
|
506
|
-
return [[{}, "
|
|
556
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
507
557
|
case "rotateZ":
|
|
508
|
-
return [[{}, "
|
|
558
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
509
559
|
case "scale":
|
|
510
|
-
return [[{}, "
|
|
560
|
+
return [[{}, "scaleX", parseLength(t.value[0], builder)], [{}, "scaleY", parseLength(t.value[1], builder)]];
|
|
511
561
|
case "scaleX":
|
|
512
562
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
513
563
|
case "scaleY":
|
|
@@ -539,9 +589,15 @@ function parseTranslate({
|
|
|
539
589
|
function parseRotate({
|
|
540
590
|
value
|
|
541
591
|
}, builder) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
592
|
+
if (value.x) {
|
|
593
|
+
builder.addDescriptor("rotateX", [{}, "rotateX", parseAngle(value.angle, builder)]);
|
|
594
|
+
}
|
|
595
|
+
if (value.y) {
|
|
596
|
+
builder.addDescriptor("rotateY", [{}, "rotateY", parseAngle(value.angle, builder)]);
|
|
597
|
+
}
|
|
598
|
+
if (value.z) {
|
|
599
|
+
builder.addDescriptor("rotateZ", [{}, "rotateZ", parseAngle(value.angle, builder)]);
|
|
600
|
+
}
|
|
545
601
|
}
|
|
546
602
|
function parseScale({
|
|
547
603
|
value
|
|
@@ -583,7 +639,8 @@ function parseZIndex({
|
|
|
583
639
|
return;
|
|
584
640
|
}
|
|
585
641
|
}
|
|
586
|
-
function parseContainerType(
|
|
642
|
+
function parseContainerType(_declaration, builder) {
|
|
643
|
+
builder.addContainer(["___default___"]);
|
|
587
644
|
return;
|
|
588
645
|
}
|
|
589
646
|
function parseContainerName({
|
|
@@ -598,7 +655,7 @@ function parseContainer({
|
|
|
598
655
|
builder.addContainer(value.name.type === "none" ? false : value.name.value);
|
|
599
656
|
return;
|
|
600
657
|
}
|
|
601
|
-
function
|
|
658
|
+
function parseUnparsedDeclaration(declaration, builder) {
|
|
602
659
|
let property = declaration.value.propertyId.property;
|
|
603
660
|
if (!(property in parsers)) {
|
|
604
661
|
builder.addWarning("property", property);
|
|
@@ -619,14 +676,14 @@ function parseDeclarationUnparsed(declaration, builder) {
|
|
|
619
676
|
*/
|
|
620
677
|
builder.descriptorProperty = property;
|
|
621
678
|
if (unparsedRuntimeParsing.has(property)) {
|
|
622
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
679
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
623
680
|
if (property === "animation") {
|
|
624
|
-
builder.addDescriptor("animation", [{},
|
|
681
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
625
682
|
} else {
|
|
626
|
-
builder.addDescriptor(property, [{},
|
|
683
|
+
builder.addDescriptor(property, [{}, (0, _selectors.toRNProperty)(property), args, 1]);
|
|
627
684
|
}
|
|
628
685
|
} else {
|
|
629
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
686
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
630
687
|
builder.addDescriptor(property, value);
|
|
631
688
|
if (property === "font-size") {
|
|
632
689
|
builder.addDescriptor("--__rn-css-em", value);
|
|
@@ -636,22 +693,31 @@ function parseDeclarationUnparsed(declaration, builder) {
|
|
|
636
693
|
}
|
|
637
694
|
}
|
|
638
695
|
}
|
|
639
|
-
function
|
|
696
|
+
function parseCustomDeclaration(declaration, builder) {
|
|
640
697
|
const property = declaration.value.name;
|
|
641
|
-
if (
|
|
642
|
-
builder.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
698
|
+
if (property === "-webkit-line-clamp") {
|
|
699
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
700
|
+
} else if (property === "-rn-ripple-style") {
|
|
701
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property) === "borderless");
|
|
702
|
+
} else if (property === "object-fit") {
|
|
703
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1046
|
|
704
|
+
parseObjectFit(declaration.value, builder);
|
|
705
|
+
} else if (property === "object-position") {
|
|
706
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1047
|
|
707
|
+
parseObjectPosition(declaration.value, builder);
|
|
708
|
+
} else if (property === "outline-offset") {
|
|
709
|
+
// https://github.com/parcel-bundler/lightningcss/issues/1048
|
|
710
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
711
|
+
} else if (property === "corner-shape") {
|
|
712
|
+
parseCornerShape(declaration.value, builder);
|
|
713
|
+
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
714
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
649
715
|
} else {
|
|
650
716
|
builder.addWarning("property", declaration.value.name);
|
|
651
717
|
}
|
|
652
718
|
}
|
|
653
|
-
function reduceParseUnparsed(tokenOrValues, builder) {
|
|
654
|
-
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder)).filter(v => v !== undefined);
|
|
719
|
+
function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
|
|
720
|
+
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
|
|
655
721
|
if (result.length === 0) {
|
|
656
722
|
return undefined;
|
|
657
723
|
}
|
|
@@ -665,6 +731,9 @@ function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
665
731
|
currentGroup.push(value);
|
|
666
732
|
}
|
|
667
733
|
}
|
|
734
|
+
|
|
735
|
+
// Groups are the tokens grouped together by comma location
|
|
736
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
668
737
|
groups = groups.flatMap(group => {
|
|
669
738
|
if (!Array.isArray(group)) {
|
|
670
739
|
return [];
|
|
@@ -678,21 +747,26 @@ function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
678
747
|
} else {
|
|
679
748
|
return [first];
|
|
680
749
|
}
|
|
750
|
+
} else if (
|
|
751
|
+
// This is a special case for <ratio> values
|
|
752
|
+
group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
|
|
753
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
754
|
+
return [group.join(" ")];
|
|
681
755
|
} else {
|
|
682
756
|
return [group];
|
|
683
757
|
}
|
|
684
758
|
});
|
|
685
759
|
return groups.length === 1 ? groups[0] : groups;
|
|
686
760
|
}
|
|
687
|
-
function unparsedFunction(token, builder) {
|
|
688
|
-
return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder)];
|
|
761
|
+
function unparsedFunction(token, builder, property, allowAuto) {
|
|
762
|
+
return [{}, (0, _selectors.toRNProperty)(token.value.name), reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
|
|
689
763
|
}
|
|
690
764
|
|
|
691
765
|
/**
|
|
692
766
|
* When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
|
|
693
767
|
* This export function best efforts parsing it into a export function that we can evaluate at runtime
|
|
694
768
|
*/
|
|
695
|
-
function parseUnparsed(tokenOrValue, builder, allowAuto =
|
|
769
|
+
function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
|
|
696
770
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
697
771
|
return;
|
|
698
772
|
}
|
|
@@ -711,7 +785,7 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
711
785
|
return round(tokenOrValue);
|
|
712
786
|
}
|
|
713
787
|
if (Array.isArray(tokenOrValue)) {
|
|
714
|
-
const args = reduceParseUnparsed(tokenOrValue, builder);
|
|
788
|
+
const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
|
|
715
789
|
if (!args) return;
|
|
716
790
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
717
791
|
return args;
|
|
@@ -719,12 +793,12 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
719
793
|
switch (tokenOrValue.type) {
|
|
720
794
|
case "unresolved-color":
|
|
721
795
|
{
|
|
722
|
-
return parseUnresolvedColor(tokenOrValue.value, builder);
|
|
796
|
+
return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
|
|
723
797
|
}
|
|
724
798
|
case "var":
|
|
725
799
|
{
|
|
726
800
|
let args = tokenOrValue.value.name.ident.slice(2);
|
|
727
|
-
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
|
|
801
|
+
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
|
|
728
802
|
if (fallback !== undefined) {
|
|
729
803
|
args = [args, fallback];
|
|
730
804
|
}
|
|
@@ -733,50 +807,51 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
733
807
|
case "function":
|
|
734
808
|
{
|
|
735
809
|
switch (tokenOrValue.value.name) {
|
|
736
|
-
case "
|
|
737
|
-
case "rotate":
|
|
738
|
-
case "rotateX":
|
|
739
|
-
case "rotateY":
|
|
740
|
-
case "skewX":
|
|
741
|
-
case "skewY":
|
|
742
|
-
case "scale":
|
|
743
|
-
case "scaleX":
|
|
744
|
-
case "scaleY":
|
|
745
|
-
case "translateX":
|
|
746
|
-
case "translateY":
|
|
747
|
-
tokenOrValue.value.name = `@${tokenOrValue.value.name}`;
|
|
748
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
810
|
+
case "blur":
|
|
749
811
|
case "brightness":
|
|
750
812
|
case "contrast":
|
|
751
813
|
case "cubic-bezier":
|
|
752
814
|
case "drop-shadow":
|
|
753
815
|
case "fontScale":
|
|
816
|
+
case "getPixelSizeForLayoutSize":
|
|
754
817
|
case "grayscale":
|
|
755
818
|
case "hsl":
|
|
756
819
|
case "hsla":
|
|
757
820
|
case "hue-rotate":
|
|
758
821
|
case "invert":
|
|
759
|
-
case "linear-gradient":
|
|
760
822
|
case "opacity":
|
|
761
823
|
case "pixelScale":
|
|
762
|
-
case "pixelSizeForLayoutSize":
|
|
763
824
|
case "platformColor":
|
|
764
|
-
case "radial-gradient":
|
|
765
825
|
case "rgb":
|
|
766
826
|
case "rgba":
|
|
827
|
+
case "rotate":
|
|
828
|
+
case "rotateX":
|
|
829
|
+
case "rotateY":
|
|
767
830
|
case "roundToNearestPixel":
|
|
768
831
|
case "saturate":
|
|
832
|
+
case "scale":
|
|
833
|
+
case "scaleX":
|
|
834
|
+
case "scaleY":
|
|
769
835
|
case "sepia":
|
|
770
836
|
case "shadow":
|
|
837
|
+
case "skewX":
|
|
838
|
+
case "skewY":
|
|
771
839
|
case "steps":
|
|
772
|
-
|
|
840
|
+
case "translate":
|
|
841
|
+
case "translateX":
|
|
842
|
+
case "translateY":
|
|
843
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
844
|
+
case "linear-gradient":
|
|
845
|
+
case "radial-gradient":
|
|
846
|
+
// These are special as React Native requires the '-' in their name
|
|
847
|
+
return [{}, tokenOrValue.value.name, reduceParseUnparsed(tokenOrValue.value.arguments, builder, property, allowAuto)];
|
|
773
848
|
case "hairlineWidth":
|
|
774
849
|
return [{}, tokenOrValue.value.name, []];
|
|
775
850
|
case "calc":
|
|
776
851
|
case "max":
|
|
777
852
|
case "min":
|
|
778
853
|
case "clamp":
|
|
779
|
-
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder);
|
|
854
|
+
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
|
|
780
855
|
default:
|
|
781
856
|
{
|
|
782
857
|
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
@@ -798,7 +873,7 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
798
873
|
builder.addWarning("value", value);
|
|
799
874
|
return;
|
|
800
875
|
}
|
|
801
|
-
if (value === "inherit") {
|
|
876
|
+
if (value === "inherit" || value === "initial") {
|
|
802
877
|
builder.addWarning("value", value);
|
|
803
878
|
return;
|
|
804
879
|
} else if (value === "currentcolor") {
|
|
@@ -808,6 +883,8 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
808
883
|
return true;
|
|
809
884
|
} else if (value === "false") {
|
|
810
885
|
return false;
|
|
886
|
+
} else if (value === "infinity") {
|
|
887
|
+
return Number.MAX_SAFE_INTEGER;
|
|
811
888
|
} else {
|
|
812
889
|
return value;
|
|
813
890
|
}
|
|
@@ -825,11 +902,17 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
825
902
|
return parseDimension(tokenOrValue.value, builder);
|
|
826
903
|
case "comma":
|
|
827
904
|
return CommaSeparator;
|
|
905
|
+
case "delim":
|
|
906
|
+
{
|
|
907
|
+
if (tokenOrValue.value.value === "/") {
|
|
908
|
+
return tokenOrValue.value.value;
|
|
909
|
+
}
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
828
912
|
case "at-keyword":
|
|
829
913
|
case "hash":
|
|
830
914
|
case "id-hash":
|
|
831
915
|
case "unquoted-url":
|
|
832
|
-
case "delim":
|
|
833
916
|
case "white-space":
|
|
834
917
|
case "comment":
|
|
835
918
|
case "colon":
|
|
@@ -893,7 +976,9 @@ function parseLength(length, builder) {
|
|
|
893
976
|
} else if (length.value === -Infinity) {
|
|
894
977
|
return -9999;
|
|
895
978
|
} else {
|
|
896
|
-
|
|
979
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
980
|
+
const value = Math.max(Math.min(length.value, Number.MAX_SAFE_INTEGER), Number.MIN_SAFE_INTEGER);
|
|
981
|
+
return round(value);
|
|
897
982
|
}
|
|
898
983
|
}
|
|
899
984
|
case "rem":
|
|
@@ -997,6 +1082,11 @@ function parseAngle(angle, builder) {
|
|
|
997
1082
|
function parseSizeDeclaration(declaration, builder) {
|
|
998
1083
|
return parseSize(declaration.value, builder);
|
|
999
1084
|
}
|
|
1085
|
+
function parseSizeWithAutoDeclaration(declaration, builder) {
|
|
1086
|
+
return parseSize(declaration.value, builder, {
|
|
1087
|
+
allowAuto: true
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1000
1090
|
function parsePointerEvents({
|
|
1001
1091
|
value
|
|
1002
1092
|
}, builder) {
|
|
@@ -1048,7 +1138,7 @@ function parseSize(size, builder, options, {
|
|
|
1048
1138
|
}
|
|
1049
1139
|
return;
|
|
1050
1140
|
}
|
|
1051
|
-
function
|
|
1141
|
+
function parseColorOrAutoDeclaration({
|
|
1052
1142
|
value
|
|
1053
1143
|
}, builder) {
|
|
1054
1144
|
if (value.type === "auto") {
|
|
@@ -1212,9 +1302,14 @@ function parseColor(cssColor, builder) {
|
|
|
1212
1302
|
});
|
|
1213
1303
|
}
|
|
1214
1304
|
}
|
|
1215
|
-
function
|
|
1305
|
+
function parseLengthPercentageDeclaration(value, builder) {
|
|
1216
1306
|
return parseLengthPercentageOrAuto(value.value, builder);
|
|
1217
1307
|
}
|
|
1308
|
+
function parseLengthPercentageOrAutoDeclaration(value, builder) {
|
|
1309
|
+
return parseLengthPercentageOrAuto(value.value, builder, {
|
|
1310
|
+
allowAuto: true
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1218
1313
|
function parseLengthPercentageOrAuto(lengthPercentageOrAuto, builder, {
|
|
1219
1314
|
allowAuto = false
|
|
1220
1315
|
} = {}) {
|
|
@@ -1438,19 +1533,28 @@ function parseBorderStyle(value, builder) {
|
|
|
1438
1533
|
builder.addWarning("value", value.top);
|
|
1439
1534
|
return undefined;
|
|
1440
1535
|
}
|
|
1441
|
-
function parseBorderBlockColor({
|
|
1442
|
-
value
|
|
1443
|
-
}, builder) {
|
|
1444
|
-
builder.addDescriptor("border-top-color", parseColor(value.start, builder));
|
|
1445
|
-
builder.addDescriptor("border-bottom-color", parseColor(value.end, builder));
|
|
1446
|
-
return;
|
|
1447
|
-
}
|
|
1448
1536
|
function parseBorderBlockWidth(declaration, builder) {
|
|
1449
|
-
|
|
1450
|
-
|
|
1537
|
+
const start = parseBorderSideWidth(declaration.value.start, builder);
|
|
1538
|
+
const end = parseBorderSideWidth(declaration.value.end, builder);
|
|
1539
|
+
if (start === end) {
|
|
1540
|
+
builder.addDescriptor("border-block-width", start);
|
|
1541
|
+
} else {
|
|
1542
|
+
builder.addDescriptor("border-block-start-width", start);
|
|
1543
|
+
builder.addDescriptor("border-block-end-width", end);
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
function parseBorderBlockStyle(declaration, builder) {
|
|
1547
|
+
const start = parseBorderStyle(declaration.value.start, builder);
|
|
1548
|
+
const end = parseBorderStyle(declaration.value.end, builder);
|
|
1549
|
+
if (start == end) {
|
|
1550
|
+
builder.addDescriptor("border-block-style", start);
|
|
1551
|
+
} else {
|
|
1552
|
+
builder.addDescriptor("border-block-start-style", start);
|
|
1553
|
+
builder.addDescriptor("border-block-end-style", end);
|
|
1554
|
+
}
|
|
1451
1555
|
}
|
|
1452
1556
|
function parseBorderSideWidthDeclaration(declaration, builder) {
|
|
1453
|
-
|
|
1557
|
+
builder.addDescriptor(declaration.property, parseBorderSideWidth(declaration.value, builder));
|
|
1454
1558
|
}
|
|
1455
1559
|
function parseBorderSideWidth(value, builder) {
|
|
1456
1560
|
if (value.type === "length") {
|
|
@@ -1605,6 +1709,13 @@ function parseBoxShadow({
|
|
|
1605
1709
|
builder.addDescriptor(`boxShadow.[${index}].inset`, shadow.inset ? true : undefined);
|
|
1606
1710
|
}
|
|
1607
1711
|
}
|
|
1712
|
+
function parseBoxSizing(declaration, builder) {
|
|
1713
|
+
if (["border-box", "content-box"].includes(declaration.value)) {
|
|
1714
|
+
return declaration.value;
|
|
1715
|
+
}
|
|
1716
|
+
builder.addWarning("value", declaration.value);
|
|
1717
|
+
return undefined;
|
|
1718
|
+
}
|
|
1608
1719
|
function parseDisplay({
|
|
1609
1720
|
value
|
|
1610
1721
|
}, builder) {
|
|
@@ -1660,6 +1771,14 @@ function parseDisplay({
|
|
|
1660
1771
|
}
|
|
1661
1772
|
}
|
|
1662
1773
|
}
|
|
1774
|
+
function parseDirection(declaration, builder) {
|
|
1775
|
+
if (["ltr", "rtl"].includes(declaration.value)) {
|
|
1776
|
+
builder.addDescriptor("direction", declaration.value);
|
|
1777
|
+
builder.addDescriptor("--__rn-css-direction", declaration.value);
|
|
1778
|
+
}
|
|
1779
|
+
builder.addWarning("value", declaration.value);
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1663
1782
|
function parseAspectRatio({
|
|
1664
1783
|
value
|
|
1665
1784
|
}) {
|
|
@@ -1676,6 +1795,16 @@ function parseAspectRatio({
|
|
|
1676
1795
|
}
|
|
1677
1796
|
}
|
|
1678
1797
|
}
|
|
1798
|
+
function parseBackfaceVisibility({
|
|
1799
|
+
value
|
|
1800
|
+
}, builder) {
|
|
1801
|
+
if (["visible", "hidden"].includes(value)) {
|
|
1802
|
+
return value;
|
|
1803
|
+
} else {
|
|
1804
|
+
builder.addWarning("value", value);
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1679
1808
|
function parseDimension({
|
|
1680
1809
|
unit,
|
|
1681
1810
|
value
|
|
@@ -1711,14 +1840,18 @@ function parseUserSelect({
|
|
|
1711
1840
|
}
|
|
1712
1841
|
}
|
|
1713
1842
|
function parseSVGPaint({
|
|
1714
|
-
value
|
|
1843
|
+
value,
|
|
1844
|
+
property
|
|
1715
1845
|
}, builder) {
|
|
1846
|
+
let parsedValue;
|
|
1716
1847
|
if (value.type === "none") {
|
|
1717
|
-
|
|
1848
|
+
parsedValue = "transparent";
|
|
1718
1849
|
} else if (value.type === "color") {
|
|
1719
|
-
|
|
1850
|
+
parsedValue = parseColor(value.value, builder);
|
|
1851
|
+
} else {
|
|
1852
|
+
return;
|
|
1720
1853
|
}
|
|
1721
|
-
|
|
1854
|
+
builder.addDescriptor(property, parsedValue);
|
|
1722
1855
|
}
|
|
1723
1856
|
function round(number) {
|
|
1724
1857
|
return Math.round((number + Number.EPSILON) * 10000) / 10000;
|
|
@@ -1732,7 +1865,7 @@ function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
|
1732
1865
|
return parseLength(value.value, builder);
|
|
1733
1866
|
}
|
|
1734
1867
|
}
|
|
1735
|
-
const
|
|
1868
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
1736
1869
|
function parseEnv(value, builder) {
|
|
1737
1870
|
switch (value.name.type) {
|
|
1738
1871
|
case "ua":
|
|
@@ -1741,7 +1874,7 @@ function parseEnv(value, builder) {
|
|
|
1741
1874
|
case "safe-area-inset-right":
|
|
1742
1875
|
case "safe-area-inset-bottom":
|
|
1743
1876
|
case "safe-area-inset-left":
|
|
1744
|
-
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder)], 1];
|
|
1877
|
+
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
|
|
1745
1878
|
case "viewport-segment-width":
|
|
1746
1879
|
case "viewport-segment-height":
|
|
1747
1880
|
case "viewport-segment-top":
|
|
@@ -1755,17 +1888,16 @@ function parseEnv(value, builder) {
|
|
|
1755
1888
|
}
|
|
1756
1889
|
return;
|
|
1757
1890
|
}
|
|
1758
|
-
function parseCalcFn(name, tokens, builder) {
|
|
1759
|
-
const args = parseCalcArguments(tokens, builder);
|
|
1891
|
+
function parseCalcFn(name, tokens, builder, property) {
|
|
1892
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
1760
1893
|
if (args) {
|
|
1761
1894
|
return [{}, name, args];
|
|
1762
1895
|
}
|
|
1763
1896
|
return;
|
|
1764
1897
|
}
|
|
1765
|
-
function parseCalcArguments([...args], builder) {
|
|
1898
|
+
function parseCalcArguments([...args], builder, property) {
|
|
1766
1899
|
const parsed = [];
|
|
1767
|
-
|
|
1768
|
-
for (const [currentIndex, arg] of args.entries()) {
|
|
1900
|
+
for (const arg of args) {
|
|
1769
1901
|
switch (arg.type) {
|
|
1770
1902
|
case "env":
|
|
1771
1903
|
{
|
|
@@ -1776,7 +1908,7 @@ function parseCalcArguments([...args], builder) {
|
|
|
1776
1908
|
case "function":
|
|
1777
1909
|
case "unresolved-color":
|
|
1778
1910
|
{
|
|
1779
|
-
const value = parseUnparsed(arg, builder);
|
|
1911
|
+
const value = parseUnparsed(arg, builder, property);
|
|
1780
1912
|
if (value === undefined) {
|
|
1781
1913
|
return undefined;
|
|
1782
1914
|
}
|
|
@@ -1811,44 +1943,21 @@ function parseCalcArguments([...args], builder) {
|
|
|
1811
1943
|
}
|
|
1812
1944
|
break;
|
|
1813
1945
|
case "percentage":
|
|
1814
|
-
|
|
1815
|
-
if (mode !== "percentage") return;
|
|
1816
|
-
parsed.push(`${arg.value.value * 100}%`);
|
|
1946
|
+
parsed.push(`${round(arg.value.value * 100)}%`);
|
|
1817
1947
|
break;
|
|
1818
1948
|
case "number":
|
|
1819
1949
|
{
|
|
1820
|
-
|
|
1821
|
-
if (mode !== "number") return;
|
|
1822
|
-
parsed.push(arg.value.value);
|
|
1950
|
+
parsed.push(round(arg.value.value));
|
|
1823
1951
|
break;
|
|
1824
1952
|
}
|
|
1825
1953
|
case "parenthesis-block":
|
|
1826
1954
|
{
|
|
1827
|
-
|
|
1828
|
-
* If we have a parenthesis block, we just treat it as a nested calc function
|
|
1829
|
-
* Because there could be multiple parenthesis blocks, this is recursive
|
|
1830
|
-
*/
|
|
1831
|
-
let closeParenthesisIndex = -1;
|
|
1832
|
-
for (let index = args.length - 1; index > 0; index--) {
|
|
1833
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1834
|
-
const value = args[index];
|
|
1835
|
-
if (value.type === "token" && value.value.type === "close-parenthesis") {
|
|
1836
|
-
closeParenthesisIndex = index;
|
|
1837
|
-
break;
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
if (closeParenthesisIndex === -1) {
|
|
1841
|
-
return;
|
|
1842
|
-
}
|
|
1843
|
-
const innerCalcArgs = args
|
|
1844
|
-
// Extract the inner calcArgs including the parenthesis. This mutates args
|
|
1845
|
-
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
1846
|
-
// Then drop the surrounding parenthesis
|
|
1847
|
-
.slice(1, -1);
|
|
1848
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
1955
|
+
parsed.push("(");
|
|
1849
1956
|
break;
|
|
1850
1957
|
}
|
|
1851
1958
|
case "close-parenthesis":
|
|
1959
|
+
parsed.push(")");
|
|
1960
|
+
break;
|
|
1852
1961
|
case "string":
|
|
1853
1962
|
case "function":
|
|
1854
1963
|
case "ident":
|
|
@@ -1886,20 +1995,20 @@ function parseTranslateProp(value, prop, builder) {
|
|
|
1886
1995
|
}
|
|
1887
1996
|
return parseLength(value[prop], builder);
|
|
1888
1997
|
}
|
|
1889
|
-
function parseUnresolvedColor(color, builder) {
|
|
1998
|
+
function parseUnresolvedColor(color, builder, property, allowAuto) {
|
|
1890
1999
|
switch (color.type) {
|
|
1891
2000
|
case "rgb":
|
|
1892
|
-
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder)]];
|
|
2001
|
+
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
|
|
1893
2002
|
case "hsl":
|
|
1894
|
-
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)]];
|
|
2003
|
+
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
|
|
1895
2004
|
case "light-dark":
|
|
1896
2005
|
{
|
|
1897
2006
|
const extraRule = builder.extendRule({
|
|
1898
2007
|
m: [["=", "prefers-color-scheme", "dark"]]
|
|
1899
2008
|
});
|
|
1900
|
-
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder), false, extraRule);
|
|
2009
|
+
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
|
|
1901
2010
|
builder.addExtraRule(extraRule);
|
|
1902
|
-
return reduceParseUnparsed(color.light, builder);
|
|
2011
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
1903
2012
|
}
|
|
1904
2013
|
default:
|
|
1905
2014
|
color;
|
|
@@ -1961,7 +2070,7 @@ function addTransitionValue(declaration, builder) {
|
|
|
1961
2070
|
}
|
|
1962
2071
|
case "transition-property":
|
|
1963
2072
|
{
|
|
1964
|
-
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)));
|
|
2073
|
+
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)));
|
|
1965
2074
|
return;
|
|
1966
2075
|
}
|
|
1967
2076
|
case "transition-duration":
|
|
@@ -2058,7 +2167,7 @@ function parseGradient(gradient, builder) {
|
|
|
2058
2167
|
switch (gradient.type) {
|
|
2059
2168
|
case "linear":
|
|
2060
2169
|
{
|
|
2061
|
-
return [{}, "
|
|
2170
|
+
return [{}, "linear-gradient", [parseLineDirection(gradient.direction, builder), ...gradient.items.map(item => parseGradientItem(item, builder))]];
|
|
2062
2171
|
}
|
|
2063
2172
|
}
|
|
2064
2173
|
return;
|
|
@@ -2093,6 +2202,43 @@ function parseGradientItem(item, builder) {
|
|
|
2093
2202
|
return parseLength(item.value, builder);
|
|
2094
2203
|
}
|
|
2095
2204
|
}
|
|
2205
|
+
function parseObjectFit(declaration, builder) {
|
|
2206
|
+
builder.addMapping({
|
|
2207
|
+
"object-fit": "contentFit"
|
|
2208
|
+
});
|
|
2209
|
+
builder.addDescriptor("object-fit", parseUnparsed(declaration.value, builder, "object-fit"));
|
|
2210
|
+
}
|
|
2211
|
+
function parseObjectPosition(declaration, builder) {
|
|
2212
|
+
builder.addMapping({
|
|
2213
|
+
"object-position": "contentPosition"
|
|
2214
|
+
});
|
|
2215
|
+
builder.addDescriptor("object-position", [{}, "join", [parseUnparsed(declaration.value, builder, "object-position"), " "]]);
|
|
2216
|
+
}
|
|
2217
|
+
function parseCornerShape(declaration, builder) {
|
|
2218
|
+
const shape = parseUnparsed(declaration.value, builder, "corner-shape");
|
|
2219
|
+
if (shape === "round") {
|
|
2220
|
+
builder.addDescriptor("borderCurve", "circular");
|
|
2221
|
+
} else if (shape === "squircle") {
|
|
2222
|
+
builder.addDescriptor("borderCurve", "continuous");
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
function parseVisibility(declaration, builder) {
|
|
2226
|
+
if (declaration.value === "visible") {
|
|
2227
|
+
builder.addDescriptor("opacity", 1);
|
|
2228
|
+
} else if (declaration.value === "hidden") {
|
|
2229
|
+
builder.addDescriptor("opacity", 0);
|
|
2230
|
+
} else {
|
|
2231
|
+
builder.addWarning("value", declaration.value);
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
function parseOutlineStyle(declaration, builder) {
|
|
2235
|
+
const allowed = ["solid", "dotted", "dashed"];
|
|
2236
|
+
if (declaration.value.type !== "auto" && allowed.includes(declaration.value.value)) {
|
|
2237
|
+
builder.addDescriptor("outlineStyle", declaration.value.value);
|
|
2238
|
+
} else {
|
|
2239
|
+
builder.addWarning("value", declaration.value.type === "auto" ? "auto" : declaration.value.value);
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2096
2242
|
function parseFilter(declaration, builder) {
|
|
2097
2243
|
if (declaration.value.type === "none") {
|
|
2098
2244
|
return "unset";
|
|
@@ -2115,6 +2261,7 @@ function parseFilter(declaration, builder) {
|
|
|
2115
2261
|
[value.type]: parseAngle(value.value, builder)
|
|
2116
2262
|
};
|
|
2117
2263
|
case "drop-shadow":
|
|
2264
|
+
return [{}, (0, _selectors.toRNProperty)(value.type), [parseLength(value.value.xOffset, builder), parseLength(value.value.yOffset, builder), parseLength(value.value.blur, builder), parseColor(value.value.color, builder)]];
|
|
2118
2265
|
case "url":
|
|
2119
2266
|
return;
|
|
2120
2267
|
}
|