@opencx/widget-react 4.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/README.md +5 -0
- package/dist/WidgetPopoverAnchor.d.ts +2 -0
- package/dist/WidgetPopoverContent.d.ts +3 -0
- package/dist/WidgetPopoverTrigger.d.ts +3 -0
- package/dist/components/AgentOrBotAvatar.d.ts +6 -0
- package/dist/components/AttachmentPreview.d.ts +7 -0
- package/dist/components/BotOrAgentMessage.d.ts +7 -0
- package/dist/components/BotOrAgentMessageGroup.d.ts +7 -0
- package/dist/components/Header.d.ts +3 -0
- package/dist/components/MightSolveUserIssueSuggestedReplies.d.ts +2 -0
- package/dist/components/PoweredByOpen.d.ts +4 -0
- package/dist/components/SuggestedReplyButton.d.ts +5 -0
- package/dist/components/UserMessage.d.ts +8 -0
- package/dist/components/UserMessageGroup.d.ts +5 -0
- package/dist/components/custom-components/BotOrAgentTextResponse.component.d.ts +16 -0
- package/dist/components/custom-components/Fallback.component.d.ts +6 -0
- package/dist/components/custom-components/Handoff.component.d.ts +3 -0
- package/dist/components/custom-components/Loading.component.d.ts +6 -0
- package/dist/components/lib/DynamicIcon.d.ts +6 -0
- package/dist/components/lib/LoadingSpinner.d.ts +4 -0
- package/dist/components/lib/MotionDiv.d.ts +19 -0
- package/dist/components/lib/avatar.d.ts +6 -0
- package/dist/components/lib/button.d.ts +11 -0
- package/dist/components/lib/dialog.d.ts +24 -0
- package/dist/components/lib/dropdown-menu.d.ts +27 -0
- package/dist/components/lib/input.d.ts +4 -0
- package/dist/components/lib/popover.d.ts +8 -0
- package/dist/components/lib/skeleton.d.ts +3 -0
- package/dist/components/lib/switch.d.ts +4 -0
- package/dist/components/lib/tooltip.d.ts +10 -0
- package/dist/components/lib/utils/cn.d.ts +2 -0
- package/dist/components/lib/widget-portal.d.ts +9 -0
- package/dist/components/lib/wobble.d.ts +26 -0
- package/dist/components/markdown.d.ts +3 -0
- package/dist/components/svg/ChatBubbleSvg.d.ts +5 -0
- package/dist/components/svg/OpenLogoSvg.d.ts +4 -0
- package/dist/hooks/useCanvas.d.ts +3 -0
- package/dist/hooks/useIsSmallScreen.d.ts +3 -0
- package/dist/hooks/useLocale.d.ts +6 -0
- package/dist/hooks/useSetWidgetSize.d.ts +8 -0
- package/dist/hooks/useTheme.d.ts +62 -0
- package/dist/hooks/useWidgetContentHeight.d.ts +3 -0
- package/dist/index.cjs +51 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +2778 -0
- package/dist/index.js.map +1 -0
- package/dist/screens/chat/ChatCanvas.d.ts +2 -0
- package/dist/screens/chat/ChatFooter.d.ts +2 -0
- package/dist/screens/chat/ChatMain.d.ts +2 -0
- package/dist/screens/chat/index.d.ts +2 -0
- package/dist/screens/index.d.ts +2 -0
- package/dist/screens/sessions/index.d.ts +2 -0
- package/dist/screens/welcome/index.d.ts +2 -0
- package/dist/translation/ar.locale.d.ts +2 -0
- package/dist/translation/de.locale.d.ts +2 -0
- package/dist/translation/en.locale.d.ts +2 -0
- package/dist/translation/es.locale.d.ts +2 -0
- package/dist/translation/fr.locale.d.ts +2 -0
- package/dist/translation/index.d.ts +16 -0
- package/dist/translation/nl.locale.d.ts +2 -0
- package/dist/translation/pt.locale.d.ts +2 -0
- package/dist/translation/tr.locale.d.ts +2 -0
- package/dist/translation/translation.types.d.ts +4 -0
- package/dist/utils/data-component.d.ts +7 -0
- package/dist/utils/group-messages-by-type.d.ts +5 -0
- package/dist-embed/script.js +365 -0
- package/dist-embed/script.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TranslationKeysU } from './translation.types';
|
|
2
|
+
declare const locales: {
|
|
3
|
+
readonly en: import('./translation.types').TranslationInterface;
|
|
4
|
+
readonly ar: import('./translation.types').TranslationInterface;
|
|
5
|
+
readonly nl: import('./translation.types').TranslationInterface;
|
|
6
|
+
readonly fr: import('./translation.types').TranslationInterface;
|
|
7
|
+
readonly de: import('./translation.types').TranslationInterface;
|
|
8
|
+
readonly pt: import('./translation.types').TranslationInterface;
|
|
9
|
+
readonly es: import('./translation.types').TranslationInterface;
|
|
10
|
+
readonly tr: import('./translation.types').TranslationInterface;
|
|
11
|
+
};
|
|
12
|
+
export declare const LOCALES: (keyof typeof locales)[];
|
|
13
|
+
export type Locale = (typeof LOCALES)[number];
|
|
14
|
+
export declare const isSupportedLocale: (lang: string | null | undefined) => lang is Locale;
|
|
15
|
+
export declare function getTranslation(key: TranslationKeysU, lang: Locale): string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type TranslationKeysU = 'i-need-more-help' | 'this-was-helpful' | 'write-a-message' | 'session-closed-lead' | 'new-conversation' | 'back-to-conversations' | 'closed-conversations' | 'no-conversations-yet' | 'welcome-title' | 'welcome-description' | 'your-name' | 'your-email' | 'optional' | 'start-chat' | 'starting-chat';
|
|
2
|
+
export type TranslationInterface = {
|
|
3
|
+
[K in TranslationKeysU]: string;
|
|
4
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AgentMessageType, BotMessageType, MessageType, UserMessageType } from '@opencx/widget-core';
|
|
2
|
+
export declare function groupMessagesByType(messages: MessageType[]): MessageType[][];
|
|
3
|
+
export declare function isUserMessageGroup(messages: MessageType[]): messages is UserMessageType[];
|
|
4
|
+
export declare function isBotMessageGroup(messages: MessageType[]): messages is BotMessageType[];
|
|
5
|
+
export declare function isAgentMessageGroup(messages: MessageType[]): messages is AgentMessageType[];
|