sass-cms-template-common 0.0.35 → 0.0.36
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 +147 -11
- package/dist/index.js +1694 -1287
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ import { Theme } from '@mui/material/styles';
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const ACCOUNT_NAV_BLOCKS: NavBlock[];
|
|
26
26
|
|
|
27
|
+
/** Módulo del Authenticator que guarda los pines del menú de cmsmedios. */
|
|
28
|
+
export declare const ADMIN_ANGULAR_MODULE = "admin-angular";
|
|
29
|
+
|
|
27
30
|
/**
|
|
28
31
|
* Catálogo de mensajes del gestor por idioma. Cada gestor declara su propio
|
|
29
32
|
* `en` como fuente de la forma y valida `es`/`pt` con `satisfies typeof enTree`
|
|
@@ -43,7 +46,7 @@ export declare type AppMessageNode = string | {
|
|
|
43
46
|
/** Árbol de mensajes del gestor (namespaces → claves → string anidable). */
|
|
44
47
|
export declare type AppMessages = Record<string, AppMessageNode>;
|
|
45
48
|
|
|
46
|
-
export declare function AppShell({ pathname, sites, children, notificationUnreadCount, notificationsData, copilotSuggestionsHref, onEditorialSeeMore, onEditorialRemindLater, onNotificationsOpen, notificationsLoading, profile, primaryLogo, brandLogo, selectedPublicationId, getPublicationHref, resolvePublicationImageUrl, profileAvatarOptions, legacyBaseUrl, cmsBaseUrl, legacySession, previewFormats, operationPermissions, isAdmin, onPreviewSelect, showAppearanceMenu, LinkComponent, permissions, navHrefOverrides, locale, language, messages, appMessages, baseUrl, profileServices, }: AppShellProps): JSX.Element;
|
|
49
|
+
export declare function AppShell({ pathname, sites, children, notificationUnreadCount, notificationsData, copilotSuggestionsHref, onEditorialSeeMore, onEditorialRemindLater, onNotificationsOpen, notificationsLoading, profile, primaryLogo, brandLogo, selectedPublicationId, getPublicationHref, resolvePublicationImageUrl, profileAvatarOptions, legacyBaseUrl, cmsBaseUrl, legacySession, previewFormats, operationPermissions, isAdmin, onPreviewSelect, showAppearanceMenu, LinkComponent, permissions, navHrefOverrides, locale, language, messages, appMessages, baseUrl, profileServices, sidebarAuthService, }: AppShellProps): JSX.Element;
|
|
47
50
|
|
|
48
51
|
export declare type AppShellProps = {
|
|
49
52
|
pathname: string;
|
|
@@ -111,6 +114,11 @@ export declare type AppShellProps = {
|
|
|
111
114
|
* accesos es solo visual y no persiste entre sesiones.
|
|
112
115
|
*/
|
|
113
116
|
profileServices?: SidebarRailPinService;
|
|
117
|
+
/**
|
|
118
|
+
* Pines y módulos hermanos del Authenticator (como cmsmedios). Si se pasa, el
|
|
119
|
+
* menú lateral lo usa en vez de los pines de `profileServices`.
|
|
120
|
+
*/
|
|
121
|
+
sidebarAuthService?: SidebarRailAuthService;
|
|
114
122
|
};
|
|
115
123
|
|
|
116
124
|
/** Traductor genérico de claves del gestor por ruta con puntos (`ns.clave`). */
|
|
@@ -264,6 +272,13 @@ export declare interface AuthPermissionsResponse extends CmsResponse {
|
|
|
264
272
|
[key: string]: unknown;
|
|
265
273
|
}
|
|
266
274
|
|
|
275
|
+
/** Identidad del pin en el Authenticator. */
|
|
276
|
+
declare type AuthPinRef = {
|
|
277
|
+
moduleName: string;
|
|
278
|
+
itemKey: string;
|
|
279
|
+
pinned: boolean;
|
|
280
|
+
};
|
|
281
|
+
|
|
267
282
|
/** Cuerpo de la respuesta de POST /auth/relogin. */
|
|
268
283
|
export declare interface AuthReloginResponse extends CmsResponse, AuthSessionData {
|
|
269
284
|
}
|
|
@@ -296,6 +311,30 @@ export declare interface AuthSessionResult extends CmsResponse {
|
|
|
296
311
|
/** Respuesta de POST /auth/setNewPassword. */
|
|
297
312
|
export declare type AuthSetNewPasswordResponse = AuthSessionResult;
|
|
298
313
|
|
|
314
|
+
/** Ítem de `GET /api/v1/auth/sidebar` (lo que el menú usa). */
|
|
315
|
+
export declare type AuthSidebarItem = {
|
|
316
|
+
itemKey: string;
|
|
317
|
+
translations?: Record<string, string>;
|
|
318
|
+
icon?: string | null;
|
|
319
|
+
href?: string | null;
|
|
320
|
+
pinned?: boolean;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
export declare type AuthSidebarResponse = {
|
|
324
|
+
sections?: AuthSidebarSection[];
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
/** Módulo (webapp) de `GET /api/v1/auth/sidebar`. */
|
|
328
|
+
export declare type AuthSidebarSection = {
|
|
329
|
+
moduleName: string;
|
|
330
|
+
translations?: Record<string, string>;
|
|
331
|
+
icon?: string | null;
|
|
332
|
+
url?: string | null;
|
|
333
|
+
/** `false` = solo aporta ítems; no es una webapp a la que saltar. */
|
|
334
|
+
sidebarHost?: boolean;
|
|
335
|
+
items?: AuthSidebarItem[];
|
|
336
|
+
};
|
|
337
|
+
|
|
299
338
|
/** Propiedades comunes a todos los campos de la configuración. */
|
|
300
339
|
declare type BaseFieldConfig = {
|
|
301
340
|
/** Identificador único del campo (clave en `FieldValues`). */
|
|
@@ -351,6 +390,17 @@ export declare type BtnDropdownProps = {
|
|
|
351
390
|
testId?: string;
|
|
352
391
|
};
|
|
353
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Aplica sobre el menú lo mismo que cmsmedios toma del Authenticator:
|
|
395
|
+
* 1. Pines de `admin-angular` (su `itemKey` en mayúsculas = `module` del ítem).
|
|
396
|
+
* Van arriba en el orden de cmsmedios: sección por sección, de atrás hacia
|
|
397
|
+
* adelante (primero los hijos anclados de un ítem con submenú). Salen de su
|
|
398
|
+
* lugar original.
|
|
399
|
+
* 2. Pines de otras apps: también arriba, como links a esa app.
|
|
400
|
+
* 3. Módulos hermanos (`sidebarHost !== false`): al final de la primera sección.
|
|
401
|
+
*/
|
|
402
|
+
export declare function buildCmsmediosMenu(groups: NavLinkItem[][], permissions: Array<NavItemPermissions>, sidebar: AuthSidebarResponse | null, locale: string, selectedPublicationId?: string): CmsmediosMenuLayout;
|
|
403
|
+
|
|
354
404
|
/**
|
|
355
405
|
* Construye el catálogo estándar de campos de "Búsqueda avanzada" del CMS con
|
|
356
406
|
* los textos por defecto de la librería (resueltos al idioma activo). Es lo que
|
|
@@ -532,6 +582,23 @@ export declare interface ClassifiedNetworkError {
|
|
|
532
582
|
*/
|
|
533
583
|
export declare function classifyNetworkError(error: unknown): ClassifiedNetworkError | null;
|
|
534
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Menú lateral igual al de cmsmedios y al del gestor de noticias (NAA-5415):
|
|
587
|
+
* copia del `CMS_MENU_CATALOG` de `bluestack-cms-news`
|
|
588
|
+
* (`src/components/sidebar/cmsMenuCatalog.ts`), que a su vez copia el
|
|
589
|
+
* `defaultMenuSections` de `cmsmedios-ux` (`menu.service.ts`). Si cambia allá,
|
|
590
|
+
* se replica acá: entre gestores de React el menú tiene que ser el mismo.
|
|
591
|
+
*
|
|
592
|
+
* Tres secciones separadas por una línea. Dentro de cada una, el orden es el
|
|
593
|
+
* de cmsmedios (alfabético por el texto fijo en español, igual en todos los
|
|
594
|
+
* idiomas) con "Otros" al final de la primera. Ya viene ordenado: el filtro por
|
|
595
|
+
* módulos/permisos solo quita ítems, no reordena.
|
|
596
|
+
*
|
|
597
|
+
* Los ítems de otros gestores React (Noticias, CoPilot, Usuarios) los resuelve
|
|
598
|
+
* cada gestor con `navHrefOverrides`; el href de acá es el de respaldo.
|
|
599
|
+
*/
|
|
600
|
+
export declare const CMS_MENU_SECTIONS: NavLinkItem[][];
|
|
601
|
+
|
|
535
602
|
/**
|
|
536
603
|
* Contenedor de "Búsqueda avanzada" reutilizable y declarativo. Recibe una lista
|
|
537
604
|
* de `fields` y los renderiza en una grilla, manejando el estado del formulario
|
|
@@ -1392,6 +1459,13 @@ export declare type CmsLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
1392
1459
|
children?: ReactNode;
|
|
1393
1460
|
};
|
|
1394
1461
|
|
|
1462
|
+
/** Menú ya resuelto: anclados arriba, secciones y la identidad de pin de cada ítem. */
|
|
1463
|
+
declare type CmsmediosMenuLayout = {
|
|
1464
|
+
pinned: NavLinkItem[];
|
|
1465
|
+
groups: NavLinkItem[][];
|
|
1466
|
+
pinRefs: Map<NavLinkItem, AuthPinRef>;
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1395
1469
|
/** Message tree shape; values are strings, keys are inferred from `enMessages`. */
|
|
1396
1470
|
export declare type CmsMessages = DeepStringMap<typeof enMessages>;
|
|
1397
1471
|
|
|
@@ -3425,29 +3499,29 @@ export declare const enMessages: {
|
|
|
3425
3499
|
readonly COMMENTS: "Comments";
|
|
3426
3500
|
readonly POLLS: "Polls";
|
|
3427
3501
|
readonly MEDIA: "Media";
|
|
3428
|
-
readonly AUDIOS: "
|
|
3502
|
+
readonly AUDIOS: "Audios";
|
|
3429
3503
|
readonly IMAGES: "Images";
|
|
3430
3504
|
readonly PLAYLISTS: "Playlist";
|
|
3431
3505
|
readonly VIDEOS: "Videos";
|
|
3432
|
-
readonly NEWS: "
|
|
3506
|
+
readonly NEWS: "Posts";
|
|
3433
3507
|
readonly PLANNING: "Planning";
|
|
3434
3508
|
readonly ANALYTICS: "Analytics";
|
|
3435
3509
|
readonly TAGS: "Tags";
|
|
3436
|
-
readonly TRIVIAS: "
|
|
3437
|
-
readonly OTHERS: "
|
|
3510
|
+
readonly TRIVIAS: "Trivias";
|
|
3511
|
+
readonly OTHERS: "Others";
|
|
3438
3512
|
readonly NEWSWIRES: "News Wires";
|
|
3439
3513
|
readonly EVENTS: "Events";
|
|
3440
|
-
readonly PAGES: "
|
|
3514
|
+
readonly PAGES: "Explorer";
|
|
3441
3515
|
readonly FEEDS: "Feed";
|
|
3442
3516
|
readonly PERSONS: "People";
|
|
3443
3517
|
readonly CONTRIBUTIONS: "Contributions";
|
|
3444
3518
|
readonly RECIPES: "Recipes";
|
|
3445
|
-
readonly POSTS: "
|
|
3519
|
+
readonly POSTS: "UGC";
|
|
3446
3520
|
readonly BANNERS: "Banners";
|
|
3447
3521
|
readonly BLOCKS: "Blocks";
|
|
3448
3522
|
readonly MENUS: "Menu";
|
|
3449
|
-
readonly TOPICS: "
|
|
3450
|
-
readonly ADVANCEDQUERYS: "
|
|
3523
|
+
readonly TOPICS: "Themes";
|
|
3524
|
+
readonly ADVANCEDQUERYS: "Search";
|
|
3451
3525
|
readonly IMPORTS: "Imports";
|
|
3452
3526
|
readonly NEWSLETTERS: "Newsletters";
|
|
3453
3527
|
readonly NOTIFICATIONS: "Notifications";
|
|
@@ -3460,6 +3534,12 @@ export declare const enMessages: {
|
|
|
3460
3534
|
readonly COPILOT: "CoPilot";
|
|
3461
3535
|
readonly ZONES: "Zones";
|
|
3462
3536
|
readonly IA: "IA";
|
|
3537
|
+
readonly PRODUCTION: "Production";
|
|
3538
|
+
readonly FREQUENCY: "Frequency";
|
|
3539
|
+
readonly VODS: "Videos OnDemand";
|
|
3540
|
+
readonly SUBSCRIPTIONS: "Subscriptions";
|
|
3541
|
+
readonly MYPLAN: "Production";
|
|
3542
|
+
readonly USERS_MANAGER: "Users";
|
|
3463
3543
|
};
|
|
3464
3544
|
readonly sidebar: {
|
|
3465
3545
|
readonly navAriaLabel: "Main navigation";
|
|
@@ -3698,6 +3778,12 @@ export declare const esMessages: {
|
|
|
3698
3778
|
COPILOT: string;
|
|
3699
3779
|
ZONES: string;
|
|
3700
3780
|
IA: string;
|
|
3781
|
+
PRODUCTION: string;
|
|
3782
|
+
FREQUENCY: string;
|
|
3783
|
+
VODS: string;
|
|
3784
|
+
SUBSCRIPTIONS: string;
|
|
3785
|
+
MYPLAN: string;
|
|
3786
|
+
USERS_MANAGER: string;
|
|
3701
3787
|
};
|
|
3702
3788
|
sidebar: {
|
|
3703
3789
|
navAriaLabel: string;
|
|
@@ -4230,6 +4316,13 @@ export declare function formatSiteDateTime(epochMs: number, gmtRedaction: string
|
|
|
4230
4316
|
|
|
4231
4317
|
export declare function getAllPublications(sites: SiteSection[]): Publication[];
|
|
4232
4318
|
|
|
4319
|
+
/**
|
|
4320
|
+
* Ícono a partir del nombre que guarda el Authenticator (`"PollIcon"`), en su
|
|
4321
|
+
* variante Outlined. El barrel de íconos se baja aparte y solo para estos
|
|
4322
|
+
* ítems; mientras llega (o si el nombre no existe) se ve el genérico.
|
|
4323
|
+
*/
|
|
4324
|
+
export declare function getAuthSidebarIcon(name?: string | null): ElementType;
|
|
4325
|
+
|
|
4233
4326
|
/**
|
|
4234
4327
|
* Resuelve el mensaje legible de un código de error en el idioma indicado.
|
|
4235
4328
|
* Aplica el fallback legacy `código → código+'a'` (p. ej. `999.002` → `999.002a`)
|
|
@@ -4872,6 +4965,16 @@ export declare type NavLinkItem = {
|
|
|
4872
4965
|
module: string;
|
|
4873
4966
|
/** Override opcional del label traducido vía i18n (`navigation.{module}`). */
|
|
4874
4967
|
label?: string;
|
|
4968
|
+
/**
|
|
4969
|
+
* Clave i18n de `navigation` cuando no coincide con `module` (p. ej. PLANS y
|
|
4970
|
+
* MYPLAN se leen los dos como `PRODUCTION`). Si falta, se usa `module`.
|
|
4971
|
+
*/
|
|
4972
|
+
labelKey?: string;
|
|
4973
|
+
/**
|
|
4974
|
+
* Se dibuja aunque su `module` no venga en `modulesAvailable` (ítems que manda
|
|
4975
|
+
* el Authenticator: pines de otras apps y módulos hermanos).
|
|
4976
|
+
*/
|
|
4977
|
+
alwaysVisible?: boolean;
|
|
4875
4978
|
badge?: string;
|
|
4876
4979
|
children?: NavLinkItem[];
|
|
4877
4980
|
defaultOpen?: boolean;
|
|
@@ -6510,6 +6613,12 @@ export declare const ptMessages: {
|
|
|
6510
6613
|
COPILOT: string;
|
|
6511
6614
|
ZONES: string;
|
|
6512
6615
|
IA: string;
|
|
6616
|
+
PRODUCTION: string;
|
|
6617
|
+
FREQUENCY: string;
|
|
6618
|
+
VODS: string;
|
|
6619
|
+
SUBSCRIPTIONS: string;
|
|
6620
|
+
MYPLAN: string;
|
|
6621
|
+
USERS_MANAGER: string;
|
|
6513
6622
|
};
|
|
6514
6623
|
sidebar: {
|
|
6515
6624
|
navAriaLabel: string;
|
|
@@ -7271,7 +7380,20 @@ export declare type SidebarProps = {
|
|
|
7271
7380
|
* todo. El anclado se identifica por `item.module` y persiste vía
|
|
7272
7381
|
* `profileServices.addPins`/`deletePins`/`getPins` (recurso de perfil).
|
|
7273
7382
|
*/
|
|
7274
|
-
export declare function SidebarRail({ pathname, permissions, LinkComponent, legacyBaseUrl, cmsBaseUrl, legacySession, selectedPublicationId, navHrefOverrides, items, profileServices, }: SidebarRailProps): JSX.Element;
|
|
7383
|
+
export declare function SidebarRail({ pathname, permissions, LinkComponent, legacyBaseUrl, cmsBaseUrl, legacySession, selectedPublicationId, navHrefOverrides, items, sections, profileServices, authService, }: SidebarRailProps): JSX.Element;
|
|
7384
|
+
|
|
7385
|
+
/**
|
|
7386
|
+
* Pines y módulos hermanos del Authenticator, igual que cmsmedios
|
|
7387
|
+
* (`MenuService.mergeWithAuthenticatorSidebar` + `PinesService`). El gestor lo
|
|
7388
|
+
* arma con su token y la publicación actual:
|
|
7389
|
+
* - `getSidebar` → `GET /api/v1/auth/sidebar?publicationId=N`
|
|
7390
|
+
* - `pin` / `unpin` → `POST` / `DELETE /api/v1/auth/sidebar/pin`
|
|
7391
|
+
*/
|
|
7392
|
+
export declare type SidebarRailAuthService = {
|
|
7393
|
+
getSidebar: () => Promise<AuthSidebarResponse>;
|
|
7394
|
+
pin: (moduleName: string, itemKey: string) => Promise<void>;
|
|
7395
|
+
unpin: (moduleName: string, itemKey: string) => Promise<void>;
|
|
7396
|
+
};
|
|
7275
7397
|
|
|
7276
7398
|
/** Servicio de pines usado por el rail: solo necesita estos tres métodos. */
|
|
7277
7399
|
export declare type SidebarRailPinService = Pick<CmsProfileServices, 'addPins' | 'deletePins' | 'getPins'>;
|
|
@@ -7293,14 +7415,28 @@ export declare type SidebarRailProps = {
|
|
|
7293
7415
|
* gestor hermano para el ajeno). Misma pestaña. Ver `resolveNavHrefOverride`.
|
|
7294
7416
|
*/
|
|
7295
7417
|
navHrefOverrides?: Record<string, string>;
|
|
7296
|
-
/**
|
|
7418
|
+
/**
|
|
7419
|
+
* Ítems en una sola lista, sin separadores. Si se pasa, gana sobre `sections`
|
|
7420
|
+
* (compatibilidad con los gestores que mandaban su propia lista).
|
|
7421
|
+
*/
|
|
7297
7422
|
items?: NavLinkItem[];
|
|
7423
|
+
/**
|
|
7424
|
+
* Ítems agrupados en secciones separadas por una línea. Por defecto,
|
|
7425
|
+
* `CMS_MENU_SECTIONS`: el mismo menú que cmsmedios y el gestor de noticias.
|
|
7426
|
+
*/
|
|
7427
|
+
sections?: NavLinkItem[][];
|
|
7298
7428
|
/**
|
|
7299
7429
|
* Servicio de pines (`CmsProfileServices`, construido por el host con su
|
|
7300
7430
|
* `axiosApi`/`authentication`). Si se omite, el anclado es solo visual y no
|
|
7301
7431
|
* persiste entre sesiones.
|
|
7302
7432
|
*/
|
|
7303
7433
|
profileServices?: SidebarRailPinService;
|
|
7434
|
+
/**
|
|
7435
|
+
* Pines y módulos hermanos del Authenticator, como cmsmedios. Si se pasa,
|
|
7436
|
+
* reemplaza a `profileServices` (pines viejos del perfil del CMS) y el orden
|
|
7437
|
+
* de los anclados es el de cmsmedios. Ver `buildCmsmediosMenu`.
|
|
7438
|
+
*/
|
|
7439
|
+
authService?: SidebarRailAuthService;
|
|
7304
7440
|
};
|
|
7305
7441
|
|
|
7306
7442
|
/**
|