wcz-test 6.6.0 → 6.7.1
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/client-utils.d.ts +30 -33
- package/dist/client-utils.js +1 -6
- package/dist/client-utils.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +57 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/client-utils.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export { P as Platform } from './utils-ChipkRJ9.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { default as LanguageDetector } from 'i18next-browser-languagedetector';
|
|
2
|
+
export { t } from 'i18next';
|
|
3
|
+
export { useTranslation } from 'react-i18next';
|
|
5
4
|
import * as nanostores from 'nanostores';
|
|
6
|
-
import * as node_modules_better_auth_dist_index_BzgT8cQd_d_mts from 'node_modules/better-auth/dist/index-BzgT8cQd.d.mts';
|
|
7
|
-
import * as _better_auth_core_oauth2 from '@better-auth/core/oauth2';
|
|
8
5
|
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
9
6
|
import * as node_modules_better_auth_dist_helper_DU33OcfW_d_mts from 'node_modules/better-auth/dist/helper-DU33OcfW.d.mts';
|
|
10
|
-
import * as
|
|
7
|
+
import * as better_auth from 'better-auth';
|
|
11
8
|
import 'axios';
|
|
12
9
|
import 'uuidv7';
|
|
13
10
|
import '@t3-oss/env-core';
|
|
@@ -17,7 +14,7 @@ declare const WISTRON_SECONDARY_COLOR = "#64DC00";
|
|
|
17
14
|
|
|
18
15
|
declare const authClient: {
|
|
19
16
|
signIn: {
|
|
20
|
-
social: <FetchOptions extends
|
|
17
|
+
social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
21
18
|
provider: unknown;
|
|
22
19
|
callbackURL?: string | undefined;
|
|
23
20
|
newUserCallbackURL?: string | undefined;
|
|
@@ -75,7 +72,7 @@ declare const authClient: {
|
|
|
75
72
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
76
73
|
};
|
|
77
74
|
} & {
|
|
78
|
-
signOut: <FetchOptions extends
|
|
75
|
+
signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
79
76
|
query?: Record<string, any> | undefined;
|
|
80
77
|
fetchOptions?: FetchOptions | undefined;
|
|
81
78
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
@@ -86,7 +83,7 @@ declare const authClient: {
|
|
|
86
83
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
87
84
|
} & {
|
|
88
85
|
signUp: {
|
|
89
|
-
email: <FetchOptions extends
|
|
86
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
90
87
|
name: string;
|
|
91
88
|
email: string;
|
|
92
89
|
password: string;
|
|
@@ -129,7 +126,7 @@ declare const authClient: {
|
|
|
129
126
|
};
|
|
130
127
|
} & {
|
|
131
128
|
signIn: {
|
|
132
|
-
email: <FetchOptions extends
|
|
129
|
+
email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
133
130
|
email: string;
|
|
134
131
|
password: string;
|
|
135
132
|
callbackURL?: string | undefined;
|
|
@@ -160,7 +157,7 @@ declare const authClient: {
|
|
|
160
157
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
161
158
|
};
|
|
162
159
|
} & {
|
|
163
|
-
resetPassword: <FetchOptions extends
|
|
160
|
+
resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
164
161
|
newPassword: string;
|
|
165
162
|
token?: string | undefined;
|
|
166
163
|
}> & Record<string, any>, Partial<{
|
|
@@ -177,7 +174,7 @@ declare const authClient: {
|
|
|
177
174
|
message?: string | undefined;
|
|
178
175
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
179
176
|
} & {
|
|
180
|
-
verifyEmail: <FetchOptions extends
|
|
177
|
+
verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
181
178
|
token: string;
|
|
182
179
|
callbackURL?: string | undefined;
|
|
183
180
|
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -193,7 +190,7 @@ declare const authClient: {
|
|
|
193
190
|
message?: string | undefined;
|
|
194
191
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
195
192
|
} & {
|
|
196
|
-
sendVerificationEmail: <FetchOptions extends
|
|
193
|
+
sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
197
194
|
email: string;
|
|
198
195
|
callbackURL?: string | undefined;
|
|
199
196
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -208,7 +205,7 @@ declare const authClient: {
|
|
|
208
205
|
message?: string | undefined;
|
|
209
206
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
210
207
|
} & {
|
|
211
|
-
changeEmail: <FetchOptions extends
|
|
208
|
+
changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
212
209
|
newEmail: string;
|
|
213
210
|
callbackURL?: string | undefined;
|
|
214
211
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -223,7 +220,7 @@ declare const authClient: {
|
|
|
223
220
|
message?: string | undefined;
|
|
224
221
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
225
222
|
} & {
|
|
226
|
-
changePassword: <FetchOptions extends
|
|
223
|
+
changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
227
224
|
newPassword: string;
|
|
228
225
|
currentPassword: string;
|
|
229
226
|
revokeOtherSessions?: boolean | undefined;
|
|
@@ -249,7 +246,7 @@ declare const authClient: {
|
|
|
249
246
|
message?: string | undefined;
|
|
250
247
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
251
248
|
} & {
|
|
252
|
-
updateUser: <FetchOptions extends
|
|
249
|
+
updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
|
|
253
250
|
name?: string | undefined;
|
|
254
251
|
image?: string | undefined;
|
|
255
252
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -263,7 +260,7 @@ declare const authClient: {
|
|
|
263
260
|
message?: string | undefined;
|
|
264
261
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
265
262
|
} & {
|
|
266
|
-
deleteUser: <FetchOptions extends
|
|
263
|
+
deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
267
264
|
callbackURL?: string | undefined;
|
|
268
265
|
password?: string | undefined;
|
|
269
266
|
token?: string | undefined;
|
|
@@ -281,7 +278,7 @@ declare const authClient: {
|
|
|
281
278
|
message?: string | undefined;
|
|
282
279
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
283
280
|
} & {
|
|
284
|
-
requestPasswordReset: <FetchOptions extends
|
|
281
|
+
requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
285
282
|
email: string;
|
|
286
283
|
redirectTo?: string | undefined;
|
|
287
284
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -298,7 +295,7 @@ declare const authClient: {
|
|
|
298
295
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
299
296
|
} & {
|
|
300
297
|
resetPassword: {
|
|
301
|
-
":token": <FetchOptions extends
|
|
298
|
+
":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
302
299
|
callbackURL: string;
|
|
303
300
|
}> & Record<string, any>, {
|
|
304
301
|
token: string;
|
|
@@ -313,7 +310,7 @@ declare const authClient: {
|
|
|
313
310
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
314
311
|
};
|
|
315
312
|
} & {
|
|
316
|
-
listSessions: <FetchOptions extends
|
|
313
|
+
listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
317
314
|
query?: Record<string, any> | undefined;
|
|
318
315
|
fetchOptions?: FetchOptions | undefined;
|
|
319
316
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -330,7 +327,7 @@ declare const authClient: {
|
|
|
330
327
|
message?: string | undefined;
|
|
331
328
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
332
329
|
} & {
|
|
333
|
-
revokeSession: <FetchOptions extends
|
|
330
|
+
revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
334
331
|
token: string;
|
|
335
332
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
336
333
|
token: string;
|
|
@@ -343,7 +340,7 @@ declare const authClient: {
|
|
|
343
340
|
message?: string | undefined;
|
|
344
341
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
345
342
|
} & {
|
|
346
|
-
revokeSessions: <FetchOptions extends
|
|
343
|
+
revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
347
344
|
query?: Record<string, any> | undefined;
|
|
348
345
|
fetchOptions?: FetchOptions | undefined;
|
|
349
346
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
@@ -353,7 +350,7 @@ declare const authClient: {
|
|
|
353
350
|
message?: string | undefined;
|
|
354
351
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
355
352
|
} & {
|
|
356
|
-
revokeOtherSessions: <FetchOptions extends
|
|
353
|
+
revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
357
354
|
query?: Record<string, any> | undefined;
|
|
358
355
|
fetchOptions?: FetchOptions | undefined;
|
|
359
356
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
@@ -363,7 +360,7 @@ declare const authClient: {
|
|
|
363
360
|
message?: string | undefined;
|
|
364
361
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
365
362
|
} & {
|
|
366
|
-
linkSocial: <FetchOptions extends
|
|
363
|
+
linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
367
364
|
provider: unknown;
|
|
368
365
|
callbackURL?: string | undefined;
|
|
369
366
|
idToken?: {
|
|
@@ -403,7 +400,7 @@ declare const authClient: {
|
|
|
403
400
|
message?: string | undefined;
|
|
404
401
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
405
402
|
} & {
|
|
406
|
-
listAccounts: <FetchOptions extends
|
|
403
|
+
listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
407
404
|
query?: Record<string, any> | undefined;
|
|
408
405
|
fetchOptions?: FetchOptions | undefined;
|
|
409
406
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
@@ -420,7 +417,7 @@ declare const authClient: {
|
|
|
420
417
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
421
418
|
} & {
|
|
422
419
|
deleteUser: {
|
|
423
|
-
callback: <FetchOptions extends
|
|
420
|
+
callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
424
421
|
token: string;
|
|
425
422
|
callbackURL?: string | undefined;
|
|
426
423
|
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -438,7 +435,7 @@ declare const authClient: {
|
|
|
438
435
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
439
436
|
};
|
|
440
437
|
} & {
|
|
441
|
-
unlinkAccount: <FetchOptions extends
|
|
438
|
+
unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
442
439
|
providerId: string;
|
|
443
440
|
accountId?: string | undefined;
|
|
444
441
|
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -453,7 +450,7 @@ declare const authClient: {
|
|
|
453
450
|
message?: string | undefined;
|
|
454
451
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
455
452
|
} & {
|
|
456
|
-
refreshToken: <FetchOptions extends
|
|
453
|
+
refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
457
454
|
providerId: string;
|
|
458
455
|
accountId?: string | undefined;
|
|
459
456
|
userId?: string | undefined;
|
|
@@ -477,7 +474,7 @@ declare const authClient: {
|
|
|
477
474
|
message?: string | undefined;
|
|
478
475
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
479
476
|
} & {
|
|
480
|
-
getAccessToken: <FetchOptions extends
|
|
477
|
+
getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
|
|
481
478
|
providerId: string;
|
|
482
479
|
accountId?: string | undefined;
|
|
483
480
|
userId?: string | undefined;
|
|
@@ -497,7 +494,7 @@ declare const authClient: {
|
|
|
497
494
|
message?: string | undefined;
|
|
498
495
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
499
496
|
} & {
|
|
500
|
-
accountInfo: <FetchOptions extends
|
|
497
|
+
accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
501
498
|
accountId?: string | undefined;
|
|
502
499
|
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
503
500
|
query?: {
|
|
@@ -505,14 +502,14 @@ declare const authClient: {
|
|
|
505
502
|
} | undefined;
|
|
506
503
|
fetchOptions?: FetchOptions | undefined;
|
|
507
504
|
}> | undefined, data_1?: FetchOptions | undefined) => Promise<_better_fetch_fetch.BetterFetchResponse<{
|
|
508
|
-
user:
|
|
505
|
+
user: better_auth.OAuth2UserInfo;
|
|
509
506
|
data: Record<string, any>;
|
|
510
507
|
}, {
|
|
511
508
|
code?: string | undefined;
|
|
512
509
|
message?: string | undefined;
|
|
513
510
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
514
511
|
} & {
|
|
515
|
-
getSession: <FetchOptions extends
|
|
512
|
+
getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
|
|
516
513
|
disableCookieCache?: unknown;
|
|
517
514
|
disableRefresh?: unknown;
|
|
518
515
|
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: node_modules_better_auth_dist_helper_DU33OcfW_d_mts.u<{
|
|
@@ -572,7 +569,7 @@ declare const authClient: {
|
|
|
572
569
|
isRefetching: boolean;
|
|
573
570
|
error: _better_fetch_fetch.BetterFetchError | null;
|
|
574
571
|
refetch: (queryParams?: {
|
|
575
|
-
query?:
|
|
572
|
+
query?: better_auth.SessionQueryParams;
|
|
576
573
|
} | undefined) => Promise<void>;
|
|
577
574
|
};
|
|
578
575
|
$Infer: {
|
package/dist/client-utils.js
CHANGED
|
@@ -11,17 +11,12 @@ import "./chunk-5WRI5ZAA.js";
|
|
|
11
11
|
|
|
12
12
|
// src/client-utils.ts
|
|
13
13
|
import { t } from "i18next";
|
|
14
|
-
import {
|
|
15
|
-
import { initReactI18next, useTranslation } from "react-i18next";
|
|
16
|
-
import { default as default3 } from "i18next-browser-languagedetector";
|
|
14
|
+
import { useTranslation } from "react-i18next";
|
|
17
15
|
export {
|
|
18
|
-
default3 as LanguageDetector,
|
|
19
16
|
Platform,
|
|
20
17
|
WISTRON_PRIMARY_COLOR,
|
|
21
18
|
WISTRON_SECONDARY_COLOR,
|
|
22
19
|
authClient,
|
|
23
|
-
default2 as i18n,
|
|
24
|
-
initReactI18next,
|
|
25
20
|
t,
|
|
26
21
|
useTranslation
|
|
27
22
|
};
|
package/dist/client-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client-utils.ts"],"sourcesContent":["export { Platform } from \"./lib/utils\";\r\nexport { WISTRON_PRIMARY_COLOR, WISTRON_SECONDARY_COLOR } from \"./hooks/ThemeHook\";\r\n\r\n// Internationalization\r\nexport { t } from \"i18next\";\r\nexport {
|
|
1
|
+
{"version":3,"sources":["../src/client-utils.ts"],"sourcesContent":["export { Platform } from \"./lib/utils\";\r\nexport { WISTRON_PRIMARY_COLOR, WISTRON_SECONDARY_COLOR } from \"./hooks/ThemeHook\";\r\n\r\n// Internationalization\r\nexport { t } from \"i18next\";\r\nexport { useTranslation } from \"react-i18next\";\r\n\r\n// Auth\r\nexport { authClient } from \"./lib/auth/auth-client\";\r\n\r\n"],"mappings":";;;;;;;;;;;;AAIA,SAAS,SAAS;AAClB,SAAS,sBAAsB;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import * as _tanstack_start_client_core from '@tanstack/start-client-core';
|
|
2
|
+
import { CssVarsThemeOptions } from '@mui/material';
|
|
1
3
|
import { LinkOptions } from '@tanstack/react-router';
|
|
2
4
|
import { FC, ReactNode } from 'react';
|
|
3
|
-
import { CssVarsThemeOptions } from '@mui/material';
|
|
4
5
|
export { r as rootRouteHead } from './utils-ChipkRJ9.js';
|
|
6
|
+
import { Resource } from 'i18next';
|
|
7
|
+
import { Plugin } from 'vite';
|
|
5
8
|
import 'axios';
|
|
6
9
|
import 'uuidv7';
|
|
7
10
|
import '@t3-oss/env-core';
|
|
@@ -30,5 +33,16 @@ interface ProvidersProps {
|
|
|
30
33
|
children: ReactNode;
|
|
31
34
|
}
|
|
32
35
|
declare const LayoutProvider: FC<ProvidersProps>;
|
|
36
|
+
declare const setSSRLanguage: _tanstack_start_client_core.OptionalFetcher<undefined, undefined, Promise<void>>;
|
|
37
|
+
|
|
38
|
+
type RequireEn<T extends Resource> = T & {
|
|
39
|
+
en: T[keyof T];
|
|
40
|
+
};
|
|
41
|
+
interface ViteLayoutOptions<T extends Resource> {
|
|
42
|
+
i18n: {
|
|
43
|
+
resources: RequireEn<T>;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
declare function viteLayout<T extends Resource>({ i18n }: ViteLayoutOptions<T>): Plugin;
|
|
33
47
|
|
|
34
|
-
export { LayoutProvider, type Navigation };
|
|
48
|
+
export { LayoutProvider, type Navigation, setSSRLanguage, viteLayout };
|
package/dist/index.js
CHANGED
|
@@ -1641,9 +1641,15 @@ var AdapterDayjs = class {
|
|
|
1641
1641
|
};
|
|
1642
1642
|
|
|
1643
1643
|
// src/providers/LayoutProvider.tsx
|
|
1644
|
+
import { createServerFn } from "@tanstack/react-start";
|
|
1645
|
+
import { getCookie as getCookie2 } from "@tanstack/react-start/server";
|
|
1646
|
+
import dayjs2 from "dayjs";
|
|
1647
|
+
import i18n from "i18next";
|
|
1648
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
1644
1649
|
import { useEffect as useEffect3, useEffectEvent } from "react";
|
|
1645
|
-
import {
|
|
1646
|
-
import
|
|
1650
|
+
import { initReactI18next } from "react-i18next";
|
|
1651
|
+
import { resources } from "virtual:layout";
|
|
1652
|
+
import z from "zod";
|
|
1647
1653
|
|
|
1648
1654
|
// src/providers/DialogsProvider.tsx
|
|
1649
1655
|
import { useId, useRef as useRef2, useState } from "react";
|
|
@@ -2104,12 +2110,12 @@ var ToolbarAccount = () => {
|
|
|
2104
2110
|
const [anchorElement, setAnchorElement] = useState4();
|
|
2105
2111
|
const [tab, setTab] = useState4("settings");
|
|
2106
2112
|
const open = Boolean(anchorElement);
|
|
2107
|
-
const { t, i18n } = useTranslation();
|
|
2113
|
+
const { t, i18n: i18n2 } = useTranslation();
|
|
2108
2114
|
const { mode, setMode } = useColorScheme();
|
|
2109
2115
|
const { data: session } = authClient.useSession();
|
|
2110
2116
|
const { alert } = useDialogs();
|
|
2111
|
-
const supportedLanguages = (Array.isArray(
|
|
2112
|
-
const languageDisplayNames = new Intl.DisplayNames([
|
|
2117
|
+
const supportedLanguages = (Array.isArray(i18n2.options.supportedLngs) ? i18n2.options.supportedLngs : []).filter((lng) => lng !== "cimode");
|
|
2118
|
+
const languageDisplayNames = new Intl.DisplayNames([i18n2.language], { type: "language" });
|
|
2113
2119
|
const colorModes = [
|
|
2114
2120
|
{ mode: "light", icon: LightMode, label: t("Layout.Light") },
|
|
2115
2121
|
{ mode: "dark", icon: DarkMode, label: t("Layout.Dark") },
|
|
@@ -2139,7 +2145,7 @@ var ToolbarAccount = () => {
|
|
|
2139
2145
|
] }),
|
|
2140
2146
|
/* @__PURE__ */ jsxs4(ListItemButton2, { onClick: changeTab("language"), sx: { py: 0.3 }, children: [
|
|
2141
2147
|
/* @__PURE__ */ jsx6(ListItemIcon2, { children: /* @__PURE__ */ jsx6(Translate, {}) }),
|
|
2142
|
-
/* @__PURE__ */ jsx6(ListItemText2, { primary: t("Layout.Language"), secondary: capitalize(languageDisplayNames.of(
|
|
2148
|
+
/* @__PURE__ */ jsx6(ListItemText2, { primary: t("Layout.Language"), secondary: capitalize(languageDisplayNames.of(i18n2.language)) }),
|
|
2143
2149
|
/* @__PURE__ */ jsx6(ChevronRight, {})
|
|
2144
2150
|
] })
|
|
2145
2151
|
] });
|
|
@@ -2170,10 +2176,10 @@ var ToolbarAccount = () => {
|
|
|
2170
2176
|
(languageCode) => /* @__PURE__ */ jsxs4(
|
|
2171
2177
|
ListItemButton2,
|
|
2172
2178
|
{
|
|
2173
|
-
onClick: () =>
|
|
2174
|
-
selected:
|
|
2179
|
+
onClick: () => i18n2.changeLanguage(languageCode).finally(() => closeMenu()),
|
|
2180
|
+
selected: i18n2.resolvedLanguage === languageCode,
|
|
2175
2181
|
children: [
|
|
2176
|
-
/* @__PURE__ */ jsx6(ListItemIcon2, { children:
|
|
2182
|
+
/* @__PURE__ */ jsx6(ListItemIcon2, { children: i18n2.resolvedLanguage === languageCode && /* @__PURE__ */ jsx6(Done, {}) }),
|
|
2177
2183
|
/* @__PURE__ */ jsx6(ListItemText2, { primary: capitalize(languageDisplayNames.of(languageCode)) })
|
|
2178
2184
|
]
|
|
2179
2185
|
},
|
|
@@ -2299,11 +2305,22 @@ var Layout = (props) => {
|
|
|
2299
2305
|
|
|
2300
2306
|
// src/providers/LayoutProvider.tsx
|
|
2301
2307
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
2308
|
+
var YEAR_IN_MINUTES = 60 * 24 * 365;
|
|
2309
|
+
i18n.use(LanguageDetector).use(initReactI18next).init({
|
|
2310
|
+
resources,
|
|
2311
|
+
fallbackLng: "en",
|
|
2312
|
+
supportedLngs: Object.keys(resources),
|
|
2313
|
+
detection: {
|
|
2314
|
+
caches: ["cookie"],
|
|
2315
|
+
cookieMinutes: YEAR_IN_MINUTES
|
|
2316
|
+
},
|
|
2317
|
+
interpolation: { escapeValue: false }
|
|
2318
|
+
});
|
|
2302
2319
|
var LayoutProvider = ({ navigation, theme, children }) => {
|
|
2303
|
-
const { i18n } = useTranslation2();
|
|
2304
2320
|
const createdTheme = useGetTheme(theme);
|
|
2305
2321
|
const languageChangedHandler = useEffectEvent(() => {
|
|
2306
2322
|
z.config(z.core.locales[i18n.language]());
|
|
2323
|
+
dayjs2.locale(i18n.language);
|
|
2307
2324
|
});
|
|
2308
2325
|
useEffect3(() => {
|
|
2309
2326
|
languageChangedHandler();
|
|
@@ -2312,11 +2329,39 @@ var LayoutProvider = ({ navigation, theme, children }) => {
|
|
|
2312
2329
|
i18n.off("languageChanged", languageChangedHandler);
|
|
2313
2330
|
};
|
|
2314
2331
|
}, []);
|
|
2315
|
-
return /* @__PURE__ */ jsx8(ThemeProvider, { theme: createdTheme, children: /* @__PURE__ */ jsx8(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.
|
|
2332
|
+
return /* @__PURE__ */ jsx8(ThemeProvider, { theme: createdTheme, children: /* @__PURE__ */ jsx8(LocalizationProvider, { dateAdapter: AdapterDayjs, adapterLocale: i18n.language, children: /* @__PURE__ */ jsx8(DialogsProvider, { children: /* @__PURE__ */ jsx8(Layout, { navigation, children }) }) }, i18n.language) });
|
|
2316
2333
|
};
|
|
2334
|
+
var setSSRLanguage = createServerFn().handler(async () => {
|
|
2335
|
+
const language = getCookie2(i18n.services.languageDetector.options.lookupCookie) || "en";
|
|
2336
|
+
dayjs2.locale(language);
|
|
2337
|
+
z.config(z.core.locales[language]());
|
|
2338
|
+
await i18n.changeLanguage(language);
|
|
2339
|
+
});
|
|
2340
|
+
|
|
2341
|
+
// src/lib/vite-plugin.ts
|
|
2342
|
+
var VIRTUAL_ID = "virtual:layout";
|
|
2343
|
+
var RESOLVED_VIRTUAL_ID = "\0" + VIRTUAL_ID;
|
|
2344
|
+
function viteLayout({ i18n: i18n2 }) {
|
|
2345
|
+
return {
|
|
2346
|
+
name: "vite:layout",
|
|
2347
|
+
enforce: "pre",
|
|
2348
|
+
resolveId(id) {
|
|
2349
|
+
if (id === VIRTUAL_ID) return RESOLVED_VIRTUAL_ID;
|
|
2350
|
+
return null;
|
|
2351
|
+
},
|
|
2352
|
+
load(id) {
|
|
2353
|
+
if (id !== RESOLVED_VIRTUAL_ID) return null;
|
|
2354
|
+
return `
|
|
2355
|
+
export const resources = ${JSON.stringify(i18n2.resources)};
|
|
2356
|
+
`;
|
|
2357
|
+
}
|
|
2358
|
+
};
|
|
2359
|
+
}
|
|
2317
2360
|
export {
|
|
2318
2361
|
LayoutProvider,
|
|
2319
|
-
rootRouteHead
|
|
2362
|
+
rootRouteHead,
|
|
2363
|
+
setSSRLanguage,
|
|
2364
|
+
viteLayout
|
|
2320
2365
|
};
|
|
2321
2366
|
/*! Bundled license information:
|
|
2322
2367
|
|