@aslaluroba/help-center-react 3.0.3 → 3.0.5
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 +28 -33
- package/dist/components/shared/Button/button.d.ts +1 -2
- package/dist/components/ui/agent-response/agent-response.d.ts +1 -2
- package/dist/components/ui/header.d.ts +1 -2
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.js +36039 -11175
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +35997 -11135
- package/dist/index.js.map +1 -1
- package/dist/ui/chatbot-popup/chat-window-screen/footer.d.ts +0 -2
- package/dist/ui/chatbot-popup/chat-window-screen/header.d.ts +1 -1
- package/dist/ui/chatbot-popup/chat-window-screen/index.d.ts +1 -1
- package/dist/ui/chatbot-popup/error-screen/index.d.ts +0 -1
- package/dist/ui/chatbot-popup/home-screen/card.d.ts +0 -1
- package/dist/ui/chatbot-popup/home-screen/chat-now-card.d.ts +0 -1
- package/dist/ui/chatbot-popup/home-screen/index.d.ts +0 -1
- package/dist/ui/chatbot-popup/loading-screen/index.d.ts +0 -1
- package/dist/ui/chatbot-popup/options-list-screen/expanded-option.d.ts +0 -1
- package/dist/ui/chatbot-popup/options-list-screen/header.d.ts +0 -1
- package/dist/ui/chatbot-popup/options-list-screen/index.d.ts +0 -1
- package/dist/ui/chatbot-popup/options-list-screen/option-card.d.ts +0 -1
- package/dist/ui/confirmation-modal/index.d.ts +1 -2
- package/dist/ui/floating-message.d.ts +1 -2
- package/dist/ui/help-button.d.ts +1 -2
- package/dist/ui/help-center.d.ts +1 -2
- package/dist/ui/help-popup.d.ts +1 -2
- package/dist/ui/review-dialog/index.d.ts +0 -1
- package/package.json +25 -25
- package/src/components/shared/Button/button.tsx +0 -1
- package/src/components/ui/agent-response/agent-response.tsx +0 -1
- package/src/components/ui/header.tsx +0 -1
- package/src/globals.css +1 -1
- package/src/index.ts +1 -3
- package/src/types/svg.d.ts +4 -4
- package/src/ui/chatbot-popup/chat-window-screen/footer.tsx +1 -3
- package/src/ui/chatbot-popup/chat-window-screen/header.tsx +42 -26
- package/src/ui/chatbot-popup/chat-window-screen/index.tsx +96 -99
- package/src/ui/chatbot-popup/error-screen/index.tsx +0 -1
- package/src/ui/chatbot-popup/home-screen/card.tsx +25 -25
- package/src/ui/chatbot-popup/home-screen/chat-now-card.tsx +0 -2
- package/src/ui/chatbot-popup/home-screen/index.tsx +0 -1
- package/src/ui/chatbot-popup/loading-screen/index.tsx +0 -2
- package/src/ui/chatbot-popup/options-list-screen/expanded-option.tsx +0 -1
- package/src/ui/chatbot-popup/options-list-screen/header.tsx +14 -12
- package/src/ui/chatbot-popup/options-list-screen/index.tsx +0 -1
- package/src/ui/chatbot-popup/options-list-screen/option-card.tsx +26 -19
- package/src/ui/confirmation-modal/index.tsx +0 -1
- package/src/ui/floating-message.tsx +0 -1
- package/src/ui/help-button.tsx +0 -1
- package/src/ui/help-center.tsx +29 -67
- package/src/ui/help-popup.tsx +4 -4
- package/src/ui/review-dialog/index.tsx +4 -4
- package/src/useLocalTranslation.ts +5 -5
- package/tsconfig.json +19 -8
- package/src/.DS_Store +0 -0
- package/src/styles/tailwind.css +0 -4
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
import { Button } from '@/components/shared';
|
|
4
2
|
import ArrowRight from '../../../assets/icons/arrowRight.svg';
|
|
5
3
|
import { useLocalTranslation } from '../../../useLocalTranslation'
|
|
6
4
|
|
|
7
5
|
interface CardProps {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
text: string;
|
|
7
|
+
handleClick: () => void;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
const Card: React.FC<CardProps> = (props) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
11
|
+
const { dir } = useLocalTranslation();
|
|
12
|
+
const isLTR = dir === "ltr";
|
|
13
|
+
return (
|
|
14
|
+
<div className="babylai-flex babylai-items-center babylai-justify-between babylai-gap-4 babylai-bg-black-white-50 babylai-rounded-3xl babylai-p-6">
|
|
15
|
+
<p className="babylai-text-base md:babylai-text-lg babylai-font-medium babylai-text-black-white-800">
|
|
16
|
+
{props.text}
|
|
17
|
+
</p>
|
|
18
|
+
<Button
|
|
19
|
+
variant="rounded-icon"
|
|
20
|
+
size="icon"
|
|
21
|
+
className="babylai-bg-primary-500 babylai-text-black-white-50 hover:babylai-bg-primary-600 md:!babylai-w-10 md:!babylai-h-10"
|
|
22
|
+
onClick={() => props.handleClick()}
|
|
23
|
+
>
|
|
24
|
+
<ArrowRight
|
|
25
|
+
className={`babylai-w-4 babylai-h-4 ${
|
|
26
|
+
isLTR ? "" : "babylai-rotate-180"
|
|
27
|
+
}`}
|
|
28
|
+
/>
|
|
29
|
+
</Button>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
33
|
|
|
34
|
-
export default Card
|
|
34
|
+
export default Card;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Header } from '@/components/ui/header'
|
|
2
2
|
import Card from '@/ui/chatbot-popup/home-screen/card'
|
|
3
3
|
import ChatNowCard from '@/ui/chatbot-popup/home-screen/chat-now-card'
|
|
4
|
-
import React from 'react'
|
|
5
4
|
import { useLocalTranslation } from '../../../useLocalTranslation'
|
|
6
5
|
|
|
7
6
|
interface HomeScreenProps {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Button } from '@/components';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import ArrowRight from './../../../assets/icons/arrowRight.svg';
|
|
4
3
|
import ThinkingLogo from './../../../assets/thinking-logo.svg';
|
|
5
4
|
import { useLocalTranslation } from '../../../useLocalTranslation';
|
|
@@ -10,32 +9,35 @@ interface OptionsListHeaderProps {
|
|
|
10
9
|
showHelpScreen: boolean;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
const OptionsListHeader: React.FC<OptionsListHeaderProps> = ({
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const OptionsListHeader: React.FC<OptionsListHeaderProps> = ({
|
|
13
|
+
handleBack,
|
|
14
|
+
showHelpScreen,
|
|
15
|
+
}) => {
|
|
16
|
+
const { dir } = useLocalTranslation();
|
|
17
|
+
const isRTL = dir === "rtl";
|
|
16
18
|
|
|
17
19
|
return (
|
|
18
20
|
<header
|
|
19
|
-
dir={
|
|
21
|
+
dir={dir}
|
|
20
22
|
className={`babylai-flex babylai-w-full babylai-items-center mb-2 ${
|
|
21
|
-
!showHelpScreen ?
|
|
23
|
+
!showHelpScreen ? "babylai-justify-end" : "babylai-justify-between"
|
|
22
24
|
}`}
|
|
23
25
|
>
|
|
24
26
|
<Button
|
|
25
|
-
variant=
|
|
26
|
-
size=
|
|
27
|
-
className=
|
|
27
|
+
variant="rounded-icon"
|
|
28
|
+
size="icon"
|
|
29
|
+
className="!babylai-w-12 !babylai-h-12 babylai-bg-black-white-50 dark:babylai-bg-storm-dust-900 babylai-relative babylai-z-10"
|
|
28
30
|
onClick={handleBack}
|
|
29
31
|
>
|
|
30
32
|
{showHelpScreen ? (
|
|
31
33
|
<ArrowRight
|
|
32
|
-
className={`${isRTL ?
|
|
34
|
+
className={`${isRTL ? "" : "babylai-rotate-180"} babylai-text-primary-500 babylai-w-full babylai-h-full`}
|
|
33
35
|
/>
|
|
34
36
|
) : (
|
|
35
|
-
<CloseCircle className=
|
|
37
|
+
<CloseCircle className="!babylai-w-full !babylai-h-full babylai-cursor-pointer" />
|
|
36
38
|
)}
|
|
37
39
|
</Button>
|
|
38
|
-
<ThinkingLogo className=
|
|
40
|
+
<ThinkingLogo className="babylai-w-40 babylai-h-40 babylai-text-primary-500 babylai-absolute babylai-top-0 babylai-end-1 babylai-overflow-hidden" />
|
|
39
41
|
</header>
|
|
40
42
|
);
|
|
41
43
|
};
|
|
@@ -3,7 +3,6 @@ import { HelpScreenData, Option } from '@/lib/types';
|
|
|
3
3
|
import ExpandedOption from '@/ui/chatbot-popup/options-list-screen/expanded-option';
|
|
4
4
|
import OptionsListHeader from '@/ui/chatbot-popup/options-list-screen/header';
|
|
5
5
|
import OptionCard from '@/ui/chatbot-popup/options-list-screen/option-card';
|
|
6
|
-
import React from 'react';
|
|
7
6
|
|
|
8
7
|
interface OptionsListScreenProps {
|
|
9
8
|
helpScreen: HelpScreenData | null;
|
|
@@ -1,25 +1,32 @@
|
|
|
1
|
-
import { Button } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useTranslation } from 'react-i18next'
|
|
1
|
+
import { Button } from "@/components";
|
|
2
|
+
import ArrowRight from "../../../assets/icons/arrowRight.svg";
|
|
3
|
+
import { useLocalTranslation } from "@/useLocalTranslation";
|
|
5
4
|
|
|
6
5
|
interface OptionCardProps {
|
|
7
|
-
|
|
6
|
+
title: string;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
const OptionCard: React.FC<OptionCardProps> = (props) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
const i18n = useLocalTranslation();
|
|
11
|
+
const isLTR = i18n.dir == "ltr";
|
|
12
|
+
return (
|
|
13
|
+
<div className="babylai-flex babylai-items-center babylai-justify-between babylai-p-2">
|
|
14
|
+
<p className="babylai-text-sm babylai-font-medium babylai-text-black-white-800 dark:babylai-text-white">
|
|
15
|
+
{props.title}
|
|
16
|
+
</p>
|
|
17
|
+
<Button
|
|
18
|
+
variant="rounded-icon"
|
|
19
|
+
size="icon"
|
|
20
|
+
className="babylai-text-primary-500 hover:babylai-bg-primary-100"
|
|
21
|
+
>
|
|
22
|
+
<ArrowRight
|
|
23
|
+
className={`babylai-w-[12px] babylai-h-[12px] ${
|
|
24
|
+
isLTR ? "" : "babylai-rotate-180"
|
|
25
|
+
} babylai-text-primary-500`}
|
|
26
|
+
/>
|
|
27
|
+
</Button>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
24
31
|
|
|
25
|
-
export default OptionCard
|
|
32
|
+
export default OptionCard;
|
package/src/ui/help-button.tsx
CHANGED
package/src/ui/help-center.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ReviewDialog from '@/ui/review-dialog';
|
|
2
|
-
import
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
3
|
import { apiRequest } from '../core/api';
|
|
4
4
|
import { ClientAblyService } from '../core/AblyService';
|
|
5
5
|
import { useLocalTranslation } from '../useLocalTranslation';
|
|
@@ -98,7 +98,6 @@ export function HelpCenter({
|
|
|
98
98
|
setMessages([]);
|
|
99
99
|
|
|
100
100
|
setIsReviewDialogOpen(true);
|
|
101
|
-
|
|
102
101
|
} catch (error) {
|
|
103
102
|
console.error('Error ending chat:', error);
|
|
104
103
|
setError('Failed to end chat session');
|
|
@@ -119,7 +118,7 @@ export function HelpCenter({
|
|
|
119
118
|
const response = await apiRequest(`Client/ClientChatSession/${reviewSessionId}/review`, 'POST', payload);
|
|
120
119
|
if (!response.ok) throw new Error('Failed to send chat review');
|
|
121
120
|
|
|
122
|
-
handleCloseChatReview()
|
|
121
|
+
handleCloseChatReview();
|
|
123
122
|
} catch (error) {
|
|
124
123
|
console.error('Error sending chat review:', error);
|
|
125
124
|
setError('Failed to send chat review');
|
|
@@ -132,15 +131,23 @@ export function HelpCenter({
|
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
const handleStartChat = async (option: Option) => {
|
|
135
|
-
|
|
134
|
+
setMessages([
|
|
135
|
+
{
|
|
136
|
+
id: Date.now(),
|
|
137
|
+
senderType: 3,
|
|
138
|
+
messageContent: option?.assistant?.greeting || 'مرحباً! كيف يمكنني مساعدتك اليوم؟',
|
|
139
|
+
sentAt: new Date(),
|
|
140
|
+
isSeen: true,
|
|
141
|
+
},
|
|
142
|
+
]);
|
|
143
|
+
setIsChatClosed(false);
|
|
144
|
+
setStatus('succeeded');
|
|
136
145
|
};
|
|
137
146
|
|
|
138
|
-
const startNewChatSession = async (option: Option) => {
|
|
139
|
-
|
|
147
|
+
const startNewChatSession = async (option: Option): Promise<string> => {
|
|
140
148
|
try {
|
|
141
149
|
setStatus('loading');
|
|
142
150
|
setError('');
|
|
143
|
-
setMessages([]);
|
|
144
151
|
|
|
145
152
|
const chatSessionCreateDto = {
|
|
146
153
|
helpScreenId: helpScreenId,
|
|
@@ -161,32 +168,12 @@ export function HelpCenter({
|
|
|
161
168
|
}
|
|
162
169
|
|
|
163
170
|
const responseData = await response.json();
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
setMessages([
|
|
168
|
-
{
|
|
169
|
-
id: Date.now(),
|
|
170
|
-
senderType: 3,
|
|
171
|
-
messageContent: responseData.chatSession.assistant.greeting,
|
|
172
|
-
sentAt: new Date(),
|
|
173
|
-
isSeen: true,
|
|
174
|
-
},
|
|
175
|
-
]);
|
|
176
|
-
} else {
|
|
177
|
-
setMessages([
|
|
178
|
-
{
|
|
179
|
-
id: Date.now(),
|
|
180
|
-
senderType: 3,
|
|
181
|
-
messageContent: 'Hello! How can I assist you today?\nمرحباً! كيف يمكنني مساعدتك اليوم؟',
|
|
182
|
-
sentAt: new Date(),
|
|
183
|
-
isSeen: true,
|
|
184
|
-
},
|
|
185
|
-
]);
|
|
186
|
-
}
|
|
171
|
+
const newSessionId = responseData.chatSession.id;
|
|
172
|
+
|
|
173
|
+
setSessionId(newSessionId);
|
|
187
174
|
|
|
188
175
|
await ClientAblyService.startConnection(
|
|
189
|
-
|
|
176
|
+
newSessionId,
|
|
190
177
|
responseData.ablyToken,
|
|
191
178
|
handleReceiveMessage,
|
|
192
179
|
responseData.chatSession.tenantId
|
|
@@ -200,21 +187,16 @@ export function HelpCenter({
|
|
|
200
187
|
setIsAblyConnected(true);
|
|
201
188
|
setIsChatClosed(false);
|
|
202
189
|
setStatus('succeeded');
|
|
190
|
+
|
|
191
|
+
return newSessionId; // Return the session ID
|
|
203
192
|
} catch (error) {
|
|
204
193
|
setError(error instanceof Error ? error.message : 'Failed to start chat session');
|
|
205
194
|
setStatus('failed');
|
|
195
|
+
throw error; // Re-throw to handle in calling function
|
|
206
196
|
}
|
|
207
197
|
};
|
|
208
198
|
|
|
209
199
|
const handleSendMessage = async (message: string) => {
|
|
210
|
-
// Only send message if Ably is connected
|
|
211
|
-
if (!isAblyConnected) {
|
|
212
|
-
setError('Connection lost. Please try again.');
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
let currentSessionId = sessionId;
|
|
217
|
-
|
|
218
200
|
if (message.trim() !== '') {
|
|
219
201
|
try {
|
|
220
202
|
setAssistantStatus('typing');
|
|
@@ -229,35 +211,15 @@ export function HelpCenter({
|
|
|
229
211
|
|
|
230
212
|
setMessages((prevMessages) => [...prevMessages, userMessage]);
|
|
231
213
|
|
|
214
|
+
// Handle session creation if needed
|
|
215
|
+
let currentSessionId = sessionId;
|
|
216
|
+
|
|
217
|
+
if (!isAblyConnected && selectedOption) {
|
|
218
|
+
currentSessionId = await startNewChatSession(selectedOption);
|
|
219
|
+
}
|
|
220
|
+
|
|
232
221
|
if (!currentSessionId) {
|
|
233
|
-
|
|
234
|
-
helpScreenId: helpScreenId,
|
|
235
|
-
optionId: selectedOption?.id,
|
|
236
|
-
user: {
|
|
237
|
-
id: user?.id,
|
|
238
|
-
name: user?.name,
|
|
239
|
-
email: user?.email,
|
|
240
|
-
},
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
const response = await apiRequest('Client/ClientChatSession/create-session', 'POST', chatSessionCreateDto);
|
|
244
|
-
|
|
245
|
-
if (!response.ok) {
|
|
246
|
-
throw new Error('Failed to create chat session');
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
const responseData = await response.json();
|
|
250
|
-
setSessionId(responseData.chatSession.id);
|
|
251
|
-
currentSessionId = responseData.chatSession.id;
|
|
252
|
-
|
|
253
|
-
await ClientAblyService.startConnection(
|
|
254
|
-
responseData.chatSession.id,
|
|
255
|
-
responseData.ablyToken,
|
|
256
|
-
handleReceiveMessage,
|
|
257
|
-
responseData.chatSession.tenantId
|
|
258
|
-
);
|
|
259
|
-
|
|
260
|
-
setIsAblyConnected(true);
|
|
222
|
+
throw new Error('No active session available');
|
|
261
223
|
}
|
|
262
224
|
|
|
263
225
|
const messageDto = { messageContent: message };
|
package/src/ui/help-popup.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import ChatBotErrorScreen from '@/ui/chatbot-popup/error-screen';
|
|
|
5
5
|
import HomeScreen from '@/ui/chatbot-popup/home-screen';
|
|
6
6
|
import ChatBotLoadingScreen from '@/ui/chatbot-popup/loading-screen';
|
|
7
7
|
import OptionsListScreen from '@/ui/chatbot-popup/options-list-screen';
|
|
8
|
-
import
|
|
8
|
+
import { useEffect, useRef, useState, useCallback, useMemo } from 'react';
|
|
9
9
|
import ChatIcon from '../assets/icons/chat.svg';
|
|
10
10
|
import { Button } from '@/components';
|
|
11
11
|
import { HelpScreenData, Message, Option } from '@/lib/types';
|
|
@@ -110,11 +110,11 @@ export function HelpPopup({
|
|
|
110
110
|
|
|
111
111
|
const handleSendMessage = useCallback(
|
|
112
112
|
(message: string) => {
|
|
113
|
-
if (message.trim()
|
|
113
|
+
if (message.trim()) {
|
|
114
114
|
onSendMessage(message.trim());
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
|
-
[onSendMessage
|
|
117
|
+
[onSendMessage]
|
|
118
118
|
);
|
|
119
119
|
|
|
120
120
|
const hideEndChatConfirmation = useCallback(() => {
|
|
@@ -133,7 +133,7 @@ export function HelpPopup({
|
|
|
133
133
|
})
|
|
134
134
|
.finally(() => {
|
|
135
135
|
setTempSelectedOption(null);
|
|
136
|
-
})
|
|
136
|
+
});
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
139
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReviewProps } from '@/lib/types'
|
|
2
2
|
import { Rating } from '@/ui/review-dialog/rating'
|
|
3
|
-
import React from 'react'
|
|
4
3
|
import { useLocalTranslation } from '../../useLocalTranslation'
|
|
5
4
|
import CloseCircle from '../../assets/icons/closeCircle.svg'
|
|
5
|
+
import { useState } from 'react';
|
|
6
6
|
|
|
7
7
|
interface ReviewDialogProps {
|
|
8
8
|
handleSubmit: ({ comment, rating }: ReviewProps) => void;
|
|
@@ -11,9 +11,9 @@ interface ReviewDialogProps {
|
|
|
11
11
|
|
|
12
12
|
const ReviewDialog: React.FC<ReviewDialogProps> = (props) => {
|
|
13
13
|
const { t } = useLocalTranslation()
|
|
14
|
-
const [comment, setComment] =
|
|
15
|
-
const [rating, setRating] =
|
|
16
|
-
const [error, setError] =
|
|
14
|
+
const [comment, setComment] = useState<string>('')
|
|
15
|
+
const [rating, setRating] = useState<number>(0)
|
|
16
|
+
const [error, setError] = useState<{ comment?: string; rating?: string }>({})
|
|
17
17
|
|
|
18
18
|
const isCommentValid = comment.length >= 10 && comment.length <= 500
|
|
19
19
|
const isRatingValid = rating >= 1 && rating <= 5
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { createHelpCenterI18n } from './i18n';
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { createHelpCenterI18n } from "./i18n";
|
|
4
3
|
|
|
5
4
|
export const useLocalTranslation = (languageFromProps?: string) => {
|
|
6
|
-
const language =
|
|
5
|
+
const language =
|
|
6
|
+
languageFromProps || localStorage.getItem("app-language") || "en";
|
|
7
7
|
|
|
8
8
|
const i18n = useMemo(() => createHelpCenterI18n(language), [language]);
|
|
9
9
|
|
|
10
10
|
const t = (key: string) => i18n.t(key);
|
|
11
11
|
const dir = i18n.dir();
|
|
12
12
|
|
|
13
|
-
return { t, dir
|
|
13
|
+
return { t, dir, i18n };
|
|
14
14
|
};
|
package/tsconfig.json
CHANGED
|
@@ -22,23 +22,34 @@
|
|
|
22
22
|
"noUnusedParameters": true,
|
|
23
23
|
"noImplicitReturns": true,
|
|
24
24
|
"noFallthroughCasesInSwitch": true,
|
|
25
|
-
"moduleResolution": "
|
|
26
|
-
"jsx": "react",
|
|
25
|
+
"moduleResolution": "bundler",
|
|
26
|
+
"jsx": "react-jsx",
|
|
27
27
|
"resolveJsonModule": true,
|
|
28
28
|
"esModuleInterop": true,
|
|
29
29
|
"skipLibCheck": true,
|
|
30
30
|
"forceConsistentCasingInFileNames": true,
|
|
31
31
|
"baseUrl": ".",
|
|
32
|
-
|
|
33
|
-
"@/*": [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@/
|
|
37
|
-
|
|
32
|
+
"paths": {
|
|
33
|
+
"@/*": [
|
|
34
|
+
"src/*"
|
|
35
|
+
],
|
|
36
|
+
"@/components/*": [
|
|
37
|
+
"src/components/*"
|
|
38
|
+
],
|
|
39
|
+
"@/ui/*": [
|
|
40
|
+
"src/ui/*"
|
|
41
|
+
],
|
|
42
|
+
"@/lib/*": [
|
|
43
|
+
"src/lib/*"
|
|
44
|
+
],
|
|
45
|
+
"@/assets/*": [
|
|
46
|
+
"src/assets/*"
|
|
47
|
+
]
|
|
38
48
|
},
|
|
39
49
|
},
|
|
40
50
|
"include": [
|
|
41
51
|
"src",
|
|
52
|
+
"src/types",
|
|
42
53
|
"assets"
|
|
43
54
|
],
|
|
44
55
|
"exclude": [
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/styles/tailwind.css
DELETED