react-native-css 3.0.0-nightly.4723140 → 3.0.0-nightly.61014be
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 +184 -1
- package/dist/commonjs/babel/allowedModules.js +23 -0
- package/dist/commonjs/babel/allowedModules.js.map +1 -0
- package/dist/commonjs/babel/helpers.js +18 -122
- package/dist/commonjs/babel/helpers.js.map +1 -1
- package/dist/commonjs/babel/import-plugin.js +62 -58
- package/dist/commonjs/babel/import-plugin.js.map +1 -1
- package/dist/commonjs/babel/react-native-web.js +118 -0
- package/dist/commonjs/babel/react-native-web.js.map +1 -0
- package/dist/commonjs/babel/react-native.js +118 -0
- package/dist/commonjs/babel/react-native.js.map +1 -0
- package/dist/commonjs/compiler/atRules.js +101 -0
- package/dist/commonjs/compiler/atRules.js.map +1 -0
- package/dist/commonjs/compiler/attributes.test.js +20 -0
- package/dist/commonjs/compiler/attributes.test.js.map +1 -0
- package/dist/commonjs/compiler/compiler.js +143 -344
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/compiler.types.js.map +1 -1
- package/dist/commonjs/compiler/container-query.js +10 -10
- package/dist/commonjs/compiler/container-query.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +1233 -988
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +78 -0
- package/dist/commonjs/compiler/inheritance.test.js.map +1 -0
- package/dist/commonjs/compiler/keyframes.js +15 -24
- package/dist/commonjs/compiler/keyframes.js.map +1 -1
- package/dist/commonjs/compiler/media-query.js +22 -22
- package/dist/commonjs/compiler/media-query.js.map +1 -1
- package/dist/commonjs/compiler/selectors.js +264 -184
- package/dist/commonjs/compiler/selectors.js.map +1 -1
- package/dist/commonjs/compiler/split-by-delimiter.js +21 -0
- package/dist/commonjs/compiler/split-by-delimiter.js.map +1 -0
- package/dist/commonjs/compiler/stylesheet.js +385 -0
- package/dist/commonjs/compiler/stylesheet.js.map +1 -0
- package/dist/commonjs/components/Text.js +2 -0
- package/dist/commonjs/components/Text.js.map +1 -1
- package/dist/commonjs/components/View.js +2 -0
- package/dist/commonjs/components/View.js.map +1 -1
- package/dist/commonjs/index.js +11 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/jest/index.js +2 -18
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +111 -50
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/metro/injection-code.js +24 -4
- package/dist/commonjs/metro/injection-code.js.map +1 -1
- package/dist/commonjs/metro/resolver.js +62 -0
- package/dist/commonjs/metro/resolver.js.map +1 -0
- package/dist/commonjs/metro/typescript.js +1 -1
- package/dist/commonjs/poison.pill.js +36 -0
- package/dist/commonjs/poison.pill.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/guards.js +10 -4
- package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +2 -0
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/index.js +11 -1
- package/dist/commonjs/runtime/native/index.js.map +1 -1
- package/dist/commonjs/runtime/native/injection.js +18 -0
- package/dist/commonjs/runtime/native/injection.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +23 -27
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +1 -5
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/animation.js +70 -72
- package/dist/commonjs/runtime/native/styles/animation.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/border.js +12 -0
- package/dist/commonjs/runtime/native/styles/border.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/box-shadow.js +40 -0
- package/dist/commonjs/runtime/native/styles/box-shadow.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calc.js +33 -61
- package/dist/commonjs/runtime/native/styles/calc.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/calculate-props.js +123 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/constants.js +2 -1
- package/dist/commonjs/runtime/native/styles/constants.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/filters.js +84 -0
- package/dist/commonjs/runtime/native/styles/filters.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/index.js +2 -110
- package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/platform-functions.js +46 -0
- package/dist/commonjs/runtime/native/styles/platform-functions.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/resolve.js +46 -13
- package/dist/commonjs/runtime/native/styles/resolve.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/shorthand.js +34 -17
- package/dist/commonjs/runtime/native/styles/shorthand.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/transform.js +9 -3
- package/dist/commonjs/runtime/native/styles/transform.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/units.js +7 -4
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +57 -36
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/utils/objects.js +18 -5
- package/dist/commonjs/runtime/utils/objects.js.map +1 -1
- package/dist/commonjs/runtime/utils/style-value.js +7 -0
- package/dist/commonjs/runtime/utils/style-value.js.map +1 -1
- package/dist/commonjs/runtime/web/index.js +1 -0
- package/dist/commonjs/runtime/web/index.js.map +1 -1
- package/dist/commonjs/runtime/web/metro.js +6 -0
- package/dist/commonjs/runtime/web/metro.js.map +1 -0
- package/dist/module/babel/allowedModules.js +19 -0
- package/dist/module/babel/allowedModules.js.map +1 -0
- package/dist/module/babel/helpers.js +17 -116
- package/dist/module/babel/helpers.js.map +1 -1
- package/dist/module/babel/import-plugin.js +63 -59
- package/dist/module/babel/import-plugin.js.map +1 -1
- package/dist/module/babel/react-native-web.js +112 -0
- package/dist/module/babel/react-native-web.js.map +1 -0
- package/dist/module/babel/react-native.js +112 -0
- package/dist/module/babel/react-native.js.map +1 -0
- package/dist/module/compiler/atRules.js +97 -0
- package/dist/module/compiler/atRules.js.map +1 -0
- package/dist/module/compiler/attributes.test.js +20 -0
- package/dist/module/compiler/attributes.test.js.map +1 -0
- package/dist/module/compiler/compiler.js +144 -345
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js +0 -12
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/container-query.js +10 -10
- package/dist/module/compiler/container-query.js.map +1 -1
- package/dist/module/compiler/declarations.js +1172 -992
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +78 -0
- package/dist/module/compiler/inheritance.test.js.map +1 -0
- package/dist/module/compiler/keyframes.js +15 -24
- package/dist/module/compiler/keyframes.js.map +1 -1
- package/dist/module/compiler/media-query.js +22 -22
- package/dist/module/compiler/media-query.js.map +1 -1
- package/dist/module/compiler/selectors.js +264 -184
- package/dist/module/compiler/selectors.js.map +1 -1
- package/dist/module/compiler/split-by-delimiter.js +17 -0
- package/dist/module/compiler/split-by-delimiter.js.map +1 -0
- package/dist/module/compiler/stylesheet.js +380 -0
- package/dist/module/compiler/stylesheet.js.map +1 -0
- package/dist/module/components/Text.js +1 -0
- package/dist/module/components/Text.js.map +1 -1
- package/dist/module/components/View.js +1 -0
- package/dist/module/components/View.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/jest/index.js +3 -3
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +111 -50
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/metro/injection-code.js +22 -3
- package/dist/module/metro/injection-code.js.map +1 -1
- package/dist/module/metro/resolver.js +57 -0
- package/dist/module/metro/resolver.js.map +1 -0
- package/dist/module/metro/typescript.js +1 -1
- package/dist/module/poison.pill.js +34 -0
- package/dist/module/poison.pill.js.map +1 -0
- package/dist/module/runtime/native/conditions/guards.js +10 -4
- package/dist/module/runtime/native/conditions/guards.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +2 -0
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/index.js +1 -2
- package/dist/module/runtime/native/index.js.map +1 -1
- package/dist/module/runtime/native/injection.js +18 -0
- package/dist/module/runtime/native/injection.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +22 -27
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +1 -5
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/styles/animation.js +68 -71
- package/dist/module/runtime/native/styles/animation.js.map +1 -1
- package/dist/module/runtime/native/styles/border.js +8 -0
- package/dist/module/runtime/native/styles/border.js.map +1 -0
- package/dist/module/runtime/native/styles/box-shadow.js +35 -0
- package/dist/module/runtime/native/styles/box-shadow.js.map +1 -0
- package/dist/module/runtime/native/styles/calc.js +33 -62
- package/dist/module/runtime/native/styles/calc.js.map +1 -1
- package/dist/module/runtime/native/styles/calculate-props.js +118 -0
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -0
- package/dist/module/runtime/native/styles/constants.js +1 -0
- package/dist/module/runtime/native/styles/constants.js.map +1 -1
- package/dist/module/runtime/native/styles/filters.js +70 -0
- package/dist/module/runtime/native/styles/filters.js.map +1 -0
- package/dist/module/runtime/native/styles/index.js +2 -110
- package/dist/module/runtime/native/styles/index.js.map +1 -1
- package/dist/module/runtime/native/styles/platform-functions.js +36 -0
- package/dist/module/runtime/native/styles/platform-functions.js.map +1 -0
- package/dist/module/runtime/native/styles/resolve.js +47 -14
- package/dist/module/runtime/native/styles/resolve.js.map +1 -1
- package/dist/module/runtime/native/styles/shorthand.js +34 -17
- package/dist/module/runtime/native/styles/shorthand.js.map +1 -1
- package/dist/module/runtime/native/styles/transform.js +9 -3
- package/dist/module/runtime/native/styles/transform.js.map +1 -1
- package/dist/module/runtime/native/styles/units.js +7 -4
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +57 -36
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/utils/objects.js +16 -4
- package/dist/module/runtime/utils/objects.js.map +1 -1
- package/dist/module/runtime/utils/style-value.js +6 -0
- package/dist/module/runtime/utils/style-value.js.map +1 -1
- package/dist/module/runtime/web/index.js +2 -0
- package/dist/module/runtime/web/index.js.map +1 -1
- package/dist/module/runtime/web/metro.js +5 -0
- package/dist/module/runtime/web/metro.js.map +1 -0
- package/dist/typescript/commonjs/example/app.config.d.ts +4 -0
- package/dist/typescript/commonjs/example/app.config.d.ts.map +1 -0
- package/dist/typescript/commonjs/example/src/App.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/babel/allowedModules.d.ts +2 -0
- package/dist/typescript/commonjs/src/babel/allowedModules.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/babel/helpers.d.ts +3 -8
- 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 +8 -0
- package/dist/typescript/commonjs/src/babel/react-native-web.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/babel/react-native.d.ts +8 -0
- package/dist/typescript/commonjs/src/babel/react-native.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts +34 -0
- package/dist/typescript/commonjs/src/compiler/atRules.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts +2 -0
- package/dist/typescript/commonjs/src/compiler/attributes.test.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +27 -108
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/container-query.d.ts +2 -2
- package/dist/typescript/commonjs/src/compiler/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +118 -25
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts +2 -0
- package/dist/typescript/commonjs/src/compiler/inheritance.test.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts +5 -4
- package/dist/typescript/commonjs/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts +4 -4
- package/dist/typescript/commonjs/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts +10 -5
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts +2 -0
- package/dist/typescript/commonjs/src/compiler/split-by-delimiter.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +54 -0
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/Text.d.ts +1 -1
- package/dist/typescript/commonjs/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/components/View.d.ts +1 -1
- package/dist/typescript/commonjs/src/components/View.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +2 -3
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts +5 -4
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts +15 -1
- package/dist/typescript/commonjs/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/resolver.d.ts +4 -0
- package/dist/typescript/commonjs/src/metro/resolver.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/poison.pill.d.ts +2 -0
- package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/api.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/index.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts +2 -1
- package/dist/typescript/commonjs/src/runtime/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts +3 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/animation.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/border.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts +3 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/box-shadow.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calc.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts +10 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts +12 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/filters.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts +3 -4
- package/dist/typescript/commonjs/src/runtime/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts +8 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/platform-functions.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts +6 -2
- package/dist/typescript/commonjs/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts +3 -4
- package/dist/typescript/commonjs/src/runtime/native/styles/shorthand.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/text-shadow.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/transform.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts +0 -15
- package/dist/typescript/commonjs/src/runtime/runtime.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/components.d.ts +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts +2 -1
- package/dist/typescript/commonjs/src/runtime/utils/objects.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts +3 -2
- package/dist/typescript/commonjs/src/runtime/utils/style-value.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/web/index.d.ts +1 -0
- package/dist/typescript/commonjs/src/runtime/web/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/web/metro.d.ts +2 -0
- package/dist/typescript/commonjs/src/runtime/web/metro.d.ts.map +1 -0
- package/dist/typescript/module/example/app.config.d.ts +4 -0
- package/dist/typescript/module/example/app.config.d.ts.map +1 -0
- package/dist/typescript/module/example/src/App.d.ts.map +1 -1
- package/dist/typescript/module/src/babel/allowedModules.d.ts +2 -0
- package/dist/typescript/module/src/babel/allowedModules.d.ts.map +1 -0
- package/dist/typescript/module/src/babel/helpers.d.ts +3 -8
- package/dist/typescript/module/src/babel/helpers.d.ts.map +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 +8 -0
- package/dist/typescript/module/src/babel/react-native-web.d.ts.map +1 -0
- package/dist/typescript/module/src/babel/react-native.d.ts +8 -0
- package/dist/typescript/module/src/babel/react-native.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/atRules.d.ts +34 -0
- package/dist/typescript/module/src/compiler/atRules.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/attributes.test.d.ts +2 -0
- package/dist/typescript/module/src/compiler/attributes.test.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/compiler.d.ts +1 -1
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +27 -108
- 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 +118 -25
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts +2 -0
- package/dist/typescript/module/src/compiler/inheritance.test.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/keyframes.d.ts +5 -4
- package/dist/typescript/module/src/compiler/keyframes.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/media-query.d.ts +4 -4
- package/dist/typescript/module/src/compiler/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selectors.d.ts +10 -5
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts +2 -0
- package/dist/typescript/module/src/compiler/split-by-delimiter.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +54 -0
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -0
- package/dist/typescript/module/src/components/Text.d.ts +1 -1
- package/dist/typescript/module/src/components/Text.d.ts.map +1 -1
- package/dist/typescript/module/src/components/View.d.ts +1 -1
- package/dist/typescript/module/src/components/View.d.ts.map +1 -1
- package/dist/typescript/module/src/index.d.ts +1 -0
- package/dist/typescript/module/src/index.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +2 -3
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts +5 -4
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/injection-code.d.ts +15 -1
- package/dist/typescript/module/src/metro/injection-code.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/resolver.d.ts +4 -0
- package/dist/typescript/module/src/metro/resolver.d.ts.map +1 -0
- package/dist/typescript/module/src/poison.pill.d.ts +2 -0
- package/dist/typescript/module/src/poison.pill.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/api.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/index.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts +2 -1
- package/dist/typescript/module/src/runtime/native/react/rules.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts +3 -2
- package/dist/typescript/module/src/runtime/native/styles/animation.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts +2 -0
- package/dist/typescript/module/src/runtime/native/styles/border.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts +3 -0
- package/dist/typescript/module/src/runtime/native/styles/box-shadow.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/calc.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts +10 -0
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/constants.d.ts +1 -0
- package/dist/typescript/module/src/runtime/native/styles/constants.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/filters.d.ts +12 -0
- package/dist/typescript/module/src/runtime/native/styles/filters.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/index.d.ts +3 -4
- package/dist/typescript/module/src/runtime/native/styles/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts +8 -0
- package/dist/typescript/module/src/runtime/native/styles/platform-functions.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts +6 -2
- package/dist/typescript/module/src/runtime/native/styles/resolve.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts +3 -4
- package/dist/typescript/module/src/runtime/native/styles/shorthand.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/styles/text-shadow.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/transform.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/units.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/styles/variables.d.ts +1 -1
- package/dist/typescript/module/src/runtime/native/styles/variables.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/runtime.types.d.ts +0 -15
- package/dist/typescript/module/src/runtime/runtime.types.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/utils/components.d.ts +1 -1
- package/dist/typescript/module/src/runtime/utils/objects.d.ts +2 -1
- package/dist/typescript/module/src/runtime/utils/objects.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/utils/style-value.d.ts +3 -2
- package/dist/typescript/module/src/runtime/utils/style-value.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/web/index.d.ts +1 -0
- package/dist/typescript/module/src/runtime/web/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/web/metro.d.ts +2 -0
- package/dist/typescript/module/src/runtime/web/metro.d.ts.map +1 -0
- package/package.json +67 -13
- package/src/babel/allowedModules.ts +24 -0
- package/src/babel/helpers.ts +16 -158
- package/src/babel/import-plugin.ts +125 -132
- package/src/babel/react-native-web.ts +226 -0
- package/src/babel/react-native.ts +226 -0
- package/src/compiler/atRules.ts +144 -0
- package/src/compiler/attributes.test.ts +28 -0
- package/src/compiler/compiler.ts +154 -482
- package/src/compiler/compiler.types.ts +30 -135
- package/src/compiler/container-query.ts +12 -12
- package/src/compiler/declarations.ts +1789 -1971
- package/src/compiler/inheritance.test.ts +121 -0
- package/src/compiler/keyframes.ts +28 -42
- package/src/compiler/media-query.ts +27 -26
- package/src/compiler/selectors.ts +289 -271
- package/src/compiler/split-by-delimiter.ts +19 -0
- package/src/compiler/stylesheet.ts +546 -0
- package/src/components/Text.tsx +2 -0
- package/src/components/View.tsx +2 -0
- package/src/index.ts +2 -0
- package/src/jest/index.ts +6 -5
- package/src/metro/index.ts +161 -64
- package/src/metro/injection-code.ts +33 -3
- package/src/metro/resolver.ts +89 -0
- package/src/metro/typescript.ts +1 -1
- package/src/poison.pill.ts +32 -0
- package/src/runtime/native/conditions/guards.ts +12 -4
- package/src/runtime/native/conditions/media-query.ts +2 -0
- package/src/runtime/native/index.ts +1 -2
- package/src/runtime/native/injection.ts +30 -0
- package/src/runtime/native/react/rules.ts +26 -33
- package/src/runtime/native/reactivity.ts +3 -7
- package/src/runtime/native/styles/animation.ts +143 -104
- package/src/runtime/native/styles/border.ts +10 -0
- package/src/runtime/native/styles/box-shadow.ts +54 -0
- package/src/runtime/native/styles/calc.ts +37 -60
- package/src/runtime/native/styles/calculate-props.ts +165 -0
- package/src/runtime/native/styles/constants.ts +1 -0
- package/src/runtime/native/styles/filters.ts +98 -0
- package/src/runtime/native/styles/index.ts +2 -138
- package/src/runtime/native/styles/platform-functions.ts +50 -0
- package/src/runtime/native/styles/resolve.ts +91 -17
- package/src/runtime/native/styles/shorthand.ts +61 -41
- package/src/runtime/native/styles/transform.ts +10 -4
- package/src/runtime/native/styles/units.ts +9 -4
- package/src/runtime/native/styles/variables.ts +51 -35
- package/src/runtime/runtime.types.ts +0 -25
- package/src/runtime/utils/objects.ts +20 -5
- package/src/runtime/utils/style-value.ts +14 -2
- package/src/runtime/web/index.ts +3 -0
- package/src/runtime/web/metro.ts +2 -0
- package/types.d.ts +70 -0
- package/dist/commonjs/compiler/add.js +0 -175
- package/dist/commonjs/compiler/add.js.map +0 -1
- package/dist/commonjs/components/ActivityIndicator.js +0 -20
- package/dist/commonjs/components/ActivityIndicator.js.map +0 -1
- package/dist/commonjs/components/SafeAreaProvider/index.js +0 -41
- package/dist/commonjs/components/SafeAreaProvider/index.js.map +0 -1
- package/dist/commonjs/components/SafeAreaProvider/index.web.js +0 -13
- package/dist/commonjs/components/SafeAreaProvider/index.web.js.map +0 -1
- package/dist/commonjs/components/TextInput.js +0 -20
- package/dist/commonjs/components/TextInput.js.map +0 -1
- package/dist/module/compiler/add.js +0 -168
- package/dist/module/compiler/add.js.map +0 -1
- package/dist/module/components/ActivityIndicator.js +0 -16
- package/dist/module/components/ActivityIndicator.js.map +0 -1
- package/dist/module/components/SafeAreaProvider/index.js +0 -36
- package/dist/module/components/SafeAreaProvider/index.js.map +0 -1
- package/dist/module/components/SafeAreaProvider/index.web.js +0 -4
- package/dist/module/components/SafeAreaProvider/index.web.js.map +0 -1
- package/dist/module/components/TextInput.js +0 -16
- package/dist/module/components/TextInput.js.map +0 -1
- package/dist/typescript/commonjs/src/compiler/add.d.ts +0 -10
- package/dist/typescript/commonjs/src/compiler/add.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts +0 -3
- package/dist/typescript/commonjs/src/components/ActivityIndicator.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.d.ts +0 -4
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.web.d.ts +0 -2
- package/dist/typescript/commonjs/src/components/SafeAreaProvider/index.web.d.ts.map +0 -1
- package/dist/typescript/commonjs/src/components/TextInput.d.ts +0 -13
- package/dist/typescript/commonjs/src/components/TextInput.d.ts.map +0 -1
- package/dist/typescript/module/src/compiler/add.d.ts +0 -10
- package/dist/typescript/module/src/compiler/add.d.ts.map +0 -1
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts +0 -3
- package/dist/typescript/module/src/components/ActivityIndicator.d.ts.map +0 -1
- package/dist/typescript/module/src/components/SafeAreaProvider/index.d.ts +0 -4
- package/dist/typescript/module/src/components/SafeAreaProvider/index.d.ts.map +0 -1
- package/dist/typescript/module/src/components/SafeAreaProvider/index.web.d.ts +0 -2
- package/dist/typescript/module/src/components/SafeAreaProvider/index.web.d.ts.map +0 -1
- package/dist/typescript/module/src/components/TextInput.d.ts +0 -13
- package/dist/typescript/module/src/components/TextInput.d.ts.map +0 -1
- package/src/compiler/add.ts +0 -257
- package/src/components/ActivityIndicator.tsx +0 -19
- package/src/components/SafeAreaProvider/index.tsx +0 -50
- package/src/components/SafeAreaProvider/index.web.tsx +0 -1
- package/src/components/TextInput.tsx +0 -20
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { compile } from "../compiler";
|
|
2
|
+
|
|
3
|
+
test("nested classes", () => {
|
|
4
|
+
const compiled = compile(`
|
|
5
|
+
.my-class .test {
|
|
6
|
+
color: red;
|
|
7
|
+
}`);
|
|
8
|
+
|
|
9
|
+
expect(compiled).toStrictEqual({
|
|
10
|
+
s: [
|
|
11
|
+
[
|
|
12
|
+
"my-class",
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
c: ["my-class"],
|
|
16
|
+
s: [0],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"test",
|
|
22
|
+
[
|
|
23
|
+
{
|
|
24
|
+
cq: [{ n: "my-class" }],
|
|
25
|
+
d: [{ color: "#f00" }],
|
|
26
|
+
v: [["__rn-css-color", "#f00"]],
|
|
27
|
+
s: [1, 2],
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
],
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("multiple tiers classes", () => {
|
|
36
|
+
const compiled = compile(`
|
|
37
|
+
.one .two .test {
|
|
38
|
+
color: red;
|
|
39
|
+
}`);
|
|
40
|
+
|
|
41
|
+
expect(compiled).toStrictEqual({
|
|
42
|
+
s: [
|
|
43
|
+
[
|
|
44
|
+
"one",
|
|
45
|
+
[
|
|
46
|
+
{
|
|
47
|
+
c: ["one"],
|
|
48
|
+
s: [0],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"two",
|
|
54
|
+
[
|
|
55
|
+
{
|
|
56
|
+
c: ["two"],
|
|
57
|
+
s: [0],
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
"test",
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
cq: [{ n: "one" }, { n: "two" }],
|
|
66
|
+
d: [{ color: "#f00" }],
|
|
67
|
+
v: [["__rn-css-color", "#f00"]],
|
|
68
|
+
s: [1, 3],
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
],
|
|
72
|
+
],
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test("tiers with multiple classes", () => {
|
|
77
|
+
const compiled = compile(`
|
|
78
|
+
.one .two.three .test {
|
|
79
|
+
color: red;
|
|
80
|
+
}`);
|
|
81
|
+
|
|
82
|
+
expect(compiled).toStrictEqual({
|
|
83
|
+
s: [
|
|
84
|
+
[
|
|
85
|
+
"one",
|
|
86
|
+
[
|
|
87
|
+
{
|
|
88
|
+
c: ["one"],
|
|
89
|
+
s: [0],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
"three",
|
|
95
|
+
[
|
|
96
|
+
{
|
|
97
|
+
c: ["three"],
|
|
98
|
+
s: [0],
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
],
|
|
102
|
+
[
|
|
103
|
+
"test",
|
|
104
|
+
[
|
|
105
|
+
{
|
|
106
|
+
cq: [
|
|
107
|
+
{ n: "one" },
|
|
108
|
+
{
|
|
109
|
+
a: [["a", "className", "*=", "two"]],
|
|
110
|
+
n: "three",
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
d: [{ color: "#f00" }],
|
|
114
|
+
v: [["__rn-css-color", "#f00"]],
|
|
115
|
+
s: [1, 4],
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
],
|
|
119
|
+
],
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
import type {
|
|
3
2
|
AnimationIterationCount,
|
|
4
3
|
EasingFunction as CSSEasingFunction,
|
|
5
|
-
Declaration,
|
|
6
4
|
KeyframesRule,
|
|
7
5
|
} from "lightningcss";
|
|
8
6
|
|
|
9
|
-
import {
|
|
10
|
-
import type {
|
|
11
|
-
AnimationKeyframes_V2,
|
|
12
|
-
CompilerCollection,
|
|
13
|
-
EasingFunction,
|
|
14
|
-
StyleDeclaration,
|
|
15
|
-
} from "./compiler.types";
|
|
7
|
+
import type { StyleDescriptor } from "./compiler.types";
|
|
16
8
|
import { parseDeclaration } from "./declarations";
|
|
9
|
+
import type { StylesheetBuilder } from "./stylesheet";
|
|
17
10
|
|
|
18
11
|
export function parseIterationCount(
|
|
19
12
|
value: AnimationIterationCount[],
|
|
@@ -25,8 +18,8 @@ export function parseIterationCount(
|
|
|
25
18
|
|
|
26
19
|
export function parseEasingFunction(
|
|
27
20
|
value: CSSEasingFunction[],
|
|
28
|
-
):
|
|
29
|
-
|
|
21
|
+
): StyleDescriptor {
|
|
22
|
+
const easingFn = value.map((value) => {
|
|
30
23
|
switch (value.type) {
|
|
31
24
|
case "linear":
|
|
32
25
|
case "ease":
|
|
@@ -35,29 +28,28 @@ export function parseEasingFunction(
|
|
|
35
28
|
case "ease-in-out":
|
|
36
29
|
return value.type;
|
|
37
30
|
case "cubic-bezier":
|
|
38
|
-
return
|
|
31
|
+
return [
|
|
32
|
+
{},
|
|
33
|
+
"cubic-bezier",
|
|
34
|
+
[value.x1, value.y1, value.x2, value.y2],
|
|
35
|
+
] as const;
|
|
39
36
|
case "steps":
|
|
40
|
-
return {
|
|
41
|
-
type: "steps",
|
|
42
|
-
c: value.count,
|
|
43
|
-
p: value.position?.type,
|
|
44
|
-
};
|
|
37
|
+
return [{}, "steps", [value.count, value.position?.type]] as const;
|
|
45
38
|
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
39
|
+
}) as StyleDescriptor[];
|
|
48
40
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return extractKeyFrames_v2(keyframes, collection);
|
|
41
|
+
if (easingFn.length === 1) {
|
|
42
|
+
return easingFn[0];
|
|
43
|
+
}
|
|
44
|
+
return easingFn;
|
|
54
45
|
}
|
|
55
46
|
|
|
56
|
-
function
|
|
57
|
-
keyframes: KeyframesRule
|
|
58
|
-
|
|
47
|
+
export function extractKeyFrames(
|
|
48
|
+
keyframes: KeyframesRule,
|
|
49
|
+
builder: StylesheetBuilder,
|
|
59
50
|
) {
|
|
60
|
-
|
|
51
|
+
builder = builder.fork("keyframes");
|
|
52
|
+
builder.newAnimationFrames(keyframes.name.value);
|
|
61
53
|
|
|
62
54
|
for (const frame of keyframes.keyframes) {
|
|
63
55
|
if (!frame.declarations.declarations) continue;
|
|
@@ -66,7 +58,7 @@ function extractKeyFrames_v2(
|
|
|
66
58
|
switch (selector.type) {
|
|
67
59
|
case "percentage":
|
|
68
60
|
return frame.selectors.length > 1
|
|
69
|
-
? `${selector.value}%`
|
|
61
|
+
? `${selector.value * 100}%`
|
|
70
62
|
: selector.value;
|
|
71
63
|
case "from":
|
|
72
64
|
case "to":
|
|
@@ -79,22 +71,16 @@ function extractKeyFrames_v2(
|
|
|
79
71
|
}
|
|
80
72
|
});
|
|
81
73
|
|
|
82
|
-
const
|
|
83
|
-
const
|
|
74
|
+
const firstSelector = selectors[0];
|
|
75
|
+
const progress =
|
|
76
|
+
firstSelector && selectors.length === 1
|
|
77
|
+
? firstSelector.toString()
|
|
78
|
+
: selectors.join(", ");
|
|
84
79
|
|
|
85
|
-
|
|
86
|
-
selectors.length > 1
|
|
87
|
-
? [selectors.join(", "), []]
|
|
88
|
-
: [selectors[0]!, declarations];
|
|
80
|
+
builder.newAnimationFrame(progress);
|
|
89
81
|
|
|
90
82
|
for (const declaration of frame.declarations.declarations) {
|
|
91
|
-
parseDeclaration(declaration,
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (declarations.length > 0) {
|
|
95
|
-
animation.push(currentFrame);
|
|
83
|
+
parseDeclaration(declaration, builder);
|
|
96
84
|
}
|
|
97
85
|
}
|
|
98
|
-
|
|
99
|
-
collection.keyframes.set(keyframes.name.value, animation);
|
|
100
86
|
}
|
|
@@ -13,12 +13,13 @@ import type {
|
|
|
13
13
|
MediaFeatureComparison,
|
|
14
14
|
StyleDescriptor,
|
|
15
15
|
} from "./compiler.types";
|
|
16
|
-
import { parseLength
|
|
16
|
+
import { parseLength } from "./declarations";
|
|
17
|
+
import type { StylesheetBuilder } from "./stylesheet";
|
|
17
18
|
|
|
18
19
|
export function parseMediaQuery(
|
|
19
20
|
query: CSSMediaQuery,
|
|
20
|
-
|
|
21
|
-
)
|
|
21
|
+
builder: StylesheetBuilder,
|
|
22
|
+
) {
|
|
22
23
|
let platformCondition: MediaCondition | undefined;
|
|
23
24
|
let condition: MediaCondition | undefined;
|
|
24
25
|
|
|
@@ -35,7 +36,7 @@ export function parseMediaQuery(
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
if (query.condition) {
|
|
38
|
-
condition = parseMediaQueryCondition(query.condition,
|
|
39
|
+
condition = parseMediaQueryCondition(query.condition, builder);
|
|
39
40
|
|
|
40
41
|
// If any of these are undefined, the media query is invalid
|
|
41
42
|
if (!condition || condition.some((v) => v === undefined)) {
|
|
@@ -56,22 +57,22 @@ export function parseMediaQuery(
|
|
|
56
57
|
mediaQuery = ["!", mediaQuery];
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
builder.addMediaQuery(mediaQuery);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function parseMediaQueryCondition(
|
|
63
64
|
query: CSSMediaCondition,
|
|
64
|
-
|
|
65
|
+
builder: StylesheetBuilder,
|
|
65
66
|
): MediaCondition | undefined {
|
|
66
67
|
switch (query.type) {
|
|
67
68
|
case "feature":
|
|
68
|
-
return parseFeature(query.value,
|
|
69
|
+
return parseFeature(query.value, builder);
|
|
69
70
|
case "not":
|
|
70
|
-
const mediaQuery = parseMediaQueryCondition(query.value,
|
|
71
|
+
const mediaQuery = parseMediaQueryCondition(query.value, builder);
|
|
71
72
|
return mediaQuery ? ["!", mediaQuery] : undefined;
|
|
72
73
|
case "operation":
|
|
73
74
|
const mediaQueries = query.conditions
|
|
74
|
-
.map((c) => parseMediaQueryCondition(c,
|
|
75
|
+
.map((c) => parseMediaQueryCondition(c, builder))
|
|
75
76
|
.filter((v): v is MediaCondition => !!v);
|
|
76
77
|
|
|
77
78
|
if (mediaQueries.length === 0) {
|
|
@@ -96,7 +97,7 @@ function parseMediaQueryCondition(
|
|
|
96
97
|
|
|
97
98
|
function parseFeature(
|
|
98
99
|
feature: QueryFeatureFor_MediaFeatureId,
|
|
99
|
-
|
|
100
|
+
builder: StylesheetBuilder,
|
|
100
101
|
): MediaCondition | undefined {
|
|
101
102
|
switch (feature.type) {
|
|
102
103
|
case "boolean":
|
|
@@ -105,21 +106,21 @@ function parseFeature(
|
|
|
105
106
|
return [
|
|
106
107
|
"=",
|
|
107
108
|
feature.name,
|
|
108
|
-
parseMediaFeatureValue(feature.value,
|
|
109
|
+
parseMediaFeatureValue(feature.value, builder),
|
|
109
110
|
];
|
|
110
111
|
case "range":
|
|
111
112
|
return [
|
|
112
113
|
parseMediaFeatureOperator(feature.operator),
|
|
113
114
|
feature.name,
|
|
114
|
-
parseMediaFeatureValue(feature.value,
|
|
115
|
+
parseMediaFeatureValue(feature.value, builder),
|
|
115
116
|
];
|
|
116
117
|
case "interval":
|
|
117
118
|
return [
|
|
118
119
|
"[]",
|
|
119
120
|
feature.name,
|
|
120
|
-
parseMediaFeatureValue(feature.start,
|
|
121
|
+
parseMediaFeatureValue(feature.start, builder),
|
|
121
122
|
parseMediaFeatureOperator(feature.startOperator),
|
|
122
|
-
parseMediaFeatureValue(feature.end,
|
|
123
|
+
parseMediaFeatureValue(feature.end, builder),
|
|
123
124
|
parseMediaFeatureOperator(feature.endOperator),
|
|
124
125
|
];
|
|
125
126
|
default:
|
|
@@ -130,7 +131,7 @@ function parseFeature(
|
|
|
130
131
|
|
|
131
132
|
export function parseMediaFeatureValue(
|
|
132
133
|
value: CSSMediaFeatureValue,
|
|
133
|
-
|
|
134
|
+
builder: StylesheetBuilder,
|
|
134
135
|
): StyleDescriptor {
|
|
135
136
|
switch (value.type) {
|
|
136
137
|
case "boolean":
|
|
@@ -141,9 +142,9 @@ export function parseMediaFeatureValue(
|
|
|
141
142
|
case "length":
|
|
142
143
|
switch (value.value.type) {
|
|
143
144
|
case "value":
|
|
144
|
-
return parseLength(value.value.value,
|
|
145
|
+
return parseLength(value.value.value, builder);
|
|
145
146
|
case "calc":
|
|
146
|
-
return parseCalcFn(value.value.value,
|
|
147
|
+
return parseCalcFn(value.value.value, builder);
|
|
147
148
|
default:
|
|
148
149
|
value.value satisfies never;
|
|
149
150
|
return;
|
|
@@ -191,25 +192,25 @@ export function parseMediaFeatureOperator(
|
|
|
191
192
|
|
|
192
193
|
function parseCalcFn(
|
|
193
194
|
calc: CalcFor_Length,
|
|
194
|
-
|
|
195
|
+
builder: StylesheetBuilder,
|
|
195
196
|
): StyleDescriptor {
|
|
196
197
|
switch (calc.type) {
|
|
197
198
|
case "number":
|
|
198
199
|
return calc.value;
|
|
199
200
|
case "value":
|
|
200
|
-
return parseLength(calc.value,
|
|
201
|
+
return parseLength(calc.value, builder);
|
|
201
202
|
case "sum":
|
|
202
|
-
return [{}, "sum", calc.value.map((c) => parseCalcFn(c,
|
|
203
|
+
return [{}, "sum", calc.value.map((c) => parseCalcFn(c, builder))];
|
|
203
204
|
case "product":
|
|
204
205
|
return [
|
|
205
206
|
{},
|
|
206
207
|
"product",
|
|
207
|
-
[calc.value[0], parseCalcFn(calc.value[1],
|
|
208
|
+
[calc.value[0], parseCalcFn(calc.value[1], builder)],
|
|
208
209
|
];
|
|
209
210
|
case "function":
|
|
210
211
|
switch (calc.value.type) {
|
|
211
212
|
case "calc":
|
|
212
|
-
return parseCalcFn(calc.value.value,
|
|
213
|
+
return parseCalcFn(calc.value.value, builder);
|
|
213
214
|
case "min":
|
|
214
215
|
case "max":
|
|
215
216
|
case "clamp":
|
|
@@ -219,14 +220,14 @@ function parseCalcFn(
|
|
|
219
220
|
return [
|
|
220
221
|
{},
|
|
221
222
|
calc.value.type,
|
|
222
|
-
calc.value.value.map((c) => parseCalcFn(c,
|
|
223
|
+
calc.value.value.map((c) => parseCalcFn(c, builder)),
|
|
223
224
|
];
|
|
224
225
|
case "abs":
|
|
225
226
|
case "sign":
|
|
226
227
|
return [
|
|
227
228
|
{},
|
|
228
229
|
calc.value.type,
|
|
229
|
-
[parseCalcFn(calc.value.value,
|
|
230
|
+
[parseCalcFn(calc.value.value, builder)],
|
|
230
231
|
];
|
|
231
232
|
case "round":
|
|
232
233
|
return [
|
|
@@ -234,8 +235,8 @@ function parseCalcFn(
|
|
|
234
235
|
calc.value.type,
|
|
235
236
|
[
|
|
236
237
|
calc.value.value[0],
|
|
237
|
-
parseCalcFn(calc.value.value[1],
|
|
238
|
-
parseCalcFn(calc.value.value[2],
|
|
238
|
+
parseCalcFn(calc.value.value[1], builder),
|
|
239
|
+
parseCalcFn(calc.value.value[2], builder),
|
|
239
240
|
],
|
|
240
241
|
];
|
|
241
242
|
default:
|