template-common 1.1.2 → 1.1.3
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/buscar-results.css +7 -0
- package/dist/sass-template-common.css +1 -1
- package/dist/sass-template-common.d.ts +425 -20
- package/dist/sass-template-common.js +6662 -5902
- package/dist/sass-template-common.umd.cjs +49 -49
- package/dist/ui/components/common/header-auth/header-auth.css +1 -1
- package/dist/ui/components/common/headers/headers.css +1 -1
- package/dist/ui/components/pages/account/profile-config/components-pages-account-profile-config.css +1 -1
- package/dist/ui/components/pages/buscar/client/buscar-client.css +1 -0
- package/package.json +2 -1
|
@@ -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,
|
|
23
|
+
export declare function AccountProfileConfig({ API_ENV, socials, texts, navItems, section: requestedSection, preferencesApiUrl, preferenceCollapseAt, newsletterItems, debug, }: AccountProfileConfigProps): JSX.Element | null;
|
|
24
24
|
|
|
25
25
|
export declare type AccountProfileConfigProps = {
|
|
26
26
|
/** Subconjunto de config (`pickCoreAuthConfig`). Default: `getConfig()`. */
|
|
@@ -39,10 +39,13 @@ export declare type AccountProfileConfigProps = {
|
|
|
39
39
|
navItems?: AccountProfileNavItem[];
|
|
40
40
|
/** Sección a mostrar. Default `config`. */
|
|
41
41
|
section?: AccountProfileSection;
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Base de `perfil-get` para "Mis preferencias": `<API>/perfil/<sitio>`, sin el
|
|
44
|
+
* `sub` (mondongo `docs/contratos.md` §4). La sección agrega `/<sub>` del lector
|
|
45
|
+
* y lo pide desde el navegador. Vacía o ausente: no se pide nada y la sección
|
|
46
|
+
* dice que las preferencias no están disponibles.
|
|
47
|
+
*/
|
|
48
|
+
preferencesApiUrl?: string;
|
|
46
49
|
/** Chips visibles por lista antes de "Mostrar más N". Default 8. */
|
|
47
50
|
preferenceCollapseAt?: number;
|
|
48
51
|
/** Opciones de "Newsletters". Default: lista genérica de la lib. */
|
|
@@ -71,24 +74,20 @@ export declare type AccountProfileNewsletterItem = {
|
|
|
71
74
|
frequency?: string;
|
|
72
75
|
};
|
|
73
76
|
|
|
77
|
+
/** Un chip: una entidad de `perfil-get` (`entidad_id`, `nombre`, `tipo`). */
|
|
74
78
|
export declare type AccountProfilePreferenceItem = {
|
|
75
79
|
id: string;
|
|
76
80
|
label: string;
|
|
77
81
|
kind: AccountProfilePreferenceKind;
|
|
78
|
-
/** Afinidad: lo que comparte grupo con lo que te interesa se sugiere primero. */
|
|
79
|
-
group?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Interés detectado por actividad, de -1 a 1 (hoy es mock: lo trae la lista).
|
|
82
|
-
* > 0: aparece en "ver más" sin ícono (inferido). < 0: en "ver menos".
|
|
83
|
-
*/
|
|
84
|
-
activity?: number;
|
|
85
82
|
};
|
|
86
83
|
|
|
87
84
|
/**
|
|
88
|
-
* Tipos
|
|
89
|
-
*
|
|
85
|
+
* Tipos de "Mis preferencias" y tipos y lista por defecto de "Newsletters". Los
|
|
86
|
+
* temas de "Mis preferencias" salen de `perfil-get` (ver `perfil-api.ts`); las
|
|
87
|
+
* newsletters, el sitio las pasa por prop (`newsletterItems`).
|
|
90
88
|
*/
|
|
91
|
-
|
|
89
|
+
/** El `tipo` de la entidad que devuelve `perfil-get` (hoy `tag`). */
|
|
90
|
+
export declare type AccountProfilePreferenceKind = string;
|
|
92
91
|
|
|
93
92
|
/** Secciones de la página de cuenta. Cada una es su propia ruta en el sitio. */
|
|
94
93
|
export declare type AccountProfileSection = 'config' | 'preferences' | 'newsletters';
|
|
@@ -111,6 +110,10 @@ export declare type AccountProfileTexts = {
|
|
|
111
110
|
saveButton: string;
|
|
112
111
|
sendingLabel: string;
|
|
113
112
|
savingLabel: string;
|
|
113
|
+
/** Nombre/apellido guardados. */
|
|
114
|
+
saveSuccess: string;
|
|
115
|
+
saveError: string;
|
|
116
|
+
errorNameRequired: string;
|
|
114
117
|
showPassword: string;
|
|
115
118
|
hidePassword: string;
|
|
116
119
|
sendCodeError: string;
|
|
@@ -139,6 +142,16 @@ export declare type AccountProfileTexts = {
|
|
|
139
142
|
prefsMoveToMore: string;
|
|
140
143
|
prefsRemove: string;
|
|
141
144
|
prefsCancel: string;
|
|
145
|
+
prefsLoading: string;
|
|
146
|
+
/** 404 `sin_historial`: la cuenta no tiene lecturas. */
|
|
147
|
+
prefsEmptyHistory: string;
|
|
148
|
+
/** 404 `sin_vectores`: ninguna nota leída se procesó todavía. */
|
|
149
|
+
prefsEmptyVectors: string;
|
|
150
|
+
/** Sin ruta configurada, `sitio_sin_salt` o 400. */
|
|
151
|
+
prefsUnavailable: string;
|
|
152
|
+
/** 500, red o CORS. Va con `prefsRetry`. */
|
|
153
|
+
prefsError: string;
|
|
154
|
+
prefsRetry: string;
|
|
142
155
|
newslettersTitle: string;
|
|
143
156
|
newslettersDesc: string;
|
|
144
157
|
newslettersFootnote: string;
|
|
@@ -150,6 +163,10 @@ export declare type AccountProfileTexts = {
|
|
|
150
163
|
debugUpdatedAt: string;
|
|
151
164
|
debugNever: string;
|
|
152
165
|
debugReset: string;
|
|
166
|
+
debugUrl: string;
|
|
167
|
+
debugStatus: string;
|
|
168
|
+
debugMs: string;
|
|
169
|
+
debugNoRequest: string;
|
|
153
170
|
changePasswordButton: string;
|
|
154
171
|
/** `{{email}}` se reemplaza por el email enmascarado. */
|
|
155
172
|
changePasswordMessage: string;
|
|
@@ -256,7 +273,7 @@ export declare interface Author {
|
|
|
256
273
|
*/
|
|
257
274
|
export declare type AuthorSocialNetwork = 'tiktok' | 'youtube' | 'pinterest';
|
|
258
275
|
|
|
259
|
-
export declare const AuthUser: ({ user, loginHref, accountUrl, texts, config }: Props_59) => JSX.Element;
|
|
276
|
+
export declare const AuthUser: ({ user, pending, loginHref, accountUrl, texts, config, }: Props_59) => JSX.Element;
|
|
260
277
|
|
|
261
278
|
export declare const AutorHeader1: FC<Props_46>;
|
|
262
279
|
|
|
@@ -578,6 +595,177 @@ export declare const buildVideoUrlFromInternal: (internal: string, options?: {
|
|
|
578
595
|
title?: string;
|
|
579
596
|
}) => string;
|
|
580
597
|
|
|
598
|
+
export declare type BuscarCardContext = {
|
|
599
|
+
/** `getEnvironmentUrl()` resuelto en el SSR: base de las imagenes relativas. */
|
|
600
|
+
imageBase: string;
|
|
601
|
+
/** `getFrontPrefix()` resuelto en el SSR (sub-publicacion); '' si no hay. */
|
|
602
|
+
frontPrefix: string;
|
|
603
|
+
/** `getAuthorPrefix()` resuelto en el SSR ("Por "), '' si el sitio no lo usa. */
|
|
604
|
+
authorPrefix: string;
|
|
605
|
+
/** Solo `autor` y `tema`: lo que leen los links de autor y de tag. */
|
|
606
|
+
paths: Pick<RoutePathConfig, 'autor' | 'tema'>;
|
|
607
|
+
/** `SHOW_TAG_BY_SECTION`: la volanta muestra el primer tag y no la seccion. */
|
|
608
|
+
showTagBySection: boolean;
|
|
609
|
+
/** `PUBLIC_LNG`. */
|
|
610
|
+
lng: string;
|
|
611
|
+
/** `DATE_TIMEZONE`. */
|
|
612
|
+
timeZone: string;
|
|
613
|
+
/** `LINK_REMOVE`. */
|
|
614
|
+
linkRemove?: string;
|
|
615
|
+
/** `SUB_PUBLICATION_PREFIX_IN_ROUTES`: rutas que NO llevan el prefijo. */
|
|
616
|
+
prefixBlocked?: {
|
|
617
|
+
buscar?: boolean;
|
|
618
|
+
autor?: boolean;
|
|
619
|
+
tema?: boolean;
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
declare function BuscarClient({ initialQuery, env, ctx, texts }: BuscarClientProps): JSX.Element;
|
|
624
|
+
export { BuscarClient }
|
|
625
|
+
export { BuscarClient as BuscarClientComponent }
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Forma larga del toggle {@link LibraryConfig.CONFIG_buscarClient}.
|
|
629
|
+
*/
|
|
630
|
+
export declare type BuscarClientConfig = {
|
|
631
|
+
/** Kill switch. `false` apaga la feature aunque el objeto este presente. */
|
|
632
|
+
enabled?: boolean;
|
|
633
|
+
/** Tamano del lote de `/news-list-search` (submit y cada "Ver mas"). Default 20. */
|
|
634
|
+
size?: number;
|
|
635
|
+
/**
|
|
636
|
+
* Tamano de "Ultimas Noticias" (sin resultados o con error). Default 21: la
|
|
637
|
+
* grilla es de 3 columnas y con 20 la ultima fila queda con un hueco.
|
|
638
|
+
*/
|
|
639
|
+
lastNewsSize?: number;
|
|
640
|
+
/** Boton "Ver mas" debajo de los resultados. Default `true`. */
|
|
641
|
+
loadMore?: boolean;
|
|
642
|
+
/**
|
|
643
|
+
* Ultima pagina que alcanza "Ver mas", contando la 1 del submit: 5 => 4
|
|
644
|
+
* clicks (100 resultados con `size` 20). Default 5, igual que `CONFIG_listLoadMore`.
|
|
645
|
+
*/
|
|
646
|
+
maxPages?: number;
|
|
647
|
+
/**
|
|
648
|
+
* Preview de resultados mientras se tipea (debounce 300 ms, minimo 3
|
|
649
|
+
* caracteres, 5 notas + "Ver todos"). Pide la misma URL que el submit, asi que
|
|
650
|
+
* Enter despues del preview no hace otro request. Default `false`.
|
|
651
|
+
*/
|
|
652
|
+
preview?: boolean;
|
|
653
|
+
/** `newstype` del pedido. Default: `config.newsType` del sitio (el de los listados). */
|
|
654
|
+
newsType?: string;
|
|
655
|
+
/** `imagesizes` del pedido. Default: `imageSizes.note.listStandard` del sitio. */
|
|
656
|
+
imageSizes?: string;
|
|
657
|
+
/** `exclude` del pedido. Default: el mismo de los routers de listado. */
|
|
658
|
+
exclude?: string;
|
|
659
|
+
/** Base de `/hit`. Default `PUBLIC_API_FRONT + PUBLIC_API_PATH_VERSION`. */
|
|
660
|
+
endpointBase?: string;
|
|
661
|
+
/** Loguea cada request en la consola del browser. Default `PUBLIC_ENV !== 'prod'`. */
|
|
662
|
+
debug?: boolean;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Whitelist de lo que la isla recibe del server. Las props de una isla se
|
|
667
|
+
* serializan en el HTML: lo que no esta aca no viaja.
|
|
668
|
+
*/
|
|
669
|
+
export declare type BuscarClientEnv = BuscarClientParamsConfig & {
|
|
670
|
+
/** `https://<sitio>/hit/5.0/1` (`PUBLIC_API_FRONT` + `PUBLIC_API_PATH_VERSION`). */
|
|
671
|
+
endpointBase: string;
|
|
672
|
+
/** `x-api-token` (el mismo de "Mas noticias"). */
|
|
673
|
+
apiToken: string;
|
|
674
|
+
/** Loguea cada request en consola (fuera de prod). */
|
|
675
|
+
debug: boolean;
|
|
676
|
+
/** `false` = sin boton "Ver mas". */
|
|
677
|
+
loadMore: boolean;
|
|
678
|
+
/** Ultima pagina que puede pedir "Ver mas" (la 1 es la del submit). */
|
|
679
|
+
loadMoreMaxPages: number;
|
|
680
|
+
/** Preview de resultados mientras se tipea. */
|
|
681
|
+
preview: boolean;
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Params del buscador client (`CONFIG_buscarClient`) contra `/hit`.
|
|
686
|
+
*
|
|
687
|
+
* Modulo PURO: sin React, sin `getConfig()`, sin imports en runtime. Lo usan el
|
|
688
|
+
* SSR (`getBuscarClientProps`, para normalizar la query del deep link) y el
|
|
689
|
+
* browser (`api.ts`): la misma funcion de los dos lados garantiza la misma URL,
|
|
690
|
+
* o sea la misma entrada de cache en CloudFront.
|
|
691
|
+
*/
|
|
692
|
+
export declare type BuscarClientParamsConfig = {
|
|
693
|
+
publication: number;
|
|
694
|
+
newsType: string;
|
|
695
|
+
imageSizes: string;
|
|
696
|
+
exclude: string;
|
|
697
|
+
/** Tamano del lote de `/news-list-search`. */
|
|
698
|
+
size: number;
|
|
699
|
+
/** Tamano de "Ultimas Noticias" (`/news-list`). */
|
|
700
|
+
lastNewsSize: number;
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
export declare type BuscarClientProps = {
|
|
704
|
+
initialQuery: string;
|
|
705
|
+
env: BuscarClientEnv;
|
|
706
|
+
ctx: BuscarCardContext;
|
|
707
|
+
texts: BuscarClientTexts;
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
export declare type BuscarClientTexts = {
|
|
711
|
+
/** `${searchKeyWord}...`, igual que `SearchSection`. */
|
|
712
|
+
placeholder: string;
|
|
713
|
+
/** `searchKeyWord`: aria-label del input y del boton. */
|
|
714
|
+
submitLabel: string;
|
|
715
|
+
noResults: string;
|
|
716
|
+
lastNotesTitle: string;
|
|
717
|
+
seeAll: string;
|
|
718
|
+
loading: string;
|
|
719
|
+
error: string;
|
|
720
|
+
/** `resultsOfPrefix` ("Resultados de "). */
|
|
721
|
+
resultsOfPrefix: string;
|
|
722
|
+
/** `<title>` sin query (= `metadata_defaults.buscar` con query vacia). */
|
|
723
|
+
titleEmpty: string;
|
|
724
|
+
/** `${config.name} | ${resultsOfPrefix}`: se le agrega `'<query>'`. */
|
|
725
|
+
titleWithQueryPrefix: string;
|
|
726
|
+
/** `listLoadMoreButton` (mismo texto que el "Ver mas" de los listados). */
|
|
727
|
+
loadMore: string;
|
|
728
|
+
/** `listLoadMoreLoading`. */
|
|
729
|
+
loadMoreLoading: string;
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
export declare const buscarLastNewsUrl: (env: BuscarClientEnv) => string;
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* El `Link` de la libreria como funcion pura: prefijo de sub-publicacion
|
|
736
|
+
* (salvo las rutas bloqueadas en `SUB_PUBLICATION_PREFIX_IN_ROUTES`),
|
|
737
|
+
* `LINK_REMOVE` y `target/rel` de externos.
|
|
738
|
+
*
|
|
739
|
+
* `opts.target` replica la semantica de la prop en `Link`: si la clave EXISTE
|
|
740
|
+
* (aunque valga `undefined`, como en `SectionCard` con `info.link.target`), el
|
|
741
|
+
* spread de props pisa el `'_blank'` default de los externos. Solo los links sin
|
|
742
|
+
* prop `target` (seccion, autor, tag) salen con `_blank`.
|
|
743
|
+
*/
|
|
744
|
+
export declare function buscarLinkAttrs(href: string | undefined, ctx: BuscarCardContext, opts?: {
|
|
745
|
+
target?: string;
|
|
746
|
+
blockPrefix?: boolean;
|
|
747
|
+
}): {
|
|
748
|
+
href: string;
|
|
749
|
+
target?: string;
|
|
750
|
+
rel?: string;
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
/** = `Modulo1x3` con `hasLines` (Section sin titulo + grilla de `Modulo3Columnas`). */
|
|
754
|
+
export declare function BuscarResultsGrid({ items, ctx, }: {
|
|
755
|
+
items: BuscarSearchItem[];
|
|
756
|
+
ctx: BuscarCardContext;
|
|
757
|
+
}): JSX.Element;
|
|
758
|
+
|
|
759
|
+
/** = `Section` de la libreria. Con `title` vacio no pinta cabecera (como `Modulo1x3`). */
|
|
760
|
+
export declare function BuscarResultsSection({ title, children, }: {
|
|
761
|
+
title?: string;
|
|
762
|
+
children: ReactNode;
|
|
763
|
+
}): JSX.Element;
|
|
764
|
+
|
|
765
|
+
export declare type BuscarSearchItem = NewListResponseData;
|
|
766
|
+
|
|
767
|
+
export declare const buscarSearchUrl: (env: BuscarClientEnv, query: string, page?: number) => string;
|
|
768
|
+
|
|
581
769
|
declare interface ButtonCSS {
|
|
582
770
|
'--button-background-color'?: string;
|
|
583
771
|
'--button-color'?: string;
|
|
@@ -628,6 +816,9 @@ export declare const CarruselOpinion: FC<SectionCardCarouselProps>;
|
|
|
628
816
|
/** Corre `resolveImageSizes` y reduce el resultado a pass/fail para CI. */
|
|
629
817
|
export declare function checkImageSizes(input: ImageSizesContractInput | undefined): ImageSizesCheckReport;
|
|
630
818
|
|
|
819
|
+
/** Status + cuerpo -> resultado, segun la tabla de respuestas del contrato (§4). */
|
|
820
|
+
export declare function classifyPerfil(status: number, body: unknown): PerfilResult;
|
|
821
|
+
|
|
631
822
|
/**
|
|
632
823
|
* Recorre recursivamente un schema (objeto o array) y elimina toda entry
|
|
633
824
|
* que quede sin valor. Si una propiedad de un objeto queda sin valor, la
|
|
@@ -1181,6 +1372,9 @@ export declare const CORE_AUTH_CHANGED_EVENT = "core-auth:changed";
|
|
|
1181
1372
|
/** Claves de config que usa el login del header y la página de cuenta. */
|
|
1182
1373
|
export declare const CORE_AUTH_CONFIG_KEYS: readonly ["CONFIG_headerAuth", "CONFIG_authUserImage", "CONFIG_accountPath", "CONFIG_authAvatarBase", "CONFIG_authMockUser", "CONFIG_profilePreferences", "CONFIG_profileNewsletters", "COGNITO_AUTH_PREFIX", "PUBLIC_ENV", "PUBLIC_LNG", "PUBLIC_SERVICE_PREFIX", "PUBLIC_IS_SUB_PUBLICATION", "FORCE_SUB_PUBLICATION_PREFIX"];
|
|
1183
1374
|
|
|
1375
|
+
/** Largo máximo de nombre y apellido (mismo límite que `/api/auth/update-profile`). */
|
|
1376
|
+
export declare const CORE_AUTH_NAME_MAX_LENGTH = 60;
|
|
1377
|
+
|
|
1184
1378
|
export declare type CoreAuthConfig = Pick<LibraryConfig, (typeof CORE_AUTH_CONFIG_KEYS)[number]>;
|
|
1185
1379
|
|
|
1186
1380
|
export declare type CoreAuthUser = {
|
|
@@ -1653,6 +1847,19 @@ declare type FetchMoreArgs = {
|
|
|
1653
1847
|
|
|
1654
1848
|
export declare function fetchMoreNews({ endpoint, route, slug, page, size, direct, }: FetchMoreArgs): Promise<MoreNewsPage>;
|
|
1655
1849
|
|
|
1850
|
+
/**
|
|
1851
|
+
* Pide el perfil. Nunca tira: cualquier falla vuelve como `error` o `unavailable`, con la
|
|
1852
|
+
* traza para el panel de debug.
|
|
1853
|
+
*
|
|
1854
|
+
* @param base `<API>/perfil/<sitio>`, sin el `sub`. Vacia: no se pide nada.
|
|
1855
|
+
* @param sub el `sub` de Cognito del lector.
|
|
1856
|
+
* @param fetchImpl para los tests; por defecto, el `fetch` global.
|
|
1857
|
+
*/
|
|
1858
|
+
export declare function fetchPerfil(base: string | undefined, sub: string, fetchImpl?: typeof fetch, timeoutMs?: number): Promise<{
|
|
1859
|
+
result: PerfilResult;
|
|
1860
|
+
trace: PerfilTrace;
|
|
1861
|
+
}>;
|
|
1862
|
+
|
|
1656
1863
|
/**
|
|
1657
1864
|
* Cache in-memory + deduplicación de requests en vuelo (misma clave → misma promesa).
|
|
1658
1865
|
* TTL corto pensado para SSR: evita 4–5 GETs repetidos de menú/banners por instancia.
|
|
@@ -1874,6 +2081,33 @@ export declare function GenerateHead({ axiosApi, headConfig: headConfigInput, me
|
|
|
1874
2081
|
/** Cliente axios compartido por origen de bucket (keep-alive en Node SSR). */
|
|
1875
2082
|
export declare function getBucketHttpClient(baseUrl: string, referer: string): AxiosInstance;
|
|
1876
2083
|
|
|
2084
|
+
export declare function getBuscarClientProps({ query, config, texts, imageSizes, cfg, }: GetBuscarClientPropsArgs): BuscarClientProps | null;
|
|
2085
|
+
|
|
2086
|
+
export declare type GetBuscarClientPropsArgs = {
|
|
2087
|
+
/** `?query=` del request, crudo (la isla lo normaliza). */
|
|
2088
|
+
query: string;
|
|
2089
|
+
/**
|
|
2090
|
+
* `config` del sitio (`src/_setup/client-config`). Se leen `name` y `siteUrl`
|
|
2091
|
+
* (`<title>`), `newsType` (mismo universo que los listados) y `paths`.
|
|
2092
|
+
*/
|
|
2093
|
+
config: {
|
|
2094
|
+
name: string;
|
|
2095
|
+
siteUrl: string;
|
|
2096
|
+
newsType?: string;
|
|
2097
|
+
paths?: Partial<RoutePathConfig>;
|
|
2098
|
+
};
|
|
2099
|
+
/** `getTexts()` del sitio. Las keys que falten caen a los defaults de la libreria. */
|
|
2100
|
+
texts: SiteTexts;
|
|
2101
|
+
/**
|
|
2102
|
+
* `imageSizes` del sitio (contrato). Se usa `note.listStandard`, el corte de
|
|
2103
|
+
* los listados; ausente cae al default congelado de `resolveImageSizes`.
|
|
2104
|
+
* `CONFIG_buscarClient.imageSizes` lo pisa.
|
|
2105
|
+
*/
|
|
2106
|
+
imageSizes?: ImageSizesContractInput;
|
|
2107
|
+
/** Default: el singleton de `initLibrary` (poblado en el SSR). */
|
|
2108
|
+
cfg?: LibraryConfig;
|
|
2109
|
+
};
|
|
2110
|
+
|
|
1877
2111
|
/**
|
|
1878
2112
|
* Busca en un dict keyed por nombre de bloque (SlotComponents, stylesConfig,
|
|
1879
2113
|
* imgSizes). Match exacto primero; si no, compara nombres normalizados para que
|
|
@@ -1926,8 +2160,6 @@ export declare const getCoreAuthInitials: (user: CoreAuthUser) => string;
|
|
|
1926
2160
|
|
|
1927
2161
|
export declare const getDefaultNewsletterItems: (lng?: string) => AccountProfileNewsletterItem[];
|
|
1928
2162
|
|
|
1929
|
-
export declare const getDefaultPreferenceItems: (lng?: string) => AccountProfilePreferenceItem[];
|
|
1930
|
-
|
|
1931
2163
|
export declare const getDynamicSlots: (axiosApi: AxiosInstance, config: Config, imgSizes: {
|
|
1932
2164
|
[key: string]: any;
|
|
1933
2165
|
}, imageSizes: ImageSizesContractInput | undefined, DYNAMIC_SLOT_TOTAL: number, DYNAMIC_SLOT_SUBINDEXES: number, exclude?: string) => Promise<{
|
|
@@ -1946,6 +2178,9 @@ export declare const getImageUrl: (imageUrl: string) => Promise<string>;
|
|
|
1946
2178
|
|
|
1947
2179
|
export declare const getItemFormated: (item: NewListResponseData, commonServices: CommonServices, imgSize: string) => Promise<ItemFormatedType>;
|
|
1948
2180
|
|
|
2181
|
+
/** "Ultimas Noticias" para cuando la busqueda no trae nada o falla. */
|
|
2182
|
+
export declare function getLastNewsClient(env: BuscarClientEnv): Promise<BuscarSearchItem[]>;
|
|
2183
|
+
|
|
1949
2184
|
export declare const getNextMeta: (config: Config, paths: Array<string>, page: number) => string;
|
|
1950
2185
|
|
|
1951
2186
|
export declare const getPage: (pathname: string) => number;
|
|
@@ -2087,7 +2322,7 @@ export declare const HEADER_AUTH_TEXTS: Record<'es' | 'en', HeaderAuthTexts>;
|
|
|
2087
2322
|
|
|
2088
2323
|
export declare const HeaderAuthHydrator: ({ API_ENV, texts }: Props_58) => JSX.Element | null;
|
|
2089
2324
|
|
|
2090
|
-
export declare const HeaderAuthSlot: ({ config,
|
|
2325
|
+
export declare const HeaderAuthSlot: ({ config, className }: Props_57) => JSX.Element | null;
|
|
2091
2326
|
|
|
2092
2327
|
export declare type HeaderAuthTexts = {
|
|
2093
2328
|
/** CTA sin sesión. */
|
|
@@ -2402,6 +2637,12 @@ export declare function insertCkAudioPlayers(html: string): string;
|
|
|
2402
2637
|
/** `true` si la sección está prendida en config. */
|
|
2403
2638
|
export declare const isAccountProfileSectionEnabled: (section: AccountProfileSection, cfg: AccountProfileSectionToggles) => boolean;
|
|
2404
2639
|
|
|
2640
|
+
/**
|
|
2641
|
+
* `true` si `/buscar` usa el buscador client. Lo usa el router de `buscar` del
|
|
2642
|
+
* sitio para dejar de pedir `searchData` en el SSR (la isla lo pide sola).
|
|
2643
|
+
*/
|
|
2644
|
+
export declare function isBuscarClientEnabled(cfg?: Pick<LibraryConfig, 'CONFIG_buscarClient'>): boolean;
|
|
2645
|
+
|
|
2405
2646
|
export declare function isConfigOriginAuditEnabled(): boolean;
|
|
2406
2647
|
|
|
2407
2648
|
/**
|
|
@@ -2669,6 +2910,31 @@ export declare type LibraryConfig = {
|
|
|
2669
2910
|
* Default `undefined` -> paginacion clasica, comportamiento actual.
|
|
2670
2911
|
*/
|
|
2671
2912
|
CONFIG_listLoadMore?: boolean | ListLoadMoreConfig;
|
|
2913
|
+
/**
|
|
2914
|
+
* [buscar] Buscador client-side (CSR): `/buscar` deja de pedir la busqueda en
|
|
2915
|
+
* el SSR y la hace una isla (`<BuscarClient>`) desde el browser, directo a
|
|
2916
|
+
* `/hit` por CDN. Submit sin recargar (`pushState`), skeleton, fallback a
|
|
2917
|
+
* "Ultimas Noticias" y boton "Ver mas".
|
|
2918
|
+
*
|
|
2919
|
+
* `true` lo prende con los defaults; la forma larga ({@link BuscarClientConfig})
|
|
2920
|
+
* permite ajustar lote, "Ver mas", preview y los params del pedido.
|
|
2921
|
+
*
|
|
2922
|
+
* Prenderlo NO cambia nada por si solo: el sitio lo cablea en su
|
|
2923
|
+
* `buscar.astro` (rutas y `<script>` de Astro no se declaran desde un paquete):
|
|
2924
|
+
* - `getBuscarClientProps(...)` devuelve las props de la isla, o `null` con el
|
|
2925
|
+
* toggle apagado (y ahi el `.astro` sigue con su buscador SSR);
|
|
2926
|
+
* - CSS: `ui/components/pages/buscar/client/buscar-client.css` inline y
|
|
2927
|
+
* `buscar-results.css` (raiz del paquete) diferido;
|
|
2928
|
+
* - el router de `buscar` deja de pedir `searchData` si
|
|
2929
|
+
* `isBuscarClientEnabled()`.
|
|
2930
|
+
*
|
|
2931
|
+
* OJO: la isla pega a `/hit` desde el browser, asi que
|
|
2932
|
+
* `PUBLIC_X_SECURITY_TOKEN` viaja en el HTML de `/buscar` (como en la rama
|
|
2933
|
+
* `cdnDirect` de `CONFIG_listLoadMore`). El WAF token no.
|
|
2934
|
+
*
|
|
2935
|
+
* Default `undefined` -> buscador SSR, comportamiento actual.
|
|
2936
|
+
*/
|
|
2937
|
+
CONFIG_buscarClient?: boolean | BuscarClientConfig;
|
|
2672
2938
|
/**
|
|
2673
2939
|
* [render] Fecha relativa ("hace 3 horas") en las superficies que emiten
|
|
2674
2940
|
* `data-rel-ts`. Solo lo lee el hidratador `initRelativeTime` en el cliente:
|
|
@@ -3064,7 +3330,7 @@ export declare type LoadMoreCmsRequest = {
|
|
|
3064
3330
|
declare const Location_2: FC<Props_24>;
|
|
3065
3331
|
export { Location_2 as Location }
|
|
3066
3332
|
|
|
3067
|
-
/** CTA "Ingresar": lo
|
|
3333
|
+
/** CTA "Ingresar": lo pinta el portal de `HeaderAuthHydrator` sin sesión. */
|
|
3068
3334
|
export declare const LoginButton: ({ href, label, }: {
|
|
3069
3335
|
href: string;
|
|
3070
3336
|
label: string;
|
|
@@ -3171,6 +3437,9 @@ declare type MasNoticiasLazyLoaderProps = {
|
|
|
3171
3437
|
fetchConfig: FetchConfig;
|
|
3172
3438
|
};
|
|
3173
3439
|
|
|
3440
|
+
/** Tope de la query: misma clave de cache, URL y `<title>` en los dos lados. */
|
|
3441
|
+
export declare const MAX_SEARCH_QUERY_LENGTH = 120;
|
|
3442
|
+
|
|
3174
3443
|
export declare interface MenuResponse {
|
|
3175
3444
|
description: string;
|
|
3176
3445
|
alt: string;
|
|
@@ -3707,6 +3976,8 @@ export declare type NormalizeRankingOptions = {
|
|
|
3707
3976
|
*/
|
|
3708
3977
|
export declare const normalizeRankingResponse: <T>(response: T, options?: NormalizeRankingOptions) => T;
|
|
3709
3978
|
|
|
3979
|
+
export declare const normalizeSearchQuery: (raw: string) => string;
|
|
3980
|
+
|
|
3710
3981
|
export declare const NOTA_PRERENDER_CLASS = "nota-prerender";
|
|
3711
3982
|
|
|
3712
3983
|
export declare type NoteShare = {
|
|
@@ -3828,6 +4099,9 @@ export declare function parseConfigOriginCacheKey(cacheKey: string): {
|
|
|
3828
4099
|
/** JSON crudo -> usuario (lo usa el mock de dev `CONFIG_authMockUser`). */
|
|
3829
4100
|
export declare const parseCoreAuthUser: (raw: string | null) => CoreAuthUser | null;
|
|
3830
4101
|
|
|
4102
|
+
/** `null` si el cuerpo no tiene la forma del 200 del contrato. */
|
|
4103
|
+
export declare function parsePerfil(raw: unknown): Perfil | null;
|
|
4104
|
+
|
|
3831
4105
|
export declare const parseTags: (keywords: any) => string;
|
|
3832
4106
|
|
|
3833
4107
|
export declare const pathnameSplit: (pathname: string) => {
|
|
@@ -3835,6 +4109,71 @@ export declare const pathnameSplit: (pathname: string) => {
|
|
|
3835
4109
|
path: string;
|
|
3836
4110
|
};
|
|
3837
4111
|
|
|
4112
|
+
/** Respuesta 200 de `perfil-get`. */
|
|
4113
|
+
export declare type Perfil = {
|
|
4114
|
+
sitio: string;
|
|
4115
|
+
notas_en_historial: number;
|
|
4116
|
+
notas_usadas: number;
|
|
4117
|
+
notas_sin_vector: string[];
|
|
4118
|
+
intereses_probables: PerfilInteres[];
|
|
4119
|
+
entidades_leidas: PerfilEntidadLeida[];
|
|
4120
|
+
};
|
|
4121
|
+
|
|
4122
|
+
/** `<sub>` del contrato: UUID en minusculas, sin normalizar. */
|
|
4123
|
+
export declare const PERFIL_SUB_RE: RegExp;
|
|
4124
|
+
|
|
4125
|
+
export declare type PerfilEntidadLeida = {
|
|
4126
|
+
entidad_id: string;
|
|
4127
|
+
nombre: string;
|
|
4128
|
+
tipo: string;
|
|
4129
|
+
/** En cuantas notas leidas aparece. */
|
|
4130
|
+
notas: number;
|
|
4131
|
+
};
|
|
4132
|
+
|
|
4133
|
+
export declare type PerfilInteres = {
|
|
4134
|
+
entidad_id: string;
|
|
4135
|
+
nombre: string;
|
|
4136
|
+
tipo: string;
|
|
4137
|
+
/** `1 - distancia coseno`; mayor es mas cercano. */
|
|
4138
|
+
puntaje: number;
|
|
4139
|
+
};
|
|
4140
|
+
|
|
4141
|
+
/**
|
|
4142
|
+
* Lo que la seccion necesita saber de la respuesta. Los codigos de error son los del
|
|
4143
|
+
* contrato (§4):
|
|
4144
|
+
* - `ok`: 200 con la forma esperada.
|
|
4145
|
+
* - `empty`: 404 `sin_historial` (no hay lecturas de la cuenta) o `sin_vectores` (ninguna
|
|
4146
|
+
* nota leida se ingirio todavia).
|
|
4147
|
+
* - `unavailable`: no hay a quien pedir o el pedido no puede andar repitiendolo: sin ruta,
|
|
4148
|
+
* `sub` sin forma de UUID, 404 `sitio_sin_salt` (o un 404 sin codigo del contrato, como el
|
|
4149
|
+
* de una ruta que no existe) y 400.
|
|
4150
|
+
* - `error`: 500 (el contrato dice que el front puede reintentar), cualquier otro status, red
|
|
4151
|
+
* caida, CORS, timeout o una respuesta con otra forma. Se ofrece reintentar.
|
|
4152
|
+
*/
|
|
4153
|
+
export declare type PerfilResult = {
|
|
4154
|
+
kind: 'ok';
|
|
4155
|
+
perfil: Perfil;
|
|
4156
|
+
} | {
|
|
4157
|
+
kind: 'empty';
|
|
4158
|
+
reason: 'sin_historial' | 'sin_vectores';
|
|
4159
|
+
} | {
|
|
4160
|
+
kind: 'unavailable';
|
|
4161
|
+
reason: string;
|
|
4162
|
+
} | {
|
|
4163
|
+
kind: 'error';
|
|
4164
|
+
reason: string;
|
|
4165
|
+
};
|
|
4166
|
+
|
|
4167
|
+
/** Lo que muestra el panel de debug, igual que `/debug/preferencias` del sitio. */
|
|
4168
|
+
export declare type PerfilTrace = {
|
|
4169
|
+
/** `''` si no se pidio nada. */
|
|
4170
|
+
url: string;
|
|
4171
|
+
status: number | null;
|
|
4172
|
+
ms: number | null;
|
|
4173
|
+
/** Cuerpo crudo (texto) de la respuesta, si la hubo. */
|
|
4174
|
+
body: string | null;
|
|
4175
|
+
};
|
|
4176
|
+
|
|
3838
4177
|
/**
|
|
3839
4178
|
* Selecciona la variante de HTML del banner según el scope.
|
|
3840
4179
|
* - Si el value no tiene markers [tag]...[/tag] → devuelve value as-is (legacy).
|
|
@@ -4517,6 +4856,10 @@ declare type Props_56 = {
|
|
|
4517
4856
|
declare type Props_57 = {
|
|
4518
4857
|
/** Default: `getConfig()` (singleton del server). */
|
|
4519
4858
|
config?: CoreAuthConfig;
|
|
4859
|
+
/**
|
|
4860
|
+
* @deprecated El SSR ya no pinta texto. Los textos se pasan a
|
|
4861
|
+
* `HeaderAuthHydrator`.
|
|
4862
|
+
*/
|
|
4520
4863
|
texts?: Partial<HeaderAuthTexts>;
|
|
4521
4864
|
/** Clase extra del contenedor (layout del header del sitio). */
|
|
4522
4865
|
className?: string;
|
|
@@ -4530,6 +4873,11 @@ declare type Props_58 = {
|
|
|
4530
4873
|
|
|
4531
4874
|
declare type Props_59 = {
|
|
4532
4875
|
user: CoreAuthUser | null;
|
|
4876
|
+
/**
|
|
4877
|
+
* Hay cookie de sesión pero `user` todavía no llegó de la API: avatar vacío
|
|
4878
|
+
* (no "Ingresar").
|
|
4879
|
+
*/
|
|
4880
|
+
pending?: boolean;
|
|
4533
4881
|
loginHref: string;
|
|
4534
4882
|
/** URL de la página de cuenta. `null`: el avatar va al login. */
|
|
4535
4883
|
accountUrl: string | null;
|
|
@@ -4942,9 +5290,35 @@ export declare function resolveBucketMenuSubtype(path?: string): string;
|
|
|
4942
5290
|
*/
|
|
4943
5291
|
export declare function resolveBucketOriginUrl(bucket: BucketOriginConfig, servicePrefix: string | undefined, type: 'menu' | 'banners' | 'bloques', subtype: string, offline?: boolean): string;
|
|
4944
5292
|
|
|
5293
|
+
/**
|
|
5294
|
+
* El toggle del buscador client con los defaults aplicados, o `null` si el sitio
|
|
5295
|
+
* no lo prendio. Fuente UNICA de la resolucion: la consumen
|
|
5296
|
+
* `getBuscarClientProps` e `isBuscarClientEnabled`.
|
|
5297
|
+
*/
|
|
5298
|
+
export declare function resolveBuscarClient(cfg?: Pick<LibraryConfig, 'CONFIG_buscarClient'>): ResolvedBuscarClient | null;
|
|
5299
|
+
|
|
4945
5300
|
/** `cfg` de la isla (prop) con fallback al singleton. */
|
|
4946
5301
|
export declare const resolveCoreAuthConfig: (cfg?: CoreAuthConfig) => CoreAuthConfig;
|
|
4947
5302
|
|
|
5303
|
+
/**
|
|
5304
|
+
* {@link BuscarClientConfig} con los defaults ya aplicados. Lo que depende del
|
|
5305
|
+
* sitio y no de `LibraryConfig` (`newsType`, `imageSizes`, `endpointBase`,
|
|
5306
|
+
* `debug`) queda `undefined` si el sitio no lo fijo: lo completa
|
|
5307
|
+
* `getBuscarClientProps`.
|
|
5308
|
+
*/
|
|
5309
|
+
export declare type ResolvedBuscarClient = {
|
|
5310
|
+
size: number;
|
|
5311
|
+
lastNewsSize: number;
|
|
5312
|
+
loadMore: boolean;
|
|
5313
|
+
maxPages: number;
|
|
5314
|
+
preview: boolean;
|
|
5315
|
+
exclude: string;
|
|
5316
|
+
newsType?: string;
|
|
5317
|
+
imageSizes?: string;
|
|
5318
|
+
endpointBase?: string;
|
|
5319
|
+
debug?: boolean;
|
|
5320
|
+
};
|
|
5321
|
+
|
|
4948
5322
|
/** {@link ListLoadMoreConfig} con todos los defaults ya aplicados. */
|
|
4949
5323
|
export declare type ResolvedListLoadMore = {
|
|
4950
5324
|
routes: readonly ListingRoute[];
|
|
@@ -5014,6 +5388,30 @@ export declare function runConfigOriginComparison(params: {
|
|
|
5014
5388
|
*/
|
|
5015
5389
|
export declare const sanitizeRichText: (html?: string | null) => string;
|
|
5016
5390
|
|
|
5391
|
+
/**
|
|
5392
|
+
* Guarda nombre y apellido: `POST /api/auth/update-profile` del sitio (Cognito
|
|
5393
|
+
* `UpdateUserAttributes` con el access token httpOnly). Si sale bien, actualiza
|
|
5394
|
+
* el cache de la pestaña y emite `core-auth:changed` (el header cambia nombre e
|
|
5395
|
+
* inicial sin recargar).
|
|
5396
|
+
*
|
|
5397
|
+
* Con el mock de dev (`CONFIG_authMockUser`) no llama al endpoint: devuelve el
|
|
5398
|
+
* usuario con los nombres nuevos.
|
|
5399
|
+
*/
|
|
5400
|
+
export declare const saveCoreAuthProfile: (current: CoreAuthUser, changes: {
|
|
5401
|
+
firstname: string;
|
|
5402
|
+
lastname: string;
|
|
5403
|
+
}, cfg?: CoreAuthConfig) => Promise<SaveCoreAuthProfileResult>;
|
|
5404
|
+
|
|
5405
|
+
export declare type SaveCoreAuthProfileResult = {
|
|
5406
|
+
ok: true;
|
|
5407
|
+
user: CoreAuthUser;
|
|
5408
|
+
} | {
|
|
5409
|
+
ok: false;
|
|
5410
|
+
/** `SESSION_EXPIRED`, `INVALID_NAME`, `NOT_ALLOWED`, `NETWORK` u otro de Cognito. */
|
|
5411
|
+
code: string;
|
|
5412
|
+
error?: string;
|
|
5413
|
+
};
|
|
5414
|
+
|
|
5017
5415
|
/**
|
|
5018
5416
|
* Regla única de schemas: con `PUBLIC_IS_OFFLINE === 'true'` no se pide ni se
|
|
5019
5417
|
* pinta ningún JSON-LD (head, videos embebidos en el body ni
|
|
@@ -5030,6 +5428,9 @@ declare type ScriptProps = {
|
|
|
5030
5428
|
strategy?: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive' | 'worker' | undefined;
|
|
5031
5429
|
};
|
|
5032
5430
|
|
|
5431
|
+
/** `page` es 1-based: la 1 es la del submit, de la 2 en adelante las pide "Ver mas". */
|
|
5432
|
+
export declare function searchNewsClient(env: BuscarClientEnv, rawQuery: string, page?: number): Promise<BuscarSearchItem[]>;
|
|
5433
|
+
|
|
5033
5434
|
export declare const SearchSection: FC<Props_14>;
|
|
5034
5435
|
|
|
5035
5436
|
export declare const Section: ForwardRefExoticComponent<SectionProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -5183,6 +5584,10 @@ export declare function shouldDisablePagination(route: string, cfg?: Pick<Librar
|
|
|
5183
5584
|
|
|
5184
5585
|
export declare const ShowSection: FC<Props_26>;
|
|
5185
5586
|
|
|
5587
|
+
declare type SiteTexts = {
|
|
5588
|
+
[key: string]: string | undefined;
|
|
5589
|
+
};
|
|
5590
|
+
|
|
5186
5591
|
declare interface Size {
|
|
5187
5592
|
size: string;
|
|
5188
5593
|
url: string;
|