@reforgium/presentia 1.4.4 → 2.0.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 +144 -0
- package/LICENSE +21 -0
- package/README.md +346 -35
- package/bin/presentia-gen-lang-keys.mjs +1 -1
- package/bin/presentia-gen-namespaces.mjs +1248 -0
- package/fesm2022/reforgium-presentia.mjs +750 -197
- package/package.json +27 -7
- package/types/reforgium-presentia.d.ts +292 -89
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { InjectionToken, Signal, PipeTransform, EnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as _reforgium_internal from '@reforgium/internal';
|
|
4
|
-
import { Devices, Langs, Themes } from '@reforgium/internal';
|
|
4
|
+
import { Devices, Langs, Themes as Themes$1 } from '@reforgium/internal';
|
|
5
5
|
import { HttpHeaders, HttpParams, HttpContext } from '@angular/common/http';
|
|
6
6
|
|
|
7
7
|
/** Breakpoints for different device types */
|
|
@@ -75,35 +75,44 @@ declare class AdaptiveService {
|
|
|
75
75
|
* Updates automatically when screen width changes
|
|
76
76
|
* or when specified breakpoints are crossed (`DEVICE_BREAKPOINTS`).
|
|
77
77
|
*/
|
|
78
|
-
device:
|
|
78
|
+
device: _angular_core.Signal<Devices>;
|
|
79
79
|
/**
|
|
80
80
|
* Current browser window width in pixels.
|
|
81
81
|
* Updates reactively on `resize` event.
|
|
82
82
|
*/
|
|
83
|
-
width:
|
|
83
|
+
width: _angular_core.Signal<number>;
|
|
84
84
|
/**
|
|
85
85
|
* Current browser window height in pixels.
|
|
86
86
|
* Updates reactively on `resize` event.
|
|
87
87
|
*/
|
|
88
|
-
height:
|
|
88
|
+
height: _angular_core.Signal<number>;
|
|
89
89
|
/**
|
|
90
90
|
* Computed signal indicating whether the current device is a desktop.
|
|
91
91
|
* Used for conditional rendering or layout configuration.
|
|
92
92
|
*/
|
|
93
|
-
isDesktop:
|
|
93
|
+
isDesktop: _angular_core.Signal<boolean>;
|
|
94
|
+
isMobile: _angular_core.Signal<boolean>;
|
|
95
|
+
isTablet: _angular_core.Signal<boolean>;
|
|
96
|
+
isDesktopSmall: _angular_core.Signal<boolean>;
|
|
94
97
|
/**
|
|
95
98
|
* Computed signal determining whether the screen is in portrait orientation.
|
|
96
99
|
* Returns `true` if window height is greater than width.
|
|
97
100
|
*/
|
|
98
|
-
isPortrait:
|
|
101
|
+
isPortrait: _angular_core.Signal<boolean>;
|
|
99
102
|
private deviceBreakpoints;
|
|
100
103
|
private devicePriority;
|
|
101
104
|
private destroyRef;
|
|
102
105
|
private breakpointObserver;
|
|
103
106
|
private isBrowser;
|
|
107
|
+
private resizeDebounceId;
|
|
104
108
|
constructor();
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
breakpoint(): Devices;
|
|
110
|
+
is(device: Devices | readonly Devices[]): boolean;
|
|
111
|
+
isAtLeast(device: Devices): boolean;
|
|
112
|
+
isBetween(min: Devices, max: Devices): boolean;
|
|
113
|
+
private deviceRank;
|
|
114
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdaptiveService, never>;
|
|
115
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AdaptiveService>;
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
/**
|
|
@@ -128,6 +137,8 @@ declare class AdaptiveService {
|
|
|
128
137
|
*/
|
|
129
138
|
declare class IfDeviceDirective {
|
|
130
139
|
private readonly deviceInput;
|
|
140
|
+
private readonly atLeastInput;
|
|
141
|
+
private readonly betweenInput;
|
|
131
142
|
private readonly inverseInput;
|
|
132
143
|
private readonly tpl;
|
|
133
144
|
private readonly vcr;
|
|
@@ -137,10 +148,12 @@ declare class IfDeviceDirective {
|
|
|
137
148
|
private readonly currentDevice;
|
|
138
149
|
constructor();
|
|
139
150
|
set reIfDevice(value: Devices | Devices[] | undefined);
|
|
151
|
+
set reIfDeviceAtLeast(value: Devices | undefined);
|
|
152
|
+
set reIfDeviceBetween(value: readonly [Devices, Devices] | undefined);
|
|
140
153
|
set inverse(value: boolean | undefined);
|
|
141
154
|
private updateView;
|
|
142
|
-
static ɵfac:
|
|
143
|
-
static ɵdir:
|
|
155
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<IfDeviceDirective, never>;
|
|
156
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<IfDeviceDirective, "[reIfDevice],[reIfDeviceAtLeast],[reIfDeviceBetween]", never, { "reIfDevice": { "alias": "reIfDevice"; "required": false; }; "reIfDeviceAtLeast": { "alias": "reIfDeviceAtLeast"; "required": false; }; "reIfDeviceBetween": { "alias": "reIfDeviceBetween"; "required": false; }; "inverse": { "alias": "inverse"; "required": false; }; }, {}, never, never, true, never>;
|
|
144
157
|
}
|
|
145
158
|
|
|
146
159
|
/**
|
|
@@ -221,6 +234,38 @@ type LangNamespaceCacheConfig = {
|
|
|
221
234
|
maxNamespaces?: number;
|
|
222
235
|
ttlMs?: number;
|
|
223
236
|
};
|
|
237
|
+
type LangRouteNamespaceManifest = Record<string, readonly string[]>;
|
|
238
|
+
type LangRouteNamespacePreloadMode = 'blocking' | 'lazy';
|
|
239
|
+
type LangRouteNamespacePreloadMergeStrategy = 'append' | 'replace';
|
|
240
|
+
type LangRouteNamespacePreloadErrorMode = 'continue' | 'throw';
|
|
241
|
+
type LangRouteNamespacePreloadConfig = {
|
|
242
|
+
mode?: LangRouteNamespacePreloadMode;
|
|
243
|
+
dataKey?: string;
|
|
244
|
+
manifest?: LangRouteNamespaceManifest;
|
|
245
|
+
mergeStrategy?: LangRouteNamespacePreloadMergeStrategy;
|
|
246
|
+
onError?: LangRouteNamespacePreloadErrorMode;
|
|
247
|
+
diagnostics?: boolean;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Adapter for custom persistence of language/theme selection.
|
|
251
|
+
* Implement this interface to replace the default `localStorage` storage.
|
|
252
|
+
*/
|
|
253
|
+
type PersistenceAdapter = {
|
|
254
|
+
getItem(key: string): string | null;
|
|
255
|
+
setItem(key: string, value: string): void;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Describes a failed namespace load attempt.
|
|
259
|
+
* Exposed via `LangService.errors()` signal.
|
|
260
|
+
*/
|
|
261
|
+
type LoadNamespaceError = {
|
|
262
|
+
namespace: string;
|
|
263
|
+
lang: Langs;
|
|
264
|
+
/** HTTP status code, or `null` for non-HTTP failures. */
|
|
265
|
+
status: number | null;
|
|
266
|
+
/** Request URL that produced the error. */
|
|
267
|
+
url: string;
|
|
268
|
+
};
|
|
224
269
|
/**
|
|
225
270
|
* Represents configuration settings for localization.
|
|
226
271
|
*
|
|
@@ -243,6 +288,7 @@ type LangNamespaceCacheConfig = {
|
|
|
243
288
|
* - `batchRequestBuilder` optional URL builder hook for batched namespace loading.
|
|
244
289
|
* - `batchResponseAdapter` optional transformer hook for batched API payloads.
|
|
245
290
|
* - `namespaceCache` optional ttl/lru-like cache controls for loaded namespaces.
|
|
291
|
+
* - `routeNamespacePreload` optional route-aware namespace preload settings.
|
|
246
292
|
*/
|
|
247
293
|
interface LocaleConfig {
|
|
248
294
|
url: string;
|
|
@@ -259,11 +305,31 @@ interface LocaleConfig {
|
|
|
259
305
|
batchRequestBuilder?: LangBatchRequestBuilder;
|
|
260
306
|
batchResponseAdapter?: LangBatchResponseAdapter;
|
|
261
307
|
namespaceCache?: LangNamespaceCacheConfig;
|
|
308
|
+
routeNamespacePreload?: LangRouteNamespacePreloadConfig;
|
|
309
|
+
/**
|
|
310
|
+
* Maximum number of namespaces per batch request.
|
|
311
|
+
* When the namespace list exceeds this limit the load is split into multiple batch requests.
|
|
312
|
+
* No limit by default.
|
|
313
|
+
*/
|
|
314
|
+
maxBatchSize?: number;
|
|
262
315
|
}
|
|
263
316
|
declare const innerLangVal: unique symbol;
|
|
264
317
|
|
|
265
318
|
declare const LANG_MISSING_KEY_HANDLER: InjectionToken<LangMissingKeyHandler>;
|
|
266
319
|
|
|
320
|
+
/**
|
|
321
|
+
* Optional DI token for a custom persistence adapter used by `LangService`
|
|
322
|
+
* to store and retrieve the selected language (default key: `'lang'`).
|
|
323
|
+
*
|
|
324
|
+
* When not provided the service falls back to `localStorage` directly.
|
|
325
|
+
*
|
|
326
|
+
* Example:
|
|
327
|
+
* ```ts
|
|
328
|
+
* { provide: LANG_PERSISTENCE_ADAPTER, useValue: sessionStorageAdapter }
|
|
329
|
+
* ```
|
|
330
|
+
*/
|
|
331
|
+
declare const LANG_PERSISTENCE_ADAPTER: InjectionToken<PersistenceAdapter>;
|
|
332
|
+
|
|
267
333
|
/**
|
|
268
334
|
* Injection token for providing locale configuration to the language module.
|
|
269
335
|
*
|
|
@@ -313,6 +379,7 @@ declare class LangService {
|
|
|
313
379
|
private readonly http;
|
|
314
380
|
private readonly isBrowser;
|
|
315
381
|
private readonly missingKeyHandler;
|
|
382
|
+
private readonly routeNamespaceDiagnostics;
|
|
316
383
|
private readonly supportedLangSet;
|
|
317
384
|
/**
|
|
318
385
|
* Computed property determining the current language setting.
|
|
@@ -322,7 +389,7 @@ declare class LangService {
|
|
|
322
389
|
* - If `config.kgValue` is not defined, the property will return the default value 'kg'.
|
|
323
390
|
* - For other languages (e.g. `ru`, `en`) returns source language as-is.
|
|
324
391
|
*/
|
|
325
|
-
readonly currentLang: Signal<"ru" | "kg" | "en" |
|
|
392
|
+
readonly currentLang: Signal<(string & {}) | "ru" | "kg" | "en" | "ky">;
|
|
326
393
|
/**
|
|
327
394
|
* Extracts readonly value from private property `#lang` and assigns it to `innerLangVal`.
|
|
328
395
|
* Expected that property `#lang` has `asReadonly` method that returns immutable representation.
|
|
@@ -347,6 +414,8 @@ declare class LangService {
|
|
|
347
414
|
*/
|
|
348
415
|
get(query: LangKey, params?: LangParams): string;
|
|
349
416
|
get(query: string, params?: LangParams): string;
|
|
417
|
+
has(query: LangKey): boolean;
|
|
418
|
+
has(query: string): boolean;
|
|
350
419
|
/**
|
|
351
420
|
* Observes changes to a specified translation key and dynamically computes its value.
|
|
352
421
|
*
|
|
@@ -368,6 +437,9 @@ declare class LangService {
|
|
|
368
437
|
loadNamespace(ns: string): Promise<void>;
|
|
369
438
|
isNamespaceLoaded(ns: string): boolean;
|
|
370
439
|
loadNamespaces(namespaces: readonly string[]): Promise<void>;
|
|
440
|
+
private loadNamespaceBatch;
|
|
441
|
+
private normalizeMaxBatchSize;
|
|
442
|
+
private chunkNamespaces;
|
|
371
443
|
evictNamespace(ns: string): void;
|
|
372
444
|
clearNamespaceCache(): void;
|
|
373
445
|
private parseModelToRecord;
|
|
@@ -393,8 +465,8 @@ declare class LangService {
|
|
|
393
465
|
private resolveMissingValue;
|
|
394
466
|
private normalizeLang;
|
|
395
467
|
private normalizeSupportedLangs;
|
|
396
|
-
static ɵfac:
|
|
397
|
-
static ɵprov:
|
|
468
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LangService, never>;
|
|
469
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<LangService>;
|
|
398
470
|
}
|
|
399
471
|
|
|
400
472
|
/**
|
|
@@ -445,7 +517,7 @@ declare class LangDirective {
|
|
|
445
517
|
* Localization mode: defines which parts of the element will be translated.
|
|
446
518
|
* @default 'all'
|
|
447
519
|
*/
|
|
448
|
-
lang:
|
|
520
|
+
lang: _angular_core.InputSignal<string | LangDirectiveConfig>;
|
|
449
521
|
/**
|
|
450
522
|
* Explicit key for text content translation.
|
|
451
523
|
*/
|
|
@@ -457,7 +529,7 @@ declare class LangDirective {
|
|
|
457
529
|
/**
|
|
458
530
|
* Name of an additional attribute to localize (besides standard `title`, `label`, `placeholder`).
|
|
459
531
|
*/
|
|
460
|
-
langForAttr:
|
|
532
|
+
langForAttr: _angular_core.InputSignal<string | undefined>;
|
|
461
533
|
private el;
|
|
462
534
|
private renderer;
|
|
463
535
|
private service;
|
|
@@ -509,8 +581,8 @@ declare class LangDirective {
|
|
|
509
581
|
* @returns localized string
|
|
510
582
|
*/
|
|
511
583
|
private getLangValue;
|
|
512
|
-
static ɵfac:
|
|
513
|
-
static ɵdir:
|
|
584
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LangDirective, never>;
|
|
585
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<LangDirective, "[reLang]", never, { "lang": { "alias": "reLang"; "required": false; "isSignal": true; }; "langForAttr": { "alias": "langForAttr"; "required": false; "isSignal": true; }; "reLangKey": { "alias": "reLangKey"; "required": false; }; "reLangAttrs": { "alias": "reLangAttrs"; "required": false; }; }, {}, never, never, true, never>;
|
|
514
586
|
}
|
|
515
587
|
|
|
516
588
|
/**
|
|
@@ -529,6 +601,7 @@ declare class LangDirective {
|
|
|
529
601
|
*/
|
|
530
602
|
declare class LangPipe implements PipeTransform {
|
|
531
603
|
private readonly cache;
|
|
604
|
+
private readonly warnedUnresolved;
|
|
532
605
|
private readonly lang;
|
|
533
606
|
private readonly injector;
|
|
534
607
|
private readonly config;
|
|
@@ -538,8 +611,9 @@ declare class LangPipe implements PipeTransform {
|
|
|
538
611
|
transform(query: string | null | undefined, params?: LangParams | null): string;
|
|
539
612
|
private makeKey;
|
|
540
613
|
private evictIfNeeded;
|
|
541
|
-
|
|
542
|
-
static
|
|
614
|
+
private warnUnresolvedKey;
|
|
615
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LangPipe, never>;
|
|
616
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<LangPipe, "lang", true>;
|
|
543
617
|
}
|
|
544
618
|
|
|
545
619
|
type LangPipeConfig = {
|
|
@@ -549,21 +623,49 @@ type LangPipeConfig = {
|
|
|
549
623
|
};
|
|
550
624
|
declare const LANG_PIPE_CONFIG: InjectionToken<LangPipeConfig>;
|
|
551
625
|
|
|
626
|
+
type BaseTheme = _reforgium_internal.Themes;
|
|
627
|
+
type Theme = BaseTheme | (string & {});
|
|
628
|
+
/**
|
|
629
|
+
* @deprecated Prefer `Theme`.
|
|
630
|
+
*/
|
|
631
|
+
type Themes = Theme;
|
|
632
|
+
|
|
633
|
+
type ThemeDomStrategy = 'root-class' | 'data-attribute';
|
|
634
|
+
type ThemeClassNameBuilder = (theme: Theme) => string;
|
|
635
|
+
interface ThemeDomConfig {
|
|
636
|
+
strategy?: ThemeDomStrategy;
|
|
637
|
+
rootSelector?: string;
|
|
638
|
+
darkThemePrefix?: string;
|
|
639
|
+
attributeName?: string;
|
|
640
|
+
themeClassPrefix?: string;
|
|
641
|
+
classNameBuilder?: ThemeClassNameBuilder;
|
|
642
|
+
}
|
|
552
643
|
/**
|
|
553
644
|
* Configuration options for theme management.
|
|
554
645
|
* Defines the default theme and prefix for dark theme variants.
|
|
555
646
|
*/
|
|
556
647
|
interface ThemeConfig {
|
|
648
|
+
/**
|
|
649
|
+
* Explicit list of supported themes.
|
|
650
|
+
* Values outside this registry are ignored and fallback to the default theme.
|
|
651
|
+
* @optional
|
|
652
|
+
*/
|
|
653
|
+
registry?: readonly Theme[];
|
|
557
654
|
/**
|
|
558
655
|
* The default theme to be applied when no other theme is specified.
|
|
559
656
|
* @optional
|
|
560
657
|
*/
|
|
561
|
-
defaultTheme?:
|
|
658
|
+
defaultTheme?: Theme;
|
|
562
659
|
/**
|
|
563
660
|
* Prefix string used to identify and apply dark theme variants.
|
|
564
661
|
* @optional
|
|
565
662
|
*/
|
|
566
663
|
darkThemePrefix?: string;
|
|
664
|
+
/**
|
|
665
|
+
* DOM application strategy for the active theme.
|
|
666
|
+
* @optional
|
|
667
|
+
*/
|
|
668
|
+
dom?: ThemeDomConfig;
|
|
567
669
|
}
|
|
568
670
|
|
|
569
671
|
/**
|
|
@@ -582,29 +684,14 @@ interface ThemeConfig {
|
|
|
582
684
|
* const isDarkTheme = theme === themes.dark;
|
|
583
685
|
* ```
|
|
584
686
|
*/
|
|
585
|
-
declare const themes: Record<Themes, Themes>;
|
|
687
|
+
declare const themes: Record<Themes$1, Themes$1>;
|
|
586
688
|
/**
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
* This constant defines the prefix applied to HTML elements when the dark theme is active.
|
|
590
|
-
* It is typically added to the root element or specific components to enable dark theme styles.
|
|
591
|
-
*
|
|
592
|
-
* @example
|
|
593
|
-
* ```typescript
|
|
594
|
-
* document.body.classList.add(darkThemePrefix); // Applies 're-dark' class
|
|
595
|
-
* ```
|
|
689
|
+
* @deprecated Prefer `theme.dom.darkClassName` via `providePresentia(...)`.
|
|
596
690
|
*/
|
|
597
691
|
declare const darkThemePrefix = "re-dark";
|
|
598
692
|
|
|
599
693
|
/**
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
* Defines the initial theme settings for the application.
|
|
603
|
-
* By default, sets the light theme as the active theme.
|
|
604
|
-
*
|
|
605
|
-
* This configuration can be overridden when providing `THEME_CONFIG` token
|
|
606
|
-
* at the module or application level.
|
|
607
|
-
* ```
|
|
694
|
+
* @deprecated Prefer configuring themes through `providePresentia({ theme: ... })`.
|
|
608
695
|
*/
|
|
609
696
|
declare const defaultThemeConfig: {
|
|
610
697
|
defaultTheme: _reforgium_internal.Themes;
|
|
@@ -628,6 +715,23 @@ declare const defaultThemeConfig: {
|
|
|
628
715
|
*/
|
|
629
716
|
declare const THEME_CONFIG: InjectionToken<ThemeConfig>;
|
|
630
717
|
|
|
718
|
+
/**
|
|
719
|
+
* @deprecated Prefer configuring theme persistence through `providePresentia({ theme: { persistence... } })`.
|
|
720
|
+
*/
|
|
721
|
+
declare const defaultThemePersistenceAdapter: PersistenceAdapter;
|
|
722
|
+
/**
|
|
723
|
+
* DI token for the persistence adapter used by `ThemeService`
|
|
724
|
+
* to store and retrieve the selected theme (default key: `'theme'`).
|
|
725
|
+
*
|
|
726
|
+
* By default `presentia` provides a `localStorage`-backed adapter.
|
|
727
|
+
*
|
|
728
|
+
* Example:
|
|
729
|
+
* ```ts
|
|
730
|
+
* { provide: THEME_PERSISTENCE_ADAPTER, useValue: sessionStorageAdapter }
|
|
731
|
+
* ```
|
|
732
|
+
*/
|
|
733
|
+
declare const THEME_PERSISTENCE_ADAPTER: InjectionToken<PersistenceAdapter>;
|
|
734
|
+
|
|
631
735
|
/**
|
|
632
736
|
* Service for managing application theme.
|
|
633
737
|
*
|
|
@@ -644,8 +748,15 @@ declare const THEME_CONFIG: InjectionToken<ThemeConfig>;
|
|
|
644
748
|
declare class ThemeService {
|
|
645
749
|
#private;
|
|
646
750
|
private readonly config;
|
|
751
|
+
private readonly registry;
|
|
647
752
|
private readonly themeDefault;
|
|
753
|
+
private readonly domStrategy;
|
|
648
754
|
private readonly darkPrefix;
|
|
755
|
+
private readonly attributeName;
|
|
756
|
+
private readonly themeClassPrefix;
|
|
757
|
+
private readonly classNameBuilder;
|
|
758
|
+
private readonly rootSelector;
|
|
759
|
+
private readonly persistence;
|
|
649
760
|
private readonly isBrowser;
|
|
650
761
|
private readonly document;
|
|
651
762
|
/**
|
|
@@ -657,12 +768,13 @@ declare class ThemeService {
|
|
|
657
768
|
* <div [class]="themeService.theme()"></div>
|
|
658
769
|
* ```
|
|
659
770
|
*/
|
|
660
|
-
theme:
|
|
771
|
+
theme: _angular_core.Signal<Theme>;
|
|
661
772
|
/**
|
|
662
773
|
* Convenient flag returning `true` if the light theme is active.
|
|
663
774
|
* Suitable for conditional style application or resource selection.
|
|
664
775
|
*/
|
|
665
|
-
isLight:
|
|
776
|
+
isLight: _angular_core.Signal<boolean>;
|
|
777
|
+
isDark: _angular_core.Signal<boolean>;
|
|
666
778
|
constructor();
|
|
667
779
|
/**
|
|
668
780
|
* Switches theme.
|
|
@@ -672,11 +784,25 @@ declare class ThemeService {
|
|
|
672
784
|
*
|
|
673
785
|
* @param theme — explicit theme value (`'light'` or `'dark'`).
|
|
674
786
|
*/
|
|
675
|
-
switch(theme?:
|
|
676
|
-
|
|
677
|
-
|
|
787
|
+
switch(theme?: Theme): void;
|
|
788
|
+
is(theme: Theme | readonly Theme[]): boolean;
|
|
789
|
+
private resolveTheme;
|
|
790
|
+
private resolveRegistry;
|
|
791
|
+
private resolveInitialTheme;
|
|
792
|
+
private getStoredTheme;
|
|
793
|
+
private persistTheme;
|
|
794
|
+
private applyThemeToDom;
|
|
795
|
+
private nextTheme;
|
|
796
|
+
private resolveRootElement;
|
|
797
|
+
private resolveThemeClassName;
|
|
798
|
+
private clearThemeClasses;
|
|
799
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
800
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ThemeService>;
|
|
678
801
|
}
|
|
679
802
|
|
|
803
|
+
/**
|
|
804
|
+
* @deprecated Prefer `PresentiaConfig` with `providePresentia(...)` for the grouped v2 API.
|
|
805
|
+
*/
|
|
680
806
|
interface AppConfig {
|
|
681
807
|
locale: LocaleConfig;
|
|
682
808
|
theme?: ThemeConfig;
|
|
@@ -684,8 +810,67 @@ interface AppConfig {
|
|
|
684
810
|
langPipe?: LangPipeConfig;
|
|
685
811
|
langMissingKeyHandler?: LangMissingKeyHandler;
|
|
686
812
|
}
|
|
813
|
+
/**
|
|
814
|
+
* @deprecated Prefer `providePresentia(...)` for new integrations.
|
|
815
|
+
*/
|
|
687
816
|
declare function provideReInit(config: AppConfig): EnvironmentProviders;
|
|
688
817
|
|
|
818
|
+
type PresentiaLangConfig = {
|
|
819
|
+
source: {
|
|
820
|
+
url: string;
|
|
821
|
+
fromAssets: boolean;
|
|
822
|
+
defaultLang?: Langs;
|
|
823
|
+
fallbackLang?: Langs;
|
|
824
|
+
supportedLangs?: readonly string[];
|
|
825
|
+
kgValue?: 'kg' | 'ky';
|
|
826
|
+
};
|
|
827
|
+
rendering?: {
|
|
828
|
+
placeholder?: string | ((query: string) => string);
|
|
829
|
+
missingValue?: string;
|
|
830
|
+
};
|
|
831
|
+
preload?: {
|
|
832
|
+
global?: readonly string[];
|
|
833
|
+
routes?: LangRouteNamespacePreloadConfig;
|
|
834
|
+
};
|
|
835
|
+
transport?: {
|
|
836
|
+
requestBuilder?: LangRequestBuilder;
|
|
837
|
+
requestOptionsFactory?: LangRequestOptionsFactory;
|
|
838
|
+
responseAdapter?: LangResponseAdapter;
|
|
839
|
+
batchRequestBuilder?: LangBatchRequestBuilder;
|
|
840
|
+
batchResponseAdapter?: LangBatchResponseAdapter;
|
|
841
|
+
maxBatchSize?: number;
|
|
842
|
+
};
|
|
843
|
+
cache?: LangNamespaceCacheConfig;
|
|
844
|
+
diagnostics?: {
|
|
845
|
+
lateNamespaceLoads?: boolean;
|
|
846
|
+
};
|
|
847
|
+
missingKeyHandler?: LangMissingKeyHandler;
|
|
848
|
+
};
|
|
849
|
+
type PresentiaThemeConfig = {
|
|
850
|
+
registry?: readonly Theme[];
|
|
851
|
+
defaultTheme?: ThemeConfig['defaultTheme'];
|
|
852
|
+
persistence?: 'localStorage' | 'none';
|
|
853
|
+
persistenceAdapter?: PersistenceAdapter;
|
|
854
|
+
dom?: {
|
|
855
|
+
strategy?: 'root-class' | 'data-attribute';
|
|
856
|
+
rootSelector?: string;
|
|
857
|
+
darkClassName?: string;
|
|
858
|
+
attributeName?: string;
|
|
859
|
+
classPrefix?: string;
|
|
860
|
+
classNameBuilder?: (theme: Theme) => string;
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
type PresentiaAdaptiveConfig = {
|
|
864
|
+
breakpoints?: DeviceBreakpoints;
|
|
865
|
+
strategy?: 'width';
|
|
866
|
+
};
|
|
867
|
+
interface PresentiaConfig {
|
|
868
|
+
lang: PresentiaLangConfig;
|
|
869
|
+
theme?: PresentiaThemeConfig;
|
|
870
|
+
adaptive?: PresentiaAdaptiveConfig;
|
|
871
|
+
}
|
|
872
|
+
declare function providePresentia(config: PresentiaConfig): EnvironmentProviders;
|
|
873
|
+
|
|
689
874
|
/**
|
|
690
875
|
* Open Graph meta tags type definition.
|
|
691
876
|
* Used for social media sharing preview configuration.
|
|
@@ -775,8 +960,8 @@ declare class SeoService {
|
|
|
775
960
|
setJsonLd(schema: object): void;
|
|
776
961
|
private upsert;
|
|
777
962
|
private upsertLink;
|
|
778
|
-
static ɵfac:
|
|
779
|
-
static ɵprov:
|
|
963
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SeoService, never>;
|
|
964
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SeoService>;
|
|
780
965
|
}
|
|
781
966
|
|
|
782
967
|
/**
|
|
@@ -800,8 +985,9 @@ declare class SeoService {
|
|
|
800
985
|
declare class SeoRouteListener {
|
|
801
986
|
private router;
|
|
802
987
|
private seo;
|
|
803
|
-
private ar;
|
|
804
988
|
private destroyRef;
|
|
989
|
+
private initialized;
|
|
990
|
+
private baseUrl;
|
|
805
991
|
/**
|
|
806
992
|
* Initializes the route listener to monitor navigation events and update SEO metadata.
|
|
807
993
|
* Subscribes to router NavigationEnd events and automatically unsubscribes on component destruction.
|
|
@@ -810,60 +996,77 @@ declare class SeoRouteListener {
|
|
|
810
996
|
* Trailing slashes will be removed automatically.
|
|
811
997
|
*/
|
|
812
998
|
init(baseUrl: string): void;
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
* This is used to extract route data from the currently active leaf route.
|
|
816
|
-
*
|
|
817
|
-
* @param r - The root activated route to start traversing from.
|
|
818
|
-
* @returns The deepest child route in the hierarchy.
|
|
819
|
-
*/
|
|
820
|
-
private deepest;
|
|
821
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SeoRouteListener, never>;
|
|
822
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SeoRouteListener>;
|
|
999
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SeoRouteListener, never>;
|
|
1000
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SeoRouteListener>;
|
|
823
1001
|
}
|
|
824
1002
|
|
|
1003
|
+
type RouteWatcherReadStrategy = 'deepest' | 'merged';
|
|
1004
|
+
|
|
1005
|
+
type RouteWatcherState = {
|
|
1006
|
+
params: Record<string, string>;
|
|
1007
|
+
deepestParams: Record<string, string>;
|
|
1008
|
+
query: Record<string, string>;
|
|
1009
|
+
data: Record<string, unknown>;
|
|
1010
|
+
mergedData: Record<string, unknown>;
|
|
1011
|
+
url: string;
|
|
1012
|
+
routePattern: string;
|
|
1013
|
+
fragment: string | null;
|
|
1014
|
+
};
|
|
825
1015
|
/**
|
|
826
1016
|
* Reactive snapshot of the current route (the deepest active route).
|
|
827
1017
|
* Updates on every `NavigationEnd` event.
|
|
828
|
-
*
|
|
829
|
-
* Provides:
|
|
830
|
-
* - `params` / `query` — strings (as in Angular Router)
|
|
831
|
-
* - `data` — arbitrary data (from route configuration/resolvers)
|
|
832
|
-
* - `url` — string assembled from `UrlSegment[]`
|
|
833
|
-
* - `fragment` — hash (#section)
|
|
834
|
-
* - `selectData(key)` — type-safe selector for `data`
|
|
835
|
-
* - `state` — combined computed object (convenient for single subscriber)
|
|
836
1018
|
*/
|
|
837
1019
|
declare class RouteWatcher {
|
|
838
1020
|
#private;
|
|
839
1021
|
private readonly router;
|
|
840
1022
|
private readonly destroyRef;
|
|
841
|
-
/**
|
|
842
|
-
readonly params:
|
|
843
|
-
/**
|
|
844
|
-
readonly
|
|
845
|
-
/**
|
|
846
|
-
readonly
|
|
847
|
-
/**
|
|
848
|
-
readonly
|
|
849
|
-
/**
|
|
850
|
-
readonly
|
|
851
|
-
/**
|
|
852
|
-
readonly
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1023
|
+
/** Params merged from root to deepest route. */
|
|
1024
|
+
readonly params: _angular_core.Signal<Record<string, string>>;
|
|
1025
|
+
/** Params declared on the deepest route only. */
|
|
1026
|
+
readonly deepestParams: _angular_core.Signal<Record<string, string>>;
|
|
1027
|
+
/** Query params from the current navigation. */
|
|
1028
|
+
readonly query: _angular_core.Signal<Record<string, string>>;
|
|
1029
|
+
/** Deepest route data only. */
|
|
1030
|
+
readonly data: _angular_core.Signal<Record<string, unknown>>;
|
|
1031
|
+
/** Route data merged from root to deepest route. */
|
|
1032
|
+
readonly mergedData: _angular_core.Signal<Record<string, unknown>>;
|
|
1033
|
+
/** Full current url path assembled from root to deepest route. */
|
|
1034
|
+
readonly url: _angular_core.Signal<string>;
|
|
1035
|
+
/** Current route config pattern, e.g. `orgs/:orgId/users/:id`. */
|
|
1036
|
+
readonly routePattern: _angular_core.Signal<string>;
|
|
1037
|
+
/** Current url fragment without `#`. */
|
|
1038
|
+
readonly fragment: _angular_core.Signal<string | null>;
|
|
1039
|
+
/** Combined computed snapshot. */
|
|
1040
|
+
readonly state: _angular_core.Signal<RouteWatcherState>;
|
|
859
1041
|
constructor();
|
|
860
|
-
|
|
861
|
-
|
|
1042
|
+
selectData<T = unknown>(key: string, strategy?: RouteWatcherReadStrategy): _angular_core.Signal<T | undefined>;
|
|
1043
|
+
selectParam(key: string, strategy?: RouteWatcherReadStrategy): _angular_core.Signal<string | undefined>;
|
|
1044
|
+
matchesPath(path: string | RegExp): boolean;
|
|
862
1045
|
private deepestSnapshot;
|
|
863
|
-
static ɵfac:
|
|
864
|
-
static ɵprov:
|
|
1046
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RouteWatcher, never>;
|
|
1047
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<RouteWatcher>;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
declare const PRESENTIA_ROUTE_NAMESPACES_DATA_KEY = "presentiaNamespaces";
|
|
1051
|
+
declare function providePresentiaRouteNamespacePreload(): _angular_core.EnvironmentProviders;
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* @deprecated Diagnostics are usually enabled through route preload config, not by consuming this service directly.
|
|
1055
|
+
*/
|
|
1056
|
+
declare class RouteNamespaceDiagnosticsService {
|
|
1057
|
+
private readonly router;
|
|
1058
|
+
private readonly enabled;
|
|
1059
|
+
private readonly warned;
|
|
1060
|
+
private currentUrl;
|
|
1061
|
+
private currentNamespaces;
|
|
1062
|
+
private navigationSettled;
|
|
1063
|
+
constructor();
|
|
1064
|
+
registerRouteNamespaces(url: string, namespaces: readonly string[]): void;
|
|
1065
|
+
warnLateNamespaceLoad(namespace: string): void;
|
|
1066
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RouteNamespaceDiagnosticsService, never>;
|
|
1067
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<RouteNamespaceDiagnosticsService>;
|
|
865
1068
|
}
|
|
866
1069
|
|
|
867
|
-
export { AdaptiveService, DEVICE_BREAKPOINTS, IfDeviceDirective, LANG_CONFIG, LANG_MISSING_KEY_HANDLER, LANG_PIPE_CONFIG, LangDirective, LangPipe, LangService, RouteWatcher, SeoRouteListener, SeoService, THEME_CONFIG, ThemeService, darkThemePrefix, defaultBreakpoints, defaultThemeConfig, innerLangVal, provideReInit, themes };
|
|
868
|
-
export type { AppConfig, DeviceBreakpoints, LangBatchRequestBuilder, LangBatchRequestContext, LangBatchResponseAdapter, LangBatchResponseContext, LangDirectiveConfig, LangDirectiveMode, LangDto, LangHttpRequestOptions, LangKey, LangKeyRegistry, LangMissingKeyHandler, LangModel, LangNamespaceCacheConfig, LangParamValue, LangParams, LangPipeConfig, LangRequestBuilder, LangRequestContext, LangRequestOptionsFactory, LangResponseAdapter, LangResponseContext, LocaleConfig, OgType, ThemeConfig, TwitterCardType };
|
|
1070
|
+
export { AdaptiveService, DEVICE_BREAKPOINTS, IfDeviceDirective, LANG_CONFIG, LANG_MISSING_KEY_HANDLER, LANG_PERSISTENCE_ADAPTER, LANG_PIPE_CONFIG, LangDirective, LangPipe, LangService, PRESENTIA_ROUTE_NAMESPACES_DATA_KEY, RouteNamespaceDiagnosticsService, RouteWatcher, SeoRouteListener, SeoService, THEME_CONFIG, THEME_PERSISTENCE_ADAPTER, ThemeService, darkThemePrefix, defaultBreakpoints, defaultThemeConfig, defaultThemePersistenceAdapter, innerLangVal, providePresentia, providePresentiaRouteNamespacePreload, provideReInit, themes };
|
|
1071
|
+
export type { AppConfig, BaseTheme, DeviceBreakpoints, LangBatchRequestBuilder, LangBatchRequestContext, LangBatchResponseAdapter, LangBatchResponseContext, LangDirectiveConfig, LangDirectiveMode, LangDto, LangHttpRequestOptions, LangKey, LangKeyRegistry, LangMissingKeyHandler, LangModel, LangNamespaceCacheConfig, LangParamValue, LangParams, LangPipeConfig, LangRequestBuilder, LangRequestContext, LangRequestOptionsFactory, LangResponseAdapter, LangResponseContext, LangRouteNamespaceManifest, LangRouteNamespacePreloadConfig, LangRouteNamespacePreloadMergeStrategy, LangRouteNamespacePreloadMode, LoadNamespaceError, LocaleConfig, OgType, PersistenceAdapter, PresentiaAdaptiveConfig, PresentiaConfig, PresentiaLangConfig, PresentiaThemeConfig, RouteWatcherReadStrategy, RouteWatcherState, Theme, ThemeConfig, Themes, TwitterCardType };
|
|
869
1072
|
//# sourceMappingURL=reforgium-presentia.d.ts.map
|