sass-template-common 0.10.10 → 0.10.11
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 +101 -2
- package/dist/sass-template-common.js +2132 -1970
- package/dist/sass-template-common.umd.cjs +42 -41
- package/package.json +1 -1
|
@@ -51,6 +51,13 @@ export declare type Analytics = {
|
|
|
51
51
|
comscore: string | undefined;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Red de seguridad runtime para consumidores JS (sin type-check). El tipo
|
|
56
|
+
* marca la forma en build; esto valida presencia de cada slot y que matchee
|
|
57
|
+
* el formato exacto en runtime — enforcement doble, decisión del owner (§3).
|
|
58
|
+
*/
|
|
59
|
+
export declare function assertImageSizesContract(x: unknown): asserts x is ImageSizesContract;
|
|
60
|
+
|
|
54
61
|
export declare const assetsImagesPrefixer: (imagePath: string, assetsClient?: string) => string;
|
|
55
62
|
|
|
56
63
|
export declare const AssetsPreconnect: () => false | "" | JSX.Element | undefined;
|
|
@@ -309,6 +316,9 @@ declare interface CarruselCardProps extends Omit<CarrouselProps, 'slot_id'> {
|
|
|
309
316
|
|
|
310
317
|
export declare const CarruselOpinion: FC<SectionCardCarouselProps>;
|
|
311
318
|
|
|
319
|
+
/** Corre `resolveImageSizes` y reduce el resultado a pass/fail para CI. */
|
|
320
|
+
export declare function checkImageSizes(input: ImageSizesContractInput | undefined): ImageSizesCheckReport;
|
|
321
|
+
|
|
312
322
|
/**
|
|
313
323
|
* Recorre recursivamente un schema (objeto o array) y elimina toda entry
|
|
314
324
|
* que quede sin valor. Si una propiedad de un objeto queda sin valor, la
|
|
@@ -512,6 +522,11 @@ export declare class CommonServices {
|
|
|
512
522
|
protected props?: ICommonServices | undefined;
|
|
513
523
|
configVersion: string;
|
|
514
524
|
exclude: string;
|
|
525
|
+
/**
|
|
526
|
+
* Contrato de tamaños resuelto UNA vez en el punto de entrada (§3). El resto
|
|
527
|
+
* de los métodos consume `this.contract.<slot>` — cero literales sueltos.
|
|
528
|
+
*/
|
|
529
|
+
readonly contract: ImageSizesContract;
|
|
515
530
|
constructor(props?: ICommonServices | undefined);
|
|
516
531
|
generateTokenOffline: (browserId: string) => Promise<any>;
|
|
517
532
|
getEntitySection: (params: Params) => Promise<AxiosResponse<{
|
|
@@ -1475,8 +1490,12 @@ export declare function homeCardImagenToHTMLString(item: NewListResponseData, in
|
|
|
1475
1490
|
|
|
1476
1491
|
declare interface ICommonServices {
|
|
1477
1492
|
config?: Config;
|
|
1493
|
+
/** @deprecated Ya no se lee acá; los tamaños salen de `contract` (§3). Se acepta por retrocompat hasta Fase 3. */
|
|
1478
1494
|
imgSizes?: any;
|
|
1495
|
+
/** @deprecated No se lee en CommonServices; se acepta por retrocompat hasta Fase 3. */
|
|
1479
1496
|
imgSizesVideo?: any;
|
|
1497
|
+
/** Nuevo contrato de tamaños (REFACTOR_IMGSIZES_PLAN.md §3). Ausente → `resolveImageSizes` cae a los defaults congelados (§4) → output idéntico. */
|
|
1498
|
+
imageSizes?: ImageSizesContractInput;
|
|
1480
1499
|
axiosApi: AxiosInstance;
|
|
1481
1500
|
exclude?: string;
|
|
1482
1501
|
}
|
|
@@ -1561,6 +1580,60 @@ declare interface ImageProps_4 {
|
|
|
1561
1580
|
figCaption?: string;
|
|
1562
1581
|
}
|
|
1563
1582
|
|
|
1583
|
+
export declare interface ImageSizesCheckReport {
|
|
1584
|
+
/** `true` si el contrato no necesitó ningún default congelado. */
|
|
1585
|
+
ok: boolean;
|
|
1586
|
+
legacyFieldsUsed: string[];
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
export declare interface ImageSizesContract {
|
|
1590
|
+
note: {
|
|
1591
|
+
detailMain: SizeString;
|
|
1592
|
+
detailSecondary: SizeString;
|
|
1593
|
+
itemsListPrimary: SizeString;
|
|
1594
|
+
relatedPrimary: SizeString;
|
|
1595
|
+
relatedThumb: SizeString;
|
|
1596
|
+
listStandard: SizeString;
|
|
1597
|
+
cardTall: SizeString;
|
|
1598
|
+
square: SizeString;
|
|
1599
|
+
gallery: SizeString;
|
|
1600
|
+
featuredSuperSecondary: SizeString;
|
|
1601
|
+
featuredVerticalPrimary: SizeString;
|
|
1602
|
+
featuredVerticalSecondary: SizeString;
|
|
1603
|
+
featuredHorizontalPrimary: SizeString;
|
|
1604
|
+
featuredHorizontalSecondary: SizeString;
|
|
1605
|
+
featuredDiarioImageThumb: SizeString;
|
|
1606
|
+
};
|
|
1607
|
+
author: {
|
|
1608
|
+
avatar: SizeString;
|
|
1609
|
+
multiCrop: SizeString;
|
|
1610
|
+
};
|
|
1611
|
+
video: {
|
|
1612
|
+
xl: SizeString;
|
|
1613
|
+
lg: SizeString;
|
|
1614
|
+
md: SizeString;
|
|
1615
|
+
};
|
|
1616
|
+
og: {
|
|
1617
|
+
social: SizeString;
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* Partial real (por slot, no solo por grupo): `Partial<ImageSizesContract>` es
|
|
1623
|
+
* shallow y obligaría a mandar cada grupo completo o nada. Un app puede mandar
|
|
1624
|
+
* solo algunos slots de `note` y dejar el resto en manos del default congelado.
|
|
1625
|
+
*/
|
|
1626
|
+
export declare type ImageSizesContractInput = {
|
|
1627
|
+
[G in keyof ImageSizesContract]?: Partial<ImageSizesContract[G]>;
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
export declare interface ImageSizesResolution {
|
|
1631
|
+
/** Siempre completo — nunca undefined para el resto del paquete. */
|
|
1632
|
+
contract: ImageSizesContract;
|
|
1633
|
+
/** Slots resueltos por el default congelado, no provistos por el app. */
|
|
1634
|
+
legacyFieldsUsed: string[];
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1564
1637
|
export declare interface Info {
|
|
1565
1638
|
type?: string;
|
|
1566
1639
|
section?: {
|
|
@@ -1887,11 +1960,19 @@ export declare interface MainBlock1Props extends SectionCardProps, NewDescriptio
|
|
|
1887
1960
|
export declare class MainComponentServices {
|
|
1888
1961
|
exclude: string;
|
|
1889
1962
|
config: any;
|
|
1963
|
+
/**
|
|
1964
|
+
* @deprecated Ya no se lee: los tamaños salen de `this.contract` (§3). Bigfish
|
|
1965
|
+
* pasa `imgSizesVideo` acá (quirk documentado en el snapshot de Fase 0), por eso
|
|
1966
|
+
* `this.imgSizes.lg` valía `video.lg`; ahora eso se expresa como `contract.video.lg`.
|
|
1967
|
+
* Se mantiene el parámetro posicional por retrocompat hasta Fase 3.
|
|
1968
|
+
*/
|
|
1890
1969
|
imgSizes: any;
|
|
1891
1970
|
configVersion: string;
|
|
1892
1971
|
axiosApi: AxiosInstance | undefined;
|
|
1893
1972
|
customMainImagesSize: string | undefined;
|
|
1894
|
-
|
|
1973
|
+
/** Contrato de tamaños resuelto UNA vez (§3); el resto consume `this.contract.<slot>`. */
|
|
1974
|
+
readonly contract: ImageSizesContract;
|
|
1975
|
+
constructor(config: Config, imgSizes: any, axiosApi: AxiosInstance, exclude?: string, customMainImagesSizes?: string, imageSizes?: ImageSizesContractInput);
|
|
1895
1976
|
getNewsListZone(params: Params): Promise<AxiosResponse<NewListResponse, any, {}> | undefined>;
|
|
1896
1977
|
getOutstandingBlock(params: Params): Promise<AxiosResponse< {
|
|
1897
1978
|
data: Array<Outstanding>;
|
|
@@ -2575,7 +2656,10 @@ export declare interface Preview {
|
|
|
2575
2656
|
photographer?: string | false;
|
|
2576
2657
|
}
|
|
2577
2658
|
|
|
2578
|
-
|
|
2659
|
+
/** Única función que imprime: nada de `console.warn` en el runtime de la app (§3.1). */
|
|
2660
|
+
export declare function printImageSizesReport(report: ImageSizesCheckReport, label?: string): void;
|
|
2661
|
+
|
|
2662
|
+
export declare const processExtractedRelatedNews: (relatedNews: string[][], getNews: (params: any) => any, imagesizes?: string) => Promise<any[]>;
|
|
2579
2663
|
|
|
2580
2664
|
export declare type PromiseArray = {
|
|
2581
2665
|
[key: string]: {
|
|
@@ -3207,6 +3291,18 @@ export declare function resolveBucketMenuSubtype(path?: string): string;
|
|
|
3207
3291
|
|
|
3208
3292
|
export declare function resolveBucketOriginUrl(bucket: BucketOriginConfig, servicePrefix: string | undefined, type: 'menu' | 'banners', subtype: string): string;
|
|
3209
3293
|
|
|
3294
|
+
/**
|
|
3295
|
+
* Recibe lo que el app mande hoy (contrato completo, parcial, o nada) y
|
|
3296
|
+
* devuelve SIEMPRE un contrato completo. Los constructores públicos del
|
|
3297
|
+
* paquete llaman esto una sola vez, en su punto de entrada, y de ahí en
|
|
3298
|
+
* adelante consumen `contract.<slot>` sin condicionales ni valores propios.
|
|
3299
|
+
*
|
|
3300
|
+
* Puede tirar (vía `assertImageSizesContract`) si un slot provisto por el
|
|
3301
|
+
* app no matchea el formato esperado — enforcement doble (§3): tipos en
|
|
3302
|
+
* build, assert en runtime.
|
|
3303
|
+
*/
|
|
3304
|
+
export declare function resolveImageSizes(input: ImageSizesContractInput | undefined): ImageSizesResolution;
|
|
3305
|
+
|
|
3210
3306
|
export declare interface RoutePathConfig {
|
|
3211
3307
|
autor: string | 'autor';
|
|
3212
3308
|
tema: string | 'tema';
|
|
@@ -3386,6 +3482,9 @@ export declare interface SizeImage {
|
|
|
3386
3482
|
scale?: string;
|
|
3387
3483
|
}
|
|
3388
3484
|
|
|
3485
|
+
/** Formato: `"w:{n},h:{n},t:{n}[,c:{hex}];"` (uno o más, cada uno separado y terminado en `;`). */
|
|
3486
|
+
export declare type SizeString = string;
|
|
3487
|
+
|
|
3389
3488
|
declare interface Social {
|
|
3390
3489
|
title: boolean;
|
|
3391
3490
|
description: boolean;
|