@momo-kits/qrcode 0.150.2-beta.11 → 0.150.2-beta.13

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.
Files changed (52) hide show
  1. package/LICENSE +1 -1
  2. package/Qrcode.podspec +43 -0
  3. package/README.md +4 -8
  4. package/android/build.gradle +10 -3
  5. package/android/gradle.properties +8 -5
  6. package/android/src/main/java/com/momokits/qrcode/MomoBarCodeViewManager.kt +111 -0
  7. package/android/src/main/java/com/momokits/qrcode/MomoQrCodeUtils.kt +23 -0
  8. package/android/src/main/java/com/momokits/qrcode/MomoQrCodeViewManager.kt +96 -0
  9. package/android/src/main/java/com/momokits/qrcode/{RCTQRCodePackage.kt → MomoQrCodeViewPackage.kt} +9 -10
  10. package/ios/BarCodeView.h +20 -0
  11. package/ios/BarCodeView.m +65 -0
  12. package/ios/QRCodeView.h +19 -0
  13. package/ios/QRCodeView.m +74 -0
  14. package/ios/RNBarCode.h +11 -0
  15. package/ios/RNBarCode.mm +63 -0
  16. package/ios/RNQRCode.h +10 -0
  17. package/ios/RNQRCode.mm +66 -0
  18. package/lib/module/BarCodeView.js +16 -0
  19. package/lib/module/BarCodeView.js.map +1 -0
  20. package/lib/module/QRCodeView.js +42 -0
  21. package/lib/module/QRCodeView.js.map +1 -0
  22. package/lib/module/RNBarCodeNativeComponent.ts +15 -0
  23. package/lib/module/RNQRCodeNativeComponent.ts +10 -0
  24. package/lib/module/index.js +5 -2
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/typescript/src/BarCodeView.d.ts +10 -0
  27. package/lib/typescript/src/BarCodeView.d.ts.map +1 -0
  28. package/lib/typescript/src/QRCodeView.d.ts +14 -0
  29. package/lib/typescript/src/QRCodeView.d.ts.map +1 -0
  30. package/lib/typescript/src/RNBarCodeNativeComponent.d.ts +15 -0
  31. package/lib/typescript/src/RNBarCodeNativeComponent.d.ts.map +1 -0
  32. package/lib/typescript/src/RNQRCodeNativeComponent.d.ts +10 -0
  33. package/lib/typescript/src/RNQRCodeNativeComponent.d.ts.map +1 -0
  34. package/lib/typescript/src/index.d.ts +5 -2
  35. package/lib/typescript/src/index.d.ts.map +1 -1
  36. package/package.json +160 -159
  37. package/src/BarCodeView.tsx +15 -0
  38. package/src/QRCodeView.tsx +63 -0
  39. package/src/RNBarCodeNativeComponent.ts +15 -0
  40. package/src/RNQRCodeNativeComponent.ts +10 -0
  41. package/src/index.tsx +6 -2
  42. package/RCTQRCode.podspec +0 -21
  43. package/android/src/main/java/com/momokits/qrcode/RCTQRCodeView.kt +0 -99
  44. package/android/src/main/java/com/momokits/qrcode/RCTQRCodeViewManager.kt +0 -52
  45. package/ios/RCTQRCodeComponentView.mm +0 -11
  46. package/ios/RCTQRCodeView.h +0 -19
  47. package/ios/RCTQRCodeView.mm +0 -142
  48. package/ios/RCTQRCodeViewManager.mm +0 -21
  49. package/lib/module/RCTQRCodeViewNativeComponent.ts +0 -10
  50. package/lib/typescript/src/RCTQRCodeViewNativeComponent.d.ts +0 -10
  51. package/lib/typescript/src/RCTQRCodeViewNativeComponent.d.ts.map +0 -1
  52. package/src/RCTQRCodeViewNativeComponent.ts +0 -10
@@ -0,0 +1,66 @@
1
+ #import "RNQRCode.h"
2
+ #import <react/renderer/components/QrcodeViewSpec/ComponentDescriptors.h>
3
+ #import <react/renderer/components/QrcodeViewSpec/Props.h>
4
+ #import <react/renderer/components/QrcodeViewSpec/RCTComponentViewHelpers.h>
5
+ #import <react/renderer/components/QrcodeViewSpec/EventEmitters.h>
6
+ #import "QRCodeView.h"
7
+ #import <React/RCTLog.h>
8
+
9
+ #import "RCTFabricComponentsPlugins.h"
10
+
11
+ using namespace facebook::react;
12
+
13
+ @interface RNQRCode () <RCTRNQRCodeViewProtocol>
14
+ @end
15
+
16
+ @implementation RNQRCode {
17
+ QRCodeView *_qrView;
18
+ }
19
+
20
+ - (instancetype)init
21
+ {
22
+ if (self = [super init]) {
23
+ // Create and embed your existing UIImageView-based QRCodeView
24
+ _qrView = [QRCodeView new];
25
+ [self addSubview:_qrView];
26
+ }
27
+ return self;
28
+ }
29
+
30
+ - (void)updateProps:(Props::Shared const &)props
31
+ oldProps:(Props::Shared const &)oldProps
32
+ {
33
+ // Pull in the generated Props struct
34
+ const auto &qrProps = *std::static_pointer_cast<RNQRCodeProps const>(props);
35
+
36
+ // Apply to your view
37
+ if (!qrProps.code.empty()) {
38
+ NSString *nsCode = [NSString stringWithUTF8String:qrProps.code.c_str()];
39
+ _qrView.code = nsCode;
40
+ }
41
+ _qrView.ratio = qrProps.ratio;
42
+ _qrView.size = qrProps.size;
43
+ NSLog(@"[QRCodeView] setCode: %@", _qrView.code);
44
+
45
+ [super updateProps:props oldProps:oldProps];
46
+ }
47
+
48
+ - (void)layoutSubviews
49
+ {
50
+ [super layoutSubviews];
51
+ // Make the QR image fill the host view
52
+ _qrView.frame = self.bounds;
53
+ }
54
+
55
+ + (ComponentDescriptorProvider)componentDescriptorProvider
56
+ {
57
+ // Hook up to the C++ ComponentDescriptor generated by Codegen
58
+ return concreteComponentDescriptorProvider<RNQRCodeComponentDescriptor>();
59
+ }
60
+
61
+ @end
62
+
63
+ Class<RCTRNQRCodeViewProtocol> RCTQRCodeCls(void)
64
+ {
65
+ return RNQRCode.class;
66
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ import RNBarCode from './RNBarCodeNativeComponent';
4
+ import { PixelRatio } from 'react-native';
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const BarCodeView = ({
7
+ ratio,
8
+ ...props
9
+ }) => {
10
+ return /*#__PURE__*/_jsx(RNBarCode, {
11
+ ratio: ratio ?? PixelRatio.get(),
12
+ ...props
13
+ });
14
+ };
15
+ export default BarCodeView;
16
+ //# sourceMappingURL=BarCodeView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RNBarCode","PixelRatio","jsx","_jsx","BarCodeView","ratio","props","get"],"sourceRoot":"../../src","sources":["BarCodeView.tsx"],"mappings":";;AAAA,OAAOA,SAAS,MAAM,4BAA4B;AAClD,SAASC,UAAU,QAAsB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASxD,MAAMC,WAAW,GAAGA,CAAC;EAAEC,KAAK;EAAE,GAAGC;AAAwB,CAAC,KAAK;EAC7D,oBAAOH,IAAA,CAACH,SAAS;IAACK,KAAK,EAAEA,KAAK,IAAIJ,UAAU,CAACM,GAAG,CAAC,CAAE;IAAA,GAAKD;EAAK,CAAG,CAAC;AACnE,CAAC;AAED,eAAeF,WAAW","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ import { Image, PixelRatio } from 'react-native';
4
+ import RNQRCode from './RNQRCodeNativeComponent';
5
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
6
+ const ratio = PixelRatio.get();
7
+ const ic_logo = 'https://img.mservice.io/momo_app_v2/new_version/img/appx_image/ic_momo.png';
8
+ const QRCodeView = ({
9
+ code,
10
+ showLogo = false,
11
+ ratio: customRatio,
12
+ icon = ic_logo,
13
+ iconSize = 32,
14
+ size,
15
+ iconStyle,
16
+ style,
17
+ ...rest
18
+ }) => {
19
+ return /*#__PURE__*/_jsxs(_Fragment, {
20
+ children: [/*#__PURE__*/_jsx(RNQRCode, {
21
+ code: code,
22
+ ratio: customRatio ?? ratio,
23
+ size: size,
24
+ ...rest,
25
+ style: [{
26
+ width: size,
27
+ height: size
28
+ }, style]
29
+ }), showLogo ? /*#__PURE__*/_jsx(Image, {
30
+ source: {
31
+ uri: icon
32
+ },
33
+ style: [{
34
+ width: iconSize,
35
+ height: iconSize,
36
+ position: 'absolute'
37
+ }, iconStyle]
38
+ }) : null]
39
+ });
40
+ };
41
+ export default QRCodeView;
42
+ //# sourceMappingURL=QRCodeView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Image","PixelRatio","RNQRCode","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ratio","get","ic_logo","QRCodeView","code","showLogo","customRatio","icon","iconSize","size","iconStyle","style","rest","children","width","height","source","uri","position"],"sourceRoot":"../../src","sources":["QRCodeView.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,UAAU,QAAQ,cAAc;AAChD,OAAOC,QAAQ,MAAM,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAGjD,MAAMC,KAAK,GAAGR,UAAU,CAACS,GAAG,CAAC,CAAC;AAC9B,MAAMC,OAAO,GACX,4EAA4E;AAa9E,MAAMC,UAAU,GAAGA,CAAC;EAClBC,IAAI;EACJC,QAAQ,GAAG,KAAK;EAChBL,KAAK,EAAEM,WAAW;EAClBC,IAAI,GAAGL,OAAO;EACdM,QAAQ,GAAG,EAAE;EACbC,IAAI;EACJC,SAAS;EACTC,KAAK;EACL,GAAGC;AACY,CAAC,KAAK;EACrB,oBACEb,KAAA,CAAAF,SAAA;IAAAgB,QAAA,gBACElB,IAAA,CAACF,QAAQ;MACPW,IAAI,EAAEA,IAAK;MACXJ,KAAK,EAAEM,WAAW,IAAIN,KAAM;MAC5BS,IAAI,EAAEA,IAAK;MAAA,GACPG,IAAI;MACRD,KAAK,EAAE,CACL;QACEG,KAAK,EAAEL,IAAI;QACXM,MAAM,EAAEN;MACV,CAAC,EACDE,KAAK;IACL,CACH,CAAC,EACDN,QAAQ,gBACPV,IAAA,CAACJ,KAAK;MACJyB,MAAM,EAAE;QAAEC,GAAG,EAAEV;MAAK,CAAE;MACtBI,KAAK,EAAE,CACL;QACEG,KAAK,EAAEN,QAAQ;QACfO,MAAM,EAAEP,QAAQ;QAChBU,QAAQ,EAAE;MACZ,CAAC,EACDR,SAAS;IACT,CACH,CAAC,GACA,IAAI;EAAA,CACR,CAAC;AAEP,CAAC;AAED,eAAeP,UAAU","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import { codegenNativeComponent, CodegenTypes } from 'react-native';
3
+
4
+ export interface BarCodeNativeComponentProps extends ViewProps {
5
+ /** the data string to encode */
6
+ code?: string;
7
+ /** scale-factor for the raw CIImage */
8
+ ratio?: CodegenTypes.Float;
9
+ /** pixel width of the final barcode */
10
+ width?: CodegenTypes.Int32;
11
+ /** pixel height of the final barcode */
12
+ height?: CodegenTypes.Int32;
13
+ }
14
+
15
+ export default codegenNativeComponent<BarCodeNativeComponentProps>('RNBarCode');
@@ -0,0 +1,10 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import { codegenNativeComponent, CodegenTypes } from 'react-native';
3
+
4
+ export interface QRCodeNativeComponentProps extends ViewProps {
5
+ code?: string;
6
+ ratio?: CodegenTypes.Float;
7
+ size?: CodegenTypes.Int32;
8
+ }
9
+
10
+ export default codegenNativeComponent<QRCodeNativeComponentProps>('RNQRCode');
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
 
3
- export { default as RCTQRCodeView } from './RCTQRCodeViewNativeComponent';
4
- export * from './RCTQRCodeViewNativeComponent';
3
+ import RNQRCode from './RNQRCodeNativeComponent';
4
+ import RNBarCode from './RNBarCodeNativeComponent';
5
+ import BarCodeView from "./BarCodeView.js";
6
+ import QRCodeView from "./QRCodeView.js";
7
+ export { BarCodeView, QRCodeView, RNQRCode, RNBarCode };
5
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","RCTQRCodeView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,aAAa,QAAQ,gCAAgC;AACzE,cAAc,gCAAgC","ignoreList":[]}
1
+ {"version":3,"names":["RNQRCode","RNBarCode","BarCodeView","QRCodeView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,OAAOA,QAAQ,MAAM,2BAA2B;AAChD,OAAOC,SAAS,MAAM,4BAA4B;AAClD,OAAOC,WAAW,MAAM,kBAAe;AACvC,OAAOC,UAAU,MAAM,iBAAc;AAErC,SAASD,WAAW,EAAEC,UAAU,EAAEH,QAAQ,EAAEC,SAAS","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import { CodegenTypes } from 'react-native';
2
+ type BarCodeViewProps = {
3
+ code: string;
4
+ width: CodegenTypes.Int32;
5
+ height: CodegenTypes.Int32;
6
+ ratio?: CodegenTypes.Float;
7
+ };
8
+ declare const BarCodeView: ({ ratio, ...props }: BarCodeViewProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default BarCodeView;
10
+ //# sourceMappingURL=BarCodeView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BarCodeView.d.ts","sourceRoot":"","sources":["../../../src/BarCodeView.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,YAAY,EAAE,MAAM,cAAc,CAAC;AAExD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;IAC1B,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC;IAC3B,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;CAC5B,CAAC;AAEF,QAAA,MAAM,WAAW,GAAI,qBAAqB,gBAAgB,4CAEzD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { CodegenTypes } from 'react-native';
2
+ type QRCodeViewProps = {
3
+ code: string;
4
+ size: CodegenTypes.Int32;
5
+ ratio?: CodegenTypes.Float;
6
+ icon?: string;
7
+ showLogo?: boolean;
8
+ iconSize?: CodegenTypes.Int32;
9
+ iconStyle?: any;
10
+ style?: any;
11
+ };
12
+ declare const QRCodeView: ({ code, showLogo, ratio: customRatio, icon, iconSize, size, iconStyle, style, ...rest }: QRCodeViewProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default QRCodeView;
14
+ //# sourceMappingURL=QRCodeView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QRCodeView.d.ts","sourceRoot":"","sources":["../../../src/QRCodeView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAMjD,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC;IACzB,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC9B,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,yFAUjB,eAAe,4CA+BjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import { CodegenTypes } from 'react-native';
3
+ export interface BarCodeNativeComponentProps extends ViewProps {
4
+ /** the data string to encode */
5
+ code?: string;
6
+ /** scale-factor for the raw CIImage */
7
+ ratio?: CodegenTypes.Float;
8
+ /** pixel width of the final barcode */
9
+ width?: CodegenTypes.Int32;
10
+ /** pixel height of the final barcode */
11
+ height?: CodegenTypes.Int32;
12
+ }
13
+ declare const _default: import("react-native").HostComponent<BarCodeNativeComponentProps>;
14
+ export default _default;
15
+ //# sourceMappingURL=RNBarCodeNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RNBarCodeNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/RNBarCodeNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAA0B,YAAY,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,WAAW,2BAA4B,SAAQ,SAAS;IAC5D,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC3B,uCAAuC;IACvC,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC3B,wCAAwC;IACxC,MAAM,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;CAC7B;;AAED,wBAAgF"}
@@ -0,0 +1,10 @@
1
+ import type { ViewProps } from 'react-native';
2
+ import { CodegenTypes } from 'react-native';
3
+ export interface QRCodeNativeComponentProps extends ViewProps {
4
+ code?: string;
5
+ ratio?: CodegenTypes.Float;
6
+ size?: CodegenTypes.Int32;
7
+ }
8
+ declare const _default: import("react-native").HostComponent<QRCodeNativeComponentProps>;
9
+ export default _default;
10
+ //# sourceMappingURL=RNQRCodeNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RNQRCodeNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/RNQRCodeNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAA0B,YAAY,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,WAAW,0BAA2B,SAAQ,SAAS;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;CAC3B;;AAED,wBAA8E"}
@@ -1,3 +1,6 @@
1
- export { default as RCTQRCodeView } from './RCTQRCodeViewNativeComponent';
2
- export * from './RCTQRCodeViewNativeComponent';
1
+ import RNQRCode from './RNQRCodeNativeComponent';
2
+ import RNBarCode from './RNBarCodeNativeComponent';
3
+ import BarCodeView from './BarCodeView';
4
+ import QRCodeView from './QRCodeView';
5
+ export { BarCodeView, QRCodeView, RNQRCode, RNBarCode };
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1E,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AACjD,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,169 +1,170 @@
1
1
  {
2
- "name": "@momo-kits/qrcode",
3
- "version": "0.150.2-beta.11",
4
- "description": "RCTQRCode & RCTBarCode",
5
- "main": "./lib/module/index.js",
6
- "types": "./lib/typescript/src/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "source": "./src/index.tsx",
10
- "types": "./lib/typescript/src/index.d.ts",
11
- "default": "./lib/module/index.js"
2
+ "name": "@momo-kits/qrcode",
3
+ "version": "0.150.2-beta.13",
4
+ "description": "A simple and customizable QR code generator component for React Native apps.",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
12
14
  },
13
- "./package.json": "./package.json"
14
- },
15
- "files": [
16
- "src",
17
- "lib",
18
- "android",
19
- "ios",
20
- "cpp",
21
- "*.podspec",
22
- "react-native.config.js",
23
- "!ios/build",
24
- "!android/build",
25
- "!android/gradle",
26
- "!android/gradlew",
27
- "!android/gradlew.bat",
28
- "!android/local.properties",
29
- "!**/__tests__",
30
- "!**/__fixtures__",
31
- "!**/__mocks__",
32
- "!**/.*"
33
- ],
34
- "scripts": {
35
- "example": "yarn workspace @momo-kits/qrcode-example",
36
- "test": "jest",
37
- "typecheck": "tsc",
38
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
40
- "prepare": "bob build",
41
- "release": "release-it --only-version"
42
- },
43
- "keywords": [
44
- "react-native",
45
- "ios",
46
- "android"
47
- ],
48
- "repository": {
49
- "type": "git",
50
- "url": "git+https://momo-kits.github.io.git"
51
- },
52
- "author": "Dung <dung.huynh1@mservice.com.vn> (https://momo-kits.github.io)",
53
- "license": "MIT",
54
- "bugs": {
55
- "url": "https://momo-kits.github.io/issues"
56
- },
57
- "homepage": "https://momo-kits.github.io#readme",
58
- "publishConfig": {
59
- "registry": "https://registry.npmjs.org/"
60
- },
61
- "devDependencies": {
62
- "@commitlint/config-conventional": "^19.8.1",
63
- "@eslint/compat": "^1.3.2",
64
- "@eslint/eslintrc": "^3.3.1",
65
- "@eslint/js": "^9.35.0",
66
- "@evilmartians/lefthook": "^1.12.3",
67
- "@react-native-community/cli": "20.0.1",
68
- "@react-native/babel-preset": "0.81.1",
69
- "@react-native/eslint-config": "^0.81.1",
70
- "@release-it/conventional-changelog": "^10.0.1",
71
- "@types/jest": "^29.5.14",
72
- "@types/react": "^19.1.0",
73
- "commitlint": "^19.8.1",
74
- "del-cli": "^6.0.0",
75
- "eslint": "^9.35.0",
76
- "eslint-config-prettier": "^10.1.8",
77
- "eslint-plugin-prettier": "^5.5.4",
78
- "jest": "^29.7.0",
79
- "prettier": "^3.6.2",
80
- "react": "19.1.0",
81
- "react-native": "0.81.1",
82
- "react-native-builder-bob": "^0.40.13",
83
- "release-it": "^19.0.4",
84
- "turbo": "^2.5.6",
85
- "typescript": "^5.9.2"
86
- },
87
- "peerDependencies": {
88
- "react": "*",
89
- "react-native": "*"
90
- },
91
- "workspaces": [
92
- "example"
93
- ],
94
- "packageManager": "yarn@3.6.1",
95
- "jest": {
96
- "preset": "react-native",
97
- "modulePathIgnorePatterns": [
98
- "<rootDir>/example/node_modules",
99
- "<rootDir>/lib/"
100
- ]
101
- },
102
- "commitlint": {
103
- "extends": [
104
- "@commitlint/config-conventional"
105
- ]
106
- },
107
- "release-it": {
108
- "git": {
109
- "commitMessage": "chore: release ${version}",
110
- "tagName": "v${version}"
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace @momo-kits/qrcode-example",
36
+ "test": "jest",
37
+ "typecheck": "tsc",
38
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
40
+ "build": "bob build",
41
+ "release": "release-it --only-version"
111
42
  },
112
- "npm": {
113
- "publish": true
43
+ "keywords": [
44
+ "react-native",
45
+ "ios",
46
+ "android"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://www.npmjs.com/.git"
114
51
  },
115
- "github": {
116
- "release": true
52
+ "author": "dung.pham2 <dung.pham2@mservice.com.vn> (https://www.npmjs.com/)",
53
+ "license": "MIT",
54
+ "bugs": {
55
+ "url": "https://www.npmjs.com//issues"
117
56
  },
118
- "plugins": {
119
- "@release-it/conventional-changelog": {
120
- "preset": {
121
- "name": "angular"
122
- }
123
- }
124
- }
125
- },
126
- "prettier": {
127
- "quoteProps": "consistent",
128
- "singleQuote": true,
129
- "tabWidth": 2,
130
- "trailingComma": "es5",
131
- "useTabs": false
132
- },
133
- "react-native-builder-bob": {
134
- "source": "src",
135
- "output": "lib",
136
- "targets": [
137
- [
138
- "module",
139
- {
140
- "esm": true
57
+ "homepage": "https://www.npmjs.com/#readme",
58
+ "publishConfig": {
59
+ "registry": "https://registry.npmjs.org/"
60
+ },
61
+ "devDependencies": {
62
+ "@commitlint/config-conventional": "^19.6.0",
63
+ "@eslint/compat": "^1.2.7",
64
+ "@eslint/eslintrc": "^3.3.0",
65
+ "@eslint/js": "^9.22.0",
66
+ "@evilmartians/lefthook": "^1.5.0",
67
+ "@react-native-community/cli": "15.0.0-alpha.2",
68
+ "@react-native/babel-preset": "0.79.2",
69
+ "@react-native/eslint-config": "^0.78.0",
70
+ "@release-it/conventional-changelog": "^9.0.2",
71
+ "@types/jest": "^29.5.5",
72
+ "@types/react": "^19.0.0",
73
+ "commitlint": "^19.6.1",
74
+ "del-cli": "^5.1.0",
75
+ "eslint": "^9.22.0",
76
+ "eslint-config-prettier": "^10.1.1",
77
+ "eslint-plugin-prettier": "^5.2.3",
78
+ "jest": "^29.7.0",
79
+ "prettier": "^3.0.3",
80
+ "react": "19.0.0",
81
+ "react-native": "0.80.1",
82
+ "react-native-builder-bob": "^0.40.12",
83
+ "release-it": "^17.10.0",
84
+ "turbo": "^1.10.7",
85
+ "typescript": "^5.8.3"
86
+ },
87
+ "peerDependencies": {
88
+ "react": "*",
89
+ "react-native": "*"
90
+ },
91
+ "workspaces": [
92
+ "example"
93
+ ],
94
+ "packageManager": "yarn@1.22.22",
95
+ "jest": {
96
+ "preset": "react-native",
97
+ "modulePathIgnorePatterns": [
98
+ "<rootDir>/example/node_modules",
99
+ "<rootDir>/lib/"
100
+ ]
101
+ },
102
+ "commitlint": {
103
+ "extends": [
104
+ "@commitlint/config-conventional"
105
+ ]
106
+ },
107
+ "release-it": {
108
+ "git": {
109
+ "commitMessage": "chore: release ${version}",
110
+ "tagName": "v${version}"
111
+ },
112
+ "npm": {
113
+ "publish": true
114
+ },
115
+ "github": {
116
+ "release": true
117
+ },
118
+ "plugins": {
119
+ "@release-it/conventional-changelog": {
120
+ "preset": {
121
+ "name": "angular"
122
+ }
123
+ }
141
124
  }
142
- ],
143
- [
144
- "typescript",
145
- {
146
- "project": "tsconfig.build.json"
125
+ },
126
+ "prettier": {
127
+ "quoteProps": "consistent",
128
+ "singleQuote": true,
129
+ "tabWidth": 2,
130
+ "trailingComma": "es5",
131
+ "useTabs": false
132
+ },
133
+ "react-native-builder-bob": {
134
+ "source": "src",
135
+ "output": "lib",
136
+ "targets": [
137
+ [
138
+ "module",
139
+ {
140
+ "esm": true
141
+ }
142
+ ],
143
+ [
144
+ "typescript",
145
+ {
146
+ "project": "tsconfig.build.json"
147
+ }
148
+ ]
149
+ ]
150
+ },
151
+ "codegenConfig": {
152
+ "name": "QrcodeViewSpec",
153
+ "type": "all",
154
+ "jsSrcsDir": "src",
155
+ "android": {
156
+ "javaPackageName": "com.momokits.qrcode"
157
+ },
158
+ "ios": {
159
+ "componentProvider": {
160
+ "RNBarCode": "RNBarCode",
161
+ "RNQRCode": "RNQRCode"
162
+ }
147
163
  }
148
- ]
149
- ]
150
- },
151
- "codegenConfig": {
152
- "name": "RCTQRCodeViewSpec",
153
- "type": "all",
154
- "jsSrcsDir": "src",
155
- "android": {
156
- "javaPackageName": "com.momokits.qrcode"
157
164
  },
158
- "ios": {
159
- "componentProvider": {
160
- "RCTQRCodeView": "RCTQRCodeView"
161
- }
165
+ "create-react-native-library": {
166
+ "languages": "kotlin-objc",
167
+ "type": "fabric-view",
168
+ "version": "0.51.1"
162
169
  }
163
- },
164
- "create-react-native-library": {
165
- "languages": "kotlin-objc",
166
- "type": "fabric-view",
167
- "version": "0.54.3"
168
- }
169
170
  }
@@ -0,0 +1,15 @@
1
+ import RNBarCode from './RNBarCodeNativeComponent';
2
+ import { PixelRatio, CodegenTypes } from 'react-native';
3
+
4
+ type BarCodeViewProps = {
5
+ code: string;
6
+ width: CodegenTypes.Int32;
7
+ height: CodegenTypes.Int32;
8
+ ratio?: CodegenTypes.Float;
9
+ };
10
+
11
+ const BarCodeView = ({ ratio, ...props }: BarCodeViewProps) => {
12
+ return <RNBarCode ratio={ratio ?? PixelRatio.get()} {...props} />;
13
+ };
14
+
15
+ export default BarCodeView;