@opencx/widget 2.6.0 → 2.6.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/dist/api-BwKgAJ6p.cjs +2 -0
- package/dist/api-BwKgAJ6p.cjs.map +1 -0
- package/dist/api-DRZ9vPwy.js +1360 -0
- package/dist/api-DRZ9vPwy.js.map +1 -0
- package/dist/basic.cjs +85 -85
- package/dist/basic.cjs.map +1 -1
- package/dist/basic.js +13350 -12831
- package/dist/basic.js.map +1 -1
- package/dist/core/client/api.d.ts +368 -40
- package/dist/core/client/chat.d.ts +27 -19
- package/dist/core/client/config.d.ts +13 -3
- package/dist/core/client/contact.d.ts +2 -12
- package/dist/core/sdk/index.d.ts +11 -0
- package/dist/core/types/helpers.d.ts +3 -0
- package/dist/core/types/index.d.ts +6 -6
- package/dist/core/types/messages.d.ts +20 -9
- package/dist/core/types/schemas-v2.d.ts +10 -713
- package/dist/index-B5YLfjom.cjs +18 -0
- package/dist/index-B5YLfjom.cjs.map +1 -0
- package/dist/index-EZN9_jan.js +1219 -0
- package/dist/index-EZN9_jan.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -1071
- package/dist/index.js.map +1 -1
- package/dist/react-web/core-integration/ChatProvider.d.ts +101 -0
- package/dist/react-web/core-integration/components.d.ts +11 -0
- package/dist/react-web/core-integration/hooks/useChatMessages.d.ts +64 -0
- package/dist/react-web/core-integration/hooks/useChatSession.d.ts +77 -0
- package/dist/react-web/core-integration/hooks/useConfig.d.ts +1 -0
- package/dist/react-web/core-integration/hooks/useContact.d.ts +11 -0
- package/dist/react-web/core-integration/hooks/useLocale.d.ts +4 -0
- package/dist/react-web/core-integration/hooks/usePreludeData.d.ts +36 -0
- package/dist/react-web/core-integration/hooks/usePubsub.d.ts +2 -0
- package/dist/react-web/{hooks → core-integration/hooks}/useUploadFiles.d.ts +2 -2
- package/dist/react-web/{hooks → core-integration/hooks}/useVote.d.ts +2 -2
- package/dist/react-web/core-integration/hooks.d.ts +9 -0
- package/dist/react-web/core-integration/index.d.ts +2 -0
- package/dist/react-web/index.d.ts +4 -10
- package/dist/react-web/types/components.d.ts +6 -3
- package/dist/react-web/types/index.d.ts +3 -2
- package/dist/react-web/types/options.d.ts +4 -30
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +10 -46
- package/dist/react.js.map +1 -1
- package/dist/src/@components/BotOrAgentMessageGroup.d.ts +1 -2
- package/dist/src/@components/BotOrAgentMessageWrapper.d.ts +2 -2
- package/dist/src/@components/ChatEvent.component.d.ts +3 -3
- package/dist/src/@components/Text.component.d.ts +1 -1
- package/dist/src/components/button.d.ts +1 -1
- package/dist/src/components/dialog.d.ts +9 -9
- package/dist/src/designs/basic/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist-embed/script.js +119 -124
- package/dist-embed/script.js.map +1 -1
- package/package.json +7 -4
- package/dist/core/tests/utils/create-fetch.test.d.ts +0 -1
- package/dist/core/types/schemas.d.ts +0 -543
- package/dist/core/utils/create-fetch.d.ts +0 -25
- package/dist/core/utils/genId.d.ts +0 -2
- package/dist/core/utils/history-to-widget-messages.d.ts +0 -4
- package/dist/genUuid-C12yFv3j.js +0 -137
- package/dist/genUuid-C12yFv3j.js.map +0 -1
- package/dist/genUuid-DdeSE04H.cjs +0 -2
- package/dist/genUuid-DdeSE04H.cjs.map +0 -1
- package/dist/index-C87obATS.js +0 -2616
- package/dist/index-C87obATS.js.map +0 -1
- package/dist/index-ChwS_h0D.cjs +0 -18
- package/dist/index-ChwS_h0D.cjs.map +0 -1
- package/dist/package.json.d.ts +0 -158
- package/dist/react-web/Root.d.ts +0 -6
- package/dist/react-web/hooks/index.d.ts +0 -6
- package/dist/react-web/hooks/use-sound.d.ts +0 -13
- package/dist/react-web/hooks/use-sound.test.d.ts +0 -1
- package/dist/react-web/hooks/use-sync-state.test.d.ts +0 -1
- package/dist/react-web/hooks/useAbstractChat.d.ts +0 -157
- package/dist/react-web/hooks/useAxiosInstance.d.ts +0 -190
- package/dist/react-web/hooks/useSyncState.d.ts +0 -4
- package/dist/react-web/hooks/useTimeoutState.d.ts +0 -3
- package/dist/react-web/providers/ChatProvider.d.ts +0 -143
- package/dist/react-web/providers/ConfigDataProvider.d.ts +0 -62
- package/dist/react-web/providers/ContactProvider.d.ts +0 -58
- package/dist/react-web/providers/LocalesProvider.d.ts +0 -11
- package/dist/react-web/providers/componentRegistry.d.ts +0 -13
- package/dist/react-web/providers/use-widget-sfx.d.ts +0 -7
- package/dist/react-web/providers/usePreludeData.d.ts +0 -2
- package/dist/react-web/utils/debug.d.ts +0 -2
- package/dist/react-web/utils/getters.d.ts +0 -24
- package/dist/react-web/utils/index.d.ts +0 -1
- package/dist/src/hooks/useShouldCollectData.d.ts +0 -3
- /package/dist/react-web/{locales → core-integration/locales}/ar.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/de.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/en.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/fr.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/helper.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/index.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/nl.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/pt.locale.d.ts +0 -0
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DefaultTextComponentBaseProps, WidgetLiteralComponentKey } from '../../react-web/types';
|
|
2
|
+
import { ChatAttachmentType, WidgetHistoryDto } from './schemas-v2';
|
|
3
|
+
import { SafeExtract, StringOrLiteral } from './helpers';
|
|
4
|
+
export type AgentType = {
|
|
5
|
+
isAi: boolean;
|
|
6
|
+
id: string | null;
|
|
7
|
+
name: string;
|
|
8
|
+
avatar: string | null;
|
|
9
|
+
};
|
|
2
10
|
export type UserMessageType = {
|
|
3
11
|
id: string;
|
|
4
12
|
type: "FROM_USER";
|
|
5
13
|
content: string;
|
|
6
14
|
deliveredAt: string | null;
|
|
7
|
-
attachments?: ChatAttachmentType[];
|
|
15
|
+
attachments?: ChatAttachmentType[] | null;
|
|
8
16
|
timestamp: string;
|
|
9
17
|
user?: {
|
|
10
18
|
name?: string;
|
|
@@ -14,23 +22,26 @@ export type UserMessageType = {
|
|
|
14
22
|
avatarUrl?: string;
|
|
15
23
|
};
|
|
16
24
|
};
|
|
17
|
-
export type BotMessageType<TData = unknown> = {
|
|
25
|
+
export type BotMessageType<TData = DefaultTextComponentBaseProps | unknown> = {
|
|
18
26
|
id: string;
|
|
19
27
|
type: "FROM_BOT";
|
|
20
|
-
|
|
28
|
+
/**
|
|
29
|
+
* The type is a bot_message literal string or other strings that correspond to the UI responses from AI action calls
|
|
30
|
+
*/
|
|
31
|
+
component: StringOrLiteral<SafeExtract<WidgetLiteralComponentKey, "bot_message">>;
|
|
21
32
|
data: TData;
|
|
22
33
|
timestamp: string;
|
|
23
|
-
original?:
|
|
34
|
+
original?: WidgetHistoryDto;
|
|
24
35
|
agent?: AgentType;
|
|
25
36
|
attachments?: ChatAttachmentType[];
|
|
26
37
|
};
|
|
27
|
-
export type AgentMessageType
|
|
38
|
+
export type AgentMessageType = {
|
|
28
39
|
id: string;
|
|
29
40
|
type: "FROM_AGENT";
|
|
30
|
-
component:
|
|
31
|
-
data:
|
|
41
|
+
component: SafeExtract<WidgetLiteralComponentKey, "agent_message">;
|
|
42
|
+
data: DefaultTextComponentBaseProps;
|
|
32
43
|
timestamp?: string;
|
|
33
|
-
original?:
|
|
44
|
+
original?: WidgetHistoryDto;
|
|
34
45
|
agent?: AgentType;
|
|
35
46
|
attachments?: ChatAttachmentType[];
|
|
36
47
|
};
|