template-common 1.1.4 → 1.1.6
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/sass-template-common.d.ts +34 -8
- package/dist/sass-template-common.js +5152 -4952
- package/dist/sass-template-common.umd.cjs +44 -44
- package/package.json +82 -81
|
@@ -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, newsletterItems, debug, }: AccountProfileConfigProps): JSX.Element | null;
|
|
23
|
+
export declare function AccountProfileConfig({ API_ENV, socials, texts, navItems, section: requestedSection, preferencesApiUrl, preferenceCollapseAt, prefsSource, syncPath, newsletterItems, debug, }: AccountProfileConfigProps): JSX.Element | null;
|
|
24
24
|
|
|
25
25
|
export declare type AccountProfileConfigProps = {
|
|
26
26
|
/** Subconjunto de config (`pickCoreAuthConfig`). Default: `getConfig()`. */
|
|
@@ -48,6 +48,17 @@ export declare type AccountProfileConfigProps = {
|
|
|
48
48
|
preferencesApiUrl?: string;
|
|
49
49
|
/** Chips visibles por lista antes de "Mostrar más N". Default 8. */
|
|
50
50
|
preferenceCollapseAt?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Fuente de "Mis preferencias". `backend` (default): `perfil-get`, solo lectura.
|
|
53
|
+
* `client`: el scoring del navegador del sitio (`window.__bsp`), con edición; no usa
|
|
54
|
+
* `preferencesApiUrl`.
|
|
55
|
+
*/
|
|
56
|
+
prefsSource?: 'client' | 'backend';
|
|
57
|
+
/**
|
|
58
|
+
* Solo con `prefsSource = 'client'`: endpoint same-origin al que se mandan los cambios
|
|
59
|
+
* (`POST { kind: 'preferences', data: snapshot }`, debounce de 2 s). Vacío: no envía.
|
|
60
|
+
*/
|
|
61
|
+
syncPath?: string;
|
|
51
62
|
/** Opciones de "Newsletters". Default: lista genérica de la lib. */
|
|
52
63
|
newsletterItems?: AccountProfileNewsletterItem[];
|
|
53
64
|
/**
|
|
@@ -1384,6 +1395,8 @@ export declare type CoreAuthUser = {
|
|
|
1384
1395
|
lastname: string;
|
|
1385
1396
|
image?: string;
|
|
1386
1397
|
provider?: string;
|
|
1398
|
+
/** Claim `cognito:username`: con el que los comentarios firman y comparan autoría. */
|
|
1399
|
+
username?: string;
|
|
1387
1400
|
};
|
|
1388
1401
|
|
|
1389
1402
|
/**
|
|
@@ -1829,7 +1842,11 @@ export declare type FetchConfig = {
|
|
|
1829
1842
|
newsType: string;
|
|
1830
1843
|
};
|
|
1831
1844
|
|
|
1832
|
-
/**
|
|
1845
|
+
/**
|
|
1846
|
+
* Usuario resuelto. Pega a `/api/auth/user` SOLO si hay sesión y no hay datos
|
|
1847
|
+
* ni en la cookie ni en el cache de la pestaña (sesión vieja o sitio sin
|
|
1848
|
+
* `userInfo`), y como mucho una vez en vuelo por pestaña.
|
|
1849
|
+
*/
|
|
1833
1850
|
export declare const fetchCoreAuthUser: (cfg?: CoreAuthConfig) => Promise<CoreAuthUser | null>;
|
|
1834
1851
|
|
|
1835
1852
|
declare type FetchMoreArgs = {
|
|
@@ -3095,7 +3112,8 @@ export declare type LibraryConfig = {
|
|
|
3095
3112
|
ANALYTICS_marfeel?: string | undefined;
|
|
3096
3113
|
ANALYTICS_gtm?: string | undefined;
|
|
3097
3114
|
ANALYTICS_comscore?: string | undefined;
|
|
3098
|
-
|
|
3115
|
+
/** `''` o `null` = cookies de login sin prefijo (ver `authPrefix` en `coreAuth.ts`). */
|
|
3116
|
+
COGNITO_AUTH_PREFIX?: string | null;
|
|
3099
3117
|
COGNITO_CLIENT_ID?: string;
|
|
3100
3118
|
COGNITO_DOMAIN?: string;
|
|
3101
3119
|
COGNITO_REDIRECT_URI?: string;
|
|
@@ -4342,7 +4360,8 @@ declare type Props_14 = {
|
|
|
4342
4360
|
|
|
4343
4361
|
declare type Props_15 = {
|
|
4344
4362
|
API_ENV: {
|
|
4345
|
-
|
|
4363
|
+
/** `''` o `null` = cookies de login sin prefijo. */
|
|
4364
|
+
COGNITO_AUTH_PREFIX: string | null;
|
|
4346
4365
|
PUBLIC_ENV: string;
|
|
4347
4366
|
CAPTCHA_KEY: string;
|
|
4348
4367
|
/** Kill switch de reCAPTCHA. Sin definir: captcha activo (como hoy). */
|
|
@@ -4357,7 +4376,8 @@ declare type Props_15 = {
|
|
|
4357
4376
|
declare type Props_16 = {
|
|
4358
4377
|
texts?: textsType;
|
|
4359
4378
|
API_ENV: {
|
|
4360
|
-
|
|
4379
|
+
/** `''` o `null` = cookies de login sin prefijo. */
|
|
4380
|
+
COGNITO_AUTH_PREFIX: string | null;
|
|
4361
4381
|
PUBLIC_ENV: string;
|
|
4362
4382
|
CAPTCHA_KEY: string;
|
|
4363
4383
|
/** Kill switch de reCAPTCHA. Sin definir: captcha activo (como hoy). */
|
|
@@ -4969,9 +4989,8 @@ declare type Props_9 = {
|
|
|
4969
4989
|
};
|
|
4970
4990
|
|
|
4971
4991
|
/**
|
|
4972
|
-
* Lectura SINCRÓNICA
|
|
4973
|
-
* usuario cacheado en esta pestaña
|
|
4974
|
-
* Sin cookie => deslogueado.
|
|
4992
|
+
* Lectura SINCRÓNICA, sin red: mock de dev, la cookie `<prefix>userInfo`, o
|
|
4993
|
+
* el usuario cacheado en esta pestaña. Sin cookie de sesión => deslogueado.
|
|
4975
4994
|
*/
|
|
4976
4995
|
export declare const readCoreAuthUser: (cfg?: CoreAuthConfig) => CoreAuthUser | null;
|
|
4977
4996
|
|
|
@@ -5984,6 +6003,13 @@ export declare const urlReplaces: (internalPath: string) => string;
|
|
|
5984
6003
|
*/
|
|
5985
6004
|
export declare function usePlayIcon(): ComponentType<SVGProps<SVGSVGElement>>;
|
|
5986
6005
|
|
|
6006
|
+
/**
|
|
6007
|
+
* Cookie NO httpOnly con los datos visibles del usuario (JSON, URL-encoded por
|
|
6008
|
+
* `cookies.set` de Astro). Forma: {@link CoreAuthUser}. Señal visual, igual que
|
|
6009
|
+
* `IS_AUTH`: no es prueba de sesión.
|
|
6010
|
+
*/
|
|
6011
|
+
export declare const userInfoCookieName: (cfg: CoreAuthConfig) => string;
|
|
6012
|
+
|
|
5987
6013
|
export declare interface UserType {
|
|
5988
6014
|
username: string;
|
|
5989
6015
|
firstname: string;
|