@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.
- package/dist/components/shared/Button/button.d.ts +1 -1
- package/dist/components/shared/Card/card.d.ts +1 -4
- package/dist/components/ui/agent-response/agent-response.d.ts +2 -1
- package/dist/index.css +1424 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.esm.js +19194 -38923
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +19198 -38927
- package/dist/index.js.map +1 -1
- package/dist/lib/LanguageContext.d.ts +1 -1
- package/dist/lib/custom-hooks/useAblyConnection.d.ts +25 -0
- package/dist/lib/custom-hooks/useActionHandler.d.ts +1 -7
- package/dist/lib/custom-hooks/useChatSession.d.ts +37 -0
- package/dist/lib/custom-hooks/useMessageQueue.d.ts +16 -0
- package/dist/lib/custom-hooks/useReview.d.ts +14 -0
- package/dist/lib/index.d.ts +1 -2
- package/dist/services.d.ts +9 -6
- package/dist/services.esm.js +1 -14348
- package/dist/services.esm.js.map +1 -1
- package/dist/services.js +19 -14344
- package/dist/services.js.map +1 -1
- package/dist/ui/chatbot-popup/chat-window-screen/footer.d.ts +1 -1
- package/dist/ui/chatbot-popup/chat-window-screen/in-chat-review.d.ts +1 -1
- package/dist/ui/chatbot-popup/chat-window-screen/index.d.ts +2 -2
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-list.d.ts +1 -1
- package/dist/ui/chatbot-popup/options-list-screen/helpscreen-option.d.ts +1 -1
- package/dist/ui/chatbot-popup/options-list-screen/index.d.ts +1 -1
- package/dist/ui/help-center.d.ts +1 -1
- package/dist/ui/help-popup.d.ts +4 -27
- package/dist/ui/review-dialog/index.d.ts +1 -1
- package/package.json +12 -26
- package/postcss.config.js +5 -0
- package/rollup.config.mjs +34 -0
- package/dist/core/AblyService.d.ts +0 -16
- package/dist/core/ApiService.d.ts +0 -16
- package/dist/core/api.d.ts +0 -10
- package/dist/core/token-service.d.ts +0 -10
- package/dist/i18n.d.ts +0 -3
- package/dist/lib/config.d.ts +0 -18
- package/dist/lib/theme-utils.d.ts +0 -10
- package/dist/lib/types.d.ts +0 -145
- package/dist/lib/utils.d.ts +0 -2
- package/src/assets/animatedLogo.gif +0 -0
- package/src/assets/logo.svg +0 -5
- package/src/assets/seperator.svg +0 -5
- package/src/components/index.ts +0 -1
- package/src/components/shared/Button/button.tsx +0 -38
- package/src/components/shared/Button/index.ts +0 -1
- package/src/components/shared/Card/card.tsx +0 -44
- package/src/components/shared/Card/index.ts +0 -1
- package/src/components/shared/index.ts +0 -2
- package/src/components/ui/agent-response/agent-response.tsx +0 -57
- package/src/components/ui/agent-response/doc.md +0 -88
- package/src/components/ui/image-attachment.tsx +0 -119
- package/src/components/ui/image-preview-dialog.tsx +0 -400
- package/src/components/ui/index.ts +0 -3
- package/src/core/AblyService.ts +0 -243
- package/src/core/ApiService.ts +0 -116
- package/src/core/api.ts +0 -278
- package/src/core/token-service.ts +0 -35
- package/src/globals.css +0 -268
- package/src/i18n.ts +0 -21
- package/src/index.ts +0 -19
- package/src/lib/LanguageContext.tsx +0 -28
- package/src/lib/config.ts +0 -52
- package/src/lib/custom-hooks/useActionHandler.ts +0 -102
- package/src/lib/custom-hooks/useTypewriter.ts +0 -26
- package/src/lib/index.ts +0 -4
- package/src/lib/theme-utils.ts +0 -56
- package/src/lib/types.ts +0 -158
- package/src/lib/utils.ts +0 -6
- package/src/locales/ar.json +0 -45
- package/src/locales/en.json +0 -45
- package/src/services.ts +0 -14
- package/src/types/icons.d.ts +0 -6
- package/src/types/svg.d.ts +0 -5
- package/src/types.d.ts +0 -9
- package/src/ui/chatbot-popup/active-chat-actions.tsx +0 -39
- package/src/ui/chatbot-popup/chat-window-screen/action-button.tsx +0 -37
- package/src/ui/chatbot-popup/chat-window-screen/footer.tsx +0 -313
- package/src/ui/chatbot-popup/chat-window-screen/header.tsx +0 -53
- package/src/ui/chatbot-popup/chat-window-screen/in-chat-review.tsx +0 -116
- package/src/ui/chatbot-popup/chat-window-screen/index.tsx +0 -366
- package/src/ui/chatbot-popup/chat-window-screen/typing-indicator.tsx +0 -31
- package/src/ui/chatbot-popup/error-screen/index.tsx +0 -22
- package/src/ui/chatbot-popup/loading-screen/index.tsx +0 -21
- package/src/ui/chatbot-popup/options-list-screen/company-card.tsx +0 -39
- package/src/ui/chatbot-popup/options-list-screen/header.tsx +0 -23
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-intro.tsx +0 -32
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-list.tsx +0 -57
- package/src/ui/chatbot-popup/options-list-screen/helpscreen-option.tsx +0 -56
- package/src/ui/chatbot-popup/options-list-screen/index.tsx +0 -70
- package/src/ui/confirmation-modal/index.tsx +0 -62
- package/src/ui/floating-message.tsx +0 -29
- package/src/ui/help-button.tsx +0 -25
- package/src/ui/help-center.tsx +0 -448
- package/src/ui/help-popup.tsx +0 -367
- package/src/ui/powered-by.tsx +0 -62
- package/src/ui/review-dialog/index.tsx +0 -149
- package/src/ui/review-dialog/rating.tsx +0 -79
- 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
|
|
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
|
-
|
|
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
|
+
};
|
package/dist/lib/index.d.ts
CHANGED
package/dist/services.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
export
|
|
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';
|