react-native-unistyles 3.0.0-alpha.38 → 3.0.0-alpha.39
Sign up to get free protection for your applications and to get access to all the features.
- package/android/build.gradle +4 -4
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +13 -30
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +22 -18
- package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +10 -5
- package/cxx/core/UnistyleWrapper.h +27 -10
- package/cxx/core/UnistylesRegistry.cpp +34 -10
- package/cxx/core/UnistylesRegistry.h +2 -2
- package/cxx/hybridObjects/HybridNavigationBar.cpp +0 -4
- package/cxx/hybridObjects/HybridNavigationBar.h +0 -1
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +7 -3
- package/cxx/hybridObjects/HybridStatusBar.cpp +0 -4
- package/cxx/hybridObjects/HybridStatusBar.h +0 -1
- package/cxx/hybridObjects/HybridStyleSheet.cpp +59 -28
- package/cxx/hybridObjects/HybridStyleSheet.h +7 -3
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +37 -6
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +7 -3
- package/cxx/parser/Parser.cpp +7 -7
- package/cxx/parser/Parser.h +2 -2
- package/ios/NativePlatform+ios.swift +2 -4
- package/ios/NativePlatform+keyboard.swift +1 -1
- package/ios/NativePlatformListener+ios.swift +6 -6
- package/ios/UnistylesModuleOnLoad.h +1 -6
- package/lib/commonjs/core/createUnistylesComponent.js +27 -20
- package/lib/commonjs/core/createUnistylesComponent.js.map +1 -1
- package/lib/commonjs/core/createUnistylesComponent.native.js +14 -17
- package/lib/commonjs/core/createUnistylesComponent.native.js.map +1 -1
- package/lib/commonjs/specs/NavigtionBar/index.js +0 -15
- package/lib/commonjs/specs/NavigtionBar/index.js.map +1 -1
- package/lib/commonjs/specs/ShadowRegistry/index.js +5 -7
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StatusBar/index.js +0 -5
- package/lib/commonjs/specs/StatusBar/index.js.map +1 -1
- package/lib/commonjs/specs/UnistylesRuntime/index.js +0 -2
- package/lib/commonjs/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/commonjs/utils.js +26 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/commonjs/web/convert/index.js +1 -1
- package/lib/commonjs/web/convert/object/boxShadow.js +2 -1
- package/lib/commonjs/web/convert/object/boxShadow.js.map +1 -1
- package/lib/commonjs/web/convert/object/objectStyle.js +3 -2
- package/lib/commonjs/web/convert/object/objectStyle.js.map +1 -1
- package/lib/commonjs/web/convert/shadow/boxShadow.js +1 -1
- package/lib/commonjs/web/convert/shadow/textShadow.js +1 -1
- package/lib/commonjs/web/create.js +2 -1
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/index.js +1 -1
- package/lib/commonjs/web/listener.js +18 -2
- package/lib/commonjs/web/listener.js.map +1 -1
- package/lib/commonjs/web/mock.js +1 -2
- package/lib/commonjs/web/mock.js.map +1 -1
- package/lib/commonjs/web/runtime.js +5 -2
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/shadowRegistry.js +53 -73
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/utils/common.js +1 -24
- package/lib/commonjs/web/utils/common.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/commonjs/web/variants/getVariants.js +1 -1
- package/lib/module/core/createUnistylesComponent.js +28 -21
- package/lib/module/core/createUnistylesComponent.js.map +1 -1
- package/lib/module/core/createUnistylesComponent.native.js +15 -18
- package/lib/module/core/createUnistylesComponent.native.js.map +1 -1
- package/lib/module/specs/NavigtionBar/index.js +0 -10
- package/lib/module/specs/NavigtionBar/index.js.map +1 -1
- package/lib/module/specs/ShadowRegistry/index.js +5 -7
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StatusBar/index.js +1 -6
- package/lib/module/specs/StatusBar/index.js.map +1 -1
- package/lib/module/specs/UnistylesRuntime/index.js +0 -2
- package/lib/module/specs/UnistylesRuntime/index.js.map +1 -1
- package/lib/module/utils.js +21 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/web/convert/index.js +1 -1
- package/lib/module/web/convert/index.js.map +1 -1
- package/lib/module/web/convert/object/boxShadow.js +2 -1
- package/lib/module/web/convert/object/boxShadow.js.map +1 -1
- package/lib/module/web/convert/object/objectStyle.js +2 -1
- package/lib/module/web/convert/object/objectStyle.js.map +1 -1
- package/lib/module/web/convert/shadow/boxShadow.js +1 -1
- package/lib/module/web/convert/shadow/boxShadow.js.map +1 -1
- package/lib/module/web/convert/shadow/textShadow.js +1 -1
- package/lib/module/web/convert/shadow/textShadow.js.map +1 -1
- package/lib/module/web/create.js +2 -1
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/index.js +1 -1
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/listener.js +18 -2
- package/lib/module/web/listener.js.map +1 -1
- package/lib/module/web/mock.js +1 -2
- package/lib/module/web/mock.js.map +1 -1
- package/lib/module/web/runtime.js +6 -3
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/shadowRegistry.js +51 -71
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/utils/common.js +0 -22
- package/lib/module/web/utils/common.js.map +1 -1
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/module/web/variants/getVariants.js +1 -1
- package/lib/module/web/variants/getVariants.js.map +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.d.ts +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts +1 -1
- package/lib/typescript/src/core/createUnistylesComponent.native.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts +2 -4
- package/lib/typescript/src/specs/NativePlatform/NativePlatform.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts +1 -15
- package/lib/typescript/src/specs/NavigtionBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +3 -3
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts +0 -1
- package/lib/typescript/src/specs/StatusBar/UnistylesStatusBar.nitro.d.ts.map +1 -1
- package/lib/typescript/src/specs/StatusBar/index.d.ts +2 -9
- package/lib/typescript/src/specs/StatusBar/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/UnistylesRuntime/index.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/convert/object/boxShadow.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/object/objectStyle.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/listener.d.ts.map +1 -1
- package/lib/typescript/src/web/mock.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +1 -1
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/shadowRegistry.d.ts +1 -3
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/common.d.ts +0 -4
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +57 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +69 -0
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +8 -16
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +2 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void_std__vector_UnistyleDependency_.kt → Func_void_UnistylesNativeMiniRuntime.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/{Func_void.kt → Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt} +5 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +4 -12
- package/nitrogen/generated/android/unistylesOnLoad.cpp +4 -4
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +43 -30
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +2 -8
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +2 -4
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +10 -32
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +0 -2
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +2 -4
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +0 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +0 -1
- package/package.json +4 -2
- package/plugin/common.js +12 -1
- package/plugin/index.js +12 -10
- package/plugin/ref.js +80 -15
- package/plugin/style.js +113 -18
- package/src/core/createUnistylesComponent.native.tsx +15 -22
- package/src/core/createUnistylesComponent.tsx +29 -23
- package/src/specs/NativePlatform/NativePlatform.nitro.ts +2 -4
- package/src/specs/NavigtionBar/UnistylesNavigationBar.nitro.ts +0 -1
- package/src/specs/NavigtionBar/index.ts +1 -30
- package/src/specs/ShadowRegistry/index.ts +8 -11
- package/src/specs/StatusBar/UnistylesStatusBar.nitro.ts +0 -1
- package/src/specs/StatusBar/index.ts +2 -17
- package/src/specs/UnistylesRuntime/index.ts +1 -2
- package/src/utils.ts +22 -0
- package/src/web/convert/index.ts +1 -1
- package/src/web/convert/object/boxShadow.ts +2 -1
- package/src/web/convert/object/objectStyle.ts +2 -1
- package/src/web/convert/shadow/boxShadow.ts +1 -1
- package/src/web/convert/shadow/textShadow.ts +1 -1
- package/src/web/create.ts +2 -1
- package/src/web/index.ts +1 -1
- package/src/web/listener.ts +22 -2
- package/src/web/mock.ts +1 -2
- package/src/web/runtime.ts +7 -3
- package/src/web/shadowRegistry.ts +55 -70
- package/src/web/utils/common.ts +0 -26
- package/src/web/utils/unistyle.ts +1 -1
- package/src/web/variants/getVariants.ts +1 -1
- package/nitrogen/generated/android/c++/JFunc_void.hpp +0 -48
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency_.hpp +0 -60
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../../src/web/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG5D,cAAM,wBAAwB;IAC1B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,SAAS,CAAoG;IACrH,OAAO,CAAC,mBAAmB,CAAoG;IAE/H,UAAU,eAAgB,kBAAkB,UAG3C;IAED,aAAa,
|
1
|
+
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../../../src/web/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAG5D,cAAM,wBAAwB;IAC1B,OAAO,CAAC,aAAa,CAAQ;IAC7B,OAAO,CAAC,SAAS,CAAoG;IACrH,OAAO,CAAC,mBAAmB,CAAoG;IAE/H,UAAU,eAAgB,kBAAkB,UAG3C;IAED,aAAa,aA8BZ;IAED,YAAY,iBAAkB,KAAK,CAAC,kBAAkB,CAAC,YAAY,YAAY,gBAM9E;IAED,sBAAsB,iBAAkB,KAAK,CAAC,kBAAkB,CAAC,YAAY,YAAY,gBAMxF;CACJ;AAED,eAAO,MAAM,iBAAiB,0BAAiC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../../src/web/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,KAAK,EAAE,kBAAkB,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAE7E,eAAO,MAAM,SAAS,EAAE,
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../../src/web/mock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACxF,OAAO,KAAK,EAAE,kBAAkB,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAE7E,eAAO,MAAM,SAAS,EAAE,aASvB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,iBAS3B,CAAA"}
|
@@ -33,7 +33,7 @@ declare class UnistylesRuntimeBuilder {
|
|
33
33
|
get miniRuntime(): UnistylesMiniRuntime;
|
34
34
|
setTheme: (themeName: AppThemeName) => void;
|
35
35
|
setAdaptiveThemes: (isEnabled: boolean) => void;
|
36
|
-
setRootViewBackgroundColor: (
|
36
|
+
setRootViewBackgroundColor: (color: string) => void;
|
37
37
|
setImmersiveMode: () => void;
|
38
38
|
updateTheme: (themeName: AppThemeName, updater: (currentTheme: AppTheme) => AppTheme) => void;
|
39
39
|
getTheme: (themeName?: undefined) => never;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/web/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAMjD,cAAM,uBAAuB;IACzB,UAAU,wBAAuB;IACjC,SAAS,wBAAsB;IAE/B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAYpB,IAAI,WAAW,gBASd;IAED,IAAI,SAAS,
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/web/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAMjD,cAAM,uBAAuB;IACzB,UAAU,wBAAuB;IACjC,SAAS,wBAAsB;IAE/B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,YAAY;IAYpB,IAAI,WAAW,gBASd;IAED,IAAI,SAAS,cAMZ;IAED,IAAI,mBAAmB,2BAEtB;IAED,IAAI,WAAW,sCAEd;IAED,IAAI,UAAU,wDAEb;IAED,IAAI,WAAW,gBAMd;IAED,IAAI,KAAK,UAER;IAED,IAAI,UAAU,WAEb;IAED,IAAI,MAAM;;;MAYT;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,MAAM;;;;;;MAQT;IAED,IAAI,SAAS,oDAEZ;IAED,IAAI,GAAG,YAEN;IAED,IAAI,iBAAiB,YAEpB;IAED,IAAI,aAAa,2DAEhB;IAED,IAAI,WAAW,IAAI,oBAAoB,CAuBtC;IAED,QAAQ,cAAe,YAAY,UAQlC;IAED,iBAAiB,cAAe,OAAO,UAQtC;IAED,0BAA0B,UAAW,MAAM,UAM1C;IAED,gBAAgB,aAAW;IAE3B,WAAW,cAAe,YAAY,WAAW,CAAC,YAAY,EAAE,QAAQ,KAAK,QAAQ,UAQpF;IAED,QAAQ,mCAYP;CACJ;AAED,eAAO,MAAM,gBAAgB,yBAAgC,CAAA"}
|
@@ -9,9 +9,7 @@ declare class UnistylesShadowRegistryBuilder {
|
|
9
9
|
private resultsMap;
|
10
10
|
private hashMap;
|
11
11
|
private classNamesMap;
|
12
|
-
|
13
|
-
private queuedResultMap;
|
14
|
-
add: (ref: any, _style?: Style | Array<Style>, _variants?: Record<string, any>, _args?: Array<any>) => Promise<string[]>;
|
12
|
+
add: (ref: any, _style: Array<Style>, _variants: Record<string, any> | undefined, _args: Array<Array<any>>) => string[] | undefined;
|
15
13
|
remove: () => void;
|
16
14
|
}
|
17
15
|
export declare const UnistylesShadowRegistry: UnistylesShadowRegistryBuilder;
|
@@ -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;
|
1
|
+
{"version":3,"file":"shadowRegistry.d.ts","sourceRoot":"","sources":["../../../../src/web/shadowRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAQ/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,UAAU,CAA0C;IAC5D,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,aAAa,CAAwC;IAE7D,GAAG,QAAS,GAAG,UAAU,KAAK,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,SAAS,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,0BAoH1G;IAED,MAAM,aAAW;CACpB;AAED,eAAO,MAAM,uBAAuB,gCAAuC,CAAA"}
|
@@ -1,10 +1,6 @@
|
|
1
1
|
export declare const reduceObject: <TObj extends Record<string, any>, TReducer>(obj: TObj, reducer: (value: TObj[keyof TObj], key: keyof TObj) => TReducer) => { [K in keyof TObj]: TReducer; };
|
2
2
|
export declare const keyInObject: <T extends Record<string, any>>(obj: T, key: PropertyKey) => key is keyof T;
|
3
3
|
export declare const isServer: () => boolean;
|
4
|
-
/**
|
5
|
-
* Deeply merges properties of passed object
|
6
|
-
*/
|
7
|
-
export declare const deepMergeObjects: <T extends Record<PropertyKey, any>>(...sources: Array<T>) => T;
|
8
4
|
export declare const warn: (message: string) => void;
|
9
5
|
export declare const equal: <T>(a: T, b: T) => boolean;
|
10
6
|
export declare const generateHash: (value: any) => string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,OAC9D,IAAI,WACA,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,IAAI,KAAK,QAAQ,KACmD,GAAG,CAAe,IAAV,MAAM,IAAI,GAAG,QAAQ,GAAE,CAAA;AAErJ,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,WAAW,KAAG,GAAG,IAAI,MAAM,CAAe,CAAA;AAElH,eAAO,MAAM,QAAQ,eAAsC,CAAA;AAE3D
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/common.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,OAC9D,IAAI,WACA,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,IAAI,KAAK,QAAQ,KACmD,GAAG,CAAe,IAAV,MAAM,IAAI,GAAG,QAAQ,GAAE,CAAA;AAErJ,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,WAAW,KAAG,GAAG,IAAI,MAAM,CAAe,CAAA;AAElH,eAAO,MAAM,QAAQ,eAAsC,CAAA;AAE3D,eAAO,MAAM,IAAI,YAAa,MAAM,SAA2D,CAAA;AAE/F,eAAO,MAAM,KAAK,GAAI,CAAC,KAAK,CAAC,KAAK,CAAC,YAqBlC,CAAA;AAED,eAAO,MAAM,YAAY,UAAW,GAAG,WAQtC,CAAA;AAED,eAAO,MAAM,SAAS,iBAAkB,MAAM,WAAyE,CAAA"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { UnistyleDependency } from '../../specs/NativePlatform';
|
2
2
|
import { ColorScheme } from '../../specs/types';
|
3
3
|
import type { StyleSheet, StyleSheetWithSuperPowers, UnistylesValues } from '../../types/stylesheet';
|
4
|
-
export declare const schemeToTheme: (scheme: ColorScheme) =>
|
4
|
+
export declare const schemeToTheme: (scheme: ColorScheme) => "light" | "dark";
|
5
5
|
export declare const hexToRGBA: (hex: string, opacity: number) => string;
|
6
6
|
export type UnistyleSecrets = {
|
7
7
|
__uni__stylesheet: StyleSheetWithSuperPowers<StyleSheet>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"unistyle.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/unistyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAKpG,eAAO,MAAM,aAAa,WAAY,WAAW,
|
1
|
+
{"version":3,"file":"unistyle.d.ts","sourceRoot":"","sources":["../../../../../src/web/utils/unistyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAKpG,eAAO,MAAM,aAAa,WAAY,WAAW,qBAQhD,CAAA;AAED,eAAO,MAAM,SAAS,QAAS,MAAM,WAAW,MAAM,WAM5B,CAAA;AAE1B,MAAM,MAAM,eAAe,GAAG;IAC1B,iBAAiB,EAAE,yBAAyB,CAAC,UAAU,CAAC,CAAC;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;IAC7B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,UAAU,CAAC,WAAW,eAAe,MAKnE,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,GAAG,sBAUzC,CAAA;AAED,eAAO,MAAM,SAAS,WAAY,eAAe,OAUhD,CAAA;AAED,eAAO,MAAM,YAAY,YAAa,WAAW,YAAoC,CAAA;AAErF,eAAO,MAAM,sBAAsB,UAAW,MAAM,uBAUnD,CAAA;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,WAmB1C,CAAA;AAED,eAAO,MAAM,2BAA2B,UAAW,GAAG,yBAQrD,CAAA"}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
///
|
2
|
+
/// JFunc_void_UnistylesNativeMiniRuntime.hpp
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
|
+
/// https://github.com/mrousavy/nitro
|
5
|
+
/// Copyright © 2024 Marc Rousavy @ Margelo
|
6
|
+
///
|
7
|
+
|
8
|
+
#pragma once
|
9
|
+
|
10
|
+
#include <fbjni/fbjni.h>
|
11
|
+
#include <functional>
|
12
|
+
|
13
|
+
#include <functional>
|
14
|
+
#include "UnistylesNativeMiniRuntime.hpp"
|
15
|
+
#include "JUnistylesNativeMiniRuntime.hpp"
|
16
|
+
#include "ColorScheme.hpp"
|
17
|
+
#include "JColorScheme.hpp"
|
18
|
+
#include "Dimensions.hpp"
|
19
|
+
#include "JDimensions.hpp"
|
20
|
+
#include <string>
|
21
|
+
#include "Insets.hpp"
|
22
|
+
#include "JInsets.hpp"
|
23
|
+
|
24
|
+
namespace margelo::nitro::unistyles {
|
25
|
+
|
26
|
+
using namespace facebook;
|
27
|
+
|
28
|
+
/**
|
29
|
+
* C++ representation of the callback Func_void_UnistylesNativeMiniRuntime.
|
30
|
+
* This is a Kotlin `(miniRuntime: UnistylesNativeMiniRuntime) -> Unit`, backed by a `std::function<...>`.
|
31
|
+
*/
|
32
|
+
struct JFunc_void_UnistylesNativeMiniRuntime final: public jni::HybridClass<JFunc_void_UnistylesNativeMiniRuntime> {
|
33
|
+
public:
|
34
|
+
static jni::local_ref<JFunc_void_UnistylesNativeMiniRuntime::javaobject> fromCpp(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& func) {
|
35
|
+
return JFunc_void_UnistylesNativeMiniRuntime::newObjectCxxArgs(func);
|
36
|
+
}
|
37
|
+
|
38
|
+
public:
|
39
|
+
void call(jni::alias_ref<JUnistylesNativeMiniRuntime> miniRuntime) {
|
40
|
+
return _func(miniRuntime->toCpp());
|
41
|
+
}
|
42
|
+
|
43
|
+
public:
|
44
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/unistyles/Func_void_UnistylesNativeMiniRuntime;";
|
45
|
+
static void registerNatives() {
|
46
|
+
registerHybrid({makeNativeMethod("call", JFunc_void_UnistylesNativeMiniRuntime::call)});
|
47
|
+
}
|
48
|
+
|
49
|
+
private:
|
50
|
+
explicit JFunc_void_UnistylesNativeMiniRuntime(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& func): _func(func) { }
|
51
|
+
|
52
|
+
private:
|
53
|
+
friend HybridBase;
|
54
|
+
std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)> _func;
|
55
|
+
};
|
56
|
+
|
57
|
+
} // namespace margelo::nitro::unistyles
|
@@ -0,0 +1,69 @@
|
|
1
|
+
///
|
2
|
+
/// JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
|
+
/// https://github.com/mrousavy/nitro
|
5
|
+
/// Copyright © 2024 Marc Rousavy @ Margelo
|
6
|
+
///
|
7
|
+
|
8
|
+
#pragma once
|
9
|
+
|
10
|
+
#include <fbjni/fbjni.h>
|
11
|
+
#include <functional>
|
12
|
+
|
13
|
+
#include <functional>
|
14
|
+
#include <vector>
|
15
|
+
#include "UnistyleDependency.hpp"
|
16
|
+
#include "UnistylesNativeMiniRuntime.hpp"
|
17
|
+
#include "JUnistyleDependency.hpp"
|
18
|
+
#include "JUnistylesNativeMiniRuntime.hpp"
|
19
|
+
#include "ColorScheme.hpp"
|
20
|
+
#include "JColorScheme.hpp"
|
21
|
+
#include "Dimensions.hpp"
|
22
|
+
#include "JDimensions.hpp"
|
23
|
+
#include <string>
|
24
|
+
#include "Insets.hpp"
|
25
|
+
#include "JInsets.hpp"
|
26
|
+
|
27
|
+
namespace margelo::nitro::unistyles {
|
28
|
+
|
29
|
+
using namespace facebook;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* C++ representation of the callback Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.
|
33
|
+
* This is a Kotlin `(dependencies: Array<UnistyleDependency>, miniRuntime: UnistylesNativeMiniRuntime) -> Unit`, backed by a `std::function<...>`.
|
34
|
+
*/
|
35
|
+
struct JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime final: public jni::HybridClass<JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime> {
|
36
|
+
public:
|
37
|
+
static jni::local_ref<JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::javaobject> fromCpp(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& func) {
|
38
|
+
return JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::newObjectCxxArgs(func);
|
39
|
+
}
|
40
|
+
|
41
|
+
public:
|
42
|
+
void call(jni::alias_ref<jni::JArrayClass<JUnistyleDependency>> dependencies, jni::alias_ref<JUnistylesNativeMiniRuntime> miniRuntime) {
|
43
|
+
return _func([&]() {
|
44
|
+
size_t __size = dependencies->size();
|
45
|
+
std::vector<UnistyleDependency> __vector;
|
46
|
+
__vector.reserve(__size);
|
47
|
+
for (size_t __i = 0; __i < __size; __i++) {
|
48
|
+
auto __element = dependencies->getElement(__i);
|
49
|
+
__vector.push_back(__element->toCpp());
|
50
|
+
}
|
51
|
+
return __vector;
|
52
|
+
}(), miniRuntime->toCpp());
|
53
|
+
}
|
54
|
+
|
55
|
+
public:
|
56
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime;";
|
57
|
+
static void registerNatives() {
|
58
|
+
registerHybrid({makeNativeMethod("call", JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::call)});
|
59
|
+
}
|
60
|
+
|
61
|
+
private:
|
62
|
+
explicit JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& func): _func(func) { }
|
63
|
+
|
64
|
+
private:
|
65
|
+
friend HybridBase;
|
66
|
+
std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)> _func;
|
67
|
+
};
|
68
|
+
|
69
|
+
} // namespace margelo::nitro::unistyles
|
@@ -34,9 +34,9 @@ namespace margelo::nitro::unistyles { enum class UnistyleDependency; }
|
|
34
34
|
#include <functional>
|
35
35
|
#include <vector>
|
36
36
|
#include "UnistyleDependency.hpp"
|
37
|
-
#include "
|
37
|
+
#include "JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp"
|
38
38
|
#include "JUnistyleDependency.hpp"
|
39
|
-
#include "
|
39
|
+
#include "JFunc_void_UnistylesNativeMiniRuntime.hpp"
|
40
40
|
|
41
41
|
namespace margelo::nitro::unistyles {
|
42
42
|
|
@@ -113,10 +113,6 @@ namespace margelo::nitro::unistyles {
|
|
113
113
|
static const auto method = _javaPart->getClass()->getMethod<void(double /* color */)>("setRootViewBackgroundColor");
|
114
114
|
method(_javaPart, color);
|
115
115
|
}
|
116
|
-
void JHybridNativePlatformSpec::setNavigationBarBackgroundColor(double color) {
|
117
|
-
static const auto method = _javaPart->getClass()->getMethod<void(double /* color */)>("setNavigationBarBackgroundColor");
|
118
|
-
method(_javaPart, color);
|
119
|
-
}
|
120
116
|
void JHybridNativePlatformSpec::setNavigationBarHidden(bool isHidden) {
|
121
117
|
static const auto method = _javaPart->getClass()->getMethod<void(jboolean /* isHidden */)>("setNavigationBarHidden");
|
122
118
|
method(_javaPart, isHidden);
|
@@ -125,10 +121,6 @@ namespace margelo::nitro::unistyles {
|
|
125
121
|
static const auto method = _javaPart->getClass()->getMethod<void(jboolean /* isHidden */)>("setStatusBarHidden");
|
126
122
|
method(_javaPart, isHidden);
|
127
123
|
}
|
128
|
-
void JHybridNativePlatformSpec::setStatusBarBackgroundColor(double color) {
|
129
|
-
static const auto method = _javaPart->getClass()->getMethod<void(double /* color */)>("setStatusBarBackgroundColor");
|
130
|
-
method(_javaPart, color);
|
131
|
-
}
|
132
124
|
void JHybridNativePlatformSpec::setImmersiveMode(bool isEnabled) {
|
133
125
|
static const auto method = _javaPart->getClass()->getMethod<void(jboolean /* isEnabled */)>("setImmersiveMode");
|
134
126
|
method(_javaPart, isEnabled);
|
@@ -138,13 +130,13 @@ namespace margelo::nitro::unistyles {
|
|
138
130
|
auto __result = method(_javaPart);
|
139
131
|
return __result->toCpp();
|
140
132
|
}
|
141
|
-
void JHybridNativePlatformSpec::registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */)>& callback) {
|
142
|
-
static const auto method = _javaPart->getClass()->getMethod<void(jni::alias_ref<
|
143
|
-
method(_javaPart,
|
133
|
+
void JHybridNativePlatformSpec::registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) {
|
134
|
+
static const auto method = _javaPart->getClass()->getMethod<void(jni::alias_ref<JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::javaobject> /* callback */)>("registerPlatformListener");
|
135
|
+
method(_javaPart, JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::fromCpp(callback));
|
144
136
|
}
|
145
|
-
void JHybridNativePlatformSpec::registerImeListener(const std::function<void()>& callback) {
|
146
|
-
static const auto method = _javaPart->getClass()->getMethod<void(jni::alias_ref<
|
147
|
-
method(_javaPart,
|
137
|
+
void JHybridNativePlatformSpec::registerImeListener(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) {
|
138
|
+
static const auto method = _javaPart->getClass()->getMethod<void(jni::alias_ref<JFunc_void_UnistylesNativeMiniRuntime::javaobject> /* callback */)>("registerImeListener");
|
139
|
+
method(_javaPart, JFunc_void_UnistylesNativeMiniRuntime::fromCpp(callback));
|
148
140
|
}
|
149
141
|
void JHybridNativePlatformSpec::unregisterPlatformListeners() {
|
150
142
|
static const auto method = _javaPart->getClass()->getMethod<void()>("unregisterPlatformListeners");
|
@@ -62,14 +62,12 @@ namespace margelo::nitro::unistyles {
|
|
62
62
|
Dimensions getNavigationBarDimensions() override;
|
63
63
|
bool getPrefersRtlDirection() override;
|
64
64
|
void setRootViewBackgroundColor(double color) override;
|
65
|
-
void setNavigationBarBackgroundColor(double color) override;
|
66
65
|
void setNavigationBarHidden(bool isHidden) override;
|
67
66
|
void setStatusBarHidden(bool isHidden) override;
|
68
|
-
void setStatusBarBackgroundColor(double color) override;
|
69
67
|
void setImmersiveMode(bool isEnabled) override;
|
70
68
|
UnistylesNativeMiniRuntime getMiniRuntime() override;
|
71
|
-
void registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */)>& callback) override;
|
72
|
-
void registerImeListener(const std::function<void()>& callback) override;
|
69
|
+
void registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) override;
|
70
|
+
void registerImeListener(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) override;
|
73
71
|
void unregisterPlatformListeners() override;
|
74
72
|
|
75
73
|
private:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
///
|
2
|
-
///
|
2
|
+
/// Func_void_UnistylesNativeMiniRuntime.kt
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
5
|
/// Copyright © 2024 Marc Rousavy @ Margelo
|
@@ -14,13 +14,13 @@ import com.margelo.nitro.core.*
|
|
14
14
|
import dalvik.annotation.optimization.FastNative
|
15
15
|
|
16
16
|
/**
|
17
|
-
* Represents the JavaScript callback `(
|
17
|
+
* Represents the JavaScript callback `(miniRuntime: struct) => void`.
|
18
18
|
* This is implemented in C++, via a `std::function<...>`.
|
19
19
|
*/
|
20
20
|
@DoNotStrip
|
21
21
|
@Keep
|
22
22
|
@Suppress("RedundantSuppression", "ConvertSecondaryConstructorToPrimary", "RedundantUnitReturnType", "KotlinJniMissingFunction", "ClassName", "unused")
|
23
|
-
class
|
23
|
+
class Func_void_UnistylesNativeMiniRuntime {
|
24
24
|
@DoNotStrip
|
25
25
|
@Keep
|
26
26
|
private val mHybridData: HybridData
|
@@ -35,12 +35,12 @@ class Func_void_std__vector_UnistyleDependency_ {
|
|
35
35
|
* Converts this function to a Kotlin Lambda.
|
36
36
|
* This exists purely as syntactic sugar, and has minimal runtime overhead.
|
37
37
|
*/
|
38
|
-
fun toLambda(): (
|
38
|
+
fun toLambda(): (miniRuntime: UnistylesNativeMiniRuntime) -> Unit = this::call
|
39
39
|
|
40
40
|
/**
|
41
41
|
* Call the given JS callback.
|
42
42
|
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
43
43
|
*/
|
44
44
|
@FastNative
|
45
|
-
external fun call(
|
45
|
+
external fun call(miniRuntime: UnistylesNativeMiniRuntime): Unit
|
46
46
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
///
|
2
|
-
///
|
2
|
+
/// Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
5
|
/// Copyright © 2024 Marc Rousavy @ Margelo
|
@@ -14,13 +14,13 @@ import com.margelo.nitro.core.*
|
|
14
14
|
import dalvik.annotation.optimization.FastNative
|
15
15
|
|
16
16
|
/**
|
17
|
-
* Represents the JavaScript callback `() => void`.
|
17
|
+
* Represents the JavaScript callback `(dependencies: array, miniRuntime: struct) => void`.
|
18
18
|
* This is implemented in C++, via a `std::function<...>`.
|
19
19
|
*/
|
20
20
|
@DoNotStrip
|
21
21
|
@Keep
|
22
22
|
@Suppress("RedundantSuppression", "ConvertSecondaryConstructorToPrimary", "RedundantUnitReturnType", "KotlinJniMissingFunction", "ClassName", "unused")
|
23
|
-
class
|
23
|
+
class Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime {
|
24
24
|
@DoNotStrip
|
25
25
|
@Keep
|
26
26
|
private val mHybridData: HybridData
|
@@ -35,12 +35,12 @@ class Func_void {
|
|
35
35
|
* Converts this function to a Kotlin Lambda.
|
36
36
|
* This exists purely as syntactic sugar, and has minimal runtime overhead.
|
37
37
|
*/
|
38
|
-
fun toLambda(): () -> Unit = this::call
|
38
|
+
fun toLambda(): (dependencies: Array<UnistyleDependency>, miniRuntime: UnistylesNativeMiniRuntime) -> Unit = this::call
|
39
39
|
|
40
40
|
/**
|
41
41
|
* Call the given JS callback.
|
42
42
|
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
43
43
|
*/
|
44
44
|
@FastNative
|
45
|
-
external fun call(): Unit
|
45
|
+
external fun call(dependencies: Array<UnistyleDependency>, miniRuntime: UnistylesNativeMiniRuntime): Unit
|
46
46
|
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt
CHANGED
@@ -85,10 +85,6 @@ abstract class HybridNativePlatformSpec: HybridObject() {
|
|
85
85
|
@Keep
|
86
86
|
abstract fun setRootViewBackgroundColor(color: Double): Unit
|
87
87
|
|
88
|
-
@DoNotStrip
|
89
|
-
@Keep
|
90
|
-
abstract fun setNavigationBarBackgroundColor(color: Double): Unit
|
91
|
-
|
92
88
|
@DoNotStrip
|
93
89
|
@Keep
|
94
90
|
abstract fun setNavigationBarHidden(isHidden: Boolean): Unit
|
@@ -97,10 +93,6 @@ abstract class HybridNativePlatformSpec: HybridObject() {
|
|
97
93
|
@Keep
|
98
94
|
abstract fun setStatusBarHidden(isHidden: Boolean): Unit
|
99
95
|
|
100
|
-
@DoNotStrip
|
101
|
-
@Keep
|
102
|
-
abstract fun setStatusBarBackgroundColor(color: Double): Unit
|
103
|
-
|
104
96
|
@DoNotStrip
|
105
97
|
@Keep
|
106
98
|
abstract fun setImmersiveMode(isEnabled: Boolean): Unit
|
@@ -111,22 +103,22 @@ abstract class HybridNativePlatformSpec: HybridObject() {
|
|
111
103
|
|
112
104
|
@DoNotStrip
|
113
105
|
@Keep
|
114
|
-
abstract fun registerPlatformListener(callback: (dependencies: Array<UnistyleDependency
|
106
|
+
abstract fun registerPlatformListener(callback: (dependencies: Array<UnistyleDependency>, miniRuntime: UnistylesNativeMiniRuntime) -> Unit): Unit
|
115
107
|
|
116
108
|
@DoNotStrip
|
117
109
|
@Keep
|
118
|
-
private fun registerPlatformListener(callback:
|
110
|
+
private fun registerPlatformListener(callback: Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime): Unit {
|
119
111
|
val __result = registerPlatformListener(callback.toLambda())
|
120
112
|
return __result
|
121
113
|
}
|
122
114
|
|
123
115
|
@DoNotStrip
|
124
116
|
@Keep
|
125
|
-
abstract fun registerImeListener(callback: () -> Unit): Unit
|
117
|
+
abstract fun registerImeListener(callback: (miniRuntime: UnistylesNativeMiniRuntime) -> Unit): Unit
|
126
118
|
|
127
119
|
@DoNotStrip
|
128
120
|
@Keep
|
129
|
-
private fun registerImeListener(callback:
|
121
|
+
private fun registerImeListener(callback: Func_void_UnistylesNativeMiniRuntime): Unit {
|
130
122
|
val __result = registerImeListener(callback.toLambda())
|
131
123
|
return __result
|
132
124
|
}
|
@@ -12,8 +12,8 @@
|
|
12
12
|
#include <NitroModules/HybridObjectRegistry.hpp>
|
13
13
|
|
14
14
|
#include "JHybridNativePlatformSpec.hpp"
|
15
|
-
#include "
|
16
|
-
#include "
|
15
|
+
#include "JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp"
|
16
|
+
#include "JFunc_void_UnistylesNativeMiniRuntime.hpp"
|
17
17
|
|
18
18
|
namespace margelo::nitro::unistyles {
|
19
19
|
|
@@ -25,8 +25,8 @@ int initialize(JavaVM* vm) {
|
|
25
25
|
return facebook::jni::initialize(vm, [] {
|
26
26
|
// Register native JNI methods
|
27
27
|
margelo::nitro::unistyles::JHybridNativePlatformSpec::registerNatives();
|
28
|
-
margelo::nitro::unistyles::
|
29
|
-
margelo::nitro::unistyles::
|
28
|
+
margelo::nitro::unistyles::JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::registerNatives();
|
29
|
+
margelo::nitro::unistyles::JFunc_void_UnistylesNativeMiniRuntime::registerNatives();
|
30
30
|
|
31
31
|
// Register Nitro Hybrid Objects
|
32
32
|
|
@@ -8,20 +8,33 @@
|
|
8
8
|
#pragma once
|
9
9
|
|
10
10
|
// Forward declarations of C++ defined types
|
11
|
+
// Forward declaration of `ColorScheme` to properly resolve imports.
|
12
|
+
namespace margelo::nitro::unistyles { enum class ColorScheme; }
|
13
|
+
// Forward declaration of `Dimensions` to properly resolve imports.
|
14
|
+
namespace margelo::nitro::unistyles { struct Dimensions; }
|
11
15
|
// Forward declaration of `HybridNativePlatformSpec` to properly resolve imports.
|
12
16
|
namespace margelo::nitro::unistyles { class HybridNativePlatformSpec; }
|
17
|
+
// Forward declaration of `Insets` to properly resolve imports.
|
18
|
+
namespace margelo::nitro::unistyles { struct Insets; }
|
13
19
|
// Forward declaration of `UnistyleDependency` to properly resolve imports.
|
14
20
|
namespace margelo::nitro::unistyles { enum class UnistyleDependency; }
|
21
|
+
// Forward declaration of `UnistylesNativeMiniRuntime` to properly resolve imports.
|
22
|
+
namespace margelo::nitro::unistyles { struct UnistylesNativeMiniRuntime; }
|
15
23
|
|
16
24
|
// Forward declarations of Swift defined types
|
17
25
|
// Forward declaration of `HybridNativePlatformSpecCxx` to properly resolve imports.
|
18
26
|
namespace Unistyles { class HybridNativePlatformSpecCxx; }
|
19
27
|
|
20
28
|
// Include C++ defined types
|
29
|
+
#include "ColorScheme.hpp"
|
30
|
+
#include "Dimensions.hpp"
|
21
31
|
#include "HybridNativePlatformSpec.hpp"
|
32
|
+
#include "Insets.hpp"
|
22
33
|
#include "UnistyleDependency.hpp"
|
34
|
+
#include "UnistylesNativeMiniRuntime.hpp"
|
23
35
|
#include <functional>
|
24
36
|
#include <memory>
|
37
|
+
#include <string>
|
25
38
|
#include <vector>
|
26
39
|
|
27
40
|
/**
|
@@ -41,60 +54,60 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
41
54
|
return vector;
|
42
55
|
}
|
43
56
|
|
44
|
-
// pragma MARK: std::function<void(const std::vector<UnistyleDependency>& /* dependencies */)>
|
57
|
+
// pragma MARK: std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>
|
45
58
|
/**
|
46
|
-
* Specialized version of `std::function<void(const std::vector<UnistyleDependency
|
59
|
+
* Specialized version of `std::function<void(const std::vector<UnistyleDependency>&, const UnistylesNativeMiniRuntime&)>`.
|
47
60
|
*/
|
48
|
-
using
|
61
|
+
using Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime = std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>;
|
49
62
|
/**
|
50
|
-
* Wrapper class for a `std::function<void(const std::vector<UnistyleDependency>& / * dependencies * /)>`, this can be used from Swift.
|
63
|
+
* Wrapper class for a `std::function<void(const std::vector<UnistyleDependency>& / * dependencies * /, const UnistylesNativeMiniRuntime& / * miniRuntime * /)>`, this can be used from Swift.
|
51
64
|
*/
|
52
|
-
class
|
65
|
+
class Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper final {
|
53
66
|
public:
|
54
|
-
explicit
|
55
|
-
explicit
|
56
|
-
inline void call(std::vector<UnistyleDependency> dependencies) const {
|
57
|
-
_function(dependencies);
|
67
|
+
explicit Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& func): _function(func) {}
|
68
|
+
explicit Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::move(func)) {}
|
69
|
+
inline void call(std::vector<UnistyleDependency> dependencies, UnistylesNativeMiniRuntime miniRuntime) const {
|
70
|
+
_function(dependencies, miniRuntime);
|
58
71
|
}
|
59
72
|
private:
|
60
|
-
std::function<void(const std::vector<UnistyleDependency>& /* dependencies */)> _function;
|
73
|
+
std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)> _function;
|
61
74
|
};
|
62
|
-
inline
|
75
|
+
inline Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime create_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(void* _Nonnull closureHolder, void(* _Nonnull call)(void* _Nonnull /* closureHolder */, std::vector<UnistyleDependency>, UnistylesNativeMiniRuntime), void(* _Nonnull destroy)(void* _Nonnull)) {
|
63
76
|
std::shared_ptr<void> sharedClosureHolder(closureHolder, destroy);
|
64
|
-
return
|
65
|
-
call(sharedClosureHolder.get(), dependencies);
|
77
|
+
return Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime([sharedClosureHolder, call](const std::vector<UnistyleDependency>& dependencies, const UnistylesNativeMiniRuntime& miniRuntime) -> void {
|
78
|
+
call(sharedClosureHolder.get(), dependencies, miniRuntime);
|
66
79
|
});
|
67
80
|
}
|
68
|
-
inline std::shared_ptr<
|
69
|
-
return std::make_shared<
|
81
|
+
inline std::shared_ptr<Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper> share_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(const Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime& value) {
|
82
|
+
return std::make_shared<Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper>(value);
|
70
83
|
}
|
71
84
|
|
72
|
-
// pragma MARK: std::function<void()>
|
85
|
+
// pragma MARK: std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>
|
73
86
|
/**
|
74
|
-
* Specialized version of `std::function<void()>`.
|
87
|
+
* Specialized version of `std::function<void(const UnistylesNativeMiniRuntime&)>`.
|
75
88
|
*/
|
76
|
-
using
|
89
|
+
using Func_void_UnistylesNativeMiniRuntime = std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>;
|
77
90
|
/**
|
78
|
-
* Wrapper class for a `std::function<void()>`, this can be used from Swift.
|
91
|
+
* Wrapper class for a `std::function<void(const UnistylesNativeMiniRuntime& / * miniRuntime * /)>`, this can be used from Swift.
|
79
92
|
*/
|
80
|
-
class
|
93
|
+
class Func_void_UnistylesNativeMiniRuntime_Wrapper final {
|
81
94
|
public:
|
82
|
-
explicit
|
83
|
-
explicit
|
84
|
-
inline void call() const {
|
85
|
-
_function();
|
95
|
+
explicit Func_void_UnistylesNativeMiniRuntime_Wrapper(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& func): _function(func) {}
|
96
|
+
explicit Func_void_UnistylesNativeMiniRuntime_Wrapper(std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::move(func)) {}
|
97
|
+
inline void call(UnistylesNativeMiniRuntime miniRuntime) const {
|
98
|
+
_function(miniRuntime);
|
86
99
|
}
|
87
100
|
private:
|
88
|
-
std::function<void()> _function;
|
101
|
+
std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)> _function;
|
89
102
|
};
|
90
|
-
inline
|
103
|
+
inline Func_void_UnistylesNativeMiniRuntime create_Func_void_UnistylesNativeMiniRuntime(void* _Nonnull closureHolder, void(* _Nonnull call)(void* _Nonnull /* closureHolder */, UnistylesNativeMiniRuntime), void(* _Nonnull destroy)(void* _Nonnull)) {
|
91
104
|
std::shared_ptr<void> sharedClosureHolder(closureHolder, destroy);
|
92
|
-
return
|
93
|
-
call(sharedClosureHolder.get());
|
105
|
+
return Func_void_UnistylesNativeMiniRuntime([sharedClosureHolder, call](const UnistylesNativeMiniRuntime& miniRuntime) -> void {
|
106
|
+
call(sharedClosureHolder.get(), miniRuntime);
|
94
107
|
});
|
95
108
|
}
|
96
|
-
inline std::shared_ptr<
|
97
|
-
return std::make_shared<
|
109
|
+
inline std::shared_ptr<Func_void_UnistylesNativeMiniRuntime_Wrapper> share_Func_void_UnistylesNativeMiniRuntime(const Func_void_UnistylesNativeMiniRuntime& value) {
|
110
|
+
return std::make_shared<Func_void_UnistylesNativeMiniRuntime_Wrapper>(value);
|
98
111
|
}
|
99
112
|
|
100
113
|
// pragma MARK: std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
|
@@ -121,18 +121,12 @@ namespace margelo::nitro::unistyles {
|
|
121
121
|
inline void setRootViewBackgroundColor(double color) override {
|
122
122
|
_swiftPart.setRootViewBackgroundColor(std::forward<decltype(color)>(color));
|
123
123
|
}
|
124
|
-
inline void setNavigationBarBackgroundColor(double color) override {
|
125
|
-
_swiftPart.setNavigationBarBackgroundColor(std::forward<decltype(color)>(color));
|
126
|
-
}
|
127
124
|
inline void setNavigationBarHidden(bool isHidden) override {
|
128
125
|
_swiftPart.setNavigationBarHidden(std::forward<decltype(isHidden)>(isHidden));
|
129
126
|
}
|
130
127
|
inline void setStatusBarHidden(bool isHidden) override {
|
131
128
|
_swiftPart.setStatusBarHidden(std::forward<decltype(isHidden)>(isHidden));
|
132
129
|
}
|
133
|
-
inline void setStatusBarBackgroundColor(double color) override {
|
134
|
-
_swiftPart.setStatusBarBackgroundColor(std::forward<decltype(color)>(color));
|
135
|
-
}
|
136
130
|
inline void setImmersiveMode(bool isEnabled) override {
|
137
131
|
_swiftPart.setImmersiveMode(std::forward<decltype(isEnabled)>(isEnabled));
|
138
132
|
}
|
@@ -140,10 +134,10 @@ namespace margelo::nitro::unistyles {
|
|
140
134
|
auto __result = _swiftPart.getMiniRuntime();
|
141
135
|
return __result;
|
142
136
|
}
|
143
|
-
inline void registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */)>& callback) override {
|
137
|
+
inline void registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) override {
|
144
138
|
_swiftPart.registerPlatformListener(callback);
|
145
139
|
}
|
146
|
-
inline void registerImeListener(const std::function<void()>& callback) override {
|
140
|
+
inline void registerImeListener(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) override {
|
147
141
|
_swiftPart.registerImeListener(callback);
|
148
142
|
}
|
149
143
|
inline void unregisterPlatformListeners() override {
|
@@ -43,13 +43,11 @@ public protocol HybridNativePlatformSpec: AnyObject, HybridObjectSpec {
|
|
43
43
|
func getNavigationBarDimensions() throws -> Dimensions
|
44
44
|
func getPrefersRtlDirection() throws -> Bool
|
45
45
|
func setRootViewBackgroundColor(color: Double) throws -> Void
|
46
|
-
func setNavigationBarBackgroundColor(color: Double) throws -> Void
|
47
46
|
func setNavigationBarHidden(isHidden: Bool) throws -> Void
|
48
47
|
func setStatusBarHidden(isHidden: Bool) throws -> Void
|
49
|
-
func setStatusBarBackgroundColor(color: Double) throws -> Void
|
50
48
|
func setImmersiveMode(isEnabled: Bool) throws -> Void
|
51
49
|
func getMiniRuntime() throws -> UnistylesNativeMiniRuntime
|
52
|
-
func registerPlatformListener(callback: @escaping ((_ dependencies: [UnistyleDependency]) -> Void)) throws -> Void
|
53
|
-
func registerImeListener(callback: @escaping (() -> Void)) throws -> Void
|
50
|
+
func registerPlatformListener(callback: @escaping ((_ dependencies: [UnistyleDependency], _ miniRuntime: UnistylesNativeMiniRuntime) -> Void)) throws -> Void
|
51
|
+
func registerImeListener(callback: @escaping ((_ miniRuntime: UnistylesNativeMiniRuntime) -> Void)) throws -> Void
|
54
52
|
func unregisterPlatformListeners() throws -> Void
|
55
53
|
}
|