react-native-unistyles 3.0.0-alpha.24 → 3.0.0-alpha.26
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/common/Helpers.h +10 -0
- package/cxx/core/UnistylesRegistry.cpp +10 -10
- package/cxx/core/UnistylesState.cpp +17 -1
- package/cxx/core/UnistylesState.h +2 -1
- package/cxx/hybridObjects/HybridStyleSheet.cpp +49 -10
- package/cxx/hybridObjects/HybridStyleSheet.h +8 -0
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +23 -3
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +5 -0
- package/cxx/parser/Parser.cpp +1 -1
- package/ios/Equatable.swift +2 -1
- package/ios/NativePlatform+ios.swift +4 -1
- package/ios/UnistylesModuleOnLoad.h +10 -1
- package/lib/commonjs/core/index.js +20 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/core/useBreakpoint.js +22 -0
- package/lib/commonjs/core/useBreakpoint.js.map +1 -0
- package/lib/commonjs/core/useBreakpoint.native.js +24 -0
- package/lib/commonjs/core/useBreakpoint.native.js.map +1 -0
- package/lib/commonjs/core/useTheme.js +22 -0
- package/lib/commonjs/core/useTheme.js.map +1 -0
- package/lib/commonjs/core/useTheme.native.js +24 -0
- package/lib/commonjs/core/useTheme.native.js.map +1 -0
- package/lib/commonjs/index.js +16 -15
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/index.js +1 -0
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/commonjs/specs/index.js +7 -0
- package/lib/commonjs/specs/index.js.map +1 -1
- package/lib/commonjs/web/runtime.js +13 -9
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/module/core/index.js +5 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/core/useBreakpoint.js +17 -0
- package/lib/module/core/useBreakpoint.js.map +1 -0
- package/lib/module/core/useBreakpoint.native.js +19 -0
- package/lib/module/core/useBreakpoint.native.js.map +1 -0
- package/lib/module/core/useTheme.js +17 -0
- package/lib/module/core/useTheme.js.map +1 -0
- package/lib/module/core/useTheme.native.js +19 -0
- package/lib/module/core/useTheme.native.js.map +1 -0
- package/lib/module/index.js +1 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/module/specs/NavigtionBar/index.js.map +1 -1
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/index.js +1 -0
- package/lib/module/specs/StyleSheet/index.js.map +1 -1
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/module/specs/index.js +2 -1
- package/lib/module/specs/index.js.map +1 -1
- package/lib/module/web/runtime.js +13 -9
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/typescript/example/App.d.ts.map +1 -1
- package/lib/typescript/example/Typography.d.ts +28 -5
- package/lib/typescript/example/Typography.d.ts.map +1 -1
- package/lib/typescript/src/core/index.d.ts +3 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/core/useBreakpoint.d.ts +2 -0
- package/lib/typescript/src/core/useBreakpoint.d.ts.map +1 -0
- package/lib/typescript/src/core/useBreakpoint.native.d.ts +2 -0
- package/lib/typescript/src/core/useBreakpoint.native.d.ts.map +1 -0
- package/lib/typescript/src/core/useTheme.d.ts +41 -0
- package/lib/typescript/src/core/useTheme.d.ts.map +1 -0
- package/lib/typescript/src/core/useTheme.native.d.ts +41 -0
- package/lib/typescript/src/core/useTheme.native.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +2 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts +5 -0
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/index.d.ts +5 -0
- package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.d.ts +2 -0
- package/lib/typescript/src/specs/StyleSheet/UnistylesStyleSheet.nitro.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/UnistylesRuntime/UnistylesRuntime.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts +3 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/index.d.ts +4 -2
- package/lib/typescript/src/specs/index.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +1 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/lib/typescript/src/types/variants.d.ts +3 -0
- package/lib/typescript/src/types/variants.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +1 -0
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +8 -6
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +2 -1
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +2 -2
- package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +16 -5
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +6 -3
- package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +10 -9
- package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +9 -8
- package/package.json +1 -1
- package/plugin/common.js +3 -1
- package/plugin/stylesheet.js +2 -1
- package/src/core/index.ts +2 -0
- package/src/core/useBreakpoint.native.ts +21 -0
- package/src/core/useBreakpoint.ts +18 -0
- package/src/core/useTheme.native.ts +21 -0
- package/src/core/useTheme.ts +18 -0
- package/src/index.ts +2 -15
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +2 -1
- package/src/specs/NavigtionBar/index.ts +5 -0
- package/src/specs/StatusBar/index.ts +5 -0
- package/src/specs/StyleSheet/UnistylesStyleSheet.nitro.ts +3 -0
- package/src/specs/StyleSheet/index.ts +4 -1
- package/src/specs/UnistylesRuntime/UnistylesRuntime.nitro.ts +0 -1
- package/src/specs/UnistylesRuntime/index.ts +3 -1
- package/src/specs/index.ts +6 -2
- package/src/types/index.ts +1 -1
- package/src/types/variants.ts +6 -0
- package/src/web/runtime.ts +17 -12
package/cxx/common/Helpers.h
CHANGED
@@ -90,6 +90,16 @@ inline bool isPlatformColor(jsi::Runtime& rt, jsi::Object& maybePlatformColor) {
|
|
90
90
|
return true;
|
91
91
|
}
|
92
92
|
|
93
|
+
auto isIOSDynamicColor =
|
94
|
+
maybePlatformColor.hasProperty(rt, "dynamic") &&
|
95
|
+
maybePlatformColor.getProperty(rt, "dynamic").isObject() &&
|
96
|
+
maybePlatformColor.getProperty(rt, "dynamic").asObject(rt).hasProperty(rt, "dark") &&
|
97
|
+
maybePlatformColor.getProperty(rt, "dynamic").asObject(rt).hasProperty(rt, "light");
|
98
|
+
|
99
|
+
if (isIOSDynamicColor) {
|
100
|
+
return true;
|
101
|
+
}
|
102
|
+
|
93
103
|
// Android
|
94
104
|
return maybePlatformColor.hasProperty(rt, "resource_paths") && maybePlatformColor.getProperty(rt, "resource_paths").isObject();
|
95
105
|
}
|
@@ -88,16 +88,16 @@ void core::UnistylesRegistry::linkShadowNodeWithUnistyle(
|
|
88
88
|
}
|
89
89
|
|
90
90
|
void core::UnistylesRegistry::unlinkShadowNodeWithUnistyles(jsi::Runtime& rt, const ShadowNodeFamily* shadowNodeFamily) {
|
91
|
-
this->_shadowRegistry[&rt]
|
91
|
+
this->_shadowRegistry[&rt].erase(shadowNodeFamily);
|
92
92
|
}
|
93
93
|
|
94
94
|
core::Unistyle::Shared core::UnistylesRegistry::findUnistyleFromKey(jsi::Runtime& rt, std::string styleKey, int tag) {
|
95
95
|
auto targetStyleSheet = this->_styleSheetRegistry[&rt][tag];
|
96
|
-
|
96
|
+
|
97
97
|
if (targetStyleSheet == nullptr) {
|
98
98
|
return nullptr;
|
99
99
|
}
|
100
|
-
|
100
|
+
|
101
101
|
return targetStyleSheet.get()->unistyles[styleKey];
|
102
102
|
}
|
103
103
|
|
@@ -152,26 +152,26 @@ core::DependencyMap core::UnistylesRegistry::buildDependencyMap(jsi::Runtime& rt
|
|
152
152
|
|
153
153
|
std::vector<std::shared_ptr<core::StyleSheet>> core::UnistylesRegistry::getStyleSheetsToRefresh(jsi::Runtime& rt, bool themeDidChange, bool runtimeDidChange) {
|
154
154
|
std::vector<std::shared_ptr<core::StyleSheet>> stylesheetsToRefresh{};
|
155
|
-
|
155
|
+
|
156
156
|
if (!themeDidChange && !runtimeDidChange) {
|
157
157
|
return stylesheetsToRefresh;
|
158
158
|
}
|
159
|
-
|
159
|
+
|
160
160
|
auto& styleSheets = this->_styleSheetRegistry[&rt];
|
161
|
-
|
161
|
+
|
162
162
|
std::for_each(styleSheets.begin(), styleSheets.end(), [&](std::pair<int, std::shared_ptr<core::StyleSheet>> pair){
|
163
163
|
auto& [_, styleSheet] = pair;
|
164
|
-
|
164
|
+
|
165
165
|
if (styleSheet->type == StyleSheetType::ThemableWithMiniRuntime && runtimeDidChange) {
|
166
166
|
stylesheetsToRefresh.emplace_back(styleSheet);
|
167
|
-
|
167
|
+
|
168
168
|
return;
|
169
169
|
}
|
170
|
-
|
170
|
+
|
171
171
|
if (styleSheet->type == StyleSheetType::Themable && themeDidChange) {
|
172
172
|
stylesheetsToRefresh.emplace_back(styleSheet);
|
173
173
|
}
|
174
174
|
});
|
175
|
-
|
175
|
+
|
176
176
|
return stylesheetsToRefresh;
|
177
177
|
}
|
@@ -23,7 +23,7 @@ std::optional<std::string>& core::UnistylesState::getCurrentThemeName() {
|
|
23
23
|
return this->_currentThemeName;
|
24
24
|
}
|
25
25
|
|
26
|
-
jsi::Object core::UnistylesState::
|
26
|
+
jsi::Object core::UnistylesState::getCurrentJSTheme() {
|
27
27
|
auto hasSomeThemes = _registeredThemeNames.size() > 0;
|
28
28
|
|
29
29
|
// return empty object, if user didn't register any themes
|
@@ -44,7 +44,23 @@ jsi::Object core::UnistylesState::getJSTheme() {
|
|
44
44
|
return maybeTheme.asObject(*_rt);
|
45
45
|
}
|
46
46
|
|
47
|
+
jsi::Object core::UnistylesState::getJSThemeByName(std::string& themeName) {
|
48
|
+
auto it = this->_jsThemes.find(themeName);
|
49
|
+
|
50
|
+
helpers::assertThat(*_rt, it != this->_jsThemes.end(), "Unistyles: You're trying to get theme '" + themeName + "', but it was not registered. Did you forget to register it with StyleSheet.configure?");
|
51
|
+
|
52
|
+
auto maybeTheme = it->second.lock(*_rt);
|
53
|
+
|
54
|
+
helpers::assertThat(*_rt, maybeTheme.isObject(), "Unistyles: Unable to retrieve your theme from C++ as it has already been garbage collected, likely due to multiple hot reloads. Please live reload the app.");
|
55
|
+
|
56
|
+
return maybeTheme.asObject(*_rt);
|
57
|
+
}
|
58
|
+
|
47
59
|
void core::UnistylesState::computeCurrentBreakpoint(int screenWidth) {
|
60
|
+
if (this->_sortedBreakpointPairs.size() == 0) {
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
|
48
64
|
this->_currentBreakpointName = helpers::getBreakpointFromScreenWidth(
|
49
65
|
screenWidth,
|
50
66
|
this->_sortedBreakpointPairs
|
@@ -28,7 +28,8 @@ struct UnistylesState {
|
|
28
28
|
std::optional<std::string> getCurrentBreakpointName();
|
29
29
|
std::vector<std::pair<std::string, double>> getSortedBreakpointPairs();
|
30
30
|
|
31
|
-
jsi::Object
|
31
|
+
jsi::Object getCurrentJSTheme();
|
32
|
+
jsi::Object getJSThemeByName(std::string& themeName);
|
32
33
|
int parseColor(jsi::Value& color);
|
33
34
|
void computeCurrentBreakpoint(int screenWidth);
|
34
35
|
void registerProcessColorFunction(jsi::Function&& fn);
|
@@ -42,11 +42,7 @@ jsi::Value HybridStyleSheet::configure(jsi::Runtime &rt, const jsi::Value &thisV
|
|
42
42
|
helpers::assertThat(rt, count == 1, "StyleSheet.configure expected to be called with one argument.");
|
43
43
|
helpers::assertThat(rt, arguments[0].isObject(), "StyleSheet.configure expected to be called with object.");
|
44
44
|
|
45
|
-
// create new state
|
46
45
|
auto config = arguments[0].asObject(rt);
|
47
|
-
auto& registry = core::UnistylesRegistry::get();
|
48
|
-
|
49
|
-
registry.createState(rt);
|
50
46
|
|
51
47
|
helpers::enumerateJSIObject(rt, config, [&](const std::string& propertyName, jsi::Value& propertyValue){
|
52
48
|
if (propertyName == "settings") {
|
@@ -71,9 +67,19 @@ jsi::Value HybridStyleSheet::configure(jsi::Runtime &rt, const jsi::Value &thisV
|
|
71
67
|
});
|
72
68
|
|
73
69
|
verifyAndSelectTheme(rt);
|
70
|
+
|
71
|
+
return jsi::Value::undefined();
|
72
|
+
}
|
73
|
+
|
74
|
+
jsi::Value HybridStyleSheet::init(jsi::Runtime &rt, const jsi::Value &thisVal, const jsi::Value *arguments, size_t count) {
|
75
|
+
// create new state
|
76
|
+
auto& registry = core::UnistylesRegistry::get();
|
77
|
+
|
78
|
+
registry.createState(rt);
|
79
|
+
|
74
80
|
loadExternalMethods(thisVal, rt);
|
75
81
|
registerHooks(rt);
|
76
|
-
|
82
|
+
|
77
83
|
return jsi::Value::undefined();
|
78
84
|
}
|
79
85
|
|
@@ -216,15 +222,27 @@ void HybridStyleSheet::loadExternalMethods(const jsi::Value& thisValue, jsi::Run
|
|
216
222
|
state.registerProcessColorFunction(std::move(processColorFn));
|
217
223
|
}
|
218
224
|
|
225
|
+
void HybridStyleSheet::registerHooks(jsi::Runtime& rt) {
|
226
|
+
this->_unistylesCommitHook = std::make_shared<core::UnistylesCommitHook>(this->_uiManager, this->_unistylesRuntime, rt);
|
227
|
+
this->_unistylesMountHook = std::make_shared<core::UnistylesMountHook>(this->_uiManager, this->_unistylesRuntime, rt);
|
228
|
+
}
|
229
|
+
|
219
230
|
void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependency> dependencies) {
|
220
231
|
auto& registry = core::UnistylesRegistry::get();
|
221
232
|
auto parser = parser::Parser(this->_unistylesRuntime);
|
222
233
|
auto& rt = this->_unistylesRuntime->getRuntime();
|
234
|
+
|
235
|
+
// re-compute new breakpoint
|
236
|
+
auto dimensionsIt = std::find(dependencies.begin(), dependencies.end(), UnistyleDependency::DIMENSIONS);
|
237
|
+
|
238
|
+
if (dimensionsIt != dependencies.end()) {
|
239
|
+
registry.getState(rt).computeCurrentBreakpoint(this->_unistylesRuntime->getScreen().width);
|
240
|
+
}
|
223
241
|
|
224
242
|
// check if color scheme changed and then if Unistyles state depend on it (adaptive themes)
|
225
243
|
auto colorSchemeIt = std::find(dependencies.begin(), dependencies.end(), UnistyleDependency::COLORSCHEME);
|
226
244
|
auto hasNewColorScheme = colorSchemeIt != dependencies.end();
|
227
|
-
|
245
|
+
|
228
246
|
// in a later step, we will rebuild only Unistyles with mounted StyleSheets
|
229
247
|
// however, user may have StyleSheets with components that haven't mounted yet
|
230
248
|
// we need to rebuild all dependent StyleSheets as well
|
@@ -233,7 +251,9 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
|
|
233
251
|
if (hasNewColorScheme) {
|
234
252
|
this->_unistylesRuntime->includeDependenciesForColorSchemeChange(dependencies);
|
235
253
|
}
|
236
|
-
|
254
|
+
|
255
|
+
this->notifyJSListeners(dependencies);
|
256
|
+
|
237
257
|
auto dependencyMap = registry.buildDependencyMap(rt, dependencies);
|
238
258
|
|
239
259
|
if (dependencyMap.size() == 0) {
|
@@ -250,7 +270,26 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
|
|
250
270
|
shadow::ShadowTreeManager::updateShadowTree(rt, shadowLeafUpdates);
|
251
271
|
}
|
252
272
|
|
253
|
-
void HybridStyleSheet::
|
254
|
-
|
255
|
-
|
273
|
+
void HybridStyleSheet::notifyJSListeners(std::vector<UnistyleDependency>& dependencies) {
|
274
|
+
if (dependencies.size() > 0) {
|
275
|
+
std::for_each(this->_changeListeners.begin(), this->_changeListeners.end(), [&](auto& listener){
|
276
|
+
(*listener)(dependencies);
|
277
|
+
});
|
278
|
+
}
|
279
|
+
}
|
280
|
+
|
281
|
+
std::function<void ()> HybridStyleSheet::addChangeListener(const std::function<void (const std::vector<UnistyleDependency>&)>& onChanged) {
|
282
|
+
auto listener = std::make_unique<std::function<void(std::vector<UnistyleDependency>&)>>(onChanged);
|
283
|
+
|
284
|
+
this->_changeListeners.push_back(std::move(listener));
|
285
|
+
|
286
|
+
return [this, listenerPtr = this->_changeListeners.back().get()](){
|
287
|
+
auto it = std::find_if(this->_changeListeners.begin(), this->_changeListeners.end(), [listenerPtr](auto& ptr) {
|
288
|
+
return ptr.get() == listenerPtr;
|
289
|
+
});
|
290
|
+
|
291
|
+
if (it != this->_changeListeners.end()) {
|
292
|
+
this->_changeListeners.erase(it);
|
293
|
+
}
|
294
|
+
};
|
256
295
|
}
|
@@ -32,11 +32,16 @@ struct HybridStyleSheet: public HybridUnistylesStyleSheetSpec {
|
|
32
32
|
const jsi::Value& thisValue,
|
33
33
|
const jsi::Value* args,
|
34
34
|
size_t count);
|
35
|
+
jsi::Value init(jsi::Runtime& rt,
|
36
|
+
const jsi::Value& thisValue,
|
37
|
+
const jsi::Value* args,
|
38
|
+
size_t count);
|
35
39
|
|
36
40
|
void loadHybridMethods() override {
|
37
41
|
HybridUnistylesStyleSheetSpec::loadHybridMethods();
|
38
42
|
|
39
43
|
registerHybrids(this, [](Prototype& prototype) {
|
44
|
+
prototype.registerRawHybridMethod("init", 1, &HybridStyleSheet::init);
|
40
45
|
prototype.registerRawHybridMethod("create", 1, &HybridStyleSheet::create);
|
41
46
|
prototype.registerRawHybridMethod("configure", 1, &HybridStyleSheet::configure);
|
42
47
|
});
|
@@ -44,6 +49,7 @@ struct HybridStyleSheet: public HybridUnistylesStyleSheetSpec {
|
|
44
49
|
|
45
50
|
double getHairlineWidth() override;
|
46
51
|
double getUnid() override;
|
52
|
+
std::function<void ()> addChangeListener(const std::function<void (const std::vector<UnistyleDependency> &)>& onChanged) override;
|
47
53
|
|
48
54
|
private:
|
49
55
|
void parseSettings(jsi::Runtime& rt, jsi::Object settings);
|
@@ -54,8 +60,10 @@ private:
|
|
54
60
|
void loadExternalMethods(const jsi::Value& thisValue, jsi::Runtime& rt);
|
55
61
|
void registerHooks(jsi::Runtime& rt);
|
56
62
|
void onPlatformDependenciesChange(std::vector<UnistyleDependency> dependencies);
|
63
|
+
void notifyJSListeners(std::vector<UnistyleDependency>& dependencies);
|
57
64
|
|
58
65
|
double __unid = -1;
|
66
|
+
std::vector<std::unique_ptr<const std::function<void(std::vector<UnistyleDependency>&)>>> _changeListeners{};
|
59
67
|
std::shared_ptr<HybridUnistylesRuntime> _unistylesRuntime;
|
60
68
|
std::shared_ptr<core::UnistylesCommitHook> _unistylesCommitHook;
|
61
69
|
std::shared_ptr<core::UnistylesMountHook> _unistylesMountHook;
|
@@ -112,6 +112,24 @@ void HybridUnistylesRuntime::calculateNewThemeAndDependencies(std::vector<Unisty
|
|
112
112
|
}
|
113
113
|
}
|
114
114
|
|
115
|
+
jsi::Value HybridUnistylesRuntime::getTheme(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
|
116
|
+
helpers::assertThat(rt, count <= 1, "UnistylesRuntime.getTheme expected to be called with 0 or 1 argument.");
|
117
|
+
|
118
|
+
auto& state = core::UnistylesRegistry::get().getState(*_rt);
|
119
|
+
|
120
|
+
if (count == 1) {
|
121
|
+
helpers::assertThat(rt, args[0].isString(), "UnistylesRuntime.getTheme expected to be called with string.");
|
122
|
+
|
123
|
+
auto themeName = args[0].asString(rt).utf8(rt);
|
124
|
+
|
125
|
+
helpers::assertThat(rt, state.hasTheme(themeName), "Unistyles: You're trying to get theme '" + themeName + "' but it wasn't registered.");
|
126
|
+
|
127
|
+
return state.getJSThemeByName(themeName);
|
128
|
+
}
|
129
|
+
|
130
|
+
return state.getCurrentJSTheme();
|
131
|
+
}
|
132
|
+
|
115
133
|
jsi::Value HybridUnistylesRuntime::updateTheme(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
|
116
134
|
helpers::assertThat(rt, count == 2, "UnistylesRuntime.updateTheme expected to be called with 2 arguments.");
|
117
135
|
helpers::assertThat(rt, args[0].isString(), "UnistylesRuntime.updateTheme expected first argument to be a string.");
|
@@ -158,7 +176,6 @@ UnistylesCxxMiniRuntime HybridUnistylesRuntime::getMiniRuntime() {
|
|
158
176
|
UnistylesCxxMiniRuntime cxxMiniRuntime{
|
159
177
|
this->getThemeName(),
|
160
178
|
this->getBreakpoint(),
|
161
|
-
nativeMiniRuntime.orientation,
|
162
179
|
this->getHasAdaptiveThemes(),
|
163
180
|
nativeMiniRuntime.colorScheme,
|
164
181
|
nativeMiniRuntime.screen,
|
@@ -168,7 +185,9 @@ UnistylesCxxMiniRuntime HybridUnistylesRuntime::getMiniRuntime() {
|
|
168
185
|
nativeMiniRuntime.fontScale,
|
169
186
|
nativeMiniRuntime.rtl,
|
170
187
|
nativeMiniRuntime.statusBar,
|
171
|
-
nativeMiniRuntime.navigationBar
|
188
|
+
nativeMiniRuntime.navigationBar,
|
189
|
+
nativeMiniRuntime.isPortrait,
|
190
|
+
nativeMiniRuntime.isLandscape
|
172
191
|
};
|
173
192
|
|
174
193
|
return cxxMiniRuntime;
|
@@ -181,7 +200,6 @@ jsi::Value HybridUnistylesRuntime::getMiniRuntimeAsValue(jsi::Runtime& rt) {
|
|
181
200
|
// auto generated by nitro, but can't be accessed due to static inline function
|
182
201
|
obj.setProperty(rt, "themeName", JSIConverter<std::optional<std::string>>::toJSI(rt, miniRuntime.themeName));
|
183
202
|
obj.setProperty(rt, "breakpoint", JSIConverter<std::optional<std::string>>::toJSI(rt, miniRuntime.breakpoint));
|
184
|
-
obj.setProperty(rt, "orientation", JSIConverter<Orientation>::toJSI(rt, miniRuntime.orientation));
|
185
203
|
obj.setProperty(rt, "hasAdaptiveThemes", JSIConverter<bool>::toJSI(rt, miniRuntime.hasAdaptiveThemes));
|
186
204
|
obj.setProperty(rt, "colorScheme", JSIConverter<ColorScheme>::toJSI(rt, miniRuntime.colorScheme));
|
187
205
|
obj.setProperty(rt, "screen", JSIConverter<Dimensions>::toJSI(rt, miniRuntime.screen));
|
@@ -192,6 +210,8 @@ jsi::Value HybridUnistylesRuntime::getMiniRuntimeAsValue(jsi::Runtime& rt) {
|
|
192
210
|
obj.setProperty(rt, "rtl", JSIConverter<bool>::toJSI(rt, miniRuntime.rtl));
|
193
211
|
obj.setProperty(rt, "statusBar", JSIConverter<Dimensions>::toJSI(rt, miniRuntime.statusBar));
|
194
212
|
obj.setProperty(rt, "navigationBar", JSIConverter<Dimensions>::toJSI(rt, miniRuntime.navigationBar));
|
213
|
+
obj.setProperty(rt, "isPortrait", JSIConverter<bool>::toJSI(rt, miniRuntime.isPortrait));
|
214
|
+
obj.setProperty(rt, "isLandscape", JSIConverter<bool>::toJSI(rt, miniRuntime.isLandscape));
|
195
215
|
|
196
216
|
return obj;
|
197
217
|
}
|
@@ -15,6 +15,10 @@ namespace margelo::nitro::unistyles {
|
|
15
15
|
struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
|
16
16
|
HybridUnistylesRuntime(Unistyles::HybridNativePlatformSpecCxx nativePlatform, jsi::Runtime& rt) : HybridObject(TAG), _nativePlatform{nativePlatform}, _rt{&rt} {}
|
17
17
|
|
18
|
+
jsi::Value getTheme(jsi::Runtime& rt,
|
19
|
+
const jsi::Value& thisValue,
|
20
|
+
const jsi::Value* args,
|
21
|
+
size_t count);
|
18
22
|
jsi::Value updateTheme(jsi::Runtime& rt,
|
19
23
|
const jsi::Value& thisValue,
|
20
24
|
const jsi::Value* args,
|
@@ -32,6 +36,7 @@ struct HybridUnistylesRuntime: public HybridUnistylesRuntimeSpec {
|
|
32
36
|
HybridUnistylesRuntimeSpec::loadHybridMethods();
|
33
37
|
|
34
38
|
registerHybrids(this, [](Prototype& prototype) {
|
39
|
+
prototype.registerRawHybridMethod("getTheme", 1, &HybridUnistylesRuntime::getTheme);
|
35
40
|
prototype.registerRawHybridMethod("updateTheme", 1, &HybridUnistylesRuntime::updateTheme);
|
36
41
|
prototype.registerRawHybridMethod("createHybridStatusBar", 0, &HybridUnistylesRuntime::createHybridStatusBar);
|
37
42
|
prototype.registerRawHybridMethod("createHybridNavigationBar", 0, &HybridUnistylesRuntime::createHybridNavigationBar);
|
package/cxx/parser/Parser.cpp
CHANGED
@@ -47,7 +47,7 @@ jsi::Object parser::Parser::unwrapStyleSheet(jsi::Runtime& rt, std::shared_ptr<S
|
|
47
47
|
|
48
48
|
// StyleSheet is a function
|
49
49
|
auto& state = core::UnistylesRegistry::get().getState(rt);
|
50
|
-
auto theme = state.
|
50
|
+
auto theme = state.getCurrentJSTheme();
|
51
51
|
|
52
52
|
if (styleSheet->type == StyleSheetType::Themable) {
|
53
53
|
return styleSheet->rawValue
|
package/ios/Equatable.swift
CHANGED
@@ -36,7 +36,8 @@ extension UnistylesNativeMiniRuntime {
|
|
36
36
|
dependencies.append(UnistyleDependency.breakpoints)
|
37
37
|
}
|
38
38
|
|
39
|
-
|
39
|
+
// no need to check isLandscape, as it's always opposite
|
40
|
+
if (lhs.isPortrait != rhs.isPortrait) {
|
40
41
|
dependencies.append(UnistyleDependency.orientation)
|
41
42
|
}
|
42
43
|
|
@@ -31,6 +31,8 @@ class NativeIOSPlatform: HybridNativePlatformSpec {
|
|
31
31
|
}
|
32
32
|
|
33
33
|
func buildMiniRuntime() -> UnistylesNativeMiniRuntime {
|
34
|
+
let orientation = self.getOrientation()
|
35
|
+
|
34
36
|
return UnistylesNativeMiniRuntime(
|
35
37
|
colorScheme: self.getColorScheme(),
|
36
38
|
screen: self.getScreenDimensions(),
|
@@ -41,7 +43,8 @@ class NativeIOSPlatform: HybridNativePlatformSpec {
|
|
41
43
|
rtl: self.getPrefersRtlDirection(),
|
42
44
|
statusBar: self.getStatusBarDimensions(),
|
43
45
|
navigationBar: self.getNavigationBarDimensions(),
|
44
|
-
|
46
|
+
isPortrait: orientation == .portrait,
|
47
|
+
isLandscape: orientation == .landscape
|
45
48
|
)
|
46
49
|
}
|
47
50
|
|
@@ -1,7 +1,16 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
|
+
#ifndef RCT_NEW_ARCH_ENABLED
|
4
|
+
#error "Unistyles 3.0 requires your project to have New Architecture enabled."
|
5
|
+
#endif
|
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
|
+
|
3
13
|
#import <React/RCTEventEmitter.h>
|
4
|
-
#import <ReactCommon/RCTTurboModuleWithJSIBindings.h>
|
5
14
|
#import "TurboUnistyles/TurboUnistyles.h"
|
6
15
|
#import <React/RCTSurfacePresenter.h>
|
7
16
|
#import <React/RCTScheduler.h>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "useBreakpoint", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _useBreakpoint.useBreakpoint;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "useTheme", {
|
13
|
+
enumerable: true,
|
14
|
+
get: function () {
|
15
|
+
return _useTheme.useTheme;
|
16
|
+
}
|
17
|
+
});
|
18
|
+
var _useBreakpoint = require("./useBreakpoint");
|
19
|
+
var _useTheme = require("./useTheme");
|
20
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_useBreakpoint","require","_useTheme"],"sourceRoot":"../../../src","sources":["core/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA","ignoreList":[]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useBreakpoint = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var _web = require("../web");
|
9
|
+
var _listener = require("../web/listener");
|
10
|
+
var _NativePlatform = require("../specs/NativePlatform");
|
11
|
+
const useBreakpoint = () => {
|
12
|
+
const [breakpoint, setBreakpoint] = (0, _react.useState)(_web.UnistylesRuntime.breakpoint);
|
13
|
+
(0, _react.useEffect)(() => {
|
14
|
+
const removeChangeListener = _listener.UnistylesListener.addListeners([_NativePlatform.UnistyleDependency.Breakpoints], () => setBreakpoint(_web.UnistylesRuntime.breakpoint));
|
15
|
+
return () => {
|
16
|
+
removeChangeListener();
|
17
|
+
};
|
18
|
+
}, []);
|
19
|
+
return breakpoint;
|
20
|
+
};
|
21
|
+
exports.useBreakpoint = useBreakpoint;
|
22
|
+
//# sourceMappingURL=useBreakpoint.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","require","_web","_listener","_NativePlatform","useBreakpoint","breakpoint","setBreakpoint","useState","UnistylesRuntime","useEffect","removeChangeListener","UnistylesListener","addListeners","UnistyleDependency","Breakpoints","exports"],"sourceRoot":"../../../src","sources":["core/useBreakpoint.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEO,MAAMI,aAAa,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAACC,qBAAgB,CAACH,UAAU,CAAC;EAEzE,IAAAI,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAGC,2BAAiB,CAACC,YAAY,CAAC,CAACC,kCAAkB,CAACC,WAAW,CAAC,EAAE,MAAMR,aAAa,CAACE,qBAAgB,CAACH,UAAU,CAAC,CAAC;IAE/I,OAAO,MAAM;MACTK,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,UAAU;AACrB,CAAC;AAAAU,OAAA,CAAAX,aAAA,GAAAA,aAAA","ignoreList":[]}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useBreakpoint = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var _specs = require("../specs");
|
9
|
+
const useBreakpoint = () => {
|
10
|
+
const [breakpoint, setBreakpoint] = (0, _react.useState)(_specs.UnistylesRuntime.breakpoint);
|
11
|
+
(0, _react.useEffect)(() => {
|
12
|
+
const removeChangeListener = _specs.StyleSheet.addChangeListener(dependencies => {
|
13
|
+
if (dependencies.includes(_specs.UnistyleDependency.Breakpoints)) {
|
14
|
+
setBreakpoint(_specs.UnistylesRuntime.breakpoint);
|
15
|
+
}
|
16
|
+
});
|
17
|
+
return () => {
|
18
|
+
removeChangeListener();
|
19
|
+
};
|
20
|
+
}, []);
|
21
|
+
return breakpoint;
|
22
|
+
};
|
23
|
+
exports.useBreakpoint = useBreakpoint;
|
24
|
+
//# sourceMappingURL=useBreakpoint.native.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","require","_specs","useBreakpoint","breakpoint","setBreakpoint","useState","UnistylesRuntime","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","includes","UnistyleDependency","Breakpoints","exports"],"sourceRoot":"../../../src","sources":["core/useBreakpoint.native.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGO,MAAME,aAAa,GAAGA,CAAA,KAAM;EAC/B,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAACC,uBAAgB,CAACH,UAAU,CAAC;EAEzE,IAAAI,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAIC,iBAAU,CAAyBC,iBAAiB,CAACC,YAAY,IAAI;MAC/F,IAAIA,YAAY,CAACC,QAAQ,CAACC,yBAAkB,CAACC,WAAW,CAAC,EAAE;QACvDV,aAAa,CAACE,uBAAgB,CAACH,UAAU,CAAC;MAC9C;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM;MACTK,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,UAAU;AACrB,CAAC;AAAAY,OAAA,CAAAb,aAAA,GAAAA,aAAA","ignoreList":[]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useTheme = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var _web = require("../web");
|
9
|
+
var _listener = require("../web/listener");
|
10
|
+
var _NativePlatform = require("../specs/NativePlatform");
|
11
|
+
const useTheme = () => {
|
12
|
+
const [theme, setTheme] = (0, _react.useState)(_web.UnistylesRuntime.getTheme());
|
13
|
+
(0, _react.useEffect)(() => {
|
14
|
+
const removeChangeListener = _listener.UnistylesListener.addListeners([_NativePlatform.UnistyleDependency.Theme], () => setTheme(_web.UnistylesRuntime.getTheme()));
|
15
|
+
return () => {
|
16
|
+
removeChangeListener();
|
17
|
+
};
|
18
|
+
}, []);
|
19
|
+
return theme;
|
20
|
+
};
|
21
|
+
exports.useTheme = useTheme;
|
22
|
+
//# sourceMappingURL=useTheme.js.map
|
@@ -0,0 +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.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEO,MAAMI,QAAQ,GAAGA,CAAA,KAAM;EAC1B,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":[]}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useTheme = void 0;
|
7
|
+
var _react = require("react");
|
8
|
+
var _specs = require("../specs");
|
9
|
+
const useTheme = () => {
|
10
|
+
const [theme, setTheme] = (0, _react.useState)(_specs.UnistylesRuntime.getTheme());
|
11
|
+
(0, _react.useEffect)(() => {
|
12
|
+
const removeChangeListener = _specs.StyleSheet.addChangeListener(dependencies => {
|
13
|
+
if (dependencies.includes(_specs.UnistyleDependency.Theme)) {
|
14
|
+
setTheme(_specs.UnistylesRuntime.getTheme());
|
15
|
+
}
|
16
|
+
});
|
17
|
+
return () => {
|
18
|
+
removeChangeListener();
|
19
|
+
};
|
20
|
+
}, []);
|
21
|
+
return theme;
|
22
|
+
};
|
23
|
+
exports.useTheme = useTheme;
|
24
|
+
//# sourceMappingURL=useTheme.native.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_react","require","_specs","useTheme","theme","setTheme","useState","UnistylesRuntime","getTheme","useEffect","removeChangeListener","StyleSheet","addChangeListener","dependencies","includes","UnistyleDependency","Theme","exports"],"sourceRoot":"../../../src","sources":["core/useTheme.native.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGO,MAAME,QAAQ,GAAGA,CAAA,KAAM;EAC1B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAACC,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,oBAAoB,GAAIC,iBAAU,CAAyBC,iBAAiB,CAACC,YAAY,IAAI;MAC/F,IAAIA,YAAY,CAACC,QAAQ,CAACC,yBAAkB,CAACC,KAAK,CAAC,EAAE;QACjDX,QAAQ,CAACE,uBAAgB,CAACC,QAAQ,CAAC,CAAC,CAAC;MACzC;IACJ,CAAC,CAAC;IAEF,OAAO,MAAM;MACTE,oBAAoB,CAAC,CAAC;IAC1B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAON,KAAK;AAChB,CAAC;AAAAa,OAAA,CAAAd,QAAA,GAAAA,QAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
var _exportNames = {
|
7
|
-
mq: true
|
7
|
+
mq: true,
|
8
|
+
useTheme: true,
|
9
|
+
useBreakpoint: true
|
8
10
|
};
|
9
11
|
Object.defineProperty(exports, "mq", {
|
10
12
|
enumerable: true,
|
@@ -12,7 +14,18 @@ Object.defineProperty(exports, "mq", {
|
|
12
14
|
return _mq.mq;
|
13
15
|
}
|
14
16
|
});
|
15
|
-
|
17
|
+
Object.defineProperty(exports, "useBreakpoint", {
|
18
|
+
enumerable: true,
|
19
|
+
get: function () {
|
20
|
+
return _core.useBreakpoint;
|
21
|
+
}
|
22
|
+
});
|
23
|
+
Object.defineProperty(exports, "useTheme", {
|
24
|
+
enumerable: true,
|
25
|
+
get: function () {
|
26
|
+
return _core.useTheme;
|
27
|
+
}
|
28
|
+
});
|
16
29
|
var _specs = require("./specs");
|
17
30
|
Object.keys(_specs).forEach(function (key) {
|
18
31
|
if (key === "default" || key === "__esModule") return;
|
@@ -26,17 +39,5 @@ Object.keys(_specs).forEach(function (key) {
|
|
26
39
|
});
|
27
40
|
});
|
28
41
|
var _mq = require("./mq");
|
29
|
-
|
30
|
-
// TODO: export Native createUnistylesComponent
|
31
|
-
// can't import it this way, it will break native build
|
32
|
-
// export { createUnistylesComponent } from './web/createUnistylesComponent'
|
33
|
-
|
34
|
-
// todo verify true min version
|
35
|
-
const minReactVersionRequiredByUnistyles = '18.3.1';
|
36
|
-
if (_react.default.version < minReactVersionRequiredByUnistyles) {
|
37
|
-
throw new Error(`
|
38
|
-
You are using an outdated version of React (${_react.default.version}).
|
39
|
-
Unistyles requires at least React ${minReactVersionRequiredByUnistyles}.
|
40
|
-
`);
|
41
|
-
}
|
42
|
+
var _core = require("./core");
|
42
43
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
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":[]}
|
@@ -1 +1 @@
|
|
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;EAAA,OAAlBA,kBAAkB;AAAA,
|
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;EAAA,OAAlBA,kBAAkB;AAAA,OA+B9B;AACA","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_reactNative","require","attachNavigationBarJSMethods","hybridObject","privateHybrid","_setBackgroundColor","setBackgroundColor","color","parsedColor","processColor","exports"],"sourceRoot":"../../../../src","sources":["specs/NavigtionBar/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;
|
1
|
+
{"version":3,"names":["_reactNative","require","attachNavigationBarJSMethods","hybridObject","privateHybrid","_setBackgroundColor","setBackgroundColor","color","parsedColor","processColor","exports"],"sourceRoot":"../../../../src","sources":["specs/NavigtionBar/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAcO,MAAMC,4BAA4B,GAAIC,YAAoC,IAAK;EAClF,MAAMC,aAAa,GAAGD,YAA6C;EAEnEC,aAAa,CAACC,mBAAmB,GAAGF,YAAY,CAACG,kBAAkB;EACnEH,YAAY,CAACG,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAG,IAAAC,yBAAY,EAACF,KAAK,CAAC,IAAI,CAAC;IAE5CH,aAAa,CAACC,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC;AAAAE,OAAA,CAAAR,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
@@ -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","_setBackgroundColor","setBackgroundColor","color","parsedColor","processColor","exports"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;
|
1
|
+
{"version":3,"names":["_reactNative","require","_types","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","StatusBarStyle","Light","NativeStatusBar","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","_setBackgroundColor","setBackgroundColor","color","parsedColor","processColor","exports"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAiBO,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;EAEDH,aAAa,CAACK,mBAAmB,GAAGf,YAAY,CAACgB,kBAAkB;EACnEhB,YAAY,CAACgB,kBAAkB,GAAIC,KAAc,IAAK;IAClD,MAAMC,WAAW,GAAG,IAAAC,yBAAY,EAACF,KAAK,CAAC,IAAI,CAAC;IAE5CP,aAAa,CAACK,mBAAmB,CAACG,WAAqB,CAAC;EAC5D,CAAC;AACL,CAAC;AAAAE,OAAA,CAAArB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
@@ -14,5 +14,6 @@ HybridUnistylesStyleSheet.compose = _reactNative.StyleSheet.compose;
|
|
14
14
|
HybridUnistylesStyleSheet.jsMethods = {
|
15
15
|
processColor: _reactNative.processColor
|
16
16
|
};
|
17
|
+
HybridUnistylesStyleSheet.init();
|
17
18
|
const StyleSheet = exports.StyleSheet = HybridUnistylesStyleSheet;
|
18
19
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
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;
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","_reactNative","HybridUnistylesStyleSheet","NitroModules","createHybridObject","absoluteFillObject","NativeStyleSheet","absoluteFill","flatten","compose","jsMethods","processColor","init","StyleSheet","exports"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAgCA,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;AAEDT,yBAAyB,CAACU,IAAI,CAAC,CAAC;AAIzB,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAGX,yBAAsE","ignoreList":[]}
|