@o3r/transloco 14.5.0-prerelease.14 → 14.5.0-prerelease.16
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.
|
@@ -4,7 +4,7 @@ import { Store } from '@ngrx/store';
|
|
|
4
4
|
import { setLocalizationOverride, LocalizationOverrideStoreModule } from '@o3r/transloco';
|
|
5
5
|
|
|
6
6
|
/** Action type to update localization via the rules engine */
|
|
7
|
-
const RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE = '
|
|
7
|
+
const RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE = 'UPDATE_LOCALISATION';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Service to handle async Localization actions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-transloco-rules-engine.mjs","sources":["../../src/rules-engine/localization-interfaces.ts","../../src/rules-engine/localization-rules-engine-action-handler.ts","../../src/rules-engine/localization-rules-engine-module.ts","../../src/rules-engine/o3r-transloco-rules-engine.ts"],"sourcesContent":["import type {\n RulesEngineAction,\n} from '@o3r/core';\n\n/** Action type to update localization via the rules engine */\nexport const RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE = '
|
|
1
|
+
{"version":3,"file":"o3r-transloco-rules-engine.mjs","sources":["../../src/rules-engine/localization-interfaces.ts","../../src/rules-engine/localization-rules-engine-action-handler.ts","../../src/rules-engine/localization-rules-engine-module.ts","../../src/rules-engine/o3r-transloco-rules-engine.ts"],"sourcesContent":["import type {\n RulesEngineAction,\n} from '@o3r/core';\n\n/** Action type to update localization via the rules engine */\nexport const RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE = 'UPDATE_LOCALISATION';\n\n/**\n * Content of action that updates localization\n */\nexport interface ActionUpdateLocalizationBlock extends RulesEngineAction {\n /** Type of the action */\n actionType: typeof RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE;\n /** Localization key to override */\n key: string;\n /** New value for the localization key */\n value: string;\n}\n","import {\n inject,\n Injectable,\n} from '@angular/core';\nimport {\n Store,\n} from '@ngrx/store';\nimport type {\n RulesEngineActionHandler,\n} from '@o3r/core';\nimport {\n ActionUpdateLocalizationBlock,\n RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE,\n} from './localization-interfaces';\nimport {\n LocalizationOverrideStore,\n setLocalizationOverride,\n} from '@o3r/transloco';\n\n/**\n * Service to handle async Localization actions\n */\n@Injectable()\nexport class LocalizationRulesEngineActionHandler implements RulesEngineActionHandler<ActionUpdateLocalizationBlock> {\n private readonly store = inject<Store<LocalizationOverrideStore>>(Store);\n\n /** @inheritdoc */\n public readonly supportingActions = [RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE] as const;\n\n /** @inheritdoc */\n public executeActions(actions: ActionUpdateLocalizationBlock[]): void | Promise<void> {\n const localizationOverrides = actions.reduce<Record<string, string>>((acc, { key, value }) => {\n acc[key] = value;\n return acc;\n }, {});\n\n this.store.dispatch(setLocalizationOverride({ state: { localizationOverrides } }));\n }\n}\n","import {\n NgModule,\n} from '@angular/core';\nimport {\n LocalizationRulesEngineActionHandler,\n} from './localization-rules-engine-action-handler';\nimport {\n LocalizationOverrideStoreModule,\n} from '@o3r/transloco';\n\n@NgModule({\n imports: [\n LocalizationOverrideStoreModule\n ],\n providers: [\n LocalizationRulesEngineActionHandler\n ]\n})\nexport class LocalizationRulesEngineActionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAIA;AACO,MAAM,4CAA4C,GAAG;;ACc5D;;AAEG;MAEU,oCAAoC,CAAA;AADjD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAmC,KAAK,CAAC;;AAGxD,QAAA,IAAA,CAAA,iBAAiB,GAAG,CAAC,4CAA4C,CAAU;AAW5F,IAAA;;AARQ,IAAA,cAAc,CAAC,OAAwC,EAAA;AAC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AAE;wBACP;AACD,qBAAA;AACD,oBAAA,SAAS,EAAE;wBACT;AACD;AACF,iBAAA;;;ACjBD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/transloco",
|
|
3
|
-
"version": "14.5.0-prerelease.
|
|
3
|
+
"version": "14.5.0-prerelease.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"@jsverse/transloco": "^8.0.0",
|
|
46
46
|
"@jsverse/transloco-messageformat": "^8.0.0",
|
|
47
47
|
"@ngrx/store": "^21.0.0",
|
|
48
|
-
"@o3r/core": "~14.5.0-prerelease.
|
|
49
|
-
"@o3r/dynamic-content": "~14.5.0-prerelease.
|
|
50
|
-
"@o3r/extractors": "~14.5.0-prerelease.
|
|
51
|
-
"@o3r/logger": "~14.5.0-prerelease.
|
|
52
|
-
"@o3r/schematics": "~14.5.0-prerelease.
|
|
48
|
+
"@o3r/core": "~14.5.0-prerelease.16",
|
|
49
|
+
"@o3r/dynamic-content": "~14.5.0-prerelease.16",
|
|
50
|
+
"@o3r/extractors": "~14.5.0-prerelease.16",
|
|
51
|
+
"@o3r/logger": "~14.5.0-prerelease.16",
|
|
52
|
+
"@o3r/schematics": "~14.5.0-prerelease.16",
|
|
53
53
|
"@schematics/angular": "^21.0.0",
|
|
54
54
|
"@yarnpkg/cli": "^4.3.1",
|
|
55
55
|
"@yarnpkg/core": "^4.1.1",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
|
-
"@o3r/schematics": "~14.5.0-prerelease.
|
|
113
|
+
"@o3r/schematics": "~14.5.0-prerelease.16",
|
|
114
114
|
"tslib": "^2.6.2"
|
|
115
115
|
},
|
|
116
116
|
"engines": {
|
|
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import * as i1 from '@o3r/transloco';
|
|
4
4
|
|
|
5
5
|
/** Action type to update localization via the rules engine */
|
|
6
|
-
declare const RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE = "
|
|
6
|
+
declare const RULES_ENGINE_LOCALIZATION_UPDATE_ACTION_TYPE = "UPDATE_LOCALISATION";
|
|
7
7
|
/**
|
|
8
8
|
* Content of action that updates localization
|
|
9
9
|
*/
|
|
@@ -22,7 +22,7 @@ interface ActionUpdateLocalizationBlock extends RulesEngineAction {
|
|
|
22
22
|
declare class LocalizationRulesEngineActionHandler implements RulesEngineActionHandler<ActionUpdateLocalizationBlock> {
|
|
23
23
|
private readonly store;
|
|
24
24
|
/** @inheritdoc */
|
|
25
|
-
readonly supportingActions: readonly ["
|
|
25
|
+
readonly supportingActions: readonly ["UPDATE_LOCALISATION"];
|
|
26
26
|
/** @inheritdoc */
|
|
27
27
|
executeActions(actions: ActionUpdateLocalizationBlock[]): void | Promise<void>;
|
|
28
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<LocalizationRulesEngineActionHandler, never>;
|