@appilots/sdk 0.8.0 → 0.11.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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkAYWMBMSN_js = require('./chunk-AYWMBMSN.js');
3
+ var chunk55Y2AQE7_js = require('./chunk-55Y2AQE7.js');
4
4
  var React = require('react');
5
5
 
6
6
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -15,24 +15,27 @@ function getActiveRouteName(state) {
15
15
  return route.name;
16
16
  }
17
17
  function AppilotsNavigationContainer({ children }) {
18
- const { emit } = chunkAYWMBMSN_js.useAppilotsContext();
18
+ const { emit } = chunk55Y2AQE7_js.useAppilotsContext();
19
19
  const internalRef = React.useRef(null);
20
- const handleRef = React.useCallback((instance) => {
21
- internalRef.current = instance;
22
- chunkAYWMBMSN_js.setNavigationRef(instance);
23
- const childRef = children.ref;
24
- if (typeof childRef === "function") childRef(instance);
25
- else if (childRef && typeof childRef === "object") childRef.current = instance;
26
- if (instance) {
27
- console.log("[Appilots] NavigationContainer ref captured");
28
- }
29
- }, [children]);
20
+ const handleRef = React.useCallback(
21
+ (instance) => {
22
+ internalRef.current = instance;
23
+ chunk55Y2AQE7_js.setNavigationRef(instance);
24
+ const childRef = children.ref;
25
+ if (typeof childRef === "function") childRef(instance);
26
+ else if (childRef && typeof childRef === "object") childRef.current = instance;
27
+ if (instance) {
28
+ chunk55Y2AQE7_js.appilotsDebugLog("NavigationContainer ref captured");
29
+ }
30
+ },
31
+ [children]
32
+ );
30
33
  const handleStateChange = React.useCallback(
31
34
  (state) => {
32
35
  const routeName = getActiveRouteName(state);
33
36
  if (routeName) {
34
- console.log(`[Appilots] Screen changed \u2192 "${routeName}"`);
35
- chunkAYWMBMSN_js.setCurrentScreen(routeName);
37
+ chunk55Y2AQE7_js.appilotsDebugLog(`Screen changed \u2192 "${routeName}"`);
38
+ chunk55Y2AQE7_js.setCurrentScreen(routeName);
36
39
  emit({
37
40
  type: "navigation:change",
38
41
  timestamp: Date.now(),
@@ -47,8 +50,8 @@ function AppilotsNavigationContainer({ children }) {
47
50
  const timer = setTimeout(() => {
48
51
  const route = internalRef.current?.getCurrentRoute?.();
49
52
  if (route?.name) {
50
- console.log(`[Appilots] Initial screen \u2192 "${route.name}"`);
51
- chunkAYWMBMSN_js.setCurrentScreen(route.name);
53
+ chunk55Y2AQE7_js.appilotsDebugLog(`Initial screen \u2192 "${route.name}"`);
54
+ chunk55Y2AQE7_js.setCurrentScreen(route.name);
52
55
  emit({
53
56
  type: "navigation:change",
54
57
  timestamp: Date.now(),