@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solercia/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Design system Solercia (componentes sol-*, theming agnóstico por puertos, contrato i18n y schematics ng add/ng generate) para proyectos Angular del ecosistema Solercia.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Solercia Solutions SAS",
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"types": "./types/solercia-ui.d.ts",
|
|
41
41
|
"default": "./fesm2022/solercia-ui.mjs"
|
|
42
42
|
},
|
|
43
|
+
"./login-appearance": {
|
|
44
|
+
"types": "./types/solercia-ui-login-appearance.d.ts",
|
|
45
|
+
"default": "./fesm2022/solercia-ui-login-appearance.mjs"
|
|
46
|
+
},
|
|
43
47
|
"./theme-studio": {
|
|
44
48
|
"types": "./types/solercia-ui-theme-studio.d.ts",
|
|
45
49
|
"default": "./fesm2022/solercia-ui-theme-studio.mjs"
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _solercia_ui from '@solercia/ui';
|
|
3
|
+
import { ThemeFile } from '@solercia/ui';
|
|
4
|
+
import * as _solercia_ui_login_appearance from '@solercia/ui/login-appearance';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Shape of the `meta.login` block of a `ThemeFile`: photos, motion and composition of the sign-in
|
|
9
|
+
* screen. It lives in `meta` (opaque to the token resolver), so a theme without it renders exactly
|
|
10
|
+
* as before and the host decides whether to use it.
|
|
11
|
+
*/
|
|
12
|
+
type LoginEffect = 'zoom' | 'focus' | 'none';
|
|
13
|
+
type LoginTransition = 'fade' | 'focus';
|
|
14
|
+
type LoginPosition = 'left' | 'right' | 'center';
|
|
15
|
+
type LoginBackground = 'glass-fade' | 'glass' | 'solid' | 'triangles' | 'split-circle' | 'facets' | 'circles';
|
|
16
|
+
type LoginCaptionPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
17
|
+
type LoginMode = 'light' | 'dark';
|
|
18
|
+
/** Gradient that covers the photo behind the form. `rgb` is a `r,g,b` triple; the rest are 0-1. */
|
|
19
|
+
interface ThemeLoginVeil {
|
|
20
|
+
rgb?: string;
|
|
21
|
+
from?: number;
|
|
22
|
+
to?: number;
|
|
23
|
+
bottom?: number;
|
|
24
|
+
}
|
|
25
|
+
/** Translucent panel behind the form (rectangular backgrounds only). */
|
|
26
|
+
interface ThemeLoginPanel {
|
|
27
|
+
bg?: string;
|
|
28
|
+
blur?: string;
|
|
29
|
+
saturate?: number;
|
|
30
|
+
border?: string;
|
|
31
|
+
radius?: string;
|
|
32
|
+
}
|
|
33
|
+
interface ThemeLoginModeConfig {
|
|
34
|
+
position?: LoginPosition;
|
|
35
|
+
background?: LoginBackground;
|
|
36
|
+
captionPosition?: LoginCaptionPosition;
|
|
37
|
+
veil?: ThemeLoginVeil;
|
|
38
|
+
panel?: ThemeLoginPanel;
|
|
39
|
+
}
|
|
40
|
+
interface ThemeLoginCaption {
|
|
41
|
+
/** Small label above the tagline (for example, the product name). */
|
|
42
|
+
label?: string;
|
|
43
|
+
/** Photo indicators next to the caption. */
|
|
44
|
+
indicators?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface ThemeLogin {
|
|
47
|
+
images?: string[];
|
|
48
|
+
intervalMs?: number;
|
|
49
|
+
effect?: LoginEffect;
|
|
50
|
+
transition?: LoginTransition;
|
|
51
|
+
caption?: ThemeLoginCaption;
|
|
52
|
+
modes?: Partial<Record<LoginMode, ThemeLoginModeConfig>>;
|
|
53
|
+
}
|
|
54
|
+
/** Logo as a host may publish it before sign-in (already sanitized by `normalizeLoginAppearance`). */
|
|
55
|
+
interface LoginLogo {
|
|
56
|
+
url: string;
|
|
57
|
+
urlDark: string | null;
|
|
58
|
+
altText: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Appearance a host can serve anonymously (before sign-in the full theme is usually private).
|
|
62
|
+
* The library makes no HTTP call: the host fetches it from its own endpoint and normalizes it.
|
|
63
|
+
*/
|
|
64
|
+
interface PublishedLoginAppearance {
|
|
65
|
+
login: ThemeLogin | null;
|
|
66
|
+
logo: LoginLogo | null;
|
|
67
|
+
/** `meta.defaultMode` of the tenant: without a session it is the only way to know the mode. */
|
|
68
|
+
mode?: LoginMode | null;
|
|
69
|
+
}
|
|
70
|
+
/** Everything the screen needs to paint itself, already resolved for the active mode. */
|
|
71
|
+
interface LoginView {
|
|
72
|
+
readonly images: readonly string[];
|
|
73
|
+
readonly intervalMs: number;
|
|
74
|
+
readonly effect: LoginEffect;
|
|
75
|
+
readonly transition: LoginTransition;
|
|
76
|
+
readonly label: string | null;
|
|
77
|
+
readonly indicators: boolean;
|
|
78
|
+
readonly position: LoginPosition;
|
|
79
|
+
readonly background: LoginBackground;
|
|
80
|
+
readonly captionPosition: LoginCaptionPosition;
|
|
81
|
+
readonly variables: Readonly<Record<string, string>>;
|
|
82
|
+
}
|
|
83
|
+
declare const LOGIN_EFFECTS: readonly LoginEffect[];
|
|
84
|
+
declare const LOGIN_TRANSITIONS: readonly LoginTransition[];
|
|
85
|
+
declare const LOGIN_POSITIONS: readonly LoginPosition[];
|
|
86
|
+
declare const LOGIN_BACKGROUNDS: readonly LoginBackground[];
|
|
87
|
+
declare const LOGIN_CAPTION_POSITIONS: readonly LoginCaptionPosition[];
|
|
88
|
+
declare const LOGIN_MAX_IMAGES = 12;
|
|
89
|
+
declare const LOGIN_INTERVAL_MIN_MS = 3000;
|
|
90
|
+
declare const LOGIN_INTERVAL_MAX_MS = 20000;
|
|
91
|
+
declare const LOGIN_INTERVAL_DEFAULT_MS = 7000;
|
|
92
|
+
declare const LOGIN_DEFAULT_EFFECT: LoginEffect;
|
|
93
|
+
declare const LOGIN_DEFAULT_TRANSITION: LoginTransition;
|
|
94
|
+
declare const LOGIN_DEFAULT_POSITION: LoginPosition;
|
|
95
|
+
declare const LOGIN_DEFAULT_BACKGROUND: LoginBackground;
|
|
96
|
+
/** Backgrounds whose shape is the form container; the others use a rectangular panel. */
|
|
97
|
+
declare const LOGIN_SHAPE_BACKGROUNDS: readonly LoginBackground[];
|
|
98
|
+
declare const hasLoginShapes: (background: LoginBackground) => boolean;
|
|
99
|
+
declare const LOGIN_META_SCHEMA: ThemeLogin;
|
|
100
|
+
|
|
101
|
+
/** `true` for a photo URL the login may paint (see `IMAGE_URL`). */
|
|
102
|
+
declare function isAllowedLoginImage(url: unknown): url is string;
|
|
103
|
+
/** Closed and bounded values; anything unrecognized is dropped or takes its default. */
|
|
104
|
+
declare function normalizeLogin(raw: unknown): ThemeLogin | null;
|
|
105
|
+
/**
|
|
106
|
+
* Body a host serves before sign-in (`{ login, logo, mode }`); `null` when it carries nothing
|
|
107
|
+
* usable. The library never fetches it: the host calls its own endpoint and passes the body here.
|
|
108
|
+
*/
|
|
109
|
+
declare function normalizeLoginAppearance(raw: unknown): PublishedLoginAppearance | null;
|
|
110
|
+
/** Resolves a normalized `meta.login` for one mode. `images` are the photos to paint (non-empty). */
|
|
111
|
+
declare function buildLoginView(login: ThemeLogin | null, images: readonly string[], dark: boolean): LoginView;
|
|
112
|
+
interface LoginAppearanceSources {
|
|
113
|
+
/** `login` already normalized from the host's anonymous endpoint (`normalizeLoginAppearance`). */
|
|
114
|
+
published: ThemeLogin | null;
|
|
115
|
+
/** `meta.login` of the active theme, raw from the JSON. */
|
|
116
|
+
theme: unknown;
|
|
117
|
+
/** Host fallback photos (for example, bundled ones) used when no source brings its own. */
|
|
118
|
+
fallbackImages?: readonly string[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Precedence: published appearance → theme `meta.login` → fallback photos → classic layout (`null`).
|
|
122
|
+
* Photos resolve separately: a configuration without photos keeps its motion and composition but
|
|
123
|
+
* takes the photos of the next source that has them.
|
|
124
|
+
*/
|
|
125
|
+
declare function resolveLoginView(sources: LoginAppearanceSources, dark: boolean): LoginView | null;
|
|
126
|
+
|
|
127
|
+
/** Logo accepted by the brand block: the theme `meta.logo` or a published `LoginLogo`. */
|
|
128
|
+
interface LoginBrandLogo {
|
|
129
|
+
url: string;
|
|
130
|
+
urlDark?: string | null;
|
|
131
|
+
altText?: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Brand above the form title: the theme logo (its dark variant in dark mode) and an optional
|
|
135
|
+
* tagline. Without a usable logo it writes the alternative text as a wordmark, so the block never
|
|
136
|
+
* renders a broken image.
|
|
137
|
+
*/
|
|
138
|
+
declare class SolLoginBrandComponent {
|
|
139
|
+
readonly logo: _angular_core.InputSignal<LoginBrandLogo | null>;
|
|
140
|
+
readonly dark: _angular_core.InputSignal<boolean>;
|
|
141
|
+
readonly tagline: _angular_core.InputSignal<string | null>;
|
|
142
|
+
protected readonly src: _angular_core.Signal<string | null>;
|
|
143
|
+
protected readonly alt: _angular_core.Signal<string>;
|
|
144
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginBrandComponent, never>;
|
|
145
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginBrandComponent, "sol-login-brand", never, { "logo": { "alias": "logo"; "required": false; "isSignal": true; }; "dark": { "alias": "dark"; "required": false; "isSignal": true; }; "tagline": { "alias": "tagline"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Themed sign-in frame: photos, veil, shapes and caption from `meta.login`, and the card where the
|
|
150
|
+
* host projects its own form (`<ng-content>`: user and password, SSO buttons, notices…). The
|
|
151
|
+
* library ships no auth logic and makes no HTTP call. With `view` null (no photos anywhere) it
|
|
152
|
+
* renders a plain centered card on the page background, so the host keeps one template.
|
|
153
|
+
*
|
|
154
|
+
* ```html
|
|
155
|
+
* <sol-login-frame [view]="view()" [tagline]="tagline()" [logo]="logo()" [dark]="isDark()">
|
|
156
|
+
* <h1>…</h1>
|
|
157
|
+
* <my-login-form />
|
|
158
|
+
* </sol-login-frame>
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
declare class SolLoginFrameComponent {
|
|
162
|
+
/** Resolved appearance (`resolveLoginView` / `buildLoginView`); `null` keeps the classic card. */
|
|
163
|
+
readonly view: _angular_core.InputSignal<LoginView | null>;
|
|
164
|
+
/** Large caption text over the photo (for example, the theme `meta.tagline`). */
|
|
165
|
+
readonly tagline: _angular_core.InputSignal<string>;
|
|
166
|
+
/** Brand block above the projected form; without it the host renders its own. */
|
|
167
|
+
readonly logo: _angular_core.InputSignal<LoginBrandLogo | null>;
|
|
168
|
+
/** Optional line under the logo. */
|
|
169
|
+
readonly brandTagline: _angular_core.InputSignal<string | null>;
|
|
170
|
+
/** Active mode, to pick the dark logo variant. */
|
|
171
|
+
readonly dark: _angular_core.InputSignal<boolean>;
|
|
172
|
+
protected readonly withShapes: _angular_core.Signal<boolean>;
|
|
173
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginFrameComponent, never>;
|
|
174
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginFrameComponent, "sol-login-frame", never, { "view": { "alias": "view"; "required": false; "isSignal": true; }; "tagline": { "alias": "tagline"; "required": false; "isSignal": true; }; "logo": { "alias": "logo"; "required": false; "isSignal": true; }; "brandTagline": { "alias": "brandTagline"; "required": false; "isSignal": true; }; "dark": { "alias": "dark"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* What sits behind the form: photos, veil, shapes and caption. Every layer is fixed to the
|
|
179
|
+
* viewport (or to the preview canvas, whose `transform` contains them) and takes no events. The
|
|
180
|
+
* real login (`sol-login-frame`) and the editor preview share it.
|
|
181
|
+
*/
|
|
182
|
+
declare class SolLoginSceneComponent {
|
|
183
|
+
readonly view: _angular_core.InputSignal<LoginView>;
|
|
184
|
+
/** Large caption text (for example, the theme `meta.tagline`). Empty hides it. */
|
|
185
|
+
readonly tagline: _angular_core.InputSignal<string>;
|
|
186
|
+
protected readonly activePhoto: _angular_core.WritableSignal<number>;
|
|
187
|
+
protected readonly withShapes: _angular_core.Signal<boolean>;
|
|
188
|
+
/** With a gradient and the caption below, a bottom band; otherwise only the caption corner. */
|
|
189
|
+
protected readonly captionVeilClass: _angular_core.Signal<string>;
|
|
190
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginSceneComponent, never>;
|
|
191
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginSceneComponent, "sol-login-scene", never, { "view": { "alias": "view"; "required": true; "isSignal": true; }; "tagline": { "alias": "tagline"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Full-screen photos of the login. The effect (what happens to the photo while in front) and the
|
|
196
|
+
* transition (how the next one comes in) are independent. It is decorative, so it is hidden from
|
|
197
|
+
* screen readers. Whoever asks for reduced motion sees the first photo, still. Photo URLs come from
|
|
198
|
+
* the theme only (`meta.login.images`, already normalized).
|
|
199
|
+
*/
|
|
200
|
+
declare class SolLoginPhotosComponent {
|
|
201
|
+
readonly photos: _angular_core.InputSignal<readonly string[]>;
|
|
202
|
+
readonly effect: _angular_core.InputSignal<LoginEffect>;
|
|
203
|
+
readonly transition: _angular_core.InputSignal<LoginTransition>;
|
|
204
|
+
readonly intervalMs: _angular_core.InputSignal<number>;
|
|
205
|
+
/** Index of the photo in front after each change. */
|
|
206
|
+
readonly activePhoto: _angular_core.OutputEmitterRef<number>;
|
|
207
|
+
protected readonly active: _angular_core.WritableSignal<number>;
|
|
208
|
+
protected readonly previous: _angular_core.WritableSignal<number | null>;
|
|
209
|
+
protected readonly duration: _angular_core.Signal<string>;
|
|
210
|
+
private timer;
|
|
211
|
+
/** Reschedules when the list or the interval change: the theme preview edits them live. */
|
|
212
|
+
private readonly carousel;
|
|
213
|
+
constructor();
|
|
214
|
+
private stop;
|
|
215
|
+
private advance;
|
|
216
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginPhotosComponent, never>;
|
|
217
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginPhotosComponent, "sol-login-photos", never, { "photos": { "alias": "photos"; "required": true; "isSignal": true; }; "effect": { "alias": "effect"; "required": false; "isSignal": true; }; "transition": { "alias": "transition"; "required": false; "isSignal": true; }; "intervalMs": { "alias": "intervalMs"; "required": false; "isSignal": true; }; }, { "activePhoto": "activePhoto"; }, never, never, true, never>;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Shapes of the background: they are the form container. They live inside the card, anchored to
|
|
222
|
+
* its center, and scale with the real form box (see `SHAPE_FORM_BOX`). They are `div`s with
|
|
223
|
+
* `clip-path` and `mix-blend-mode`; the blend with the photo only works when no ancestor creates its
|
|
224
|
+
* own stacking context, which is why `em` does the scaling instead of `transform`. Below 768 px
|
|
225
|
+
* they are hidden and the card uses the simple panel.
|
|
226
|
+
*/
|
|
227
|
+
declare class SolLoginShapesComponent {
|
|
228
|
+
private readonly element;
|
|
229
|
+
private readonly destroyRef;
|
|
230
|
+
readonly background: _angular_core.InputSignal<LoginBackground>;
|
|
231
|
+
readonly position: _angular_core.InputSignal<LoginPosition>;
|
|
232
|
+
/** Explicit scale for editor thumbnails, which are not anchored to a form. */
|
|
233
|
+
readonly fixedScale: _angular_core.InputSignal<number | null>;
|
|
234
|
+
private readonly scale;
|
|
235
|
+
protected readonly effectiveScale: _angular_core.Signal<number>;
|
|
236
|
+
protected readonly shapes: _angular_core.Signal<{
|
|
237
|
+
style: Record<string, string>;
|
|
238
|
+
child: Record<string, string> | null;
|
|
239
|
+
}[]>;
|
|
240
|
+
constructor();
|
|
241
|
+
private observe;
|
|
242
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginShapesComponent, never>;
|
|
243
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginShapesComponent, "sol-login-shapes", never, { "background": { "alias": "background"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": true; "isSignal": true; }; "fixedScale": { "alias": "fixedScale"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Background of the form. With gradient, glass or solid it is the rectangular panel (driven by the
|
|
248
|
+
* `--sol-auth-panel-*` variables). With a shape there is no panel or veil: the shape is the
|
|
249
|
+
* container. Below 768 px, with a shape, a simple panel comes back.
|
|
250
|
+
*/
|
|
251
|
+
declare class SolLoginPanelBackgroundComponent {
|
|
252
|
+
readonly background: _angular_core.InputSignal<LoginBackground>;
|
|
253
|
+
readonly position: _angular_core.InputSignal<LoginPosition>;
|
|
254
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
255
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginPanelBackgroundComponent, never>;
|
|
256
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginPanelBackgroundComponent, "sol-login-panel-background", never, { "background": { "alias": "background"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* The login, scaled inside a frame, with the same scene, shapes and panel as the real one. The
|
|
261
|
+
* canvas `transform` is the containing block of its `position: fixed` layers. The tokens of the
|
|
262
|
+
* shown mode apply only here: "Dark" looks dark even when the app is light, and vice versa. The
|
|
263
|
+
* form is an inert mock: the preview never signs in.
|
|
264
|
+
*/
|
|
265
|
+
declare class SolLoginPreviewComponent {
|
|
266
|
+
private readonly element;
|
|
267
|
+
private readonly destroyRef;
|
|
268
|
+
protected readonly t: (key: string, params?: Record<string, unknown>) => string;
|
|
269
|
+
readonly view: _angular_core.InputSignal<LoginView>;
|
|
270
|
+
/** Theme whose tokens paint the frame for the shown mode; `null` keeps the app tokens. */
|
|
271
|
+
readonly theme: _angular_core.InputSignal<ThemeFile | null>;
|
|
272
|
+
readonly dark: _angular_core.InputSignal<boolean>;
|
|
273
|
+
/** Caption text; by default the theme `meta.tagline` or the library fallback. */
|
|
274
|
+
readonly tagline: _angular_core.InputSignal<string | null>;
|
|
275
|
+
protected readonly shownTagline: _angular_core.Signal<string>;
|
|
276
|
+
protected readonly logo: _angular_core.Signal<_solercia_ui.ThemeLogo | null>;
|
|
277
|
+
protected readonly scale: _angular_core.WritableSignal<number>;
|
|
278
|
+
protected readonly height: _angular_core.WritableSignal<number>;
|
|
279
|
+
protected readonly withShapes: _angular_core.Signal<boolean>;
|
|
280
|
+
protected readonly variables: _angular_core.Signal<{
|
|
281
|
+
[x: string]: string;
|
|
282
|
+
}>;
|
|
283
|
+
constructor();
|
|
284
|
+
/** A theme that cannot be resolved must not break the preview: it keeps the app tokens. */
|
|
285
|
+
private modeTokens;
|
|
286
|
+
private observeWidth;
|
|
287
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginPreviewComponent, never>;
|
|
288
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginPreviewComponent, "sol-login-preview", never, { "view": { "alias": "view"; "required": true; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "dark": { "alias": "dark"; "required": false; "isSignal": true; }; "tagline": { "alias": "tagline"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** Uploads one photo and returns its published URL (usually the store `uploadLogo`). */
|
|
292
|
+
type LoginPhotoUploader = (file: File) => Observable<string>;
|
|
293
|
+
/**
|
|
294
|
+
* Editor of the theme `meta.login` block: photos, motion, per-mode composition and caption, with
|
|
295
|
+
* a live preview. It emits the whole block only when the person changes something; saving is the
|
|
296
|
+
* host's job (inside `sol-theme-studio`, its «Aplicar tema»). Veil and panel have no controls: they
|
|
297
|
+
* travel untouched inside the block.
|
|
298
|
+
*/
|
|
299
|
+
declare class SolLoginAppearanceEditorComponent {
|
|
300
|
+
private readonly themeService;
|
|
301
|
+
protected readonly t: (key: string, params?: Record<string, unknown>) => string;
|
|
302
|
+
/** Current `meta.login`, already normalized; untouched, the editor only shows it. */
|
|
303
|
+
readonly base: _angular_core.InputSignal<ThemeLogin>;
|
|
304
|
+
/** Theme whose tokens paint the preview (the one being edited); by default the active one. */
|
|
305
|
+
readonly theme: _angular_core.InputSignal<ThemeFile | null>;
|
|
306
|
+
/** Host photos for the preview when the block has none, and what «Restablecer» restores. */
|
|
307
|
+
readonly fallbackImages: _angular_core.InputSignal<readonly string[]>;
|
|
308
|
+
/** Photo upload; without it the editor only orders and removes photos. */
|
|
309
|
+
readonly uploader: _angular_core.InputSignal<LoginPhotoUploader | null>;
|
|
310
|
+
/** Readable message of an upload error (for example, the store `extractStoreErrorMessage`). */
|
|
311
|
+
readonly describeError: _angular_core.InputSignal<((error: unknown) => string | null) | null>;
|
|
312
|
+
/** Shows the note and the button that send the person to «Aplicar tema». */
|
|
313
|
+
readonly showApplyShortcut: _angular_core.InputSignal<boolean>;
|
|
314
|
+
/** Full `meta.login` after each change made by the person. */
|
|
315
|
+
readonly loginChange: _angular_core.OutputEmitterRef<ThemeLogin>;
|
|
316
|
+
readonly goToApply: _angular_core.OutputEmitterRef<void>;
|
|
317
|
+
protected readonly effects: readonly _solercia_ui_login_appearance.LoginEffect[];
|
|
318
|
+
protected readonly transitions: readonly _solercia_ui_login_appearance.LoginTransition[];
|
|
319
|
+
protected readonly positions: readonly LoginPosition[];
|
|
320
|
+
protected readonly backgrounds: readonly LoginBackground[];
|
|
321
|
+
protected readonly modes: readonly LoginMode[];
|
|
322
|
+
protected readonly maxImages = 12;
|
|
323
|
+
protected readonly minSeconds: number;
|
|
324
|
+
protected readonly maxSeconds: number;
|
|
325
|
+
/** Draft of the person's edits; a new `base` (import, version, apply) discards it. */
|
|
326
|
+
private readonly draft;
|
|
327
|
+
protected readonly value: _angular_core.Signal<ThemeLogin>;
|
|
328
|
+
protected readonly previewTheme: _angular_core.Signal<ThemeFile | null>;
|
|
329
|
+
protected readonly mode: _angular_core.WritableSignal<LoginMode>;
|
|
330
|
+
protected readonly modeConfig: _angular_core.Signal<ThemeLoginModeConfig & {
|
|
331
|
+
position: LoginPosition;
|
|
332
|
+
background: LoginBackground;
|
|
333
|
+
}>;
|
|
334
|
+
protected readonly images: _angular_core.Signal<string[]>;
|
|
335
|
+
protected readonly full: _angular_core.Signal<boolean>;
|
|
336
|
+
protected readonly seconds: _angular_core.Signal<number>;
|
|
337
|
+
protected readonly effect: _angular_core.Signal<_solercia_ui_login_appearance.LoginEffect>;
|
|
338
|
+
protected readonly transition: _angular_core.Signal<_solercia_ui_login_appearance.LoginTransition>;
|
|
339
|
+
protected readonly captionLabel: _angular_core.Signal<string>;
|
|
340
|
+
protected readonly indicators: _angular_core.Signal<boolean>;
|
|
341
|
+
protected readonly uploading: _angular_core.WritableSignal<{
|
|
342
|
+
current: number;
|
|
343
|
+
total: number;
|
|
344
|
+
} | null>;
|
|
345
|
+
protected readonly photoError: _angular_core.WritableSignal<string | null>;
|
|
346
|
+
private readonly previous;
|
|
347
|
+
protected readonly canUndo: _angular_core.Signal<boolean>;
|
|
348
|
+
protected readonly resetDone: _angular_core.WritableSignal<boolean>;
|
|
349
|
+
private readonly safeFallback;
|
|
350
|
+
protected readonly previewView: _angular_core.Signal<_solercia_ui_login_appearance.LoginView | null>;
|
|
351
|
+
private commit;
|
|
352
|
+
protected set(changes: Partial<ThemeLogin>): void;
|
|
353
|
+
protected setMode(changes: Partial<ThemeLoginModeConfig>): void;
|
|
354
|
+
protected stepSeconds(delta: number): void;
|
|
355
|
+
protected setLabel(event: Event): void;
|
|
356
|
+
protected setIndicators(event: Event): void;
|
|
357
|
+
protected move(index: number, delta: number): void;
|
|
358
|
+
protected remove(index: number): void;
|
|
359
|
+
protected nameOf(url: string): string;
|
|
360
|
+
protected onFiles(event: Event): Promise<void>;
|
|
361
|
+
private upload;
|
|
362
|
+
protected reset(): void;
|
|
363
|
+
protected undo(): void;
|
|
364
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SolLoginAppearanceEditorComponent, never>;
|
|
365
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SolLoginAppearanceEditorComponent, "sol-login-appearance-editor", never, { "base": { "alias": "base"; "required": true; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "fallbackImages": { "alias": "fallbackImages"; "required": false; "isSignal": true; }; "uploader": { "alias": "uploader"; "required": false; "isSignal": true; }; "describeError": { "alias": "describeError"; "required": false; "isSignal": true; }; "showApplyShortcut": { "alias": "showApplyShortcut"; "required": false; "isSignal": true; }; }, { "loginChange": "loginChange"; "goToApply": "goToApply"; }, never, never, true, never>;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** Text tree of the login appearance pieces (keys under `sol.loginAppearance`). */
|
|
369
|
+
type LoginAppearanceDictionary = {
|
|
370
|
+
readonly [key: string]: string | LoginAppearanceDictionary;
|
|
371
|
+
};
|
|
372
|
+
/** Default texts in Colombian Spanish (formal, tuteo). The host overrides any key in its engine. */
|
|
373
|
+
declare const SOL_LOGIN_APPEARANCE_I18N_ES_CO: LoginAppearanceDictionary;
|
|
374
|
+
declare const SOL_LOGIN_APPEARANCE_I18N_EN: LoginAppearanceDictionary;
|
|
375
|
+
/** Prefix of every key in the host translation engine. */
|
|
376
|
+
declare const LOGIN_APPEARANCE_I18N_PREFIX = "sol.loginAppearance.";
|
|
377
|
+
|
|
378
|
+
export { LOGIN_APPEARANCE_I18N_PREFIX, LOGIN_BACKGROUNDS, LOGIN_CAPTION_POSITIONS, LOGIN_DEFAULT_BACKGROUND, LOGIN_DEFAULT_EFFECT, LOGIN_DEFAULT_POSITION, LOGIN_DEFAULT_TRANSITION, LOGIN_EFFECTS, LOGIN_INTERVAL_DEFAULT_MS, LOGIN_INTERVAL_MAX_MS, LOGIN_INTERVAL_MIN_MS, LOGIN_MAX_IMAGES, LOGIN_META_SCHEMA, LOGIN_POSITIONS, LOGIN_SHAPE_BACKGROUNDS, LOGIN_TRANSITIONS, SOL_LOGIN_APPEARANCE_I18N_EN, SOL_LOGIN_APPEARANCE_I18N_ES_CO, SolLoginAppearanceEditorComponent, SolLoginBrandComponent, SolLoginFrameComponent, SolLoginPanelBackgroundComponent, SolLoginPhotosComponent, SolLoginPreviewComponent, SolLoginSceneComponent, SolLoginShapesComponent, buildLoginView, hasLoginShapes, isAllowedLoginImage, normalizeLogin, normalizeLoginAppearance, resolveLoginView };
|
|
379
|
+
export type { LoginAppearanceDictionary, LoginAppearanceSources, LoginBackground, LoginBrandLogo, LoginCaptionPosition, LoginEffect, LoginLogo, LoginMode, LoginPhotoUploader, LoginPosition, LoginTransition, LoginView, PublishedLoginAppearance, ThemeLogin, ThemeLoginCaption, ThemeLoginModeConfig, ThemeLoginPanel, ThemeLoginVeil };
|