@zean-chat/react 0.1.4 → 0.1.7
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.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export type { ZeanChatProps, ZeanControls } from './interfaces.js';
|
|
|
5
5
|
* Shows the chat. Render it once, near the root, on every page. It renders nothing itself: the chat sits in its own
|
|
6
6
|
* frame, and stays across page changes.
|
|
7
7
|
*/
|
|
8
|
-
export declare function ZeanChat({ appKey, user, attributes, locale, loaderUrl }: ZeanChatProps): null;
|
|
8
|
+
export declare function ZeanChat({ appKey, user, attributes, locale, tabAlert, loaderUrl }: ZeanChatProps): null;
|
|
9
9
|
/** Opens and closes the chat, and follows the unread count. Works in any component, before the chat has loaded. */
|
|
10
10
|
export declare function useZean(): ZeanControls;
|
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { useEffect, useRef, useSyncExternalStore } from "react";
|
|
5
5
|
import { loadZean, zean } from "@zean-chat/js";
|
|
6
|
-
function ZeanChat({ appKey, user, attributes, locale, loaderUrl }) {
|
|
6
|
+
function ZeanChat({ appKey, user, attributes, locale, tabAlert, loaderUrl }) {
|
|
7
7
|
const userKey = user ? JSON.stringify(user) : null;
|
|
8
8
|
const identified = useRef(false);
|
|
9
9
|
const attributesKey = attributes ? JSON.stringify(attributes) : null;
|
|
10
10
|
useEffect(() => {
|
|
11
|
-
loadZean({ appKey, locale, loaderUrl });
|
|
12
|
-
}, [appKey, locale, loaderUrl]);
|
|
11
|
+
loadZean({ appKey, locale, tabAlert, loaderUrl });
|
|
12
|
+
}, [appKey, locale, tabAlert, loaderUrl]);
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
if (userKey) zean.identify(JSON.parse(userKey));
|
|
15
15
|
else if (identified.current) zean.signOut();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zean-chat/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Live chat widget for React and Next.js: add a free customer support chat to your app with one component and a hook. Intercom and Crisp alternative.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"check-types": "tsc --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@zean-chat/js": "^0.1.
|
|
60
|
+
"@zean-chat/js": "^0.1.6"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"react": ">=18"
|