react-native-css 3.0.0-nightly.61014be → 3.0.0-nightly.67b5d08
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/compiler.js +34 -18
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +214 -136
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +15 -15
- 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 +137 -46
- 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/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 +12 -46
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +26 -21
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/injection.js +22 -20
- 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 +26 -24
- 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 +63 -38
- 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 +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 +121 -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/{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 +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 +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/module/compiler/atRules.js +16 -3
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +34 -18
- 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 +209 -132
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +15 -15
- 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 +136 -45
- 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/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 +12 -46
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +27 -22
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/injection.js +21 -19
- 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 +26 -24
- 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 +64 -39
- 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 +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 +114 -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/{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 +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 +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/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 +7 -8
- 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/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 +21 -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/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/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 +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 +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 +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 +7 -8
- 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/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 +21 -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/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/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 +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 +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 +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 +6 -3
- package/src/compiler/atRules.ts +17 -3
- package/src/compiler/compiler.ts +38 -32
- package/src/compiler/compiler.types.ts +9 -9
- package/src/compiler/declarations.ts +379 -166
- package/src/compiler/inheritance.test.ts +13 -13
- 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 +186 -51
- 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/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 +14 -66
- package/src/runtime/native/conditions/media-query.ts +29 -25
- package/src/runtime/native/injection.ts +32 -31
- package/src/runtime/native/react/interaction.ts +12 -12
- package/src/runtime/native/react/rules.ts +27 -23
- 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 +71 -39
- 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 +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 +84 -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} +4 -2
- package/src/runtime/native/styles/units.ts +8 -4
- package/src/runtime/native/styles/variables.ts +2 -6
- package/src/runtime/utils/objects.ts +16 -4
- package/src/runtime/utils/specificity.ts +1 -0
- package/dist/commonjs/compiler/attributes.test.js +0 -20
- package/dist/commonjs/compiler/attributes.test.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.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/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/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/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/runtime/native/styles/calc.ts +0 -97
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { isStyleDescriptorArray } from "../../../utils";
|
|
2
|
+
import type { StyleFunctionResolver } from "../resolve";
|
|
3
|
+
|
|
4
|
+
export const scale: StyleFunctionResolver = (resolveValue, descriptor) => {
|
|
5
|
+
const args = descriptor[2];
|
|
6
|
+
|
|
7
|
+
if (!isStyleDescriptorArray(args)) {
|
|
8
|
+
return { scale: resolveValue(args) };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const x = resolveValue(args[0]);
|
|
12
|
+
const y = resolveValue(args[1]);
|
|
13
|
+
|
|
14
|
+
const isXValid = typeof x === "string" || typeof x === "number";
|
|
15
|
+
const isYValid = typeof y === "string" || typeof y === "number";
|
|
16
|
+
|
|
17
|
+
if (isXValid && isYValid) {
|
|
18
|
+
return x === y ? { scale: x } : [{ scaleX: x }, { scaleY: y }];
|
|
19
|
+
} else if (isXValid) {
|
|
20
|
+
return { scaleX: x };
|
|
21
|
+
} else if (isYValid) {
|
|
22
|
+
return { scaleY: y };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const rotate: StyleFunctionResolver = (resolveValue, descriptor) => {
|
|
29
|
+
const args = descriptor[2];
|
|
30
|
+
|
|
31
|
+
if (!isStyleDescriptorArray(args)) {
|
|
32
|
+
return { rotate: resolveValue(args) };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const x = resolveValue(args[0]);
|
|
36
|
+
const y = resolveValue(args[1]);
|
|
37
|
+
const z = resolveValue(args[2]);
|
|
38
|
+
|
|
39
|
+
const isXValid = typeof x === "string" || typeof x === "number";
|
|
40
|
+
const isYValid = typeof y === "string" || typeof y === "number";
|
|
41
|
+
const isZValid = typeof z === "string" || typeof z === "number";
|
|
42
|
+
|
|
43
|
+
if (isXValid && isYValid && isZValid) {
|
|
44
|
+
return [{ rotateX: x }, { rotateY: y }, { rotateZ: z }];
|
|
45
|
+
} else if (isXValid && isYValid) {
|
|
46
|
+
return [{ rotateX: x }, { rotateY: y }];
|
|
47
|
+
} else if (isXValid && isZValid) {
|
|
48
|
+
return [{ rotateX: x }, { rotateZ: z }];
|
|
49
|
+
} else if (isYValid && isZValid) {
|
|
50
|
+
return [{ rotateY: y }, { rotateZ: z }];
|
|
51
|
+
} else if (isXValid) {
|
|
52
|
+
return { rotateX: x };
|
|
53
|
+
} else if (isYValid) {
|
|
54
|
+
return { rotateY: y };
|
|
55
|
+
} else if (isZValid) {
|
|
56
|
+
return { rotateZ: z };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const translate: StyleFunctionResolver = (resolveValue, descriptor) => {
|
|
63
|
+
const args = descriptor[2];
|
|
64
|
+
|
|
65
|
+
if (!isStyleDescriptorArray(args)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const x = resolveValue(args[0]);
|
|
70
|
+
const y = resolveValue(args[1]);
|
|
71
|
+
|
|
72
|
+
const isXValid = typeof x === "string" || typeof x === "number";
|
|
73
|
+
const isYValid = typeof y === "string" || typeof y === "number";
|
|
74
|
+
|
|
75
|
+
if (isXValid && isYValid) {
|
|
76
|
+
return [{ translateX: x }, { translateY: y }];
|
|
77
|
+
} else if (isXValid) {
|
|
78
|
+
return { translateX: x };
|
|
79
|
+
} else if (isYValid) {
|
|
80
|
+
return { translateY: y };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return;
|
|
84
|
+
};
|
|
@@ -55,57 +55,57 @@ export function getStyledProps(
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
// Apply the handlers
|
|
58
|
-
if (hoverFamily.has(state.
|
|
58
|
+
if (hoverFamily.has(state.ruleEffectGetter)) {
|
|
59
59
|
result ??= {};
|
|
60
60
|
result.onHoverIn = getInteractionHandler(
|
|
61
|
-
state.
|
|
61
|
+
state.ruleEffectGetter,
|
|
62
62
|
"onHoverIn",
|
|
63
63
|
inline?.onHoverIn,
|
|
64
64
|
);
|
|
65
65
|
result.onHoverOut = getInteractionHandler(
|
|
66
|
-
state.
|
|
66
|
+
state.ruleEffectGetter,
|
|
67
67
|
"onHoverOut",
|
|
68
68
|
inline?.onHoverOut,
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if (activeFamily.has(state.
|
|
72
|
+
if (activeFamily.has(state.ruleEffectGetter)) {
|
|
73
73
|
result ??= {};
|
|
74
74
|
result.onPress = getInteractionHandler(
|
|
75
|
-
state.
|
|
75
|
+
state.ruleEffectGetter,
|
|
76
76
|
"onPress",
|
|
77
77
|
inline?.onPress,
|
|
78
78
|
);
|
|
79
79
|
result.onPressIn = getInteractionHandler(
|
|
80
|
-
state.
|
|
80
|
+
state.ruleEffectGetter,
|
|
81
81
|
"onPressIn",
|
|
82
82
|
inline?.onPressIn,
|
|
83
83
|
);
|
|
84
84
|
result.onPressOut = getInteractionHandler(
|
|
85
|
-
state.
|
|
85
|
+
state.ruleEffectGetter,
|
|
86
86
|
"onPressOut",
|
|
87
87
|
inline?.onPressOut,
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
if (focusFamily.has(state.
|
|
91
|
+
if (focusFamily.has(state.ruleEffectGetter)) {
|
|
92
92
|
result ??= {};
|
|
93
93
|
result.onBlur = getInteractionHandler(
|
|
94
|
-
state.
|
|
94
|
+
state.ruleEffectGetter,
|
|
95
95
|
"onBlur",
|
|
96
96
|
inline?.onBlur,
|
|
97
97
|
);
|
|
98
98
|
result.onFocus = getInteractionHandler(
|
|
99
|
-
state.
|
|
99
|
+
state.ruleEffectGetter,
|
|
100
100
|
"onFocus",
|
|
101
101
|
inline?.onFocus,
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
if (containerLayoutFamily.has(state.
|
|
105
|
+
if (containerLayoutFamily.has(state.ruleEffectGetter)) {
|
|
106
106
|
result ??= {};
|
|
107
107
|
result.onLayout = getInteractionHandler(
|
|
108
|
-
state.
|
|
108
|
+
state.ruleEffectGetter,
|
|
109
109
|
"onLayout",
|
|
110
110
|
inline?.onLayout,
|
|
111
111
|
);
|
|
@@ -7,34 +7,10 @@ import type {
|
|
|
7
7
|
} from "../../../compiler";
|
|
8
8
|
import type { RenderGuard } from "../conditions/guards";
|
|
9
9
|
import { type Getter, type VariableContextValue } from "../reactivity";
|
|
10
|
-
import { animation, timingFunctionResolver } from "./animation";
|
|
11
|
-
import { border } from "./border";
|
|
12
|
-
import { boxShadow } from "./box-shadow";
|
|
13
|
-
import { calc } from "./calc";
|
|
14
10
|
import type { calculateProps } from "./calculate-props";
|
|
15
11
|
import { transformKeys } from "./defaults";
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
brightness,
|
|
19
|
-
contrast,
|
|
20
|
-
dropShadow,
|
|
21
|
-
grayscale,
|
|
22
|
-
hueRotate,
|
|
23
|
-
invert,
|
|
24
|
-
opacity,
|
|
25
|
-
saturate,
|
|
26
|
-
sepia,
|
|
27
|
-
} from "./filters";
|
|
28
|
-
import {
|
|
29
|
-
fontScale,
|
|
30
|
-
hairlineWidth,
|
|
31
|
-
pixelRatio,
|
|
32
|
-
pixelSizeForLayoutSize,
|
|
33
|
-
platformColor,
|
|
34
|
-
roundToNearestPixel,
|
|
35
|
-
} from "./platform-functions";
|
|
36
|
-
import { textShadow } from "./text-shadow";
|
|
37
|
-
import { transform } from "./transform";
|
|
12
|
+
import * as functions from "./functions";
|
|
13
|
+
import * as shorthands from "./shorthands";
|
|
38
14
|
import { em, rem, vh, vw } from "./units";
|
|
39
15
|
import { varResolver } from "./variables";
|
|
40
16
|
|
|
@@ -57,34 +33,12 @@ export type StyleResolver = (
|
|
|
57
33
|
options: ResolveValueOptions,
|
|
58
34
|
) => unknown;
|
|
59
35
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"@textShadow": textShadow,
|
|
65
|
-
"@transform": transform,
|
|
66
|
-
"animationName": animation,
|
|
67
|
-
"cubic-bezier": timingFunctionResolver,
|
|
68
|
-
"steps": timingFunctionResolver,
|
|
69
|
-
"hue-rotate": hueRotate,
|
|
70
|
-
"drop-shadow": dropShadow,
|
|
71
|
-
blur,
|
|
72
|
-
brightness,
|
|
73
|
-
calc,
|
|
74
|
-
contrast,
|
|
36
|
+
const functionResolvers = {
|
|
37
|
+
...shorthands,
|
|
38
|
+
...functions,
|
|
39
|
+
animationName: shorthands.animation,
|
|
75
40
|
em,
|
|
76
|
-
fontScale,
|
|
77
|
-
grayscale,
|
|
78
|
-
hairlineWidth,
|
|
79
|
-
invert,
|
|
80
|
-
opacity,
|
|
81
|
-
pixelRatio,
|
|
82
|
-
pixelSizeForLayoutSize,
|
|
83
|
-
platformColor,
|
|
84
41
|
rem,
|
|
85
|
-
roundToNearestPixel,
|
|
86
|
-
saturate,
|
|
87
|
-
sepia,
|
|
88
42
|
vh,
|
|
89
43
|
vw,
|
|
90
44
|
};
|
|
@@ -116,10 +70,16 @@ export function resolveValue(
|
|
|
116
70
|
case "number":
|
|
117
71
|
case "boolean":
|
|
118
72
|
return value;
|
|
119
|
-
case "string":
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
73
|
+
case "string": {
|
|
74
|
+
if (value === "unset") {
|
|
75
|
+
return null;
|
|
76
|
+
} else if (value.endsWith("px")) {
|
|
77
|
+
// Inline vars() might set a value with a px suffix
|
|
78
|
+
return parseInt(value.slice(0, -2), 10);
|
|
79
|
+
} else {
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
123
83
|
case "object": {
|
|
124
84
|
if (!Array.isArray(value)) {
|
|
125
85
|
return value;
|
|
@@ -145,8 +105,8 @@ export function resolveValue(
|
|
|
145
105
|
|
|
146
106
|
if (name === "var") {
|
|
147
107
|
return varResolver(simpleResolve, value, get, options);
|
|
148
|
-
} else if (name in
|
|
149
|
-
const fn =
|
|
108
|
+
} else if (name in functionResolvers) {
|
|
109
|
+
const fn = functionResolvers[name as keyof typeof functionResolvers];
|
|
150
110
|
|
|
151
111
|
if (typeof fn !== "function") {
|
|
152
112
|
throw new Error(`Unknown function: ${name}`);
|
|
@@ -160,11 +120,7 @@ export function resolveValue(
|
|
|
160
120
|
) as StyleDescriptor;
|
|
161
121
|
} else if (transformKeys.has(name)) {
|
|
162
122
|
// translate, rotate, scale, etc.
|
|
163
|
-
|
|
164
|
-
return simpleResolve(args, castToArray);
|
|
165
|
-
} else if (transformKeys.has(name.slice(1))) {
|
|
166
|
-
// @translate, @rotate, @scale, etc.
|
|
167
|
-
return { [name.slice(1)]: simpleResolve(value[2], castToArray) };
|
|
123
|
+
return { [name]: simpleResolve(value[2], castToArray) };
|
|
168
124
|
} else {
|
|
169
125
|
let args = simpleResolve(value[2], castToArray);
|
|
170
126
|
|
|
@@ -178,6 +134,7 @@ export function resolveValue(
|
|
|
178
134
|
}
|
|
179
135
|
return arg;
|
|
180
136
|
})
|
|
137
|
+
.filter((value) => value !== "/")
|
|
181
138
|
.join(", ");
|
|
182
139
|
|
|
183
140
|
if (name === "radial-gradient") {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import { setDeepPath } from "
|
|
3
|
-
import { isStyleDescriptorArray } from "
|
|
4
|
-
import { ShortHandSymbol } from "
|
|
5
|
-
import { defaultValues } from "
|
|
6
|
-
import type { StyleResolver } from "
|
|
2
|
+
import { setDeepPath } from "../../../utils/objects";
|
|
3
|
+
import { isStyleDescriptorArray } from "../../../utils/style-value";
|
|
4
|
+
import { ShortHandSymbol } from "../constants";
|
|
5
|
+
import { defaultValues } from "../defaults";
|
|
6
|
+
import type { StyleResolver } from "../resolve";
|
|
7
7
|
|
|
8
8
|
type ShorthandType =
|
|
9
9
|
| "string"
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { weakFamily } from "../reactivity";
|
|
7
|
-
import type { StyleFunctionResolver } from "./resolve";
|
|
8
|
-
import { shorthandHandler } from "./shorthand";
|
|
2
|
+
import { applyShorthand } from "../../../utils";
|
|
3
|
+
import { StyleCollection } from "../../injection";
|
|
4
|
+
import type { StyleFunctionResolver } from "../resolve";
|
|
5
|
+
import { shorthandHandler } from "./_handler";
|
|
9
6
|
|
|
10
7
|
const name = ["animationName", "string", "none"] as const;
|
|
11
8
|
const delay = ["animationDelay", "number", 0] as const;
|
|
@@ -61,22 +58,6 @@ export const animationShorthand = shorthandHandler(
|
|
|
61
58
|
"tuples",
|
|
62
59
|
);
|
|
63
60
|
|
|
64
|
-
export const animatedComponentFamily = weakFamily(
|
|
65
|
-
(component: ComponentType) => {
|
|
66
|
-
if (
|
|
67
|
-
"displayName" in component &&
|
|
68
|
-
component.displayName?.startsWith("Animated.")
|
|
69
|
-
) {
|
|
70
|
-
return component;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const createAnimatedComponent =
|
|
74
|
-
require("react-native-reanimated").createAnimatedComponent;
|
|
75
|
-
|
|
76
|
-
return createAnimatedComponent(component);
|
|
77
|
-
},
|
|
78
|
-
);
|
|
79
|
-
|
|
80
61
|
export const animation: StyleFunctionResolver = (
|
|
81
62
|
resolveValue,
|
|
82
63
|
value,
|
|
@@ -139,43 +120,3 @@ export const animation: StyleFunctionResolver = (
|
|
|
139
120
|
|
|
140
121
|
return applyShorthand(animationShortHandTuples);
|
|
141
122
|
};
|
|
142
|
-
|
|
143
|
-
const advancedTimingFunctions: Record<
|
|
144
|
-
string,
|
|
145
|
-
() => (...args: any[]) => unknown
|
|
146
|
-
> = {
|
|
147
|
-
"cubic-bezier": () => {
|
|
148
|
-
return (
|
|
149
|
-
require("react-native-reanimated") as typeof import("react-native-reanimated")
|
|
150
|
-
).cubicBezier;
|
|
151
|
-
},
|
|
152
|
-
"steps": () => {
|
|
153
|
-
return (
|
|
154
|
-
require("react-native-reanimated") as typeof import("react-native-reanimated")
|
|
155
|
-
).steps;
|
|
156
|
-
},
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export const timingFunctionResolver: StyleFunctionResolver = (
|
|
160
|
-
resolveValue,
|
|
161
|
-
value,
|
|
162
|
-
) => {
|
|
163
|
-
const name = value[1];
|
|
164
|
-
const resolver = advancedTimingFunctions[name];
|
|
165
|
-
|
|
166
|
-
if (!resolver) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const args = resolveValue(value[2]);
|
|
171
|
-
|
|
172
|
-
if (!Array.isArray(args)) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const fn = resolver();
|
|
177
|
-
|
|
178
|
-
const result = fn(...args);
|
|
179
|
-
|
|
180
|
-
return result;
|
|
181
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isStyleDescriptorArray } from "
|
|
2
|
-
import type { StyleFunctionResolver } from "
|
|
3
|
-
import { shorthandHandler } from "./
|
|
1
|
+
import { isStyleDescriptorArray } from "../../../utils";
|
|
2
|
+
import type { StyleFunctionResolver } from "../resolve";
|
|
3
|
+
import { shorthandHandler } from "./_handler";
|
|
4
4
|
|
|
5
5
|
const color = ["color", "string"] as const;
|
|
6
6
|
const offsetX = ["offsetX", "number"] as const;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StyleFunctionResolver } from "
|
|
1
|
+
import type { StyleFunctionResolver } from "../resolve";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Handle the unparsable transform property by converting its values into StyleDeclarations
|
|
@@ -11,7 +11,9 @@ export const transform: StyleFunctionResolver = (
|
|
|
11
11
|
const transforms = resolveValue(transformDescriptor[2]);
|
|
12
12
|
|
|
13
13
|
if (Array.isArray(transforms)) {
|
|
14
|
-
return transforms.filter(
|
|
14
|
+
return transforms.filter(
|
|
15
|
+
(transform) => transform !== undefined && transform !== "initial",
|
|
16
|
+
) as unknown;
|
|
15
17
|
} else if (transforms) {
|
|
16
18
|
// If it's a single transform, wrap it in an array
|
|
17
19
|
return [transforms];
|
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
import { rem as remObs, vh as vhObs, vw as vwObs } from "../reactivity";
|
|
3
3
|
import type { StyleFunctionResolver } from "./resolve";
|
|
4
4
|
|
|
5
|
-
export const em: StyleFunctionResolver = (resolve, func) => {
|
|
5
|
+
export const em: StyleFunctionResolver = (resolve, func, get) => {
|
|
6
6
|
let value = func[2];
|
|
7
7
|
|
|
8
|
-
if (
|
|
8
|
+
if (typeof value !== "number") {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
let emValue = resolve([{}, "var", ["__rn-css-em"]]);
|
|
13
13
|
|
|
14
14
|
if (typeof emValue !== "number") {
|
|
15
|
-
|
|
15
|
+
emValue = get(remObs);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (typeof emValue !== "number") {
|
|
19
|
+
return;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
return round(Number(value) * emValue);
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { StyleDescriptor, StyleFunction } from "../../../compiler";
|
|
2
2
|
import { isStyleDescriptorArray } from "../../utils";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
universalVariables,
|
|
6
|
-
VAR_SYMBOL,
|
|
7
|
-
type Getter,
|
|
8
|
-
} from "../reactivity";
|
|
3
|
+
import { VAR_SYMBOL, type Getter } from "../reactivity";
|
|
4
|
+
import { rootVariables, universalVariables } from "../root";
|
|
9
5
|
import type { ResolveValueOptions, SimpleResolveValue } from "./resolve";
|
|
10
6
|
|
|
11
7
|
export function varResolver(
|
|
@@ -23,6 +23,10 @@ export function getDeepPath(source: any, paths: string | string[] | false) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
return target;
|
|
26
|
+
} else if (transformKeys.has(paths)) {
|
|
27
|
+
return Array.isArray(source?.transform)
|
|
28
|
+
? source.transform.find((t: any) => t[paths] !== undefined)
|
|
29
|
+
: source.transform;
|
|
26
30
|
} else {
|
|
27
31
|
return source?.[paths];
|
|
28
32
|
}
|
|
@@ -49,8 +53,13 @@ export function applyValue(
|
|
|
49
53
|
prop: string,
|
|
50
54
|
value: any,
|
|
51
55
|
) {
|
|
56
|
+
// This is confusing.
|
|
57
|
+
// An undefined value means "don't set anything" (something failed while parsing)
|
|
58
|
+
// While a null value means "remove this value", which in React Native means "set to undefined"
|
|
52
59
|
if (value === undefined) {
|
|
53
60
|
return;
|
|
61
|
+
} else if (value === null) {
|
|
62
|
+
value = undefined;
|
|
54
63
|
}
|
|
55
64
|
|
|
56
65
|
if (transformKeys.has(prop)) {
|
|
@@ -58,12 +67,15 @@ export function applyValue(
|
|
|
58
67
|
target.transform = [];
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
const
|
|
70
|
+
const transformArray: Record<string, unknown>[] = target.transform;
|
|
62
71
|
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
// Remove any existing values
|
|
73
|
+
target.transform = transformArray.filter((t) => !(prop in t));
|
|
74
|
+
|
|
75
|
+
if (Array.isArray(value)) {
|
|
76
|
+
target.transform.push(...value);
|
|
65
77
|
} else {
|
|
66
|
-
target.transform.push(
|
|
78
|
+
target.transform.push(value);
|
|
67
79
|
}
|
|
68
80
|
return;
|
|
69
81
|
} else if (typeof value === "object" && value && ShortHandSymbol in value) {
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _index = require("../compiler/index.js");
|
|
4
|
-
test("multiple classes", () => {
|
|
5
|
-
const compiled = (0, _index.compile)(`
|
|
6
|
-
.my-class.test {
|
|
7
|
-
color: red;
|
|
8
|
-
}`);
|
|
9
|
-
expect(compiled).toStrictEqual({
|
|
10
|
-
s: [["test", [{
|
|
11
|
-
aq: [["a", "className", "*=", "my-class"]],
|
|
12
|
-
d: [{
|
|
13
|
-
color: "#f00"
|
|
14
|
-
}],
|
|
15
|
-
s: [1, 2],
|
|
16
|
-
v: [["__rn-css-color", "#f00"]]
|
|
17
|
-
}]]]
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=attributes.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","test","compiled","compile","expect","toStrictEqual","s","aq","d","color","v"],"sourceRoot":"../../../src","sources":["compiler/attributes.test.ts"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEAC,IAAI,CAAC,kBAAkB,EAAE,MAAM;EAC7B,MAAMC,QAAQ,GAAG,IAAAC,cAAO,EAAC;AAC3B;AACA;AACA,EAAE,CAAC;EAEDC,MAAM,CAACF,QAAQ,CAAC,CAACG,aAAa,CAAC;IAC7BC,CAAC,EAAE,CACD,CACE,MAAM,EACN,CACE;MACEC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;MAC1CC,CAAC,EAAE,CACD;QACEC,KAAK,EAAE;MACT,CAAC,CACF;MACDH,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MACTI,CAAC,EAAE,CAAC,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAChC,CAAC,CACF,CACF;EAEL,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","_injection","_reactivity","_shorthand","name","delay","duration","iteration","fill","playState","direction","timingFunction","animationShorthand","exports","shorthandHandler","animatedComponentFamily","weakFamily","component","displayName","startsWith","createAnimatedComponent","animation","resolveValue","value","get","options","animationShortHandTuples","Array","isArray","pop","nameTuple","find","tuple","keyframes","StyleCollection","progress","declarations","props","calculateProps","s","d","renderGuards","inheritedVariables","inlineVariables","normal","Object","assign","important","style","applyShorthand","advancedTimingFunctions","cubic-bezier","cubicBezier","steps","timingFunctionResolver","resolver","args","fn","result"],"sourceRoot":"../../../../../src","sources":["runtime/native/styles/animation.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAPA;;AASA,MAAMI,IAAI,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAU;AACzD,MAAMC,KAAK,GAAG,CAAC,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAAU;AACtD,MAAMC,QAAQ,GAAG,CAAC,mBAAmB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CAAC,CAAC;EAEnC,IAAI,CAACI,KAAK,CAACC,OAAO,CAAC4B,IAAI,CAAC,EAAE;IACxB;EACF;EAEA,MAAMC,EAAE,GAAGF,QAAQ,CAAC,CAAC;EAErB,MAAMG,MAAM,GAAGD,EAAE,CAAC,GAAGD,IAAI,CAAC;EAE1B,OAAOE,MAAM;AACf,CAAC;AAAC7C,OAAA,CAAAyC,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_shorthand","require","width","style","color","border","exports","shorthandHandler"],"sourceRoot":"../../../../../src","sources":["runtime/native/styles/border.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,MAAMC,KAAK,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAU;AAChD,MAAMC,KAAK,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAU;AAChD,MAAMC,KAAK,GAAG,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,CAAU;AAEjD,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG,IAAAE,2BAAgB,EACpC,CAAC,CAACL,KAAK,EAAEC,KAAK,EAAEC,KAAK,CAAC,EAAE,CAACD,KAAK,EAAEC,KAAK,CAAC,EAAE,CAACF,KAAK,EAAEC,KAAK,CAAC,EAAE,CAACA,KAAK,CAAC,CAAC,EAChE,EACF,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","_shorthand","color","offsetX","offsetY","blurRadius","spreadDistance","handler","shorthandHandler","boxShadow","resolveValue","func","get","options","args","isStyleDescriptorArray","flatMap","shadows","undefined","length","Array","isArray","map","shadow","filter","v","exports"],"sourceRoot":"../../../../../src","sources":["runtime/native/styles/box-shadow.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,MAAME,KAAK,GAAG,CAAC,OA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IC,KAAK,CAACC,OAAO,CAACJ,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;UACpC,OAAOA,OAAO,CACXK,GAAG,CAAEC,MAAM,IAAKhB,OAAO,CAACG,YAAY,EAAEa,MAAM,EAAEX,GAAG,EAAEC,OAAO,CAAC,CAAC,CAC5DW,MAAM,CAAEC,CAAC,IAAKA,CAAC,KAAKP,SAAS,CAAC;QACnC,CAAC,MAAM;UACL,OAAOX,OAAO,CAACG,YAAY,EAAEO,OAAO,EAAEL,GAAG,EAAEC,OAAO,CAAC;QACrD;MACF,CAAC,MAAM;QACL,OAAON,OAAO,CAACG,YAAY,EAAEO,OAAO,EAAEL,GAAG,EAAEC,OAAO,CAAC;MACrD;IACF,CAAC,CAAC;EACJ;AACF,CAAC;AAACa,OAAA,CAAAjB,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.calc = void 0;
|
|
7
|
-
var _index = require("../../utils/index.js");
|
|
8
|
-
/* eslint-disable */
|
|
9
|
-
|
|
10
|
-
const calcPrecedence = {
|
|
11
|
-
"+": 1,
|
|
12
|
-
"-": 1,
|
|
13
|
-
"*": 2,
|
|
14
|
-
"/": 2
|
|
15
|
-
};
|
|
16
|
-
const calc = (resolveValue, func) => {
|
|
17
|
-
let mode;
|
|
18
|
-
const values = [];
|
|
19
|
-
const ops = [];
|
|
20
|
-
const args = resolveValue(func[2]);
|
|
21
|
-
if (!(0, _index.isStyleDescriptorArray)(args)) return;
|
|
22
|
-
for (let token of args) {
|
|
23
|
-
if (typeof token === "number") {
|
|
24
|
-
if (!mode) mode = "number";
|
|
25
|
-
if (mode !== "number") return;
|
|
26
|
-
values.push(token);
|
|
27
|
-
continue;
|
|
28
|
-
} else if (typeof token === "string") {
|
|
29
|
-
if (token === "(") {
|
|
30
|
-
ops.push(token);
|
|
31
|
-
} else if (token === ")") {
|
|
32
|
-
// Resolve all values within the brackets
|
|
33
|
-
while (ops.length && ops[ops.length - 1] !== "(") {
|
|
34
|
-
applyCalcOperator(ops.pop(), values.pop(), values.pop(), values);
|
|
35
|
-
}
|
|
36
|
-
ops.pop();
|
|
37
|
-
} else if (token.endsWith("%")) {
|
|
38
|
-
if (!mode) mode = "percentage";
|
|
39
|
-
if (mode !== "percentage") return;
|
|
40
|
-
values.push(Number.parseFloat(token.slice(0, -1)));
|
|
41
|
-
} else {
|
|
42
|
-
// This means we have an operator
|
|
43
|
-
while (ops.length && ops[ops.length - 1] &&
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
calcPrecedence[ops[ops.length - 1]] >= calcPrecedence[token]) {
|
|
46
|
-
applyCalcOperator(ops.pop(), values.pop(), values.pop(), values);
|
|
47
|
-
}
|
|
48
|
-
ops.push(token);
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
// We got something unexpected
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
while (ops.length) {
|
|
56
|
-
applyCalcOperator(ops.pop(), values.pop(), values.pop(), values);
|
|
57
|
-
}
|
|
58
|
-
if (!mode) return;
|
|
59
|
-
const num = values[0];
|
|
60
|
-
if (typeof num !== "number") {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const value = Math.round((num + Number.EPSILON) * 100) / 100;
|
|
64
|
-
if (mode === "percentage") {
|
|
65
|
-
return `${value}%`;
|
|
66
|
-
}
|
|
67
|
-
return value;
|
|
68
|
-
};
|
|
69
|
-
exports.calc = calc;
|
|
70
|
-
function applyCalcOperator(operator, b = 0,
|
|
71
|
-
// These are reversed because we pop them off the stack
|
|
72
|
-
a = 0, values) {
|
|
73
|
-
switch (operator) {
|
|
74
|
-
case "+":
|
|
75
|
-
return values.push(a + b);
|
|
76
|
-
case "-":
|
|
77
|
-
return values.push(a - b);
|
|
78
|
-
case "*":
|
|
79
|
-
return values.push(a * b);
|
|
80
|
-
case "/":
|
|
81
|
-
return values.push(a / b);
|
|
82
|
-
}
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=calc.js.map
|