react-native-css 0.0.0-nightly.99fdf44 → 0.0.0-nightly.a5002c5
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/README.md +5 -5
- package/dist/commonjs/babel/import-plugin.js +9 -3
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +16 -3
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +7 -2
- package/dist/commonjs/babel/react-native.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +52 -17
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +92 -31
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/container-query.js +6 -1
- package/dist/commonjs/compiler/container-query.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +158 -66
- package/dist/commonjs/compiler/declarations.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/lightningcss-loader.js +15 -2
- package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -1
- package/dist/commonjs/compiler/media-query.js +16 -6
- package/dist/commonjs/compiler/media-query.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +13 -3
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +7 -5
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +2 -2
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/ActivityIndicator.js +6 -6
- package/dist/commonjs/components/ActivityIndicator.js.map +1 -1
- package/dist/commonjs/components/Button.js +6 -6
- package/dist/commonjs/components/Button.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +7 -6
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/Image.js +6 -6
- package/dist/commonjs/components/Image.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +8 -12
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +8 -9
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/commonjs/components/Pressable.js +6 -6
- package/dist/commonjs/components/Pressable.js.map +1 -1
- package/dist/commonjs/components/SafeAreaProvider.js +13 -0
- package/dist/commonjs/components/SafeAreaProvider.js.map +1 -0
- package/dist/commonjs/components/ScrollView.js +6 -6
- package/dist/commonjs/components/ScrollView.js.map +1 -1
- package/dist/commonjs/components/Switch.js +6 -6
- package/dist/commonjs/components/Switch.js.map +1 -1
- package/dist/commonjs/components/Text.js +6 -6
- package/dist/commonjs/components/Text.js.map +1 -1
- package/dist/commonjs/components/TextInput.js +6 -6
- package/dist/commonjs/components/TextInput.js.map +1 -1
- package/dist/commonjs/components/TouchableHighlight.js +6 -6
- package/dist/commonjs/components/TouchableHighlight.js.map +1 -1
- package/dist/commonjs/components/TouchableOpacity.js +6 -6
- package/dist/commonjs/components/TouchableOpacity.js.map +1 -1
- package/dist/commonjs/components/TouchableWithoutFeedback.js +6 -6
- package/dist/commonjs/components/TouchableWithoutFeedback.js.map +1 -1
- package/dist/commonjs/components/View.js +6 -6
- package/dist/commonjs/components/View.js.map +1 -1
- package/dist/commonjs/components/VirtualizedList.js +6 -6
- package/dist/commonjs/components/VirtualizedList.js.map +1 -1
- package/dist/commonjs/components/copyComponentProperties.js +19 -0
- package/dist/commonjs/components/copyComponentProperties.js.map +1 -0
- package/dist/commonjs/components/index.cjs +310 -0
- package/dist/commonjs/components/index.cjs.map +1 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/jest/index.js +2 -2
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/cache-version.js +43 -0
- package/dist/commonjs/metro/cache-version.js.map +1 -0
- package/dist/commonjs/metro/index.js +10 -118
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +9 -2
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/{native/metro.js → metro/override.js} +1 -1
- package/dist/commonjs/{native/metro.js.map → metro/override.js.map} +1 -1
- package/dist/commonjs/metro/resolver.js +15 -22
- package/dist/commonjs/metro/resolver.js.map +1 -1
- package/dist/commonjs/metro/typescript.js +26 -6
- package/dist/commonjs/metro/typescript.js.map +1 -1
- package/dist/commonjs/native/api.js +17 -9
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/conditions/attributes.js +16 -9
- package/dist/commonjs/native/conditions/attributes.js.map +1 -1
- package/dist/commonjs/native/conditions/container-query.js +11 -11
- package/dist/commonjs/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/native/conditions/media-query.js +1 -1
- package/dist/commonjs/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/native/index.js +8 -8
- package/dist/commonjs/native/index.js.map +1 -1
- package/dist/commonjs/native/react/interaction.js +10 -5
- package/dist/commonjs/native/react/interaction.js.map +1 -1
- package/dist/commonjs/native/react/rules.js +12 -5
- package/dist/commonjs/native/react/rules.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +58 -16
- package/dist/commonjs/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/native/react/usePassthrough.js +5 -2
- package/dist/commonjs/native/react/usePassthrough.js.map +1 -1
- package/dist/commonjs/{poison.pill.js → native/react-native-css-metro-override.js} +1 -1
- package/dist/commonjs/native/react-native-css-metro-override.js.map +1 -0
- package/dist/commonjs/native/reactivity.js +32 -22
- package/dist/commonjs/native/reactivity.js.map +1 -1
- package/dist/commonjs/native/reanimated.js +15 -3
- package/dist/commonjs/native/reanimated.js.map +1 -1
- package/dist/commonjs/native/styles/calculate-props.js +1 -1
- package/dist/commonjs/native/styles/functions/color-mix.js +64 -0
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -0
- package/dist/commonjs/native/styles/functions/filters.js +18 -5
- package/dist/commonjs/native/styles/functions/filters.js.map +1 -1
- package/dist/commonjs/native/styles/functions/index.js +11 -0
- package/dist/commonjs/native/styles/functions/index.js.map +1 -1
- package/dist/commonjs/native/styles/functions/numeric-functions.js +4 -3
- package/dist/commonjs/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/string-functions.js +16 -1
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +5 -4
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +382 -28
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +10 -7
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +13 -0
- package/dist/commonjs/native/styles/scale-factor.js.map +1 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js +10 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/animation.js +11 -4
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/box-shadow.js +45 -12
- package/dist/commonjs/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/index.js +11 -0
- package/dist/commonjs/native/styles/shorthands/index.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js +22 -0
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/commonjs/native/styles/variables.js +55 -43
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +1 -1
- package/dist/commonjs/native-internal/style-collection.js.map +1 -1
- package/dist/commonjs/utilities/dot-notation.types.js +4 -0
- package/dist/commonjs/utilities/style-descriptor.js +4 -9
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +7 -4
- package/dist/commonjs/web/api.js.map +1 -1
- package/dist/commonjs/web/assign-style.js +4 -1
- package/dist/commonjs/web/assign-style.js.map +1 -1
- package/dist/module/babel/import-plugin.js +11 -5
- package/dist/module/babel/import-plugin.js.map +1 -1
- package/dist/module/babel/react-native-web.js +16 -4
- package/dist/module/babel/react-native-web.js.map +1 -1
- package/dist/module/babel/react-native.js +7 -2
- package/dist/module/babel/react-native.js.map +1 -1
- package/dist/module/compiler/atRules.js +50 -17
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +94 -33
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/container-query.js +6 -1
- package/dist/module/compiler/container-query.js.map +1 -1
- package/dist/module/compiler/declarations.js +157 -66
- package/dist/module/compiler/declarations.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/lightningcss-loader.js +14 -2
- package/dist/module/compiler/lightningcss-loader.js.map +1 -1
- package/dist/module/compiler/media-query.js +16 -6
- package/dist/module/compiler/media-query.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +13 -3
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +7 -5
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +2 -2
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/ActivityIndicator.js +4 -3
- package/dist/module/components/ActivityIndicator.js.map +1 -1
- package/dist/module/components/Button.js +4 -3
- package/dist/module/components/Button.js.map +1 -1
- package/dist/module/components/FlatList.js +5 -3
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/Image.js +4 -3
- package/dist/module/components/Image.js.map +1 -1
- package/dist/module/components/ImageBackground.js +6 -9
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +6 -6
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/module/components/Pressable.js +4 -3
- package/dist/module/components/Pressable.js.map +1 -1
- package/dist/module/components/SafeAreaProvider.js +4 -0
- package/dist/module/components/SafeAreaProvider.js.map +1 -0
- package/dist/module/components/ScrollView.js +4 -3
- package/dist/module/components/ScrollView.js.map +1 -1
- package/dist/module/components/Switch.js +4 -3
- package/dist/module/components/Switch.js.map +1 -1
- package/dist/module/components/Text.js +4 -3
- package/dist/module/components/Text.js.map +1 -1
- package/dist/module/components/TextInput.js +4 -3
- package/dist/module/components/TextInput.js.map +1 -1
- package/dist/module/components/TouchableHighlight.js +4 -3
- package/dist/module/components/TouchableHighlight.js.map +1 -1
- package/dist/module/components/TouchableOpacity.js +4 -3
- package/dist/module/components/TouchableOpacity.js.map +1 -1
- package/dist/module/components/TouchableWithoutFeedback.js +4 -3
- package/dist/module/components/TouchableWithoutFeedback.js.map +1 -1
- package/dist/module/components/View.js +4 -3
- package/dist/module/components/View.js.map +1 -1
- package/dist/module/components/VirtualizedList.js +4 -3
- package/dist/module/components/VirtualizedList.js.map +1 -1
- package/dist/module/components/copyComponentProperties.js +15 -0
- package/dist/module/components/copyComponentProperties.js.map +1 -0
- package/dist/module/components/index.cjs +310 -0
- package/dist/module/components/index.cjs.map +1 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/jest/index.js +2 -2
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/cache-version.js +39 -0
- package/dist/module/metro/cache-version.js.map +1 -0
- package/dist/module/metro/index.js +10 -117
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +9 -2
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/override.js +4 -0
- package/dist/module/{native/metro.js.map → metro/override.js.map} +1 -1
- package/dist/module/metro/resolver.js +15 -22
- package/dist/module/metro/resolver.js.map +1 -1
- package/dist/module/metro/typescript.js +26 -6
- package/dist/module/metro/typescript.js.map +1 -1
- package/dist/module/native/api.js +18 -11
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/conditions/attributes.js +16 -9
- package/dist/module/native/conditions/attributes.js.map +1 -1
- package/dist/module/native/conditions/container-query.js +11 -11
- package/dist/module/native/conditions/container-query.js.map +1 -1
- package/dist/module/native/conditions/media-query.js +1 -1
- package/dist/module/native/conditions/media-query.js.map +1 -1
- package/dist/module/native/index.js +1 -1
- package/dist/module/native/index.js.map +1 -1
- package/dist/module/native/react/interaction.js +10 -5
- package/dist/module/native/react/interaction.js.map +1 -1
- package/dist/module/native/react/rules.js +13 -6
- package/dist/module/native/react/rules.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +59 -17
- package/dist/module/native/react/useNativeCss.js.map +1 -1
- package/dist/module/native/react/usePassthrough.js +5 -2
- package/dist/module/native/react/usePassthrough.js.map +1 -1
- package/dist/module/{poison.pill.js → native/react-native-css-metro-override.js} +1 -1
- package/dist/module/native/react-native-css-metro-override.js.map +1 -0
- package/dist/module/native/reactivity.js +32 -22
- package/dist/module/native/reactivity.js.map +1 -1
- package/dist/module/native/reanimated.js +15 -3
- package/dist/module/native/reanimated.js.map +1 -1
- package/dist/module/native/styles/calculate-props.js +1 -1
- package/dist/module/native/styles/functions/color-mix.js +59 -0
- package/dist/module/native/styles/functions/color-mix.js.map +1 -0
- package/dist/module/native/styles/functions/filters.js +16 -4
- package/dist/module/native/styles/functions/filters.js.map +1 -1
- package/dist/module/native/styles/functions/index.js +1 -0
- package/dist/module/native/styles/functions/index.js.map +1 -1
- package/dist/module/native/styles/functions/numeric-functions.js +4 -3
- package/dist/module/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/module/native/styles/functions/string-functions.js +13 -0
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +5 -4
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +383 -28
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +10 -7
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +9 -0
- package/dist/module/native/styles/scale-factor.js.map +1 -0
- package/dist/module/native/styles/shorthands/_handler.js +11 -1
- package/dist/module/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/module/native/styles/shorthands/animation.js +9 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/box-shadow.js +46 -12
- package/dist/module/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/native/styles/shorthands/index.js +1 -0
- package/dist/module/native/styles/shorthands/index.js.map +1 -1
- package/dist/module/native/styles/shorthands/logical-border-width.js +18 -0
- package/dist/module/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/module/native/styles/variables.js +55 -43
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +1 -1
- package/dist/module/native-internal/style-collection.js.map +1 -1
- package/dist/module/utilities/dot-notation.types.js +2 -0
- package/dist/module/utilities/style-descriptor.js +4 -9
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +7 -4
- package/dist/module/web/api.js.map +1 -1
- package/dist/module/web/assign-style.js +4 -1
- package/dist/module/web/assign-style.js.map +1 -1
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts +4 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +1 -0
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Button.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts +3 -3
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Image.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Pressable.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/Pressable.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/ScrollView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Switch.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/Text.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableHighlight.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableOpacity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts +2 -4
- package/dist/typescript/commonjs/src/components/TouchableWithoutFeedback.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/View.d.ts +2 -6
- package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts +3 -3
- package/dist/typescript/commonjs/src/components/VirtualizedList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/commonjs/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.cts +2 -0
- package/dist/typescript/commonjs/src/components/index.d.cts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/commonjs/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +5 -3
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/override.d.ts +2 -0
- package/dist/typescript/commonjs/src/metro/override.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/api.d.ts +5 -9
- package/dist/typescript/commonjs/src/native/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/index.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/react-native-css-metro-override.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/reactivity.d.ts +7 -3
- package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts +3 -0
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime.types.d.ts +11 -6
- package/dist/typescript/commonjs/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts +3 -2
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/api.d.ts +5 -5
- package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts +1 -1
- package/dist/typescript/module/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/atRules.d.ts +6 -3
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts +2 -2
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/container-query.d.ts +2 -2
- package/dist/typescript/module/src/compiler/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +4 -3
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/index.d.ts +2 -2
- package/dist/typescript/module/src/compiler/index.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +1 -1
- package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts +3 -3
- package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/media-query.d.ts +3 -3
- package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts +1 -1
- package/dist/typescript/module/src/compiler/pseudo-elements.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selectors.d.ts +2 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +2 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +2 -4
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Button.d.ts +2 -4
- package/dist/typescript/module/src/components/Button.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts +3 -3
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Image.d.ts +2 -4
- package/dist/typescript/module/src/components/Image.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts +2 -4
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts +2 -4
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Pressable.d.ts +2 -4
- package/dist/typescript/module/src/components/Pressable.d.ts.map +1 -1
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/module/src/components/ScrollView.d.ts +2 -4
- package/dist/typescript/module/src/components/ScrollView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Switch.d.ts +2 -6
- package/dist/typescript/module/src/components/Switch.d.ts.map +1 -1
- package/dist/typescript/module/src/components/Text.d.ts +2 -6
- package/dist/typescript/module/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TextInput.d.ts +2 -4
- package/dist/typescript/module/src/components/TextInput.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableHighlight.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableOpacity.d.ts.map +1 -1
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts +2 -4
- package/dist/typescript/module/src/components/TouchableWithoutFeedback.d.ts.map +1 -1
- package/dist/typescript/module/src/components/View.d.ts +2 -6
- package/dist/typescript/module/src/components/View.d.ts.map +1 -1
- package/dist/typescript/module/src/components/VirtualizedList.d.ts +3 -3
- package/dist/typescript/module/src/components/VirtualizedList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts +5 -0
- package/dist/typescript/module/src/components/copyComponentProperties.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.cts +2 -0
- package/dist/typescript/module/src/components/index.d.cts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +16 -16
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/cache-version.d.ts +8 -0
- package/dist/typescript/module/src/metro/cache-version.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/index.d.ts +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +6 -4
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/override.d.ts +2 -0
- package/dist/typescript/module/src/metro/override.d.ts.map +1 -0
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/module/src/native/api.d.ts +6 -10
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/container-query.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/index.d.ts +3 -3
- package/dist/typescript/module/src/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/index.d.ts +3 -3
- package/dist/typescript/module/src/native/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/rules.d.ts +2 -2
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +5 -5
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts +1 -1
- package/dist/typescript/module/src/native/react/usePassthrough.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts +2 -0
- package/dist/typescript/module/src/native/react-native-css-metro-override.d.ts.map +1 -0
- package/dist/typescript/module/src/native/reactivity.d.ts +7 -3
- package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts +2 -2
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +3 -0
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/index.d.ts +8 -7
- package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/index.d.ts +7 -7
- package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/resolve.d.ts +4 -3
- package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +3 -2
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/border.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts +6 -5
- package/dist/typescript/module/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/module/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/text-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/variables.d.ts +2 -2
- package/dist/typescript/module/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/index.d.ts +3 -3
- package/dist/typescript/module/src/native-internal/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/root.d.ts +1 -1
- package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/style-collection.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/style-collection.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/variables.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.d.ts +1 -1
- package/dist/typescript/module/src/runtime.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.types.d.ts +11 -6
- package/dist/typescript/module/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +3 -2
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/index.d.ts +3 -3
- package/dist/typescript/module/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/specificity.d.ts +2 -2
- package/dist/typescript/module/src/utilities/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/module/src/web/api.d.ts +5 -5
- package/dist/typescript/module/src/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/web/index.d.ts +3 -3
- package/dist/typescript/module/src/web/index.d.ts.map +1 -1
- package/node/babel.mjs +4 -0
- package/node/compiler.mjs +2 -0
- package/node/metro.mjs +2 -0
- package/package.json +87 -39
- package/src/babel/import-plugin.ts +15 -4
- package/src/babel/react-native-web.ts +32 -3
- package/src/babel/react-native.ts +7 -1
- package/src/compiler/atRules.ts +63 -18
- package/src/compiler/compiler.ts +140 -42
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +289 -104
- package/src/compiler/keyframes.ts +2 -2
- package/src/compiler/lightningcss-loader.ts +21 -1
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +29 -3
- package/src/compiler/stylesheet.ts +9 -5
- package/src/compiler/supports.ts +2 -2
- package/src/components/ActivityIndicator.tsx +9 -6
- package/src/components/Button.tsx +9 -4
- package/src/components/FlatList.tsx +15 -5
- package/src/components/Image.tsx +9 -4
- package/src/components/ImageBackground.tsx +11 -12
- package/src/components/KeyboardAvoidingView.tsx +11 -9
- package/src/components/Pressable.tsx +9 -4
- package/src/components/SafeAreaProvider.tsx +1 -0
- package/src/components/ScrollView.tsx +9 -6
- package/src/components/Switch.tsx +9 -4
- package/src/components/Text.tsx +9 -4
- package/src/components/TextInput.tsx +9 -4
- package/src/components/TouchableHighlight.tsx +9 -6
- package/src/components/TouchableOpacity.tsx +9 -6
- package/src/components/TouchableWithoutFeedback.tsx +9 -6
- package/src/components/View.tsx +9 -4
- package/src/components/VirtualizedList.tsx +18 -6
- package/src/components/copyComponentProperties.ts +21 -0
- package/src/components/index.cts +308 -0
- package/src/components/{index.tsx → index.ts} +0 -1
- package/src/jest/index.ts +3 -2
- package/src/metro/cache-version.ts +48 -0
- package/src/metro/index.ts +10 -166
- package/src/metro/metro-transformer.ts +24 -7
- package/src/metro/override.ts +1 -0
- package/src/metro/resolver.ts +29 -28
- package/src/metro/typescript.ts +53 -6
- package/src/native/api.tsx +24 -14
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/index.ts +1 -2
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +13 -5
- package/src/native/react/useNativeCss.ts +64 -17
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +42 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/calculate-props.ts +1 -1
- package/src/native/styles/functions/color-mix.ts +74 -0
- package/src/native/styles/functions/filters.ts +20 -6
- package/src/native/styles/functions/index.ts +1 -0
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/string-functions.ts +18 -0
- package/src/native/styles/functions/transform-functions.ts +5 -4
- package/src/native/styles/index.ts +443 -36
- package/src/native/styles/resolve.ts +15 -12
- package/src/native/styles/scale-factor.ts +6 -0
- package/src/native/styles/shorthands/_handler.ts +14 -1
- package/src/native/styles/shorthands/animation.ts +17 -3
- package/src/native/styles/shorthands/box-shadow.ts +50 -15
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/variables.ts +48 -38
- package/src/native-internal/style-collection.ts +1 -1
- package/src/runtime.types.ts +17 -15
- package/src/utilities/dot-notation.types.ts +12 -4
- package/src/utilities/style-descriptor.ts +11 -16
- package/src/web/api.tsx +13 -13
- package/src/web/assign-style.ts +2 -1
- package/types.d.ts +3 -20
- package/dist/commonjs/compiler/inheritance.test.js +0 -78
- package/dist/commonjs/compiler/inheritance.test.js.map +0 -1
- package/dist/commonjs/poison.pill.js.map +0 -1
- package/dist/commonjs/runtime/native/injection.js +0 -2
- package/dist/commonjs/runtime/native/injection.js.map +0 -1
- package/dist/module/compiler/inheritance.test.js +0 -78
- package/dist/module/compiler/inheritance.test.js.map +0 -1
- package/dist/module/native/metro.js +0 -5
- package/dist/module/poison.pill.js.map +0 -1
- package/dist/module/runtime/native/injection.js +0 -2
- package/dist/module/runtime/native/injection.js.map +0 -1
- package/dist/typescript/commonjs/example/app.config.d.ts +0 -4
- package/dist/typescript/commonjs/example/app.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/src/App.d.ts +0 -2
- package/dist/typescript/commonjs/example/src/App.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/native/metro.d.ts +0 -2
- package/dist/typescript/commonjs/src/native/metro.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/poison.pill.d.ts +0 -2
- package/dist/typescript/commonjs/src/poison.pill.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts +0 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +0 -1
- package/dist/typescript/module/example/app.config.d.ts +0 -4
- package/dist/typescript/module/example/app.config.d.ts.map +0 -1
- package/dist/typescript/module/example/src/App.d.ts +0 -2
- package/dist/typescript/module/example/src/App.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts +0 -2
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +0 -1
- package/dist/typescript/module/src/native/metro.d.ts +0 -2
- package/dist/typescript/module/src/native/metro.d.ts.map +0 -1
- package/dist/typescript/module/src/poison.pill.d.ts +0 -2
- package/dist/typescript/module/src/poison.pill.d.ts.map +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts +0 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +0 -1
- package/src/compiler/inheritance.test.ts +0 -121
- package/src/native/metro.ts +0 -2
- package/src/runtime/native/injection.ts +0 -0
- /package/src/{poison.pill.ts → native/react-native-css-metro-override.ts} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { dirname, relative, sep } from "node:path";
|
|
5
4
|
import { versions } from "node:process";
|
|
6
|
-
import
|
|
7
|
-
import { compile } from "../compiler/index.js";
|
|
8
|
-
import { getNativeInjectionCode, getWebInjectionCode } from "./injection-code.js";
|
|
5
|
+
import { getCacheVersion } from "./cache-version.js";
|
|
9
6
|
import { nativeResolver, webResolver } from "./resolver.js";
|
|
10
7
|
import { setupTypeScript } from "./typescript.js";
|
|
11
|
-
const
|
|
8
|
+
const metroOverrideResolution = {
|
|
9
|
+
type: "sourceFile",
|
|
10
|
+
filePath: require.resolve("./override")
|
|
11
|
+
};
|
|
12
12
|
export function withReactNativeCSS(config, options) {
|
|
13
13
|
if (typeof config === "function") {
|
|
14
14
|
return async () => {
|
|
@@ -21,16 +21,15 @@ export function withReactNativeCSS(config, options) {
|
|
|
21
21
|
const {
|
|
22
22
|
disableTypeScriptGeneration,
|
|
23
23
|
typescriptEnvPath,
|
|
24
|
-
globalClassNamePolyfill = false
|
|
25
|
-
logger = defaultLogger
|
|
24
|
+
globalClassNamePolyfill = false
|
|
26
25
|
} = options || {};
|
|
27
|
-
const loggerEnabled = "enabled" in logger ? logger.enabled : true;
|
|
28
26
|
if (disableTypeScriptGeneration !== true) {
|
|
29
27
|
setupTypeScript(typescriptEnvPath);
|
|
30
28
|
}
|
|
31
29
|
return {
|
|
32
30
|
...config,
|
|
33
|
-
|
|
31
|
+
cacheVersion: getCacheVersion(config.cacheVersion, options),
|
|
32
|
+
transformerPath: require.resolve("./metro-transformer"),
|
|
34
33
|
transformer: {
|
|
35
34
|
...config.transformer,
|
|
36
35
|
reactNativeCSS: options
|
|
@@ -39,10 +38,8 @@ export function withReactNativeCSS(config, options) {
|
|
|
39
38
|
...config.resolver,
|
|
40
39
|
sourceExts: [...(config?.resolver?.sourceExts || []), "css"],
|
|
41
40
|
resolveRequest: (context, moduleName, platform) => {
|
|
42
|
-
if (moduleName.includes("
|
|
43
|
-
return
|
|
44
|
-
type: "empty"
|
|
45
|
-
};
|
|
41
|
+
if (moduleName.includes("react-native-css-metro-override")) {
|
|
42
|
+
return metroOverrideResolution;
|
|
46
43
|
}
|
|
47
44
|
const parentResolver = config.resolver?.resolveRequest ?? context.resolveRequest;
|
|
48
45
|
|
|
@@ -54,110 +51,6 @@ export function withReactNativeCSS(config, options) {
|
|
|
54
51
|
const resolved = resolver(parentResolver, context, moduleName, platform);
|
|
55
52
|
return resolved;
|
|
56
53
|
}
|
|
57
|
-
},
|
|
58
|
-
server: {
|
|
59
|
-
...config.server,
|
|
60
|
-
enhanceMiddleware(metroMiddleware, metroServer) {
|
|
61
|
-
const bundler = metroServer.getBundler().getBundler();
|
|
62
|
-
if (!bundler.__react_native_css__patched) {
|
|
63
|
-
bundler.__react_native_css__patched = true;
|
|
64
|
-
const nativeCSSFiles = new Map();
|
|
65
|
-
const webCSSFiles = new Set();
|
|
66
|
-
const nativeInjectionPath = require.resolve("../native/metro");
|
|
67
|
-
const nativeInjectionFilepaths = [
|
|
68
|
-
// CommonJS
|
|
69
|
-
nativeInjectionPath,
|
|
70
|
-
// ES Module
|
|
71
|
-
nativeInjectionPath.replace(`dist${sep}commonjs`, `dist${sep}module`),
|
|
72
|
-
// TypeScript
|
|
73
|
-
nativeInjectionPath.replace(`dist${sep}commonjs`, `src`).replace(".js", ".ts")];
|
|
74
|
-
const webInjectionPath = require.resolve("../web/metro");
|
|
75
|
-
const webInjectionFilepaths = [
|
|
76
|
-
// CommonJS
|
|
77
|
-
webInjectionPath,
|
|
78
|
-
// ES Module
|
|
79
|
-
webInjectionPath.replace(`dist${sep}commonjs`, `dist${sep}module`),
|
|
80
|
-
// TypeScript
|
|
81
|
-
webInjectionPath.replace(`dist${sep}commonjs`, `src`).replace(".js", ".ts")];
|
|
82
|
-
|
|
83
|
-
// Keep the original
|
|
84
|
-
const transformFile = bundler.transformFile.bind(bundler);
|
|
85
|
-
const watcher = bundler.getWatcher();
|
|
86
|
-
|
|
87
|
-
// Patch with our functionality
|
|
88
|
-
bundler.transformFile = async function (filePath, transformOptions, fileBuffer) {
|
|
89
|
-
const isCss = /\.(s?css|sass)$/.test(filePath);
|
|
90
|
-
if (transformOptions.platform === "web") {
|
|
91
|
-
if (isCss) {
|
|
92
|
-
webCSSFiles.add(filePath);
|
|
93
|
-
} else if (webInjectionFilepaths.includes(filePath)) {
|
|
94
|
-
fileBuffer = getWebInjectionCode(Array.from(webCSSFiles));
|
|
95
|
-
}
|
|
96
|
-
return transformFile(filePath, transformOptions, fileBuffer);
|
|
97
|
-
} else {
|
|
98
|
-
// Handle CSS files on native platforms
|
|
99
|
-
if (isCss) {
|
|
100
|
-
const webTransform = await transformFile(filePath, {
|
|
101
|
-
...transformOptions,
|
|
102
|
-
// Force the platform to web for CSS files
|
|
103
|
-
platform: "web",
|
|
104
|
-
// Let the transformer know that we will handle compilation
|
|
105
|
-
customTransformOptions: {
|
|
106
|
-
...transformOptions.customTransformOptions,
|
|
107
|
-
reactNativeCSS: options
|
|
108
|
-
}
|
|
109
|
-
}, fileBuffer);
|
|
110
|
-
const lastTransform = nativeCSSFiles.get(filePath);
|
|
111
|
-
const last = lastTransform?.[0];
|
|
112
|
-
const next = webTransform.output[0].data.css.code.toString();
|
|
113
|
-
|
|
114
|
-
// The CSS file has changed, we need to recompile the injection file
|
|
115
|
-
if (next !== last) {
|
|
116
|
-
nativeCSSFiles.set(filePath, [next, compile(next, {
|
|
117
|
-
hexColors: options?.hexColors
|
|
118
|
-
}).stylesheet()]);
|
|
119
|
-
watcher.emit("change", {
|
|
120
|
-
eventsQueue: nativeInjectionFilepaths.map(filePath => ({
|
|
121
|
-
filePath,
|
|
122
|
-
metadata: {
|
|
123
|
-
modifiedTime: Date.now(),
|
|
124
|
-
size: 1,
|
|
125
|
-
// Can be anything
|
|
126
|
-
type: "virtual" // Can be anything
|
|
127
|
-
},
|
|
128
|
-
type: "change"
|
|
129
|
-
}))
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const nativeTransform = await transformFile(filePath, transformOptions, fileBuffer);
|
|
133
|
-
|
|
134
|
-
// Tell Expo to skip caching this file
|
|
135
|
-
nativeTransform.output[0].data.css = {
|
|
136
|
-
skipCache: true,
|
|
137
|
-
// Expo requires a `code` property
|
|
138
|
-
code: ""
|
|
139
|
-
};
|
|
140
|
-
return nativeTransform;
|
|
141
|
-
} else if (nativeInjectionFilepaths.includes(filePath)) {
|
|
142
|
-
// If this is the injection file, we to swap its content with the
|
|
143
|
-
// compiled CSS files
|
|
144
|
-
fileBuffer = getNativeInjectionCode(Array.from(nativeCSSFiles.keys()).map(key => relative(dirname(filePath), key)), Array.from(nativeCSSFiles.values()).map(([, value]) => value));
|
|
145
|
-
if (loggerEnabled && fileBuffer) {
|
|
146
|
-
logger(`Transformed ${filePath}`);
|
|
147
|
-
logger(fileBuffer?.toString());
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return transformFile(filePath, transformOptions, fileBuffer);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* We don't modify the middleware, we just use this function to get the metroServer
|
|
157
|
-
* So simply return the existing middleware
|
|
158
|
-
*/
|
|
159
|
-
return config.server?.enhanceMiddleware?.(metroMiddleware, metroServer) ?? metroMiddleware;
|
|
160
|
-
}
|
|
161
54
|
}
|
|
162
55
|
};
|
|
163
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["versions","getCacheVersion","nativeResolver","webResolver","setupTypeScript","metroOverrideResolution","type","filePath","require","resolve","withReactNativeCSS","config","options","Number","node","split","Error","disableTypeScriptGeneration","typescriptEnvPath","globalClassNamePolyfill","cacheVersion","transformerPath","transformer","reactNativeCSS","resolver","sourceExts","resolveRequest","context","moduleName","platform","includes","parentResolver","resolved"],"sourceRoot":"../../../src","sources":["metro/index.ts"],"mappings":";;AAAA;AACA,SAASA,QAAQ,QAAQ,cAAc;AAKvC,SAASC,eAAe,QAAQ,oBAAiB;AACjD,SAASC,cAAc,EAAEC,WAAW,QAAQ,eAAY;AACxD,SAASC,eAAe,QAAQ,iBAAc;AAY9C,MAAMC,uBAAuB,GAAG;EAC9BC,IAAI,EAAE,YAAY;EAClBC,QAAQ,EAAEC,OAAO,CAACC,OAAO,CAAC,YAAY;AACxC,CAAC;AAED,OAAO,SAASC,kBAAkBA,CAEhCC,MAAS,EAAEC,OAAmC,EAAK;EACnD,IAAI,OAAOD,MAAM,KAAK,UAAU,EAAE;IAChC,OAAQ,YAAY;MAClB,OAAOD,kBAAkB,CAAC,MAAMC,MAAM,CAAC,CAAC,EAAEC,OAAO,CAAC;IACpD,CAAC;EACH;EAEA,IAAIC,MAAM,CAACb,QAAQ,CAACc,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE;IAC5C,MAAM,IAAIC,KAAK,CAAC,2CAA2C,CAAC;EAC9D;EAEA,MAAM;IACJC,2BAA2B;IAC3BC,iBAAiB;IACjBC,uBAAuB,GAAG;EAC5B,CAAC,GAAGP,OAAO,IAAI,CAAC,CAAC;EAEjB,IAAIK,2BAA2B,KAAK,IAAI,EAAE;IACxCb,eAAe,CAACc,iBAAiB,CAAC;EACpC;EAEA,OAAO;IACL,GAAGP,MAAM;IACTS,YAAY,EAAEnB,eAAe,CAACU,MAAM,CAACS,YAAY,EAAER,OAAO,CAAC;IAC3DS,eAAe,EAAEb,OAAO,CAACC,OAAO,CAAC,qBAAqB,CAAC;IACvDa,WAAW,EAAE;MACX,GAAGX,MAAM,CAACW,WAAW;MACrBC,cAAc,EAAEX;IAClB,CAAC;IACDY,QAAQ,EAAE;MACR,GAAGb,MAAM,CAACa,QAAQ;MAClBC,UAAU,EAAE,CAAC,IAAId,MAAM,EAAEa,QAAQ,EAAEC,UAAU,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC;MAC5DC,cAAc,EAAEA,CAACC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,KAAK;QACjD,IAAID,UAAU,CAACE,QAAQ,CAAC,iCAAiC,CAAC,EAAE;UAC1D,OAAOzB,uBAAuB;QAChC;QAEA,MAAM0B,cAAc,GAClBpB,MAAM,CAACa,QAAQ,EAAEE,cAAc,IAAIC,OAAO,CAACD,cAAc;;QAE3D;QACA,IAAI,CAACP,uBAAuB,EAAE;UAC5B,OAAOY,cAAc,CAACJ,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;QACtD;QAEA,MAAML,QAAQ,GAAGK,QAAQ,KAAK,KAAK,GAAG1B,WAAW,GAAGD,cAAc;QAClE,MAAM8B,QAAQ,GAAGR,QAAQ,CACvBO,cAAc,EACdJ,OAAO,EACPC,UAAU,EACVC,QACF,CAAC;QAED,OAAOG,QAAQ;MACjB;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -17,11 +17,18 @@ export async function transform(config, projectRoot, filePath, data, options) {
|
|
|
17
17
|
});
|
|
18
18
|
const css = cssFile.output[0].data.css.code.toString();
|
|
19
19
|
const productionJS = compile(css, {
|
|
20
|
-
...
|
|
20
|
+
...config.reactNativeCSS,
|
|
21
21
|
filename: filePath,
|
|
22
22
|
projectRoot: projectRoot
|
|
23
23
|
}).stylesheet();
|
|
24
24
|
data = Buffer.from(getNativeInjectionCode([], [productionJS]));
|
|
25
|
-
|
|
25
|
+
const transform = await worker.transform(config, projectRoot, `${filePath}.js`, data, options);
|
|
26
|
+
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
28
|
+
transform.output[0].data.css = {
|
|
29
|
+
skipCache: true,
|
|
30
|
+
code: ""
|
|
31
|
+
};
|
|
32
|
+
return transform;
|
|
26
33
|
}
|
|
27
34
|
//# sourceMappingURL=metro-transformer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["unstable_transformerPath","compile","getNativeInjectionCode","worker","require","transform","config","projectRoot","filePath","data","options","isCss","type","test","platform","cssFile","css","output","code","toString","productionJS","reactNativeCSS","filename","stylesheet","Buffer","from"],"sourceRoot":"../../../src","sources":["metro/metro-transformer.ts"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,oBAAoB;
|
|
1
|
+
{"version":3,"names":["unstable_transformerPath","compile","getNativeInjectionCode","worker","require","transform","config","projectRoot","filePath","data","options","isCss","type","test","platform","cssFile","css","output","code","toString","productionJS","reactNativeCSS","filename","stylesheet","Buffer","from","skipCache"],"sourceRoot":"../../../src","sources":["metro/metro-transformer.ts"],"mappings":";;AAAA,SAASA,wBAAwB,QAAQ,oBAAoB;AAM7D,SAASC,OAAO,QAA8B,sBAAa;AAC3D,SAASC,sBAAsB,QAAQ,qBAAkB;AAMzD,MAAMC,MAAM;AACV;AACAC,OAAO,CAACJ,wBAAwB,CAA4C;AAE9E,OAAO,eAAeK,SAASA,CAC7BC,MAEC,EACDC,WAAmB,EACnBC,QAAgB,EAChBC,IAAY,EACZC,OAA2B,EACC;EAC5B,MAAMC,KAAK,GAAGD,OAAO,CAACE,IAAI,KAAK,OAAO,IAAI,iBAAiB,CAACC,IAAI,CAACL,QAAQ,CAAC;EAE1E,IAAIE,OAAO,CAACI,QAAQ,KAAK,KAAK,IAAI,CAACH,KAAK,EAAE;IACxC,OAAOR,MAAM,CAACE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,CAAC;EACvE;EAEA,MAAMK,OAAO,GAAI,MAAMZ,MAAM,CAACE,SAAS,CAACC,MAAM,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,EAAE;IAC3E,GAAGC,OAAO;IACVI,QAAQ,EAAE;EACZ,CAAC,CAEA;EAED,MAAME,GAAG,GAAGD,OAAO,CAACE,MAAM,CAAC,CAAC,CAAC,CAACR,IAAI,CAACO,GAAG,CAACE,IAAI,CAACC,QAAQ,CAAC,CAAC;EAEtD,MAAMC,YAAY,GAAGnB,OAAO,CAACe,GAAG,EAAE;IAChC,GAAGV,MAAM,CAACe,cAAc;IACxBC,QAAQ,EAAEd,QAAQ;IAClBD,WAAW,EAAEA;EACf,CAAC,CAAC,CAACgB,UAAU,CAAC,CAAC;EAEfd,IAAI,GAAGe,MAAM,CAACC,IAAI,CAACvB,sBAAsB,CAAC,EAAE,EAAE,CAACkB,YAAY,CAAC,CAAC,CAAC;EAE9D,MAAMf,SAAS,GAAG,MAAMF,MAAM,CAACE,SAAS,CACtCC,MAAM,EACNC,WAAW,EACX,GAAGC,QAAQ,KAAK,EAChBC,IAAI,EACJC,OACF,CAAC;;EAED;EACCL,SAAS,CAASY,MAAM,CAAC,CAAC,CAAC,CAACR,IAAI,CAACO,GAAG,GAAG;IACtCU,SAAS,EAAE,IAAI;IACfR,IAAI,EAAE;EACR,CAAC;EAED,OAAOb,SAAS;AAClB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["metro/override.ts"],"mappings":";;AAAA","ignoreList":[]}
|
|
@@ -9,32 +9,23 @@ function isFromThisModule(filename) {
|
|
|
9
9
|
}
|
|
10
10
|
export function nativeResolver(resolver, context, moduleName, platform) {
|
|
11
11
|
const resolution = resolver(context, moduleName, platform);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// Only operate on source files
|
|
16
|
-
resolution.type !== "sourceFile" ||
|
|
17
|
-
// Skip the React Native barrel file to prevent infinite recursion
|
|
18
|
-
context.originModulePath.endsWith("react-native/index.js") ||
|
|
19
|
-
// Skip anything that isn't importing a React Native component
|
|
20
|
-
!(moduleName.startsWith("react-native") || moduleName.startsWith("react-native/"))) {
|
|
12
|
+
const isInternal = isFromThisModule(context.originModulePath);
|
|
13
|
+
const isReactNativeIndex = context.originModulePath.endsWith(`${sep}react-native${sep}index.js`);
|
|
14
|
+
if (isInternal || resolution.type !== "sourceFile" || isReactNativeIndex) {
|
|
21
15
|
return resolution;
|
|
22
16
|
}
|
|
23
17
|
if (moduleName === "react-native") {
|
|
24
18
|
return resolver(context, `react-native-css/components`, platform);
|
|
25
|
-
}
|
|
26
|
-
if (moduleName === "react-native-safe-area-context") {
|
|
19
|
+
} else if (moduleName === "react-native-safe-area-context") {
|
|
27
20
|
return resolver(context, `react-native-css/components/react-native-safe-area-context`, platform);
|
|
21
|
+
} else if (resolution.filePath.includes(`${sep}react-native${sep}Libraries${sep}`)) {
|
|
22
|
+
const filename = basename(resolution.filePath.split(sep).at(-1) ?? "");
|
|
23
|
+
const module = filename.split(".").at(0);
|
|
24
|
+
if (module && allowedModules.has(module)) {
|
|
25
|
+
return resolver(context, `react-native-css/components/${module}`, platform);
|
|
26
|
+
}
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
// We only care about `react-native/Library/Components/<module>.js` components
|
|
31
|
-
const segments = resolution.filePath.split(sep);
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
33
|
-
const module = basename(segments.at(-1)).split(".")[0];
|
|
34
|
-
if (!module || !allowedModules.has(module)) {
|
|
35
|
-
return resolution;
|
|
36
|
-
}
|
|
37
|
-
return resolver(context, `react-native-css/components/${module}`, platform);
|
|
28
|
+
return resolution;
|
|
38
29
|
}
|
|
39
30
|
export function webResolver(resolver, context, moduleName, platform) {
|
|
40
31
|
const resolution = resolver(context, moduleName, platform);
|
|
@@ -44,7 +35,9 @@ export function webResolver(resolver, context, moduleName, platform) {
|
|
|
44
35
|
// Only operate on source files
|
|
45
36
|
resolution.type !== "sourceFile" ||
|
|
46
37
|
// Skip anything that isn't importing from `react-native-web`
|
|
47
|
-
!resolution.filePath.includes(`${sep}react-native-web${sep}`)
|
|
38
|
+
!resolution.filePath.includes(`${sep}react-native-web${sep}`) ||
|
|
39
|
+
// Skip internal react-native-web files
|
|
40
|
+
resolution.filePath.includes(`${sep}react-native-web${sep}dist${sep}vendor`)) {
|
|
48
41
|
return resolution;
|
|
49
42
|
}
|
|
50
43
|
|
|
@@ -52,7 +45,7 @@ export function webResolver(resolver, context, moduleName, platform) {
|
|
|
52
45
|
const segments = resolution.filePath.split(sep);
|
|
53
46
|
const isIndex = segments.at(-1)?.startsWith("index.");
|
|
54
47
|
const module = segments.at(-2);
|
|
55
|
-
if (!isIndex || !module || !allowedModules.has(module)) {
|
|
48
|
+
if (!isIndex || !module || !allowedModules.has(module) || module === "VirtualizedList") {
|
|
56
49
|
return resolution;
|
|
57
50
|
}
|
|
58
51
|
return resolver(context, `react-native-css/components/${module}`, platform);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["basename","resolve","sep","allowedModules","thisModuleDist","__dirname","thisModuleSrc","isFromThisModule","filename","startsWith","nativeResolver","resolver","context","moduleName","platform","resolution","originModulePath","
|
|
1
|
+
{"version":3,"names":["basename","resolve","sep","allowedModules","thisModuleDist","__dirname","thisModuleSrc","isFromThisModule","filename","startsWith","nativeResolver","resolver","context","moduleName","platform","resolution","isInternal","originModulePath","isReactNativeIndex","endsWith","type","filePath","includes","split","at","module","has","webResolver","segments","isIndex"],"sourceRoot":"../../../src","sources":["metro/resolver.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,GAAG,QAAQ,WAAW;AAQlD,SAASC,cAAc,QAAQ,4BAAyB;AAExD,MAAMC,cAAc,GAAGH,OAAO,CAACI,SAAS,EAAE,eAAe,CAAC;AAC1D,MAAMC,aAAa,GAAGL,OAAO,CAACI,SAAS,EAAE,cAAc,CAAC;AAExD,SAASE,gBAAgBA,CAACC,QAAgB,EAAW;EACnD,OACEA,QAAQ,CAACC,UAAU,CAACL,cAAc,CAAC,IAAII,QAAQ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EA,OAAOC,UAAU;AACnB;AAEA,OAAO,SAASY,WAAWA,CACzBhB,QAAwB,EACxBC,OAAgC,EAChCC,UAAkB,EAClBC,QAAuB,EACX;EACZ,MAAMC,UAAU,GAAGJ,QAAQ,CAACC,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;EAE1D;EACE;EACAP,gBAAgB,CAACK,OAAO,CAACK,gBAAgB,CAAC;EAC1C;EACAF,UAAU,CAACK,IAAI,KAAK,YAAY;EAChC;EACA,CAACL,UAAU,CAACM,QAAQ,CAACC,QAAQ,CAAC,GAAGpB,GAAG,mBAAmBA,GAAG,EAAE,CAAC;EAC7D;EACAa,UAAU,CAACM,QAAQ,CAACC,QAAQ,CAAC,GAAGpB,GAAG,mBAAmBA,GAAG,OAAOA,GAAG,QAAQ,CAAC,EAC5E;IACA,OAAOa,UAAU;EACnB;;EAEA;EACA,MAAMa,QAAQ,GAAGb,UAAU,CAACM,QAAQ,CAACE,KAAK,CAACrB,GAAG,CAAC;EAC/C,MAAM2B,OAAO,GAAGD,QAAQ,CAACJ,EAAE,CAAC,CAAC,CAAC,CAAC,EAAEf,UAAU,CAAC,QAAQ,CAAC;EACrD,MAAMgB,MAAM,GAAGG,QAAQ,CAACJ,EAAE,CAAC,CAAC,CAAC,CAAC;EAE9B,IACE,CAACK,OAAO,IACR,CAACJ,MAAM,IACP,CAACtB,cAAc,CAACuB,GAAG,CAACD,MAAM,CAAC,IAC3BA,MAAM,KAAK,iBAAiB,EAC5B;IACA,OAAOV,UAAU;EACnB;EAEA,OAAOJ,QAAQ,CAACC,OAAO,EAAE,+BAA+Ba,MAAM,EAAE,EAAEX,QAAQ,CAAC;AAC7E","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
5
|
+
import { dirname, relative, resolve } from "node:path";
|
|
5
6
|
import { CommentArray, parse, stringify } from "comment-json";
|
|
6
7
|
import { bold, cyan } from "./picocolors.js";
|
|
7
8
|
export function setupTypeScript(envPath = "react-native-css-env.d.ts", name = "react-native-css") {
|
|
@@ -10,11 +11,15 @@ export function setupTypeScript(envPath = "react-native-css-env.d.ts", name = "r
|
|
|
10
11
|
if (!ts) {
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
|
-
const configFileName = ts.findConfigFile("
|
|
14
|
+
const configFileName = ts.findConfigFile(resolve("."), ts.sys.fileExists, "tsconfig.json");
|
|
15
|
+
if (!configFileName) return;
|
|
16
|
+
const configDirectory = dirname(resolve(configFileName));
|
|
17
|
+
const environmentFile = resolve(envPath);
|
|
18
|
+
const relativeEnvironmentFile = relative(configDirectory, environmentFile);
|
|
14
19
|
const userConfig = parse(readFileSync(configFileName, {
|
|
15
20
|
encoding: "utf-8"
|
|
16
21
|
}));
|
|
17
|
-
if (typeof userConfig !== "object" || !userConfig || Array.isArray(userConfig)) {
|
|
22
|
+
if (typeof userConfig !== "object" || !userConfig || Array.isArray(userConfig) || Object.prototype.toString.call(userConfig) !== "[object Object]") {
|
|
18
23
|
return;
|
|
19
24
|
}
|
|
20
25
|
const output = [];
|
|
@@ -25,17 +30,32 @@ export function setupTypeScript(envPath = "react-native-css-env.d.ts", name = "r
|
|
|
25
30
|
// NOTE: This file should not be edited and should be committed with your source code. It is generated by ${name}. If you need to move or disable this file, please see the documentation.`);
|
|
26
31
|
output.push(`Created ${cyan(envPath)}`);
|
|
27
32
|
}
|
|
28
|
-
userConfig.include
|
|
29
|
-
|
|
30
|
-
userConfig.include.push(envPath);
|
|
33
|
+
if (Array.isArray(userConfig.include) && !(Array.isArray(userConfig.files) && userConfig.files.includes(relativeEnvironmentFile)) && !userConfig.include.includes(relativeEnvironmentFile)) {
|
|
34
|
+
userConfig.include.push(relativeEnvironmentFile);
|
|
31
35
|
updatedConfig = true;
|
|
32
36
|
output.push(`Updated ${configFileName} to include the ${cyan(envPath)} file`);
|
|
33
37
|
}
|
|
38
|
+
|
|
39
|
+
// Resolve inheritance on a copy so comments and the user's own settings survive.
|
|
40
|
+
const effectiveConfig = ts.parseJsonConfigFileContent(JSON.parse(JSON.stringify(userConfig)), ts.sys, configDirectory, {}, resolve(configFileName));
|
|
41
|
+
if (!effectiveConfig.fileNames.some(file => resolve(file) === environmentFile)) {
|
|
42
|
+
// A files entry can include the declaration even when inherited include or
|
|
43
|
+
// exclude settings omit it. Preserve the original implicit include as well.
|
|
44
|
+
if (effectiveConfig.raw.include === undefined && effectiveConfig.raw.files === undefined) {
|
|
45
|
+
userConfig.include = new CommentArray("**/*");
|
|
46
|
+
}
|
|
47
|
+
userConfig.files ??= new CommentArray(...(effectiveConfig.raw.files || []));
|
|
48
|
+
if (Array.isArray(userConfig.files) && !userConfig.files.includes(relativeEnvironmentFile)) {
|
|
49
|
+
userConfig.files.push(relativeEnvironmentFile);
|
|
50
|
+
updatedConfig = true;
|
|
51
|
+
output.push(`Updated ${configFileName} to include the ${cyan(envPath)} file`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
34
54
|
if (updatedConfig) {
|
|
35
55
|
writeFileSync(configFileName, stringify(userConfig, null, 2));
|
|
36
56
|
}
|
|
37
57
|
if (output.length) {
|
|
38
|
-
console.log(`${cyan(bold("
|
|
58
|
+
console.log(`${cyan(bold("Nativewind"))} made the following changes to your project to support TypeScript:\n - ${output.join("\n - ")}`);
|
|
39
59
|
}
|
|
40
60
|
} catch {}
|
|
41
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["existsSync","readFileSync","writeFileSync","CommentArray","parse","stringify","bold","cyan","setupTypeScript","envPath","name","ts","require","configFileName","findConfigFile","sys","fileExists","userConfig","encoding","Array","isArray","output","updatedConfig","push","include","includes","length","console","log","join"],"sourceRoot":"../../../src","sources":["metro/typescript.ts"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,YAAY,EAAEC,aAAa,QAAQ,IAAI;
|
|
1
|
+
{"version":3,"names":["existsSync","readFileSync","writeFileSync","dirname","relative","resolve","CommentArray","parse","stringify","bold","cyan","setupTypeScript","envPath","name","ts","require","configFileName","findConfigFile","sys","fileExists","configDirectory","environmentFile","relativeEnvironmentFile","userConfig","encoding","Array","isArray","Object","prototype","toString","call","output","updatedConfig","push","include","files","includes","effectiveConfig","parseJsonConfigFileContent","JSON","fileNames","some","file","raw","undefined","length","console","log","join"],"sourceRoot":"../../../src","sources":["metro/typescript.ts"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,YAAY,EAAEC,aAAa,QAAQ,IAAI;AAC5D,SAASC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,QAAQ,WAAW;AAEtD,SAASC,YAAY,EAAEC,KAAK,EAAEC,SAAS,QAAQ,cAAc;AAE7D,SAASC,IAAI,EAAEC,IAAI,QAAQ,iBAAc;AAEzC,OAAO,SAASC,eAAeA,CAC7BC,OAAO,GAAG,2BAA2B,EACrCC,IAAI,GAAG,kBAAkB,EACzB;EACA,IAAI;IACF,MAAMC,EAAE,GAAGC,OAAO,CAAC,YAAY,CAAC;IAChC,IAAI,CAACD,EAAE,EAAE;MACP;IACF;IAEA,MAAME,cAAc,GAAGF,EAAE,CAACG,cAAc,CACtCZ,OAAO,CAAC,GAAG,CAAC,EACZS,EAAE,CAACI,GAAG,CAACC,UAAU,EACjB,eACF,CAAC;IAED,IAAI,CAACH,cAAc,EAAE;IAErB,MAAMI,eAAe,GAAGjB,OAAO,CAACE,OAAO,CAACW,cAAc,CAAC,CAAC;IACxD,MAAMK,eAAe,GAAGhB,OAAO,CAACO,OAAO,CAAC;IACxC,MAAMU,uBAAuB,GAAGlB,QAAQ,CAACgB,eAAe,EAAEC,eAAe,CAAC;IAE1E,MAAME,UAAU,GAAGhB,KAAK,CACtBN,YAAY,CAACe,cAAc,EAAE;MAC3BQ,QAAQ,EAAE;IACZ,CAAC,CACH,CAAC;IAED,IACE,OAAOD,UAAU,KAAK,QAAQ,IAC9B,CAACA,UAAU,IACXE,KAAK,CAACC,OAA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ACzCP,eAAe,CAACM,GAAG,CAACR,KAAK,KAAKS,SAAS,EACvC;QACArB,UAAU,CAACW,OAAO,GAAG,IAAI5B,YAAY,CAAC,MAAM,CAAC;MAC/C;MACAiB,UAAU,CAACY,KAAK,KAAK,IAAI7B,YAAY,CACnC,IAAI+B,eAAe,CAACM,GAAG,CAACR,KAAK,IAAI,EAAE,CACrC,CAAC;MACD,IACEV,KAAK,CAACC,OAAO,CAACH,UAAU,CAACY,KAAK,CAAC,IAC/B,CAACZ,UAAU,CAACY,KAAK,CAACC,QAAQ,CAACd,uBAAuB,CAAC,EACnD;QACAC,UAAU,CAACY,KAAK,CAACF,IAAI,CAACX,uBAAuB,CAAC;QAC9CU,aAAa,GAAG,IAAI;QACpBD,MAAM,CAACE,IAAI,CACT,WAAWjB,cAAc,mBAAmBN,IAAI,CAACE,OAAO,CAAC,OAC3D,CAAC;MACH;IACF;IAEA,IAAIoB,aAAa,EAAE;MACjB9B,aAAa,CAACc,cAAc,EAAER,SAAS,CAACe,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/D;IAEA,IAAIQ,MAAM,CAACc,MAAM,EAAE;MACjBC,OAAO,CAACC,GAAG,CACT,GAAGrC,IAAI,CAACD,IAAI,CAAC,YAAY,CAAC,CAAC,2EAA2EsB,MAAM,CAACiB,IAAI,CAAC,QAAQ,CAAC,EAC7H,CAAC;IACH;EACF,CAAC,CAAC,MAAM,CAAC;AACX","ignoreList":[]}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { useContext, useState } from "react";
|
|
4
|
+
import { useContext, useEffect, useState } from "react";
|
|
5
5
|
import { Appearance } from "react-native";
|
|
6
6
|
import { VariableContext } from "react-native-css/native-internal";
|
|
7
7
|
import { mappingToConfig, useNativeCss } from "./react/useNativeCss.js";
|
|
8
8
|
import { usePassthrough } from "./react/usePassthrough.js";
|
|
9
|
-
import { colorScheme as colorSchemeObs, VAR_SYMBOL } from "./reactivity.js";
|
|
9
|
+
import { cleanupEffect, colorScheme as colorSchemeObs, VAR_SYMBOL } from "./reactivity.js";
|
|
10
10
|
import { resolveValue } from "./styles/resolve.js";
|
|
11
11
|
export { StyleCollection, VariableContext, VariableContextProvider } from "react-native-css/native-internal";
|
|
12
12
|
export { useNativeCss };
|
|
13
|
+
const defaultMapping = {
|
|
14
|
+
className: "style"
|
|
15
|
+
};
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* Generates a new Higher-Order component the wraps the base component and applies the styles.
|
|
@@ -17,7 +20,7 @@ export { useNativeCss };
|
|
|
17
20
|
* @param baseComponent
|
|
18
21
|
* @param mapping
|
|
19
22
|
*/
|
|
20
|
-
export const styled = (baseComponent, mapping, options) => {
|
|
23
|
+
export const styled = (baseComponent, mapping = defaultMapping, options) => {
|
|
21
24
|
let component;
|
|
22
25
|
// const type = getComponentType(baseComponent);
|
|
23
26
|
|
|
@@ -40,7 +43,7 @@ export const colorScheme = {
|
|
|
40
43
|
return colorSchemeObs.get() ?? Appearance.getColorScheme() ?? "light";
|
|
41
44
|
},
|
|
42
45
|
set(value) {
|
|
43
|
-
return colorSchemeObs.set(value);
|
|
46
|
+
return colorSchemeObs.set(value === "unspecified" ? null : value);
|
|
44
47
|
}
|
|
45
48
|
};
|
|
46
49
|
export const useUnstableNativeVariable = useNativeVariable;
|
|
@@ -53,19 +56,23 @@ export function useNativeVariable(name) {
|
|
|
53
56
|
name = name.slice(2);
|
|
54
57
|
}
|
|
55
58
|
const inheritedVariables = useContext(VariableContext);
|
|
56
|
-
const [
|
|
59
|
+
const [, forceUpdate] = useState(0);
|
|
60
|
+
const [effect] = useState(() => {
|
|
57
61
|
const effect = {
|
|
58
62
|
observers: new Set(),
|
|
59
|
-
run: () =>
|
|
60
|
-
...state
|
|
61
|
-
}))
|
|
63
|
+
run: () => forceUpdate(state => state + 1)
|
|
62
64
|
};
|
|
63
65
|
const get = observable => observable.get(effect);
|
|
64
|
-
return {
|
|
65
|
-
...effect,
|
|
66
|
+
return Object.assign(effect, {
|
|
66
67
|
get
|
|
67
|
-
};
|
|
68
|
+
});
|
|
68
69
|
});
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
// React StrictMode replays setup after cleanup without another render.
|
|
72
|
+
if (effect.observers.size === 0) forceUpdate(state => state + 1);
|
|
73
|
+
return () => cleanupEffect(effect);
|
|
74
|
+
}, [effect]);
|
|
75
|
+
cleanupEffect(effect);
|
|
69
76
|
return resolveValue([{}, "var", [name]], effect.get, {
|
|
70
77
|
inheritedVariables
|
|
71
78
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useContext","useState","Appearance","VariableContext","mappingToConfig","useNativeCss","usePassthrough","colorScheme","colorSchemeObs","VAR_SYMBOL","resolveValue","StyleCollection","VariableContextProvider","styled","baseComponent","mapping","options","component","configs","passThrough","props","name","displayName","get","getColorScheme","set","value","useUnstableNativeVariable","useNativeVariable","useCssElement","incomingProps","config","startsWith","slice","inheritedVariables","
|
|
1
|
+
{"version":3,"names":["useContext","useEffect","useState","Appearance","VariableContext","mappingToConfig","useNativeCss","usePassthrough","cleanupEffect","colorScheme","colorSchemeObs","VAR_SYMBOL","resolveValue","StyleCollection","VariableContextProvider","defaultMapping","className","styled","baseComponent","mapping","options","component","configs","passThrough","props","name","displayName","get","getColorScheme","set","value","useUnstableNativeVariable","useNativeVariable","useCssElement","incomingProps","config","startsWith","slice","inheritedVariables","forceUpdate","effect","observers","Set","run","state","observable","Object","assign","size","vars","variables","fromEntries","entries","map","k","v","replace"],"sourceRoot":"../../../src","sources":["native/api.tsx"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAA4B,OAAO;AAC3E,SAASC,UAAU,QAAwB,cAAc;AAGzD,SAASC,eAAe,QAAQ,kCAAkC;AAUlE,SAASC,eAAe,EAAEC,YAAY,QAAQ,yBAAsB;AACpE,SAASC,cAAc,QAAQ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AAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAACa,IAAI,CAAC,CAAC,EAAEe,MAAM,CAACb,GAAG,EAAE;IAAEW;EAAmB,CAAC,CAAC;AAC9E;;AAEA;AACA;AACA;AACA,OAAO,SAASW,IAAIA,CAACC,SAA0C,EAAa;EAC1E,OAAOJ,MAAM,CAACC,MAAM,CAClB;IAAE,CAACpC,UAAU,GAAG;EAAS,CAAC,EAC1BmC,MAAM,CAACK,WAAW,CAChBL,MAAM,CAACM,OAAO,CAACF,SAAS,CAAC,CAACG,GAAG,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAK,CAACD,CAAC,CAACE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAED,CAAC,CAAC,CACrE,CACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
export function testAttributes(queries, props, guards) {
|
|
4
4
|
return queries.every(query => testAttribute(query, props, guards));
|
|
5
5
|
}
|
|
6
|
-
function testAttribute([type, prop, operator, testValue], props, guards) {
|
|
6
|
+
function testAttribute([type, prop, operator, testValue, caseSensitivity], props, guards) {
|
|
7
7
|
let value = undefined;
|
|
8
8
|
if (props) {
|
|
9
9
|
if (type === "a") {
|
|
@@ -17,21 +17,28 @@ function testAttribute([type, prop, operator, testValue], props, guards) {
|
|
|
17
17
|
if (!operator) {
|
|
18
18
|
return value !== undefined && value !== null && value !== false;
|
|
19
19
|
}
|
|
20
|
+
if (operator === "!") return !value;
|
|
21
|
+
if (value === undefined || value === null || testValue === undefined) return false;
|
|
22
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") return false;
|
|
23
|
+
let actual = String(value);
|
|
24
|
+
if (caseSensitivity === "i") {
|
|
25
|
+
// CSS attribute flags fold ASCII letters only, not Unicode characters.
|
|
26
|
+
actual = actual.replace(/[A-Z]/g, letter => letter.toLowerCase());
|
|
27
|
+
testValue = testValue.replace(/[A-Z]/g, letter => letter.toLowerCase());
|
|
28
|
+
}
|
|
20
29
|
switch (operator) {
|
|
21
|
-
case "!":
|
|
22
|
-
return !value;
|
|
23
30
|
case "=":
|
|
24
|
-
return
|
|
31
|
+
return actual === testValue;
|
|
25
32
|
case "~=":
|
|
26
|
-
return testValue &&
|
|
33
|
+
return testValue !== "" && actual.split(/[\t\n\f\r ]+/).includes(testValue);
|
|
27
34
|
case "|=":
|
|
28
|
-
return testValue
|
|
35
|
+
return actual === testValue || actual.startsWith(testValue + "-");
|
|
29
36
|
case "^=":
|
|
30
|
-
return testValue &&
|
|
37
|
+
return testValue !== "" && actual.startsWith(testValue);
|
|
31
38
|
case "$=":
|
|
32
|
-
return testValue &&
|
|
39
|
+
return testValue !== "" && actual.endsWith(testValue);
|
|
33
40
|
case "*=":
|
|
34
|
-
return testValue &&
|
|
41
|
+
return testValue !== "" && actual.includes(testValue);
|
|
35
42
|
default:
|
|
36
43
|
operator;
|
|
37
44
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["testAttributes","queries","props","guards","every","query","testAttribute","type","prop","operator","testValue","value","undefined","dataSet","push","
|
|
1
|
+
{"version":3,"names":["testAttributes","queries","props","guards","every","query","testAttribute","type","prop","operator","testValue","caseSensitivity","value","undefined","dataSet","push","actual","String","replace","letter","toLowerCase","split","includes","startsWith","endsWith"],"sourceRoot":"../../../../src","sources":["native/conditions/attributes.ts"],"mappings":";;AAIA,OAAO,SAASA,cAAcA,CAC5BC,OAAyB,EACzBC,KAAiD,EACjDC,MAAqB,EACrB;EACA,OAAOF,OAAO,CAACG,KAAK,CAAEC,KAAK,IAAKC,aAAa,CAACD,KAAK,EAAEH,KAAK,EAAEC,MAAM,CAAC,CAAC;AACtE;AAEA,SAASG,aAAaA,CACpB,CAACC,IAAI,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,eAAe,CAAiB,EAClET,KAAiD,EACjDC,MAAqB,EACrB;EACA,IAAIS,KAAc,GAAGC,SAAS;EAE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P,OAAOM,MAAM,KAAKN,SAAS,IAAIM,MAAM,CAACO,UAAU,CAACb,SAAS,GAAG,GAAG,CAAC;IACnE,KAAK,IAAI;MACP,OAAOA,SAAS,KAAK,EAAE,IAAIM,MAAM,CAACO,UAAU,CAACb,SAAS,CAAC;IACzD,KAAK,IAAI;MACP,OAAOA,SAAS,KAAK,EAAE,IAAIM,MAAM,CAACQ,QAAQ,CAACd,SAAS,CAAC;IACvD,KAAK,IAAI;MACP,OAAOA,SAAS,KAAK,EAAE,IAAIM,MAAM,CAACM,QAAQ,CAACZ,SAAS,CAAC;IACvD;MACED,QAAQ;MACR,OAAO,KAAK;EAChB;AACF","ignoreList":[]}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
5
|
import { activeFamily, containerHeightFamily, containerWidthFamily, focusFamily, hoverFamily } from "../reactivity.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { testAttributes } from "./attributes.js";
|
|
8
7
|
export const DEFAULT_CONTAINER_NAME = "c:___default___";
|
|
9
8
|
export function testContainerQueries(queries, inheritedContainers, guards, get) {
|
|
10
9
|
return queries.every(query => {
|
|
@@ -19,14 +18,15 @@ export function testContainerQuery(query, inheritedContainers, guards, get) {
|
|
|
19
18
|
return false;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
// Ancestor snapshots have their own context guard. Their attributes must not
|
|
22
|
+
// be compared with this descendant's props by the ordinary attribute guards.
|
|
23
|
+
if (query.a && !testAttributes(query.a, container.props, [])) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (query.m && !testContainerMediaCondition(query.m, container.key, get)) {
|
|
27
27
|
return false;
|
|
28
28
|
}
|
|
29
|
-
if (query.p && !testContainerPseudoCondition(query.p, container, get)) {
|
|
29
|
+
if (query.p && !testContainerPseudoCondition(query.p, container.key, get)) {
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
return true;
|
|
@@ -77,11 +77,11 @@ function testContainerMediaCondition(condition, containerKey, get) {
|
|
|
77
77
|
case ">":
|
|
78
78
|
return left > right;
|
|
79
79
|
case ">=":
|
|
80
|
-
return left
|
|
80
|
+
return left >= right;
|
|
81
81
|
case "<":
|
|
82
|
-
return left
|
|
82
|
+
return left < right;
|
|
83
83
|
case "<=":
|
|
84
|
-
return left
|
|
84
|
+
return left <= right;
|
|
85
85
|
default:
|
|
86
86
|
condition[0];
|
|
87
87
|
return false;
|