react-native-acoustic-connect-beta 18.0.12 → 18.0.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 (48) hide show
  1. package/Examples/SampleUI/src/RootNavigator.tsx +1 -1
  2. package/Examples/SampleUI/src/index.native.tsx +46 -31
  3. package/android/src/main/assets/ConnectAdvancedConfig.json +1 -1
  4. package/android/src/main/assets/TealeafAdvancedConfig.json +1 -1
  5. package/lib/commonjs/TLTRN.js +219 -0
  6. package/lib/commonjs/TLTRN.js.map +1 -0
  7. package/lib/commonjs/components/Connect.js +37 -30
  8. package/lib/commonjs/components/Connect.js.map +1 -1
  9. package/lib/commonjs/components/ConnectProfiler.js +45 -0
  10. package/lib/commonjs/components/ConnectProfiler.js.map +1 -0
  11. package/lib/commonjs/index.js +14 -3
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/utils/KeyboardListener.js +110 -0
  14. package/lib/commonjs/utils/KeyboardListener.js.map +1 -0
  15. package/lib/module/TLTRN.js +214 -0
  16. package/lib/module/TLTRN.js.map +1 -0
  17. package/lib/module/components/Connect.js +37 -30
  18. package/lib/module/components/Connect.js.map +1 -1
  19. package/lib/module/components/ConnectProfiler.js +40 -0
  20. package/lib/module/components/ConnectProfiler.js.map +1 -0
  21. package/lib/module/index.js +4 -3
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/module/utils/KeyboardListener.js +105 -0
  24. package/lib/module/utils/KeyboardListener.js.map +1 -0
  25. package/lib/typescript/src/TLTRN.d.ts +47 -0
  26. package/lib/typescript/src/TLTRN.d.ts.map +1 -0
  27. package/lib/typescript/src/components/Connect.d.ts +2 -1
  28. package/lib/typescript/src/components/Connect.d.ts.map +1 -1
  29. package/lib/typescript/src/components/ConnectProfiler.d.ts +23 -0
  30. package/lib/typescript/src/components/ConnectProfiler.d.ts.map +1 -0
  31. package/lib/typescript/src/index.d.ts +3 -1
  32. package/lib/typescript/src/index.d.ts.map +1 -1
  33. package/{jslib/components/ConnectProfiler.js → lib/typescript/src/utils/KeyboardListener.d.ts} +9 -29
  34. package/lib/typescript/src/utils/KeyboardListener.d.ts.map +1 -0
  35. package/package.json +1 -2
  36. package/scripts/ConnectConfig.json +1 -1
  37. package/{jslib/TLTRN.js → src/TLTRN.ts} +54 -39
  38. package/src/components/Connect.tsx +102 -86
  39. package/src/components/ConnectProfiler.ts +43 -0
  40. package/src/index.ts +4 -2
  41. package/src/utils/KeyboardListener.ts +113 -0
  42. package/jslib/utils/KeyboardListener.js +0 -100
  43. package/lib/typescript/jslib/TLTRN.d.ts +0 -37
  44. package/lib/typescript/jslib/TLTRN.d.ts.map +0 -1
  45. package/lib/typescript/jslib/components/ConnectProfiler.d.ts +0 -10
  46. package/lib/typescript/jslib/components/ConnectProfiler.d.ts.map +0 -1
  47. package/lib/typescript/jslib/utils/KeyboardListener.d.ts +0 -10
  48. package/lib/typescript/jslib/utils/KeyboardListener.d.ts.map +0 -1
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+
3
+ /********************************************************************************************
4
+ * Copyright (C) 2025 Acoustic, L.P. All rights reserved.
5
+ *
6
+ * NOTICE: This file contains material that is confidential and proprietary to
7
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
8
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
9
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
10
+ * prohibited.
11
+ ********************************************************************************************/
12
+
13
+ import { Keyboard, TextInput } from "react-native";
14
+ import TLTRN from '../TLTRN';
15
+ class KeyboardListener {
16
+ static TLTRN = null;
17
+ static listener = null;
18
+ static _instance(_TLTRN) {
19
+ if (!KeyboardListener.listener) {
20
+ KeyboardListener.listener = new KeyboardListener(_TLTRN);
21
+ }
22
+ return KeyboardListener.listener;
23
+ }
24
+ constructor(_TLTRN) {
25
+ KeyboardListener.TLTRN = _TLTRN;
26
+ this.enabled = false;
27
+ let _x = {};
28
+ let _i = {};
29
+ const sanitize = (target, text) => {
30
+ if (!_x[target].secureTextEntry || typeof _x[target].secureTextEntry === "undefined") {
31
+ return text;
32
+ }
33
+ return new Array(text.length).fill("*").join("");
34
+ };
35
+ const flushData = () => {
36
+ _i = {};
37
+ _x = {};
38
+ };
39
+ const keyListener = (evt, bubbledEvent) => {
40
+ let _nativeTag = evt?.target?._nativeTag;
41
+ let valid = this.enabled && (!_i[_nativeTag] || _i[_nativeTag] === bubbledEvent);
42
+ if (!valid) {
43
+ return;
44
+ }
45
+ _i[_nativeTag] = bubbledEvent;
46
+ if (!_x[_nativeTag]) {
47
+ _x[_nativeTag] = {
48
+ text: ""
49
+ };
50
+ }
51
+ _x[_nativeTag].target = evt?.target?._nativeTag;
52
+ _x[_nativeTag].controlId = evt?._targetInst?.memoizedProps?.id;
53
+ _x[_nativeTag].ariaLabel = evt?._targetInst?.memoizedProps?.accessible?.accessibilityLabel;
54
+ _x[_nativeTag].secureTextEntry = evt?._targetInst?.memoizedProps?.secureTextEntry;
55
+ const anon = _k => {
56
+ if (_k !== "Backspace" && _k.length === 1) {
57
+ return _x[_nativeTag].text += sanitize(_nativeTag, _k);
58
+ } else if (_k !== "Backspace" && _k.length > 1) {
59
+ return sanitize(_nativeTag, _k);
60
+ } else {
61
+ return _x[_nativeTag].text.slice(0, -1);
62
+ }
63
+ };
64
+ let text = null;
65
+ switch (bubbledEvent) {
66
+ case "onTextInput":
67
+ text = evt?.nativeEvent?.text;
68
+ _x[_nativeTag].text = sanitize(_nativeTag, text || "");
69
+ break;
70
+ case "onKeyPress":
71
+ text = evt?.nativeEvent?.key;
72
+ _x[_nativeTag].text = anon(text || "");
73
+ break;
74
+ case "onChange":
75
+ text = evt?.nativeEvent?.text;
76
+ _x[_nativeTag].text = sanitize(_nativeTag, text || "");
77
+ break;
78
+ }
79
+ };
80
+ const keyboardDidHide = async () => {
81
+ let values = Object.values(_x);
82
+ for (let value of values) {
83
+ let {
84
+ text,
85
+ controlId,
86
+ ariaLabel,
87
+ target
88
+ } = value;
89
+ TLTRN.logTextChangeEvent(target, controlId, text, ariaLabel);
90
+ }
91
+ flushData();
92
+ };
93
+
94
+ // @ts-ignore: Ignore TypeScript error for defaultProps
95
+ TextInput.defaultProps = TextInput.defaultProps || {};
96
+ // @ts-ignore: Ignore TypeScript error for defaultProps
97
+ TextInput.defaultProps.onChange = evt => keyListener(evt, "onChange");
98
+ Keyboard.addListener("keyboardDidHide", keyboardDidHide);
99
+ }
100
+ interceptKeyboardEvents(enable) {
101
+ this.enabled = enable;
102
+ }
103
+ }
104
+ export default KeyboardListener;
105
+ //# sourceMappingURL=KeyboardListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Keyboard","TextInput","TLTRN","KeyboardListener","listener","_instance","_TLTRN","constructor","enabled","_x","_i","sanitize","target","text","secureTextEntry","Array","length","fill","join","flushData","keyListener","evt","bubbledEvent","_nativeTag","valid","controlId","_targetInst","memoizedProps","id","ariaLabel","accessible","accessibilityLabel","anon","_k","slice","nativeEvent","key","keyboardDidHide","values","Object","value","logTextChangeEvent","defaultProps","onChange","addListener","interceptKeyboardEvents","enable"],"sourceRoot":"../../../src","sources":["utils/KeyboardListener.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAYC,SAAS,QAAQ,cAAc;AAC5D,OAAOC,KAAK,MAAM,UAAU;AAE5B,MAAMC,gBAAgB,CAAC;EACnB,OAAOD,KAAK,GAAiB,IAAI;EACjC,OAAOE,QAAQ,GAA4B,IAAI;EAE/C,OAAOC,SAASA,CAACC,MAAa,EAAoB;IAC9C,IAAI,CAACH,gBAAgB,CAACC,QAAQ,EAAE;MAC5BD,gBAAgB,CAACC,QAAQ,GAAG,IAAID,gBAAgB,CAACG,MAAM,CAAC;IAC5D;IACA,OAAOH,gBAAgB,CAACC,QAAQ;EACpC;EAIAG,WAAWA,CAACD,MAAa,EAAE;IACvBH,gBAAgB,CAACD,KAAK,GAAGI,MAAM;IAE/B,IAAI,C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C;UACtD;MACR;IACJ,CAAC;IAED,MAAMwB,eAAe,GAAG,MAAAA,CAAA,KAA2B;MAC/C,IAAIC,MAAM,GAAGC,MAAM,CAACD,MAAM,CAAC7B,EAAE,CAAC;MAC9B,KAAK,IAAI+B,KAAK,IAAIF,MAAM,EAAE;QACtB,IAAI;UAAEzB,IAAI;UAAEY,SAAS;UAAEI,SAAS;UAAEjB;QAAO,CAAC,GAAG4B,KAAK;QAClDtC,KAAK,CAACuC,kBAAkB,CAAC7B,MAAM,EAAEa,SAAS,EAAEZ,IAAI,EAAEgB,SAAS,CAAC;MAChE;MACAV,SAAS,CAAC,CAAC;IACf,CAAC;;IAED;IACAlB,SAAS,CAACyC,YAAY,GAAGzC,SAAS,CAACyC,YAAY,IAAI,CAAC,CAAC;IACrD;IACAzC,SAAS,CAACyC,YAAY,CAACC,QAAQ,GAAItB,GAAQ,IAAKD,WAAW,CAACC,GAAG,EAAE,UAAU,CAAC;IAE5ErB,QAAQ,CAAC4C,WAAW,CAAC,iBAAiB,EAAEP,eAAe,CAAC;EAC5D;EAEAQ,uBAAuBA,CAACC,MAAe,EAAQ;IAC3C,IAAI,CAACtC,OAAO,GAAGsC,MAAM;EACzB;AACJ;AAEA,eAAe3C,gBAAgB","ignoreList":[]}
@@ -0,0 +1,47 @@
1
+ /********************************************************************************************
2
+ * Copyright (C) 2025 Acoustic, L.P. All rights reserved.
3
+ *
4
+ * NOTICE: This file contains material that is confidential and proprietary to
5
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
6
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
7
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
+ * prohibited.
9
+ ********************************************************************************************/
10
+ /// <reference types="node" />
11
+ declare class TLTRN {
12
+ static currentScreen: string;
13
+ static lastJSBridgeMessageTime: number;
14
+ static totalRenderTime: number;
15
+ static messageRenderTime: number;
16
+ static countMsgs: number;
17
+ static messageConsole: number;
18
+ static lastMessageConsole: number;
19
+ static isLoggingData: number;
20
+ static displayDebug: boolean;
21
+ static myTimer: {
22
+ handle: NodeJS.Timeout | null;
23
+ started: number;
24
+ time: number;
25
+ /**
26
+ * @type Class
27
+ */
28
+ startTimer: () => void;
29
+ /**
30
+ * @type Class
31
+ */
32
+ stopTimer: () => void;
33
+ };
34
+ static init: (initialCurrentScreen: String, showDebugConsoleMessages: boolean) => void;
35
+ static interceptKeyboardEvents: (enable: boolean) => void;
36
+ static logScreenViewPageName: (name: string | undefined) => boolean;
37
+ static logScreenViewContextLoad: (name: string, prevName: string) => boolean;
38
+ static logScreenLayout: (name: string | undefined) => boolean;
39
+ static logClickEvent: (event: any) => Promise<boolean>;
40
+ static logTextChangeEvent: (target: number, controlId: string, text: string, _ariaLabel: string) => Promise<boolean>;
41
+ static logCustomEvent: (eventName: string, values: Record<string, string | number | boolean>, level: number) => Promise<boolean>;
42
+ static listenToBridge: (message: any) => void;
43
+ static checkTime: () => void;
44
+ static logTeal: () => Promise<void>;
45
+ }
46
+ export default TLTRN;
47
+ //# sourceMappingURL=TLTRN.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TLTRN.d.ts","sourceRoot":"","sources":["../../../src/TLTRN.ts"],"names":[],"mappings":"AAAA;;;;;;;;6FAQ6F;;AAiB7F,cAAM,KAAK;IACT,MAAM,CAAC,aAAa,SACgD;IACpE,MAAM,CAAC,uBAAuB,SAAK;IACnC,MAAM,CAAC,eAAe,SAAK;IAC3B,MAAM,CAAC,iBAAiB,SAAK;IAC7B,MAAM,CAAC,SAAS,SAAK;IACrB,MAAM,CAAC,cAAc,SAAK;IAC1B,MAAM,CAAC,kBAAkB,SAAK;IAC9B,MAAM,CAAC,aAAa,SAAK;IACzB,MAAM,CAAC,YAAY,UAAS;IAE5B,MAAM,CAAC,OAAO;;;;QAIZ;;WAEG;;QAKH;;WAEG;;MAQH;IAEF,MAAM,CAAC,IAAI,yBAA0B,MAAM,4BAA4B,OAAO,UAQ5E;IAEF,MAAM,CAAC,uBAAuB,WAAY,OAAO,UAE/C;IAEF,MAAM,CAAC,qBAAqB,SAAU,MAAM,GAAG,SAAS,aAQtD;IAEF,MAAM,CAAC,wBAAwB,SAAU,MAAM,YAAY,MAAM,aAQ/D;IAEF,MAAM,CAAC,eAAe,SAAU,MAAM,GAAG,SAAS,aAShD;IAEF,MAAM,CAAC,aAAa,UAAiB,GAAG,sBAwBtC;IAEF,MAAM,CAAC,kBAAkB,WAAkB,MAAM,aAAa,MAAM,QAAQ,MAAM,cAAc,MAAM,sBAYpG;IAEF,MAAM,CAAC,cAAc,cAAqB,MAAM,UAAU,OAAO,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,sBAQhH;IAEF,MAAM,CAAC,cAAc,YAAa,GAAG,UAiEnC;IAEF,MAAM,CAAC,SAAS,aA6Bd;IAEF,MAAM,CAAC,OAAO,sBAsBZ;CACH;AAGD,eAAe,KAAK,CAAC"}
@@ -11,7 +11,8 @@ import React from "react";
11
11
  interface ConnectProps {
12
12
  children: React.ReactNode;
13
13
  captureKeyboardEvents: boolean;
14
+ navigationRef?: React.RefObject<any>;
14
15
  }
15
- declare const Connect: React.FC<ConnectProps>;
16
+ declare const Connect: React.ForwardRefExoticComponent<ConnectProps & React.RefAttributes<any>>;
16
17
  export default Connect;
17
18
  //# sourceMappingURL=Connect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Connect.d.ts","sourceRoot":"","sources":["../../../../src/components/Connect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;6FAQ6F;AAC7F,OAAO,KAAyC,MAAM,OAAO,CAAC;AAK9D,UAAU,YAAY;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qBAAqB,EAAE,OAAO,CAAC;CAClC;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyEnC,CAAC;AAWF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Connect.d.ts","sourceRoot":"","sources":["../../../../src/components/Connect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;6FAQ6F;AAC7F,OAAO,KAAqD,MAAM,OAAO,CAAC;AAK1E,UAAU,YAAY;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;CACxC;AAED,QAAA,MAAM,OAAO,0EAwFX,CAAC;AAWH,eAAe,OAAO,CAAC"}
@@ -0,0 +1,23 @@
1
+ /********************************************************************************************
2
+ * Copyright (C) 2025 Acoustic, L.P. All rights reserved.
3
+ *
4
+ * NOTICE: This file contains material that is confidential and proprietary to
5
+ * Acoustic, L.P. and/or other developers. No license is granted under any intellectual or
6
+ * industrial property rights of Acoustic, L.P. except as may be provided in an agreement with
7
+ * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
+ * prohibited.
9
+ ********************************************************************************************/
10
+ import React, { Component } from "react";
11
+ interface ConnectProfilerProps {
12
+ profileName?: string;
13
+ children?: React.ReactNode;
14
+ }
15
+ declare class ConnectProfiler extends Component<ConnectProfilerProps> {
16
+ startTime: number;
17
+ endTime: number;
18
+ constructor(props: ConnectProfilerProps);
19
+ componentDidMount(): void;
20
+ render(): React.ReactNode;
21
+ }
22
+ export default ConnectProfiler;
23
+ //# sourceMappingURL=ConnectProfiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectProfiler.d.ts","sourceRoot":"","sources":["../../../../src/components/ConnectProfiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;6FAQ6F;AAE7F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,UAAU,oBAAoB;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,cAAM,eAAgB,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IAC3D,SAAS,SAAK;IACd,OAAO,SAAK;gBAEA,KAAK,EAAE,oBAAoB;IAKvC,iBAAiB;IAUjB,MAAM;CAGP;AAED,eAAe,eAAe,CAAC"}
@@ -12,7 +12,9 @@
12
12
  ********************************************************************************************/
13
13
  import type { AcousticConnectRN as AcousticConnectRNSpec } from './specs/react-native-acoustic-connect.nitro';
14
14
  import Connect from './components/Connect';
15
+ import KeyboardListener from './utils/KeyboardListener';
16
+ import TLTRN from './TLTRN';
15
17
  declare const AcousticConnectRN: AcousticConnectRNSpec;
16
- export { Connect };
18
+ export { Connect, TLTRN, KeyboardListener };
17
19
  export default AcousticConnectRN;
18
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;6FAW6F;AAG7F,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAC7G,OAAO,OAAO,MAAM,sBAAsB,CAAA;AAE1C,QAAA,MAAM,iBAAiB,uBAA8E,CAAA;AAErG,OAAO,EAAE,OAAO,EAAE,CAAA;AAClB,eAAe,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;6FAW6F;AAG7F,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAC7G,OAAO,OAAO,MAAM,sBAAsB,CAAA;AAC1C,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,QAAA,MAAM,iBAAiB,uBAA8E,CAAA;AAErG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAC,CAAA;AAC1C,eAAe,iBAAiB,CAAA"}
@@ -7,34 +7,14 @@
7
7
  * Acoustic, L.P. Any unauthorized copying or distribution of content from this file is
8
8
  * prohibited.
9
9
  ********************************************************************************************/
10
-
11
- import React, {Component} from "react";
12
10
  import TLTRN from '../TLTRN';
13
-
14
-
15
- class ConnectProfiler extends Component {
16
- startTime = 0
17
- endTime = 0
18
-
19
- constructor(props){
20
- super(props)
21
- this.startTime = (new Date()).getTime();
22
-
23
- }
24
-
25
- componentDidMount(){
26
- this.endTime = (new Date()).getTime();
27
- const pageLoadTime = this.endTime - this.startTime
28
- const {profileName} = this.props
29
-
30
- if(profileName){
31
- TLTRN.logCustomEvent("Load Time",{profileName, pageLoadTime},1)
32
- }
33
- }
34
-
35
- render(){
36
- return this.props.children
37
- }
11
+ declare class KeyboardListener {
12
+ static TLTRN: TLTRN | null;
13
+ static listener: KeyboardListener | null;
14
+ static _instance(_TLTRN: TLTRN): KeyboardListener;
15
+ enabled: boolean;
16
+ constructor(_TLTRN: TLTRN);
17
+ interceptKeyboardEvents(enable: boolean): void;
38
18
  }
39
-
40
- export default ConnectProfiler;
19
+ export default KeyboardListener;
20
+ //# sourceMappingURL=KeyboardListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyboardListener.d.ts","sourceRoot":"","sources":["../../../../src/utils/KeyboardListener.ts"],"names":[],"mappings":"AAAA;;;;;;;;6FAQ6F;AAG7F,OAAO,KAAK,MAAM,UAAU,CAAC;AAE7B,cAAM,gBAAgB;IAClB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAQ;IAClC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAEhD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,GAAG,gBAAgB;IAOjD,OAAO,EAAE,OAAO,CAAC;gBAEL,MAAM,EAAE,KAAK;IAiFzB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;CAGjD;AAED,eAAe,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -53,7 +53,6 @@
53
53
  "src",
54
54
  "react-native.config.js",
55
55
  "lib",
56
- "jslib",
57
56
  "nitrogen",
58
57
  "cpp",
59
58
  "android/build.gradle",
@@ -193,7 +192,7 @@
193
192
  "source": "src/index",
194
193
  "summary": "react-native ios android tealeaf connect cxa wxca er enhanced-replay",
195
194
  "types": "./lib/typescript/src/index.d.ts",
196
- "version": "18.0.12",
195
+ "version": "18.0.13",
197
196
  "workspaces": [
198
197
  "example"
199
198
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "Connect": {
3
- "AndroidVersion": "10.4.37",
3
+ "AndroidVersion": "10.4.45",
4
4
  "AppKey": "b6c3709b7a4c479bb4b5a9fb8fec324c",
5
5
  "KillSwitchUrl": "https://lib-us-2.brilliantcollector.com/collector/switch/b6c3709b7a4c479bb4b5a9fb8fec324c",
6
6
  "PostMessageUrl": "https://lib-us-2.brilliantcollector.com/collector/collectorPost",
@@ -8,18 +8,20 @@
8
8
  * prohibited.
9
9
  ********************************************************************************************/
10
10
 
11
+ // @ts-ignore
11
12
  import MessageQueue from "react-native/Libraries/BatchedBridge/MessageQueue.js";
13
+ import { Platform } from "react-native";
12
14
  import KeyboardListener from "./utils/KeyboardListener";
13
- import AcousticConnectRN from 'react-native-acoustic-connect-beta';
14
-
15
- global.ErrorUtils.setGlobalHandler( (e, isFatal) => {
15
+ import AcousticConnectRN from './index';
16
16
 
17
+ // @ts-ignore
18
+ global.ErrorUtils.setGlobalHandler((e: any, _isFatal: boolean) => {
17
19
  AcousticConnectRN.logExceptionEvent(
18
20
  JSON.stringify(e),
19
21
  JSON.stringify(e),
20
22
  true
21
- );
22
- })
23
+ );
24
+ });
23
25
 
24
26
  class TLTRN {
25
27
  static currentScreen =
@@ -31,10 +33,10 @@ class TLTRN {
31
33
  static messageConsole = 0;
32
34
  static lastMessageConsole = 0;
33
35
  static isLoggingData = 0;
34
- static displayDebug = 0;
36
+ static displayDebug = false;
35
37
 
36
38
  static myTimer = {
37
- handle: 0,
39
+ handle: null as NodeJS.Timeout | null,
38
40
  started: 0,
39
41
  time: 1000,
40
42
  /**
@@ -50,57 +52,65 @@ class TLTRN {
50
52
  stopTimer: function () {
51
53
  if (this.handle) {
52
54
  clearInterval(this.handle);
53
- this.handle = 0;
55
+ this.handle = null;
54
56
  this.started = 0;
55
57
  }
56
58
  },
57
59
  };
58
60
 
59
- static init = (initialCurrentScreen, showDebugConsoleMessages) => {
61
+ static init = (initialCurrentScreen: String, showDebugConsoleMessages: boolean) => {
60
62
  TLTRN.currentScreen =
61
63
  initialCurrentScreen === undefined
64
+ // @ts-ignore:
62
65
  ? currentScreenMsg
63
66
  : initialCurrentScreen;
64
67
  MessageQueue.spy(TLTRN.listenToBridge);
65
- TLTRN.displayDebug =
66
- showDebugConsoleMessages === undefined ? 0 : showDebugConsoleMessages;
68
+ TLTRN.displayDebug = showDebugConsoleMessages === undefined ? false : showDebugConsoleMessages;
67
69
  };
68
70
 
69
- static interceptKeyboardEvents = (enable) => {
71
+ static interceptKeyboardEvents = (enable: boolean) => {
70
72
  keyListener.interceptKeyboardEvents(enable);
71
73
  };
72
74
 
73
- static logScreenViewPageName = (name) => {
75
+ static logScreenViewPageName = (name: string | undefined) => {
76
+ let result = false
74
77
  try {
75
- return AcousticConnectRN.setCurrentScreenName(name);
76
- } catch (error) {
78
+ result = AcousticConnectRN.setCurrentScreenName(name || '');
79
+ } catch (error: Error | any) {
77
80
  console.log('LogScreenViewPageName error: ', error.message);
78
81
  }
82
+ return result;
79
83
  };
80
84
 
81
- static logScreenViewContextLoad = (name, prevName) => {
85
+ static logScreenViewContextLoad = (name: string, prevName: string) => {
86
+ let result = false
82
87
  try {
83
- return AcousticConnectRN.logScreenViewContextLoad(name, prevName);
84
- } catch (error) {
88
+ result = AcousticConnectRN.logScreenViewContextLoad(name, prevName);
89
+ } catch (error: Error | any) {
85
90
  console.log('LogScreenViewContextLoad error: ', error.message);
86
91
  }
92
+ return result;
87
93
  };
88
94
 
89
- static logScreenLayout = (name) => {
90
- TLTRN.currentScreen = name;
95
+ static logScreenLayout = (name: string | undefined) => {
96
+ TLTRN.currentScreen = name || '';
97
+ let result = false
91
98
  try {
92
- return AcousticConnectRN.logScreenLayout(name, 0);
93
- } catch (error) {
99
+ result = AcousticConnectRN.logScreenLayout(TLTRN.currentScreen, 0);
100
+ } catch (error: Error | any) {
94
101
  console.log('LogScreenLayout error: ', error.message);
95
102
  }
103
+ return result;
96
104
  };
97
105
 
98
- static logClickEvent = async (event) => {
99
- if(!event.target._nativeTag || typeof event.target._nativeTag === 'undefined'){ return false; }
106
+ static logClickEvent = async (event: any) => {
107
+ let result = false
108
+
109
+ if(!event.target || !event.target._nativeTag || typeof event.target._nativeTag === 'undefined'){ return result; }
100
110
 
101
- const events = event._dispatchInstances.filter(node => {
102
- return (node.memoizedProps && node.memoizedProps.id)
103
- })
111
+ const events = event._dispatchInstances.filter((node: any) => {
112
+ return node.memoizedProps && node.memoizedProps.id;
113
+ });
104
114
  const id = (events.length) ? events[0].memoizedProps.id : '';
105
115
 
106
116
  let target = event.target._nativeTag;
@@ -109,36 +119,41 @@ class TLTRN {
109
119
 
110
120
  try {
111
121
  if (Platform.OS === 'ios') {
112
- return AcousticConnectRN.logClickEvent(target, controlId);
122
+ result = AcousticConnectRN.logClickEvent(target, controlId);
113
123
  } else if (Platform.OS === 'android') {
114
- return AcousticConnectRN.logClickEvent(target, controlId);
124
+ result = AcousticConnectRN.logClickEvent(target, controlId);
115
125
  }
116
- } catch(error){
126
+ } catch(error: Error | any){
117
127
  console.log('LogClickEvent error: ', error.message);
118
128
  }
129
+ return result;
119
130
  };
120
131
 
121
- static logTextChangeEvent = async (target, controlId, text, ariaLabel) => {
132
+ static logTextChangeEvent = async (target: number, controlId: string, text: string, _ariaLabel: string) => {
133
+ let result = false
122
134
  try {
123
135
  if (Platform.OS === 'ios') {
124
- await AcousticConnectRN.logTextChangeEvent(target, controlId, text);
136
+ result = AcousticConnectRN.logTextChangeEvent(target, controlId, text);
125
137
  } else if (Platform.OS === 'android') {
126
138
  AcousticConnectRN.logTextChangeEvent(target, controlId, text);
127
139
  }
128
- } catch (error) {
140
+ } catch (error: Error | any) {
129
141
  console.log('LogTextChangeEvent error: ', error.message);
130
142
  }
143
+ return result;
131
144
  };
132
145
 
133
- static logCustomEvent = async (eventName, values, level) => {
146
+ static logCustomEvent = async (eventName: string, values: Record<string, string | number | boolean>, level: number) => {
147
+ let result = false
134
148
  try {
135
- return await AcousticConnectRN.logCustomEvent(eventName, values, level);
136
- } catch (error) {
149
+ result = AcousticConnectRN.logCustomEvent(eventName, values, level);
150
+ } catch (error: Error | any) {
137
151
  console.log('LogCustomEvent error: ', error.message);
138
152
  }
153
+ return result;
139
154
  };
140
155
 
141
- static listenToBridge = (message) => {
156
+ static listenToBridge = (message: any) => {
142
157
  if (TLTRN.displayDebug) {
143
158
  console.log(
144
159
  "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&:isLoggingData:" +
@@ -232,14 +247,14 @@ class TLTRN {
232
247
  TLTRN.messageConsole = 0;
233
248
  TLTRN.lastMessageConsole = 0;
234
249
  TLTRN.myTimer.stopTimer();
235
- logTeal();
250
+ this.logTeal();
236
251
  }
237
252
  };
238
253
 
239
254
  static logTeal = async () => {
240
255
  try {
241
256
  TLTRN.isLoggingData = 1;
242
- var res = await AcousticConnectRN.logScreenLayout(TLTRN.currentScreen);
257
+ var res = await AcousticConnectRN.logScreenLayout(TLTRN.currentScreen, -1);
243
258
  var dict = { ReactLayoutTime: TLTRN.totalRenderTime };
244
259
  var result = await AcousticConnectRN.logCustomEvent("ReactPlugin", dict, 1);
245
260
  if (TLTRN.displayDebug) {