react-native-css 0.0.0-nightly.2cfbf16 → 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 +30 -0
- 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 +150 -50
- 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 +32 -13
- package/dist/commonjs/compiler/stylesheet.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/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 +15 -1
- 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 +182 -123
- 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/animation.js +6 -3
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/box-shadow.js +13 -25
- 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 +1 -1
- 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 +151 -51
- 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 +32 -13
- package/dist/module/compiler/stylesheet.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/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 +13 -0
- 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 +182 -123
- 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/animation.js +6 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/box-shadow.js +14 -26
- 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 +1 -1
- 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 -11
- package/dist/typescript/commonjs/src/compiler/stylesheet.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/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/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 -11
- package/dist/typescript/module/src/compiler/stylesheet.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/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 +61 -27
- 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 +216 -69
- 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 +49 -19
- package/src/components/ImageBackground.tsx +2 -6
- package/src/components/KeyboardAvoidingView.tsx +2 -3
- 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 +15 -0
- 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 +208 -144
- package/src/native/styles/resolve.ts +188 -29
- package/src/native/styles/scale-factor.ts +9 -0
- package/src/native/styles/shorthands/animation.ts +8 -2
- package/src/native/styles/shorthands/box-shadow.ts +20 -34
- 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 +6 -11
- 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
|
@@ -54,49 +54,20 @@ function hasNonOverlappingProperties(
|
|
|
54
54
|
return false;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
/**
|
|
58
|
-
* Flattens a style array into a single object when possible, with rightmost values taking precedence.
|
|
59
|
-
* Returns the original array if it contains any non-plain objects, arrays, or CSS variable objects.
|
|
60
|
-
*
|
|
61
|
-
* Note: This function assumes the input array has already been filtered (e.g., by filterCssVariables),
|
|
62
|
-
* so empty arrays should not reach this function. If they do, they will be treated as non-flattenable.
|
|
63
|
-
*
|
|
64
|
-
* @param styleArray - The style array to potentially flatten
|
|
65
|
-
* @returns A single merged object if all items are plain objects, otherwise the original array
|
|
66
|
-
*/
|
|
67
|
-
function flattenStyleArray(styleArray: any[]): any {
|
|
68
|
-
// Check if we can flatten to a single object (all items are plain objects)
|
|
69
|
-
for (const item of styleArray) {
|
|
70
|
-
// Use explicit null check instead of !item to allow falsy values like 0 or false
|
|
71
|
-
if (
|
|
72
|
-
item == null ||
|
|
73
|
-
typeof item !== "object" ||
|
|
74
|
-
Array.isArray(item) ||
|
|
75
|
-
Object.prototype.hasOwnProperty.call(item, VAR_SYMBOL)
|
|
76
|
-
) {
|
|
77
|
-
return styleArray;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Use reduce to avoid spread operator performance issues with large arrays
|
|
82
|
-
return styleArray.reduce((acc, item) => Object.assign(acc, item), {});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
57
|
/**
|
|
86
58
|
* Recursively filters out CSS variable objects (with VAR_SYMBOL) from style values.
|
|
87
59
|
* This prevents CSS variable runtime objects from leaking into React Native component props.
|
|
88
60
|
*
|
|
89
61
|
* @param value - The value to filter (can be any type: object, array, primitive, etc.)
|
|
90
62
|
* @param depth - Internal recursion depth counter to prevent stack overflow (max 100)
|
|
91
|
-
* @returns The
|
|
92
|
-
* should be filtered out (e.g., empty arrays, objects with only VAR_SYMBOL properties)
|
|
63
|
+
* @returns The value with CSS variables removed, or `undefined` if the entire value should be filtered out
|
|
93
64
|
*
|
|
94
65
|
* Filtering behavior:
|
|
95
66
|
* - Objects with VAR_SYMBOL property: returns `undefined` (completely filtered)
|
|
96
|
-
* -
|
|
97
|
-
* -
|
|
98
|
-
* -
|
|
99
|
-
* -
|
|
67
|
+
* - A value holding no CSS variable comes back as the same object, uncopied, so an animated style keeps its identity
|
|
68
|
+
* - A value holding some comes back copied without them, or `undefined` if nothing remains
|
|
69
|
+
* - Class instances (e.g. an Animated.Value) and primitives: returned as-is
|
|
70
|
+
* - A top-level style object with no string keys (`{}`, or only Symbol keys): returns `undefined`
|
|
100
71
|
*
|
|
101
72
|
* @example
|
|
102
73
|
* filterCssVariables({fontSize: 16, color: {[VAR_SYMBOL]: true}}) // {fontSize: 16}
|
|
@@ -105,64 +76,70 @@ function flattenStyleArray(styleArray: any[]): any {
|
|
|
105
76
|
*/
|
|
106
77
|
function filterCssVariables(value: any, depth = 0): any | undefined {
|
|
107
78
|
// Prevent stack overflow on deeply nested structures
|
|
108
|
-
if (depth > 100) {
|
|
109
|
-
return value;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (value === null || value === undefined) {
|
|
79
|
+
if (depth > 100 || typeof value !== "object" || value === null) {
|
|
113
80
|
return value;
|
|
114
81
|
}
|
|
115
82
|
|
|
83
|
+
// Nothing is copied until a CSS variable is found, so an inline style keeps its identity, as an animated style's handle needs
|
|
116
84
|
if (Array.isArray(value)) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
typeof filteredItem === "object" &&
|
|
126
|
-
filteredItem !== null &&
|
|
127
|
-
Object.prototype.hasOwnProperty.call(filteredItem, VAR_SYMBOL)
|
|
128
|
-
)
|
|
129
|
-
) {
|
|
130
|
-
filtered.push(filteredItem);
|
|
85
|
+
let filtered: any[] | undefined;
|
|
86
|
+
for (let index = 0; index < value.length; index++) {
|
|
87
|
+
const item = value[index];
|
|
88
|
+
const kept = filterCssVariables(item, depth + 1);
|
|
89
|
+
// No copy yet: skip unchanged items, then copy them all with the slice once one changes
|
|
90
|
+
if (filtered === undefined) {
|
|
91
|
+
if (kept === item) continue;
|
|
92
|
+
filtered = value.slice(0, index);
|
|
131
93
|
}
|
|
94
|
+
if (kept !== undefined) filtered.push(kept);
|
|
132
95
|
}
|
|
133
|
-
|
|
96
|
+
if (filtered === undefined) return value;
|
|
134
97
|
return filtered.length > 0 ? filtered : undefined;
|
|
135
98
|
}
|
|
136
99
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
100
|
+
// If the object itself has VAR_SYMBOL, filter it out (check own property only)
|
|
101
|
+
if (Object.prototype.hasOwnProperty.call(value, VAR_SYMBOL)) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
142
104
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
105
|
+
// A class instance, such as an Animated.Value, passes as it is: a plain copy detaches it from its animation
|
|
106
|
+
const prototype: unknown = Object.getPrototypeOf(value);
|
|
107
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Object.keys only iterates own string properties, so Symbol properties are left out of a copy
|
|
112
|
+
const keys = Object.keys(value);
|
|
113
|
+
let filtered: Record<string, any> | undefined;
|
|
114
|
+
for (let index = 0; index < keys.length; index++) {
|
|
115
|
+
const key = keys[index] as string;
|
|
116
|
+
const item = value[key];
|
|
117
|
+
const kept = filterCssVariables(item, depth + 1);
|
|
118
|
+
// No copy yet: skip unchanged keys, then copy them all below once one changes
|
|
119
|
+
if (filtered === undefined) {
|
|
120
|
+
if (kept === item) continue;
|
|
121
|
+
// Objects have no slice: copy the unchanged keys before this one, performantly / avoiding allocations
|
|
122
|
+
filtered = {};
|
|
123
|
+
for (let earlier = 0; earlier < index; earlier++) {
|
|
124
|
+
const earlierKey = keys[earlier] as string;
|
|
125
|
+
filtered[earlierKey] = value[earlierKey];
|
|
154
126
|
}
|
|
155
127
|
}
|
|
128
|
+
if (kept !== undefined) filtered[key] = kept;
|
|
129
|
+
}
|
|
156
130
|
|
|
157
|
-
|
|
131
|
+
// A style object with no string keys, such as {}, adds nothing, as before
|
|
132
|
+
if (filtered === undefined) {
|
|
133
|
+
return depth === 0 && keys.length === 0 ? undefined : value;
|
|
158
134
|
}
|
|
159
135
|
|
|
160
|
-
return
|
|
136
|
+
for (const _ in filtered) return filtered;
|
|
137
|
+
return undefined;
|
|
161
138
|
}
|
|
162
139
|
|
|
163
140
|
export const stylesFamily = family(
|
|
164
141
|
(
|
|
165
|
-
hash:
|
|
142
|
+
hash: number,
|
|
166
143
|
rules: Set<StyleRule | InlineVariable | VariableContextValue>,
|
|
167
144
|
) => {
|
|
168
145
|
const sortedRules = Array.from(rules).sort(specificityCompareFn);
|
|
@@ -172,9 +149,10 @@ export const stylesFamily = family(
|
|
|
172
149
|
/**
|
|
173
150
|
* A family is a map, so we need to cleanup the observers when the the hash is no longer used
|
|
174
151
|
*/
|
|
152
|
+
const unsubscribe = obs.unsubscribe;
|
|
175
153
|
return Object.assign(obs, {
|
|
176
|
-
|
|
177
|
-
|
|
154
|
+
unsubscribe: (effect: Effect) => {
|
|
155
|
+
unsubscribe(effect);
|
|
178
156
|
if (obs.observers.size === 0) {
|
|
179
157
|
stylesFamily.delete(hash);
|
|
180
158
|
}
|
|
@@ -186,15 +164,23 @@ export const stylesFamily = family(
|
|
|
186
164
|
export function getStyledProps(
|
|
187
165
|
state: ComponentState,
|
|
188
166
|
inline: Record<string, any> | undefined | null,
|
|
167
|
+
adaptProps: (
|
|
168
|
+
props: Record<string, any> | undefined,
|
|
169
|
+
) => Record<string, any> | undefined = (props) => props,
|
|
189
170
|
) {
|
|
190
171
|
let result: Record<string, any> | undefined;
|
|
191
172
|
|
|
192
173
|
const styledProps = state.stylesObs?.get(state.styleEffect);
|
|
193
174
|
|
|
175
|
+
// Each config merges a complete props object. Preserve its full target path
|
|
176
|
+
// before the next config merges unrelated inline props over that object.
|
|
177
|
+
const computedTargets: { path: string[]; value: unknown }[] = [];
|
|
178
|
+
const consumedSources: string[] = [];
|
|
179
|
+
|
|
194
180
|
for (const config of state.configs) {
|
|
195
181
|
result = deepMergeConfig(
|
|
196
182
|
config,
|
|
197
|
-
nativeStyleMapping(config, styledProps?.normal),
|
|
183
|
+
nativeStyleMapping(config, adaptProps(styledProps?.normal)),
|
|
198
184
|
inline,
|
|
199
185
|
true,
|
|
200
186
|
);
|
|
@@ -203,10 +189,27 @@ export function getStyledProps(
|
|
|
203
189
|
result = deepMergeConfig(
|
|
204
190
|
config,
|
|
205
191
|
result,
|
|
206
|
-
nativeStyleMapping(config, styledProps.important),
|
|
192
|
+
nativeStyleMapping(config, adaptProps(styledProps.important)),
|
|
207
193
|
);
|
|
208
194
|
}
|
|
209
195
|
|
|
196
|
+
if (result && config.target) {
|
|
197
|
+
const path = Array.isArray(config.target)
|
|
198
|
+
? config.target
|
|
199
|
+
: [config.target];
|
|
200
|
+
let target = result;
|
|
201
|
+
for (const key of path.slice(0, -1)) target = target?.[key];
|
|
202
|
+
const key = path[path.length - 1];
|
|
203
|
+
if (target && key && key in target) {
|
|
204
|
+
computedTargets.push({ path, value: target[key] });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Track consumed className sources for cleanup
|
|
209
|
+
if (config.source !== config.target) {
|
|
210
|
+
consumedSources.push(config.source);
|
|
211
|
+
}
|
|
212
|
+
|
|
210
213
|
// Apply the handlers
|
|
211
214
|
if (hoverFamily.has(state.ruleEffectGetter)) {
|
|
212
215
|
result ??= {};
|
|
@@ -265,6 +268,24 @@ export function getStyledProps(
|
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
|
|
271
|
+
// Restore correctly-merged target props that may have been overwritten
|
|
272
|
+
// by later config iterations' Object.assign({}, left, right)
|
|
273
|
+
if (result) {
|
|
274
|
+
for (const { path, value } of computedTargets) {
|
|
275
|
+
let target = result;
|
|
276
|
+
for (const key of path.slice(0, -1)) {
|
|
277
|
+
const existing = target[key];
|
|
278
|
+
target = target[key] = Array.isArray(existing)
|
|
279
|
+
? [...existing]
|
|
280
|
+
: { ...existing };
|
|
281
|
+
}
|
|
282
|
+
target[path[path.length - 1]!] = value;
|
|
283
|
+
}
|
|
284
|
+
for (const source of consumedSources) {
|
|
285
|
+
delete result[source];
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
268
289
|
return result;
|
|
269
290
|
}
|
|
270
291
|
|
|
@@ -312,6 +333,20 @@ function mergeDefinedProps(
|
|
|
312
333
|
return result;
|
|
313
334
|
}
|
|
314
335
|
|
|
336
|
+
type StyleCallback = (state: unknown) => unknown;
|
|
337
|
+
|
|
338
|
+
function isStyleCallback(value: unknown): value is StyleCallback {
|
|
339
|
+
return typeof value === "function";
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Pressable calls a function style with its pressed state, so a merge keeps a callback a callback
|
|
343
|
+
function composeStyleCallback(left: unknown, right: unknown): StyleCallback {
|
|
344
|
+
return (state) => [
|
|
345
|
+
isStyleCallback(left) ? left(state) : left,
|
|
346
|
+
isStyleCallback(right) ? right(state) : right,
|
|
347
|
+
];
|
|
348
|
+
}
|
|
349
|
+
|
|
315
350
|
function deepMergeConfig(
|
|
316
351
|
config: Config,
|
|
317
352
|
left: Record<string, any> | undefined,
|
|
@@ -331,74 +366,31 @@ function deepMergeConfig(
|
|
|
331
366
|
config.target[0] === "style"
|
|
332
367
|
) {
|
|
333
368
|
// Special handling for style target when we have inline styles
|
|
334
|
-
result =
|
|
369
|
+
result = mergeDefinedProps(left, right);
|
|
335
370
|
|
|
336
371
|
// Handle null/undefined inline styles
|
|
337
372
|
if (right?.style === null || right?.style === undefined) {
|
|
338
373
|
if (left?.style) {
|
|
339
374
|
result.style = left.style;
|
|
340
375
|
}
|
|
341
|
-
} else if (rightIsInline && right?.style) {
|
|
342
|
-
// Filter inline styles if rightIsInline is true
|
|
343
|
-
const filteredRightStyle = filterCssVariables(right.style);
|
|
344
|
-
|
|
345
|
-
if (left?.style) {
|
|
346
|
-
if (!filteredRightStyle) {
|
|
347
|
-
// All inline styles were CSS variables, only use left
|
|
348
|
-
result.style = left.style;
|
|
349
|
-
} else {
|
|
350
|
-
const leftStyle = left.style;
|
|
351
|
-
|
|
352
|
-
// For arrays or objects, check if we need to create a style array
|
|
353
|
-
const leftIsObject =
|
|
354
|
-
typeof leftStyle === "object" && !Array.isArray(leftStyle);
|
|
355
|
-
const rightIsObject =
|
|
356
|
-
typeof filteredRightStyle === "object" &&
|
|
357
|
-
!Array.isArray(filteredRightStyle);
|
|
358
|
-
|
|
359
|
-
if (leftIsObject && rightIsObject) {
|
|
360
|
-
if (hasNonOverlappingProperties(leftStyle, filteredRightStyle)) {
|
|
361
|
-
result.style = [leftStyle, filteredRightStyle];
|
|
362
|
-
} else {
|
|
363
|
-
// All left properties are in right, right overrides
|
|
364
|
-
result.style = filteredRightStyle;
|
|
365
|
-
}
|
|
366
|
-
} else {
|
|
367
|
-
// One or both are arrays, merge them
|
|
368
|
-
result.style = [leftStyle, filteredRightStyle];
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
} else {
|
|
372
|
-
// No left style, just use filtered right
|
|
373
|
-
if (filteredRightStyle) {
|
|
374
|
-
result.style = filteredRightStyle;
|
|
375
|
-
} else {
|
|
376
|
-
// All filtered out, remove style prop
|
|
377
|
-
delete result.style;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
376
|
} else if (!rightIsInline && right?.style) {
|
|
381
377
|
// Merging non-inline styles (e.g., important styles)
|
|
382
378
|
if (left?.style) {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const combined = [...left.style, right.style];
|
|
386
|
-
result.style = flattenStyleArray(combined);
|
|
379
|
+
if (isStyleCallback(left.style) || isStyleCallback(right.style)) {
|
|
380
|
+
result.style = composeStyleCallback(left.style, right.style);
|
|
387
381
|
} else if (
|
|
388
382
|
typeof left.style === "object" &&
|
|
389
|
-
|
|
383
|
+
!Array.isArray(left.style) &&
|
|
384
|
+
typeof right.style === "object" &&
|
|
385
|
+
!hasNonOverlappingProperties(left.style, right.style)
|
|
390
386
|
) {
|
|
391
|
-
//
|
|
392
|
-
|
|
393
|
-
result.style = flattenStyleArray([left.style, right.style]);
|
|
394
|
-
} else {
|
|
395
|
-
// All left properties are overridden by right
|
|
396
|
-
result.style = right.style;
|
|
397
|
-
}
|
|
387
|
+
// All left properties are overridden by right
|
|
388
|
+
result.style = right.style;
|
|
398
389
|
} else {
|
|
399
|
-
//
|
|
400
|
-
|
|
401
|
-
|
|
390
|
+
// Layered rather than flattened: a copy would merge an inline animated style's handle into a plain object
|
|
391
|
+
result.style = Array.isArray(left.style)
|
|
392
|
+
? [...left.style, right.style]
|
|
393
|
+
: [left.style, right.style];
|
|
402
394
|
}
|
|
403
395
|
}
|
|
404
396
|
}
|
|
@@ -422,21 +414,75 @@ function deepMergeConfig(
|
|
|
422
414
|
* If target is a path, deep merge until we get to the last key
|
|
423
415
|
*/
|
|
424
416
|
if (Array.isArray(config.target)) {
|
|
425
|
-
|
|
426
|
-
const key = config.target[
|
|
427
|
-
|
|
428
|
-
if (key === undefined) {
|
|
429
|
-
return result;
|
|
430
|
-
}
|
|
431
|
-
|
|
417
|
+
if (config.target.length > 1) {
|
|
418
|
+
const key = config.target[0]!;
|
|
432
419
|
result[key] = deepMergeConfig(
|
|
433
|
-
{ source: config.source, target: config.target.slice(
|
|
420
|
+
{ source: config.source, target: config.target.slice(1) },
|
|
434
421
|
left?.[key],
|
|
435
422
|
right?.[key],
|
|
436
423
|
rightIsInline,
|
|
437
424
|
);
|
|
438
425
|
}
|
|
439
426
|
|
|
427
|
+
// For length-1 array targets (e.g. ["contentContainerStyle"]), the loop
|
|
428
|
+
// above runs 0 iterations. Merge the target prop so inline styles don't
|
|
429
|
+
// silently overwrite className-computed styles (same as string target path).
|
|
430
|
+
const finalKey = config.target[config.target.length - 1];
|
|
431
|
+
if (config.target.length === 1 && finalKey && rightIsInline) {
|
|
432
|
+
let rightValue = right?.[finalKey];
|
|
433
|
+
if (rightValue !== undefined) {
|
|
434
|
+
rightValue = filterCssVariables(rightValue);
|
|
435
|
+
}
|
|
436
|
+
if (rightValue === undefined || rightValue === null) {
|
|
437
|
+
// Inline is empty or fully filtered — preserve className-computed value
|
|
438
|
+
if (left && finalKey in left) {
|
|
439
|
+
result[finalKey] = left[finalKey];
|
|
440
|
+
} else {
|
|
441
|
+
// No left value either — remove unfiltered inline value from result
|
|
442
|
+
delete result[finalKey];
|
|
443
|
+
}
|
|
444
|
+
} else if (left && finalKey in left) {
|
|
445
|
+
const leftValue = left[finalKey];
|
|
446
|
+
const leftIsObj =
|
|
447
|
+
typeof leftValue === "object" &&
|
|
448
|
+
leftValue !== null &&
|
|
449
|
+
!Array.isArray(leftValue);
|
|
450
|
+
const rightIsObj =
|
|
451
|
+
typeof rightValue === "object" &&
|
|
452
|
+
rightValue !== null &&
|
|
453
|
+
!Array.isArray(rightValue);
|
|
454
|
+
if (isStyleCallback(leftValue) || isStyleCallback(rightValue)) {
|
|
455
|
+
result[finalKey] = composeStyleCallback(leftValue, rightValue);
|
|
456
|
+
} else if (leftIsObj && rightIsObj) {
|
|
457
|
+
if (hasNonOverlappingProperties(leftValue, rightValue)) {
|
|
458
|
+
result[finalKey] = [leftValue, rightValue];
|
|
459
|
+
} else {
|
|
460
|
+
// All left keys are in right — use filtered right value
|
|
461
|
+
result[finalKey] = rightValue;
|
|
462
|
+
}
|
|
463
|
+
} else {
|
|
464
|
+
result[finalKey] = [leftValue, rightValue];
|
|
465
|
+
}
|
|
466
|
+
} else {
|
|
467
|
+
// No left value — use filtered right value (not the unfiltered one from mergeDefinedProps)
|
|
468
|
+
result[finalKey] = rightValue;
|
|
469
|
+
}
|
|
470
|
+
} else if (
|
|
471
|
+
config.target.length === 1 &&
|
|
472
|
+
finalKey &&
|
|
473
|
+
finalKey !== "style" &&
|
|
474
|
+
left?.[finalKey] !== undefined &&
|
|
475
|
+
right[finalKey] !== undefined
|
|
476
|
+
) {
|
|
477
|
+
// An !important value layers over the class's and the inline value rather than replacing both
|
|
478
|
+
const leftValue = left[finalKey];
|
|
479
|
+
const rightValue = right[finalKey];
|
|
480
|
+
result[finalKey] =
|
|
481
|
+
isStyleCallback(leftValue) || isStyleCallback(rightValue)
|
|
482
|
+
? composeStyleCallback(leftValue, rightValue)
|
|
483
|
+
: [leftValue, rightValue];
|
|
484
|
+
}
|
|
485
|
+
|
|
440
486
|
return result;
|
|
441
487
|
}
|
|
442
488
|
|
|
@@ -453,9 +499,22 @@ function deepMergeConfig(
|
|
|
453
499
|
rightValue = filterCssVariables(rightValue);
|
|
454
500
|
}
|
|
455
501
|
|
|
456
|
-
if (rightValue
|
|
457
|
-
|
|
458
|
-
|
|
502
|
+
if (rightValue === undefined && rightIsInline && target in right) {
|
|
503
|
+
// An inline value that held only CSS variables leaves the class's, and never reaches the component itself
|
|
504
|
+
if (left && target in left) {
|
|
505
|
+
result[target] = left[target];
|
|
506
|
+
} else {
|
|
507
|
+
delete result[target];
|
|
508
|
+
}
|
|
509
|
+
} else if (rightValue !== undefined) {
|
|
510
|
+
if (left && target in left) {
|
|
511
|
+
result[target] =
|
|
512
|
+
isStyleCallback(left[target]) || isStyleCallback(rightValue)
|
|
513
|
+
? composeStyleCallback(left[target], rightValue)
|
|
514
|
+
: [left[target], rightValue];
|
|
515
|
+
} else {
|
|
516
|
+
result[target] = rightValue;
|
|
517
|
+
}
|
|
459
518
|
}
|
|
460
519
|
|
|
461
520
|
return result;
|
|
@@ -465,7 +524,11 @@ function nativeStyleMapping(
|
|
|
465
524
|
config: Config,
|
|
466
525
|
props: Record<string, any> | undefined,
|
|
467
526
|
) {
|
|
468
|
-
if (!
|
|
527
|
+
if (!props) {
|
|
528
|
+
return props;
|
|
529
|
+
}
|
|
530
|
+
if (!config.nativeStyleMapping) {
|
|
531
|
+
if (config.target === false) delete props.style;
|
|
469
532
|
return props;
|
|
470
533
|
}
|
|
471
534
|
|
|
@@ -514,5 +577,6 @@ function nativeStyleMapping(
|
|
|
514
577
|
target[lastToken!] = styleValue;
|
|
515
578
|
}
|
|
516
579
|
|
|
580
|
+
if (config.target === false) delete props.style;
|
|
517
581
|
return props;
|
|
518
582
|
}
|