sass-cms-template-common 0.0.13 → 0.0.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.
- package/dist/index.d.ts +395 -28
- package/dist/index.js +1802 -1372
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +112 -0
- package/dist/server.js +2 -2
- package/dist/{services-DS4p6Tpl.js → services-BQ1IbdWe.js} +234 -88
- package/dist/services-BQ1IbdWe.js.map +1 -0
- package/package.json +1 -1
- package/dist/services-DS4p6Tpl.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -492,6 +492,22 @@ export declare interface CkeditorPrompt {
|
|
|
492
492
|
[key: string]: unknown;
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
+
export declare interface ClassifiedNetworkError {
|
|
496
|
+
errorCode: NetworkErrorCode;
|
|
497
|
+
/** Si conviene reintentar la petición. */
|
|
498
|
+
retryable: boolean;
|
|
499
|
+
/** Mensaje crudo del error original (para el detalle copiable del toast). */
|
|
500
|
+
error: string;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Clasifica una excepción (error de axios en el servidor, o `TypeError:
|
|
505
|
+
* Failed to fetch` del navegador al invocar un server action) como error de
|
|
506
|
+
* red/servidor. Devuelve `null` si NO es un error de red (p. ej. un 4xx o una
|
|
507
|
+
* excepción de lógica): el caller lo trata entonces como error de negocio.
|
|
508
|
+
*/
|
|
509
|
+
export declare function classifyNetworkError(error: unknown): ClassifiedNetworkError | null;
|
|
510
|
+
|
|
495
511
|
/**
|
|
496
512
|
* Contenedor de "Búsqueda avanzada" reutilizable y declarativo. Recibe una lista
|
|
497
513
|
* de `fields` y los renderiza en una grilla, manejando el estado del formulario
|
|
@@ -725,6 +741,8 @@ export declare const cmsColors: {
|
|
|
725
741
|
readonly primary: string;
|
|
726
742
|
readonly primaryHover: string;
|
|
727
743
|
readonly primaryDisabled: string;
|
|
744
|
+
readonly kundera: string;
|
|
745
|
+
readonly kunderaHover: string;
|
|
728
746
|
readonly secondary: string;
|
|
729
747
|
readonly secondaryHover: string;
|
|
730
748
|
readonly onSecondaryContainer: string;
|
|
@@ -732,6 +750,9 @@ export declare const cmsColors: {
|
|
|
732
750
|
readonly controlBorder: string;
|
|
733
751
|
readonly controlText: string;
|
|
734
752
|
readonly controlHoverBg: string;
|
|
753
|
+
readonly searchHoverBg: string;
|
|
754
|
+
readonly searchFocusBg: string;
|
|
755
|
+
readonly searchClearHoverBg: string;
|
|
735
756
|
readonly whiteBtnBorder: string;
|
|
736
757
|
readonly whiteBtnText: string;
|
|
737
758
|
readonly iconButtonHoverBg: string;
|
|
@@ -743,6 +764,11 @@ export declare const cmsColors: {
|
|
|
743
764
|
readonly alphabetIdleSoft: string;
|
|
744
765
|
readonly alphabetLetter: string;
|
|
745
766
|
readonly alphabetLetterDisabled: string;
|
|
767
|
+
readonly rowHover: string;
|
|
768
|
+
readonly neutralHover: string;
|
|
769
|
+
readonly onPrimaryStateLayer: string;
|
|
770
|
+
readonly actionIcon: string;
|
|
771
|
+
readonly actionIconHover: string;
|
|
746
772
|
readonly textStrong: string;
|
|
747
773
|
readonly textNav: string;
|
|
748
774
|
readonly textMuted: string;
|
|
@@ -753,6 +779,9 @@ export declare const cmsColors: {
|
|
|
753
779
|
readonly border: string;
|
|
754
780
|
readonly avatarBg: string;
|
|
755
781
|
readonly avatarBorder: string;
|
|
782
|
+
readonly avatarInactiveBg: string;
|
|
783
|
+
readonly avatarInactiveIcon: string;
|
|
784
|
+
readonly tooltipSurface: string;
|
|
756
785
|
readonly surface: string;
|
|
757
786
|
};
|
|
758
787
|
|
|
@@ -878,10 +907,10 @@ export declare type CmsConfirmDialogProps = {
|
|
|
878
907
|
icon?: ReactNode;
|
|
879
908
|
/** Color de acento del badge del ícono. Por defecto el texto de navegación. */
|
|
880
909
|
iconColor?: string;
|
|
881
|
-
/** Título opcional.
|
|
910
|
+
/** Título opcional. M3 title-large (Google Sans 500 22/28). Admite `\n` para saltos de línea. */
|
|
882
911
|
title?: ReactNode;
|
|
883
912
|
/**
|
|
884
|
-
* Descripción opcional.
|
|
913
|
+
* Descripción opcional. Google Sans 14/400. Puede incluir negrita (`<b>`/`<strong>`)
|
|
885
914
|
* y enlaces (`<a>`); ambos se estilan según el diseño.
|
|
886
915
|
*/
|
|
887
916
|
description?: ReactNode;
|
|
@@ -1069,6 +1098,24 @@ export declare type CmsDialogActionsProps = {
|
|
|
1069
1098
|
testId?: string;
|
|
1070
1099
|
};
|
|
1071
1100
|
|
|
1101
|
+
/**
|
|
1102
|
+
* Bloque de "sin resultados" para listados y tablas: icono + título + subtítulo,
|
|
1103
|
+
* centrado. Presentacional; los textos vienen por props (i18n del gestor).
|
|
1104
|
+
* Replica el estado vacío del CMS Angular legacy.
|
|
1105
|
+
*/
|
|
1106
|
+
export declare function CmsEmptyState({ title, description, icon, testId, }: CmsEmptyStateProps): JSX.Element;
|
|
1107
|
+
|
|
1108
|
+
export declare type CmsEmptyStateProps = {
|
|
1109
|
+
/** Título principal (ya traducido). */
|
|
1110
|
+
title: string;
|
|
1111
|
+
/** Subtítulo / ayuda opcional (ya traducido). */
|
|
1112
|
+
description?: string;
|
|
1113
|
+
/** Icono a mostrar. Por defecto `search_off` (SearchOffOutlined). */
|
|
1114
|
+
icon?: ReactNode;
|
|
1115
|
+
/** Base para los `data-testid` (p. ej. `panel-users-empty`). */
|
|
1116
|
+
testId?: string;
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1072
1119
|
/**
|
|
1073
1120
|
* Página de error compartida por todos los gestores (mecanismo en la lib).
|
|
1074
1121
|
* Replica la de cmsmedios: ilustración + título + subtítulo + botón HOME, y en
|
|
@@ -1139,15 +1186,54 @@ export declare class CmsFileExplorerServices {
|
|
|
1139
1186
|
}
|
|
1140
1187
|
|
|
1141
1188
|
/**
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1144
|
-
*
|
|
1189
|
+
* Barra de filtros activos: aparece bajo la toolbar del listado con el label
|
|
1190
|
+
* "Filtros:", un chip removible por cada filtro aplicado y un botón
|
|
1191
|
+
* "Limpiar todo". Presentacional y controlado: los chips y los callbacks los
|
|
1192
|
+
* arma el gestor (dominio del producto); la lib solo aporta la estética común.
|
|
1193
|
+
*
|
|
1194
|
+
* No renderiza nada si no hay chips activos.
|
|
1195
|
+
*/
|
|
1196
|
+
export declare function CmsFilterBar({ label, chips, onClearAll, clearAllLabel, testId, }: CmsFilterBarProps): JSX.Element | null;
|
|
1197
|
+
|
|
1198
|
+
export declare type CmsFilterBarProps = {
|
|
1199
|
+
/** Texto del prefijo (p. ej. "Filtros:"). */
|
|
1200
|
+
label: string;
|
|
1201
|
+
/** Chips de filtros activos. Si está vacío, la barra no se renderiza. */
|
|
1202
|
+
chips: CmsFilterChip[];
|
|
1203
|
+
/** Callback de "Limpiar todo" (limpia todos los filtros). Si se omite, no se muestra. */
|
|
1204
|
+
onClearAll?: () => void;
|
|
1205
|
+
/** Texto del botón "Limpiar todo" (ya traducido). */
|
|
1206
|
+
clearAllLabel?: string;
|
|
1207
|
+
/** `data-testid` base de la barra. */
|
|
1208
|
+
testId?: string;
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1211
|
+
/** Chip de un filtro activo dentro del `CmsFilterBar`. */
|
|
1212
|
+
export declare type CmsFilterChip = {
|
|
1213
|
+
/** Id estable del chip (para la key y el `data-testid`). */
|
|
1214
|
+
id: string;
|
|
1215
|
+
/** Texto o nodo a mostrar (ya traducido / formateado). */
|
|
1216
|
+
label: ReactNode;
|
|
1217
|
+
/** Icono opcional a la izquierda del label (p. ej. `search`). */
|
|
1218
|
+
icon?: ReactNode;
|
|
1219
|
+
/** Callback al quitar este filtro (clic en la X del chip). */
|
|
1220
|
+
onRemove: () => void;
|
|
1221
|
+
/** `aria-label` de la X del chip. */
|
|
1222
|
+
removeAriaLabel?: string;
|
|
1223
|
+
/** `data-testid` base del chip (la X será `${testId}-icon-btn-remove`). */
|
|
1224
|
+
testId?: string;
|
|
1225
|
+
};
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* Inyecta los `@font-face` de Google Sans (fuente única del CMS) como estilos
|
|
1229
|
+
* globales. Va montado dentro de los providers MUI de la lib, así cada gestor que
|
|
1230
|
+
* los use tiene la fuente disponible sin configurar nada.
|
|
1145
1231
|
*/
|
|
1146
1232
|
export declare function CmsFontFaces(): JSX.Element;
|
|
1147
1233
|
|
|
1148
1234
|
/**
|
|
1149
|
-
* Reglas `@font-face` de
|
|
1150
|
-
*
|
|
1235
|
+
* Reglas `@font-face` de Google Sans, listas para inyectarse como estilos
|
|
1236
|
+
* globales (ver el componente `CmsFontFaces`).
|
|
1151
1237
|
*/
|
|
1152
1238
|
export declare const cmsFontFaces: string;
|
|
1153
1239
|
|
|
@@ -1295,6 +1381,120 @@ export declare type CmsMultiSelectFieldProps = {
|
|
|
1295
1381
|
testId?: string;
|
|
1296
1382
|
};
|
|
1297
1383
|
|
|
1384
|
+
/**
|
|
1385
|
+
* Singleton que conecta el interceptor de axios con el provider de red. El
|
|
1386
|
+
* provider llama `register` al montar y `unregister` al desmontar; el
|
|
1387
|
+
* interceptor usa los métodos (con fallback seguro si no hay provider).
|
|
1388
|
+
*/
|
|
1389
|
+
export declare const cmsNetworkBridge: {
|
|
1390
|
+
register(next: CmsNetworkBridgeHandlers): void;
|
|
1391
|
+
unregister(): void;
|
|
1392
|
+
/** `true` si hay un `CmsNetworkProvider` montado escuchando. */
|
|
1393
|
+
readonly isRegistered: boolean;
|
|
1394
|
+
reportOffline(): void;
|
|
1395
|
+
waitForOnline(): Promise<void>;
|
|
1396
|
+
verifyConnectivity(): Promise<boolean>;
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* Puente entre el interceptor de axios (un módulo, sin React) y el
|
|
1401
|
+
* `CmsNetworkProvider` (React). Replica el rol del `NetworkService` que se
|
|
1402
|
+
* inyecta en el `NetworkInterceptor` del Angular legacy: el interceptor no
|
|
1403
|
+
* puede usar hooks, así que el provider registra aquí sus funciones y el
|
|
1404
|
+
* interceptor las consume.
|
|
1405
|
+
*
|
|
1406
|
+
* Módulo **server-safe** (sin React, sin `'use client'`): así lo puede importar
|
|
1407
|
+
* el `lib/http/axios.ts` del gestor —que corre tanto en cliente como en
|
|
1408
|
+
* servidor— sin arrastrar componentes cliente. En el servidor el bridge queda
|
|
1409
|
+
* sin registrar (no hay provider) y `resumeAxiosOnNetworkError` re-lanza el
|
|
1410
|
+
* error para que lo maneje el server action (`toCmsError`).
|
|
1411
|
+
*/
|
|
1412
|
+
/** Funciones que el `CmsNetworkProvider` registra para el interceptor. */
|
|
1413
|
+
export declare interface CmsNetworkBridgeHandlers {
|
|
1414
|
+
/** Marca la conexión como offline de inmediato (dispara el toast). */
|
|
1415
|
+
reportOffline: () => void;
|
|
1416
|
+
/** Resuelve cuando la conexión vuelve (confirmada por el ping/eventos). */
|
|
1417
|
+
waitForOnline: () => Promise<void>;
|
|
1418
|
+
/** Confirma por ping si hay internet real. `true` = online. */
|
|
1419
|
+
verifyConnectivity: () => Promise<boolean>;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
export declare const CmsNetworkContext: Context<CmsNetworkContextValue | null>;
|
|
1423
|
+
|
|
1424
|
+
export declare interface CmsNetworkContextValue {
|
|
1425
|
+
/** Estado actual de la conexión. */
|
|
1426
|
+
status: CmsNetworkState;
|
|
1427
|
+
/** Atajo: `status === 'online'`. */
|
|
1428
|
+
isOnline: boolean;
|
|
1429
|
+
/**
|
|
1430
|
+
* Promesa que resuelve cuando la conexión vuelve a `online`. Si ya está
|
|
1431
|
+
* online, resuelve al instante. La usa el reintento para "retomar el llamado"
|
|
1432
|
+
* cuando vuelve internet.
|
|
1433
|
+
*/
|
|
1434
|
+
waitForOnline: () => Promise<void>;
|
|
1435
|
+
/**
|
|
1436
|
+
* Fuerza una verificación por ping (útil cuando una petición falló por red
|
|
1437
|
+
* pero `navigator.onLine` todavía dice `true`). Resuelve a `true` si confirma
|
|
1438
|
+
* conexión real, `false` si confirma que no hay internet.
|
|
1439
|
+
*/
|
|
1440
|
+
verifyConnectivity: () => Promise<boolean>;
|
|
1441
|
+
/**
|
|
1442
|
+
* Marca la conexión como `offline` de inmediato (dispara el toast de "sin
|
|
1443
|
+
* conexión" sin esperar al ping). Lo usa el reintento cuando el navegador ya
|
|
1444
|
+
* reporta que no hay internet, para que el error se vea al perder la conexión
|
|
1445
|
+
* y no recién al recuperarla.
|
|
1446
|
+
*/
|
|
1447
|
+
reportOffline: () => void;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
/**
|
|
1451
|
+
* Provee el estado de conectividad a toda la app y una promesa `waitForOnline`
|
|
1452
|
+
* para reanudar peticiones al recuperar internet.
|
|
1453
|
+
*
|
|
1454
|
+
* Replica el `NetworkService` del Angular legacy: combina `navigator.onLine`,
|
|
1455
|
+
* los eventos `window` `online`/`offline` y un **ping activo con polling** que
|
|
1456
|
+
* confirma la reconexión real (los eventos del navegador a veces mienten).
|
|
1457
|
+
*
|
|
1458
|
+
* El mecanismo vive en la lib; el **disparo** de toasts lo hace
|
|
1459
|
+
* `CmsNetworkToaster` (globales) y `useResilientAction` (por petición).
|
|
1460
|
+
*/
|
|
1461
|
+
export declare function CmsNetworkProvider({ children, pingUrl, pingIntervalMs, pingTimeoutMs, }: CmsNetworkProviderProps): JSX.Element;
|
|
1462
|
+
|
|
1463
|
+
export declare interface CmsNetworkProviderProps {
|
|
1464
|
+
children: ReactNode;
|
|
1465
|
+
/**
|
|
1466
|
+
* URL de ping para confirmar conectividad real (además de los eventos del
|
|
1467
|
+
* navegador). Debe responder rápido a un `GET` sin CORS. `null` desactiva el
|
|
1468
|
+
* ping y deja solo los eventos `online`/`offline`. Default: endpoint 204 de
|
|
1469
|
+
* Google (mismo que usa el Angular legacy).
|
|
1470
|
+
*/
|
|
1471
|
+
pingUrl?: string | null;
|
|
1472
|
+
/** Intervalo del polling de ping mientras siga offline (ms). Default 5000. */
|
|
1473
|
+
pingIntervalMs?: number;
|
|
1474
|
+
/**
|
|
1475
|
+
* Timeout del ping antes de darlo por fallido (ms). Sin él, un `fetch` a un
|
|
1476
|
+
* host externo sin internet puede colgarse hasta que la red vuelva, y el
|
|
1477
|
+
* offline se detectaría tarde. Default 5000.
|
|
1478
|
+
*/
|
|
1479
|
+
pingTimeoutMs?: number;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/** Estado de conectividad del navegador. */
|
|
1483
|
+
export declare type CmsNetworkState = 'online' | 'offline';
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
* Componente sin UI que observa el estado de conexión y dispara los toasts
|
|
1487
|
+
* globales, replicando el Angular legacy:
|
|
1488
|
+
*
|
|
1489
|
+
* - Al perder internet → toast de error "sin conexión" (no se autocierra).
|
|
1490
|
+
* - Al recuperarla → cierra el anterior y muestra "conexión restablecida".
|
|
1491
|
+
*
|
|
1492
|
+
* Se monta una sola vez, dentro de `CmsNetworkProvider` + `CmsToastProvider`.
|
|
1493
|
+
* El reintento y "reanudar el llamado" por acción los maneja
|
|
1494
|
+
* `useResilientAction`.
|
|
1495
|
+
*/
|
|
1496
|
+
export declare function CmsNetworkToaster(): null;
|
|
1497
|
+
|
|
1298
1498
|
/**
|
|
1299
1499
|
* Servicios HTTP del módulo `news` del CMS (core + publish, unpublish, pin,
|
|
1300
1500
|
* massive, freshness, views y analytics).
|
|
@@ -2126,6 +2326,7 @@ export declare type CmsTranslator = {
|
|
|
2126
2326
|
count?: number;
|
|
2127
2327
|
}) => string;
|
|
2128
2328
|
toast: (key: ToastMessageKey) => string;
|
|
2329
|
+
network: (key: NetworkMessageKey) => string;
|
|
2129
2330
|
userAvatar: (key: UserAvatarMessageKey) => string;
|
|
2130
2331
|
errorPage: (key: ErrorPageMessageKey) => string;
|
|
2131
2332
|
/**
|
|
@@ -2899,6 +3100,9 @@ export declare const DEFAULT_PREVIEW_FORMATS: PreviewFormat[];
|
|
|
2899
3100
|
|
|
2900
3101
|
export declare const DEFAULT_SITE_ID = "bluestack-es";
|
|
2901
3102
|
|
|
3103
|
+
/** Preferencia por defecto (sin nada guardado): tema nuevo activo, modo claro. */
|
|
3104
|
+
export declare const DEFAULT_THEME_PREFERENCE: ThemePreference;
|
|
3105
|
+
|
|
2902
3106
|
export declare const DefaultCmsLink: ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
2903
3107
|
href: string;
|
|
2904
3108
|
children?: ReactNode;
|
|
@@ -3175,6 +3379,11 @@ export declare const enMessages: {
|
|
|
3175
3379
|
readonly defaultWarning: "Please review the request.";
|
|
3176
3380
|
readonly defaultInfo: "Information";
|
|
3177
3381
|
};
|
|
3382
|
+
readonly network: {
|
|
3383
|
+
readonly disconnected: "No connection. Check your network or Wi-Fi status. We will retry when the connection is restored.";
|
|
3384
|
+
readonly retrying: "Retrying requests.";
|
|
3385
|
+
readonly restored: "Connection restored.";
|
|
3386
|
+
};
|
|
3178
3387
|
readonly userAvatar: {
|
|
3179
3388
|
readonly alt: "User avatar";
|
|
3180
3389
|
readonly unknownUser: "Unknown user";
|
|
@@ -3391,6 +3600,11 @@ export declare const esMessages: {
|
|
|
3391
3600
|
defaultWarning: string;
|
|
3392
3601
|
defaultInfo: string;
|
|
3393
3602
|
};
|
|
3603
|
+
network: {
|
|
3604
|
+
disconnected: string;
|
|
3605
|
+
retrying: string;
|
|
3606
|
+
restored: string;
|
|
3607
|
+
};
|
|
3394
3608
|
userAvatar: {
|
|
3395
3609
|
alt: string;
|
|
3396
3610
|
unknownUser: string;
|
|
@@ -3644,16 +3858,17 @@ export declare const fieldStyles: {
|
|
|
3644
3858
|
*/
|
|
3645
3859
|
sxAutocompleteListbox: SxProps<Theme>;
|
|
3646
3860
|
/**
|
|
3647
|
-
* Paper del menú de `CmsSelectField`.
|
|
3648
|
-
*
|
|
3649
|
-
*
|
|
3861
|
+
* Paper del menú de `CmsSelectField`. Menú M3 común a todos los desplegables:
|
|
3862
|
+
* fondo `menuSurface` (#ECEDF6), sin padding lateral (ítems de borde a borde) y
|
|
3863
|
+
* 8px arriba/abajo; `overflow: hidden` recorta las esquinas del hover.
|
|
3650
3864
|
*/
|
|
3651
3865
|
sxSelectMenuPaper: SxProps<Theme>;
|
|
3652
|
-
/** Lista del menú del select (sin padding
|
|
3866
|
+
/** Lista del menú del select (sin padding ni gap: los ítems van full-bleed). */
|
|
3653
3867
|
sxSelectList: SxProps<Theme>;
|
|
3654
3868
|
/**
|
|
3655
|
-
* Opción del menú del select:
|
|
3656
|
-
* `
|
|
3869
|
+
* Opción del menú del select: full-bleed (sin radio), hover en `neutralHover`
|
|
3870
|
+
* (state layer M3 `onSurface` al 8%, #191C20), activa en `secondary`. El check
|
|
3871
|
+
* va a la derecha.
|
|
3657
3872
|
*/
|
|
3658
3873
|
sxSelectItem: SxProps<Theme>;
|
|
3659
3874
|
/** Check de la opción activa del select. */
|
|
@@ -3702,14 +3917,13 @@ export declare function findPublicationBySlug(sites: SiteSection[], slug: string
|
|
|
3702
3917
|
export declare function findPublicationLabel(sites: SiteSection[], publicationId: string): string;
|
|
3703
3918
|
|
|
3704
3919
|
/**
|
|
3705
|
-
* Familias tipográficas del CMS. `
|
|
3706
|
-
*
|
|
3707
|
-
* `theme/fonts.ts` y se
|
|
3920
|
+
* Familias tipográficas del CMS. `googleSans` = fuente única de todo el CMS
|
|
3921
|
+
* (texto, marca y títulos); reemplaza a Roboto y Product Sans. La `@font-face`
|
|
3922
|
+
* que la carga vive en `theme/fonts.ts` y se inyecta vía el provider MUI.
|
|
3708
3923
|
*/
|
|
3709
3924
|
export declare const fontFamilies: {
|
|
3710
|
-
readonly
|
|
3711
|
-
|
|
3712
|
-
/** Monoespaciada (url del toast de error, fragmentos de código). */
|
|
3925
|
+
readonly googleSans: "\"Google Sans\",\"Helvetica\",\"Arial\",sans-serif";
|
|
3926
|
+
/** Monoespaciada (url del toast de error, fragmentos de código). No es de marca. */
|
|
3713
3927
|
readonly mono: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
|
|
3714
3928
|
};
|
|
3715
3929
|
|
|
@@ -3737,9 +3951,20 @@ export declare function getCommonError(errorCode: string | number | Array<string
|
|
|
3737
3951
|
|
|
3738
3952
|
export declare function getDefaultPublicationSlug(sites: SiteSection[]): string;
|
|
3739
3953
|
|
|
3954
|
+
/** Modo efectivo aplicado al sitio a partir de la preferencia. */
|
|
3955
|
+
export declare function getEffectiveThemeMode(pref: ThemePreference): ThemeMode;
|
|
3956
|
+
|
|
3740
3957
|
/** BCP 47 tag for `Intl` / `toLocaleString` formatting. */
|
|
3741
3958
|
export declare function getIntlLocaleTag(locale: Locale): string;
|
|
3742
3959
|
|
|
3960
|
+
/**
|
|
3961
|
+
* Si un resultado ya devuelto por un server action es un envelope de error con
|
|
3962
|
+
* un código de red (`{ status: 'error', errorCode: 'net.*' }`), devuelve ese
|
|
3963
|
+
* código; si no, `null`. Permite reintentar cuando el fallo de red se detectó
|
|
3964
|
+
* en el servidor (Next→OpenCms) y viajó como `CmsResponse`.
|
|
3965
|
+
*/
|
|
3966
|
+
export declare function getNetworkErrorCodeFromResult(result: unknown): NetworkErrorCode | null;
|
|
3967
|
+
|
|
3743
3968
|
export declare function getProfileAvatarSrc(profile: ProfileGetResponse, options?: ProfileAvatarOptions): string;
|
|
3744
3969
|
|
|
3745
3970
|
export declare function getProfileDisplayName(profile: ProfileGetResponse): string;
|
|
@@ -4144,6 +4369,9 @@ declare interface ISitesServices {
|
|
|
4144
4369
|
authentication: Authentication;
|
|
4145
4370
|
}
|
|
4146
4371
|
|
|
4372
|
+
/** `true` si el código dado es uno de los códigos internos de red. */
|
|
4373
|
+
export declare function isNetworkErrorCode(code: string | null | undefined): boolean;
|
|
4374
|
+
|
|
4147
4375
|
/**
|
|
4148
4376
|
* Decide si un ítem es visible según los permisos de operación del usuario.
|
|
4149
4377
|
*
|
|
@@ -4160,6 +4388,9 @@ declare interface ISitesServices {
|
|
|
4160
4388
|
*/
|
|
4161
4389
|
export declare function isNewContentItemVisible(item: NewContentItem, operationPermissions: string[] | undefined, isAdmin: boolean | undefined): boolean;
|
|
4162
4390
|
|
|
4391
|
+
/** `true` si un código de red debe reintentarse. */
|
|
4392
|
+
export declare function isRetryableNetworkCode(code: string | null | undefined): boolean;
|
|
4393
|
+
|
|
4163
4394
|
declare interface ITagsServices {
|
|
4164
4395
|
axiosApi: AxiosInstance;
|
|
4165
4396
|
authentication: Authentication;
|
|
@@ -4294,8 +4525,30 @@ export declare type NavLinkItem = {
|
|
|
4294
4525
|
accent?: 'ai';
|
|
4295
4526
|
/** Si el href apunta al admin legacy (JSP/Angular), se prefija con `legacyBaseUrl`. */
|
|
4296
4527
|
legacy?: boolean;
|
|
4528
|
+
/**
|
|
4529
|
+
* Si la ruta del Angular master exige el id de publicación al final
|
|
4530
|
+
* (p. ej. `/admin/tags/:idPub`, `/admin/planning/:idPub`), se le agrega
|
|
4531
|
+
* `selectedPublicationId`. Solo aplica junto con `legacy`.
|
|
4532
|
+
*/
|
|
4533
|
+
appendPublicationId?: boolean;
|
|
4534
|
+
};
|
|
4535
|
+
|
|
4536
|
+
/** Códigos internos de error de red/servidor (no son del CMS). */
|
|
4537
|
+
export declare const NETWORK_ERROR_CODES: {
|
|
4538
|
+
/** Sin conexión a internet (no se pudo alcanzar el servidor). */
|
|
4539
|
+
readonly offline: "net.offline";
|
|
4540
|
+
/** La petición excedió el timeout. */
|
|
4541
|
+
readonly timeout: "net.timeout";
|
|
4542
|
+
/** El backend no responde (502/503/504). */
|
|
4543
|
+
readonly unavailable: "net.unavailable";
|
|
4544
|
+
/** Error interno del servidor (5xx genérico). */
|
|
4545
|
+
readonly server: "net.server";
|
|
4297
4546
|
};
|
|
4298
4547
|
|
|
4548
|
+
export declare type NetworkErrorCode = (typeof NETWORK_ERROR_CODES)[keyof typeof NETWORK_ERROR_CODES];
|
|
4549
|
+
|
|
4550
|
+
export declare type NetworkMessageKey = keyof CmsMessages['network'];
|
|
4551
|
+
|
|
4299
4552
|
/** Columna del menú "Nuevo" (Frecuentes / Otros / Videos). */
|
|
4300
4553
|
export declare type NewContentGroup = {
|
|
4301
4554
|
/** Clave i18n del título de la columna (namespace `newMenu`). */
|
|
@@ -6021,6 +6274,11 @@ export declare const ptMessages: {
|
|
|
6021
6274
|
defaultWarning: string;
|
|
6022
6275
|
defaultInfo: string;
|
|
6023
6276
|
};
|
|
6277
|
+
network: {
|
|
6278
|
+
disconnected: string;
|
|
6279
|
+
retrying: string;
|
|
6280
|
+
restored: string;
|
|
6281
|
+
};
|
|
6024
6282
|
userAvatar: {
|
|
6025
6283
|
alt: string;
|
|
6026
6284
|
unknownUser: string;
|
|
@@ -6143,6 +6401,12 @@ export declare const radii: {
|
|
|
6143
6401
|
readonly pill: "999px";
|
|
6144
6402
|
};
|
|
6145
6403
|
|
|
6404
|
+
/** Modo efectivo leído directo de `localStorage`. SSR-safe. */
|
|
6405
|
+
export declare function readEffectiveThemeMode(): ThemeMode;
|
|
6406
|
+
|
|
6407
|
+
/** Lee la preferencia de `localStorage`. SSR-safe (fallback al default). */
|
|
6408
|
+
export declare function readThemePreference(): ThemePreference;
|
|
6409
|
+
|
|
6146
6410
|
/** Receta del CMS. La forma exacta depende del recurso y del formato pedido. */
|
|
6147
6411
|
export declare interface Recipe {
|
|
6148
6412
|
[key: string]: unknown;
|
|
@@ -6308,6 +6572,19 @@ export declare interface RecipesPublishCheckResponse extends CmsResponse {
|
|
|
6308
6572
|
[key: string]: unknown;
|
|
6309
6573
|
}
|
|
6310
6574
|
|
|
6575
|
+
export declare type ResilientRunner = <T>(fn: () => Promise<T>, options?: ResilientRunOptions) => Promise<T>;
|
|
6576
|
+
|
|
6577
|
+
export declare interface ResilientRunOptions {
|
|
6578
|
+
/** Servicio/endpoint (para el detalle del toast, si el resultado es error). */
|
|
6579
|
+
service?: string;
|
|
6580
|
+
/** Params de la llamada (para el detalle del toast). */
|
|
6581
|
+
params?: Record<string, unknown>;
|
|
6582
|
+
/** Máximo de reintentos con backoff (fallos de servidor/timeout). Default 3. */
|
|
6583
|
+
maxRetries?: number;
|
|
6584
|
+
/** Mostrar el toast "reintentando" al reanudar tras una desconexión. Default true. */
|
|
6585
|
+
notifyRetry?: boolean;
|
|
6586
|
+
}
|
|
6587
|
+
|
|
6311
6588
|
export declare function resolveCmsAssetUrl(path: string, cmsOrigin?: string): string;
|
|
6312
6589
|
|
|
6313
6590
|
export declare function resolveCmsOrigin(cmsOrigin?: string): string;
|
|
@@ -6315,6 +6592,30 @@ export declare function resolveCmsOrigin(cmsOrigin?: string): string;
|
|
|
6315
6592
|
/** Devuelve la severidad de toast para un código de error (`warning`/`error`). */
|
|
6316
6593
|
export declare function resolveErrorSeverity(errorCode: string | number | Array<string | number> | null | undefined): CmsErrorSeverity;
|
|
6317
6594
|
|
|
6595
|
+
/**
|
|
6596
|
+
* Da resiliencia de red a una petición de axios, replicando el
|
|
6597
|
+
* `NetworkInterceptor` del Angular legacy. Pensado para el `onRejected` del
|
|
6598
|
+
* interceptor de respuesta de axios del gestor:
|
|
6599
|
+
*
|
|
6600
|
+
* ```ts
|
|
6601
|
+
* api.interceptors.response.use(
|
|
6602
|
+
* (r) => r,
|
|
6603
|
+
* (error) => resumeAxiosOnNetworkError(error, (config) => api.request(config)),
|
|
6604
|
+
* );
|
|
6605
|
+
* ```
|
|
6606
|
+
*
|
|
6607
|
+
* - **En el servidor, o no es error de red, o no hay provider montado** →
|
|
6608
|
+
* re-lanza el error (lo maneja el caller / `toCmsError`).
|
|
6609
|
+
* - **Sin internet** (el navegador reporta offline, o el ping confirma que no
|
|
6610
|
+
* hay salida real, p. ej. `ERR_NAME_NOT_RESOLVED`): muestra "sin conexión"
|
|
6611
|
+
* (vía el provider), arranca el ping y, al volver la conexión, **reintenta**
|
|
6612
|
+
* la petición (retoma el servicio).
|
|
6613
|
+
* - **Con internet** (el caído era el backend: 5xx/timeout): re-lanza sin
|
|
6614
|
+
* reintentar, para no repetir a ciegas un POST. Ese caso lo cubre
|
|
6615
|
+
* `useResilientAction`/`toCmsError` en las mutaciones envueltas.
|
|
6616
|
+
*/
|
|
6617
|
+
export declare function resumeAxiosOnNetworkError<T = unknown>(error: unknown, reAttempt: (config: unknown) => Promise<T>): Promise<T>;
|
|
6618
|
+
|
|
6318
6619
|
/** Sección de una publicación del CMS (forma devuelta por get/exist). */
|
|
6319
6620
|
export declare interface Section {
|
|
6320
6621
|
id?: number;
|
|
@@ -6451,13 +6752,15 @@ export declare type SelectOption = {
|
|
|
6451
6752
|
* importarlo para construir un trigger/menú coherente con el sistema.
|
|
6452
6753
|
*
|
|
6453
6754
|
* Reglas de color (todas con variables de `variables.ts`):
|
|
6454
|
-
* - Trigger por defecto: borde `
|
|
6455
|
-
* (#000) en negrita, fondo transparente; hover → `
|
|
6755
|
+
* - Trigger por defecto: borde `m3.outlineVariant` (#C4C6CF), texto `controlText`
|
|
6756
|
+
* (#000) en negrita, fondo transparente; hover → `neutralHover` (state layer
|
|
6757
|
+
* M3 `onSurface` al 8%, #191C20).
|
|
6456
6758
|
* - Trigger activo (abierto) o resaltado (valor activo): fondo `secondary`
|
|
6457
6759
|
* (#D8E2FF), sin borde.
|
|
6458
|
-
* - Opción del menú: hover → `
|
|
6459
|
-
* fondo `secondary` (#D8E2FF). El menú es full-bleed
|
|
6460
|
-
* radio en los ítems): el resaltado llega de borde a
|
|
6760
|
+
* - Opción del menú: hover → `neutralHover` (state layer M3 `onSurface` al 8%,
|
|
6761
|
+
* #191C20); seleccionada → fondo `secondary` (#D8E2FF). El menú es full-bleed
|
|
6762
|
+
* (sin padding lateral ni radio en los ítems): el resaltado llega de borde a
|
|
6763
|
+
* borde, sobre el fondo `menuSurface` (#ECEDF6) común a todos los desplegables.
|
|
6461
6764
|
*/
|
|
6462
6765
|
export declare const SelectStyles: {
|
|
6463
6766
|
/**
|
|
@@ -6510,7 +6813,7 @@ export declare type SidebarProps = {
|
|
|
6510
6813
|
* todo. El anclado se identifica por `item.module` y persiste vía
|
|
6511
6814
|
* `profileServices.addPins`/`deletePins`/`getPins` (recurso de perfil).
|
|
6512
6815
|
*/
|
|
6513
|
-
export declare function SidebarRail({ pathname, permissions, LinkComponent, legacyBaseUrl, items, profileServices, }: SidebarRailProps): JSX.Element;
|
|
6816
|
+
export declare function SidebarRail({ pathname, permissions, LinkComponent, legacyBaseUrl, selectedPublicationId, items, profileServices, }: SidebarRailProps): JSX.Element;
|
|
6514
6817
|
|
|
6515
6818
|
/** Servicio de pines usado por el rail: solo necesita estos tres métodos. */
|
|
6516
6819
|
export declare type SidebarRailPinService = Pick<CmsProfileServices, 'addPins' | 'deletePins' | 'getPins'>;
|
|
@@ -6521,6 +6824,8 @@ export declare type SidebarRailProps = {
|
|
|
6521
6824
|
permissions: Array<NavItemPermissions>;
|
|
6522
6825
|
/** Dominio del admin legacy (JSP/Angular) para prefijar hrefs con `item.legacy`. */
|
|
6523
6826
|
legacyBaseUrl?: string;
|
|
6827
|
+
/** Id de publicación activa; se agrega a los ítems legacy con `appendPublicationId`. */
|
|
6828
|
+
selectedPublicationId?: string;
|
|
6524
6829
|
/** Ítems de navegación. Por defecto, `ACCOUNT_NAV_BLOCKS`. */
|
|
6525
6830
|
items?: NavLinkItem[];
|
|
6526
6831
|
/**
|
|
@@ -6624,8 +6929,8 @@ export declare const sizes: {
|
|
|
6624
6929
|
readonly buttonHeight: 40;
|
|
6625
6930
|
/** Alto de botones/triggers compactos (selector de sitios). */
|
|
6626
6931
|
readonly buttonHeightSm: 34;
|
|
6627
|
-
/** Alto del campo buscador (`CmsSearchField`). */
|
|
6628
|
-
readonly searchHeight:
|
|
6932
|
+
/** Alto del campo buscador (`CmsSearchField`): igual al del filtro (`buttonHeight`). */
|
|
6933
|
+
readonly searchHeight: 40;
|
|
6629
6934
|
};
|
|
6630
6935
|
|
|
6631
6936
|
export declare type SourceColors = typeof sourceColors;
|
|
@@ -6858,6 +7163,27 @@ export declare type TextFieldConfig = BaseFieldConfig & {
|
|
|
6858
7163
|
type?: 'text' | 'email' | 'url';
|
|
6859
7164
|
};
|
|
6860
7165
|
|
|
7166
|
+
/**
|
|
7167
|
+
* Atributo que MUI togglea en `<html>` (coincide con `colorSchemeSelector` de
|
|
7168
|
+
* `createAppTheme`). Las CSS vars `--cms-*` y `--mui-palette-*` se enganchan acá.
|
|
7169
|
+
*/
|
|
7170
|
+
export declare const THEME_COLOR_SCHEME_ATTRIBUTE = "data-mui-color-scheme";
|
|
7171
|
+
|
|
7172
|
+
/** Clave de localStorage para el switch "Tema nuevo". */
|
|
7173
|
+
export declare const THEME_ENABLED_STORAGE_KEY = "cms-theme-enabled";
|
|
7174
|
+
|
|
7175
|
+
/** Clave de localStorage para el modo deseado (`light`/`dark`). */
|
|
7176
|
+
export declare const THEME_MODE_STORAGE_KEY = "cms-theme-mode";
|
|
7177
|
+
|
|
7178
|
+
export declare type ThemeMode = 'light' | 'dark';
|
|
7179
|
+
|
|
7180
|
+
export declare type ThemePreference = {
|
|
7181
|
+
/** Switch "Tema nuevo" del menú Apariencia. Off → se fuerza claro. */
|
|
7182
|
+
enabled: boolean;
|
|
7183
|
+
/** Modo deseado por el usuario (se recuerda aunque `enabled` esté off). */
|
|
7184
|
+
mode: ThemeMode;
|
|
7185
|
+
};
|
|
7186
|
+
|
|
6861
7187
|
/**
|
|
6862
7188
|
* Detalle extra que enriquece el toast de error (replica el toast de error del
|
|
6863
7189
|
* Angular legacy: detalle copiable con url/servicio/params/versión).
|
|
@@ -7237,6 +7563,11 @@ export declare interface UploadResponse extends CmsResponse {
|
|
|
7237
7563
|
[key: string]: unknown;
|
|
7238
7564
|
}
|
|
7239
7565
|
|
|
7566
|
+
/**
|
|
7567
|
+
* Lee el estado de conectividad. Debe usarse dentro de `<CmsNetworkProvider>`.
|
|
7568
|
+
*/
|
|
7569
|
+
export declare function useCmsNetworkStatus(): CmsNetworkContextValue;
|
|
7570
|
+
|
|
7240
7571
|
/**
|
|
7241
7572
|
* Hook para disparar toasts. Debe usarse dentro de `CmsToastProvider`.
|
|
7242
7573
|
*/
|
|
@@ -7270,7 +7601,7 @@ export declare function useCurrentUserPhoto(): CurrentUserPhotoContextValue | nu
|
|
|
7270
7601
|
* nombre y textos traducidos (es/en/pt). Reacciona al cambio de la prop `photo`;
|
|
7271
7602
|
* para el usuario logueado, reacciona además al `CurrentUserPhotoProvider`.
|
|
7272
7603
|
*/
|
|
7273
|
-
export declare function UserAvatar({ photo, description, username, size, showTooltip, cmsOrigin, crossOrigin, isCurrentUser, onClick, testId, }: UserAvatarProps): JSX.Element;
|
|
7604
|
+
export declare function UserAvatar({ photo, description, username, size, showTooltip, inactive, cmsOrigin, crossOrigin, isCurrentUser, onClick, testId, }: UserAvatarProps): JSX.Element;
|
|
7274
7605
|
|
|
7275
7606
|
export declare type UserAvatarMessageKey = keyof CmsMessages['userAvatar'];
|
|
7276
7607
|
|
|
@@ -7289,6 +7620,11 @@ export declare type UserAvatarProps = {
|
|
|
7289
7620
|
size?: number;
|
|
7290
7621
|
/** Muestra el tooltip con el nombre al pasar el mouse. Por defecto `true`. */
|
|
7291
7622
|
showTooltip?: boolean;
|
|
7623
|
+
/**
|
|
7624
|
+
* Marca al usuario como inactivo/desactivado: el avatar cae a un gris apagado
|
|
7625
|
+
* (fondo y ícono más grises). Por defecto `false`.
|
|
7626
|
+
*/
|
|
7627
|
+
inactive?: boolean;
|
|
7292
7628
|
/** Origen del CMS para resolver rutas relativas de la foto. */
|
|
7293
7629
|
cmsOrigin?: string;
|
|
7294
7630
|
/**
|
|
@@ -7308,6 +7644,31 @@ export declare type UserAvatarProps = {
|
|
|
7308
7644
|
testId?: string;
|
|
7309
7645
|
};
|
|
7310
7646
|
|
|
7647
|
+
/**
|
|
7648
|
+
* Envuelve la invocación de un server action para hacerla **resiliente a la
|
|
7649
|
+
* red**, replicando el comportamiento del Angular legacy:
|
|
7650
|
+
*
|
|
7651
|
+
* - **Sin internet (usuario offline):** no se pierde la acción. Se espera —sin
|
|
7652
|
+
* consumir reintentos— a que vuelva la conexión y entonces se **retoma el
|
|
7653
|
+
* llamado** automáticamente (muestra "reintentando…").
|
|
7654
|
+
* - **Backend caído / timeout / 5xx (con internet):** reintenta con backoff
|
|
7655
|
+
* exponencial (1s, 2s, 4s, 8s) hasta `maxRetries`; luego devuelve el
|
|
7656
|
+
* resultado de error para que el caller muestre el toast.
|
|
7657
|
+
* - **Error de negocio (4xx / `status:'fail'`):** no reintenta; devuelve el
|
|
7658
|
+
* resultado tal cual para que el caller decida (toast/update optimista).
|
|
7659
|
+
*
|
|
7660
|
+
* El toast global de "sin conexión" / "conexión restablecida" lo dispara
|
|
7661
|
+
* `CmsNetworkToaster`; este hook solo añade el "reintentando…" por acción.
|
|
7662
|
+
*
|
|
7663
|
+
* Uso en el gestor:
|
|
7664
|
+
* ```ts
|
|
7665
|
+
* const run = useResilientAction();
|
|
7666
|
+
* const res = await run(() => setUserStatus(slug, id, action),
|
|
7667
|
+
* { service: '/users/actions/setStatus', params: { id, action } });
|
|
7668
|
+
* ```
|
|
7669
|
+
*/
|
|
7670
|
+
export declare function useResilientAction(): ResilientRunner;
|
|
7671
|
+
|
|
7311
7672
|
/** Grupo del sistema devuelto por POST /users/groups/get. */
|
|
7312
7673
|
export declare interface UserGroup {
|
|
7313
7674
|
id: string;
|
|
@@ -7842,6 +8203,12 @@ export declare interface WorkpaperStatusResponse extends CmsResponse {
|
|
|
7842
8203
|
ediciones: WorkpaperEdition[];
|
|
7843
8204
|
}
|
|
7844
8205
|
|
|
8206
|
+
/**
|
|
8207
|
+
* Guarda la preferencia y refleja el modo efectivo en el atributo de `<html>`
|
|
8208
|
+
* de una (para que el cambio se vea sin recargar). SSR-safe.
|
|
8209
|
+
*/
|
|
8210
|
+
export declare function writeThemePreference(pref: ThemePreference): void;
|
|
8211
|
+
|
|
7845
8212
|
/** Cuerpo de la respuesta de POST /videos/youtube/getThumbnails. */
|
|
7846
8213
|
export declare interface YoutubeThumbnailsResponse extends CmsResponse {
|
|
7847
8214
|
[key: string]: unknown;
|