react-native-css 0.0.0-nightly.2c68396 → 0.0.0-nightly.2e152c9
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 +35 -5
- package/dist/commonjs/babel/helpers.js +7 -0
- package/dist/commonjs/babel/helpers.js.map +1 -1
- package/dist/commonjs/babel/import-plugin.js +20 -8
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +17 -4
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +9 -4
- package/dist/commonjs/babel/react-native.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +35 -0
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +198 -39
- 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 +190 -101
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/individual-transforms.js +129 -0
- package/dist/commonjs/compiler/individual-transforms.js.map +1 -0
- package/dist/commonjs/compiler/inline-variables.js +47 -1
- package/dist/commonjs/compiler/inline-variables.js.map +1 -1
- package/dist/commonjs/compiler/lightningcss-loader.js +11 -8
- 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 +16 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +33 -9
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +1 -3
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +1 -0
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +2 -6
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +2 -3
- package/dist/commonjs/components/KeyboardAvoidingView.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/index.cjs +49 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/components/react-native-safe-area-context.native.js +10 -0
- package/dist/commonjs/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/commonjs/jest/index.js +3 -1
- 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 +2 -0
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/metro-transformer.js +16 -3
- package/dist/commonjs/metro/metro-transformer.js.map +1 -1
- package/dist/commonjs/metro/typescript.js +26 -6
- package/dist/commonjs/metro/typescript.js.map +1 -1
- package/dist/commonjs/metro/warnings.js +135 -0
- package/dist/commonjs/metro/warnings.js.map +1 -0
- package/dist/commonjs/native/api.js +16 -11
- 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/guards.js +7 -0
- package/dist/commonjs/native/conditions/guards.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/objects.js +11 -18
- package/dist/commonjs/native/objects.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 +45 -38
- package/dist/commonjs/native/react/rules.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +70 -15
- 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/native/reactivity.js +64 -24
- 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 +139 -26
- package/dist/commonjs/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/native/styles/functions/animation-timing.js +2 -1
- package/dist/commonjs/native/styles/functions/animation-timing.js.map +1 -1
- package/dist/commonjs/native/styles/functions/color-mix.js +43 -29
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -1
- package/dist/commonjs/native/styles/functions/filters.js +19 -5
- package/dist/commonjs/native/styles/functions/filters.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/platform-functions.js +2 -1
- package/dist/commonjs/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/string-functions.js +22 -6
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +95 -105
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +303 -49
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +136 -19
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +12 -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 +6 -3
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/box-shadow.js +41 -20
- 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/shorthands/transform.js +31 -8
- package/dist/commonjs/native/styles/shorthands/transform.js.map +1 -1
- package/dist/commonjs/native/styles/variables.js +165 -48
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/root.js +46 -7
- package/dist/commonjs/native-internal/root.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +22 -37
- package/dist/commonjs/native-internal/style-collection.js.map +1 -1
- package/dist/commonjs/native-internal/variables.js +1 -1
- package/dist/commonjs/native-internal/variables.js.map +1 -1
- package/dist/commonjs/utilities/dot-notation.types.js +4 -0
- package/dist/commonjs/utilities/equality.js +41 -0
- package/dist/commonjs/utilities/equality.js.map +1 -0
- package/dist/commonjs/utilities/index.js +11 -0
- package/dist/commonjs/utilities/index.js.map +1 -1
- package/dist/commonjs/utilities/style-descriptor.js +32 -8
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +2 -2
- 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/helpers.js +6 -0
- package/dist/module/babel/helpers.js.map +1 -1
- package/dist/module/babel/import-plugin.js +22 -10
- 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 +9 -4
- package/dist/module/babel/react-native.js.map +1 -1
- package/dist/module/compiler/atRules.js +33 -0
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +200 -41
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +2 -0
- package/dist/module/compiler/compiler.types.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 +190 -100
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/individual-transforms.js +125 -0
- package/dist/module/compiler/individual-transforms.js.map +1 -0
- package/dist/module/compiler/inline-variables.js +47 -1
- package/dist/module/compiler/inline-variables.js.map +1 -1
- package/dist/module/compiler/lightningcss-loader.js +10 -8
- 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 +16 -5
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +33 -9
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +1 -3
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/FlatList.js +1 -0
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/ImageBackground.js +2 -6
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +2 -3
- package/dist/module/components/KeyboardAvoidingView.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/index.cjs +49 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/components/react-native-safe-area-context.native.js +9 -1
- package/dist/module/components/react-native-safe-area-context.native.js.map +1 -1
- package/dist/module/jest/index.js +3 -1
- 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 +2 -0
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/metro-transformer.js +16 -3
- package/dist/module/metro/metro-transformer.js.map +1 -1
- package/dist/module/metro/typescript.js +26 -6
- package/dist/module/metro/typescript.js.map +1 -1
- package/dist/module/metro/warnings.js +131 -0
- package/dist/module/metro/warnings.js.map +1 -0
- package/dist/module/native/api.js +18 -13
- 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/guards.js +7 -0
- package/dist/module/native/conditions/guards.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/objects.js +11 -18
- package/dist/module/native/objects.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 +46 -39
- package/dist/module/native/react/rules.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +73 -18
- 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/native/reactivity.js +58 -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 +139 -26
- package/dist/module/native/styles/calculate-props.js.map +1 -1
- package/dist/module/native/styles/functions/animation-timing.js +2 -1
- package/dist/module/native/styles/functions/animation-timing.js.map +1 -1
- package/dist/module/native/styles/functions/color-mix.js +43 -29
- package/dist/module/native/styles/functions/color-mix.js.map +1 -1
- package/dist/module/native/styles/functions/filters.js +17 -4
- package/dist/module/native/styles/functions/filters.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/platform-functions.js +2 -1
- package/dist/module/native/styles/functions/platform-functions.js.map +1 -1
- package/dist/module/native/styles/functions/string-functions.js +19 -5
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +93 -104
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +304 -49
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +136 -19
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +8 -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 +6 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/box-shadow.js +43 -21
- 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/shorthands/transform.js +31 -8
- package/dist/module/native/styles/shorthands/transform.js.map +1 -1
- package/dist/module/native/styles/variables.js +166 -50
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/root.js +44 -7
- package/dist/module/native-internal/root.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +10 -37
- package/dist/module/native-internal/style-collection.js.map +1 -1
- package/dist/module/native-internal/variables.js +2 -2
- package/dist/module/native-internal/variables.js.map +1 -1
- package/dist/module/utilities/dot-notation.types.js +2 -0
- package/dist/module/utilities/equality.js +37 -0
- package/dist/module/utilities/equality.js.map +1 -0
- package/dist/module/utilities/index.js +1 -0
- package/dist/module/utilities/index.js.map +1 -1
- package/dist/module/utilities/style-descriptor.js +30 -8
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +2 -2
- 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/helpers.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts.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 +1 -5
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +13 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -3
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts +10 -0
- package/dist/typescript/commonjs/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/inline-variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/inline-variables.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 +2 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +10 -10
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.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/react-native-safe-area-context.native.d.ts +2 -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 +2 -10
- 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 +4 -0
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts +9 -4
- package/dist/typescript/commonjs/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/commonjs/src/metro/warnings.d.ts.map +1 -0
- 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/conditions/guards.d.ts +2 -1
- package/dist/typescript/commonjs/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/objects.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 +7 -2
- package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts +0 -3
- 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/reactivity.d.ts +15 -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/calculate-props.d.ts +11 -2
- package/dist/typescript/commonjs/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -1
- 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/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/platform-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 +2 -0
- 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 +5 -4
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +4 -1
- 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.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/shorthands/transform.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts +3 -2
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/root.d.ts +38 -0
- package/dist/typescript/commonjs/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/style-collection.d.ts +2 -2
- package/dist/typescript/commonjs/src/native-internal/style-collection.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 +2 -1
- package/dist/typescript/commonjs/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/equality.d.ts +2 -0
- package/dist/typescript/commonjs/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts +14 -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/helpers.d.ts +2 -1
- package/dist/typescript/module/src/babel/helpers.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 +3 -7
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +14 -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 -5
- 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/individual-transforms.d.ts +10 -0
- package/dist/typescript/module/src/compiler/individual-transforms.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +2 -2
- package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts +2 -2
- 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 +3 -2
- 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 +10 -10
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.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/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 +2 -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 +2 -10
- 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 +5 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/metro-transformer.d.ts +10 -5
- package/dist/typescript/module/src/metro/metro-transformer.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/typescript.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/warnings.d.ts +13 -0
- package/dist/typescript/module/src/metro/warnings.d.ts.map +1 -0
- 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 +4 -3
- 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/objects.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 +9 -4
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +4 -7
- 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/reactivity.d.ts +15 -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 +13 -4
- 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 +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -1
- 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 -8
- 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 +3 -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 +9 -8
- 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 +7 -4
- 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 +2 -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 +4 -3
- 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 +39 -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 +3 -3
- 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 +2 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/equality.d.ts +2 -0
- package/dist/typescript/module/src/utilities/equality.d.ts.map +1 -0
- package/dist/typescript/module/src/utilities/index.d.ts +4 -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 +14 -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 +78 -31
- package/src/babel/helpers.ts +8 -1
- package/src/babel/import-plugin.ts +31 -16
- package/src/babel/react-native-web.ts +32 -4
- package/src/babel/react-native.ts +9 -4
- package/src/compiler/atRules.ts +44 -0
- package/src/compiler/compiler.ts +282 -50
- package/src/compiler/compiler.types.ts +17 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +385 -247
- package/src/compiler/individual-transforms.ts +129 -0
- package/src/compiler/inline-variables.ts +67 -0
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +32 -5
- package/src/compiler/stylesheet.ts +51 -15
- package/src/compiler/supports.ts +1 -3
- package/src/components/FlatList.tsx +1 -0
- package/src/components/ImageBackground.tsx +2 -6
- package/src/components/KeyboardAvoidingView.tsx +2 -3
- package/src/components/SafeAreaProvider.tsx +1 -0
- package/src/components/index.cts +49 -1
- package/src/components/react-native-safe-area-context.native.tsx +20 -0
- package/src/jest/index.ts +3 -1
- package/src/metro/cache-version.ts +48 -0
- package/src/metro/index.ts +7 -0
- package/src/metro/metro-transformer.ts +26 -8
- package/src/metro/typescript.ts +53 -6
- package/src/metro/warnings.ts +187 -0
- package/src/native/api.tsx +26 -18
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/guards.ts +13 -1
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/objects.ts +12 -22
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +58 -45
- package/src/native/react/useNativeCss.ts +85 -18
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +79 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/calculate-props.ts +179 -28
- package/src/native/styles/functions/animation-timing.ts +3 -1
- package/src/native/styles/functions/color-mix.ts +45 -39
- package/src/native/styles/functions/filters.ts +21 -6
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/platform-functions.ts +3 -1
- package/src/native/styles/functions/string-functions.ts +25 -5
- package/src/native/styles/functions/transform-functions.ts +111 -64
- package/src/native/styles/index.ts +340 -53
- package/src/native/styles/resolve.ts +188 -29
- package/src/native/styles/scale-factor.ts +9 -0
- package/src/native/styles/shorthands/_handler.ts +14 -1
- package/src/native/styles/shorthands/animation.ts +8 -2
- package/src/native/styles/shorthands/box-shadow.ts +46 -25
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/shorthands/transform.ts +36 -11
- package/src/native/styles/variables.ts +242 -45
- package/src/native-internal/root.ts +83 -13
- package/src/native-internal/style-collection.ts +21 -46
- package/src/native-internal/variables.tsx +6 -4
- package/src/runtime.types.ts +17 -15
- package/src/utilities/dot-notation.types.ts +4 -3
- package/src/utilities/equality.ts +41 -0
- package/src/utilities/index.ts +1 -0
- package/src/utilities/style-descriptor.ts +36 -14
- package/src/web/api.tsx +7 -12
- package/src/web/assign-style.ts +2 -1
- package/types.d.ts +0 -20
- package/dist/commonjs/compiler/inheritance.test.js +0 -78
- package/dist/commonjs/compiler/inheritance.test.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/typescript/commonjs/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/commonjs/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/eslint.config.d.mts +0 -2
- package/dist/typescript/commonjs/eslint.config.d.mts.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/index.d.ts +0 -2
- package/dist/typescript/commonjs/example/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/metro.config.d.ts +0 -3
- package/dist/typescript/commonjs/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/commonjs/example/postcss.config.d.mts +0 -7
- package/dist/typescript/commonjs/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/commonjs/example/src/App.d.ts +0 -3
- 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/module/.config/eslint.config.d.mts +0 -3
- package/dist/typescript/module/.config/eslint.config.d.mts.map +0 -1
- package/dist/typescript/module/eslint.config.d.mts +0 -2
- package/dist/typescript/module/eslint.config.d.mts.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/index.d.ts +0 -2
- package/dist/typescript/module/example/index.d.ts.map +0 -1
- package/dist/typescript/module/example/metro.config.d.ts +0 -3
- package/dist/typescript/module/example/metro.config.d.ts.map +0 -1
- package/dist/typescript/module/example/postcss.config.d.mts +0 -7
- package/dist/typescript/module/example/postcss.config.d.mts.map +0 -1
- package/dist/typescript/module/example/src/App.d.ts +0 -3
- 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/src/compiler/inheritance.test.ts +0 -121
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { createElement, Fragment, useContext, useEffect, useState } from "react";
|
|
5
|
-
import { Pressable, View } from "react-native";
|
|
4
|
+
import { createElement, Fragment, useContext, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Image, Pressable, StyleSheet, View } from "react-native";
|
|
6
6
|
import { VariableContext } from "react-native-css/native-internal";
|
|
7
7
|
import { testGuards } from "../conditions/guards.js";
|
|
8
|
-
import { cleanupEffect, ContainerContext } from "../reactivity.js";
|
|
8
|
+
import { cleanupEffect, ContainerContext, hasChangedDependencies, weakFamily } from "../reactivity.js";
|
|
9
9
|
import { animatedComponentFamily } from "../reanimated.js";
|
|
10
10
|
import { getStyledProps } from "../styles/index.js";
|
|
11
11
|
import { updateRules } from "./rules.js";
|
|
@@ -19,9 +19,6 @@ export function useNativeCss(type, originalProps, configs = [{
|
|
|
19
19
|
const inheritedVariables = useContext(VariableContext);
|
|
20
20
|
const inheritedContainers = useContext(ContainerContext);
|
|
21
21
|
const [state, setState] = useState(() => {
|
|
22
|
-
// Both effects share the same observers to improve memory usage
|
|
23
|
-
const observers = new Set();
|
|
24
|
-
|
|
25
22
|
/**
|
|
26
23
|
* When fired, this effect will force the rules to be re-evaluated.
|
|
27
24
|
* This will cause a re-render if there are different rules
|
|
@@ -29,7 +26,7 @@ export function useNativeCss(type, originalProps, configs = [{
|
|
|
29
26
|
* Use this when a rule condition changes, e.g FastRefresh or media queries
|
|
30
27
|
*/
|
|
31
28
|
const ruleEffect = {
|
|
32
|
-
observers,
|
|
29
|
+
observers: new Set(),
|
|
33
30
|
run: () => setState(state => updateRules(state))
|
|
34
31
|
};
|
|
35
32
|
|
|
@@ -40,12 +37,12 @@ export function useNativeCss(type, originalProps, configs = [{
|
|
|
40
37
|
* Use this when a value changes, e.g vm units or light / dark mode
|
|
41
38
|
*/
|
|
42
39
|
const styleEffect = {
|
|
43
|
-
observers,
|
|
40
|
+
observers: new Set(),
|
|
44
41
|
run: () => setState(state => ({
|
|
45
42
|
...state
|
|
46
43
|
}))
|
|
47
44
|
};
|
|
48
|
-
|
|
45
|
+
const initialState = updateRules({
|
|
49
46
|
ruleEffect,
|
|
50
47
|
ruleEffectGetter: observable => observable.get(ruleEffect),
|
|
51
48
|
styleEffect,
|
|
@@ -54,10 +51,35 @@ export function useNativeCss(type, originalProps, configs = [{
|
|
|
54
51
|
inheritedVariables,
|
|
55
52
|
pressable: type === View ? false : undefined
|
|
56
53
|
}, originalProps, inheritedVariables, inheritedContainers, false, false);
|
|
54
|
+
// State initializers may be discarded by React StrictMode. Subscribe once
|
|
55
|
+
// the component commits instead of retaining an abandoned initializer.
|
|
56
|
+
cleanupEffect(ruleEffect);
|
|
57
|
+
return initialState;
|
|
57
58
|
});
|
|
58
59
|
|
|
59
|
-
//
|
|
60
|
-
|
|
60
|
+
// Distinguishes a fresh mount from an effect replay (Activity, StrictMode)
|
|
61
|
+
const hasCommittedRef = useRef(false);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
// Reconnect subscriptions after React replays an effect setup.
|
|
64
|
+
if (state.ruleEffect.observers.size === 0) {
|
|
65
|
+
if (hasCommittedRef.current || hasChangedDependencies(state.ruleEffect)) {
|
|
66
|
+
// Replay, or conditions changed since the initializer: recalculate.
|
|
67
|
+
state.ruleEffect.run();
|
|
68
|
+
state.styleEffect.run();
|
|
69
|
+
} else {
|
|
70
|
+
// Fresh mount: resubscribe to the initializer's dependencies.
|
|
71
|
+
// styleEffect resubscribes itself during render.
|
|
72
|
+
for (const observable of state.ruleEffect.dependencies ?? []) {
|
|
73
|
+
observable.get(state.ruleEffect);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
hasCommittedRef.current = true;
|
|
78
|
+
return () => {
|
|
79
|
+
cleanupEffect(state.ruleEffect);
|
|
80
|
+
cleanupEffect(state.styleEffect);
|
|
81
|
+
};
|
|
82
|
+
}, [state.ruleEffect, state.styleEffect]);
|
|
61
83
|
|
|
62
84
|
// Check if our derived state has changed (e.g the className prop)
|
|
63
85
|
if (testGuards(state, originalProps, inheritedVariables, inheritedContainers)) {
|
|
@@ -70,7 +92,7 @@ export function useNativeCss(type, originalProps, configs = [{
|
|
|
70
92
|
// We can bail on rendering as the result of this render will be discarded
|
|
71
93
|
return /*#__PURE__*/createElement(Fragment);
|
|
72
94
|
}
|
|
73
|
-
let props = getStyledProps(state, originalProps);
|
|
95
|
+
let props = getStyledProps(state, originalProps, type === Image ? adaptImageProps : undefined);
|
|
74
96
|
if (type === View && props?.onPress) {
|
|
75
97
|
type = Pressable;
|
|
76
98
|
}
|
|
@@ -85,8 +107,14 @@ export function useNativeCss(type, originalProps, configs = [{
|
|
|
85
107
|
type = VariableContext.Provider;
|
|
86
108
|
}
|
|
87
109
|
if (state.containers) {
|
|
110
|
+
// Publish a new props snapshot even when this component's own rules did not
|
|
111
|
+
// change. Descendants can depend on an ancestor attribute through a group.
|
|
112
|
+
const containers = Object.fromEntries(Object.entries(state.containers).map(([name, container]) => [name, container.key === state.ruleEffectGetter ? {
|
|
113
|
+
key: container.key,
|
|
114
|
+
props: originalProps
|
|
115
|
+
} : inheritedContainers[name] ?? container]));
|
|
88
116
|
props = {
|
|
89
|
-
value:
|
|
117
|
+
value: containers,
|
|
90
118
|
children: /*#__PURE__*/createElement(type, props)
|
|
91
119
|
};
|
|
92
120
|
type = ContainerContext.Provider;
|
|
@@ -94,10 +122,8 @@ export function useNativeCss(type, originalProps, configs = [{
|
|
|
94
122
|
return /*#__PURE__*/createElement(type, props);
|
|
95
123
|
}
|
|
96
124
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*/
|
|
100
|
-
export function mappingToConfig(mapping) {
|
|
125
|
+
// Derived once per mapping, since the resolved-style cache keys on the config array's identity
|
|
126
|
+
const configForMapping = weakFamily(function (mapping) {
|
|
101
127
|
return Object.entries(mapping).flatMap(([key, value]) => {
|
|
102
128
|
if (value === true) {
|
|
103
129
|
return {
|
|
@@ -115,7 +141,10 @@ export function mappingToConfig(mapping) {
|
|
|
115
141
|
target: value.split(".")
|
|
116
142
|
};
|
|
117
143
|
} else if (typeof value === "object") {
|
|
118
|
-
|
|
144
|
+
// Keep the declared deprecated alias working. The current spelling wins
|
|
145
|
+
// when both are provided, including an intentionally empty mapping.
|
|
146
|
+
const mapping = value.nativeStyleMapping ?? value.nativeStyleToProp;
|
|
147
|
+
const nativeStyleMapping = mapping ? Object.fromEntries(Object.entries(mapping).map(([k, v]) => [k, v === true ? k : v])) : undefined;
|
|
119
148
|
if (Array.isArray(value)) {
|
|
120
149
|
return {
|
|
121
150
|
source: key,
|
|
@@ -156,5 +185,31 @@ export function mappingToConfig(mapping) {
|
|
|
156
185
|
}
|
|
157
186
|
throw new Error(`styled(): Invalid mapping for ${key}: ${value}`);
|
|
158
187
|
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// Refused by name, since a primitive would otherwise fail inside the WeakMap with a message naming neither styled() nor the argument
|
|
191
|
+
export function mappingToConfig(mapping) {
|
|
192
|
+
if (typeof mapping !== "object" || mapping === null) {
|
|
193
|
+
throw new Error(`styled(): mapping must be an object, received ${mapping === null ? "null" : typeof mapping}`);
|
|
194
|
+
}
|
|
195
|
+
return configForMapping(mapping);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Apply native Image fitting before normal, inline, and important props merge.
|
|
199
|
+
// The compiler's contentFit mapping remains available to Expo Image adapters.
|
|
200
|
+
function adaptImageProps(props) {
|
|
201
|
+
if (!props || !("contentFit" in props)) return props;
|
|
202
|
+
const {
|
|
203
|
+
contentFit,
|
|
204
|
+
style,
|
|
205
|
+
...rest
|
|
206
|
+
} = props;
|
|
207
|
+
return {
|
|
208
|
+
...rest,
|
|
209
|
+
style: {
|
|
210
|
+
...StyleSheet.flatten(style),
|
|
211
|
+
objectFit: contentFit
|
|
212
|
+
}
|
|
213
|
+
};
|
|
159
214
|
}
|
|
160
215
|
//# sourceMappingURL=useNativeCss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElement","Fragment","useContext","useEffect","useState","Pressable","View","VariableContext","testGuards","cleanupEffect","ContainerContext","animatedComponentFamily","getStyledProps","updateRules","useNativeCss","type","originalProps","configs","source","target","inheritedVariables","inheritedContainers","state","setState","
|
|
1
|
+
{"version":3,"names":["createElement","Fragment","useContext","useEffect","useRef","useState","Image","Pressable","StyleSheet","View","VariableContext","testGuards","cleanupEffect","ContainerContext","hasChangedDependencies","weakFamily","animatedComponentFamily","getStyledProps","updateRules","useNativeCss","type","originalProps","configs","source","target","inheritedVariables","inheritedContainers","state","setState","ruleEffect","observers","Set","run","styleEffect","initialState","ruleEffectGetter","observable","get","pressable","undefined","hasCommittedRef","size","current","dependencies","props","adaptImageProps","onPress","animated","variables","value","children","Provider","containers","Object","fromEntries","entries","map","name","container","key","configForMapping","mapping","flatMap","split","nativeStyleMapping","nativeStyleToProp","k","v","Array","isArray","length","Error","mappingToConfig","contentFit","style","rest","flatten","objectFit"],"sourceRoot":"../../../../src","sources":["native/react/useNativeCss.ts"],"mappings":";;AAAA;AACA,SACEA,aAAa,EACbC,QAAQ,EACRC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,QAAQ,QAEH,OAAO;AACd,SAASC,KAAK,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEjE,SAASC,eAAe,QAAQ,kCAAkC;AAGlE,SAASC,UAAU,QAA0B,yBAAsB;AACnE,SACEC,aAAa,EACbC,gBAAgB,EAChBC,sBAAsB,EACtBC,UAAU,QAKL,kBAAe;AACtB,SAASC,uBAAuB,QAAQ,kBAAe;AACvD,SAASC,cAAc,QAAsB,oBAAW;AACxD,SAASC,WAAW,QAAQ,YAAS;AAkCrC;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAC1BC,IA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C;YAAmB,CAAC;UAChE,CAAC,MAAM;YACL,OAAO;cAAEzC,MAAM,EAAEoC,GAAG;cAAEnC,MAAM;cAAEwC;YAAmB,CAAC;UACpD;QACF,CAAC,MAAM,IAAII,KAAK,CAACC,OAAO,CAACpB,KAAK,CAACzB,MAAM,CAAC,EAAE;UACtC,OAAO;YAAED,MAAM,EAAEoC,GAAG;YAAEnC,MAAM,EAAEyB,KAAK,CAACzB,MAAM;YAAEwC;UAAmB,CAAC;QAClE;MACF;IACF;IAEA,MAAM,IAAIO,KAAK,CAAC,iCAAiCZ,GAAG,KAAKV,KAAK,EAAE,CAAC;EACnE,CAAC,CAAC;AACJ,CAAC,CAAC;;AAEF;AACA,OAAO,SAASuB,eAAeA,CAACX,OAAiC,EAAY;EAC3E,IAAI,OAAOA,OAAO,KAAK,QAAQ,IAAIA,OAAO,KAAK,IAAI,EAAE;IACnD,MAAM,IAAIU,KAAK,CACb,iDAAiDV,OAAO,KAAK,IAAI,GAAG,MAAM,GAAG,OAAOA,OAAO,EAC7F,CAAC;EACH;EAEA,OAAOD,gBAAgB,CAACC,OAAO,CAAC;AAClC;;AAEA;AACA;AACA,SAAShB,eAAeA,CAACD,KAAsC,EAAE;EAC/D,IAAI,CAACA,KAAK,IAAI,EAAE,YAAY,IAAIA,KAAK,CAAC,EAAE,OAAOA,KAAK;EACpD,MAAM;IAAE6B,UAAU;IAAEC,KAAK;IAAE,GAAGC;EAAK,CAAC,GAAG/B,KAAK;EAC5C,OAAO;IACL,GAAG+B,IAAI;IACPD,KAAK,EAAE;MAAE,GAAGlE,UAAU,CAACoE,OAAO,CAACF,KAAK,CAAC;MAAEG,SAAS,EAAEJ;IAAW;EAC/D,CAAC;AACH","ignoreList":[]}
|
|
@@ -27,8 +27,11 @@ export function usePassthrough(type, {
|
|
|
27
27
|
if (Array.isArray(target)) {
|
|
28
28
|
for (let i = 0; i < target.length - 1; i++) {
|
|
29
29
|
const prop = target[i];
|
|
30
|
-
|
|
31
|
-
targetProps =
|
|
30
|
+
const value = targetProps[prop];
|
|
31
|
+
targetProps[prop] = Array.isArray(value) ? [...value] : {
|
|
32
|
+
...value
|
|
33
|
+
};
|
|
34
|
+
targetProps = targetProps[prop];
|
|
32
35
|
}
|
|
33
36
|
target = target[target.length - 1];
|
|
34
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElement","INLINE_RULE_SYMBOL","cache","Map","usePassthrough","type","props","configs","config","source","target","classNames","styles","get","undefined","targetProps","Array","isArray","i","length","prop"],"sourceRoot":"../../../../src","sources":["native/react/usePassthrough.ts"],"mappings":";;AAAA;AACA,SAASA,aAAa,QAA4B,OAAO;AAEzD,SAASC,kBAAkB,QAAQ,YAAS;AAG5C,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAA8B,CAAC;AAEpD,OAAO,SAASC,cAAcA,CAC5BC,IAAwB,EACxB;EAAE,GAAGC;AAA2B,CAAC,EACjCC,OAAiB,EACjB;EACA,KAAK,MAAMC,MAAM,IAAID,OAAO,EAAE;IAC5B,IAAI;MAAEE,MAAM;MAAEC;IAAO,CAAC,GAAGF,MAAM;IAE/B,MAAMG,UAAU,GAAGL,KAAK,CAACG,MAAM,CAAC;IAEhC,IAAIG,MAAM,GAAGV,KAAK,CAACW,GAAG,CAACJ,MAAM,CAAC;IAC9B,IAAIG,MAAM,KAAKE,SAAS,EAAE;MACxBF,MAAM,GAAG;QAAE,CAACX,kBAAkB,GAAGU;MAAW,CAAC;IAC/C;IAEA,OAAOL,KAAK,CAACG,MAAM,CAAC;IAEpB,IAAIE,UAAU,KAAKG,SAAS,IAAIJ,MAAM,KAAK,KAAK,EAAE;MAChD;IACF;IAEA,IAAIK,WAAW,GAAGT,KAAK;IAEvB,IAAIU,KAAK,CAACC,OAAO,CAACP,MAAM,CAAC,EAAE;MACzB,KAAK,IAAIQ,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGR,MAAM,CAACS,MAAM,GAAG,CAAC,EAAED,CAAC,EAAE,EAAE;QAC1C,MAAME,IAAI,GAAGV,MAAM,CAACQ,CAAC,CAAE;
|
|
1
|
+
{"version":3,"names":["createElement","INLINE_RULE_SYMBOL","cache","Map","usePassthrough","type","props","configs","config","source","target","classNames","styles","get","undefined","targetProps","Array","isArray","i","length","prop","value"],"sourceRoot":"../../../../src","sources":["native/react/usePassthrough.ts"],"mappings":";;AAAA;AACA,SAASA,aAAa,QAA4B,OAAO;AAEzD,SAASC,kBAAkB,QAAQ,YAAS;AAG5C,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAA8B,CAAC;AAEpD,OAAO,SAASC,cAAcA,CAC5BC,IAAwB,EACxB;EAAE,GAAGC;AAA2B,CAAC,EACjCC,OAAiB,EACjB;EACA,KAAK,MAAMC,MAAM,IAAID,OAAO,EAAE;IAC5B,IAAI;MAAEE,MAAM;MAAEC;IAAO,CAAC,GAAGF,MAAM;IAE/B,MAAMG,UAAU,GAAGL,KAAK,CAACG,MAAM,CAAC;IAEhC,IAAIG,MAAM,GAAGV,KAAK,CAACW,GAAG,CAACJ,MAAM,CAAC;IAC9B,IAAIG,MAAM,KAAKE,SAAS,EAAE;MACxBF,MAAM,GAAG;QAAE,CAACX,kBAAkB,GAAGU;MAAW,CAAC;IAC/C;IAEA,OAAOL,KAAK,CAACG,MAAM,CAAC;IAEpB,IAAIE,UAAU,KAAKG,SAAS,IAAIJ,MAAM,KAAK,KAAK,EAAE;MAChD;IACF;IAEA,IAAIK,WAAW,GAAGT,KAAK;IAEvB,IAAIU,KAAK,CAACC,OAAO,CAACP,MAAM,CAAC,EAAE;MACzB,KAAK,IAAIQ,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGR,MAAM,CAACS,MAAM,GAAG,CAAC,EAAED,CAAC,EAAE,EAAE;QAC1C,MAAME,IAAI,GAAGV,MAAM,CAACQ,CAAC,CAAE;QACvB,MAAMG,KAAK,GAAGN,WAAW,CAACK,IAAI,CAAC;QAC/BL,WAAW,CAACK,IAAI,CAAC,GAAGJ,KAAK,CAACC,OAAO,CAACI,KAAK,CAAC,GAAG,CAAC,GAAGA,KAAK,CAAC,GAAG;UAAE,GAAGA;QAAM,CAAC;QACpEN,WAAW,GAAGA,WAAW,CAACK,IAAI,CAAC;MACjC;MACAV,MAAM,GAAGA,MAAM,CAACA,MAAM,CAACS,MAAM,GAAG,CAAC,CAAE;IACrC;IAEA,IAAIH,KAAK,CAACC,OAAO,CAACF,WAAW,CAACL,MAAM,CAAC,CAAC,EAAE;MACtCK,WAAW,CAACL,MAAM,CAAC,GAAG,CAAC,GAAGK,WAAW,CAACL,MAAM,CAAC,EAAEE,MAAM,CAAC;IACxD,CAAC,MAAM,IAAIG,WAAW,CAACL,MAAM,CAAC,EAAE;MAC9BK,WAAW,CAACL,MAAM,CAAC,GAAG,CAACK,WAAW,CAACL,MAAM,CAAC,EAAEE,MAAM,CAAC;IACrD,CAAC,MAAM;MACLG,WAAW,CAACL,MAAM,CAAC,GAAGE,MAAM;IAC9B;EACF;EAEA,oBAAOZ,aAAa,CAACK,IAAI,EAAEC,KAAK,CAAC;AACnC","ignoreList":[]}
|
|
@@ -15,9 +15,10 @@ export function observable(init, equality = Object.is) {
|
|
|
15
15
|
}
|
|
16
16
|
const observers = new Set();
|
|
17
17
|
const effect = {
|
|
18
|
-
observers,
|
|
18
|
+
observers: new Set(),
|
|
19
19
|
run: () => {
|
|
20
20
|
if (!isStatic) {
|
|
21
|
+
cleanupEffect(effect);
|
|
21
22
|
const nextValue = init(getter, lastArg);
|
|
22
23
|
if (equality(value, nextValue)) {
|
|
23
24
|
return;
|
|
@@ -27,13 +28,17 @@ export function observable(init, equality = Object.is) {
|
|
|
27
28
|
notify();
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
|
-
const getter = observable => observable.get(effect);
|
|
31
|
-
function get(
|
|
32
|
-
if (
|
|
33
|
-
observers.
|
|
31
|
+
const getter = observable => observable.get(observers.size > 0 ? effect : undefined);
|
|
32
|
+
function get(subscriber) {
|
|
33
|
+
if (subscriber) {
|
|
34
|
+
if (observers.size === 0 && !isStatic) didInit = false;
|
|
35
|
+
observers.add(subscriber);
|
|
36
|
+
subscriber.observers.add(obs);
|
|
34
37
|
}
|
|
35
38
|
if (!didInit) {
|
|
36
|
-
|
|
39
|
+
cleanupEffect(effect);
|
|
40
|
+
value = init(getter, lastArg);
|
|
41
|
+
didInit = observers.size > 0;
|
|
37
42
|
}
|
|
38
43
|
return value;
|
|
39
44
|
}
|
|
@@ -44,8 +49,9 @@ export function observable(init, equality = Object.is) {
|
|
|
44
49
|
}
|
|
45
50
|
value = arg;
|
|
46
51
|
} else {
|
|
52
|
+
cleanupEffect(effect);
|
|
47
53
|
const nextValue = init(getter, arg);
|
|
48
|
-
didInit =
|
|
54
|
+
didInit = observers.size > 0;
|
|
49
55
|
lastArg = arg;
|
|
50
56
|
if (equality(value, nextValue)) {
|
|
51
57
|
return;
|
|
@@ -68,16 +74,36 @@ export function observable(init, equality = Object.is) {
|
|
|
68
74
|
observers,
|
|
69
75
|
get,
|
|
70
76
|
set,
|
|
71
|
-
run: effect.run
|
|
77
|
+
run: effect.run,
|
|
78
|
+
unsubscribe(subscriber) {
|
|
79
|
+
if (observers.delete(subscriber) && observers.size === 0 && !isStatic) {
|
|
80
|
+
cleanupEffect(effect);
|
|
81
|
+
didInit = false;
|
|
82
|
+
}
|
|
83
|
+
subscriber.observers.delete(obs);
|
|
84
|
+
}
|
|
72
85
|
};
|
|
73
86
|
return obs;
|
|
74
87
|
}
|
|
75
88
|
export function cleanupEffect(effect) {
|
|
76
89
|
if (!effect) return;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
90
|
+
const dependencies = effect.dependencies = Array.from(effect.observers);
|
|
91
|
+
// Snapshot before detaching so computed observables return cached values
|
|
92
|
+
effect.snapshots = dependencies.map(observable => [observable, observable.get()]);
|
|
80
93
|
effect.observers.clear();
|
|
94
|
+
for (const dep of dependencies) {
|
|
95
|
+
dep.unsubscribe(effect);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Whether any of the effect's dependencies changed since cleanupEffect() */
|
|
100
|
+
export function hasChangedDependencies(effect) {
|
|
101
|
+
const snapshots = effect.snapshots;
|
|
102
|
+
if (!snapshots) return false;
|
|
103
|
+
for (const [observable, value] of snapshots) {
|
|
104
|
+
if (!Object.is(observable.get(), value)) return true;
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
81
107
|
}
|
|
82
108
|
|
|
83
109
|
/** Family Helpers ************************************************************/
|
|
@@ -85,16 +111,17 @@ export function cleanupEffect(effect) {
|
|
|
85
111
|
export function family(fn) {
|
|
86
112
|
const map = new Map();
|
|
87
113
|
return Object.assign((key, args) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
map.set(key, value);
|
|
92
|
-
}
|
|
114
|
+
if (map.has(key)) return map.get(key);
|
|
115
|
+
const value = fn(key, args);
|
|
116
|
+
map.set(key, value);
|
|
93
117
|
return value;
|
|
94
118
|
}, {
|
|
95
119
|
delete(key) {
|
|
96
120
|
return map.delete(key);
|
|
97
121
|
},
|
|
122
|
+
size() {
|
|
123
|
+
return map.size;
|
|
124
|
+
},
|
|
98
125
|
clear() {
|
|
99
126
|
return map.clear();
|
|
100
127
|
}
|
|
@@ -103,11 +130,9 @@ export function family(fn) {
|
|
|
103
130
|
export function weakFamily(fn) {
|
|
104
131
|
const map = new WeakMap();
|
|
105
132
|
return Object.assign((key, args) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
map.set(key, value);
|
|
110
|
-
}
|
|
133
|
+
if (map.has(key)) return map.get(key);
|
|
134
|
+
const value = fn(key, args);
|
|
135
|
+
map.set(key, value);
|
|
111
136
|
return value;
|
|
112
137
|
}, {
|
|
113
138
|
has: key => map.has(key)
|
|
@@ -117,6 +142,17 @@ export function weakFamily(fn) {
|
|
|
117
142
|
/********************************* Variables **********************************/
|
|
118
143
|
|
|
119
144
|
export const VAR_SYMBOL = Symbol.for("react-native-css.var");
|
|
145
|
+
// Variable lookup is presence-keyed, so an entry with no value produces no key rather than one that stops the cascade
|
|
146
|
+
export function toVariableRecord(variables) {
|
|
147
|
+
const record = {};
|
|
148
|
+
for (const [name, value] of Object.entries(variables)) {
|
|
149
|
+
if (value !== undefined) {
|
|
150
|
+
record[name.replace(/^--/, "")] = value;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return record;
|
|
154
|
+
}
|
|
155
|
+
|
|
120
156
|
/** Pseudo Classes ************************************************************/
|
|
121
157
|
|
|
122
158
|
export const hoverFamily = weakFamily(() => observable(false));
|
|
@@ -163,7 +199,7 @@ export const containerWidthFamily = weakFamily(key => {
|
|
|
163
199
|
});
|
|
164
200
|
export const containerHeightFamily = weakFamily(key => {
|
|
165
201
|
return observable(read => {
|
|
166
|
-
return read(containerLayoutFamily(key))?.
|
|
202
|
+
return read(containerLayoutFamily(key))?.height || 0;
|
|
167
203
|
});
|
|
168
204
|
});
|
|
169
205
|
//# sourceMappingURL=reactivity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","Appearance","Dimensions","observableBatch","observable","init","equality","Object","is","value","isStatic","didInit","lastArg","observers","Set","effect","run","nextValue","getter","notify","get","
|
|
1
|
+
{"version":3,"names":["createContext","Appearance","Dimensions","observableBatch","observable","init","equality","Object","is","value","isStatic","didInit","lastArg","observers","Set","effect","run","cleanupEffect","nextValue","getter","notify","get","size","undefined","subscriber","add","obs","set","arg","Array","from","forEach","observer","current","unsubscribe","delete","dependencies","snapshots","map","clear","dep","hasChangedDependencies","family","fn","Map","assign","key","args","has","weakFamily","WeakMap","VAR_SYMBOL","Symbol","for","toVariableRecord","variables","record","name","entries","replace","hoverFamily","activeFamily","focusFamily","dimensions","vw","read","width","vh","height","addEventListener","window","colorScheme","getColorScheme","addChangeListener","event","ContainerContext","containerLayoutFamily","x","y","containerWidthFamily","containerHeightFamily"],"sourceRoot":"../../../src","sources":["native/reactivity.ts"],"mappings":";;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,CAAC8B,OAAO,GAAGV,SAAS;AACrC,CAAC,CAAC;;AAEF;;AAEA,OAAO,MAAMgD,WAAW,GAAGnE,UAAU,CACnCH,UAAU,CAACuE,cAAc,CAAC,CAC5B,CAAC;AACDvE,UAAU,CAACwE,iBAAiB,CAAEC,KAAK,IAAKH,WAAW,CAAC5C,GAAG,CAAC+C,KAAK,CAACH,WAAW,CAAC,CAAC;;AAE3E;;AASA,OAAO,MAAMI,gBAAgB,gBAAG3E,aAAa,CAAwB,CAAC,CAAC,CAAC;AAExE,OAAO,MAAM4E,qBAAqB,GAAG3B,UAAU,CAAC,MAAM;EACpD,OAAO7C,UAAU,CAAkB;IACjCyE,CAAC,EAAE,CAAC;IACJC,CAAC,EAAE,CAAC;IACJZ,KAAK,EAAE,CAAC;IACRE,MAAM,EAAE;EACV,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,MAAMW,oBAAoB,GAAG9B,UAAU,CAAEH,GAAG,IAAK;EACtD,OAAO1C,UAAU,CAAE6D,IAAI,IAAK;IAC1B,OAAOA,IAAI,CAACW,qBAAqB,CAAC9B,GAAG,CAAC,CAAC,EAAEoB,KAAK,IAAI,CAAC;EACrD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,MAAMc,qBAAqB,GAAG/B,UAAU,CAAEH,GAAG,IAAK;EACvD,OAAO1C,UAAU,CAAE6D,IAAI,IAAK;IAC1B,OAAOA,IAAI,CAACW,qBAAqB,CAAC9B,GAAG,CAAC,CAAC,EAAEsB,MAAM,IAAI,CAAC;EACtD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,9 +5,21 @@ export const animatedComponentFamily = weakFamily(component => {
|
|
|
5
5
|
if ("displayName" in component && component.displayName?.startsWith("Animated.")) {
|
|
6
6
|
return component;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
|
|
8
|
+
|
|
9
|
+
// Reanimated 4.5 keeps the original component display name. Compare its
|
|
10
|
+
// public built-in components by identity instead of interpreting that name.
|
|
11
|
+
const reanimated =
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
13
|
+
require("react-native-reanimated");
|
|
14
|
+
const animated = reanimated.default;
|
|
15
|
+
if ([animated.View, animated.Text, animated.Image, animated.ScrollView, animated.FlatList].some(value => value === component)) {
|
|
16
|
+
return component;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// This public constructor remains supported for arbitrary components; only
|
|
20
|
+
// its FlatList-specific overload is deprecated by Reanimated.
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
22
|
+
const createAnimatedComponent = reanimated.createAnimatedComponent;
|
|
11
23
|
return createAnimatedComponent(component);
|
|
12
24
|
});
|
|
13
25
|
//# sourceMappingURL=reanimated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["weakFamily","animatedComponentFamily","component","displayName","startsWith","
|
|
1
|
+
{"version":3,"names":["weakFamily","animatedComponentFamily","component","displayName","startsWith","reanimated","require","animated","default","View","Text","Image","ScrollView","FlatList","some","value","createAnimatedComponent"],"sourceRoot":"../../../src","sources":["native/reanimated.ts"],"mappings":";;AAEA,SAASA,UAAU,QAAQ,iBAAc;AAEzC,OAAO,MAAMC,uBAAuB,GAAGD,UAAU,CAC9CE,SAAwB,IAAK;EAC5B,IACE,aAAa,IAAIA,SAAS,IAC1BA,SAAS,CAACC,WAAW,EAAEC,UAAU,CAAC,WAAW,CAAC,EAC9C;IACA,OAAOF,SAAS;EAClB;;EAEA;EACA;EACA,MAAMG,UAAU;EACd;EACAC,OAAO,CAAC,yBAAyB,CAA6C;EAChF,MAAMC,QAAQ,GAAGF,UAAU,CAACG,OAAO;EACnC,IACE,CACED,QAAQ,CAACE,IAAI,EACbF,QAAQ,CAACG,IAAI,EACbH,QAAQ,CAACI,KAAK,EACdJ,QAAQ,CAACK,UAAU,EACnBL,QAAQ,CAACM,QAAQ,CAClB,CAACC,IAAI,CAAEC,KAAK,IAAKA,KAAK,KAAKb,SAAS,CAAC,EACtC;IACA,OAAOA,SAAS;EAClB;;EAEA;EACA;EACA;EACA,MAAMc,uBAAuB,GAAGX,UAAU,CAACW,uBAEzB;EAElB,OAAOA,uBAAuB,CAACd,SAAS,CAAC;AAC3C,CACF,CAAC","ignoreList":[]}
|