react-native-unistyles 3.0.0-alpha.6 → 3.0.0-alpha.8
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/common/Helpers.h +24 -0
- package/cxx/core/HostStyle.cpp +4 -5
- package/cxx/core/HostStyle.h +4 -0
- package/cxx/core/StyleSheet.h +0 -1
- package/cxx/core/StyleSheetRegistry.cpp +9 -17
- package/cxx/core/StyleSheetRegistry.h +3 -4
- package/cxx/core/UnistyleData.h +22 -0
- package/cxx/core/UnistylesCommitHook.cpp +4 -1
- package/cxx/core/UnistylesRegistry.cpp +33 -49
- package/cxx/core/UnistylesRegistry.h +8 -8
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +4 -3
- package/cxx/hybridObjects/HybridStyleSheet.cpp +8 -11
- package/cxx/parser/Parser.cpp +41 -57
- package/cxx/parser/Parser.h +8 -13
- package/lib/commonjs/specs/ShadowRegistry/index.js +2 -2
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
- package/lib/commonjs/specs/index.web.js +1 -1
- package/lib/commonjs/web/convert/boxShadow.js +77 -0
- package/lib/commonjs/web/convert/boxShadow.js.map +1 -0
- package/lib/commonjs/web/convert/breakpoint.js +25 -0
- package/lib/commonjs/web/convert/breakpoint.js.map +1 -0
- package/lib/commonjs/web/convert/index.js +76 -0
- package/lib/commonjs/web/convert/index.js.map +1 -0
- package/lib/commonjs/web/convert/module.d.js +2 -0
- package/lib/commonjs/web/convert/module.d.js.map +1 -0
- package/lib/commonjs/web/convert/shadow.js +68 -0
- package/lib/commonjs/web/convert/shadow.js.map +1 -0
- package/lib/commonjs/web/convert/style.js +89 -0
- package/lib/commonjs/web/convert/style.js.map +1 -0
- package/lib/commonjs/web/convert/textShadow.js +73 -0
- package/lib/commonjs/web/convert/textShadow.js.map +1 -0
- package/lib/commonjs/web/convert/transform.js +72 -0
- package/lib/commonjs/web/convert/transform.js.map +1 -0
- package/lib/commonjs/web/convert/types.js +9 -0
- package/lib/commonjs/web/convert/types.js.map +1 -0
- package/lib/commonjs/web/convert/utils.js +55 -0
- package/lib/commonjs/web/convert/utils.js.map +1 -0
- package/lib/commonjs/web/create.js +89 -0
- package/lib/commonjs/web/create.js.map +1 -0
- package/lib/commonjs/web/index.js +51 -0
- package/lib/commonjs/web/index.js.map +1 -0
- package/lib/commonjs/web/listener/index.js +13 -0
- package/lib/commonjs/web/listener/index.js.map +1 -0
- package/lib/commonjs/web/listener/listener.js +36 -0
- package/lib/commonjs/web/listener/listener.js.map +1 -0
- package/lib/commonjs/web/mock.js +37 -0
- package/lib/commonjs/web/mock.js.map +1 -0
- package/lib/commonjs/web/mq.js +23 -0
- package/lib/commonjs/web/mq.js.map +1 -0
- package/lib/commonjs/web/pseudo.js +11 -0
- package/lib/commonjs/web/pseudo.js.map +1 -0
- package/lib/commonjs/web/registry.js +37 -0
- package/lib/commonjs/web/registry.js.map +1 -0
- package/lib/commonjs/web/runtime.js +164 -0
- package/lib/commonjs/web/runtime.js.map +1 -0
- package/lib/commonjs/web/state.js +121 -0
- package/lib/commonjs/web/state.js.map +1 -0
- package/lib/commonjs/web/utils.js +78 -0
- package/lib/commonjs/web/utils.js.map +1 -0
- package/lib/commonjs/web/variants/getVariants.js +39 -0
- package/lib/commonjs/web/variants/getVariants.js.map +1 -0
- package/lib/commonjs/web/variants/index.js +28 -0
- package/lib/commonjs/web/variants/index.js.map +1 -0
- package/lib/commonjs/web/variants/useVariants.js +75 -0
- package/lib/commonjs/web/variants/useVariants.js.map +1 -0
- package/lib/module/specs/ShadowRegistry/index.js +2 -2
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/index.js.map +1 -1
- package/lib/module/specs/index.web.js +1 -1
- package/lib/module/specs/index.web.js.map +1 -1
- package/lib/module/web/convert/boxShadow.js +72 -0
- package/lib/module/web/convert/boxShadow.js.map +1 -0
- package/lib/module/web/convert/breakpoint.js +20 -0
- package/lib/module/web/convert/breakpoint.js.map +1 -0
- package/lib/module/web/convert/index.js +71 -0
- package/lib/module/web/convert/index.js.map +1 -0
- package/lib/module/web/convert/module.d.js +2 -0
- package/lib/module/web/convert/module.d.js.map +1 -0
- package/lib/module/web/convert/shadow.js +63 -0
- package/lib/module/web/convert/shadow.js.map +1 -0
- package/lib/module/web/convert/style.js +84 -0
- package/lib/module/web/convert/style.js.map +1 -0
- package/lib/module/web/convert/textShadow.js +68 -0
- package/lib/module/web/convert/textShadow.js.map +1 -0
- package/lib/module/web/convert/transform.js +67 -0
- package/lib/module/web/convert/transform.js.map +1 -0
- package/lib/module/web/convert/types.js +5 -0
- package/lib/module/web/convert/types.js.map +1 -0
- package/lib/module/web/convert/utils.js +43 -0
- package/lib/module/web/convert/utils.js.map +1 -0
- package/lib/module/web/create.js +84 -0
- package/lib/module/web/create.js.map +1 -0
- package/lib/module/web/index.js +24 -0
- package/lib/module/web/index.js.map +1 -0
- package/lib/module/web/listener/index.js +4 -0
- package/lib/module/web/listener/index.js.map +1 -0
- package/lib/module/web/listener/listener.js +31 -0
- package/lib/module/web/listener/listener.js.map +1 -0
- package/lib/module/web/mock.js +33 -0
- package/lib/module/web/mock.js.map +1 -0
- package/lib/module/web/mq.js +17 -0
- package/lib/module/web/mq.js.map +1 -0
- package/lib/module/web/pseudo.js +6 -0
- package/lib/module/web/pseudo.js.map +1 -0
- package/lib/module/web/registry.js +33 -0
- package/lib/module/web/registry.js.map +1 -0
- package/lib/module/web/runtime.js +160 -0
- package/lib/module/web/runtime.js.map +1 -0
- package/lib/module/web/state.js +117 -0
- package/lib/module/web/state.js.map +1 -0
- package/lib/module/web/utils.js +65 -0
- package/lib/module/web/utils.js.map +1 -0
- package/lib/module/web/variants/getVariants.js +34 -0
- package/lib/module/web/variants/getVariants.js.map +1 -0
- package/lib/module/web/variants/index.js +5 -0
- package/lib/module/web/variants/index.js.map +1 -0
- package/lib/module/web/variants/useVariants.js +70 -0
- package/lib/module/web/variants/useVariants.js.map +1 -0
- package/lib/typescript/example/App.d.ts.map +1 -1
- package/lib/typescript/example/Typography.d.ts +11 -0
- package/lib/typescript/example/Typography.d.ts.map +1 -0
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +2 -2
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts +2 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.web.d.ts +1 -1
- package/lib/typescript/src/specs/index.web.d.ts.map +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts +1 -1
- package/lib/typescript/src/types/stylesheet.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/boxShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/breakpoint.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/convert/index.d.ts +1 -1
- package/lib/typescript/src/web/convert/index.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/shadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/style.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/textShadow.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/transform.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/convert/types.d.ts +1 -1
- package/lib/typescript/src/web/convert/types.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/utils.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/create.d.ts +11 -11
- package/lib/typescript/{web → src/web}/create.d.ts.map +1 -1
- package/lib/typescript/{web → src/web}/index.d.ts +12 -12
- package/lib/typescript/{web → src/web}/index.d.ts.map +1 -1
- package/lib/typescript/src/web/listener/index.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/listener/listener.d.ts +1 -1
- package/lib/typescript/src/web/listener/listener.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/mock.d.ts +2 -2
- package/lib/typescript/src/web/mock.d.ts.map +1 -0
- package/lib/typescript/src/web/mq.d.ts.map +1 -0
- package/lib/typescript/src/web/pseudo.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/registry.d.ts +1 -1
- package/lib/typescript/src/web/registry.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/runtime.d.ts +6 -6
- package/lib/typescript/src/web/runtime.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/state.d.ts +4 -4
- package/lib/typescript/src/web/state.d.ts.map +1 -0
- package/lib/typescript/{web → src/web}/utils.d.ts +5 -3
- package/lib/typescript/src/web/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/variants/getVariants.d.ts +3 -0
- package/lib/typescript/src/web/variants/getVariants.d.ts.map +1 -0
- package/lib/typescript/src/web/variants/index.d.ts +3 -0
- package/lib/typescript/src/web/variants/index.d.ts.map +1 -0
- package/lib/typescript/src/web/variants/useVariants.d.ts +3 -0
- package/lib/typescript/src/web/variants/useVariants.d.ts.map +1 -0
- package/package.json +1 -1
- package/plugin/__tests__/dependencies.spec.js +181 -103
- package/plugin/__tests__/ref.spec.js +346 -156
- package/plugin/__tests__/stylesheet.spec.js +148 -55
- package/plugin/index.js +31 -21
- package/plugin/ref.js +67 -15
- package/plugin/style.js +13 -24
- package/plugin/stylesheet.js +44 -1
- package/plugin/variants.js +33 -0
- package/src/specs/ShadowRegistry/index.ts +4 -4
- package/src/specs/StyleSheet/index.ts +3 -1
- package/src/specs/index.web.ts +1 -1
- package/src/types/stylesheet.ts +1 -1
- package/{web → src/web}/convert/breakpoint.ts +1 -1
- package/{web → src/web}/convert/index.ts +1 -1
- package/{web → src/web}/convert/types.ts +1 -1
- package/{web → src/web}/create.ts +36 -33
- package/{web → src/web}/listener/listener.ts +1 -1
- package/{web → src/web}/mock.ts +2 -2
- package/{web → src/web}/registry.ts +1 -1
- package/{web → src/web}/runtime.ts +4 -4
- package/{web → src/web}/state.ts +5 -5
- package/{web → src/web}/utils.ts +5 -5
- package/src/web/variants/getVariants.ts +42 -0
- package/src/web/variants/index.ts +2 -0
- package/{web → src/web/variants}/useVariants.ts +24 -44
- package/lib/typescript/web/convert/boxShadow.d.ts.map +0 -1
- package/lib/typescript/web/convert/breakpoint.d.ts.map +0 -1
- package/lib/typescript/web/convert/index.d.ts.map +0 -1
- package/lib/typescript/web/convert/shadow.d.ts.map +0 -1
- package/lib/typescript/web/convert/style.d.ts.map +0 -1
- package/lib/typescript/web/convert/textShadow.d.ts.map +0 -1
- package/lib/typescript/web/convert/transform.d.ts.map +0 -1
- package/lib/typescript/web/convert/types.d.ts.map +0 -1
- package/lib/typescript/web/convert/utils.d.ts.map +0 -1
- package/lib/typescript/web/listener/index.d.ts.map +0 -1
- package/lib/typescript/web/listener/listener.d.ts.map +0 -1
- package/lib/typescript/web/mock.d.ts.map +0 -1
- package/lib/typescript/web/mq.d.ts.map +0 -1
- package/lib/typescript/web/pseudo.d.ts.map +0 -1
- package/lib/typescript/web/registry.d.ts.map +0 -1
- package/lib/typescript/web/runtime.d.ts.map +0 -1
- package/lib/typescript/web/state.d.ts.map +0 -1
- package/lib/typescript/web/useVariants.d.ts +0 -3
- package/lib/typescript/web/useVariants.d.ts.map +0 -1
- package/lib/typescript/web/utils.d.ts.map +0 -1
- /package/lib/typescript/{web → src/web}/convert/boxShadow.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/convert/breakpoint.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/convert/shadow.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/convert/style.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/convert/textShadow.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/convert/transform.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/convert/utils.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/listener/index.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/mq.d.ts +0 -0
- /package/lib/typescript/{web → src/web}/pseudo.d.ts +0 -0
- /package/{web → src/web}/convert/boxShadow.ts +0 -0
- /package/{web → src/web}/convert/module.d.ts +0 -0
- /package/{web → src/web}/convert/shadow.ts +0 -0
- /package/{web → src/web}/convert/style.ts +0 -0
- /package/{web → src/web}/convert/textShadow.ts +0 -0
- /package/{web → src/web}/convert/transform.ts +0 -0
- /package/{web → src/web}/convert/utils.ts +0 -0
- /package/{web → src/web}/index.ts +0 -0
- /package/{web → src/web}/listener/index.ts +0 -0
- /package/{web → src/web}/mq.ts +0 -0
- /package/{web → src/web}/pseudo.ts +0 -0
package/cxx/parser/Parser.cpp
CHANGED
@@ -68,14 +68,14 @@ jsi::Object parser::Parser::unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<S
|
|
68
68
|
void parser::Parser::parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet) {
|
69
69
|
for (const auto& [_, unistyle] : styleSheet->unistyles) {
|
70
70
|
if (unistyle->type == core::UnistyleType::Object) {
|
71
|
-
auto result = this->parseFirstLevel(rt, unistyle,
|
71
|
+
auto result = this->parseFirstLevel(rt, unistyle, std::nullopt);
|
72
72
|
|
73
73
|
unistyle->parsedStyle = std::move(result);
|
74
74
|
unistyle->seal();
|
75
75
|
}
|
76
76
|
|
77
77
|
if (unistyle->type == core::UnistyleType::DynamicFunction) {
|
78
|
-
auto hostFn = this->createDynamicFunctionProxy(rt, unistyle
|
78
|
+
auto hostFn = this->createDynamicFunctionProxy(rt, unistyle);
|
79
79
|
auto unistyleFn = std::dynamic_pointer_cast<UnistyleDynamicFunction>(unistyle);
|
80
80
|
|
81
81
|
// defer parsing dynamic functions
|
@@ -85,39 +85,40 @@ void parser::Parser::parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
|
|
85
85
|
}
|
86
86
|
|
87
87
|
// rebuild all unistyles in StyleSheet that depends on variants
|
88
|
-
void parser::Parser::rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet) {
|
88
|
+
void parser::Parser::rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants) {
|
89
89
|
for (const auto& [_, unistyle] : styleSheet->unistyles) {
|
90
90
|
if (!unistyle->dependsOn(UnistyleDependency::VARIANTS)) {
|
91
91
|
continue;
|
92
92
|
}
|
93
93
|
|
94
|
-
this->rebuildUnistyle(rt, styleSheet, unistyle);
|
94
|
+
this->rebuildUnistyle(rt, styleSheet, unistyle, variants);
|
95
95
|
}
|
96
96
|
}
|
97
97
|
|
98
98
|
// rebuild all unistyles that are affected by platform event
|
99
99
|
void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap) {
|
100
|
-
for (
|
100
|
+
for (auto& [styleSheet, map] : dependencyMap) {
|
101
101
|
jsi::Object unwrappedStyleSheet = this->unwrapStyleSheet(rt, styleSheet);
|
102
102
|
|
103
|
-
for (
|
104
|
-
for (
|
103
|
+
for (auto& [shadowNode, unistyles] : map) {
|
104
|
+
for (auto& [unistyle, variants, parsedStyle] : unistyles) {
|
105
105
|
// StyleSheet might have styles that are not affected
|
106
106
|
if (!unwrappedStyleSheet.hasProperty(rt, unistyle->styleKey.c_str())) {
|
107
107
|
continue;
|
108
108
|
}
|
109
109
|
|
110
110
|
unistyle->rawValue = unwrappedStyleSheet.getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
|
111
|
-
this->rebuildUnistyle(rt, styleSheet, unistyle);
|
111
|
+
this->rebuildUnistyle(rt, styleSheet, unistyle, variants);
|
112
|
+
parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
|
112
113
|
}
|
113
114
|
}
|
114
115
|
}
|
115
116
|
}
|
116
117
|
|
117
118
|
// rebuild single unistyle
|
118
|
-
void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle) {
|
119
|
+
void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle, const Variants& variants) {
|
119
120
|
if (unistyle->type == core::UnistyleType::Object) {
|
120
|
-
auto result = this->parseFirstLevel(rt, unistyle,
|
121
|
+
auto result = this->parseFirstLevel(rt, unistyle, variants);
|
121
122
|
|
122
123
|
unistyle->parsedStyle = std::move(result);
|
123
124
|
}
|
@@ -133,7 +134,7 @@ void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleShee
|
|
133
134
|
// convert arguments to jsi::Value
|
134
135
|
auto metadata = unistyleFn->dynamicFunctionMetadata.value();
|
135
136
|
std::vector<jsi::Value> args{};
|
136
|
-
|
137
|
+
|
137
138
|
args.reserve(3);
|
138
139
|
|
139
140
|
for (int i = 0; i < metadata.count; i++) {
|
@@ -148,20 +149,20 @@ void parser::Parser::rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleShee
|
|
148
149
|
auto functionResult = unistyleFn->proxiedFunction.value().callAsConstructor(rt, argStart, metadata.count).asObject(rt);
|
149
150
|
|
150
151
|
unistyleFn->unprocessedValue = std::move(functionResult);
|
151
|
-
unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn,
|
152
|
+
unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, variants);
|
152
153
|
}
|
153
154
|
}
|
154
155
|
|
155
156
|
// convert dependency map to shadow tree updates
|
156
|
-
shadow::ShadowLeafUpdates parser::Parser::dependencyMapToShadowLeafUpdates(DependencyMap& dependencyMap) {
|
157
|
+
shadow::ShadowLeafUpdates parser::Parser::dependencyMapToShadowLeafUpdates(core::DependencyMap& dependencyMap) {
|
157
158
|
shadow::ShadowLeafUpdates updates;
|
158
159
|
auto& rt = this->_unistylesRuntime->getRuntime();
|
159
160
|
|
160
161
|
for (const auto& [styleSheet, map] : dependencyMap) {
|
161
162
|
for (const auto& [shadowNode, unistyles] : map) {
|
162
|
-
for (const auto& unistyle : unistyles) {
|
163
|
-
auto rawProps = this->parseStylesToShadowTreeStyles(rt,
|
164
|
-
|
163
|
+
for (const auto& [unistyle, variants, parsedStyle] : unistyles) {
|
164
|
+
auto rawProps = this->parseStylesToShadowTreeStyles(rt, parsedStyle.value());
|
165
|
+
|
165
166
|
if (updates.contains(shadowNode)) {
|
166
167
|
updates[shadowNode].emplace_back(std::move(rawProps));
|
167
168
|
|
@@ -179,7 +180,7 @@ shadow::ShadowLeafUpdates parser::Parser::dependencyMapToShadowLeafUpdates(Depen
|
|
179
180
|
// convert jsi::Value arguments to folly::dynamic
|
180
181
|
std::vector<folly::dynamic> parser::Parser::parseDynamicFunctionArguments(jsi::Runtime& rt, size_t count, const jsi::Value* arguments) {
|
181
182
|
std::vector<folly::dynamic> parsedArgument{};
|
182
|
-
|
183
|
+
|
183
184
|
parsedArgument.reserve(3);
|
184
185
|
|
185
186
|
for (size_t i = 0; i < count; i++) {
|
@@ -234,7 +235,7 @@ std::vector<folly::dynamic> parser::Parser::parseDynamicFunctionArguments(jsi::R
|
|
234
235
|
|
235
236
|
// first level of StyleSheet, we can expect here different properties than on second level
|
236
237
|
// eg. variants, compoundVariants, mq, breakpoints etc.
|
237
|
-
jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared unistyle, Variants
|
238
|
+
jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared unistyle, std::optional<Variants> variants) {
|
238
239
|
// for objects - we simply operate on them
|
239
240
|
// for functions we need to work on the unprocessed result (object)
|
240
241
|
auto& style = unistyle->type == core::UnistyleType::Object
|
@@ -317,15 +318,15 @@ jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared u
|
|
317
318
|
parsedStyle.setProperty(rt, jsi::PropNameID::forUtf8(rt, propertyName), this->parseSecondLevel(rt, unistyle, valueFromBreakpoint));
|
318
319
|
});
|
319
320
|
|
320
|
-
if (shouldParseVariants && !variants.empty()) {
|
321
|
+
if (shouldParseVariants && variants.has_value() && !variants.value().empty()) {
|
321
322
|
auto propertyValueObject = style.getProperty(rt, "variants").asObject(rt);
|
322
|
-
auto parsedVariant = this->parseVariants(rt, unistyle, propertyValueObject, variants);
|
323
|
+
auto parsedVariant = this->parseVariants(rt, unistyle, propertyValueObject, variants.value());
|
323
324
|
|
324
325
|
helpers::mergeJSIObjects(rt, parsedStyle, parsedVariant);
|
325
326
|
|
326
327
|
if (shouldParseCompoundVariants) {
|
327
328
|
auto compoundVariants = style.getProperty(rt, "compoundVariants").asObject(rt);
|
328
|
-
auto parsedCompoundVariants = this->parseCompoundVariants(rt, unistyle, compoundVariants, variants);
|
329
|
+
auto parsedCompoundVariants = this->parseCompoundVariants(rt, unistyle, compoundVariants, variants.value());
|
329
330
|
|
330
331
|
helpers::mergeJSIObjects(rt, parsedStyle, parsedCompoundVariants);
|
331
332
|
}
|
@@ -335,14 +336,14 @@ jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared u
|
|
335
336
|
}
|
336
337
|
|
337
338
|
// function replaces original user dynamic function with additional logic to memoize arguments
|
338
|
-
jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unistyle::Shared unistyle
|
339
|
+
jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unistyle::Shared unistyle) {
|
339
340
|
auto unistylesRuntime = this->_unistylesRuntime;
|
340
341
|
|
341
342
|
return jsi::Function::createFromHostFunction(
|
342
343
|
rt,
|
343
344
|
jsi::PropNameID::forUtf8(rt, unistyle->styleKey),
|
344
345
|
1,
|
345
|
-
[this, unistylesRuntime, unistyle
|
346
|
+
[this, unistylesRuntime, unistyle](jsi::Runtime& rt, const jsi::Value& thisVal, const jsi::Value* args, size_t count) {
|
346
347
|
auto thisObject = thisVal.asObject(rt);
|
347
348
|
auto parser = parser::Parser(unistylesRuntime);
|
348
349
|
|
@@ -358,7 +359,7 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
|
|
358
359
|
};
|
359
360
|
|
360
361
|
unistyleFn->unprocessedValue = jsi::Value(rt, result).asObject(rt);
|
361
|
-
unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn,
|
362
|
+
unistyleFn->parsedStyle = this->parseFirstLevel(rt, unistyleFn, std::nullopt);
|
362
363
|
unistyleFn->seal();
|
363
364
|
|
364
365
|
return jsi::Value(rt, unistyleFn->parsedStyle.value());
|
@@ -370,7 +371,7 @@ std::vector<UnistyleDependency> parser::Parser::parseDependencies(jsi::Runtime &
|
|
370
371
|
helpers::assertThat(rt, dependencies.isArray(rt), "Unistyles: Babel transform is invalid - unexpected type for dependencies.");
|
371
372
|
|
372
373
|
std::vector<UnistyleDependency> parsedDependencies{};
|
373
|
-
|
374
|
+
|
374
375
|
parsedDependencies.reserve(5);
|
375
376
|
|
376
377
|
helpers::iterateJSIArray(rt, dependencies.asArray(rt), [&](size_t i, jsi::Value& value){
|
@@ -389,7 +390,7 @@ jsi::Value parser::Parser::parseTransforms(jsi::Runtime& rt, Unistyle::Shared un
|
|
389
390
|
}
|
390
391
|
|
391
392
|
std::vector<jsi::Value> parsedTransforms{};
|
392
|
-
|
393
|
+
|
393
394
|
parsedTransforms.reserve(2);
|
394
395
|
|
395
396
|
helpers::iterateJSIArray(rt, obj.asArray(rt), [&](size_t i, jsi::Value& value){
|
@@ -438,7 +439,7 @@ jsi::Value parser::Parser::getValueFromBreakpoints(jsi::Runtime& rt, Unistyle::S
|
|
438
439
|
auto propertyName = propertyNames.getValueAtIndex(rt, i).asString(rt).utf8(rt);
|
439
440
|
auto propertyValue = obj.getProperty(rt, propertyName.c_str());
|
440
441
|
auto mq = core::UnistylesMQ{propertyName};
|
441
|
-
|
442
|
+
|
442
443
|
if (mq.isMQ()) {
|
443
444
|
unistyle->addDependency(UnistyleDependency::BREAKPOINTS);
|
444
445
|
}
|
@@ -451,11 +452,11 @@ jsi::Value parser::Parser::getValueFromBreakpoints(jsi::Runtime& rt, Unistyle::S
|
|
451
452
|
|
452
453
|
// check orientation breakpoints if user didn't register own breakpoint
|
453
454
|
bool hasOrientationBreakpoint = obj.hasProperty(rt, currentOrientation);
|
454
|
-
|
455
|
+
|
455
456
|
if (hasOrientationBreakpoint) {
|
456
457
|
unistyle->addDependency(UnistyleDependency::BREAKPOINTS);
|
457
458
|
}
|
458
|
-
|
459
|
+
|
459
460
|
if (!hasBreakpoints && hasOrientationBreakpoint) {
|
460
461
|
return obj.getProperty(rt, currentOrientation);
|
461
462
|
}
|
@@ -463,7 +464,7 @@ jsi::Value parser::Parser::getValueFromBreakpoints(jsi::Runtime& rt, Unistyle::S
|
|
463
464
|
if (!currentBreakpoint.has_value()) {
|
464
465
|
return jsi::Value::undefined();
|
465
466
|
}
|
466
|
-
|
467
|
+
|
467
468
|
unistyle->addDependency(UnistyleDependency::BREAKPOINTS);
|
468
469
|
|
469
470
|
// if you're still here it means that there is no
|
@@ -509,7 +510,7 @@ jsi::Object parser::Parser::parseVariants(jsi::Runtime& rt, Unistyle::Shared uni
|
|
509
510
|
: std::nullopt;
|
510
511
|
|
511
512
|
// we've got a match, but we need to check some condition
|
512
|
-
auto styles = this->getStylesForVariant(rt, groupValue.asObject(rt), selectedVariant);
|
513
|
+
auto styles = this->getStylesForVariant(rt, groupName, groupValue.asObject(rt), selectedVariant, variants);
|
513
514
|
|
514
515
|
// oops, invalid variant
|
515
516
|
if (styles.isUndefined() || !styles.isObject()) {
|
@@ -525,13 +526,19 @@ jsi::Object parser::Parser::parseVariants(jsi::Runtime& rt, Unistyle::Shared uni
|
|
525
526
|
}
|
526
527
|
|
527
528
|
// helpers function to support 'default' variants
|
528
|
-
jsi::Value parser::Parser::getStylesForVariant(jsi::Runtime& rt, jsi::Object&& groupValue, std::optional<std::string> selectedVariant) {
|
529
|
+
jsi::Value parser::Parser::getStylesForVariant(jsi::Runtime& rt, const std::string groupName, jsi::Object&& groupValue, std::optional<std::string> selectedVariant, Variants& variants) {
|
529
530
|
// if there is no value, let's try 'default'
|
530
531
|
auto selectedVariantKey = selectedVariant.has_value()
|
531
532
|
? selectedVariant.value().c_str()
|
532
533
|
: "default";
|
534
|
+
auto hasKey = groupValue.hasProperty(rt, selectedVariantKey);
|
535
|
+
|
536
|
+
if (hasKey && !selectedVariant.has_value()) {
|
537
|
+
// add 'default' selection to variants map
|
538
|
+
variants.emplace_back(groupName, selectedVariantKey);
|
539
|
+
}
|
533
540
|
|
534
|
-
if (
|
541
|
+
if (hasKey) {
|
535
542
|
return groupValue.getProperty(rt, selectedVariantKey);
|
536
543
|
}
|
537
544
|
|
@@ -660,31 +667,8 @@ jsi::Value parser::Parser::parseSecondLevel(jsi::Runtime &rt, Unistyle::Shared u
|
|
660
667
|
return parsedStyle;
|
661
668
|
}
|
662
669
|
|
663
|
-
// helpers function that convert variants from JS to C++ variants
|
664
|
-
Variants parser::Parser::variantsToPairs(jsi::Runtime& rt, jsi::Object&& variants) {
|
665
|
-
Variants pairs{};
|
666
|
-
|
667
|
-
helpers::enumerateJSIObject(rt, variants, [&](const std::string& variantName, jsi::Value& variantValue){
|
668
|
-
if (variantValue.isUndefined() || variantValue.isNull()) {
|
669
|
-
return;
|
670
|
-
}
|
671
|
-
|
672
|
-
if (variantValue.isBool()) {
|
673
|
-
pairs.emplace_back(std::make_pair(variantName, variantValue.asBool() ? "true" : "false"));
|
674
|
-
|
675
|
-
return;
|
676
|
-
}
|
677
|
-
|
678
|
-
if (variantValue.isString()) {
|
679
|
-
pairs.emplace_back(std::make_pair(variantName, variantValue.asString(rt).utf8(rt)));
|
680
|
-
}
|
681
|
-
});
|
682
|
-
|
683
|
-
return pairs;
|
684
|
-
}
|
685
|
-
|
686
670
|
// convert jsi::Object to RawValue with int colors
|
687
|
-
RawProps parser::Parser::parseStylesToShadowTreeStyles(jsi::Runtime& rt, jsi::Object& styles) {
|
671
|
+
RawProps parser::Parser::parseStylesToShadowTreeStyles(jsi::Runtime& rt, const jsi::Object& styles) {
|
688
672
|
jsi::Object convertedStyles = jsi::Object(rt);
|
689
673
|
auto& state = core::UnistylesRegistry::get().getState(rt);
|
690
674
|
|
package/cxx/parser/Parser.h
CHANGED
@@ -17,36 +17,31 @@ using namespace facebook;
|
|
17
17
|
using namespace margelo::nitro::unistyles::core;
|
18
18
|
|
19
19
|
using Variants = std::vector<std::pair<std::string, std::string>>;
|
20
|
-
using DependencyMap = std::unordered_map<
|
21
|
-
std::shared_ptr<core::StyleSheet>,
|
22
|
-
std::unordered_map<const ShadowNodeFamily*, std::vector<core::Unistyle::Shared>>
|
23
|
-
>;
|
24
20
|
|
25
21
|
struct Parser {
|
26
22
|
Parser(std::shared_ptr<HybridUnistylesRuntime> unistylesRuntime): _unistylesRuntime{unistylesRuntime} {}
|
27
23
|
|
28
24
|
void buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
29
25
|
void parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
30
|
-
|
31
|
-
void
|
32
|
-
|
33
|
-
shadow::ShadowLeafUpdates dependencyMapToShadowLeafUpdates(DependencyMap& dependencyMap);
|
26
|
+
void rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants);
|
27
|
+
void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap);
|
28
|
+
shadow::ShadowLeafUpdates dependencyMapToShadowLeafUpdates(core::DependencyMap& dependencyMap);
|
34
29
|
|
35
30
|
private:
|
36
|
-
void rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle);
|
31
|
+
void rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle, const Variants& variants);
|
37
32
|
jsi::Object unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
38
|
-
jsi::Object parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared unistyle, Variants
|
33
|
+
jsi::Object parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared unistyle, std::optional<Variants> variants);
|
39
34
|
jsi::Value parseSecondLevel(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Value& nestedObject);
|
40
|
-
jsi::Function createDynamicFunctionProxy(jsi::Runtime& rt, Unistyle::Shared unistyle
|
35
|
+
jsi::Function createDynamicFunctionProxy(jsi::Runtime& rt, Unistyle::Shared unistyle);
|
41
36
|
std::vector<folly::dynamic> parseDynamicFunctionArguments(jsi::Runtime& rt, size_t count, const jsi::Value* arguments);
|
42
37
|
std::vector<UnistyleDependency> parseDependencies(jsi::Runtime &rt, jsi::Object&& dependencies);
|
43
38
|
jsi::Value parseTransforms(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Object& obj);
|
44
39
|
jsi::Value getValueFromBreakpoints(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Object& obj);
|
45
40
|
jsi::Object parseVariants(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Object& obj, Variants& variants);
|
46
|
-
jsi::Value getStylesForVariant(jsi::Runtime& rt, jsi::Object&& groupValue, std::optional<std::string> selectedVariant);
|
41
|
+
jsi::Value getStylesForVariant(jsi::Runtime& rt, const std::string groupName, jsi::Object&& groupValue, std::optional<std::string> selectedVariant, Variants& variants);
|
47
42
|
jsi::Object parseCompoundVariants(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Object& obj, Variants& variants);
|
48
43
|
bool shouldApplyCompoundVariants(jsi::Runtime& rt, const Variants& variants, jsi::Object& compoundVariant);
|
49
|
-
RawProps parseStylesToShadowTreeStyles(jsi::Runtime& rt, jsi::Object& parsedStyles);
|
44
|
+
RawProps parseStylesToShadowTreeStyles(jsi::Runtime& rt, const jsi::Object& parsedStyles);
|
50
45
|
bool isColor(const std::string& propertyName);
|
51
46
|
|
52
47
|
std::shared_ptr<HybridUnistylesRuntime> _unistylesRuntime;
|
@@ -14,11 +14,11 @@ const findShadowNodeForHandle = handle => {
|
|
14
14
|
}
|
15
15
|
return node;
|
16
16
|
};
|
17
|
-
HybridShadowRegistry.add = (handle, style) => {
|
17
|
+
HybridShadowRegistry.add = (handle, style, variants) => {
|
18
18
|
if (!handle || !style?.__unid) {
|
19
19
|
return;
|
20
20
|
}
|
21
|
-
HybridShadowRegistry.link(findShadowNodeForHandle(handle), style);
|
21
|
+
HybridShadowRegistry.link(findShadowNodeForHandle(handle), style, variants ?? {});
|
22
22
|
};
|
23
23
|
HybridShadowRegistry.remove = (handle, style) => {
|
24
24
|
if (!handle || !style?.__unid) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","__unid","link","remove","unlink","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAaA,MAAMC,oBAAoB,GAAGC,qCAAY,CAACC,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP;IACA,MAAM,IAAIK,KAAK,CAAC,uDAAuD,CAAC;EAC5E;EAEA,OAAOL,IAAI;AACf,CAAC;AAEDL,oBAAoB,CAACW,GAAG,GAAG,CAACP,MAAM,EAAEQ,KAAK,KAAK;
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","__unid","link","remove","unlink","UnistylesShadowRegistry","exports"],"sourceRo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ativeNitroModules","require","_reactNative","HybridUnistylesStyleSheet","NitroModules","createHybridObject","absoluteFillObject","NativeStyleSheet","absoluteFill","flatten","compose","jsMethods","processColor","StyleSheet","exports"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AA+BA,MAAME,yBAAyB,GAAGC,qCAAY,CACzCC,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnEF,yBAAyB,CAACG,kBAAkB,GAAGC,uBAAgB,CAACD,kBAAkB;AAClFH,yBAAyB,CAACK,YAAY,GAAGD,uBAAgB,CAACC,YAAY;AACtEL,yBAAyB,CAACM,OAAO,GAAGF,uBAAgB,CAACE,OAAO;AAC5DN,yBAAyB,CAACO,OAAO,GAAGH,uBAAgB,CAACG,OAAO;AAC5DP,yBAAyB,CAACQ,SAAS,GAAG;EAClCC,YAAY,EAAZA;AACJ,CAAC;
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","_reactNative","HybridUnistylesStyleSheet","NitroModules","createHybridObject","absoluteFillObject","NativeStyleSheet","absoluteFill","flatten","compose","jsMethods","processColor","StyleSheet","exports"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AA+BA,MAAME,yBAAyB,GAAGC,qCAAY,CACzCC,kBAAkB,CAAsB,qBAAqB,CAAC;AAEnEF,yBAAyB,CAACG,kBAAkB,GAAGC,uBAAgB,CAACD,kBAAkB;AAClFH,yBAAyB,CAACK,YAAY,GAAGD,uBAAgB,CAACC,YAAY;AACtEL,yBAAyB,CAACM,OAAO,GAAGF,uBAAgB,CAACE,OAAO;AAC5DN,yBAAyB,CAACO,OAAO,GAAGH,uBAAgB,CAACG,OAAO;AAC5DP,yBAAyB,CAACQ,SAAS,GAAG;EAClCC,YAAY,EAAZA;AACJ,CAAC;AAIM,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAGV,yBAAsE","ignoreList":[]}
|
@@ -7,7 +7,7 @@ var _exportNames = {
|
|
7
7
|
getSSRUnistyles: true
|
8
8
|
};
|
9
9
|
exports.getSSRUnistyles = void 0;
|
10
|
-
var _web = require("
|
10
|
+
var _web = require("../web");
|
11
11
|
Object.keys(_web).forEach(function (key) {
|
12
12
|
if (key === "default" || key === "__esModule") return;
|
13
13
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getBoxShadowStyle = void 0;
|
7
|
+
var _typestyle = require("typestyle");
|
8
|
+
var _utils = require("../utils");
|
9
|
+
var _shadow = require("./shadow");
|
10
|
+
var _breakpoint = require("./breakpoint");
|
11
|
+
var _types = require("./types");
|
12
|
+
var _utils2 = require("./utils");
|
13
|
+
const createBoxShadowValue = style => {
|
14
|
+
// at this point every prop is present
|
15
|
+
const {
|
16
|
+
shadowColor,
|
17
|
+
shadowOffset,
|
18
|
+
shadowOpacity,
|
19
|
+
shadowRadius
|
20
|
+
} = style;
|
21
|
+
const offsetX = (0, _utils2.normalizeNumericValue)(shadowOffset.width);
|
22
|
+
const offsetY = (0, _utils2.normalizeNumericValue)(shadowOffset.height);
|
23
|
+
const radius = (0, _utils2.normalizeNumericValue)(shadowRadius);
|
24
|
+
const color = (0, _utils2.normalizeColor)(shadowColor, shadowOpacity);
|
25
|
+
return `${offsetX} ${offsetY} ${radius} ${color}`;
|
26
|
+
};
|
27
|
+
const getBoxShadowStyle = styles => {
|
28
|
+
const missingStyles = _types.BOX_SHADOW_STYLES.filter(key => !(key in styles));
|
29
|
+
if (missingStyles.length) {
|
30
|
+
(0, _utils.warn)(`can't apply box shadow as you miss these properties: ${missingStyles.join(', ')}`);
|
31
|
+
return {};
|
32
|
+
}
|
33
|
+
const breakpointsSet = new Set();
|
34
|
+
try {
|
35
|
+
(0, _shadow.validateShadow)(_types.BOX_SHADOW_STYLES, styles, breakpointsSet);
|
36
|
+
} catch (error) {
|
37
|
+
if (typeof error === 'string') {
|
38
|
+
(0, _utils.warn)(error);
|
39
|
+
}
|
40
|
+
return {};
|
41
|
+
}
|
42
|
+
const breakpoints = Array.from(breakpointsSet);
|
43
|
+
|
44
|
+
// If no breakpoints were used return styles without media queries
|
45
|
+
if (breakpoints.length === 0) {
|
46
|
+
return {
|
47
|
+
boxShadow: createBoxShadowValue(styles)
|
48
|
+
};
|
49
|
+
}
|
50
|
+
|
51
|
+
// Create boxShadow for each breakpoint
|
52
|
+
const breakpointStyles = breakpoints.map(breakpoint => {
|
53
|
+
const color = (0, _utils2.extractShadowValue)('shadowColor', breakpoint, styles);
|
54
|
+
const {
|
55
|
+
width,
|
56
|
+
height
|
57
|
+
} = (0, _utils2.extractShadowValue)('shadowOffset', breakpoint, styles);
|
58
|
+
const radius = (0, _utils2.extractShadowValue)('shadowRadius', breakpoint, styles);
|
59
|
+
const opacity = (0, _utils2.extractShadowValue)('shadowOpacity', breakpoint, styles);
|
60
|
+
return (0, _typestyle.media)((0, _breakpoint.convertBreakpoint)(breakpoint), {
|
61
|
+
boxShadow: createBoxShadowValue({
|
62
|
+
shadowColor: color,
|
63
|
+
shadowOffset: {
|
64
|
+
width,
|
65
|
+
height
|
66
|
+
},
|
67
|
+
shadowRadius: radius,
|
68
|
+
shadowOpacity: opacity
|
69
|
+
})
|
70
|
+
});
|
71
|
+
});
|
72
|
+
|
73
|
+
// Merge all breakpoints styles into one
|
74
|
+
return (0, _utils.deepMergeObjects)(...breakpointStyles);
|
75
|
+
};
|
76
|
+
exports.getBoxShadowStyle = getBoxShadowStyle;
|
77
|
+
//# sourceMappingURL=boxShadow.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_typestyle","require","_utils","_shadow","_breakpoint","_types","_utils2","createBoxShadowValue","style","shadowColor","shadowOffset","shadowOpacity","shadowRadius","offsetX","normalizeNumericValue","width","offsetY","height","radius","color","normalizeColor","getBoxShadowStyle","styles","missingStyles","BOX_SHADOW_STYLES","filter","key","length","warn","join","breakpointsSet","Set","validateShadow","error","breakpoints","Array","from","boxShadow","breakpointStyles","map","breakpoint","extractShadowValue","opacity","media","convertBreakpoint","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/boxShadow.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,MAAMM,oBAAoB,GAAIC,KAAgB,IAAK;EAC/C;EACA,MAAM;IAAEC,WAAW;IAAEC,YAAY;IAAEC,aAAa;IAAEC;EAAa,CAAC,GAAGJ,KAAK;EACxE,MAAMK,OAAO,GAAG,IAAAC,6BAAqB,EAACJ,YAAY,CAACK,KAAK,CAAC;EACzD,MAAMC,OAAO,GAAG,IAAAF,6BAAqB,EAACJ,YAAY,CAACO,MAAM,CAAC;EAC1D,MAAMC,MAAM,GAAG,IAAAJ,6BAAqB,EAACF,YAAY,CAAC;EAClD,MAAMO,KAAK,GAAG,IAAAC,sBAAc,EAACX,WAAW,EAAYE,aAAuB,CAAC;EAE5E,OAAO,GAAGE,OAAO,IAAIG,OAAO,IAAIE,MAAM,IAAIC,KAAK,EAAE;AACrD,CAAC;AAEM,MAAME,iBAAiB,GAAIC,MAA2B,IAA0B;EACnF,MAAMC,aAAa,GAAGC,wBAAiB,CAACC,MAAM,CAACC,GAAG,IAAI,EAAEA,GAAG,IAAIJ,MAAM,CAAC,CAAC;EAEvE,IAAIC,aAAa,CAACI,MAAM,EAAE;IACtB,IAAAC,WAAI,EAAC,wDAAwDL,aAAa,C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AC;IACL,CAAC,CAAC;EACN,CAAC,CAAC;;EAEF;EACA,OAAO,IAAAG,uBAAgB,EAAC,GAAGP,gBAAgB,CAAC;AAChD,CAAC;AAAAQ,OAAA,CAAAzB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.convertBreakpoint = void 0;
|
7
|
+
var _state = require("../state");
|
8
|
+
var _utils = require("../utils");
|
9
|
+
var _mq = require("../mq");
|
10
|
+
var _types = require("../../specs/types");
|
11
|
+
const convertBreakpoint = breakpoint => {
|
12
|
+
if (Object.values(_types.Orientation).includes(breakpoint)) {
|
13
|
+
return {
|
14
|
+
orientation: breakpoint
|
15
|
+
};
|
16
|
+
}
|
17
|
+
if ((0, _mq.isUnistylesMq)(breakpoint)) {
|
18
|
+
return (0, _mq.parseMq)(breakpoint);
|
19
|
+
}
|
20
|
+
return {
|
21
|
+
minWidth: _state.UnistylesState.breakpoints && (0, _utils.keyInObject)(_state.UnistylesState.breakpoints, breakpoint) ? _state.UnistylesState.breakpoints[breakpoint] : undefined
|
22
|
+
};
|
23
|
+
};
|
24
|
+
exports.convertBreakpoint = convertBreakpoint;
|
25
|
+
//# sourceMappingURL=breakpoint.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_state","require","_utils","_mq","_types","convertBreakpoint","breakpoint","Object","values","Orientation","includes","orientation","isUnistylesMq","parseMq","minWidth","UnistylesState","breakpoints","keyInObject","undefined","exports"],"sourceRoot":"../../../../src","sources":["web/convert/breakpoint.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,GAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEO,MAAMI,iBAAiB,GAAIC,UAAkB,IAAiB;EACjE,IAAIC,MAAM,CAACC,MAAM,CAACC,kBAAW,CAAC,CAACC,QAAQ,CAACJ,UAAyB,CAAC,EAAE;IAChE,OAAO;MACHK,WAAW,EAAEL;IACjB,CAAC;EACL;EAEA,IAAI,IAAAM,iBAAa,EAACN,UAAU,CAAC,EAAE;IAC3B,OAAO,IAAAO,WAAO,EAACP,UAAU,CAAC;EAC9B;EAEA,OAAO;IACHQ,QAAQ,EAAEC,qBAAc,CAACC,WAAW,IAAI,IAAAC,kBAAW,EAACF,qBAAc,CAACC,WAAW,EAAEV,UAAU,CAAC,GAAGS,qBAAc,CAACC,WAAW,CAACV,UAAU,CAAC,GAAGY;EAC3I,CAAC;AACL,CAAC;AAAAC,OAAA,CAAAd,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.convertToTypeStyle = void 0;
|
7
|
+
var _typestyle = require("typestyle");
|
8
|
+
var _pseudo = require("../pseudo");
|
9
|
+
var _breakpoint = require("./breakpoint");
|
10
|
+
var _style = require("./style");
|
11
|
+
var _utils = require("../utils");
|
12
|
+
var _transform = require("./transform");
|
13
|
+
var _utils2 = require("./utils");
|
14
|
+
var _textShadow = require("./textShadow");
|
15
|
+
var _boxShadow = require("./boxShadow");
|
16
|
+
const convertToTypeStyle = value => {
|
17
|
+
// Flag to mark if textShadow is already created
|
18
|
+
let hasTextShadow = false;
|
19
|
+
// Flag to mark if boxShadow is already created
|
20
|
+
let hasBoxShadow = false;
|
21
|
+
const stylesArray = Object.entries({
|
22
|
+
...value,
|
23
|
+
...value._web
|
24
|
+
}).flatMap(([unistylesKey, unistylesValue]) => {
|
25
|
+
// Keys to omit
|
26
|
+
if (['_css', '_web', 'variants', 'compoundVariants', 'uni__dependencies'].includes(unistylesKey)) {
|
27
|
+
return [];
|
28
|
+
}
|
29
|
+
|
30
|
+
// Pseudo classes :hover, :before etc.
|
31
|
+
if ((0, _pseudo.isPseudo)(unistylesKey)) {
|
32
|
+
const typestyleValues = convertToTypeStyle(unistylesValue);
|
33
|
+
return {
|
34
|
+
$nest: {
|
35
|
+
[unistylesKey.replace('_', '&:')]: typestyleValues
|
36
|
+
}
|
37
|
+
};
|
38
|
+
}
|
39
|
+
|
40
|
+
// Text shadow
|
41
|
+
if ((0, _utils2.isTextShadow)(unistylesKey)) {
|
42
|
+
if (hasTextShadow) {
|
43
|
+
return [];
|
44
|
+
}
|
45
|
+
hasTextShadow = true;
|
46
|
+
return (0, _textShadow.getTextShadowStyle)(value);
|
47
|
+
}
|
48
|
+
|
49
|
+
// Box shadow
|
50
|
+
if ((0, _utils2.isBoxShadow)(unistylesKey)) {
|
51
|
+
if (hasBoxShadow) {
|
52
|
+
return [];
|
53
|
+
}
|
54
|
+
hasBoxShadow = true;
|
55
|
+
return (0, _boxShadow.getBoxShadowStyle)(value);
|
56
|
+
}
|
57
|
+
|
58
|
+
// Transforms
|
59
|
+
if ((0, _utils2.isTransform)(unistylesKey, unistylesValue)) {
|
60
|
+
return (0, _transform.getTransformStyle)(unistylesValue);
|
61
|
+
}
|
62
|
+
|
63
|
+
// Breakpoints
|
64
|
+
if (typeof unistylesValue === 'object' && unistylesValue !== null) {
|
65
|
+
return Object.entries(unistylesValue).map(([breakpointKey, breakpointValue]) => {
|
66
|
+
return (0, _typestyle.media)((0, _breakpoint.convertBreakpoint)(breakpointKey), (0, _style.getStyle)(unistylesKey, breakpointValue));
|
67
|
+
});
|
68
|
+
}
|
69
|
+
|
70
|
+
// Regular styles
|
71
|
+
return (0, _style.getStyle)(unistylesKey, unistylesValue);
|
72
|
+
});
|
73
|
+
return (0, _utils.deepMergeObjects)(...stylesArray);
|
74
|
+
};
|
75
|
+
exports.convertToTypeStyle = convertToTypeStyle;
|
76
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_typestyle","require","_pseudo","_breakpoint","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","isPseudo","typestyleValues","$nest","replace","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","media","convertBreakpoint","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAEO,MAAMS,kBAAkB,GAAIC,KAAsB,IAAK;EAC1D;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,YAAY,GAAG,KAAK;EAExB,MAAMC,WAAW,GAAGC,MAAM,CAACC,OAAO,CAAC;IAC/B,GAAGL,KAAK;IACR,GAAGA,KAAK,CAACM;EACb,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,CAACC,YAAY,EAAEC,cAAc,CAAC,KAAK;IAC3C;IACA,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,CAAC,CAACC,QAAQ,CAACF,YAAY,CAAC,EAAE;MAC9F,OAAO,EAAE;IACb;;IAEA;IACA,IAAI,IAAAG,gBAAQ,EAACH,YAAY,CAAC,EAAE;MACxB,MAAMI,eAAe,GAAGb,kBAAkB,CAACU,cAAiC,CAAC;MAE7E,OAAO;QACHI,KAAK,EAAE;UACH,CAACL,YAAY,CAACM,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,GAAGF;QACvC;MACJ,CAAC;IACL;;IAEA;IACA,IAAI,IAAAG,oBAAY,EAACP,YAAY,CAAC,EAAE;MAC5B,IAAIP,aAAa,EAAE;QACf,OAAO,EAAE;MACb;MAEAA,aAAa,GAAG,IAAI;MAEpB,OAAO,IAAAe,8BAAkB,EAAChB,KAAK,CAAC;IACpC;;IAEA;IACA,IAAI,IAAAiB,mBAAW,EAACT,YAAY,CAAC,EAAE;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MAEAA,YAAY,GAAG,IAAI;MAEnB,OAAO,IAAAgB,4BAAiB,EAAClB,KAAK,CAAC;IACnC;;IAEA;IACA,IAAI,IAAAmB,mBAAW,EAACX,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAO,IAAAW,4BAAiB,EAACX,cAAc,CAAC;IAC5C;;IAEA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACY,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO,IAAAC,gBAAK,EAAC,IAAAC,6BAAiB,EAACH,aAAa,CAAC,EAAE,IAAAI,eAAQ,EAAClB,YAAY,EAAEe,eAAe,CAAC,CAAC;MAC3F,CAAC,CAAC;IACN;;IAEA;IACA,OAAO,IAAAG,eAAQ,EAAClB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAO,IAAAkB,uBAAgB,EAAC,GAAGxB,WAAW,CAAC;AAC3C,CAAC;AAAAyB,OAAA,CAAA7B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["web/convert/module.d.ts"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.validateShadow = void 0;
|
7
|
+
const validateShadow = (shadowProperties, styles, breakpoints) => {
|
8
|
+
// Collect breakpoints
|
9
|
+
shadowProperties.forEach(key => {
|
10
|
+
const value = styles[key];
|
11
|
+
if (typeof value !== 'object') {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
if (key === 'shadowOffset' || key === 'textShadowOffset') {
|
15
|
+
const {
|
16
|
+
width,
|
17
|
+
height
|
18
|
+
} = value;
|
19
|
+
|
20
|
+
// If shadowOffset.width has breakpoints
|
21
|
+
if (typeof width === 'object') {
|
22
|
+
Object.keys(width).forEach(breakpoint => breakpoints.add(breakpoint));
|
23
|
+
}
|
24
|
+
|
25
|
+
// If shadowOffset.height has breakpoints
|
26
|
+
if (typeof height === 'object') {
|
27
|
+
Object.keys(height).forEach(breakpoint => breakpoints.add(breakpoint));
|
28
|
+
}
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
|
32
|
+
// Collect regular breakpoints
|
33
|
+
Object.keys(value).forEach(breakpoint => breakpoints.add(breakpoint));
|
34
|
+
});
|
35
|
+
|
36
|
+
// Validate if all breakpoints are present
|
37
|
+
shadowProperties.forEach(key => {
|
38
|
+
const value = styles[key];
|
39
|
+
if (typeof value !== 'object') {
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
if (key === 'shadowOffset' || key === 'textShadowOffset') {
|
43
|
+
const {
|
44
|
+
width,
|
45
|
+
height
|
46
|
+
} = value;
|
47
|
+
if (typeof width === 'object') {
|
48
|
+
const missingBreakpoints = Array.from(breakpoints).filter(breakpoint => !(breakpoint in width));
|
49
|
+
if (missingBreakpoints.length) {
|
50
|
+
throw `missing breakpoints in ${key}.width: ${missingBreakpoints.join(', ')}`;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
if (typeof height === 'object') {
|
54
|
+
const missingBreakpoints = Array.from(breakpoints).filter(breakpoint => !(breakpoint in height));
|
55
|
+
if (missingBreakpoints.length) {
|
56
|
+
throw `missing breakpoints in ${key}.height: ${missingBreakpoints.join(', ')}`;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
const missingBreakpoints = Array.from(breakpoints).filter(breakpoint => !(breakpoint in value));
|
62
|
+
if (missingBreakpoints.length) {
|
63
|
+
throw `missing breakpoints in ${key}: ${missingBreakpoints.join(', ')}`;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
};
|
67
|
+
exports.validateShadow = validateShadow;
|
68
|
+
//# sourceMappingURL=shadow.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["validateShadow","shadowProperties","styles","breakpoints","forEach","key","value","width","height","Object","keys","breakpoint","add","missingBreakpoints","Array","from","filter","length","join","exports"],"sourceRoot":"../../../../src","sources":["web/convert/shadow.ts"],"mappings":";;;;;;AAEO,MAAMA,cAAc,GAAGA,CAACC,gBAAuC,EAAEC,MAA2B,EAAEC,WAAwB,KAAK;EAC9H;EACAF,gBAAgB,CAACG,OAAO,CAACC,GAAG,IAAI;IAC5B,MAAMC,KAAK,GAAGJ,MAAM,CAACG,GAAG,CAAC;IAEzB,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC3B;IACJ;IAEA,IAAID,GAAG,KAAK,cAAc,IAAIA,GAAG,KAAK,kBAAkB,EAAE;MACtD,MAAM;QAAEE,KAAK;QAAEC;MAAO,CAAC,GAAGF,KAAqB;;MAE/C;MACA,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;QAC3BE,MAAM,CAACC,IAAI,CAACH,KAAK,CAAC,CAACH,OAAO,CAACO,UAAU,IAAIR,WAAW,CAACS,GAAG,CAACD,UAAU,CAAC,CAAC;MACzE;;MAEA;MACA,IAAI,OAAOH,MAAM,KAAK,QAAQ,EAAE;QAC5BC,MAAM,CAACC,IAAI,CAACF,MAAM,CAAC,CAACJ,OAAO,CAACO,UAAU,IAAIR,WAAW,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