@opencx/widget 2.4.2 → 2.4.4-rn.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.
Files changed (50) hide show
  1. package/README.md +30 -30
  2. package/dist/basic.cjs +52 -52
  3. package/dist/basic.cjs.map +1 -1
  4. package/dist/basic.js +6094 -6181
  5. package/dist/basic.js.map +1 -1
  6. package/dist/core/client/api.d.ts +36 -6
  7. package/dist/core/client/chat.d.ts +10 -20
  8. package/dist/core/client/config.d.ts +2 -3
  9. package/dist/core/client/contact.d.ts +13 -12
  10. package/dist/core/client/index.d.ts +1 -0
  11. package/dist/core/index.d.ts +0 -1
  12. package/dist/core/platform/index.d.ts +5 -5
  13. package/dist/core/platform/logger.d.ts +14 -0
  14. package/dist/core/platform/storage.d.ts +46 -0
  15. package/dist/core/types/helpers.d.ts +12 -0
  16. package/dist/core/types/index.d.ts +1 -1
  17. package/dist/core/types/messages.d.ts +2 -2
  18. package/dist/core/types/pub-sub.d.ts +24 -8
  19. package/dist/core/types/schemas-v2.d.ts +22 -25
  20. package/dist/{index-CsKiFO8A.cjs → index-BVoLVQCZ.cjs} +3 -3
  21. package/dist/index-BVoLVQCZ.cjs.map +1 -0
  22. package/dist/{index-DsIbhmIO.js → index-Cjs7ckCU.js} +100 -96
  23. package/dist/index-Cjs7ckCU.js.map +1 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.js +705 -343
  27. package/dist/index.js.map +1 -1
  28. package/dist/package.json.d.ts +156 -0
  29. package/dist/react.cjs +1 -1
  30. package/dist/react.cjs.map +1 -1
  31. package/dist/react.js +7 -7
  32. package/dist/react.js.map +1 -1
  33. package/dist/schemas-BBAV6Sd_.js.map +1 -1
  34. package/dist/schemas-wky4fpbc.cjs.map +1 -1
  35. package/dist/style.css +1 -1
  36. package/dist-embed/script.js +94 -94
  37. package/dist-embed/script.js.map +1 -1
  38. package/package.json +3 -1
  39. package/dist/core/client/chat.test.d.ts +0 -1
  40. package/dist/core/client/client.d.ts +0 -9
  41. package/dist/core/client/config.test.d.ts +0 -1
  42. package/dist/core/client/contact.test.d.ts +0 -1
  43. package/dist/index-CsKiFO8A.cjs.map +0 -1
  44. package/dist/index-DsIbhmIO.js.map +0 -1
  45. package/dist/react-bindings/context/ChatContext.d.ts +0 -127
  46. package/dist/react-bindings/hooks/useContact.d.ts +0 -9
  47. package/dist/react-bindings/hooks/usePubsub.d.ts +0 -3
  48. package/dist/react-bindings/hooks/useSendMessage.d.ts +0 -6
  49. package/dist/react-bindings/index.d.ts +0 -3
  50. package/dist/src/designs/basic/screens/chat-screen/SessionClosedDialog.d.ts +0 -2
@@ -1,127 +0,0 @@
1
- import { default as React } from 'react';
2
- import { CoreOptions, ApiCaller } from '../../core';
3
- interface ChatProviderProps {
4
- options: CoreOptions;
5
- children: React.ReactNode;
6
- }
7
- export declare const ChatProvider: React.FC<ChatProviderProps>;
8
- export declare const useChat: () => {
9
- api: ApiCaller;
10
- config: {
11
- getConfig: () => Required<Omit<CoreOptions, "contactToken">> & {
12
- contactToken: string | undefined | null;
13
- soundEffectFiles: {
14
- messageArrived: string;
15
- };
16
- theme: {
17
- primaryColor: string;
18
- triggerOffset: string;
19
- };
20
- settings: {
21
- persistSession: boolean;
22
- useSoundEffects: boolean;
23
- };
24
- };
25
- getApiConfig: () => {
26
- apiUrl: string;
27
- token: string;
28
- headers: Record<string, string>;
29
- queryParams: Record<string, string>;
30
- pathParams: Record<string, string>;
31
- };
32
- getBotConfig: () => {
33
- name?: string;
34
- avatarUrl?: string;
35
- id?: number | null;
36
- is_ai?: boolean;
37
- };
38
- getThemeConfig: () => {
39
- primaryColor?: string;
40
- triggerOffset?: string;
41
- } & {
42
- primaryColor: string;
43
- triggerOffset: string;
44
- };
45
- getSettings: () => {
46
- persistSession?: boolean;
47
- useSoundEffects?: boolean;
48
- } & {
49
- persistSession: boolean;
50
- useSoundEffects: boolean;
51
- };
52
- getSoundEffects: () => {
53
- messageArrived?: string;
54
- } & {
55
- messageArrived: string;
56
- };
57
- getUser: () => import('../../core').User;
58
- getLanguage: () => string;
59
- getDebugMode: () => boolean;
60
- };
61
- chat: {
62
- chatState: import('../../core').PubSub<{
63
- lastUpdated: number | null;
64
- messages: import('../../core').MessageType[];
65
- keyboard: {
66
- options: string[];
67
- } | null;
68
- }>;
69
- sessionState: import('../../core').PubSub<{
70
- id: string;
71
- channel: string;
72
- assignee: {
73
- name: string | null;
74
- kind: "unknown" | "ai" | "none" | "human";
75
- };
76
- createdAt: Date;
77
- updatedAt: Date;
78
- isHandedOff: boolean;
79
- isOpened: boolean;
80
- } | null>;
81
- sendMessage: (input: {
82
- content: {
83
- text: string;
84
- };
85
- attachments?: any[];
86
- id?: string;
87
- language?: string;
88
- user?: {
89
- external_id?: string;
90
- name?: string;
91
- email?: string;
92
- phone?: string;
93
- customData?: Record<string, string>;
94
- avatarUrl?: string;
95
- };
96
- }) => Promise<void>;
97
- createSession: () => Promise<{
98
- id: string;
99
- channel: string;
100
- assignee: {
101
- name: string | null;
102
- kind: "unknown" | "ai" | "none" | "human";
103
- };
104
- createdAt: Date;
105
- updatedAt: Date;
106
- isHandedOff: boolean;
107
- isOpened: boolean;
108
- }>;
109
- clearSession: () => Promise<void>;
110
- cleanup: () => void;
111
- };
112
- contact: {
113
- shouldCollectData: () => {
114
- should: boolean;
115
- reason?: string;
116
- };
117
- cleanup: () => void;
118
- contactState: import('../../core').PubSub<{
119
- email: string | null;
120
- id: string;
121
- name: string | null;
122
- avatar_url: string | null;
123
- created_at: string;
124
- } | null>;
125
- };
126
- };
127
- export {};
@@ -1,9 +0,0 @@
1
- export declare const useContact: () => {
2
- contactState: {
3
- email: string | null;
4
- id: string;
5
- name: string | null;
6
- avatar_url: string | null;
7
- created_at: string;
8
- } | null;
9
- };
@@ -1,3 +0,0 @@
1
- import { PubSub } from '../../core/types';
2
- declare function usePubsub<S extends any>(p: InstanceType<typeof PubSub<S>>): S;
3
- export default usePubsub;
@@ -1,6 +0,0 @@
1
- import { SendMessageInput } from '../../core';
2
- export declare const useSendMessage: () => {
3
- sendMessage: (message: SendMessageInput) => Promise<void>;
4
- isLoading: boolean;
5
- error: Error | null;
6
- };
@@ -1,3 +0,0 @@
1
- export { ChatProvider, useChat } from './context/ChatContext';
2
- export { useSendMessage } from './hooks/useSendMessage';
3
- export { useContact } from './hooks/useContact';
@@ -1,2 +0,0 @@
1
- import { default as React } from 'react';
2
- export declare function SessionClosedDialog(): React.JSX.Element | null;