react-native-unistyles 3.0.0-alpha.16 → 3.0.0-alpha.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,25 +21,7 @@ inline static Unistyle::Shared unistyleFromValue(jsi::Runtime& rt, const jsi::Va
21
21
  return nullptr;
22
22
  }
23
23
 
24
- auto obj = value.getObject(rt);
25
-
26
- if (!obj.hasNativeState(rt)) {
27
- throw jsi::JSError(rt, R"(Unistyles: Style is not bound!
28
-
29
- Potential reasons:
30
- - You likely used the spread operator on a Unistyle style outside of a JSX component
31
- - You're mixing React Native's StyleSheet styles with Unistyles styles
32
-
33
- If you need to merge styles, do it within the style prop of your JSX component:
34
-
35
- style={{...styles.container, ...styles.otherProp}} or style={[styles.container, styles.otherProp]}
36
-
37
- Copying a Unistyle style outside of a JSX element will remove its internal C++ state, leading to unexpected behavior.
38
-
39
- If you're mixing React Native and Unistyle StyleSheet styles, move your static styles into Unistyles to avoid conflicts.)");
40
- }
41
-
42
- return obj.getNativeState<UnistyleWrapper>(rt)->unistyle;
24
+ return value.getObject(rt).getNativeState<UnistyleWrapper>(rt)->unistyle;
43
25
  }
44
26
 
45
27
  inline static jsi::Value valueFromUnistyle(jsi::Runtime& rt, Unistyle::Shared unistyle) {
@@ -479,8 +479,8 @@ jsi::Value parser::Parser::getStylesForVariant(jsi::Runtime& rt, const std::stri
479
479
  : "default";
480
480
  auto hasKey = groupValue.hasProperty(rt, selectedVariantKey);
481
481
 
482
- if (hasKey && !selectedVariant.has_value()) {
483
- // add 'default' selection to variants map
482
+ if (!hasKey || !selectedVariant.has_value()) {
483
+ // for no key, add 'default' selection to variants map
484
484
  variants.emplace_back(groupName, selectedVariantKey);
485
485
  }
486
486
 
package/ios/Unistyles.h CHANGED
@@ -1,3 +1,4 @@
1
1
  #pragma once
2
2
 
3
+ #import "jsi/jsi.h"
3
4
  #import <React/RCTUtils.h>
@@ -24,6 +24,33 @@ HybridShadowRegistry.add = (handle, style, variants, args) => {
24
24
  if (typeof style !== 'object' && typeof style !== 'function') {
25
25
  return;
26
26
  }
27
+ if (!style.__unid) {
28
+ console.warn(`Unistyles: Style is not bound!
29
+
30
+ Potential reasons:
31
+ a) You created a new Expo or React Native project that references StyleSheet from React Native
32
+ b) You used the spread operator on a Unistyle style outside of a JSX component
33
+ c) You're mixing StyleSheet styles from React Native with Unistyles
34
+
35
+ a) For new projects
36
+ If you're using a freshly generated project, replace StyleSheet imports from React Native with Unistyles:
37
+
38
+ - import { StyleSheet } from 'react-native'
39
+ + import { StyleSheet } from 'react-native-unistyles'
40
+
41
+ b) Merging styles
42
+ If you need to merge styles, do it within the style prop of your JSX component:
43
+
44
+ style={{...styles.container, ...styles.otherProp}}
45
+ or
46
+ style={[styles.container, styles.otherProp]}
47
+
48
+ Copying a Unistyle style outside of a JSX element will remove its internal C++ state, leading to unexpected behavior.
49
+
50
+ c) Mixing styles
51
+ If you're mixing React Native and Unistyle StyleSheet styles, move your static styles into Unistyles to avoid conflicts.\n`);
52
+ return;
53
+ }
27
54
  HybridShadowRegistry.link(findShadowNodeForHandle(handle), style, variants ?? {}, args ?? []);
28
55
  };
29
56
  HybridShadowRegistry.remove = (handle, style) => {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","args","link","remove","__unid","unlink","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AAaA,MAAMC,oBAAoB,GAAGC,qCAAY,CAACC,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP;IACA,MAAM,IAAIK,KAAK,CAAC,uDAAuD,CAAC;EAC5E;EAEA,OAAOL,IAAI;AACf,CAAC;AAEDL,oBAAoB,CAACW,GAAG,GAAG,CAACP,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEC,IAAI,KAAK;EAC1D;EACA,IAAI,CAACV,MAAM,IAAI,CAACQ,KAAK,EAAE;IACnB;EACJ;;EAEA;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;IAC1D;EACJ;EAEAZ,oBAAoB,CAACe,IAAI,CAACZ,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,EAAEC,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,CAAC;AACjG,CAAC;AAEDd,oBAAoB,CAACgB,MAAM,GAAG,CAACZ,MAAM,EAAEQ,KAAK,KAAK;EAC7C,IAAI,CAACR,MAAM,IAAI,CAACQ,KAAK,EAAEK,MAAM,EAAE;IAC3B;EACJ;EAEAjB,oBAAoB,CAACkB,MAAM,CAACf,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,CAAC;AACvE,CAAC;AAQM,MAAMO,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAGnB,oBAA4D","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeNitroModules","require","HybridShadowRegistry","NitroModules","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","args","__unid","console","warn","link","remove","unlink","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAA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AAI,CAACQ,KAAK,EAAEG,MAAM,EAAE;IAC3B;EACJ;EAEAf,oBAAoB,CAACoB,MAAM,CAACjB,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,CAAC;AACvE,CAAC;AAQM,MAAMS,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAGrB,oBAA4D","ignoreList":[]}
@@ -23,7 +23,7 @@ const convertToTypeStyle = value => {
23
23
  ...value._web
24
24
  }).flatMap(([unistylesKey, unistylesValue]) => {
25
25
  // Keys to omit
26
- if (['_css', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
26
+ if (['_classNames', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
27
27
  return [];
28
28
  }
29
29
 
@@ -1 +1 @@
1
- {"version":3,"names":["_typestyle","require","_pseudo","_breakpoint","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","isPseudo","typestyleValues","$nest","replace","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","media","convertBreakpoint","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAEO,MAAMS,kBAAkB,GAAIC,KAAsB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QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO,IAAAC,gBAAK,EAAC,IAAAC,6BAAiB,EAACH,aAAa,CAAC,EAAE,IAAAI,eAAQ,EAACnB,YAAY,EAAEgB,eAAe,CAAC,CAAC;MAC3F,CAAC,CAAC;IACN;;IAEA;IACA,OAAO,IAAAG,eAAQ,EAACnB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAO,IAAAmB,uBAAgB,EAAC,GAAGzB,WAAW,CAAC;AAC3C,CAAC;AAAA0B,OAAA,CAAA9B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typestyle","require","_pseudo","_breakpoint","_style","_utils","_transform","_utils2","_textShadow","_boxShadow","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","isPseudo","typestyleValues","$nest","replace","isTextShadow","getTextShadowStyle","isBoxShadow","getBoxShadowStyle","isTransform","getTransformStyle","map","breakpointKey","breakpointValue","media","convertBreakpoint","getStyle","deepMergeObjects","exports"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAEO,MAAMS,kBAAkB,GAAIC,KAAsB,IAAK;EAC1D;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;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,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACa,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO,IAAAC,gBAAK,EAAC,IAAAC,6BAAiB,EAACH,aAAa,CAAC,EAAE,IAAAI,eAAQ,EAACnB,YAAY,EAAEgB,eAAe,CAAC,CAAC;MAC3F,CAAC,CAAC;IACN;;IAEA;IACA,OAAO,IAAAG,eAAQ,EAACnB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAO,IAAAmB,uBAAgB,EAAC,GAAGzB,WAAW,CAAC;AAC3C,CAAC;AAAA0B,OAAA,CAAA9B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -13,13 +13,6 @@ class UnistylesRegistryBuilder {
13
13
  const className = unistyles.style({
14
14
  $debugName: `${key}-${Math.random().toString(16).slice(10)}`
15
15
  }, typestyleStylesheet);
16
- if (stylesheet._web?._css) {
17
- const customClassName = Array.isArray(stylesheet._web._css) ? stylesheet._web._css.join(' ') : stylesheet._web._css;
18
- return {
19
- className: `${className} ${customClassName}`,
20
- unistyles
21
- };
22
- }
23
16
  return {
24
17
  className,
25
18
  unistyles
@@ -1 +1 @@
1
- {"version":3,"names":["_typestyle","require","_convert","UnistylesRegistryBuilder","createStyles","stylesheet","key","unistyles","createTypeStyle","typestyleStylesheet","convertToTypeStyle","className","style","$debugName","Math","random","toString","slice","_web","_css","customClassName","Array","isArray","join","updateStyles","reinit","cssRule","UnistylesRegistry","exports"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EAC3BC,YAAY,GAAGA,CAACC,UAA2B,EAAEC,GAAW,KAAK;IACzD,MAAMC,SAAS,GAAG,IAAAC,0BAAe,EAAC,CAAC;IACnC,MAAMC,mBAAmB,GAAG,IAAAC,2BAAkB,EAACL,UAAU,CAAC;IAE1D,MAAMM,SAAS,GAAGJ,SAAS,CAACK,KAAK,CAAC;MAC9BC,UAAU,EAAE,GAAGP,GAAG,IAAIQ,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,EAAE,CAAC;IAC9D,CAAC,EAAER,mBAAmB,CAAC;IAEvB,IAAIJ,UAAU,CAACa,IAAI,EAAEC,IAAI,EAAE;MACvB,MAAMC,eAAe,GAAGC,KAAK,CAACC,OAAO,CAACjB,UAAU,CAACa,IAAI,CAACC,IAAI,CAAC,GACrDd,UAAU,CAACa,IAAI,CAACC,IAAI,CAACI,IAAI,CAAC,GAAG,CAAC,GAC9BlB,UAAU,CAACa,IAAI,CAACC,IAAI;MAE1B,OAAO;QACHR,SAAS,EAAE,GAAGA,SAAS,IAAIS,eAAe,EAAE;QAC5Cb;MACJ,CAAC;IACL;IAEA,OAAO;MACHI,SAAS;MACTJ;IACJ,CAAC;EACL,CAAC;EAEDiB,YAAY,GAAGA,CAACjB,SAAoB,EAAEF,UAA2B,EAAEM,SAAiB,KAAK;IACrF,MAAMF,mBAAmB,GAAG,IAAAC,2BAAkB,EAACL,UAAU,CAAC;IAE1DE,SAAS,CAACkB,MAAM,CAAC,CAAC;IAClBlB,SAAS,CAACmB,OAAO,CAAC,IAAIf,SAAS,EAAE,EAAEF,mBAAmB,CAAC;EAC3D,CAAC;AACL;AAEO,MAAMkB,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIxB,wBAAwB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_typestyle","require","_convert","UnistylesRegistryBuilder","createStyles","stylesheet","key","unistyles","createTypeStyle","typestyleStylesheet","convertToTypeStyle","className","style","$debugName","Math","random","toString","slice","updateStyles","reinit","cssRule","UnistylesRegistry","exports"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAEA,MAAME,wBAAwB,CAAC;EAC3BC,YAAY,GAAGA,CAACC,UAA2B,EAAEC,GAAW,KAAK;IACzD,MAAMC,SAAS,GAAG,IAAAC,0BAAe,EAAC,CAAC;IACnC,MAAMC,mBAAmB,GAAG,IAAAC,2BAAkB,EAACL,UAAU,CAAC;IAE1D,MAAMM,SAAS,GAAGJ,SAAS,CAACK,KAAK,CAAC;MAC9BC,UAAU,EAAE,GAAGP,GAAG,IAAIQ,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,EAAE,CAAC;IAC9D,CAAC,EAAER,mBAAmB,CAAC;IAEvB,OAAO;MACHE,SAAS;MACTJ;IACJ,CAAC;EACL,CAAC;EAEDW,YAAY,GAAGA,CAACX,SAAoB,EAAEF,UAA2B,EAAEM,SAAiB,KAAK;IACrF,MAAMF,mBAAmB,GAAG,IAAAC,2BAAkB,EAACL,UAAU,CAAC;IAE1DE,SAAS,CAACY,MAAM,CAAC,CAAC;IAClBZ,SAAS,CAACa,OAAO,CAAC,IAAIT,SAAS,EAAE,EAAEF,mBAAmB,CAAC;EAC3D,CAAC;AACL;AAEO,MAAMY,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIlB,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -93,6 +93,10 @@ class UnistylesShadowRegistryBuilder {
93
93
  }));
94
94
  if (!storedWebUnistyle) {
95
95
  const styleTag = document.createElement('style');
96
+ const additionalClasses = resultWithVariants._web._classNames;
97
+ if (additionalClasses) {
98
+ ref.classList.add(...(Array.isArray(additionalClasses) ? additionalClasses : [additionalClasses]));
99
+ }
96
100
  ref.classList.add(webUnistyle.className);
97
101
  webUnistyle.unistyles.setStylesTarget(styleTag);
98
102
  document.head.appendChild(styleTag);
@@ -1 +1 @@
1
- {"version":3,"names":["_listener","require","_registry","_runtime","_utils","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","webUnistylesMap","createDoubleMap","disposeMap","stylesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","extractSecrets","__uni__refs","isInDocument","remove","HTMLElement","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","UnistylesRuntime","theme","miniRuntime","args","resultHidden","result","extractHiddenProperties","variants","fromEntries","getVariants","length","resultWithVariants","storedWebUnistyle","get","webUnistyle","UnistylesRegistry","createStyles","set","listenToDependencies","stylesheet","className","unistyles","styleTag","document","createElement","classList","setStylesTarget","head","appendChild","updateStyles","delete","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAMA,MAAMK,8BAA8B,CAAC;EACjC;EACAC,IAAI,GAAG,yBAAyB;EAChCC,MAAM,GAAG,KAAK;EACdC,MAAM,GAAGA,CAAA,KAAM,IAAI;EACnBC,QAAQ,GAAGA,CAAA,KAAM,yBAAyB;EAC1CC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB;;EAEiBC,eAAe,GAAG,IAAAC,sBAAe,EAAmC,CAAC;EACrEC,UAAU,GAAG,IAAAD,sBAAe,EAAgD,CAAC;EAC7EE,SAAS,GAAG,IAAAF,sBAAe,EAAwC,CAAC;EAErFG,GAAG,GAAGA,CAACC,GAAQ,EAAEC,MAA6B,EAAEC,SAA+B,EAAEC,KAAkB,KAAK;IACpG;IACA,IAAI,CAACF,MAAM,EAAE;MACT;IACJ;;IAEA;IACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,EAAE;MACvBA,MAAM,CAACK,OAAO,CAACC,KAAK,IAAI,IAA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AAC;QAC/CC,QAAQ,CAACI,IAAI,CAACC,WAAW,CAACN,QAAQ,CAAC;QACnChC,WAAW,CAAChB,GAAG,CAACC,GAAG,CAAC;QACpB,IAAI,CAACF,SAAS,CAAC4C,GAAG,CAAC1C,GAAG,EAAEoB,UAAU,EAAE2B,QAAQ,CAAC;MACjD;MAEA,IAAIV,iBAAiB,EAAE;QACnBG,2BAAiB,CAACc,YAAY,CAACf,WAAW,CAACO,SAAS,EAAEV,kBAAkB,EAAEG,WAAW,CAACM,SAAS,CAAC;MACpG;IACJ,CAAC,CAAC;EACN,CAAC;EAED5B,MAAM,GAAGA,CAACjB,GAAgB,EAAEO,KAAY,KAAK;IACzC,IAAAO,qBAAc,EAACP,KAAK,CAAC,CAACD,OAAO,CAAC,CAAC;MAAEc;IAAW,CAAC,KAAK;MAC9C,IAAI,CAACzB,eAAe,CAAC4D,MAAM,CAACvD,GAAG,EAAEoB,UAAU,CAAC;MAC5C,IAAI,CAACvB,UAAU,CAACyC,GAAG,CAACtC,GAAG,EAAEoB,UAAU,CAAC,GAAG,CAAC;MACxC,IAAI,CAACvB,UAAU,CAAC0D,MAAM,CAACvD,GAAG,EAAEoB,UAAU,CAAC;MACvC,IAAI,CAACtB,SAAS,CAACwC,GAAG,CAACtC,GAAG,EAAEoB,UAAU,CAAC,EAAEH,MAAM,CAAC,CAAC;MAC7C,IAAI,CAACnB,SAAS,CAACyD,MAAM,CAACvD,GAAG,EAAEoB,UAAU,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC;AACL;AAEO,MAAMoC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAInE,8BAA8B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_listener","require","_registry","_runtime","_utils","_variants2","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","webUnistylesMap","createDoubleMap","disposeMap","stylesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","extractSecrets","__uni__refs","isInDocument","remove","HTMLElement","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","UnistylesRuntime","theme","miniRuntime","args","resultHidden","result","extractHiddenProperties","variants","fromEntries","getVariants","length","resultWithVariants","storedWebUnistyle","get","webUnistyle","UnistylesRegistry","createStyles","set","listenToDependencies","stylesheet","className","unistyles","styleTag","document","createElement","additionalClasses","_web","_classNames","classList","setStylesTarget","head","appendChild","updateStyles","delete","UnistylesShadowRegistry","exports"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAMA,MAAMK,8BAA8B,CAAC;EACjC;EACAC,IAAI,GAAG,yBAAyB;EAChCC,MAAM,GAAG,KAAK;EACdC,MAAM,GAAGA,CAAA,KAAM,IAAI;EACnBC,QAAQ,GAAGA,CAAA,KAAM,yBAAyB;EAC1CC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB;;EAEiBC,eAAe,GAAG,IAAAC,sBAAe,EAAmC,CAAC;EACrEC,UAAU,GAAG,IAAAD,sBAAe,EAAgD,CAAC;EAC7EE,SAAS,GAAG,IAAAF,sBAAe,EAAwC,CAAC;EAErFG,GAAG,GAAGA,CAACC,GAAQ,EAAEC,MAA6B,EAAEC,SAA+B,EAAEC,KAAkB,KAAK;IACpG;IACA,IAAI,CAACF,MAAM,EAAE;MACT;IACJ;;IAEA;IACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,EAAE;MACvBA,MAAM,CAACK,OAAO,CAACC,KAAK,IAAI,IAAI,CAACR,GAAG,CAACC,GAAG,EAAEO,KAAK,EAAEL,SAAS,EAAEC,KAAK,CAAC,CAAC;MAE/D;IACJ;;IAEA;IACA,IAAI,CAACK,MAAM,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!== 'object' && typeof style !== 'function') {
21
21
  return;
22
22
  }
23
+ if (!style.__unid) {
24
+ console.warn(`Unistyles: Style is not bound!
25
+
26
+ Potential reasons:
27
+ a) You created a new Expo or React Native project that references StyleSheet from React Native
28
+ b) You used the spread operator on a Unistyle style outside of a JSX component
29
+ c) You're mixing StyleSheet styles from React Native with Unistyles
30
+
31
+ a) For new projects
32
+ If you're using a freshly generated project, replace StyleSheet imports from React Native with Unistyles:
33
+
34
+ - import { StyleSheet } from 'react-native'
35
+ + import { StyleSheet } from 'react-native-unistyles'
36
+
37
+ b) Merging styles
38
+ If you need to merge styles, do it within the style prop of your JSX component:
39
+
40
+ style={{...styles.container, ...styles.otherProp}}
41
+ or
42
+ style={[styles.container, styles.otherProp]}
43
+
44
+ Copying a Unistyle style outside of a JSX element will remove its internal C++ state, leading to unexpected behavior.
45
+
46
+ c) Mixing styles
47
+ If you're mixing React Native and Unistyle StyleSheet styles, move your static styles into Unistyles to avoid conflicts.\n`);
48
+ return;
49
+ }
23
50
  HybridShadowRegistry.link(findShadowNodeForHandle(handle), style, variants ?? {}, args ?? []);
24
51
  };
25
52
  HybridShadowRegistry.remove = (handle, style) => {
@@ -1 +1 @@
1
- {"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","args","link","remove","__unid","unlink","UnistylesShadowRegistry"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAazD,MAAMC,oBAAoB,GAAGD,YAAY,CAACE,kBAAkB,CAAiB,yBAAyB,CAAC;AAEvG,MAAMC,uBAAuB,GAAIC,MAAkB,IAAK;EACpD,MAAMC,IAAI,GAAGD,MAAM,EAAEE,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACvDD,MAAM,EAAEI,kBAAkB,GAAG,CAAC,EAAEC,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI,IACjGD,MAAM,EAAEK,kBAAkB,GAAG,CAAC,EAAEH,wBAAwB,EAAEC,SAAS,EAAEF,IAAI;EAEhF,IAAI,CAACA,IAAI,EAAE;IACP;IACA,MAAM,IAAIK,KAAK,CAAC,uDAAuD,CAAC;EAC5E;EAEA,OAAOL,IAAI;AACf,CAAC;AAEDJ,oBAAoB,CAACU,GAAG,GAAG,CAACP,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,EAAEC,IAAI,KAAK;EAC1D;EACA,IAAI,CAACV,MAAM,IAAI,CAACQ,KAAK,EAAE;IACnB;EACJ;;EAEA;EACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,UAAU,EAAE;IAC1D;EACJ;EAEAX,oBAAoB,CAACc,IAAI,CAACZ,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,EAAEC,QAAQ,IAAI,CAAC,CAAC,EAAEC,IAAI,IAAI,EAAE,CAAC;AACjG,CAAC;AAEDb,oBAAoB,CAACe,MAAM,GAAG,CAACZ,MAAM,EAAEQ,KAAK,KAAK;EAC7C,IAAI,CAACR,MAAM,IAAI,CAACQ,KAAK,EAAEK,MAAM,EAAE;IAC3B;EACJ;EAEAhB,oBAAoB,CAACiB,MAAM,CAACf,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,CAAC;AACvE,CAAC;AAQD,OAAO,MAAMO,uBAAuB,GAAGlB,oBAA4D","ignoreList":[]}
1
+ {"version":3,"names":["NitroModules","HybridShadowRegistry","createHybridObject","findShadowNodeForHandle","handle","node","__internalInstanceHandle","stateNode","getScrollResponder","getNativeScrollRef","Error","add","style","variants","args","__unid","console","warn","link","remove","unlink","UnistylesShadowRegistry"],"sourceRoot":"../../../../src","sources":["specs/ShadowRegistry/index.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAazD,MAAMC,oBAAoB,GAAGD,YA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J;EAEAd,oBAAoB,CAACmB,MAAM,CAACjB,uBAAuB,CAACC,MAAM,CAAC,EAAEQ,KAAK,CAAC;AACvE,CAAC;AAQD,OAAO,MAAMS,uBAAuB,GAAGpB,oBAA4D","ignoreList":[]}
@@ -19,7 +19,7 @@ export const convertToTypeStyle = value => {
19
19
  ...value._web
20
20
  }).flatMap(([unistylesKey, unistylesValue]) => {
21
21
  // Keys to omit
22
- if (['_css', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
22
+ if (['_classNames', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
23
23
  return [];
24
24
  }
25
25
 
@@ -1 +1 @@
1
- {"version":3,"names":["media","isPseudo","convertBreakpoint","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","typestyleValues","$nest","replace","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;AAEA,SAASA,KAAK,QAAQ,WAAW;AACjC,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,WAAW,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAChE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,OAAO,MAAMC,kBAAkB,GAAIC,KAAsB,IAAK;EAC1D;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,YAAY,GAAG,KAAK;EAExB,MA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CAAC,KAAK;QAC5E,OAAO7B,KAAK,CAACE,iBAAiB,CAAC0B,aAAa,CAAC,EAAEzB,QAAQ,CAACiB,YAAY,EAAES,eAAe,CAAC,CAAC;MAC3F,CAAC,CAAC;IACN;;IAEA;IACA,OAAO1B,QAAQ,CAACiB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAOjB,gBAAgB,CAAC,GAAGW,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["media","isPseudo","convertBreakpoint","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertToTypeStyle","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","typestyleValues","$nest","replace","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.ts"],"mappings":";;AAEA,SAASA,KAAK,QAAQ,WAAW;AACjC,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,QAAQ,QAAQ,SAAS;AAClC,SAASC,gBAAgB,QAAQ,UAAU;AAC3C,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,WAAW,EAAEC,YAAY,EAAEC,WAAW,QAAQ,SAAS;AAChE,SAASC,kBAAkB,QAAQ,cAAc;AACjD,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,OAAO,MAAMC,kBAAkB,GAAIC,KAAsB,IAAK;EAC1D;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,YAAY,GAAG,KAAK;EAExB,MAAMC,WAAW,GAAGC,MAAM,CAACC,OAAO,CAAC;IAC/B,GAAGL,KAAK;IACR,GAAGA,KAAK,CAACM;EACb,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,CAACC,YAAY,EAAEC,cAAc,CAAC,KAAK;IAC3C;IACA,IAAI,CAAC,aAAa,E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c,CAAC;EACjD,CAAC,CAA+B;EAEhC,OAAOjB,gBAAgB,CAAC,GAAGW,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
@@ -9,13 +9,6 @@ class UnistylesRegistryBuilder {
9
9
  const className = unistyles.style({
10
10
  $debugName: `${key}-${Math.random().toString(16).slice(10)}`
11
11
  }, typestyleStylesheet);
12
- if (stylesheet._web?._css) {
13
- const customClassName = Array.isArray(stylesheet._web._css) ? stylesheet._web._css.join(' ') : stylesheet._web._css;
14
- return {
15
- className: `${className} ${customClassName}`,
16
- unistyles
17
- };
18
- }
19
12
  return {
20
13
  className,
21
14
  unistyles
@@ -1 +1 @@
1
- {"version":3,"names":["createTypeStyle","convertToTypeStyle","UnistylesRegistryBuilder","createStyles","stylesheet","key","unistyles","typestyleStylesheet","className","style","$debugName","Math","random","toString","slice","_web","_css","customClassName","Array","isArray","join","updateStyles","reinit","cssRule","UnistylesRegistry"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAmB,WAAW;AAEtD,SAASC,kBAAkB,QAAQ,WAAW;AAE9C,MAAMC,wBAAwB,CAAC;EAC3BC,YAAY,GAAGA,CAACC,UAA2B,EAAEC,GAAW,KAAK;IACzD,MAAMC,SAAS,GAAGN,eAAe,CAAC,CAAC;IACnC,MAAMO,mBAAmB,GAAGN,kBAAkB,CAACG,UAAU,CAAC;IAE1D,MAAMI,SAAS,GAAGF,SAAS,CAACG,KAAK,CAAC;MAC9BC,UAAU,EAAE,GAAGL,GAAG,IAAIM,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,EAAE,CAAC;IAC9D,CAAC,EAAEP,mBAAmB,CAAC;IAEvB,IAAIH,UAAU,CAACW,IAAI,EAAEC,IAAI,EAAE;MACvB,MAAMC,eAAe,GAAGC,KAAK,CAACC,OAAO,CAACf,UAAU,CAACW,IAAI,CAACC,IAAI,CAAC,GACrDZ,UAAU,CAACW,IAAI,CAACC,IAAI,CAACI,IAAI,CAAC,GAAG,CAAC,GAC9BhB,UAAU,CAACW,IAAI,CAACC,IAAI;MAE1B,OAAO;QACHR,SAAS,EAAE,GAAGA,SAAS,IAAIS,eAAe,EAAE;QAC5CX;MACJ,CAAC;IACL;IAEA,OAAO;MACHE,SAAS;MACTF;IACJ,CAAC;EACL,CAAC;EAEDe,YAAY,GAAGA,CAACf,SAAoB,EAAEF,UAA2B,EAAEI,SAAiB,KAAK;IACrF,MAAMD,mBAAmB,GAAGN,kBAAkB,CAACG,UAAU,CAAC;IAE1DE,SAAS,CAACgB,MAAM,CAAC,CAAC;IAClBhB,SAAS,CAACiB,OAAO,CAAC,IAAIf,SAAS,EAAE,EAAED,mBAAmB,CAAC;EAC3D,CAAC;AACL;AAEA,OAAO,MAAMiB,iBAAiB,GAAG,IAAItB,wBAAwB,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createTypeStyle","convertToTypeStyle","UnistylesRegistryBuilder","createStyles","stylesheet","key","unistyles","typestyleStylesheet","className","style","$debugName","Math","random","toString","slice","updateStyles","reinit","cssRule","UnistylesRegistry"],"sourceRoot":"../../../src","sources":["web/registry.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAmB,WAAW;AAEtD,SAASC,kBAAkB,QAAQ,WAAW;AAE9C,MAAMC,wBAAwB,CAAC;EAC3BC,YAAY,GAAGA,CAACC,UAA2B,EAAEC,GAAW,KAAK;IACzD,MAAMC,SAAS,GAAGN,eAAe,CAAC,CAAC;IACnC,MAAMO,mBAAmB,GAAGN,kBAAkB,CAACG,UAAU,CAAC;IAE1D,MAAMI,SAAS,GAAGF,SAAS,CAACG,KAAK,CAAC;MAC9BC,UAAU,EAAE,GAAGL,GAAG,IAAIM,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,EAAE,CAAC;IAC9D,CAAC,EAAEP,mBAAmB,CAAC;IAEvB,OAAO;MACHC,SAAS;MACTF;IACJ,CAAC;EACL,CAAC;EAEDS,YAAY,GAAGA,CAACT,SAAoB,EAAEF,UAA2B,EAAEI,SAAiB,KAAK;IACrF,MAAMD,mBAAmB,GAAGN,kBAAkB,CAACG,UAAU,CAAC;IAE1DE,SAAS,CAACU,MAAM,CAAC,CAAC;IAClBV,SAAS,CAACW,OAAO,CAAC,IAAIT,SAAS,EAAE,EAAED,mBAAmB,CAAC;EAC3D,CAAC;AACL;AAEA,OAAO,MAAMW,iBAAiB,GAAG,IAAIhB,wBAAwB,CAAC,CAAC","ignoreList":[]}
@@ -89,6 +89,10 @@ class UnistylesShadowRegistryBuilder {
89
89
  }));
90
90
  if (!storedWebUnistyle) {
91
91
  const styleTag = document.createElement('style');
92
+ const additionalClasses = resultWithVariants._web._classNames;
93
+ if (additionalClasses) {
94
+ ref.classList.add(...(Array.isArray(additionalClasses) ? additionalClasses : [additionalClasses]));
95
+ }
92
96
  ref.classList.add(webUnistyle.className);
93
97
  webUnistyle.unistyles.setStylesTarget(styleTag);
94
98
  document.head.appendChild(styleTag);
@@ -1 +1 @@
1
- {"version":3,"names":["listenToDependencies","UnistylesRegistry","UnistylesRuntime","createDoubleMap","extractHiddenProperties","extractSecrets","isInDocument","getVariants","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","webUnistylesMap","disposeMap","stylesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","__uni__refs","remove","HTMLElement","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","theme","miniRuntime","args","resultHidden","result","variants","fromEntries","length","resultWithVariants","storedWebUnistyle","get","webUnistyle","createStyles","set","stylesheet","className","unistyles","styleTag","document","createElement","classList","setStylesTarget","head","appendChild","updateStyles","delete","UnistylesShadowRegistry"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;AACA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,QA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D,MAAM,CAAChD,GAAG,EAAEkB,UAAU,CAAC;MAC5C,IAAI,CAACrB,UAAU,CAACoC,GAAG,CAACjC,GAAG,EAAEkB,UAAU,CAAC,GAAG,CAAC;MACxC,IAAI,CAACrB,UAAU,CAACmD,MAAM,CAAChD,GAAG,EAAEkB,UAAU,CAAC;MACvC,IAAI,CAACpB,SAAS,CAACmC,GAAG,CAACjC,GAAG,EAAEkB,UAAU,CAAC,EAAEH,MAAM,CAAC,CAAC;MAC7C,IAAI,CAACjB,SAAS,CAACkD,MAAM,CAAChD,GAAG,EAAEkB,UAAU,CAAC;IAC1C,CAAC,CAAC;EACN,CAAC;AACL;AAEA,OAAO,MAAM+B,uBAAuB,GAAG,IAAI3D,8BAA8B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["listenToDependencies","UnistylesRegistry","UnistylesRuntime","createDoubleMap","extractHiddenProperties","extractSecrets","isInDocument","getVariants","UnistylesShadowRegistryBuilder","name","__type","equals","toString","dispose","webUnistylesMap","disposeMap","stylesMap","add","ref","_style","_variants","_args","Array","isArray","forEach","style","Object","keys","some","key","startsWith","secrets","__uni__refs","remove","HTMLElement","secret","__uni__key","__uni__stylesheet","__uni__variants","__uni__args","newComputedStylesheet","theme","miniRuntime","args","resultHidden","result","variants","fromEntries","length","resultWithVariants","storedWebUnistyle","get","webUnistyle","createStyles","set","stylesheet","className","unistyles","styleTag","document","createElement","additionalClasses","_web","_classNames","classList","setStylesTarget","head","appendChild","updateStyles","delete","UnistylesShadowRegistry"],"sourceRoot":"../../../src","sources":["web/shadowRegistry.ts"],"mappings":";;AACA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,eAAe,EAAEC,uBAAuB,EAAEC,cAAc,EAAEC,YAAY,QAAQ,SAAS;AAChG,SAASC,WAAW,QAAQ,YAAY;AAMxC,MAAMC,8BAA8B,CAAC;EACjC;EAC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K,GACL,QAAQ,GACR,MAAM,GACN,QAAQ,CAAA;AAEd,eAAO,MAAM,uBAAuB,EAA2B,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA"}
@@ -21,7 +21,7 @@ type VariantsObject = {
21
21
  };
22
22
  };
23
23
  type CustomClassName = {
24
- _css?: string | Array<string>;
24
+ _classNames?: string | Array<string>;
25
25
  };
26
26
  type CompoundVariant = {
27
27
  styles: Omit<UnistylesValues, 'variants' | 'compoundVariants'>;
@@ -1 +1 @@
1
- {"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../../../src/types/stylesheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,UAAU,GAAG,cAAc,GAAG,WAAW,GAAG,kBAAkB,CAAA;AAEnE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;AACtD,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;AACtD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAExD,KAAK,oBAAoB,GAAG;IACxB,YAAY,CAAC,EAAE,eAAe,C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,CAAA;CAC7E,CAAA;AAED,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,UAAU,IACpD,CAAC,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,KAAK,CAAC,CAAC,GACjE,CAAC,CAAA;AAEP,KAAK,aAAa,CAAC,CAAC,IAAI;IACpB,WAAW,EAAE,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAA;CAC1D,CAAA;AAED,QAAA,MAAM,MAAM,GAAI,CAAC,SAAS,UAAU,cAAc,yBAAyB,CAAC,CAAC,CAAC,KAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,OAAO,UAAU,CAAC,CAAgF,CAAA;AAE7N,MAAM,MAAM,yBAAyB,GAAG,OAAO,MAAM,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/web/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,SAAS,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C,cAAM,wBAAwB;IAC1B,YAAY,eAAgB,eAAe,OAAO,MAAM;;;MAuBvD;IAED,YAAY,cAAe,SAAS,cAAc,eAAe,aAAa,MAAM,UAKnF;CACJ;AAED,eAAO,MAAM,iBAAiB,0BAAiC,CAAA"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/web/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,SAAS,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C,cAAM,wBAAwB;IAC1B,YAAY,eAAgB,eAAe,OAAO,MAAM;;;MAYvD;IAED,YAAY,cAAe,SAAS,cAAc,eAAe,aAAa,MAAM,UAKnF;CACJ;AAED,eAAO,MAAM,iBAAiB,0BAAiC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"shadowRegistry.d.ts","sourceRoot":"","sources":["../../../../src/web/shadowRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS/C,KAAK,KAAK,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,eAAe,CAAC,CAAA;AAEzE,cAAM,8BAA8B;IAEhC,IAAI,SAA4B;IAChC,MAAM,SAAQ;IACd,MAAM,gBAAa;IACnB,QAAQ,eAAkC;IAC1C,OAAO,aAAW;IAGlB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsD;IACtF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmE;IAC9F,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2D;IAErF,GAAG,QAAS,GAAG,WAAW,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,KAAK,CAAC,GAAG,CAAC,UAmFlG;IAED,MAAM,QAAS,WAAW,SAAS,KAAK,UAQvC;CACJ;AAED,eAAO,MAAM,uBAAuB,gCAAuC,CAAA"}
1
+ {"version":3,"file":"shadowRegistry.d.ts","sourceRoot":"","sources":["../../../../src/web/shadowRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS/C,KAAK,KAAK,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,eAAe,CAAC,CAAA;AAEzE,cAAM,8BAA8B;IAEhC,IAAI,SAA4B;IAChC,MAAM,SAAQ;IACd,MAAM,gBAAa;IACnB,QAAQ,eAAkC;IAC1C,OAAO,aAAW;IAGlB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsD;IACtF,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmE;IAC9F,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2D;IAErF,GAAG,QAAS,GAAG,WAAW,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,KAAK,CAAC,GAAG,CAAC,UAyFlG;IAED,MAAM,QAAS,WAAW,SAAS,KAAK,UAQvC;CACJ;AAED,eAAO,MAAM,uBAAuB,gCAAuC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "3.0.0-alpha.16",
3
+ "version": "3.0.0-alpha.18",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -37,6 +37,35 @@ HybridShadowRegistry.add = (handle, style, variants, args) => {
37
37
  return
38
38
  }
39
39
 
40
+ if (!style.__unid) {
41
+ console.warn(`Unistyles: Style is not bound!
42
+
43
+ Potential reasons:
44
+ a) You created a new Expo or React Native project that references StyleSheet from React Native
45
+ b) You used the spread operator on a Unistyle style outside of a JSX component
46
+ c) You're mixing StyleSheet styles from React Native with Unistyles
47
+
48
+ a) For new projects
49
+ If you're using a freshly generated project, replace StyleSheet imports from React Native with Unistyles:
50
+
51
+ - import { StyleSheet } from 'react-native'
52
+ + import { StyleSheet } from 'react-native-unistyles'
53
+
54
+ b) Merging styles
55
+ If you need to merge styles, do it within the style prop of your JSX component:
56
+
57
+ style={{...styles.container, ...styles.otherProp}}
58
+ or
59
+ style={[styles.container, styles.otherProp]}
60
+
61
+ Copying a Unistyle style outside of a JSX element will remove its internal C++ state, leading to unexpected behavior.
62
+
63
+ c) Mixing styles
64
+ If you're mixing React Native and Unistyle StyleSheet styles, move your static styles into Unistyles to avoid conflicts.\n`)
65
+
66
+ return
67
+ }
68
+
40
69
  HybridShadowRegistry.link(findShadowNodeForHandle(handle), style, variants ?? {}, args ?? [])
41
70
  }
42
71
 
@@ -27,7 +27,7 @@ type VariantsObject = {
27
27
  }
28
28
 
29
29
  type CustomClassName = {
30
- _css?: string | Array<string>
30
+ _classNames?: string | Array<string>
31
31
  }
32
32
 
33
33
  type CompoundVariant = {
@@ -21,7 +21,7 @@ export const convertToTypeStyle = (value: UnistylesValues) => {
21
21
  ...value._web
22
22
  }).flatMap(([unistylesKey, unistylesValue]) => {
23
23
  // Keys to omit
24
- if (['_css', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
24
+ if (['_classNames', '_web', 'variants', 'compoundVariants', 'uni__dependencies', '__unistyles-secrets__'].includes(unistylesKey) || unistylesKey.startsWith('variant-')) {
25
25
  return []
26
26
  }
27
27
 
@@ -11,17 +11,6 @@ class UnistylesRegistryBuilder {
11
11
  $debugName: `${key}-${Math.random().toString(16).slice(10)}`,
12
12
  }, typestyleStylesheet)
13
13
 
14
- if (stylesheet._web?._css) {
15
- const customClassName = Array.isArray(stylesheet._web._css)
16
- ? stylesheet._web._css.join(' ')
17
- : stylesheet._web._css
18
-
19
- return {
20
- className: `${className} ${customClassName}`,
21
- unistyles
22
- }
23
- }
24
-
25
14
  return {
26
15
  className,
27
16
  unistyles
@@ -94,6 +94,12 @@ class UnistylesShadowRegistryBuilder {
94
94
  if (!storedWebUnistyle) {
95
95
  const styleTag = document.createElement('style')
96
96
 
97
+ const additionalClasses = resultWithVariants._web._classNames
98
+
99
+ if (additionalClasses) {
100
+ ref.classList.add(...Array.isArray(additionalClasses) ? additionalClasses : [additionalClasses])
101
+ }
102
+
97
103
  ref.classList.add(webUnistyle.className)
98
104
  webUnistyle.unistyles.setStylesTarget(styleTag)
99
105
  document.head.appendChild(styleTag)