react-native-unistyles 3.0.0-alpha.29 → 3.0.0-alpha.30
Sign up to get free protection for your applications and to get access to all the features.
- package/cxx/common/Helpers.h +11 -0
- package/cxx/core/HostStyle.cpp +1 -1
- package/cxx/core/UnistyleWrapper.h +9 -8
- package/cxx/core/UnistylesCommitHook.cpp +3 -14
- package/cxx/core/UnistylesCommitHook.h +5 -11
- package/cxx/core/UnistylesMountHook.cpp +0 -1
- package/cxx/core/UnistylesMountHook.h +0 -2
- package/cxx/core/UnistylesRegistry.cpp +1 -1
- package/cxx/core/UnistylesRegistry.h +1 -1
- package/cxx/hybridObjects/HybridStyleSheet.cpp +17 -11
- package/cxx/hybridObjects/HybridStyleSheet.h +1 -1
- package/cxx/parser/Parser.cpp +20 -14
- package/cxx/parser/Parser.h +1 -1
- package/cxx/shadowTree/ShadowTrafficController.h +4 -0
- package/cxx/shadowTree/ShadowTreeManager.cpp +3 -4
- package/cxx/shadowTree/ShadowTreeManager.h +1 -1
- package/ios/UnistylesModuleOnLoad.mm +4 -4
- package/lib/commonjs/common.js.map +1 -1
- package/lib/commonjs/core/createUnistylesComponent.js +18 -0
- package/lib/commonjs/core/createUnistylesComponent.js.map +1 -0
- package/lib/commonjs/core/createUnistylesComponent.native.js +45 -0
- package/lib/commonjs/core/createUnistylesComponent.native.js.map +2 -0
- package/lib/commonjs/core/index.js +7 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/core/useBreakpoint.js.map +1 -1
- package/lib/commonjs/core/useBreakpoint.native.js.map +2 -1
- package/lib/commonjs/core/useTheme.js.map +2 -1
- package/lib/commonjs/core/useTheme.native.js.map +2 -1
- package/lib/commonjs/global.js +3 -0
- package/lib/commonjs/index.js +8 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mq.js +1 -4
- package/lib/commonjs/mq.js.map +2 -1
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js +5 -4
- package/lib/commonjs/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/commonjs/specs/NativePlatform/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/types.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js.map +2 -1
- package/lib/commonjs/specs/TurboUnistyles/index.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -2
- package/lib/commonjs/specs/index.web.js.map +1 -2
- package/lib/commonjs/specs/types.js +10 -10
- package/lib/commonjs/specs/types.js.map +2 -1
- package/lib/commonjs/types/accessibility.js +9 -9
- package/lib/commonjs/types/accessibility.js.map +1 -1
- package/lib/commonjs/types/common.js +3 -0
- package/lib/commonjs/types/core.js.map +1 -1
- package/lib/commonjs/types/index.js.map +2 -1
- package/lib/commonjs/types/stylesheet.js +1 -2
- package/lib/commonjs/web/convert/index.js +1 -7
- package/lib/commonjs/web/convert/index.js.map +2 -1
- package/lib/commonjs/web/convert/pseudo.js.map +2 -1
- package/lib/commonjs/web/convert/shadow.js.map +2 -1
- package/lib/commonjs/web/convert/style.js.map +2 -1
- package/lib/commonjs/web/convert/textShadow.js +1 -4
- package/lib/commonjs/web/convert/textShadow.js.map +2 -1
- package/lib/commonjs/web/convert/transform.js.map +2 -1
- package/lib/commonjs/web/convert/utils.js +1 -2
- package/lib/commonjs/web/convert/utils.js.map +2 -1
- package/lib/commonjs/web/index.js.map +2 -1
- package/lib/commonjs/web/listener.js.map +2 -1
- package/lib/commonjs/web/mock.js.map +2 -1
- package/lib/commonjs/web/mq.js.map +1 -1
- package/lib/commonjs/web/registry.js +1 -3
- package/lib/commonjs/web/registry.js.map +2 -1
- package/lib/commonjs/web/runtime.js.map +2 -1
- package/lib/commonjs/web/shadowRegistry.js +1 -9
- package/lib/commonjs/web/shadowRegistry.js.map +2 -1
- package/lib/commonjs/web/state.js +1 -5
- package/lib/commonjs/web/state.js.map +2 -1
- package/lib/commonjs/web/utils/common.js +1 -3
- package/lib/commonjs/web/utils/common.js.map +2 -1
- package/lib/commonjs/web/utils/index.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js.map +2 -1
- package/lib/commonjs/web/variants/index.js.map +1 -1
- package/lib/commonjs/web/variants/useVariants.js +1 -2
- package/lib/commonjs/web/variants/useVariants.js.map +2 -1
- package/lib/module/core/createUnistylesComponent.js +11 -0
- package/lib/module/core/createUnistylesComponent.js.map +2 -0
- package/lib/module/core/createUnistylesComponent.native.js +39 -0
- package/lib/module/core/createUnistylesComponent.native.js.map +1 -0
- package/lib/module/core/index.js +1 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/core/useBreakpoint.js.map +1 -1
- package/lib/module/core/useBreakpoint.native.js.map +2 -1
- package/lib/module/core/useTheme.js.map +2 -1
- package/lib/module/core/useTheme.native.js.map +2 -1
- package/lib/module/global.js +1 -1
- package/lib/module/global.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mq.js +1 -4
- package/lib/module/mq.js.map +2 -1
- package/lib/module/specs/NativePlatform/NativePlatform.nitro.js.map +1 -1
- package/lib/module/specs/NativePlatform/index.js.map +1 -1
- package/lib/module/specs/NavigtionBar/index.js.map +2 -1
- package/lib/module/specs/ShadowRegistry/ShadowRegistry.nitro.js.map +1 -2
- package/lib/module/specs/ShadowRegistry/index.js.map +2 -1
- package/lib/module/specs/ShadowRegistry/types.js.map +2 -1
- package/lib/module/specs/StatusBar/UnistylesStatusBar.nitro.js.map +1 -2
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js +1 -1
- package/lib/module/specs/StyleSheet/UnistylesStyleSheet.nitro.js.map +0 -1
- package/lib/module/specs/StyleSheet/index.js.map +2 -1
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js +3 -2
- package/lib/module/specs/TurboUnistyles/NativeTurboUnistyles.js.map +2 -1
- package/lib/module/specs/UnistylesRuntime/UnistylesRuntime.nitro.js.map +2 -1
- package/lib/module/specs/index.js.map +1 -2
- package/lib/module/specs/types.js.map +1 -2
- package/lib/module/types/accessibility.js +1 -1
- package/lib/module/types/accessibility.js.map +1 -0
- package/lib/module/types/breakpoints.js.map +1 -0
- package/lib/module/types/common.js +1 -1
- package/lib/module/types/common.js.map +1 -0
- package/lib/module/types/core.js.map +1 -1
- package/lib/module/types/index.js.map +2 -1
- package/lib/module/types/variants.js.map +1 -0
- package/lib/module/web/convert/index.js.map +2 -1
- package/lib/module/web/convert/pseudo.js.map +2 -1
- package/lib/module/web/convert/shadow.js +1 -5
- package/lib/module/web/convert/utils.js +1 -2
- package/lib/module/web/index.js +1 -2
- package/lib/module/web/index.js.map +2 -1
- package/lib/module/web/listener.js.map +2 -1
- package/lib/module/web/mock.js.map +2 -1
- package/lib/module/web/state.js +1 -5
- package/lib/module/web/state.js.map +2 -1
- package/lib/module/web/variants/getVariants.js.map +2 -1
- package/lib/module/web/variants/index.js.map +1 -1
- package/lib/module/web/variants/useVariants.js +1 -2
- package/lib/module/web/variants/useVariants.js.map +2 -1
- package/lib/typescript/src/core/createUnistylesComponent.d.ts +6 -0
- package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -0
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +6 -0
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +1 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +1 -1
- package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +3 -3
- package/nitrogen/generated/android/unistyles+autolinking.cmake +13 -1
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +4 -10
- package/package.json +3 -3
- package/src/common.js +4 -0
- package/src/core/createUnistylesComponent.js +6 -0
- package/src/core/createUnistylesComponent.native.js +31 -0
- package/src/core/createUnistylesComponent.native.tsx +44 -0
- package/src/core/createUnistylesComponent.tsx +10 -0
- package/src/core/index.js +3 -0
- package/src/core/index.ts +1 -0
- package/src/core/useBreakpoint.js +14 -0
- package/src/core/useBreakpoint.native.js +16 -0
- package/src/core/useTheme.js +14 -0
- package/src/core/useTheme.native.js +16 -0
- package/src/global.js +1 -0
- package/src/index.js +3 -0
- package/src/index.ts +1 -1
- package/src/mq.js +38 -0
- package/src/specs/NativePlatform/NativePlatform.nitro.js +1 -0
- package/src/types/accessibility.js +30 -0
- package/src/types/breakpoints.js +1 -0
- package/src/types/common.js +1 -0
- package/src/types/core.js +1 -0
- package/src/types/index.js +1 -0
- package/src/types/stylesheet.js +2 -0
- package/src/types/variants.js +1 -0
- package/src/web/convert/boxShadow.js +59 -0
- package/src/web/convert/index.js +56 -0
- package/src/web/convert/pseudo.js +131 -0
- package/src/web/convert/shadow.js +50 -0
- package/src/web/convert/style.js +137 -0
- package/src/web/convert/textShadow.js +56 -0
- package/src/web/convert/transform.js +65 -0
- package/src/web/convert/types.js +2 -0
- package/src/web/convert/utils.js +39 -0
- package/src/web/create.js +36 -0
- package/src/web/index.js +22 -0
- package/src/web/listener.js +26 -0
- package/src/web/mock.js +21 -0
- package/src/web/mq.js +14 -0
- package/src/web/registry.js +165 -0
- package/src/web/runtime.js +160 -0
- package/src/web/shadowRegistry.js +96 -0
- package/src/web/state.js +68 -0
- package/src/web/utils/common.js +79 -0
- package/src/web/utils/index.js +2 -0
- package/src/web/utils/unistyle.js +72 -0
- package/src/web/variants/getVariants.js +26 -0
- package/src/web/variants/index.js +2 -0
- package/src/web/variants/useVariants.js +50 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["processColor","StatusBar","NativeStatusBar","StatusBarStyle","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","Light","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.
|
1
|
+
{"version":3,"names":["processColor","StatusBar","NativeStatusBar","StatusBarStyle","attachStatusBarJSMethods","hybridObject","setStyle","style","animated","Light","setBarStyle","Dark","Default","privateHybrid","_setHidden","setHidden","isHidden","animation","_setBackgroundColor","setBackgroundColor","color","parsedColor"],"sourceRoot":"../../../../src","sources":["specs/StatusBar/index.js"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,SAAS,IAAIC,eAAe,QAAQ,cAAc;AACzE,SAASC,cAAc,QAAQ,UAAU;AACzC,OAAO,MAAMC,wBAAwB,GAAIC,YAAY,IAAK;EACtDA,YAAY,CAACC,QAAQ,GAAG,CAACC,KAAK,EAAEC,QAAQ,KAAK;IACzC,QAAQD,KAAK;MACT,KAAKJ,cAAc,CAACM,KAAK;QACrB,OAAOP,eAAe,CAACQ,WAAW,CAAC,eAAe,EAAEF,QAAQ,CAAC;MACjE,KAAKL,cAAc,CAACQ,IAAI;QACpB,OAAOT,eAAe,CAACQ,WAAW,CAAC,cAAc,EAAEF,QAAQ,CAAC;MAChE,KAAKL,cAAc,CAACS,OAAO;QACvB,OAAOV,eAAe,CAACQ,WAAW,CAAC,SAAS,EAAEF,QAAQ,CAAC;IAC/D;EACJ,CAAC;EACD,MAAMK,aAAa,GAAGR,YAAY;EAClCQ,aAAa,CAACC,UAAU,GAAGT,YAAY,CAACU,SAAS;EACjDV,YAAY,CAACU,SAAS,GAAG,CAACC,QAAQ,EAAEC,SAAS,KAAK;IAC9Cf,eAAe,CAACa,SAAS,CAACC,QAAQ,EAAEC,SAAS,CAAC;IAC9CJ,aAAa,CAACC,UAAU,CAACE,QAAQ,CAAC;EACtC,CAAC;EACDH,aAAa,CAACK,mBAAmB,GAAGb,YAAY,CAACc,kBAAkB;EACnEd,YAAY,CAACc,kBAAkB,GAAIC,KAAK,IAAK;IACzC,MAAMC,WAAW,GAAGrB,YAAY,CAACoB,KAAK,CAAC,IAAI,CAAC;IAC5CP,aAAa,CAACK,mBAAmB,CAACG,WAAW,CAAC;EAClD,CAAC;AACL,CAAC","ignoreList":[]}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods","init"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.
|
1
|
+
{"version":3,"names":["NitroModules","processColor","StyleSheet","NativeStyleSheet","HybridUnistylesStyleSheet","createHybridObject","absoluteFillObject","absoluteFill","flatten","compose","jsMethods","init"],"sourceRoot":"../../../../src","sources":["specs/StyleSheet/index.js"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4BAA4B;AACzD,SAASC,YAAY,EAAEC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AAC3E,MAAMC,yBAAyB,GAAGJ,YAAY,CACzCK,kBAAkB,CAAC,qBAAqB,CAAC;AAC9CD,yBAAyB,CAACE,kBAAkB,GAAGH,gBAAgB,CAACG,kBAAkB;AAClFF,yBAAyB,CAACG,YAAY,GAAGJ,gBAAgB,CAACI,YAAY;AACtEH,yBAAyB,CAACI,OAAO,GAAGL,gBAAgB,CAACK,OAAO;AAC5DJ,yBAAyB,CAACK,OAAO,GAAGN,gBAAgB,CAACM,OAAO;AAC5DL,yBAAyB,CAACM,SAAS,GAAG;EAClCT;AACJ,CAAC;AACDG,yBAAyB,CAACO,IAAI,CAAC,CAAC;AAChC,OAAO,MAAMT,UAAU,GAAGE,yBAAyB","ignoreList":[]}
|
2
|
+
}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
import { TurboModuleRegistry } from 'react-native';
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
// this is empty spec for TurboModule that is required to hook
|
6
|
+
// Unistyles to Fabric
|
6
7
|
|
7
8
|
TurboModuleRegistry.get('Unistyles');
|
8
9
|
//# sourceMappingURL=NativeTurboUnistyles.js.map
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/TurboUnistyles/NativeTurboUnistyles.
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../../../src","sources":["specs/TurboUnistyles/NativeTurboUnistyles.js"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,cAAc;AAClDA,mBAAmB,CAACC,GAAG,CAAC,WAAW,CAAC","ignoreList":[]}
|
2
|
+
reList":[]}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/UnistylesRuntime.nitro.
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["specs/UnistylesRuntime/UnistylesRuntime.nitro.ts"],"mappings":"","ignoreList":[]}
|
2
|
+
":[]}
|
@@ -1,2 +1 @@
|
|
1
|
-
{"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistyleDependency","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.
|
2
|
-
}
|
1
|
+
{"version":3,"names":["Runtime","StyleSheet","UnistylesShadowRegistry","StatusBarStyle","ColorScheme","Orientation","UnistyleDependency","UnistylesRuntime"],"sourceRoot":"../../../src","sources":["specs/index.ts"],"mappings":";;AAAA,OAAO,kBAAkB;AAEzB,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,uBAAuB,QAAQ,kBAAkB;AAE1D,SAASC,cAAc,EAAEC,WAAW,EAAEC,WAAW,QAAQ,SAAS;AAClE,SAASC,kBAAkB,QAAQ,kBAAkB;AAErD,SACIH,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,kBAAkB;AAGtB,SACIJ,uBAAuB,EACvBF,OAAO,IAAIO,gBAAgB,EAC3BN,UAAU","ignoreList":[]}
|
@@ -1,2 +1 @@
|
|
1
|
-
{"version":3,"names":["ColorScheme","Orientation","StatusBarStyle"],"sourceRoot":"../../../src","sources":["specs/types.
|
2
|
-
WAAW,EAAE;EACpBA,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;EACpCA,WAAW,CAAC,WAAW,CAAC,GAAG,WAAW;AAC1C,CAAC,EAAEA,WAAW,KAAKA,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;AACrC,OAAO,IAAIC,cAAc;AACzB,CAAC,UAAUA,cAAc,EAAE;EACvBA,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS;EACrCA,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO;EACjCA,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM;AACnC,CAAC,EAAEA,cAAc,KAAKA,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["ColorScheme","Orientation","StatusBarStyle"],"sourceRoot":"../../../src","sources":["specs/types.js"],"mappings":";;AAAA,OAAO,IAAIA,WAAW;AACtB,CAAC,UAAUA,WAAW,EAAE;EACpBA,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO;EAC9BA,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;EAC5BA,WAAW,CAAC,aAAa,CAAC,GAAG,aAAa;AAC9C,CAAC,EAAEA,WAAW,KAAKA,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;AACrC,OAAO,IAAIC,WAAW;AACtB,CAAC,UAAUA,WAAW,EAAE;EACpBA,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;EACpCA,WAAW,CAAC,WAAW,CAAC,GAAG,WAAW;AAC1C,CAAC,EAAEA,WAAW,KAAKA,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC;AACrC,OAAO,IAAIC,cAAc;AACzB,CAAC,UAAUA,cAAc,EAAE;EACvBA,cAAc,CAAC,SAAS,CAAC,GAAG,SAAS;EACrCA,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO;EACjCA,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM;AACnC,CAAC,EAAEA,cAAc,KAAKA,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
@@ -30,4 +30,4 @@ export let WebContentSizeCategory = /*#__PURE__*/function (WebContentSizeCategor
|
|
30
30
|
WebContentSizeCategory["Unspecified"] = "web-unspecified";
|
31
31
|
return WebContentSizeCategory;
|
32
32
|
}({});
|
33
|
-
//# sourceMappingURL=accessibility.js.map
|
33
|
+
//# sourceMappingURL=accessibility.js.mappingURL=accessibility.js.map
|
@@ -1 +1,2 @@
|
|
1
1
|
{"version":3,"names":["IOSContentSizeCategory","AndroidContentSizeCategory","WebContentSizeCategory"],"sourceRoot":"../../../src","sources":["types/accessibility.ts"],"mappings":";;AAAA,WAAYA,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;AAgBlC,WAAYC,0BAA0B,0BAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAA1BA,0BAA0B;EAAA,OAA1BA,0BAA0B;AAAA;AAUtC,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA","ignoreList":[]}
|
2
|
+
AAO,CAAC,GAAG,OAAO;EACzCA,sBAAsB,CAAC,YAAY,CAAC,GAAG,QAAQ;EAC/CA,sBAAsB,CAAC,aAAa,CAAC,GAAG,aAAa;AACzD,CAAC,EAAEA,sBAAsB,KAAKA,sBAAsB,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3D,OAAO,IAAIC,0BAA0B;AACrC,CAAC,UAAUA,0BAA0B,EAAE;EACnCA,0BAA0B,CAAC,OAAO,CAAC,GAAG,OAAO;EAC7CA,0BAA0B,CAAC,SAAS,CAAC,GAAG,SAAS;EACjDA,0BAA0B,CAAC,OAAO,CAAC,GAAG,OAAO;EAC7CA,0BAA0B,CAAC,YAAY,CAAC,GAAG,YAAY;EACvDA,0BAA0B,CAAC,MAAM,CAAC,GAAG,MAAM;EAC3CA,0BAA0B,CAAC,WAAW,CAAC,GAAG,WAAW;EACrDA,0BAA0B,CAAC,gBAAgB,CAAC,GAAG,gBAAgB;AACnE,CAAC,EAAEA,0BAA0B,KAAKA,0BAA0B,GAAG,CAAC,CAAC,CAAC,CAAC;AACnE,OAAO,IAAIC,sBAAsB;AACjC,CAAC,UAAUA,sBAAsB,EAAE;EAC/BA,sBAAsB,CAAC,aAAa,CAAC,GAAG,iBAAiB;AAC7D,CAAC,EAAEA,sBAAsB,KAAKA,sBAAsB,GAAG,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
"use strict";
|
2
|
-
//# sourceMappingURL=common.js.map
|
2
|
+
//# sourceMappingURL=common.js.mapommon.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/core.
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/core.js"],"mappings":";;AAAA","ignoreList":[]}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["AndroidContentSizeCategory","IOSContentSizeCategory","WebContentSizeCategory"],"sourceRoot":"../../../src","sources":["types/index.
|
1
|
+
{"version":3,"names":["AndroidContentSizeCategory","IOSContentSizeCategory","WebContentSizeCategory"],"sourceRoot":"../../../src","sources":["types/index.js"],"mappings":";;AAAA,SAASA,0BAA0B,EAAEC,sBAAsB,EAAEC,sBAAsB,QAAQ,iBAAiB","ignoreList":[]}
|
2
|
+
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["isPseudo","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertUnistyles","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","flattenValues","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.
|
1
|
+
{"version":3,"names":["isPseudo","getStyle","deepMergeObjects","getTransformStyle","isBoxShadow","isTextShadow","isTransform","getTextShadowStyle","getBoxShadowStyle","convertUnistyles","value","hasTextShadow","hasBoxShadow","stylesArray","Object","entries","_web","flatMap","unistylesKey","unistylesValue","includes","startsWith","flattenValues","map","breakpointKey","breakpointValue"],"sourceRoot":"../../../../src","sources":["web/convert/index.js"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,UAAU;AACnC,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;AAC/C,OAAO,MAAMC,gBAAgB,GAAIC,KAAK,IAAK;EACvC;EACA,IAAIC,aAAa,GAAG,KAAK;EACzB;EACA,IAAIC,YAAY,GAAG,KAAK;EACxB,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,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAACC,QAAQ,CAACF,YAAY,CAAC,IAAIA,YAAY,CAACG,UAAU,CAAC,UAAU,CAAC,EAAE;MACrK,OAAO,EAAE;IACb;IACA;IACA,IAAIrB,QAAQ,CAACkB,YAAY,CAAC,EAAE;MACxB,MAAMI,aAAa,GAAGb,gBAAgB,CAACU,cAAc,CAAC;MACtD,OAAO;QAAE,CAACD,YAAY,GAAGI;MAAc,CAAC;IAC5C;IACA;IACA,IAAIjB,YAAY,CAACa,YAAY,CAAC,EAAE;MAC5B,IAAIP,aAAa,EAAE;QACf,OAAO,EAAE;MACb;MACAA,aAAa,GAAG,IAAI;MACpB,OAAOJ,kBAAkB,CAACG,KAAK,CAAC;IACpC;IACA;IACA,IAAIN,WAAW,CAACc,YAAY,CAAC,EAAE;MAC3B,IAAIN,YAAY,EAAE;QACd,OAAO,EAAE;MACb;MACAA,YAAY,GAAG,IAAI;MACnB,OAAOJ,iBAAiB,CAACE,KAAK,CAAC;IACnC;IACA;IACA,IAAIJ,WAAW,CAACY,YAAY,EAAEC,cAAc,CAAC,EAAE;MAC3C,OAAOhB,iBAAiB,CAACgB,cAAc,CAAC;IAC5C;IACA;IACA,IAAI,OAAOA,cAAc,KAAK,QAAQ,IAAIA,cAAc,KAAK,IAAI,EAAE;MAC/D,OAAOL,MAAM,CAACC,OAAO,CAACI,cAAc,CAAC,CAACI,GAAG,CAAC,CAAC,CAACC,aAAa,EAAEC,eAAe,CAAC,KAAK;QAC5E,OAAO;UAAE,CAACD,aAAa,GAAGvB,QAAQ,CAACiB,YAAY,EAAEO,eAAe;QAAE,CAAC;MACvE,CAAC,CAAC;IACN;IACA;IACA,OAAOxB,QAAQ,CAACiB,YAAY,EAAEC,cAAc,CAAC;EACjD,CAAC,CAAC;EACF,OAAOjB,gBAAgB,CAAC,GAAGW,WAAW,CAAC;AAC3C,CAAC","ignoreList":[]}
|
2
|
+
List":[]}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["pseudos","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../../src","sources":["web/convert/pseudo.
|
1
|
+
{"version":3,"names":["pseudos","isPseudo","selector","some","pseudo","startsWith"],"sourceRoot":"../../../../src","sources":["web/convert/pseudo.js"],"mappings":";;AAAA,OAAO,MAAMA,OAAO,GAAG,CACnB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,QAAQ,EACR,aAAa,EACb,eAAe,EACf,OAAO,EACP,OAAO,EACP,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,eAAe,EACf,WAAW,EACX,eAAe,EACf,OAAO,EACP,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,4BAA4B,EAC5B,8BAA8B,EAC9B,qCAAqC,EACrC,8BAA8B,EAC9B,8BAA8B,EAC9B,iCAAiC,EACjC,uBAAuB,EACvB,iCAAiC,EACjC,yBAAyB,EACzB,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,EAChC,gCAAgC,EAChC,uBAAuB,EACvB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,CACzB;AACD,OAAO,MAAMC,QAAQ,GAAIC,QAAQ,IAAKF,OAAO,CAACG,IAAI,CAACC,MAAM,IAAIF,QAAQ,CAACG,UAAU,CAACD,MAAM,CAAC,CAAC","ignoreList":[]}
|
2
|
+
|
@@ -12,23 +12,19 @@ export const validateShadow = (shadowProperties, styles, breakpoints) => {
|
|
12
12
|
width,
|
13
13
|
height
|
14
14
|
} = value;
|
15
|
-
|
16
15
|
// If shadowOffset.width has breakpoints
|
17
16
|
if (typeof width === 'object') {
|
18
17
|
Object.keys(width).forEach(breakpoint => breakpoints.add(breakpoint));
|
19
18
|
}
|
20
|
-
|
21
19
|
// If shadowOffset.height has breakpoints
|
22
20
|
if (typeof height === 'object') {
|
23
21
|
Object.keys(height).forEach(breakpoint => breakpoints.add(breakpoint));
|
24
22
|
}
|
25
23
|
return;
|
26
24
|
}
|
27
|
-
|
28
25
|
// Collect regular breakpoints
|
29
26
|
Object.keys(value).forEach(breakpoint => breakpoints.add(breakpoint));
|
30
27
|
});
|
31
|
-
|
32
28
|
// Validate if all breakpoints are present
|
33
29
|
shadowProperties.forEach(key => {
|
34
30
|
const value = styles[key];
|
@@ -60,4 +56,4 @@ export const validateShadow = (shadowProperties, styles, breakpoints) => {
|
|
60
56
|
}
|
61
57
|
});
|
62
58
|
};
|
63
|
-
//# sourceMappingURL=shadow.js.map
|
59
|
+
//# sourceMappingURL=shadow.js.map.map
|
@@ -14,7 +14,6 @@ export const normalizeColor = (color, opacity = 1) => {
|
|
14
14
|
return color;
|
15
15
|
}
|
16
16
|
const integer = normalizeColors(color);
|
17
|
-
|
18
17
|
// If the color is an unknown format, the return value is null
|
19
18
|
if (integer === null) {
|
20
19
|
return color;
|
@@ -40,4 +39,4 @@ export const extractShadowValue = (key, breakpoint, styles) => {
|
|
40
39
|
}
|
41
40
|
return typeof value === 'object' ? value[breakpoint] : value;
|
42
41
|
};
|
43
|
-
//# sourceMappingURL=utils.js.
|
42
|
+
//# sourceMappingURL=utils.js.mapp
|
package/lib/module/web/index.js
CHANGED
@@ -20,7 +20,6 @@ export const StyleSheet = {
|
|
20
20
|
export { UnistylesRuntime } from './runtime';
|
21
21
|
export { UnistylesShadowRegistry } from './shadowRegistry';
|
22
22
|
export * from './mock';
|
23
|
-
|
24
23
|
// TODO: Work on SSR
|
25
24
|
export const getSSRUnistyles = () => [];
|
26
|
-
//# sourceMappingURL=index.js.
|
25
|
+
//# sourceMappingURL=index.js.mapp
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["create","UnistylesState","deepMergeObjects","StyleSheet","configure","init","absoluteFill","position","left","top","right","bottom","compose","a","b","flatten","styles","hairlineWidth","UnistylesRuntime","UnistylesShadowRegistry","getSSRUnistyles"],"sourceRoot":"../../../src","sources":["web/index.
|
1
|
+
{"version":3,"names":["create","UnistylesState","deepMergeObjects","StyleSheet","configure","init","absoluteFill","position","left","top","right","bottom","compose","a","b","flatten","styles","hairlineWidth","UnistylesRuntime","UnistylesShadowRegistry","getSSRUnistyles"],"sourceRoot":"../../../src","sources":["web/index.js"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,UAAU;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,OAAO,MAAMC,UAAU,GAAG;EACtBC,SAAS,EAAEH,cAAc,CAACI,IAAI;EAC9BL,MAAM;EACNM,YAAY,EAAE;IACVC,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACZ,CAAC;EACDC,OAAO,EAAEA,CAACC,CAAC,EAAEC,CAAC,KAAKZ,gBAAgB,CAACW,CAAC,EAAEC,CAAC,CAAC;EACzCC,OAAO,EAAEA,CAAC,GAAGC,MAAM,KAAKd,gBAAgB,CAAC,GAAGc,MAAM,CAAC;EACnDC,aAAa,EAAE;AACnB,CAAC;AACD,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,uBAAuB,QAAQ,kBAAkB;AAC1D,cAAc,QAAQ;AACtB;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM,EAAE","ignoreList":[]}
|
2
|
+
}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","UnistylesListener"],"sourceRoot":"../../../src","sources":["web/listener.
|
1
|
+
{"version":3,"names":["UnistyleDependency","UnistylesRuntime","UnistylesListenerBuilder","isInitialized","listeners","Array","from","length","Object","keys","Set","emitChange","dependency","forEach","listener","initListeners","darkMedia","addEventListener","ColorScheme","lightMedia","window","Orientation","Dimensions","addListeners","dependencies","add","delete","UnistylesListener"],"sourceRoot":"../../../src","sources":["web/listener.js"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,MAAMC,wBAAwB,CAAC;EAC3BC,aAAa,GAAG,KAAK;EACrBC,SAAS,GAAGC,KAAK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ACL,CAAC;AACL;AACA,OAAO,MAAMa,iBAAiB,GAAG,IAAIzB,wBAAwB,CAAC,CAAC","ignoreList":[]}
|
2
|
+
]}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["StatusBar","width","height","setStyle","setHidden","setBackgroundColor","equals","toString","__type","name","NavigationBar"],"sourceRoot":"../../../src","sources":["web/mock.
|
1
|
+
{"version":3,"names":["StatusBar","width","height","setStyle","setHidden","setBackgroundColor","equals","toString","__type","name","NavigationBar"],"sourceRoot":"../../../src","sources":["web/mock.js"],"mappings":";;AAAA,OAAO,MAAMA,SAAS,GAAG;EACrBC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,QAAQ,EAAEA,CAAA,KAAM,CAAE,CAAC;EACnBC,SAAS,EAAEA,CAAA,KAAM,CAAE,CAAC;EACpBC,kBAAkB,EAAEA,CAAA,KAAM,CAAE,CAAC;EAC7BC,MAAM,EAAEA,CAAA,KAAM,IAAI;EAClBC,QAAQ,EAAEA,CAAA,KAAM,WAAW;EAC3BC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE;AACV,CAAC;AACD,OAAO,MAAMC,aAAa,GAAG;EACzBT,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTE,SAAS,EAAEA,CAAA,KAAM,CAAE,CAAC;EACpBC,kBAAkB,EAAEA,CAAA,KAAM,CAAE,CAAC;EAC7BC,MAAM,EAAEA,CAAA,KAAM,IAAI;EAClBC,QAAQ,EAAEA,CAAA,KAAM,eAAe;EAC/BC,MAAM,EAAE,KAAK;EACbC,IAAI,EAAE;AACV,CAAC","ignoreList":[]}
|
2
|
+
}
|
package/lib/module/web/state.js
CHANGED
@@ -29,24 +29,20 @@ class UnistylesStateBuilder {
|
|
29
29
|
initSettings = settings => {
|
30
30
|
this.hasAdaptiveThemes = settings?.adaptiveThemes ?? false;
|
31
31
|
const themeNames = Array.from(this.themes.keys());
|
32
|
-
|
33
32
|
// Single theme + no settings
|
34
33
|
if (!settings?.adaptiveThemes && !settings?.initialTheme && themeNames.length === 1) {
|
35
34
|
this.themeName = themeNames[0];
|
36
35
|
return;
|
37
36
|
}
|
38
|
-
|
39
37
|
// No settings
|
40
38
|
if (!settings?.adaptiveThemes && !settings?.initialTheme) {
|
41
39
|
throw new Error('🦄 You need to specify either "initialTheme" or "adaptiveThemes" in your config');
|
42
40
|
}
|
43
|
-
|
44
41
|
// Adaptive themes
|
45
42
|
if (settings.adaptiveThemes) {
|
46
43
|
this.themeName = schemeToTheme(UnistylesRuntime.colorScheme);
|
47
44
|
return;
|
48
45
|
}
|
49
|
-
|
50
46
|
// Initial theme
|
51
47
|
this.themeName = typeof settings.initialTheme === 'function' ? settings.initialTheme() : settings.initialTheme;
|
52
48
|
};
|
@@ -66,4 +62,4 @@ class UnistylesStateBuilder {
|
|
66
62
|
};
|
67
63
|
}
|
68
64
|
export const UnistylesState = new UnistylesStateBuilder();
|
69
|
-
//# sourceMappingURL=state.js.map
|
65
|
+
//# sourceMappingURL=state.js.map.map
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["UnistylesRuntime","isServer","schemeToTheme","UnistylesListener","UnistyleDependency","UnistylesStateBuilder","themes","Map","matchingBreakpoints","breakpoint","currentBreakpoint","Array","from","reverse","find","_key","value","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","keys","initialTheme","length","Error","colorScheme","sort","a","b","mediaQuery","window","matchMedia","matches","addEventListener","event","emitChange","Breakpoints","UnistylesState"],"sourceRoot":"../../../src","sources":["web/state.
|
1
|
+
{"version":3,"names":["UnistylesRuntime","isServer","schemeToTheme","UnistylesListener","UnistyleDependency","UnistylesStateBuilder","themes","Map","matchingBreakpoints","breakpoint","currentBreakpoint","Array","from","reverse","find","_key","value","hasAdaptiveThemes","init","config","initThemes","initBreakpoints","breakpoints","initSettings","settings","initListeners","Object","entries","forEach","themeName","theme","set","adaptiveThemes","themeNames","keys","initialTheme","length","Error","colorScheme","sort","a","b","mediaQuery","window","matchMedia","matches","addEventListener","event","emitChange","Breakpoints","UnistylesState"],"sourceRoot":"../../../src","sources":["web/state.js"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,QAAQ,EAAEC,aAAa,QAAQ,SAAS;AACjD,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,MAAMC,qBAAqB,CAAC;EACxBC,MAAM,GAAG,IAAIC,GAAG,CAAC,CAAC;EAElBC,mBAAmB,GAAG,IAAID,GAAG,CAAC,CAAC;EAC/B,IAAIE,UAAUA,CAAA,EAAG;IACb,MAAM,CAACC,iBAAiB,CAAC,GAAGC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACJ,mBAAmB,CAAC,CAC3DK,OAAO,CAAC,CAAC,CACTC,IAAI,CAAC,CAAC,CAACC,IAAI,EAAEC,KAAK,CAAC,KAAKA,KAAK,CAAC,IAAI,EAAE;IACzC,OAAON,iBAAiB;EAC5B;EAEAO,iBAAiB,GAAG,KAAK;EACzBC,IAAI,GAAIC,MAAM,IAAK;IACf,IAAI,CAACC,UAAU,CAACD,MAAM,CAACb,MAAM,CAAC;IAC9B,IAAI,CAACe,eAAe,CAACF,MAAM,CAACG,WAAW,CAAC;IACxC,IAAI,CAACC,YAAY,CAACJ,MAAM,CAACK,QAAQ,CAAC;IAClC,IAAIvB,QAAQ,CAAC,CAAC,EAAE;MACZ;IACJ;IACAE,iBAAiB,CAACsB,aAAa,CAAC,CAAC;EACrC,CAAC;EACDL,UAAU,GAAGA,CAACd,MAAM,GAAG,CAAC,CAAC,KAAK;IAC1BoB,MAAM,CAACC,OAAO,CAACrB,MAAM,CAAC,CAACsB,OAAO,CAAC,CAAC,CAACC,SAAS,EAAEC,KAAK,CAAC,KAAK;MACnD,IAAI,CAACxB,MAAM,CAACyB,GAAG,CAACF,SAAS,EAAEC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AM,CAACC,UAAU,CAAC,eAAe5B,KAAK,KAAK,CAAC;MAC/D,IAAI,CAACR,mBAAmB,CAACuB,GAAG,CAACtB,UAAU,EAAEiC,UAAU,CAACG,OAAO,CAAC;MAC5DH,UAAU,CAACI,gBAAgB,CAAC,QAAQ,EAAEC,KAAK,IAAI;QAC3C,IAAI,CAACvC,mBAAmB,CAACuB,GAAG,CAACtB,UAAU,EAAEsC,KAAK,CAACF,OAAO,CAAC;QACvD1C,iBAAiB,CAAC6C,UAAU,CAAC5C,kBAAkB,CAAC6C,WAAW,CAAC;MAChE,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC;AACL;AACA,OAAO,MAAMC,cAAc,GAAG,IAAI7C,qBAAqB,CAAC,CAAC","ignoreList":[]}
|
2
|
+
noreList":[]}
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["deepMergeObjects","hasVariants","value","getVariants","styles","selectedVariants","Object","entries","filter","_key","variants","keys","some","variant","map","key","compoundVariants","variantStyles","flatMap","selectedVariant","selectedVariantStyles","compoundVariantStyles","compoundVariant","conditions","String","mergedVariantStyles"],"sourceRoot":"../../../../src","sources":["web/variants/getVariants.
|
1
|
+
{"version":3,"names":["deepMergeObjects","hasVariants","value","getVariants","styles","selectedVariants","Object","entries","filter","_key","variants","keys","some","variant","map","key","compoundVariants","variantStyles","flatMap","selectedVariant","selectedVariantStyles","compoundVariantStyles","compoundVariant","conditions","String","mergedVariantStyles"],"sourceRoot":"../../../../src","sources":["web/variants/getVariants.js"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,UAAU;AAC3C,MAAMC,WAAW,GAAIC,KAAK,IAAK,UAAU,IAAIA,KAAK,CAAC,CAAC,CAAC;AACrD,OAAO,MAAMC,WAAW,GAAGA,CAACC,MAAM,EAAEC,gBAAgB,KAAK;EACrD,OAAOC,MAAM,CAACC,OAAO,CAACH,MAAM,CAAC,CACxBI,MAAM,CAACP,WAAW,CAAC,CACnBO,MAAM,CAAC,CAAC,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-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["web/variants/index.
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["web/variants/index.js"],"mappings":";;AAAA,cAAc,eAAe;AAC7B,cAAc,eAAe","ignoreList":[]}
|
@@ -31,7 +31,6 @@ export const createUseVariants = (styles, setSelectedVariants) => {
|
|
31
31
|
enumerable: false,
|
32
32
|
configurable: true
|
33
33
|
})));
|
34
|
-
|
35
34
|
// Add __uni__variants to static styles
|
36
35
|
Object.keys(styleEntry).forEach(key => {
|
37
36
|
if (!key.startsWith('__uni__secrets__')) {
|
@@ -51,4 +50,4 @@ export const createUseVariants = (styles, setSelectedVariants) => {
|
|
51
50
|
value: useVariants
|
52
51
|
});
|
53
52
|
};
|
54
|
-
//# sourceMappingURL=useVariants.js.
|
53
|
+
//# sourceMappingURL=useVariants.js.mapp
|
@@ -1 +1,2 @@
|
|
1
|
-
{"version":3,"names":["useMemo","useRef","useState","equal","keyInObject","reduceObject","getVariants","createUseVariants","styles","setSelectedVariants","useVariants","selectedVariants","selectedVariantStylesMap","Map","lastSelectedVariantsRef","variantsChanged","current","combinedVariantStyles","result","forEach","key","value","set","styleEntry","selectedVariantStyles","get","Object","defineProperties","enumerable","configurable","keys","startsWith","secret","undefined","defineProperty"],"sourceRoot":"../../../../src","sources":["web/variants/useVariants.
|
1
|
+
{"version":3,"names":["useMemo","useRef","useState","equal","keyInObject","reduceObject","getVariants","createUseVariants","styles","setSelectedVariants","useVariants","selectedVariants","selectedVariantStylesMap","Map","lastSelectedVariantsRef","variantsChanged","current","combinedVariantStyles","result","forEach","key","value","set","styleEntry","selectedVariantStyles","get","Object","defineProperties","enumerable","configurable","keys","startsWith","secret","undefined","defineProperty"],"sourceRoot":"../../../../src","sources":["web/variants/useVariants.js"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACjD,SAASC,KAAK,EAAEC,WAAW,EAAEC,YAAY,QAAQ,UA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,CAAC,CAAC,CAAC;MACJ;MACAH,MAAM,CAACI,IAAI,CAACP,UAAU,CAAC,CAACJ,OAAO,CAACC,GAAG,IAAI;QACnC,IAAI,CAACA,GAAG,CAACW,UAAU,CAAC,kBAAkB,CAAC,EAAE;UACrC;QACJ;QACA,MAAMC,MAAM,GAAG5B,WAAW,CAACmB,UAAU,EAAEH,GAAG,CAAC,GAAGG,UAAU,CAACH,GAAG,CAAC,GAAGa,SAAS;QACzE,IAAI,CAACD,MAAM,EAAE;UACT;QACJ;QACAN,MAAM,CAACQ,cAAc,CAACF,MAAM,EAAE,iBAAiB,EAAE;UAC7CX,KAAK,EAAEV;QACX,CAAC,CAAC;MACN,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC;EACDe,MAAM,CAACQ,cAAc,CAAC1B,MAAM,EAAE,aAAa,EAAE;IACzCa,KAAK,EAAEX;EACX,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
2
|
+
[]}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React, { type ComponentProps, type ComponentType } from 'react';
|
2
|
+
import type { UnistylesTheme } from '../types';
|
3
|
+
type Mappings<T extends ComponentType<any>> = (theme: UnistylesTheme) => Partial<ComponentProps<T>>;
|
4
|
+
export declare const createUnistylesComponent: <T extends ComponentType<any>>(Component: T, _: Mappings<T>) => (props: ComponentProps<T>) => React.JSX.Element;
|
5
|
+
export {};
|
6
|
+
//# sourceMappingURL=createUnistylesComponent.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createUnistylesComponent.d.ts","sourceRoot":"","sources":["../../../../src/core/createUnistylesComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,KAAK,QAAQ,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AAEnG,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,aAChF,cAAc,CAAC,CAAC,CAAC,sBAGnC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React, { type ComponentProps, type ComponentType } from 'react';
|
2
|
+
import type { UnistylesTheme } from '../types';
|
3
|
+
type Mappings<T extends ComponentType<any>> = (theme: UnistylesTheme) => Partial<ComponentProps<T>>;
|
4
|
+
export declare const createUnistylesComponent: <T extends ComponentType<any>>(Component: T, mappings: Mappings<T>) => (props: ComponentProps<T>) => React.JSX.Element;
|
5
|
+
export {};
|
6
|
+
//# sourceMappingURL=createUnistylesComponent.native.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createUnistylesComponent.native.d.ts","sourceRoot":"","sources":["../../../../src/core/createUnistylesComponent.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAuB,MAAM,OAAO,CAAA;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG9C,KAAK,QAAQ,CAAC,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AAEnG,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,YAAY,QAAQ,CAAC,CAAC,CAAC,aACvF,cAAc,CAAC,CAAC,CAAC,sBAoCnC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from './specs';
|
2
2
|
export { mq } from './mq';
|
3
3
|
export type { UnistylesThemes, UnistylesBreakpoints } from './global';
|
4
|
-
export { useTheme, useBreakpoint } from './core';
|
4
|
+
export { useTheme, useBreakpoint, createUnistylesComponent } from './core';
|
5
5
|
export type { UnistylesVariants } from './types';
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAA;AACzB,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAA;AAC1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}
|
@@ -107,7 +107,7 @@ namespace margelo::nitro::unistyles {
|
|
107
107
|
bool JHybridNativePlatformSpec::getPrefersRtlDirection() {
|
108
108
|
static const auto method = _javaPart->getClass()->getMethod<jboolean()>("getPrefersRtlDirection");
|
109
109
|
auto __result = method(_javaPart);
|
110
|
-
return __result;
|
110
|
+
return static_cast<bool>(__result);
|
111
111
|
}
|
112
112
|
void JHybridNativePlatformSpec::setRootViewBackgroundColor(double color) {
|
113
113
|
static const auto method = _javaPart->getClass()->getMethod<void(double /* color */)>("setRootViewBackgroundColor");
|
@@ -65,11 +65,11 @@ namespace margelo::nitro::unistyles {
|
|
65
65
|
insets->toCpp(),
|
66
66
|
pixelRatio,
|
67
67
|
fontScale,
|
68
|
-
rtl,
|
68
|
+
static_cast<bool>(rtl),
|
69
69
|
statusBar->toCpp(),
|
70
70
|
navigationBar->toCpp(),
|
71
|
-
isPortrait,
|
72
|
-
isLandscape
|
71
|
+
static_cast<bool>(isPortrait),
|
72
|
+
static_cast<bool>(isLandscape)
|
73
73
|
);
|
74
74
|
}
|
75
75
|
|
@@ -47,6 +47,18 @@ target_link_libraries(
|
|
47
47
|
unistyles
|
48
48
|
fbjni::fbjni # <-- Facebook C++ JNI helpers
|
49
49
|
ReactAndroid::jsi # <-- RN: JSI
|
50
|
-
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
51
50
|
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
|
52
51
|
)
|
52
|
+
|
53
|
+
# Link react-native (different prefab between RN 0.75 and RN 0.76)
|
54
|
+
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
|
55
|
+
target_link_libraries(
|
56
|
+
unistyles
|
57
|
+
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
|
58
|
+
)
|
59
|
+
else()
|
60
|
+
target_link_libraries(
|
61
|
+
unistyles
|
62
|
+
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
63
|
+
)
|
64
|
+
endif()
|
@@ -7,12 +7,6 @@
|
|
7
7
|
|
8
8
|
#pragma once
|
9
9
|
|
10
|
-
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
11
|
-
#include <NitroModules/NitroDefines.hpp>
|
12
|
-
#else
|
13
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
14
|
-
#endif
|
15
|
-
|
16
10
|
// Forward declarations of C++ defined types
|
17
11
|
// Forward declaration of `HybridNativePlatformSpec` to properly resolve imports.
|
18
12
|
namespace margelo::nitro::unistyles { class HybridNativePlatformSpec; }
|
@@ -46,7 +40,7 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
46
40
|
vector.reserve(size);
|
47
41
|
return vector;
|
48
42
|
}
|
49
|
-
|
43
|
+
|
50
44
|
// pragma MARK: std::function<void(const std::vector<UnistyleDependency>& /* dependencies */)>
|
51
45
|
/**
|
52
46
|
* Specialized version of `std::function<void(const std::vector<UnistyleDependency>&)>`.
|
@@ -65,7 +59,7 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
65
59
|
private:
|
66
60
|
std::function<void(const std::vector<UnistyleDependency>& /* dependencies */)> _function;
|
67
61
|
};
|
68
|
-
inline Func_void_std__vector_UnistyleDependency_ create_Func_void_std__vector_UnistyleDependency_(void*
|
62
|
+
inline Func_void_std__vector_UnistyleDependency_ create_Func_void_std__vector_UnistyleDependency_(void* _Nonnull closureHolder, void(* _Nonnull call)(void* _Nonnull /* closureHolder */, std::vector<UnistyleDependency>), void(* _Nonnull destroy)(void* _Nonnull)) {
|
69
63
|
std::shared_ptr<void> sharedClosureHolder(closureHolder, destroy);
|
70
64
|
return Func_void_std__vector_UnistyleDependency_([sharedClosureHolder, call](const std::vector<UnistyleDependency>& dependencies) -> void {
|
71
65
|
call(sharedClosureHolder.get(), dependencies);
|
@@ -74,7 +68,7 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
74
68
|
inline std::shared_ptr<Func_void_std__vector_UnistyleDependency__Wrapper> share_Func_void_std__vector_UnistyleDependency_(const Func_void_std__vector_UnistyleDependency_& value) {
|
75
69
|
return std::make_shared<Func_void_std__vector_UnistyleDependency__Wrapper>(value);
|
76
70
|
}
|
77
|
-
|
71
|
+
|
78
72
|
// pragma MARK: std::function<void()>
|
79
73
|
/**
|
80
74
|
* Specialized version of `std::function<void()>`.
|
@@ -102,7 +96,7 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
102
96
|
inline std::shared_ptr<Func_void_Wrapper> share_Func_void(const Func_void& value) {
|
103
97
|
return std::make_shared<Func_void_Wrapper>(value);
|
104
98
|
}
|
105
|
-
|
99
|
+
|
106
100
|
// pragma MARK: std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
|
107
101
|
/**
|
108
102
|
* Specialized version of `std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>`.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "react-native-unistyles",
|
3
|
-
"version": "3.0.0-alpha.
|
3
|
+
"version": "3.0.0-alpha.30",
|
4
4
|
"description": "Level up your React Native StyleSheet",
|
5
5
|
"scripts": {
|
6
6
|
"test": "jest",
|
@@ -74,11 +74,11 @@
|
|
74
74
|
"husky": "9.1.6",
|
75
75
|
"jest": "29.7.0",
|
76
76
|
"metro-react-native-babel-preset": "0.77.0",
|
77
|
-
"nitro-codegen": "0.
|
77
|
+
"nitro-codegen": "0.14.0",
|
78
78
|
"react": "18.3.1",
|
79
79
|
"react-native": "0.76.0",
|
80
80
|
"react-native-builder-bob": "0.30.2",
|
81
|
-
"react-native-nitro-modules": "0.
|
81
|
+
"react-native-nitro-modules": "0.14.0",
|
82
82
|
"react-test-renderer": "18.3.1",
|
83
83
|
"release-it": "17.10.0",
|
84
84
|
"typescript": "5.6.3"
|
package/src/common.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
2
|
+
import { StyleSheet, UnistyleDependency, UnistylesRuntime } from '../specs';
|
3
|
+
export const createUnistylesComponent = (Component, mappings) => {
|
4
|
+
return (props) => {
|
5
|
+
const [theme, setTheme] = useState(UnistylesRuntime.getTheme());
|
6
|
+
const [, setRt] = useState(0);
|
7
|
+
useEffect(() => {
|
8
|
+
const removeChangeListener = StyleSheet.addChangeListener(dependencies => {
|
9
|
+
const componentDependencies = (props.style?.uni__dependencies || mappings(theme).style?.uni__dependencies);
|
10
|
+
if (dependencies.includes(UnistyleDependency.Theme) && (!componentDependencies || componentDependencies.includes(UnistyleDependency.Theme))) {
|
11
|
+
setTheme(UnistylesRuntime.getTheme());
|
12
|
+
}
|
13
|
+
if (dependencies.some(dependency => dependency >= 2) && (!componentDependencies || componentDependencies.some(dependency => dependency >= 2))) {
|
14
|
+
setRt(prevState => prevState + 1);
|
15
|
+
}
|
16
|
+
});
|
17
|
+
return () => {
|
18
|
+
removeChangeListener();
|
19
|
+
};
|
20
|
+
}, []);
|
21
|
+
const mergedProps = { ...mappings(theme) };
|
22
|
+
Object.keys(props).forEach(key => {
|
23
|
+
if (key in mergedProps) {
|
24
|
+
mergedProps[key] = Object.assign(props[key], mergedProps[key]);
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
mergedProps[key] = props[key];
|
28
|
+
});
|
29
|
+
return React.createElement(Component, { ...mergedProps });
|
30
|
+
};
|
31
|
+
};
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import React, { type ComponentProps, type ComponentType, useEffect, useState } from 'react'
|
2
|
+
import type { UnistylesTheme } from '../types'
|
3
|
+
import { StyleSheet, UnistyleDependency, UnistylesRuntime, type UnistylesStyleSheet } from '../specs'
|
4
|
+
|
5
|
+
type Mappings<T extends ComponentType<any>> = (theme: UnistylesTheme) => Partial<ComponentProps<T>>
|
6
|
+
|
7
|
+
export const createUnistylesComponent = <T extends ComponentType<any>>(Component: T, mappings: Mappings<T>) => {
|
8
|
+
return (props: ComponentProps<T>) => {
|
9
|
+
const [theme, setTheme] = useState<UnistylesTheme>(UnistylesRuntime.getTheme())
|
10
|
+
const [, setRt] = useState(0)
|
11
|
+
|
12
|
+
useEffect(() => {
|
13
|
+
const removeChangeListener = (StyleSheet as UnistylesStyleSheet).addChangeListener(dependencies => {
|
14
|
+
const componentDependencies = (props.style?.uni__dependencies || mappings(theme).style?.uni__dependencies) as Array<UnistyleDependency>
|
15
|
+
|
16
|
+
if (dependencies.includes(UnistyleDependency.Theme) && (!componentDependencies ||componentDependencies.includes(UnistyleDependency.Theme))) {
|
17
|
+
setTheme(UnistylesRuntime.getTheme())
|
18
|
+
}
|
19
|
+
|
20
|
+
if (dependencies.some(dependency => dependency >= 2) && (!componentDependencies || componentDependencies.some(dependency => dependency >= 2))) {
|
21
|
+
setRt(prevState => prevState + 1)
|
22
|
+
}
|
23
|
+
})
|
24
|
+
|
25
|
+
return () => {
|
26
|
+
removeChangeListener()
|
27
|
+
}
|
28
|
+
}, [])
|
29
|
+
|
30
|
+
const mergedProps = { ...mappings(theme) } as ComponentProps<T>
|
31
|
+
|
32
|
+
Object.keys(props).forEach(key => {
|
33
|
+
if (key in mergedProps) {
|
34
|
+
mergedProps[key] = Object.assign(props[key], mergedProps[key])
|
35
|
+
|
36
|
+
return
|
37
|
+
}
|
38
|
+
|
39
|
+
mergedProps[key] = props[key]
|
40
|
+
})
|
41
|
+
|
42
|
+
return <Component {...mergedProps} />
|
43
|
+
}
|
44
|
+
}
|