react-native-css 3.0.7 → 3.1.0-rc.1
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/CHANGELOG.md +21 -0
- package/README.md +24 -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 +44 -28
- 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 +103 -62
- package/dist/commonjs/compiler/declarations.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 +15 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +11 -3
- 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 +46 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/jest/index.js +1 -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 +13 -9
- package/dist/commonjs/native/api.js.map +1 -1
- package/dist/commonjs/native/conditions/attributes.js +16 -9
- package/dist/commonjs/native/conditions/attributes.js.map +1 -1
- package/dist/commonjs/native/conditions/container-query.js +11 -11
- package/dist/commonjs/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/native/conditions/media-query.js +1 -1
- package/dist/commonjs/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/native/react/interaction.js +10 -5
- package/dist/commonjs/native/react/interaction.js.map +1 -1
- package/dist/commonjs/native/react/rules.js +12 -5
- package/dist/commonjs/native/react/rules.js.map +1 -1
- package/dist/commonjs/native/react/useNativeCss.js +60 -11
- 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 +61 -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/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 +14 -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/string-functions.js +16 -1
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +5 -4
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +95 -12
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +10 -6
- package/dist/commonjs/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/native/styles/scale-factor.js +13 -0
- package/dist/commonjs/native/styles/scale-factor.js.map +1 -0
- package/dist/commonjs/native/styles/shorthands/animation.js +6 -3
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/index.js +11 -0
- package/dist/commonjs/native/styles/shorthands/index.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js +22 -0
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/commonjs/native/styles/variables.js +55 -43
- package/dist/commonjs/native/styles/variables.js.map +1 -1
- package/dist/commonjs/native-internal/root.js +18 -7
- package/dist/commonjs/native-internal/root.js.map +1 -1
- package/dist/commonjs/native-internal/style-collection.js +1 -1
- package/dist/commonjs/native-internal/style-collection.js.map +1 -1
- package/dist/commonjs/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/style-descriptor.js +4 -9
- 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 +45 -29
- 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 +103 -62
- package/dist/module/compiler/declarations.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 +15 -4
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +11 -3
- 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 +46 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/jest/index.js +1 -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 +15 -11
- package/dist/module/native/api.js.map +1 -1
- package/dist/module/native/conditions/attributes.js +16 -9
- package/dist/module/native/conditions/attributes.js.map +1 -1
- package/dist/module/native/conditions/container-query.js +11 -11
- package/dist/module/native/conditions/container-query.js.map +1 -1
- package/dist/module/native/conditions/media-query.js +1 -1
- package/dist/module/native/conditions/media-query.js.map +1 -1
- package/dist/module/native/react/interaction.js +10 -5
- package/dist/module/native/react/interaction.js.map +1 -1
- package/dist/module/native/react/rules.js +13 -6
- package/dist/module/native/react/rules.js.map +1 -1
- package/dist/module/native/react/useNativeCss.js +63 -14
- 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 +55 -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/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 +12 -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/string-functions.js +13 -0
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +5 -4
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +95 -12
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +10 -6
- package/dist/module/native/styles/resolve.js.map +1 -1
- package/dist/module/native/styles/scale-factor.js +9 -0
- package/dist/module/native/styles/scale-factor.js.map +1 -0
- package/dist/module/native/styles/shorthands/animation.js +6 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/index.js +1 -0
- package/dist/module/native/styles/shorthands/index.js.map +1 -1
- package/dist/module/native/styles/shorthands/logical-border-width.js +18 -0
- package/dist/module/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/module/native/styles/variables.js +55 -43
- package/dist/module/native/styles/variables.js.map +1 -1
- package/dist/module/native-internal/root.js +18 -7
- package/dist/module/native-internal/root.js.map +1 -1
- package/dist/module/native-internal/style-collection.js +1 -1
- package/dist/module/native-internal/style-collection.js.map +1 -1
- package/dist/module/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/style-descriptor.js +4 -9
- 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 +6 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +2 -2
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/lightningcss-loader.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +6 -8
- 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 +1 -1
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +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 +4 -8
- 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/react/interaction.d.ts +1 -1
- package/dist/typescript/commonjs/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/react/useNativeCss.d.ts.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 +14 -3
- package/dist/typescript/commonjs/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.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/string-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native-internal/root.d.ts +12 -0
- package/dist/typescript/commonjs/src/native-internal/root.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/style-descriptor.d.ts +1 -1
- package/dist/typescript/commonjs/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/api.d.ts +5 -5
- package/dist/typescript/commonjs/src/web/api.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/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 +7 -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 -4
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/index.d.ts +2 -2
- package/dist/typescript/module/src/compiler/index.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/inline-variables.d.ts +1 -1
- package/dist/typescript/module/src/compiler/inline-variables.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/keyframes.d.ts +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 +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selectors.d.ts +2 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +6 -8
- 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 +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +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 +5 -9
- package/dist/typescript/module/src/native/api.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/attributes.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/container-query.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/module/src/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/index.d.ts +3 -3
- package/dist/typescript/module/src/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts +1 -1
- package/dist/typescript/module/src/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/native/index.d.ts +3 -3
- package/dist/typescript/module/src/native/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/rules.d.ts +2 -2
- package/dist/typescript/module/src/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/native/react/useNativeCss.d.ts +4 -4
- 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 +14 -3
- package/dist/typescript/module/src/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/native/reanimated.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts +2 -2
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +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 +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/index.d.ts +7 -7
- package/dist/typescript/module/src/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/line-height.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/resolve.d.ts +4 -3
- package/dist/typescript/module/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/module/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/shorthands/animation.d.ts +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 +2 -2
- package/dist/typescript/module/src/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/index.d.ts +3 -3
- package/dist/typescript/module/src/native-internal/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/root.d.ts +13 -1
- package/dist/typescript/module/src/native-internal/root.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/style-collection.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/style-collection.d.ts.map +1 -1
- package/dist/typescript/module/src/native-internal/variables.d.ts +2 -2
- package/dist/typescript/module/src/native-internal/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.d.ts +1 -1
- package/dist/typescript/module/src/runtime.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts +1 -1
- package/dist/typescript/module/src/runtime.native.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime.types.d.ts +11 -6
- package/dist/typescript/module/src/runtime.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts +2 -1
- package/dist/typescript/module/src/utilities/dot-notation.types.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/index.d.ts +3 -3
- package/dist/typescript/module/src/utilities/index.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/specificity.d.ts +2 -2
- package/dist/typescript/module/src/utilities/specificity.d.ts.map +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts +1 -1
- package/dist/typescript/module/src/utilities/style-descriptor.d.ts.map +1 -1
- package/dist/typescript/module/src/web/api.d.ts +5 -5
- package/dist/typescript/module/src/web/api.d.ts.map +1 -1
- package/dist/typescript/module/src/web/assign-style.d.ts.map +1 -1
- package/dist/typescript/module/src/web/index.d.ts +3 -3
- package/dist/typescript/module/src/web/index.d.ts.map +1 -1
- package/node/babel.mjs +4 -0
- package/node/compiler.mjs +2 -0
- package/node/metro.mjs +2 -0
- package/package.json +63 -28
- 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 +78 -47
- package/src/compiler/compiler.types.ts +9 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +190 -101
- package/src/compiler/lightningcss-loader.ts +16 -15
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +31 -4
- package/src/compiler/stylesheet.ts +17 -10
- package/src/components/ImageBackground.tsx +2 -6
- package/src/components/KeyboardAvoidingView.tsx +2 -3
- package/src/components/index.cts +46 -1
- package/src/jest/index.ts +1 -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 +22 -17
- package/src/native/conditions/attributes.ts +26 -9
- package/src/native/conditions/container-query.ts +11 -9
- package/src/native/conditions/media-query.ts +1 -1
- package/src/native/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +13 -5
- package/src/native/react/useNativeCss.ts +69 -14
- package/src/native/react/usePassthrough.ts +3 -2
- package/src/native/reactivity.ts +76 -24
- package/src/native/reanimated.ts +24 -5
- package/src/native/styles/functions/color-mix.ts +45 -39
- package/src/native/styles/functions/filters.ts +14 -0
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/string-functions.ts +18 -0
- package/src/native/styles/functions/transform-functions.ts +5 -4
- package/src/native/styles/index.ts +100 -13
- package/src/native/styles/resolve.ts +15 -11
- package/src/native/styles/scale-factor.ts +6 -0
- package/src/native/styles/shorthands/animation.ts +8 -2
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/variables.ts +48 -38
- package/src/native-internal/root.ts +40 -13
- package/src/native-internal/style-collection.ts +1 -1
- 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/style-descriptor.ts +11 -16
- 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
|
@@ -25,9 +25,6 @@ function useNativeCss(type, originalProps, configs = [{
|
|
|
25
25
|
const inheritedVariables = (0, _react.useContext)(_nativeInternal.VariableContext);
|
|
26
26
|
const inheritedContainers = (0, _react.useContext)(_reactivity.ContainerContext);
|
|
27
27
|
const [state, setState] = (0, _react.useState)(() => {
|
|
28
|
-
// Both effects share the same observers to improve memory usage
|
|
29
|
-
const observers = new Set();
|
|
30
|
-
|
|
31
28
|
/**
|
|
32
29
|
* When fired, this effect will force the rules to be re-evaluated.
|
|
33
30
|
* This will cause a re-render if there are different rules
|
|
@@ -35,7 +32,7 @@ function useNativeCss(type, originalProps, configs = [{
|
|
|
35
32
|
* Use this when a rule condition changes, e.g FastRefresh or media queries
|
|
36
33
|
*/
|
|
37
34
|
const ruleEffect = {
|
|
38
|
-
observers,
|
|
35
|
+
observers: new Set(),
|
|
39
36
|
run: () => setState(state => (0, _rules.updateRules)(state))
|
|
40
37
|
};
|
|
41
38
|
|
|
@@ -46,12 +43,12 @@ function useNativeCss(type, originalProps, configs = [{
|
|
|
46
43
|
* Use this when a value changes, e.g vm units or light / dark mode
|
|
47
44
|
*/
|
|
48
45
|
const styleEffect = {
|
|
49
|
-
observers,
|
|
46
|
+
observers: new Set(),
|
|
50
47
|
run: () => setState(state => ({
|
|
51
48
|
...state
|
|
52
49
|
}))
|
|
53
50
|
};
|
|
54
|
-
|
|
51
|
+
const initialState = (0, _rules.updateRules)({
|
|
55
52
|
ruleEffect,
|
|
56
53
|
ruleEffectGetter: observable => observable.get(ruleEffect),
|
|
57
54
|
styleEffect,
|
|
@@ -60,10 +57,35 @@ function useNativeCss(type, originalProps, configs = [{
|
|
|
60
57
|
inheritedVariables,
|
|
61
58
|
pressable: type === _reactNative.View ? false : undefined
|
|
62
59
|
}, originalProps, inheritedVariables, inheritedContainers, false, false);
|
|
60
|
+
// State initializers may be discarded by React StrictMode. Subscribe once
|
|
61
|
+
// the component commits instead of retaining an abandoned initializer.
|
|
62
|
+
(0, _reactivity.cleanupEffect)(ruleEffect);
|
|
63
|
+
return initialState;
|
|
63
64
|
});
|
|
64
65
|
|
|
65
|
-
//
|
|
66
|
-
|
|
66
|
+
// Distinguishes a fresh mount from an effect replay (Activity, StrictMode)
|
|
67
|
+
const hasCommittedRef = (0, _react.useRef)(false);
|
|
68
|
+
(0, _react.useEffect)(() => {
|
|
69
|
+
// Reconnect subscriptions after React replays an effect setup.
|
|
70
|
+
if (state.ruleEffect.observers.size === 0) {
|
|
71
|
+
if (hasCommittedRef.current || (0, _reactivity.hasChangedDependencies)(state.ruleEffect)) {
|
|
72
|
+
// Replay, or conditions changed since the initializer: recalculate.
|
|
73
|
+
state.ruleEffect.run();
|
|
74
|
+
state.styleEffect.run();
|
|
75
|
+
} else {
|
|
76
|
+
// Fresh mount: resubscribe to the initializer's dependencies.
|
|
77
|
+
// styleEffect resubscribes itself during render.
|
|
78
|
+
for (const observable of state.ruleEffect.dependencies ?? []) {
|
|
79
|
+
observable.get(state.ruleEffect);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
hasCommittedRef.current = true;
|
|
84
|
+
return () => {
|
|
85
|
+
(0, _reactivity.cleanupEffect)(state.ruleEffect);
|
|
86
|
+
(0, _reactivity.cleanupEffect)(state.styleEffect);
|
|
87
|
+
};
|
|
88
|
+
}, [state.ruleEffect, state.styleEffect]);
|
|
67
89
|
|
|
68
90
|
// Check if our derived state has changed (e.g the className prop)
|
|
69
91
|
if ((0, _guards.testGuards)(state, originalProps, inheritedVariables, inheritedContainers)) {
|
|
@@ -76,7 +98,7 @@ function useNativeCss(type, originalProps, configs = [{
|
|
|
76
98
|
// We can bail on rendering as the result of this render will be discarded
|
|
77
99
|
return /*#__PURE__*/(0, _react.createElement)(_react.Fragment);
|
|
78
100
|
}
|
|
79
|
-
let props = (0, _index.getStyledProps)(state, originalProps);
|
|
101
|
+
let props = (0, _index.getStyledProps)(state, originalProps, type === _reactNative.Image ? adaptImageProps : undefined);
|
|
80
102
|
if (type === _reactNative.View && props?.onPress) {
|
|
81
103
|
type = _reactNative.Pressable;
|
|
82
104
|
}
|
|
@@ -91,8 +113,14 @@ function useNativeCss(type, originalProps, configs = [{
|
|
|
91
113
|
type = _nativeInternal.VariableContext.Provider;
|
|
92
114
|
}
|
|
93
115
|
if (state.containers) {
|
|
116
|
+
// Publish a new props snapshot even when this component's own rules did not
|
|
117
|
+
// change. Descendants can depend on an ancestor attribute through a group.
|
|
118
|
+
const containers = Object.fromEntries(Object.entries(state.containers).map(([name, container]) => [name, container.key === state.ruleEffectGetter ? {
|
|
119
|
+
key: container.key,
|
|
120
|
+
props: originalProps
|
|
121
|
+
} : inheritedContainers[name] ?? container]));
|
|
94
122
|
props = {
|
|
95
|
-
value:
|
|
123
|
+
value: containers,
|
|
96
124
|
children: /*#__PURE__*/(0, _react.createElement)(type, props)
|
|
97
125
|
};
|
|
98
126
|
type = _reactivity.ContainerContext.Provider;
|
|
@@ -121,7 +149,10 @@ function mappingToConfig(mapping) {
|
|
|
121
149
|
target: value.split(".")
|
|
122
150
|
};
|
|
123
151
|
} else if (typeof value === "object") {
|
|
124
|
-
|
|
152
|
+
// Keep the declared deprecated alias working. The current spelling wins
|
|
153
|
+
// when both are provided, including an intentionally empty mapping.
|
|
154
|
+
const mapping = value.nativeStyleMapping ?? value.nativeStyleToProp;
|
|
155
|
+
const nativeStyleMapping = mapping ? Object.fromEntries(Object.entries(mapping).map(([k, v]) => [k, v === true ? k : v])) : undefined;
|
|
125
156
|
if (Array.isArray(value)) {
|
|
126
157
|
return {
|
|
127
158
|
source: key,
|
|
@@ -163,4 +194,22 @@ function mappingToConfig(mapping) {
|
|
|
163
194
|
throw new Error(`styled(): Invalid mapping for ${key}: ${value}`);
|
|
164
195
|
});
|
|
165
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
|
+
..._reactNative.StyleSheet.flatten(style),
|
|
211
|
+
objectFit: contentFit
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
166
215
|
//# sourceMappingURL=useNativeCss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_nativeInternal","_guards","_reactivity","_reanimated","_index","_rules","useNativeCss","type","originalProps","configs","source","target","inheritedVariables","useContext","VariableContext","inheritedContainers","ContainerContext","state","setState","useState","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_nativeInternal","_guards","_reactivity","_reanimated","_index","_rules","useNativeCss","type","originalProps","configs","source","target","inheritedVariables","useContext","VariableContext","inheritedContainers","ContainerContext","state","setState","useState","ruleEffect","observers","Set","run","updateRules","styleEffect","initialState","ruleEffectGetter","observable","get","pressable","View","undefined","cleanupEffect","hasCommittedRef","useRef","useEffect","size","current","hasChangedDependencies","dependencies","testGuards","createElement","Fragment","props","getStyledProps","Image","adaptImageProps","onPress","Pressable","animated","animatedComponentFamily","variables","value","children","Provider","containers","Object","fromEntries","entries","map","name","container","key","mappingToConfig","mapping","flatMap","split","nativeStyleMapping","nativeStyleToProp","k","v","Array","isArray","length","Error","contentFit","style","rest","StyleSheet","flatten","objectFit"],"sourceRoot":"../../../../src","sources":["native/react/useNativeCss.ts"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAGA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AA3BA;;AA6DA;AACA;AACA;AACO,SAASQ,YAAYA,CAC1BC,IAAwB,EACxBC,aAAqD,EACrDC,OAAiB,GAAG,CAAC;EAAEC,MAAM,EAAE,WAAW;EAAEC,MAAM,EAAE;AAAQ,CAAC,CAAC,EAC9D;EACA,MAAMC,kBAAkB,GAAG,IAAAC,iBAAU,EAACC,+BAAe,CAAC;EACtD,MAAMC,mBAAmB,GAAG,IAAAF,iBAAU,EAACG,4BAAgB,CAAC;EAExD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAC,MAAsB;IACvD;AACJ;AACA;AACA;AACA;AACA;IACI,MAAMC,UAAkB,GAAG;MACzBC,SAAS,EAAE,IAAIC,G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C1C,MAAM;YAAEyD;UAAmB,CAAC;QAClE;MACF;IACF;IAEA,MAAM,IAAIO,KAAK,CAAC,iCAAiCZ,GAAG,KAAKV,KAAK,EAAE,CAAC;EACnE,CAAC,CAAC;AACJ;;AAEA;AACA;AACA,SAASN,eAAeA,CAACH,KAAsC,EAAE;EAC/D,IAAI,CAACA,KAAK,IAAI,EAAE,YAAY,IAAIA,KAAK,CAAC,EAAE,OAAOA,KAAK;EACpD,MAAM;IAAEgC,UAAU;IAAEC,KAAK;IAAE,GAAGC;EAAK,CAAC,GAAGlC,KAAK;EAC5C,OAAO;IACL,GAAGkC,IAAI;IACPD,KAAK,EAAE;MAAE,GAAGE,uBAAU,CAACC,OAAO,CAACH,KAAK,CAAC;MAAEI,SAAS,EAAEL;IAAW;EAC/D,CAAC;AACH","ignoreList":[]}
|
|
@@ -32,8 +32,11 @@ function usePassthrough(type, {
|
|
|
32
32
|
if (Array.isArray(target)) {
|
|
33
33
|
for (let i = 0; i < target.length - 1; i++) {
|
|
34
34
|
const prop = target[i];
|
|
35
|
-
|
|
36
|
-
targetProps =
|
|
35
|
+
const value = targetProps[prop];
|
|
36
|
+
targetProps[prop] = Array.isArray(value) ? [...value] : {
|
|
37
|
+
...value
|
|
38
|
+
};
|
|
39
|
+
targetProps = targetProps[prop];
|
|
37
40
|
}
|
|
38
41
|
target = target[target.length - 1];
|
|
39
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_rules","cache","Map","usePassthrough","type","props","configs","config","source","target","classNames","styles","get","undefined","INLINE_RULE_SYMBOL","targetProps","Array","isArray","i","length","prop","createElement"],"sourceRoot":"../../../../src","sources":["native/react/usePassthrough.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAHA;;AAMA,MAAME,KAAK,GAAG,IAAIC,GAAG,CAA8B,CAAC;AAE7C,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,CAACG,yBAAkB,GAAGJ;MAAW,CAAC;IAC/C;IAEA,OAAOL,KAAK,CAACG,MAAM,CAAC;IAEpB,IAAIE,UAAU,KAAKG,SAAS,IAAIJ,MAAM,KAAK,KAAK,EAAE;MAChD;IACF;IAEA,IAAIM,WAAW,GAAGV,KAAK;IAEvB,IAAIW,KAAK,CAACC,OAAO,CAACR,MAAM,CAAC,EAAE;MACzB,KAAK,IAAIS,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGT,MAAM,CAACU,MAAM,GAAG,CAAC,EAAED,CAAC,EAAE,EAAE;QAC1C,MAAME,IAAI,GAAGX,MAAM,CAACS,CAAC,CAAE;
|
|
1
|
+
{"version":3,"names":["_react","require","_rules","cache","Map","usePassthrough","type","props","configs","config","source","target","classNames","styles","get","undefined","INLINE_RULE_SYMBOL","targetProps","Array","isArray","i","length","prop","value","createElement"],"sourceRoot":"../../../../src","sources":["native/react/usePassthrough.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAHA;;AAMA,MAAME,KAAK,GAAG,IAAIC,GAAG,CAA8B,CAAC;AAE7C,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,MA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M;MACLI,WAAW,CAACN,MAAM,CAAC,GAAGE,MAAM;IAC9B;EACF;EAEA,oBAAO,IAAAW,oBAAa,EAAClB,IAAI,EAAEC,KAAK,CAAC;AACnC","ignoreList":[]}
|
|
@@ -7,9 +7,13 @@ exports.activeFamily = exports.VAR_SYMBOL = exports.ContainerContext = void 0;
|
|
|
7
7
|
exports.cleanupEffect = cleanupEffect;
|
|
8
8
|
exports.dimensions = exports.containerWidthFamily = exports.containerLayoutFamily = exports.containerHeightFamily = exports.colorScheme = void 0;
|
|
9
9
|
exports.family = family;
|
|
10
|
-
exports.
|
|
10
|
+
exports.focusFamily = void 0;
|
|
11
|
+
exports.hasChangedDependencies = hasChangedDependencies;
|
|
12
|
+
exports.hoverFamily = void 0;
|
|
11
13
|
exports.observable = observable;
|
|
12
|
-
exports.
|
|
14
|
+
exports.observableBatch = void 0;
|
|
15
|
+
exports.toVariableRecord = toVariableRecord;
|
|
16
|
+
exports.vw = exports.vh = void 0;
|
|
13
17
|
exports.weakFamily = weakFamily;
|
|
14
18
|
var _react = require("react");
|
|
15
19
|
var _reactNative = require("react-native");
|
|
@@ -27,9 +31,10 @@ function observable(init, equality = Object.is) {
|
|
|
27
31
|
}
|
|
28
32
|
const observers = new Set();
|
|
29
33
|
const effect = {
|
|
30
|
-
observers,
|
|
34
|
+
observers: new Set(),
|
|
31
35
|
run: () => {
|
|
32
36
|
if (!isStatic) {
|
|
37
|
+
cleanupEffect(effect);
|
|
33
38
|
const nextValue = init(getter, lastArg);
|
|
34
39
|
if (equality(value, nextValue)) {
|
|
35
40
|
return;
|
|
@@ -39,13 +44,17 @@ function observable(init, equality = Object.is) {
|
|
|
39
44
|
notify();
|
|
40
45
|
}
|
|
41
46
|
};
|
|
42
|
-
const getter = observable => observable.get(effect);
|
|
43
|
-
function get(
|
|
44
|
-
if (
|
|
45
|
-
observers.
|
|
47
|
+
const getter = observable => observable.get(observers.size > 0 ? effect : undefined);
|
|
48
|
+
function get(subscriber) {
|
|
49
|
+
if (subscriber) {
|
|
50
|
+
if (observers.size === 0 && !isStatic) didInit = false;
|
|
51
|
+
observers.add(subscriber);
|
|
52
|
+
subscriber.observers.add(obs);
|
|
46
53
|
}
|
|
47
54
|
if (!didInit) {
|
|
48
|
-
|
|
55
|
+
cleanupEffect(effect);
|
|
56
|
+
value = init(getter, lastArg);
|
|
57
|
+
didInit = observers.size > 0;
|
|
49
58
|
}
|
|
50
59
|
return value;
|
|
51
60
|
}
|
|
@@ -56,8 +65,9 @@ function observable(init, equality = Object.is) {
|
|
|
56
65
|
}
|
|
57
66
|
value = arg;
|
|
58
67
|
} else {
|
|
68
|
+
cleanupEffect(effect);
|
|
59
69
|
const nextValue = init(getter, arg);
|
|
60
|
-
didInit =
|
|
70
|
+
didInit = observers.size > 0;
|
|
61
71
|
lastArg = arg;
|
|
62
72
|
if (equality(value, nextValue)) {
|
|
63
73
|
return;
|
|
@@ -80,16 +90,36 @@ function observable(init, equality = Object.is) {
|
|
|
80
90
|
observers,
|
|
81
91
|
get,
|
|
82
92
|
set,
|
|
83
|
-
run: effect.run
|
|
93
|
+
run: effect.run,
|
|
94
|
+
unsubscribe(subscriber) {
|
|
95
|
+
if (observers.delete(subscriber) && observers.size === 0 && !isStatic) {
|
|
96
|
+
cleanupEffect(effect);
|
|
97
|
+
didInit = false;
|
|
98
|
+
}
|
|
99
|
+
subscriber.observers.delete(obs);
|
|
100
|
+
}
|
|
84
101
|
};
|
|
85
102
|
return obs;
|
|
86
103
|
}
|
|
87
104
|
function cleanupEffect(effect) {
|
|
88
105
|
if (!effect) return;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
106
|
+
const dependencies = effect.dependencies = Array.from(effect.observers);
|
|
107
|
+
// Snapshot before detaching so computed observables return cached values
|
|
108
|
+
effect.snapshots = dependencies.map(observable => [observable, observable.get()]);
|
|
92
109
|
effect.observers.clear();
|
|
110
|
+
for (const dep of dependencies) {
|
|
111
|
+
dep.unsubscribe(effect);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Whether any of the effect's dependencies changed since cleanupEffect() */
|
|
116
|
+
function hasChangedDependencies(effect) {
|
|
117
|
+
const snapshots = effect.snapshots;
|
|
118
|
+
if (!snapshots) return false;
|
|
119
|
+
for (const [observable, value] of snapshots) {
|
|
120
|
+
if (!Object.is(observable.get(), value)) return true;
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
93
123
|
}
|
|
94
124
|
|
|
95
125
|
/** Family Helpers ************************************************************/
|
|
@@ -97,11 +127,9 @@ function cleanupEffect(effect) {
|
|
|
97
127
|
function family(fn) {
|
|
98
128
|
const map = new Map();
|
|
99
129
|
return Object.assign((key, args) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
map.set(key, value);
|
|
104
|
-
}
|
|
130
|
+
if (map.has(key)) return map.get(key);
|
|
131
|
+
const value = fn(key, args);
|
|
132
|
+
map.set(key, value);
|
|
105
133
|
return value;
|
|
106
134
|
}, {
|
|
107
135
|
delete(key) {
|
|
@@ -115,11 +143,9 @@ function family(fn) {
|
|
|
115
143
|
function weakFamily(fn) {
|
|
116
144
|
const map = new WeakMap();
|
|
117
145
|
return Object.assign((key, args) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
map.set(key, value);
|
|
122
|
-
}
|
|
146
|
+
if (map.has(key)) return map.get(key);
|
|
147
|
+
const value = fn(key, args);
|
|
148
|
+
map.set(key, value);
|
|
123
149
|
return value;
|
|
124
150
|
}, {
|
|
125
151
|
has: key => map.has(key)
|
|
@@ -129,6 +155,17 @@ function weakFamily(fn) {
|
|
|
129
155
|
/********************************* Variables **********************************/
|
|
130
156
|
|
|
131
157
|
const VAR_SYMBOL = exports.VAR_SYMBOL = Symbol.for("react-native-css.var");
|
|
158
|
+
// Variable lookup is presence-keyed, so an entry with no value produces no key rather than one that stops the cascade
|
|
159
|
+
function toVariableRecord(variables) {
|
|
160
|
+
const record = {};
|
|
161
|
+
for (const [name, value] of Object.entries(variables)) {
|
|
162
|
+
if (value !== undefined) {
|
|
163
|
+
record[name.replace(/^--/, "")] = value;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return record;
|
|
167
|
+
}
|
|
168
|
+
|
|
132
169
|
/** Pseudo Classes ************************************************************/
|
|
133
170
|
|
|
134
171
|
const hoverFamily = exports.hoverFamily = weakFamily(() => observable(false));
|
|
@@ -175,7 +212,7 @@ const containerWidthFamily = exports.containerWidthFamily = weakFamily(key => {
|
|
|
175
212
|
});
|
|
176
213
|
const containerHeightFamily = exports.containerHeightFamily = weakFamily(key => {
|
|
177
214
|
return observable(read => {
|
|
178
|
-
return read(containerLayoutFamily(key))?.
|
|
215
|
+
return read(containerLayoutFamily(key))?.height || 0;
|
|
179
216
|
});
|
|
180
217
|
});
|
|
181
218
|
//# sourceMappingURL=reactivity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","observableBatch","exports","observable","init","equality","Object","is","value","isStatic","didInit","lastArg","observers","Set","effect","run","nextValue","getter","notify","get","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","observableBatch","exports","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","Dimensions","vw","read","width","vh","height","addEventListener","window","colorScheme","Appearance","getColorScheme","addChangeListener","event","ContainerContext","createContext","containerLayoutFamily","x","y","containerWidthFamily","containerHeightFamily"],"sourceRoot":"../../../src","sources":["native/reactivity.ts"],"mappings":";;;;;;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,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d,eAAe,CAAC+B,OAAO,GAAGV,SAAS;AACrC,CAAC,CAAC;;AAEF;;AAEO,MAAMiD,WAAW,GAAArE,OAAA,CAAAqE,WAAA,GAAGpE,UAAU,CACnCqE,uBAAU,CAACC,cAAc,CAAC,CAC5B,CAAC;AACDD,uBAAU,CAACE,iBAAiB,CAAEC,KAAK,IAAKJ,WAAW,CAAC7C,GAAG,CAACiD,KAAK,CAACJ,WAAW,CAAC,CAAC;;AAE3E;;AASO,MAAMK,gBAAgB,GAAA1E,OAAA,CAAA0E,gBAAA,gBAAG,IAAAC,oBAAa,EAAwB,CAAC,CAAC,CAAC;AAEjE,MAAMC,qBAAqB,GAAA5E,OAAA,CAAA4E,qBAAA,GAAG9B,UAAU,CAAC,MAAM;EACpD,OAAO7C,UAAU,CAAkB;IACjC4E,CAAC,EAAE,CAAC;IACJC,CAAC,EAAE,CAAC;IACJd,KAAK,EAAE,CAAC;IACRE,MAAM,EAAE;EACV,CAAC,CAAC;AACJ,CAAC,CAAC;AAEK,MAAMa,oBAAoB,GAAA/E,OAAA,CAAA+E,oBAAA,GAAGjC,UAAU,CAAEH,GAAG,IAAK;EACtD,OAAO1C,UAAU,CAAE8D,IAAI,IAAK;IAC1B,OAAOA,IAAI,CAACa,qBAAqB,CAACjC,GAAG,CAAC,CAAC,EAAEqB,KAAK,IAAI,CAAC;EACrD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEK,MAAMgB,qBAAqB,GAAAhF,OAAA,CAAAgF,qBAAA,GAAGlC,UAAU,CAAEH,GAAG,IAAK;EACvD,OAAO1C,UAAU,CAAE8D,IAAI,IAAK;IAC1B,OAAOA,IAAI,CAACa,qBAAqB,CAACjC,GAAG,CAAC,CAAC,EAAEuB,MAAM,IAAI,CAAC;EACtD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -9,9 +9,21 @@ const animatedComponentFamily = exports.animatedComponentFamily = (0, _reactivit
|
|
|
9
9
|
if ("displayName" in component && component.displayName?.startsWith("Animated.")) {
|
|
10
10
|
return component;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
|
|
12
|
+
|
|
13
|
+
// Reanimated 4.5 keeps the original component display name. Compare its
|
|
14
|
+
// public built-in components by identity instead of interpreting that name.
|
|
15
|
+
const reanimated =
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
17
|
+
require("react-native-reanimated");
|
|
18
|
+
const animated = reanimated.default;
|
|
19
|
+
if ([animated.View, animated.Text, animated.Image, animated.ScrollView, animated.FlatList].some(value => value === component)) {
|
|
20
|
+
return component;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// This public constructor remains supported for arbitrary components; only
|
|
24
|
+
// its FlatList-specific overload is deprecated by Reanimated.
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
26
|
+
const createAnimatedComponent = reanimated.createAnimatedComponent;
|
|
15
27
|
return createAnimatedComponent(component);
|
|
16
28
|
});
|
|
17
29
|
//# sourceMappingURL=reanimated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactivity","require","animatedComponentFamily","exports","weakFamily","component","displayName","startsWith","createAnimatedComponent"],"sourceRoot":"../../../src","sources":["native/reanimated.ts"],"mappings":";;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAAE,sBAAU,EAC9CC,SAAwB,IAAK;EAC5B,IACE,aAAa,IAAIA,SAAS,IAC1BA,SAAS,CAACC,WAAW,EAAEC,UAAU,CAAC,WAAW,CAAC,EAC9C;IACA,OAAOF,SAAS;EAClB;
|
|
1
|
+
{"version":3,"names":["_reactivity","require","animatedComponentFamily","exports","weakFamily","component","displayName","startsWith","reanimated","animated","default","View","Text","Image","ScrollView","FlatList","some","value","createAnimatedComponent"],"sourceRoot":"../../../src","sources":["native/reanimated.ts"],"mappings":";;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAAE,sBAAU,EAC9CC,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;EACAP,OAAO,CAAC,yBAAyB,CAA6C;EAChF,MAAMQ,QAAQ,GAAGD,UAAU,CAACE,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,KAAKZ,SAAS,CAAC,EACtC;IACA,OAAOA,SAAS;EAClB;;EAEA;EACA;EACA;EACA,MAAMa,uBAAuB,GAAGV,UAAU,CAACU,uBAEzB;EAElB,OAAOA,uBAAuB,CAACb,SAAS,CAAC;AAC3C,CACF,CAAC","ignoreList":[]}
|
|
@@ -5,42 +5,56 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.colorMix = void 0;
|
|
7
7
|
var _fn = require("colorjs.io/fn");
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
9
|
-
|
|
10
8
|
_fn.ColorSpace.register(_fn.sRGB);
|
|
11
9
|
_fn.ColorSpace.register(_fn.P3);
|
|
12
10
|
_fn.ColorSpace.register(_fn.OKLab);
|
|
13
11
|
const colorMix = (resolveValue, value) => {
|
|
14
|
-
const
|
|
15
|
-
if (!Array.isArray(
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const resolved = resolveValue(value[2]);
|
|
13
|
+
if (!Array.isArray(resolved)) return;
|
|
14
|
+
|
|
15
|
+
// Resolved descriptors may be cached and shared by another styled component.
|
|
16
|
+
const args = [...resolved];
|
|
18
17
|
try {
|
|
19
18
|
const space = args.shift();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (typeof
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
const leftValue = args.shift();
|
|
20
|
+
if (typeof space !== "string" || typeof leftValue !== "string") return;
|
|
21
|
+
_fn.ColorSpace.get(space);
|
|
22
|
+
const left = (0, _fn.parse)(leftValue);
|
|
23
|
+
const percentage = () => {
|
|
24
|
+
const next = args[0];
|
|
25
|
+
if (typeof next !== "string" || !next.endsWith("%")) return undefined;
|
|
26
|
+
args.shift();
|
|
27
|
+
return Number(next.slice(0, -1)) / 100;
|
|
28
|
+
};
|
|
29
|
+
let leftWeight = percentage();
|
|
30
|
+
const rightValue = args.shift();
|
|
31
|
+
if (typeof rightValue !== "string") return;
|
|
32
|
+
const right = (0, _fn.parse)(rightValue);
|
|
33
|
+
let rightWeight = percentage();
|
|
34
|
+
if (args.length) return;
|
|
35
|
+
|
|
36
|
+
// CSS Color 5: omitted weights are complementary, then both are normalized.
|
|
37
|
+
leftWeight ??= rightWeight === undefined ? 0.5 : 1 - rightWeight;
|
|
38
|
+
rightWeight ??= 1 - leftWeight;
|
|
39
|
+
if (![leftWeight, rightWeight].every(weight => Number.isFinite(weight) && weight >= 0 && weight <= 1)) return;
|
|
40
|
+
const sum = leftWeight + rightWeight;
|
|
41
|
+
if (sum === 0) return;
|
|
42
|
+
const alphaMultiplier = Math.min(sum, 1);
|
|
43
|
+
let result;
|
|
44
|
+
if (right.alpha === 0 || left.alpha === 0) {
|
|
45
|
+
// A transparent endpoint contributes no premultiplied channels.
|
|
46
|
+
const source = right.alpha === 0 ? left : right;
|
|
47
|
+
const weight = right.alpha === 0 ? leftWeight : rightWeight;
|
|
48
|
+
result = (0, _fn.to)(source, "srgb");
|
|
49
|
+
result.alpha = (source.alpha ?? 1) * weight / sum;
|
|
50
|
+
} else {
|
|
51
|
+
result = (0, _fn.mix)(left, right, rightWeight / sum, {
|
|
52
|
+
space,
|
|
53
|
+
outputSpace: "srgb",
|
|
54
|
+
premultiplied: true
|
|
55
|
+
});
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
space,
|
|
42
|
-
outputSpace: "srgb"
|
|
43
|
-
});
|
|
57
|
+
result.alpha = (result.alpha ?? 1) * alphaMultiplier;
|
|
44
58
|
return `rgba(${(result.coords[0] ?? 0) * 255}, ${(result.coords[1] ?? 0) * 255}, ${(result.coords[2] ?? 0) * 255}, ${result.alpha})`;
|
|
45
59
|
} catch {
|
|
46
60
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fn","require","ColorSpace","register","sRGB","P3","OKLab","colorMix","resolveValue","value","
|
|
1
|
+
{"version":3,"names":["_fn","require","ColorSpace","register","sRGB","P3","OKLab","colorMix","resolveValue","value","resolved","Array","isArray","args","space","shift","leftValue","get","left","parse","percentage","next","endsWith","undefined","Number","slice","leftWeight","rightValue","right","rightWeight","length","every","weight","isFinite","sum","alphaMultiplier","Math","min","result","alpha","source","convert","mix","outputSpace","premultiplied","coords","exports"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/color-mix.ts"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AAYAC,cAAU,CAACC,QAAQ,CAACC,QAAI,CAAC;AACzBF,cAAU,CAACC,QAAQ,CAACE,MAAE,CAAC;AACvBH,cAAU,CAACC,QAAQ,CAACG,SAAK,CAAC;AAEnB,MAAMC,QAA+B,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EACtE,MAAMC,QAAQ,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACvC,IAAI,CAACE,KAAK,CA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;EACtI,CAAC,CAAC,MAAM;IACN;EACF;AACF,CAAC;AAACO,OAAA,CAAAvC,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.sepia = exports.saturate = exports.opacity = exports.invert = exports.hueRotate = exports.grayscale = exports.dropShadow = exports.contrast = exports.brightness = exports.blur = void 0;
|
|
6
|
+
exports.sepia = exports.saturate = exports.opacity = exports.invert = exports.hueRotate = exports.grayscale = exports.filter = exports.dropShadow = exports.contrast = exports.brightness = exports.blur = void 0;
|
|
7
7
|
var _utilities = require("react-native-css/utilities");
|
|
8
8
|
var _handler = require("../shorthands/_handler.js");
|
|
9
9
|
const blur = (resolveValue, value) => {
|
|
@@ -80,5 +80,18 @@ const dropShadow = (resolveValue, func, get, options) => {
|
|
|
80
80
|
dropShadow: handler(resolveValue, args, get, options)
|
|
81
81
|
} : undefined;
|
|
82
82
|
};
|
|
83
|
+
|
|
84
|
+
/** CSS variables may expand to multiple filters; native filter arrays must be flat. */
|
|
83
85
|
exports.dropShadow = dropShadow;
|
|
86
|
+
const filter = (resolveValue, descriptor) => {
|
|
87
|
+
const value = resolveValue(descriptor[2]);
|
|
88
|
+
if (Array.isArray(value)) {
|
|
89
|
+
const filters = value.flat(Infinity);
|
|
90
|
+
return filters.filter(entry => entry !== undefined && entry !== "initial");
|
|
91
|
+
}
|
|
92
|
+
if (value === undefined || value === "initial") return;
|
|
93
|
+
if (value === "none") return null;
|
|
94
|
+
return typeof value === "string" ? value : [value];
|
|
95
|
+
};
|
|
96
|
+
exports.filter = filter;
|
|
84
97
|
//# sourceMappingURL=filters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_utilities","require","_handler","blur","resolveValue","value","args","Array","isArray","exports","brightness","contrast","grayscale","hueRotate","invert","sepia","saturate","opacity","color","offsetX","offsetY","standardDeviation","handler","shorthandHandler","dropShadow","func","get","options","isStyleDescriptorArray","undefined"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/filters.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,IAA2B,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EAClE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLF,IAAI,EAAGI,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EACzC,CAAC;AACH,CAAC;AAACG,OAAA,CAAAN,IAAA,GAAAA,IAAA;AAEK,MAAMO,UAAiC,GAAGA,CAACN,YAAY,EAAEC,KAAK,KAAK;EACxE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLK,UAAU,EAAGH,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EAC/C,CAAC;AACH,CAAC;AAACG,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAEK,MAAMC,QAA+B,GAAGA,CAACP,YAAY,EAAEC,KAAK,KAAK;EACtE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLM,QAAQ,EAAGJ,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EAC7C,CAAC;AACH,CAAC;AAACG,OAAA,CAAAE,QAAA,GAAAA,QAAA;AAEK,MAAMC,SAAgC,GAAGA,CAACR,YAAY,EAAEC,KAAK,KAAK;EACvE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLO,SAAS,EAAGL,KAAK,CAACC,OAAO,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YAAY,EAAEE,IAAI,EAAEoB,GAAG,EAAEC,OAAO;EACtD,CAAC,GACDE,SAAS;AACf,CAAC;
|
|
1
|
+
{"version":3,"names":["_utilities","require","_handler","blur","resolveValue","value","args","Array","isArray","exports","brightness","contrast","grayscale","hueRotate","invert","sepia","saturate","opacity","color","offsetX","offsetY","standardDeviation","handler","shorthandHandler","dropShadow","func","get","options","isStyleDescriptorArray","undefined","filter","descriptor","filters","flat","Infinity","entry"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/filters.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AAEO,MAAME,IAA2B,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EAClE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLF,IAAI,EAAGI,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EACzC,CAAC;AACH,CAAC;AAACG,OAAA,CAAAN,IAAA,GAAAA,IAAA;AAEK,MAAMO,UAAiC,GAAGA,CAACN,YAAY,EAAEC,KAAK,KAAK;EACxE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLK,UAAU,EAAGH,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;EAC/C,CAAC;AACH,CAAC;AAACG,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAEK,MAAMC,QAA+B,GAAGA,CAACP,YAAY,EAAEC,KAAK,KAAK;EACtE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EACnC,OAAO;IACLM,QAAQ,EAAGJ,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA;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,MAAMM,UAAiC,GAAGA,CAC/CpB,YAAY,EACZqB,IAAI,EACJC,GAAG,EACHC,OAAO,KACJ;EACH,MAAMrB,IAAI,GAAGF,YAAY,CAACqB,IAAI,CAAC,CAAC,CAAC,CAAC;EAElC,OAAO,IAAAG,iCAAsB,EAACtB,IAAI,CAAC,GAC/B;IACEkB,UAAU,EAAEF,OAAO,CAAClB,YAAY,EAAEE,IAAI,EAAEoB,GAAG,EAAEC,OAAO;EACtD,CAAC,GACDE,SAAS;AACf,CAAC;;AAED;AAAApB,OAAA,CAAAe,UAAA,GAAAA,UAAA;AACO,MAAMM,MAA6B,GAAGA,CAAC1B,YAAY,EAAE2B,UAAU,KAAK;EACzE,MAAM1B,KAAc,GAAGD,YAAY,CAAC2B,UAAU,CAAC,CAAC,CAAC,CAAC;EAClD,IAAIxB,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,EAAE;IACxB,MAAM2B,OAAkB,GAAG3B,KAAK,CAAC4B,IAAI,CAACC,QAAQ,CAAC;IAC/C,OAAOF,OAAO,CAACF,MAAM,CAClBK,KAAK,IAAKA,KAAK,KAAKN,SAAS,IAAIM,KAAK,KAAK,SAC9C,CAAC;EACH;EACA,IAAI9B,KAAK,KAAKwB,SAAS,IAAIxB,KAAK,KAAK,SAAS,EAAE;EAChD,IAAIA,KAAK,KAAK,MAAM,EAAE,OAAO,IAAI;EACjC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAG,CAACA,KAAK,CAAC;AACpD,CAAC;AAACI,OAAA,CAAAqB,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -22,11 +22,12 @@ const min = (resolveValue, value) => {
|
|
|
22
22
|
exports.min = min;
|
|
23
23
|
const clamp = (resolveValue, value) => {
|
|
24
24
|
const args = resolveValue(value[2]);
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
if (!Array.isArray(args)) return;
|
|
26
|
+
const [minimum, preferred, maximum] = args;
|
|
27
|
+
if (typeof minimum !== "number" || typeof preferred !== "number" || typeof maximum !== "number") {
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
return Math.
|
|
30
|
+
return Math.max(minimum, Math.min(preferred, maximum));
|
|
30
31
|
};
|
|
31
32
|
exports.clamp = clamp;
|
|
32
33
|
//# sourceMappingURL=numeric-functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["max","resolveValue","value","args","Array","isArray","some","arg","Math","exports","min","clamp","
|
|
1
|
+
{"version":3,"names":["max","resolveValue","value","args","Array","isArray","some","arg","Math","exports","min","clamp","minimum","preferred","maximum"],"sourceRoot":"../../../../../src","sources":["native/styles/functions/numeric-functions.ts"],"mappings":";;;;;;AAEO,MAAMA,GAA0B,GAAGA,CAACC,YAAY,EAAEC,KAAK,KAAK;EACjE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAEnC,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,IAAIA,IAAI,CAACG,IAAI,CAAEC,GAAG,IAAK,OAAOA,GAAG,KAAK,QAAQ,CAAC,EAAE;IACvE;EACF;EAEA,OAAOC,IAAI,CAACR,GAAG,CAAC,GAAIG,IAAiB,CAAC;AACxC,CAAC;AAACM,OAAA,CAAAT,GAAA,GAAAA,GAAA;AAEK,MAAMU,GAA0B,GAAGA,CAACT,YAAY,EAAEC,KAAK,KAAK;EACjE,MAAMC,IAAI,GAAGF,YAAY,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC;EAEnC,IAAI,CAACE,KAAK,CAACC,OAAO,CAACF,IAAI,CAAC,IAAIA,IAAI,CAACG,IAAI,CAAEC,GAAG,IAAK,OAAOA,GAAG,KAAK,QAAQ,CAAC,EAAE;IACvE;EACF;EAEA,OAAOC,IAAI,CAACE,GAAG,CAAC,GAAIP,IAAiB,CAAC;AACxC,CAAC;AAACM,OAAA,CAAAC,GAAA,GAAAA,GAAA;AAEK,MAAMC,KAA4B,GAA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