@o3r/components 15.3.0-prerelease.9 → 15.3.0-rc.1
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/fesm2022/o3r-components-rules-engine.mjs +321 -334
- package/fesm2022/o3r-components-rules-engine.mjs.map +1 -1
- package/fesm2022/o3r-components.mjs +1495 -1638
- package/fesm2022/o3r-components.mjs.map +1 -1
- package/package.json +12 -12
- package/schematics/ng-add/schema.json +0 -3
- package/types/o3r-components-rules-engine.d.ts +60 -66
- package/types/o3r-components-rules-engine.d.ts.map +1 -1
- package/types/o3r-components.d.ts +635 -641
- package/types/o3r-components.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/components",
|
|
3
|
-
"version": "15.3.0-
|
|
3
|
+
"version": "15.3.0-rc.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
"@ngrx/effects": "^22.0.0",
|
|
45
45
|
"@ngrx/entity": "^22.0.0",
|
|
46
46
|
"@ngrx/store": "^22.0.0",
|
|
47
|
-
"@o3r/analytics": "~15.3.0-
|
|
48
|
-
"@o3r/configuration": "~15.3.0-
|
|
49
|
-
"@o3r/core": "~15.3.0-
|
|
50
|
-
"@o3r/dynamic-content": "~15.3.0-
|
|
51
|
-
"@o3r/extractors": "~15.3.0-
|
|
52
|
-
"@o3r/localization": "~15.3.0-
|
|
53
|
-
"@o3r/logger": "~15.3.0-
|
|
54
|
-
"@o3r/rules-engine": "~15.3.0-
|
|
55
|
-
"@o3r/schematics": "~15.3.0-
|
|
56
|
-
"@o3r/transloco": "~15.3.0-
|
|
47
|
+
"@o3r/analytics": "~15.3.0-rc.1",
|
|
48
|
+
"@o3r/configuration": "~15.3.0-rc.1",
|
|
49
|
+
"@o3r/core": "~15.3.0-rc.1",
|
|
50
|
+
"@o3r/dynamic-content": "~15.3.0-rc.1",
|
|
51
|
+
"@o3r/extractors": "~15.3.0-rc.1",
|
|
52
|
+
"@o3r/localization": "~15.3.0-rc.1",
|
|
53
|
+
"@o3r/logger": "~15.3.0-rc.1",
|
|
54
|
+
"@o3r/rules-engine": "~15.3.0-rc.1",
|
|
55
|
+
"@o3r/schematics": "~15.3.0-rc.1",
|
|
56
|
+
"@o3r/transloco": "~15.3.0-rc.1",
|
|
57
57
|
"@schematics/angular": "^22.0.0",
|
|
58
58
|
"chokidar": "^4.0.0 || ^5.0.0",
|
|
59
59
|
"globby": "^11.1.0",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@o3r/schematics": "~15.3.0-
|
|
120
|
+
"@o3r/schematics": "~15.3.0-rc.1",
|
|
121
121
|
"tslib": "^2.6.2"
|
|
122
122
|
},
|
|
123
123
|
"engines": {
|
|
@@ -1,94 +1,88 @@
|
|
|
1
|
-
import { RulesEngineAction, RulesEngineActionHandler } from
|
|
2
|
-
import { Observable, Subject } from
|
|
3
|
-
import * as i2 from
|
|
4
|
-
import { PlaceholderRequestReply } from
|
|
5
|
-
import * as i0 from
|
|
6
|
-
import { EnvironmentProviders } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
|
|
1
|
+
import { RulesEngineAction, RulesEngineActionHandler } from "@o3r/core";
|
|
2
|
+
import { Observable, Subject } from "rxjs";
|
|
3
|
+
import * as i2 from "@o3r/components";
|
|
4
|
+
import { PlaceholderRequestReply } from "@o3r/components";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
7
|
+
import * as i1 from "@ngrx/effects";
|
|
9
8
|
/**
|
|
10
9
|
* Minimal subset of the underlying translation service (ngx-translate's `TranslateService` or
|
|
11
10
|
* transloco's `TranslocoService`) exposing language-change notifications.
|
|
12
11
|
* TODO: remove this abstraction and rely on the single supported translation service in v16
|
|
13
12
|
*/
|
|
14
|
-
interface PlaceholderTranslateService {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
export interface PlaceholderTranslateService {
|
|
14
|
+
/** Language-change stream exposed by ngx-translate (`@o3r/localization`) */
|
|
15
|
+
onLangChange?: Observable<{
|
|
16
|
+
lang: string;
|
|
17
|
+
}>;
|
|
18
|
+
/** Language-change stream exposed by transloco (`@o3r/transloco`) */
|
|
19
|
+
langChanges$?: Observable<string>;
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
22
|
* Minimal subset of the `LocalizationService` API (from `@o3r/localization` or `@o3r/transloco`)
|
|
24
23
|
* used by the placeholder rules engine. Declared locally so that neither package is a hard dependency.
|
|
25
24
|
* TODO: remove this abstraction and import `LocalizationService` directly from the single supported translation package in v16
|
|
26
25
|
*/
|
|
27
|
-
interface PlaceholderLocalizationService {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
export interface PlaceholderLocalizationService {
|
|
27
|
+
/** Translate a localization key, resolving the given interpolation parameters */
|
|
28
|
+
translate(key: string, interpolateParams?: object): Observable<string>;
|
|
29
|
+
/** Get the underlying translation service used by the localization service */
|
|
30
|
+
getTranslateService(): PlaceholderTranslateService;
|
|
31
|
+
/** Get the current active language */
|
|
32
|
+
getCurrentLanguage(): string;
|
|
34
33
|
}
|
|
35
34
|
/** ActionUpdatePlaceholderBlock */
|
|
36
|
-
declare const RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE = "UPDATE_PLACEHOLDER";
|
|
35
|
+
export declare const RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE = "UPDATE_PLACEHOLDER";
|
|
37
36
|
/**
|
|
38
37
|
* Content of action that updates a placeholder
|
|
39
38
|
*/
|
|
40
|
-
interface ActionUpdatePlaceholderBlock extends RulesEngineAction {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
export interface ActionUpdatePlaceholderBlock extends RulesEngineAction {
|
|
40
|
+
actionType: typeof RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE;
|
|
41
|
+
placeholderId: string;
|
|
42
|
+
value: string;
|
|
43
|
+
priority?: number;
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
/**
|
|
48
46
|
* Service to handle async PlaceholderTemplate actions
|
|
49
47
|
*/
|
|
50
|
-
declare class PlaceholderRulesEngineActionHandler implements RulesEngineActionHandler<ActionUpdatePlaceholderBlock> {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
48
|
+
export declare class PlaceholderRulesEngineActionHandler implements RulesEngineActionHandler<ActionUpdatePlaceholderBlock> {
|
|
49
|
+
private readonly logger;
|
|
50
|
+
private readonly injector;
|
|
51
|
+
private readonly translationService;
|
|
52
|
+
protected placeholdersActions$: Subject<{
|
|
53
|
+
placeholderId: string;
|
|
54
|
+
templateUrl: string;
|
|
55
|
+
priority: number;
|
|
56
|
+
}[]>;
|
|
57
|
+
/** @inheritdoc */
|
|
58
|
+
readonly supportingActions: readonly ["UPDATE_PLACEHOLDER"];
|
|
59
|
+
constructor();
|
|
60
|
+
/**
|
|
61
|
+
* Localize the url, replacing the language marker
|
|
62
|
+
* @param url
|
|
63
|
+
* @param language
|
|
64
|
+
*/
|
|
65
|
+
protected resolveUrlWithLang(url: string, language: string | null): string;
|
|
66
|
+
/**
|
|
67
|
+
* Retrieve template as json from a given url
|
|
68
|
+
* @param url
|
|
69
|
+
*/
|
|
70
|
+
protected retrieveTemplate(url: string): Promise<PlaceholderRequestReply>;
|
|
71
|
+
/** @inheritdoc */
|
|
72
|
+
executeActions(actions: ActionUpdatePlaceholderBlock[]): void;
|
|
73
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PlaceholderRulesEngineActionHandler, never>;
|
|
74
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
77
75
|
}
|
|
78
|
-
|
|
79
76
|
/**
|
|
80
77
|
* @deprecated Will be removed in v16. Use {@link providePlaceholderRulesEngineAction} instead.
|
|
81
78
|
*/
|
|
82
|
-
declare class PlaceholderRulesEngineActionModule {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
export declare class PlaceholderRulesEngineActionModule {
|
|
80
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PlaceholderRulesEngineActionModule, never>;
|
|
81
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PlaceholderRulesEngineActionModule, never, [typeof i1.EffectsFeatureModule, typeof i2.PlaceholderRequestStoreModule, typeof i2.PlaceholderTemplateStoreModule], never>;
|
|
82
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PlaceholderRulesEngineActionModule>;
|
|
86
83
|
}
|
|
87
84
|
/**
|
|
88
85
|
* Provide placeholder rules engine action handler.
|
|
89
86
|
*/
|
|
90
|
-
declare function providePlaceholderRulesEngineAction(): EnvironmentProviders;
|
|
91
|
-
|
|
92
|
-
export { PlaceholderRulesEngineActionHandler, PlaceholderRulesEngineActionModule, RULES_ENGINE_PLACEHOLDER_UPDATE_ACTION_TYPE, providePlaceholderRulesEngineAction };
|
|
93
|
-
export type { ActionUpdatePlaceholderBlock, PlaceholderLocalizationService, PlaceholderTranslateService };
|
|
94
|
-
//# sourceMappingURL=o3r-components-rules-engine.d.ts.map
|
|
87
|
+
export declare function providePlaceholderRulesEngineAction(): EnvironmentProviders;
|
|
88
|
+
//# sourceMappingURL=o3r-components-rules-engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-components-rules-engine.d.ts","sources":["../../src/rules-engine/placeholder-interfaces.ts","../../src/rules-engine/placeholder-action-handler.ts","../../src/rules-engine/placeholder-rules-engine-module.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"o3r-components-rules-engine.d.ts","names":[],"sources":["../../src/rules-engine/placeholder-interfaces.ts","../../src/rules-engine/placeholder-action-handler.ts","../../src/rules-engine/placeholder-rules-engine-module.ts"],"mappings":";;;;;;;;;;;;iBAYiB;;EAEf,eAAe;IAAa;;;EAE5B,eAAe;;;;;;;iBAQA;;EAEf,UAAU,aAAa,6BAA6B;;EAEpD,uBAAuB;;EAEvB;;;qBAIW;;;;iBAKI,qCAAqC;EACpD,mBAAmB;EACnB;EACA;EACA;;;;;qBCWW,+CAA+C,yBAAyB;mBAClE;mBACA;mBAIA;YAOP,sBAAsB;IAAU;IAAuB;IAAqB;;;WAGtE;;;;;;;YAgIN,mBAAmB,aAAa;;;;;YAW1B,iBAAiB,cAAc,QAAQ;;EAOhD,eAAe,SAAS;SAlKpB,MAAA,GAAA,qBAAA;;;;;;qBCnBA;SAAA,MAAA,GAAA,qBAAA;SAAA,MAAA,GAAA,sBAAA,mDAAkC,GAAA,6BAAA,GAAA,sCAAA,GAAA;SAAlC,MAAA,GAAA,sBAAA;;;;;wBAKG,uCAAuC"}
|