sass-template-common 0.10.13 → 0.10.15

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.
@@ -244,10 +244,53 @@ export declare type BucketOriginConfig = {
244
244
  proxyUrl?: string;
245
245
  /** Prefijo raíz del cliente dentro del bucket (ej. `'debate'`). */
246
246
  clientName: string;
247
- /** Sirve el menú (sidebar/menu/footer/freeZone/cintillo + equipos/sites) desde el bucket. */
247
+ /**
248
+ * Sirve el menú (sidebar/menu/footer/freeZone/cintillo + equipos/sites) desde
249
+ * el bucket. Con el toggle ON, SIN fallback a CMS: si el bucket agota los 4
250
+ * intentos, se sirve vacío + registro en el debugPanel (`reportBucketOriginExhausted`).
251
+ */
248
252
  menu?: boolean;
249
- /** Sirve los banners (home/seccion/nota) desde el bucket. */
253
+ /**
254
+ * Sirve los banners (home/seccion/nota) desde el bucket. Con el toggle ON, SIN
255
+ * fallback a CMS: si el bucket agota los 4 intentos, se sirve vacío + registro
256
+ * en el debugPanel.
257
+ */
250
258
  banners?: boolean;
259
+ /**
260
+ * [transicional] Sirve la config de los slots dinámicos de home
261
+ * (`bloques/modulos-dinamicos/modulos-dinamicos.json`) desde el bucket en
262
+ * lugar del fan-out N contra `/config/blocks-saas`. Toggle de migración: al
263
+ * pasar todos los sitios a `true`, la rama legacy CMS se elimina y el toggle
264
+ * queda no-op (luego se remueve). El JSON keyea plano `Home_N` (sin subíndices);
265
+ * cada entry se resuelve con `resolveSlotContent` (content-fetch al CMS igual
266
+ * que legacy). SIN fallback de CONFIG a CMS: con el toggle ON el bucket es el
267
+ * método único; si agota los 4 intentos, los slots se sirven vacíos y se
268
+ * registra en el debugPanel (`reportBucketOriginExhausted`) para notar la falla.
269
+ * El fan-out CMS solo corre con el toggle OFF (sitios sin migrar).
270
+ * Ver `PLAN_DYNAMIC_SLOTS_BUCKET_ORIGIN.md` §4.3/§7.
271
+ */
272
+ slots?: boolean;
273
+ /**
274
+ * [transicional] Sirve la config del destacado dinámico
275
+ * (`bloques/destacado/destacado.json`) desde el bucket en lugar de
276
+ * `/config/blocks`. Es drop-in de TRANSPORTE (mismo `.data.data` que el CMS).
277
+ * ⚠ CONTRATO (verificado contra un sitio CMS funcional, golfo): el LAYOUT del
278
+ * destacado va en `data[0].block`, que debe ser uno de los 5 nombres de layout
279
+ * (`Diario` | `Diario con imagen` | `Super` | `3 notas verticales` |
280
+ * `3 notas horizontales`) — es la key que consume `DynamicMainSlot` vía el prop
281
+ * `component`. Los campos `value`/`size`/`title`/`link` NO los usa el destacado
282
+ * (en el CMS vuelven como tokens sin rellenar) → se ignoran. (Nota: existe
283
+ * `getMainBlockData`, que lee `value` contra `GetByOptions`, pero es otra ruta
284
+ * que el render vivo de golfo no usa.)
285
+ * El CONTENIDO (las notas) SIEMPRE sale del CMS (zona `destacadas`, sección
286
+ * provista por la app) — permanente, no transicional: este toggle solo mueve el
287
+ * ORIGEN DE LA CONFIG (bucket vs CMS), nunca el contenido. SIN fallback de CONFIG
288
+ * a CMS: con el toggle ON el bucket es el método único; si agota los 4 intentos,
289
+ * el destacado se sirve vacío y se registra en el debugPanel (`reportBucketOriginExhausted`).
290
+ * El CMS solo sirve la config con el toggle OFF (sitios sin migrar).
291
+ * Ver `PLAN_DYNAMIC_SLOTS_BUCKET_ORIGIN.md` §4.4/§7.
292
+ */
293
+ destacado?: boolean;
251
294
  /**
252
295
  * Referer exigido por la bucket policy (`aws:Referer`). Sin este header el
253
296
  * bucket devuelve 403 aunque la ruta/archivo exista. Default: el mismo
@@ -532,9 +575,7 @@ export declare class CommonServices {
532
575
  getEntitySection: (params: Params) => Promise<AxiosResponse<{
533
576
  data: Array<NewListResponse>;
534
577
  }, any, {}>> | undefined;
535
- getMainMenu: (params: Params) => Promise<AxiosResponse<{
536
- data: Array<MenuResponse>;
537
- }, any, {}> | {
578
+ getMainMenu: (params: Params) => Promise<{
538
579
  data: {
539
580
  data: Array<MenuResponse>;
540
581
  };
@@ -562,9 +603,7 @@ export declare class CommonServices {
562
603
  getVideosList: (params: Params) => Promise<AxiosResponse<{
563
604
  data: Array<VideoResponseData>;
564
605
  }, any, {}>> | undefined;
565
- getBanners: (params: Params) => Promise<AxiosResponse<{
566
- data: Array<BannerResponse>;
567
- }, any, {}> | {
606
+ getBanners: (params: Params) => Promise<{
568
607
  data: {
569
608
  data: Array<BannerResponse>;
570
609
  };
@@ -1008,9 +1047,28 @@ export declare class DynamicBlockServices extends CommonServices {
1008
1047
  } | {
1009
1048
  blockSass: BlockSaasResponse[] | undefined;
1010
1049
  }>;
1050
+ /**
1051
+ * Dada la config de UN slot (`BlockSaasResponse[]`, se usa `[0]`), dispara el
1052
+ * content-fetch que corresponda (`videos`/`tag`/`seccion`) y devuelve
1053
+ * `{ blockSass, content? }`. Extraído de `getBlockSass` para reusarse tanto
1054
+ * desde la rama legacy (CMS `/config/blocks-saas`) como desde la rama de
1055
+ * bucket (`modulos-dinamicos.json`, ver `getDynamicSlotsFromBucket`): el
1056
+ * origen del array cambia, el resto de la resolución de contenido no.
1057
+ */
1058
+ resolveSlotContent: (blockSassData: Array<BlockSaasResponse> | undefined) => Promise<{
1059
+ blockSass: BlockSaasResponse[];
1060
+ content: {
1061
+ data: Array<VideoResponseData>;
1062
+ } | undefined;
1063
+ } | {
1064
+ blockSass: BlockSaasResponse[];
1065
+ content: NewListResponse | undefined;
1066
+ } | {
1067
+ blockSass: BlockSaasResponse[] | undefined;
1068
+ }>;
1011
1069
  }
1012
1070
 
1013
- export declare const DynamicComponents: ({ slots, DYNAMIC_SLOT_SUBINDEXES, stylesConfig, AutorIcon, config, banners, showTagBySection, pathname, }: Props_21) => JSX.Element[];
1071
+ export declare const DynamicComponents: ({ slots, DYNAMIC_SLOT_SUBINDEXES, stylesConfig, AutorIcon, config, banners, showTagBySection, pathname, }: Props_21) => ReactNode[];
1014
1072
 
1015
1073
  export declare const DynamicMainSlot: ({ component, data, banners, rightOnlyBanner, isHome, }: Props_20) => JSX.Element;
1016
1074
 
@@ -1595,12 +1653,12 @@ export declare interface ImageSizesContract {
1595
1653
  cardTall: SizeString;
1596
1654
  square: SizeString;
1597
1655
  gallery: SizeString;
1598
- featuredSuperSecondary: SizeString;
1599
- featuredVerticalPrimary: SizeString;
1600
- featuredVerticalSecondary: SizeString;
1601
- featuredHorizontalPrimary: SizeString;
1602
- featuredHorizontalSecondary: SizeString;
1603
- featuredDiarioImageThumb: SizeString;
1656
+ featuredSuperSecondary?: SizeString;
1657
+ featuredVerticalPrimary?: SizeString;
1658
+ featuredVerticalSecondary?: SizeString;
1659
+ featuredHorizontalPrimary?: SizeString;
1660
+ featuredHorizontalSecondary?: SizeString;
1661
+ featuredDiarioImageThumb?: SizeString;
1604
1662
  };
1605
1663
  author: {
1606
1664
  avatar: SizeString;
@@ -1914,6 +1972,12 @@ export declare type LibraryConfig = {
1914
1972
  * comportamiento no cambia (sigue yendo al CMS). Si un archivo no existe
1915
1973
  * en el bucket para un sitio/tipo dado, el request falla simple (sin
1916
1974
  * fallback automático al CMS) — igual que cualquier otro fetch fallido.
1975
+ *
1976
+ * [offline] Cuando `PUBLIC_IS_OFFLINE === 'true'`, todos los archivos de bucket
1977
+ * se leen de la subcarpeta `offline/` del mismo directorio
1978
+ * (`.../${subtype}/offline/${subtype}.json`) y, si fallan tras agotar
1979
+ * reintentos, NO caen al CMS ni al archivo online: se devuelve vacío. Ver
1980
+ * `resolveBucketOriginUrl`.
1917
1981
  */
1918
1982
  BUCKET_ORIGIN?: BucketOriginConfig;
1919
1983
  };
@@ -1985,9 +2049,11 @@ export declare class MainComponentServices {
1985
2049
  readonly contract: ImageSizesContract;
1986
2050
  constructor(config: Config, imgSizes: any, axiosApi: AxiosInstance, exclude?: string, customMainImagesSizes?: string, imageSizes?: ImageSizesContractInput);
1987
2051
  getNewsListZone(params: Params): Promise<AxiosResponse<NewListResponse, any, {}> | undefined>;
1988
- getOutstandingBlock(params: Params): Promise<AxiosResponse< {
1989
- data: Array<Outstanding>;
1990
- }, any, {}> | undefined>;
2052
+ getOutstandingBlock(params: Params): Promise<{
2053
+ data: {
2054
+ data: Array<Outstanding>;
2055
+ };
2056
+ } | undefined>;
1991
2057
  getNewsListZoneWrapper(section: string, size: number, imagesizes?: string): Promise<AxiosResponse<NewListResponse, any, {}> | undefined>;
1992
2058
  getNewsDestacadoDiario(section: string): Promise<never[] | AxiosResponse<NewListResponse, any, {}>>;
1993
2059
  getNewsDestacadoDiarioImage(section: string): Promise<never[] | AxiosResponse<NewListResponse, any, {}>>;
@@ -3251,6 +3317,18 @@ export declare const REPORT_REASONS: {
3251
3317
  readonly bullying: "Bullying o acoso";
3252
3318
  };
3253
3319
 
3320
+ /**
3321
+ * Registra en el **debugPanel** (`DebugStore`, gated por `DEBUG_ENABLED`) que un
3322
+ * recurso de `BUCKET_ORIGIN` agotó los reintentos. En un sitio con el toggle
3323
+ * prendido, el bucket es el MÉTODO ÚNICO: NO se cae al CMS (eso solo pasa con el
3324
+ * toggle OFF, en sitios sin migrar). El recurso se sirve VACÍO y esta entrada
3325
+ * deja constancia explícita del "servido vacío, sin fallback" para que la falla
3326
+ * se NOTE en el panel en vez de quedar enmascarada. (El fallo de red crudo ya lo
3327
+ * registra `resilientFetch`; esta entrada agrega la decisión de no-fallback.)
3328
+ * Ver `PLAN_DYNAMIC_SLOTS_BUCKET_ORIGIN.md` §7.
3329
+ */
3330
+ export declare function reportBucketOriginExhausted(kind: string, url: string): void;
3331
+
3254
3332
  export declare function reportComment({ publication, username, id, type, baseUrl, captchaToken, apiToken, securityToken, COMMENTS_VARS, }: ReportCommentParams): Promise<{
3255
3333
  type: string;
3256
3334
  message: string;
@@ -3275,9 +3353,9 @@ export declare type ReportReasonKey = keyof typeof REPORT_REASONS;
3275
3353
  /**
3276
3354
  * Grupos requeridos del contrato: los que `resolveImageSizes` completa con el
3277
3355
  * default congelado y el assert exige enteros. Los slots OPCIONALES sin default
3278
- * (como `squareLg`) se excluyen a mano no participan del merge ni del assert
3279
- * obligatorio. Derivado (no hardcode) para que un grupo requerido nuevo entre
3280
- * solo y siga cubierto por el guard de completitud.
3356
+ * obligatorio (`squareLg` a nivel raíz, `featured*` dentro de `note`) se manejan
3357
+ * aparte — no participan del assert obligatorio. Derivado (no hardcode) para que
3358
+ * un grupo requerido nuevo entre solo y siga cubierto por el guard de completitud.
3281
3359
  */
3282
3360
  export declare type RequiredGroup = Exclude<keyof ImageSizesContract, 'squareLg'>;
3283
3361
 
@@ -3309,7 +3387,18 @@ export declare function resolveBatchCount(): number;
3309
3387
 
3310
3388
  export declare function resolveBucketMenuSubtype(path?: string): string;
3311
3389
 
3312
- export declare function resolveBucketOriginUrl(bucket: BucketOriginConfig, servicePrefix: string | undefined, type: 'menu' | 'banners', subtype: string): string;
3390
+ /**
3391
+ * Arma la URL del recurso en el bucket:
3392
+ * `${base}/${clientName}/${site}/${type}/${subtype}/${subtype}.json`.
3393
+ *
3394
+ * En modo offline (`PUBLIC_IS_OFFLINE === 'true'`) el consumidor pasa
3395
+ * `offline = true` y el archivo se resuelve dentro de la subcarpeta `offline/`
3396
+ * del MISMO directorio: `.../${subtype}/offline/${subtype}.json`. La variante
3397
+ * offline es un archivo aparte que convive con el de producción
3398
+ * (`.../${subtype}/${subtype}.json`); el consumidor NO cae al CMS ni al archivo
3399
+ * online si la offline falla (ver getMainMenu/getBanners/getDynamicSlots/destacado).
3400
+ */
3401
+ export declare function resolveBucketOriginUrl(bucket: BucketOriginConfig, servicePrefix: string | undefined, type: 'menu' | 'banners' | 'bloques', subtype: string, offline?: boolean): string;
3313
3402
 
3314
3403
  /**
3315
3404
  * Recibe lo que el app mande hoy (contrato completo, parcial, o nada) y