@react-native-vector-icons/common 12.0.0 → 12.0.1
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 +4 -4
- package/android/generated/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeVectorIconsSpec.java +42 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNVectorIconsSpec-generated.cpp +38 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNVectorIconsSpec.h +31 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.cpp +22 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h +24 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/EventEmitters.h +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/Props.cpp +19 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/Props.h +18 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI-generated.cpp +40 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/RNVectorIconsSpecJSI.h +76 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.cpp +17 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/ShadowNodes.h +23 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/States.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec/States.h +19 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2321 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h +2761 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpecJSI-generated.cpp +2929 -0
- package/ios/generated/build/generated/ios/FBReactNativeSpecJSI.h +7727 -0
- package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/build/generated/ios/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/build/generated/ios/RNVectorIconsSpec/RNVectorIconsSpec-generated.mm +46 -0
- package/ios/generated/build/generated/ios/RNVectorIconsSpec/RNVectorIconsSpec.h +68 -0
- package/ios/generated/build/generated/ios/RNVectorIconsSpecJSI-generated.cpp +40 -0
- package/ios/generated/build/generated/ios/RNVectorIconsSpecJSI.h +76 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.cpp +22 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h +24 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/EventEmitters.cpp +16 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/EventEmitters.h +17 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/Props.cpp +19 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/Props.h +18 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/RCTComponentViewHelpers.h +18 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ShadowNodes.cpp +17 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ShadowNodes.h +23 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/States.cpp +16 -0
- package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/States.h +19 -0
- package/lib/commonjs/create-icon-set.js +5 -6
- package/lib/commonjs/create-icon-set.js.map +1 -1
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js +8 -18
- package/lib/commonjs/dynamicLoading/dynamic-font-loading.js.map +1 -1
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js +11 -1
- package/lib/commonjs/dynamicLoading/dynamic-loading-setting.js.map +1 -1
- package/lib/module/create-icon-set.js +5 -6
- package/lib/module/create-icon-set.js.map +1 -1
- package/lib/module/dynamicLoading/dynamic-font-loading.js +9 -17
- package/lib/module/dynamicLoading/dynamic-font-loading.js.map +1 -1
- package/lib/module/dynamicLoading/dynamic-loading-setting.js +10 -1
- package/lib/module/dynamicLoading/dynamic-loading-setting.js.map +1 -1
- 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 +18 -7
- package/lib/typescript/commonjs/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -1
- 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 +18 -7
- package/lib/typescript/module/src/dynamicLoading/dynamic-loading-setting.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/create-icon-set.tsx +6 -7
- package/src/dynamicLoading/dynamic-font-loading.ts +10 -17
- package/src/dynamicLoading/dynamic-loading-setting.ts +41 -13
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
|
13
|
+
|
|
14
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
|
15
|
+
|
|
16
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTModulesConformingToProtocolsProvider.h"
|
|
9
|
+
|
|
10
|
+
@implementation RCTModulesConformingToProtocolsProvider
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
|
13
|
+
{
|
|
14
|
+
return @[
|
|
15
|
+
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
|
20
|
+
{
|
|
21
|
+
return @[
|
|
22
|
+
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
|
27
|
+
{
|
|
28
|
+
return @[
|
|
29
|
+
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#import "RNVectorIconsSpec.h"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@implementation NativeVectorIconsSpecBase
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
|
|
21
|
+
{
|
|
22
|
+
_eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
|
|
23
|
+
}
|
|
24
|
+
@end
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
namespace facebook::react {
|
|
28
|
+
|
|
29
|
+
static facebook::jsi::Value __hostFunction_NativeVectorIconsSpecJSI_getImageForFont(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
30
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "getImageForFont", @selector(getImageForFont:glyph:fontSize:color:resolve:reject:), args, count);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static facebook::jsi::Value __hostFunction_NativeVectorIconsSpecJSI_getImageForFontSync(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
34
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, StringKind, "getImageForFontSync", @selector(getImageForFontSync:glyph:fontSize:color:), args, count);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
NativeVectorIconsSpecJSI::NativeVectorIconsSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
38
|
+
: ObjCTurboModule(params) {
|
|
39
|
+
|
|
40
|
+
methodMap_["getImageForFont"] = MethodMetadata {4, __hostFunction_NativeVectorIconsSpecJSI_getImageForFont};
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
methodMap_["getImageForFontSync"] = MethodMetadata {4, __hostFunction_NativeVectorIconsSpecJSI_getImageForFontSync};
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef __cplusplus
|
|
15
|
+
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// Avoid multiple includes of RNVectorIconsSpec symbols
|
|
19
|
+
#ifndef RNVectorIconsSpec_H
|
|
20
|
+
#define RNVectorIconsSpec_H
|
|
21
|
+
|
|
22
|
+
#import <Foundation/Foundation.h>
|
|
23
|
+
#import <RCTRequired/RCTRequired.h>
|
|
24
|
+
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
+
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
+
#import <React/RCTBridgeModule.h>
|
|
27
|
+
#import <React/RCTCxxConvert.h>
|
|
28
|
+
#import <React/RCTManagedPointer.h>
|
|
29
|
+
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
+
#import <optional>
|
|
31
|
+
#import <vector>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@protocol NativeVectorIconsSpec <RCTBridgeModule, RCTTurboModule>
|
|
35
|
+
|
|
36
|
+
- (void)getImageForFont:(NSString *)fontFamilyName
|
|
37
|
+
glyph:(NSString *)glyph
|
|
38
|
+
fontSize:(double)fontSize
|
|
39
|
+
color:(double)color
|
|
40
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
41
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
42
|
+
- (NSString *)getImageForFontSync:(NSString *)fontFamilyName
|
|
43
|
+
glyph:(NSString *)glyph
|
|
44
|
+
fontSize:(double)fontSize
|
|
45
|
+
color:(double)color;
|
|
46
|
+
|
|
47
|
+
@end
|
|
48
|
+
|
|
49
|
+
@interface NativeVectorIconsSpecBase : NSObject {
|
|
50
|
+
@protected
|
|
51
|
+
facebook::react::EventEmitterCallback _eventEmitterCallback;
|
|
52
|
+
}
|
|
53
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@end
|
|
57
|
+
|
|
58
|
+
namespace facebook::react {
|
|
59
|
+
/**
|
|
60
|
+
* ObjC++ class for module 'NativeVectorIcons'
|
|
61
|
+
*/
|
|
62
|
+
class JSI_EXPORT NativeVectorIconsSpecJSI : public ObjCTurboModule {
|
|
63
|
+
public:
|
|
64
|
+
NativeVectorIconsSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
65
|
+
};
|
|
66
|
+
} // namespace facebook::react
|
|
67
|
+
|
|
68
|
+
#endif // RNVectorIconsSpec_H
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNVectorIconsSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFont(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeVectorIconsCxxSpecJSI *>(&turboModule)->getImageForFont(
|
|
16
|
+
rt,
|
|
17
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
18
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
19
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
20
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber()
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
static jsi::Value __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFontSync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
24
|
+
return static_cast<NativeVectorIconsCxxSpecJSI *>(&turboModule)->getImageForFontSync(
|
|
25
|
+
rt,
|
|
26
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
27
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
28
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
29
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber()
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
NativeVectorIconsCxxSpecJSI::NativeVectorIconsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
34
|
+
: TurboModule("VectorIcons", jsInvoker) {
|
|
35
|
+
methodMap_["getImageForFont"] = MethodMetadata {4, __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFont};
|
|
36
|
+
methodMap_["getImageForFontSync"] = MethodMetadata {4, __hostFunction_NativeVectorIconsCxxSpecJSI_getImageForFontSync};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class JSI_EXPORT NativeVectorIconsCxxSpecJSI : public TurboModule {
|
|
19
|
+
protected:
|
|
20
|
+
NativeVectorIconsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
virtual jsi::Value getImageForFont(jsi::Runtime &rt, jsi::String fontFamilyName, jsi::String glyph, double fontSize, double color) = 0;
|
|
24
|
+
virtual jsi::String getImageForFontSync(jsi::Runtime &rt, jsi::String fontFamilyName, jsi::String glyph, double fontSize, double color) = 0;
|
|
25
|
+
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
template <typename T>
|
|
29
|
+
class JSI_EXPORT NativeVectorIconsCxxSpec : public TurboModule {
|
|
30
|
+
public:
|
|
31
|
+
jsi::Value get(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
32
|
+
return delegate_.get(rt, propName);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static constexpr std::string_view kModuleName = "VectorIcons";
|
|
36
|
+
|
|
37
|
+
protected:
|
|
38
|
+
NativeVectorIconsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
39
|
+
: TurboModule(std::string{NativeVectorIconsCxxSpec::kModuleName}, jsInvoker),
|
|
40
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
private:
|
|
44
|
+
class Delegate : public NativeVectorIconsCxxSpecJSI {
|
|
45
|
+
public:
|
|
46
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
47
|
+
NativeVectorIconsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
jsi::Value getImageForFont(jsi::Runtime &rt, jsi::String fontFamilyName, jsi::String glyph, double fontSize, double color) override {
|
|
52
|
+
static_assert(
|
|
53
|
+
bridging::getParameterCount(&T::getImageForFont) == 5,
|
|
54
|
+
"Expected getImageForFont(...) to have 5 parameters");
|
|
55
|
+
|
|
56
|
+
return bridging::callFromJs<jsi::Value>(
|
|
57
|
+
rt, &T::getImageForFont, jsInvoker_, instance_, std::move(fontFamilyName), std::move(glyph), std::move(fontSize), std::move(color));
|
|
58
|
+
}
|
|
59
|
+
jsi::String getImageForFontSync(jsi::Runtime &rt, jsi::String fontFamilyName, jsi::String glyph, double fontSize, double color) override {
|
|
60
|
+
static_assert(
|
|
61
|
+
bridging::getParameterCount(&T::getImageForFontSync) == 5,
|
|
62
|
+
"Expected getImageForFontSync(...) to have 5 parameters");
|
|
63
|
+
|
|
64
|
+
return bridging::callFromJs<jsi::String>(
|
|
65
|
+
rt, &T::getImageForFontSync, jsInvoker_, instance_, std::move(fontFamilyName), std::move(glyph), std::move(fontSize), std::move(color));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
friend class NativeVectorIconsCxxSpec;
|
|
70
|
+
T *instance_;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
Delegate delegate_;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,22 @@
|
|
|
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: GenerateComponentDescriptorCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNVectorIconsSpec/ComponentDescriptors.h>
|
|
12
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
void RNVectorIconsSpec_registerComponentDescriptorsFromCodegen(
|
|
18
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,24 @@
|
|
|
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: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/RNVectorIconsSpec/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
void RNVectorIconsSpec_registerComponentDescriptorsFromCodegen(
|
|
22
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
+
|
|
24
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,16 @@
|
|
|
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: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNVectorIconsSpec/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,17 @@
|
|
|
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: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/Props.cpp
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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: GeneratePropsCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNVectorIconsSpec/Props.h>
|
|
12
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
+
#include <react/renderer/core/propsConversions.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,18 @@
|
|
|
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: GeneratePropsH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateComponentHObjCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
#import <React/RCTDefines.h>
|
|
12
|
+
#import <React/RCTLog.h>
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,17 @@
|
|
|
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: GenerateShadowNodeCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/RNVectorIconsSpec/ShadowNodes.h>
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/ShadowNodes.h
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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: GenerateShadowNodeH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/RNVectorIconsSpec/EventEmitters.h>
|
|
14
|
+
#include <react/renderer/components/RNVectorIconsSpec/Props.h>
|
|
15
|
+
#include <react/renderer/components/RNVectorIconsSpec/States.h>
|
|
16
|
+
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
|
+
#include <jsi/jsi.h>
|
|
18
|
+
|
|
19
|
+
namespace facebook::react {
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/States.cpp
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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: GenerateStateCpp.js
|
|
9
|
+
*/
|
|
10
|
+
#include <react/renderer/components/RNVectorIconsSpec/States.h>
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
} // namespace facebook::react
|
package/ios/generated/build/generated/ios/react/renderer/components/RNVectorIconsSpec/States.h
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateStateH.js
|
|
8
|
+
*/
|
|
9
|
+
#pragma once
|
|
10
|
+
|
|
11
|
+
#ifdef ANDROID
|
|
12
|
+
#include <folly/dynamic.h>
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -35,9 +35,13 @@ function createIconSet(glyphMap, postScriptNameOrOptions, fontFileNameParam, fon
|
|
|
35
35
|
const fontReference = _reactNative.Platform.select({
|
|
36
36
|
windows: `/Assets/${fontFileName}#${postScriptName}`,
|
|
37
37
|
android: fontBasename,
|
|
38
|
-
web: fontBasename,
|
|
39
38
|
default: postScriptName
|
|
40
39
|
});
|
|
40
|
+
const styleOverrides = {
|
|
41
|
+
fontFamily: fontReference,
|
|
42
|
+
fontWeight: 'normal',
|
|
43
|
+
fontStyle: 'normal'
|
|
44
|
+
};
|
|
41
45
|
const resolveGlyph = name => {
|
|
42
46
|
const glyph = glyphMap[name] || '?';
|
|
43
47
|
if (typeof glyph === 'number') {
|
|
@@ -76,11 +80,6 @@ function createIconSet(glyphMap, postScriptNameOrOptions, fontFileNameParam, fon
|
|
|
76
80
|
fontSize: size,
|
|
77
81
|
color
|
|
78
82
|
};
|
|
79
|
-
const styleOverrides = {
|
|
80
|
-
fontFamily: fontReference,
|
|
81
|
-
fontWeight: 'normal',
|
|
82
|
-
fontStyle: 'normal'
|
|
83
|
-
};
|
|
84
83
|
const newProps = {
|
|
85
84
|
...props,
|
|
86
85
|
style: [styleDefaults, style, styleOverrides, fontStyle || {}],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_createIconSourceCache","_interopRequireDefault","_dynamicFontLoading","_dynamicLoadingSetting","_getImageLibrary","_jsxRuntime","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DEFAULT_ICON_SIZE","exports","DEFAULT_ICON_COLOR","createIconSet","glyphMap","postScriptNameOrOptions","fontFileNameParam","fontStyleParam","postScriptName","fontFileName","fontStyle","fontBasename","replace","fontReference","Platform","select","windows","android","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_createIconSourceCache","_interopRequireDefault","_dynamicFontLoading","_dynamicLoadingSetting","_getImageLibrary","_jsxRuntime","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","DEFAULT_ICON_SIZE","exports","DEFAULT_ICON_COLOR","createIconSet","glyphMap","postScriptNameOrOptions","fontFileNameParam","fontStyleParam","postScriptName","fontFileName","fontStyle","fontBasename","replace","fontReference","Platform","select","windows","android","styleOverrides","fontFamily","fontWeight","resolveGlyph","name","glyph","String","fromCodePoint","Icon","size","color","style","children","allowFontScaling","innerRef","props","isFontLoaded","setIsFontLoaded","React","useState","isDynamicLoadingEnabled","dynamicLoader","isLoaded","useEffect","isMounted","fontSource","loadFontAsync","finally","styleDefaults","fontSize","newProps","jsxs","Text","ref","selectable","WrappedIcon","forwardRef","jsx","displayName","imageSourceCache","createIconSourceCache","getImageSourceSync","NativeIconAPI","ensureGetImageAvailable","processedColor","processColor","cacheKey","imagePath","getImageForFontSync","value","uri","scale","PixelRatio","setValue","error","setError","getImageSource","getImageForFont","IconNamespace","assign"],"sourceRoot":"../../src","sources":["create-icon-set.tsx"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAEA,IAAAM,gBAAA,GAAAN,OAAA;AAA8D,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe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K;IACd,CAAC,CAAC,OAAOK,KAAK,EAAE;MACdf,gBAAgB,CAACgB,QAAQ,CAACT,QAAQ,EAAEQ,KAAc,CAAC;MACnD,MAAMA,KAAK;IACb;EACF,CAAC;EAED,MAAMI,aAAa,GAAGpF,MAAM,CAACqF,MAAM,CAACxB,WAAW,EAAE;IAC/CqB,cAAc;IACdf;EACF,CAAC,CAAC;EAEF,OAAOiB,aAAa;AACtB","ignoreList":[]}
|
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.dynamicLoader = void 0;
|
|
7
7
|
var _registry = require("@react-native/assets-registry/registry");
|
|
8
|
-
var
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
9
|
var _dynamicLoadingSetting = require("./dynamic-loading-setting.js");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
10
|
/*
|
|
12
11
|
* The following imports are always present when react native is installed
|
|
13
12
|
* in the future, more explicit apis will be exposed by the core, including typings
|
|
@@ -15,15 +14,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
15
14
|
// @ts-expect-error missing types
|
|
16
15
|
// eslint-disable-next-line import/no-extraneous-dependencies,import/no-unresolved
|
|
17
16
|
|
|
18
|
-
// @ts-expect-error missing types
|
|
19
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
20
|
-
|
|
21
17
|
const loadPromises = {};
|
|
22
18
|
const loadFontAsync = async (fontFamily, fontSource) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
19
|
+
const globalRef = globalThis;
|
|
20
|
+
(0, _dynamicLoadingSetting.assertExpoModulesPresent)(globalRef);
|
|
21
|
+
const expoModules = globalRef.expo.modules;
|
|
27
22
|
if (loadPromises[fontFamily]) {
|
|
28
23
|
return loadPromises[fontFamily];
|
|
29
24
|
}
|
|
@@ -62,8 +57,7 @@ const getLocalFontUrl = (fontModuleId, fontFamily) => {
|
|
|
62
57
|
if (!assetMeta) {
|
|
63
58
|
throw new Error(`no asset found for font family "${fontFamily}", moduleId: ${String(fontModuleId)}`);
|
|
64
59
|
}
|
|
65
|
-
const
|
|
66
|
-
const assetSource = resolver(fontModuleId);
|
|
60
|
+
const assetSource = _reactNative.Image.resolveAssetSource(fontModuleId);
|
|
67
61
|
return {
|
|
68
62
|
...assetMeta,
|
|
69
63
|
...assetSource
|
|
@@ -74,13 +68,9 @@ const isLoadedNative = fontFamily => {
|
|
|
74
68
|
if (fontFamily in loadedFontsCache) {
|
|
75
69
|
return true;
|
|
76
70
|
}
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!expo) {
|
|
81
|
-
throw new Error('Expo is not available. Dynamic font loading is not available.');
|
|
82
|
-
}
|
|
83
|
-
const loadedNativeFonts = expo.modules.ExpoFontLoader.getLoadedFonts();
|
|
71
|
+
const globalRef = globalThis;
|
|
72
|
+
(0, _dynamicLoadingSetting.assertExpoModulesPresent)(globalRef);
|
|
73
|
+
const loadedNativeFonts = globalRef.expo.modules.ExpoFontLoader.getLoadedFonts();
|
|
84
74
|
loadedNativeFonts.forEach(font => {
|
|
85
75
|
loadedFontsCache[font] = true;
|
|
86
76
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_registry","require","
|
|
1
|
+
{"version":3,"names":["_registry","require","_reactNative","_dynamicLoadingSetting","loadPromises","loadFontAsync","fontFamily","fontSource","globalRef","globalThis","assertExpoModulesPresent","expoModules","expo","modules","LoadFont","localUri","uri","type","hash","getLocalFontUrl","ExpoAsset","downloadAsync","ExpoFontLoader","loadAsync","error","console","getErrorCallback","fontModuleId","assetMeta","getAssetByID","Error","String","assetSource","Image","resolveAssetSource","loadedFontsCache","isLoadedNative","loadedNativeFonts","getLoadedFonts","forEach","font","dynamicLoader","exports","isLoaded"],"sourceRoot":"../../../src","sources":["dynamicLoading/dynamic-font-loading.ts"],"mappings":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