@convep_mobilogy/react-native-qms-plugin 0.5.2 → 0.6.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.
@@ -75,7 +75,7 @@ dependencies {
75
75
  implementation "com.facebook.react:react-android"
76
76
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
77
  implementation 'com.facebook.react:react-native:+'
78
- implementation "com.convep.qms:qms-plugin:1.0.0"
78
+ implementation "com.convep.qms:qms-plugin:1.2.0"
79
79
  // implementation files('libs/Qms_plugin-release.aar')
80
80
  implementation 'androidx.appcompat:appcompat:1.6.1'
81
81
 
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ // src/NativeQmsPlugin.tsx
4
+ import { TurboModuleRegistry } from 'react-native';
5
+ export default TurboModuleRegistry.getEnforcing('QmsPlugin');
6
+ //# sourceMappingURL=NativeQmsPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeQmsPlugin.ts"],"mappings":";;AAAA;AACA,SAASA,mBAAmB,QAA0B,cAAc;AAMpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,WAAW,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export { QmsDashboardView } from './QmsDashboardView';
3
+ export { QmsDashboardView } from "./QmsDashboardView.ios.js";
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["QmsDashboardView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["QmsDashboardView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,2BAAwB","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import { type TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ showPluginUI(): void;
4
+ }
5
+ declare const _default: Spec;
6
+ export default _default;
7
+ //# sourceMappingURL=NativeQmsPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeQmsPlugin.d.ts","sourceRoot":"","sources":["../../../src/NativeQmsPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,YAAY,IAAI,IAAI,CAAC;CACtB;;AAED,wBAAmE"}
@@ -1,3 +1,3 @@
1
- export { QmsDashboardView } from './QmsDashboardView';
1
+ export { QmsDashboardView } from './QmsDashboardView.ios';
2
2
  export type { QmsDashboardViewProps } from './QmsDashboardView.types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convep_mobilogy/react-native-qms-plugin",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "To handle defect managment",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -148,6 +148,14 @@
148
148
  ]
149
149
  ]
150
150
  },
151
+ "codegenConfig": {
152
+ "name": "QmsPluginSpec",
153
+ "type": "modules",
154
+ "jsSrcsDir": "src",
155
+ "android": {
156
+ "javaPackageName": "com.qmsplugin"
157
+ }
158
+ },
151
159
  "create-react-native-library": {
152
160
  "languages": "kotlin-objc",
153
161
  "type": "turbo-module",
@@ -0,0 +1,8 @@
1
+ // src/NativeQmsPlugin.tsx
2
+ import { TurboModuleRegistry, type TurboModule } from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ showPluginUI(): void;
6
+ }
7
+
8
+ export default TurboModuleRegistry.getEnforcing<Spec>('QmsPlugin');
package/src/index.tsx CHANGED
@@ -1,2 +1,2 @@
1
- export { QmsDashboardView } from './QmsDashboardView';
1
+ export { QmsDashboardView } from './QmsDashboardView.ios';
2
2
  export type { QmsDashboardViewProps } from './QmsDashboardView.types';
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- import React, { useEffect } from 'react';
4
- import { NativeModules, Platform, requireNativeComponent, View } from 'react-native';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- const {
7
- QmsModule
8
- } = NativeModules;
9
-
10
- // Only resolve the native view on iOS to avoid runtime errors on Android
11
- const NativeQmsDashboardView = Platform.OS === 'ios' ? requireNativeComponent('QmsDashboardView') : null;
12
- export const showQms = (token, clientID, clientCode) => {
13
- QmsModule?.showQms?.(token, clientID, clientCode);
14
- };
15
- export const QmsDashboardView = ({
16
- style,
17
- clientID = '',
18
- clientCode = '',
19
- user_token,
20
- token,
21
- userToken,
22
- autoShow = true
23
- }) => {
24
- const effectiveToken = user_token ?? token ?? userToken ?? '';
25
- useEffect(() => {
26
- if (Platform.OS === 'android' && autoShow) {
27
- QmsModule?.showQms?.(effectiveToken, clientID, clientCode);
28
- }
29
- }, [effectiveToken, clientID, clientCode, autoShow]);
30
- if (Platform.OS === 'ios') {
31
- return NativeQmsDashboardView && /*#__PURE__*/_jsx(NativeQmsDashboardView, {
32
- style: style,
33
- ClientID: clientID,
34
- ClientCode: clientCode,
35
- user_token: effectiveToken
36
- });
37
- }
38
- return /*#__PURE__*/_jsx(View, {
39
- style: style
40
- });
41
- };
42
- //# sourceMappingURL=QmsDashboardView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useEffect","NativeModules","Platform","requireNativeComponent","View","jsx","_jsx","QmsModule","NativeQmsDashboardView","OS","showQms","token","clientID","clientCode","QmsDashboardView","style","user_token","userToken","autoShow","effectiveToken","ClientID","ClientCode"],"sourceRoot":"../../src","sources":["QmsDashboardView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,aAAa,EACbC,QAAQ,EACRC,sBAAsB,EACtBC,IAAI,QACC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAqBtB,MAAM;EAAEC;AAAU,CAAC,GAAGN,aAAa;;AAEnC;AACA,MAAMO,sBAAsB,GAC1BN,QAAQ,CAACO,EAAE,KAAK,KAAK,GACjBN,sBAAsB,CAAW,kBAAkB,CAAC,GACpD,IAAI;AAEV,OAAO,MAAMO,OAAO,GAAGA,CACrBC,KAAc,EACdC,QAAiB,EACjBC,UAAmB,KAChB;EACHN,SAAS,EAAEG,OAAO,GAAGC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,CAAC;AACnD,CAAC;AAED,OAAO,MAAMC,gBAA6C,GAAGA,CAAC;EAC5DC,KAAK;EACLH,QAAQ,GAAG,EAAE;EACbC,UAAU,GAAG,EAAE;EACfG,UAAU;EACVL,KAAK;EACLM,SAAS;EACTC,QAAQ,GAAG;AACb,CAAC,KAAK;EACJ,MAAMC,cAAc,GAAGH,UAAU,IAAIL,KAAK,IAAIM,SAAS,IAAI,EAAE;EAE7DjB,SAAS,CAAC,MAAM;IACd,IAAIE,QAAQ,CAACO,EAAE,KAAK,SAAS,IAAIS,QAAQ,EAAE;MACzCX,SAAS,EAAEG,OAAO,GAAGS,cAAc,EAAEP,QAAQ,EAAEC,UAAU,CAAC;IAC5D;EACF,CAAC,EAAE,CAACM,cAAc,EAAEP,QAAQ,EAAEC,UAAU,EAAEK,QAAQ,CAAC,CAAC;EAEpD,IAAIhB,QAAQ,CAACO,EAAE,KAAK,KAAK,EAAE;IACzB,OACED,sBAAsB,iBACpBF,IAAA,CAACE,sBAAsB;MACrBO,KAAK,EAAEA,KAAM;MACbK,QAAQ,EAAER,QAAS;MACnBS,UAAU,EAAER,UAAW;MACvBG,UAAU,EAAEG;IAAe,CAC5B,CACF;EAEL;EAEA,oBAAOb,IAAA,CAACF,IAAI;IAACW,KAAK,EAAEA;EAAM,CAAE,CAAC;AAC/B,CAAC","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { ViewStyle } from 'react-native';
3
- export type QmsDashboardProps = {
4
- style?: ViewStyle;
5
- clientID?: string;
6
- clientCode?: string;
7
- user_token?: string;
8
- token?: string;
9
- userToken?: string;
10
- autoShow?: boolean;
11
- };
12
- export declare const showQms: (token?: string, clientID?: string, clientCode?: string) => void;
13
- export declare const QmsDashboardView: React.FC<QmsDashboardProps>;
14
- //# sourceMappingURL=QmsDashboardView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"QmsDashboardView.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAS9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAUF,eAAO,MAAM,OAAO,WACV,MAAM,aACH,MAAM,eACJ,MAAM,SAGpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA+BxD,CAAC"}
@@ -1,75 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import {
3
- NativeModules,
4
- Platform,
5
- requireNativeComponent,
6
- View,
7
- } from 'react-native';
8
- import type { ViewStyle } from 'react-native';
9
-
10
- type IOSProps = {
11
- style?: ViewStyle;
12
- ClientID?: string;
13
- ClientCode?: string;
14
- user_token?: string;
15
- };
16
-
17
- export type QmsDashboardProps = {
18
- style?: ViewStyle;
19
- clientID?: string;
20
- clientCode?: string;
21
- // prefer snake_case to match native expectation; keep others for compatibility
22
- user_token?: string;
23
- token?: string;
24
- userToken?: string;
25
- autoShow?: boolean;
26
- };
27
-
28
- const { QmsModule } = NativeModules;
29
-
30
- // Only resolve the native view on iOS to avoid runtime errors on Android
31
- const NativeQmsDashboardView =
32
- Platform.OS === 'ios'
33
- ? requireNativeComponent<IOSProps>('QmsDashboardView')
34
- : null;
35
-
36
- export const showQms = (
37
- token?: string,
38
- clientID?: string,
39
- clientCode?: string
40
- ) => {
41
- QmsModule?.showQms?.(token, clientID, clientCode);
42
- };
43
-
44
- export const QmsDashboardView: React.FC<QmsDashboardProps> = ({
45
- style,
46
- clientID = '',
47
- clientCode = '',
48
- user_token,
49
- token,
50
- userToken,
51
- autoShow = true,
52
- }) => {
53
- const effectiveToken = user_token ?? token ?? userToken ?? '';
54
-
55
- useEffect(() => {
56
- if (Platform.OS === 'android' && autoShow) {
57
- QmsModule?.showQms?.(effectiveToken, clientID, clientCode);
58
- }
59
- }, [effectiveToken, clientID, clientCode, autoShow]);
60
-
61
- if (Platform.OS === 'ios') {
62
- return (
63
- NativeQmsDashboardView && (
64
- <NativeQmsDashboardView
65
- style={style}
66
- ClientID={clientID}
67
- ClientCode={clientCode}
68
- user_token={effectiveToken}
69
- />
70
- )
71
- );
72
- }
73
-
74
- return <View style={style} />;
75
- };