template-common 1.1.5 → 1.1.7
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.
|
@@ -20,7 +20,7 @@ export declare const ACCOUNT_PROFILE_NAV_ITEMS: Record<'es' | 'en', (AccountProf
|
|
|
20
20
|
|
|
21
21
|
export declare const ACCOUNT_PROFILE_TEXTS: Record<'es' | 'en', AccountProfileTexts>;
|
|
22
22
|
|
|
23
|
-
export declare function AccountProfileConfig({ API_ENV, socials, texts, navItems, section: requestedSection, preferencesApiUrl, preferenceCollapseAt, prefsSource, syncPath, newsletterItems, debug, }: AccountProfileConfigProps): JSX.Element
|
|
23
|
+
export declare function AccountProfileConfig({ API_ENV, socials, texts, navItems, section: requestedSection, preferencesApiUrl, preferenceCollapseAt, prefsSource, syncPath, newsletterItems, debug, }: AccountProfileConfigProps): JSX.Element;
|
|
24
24
|
|
|
25
25
|
export declare type AccountProfileConfigProps = {
|
|
26
26
|
/** Subconjunto de config (`pickCoreAuthConfig`). Default: `getConfig()`. */
|
|
@@ -109,8 +109,21 @@ export declare type AccountProfileSectionToggles = {
|
|
|
109
109
|
CONFIG_profileNewsletters?: boolean;
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
+
export declare function AccountProfileSkeleton({ API_ENV, socials, texts, navItems, section: requestedSection, }: AccountProfileSkeletonProps): JSX.Element;
|
|
113
|
+
|
|
114
|
+
export declare type AccountProfileSkeletonProps = {
|
|
115
|
+
/** Mismas props que `AccountProfileConfig`: el placeholder resuelve igual título y menú. */
|
|
116
|
+
API_ENV?: CoreAuthConfig;
|
|
117
|
+
socials?: Socials;
|
|
118
|
+
texts?: Partial<Record<keyof AccountProfileTexts, unknown>>;
|
|
119
|
+
navItems?: AccountProfileNavItem[];
|
|
120
|
+
section?: AccountProfileSection;
|
|
121
|
+
};
|
|
122
|
+
|
|
112
123
|
export declare type AccountProfileTexts = {
|
|
113
124
|
title: string;
|
|
125
|
+
/** Lector de pantalla mientras se pinta el placeholder (`AccountProfileSkeleton`). */
|
|
126
|
+
loadingLabel: string;
|
|
114
127
|
logout: string;
|
|
115
128
|
avatarAlt: string;
|
|
116
129
|
sectionTitle: string;
|
|
@@ -1395,6 +1408,8 @@ export declare type CoreAuthUser = {
|
|
|
1395
1408
|
lastname: string;
|
|
1396
1409
|
image?: string;
|
|
1397
1410
|
provider?: string;
|
|
1411
|
+
/** Claim `cognito:username`: con el que los comentarios firman y comparan autoría. */
|
|
1412
|
+
username?: string;
|
|
1398
1413
|
};
|
|
1399
1414
|
|
|
1400
1415
|
/**
|
|
@@ -1840,7 +1855,11 @@ export declare type FetchConfig = {
|
|
|
1840
1855
|
newsType: string;
|
|
1841
1856
|
};
|
|
1842
1857
|
|
|
1843
|
-
/**
|
|
1858
|
+
/**
|
|
1859
|
+
* Usuario resuelto. Pega a `/api/auth/user` SOLO si hay sesión y no hay datos
|
|
1860
|
+
* ni en la cookie ni en el cache de la pestaña (sesión vieja o sitio sin
|
|
1861
|
+
* `userInfo`), y como mucho una vez en vuelo por pestaña.
|
|
1862
|
+
*/
|
|
1844
1863
|
export declare const fetchCoreAuthUser: (cfg?: CoreAuthConfig) => Promise<CoreAuthUser | null>;
|
|
1845
1864
|
|
|
1846
1865
|
declare type FetchMoreArgs = {
|
|
@@ -3106,7 +3125,8 @@ export declare type LibraryConfig = {
|
|
|
3106
3125
|
ANALYTICS_marfeel?: string | undefined;
|
|
3107
3126
|
ANALYTICS_gtm?: string | undefined;
|
|
3108
3127
|
ANALYTICS_comscore?: string | undefined;
|
|
3109
|
-
|
|
3128
|
+
/** `''` o `null` = cookies de login sin prefijo (ver `authPrefix` en `coreAuth.ts`). */
|
|
3129
|
+
COGNITO_AUTH_PREFIX?: string | null;
|
|
3110
3130
|
COGNITO_CLIENT_ID?: string;
|
|
3111
3131
|
COGNITO_DOMAIN?: string;
|
|
3112
3132
|
COGNITO_REDIRECT_URI?: string;
|
|
@@ -4353,7 +4373,8 @@ declare type Props_14 = {
|
|
|
4353
4373
|
|
|
4354
4374
|
declare type Props_15 = {
|
|
4355
4375
|
API_ENV: {
|
|
4356
|
-
|
|
4376
|
+
/** `''` o `null` = cookies de login sin prefijo. */
|
|
4377
|
+
COGNITO_AUTH_PREFIX: string | null;
|
|
4357
4378
|
PUBLIC_ENV: string;
|
|
4358
4379
|
CAPTCHA_KEY: string;
|
|
4359
4380
|
/** Kill switch de reCAPTCHA. Sin definir: captcha activo (como hoy). */
|
|
@@ -4368,7 +4389,8 @@ declare type Props_15 = {
|
|
|
4368
4389
|
declare type Props_16 = {
|
|
4369
4390
|
texts?: textsType;
|
|
4370
4391
|
API_ENV: {
|
|
4371
|
-
|
|
4392
|
+
/** `''` o `null` = cookies de login sin prefijo. */
|
|
4393
|
+
COGNITO_AUTH_PREFIX: string | null;
|
|
4372
4394
|
PUBLIC_ENV: string;
|
|
4373
4395
|
CAPTCHA_KEY: string;
|
|
4374
4396
|
/** Kill switch de reCAPTCHA. Sin definir: captcha activo (como hoy). */
|
|
@@ -4980,9 +5002,8 @@ declare type Props_9 = {
|
|
|
4980
5002
|
};
|
|
4981
5003
|
|
|
4982
5004
|
/**
|
|
4983
|
-
* Lectura SINCRÓNICA
|
|
4984
|
-
* usuario cacheado en esta pestaña
|
|
4985
|
-
* Sin cookie => deslogueado.
|
|
5005
|
+
* Lectura SINCRÓNICA, sin red: mock de dev, la cookie `<prefix>userInfo`, o
|
|
5006
|
+
* el usuario cacheado en esta pestaña. Sin cookie de sesión => deslogueado.
|
|
4986
5007
|
*/
|
|
4987
5008
|
export declare const readCoreAuthUser: (cfg?: CoreAuthConfig) => CoreAuthUser | null;
|
|
4988
5009
|
|
|
@@ -5995,6 +6016,13 @@ export declare const urlReplaces: (internalPath: string) => string;
|
|
|
5995
6016
|
*/
|
|
5996
6017
|
export declare function usePlayIcon(): ComponentType<SVGProps<SVGSVGElement>>;
|
|
5997
6018
|
|
|
6019
|
+
/**
|
|
6020
|
+
* Cookie NO httpOnly con los datos visibles del usuario (JSON, URL-encoded por
|
|
6021
|
+
* `cookies.set` de Astro). Forma: {@link CoreAuthUser}. Señal visual, igual que
|
|
6022
|
+
* `IS_AUTH`: no es prueba de sesión.
|
|
6023
|
+
*/
|
|
6024
|
+
export declare const userInfoCookieName: (cfg: CoreAuthConfig) => string;
|
|
6025
|
+
|
|
5998
6026
|
export declare interface UserType {
|
|
5999
6027
|
username: string;
|
|
6000
6028
|
firstname: string;
|