react-native-unistyles 3.0.9 → 3.0.11

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.
package/README.md CHANGED
@@ -21,14 +21,14 @@ yarn add react-native-unistyles
21
21
  Install dependencies:
22
22
 
23
23
  ```shell
24
- yarn add react-native-edge-to-edge react-native-nitro-modules@0.27.5
24
+ yarn add react-native-edge-to-edge react-native-nitro-modules@0.29.3
25
25
  ```
26
26
 
27
27
  > To avoid unexpected behavior, always use a fixed version of `react-native-nitro-modules`
28
28
 
29
29
  | react-native-unistyles | react-native-nitro-modules |
30
30
  |------------------------|----------------------------|
31
- | 3.0.0 | 0.27.5 |
31
+ | 3.0.0 | 0.29.3 |
32
32
 
33
33
  Then follow [installation guides](https://unistyl.es/v3/start/getting-started) for your platform.
34
34
 
@@ -59,12 +59,6 @@ Then follow [installation guides](https://unistyl.es/v3/start/getting-started) f
59
59
  <a href="https://galaxies.dev">
60
60
  <img src="https://avatars.githubusercontent.com/u/118431096?s=200&v=4" height="70px" width="70px" alt="galaxies-dev" />
61
61
  </a>
62
- <a href="https://github.com/mobily">
63
- <img src="https://avatars.githubusercontent.com/u/1467712?v=4" height="70px" width="70px" alt="mobily" />
64
- </a>
65
- <a href="https://github.com/mwarger">
66
- <img src="https://avatars.githubusercontent.com/u/686823?v=4" height="70px" width="70px" alt="mwarger" />
67
- </a>
68
62
  <a href="https://github.com/biw">
69
63
  <img src="https://avatars.githubusercontent.com/u/6139501?v=4" height="70px" width="70px" alt="biw" />
70
64
  </a>
@@ -134,6 +128,12 @@ Then follow [installation guides](https://unistyl.es/v3/start/getting-started) f
134
128
  <a href="https://github.com/loopsware">
135
129
  <img src="https://avatars.githubusercontent.com/u/161434039?s=200&v=4" height="60px" width="60px" alt="loopsware" />
136
130
  </a>
131
+ <a href="https://github.com/mobily">
132
+ <img src="https://avatars.githubusercontent.com/u/1467712?v=4" height="60px" width="60px" alt="mobily" />
133
+ </a>
134
+ <a href="https://github.com/mwarger">
135
+ <img src="https://avatars.githubusercontent.com/u/686823?v=4" height="60px" width="60px" alt="mwarger" />
136
+ </a>
137
137
 
138
138
  ## Sponsor my work
139
139
 
@@ -5,6 +5,10 @@ project(unistyles)
5
5
  file(GLOB_RECURSE CORE_SRC RELATIVE ${CMAKE_SOURCE_DIR} "../cxx/**/*.cpp")
6
6
  file(GLOB_RECURSE PLATFORM_SRC RELATIVE ${CMAKE_SOURCE_DIR} "./src/main/cxx/*.cpp")
7
7
 
8
+ if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 80)
9
+ target_compile_reactnative_options(unistyles PRIVATE)
10
+ endif()
11
+
8
12
  add_library(unistyles
9
13
  SHARED
10
14
  ${CORE_SRC}
@@ -35,6 +39,6 @@ set_target_properties(unistyles PROPERTIES
35
39
 
36
40
  # For React Native 0.76 and above, we don't need to link anything
37
41
  # as NitroModules will automatically add ReactAndroid::reactnative prefab
38
- if (ReactAndroid_VERSION_MINOR LESS 76)
39
- message(FATAL_ERROR "Unistyles 3.0 requires min. React Native version to be 0.76")
42
+ if (ReactAndroid_VERSION_MINOR LESS 78)
43
+ message(FATAL_ERROR "Unistyles 3.0 requires min. React Native version to be 0.78")
40
44
  endif ()
@@ -6,7 +6,7 @@ using namespace facebook::react;
6
6
  jsi::Value HybridShadowRegistry::link(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
7
7
  helpers::assertThat(rt, count == 2, "Unistyles: Invalid babel transform 'ShadowRegistry link' expected 2 arguments.");
8
8
 
9
- ShadowNode::Shared shadowNodeWrapper = shadowNodeFromValue(rt, args[0]);
9
+ auto shadowNodeWrapper = getShadowNodeFromRef(rt, args[0]);
10
10
 
11
11
  std::vector<core::Unistyle::Shared> unistyleWrappers = core::unistyleFromValue(rt, args[1]);
12
12
  std::vector<std::vector<folly::dynamic>> arguments;
@@ -98,7 +98,7 @@ jsi::Value HybridShadowRegistry::link(jsi::Runtime &rt, const jsi::Value &thisVa
98
98
  jsi::Value HybridShadowRegistry::unlink(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
99
99
  helpers::assertThat(rt, count == 1, "Unistyles: Invalid babel transform 'ShadowRegistry unlink' expected 1 argument.");
100
100
 
101
- ShadowNode::Shared shadowNodeWrapper = shadowNodeFromValue(rt, args[0]);
101
+ auto shadowNodeWrapper = getShadowNodeFromRef(rt, args[0]);
102
102
 
103
103
  auto& registry = core::UnistylesRegistry::get();
104
104
 
@@ -108,7 +108,7 @@ jsi::Value HybridShadowRegistry::unlink(jsi::Runtime &rt, const jsi::Value &this
108
108
  }
109
109
 
110
110
  jsi::Value HybridShadowRegistry::flush(jsi::Runtime &rt, const jsi::Value &thisValue, const jsi::Value *args, size_t count) {
111
- shadow::ShadowTreeManager::updateShadowTree(UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry());
111
+ shadow::ShadowTreeManager::updateShadowTree(rt);
112
112
 
113
113
  return jsi::Value::undefined();
114
114
  }
@@ -137,3 +137,11 @@ jsi::Value HybridShadowRegistry::getScopedTheme(jsi::Runtime &rt, const jsi::Val
137
137
  ? jsi::String::createFromUtf8(rt, maybeScopedTheme.value())
138
138
  : jsi::Value::undefined();
139
139
  }
140
+
141
+ std::shared_ptr<const core::ShadowNode> HybridShadowRegistry::getShadowNodeFromRef(jsi::Runtime& rt, const jsi::Value& maybeRef) {
142
+ #if REACT_NATIVE_VERSION_MINOR >= 81
143
+ return Bridging<std::shared_ptr<const ShadowNode>>::fromJs(rt, maybeRef);
144
+ #else
145
+ return shadowNodeFromValue(rt, maybeRef);
146
+ #endif
147
+ }
@@ -6,6 +6,7 @@
6
6
  #include "UnistylesState.h"
7
7
  #include "UnistylesRegistry.h"
8
8
  #include "ShadowTreeManager.h"
9
+ #include <cxxreact/ReactNativeVersion.h>
9
10
 
10
11
  namespace margelo::nitro::unistyles {
11
12
 
@@ -45,6 +46,8 @@ struct HybridShadowRegistry: public HybridUnistylesShadowRegistrySpec {
45
46
  prototype.registerRawHybridMethod("getScopedTheme", 0, &HybridShadowRegistry::getScopedTheme);
46
47
  });
47
48
  };
49
+
50
+ std::shared_ptr<const core::ShadowNode> getShadowNodeFromRef(jsi::Runtime& rt, const jsi::Value& maybeRef);
48
51
 
49
52
  private:
50
53
  std::shared_ptr<HybridUnistylesRuntime> _unistylesRuntime;
@@ -296,7 +296,7 @@ void HybridStyleSheet::onPlatformDependenciesChange(std::vector<UnistyleDependen
296
296
  parser.rebuildShadowLeafUpdates(rt, dependencyMap);
297
297
 
298
298
  this->notifyJSListeners(dependencies);
299
- shadow::ShadowTreeManager::updateShadowTree(UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry());
299
+ shadow::ShadowTreeManager::updateShadowTree(rt);
300
300
  }
301
301
 
302
302
  void HybridStyleSheet::onPlatformNativeDependenciesChange(std::vector<UnistyleDependency> dependencies, UnistylesNativeMiniRuntime miniRuntime) {
@@ -352,7 +352,7 @@ void HybridStyleSheet::onPlatformNativeDependenciesChange(std::vector<UnistyleDe
352
352
  parser.rebuildShadowLeafUpdates(rt, dependencyMap);
353
353
 
354
354
  this->notifyJSListeners(unistyleDependencies);
355
- shadow::ShadowTreeManager::updateShadowTree(UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry());
355
+ shadow::ShadowTreeManager::updateShadowTree(rt);
356
356
  });
357
357
  }
358
358
 
@@ -381,7 +381,7 @@ void HybridStyleSheet::onImeChange(UnistylesNativeMiniRuntime miniRuntime) {
381
381
  parser.rebuildShadowLeafUpdates(rt, dependencyMap);
382
382
 
383
383
  this->notifyJSListeners(dependencies);
384
- shadow::ShadowTreeManager::updateShadowTree(UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry());
384
+ shadow::ShadowTreeManager::updateShadowTree(rt);
385
385
  });
386
386
  }
387
387
 
@@ -6,7 +6,7 @@ using namespace facebook;
6
6
 
7
7
  using AffectedNodes = std::unordered_map<const ShadowNodeFamily*, std::unordered_set<int>>;
8
8
 
9
- void shadow::ShadowTreeManager::updateShadowTree(const ShadowTreeRegistry& shadowTreeRegistry) {
9
+ void shadow::ShadowTreeManager::updateShadowTree(jsi::Runtime& rt) {
10
10
  auto& registry = core::UnistylesRegistry::get();
11
11
 
12
12
  registry.trafficController.withLock([&](){
@@ -16,6 +16,21 @@ void shadow::ShadowTreeManager::updateShadowTree(const ShadowTreeRegistry& shado
16
16
  return;
17
17
  }
18
18
 
19
+ #if REACT_NATIVE_VERSION_MINOR >= 81
20
+ std::unordered_map<Tag, folly::dynamic> tagToProps;
21
+
22
+ for (const auto& [family, props] : updates) {
23
+ tagToProps.insert({family->getTag(), props});
24
+
25
+ // Store in native props system to preserve during Reanimated cloning
26
+ const_cast<ShadowNodeFamily*>(family)->nativeProps_DEPRECATED =
27
+ std::make_unique<folly::dynamic>(props);
28
+ }
29
+
30
+ UIManagerBinding::getBinding(rt)->getUIManager().updateShadowTree(std::move(tagToProps));
31
+ #else
32
+ const auto& shadowTreeRegistry = UIManagerBinding::getBinding(rt)->getUIManager().getShadowTreeRegistry();
33
+
19
34
  shadowTreeRegistry.enumerate([&updates](const ShadowTree& shadowTree, bool& stop){
20
35
  // we could iterate via updates and create multiple commits
21
36
  // but it can cause performance issues for hundreds of nodes
@@ -23,6 +38,12 @@ void shadow::ShadowTreeManager::updateShadowTree(const ShadowTreeRegistry& shado
23
38
  auto transaction = [&updates](const RootShadowNode& oldRootShadowNode) {
24
39
  auto affectedNodes = shadow::ShadowTreeManager::findAffectedNodes(oldRootShadowNode, updates);
25
40
 
41
+ for (const auto& [family, props] : updates) {
42
+ // Merge props to fix glitches caused by REA updates
43
+ const_cast<ShadowNodeFamily*>(family)->nativeProps_DEPRECATED =
44
+ std::make_unique<folly::dynamic>(props);
45
+ }
46
+
26
47
  return std::static_pointer_cast<RootShadowNode>(shadow::ShadowTreeManager::cloneShadowTree(
27
48
  oldRootShadowNode,
28
49
  updates,
@@ -36,12 +57,12 @@ void shadow::ShadowTreeManager::updateShadowTree(const ShadowTreeRegistry& shado
36
57
  // mountSynchronously: must be true as this is update from C++ not React
37
58
  shadowTree.commit(transaction, {false, true});
38
59
 
39
-
40
60
  // for now we're assuming single surface, can be improved in the future
41
61
  // stop = true means stop enumerating next shadow tree
42
62
  // so in other words first shadow tree is our desired tree
43
63
  stop = true;
44
64
  });
65
+ #endif
45
66
  });
46
67
  }
47
68
 
@@ -80,15 +101,41 @@ AffectedNodes shadow::ShadowTreeManager::findAffectedNodes(const RootShadowNode&
80
101
  return affectedNodes;
81
102
  }
82
103
 
104
+ Props::Shared shadow::ShadowTreeManager::computeUpdatedProps(const ShadowNode &shadowNode, ShadowLeafUpdates& updates) {
105
+ const auto family = &shadowNode.getFamily();
106
+ const auto rawPropsIt = updates.find(family);
107
+
108
+ if (rawPropsIt == updates.end()) {
109
+ return ShadowNodeFragment::propsPlaceholder();
110
+ }
111
+
112
+ const auto& componentDescriptor = shadowNode.getComponentDescriptor();
113
+ const auto& props = shadowNode.getProps();
114
+
115
+ PropsParserContext propsParserContext{
116
+ shadowNode.getSurfaceId(),
117
+ *shadowNode.getContextContainer()
118
+ };
119
+
120
+ folly::dynamic newProps = rawPropsIt->second == nullptr
121
+ ? folly::dynamic::object()
122
+ : rawPropsIt->second;
123
+
124
+ return componentDescriptor.cloneProps(
125
+ propsParserContext,
126
+ props,
127
+ RawProps(newProps)
128
+ );
129
+ }
130
+
83
131
  // based on Reanimated algorithm
84
132
  // clone affected nodes recursively, inject props and commit tree
85
- ShadowNode::Unshared shadow::ShadowTreeManager::cloneShadowTree(const ShadowNode &shadowNode, ShadowLeafUpdates& updates, AffectedNodes& affectedNodes) {
133
+ std::shared_ptr<ShadowNode> shadow::ShadowTreeManager::cloneShadowTree(const ShadowNode &shadowNode, ShadowLeafUpdates& updates, AffectedNodes& affectedNodes) {
86
134
  const auto family = &shadowNode.getFamily();
87
- const auto rawPropsIt = updates.find(family);
88
135
  const auto childrenIt = affectedNodes.find(family);
89
136
 
90
137
  // Only copy children if we need to update them
91
- std::shared_ptr<ShadowNode::ListOfShared> childrenPtr;
138
+ std::shared_ptr<std::vector<std::shared_ptr<const ShadowNode>>> childrenPtr;
92
139
  const auto& originalChildren = shadowNode.getChildren();
93
140
 
94
141
  if (childrenIt != affectedNodes.end()) {
@@ -98,42 +145,16 @@ ShadowNode::Unshared shadow::ShadowTreeManager::cloneShadowTree(const ShadowNode
98
145
  children[index] = cloneShadowTree(*children[index], updates, affectedNodes);
99
146
  }
100
147
 
101
- childrenPtr = std::make_shared<ShadowNode::ListOfShared>(std::move(children));
148
+ childrenPtr = std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>(std::move(children));
102
149
  } else {
103
- childrenPtr = std::make_shared<ShadowNode::ListOfShared>(originalChildren);
150
+ childrenPtr = std::make_shared<std::vector<std::shared_ptr<const ShadowNode>>>(originalChildren);
104
151
  }
105
152
 
106
- Props::Shared updatedProps = nullptr;
107
-
108
- if (rawPropsIt != updates.end()) {
109
- const auto& componentDescriptor = shadowNode.getComponentDescriptor();
110
- const auto& props = shadowNode.getProps();
111
-
112
- PropsParserContext propsParserContext{
113
- shadowNode.getSurfaceId(),
114
- *shadowNode.getContextContainer()
115
- };
116
-
117
- folly::dynamic newProps;
118
- #ifdef ANDROID
119
- auto safeProps = rawPropsIt->second == nullptr
120
- ? folly::dynamic::object()
121
- : rawPropsIt->second;
122
- newProps = folly::dynamic::merge(props->rawProps, safeProps);
123
- #else
124
- newProps = rawPropsIt->second;
125
- #endif
126
-
127
- updatedProps = componentDescriptor.cloneProps(
128
- propsParserContext,
129
- props,
130
- RawProps(newProps)
131
- );
132
- }
153
+ Props::Shared updatedProps = computeUpdatedProps(shadowNode, updates);
133
154
 
134
155
  return shadowNode.clone({
135
- updatedProps ? updatedProps : ShadowNodeFragment::propsPlaceholder(),
136
- childrenPtr,
137
- shadowNode.getState()
156
+ .props = updatedProps,
157
+ .children = childrenPtr,
158
+ .state = shadowNode.getState()
138
159
  });
139
160
  }
@@ -6,6 +6,7 @@
6
6
  #include <ranges>
7
7
  #include "ShadowLeafUpdate.h"
8
8
  #include "UnistylesRegistry.h"
9
+ #include <cxxreact/ReactNativeVersion.h>
9
10
 
10
11
  namespace margelo::nitro::unistyles::shadow {
11
12
 
@@ -15,9 +16,10 @@ using namespace facebook;
15
16
  using AffectedNodes = std::unordered_map<const ShadowNodeFamily *, std::unordered_set<int>>;
16
17
 
17
18
  struct ShadowTreeManager {
18
- static void updateShadowTree(const ShadowTreeRegistry& shadowTreeRegistry);
19
+ static void updateShadowTree(jsi::Runtime& rt);
19
20
  static AffectedNodes findAffectedNodes(const RootShadowNode& rootNode, ShadowLeafUpdates& updates);
20
- static ShadowNode::Unshared cloneShadowTree(const ShadowNode &shadowNode, ShadowLeafUpdates& updates, AffectedNodes& affectedNodes);
21
+ static std::shared_ptr<ShadowNode> cloneShadowTree(const ShadowNode& shadowNode, ShadowLeafUpdates& updates, AffectedNodes& affectedNodes);
22
+ static Props::Shared computeUpdatedProps(const ShadowNode &shadowNode, ShadowLeafUpdates& updates);
21
23
  };
22
24
 
23
25
  }
@@ -9,7 +9,7 @@ var _exportNames = {
9
9
  UnistylesShadowRegistry: true
10
10
  };
11
11
  exports.UnistylesShadowRegistry = exports.UnistylesRuntime = exports.StyleSheet = void 0;
12
- var _utils = require("../utils");
12
+ var _reactNative = require("react-native");
13
13
  var _create = require("./create");
14
14
  var unistyles = _interopRequireWildcard(require("./services"));
15
15
  var _mock = require("./mock");
@@ -42,8 +42,8 @@ const StyleSheet = exports.StyleSheet = {
42
42
  right: 0,
43
43
  bottom: 0
44
44
  },
45
- compose: (a, b) => (0, _utils.deepMergeObjects)(a, b),
46
- flatten: (...styles) => (0, _utils.deepMergeObjects)(...styles),
45
+ compose: (a, b) => _reactNative.StyleSheet.compose(a, b),
46
+ flatten: (...styles) => _reactNative.StyleSheet.flatten(...styles),
47
47
  hairlineWidth: 1
48
48
  };
49
49
  const UnistylesRuntime = exports.UnistylesRuntime = unistyles.services.runtime;
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_create","unistyles","_interopRequireWildcard","_mock","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor","StyleSheet","configure","services","state","init","create","absoluteFill","position","left","top","right","bottom","absoluteFillObject","compose","a","b","deepMergeObjects","flatten","styles","hairlineWidth","UnistylesRuntime","runtime","UnistylesShadowRegistry","shadowRegistry"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,uBAAA,CAAAH,OAAA;AA2BA,IAAAI,KAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,KAAA,EAAAG,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,MAAAJ,KAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAAsB,SAAAL,wBAAAc,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA,CAAAc,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAP,GAAA,CAAAC,CAAA,GAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAR,cAAA,CAAAC,IAAA,CAAAM,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAlB,MAAA,CAAAS,cAAA,KAAAT,MAAA,CAAAyB,wBAAA,CAAAb,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAR,GAAA,IAAAQ,CAAA,CAAAK,GAAA,IAAAN,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAzBf,MAAMa,UAAU,GAAAlB,OAAA,CAAAkB,UAAA,GAAG;EACtBC,SAAS,EAAE9B,SAAS,CAAC+B,QAAQ,CAACC,KAAK,CAACC,IAAI;EACxCC,MAAM,EAAEA,cAAM;EACdC,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,kBAAkB,EAAE;IAChBL,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDE,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAK,IAAAC,uBAAgB,EAACF,CAAC,EAAEC,CAAC,CAAC;EACzDE,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAK,IAAAF,uBAAgB,EAAC,GAAGE,MAAM,CAAC;EAClEC,aAAa,EAAE;AACnB,CAAuC;AAEhC,MAAMC,gBAAgB,GAAAtC,OAAA,CAAAsC,gBAAA,GAAGjD,SAAS,CAAC+B,QAAQ,CAACmB,OAAmD;AAC/F,MAAMC,uBAAuB,GAAAxC,OAAA,CAAAwC,uBAAA,GAAGnD,SAAS,CAAC+B,QAAQ,CAACqB,cAAiE","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_create","unistyles","_interopRequireWildcard","_mock","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","set","getOwnPropertyDescriptor","StyleSheet","configure","services","state","init","create","absoluteFill","position","left","top","right","bottom","absoluteFillObject","compose","a","b","RNStyleSheet","flatten","styles","hairlineWidth","UnistylesRuntime","runtime","UnistylesShadowRegistry","shadowRegistry"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,uBAAA,CAAAH,OAAA;AA2BA,IAAAI,KAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,KAAA,EAAAG,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,MAAAJ,KAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAAsB,SAAAL,wBAAAc,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA,CAAAc,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAP,GAAA,CAAAC,CAAA,GAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAR,cAAA,CAAAC,IAAA,CAAAM,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAlB,MAAA,CAAAS,cAAA,KAAAT,MAAA,CAAAyB,wBAAA,CAAAb,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAR,GAAA,IAAAQ,CAAA,CAAAK,GAAA,IAAAN,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAzBf,MAAMa,UAAU,GAAAlB,OAAA,CAAAkB,UAAA,GAAG;EACtBC,SAAS,EAAE9B,SAAS,CAAC+B,QAAQ,CAACC,KAAK,CAACC,IAAI;EACxCC,MAAM,EAAEA,cAAM;EACdC,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,kBAAkB,EAAE;IAChBL,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDE,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAKC,uBAAY,CAACH,OAAO,CAACC,CAAC,EAAEC,CAAC,CAAC;EAC7DE,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAKF,uBAAY,CAACC,OAAO,CAAC,GAAGC,MAAM,CAAC;EACtEC,aAAa,EAAE;AACnB,CAAuC;AAEhC,MAAMC,gBAAgB,GAAAtC,OAAA,CAAAsC,gBAAA,GAAGjD,SAAS,CAAC+B,QAAQ,CAACmB,OAAmD;AAC/F,MAAMC,uBAAuB,GAAAxC,OAAA,CAAAwC,uBAAA,GAAGnD,SAAS,CAAC+B,QAAQ,CAACqB,cAAiE","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- import { deepMergeObjects } from '../utils';
3
+ import { StyleSheet as RNStyleSheet } from 'react-native';
4
4
  import { create } from './create';
5
5
  import * as unistyles from './services';
6
6
  export const StyleSheet = {
@@ -20,8 +20,8 @@ export const StyleSheet = {
20
20
  right: 0,
21
21
  bottom: 0
22
22
  },
23
- compose: (a, b) => deepMergeObjects(a, b),
24
- flatten: (...styles) => deepMergeObjects(...styles),
23
+ compose: (a, b) => RNStyleSheet.compose(a, b),
24
+ flatten: (...styles) => RNStyleSheet.flatten(...styles),
25
25
  hairlineWidth: 1
26
26
  };
27
27
  export const UnistylesRuntime = unistyles.services.runtime;
@@ -1 +1 @@
1
- {"version":3,"names":["deepMergeObjects","create","unistyles","StyleSheet","configure","services","state","init","absoluteFill","position","left","top","right","bottom","absoluteFillObject","compose","a","b","flatten","styles","hairlineWidth","UnistylesRuntime","runtime","UnistylesShadowRegistry","shadowRegistry"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;AAGA,SAASA,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,MAAM,QAAQ,UAAU;AACjC,OAAO,KAAKC,SAAS,MAAM,YAAY;AAEvC,OAAO,MAAMC,UAAU,GAAG;EACtBC,SAAS,EAAEF,SAAS,CAACG,QAAQ,CAACC,KAAK,CAACC,IAAI;EACxCN,MAAM,EAAEA,MAAM;EACdO,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,kBAAkB,EAAE;IAChBL,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDE,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAKjB,gBAAgB,CAACgB,CAAC,EAAEC,CAAC,CAAC;EACzDC,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAKnB,gBAAgB,CAAC,GAAGmB,MAAM,CAAC;EAClEC,aAAa,EAAE;AACnB,CAAuC;AAEvC,OAAO,MAAMC,gBAAgB,GAAGnB,SAAS,CAACG,QAAQ,CAACiB,OAAmD;AACtG,OAAO,MAAMC,uBAAuB,GAAGrB,SAAS,CAACG,QAAQ,CAACmB,cAAiE;AAE3H,cAAc,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["StyleSheet","RNStyleSheet","create","unistyles","configure","services","state","init","absoluteFill","position","left","top","right","bottom","absoluteFillObject","compose","a","b","flatten","styles","hairlineWidth","UnistylesRuntime","runtime","UnistylesShadowRegistry","shadowRegistry"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;AAAA,SAASA,UAAU,IAAIC,YAAY,QAAQ,cAAc;AAIzD,SAASC,MAAM,QAAQ,UAAU;AACjC,OAAO,KAAKC,SAAS,MAAM,YAAY;AAEvC,OAAO,MAAMH,UAAU,GAAG;EACtBI,SAAS,EAAED,SAAS,CAACE,QAAQ,CAACC,KAAK,CAACC,IAAI;EACxCL,MAAM,EAAEA,MAAM;EACdM,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,kBAAkB,EAAE;IAChBL,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDE,OAAO,EAAEA,CAACC,CAAS,EAAEC,CAAS,KAAKhB,YAAY,CAACc,OAAO,CAACC,CAAC,EAAEC,CAAC,CAAC;EAC7DC,OAAO,EAAEA,CAAC,GAAGC,MAAqB,KAAKlB,YAAY,CAACiB,OAAO,CAAC,GAAGC,MAAM,CAAC;EACtEC,aAAa,EAAE;AACnB,CAAuC;AAEvC,OAAO,MAAMC,gBAAgB,GAAGlB,SAAS,CAACE,QAAQ,CAACiB,OAAmD;AACtG,OAAO,MAAMC,uBAAuB,GAAGpB,SAAS,CAACE,QAAQ,CAACmB,cAAiE;AAE3H,cAAc,QAAQ","ignoreList":[]}
@@ -2,7 +2,7 @@ export { StyleSheet, UnistylesRuntime, StatusBar, NavigationBar } from './specs'
2
2
  export { mq } from './mq';
3
3
  export type { UnistylesThemes, UnistylesBreakpoints } from './global';
4
4
  export { withUnistyles, useUnistyles, createUnistylesElement } from './core';
5
- export type { UnistylesVariants } from './types';
5
+ export type { UnistylesVariants, IOSContentSizeCategory, AndroidContentSizeCategory } from './types';
6
6
  export { Display, Hide, ScopedTheme } from './components';
7
7
  export { useServerUnistyles, hydrateServerUnistyles, getServerUnistyles, resetServerUnistyles } from './server';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAA;AAC5E,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAA;AAC5E,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AACpG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,IAAI,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvG,OAAO,KAAK,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAKlF,eAAO,MAAM,UAAU,EAoBP,OAAO,gBAAgB,CAAA;AAEvC,eAAO,MAAM,gBAAgB,EAA4C,OAAO,sBAAsB,CAAA;AACtG,eAAO,MAAM,uBAAuB,EAAmD,OAAO,6BAA6B,CAAA;AAE3H,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/web/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,IAAI,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvG,OAAO,KAAK,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,KAAK,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAIlF,eAAO,MAAM,UAAU,EAoBP,OAAO,gBAAgB,CAAA;AAEvC,eAAO,MAAM,gBAAgB,EAA4C,OAAO,sBAAsB,CAAA;AACtG,eAAO,MAAM,uBAAuB,EAAmD,OAAO,6BAA6B,CAAA;AAE3H,cAAc,QAAQ,CAAA"}
@@ -14,7 +14,7 @@
14
14
  namespace margelo::nitro::unistyles::bridge::swift {
15
15
 
16
16
  // pragma MARK: std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>
17
- Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime create_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) {
17
+ Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime create_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) noexcept {
18
18
  auto swiftClosure = Unistyles::Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::fromUnsafe(swiftClosureWrapper);
19
19
  return [swiftClosure = std::move(swiftClosure)](const std::vector<UnistyleDependency>& dependencies, const UnistylesNativeMiniRuntime& miniRuntime) mutable -> void {
20
20
  swiftClosure.call(dependencies, miniRuntime);
@@ -22,19 +22,19 @@ namespace margelo::nitro::unistyles::bridge::swift {
22
22
  }
23
23
 
24
24
  // pragma MARK: std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>
25
- Func_void_UnistylesNativeMiniRuntime create_Func_void_UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) {
25
+ Func_void_UnistylesNativeMiniRuntime create_Func_void_UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) noexcept {
26
26
  auto swiftClosure = Unistyles::Func_void_UnistylesNativeMiniRuntime::fromUnsafe(swiftClosureWrapper);
27
27
  return [swiftClosure = std::move(swiftClosure)](const UnistylesNativeMiniRuntime& miniRuntime) mutable -> void {
28
28
  swiftClosure.call(miniRuntime);
29
29
  };
30
30
  }
31
31
 
32
- // pragma MARK: std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
33
- std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec> create_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(void* _Nonnull swiftUnsafePointer) {
32
+ // pragma MARK: std::shared_ptr<HybridNativePlatformSpec>
33
+ std::shared_ptr<HybridNativePlatformSpec> create_std__shared_ptr_HybridNativePlatformSpec_(void* _Nonnull swiftUnsafePointer) noexcept {
34
34
  Unistyles::HybridNativePlatformSpec_cxx swiftPart = Unistyles::HybridNativePlatformSpec_cxx::fromUnsafe(swiftUnsafePointer);
35
35
  return std::make_shared<margelo::nitro::unistyles::HybridNativePlatformSpecSwift>(swiftPart);
36
36
  }
37
- void* _Nonnull get_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ cppType) {
37
+ void* _Nonnull get_std__shared_ptr_HybridNativePlatformSpec_(std__shared_ptr_HybridNativePlatformSpec_ cppType) noexcept {
38
38
  std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::unistyles::HybridNativePlatformSpecSwift>(cppType);
39
39
  #ifdef NITRO_DEBUG
40
40
  if (swiftWrapper == nullptr) [[unlikely]] {
@@ -53,7 +53,7 @@ namespace margelo::nitro::unistyles::bridge::swift {
53
53
  * Specialized version of `std::vector<UnistyleDependency>`.
54
54
  */
55
55
  using std__vector_UnistyleDependency_ = std::vector<UnistyleDependency>;
56
- inline std::vector<UnistyleDependency> create_std__vector_UnistyleDependency_(size_t size) {
56
+ inline std::vector<UnistyleDependency> create_std__vector_UnistyleDependency_(size_t size) noexcept {
57
57
  std::vector<UnistyleDependency> vector;
58
58
  vector.reserve(size);
59
59
  return vector;
@@ -70,14 +70,14 @@ namespace margelo::nitro::unistyles::bridge::swift {
70
70
  class Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper final {
71
71
  public:
72
72
  explicit Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::make_unique<std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>>(std::move(func))) {}
73
- inline void call(std::vector<UnistyleDependency> dependencies, UnistylesNativeMiniRuntime miniRuntime) const {
73
+ inline void call(std::vector<UnistyleDependency> dependencies, UnistylesNativeMiniRuntime miniRuntime) const noexcept {
74
74
  _function->operator()(dependencies, miniRuntime);
75
75
  }
76
76
  private:
77
77
  std::unique_ptr<std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>> _function;
78
78
  } SWIFT_NONCOPYABLE;
79
- Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime create_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper);
80
- inline Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper wrap_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime value) {
79
+ Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime create_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) noexcept;
80
+ inline Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper wrap_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime value) noexcept {
81
81
  return Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(std::move(value));
82
82
  }
83
83
 
@@ -92,107 +92,107 @@ namespace margelo::nitro::unistyles::bridge::swift {
92
92
  class Func_void_UnistylesNativeMiniRuntime_Wrapper final {
93
93
  public:
94
94
  explicit Func_void_UnistylesNativeMiniRuntime_Wrapper(std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::make_unique<std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>>(std::move(func))) {}
95
- inline void call(UnistylesNativeMiniRuntime miniRuntime) const {
95
+ inline void call(UnistylesNativeMiniRuntime miniRuntime) const noexcept {
96
96
  _function->operator()(miniRuntime);
97
97
  }
98
98
  private:
99
99
  std::unique_ptr<std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>> _function;
100
100
  } SWIFT_NONCOPYABLE;
101
- Func_void_UnistylesNativeMiniRuntime create_Func_void_UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper);
102
- inline Func_void_UnistylesNativeMiniRuntime_Wrapper wrap_Func_void_UnistylesNativeMiniRuntime(Func_void_UnistylesNativeMiniRuntime value) {
101
+ Func_void_UnistylesNativeMiniRuntime create_Func_void_UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) noexcept;
102
+ inline Func_void_UnistylesNativeMiniRuntime_Wrapper wrap_Func_void_UnistylesNativeMiniRuntime(Func_void_UnistylesNativeMiniRuntime value) noexcept {
103
103
  return Func_void_UnistylesNativeMiniRuntime_Wrapper(std::move(value));
104
104
  }
105
105
 
106
- // pragma MARK: std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
106
+ // pragma MARK: std::shared_ptr<HybridNativePlatformSpec>
107
107
  /**
108
- * Specialized version of `std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>`.
108
+ * Specialized version of `std::shared_ptr<HybridNativePlatformSpec>`.
109
109
  */
110
- using std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ = std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>;
111
- std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec> create_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(void* _Nonnull swiftUnsafePointer);
112
- void* _Nonnull get_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ cppType);
110
+ using std__shared_ptr_HybridNativePlatformSpec_ = std::shared_ptr<HybridNativePlatformSpec>;
111
+ std::shared_ptr<HybridNativePlatformSpec> create_std__shared_ptr_HybridNativePlatformSpec_(void* _Nonnull swiftUnsafePointer) noexcept;
112
+ void* _Nonnull get_std__shared_ptr_HybridNativePlatformSpec_(std__shared_ptr_HybridNativePlatformSpec_ cppType) noexcept;
113
113
 
114
- // pragma MARK: std::weak_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
115
- using std__weak_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ = std::weak_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>;
116
- inline std__weak_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ weakify_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(const std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>& strong) { return strong; }
114
+ // pragma MARK: std::weak_ptr<HybridNativePlatformSpec>
115
+ using std__weak_ptr_HybridNativePlatformSpec_ = std::weak_ptr<HybridNativePlatformSpec>;
116
+ inline std__weak_ptr_HybridNativePlatformSpec_ weakify_std__shared_ptr_HybridNativePlatformSpec_(const std::shared_ptr<HybridNativePlatformSpec>& strong) noexcept { return strong; }
117
117
 
118
118
  // pragma MARK: Result<Insets>
119
119
  using Result_Insets_ = Result<Insets>;
120
- inline Result_Insets_ create_Result_Insets_(const Insets& value) {
120
+ inline Result_Insets_ create_Result_Insets_(const Insets& value) noexcept {
121
121
  return Result<Insets>::withValue(value);
122
122
  }
123
- inline Result_Insets_ create_Result_Insets_(const std::exception_ptr& error) {
123
+ inline Result_Insets_ create_Result_Insets_(const std::exception_ptr& error) noexcept {
124
124
  return Result<Insets>::withError(error);
125
125
  }
126
126
 
127
127
  // pragma MARK: Result<ColorScheme>
128
128
  using Result_ColorScheme_ = Result<ColorScheme>;
129
- inline Result_ColorScheme_ create_Result_ColorScheme_(ColorScheme value) {
129
+ inline Result_ColorScheme_ create_Result_ColorScheme_(ColorScheme value) noexcept {
130
130
  return Result<ColorScheme>::withValue(std::move(value));
131
131
  }
132
- inline Result_ColorScheme_ create_Result_ColorScheme_(const std::exception_ptr& error) {
132
+ inline Result_ColorScheme_ create_Result_ColorScheme_(const std::exception_ptr& error) noexcept {
133
133
  return Result<ColorScheme>::withError(error);
134
134
  }
135
135
 
136
136
  // pragma MARK: Result<double>
137
137
  using Result_double_ = Result<double>;
138
- inline Result_double_ create_Result_double_(double value) {
138
+ inline Result_double_ create_Result_double_(double value) noexcept {
139
139
  return Result<double>::withValue(std::move(value));
140
140
  }
141
- inline Result_double_ create_Result_double_(const std::exception_ptr& error) {
141
+ inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
142
142
  return Result<double>::withError(error);
143
143
  }
144
144
 
145
145
  // pragma MARK: Result<Orientation>
146
146
  using Result_Orientation_ = Result<Orientation>;
147
- inline Result_Orientation_ create_Result_Orientation_(Orientation value) {
147
+ inline Result_Orientation_ create_Result_Orientation_(Orientation value) noexcept {
148
148
  return Result<Orientation>::withValue(std::move(value));
149
149
  }
150
- inline Result_Orientation_ create_Result_Orientation_(const std::exception_ptr& error) {
150
+ inline Result_Orientation_ create_Result_Orientation_(const std::exception_ptr& error) noexcept {
151
151
  return Result<Orientation>::withError(error);
152
152
  }
153
153
 
154
154
  // pragma MARK: Result<std::string>
155
155
  using Result_std__string_ = Result<std::string>;
156
- inline Result_std__string_ create_Result_std__string_(const std::string& value) {
156
+ inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept {
157
157
  return Result<std::string>::withValue(value);
158
158
  }
159
- inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) {
159
+ inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept {
160
160
  return Result<std::string>::withError(error);
161
161
  }
162
162
 
163
163
  // pragma MARK: Result<Dimensions>
164
164
  using Result_Dimensions_ = Result<Dimensions>;
165
- inline Result_Dimensions_ create_Result_Dimensions_(const Dimensions& value) {
165
+ inline Result_Dimensions_ create_Result_Dimensions_(const Dimensions& value) noexcept {
166
166
  return Result<Dimensions>::withValue(value);
167
167
  }
168
- inline Result_Dimensions_ create_Result_Dimensions_(const std::exception_ptr& error) {
168
+ inline Result_Dimensions_ create_Result_Dimensions_(const std::exception_ptr& error) noexcept {
169
169
  return Result<Dimensions>::withError(error);
170
170
  }
171
171
 
172
172
  // pragma MARK: Result<bool>
173
173
  using Result_bool_ = Result<bool>;
174
- inline Result_bool_ create_Result_bool_(bool value) {
174
+ inline Result_bool_ create_Result_bool_(bool value) noexcept {
175
175
  return Result<bool>::withValue(std::move(value));
176
176
  }
177
- inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) {
177
+ inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
178
178
  return Result<bool>::withError(error);
179
179
  }
180
180
 
181
181
  // pragma MARK: Result<void>
182
182
  using Result_void_ = Result<void>;
183
- inline Result_void_ create_Result_void_() {
183
+ inline Result_void_ create_Result_void_() noexcept {
184
184
  return Result<void>::withValue();
185
185
  }
186
- inline Result_void_ create_Result_void_(const std::exception_ptr& error) {
186
+ inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
187
187
  return Result<void>::withError(error);
188
188
  }
189
189
 
190
190
  // pragma MARK: Result<UnistylesNativeMiniRuntime>
191
191
  using Result_UnistylesNativeMiniRuntime_ = Result<UnistylesNativeMiniRuntime>;
192
- inline Result_UnistylesNativeMiniRuntime_ create_Result_UnistylesNativeMiniRuntime_(const UnistylesNativeMiniRuntime& value) {
192
+ inline Result_UnistylesNativeMiniRuntime_ create_Result_UnistylesNativeMiniRuntime_(const UnistylesNativeMiniRuntime& value) noexcept {
193
193
  return Result<UnistylesNativeMiniRuntime>::withValue(value);
194
194
  }
195
- inline Result_UnistylesNativeMiniRuntime_ create_Result_UnistylesNativeMiniRuntime_(const std::exception_ptr& error) {
195
+ inline Result_UnistylesNativeMiniRuntime_ create_Result_UnistylesNativeMiniRuntime_(const std::exception_ptr& error) noexcept {
196
196
  return Result<UnistylesNativeMiniRuntime>::withError(error);
197
197
  }
198
198
 
@@ -33,7 +33,7 @@ open class HybridNativePlatformSpec_cxx {
33
33
  /**
34
34
  * Holds a weak pointer to the C++ class that wraps the Swift class.
35
35
  */
36
- private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_
36
+ private var __cxxPart: bridge.std__weak_ptr_HybridNativePlatformSpec_
37
37
 
38
38
  /**
39
39
  * Create a new `HybridNativePlatformSpec_cxx` that wraps the given `HybridNativePlatformSpec`.
@@ -72,15 +72,15 @@ open class HybridNativePlatformSpec_cxx {
72
72
 
73
73
  /**
74
74
  * Gets (or creates) the C++ part of this Hybrid Object.
75
- * The C++ part is a `std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>`.
75
+ * The C++ part is a `std::shared_ptr<HybridNativePlatformSpec>`.
76
76
  */
77
- public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ {
77
+ public func getCxxPart() -> bridge.std__shared_ptr_HybridNativePlatformSpec_ {
78
78
  let cachedCxxPart = self.__cxxPart.lock()
79
79
  if cachedCxxPart.__convertToBool() {
80
80
  return cachedCxxPart
81
81
  } else {
82
- let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(self.toUnsafe())
83
- __cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(newCxxPart)
82
+ let newCxxPart = bridge.create_std__shared_ptr_HybridNativePlatformSpec_(self.toUnsafe())
83
+ __cxxPart = bridge.weakify_std__shared_ptr_HybridNativePlatformSpec_(newCxxPart)
84
84
  return newCxxPart
85
85
  }
86
86
  }
@@ -38,26 +38,24 @@ namespace margelo::nitro::unistyles {
38
38
 
39
39
  namespace margelo::nitro {
40
40
 
41
- using namespace margelo::nitro::unistyles;
42
-
43
41
  // C++ ColorScheme <> JS ColorScheme (union)
44
42
  template <>
45
- struct JSIConverter<ColorScheme> final {
46
- static inline ColorScheme fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
43
+ struct JSIConverter<margelo::nitro::unistyles::ColorScheme> final {
44
+ static inline margelo::nitro::unistyles::ColorScheme fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
47
45
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
48
46
  switch (hashString(unionValue.c_str(), unionValue.size())) {
49
- case hashString("dark"): return ColorScheme::DARK;
50
- case hashString("light"): return ColorScheme::LIGHT;
51
- case hashString("unspecified"): return ColorScheme::UNSPECIFIED;
47
+ case hashString("dark"): return margelo::nitro::unistyles::ColorScheme::DARK;
48
+ case hashString("light"): return margelo::nitro::unistyles::ColorScheme::LIGHT;
49
+ case hashString("unspecified"): return margelo::nitro::unistyles::ColorScheme::UNSPECIFIED;
52
50
  default: [[unlikely]]
53
51
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ColorScheme - invalid value!");
54
52
  }
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, ColorScheme arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::unistyles::ColorScheme arg) {
57
55
  switch (arg) {
58
- case ColorScheme::DARK: return JSIConverter<std::string>::toJSI(runtime, "dark");
59
- case ColorScheme::LIGHT: return JSIConverter<std::string>::toJSI(runtime, "light");
60
- case ColorScheme::UNSPECIFIED: return JSIConverter<std::string>::toJSI(runtime, "unspecified");
56
+ case margelo::nitro::unistyles::ColorScheme::DARK: return JSIConverter<std::string>::toJSI(runtime, "dark");
57
+ case margelo::nitro::unistyles::ColorScheme::LIGHT: return JSIConverter<std::string>::toJSI(runtime, "light");
58
+ case margelo::nitro::unistyles::ColorScheme::UNSPECIFIED: return JSIConverter<std::string>::toJSI(runtime, "unspecified");
61
59
  default: [[unlikely]]
62
60
  throw std::invalid_argument("Cannot convert ColorScheme to JS - invalid value: "
63
61
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -41,19 +41,17 @@ namespace margelo::nitro::unistyles {
41
41
 
42
42
  namespace margelo::nitro {
43
43
 
44
- using namespace margelo::nitro::unistyles;
45
-
46
44
  // C++ Dimensions <> JS Dimensions (object)
47
45
  template <>
48
- struct JSIConverter<Dimensions> final {
49
- static inline Dimensions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
+ struct JSIConverter<margelo::nitro::unistyles::Dimensions> final {
47
+ static inline margelo::nitro::unistyles::Dimensions fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
50
48
  jsi::Object obj = arg.asObject(runtime);
51
- return Dimensions(
49
+ return margelo::nitro::unistyles::Dimensions(
52
50
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "width")),
53
51
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "height"))
54
52
  );
55
53
  }
56
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const Dimensions& arg) {
54
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unistyles::Dimensions& arg) {
57
55
  jsi::Object obj(runtime);
58
56
  obj.setProperty(runtime, "width", JSIConverter<double>::toJSI(runtime, arg.width));
59
57
  obj.setProperty(runtime, "height", JSIConverter<double>::toJSI(runtime, arg.height));
@@ -44,14 +44,12 @@ namespace margelo::nitro::unistyles {
44
44
 
45
45
  namespace margelo::nitro {
46
46
 
47
- using namespace margelo::nitro::unistyles;
48
-
49
47
  // C++ Insets <> JS Insets (object)
50
48
  template <>
51
- struct JSIConverter<Insets> final {
52
- static inline Insets fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
49
+ struct JSIConverter<margelo::nitro::unistyles::Insets> final {
50
+ static inline margelo::nitro::unistyles::Insets fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
53
51
  jsi::Object obj = arg.asObject(runtime);
54
- return Insets(
52
+ return margelo::nitro::unistyles::Insets(
55
53
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "top")),
56
54
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "bottom")),
57
55
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "left")),
@@ -59,7 +57,7 @@ namespace margelo::nitro {
59
57
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "ime"))
60
58
  );
61
59
  }
62
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const Insets& arg) {
60
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unistyles::Insets& arg) {
63
61
  jsi::Object obj(runtime);
64
62
  obj.setProperty(runtime, "top", JSIConverter<double>::toJSI(runtime, arg.top));
65
63
  obj.setProperty(runtime, "bottom", JSIConverter<double>::toJSI(runtime, arg.bottom));
@@ -37,24 +37,22 @@ namespace margelo::nitro::unistyles {
37
37
 
38
38
  namespace margelo::nitro {
39
39
 
40
- using namespace margelo::nitro::unistyles;
41
-
42
40
  // C++ Orientation <> JS Orientation (union)
43
41
  template <>
44
- struct JSIConverter<Orientation> final {
45
- static inline Orientation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
42
+ struct JSIConverter<margelo::nitro::unistyles::Orientation> final {
43
+ static inline margelo::nitro::unistyles::Orientation fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
46
44
  std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
47
45
  switch (hashString(unionValue.c_str(), unionValue.size())) {
48
- case hashString("portrait"): return Orientation::PORTRAIT;
49
- case hashString("landscape"): return Orientation::LANDSCAPE;
46
+ case hashString("portrait"): return margelo::nitro::unistyles::Orientation::PORTRAIT;
47
+ case hashString("landscape"): return margelo::nitro::unistyles::Orientation::LANDSCAPE;
50
48
  default: [[unlikely]]
51
49
  throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum Orientation - invalid value!");
52
50
  }
53
51
  }
54
- static inline jsi::Value toJSI(jsi::Runtime& runtime, Orientation arg) {
52
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::unistyles::Orientation arg) {
55
53
  switch (arg) {
56
- case Orientation::PORTRAIT: return JSIConverter<std::string>::toJSI(runtime, "portrait");
57
- case Orientation::LANDSCAPE: return JSIConverter<std::string>::toJSI(runtime, "landscape");
54
+ case margelo::nitro::unistyles::Orientation::PORTRAIT: return JSIConverter<std::string>::toJSI(runtime, "portrait");
55
+ case margelo::nitro::unistyles::Orientation::LANDSCAPE: return JSIConverter<std::string>::toJSI(runtime, "landscape");
58
56
  default: [[unlikely]]
59
57
  throw std::invalid_argument("Cannot convert Orientation to JS - invalid value: "
60
58
  + std::to_string(static_cast<int>(arg)) + "!");
@@ -46,16 +46,14 @@ namespace margelo::nitro::unistyles {
46
46
 
47
47
  namespace margelo::nitro {
48
48
 
49
- using namespace margelo::nitro::unistyles;
50
-
51
49
  // C++ UnistyleDependency <> JS UnistyleDependency (enum)
52
50
  template <>
53
- struct JSIConverter<UnistyleDependency> final {
54
- static inline UnistyleDependency fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
51
+ struct JSIConverter<margelo::nitro::unistyles::UnistyleDependency> final {
52
+ static inline margelo::nitro::unistyles::UnistyleDependency fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
55
53
  int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
56
- return static_cast<UnistyleDependency>(enumValue);
54
+ return static_cast<margelo::nitro::unistyles::UnistyleDependency>(enumValue);
57
55
  }
58
- static inline jsi::Value toJSI(jsi::Runtime& runtime, UnistyleDependency arg) {
56
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::unistyles::UnistyleDependency arg) {
59
57
  int enumValue = static_cast<int>(arg);
60
58
  return JSIConverter<int>::toJSI(runtime, enumValue);
61
59
  }
@@ -62,44 +62,42 @@ namespace margelo::nitro::unistyles {
62
62
 
63
63
  namespace margelo::nitro {
64
64
 
65
- using namespace margelo::nitro::unistyles;
66
-
67
65
  // C++ UnistylesCxxMiniRuntime <> JS UnistylesCxxMiniRuntime (object)
68
66
  template <>
69
- struct JSIConverter<UnistylesCxxMiniRuntime> final {
70
- static inline UnistylesCxxMiniRuntime fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
67
+ struct JSIConverter<margelo::nitro::unistyles::UnistylesCxxMiniRuntime> final {
68
+ static inline margelo::nitro::unistyles::UnistylesCxxMiniRuntime fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
71
69
  jsi::Object obj = arg.asObject(runtime);
72
- return UnistylesCxxMiniRuntime(
70
+ return margelo::nitro::unistyles::UnistylesCxxMiniRuntime(
73
71
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "themeName")),
74
72
  JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, "breakpoint")),
75
73
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "hasAdaptiveThemes")),
76
- JSIConverter<ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, "colorScheme")),
77
- JSIConverter<Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "screen")),
74
+ JSIConverter<margelo::nitro::unistyles::ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, "colorScheme")),
75
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "screen")),
78
76
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "contentSizeCategory")),
79
- JSIConverter<Insets>::fromJSI(runtime, obj.getProperty(runtime, "insets")),
77
+ JSIConverter<margelo::nitro::unistyles::Insets>::fromJSI(runtime, obj.getProperty(runtime, "insets")),
80
78
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pixelRatio")),
81
79
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "fontScale")),
82
80
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "rtl")),
83
- JSIConverter<Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "statusBar")),
84
- JSIConverter<Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "navigationBar")),
81
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "statusBar")),
82
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "navigationBar")),
85
83
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isPortrait")),
86
84
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isLandscape"))
87
85
  );
88
86
  }
89
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const UnistylesCxxMiniRuntime& arg) {
87
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unistyles::UnistylesCxxMiniRuntime& arg) {
90
88
  jsi::Object obj(runtime);
91
89
  obj.setProperty(runtime, "themeName", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.themeName));
92
90
  obj.setProperty(runtime, "breakpoint", JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.breakpoint));
93
91
  obj.setProperty(runtime, "hasAdaptiveThemes", JSIConverter<bool>::toJSI(runtime, arg.hasAdaptiveThemes));
94
- obj.setProperty(runtime, "colorScheme", JSIConverter<ColorScheme>::toJSI(runtime, arg.colorScheme));
95
- obj.setProperty(runtime, "screen", JSIConverter<Dimensions>::toJSI(runtime, arg.screen));
92
+ obj.setProperty(runtime, "colorScheme", JSIConverter<margelo::nitro::unistyles::ColorScheme>::toJSI(runtime, arg.colorScheme));
93
+ obj.setProperty(runtime, "screen", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.screen));
96
94
  obj.setProperty(runtime, "contentSizeCategory", JSIConverter<std::string>::toJSI(runtime, arg.contentSizeCategory));
97
- obj.setProperty(runtime, "insets", JSIConverter<Insets>::toJSI(runtime, arg.insets));
95
+ obj.setProperty(runtime, "insets", JSIConverter<margelo::nitro::unistyles::Insets>::toJSI(runtime, arg.insets));
98
96
  obj.setProperty(runtime, "pixelRatio", JSIConverter<double>::toJSI(runtime, arg.pixelRatio));
99
97
  obj.setProperty(runtime, "fontScale", JSIConverter<double>::toJSI(runtime, arg.fontScale));
100
98
  obj.setProperty(runtime, "rtl", JSIConverter<bool>::toJSI(runtime, arg.rtl));
101
- obj.setProperty(runtime, "statusBar", JSIConverter<Dimensions>::toJSI(runtime, arg.statusBar));
102
- obj.setProperty(runtime, "navigationBar", JSIConverter<Dimensions>::toJSI(runtime, arg.navigationBar));
99
+ obj.setProperty(runtime, "statusBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.statusBar));
100
+ obj.setProperty(runtime, "navigationBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.navigationBar));
103
101
  obj.setProperty(runtime, "isPortrait", JSIConverter<bool>::toJSI(runtime, arg.isPortrait));
104
102
  obj.setProperty(runtime, "isLandscape", JSIConverter<bool>::toJSI(runtime, arg.isLandscape));
105
103
  return obj;
@@ -112,15 +110,15 @@ namespace margelo::nitro {
112
110
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "themeName"))) return false;
113
111
  if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, "breakpoint"))) return false;
114
112
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "hasAdaptiveThemes"))) return false;
115
- if (!JSIConverter<ColorScheme>::canConvert(runtime, obj.getProperty(runtime, "colorScheme"))) return false;
116
- if (!JSIConverter<Dimensions>::canConvert(runtime, obj.getProperty(runtime, "screen"))) return false;
113
+ if (!JSIConverter<margelo::nitro::unistyles::ColorScheme>::canConvert(runtime, obj.getProperty(runtime, "colorScheme"))) return false;
114
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "screen"))) return false;
117
115
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "contentSizeCategory"))) return false;
118
- if (!JSIConverter<Insets>::canConvert(runtime, obj.getProperty(runtime, "insets"))) return false;
116
+ if (!JSIConverter<margelo::nitro::unistyles::Insets>::canConvert(runtime, obj.getProperty(runtime, "insets"))) return false;
119
117
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pixelRatio"))) return false;
120
118
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "fontScale"))) return false;
121
119
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "rtl"))) return false;
122
- if (!JSIConverter<Dimensions>::canConvert(runtime, obj.getProperty(runtime, "statusBar"))) return false;
123
- if (!JSIConverter<Dimensions>::canConvert(runtime, obj.getProperty(runtime, "navigationBar"))) return false;
120
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "statusBar"))) return false;
121
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "navigationBar"))) return false;
124
122
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isPortrait"))) return false;
125
123
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isLandscape"))) return false;
126
124
  return true;
@@ -58,38 +58,36 @@ namespace margelo::nitro::unistyles {
58
58
 
59
59
  namespace margelo::nitro {
60
60
 
61
- using namespace margelo::nitro::unistyles;
62
-
63
61
  // C++ UnistylesNativeMiniRuntime <> JS UnistylesNativeMiniRuntime (object)
64
62
  template <>
65
- struct JSIConverter<UnistylesNativeMiniRuntime> final {
66
- static inline UnistylesNativeMiniRuntime fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
63
+ struct JSIConverter<margelo::nitro::unistyles::UnistylesNativeMiniRuntime> final {
64
+ static inline margelo::nitro::unistyles::UnistylesNativeMiniRuntime fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
67
65
  jsi::Object obj = arg.asObject(runtime);
68
- return UnistylesNativeMiniRuntime(
69
- JSIConverter<ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, "colorScheme")),
70
- JSIConverter<Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "screen")),
66
+ return margelo::nitro::unistyles::UnistylesNativeMiniRuntime(
67
+ JSIConverter<margelo::nitro::unistyles::ColorScheme>::fromJSI(runtime, obj.getProperty(runtime, "colorScheme")),
68
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "screen")),
71
69
  JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "contentSizeCategory")),
72
- JSIConverter<Insets>::fromJSI(runtime, obj.getProperty(runtime, "insets")),
70
+ JSIConverter<margelo::nitro::unistyles::Insets>::fromJSI(runtime, obj.getProperty(runtime, "insets")),
73
71
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "pixelRatio")),
74
72
  JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, "fontScale")),
75
73
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "rtl")),
76
- JSIConverter<Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "statusBar")),
77
- JSIConverter<Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "navigationBar")),
74
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "statusBar")),
75
+ JSIConverter<margelo::nitro::unistyles::Dimensions>::fromJSI(runtime, obj.getProperty(runtime, "navigationBar")),
78
76
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isPortrait")),
79
77
  JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, "isLandscape"))
80
78
  );
81
79
  }
82
- static inline jsi::Value toJSI(jsi::Runtime& runtime, const UnistylesNativeMiniRuntime& arg) {
80
+ static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::unistyles::UnistylesNativeMiniRuntime& arg) {
83
81
  jsi::Object obj(runtime);
84
- obj.setProperty(runtime, "colorScheme", JSIConverter<ColorScheme>::toJSI(runtime, arg.colorScheme));
85
- obj.setProperty(runtime, "screen", JSIConverter<Dimensions>::toJSI(runtime, arg.screen));
82
+ obj.setProperty(runtime, "colorScheme", JSIConverter<margelo::nitro::unistyles::ColorScheme>::toJSI(runtime, arg.colorScheme));
83
+ obj.setProperty(runtime, "screen", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.screen));
86
84
  obj.setProperty(runtime, "contentSizeCategory", JSIConverter<std::string>::toJSI(runtime, arg.contentSizeCategory));
87
- obj.setProperty(runtime, "insets", JSIConverter<Insets>::toJSI(runtime, arg.insets));
85
+ obj.setProperty(runtime, "insets", JSIConverter<margelo::nitro::unistyles::Insets>::toJSI(runtime, arg.insets));
88
86
  obj.setProperty(runtime, "pixelRatio", JSIConverter<double>::toJSI(runtime, arg.pixelRatio));
89
87
  obj.setProperty(runtime, "fontScale", JSIConverter<double>::toJSI(runtime, arg.fontScale));
90
88
  obj.setProperty(runtime, "rtl", JSIConverter<bool>::toJSI(runtime, arg.rtl));
91
- obj.setProperty(runtime, "statusBar", JSIConverter<Dimensions>::toJSI(runtime, arg.statusBar));
92
- obj.setProperty(runtime, "navigationBar", JSIConverter<Dimensions>::toJSI(runtime, arg.navigationBar));
89
+ obj.setProperty(runtime, "statusBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.statusBar));
90
+ obj.setProperty(runtime, "navigationBar", JSIConverter<margelo::nitro::unistyles::Dimensions>::toJSI(runtime, arg.navigationBar));
93
91
  obj.setProperty(runtime, "isPortrait", JSIConverter<bool>::toJSI(runtime, arg.isPortrait));
94
92
  obj.setProperty(runtime, "isLandscape", JSIConverter<bool>::toJSI(runtime, arg.isLandscape));
95
93
  return obj;
@@ -99,15 +97,15 @@ namespace margelo::nitro {
99
97
  return false;
100
98
  }
101
99
  jsi::Object obj = value.getObject(runtime);
102
- if (!JSIConverter<ColorScheme>::canConvert(runtime, obj.getProperty(runtime, "colorScheme"))) return false;
103
- if (!JSIConverter<Dimensions>::canConvert(runtime, obj.getProperty(runtime, "screen"))) return false;
100
+ if (!JSIConverter<margelo::nitro::unistyles::ColorScheme>::canConvert(runtime, obj.getProperty(runtime, "colorScheme"))) return false;
101
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "screen"))) return false;
104
102
  if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "contentSizeCategory"))) return false;
105
- if (!JSIConverter<Insets>::canConvert(runtime, obj.getProperty(runtime, "insets"))) return false;
103
+ if (!JSIConverter<margelo::nitro::unistyles::Insets>::canConvert(runtime, obj.getProperty(runtime, "insets"))) return false;
106
104
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "pixelRatio"))) return false;
107
105
  if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, "fontScale"))) return false;
108
106
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "rtl"))) return false;
109
- if (!JSIConverter<Dimensions>::canConvert(runtime, obj.getProperty(runtime, "statusBar"))) return false;
110
- if (!JSIConverter<Dimensions>::canConvert(runtime, obj.getProperty(runtime, "navigationBar"))) return false;
107
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "statusBar"))) return false;
108
+ if (!JSIConverter<margelo::nitro::unistyles::Dimensions>::canConvert(runtime, obj.getProperty(runtime, "navigationBar"))) return false;
111
109
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isPortrait"))) return false;
112
110
  if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, "isLandscape"))) return false;
113
111
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "3.0.9",
3
+ "version": "3.0.11",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "NODE_ENV=babel-test jest ./plugin",
@@ -148,11 +148,11 @@
148
148
  "husky": "9.1.7",
149
149
  "jest": "29.7.0",
150
150
  "metro-react-native-babel-preset": "0.77.0",
151
- "nitro-codegen": "0.27.5",
151
+ "nitro-codegen": "0.29.3",
152
152
  "react": "19.1.0",
153
153
  "react-native": "0.79.2",
154
154
  "react-native-builder-bob": "0.40.10",
155
- "react-native-nitro-modules": "0.27.5",
155
+ "react-native-nitro-modules": "0.29.3",
156
156
  "react-native-reanimated": "3.17.5",
157
157
  "react-native-web": "0.20.0",
158
158
  "react-test-renderer": "19.1.0",
@@ -213,7 +213,47 @@
213
213
  },
214
214
  "plugins": {
215
215
  "@release-it/conventional-changelog": {
216
- "preset": "angular"
216
+ "writerOpts": {
217
+ "groupBy": "type",
218
+ "commitGroupsSort": [
219
+ "feat",
220
+ "fix",
221
+ "perf",
222
+ "refactor",
223
+ "docs",
224
+ "chore"
225
+ ],
226
+ "commitsSort": [
227
+ "scope",
228
+ "subject"
229
+ ]
230
+ },
231
+ "types": [
232
+ {
233
+ "type": "feat",
234
+ "section": "Features"
235
+ },
236
+ {
237
+ "type": "fix",
238
+ "section": "Bug Fixes"
239
+ },
240
+ {
241
+ "type": "perf",
242
+ "section": "Performance Improvements"
243
+ },
244
+ {
245
+ "type": "refactor",
246
+ "section": "Code Refactoring"
247
+ },
248
+ {
249
+ "type": "docs",
250
+ "section": "Documentation"
251
+ },
252
+ {
253
+ "type": "chore",
254
+ "section": "Maintenance"
255
+ }
256
+ ]
217
257
  }
218
258
  }
219
259
  },
package/src/index.ts CHANGED
@@ -10,6 +10,6 @@ export { StyleSheet, UnistylesRuntime, StatusBar, NavigationBar } from './specs'
10
10
  export { mq } from './mq'
11
11
  export type { UnistylesThemes, UnistylesBreakpoints } from './global'
12
12
  export { withUnistyles, useUnistyles, createUnistylesElement } from './core'
13
- export type { UnistylesVariants } from './types'
13
+ export type { UnistylesVariants, IOSContentSizeCategory, AndroidContentSizeCategory } from './types'
14
14
  export { Display, Hide, ScopedTheme } from './components'
15
15
  export { useServerUnistyles, hydrateServerUnistyles, getServerUnistyles, resetServerUnistyles } from './server'
package/src/web/index.ts CHANGED
@@ -1,7 +1,7 @@
1
+ import { StyleSheet as RNStyleSheet } from 'react-native'
1
2
  import type { UnistylesShadowRegistry as NativeUnistylesShadowRegistry } from '../specs/ShadowRegistry'
2
3
  import type { StyleSheet as NativeStyleSheet } from '../specs/StyleSheet'
3
4
  import type { Runtime as NativeUnistylesRuntime } from '../specs/UnistylesRuntime'
4
- import { deepMergeObjects } from '../utils'
5
5
  import { create } from './create'
6
6
  import * as unistyles from './services'
7
7
 
@@ -22,8 +22,8 @@ export const StyleSheet = {
22
22
  right: 0,
23
23
  bottom: 0
24
24
  },
25
- compose: (a: object, b: object) => deepMergeObjects(a, b),
26
- flatten: (...styles: Array<object>) => deepMergeObjects(...styles),
25
+ compose: (a: object, b: object) => RNStyleSheet.compose(a, b),
26
+ flatten: (...styles: Array<object>) => RNStyleSheet.flatten(...styles),
27
27
  hairlineWidth: 1
28
28
  } as unknown as typeof NativeStyleSheet
29
29