@opencx/widget 2.6.2 → 3.0.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/dist/basic.cjs +89 -89
- package/dist/basic.cjs.map +1 -1
- package/dist/basic.d.ts +1 -1
- package/dist/basic.js +34083 -34125
- package/dist/basic.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -22
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +20 -10
- package/dist/react.js.map +1 -1
- package/dist/src/designs/react/basic/index.d.ts +10 -0
- package/dist/src/designs/{basic → react/basic}/utils/group-messages-by-type.d.ts +1 -1
- package/dist/src/{@components → designs/react/components}/BotOrAgentMessage.d.ts +1 -1
- package/dist/src/{@components → designs/react/components}/BotOrAgentMessageGroup.d.ts +2 -2
- package/dist/src/designs/react/components/BotOrAgentMessageWrapper.d.ts +7 -0
- package/dist/src/{@components → designs/react/components}/Fallback.component.d.ts +2 -2
- package/dist/src/{components → designs/react/components}/RenderFile.d.ts +2 -2
- package/dist/src/{@components → designs/react/components}/Text.component.d.ts +1 -1
- package/dist/src/{components → designs/react/components}/UserMessageGroup.d.ts +1 -1
- package/dist/src/{components → designs/react/components}/VoteButtons.d.ts +1 -1
- package/dist/src/designs/{constants.d.ts → react/constants.d.ts} +2 -4
- package/dist/src/designs/react/hooks/useLocale.d.ts +6 -0
- package/dist/src/{index.d.ts → designs/react/index.d.ts} +2 -2
- package/dist/src/designs/translation/ar.locale.d.ts +2 -0
- package/dist/src/designs/translation/de.locale.d.ts +2 -0
- package/dist/src/designs/translation/en.locale.d.ts +2 -0
- package/dist/src/designs/translation/fr.locale.d.ts +2 -0
- package/dist/src/designs/translation/index.d.ts +14 -0
- package/dist/src/designs/translation/nl.locale.d.ts +2 -0
- package/dist/src/designs/translation/pt.locale.d.ts +2 -0
- package/dist/src/designs/translation/translation.types.d.ts +4 -0
- package/dist/{core/client → src/headless/core}/api.d.ts +56 -143
- package/dist/src/headless/core/context/contact.d.ts +25 -0
- package/dist/src/headless/core/context/message.d.ts +40 -0
- package/dist/src/headless/core/context/session.d.ts +74 -0
- package/dist/src/headless/core/context/widget.d.ts +16 -0
- package/dist/src/headless/core/index.d.ts +7 -0
- package/dist/{core → src/headless/core}/sdk/index.d.ts +5 -4
- package/dist/src/headless/core/types/WidgetConfig.d.ts +34 -0
- package/dist/src/headless/core/types/agent-or-bot.d.ts +6 -0
- package/dist/src/headless/core/types/helpers.d.ts +4 -0
- package/dist/{core → src/headless/core}/types/messages.d.ts +11 -31
- package/dist/src/headless/core/types/schemas.d.ts +9 -0
- package/dist/src/headless/core/utils/Poller.d.ts +12 -0
- package/dist/{core/types/pub-sub.d.ts → src/headless/core/utils/PubSub.d.ts} +6 -9
- package/dist/{react-web/core-integration/components.d.ts → src/headless/react/ComponentRegistry.d.ts} +1 -1
- package/dist/src/headless/react/WidgetProvider.d.ts +17 -0
- package/dist/src/headless/react/hooks/useConfig.d.ts +1 -0
- package/dist/src/headless/react/hooks/useContact.d.ts +10 -0
- package/dist/src/headless/react/hooks/useIsAwaitingBotReply.d.ts +3 -0
- package/dist/src/headless/react/hooks/useMessages.d.ts +8 -0
- package/dist/{react-web/core-integration → src/headless/react}/hooks/usePreludeData.d.ts +2 -2
- package/dist/{react-web/core-integration → src/headless/react}/hooks/usePubsub.d.ts +1 -1
- package/dist/src/headless/react/hooks/useSession.d.ts +6 -0
- package/dist/{react-web/core-integration → src/headless/react}/hooks/useUploadFiles.d.ts +1 -1
- package/dist/{react-web/core-integration → src/headless/react}/hooks/useVote.d.ts +2 -2
- package/dist/src/headless/react/index.d.ts +11 -0
- package/dist/src/headless/react/types/components.d.ts +15 -0
- package/dist/style.css +1 -1
- package/dist/useUploadFiles-BZa0DENN.cjs +18 -0
- package/dist/useUploadFiles-BZa0DENN.cjs.map +1 -0
- package/dist/useUploadFiles-BaCcqTwX.js +1336 -0
- package/dist/useUploadFiles-BaCcqTwX.js.map +1 -0
- package/dist/widget-BlvH6dre.cjs +2 -0
- package/dist/widget-BlvH6dre.cjs.map +1 -0
- package/dist/widget-DbgWez1r.js +514 -0
- package/dist/widget-DbgWez1r.js.map +1 -0
- package/dist-embed/script.js +127 -142
- package/dist-embed/script.js.map +1 -1
- package/package.json +12 -8
- package/dist/api-BEtFfKMB.cjs +0 -2
- package/dist/api-BEtFfKMB.cjs.map +0 -1
- package/dist/api-Cez5T-se.js +0 -1393
- package/dist/api-Cez5T-se.js.map +0 -1
- package/dist/core/client/chat.d.ts +0 -101
- package/dist/core/client/config.d.ts +0 -43
- package/dist/core/client/contact.d.ts +0 -29
- package/dist/core/client/index.d.ts +0 -4
- package/dist/core/errors/index.d.ts +0 -27
- package/dist/core/index.d.ts +0 -9
- package/dist/core/platform/audio.d.ts +0 -38
- package/dist/core/platform/index.d.ts +0 -15
- package/dist/core/platform/logger.d.ts +0 -14
- package/dist/core/platform/storage.d.ts +0 -52
- package/dist/core/tests/platform/logger.test.d.ts +0 -1
- package/dist/core/tests/platform/storage.test.d.ts +0 -1
- package/dist/core/tests/test-utils.d.ts +0 -2
- package/dist/core/tests/types/pub-sub.test.d.ts +0 -1
- package/dist/core/types/contact.d.ts +0 -2
- package/dist/core/types/helpers.d.ts +0 -20
- package/dist/core/types/index.d.ts +0 -52
- package/dist/core/types/prelude.d.ts +0 -14
- package/dist/core/types/schemas-v2.d.ts +0 -10
- package/dist/index-BzidnDPX.cjs +0 -18
- package/dist/index-BzidnDPX.cjs.map +0 -1
- package/dist/index-DUlnC30_.js +0 -1219
- package/dist/index-DUlnC30_.js.map +0 -1
- package/dist/react-web/core-integration/ChatProvider.d.ts +0 -107
- package/dist/react-web/core-integration/hooks/useChatMessages.d.ts +0 -70
- package/dist/react-web/core-integration/hooks/useChatSession.d.ts +0 -83
- package/dist/react-web/core-integration/hooks/useConfig.d.ts +0 -1
- package/dist/react-web/core-integration/hooks/useContact.d.ts +0 -17
- package/dist/react-web/core-integration/hooks/useLocale.d.ts +0 -4
- package/dist/react-web/core-integration/hooks.d.ts +0 -9
- package/dist/react-web/core-integration/index.d.ts +0 -2
- package/dist/react-web/core-integration/locales/ar.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/de.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/en.locale.d.ts +0 -55
- package/dist/react-web/core-integration/locales/fr.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/helper.d.ts +0 -65
- package/dist/react-web/core-integration/locales/index.d.ts +0 -3
- package/dist/react-web/core-integration/locales/nl.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/pt.locale.d.ts +0 -2
- package/dist/react-web/hooks/useScrollTo.d.ts +0 -2
- package/dist/react-web/index.d.ts +0 -4
- package/dist/react-web/types/components.d.ts +0 -13
- package/dist/react-web/types/index.d.ts +0 -8
- package/dist/react-web/types/options.d.ts +0 -17
- package/dist/src/@components/BotOrAgentMessageWrapper.d.ts +0 -9
- package/dist/src/@components/ChatEvent.component.d.ts +0 -9
- package/dist/src/@components/index.d.ts +0 -6
- package/dist/src/designs/basic/index.d.ts +0 -8
- /package/dist/src/designs/{basic → react/basic}/WidgetPopoverTrigger.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatFooter.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatHeader.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatMain.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatScreen.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/root-screen.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/welcome-screen/WelcomeScreen.d.ts +0 -0
- /package/dist/{core/tests/client/integration-perisitance.test.d.ts → src/designs/react/basic/widget-interaction-tests/widget.test.d.ts} +0 -0
- /package/dist/src/{@components → designs/react/components}/Loading.component.d.ts +0 -0
- /package/dist/src/{@components → designs/react/components}/OpenLogoSvg.d.ts +0 -0
- /package/dist/src/{components → designs/react/components}/keyboard.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/MotionDiv.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/avatar.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/button.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/dialog.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/dropdown-menu.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/input.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/popover.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/skeleton.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/switch.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/tooltip.d.ts +0 -0
- /package/dist/src/{utils.d.ts → designs/react/components/lib/utils/cn.d.ts} +0 -0
- /package/dist/src/{components → designs/react/components/lib}/wobble.d.ts +0 -0
- /package/dist/src/{@components → designs/react/components}/markdown.d.ts +0 -0
- /package/dist/{react-web → src/designs/react}/hooks/useWidgetContentHeight.d.ts +0 -0
- /package/dist/src/{render.d.ts → designs/react/render.d.ts} +0 -0
- /package/dist/{core/tests/client/integration.test.d.ts → src/headless/core/utils/PubSub.test.d.ts} +0 -0
- /package/dist/{core/utils/genUuid.d.ts → src/headless/core/utils/uuid.d.ts} +0 -0
- /package/dist/{react-web → src/headless/react}/utils/create-safe-context.d.ts +0 -0
- /package/dist/{core/tests/platform/audio.test.d.ts → vitest/setup.d.ts} +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export declare const enLocale: {
|
|
2
|
-
ok: string;
|
|
3
|
-
yes: string;
|
|
4
|
-
no: string;
|
|
5
|
-
agree: string;
|
|
6
|
-
cancel: string;
|
|
7
|
-
"yes-exit": string;
|
|
8
|
-
"yes-reset": string;
|
|
9
|
-
"no-cancel": string;
|
|
10
|
-
"are-you-sure": string;
|
|
11
|
-
recording: string;
|
|
12
|
-
"thank-you": string;
|
|
13
|
-
"sorry-try-again": string;
|
|
14
|
-
"error-occurred": string;
|
|
15
|
-
"please-try-again": string;
|
|
16
|
-
"write-a-message": string;
|
|
17
|
-
"send-message": string;
|
|
18
|
-
connected: string;
|
|
19
|
-
connecting: string;
|
|
20
|
-
reconnecting: string;
|
|
21
|
-
reconnected: string;
|
|
22
|
-
disconnecting: string;
|
|
23
|
-
disconnected: string;
|
|
24
|
-
error: string;
|
|
25
|
-
"persist-session": string;
|
|
26
|
-
settings: string;
|
|
27
|
-
close: string;
|
|
28
|
-
help: string;
|
|
29
|
-
chat: string;
|
|
30
|
-
send: string;
|
|
31
|
-
copy: string;
|
|
32
|
-
copied: string;
|
|
33
|
-
"sound-effects": string;
|
|
34
|
-
language: string;
|
|
35
|
-
select: string;
|
|
36
|
-
agent: string;
|
|
37
|
-
user: string;
|
|
38
|
-
bot: string;
|
|
39
|
-
"reset-conversation-confirm": string;
|
|
40
|
-
"close-widget": string;
|
|
41
|
-
"got-any-questions": string;
|
|
42
|
-
"typical-response-time": string;
|
|
43
|
-
"session-closed-lead": string;
|
|
44
|
-
"create-new-ticket": string;
|
|
45
|
-
exit: string;
|
|
46
|
-
"reset-conversation": string;
|
|
47
|
-
"welcome-title": string;
|
|
48
|
-
"welcome-description": string;
|
|
49
|
-
"your-name": string;
|
|
50
|
-
"your-email": string;
|
|
51
|
-
"start-chat": string;
|
|
52
|
-
"starting-chat": string;
|
|
53
|
-
"hello-greeting": string;
|
|
54
|
-
};
|
|
55
|
-
export type TranslationKeysType = keyof typeof enLocale;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { TranslationKeysType } from './en.locale';
|
|
2
|
-
declare const locales: {
|
|
3
|
-
readonly en: {
|
|
4
|
-
ok: string;
|
|
5
|
-
yes: string;
|
|
6
|
-
no: string;
|
|
7
|
-
agree: string;
|
|
8
|
-
cancel: string;
|
|
9
|
-
"yes-exit": string;
|
|
10
|
-
"yes-reset": string;
|
|
11
|
-
"no-cancel": string;
|
|
12
|
-
"are-you-sure": string;
|
|
13
|
-
recording: string;
|
|
14
|
-
"thank-you": string;
|
|
15
|
-
"sorry-try-again": string;
|
|
16
|
-
"error-occurred": string;
|
|
17
|
-
"please-try-again": string;
|
|
18
|
-
"write-a-message": string;
|
|
19
|
-
"send-message": string;
|
|
20
|
-
connected: string;
|
|
21
|
-
connecting: string;
|
|
22
|
-
reconnecting: string;
|
|
23
|
-
reconnected: string;
|
|
24
|
-
disconnecting: string;
|
|
25
|
-
disconnected: string;
|
|
26
|
-
error: string;
|
|
27
|
-
"persist-session": string;
|
|
28
|
-
settings: string;
|
|
29
|
-
close: string;
|
|
30
|
-
help: string;
|
|
31
|
-
chat: string;
|
|
32
|
-
send: string;
|
|
33
|
-
copy: string;
|
|
34
|
-
copied: string;
|
|
35
|
-
"sound-effects": string;
|
|
36
|
-
language: string;
|
|
37
|
-
select: string;
|
|
38
|
-
agent: string;
|
|
39
|
-
user: string;
|
|
40
|
-
bot: string;
|
|
41
|
-
"reset-conversation-confirm": string;
|
|
42
|
-
"close-widget": string;
|
|
43
|
-
"got-any-questions": string;
|
|
44
|
-
"typical-response-time": string;
|
|
45
|
-
"session-closed-lead": string;
|
|
46
|
-
"create-new-ticket": string;
|
|
47
|
-
exit: string;
|
|
48
|
-
"reset-conversation": string;
|
|
49
|
-
"welcome-title": string;
|
|
50
|
-
"welcome-description": string;
|
|
51
|
-
"your-name": string;
|
|
52
|
-
"your-email": string;
|
|
53
|
-
"start-chat": string;
|
|
54
|
-
"starting-chat": string;
|
|
55
|
-
"hello-greeting": string;
|
|
56
|
-
};
|
|
57
|
-
readonly ar: import('.').TranslatableMessages;
|
|
58
|
-
readonly nl: import('.').TranslatableMessages;
|
|
59
|
-
readonly fr: import('.').TranslatableMessages;
|
|
60
|
-
readonly de: import('.').TranslatableMessages;
|
|
61
|
-
readonly pt: import('.').TranslatableMessages;
|
|
62
|
-
};
|
|
63
|
-
export type LangType = keyof typeof locales;
|
|
64
|
-
export declare function getStr(key: TranslationKeysType, lang: LangType): string;
|
|
65
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { ChatProvider, useChat } from './core-integration/ChatProvider';
|
|
2
|
-
export { useChatState, useChatSession, useConfig, usePreludeData, useLocale, useContact, type FileWithProgress, useUploadFiles } from './core-integration/hooks';
|
|
3
|
-
export type { CoreOptions } from '../core/types';
|
|
4
|
-
export type { WidgetOptions } from './types/options';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { BotMessageType } from '@core/types/messages';
|
|
3
|
-
import { StringOrLiteral } from '../../core/types';
|
|
4
|
-
export type ComponentProps<TData> = BotMessageType<TData>;
|
|
5
|
-
export type WidgetLiteralComponentKey = "bot_message" | "agent_message" | "loading" | "fallback";
|
|
6
|
-
export type WidgetComponentKey = StringOrLiteral<WidgetLiteralComponentKey>;
|
|
7
|
-
export type WidgetComponentType = {
|
|
8
|
-
key: WidgetComponentKey;
|
|
9
|
-
component: React.ElementType;
|
|
10
|
-
};
|
|
11
|
-
export type OptionsType = {
|
|
12
|
-
components?: WidgetComponentType[];
|
|
13
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from './components';
|
|
2
|
-
export * from './options';
|
|
3
|
-
export * from './components';
|
|
4
|
-
export type DefaultTextComponentBaseProps = {
|
|
5
|
-
message: string;
|
|
6
|
-
variant?: "default" | "error";
|
|
7
|
-
};
|
|
8
|
-
export type DefaultTextComponentProps = ComponentProps<DefaultTextComponentBaseProps>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CoreOptions } from '../../core/types';
|
|
2
|
-
import { LangType } from '@react/core-integration/locales';
|
|
3
|
-
export type UserObject = {
|
|
4
|
-
external_id?: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
email?: string;
|
|
7
|
-
phone?: string;
|
|
8
|
-
customData?: Record<string, string>;
|
|
9
|
-
avatarUrl?: string;
|
|
10
|
-
};
|
|
11
|
-
export interface WidgetThemeOptions {
|
|
12
|
-
primaryColor: string;
|
|
13
|
-
triggerOffset: string;
|
|
14
|
-
}
|
|
15
|
-
export interface WidgetOptions extends CoreOptions {
|
|
16
|
-
language?: LangType;
|
|
17
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { AgentType } from '@core/types/messages';
|
|
3
|
-
export declare function BotOrAgentMessageWrapper({ children, agent, className, messageId, sessionId, }: {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
agent: AgentType;
|
|
6
|
-
className?: string;
|
|
7
|
-
messageId?: string;
|
|
8
|
-
sessionId?: string;
|
|
9
|
-
}): React.JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MessageTypeU } from '../../core/types';
|
|
2
|
-
import { ComponentProps } from '../../react-web/types';
|
|
3
|
-
import { default as React } from 'react';
|
|
4
|
-
type ChatEventComponentProps = ComponentProps<{
|
|
5
|
-
event: MessageTypeU;
|
|
6
|
-
message: string;
|
|
7
|
-
}>;
|
|
8
|
-
declare function ChatEventComponent(props: ChatEventComponentProps): React.JSX.Element;
|
|
9
|
-
export { ChatEventComponent, type ChatEventComponentProps };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { default as React, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { WidgetOptions } from '../../../react-web/types';
|
|
3
|
-
declare function Widget({ className, ...props }: ComponentPropsWithoutRef<"div">): React.JSX.Element;
|
|
4
|
-
declare function WidgetRoot({ options, children, }: {
|
|
5
|
-
options: WidgetOptions;
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}): React.JSX.Element;
|
|
8
|
-
export { WidgetRoot, Widget };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{core/tests/client/integration.test.d.ts → src/headless/core/utils/PubSub.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|