@appilots/sdk 0.8.0 → 0.10.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/README.md +5 -4
- package/dist/.build-meta.json +5 -0
- package/dist/{chunk-H7BMQTXH.js → chunk-2GCWCPSD.js} +19 -16
- package/dist/{chunk-C2KVVJ5K.mjs → chunk-AHHDOUVX.mjs} +1968 -386
- package/dist/{chunk-ZSEACJKU.mjs → chunk-IHPLS5FE.mjs} +16 -13
- package/dist/{chunk-N7EAOLBP.js → chunk-VX7AL4SA.js} +956 -1134
- package/dist/{chunk-MHWVRZYF.mjs → chunk-XHR65V2W.mjs} +736 -919
- package/dist/{chunk-AYWMBMSN.js → chunk-YB77RYCC.js} +1992 -384
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +11 -11
- package/dist/hooks/index.mjs +2 -2
- package/dist/{index-BdYY-dvG.d.mts → index-BPZ0j71S.d.mts} +254 -6
- package/dist/{index-BdYY-dvG.d.ts → index-BPZ0j71S.d.ts} +254 -6
- package/dist/index.d.mts +306 -21
- package/dist/index.d.ts +306 -21
- package/dist/index.js +337 -229
- package/dist/index.mjs +269 -173
- package/dist/navigation/index.d.mts +171 -3
- package/dist/navigation/index.d.ts +171 -3
- package/dist/navigation/index.js +13 -13
- package/dist/navigation/index.mjs +2 -2
- package/metro.d.ts +16 -1
- package/metro.js +104 -10
- package/package.json +4 -2
- package/dist/registerScreen-D1oGm28T.d.mts +0 -159
- package/dist/registerScreen-D1oGm28T.d.ts +0 -159
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@ pnpm add @appilots/sdk
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
|
-
import { AppilotsProvider, AppilotsChat } from '@appilots/sdk';
|
|
18
|
+
import { AppilotsProvider, AppilotsNavigationContainer, AppilotsChat } from '@appilots/sdk';
|
|
19
|
+
import { NavigationContainer } from '@react-navigation/native';
|
|
19
20
|
|
|
20
21
|
function App() {
|
|
21
22
|
return (
|
|
@@ -24,9 +25,9 @@ function App() {
|
|
|
24
25
|
projectId: 'your-project-id',
|
|
25
26
|
}}
|
|
26
27
|
>
|
|
27
|
-
<
|
|
28
|
-
{/* Your app screens */}
|
|
29
|
-
</
|
|
28
|
+
<AppilotsNavigationContainer>
|
|
29
|
+
<NavigationContainer>{/* Your app screens */}</NavigationContainer>
|
|
30
|
+
</AppilotsNavigationContainer>
|
|
30
31
|
<AppilotsChat />
|
|
31
32
|
</AppilotsProvider>
|
|
32
33
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYB77RYCC_js = require('./chunk-YB77RYCC.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 } =
|
|
18
|
+
const { emit } = chunkYB77RYCC_js.useAppilotsContext();
|
|
19
19
|
const internalRef = React.useRef(null);
|
|
20
|
-
const handleRef = React.useCallback(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
const handleRef = React.useCallback(
|
|
21
|
+
(instance) => {
|
|
22
|
+
internalRef.current = instance;
|
|
23
|
+
chunkYB77RYCC_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
|
+
chunkYB77RYCC_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
|
-
|
|
35
|
-
|
|
37
|
+
chunkYB77RYCC_js.appilotsDebugLog(`Screen changed \u2192 "${routeName}"`);
|
|
38
|
+
chunkYB77RYCC_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
|
-
|
|
51
|
-
|
|
53
|
+
chunkYB77RYCC_js.appilotsDebugLog(`Initial screen \u2192 "${route.name}"`);
|
|
54
|
+
chunkYB77RYCC_js.setCurrentScreen(route.name);
|
|
52
55
|
emit({
|
|
53
56
|
type: "navigation:change",
|
|
54
57
|
timestamp: Date.now(),
|