react-native-unistyles 3.0.0-alpha.37 → 3.0.0-alpha.39
Sign up to get free protection for your applications and to get access to all the features.
- package/android/build.gradle +4 -4
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +13 -30
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +22 -18
- package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +10 -5
- package/cxx/core/UnistyleWrapper.h +27 -10
- package/cxx/core/UnistylesRegistry.cpp +34 -10
- package/cxx/core/UnistylesRegistry.h +2 -2
- package/cxx/hybridObjects/HybridNavigationBar.cpp +0 -4
- package/cxx/hybridObjects/HybridNavigationBar.h +0 -1
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +7 -3
- package/cxx/hybridObjects/HybridStatusBar.cpp +0 -4
- package/cxx/hybridObjects/HybridStatusBar.h +0 -1
- package/cxx/hybridObjects/HybridStyleSheet.cpp +59 -28
- package/cxx/hybridObjects/HybridStyleSheet.h +7 -3
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +37 -6
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +7 -3
- package/cxx/parser/Parser.cpp +7 -7
- package/cxx/parser/Parser.h +2 -2
- package/ios/NativePlatform+ios.swift +2 -4
- package/ios/NativePlatform+keyboard.swift +1 -1
- package/ios/NativePlatformListener+ios.swift +6 -6
- package/ios/UnistylesModuleOnLoad.h +1 -6
- package/lib/commonjs/core/createUnistylesComponent.js +27 -20
- package/lib/commonjs/core/createUnistylesComponent.js.map +1 -1
- package/lib/commonjs/core/createUnistylesComponent.native.js +15 -18
- package/lib/commonjs/core/createUnistylesComponent.native.js.map +1 -1
- package/lib/commonjs/specs/NavigtionBar/index.js +0 -15
- package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +5 -7
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js +0 -5
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js +0 -2
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/commonjs/utils.js +26 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/convert/index.js +1 -1
- package/lib/commonjs/web/convert/object/boxShadow.js +2 -1
- package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -1
- package/lib/commonjs/web/convert/object/objectStyle.js +3 -2
- package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -1
- package/lib/commonjs/web/convert/shadow/boxShadow.js +1 -1
- package/lib/commonjs/web/convert/shadow/textShadow.js +1 -1
- package/lib/commonjs/web/create.js +2 -1
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/index.js +1 -1
- package/lib/commonjs/web/listener.js +18 -2
- package/lib/commonjs/web/listener.js.map +1 -1
- package/lib/commonjs/web/mock.js +1 -2
- package/lib/commonjs/web/mock.js.map +1 -1
- package/lib/commonjs/web/runtime.js +5 -2
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +53 -73
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/utils/common.js +1 -24
- package/lib/commonjs/web/utils/common.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/commonjs/web/variants/getVariants.js +1 -1
- package/lib/module/core/createUnistylesComponent.js +28 -21
- package/lib/module/core/createUnistylesComponent.js.map +1 -1
- package/lib/module/core/createUnistylesComponent.native.js +16 -19
- package/lib/module/core/createUnistylesComponent.native.js.map +1 -1
- package/lib/module/specs/NavigtionBar/index.js +0 -10
- package/lib/module/specs/NavigtionBar/index.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +5 -7
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StatusBar/index.js +1 -6
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/UnistylesRuntime/index.js +0 -2
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/module/utils.js +21 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/convert/index.js +1 -1
- package/lib/module/web/convert/index.js.map +1 -1
- package/lib/module/web/convert/object/boxShadow.js +2 -1
- package/lib/module/web/convert/object/boxShadow.js.map +1 -1
- package/lib/module/web/convert/object/objectStyle.js +2 -1
- package/lib/module/web/convert/object/objectStyle.js.map +1 -1
- package/lib/module/web/convert/shadow/boxShadow.js +1 -1
- package/lib/module/web/convert/shadow/boxShadow.js.map +1 -1
- package/lib/module/web/convert/shadow/textShadow.js +1 -1
- package/lib/module/web/convert/shadow/textShadow.js.map +1 -1
- package/lib/module/web/create.js +2 -1
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/index.js +1 -1
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/listener.js +18 -2
- package/lib/module/web/listener.js.map +1 -1
- package/lib/module/web/mock.js +1 -2
- package/lib/module/web/mock.js.map +1 -1
- package/lib/module/web/runtime.js +6 -3
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +51 -71
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/utils/common.js +0 -22
- package/lib/module/web/utils/common.js.map +1 -1
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/module/web/variants/getVariants.js +1 -1
- package/lib/module/web/variants/getVariants.js.map +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.d.ts +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +2 -4
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts +1 -15
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +3 -3
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/index.d.ts +2 -9
- package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/listener.d.ts.map +1 -1
- package/lib/typescript/src/web/mock.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +1 -1
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts +1 -3
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/common.d.ts +0 -4
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +57 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +69 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +8 -16
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +2 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void_std__vector_UnistyleDependency_.kt → Func_void_UnistylesNativeMiniRuntime.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void.kt → Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +4 -12
- package/nitrogen/generated/android/unistylesOnLoad.cpp +4 -4
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +43 -30
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +2 -8
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +2 -4
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +10 -32
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +0 -2
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +2 -4
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +0 -1
- package/package.json +4 -2
- package/plugin/common.js +19 -2
- package/plugin/index.js +12 -10
- package/plugin/ref.js +80 -15
- package/plugin/style.js +113 -18
- package/src/core/createUnistylesComponent.native.tsx +16 -23
- package/src/core/createUnistylesComponent.tsx +29 -23
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +2 -4
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +0 -1
- package/src/specs/NavigtionBar/index.ts +1 -30
- package/src/specs/ShadowRegistry/index.ts +8 -11
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +0 -1
- package/src/specs/StatusBar/index.ts +2 -17
- package/src/specs/UnistylesRuntime/index.ts +1 -2
- package/src/utils.ts +22 -0
- package/src/web/convert/index.ts +1 -1
- package/src/web/convert/object/boxShadow.ts +2 -1
- package/src/web/convert/object/objectStyle.ts +2 -1
- package/src/web/convert/shadow/boxShadow.ts +1 -1
- package/src/web/convert/shadow/textShadow.ts +1 -1
- package/src/web/create.ts +2 -1
- package/src/web/index.ts +1 -1
- package/src/web/listener.ts +22 -2
- package/src/web/mock.ts +1 -2
- package/src/web/runtime.ts +7 -3
- package/src/web/shadowRegistry.ts +55 -70
- package/src/web/utils/common.ts +0 -26
- package/src/web/utils/unistyle.ts +1 -1
- package/src/web/variants/getVariants.ts +1 -1
- package/nitrogen/generated/android/c++/JFunc_void.hpp +0 -48
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +0 -60
@@ -205,9 +205,32 @@ UnistylesCxxMiniRuntime HybridUnistylesRuntime::getMiniRuntime() {
|
|
205
205
|
return cxxMiniRuntime;
|
206
206
|
}
|
207
207
|
|
208
|
-
|
209
|
-
|
208
|
+
UnistylesCxxMiniRuntime HybridUnistylesRuntime::buildMiniRuntimeFromNativeRuntime(UnistylesNativeMiniRuntime& nativeMiniRuntime) {
|
209
|
+
UnistylesCxxMiniRuntime cxxMiniRuntime{
|
210
|
+
this->getThemeName(),
|
211
|
+
this->getBreakpoint(),
|
212
|
+
this->getHasAdaptiveThemes(),
|
213
|
+
nativeMiniRuntime.colorScheme,
|
214
|
+
nativeMiniRuntime.screen,
|
215
|
+
nativeMiniRuntime.contentSizeCategory,
|
216
|
+
nativeMiniRuntime.insets,
|
217
|
+
nativeMiniRuntime.pixelRatio,
|
218
|
+
nativeMiniRuntime.fontScale,
|
219
|
+
nativeMiniRuntime.rtl,
|
220
|
+
nativeMiniRuntime.statusBar,
|
221
|
+
nativeMiniRuntime.navigationBar,
|
222
|
+
nativeMiniRuntime.isPortrait,
|
223
|
+
nativeMiniRuntime.isLandscape
|
224
|
+
};
|
225
|
+
|
226
|
+
return cxxMiniRuntime;
|
227
|
+
}
|
228
|
+
|
229
|
+
jsi::Value HybridUnistylesRuntime::getMiniRuntimeAsValue(jsi::Runtime& rt, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
|
210
230
|
jsi::Object obj(rt);
|
231
|
+
auto miniRuntime = maybeMiniRuntime.has_value()
|
232
|
+
? this->buildMiniRuntimeFromNativeRuntime(maybeMiniRuntime.value())
|
233
|
+
: this->getMiniRuntime();
|
211
234
|
|
212
235
|
// auto generated by nitro, but can't be accessed due to static inline function
|
213
236
|
obj.setProperty(rt, "themeName", JSIConverter<std::optional<std::string>>::toJSI(rt, miniRuntime.themeName));
|
@@ -228,16 +251,20 @@ jsi::Value HybridUnistylesRuntime::getMiniRuntimeAsValue(jsi::Runtime& rt) {
|
|
228
251
|
return obj;
|
229
252
|
}
|
230
253
|
|
231
|
-
void HybridUnistylesRuntime::registerPlatformListener(const std::function<void(std::vector<UnistyleDependency>)>& listener) {
|
232
|
-
this->_nativePlatform.registerPlatformListener(listener);
|
254
|
+
void HybridUnistylesRuntime::registerPlatformListener(const std::function<void (std::vector<UnistyleDependency>)>& listener) {
|
233
255
|
this->_onDependenciesChange = listener;
|
234
256
|
}
|
235
257
|
|
236
|
-
void HybridUnistylesRuntime::
|
258
|
+
void HybridUnistylesRuntime::registerNativePlatformListener(const std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)>& listener) {
|
259
|
+
this->_nativePlatform.registerPlatformListener(listener);
|
260
|
+
this->_onNativeDependenciesChange = listener;
|
261
|
+
}
|
262
|
+
|
263
|
+
void HybridUnistylesRuntime::registerImeListener(const std::function<void(UnistylesNativeMiniRuntime)>& listener) {
|
237
264
|
this->_nativePlatform.registerImeListener(listener);
|
238
265
|
}
|
239
266
|
|
240
|
-
void HybridUnistylesRuntime::
|
267
|
+
void HybridUnistylesRuntime::unregisterNativePlatformListeners() {
|
241
268
|
this->_nativePlatform.unregisterPlatformListeners();
|
242
269
|
}
|
243
270
|
|
@@ -252,3 +279,7 @@ void HybridUnistylesRuntime::includeDependenciesForColorSchemeChange(std::vector
|
|
252
279
|
|
253
280
|
this->calculateNewThemeAndDependencies(deps);
|
254
281
|
}
|
282
|
+
|
283
|
+
jsi::Runtime& HybridUnistylesRuntime::getRuntime() {
|
284
|
+
return *this->_rt;
|
285
|
+
}
|
@@ -56,8 +56,9 @@ struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
|
|
56
56
|
double getPixelRatio() override;
|
57
57
|
double getFontScale() override;
|
58
58
|
void registerPlatformListener(const std::function<void(std::vector<UnistyleDependency>)>& listener);
|
59
|
-
void
|
60
|
-
void
|
59
|
+
void registerNativePlatformListener(const std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)>& listener);
|
60
|
+
void registerImeListener(const std::function<void(UnistylesNativeMiniRuntime)>& listener);
|
61
|
+
void unregisterNativePlatformListeners();
|
61
62
|
|
62
63
|
void setTheme(const std::string &themeName) override;
|
63
64
|
void setAdaptiveThemes(bool isEnabled) override;
|
@@ -66,7 +67,9 @@ struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
|
|
66
67
|
UnistylesCxxMiniRuntime getMiniRuntime() override;
|
67
68
|
std::unordered_map<std::string, double> getBreakpoints() override;
|
68
69
|
|
69
|
-
jsi::
|
70
|
+
jsi::Runtime& getRuntime();
|
71
|
+
UnistylesCxxMiniRuntime buildMiniRuntimeFromNativeRuntime(UnistylesNativeMiniRuntime& nativeMiniRuntime);
|
72
|
+
jsi::Value getMiniRuntimeAsValue(jsi::Runtime& rt, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime);
|
70
73
|
void includeDependenciesForColorSchemeChange(std::vector<UnistyleDependency>& deps);
|
71
74
|
void calculateNewThemeAndDependencies(std::vector<UnistyleDependency>& deps);
|
72
75
|
std::function<void(std::function<void(jsi::Runtime&)>&&)> runOnJSThread;
|
@@ -77,6 +80,7 @@ private:
|
|
77
80
|
std::shared_ptr<HybridStatusBar> _statusBar;
|
78
81
|
Unistyles::HybridNativePlatformSpecCxx _nativePlatform;
|
79
82
|
std::function<void(std::vector<UnistyleDependency>)> _onDependenciesChange;
|
83
|
+
std::function<void(std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime)> _onNativeDependenciesChange;
|
80
84
|
};
|
81
85
|
|
82
86
|
}
|
package/cxx/parser/Parser.cpp
CHANGED
@@ -9,7 +9,7 @@ using Variants = std::vector<std::pair<std::string, std::string>>;
|
|
9
9
|
|
10
10
|
// called only once while processing StyleSheet.create
|
11
11
|
void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet) {
|
12
|
-
jsi::Object unwrappedStyleSheet = this->unwrapStyleSheet(rt, styleSheet);
|
12
|
+
jsi::Object unwrappedStyleSheet = this->unwrapStyleSheet(rt, styleSheet, std::nullopt);
|
13
13
|
|
14
14
|
helpers::enumerateJSIObject(rt, unwrappedStyleSheet, [&](const std::string& styleKey, jsi::Value& propertyValue){
|
15
15
|
helpers::assertThat(rt, propertyValue.isObject(), "Unistyles: Style with name '" + styleKey + "' is not a function or object.");
|
@@ -36,7 +36,7 @@ void parser::Parser::buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet
|
|
36
36
|
});
|
37
37
|
}
|
38
38
|
|
39
|
-
jsi::Object parser::Parser::unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet) {
|
39
|
+
jsi::Object parser::Parser::unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
|
40
40
|
// firstly we need to get object representation of user's StyleSheet
|
41
41
|
// StyleSheet can be a function or an object
|
42
42
|
|
@@ -58,7 +58,7 @@ jsi::Object parser::Parser::unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<S
|
|
58
58
|
|
59
59
|
// stylesheet also has a mini runtime dependency
|
60
60
|
// StyleSheetType::ThemableWithMiniRuntime
|
61
|
-
auto miniRuntime = this->_unistylesRuntime->getMiniRuntimeAsValue(rt);
|
61
|
+
auto miniRuntime = this->_unistylesRuntime->getMiniRuntimeAsValue(rt, maybeMiniRuntime);
|
62
62
|
|
63
63
|
return styleSheet->rawValue
|
64
64
|
.asFunction(rt)
|
@@ -98,13 +98,13 @@ void parser::Parser::rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_
|
|
98
98
|
}
|
99
99
|
|
100
100
|
// rebuild all unistyles that are affected by platform event
|
101
|
-
void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets) {
|
101
|
+
void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime) {
|
102
102
|
std::unordered_map<std::shared_ptr<StyleSheet>, jsi::Value> parsedStyleSheets{};
|
103
103
|
std::unordered_map<std::shared_ptr<core::Unistyle>, bool> parsedUnistyles{};
|
104
104
|
|
105
105
|
// parse all stylesheets that depends on changes
|
106
106
|
for (auto styleSheet : styleSheets) {
|
107
|
-
parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet));
|
107
|
+
parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
|
108
108
|
}
|
109
109
|
|
110
110
|
// then parse all visible Unistyles managed by Unistyle
|
@@ -113,7 +113,7 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
113
113
|
|
114
114
|
// stylesheet may be optional for exotic unistyles
|
115
115
|
if (styleSheet != nullptr && !parsedStyleSheets.contains(styleSheet)) {
|
116
|
-
parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet));
|
116
|
+
parsedStyleSheets.emplace(styleSheet, this->unwrapStyleSheet(rt, styleSheet, maybeMiniRuntime));
|
117
117
|
}
|
118
118
|
|
119
119
|
for (auto& unistyleData : unistyles) {
|
@@ -137,7 +137,7 @@ void parser::Parser::rebuildUnistylesInDependencyMap(jsi::Runtime& rt, Dependenc
|
|
137
137
|
|
138
138
|
// we may hit now other StyleSheets that are referenced from affected nodes
|
139
139
|
if (unistyleStyleSheet != nullptr && !parsedStyleSheets.contains(unistyleStyleSheet)) {
|
140
|
-
parsedStyleSheets.emplace(unistyleStyleSheet, this->unwrapStyleSheet(rt, unistyleStyleSheet));
|
140
|
+
parsedStyleSheets.emplace(unistyleStyleSheet, this->unwrapStyleSheet(rt, unistyleStyleSheet, maybeMiniRuntime));
|
141
141
|
}
|
142
142
|
|
143
143
|
// StyleSheet might have styles that are not affected
|
package/cxx/parser/Parser.h
CHANGED
@@ -24,13 +24,13 @@ struct Parser {
|
|
24
24
|
void buildUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
25
25
|
void parseUnistyles(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
26
26
|
void rebuildUnistylesWithVariants(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Variants& variants);
|
27
|
-
void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets);
|
27
|
+
void rebuildUnistylesInDependencyMap(jsi::Runtime& rt, core::DependencyMap& dependencyMap, std::vector<std::shared_ptr<core::StyleSheet>>& styleSheets, std::optional<UnistylesNativeMiniRuntime> maybeMiniRuntime);
|
28
28
|
void rebuildShadowLeafUpdates(jsi::Runtime& rt, core::DependencyMap& dependencyMap);
|
29
29
|
folly::dynamic parseStylesToShadowTreeStyles(jsi::Runtime& rt, const std::vector<std::shared_ptr<UnistyleData>>& unistyles);
|
30
30
|
void rebuildUnistyle(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, Unistyle::Shared unistyle, const Variants& variants, std::optional<std::vector<folly::dynamic>>);
|
31
31
|
|
32
32
|
private:
|
33
|
-
jsi::Object unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet);
|
33
|
+
jsi::Object unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<StyleSheet> styleSheet, std::optional<UnistylesNativeMiniRuntime>);
|
34
34
|
jsi::Object parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared unistyle, std::optional<Variants> variants);
|
35
35
|
jsi::Value parseSecondLevel(jsi::Runtime& rt, Unistyle::Shared unistyle, jsi::Value& nestedObject);
|
36
36
|
jsi::Function createDynamicFunctionProxy(jsi::Runtime& rt, Unistyle::Shared unistyle);
|
@@ -4,8 +4,8 @@ import Foundation
|
|
4
4
|
import Combine
|
5
5
|
import NitroModules
|
6
6
|
|
7
|
-
typealias CxxDependencyListener = (Array<UnistyleDependency
|
8
|
-
typealias CxxImeListener = () -> Void
|
7
|
+
typealias CxxDependencyListener = (Array<UnistyleDependency>, UnistylesNativeMiniRuntime) -> Void
|
8
|
+
typealias CxxImeListener = (UnistylesNativeMiniRuntime) -> Void
|
9
9
|
|
10
10
|
class NativeIOSPlatform: HybridNativePlatformSpec {
|
11
11
|
var miniRuntime: UnistylesNativeMiniRuntime?
|
@@ -296,9 +296,7 @@ class NativeIOSPlatform: HybridNativePlatformSpec {
|
|
296
296
|
}
|
297
297
|
|
298
298
|
// not implemented for iOS as there are no such APIs
|
299
|
-
func setNavigationBarBackgroundColor(color: Double) throws {}
|
300
299
|
func setNavigationBarHidden(isHidden: Bool) throws {}
|
301
|
-
func setStatusBarBackgroundColor(color: Double) throws {}
|
302
300
|
|
303
301
|
// implemented from JS
|
304
302
|
func setImmersiveMode(isEnabled: Bool) throws {}
|
@@ -72,8 +72,8 @@ extension NativeIOSPlatform {
|
|
72
72
|
// Interpolate between 'from' and 'to'
|
73
73
|
keyboardAnimation.animatedImeInset = keyboardAnimation.from + (keyboardAnimation.to - keyboardAnimation.from) * CGFloat(easedProgress)
|
74
74
|
|
75
|
-
self.emitImeEvent()
|
76
75
|
self.miniRuntime?.insets.ime = keyboardAnimation.animatedImeInset
|
76
|
+
self.emitImeEvent(updatedMiniRuntime: self.miniRuntime!)
|
77
77
|
|
78
78
|
if linearProgress >= 1 {
|
79
79
|
keyboardAnimation.displayLink?.invalidate()
|
@@ -20,16 +20,16 @@ extension NativeIOSPlatform {
|
|
20
20
|
self.dependencyListeners.append(callback)
|
21
21
|
}
|
22
22
|
|
23
|
-
func registerImeListener(callback: @escaping (() -> Void)) throws {
|
23
|
+
func registerImeListener(callback: @escaping ((UnistylesNativeMiniRuntime) -> Void)) throws {
|
24
24
|
self.imeListeners.append(callback)
|
25
25
|
}
|
26
26
|
|
27
|
-
func emitCxxEvent(dependencies: Array<UnistyleDependency
|
28
|
-
self.dependencyListeners.forEach { $0(dependencies) }
|
27
|
+
func emitCxxEvent(dependencies: Array<UnistyleDependency>, updatedMiniRuntime: UnistylesNativeMiniRuntime) {
|
28
|
+
self.dependencyListeners.forEach { $0(dependencies, updatedMiniRuntime) }
|
29
29
|
}
|
30
30
|
|
31
|
-
func emitImeEvent() {
|
32
|
-
self.imeListeners.forEach { $0() }
|
31
|
+
func emitImeEvent(updatedMiniRuntime: UnistylesNativeMiniRuntime) {
|
32
|
+
self.imeListeners.forEach { $0(updatedMiniRuntime) }
|
33
33
|
}
|
34
34
|
|
35
35
|
func unregisterPlatformListeners() {
|
@@ -48,7 +48,7 @@ extension NativeIOSPlatform {
|
|
48
48
|
|
49
49
|
if (changedDependencies.count > 0) {
|
50
50
|
self.miniRuntime = newMiniRuntime
|
51
|
-
self.emitCxxEvent(dependencies: changedDependencies)
|
51
|
+
self.emitCxxEvent(dependencies: changedDependencies, updatedMiniRuntime: newMiniRuntime)
|
52
52
|
}
|
53
53
|
}
|
54
54
|
}
|
@@ -4,18 +4,13 @@
|
|
4
4
|
#error "Unistyles 3.0 requires your project to have New Architecture enabled."
|
5
5
|
#endif
|
6
6
|
|
7
|
-
#if __has_include(<ReactCommon/RCTTurboModuleWithJSIBindings.h>)
|
8
|
-
#import <ReactCommon/RCTTurboModuleWithJSIBindings.h>
|
9
|
-
#else
|
10
|
-
#error "Unistyles 3.0 requires your project to use React Native 0.75 or higher."
|
11
|
-
#endif
|
12
|
-
|
13
7
|
#import <React/RCTEventEmitter.h>
|
14
8
|
#import "TurboUnistyles/TurboUnistyles.h"
|
15
9
|
#import <React/RCTSurfacePresenter.h>
|
16
10
|
#import <React/RCTScheduler.h>
|
17
11
|
#import <React/RCTRuntimeExecutorModule.h>
|
18
12
|
#import <ReactCommon/RCTRuntimeExecutor.h>
|
13
|
+
#import <ReactCommon/RCTTurboModuleWithJSIBindings.h>
|
19
14
|
|
20
15
|
@interface UnistylesModule: RCTEventEmitter<NativeTurboUnistylesSpec>
|
21
16
|
@end
|
@@ -10,33 +10,40 @@ var _NativePlatform = require("../specs/NativePlatform");
|
|
10
10
|
var _listener = require("../web/listener");
|
11
11
|
var _web = require("../web");
|
12
12
|
var _utils = require("../web/utils");
|
13
|
+
var _utils2 = require("../utils");
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
14
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
15
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
16
17
|
const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'];
|
17
18
|
const ALL_DEPENDENCIES = Object.values(_NativePlatform.UnistyleDependency).filter(dependency => typeof dependency === 'number');
|
18
19
|
const useShadowRegistry = style => {
|
19
|
-
const [classNames, setClassNames] = (0, _react.useState)([]);
|
20
20
|
const [ref] = (0, _react.useState)(document.createElement('div'));
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
const oldClassNames = (0, _react.useRef)([]);
|
22
|
+
const classNames = (0, _react.useMemo)(() => {
|
23
|
+
if (!style) {
|
24
|
+
return [];
|
25
|
+
}
|
26
|
+
const newClassNames = _web.UnistylesShadowRegistry.add(ref, [style], undefined, []) ?? [];
|
27
|
+
if ((0, _utils.equal)(oldClassNames.current, newClassNames)) {
|
28
|
+
return oldClassNames.current;
|
29
|
+
}
|
30
|
+
oldClassNames.current = newClassNames;
|
31
|
+
return newClassNames;
|
32
|
+
}, [style]);
|
29
33
|
(0, _react.useEffect)(() => () => {
|
30
34
|
// Remove styles on unmount
|
31
|
-
|
35
|
+
if (style) {
|
36
|
+
_web.UnistylesShadowRegistry.add(null, [style], undefined, []);
|
37
|
+
}
|
32
38
|
});
|
33
39
|
return classNames;
|
34
40
|
};
|
35
41
|
const createUnistylesComponent = (Component, mappings) => {
|
36
|
-
return props => {
|
42
|
+
return /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
43
|
+
const narrowedProps = props;
|
37
44
|
const [mappingsProps, setMappingsProps] = (0, _react.useState)(mappings?.(_specs.UnistylesRuntime.getTheme()));
|
38
|
-
const styleClassNames = useShadowRegistry(
|
39
|
-
const contentContainerStyleClassNames = useShadowRegistry(
|
45
|
+
const styleClassNames = useShadowRegistry(narrowedProps.style);
|
46
|
+
const contentContainerStyleClassNames = useShadowRegistry(narrowedProps.contentContainerStyle);
|
40
47
|
(0, _react.useEffect)(() => {
|
41
48
|
const disposeMappings = _listener.UnistylesListener.addListeners(ALL_DEPENDENCIES, () => {
|
42
49
|
if (!mappings) {
|
@@ -46,17 +53,16 @@ const createUnistylesComponent = (Component, mappings) => {
|
|
46
53
|
return setMappingsProps(mappings(_specs.UnistylesRuntime.getTheme()));
|
47
54
|
});
|
48
55
|
return () => disposeMappings();
|
49
|
-
}, [mappingsProps,
|
56
|
+
}, [mappingsProps, narrowedProps.style]);
|
50
57
|
const combinedProps = {
|
51
|
-
...mappingsProps,
|
52
|
-
...
|
53
|
-
...(props.style ? {
|
58
|
+
...(0, _utils2.deepMergeObjects)(props, mappingsProps ?? {}),
|
59
|
+
...(narrowedProps.style ? {
|
54
60
|
style: {
|
55
61
|
$$css: true,
|
56
62
|
'unistyles': styleClassNames.join(' ')
|
57
63
|
}
|
58
64
|
} : {}),
|
59
|
-
...(
|
65
|
+
...(narrowedProps.contentContainerStyle ? {
|
60
66
|
style: {
|
61
67
|
$$css: true,
|
62
68
|
'unistyles': contentContainerStyleClassNames.join(' ')
|
@@ -64,9 +70,10 @@ const createUnistylesComponent = (Component, mappings) => {
|
|
64
70
|
} : {})
|
65
71
|
};
|
66
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
67
|
-
...combinedProps
|
73
|
+
...combinedProps,
|
74
|
+
ref: ref
|
68
75
|
});
|
69
|
-
};
|
76
|
+
});
|
70
77
|
};
|
71
78
|
exports.createUnistylesComponent = createUnistylesComponent;
|
72
79
|
//# sourceMappingURL=createUnistylesComponent.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_NativePlatform","_listener","_web","_utils","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SUPPORTED_STYLE_PROPS","ALL_DEPENDENCIES","values","UnistyleDependency","filter","dependency","useShadowRegistry","style","
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_NativePlatform","_listener","_web","_utils","_utils2","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SUPPORTED_STYLE_PROPS","ALL_DEPENDENCIES","values","UnistyleDependency","filter","dependency","useShadowRegistry","style","ref","useState","document","createElement","oldClassNames","useRef","classNames","useMemo","newClassNames","UnistylesShadowRegistry","add","undefined","equal","current","useEffect","createUnistylesComponent","Component","mappings","forwardRef","props","narrowedProps","mappingsProps","setMappingsProps","UnistylesRuntime","getTheme","styleClassNames","contentContainerStyleClassNames","contentContainerStyle","disposeMappings","UnistylesListener","addListeners","combinedProps","deepMergeObjects","$$css","join","jsx","exports"],"sourceRoot":"../../../src","sources":["core/createUnistylesComponent.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,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,SAAAV,wBAAAU,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,GA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CAACrB,KAAK,CAAC,CAAC;IAExC,MAAMgC,aAAa,GAAG;MAClB,GAAG,IAAAC,wBAAgB,EAACb,KAAK,EAAGE,aAAa,IAAI,CAAC,CAAY,CAAC;MAC3D,IAAGD,aAAa,CAACrB,KAAK,GAAG;QACrBA,KAAK,EAAE;UACHkC,KAAK,EAAE,IAAI;UACX,WAAW,EAAER,eAAe,CAACS,IAAI,CAAC,GAAG;QACzC;MACJ,CAAC,GAAG,CAAC,CAAC;MACN,IAAGd,aAAa,CAACO,qBAAqB,GAAG;QACrC5B,KAAK,EAAE;UACHkC,KAAK,EAAE,IAAI;UACX,WAAW,EAAEP,+BAA+B,CAACQ,IAAI,CAAC,GAAG;QACzD;MACJ,CAAC,GAAG,CAAC,CAAC;IACV,CAAsB;IAEtB,oBAAO,IAAA/D,WAAA,CAAAgE,GAAA,EAACnB,SAAS;MAAA,GAAKe,aAAa;MAAE/B,GAAG,EAAEA;IAAI,CAAE,CAAC;EACrD,CAAC,CAAC;AACN,CAAC;AAAAoC,OAAA,CAAArB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -6,20 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.createUnistylesComponent = void 0;
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
8
8
|
var _specs = require("../specs");
|
9
|
+
var _utils = require("../utils");
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
10
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
11
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
12
13
|
const SUPPORTED_STYLE_PROPS = ['style', 'contentContainerStyle'];
|
13
14
|
const createUnistylesComponent = (Component, mappings) => {
|
14
|
-
return props => {
|
15
|
+
return /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
16
|
+
const narrowedProps = props;
|
15
17
|
const [theme, setTheme] = (0, _react.useState)(_specs.UnistylesRuntime.getTheme());
|
16
18
|
const [, setRt] = (0, _react.useState)(0);
|
17
19
|
const stylesRef = (0, _react.useRef)({});
|
18
20
|
const isForcedRef = (0, _react.useRef)(false);
|
19
21
|
if (!isForcedRef.current) {
|
20
22
|
SUPPORTED_STYLE_PROPS.forEach(propName => {
|
21
|
-
if (
|
22
|
-
if (Array.isArray(
|
23
|
+
if (narrowedProps?.[propName]) {
|
24
|
+
if (Array.isArray(narrowedProps[propName])) {
|
23
25
|
console.error(`🦄 Unistyles: createUnistylesComponent requires ${propName} to be an object. Please check props for component: ${Component.displayName}`);
|
24
26
|
}
|
25
27
|
|
@@ -29,24 +31,24 @@ const createUnistylesComponent = (Component, mappings) => {
|
|
29
31
|
}
|
30
32
|
stylesRef.current = {
|
31
33
|
...stylesRef.current,
|
32
|
-
[propName]:
|
34
|
+
[propName]: narrowedProps[propName]
|
33
35
|
};
|
34
36
|
}
|
35
37
|
});
|
36
38
|
}
|
37
39
|
(0, _react.useEffect)(() => {
|
38
40
|
const removeChangeListener = _specs.StyleSheet.addChangeListener(dependencies => {
|
39
|
-
const componentDependencies =
|
41
|
+
const componentDependencies = narrowedProps.style?.__proto__.uni__dependencies || mappings?.(theme).style?.__proto__.uni__dependencies;
|
40
42
|
if (dependencies.includes(_specs.UnistyleDependency.Theme) && (!componentDependencies || componentDependencies.includes(_specs.UnistyleDependency.Theme))) {
|
41
43
|
setTheme(_specs.UnistylesRuntime.getTheme());
|
42
44
|
|
43
45
|
// override with Unistyles styles
|
44
46
|
SUPPORTED_STYLE_PROPS.forEach(propName => {
|
45
|
-
if (
|
47
|
+
if (narrowedProps?.[propName]) {
|
46
48
|
stylesRef.current = {
|
47
49
|
...stylesRef.current,
|
48
50
|
// @ts-expect-error - this is hidden from TS
|
49
|
-
[propName]: props[propName].__proto__?.getStyle() || props[propName]
|
51
|
+
[propName]: props[propName].__proto__?.getStyle?.() || props[propName]
|
50
52
|
};
|
51
53
|
}
|
52
54
|
});
|
@@ -61,25 +63,20 @@ const createUnistylesComponent = (Component, mappings) => {
|
|
61
63
|
};
|
62
64
|
}, []);
|
63
65
|
const mergedProps = mappings?.(theme) ?? {};
|
64
|
-
|
65
|
-
if (key in mergedProps) {
|
66
|
-
mergedProps[key] = Object.assign(props[key], mergedProps[key]);
|
67
|
-
return;
|
68
|
-
}
|
69
|
-
mergedProps[key] = props[key];
|
70
|
-
});
|
66
|
+
const finalProps = (0, _utils.deepMergeObjects)(mergedProps, props);
|
71
67
|
|
72
68
|
// override with Unistyles styles
|
73
69
|
SUPPORTED_STYLE_PROPS.forEach(propName => {
|
74
|
-
if (
|
75
|
-
|
70
|
+
if (finalProps[propName]) {
|
71
|
+
finalProps[propName] = stylesRef.current[propName];
|
76
72
|
}
|
77
73
|
});
|
78
74
|
isForcedRef.current = false;
|
79
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
80
|
-
...
|
76
|
+
...finalProps,
|
77
|
+
ref: ref
|
81
78
|
});
|
82
|
-
};
|
79
|
+
});
|
83
80
|
};
|
84
81
|
exports.createUnistylesComponent = createUnistylesComponent;
|
85
82
|
//# sourceMappingURL=createUnistylesComponent.native.js.map
|
@@ -1 +1 @@
|
|
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","SUPPORTED_STYLE_PROPS","createUnistylesComponent","Component","mappings","props","theme","setTheme","useState","UnistylesRuntime","getTheme","setRt","stylesRef","useRef","isForcedRef","current","forEach","propName","Array","isArray","console","error","displayName","__unistyles_name","getStyle","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","componentDependencies","style","uni__dependencies","includes","UnistyleDependency","Theme","some","dependency","prevState","mergedProps","
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_specs","_utils","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SUPPORTED_STYLE_PROPS","createUnistylesComponent","Component","mappings","forwardRef","props","ref","narrowedProps","theme","setTheme","useState","UnistylesRuntime","getTheme","setRt","stylesRef","useRef","isForcedRef","current","forEach","propName","Array","isArray","console","error","displayName","__unistyles_name","getStyle","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","componentDependencies","style","uni__dependencies","includes","UnistyleDependency","Theme","some","dependency","prevState","mergedProps","finalProps","deepMergeObjects","jsx","exports"],"sourceRoot":"../../../src","sources":["core/createUnistylesComponent.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAA2C,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,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,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAA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CAAA5C,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -1,17 +1,2 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.attachNavigationBarJSMethods = void 0;
|
7
|
-
var _reactNative = require("react-native");
|
8
|
-
const attachNavigationBarJSMethods = hybridObject => {
|
9
|
-
const privateHybrid = hybridObject;
|
10
|
-
privateHybrid._setBackgroundColor = hybridObject.setBackgroundColor;
|
11
|
-
hybridObject.setBackgroundColor = color => {
|
12
|
-
const parsedColor = (0, _reactNative.processColor)(color) ?? 0;
|
13
|
-
privateHybrid._setBackgroundColor(parsedColor);
|
14
|
-
};
|
15
|
-
};
|
16
|
-
exports.attachNavigationBarJSMethods = attachNavigationBarJSMethods;
|
17
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["specs/NavigtionBar/index.ts"],"mappings":"","ignoreList":[]}
|
@@ -14,17 +14,15 @@ const findShadowNodeForHandle = handle => {
|
|
14
14
|
}
|
15
15
|
return node;
|
16
16
|
};
|
17
|
-
HybridShadowRegistry.add = (handle,
|
17
|
+
HybridShadowRegistry.add = (handle, styles, variants, args) => {
|
18
18
|
// virtualized nodes can be null
|
19
|
-
if (!handle || !
|
19
|
+
if (!handle || !styles || !Array.isArray(styles)) {
|
20
20
|
return;
|
21
21
|
}
|
22
22
|
|
23
|
-
//
|
24
|
-
|
25
|
-
|
26
|
-
}
|
27
|
-
HybridShadowRegistry.link(findShadowNodeForHandle(handle), style, variants ?? {}, args ?? []);
|
23
|
+
// filter Reanimated styles
|
24
|
+
const filteredStyles = styles.filter(style => !style?.initial?.updater);
|
25
|
+
HybridShadowRegistry.link(findShadowNodeForHandle(handle), filteredStyles, variants ?? {}, args ?? []);
|
28
26
|
};
|
29
27
|
HybridShadowRegistry.remove = handle => {
|
30
28
|
if (!handle) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","styles","variants","args","Array","isArray","filteredStyles","filter","style","initial","updater","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,MAAM,EAAEC,QAAQ,EAAEC,IAAI,KAAK;EAC3D;EACA,IAAI,CAACV,MAAM,IAAI,CAACQ,MAAM,IAAI,CAACG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,EAAE;IAC9C;EACJ;;EAEA;EACA,MAAMK,cAAc,GAAGL,MAAM,CAACM,MAAM,CAACC,KAAK,IAAI,CAACA,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC;EACvErB,oBAAoB,CAACsB,IAAI,CAACnB,uBAAuB,CAACC,MAAM,CAAC,EAAEa,cAAc,EAAEJ,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,CAAC;AAC1G,CAAC;AAEDd,oBAAoB,CAACuB,MAAM,GAAGnB,MAAM,IAAI;EACpC,IAAI,CAACA,MAAM,EAAE;IACT;EACJ;EAEAJ,oBAAoB,CAACwB,MAAM,CAACrB,uBAAuB,CAACC,MAAM,CAAC,CAAC;AAChE,CAAC;AAQM,MAAMqB,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAGzB,oBAA4D","ignoreList":[]}
|
@@ -23,11 +23,6 @@ const attachStatusBarJSMethods = hybridObject => {
|
|
23
23
|
_reactNative.StatusBar.setHidden(isHidden, animation);
|
24
24
|
privateHybrid._setHidden(isHidden);
|
25
25
|
};
|
26
|
-
privateHybrid._setBackgroundColor = hybridObject.setBackgroundColor;
|
27
|
-
hybridObject.setBackgroundColor = color => {
|
28
|
-
const parsedColor = (0, _reactNative.processColor)(color) ?? 0;
|
29
|
-
privateHybrid._setBackgroundColor(parsedColor);
|
30
|
-
};
|
31
26
|
};
|
32
27
|
exports.attachStatusBarJSMethods = attachStatusBarJSMethods;
|
33
28
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_types","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","StatusBarStyle","Light","NativeStatusBar","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","
|
1
|
+
{"version":3,"names":["_reactNative","require","_types","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","StatusBarStyle","Light","NativeStatusBar","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","exports"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAUO,MAAME,wBAAwB,GAAIC,YAAgC,IAAK;EAC1EA,YAAY,CAACC,QAAQ,GAAG,CAACC,KAAqB,EAAEC,QAAkB,KAAK;IACnE,QAAQD,KAAK;MACT,KAAKE,qBAAc,CAACC,KAAK;QACrB,OAAOC,sBAAe,CAACC,WAAW,CAAC,eAAe,EAAEJ,QAAQ,CAAC;MACjE,KAAKC,qBAAc,CAACI,IAAI;QACpB,OAAOF,sBAAe,CAACC,WAAW,CAAC,cAAc,EAAEJ,QAAQ,CAAC;MAChE,KAAKC,qBAAc,CAACK,OAAO;QACvB,OAAOH,sBAAe,CAACC,WAAW,CAAC,SAAS,EAAEJ,QAAQ,CAAC;IAC/D;EACJ,CAAC;EAED,MAAMO,aAAa,GAAGV,YAAyC;EAE/DU,aAAa,CAACC,UAAU,GAAGX,YAAY,CAACY,SAAS;EACjDZ,YAAY,CAACY,SAAS,GAAG,CAACC,QAAiB,EAAEC,SAAoC,KAAK;IAClFR,sBAAe,CAACM,SAAS,CAACC,QAAQ,EAAEC,SAAS,CAAC;IAC9CJ,aAAa,CAACC,UAAU,CAACE,QAAQ,CAAC;EACtC,CAAC;AACL,CAAC;AAAAE,OAAA,CAAAhB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -7,7 +7,6 @@ exports.Runtime = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
8
8
|
var _reactNativeNitroModules = require("react-native-nitro-modules");
|
9
9
|
var _StatusBar = require("../StatusBar");
|
10
|
-
var _NavigtionBar = require("../NavigtionBar");
|
11
10
|
var _common = require("../../common");
|
12
11
|
const HybridUnistylesRuntime = _reactNativeNitroModules.NitroModules.createHybridObject('UnistylesRuntime');
|
13
12
|
HybridUnistylesRuntime.statusBar = HybridUnistylesRuntime.createHybridStatusBar();
|
@@ -21,6 +20,5 @@ if (_common.isIOS) {
|
|
21
20
|
HybridUnistylesRuntime.setImmersiveMode = isEnabled => HybridUnistylesRuntime.statusBar.setHidden(isEnabled, 'fade');
|
22
21
|
}
|
23
22
|
(0, _StatusBar.attachStatusBarJSMethods)(HybridUnistylesRuntime.statusBar);
|
24
|
-
(0, _NavigtionBar.attachNavigationBarJSMethods)(HybridUnistylesRuntime.navigationBar);
|
25
23
|
const Runtime = exports.Runtime = HybridUnistylesRuntime;
|
26
24
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_reactNativeNitroModules","_StatusBar","
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeNitroModules","_StatusBar","_common","HybridUnistylesRuntime","NitroModules","createHybridObject","statusBar","createHybridStatusBar","navigationBar","createHybridNavigationBar","_setRootViewBackgroundColor","setRootViewBackgroundColor","color","parsedColor","processColor","isIOS","setImmersiveMode","isEnabled","setHidden","attachStatusBarJSMethods","Runtime","exports"],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AAGA,IAAAG,OAAA,GAAAH,OAAA;AAkCA,MAAMI,sBAAsB,GAAGC,qCAAY,CACtCC,kBAAkB,CAA0B,kBAAkB,CAAC;AAEpEF,sBAAsB,CAACG,SAAS,GAAGH,sBAAsB,CAACI,qBAAqB,CAAC,CAAC;AACjFJ,sBAAsB,CAACK,aAAa,GAAGL,sBAAsB,CAACM,yBAAyB,CAAC,CAAC;AACzFN,sBAAsB,CAACO,2BAA2B,GAAGP,sBAAsB,CAACQ,0BAA0B;AAEtGR,sBAAsB,CAACQ,0BAA0B,GAAIC,KAAc,IAAK;EACpE,MAAMC,WAAW,GAAG,IAAAC,yBAAY,EAACF,KAAK,CAAC,IAAI,CAAC;EAE5CT,sBAAsB,CAACO,2BAA2B,CAACG,WAAqB,CAAC;AAC7E,CAAC;AAED,IAAIE,aAAK,EAAE;EACPZ,sBAAsB,CAACa,gBAAgB,GAAIC,SAAkB,IAAKd,sBAAsB,CAACG,SAAS,CAACY,SAAS,CAACD,SAAS,EAAE,MAAM,CAAC;AACnI;AAEA,IAAAE,mCAAwB,EAAChB,sBAAsB,CAACG,SAAS,CAAC;AAEnD,MAAMc,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAGjB,sBAA0C","ignoreList":[]}
|