@solercia/ui 0.6.0 → 0.7.0
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/CHANGELOG.md +110 -0
- package/README.md +30 -0
- package/fesm2022/solercia-ui-login-appearance.mjs +1806 -0
- package/fesm2022/solercia-ui-login-appearance.mjs.map +1 -0
- package/fesm2022/solercia-ui-theme-studio.mjs +2023 -823
- package/fesm2022/solercia-ui-theme-studio.mjs.map +1 -1
- package/fesm2022/solercia-ui.mjs +563 -81
- package/fesm2022/solercia-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/types/solercia-ui-login-appearance.d.ts +379 -0
- package/types/solercia-ui-theme-studio.d.ts +206 -52
- package/types/solercia-ui.d.ts +139 -13
|
@@ -2,6 +2,7 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, OnInit, OnDestroy } from '@angular/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { ThemeFile, ThemeMode, SolTableVariant, ThemeLogo } from '@solercia/ui';
|
|
5
|
+
import { ThemeLogin, LoginPhotoUploader } from '@solercia/ui/login-appearance';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Una versión guardada del tema del tenant. El `ThemeFile` NO lleva campo de versión: el
|
|
@@ -38,9 +39,11 @@ interface ThemeStudioStore {
|
|
|
38
39
|
load(): Observable<ThemeFile | null>;
|
|
39
40
|
/**
|
|
40
41
|
* Persiste el tema. `sourceVersionId` es la versión restaurada en la que se basó el cambio
|
|
41
|
-
* (o `null`). Puede devolver la versión creada
|
|
42
|
+
* (o `null`). Puede devolver la versión creada o el tema TAL COMO QUEDÓ PERSISTIDO: con un
|
|
43
|
+
* `ThemeFile` la pantalla lo empuja con `ThemeService.setTenantTheme` (sin volver a pedirlo);
|
|
44
|
+
* sin él, llama a `ThemeService.refresh()`.
|
|
42
45
|
*/
|
|
43
|
-
apply(theme: ThemeFile, sourceVersionId?: ThemeVersion['id'] | null): Observable<ThemeVersion | void>;
|
|
46
|
+
apply(theme: ThemeFile, sourceVersionId?: ThemeVersion['id'] | null): Observable<ThemeVersion | ThemeFile | void>;
|
|
44
47
|
/** Historial paginado; `before` es el cursor `next` de la página anterior. */
|
|
45
48
|
listVersions?(before?: ThemeVersionPage['next']): Observable<ThemeVersionPage>;
|
|
46
49
|
/** Tema completo de una versión del historial. */
|
|
@@ -48,6 +51,13 @@ interface ThemeStudioStore {
|
|
|
48
51
|
/** Sube una imagen (logo o favicon) y devuelve la URL publicada. */
|
|
49
52
|
uploadLogo?(file: File): Observable<string>;
|
|
50
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Mensaje legible de un error del store, si lo trae. Reconoce la forma de `HttpErrorResponse`
|
|
56
|
+
* (`error.message` o `error.errors[0].message` del cuerpo de la respuesta) y un objeto plano
|
|
57
|
+
* `{ message }` marcado como mensaje para la persona usuaria (`userMessage`). Nunca devuelve el
|
|
58
|
+
* texto técnico de un `Error` cualquiera (por ejemplo, "Http failure response for …").
|
|
59
|
+
*/
|
|
60
|
+
declare function extractStoreErrorMessage(error: unknown): string | null;
|
|
51
61
|
/** Token del puerto de persistencia. Sin proveedor, `<sol-theme-studio>` muestra su estado de error. */
|
|
52
62
|
declare const THEME_STUDIO_STORE: InjectionToken<ThemeStudioStore>;
|
|
53
63
|
|
|
@@ -190,15 +200,63 @@ declare const DEFAULT_TABLE_VARIANT: SolTableVariant;
|
|
|
190
200
|
declare const DEFAULT_STUDIO_FORM: ThemeStudioForm;
|
|
191
201
|
/** Copia profunda del formulario (los bloques por modo son objetos planos). */
|
|
192
202
|
declare function cloneStudioForm(form: ThemeStudioForm): ThemeStudioForm;
|
|
203
|
+
/** Presentación del indicador de carga: como está hoy, centrado sin cortina o con cortina y blur. */
|
|
204
|
+
type StudioLoaderPresentation = 'current' | 'centered' | 'backdrop';
|
|
205
|
+
declare const STUDIO_LOADER_PRESENTATIONS: ReadonlyArray<StudioLoaderPresentation>;
|
|
206
|
+
/** Animación del indicador de carga (giro, latido, sacudida o ninguna). */
|
|
207
|
+
type StudioLoaderAnimation = 'spin' | 'pulse' | 'shake' | 'none';
|
|
208
|
+
declare const STUDIO_LOADER_ANIMATIONS: ReadonlyArray<StudioLoaderAnimation>;
|
|
209
|
+
/**
|
|
210
|
+
* Configuración del indicador de carga que el host guarda en `meta.loader`. `image` es la URL
|
|
211
|
+
* de una imagen subida por archivo; vacía, el host pinta un anillo con el color del tema.
|
|
212
|
+
*/
|
|
213
|
+
interface ThemeLoaderConfig {
|
|
214
|
+
image: string;
|
|
215
|
+
presentation: StudioLoaderPresentation;
|
|
216
|
+
animation: StudioLoaderAnimation;
|
|
217
|
+
}
|
|
218
|
+
declare const DEFAULT_LOADER_CONFIG: ThemeLoaderConfig;
|
|
193
219
|
|
|
194
220
|
/** Aviso que la pantalla emite por `notify`; la aplicación decide cómo mostrarlo (toast, alerta…). */
|
|
195
221
|
interface SolThemeStudioNotice {
|
|
196
|
-
kind: 'success' | 'error' | 'info';
|
|
222
|
+
kind: 'success' | 'error' | 'info' | 'warning';
|
|
197
223
|
/** Clave completa (`sol.themeStudio.*`) por si el host prefiere traducirla con su motor. */
|
|
198
224
|
messageKey: string;
|
|
199
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* Texto ya resuelto en el idioma activo (con el respaldo de la librería). Cuando el store
|
|
227
|
+
* devolvió un mensaje propio (por ejemplo, el del backend), es ese mensaje.
|
|
228
|
+
*/
|
|
200
229
|
message: string;
|
|
201
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Secciones y comportamientos opcionales de `<sol-theme-studio>`. Los valores por defecto
|
|
233
|
+
* reproducen la pantalla de 0.6.0; un host activa lo que necesita.
|
|
234
|
+
*/
|
|
235
|
+
interface SolThemeStudioFeatures {
|
|
236
|
+
/** Campo «Nombre del tema» (`meta.name`) en la sección Marca. Por defecto `true`. */
|
|
237
|
+
themeName?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Sección «Loader / spinner» (`meta.loader`: imagen, presentación y animación) y su muestra en
|
|
240
|
+
* la vista previa. Por defecto `false`.
|
|
241
|
+
*/
|
|
242
|
+
loader?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Clave de `meta` donde el host lee y escribe además la variante de tabla (p. ej.
|
|
245
|
+
* `'tableStyle'`). Al hidratar gana sobre `component.table.variant`. Por defecto, ninguna.
|
|
246
|
+
*/
|
|
247
|
+
tableVariantMetaKey?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Al aplicar, fija `meta.defaultMode` como preferencia EXPLÍCITA de este navegador
|
|
250
|
+
* (`ThemeService.setDarkMode`), para que nadie quede pegado en un modo viejo. Por defecto `false`.
|
|
251
|
+
*/
|
|
252
|
+
persistDefaultModeOnApply?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Pestaña «Inicio de sesión»: editor de `meta.login` (fotos, movimiento, composición por modo y
|
|
255
|
+
* lema) de `@solercia/ui/login-appearance`, con su vista previa. Se guarda con el mismo
|
|
256
|
+
* «Aplicar tema». Por defecto `false`.
|
|
257
|
+
*/
|
|
258
|
+
loginAppearance?: boolean;
|
|
259
|
+
}
|
|
202
260
|
/** Opción de un control segmentado: valor del contrato + clave de su texto. */
|
|
203
261
|
interface SegmentOption {
|
|
204
262
|
value: string | number;
|
|
@@ -213,24 +271,31 @@ interface SegmentGroup<K extends string> {
|
|
|
213
271
|
labelKey: string;
|
|
214
272
|
options: ReadonlyArray<SegmentOption>;
|
|
215
273
|
}
|
|
216
|
-
|
|
274
|
+
/** Imagen que se sube por archivo. */
|
|
275
|
+
type ImageTarget = 'logo' | 'logoDark' | 'favicon' | 'loaderImage';
|
|
217
276
|
type LoadState = 'loading' | 'ready' | 'error' | 'no-store';
|
|
277
|
+
/** Texto de estado: una clave traducible o un texto ya resuelto (p. ej. el mensaje del backend). */
|
|
218
278
|
type StatusMessage = {
|
|
219
279
|
key: string;
|
|
220
280
|
params?: Record<string, unknown>;
|
|
221
|
-
} |
|
|
281
|
+
} | {
|
|
282
|
+
text: string;
|
|
283
|
+
};
|
|
222
284
|
/**
|
|
223
|
-
* `<sol-theme-studio>`: editor visual completo del tema del tenant
|
|
285
|
+
* `<sol-theme-studio>`: editor visual completo del tema del tenant (portado del Theme Studio de
|
|
286
|
+
* PANDORA con el mismo marcado, estilos, textos y comportamiento).
|
|
224
287
|
*
|
|
225
288
|
* - Persistencia por el puerto `THEME_STUDIO_STORE` (la app implementa el adaptador). Los
|
|
226
289
|
* métodos opcionales del store apagan su sección: sin historial o sin carga de imágenes.
|
|
227
|
-
* - Edición: controles COMPARTIDOS (marca,
|
|
228
|
-
* POR MODO (color, roles, sombra, textura, barra
|
|
229
|
-
*
|
|
230
|
-
* -
|
|
231
|
-
*
|
|
232
|
-
* -
|
|
233
|
-
*
|
|
290
|
+
* - Edición: controles COMPARTIDOS (marca, pie, inicio de sesión, modo por defecto, tablas,
|
|
291
|
+
* tipografía, forma, densidad, movimiento) y POR MODO (color, roles, sombra, textura, barra
|
|
292
|
+
* lateral, encabezado) en pestañas claro/oscuro. Secciones opcionales por `features`.
|
|
293
|
+
* - Vista previa aislada al lado de los controles en escritorio (divisor arrastrable, 60/40 por
|
|
294
|
+
* defecto) y en un panel lateral con botón flotante bajo 1024 px.
|
|
295
|
+
* - Aplicar (con confirmación) llama a `store.apply(...)`; con el tema persistido lo empuja con
|
|
296
|
+
* `ThemeService.setTenantTheme`, sin él llama a `ThemeService.refresh()`. Emite `applied`.
|
|
297
|
+
* - Historial paginado, previsualización y restauración de versiones (`sourceVersionId`).
|
|
298
|
+
* - Importar/exportar JSON con validación previa. Textos por `SOL_I18N` (`sol.themeStudio.*`).
|
|
234
299
|
*/
|
|
235
300
|
declare class SolThemeStudioComponent implements OnInit, OnDestroy {
|
|
236
301
|
private readonly store;
|
|
@@ -243,30 +308,53 @@ declare class SolThemeStudioComponent implements OnInit, OnDestroy {
|
|
|
243
308
|
readonly baseTheme: _angular_core.InputSignal<ThemeFile | undefined>;
|
|
244
309
|
/** Campos opacos del host que viajan intactos a `meta` (y se aceptan al importar JSON). */
|
|
245
310
|
readonly metaExtras: _angular_core.InputSignal<Readonly<Record<string, unknown>> | undefined>;
|
|
311
|
+
/**
|
|
312
|
+
* Forma de campos opacos de `meta` que el host PRESERVA sin escribirlos (p. ej. el
|
|
313
|
+
* comportamiento del menú lateral): solo amplía lo que el importador de JSON acepta.
|
|
314
|
+
*/
|
|
315
|
+
readonly metaExtrasSchema: _angular_core.InputSignal<Readonly<Record<string, unknown>> | undefined>;
|
|
316
|
+
/** Secciones y comportamientos opcionales (ver `SolThemeStudioFeatures`). */
|
|
317
|
+
readonly features: _angular_core.InputSignal<SolThemeStudioFeatures>;
|
|
318
|
+
/** Placeholder del texto del pie de página (p. ej. el formato por defecto del pie del host). */
|
|
319
|
+
readonly footerPlaceholder: _angular_core.InputSignal<string | undefined>;
|
|
320
|
+
/** Nombre del archivo de «Exportar JSON». Por defecto, `<tenant>-theme.json`. */
|
|
321
|
+
readonly exportFileName: _angular_core.InputSignal<string | undefined>;
|
|
322
|
+
/** Zona horaria IANA de las fechas del historial (p. ej. `America/Bogota`). Por defecto, la del navegador. */
|
|
323
|
+
readonly versionTimeZone: _angular_core.InputSignal<string | undefined>;
|
|
324
|
+
/** Texto que sigue a cada fecha del historial (p. ej. `(Bogotá)`). */
|
|
325
|
+
readonly versionTimeZoneLabel: _angular_core.InputSignal<string | undefined>;
|
|
246
326
|
/** Tema persistido con éxito por `store.apply(...)`. */
|
|
247
327
|
readonly applied: _angular_core.OutputEmitterRef<ThemeFile>;
|
|
248
328
|
/** Avisos para que la aplicación los muestre a su manera. */
|
|
249
329
|
readonly notify: _angular_core.OutputEmitterRef<SolThemeStudioNotice>;
|
|
250
|
-
/** El store permite subir imágenes (logo
|
|
330
|
+
/** El store permite subir imágenes (logo, favicon, imagen del indicador de carga). */
|
|
251
331
|
protected readonly canUpload: boolean;
|
|
252
332
|
/** El store expone historial completo (listar + leer una versión). */
|
|
253
333
|
protected readonly canBrowseHistory: boolean;
|
|
334
|
+
protected readonly feature: _angular_core.Signal<Required<Omit<SolThemeStudioFeatures, "tableVariantMetaKey">> & {
|
|
335
|
+
tableVariantMetaKey?: string;
|
|
336
|
+
}>;
|
|
254
337
|
protected readonly loadState: _angular_core.WritableSignal<LoadState>;
|
|
255
338
|
private readonly savedTheme;
|
|
256
339
|
protected readonly hasSavedTheme: _angular_core.Signal<boolean>;
|
|
257
340
|
protected readonly form: _angular_core.WritableSignal<ThemeStudioForm>;
|
|
341
|
+
/** Modo activo: define QUÉ bloque por modo se edita Y el modo de la vista previa. */
|
|
258
342
|
protected readonly activeMode: _angular_core.WritableSignal<ThemeMode>;
|
|
259
343
|
protected readonly modeForm: _angular_core.Signal<ThemeStudioModeForm>;
|
|
260
344
|
protected readonly brandForm: _angular_core.WritableSignal<ThemeLogo>;
|
|
261
345
|
protected readonly themeName: _angular_core.WritableSignal<string>;
|
|
262
346
|
protected readonly tagline: _angular_core.WritableSignal<string>;
|
|
263
347
|
protected readonly favicon: _angular_core.WritableSignal<string>;
|
|
264
|
-
protected readonly
|
|
265
|
-
|
|
266
|
-
protected readonly
|
|
348
|
+
protected readonly loaderForm: _angular_core.WritableSignal<ThemeLoaderConfig>;
|
|
349
|
+
/** Logo que se está subiendo (deshabilita ambos botones de logo mientras dura). */
|
|
350
|
+
protected readonly uploadingLogo: _angular_core.WritableSignal<"logo" | "logoDark" | null>;
|
|
351
|
+
protected readonly uploadingFavicon: _angular_core.WritableSignal<boolean>;
|
|
352
|
+
protected readonly uploadingLoaderImage: _angular_core.WritableSignal<boolean>;
|
|
353
|
+
protected readonly logoAccept = "image/png,image/jpeg,image/svg+xml,image/webp";
|
|
354
|
+
protected readonly faviconAccept = "image/png,image/svg+xml,image/x-icon,image/vnd.microsoft.icon,image/webp";
|
|
267
355
|
protected readonly historyOpen: _angular_core.WritableSignal<boolean>;
|
|
268
356
|
protected readonly historyLoading: _angular_core.WritableSignal<boolean>;
|
|
269
|
-
protected readonly historyError: _angular_core.WritableSignal<
|
|
357
|
+
protected readonly historyError: _angular_core.WritableSignal<StatusMessage | null>;
|
|
270
358
|
protected readonly versions: _angular_core.WritableSignal<ThemeVersion[]>;
|
|
271
359
|
protected readonly nextCursor: _angular_core.WritableSignal<string | number | null>;
|
|
272
360
|
protected readonly versionLoading: _angular_core.WritableSignal<boolean>;
|
|
@@ -274,21 +362,41 @@ declare class SolThemeStudioComponent implements OnInit, OnDestroy {
|
|
|
274
362
|
protected readonly importing: _angular_core.WritableSignal<boolean>;
|
|
275
363
|
protected readonly applying: _angular_core.WritableSignal<boolean>;
|
|
276
364
|
protected readonly showApplyConfirm: _angular_core.WritableSignal<boolean>;
|
|
277
|
-
|
|
278
|
-
protected readonly
|
|
365
|
+
/** Bajo 1024px la vista previa vive en el panel lateral que abre el botón flotante. */
|
|
366
|
+
protected readonly previewOpenMobile: _angular_core.WritableSignal<boolean>;
|
|
367
|
+
protected readonly status: _angular_core.WritableSignal<StatusMessage | null>;
|
|
279
368
|
protected readonly busy: _angular_core.Signal<boolean>;
|
|
280
369
|
private readonly importedTheme;
|
|
281
370
|
private importedGenerated;
|
|
282
371
|
private readonly gridContainer;
|
|
283
|
-
private readonly themeJsonInput;
|
|
284
|
-
private readonly imageFileInput;
|
|
285
372
|
protected readonly studioSplit: _angular_core.WritableSignal<number>;
|
|
286
373
|
protected readonly resizing: _angular_core.WritableSignal<boolean>;
|
|
287
374
|
protected readonly splitMin = 30;
|
|
288
375
|
protected readonly splitMax = 75;
|
|
289
376
|
/** Base del builder: importado/versión en borrador → tema guardado → base del host → empaquetado. */
|
|
290
377
|
private readonly workingBase;
|
|
291
|
-
/**
|
|
378
|
+
/** Pestaña visible cuando `features.loginAppearance` está activa. */
|
|
379
|
+
protected readonly section: _angular_core.WritableSignal<"general" | "login">;
|
|
380
|
+
/** `meta.login` de la base, normalizado: lo que el editor muestra mientras nadie lo toque. */
|
|
381
|
+
protected readonly loginBase: _angular_core.Signal<ThemeLogin>;
|
|
382
|
+
/**
|
|
383
|
+
* Último `meta.login` editado; `null` mientras la persona no cambie nada en la pestaña. Una base
|
|
384
|
+
* nueva (importación, versión del historial) lo descarta: sin cambios, el `meta.login` propio de
|
|
385
|
+
* la base viaja intacto.
|
|
386
|
+
*/
|
|
387
|
+
protected readonly loginEdited: _angular_core.WritableSignal<ThemeLogin | null>;
|
|
388
|
+
/** Hay cambios de inicio de sesión que todavía no se aplicaron. */
|
|
389
|
+
protected readonly loginUnsaved: _angular_core.Signal<boolean>;
|
|
390
|
+
protected readonly loginUploader: LoginPhotoUploader | null;
|
|
391
|
+
protected readonly describeStoreError: typeof extractStoreErrorMessage;
|
|
392
|
+
/** Indicador de carga para la vista previa (solo con la sección activa). */
|
|
393
|
+
protected readonly previewLoader: _angular_core.Signal<ThemeLoaderConfig | undefined>;
|
|
394
|
+
/**
|
|
395
|
+
* TEMA EN EDICIÓN: el formulario construido sobre la base, con la marca, el nombre, el pie, el
|
|
396
|
+
* favicon y las secciones opcionales (indicador de carga, variante de tabla en `meta`)
|
|
397
|
+
* compuestos en `meta`. Un tema importado o una versión en borrador conserva sus tokens no
|
|
398
|
+
* editados (`mergeThemeEditorChanges`).
|
|
399
|
+
*/
|
|
292
400
|
protected readonly effectiveTheme: _angular_core.Signal<ThemeFile>;
|
|
293
401
|
protected readonly textureUsesColor: _angular_core.Signal<boolean>;
|
|
294
402
|
protected readonly modes: ReadonlyArray<ThemeMode>;
|
|
@@ -302,23 +410,22 @@ declare class SolThemeStudioComponent implements OnInit, OnDestroy {
|
|
|
302
410
|
protected readonly brandWidthMax = 200;
|
|
303
411
|
protected readonly shadowColorSuggestions: readonly string[];
|
|
304
412
|
protected readonly textureColorSuggestions: readonly string[];
|
|
305
|
-
protected readonly logoSlots: ReadonlyArray<{
|
|
306
|
-
target: ImageTarget;
|
|
307
|
-
labelKey: string;
|
|
308
|
-
altKey: string;
|
|
309
|
-
}>;
|
|
310
413
|
protected readonly fontRoles: ReadonlyArray<{
|
|
311
414
|
key: 'displayFont' | 'bodyFont';
|
|
312
415
|
labelKey: string;
|
|
416
|
+
testId: string;
|
|
313
417
|
quick: ReadonlyArray<string>;
|
|
314
418
|
catalog: ReadonlyArray<string>;
|
|
315
419
|
}>;
|
|
316
|
-
protected readonly
|
|
420
|
+
protected readonly authLayoutOptions: ReadonlyArray<SegmentOption>;
|
|
421
|
+
protected readonly defaultModeOptions: ReadonlyArray<SegmentOption>;
|
|
422
|
+
protected readonly tableVariantOptions: ReadonlyArray<SegmentOption>;
|
|
423
|
+
protected readonly loaderPresentationOptions: ReadonlyArray<SegmentOption>;
|
|
424
|
+
protected readonly loaderAnimationOptions: ReadonlyArray<SegmentOption>;
|
|
317
425
|
protected readonly typographyGroups: ReadonlyArray<SegmentGroup<SharedSegmentKey>>;
|
|
318
|
-
protected readonly
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}>;
|
|
426
|
+
protected readonly shapeGroups: ReadonlyArray<SegmentGroup<SharedSegmentKey>>;
|
|
427
|
+
protected readonly sharedStructureGroups: ReadonlyArray<SegmentGroup<SharedSegmentKey>>;
|
|
428
|
+
protected readonly motionGroups: ReadonlyArray<SegmentGroup<SharedSegmentKey>>;
|
|
322
429
|
protected readonly shadowStyleOptions: ReadonlyArray<SegmentOption>;
|
|
323
430
|
protected readonly shadowSizeOptions: ReadonlyArray<SegmentOption>;
|
|
324
431
|
protected readonly shadowDirections: {
|
|
@@ -345,59 +452,80 @@ declare class SolThemeStudioComponent implements OnInit, OnDestroy {
|
|
|
345
452
|
ngOnDestroy(): void;
|
|
346
453
|
/** Pide el tema guardado al store (también es la acción de "Reintentar"). */
|
|
347
454
|
load(): void;
|
|
348
|
-
/** Vuelca un ThemeFile en el formulario, la marca, el nombre, el pie y
|
|
455
|
+
/** Vuelca un ThemeFile en el formulario, la marca, el nombre, el pie, el favicon y los opcionales. */
|
|
349
456
|
private hydrateFrom;
|
|
457
|
+
/** Escape cierra el panel lateral, salvo que la confirmación esté abierta encima (ese Escape es suyo). */
|
|
458
|
+
protected closePreviewPanel(): void;
|
|
350
459
|
protected setField<K extends keyof ThemeStudioForm>(key: K, value: ThemeStudioForm[K]): void;
|
|
351
460
|
protected setChoice(key: SharedSegmentKey, value: string | number): void;
|
|
352
461
|
protected setModeColor(key: StudioModeColorKey, value: string): void;
|
|
353
462
|
protected setModeChoice(key: ModeSegmentKey, value: string | number): void;
|
|
354
463
|
protected setBrandField<K extends keyof ThemeLogo>(key: K, value: ThemeLogo[K]): void;
|
|
464
|
+
protected setLoaderChoice(key: 'presentation' | 'animation', value: string | number): void;
|
|
355
465
|
protected onModeHexChange(key: StudioModeColorKey, event: Event): void;
|
|
356
466
|
protected toggleMode(): void;
|
|
357
467
|
protected inputValue(event: Event): string;
|
|
358
468
|
protected numberValue(event: Event): number;
|
|
359
469
|
protected fontStackFor(family: string): string;
|
|
360
|
-
/** URL SANITIZADA de una imagen
|
|
470
|
+
/** URL SANITIZADA de una imagen (para la miniatura); `null` sin imagen segura. */
|
|
361
471
|
protected imageUrl(target: ImageTarget): string | null;
|
|
362
|
-
protected
|
|
363
|
-
protected onImageSelected(event: Event): void;
|
|
472
|
+
protected onImageSelected(target: ImageTarget, event: Event): void;
|
|
364
473
|
/** Valida y sube una imagen con `store.uploadLogo`; la URL devuelta queda en el campo destino. */
|
|
365
474
|
uploadImage(target: ImageTarget, file: File | undefined): void;
|
|
475
|
+
private setUploading;
|
|
366
476
|
protected removeImage(target: ImageTarget): void;
|
|
367
477
|
private setImage;
|
|
368
478
|
protected requestApply(): void;
|
|
369
|
-
/**
|
|
479
|
+
/**
|
|
480
|
+
* Persiste el tema en edición con `store.apply(...)`. Con el tema persistido lo empuja con
|
|
481
|
+
* `ThemeService.setTenantTheme` (sin volver a pedirlo); sin él, `ThemeService.refresh()`.
|
|
482
|
+
*/
|
|
370
483
|
confirmApply(): void;
|
|
371
484
|
protected toggleHistory(): void;
|
|
372
485
|
/** Primera página (o la siguiente con `more`). */
|
|
373
486
|
loadHistory(more?: boolean): void;
|
|
487
|
+
/** Fecha del historial en el idioma activo, con la zona horaria configurada. */
|
|
374
488
|
protected versionDate(value: string): string;
|
|
375
489
|
/** Carga una versión del historial en el borrador (no la guarda: hay que confirmar Aplicar). */
|
|
376
490
|
previewVersion(id: ThemeVersion['id']): void;
|
|
377
|
-
protected openJsonPicker(): void;
|
|
378
491
|
protected importJson(event: Event): Promise<void>;
|
|
379
492
|
/** Valida un archivo JSON y, si es válido, lo carga en el borrador (no lo guarda). */
|
|
380
493
|
importFile(file: File | undefined): Promise<void>;
|
|
381
|
-
private
|
|
494
|
+
private parseOptions;
|
|
495
|
+
/** Texto de un error del importador; la ruta solo se muestra cuando señala el campo a corregir. */
|
|
496
|
+
private importError;
|
|
497
|
+
/** Mensaje del store (p. ej. el del backend) o, sin él, el texto por defecto. */
|
|
498
|
+
private storeError;
|
|
382
499
|
/** Borrador desde un tema externo: hidrata los controles y conserva sus tokens no editados. */
|
|
383
500
|
private loadDraft;
|
|
384
501
|
protected exportJson(): void;
|
|
385
502
|
protected copyJson(): void;
|
|
386
|
-
|
|
503
|
+
/**
|
|
504
|
+
* Inicia el arrastre del divisor. Captura el puntero sobre el propio divisor, así los
|
|
505
|
+
* `pointermove`/`pointerup` llegan aunque el cursor se salga; el reparto se calcula contra el
|
|
506
|
+
* rectángulo del grid medido al empezar.
|
|
507
|
+
*/
|
|
387
508
|
protected startResize(event: PointerEvent): void;
|
|
509
|
+
/** Teclado sobre el divisor: flechas mueven de a 2 puntos; Inicio/Fin van a los topes. */
|
|
388
510
|
protected onDividerKeydown(event: KeyboardEvent): void;
|
|
511
|
+
/** Doble clic sobre el divisor: vuelve al reparto por defecto. */
|
|
389
512
|
protected resetSplit(): void;
|
|
390
513
|
private persistSplit;
|
|
514
|
+
/** Resuelve un texto de estado (clave traducible o texto ya resuelto). */
|
|
515
|
+
protected text(message: StatusMessage): string;
|
|
516
|
+
/** Texto de la línea de estado del JSON (vacía sin estado). */
|
|
517
|
+
protected statusText(): string;
|
|
391
518
|
private emitNotice;
|
|
392
519
|
/** Carga el catálogo curado de fuentes con la URL sanitizada por construcción (`buildGoogleFontsUrl`). */
|
|
393
520
|
private injectStudioFonts;
|
|
394
521
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolThemeStudioComponent, never>;
|
|
395
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolThemeStudioComponent, "sol-theme-studio", never, { "baseTheme": { "alias": "baseTheme"; "required": false; "isSignal": true; }; "metaExtras": { "alias": "metaExtras"; "required": false; "isSignal": true; }; }, { "applied": "applied"; "notify": "notify"; }, never, never, true, never>;
|
|
522
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolThemeStudioComponent, "sol-theme-studio", never, { "baseTheme": { "alias": "baseTheme"; "required": false; "isSignal": true; }; "metaExtras": { "alias": "metaExtras"; "required": false; "isSignal": true; }; "metaExtrasSchema": { "alias": "metaExtrasSchema"; "required": false; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "footerPlaceholder": { "alias": "footerPlaceholder"; "required": false; "isSignal": true; }; "exportFileName": { "alias": "exportFileName"; "required": false; "isSignal": true; }; "versionTimeZone": { "alias": "versionTimeZone"; "required": false; "isSignal": true; }; "versionTimeZoneLabel": { "alias": "versionTimeZoneLabel"; "required": false; "isSignal": true; }; }, { "applied": "applied"; "notify": "notify"; }, never, never, true, never>;
|
|
396
523
|
}
|
|
397
524
|
|
|
398
525
|
/**
|
|
399
526
|
* Vista previa aislada del tema EN EDICIÓN: un mini panel (barra lateral, indicadores, campo,
|
|
400
|
-
* botones, chips, texto
|
|
527
|
+
* botones, botones por rol, chips, texto, tabla y, si el host activa la sección, el indicador de
|
|
528
|
+
* carga) pintado con las variables del tema que se está editando.
|
|
401
529
|
*
|
|
402
530
|
* `resolveCssVars(theme, mode)` produce el mapa `--sol-*` y un effect lo aplica sobre el HOST del
|
|
403
531
|
* componente: las custom properties heredan hacia abajo, así que solo el mock queda tematizado y
|
|
@@ -416,15 +544,22 @@ declare class SolThemeStudioPreviewComponent {
|
|
|
416
544
|
readonly tagline: _angular_core.InputSignal<string>;
|
|
417
545
|
/** Variante de tabla de la muestra. */
|
|
418
546
|
readonly tableVariant: _angular_core.InputSignal<SolTableVariant | null>;
|
|
419
|
-
/**
|
|
547
|
+
/** Indicador de carga en edición; sin él no se muestra su muestra. */
|
|
548
|
+
readonly loader: _angular_core.InputSignal<ThemeLoaderConfig | undefined>;
|
|
549
|
+
/**
|
|
550
|
+
* URL del logo del modo de la vista previa, SANITIZADA. En modo oscuro usa `urlDark` cuando
|
|
551
|
+
* existe; sin URL segura se muestra el texto de respaldo.
|
|
552
|
+
*/
|
|
420
553
|
protected readonly logoUrl: _angular_core.Signal<string | null>;
|
|
554
|
+
/** Ancho del logo (control «Ancho del logo»), como techo del ancho derivado. */
|
|
555
|
+
protected readonly logoWidth: _angular_core.Signal<string>;
|
|
421
556
|
protected readonly sampleRows: {
|
|
422
557
|
name: string;
|
|
423
558
|
stateKey: string;
|
|
424
559
|
}[];
|
|
425
560
|
constructor();
|
|
426
561
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolThemeStudioPreviewComponent, never>;
|
|
427
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolThemeStudioPreviewComponent, "sol-theme-studio-preview", never, { "theme": { "alias": "theme"; "required": true; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "brand": { "alias": "brand"; "required": false; "isSignal": true; }; "tagline": { "alias": "tagline"; "required": false; "isSignal": true; }; "tableVariant": { "alias": "tableVariant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
562
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolThemeStudioPreviewComponent, "sol-theme-studio-preview", never, { "theme": { "alias": "theme"; "required": true; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "brand": { "alias": "brand"; "required": false; "isSignal": true; }; "tagline": { "alias": "tagline"; "required": false; "isSignal": true; }; "tableVariant": { "alias": "tableVariant"; "required": false; "isSignal": true; }; "loader": { "alias": "loader"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
428
563
|
}
|
|
429
564
|
|
|
430
565
|
/** Árbol de textos de la pantalla (claves bajo `sol.themeStudio`). */
|
|
@@ -432,8 +567,10 @@ type ThemeStudioDictionary = {
|
|
|
432
567
|
readonly [key: string]: string | ThemeStudioDictionary;
|
|
433
568
|
};
|
|
434
569
|
/**
|
|
435
|
-
* Textos por defecto en español colombiano
|
|
436
|
-
*
|
|
570
|
+
* Textos por defecto en español colombiano. Son los del Theme Studio de PANDORA, del que se portó
|
|
571
|
+
* la pantalla; solo tres se dejan genéricos porque nombran un producto o su plataforma legada
|
|
572
|
+
* (`preview.footerFallback`, `table.hint` y `loader.hint`): el host que quiera el texto propio lo
|
|
573
|
+
* define en su motor de traducción bajo `sol.themeStudio.*`, que siempre gana sobre este respaldo.
|
|
437
574
|
*/
|
|
438
575
|
declare const SOL_THEME_STUDIO_I18N_ES_CO: ThemeStudioDictionary;
|
|
439
576
|
/** Default English texts (same tree as `SOL_THEME_STUDIO_I18N_ES_CO`). */
|
|
@@ -509,11 +646,18 @@ declare const MAX_THEME_JSON_BYTES: number;
|
|
|
509
646
|
* - `not-renderable`: el tema no resuelve todas sus variables en ambos modos.
|
|
510
647
|
*/
|
|
511
648
|
type ThemeImportErrorCode = 'too-large' | 'invalid-json' | 'invalid-structure' | 'unsupported-key' | 'unsafe-key' | 'unsafe-value' | 'invalid-value' | 'not-renderable';
|
|
512
|
-
/**
|
|
649
|
+
/**
|
|
650
|
+
* Error tipado del importador: `code` para traducir, `path` para diagnóstico.
|
|
651
|
+
*
|
|
652
|
+
* `pathVisible` indica que la ruta señala el campo exacto que hay que corregir (clave no
|
|
653
|
+
* admitida, clave prohibida, color de marca o contraste inválido) y por eso la pantalla la
|
|
654
|
+
* muestra a la persona usuaria; en los demás casos la ruta queda solo para diagnóstico.
|
|
655
|
+
*/
|
|
513
656
|
declare class ThemeImportError extends Error {
|
|
514
657
|
readonly code: ThemeImportErrorCode;
|
|
515
658
|
readonly path?: string | undefined;
|
|
516
|
-
|
|
659
|
+
readonly pathVisible: boolean;
|
|
660
|
+
constructor(code: ThemeImportErrorCode, path?: string | undefined, pathVisible?: boolean);
|
|
517
661
|
}
|
|
518
662
|
/** Opciones de `parseThemeJson`. */
|
|
519
663
|
interface ParseThemeJsonOptions {
|
|
@@ -523,6 +667,16 @@ interface ParseThemeJsonOptions {
|
|
|
523
667
|
* tipo y la misma estructura que el valor de referencia.
|
|
524
668
|
*/
|
|
525
669
|
metaExtras?: Readonly<Record<string, unknown>>;
|
|
670
|
+
/**
|
|
671
|
+
* Forma de referencia de campos opacos de `meta` que el host PRESERVA pero no escribe (por
|
|
672
|
+
* ejemplo, comportamiento del menú lateral). Se aceptan al importar con el mismo tipo y la
|
|
673
|
+
* misma estructura que el valor de referencia.
|
|
674
|
+
*/
|
|
675
|
+
metaExtrasSchema?: Readonly<Record<string, unknown>>;
|
|
676
|
+
/** Acepta y valida `meta.loader` (sección opcional del indicador de carga). */
|
|
677
|
+
loader?: boolean;
|
|
678
|
+
/** Clave de `meta` donde el host refleja la variante de tabla (se valida contra las variantes). */
|
|
679
|
+
tableVariantMetaKey?: string;
|
|
526
680
|
}
|
|
527
681
|
/**
|
|
528
682
|
* Valida y devuelve el `ThemeFile` de un archivo JSON ANTES de cualquier fusión, vista previa,
|
|
@@ -542,5 +696,5 @@ declare function parseThemeJson(text: string, current: ThemeFile, options?: Pars
|
|
|
542
696
|
*/
|
|
543
697
|
declare function mergeThemeEditorChanges<T>(original: T, before: T, after: T): T;
|
|
544
698
|
|
|
545
|
-
export { BASE_SIZE_MAX, BASE_SIZE_MIN, DEFAULT_DARK_MODE_FORM, DEFAULT_LIGHT_MODE_FORM, DEFAULT_STUDIO_FORM, DEFAULT_TABLE_VARIANT, HEX_COLOR_PATTERN, LINE_HEIGHT_MAX, LINE_HEIGHT_MIN, MAX_THEME_JSON_BYTES, RADIUS_MAX, RADIUS_MIN, SERIF_DISPLAY_FONTS, SOL_THEME_STUDIO_I18N_EN, SOL_THEME_STUDIO_I18N_ES_CO, STUDIO_BODY_FONTS, STUDIO_BODY_FONTS_QUICK, STUDIO_COLOR_SUGGESTIONS_DARK, STUDIO_COLOR_SUGGESTIONS_LIGHT, STUDIO_DISPLAY_FONTS, STUDIO_DISPLAY_FONTS_QUICK, STUDIO_SHADOW_COLOR_SUGGESTIONS, STUDIO_SHADOW_DIRECTIONS, STUDIO_TEXTURE_COLOR_SUGGESTIONS, STUDIO_TEXT_COLOR_SUGGESTIONS_DARK, STUDIO_TEXT_COLOR_SUGGESTIONS_LIGHT, SolThemeStudioComponent, SolThemeStudioPreviewComponent, THEME_STUDIO_I18N_PREFIX, THEME_STUDIO_STORE, ThemeImportError, buildThemeFile, cloneStudioForm, deepMerge, mapThemeFileToForm, mergeThemeEditorChanges, parseThemeJson };
|
|
546
|
-
export type { DeepPartial, ParseThemeJsonOptions, SolThemeStudioNotice, StudioAuthLayout, StudioBorderWidth, StudioButtonShape, StudioColorFieldKey, StudioDensity, StudioDisplayTransform, StudioDisplayWeight, StudioHeaderStyle, StudioInputStyle, StudioModeColorKey, StudioMotionDuration, StudioMotionIntensity, StudioOverlayBlur, StudioRevealStyle, StudioShadowDirection, StudioShadowSize, StudioShadowStyle, StudioSidebarStyle, StudioTexture, ThemeImportErrorCode, ThemeStudioDictionary, ThemeStudioForm, ThemeStudioModeForm, ThemeStudioStore, ThemeVersion, ThemeVersionPage };
|
|
699
|
+
export { BASE_SIZE_MAX, BASE_SIZE_MIN, DEFAULT_DARK_MODE_FORM, DEFAULT_LIGHT_MODE_FORM, DEFAULT_LOADER_CONFIG, DEFAULT_STUDIO_FORM, DEFAULT_TABLE_VARIANT, HEX_COLOR_PATTERN, LINE_HEIGHT_MAX, LINE_HEIGHT_MIN, MAX_THEME_JSON_BYTES, RADIUS_MAX, RADIUS_MIN, SERIF_DISPLAY_FONTS, SOL_THEME_STUDIO_I18N_EN, SOL_THEME_STUDIO_I18N_ES_CO, STUDIO_BODY_FONTS, STUDIO_BODY_FONTS_QUICK, STUDIO_COLOR_SUGGESTIONS_DARK, STUDIO_COLOR_SUGGESTIONS_LIGHT, STUDIO_DISPLAY_FONTS, STUDIO_DISPLAY_FONTS_QUICK, STUDIO_LOADER_ANIMATIONS, STUDIO_LOADER_PRESENTATIONS, STUDIO_SHADOW_COLOR_SUGGESTIONS, STUDIO_SHADOW_DIRECTIONS, STUDIO_TEXTURE_COLOR_SUGGESTIONS, STUDIO_TEXT_COLOR_SUGGESTIONS_DARK, STUDIO_TEXT_COLOR_SUGGESTIONS_LIGHT, SolThemeStudioComponent, SolThemeStudioPreviewComponent, THEME_STUDIO_I18N_PREFIX, THEME_STUDIO_STORE, ThemeImportError, buildThemeFile, cloneStudioForm, deepMerge, extractStoreErrorMessage, mapThemeFileToForm, mergeThemeEditorChanges, parseThemeJson };
|
|
700
|
+
export type { DeepPartial, ParseThemeJsonOptions, SolThemeStudioFeatures, SolThemeStudioNotice, StudioAuthLayout, StudioBorderWidth, StudioButtonShape, StudioColorFieldKey, StudioDensity, StudioDisplayTransform, StudioDisplayWeight, StudioHeaderStyle, StudioInputStyle, StudioLoaderAnimation, StudioLoaderPresentation, StudioModeColorKey, StudioMotionDuration, StudioMotionIntensity, StudioOverlayBlur, StudioRevealStyle, StudioShadowDirection, StudioShadowSize, StudioShadowStyle, StudioSidebarStyle, StudioTexture, ThemeImportErrorCode, ThemeLoaderConfig, ThemeStudioDictionary, ThemeStudioForm, ThemeStudioModeForm, ThemeStudioStore, ThemeVersion, ThemeVersionPage };
|