sass-cms-template-common 0.0.13 → 0.0.14
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 +319 -28
- package/dist/index.js +1720 -1315
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +50 -0
- package/dist/server.js +2 -2
- package/dist/{services-DS4p6Tpl.js → services-DB5GX5UJ.js} +201 -92
- package/dist/services-DB5GX5UJ.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,68 @@ export declare type CmsMultiSelectFieldProps = {
|
|
|
1295
1381
|
testId?: string;
|
|
1296
1382
|
};
|
|
1297
1383
|
|
|
1384
|
+
export declare const CmsNetworkContext: Context<CmsNetworkContextValue | null>;
|
|
1385
|
+
|
|
1386
|
+
export declare interface CmsNetworkContextValue {
|
|
1387
|
+
/** Estado actual de la conexión. */
|
|
1388
|
+
status: CmsNetworkState;
|
|
1389
|
+
/** Atajo: `status === 'online'`. */
|
|
1390
|
+
isOnline: boolean;
|
|
1391
|
+
/**
|
|
1392
|
+
* Promesa que resuelve cuando la conexión vuelve a `online`. Si ya está
|
|
1393
|
+
* online, resuelve al instante. La usa el reintento para "retomar el llamado"
|
|
1394
|
+
* cuando vuelve internet.
|
|
1395
|
+
*/
|
|
1396
|
+
waitForOnline: () => Promise<void>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Fuerza una verificación por ping (útil cuando una petición falló por red
|
|
1399
|
+
* pero `navigator.onLine` todavía dice `true`).
|
|
1400
|
+
*/
|
|
1401
|
+
verifyConnectivity: () => void;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
/**
|
|
1405
|
+
* Provee el estado de conectividad a toda la app y una promesa `waitForOnline`
|
|
1406
|
+
* para reanudar peticiones al recuperar internet.
|
|
1407
|
+
*
|
|
1408
|
+
* Replica el `NetworkService` del Angular legacy: combina `navigator.onLine`,
|
|
1409
|
+
* los eventos `window` `online`/`offline` y un **ping activo con polling** que
|
|
1410
|
+
* confirma la reconexión real (los eventos del navegador a veces mienten).
|
|
1411
|
+
*
|
|
1412
|
+
* El mecanismo vive en la lib; el **disparo** de toasts lo hace
|
|
1413
|
+
* `CmsNetworkToaster` (globales) y `useResilientAction` (por petición).
|
|
1414
|
+
*/
|
|
1415
|
+
export declare function CmsNetworkProvider({ children, pingUrl, pingIntervalMs, }: CmsNetworkProviderProps): JSX.Element;
|
|
1416
|
+
|
|
1417
|
+
export declare interface CmsNetworkProviderProps {
|
|
1418
|
+
children: ReactNode;
|
|
1419
|
+
/**
|
|
1420
|
+
* URL de ping para confirmar conectividad real (además de los eventos del
|
|
1421
|
+
* navegador). Debe responder rápido a un `GET` sin CORS. `null` desactiva el
|
|
1422
|
+
* ping y deja solo los eventos `online`/`offline`. Default: endpoint 204 de
|
|
1423
|
+
* Google (mismo que usa el Angular legacy).
|
|
1424
|
+
*/
|
|
1425
|
+
pingUrl?: string | null;
|
|
1426
|
+
/** Intervalo del polling de ping mientras siga offline (ms). Default 5000. */
|
|
1427
|
+
pingIntervalMs?: number;
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
/** Estado de conectividad del navegador. */
|
|
1431
|
+
export declare type CmsNetworkState = 'online' | 'offline';
|
|
1432
|
+
|
|
1433
|
+
/**
|
|
1434
|
+
* Componente sin UI que observa el estado de conexión y dispara los toasts
|
|
1435
|
+
* globales, replicando el Angular legacy:
|
|
1436
|
+
*
|
|
1437
|
+
* - Al perder internet → toast de error "sin conexión" (no se autocierra).
|
|
1438
|
+
* - Al recuperarla → cierra el anterior y muestra "conexión restablecida".
|
|
1439
|
+
*
|
|
1440
|
+
* Se monta una sola vez, dentro de `CmsNetworkProvider` + `CmsToastProvider`.
|
|
1441
|
+
* El reintento y "reanudar el llamado" por acción los maneja
|
|
1442
|
+
* `useResilientAction`.
|
|
1443
|
+
*/
|
|
1444
|
+
export declare function CmsNetworkToaster(): null;
|
|
1445
|
+
|
|
1298
1446
|
/**
|
|
1299
1447
|
* Servicios HTTP del módulo `news` del CMS (core + publish, unpublish, pin,
|
|
1300
1448
|
* massive, freshness, views y analytics).
|
|
@@ -2126,6 +2274,7 @@ export declare type CmsTranslator = {
|
|
|
2126
2274
|
count?: number;
|
|
2127
2275
|
}) => string;
|
|
2128
2276
|
toast: (key: ToastMessageKey) => string;
|
|
2277
|
+
network: (key: NetworkMessageKey) => string;
|
|
2129
2278
|
userAvatar: (key: UserAvatarMessageKey) => string;
|
|
2130
2279
|
errorPage: (key: ErrorPageMessageKey) => string;
|
|
2131
2280
|
/**
|
|
@@ -2899,6 +3048,9 @@ export declare const DEFAULT_PREVIEW_FORMATS: PreviewFormat[];
|
|
|
2899
3048
|
|
|
2900
3049
|
export declare const DEFAULT_SITE_ID = "bluestack-es";
|
|
2901
3050
|
|
|
3051
|
+
/** Preferencia por defecto (sin nada guardado): tema nuevo activo, modo claro. */
|
|
3052
|
+
export declare const DEFAULT_THEME_PREFERENCE: ThemePreference;
|
|
3053
|
+
|
|
2902
3054
|
export declare const DefaultCmsLink: ForwardRefExoticComponent<AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
2903
3055
|
href: string;
|
|
2904
3056
|
children?: ReactNode;
|
|
@@ -3175,6 +3327,11 @@ export declare const enMessages: {
|
|
|
3175
3327
|
readonly defaultWarning: "Please review the request.";
|
|
3176
3328
|
readonly defaultInfo: "Information";
|
|
3177
3329
|
};
|
|
3330
|
+
readonly network: {
|
|
3331
|
+
readonly disconnected: "No connection. Check your network or Wi-Fi status. We will retry when the connection is restored.";
|
|
3332
|
+
readonly retrying: "Retrying requests.";
|
|
3333
|
+
readonly restored: "Connection restored.";
|
|
3334
|
+
};
|
|
3178
3335
|
readonly userAvatar: {
|
|
3179
3336
|
readonly alt: "User avatar";
|
|
3180
3337
|
readonly unknownUser: "Unknown user";
|
|
@@ -3391,6 +3548,11 @@ export declare const esMessages: {
|
|
|
3391
3548
|
defaultWarning: string;
|
|
3392
3549
|
defaultInfo: string;
|
|
3393
3550
|
};
|
|
3551
|
+
network: {
|
|
3552
|
+
disconnected: string;
|
|
3553
|
+
retrying: string;
|
|
3554
|
+
restored: string;
|
|
3555
|
+
};
|
|
3394
3556
|
userAvatar: {
|
|
3395
3557
|
alt: string;
|
|
3396
3558
|
unknownUser: string;
|
|
@@ -3644,16 +3806,17 @@ export declare const fieldStyles: {
|
|
|
3644
3806
|
*/
|
|
3645
3807
|
sxAutocompleteListbox: SxProps<Theme>;
|
|
3646
3808
|
/**
|
|
3647
|
-
* Paper del menú de `CmsSelectField`.
|
|
3648
|
-
*
|
|
3649
|
-
*
|
|
3809
|
+
* Paper del menú de `CmsSelectField`. Menú M3 común a todos los desplegables:
|
|
3810
|
+
* fondo `menuSurface` (#ECEDF6), sin padding lateral (ítems de borde a borde) y
|
|
3811
|
+
* 8px arriba/abajo; `overflow: hidden` recorta las esquinas del hover.
|
|
3650
3812
|
*/
|
|
3651
3813
|
sxSelectMenuPaper: SxProps<Theme>;
|
|
3652
|
-
/** Lista del menú del select (sin padding
|
|
3814
|
+
/** Lista del menú del select (sin padding ni gap: los ítems van full-bleed). */
|
|
3653
3815
|
sxSelectList: SxProps<Theme>;
|
|
3654
3816
|
/**
|
|
3655
|
-
* Opción del menú del select:
|
|
3656
|
-
* `
|
|
3817
|
+
* Opción del menú del select: full-bleed (sin radio), hover en `neutralHover`
|
|
3818
|
+
* (state layer M3 `onSurface` al 8%, #191C20), activa en `secondary`. El check
|
|
3819
|
+
* va a la derecha.
|
|
3657
3820
|
*/
|
|
3658
3821
|
sxSelectItem: SxProps<Theme>;
|
|
3659
3822
|
/** Check de la opción activa del select. */
|
|
@@ -3702,14 +3865,13 @@ export declare function findPublicationBySlug(sites: SiteSection[], slug: string
|
|
|
3702
3865
|
export declare function findPublicationLabel(sites: SiteSection[], publicationId: string): string;
|
|
3703
3866
|
|
|
3704
3867
|
/**
|
|
3705
|
-
* Familias tipográficas del CMS. `
|
|
3706
|
-
*
|
|
3707
|
-
* `theme/fonts.ts` y se
|
|
3868
|
+
* Familias tipográficas del CMS. `googleSans` = fuente única de todo el CMS
|
|
3869
|
+
* (texto, marca y títulos); reemplaza a Roboto y Product Sans. La `@font-face`
|
|
3870
|
+
* que la carga vive en `theme/fonts.ts` y se inyecta vía el provider MUI.
|
|
3708
3871
|
*/
|
|
3709
3872
|
export declare const fontFamilies: {
|
|
3710
|
-
readonly
|
|
3711
|
-
|
|
3712
|
-
/** Monoespaciada (url del toast de error, fragmentos de código). */
|
|
3873
|
+
readonly googleSans: "\"Google Sans\",\"Helvetica\",\"Arial\",sans-serif";
|
|
3874
|
+
/** Monoespaciada (url del toast de error, fragmentos de código). No es de marca. */
|
|
3713
3875
|
readonly mono: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
|
|
3714
3876
|
};
|
|
3715
3877
|
|
|
@@ -3737,9 +3899,20 @@ export declare function getCommonError(errorCode: string | number | Array<string
|
|
|
3737
3899
|
|
|
3738
3900
|
export declare function getDefaultPublicationSlug(sites: SiteSection[]): string;
|
|
3739
3901
|
|
|
3902
|
+
/** Modo efectivo aplicado al sitio a partir de la preferencia. */
|
|
3903
|
+
export declare function getEffectiveThemeMode(pref: ThemePreference): ThemeMode;
|
|
3904
|
+
|
|
3740
3905
|
/** BCP 47 tag for `Intl` / `toLocaleString` formatting. */
|
|
3741
3906
|
export declare function getIntlLocaleTag(locale: Locale): string;
|
|
3742
3907
|
|
|
3908
|
+
/**
|
|
3909
|
+
* Si un resultado ya devuelto por un server action es un envelope de error con
|
|
3910
|
+
* un código de red (`{ status: 'error', errorCode: 'net.*' }`), devuelve ese
|
|
3911
|
+
* código; si no, `null`. Permite reintentar cuando el fallo de red se detectó
|
|
3912
|
+
* en el servidor (Next→OpenCms) y viajó como `CmsResponse`.
|
|
3913
|
+
*/
|
|
3914
|
+
export declare function getNetworkErrorCodeFromResult(result: unknown): NetworkErrorCode | null;
|
|
3915
|
+
|
|
3743
3916
|
export declare function getProfileAvatarSrc(profile: ProfileGetResponse, options?: ProfileAvatarOptions): string;
|
|
3744
3917
|
|
|
3745
3918
|
export declare function getProfileDisplayName(profile: ProfileGetResponse): string;
|
|
@@ -4144,6 +4317,9 @@ declare interface ISitesServices {
|
|
|
4144
4317
|
authentication: Authentication;
|
|
4145
4318
|
}
|
|
4146
4319
|
|
|
4320
|
+
/** `true` si el código dado es uno de los códigos internos de red. */
|
|
4321
|
+
export declare function isNetworkErrorCode(code: string | null | undefined): boolean;
|
|
4322
|
+
|
|
4147
4323
|
/**
|
|
4148
4324
|
* Decide si un ítem es visible según los permisos de operación del usuario.
|
|
4149
4325
|
*
|
|
@@ -4160,6 +4336,9 @@ declare interface ISitesServices {
|
|
|
4160
4336
|
*/
|
|
4161
4337
|
export declare function isNewContentItemVisible(item: NewContentItem, operationPermissions: string[] | undefined, isAdmin: boolean | undefined): boolean;
|
|
4162
4338
|
|
|
4339
|
+
/** `true` si un código de red debe reintentarse. */
|
|
4340
|
+
export declare function isRetryableNetworkCode(code: string | null | undefined): boolean;
|
|
4341
|
+
|
|
4163
4342
|
declare interface ITagsServices {
|
|
4164
4343
|
axiosApi: AxiosInstance;
|
|
4165
4344
|
authentication: Authentication;
|
|
@@ -4294,8 +4473,30 @@ export declare type NavLinkItem = {
|
|
|
4294
4473
|
accent?: 'ai';
|
|
4295
4474
|
/** Si el href apunta al admin legacy (JSP/Angular), se prefija con `legacyBaseUrl`. */
|
|
4296
4475
|
legacy?: boolean;
|
|
4476
|
+
/**
|
|
4477
|
+
* Si la ruta del Angular master exige el id de publicación al final
|
|
4478
|
+
* (p. ej. `/admin/tags/:idPub`, `/admin/planning/:idPub`), se le agrega
|
|
4479
|
+
* `selectedPublicationId`. Solo aplica junto con `legacy`.
|
|
4480
|
+
*/
|
|
4481
|
+
appendPublicationId?: boolean;
|
|
4297
4482
|
};
|
|
4298
4483
|
|
|
4484
|
+
/** Códigos internos de error de red/servidor (no son del CMS). */
|
|
4485
|
+
export declare const NETWORK_ERROR_CODES: {
|
|
4486
|
+
/** Sin conexión a internet (no se pudo alcanzar el servidor). */
|
|
4487
|
+
readonly offline: "net.offline";
|
|
4488
|
+
/** La petición excedió el timeout. */
|
|
4489
|
+
readonly timeout: "net.timeout";
|
|
4490
|
+
/** El backend no responde (502/503/504). */
|
|
4491
|
+
readonly unavailable: "net.unavailable";
|
|
4492
|
+
/** Error interno del servidor (5xx genérico). */
|
|
4493
|
+
readonly server: "net.server";
|
|
4494
|
+
};
|
|
4495
|
+
|
|
4496
|
+
export declare type NetworkErrorCode = (typeof NETWORK_ERROR_CODES)[keyof typeof NETWORK_ERROR_CODES];
|
|
4497
|
+
|
|
4498
|
+
export declare type NetworkMessageKey = keyof CmsMessages['network'];
|
|
4499
|
+
|
|
4299
4500
|
/** Columna del menú "Nuevo" (Frecuentes / Otros / Videos). */
|
|
4300
4501
|
export declare type NewContentGroup = {
|
|
4301
4502
|
/** Clave i18n del título de la columna (namespace `newMenu`). */
|
|
@@ -6021,6 +6222,11 @@ export declare const ptMessages: {
|
|
|
6021
6222
|
defaultWarning: string;
|
|
6022
6223
|
defaultInfo: string;
|
|
6023
6224
|
};
|
|
6225
|
+
network: {
|
|
6226
|
+
disconnected: string;
|
|
6227
|
+
retrying: string;
|
|
6228
|
+
restored: string;
|
|
6229
|
+
};
|
|
6024
6230
|
userAvatar: {
|
|
6025
6231
|
alt: string;
|
|
6026
6232
|
unknownUser: string;
|
|
@@ -6143,6 +6349,12 @@ export declare const radii: {
|
|
|
6143
6349
|
readonly pill: "999px";
|
|
6144
6350
|
};
|
|
6145
6351
|
|
|
6352
|
+
/** Modo efectivo leído directo de `localStorage`. SSR-safe. */
|
|
6353
|
+
export declare function readEffectiveThemeMode(): ThemeMode;
|
|
6354
|
+
|
|
6355
|
+
/** Lee la preferencia de `localStorage`. SSR-safe (fallback al default). */
|
|
6356
|
+
export declare function readThemePreference(): ThemePreference;
|
|
6357
|
+
|
|
6146
6358
|
/** Receta del CMS. La forma exacta depende del recurso y del formato pedido. */
|
|
6147
6359
|
export declare interface Recipe {
|
|
6148
6360
|
[key: string]: unknown;
|
|
@@ -6308,6 +6520,19 @@ export declare interface RecipesPublishCheckResponse extends CmsResponse {
|
|
|
6308
6520
|
[key: string]: unknown;
|
|
6309
6521
|
}
|
|
6310
6522
|
|
|
6523
|
+
export declare type ResilientRunner = <T>(fn: () => Promise<T>, options?: ResilientRunOptions) => Promise<T>;
|
|
6524
|
+
|
|
6525
|
+
export declare interface ResilientRunOptions {
|
|
6526
|
+
/** Servicio/endpoint (para el detalle del toast, si el resultado es error). */
|
|
6527
|
+
service?: string;
|
|
6528
|
+
/** Params de la llamada (para el detalle del toast). */
|
|
6529
|
+
params?: Record<string, unknown>;
|
|
6530
|
+
/** Máximo de reintentos con backoff (fallos de servidor/timeout). Default 3. */
|
|
6531
|
+
maxRetries?: number;
|
|
6532
|
+
/** Mostrar el toast "reintentando" al reanudar tras una desconexión. Default true. */
|
|
6533
|
+
notifyRetry?: boolean;
|
|
6534
|
+
}
|
|
6535
|
+
|
|
6311
6536
|
export declare function resolveCmsAssetUrl(path: string, cmsOrigin?: string): string;
|
|
6312
6537
|
|
|
6313
6538
|
export declare function resolveCmsOrigin(cmsOrigin?: string): string;
|
|
@@ -6451,13 +6676,15 @@ export declare type SelectOption = {
|
|
|
6451
6676
|
* importarlo para construir un trigger/menú coherente con el sistema.
|
|
6452
6677
|
*
|
|
6453
6678
|
* Reglas de color (todas con variables de `variables.ts`):
|
|
6454
|
-
* - Trigger por defecto: borde `
|
|
6455
|
-
* (#000) en negrita, fondo transparente; hover → `
|
|
6679
|
+
* - Trigger por defecto: borde `m3.outlineVariant` (#C4C6CF), texto `controlText`
|
|
6680
|
+
* (#000) en negrita, fondo transparente; hover → `neutralHover` (state layer
|
|
6681
|
+
* M3 `onSurface` al 8%, #191C20).
|
|
6456
6682
|
* - Trigger activo (abierto) o resaltado (valor activo): fondo `secondary`
|
|
6457
6683
|
* (#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
|
|
6684
|
+
* - Opción del menú: hover → `neutralHover` (state layer M3 `onSurface` al 8%,
|
|
6685
|
+
* #191C20); seleccionada → fondo `secondary` (#D8E2FF). El menú es full-bleed
|
|
6686
|
+
* (sin padding lateral ni radio en los ítems): el resaltado llega de borde a
|
|
6687
|
+
* borde, sobre el fondo `menuSurface` (#ECEDF6) común a todos los desplegables.
|
|
6461
6688
|
*/
|
|
6462
6689
|
export declare const SelectStyles: {
|
|
6463
6690
|
/**
|
|
@@ -6510,7 +6737,7 @@ export declare type SidebarProps = {
|
|
|
6510
6737
|
* todo. El anclado se identifica por `item.module` y persiste vía
|
|
6511
6738
|
* `profileServices.addPins`/`deletePins`/`getPins` (recurso de perfil).
|
|
6512
6739
|
*/
|
|
6513
|
-
export declare function SidebarRail({ pathname, permissions, LinkComponent, legacyBaseUrl, items, profileServices, }: SidebarRailProps): JSX.Element;
|
|
6740
|
+
export declare function SidebarRail({ pathname, permissions, LinkComponent, legacyBaseUrl, selectedPublicationId, items, profileServices, }: SidebarRailProps): JSX.Element;
|
|
6514
6741
|
|
|
6515
6742
|
/** Servicio de pines usado por el rail: solo necesita estos tres métodos. */
|
|
6516
6743
|
export declare type SidebarRailPinService = Pick<CmsProfileServices, 'addPins' | 'deletePins' | 'getPins'>;
|
|
@@ -6521,6 +6748,8 @@ export declare type SidebarRailProps = {
|
|
|
6521
6748
|
permissions: Array<NavItemPermissions>;
|
|
6522
6749
|
/** Dominio del admin legacy (JSP/Angular) para prefijar hrefs con `item.legacy`. */
|
|
6523
6750
|
legacyBaseUrl?: string;
|
|
6751
|
+
/** Id de publicación activa; se agrega a los ítems legacy con `appendPublicationId`. */
|
|
6752
|
+
selectedPublicationId?: string;
|
|
6524
6753
|
/** Ítems de navegación. Por defecto, `ACCOUNT_NAV_BLOCKS`. */
|
|
6525
6754
|
items?: NavLinkItem[];
|
|
6526
6755
|
/**
|
|
@@ -6624,8 +6853,8 @@ export declare const sizes: {
|
|
|
6624
6853
|
readonly buttonHeight: 40;
|
|
6625
6854
|
/** Alto de botones/triggers compactos (selector de sitios). */
|
|
6626
6855
|
readonly buttonHeightSm: 34;
|
|
6627
|
-
/** Alto del campo buscador (`CmsSearchField`). */
|
|
6628
|
-
readonly searchHeight:
|
|
6856
|
+
/** Alto del campo buscador (`CmsSearchField`): igual al del filtro (`buttonHeight`). */
|
|
6857
|
+
readonly searchHeight: 40;
|
|
6629
6858
|
};
|
|
6630
6859
|
|
|
6631
6860
|
export declare type SourceColors = typeof sourceColors;
|
|
@@ -6858,6 +7087,27 @@ export declare type TextFieldConfig = BaseFieldConfig & {
|
|
|
6858
7087
|
type?: 'text' | 'email' | 'url';
|
|
6859
7088
|
};
|
|
6860
7089
|
|
|
7090
|
+
/**
|
|
7091
|
+
* Atributo que MUI togglea en `<html>` (coincide con `colorSchemeSelector` de
|
|
7092
|
+
* `createAppTheme`). Las CSS vars `--cms-*` y `--mui-palette-*` se enganchan acá.
|
|
7093
|
+
*/
|
|
7094
|
+
export declare const THEME_COLOR_SCHEME_ATTRIBUTE = "data-mui-color-scheme";
|
|
7095
|
+
|
|
7096
|
+
/** Clave de localStorage para el switch "Tema nuevo". */
|
|
7097
|
+
export declare const THEME_ENABLED_STORAGE_KEY = "cms-theme-enabled";
|
|
7098
|
+
|
|
7099
|
+
/** Clave de localStorage para el modo deseado (`light`/`dark`). */
|
|
7100
|
+
export declare const THEME_MODE_STORAGE_KEY = "cms-theme-mode";
|
|
7101
|
+
|
|
7102
|
+
export declare type ThemeMode = 'light' | 'dark';
|
|
7103
|
+
|
|
7104
|
+
export declare type ThemePreference = {
|
|
7105
|
+
/** Switch "Tema nuevo" del menú Apariencia. Off → se fuerza claro. */
|
|
7106
|
+
enabled: boolean;
|
|
7107
|
+
/** Modo deseado por el usuario (se recuerda aunque `enabled` esté off). */
|
|
7108
|
+
mode: ThemeMode;
|
|
7109
|
+
};
|
|
7110
|
+
|
|
6861
7111
|
/**
|
|
6862
7112
|
* Detalle extra que enriquece el toast de error (replica el toast de error del
|
|
6863
7113
|
* Angular legacy: detalle copiable con url/servicio/params/versión).
|
|
@@ -7237,6 +7487,11 @@ export declare interface UploadResponse extends CmsResponse {
|
|
|
7237
7487
|
[key: string]: unknown;
|
|
7238
7488
|
}
|
|
7239
7489
|
|
|
7490
|
+
/**
|
|
7491
|
+
* Lee el estado de conectividad. Debe usarse dentro de `<CmsNetworkProvider>`.
|
|
7492
|
+
*/
|
|
7493
|
+
export declare function useCmsNetworkStatus(): CmsNetworkContextValue;
|
|
7494
|
+
|
|
7240
7495
|
/**
|
|
7241
7496
|
* Hook para disparar toasts. Debe usarse dentro de `CmsToastProvider`.
|
|
7242
7497
|
*/
|
|
@@ -7270,7 +7525,7 @@ export declare function useCurrentUserPhoto(): CurrentUserPhotoContextValue | nu
|
|
|
7270
7525
|
* nombre y textos traducidos (es/en/pt). Reacciona al cambio de la prop `photo`;
|
|
7271
7526
|
* para el usuario logueado, reacciona además al `CurrentUserPhotoProvider`.
|
|
7272
7527
|
*/
|
|
7273
|
-
export declare function UserAvatar({ photo, description, username, size, showTooltip, cmsOrigin, crossOrigin, isCurrentUser, onClick, testId, }: UserAvatarProps): JSX.Element;
|
|
7528
|
+
export declare function UserAvatar({ photo, description, username, size, showTooltip, inactive, cmsOrigin, crossOrigin, isCurrentUser, onClick, testId, }: UserAvatarProps): JSX.Element;
|
|
7274
7529
|
|
|
7275
7530
|
export declare type UserAvatarMessageKey = keyof CmsMessages['userAvatar'];
|
|
7276
7531
|
|
|
@@ -7289,6 +7544,11 @@ export declare type UserAvatarProps = {
|
|
|
7289
7544
|
size?: number;
|
|
7290
7545
|
/** Muestra el tooltip con el nombre al pasar el mouse. Por defecto `true`. */
|
|
7291
7546
|
showTooltip?: boolean;
|
|
7547
|
+
/**
|
|
7548
|
+
* Marca al usuario como inactivo/desactivado: el avatar cae a un gris apagado
|
|
7549
|
+
* (fondo y ícono más grises). Por defecto `false`.
|
|
7550
|
+
*/
|
|
7551
|
+
inactive?: boolean;
|
|
7292
7552
|
/** Origen del CMS para resolver rutas relativas de la foto. */
|
|
7293
7553
|
cmsOrigin?: string;
|
|
7294
7554
|
/**
|
|
@@ -7308,6 +7568,31 @@ export declare type UserAvatarProps = {
|
|
|
7308
7568
|
testId?: string;
|
|
7309
7569
|
};
|
|
7310
7570
|
|
|
7571
|
+
/**
|
|
7572
|
+
* Envuelve la invocación de un server action para hacerla **resiliente a la
|
|
7573
|
+
* red**, replicando el comportamiento del Angular legacy:
|
|
7574
|
+
*
|
|
7575
|
+
* - **Sin internet (usuario offline):** no se pierde la acción. Se espera —sin
|
|
7576
|
+
* consumir reintentos— a que vuelva la conexión y entonces se **retoma el
|
|
7577
|
+
* llamado** automáticamente (muestra "reintentando…").
|
|
7578
|
+
* - **Backend caído / timeout / 5xx (con internet):** reintenta con backoff
|
|
7579
|
+
* exponencial (1s, 2s, 4s, 8s) hasta `maxRetries`; luego devuelve el
|
|
7580
|
+
* resultado de error para que el caller muestre el toast.
|
|
7581
|
+
* - **Error de negocio (4xx / `status:'fail'`):** no reintenta; devuelve el
|
|
7582
|
+
* resultado tal cual para que el caller decida (toast/update optimista).
|
|
7583
|
+
*
|
|
7584
|
+
* El toast global de "sin conexión" / "conexión restablecida" lo dispara
|
|
7585
|
+
* `CmsNetworkToaster`; este hook solo añade el "reintentando…" por acción.
|
|
7586
|
+
*
|
|
7587
|
+
* Uso en el gestor:
|
|
7588
|
+
* ```ts
|
|
7589
|
+
* const run = useResilientAction();
|
|
7590
|
+
* const res = await run(() => setUserStatus(slug, id, action),
|
|
7591
|
+
* { service: '/users/actions/setStatus', params: { id, action } });
|
|
7592
|
+
* ```
|
|
7593
|
+
*/
|
|
7594
|
+
export declare function useResilientAction(): ResilientRunner;
|
|
7595
|
+
|
|
7311
7596
|
/** Grupo del sistema devuelto por POST /users/groups/get. */
|
|
7312
7597
|
export declare interface UserGroup {
|
|
7313
7598
|
id: string;
|
|
@@ -7842,6 +8127,12 @@ export declare interface WorkpaperStatusResponse extends CmsResponse {
|
|
|
7842
8127
|
ediciones: WorkpaperEdition[];
|
|
7843
8128
|
}
|
|
7844
8129
|
|
|
8130
|
+
/**
|
|
8131
|
+
* Guarda la preferencia y refleja el modo efectivo en el atributo de `<html>`
|
|
8132
|
+
* de una (para que el cambio se vea sin recargar). SSR-safe.
|
|
8133
|
+
*/
|
|
8134
|
+
export declare function writeThemePreference(pref: ThemePreference): void;
|
|
8135
|
+
|
|
7845
8136
|
/** Cuerpo de la respuesta de POST /videos/youtube/getThumbnails. */
|
|
7846
8137
|
export declare interface YoutubeThumbnailsResponse extends CmsResponse {
|
|
7847
8138
|
[key: string]: unknown;
|