@openpanel/react-native 0.0.11-beta → 1.0.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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -6
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var A=Object.create;var c=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},o=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of v(t))!O.call(e,a)&&a!==r&&c(e,a,{get:()=>t[a],enumerable:!(n=_(t,a))||n.enumerable});return e},s=(e,t,r)=>(o(e,t,"default"),r&&o(r,t,"default")),f=(e,t,r)=>(r=e!=null?A(P(e)):{},o(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),b=e=>o(c({},"__esModule",{value:!0}),e);var i={};V(i,{OpenPanel:()=>d});module.exports=b(i);var l=require("react-native"),p=f(require("expo-application"),1),m=f(require("expo-constants"),1),u=require("@openpanel/sdk");s(i,require("@openpanel/sdk"),module.exports);var d=class extends u.OpenPanel{constructor(r){super({...r,sdk:"react-native",sdkVersion:"1.0.0"});this.options=r;this.api.addHeader("User-Agent",m.default.getWebViewUserAgentAsync()),l.AppState.addEventListener("change",n=>{n==="active"&&this.setDefaultProperties()}),this.setDefaultProperties()}async setDefaultProperties(){this.setGlobalProperties({__version:p.nativeApplicationVersion,__buildNumber:p.nativeBuildVersion,__referrer:l.Platform.OS==="android"?await p.getInstallReferrerAsync():void 0})}screenView(r,n){super.track("screen_view",{...n,__path:r})}};0&&(module.exports={OpenPanel,...require("@openpanel/sdk")});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.ts"],"sourcesContent":["import { AppState, Platform } from 'react-native';\nimport * as Application from 'expo-application';\nimport Constants from 'expo-constants';\n\nimport type {
|
|
1
|
+
{"version":3,"sources":["../index.ts"],"sourcesContent":["import { AppState, Platform } from 'react-native';\nimport * as Application from 'expo-application';\nimport Constants from 'expo-constants';\n\nimport type { OpenPanelOptions, TrackProperties } from '@openpanel/sdk';\nimport { OpenPanel as OpenPanelBase } from '@openpanel/sdk';\n\nexport * from '@openpanel/sdk';\n\nexport class OpenPanel extends OpenPanelBase {\n constructor(public options: OpenPanelOptions) {\n super({\n ...options,\n sdk: 'react-native',\n sdkVersion: process.env.REACT_NATIVE_VERSION!,\n });\n\n this.api.addHeader('User-Agent', Constants.getWebViewUserAgentAsync());\n\n AppState.addEventListener('change', (state) => {\n if (state === 'active') {\n this.setDefaultProperties();\n }\n });\n\n this.setDefaultProperties();\n }\n\n private async setDefaultProperties() {\n this.setGlobalProperties({\n __version: Application.nativeApplicationVersion,\n __buildNumber: Application.nativeBuildVersion,\n __referrer:\n Platform.OS === 'android'\n ? await Application.getInstallReferrerAsync()\n : undefined,\n });\n }\n\n public screenView(route: string, properties?: TrackProperties): void {\n super.track('screen_view', {\n ...properties,\n __path: route,\n });\n }\n}\n"],"mappings":"wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmC,wBACnCC,EAA6B,iCAC7BC,EAAsB,+BAGtBC,EAA2C,0BAE3CC,EAAAR,EAAc,0BAPd,gBASO,IAAME,EAAN,cAAwB,EAAAO,SAAc,CAC3C,YAAmBC,EAA2B,CAC5C,MAAM,CACJ,GAAGA,EACH,IAAK,eACL,WAAY,OACd,CAAC,EALgB,aAAAA,EAOjB,KAAK,IAAI,UAAU,aAAc,EAAAC,QAAU,yBAAyB,CAAC,EAErE,WAAS,iBAAiB,SAAWC,GAAU,CACzCA,IAAU,UACZ,KAAK,qBAAqB,CAE9B,CAAC,EAED,KAAK,qBAAqB,CAC5B,CAEA,MAAc,sBAAuB,CACnC,KAAK,oBAAoB,CACvB,UAAuB,2BACvB,cAA2B,qBAC3B,WACE,WAAS,KAAO,UACZ,MAAkB,0BAAwB,EAC1C,MACR,CAAC,CACH,CAEO,WAAWC,EAAeC,EAAoC,CACnE,MAAM,MAAM,cAAe,CACzB,GAAGA,EACH,OAAQD,CACV,CAAC,CACH,CACF","names":["react_native_exports","__export","OpenPanel","__toCommonJS","import_react_native","Application","import_expo_constants","import_sdk","__reExport","OpenPanelBase","options","Constants","state","route","properties"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenPanel as OpenPanel$1, OpenPanelOptions, TrackProperties } from '@openpanel/sdk';
|
|
2
2
|
export * from '@openpanel/sdk';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(options:
|
|
7
|
-
private
|
|
8
|
-
screenView(route: string, properties?:
|
|
4
|
+
declare class OpenPanel extends OpenPanel$1 {
|
|
5
|
+
options: OpenPanelOptions;
|
|
6
|
+
constructor(options: OpenPanelOptions);
|
|
7
|
+
private setDefaultProperties;
|
|
8
|
+
screenView(route: string, properties?: TrackProperties): void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { OpenPanel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpenPanel as OpenPanel$1, OpenPanelOptions, TrackProperties } from '@openpanel/sdk';
|
|
2
2
|
export * from '@openpanel/sdk';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constructor(options:
|
|
7
|
-
private
|
|
8
|
-
screenView(route: string, properties?:
|
|
4
|
+
declare class OpenPanel extends OpenPanel$1 {
|
|
5
|
+
options: OpenPanelOptions;
|
|
6
|
+
constructor(options: OpenPanelOptions);
|
|
7
|
+
private setDefaultProperties;
|
|
8
|
+
screenView(route: string, properties?: TrackProperties): void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export {
|
|
11
|
+
export { OpenPanel };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{AppState as
|
|
1
|
+
import{AppState as s,Platform as n}from"react-native";import*as e from"expo-application";import p from"expo-constants";import{OpenPanel as a}from"@openpanel/sdk";export*from"@openpanel/sdk";var i=class extends a{constructor(t){super({...t,sdk:"react-native",sdkVersion:"1.0.0"});this.options=t;this.api.addHeader("User-Agent",p.getWebViewUserAgentAsync()),s.addEventListener("change",r=>{r==="active"&&this.setDefaultProperties()}),this.setDefaultProperties()}async setDefaultProperties(){this.setGlobalProperties({__version:e.nativeApplicationVersion,__buildNumber:e.nativeBuildVersion,__referrer:n.OS==="android"?await e.getInstallReferrerAsync():void 0})}screenView(t,r){super.track("screen_view",{...r,__path:t})}};export{i as OpenPanel};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.ts"],"sourcesContent":["import { AppState, Platform } from 'react-native';\nimport * as Application from 'expo-application';\nimport Constants from 'expo-constants';\n\nimport type {
|
|
1
|
+
{"version":3,"sources":["../index.ts"],"sourcesContent":["import { AppState, Platform } from 'react-native';\nimport * as Application from 'expo-application';\nimport Constants from 'expo-constants';\n\nimport type { OpenPanelOptions, TrackProperties } from '@openpanel/sdk';\nimport { OpenPanel as OpenPanelBase } from '@openpanel/sdk';\n\nexport * from '@openpanel/sdk';\n\nexport class OpenPanel extends OpenPanelBase {\n constructor(public options: OpenPanelOptions) {\n super({\n ...options,\n sdk: 'react-native',\n sdkVersion: process.env.REACT_NATIVE_VERSION!,\n });\n\n this.api.addHeader('User-Agent', Constants.getWebViewUserAgentAsync());\n\n AppState.addEventListener('change', (state) => {\n if (state === 'active') {\n this.setDefaultProperties();\n }\n });\n\n this.setDefaultProperties();\n }\n\n private async setDefaultProperties() {\n this.setGlobalProperties({\n __version: Application.nativeApplicationVersion,\n __buildNumber: Application.nativeBuildVersion,\n __referrer:\n Platform.OS === 'android'\n ? await Application.getInstallReferrerAsync()\n : undefined,\n });\n }\n\n public screenView(route: string, properties?: TrackProperties): void {\n super.track('screen_view', {\n ...properties,\n __path: route,\n });\n }\n}\n"],"mappings":"AAAA,OAAS,YAAAA,EAAU,YAAAC,MAAgB,eACnC,UAAYC,MAAiB,mBAC7B,OAAOC,MAAe,iBAGtB,OAAS,aAAaC,MAAqB,iBAE3C,WAAc,iBAEP,IAAMC,EAAN,cAAwBD,CAAc,CAC3C,YAAmBE,EAA2B,CAC5C,MAAM,CACJ,GAAGA,EACH,IAAK,eACL,WAAY,OACd,CAAC,EALgB,aAAAA,EAOjB,KAAK,IAAI,UAAU,aAAcH,EAAU,yBAAyB,CAAC,EAErEH,EAAS,iBAAiB,SAAWO,GAAU,CACzCA,IAAU,UACZ,KAAK,qBAAqB,CAE9B,CAAC,EAED,KAAK,qBAAqB,CAC5B,CAEA,MAAc,sBAAuB,CACnC,KAAK,oBAAoB,CACvB,UAAuB,2BACvB,cAA2B,qBAC3B,WACEN,EAAS,KAAO,UACZ,MAAkB,0BAAwB,EAC1C,MACR,CAAC,CACH,CAEO,WAAWO,EAAeC,EAAoC,CACnE,MAAM,MAAM,cAAe,CACzB,GAAGA,EACH,OAAQD,CACV,CAAC,CACH,CACF","names":["AppState","Platform","Application","Constants","OpenPanelBase","OpenPanel","options","state","route","properties"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpanel/react-native",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"module": "./dist/index.mjs",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rm -rf dist && tsup",
|
|
@@ -9,21 +9,22 @@
|
|
|
9
9
|
"typecheck": "tsc --noEmit"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@openpanel/sdk": "0.0
|
|
12
|
+
"@openpanel/sdk": "1.0.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@openpanel/eslint-config": "workspace:*",
|
|
16
16
|
"@openpanel/prettier-config": "workspace:*",
|
|
17
17
|
"@openpanel/tsconfig": "workspace:*",
|
|
18
|
+
"@types/node": "^20.14.12",
|
|
18
19
|
"eslint": "^8.48.0",
|
|
19
20
|
"prettier": "^3.0.3",
|
|
20
21
|
"tsup": "^7.2.0",
|
|
21
22
|
"typescript": "^5.2.2"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
|
-
"react-native": "0.73 - 0.74",
|
|
25
25
|
"expo-application": "^5",
|
|
26
|
-
"expo-constants": "14 - 16"
|
|
26
|
+
"expo-constants": "14 - 16",
|
|
27
|
+
"react-native": "0.73 - 0.74"
|
|
27
28
|
},
|
|
28
29
|
"eslintConfig": {
|
|
29
30
|
"root": true,
|
|
@@ -40,7 +41,10 @@
|
|
|
40
41
|
"dist"
|
|
41
42
|
],
|
|
42
43
|
"exports": {
|
|
43
|
-
"
|
|
44
|
-
|
|
44
|
+
".": {
|
|
45
|
+
"import": "./dist/index.js",
|
|
46
|
+
"require": "./dist/index.cjs",
|
|
47
|
+
"types": "./dist/index.d.ts"
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
}
|