template-common 1.1.1 → 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 +449 -41
- package/dist/sass-template-common.js +7315 -6432
- package/dist/sass-template-common.umd.cjs +41 -41
- 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,15 +39,20 @@ 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;
|
|
49
|
+
/** Chips visibles por lista antes de "Mostrar más N". Default 8. */
|
|
50
|
+
preferenceCollapseAt?: number;
|
|
46
51
|
/** Opciones de "Newsletters". Default: lista genérica de la lib. */
|
|
47
52
|
newsletterItems?: AccountProfileNewsletterItem[];
|
|
48
53
|
/**
|
|
49
|
-
* Panel debug de "Newsletters". Default: visible fuera
|
|
50
|
-
* `?debug` en la URL.
|
|
54
|
+
* Panel debug de "Mis preferencias" y "Newsletters". Default: visible fuera
|
|
55
|
+
* de prod, o con `?debug` en la URL.
|
|
51
56
|
*/
|
|
52
57
|
debug?: boolean;
|
|
53
58
|
};
|
|
@@ -69,23 +74,20 @@ export declare type AccountProfileNewsletterItem = {
|
|
|
69
74
|
frequency?: string;
|
|
70
75
|
};
|
|
71
76
|
|
|
77
|
+
/** Un chip: una entidad de `perfil-get` (`entidad_id`, `nombre`, `tipo`). */
|
|
72
78
|
export declare type AccountProfilePreferenceItem = {
|
|
73
79
|
id: string;
|
|
74
80
|
label: string;
|
|
75
81
|
kind: AccountProfilePreferenceKind;
|
|
76
|
-
/** Afinidad para recomendar: seguir un ítem sube a los del mismo grupo. */
|
|
77
|
-
group?: string;
|
|
78
|
-
/** Foto (autores). Sin imagen: iniciales. */
|
|
79
|
-
image?: string;
|
|
80
|
-
/** Marca "Nuevo" en la sugerencia. */
|
|
81
|
-
isNew?: boolean;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* Tipos
|
|
86
|
-
*
|
|
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`).
|
|
87
88
|
*/
|
|
88
|
-
|
|
89
|
+
/** El `tipo` de la entidad que devuelve `perfil-get` (hoy `tag`). */
|
|
90
|
+
export declare type AccountProfilePreferenceKind = string;
|
|
89
91
|
|
|
90
92
|
/** Secciones de la página de cuenta. Cada una es su propia ruta en el sitio. */
|
|
91
93
|
export declare type AccountProfileSection = 'config' | 'preferences' | 'newsletters';
|
|
@@ -108,6 +110,10 @@ export declare type AccountProfileTexts = {
|
|
|
108
110
|
saveButton: string;
|
|
109
111
|
sendingLabel: string;
|
|
110
112
|
savingLabel: string;
|
|
113
|
+
/** Nombre/apellido guardados. */
|
|
114
|
+
saveSuccess: string;
|
|
115
|
+
saveError: string;
|
|
116
|
+
errorNameRequired: string;
|
|
111
117
|
showPassword: string;
|
|
112
118
|
hidePassword: string;
|
|
113
119
|
sendCodeError: string;
|
|
@@ -117,26 +123,35 @@ export declare type AccountProfileTexts = {
|
|
|
117
123
|
gnewsHintPrefix: string;
|
|
118
124
|
gnewsHintSuffix: string;
|
|
119
125
|
prefsTitle: string;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
/** `{{topics}}` se reemplaza por la lista de temas ("A, B y C"). */
|
|
127
|
+
prefsSummary: string;
|
|
128
|
+
prefsSummaryEmpty: string;
|
|
129
|
+
prefsMoreTitle: string;
|
|
130
|
+
prefsMoreHint: string;
|
|
131
|
+
prefsLessTitle: string;
|
|
132
|
+
prefsLessHint: string;
|
|
133
|
+
prefsExpand: string;
|
|
134
|
+
prefsCollapse: string;
|
|
135
|
+
prefsAdd: string;
|
|
136
|
+
prefsAddPlaceholder: string;
|
|
137
|
+
prefsSuggestedAria: string;
|
|
138
|
+
prefsEditAria: string;
|
|
139
|
+
prefsSourceAdded: string;
|
|
140
|
+
prefsSourceActivity: string;
|
|
141
|
+
prefsMoveToLess: string;
|
|
142
|
+
prefsMoveToMore: string;
|
|
143
|
+
prefsRemove: string;
|
|
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;
|
|
140
155
|
newslettersTitle: string;
|
|
141
156
|
newslettersDesc: string;
|
|
142
157
|
newslettersFootnote: string;
|
|
@@ -147,6 +162,11 @@ export declare type AccountProfileTexts = {
|
|
|
147
162
|
debugStorageKey: string;
|
|
148
163
|
debugUpdatedAt: string;
|
|
149
164
|
debugNever: string;
|
|
165
|
+
debugReset: string;
|
|
166
|
+
debugUrl: string;
|
|
167
|
+
debugStatus: string;
|
|
168
|
+
debugMs: string;
|
|
169
|
+
debugNoRequest: string;
|
|
150
170
|
changePasswordButton: string;
|
|
151
171
|
/** `{{email}}` se reemplaza por el email enmascarado. */
|
|
152
172
|
changePasswordMessage: string;
|
|
@@ -253,7 +273,7 @@ export declare interface Author {
|
|
|
253
273
|
*/
|
|
254
274
|
export declare type AuthorSocialNetwork = 'tiktok' | 'youtube' | 'pinterest';
|
|
255
275
|
|
|
256
|
-
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;
|
|
257
277
|
|
|
258
278
|
export declare const AutorHeader1: FC<Props_46>;
|
|
259
279
|
|
|
@@ -575,6 +595,177 @@ export declare const buildVideoUrlFromInternal: (internal: string, options?: {
|
|
|
575
595
|
title?: string;
|
|
576
596
|
}) => string;
|
|
577
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
|
+
|
|
578
769
|
declare interface ButtonCSS {
|
|
579
770
|
'--button-background-color'?: string;
|
|
580
771
|
'--button-color'?: string;
|
|
@@ -625,6 +816,9 @@ export declare const CarruselOpinion: FC<SectionCardCarouselProps>;
|
|
|
625
816
|
/** Corre `resolveImageSizes` y reduce el resultado a pass/fail para CI. */
|
|
626
817
|
export declare function checkImageSizes(input: ImageSizesContractInput | undefined): ImageSizesCheckReport;
|
|
627
818
|
|
|
819
|
+
/** Status + cuerpo -> resultado, segun la tabla de respuestas del contrato (§4). */
|
|
820
|
+
export declare function classifyPerfil(status: number, body: unknown): PerfilResult;
|
|
821
|
+
|
|
628
822
|
/**
|
|
629
823
|
* Recorre recursivamente un schema (objeto o array) y elimina toda entry
|
|
630
824
|
* que quede sin valor. Si una propiedad de un objeto queda sin valor, la
|
|
@@ -1178,6 +1372,9 @@ export declare const CORE_AUTH_CHANGED_EVENT = "core-auth:changed";
|
|
|
1178
1372
|
/** Claves de config que usa el login del header y la página de cuenta. */
|
|
1179
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"];
|
|
1180
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
|
+
|
|
1181
1378
|
export declare type CoreAuthConfig = Pick<LibraryConfig, (typeof CORE_AUTH_CONFIG_KEYS)[number]>;
|
|
1182
1379
|
|
|
1183
1380
|
export declare type CoreAuthUser = {
|
|
@@ -1650,6 +1847,19 @@ declare type FetchMoreArgs = {
|
|
|
1650
1847
|
|
|
1651
1848
|
export declare function fetchMoreNews({ endpoint, route, slug, page, size, direct, }: FetchMoreArgs): Promise<MoreNewsPage>;
|
|
1652
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
|
+
|
|
1653
1863
|
/**
|
|
1654
1864
|
* Cache in-memory + deduplicación de requests en vuelo (misma clave → misma promesa).
|
|
1655
1865
|
* TTL corto pensado para SSR: evita 4–5 GETs repetidos de menú/banners por instancia.
|
|
@@ -1871,6 +2081,33 @@ export declare function GenerateHead({ axiosApi, headConfig: headConfigInput, me
|
|
|
1871
2081
|
/** Cliente axios compartido por origen de bucket (keep-alive en Node SSR). */
|
|
1872
2082
|
export declare function getBucketHttpClient(baseUrl: string, referer: string): AxiosInstance;
|
|
1873
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
|
+
|
|
1874
2111
|
/**
|
|
1875
2112
|
* Busca en un dict keyed por nombre de bloque (SlotComponents, stylesConfig,
|
|
1876
2113
|
* imgSizes). Match exacto primero; si no, compara nombres normalizados para que
|
|
@@ -1923,8 +2160,6 @@ export declare const getCoreAuthInitials: (user: CoreAuthUser) => string;
|
|
|
1923
2160
|
|
|
1924
2161
|
export declare const getDefaultNewsletterItems: (lng?: string) => AccountProfileNewsletterItem[];
|
|
1925
2162
|
|
|
1926
|
-
export declare const getDefaultPreferenceItems: (lng?: string) => AccountProfilePreferenceItem[];
|
|
1927
|
-
|
|
1928
2163
|
export declare const getDynamicSlots: (axiosApi: AxiosInstance, config: Config, imgSizes: {
|
|
1929
2164
|
[key: string]: any;
|
|
1930
2165
|
}, imageSizes: ImageSizesContractInput | undefined, DYNAMIC_SLOT_TOTAL: number, DYNAMIC_SLOT_SUBINDEXES: number, exclude?: string) => Promise<{
|
|
@@ -1943,6 +2178,9 @@ export declare const getImageUrl: (imageUrl: string) => Promise<string>;
|
|
|
1943
2178
|
|
|
1944
2179
|
export declare const getItemFormated: (item: NewListResponseData, commonServices: CommonServices, imgSize: string) => Promise<ItemFormatedType>;
|
|
1945
2180
|
|
|
2181
|
+
/** "Ultimas Noticias" para cuando la busqueda no trae nada o falla. */
|
|
2182
|
+
export declare function getLastNewsClient(env: BuscarClientEnv): Promise<BuscarSearchItem[]>;
|
|
2183
|
+
|
|
1946
2184
|
export declare const getNextMeta: (config: Config, paths: Array<string>, page: number) => string;
|
|
1947
2185
|
|
|
1948
2186
|
export declare const getPage: (pathname: string) => number;
|
|
@@ -2084,7 +2322,7 @@ export declare const HEADER_AUTH_TEXTS: Record<'es' | 'en', HeaderAuthTexts>;
|
|
|
2084
2322
|
|
|
2085
2323
|
export declare const HeaderAuthHydrator: ({ API_ENV, texts }: Props_58) => JSX.Element | null;
|
|
2086
2324
|
|
|
2087
|
-
export declare const HeaderAuthSlot: ({ config,
|
|
2325
|
+
export declare const HeaderAuthSlot: ({ config, className }: Props_57) => JSX.Element | null;
|
|
2088
2326
|
|
|
2089
2327
|
export declare type HeaderAuthTexts = {
|
|
2090
2328
|
/** CTA sin sesión. */
|
|
@@ -2399,6 +2637,12 @@ export declare function insertCkAudioPlayers(html: string): string;
|
|
|
2399
2637
|
/** `true` si la sección está prendida en config. */
|
|
2400
2638
|
export declare const isAccountProfileSectionEnabled: (section: AccountProfileSection, cfg: AccountProfileSectionToggles) => boolean;
|
|
2401
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
|
+
|
|
2402
2646
|
export declare function isConfigOriginAuditEnabled(): boolean;
|
|
2403
2647
|
|
|
2404
2648
|
/**
|
|
@@ -2666,6 +2910,31 @@ export declare type LibraryConfig = {
|
|
|
2666
2910
|
* Default `undefined` -> paginacion clasica, comportamiento actual.
|
|
2667
2911
|
*/
|
|
2668
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;
|
|
2669
2938
|
/**
|
|
2670
2939
|
* [render] Fecha relativa ("hace 3 horas") en las superficies que emiten
|
|
2671
2940
|
* `data-rel-ts`. Solo lo lee el hidratador `initRelativeTime` en el cliente:
|
|
@@ -3061,7 +3330,7 @@ export declare type LoadMoreCmsRequest = {
|
|
|
3061
3330
|
declare const Location_2: FC<Props_24>;
|
|
3062
3331
|
export { Location_2 as Location }
|
|
3063
3332
|
|
|
3064
|
-
/** CTA "Ingresar": lo
|
|
3333
|
+
/** CTA "Ingresar": lo pinta el portal de `HeaderAuthHydrator` sin sesión. */
|
|
3065
3334
|
export declare const LoginButton: ({ href, label, }: {
|
|
3066
3335
|
href: string;
|
|
3067
3336
|
label: string;
|
|
@@ -3168,6 +3437,9 @@ declare type MasNoticiasLazyLoaderProps = {
|
|
|
3168
3437
|
fetchConfig: FetchConfig;
|
|
3169
3438
|
};
|
|
3170
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
|
+
|
|
3171
3443
|
export declare interface MenuResponse {
|
|
3172
3444
|
description: string;
|
|
3173
3445
|
alt: string;
|
|
@@ -3704,6 +3976,8 @@ export declare type NormalizeRankingOptions = {
|
|
|
3704
3976
|
*/
|
|
3705
3977
|
export declare const normalizeRankingResponse: <T>(response: T, options?: NormalizeRankingOptions) => T;
|
|
3706
3978
|
|
|
3979
|
+
export declare const normalizeSearchQuery: (raw: string) => string;
|
|
3980
|
+
|
|
3707
3981
|
export declare const NOTA_PRERENDER_CLASS = "nota-prerender";
|
|
3708
3982
|
|
|
3709
3983
|
export declare type NoteShare = {
|
|
@@ -3825,6 +4099,9 @@ export declare function parseConfigOriginCacheKey(cacheKey: string): {
|
|
|
3825
4099
|
/** JSON crudo -> usuario (lo usa el mock de dev `CONFIG_authMockUser`). */
|
|
3826
4100
|
export declare const parseCoreAuthUser: (raw: string | null) => CoreAuthUser | null;
|
|
3827
4101
|
|
|
4102
|
+
/** `null` si el cuerpo no tiene la forma del 200 del contrato. */
|
|
4103
|
+
export declare function parsePerfil(raw: unknown): Perfil | null;
|
|
4104
|
+
|
|
3828
4105
|
export declare const parseTags: (keywords: any) => string;
|
|
3829
4106
|
|
|
3830
4107
|
export declare const pathnameSplit: (pathname: string) => {
|
|
@@ -3832,6 +4109,71 @@ export declare const pathnameSplit: (pathname: string) => {
|
|
|
3832
4109
|
path: string;
|
|
3833
4110
|
};
|
|
3834
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
|
+
|
|
3835
4177
|
/**
|
|
3836
4178
|
* Selecciona la variante de HTML del banner según el scope.
|
|
3837
4179
|
* - Si el value no tiene markers [tag]...[/tag] → devuelve value as-is (legacy).
|
|
@@ -4514,6 +4856,10 @@ declare type Props_56 = {
|
|
|
4514
4856
|
declare type Props_57 = {
|
|
4515
4857
|
/** Default: `getConfig()` (singleton del server). */
|
|
4516
4858
|
config?: CoreAuthConfig;
|
|
4859
|
+
/**
|
|
4860
|
+
* @deprecated El SSR ya no pinta texto. Los textos se pasan a
|
|
4861
|
+
* `HeaderAuthHydrator`.
|
|
4862
|
+
*/
|
|
4517
4863
|
texts?: Partial<HeaderAuthTexts>;
|
|
4518
4864
|
/** Clase extra del contenedor (layout del header del sitio). */
|
|
4519
4865
|
className?: string;
|
|
@@ -4527,6 +4873,11 @@ declare type Props_58 = {
|
|
|
4527
4873
|
|
|
4528
4874
|
declare type Props_59 = {
|
|
4529
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;
|
|
4530
4881
|
loginHref: string;
|
|
4531
4882
|
/** URL de la página de cuenta. `null`: el avatar va al login. */
|
|
4532
4883
|
accountUrl: string | null;
|
|
@@ -4939,9 +5290,35 @@ export declare function resolveBucketMenuSubtype(path?: string): string;
|
|
|
4939
5290
|
*/
|
|
4940
5291
|
export declare function resolveBucketOriginUrl(bucket: BucketOriginConfig, servicePrefix: string | undefined, type: 'menu' | 'banners' | 'bloques', subtype: string, offline?: boolean): string;
|
|
4941
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
|
+
|
|
4942
5300
|
/** `cfg` de la isla (prop) con fallback al singleton. */
|
|
4943
5301
|
export declare const resolveCoreAuthConfig: (cfg?: CoreAuthConfig) => CoreAuthConfig;
|
|
4944
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
|
+
|
|
4945
5322
|
/** {@link ListLoadMoreConfig} con todos los defaults ya aplicados. */
|
|
4946
5323
|
export declare type ResolvedListLoadMore = {
|
|
4947
5324
|
routes: readonly ListingRoute[];
|
|
@@ -5011,6 +5388,30 @@ export declare function runConfigOriginComparison(params: {
|
|
|
5011
5388
|
*/
|
|
5012
5389
|
export declare const sanitizeRichText: (html?: string | null) => string;
|
|
5013
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
|
+
|
|
5014
5415
|
/**
|
|
5015
5416
|
* Regla única de schemas: con `PUBLIC_IS_OFFLINE === 'true'` no se pide ni se
|
|
5016
5417
|
* pinta ningún JSON-LD (head, videos embebidos en el body ni
|
|
@@ -5027,6 +5428,9 @@ declare type ScriptProps = {
|
|
|
5027
5428
|
strategy?: 'afterInteractive' | 'lazyOnload' | 'beforeInteractive' | 'worker' | undefined;
|
|
5028
5429
|
};
|
|
5029
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
|
+
|
|
5030
5434
|
export declare const SearchSection: FC<Props_14>;
|
|
5031
5435
|
|
|
5032
5436
|
export declare const Section: ForwardRefExoticComponent<SectionProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -5180,6 +5584,10 @@ export declare function shouldDisablePagination(route: string, cfg?: Pick<Librar
|
|
|
5180
5584
|
|
|
5181
5585
|
export declare const ShowSection: FC<Props_26>;
|
|
5182
5586
|
|
|
5587
|
+
declare type SiteTexts = {
|
|
5588
|
+
[key: string]: string | undefined;
|
|
5589
|
+
};
|
|
5590
|
+
|
|
5183
5591
|
declare interface Size {
|
|
5184
5592
|
size: string;
|
|
5185
5593
|
url: string;
|