react-native-css 3.0.0-nightly.27bd5e2 → 3.0.0-nightly.4af17f5
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/dist/commonjs/compiler/atRules.js +6 -2
- package/dist/commonjs/compiler/atRules.js.map +1 -1
- package/dist/commonjs/compiler/attributes.test.js +1 -1
- package/dist/commonjs/compiler/attributes.test.js.map +1 -1
- package/dist/commonjs/compiler/compiler.js +57 -18
- package/dist/commonjs/compiler/compiler.js.map +1 -1
- package/dist/commonjs/compiler/declarations.js +177 -74
- package/dist/commonjs/compiler/declarations.js.map +1 -1
- package/dist/commonjs/compiler/inheritance.test.js +7 -7
- package/dist/commonjs/compiler/inheritance.test.js.map +1 -1
- package/dist/commonjs/compiler/selector-builder.js +457 -0
- package/dist/commonjs/compiler/selector-builder.js.map +1 -0
- package/dist/commonjs/compiler/selectors.js +10 -6
- package/dist/commonjs/compiler/selectors.js.map +1 -1
- package/dist/commonjs/compiler/stylesheet.js +125 -40
- package/dist/commonjs/compiler/stylesheet.js.map +1 -1
- package/dist/commonjs/jest/index.js +24 -25
- package/dist/commonjs/jest/index.js.map +1 -1
- package/dist/commonjs/metro/index.js +7 -5
- package/dist/commonjs/metro/index.js.map +1 -1
- package/dist/commonjs/poison.pill.js +4 -1
- package/dist/commonjs/poison.pill.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/attributes.js +42 -0
- package/dist/commonjs/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/commonjs/runtime/native/conditions/container-query.js +28 -21
- package/dist/commonjs/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/guards.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/index.js +10 -46
- package/dist/commonjs/runtime/native/conditions/index.js.map +1 -1
- package/dist/commonjs/runtime/native/conditions/media-query.js +17 -17
- package/dist/commonjs/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/commonjs/runtime/native/injection.js +3 -2
- package/dist/commonjs/runtime/native/injection.js.map +1 -1
- package/dist/commonjs/runtime/native/react/interaction.js +10 -10
- package/dist/commonjs/runtime/native/react/interaction.js.map +1 -1
- package/dist/commonjs/runtime/native/react/rules.js +9 -9
- package/dist/commonjs/runtime/native/react/rules.js.map +1 -1
- package/dist/commonjs/runtime/native/react/useNativeCss.js +1 -0
- package/dist/commonjs/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/commonjs/runtime/native/reactivity.js +1 -12
- package/dist/commonjs/runtime/native/reactivity.js.map +1 -1
- package/dist/commonjs/runtime/native/root.js +28 -0
- package/dist/commonjs/runtime/native/root.js.map +1 -0
- package/dist/commonjs/runtime/native/styles/calculate-props.js +53 -48
- package/dist/commonjs/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/index.js +12 -12
- package/dist/commonjs/runtime/native/styles/index.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/units.js +6 -3
- package/dist/commonjs/runtime/native/styles/units.js.map +1 -1
- package/dist/commonjs/runtime/native/styles/variables.js +3 -2
- package/dist/commonjs/runtime/native/styles/variables.js.map +1 -1
- package/dist/commonjs/runtime/utils/specificity.js +2 -1
- package/dist/commonjs/runtime/utils/specificity.js.map +1 -1
- package/dist/module/compiler/atRules.js +6 -2
- package/dist/module/compiler/atRules.js.map +1 -1
- package/dist/module/compiler/attributes.test.js +1 -1
- package/dist/module/compiler/attributes.test.js.map +1 -1
- package/dist/module/compiler/compiler.js +57 -18
- package/dist/module/compiler/compiler.js.map +1 -1
- package/dist/module/compiler/compiler.types.js.map +1 -1
- package/dist/module/compiler/declarations.js +172 -70
- package/dist/module/compiler/declarations.js.map +1 -1
- package/dist/module/compiler/inheritance.test.js +7 -7
- package/dist/module/compiler/inheritance.test.js.map +1 -1
- package/dist/module/compiler/selector-builder.js +452 -0
- package/dist/module/compiler/selector-builder.js.map +1 -0
- package/dist/module/compiler/selectors.js +10 -6
- package/dist/module/compiler/selectors.js.map +1 -1
- package/dist/module/compiler/stylesheet.js +124 -39
- package/dist/module/compiler/stylesheet.js.map +1 -1
- package/dist/module/jest/index.js +25 -10
- package/dist/module/jest/index.js.map +1 -1
- package/dist/module/metro/index.js +7 -5
- package/dist/module/metro/index.js.map +1 -1
- package/dist/module/poison.pill.js +4 -1
- package/dist/module/poison.pill.js.map +1 -1
- package/dist/module/runtime/native/conditions/attributes.js +38 -0
- package/dist/module/runtime/native/conditions/attributes.js.map +1 -0
- package/dist/module/runtime/native/conditions/container-query.js +28 -21
- package/dist/module/runtime/native/conditions/container-query.js.map +1 -1
- package/dist/module/runtime/native/conditions/guards.js.map +1 -1
- package/dist/module/runtime/native/conditions/index.js +10 -46
- package/dist/module/runtime/native/conditions/index.js.map +1 -1
- package/dist/module/runtime/native/conditions/media-query.js +17 -17
- package/dist/module/runtime/native/conditions/media-query.js.map +1 -1
- package/dist/module/runtime/native/injection.js +2 -1
- package/dist/module/runtime/native/injection.js.map +1 -1
- package/dist/module/runtime/native/react/interaction.js +10 -10
- package/dist/module/runtime/native/react/interaction.js.map +1 -1
- package/dist/module/runtime/native/react/rules.js +9 -9
- package/dist/module/runtime/native/react/rules.js.map +1 -1
- package/dist/module/runtime/native/react/useNativeCss.js +1 -0
- package/dist/module/runtime/native/react/useNativeCss.js.map +1 -1
- package/dist/module/runtime/native/reactivity.js +0 -11
- package/dist/module/runtime/native/reactivity.js.map +1 -1
- package/dist/module/runtime/native/root.js +24 -0
- package/dist/module/runtime/native/root.js.map +1 -0
- package/dist/module/runtime/native/styles/calculate-props.js +53 -48
- package/dist/module/runtime/native/styles/calculate-props.js.map +1 -1
- package/dist/module/runtime/native/styles/index.js +12 -12
- package/dist/module/runtime/native/styles/index.js.map +1 -1
- package/dist/module/runtime/native/styles/units.js +6 -3
- package/dist/module/runtime/native/styles/units.js.map +1 -1
- package/dist/module/runtime/native/styles/variables.js +2 -1
- package/dist/module/runtime/native/styles/variables.js.map +1 -1
- package/dist/module/runtime/utils/specificity.js +2 -1
- package/dist/module/runtime/utils/specificity.js.map +1 -1
- 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/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/commonjs/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts +5 -4
- package/dist/typescript/commonjs/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts +16 -19
- package/dist/typescript/commonjs/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts +23 -0
- package/dist/typescript/commonjs/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/commonjs/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts +23 -5
- package/dist/typescript/commonjs/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/jest/index.d.ts +11 -5
- package/dist/typescript/commonjs/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/poison.pill.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts +3 -3
- package/dist/typescript/commonjs/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/injection.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/commonjs/src/runtime/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts +2 -1
- package/dist/typescript/commonjs/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts +2 -10
- package/dist/typescript/commonjs/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/commonjs/src/runtime/native/root.d.ts +11 -0
- package/dist/typescript/commonjs/src/runtime/native/root.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/runtime/native/styles/calculate-props.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.map +1 -1
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts +1 -0
- package/dist/typescript/commonjs/src/runtime/utils/specificity.d.ts.map +1 -1
- 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/src/compiler/compiler.d.ts +9 -2
- package/dist/typescript/module/src/compiler/compiler.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/compiler.types.d.ts +5 -4
- package/dist/typescript/module/src/compiler/compiler.types.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/declarations.d.ts +16 -19
- package/dist/typescript/module/src/compiler/declarations.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/selector-builder.d.ts +23 -0
- package/dist/typescript/module/src/compiler/selector-builder.d.ts.map +1 -0
- package/dist/typescript/module/src/compiler/selectors.d.ts +3 -2
- package/dist/typescript/module/src/compiler/selectors.d.ts.map +1 -1
- package/dist/typescript/module/src/compiler/stylesheet.d.ts +23 -5
- package/dist/typescript/module/src/compiler/stylesheet.d.ts.map +1 -1
- package/dist/typescript/module/src/jest/index.d.ts +11 -5
- package/dist/typescript/module/src/jest/index.d.ts.map +1 -1
- package/dist/typescript/module/src/metro/index.d.ts.map +1 -1
- package/dist/typescript/module/src/poison.pill.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts +5 -0
- package/dist/typescript/module/src/runtime/native/conditions/attributes.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts +3 -3
- package/dist/typescript/module/src/runtime/native/conditions/container-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/guards.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/index.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/conditions/media-query.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/injection.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts +2 -2
- package/dist/typescript/module/src/runtime/native/react/interaction.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts +2 -1
- package/dist/typescript/module/src/runtime/native/react/useNativeCss.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts +2 -10
- package/dist/typescript/module/src/runtime/native/reactivity.d.ts.map +1 -1
- package/dist/typescript/module/src/runtime/native/root.d.ts +11 -0
- package/dist/typescript/module/src/runtime/native/root.d.ts.map +1 -0
- package/dist/typescript/module/src/runtime/native/styles/calculate-props.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.map +1 -1
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts +1 -0
- package/dist/typescript/module/src/runtime/utils/specificity.d.ts.map +1 -1
- package/package.json +28 -4
- package/src/compiler/atRules.ts +7 -2
- package/src/compiler/attributes.test.ts +1 -1
- package/src/compiler/compiler.ts +63 -33
- package/src/compiler/compiler.types.ts +7 -5
- package/src/compiler/declarations.ts +300 -69
- package/src/compiler/inheritance.test.ts +6 -6
- package/src/compiler/selector-builder.ts +531 -0
- package/src/compiler/selectors.ts +20 -6
- package/src/compiler/stylesheet.ts +168 -38
- package/src/jest/index.ts +34 -11
- package/src/metro/index.ts +12 -6
- package/src/poison.pill.ts +5 -1
- package/src/runtime/native/conditions/attributes.ts +52 -0
- package/src/runtime/native/conditions/container-query.ts +27 -22
- package/src/runtime/native/conditions/guards.ts +1 -2
- package/src/runtime/native/conditions/index.ts +12 -66
- package/src/runtime/native/conditions/media-query.ts +18 -20
- package/src/runtime/native/injection.ts +1 -1
- package/src/runtime/native/react/interaction.ts +12 -12
- package/src/runtime/native/react/rules.ts +9 -9
- package/src/runtime/native/react/useNativeCss.ts +3 -0
- package/src/runtime/native/reactivity.ts +2 -21
- package/src/runtime/native/root.ts +31 -0
- package/src/runtime/native/styles/calculate-props.ts +59 -49
- package/src/runtime/native/styles/index.ts +12 -12
- package/src/runtime/native/styles/units.ts +7 -3
- package/src/runtime/native/styles/variables.ts +2 -6
- package/src/runtime/utils/specificity.ts +1 -0
- package/types.d.ts +70 -0
package/src/compiler/compiler.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
+
import { inspect } from "node:util";
|
|
3
|
+
|
|
2
4
|
import { debug } from "debug";
|
|
3
5
|
import {
|
|
4
6
|
transform as lightningcss,
|
|
@@ -12,16 +14,11 @@ import {
|
|
|
12
14
|
} from "lightningcss";
|
|
13
15
|
|
|
14
16
|
import { maybeMutateReactNativeOptions, parsePropAtRule } from "./atRules";
|
|
15
|
-
import type {
|
|
16
|
-
CompilerOptions,
|
|
17
|
-
ContainerQuery,
|
|
18
|
-
ReactNativeCssStyleSheet,
|
|
19
|
-
} from "./compiler.types";
|
|
17
|
+
import type { CompilerOptions, ContainerQuery } from "./compiler.types";
|
|
20
18
|
import { parseContainerCondition } from "./container-query";
|
|
21
19
|
import { parseDeclaration } from "./declarations";
|
|
22
20
|
import { extractKeyFrames } from "./keyframes";
|
|
23
21
|
import { parseMediaQuery } from "./media-query";
|
|
24
|
-
import { getSelectors } from "./selectors";
|
|
25
22
|
import { StylesheetBuilder } from "./stylesheet";
|
|
26
23
|
|
|
27
24
|
const defaultLogger = debug("react-native-css:compiler");
|
|
@@ -33,11 +30,11 @@ const defaultLogger = debug("react-native-css:compiler");
|
|
|
33
30
|
* @param options - Compiler options
|
|
34
31
|
* @returns A `ReactNativeCssStyleSheet` that can be passed to `StyleSheet.register` or used with a custom runtime
|
|
35
32
|
*/
|
|
36
|
-
export function compile(
|
|
37
|
-
code: Buffer | string,
|
|
38
|
-
options: CompilerOptions = {},
|
|
39
|
-
): ReactNativeCssStyleSheet {
|
|
33
|
+
export function compile(code: Buffer | string, options: CompilerOptions = {}) {
|
|
40
34
|
const { logger = defaultLogger } = options;
|
|
35
|
+
const isLoggerEnabled =
|
|
36
|
+
"enabled" in logger ? logger.enabled : Boolean(logger);
|
|
37
|
+
|
|
41
38
|
const features = Object.assign({}, options.features);
|
|
42
39
|
|
|
43
40
|
if (options.selectorPrefix && options.selectorPrefix.startsWith(".")) {
|
|
@@ -67,8 +64,12 @@ export function compile(
|
|
|
67
64
|
maybeMutateReactNativeOptions(rule, builder);
|
|
68
65
|
},
|
|
69
66
|
StyleSheetExit(sheet) {
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
if (isLoggerEnabled) {
|
|
68
|
+
logger(`Found ${sheet.rules.length} rules to process`);
|
|
69
|
+
logger(
|
|
70
|
+
inspect(sheet.rules, { depth: null, colors: true, compact: false }),
|
|
71
|
+
);
|
|
72
|
+
}
|
|
72
73
|
|
|
73
74
|
for (const rule of sheet.rules) {
|
|
74
75
|
// Extract the style declarations and animations from the current rule
|
|
@@ -108,7 +109,10 @@ export function compile(
|
|
|
108
109
|
visitor,
|
|
109
110
|
});
|
|
110
111
|
|
|
111
|
-
return
|
|
112
|
+
return {
|
|
113
|
+
stylesheet: () => builder.getNativeStyleSheet(),
|
|
114
|
+
warnings: () => builder.getWarnings(),
|
|
115
|
+
};
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
/**
|
|
@@ -132,17 +136,37 @@ function extractRule(rule: Rule, builder: StylesheetBuilder) {
|
|
|
132
136
|
extractMedia(rule.value, builder);
|
|
133
137
|
break;
|
|
134
138
|
}
|
|
139
|
+
case "nested-declarations": {
|
|
140
|
+
const value = rule.value;
|
|
141
|
+
|
|
142
|
+
const declarationBlock = value.declarations;
|
|
143
|
+
if (declarationBlock) {
|
|
144
|
+
if (declarationBlock.declarations?.length) {
|
|
145
|
+
builder.newNestedRule();
|
|
146
|
+
for (const declaration of declarationBlock.declarations) {
|
|
147
|
+
parseDeclaration(declaration, builder);
|
|
148
|
+
}
|
|
149
|
+
builder.applyRuleToSelectors();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (declarationBlock.importantDeclarations?.length) {
|
|
153
|
+
builder.newNestedRule({ important: true });
|
|
154
|
+
for (const declaration of declarationBlock.importantDeclarations) {
|
|
155
|
+
parseDeclaration(declaration, builder);
|
|
156
|
+
}
|
|
157
|
+
builder.applyRuleToSelectors();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
135
162
|
case "style": {
|
|
136
|
-
|
|
137
|
-
|
|
163
|
+
const value = rule.value;
|
|
164
|
+
|
|
165
|
+
const declarationBlock = value.declarations;
|
|
166
|
+
const mapping = parsePropAtRule(value.rules);
|
|
138
167
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const selectors = getSelectors(
|
|
142
|
-
rule.value.selectors,
|
|
143
|
-
false,
|
|
144
|
-
builder.getOptions(),
|
|
145
|
-
);
|
|
168
|
+
// If the rule is a style declaration, extract it with the `getExtractedStyle` function and store it in the `declarations` map
|
|
169
|
+
builder = builder.fork("style", value.selectors);
|
|
146
170
|
|
|
147
171
|
if (declarationBlock) {
|
|
148
172
|
if (declarationBlock.declarations) {
|
|
@@ -150,7 +174,7 @@ function extractRule(rule: Rule, builder: StylesheetBuilder) {
|
|
|
150
174
|
for (const declaration of declarationBlock.declarations) {
|
|
151
175
|
parseDeclaration(declaration, builder);
|
|
152
176
|
}
|
|
153
|
-
builder.applyRuleToSelectors(
|
|
177
|
+
builder.applyRuleToSelectors();
|
|
154
178
|
}
|
|
155
179
|
|
|
156
180
|
if (declarationBlock.importantDeclarations) {
|
|
@@ -158,9 +182,16 @@ function extractRule(rule: Rule, builder: StylesheetBuilder) {
|
|
|
158
182
|
for (const declaration of declarationBlock.importantDeclarations) {
|
|
159
183
|
parseDeclaration(declaration, builder);
|
|
160
184
|
}
|
|
161
|
-
builder.applyRuleToSelectors(
|
|
185
|
+
builder.applyRuleToSelectors();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (value.rules) {
|
|
190
|
+
for (const nestedRule of value.rules) {
|
|
191
|
+
extractRule(nestedRule, builder);
|
|
162
192
|
}
|
|
163
193
|
}
|
|
194
|
+
|
|
164
195
|
break;
|
|
165
196
|
}
|
|
166
197
|
case "layer-block":
|
|
@@ -184,7 +215,6 @@ function extractRule(rule: Rule, builder: StylesheetBuilder) {
|
|
|
184
215
|
case "counter-style":
|
|
185
216
|
case "moz-document":
|
|
186
217
|
case "nesting":
|
|
187
|
-
case "nested-declarations":
|
|
188
218
|
case "viewport":
|
|
189
219
|
case "custom-media":
|
|
190
220
|
case "scope":
|
|
@@ -252,17 +282,17 @@ function extractContainer(
|
|
|
252
282
|
builder = builder.fork("container");
|
|
253
283
|
|
|
254
284
|
// Iterate over all rules inside the containerRule and extract their styles using the updated CompilerCollection
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
};
|
|
285
|
+
const query: ContainerQuery = {
|
|
286
|
+
m: parseContainerCondition(containerRule.condition, builder),
|
|
287
|
+
};
|
|
259
288
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
289
|
+
if (containerRule.name) {
|
|
290
|
+
query.n = containerRule.name;
|
|
291
|
+
}
|
|
263
292
|
|
|
264
|
-
|
|
293
|
+
builder.addContainerQuery(query);
|
|
265
294
|
|
|
295
|
+
for (const rule of containerRule.rules) {
|
|
266
296
|
extractRule(rule, builder);
|
|
267
297
|
}
|
|
268
298
|
}
|
|
@@ -35,9 +35,9 @@ export interface ReactNativeCssStyleSheet_V2 {
|
|
|
35
35
|
/** KeyFrames */
|
|
36
36
|
k?: Animation_V2[];
|
|
37
37
|
/** Root Variables */
|
|
38
|
-
vr?:
|
|
38
|
+
vr?: RootVariables;
|
|
39
39
|
/** Universal Variables */
|
|
40
|
-
vu?:
|
|
40
|
+
vu?: RootVariables;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/******************************** Styles ********************************/
|
|
@@ -147,10 +147,12 @@ export type StyleFunction =
|
|
|
147
147
|
/****************************** Variables *******************************/
|
|
148
148
|
|
|
149
149
|
export type VariableDescriptor = [string, StyleDescriptor];
|
|
150
|
-
export type VariableRecord = Record<string,
|
|
151
|
-
export type
|
|
150
|
+
export type VariableRecord = Record<string, VariableValue[]>;
|
|
151
|
+
export type VariableValue =
|
|
152
152
|
| [StyleDescriptor]
|
|
153
|
-
| [StyleDescriptor,
|
|
153
|
+
| [StyleDescriptor, MediaCondition[]];
|
|
154
|
+
|
|
155
|
+
export type RootVariables = [string, VariableValue[]][];
|
|
154
156
|
|
|
155
157
|
export type InlineVariable = {
|
|
156
158
|
[VAR_SYMBOL]: "inline";
|