@aslaluroba/help-center-react 3.2.17 → 3.2.18

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 (101) hide show
  1. package/dist/components/shared/Button/button.d.ts +1 -1
  2. package/dist/components/shared/Card/card.d.ts +1 -4
  3. package/dist/components/ui/agent-response/agent-response.d.ts +2 -1
  4. package/dist/index.css +1424 -1
  5. package/dist/index.d.ts +3 -3
  6. package/dist/index.esm.js +19194 -38923
  7. package/dist/index.esm.js.map +1 -1
  8. package/dist/index.js +19198 -38927
  9. package/dist/index.js.map +1 -1
  10. package/dist/lib/LanguageContext.d.ts +1 -1
  11. package/dist/lib/custom-hooks/useAblyConnection.d.ts +25 -0
  12. package/dist/lib/custom-hooks/useActionHandler.d.ts +1 -7
  13. package/dist/lib/custom-hooks/useChatSession.d.ts +37 -0
  14. package/dist/lib/custom-hooks/useMessageQueue.d.ts +16 -0
  15. package/dist/lib/custom-hooks/useReview.d.ts +14 -0
  16. package/dist/lib/index.d.ts +1 -2
  17. package/dist/services.d.ts +9 -6
  18. package/dist/services.esm.js +1 -14348
  19. package/dist/services.esm.js.map +1 -1
  20. package/dist/services.js +19 -14344
  21. package/dist/services.js.map +1 -1
  22. package/dist/ui/chatbot-popup/chat-window-screen/footer.d.ts +1 -1
  23. package/dist/ui/chatbot-popup/chat-window-screen/in-chat-review.d.ts +1 -1
  24. package/dist/ui/chatbot-popup/chat-window-screen/index.d.ts +2 -2
  25. package/dist/ui/chatbot-popup/options-list-screen/helpscreen-list.d.ts +1 -1
  26. package/dist/ui/chatbot-popup/options-list-screen/helpscreen-option.d.ts +1 -1
  27. package/dist/ui/chatbot-popup/options-list-screen/index.d.ts +1 -1
  28. package/dist/ui/help-center.d.ts +1 -1
  29. package/dist/ui/help-popup.d.ts +4 -27
  30. package/dist/ui/review-dialog/index.d.ts +1 -1
  31. package/package.json +12 -26
  32. package/postcss.config.js +5 -0
  33. package/rollup.config.mjs +34 -0
  34. package/dist/core/AblyService.d.ts +0 -16
  35. package/dist/core/ApiService.d.ts +0 -16
  36. package/dist/core/api.d.ts +0 -10
  37. package/dist/core/token-service.d.ts +0 -10
  38. package/dist/i18n.d.ts +0 -3
  39. package/dist/lib/config.d.ts +0 -18
  40. package/dist/lib/theme-utils.d.ts +0 -10
  41. package/dist/lib/types.d.ts +0 -145
  42. package/dist/lib/utils.d.ts +0 -2
  43. package/src/assets/animatedLogo.gif +0 -0
  44. package/src/assets/logo.svg +0 -5
  45. package/src/assets/seperator.svg +0 -5
  46. package/src/components/index.ts +0 -1
  47. package/src/components/shared/Button/button.tsx +0 -38
  48. package/src/components/shared/Button/index.ts +0 -1
  49. package/src/components/shared/Card/card.tsx +0 -44
  50. package/src/components/shared/Card/index.ts +0 -1
  51. package/src/components/shared/index.ts +0 -2
  52. package/src/components/ui/agent-response/agent-response.tsx +0 -57
  53. package/src/components/ui/agent-response/doc.md +0 -88
  54. package/src/components/ui/image-attachment.tsx +0 -119
  55. package/src/components/ui/image-preview-dialog.tsx +0 -400
  56. package/src/components/ui/index.ts +0 -3
  57. package/src/core/AblyService.ts +0 -243
  58. package/src/core/ApiService.ts +0 -116
  59. package/src/core/api.ts +0 -278
  60. package/src/core/token-service.ts +0 -35
  61. package/src/globals.css +0 -268
  62. package/src/i18n.ts +0 -21
  63. package/src/index.ts +0 -19
  64. package/src/lib/LanguageContext.tsx +0 -28
  65. package/src/lib/config.ts +0 -52
  66. package/src/lib/custom-hooks/useActionHandler.ts +0 -102
  67. package/src/lib/custom-hooks/useTypewriter.ts +0 -26
  68. package/src/lib/index.ts +0 -4
  69. package/src/lib/theme-utils.ts +0 -56
  70. package/src/lib/types.ts +0 -158
  71. package/src/lib/utils.ts +0 -6
  72. package/src/locales/ar.json +0 -45
  73. package/src/locales/en.json +0 -45
  74. package/src/services.ts +0 -14
  75. package/src/types/icons.d.ts +0 -6
  76. package/src/types/svg.d.ts +0 -5
  77. package/src/types.d.ts +0 -9
  78. package/src/ui/chatbot-popup/active-chat-actions.tsx +0 -39
  79. package/src/ui/chatbot-popup/chat-window-screen/action-button.tsx +0 -37
  80. package/src/ui/chatbot-popup/chat-window-screen/footer.tsx +0 -313
  81. package/src/ui/chatbot-popup/chat-window-screen/header.tsx +0 -53
  82. package/src/ui/chatbot-popup/chat-window-screen/in-chat-review.tsx +0 -116
  83. package/src/ui/chatbot-popup/chat-window-screen/index.tsx +0 -366
  84. package/src/ui/chatbot-popup/chat-window-screen/typing-indicator.tsx +0 -31
  85. package/src/ui/chatbot-popup/error-screen/index.tsx +0 -22
  86. package/src/ui/chatbot-popup/loading-screen/index.tsx +0 -21
  87. package/src/ui/chatbot-popup/options-list-screen/company-card.tsx +0 -39
  88. package/src/ui/chatbot-popup/options-list-screen/header.tsx +0 -23
  89. package/src/ui/chatbot-popup/options-list-screen/helpscreen-intro.tsx +0 -32
  90. package/src/ui/chatbot-popup/options-list-screen/helpscreen-list.tsx +0 -57
  91. package/src/ui/chatbot-popup/options-list-screen/helpscreen-option.tsx +0 -56
  92. package/src/ui/chatbot-popup/options-list-screen/index.tsx +0 -70
  93. package/src/ui/confirmation-modal/index.tsx +0 -62
  94. package/src/ui/floating-message.tsx +0 -29
  95. package/src/ui/help-button.tsx +0 -25
  96. package/src/ui/help-center.tsx +0 -448
  97. package/src/ui/help-popup.tsx +0 -367
  98. package/src/ui/powered-by.tsx +0 -62
  99. package/src/ui/review-dialog/index.tsx +0 -149
  100. package/src/ui/review-dialog/rating.tsx +0 -79
  101. package/src/useLocalTranslation.ts +0 -15
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
-
3
- interface HelpscreenIntroProps {
4
- title?: string | null;
5
- }
6
-
7
- const HelpscreenIntro: React.FC<HelpscreenIntroProps> = ({ title }) => {
8
- return (
9
- <section className="babylai:flex babylai:items-center babylai:justify-center babylai:gap-3 babylai:pb-5 babylai:border-b babylai:border-black-white-200">
10
- <svg
11
- className="babylai:w-8 babylai:h-8"
12
- style={{ color: 'var(--babylai-color-primary)' }}
13
- xmlns="http://www.w3.org/2000/svg"
14
- viewBox="0 0 34 34"
15
- fill="currentColor"
16
- >
17
- <path
18
- d="M18.4785 1.12896C18.4758 1.11935 18.4745 1.11454 18.4739 1.11232C18.0509 -0.370772 15.9491 -0.370772 15.5261 1.11232C15.5255 1.11454 15.5242 1.11935 15.5215 1.12896C15.5143 1.15428 15.5107 1.16694 15.5074 1.17883C13.5422 8.11839 8.11839 13.5422 1.17883 15.5074C1.16694 15.5107 1.15428 15.5143 1.12895 15.5215C1.11934 15.5242 1.11454 15.5255 1.11232 15.5261C-0.370773 15.9491 -0.370773 18.0509 1.11232 18.4739C1.11454 18.4745 1.11934 18.4758 1.12896 18.4785C1.15428 18.4857 1.16694 18.4893 1.17883 18.4926C8.11839 20.4578 13.5422 25.8816 15.5074 32.8212C15.5107 32.8331 15.5143 32.8457 15.5215 32.871C15.5242 32.8807 15.5255 32.8855 15.5261 32.8877C15.9491 34.3708 18.0509 34.3708 18.4739 32.8877C18.4745 32.8855 18.4758 32.8807 18.4785 32.871C18.4857 32.8457 18.4893 32.8331 18.4926 32.8212C20.4578 25.8816 25.8816 20.4578 32.8212 18.4926C32.8331 18.4893 32.8457 18.4857 32.871 18.4785C32.8807 18.4758 32.8855 18.4745 32.8877 18.4739C34.3708 18.0509 34.3708 15.9491 32.8877 15.5261C32.8855 15.5255 32.8807 15.5242 32.871 15.5215C32.8457 15.5143 32.8331 15.5107 32.8212 15.5074C25.8816 13.5422 20.4578 8.11839 18.4926 1.17883C18.4893 1.16694 18.4857 1.15428 18.4785 1.12896Z"
19
- fill="currentColor"
20
- />
21
- </svg>
22
- <h1 className="babylai:text-2xl! babylai:font-semibold! babylai:text-card-foreground">
23
- {title}
24
- </h1>
25
- </section>
26
- );
27
- };
28
-
29
- HelpscreenIntro.displayName = 'HelpscreenIntro';
30
-
31
- export default HelpscreenIntro;
32
-
@@ -1,57 +0,0 @@
1
- import React from 'react';
2
- import { Option } from '@/lib/types';
3
- import HelpscreenOption from '@/ui/chatbot-popup/options-list-screen/helpscreen-option';
4
- import { useLocalTranslation } from '@/useLocalTranslation';
5
- import { Button } from '@/components';
6
- import SolarPlain2BoldDuotone from '~icons/solar/plain-2-bold-duotone'
7
-
8
- interface HelpscreenListProps {
9
- options: Option[] | undefined;
10
- selectedOption: Option | null;
11
- onToggleOption: (option: Option) => void;
12
- onStartChat: () => void;
13
- showChatNowButton?: boolean;
14
- chatWithUs?: boolean;
15
- }
16
-
17
- const HelpscreenList: React.FC<HelpscreenListProps> = ({
18
- options,
19
- selectedOption,
20
- onToggleOption,
21
- onStartChat,
22
- showChatNowButton = true,
23
- chatWithUs = true,
24
- }) => {
25
- const { t } = useLocalTranslation();
26
-
27
- return (
28
- <section className='babylai:flex babylai:flex-col babylai:flex-1 babylai:gap-4'>
29
- <div className='babylai:grid babylai:grid-cols-1 babylai:gap-4'>
30
- {options?.map((option) => (
31
- <HelpscreenOption
32
- key={option.id}
33
- option={option}
34
- isSelected={selectedOption?.id === option.id}
35
- onClick={() => onToggleOption(option)}
36
- />
37
- ))}
38
- </div>
39
- {showChatNowButton && (
40
- <div className="babylai:sticky babylai:bottom-0 babylai:z-10">
41
- <Button
42
- variant='default'
43
- onClick={onStartChat}
44
- disabled={!selectedOption || !chatWithUs}
45
- >
46
- {t('homeSdk.chatNow')}
47
- <SolarPlain2BoldDuotone className="babylai:w-6 babylai:h-6" />
48
- </Button>
49
- </div>
50
- )}
51
- </section>
52
- );
53
- };
54
-
55
- HelpscreenList.displayName = 'HelpscreenList';
56
-
57
- export default HelpscreenList;
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import { Option } from '@/lib/types';
3
- import { cn } from '@/lib/utils';
4
-
5
- interface HelpscreenOptionProps {
6
- option: Option;
7
- isSelected: boolean;
8
- onClick: () => void;
9
- }
10
-
11
- const HelpscreenOption: React.FC<HelpscreenOptionProps> = ({
12
- option,
13
- isSelected,
14
- onClick,
15
- }) => {
16
- const chatWithUs = option.chatWithUs ?? true;
17
-
18
- return (
19
- <div
20
- role={chatWithUs ? 'button' : undefined}
21
- tabIndex={chatWithUs ? 0 : undefined}
22
- className={cn(
23
- 'babylai:flex babylai:flex-col babylai:gap-2 babylai:p-6 babylai:rounded-3xl babylai:text-start babylai:border babylai:border-black-white-200 babylai:bg-card',
24
- 'babylai:transition-all babylai:duration-200 babylai:ease-out',
25
- chatWithUs
26
- ? 'babylai:cursor-pointer babylai:active:scale-[0.98] babylai:active:opacity-95'
27
- : 'babylai:cursor-default',
28
- isSelected && 'babylai:ring babylai:ring-primary-500 babylai:shadow-md'
29
- )}
30
- onClick={chatWithUs ? onClick : undefined}
31
- onKeyDown={
32
- chatWithUs
33
- ? (e) => {
34
- if (e.key === 'Enter' || e.key === ' ') {
35
- e.preventDefault();
36
- onClick();
37
- }
38
- }
39
- : undefined
40
- }
41
- >
42
- <h2 className="babylai:text-base! babylai:font-semibold! babylai:text-card-foreground" dir="auto">
43
- {option.title}
44
- </h2>
45
- {option.paragraphs.map((paragraph, index) => (
46
- <p key={index} className="babylai:text-sm babylai:text-muted-foreground babylai:leading-snug" dir="auto">
47
- {paragraph}
48
- </p>
49
- ))}
50
- </div>
51
- );
52
- };
53
-
54
- HelpscreenOption.displayName = 'HelpscreenOption';
55
-
56
- export default HelpscreenOption;
@@ -1,70 +0,0 @@
1
- import { HelpScreenData, Option } from '@/lib/types';
2
- import OptionsListHeader from '@/ui/chatbot-popup/options-list-screen/header';
3
- import CompanyCard from '@/ui/chatbot-popup/options-list-screen/company-card';
4
- import HelpscreenIntro from '@/ui/chatbot-popup/options-list-screen/helpscreen-intro';
5
- import HelpscreenList from '@/ui/chatbot-popup/options-list-screen/helpscreen-list';
6
- import PoweredBy from '@/ui/powered-by';
7
- import { useState, useEffect } from 'react';
8
-
9
- interface OptionsListScreenProps {
10
- helpScreen: HelpScreenData | null;
11
- handleStartChat: (option: Option) => void;
12
- handleMinimize: () => void;
13
- hasActiveSession?: boolean;
14
- }
15
-
16
- const OptionsListScreen: React.FC<OptionsListScreenProps> = ({
17
- helpScreen,
18
- handleStartChat,
19
- handleMinimize,
20
- hasActiveSession = false,
21
- }) => {
22
- const [selectedOption, setSelectedOption] = useState<Option | null>(null);
23
-
24
- useEffect(() => {
25
- // Reset selected option when helpScreen changes
26
- setSelectedOption(null);
27
- }, [helpScreen?.id]);
28
-
29
- const handleToggleExpandOption = (option: Option) => {
30
- if (selectedOption?.id === option.id) {
31
- setSelectedOption(null);
32
- } else {
33
- setSelectedOption(option);
34
- }
35
- };
36
-
37
- const handleStartChatWithSelected = () => {
38
- if (selectedOption) {
39
- handleStartChat(selectedOption);
40
- }
41
- };
42
-
43
- return (
44
- <div className='babylai:flex babylai:flex-col babylai:max-h-full'>
45
- <OptionsListHeader onMinimize={handleMinimize} />
46
- <div className='babylai:flex babylai:flex-col babylai:flex-1 babylai:overflow-y-auto babylai:px-6 babylai:pt-6 babylai:pb-4 babylai:gap-6'>
47
- <HelpscreenIntro title={helpScreen?.title} />
48
-
49
- <CompanyCard
50
- logoUrl={helpScreen?.tenant?.logoUrl}
51
- name={helpScreen?.tenant?.name}
52
- description={helpScreen?.tenant?.settings?.description}
53
- title={helpScreen?.title}
54
- />
55
-
56
- <HelpscreenList
57
- options={helpScreen?.options}
58
- selectedOption={selectedOption}
59
- onToggleOption={handleToggleExpandOption}
60
- onStartChat={handleStartChatWithSelected}
61
- showChatNowButton={!hasActiveSession}
62
- chatWithUs={helpScreen?.chatWithUs ?? true}
63
- />
64
- </div >
65
- <PoweredBy />
66
- </div >
67
- );
68
- };
69
-
70
- export default OptionsListScreen;
@@ -1,62 +0,0 @@
1
- import { Button } from "@/components";
2
- import { useLocalTranslation } from "@/useLocalTranslation";
3
- import SolarChatRoundUnreadBoldDuotone from '~icons/solar/chat-round-unread-bold-duotone'
4
- import SolarCloseCircleLineDuotone from '~icons/solar/close-circle-line-duotone'
5
- import SolarPlain2BoldDuotone from '~icons/solar/plain-2-bold-duotone'
6
- import PoweredBy from "../powered-by";
7
-
8
- interface ConfirmationModalProps {
9
- title: string;
10
- message: string;
11
- onCancel: () => void;
12
- onConfirm: () => void;
13
- }
14
-
15
- const ConfirmationModal = ({ title, message, onCancel, onConfirm }: ConfirmationModalProps) => {
16
- const { t } = useLocalTranslation();
17
-
18
- return (
19
- <div className='babylai:absolute babylai:inset-0 babylai:z-50 babylai:flex babylai:items-end babylai:rounded-3xl babylai:overflow-hidden'>
20
- <div className='babylai:absolute babylai:inset-0 babylai:bg-black/60' onClick={onCancel}></div>
21
- <div className='babylai:flex babylai:flex-col babylai:bg-card babylai:rounded-2xl babylai:w-full babylai:z-50 babylai:shadow-lg'>
22
- <div className='babylai:flex babylai:flex-col babylai:p-6 babylai:pb-5 babylai:w-full'>
23
- <button className="babylai:border-0 babylai:p-0 babylai:flex babylai:bg-transparent babylai:cursor-pointer babylai:mb-6 babylai:ms-auto babylai:text-card-foreground"
24
- type='button'
25
- onClick={onCancel}
26
- >
27
- <SolarCloseCircleLineDuotone className="babylai:w-7 babylai:h-7" />
28
- </button>
29
-
30
- <section className="babylai:flex babylai:items-center babylai:justify-center babylai:border-b babylai:border-black-white-200 babylai:pb-6 babylai:mb-6">
31
- <div className="babylai:flex babylai:items-center babylai:justify-center babylai:w-20 babylai:h-20 babylai:rounded-full babylai:p-3 babylai:bg-primary/15 babylai:text-primary">
32
- <SolarChatRoundUnreadBoldDuotone className="babylai:w-16 babylai:h-16" />
33
- </div>
34
- </section>
35
-
36
- <h3 className='babylai:text-2xl! babylai:text-center babylai:font-bold! babylai:mb-2! babylai:text-card-foreground'>{title}</h3>
37
-
38
- <p className='babylai:text-sm babylai:text-center babylai:text-muted-foreground'>{message}</p>
39
-
40
- <div className='babylai:flex babylai:justify-between babylai:gap-3 babylai:mt-6'>
41
- <Button
42
- onClick={onCancel}
43
- variant='secondary'
44
- >
45
- {t('homeSdk.ConfirmationModal.cancel_button')}
46
- <SolarPlain2BoldDuotone className="babylai:w-6 babylai:h-6" />
47
- </Button>
48
- <Button
49
- onClick={onConfirm}
50
- variant='default'
51
- >
52
- {t('homeSdk.ConfirmationModal.confirmation_button')}
53
- </Button>
54
- </div>
55
- </div>
56
- <PoweredBy />
57
- </div>
58
- </div>
59
- );
60
- };
61
-
62
- export default ConfirmationModal;
@@ -1,29 +0,0 @@
1
- import MaterialSymbolsCloseSmallOutlineRounded from '~icons/material-symbols/close-small-outline-rounded'
2
-
3
- interface FloatingMessageProps {
4
- message: string
5
- onClose: () => void
6
- }
7
-
8
- const FloatingMessage = ({ message, onClose }: FloatingMessageProps) => {
9
- return (
10
- <div
11
- className="
12
- babylai:fixed babylai:bottom-16 babylai:right-4
13
- babylai:z-50 babylai:flex babylai:flex-col babylai:items-end babylai:animate-[float_2s_infinite_ease-in-out]"
14
- >
15
- <div className="babylai:bg-primary-500 babylai:text-white babylai:py-3 babylai:px-4 babylai:rounded-3xl babylai:shadow-lg babylai:mb-4 babylai:max-w-[200px] babylai:relative after:babylai:content-[''] after:babylai:absolute after:babylai:-bottom-[10px] after:babylai:right-5 after:babylai:w-0 after:babylai:h-0 after:babylai:border-l-[10px] after:babylai:border-r-[10px] after:babylai:border-t-[10px] after:babylai:border-l-transparent after:babylai:border-r-transparent after:babylai:border-t-primary-500">
16
- <p className="babylai:text-xs babylai:font-bold babylai:m-0">{message}</p>
17
- <button
18
- className="babylai:absolute babylai:-top-2 babylai:-right-2 babylai:w-5 babylai:h-5 babylai:rounded-full babylai:bg-white babylai:border-none babylai:cursor-pointer babylai:flex babylai:items-center babylai:justify-center babylai:text-black-white-700 babylai:p-[3px] babylai:hover:bg-primary-400 babylai:hover:text-white babylai:shadow-md"
19
- onClick={onClose}
20
- >
21
- <MaterialSymbolsCloseSmallOutlineRounded className="babylai:w-8 babylai:h-8" />
22
- <span className="babylai:sr-only">Close</span>
23
- </button>
24
- </div>
25
- </div>
26
- )
27
- }
28
-
29
- export default FloatingMessage;
@@ -1,25 +0,0 @@
1
- import Logo from '@/assets/logo.svg'
2
-
3
- interface HelpButtonProps {
4
- onClick: () => void
5
- }
6
-
7
- const HelpButton = ({ onClick }: HelpButtonProps) => {
8
-
9
- return (
10
- <button
11
- className="
12
- babylai:fixed babylai:z-50 babylai:bottom-4 babylai:right-4
13
- babylai:p-4
14
- babylai:rounded-full babylai:bg-primary-500 babylai:flex babylai:items-center
15
- babylai:justify-center babylai:border-[0.5px] babylai:border-black-white-50 "
16
- onClick={onClick}
17
- aria-label="Need Help?"
18
- >
19
- <Logo className="babylai:w-8 babylai:h-8 babylai:text-primary-500" />
20
- <span className="babylai:sr-only">Need Help?</span>
21
- </button>
22
- )
23
- }
24
-
25
- export default HelpButton;