react-native-css 0.0.0-nightly.0acc293 → 0.0.0-nightly.0b4380e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -5
- package/dist/commonjs/babel/helpers.js +7 -0
- package/dist/commonjs/babel/helpers.js.map +1 -1
- package/dist/commonjs/babel/import-plugin.js +20 -8
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +17 -4
- package/dist/commonjs/babel/react-native-web.js.map +1 -1
- package/dist/commonjs/babel/react-native.js +9 -4
- package/dist/commonjs/babel/react-native.js.map +1 -1
- package/dist/commonjs/compiler/atRules.js +35 -0
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +188 -38
- 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 +149 -57
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- 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 +15 -2
- package/dist/commonjs/compiler/lightningcss-loader.js.map +1 -1
- package/dist/commonjs/compiler/media-query.js +16 -6
- package/dist/commonjs/compiler/media-query.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +16 -4
- package/dist/commonjs/compiler/selector-builder.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +18 -3
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/compiler/supports.js +2 -2
- package/dist/commonjs/compiler/supports.js.map +1 -1
- package/dist/commonjs/components/FlatList.js +1 -0
- package/dist/commonjs/components/FlatList.js.map +1 -1
- package/dist/commonjs/components/ImageBackground.js +2 -6
- package/dist/commonjs/components/ImageBackground.js.map +1 -1
- package/dist/commonjs/components/KeyboardAvoidingView.js +2 -3
- package/dist/commonjs/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/commonjs/components/SafeAreaProvider.js +13 -0
- package/dist/commonjs/components/SafeAreaProvider.js.map +1 -0
- package/dist/commonjs/components/index.cjs +49 -1
- package/dist/commonjs/components/index.cjs.map +1 -1
- package/dist/commonjs/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 +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/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/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 +80 -19
- 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/functions/color-mix.js +64 -0
- package/dist/commonjs/native/styles/functions/color-mix.js.map +1 -0
- package/dist/commonjs/native/styles/functions/filters.js +18 -5
- package/dist/commonjs/native/styles/functions/filters.js.map +1 -1
- package/dist/commonjs/native/styles/functions/index.js +11 -0
- package/dist/commonjs/native/styles/functions/index.js.map +1 -1
- package/dist/commonjs/native/styles/functions/numeric-functions.js +4 -3
- package/dist/commonjs/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/string-functions.js +16 -1
- package/dist/commonjs/native/styles/functions/string-functions.js.map +1 -1
- package/dist/commonjs/native/styles/functions/transform-functions.js +5 -4
- package/dist/commonjs/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/commonjs/native/styles/index.js +382 -28
- package/dist/commonjs/native/styles/index.js.map +1 -1
- package/dist/commonjs/native/styles/resolve.js +10 -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/_handler.js +10 -0
- package/dist/commonjs/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/animation.js +6 -3
- package/dist/commonjs/native/styles/shorthands/animation.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/box-shadow.js +45 -12
- package/dist/commonjs/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/index.js +11 -0
- package/dist/commonjs/native/styles/shorthands/index.js.map +1 -1
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js +22 -0
- package/dist/commonjs/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/commonjs/native/styles/variables.js +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 +4 -9
- package/dist/commonjs/utilities/style-descriptor.js.map +1 -1
- package/dist/commonjs/web/api.js +2 -2
- package/dist/commonjs/web/api.js.map +1 -1
- package/dist/commonjs/web/assign-style.js +4 -1
- package/dist/commonjs/web/assign-style.js.map +1 -1
- package/dist/module/babel/helpers.js +6 -0
- package/dist/module/babel/helpers.js.map +1 -1
- package/dist/module/babel/import-plugin.js +22 -10
- package/dist/module/babel/import-plugin.js.map +1 -1
- package/dist/module/babel/react-native-web.js +16 -4
- package/dist/module/babel/react-native-web.js.map +1 -1
- package/dist/module/babel/react-native.js +9 -4
- package/dist/module/babel/react-native.js.map +1 -1
- package/dist/module/compiler/atRules.js +33 -0
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/compiler.js +190 -40
- 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 +148 -57
- package/dist/module/compiler/declarations.js.map +1 -1
- 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 +14 -2
- package/dist/module/compiler/lightningcss-loader.js.map +1 -1
- package/dist/module/compiler/media-query.js +16 -6
- package/dist/module/compiler/media-query.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +16 -5
- package/dist/module/compiler/selector-builder.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +18 -3
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/compiler/supports.js +2 -2
- package/dist/module/compiler/supports.js.map +1 -1
- package/dist/module/components/FlatList.js +1 -0
- package/dist/module/components/FlatList.js.map +1 -1
- package/dist/module/components/ImageBackground.js +2 -6
- package/dist/module/components/ImageBackground.js.map +1 -1
- package/dist/module/components/KeyboardAvoidingView.js +2 -3
- package/dist/module/components/KeyboardAvoidingView.js.map +1 -1
- package/dist/module/components/SafeAreaProvider.js +4 -0
- package/dist/module/components/SafeAreaProvider.js.map +1 -0
- package/dist/module/components/index.cjs +49 -1
- package/dist/module/components/index.cjs.map +1 -1
- package/dist/module/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 +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/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/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 +83 -22
- 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/functions/color-mix.js +59 -0
- package/dist/module/native/styles/functions/color-mix.js.map +1 -0
- package/dist/module/native/styles/functions/filters.js +16 -4
- package/dist/module/native/styles/functions/filters.js.map +1 -1
- package/dist/module/native/styles/functions/index.js +1 -0
- package/dist/module/native/styles/functions/index.js.map +1 -1
- package/dist/module/native/styles/functions/numeric-functions.js +4 -3
- package/dist/module/native/styles/functions/numeric-functions.js.map +1 -1
- package/dist/module/native/styles/functions/string-functions.js +13 -0
- package/dist/module/native/styles/functions/string-functions.js.map +1 -1
- package/dist/module/native/styles/functions/transform-functions.js +5 -4
- package/dist/module/native/styles/functions/transform-functions.js.map +1 -1
- package/dist/module/native/styles/index.js +383 -28
- package/dist/module/native/styles/index.js.map +1 -1
- package/dist/module/native/styles/resolve.js +10 -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/_handler.js +11 -1
- package/dist/module/native/styles/shorthands/_handler.js.map +1 -1
- package/dist/module/native/styles/shorthands/animation.js +6 -3
- package/dist/module/native/styles/shorthands/animation.js.map +1 -1
- package/dist/module/native/styles/shorthands/box-shadow.js +46 -12
- package/dist/module/native/styles/shorthands/box-shadow.js.map +1 -1
- package/dist/module/native/styles/shorthands/index.js +1 -0
- package/dist/module/native/styles/shorthands/index.js.map +1 -1
- package/dist/module/native/styles/shorthands/logical-border-width.js +18 -0
- package/dist/module/native/styles/shorthands/logical-border-width.js.map +1 -0
- package/dist/module/native/styles/variables.js +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 +4 -9
- package/dist/module/utilities/style-descriptor.js.map +1 -1
- package/dist/module/web/api.js +2 -2
- package/dist/module/web/api.js.map +1 -1
- package/dist/module/web/assign-style.js +4 -1
- package/dist/module/web/assign-style.js.map +1 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/import-plugin.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts +2 -1
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts +4 -1
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -5
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +13 -0
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +3 -2
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- 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 +8 -8
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/react-native-safe-area-context.native.d.ts +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/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/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/functions/color-mix.d.ts +3 -0
- package/dist/typescript/commonjs/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/index.d.ts +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 +1 -0
- package/dist/typescript/commonjs/src/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts +2 -0
- package/dist/typescript/commonjs/src/native/styles/scale-factor.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/_handler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/box-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts +4 -0
- package/dist/typescript/commonjs/src/native/styles/shorthands/logical-border-width.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/native/styles/variables.d.ts +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 +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 +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 +5 -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 +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 +8 -8
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/components/FlatList.d.ts.map +1 -1
- package/dist/typescript/module/src/components/ImageBackground.d.ts.map +1 -1
- package/dist/typescript/module/src/components/KeyboardAvoidingView.d.ts.map +1 -1
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts +2 -0
- package/dist/typescript/module/src/components/SafeAreaProvider.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +16 -16
- package/dist/typescript/module/src/components/index.d.ts.map +1 -1
- package/dist/typescript/module/src/components/react-native-safe-area-context.native.d.ts +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 +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/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 +2 -2
- package/dist/typescript/module/src/native/styles/calculate-props.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/animation-timing.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts +3 -0
- package/dist/typescript/module/src/native/styles/functions/color-mix.d.ts.map +1 -0
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/filters.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/index.d.ts +8 -7
- package/dist/typescript/module/src/native/styles/functions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/numeric-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/platform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts +3 -1
- package/dist/typescript/module/src/native/styles/functions/string-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts +1 -1
- package/dist/typescript/module/src/native/styles/functions/transform-functions.d.ts.map +1 -1
- package/dist/typescript/module/src/native/styles/index.d.ts +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 +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 +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 +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 +79 -31
- package/src/babel/helpers.ts +8 -1
- package/src/babel/import-plugin.ts +31 -16
- package/src/babel/react-native-web.ts +32 -4
- package/src/babel/react-native.ts +9 -4
- package/src/compiler/atRules.ts +44 -0
- package/src/compiler/compiler.ts +266 -49
- package/src/compiler/compiler.types.ts +17 -0
- package/src/compiler/container-query.ts +8 -3
- package/src/compiler/declarations.ts +280 -95
- package/src/compiler/inline-variables.ts +67 -0
- package/src/compiler/lightningcss-loader.ts +21 -1
- package/src/compiler/media-query.ts +20 -9
- package/src/compiler/selector-builder.ts +32 -5
- package/src/compiler/stylesheet.ts +35 -10
- package/src/compiler/supports.ts +2 -2
- package/src/components/FlatList.tsx +1 -0
- package/src/components/ImageBackground.tsx +2 -6
- package/src/components/KeyboardAvoidingView.tsx +2 -3
- package/src/components/SafeAreaProvider.tsx +1 -0
- package/src/components/index.cts +49 -1
- package/src/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 +22 -17
- 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/react/interaction.ts +11 -6
- package/src/native/react/rules.ts +58 -45
- package/src/native/react/useNativeCss.ts +95 -21
- 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/functions/color-mix.ts +74 -0
- package/src/native/styles/functions/filters.ts +20 -6
- package/src/native/styles/functions/index.ts +1 -0
- package/src/native/styles/functions/numeric-functions.ts +7 -6
- package/src/native/styles/functions/string-functions.ts +18 -0
- package/src/native/styles/functions/transform-functions.ts +5 -4
- package/src/native/styles/index.ts +444 -37
- package/src/native/styles/resolve.ts +15 -11
- package/src/native/styles/scale-factor.ts +6 -0
- package/src/native/styles/shorthands/_handler.ts +14 -1
- package/src/native/styles/shorthands/animation.ts +8 -2
- package/src/native/styles/shorthands/box-shadow.ts +50 -15
- package/src/native/styles/shorthands/index.ts +1 -0
- package/src/native/styles/shorthands/logical-border-width.ts +32 -0
- package/src/native/styles/variables.ts +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 +11 -16
- package/src/web/api.tsx +7 -12
- package/src/web/assign-style.ts +2 -1
- package/types.d.ts +3 -20
- package/dist/commonjs/compiler/inheritance.test.js +0 -78
- package/dist/commonjs/compiler/inheritance.test.js.map +0 -1
- package/dist/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
|
@@ -12,9 +12,9 @@ const fill = ["animationFillMode", ["none", "forwards", "backwards", "both"], "n
|
|
|
12
12
|
const playState = ["animationPlayState", ["running", "paused"], "running"];
|
|
13
13
|
const direction = ["animationDirection", ["normal", "reverse", "alternate", "alternate-reverse"], "normal"];
|
|
14
14
|
const timingFunction = ["animationTimingFunction", ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "object"], "ease"];
|
|
15
|
-
export const animationShorthand = shorthandHandler([[name], [duration, name], [name, duration], [name, duration, iteration], [name, duration, timingFunction, iteration], [duration, delay, name], [duration, delay, iteration, name], [duration, delay, iteration, timingFunction, name], [name, duration, timingFunction, delay, iteration, fill]], [name, delay, direction, duration, fill, iteration, playState, timingFunction], "tuples");
|
|
15
|
+
export const animationShorthand = shorthandHandler([[name], [duration, name], [name, duration], [name, duration, timingFunction], [duration, timingFunction, name], [name, duration, iteration], [name, duration, timingFunction, iteration], [duration, delay, name], [duration, delay, iteration, name], [duration, delay, iteration, timingFunction, name], [name, duration, timingFunction, delay, iteration, fill]], [name, delay, direction, duration, fill, iteration, playState, timingFunction], "tuples");
|
|
16
16
|
export const animation = (resolveValue, value, get, options) => {
|
|
17
|
-
const animationShortHandTuples = animationShorthand(resolveValue, value, get, options);
|
|
17
|
+
const animationShortHandTuples = animationShorthand(resolveValue, [value[2]], get, options);
|
|
18
18
|
if (!Array.isArray(animationShortHandTuples)) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
@@ -23,6 +23,9 @@ export const animation = (resolveValue, value, get, options) => {
|
|
|
23
23
|
if (!nameTuple || typeof name !== "string") {
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
+
if (name === "none") {
|
|
27
|
+
return applyShorthand(animationShortHandTuples);
|
|
28
|
+
}
|
|
26
29
|
const keyframes = get(StyleCollection.keyframes(name));
|
|
27
30
|
const animation = {};
|
|
28
31
|
for (const [progress, declarations] of keyframes) {
|
|
@@ -49,6 +52,6 @@ export const animation = (resolveValue, value, get, options) => {
|
|
|
49
52
|
};
|
|
50
53
|
export const animationName = (resolveValue, value, get, options) => {
|
|
51
54
|
const shorthand = animation(resolveValue, value, get, options);
|
|
52
|
-
return shorthand
|
|
55
|
+
return shorthand?.animationName;
|
|
53
56
|
};
|
|
54
57
|
//# sourceMappingURL=animation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleCollection","applyShorthand","shorthandHandler","name","delay","duration","iteration","fill","playState","direction","timingFunction","animationShorthand","animation","resolveValue","value","get","options","animationShortHandTuples","Array","isArray","nameTuple","find","tuple","keyframes","progress","declarations","props","calculateProps","s","d","renderGuards","inheritedVariables","inlineVariables","normal","Object","assign","important","style","animationName","shorthand"],"sourceRoot":"../../../../../src","sources":["native/styles/shorthands/animation.ts"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAQ,kCAAkC;AAElE,SAASC,cAAc,QAAQ,kBAAe;AAE9C,SAASC,gBAAgB,QAAQ,eAAY;AAE7C,MAAMC,IAAI,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAU;AACzD,MAAMC,KAAK,GAAG,CAAC,gBAAgB,EAAE,QAAQ,EAAE,CAAC,CAAU;AACtD,MAAMC,QAAQ,GAAG,CAAC,mBAAmB,EAAE,QAAQ,EAAE,CAAC,CAAU;AAC5D,MAAMC,SAAS,GAAG,CAChB,yBAAyB,EACzB,CAAC,QAAQ,EAAE,UAAU,CAAC,EACtB,CAAC,CACO;AACV,MAAMC,IAAI,GAAG,CACX,mBAAmB,EACnB,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,CAAC,EACzC,MAAM,CACE;AACV,MAAMC,SAAS,GAAG,CAChB,oBAAoB,EACpB,CAAC,SAAS,EAAE,QAAQ,CAAC,EACrB,SAAS,CACD;AACV,MAAMC,SAAS,GAAG,CAChB,oBAAoB,EACpB,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,EACvD,QAAQ,CACA;AACV,MAAMC,cAAc,GAAG,CACrB,yBAAyB,EACzB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,CAAC,EAClE,MAAM,CACE;AAEV,OAAO,MAAMC,kBAAkB,GAAGT,gBAAgB,CAChD,CACE,CAACC,IAAI,CAAC,EACN,CAACE,QAAQ,EAAEF,IAAI,CAAC,EAChB,CAACA,IAAI,EAAEE,QAAQ,CAAC,EAChB,CAACF,IAAI,EAAEE,QAAQ,EAAEC,SAAS,CAAC,EAC3B,CAACH,IAAI,EAAEE,QAAQ,EAAEK,cAAc,EAAEJ,SAAS,CAAC,EAC3C,CAACD,QAAQ,EAAED,KAAK,EAAED,IAAI,CAAC,EACvB,CAACE,QAAQ,EAAED,KAAK,EAAEE,SAAS,EAAEH,IAAI,CAAC,EAClC,CAACE,QAAQ,EAAED,KAAK,EAAEE,SAAS,EAAEI,cAAc,EAAEP,IAAI,CAAC,EAClD,CAACA,IAAI,EAAEE,QAAQ,EAAEK,cAAc,EAAEN,KAAK,EAAEE,SAAS,EAAEC,IAAI,CAAC,CACzD,EACD,CACEJ,IAAI,EACJC,KAAK,EACLK,SAAS,EACTJ,QAAQ,EACRE,IAAI,EACJD,SAAS,EACTE,SAAS,EACTE,cAAc,CACf,EACD,QACF,CAAC;AAED,OAAO,MAAME,SAAgC,GAAGA,CAC9CC,YAAY,EACZC,KAAK,EACLC,GAAG,EACHC,OAAO,KACJ;EACH,MAAMC,wBAAwB,GAAGN,kBAAkB,CACjDE,YAAY,
|
|
1
|
+
{"version":3,"names":["StyleCollection","applyShorthand","shorthandHandler","name","delay","duration","iteration","fill","playState","direction","timingFunction","animationShorthand","animation","resolveValue","value","get","options","animationShortHandTuples","Array","isArray","nameTuple","find","tuple","keyframes","progress","declarations","props","calculateProps","s","d","renderGuards","inheritedVariables","inlineVariables","normal","Object","assign","important","style","animationName","shorthand"],"sourceRoot":"../../../../../src","sources":["native/styles/shorthands/animation.ts"],"mappings":";;AAAA;AACA,SAASA,eAAe,QAAQ,kCAAkC;AAElE,SAASC,cAAc,QAAQ,kBAAe;AAE9C,SAASC,gBAAgB,QAAQ,eAAY;AAE7C,MAAMC,IAAI,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,M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MAAEC,CAAC,EAAEJ;IAAa,CAAC,CAAC,EAC7BT,OAAO,CAACc,YAAY,EACpBd,OAAO,CAACe,kBAAkB,EAC1Bf,OAAO,CAACgB,eACV,CAAC;IAED,IAAI,CAACN,KAAK,EAAE;MACV;IACF;IAEA,IAAIA,KAAK,CAACO,MAAM,EAAE;MAChBC,MAAM,CAACC,MAAM,CAACvB,SAAS,CAACY,QAAQ,CAAC,EAAEE,KAAK,CAACO,MAAM,CAAC;IAClD;IACA,IAAIP,KAAK,CAACU,SAAS,EAAE;MACnBF,MAAM,CAACC,MAAM,CAACvB,SAAS,CAACY,QAAQ,CAAC,EAAEE,KAAK,CAACU,SAAS,CAAC;IACrD;IAEAxB,SAAS,CAACY,QAAQ,CAAC,GAAGZ,SAAS,CAACY,QAAQ,CAAC,CAACa,KAAK;EACjD;EAEAjB,SAAS,CAAC,CAAC,CAAC,GAAGR,SAAS;EAExB,OAAOX,cAAc,CAACgB,wBAAwB,CAAC;AACjD,CAAC;AAED,OAAO,MAAMqB,aAAoC,GAAGA,CAClDzB,YAAY,EACZC,KAAK,EACLC,GAAG,EACHC,OAAO,KACJ;EACH,MAAMuB,SAAc,GAAG3B,SAAS,CAACC,YAAY,EAAEC,KAAK,EAAEC,GAAG,EAAEC,OAAO,CAAC;EACnE,OAAOuB,SAAS,EAAED,aAAa;AACjC,CAAC","ignoreList":[]}
|
|
@@ -2,27 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
import { isStyleDescriptorArray } from "react-native-css/utilities";
|
|
4
4
|
import { shorthandHandler } from "./_handler.js";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
// "color" type accepts both strings ("#fff") and objects (PlatformColor from currentcolor).
|
|
7
|
+
// Using "string" here would reject platform color objects and silently drop the shadow.
|
|
8
|
+
const color = ["color", "color"];
|
|
6
9
|
const offsetX = ["offsetX", "number"];
|
|
7
10
|
const offsetY = ["offsetY", "number"];
|
|
8
11
|
const blurRadius = ["blurRadius", "number"];
|
|
9
12
|
const spreadDistance = ["spreadDistance", "number"];
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
const handler = shorthandHandler([
|
|
13
|
+
// Match the literal string "inset" - the array type checks if value is in array
|
|
14
|
+
const inset = ["inset", ["inset"]];
|
|
15
|
+
const handler = shorthandHandler([
|
|
16
|
+
// Standard patterns (without inset)
|
|
17
|
+
[offsetX, offsetY, blurRadius, spreadDistance], [offsetX, offsetY, blurRadius, spreadDistance, color], [color, offsetX, offsetY], [color, offsetX, offsetY, blurRadius, spreadDistance], [offsetX, offsetY, color], [offsetX, offsetY, blurRadius, color],
|
|
18
|
+
// Inset patterns - "inset" keyword at the beginning
|
|
19
|
+
[inset, offsetX, offsetY, blurRadius, spreadDistance], [inset, offsetX, offsetY, blurRadius, spreadDistance, color], [inset, offsetX, offsetY, blurRadius, color], [inset, color, offsetX, offsetY, blurRadius, spreadDistance]], [], "object");
|
|
13
20
|
export const boxShadow = (resolveValue, func, get, options) => {
|
|
14
21
|
const args = resolveValue(func[2]);
|
|
15
22
|
if (!isStyleDescriptorArray(args)) {
|
|
16
23
|
return args;
|
|
17
|
-
} else {
|
|
18
|
-
return args.flatMap(flattenShadowDescriptor).map(shadows => {
|
|
19
|
-
if (shadows === undefined) {
|
|
20
|
-
return;
|
|
21
|
-
} else {
|
|
22
|
-
return omitTransparentShadows(handler(resolveValue, shadows, get, options));
|
|
23
|
-
}
|
|
24
|
-
}).filter(v => v !== undefined);
|
|
25
24
|
}
|
|
25
|
+
|
|
26
|
+
// A flat array of primitives (e.g. [0, 4, 6, -1, "#000"]) is a single shadow
|
|
27
|
+
// resolved from a runtime variable. Pass it directly to the pattern handler.
|
|
28
|
+
// A nested array (e.g. [[0, 4, 6, -1, "#000"], [...]]) is multiple shadows.
|
|
29
|
+
if (args.length > 0 && !Array.isArray(args[0])) {
|
|
30
|
+
const result = handler(resolveValue, args, get, options);
|
|
31
|
+
if (result === undefined) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
const filtered = omitTransparentShadows(result);
|
|
35
|
+
return filtered !== undefined ? [normalizeInsetValue(filtered)] : [];
|
|
36
|
+
}
|
|
37
|
+
return args.flatMap(flattenShadowDescriptor).map(shadows => {
|
|
38
|
+
if (shadows === undefined) {
|
|
39
|
+
return;
|
|
40
|
+
} else {
|
|
41
|
+
return normalizeInsetValue(omitTransparentShadows(handler(resolveValue, shadows, get, options)));
|
|
42
|
+
}
|
|
43
|
+
}).filter(v => v !== undefined);
|
|
26
44
|
};
|
|
27
45
|
function flattenShadowDescriptor(arg) {
|
|
28
46
|
if (isStyleDescriptorArray(arg) && isStyleDescriptorArray(arg[0])) {
|
|
@@ -40,4 +58,20 @@ function omitTransparentShadows(style) {
|
|
|
40
58
|
}
|
|
41
59
|
return style;
|
|
42
60
|
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Convert inset: "inset" to inset: true for React Native boxShadow.
|
|
64
|
+
*
|
|
65
|
+
* The shorthand handler matches the literal "inset" string and assigns it as the value.
|
|
66
|
+
* React Native's boxShadow expects inset to be a boolean.
|
|
67
|
+
*/
|
|
68
|
+
function normalizeInsetValue(style) {
|
|
69
|
+
if (typeof style === "object" && style && "inset" in style) {
|
|
70
|
+
return {
|
|
71
|
+
...style,
|
|
72
|
+
inset: true
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return style;
|
|
76
|
+
}
|
|
43
77
|
//# sourceMappingURL=box-shadow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isStyleDescriptorArray","shorthandHandler","color","offsetX","offsetY","blurRadius","spreadDistance","handler","boxShadow","resolveValue","func","get","options","args","
|
|
1
|
+
{"version":3,"names":["isStyleDescriptorArray","shorthandHandler","color","offsetX","offsetY","blurRadius","spreadDistance","inset","handler","boxShadow","resolveValue","func","get","options","args","length","Array","isArray","result","undefined","filtered","omitTransparentShadows","normalizeInsetValue","flatMap","flattenShadowDescriptor","map","shadows","filter","v","arg","style"],"sourceRoot":"../../../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IACjE,OAAOA,GAAG,CAACJ,GAAG,CAAEI,GAAG,IAAK;MACtB,OAAOL,uBAAuB,CAACK,GAAG,CAAC;IACrC,CAAC,CAAC;EACJ;EAEA,OAAO,CAACA,GAAG,CAAC;AACd;AAEA,SAASR,sBAAsBA,CAACS,KAAc,EAAE;EAC9C,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,IAAI,OAAO,IAAIA,KAAK,EAAE;IAC1D,IAAIA,KAAK,CAAC5B,KAAK,KAAK,OAAO,IAAI4B,KAAK,CAAC5B,KAAK,KAAK,aAAa,EAAE;MAC5D;IACF;EACF;EAEA,OAAO4B,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASR,mBAAmBA,CAACQ,KAAc,EAAE;EAC3C,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,IAAI,OAAO,IAAIA,KAAK,EAAE;IAC1D,OAAO;MAAE,GAAGA,KAAK;MAAEvB,KAAK,EAAE;IAAK,CAAC;EAClC;EAEA,OAAOuB,KAAK;AACd","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["native/styles/shorthands/index.ts"],"mappings":";;AAAA,cAAc,gBAAa;AAC3B,cAAc,aAAU;AACxB,cAAc,iBAAc;AAC5B,cAAc,kBAAe;AAC7B,cAAc,gBAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["native/styles/shorthands/index.ts"],"mappings":";;AAAA,cAAc,gBAAa;AAC3B,cAAc,aAAU;AACxB,cAAc,2BAAwB;AACtC,cAAc,iBAAc;AAC5B,cAAc,kBAAe;AAC7B,cAAc,gBAAa","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { ShortHandSymbol } from "../constants.js";
|
|
4
|
+
function logicalWidth(start, end) {
|
|
5
|
+
return (resolve, descriptor) => {
|
|
6
|
+
const resolved = resolve(descriptor[2]);
|
|
7
|
+
const values = Array.isArray(resolved) ? resolved : [resolved];
|
|
8
|
+
if (values.length < 1 || values.length > 2 || !values.every(value => typeof value === "number" && Number.isFinite(value) && value >= 0)) return;
|
|
9
|
+
return {
|
|
10
|
+
[ShortHandSymbol]: true,
|
|
11
|
+
[start]: values[0],
|
|
12
|
+
[end]: values[1] ?? values[0]
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export const borderBlockWidth = logicalWidth("borderTopWidth", "borderBottomWidth");
|
|
17
|
+
export const borderInlineWidth = logicalWidth("borderStartWidth", "borderEndWidth");
|
|
18
|
+
//# sourceMappingURL=logical-border-width.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ShortHandSymbol","logicalWidth","start","end","resolve","descriptor","resolved","values","Array","isArray","length","every","value","Number","isFinite","borderBlockWidth","borderInlineWidth"],"sourceRoot":"../../../../../src","sources":["native/styles/shorthands/logical-border-width.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,iBAAc;AAG9C,SAASC,YAAYA,CAACC,KAAa,EAAEC,GAAW,EAAyB;EACvE,OAAO,CAACC,OAAO,EAAEC,UAAU,KAAK;IAC9B,MAAMC,QAAQ,GAAGF,OAAO,CAACC,UAAU,CAAC,CAAC,CAAC,CAAC;IACvC,MAAME,MAAiB,GAAGC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAG,CAACA,QAAQ,CAAC;IACzE,IACEC,MAAM,CAACG,MAAM,GAAG,CAAC,IACjBH,MAAM,CAACG,MAAM,GAAG,CAAC,IACjB,CAACH,MAAM,CAACI,KAAK,CACVC,KAAK,IACJ,OAAOA,KAAK,KAAK,QAAQ,IAAIC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,IAAIA,KAAK,IAAI,CACpE,CAAC,EAED;IACF,OAAO;MACL,CAACZ,eAAe,GAAG,IAAI;MACvB,CAACE,KAAK,GAAGK,MAAM,CAAC,CAAC,CAAC;MAClB,CAACJ,GAAG,GAAGI,MAAM,CAAC,CAAC,CAAC,IAAIA,MAAM,CAAC,CAAC;IAC9B,CAAC;EACH,CAAC;AACH;AAEA,OAAO,MAAMQ,gBAAgB,GAAGd,YAAY,CAC1C,gBAAgB,EAChB,mBACF,CAAC;AACD,OAAO,MAAMe,iBAAiB,GAAGf,YAAY,CAC3C,kBAAkB,EAClB,gBACF,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { rootVariables, universalVariables } from "react-native-css/native-internal";
|
|
4
|
-
import { isStyleDescriptorArray } from "react-native-css/utilities";
|
|
3
|
+
import { registeredInheritance, registeredInitialValues, rootVariables, universalVariables } from "react-native-css/native-internal";
|
|
4
|
+
import { isDeepEqual, isStyleDescriptorArray, isStyleFunction } from "react-native-css/utilities";
|
|
5
5
|
import { VAR_SYMBOL } from "../reactivity.js";
|
|
6
6
|
export function varResolver(resolve, fn, get, options) {
|
|
7
7
|
const {
|
|
@@ -10,66 +10,182 @@ export function varResolver(resolve, fn, get, options) {
|
|
|
10
10
|
[VAR_SYMBOL]: true
|
|
11
11
|
},
|
|
12
12
|
inlineVariables,
|
|
13
|
-
variableHistory = new Set()
|
|
13
|
+
variableHistory = options.variableHistory ??= new Set(),
|
|
14
|
+
variableCycles = options.variableCycles ??= new Set()
|
|
14
15
|
} = options;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
let fallback;
|
|
18
|
-
if (typeof args === "string") {
|
|
19
|
-
name = args;
|
|
20
|
-
} else {
|
|
21
|
-
const result = resolve(args);
|
|
22
|
-
if (isStyleDescriptorArray(result)) {
|
|
23
|
-
name = result[0];
|
|
24
|
-
fallback = result[1];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (typeof name !== "string") {
|
|
16
|
+
const name = variableName(fn[2]);
|
|
17
|
+
if (name === undefined) {
|
|
28
18
|
return;
|
|
29
19
|
}
|
|
30
20
|
|
|
31
|
-
//
|
|
21
|
+
// Fallbacks are substituted only when needed, after reading the variable.
|
|
22
|
+
const fallback = variableFallback(fn[2]);
|
|
23
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
24
|
+
|
|
25
|
+
// Share the active resolution path with recursive calls.
|
|
32
26
|
if (variableHistory.has(name)) {
|
|
27
|
+
markCycle(variableHistory, name, variableCycles);
|
|
33
28
|
return;
|
|
34
29
|
}
|
|
35
|
-
if (name in variables) {
|
|
36
|
-
renderGuards?.push(["v", name, variables[name]]);
|
|
37
|
-
return resolve(variables[name]);
|
|
38
|
-
}
|
|
39
30
|
variableHistory.add(name);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
try {
|
|
32
|
+
let value = resolve(inlineVariables?.[name]);
|
|
33
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
34
|
+
if (value !== undefined) {
|
|
35
|
+
options.inlineVariables ??= {
|
|
36
|
+
[VAR_SYMBOL]: "inline"
|
|
37
|
+
};
|
|
38
|
+
options.inlineVariables[name] = value;
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// A universal selector declares the variable on this element. It has lower
|
|
43
|
+
// specificity than the element's class declarations, but beats inheritance.
|
|
44
|
+
value = resolve(get(universalVariables(name)));
|
|
45
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
46
|
+
if (value !== undefined) {
|
|
47
|
+
options.inlineVariables ??= {
|
|
48
|
+
[VAR_SYMBOL]: "inline"
|
|
49
|
+
};
|
|
50
|
+
options.inlineVariables[name] = value;
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// An ancestor's variables and :root reach an element only by inheritance, which a non-inheriting registration switches off
|
|
55
|
+
// Guards retain the ancestor's raw descriptor, matching the context value.
|
|
56
|
+
if (name in variables) {
|
|
57
|
+
if (inherits(name, get)) {
|
|
58
|
+
renderGuards?.push(["v", name, variables[name]]);
|
|
59
|
+
value = resolve(variables[name]);
|
|
60
|
+
// An ancestor's guaranteed-invalid value inherits as such, so the reader takes its own fallback
|
|
61
|
+
return value === undefined || variableCycles.has(name) ? resolve(fallback) : value;
|
|
62
|
+
}
|
|
63
|
+
renderGuards?.push(["n", name, variables[name]]);
|
|
64
|
+
}
|
|
65
|
+
const rootValue = get(rootVariables(name));
|
|
66
|
+
if (rootValue !== undefined && inherits(name, get)) {
|
|
67
|
+
value = resolve(Array.isArray(rootValue) ? substituteOwnValues(rootValue, reference => get(rootVariables(reference)), get) : rootValue);
|
|
68
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
69
|
+
if (value !== undefined) {
|
|
70
|
+
options.inlineVariables ??= {
|
|
71
|
+
[VAR_SYMBOL]: "inline"
|
|
72
|
+
};
|
|
73
|
+
options.inlineVariables[name] = value;
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// A registered initial value applies only where no declaration reaches the element
|
|
79
|
+
value = resolve(get(registeredInitialValues(name)));
|
|
80
|
+
if (variableCycles.has(name)) return resolve(fallback);
|
|
81
|
+
if (value !== undefined) {
|
|
82
|
+
options.inlineVariables ??= {
|
|
83
|
+
[VAR_SYMBOL]: "inline"
|
|
84
|
+
};
|
|
85
|
+
options.inlineVariables[name] = value;
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
return resolve(fallback);
|
|
89
|
+
} finally {
|
|
90
|
+
variableHistory.delete(name);
|
|
47
91
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
92
|
+
}
|
|
93
|
+
function inherits(name, get) {
|
|
94
|
+
return get(registeredInheritance(name));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// A value that inherits is computed where it is declared, so its references to non-inheriting properties take that scope's own values
|
|
98
|
+
function substituteOwnValues(value, ownValue, get, history = new Set(), cycles = new Set()) {
|
|
99
|
+
if (!Array.isArray(value)) {
|
|
55
100
|
return value;
|
|
56
101
|
}
|
|
57
|
-
|
|
58
|
-
if (value
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
102
|
+
const substitute = descriptor => substituteOwnValues(descriptor, ownValue, get, history, cycles);
|
|
103
|
+
if (!isStyleFunction(value)) {
|
|
104
|
+
let substituted;
|
|
105
|
+
value.forEach((item, index) => {
|
|
106
|
+
const substitutedItem = substitute(item);
|
|
107
|
+
if (substitutedItem !== item) {
|
|
108
|
+
substituted ??= [...value];
|
|
109
|
+
substituted[index] = substitutedItem;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return substituted ?? value;
|
|
64
113
|
}
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
114
|
+
const name = value[1] === "var" ? variableName(value[2]) : undefined;
|
|
115
|
+
if (name === undefined) {
|
|
116
|
+
const substitutedArguments = substitute(value[2]);
|
|
117
|
+
return substitutedArguments === value[2] ? value : withArguments(value, substitutedArguments);
|
|
118
|
+
}
|
|
119
|
+
const fallback = variableFallback(value[2]);
|
|
120
|
+
if (inherits(name, get)) {
|
|
121
|
+
const substitutedFallback = substitute(fallback);
|
|
122
|
+
return substitutedFallback === fallback ? value : withArguments(value, [name, substitutedFallback]);
|
|
123
|
+
}
|
|
124
|
+
if (cycles.has(name)) {
|
|
125
|
+
return substitute(fallback);
|
|
126
|
+
}
|
|
127
|
+
if (history.has(name)) {
|
|
128
|
+
markCycle(history, name, cycles);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
history.add(name);
|
|
132
|
+
try {
|
|
133
|
+
const own = substitute(ownValue(name) ?? get(universalVariables(name)) ?? get(registeredInitialValues(name)));
|
|
134
|
+
return own === undefined || cycles.has(name) ? substitute(fallback) : own;
|
|
135
|
+
} finally {
|
|
136
|
+
history.delete(name);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Returns whether a value the element publishes differs from the one it published last
|
|
141
|
+
export function substituteOwnReferences(variables, ruleVariableNames, inlineVariables, previous, get) {
|
|
142
|
+
// Only inheriting values are rewritten, so a non-inheriting one still reads as declared
|
|
143
|
+
const ownValue = name => ruleVariableNames.has(name) || declaresInline(inlineVariables, name) ? variables[name] : undefined;
|
|
144
|
+
let changed = false;
|
|
145
|
+
|
|
146
|
+
// An inline vars() value is a value, never a reference, so only the rules' variables need rewriting
|
|
147
|
+
for (const name of ruleVariableNames) {
|
|
148
|
+
// Read without subscribing: if a later stylesheet flips `inherits` on a name this element publishes, the change is
|
|
149
|
+
// picked up only when the element next updates for another reason. In practice that matters only during Fast Refresh.
|
|
150
|
+
if (registeredInheritance(name).get()) {
|
|
151
|
+
const declared = variables[name];
|
|
152
|
+
const value = substituteOwnValues(declared, ownValue, get);
|
|
153
|
+
if (value !== declared) {
|
|
154
|
+
// The previous descriptor keeps descendants' guards holding while nothing changed
|
|
155
|
+
variables[name] = previous && isDeepEqual(previous[name], value) ? previous[name] : value;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
changed ||= previous?.[name] !== variables[name];
|
|
159
|
+
}
|
|
160
|
+
return changed;
|
|
161
|
+
}
|
|
162
|
+
function declaresInline(inlineVariables, name) {
|
|
163
|
+
for (const inlineVariable of inlineVariables) {
|
|
164
|
+
if (name in inlineVariable) {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
function withArguments(styleFunction, functionArguments) {
|
|
171
|
+
return styleFunction.length === 4 ? [styleFunction[0], styleFunction[1], functionArguments, styleFunction[3]] : [styleFunction[0], styleFunction[1], functionArguments];
|
|
172
|
+
}
|
|
173
|
+
function variableName(variableArguments) {
|
|
174
|
+
if (typeof variableArguments === "string") {
|
|
175
|
+
return variableArguments;
|
|
176
|
+
}
|
|
177
|
+
return isStyleDescriptorArray(variableArguments) && typeof variableArguments[0] === "string" ? variableArguments[0] : undefined;
|
|
178
|
+
}
|
|
179
|
+
function variableFallback(variableArguments) {
|
|
180
|
+
return isStyleDescriptorArray(variableArguments) ? variableArguments[1] : undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Marks only the actual cycle, so a variable that depends on it can still use its own fallback
|
|
184
|
+
function markCycle(history, name, cycles) {
|
|
185
|
+
let inCycle = false;
|
|
186
|
+
for (const dependency of history) {
|
|
187
|
+
if (dependency === name) inCycle = true;
|
|
188
|
+
if (inCycle) cycles.add(dependency);
|
|
72
189
|
}
|
|
73
|
-
return resolve(fallback);
|
|
74
190
|
}
|
|
75
191
|
//# sourceMappingURL=variables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["rootVariables","universalVariables","isStyleDescriptorArray","VAR_SYMBOL","varResolver","resolve","fn","get","options","renderGuards","inheritedVariables","variables","inlineVariables","variableHistory","Set","
|
|
1
|
+
{"version":3,"names":["registeredInheritance","registeredInitialValues","rootVariables","universalVariables","isDeepEqual","isStyleDescriptorArray","isStyleFunction","VAR_SYMBOL","varResolver","resolve","fn","get","options","renderGuards","inheritedVariables","variables","inlineVariables","variableHistory","Set","variableCycles","name","variableName","undefined","fallback","variableFallback","has","markCycle","add","value","inherits","push","rootValue","Array","isArray","substituteOwnValues","reference","delete","ownValue","history","cycles","substitute","descriptor","substituted","forEach","item","index","substitutedItem","substitutedArguments","withArguments","substitutedFallback","own","substituteOwnReferences","ruleVariableNames","previous","declaresInline","changed","declared","inlineVariable","styleFunction","functionArguments","length","variableArguments","inCycle","dependency"],"sourceRoot":"../../../../src","sources":["native/styles/variables.ts"],"mappings":";;AAKA,SACEA,qBAAqB,EACrBC,uBAAuB,EACvBC,aAAa,EACbC,kBAAkB,QACb,kCAAkC;A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,CAChBY,OAA4B,EAC5BlB,IAAY,EACZmB,MAAmB,EACnB;EACA,IAAIuB,OAAO,GAAG,KAAK;EACnB,KAAK,MAAMC,UAAU,IAAIzB,OAAO,EAAE;IAChC,IAAIyB,UAAU,KAAK3C,IAAI,EAAE0C,OAAO,GAAG,IAAI;IACvC,IAAIA,OAAO,EAAEvB,MAAM,CAACZ,GAAG,CAACoC,UAAU,CAAC;EACrC;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Platform, PlatformColor } from "react-native";
|
|
4
|
+
import { isDeepEqual } from "react-native-css/utilities";
|
|
4
5
|
import { testMediaQuery } from "../native/conditions/media-query.js";
|
|
5
6
|
import { family, observable } from "../native/reactivity.js";
|
|
6
7
|
const rootVariableFamily = () => {
|
|
@@ -20,11 +21,47 @@ const rootVariableFamily = () => {
|
|
|
20
21
|
return obs;
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
|
|
25
|
+
// Static, since the compiler records only the @property rules no condition wraps
|
|
26
|
+
const registeredInitialValueFamily = () => {
|
|
27
|
+
return family(() => observable(undefined, isDeepEqual));
|
|
28
|
+
};
|
|
29
|
+
const registeredInheritanceFamily = () => {
|
|
30
|
+
return family(() => observable(true));
|
|
31
|
+
};
|
|
32
|
+
function seedRootRegistry(root) {
|
|
33
|
+
root("__rn-css-rem").set([[14]]);
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
35
|
+
root("__rn-css-color").set([[Platform.OS === "ios" ? PlatformColor("label", "labelColor") : PlatformColor("?attr/textColorPrimary", "SystemBaseHighColor")]
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Seeded with the registries, so a copy that loads after the stylesheet inject keeps the project's rem
|
|
41
|
+
function createRootVariableRegistries() {
|
|
42
|
+
const registries = {
|
|
43
|
+
root: rootVariableFamily(),
|
|
44
|
+
universal: rootVariableFamily()
|
|
45
|
+
};
|
|
46
|
+
seedRootRegistry(registries.root);
|
|
47
|
+
return registries;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// The exports map gives import and require different builds, and Metro resolves each per requesting module
|
|
51
|
+
globalThis.__react_native_css_root_variable_registries ??= createRootVariableRegistries();
|
|
52
|
+
export const rootVariables = globalThis.__react_native_css_root_variable_registries.root;
|
|
53
|
+
export const universalVariables = globalThis.__react_native_css_root_variable_registries.universal;
|
|
54
|
+
globalThis.__react_native_css_registered_initial_values ??= registeredInitialValueFamily();
|
|
55
|
+
globalThis.__react_native_css_registered_inheritance ??= registeredInheritanceFamily();
|
|
56
|
+
export const registeredInitialValues = globalThis.__react_native_css_registered_initial_values;
|
|
57
|
+
export const registeredInheritance = globalThis.__react_native_css_registered_inheritance;
|
|
58
|
+
|
|
59
|
+
// Clearing suffices between tests, where nothing stays mounted to strand
|
|
60
|
+
export function resetVariableRegistries() {
|
|
61
|
+
rootVariables.clear();
|
|
62
|
+
universalVariables.clear();
|
|
63
|
+
registeredInitialValues.clear();
|
|
64
|
+
registeredInheritance.clear();
|
|
65
|
+
seedRootRegistry(rootVariables);
|
|
66
|
+
}
|
|
30
67
|
//# sourceMappingURL=root.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","PlatformColor","testMediaQuery","family","observable","rootVariableFamily","obs","read","variableValue","undefined","value","mediaQuery","
|
|
1
|
+
{"version":3,"names":["Platform","PlatformColor","isDeepEqual","testMediaQuery","family","observable","rootVariableFamily","obs","read","variableValue","undefined","value","mediaQuery","registeredInitialValueFamily","registeredInheritanceFamily","seedRootRegistry","root","set","OS","createRootVariableRegistries","registries","universal","globalThis","__react_native_css_root_variable_registries","rootVariables","universalVariables","__react_native_css_registered_initial_values","__react_native_css_registered_inheritance","registeredInitialValues","registeredInheritance","resetVariableRegistries","clear"],"sourceRoot":"../../../src","sources":["native-internal/root.ts"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,cAAc;AAGtD,SAASC,WAAW,QAAQ,4BAA4B;AAExD,SAASC,cAAc,QAAQ,qCAAkC;AACjE,SAASC,MAAM,EAAEC,UAAU,QAAyB,yBAAsB;AAE1E,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EAC/B,OAAOF,MAAM,CAAuD,MAAM;IACxE,MAAMG,GAAG,GAAGF,UAAU,CACpB,CAACG,IAAI,EAAEC,aAAa,KAAK;MACvB,IAAI,CAACA,aAAa,EAAE,OAAOC,SAAS;MAEpC,KAAK,MAAM,CAACC,KAAK,EAAEC,UAAU,CAAC,IAAIH,aAAa,EAAE;QAC/C,IAAI,CAACG,UAAU,EAAE;UACf,OAAOD,KAAK;QACd;QAEA,IAAIR,cAAc,CAACS,UAAU,EAAEJ,IAAI,CAAC,EAAE;UACpC,OAAOG,KAAK;QACd;MACF;MAEA,OAAOD,SAAS;IAClB,CACF,CAAC;IAED,OAAOH,GAAG;EACZ,CAAC,CAAC;AACJ,CAAC;;AAED;AACA,MAAMM,4BAA4B,GAAGA,CAAA,KAAM;EACzC,OAAOT,MAAM,CAAsC,MACjDC,UAAU,CAAkBK,SAAS,EAAER,WAAW,CACpD,CAAC;AACH,CAAC;AAED,MAAMY,2BAA2B,GAAGA,CAAA,KAAM;EACxC,OAAOV,MAAM,CAA8B,MAAMC,UAAU,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC;AAmBD,SAASU,gBAAgBA,CAACC,IAA2C,EAAE;EACrEA,IAAI,CAAC,cAAc,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAChC;EACAD,IAAI,CAAC,gBAAgB,CAAC,CAACC,GAAG,CAAC,CACzB,CACEjB,QAAQ,CAACkB,EAAE,KAAK,KAAK,GACjBjB,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,GACpCA,aAAa,CAAC,wBAAwB,EAAE,qBAAqB,CAAC;EAEpE;EAAA,CACM,CAAC;AACX;;AAEA;AACA,SAASkB,4BAA4BA,CAAA,EAA2B;EAC9D,MAAMC,UAAkC,GAAG;IACzCJ,IAAI,EAAEV,kBAAkB,CAAC,CAAC;IAC1Be,SAAS,EAAEf,kBAAkB,CAAC;EAChC,CAAC;EAEDS,gBAAgB,CAACK,UAAU,CAACJ,IAAI,CAAC;EAEjC,OAAOI,UAAU;AACnB;;AAEA;AACAE,UAAU,CAACC,2CAA2C,KACpDJ,4BAA4B,CAAC,CAAC;AAEhC,OAAO,MAAMK,aAAa,GACxBF,UAAU,CAACC,2CAA2C,CAACP,IAAI;AAC7D,OAAO,MAAMS,kBAAkB,GAC7BH,UAAU,CAACC,2CAA2C,CAACF,SAAS;AAElEC,UAAU,CAACI,4CAA4C,KACrDb,4BAA4B,CAAC,CAAC;AAChCS,UAAU,CAACK,yCAAyC,KAClDb,2BAA2B,CAAC,CAAC;AAE/B,OAAO,MAAMc,uBAAuB,GAClCN,UAAU,CAACI,4CAA4C;AAEzD,OAAO,MAAMG,qBAAqB,GAChCP,UAAU,CAACK,yCAAyC;;AAEtD;AACA,OAAO,SAASG,uBAAuBA,CAAA,EAAG;EACxCN,aAAa,CAACO,KAAK,CAAC,CAAC;EACrBN,kBAAkB,CAACM,KAAK,CAAC,CAAC;EAC1BH,uBAAuB,CAACG,KAAK,CAAC,CAAC;EAC/BF,qBAAqB,CAACE,KAAK,CAAC,CAAC;EAE7BhB,gBAAgB,CAACS,aAAa,CAAC;AACjC","ignoreList":[]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { isDeepEqual } from "react-native-css/utilities";
|
|
3
4
|
import { DEFAULT_CONTAINER_NAME } from "../native/conditions/container-query.js";
|
|
4
5
|
import { family, observable, observableBatch } from "../native/reactivity.js";
|
|
5
|
-
import { rootVariables, universalVariables } from "./root.js";
|
|
6
|
-
export { rootVariables, universalVariables };
|
|
6
|
+
import { registeredInheritance, registeredInitialValues, rootVariables, universalVariables } from "./root.js";
|
|
7
|
+
export { registeredInheritance, registeredInitialValues, rootVariables, universalVariables };
|
|
7
8
|
globalThis.__react_native_css_style_collection ??= {
|
|
8
9
|
styles: family(() => {
|
|
9
10
|
return observable([], isDeepEqual);
|
|
@@ -48,9 +49,15 @@ globalThis.__react_native_css_style_collection ??= {
|
|
|
48
49
|
}
|
|
49
50
|
if (options.vu) {
|
|
50
51
|
for (const entry of options.vu) {
|
|
51
|
-
|
|
52
|
+
universalVariables(entry[0]).set(entry[1]);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
// Added by name like vr and vu, since Metro injects each CSS file apart and a registration holds across them
|
|
57
|
+
for (const [name, inherits, initialValue] of options.vp ?? []) {
|
|
58
|
+
registeredInheritance(name).set(inherits);
|
|
59
|
+
registeredInitialValues(name).set(initialValue);
|
|
60
|
+
}
|
|
54
61
|
for (const effect of observableBatch.current) {
|
|
55
62
|
effect.run();
|
|
56
63
|
}
|
|
@@ -58,38 +65,4 @@ globalThis.__react_native_css_style_collection ??= {
|
|
|
58
65
|
}
|
|
59
66
|
};
|
|
60
67
|
export const StyleCollection = globalThis.__react_native_css_style_collection;
|
|
61
|
-
function isDeepEqual(a, b) {
|
|
62
|
-
const aArray = Array.isArray(a);
|
|
63
|
-
const bArray = Array.isArray(b);
|
|
64
|
-
const requiresKeyComparison = typeof a === "object" && typeof b === "object" && aArray === bArray;
|
|
65
|
-
|
|
66
|
-
// Only compare keys when both are an object or array
|
|
67
|
-
// This does not account for complex types like Date/Regex, because we don't use them
|
|
68
|
-
if (!requiresKeyComparison) return a === b;
|
|
69
|
-
|
|
70
|
-
// Make either are not null
|
|
71
|
-
if (!a || !b) {
|
|
72
|
-
return a === b;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Shortcut for arrays
|
|
76
|
-
if (aArray && bArray && a.length !== b.length) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Compare a to b
|
|
81
|
-
for (const key in a) {
|
|
82
|
-
if (!isDeepEqual(a[key], b[key])) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Compare b to a
|
|
88
|
-
for (const key in b) {
|
|
89
|
-
if (!(key in a)) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
94
|
-
}
|
|
95
68
|
//# sourceMappingURL=style-collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_CONTAINER_NAME","family","observable","observableBatch","rootVariables","universalVariables","globalThis","__react_native_css_style_collection","styles","
|
|
1
|
+
{"version":3,"names":["isDeepEqual","DEFAULT_CONTAINER_NAME","family","observable","observableBatch","registeredInheritance","registeredInitialValues","rootVariables","universalVariables","globalThis","__react_native_css_style_collection","styles","keyframes","inject","options","current","Set","StyleCollection","set","s","v","c","a","p","h","style","k","vr","entry","vu","name","inherits","initialValue","vp","effect","run","undefined"],"sourceRoot":"../../../src","sources":["native-internal/style-collection.ts"],"mappings":";;AAOA,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,sBAAsB,QAAQ,yCAAsC;AAC7E,SACEC,MAAM,EACNC,UAAU,EACVC,eAAe,QAGV,yBAAsB;AAC7B,SACEC,qBAAqB,EACrBC,uBAAuB,EACvBC,aAAa,EACbC,kBAAkB,QACb,WAAQ;AAEf,SACEH,qBAAqB,EACrBC,uBAAuB,EACvBC,aAAa,EACbC,kBAAkB;AAgBpBC,UAAU,CAACC,mCAAmC,KAAK;EACjDC,MAAM,EAAET,MAAM,CAAmC,MAAM;IACrD,OAAOC,UAAU,CAAC,EAAE,EAAEH,WAAW,CAAC;EACpC,CAAC,CAAC;EACFY,SAAS,EAAEV,MAAM,CAAmC,MAA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