@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
@@ -7,5 +7,5 @@ interface LanguageProviderProps {
7
7
  language: string;
8
8
  }
9
9
  export declare const LanguageProvider: React.FC<LanguageProviderProps>;
10
- export declare const useLanguage: () => LanguageContextType | null;
10
+ export declare const useLanguage: () => LanguageContextType;
11
11
  export {};
@@ -0,0 +1,25 @@
1
+ import { Option, SenderType } from '@aslaluroba/help-center-core';
2
+ type OnMessageCallback = (message: string | {
3
+ content: string;
4
+ attachments?: string[];
5
+ }, senderType: SenderType, agentNeeded: boolean) => void;
6
+ type OnActionCallback = (actionType: string, messageData: unknown) => void;
7
+ export interface StartSessionOptions {
8
+ helpScreenId: string;
9
+ language: 'ar' | 'en';
10
+ user?: {
11
+ id?: string;
12
+ name?: string;
13
+ email?: string;
14
+ avatar?: string;
15
+ };
16
+ onMessage: OnMessageCallback;
17
+ onAction: OnActionCallback;
18
+ }
19
+ export declare function useAblyConnection(): {
20
+ sessionId: string | null;
21
+ setSessionId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
22
+ startNewChatSession: (option: Option, opts: StartSessionOptions) => Promise<string>;
23
+ stopConnection: () => Promise<void>;
24
+ };
25
+ export {};
@@ -1,8 +1,2 @@
1
- export type ActionHandler = (messageData: unknown) => void | Promise<void>;
2
- export interface ActionHandlerService {
3
- registerHandler(actionType: string, handler: ActionHandler): void;
4
- unregisterHandler(actionType: string): void;
5
- handleAction(actionType: string | undefined | null, messageData: unknown): Promise<void>;
6
- getRegisteredActions(): string[];
7
- }
1
+ import type { ActionHandlerService } from '@aslaluroba/help-center-core';
8
2
  export declare const useActionHandler: () => ActionHandlerService;
@@ -0,0 +1,37 @@
1
+ import { Option, ReviewProps } from '@aslaluroba/help-center-core';
2
+ export interface ChatSession {
3
+ sessionId: string | null;
4
+ reviewSessionId: string | null;
5
+ inChatReviewSessionId: string | null;
6
+ isChatClosed: boolean;
7
+ messages: import('@aslaluroba/help-center-core').Message[];
8
+ needsAgent: boolean;
9
+ assistantStatus: string;
10
+ isReviewDialogOpen: boolean;
11
+ isSubmittingReview: boolean;
12
+ navigateToOptionsListAfterReview: boolean;
13
+ selectedOption: Option | null;
14
+ setSelectedOption: (option: Option | null) => void;
15
+ handleStartChat: (option: Option) => void;
16
+ handleSendMessage: (message: string, attachmentIds: string[], previewUrls?: string[]) => Promise<void>;
17
+ handleEnsureSession: () => Promise<string>;
18
+ handleEndChat: (options?: {
19
+ fromChatScreen?: boolean;
20
+ sessionClosedByServer?: boolean;
21
+ }) => Promise<void>;
22
+ handleSendChatReview: (payload: ReviewProps) => Promise<void>;
23
+ handleCloseChatReview: () => void;
24
+ onNavigatedToOptionsList: () => void;
25
+ }
26
+ interface UseChatSessionOptions {
27
+ helpScreenId: string;
28
+ language: 'ar' | 'en';
29
+ user?: {
30
+ id?: string;
31
+ name?: string;
32
+ email?: string;
33
+ avatar?: string;
34
+ };
35
+ }
36
+ export declare function useChatSession({ helpScreenId, language, user, }: UseChatSessionOptions): ChatSession;
37
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Message, Option, SenderType } from '@aslaluroba/help-center-core';
2
+ export declare const nextMsgId: () => number;
3
+ export declare function useMessageQueue(): {
4
+ messages: Message[];
5
+ needsAgent: boolean;
6
+ assistantStatus: string;
7
+ setMessages: import("react").Dispatch<import("react").SetStateAction<Message[]>>;
8
+ setNeedsAgent: import("react").Dispatch<import("react").SetStateAction<boolean>>;
9
+ setAssistantStatus: import("react").Dispatch<import("react").SetStateAction<string>>;
10
+ handleReceiveMessage: (message: string | {
11
+ content: string;
12
+ attachments?: string[];
13
+ }, senderType: SenderType, agentNeeded: boolean) => void;
14
+ initMessages: (option: Option) => void;
15
+ appendSystemMessage: (content: string) => void;
16
+ };
@@ -0,0 +1,14 @@
1
+ import { ReviewProps } from '@aslaluroba/help-center-core';
2
+ export declare function useReview(language: 'ar' | 'en'): {
3
+ reviewSessionId: string | null;
4
+ inChatReviewSessionId: string | null;
5
+ isReviewDialogOpen: boolean;
6
+ isSubmittingReview: boolean;
7
+ navigateToOptionsListAfterReview: boolean;
8
+ setReviewSessionId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
9
+ openReview: (sessionId: string, fromChatScreen: boolean) => void;
10
+ clearInChatReview: () => void;
11
+ handleSendChatReview: ({ comment, rating }: ReviewProps) => Promise<void>;
12
+ handleCloseChatReview: () => void;
13
+ onNavigatedToOptionsList: () => void;
14
+ };
@@ -1,4 +1,3 @@
1
1
  export * from "./LanguageContext";
2
- export * from "./utils";
3
- export * from "./theme-utils";
2
+ export { cn, getPrimaryColorStyles } from "@aslaluroba/help-center-core";
4
3
  export * from "./custom-hooks/useActionHandler";
@@ -1,6 +1,9 @@
1
- export { ApiService } from './core/ApiService';
2
- export { ClientAblyService as AblyService } from './core/AblyService';
3
- export { TokenService } from './core/token-service';
4
- export { initializeAPI, getValidToken, apiRequest } from './core/api';
5
- export type { TokenResponse } from './lib/types';
6
- export * from './lib/types';
1
+ /**
2
+ * @deprecated Import directly from `@aslaluroba/help-center-core` instead.
3
+ * This re-export file will be removed in the next major version.
4
+ */
5
+ export { ApiService } from '@aslaluroba/help-center-core';
6
+ export { ClientAblyService as AblyService } from '@aslaluroba/help-center-core';
7
+ export { TokenService } from '@aslaluroba/help-center-core';
8
+ export { initializeAPI, getValidToken, apiRequest } from '@aslaluroba/help-center-core';
9
+ export type { TokenResponse } from '@aslaluroba/help-center-core';