@react-native-vector-icons/common 12.0.1 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -35
- package/lib/commonjs/create-icon-set.js +11 -52
- package/lib/commonjs/create-icon-set.js.map +1 -1
- package/lib/commonjs/create-icon-source-cache.js +0 -2
- package/lib/commonjs/create-icon-source-cache.js.map +1 -1
- package/lib/commonjs/defaults.js +9 -0
- package/lib/commonjs/defaults.js.map +1 -0
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js +1 -1
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js.map +1 -1
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js +8 -1
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js.map +1 -1
- package/lib/commonjs/get-image-library.js +25 -5
- package/lib/commonjs/get-image-library.js.map +1 -1
- package/lib/commonjs/get-image-source.js +58 -0
- package/lib/commonjs/get-image-source.js.map +1 -0
- package/lib/commonjs/index.js +3 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/scripts/common.js.map +1 -1
- package/lib/commonjs/scripts/updatePlist.js.map +1 -1
- package/lib/module/create-icon-set.js +10 -51
- package/lib/module/create-icon-set.js.map +1 -1
- package/lib/module/create-icon-source-cache.js +0 -2
- package/lib/module/create-icon-source-cache.js.map +1 -1
- package/lib/module/defaults.js +5 -0
- package/lib/module/defaults.js.map +1 -0
- package/lib/module/dynamicLoading/dynamic-font-loading.js +2 -1
- package/lib/module/dynamicLoading/dynamic-font-loading.js.map +1 -1
- package/lib/module/dynamicLoading/dynamic-loading-setting.js +5 -0
- package/lib/module/dynamicLoading/dynamic-loading-setting.js.map +1 -1
- package/lib/module/get-image-library.js +26 -5
- package/lib/module/get-image-library.js.map +1 -1
- package/lib/module/get-image-source.js +52 -0
- package/lib/module/get-image-source.js.map +1 -0
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/scripts/common.js.map +1 -1
- package/lib/module/scripts/updatePlist.js.map +1 -1
- package/lib/typescript/commonjs/src/create-icon-set.d.ts +0 -2
- package/lib/typescript/commonjs/src/create-icon-set.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/create-icon-source-cache.d.ts +0 -1
- package/lib/typescript/commonjs/src/create-icon-source-cache.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/defaults.d.ts +3 -0
- package/lib/typescript/commonjs/src/defaults.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts +15 -0
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/get-image-library.d.ts +4 -1
- package/lib/typescript/commonjs/src/get-image-library.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/get-image-source.d.ts +11 -0
- package/lib/typescript/commonjs/src/get-image-source.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +4 -3
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/scripts/common.d.ts.map +1 -1
- package/lib/typescript/module/src/create-icon-set.d.ts +0 -2
- package/lib/typescript/module/src/create-icon-set.d.ts.map +1 -1
- package/lib/typescript/module/src/create-icon-source-cache.d.ts +0 -1
- package/lib/typescript/module/src/create-icon-source-cache.d.ts.map +1 -1
- package/lib/typescript/module/src/defaults.d.ts +3 -0
- package/lib/typescript/module/src/defaults.d.ts.map +1 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-font-loading.d.ts.map +1 -1
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts +15 -0
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -1
- package/lib/typescript/module/src/get-image-library.d.ts +4 -1
- package/lib/typescript/module/src/get-image-library.d.ts.map +1 -1
- package/lib/typescript/module/src/get-image-source.d.ts +11 -0
- package/lib/typescript/module/src/get-image-source.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -3
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/scripts/common.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/create-icon-set.tsx +16 -69
- package/src/create-icon-source-cache.ts +1 -3
- package/src/defaults.ts +2 -0
- package/src/dynamicLoading/dynamic-font-loading.ts +3 -1
- package/src/dynamicLoading/dynamic-loading-setting.ts +24 -5
- package/src/get-image-library.ts +30 -9
- package/src/get-image-source.ts +74 -0
- package/src/index.ts +4 -3
- package/src/scripts/common.ts +1 -0
- package/src/scripts/updatePlist.ts +1 -0
- package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeVectorIconsSpec.java +0 -42
- package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/generated/android/app/build/generated/source/codegen/jni/RNVectorIconsSpec-generated.cpp +0 -38
- package/android/generated/android/app/build/generated/source/codegen/jni/RNVectorIconsSpec.h +0 -31
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.cpp +0 -22
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h +0 -24
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.cpp +0 -16
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.h +0 -17
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/Props.cpp +0 -19
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/Props.h +0 -18
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI-generated.cpp +0 -40
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI.h +0 -76
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.cpp +0 -17
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.h +0 -23
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/States.cpp +0 -16
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/States.h +0 -19
- package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +0 -2321
- package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +0 -2761
- package/ios/generated/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +0 -2929
- package/ios/generated/build/generated/ios/FBReactNativeSpecJSI.h +0 -7727
- package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +0 -33
- package/ios/generated/build/generated/ios/RNVectorIconsSpec/RNVectorIconsSpec-generated.mm +0 -46
- package/ios/generated/build/generated/ios/RNVectorIconsSpec/RNVectorIconsSpec.h +0 -68
- package/ios/generated/build/generated/ios/RNVectorIconsSpecJSI-generated.cpp +0 -40
- package/ios/generated/build/generated/ios/RNVectorIconsSpecJSI.h +0 -76
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.cpp +0 -22
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h +0 -24
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/EventEmitters.cpp +0 -16
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/EventEmitters.h +0 -17
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/Props.cpp +0 -19
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/Props.h +0 -18
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/RCTComponentViewHelpers.h +0 -18
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ShadowNodes.cpp +0 -17
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ShadowNodes.h +0 -23
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/States.cpp +0 -16
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/States.h +0 -19
|
@@ -6,11 +6,19 @@ type ExpoFontLoaderModule = {
|
|
|
6
6
|
getLoadedFonts: () => string[];
|
|
7
7
|
loadAsync: (fontFamilyAlias: string, fileUri: string) => Promise<void>;
|
|
8
8
|
};
|
|
9
|
+
type ExpoFontUtilsModule = {
|
|
10
|
+
renderToImageAsync: (glyph: string, options: {
|
|
11
|
+
fontFamily?: string;
|
|
12
|
+
size?: number;
|
|
13
|
+
color?: number;
|
|
14
|
+
}) => Promise<string>;
|
|
15
|
+
};
|
|
9
16
|
declare global {
|
|
10
17
|
interface ExpoGlobal {
|
|
11
18
|
modules: {
|
|
12
19
|
ExpoAsset?: ExpoAssetModule;
|
|
13
20
|
ExpoFontLoader?: ExpoFontLoaderModule;
|
|
21
|
+
ExpoFontUtils?: ExpoFontUtilsModule;
|
|
14
22
|
};
|
|
15
23
|
}
|
|
16
24
|
var expo: ExpoGlobal | undefined;
|
|
@@ -21,6 +29,13 @@ type ExpoGlobalType = {
|
|
|
21
29
|
ExpoFontLoader: ExpoFontLoaderModule;
|
|
22
30
|
};
|
|
23
31
|
};
|
|
32
|
+
export declare function getIsRenderToImageSupported(globalObj: any): globalObj is {
|
|
33
|
+
expo: {
|
|
34
|
+
modules: {
|
|
35
|
+
ExpoFontUtils: ExpoFontUtilsModule;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
24
39
|
export declare function assertExpoModulesPresent(globalObj: unknown): asserts globalObj is {
|
|
25
40
|
expo: ExpoGlobalType;
|
|
26
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-loading-setting.d.ts","sourceRoot":"","sources":["../../../../../src/dynamicLoading/dynamic-loading-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,eAAe,GAAG;IAGrB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACzF,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAG1B,cAAc,EAAE,MAAM,MAAM,EAAE,CAAC;IAC/B,SAAS,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB,OAAO,EAAE;YACP,SAAS,CAAC,EAAE,eAAe,CAAC;YAC5B,cAAc,CAAC,EAAE,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"dynamic-loading-setting.d.ts","sourceRoot":"","sources":["../../../../../src/dynamicLoading/dynamic-loading-setting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,eAAe,GAAG;IAGrB,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACzF,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAG1B,cAAc,EAAE,MAAM,MAAM,EAAE,CAAC;IAC/B,SAAS,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,kBAAkB,EAAE,CAClB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,KACE,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB,OAAO,EAAE;YACP,SAAS,CAAC,EAAE,eAAe,CAAC;YAC5B,cAAc,CAAC,EAAE,oBAAoB,CAAC;YACtC,aAAa,CAAC,EAAE,mBAAmB,CAAC;SACrC,CAAC;KACH;IAGD,IAAI,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;CAClC;AAED,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE;QACP,SAAS,EAAE,eAAe,CAAC;QAC3B,cAAc,EAAE,oBAAoB,CAAC;KACtC,CAAC;CACH,CAAC;AAeF,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI;IACxE,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,aAAa,EAAE,mBAAmB,CAAC;SACpC,CAAC;KACH,CAAC;CACH,CAEA;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,IAAI;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAI1G;AAQD,eAAO,MAAM,yBAAyB,eAAiC,CAAC;AAExE;;;;;;;KAOK;AACL,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,OAczD,CAAC;AAEF;;KAEK;AACL,eAAO,MAAM,uBAAuB,eAAkC,CAAC;AAEvE,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,KAAK,IAAI,CAAC;AAIlG;;KAEK;AACL,eAAO,MAAM,8BAA8B,GAAI,UAAU,aAAa,SAErE,CAAC;AAEF,eAAO,MAAM,gBAAgB,iCAAoC,CAAC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export declare const ensureGetImageAvailable: () => typeof import("@react-native-vector-icons/get-image")
|
|
1
|
+
export declare const ensureGetImageAvailable: () => typeof import("@react-native-vector-icons/get-image") | {
|
|
2
|
+
getImageForFont: (fontReference: string, glyph: string, size: number, color: number) => Promise<string>;
|
|
3
|
+
getImageForFontSync: () => never;
|
|
4
|
+
};
|
|
2
5
|
//# sourceMappingURL=get-image-library.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-image-library.d.ts","sourceRoot":"","sources":["../../../../src/get-image-library.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-image-library.d.ts","sourceRoot":"","sources":["../../../../src/get-image-library.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,uBAAuB;qCAQS,MAAM,SAAS,MAAM,QAAQ,MAAM,SAAS,MAAM;;CAgB9F,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
import type createIconSourceCache from './create-icon-source-cache';
|
|
3
|
+
export declare const getImageSourceSync: (imageSourceCache: ReturnType<typeof createIconSourceCache>, fontReference: string, glyph: string, size?: number, color?: TextStyle["color"]) => {
|
|
4
|
+
uri: string;
|
|
5
|
+
scale: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const getImageSource: (imageSourceCache: ReturnType<typeof createIconSourceCache>, fontReference: string, glyph: string, size?: number, color?: TextStyle["color"]) => Promise<{
|
|
8
|
+
uri: string;
|
|
9
|
+
scale: number;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=get-image-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-image-source.d.ts","sourceRoot":"","sources":["../../../../src/get-image-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,KAAK,qBAAqB,MAAM,4BAA4B,CAAC;AAIpE,eAAO,MAAM,kBAAkB,GAC7B,kBAAkB,UAAU,CAAC,OAAO,qBAAqB,CAAC,EAC1D,eAAe,MAAM,EACrB,OAAO,MAAM,EACb,aAAwB,EACxB,QAAO,SAAS,CAAC,OAAO,CAAsB;;;CA2B/C,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,kBAAkB,UAAU,CAAC,OAAO,qBAAqB,CAAC,EAC1D,eAAe,MAAM,EACrB,OAAO,MAAM,EACb,aAAwB,EACxB,QAAO,SAAS,CAAC,OAAO,CAAsB;;;EA2B/C,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
1
|
+
export type { CreateIconSetOptions, IconProps } from './create-icon-set';
|
|
2
|
+
export { createIconSet } from './create-icon-set';
|
|
3
|
+
export { DEFAULT_ICON_COLOR, DEFAULT_ICON_SIZE } from './defaults';
|
|
4
|
+
export { isDynamicLoadingEnabled, isDynamicLoadingSupported, setDynamicLoadingEnabled, setDynamicLoadingErrorCallback, } from './dynamicLoading/dynamic-loading-setting';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,0CAA0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/common.ts"],"names":[],"mappings":"AA8CA,eAAO,MAAM,YAAY,GAAI,qBAAqB,MAAM,aAMvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-vector-icons/common",
|
|
3
|
-
"version": "12.0
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "Customizable Icons for React Native with support for image source and full styling.",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/plist": "^3.0.5",
|
|
79
|
-
"@types/react": "^
|
|
79
|
+
"@types/react": "^19.0.12",
|
|
80
80
|
"del-cli": "^6.0.0",
|
|
81
81
|
"onchange": "^7.1.0",
|
|
82
82
|
"react-native-builder-bob": "^0.35.2",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"react": "*",
|
|
87
87
|
"react-native": "*",
|
|
88
|
-
"@react-native-vector-icons/get-image": "^12.0
|
|
88
|
+
"@react-native-vector-icons/get-image": "^12.1.0"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
91
91
|
"@react-native-vector-icons/get-image": {
|
package/src/create-icon-set.tsx
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
import React, { forwardRef, type Ref, useEffect } from 'react';
|
|
3
|
-
|
|
4
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
|
-
import {
|
|
4
|
+
import { Platform, Text, type TextProps, type TextStyle } from 'react-native';
|
|
6
5
|
|
|
7
6
|
import createIconSourceCache from './create-icon-source-cache';
|
|
7
|
+
import { DEFAULT_ICON_COLOR, DEFAULT_ICON_SIZE } from './defaults';
|
|
8
8
|
import { dynamicLoader } from './dynamicLoading/dynamic-font-loading';
|
|
9
9
|
import { isDynamicLoadingEnabled } from './dynamicLoading/dynamic-loading-setting';
|
|
10
10
|
import type { FontSource } from './dynamicLoading/types';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
export const DEFAULT_ICON_SIZE = 12;
|
|
14
|
-
export const DEFAULT_ICON_COLOR = 'black';
|
|
11
|
+
import { getImageSource as getImageSourceImpl, getImageSourceSync as getImageSourceSyncImpl } from './get-image-source';
|
|
15
12
|
|
|
16
13
|
type ValueData = { uri: string; scale: number };
|
|
17
14
|
type GetImageSourceSyncIconFunc<GM> = (name: GM, size?: number, color?: TextStyle['color']) => ValueData | undefined;
|
|
@@ -65,7 +62,11 @@ export function createIconSet<GM extends Record<string, number>>(
|
|
|
65
62
|
): IconComponent<GM> {
|
|
66
63
|
const { postScriptName, fontFileName, fontStyle } =
|
|
67
64
|
typeof postScriptNameOrOptions === 'string'
|
|
68
|
-
? {
|
|
65
|
+
? {
|
|
66
|
+
postScriptName: postScriptNameOrOptions,
|
|
67
|
+
fontFileName: fontFileNameParam,
|
|
68
|
+
fontStyle: fontStyleParam,
|
|
69
|
+
}
|
|
69
70
|
: postScriptNameOrOptions;
|
|
70
71
|
|
|
71
72
|
const fontBasename = fontFileName ? fontFileName.replace(/\.(otf|ttf)$/, '') : postScriptName;
|
|
@@ -83,13 +84,13 @@ export function createIconSet<GM extends Record<string, number>>(
|
|
|
83
84
|
};
|
|
84
85
|
|
|
85
86
|
const resolveGlyph = (name: keyof GM) => {
|
|
86
|
-
const glyph = glyphMap[name]
|
|
87
|
+
const glyph = glyphMap[name];
|
|
87
88
|
|
|
88
89
|
if (typeof glyph === 'number') {
|
|
89
90
|
return String.fromCodePoint(glyph);
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
return
|
|
93
|
+
return '?';
|
|
93
94
|
};
|
|
94
95
|
|
|
95
96
|
const Icon = ({
|
|
@@ -153,69 +154,15 @@ export function createIconSet<GM extends Record<string, number>>(
|
|
|
153
154
|
|
|
154
155
|
const imageSourceCache = createIconSourceCache();
|
|
155
156
|
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
color: TextStyle['color'] = DEFAULT_ICON_COLOR,
|
|
160
|
-
) => {
|
|
161
|
-
const NativeIconAPI = ensureGetImageAvailable();
|
|
162
|
-
|
|
163
|
-
const glyph = resolveGlyph(name);
|
|
164
|
-
const processedColor = processColor(color);
|
|
165
|
-
const cacheKey = `${glyph}:${size}:${String(processedColor)}`;
|
|
166
|
-
|
|
167
|
-
if (imageSourceCache.has(cacheKey)) {
|
|
168
|
-
// FIXME: Should this check if it's an error and throw it again?
|
|
169
|
-
return imageSourceCache.get(cacheKey);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
try {
|
|
173
|
-
const imagePath = NativeIconAPI.getImageForFontSync(
|
|
174
|
-
fontReference,
|
|
175
|
-
glyph,
|
|
176
|
-
size,
|
|
177
|
-
processedColor as number, // FIXME what if a non existant colour was passed in?
|
|
178
|
-
);
|
|
179
|
-
const value = { uri: imagePath, scale: PixelRatio.get() };
|
|
180
|
-
imageSourceCache.setValue(cacheKey, value);
|
|
181
|
-
return value;
|
|
182
|
-
} catch (error) {
|
|
183
|
-
imageSourceCache.setError(cacheKey, error as Error);
|
|
184
|
-
throw error;
|
|
157
|
+
const getImageSource: GetImageSourceIconFunc<keyof GM> = async (name, size, color) => {
|
|
158
|
+
if (typeof postScriptNameOrOptions === 'object' && typeof postScriptNameOrOptions.fontSource !== 'undefined') {
|
|
159
|
+
await dynamicLoader.loadFontAsync(fontReference, postScriptNameOrOptions.fontSource);
|
|
185
160
|
}
|
|
161
|
+
return getImageSourceImpl(imageSourceCache, fontReference, resolveGlyph(name), size, color);
|
|
186
162
|
};
|
|
187
163
|
|
|
188
|
-
const
|
|
189
|
-
name
|
|
190
|
-
size = DEFAULT_ICON_SIZE,
|
|
191
|
-
color: TextStyle['color'] = DEFAULT_ICON_COLOR,
|
|
192
|
-
) => {
|
|
193
|
-
const NativeIconAPI = ensureGetImageAvailable();
|
|
194
|
-
|
|
195
|
-
const glyph = resolveGlyph(name);
|
|
196
|
-
const processedColor = processColor(color);
|
|
197
|
-
const cacheKey = `${glyph}:${size}:${String(processedColor)}`;
|
|
198
|
-
|
|
199
|
-
if (imageSourceCache.has(cacheKey)) {
|
|
200
|
-
// FIXME: Should this check if it's an error and throw it again?
|
|
201
|
-
return imageSourceCache.get(cacheKey);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
try {
|
|
205
|
-
const imagePath = await NativeIconAPI.getImageForFont(
|
|
206
|
-
fontReference,
|
|
207
|
-
glyph,
|
|
208
|
-
size,
|
|
209
|
-
processedColor as number, // FIXME what if a non existant colour was passed in?
|
|
210
|
-
);
|
|
211
|
-
const value = { uri: imagePath, scale: PixelRatio.get() };
|
|
212
|
-
imageSourceCache.setValue(cacheKey, value);
|
|
213
|
-
return value;
|
|
214
|
-
} catch (error) {
|
|
215
|
-
imageSourceCache.setError(cacheKey, error as Error);
|
|
216
|
-
throw error;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
164
|
+
const getImageSourceSync: GetImageSourceSyncIconFunc<keyof GM> = (name, size, color) =>
|
|
165
|
+
getImageSourceSyncImpl(imageSourceCache, fontReference, resolveGlyph(name), size, color);
|
|
219
166
|
|
|
220
167
|
const IconNamespace = Object.assign(WrappedIcon, {
|
|
221
168
|
getImageSource,
|
|
@@ -12,8 +12,6 @@ export default function createIconSourceCache() {
|
|
|
12
12
|
|
|
13
13
|
const setError = (key: string, error: Error) => cache.set(key, { type: TYPE_ERROR, data: error });
|
|
14
14
|
|
|
15
|
-
const has = (key: string) => cache.has(key);
|
|
16
|
-
|
|
17
15
|
const get = (key: string) => {
|
|
18
16
|
const value = cache.get(key);
|
|
19
17
|
if (!value) {
|
|
@@ -27,5 +25,5 @@ export default function createIconSourceCache() {
|
|
|
27
25
|
return data;
|
|
28
26
|
};
|
|
29
27
|
|
|
30
|
-
return { setValue, setError,
|
|
28
|
+
return { setValue, setError, get };
|
|
31
29
|
}
|
package/src/defaults.ts
ADDED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Image } from 'react-native';
|
|
2
|
+
|
|
1
3
|
/*
|
|
2
4
|
* The following imports are always present when react native is installed
|
|
3
5
|
* in the future, more explicit apis will be exposed by the core, including typings
|
|
@@ -5,7 +7,7 @@
|
|
|
5
7
|
// @ts-expect-error missing types
|
|
6
8
|
// eslint-disable-next-line import/no-extraneous-dependencies,import/no-unresolved
|
|
7
9
|
import { getAssetByID } from '@react-native/assets-registry/registry';
|
|
8
|
-
|
|
10
|
+
|
|
9
11
|
import { assertExpoModulesPresent, getErrorCallback } from './dynamic-loading-setting';
|
|
10
12
|
import type { DynamicLoader, FontSource } from './types';
|
|
11
13
|
|
|
@@ -13,11 +13,23 @@ type ExpoFontLoaderModule = {
|
|
|
13
13
|
loadAsync: (fontFamilyAlias: string, fileUri: string) => Promise<void>;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
type ExpoFontUtilsModule = {
|
|
17
|
+
renderToImageAsync: (
|
|
18
|
+
glyph: string,
|
|
19
|
+
options: {
|
|
20
|
+
fontFamily?: string;
|
|
21
|
+
size?: number;
|
|
22
|
+
color?: number;
|
|
23
|
+
},
|
|
24
|
+
) => Promise<string>;
|
|
25
|
+
};
|
|
26
|
+
|
|
16
27
|
declare global {
|
|
17
28
|
interface ExpoGlobal {
|
|
18
29
|
modules: {
|
|
19
30
|
ExpoAsset?: ExpoAssetModule;
|
|
20
31
|
ExpoFontLoader?: ExpoFontLoaderModule;
|
|
32
|
+
ExpoFontUtils?: ExpoFontUtilsModule;
|
|
21
33
|
};
|
|
22
34
|
}
|
|
23
35
|
|
|
@@ -44,6 +56,17 @@ function getIsDynamicLoadingSupported(globalObj: any): globalObj is {
|
|
|
44
56
|
);
|
|
45
57
|
}
|
|
46
58
|
|
|
59
|
+
// biome-ignore lint/suspicious/noExplicitAny: this is used internally with globalThis
|
|
60
|
+
export function getIsRenderToImageSupported(globalObj: any): globalObj is {
|
|
61
|
+
expo: {
|
|
62
|
+
modules: {
|
|
63
|
+
ExpoFontUtils: ExpoFontUtilsModule;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
} {
|
|
67
|
+
return globalObj?.expo && typeof globalObj.expo.modules?.ExpoFontUtils?.renderToImageAsync === 'function';
|
|
68
|
+
}
|
|
69
|
+
|
|
47
70
|
export function assertExpoModulesPresent(globalObj: unknown): asserts globalObj is { expo: ExpoGlobalType } {
|
|
48
71
|
if (!getIsDynamicLoadingSupported(globalObj)) {
|
|
49
72
|
throw new Error('Dynamic font loading for Expo is not available.');
|
|
@@ -87,11 +110,7 @@ export const setDynamicLoadingEnabled = (value: boolean): boolean => {
|
|
|
87
110
|
* */
|
|
88
111
|
export const isDynamicLoadingEnabled = () => dynamicFontLoadingEnabled;
|
|
89
112
|
|
|
90
|
-
type ErrorCallback = (args: {
|
|
91
|
-
error: Error;
|
|
92
|
-
fontFamily: string;
|
|
93
|
-
fontSource: FontSource;
|
|
94
|
-
}) => void;
|
|
113
|
+
type ErrorCallback = (args: { error: Error; fontFamily: string; fontSource: FontSource }) => void;
|
|
95
114
|
|
|
96
115
|
let dynamicLoadingErrorCallback: undefined | ErrorCallback;
|
|
97
116
|
|
package/src/get-image-library.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getIsRenderToImageSupported } from './dynamicLoading/dynamic-loading-setting';
|
|
2
|
+
|
|
1
3
|
// eslint-disable-next-line import/no-mutable-exports
|
|
2
4
|
let NativeIconAPI: typeof import('@react-native-vector-icons/get-image') | null = null;
|
|
3
5
|
|
|
@@ -5,17 +7,36 @@ try {
|
|
|
5
7
|
// eslint-disable-next-line global-require,import/no-extraneous-dependencies,@typescript-eslint/no-require-imports
|
|
6
8
|
NativeIconAPI = require('@react-native-vector-icons/get-image');
|
|
7
9
|
} catch {
|
|
8
|
-
//
|
|
10
|
+
// if this fails, it's likely due to:
|
|
11
|
+
// "Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'VectorIcons' could not be found. ..."
|
|
12
|
+
// No warning at this stage.
|
|
9
13
|
}
|
|
10
14
|
|
|
15
|
+
const globalRef = globalThis;
|
|
16
|
+
const hasExpoRenderToImage = getIsRenderToImageSupported(globalRef);
|
|
17
|
+
|
|
11
18
|
export const ensureGetImageAvailable = () => {
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
19
|
+
if (NativeIconAPI) {
|
|
20
|
+
NativeIconAPI.ensureNativeModuleAvailable();
|
|
21
|
+
return NativeIconAPI;
|
|
16
22
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
if (hasExpoRenderToImage) {
|
|
24
|
+
const { ExpoFontUtils } = globalRef.expo.modules;
|
|
25
|
+
return {
|
|
26
|
+
getImageForFont: async (fontReference: string, glyph: string, size: number, color: number) =>
|
|
27
|
+
ExpoFontUtils.renderToImageAsync(glyph, {
|
|
28
|
+
fontFamily: fontReference,
|
|
29
|
+
size,
|
|
30
|
+
color,
|
|
31
|
+
}),
|
|
32
|
+
getImageForFontSync: () => {
|
|
33
|
+
throw new Error(
|
|
34
|
+
'You attempted to call `getImageForFontSync`. Expo dev client with `@react-native-vector-icons/get-image` installed is required for this. Alternatively, call `getImageForFont` or generate the image yourself and bundle it with the app.',
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
throw new Error(
|
|
40
|
+
'Error in getImageSource / getImageSourceSync: You need to either (1) install `@react-native-vector-icons/get-image` or (2) use Expo SDK 53+ (Expo dev client or Expo Go). Check your setup and rebuild the app.',
|
|
41
|
+
);
|
|
21
42
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
import { PixelRatio, processColor } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type createIconSourceCache from './create-icon-source-cache';
|
|
5
|
+
import { DEFAULT_ICON_COLOR, DEFAULT_ICON_SIZE } from './defaults';
|
|
6
|
+
import { ensureGetImageAvailable } from './get-image-library';
|
|
7
|
+
|
|
8
|
+
export const getImageSourceSync = (
|
|
9
|
+
imageSourceCache: ReturnType<typeof createIconSourceCache>,
|
|
10
|
+
fontReference: string,
|
|
11
|
+
glyph: string,
|
|
12
|
+
size = DEFAULT_ICON_SIZE,
|
|
13
|
+
color: TextStyle['color'] = DEFAULT_ICON_COLOR,
|
|
14
|
+
) => {
|
|
15
|
+
const NativeIconAPI = ensureGetImageAvailable();
|
|
16
|
+
|
|
17
|
+
const processedColor = processColor(color);
|
|
18
|
+
const cacheKey = `${glyph}:${size}:${String(processedColor)}`;
|
|
19
|
+
|
|
20
|
+
const maybeCachedValue = imageSourceCache.get(cacheKey);
|
|
21
|
+
if (maybeCachedValue !== undefined) {
|
|
22
|
+
// FIXME: Should this check if it's an error and throw it again?
|
|
23
|
+
return maybeCachedValue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const imagePath = NativeIconAPI.getImageForFontSync(
|
|
28
|
+
fontReference,
|
|
29
|
+
glyph,
|
|
30
|
+
size,
|
|
31
|
+
processedColor as number, // FIXME what if a non existent colour was passed in?
|
|
32
|
+
);
|
|
33
|
+
const value = { uri: imagePath, scale: PixelRatio.get() };
|
|
34
|
+
imageSourceCache.setValue(cacheKey, value);
|
|
35
|
+
return value;
|
|
36
|
+
} catch (error) {
|
|
37
|
+
imageSourceCache.setError(cacheKey, error as Error);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const getImageSource = async (
|
|
43
|
+
imageSourceCache: ReturnType<typeof createIconSourceCache>,
|
|
44
|
+
fontReference: string,
|
|
45
|
+
glyph: string,
|
|
46
|
+
size = DEFAULT_ICON_SIZE,
|
|
47
|
+
color: TextStyle['color'] = DEFAULT_ICON_COLOR,
|
|
48
|
+
) => {
|
|
49
|
+
const NativeIconAPI = ensureGetImageAvailable();
|
|
50
|
+
|
|
51
|
+
const processedColor = processColor(color);
|
|
52
|
+
const cacheKey = `${glyph}:${size}:${String(processedColor)}`;
|
|
53
|
+
|
|
54
|
+
const maybeCachedValue = imageSourceCache.get(cacheKey);
|
|
55
|
+
if (maybeCachedValue !== undefined) {
|
|
56
|
+
// FIXME: Should this check if it's an error and throw it again?
|
|
57
|
+
return maybeCachedValue;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
const imagePath = await NativeIconAPI.getImageForFont(
|
|
62
|
+
fontReference,
|
|
63
|
+
glyph,
|
|
64
|
+
size,
|
|
65
|
+
processedColor as number, // FIXME what if a non existent colour was passed in?
|
|
66
|
+
);
|
|
67
|
+
const value = { uri: imagePath, scale: PixelRatio.get() };
|
|
68
|
+
imageSourceCache.setValue(cacheKey, value);
|
|
69
|
+
return value;
|
|
70
|
+
} catch (error) {
|
|
71
|
+
imageSourceCache.setError(cacheKey, error as Error);
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
1
|
+
export type { CreateIconSetOptions, IconProps } from './create-icon-set';
|
|
2
|
+
export { createIconSet } from './create-icon-set';
|
|
3
|
+
export { DEFAULT_ICON_COLOR, DEFAULT_ICON_SIZE } from './defaults';
|
|
3
4
|
export {
|
|
4
|
-
setDynamicLoadingEnabled,
|
|
5
5
|
isDynamicLoadingEnabled,
|
|
6
6
|
isDynamicLoadingSupported,
|
|
7
|
+
setDynamicLoadingEnabled,
|
|
7
8
|
setDynamicLoadingErrorCallback,
|
|
8
9
|
} from './dynamicLoading/dynamic-loading-setting';
|
package/src/scripts/common.ts
CHANGED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.facebook.fbreact.specs;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.Promise;
|
|
17
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
21
|
-
import javax.annotation.Nonnull;
|
|
22
|
-
|
|
23
|
-
public abstract class NativeVectorIconsSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
24
|
-
public static final String NAME = "VectorIcons";
|
|
25
|
-
|
|
26
|
-
public NativeVectorIconsSpec(ReactApplicationContext reactContext) {
|
|
27
|
-
super(reactContext);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@Override
|
|
31
|
-
public @Nonnull String getName() {
|
|
32
|
-
return NAME;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@ReactMethod
|
|
36
|
-
@DoNotStrip
|
|
37
|
-
public abstract void getImageForFont(String fontFamilyName, String glyph, double fontSize, double color, Promise promise);
|
|
38
|
-
|
|
39
|
-
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
40
|
-
@DoNotStrip
|
|
41
|
-
public abstract String getImageForFontSync(String fontFamilyName, String glyph, double fontSize, double color);
|
|
42
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNVectorIconsSpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_RNVectorIconsSpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_RNVectorIconsSpec PUBLIC . react/renderer/components/RNVectorIconsSpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_RNVectorIconsSpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_RNVectorIconsSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#include "RNVectorIconsSpec.h"
|
|
12
|
-
|
|
13
|
-
namespace facebook::react {
|
|
14
|
-
|
|
15
|
-
static facebook::jsi::Value __hostFunction_NativeVectorIconsSpecJSI_getImageForFont(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
-
static jmethodID cachedMethodId = nullptr;
|
|
17
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getImageForFont", "(Ljava/lang/String;Ljava/lang/String;DDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static facebook::jsi::Value __hostFunction_NativeVectorIconsSpecJSI_getImageForFontSync(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
21
|
-
static jmethodID cachedMethodId = nullptr;
|
|
22
|
-
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "getImageForFontSync", "(Ljava/lang/String;Ljava/lang/String;DD)Ljava/lang/String;", args, count, cachedMethodId);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
NativeVectorIconsSpecJSI::NativeVectorIconsSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
26
|
-
: JavaTurboModule(params) {
|
|
27
|
-
methodMap_["getImageForFont"] = MethodMetadata {4, __hostFunction_NativeVectorIconsSpecJSI_getImageForFont};
|
|
28
|
-
methodMap_["getImageForFontSync"] = MethodMetadata {4, __hostFunction_NativeVectorIconsSpecJSI_getImageForFontSync};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
std::shared_ptr<TurboModule> RNVectorIconsSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
32
|
-
if (moduleName == "VectorIcons") {
|
|
33
|
-
return std::make_shared<NativeVectorIconsSpecJSI>(params);
|
|
34
|
-
}
|
|
35
|
-
return nullptr;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
} // namespace facebook::react
|
package/android/generated/android/app/build/generated/source/codegen/jni/RNVectorIconsSpec.h
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
-
#include <ReactCommon/TurboModule.h>
|
|
15
|
-
#include <jsi/jsi.h>
|
|
16
|
-
|
|
17
|
-
namespace facebook::react {
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* JNI C++ class for module 'NativeVectorIcons'
|
|
21
|
-
*/
|
|
22
|
-
class JSI_EXPORT NativeVectorIconsSpecJSI : public JavaTurboModule {
|
|
23
|
-
public:
|
|
24
|
-
NativeVectorIconsSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
JSI_EXPORT
|
|
29
|
-
std::shared_ptr<TurboModule> RNVectorIconsSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
-
|
|
31
|
-
} // namespace facebook::react
|