profinansy-ui-lib 4.1.50 → 4.1.52
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/api/clubSearch/clubSearch.d.ts +32 -0
- package/dist/api/support/support.api.d.ts +29 -0
- package/dist/api/support/support.socket.d.ts +38 -0
- package/dist/api/support/support.typed.d.ts +176 -0
- package/dist/components/blocks/SupportV2/SupportV2.const.d.ts +47 -0
- package/dist/components/blocks/SupportV2/SupportV2.d.ts +3 -0
- package/dist/components/blocks/SupportV2/SupportV2.styled.d.ts +19 -0
- package/dist/components/blocks/SupportV2/SupportV2.typed.d.ts +105 -0
- package/dist/components/blocks/SupportV2/components/AttachSheet.d.ts +11 -0
- package/dist/components/blocks/SupportV2/components/ChatFeed.d.ts +28 -0
- package/dist/components/blocks/SupportV2/components/ChatHeader.d.ts +13 -0
- package/dist/components/blocks/SupportV2/components/CommandChips.d.ts +8 -0
- package/dist/components/blocks/SupportV2/components/Composer.d.ts +22 -0
- package/dist/components/blocks/SupportV2/components/GuestGate.d.ts +18 -0
- package/dist/components/blocks/SupportV2/components/LinkPreviewCard.d.ts +10 -0
- package/dist/components/blocks/SupportV2/components/LoadError.d.ts +8 -0
- package/dist/components/blocks/SupportV2/components/MessageBubble.d.ts +23 -0
- package/dist/components/blocks/SupportV2/components/NpsRating.d.ts +6 -0
- package/dist/components/blocks/SupportV2/components/chat.styled.d.ts +148 -0
- package/dist/components/blocks/SupportV2/index.d.ts +2 -0
- package/dist/components/blocks/SupportV2/support.map.d.ts +40 -0
- package/dist/components/blocks/SupportV2/useSupportChat.d.ts +39 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/ClubSearch.styled.d.ts +22 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/ClubSearch.translations.d.ts +24 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/ClubSearchModal.d.ts +8 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/ClubSearchTrigger.d.ts +3 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/ClubSearchTrigger.typed.d.ts +3 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/components/SearchEmptyState/SearchEmptyState.d.ts +3 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/components/SearchEmptyState/SearchEmptyState.typed.d.ts +4 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/components/SearchEmptyState/index.d.ts +1 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/components/SearchResultItem.d.ts +3 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/components/SearchResultItem.typed.d.ts +8 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/hooks/useClubSearch.d.ts +8 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/index.d.ts +2 -0
- package/dist/components/blocks/headerV2/components/Burger/components/ClubSearch/utils/getClubSearchSectionMeta.d.ts +12 -0
- package/dist/components/blocks/headerV2/components/Burger/components/Item/Item.d.ts +3 -1
- package/dist/components/blocks/headerV2/components/Burger/components/Menu/Menu.d.ts +2 -4
- package/dist/components/blocks/headerV2/components/Burger/components/Menu/Menu.typed.d.ts +5 -0
- package/dist/components/blocks/headerV2/components/Burger/components/SupPages/SubPages.d.ts +3 -1
- package/dist/components/uikit/DatepickerV2/DatepickerV2.d.ts +3 -0
- package/dist/components/uikit/DatepickerV2/DatepickerV2.styled.d.ts +6 -0
- package/dist/components/uikit/DatepickerV2/DatepickerV2.typed.d.ts +53 -0
- package/dist/components/uikit/DatepickerV2/components/Calendar/Calendar.d.ts +3 -0
- package/dist/components/uikit/DatepickerV2/components/Calendar/Calendar.styled.d.ts +19 -0
- package/dist/components/uikit/DatepickerV2/components/Calendar/Calendar.typed.d.ts +20 -0
- package/dist/components/uikit/DatepickerV2/components/ComparisonPeriod/ComparisonPeriod.const.d.ts +25 -0
- package/dist/components/uikit/DatepickerV2/components/ComparisonPeriod/ComparisonPeriod.d.ts +3 -0
- package/dist/components/uikit/DatepickerV2/components/ComparisonPeriod/ComparisonPeriod.styled.d.ts +32 -0
- package/dist/components/uikit/DatepickerV2/components/ComparisonPeriod/ComparisonPeriod.typed.d.ts +21 -0
- package/dist/components/uikit/DatepickerV2/components/ComparisonPeriod/ComparisonPeriodSettings.d.ts +12 -0
- package/dist/components/uikit/DatepickerV2/components/ComparisonPeriod/index.d.ts +1 -0
- package/dist/components/uikit/DatepickerV2/components/Day/Day.d.ts +11 -0
- package/dist/components/uikit/DatepickerV2/components/Day/Day.styled.d.ts +4 -0
- package/dist/components/uikit/DatepickerV2/components/Header/Header.d.ts +5 -0
- package/dist/components/uikit/DatepickerV2/components/Header/Header.styled.d.ts +12 -0
- package/dist/components/uikit/DatepickerV2/components/Header/index.d.ts +1 -0
- package/dist/components/uikit/DatepickerV2/components/Input/Input.d.ts +19 -0
- package/dist/components/uikit/DatepickerV2/components/Input/Input.styled.d.ts +16 -0
- package/dist/components/uikit/DatepickerV2/components/MobileRangePicker/MobileRangePicker.d.ts +3 -0
- package/dist/components/uikit/DatepickerV2/components/MobileRangePicker/MobileRangePicker.styled.d.ts +22 -0
- package/dist/components/uikit/DatepickerV2/components/MobileRangePicker/MobileRangePicker.typed.d.ts +23 -0
- package/dist/components/uikit/DatepickerV2/components/MobileRangePicker/index.d.ts +1 -0
- package/dist/components/uikit/DatepickerV2/components/PeriodTemplates/PeriodTemplates.const.d.ts +23 -0
- package/dist/components/uikit/DatepickerV2/components/PeriodTemplates/PeriodTemplates.d.ts +3 -0
- package/dist/components/uikit/DatepickerV2/components/PeriodTemplates/PeriodTemplates.styled.d.ts +7 -0
- package/dist/components/uikit/DatepickerV2/components/PeriodTemplates/PeriodTemplates.typed.d.ts +6 -0
- package/dist/components/uikit/DatepickerV2/components/RangeSummary/RangeSummary.d.ts +3 -0
- package/dist/components/uikit/DatepickerV2/components/RangeSummary/RangeSummary.styled.d.ts +6 -0
- package/dist/components/uikit/DatepickerV2/components/RangeSummary/RangeSummary.typed.d.ts +7 -0
- package/dist/components/uikit/DatepickerV2/components/Time/Time.const.d.ts +8 -0
- package/dist/components/uikit/DatepickerV2/components/Time/Time.d.ts +3 -0
- package/dist/components/uikit/DatepickerV2/components/Time/Time.styled.d.ts +12 -0
- package/dist/components/uikit/DatepickerV2/components/Time/Time.typed.d.ts +6 -0
- package/dist/components/uikit/DatepickerV2/index.d.ts +2 -0
- package/dist/components/uikit/Modal/Modal.typed.d.ts +2 -0
- package/dist/components/uikit/SegmentControl/SegmentControl.styled.d.ts +2 -0
- package/dist/components/uikit/Switch/Switch.styled.d.ts +1 -1
- package/dist/constants/common.d.ts +3 -0
- package/dist/index.d.ts +4 -0
- package/dist/localization/translations/common.d.ts +2 -0
- package/dist/localization/translations/support.d.ts +98 -0
- package/dist/localization/translations/urls.d.ts +6 -0
- package/dist/profinansy-ui-lib.cjs +10778 -8224
- package/dist/profinansy-ui-lib.cjs.map +1 -1
- package/dist/profinansy-ui-lib.es.js +38616 -27698
- package/dist/profinansy-ui-lib.es.js.map +1 -1
- package/dist/theme/Theme.stories.styled.d.ts +34 -0
- package/dist/theme/ThemeProvider.d.ts +8 -7
- package/dist/theme/theme.const.d.ts +134 -52
- package/dist/urls/products/idv/idvLinks.d.ts +13 -0
- package/dist/urls/products/method/methodLinks.d.ts +13 -6
- package/dist/urls/productsV2/courses/courses.header.d.ts +18 -0
- package/dist/urls/productsV2/method/method.d.ts +10 -33
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IApiSettings } from 'src/api/api';
|
|
2
|
+
export type ClubSearchNewsItem = {
|
|
3
|
+
news_id: number;
|
|
4
|
+
title: string;
|
|
5
|
+
tags?: number[];
|
|
6
|
+
idea?: unknown;
|
|
7
|
+
};
|
|
8
|
+
export type ClubSearchNewsResponse = {
|
|
9
|
+
data: ClubSearchNewsItem[];
|
|
10
|
+
next?: string;
|
|
11
|
+
ok?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type ClubLentaMenuItem = {
|
|
14
|
+
news_section_id: number;
|
|
15
|
+
code: string;
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
export type ClubMenuTab = {
|
|
19
|
+
id: number;
|
|
20
|
+
code: string;
|
|
21
|
+
name: string;
|
|
22
|
+
childs?: ClubMenuTab[] | null;
|
|
23
|
+
};
|
|
24
|
+
export declare const searchClubNews: (params: Record<string, string | number>, settings: IApiSettings) => Promise<ClubSearchNewsResponse>;
|
|
25
|
+
export declare const getClubLentaMenu: (settings: IApiSettings) => Promise<{
|
|
26
|
+
data: ClubLentaMenuItem[];
|
|
27
|
+
ok?: boolean;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const getClubMenuTabs: (settings: IApiSettings) => Promise<{
|
|
30
|
+
data: ClubMenuTab[];
|
|
31
|
+
ok?: boolean;
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IApiSettings } from '../api';
|
|
2
|
+
import { ISupportBotAskRequest, ISupportBotAskResponse, ISupportBotRateRequest, ISupportChatHistoryResponse, ISupportChatMessageOut, ISupportMarkReadData, ISupportMarkReadRequest, ISupportMenuButtonOut, ISupportNavData, ISupportNavRequest, ISupportOnboardingClickData, ISupportOnboardingClickRequest, ISupportOperatorClickData, ISupportQaClickData, ISupportQaClickRequest, ISupportUnreadCountData } from './support.typed';
|
|
3
|
+
type TSupportApiSettings = IApiSettings & {
|
|
4
|
+
sourceUrl: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const supportApi: {
|
|
7
|
+
getChat: (apiSettings: TSupportApiSettings, params?: {
|
|
8
|
+
skip?: number;
|
|
9
|
+
limit?: number;
|
|
10
|
+
}) => Promise<ISupportChatHistoryResponse>;
|
|
11
|
+
getUnreadCount: (apiSettings: IApiSettings) => Promise<ISupportUnreadCountData>;
|
|
12
|
+
markRead: (apiSettings: IApiSettings, payload?: ISupportMarkReadRequest) => Promise<ISupportMarkReadData>;
|
|
13
|
+
sendText: (apiSettings: TSupportApiSettings, payload: ISupportBotAskRequest) => Promise<ISupportBotAskResponse>;
|
|
14
|
+
rate: (apiSettings: TSupportApiSettings, payload: ISupportBotRateRequest) => Promise<Record<string, unknown> | null>;
|
|
15
|
+
clickQa: (apiSettings: TSupportApiSettings, payload: ISupportQaClickRequest) => Promise<ISupportQaClickData>;
|
|
16
|
+
clickOperator: (apiSettings: TSupportApiSettings) => Promise<ISupportOperatorClickData>;
|
|
17
|
+
clickOnboarding: (apiSettings: TSupportApiSettings, payload: ISupportOnboardingClickRequest) => Promise<ISupportOnboardingClickData>;
|
|
18
|
+
getTreeRoot: (apiSettings: IApiSettings) => Promise<ISupportMenuButtonOut[]>;
|
|
19
|
+
nav: (apiSettings: TSupportApiSettings, payload: ISupportNavRequest) => Promise<ISupportNavData>;
|
|
20
|
+
uploadFile: (apiSettings: TSupportApiSettings, payload: {
|
|
21
|
+
file: File;
|
|
22
|
+
caption?: string;
|
|
23
|
+
conversationId?: number;
|
|
24
|
+
}, options?: {
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
onProgress?: (loaded: number, total: number) => void;
|
|
27
|
+
}) => Promise<ISupportChatMessageOut>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Socket } from 'socket.io-client';
|
|
2
|
+
import { ISupportMarkReadRequest, ISupportNavData, ISupportNavRequest, ISupportOnboardingClickData, ISupportOnboardingClickRequest, ISupportOperatorClickData, ISupportQaClickData, ISupportQaClickRequest, ISupportSocketAnswer, ISupportSocketAnswerDone, ISupportSocketError, ISupportSocketMessageDelete, ISupportSocketMessageEdit, ISupportSocketNps, ISupportSocketRead, ISupportSocketReadAck, ISupportSocketSystem, ISupportSocketTyping } from './support.typed';
|
|
3
|
+
export interface ISupportSocketHandlers {
|
|
4
|
+
onConnect?: () => void;
|
|
5
|
+
onConnectError?: (error: Error) => void;
|
|
6
|
+
onAnswer?: (payload: ISupportSocketAnswer) => void;
|
|
7
|
+
onAnswerDone?: (payload: ISupportSocketAnswerDone) => void;
|
|
8
|
+
onQaClick?: (payload: ISupportQaClickData) => void;
|
|
9
|
+
onOperatorClick?: (payload: ISupportOperatorClickData) => void;
|
|
10
|
+
onOnboardingClick?: (payload: ISupportOnboardingClickData) => void;
|
|
11
|
+
onNav?: (payload: ISupportNavData) => void;
|
|
12
|
+
onNps?: (payload: ISupportSocketNps) => void;
|
|
13
|
+
onOperatorSessionStarted?: () => void;
|
|
14
|
+
onOperatorSessionEnded?: () => void;
|
|
15
|
+
onRead?: (payload: ISupportSocketRead) => void;
|
|
16
|
+
onReadAck?: (payload: ISupportSocketReadAck) => void;
|
|
17
|
+
onTyping?: (payload: ISupportSocketTyping) => void;
|
|
18
|
+
onMessageEdit?: (payload: ISupportSocketMessageEdit) => void;
|
|
19
|
+
onMessageDelete?: (payload: ISupportSocketMessageDelete) => void;
|
|
20
|
+
onSystem?: (payload: ISupportSocketSystem) => void;
|
|
21
|
+
onError?: (payload: ISupportSocketError) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface ISupportSocketClient {
|
|
24
|
+
socket: Socket;
|
|
25
|
+
emitQuestion: (text: string) => void;
|
|
26
|
+
emitQaClick: (payload: ISupportQaClickRequest) => void;
|
|
27
|
+
emitNav: (payload: ISupportNavRequest) => void;
|
|
28
|
+
emitOperatorClick: () => void;
|
|
29
|
+
emitOnboardingClick: (payload: ISupportOnboardingClickRequest) => void;
|
|
30
|
+
emitRead: (payload?: ISupportMarkReadRequest) => void;
|
|
31
|
+
disconnect: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const connectSupportSocket: ({ token, isTest, sourceUrl, handlers }: {
|
|
34
|
+
token: string;
|
|
35
|
+
isTest?: boolean;
|
|
36
|
+
sourceUrl: string;
|
|
37
|
+
handlers: ISupportSocketHandlers;
|
|
38
|
+
}) => Promise<ISupportSocketClient>;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
export type TSupportMessageRoleApi = 'user' | 'bot' | 'operator';
|
|
2
|
+
export declare const SUPPORT_WEB_SOURCE: "web";
|
|
3
|
+
export type TSupportChipKindApi = 'tree' | 'qa' | 'menu' | 'back' | 'url' | 'operator' | 'onboarding';
|
|
4
|
+
export type TSupportAttachmentKind = 'image' | 'document';
|
|
5
|
+
export type TSupportNavTarget = 'menu' | 'tree' | 'qa' | 'back';
|
|
6
|
+
export interface ISupportApiEnvelope<T> {
|
|
7
|
+
data?: T | null;
|
|
8
|
+
error?: string | Record<string, unknown> | null;
|
|
9
|
+
msg?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ISupportAttachmentOut {
|
|
12
|
+
url: string;
|
|
13
|
+
filename: string;
|
|
14
|
+
content_type: string;
|
|
15
|
+
size: number;
|
|
16
|
+
kind: TSupportAttachmentKind;
|
|
17
|
+
}
|
|
18
|
+
export interface ISupportMenuButtonOut {
|
|
19
|
+
label: string;
|
|
20
|
+
kind: TSupportChipKindApi;
|
|
21
|
+
node_id?: number | null;
|
|
22
|
+
url?: string | null;
|
|
23
|
+
action?: string | null;
|
|
24
|
+
has_children?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ISupportChatMessageOut {
|
|
27
|
+
id: number;
|
|
28
|
+
role: TSupportMessageRoleApi;
|
|
29
|
+
content: string;
|
|
30
|
+
created_at: string;
|
|
31
|
+
read_at?: string | null;
|
|
32
|
+
edited_at?: string | null;
|
|
33
|
+
flow_id?: number | null;
|
|
34
|
+
metadata_json?: Record<string, unknown> | null;
|
|
35
|
+
attachments?: ISupportAttachmentOut[] | null;
|
|
36
|
+
buttons?: ISupportMenuButtonOut[] | null;
|
|
37
|
+
}
|
|
38
|
+
export interface ISupportBotMessageOut {
|
|
39
|
+
text: string;
|
|
40
|
+
scenario: string;
|
|
41
|
+
buttons?: ISupportMenuButtonOut[] | null;
|
|
42
|
+
metadata?: Record<string, unknown> | null;
|
|
43
|
+
}
|
|
44
|
+
export interface ISupportBotAskRequest {
|
|
45
|
+
question: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ISupportBotAskResponse {
|
|
48
|
+
answers?: string[];
|
|
49
|
+
messages?: ISupportBotMessageOut[];
|
|
50
|
+
buttons?: ISupportMenuButtonOut[] | null;
|
|
51
|
+
flow_id?: number | null;
|
|
52
|
+
should_show_nps?: boolean;
|
|
53
|
+
subcategory?: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface ISupportBotRateRequest {
|
|
56
|
+
rating: number;
|
|
57
|
+
}
|
|
58
|
+
export interface ISupportMarkReadRequest {
|
|
59
|
+
conversation_id?: number | null;
|
|
60
|
+
message_ids?: number[] | null;
|
|
61
|
+
}
|
|
62
|
+
export interface ISupportMarkReadData {
|
|
63
|
+
updated: number;
|
|
64
|
+
read_at: string;
|
|
65
|
+
message_ids?: number[];
|
|
66
|
+
}
|
|
67
|
+
export interface ISupportNavRequest {
|
|
68
|
+
target: TSupportNavTarget;
|
|
69
|
+
node_id?: number | null;
|
|
70
|
+
}
|
|
71
|
+
export interface ISupportNavData {
|
|
72
|
+
target: string;
|
|
73
|
+
text: string;
|
|
74
|
+
node_id?: number | null;
|
|
75
|
+
buttons?: ISupportMenuButtonOut[];
|
|
76
|
+
id?: number | null;
|
|
77
|
+
created_at?: string | null;
|
|
78
|
+
}
|
|
79
|
+
export interface ISupportQaClickRequest {
|
|
80
|
+
node_id: number;
|
|
81
|
+
}
|
|
82
|
+
export interface ISupportQaClickData {
|
|
83
|
+
node_id: number;
|
|
84
|
+
label: string;
|
|
85
|
+
action: string;
|
|
86
|
+
answers?: string[];
|
|
87
|
+
messages?: ISupportBotMessageOut[];
|
|
88
|
+
children?: ISupportMenuButtonOut[];
|
|
89
|
+
escalated?: boolean;
|
|
90
|
+
should_show_nps?: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface ISupportOperatorClickData {
|
|
93
|
+
answers?: string[];
|
|
94
|
+
children?: ISupportMenuButtonOut[];
|
|
95
|
+
escalated?: boolean;
|
|
96
|
+
label?: string;
|
|
97
|
+
}
|
|
98
|
+
export type TSupportOnboardingValue = 'has_account' | 'no_account';
|
|
99
|
+
export interface ISupportOnboardingClickRequest {
|
|
100
|
+
value: TSupportOnboardingValue;
|
|
101
|
+
}
|
|
102
|
+
export interface ISupportOnboardingClickData {
|
|
103
|
+
messages?: ISupportBotMessageOut[];
|
|
104
|
+
answers?: string[];
|
|
105
|
+
buttons?: ISupportMenuButtonOut[];
|
|
106
|
+
}
|
|
107
|
+
export interface ISupportUnreadCountData {
|
|
108
|
+
unread_count: number;
|
|
109
|
+
}
|
|
110
|
+
export interface ISupportChatHistoryResponse {
|
|
111
|
+
data?: ISupportChatMessageOut[] | null;
|
|
112
|
+
error?: string | Record<string, unknown> | null;
|
|
113
|
+
msg?: string;
|
|
114
|
+
operator_session_active?: boolean;
|
|
115
|
+
unread_count?: number;
|
|
116
|
+
}
|
|
117
|
+
export interface ISupportSocketAnswer {
|
|
118
|
+
id?: number;
|
|
119
|
+
index?: number;
|
|
120
|
+
total?: number;
|
|
121
|
+
scenario?: string;
|
|
122
|
+
created_at?: string;
|
|
123
|
+
read_at?: string | null;
|
|
124
|
+
edited_at?: string | null;
|
|
125
|
+
flow_id?: number | null;
|
|
126
|
+
sender?: TSupportMessageRoleApi;
|
|
127
|
+
role?: TSupportMessageRoleApi;
|
|
128
|
+
attachments?: ISupportAttachmentOut[] | null;
|
|
129
|
+
buttons?: ISupportMenuButtonOut[] | null;
|
|
130
|
+
case_id?: number | null;
|
|
131
|
+
text?: string;
|
|
132
|
+
content?: string;
|
|
133
|
+
}
|
|
134
|
+
export interface ISupportSocketAnswerDone {
|
|
135
|
+
total: number;
|
|
136
|
+
}
|
|
137
|
+
export interface ISupportSocketNps {
|
|
138
|
+
should_show_nps?: boolean;
|
|
139
|
+
prompt?: string;
|
|
140
|
+
buttons?: ISupportMenuButtonOut[];
|
|
141
|
+
text?: string;
|
|
142
|
+
}
|
|
143
|
+
export interface ISupportSocketTyping {
|
|
144
|
+
event?: 'typing';
|
|
145
|
+
sender?: TSupportMessageRoleApi | 'bot';
|
|
146
|
+
status?: boolean;
|
|
147
|
+
}
|
|
148
|
+
export interface ISupportSocketError {
|
|
149
|
+
message?: string;
|
|
150
|
+
code?: number | string;
|
|
151
|
+
}
|
|
152
|
+
export interface ISupportSocketRead {
|
|
153
|
+
message_ids?: number[];
|
|
154
|
+
read_at?: string;
|
|
155
|
+
}
|
|
156
|
+
export interface ISupportSocketReadAck {
|
|
157
|
+
updated: number;
|
|
158
|
+
message_ids?: number[];
|
|
159
|
+
}
|
|
160
|
+
export interface ISupportSocketMessageEdit {
|
|
161
|
+
id: number;
|
|
162
|
+
content?: string;
|
|
163
|
+
text?: string;
|
|
164
|
+
edited_at?: string;
|
|
165
|
+
attachments?: ISupportAttachmentOut[] | null;
|
|
166
|
+
}
|
|
167
|
+
export interface ISupportSocketMessageDelete {
|
|
168
|
+
id: number;
|
|
169
|
+
deleted_at?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface ISupportSocketSystem {
|
|
172
|
+
text?: string;
|
|
173
|
+
content?: string;
|
|
174
|
+
scenario?: string | null;
|
|
175
|
+
}
|
|
176
|
+
export declare const SUPPORT_SOCKET_PATH = "/chat/ws/";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ISupportLayoutAttachment, ISupportLayoutChip, ISupportLayoutMessage, TSupportLayoutPreset } from './SupportV2.typed';
|
|
2
|
+
import type { TProject } from '../../../config';
|
|
3
|
+
export declare const SUPPORT_WIDGET_ID = "support-widget";
|
|
4
|
+
export declare const SUPPORT_CHAT_QUERY = "supportChat";
|
|
5
|
+
export declare const SUPPORT_DRAFT_PREFIX = "support-chat-draft:";
|
|
6
|
+
export declare const SUPPORT_LOGIN_PATH = "/login";
|
|
7
|
+
export declare const SUPPORT_HOME_PATH = "/";
|
|
8
|
+
export declare const SUPPORT_AVATAR_URL = "https://storage.yandexcloud.net/public-files.profinansy.ru/images/support-avatar.png";
|
|
9
|
+
export declare const SUPPORT_LINK_PREVIEW_IMAGE_URL = "https://storage.yandexcloud.net/public-files.profinansy.ru/images/link-preview.png";
|
|
10
|
+
export declare const SUPPORT_GUEST_ROBOT_URL = "https://storage.yandexcloud.net/public-files.profinansy.ru/images/guest-support-robot.png";
|
|
11
|
+
export declare const getSupportDraftKey: (userId?: number | string | null) => string;
|
|
12
|
+
export declare const COMPOSER_MAX_ROWS = 7;
|
|
13
|
+
export declare const FILE_MAX_SIZE_BYTES: number;
|
|
14
|
+
export declare const SUPPORT_FILE_EXTENSIONS: string[];
|
|
15
|
+
export declare const SUPPORT_FILE_MIME_TYPES: string[];
|
|
16
|
+
export declare const getSupportAttachmentKind: (file: File) => ISupportLayoutAttachment['kind'];
|
|
17
|
+
export declare const isSupportFileTypeAllowed: (file: File) => boolean;
|
|
18
|
+
/** Как в старом Support: `/account/bank-ideas` в новой вкладке. */
|
|
19
|
+
export declare const BANK_IDEAS_PATH = "/account/bank-ideas";
|
|
20
|
+
export declare const BANK_IDEAS_FALLBACK_ORIGIN = "https://profinansy.ru";
|
|
21
|
+
export declare const FILE_NOTICE_MS = 4000;
|
|
22
|
+
export declare const getBankIdeasUrl: (hostname?: string) => string;
|
|
23
|
+
export declare const getSupportLoginUrl: (authHostname?: string, project?: TProject) => string;
|
|
24
|
+
/** Страница GET /chat; дальше — skip при скролле вверх. */
|
|
25
|
+
export declare const CHAT_HISTORY_PAGE_SIZE = 100;
|
|
26
|
+
/** Hover FAB из Figma; в палитре токена нет. */
|
|
27
|
+
export declare const FAB_HOVER_BACKGROUND = "#7B6AFF";
|
|
28
|
+
export declare const URL_IN_TEXT_REGEXP: RegExp;
|
|
29
|
+
/** Макетный снимок для сторис вложений (не иконка). */
|
|
30
|
+
export declare const LAYOUT_PHOTO_URL = "https://picsum.photos/id/1015/572/572";
|
|
31
|
+
export declare const isTodayDateLabel: (label: string) => boolean;
|
|
32
|
+
export declare const EMOJI_LIST: string[];
|
|
33
|
+
export declare const LAYOUT_ROOT_CHIPS: ISupportLayoutChip[];
|
|
34
|
+
export declare const LAYOUT_FOLLOW_CHIPS: ISupportLayoutChip[];
|
|
35
|
+
export declare const LAYOUT_GREETING_MESSAGE: ISupportLayoutMessage;
|
|
36
|
+
export declare const LAYOUT_ASSISTANT_HELLO: ISupportLayoutMessage;
|
|
37
|
+
export declare const LAYOUT_PENDING_PHOTO: ISupportLayoutAttachment;
|
|
38
|
+
export declare const LAYOUT_CHIPS_MESSAGES: ISupportLayoutMessage[];
|
|
39
|
+
export declare const LAYOUT_UNREAD_MESSAGES: ISupportLayoutMessage[];
|
|
40
|
+
export declare const LAYOUT_LINK_MESSAGES: ISupportLayoutMessage[];
|
|
41
|
+
export declare const LAYOUT_ATTACH_MESSAGES: ISupportLayoutMessage[];
|
|
42
|
+
export declare const LAYOUT_MOCK_MESSAGES: ISupportLayoutMessage[];
|
|
43
|
+
export declare const getLayoutMessages: (preset?: TSupportLayoutPreset) => ISupportLayoutMessage[];
|
|
44
|
+
export declare const capitalizeFirst: (value: string) => string;
|
|
45
|
+
export declare const midEllipsis: (name: string, max?: number) => string;
|
|
46
|
+
export declare const extractUrl: (text: string) => string;
|
|
47
|
+
export declare const hasSupportChatQuery: (pathname?: string) => boolean;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ISupport } from './SupportV2.typed';
|
|
2
|
+
declare const SupportV2: ({ isWithoutBottom, fabOffset, defaultOpen, token, onNeedAuth, onFetchLinkPreview, showUnreadBadge, unreadCount, previewPreset }: ISupport) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export { SupportV2 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ISupportFabOffset } from './SupportV2.typed';
|
|
3
|
+
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
|
+
$isWithoutBottom: boolean;
|
|
5
|
+
$isOpen: boolean;
|
|
6
|
+
$fabOffset?: ISupportFabOffset;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export declare const Overlay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
9
|
+
export declare const MobileClose: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
10
|
+
export declare const Button: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
11
|
+
$mode: string;
|
|
12
|
+
$isOpen: boolean;
|
|
13
|
+
}>> & string;
|
|
14
|
+
export declare const UnreadBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
15
|
+
export declare const Popup: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
16
|
+
$mode: string;
|
|
17
|
+
$isOpen: boolean;
|
|
18
|
+
}>> & string;
|
|
19
|
+
export declare const Notice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** Пейлоад опционального переопределения перехода на авторизацию. */
|
|
2
|
+
export interface ISupportNeedAuthPayload {
|
|
3
|
+
returnQuery: string;
|
|
4
|
+
}
|
|
5
|
+
/** Контакты гостя, отправляемые первым сообщением в чат. */
|
|
6
|
+
export interface ISupportGuestIdentifyPayload {
|
|
7
|
+
email: string;
|
|
8
|
+
phone: string;
|
|
9
|
+
}
|
|
10
|
+
/** Метаданные превью ссылки. */
|
|
11
|
+
export interface ISupportLinkPreview {
|
|
12
|
+
url: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
image?: string;
|
|
16
|
+
hostname?: string;
|
|
17
|
+
}
|
|
18
|
+
export type TSupportLayoutPreset = 'overview' | 'empty' | 'loadError' | 'chips' | 'unread' | 'link' | 'attach';
|
|
19
|
+
export interface ISupportFabOffset {
|
|
20
|
+
/** Отступ справа на всех разрешениях, px. */
|
|
21
|
+
right?: number;
|
|
22
|
+
/** Отступ снизу шире tablet breakpoint, px. */
|
|
23
|
+
desktopBottom?: number;
|
|
24
|
+
/** Отступ снизу на tablet/mobile, px. */
|
|
25
|
+
mobileBottom?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ISupport {
|
|
28
|
+
/**
|
|
29
|
+
* На узком экране не поднимать кнопку над нижней навигацией.
|
|
30
|
+
*/
|
|
31
|
+
isWithoutBottom?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Переопределение позиции FAB для конкретного проекта.
|
|
34
|
+
* Непереданные значения сохраняют стандартные отступы компонента.
|
|
35
|
+
*/
|
|
36
|
+
fabOffset?: ISupportFabOffset;
|
|
37
|
+
/**
|
|
38
|
+
* Сразу открыть панель чата (хост или Storybook).
|
|
39
|
+
*/
|
|
40
|
+
defaultOpen?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* JWT support-api. Если нет — берётся токен пользовательской сессии
|
|
43
|
+
* из `user.token` в конфиге.
|
|
44
|
+
*/
|
|
45
|
+
token?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Опционально переопределить встроенный переход на `/login`.
|
|
48
|
+
* Без колбэка после входа пользователь вернётся на `/?supportChat=1`.
|
|
49
|
+
*/
|
|
50
|
+
onNeedAuth?: (payload: ISupportNeedAuthPayload) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Подтянуть OG-превью URL. Без колбэка — карточка с hostname.
|
|
53
|
+
*/
|
|
54
|
+
onFetchLinkPreview?: (url: string) => Promise<ISupportLinkPreview | null>;
|
|
55
|
+
/**
|
|
56
|
+
* Бейдж непрочитанных на FAB. По умолчанию скрыт.
|
|
57
|
+
*/
|
|
58
|
+
showUnreadBadge?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Число для бейджа, если хост задаёт его сам. В live-режиме берётся с API.
|
|
61
|
+
*/
|
|
62
|
+
unreadCount?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Пресет вёрстки под секцию Figma. Только Storybook; без него при токене
|
|
65
|
+
* идёт живой API.
|
|
66
|
+
*/
|
|
67
|
+
previewPreset?: TSupportLayoutPreset;
|
|
68
|
+
}
|
|
69
|
+
export type TSupportMessageRole = 'user' | 'bot' | 'operator' | 'system';
|
|
70
|
+
export type TSupportMessageStatus = 'sent' | 'failed' | 'uploading';
|
|
71
|
+
export type TSupportChipKind = 'tree' | 'qa' | 'menu' | 'back' | 'url' | 'operator' | 'onboarding';
|
|
72
|
+
export interface ISupportLayoutChip {
|
|
73
|
+
id: string;
|
|
74
|
+
label: string;
|
|
75
|
+
kind: TSupportChipKind;
|
|
76
|
+
nodeId?: number | null;
|
|
77
|
+
url?: string | null;
|
|
78
|
+
action?: string | null;
|
|
79
|
+
}
|
|
80
|
+
export interface ISupportLayoutAttachment {
|
|
81
|
+
kind: 'image' | 'document';
|
|
82
|
+
filename: string;
|
|
83
|
+
sizeLabel: string;
|
|
84
|
+
url?: string;
|
|
85
|
+
status?: 'uploading' | 'download' | 'open';
|
|
86
|
+
file?: File;
|
|
87
|
+
uploadedBytes?: number;
|
|
88
|
+
totalBytes?: number;
|
|
89
|
+
}
|
|
90
|
+
export interface ISupportLayoutMessage {
|
|
91
|
+
id: string;
|
|
92
|
+
role: TSupportMessageRole;
|
|
93
|
+
content: string;
|
|
94
|
+
time: string;
|
|
95
|
+
senderName?: string;
|
|
96
|
+
status?: TSupportMessageStatus;
|
|
97
|
+
attachments?: ISupportLayoutAttachment[];
|
|
98
|
+
linkPreview?: ISupportLinkPreview;
|
|
99
|
+
chips?: ISupportLayoutChip[];
|
|
100
|
+
unreadStart?: boolean;
|
|
101
|
+
showNps?: boolean;
|
|
102
|
+
npsTitle?: string;
|
|
103
|
+
dateLabel?: string;
|
|
104
|
+
dayKey?: string;
|
|
105
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ISupportLayoutAttachment } from '../SupportV2.typed';
|
|
2
|
+
interface IAttachSheet {
|
|
3
|
+
title: string;
|
|
4
|
+
photoLabel: string;
|
|
5
|
+
fileLabel: string;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onPick: (attachment: ISupportLayoutAttachment) => void;
|
|
8
|
+
onFileRejected?: (reason: 'too-large' | 'unsupported-type') => void;
|
|
9
|
+
}
|
|
10
|
+
declare const AttachSheet: ({ title, photoLabel, fileLabel, onClose, onPick, onFileRejected }: IAttachSheet) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { AttachSheet };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ISupportLayoutChip, ISupportLayoutMessage } from '../SupportV2.typed';
|
|
2
|
+
interface IChatFeed {
|
|
3
|
+
messages: ISupportLayoutMessage[];
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
jumpLabel: string;
|
|
6
|
+
hasMore?: boolean;
|
|
7
|
+
isLoadingOlder?: boolean;
|
|
8
|
+
labels: {
|
|
9
|
+
retry: string;
|
|
10
|
+
delete: string;
|
|
11
|
+
cancelUpload: string;
|
|
12
|
+
rateTitle: string;
|
|
13
|
+
download: string;
|
|
14
|
+
open: string;
|
|
15
|
+
newMessages: string;
|
|
16
|
+
botName: string;
|
|
17
|
+
operatorName: string;
|
|
18
|
+
copyLink: string;
|
|
19
|
+
close: string;
|
|
20
|
+
};
|
|
21
|
+
onRetry: (id: string) => void;
|
|
22
|
+
onDelete: (id: string) => void;
|
|
23
|
+
onChip: (chip: ISupportLayoutChip) => void;
|
|
24
|
+
onRate: (rating: number) => void;
|
|
25
|
+
onLoadOlder?: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare const ChatFeed: ({ messages, isActive, jumpLabel, hasMore, isLoadingOlder, labels, onRetry, onDelete, onChip, onRate, onLoadOlder }: IChatFeed) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export { ChatFeed };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type TSupportHeaderStatus = 'online' | 'loading' | 'typing';
|
|
2
|
+
interface IChatHeader {
|
|
3
|
+
title: string;
|
|
4
|
+
bankLabel: string;
|
|
5
|
+
subtitle: string;
|
|
6
|
+
status: TSupportHeaderStatus;
|
|
7
|
+
closeLabel: string;
|
|
8
|
+
showMenu?: boolean;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onOpenBank: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const ChatHeader: ({ title, bankLabel, subtitle, status, closeLabel, showMenu, onClose, onOpenBank }: IChatHeader) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { ChatHeader };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ISupportLayoutChip } from '../SupportV2.typed';
|
|
2
|
+
interface ICommandChips {
|
|
3
|
+
chips: ISupportLayoutChip[];
|
|
4
|
+
onSelect: (chip: ISupportLayoutChip) => void;
|
|
5
|
+
center?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const CommandChips: ({ chips, onSelect, center }: ICommandChips) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { CommandChips };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ISupportLinkPreview, ISupportLayoutAttachment } from '../SupportV2.typed';
|
|
2
|
+
interface IComposer {
|
|
3
|
+
placeholder: string;
|
|
4
|
+
sendLabel: string;
|
|
5
|
+
attachLabel: string;
|
|
6
|
+
draftKey?: string;
|
|
7
|
+
seedText?: string;
|
|
8
|
+
pendingAttachment?: ISupportLayoutAttachment | null;
|
|
9
|
+
onClearAttachment?: () => void;
|
|
10
|
+
onSend: (payload: {
|
|
11
|
+
text: string;
|
|
12
|
+
attachment?: ISupportLayoutAttachment;
|
|
13
|
+
linkPreview?: ISupportLinkPreview | null;
|
|
14
|
+
}) => void;
|
|
15
|
+
onFetchLinkPreview?: (url: string) => Promise<ISupportLinkPreview | null>;
|
|
16
|
+
onOpenAttach: () => void;
|
|
17
|
+
onPickAttachment?: (attachment: ISupportLayoutAttachment) => void;
|
|
18
|
+
onFileRejected?: (reason: 'too-large' | 'unsupported-type') => void;
|
|
19
|
+
}
|
|
20
|
+
declare const Composer: ({ placeholder, sendLabel, attachLabel, draftKey, seedText, pendingAttachment, onClearAttachment, onSend, onFetchLinkPreview, onOpenAttach, onPickAttachment, onFileRejected }: IComposer) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export { Composer };
|
|
22
|
+
export declare const readLocalFile: (file: File, kind: 'image' | 'document') => ISupportLayoutAttachment | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ISupportGuestIdentifyPayload } from '../SupportV2.typed';
|
|
2
|
+
interface IGuestGate {
|
|
3
|
+
question: string;
|
|
4
|
+
yesLabel: string;
|
|
5
|
+
noLabel: string;
|
|
6
|
+
hasAccountDescription: string;
|
|
7
|
+
contactsDescription: string;
|
|
8
|
+
authLabel: string;
|
|
9
|
+
emailLabel: string;
|
|
10
|
+
phoneLabel: string;
|
|
11
|
+
continueLabel: string;
|
|
12
|
+
invalidLabel: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
onHasAccount: () => void;
|
|
15
|
+
onIdentify: (payload: ISupportGuestIdentifyPayload) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const GuestGate: ({ question, yesLabel, noLabel, hasAccountDescription, contactsDescription, authLabel, emailLabel, phoneLabel, continueLabel, invalidLabel, error, onHasAccount, onIdentify }: IGuestGate) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { GuestGate };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ISupportLinkPreview } from '../SupportV2.typed';
|
|
2
|
+
interface ILinkPreviewCard {
|
|
3
|
+
preview: ISupportLinkPreview;
|
|
4
|
+
onDismiss?: () => void;
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
copyLabel?: string;
|
|
7
|
+
mine?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const LinkPreviewCard: ({ preview, onDismiss, compact, copyLabel, mine }: ILinkPreviewCard) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { LinkPreviewCard };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ISupportLayoutChip, ISupportLayoutMessage } from '../SupportV2.typed';
|
|
2
|
+
interface IMessageBubble {
|
|
3
|
+
message: ISupportLayoutMessage;
|
|
4
|
+
labels: {
|
|
5
|
+
retry: string;
|
|
6
|
+
delete: string;
|
|
7
|
+
cancelUpload: string;
|
|
8
|
+
rateTitle: string;
|
|
9
|
+
download: string;
|
|
10
|
+
open: string;
|
|
11
|
+
newMessages: string;
|
|
12
|
+
botName: string;
|
|
13
|
+
operatorName: string;
|
|
14
|
+
copyLink: string;
|
|
15
|
+
close: string;
|
|
16
|
+
};
|
|
17
|
+
onRetry: (id: string) => void;
|
|
18
|
+
onDelete: (id: string) => void;
|
|
19
|
+
onChip: (chip: ISupportLayoutChip) => void;
|
|
20
|
+
onRate: (rating: number) => void;
|
|
21
|
+
}
|
|
22
|
+
declare const MessageBubble: ({ message, labels, onRetry, onDelete, onChip, onRate }: IMessageBubble) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export { MessageBubble };
|