react-native-unistyles 3.0.0-alpha.30 → 3.0.0-alpha.32
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/core/UnistylesCommitHook.cpp +9 -11
- package/cxx/core/UnistylesCommitHook.h +1 -2
- package/cxx/core/UnistylesMountHook.cpp +5 -3
- package/cxx/core/UnistylesMountHook.h +2 -1
- package/cxx/core/UnistylesRegistry.cpp +23 -4
- package/cxx/core/UnistylesRegistry.h +1 -1
- package/cxx/hybridObjects/HybridStyleSheet.cpp +6 -14
- package/cxx/hybridObjects/HybridStyleSheet.h +0 -1
- package/cxx/parser/Parser.cpp +51 -13
- package/cxx/parser/Parser.h +2 -1
- package/cxx/shadowTree/ShadowLeafUpdate.h +2 -1
- package/cxx/shadowTree/ShadowTrafficController.h +48 -15
- package/cxx/shadowTree/ShadowTreeManager.cpp +5 -6
- package/cxx/shadowTree/ShadowTreeManager.h +1 -1
- package/ios/UnistylesModuleOnLoad.mm +1 -3
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/core/createUnistylesComponent.native.js.map +1 -2
- package/lib/commonjs/core/useTheme.js.map +1 -2
- package/lib/commonjs/global.js +2 -1
- package/lib/commonjs/global.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mq.js +4 -1
- package/lib/commonjs/mq.js.map +1 -2
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +2 -1
- package/lib/commonjs/specs/NativePlatform/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/types.js +2 -1
- package/lib/commonjs/specs/ShadowRegistry/types.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -2
- package/lib/commonjs/types/accessibility.js +10 -10
- package/lib/commonjs/types/accessibility.js.map +2 -1
- package/lib/commonjs/types/core.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -2
- package/lib/commonjs/web/convert/shadow.js +1 -5
- package/lib/commonjs/web/convert/types.js.map +1 -1
- package/lib/commonjs/web/index.js.map +1 -2
- package/lib/commonjs/web/registry.js +3 -1
- package/lib/commonjs/web/registry.js.map +1 -2
- package/lib/commonjs/web/runtime.js.map +1 -2
- package/lib/commonjs/web/state.js +5 -1
- package/lib/commonjs/web/state.js.map +1 -2
- package/lib/commonjs/web/utils/common.js +3 -1
- package/lib/commonjs/web/utils/common.js.map +1 -2
- package/lib/commonjs/web/utils/index.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js.map +1 -2
- package/lib/module/common.js.map +1 -1
- package/lib/module/core/createUnistylesComponent.js +4 -3
- package/lib/module/core/createUnistylesComponent.js.map +1 -2
- package/lib/module/core/useBreakpoint.js.map +1 -1
- package/lib/module/core/useBreakpoint.native.js.map +1 -2
- package/lib/module/core/useTheme.native.js.map +1 -2
- package/lib/module/mq.js +4 -1
- package/lib/module/mq.js.map +1 -2
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js +5 -6
- package/lib/module/specs/NativePlatform/index.js.map +1 -1
- package/lib/module/specs/NavigtionBar/index.js.map +1 -2
- package/lib/module/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +2 -1
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -2
- package/lib/module/specs/StatusBar/UnistylesStatusBar.nitro.js.map +2 -1
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js +1 -1
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +1 -0
- package/lib/module/specs/UnistylesRuntime/index.js.map +2 -1
- package/lib/module/specs/index.web.js.map +1 -2
- package/lib/module/specs/types.js +10 -10
- package/lib/module/specs/types.js.map +2 -1
- package/lib/module/types/accessibility.js +10 -10
- package/lib/module/types/accessibility.js.map +1 -2
- package/lib/module/types/common.js +3 -1
- package/lib/module/types/common.js.map +1 -2
- package/lib/module/types/index.js.map +1 -2
- package/lib/module/types/stylesheet.js +2 -2
- package/lib/module/types/variants.js.map +1 -2
- package/lib/module/web/convert/boxShadow.js +1 -4
- package/lib/module/web/convert/boxShadow.js.map +2 -1
- package/lib/module/web/convert/index.js.map +1 -2
- package/lib/module/web/convert/shadow.js +5 -1
- package/lib/module/web/convert/textShadow.js +1 -4
- package/lib/module/web/convert/transform.js.map +2 -1
- package/lib/module/web/convert/types.js.map +1 -1
- package/lib/module/web/index.js +2 -1
- package/lib/module/web/index.js.map +1 -2
- package/lib/module/web/listener.js.map +1 -2
- package/lib/module/web/mock.js.map +1 -2
- package/lib/module/web/registry.js +1 -3
- package/lib/module/web/registry.js.map +2 -1
- package/lib/module/web/runtime.js.map +2 -1
- package/lib/module/web/shadowRegistry.js +1 -9
- package/lib/module/web/state.js +5 -1
- package/lib/module/web/state.js.map +1 -2
- package/lib/module/web/utils/common.js +1 -3
- package/lib/module/web/utils/common.js.map +2 -1
- package/lib/module/web/utils/index.js.map +1 -1
- package/lib/module/web/variants/getVariants.js.map +1 -2
- package/package.json +1 -1
@@ -18,7 +18,7 @@ RootShadowNode::Unshared core::UnistylesCommitHook::shadowTreeWillCommit(
|
|
18
18
|
RootShadowNode::Unshared rootNode = newRootShadowNode;
|
19
19
|
auto unistylesRootNode = std::reinterpret_pointer_cast<core::UnistylesCommitShadowNode>(newRootShadowNode);
|
20
20
|
|
21
|
-
//
|
21
|
+
// this is Unistyles commit, we don't need to override it
|
22
22
|
if (unistylesRootNode->hasUnistylesCommitTrait()) {
|
23
23
|
unistylesRootNode->removeUnistylesCommitTrait();
|
24
24
|
unistylesRootNode->addUnistylesMountTrait();
|
@@ -26,26 +26,24 @@ RootShadowNode::Unshared core::UnistylesCommitHook::shadowTreeWillCommit(
|
|
26
26
|
return newRootShadowNode;
|
27
27
|
}
|
28
28
|
|
29
|
+
// this is React Native / Reanimated commit
|
30
|
+
// merge Unistyles updates before it completes
|
29
31
|
auto& registry = core::UnistylesRegistry::get();
|
32
|
+
auto& shadowLeafUpdates = registry.trafficController.getUpdates();
|
30
33
|
|
31
|
-
|
32
|
-
return newRootShadowNode;
|
33
|
-
}
|
34
|
-
|
35
|
-
auto& shadowLeafUpdates = registry.trafficController._unistylesUpdates;
|
36
|
-
|
34
|
+
// oops, not updates from Unistyles yet, skip it!
|
37
35
|
if (shadowLeafUpdates.size() == 0) {
|
38
36
|
return newRootShadowNode;
|
39
37
|
}
|
40
38
|
|
41
|
-
|
42
|
-
registry.trafficController.stopUnistylesTraffic();
|
39
|
+
auto affectedNodes = shadow::ShadowTreeManager::findAffectedNodes(*rootNode, shadowLeafUpdates);
|
43
40
|
|
44
|
-
|
41
|
+
registry.trafficController.stopUnistylesTraffic();
|
45
42
|
|
43
|
+
// we have few updates, so merge it
|
46
44
|
return std::static_pointer_cast<RootShadowNode>(shadow::ShadowTreeManager::cloneShadowTree(
|
47
45
|
*rootNode,
|
48
|
-
shadowLeafUpdates
|
46
|
+
shadowLeafUpdates,
|
49
47
|
affectedNodes
|
50
48
|
));
|
51
49
|
}
|
@@ -10,7 +10,7 @@ namespace margelo::nitro::unistyles::core {
|
|
10
10
|
using namespace facebook::react;
|
11
11
|
|
12
12
|
struct UnistylesCommitHook : public UIManagerCommitHook {
|
13
|
-
UnistylesCommitHook(std::shared_ptr<UIManager> uiManager
|
13
|
+
UnistylesCommitHook(std::shared_ptr<UIManager> uiManager) : _uiManager{uiManager} {
|
14
14
|
_uiManager->registerCommitHook(*this);
|
15
15
|
}
|
16
16
|
|
@@ -22,7 +22,6 @@ struct UnistylesCommitHook : public UIManagerCommitHook {
|
|
22
22
|
|
23
23
|
private:
|
24
24
|
std::shared_ptr<UIManager> _uiManager;
|
25
|
-
jsi::Runtime* _rt;
|
26
25
|
};
|
27
26
|
|
28
27
|
}
|
@@ -18,9 +18,11 @@ void core::UnistylesMountHook::shadowTreeDidMount(RootShadowNode::Shared const &
|
|
18
18
|
return;
|
19
19
|
}
|
20
20
|
|
21
|
-
// React Native
|
21
|
+
// this is React Native or Reanimated commit
|
22
|
+
// one more time merge Unistyles changes
|
22
23
|
auto& registry = core::UnistylesRegistry::get();
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
if (!registry.trafficController.shouldStop()) {
|
26
|
+
shadow::ShadowTreeManager::updateShadowTree(*_rt);
|
27
|
+
}
|
26
28
|
}
|
@@ -9,7 +9,7 @@ namespace margelo::nitro::unistyles::core {
|
|
9
9
|
using namespace facebook::react;
|
10
10
|
|
11
11
|
struct UnistylesMountHook : public UIManagerMountHook {
|
12
|
-
UnistylesMountHook(std::shared_ptr<UIManager> uiManager) : _uiManager{uiManager} {
|
12
|
+
UnistylesMountHook(std::shared_ptr<UIManager> uiManager, jsi::Runtime& rt) : _uiManager{uiManager}, _rt{&rt} {
|
13
13
|
_uiManager->registerMountHook(*this);
|
14
14
|
}
|
15
15
|
|
@@ -19,6 +19,7 @@ struct UnistylesMountHook : public UIManagerMountHook {
|
|
19
19
|
|
20
20
|
private:
|
21
21
|
std::shared_ptr<UIManager> _uiManager;
|
22
|
+
jsi::Runtime* _rt;
|
22
23
|
};
|
23
24
|
|
24
25
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
#include "UnistylesRegistry.h"
|
2
2
|
#include "UnistylesState.h"
|
3
|
+
#include "Parser.h"
|
3
4
|
|
4
5
|
using namespace margelo::nitro::unistyles;
|
5
6
|
using namespace facebook;
|
@@ -74,16 +75,29 @@ void core::UnistylesRegistry::linkShadowNodeWithUnistyle(
|
|
74
75
|
Variants& variants,
|
75
76
|
std::vector<folly::dynamic>& arguments
|
76
77
|
) {
|
78
|
+
auto parser = parser::Parser(nullptr);
|
79
|
+
shadow::ShadowLeafUpdates updates;
|
80
|
+
|
77
81
|
if (!this->_shadowRegistry[&rt].contains(shadowNodeFamily)) {
|
78
82
|
this->_shadowRegistry[&rt][shadowNodeFamily] = {};
|
79
83
|
}
|
80
84
|
|
81
85
|
std::for_each(unistyles.begin(), unistyles.end(), [&, this](Unistyle::Shared unistyle){
|
82
86
|
this->_shadowRegistry[&rt][shadowNodeFamily].emplace_back(std::make_shared<UnistyleData>(unistyle, variants, arguments));
|
87
|
+
|
88
|
+
// add or update node for shadow leaf updates
|
89
|
+
// dynamic functions are parsed later
|
90
|
+
if (unistyle->type == UnistyleType::Object) {
|
91
|
+
updates[shadowNodeFamily] = parser.parseUnistyleToShadowTreeStyles(rt, unistyle);
|
92
|
+
}
|
83
93
|
});
|
94
|
+
|
95
|
+
this->trafficController.setUpdates(updates);
|
96
|
+
this->trafficController.resumeUnistylesTraffic();
|
84
97
|
}
|
85
98
|
|
86
99
|
void core::UnistylesRegistry::unlinkShadowNodeWithUnistyles(jsi::Runtime& rt, const ShadowNodeFamily* shadowNodeFamily) {
|
100
|
+
this->trafficController.removeFromUpdates(shadowNodeFamily);
|
87
101
|
this->_shadowRegistry[&rt].erase(shadowNodeFamily);
|
88
102
|
}
|
89
103
|
|
@@ -134,16 +148,21 @@ core::DependencyMap core::UnistylesRegistry::buildDependencyMap(jsi::Runtime& rt
|
|
134
148
|
return dependencyMap;
|
135
149
|
}
|
136
150
|
|
137
|
-
|
138
|
-
|
151
|
+
// called from proxied function only, we don't know host
|
152
|
+
// so we need to rebuild all instances as they may have different variants
|
153
|
+
void core::UnistylesRegistry::shadowLeafUpdateFromUnistyle(jsi::Runtime& rt, Unistyle::Shared unistyle) {
|
154
|
+
shadow::ShadowLeafUpdates updates;
|
155
|
+
auto parser = parser::Parser(nullptr);
|
139
156
|
|
140
157
|
for (const auto& [family, unistyles] : this->_shadowRegistry[&rt]) {
|
141
158
|
for (const auto& unistyleData : unistyles) {
|
142
|
-
|
159
|
+
if (unistyleData->unistyle == unistyle) {
|
160
|
+
updates[family] = parser.parseStylesToShadowTreeStyles(rt, {unistyleData});
|
161
|
+
}
|
143
162
|
}
|
144
163
|
}
|
145
164
|
|
146
|
-
|
165
|
+
this->trafficController.setUpdates(updates);
|
147
166
|
}
|
148
167
|
|
149
168
|
std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyleSheetsToRefresh(jsi::Runtime& rt, bool themeDidChange, bool runtimeDidChange) {
|
@@ -42,7 +42,7 @@ struct UnistylesRegistry: public StyleSheetRegistry {
|
|
42
42
|
std::shared_ptr<core::StyleSheet> addStyleSheet(jsi::Runtime& rt, int tag, core::StyleSheetType type, jsi::Object&& rawValue);
|
43
43
|
DependencyMap buildDependencyMap(jsi::Runtime& rt, std::vector<UnistyleDependency>& deps);
|
44
44
|
Unistyle::Shared findUnistyleFromKey(jsi::Runtime& rt, std::string styleKey, int tag);
|
45
|
-
|
45
|
+
void shadowLeafUpdateFromUnistyle(jsi::Runtime& rt, Unistyle::Shared unistyle);
|
46
46
|
shadow::ShadowTrafficController trafficController{};
|
47
47
|
|
48
48
|
private:
|
@@ -230,8 +230,8 @@ void HybridStyleSheet::loadExternalMethods(const jsi::Value& thisValue, jsi::Run
|
|
230
230
|
}
|
231
231
|
|
232
232
|
void HybridStyleSheet::registerHooks(jsi::Runtime& rt) {
|
233
|
-
this->_unistylesCommitHook = std::make_shared<core::UnistylesCommitHook>(this->_uiManager
|
234
|
-
this->_unistylesMountHook = std::make_shared<core::UnistylesMountHook>(this->_uiManager);
|
233
|
+
this->_unistylesCommitHook = std::make_shared<core::UnistylesCommitHook>(this->_uiManager);
|
234
|
+
this->_unistylesMountHook = std::make_shared<core::UnistylesMountHook>(this->_uiManager, rt);
|
235
235
|
}
|
236
236
|
|
237
237
|
void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependency> unistylesDependencies) {
|
@@ -273,14 +273,10 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
|
|
273
273
|
}
|
274
274
|
|
275
275
|
parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, dependentStyleSheets);
|
276
|
-
|
277
|
-
this->notifyJSListeners(dependencies);
|
278
|
-
|
279
|
-
// this is required, otherwise shadow tree will ignore Unistyles commit
|
280
|
-
registry.trafficController.setHasUnistylesCommit(true);
|
281
276
|
parser.rebuildShadowLeafUpdates(dependencyMap);
|
282
|
-
|
283
|
-
|
277
|
+
|
278
|
+
this->notifyJSListeners(dependencies);
|
279
|
+
shadow::ShadowTreeManager::updateShadowTree(rt);
|
284
280
|
});
|
285
281
|
}
|
286
282
|
|
@@ -304,12 +300,8 @@ void HybridStyleSheet::onImeChange() {
|
|
304
300
|
}
|
305
301
|
|
306
302
|
parser.rebuildUnistylesInDependencyMap(rt, dependencyMap, {});
|
307
|
-
|
308
|
-
// this is required, otherwise shadow tree will ignore Unistyles commit
|
309
|
-
registry.trafficController.setHasUnistylesCommit(true);
|
310
303
|
parser.rebuildShadowLeafUpdates(dependencyMap);
|
311
|
-
|
312
|
-
shadow::ShadowTreeManager::updateShadowTree(rt, registry.trafficController._unistylesUpdates[&rt]);
|
304
|
+
shadow::ShadowTreeManager::updateShadowTree(rt);
|
313
305
|
});
|
314
306
|
}
|
315
307
|
|
package/cxx/parser/Parser.cpp
CHANGED
@@ -120,23 +120,33 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
120
120
|
auto& unistyle = unistyleData->unistyle;
|
121
121
|
|
122
122
|
// for RN styles or inline styles, compute styles only once
|
123
|
-
if (unistyle->styleKey == helpers::EXOTIC_STYLE_KEY.c_str()
|
124
|
-
unistyleData->parsedStyle
|
123
|
+
if (unistyle->styleKey == helpers::EXOTIC_STYLE_KEY.c_str()) {
|
124
|
+
if (!unistyleData->parsedStyle.has_value()) {
|
125
|
+
unistyleData->parsedStyle = jsi::Value(rt, unistyle->rawValue).asObject(rt);
|
125
126
|
|
126
|
-
|
127
|
-
|
127
|
+
if (!parsedUnistyles.contains(unistyle)) {
|
128
|
+
parsedUnistyles.emplace(unistyle, true);
|
129
|
+
}
|
128
130
|
}
|
129
131
|
|
130
132
|
continue;
|
131
133
|
}
|
132
134
|
|
135
|
+
// reference Unistyles StyleSheet as we may mix them for one style
|
136
|
+
auto unistyleStyleSheet = unistyle->parent;
|
137
|
+
|
138
|
+
// we may hit now other StyleSheets that are referenced from affected nodes
|
139
|
+
if (unistyleStyleSheet != nullptr && !parsedStyleSheets.contains(unistyleStyleSheet)) {
|
140
|
+
parsedStyleSheets.emplace(unistyleStyleSheet, this->unwrapStyleSheet(rt, unistyleStyleSheet));
|
141
|
+
}
|
142
|
+
|
133
143
|
// StyleSheet might have styles that are not affected
|
134
|
-
if (!parsedStyleSheets[
|
144
|
+
if (!parsedStyleSheets[unistyleStyleSheet].asObject(rt).hasProperty(rt, unistyle->styleKey.c_str())) {
|
135
145
|
continue;
|
136
146
|
}
|
137
147
|
|
138
|
-
unistyle->rawValue = parsedStyleSheets[
|
139
|
-
this->rebuildUnistyle(rt,
|
148
|
+
unistyle->rawValue = parsedStyleSheets[unistyleStyleSheet].asObject(rt).getProperty(rt, unistyle->styleKey.c_str()).asObject(rt);
|
149
|
+
this->rebuildUnistyle(rt, unistyleStyleSheet, unistyle, unistyleData->variants, unistyleData->dynamicFunctionMetadata);
|
140
150
|
unistyleData->parsedStyle = jsi::Value(rt, unistyle->parsedStyle.value()).asObject(rt);
|
141
151
|
|
142
152
|
if (!parsedUnistyles.contains(unistyle)) {
|
@@ -207,7 +217,10 @@ void parser::Parser::rebuildShadowLeafUpdates(core::DependencyMap& dependencyMap
|
|
207
217
|
updates.emplace(shadowNode, std::move(rawProps));
|
208
218
|
}
|
209
219
|
|
210
|
-
registry.trafficController.
|
220
|
+
registry.trafficController.setUpdates(updates);
|
221
|
+
|
222
|
+
// this is required, we need to indicate that there are new changes
|
223
|
+
registry.trafficController.resumeUnistylesTraffic();
|
211
224
|
}
|
212
225
|
|
213
226
|
// first level of StyleSheet, we can expect here different properties than on second level
|
@@ -359,6 +372,11 @@ jsi::Function parser::Parser::createDynamicFunctionProxy(jsi::Runtime& rt, Unist
|
|
359
372
|
|
360
373
|
helpers::defineHiddenProperty(rt, style, helpers::STYLE_DEPENDENCIES, helpers::dependenciesToJSIArray(rt, unistyle->dependencies));
|
361
374
|
|
375
|
+
// update shadow leaf updates to indicate newest changes
|
376
|
+
auto& registry = core::UnistylesRegistry::get();
|
377
|
+
|
378
|
+
registry.shadowLeafUpdateFromUnistyle(rt, unistyle);
|
379
|
+
|
362
380
|
return style;
|
363
381
|
});
|
364
382
|
}
|
@@ -723,15 +741,15 @@ jsi::Value parser::Parser::parseSecondLevel(jsi::Runtime &rt, Unistyle::Shared u
|
|
723
741
|
return parsedStyle;
|
724
742
|
}
|
725
743
|
|
726
|
-
// convert unistyles to
|
727
|
-
|
744
|
+
// convert unistyles to folly with int colors
|
745
|
+
folly::dynamic parser::Parser::parseStylesToShadowTreeStyles(jsi::Runtime& rt, const std::vector<std::shared_ptr<UnistyleData>>& unistyles) {
|
728
746
|
jsi::Object convertedStyles = jsi::Object(rt);
|
729
747
|
auto& state = core::UnistylesRegistry::get().getState(rt);
|
730
748
|
|
731
749
|
for (const auto& unistyleData : unistyles) {
|
750
|
+
// this can happen for exotic stylesheets
|
732
751
|
if (!unistyleData->parsedStyle.has_value()) {
|
733
|
-
|
734
|
-
continue;
|
752
|
+
return nullptr;
|
735
753
|
}
|
736
754
|
|
737
755
|
helpers::enumerateJSIObject(rt, unistyleData->parsedStyle.value(), [&](const std::string& propertyName, jsi::Value& propertyValue){
|
@@ -743,7 +761,27 @@ RawProps parser::Parser::parseStylesToShadowTreeStyles(jsi::Runtime& rt, const s
|
|
743
761
|
});
|
744
762
|
}
|
745
763
|
|
746
|
-
return
|
764
|
+
return jsi::dynamicFromValue(rt, std::move(convertedStyles));
|
765
|
+
}
|
766
|
+
|
767
|
+
folly::dynamic parser::Parser::parseUnistyleToShadowTreeStyles(jsi::Runtime& rt, const Unistyle::Shared unistyle) {
|
768
|
+
jsi::Object convertedStyles = jsi::Object(rt);
|
769
|
+
auto& state = core::UnistylesRegistry::get().getState(rt);
|
770
|
+
|
771
|
+
// can happen for exotic styles
|
772
|
+
if (!unistyle->parsedStyle.has_value()) {
|
773
|
+
return nullptr;
|
774
|
+
}
|
775
|
+
|
776
|
+
helpers::enumerateJSIObject(rt, unistyle->parsedStyle.value(), [&](const std::string& propertyName, jsi::Value& propertyValue){
|
777
|
+
if (this->isColor(propertyName)) {
|
778
|
+
return convertedStyles.setProperty(rt, propertyName.c_str(), jsi::Value(state.parseColor(propertyValue)));
|
779
|
+
}
|
780
|
+
|
781
|
+
convertedStyles.setProperty(rt, propertyName.c_str(), propertyValue);
|
782
|
+
});
|
783
|
+
|
784
|
+
return jsi::dynamicFromValue(rt, std::move(convertedStyles));
|
747
785
|
}
|
748
786
|
|
749
787
|
// check is styleKey contains color
|
package/cxx/parser/Parser.h
CHANGED
@@ -26,6 +26,8 @@ struct Parser {
|
|
26
26
|
void rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants);
|
27
27
|
void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>> styleSheets);
|
28
28
|
void rebuildShadowLeafUpdates(core::DependencyMap& dependencyMap);
|
29
|
+
folly::dynamic parseUnistyleToShadowTreeStyles(jsi::Runtime& rt, const Unistyle::Shared unistyle);
|
30
|
+
folly::dynamic parseStylesToShadowTreeStyles(jsi::Runtime& rt, const std::vector<std::shared_ptr<UnistyleData>>& unistyles);
|
29
31
|
|
30
32
|
private:
|
31
33
|
void rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle, const Variants& variants, std::optional<std::vector<folly::dynamic>>);
|
@@ -42,7 +44,6 @@ private:
|
|
42
44
|
jsi::Value getStylesForVariant(jsi::Runtime& rt, const std::string groupName, jsi::Object&& groupValue, std::optional<std::string> selectedVariant, Variants& variants);
|
43
45
|
jsi::Object parseCompoundVariants(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Object& obj, Variants& variants);
|
44
46
|
bool shouldApplyCompoundVariants(jsi::Runtime& rt, const Variants& variants, jsi::Object& compoundVariant);
|
45
|
-
RawProps parseStylesToShadowTreeStyles(jsi::Runtime& rt, const std::vector<std::shared_ptr<UnistyleData>>& unistyles);
|
46
47
|
bool isColor(const std::string& propertyName);
|
47
48
|
|
48
49
|
std::shared_ptr<HybridUnistylesRuntime> _unistylesRuntime;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
3
|
#include <jsi/jsi.h>
|
4
|
+
#include <folly/dynamic.h>
|
4
5
|
#include <react/renderer/uimanager/UIManager.h>
|
5
6
|
|
6
7
|
namespace margelo::nitro::unistyles::shadow {
|
@@ -8,6 +9,6 @@ namespace margelo::nitro::unistyles::shadow {
|
|
8
9
|
using namespace facebook;
|
9
10
|
using namespace facebook::react;
|
10
11
|
|
11
|
-
using ShadowLeafUpdates = std::unordered_map<const ShadowNodeFamily*,
|
12
|
+
using ShadowLeafUpdates = std::unordered_map<const ShadowNodeFamily*, folly::dynamic>;
|
12
13
|
|
13
14
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
|
+
#import "mutex"
|
3
4
|
#import "ShadowLeafUpdate.h"
|
4
5
|
|
5
6
|
namespace margelo::nitro::unistyles::shadow {
|
@@ -7,31 +8,63 @@ namespace margelo::nitro::unistyles::shadow {
|
|
7
8
|
// Like a traffic officer managing a jam, this struct ensures everything
|
8
9
|
// is synchronized within a set timeframe, controlling flow and preventing chaos.
|
9
10
|
struct ShadowTrafficController {
|
10
|
-
inline bool hasUnistylesCommit() {
|
11
|
-
return _hasCommit;
|
12
|
-
}
|
13
|
-
|
14
|
-
inline void setHasUnistylesCommit(bool hasCommit) {
|
15
|
-
this->_hasCommit = hasCommit;
|
16
|
-
}
|
17
|
-
|
18
11
|
inline bool shouldStop() {
|
19
12
|
return !_canCommit;
|
20
13
|
}
|
21
|
-
|
14
|
+
|
22
15
|
inline void stopUnistylesTraffic() {
|
16
|
+
std::lock_guard<std::mutex> lock(_mutex);
|
17
|
+
|
23
18
|
this->_canCommit = false;
|
24
19
|
}
|
25
|
-
|
20
|
+
|
26
21
|
inline void resumeUnistylesTraffic() {
|
22
|
+
std::lock_guard<std::mutex> lock(_mutex);
|
23
|
+
|
27
24
|
this->_canCommit = true;
|
28
25
|
}
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
|
27
|
+
inline shadow::ShadowLeafUpdates& getUpdates() {
|
28
|
+
std::lock_guard<std::mutex> lock(_mutex);
|
29
|
+
|
30
|
+
return _unistylesUpdates;
|
31
|
+
}
|
32
|
+
|
33
|
+
inline void setUpdates(shadow::ShadowLeafUpdates& newUpdates) {
|
34
|
+
std::lock_guard<std::mutex> lock(_mutex);
|
35
|
+
|
36
|
+
auto& targetUpdates = _unistylesUpdates;
|
37
|
+
|
38
|
+
// this is important as overriding updates may skip some interim changes
|
39
|
+
// Unistyles emits different events so this will make sure that everything is synced
|
40
|
+
std::for_each(newUpdates.begin(), newUpdates.end(), [&targetUpdates](auto& pair){
|
41
|
+
if (targetUpdates.contains(pair.first)) {
|
42
|
+
targetUpdates[pair.first] = std::move(pair.second);
|
43
|
+
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
|
47
|
+
targetUpdates.emplace(pair.first, std::move(pair.second));
|
48
|
+
});
|
49
|
+
}
|
50
|
+
|
51
|
+
inline void removeFromUpdates(const ShadowNodeFamily* family) {
|
52
|
+
auto it = std::find_if(_unistylesUpdates.begin(), _unistylesUpdates.end(), [family](auto& pair){
|
53
|
+
return family == pair.first;
|
54
|
+
});
|
55
|
+
|
56
|
+
if (it != _unistylesUpdates.end()) {
|
57
|
+
_unistylesUpdates.erase(it);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
32
61
|
private:
|
33
|
-
bool
|
34
|
-
|
62
|
+
std::atomic<bool> _canCommit = false;
|
63
|
+
shadow::ShadowLeafUpdates _unistylesUpdates{};
|
64
|
+
|
65
|
+
// this struct should be accessed in thread-safe manner. Otherwise shadow tree updates
|
66
|
+
// from different threads will break it
|
67
|
+
std::mutex _mutex;
|
35
68
|
};
|
36
69
|
|
37
70
|
}
|
@@ -6,14 +6,13 @@ using namespace facebook;
|
|
6
6
|
|
7
7
|
using AffectedNodes = std::unordered_map<const ShadowNodeFamily*, std::unordered_set<int>>;
|
8
8
|
|
9
|
-
void shadow::ShadowTreeManager::updateShadowTree(facebook::jsi::Runtime& rt
|
9
|
+
void shadow::ShadowTreeManager::updateShadowTree(facebook::jsi::Runtime& rt) {
|
10
|
+
auto& registry = core::UnistylesRegistry::get();
|
10
11
|
auto& uiManager = UIManagerBinding::getBinding(rt)->getUIManager();
|
11
12
|
const auto &shadowTreeRegistry = uiManager.getShadowTreeRegistry();
|
12
|
-
auto
|
13
|
-
|
14
|
-
if (registry.trafficController.shouldStop()) {
|
15
|
-
registry.trafficController.setHasUnistylesCommit(true);
|
13
|
+
auto updates = registry.trafficController.getUpdates();
|
16
14
|
|
15
|
+
if (updates.size() == 0) {
|
17
16
|
return;
|
18
17
|
}
|
19
18
|
|
@@ -29,7 +28,7 @@ void shadow::ShadowTreeManager::updateShadowTree(facebook::jsi::Runtime& rt, sha
|
|
29
28
|
affectedNodes
|
30
29
|
));
|
31
30
|
|
32
|
-
// set unistyles
|
31
|
+
// set unistyles trait
|
33
32
|
auto unistylesRootNode = std::reinterpret_pointer_cast<core::UnistylesCommitShadowNode>(newRootNode);
|
34
33
|
|
35
34
|
unistylesRootNode->addUnistylesCommitTrait();
|
@@ -16,7 +16,7 @@ using namespace facebook;
|
|
16
16
|
using AffectedNodes = std::unordered_map<const ShadowNodeFamily *, std::unordered_set<int>>;
|
17
17
|
|
18
18
|
struct ShadowTreeManager {
|
19
|
-
static void updateShadowTree(jsi::Runtime& rt
|
19
|
+
static void updateShadowTree(jsi::Runtime& rt);
|
20
20
|
static AffectedNodes findAffectedNodes(const RootShadowNode& rootNode, ShadowLeafUpdates& updates);
|
21
21
|
static ShadowNode::Unshared cloneShadowTree(const ShadowNode &shadowNode, ShadowLeafUpdates& updates, AffectedNodes& affectedNodes);
|
22
22
|
};
|
@@ -26,8 +26,6 @@ __weak RCTSurfacePresenter* _surfacePresenter;
|
|
26
26
|
// check if this is live reload, if so let's replace UnistylesRuntime with new runtime
|
27
27
|
auto hasUnistylesRuntime = HybridObjectRegistry::hasHybridObject("UnistylesRuntime");
|
28
28
|
|
29
|
-
auto& registry = core::UnistylesRegistry::get();
|
30
|
-
|
31
29
|
if (hasUnistylesRuntime) {
|
32
30
|
HybridObjectRegistry::unregisterHybridObjectConstructor("UnistylesRuntime");
|
33
31
|
HybridObjectRegistry::unregisterHybridObjectConstructor("UnistylesStyleSheet");
|
@@ -40,7 +38,7 @@ __weak RCTSurfacePresenter* _surfacePresenter;
|
|
40
38
|
- (void)createHybrids:(jsi::Runtime&)rt {
|
41
39
|
auto runOnJSThread = ([executor = _runtimeExecutor](std::function<void(jsi::Runtime& rt)> &&callback) {
|
42
40
|
__block auto objcCallback = callback;
|
43
|
-
|
41
|
+
|
44
42
|
[executor execute:^(jsi::Runtime& rt){
|
45
43
|
objcCallback(rt);
|
46
44
|
}];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","isWeb","exports","Platform","OS","isIOS","isAndroid"],"sourceRoot":"../../src","sources":["common.
|
1
|
+
{"version":3,"names":["_reactNative","require","isWeb","exports","Platform","OS","isIOS","isAndroid"],"sourceRoot":"../../src","sources":["common.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAGE,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAMC,KAAK,GAAAH,OAAA,CAAAG,KAAA,GAAGF,qBAAQ,CAACC,EAAE,KAAK,KAAK;AACnC,MAAME,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGH,qBAAQ,CAACC,EAAE,KAAK,SAAS","ignoreList":[]}
|
@@ -1,2 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","createUnistylesComponent","Component","mappings","props","theme","setTheme","useState","UnistylesRuntime","getTheme","setRt","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","componentDependencies","style","uni__dependencies","includes","UnistyleDependency","Theme","some","dependency","prevState","mergedProps","keys","forEach","key","assign","
|
2
|
-
AA,GAAAA,wBAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","createUnistylesComponent","Component","mappings","props","theme","setTheme","useState","UnistylesRuntime","getTheme","setRt","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","componentDependencies","style","uni__dependencies","includes","UnistyleDependency","Theme","some","dependency","prevState","mergedProps","keys","forEach","key","assign","jsx","exports"],"sourceRoot":"../../../src","sources":["core/createUnistylesComponent.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAqG,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAI9F,MAAMW,wBAAwB,GAAGA,CAA+BC,SAAY,EAAEC,QAAqB,KAAK;EAC3G,OAAQC,KAAwB,IAAK;IACjC,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAiBC,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;IAC/E,MAAM,GAAGC,KAAK,CAAC,GAAG,IAAAH,eAAQ,EAAC,CAAC,CAAC;IAE7B,IAAAI,gBAAS,EAAC,MAAM;MACZ,MAAMC,oBAAoB,GAAIC,iBAAU,CAAyBC,iBAAiB,CAACC,YAAY,IAAI;QAC/F,MAAMC,qBAAqB,GAAIZ,KAAK,CAACa,KAAK,EAAEC,iBAAiB,IAAIf,QAAQ,CAACE,KAAK,CAAC,CAACY,KAAK,EAAEC,iBAA+C;QAEvI,IAAIH,YAAY,CAACI,QAAQ,CAACC,yBAAkB,CAACC,KAAK,CAAC,KAAK,CAACL,qBAAqB,IAAGA,qBAAqB,CAACG,QAAQ,CAACC,yBAAkB,CAACC,KAAK,CAAC,CAAC,EAAE;UACxIf,QAAQ,CAACE,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;QACzC;QAEA,IAAIM,YAAY,CAACO,IAAI,CAACC,UAAU,IAAIA,UAAU,IAAI,CAAC,CAAC,KAAK,CAACP,qBAAqB,IAAIA,qBAAqB,CAACM,IAAI,CAACC,UAAU,IAAIA,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE;UAC3Ib,KAAK,CAACc,SAAS,IAAIA,SAAS,GAAG,CAAC,CAAC;QACrC;MACJ,CAAC,CAAC;MAEF,OAAO,MAAM;QACTZ,oBAAoB,CAAC,CAAC;MAC1B,CAAC;IACL,CAAC,EAAE,EAAE,CAAC;IAEN,MAAMa,WAAW,GAAG;MAAE,GAAGtB,QAAQ,CAACE,KAAK;IAAE,CAAsB;IAE/DZ,MAAM,CAACiC,IAAI,CAACtB,KAAK,CAAC,CAACuB,OAAO,CAACC,GAAG,IAAI;MAC9B,IAAIA,GAAG,IAAIH,WAAW,EAAE;QACpBA,WAAW,CAACG,GAAG,CAAC,GAAGnC,MAAM,CAACoC,MAAM,CAACzB,KAAK,CAACwB,GAAG,CAAC,EAAEH,WAAW,CAACG,GAAG,CAAC,CAAC;QAE9D;MACJ;MAEAH,WAAW,CAACG,GAAG,CAAC,GAAGxB,KAAK,CAACwB,GAAG,CAAC;IACjC,CAAC,CAAC;IAEF,oBAAO,IAAAhD,WAAA,CAAAkD,GAAA,EAAC5B,SAAS;MAAA,GAAKuB;IAAW,CAAG,CAAC;EACzC,CAAC;AACL,CAAC;AAAAM,OAAA,CAAA9B,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -1,2 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","require","_web","_listener","_NativePlatform","useTheme","theme","setTheme","useState","UnistylesRuntime","getTheme","useEffect","removeChangeListener","UnistylesListener","addListeners","UnistyleDependency","Theme","exports"],"sourceRoot":"../../../src","sources":["core/useTheme.
|
2
|
-
|
1
|
+
{"version":3,"names":["_react","require","_web","_listener","_NativePlatform","useTheme","theme","setTheme","useState","UnistylesRuntime","getTheme","useEffect","removeChangeListener","UnistylesListener","addListeners","UnistyleDependency","Theme","exports"],"sourceRoot":"../../../src","sources":["core/useTheme.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAGO,MAAMI,QAAQ,GAAGA,CAAA,KAAsB;EAC1C,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAACC,qBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAGC,2BAAiB,CAACC,YAAY,CAAC,CAACC,kCAAkB,CAACC,KAAK,CAAC,EAAE,MAAMT,QAAQ,CAACE,qBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpI,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAON,KAAK;AAChB,CAAC;AAAAW,OAAA,CAAAZ,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/lib/commonjs/global.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["global.
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["global.js"],"mappings":"","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_specs","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_mq","_core"],"sourceRoot":"../../src","sources":["index.
|
1
|
+
{"version":3,"names":["_specs","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_mq","_core"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,GAAA,GAAAb,OAAA;AAEA,IAAAc,KAAA,GAAAd,OAAA","ignoreList":[]}
|
package/lib/commonjs/mq.js
CHANGED
@@ -11,6 +11,7 @@ const getMQValue = value => {
|
|
11
11
|
if (value === null) {
|
12
12
|
return 0;
|
13
13
|
}
|
14
|
+
|
14
15
|
// todo take it from js
|
15
16
|
const breakpoints = {
|
16
17
|
xs: 0,
|
@@ -19,9 +20,11 @@ const getMQValue = value => {
|
|
19
20
|
lg: 800,
|
20
21
|
xl: 1200
|
21
22
|
};
|
23
|
+
|
22
24
|
// @ts-ignore
|
23
25
|
return breakpoints[value] ?? 0;
|
24
26
|
};
|
27
|
+
|
25
28
|
/**
|
26
29
|
* Utility to create cross-platform media queries
|
27
30
|
* @returns - JavaScript symbol to be used in your stylesheet
|
@@ -42,4 +45,4 @@ const mq = exports.mq = {
|
|
42
45
|
}
|
43
46
|
})
|
44
47
|
};
|
45
|
-
//# sourceMappingURL=mq.js.
|
48
|
+
//# sourceMappingURL=mq.js.map
|
package/lib/commonjs/mq.js.map
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
{"version":3,"names":["getMQValue","value","breakpoints","xs","sm","md","lg","xl","mq","exports","only","width","wMin","wMax","Infinity","height","hMin","hMax","and"],"sourceRoot":"../../src","sources":["mq.
|
2
|
-
gnoreList":[]}
|
1
|
+
{"version":3,"names":["getMQValue","value","breakpoints","xs","sm","md","lg","xl","mq","exports","only","width","wMin","wMax","Infinity","height","hMin","hMax","and"],"sourceRoot":"../../src","sources":["mq.ts"],"mappings":";;;;;;AAsBA,MAAMA,UAAU,GAAIC,KAAwB,IAAK;EAC7C,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOA,KAAK;EAChB;EAEA,IAAIA,KAAK,KAAK,IAAI,EAAE;IAChB,OAAO,CAAC;EACZ;;EAEA;EACA,MAAMC,WAAW,GAAG;IAChBC,EAAE,EAAE,CAAC;IACLC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE;EACR,CAAC;;EAED;EACA,OAAOL,WAAW,CAACD,KAAK,CAAC,IAAI,CAAC;AAClC,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMO,EAAa,GAAAC,OAAA,CAAAD,EAAA,GAAG;EACzBE,IAAI,EAAE;IACFC,KAAK,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGC,QAAQ,KAAM,MAAMd,UAAU,CAACY,IAAI,CAAC,KAAKZ,UAAU,CAACa,IAAI,CAAC,GAAyB;IACvIE,MAAM,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGH,QAAQ,KAAM,MAAMd,UAAU,CAACgB,IAAI,CAAC,KAAKhB,UAAU,CAACiB,IAAI,CAAC;EACnH,CAAC;EACDN,KAAK,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGC,QAAQ,MAAM;IAC/DI,GAAG,EAAE;MACDH,MAAM,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGH,QAAQ,KACzD,MAAMd,UAAU,CAACY,IAAI,CAAC,KAAKZ,UAAU,CAACa,IAAI,CAAC,OAAOb,UAAU,CAACgB,IAAI,CAAC,KAAKhB,UAAU,CAACiB,IAAI,CAAC;IAChG;EACJ,CAAC,CAAC;EACFF,MAAM,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGH,QAAQ,MAAM;IAChEI,GAAG,EAAE;MACDP,KAAK,EAAEA,CAACC,IAAuB,GAAG,CAAC,EAAEC,IAAa,GAAGC,QAAQ,KACxD,MAAMd,UAAU,CAACY,IAAI,CAAC,KAAKZ,UAAU,CAACa,IAAI,CAAC,OAAOb,UAAU,CAACgB,IAAI,CAAC,KAAKhB,UAAU,CAACiB,IAAI,CAAC;IAChG;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["UnistyleDependency","exports"],"sourceRoot":"../../../../src","sources":["specs/NativePlatform/NativePlatform.nitro.ts"],"mappings":";;;;;;IAMYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA,OAgC9B;AACA","ignoreList":[]}
|
2
|
+
,CAAC,GAAG,YAAY;EACvEA,kBAAkB,CAACA,kBAAkB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;EACzEA,kBAAkB,CAACA,kBAAkB,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;EACzFA,kBAAkB,CAACA,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;EAC/DA,kBAAkB,CAACA,kBAAkB,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,GAAG,YAAY;EACxEA,kBAAkB,CAACA,kBAAkB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,WAAW;EACtEA,kBAAkB,CAACA,kBAAkB,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,WAAW;EACtEA,kBAAkB,CAACA,kBAAkB,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,GAAG,eAAe;EAC9EA,kBAAkB,CAACA,kBAAkB,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK;AAC9D,CAAC,EAAEA,kBAAkB,KAAAC,OAAA,CAAAD,kBAAA,GAAKA,kBAAkB,GAAG,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_NativePlatform","require"],"sourceRoot":"../../../../src","sources":["specs/NativePlatform/index.
|
1
|
+
{"version":3,"names":["_NativePlatform","require"],"sourceRoot":"../../../../src","sources":["specs/NativePlatform/index.ts"],"mappings":";;;;;;;;;;;AACA,IAAAA,eAAA,GAAAC,OAAA","ignoreList":[]}
|