react-native-css 3.0.0-nightly.27bd5e2 → 3.0.0-nightly.46bc0ab
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/compiler/atRules.js +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 +57 -18
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +209 -107
- 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 +136 -45
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/components/ActivityIndicator.js +22 -0
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -0
- package/dist/commonjs/components/Button.js +22 -0
- package/dist/commonjs/components/Button.js.map +1 -0
- package/dist/commonjs/components/FlatList.js +19 -0
- package/dist/commonjs/components/FlatList.js.map +1 -0
- package/dist/commonjs/components/Image.js +17 -0
- package/dist/commonjs/components/Image.js.map +1 -0
- package/dist/commonjs/components/TextInput.js +17 -0
- package/dist/commonjs/components/TextInput.js.map +1 -0
- package/dist/commonjs/components/index.js +40 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/jest/index.js +34 -28
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +7 -5
- 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 +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 +22 -17
- 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 +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/attributes.test.js +1 -1
- package/dist/module/compiler/attributes.test.js.map +1 -1
- package/dist/module/compiler/compiler.js +57 -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 +204 -103
- 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 +135 -44
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/components/ActivityIndicator.js +17 -0
- package/dist/module/components/ActivityIndicator.js.map +1 -0
- package/dist/module/components/Button.js +17 -0
- package/dist/module/components/Button.js.map +1 -0
- package/dist/module/components/FlatList.js +14 -0
- package/dist/module/components/FlatList.js.map +1 -0
- package/dist/module/components/Image.js +12 -0
- package/dist/module/components/Image.js.map +1 -0
- package/dist/module/components/TextInput.js +12 -0
- package/dist/module/components/TextInput.js.map +1 -0
- package/dist/module/components/index.js +5 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/jest/index.js +34 -13
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +7 -5
- 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 +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 +22 -17
- 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 +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/example/app.config.d.ts +4 -0
- package/dist/typescript/commonjs/example/app.config.d.ts.map +1 -0
- 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 +6 -7
- 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 +23 -5
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +13 -0
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Button.d.ts +13 -0
- package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/FlatList.d.ts +10 -0
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Image.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +5 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +21 -5
- 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.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/example/app.config.d.ts +4 -0
- package/dist/typescript/module/example/app.config.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +6 -7
- 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 +23 -5
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +13 -0
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Button.d.ts +13 -0
- package/dist/typescript/module/src/components/Button.d.ts.map +1 -0
- package/dist/typescript/module/src/components/FlatList.d.ts +10 -0
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Image.d.ts +8 -0
- package/dist/typescript/module/src/components/Image.d.ts.map +1 -0
- package/dist/typescript/module/src/components/TextInput.d.ts +8 -0
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +5 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +21 -5
- 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.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 +28 -4
- package/src/compiler/atRules.ts +17 -3
- package/src/compiler/attributes.test.ts +1 -1
- package/src/compiler/compiler.ts +63 -33
- package/src/compiler/compiler.types.ts +8 -8
- package/src/compiler/declarations.ts +374 -127
- 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 +179 -42
- package/src/components/ActivityIndicator.tsx +27 -0
- package/src/components/Button.tsx +22 -0
- package/src/components/FlatList.tsx +21 -0
- package/src/components/Image.tsx +17 -0
- package/src/components/TextInput.tsx +17 -0
- package/src/components/index.tsx +5 -0
- package/src/jest/index.ts +45 -13
- package/src/metro/index.ts +12 -6
- 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 +32 -31
- package/src/runtime/native/react/interaction.ts +12 -12
- package/src/runtime/native/react/rules.ts +23 -14
- 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 +14 -4
- package/src/runtime/utils/specificity.ts +1 -0
- package/types.d.ts +70 -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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AttributeQuery } from "../../../compiler";
|
|
2
|
+
import type { Props } from "../../runtime.types";
|
|
3
|
+
import type { RenderGuard } from "./guards";
|
|
4
|
+
|
|
5
|
+
export function testAttributes(
|
|
6
|
+
queries: AttributeQuery[],
|
|
7
|
+
props: Props,
|
|
8
|
+
guards: RenderGuard[],
|
|
9
|
+
) {
|
|
10
|
+
return queries.every((query) => testAttribute(query, props, guards));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function testAttribute(
|
|
14
|
+
[type, prop, operator, testValue]: AttributeQuery,
|
|
15
|
+
props: Props,
|
|
16
|
+
guards: RenderGuard[],
|
|
17
|
+
) {
|
|
18
|
+
let value: unknown;
|
|
19
|
+
|
|
20
|
+
if (type === "a") {
|
|
21
|
+
value = props?.[prop];
|
|
22
|
+
} else {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
24
|
+
value = props?.dataSet?.[prop];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
guards.push([type, prop, value]);
|
|
28
|
+
|
|
29
|
+
if (!operator) {
|
|
30
|
+
return value !== undefined && value !== null && value !== false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
switch (operator) {
|
|
34
|
+
case "!":
|
|
35
|
+
return !value;
|
|
36
|
+
case "=":
|
|
37
|
+
return value == testValue;
|
|
38
|
+
case "~=":
|
|
39
|
+
return testValue && value?.toString().split(" ").includes(testValue);
|
|
40
|
+
case "|=":
|
|
41
|
+
return testValue && value?.toString().startsWith(testValue + "-");
|
|
42
|
+
case "^=":
|
|
43
|
+
return testValue && value?.toString().startsWith(testValue);
|
|
44
|
+
case "$=":
|
|
45
|
+
return testValue && value?.toString().endsWith(testValue);
|
|
46
|
+
case "*=":
|
|
47
|
+
return testValue && value?.toString().includes(testValue);
|
|
48
|
+
default:
|
|
49
|
+
operator satisfies never;
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -14,8 +14,9 @@ import {
|
|
|
14
14
|
focusFamily,
|
|
15
15
|
hoverFamily,
|
|
16
16
|
type ContainerContextValue,
|
|
17
|
-
type
|
|
17
|
+
type Getter,
|
|
18
18
|
} from "../reactivity";
|
|
19
|
+
// import { testAttributes } from "./attributes";
|
|
19
20
|
import type { RenderGuard } from "./guards";
|
|
20
21
|
|
|
21
22
|
export const DEFAULT_CONTAINER_NAME = "c:___default___";
|
|
@@ -24,10 +25,10 @@ export function testContainerQueries(
|
|
|
24
25
|
queries: ContainerQuery[],
|
|
25
26
|
inheritedContainers: ContainerContextValue,
|
|
26
27
|
guards: RenderGuard[],
|
|
27
|
-
|
|
28
|
+
get: Getter,
|
|
28
29
|
) {
|
|
29
30
|
return queries.every((query) => {
|
|
30
|
-
return testContainerQuery(query, inheritedContainers, guards,
|
|
31
|
+
return testContainerQuery(query, inheritedContainers, guards, get);
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -35,7 +36,7 @@ export function testContainerQuery(
|
|
|
35
36
|
query: ContainerQuery,
|
|
36
37
|
inheritedContainers: ContainerContextValue,
|
|
37
38
|
guards: RenderGuard[],
|
|
38
|
-
|
|
39
|
+
get: Getter,
|
|
39
40
|
): boolean {
|
|
40
41
|
const name = query.n ?? DEFAULT_CONTAINER_NAME;
|
|
41
42
|
const container = inheritedContainers[name]!;
|
|
@@ -46,11 +47,15 @@ export function testContainerQuery(
|
|
|
46
47
|
return false;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
if (query.
|
|
50
|
+
// if (query.a && !testAttributes(query.a, container.props, guards)) {
|
|
51
|
+
// return false;
|
|
52
|
+
// }
|
|
53
|
+
|
|
54
|
+
if (query.m && !testContainerMediaCondition(query.m, container, get)) {
|
|
50
55
|
return false;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
if (query.p && !testContainerPseudoCondition(query.p, container,
|
|
58
|
+
if (query.p && !testContainerPseudoCondition(query.p, container, get)) {
|
|
54
59
|
return false;
|
|
55
60
|
}
|
|
56
61
|
|
|
@@ -60,15 +65,15 @@ export function testContainerQuery(
|
|
|
60
65
|
function testContainerPseudoCondition(
|
|
61
66
|
query: PseudoClassesQuery,
|
|
62
67
|
containerKey: WeakKey,
|
|
63
|
-
|
|
68
|
+
get: Getter,
|
|
64
69
|
): boolean {
|
|
65
|
-
if (query.h && !hoverFamily(containerKey)
|
|
70
|
+
if (query.h && !get(hoverFamily(containerKey))) {
|
|
66
71
|
return false;
|
|
67
72
|
}
|
|
68
|
-
if (query.a && !activeFamily(containerKey)
|
|
73
|
+
if (query.a && !get(activeFamily(containerKey))) {
|
|
69
74
|
return false;
|
|
70
75
|
}
|
|
71
|
-
if (query.f && !focusFamily(containerKey)
|
|
76
|
+
if (query.f && !get(focusFamily(containerKey))) {
|
|
72
77
|
return false;
|
|
73
78
|
}
|
|
74
79
|
return true;
|
|
@@ -77,18 +82,18 @@ function testContainerPseudoCondition(
|
|
|
77
82
|
function testContainerMediaCondition(
|
|
78
83
|
condition: MediaCondition,
|
|
79
84
|
containerKey: WeakKey,
|
|
80
|
-
|
|
85
|
+
get: Getter,
|
|
81
86
|
): boolean {
|
|
82
87
|
switch (condition[0]) {
|
|
83
88
|
case "!":
|
|
84
|
-
return !testContainerMediaCondition(condition[1], containerKey,
|
|
89
|
+
return !testContainerMediaCondition(condition[1], containerKey, get);
|
|
85
90
|
case "&":
|
|
86
91
|
return condition[1].every((query) => {
|
|
87
|
-
return testContainerMediaCondition(query, containerKey,
|
|
92
|
+
return testContainerMediaCondition(query, containerKey, get);
|
|
88
93
|
});
|
|
89
94
|
case "|":
|
|
90
95
|
return condition[1].some((query) => {
|
|
91
|
-
return testContainerMediaCondition(query, containerKey,
|
|
96
|
+
return testContainerMediaCondition(query, containerKey, get);
|
|
92
97
|
});
|
|
93
98
|
case "!!":
|
|
94
99
|
return false;
|
|
@@ -99,7 +104,7 @@ function testContainerMediaCondition(
|
|
|
99
104
|
case "<":
|
|
100
105
|
case "<=":
|
|
101
106
|
case "=": {
|
|
102
|
-
const left = getContainerFeatureValue(condition[1], containerKey,
|
|
107
|
+
const left = getContainerFeatureValue(condition[1], containerKey, get);
|
|
103
108
|
const right = condition[2];
|
|
104
109
|
|
|
105
110
|
if (condition[0] === "=") {
|
|
@@ -133,21 +138,21 @@ function testContainerMediaCondition(
|
|
|
133
138
|
function getContainerFeatureValue(
|
|
134
139
|
name: MediaFeatureNameFor_ContainerSizeFeatureId,
|
|
135
140
|
containerKey: WeakKey,
|
|
136
|
-
|
|
141
|
+
get: Getter,
|
|
137
142
|
): StyleDescriptor {
|
|
138
143
|
switch (name) {
|
|
139
144
|
case "width":
|
|
140
|
-
return containerWidthFamily(containerKey)
|
|
145
|
+
return get(containerWidthFamily(containerKey));
|
|
141
146
|
case "height":
|
|
142
|
-
return containerHeightFamily(containerKey)
|
|
147
|
+
return get(containerHeightFamily(containerKey));
|
|
143
148
|
case "aspect-ratio": {
|
|
144
|
-
const width = containerWidthFamily(containerKey)
|
|
145
|
-
const height =
|
|
149
|
+
const width = get(containerWidthFamily(containerKey));
|
|
150
|
+
const height = get(containerHeightFamily(containerKey));
|
|
146
151
|
return width / height;
|
|
147
152
|
}
|
|
148
153
|
case "orientation":
|
|
149
|
-
const width = containerWidthFamily(containerKey)
|
|
150
|
-
const height =
|
|
154
|
+
const width = get(containerWidthFamily(containerKey));
|
|
155
|
+
const height = get(containerHeightFamily(containerKey));
|
|
151
156
|
return width > height ? "landscape" : "portrait";
|
|
152
157
|
case "inline-size":
|
|
153
158
|
case "block-size":
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import type { ComponentState } from "../react/useNativeCss";
|
|
3
3
|
import type {
|
|
4
4
|
ContainerContextValue,
|
|
5
|
-
Effect,
|
|
6
5
|
VariableContextValue,
|
|
7
6
|
} from "../reactivity";
|
|
8
7
|
|
|
@@ -10,7 +9,7 @@ export type RenderGuard =
|
|
|
10
9
|
| ["a", string, any]
|
|
11
10
|
| ["d", string, any]
|
|
12
11
|
| ["v", string, any]
|
|
13
|
-
| ["c", string,
|
|
12
|
+
| ["c", string, WeakKey];
|
|
14
13
|
|
|
15
14
|
export function testGuards(
|
|
16
15
|
state: ComponentState,
|
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
AttributeQuery,
|
|
4
|
-
PseudoClassesQuery,
|
|
5
|
-
StyleRule,
|
|
6
|
-
} from "../../../compiler";
|
|
1
|
+
import type { PseudoClassesQuery, StyleRule } from "../../../compiler";
|
|
7
2
|
import type { Props } from "../../runtime.types";
|
|
8
3
|
import {
|
|
9
4
|
activeFamily,
|
|
10
5
|
focusFamily,
|
|
11
6
|
hoverFamily,
|
|
12
7
|
type ContainerContextValue,
|
|
13
|
-
type
|
|
8
|
+
type Getter,
|
|
14
9
|
} from "../reactivity";
|
|
10
|
+
import { testAttributes } from "./attributes";
|
|
15
11
|
import { testContainerQueries } from "./container-query";
|
|
16
12
|
import type { RenderGuard } from "./guards";
|
|
17
13
|
import { testMediaQuery } from "./media-query";
|
|
18
14
|
|
|
19
15
|
export function testRule(
|
|
20
16
|
rule: StyleRule,
|
|
21
|
-
|
|
17
|
+
get: Getter,
|
|
22
18
|
props: Props,
|
|
23
19
|
guards: RenderGuard[],
|
|
24
20
|
containerContext: ContainerContextValue,
|
|
25
21
|
) {
|
|
26
|
-
if (rule.p && !pseudoClasses(rule.p,
|
|
22
|
+
if (rule.p && !pseudoClasses(rule.p, get)) {
|
|
27
23
|
return false;
|
|
28
24
|
}
|
|
29
|
-
if (rule.m && !testMediaQuery(rule.m,
|
|
25
|
+
if (rule.m && !testMediaQuery(rule.m, get)) {
|
|
30
26
|
return false;
|
|
31
27
|
}
|
|
32
|
-
if (rule.aq && !
|
|
28
|
+
if (rule.aq && !testAttributes(rule.aq, props, guards)) {
|
|
33
29
|
return false;
|
|
34
30
|
}
|
|
35
31
|
if (
|
|
36
32
|
rule.cq &&
|
|
37
|
-
!testContainerQueries(rule.cq, containerContext, guards,
|
|
33
|
+
!testContainerQueries(rule.cq, containerContext, guards, get)
|
|
38
34
|
) {
|
|
39
35
|
return false;
|
|
40
36
|
}
|
|
@@ -42,65 +38,15 @@ export function testRule(
|
|
|
42
38
|
return true;
|
|
43
39
|
}
|
|
44
40
|
|
|
45
|
-
function pseudoClasses(query: PseudoClassesQuery,
|
|
46
|
-
if (query.h && !hoverFamily(
|
|
41
|
+
function pseudoClasses(query: PseudoClassesQuery, get: Getter) {
|
|
42
|
+
if (query.h && !get(hoverFamily(get))) {
|
|
47
43
|
return false;
|
|
48
44
|
}
|
|
49
|
-
if (query.a && !activeFamily(
|
|
45
|
+
if (query.a && !get(activeFamily(get))) {
|
|
50
46
|
return false;
|
|
51
47
|
}
|
|
52
|
-
if (query.f && !focusFamily(
|
|
48
|
+
if (query.f && !get(focusFamily(get))) {
|
|
53
49
|
return false;
|
|
54
50
|
}
|
|
55
51
|
return true;
|
|
56
52
|
}
|
|
57
|
-
|
|
58
|
-
function attributes(
|
|
59
|
-
queries: AttributeQuery[],
|
|
60
|
-
props: Props,
|
|
61
|
-
guards: RenderGuard[],
|
|
62
|
-
) {
|
|
63
|
-
return queries.every((query) => testAttribute(query, props, guards));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function testAttribute(
|
|
67
|
-
query: AttributeQuery,
|
|
68
|
-
props: Props,
|
|
69
|
-
guards: RenderGuard[],
|
|
70
|
-
) {
|
|
71
|
-
let value: any;
|
|
72
|
-
|
|
73
|
-
if (query[0] === "a") {
|
|
74
|
-
value = props?.[query[1]];
|
|
75
|
-
} else {
|
|
76
|
-
value = props?.dataSet?.[query[1]];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
guards.push([query[0], query[1], value]);
|
|
80
|
-
|
|
81
|
-
const operator = query[2];
|
|
82
|
-
|
|
83
|
-
if (!operator) {
|
|
84
|
-
return value !== undefined && value !== null && value !== false;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
switch (operator) {
|
|
88
|
-
case "!":
|
|
89
|
-
return !value;
|
|
90
|
-
case "=":
|
|
91
|
-
return value == query[3];
|
|
92
|
-
case "~=":
|
|
93
|
-
return value?.toString().split(" ").includes(query[3]);
|
|
94
|
-
case "|=":
|
|
95
|
-
return value?.toString().startsWith(query[3] + "-");
|
|
96
|
-
case "^=":
|
|
97
|
-
return value?.toString().startsWith(query[3]);
|
|
98
|
-
case "$=":
|
|
99
|
-
return value?.toString().endsWith(query[3]);
|
|
100
|
-
case "*=":
|
|
101
|
-
return value?.toString().includes(query[3]);
|
|
102
|
-
default:
|
|
103
|
-
operator satisfies never;
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
@@ -2,61 +2,61 @@
|
|
|
2
2
|
import { PixelRatio, Platform } from "react-native";
|
|
3
3
|
|
|
4
4
|
import type { MediaCondition } from "../../../compiler";
|
|
5
|
-
import { colorScheme, vh, vw, type
|
|
5
|
+
import { colorScheme, vh, vw, type Getter } from "../reactivity";
|
|
6
6
|
|
|
7
|
-
export function testMediaQuery(mediaQueries: MediaCondition[],
|
|
8
|
-
return mediaQueries.every((query) => test(query,
|
|
7
|
+
export function testMediaQuery(mediaQueries: MediaCondition[], get: Getter) {
|
|
8
|
+
return mediaQueries.every((query) => test(query, get));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function test(mediaQuery: MediaCondition,
|
|
11
|
+
function test(mediaQuery: MediaCondition, get: Getter): Boolean {
|
|
12
12
|
switch (mediaQuery[0]) {
|
|
13
13
|
case "[]":
|
|
14
14
|
case "!!":
|
|
15
15
|
return false;
|
|
16
16
|
case "!":
|
|
17
|
-
return !test(mediaQuery[1],
|
|
17
|
+
return !test(mediaQuery[1], get);
|
|
18
18
|
case "&":
|
|
19
19
|
return mediaQuery[1].every((query) => {
|
|
20
|
-
return test(query,
|
|
20
|
+
return test(query, get);
|
|
21
21
|
});
|
|
22
22
|
case "|":
|
|
23
23
|
return mediaQuery[1].some((query) => {
|
|
24
|
-
return test(query,
|
|
24
|
+
return test(query, get);
|
|
25
25
|
});
|
|
26
26
|
case ">":
|
|
27
27
|
case ">=":
|
|
28
28
|
case "<":
|
|
29
29
|
case "<=":
|
|
30
30
|
case "=": {
|
|
31
|
-
return testComparison(mediaQuery,
|
|
31
|
+
return testComparison(mediaQuery, get);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
function testComparison(mediaQuery: MediaCondition,
|
|
36
|
+
function testComparison(mediaQuery: MediaCondition, get: Getter): Boolean {
|
|
37
37
|
let left: number | undefined;
|
|
38
38
|
const right = mediaQuery[2];
|
|
39
39
|
|
|
40
40
|
switch (mediaQuery[1]) {
|
|
41
|
+
case "hover":
|
|
42
|
+
return true;
|
|
41
43
|
case "platform":
|
|
42
|
-
return right === Platform.OS;
|
|
44
|
+
return right === "native" || right === Platform.OS;
|
|
43
45
|
case "prefers-color-scheme": {
|
|
44
|
-
return right ===
|
|
46
|
+
return right === get(colorScheme);
|
|
45
47
|
}
|
|
46
48
|
case "display-mode":
|
|
47
49
|
return right === "native" || Platform.OS === right;
|
|
48
50
|
case "min-width":
|
|
49
|
-
return typeof right === "number" &&
|
|
51
|
+
return typeof right === "number" && get(vw) >= right;
|
|
50
52
|
case "max-width":
|
|
51
|
-
return typeof right === "number" &&
|
|
53
|
+
return typeof right === "number" && get(vw) <= right;
|
|
52
54
|
case "min-height":
|
|
53
|
-
return typeof right === "number" &&
|
|
55
|
+
return typeof right === "number" && get(vh) >= right;
|
|
54
56
|
case "max-height":
|
|
55
|
-
return typeof right === "number" &&
|
|
57
|
+
return typeof right === "number" && get(vh) <= right;
|
|
56
58
|
case "orientation":
|
|
57
|
-
return right === "landscape"
|
|
58
|
-
? vh.get(effect) < vw.get(effect)
|
|
59
|
-
: vh.get(effect) >= vw.get(effect);
|
|
59
|
+
return right === "landscape" ? get(vh) < get(vw) : get(vh) >= get(vw);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (typeof right !== "number") {
|
|
@@ -65,10 +65,10 @@ function testComparison(mediaQuery: MediaCondition, effect: Effect): Boolean {
|
|
|
65
65
|
|
|
66
66
|
switch (mediaQuery[1]) {
|
|
67
67
|
case "width":
|
|
68
|
-
left =
|
|
68
|
+
left = get(vw);
|
|
69
69
|
break;
|
|
70
70
|
case "height":
|
|
71
|
-
left =
|
|
71
|
+
left = get(vh);
|
|
72
72
|
break;
|
|
73
73
|
case "resolution":
|
|
74
74
|
left = PixelRatio.get();
|
|
@@ -3,13 +3,14 @@ import type {
|
|
|
3
3
|
ReactNativeCssStyleSheet,
|
|
4
4
|
StyleRuleSet,
|
|
5
5
|
} from "../../compiler";
|
|
6
|
+
import { DEFAULT_CONTAINER_NAME } from "./conditions/container-query";
|
|
6
7
|
import {
|
|
7
8
|
family,
|
|
8
9
|
observable,
|
|
9
10
|
observableBatch,
|
|
10
|
-
rootVariables,
|
|
11
11
|
type Observable,
|
|
12
12
|
} from "./reactivity";
|
|
13
|
+
import { rootVariables } from "./root";
|
|
13
14
|
|
|
14
15
|
export function StyleCollection() {
|
|
15
16
|
return null;
|
|
@@ -27,6 +28,36 @@ StyleCollection.keyframes = family<string, Observable<Animation_V2[1]>>(() => {
|
|
|
27
28
|
StyleCollection.inject = function (options: ReactNativeCssStyleSheet) {
|
|
28
29
|
observableBatch.current = new Set();
|
|
29
30
|
|
|
31
|
+
StyleCollection.styles("will-change-variable").set([
|
|
32
|
+
{
|
|
33
|
+
s: [0],
|
|
34
|
+
v: [],
|
|
35
|
+
},
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
StyleCollection.styles("will-change-container").set([
|
|
39
|
+
{
|
|
40
|
+
s: [0],
|
|
41
|
+
c: [DEFAULT_CONTAINER_NAME],
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
StyleCollection.styles("will-change-animation").set([
|
|
46
|
+
{
|
|
47
|
+
s: [0],
|
|
48
|
+
a: true,
|
|
49
|
+
},
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
StyleCollection.styles("will-change-pressable").set([
|
|
53
|
+
{
|
|
54
|
+
s: [0],
|
|
55
|
+
p: {
|
|
56
|
+
h: 1,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
]);
|
|
60
|
+
|
|
30
61
|
if (options.s) {
|
|
31
62
|
for (const style of options.s) {
|
|
32
63
|
StyleCollection.styles(style[0]).set(style[1]);
|
|
@@ -99,33 +130,3 @@ function isDeepEqual(a: unknown, b: unknown): boolean {
|
|
|
99
130
|
|
|
100
131
|
return true;
|
|
101
132
|
}
|
|
102
|
-
|
|
103
|
-
StyleCollection.styles("will-change-variable").set([
|
|
104
|
-
{
|
|
105
|
-
s: [0],
|
|
106
|
-
v: [],
|
|
107
|
-
},
|
|
108
|
-
]);
|
|
109
|
-
|
|
110
|
-
StyleCollection.styles("will-change-container").set([
|
|
111
|
-
{
|
|
112
|
-
s: [0],
|
|
113
|
-
c: [],
|
|
114
|
-
},
|
|
115
|
-
]);
|
|
116
|
-
|
|
117
|
-
StyleCollection.styles("will-change-animation").set([
|
|
118
|
-
{
|
|
119
|
-
s: [0],
|
|
120
|
-
a: true,
|
|
121
|
-
},
|
|
122
|
-
]);
|
|
123
|
-
|
|
124
|
-
StyleCollection.styles("will-change-pressable").set([
|
|
125
|
-
{
|
|
126
|
-
s: [0],
|
|
127
|
-
p: {
|
|
128
|
-
h: 1,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
]);
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
containerLayoutFamily,
|
|
7
7
|
focusFamily,
|
|
8
8
|
hoverFamily,
|
|
9
|
-
type
|
|
9
|
+
type Getter as WeakKey,
|
|
10
10
|
} from "../reactivity";
|
|
11
11
|
|
|
12
12
|
const mainCache = new WeakMap<
|
|
13
|
-
|
|
13
|
+
WeakKey,
|
|
14
14
|
WeakMap<Function, (event: any) => void>
|
|
15
15
|
>();
|
|
16
16
|
|
|
@@ -38,14 +38,14 @@ const defaultHandlers: Record<InteractionType, Handler> = {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export function getInteractionHandler(
|
|
41
|
-
|
|
41
|
+
weakKey: WeakKey,
|
|
42
42
|
type: InteractionType,
|
|
43
43
|
handler = defaultHandlers[type],
|
|
44
44
|
) {
|
|
45
|
-
let cache = mainCache.get(
|
|
45
|
+
let cache = mainCache.get(weakKey);
|
|
46
46
|
if (!cache) {
|
|
47
47
|
cache = new WeakMap();
|
|
48
|
-
mainCache.set(
|
|
48
|
+
mainCache.set(weakKey, cache);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
let cached = cache.get(handler);
|
|
@@ -57,29 +57,29 @@ export function getInteractionHandler(
|
|
|
57
57
|
|
|
58
58
|
switch (type) {
|
|
59
59
|
case "onLayout":
|
|
60
|
-
containerLayoutFamily(
|
|
60
|
+
containerLayoutFamily(weakKey).set(
|
|
61
61
|
(event as LayoutChangeEvent).nativeEvent.layout,
|
|
62
62
|
);
|
|
63
63
|
break;
|
|
64
64
|
case "onHoverIn":
|
|
65
|
-
hoverFamily(
|
|
65
|
+
hoverFamily(weakKey).set(true);
|
|
66
66
|
break;
|
|
67
67
|
case "onHoverOut":
|
|
68
|
-
hoverFamily(
|
|
68
|
+
hoverFamily(weakKey).set(false);
|
|
69
69
|
break;
|
|
70
70
|
case "onPress":
|
|
71
71
|
break;
|
|
72
72
|
case "onPressIn":
|
|
73
|
-
activeFamily(
|
|
73
|
+
activeFamily(weakKey).set(true);
|
|
74
74
|
break;
|
|
75
75
|
case "onPressOut":
|
|
76
|
-
activeFamily(
|
|
76
|
+
activeFamily(weakKey).set(false);
|
|
77
77
|
break;
|
|
78
78
|
case "onFocus":
|
|
79
|
-
focusFamily(
|
|
79
|
+
focusFamily(weakKey).set(true);
|
|
80
80
|
break;
|
|
81
81
|
case "onBlur":
|
|
82
|
-
focusFamily(
|
|
82
|
+
focusFamily(weakKey).set(false);
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
85
|
};
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
hoverFamily,
|
|
13
13
|
VAR_SYMBOL,
|
|
14
14
|
weakFamily,
|
|
15
|
+
type ContainerContextValue,
|
|
15
16
|
type VariableContextValue,
|
|
16
17
|
} from "../reactivity";
|
|
17
18
|
import { stylesFamily } from "../styles";
|
|
@@ -36,8 +37,8 @@ export function updateRules(
|
|
|
36
37
|
|
|
37
38
|
let usesVariables = false;
|
|
38
39
|
|
|
39
|
-
let variables
|
|
40
|
-
let containers
|
|
40
|
+
let variables: VariableContextValue | undefined;
|
|
41
|
+
let containers: ContainerContextValue | undefined;
|
|
41
42
|
const inlineVariables = new Set<InlineVariable>();
|
|
42
43
|
|
|
43
44
|
let animated = false;
|
|
@@ -101,10 +102,20 @@ export function updateRules(
|
|
|
101
102
|
|
|
102
103
|
usesVariables ||= Boolean(rule.dv);
|
|
103
104
|
|
|
105
|
+
// We do this even if the rule doesn't match so we can maintain a consistent render tree
|
|
106
|
+
// We we need to inject React context
|
|
107
|
+
if (rule.v) {
|
|
108
|
+
variables ??= inheritedVariables;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (rule.c) {
|
|
112
|
+
containers ??= inheritedContainers;
|
|
113
|
+
}
|
|
114
|
+
|
|
104
115
|
if (
|
|
105
116
|
!testRule(
|
|
106
117
|
rule,
|
|
107
|
-
state.
|
|
118
|
+
state.ruleEffectGetter,
|
|
108
119
|
currentProps,
|
|
109
120
|
guards,
|
|
110
121
|
inheritedContainers,
|
|
@@ -114,11 +125,8 @@ export function updateRules(
|
|
|
114
125
|
}
|
|
115
126
|
|
|
116
127
|
if (rule.v) {
|
|
117
|
-
// We're going to set a value, so we need to create a new object
|
|
118
128
|
if (variables === inheritedVariables) {
|
|
119
129
|
variables = { ...inheritedVariables };
|
|
120
|
-
} else {
|
|
121
|
-
variables ??= { ...inheritedVariables };
|
|
122
130
|
}
|
|
123
131
|
|
|
124
132
|
for (const v of rule.v) {
|
|
@@ -132,20 +140,20 @@ export function updateRules(
|
|
|
132
140
|
containers = {
|
|
133
141
|
...inheritedContainers,
|
|
134
142
|
// This container becomes the default container
|
|
135
|
-
[DEFAULT_CONTAINER_NAME]: state.
|
|
143
|
+
[DEFAULT_CONTAINER_NAME]: state.ruleEffectGetter,
|
|
136
144
|
};
|
|
137
145
|
}
|
|
138
146
|
|
|
139
147
|
// This this component as the named container
|
|
140
148
|
for (const name of rule.c) {
|
|
141
|
-
containers![name] = state.
|
|
149
|
+
containers![name] = state.ruleEffectGetter;
|
|
142
150
|
}
|
|
143
151
|
|
|
144
152
|
// Enable hover/active/focus/layout handlers
|
|
145
|
-
hoverFamily(state.
|
|
146
|
-
activeFamily(state.
|
|
147
|
-
focusFamily(state.
|
|
148
|
-
containerLayoutFamily(state.
|
|
153
|
+
hoverFamily(state.ruleEffectGetter);
|
|
154
|
+
activeFamily(state.ruleEffectGetter);
|
|
155
|
+
focusFamily(state.ruleEffectGetter);
|
|
156
|
+
containerLayoutFamily(state.ruleEffectGetter);
|
|
149
157
|
}
|
|
150
158
|
|
|
151
159
|
if (rule.a) {
|
|
@@ -163,7 +171,7 @@ export function updateRules(
|
|
|
163
171
|
|
|
164
172
|
if (process.env.NODE_ENV !== "production") {
|
|
165
173
|
if (isRerender) {
|
|
166
|
-
let pressable = activeFamily.has(state.
|
|
174
|
+
let pressable = activeFamily.has(state.ruleEffectGetter);
|
|
167
175
|
|
|
168
176
|
if (Boolean(variables) !== Boolean(state.variables)) {
|
|
169
177
|
console.log(
|
|
@@ -190,7 +198,7 @@ export function updateRules(
|
|
|
190
198
|
let pressable =
|
|
191
199
|
process.env.NODE_ENV === "production"
|
|
192
200
|
? undefined
|
|
193
|
-
: activeFamily.has(state.
|
|
201
|
+
: activeFamily.has(state.ruleEffectGetter);
|
|
194
202
|
|
|
195
203
|
if (!rules.size && !state.stylesObs && !inlineVariables.size) {
|
|
196
204
|
return {
|
|
@@ -199,6 +207,7 @@ export function updateRules(
|
|
|
199
207
|
guards,
|
|
200
208
|
animated,
|
|
201
209
|
pressable,
|
|
210
|
+
variables,
|
|
202
211
|
};
|
|
203
212
|
}
|
|
204
213
|
|