react-native-unistyles 3.2.2 → 3.2.3
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.
|
@@ -61,9 +61,10 @@ void core::UnistylesRegistry::updateTheme(jsi::Runtime& rt, std::string& themeNa
|
|
|
61
61
|
void core::UnistylesRegistry::linkShadowNodeWithUnistyle(
|
|
62
62
|
jsi::Runtime& rt,
|
|
63
63
|
const ShadowNodeFamily* shadowNodeFamily,
|
|
64
|
-
std::vector<std::shared_ptr<UnistyleData>>& unistylesData
|
|
64
|
+
std::vector<std::shared_ptr<UnistyleData>>& unistylesData,
|
|
65
|
+
std::optional<folly::dynamic> initialScopedUpdate
|
|
65
66
|
) {
|
|
66
|
-
this->trafficController.withLock([this, &rt, &unistylesData, shadowNodeFamily](){
|
|
67
|
+
this->trafficController.withLock([this, &rt, &unistylesData, shadowNodeFamily, &initialScopedUpdate](){
|
|
67
68
|
// Clear suspension state if this family was previously suspended
|
|
68
69
|
if (_suspendedFamilies.erase(shadowNodeFamily) > 0) {
|
|
69
70
|
auto* mutableFamily = const_cast<ShadowNodeFamily*>(shadowNodeFamily);
|
|
@@ -77,6 +78,14 @@ void core::UnistylesRegistry::linkShadowNodeWithUnistyle(
|
|
|
77
78
|
std::for_each(unistylesData.begin(), unistylesData.end(), [this, shadowNodeFamily](std::shared_ptr<UnistyleData> unistyleData){
|
|
78
79
|
this->_shadowRegistry[shadowNodeFamily].emplace_back(unistyleData);
|
|
79
80
|
});
|
|
81
|
+
|
|
82
|
+
// Required for scoped themes to apply on initial mount
|
|
83
|
+
if (initialScopedUpdate.has_value()) {
|
|
84
|
+
shadow::ShadowLeafUpdates updates;
|
|
85
|
+
|
|
86
|
+
updates.emplace(shadowNodeFamily, std::move(*initialScopedUpdate));
|
|
87
|
+
this->trafficController.setUpdates(updates);
|
|
88
|
+
}
|
|
80
89
|
});
|
|
81
90
|
}
|
|
82
91
|
|
|
@@ -40,7 +40,7 @@ struct UnistylesRegistry: public StyleSheetRegistry {
|
|
|
40
40
|
UnistylesState& getState();
|
|
41
41
|
void createState();
|
|
42
42
|
std::vector<std::shared_ptr<core::StyleSheet>> getStyleSheetsToRefresh(std::vector<UnistyleDependency>& unistylesDependencies);
|
|
43
|
-
void linkShadowNodeWithUnistyle(jsi::Runtime& rt, const ShadowNodeFamily*, std::vector<std::shared_ptr<UnistyleData>>& unistylesData);
|
|
43
|
+
void linkShadowNodeWithUnistyle(jsi::Runtime& rt, const ShadowNodeFamily*, std::vector<std::shared_ptr<UnistyleData>>& unistylesData, std::optional<folly::dynamic> initialScopedUpdate = std::nullopt);
|
|
44
44
|
void unlinkShadowNodeWithUnistyles(const ShadowNodeFamily*);
|
|
45
45
|
void suspendShadowNode(const ShadowNodeFamily*);
|
|
46
46
|
bool isSuspended(const ShadowNodeFamily*) const noexcept;
|
|
@@ -94,10 +94,17 @@ jsi::Value HybridShadowRegistry::link(jsi::Runtime &rt, const jsi::Value &thisVa
|
|
|
94
94
|
unistylesData.emplace_back(unistyleData);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
std::optional<folly::dynamic> initialScopedUpdate;
|
|
98
|
+
|
|
99
|
+
if (scopedTheme.has_value()) {
|
|
100
|
+
initialScopedUpdate = parser.parseStylesToShadowTreeStyles(rt, unistylesData);
|
|
101
|
+
}
|
|
102
|
+
|
|
97
103
|
registry.linkShadowNodeWithUnistyle(
|
|
98
104
|
rt,
|
|
99
105
|
&shadowNodeWrapper->getFamily(),
|
|
100
|
-
unistylesData
|
|
106
|
+
unistylesData,
|
|
107
|
+
std::move(initialScopedUpdate)
|
|
101
108
|
);
|
|
102
109
|
|
|
103
110
|
return jsi::Value::undefined();
|
|
@@ -56,5 +56,7 @@ def add_nitrogen_files(spec)
|
|
|
56
56
|
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
57
|
# Enables stricter modular headers
|
|
58
58
|
"DEFINES_MODULE" => "YES",
|
|
59
|
+
# Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
|
|
60
|
+
"SWIFT_INSTALL_OBJC_HEADER" => "NO",
|
|
59
61
|
})
|
|
60
62
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-unistyles",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "NODE_ENV=babel-test jest ./plugin ./src/__tests__",
|
|
@@ -145,13 +145,13 @@
|
|
|
145
145
|
"@babel/plugin-syntax-jsx": "7.28.6",
|
|
146
146
|
"@babel/runtime": "7.28.6",
|
|
147
147
|
"@react-native/babel-preset": "0.83.2",
|
|
148
|
-
"nitrogen": "0.35.
|
|
148
|
+
"nitrogen": "0.35.4",
|
|
149
149
|
"oxfmt": "0.35.0",
|
|
150
150
|
"oxlint": "1.50.0",
|
|
151
151
|
"react": "19.2.0",
|
|
152
152
|
"react-native": "0.83.2",
|
|
153
153
|
"react-native-builder-bob": "0.40.18",
|
|
154
|
-
"react-native-nitro-modules": "0.35.
|
|
154
|
+
"react-native-nitro-modules": "0.35.4",
|
|
155
155
|
"react-native-reanimated": "4.2.2",
|
|
156
156
|
"react-native-web": "0.21.2",
|
|
157
157
|
"typescript": "5.9.3"
|