react-native-css 3.0.0-nightly.61014be → 3.0.0-nightly.8dd703d
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 +16 -3
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/attributes.test.js +1 -1
- package/dist/commonjs/compiler/attributes.test.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +26 -17
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +195 -94
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +7 -7
- 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/selector-builder.js +457 -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 +122 -43
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/jest/index.js +33 -10
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +1 -1
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/poison.pill.js +4 -1
- package/dist/commonjs/poison.pill.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 +28 -21
- package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +10 -46
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +19 -17
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/injection.js +3 -2
- package/dist/commonjs/runtime/native/injection.js.map +1 -1
- package/dist/commonjs/runtime/native/react/interaction.js +10 -10
- package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +9 -9
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/react/useNativeCss.js +3 -2
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +1 -12
- 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/root.js +28 -0
- package/dist/commonjs/runtime/native/root.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js +56 -48
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/defaults.js +1 -1
- package/dist/commonjs/runtime/native/styles/defaults.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/functions/animation-timing.js +34 -0
- package/dist/commonjs/runtime/native/styles/functions/animation-timing.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
- package/dist/commonjs/runtime/native/styles/functions/calc.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{filters.js → functions/filters.js} +3 -3
- package/dist/commonjs/runtime/native/styles/functions/filters.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js +61 -0
- package/dist/commonjs/runtime/native/styles/functions/index.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +3 -3
- package/dist/commonjs/runtime/native/styles/functions/platform-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js +83 -0
- package/dist/commonjs/runtime/native/styles/functions/transform-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/index.js +12 -12
- package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/resolve.js +21 -44
- package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
- package/dist/commonjs/runtime/native/styles/shorthands/_handler.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{animation.js → shorthands/animation.js} +5 -36
- package/dist/commonjs/runtime/native/styles/shorthands/animation.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{border.js → shorthands/border.js} +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/border.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +3 -3
- package/dist/commonjs/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/shorthands/index.js +61 -0
- package/dist/commonjs/runtime/native/styles/shorthands/index.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +2 -2
- package/dist/commonjs/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/units.js +7 -4
- 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 +25 -5
- 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/module/compiler/atRules.js +16 -3
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/attributes.test.js +1 -1
- package/dist/module/compiler/attributes.test.js.map +1 -1
- package/dist/module/compiler/compiler.js +26 -17
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +190 -90
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +7 -7
- 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/selector-builder.js +452 -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 +121 -42
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/jest/index.js +32 -10
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +1 -1
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/poison.pill.js +4 -1
- package/dist/module/poison.pill.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 +28 -21
- package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/module/runtime/native/conditions/guards.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +10 -46
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +19 -17
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/injection.js +2 -1
- package/dist/module/runtime/native/injection.js.map +1 -1
- package/dist/module/runtime/native/react/interaction.js +10 -10
- package/dist/module/runtime/native/react/interaction.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +9 -9
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js +2 -1
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +0 -11
- 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/root.js +24 -0
- package/dist/module/runtime/native/root.js.map +1 -0
- package/dist/module/runtime/native/styles/calculate-props.js +57 -49
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/defaults.js +1 -1
- package/dist/module/runtime/native/styles/defaults.js.map +1 -1
- package/dist/module/runtime/native/styles/functions/animation-timing.js +30 -0
- package/dist/module/runtime/native/styles/functions/animation-timing.js.map +1 -0
- package/dist/module/runtime/native/styles/{calc.js → functions/calc.js} +1 -1
- package/dist/module/runtime/native/styles/functions/calc.js.map +1 -0
- package/dist/module/runtime/native/styles/{filters.js → functions/filters.js} +2 -2
- package/dist/module/runtime/native/styles/functions/filters.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/index.js +8 -0
- package/dist/module/runtime/native/styles/functions/index.js.map +1 -0
- package/dist/module/runtime/native/styles/{platform-functions.js → functions/platform-functions.js} +1 -1
- package/dist/module/runtime/native/styles/functions/platform-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/functions/transform-functions.js +76 -0
- package/dist/module/runtime/native/styles/functions/transform-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/index.js +12 -12
- package/dist/module/runtime/native/styles/index.js.map +1 -1
- package/dist/module/runtime/native/styles/resolve.js +20 -44
- package/dist/module/runtime/native/styles/resolve.js.map +1 -1
- package/dist/module/runtime/native/styles/{shorthand.js → shorthands/_handler.js} +5 -5
- package/dist/module/runtime/native/styles/shorthands/_handler.js.map +1 -0
- package/dist/module/runtime/native/styles/{animation.js → shorthands/animation.js} +3 -34
- package/dist/module/runtime/native/styles/shorthands/animation.js.map +1 -0
- package/dist/module/runtime/native/styles/{border.js → shorthands/border.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/border.js.map +1 -0
- package/dist/module/runtime/native/styles/{box-shadow.js → shorthands/box-shadow.js} +2 -2
- package/dist/module/runtime/native/styles/shorthands/box-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/shorthands/index.js +8 -0
- package/dist/module/runtime/native/styles/shorthands/index.js.map +1 -0
- package/dist/module/runtime/native/styles/{text-shadow.js → shorthands/text-shadow.js} +1 -1
- package/dist/module/runtime/native/styles/shorthands/text-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/shorthands/transform.js.map +1 -0
- package/dist/module/runtime/native/styles/units.js +7 -4
- 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 +25 -5
- 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/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +5 -4
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +16 -19
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +23 -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 +21 -7
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +20 -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/poison.pill.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 +3 -3
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +2 -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 +2 -10
- 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/root.d.ts +11 -0
- package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/defaults.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts +6 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/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/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +5 -4
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +16 -19
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +23 -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 +21 -7
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +20 -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/poison.pill.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 +3 -3
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +2 -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 +2 -10
- 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/root.d.ts +11 -0
- package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/defaults.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/animation-timing.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/calc.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{filters.d.ts → functions/filters.d.ts} +1 -1
- package/dist/typescript/module/src/runtime/native/styles/functions/filters.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{platform-functions.d.ts → functions/platform-functions.d.ts} +2 -2
- package/dist/typescript/module/src/runtime/native/styles/functions/platform-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/styles/functions/transform-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/{shorthand.d.ts → shorthands/_handler.d.ts} +2 -2
- package/dist/typescript/module/src/runtime/native/styles/shorthands/_handler.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts +4 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/animation.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/border.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/box-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts +6 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/index.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/shorthands/text-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/{transform.d.ts → shorthands/transform.d.ts} +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthands/transform.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/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/package.json +4 -3
- package/src/compiler/atRules.ts +17 -3
- package/src/compiler/attributes.test.ts +1 -1
- package/src/compiler/compiler.ts +30 -31
- package/src/compiler/compiler.types.ts +7 -5
- package/src/compiler/declarations.ts +351 -114
- package/src/compiler/inheritance.test.ts +6 -6
- package/src/compiler/keyframes.ts +1 -1
- package/src/compiler/selector-builder.ts +531 -0
- package/src/compiler/selectors.ts +20 -6
- package/src/compiler/stylesheet.ts +168 -48
- package/src/jest/index.ts +41 -8
- package/src/metro/index.ts +6 -3
- package/src/poison.pill.ts +5 -1
- package/src/runtime/native/conditions/attributes.ts +52 -0
- package/src/runtime/native/conditions/container-query.ts +27 -22
- package/src/runtime/native/conditions/guards.ts +1 -2
- package/src/runtime/native/conditions/index.ts +12 -66
- package/src/runtime/native/conditions/media-query.ts +20 -20
- package/src/runtime/native/injection.ts +1 -1
- package/src/runtime/native/react/interaction.ts +12 -12
- package/src/runtime/native/react/rules.ts +9 -9
- package/src/runtime/native/react/useNativeCss.ts +4 -1
- package/src/runtime/native/reactivity.ts +2 -21
- package/src/runtime/native/reanimated.ts +22 -0
- package/src/runtime/native/root.ts +31 -0
- package/src/runtime/native/styles/calculate-props.ts +61 -50
- package/src/runtime/native/styles/defaults.ts +1 -0
- package/src/runtime/native/styles/functions/animation-timing.ts +44 -0
- package/src/runtime/native/styles/{calc.ts → functions/calc.ts} +2 -2
- package/src/runtime/native/styles/{filters.ts → functions/filters.ts} +3 -3
- package/src/runtime/native/styles/functions/index.ts +5 -0
- package/src/runtime/native/styles/{platform-functions.ts → functions/platform-functions.ts} +2 -2
- package/src/runtime/native/styles/functions/transform-functions.ts +51 -0
- package/src/runtime/native/styles/index.ts +12 -12
- package/src/runtime/native/styles/resolve.ts +20 -63
- package/src/runtime/native/styles/{shorthand.ts → shorthands/_handler.ts} +5 -5
- package/src/runtime/native/styles/{animation.ts → shorthands/animation.ts} +4 -63
- package/src/runtime/native/styles/{border.ts → shorthands/border.ts} +1 -1
- package/src/runtime/native/styles/{box-shadow.ts → shorthands/box-shadow.ts} +3 -3
- package/src/runtime/native/styles/shorthands/index.ts +5 -0
- package/src/runtime/native/styles/{text-shadow.ts → shorthands/text-shadow.ts} +1 -1
- package/src/runtime/native/styles/{transform.ts → shorthands/transform.ts} +1 -1
- package/src/runtime/native/styles/units.ts +8 -4
- package/src/runtime/native/styles/variables.ts +2 -6
- package/src/runtime/utils/objects.ts +24 -3
- package/src/runtime/utils/specificity.ts +1 -0
- package/dist/commonjs/runtime/native/styles/animation.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/border.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/calc.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/filters.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/commonjs/runtime/native/styles/transform.js.map +0 -1
- package/dist/module/runtime/native/styles/animation.js.map +0 -1
- package/dist/module/runtime/native/styles/border.js.map +0 -1
- package/dist/module/runtime/native/styles/box-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/calc.js.map +0 -1
- package/dist/module/runtime/native/styles/filters.js.map +0 -1
- package/dist/module/runtime/native/styles/platform-functions.js.map +0 -1
- package/dist/module/runtime/native/styles/shorthand.js.map +0 -1
- package/dist/module/runtime/native/styles/text-shadow.js.map +0 -1
- package/dist/module/runtime/native/styles/transform.js.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +0 -9
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts +0 -3
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +0 -2
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +0 -1
- /package/dist/commonjs/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
- /package/dist/module/runtime/native/styles/{transform.js → shorthands/transform.js} +0 -0
|
@@ -13,8 +13,9 @@ exports.parseAlignItems = parseAlignItems;
|
|
|
13
13
|
exports.parseAlignSelf = parseAlignSelf;
|
|
14
14
|
exports.parseAngle = parseAngle;
|
|
15
15
|
exports.parseAspectRatio = parseAspectRatio;
|
|
16
|
-
exports.parseBorderBlockColor = parseBorderBlockColor;
|
|
17
16
|
exports.parseBorderBlockWidth = parseBorderBlockWidth;
|
|
17
|
+
exports.parseBorderInlineStyle = parseBorderInlineStyle;
|
|
18
|
+
exports.parseBorderInlineWidth = parseBorderInlineWidth;
|
|
18
19
|
exports.parseBorderSideWidth = parseBorderSideWidth;
|
|
19
20
|
exports.parseBorderSideWidthDeclaration = parseBorderSideWidthDeclaration;
|
|
20
21
|
exports.parseBorderStyle = parseBorderStyle;
|
|
@@ -24,10 +25,9 @@ exports.parseCalcArguments = parseCalcArguments;
|
|
|
24
25
|
exports.parseCalcFn = parseCalcFn;
|
|
25
26
|
exports.parseColor = parseColor;
|
|
26
27
|
exports.parseColorDeclaration = parseColorDeclaration;
|
|
27
|
-
exports.
|
|
28
|
+
exports.parseColorOrAutoDeclaration = parseColorOrAutoDeclaration;
|
|
29
|
+
exports.parseCustomDeclaration = parseCustomDeclaration;
|
|
28
30
|
exports.parseDeclaration = parseDeclaration;
|
|
29
|
-
exports.parseDeclarationCustom = parseDeclarationCustom;
|
|
30
|
-
exports.parseDeclarationUnparsed = parseDeclarationUnparsed;
|
|
31
31
|
exports.parseDimension = parseDimension;
|
|
32
32
|
exports.parseDimensionPercentageFor_LengthValue = parseDimensionPercentageFor_LengthValue;
|
|
33
33
|
exports.parseDisplay = parseDisplay;
|
|
@@ -67,6 +67,7 @@ exports.parseTextShadow = parseTextShadow;
|
|
|
67
67
|
exports.parseTime = parseTime;
|
|
68
68
|
exports.parseTranslateProp = parseTranslateProp;
|
|
69
69
|
exports.parseUnparsed = parseUnparsed;
|
|
70
|
+
exports.parseUnparsedDeclaration = parseUnparsedDeclaration;
|
|
70
71
|
exports.parseUnresolvedColor = parseUnresolvedColor;
|
|
71
72
|
exports.parseUserSelect = parseUserSelect;
|
|
72
73
|
exports.parseVerticalAlign = parseVerticalAlign;
|
|
@@ -83,7 +84,9 @@ const CommaSeparator = Symbol("CommaSeparator");
|
|
|
83
84
|
const propertyRename = {
|
|
84
85
|
"background-image": "experimental_backgroundImage"
|
|
85
86
|
};
|
|
86
|
-
|
|
87
|
+
|
|
88
|
+
// TODO: We need a better way to handle this
|
|
89
|
+
const unparsedRuntimeParsing = new Set(["animation", "border", "box-shadow", "text-shadow", "transform", "scale", "rotate", "translate"]);
|
|
87
90
|
const parsers = {
|
|
88
91
|
"align-content": parseAlignContent,
|
|
89
92
|
"align-items": parseAlignItems,
|
|
@@ -103,37 +106,44 @@ const parsers = {
|
|
|
103
106
|
"block-size": parseSizeDeclaration,
|
|
104
107
|
"border": parseBorder,
|
|
105
108
|
"border-block": parseBorderBlock,
|
|
106
|
-
"border-block-color":
|
|
109
|
+
"border-block-color": parseBorderColor,
|
|
107
110
|
"border-block-end": parseBorderBlockEnd,
|
|
108
111
|
"border-block-end-color": parseColorDeclaration,
|
|
109
112
|
"border-block-end-width": parseBorderSideWidthDeclaration,
|
|
110
113
|
"border-block-start": parseBorderBlockStart,
|
|
111
114
|
"border-block-start-color": parseColorDeclaration,
|
|
112
115
|
"border-block-start-width": parseBorderSideWidthDeclaration,
|
|
116
|
+
"border-block-style": parseBorderBlockStyle,
|
|
113
117
|
"border-block-width": parseBorderBlockWidth,
|
|
114
118
|
"border-bottom": parseBorderSide,
|
|
115
119
|
"border-bottom-color": parseColorDeclaration,
|
|
116
120
|
"border-bottom-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
117
121
|
"border-bottom-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
122
|
+
"border-bottom-style": parseBorderStyleDeclaration,
|
|
118
123
|
"border-bottom-width": parseBorderSideWidthDeclaration,
|
|
119
124
|
"border-color": parseBorderColor,
|
|
120
125
|
"border-end-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
121
126
|
"border-end-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
122
127
|
"border-inline": parseBorderInline,
|
|
123
|
-
"border-inline-color":
|
|
128
|
+
"border-inline-color": parseBorderColor,
|
|
124
129
|
"border-inline-end": parseBorderInlineEnd,
|
|
125
130
|
"border-inline-end-color": parseColorDeclaration,
|
|
131
|
+
"border-inline-end-style": parseBorderInlineStyle,
|
|
126
132
|
"border-inline-end-width": parseBorderSideWidthDeclaration,
|
|
127
133
|
"border-inline-start": parseBorderInlineStart,
|
|
128
134
|
"border-inline-start-color": parseColorDeclaration,
|
|
135
|
+
"border-inline-start-style": parseBorderInlineStyle,
|
|
129
136
|
"border-inline-start-width": parseBorderSideWidthDeclaration,
|
|
130
|
-
"border-inline-
|
|
137
|
+
"border-inline-style": parseBorderInlineStyle,
|
|
138
|
+
"border-inline-width": parseBorderInlineWidth,
|
|
131
139
|
"border-left": parseBorderSide,
|
|
132
140
|
"border-left-color": parseColorDeclaration,
|
|
141
|
+
"border-left-style": parseBorderStyleDeclaration,
|
|
133
142
|
"border-left-width": parseBorderSideWidthDeclaration,
|
|
134
143
|
"border-radius": parseBorderRadius,
|
|
135
144
|
"border-right": parseBorderSide,
|
|
136
145
|
"border-right-color": parseColorDeclaration,
|
|
146
|
+
"border-right-style": parseBorderStyleDeclaration,
|
|
137
147
|
"border-right-width": parseBorderSideWidthDeclaration,
|
|
138
148
|
"border-start-end-radius": parseSize2DDimensionPercentageDeclaration,
|
|
139
149
|
"border-start-start-radius": parseSize2DDimensionPercentageDeclaration,
|
|
@@ -142,11 +152,12 @@ const parsers = {
|
|
|
142
152
|
"border-top-color": parseColorDeclaration,
|
|
143
153
|
"border-top-left-radius": parseSize2DDimensionPercentageDeclaration,
|
|
144
154
|
"border-top-right-radius": parseSize2DDimensionPercentageDeclaration,
|
|
155
|
+
"border-top-style": parseBorderStyleDeclaration,
|
|
145
156
|
"border-top-width": parseBorderSideWidthDeclaration,
|
|
146
157
|
"border-width": parseBorderWidth,
|
|
147
158
|
"bottom": parseSizeDeclaration,
|
|
148
159
|
"box-shadow": parseBoxShadow,
|
|
149
|
-
"caret-color":
|
|
160
|
+
"caret-color": parseColorOrAutoDeclaration,
|
|
150
161
|
"color": parseFontColorDeclaration,
|
|
151
162
|
"column-gap": parseGap,
|
|
152
163
|
"container": parseContainer,
|
|
@@ -265,9 +276,9 @@ function parseDeclaration(declaration, builder) {
|
|
|
265
276
|
return;
|
|
266
277
|
}
|
|
267
278
|
if (declaration.property === "unparsed") {
|
|
268
|
-
|
|
279
|
+
parseUnparsedDeclaration(declaration, builder);
|
|
269
280
|
} else if (declaration.property === "custom") {
|
|
270
|
-
|
|
281
|
+
parseCustomDeclaration(declaration, builder);
|
|
271
282
|
} else {
|
|
272
283
|
parseWithParser(declaration, builder);
|
|
273
284
|
}
|
|
@@ -276,6 +287,7 @@ function parseWithParser(declaration, builder) {
|
|
|
276
287
|
if (declaration.property in parsers) {
|
|
277
288
|
const parser = parsers[declaration.property];
|
|
278
289
|
builder.descriptorProperty = declaration.property;
|
|
290
|
+
builder.setWarningProperty(declaration.property);
|
|
279
291
|
const value = parser(declaration, builder, declaration.property);
|
|
280
292
|
if (value !== undefined) {
|
|
281
293
|
builder.addDescriptor(propertyRename[declaration.property] ?? declaration.property, value);
|
|
@@ -320,15 +332,25 @@ function parseBorderRadius({
|
|
|
320
332
|
"border-top-right-radius": parseSize2DDimensionPercentage(value.topRight, builder)
|
|
321
333
|
});
|
|
322
334
|
}
|
|
323
|
-
function parseBorderColor({
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
335
|
+
function parseBorderColor(declaration, builder) {
|
|
336
|
+
switch (declaration.property) {
|
|
337
|
+
case "border-color":
|
|
338
|
+
builder.addShorthand("border-color", {
|
|
339
|
+
"border-top-color": parseColor(declaration.value.top, builder),
|
|
340
|
+
"border-bottom-color": parseColor(declaration.value.bottom, builder),
|
|
341
|
+
"border-left-color": parseColor(declaration.value.left, builder),
|
|
342
|
+
"border-right-color": parseColor(declaration.value.right, builder)
|
|
343
|
+
});
|
|
344
|
+
break;
|
|
345
|
+
case "border-block-color":
|
|
346
|
+
builder.addDescriptor("border-top-color", parseColor(declaration.value.start, builder));
|
|
347
|
+
builder.addDescriptor("border-bottom-color", parseColor(declaration.value.end, builder));
|
|
348
|
+
break;
|
|
349
|
+
case "border-inline-color":
|
|
350
|
+
builder.addDescriptor("border-left-color", parseColor(declaration.value.start, builder));
|
|
351
|
+
builder.addDescriptor("border-right-color", parseColor(declaration.value.end, builder));
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
332
354
|
}
|
|
333
355
|
function parseBorderWidth({
|
|
334
356
|
value
|
|
@@ -396,6 +418,19 @@ function parseBorderInlineEnd({
|
|
|
396
418
|
builder.addDescriptor("border-right-color", parseColor(value.color, builder));
|
|
397
419
|
builder.addDescriptor("border-right-width", parseBorderSideWidth(value.width, builder));
|
|
398
420
|
}
|
|
421
|
+
function parseBorderInlineWidth(declaration, builder) {
|
|
422
|
+
builder.addDescriptor("border-left-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
423
|
+
builder.addDescriptor("border-right-width", parseBorderSideWidth(declaration.value.end, builder));
|
|
424
|
+
}
|
|
425
|
+
function parseBorderInlineStyle(declaration, builder) {
|
|
426
|
+
if (typeof declaration.value === "string") {
|
|
427
|
+
builder.addDescriptor("border-style", parseBorderStyle(declaration.value, builder));
|
|
428
|
+
} else if (declaration.value.start === declaration.value.end) {
|
|
429
|
+
builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
|
|
430
|
+
} else {
|
|
431
|
+
builder.addWarning("property", "border-inline-style");
|
|
432
|
+
}
|
|
433
|
+
}
|
|
399
434
|
function parseFlexFlow({
|
|
400
435
|
value
|
|
401
436
|
}, builder) {
|
|
@@ -482,26 +517,26 @@ function parseFont({
|
|
|
482
517
|
function parseTransform({
|
|
483
518
|
value
|
|
484
519
|
}, builder) {
|
|
485
|
-
builder.addDescriptor("transform", [{}, "
|
|
520
|
+
builder.addDescriptor("transform", [{}, "transform", value.flatMap(t => {
|
|
486
521
|
switch (t.type) {
|
|
487
522
|
case "perspective":
|
|
488
|
-
return [[{}, "
|
|
523
|
+
return [[{}, "perspective", parseLength(t.value, builder)]];
|
|
489
524
|
case "translate":
|
|
490
|
-
return [[{}, "
|
|
525
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value[0], builder)], [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value[1], builder)]]];
|
|
491
526
|
case "translateX":
|
|
492
|
-
return [[{}, "
|
|
527
|
+
return [[{}, "translateX", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
493
528
|
case "translateY":
|
|
494
|
-
return [[{}, "
|
|
529
|
+
return [[{}, "translateY", parseLengthOrCoercePercentageToRuntime(t.value, builder)]];
|
|
495
530
|
case "rotate":
|
|
496
|
-
return [[{}, "
|
|
531
|
+
return [[{}, "rotate", parseAngle(t.value, builder)]];
|
|
497
532
|
case "rotateX":
|
|
498
|
-
return [[{}, "
|
|
533
|
+
return [[{}, "rotateX", parseAngle(t.value, builder)]];
|
|
499
534
|
case "rotateY":
|
|
500
|
-
return [[{}, "
|
|
535
|
+
return [[{}, "rotateY", parseAngle(t.value, builder)]];
|
|
501
536
|
case "rotateZ":
|
|
502
|
-
return [[{}, "
|
|
537
|
+
return [[{}, "rotateZ", parseAngle(t.value, builder)]];
|
|
503
538
|
case "scale":
|
|
504
|
-
return [[{}, "
|
|
539
|
+
return [[{}, "scaleX", parseLength(t.value[0], builder)], [{}, "scaleY", parseLength(t.value[1], builder)]];
|
|
505
540
|
case "scaleX":
|
|
506
541
|
return [[{}, "scaleX", parseLength(t.value, builder)]];
|
|
507
542
|
case "scaleY":
|
|
@@ -533,9 +568,15 @@ function parseTranslate({
|
|
|
533
568
|
function parseRotate({
|
|
534
569
|
value
|
|
535
570
|
}, builder) {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
571
|
+
if (value.x) {
|
|
572
|
+
builder.addDescriptor("rotateX", [{}, "rotateX", parseAngle(value.angle, builder)]);
|
|
573
|
+
}
|
|
574
|
+
if (value.y) {
|
|
575
|
+
builder.addDescriptor("rotateY", [{}, "rotateY", parseAngle(value.angle, builder)]);
|
|
576
|
+
}
|
|
577
|
+
if (value.z) {
|
|
578
|
+
builder.addDescriptor("rotateZ", [{}, "rotateZ", parseAngle(value.angle, builder)]);
|
|
579
|
+
}
|
|
539
580
|
}
|
|
540
581
|
function parseScale({
|
|
541
582
|
value
|
|
@@ -555,7 +596,11 @@ function parseLetterSpacing({
|
|
|
555
596
|
if (value.type === "normal") {
|
|
556
597
|
return;
|
|
557
598
|
}
|
|
558
|
-
|
|
599
|
+
const descriptor = parseLength(value.value, builder);
|
|
600
|
+
if (Array.isArray(descriptor) && descriptor[1] === "em" && typeof descriptor[2] === "number") {
|
|
601
|
+
return descriptor[2];
|
|
602
|
+
}
|
|
603
|
+
return descriptor;
|
|
559
604
|
}
|
|
560
605
|
function parseTextDecoration({
|
|
561
606
|
value
|
|
@@ -573,7 +618,8 @@ function parseZIndex({
|
|
|
573
618
|
return;
|
|
574
619
|
}
|
|
575
620
|
}
|
|
576
|
-
function parseContainerType(
|
|
621
|
+
function parseContainerType(_declaration, builder) {
|
|
622
|
+
builder.addContainer(["___default___"]);
|
|
577
623
|
return;
|
|
578
624
|
}
|
|
579
625
|
function parseContainerName({
|
|
@@ -588,12 +634,13 @@ function parseContainer({
|
|
|
588
634
|
builder.addContainer(value.name.type === "none" ? false : value.name.value);
|
|
589
635
|
return;
|
|
590
636
|
}
|
|
591
|
-
function
|
|
637
|
+
function parseUnparsedDeclaration(declaration, builder) {
|
|
592
638
|
let property = declaration.value.propertyId.property;
|
|
593
639
|
if (!(property in parsers)) {
|
|
594
640
|
builder.addWarning("property", property);
|
|
595
641
|
return;
|
|
596
642
|
}
|
|
643
|
+
builder.setWarningProperty(property);
|
|
597
644
|
|
|
598
645
|
/**
|
|
599
646
|
* React Native doesn't support all the logical properties
|
|
@@ -608,14 +655,14 @@ function parseDeclarationUnparsed(declaration, builder) {
|
|
|
608
655
|
*/
|
|
609
656
|
builder.descriptorProperty = property;
|
|
610
657
|
if (unparsedRuntimeParsing.has(property)) {
|
|
611
|
-
const args = parseUnparsed(declaration.value.value, builder);
|
|
658
|
+
const args = parseUnparsed(declaration.value.value, builder, property);
|
|
612
659
|
if (property === "animation") {
|
|
613
|
-
builder.addDescriptor("animation", [{},
|
|
660
|
+
builder.addDescriptor("animation", [{}, property, args]);
|
|
614
661
|
} else {
|
|
615
|
-
builder.addDescriptor(property, [{},
|
|
662
|
+
builder.addDescriptor(property, [{}, (0, _selectors.toRNProperty)(property), args, 1]);
|
|
616
663
|
}
|
|
617
664
|
} else {
|
|
618
|
-
const value = parseUnparsed(declaration.value.value, builder);
|
|
665
|
+
const value = parseUnparsed(declaration.value.value, builder, property);
|
|
619
666
|
builder.addDescriptor(property, value);
|
|
620
667
|
if (property === "font-size") {
|
|
621
668
|
builder.addDescriptor("--__rn-css-em", value);
|
|
@@ -625,16 +672,20 @@ function parseDeclarationUnparsed(declaration, builder) {
|
|
|
625
672
|
}
|
|
626
673
|
}
|
|
627
674
|
}
|
|
628
|
-
function
|
|
675
|
+
function parseCustomDeclaration(declaration, builder) {
|
|
629
676
|
const property = declaration.value.name;
|
|
630
|
-
if (
|
|
631
|
-
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder,
|
|
677
|
+
if (property === "-webkit-line-clamp") {
|
|
678
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
679
|
+
} else if (property === "-rn-ripple-style") {
|
|
680
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property) === "borderless");
|
|
681
|
+
} else if (validProperties.has(property) || property.startsWith("--") || property.startsWith("-rn-")) {
|
|
682
|
+
builder.addDescriptor(property, parseUnparsed(declaration.value.value, builder, property));
|
|
632
683
|
} else {
|
|
633
684
|
builder.addWarning("property", declaration.value.name);
|
|
634
685
|
}
|
|
635
686
|
}
|
|
636
|
-
function reduceParseUnparsed(tokenOrValues, builder) {
|
|
637
|
-
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder)).filter(v => v !== undefined);
|
|
687
|
+
function reduceParseUnparsed(tokenOrValues, builder, property, allowAuto) {
|
|
688
|
+
const result = tokenOrValues.map(tokenOrValue => parseUnparsed(tokenOrValue, builder, property, allowAuto)).filter(v => v !== undefined);
|
|
638
689
|
if (result.length === 0) {
|
|
639
690
|
return undefined;
|
|
640
691
|
}
|
|
@@ -648,6 +699,9 @@ function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
648
699
|
currentGroup.push(value);
|
|
649
700
|
}
|
|
650
701
|
}
|
|
702
|
+
|
|
703
|
+
// Groups are the tokens grouped together by comma location
|
|
704
|
+
// If a group only has 1 item, it shouldn't be an array
|
|
651
705
|
groups = groups.flatMap(group => {
|
|
652
706
|
if (!Array.isArray(group)) {
|
|
653
707
|
return [];
|
|
@@ -661,21 +715,26 @@ function reduceParseUnparsed(tokenOrValues, builder) {
|
|
|
661
715
|
} else {
|
|
662
716
|
return [first];
|
|
663
717
|
}
|
|
718
|
+
} else if (
|
|
719
|
+
// This is a special case for <ratio> values
|
|
720
|
+
group.includes("/") && group.every(item => typeof item === "string" && item === "/" ? item : typeof item === "number")) {
|
|
721
|
+
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
722
|
+
return [group.join(" ")];
|
|
664
723
|
} else {
|
|
665
724
|
return [group];
|
|
666
725
|
}
|
|
667
726
|
});
|
|
668
727
|
return groups.length === 1 ? groups[0] : groups;
|
|
669
728
|
}
|
|
670
|
-
function unparsedFunction(token, builder) {
|
|
671
|
-
return [{}, token.value.name, reduceParseUnparsed(token.value.arguments, builder)];
|
|
729
|
+
function unparsedFunction(token, builder, property, allowAuto) {
|
|
730
|
+
return [{}, (0, _selectors.toRNProperty)(token.value.name), reduceParseUnparsed(token.value.arguments, builder, property, allowAuto)];
|
|
672
731
|
}
|
|
673
732
|
|
|
674
733
|
/**
|
|
675
734
|
* When the CSS cannot be parsed (often due to a runtime condition like a CSS variable)
|
|
676
735
|
* This export function best efforts parsing it into a export function that we can evaluate at runtime
|
|
677
736
|
*/
|
|
678
|
-
function parseUnparsed(tokenOrValue, builder, allowAuto =
|
|
737
|
+
function parseUnparsed(tokenOrValue, builder, property, allowAuto = allowAutoProperties.has(property)) {
|
|
679
738
|
if (tokenOrValue === undefined || tokenOrValue === null) {
|
|
680
739
|
return;
|
|
681
740
|
}
|
|
@@ -694,7 +753,7 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
694
753
|
return round(tokenOrValue);
|
|
695
754
|
}
|
|
696
755
|
if (Array.isArray(tokenOrValue)) {
|
|
697
|
-
const args = reduceParseUnparsed(tokenOrValue, builder);
|
|
756
|
+
const args = reduceParseUnparsed(tokenOrValue, builder, property, allowAuto);
|
|
698
757
|
if (!args) return;
|
|
699
758
|
if (Array.isArray(args) && args.length === 1) return args[0];
|
|
700
759
|
return args;
|
|
@@ -702,12 +761,12 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
702
761
|
switch (tokenOrValue.type) {
|
|
703
762
|
case "unresolved-color":
|
|
704
763
|
{
|
|
705
|
-
return parseUnresolvedColor(tokenOrValue.value, builder);
|
|
764
|
+
return parseUnresolvedColor(tokenOrValue.value, builder, property, allowAuto);
|
|
706
765
|
}
|
|
707
766
|
case "var":
|
|
708
767
|
{
|
|
709
768
|
let args = tokenOrValue.value.name.ident.slice(2);
|
|
710
|
-
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder);
|
|
769
|
+
const fallback = parseUnparsed(tokenOrValue.value.fallback, builder, property, allowAuto);
|
|
711
770
|
if (fallback !== undefined) {
|
|
712
771
|
args = [args, fallback];
|
|
713
772
|
}
|
|
@@ -727,8 +786,8 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
727
786
|
case "scaleY":
|
|
728
787
|
case "translateX":
|
|
729
788
|
case "translateY":
|
|
730
|
-
tokenOrValue
|
|
731
|
-
|
|
789
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
790
|
+
case "blur":
|
|
732
791
|
case "brightness":
|
|
733
792
|
case "contrast":
|
|
734
793
|
case "cubic-bezier":
|
|
@@ -742,7 +801,7 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
742
801
|
case "linear-gradient":
|
|
743
802
|
case "opacity":
|
|
744
803
|
case "pixelScale":
|
|
745
|
-
case "
|
|
804
|
+
case "getPixelSizeForLayoutSize":
|
|
746
805
|
case "platformColor":
|
|
747
806
|
case "radial-gradient":
|
|
748
807
|
case "rgb":
|
|
@@ -752,17 +811,17 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
752
811
|
case "sepia":
|
|
753
812
|
case "shadow":
|
|
754
813
|
case "steps":
|
|
755
|
-
return unparsedFunction(tokenOrValue, builder);
|
|
814
|
+
return unparsedFunction(tokenOrValue, builder, property, allowAuto);
|
|
756
815
|
case "hairlineWidth":
|
|
757
816
|
return [{}, tokenOrValue.value.name, []];
|
|
758
817
|
case "calc":
|
|
759
818
|
case "max":
|
|
760
819
|
case "min":
|
|
761
820
|
case "clamp":
|
|
762
|
-
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder);
|
|
821
|
+
return parseCalcFn(tokenOrValue.value.name, tokenOrValue.value.arguments, builder, property);
|
|
763
822
|
default:
|
|
764
823
|
{
|
|
765
|
-
builder.addWarning("
|
|
824
|
+
builder.addWarning("value", `${tokenOrValue.value.name}()`);
|
|
766
825
|
return;
|
|
767
826
|
}
|
|
768
827
|
}
|
|
@@ -791,6 +850,8 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
791
850
|
return true;
|
|
792
851
|
} else if (value === "false") {
|
|
793
852
|
return false;
|
|
853
|
+
} else if (value === "infinity") {
|
|
854
|
+
return Number.MAX_SAFE_INTEGER;
|
|
794
855
|
} else {
|
|
795
856
|
return value;
|
|
796
857
|
}
|
|
@@ -808,11 +869,17 @@ function parseUnparsed(tokenOrValue, builder, allowAuto = false) {
|
|
|
808
869
|
return parseDimension(tokenOrValue.value, builder);
|
|
809
870
|
case "comma":
|
|
810
871
|
return CommaSeparator;
|
|
872
|
+
case "delim":
|
|
873
|
+
{
|
|
874
|
+
if (tokenOrValue.value.value === "/") {
|
|
875
|
+
return tokenOrValue.value.value;
|
|
876
|
+
}
|
|
877
|
+
return;
|
|
878
|
+
}
|
|
811
879
|
case "at-keyword":
|
|
812
880
|
case "hash":
|
|
813
881
|
case "id-hash":
|
|
814
882
|
case "unquoted-url":
|
|
815
|
-
case "delim":
|
|
816
883
|
case "white-space":
|
|
817
884
|
case "comment":
|
|
818
885
|
case "colon":
|
|
@@ -865,22 +932,32 @@ function parseLength(length, builder) {
|
|
|
865
932
|
inlineRem = 14
|
|
866
933
|
} = builder.getOptions();
|
|
867
934
|
if (typeof length === "number") {
|
|
868
|
-
return length;
|
|
935
|
+
return round(length);
|
|
869
936
|
}
|
|
870
937
|
if ("unit" in length) {
|
|
871
938
|
switch (length.unit) {
|
|
872
939
|
case "px":
|
|
873
|
-
|
|
940
|
+
{
|
|
941
|
+
if (length.value === Infinity) {
|
|
942
|
+
return 9999;
|
|
943
|
+
} else if (length.value === -Infinity) {
|
|
944
|
+
return -9999;
|
|
945
|
+
} else {
|
|
946
|
+
// Normalize large values to safe integers, e.g. `calc(infinity * 1px)`
|
|
947
|
+
const value = Math.max(Math.min(length.value, Number.MAX_SAFE_INTEGER), Number.MIN_SAFE_INTEGER);
|
|
948
|
+
return round(value);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
874
951
|
case "rem":
|
|
875
952
|
if (typeof inlineRem === "number") {
|
|
876
953
|
return length.value * inlineRem;
|
|
877
954
|
} else {
|
|
878
|
-
return [{}, "rem", length.value];
|
|
955
|
+
return [{}, "rem", round(length.value)];
|
|
879
956
|
}
|
|
880
957
|
case "vw":
|
|
881
958
|
case "vh":
|
|
882
959
|
case "em":
|
|
883
|
-
return [{}, length.unit, length.value, 1];
|
|
960
|
+
return [{}, length.unit, round(length.value), 1];
|
|
884
961
|
case "in":
|
|
885
962
|
case "cm":
|
|
886
963
|
case "mm":
|
|
@@ -965,7 +1042,7 @@ function parseAngle(angle, builder) {
|
|
|
965
1042
|
case "rad":
|
|
966
1043
|
return `${angle.value}${angle.type}`;
|
|
967
1044
|
default:
|
|
968
|
-
builder.addWarning("value", angle.value);
|
|
1045
|
+
builder.addWarning("value", `${angle.value} ${angle.type}`);
|
|
969
1046
|
return undefined;
|
|
970
1047
|
}
|
|
971
1048
|
}
|
|
@@ -1023,7 +1100,7 @@ function parseSize(size, builder, options, {
|
|
|
1023
1100
|
}
|
|
1024
1101
|
return;
|
|
1025
1102
|
}
|
|
1026
|
-
function
|
|
1103
|
+
function parseColorOrAutoDeclaration({
|
|
1027
1104
|
value
|
|
1028
1105
|
}, builder) {
|
|
1029
1106
|
if (value.type === "auto") {
|
|
@@ -1413,19 +1490,27 @@ function parseBorderStyle(value, builder) {
|
|
|
1413
1490
|
builder.addWarning("value", value.top);
|
|
1414
1491
|
return undefined;
|
|
1415
1492
|
}
|
|
1416
|
-
function parseBorderBlockColor({
|
|
1417
|
-
value
|
|
1418
|
-
}, builder) {
|
|
1419
|
-
builder.addDescriptor("border-top-color", parseColor(value.start, builder));
|
|
1420
|
-
builder.addDescriptor("border-bottom-color", parseColor(value.end, builder));
|
|
1421
|
-
return;
|
|
1422
|
-
}
|
|
1423
1493
|
function parseBorderBlockWidth(declaration, builder) {
|
|
1424
1494
|
builder.addDescriptor("border-top-width", parseBorderSideWidth(declaration.value.start, builder));
|
|
1425
1495
|
builder.addDescriptor("border-bottom-width", parseBorderSideWidth(declaration.value.end, builder));
|
|
1426
1496
|
}
|
|
1497
|
+
function parseBorderBlockStyle(declaration, builder) {
|
|
1498
|
+
if (declaration.value.start === declaration.value.end) {
|
|
1499
|
+
builder.addDescriptor("border-style", parseBorderStyle(declaration.value.start, builder));
|
|
1500
|
+
} else {
|
|
1501
|
+
builder.addWarning("property", "border-block-style");
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1427
1504
|
function parseBorderSideWidthDeclaration(declaration, builder) {
|
|
1428
|
-
|
|
1505
|
+
if (declaration.property.includes("block")) {
|
|
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
|
+
}
|
|
1429
1514
|
}
|
|
1430
1515
|
function parseBorderSideWidth(value, builder) {
|
|
1431
1516
|
if (value.type === "length") {
|
|
@@ -1470,7 +1555,7 @@ function parseLineHeight(value, builder) {
|
|
|
1470
1555
|
return parseLength(length, builder);
|
|
1471
1556
|
case "percentage":
|
|
1472
1557
|
case "calc":
|
|
1473
|
-
builder.addWarning("
|
|
1558
|
+
builder.addWarning("style", "line-height", typeof length.value === "number" ? length.value : JSON.stringify(length.value));
|
|
1474
1559
|
return;
|
|
1475
1560
|
default:
|
|
1476
1561
|
{
|
|
@@ -1540,8 +1625,8 @@ function parseLengthOrCoercePercentageToRuntime(value, builder) {
|
|
|
1540
1625
|
}
|
|
1541
1626
|
function parseGap(declaration, builder) {
|
|
1542
1627
|
if ("column" in declaration.value) {
|
|
1543
|
-
builder.addDescriptor("row-gap",
|
|
1544
|
-
builder.addDescriptor("column-gap",
|
|
1628
|
+
builder.addDescriptor("row-gap", parseGapValue(declaration.value.row, builder));
|
|
1629
|
+
builder.addDescriptor("column-gap", parseGapValue(declaration.value.column, builder));
|
|
1545
1630
|
return;
|
|
1546
1631
|
} else {
|
|
1547
1632
|
if (declaration.value.type === "normal") {
|
|
@@ -1551,6 +1636,13 @@ function parseGap(declaration, builder) {
|
|
|
1551
1636
|
return parseLength(declaration.value.value, builder);
|
|
1552
1637
|
}
|
|
1553
1638
|
}
|
|
1639
|
+
function parseGapValue(value, builder) {
|
|
1640
|
+
if (value.type === "normal") {
|
|
1641
|
+
return;
|
|
1642
|
+
} else {
|
|
1643
|
+
return parseLength(value.value, builder);
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1554
1646
|
function parseTextAlign({
|
|
1555
1647
|
value
|
|
1556
1648
|
}, builder) {
|
|
@@ -1650,7 +1742,11 @@ function parseDimension({
|
|
|
1650
1742
|
}, builder) {
|
|
1651
1743
|
switch (unit) {
|
|
1652
1744
|
case "px":
|
|
1653
|
-
|
|
1745
|
+
if (value === Infinity) {
|
|
1746
|
+
return 9999;
|
|
1747
|
+
} else {
|
|
1748
|
+
return value;
|
|
1749
|
+
}
|
|
1654
1750
|
case "%":
|
|
1655
1751
|
return `${value}%`;
|
|
1656
1752
|
case "rnh":
|
|
@@ -1675,17 +1771,21 @@ function parseUserSelect({
|
|
|
1675
1771
|
}
|
|
1676
1772
|
}
|
|
1677
1773
|
function parseSVGPaint({
|
|
1678
|
-
value
|
|
1774
|
+
value,
|
|
1775
|
+
property
|
|
1679
1776
|
}, builder) {
|
|
1777
|
+
let parsedValue;
|
|
1680
1778
|
if (value.type === "none") {
|
|
1681
|
-
|
|
1779
|
+
parsedValue = "transparent";
|
|
1682
1780
|
} else if (value.type === "color") {
|
|
1683
|
-
|
|
1781
|
+
parsedValue = parseColor(value.value, builder);
|
|
1782
|
+
} else {
|
|
1783
|
+
return;
|
|
1684
1784
|
}
|
|
1685
|
-
|
|
1785
|
+
builder.addDescriptor(property, parsedValue);
|
|
1686
1786
|
}
|
|
1687
1787
|
function round(number) {
|
|
1688
|
-
return Math.round((number + Number.EPSILON) *
|
|
1788
|
+
return Math.round((number + Number.EPSILON) * 10000) / 10000;
|
|
1689
1789
|
}
|
|
1690
1790
|
function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
1691
1791
|
if (value.type === "calc") {
|
|
@@ -1696,7 +1796,7 @@ function parseDimensionPercentageFor_LengthValue(value, builder) {
|
|
|
1696
1796
|
return parseLength(value.value, builder);
|
|
1697
1797
|
}
|
|
1698
1798
|
}
|
|
1699
|
-
const
|
|
1799
|
+
const allowAutoProperties = new Set(["pointer-events"]);
|
|
1700
1800
|
function parseEnv(value, builder) {
|
|
1701
1801
|
switch (value.name.type) {
|
|
1702
1802
|
case "ua":
|
|
@@ -1705,7 +1805,7 @@ function parseEnv(value, builder) {
|
|
|
1705
1805
|
case "safe-area-inset-right":
|
|
1706
1806
|
case "safe-area-inset-bottom":
|
|
1707
1807
|
case "safe-area-inset-left":
|
|
1708
|
-
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder)], 1];
|
|
1808
|
+
return [{}, "var", [`--react-native-css-${value.name.value}`, parseUnparsed(value.fallback, builder, value.name.value)], 1];
|
|
1709
1809
|
case "viewport-segment-width":
|
|
1710
1810
|
case "viewport-segment-height":
|
|
1711
1811
|
case "viewport-segment-top":
|
|
@@ -1719,14 +1819,14 @@ function parseEnv(value, builder) {
|
|
|
1719
1819
|
}
|
|
1720
1820
|
return;
|
|
1721
1821
|
}
|
|
1722
|
-
function parseCalcFn(name, tokens, builder) {
|
|
1723
|
-
const args = parseCalcArguments(tokens, builder);
|
|
1822
|
+
function parseCalcFn(name, tokens, builder, property) {
|
|
1823
|
+
const args = parseCalcArguments(tokens, builder, property);
|
|
1724
1824
|
if (args) {
|
|
1725
1825
|
return [{}, name, args];
|
|
1726
1826
|
}
|
|
1727
1827
|
return;
|
|
1728
1828
|
}
|
|
1729
|
-
function parseCalcArguments([...args], builder) {
|
|
1829
|
+
function parseCalcArguments([...args], builder, property) {
|
|
1730
1830
|
const parsed = [];
|
|
1731
1831
|
let mode;
|
|
1732
1832
|
for (const [currentIndex, arg] of args.entries()) {
|
|
@@ -1740,7 +1840,7 @@ function parseCalcArguments([...args], builder) {
|
|
|
1740
1840
|
case "function":
|
|
1741
1841
|
case "unresolved-color":
|
|
1742
1842
|
{
|
|
1743
|
-
const value = parseUnparsed(arg, builder);
|
|
1843
|
+
const value = parseUnparsed(arg, builder, property);
|
|
1744
1844
|
if (value === undefined) {
|
|
1745
1845
|
return undefined;
|
|
1746
1846
|
}
|
|
@@ -1809,7 +1909,7 @@ function parseCalcArguments([...args], builder) {
|
|
|
1809
1909
|
.splice(currentIndex, closeParenthesisIndex - currentIndex + 1)
|
|
1810
1910
|
// Then drop the surrounding parenthesis
|
|
1811
1911
|
.slice(1, -1);
|
|
1812
|
-
parsed.push(parseCalcFn("calc", innerCalcArgs, builder));
|
|
1912
|
+
parsed.push(parseCalcFn("calc", innerCalcArgs, builder, property));
|
|
1813
1913
|
break;
|
|
1814
1914
|
}
|
|
1815
1915
|
case "close-parenthesis":
|
|
@@ -1850,20 +1950,20 @@ function parseTranslateProp(value, prop, builder) {
|
|
|
1850
1950
|
}
|
|
1851
1951
|
return parseLength(value[prop], builder);
|
|
1852
1952
|
}
|
|
1853
|
-
function parseUnresolvedColor(color, builder) {
|
|
1953
|
+
function parseUnresolvedColor(color, builder, property, allowAuto) {
|
|
1854
1954
|
switch (color.type) {
|
|
1855
1955
|
case "rgb":
|
|
1856
|
-
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder)]];
|
|
1956
|
+
return [{}, "rgba", [round(color.r * 255), round(color.g * 255), round(color.b * 255), parseUnparsed(color.alpha, builder, property)]];
|
|
1857
1957
|
case "hsl":
|
|
1858
|
-
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder)]];
|
|
1958
|
+
return [{}, color.type, [color.h, color.s, color.l, parseUnparsed(color.alpha, builder, property)]];
|
|
1859
1959
|
case "light-dark":
|
|
1860
1960
|
{
|
|
1861
1961
|
const extraRule = builder.extendRule({
|
|
1862
1962
|
m: [["=", "prefers-color-scheme", "dark"]]
|
|
1863
1963
|
});
|
|
1864
|
-
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder), false, extraRule);
|
|
1964
|
+
builder.addUnnamedDescriptor(reduceParseUnparsed(color.dark, builder, property, allowAuto), false, extraRule);
|
|
1865
1965
|
builder.addExtraRule(extraRule);
|
|
1866
|
-
return reduceParseUnparsed(color.light, builder);
|
|
1966
|
+
return reduceParseUnparsed(color.light, builder, property, allowAuto);
|
|
1867
1967
|
}
|
|
1868
1968
|
default:
|
|
1869
1969
|
color;
|
|
@@ -2022,7 +2122,7 @@ function parseGradient(gradient, builder) {
|
|
|
2022
2122
|
switch (gradient.type) {
|
|
2023
2123
|
case "linear":
|
|
2024
2124
|
{
|
|
2025
|
-
return [{}, "
|
|
2125
|
+
return [{}, "linear-gradient", [parseLineDirection(gradient.direction, builder), ...gradient.items.map(item => parseGradientItem(item, builder))]];
|
|
2026
2126
|
}
|
|
2027
2127
|
}
|
|
2028
2128
|
return;
|
|
@@ -2079,6 +2179,7 @@ function parseFilter(declaration, builder) {
|
|
|
2079
2179
|
[value.type]: parseAngle(value.value, builder)
|
|
2080
2180
|
};
|
|
2081
2181
|
case "drop-shadow":
|
|
2182
|
+
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)]];
|
|
2082
2183
|
case "url":
|
|
2083
2184
|
return;
|
|
2084
2185
|
}
|