@cossistant/next 0.1.0 → 0.1.1
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/package.json +2 -2
- package/react/src/hooks/private/use-rest-client.d.ts.map +1 -1
- package/react/src/hooks/use-conversation-auto-seen.d.ts.map +1 -1
- package/react/src/hooks/use-conversation-seen.d.ts.map +1 -1
- package/react/src/hooks/use-conversation-typing.d.ts.map +1 -1
- package/react/src/provider.d.ts.map +1 -1
- package/react/src/realtime/provider.d.ts +4 -17
- package/react/src/realtime/provider.d.ts.map +1 -1
- package/react/src/realtime/seen-store.d.ts.map +1 -1
- package/react/src/realtime/support-provider.d.ts +8 -6
- package/react/src/realtime/support-provider.d.ts.map +1 -1
- package/react/src/realtime/typing-store.d.ts.map +1 -1
- package/react/src/support/context/websocket.d.ts +17 -7
- package/react/src/support/context/websocket.d.ts.map +1 -1
- package/react/src/support/store/support-store.d.ts +5 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cossistant/next",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Cossistant team",
|
|
7
7
|
"description": "Next.js-ready SDK for building AI-powered support/chat widgets. Hooks + primitives, WS-driven, TypeScript-first. Next.js-ready, Tailwind optional.",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@cossistant/react": "0.1.
|
|
83
|
+
"@cossistant/react": "0.1.1"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"react": ">=18 <20",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-rest-client.d.ts","names":[],"sources":["../../../../../../react/src/hooks/private/use-rest-client.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"use-rest-client.d.ts","names":[],"sources":["../../../../../../react/src/hooks/private/use-rest-client.ts"],"sourcesContent":[],"mappings":";;;KAYY,kBAAA;;EAAA,OAAA,EAAA,MAAA;EAMA,UAAA,EAAA,MAAe;AAkB3B,CAAA;KAlBY,eAAA;UAED;;;;;;sBAOY;;;;;;;;iBASP,SAAA,kEAIb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-conversation-auto-seen.d.ts","names":[],"sources":["../../../../../react/src/hooks/use-conversation-auto-seen.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"use-conversation-auto-seen.d.ts","names":[],"sources":["../../../../../react/src/hooks/use-conversation-auto-seen.ts"],"sourcesContent":[],"mappings":";;;cAKa,+BAAA;AAAA,KAMD,8BAAA,GANgC;EAMhC;AA4DZ;;UAxDS;;;;;;;;;;;;;oBAgBU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCH,uBAAA,UACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-conversation-seen.d.ts","names":[],"sources":["../../../../../react/src/hooks/use-conversation-seen.ts"],"sourcesContent":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"use-conversation-seen.d.ts","names":[],"sources":["../../../../../react/src/hooks/use-conversation-seen.ts"],"sourcesContent":[],"mappings":";AACkE,KAK7D,0BAAA,GAA0B;EAgBf,WAAA,CAAA,EAfD,gBAeoB,EAAA;AAqEnC,CAAA;;;;;iBArEgB,mBAAA,sDAEN,6BACP;;;;;;;iBAkEa,4BAAA,sDAEN,6CAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-conversation-typing.d.ts","names":[],"sources":["../../../../../react/src/hooks/use-conversation-typing.ts"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"use-conversation-typing.d.ts","names":[],"sources":["../../../../../react/src/hooks/use-conversation-typing.ts"],"sourcesContent":[],"mappings":";;;KAKY,6BAAA,GAAgC;KAEvC,4BAAA;EAFO,gBAAA,CAAA,EAAA,MAAA,GAAA,IAA6B;EAEpC,aAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EA6BW,gBAAA,CAAA,EAAA,MAAqB,GAAA,IAAA;;;;;;iBAArB,qBAAA,sDAEN,+BACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../react/src/provider.tsx"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../react/src/provider.tsx"],"sourcesContent":[],"mappings":";;;;;;KA+DY,oBAAA;YACD,KAAA,CAAM;EADL,WAAA,CAAA,EAAA,OAAA;EACD,MAAM,CAAA,EAAA,MAAA;EAKE,KAAA,CAAA,EAAA,MAAA;EAKE,SAAA,CAAA,EAAA,MAAA;EAAK,eAAA,CAAA,EALP,cAKO,EAAA;EAId,YAAA,CAAA,EAAA,MAAA,EAAA;EAEA,WAAA,CAAA,EAAA,OAAA;EACF,WAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EACQ,cAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAEc,SAAA,CAAA,EAAA,CAAA,KAAA,EAVX,KAUW,EAAA,GAAA,IAAA;EAKxB,IAAA,CAAA,EAAA,QAAA,GAAA,QAAA;CACa;AACZ,KAbG,uBAAA,GAA0B,oBAa7B;AAAgB,KAXb,sBAAA,GAWa;EAOpB,OAAA,EAjBK,qBAiBqB,GAAA,IAAA;EAE1B,eAAA,EAlBa,cAkBI,EAAA;EAAG,YAAA,EAAA,MAAA,EAAA;EAEV,kBAAA,EAAA,CAAA,QAAA,EAlBiB,cAkBjB,EAAA,EAAA,GAAA,IAAA;EAAZ,eAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,EAAA,GAAA,IAAA;EAAW,WAAA,EAAA,MAAA;EAiDF,cAAA,EAAA,CAAA,KAAe,EAAA,MAAA,EAAA,GAAA,IAAA;EAAG,SAAA,EAAA,OAAA;EACK,KAAA,EA/D3B,KA+D2B,GAAA,IAAA;EAAZ,kBAAA,EA9DF,kBA8DE,GAAA,IAAA;EACS,MAAA,EA9DvB,gBA8DuB,GAAA,IAAA;EAAZ,MAAA,EAAA,OAAA;EACT,IAAA,EAAA,GAAA,GAAA,IAAA;EAAiB,KAAA,EAAA,GAAA,GAAA,IAAA;EAIf,MAAA,EAAA,GAAA,GAAA,IAED;AA6VZ,CAAA;KA3ZK,WAAA,GAAc,WA4ZlB,CA5Z8B,sBA4Z9B,CAAA,SAAA,CAAA,CAAA;KA1ZI,iBAAA,GAAoB,WA2ZxB,CAAA,SAAA,CAAA,SAAA,IAAA,GAAA,SAAA,GAAA,SAAA,GAzZE,WAyZF,CAzZc,WAyZd,CAAA,SAAA,CAAA,CAAA,GAAA;EACA,MAAA,EAAA,MAAA,GAAA,IAAA;CACA;AACA,KA3WW,eAAA,GAAkB,sBA2W7B,GAAA;EACA,oBAAA,EA3WsB,WA2WtB,CA3WkC,WA2WlC,CAAA,sBAAA,CAAA,CAAA,GAAA,EAAA;EACA,iBAAA,EA3WmB,WA2WnB,CA3W+B,WA2W/B,CAAA,mBAAA,CAAA,CAAA,GAAA,EAAA;EACA,OAAA,CAAA,EA3WU,iBA2WV;EACA,IAAA,EAAA,QAAA,GAAA,QAAA;CACA;AACA,cA1WY,cA0WZ,EA1W0B,KAAA,CAAA,OA0W1B,CA1W0B,sBA0W1B,GAAA,SAAA,CAAA;;;;;AA0BD;;iBArCgB,eAAA;;;;;;;;;;;;;GAab,uBAAuB,KAAA,CAAM;;;;;iBAwBhB,UAAA,CAAA,GAAc"}
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
+
import { RealtimeAuthConfig, RealtimeAuthConfig as RealtimeAuthConfig$1 } from "@cossistant/core";
|
|
1
2
|
import React from "react";
|
|
2
3
|
|
|
3
4
|
//#region ../react/src/realtime/provider.d.ts
|
|
4
5
|
type SubscribeHandler = (event: AnyRealtimeEvent) => void;
|
|
5
|
-
type VisitorAuthConfig = {
|
|
6
|
-
kind: "visitor";
|
|
7
|
-
visitorId: string | null;
|
|
8
|
-
websiteId?: string | null;
|
|
9
|
-
publicKey?: string | null;
|
|
10
|
-
};
|
|
11
|
-
type SessionAuthConfig = {
|
|
12
|
-
kind: "session";
|
|
13
|
-
sessionToken: string | null;
|
|
14
|
-
websiteId?: string | null;
|
|
15
|
-
userId?: string | null;
|
|
16
|
-
};
|
|
17
|
-
type RealtimeAuthConfig = VisitorAuthConfig | SessionAuthConfig;
|
|
18
6
|
type RealtimeProviderProps = {
|
|
19
7
|
children: React.ReactNode;
|
|
20
8
|
wsUrl?: string;
|
|
@@ -24,7 +12,7 @@ type RealtimeProviderProps = {
|
|
|
24
12
|
onDisconnect?: () => void;
|
|
25
13
|
onError?: (error: Error) => void;
|
|
26
14
|
};
|
|
27
|
-
type
|
|
15
|
+
type RealtimeContextValue = {
|
|
28
16
|
isConnected: boolean;
|
|
29
17
|
isConnecting: boolean;
|
|
30
18
|
error: Error | null;
|
|
@@ -34,14 +22,13 @@ type RealtimeConnectionState = {
|
|
|
34
22
|
lastEvent: AnyRealtimeEvent | null;
|
|
35
23
|
connectionId: string | null;
|
|
36
24
|
reconnect: () => void;
|
|
37
|
-
};
|
|
38
|
-
type RealtimeContextValue = RealtimeConnectionState & {
|
|
39
25
|
visitorId: string | null;
|
|
40
26
|
websiteId: string | null;
|
|
41
27
|
userId: string | null;
|
|
42
28
|
};
|
|
43
29
|
/**
|
|
44
30
|
* Provides websocket connectivity and heartbeating logic for realtime events.
|
|
31
|
+
* Backed by the framework-agnostic RealtimeClient from @cossistant/core.
|
|
45
32
|
*/
|
|
46
33
|
declare function RealtimeProvider({
|
|
47
34
|
children,
|
|
@@ -57,5 +44,5 @@ declare function RealtimeProvider({
|
|
|
57
44
|
*/
|
|
58
45
|
declare function useRealtimeConnection(): RealtimeContextValue;
|
|
59
46
|
//#endregion
|
|
60
|
-
export { type RealtimeAuthConfig, type RealtimeContextValue, RealtimeProvider, type RealtimeProviderProps, useRealtimeConnection };
|
|
47
|
+
export { type RealtimeAuthConfig$1 as RealtimeAuthConfig, type RealtimeContextValue, RealtimeProvider, type RealtimeProviderProps, useRealtimeConnection };
|
|
61
48
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../../react/src/realtime/provider.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","names":[],"sources":["../../../../../react/src/realtime/provider.tsx"],"sourcesContent":[],"mappings":";;;;KAkBK,gBAAA,WAA2B;AAdD,KAgB1B,qBAAA,GAFgB;EAEhB,QAAA,EACM,KAAA,CAAM,SADS;EACf,KAAM,CAAA,EAAA,MAAA;EAEV,IAAA,EAAA,kBAAA,GAAA,IAAA;EAIY,WAAA,CAAA,EAAA,OAAA;EAAK,SAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EAGnB,YAAA,CAAA,EAAA,GAAA,GAAA,IAAoB;EAGjB,OAAA,CAAA,EAAA,CAAA,KAAA,EANW,KAMX,EAAA,GAAA,IAAA;CACO;KAJV,oBAAA,GAMiB;EACV,WAAA,EAAA,OAAA;EAAgB,YAAA,EAAA,OAAA;EAgCZ,KAAA,EApCR,KAoCQ,GAAA,IAAgB;EAC/B,IAAA,EAAA,CAAA,KAAA,EApCc,gBAoCd,EAAA,GAAA,IAAA;EACA,OAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EACA,SAAA,EAAA,CAAA,OAAA,EApCqB,gBAoCrB,EAAA,GAAA,GAAA,GAAA,IAAA;EACA,SAAA,EApCW,gBAoCX,GAAA,IAAA;EACA,YAAA,EAAA,MAAA,GAAA,IAAA;EACA,SAAA,EAAA,GAAA,GAAA,IAAA;EACA,SAAA,EAAA,MAAA,GAAA,IAAA;EACE,SAAA,EAAA,MAAA,GAAA,IAAA;EAAwB,MAAM,EAAA,MAAA,GAAA,IAAA;CAAY;AAiG7C;;;;iBAzGgB,gBAAA;;;;;;;;GAQb,wBAAwB,KAAA,CAAM;;;;iBAiGjB,qBAAA,CAAA,GAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seen-store.d.ts","names":[],"sources":["../../../../../react/src/realtime/seen-store.ts"],"sourcesContent":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"seen-store.d.ts","names":[],"sources":["../../../../../react/src/realtime/seen-store.ts"],"sourcesContent":[],"mappings":";;;;;;;iBA8DgB,uBAAA,kCAEN;;;;iBAQM,sBAAA;;aAEJ;;cAEC;;;;;;iBAYG,0BAAA,QACR"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
3
|
//#region ../react/src/realtime/support-provider.d.ts
|
|
4
|
-
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
};
|
|
4
|
+
|
|
7
5
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Previously bridged websocket events into the core client stores.
|
|
7
|
+
* Event routing is now handled by CossistantClient.handleRealtimeEvent()
|
|
8
|
+
* in @cossistant/core, so this component is a no-op passthrough retained
|
|
9
|
+
* for tree compatibility.
|
|
10
10
|
*/
|
|
11
11
|
declare function SupportRealtimeProvider({
|
|
12
12
|
children
|
|
13
|
-
}:
|
|
13
|
+
}: {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): React.ReactElement;
|
|
14
16
|
//#endregion
|
|
15
17
|
export { SupportRealtimeProvider };
|
|
16
18
|
//# sourceMappingURL=support-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-provider.d.ts","names":[],"sources":["../../../../../react/src/realtime/support-provider.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"support-provider.d.ts","names":[],"sources":["../../../../../react/src/realtime/support-provider.tsx"],"sourcesContent":[],"mappings":";;;;;;AAQA;;;;AAIsB,iBAJN,uBAAA,CAIM;EAAA;CAAA,EAAA;YADX,KAAA,CAAM;IACb,KAAA,CAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typing-store.d.ts","names":[],"sources":["../../../../../react/src/realtime/typing-store.ts"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"typing-store.d.ts","names":[],"sources":["../../../../../react/src/realtime/typing-store.ts"],"sourcesContent":[],"mappings":";;;;;;;;iBAgEgB,cAAA;;aAEJ;;;;;;;;;iBAYI,gBAAA;;aAEJ;;;;;;;iBAUI,4BAAA,QACR;;;;;;;;;;iBAeQ,2BAAA,QACR"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import { RealtimeContextValue } from "../../realtime/provider.js";
|
|
2
|
-
import "../../realtime/index.js";
|
|
3
|
-
import React from "react";
|
|
4
|
-
|
|
5
1
|
//#region ../react/src/support/context/websocket.d.ts
|
|
6
|
-
type
|
|
2
|
+
type SubscribeHandler = (event: AnyRealtimeEvent) => void;
|
|
3
|
+
type WebSocketContextValue = {
|
|
4
|
+
isConnected: boolean;
|
|
5
|
+
isConnecting: boolean;
|
|
6
|
+
error: Error | null;
|
|
7
|
+
send: (event: AnyRealtimeEvent) => void;
|
|
8
|
+
sendRaw: (data: string) => void;
|
|
9
|
+
subscribe: (handler: SubscribeHandler) => () => void;
|
|
10
|
+
lastEvent: AnyRealtimeEvent | null;
|
|
11
|
+
connectionId: string | null;
|
|
12
|
+
reconnect: () => void;
|
|
13
|
+
visitorId: string | null;
|
|
14
|
+
websiteId: string | null;
|
|
15
|
+
userId: string | null;
|
|
16
|
+
};
|
|
7
17
|
type WebSocketProviderProps = {
|
|
8
18
|
children: React.ReactNode;
|
|
9
19
|
publicKey?: string;
|
|
@@ -16,8 +26,8 @@ type WebSocketProviderProps = {
|
|
|
16
26
|
onError?: (error: Error) => void;
|
|
17
27
|
};
|
|
18
28
|
/**
|
|
19
|
-
* Support-specific realtime provider that authenticates visitors
|
|
20
|
-
* connection alive with presence pings.
|
|
29
|
+
* Support-specific realtime provider that authenticates visitors using the
|
|
30
|
+
* core client's RealtimeClient and keeps the connection alive with presence pings.
|
|
21
31
|
*/
|
|
22
32
|
declare const WebSocketProvider: React.FC<WebSocketProviderProps>;
|
|
23
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.d.ts","names":[],"sources":["../../../../../../react/src/support/context/websocket.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"websocket.d.ts","names":[],"sources":["../../../../../../react/src/support/context/websocket.tsx"],"sourcesContent":[],"mappings":";AAI0E,KAYrE,gBAAA,GAAgB,CAAA,KAAA,EAAW,gBAAA,EAAA,GAAgB,IAAA;AAAA,KAE3C,qBAAA,GAAqB;EAGlB,WAAA,EAAA,OAAA;EACO,YAAA,EAAA,OAAA;EAEO,KAAA,EAHd,KAGc,GAAA,IAAA;EACV,IAAA,EAAA,CAAA,KAAA,EAHG,gBAGH,EAAA,GAAA,IAAA;EAAgB,OAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EAQvB,SAAA,EAAA,CAAA,OAAA,EATiB,gBASK,EAChB,GAAA,GAAM,GAAA,IAAA;EAiBJ,SAAA,EA1BD,gBAoMX,GAAA,IA1KwC;EAgL5B,YAAA,EAAA,MAMZ,GAAA,IAAA;;;;;;KAxMI,sBAAA;YACM,KAAA,CAAM;;;;;;;;oBAQE;;;;;;cASN,mBAAmB,KAAA,CAAM,GAAG;;;;;cAgL5B,oBAAmB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _cossistant_core5 from "@cossistant/core";
|
|
2
2
|
import { SupportConfig, SupportStore, SupportStoreState } from "@cossistant/core";
|
|
3
3
|
|
|
4
4
|
//#region ../react/src/support/store/support-store.d.ts
|
|
@@ -43,15 +43,15 @@ declare const useSupportConfig: () => UseSupportConfigResult;
|
|
|
43
43
|
* const { navigate, goBack, page, params } = useSupportNavigation();
|
|
44
44
|
*/
|
|
45
45
|
declare const useSupportNavigation: () => {
|
|
46
|
-
current:
|
|
46
|
+
current: _cossistant_core5.NavigationState<_cossistant_core5.RouteRegistry>;
|
|
47
47
|
page: "HOME" | "ARTICLES" | "CONVERSATION" | "CONVERSATION_HISTORY";
|
|
48
48
|
params: {
|
|
49
49
|
conversationId: string;
|
|
50
50
|
initialMessage?: string;
|
|
51
51
|
} | undefined;
|
|
52
|
-
previousPages:
|
|
53
|
-
navigate: (state:
|
|
54
|
-
replace: (state:
|
|
52
|
+
previousPages: _cossistant_core5.NavigationState<_cossistant_core5.RouteRegistry>[];
|
|
53
|
+
navigate: (state: _cossistant_core5.NavigationState<_cossistant_core5.RouteRegistry>) => void;
|
|
54
|
+
replace: (state: _cossistant_core5.NavigationState<_cossistant_core5.RouteRegistry>) => void;
|
|
55
55
|
goBack: () => void;
|
|
56
56
|
canGoBack: boolean;
|
|
57
57
|
};
|