@o3r/configuration 10.3.0-prerelease.7 → 10.3.0-prerelease.8
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/collection.json +6 -0
- package/core/configurable.d.ts +1 -1
- package/core/configurable.d.ts.map +1 -1
- package/esm2022/core/configurable.mjs +1 -1
- package/esm2022/tools/configuration.decorators.mjs +35 -0
- package/esm2022/tools/configuration.signal.mjs +19 -0
- package/esm2022/tools/index.mjs +3 -2
- package/fesm2022/o3r-configuration.mjs +46 -20
- package/fesm2022/o3r-configuration.mjs.map +1 -1
- package/migration.json +10 -0
- package/package.json +5 -5
- package/schematics/configuration-to-component/index.d.ts.map +1 -1
- package/schematics/configuration-to-component/index.js +93 -13
- package/schematics/configuration-to-component/schema.d.ts +2 -0
- package/schematics/configuration-to-component/schema.d.ts.map +1 -1
- package/schematics/configuration-to-component/schema.json +5 -0
- package/schematics/ng-update/v10-3/index.d.ts +6 -0
- package/schematics/ng-update/v10-3/index.d.ts.map +1 -0
- package/schematics/ng-update/v10-3/index.js +21 -0
- package/schematics/use-config-signal/index.d.ts +8 -0
- package/schematics/use-config-signal/index.d.ts.map +1 -0
- package/schematics/use-config-signal/index.js +95 -0
- package/schematics/use-config-signal/schema.d.ts +8 -0
- package/schematics/use-config-signal/schema.d.ts.map +1 -0
- package/schematics/use-config-signal/schema.js +3 -0
- package/schematics/use-config-signal/schema.json +21 -0
- package/tools/configuration.decorators.d.ts +10 -0
- package/tools/configuration.decorators.d.ts.map +1 -0
- package/tools/configuration.signal.d.ts +16 -0
- package/tools/configuration.signal.d.ts.map +1 -0
- package/tools/index.d.ts +2 -1
- package/tools/index.d.ts.map +1 -1
- package/esm2022/tools/configuration.decorator.mjs +0 -26
- package/tools/configuration.decorator.d.ts +0 -5
- package/tools/configuration.decorator.d.ts.map +0 -1
package/collection.json
CHANGED
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
"factory": "./schematics/configuration-to-component/index#ngAddConfig",
|
|
13
13
|
"schema": "./schematics/configuration-to-component/schema.json",
|
|
14
14
|
"aliases": ["add-config"]
|
|
15
|
+
},
|
|
16
|
+
"use-config-signal": {
|
|
17
|
+
"description": "Migrate from configuration observable to signal",
|
|
18
|
+
"factory": "./schematics/use-config-signal/index#ngUseConfigSignal",
|
|
19
|
+
"schema": "./schematics/use-config-signal/schema.json",
|
|
20
|
+
"aliases": ["migrate-to-signal-config"]
|
|
15
21
|
}
|
|
16
22
|
}
|
|
17
23
|
}
|
package/core/configurable.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { DynamicConfigurable, Configurable } from '@o3r/core';
|
|
1
|
+
export type { DynamicConfigurable, Configurable, DynamicConfigurableWithSignal } from '@o3r/core';
|
|
2
2
|
//# sourceMappingURL=configurable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurable.d.ts","sourceRoot":"","sources":["../../src/core/configurable.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"configurable.d.ts","sourceRoot":"","sources":["../../src/core/configurable.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhYmxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvcmUvY29uZmlndXJhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSB7IER5bmFtaWNDb25maWd1cmFibGUsIENvbmZpZ3VyYWJsZSwgRHluYW1pY0NvbmZpZ3VyYWJsZVdpdGhTaWduYWwgfSBmcm9tICdAbzNyL2NvcmUnO1xuIl19
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { otterComponentInfoPropertyName } from '@o3r/core';
|
|
2
|
+
const decorator = (target, key) => {
|
|
3
|
+
const privateField = `_${key}`;
|
|
4
|
+
if (delete target[key]) {
|
|
5
|
+
Object.defineProperty(target, key, {
|
|
6
|
+
get: function () {
|
|
7
|
+
return this[privateField];
|
|
8
|
+
},
|
|
9
|
+
set: function (value) {
|
|
10
|
+
this[privateField] = value;
|
|
11
|
+
if (this[otterComponentInfoPropertyName]) {
|
|
12
|
+
this[otterComponentInfoPropertyName].configId = this[privateField].configId;
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Decorator to identify the configuration observer
|
|
22
|
+
* @deprecated please use O3rConfig, will be removed in v12
|
|
23
|
+
*/
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
|
+
export function ConfigObserver() {
|
|
26
|
+
return decorator;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Decorator to identify the component's configuration
|
|
30
|
+
*/
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
32
|
+
export function O3rConfig() {
|
|
33
|
+
return decorator;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5kZWNvcmF0b3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3Rvb2xzL2NvbmZpZ3VyYXRpb24uZGVjb3JhdG9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUF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dGhlIGNvbmZpZ3VyYXRpb24gb2JzZXJ2ZXJcbiAqIEBkZXByZWNhdGVkIHBsZWFzZSB1c2UgTzNyQ29uZmlnLCB3aWxsIGJlIHJlbW92ZWQgaW4gdjEyXG4gKi9cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbmFtaW5nLWNvbnZlbnRpb25cbmV4cG9ydCBmdW5jdGlvbiBDb25maWdPYnNlcnZlcigpIHtcbiAgcmV0dXJuIGRlY29yYXRvcjtcbn1cblxuLyoqXG4gKiBEZWNvcmF0b3IgdG8gaWRlbnRpZnkgdGhlIGNvbXBvbmVudCdzIGNvbmZpZ3VyYXRpb25cbiAqL1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uYW1pbmctY29udmVudGlvblxuZXhwb3J0IGZ1bmN0aW9uIE8zckNvbmZpZygpIHtcbiAgcmV0dXJuIGRlY29yYXRvcjtcbn1cbiJdfQ==
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { shareReplay } from 'rxjs';
|
|
3
|
+
import { getConfiguration } from '../core';
|
|
4
|
+
/**
|
|
5
|
+
* Get a configuration signal
|
|
6
|
+
* @param configInput
|
|
7
|
+
* @param configId
|
|
8
|
+
* @param defaultConfig
|
|
9
|
+
* @param configurationService
|
|
10
|
+
*/
|
|
11
|
+
export const configSignal = (configInput, configId, defaultConfig, configurationService) => {
|
|
12
|
+
if (configurationService) {
|
|
13
|
+
configurationService.extendConfiguration(defaultConfig, configId);
|
|
14
|
+
}
|
|
15
|
+
const signal = toSignal(toObservable(configInput).pipe(configurationService ? configurationService.getComponentConfig(configId, defaultConfig) : getConfiguration(defaultConfig), shareReplay({ bufferSize: 1, refCount: true })), { initialValue: defaultConfig });
|
|
16
|
+
signal.configId = configId;
|
|
17
|
+
return signal;
|
|
18
|
+
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mYXVsdENvbmZpZzogVCxcbiAgY29uZmlndXJhdGlvblNlcnZpY2U/OiBDb25maWd1cmF0aW9uQmFzZVNlcnZpY2UgfCBudWxsXG4pOiBDb25maWd1cmF0aW9uU2lnbmFsPFQ+ID0+IHtcbiAgaWYgKGNvbmZpZ3VyYXRpb25TZXJ2aWNlKSB7XG4gICAgY29uZmlndXJhdGlvblNlcnZpY2UuZXh0ZW5kQ29uZmlndXJhdGlvbihkZWZhdWx0Q29uZmlnLCBjb25maWdJZCk7XG4gIH1cblxuICBjb25zdCBzaWduYWw6IENvbmZpZ3VyYXRpb25TaWduYWw8VD4gPSB0b1NpZ25hbChcbiAgICB0b09ic2VydmFibGUoY29uZmlnSW5wdXQpLnBpcGUoXG4gICAgICBjb25maWd1cmF0aW9uU2VydmljZSA/IGNvbmZpZ3VyYXRpb25TZXJ2aWNlLmdldENvbXBvbmVudENvbmZpZyhjb25maWdJZCwgZGVmYXVsdENvbmZpZykgOiBnZXRDb25maWd1cmF0aW9uKGRlZmF1bHRDb25maWcpLFxuICAgICAgc2hhcmVSZXBsYXkoeyBidWZmZXJTaXplOiAxLCByZWZDb3VudDogdHJ1ZSB9KVxuICAgICksXG4gICAgeyBpbml0aWFsVmFsdWU6IGRlZmF1bHRDb25maWcgfVxuICApIGFzIENvbmZpZ3VyYXRpb25TaWduYWw8VD47XG4gIHNpZ25hbC5jb25maWdJZCA9IGNvbmZpZ0lkO1xuICByZXR1cm4gc2lnbmFsO1xufTtcbiJdfQ==
|
package/esm2022/tools/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from './configuration.
|
|
1
|
+
export * from './configuration.decorators';
|
|
2
2
|
export * from './configuration.observer';
|
|
3
|
-
|
|
3
|
+
export * from './configuration.signal';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdG9vbHMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsd0JBQXdCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2NvbmZpZ3VyYXRpb24uZGVjb3JhdG9ycyc7XG5leHBvcnQgKiBmcm9tICcuL2NvbmZpZ3VyYXRpb24ub2JzZXJ2ZXInO1xuZXhwb3J0ICogZnJvbSAnLi9jb25maWd1cmF0aW9uLnNpZ25hbCc7XG4iXX0=
|
|
@@ -2,12 +2,13 @@ import { computeItemIdentifier, deepFill, sendOtterMessage, filterMessageContent
|
|
|
2
2
|
import { map, distinctUntilChanged, shareReplay, filter, take, switchMap } from 'rxjs/operators';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { InjectionToken, NgModule, Injectable, Optional, Inject } from '@angular/core';
|
|
5
|
-
import { firstValueFrom, Subscription, fromEvent, of, combineLatest, BehaviorSubject } from 'rxjs';
|
|
5
|
+
import { firstValueFrom, Subscription, fromEvent, of, combineLatest, BehaviorSubject, shareReplay as shareReplay$1 } from 'rxjs';
|
|
6
6
|
import * as i1 from '@ngrx/store';
|
|
7
7
|
import { createAction, props, on, createReducer, StoreModule, createFeatureSelector, createSelector, select } from '@ngrx/store';
|
|
8
8
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
9
9
|
import * as i2 from '@o3r/logger';
|
|
10
10
|
import { LoggerModule } from '@o3r/logger';
|
|
11
|
+
import { toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Get the configuration name
|
|
@@ -751,29 +752,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImpor
|
|
|
751
752
|
}]
|
|
752
753
|
}], ctorParameters: () => [{ type: i1.Store }] });
|
|
753
754
|
|
|
755
|
+
const decorator = (target, key) => {
|
|
756
|
+
const privateField = `_${key}`;
|
|
757
|
+
if (delete target[key]) {
|
|
758
|
+
Object.defineProperty(target, key, {
|
|
759
|
+
get: function () {
|
|
760
|
+
return this[privateField];
|
|
761
|
+
},
|
|
762
|
+
set: function (value) {
|
|
763
|
+
this[privateField] = value;
|
|
764
|
+
if (this[otterComponentInfoPropertyName]) {
|
|
765
|
+
this[otterComponentInfoPropertyName].configId = this[privateField].configId;
|
|
766
|
+
}
|
|
767
|
+
},
|
|
768
|
+
enumerable: true,
|
|
769
|
+
configurable: true
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
};
|
|
754
773
|
/**
|
|
755
774
|
* Decorator to identify the configuration observer
|
|
775
|
+
* @deprecated please use O3rConfig, will be removed in v12
|
|
756
776
|
*/
|
|
757
777
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
758
778
|
function ConfigObserver() {
|
|
759
|
-
return
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
this[privateField] = value;
|
|
768
|
-
if (this[otterComponentInfoPropertyName]) {
|
|
769
|
-
this[otterComponentInfoPropertyName].configId = this[privateField].configId;
|
|
770
|
-
}
|
|
771
|
-
},
|
|
772
|
-
enumerable: true,
|
|
773
|
-
configurable: true
|
|
774
|
-
});
|
|
775
|
-
}
|
|
776
|
-
};
|
|
779
|
+
return decorator;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Decorator to identify the component's configuration
|
|
783
|
+
*/
|
|
784
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
785
|
+
function O3rConfig() {
|
|
786
|
+
return decorator;
|
|
777
787
|
}
|
|
778
788
|
|
|
779
789
|
class ConfigurationObserver {
|
|
@@ -809,9 +819,25 @@ class ConfigurationObserver {
|
|
|
809
819
|
}
|
|
810
820
|
}
|
|
811
821
|
|
|
822
|
+
/**
|
|
823
|
+
* Get a configuration signal
|
|
824
|
+
* @param configInput
|
|
825
|
+
* @param configId
|
|
826
|
+
* @param defaultConfig
|
|
827
|
+
* @param configurationService
|
|
828
|
+
*/
|
|
829
|
+
const configSignal = (configInput, configId, defaultConfig, configurationService) => {
|
|
830
|
+
if (configurationService) {
|
|
831
|
+
configurationService.extendConfiguration(defaultConfig, configId);
|
|
832
|
+
}
|
|
833
|
+
const signal = toSignal(toObservable(configInput).pipe(configurationService ? configurationService.getComponentConfig(configId, defaultConfig) : getConfiguration(defaultConfig), shareReplay$1({ bufferSize: 1, refCount: true })), { initialValue: defaultConfig });
|
|
834
|
+
signal.configId = configId;
|
|
835
|
+
return signal;
|
|
836
|
+
};
|
|
837
|
+
|
|
812
838
|
/**
|
|
813
839
|
* Generated bundle index. Do not edit.
|
|
814
840
|
*/
|
|
815
841
|
|
|
816
|
-
export { CONFIGURATION_REDUCER_TOKEN, CONFIGURATION_STORE_NAME, CONFIG_OVERRIDE_REDUCER_TOKEN, CONFIG_OVERRIDE_STORE_NAME, ConfigObserver, ConfigOverrideStoreModule, ConfigurationBaseService, ConfigurationBaseServiceModule, ConfigurationDevtoolsConsoleService, ConfigurationDevtoolsMessageService, ConfigurationDevtoolsModule, ConfigurationObserver, ConfigurationStoreModule, OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS, OtterConfigurationDevtools, clearConfigurationEntities, computeConfiguration, computeConfigurationName, configOverrideInitialState, configOverrideReducer, configOverrideReducerFeatures, configOverrideStorageDeserializer, configOverrideStorageSync, configurationAdapter, configurationInitialState, configurationReducer, configurationReducerFeatures, configurationStorageSync, getConfiguration, getDefaultConfigOverrideReducer, getDefaultConfigurationReducer, globalConfigurationId, isConfigurationMessage, parseConfigurationName, selectAllConfiguration, selectComponentOverrideConfig, selectConfigOverride, selectConfigOverrideState, selectConfigurationEntities, selectConfigurationForComponent, selectConfigurationIds, selectConfigurationState, selectConfigurationTotal, selectGlobalConfiguration, setConfigOverride, setConfigurationEntities, updateConfigurationEntities, updateConfigurationEntity, upsertConfigurationEntities, upsertConfigurationEntity };
|
|
842
|
+
export { CONFIGURATION_REDUCER_TOKEN, CONFIGURATION_STORE_NAME, CONFIG_OVERRIDE_REDUCER_TOKEN, CONFIG_OVERRIDE_STORE_NAME, ConfigObserver, ConfigOverrideStoreModule, ConfigurationBaseService, ConfigurationBaseServiceModule, ConfigurationDevtoolsConsoleService, ConfigurationDevtoolsMessageService, ConfigurationDevtoolsModule, ConfigurationObserver, ConfigurationStoreModule, O3rConfig, OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS, OtterConfigurationDevtools, clearConfigurationEntities, computeConfiguration, computeConfigurationName, configOverrideInitialState, configOverrideReducer, configOverrideReducerFeatures, configOverrideStorageDeserializer, configOverrideStorageSync, configSignal, configurationAdapter, configurationInitialState, configurationReducer, configurationReducerFeatures, configurationStorageSync, getConfiguration, getDefaultConfigOverrideReducer, getDefaultConfigurationReducer, globalConfigurationId, isConfigurationMessage, parseConfigurationName, selectAllConfiguration, selectComponentOverrideConfig, selectConfigOverride, selectConfigOverrideState, selectConfigurationEntities, selectConfigurationForComponent, selectConfigurationIds, selectConfigurationState, selectConfigurationTotal, selectGlobalConfiguration, setConfigOverride, setConfigurationEntities, updateConfigurationEntities, updateConfigurationEntity, upsertConfigurationEntities, upsertConfigurationEntity };
|
|
817
843
|
//# sourceMappingURL=o3r-configuration.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"o3r-configuration.mjs","sources":["../../src/core/configuration.ts","../../src/devkit/configuration-devtools.interface.ts","../../src/stores/config-override/config-override.actions.ts","../../src/stores/config-override/config-override.reducer.ts","../../src/stores/config-override/config-override.state.ts","../../src/stores/config-override/config-override.module.ts","../../src/stores/config-override/config-override.selectors.ts","../../src/stores/config-override/config-override.sync.ts","../../src/stores/configuration/configuration.actions.ts","../../src/stores/configuration/configuration.helpers.ts","../../src/stores/configuration/configuration.reducer.ts","../../src/stores/configuration/configuration.state.ts","../../src/stores/configuration/configuration.module.ts","../../src/stores/configuration/configuration.selectors.ts","../../src/stores/configuration/configuration.sync.ts","../../src/devkit/configuration-devtools.token.ts","../../src/devkit/configuration-devtools.service.ts","../../src/devkit/configuration-devtools.console.service.ts","../../src/devkit/configuration-devtools.message.service.ts","../../src/devkit/configuration-devtools.module.ts","../../src/services/configuration/configuration.base.module.ts","../../src/services/configuration/configuration.base.service.ts","../../src/tools/configuration.decorator.ts","../../src/tools/configuration.observer.ts","../../src/o3r-configuration.ts"],"sourcesContent":["import { computeItemIdentifier, deepFill } from '@o3r/core';\nimport { Observable } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs/operators';\n\n/**\n * Interface to define the error messages into component configuration\n */\nexport interface ErrorMessages {\n /**\n * Error message map\n */\n errorMessages: { [key: string]: string };\n}\n\n/**\n * Interface to specify that the component has an ID\n */\nexport interface Identifiable {\n /**\n * Identifier\n */\n id: string;\n}\n\n/**\n * Get the configuration name\n * @deprecated use {@link computeItemIdentifier} from @o3r/core. Will be removed in v12\n * @param componentName Name of the component to get the configuration\n * @param libraryName Name of the library the component is coming from\n */\nexport function computeConfigurationName(componentName: string, libraryName?: string) {\n return computeItemIdentifier(componentName, libraryName);\n}\n\n/**\n * Get the component and library's names based on the configuration name\n * @param configurationName Name of the component as found in the store\n * @returns Object containing library and component name.\n */\nexport function parseConfigurationName(configurationName: string): { library?: string; libraryName?: string; componentName: string } | undefined {\n const parsedConfigurationName = configurationName.match(/^([^#]*)#(.*)$/i);\n if (parsedConfigurationName) {\n return {\n library: parsedConfigurationName.length > 2 ? parsedConfigurationName[1] : undefined,\n componentName: parsedConfigurationName.length > 2 ? parsedConfigurationName[2] : parsedConfigurationName[0]\n };\n }\n}\n\n/**\n * Operator to get the configuration from store for a given component and merge it with the global config\n * @param defaultValue Default value of the configuration\n */\nexport function getConfiguration<T extends Record<string, unknown>>(defaultValue: T) {\n return <C extends Partial<T>>(source: Observable<C | undefined >): Observable<T> =>\n source.pipe(\n map((configOverride) => {\n return deepFill(defaultValue, configOverride);\n }),\n distinctUntilChanged((prev, current) => JSON.stringify(prev) === JSON.stringify(current)),\n shareReplay(1)\n );\n}\n","import type { Dictionary } from '@ngrx/entity';\nimport type {\n Configuration,\n ConnectContentMessage,\n ContextualizationDevtoolsCommonOptions,\n CustomConfig,\n DevtoolsCommonOptions,\n MessageDataTypes,\n OtterMessageContent,\n RequestMessagesContentMessage\n} from '@o3r/core';\nimport type { ConfigurationModel } from '../stores/index';\n\n/** Option for Configuration devtools service */\nexport interface ConfigurationDevtoolsServiceOptions extends DevtoolsCommonOptions, ContextualizationDevtoolsCommonOptions {\n /**\n * Default library name to use if not specified in the function call\n * @default `@o3r/components`\n */\n defaultLibraryName: string;\n /**\n * Default JSON file name if not specified in the function\n * @default partial-static-config.json\n */\n defaultJsonFilename: string;\n}\n\nexport interface ConfigurationsMessage extends OtterMessageContent<'configurations'> {\n /** Configurations */\n configurations: Dictionary<ConfigurationModel>;\n}\n\nexport interface UpdateConfigMessage extends OtterMessageContent<'updateConfig'> {\n /** Configuration ID */\n id: string;\n /** Configuration value */\n configValue: any;\n}\n\ntype ConfigurationMessageContents =\n | ConfigurationsMessage\n | UpdateConfigMessage;\n\n/** List of possible DataTypes for Configuration messages */\nexport type ConfigurationMessageDataTypes = MessageDataTypes<ConfigurationMessageContents>;\n\n/** List of all messages for configuration purpose */\nexport type AvailableConfigurationMessageContents =\n | ConfigurationMessageContents\n | ConnectContentMessage\n | RequestMessagesContentMessage<ConfigurationMessageDataTypes>;\n\n/**\n * Determine if the given message is a Configuration message\n * @param message message to check\n */\nexport const isConfigurationMessage = (message: any): message is AvailableConfigurationMessageContents => {\n return message && (\n message.dataType === 'configurations' ||\n message.dataType === 'updateConfig' ||\n message.dataType === 'requestMessages' ||\n message.dataType === 'connect');\n};\n\n/**\n * Contextualization devtools exposed for configuration in CMS integration\n */\nexport interface ConfigurationContextualizationDevtools {\n /**\n * Replace N configurations in one shot\n * @param configs array of configurations to update\n */\n updateConfigurations: (configurations: CustomConfig<Configuration>[]) => void;\n}\n","import { createAction, props } from '@ngrx/store';\nimport { SetStateActionPayload } from '@o3r/core';\nimport { ConfigOverrideState } from './config-override.state';\n\n/** Actions */\nconst ACTION_SET = '[ConfigOverride] set';\n\n/**\n * Clear all overrides and fill the store with the payload\n */\nexport const setConfigOverride = createAction(ACTION_SET, props<SetStateActionPayload<ConfigOverrideState>>());\n","import {ActionCreator, createReducer, on, ReducerTypes} from '@ngrx/store';\nimport * as actions from './config-override.actions';\nimport {ConfigOverrideState} from './config-override.state';\n\n/**\n * ConfigOverride Store initial value\n */\nexport const configOverrideInitialState: ConfigOverrideState = {configOverrides: {}};\n\n/**\n * List of basic actions for ConfigOverride Store\n */\nexport const configOverrideReducerFeatures: ReducerTypes<ConfigOverrideState, ActionCreator[]>[] = [\n on(actions.setConfigOverride, (_state, payload) => ({...payload.state}))\n];\n\n/**\n * ConfigOverride Store reducer\n */\nexport const configOverrideReducer = createReducer(\n configOverrideInitialState,\n ...configOverrideReducerFeatures\n);\n","/**\n * Property override model\n */\nexport interface PropertyOverride {\n [property: string]: any;\n}\n\n/**\n * ConfigOverride store state\n */\nexport interface ConfigOverrideState {\n /** Map of PropertyOverride indexed on component + config name */\n configOverrides: Record<string, PropertyOverride>;\n}\n\n/**\n * Name of the ConfigOverride Store\n */\nexport const CONFIG_OVERRIDE_STORE_NAME = 'configOverride';\n\n/**\n * ConfigOverride Store Interface\n */\nexport interface ConfigOverrideStore {\n /** ConfigOverride state */\n [CONFIG_OVERRIDE_STORE_NAME]: ConfigOverrideState;\n}\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { Action, ActionReducer, StoreModule } from '@ngrx/store';\n\nimport { configOverrideReducer } from './config-override.reducer';\nimport { CONFIG_OVERRIDE_STORE_NAME, ConfigOverrideState } from './config-override.state';\n\n/** Token of the ConfigOverride reducer */\nexport const CONFIG_OVERRIDE_REDUCER_TOKEN = new InjectionToken<ActionReducer<ConfigOverrideState, Action>>('Feature ConfigOverride Reducer');\n\n/** Provide default reducer for ConfigOverride store */\nexport function getDefaultConfigOverrideReducer() {\n return configOverrideReducer;\n}\n\n@NgModule({\n imports: [\n StoreModule.forFeature(CONFIG_OVERRIDE_STORE_NAME, CONFIG_OVERRIDE_REDUCER_TOKEN)\n ],\n providers: [\n { provide: CONFIG_OVERRIDE_REDUCER_TOKEN, useFactory: getDefaultConfigOverrideReducer }\n ]\n})\nexport class ConfigOverrideStoreModule {\n public static forRoot<T extends ConfigOverrideState>(reducerFactory: () => ActionReducer<T, Action>): ModuleWithProviders<ConfigOverrideStoreModule> {\n return {\n ngModule: ConfigOverrideStoreModule,\n providers: [\n { provide: CONFIG_OVERRIDE_REDUCER_TOKEN, useFactory: reducerFactory }\n ]\n };\n }\n}\n","import { createFeatureSelector, createSelector } from '@ngrx/store';\nimport { CONFIG_OVERRIDE_STORE_NAME, ConfigOverrideState } from './config-override.state';\n\n/** Select ConfigOverride State */\nexport const selectConfigOverrideState = createFeatureSelector<ConfigOverrideState>(CONFIG_OVERRIDE_STORE_NAME);\n\n/** Select the array of ConfigOverride */\nexport const selectConfigOverride = createSelector(selectConfigOverrideState, (state) => state?.configOverrides || {});\n\n/**\n * Get the override for given component identifier\n * @param componentId\n * @returns\n */\nexport const selectComponentOverrideConfig =\n (componentId: string) => createSelector(selectConfigOverride, (configOverrides) => configOverrides[componentId] || {});\n","import { Serializer } from '@o3r/core';\nimport { configOverrideInitialState } from './config-override.reducer';\nimport { ConfigOverrideState } from './config-override.state';\n\n/**\n * Deserializer\n * @param rawObject\n */\nexport const configOverrideStorageDeserializer = (rawObject: any) => {\n if (!rawObject) {\n return configOverrideInitialState;\n }\n return rawObject;\n};\n\nexport const configOverrideStorageSync: Serializer<ConfigOverrideState> = {\n deserialize: configOverrideStorageDeserializer\n};\n","import { createAction, props } from '@ngrx/store';\nimport { Configuration } from '@o3r/core';\n\nexport interface SetConfigurationEntitiesPayload {\n /** Map of configurations to update/insert, this is now Partial due the change of Configuration interface */\n entities: {[id: string]: Partial<Configuration>};\n}\n\nexport interface UpsertConfigurationEntityPayload {\n /** ID of the item */\n id: string;\n /** Updated/New configuration object */\n configuration: Partial<Configuration>;\n}\n\nexport interface UpdateConfigurationEntityPayload {\n /** ID of the item */\n id: string;\n /** Updated/New configuration partial object */\n configuration: Partial<Configuration>;\n}\n\n/** Entity Actions */\nconst ACTION_CLEAR_ENTITIES = '[Configuration] clear entities';\nconst ACTION_UPDATE_ENTITIES = '[Configuration] update entities';\nconst ACTION_UPSERT_ENTITIES = '[Configuration] upsert entities';\nconst ACTION_SET_ENTITIES = '[Configuration] set entities';\nconst ACTION_UPDATE_CONFIGURATION_ENTITY = '[Configuration] update configuration entity';\nconst ACTION_UPSERT_CONFIGURATION_ENTITY = '[Configuration] set configuration entity';\n\n/**\n * Upsert one configuration entity\n */\nexport const upsertConfigurationEntity = createAction(ACTION_UPSERT_CONFIGURATION_ENTITY, props<UpsertConfigurationEntityPayload>());\n\n/**\n * Update one configuration entity\n */\nexport const updateConfigurationEntity = createAction(ACTION_UPDATE_CONFIGURATION_ENTITY, props<UpdateConfigurationEntityPayload>());\n\n/**\n * Clear all configuration and fill the store with the payload\n */\nexport const setConfigurationEntities = createAction(ACTION_SET_ENTITIES, props<SetConfigurationEntitiesPayload>());\n\n/**\n * Update configuration with known IDs, ignore the new ones\n */\nexport const updateConfigurationEntities = createAction(ACTION_UPDATE_ENTITIES, props<SetConfigurationEntitiesPayload>());\n\n/**\n * Update configuration with known IDs, insert the new ones\n */\nexport const upsertConfigurationEntities = createAction(ACTION_UPSERT_ENTITIES, props<SetConfigurationEntitiesPayload>());\n\n/**\n * Clear only the entities, keeps the other attributes in the state\n */\nexport const clearConfigurationEntities = createAction(ACTION_CLEAR_ENTITIES);\n","import type { Configuration, CustomConfig } from '@o3r/core';\nimport { computeItemIdentifier } from '@o3r/core';\nimport { SetConfigurationEntitiesPayload } from './configuration.actions';\n\n/**\n * compute the configuration into SetEntitiesPayload\n * @param customConfigObject array of configurations\n */\nexport function computeConfiguration<T extends Configuration>(customConfigObject: CustomConfig<T>[]): SetConfigurationEntitiesPayload {\n const entities = customConfigObject.reduce<{[k: string]: Partial<T> & {id: string}}>((acc, conf) => {\n const id = computeItemIdentifier(conf.name, conf.library);\n acc[id] = {...conf.config, id};\n return acc;\n }, {});\n return {entities};\n}\n","import {createEntityAdapter, EntityAdapter} from '@ngrx/entity';\nimport {ActionCreator, createReducer, on, ReducerTypes} from '@ngrx/store';\nimport * as actions from './configuration.actions';\n\nimport {ConfigurationModel, ConfigurationState} from './configuration.state';\n\n/**\n * Configuration Store adapter\n */\nexport const configurationAdapter: EntityAdapter<ConfigurationModel> = createEntityAdapter<ConfigurationModel>({\n selectId: (model) => model.id\n});\n\n/**\n * Configuration Store initial value\n */\nexport const configurationInitialState: ConfigurationState = configurationAdapter.getInitialState({});\n\n/**\n * List of basic actions for Configuration Store\n */\nexport const configurationReducerFeatures: ReducerTypes<ConfigurationState, ActionCreator[]>[] = [\n\n on(actions.setConfigurationEntities, (state, payload) => configurationAdapter.addMany((Object.keys(payload) as (keyof typeof payload)[]).map((id) =>\n ({...(payload[id] as any), id})), configurationAdapter.removeAll(state))),\n\n on(actions.updateConfigurationEntities, (state, payload) =>\n configurationAdapter.updateMany(Object.keys(payload.entities).map((id) => ({id: id, changes: payload.entities[id]})), state)),\n\n on(actions.upsertConfigurationEntities, (state, payload) => configurationAdapter.upsertMany(Object.keys(payload.entities).map((id) => ({...payload.entities[id], id})), state)),\n\n on(actions.clearConfigurationEntities, (state) => configurationAdapter.removeAll(state)),\n\n on(actions.updateConfigurationEntity, (state, payload) => configurationAdapter.updateOne({id: payload.id, changes: payload.configuration}, state)),\n\n on(actions.upsertConfigurationEntity, (state, payload) => configurationAdapter.upsertOne({id: payload.id, ...payload.configuration}, state))\n];\n\n/**\n * Configuration Store reducer\n */\nexport const configurationReducer = createReducer(\n configurationInitialState,\n ...configurationReducerFeatures\n);\n","import type { EntityState } from '@ngrx/entity';\nimport type { Configuration } from '@o3r/core';\n\n/**\n * Configuration model\n */\nexport interface ConfigurationModel extends Configuration {\n id: string;\n}\n\n/**\n * Configuration store state\n */\nexport interface ConfigurationState extends EntityState<ConfigurationModel> {\n}\n\n/**\n * Name of the Configuration Store\n */\nexport const CONFIGURATION_STORE_NAME = 'configuration';\n\n/**\n * Configuration Store Interface\n */\nexport interface ConfigurationStore {\n /** Configuration state */\n [CONFIGURATION_STORE_NAME]: ConfigurationState;\n}\n\n/**\n * ID of the global configuration\n */\nexport const globalConfigurationId = 'global';\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { Action, ActionReducer, StoreModule } from '@ngrx/store';\nimport { configurationReducer } from './configuration.reducer';\nimport { CONFIGURATION_STORE_NAME, ConfigurationState } from './configuration.state';\n\n/** Token of the Configuration reducer */\nexport const CONFIGURATION_REDUCER_TOKEN = new InjectionToken<ActionReducer<ConfigurationState, Action>>('Feature Configuration Reducer');\n\n/** Provide default reducer for Configuration store */\nexport function getDefaultConfigurationReducer() {\n return configurationReducer;\n}\n\n@NgModule({\n imports: [\n StoreModule.forFeature(CONFIGURATION_STORE_NAME, CONFIGURATION_REDUCER_TOKEN)\n ],\n providers: [\n { provide: CONFIGURATION_REDUCER_TOKEN, useFactory: getDefaultConfigurationReducer }\n ]\n})\nexport class ConfigurationStoreModule {\n public static forRoot<T extends ConfigurationState>(reducerFactory: () => ActionReducer<T, Action>): ModuleWithProviders<ConfigurationStoreModule> {\n return {\n ngModule: ConfigurationStoreModule,\n providers: [\n { provide: CONFIGURATION_REDUCER_TOKEN, useFactory: reducerFactory }\n ]\n };\n }\n}\n","import { createSelector } from '@ngrx/store';\nimport { Configuration } from '@o3r/core';\nimport { configurationAdapter } from './configuration.reducer';\nimport { CONFIGURATION_STORE_NAME, ConfigurationState, globalConfigurationId } from './configuration.state';\n\nconst {selectIds, selectEntities, selectAll, selectTotal} = configurationAdapter.getSelectors();\n\n/**\n * Select Configuration State\n * Note: the usage of createSelector is to avoid warning printing because of potentially undefined feature store\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const selectConfigurationState = createSelector<{[CONFIGURATION_STORE_NAME]: ConfigurationState }, [state: ConfigurationState | undefined], ConfigurationState | undefined>(\n (state) => state[CONFIGURATION_STORE_NAME],\n (state) => state\n);\n\n/** Select the array of Configuration ids */\nexport const selectConfigurationIds = createSelector(selectConfigurationState, (state) => state ? selectIds(state) : []);\n\n/** Select the array of Configuration */\nexport const selectAllConfiguration = createSelector(selectConfigurationState, (state) => state ? selectAll(state) : []);\n\n/** Select the dictionary of Configuration entities */\nexport const selectConfigurationEntities = createSelector(selectConfigurationState, (state) => state ? selectEntities(state) : {});\n\n/** Select the total Configuration count */\nexport const selectConfigurationTotal = createSelector(selectConfigurationState, (state) => state ? selectTotal(state) : 0);\n\n/**\n * Select the configuration for component with id\n * @param props property of the selector\n * @param props.id id of the component\n */\nexport const selectConfigurationForComponent = <T extends Configuration>(props: {id: string}) =>\n createSelector(selectConfigurationEntities, (entities) => (entities?.[props.id] || {}) as Configuration as T);\n\n/**\n * Select the global configuration\n */\nexport const selectGlobalConfiguration = createSelector(selectConfigurationForComponent({ id: globalConfigurationId }), (config) => config);\n","import {configurationAdapter, configurationInitialState} from './configuration.reducer';\nimport {ConfigurationState} from './configuration.state';\n\nexport const configurationStorageSync = {\n deserialize: (rawObject: any) => {\n if (!rawObject || !rawObject.ids) {\n return configurationInitialState;\n }\n const storeObject = configurationAdapter.getInitialState<ConfigurationState>(rawObject);\n return storeObject as ConfigurationState;\n }\n};\n","import { InjectionToken } from '@angular/core';\nimport { ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\n\nexport const OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS: ConfigurationDevtoolsServiceOptions = {\n defaultLibraryName: '@o3r/components',\n defaultJsonFilename: 'partial-static-config.json',\n isActivatedOnBootstrap: false,\n isActivatedOnBootstrapWhenCMSContext: true\n};\n\n// eslint-disable-next-line max-len\nexport const OTTER_CONFIGURATION_DEVTOOLS_OPTIONS: InjectionToken<ConfigurationDevtoolsServiceOptions> = new InjectionToken<ConfigurationDevtoolsServiceOptions>('Otter Configuration Devtools options');\n","import { ApplicationRef, Inject, Injectable, Optional } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { Configuration, CustomConfig } from '@o3r/core';\nimport { firstValueFrom, Observable } from 'rxjs';\nimport { filter, map, shareReplay } from 'rxjs/operators';\nimport { computeConfigurationName, parseConfigurationName } from '../core';\nimport {\n computeConfiguration,\n ConfigurationModel,\n ConfigurationStore,\n selectConfigurationEntities,\n selectConfigurationIds,\n upsertConfigurationEntities,\n upsertConfigurationEntity\n} from '../stores';\nimport { ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@Injectable({ providedIn: 'root' })\nexport class OtterConfigurationDevtools {\n\n /** Stream of configurations */\n public readonly configurationEntities$: Observable<CustomConfig[]>;\n\n constructor(\n protected store: Store<ConfigurationStore>,\n private readonly appRef: ApplicationRef,\n @Optional() @Inject(OTTER_CONFIGURATION_DEVTOOLS_OPTIONS) private readonly options: ConfigurationDevtoolsServiceOptions) {\n\n this.options = { ...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n /** Full configuration store */\n this.configurationEntities$ = this.store.pipe(\n select(selectConfigurationEntities),\n map((entities) =>\n Object.values(entities)\n .filter((entity): entity is ConfigurationModel => !!entity)\n .map((entity) => {\n const { id, ...configuration } = entity;\n const parsedConfigurationName = parseConfigurationName(id);\n const libraryName = parsedConfigurationName && parsedConfigurationName.library || this.options.defaultLibraryName;\n const name = parsedConfigurationName && parsedConfigurationName.componentName || id;\n return { name, config: configuration, library: libraryName } as CustomConfig;\n })\n .filter((conf): conf is CustomConfig => !!conf)\n ),\n shareReplay(1)\n );\n }\n\n /**\n * Get configuration name based on input information\n * @param selector Selector for a component configuration. It can be a string in the form library#componentName (i.e: @my-lib/shared-components#HeaderContComponent)\n * or an object with the component and library names (i.e: {library:\"@my-lib/shared-components\", componentName:'HeaderContComponent'})\n * @param isFallbackName Determine if the name requested is a fallback name\n * @returns string in the format library#componentName (i.e: \"@my-lib/shared-components#HeaderContComponent\")\n */\n public getComponentConfigName(selector: string | { library?: string; componentName: string }, isFallbackName = false) {\n if (!isFallbackName) {\n return typeof selector === 'string' ? selector : computeConfigurationName(selector.componentName, selector.library || this.options.defaultLibraryName);\n }\n\n return typeof selector === 'string' ? computeConfigurationName(selector, this.options.defaultLibraryName || 'global') :\n computeConfigurationName(selector.componentName, this.options.defaultLibraryName || 'global');\n }\n\n /**\n * Get the list of components which have a configuration loaded in the store\n */\n public getComponentsWithConfiguration(): Promise<string[]> {\n return firstValueFrom(\n this.store\n .pipe(\n select(selectConfigurationIds),\n map((ids) => ids\n .map((configName) => parseConfigurationName(configName.toString()))\n .filter((parsedName): parsedName is { library?: string; componentName: string } => !!parsedName)\n .map((parsedName) => parsedName.componentName + (parsedName.library ? ' from ' + parsedName.library : ''))\n )\n )\n );\n }\n\n /**\n * Set a specified value of a component configuration\n * @param selector Selector for a component configuration\n * @param configProperty Name of the configuration property to set\n * @param configValue Value of the configuration property to set\n */\n public setDynamicConfig(selector: string | { library?: string; componentName: string }, configProperty: string, configValue: any): void {\n this.store.dispatch(\n upsertConfigurationEntity({\n id: this.getComponentConfigName(selector),\n configuration: { [configProperty]: configValue }\n })\n );\n this.appRef.tick();\n }\n\n /**\n * Get the configuration for a specific component\n * @param selector Selector for a component configuration. It can be a string in the form library#configurationName (i.e: @my-lib/shared-components#HeaderPresConfig)\n * or an object with the configuration and library names (i.e: {library:\"@my-lib/shared-components\", componentName:'HeaderPresConfig'})\n */\n public getCurrentConfigurationFor(selector: string | { library?: string; componentName: string }): Promise<Configuration> {\n return firstValueFrom(\n this.store.pipe(\n select(selectConfigurationEntities),\n map((entities) => entities[this.getComponentConfigName(selector)] || entities[this.getComponentConfigName(selector, true)]),\n filter((entity): entity is ConfigurationModel => !!entity),\n map((entity) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { id, ...configuration } = entity;\n return configuration as Configuration;\n })\n )\n );\n }\n\n /**\n * Get the whole configuration of the application\n */\n public getConfiguration() {\n return firstValueFrom(this.configurationEntities$);\n }\n\n /**\n * Load a json configuration\n * @param configurations configurations to load\n */\n public loadConfiguration(configurations: string | CustomConfig<Configuration>[]): void {\n this.store.dispatch(upsertConfigurationEntities(computeConfiguration(typeof configurations === 'string' ? JSON.parse(configurations) : configurations)));\n this.appRef.tick();\n }\n}\n","/* eslint-disable no-console */\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport type { Configuration, ContextualizationDataset, CustomConfig, DevtoolsServiceInterface, WindowWithDevtools } from '@o3r/core';\nimport { firstValueFrom } from 'rxjs';\nimport { ConfigurationContextualizationDevtools, ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\nimport { OtterConfigurationDevtools } from './configuration-devtools.service';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationDevtoolsConsoleService implements DevtoolsServiceInterface, ConfigurationContextualizationDevtools {\n\n /** Name of the Window property to access to the devtools */\n public static readonly windowModuleName = 'configuration';\n\n constructor(\n private readonly configurationDevtools: OtterConfigurationDevtools,\n @Optional() @Inject(OTTER_CONFIGURATION_DEVTOOLS_OPTIONS) private readonly options: ConfigurationDevtoolsServiceOptions\n ) {\n this.options = { ...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n if (\n this.options.isActivatedOnBootstrap\n || (\n this.options.isActivatedOnBootstrapWhenCMSContext\n && (document.body.dataset as ContextualizationDataset).cmscontext === 'true'\n )\n ) {\n this.activate();\n }\n }\n\n private downloadJSON(content: string, fileName: string = this.options.defaultJsonFilename): void {\n const a = document.createElement('a');\n const file = new Blob([content], { type: 'text/plain' });\n a.href = URL.createObjectURL(file);\n a.download = fileName;\n a.click();\n }\n\n private copyElementToClipboard(content: string): void {\n const input = document.createElement('textarea');\n input.value = content;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n\n /**\n * Set a specified value of a component configuration\n * @param selector Selector for a component configuration\n * @param configProperty Name of the configuration property to set\n * @param configValue Value of the configuration property to set\n */\n public setDynamicConfig(selector: string | { library?: string; componentName: string }, configProperty: string, configValue: any): void {\n this.configurationDevtools.setDynamicConfig(selector, configProperty, configValue);\n }\n\n /** @inheritDoc */\n public activate() {\n const windowWithDevtools: WindowWithDevtools = window;\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_ ||= {};\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_[ConfigurationDevtoolsConsoleService.windowModuleName] = this;\n\n console.info(`Otter Configuration Devtools is now accessible via the _OTTER_DEVTOOLS_.${ConfigurationDevtoolsConsoleService.windowModuleName} variable`);\n }\n\n /**\n * Display the list of configurations loaded in the store and the library they originate from\n * @returns array with the configurations and libraries for example: [\"LibComponentsCommonRuntimeConfig from @my-lib/shared-common\"]\n */\n public async displayComponentsWithConfiguration() {\n const selectors = await this.configurationDevtools.getComponentsWithConfiguration();\n console.log(selectors);\n }\n\n /**\n * Display the configuration for a specific component\n * @param selector Selector for a component configuration. It can be a string in the form library#configurationName (i.e: '@my-lib/shared-components#HeaderContConfig')\n * or an object with the configuration and library names (i.e: {library:\"@my-lib/shared-components\", componentName:'HeaderContConfig'}).\n * Note the object input componentName expects a configuration name not a component name.\n * @returns Configuration object (i.e: {airlineLogoPath: \"img/airlines/icon-BH.svg\", displayLanguageSelector: false})\n */\n public async displayCurrentConfigurationFor(selector: string | { library?: string; componentName: string }) {\n const configuration = await this.configurationDevtools.getCurrentConfigurationFor(selector);\n console.log(configuration);\n }\n\n /**\n * Download the JSON file of the whole configuration\n * @param fileName Name of the file to download\n */\n public async saveConfiguration(fileName: string = this.options.defaultJsonFilename) {\n const configs = await firstValueFrom(this.configurationDevtools.configurationEntities$);\n this.downloadJSON(JSON.stringify(configs), fileName);\n }\n\n /**\n * Display the whole configuration of the application\n */\n public async displayConfiguration() {\n const configs = await this.configurationDevtools.getConfiguration();\n console.log(configs);\n }\n\n /**\n * Display a bookmark to generate the current configuration\n */\n public async displayConfigurationBookmark() {\n const content = await this.configurationDevtools.getConfiguration();\n\n console.log('BOOKMARK');\n console.log(`javascript:window._OTTER_DEVTOOLS_.updateConfigurations('${JSON.stringify(content).replace(/[']/g, '\\\\\\'')}')`);\n }\n\n /**\n * Copy the whole configuration to the clipboard\n */\n public async copyConfigurationToClipboard() {\n const configs = await firstValueFrom(this.configurationDevtools.configurationEntities$);\n this.copyElementToClipboard(JSON.stringify(configs));\n }\n\n /**\n * Load a json configuration\n * @param configurations configurations to load\n * @deprecated please use `updateConfigurations` instead, will be removed in Otter v12.\n */\n public loadConfiguration(configurations: string | CustomConfig<Configuration>[]): void {\n this.configurationDevtools.loadConfiguration(configurations);\n }\n\n /**\n * Replace N configurations in one shot\n * @param configurations array of configurations to update\n */\n public updateConfigurations(configurations: string | CustomConfig<Configuration>[]): void {\n this.configurationDevtools.loadConfiguration(configurations);\n }\n}\n","import { Inject, Injectable, OnDestroy, Optional } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { DevtoolsServiceInterface, filterMessageContent, sendOtterMessage } from '@o3r/core';\nimport { LoggerService } from '@o3r/logger';\nimport { firstValueFrom, fromEvent, Subscription } from 'rxjs';\nimport { ConfigurationStore, selectConfigurationEntities } from '../stores';\nimport { AvailableConfigurationMessageContents, ConfigurationDevtoolsServiceOptions, ConfigurationMessageDataTypes, isConfigurationMessage } from './configuration-devtools.interface';\nimport { OtterConfigurationDevtools } from './configuration-devtools.service';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationDevtoolsMessageService implements OnDestroy, DevtoolsServiceInterface {\n\n private readonly subscriptions = new Subscription();\n\n private readonly sendMessage = sendOtterMessage<AvailableConfigurationMessageContents>;\n\n constructor(\n private readonly store: Store<ConfigurationStore>,\n private readonly logger: LoggerService,\n private readonly configurationDevtools: OtterConfigurationDevtools,\n @Optional() @Inject(OTTER_CONFIGURATION_DEVTOOLS_OPTIONS) private readonly options: ConfigurationDevtoolsServiceOptions) {\n\n this.options = { ...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n private async sendCurrentConfigurationState() {\n const configurations = await firstValueFrom(this.store.pipe(\n select(selectConfigurationEntities)\n ));\n this.sendMessage('configurations', { configurations });\n }\n\n /**\n * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension\n * @param only restricted list of messages to re-send\n */\n private handleReEmitRequest(only?: ConfigurationMessageDataTypes[]) {\n if (!only || only.includes('configurations')) {\n return this.sendCurrentConfigurationState();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n * @param event Event coming from the Otter Chrome DevTools extension\n * @param message\n */\n private async handleEvents(message: AvailableConfigurationMessageContents) {\n this.logger.debug('Message handling by the configuration service', message);\n\n switch (message.dataType) {\n case 'connect': {\n await this.connectPlugin();\n break;\n }\n case 'requestMessages': {\n await this.handleReEmitRequest(message.only);\n break;\n }\n case 'updateConfig': {\n this.configurationDevtools.loadConfiguration([{\n name: message.id,\n config: message.configValue\n }]);\n break;\n }\n default: {\n this.logger.warn('Message ignored by the configuration service', message);\n }\n }\n }\n\n /**\n * Function to connect the plugin to the Otter DevTools extension\n */\n private connectPlugin() {\n this.logger.debug('Otter DevTools is plugged to configuration service of the application');\n return this.sendCurrentConfigurationState();\n }\n\n /** @inheritDoc */\n public activate() {\n this.subscriptions.add(\n fromEvent(window, 'message').pipe(filterMessageContent(isConfigurationMessage)).subscribe((e) => this.handleEvents(e))\n );\n\n this.subscriptions.add(\n this.store.pipe(select(selectConfigurationEntities))\n .subscribe((configurations) => {\n this.sendMessage('configurations', {\n configurations\n });\n })\n );\n }\n\n /** @inheritDoc */\n public ngOnDestroy() {\n this.subscriptions.unsubscribe();\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\nimport { ConfigurationStoreModule } from '../stores/index';\nimport type { ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\nimport { ConfigurationDevtoolsConsoleService } from './configuration-devtools.console.service';\nimport { ConfigurationDevtoolsMessageService } from './configuration-devtools.message.service';\nimport { OtterConfigurationDevtools } from './configuration-devtools.service';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@NgModule({\n imports: [\n StoreModule,\n ConfigurationStoreModule\n ],\n providers: [\n { provide: OTTER_CONFIGURATION_DEVTOOLS_OPTIONS, useValue: OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS },\n ConfigurationDevtoolsMessageService,\n ConfigurationDevtoolsConsoleService,\n OtterConfigurationDevtools\n ]\n})\nexport class ConfigurationDevtoolsModule {\n\n /**\n * Initialize Otter Devtools\n * @param options\n */\n public static instrument(options: Partial<ConfigurationDevtoolsServiceOptions>): ModuleWithProviders<ConfigurationDevtoolsModule> {\n return {\n ngModule: ConfigurationDevtoolsModule,\n providers: [\n { provide: OTTER_CONFIGURATION_DEVTOOLS_OPTIONS, useValue: {...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options}, multi: false },\n ConfigurationDevtoolsMessageService,\n ConfigurationDevtoolsConsoleService,\n OtterConfigurationDevtools\n ]\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { LoggerModule } from '@o3r/logger';\nimport { ConfigurationStoreModule } from '../../stores/index';\n\n@NgModule({\n imports: [ConfigurationStoreModule, LoggerModule]\n})\nexport class ConfigurationBaseServiceModule {}\n","import { Injectable } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { Configuration, CustomConfig, deepFill } from '@o3r/core';\nimport { combineLatest, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, take } from 'rxjs/operators';\nimport { ConfigOverrideStore, selectComponentOverrideConfig } from '../../stores/config-override/index';\nimport {\n computeConfiguration,\n ConfigurationStore,\n globalConfigurationId,\n selectConfigurationEntities,\n selectConfigurationForComponent,\n selectGlobalConfiguration,\n updateConfigurationEntity,\n upsertConfigurationEntities,\n upsertConfigurationEntity\n} from '../../stores/index';\nimport { ConfigurationBaseServiceModule } from './configuration.base.module';\n\nconst jsonStringifyDiff = (obj1: any, obj2: any) => JSON.stringify(obj1) === JSON.stringify(obj2);\n\n/**\n * Configuration service\n */\n@Injectable({\n providedIn: ConfigurationBaseServiceModule\n})\nexport class ConfigurationBaseService {\n\n private readonly extendedConfiguration: {[key: string]: boolean} = {};\n\n constructor(private readonly store: Store<ConfigurationStore & ConfigOverrideStore>) {\n }\n\n /**\n * Update a specific component config or add it to the store if does not exist\n * @param configuration to edit/add\n * @param configurationId Configuration ID\n */\n public upsertConfiguration<T extends Configuration>(configuration: T, configurationId = globalConfigurationId) {\n this.store.dispatch(upsertConfigurationEntity({id: configurationId, configuration}));\n }\n\n /**\n * Update a specific component config\n * @param configuration Partial config to edit\n * @param configurationId Configuration ID\n */\n public updateConfiguration<T extends Partial<Configuration>>(configuration: T, configurationId = globalConfigurationId) {\n this.store.dispatch(updateConfigurationEntity({id: configurationId, configuration}));\n }\n\n /**\n * This function will get the configuration stored in the data attribute of the html's body tag\n * @param configTagName Value used to identify the data attribute where the config is pushed in the index.html\n */\n public getConfigFromBodyTag<T extends Configuration>(configTagName = 'staticconfig') {\n const bootstrapConfigString = document.body.dataset[configTagName];\n const customConfigObject: CustomConfig<T>[] = bootstrapConfigString ? JSON.parse(bootstrapConfigString) : [];\n if (customConfigObject.length) {\n this.computeConfiguration(customConfigObject);\n }\n }\n\n /**\n * Transform the custom configuration in store configuration model\n * @param customConfigObject Configuration object (extracted from body tag for static config or downloaded in case of dynamic config)\n */\n public computeConfiguration<T extends Configuration>(customConfigObject: CustomConfig<T>[]) {\n this.store.dispatch(upsertConfigurationEntities(computeConfiguration(customConfigObject)));\n }\n\n /**\n * Complete a stored configuration by adding the missing fields\n * @param extension Configuration extension to be included in the store\n * @param configurationId Configuration ID to extend\n * @param forceUpdate Force update the configuration in the store\n */\n public extendConfiguration<T extends Configuration>(extension: T, configurationId = globalConfigurationId, forceUpdate = false) {\n if (this.extendedConfiguration[configurationId] && !forceUpdate) {\n return;\n }\n this.extendedConfiguration[configurationId] = true;\n this.store.pipe(\n select(selectConfigurationEntities),\n take(1),\n map((storedConfigs) => configurationId in storedConfigs ? deepFill(extension, storedConfigs[configurationId]) : extension)\n ).subscribe((extendedConfig) => this.upsertConfiguration(extendedConfig, configurationId));\n }\n\n /**\n * Operator to get the configuration from store for a given component and merge it with the global config\n * @param id Id of the component\n * @param defaultValue Default value of the configuration\n */\n public getComponentConfig<T extends Configuration>(id: string, defaultValue: T) {\n return (source: Observable<Partial<T> | undefined>): Observable <T> => {\n const componentConfigurationFromStore$ = this.getConfig(id) as Observable<T>;\n\n return source.pipe(\n switchMap((overrideConfig) => componentConfigurationFromStore$.pipe(\n map((componentConfigurationFromStore) => {\n const config = componentConfigurationFromStore ? deepFill(defaultValue, componentConfigurationFromStore) : defaultValue;\n return overrideConfig ? deepFill(config, overrideConfig) : config;\n })\n ))\n );\n };\n }\n\n /**\n * Get an observable of the configuration from store for a given component and merge it with the global config + the config overrides from the rules engine\n * @param id Id of the component\n */\n public getConfig(id: string): Observable<any> {\n const globalConfig$ = this.store.pipe(select(selectGlobalConfiguration));\n const componentConfig$ = id !== globalConfigurationId ? this.store.pipe(select(selectConfigurationForComponent({ id }))) : of({});\n const overrideConfig$ = this.store.pipe(select(selectComponentOverrideConfig(id)));\n\n return combineLatest([globalConfig$, componentConfig$, overrideConfig$]).pipe(\n map(([globalConfig, componentConfig, overrideConfig]) => ({ ...globalConfig, ...componentConfig, ...overrideConfig })),\n distinctUntilChanged(jsonStringifyDiff)\n );\n }\n}\n","import { Configuration, otterComponentInfoPropertyName } from '@o3r/core';\nimport { ConfigurationObserver } from './configuration.observer';\n\n/**\n * Decorator to identify the configuration observer\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function ConfigObserver() {\n return (target: any, key: string) => {\n const privateField = `_${key}`;\n\n if (delete target[key]) {\n Object.defineProperty(target, key, {\n get: function (this: any) {\n return this[privateField];\n },\n set: function (this: any, value: Record<string, unknown>) {\n this[privateField] = value;\n if (this[otterComponentInfoPropertyName]) {\n this[otterComponentInfoPropertyName].configId = (this[privateField] as ConfigurationObserver<Configuration>).configId;\n }\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n}\n","import { Configuration } from '@o3r/core';\nimport { BehaviorSubject, Observable, Observer } from 'rxjs';\nimport { shareReplay } from 'rxjs/operators';\nimport { getConfiguration } from '../core';\nimport { ConfigurationBaseService } from '../services/configuration/configuration.base.service';\n\nexport class ConfigurationObserver<T extends Configuration> implements Observer<Partial<T> | undefined> {\n\n /** Inner observable */\n private readonly observable: Observable<T>;\n\n /** Inner subscriber */\n private readonly subscriber: BehaviorSubject<Partial<T>> = new BehaviorSubject<Partial<T>>({});\n\n /** @inheritdoc */\n public closed?: boolean;\n\n constructor(\n /** Configuration ID */\n public configId: string,\n defaultConfig: T,\n configurationService?: ConfigurationBaseService\n ) {\n if (configurationService) {\n configurationService.extendConfiguration(defaultConfig, configId);\n }\n\n this.observable = this.subscriber\n .pipe(\n configurationService ? configurationService.getComponentConfig(configId, defaultConfig) : getConfiguration(defaultConfig),\n shareReplay(1)\n );\n }\n\n /** @inheritdoc */\n public next(value?: Partial<T>): void {\n this.subscriber.next(value || {});\n }\n\n /** @inheritdoc */\n public error(err: any): void {\n this.subscriber.error(err);\n this.closed = true;\n }\n\n /** @inheritdoc */\n public complete(): void {\n this.subscriber.complete();\n this.closed = true;\n }\n\n /** @see Subject.asObservable */\n public asObservable(): Observable<T> {\n return this.observable;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["actions.setConfigOverride","actions.setConfigurationEntities","actions.updateConfigurationEntities","actions.upsertConfigurationEntities","actions.clearConfigurationEntities","actions.updateConfigurationEntity","actions.upsertConfigurationEntity"],"mappings":";;;;;;;;;;;AAwBA;;;;;AAKG;AACa,SAAA,wBAAwB,CAAC,aAAqB,EAAE,WAAoB,EAAA;AAClF,IAAA,OAAO,qBAAqB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAC3D,CAAC;AAED;;;;AAIG;AACG,SAAU,sBAAsB,CAAC,iBAAyB,EAAA;IAC9D,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC3E,IAAI,uBAAuB,EAAE;QAC3B,OAAO;AACL,YAAA,OAAO,EAAE,uBAAuB,CAAC,MAAM,GAAG,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS;AACpF,YAAA,aAAa,EAAE,uBAAuB,CAAC,MAAM,GAAG,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC;SAC5G,CAAC;KACH;AACH,CAAC;AAED;;;AAGG;AACG,SAAU,gBAAgB,CAAoC,YAAe,EAAA;AACjF,IAAA,OAAO,CAAuB,MAAkC,KAC9D,MAAM,CAAC,IAAI,CACT,GAAG,CAAC,CAAC,cAAc,KAAI;AACrB,QAAA,OAAO,QAAQ,CA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AACb,QAAA,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC3B,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;KACpB;;IAGM,YAAY,GAAA;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC;KACxB;AACF;;ACvDD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"o3r-configuration.mjs","sources":["../../src/core/configuration.ts","../../src/devkit/configuration-devtools.interface.ts","../../src/stores/config-override/config-override.actions.ts","../../src/stores/config-override/config-override.reducer.ts","../../src/stores/config-override/config-override.state.ts","../../src/stores/config-override/config-override.module.ts","../../src/stores/config-override/config-override.selectors.ts","../../src/stores/config-override/config-override.sync.ts","../../src/stores/configuration/configuration.actions.ts","../../src/stores/configuration/configuration.helpers.ts","../../src/stores/configuration/configuration.reducer.ts","../../src/stores/configuration/configuration.state.ts","../../src/stores/configuration/configuration.module.ts","../../src/stores/configuration/configuration.selectors.ts","../../src/stores/configuration/configuration.sync.ts","../../src/devkit/configuration-devtools.token.ts","../../src/devkit/configuration-devtools.service.ts","../../src/devkit/configuration-devtools.console.service.ts","../../src/devkit/configuration-devtools.message.service.ts","../../src/devkit/configuration-devtools.module.ts","../../src/services/configuration/configuration.base.module.ts","../../src/services/configuration/configuration.base.service.ts","../../src/tools/configuration.decorators.ts","../../src/tools/configuration.observer.ts","../../src/tools/configuration.signal.ts","../../src/o3r-configuration.ts"],"sourcesContent":["import { computeItemIdentifier, deepFill } from '@o3r/core';\nimport { Observable } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs/operators';\n\n/**\n * Interface to define the error messages into component configuration\n */\nexport interface ErrorMessages {\n /**\n * Error message map\n */\n errorMessages: { [key: string]: string };\n}\n\n/**\n * Interface to specify that the component has an ID\n */\nexport interface Identifiable {\n /**\n * Identifier\n */\n id: string;\n}\n\n/**\n * Get the configuration name\n * @deprecated use {@link computeItemIdentifier} from @o3r/core. Will be removed in v12\n * @param componentName Name of the component to get the configuration\n * @param libraryName Name of the library the component is coming from\n */\nexport function computeConfigurationName(componentName: string, libraryName?: string) {\n return computeItemIdentifier(componentName, libraryName);\n}\n\n/**\n * Get the component and library's names based on the configuration name\n * @param configurationName Name of the component as found in the store\n * @returns Object containing library and component name.\n */\nexport function parseConfigurationName(configurationName: string): { library?: string; libraryName?: string; componentName: string } | undefined {\n const parsedConfigurationName = configurationName.match(/^([^#]*)#(.*)$/i);\n if (parsedConfigurationName) {\n return {\n library: parsedConfigurationName.length > 2 ? parsedConfigurationName[1] : undefined,\n componentName: parsedConfigurationName.length > 2 ? parsedConfigurationName[2] : parsedConfigurationName[0]\n };\n }\n}\n\n/**\n * Operator to get the configuration from store for a given component and merge it with the global config\n * @param defaultValue Default value of the configuration\n */\nexport function getConfiguration<T extends Record<string, unknown>>(defaultValue: T) {\n return <C extends Partial<T>>(source: Observable<C | undefined >): Observable<T> =>\n source.pipe(\n map((configOverride) => {\n return deepFill(defaultValue, configOverride);\n }),\n distinctUntilChanged((prev, current) => JSON.stringify(prev) === JSON.stringify(current)),\n shareReplay(1)\n );\n}\n","import type { Dictionary } from '@ngrx/entity';\nimport type {\n Configuration,\n ConnectContentMessage,\n ContextualizationDevtoolsCommonOptions,\n CustomConfig,\n DevtoolsCommonOptions,\n MessageDataTypes,\n OtterMessageContent,\n RequestMessagesContentMessage\n} from '@o3r/core';\nimport type { ConfigurationModel } from '../stores/index';\n\n/** Option for Configuration devtools service */\nexport interface ConfigurationDevtoolsServiceOptions extends DevtoolsCommonOptions, ContextualizationDevtoolsCommonOptions {\n /**\n * Default library name to use if not specified in the function call\n * @default `@o3r/components`\n */\n defaultLibraryName: string;\n /**\n * Default JSON file name if not specified in the function\n * @default partial-static-config.json\n */\n defaultJsonFilename: string;\n}\n\nexport interface ConfigurationsMessage extends OtterMessageContent<'configurations'> {\n /** Configurations */\n configurations: Dictionary<ConfigurationModel>;\n}\n\nexport interface UpdateConfigMessage extends OtterMessageContent<'updateConfig'> {\n /** Configuration ID */\n id: string;\n /** Configuration value */\n configValue: any;\n}\n\ntype ConfigurationMessageContents =\n | ConfigurationsMessage\n | UpdateConfigMessage;\n\n/** List of possible DataTypes for Configuration messages */\nexport type ConfigurationMessageDataTypes = MessageDataTypes<ConfigurationMessageContents>;\n\n/** List of all messages for configuration purpose */\nexport type AvailableConfigurationMessageContents =\n | ConfigurationMessageContents\n | ConnectContentMessage\n | RequestMessagesContentMessage<ConfigurationMessageDataTypes>;\n\n/**\n * Determine if the given message is a Configuration message\n * @param message message to check\n */\nexport const isConfigurationMessage = (message: any): message is AvailableConfigurationMessageContents => {\n return message && (\n message.dataType === 'configurations' ||\n message.dataType === 'updateConfig' ||\n message.dataType === 'requestMessages' ||\n message.dataType === 'connect');\n};\n\n/**\n * Contextualization devtools exposed for configuration in CMS integration\n */\nexport interface ConfigurationContextualizationDevtools {\n /**\n * Replace N configurations in one shot\n * @param configs array of configurations to update\n */\n updateConfigurations: (configurations: CustomConfig<Configuration>[]) => void;\n}\n","import { createAction, props } from '@ngrx/store';\nimport { SetStateActionPayload } from '@o3r/core';\nimport { ConfigOverrideState } from './config-override.state';\n\n/** Actions */\nconst ACTION_SET = '[ConfigOverride] set';\n\n/**\n * Clear all overrides and fill the store with the payload\n */\nexport const setConfigOverride = createAction(ACTION_SET, props<SetStateActionPayload<ConfigOverrideState>>());\n","import {ActionCreator, createReducer, on, ReducerTypes} from '@ngrx/store';\nimport * as actions from './config-override.actions';\nimport {ConfigOverrideState} from './config-override.state';\n\n/**\n * ConfigOverride Store initial value\n */\nexport const configOverrideInitialState: ConfigOverrideState = {configOverrides: {}};\n\n/**\n * List of basic actions for ConfigOverride Store\n */\nexport const configOverrideReducerFeatures: ReducerTypes<ConfigOverrideState, ActionCreator[]>[] = [\n on(actions.setConfigOverride, (_state, payload) => ({...payload.state}))\n];\n\n/**\n * ConfigOverride Store reducer\n */\nexport const configOverrideReducer = createReducer(\n configOverrideInitialState,\n ...configOverrideReducerFeatures\n);\n","/**\n * Property override model\n */\nexport interface PropertyOverride {\n [property: string]: any;\n}\n\n/**\n * ConfigOverride store state\n */\nexport interface ConfigOverrideState {\n /** Map of PropertyOverride indexed on component + config name */\n configOverrides: Record<string, PropertyOverride>;\n}\n\n/**\n * Name of the ConfigOverride Store\n */\nexport const CONFIG_OVERRIDE_STORE_NAME = 'configOverride';\n\n/**\n * ConfigOverride Store Interface\n */\nexport interface ConfigOverrideStore {\n /** ConfigOverride state */\n [CONFIG_OVERRIDE_STORE_NAME]: ConfigOverrideState;\n}\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { Action, ActionReducer, StoreModule } from '@ngrx/store';\n\nimport { configOverrideReducer } from './config-override.reducer';\nimport { CONFIG_OVERRIDE_STORE_NAME, ConfigOverrideState } from './config-override.state';\n\n/** Token of the ConfigOverride reducer */\nexport const CONFIG_OVERRIDE_REDUCER_TOKEN = new InjectionToken<ActionReducer<ConfigOverrideState, Action>>('Feature ConfigOverride Reducer');\n\n/** Provide default reducer for ConfigOverride store */\nexport function getDefaultConfigOverrideReducer() {\n return configOverrideReducer;\n}\n\n@NgModule({\n imports: [\n StoreModule.forFeature(CONFIG_OVERRIDE_STORE_NAME, CONFIG_OVERRIDE_REDUCER_TOKEN)\n ],\n providers: [\n { provide: CONFIG_OVERRIDE_REDUCER_TOKEN, useFactory: getDefaultConfigOverrideReducer }\n ]\n})\nexport class ConfigOverrideStoreModule {\n public static forRoot<T extends ConfigOverrideState>(reducerFactory: () => ActionReducer<T, Action>): ModuleWithProviders<ConfigOverrideStoreModule> {\n return {\n ngModule: ConfigOverrideStoreModule,\n providers: [\n { provide: CONFIG_OVERRIDE_REDUCER_TOKEN, useFactory: reducerFactory }\n ]\n };\n }\n}\n","import { createFeatureSelector, createSelector } from '@ngrx/store';\nimport { CONFIG_OVERRIDE_STORE_NAME, ConfigOverrideState } from './config-override.state';\n\n/** Select ConfigOverride State */\nexport const selectConfigOverrideState = createFeatureSelector<ConfigOverrideState>(CONFIG_OVERRIDE_STORE_NAME);\n\n/** Select the array of ConfigOverride */\nexport const selectConfigOverride = createSelector(selectConfigOverrideState, (state) => state?.configOverrides || {});\n\n/**\n * Get the override for given component identifier\n * @param componentId\n * @returns\n */\nexport const selectComponentOverrideConfig =\n (componentId: string) => createSelector(selectConfigOverride, (configOverrides) => configOverrides[componentId] || {});\n","import { Serializer } from '@o3r/core';\nimport { configOverrideInitialState } from './config-override.reducer';\nimport { ConfigOverrideState } from './config-override.state';\n\n/**\n * Deserializer\n * @param rawObject\n */\nexport const configOverrideStorageDeserializer = (rawObject: any) => {\n if (!rawObject) {\n return configOverrideInitialState;\n }\n return rawObject;\n};\n\nexport const configOverrideStorageSync: Serializer<ConfigOverrideState> = {\n deserialize: configOverrideStorageDeserializer\n};\n","import { createAction, props } from '@ngrx/store';\nimport { Configuration } from '@o3r/core';\n\nexport interface SetConfigurationEntitiesPayload {\n /** Map of configurations to update/insert, this is now Partial due the change of Configuration interface */\n entities: {[id: string]: Partial<Configuration>};\n}\n\nexport interface UpsertConfigurationEntityPayload {\n /** ID of the item */\n id: string;\n /** Updated/New configuration object */\n configuration: Partial<Configuration>;\n}\n\nexport interface UpdateConfigurationEntityPayload {\n /** ID of the item */\n id: string;\n /** Updated/New configuration partial object */\n configuration: Partial<Configuration>;\n}\n\n/** Entity Actions */\nconst ACTION_CLEAR_ENTITIES = '[Configuration] clear entities';\nconst ACTION_UPDATE_ENTITIES = '[Configuration] update entities';\nconst ACTION_UPSERT_ENTITIES = '[Configuration] upsert entities';\nconst ACTION_SET_ENTITIES = '[Configuration] set entities';\nconst ACTION_UPDATE_CONFIGURATION_ENTITY = '[Configuration] update configuration entity';\nconst ACTION_UPSERT_CONFIGURATION_ENTITY = '[Configuration] set configuration entity';\n\n/**\n * Upsert one configuration entity\n */\nexport const upsertConfigurationEntity = createAction(ACTION_UPSERT_CONFIGURATION_ENTITY, props<UpsertConfigurationEntityPayload>());\n\n/**\n * Update one configuration entity\n */\nexport const updateConfigurationEntity = createAction(ACTION_UPDATE_CONFIGURATION_ENTITY, props<UpdateConfigurationEntityPayload>());\n\n/**\n * Clear all configuration and fill the store with the payload\n */\nexport const setConfigurationEntities = createAction(ACTION_SET_ENTITIES, props<SetConfigurationEntitiesPayload>());\n\n/**\n * Update configuration with known IDs, ignore the new ones\n */\nexport const updateConfigurationEntities = createAction(ACTION_UPDATE_ENTITIES, props<SetConfigurationEntitiesPayload>());\n\n/**\n * Update configuration with known IDs, insert the new ones\n */\nexport const upsertConfigurationEntities = createAction(ACTION_UPSERT_ENTITIES, props<SetConfigurationEntitiesPayload>());\n\n/**\n * Clear only the entities, keeps the other attributes in the state\n */\nexport const clearConfigurationEntities = createAction(ACTION_CLEAR_ENTITIES);\n","import type { Configuration, CustomConfig } from '@o3r/core';\nimport { computeItemIdentifier } from '@o3r/core';\nimport { SetConfigurationEntitiesPayload } from './configuration.actions';\n\n/**\n * compute the configuration into SetEntitiesPayload\n * @param customConfigObject array of configurations\n */\nexport function computeConfiguration<T extends Configuration>(customConfigObject: CustomConfig<T>[]): SetConfigurationEntitiesPayload {\n const entities = customConfigObject.reduce<{[k: string]: Partial<T> & {id: string}}>((acc, conf) => {\n const id = computeItemIdentifier(conf.name, conf.library);\n acc[id] = {...conf.config, id};\n return acc;\n }, {});\n return {entities};\n}\n","import {createEntityAdapter, EntityAdapter} from '@ngrx/entity';\nimport {ActionCreator, createReducer, on, ReducerTypes} from '@ngrx/store';\nimport * as actions from './configuration.actions';\n\nimport {ConfigurationModel, ConfigurationState} from './configuration.state';\n\n/**\n * Configuration Store adapter\n */\nexport const configurationAdapter: EntityAdapter<ConfigurationModel> = createEntityAdapter<ConfigurationModel>({\n selectId: (model) => model.id\n});\n\n/**\n * Configuration Store initial value\n */\nexport const configurationInitialState: ConfigurationState = configurationAdapter.getInitialState({});\n\n/**\n * List of basic actions for Configuration Store\n */\nexport const configurationReducerFeatures: ReducerTypes<ConfigurationState, ActionCreator[]>[] = [\n\n on(actions.setConfigurationEntities, (state, payload) => configurationAdapter.addMany((Object.keys(payload) as (keyof typeof payload)[]).map((id) =>\n ({...(payload[id] as any), id})), configurationAdapter.removeAll(state))),\n\n on(actions.updateConfigurationEntities, (state, payload) =>\n configurationAdapter.updateMany(Object.keys(payload.entities).map((id) => ({id: id, changes: payload.entities[id]})), state)),\n\n on(actions.upsertConfigurationEntities, (state, payload) => configurationAdapter.upsertMany(Object.keys(payload.entities).map((id) => ({...payload.entities[id], id})), state)),\n\n on(actions.clearConfigurationEntities, (state) => configurationAdapter.removeAll(state)),\n\n on(actions.updateConfigurationEntity, (state, payload) => configurationAdapter.updateOne({id: payload.id, changes: payload.configuration}, state)),\n\n on(actions.upsertConfigurationEntity, (state, payload) => configurationAdapter.upsertOne({id: payload.id, ...payload.configuration}, state))\n];\n\n/**\n * Configuration Store reducer\n */\nexport const configurationReducer = createReducer(\n configurationInitialState,\n ...configurationReducerFeatures\n);\n","import type { EntityState } from '@ngrx/entity';\nimport type { Configuration } from '@o3r/core';\n\n/**\n * Configuration model\n */\nexport interface ConfigurationModel extends Configuration {\n id: string;\n}\n\n/**\n * Configuration store state\n */\nexport interface ConfigurationState extends EntityState<ConfigurationModel> {\n}\n\n/**\n * Name of the Configuration Store\n */\nexport const CONFIGURATION_STORE_NAME = 'configuration';\n\n/**\n * Configuration Store Interface\n */\nexport interface ConfigurationStore {\n /** Configuration state */\n [CONFIGURATION_STORE_NAME]: ConfigurationState;\n}\n\n/**\n * ID of the global configuration\n */\nexport const globalConfigurationId = 'global';\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { Action, ActionReducer, StoreModule } from '@ngrx/store';\nimport { configurationReducer } from './configuration.reducer';\nimport { CONFIGURATION_STORE_NAME, ConfigurationState } from './configuration.state';\n\n/** Token of the Configuration reducer */\nexport const CONFIGURATION_REDUCER_TOKEN = new InjectionToken<ActionReducer<ConfigurationState, Action>>('Feature Configuration Reducer');\n\n/** Provide default reducer for Configuration store */\nexport function getDefaultConfigurationReducer() {\n return configurationReducer;\n}\n\n@NgModule({\n imports: [\n StoreModule.forFeature(CONFIGURATION_STORE_NAME, CONFIGURATION_REDUCER_TOKEN)\n ],\n providers: [\n { provide: CONFIGURATION_REDUCER_TOKEN, useFactory: getDefaultConfigurationReducer }\n ]\n})\nexport class ConfigurationStoreModule {\n public static forRoot<T extends ConfigurationState>(reducerFactory: () => ActionReducer<T, Action>): ModuleWithProviders<ConfigurationStoreModule> {\n return {\n ngModule: ConfigurationStoreModule,\n providers: [\n { provide: CONFIGURATION_REDUCER_TOKEN, useFactory: reducerFactory }\n ]\n };\n }\n}\n","import { createSelector } from '@ngrx/store';\nimport { Configuration } from '@o3r/core';\nimport { configurationAdapter } from './configuration.reducer';\nimport { CONFIGURATION_STORE_NAME, ConfigurationState, globalConfigurationId } from './configuration.state';\n\nconst {selectIds, selectEntities, selectAll, selectTotal} = configurationAdapter.getSelectors();\n\n/**\n * Select Configuration State\n * Note: the usage of createSelector is to avoid warning printing because of potentially undefined feature store\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const selectConfigurationState = createSelector<{[CONFIGURATION_STORE_NAME]: ConfigurationState }, [state: ConfigurationState | undefined], ConfigurationState | undefined>(\n (state) => state[CONFIGURATION_STORE_NAME],\n (state) => state\n);\n\n/** Select the array of Configuration ids */\nexport const selectConfigurationIds = createSelector(selectConfigurationState, (state) => state ? selectIds(state) : []);\n\n/** Select the array of Configuration */\nexport const selectAllConfiguration = createSelector(selectConfigurationState, (state) => state ? selectAll(state) : []);\n\n/** Select the dictionary of Configuration entities */\nexport const selectConfigurationEntities = createSelector(selectConfigurationState, (state) => state ? selectEntities(state) : {});\n\n/** Select the total Configuration count */\nexport const selectConfigurationTotal = createSelector(selectConfigurationState, (state) => state ? selectTotal(state) : 0);\n\n/**\n * Select the configuration for component with id\n * @param props property of the selector\n * @param props.id id of the component\n */\nexport const selectConfigurationForComponent = <T extends Configuration>(props: {id: string}) =>\n createSelector(selectConfigurationEntities, (entities) => (entities?.[props.id] || {}) as Configuration as T);\n\n/**\n * Select the global configuration\n */\nexport const selectGlobalConfiguration = createSelector(selectConfigurationForComponent({ id: globalConfigurationId }), (config) => config);\n","import {configurationAdapter, configurationInitialState} from './configuration.reducer';\nimport {ConfigurationState} from './configuration.state';\n\nexport const configurationStorageSync = {\n deserialize: (rawObject: any) => {\n if (!rawObject || !rawObject.ids) {\n return configurationInitialState;\n }\n const storeObject = configurationAdapter.getInitialState<ConfigurationState>(rawObject);\n return storeObject as ConfigurationState;\n }\n};\n","import { InjectionToken } from '@angular/core';\nimport { ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\n\nexport const OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS: ConfigurationDevtoolsServiceOptions = {\n defaultLibraryName: '@o3r/components',\n defaultJsonFilename: 'partial-static-config.json',\n isActivatedOnBootstrap: false,\n isActivatedOnBootstrapWhenCMSContext: true\n};\n\n// eslint-disable-next-line max-len\nexport const OTTER_CONFIGURATION_DEVTOOLS_OPTIONS: InjectionToken<ConfigurationDevtoolsServiceOptions> = new InjectionToken<ConfigurationDevtoolsServiceOptions>('Otter Configuration Devtools options');\n","import { ApplicationRef, Inject, Injectable, Optional } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { Configuration, CustomConfig } from '@o3r/core';\nimport { firstValueFrom, Observable } from 'rxjs';\nimport { filter, map, shareReplay } from 'rxjs/operators';\nimport { computeConfigurationName, parseConfigurationName } from '../core';\nimport {\n computeConfiguration,\n ConfigurationModel,\n ConfigurationStore,\n selectConfigurationEntities,\n selectConfigurationIds,\n upsertConfigurationEntities,\n upsertConfigurationEntity\n} from '../stores';\nimport { ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@Injectable({ providedIn: 'root' })\nexport class OtterConfigurationDevtools {\n\n /** Stream of configurations */\n public readonly configurationEntities$: Observable<CustomConfig[]>;\n\n constructor(\n protected store: Store<ConfigurationStore>,\n private readonly appRef: ApplicationRef,\n @Optional() @Inject(OTTER_CONFIGURATION_DEVTOOLS_OPTIONS) private readonly options: ConfigurationDevtoolsServiceOptions) {\n\n this.options = { ...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n /** Full configuration store */\n this.configurationEntities$ = this.store.pipe(\n select(selectConfigurationEntities),\n map((entities) =>\n Object.values(entities)\n .filter((entity): entity is ConfigurationModel => !!entity)\n .map((entity) => {\n const { id, ...configuration } = entity;\n const parsedConfigurationName = parseConfigurationName(id);\n const libraryName = parsedConfigurationName && parsedConfigurationName.library || this.options.defaultLibraryName;\n const name = parsedConfigurationName && parsedConfigurationName.componentName || id;\n return { name, config: configuration, library: libraryName } as CustomConfig;\n })\n .filter((conf): conf is CustomConfig => !!conf)\n ),\n shareReplay(1)\n );\n }\n\n /**\n * Get configuration name based on input information\n * @param selector Selector for a component configuration. It can be a string in the form library#componentName (i.e: @my-lib/shared-components#HeaderContComponent)\n * or an object with the component and library names (i.e: {library:\"@my-lib/shared-components\", componentName:'HeaderContComponent'})\n * @param isFallbackName Determine if the name requested is a fallback name\n * @returns string in the format library#componentName (i.e: \"@my-lib/shared-components#HeaderContComponent\")\n */\n public getComponentConfigName(selector: string | { library?: string; componentName: string }, isFallbackName = false) {\n if (!isFallbackName) {\n return typeof selector === 'string' ? selector : computeConfigurationName(selector.componentName, selector.library || this.options.defaultLibraryName);\n }\n\n return typeof selector === 'string' ? computeConfigurationName(selector, this.options.defaultLibraryName || 'global') :\n computeConfigurationName(selector.componentName, this.options.defaultLibraryName || 'global');\n }\n\n /**\n * Get the list of components which have a configuration loaded in the store\n */\n public getComponentsWithConfiguration(): Promise<string[]> {\n return firstValueFrom(\n this.store\n .pipe(\n select(selectConfigurationIds),\n map((ids) => ids\n .map((configName) => parseConfigurationName(configName.toString()))\n .filter((parsedName): parsedName is { library?: string; componentName: string } => !!parsedName)\n .map((parsedName) => parsedName.componentName + (parsedName.library ? ' from ' + parsedName.library : ''))\n )\n )\n );\n }\n\n /**\n * Set a specified value of a component configuration\n * @param selector Selector for a component configuration\n * @param configProperty Name of the configuration property to set\n * @param configValue Value of the configuration property to set\n */\n public setDynamicConfig(selector: string | { library?: string; componentName: string }, configProperty: string, configValue: any): void {\n this.store.dispatch(\n upsertConfigurationEntity({\n id: this.getComponentConfigName(selector),\n configuration: { [configProperty]: configValue }\n })\n );\n this.appRef.tick();\n }\n\n /**\n * Get the configuration for a specific component\n * @param selector Selector for a component configuration. It can be a string in the form library#configurationName (i.e: @my-lib/shared-components#HeaderPresConfig)\n * or an object with the configuration and library names (i.e: {library:\"@my-lib/shared-components\", componentName:'HeaderPresConfig'})\n */\n public getCurrentConfigurationFor(selector: string | { library?: string; componentName: string }): Promise<Configuration> {\n return firstValueFrom(\n this.store.pipe(\n select(selectConfigurationEntities),\n map((entities) => entities[this.getComponentConfigName(selector)] || entities[this.getComponentConfigName(selector, true)]),\n filter((entity): entity is ConfigurationModel => !!entity),\n map((entity) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { id, ...configuration } = entity;\n return configuration as Configuration;\n })\n )\n );\n }\n\n /**\n * Get the whole configuration of the application\n */\n public getConfiguration() {\n return firstValueFrom(this.configurationEntities$);\n }\n\n /**\n * Load a json configuration\n * @param configurations configurations to load\n */\n public loadConfiguration(configurations: string | CustomConfig<Configuration>[]): void {\n this.store.dispatch(upsertConfigurationEntities(computeConfiguration(typeof configurations === 'string' ? JSON.parse(configurations) : configurations)));\n this.appRef.tick();\n }\n}\n","/* eslint-disable no-console */\nimport { Inject, Injectable, Optional } from '@angular/core';\nimport type { Configuration, ContextualizationDataset, CustomConfig, DevtoolsServiceInterface, WindowWithDevtools } from '@o3r/core';\nimport { firstValueFrom } from 'rxjs';\nimport { ConfigurationContextualizationDevtools, ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\nimport { OtterConfigurationDevtools } from './configuration-devtools.service';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationDevtoolsConsoleService implements DevtoolsServiceInterface, ConfigurationContextualizationDevtools {\n\n /** Name of the Window property to access to the devtools */\n public static readonly windowModuleName = 'configuration';\n\n constructor(\n private readonly configurationDevtools: OtterConfigurationDevtools,\n @Optional() @Inject(OTTER_CONFIGURATION_DEVTOOLS_OPTIONS) private readonly options: ConfigurationDevtoolsServiceOptions\n ) {\n this.options = { ...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n if (\n this.options.isActivatedOnBootstrap\n || (\n this.options.isActivatedOnBootstrapWhenCMSContext\n && (document.body.dataset as ContextualizationDataset).cmscontext === 'true'\n )\n ) {\n this.activate();\n }\n }\n\n private downloadJSON(content: string, fileName: string = this.options.defaultJsonFilename): void {\n const a = document.createElement('a');\n const file = new Blob([content], { type: 'text/plain' });\n a.href = URL.createObjectURL(file);\n a.download = fileName;\n a.click();\n }\n\n private copyElementToClipboard(content: string): void {\n const input = document.createElement('textarea');\n input.value = content;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n\n /**\n * Set a specified value of a component configuration\n * @param selector Selector for a component configuration\n * @param configProperty Name of the configuration property to set\n * @param configValue Value of the configuration property to set\n */\n public setDynamicConfig(selector: string | { library?: string; componentName: string }, configProperty: string, configValue: any): void {\n this.configurationDevtools.setDynamicConfig(selector, configProperty, configValue);\n }\n\n /** @inheritDoc */\n public activate() {\n const windowWithDevtools: WindowWithDevtools = window;\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_ ||= {};\n // eslint-disable-next-line no-underscore-dangle\n windowWithDevtools._OTTER_DEVTOOLS_[ConfigurationDevtoolsConsoleService.windowModuleName] = this;\n\n console.info(`Otter Configuration Devtools is now accessible via the _OTTER_DEVTOOLS_.${ConfigurationDevtoolsConsoleService.windowModuleName} variable`);\n }\n\n /**\n * Display the list of configurations loaded in the store and the library they originate from\n * @returns array with the configurations and libraries for example: [\"LibComponentsCommonRuntimeConfig from @my-lib/shared-common\"]\n */\n public async displayComponentsWithConfiguration() {\n const selectors = await this.configurationDevtools.getComponentsWithConfiguration();\n console.log(selectors);\n }\n\n /**\n * Display the configuration for a specific component\n * @param selector Selector for a component configuration. It can be a string in the form library#configurationName (i.e: '@my-lib/shared-components#HeaderContConfig')\n * or an object with the configuration and library names (i.e: {library:\"@my-lib/shared-components\", componentName:'HeaderContConfig'}).\n * Note the object input componentName expects a configuration name not a component name.\n * @returns Configuration object (i.e: {airlineLogoPath: \"img/airlines/icon-BH.svg\", displayLanguageSelector: false})\n */\n public async displayCurrentConfigurationFor(selector: string | { library?: string; componentName: string }) {\n const configuration = await this.configurationDevtools.getCurrentConfigurationFor(selector);\n console.log(configuration);\n }\n\n /**\n * Download the JSON file of the whole configuration\n * @param fileName Name of the file to download\n */\n public async saveConfiguration(fileName: string = this.options.defaultJsonFilename) {\n const configs = await firstValueFrom(this.configurationDevtools.configurationEntities$);\n this.downloadJSON(JSON.stringify(configs), fileName);\n }\n\n /**\n * Display the whole configuration of the application\n */\n public async displayConfiguration() {\n const configs = await this.configurationDevtools.getConfiguration();\n console.log(configs);\n }\n\n /**\n * Display a bookmark to generate the current configuration\n */\n public async displayConfigurationBookmark() {\n const content = await this.configurationDevtools.getConfiguration();\n\n console.log('BOOKMARK');\n console.log(`javascript:window._OTTER_DEVTOOLS_.updateConfigurations('${JSON.stringify(content).replace(/[']/g, '\\\\\\'')}')`);\n }\n\n /**\n * Copy the whole configuration to the clipboard\n */\n public async copyConfigurationToClipboard() {\n const configs = await firstValueFrom(this.configurationDevtools.configurationEntities$);\n this.copyElementToClipboard(JSON.stringify(configs));\n }\n\n /**\n * Load a json configuration\n * @param configurations configurations to load\n * @deprecated please use `updateConfigurations` instead, will be removed in Otter v12.\n */\n public loadConfiguration(configurations: string | CustomConfig<Configuration>[]): void {\n this.configurationDevtools.loadConfiguration(configurations);\n }\n\n /**\n * Replace N configurations in one shot\n * @param configurations array of configurations to update\n */\n public updateConfigurations(configurations: string | CustomConfig<Configuration>[]): void {\n this.configurationDevtools.loadConfiguration(configurations);\n }\n}\n","import { Inject, Injectable, OnDestroy, Optional } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { DevtoolsServiceInterface, filterMessageContent, sendOtterMessage } from '@o3r/core';\nimport { LoggerService } from '@o3r/logger';\nimport { firstValueFrom, fromEvent, Subscription } from 'rxjs';\nimport { ConfigurationStore, selectConfigurationEntities } from '../stores';\nimport { AvailableConfigurationMessageContents, ConfigurationDevtoolsServiceOptions, ConfigurationMessageDataTypes, isConfigurationMessage } from './configuration-devtools.interface';\nimport { OtterConfigurationDevtools } from './configuration-devtools.service';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ConfigurationDevtoolsMessageService implements OnDestroy, DevtoolsServiceInterface {\n\n private readonly subscriptions = new Subscription();\n\n private readonly sendMessage = sendOtterMessage<AvailableConfigurationMessageContents>;\n\n constructor(\n private readonly store: Store<ConfigurationStore>,\n private readonly logger: LoggerService,\n private readonly configurationDevtools: OtterConfigurationDevtools,\n @Optional() @Inject(OTTER_CONFIGURATION_DEVTOOLS_OPTIONS) private readonly options: ConfigurationDevtoolsServiceOptions) {\n\n this.options = { ...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n if (this.options.isActivatedOnBootstrap) {\n this.activate();\n }\n }\n\n private async sendCurrentConfigurationState() {\n const configurations = await firstValueFrom(this.store.pipe(\n select(selectConfigurationEntities)\n ));\n this.sendMessage('configurations', { configurations });\n }\n\n /**\n * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension\n * @param only restricted list of messages to re-send\n */\n private handleReEmitRequest(only?: ConfigurationMessageDataTypes[]) {\n if (!only || only.includes('configurations')) {\n return this.sendCurrentConfigurationState();\n }\n }\n\n /**\n * Function to handle the incoming messages from Otter Chrome DevTools extension\n * @param event Event coming from the Otter Chrome DevTools extension\n * @param message\n */\n private async handleEvents(message: AvailableConfigurationMessageContents) {\n this.logger.debug('Message handling by the configuration service', message);\n\n switch (message.dataType) {\n case 'connect': {\n await this.connectPlugin();\n break;\n }\n case 'requestMessages': {\n await this.handleReEmitRequest(message.only);\n break;\n }\n case 'updateConfig': {\n this.configurationDevtools.loadConfiguration([{\n name: message.id,\n config: message.configValue\n }]);\n break;\n }\n default: {\n this.logger.warn('Message ignored by the configuration service', message);\n }\n }\n }\n\n /**\n * Function to connect the plugin to the Otter DevTools extension\n */\n private connectPlugin() {\n this.logger.debug('Otter DevTools is plugged to configuration service of the application');\n return this.sendCurrentConfigurationState();\n }\n\n /** @inheritDoc */\n public activate() {\n this.subscriptions.add(\n fromEvent(window, 'message').pipe(filterMessageContent(isConfigurationMessage)).subscribe((e) => this.handleEvents(e))\n );\n\n this.subscriptions.add(\n this.store.pipe(select(selectConfigurationEntities))\n .subscribe((configurations) => {\n this.sendMessage('configurations', {\n configurations\n });\n })\n );\n }\n\n /** @inheritDoc */\n public ngOnDestroy() {\n this.subscriptions.unsubscribe();\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { StoreModule } from '@ngrx/store';\nimport { ConfigurationStoreModule } from '../stores/index';\nimport type { ConfigurationDevtoolsServiceOptions } from './configuration-devtools.interface';\nimport { ConfigurationDevtoolsConsoleService } from './configuration-devtools.console.service';\nimport { ConfigurationDevtoolsMessageService } from './configuration-devtools.message.service';\nimport { OtterConfigurationDevtools } from './configuration-devtools.service';\nimport { OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, OTTER_CONFIGURATION_DEVTOOLS_OPTIONS } from './configuration-devtools.token';\n\n@NgModule({\n imports: [\n StoreModule,\n ConfigurationStoreModule\n ],\n providers: [\n { provide: OTTER_CONFIGURATION_DEVTOOLS_OPTIONS, useValue: OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS },\n ConfigurationDevtoolsMessageService,\n ConfigurationDevtoolsConsoleService,\n OtterConfigurationDevtools\n ]\n})\nexport class ConfigurationDevtoolsModule {\n\n /**\n * Initialize Otter Devtools\n * @param options\n */\n public static instrument(options: Partial<ConfigurationDevtoolsServiceOptions>): ModuleWithProviders<ConfigurationDevtoolsModule> {\n return {\n ngModule: ConfigurationDevtoolsModule,\n providers: [\n { provide: OTTER_CONFIGURATION_DEVTOOLS_OPTIONS, useValue: {...OTTER_CONFIGURATION_DEVTOOLS_DEFAULT_OPTIONS, ...options}, multi: false },\n ConfigurationDevtoolsMessageService,\n ConfigurationDevtoolsConsoleService,\n OtterConfigurationDevtools\n ]\n };\n }\n}\n","import { NgModule } from '@angular/core';\nimport { LoggerModule } from '@o3r/logger';\nimport { ConfigurationStoreModule } from '../../stores/index';\n\n@NgModule({\n imports: [ConfigurationStoreModule, LoggerModule]\n})\nexport class ConfigurationBaseServiceModule {}\n","import { Injectable } from '@angular/core';\nimport { select, Store } from '@ngrx/store';\nimport { Configuration, CustomConfig, deepFill } from '@o3r/core';\nimport { combineLatest, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, take } from 'rxjs/operators';\nimport { ConfigOverrideStore, selectComponentOverrideConfig } from '../../stores/config-override/index';\nimport {\n computeConfiguration,\n ConfigurationStore,\n globalConfigurationId,\n selectConfigurationEntities,\n selectConfigurationForComponent,\n selectGlobalConfiguration,\n updateConfigurationEntity,\n upsertConfigurationEntities,\n upsertConfigurationEntity\n} from '../../stores/index';\nimport { ConfigurationBaseServiceModule } from './configuration.base.module';\n\nconst jsonStringifyDiff = (obj1: any, obj2: any) => JSON.stringify(obj1) === JSON.stringify(obj2);\n\n/**\n * Configuration service\n */\n@Injectable({\n providedIn: ConfigurationBaseServiceModule\n})\nexport class ConfigurationBaseService {\n\n private readonly extendedConfiguration: {[key: string]: boolean} = {};\n\n constructor(private readonly store: Store<ConfigurationStore & ConfigOverrideStore>) {\n }\n\n /**\n * Update a specific component config or add it to the store if does not exist\n * @param configuration to edit/add\n * @param configurationId Configuration ID\n */\n public upsertConfiguration<T extends Configuration>(configuration: T, configurationId = globalConfigurationId) {\n this.store.dispatch(upsertConfigurationEntity({id: configurationId, configuration}));\n }\n\n /**\n * Update a specific component config\n * @param configuration Partial config to edit\n * @param configurationId Configuration ID\n */\n public updateConfiguration<T extends Partial<Configuration>>(configuration: T, configurationId = globalConfigurationId) {\n this.store.dispatch(updateConfigurationEntity({id: configurationId, configuration}));\n }\n\n /**\n * This function will get the configuration stored in the data attribute of the html's body tag\n * @param configTagName Value used to identify the data attribute where the config is pushed in the index.html\n */\n public getConfigFromBodyTag<T extends Configuration>(configTagName = 'staticconfig') {\n const bootstrapConfigString = document.body.dataset[configTagName];\n const customConfigObject: CustomConfig<T>[] = bootstrapConfigString ? JSON.parse(bootstrapConfigString) : [];\n if (customConfigObject.length) {\n this.computeConfiguration(customConfigObject);\n }\n }\n\n /**\n * Transform the custom configuration in store configuration model\n * @param customConfigObject Configuration object (extracted from body tag for static config or downloaded in case of dynamic config)\n */\n public computeConfiguration<T extends Configuration>(customConfigObject: CustomConfig<T>[]) {\n this.store.dispatch(upsertConfigurationEntities(computeConfiguration(customConfigObject)));\n }\n\n /**\n * Complete a stored configuration by adding the missing fields\n * @param extension Configuration extension to be included in the store\n * @param configurationId Configuration ID to extend\n * @param forceUpdate Force update the configuration in the store\n */\n public extendConfiguration<T extends Configuration>(extension: T, configurationId = globalConfigurationId, forceUpdate = false) {\n if (this.extendedConfiguration[configurationId] && !forceUpdate) {\n return;\n }\n this.extendedConfiguration[configurationId] = true;\n this.store.pipe(\n select(selectConfigurationEntities),\n take(1),\n map((storedConfigs) => configurationId in storedConfigs ? deepFill(extension, storedConfigs[configurationId]) : extension)\n ).subscribe((extendedConfig) => this.upsertConfiguration(extendedConfig, configurationId));\n }\n\n /**\n * Operator to get the configuration from store for a given component and merge it with the global config\n * @param id Id of the component\n * @param defaultValue Default value of the configuration\n */\n public getComponentConfig<T extends Configuration>(id: string, defaultValue: T) {\n return (source: Observable<Partial<T> | undefined>): Observable <T> => {\n const componentConfigurationFromStore$ = this.getConfig(id) as Observable<T>;\n\n return source.pipe(\n switchMap((overrideConfig) => componentConfigurationFromStore$.pipe(\n map((componentConfigurationFromStore) => {\n const config = componentConfigurationFromStore ? deepFill(defaultValue, componentConfigurationFromStore) : defaultValue;\n return overrideConfig ? deepFill(config, overrideConfig) : config;\n })\n ))\n );\n };\n }\n\n /**\n * Get an observable of the configuration from store for a given component and merge it with the global config + the config overrides from the rules engine\n * @param id Id of the component\n */\n public getConfig(id: string): Observable<any> {\n const globalConfig$ = this.store.pipe(select(selectGlobalConfiguration));\n const componentConfig$ = id !== globalConfigurationId ? this.store.pipe(select(selectConfigurationForComponent({ id }))) : of({});\n const overrideConfig$ = this.store.pipe(select(selectComponentOverrideConfig(id)));\n\n return combineLatest([globalConfig$, componentConfig$, overrideConfig$]).pipe(\n map(([globalConfig, componentConfig, overrideConfig]) => ({ ...globalConfig, ...componentConfig, ...overrideConfig })),\n distinctUntilChanged(jsonStringifyDiff)\n );\n }\n}\n","import { Configuration, otterComponentInfoPropertyName } from '@o3r/core';\nimport { ConfigurationObserver } from './configuration.observer';\nimport type { ConfigurationSignal } from './configuration.signal';\n\nconst decorator = (target: any, key: string) => {\n const privateField = `_${key}`;\n\n if (delete target[key]) {\n Object.defineProperty(target, key, {\n get: function (this: any) {\n return this[privateField];\n },\n set: function (this: any, value: ConfigurationObserver<Configuration> | ConfigurationSignal<Configuration>) {\n this[privateField] = value;\n if (this[otterComponentInfoPropertyName]) {\n this[otterComponentInfoPropertyName].configId = this[privateField].configId;\n }\n },\n enumerable: true,\n configurable: true\n });\n }\n};\n\n/**\n * Decorator to identify the configuration observer\n * @deprecated please use O3rConfig, will be removed in v12\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function ConfigObserver() {\n return decorator;\n}\n\n/**\n * Decorator to identify the component's configuration\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function O3rConfig() {\n return decorator;\n}\n","import { Configuration } from '@o3r/core';\nimport { BehaviorSubject, Observable, Observer } from 'rxjs';\nimport { shareReplay } from 'rxjs/operators';\nimport { getConfiguration } from '../core';\nimport { ConfigurationBaseService } from '../services/configuration/configuration.base.service';\n\nexport class ConfigurationObserver<T extends Configuration> implements Observer<Partial<T> | undefined> {\n\n /** Inner observable */\n private readonly observable: Observable<T>;\n\n /** Inner subscriber */\n private readonly subscriber: BehaviorSubject<Partial<T>> = new BehaviorSubject<Partial<T>>({});\n\n /** @inheritdoc */\n public closed?: boolean;\n\n constructor(\n /** Configuration ID */\n public configId: string,\n defaultConfig: T,\n configurationService?: ConfigurationBaseService\n ) {\n if (configurationService) {\n configurationService.extendConfiguration(defaultConfig, configId);\n }\n\n this.observable = this.subscriber\n .pipe(\n configurationService ? configurationService.getComponentConfig(configId, defaultConfig) : getConfiguration(defaultConfig),\n shareReplay(1)\n );\n }\n\n /** @inheritdoc */\n public next(value?: Partial<T>): void {\n this.subscriber.next(value || {});\n }\n\n /** @inheritdoc */\n public error(err: any): void {\n this.subscriber.error(err);\n this.closed = true;\n }\n\n /** @inheritdoc */\n public complete(): void {\n this.subscriber.complete();\n this.closed = true;\n }\n\n /** @see Subject.asObservable */\n public asObservable(): Observable<T> {\n return this.observable;\n }\n}\n","import type { InputSignal, Signal } from '@angular/core';\nimport { toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport type { Configuration } from '@o3r/core';\nimport { shareReplay } from 'rxjs';\nimport { getConfiguration } from '../core';\nimport type { ConfigurationBaseService } from '../services';\n\n/** Configuration signal */\nexport type ConfigurationSignal<T> = Signal<T> & { configId: string };\n\n/**\n * Get a configuration signal\n * @param configInput\n * @param configId\n * @param defaultConfig\n * @param configurationService\n */\nexport const configSignal = <T extends Configuration>(\n configInput: InputSignal<Partial<T> | undefined>,\n configId: string,\n defaultConfig: T,\n configurationService?: ConfigurationBaseService | null\n): ConfigurationSignal<T> => {\n if (configurationService) {\n configurationService.extendConfiguration(defaultConfig, configId);\n }\n\n const signal: ConfigurationSignal<T> = toSignal(\n toObservable(configInput).pipe(\n configurationService ? configurationService.getComponentConfig(configId, defaultConfig) : getConfiguration(defaultConfig),\n shareReplay({ bufferSize: 1, refCount: true })\n ),\n { initialValue: defaultConfig }\n ) as ConfigurationSignal<T>;\n signal.configId = configId;\n return signal;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["actions.setConfigOverride","actions.setConfigurationEntities","actions.updateConfigurationEntities","actions.upsertConfigurationEntities","actions.clearConfigurationEntities","actions.updateConfigurationEntity","actions.upsertConfigurationEntity","shareReplay"],"mappings":";;;;;;;;;;;;AAwBA;;;;;AAKG;AACa,SAAA,wBAAwB,CAAC,aAAqB,EAAE,WAAoB,EAAA;AAClF,IAAA,OAAO,qBAAqB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAC3D,CAAC;AAED;;;;AAIG;AACG,SAAU,sBAAsB,CAAC,iBAAyB,EAAA;IAC9D,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC3E,IAAI,uBAAuB,EAAE;QAC3B,OAAO;AACL,YAAA,OAAO,EAAE,uBAAuB,CAAC,MAAM,GAAG,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS;AACpF,YAAA,aAAa,EAAE,uBAAuB,CAAC,MAAM,GAAG,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAAC;SAC5G,CAAC;KACH;AACH,CAAC;AAED;;;AAGG;AACG,SAAU,gBAAgB,CAAoC,YAAe,EAAA;AACjF,IAAA,OAAO,CAAuB,MAAkC,KAC9D,MAAM,CAAC,IAAI,CACT,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AAK,CAAC,GAAQ,EAAA;AACnB,QAAA,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3B,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;KACpB;;IAGM,QAAQ,GAAA;AACb,QAAA,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC3B,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;KACpB;;IAGM,YAAY,GAAA;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC;KACxB;AACF;;AC7CD;;;;;;AAMG;AACI,MAAM,YAAY,GAAG,CAC1B,WAAgD,EAChD,QAAgB,EAChB,aAAgB,EAChB,oBAAsD,KAC5B;IAC1B,IAAI,oBAAoB,EAAE;AACxB,QAAA,oBAAoB,CAAC,mBAAmB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;KACnE;IAED,MAAM,MAAM,GAA2B,QAAQ,CAC7C,YAAY,CAAC,WAAW,CAAC,CAAC,IAAI,CAC5B,oBAAoB,GAAG,oBAAoB,CAAC,kBAAkB,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,gBAAgB,CAAC,aAAa,CAAC,EACzHC,aAAW,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC/C,EACD,EAAE,YAAY,EAAE,aAAa,EAAE,CACN,CAAC;AAC5B,IAAA,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC3B,IAAA,OAAO,MAAM,CAAC;AAChB;;ACpCA;;AAEG;;;;"}
|
package/migration.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular_devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"migration-v10_3": {
|
|
5
|
+
"version": "10.3.0-alpha.0",
|
|
6
|
+
"description": "Updates of @o3r/configuration to v10.3.*",
|
|
7
|
+
"factory": "./schematics/ng-update/v10-3/index#updateV10_3"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/configuration",
|
|
3
|
-
"version": "10.3.0-prerelease.
|
|
3
|
+
"version": "10.3.0-prerelease.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@angular/platform-browser-dynamic": "~17.3.0",
|
|
52
52
|
"@ngrx/entity": "~17.1.0",
|
|
53
53
|
"@ngrx/store": "~17.1.0",
|
|
54
|
-
"@o3r/core": "^10.3.0-prerelease.
|
|
55
|
-
"@o3r/logger": "^10.3.0-prerelease.
|
|
56
|
-
"@o3r/schematics": "^10.3.0-prerelease.
|
|
57
|
-
"@o3r/testing": "^10.3.0-prerelease.
|
|
54
|
+
"@o3r/core": "^10.3.0-prerelease.8",
|
|
55
|
+
"@o3r/logger": "^10.3.0-prerelease.8",
|
|
56
|
+
"@o3r/schematics": "^10.3.0-prerelease.8",
|
|
57
|
+
"@o3r/testing": "^10.3.0-prerelease.8",
|
|
58
58
|
"@schematics/angular": "~17.3.0",
|
|
59
59
|
"cheerio": "^1.0.0-rc.10",
|
|
60
60
|
"express-interceptor": "^1.2.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/configuration-to-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAqBpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAkC5D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/configuration-to-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,IAAI,EAML,MAAM,4BAA4B,CAAC;AAqBpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAkC5D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAgXxE;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,gDAAuD,CAAC"}
|
|
@@ -6,11 +6,11 @@ const schematics_2 = require("@o3r/schematics");
|
|
|
6
6
|
const node_path_1 = require("node:path");
|
|
7
7
|
const ts = require("typescript");
|
|
8
8
|
const configProperties = [
|
|
9
|
-
'dynamicConfig$', 'config', 'config$'
|
|
9
|
+
'dynamicConfig$', 'config', 'config$', 'configSignal'
|
|
10
10
|
];
|
|
11
11
|
const checkConfiguration = (componentPath, tree) => {
|
|
12
12
|
const files = [
|
|
13
|
-
node_path_1.posix.join((0, node_path_1.dirname)(componentPath), `${(0, node_path_1.basename)(componentPath, '.component.ts')}.
|
|
13
|
+
node_path_1.posix.join((0, node_path_1.dirname)(componentPath), `${(0, node_path_1.basename)(componentPath, '.component.ts')}.config.ts`)
|
|
14
14
|
];
|
|
15
15
|
if (files.some((file) => tree.exists(file))) {
|
|
16
16
|
throw new schematics_2.O3rCliError(`Unable to add configuration to this component because it already has at least one of these files: ${files.join(', ')}.`);
|
|
@@ -46,15 +46,15 @@ function ngAddConfigFn(options) {
|
|
|
46
46
|
(0, schematics_1.renameTemplateFiles)(),
|
|
47
47
|
(0, schematics_1.move)((0, node_path_1.dirname)(componentPath))
|
|
48
48
|
]), schematics_1.MergeStrategy.Overwrite);
|
|
49
|
-
const
|
|
49
|
+
const updateComponentRulesWithObservable = (0, schematics_1.chain)([
|
|
50
50
|
(0, schematics_2.addImportsRule)(componentPath, [
|
|
51
51
|
{
|
|
52
52
|
from: '@o3r/configuration',
|
|
53
53
|
importNames: [
|
|
54
|
-
'ConfigObserver',
|
|
55
54
|
'ConfigurationBaseService',
|
|
56
55
|
'ConfigurationObserver',
|
|
57
|
-
'DynamicConfigurable'
|
|
56
|
+
'DynamicConfigurable',
|
|
57
|
+
'O3rConfig'
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
{
|
|
@@ -90,13 +90,13 @@ function ngAddConfigFn(options) {
|
|
|
90
90
|
const visit = (node) => {
|
|
91
91
|
if (ts.isClassDeclaration(node) && (0, schematics_2.isO3rClassComponent)(node)) {
|
|
92
92
|
const propertiesToAdd = (0, schematics_2.generateClassElementsFromString)(`
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
@Input()
|
|
94
|
+
public config: Partial<${properties.componentConfig}> | undefined;
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
@O3rConfig()
|
|
97
|
+
private dynamicConfig$: ConfigurationObserver<${properties.componentConfig}>;
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
public config$: Observable<${properties.componentConfig}>;
|
|
100
100
|
`);
|
|
101
101
|
const constructorDeclaration = node.members.find((classElement) => ts.isConstructorDeclaration(classElement));
|
|
102
102
|
const configurationService = constructorDeclaration?.parameters.find((parameter) => !!parameter.type
|
|
@@ -132,7 +132,8 @@ function ngAddConfigFn(options) {
|
|
|
132
132
|
? ngOnChangesMethod.parameters
|
|
133
133
|
: (0, schematics_2.generateParametersDeclarationFromString)(`${changesVariableName}: SimpleChanges`), ngOnChangesMethod.type, ngOnChangesMethod.body
|
|
134
134
|
? factory.updateBlock(ngOnChangesMethod.body, ngOnChangesMethod.body.statements.concat(ifStatementToAdd)) : factory.createBlock(ifStatementToAdd, true)) : factory.createMethodDeclaration([factory.createToken(ts.SyntaxKind.PublicKeyword)], undefined, factory.createIdentifier('ngOnChanges'), undefined, undefined, (0, schematics_2.generateParametersDeclarationFromString)(`${changesVariableName}: SimpleChanges`), undefined, factory.createBlock(ifStatementToAdd, true));
|
|
135
|
-
const
|
|
135
|
+
const decorators = ts.getDecorators(node);
|
|
136
|
+
const o3rDecorator = decorators.find(schematics_2.isO3rClassDecorator);
|
|
136
137
|
const firstArg = o3rDecorator.expression.arguments[0];
|
|
137
138
|
const shouldUpdateDecorator = options.exposeComponent && ts.isObjectLiteralExpression(firstArg) && firstArg.properties.find((prop) => ts.isPropertyAssignment(prop)
|
|
138
139
|
&& prop.name?.getText() === 'componentType'
|
|
@@ -146,7 +147,7 @@ function ngAddConfigFn(options) {
|
|
|
146
147
|
]))
|
|
147
148
|
: o3rDecorator;
|
|
148
149
|
const newModifiers = [newO3rDecorator]
|
|
149
|
-
.concat(
|
|
150
|
+
.concat(decorators.filter((decorator) => !(0, schematics_2.isO3rClassDecorator)(decorator)))
|
|
150
151
|
.concat((ts.getModifiers(node) || []));
|
|
151
152
|
const newMembers = node.members
|
|
152
153
|
.filter((classElement) => !(ts.isConstructorDeclaration(classElement) || isNgOnChangesMethod(classElement)))
|
|
@@ -172,9 +173,88 @@ function ngAddConfigFn(options) {
|
|
|
172
173
|
return tree;
|
|
173
174
|
}
|
|
174
175
|
]);
|
|
176
|
+
const updateComponentRulesWithSignal = (0, schematics_1.chain)([
|
|
177
|
+
(0, schematics_2.addImportsRule)(componentPath, [
|
|
178
|
+
{
|
|
179
|
+
from: '@angular/core',
|
|
180
|
+
importNames: [
|
|
181
|
+
'inject',
|
|
182
|
+
'input'
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
from: '@o3r/configuration',
|
|
187
|
+
importNames: [
|
|
188
|
+
'configSignal',
|
|
189
|
+
'O3rConfig',
|
|
190
|
+
'ConfigurationBaseService',
|
|
191
|
+
'DynamicConfigurableWithSignal'
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
from: `./${properties.name}.config`,
|
|
196
|
+
importNames: [
|
|
197
|
+
`${properties.configKey}_DEFAULT_CONFIG`,
|
|
198
|
+
`${properties.configKey}_CONFIG_ID`,
|
|
199
|
+
properties.componentConfig
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
]),
|
|
203
|
+
() => {
|
|
204
|
+
const componentSourceFile = ts.createSourceFile(componentPath, tree.readText(componentPath), ts.ScriptTarget.ES2020, true);
|
|
205
|
+
const result = ts.transform(componentSourceFile, [
|
|
206
|
+
(0, schematics_2.addInterfaceToClassTransformerFactory)(`DynamicConfigurableWithSignal<${properties.componentConfig}>`, schematics_2.isO3rClassComponent),
|
|
207
|
+
(ctx) => (rootNode) => {
|
|
208
|
+
const { factory } = ctx;
|
|
209
|
+
const visit = (node) => {
|
|
210
|
+
if (ts.isClassDeclaration(node) && (0, schematics_2.isO3rClassComponent)(node)) {
|
|
211
|
+
const propertiesToAdd = (0, schematics_2.generateClassElementsFromString)(`
|
|
212
|
+
private readonly configurationService = inject(ConfigurationBaseService);
|
|
213
|
+
|
|
214
|
+
public config = input<Partial<${properties.componentConfig}>>();
|
|
215
|
+
|
|
216
|
+
@O3rConfig()
|
|
217
|
+
public readonly configSignal = configSignal(this.config, ${properties.configKey}_CONFIG_ID, ${properties.configKey}_DEFAULT_CONFIG, this.configurationService);`);
|
|
218
|
+
const decorators = ts.getDecorators(node);
|
|
219
|
+
const o3rDecorator = decorators.find(schematics_2.isO3rClassDecorator);
|
|
220
|
+
const firstArg = o3rDecorator.expression.arguments[0];
|
|
221
|
+
const shouldUpdateDecorator = options.exposeComponent && ts.isObjectLiteralExpression(firstArg) && firstArg.properties.find((prop) => ts.isPropertyAssignment(prop)
|
|
222
|
+
&& prop.name?.getText() === 'componentType'
|
|
223
|
+
&& ts.isStringLiteral(prop.initializer)
|
|
224
|
+
&& prop.initializer.text === 'Component');
|
|
225
|
+
const newO3rDecorator = shouldUpdateDecorator ? factory.updateDecorator(o3rDecorator, factory.updateCallExpression(o3rDecorator.expression, o3rDecorator.expression.expression, o3rDecorator.expression.typeArguments, [
|
|
226
|
+
factory.createObjectLiteralExpression([
|
|
227
|
+
...o3rDecorator.expression.arguments[0].properties.filter((prop) => prop.name?.getText() !== 'componentType'),
|
|
228
|
+
factory.createPropertyAssignment('componentType', factory.createStringLiteral('ExposedComponent', true))
|
|
229
|
+
])
|
|
230
|
+
]))
|
|
231
|
+
: o3rDecorator;
|
|
232
|
+
const newModifiers = [newO3rDecorator]
|
|
233
|
+
.concat(decorators.filter((decorator) => !(0, schematics_2.isO3rClassDecorator)(decorator)))
|
|
234
|
+
.concat((ts.getModifiers(node) || []));
|
|
235
|
+
const newMembers = propertiesToAdd.concat(node.members);
|
|
236
|
+
(0, schematics_2.addCommentsOnClassProperties)(newMembers, {
|
|
237
|
+
config: 'Input configuration to override the default configuration of the component',
|
|
238
|
+
configSignal: 'Configuration signal based on the input and the stored configuration'
|
|
239
|
+
});
|
|
240
|
+
return factory.updateClassDeclaration(node, newModifiers, node.name, node.typeParameters, node.heritageClauses, newMembers);
|
|
241
|
+
}
|
|
242
|
+
return ts.visitEachChild(node, visit, ctx);
|
|
243
|
+
};
|
|
244
|
+
return ts.visitNode(rootNode, visit);
|
|
245
|
+
}
|
|
246
|
+
]);
|
|
247
|
+
const printer = ts.createPrinter({
|
|
248
|
+
removeComments: false,
|
|
249
|
+
newLine: ts.NewLineKind.LineFeed
|
|
250
|
+
});
|
|
251
|
+
tree.overwrite(componentPath, printer.printFile(result.transformed[0]));
|
|
252
|
+
return tree;
|
|
253
|
+
}
|
|
254
|
+
]);
|
|
175
255
|
return (0, schematics_1.chain)([
|
|
176
256
|
createConfigFilesRule,
|
|
177
|
-
|
|
257
|
+
options.useSignal ? updateComponentRulesWithSignal : updateComponentRulesWithObservable,
|
|
178
258
|
options.skipLinter ? (0, schematics_1.noop)() : (0, schematics_2.applyEsLintFix)()
|
|
179
259
|
]);
|
|
180
260
|
}
|
|
@@ -8,5 +8,7 @@ export interface NgAddConfigSchematicsSchema extends SchematicOptionObject {
|
|
|
8
8
|
skipLinter: boolean;
|
|
9
9
|
/** Should change a component into an exposed component */
|
|
10
10
|
exposeComponent: boolean;
|
|
11
|
+
/** Should add a config signal instead of observable in the component */
|
|
12
|
+
useSignal: boolean;
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/configuration-to-component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,2BAA4B,SAAQ,qBAAqB;IACxE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,0DAA0D;IAC1D,eAAe,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/configuration-to-component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,2BAA4B,SAAQ,qBAAqB;IACxE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;IAEpB,0DAA0D;IAC1D,eAAe,EAAE,OAAO,CAAC;IAEzB,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
"type": "boolean",
|
|
25
25
|
"description": "Should change a component into an exposed component, to have it extracted in CMS metadata",
|
|
26
26
|
"default": true
|
|
27
|
+
},
|
|
28
|
+
"useSignal": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Should add a config signal instead of observable in the component.",
|
|
31
|
+
"default": false
|
|
27
32
|
}
|
|
28
33
|
},
|
|
29
34
|
"additionalProperties": true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-update/v10-3/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,4BAA4B,CAAC;AAiB7D;;GAEG;AACH,eAAO,MAAM,WAAW,4BAAuD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateV10_3 = void 0;
|
|
4
|
+
const schematics_1 = require("@o3r/schematics");
|
|
5
|
+
const configObserverRegExp = /\bConfigObserver\b/g;
|
|
6
|
+
function updateV10_3Fn() {
|
|
7
|
+
return (tree) => {
|
|
8
|
+
const files = (0, schematics_1.findFilesInTree)(tree.getDir(''), (filePath) => /.*\.ts/.test(filePath));
|
|
9
|
+
files.forEach(({ content, path }) => {
|
|
10
|
+
const str = content.toString();
|
|
11
|
+
if (configObserverRegExp.test(str)) {
|
|
12
|
+
tree.overwrite(path, str.replaceAll(configObserverRegExp, 'O3rConfig'));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Update of Otter configuration V10.3
|
|
19
|
+
*/
|
|
20
|
+
exports.updateV10_3 = (0, schematics_1.createSchematicWithMetricsIfInstalled)(updateV10_3Fn);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Rule } from '@angular-devkit/schematics';
|
|
2
|
+
import type { NgUseConfigSignalSchematicsSchema } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* Migrate from configuration observable to signal
|
|
5
|
+
* @param options
|
|
6
|
+
*/
|
|
7
|
+
export declare const ngUseConfigSignal: (options: NgUseConfigSignalSchematicsSchema) => Rule;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/use-config-signal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EAEV,MAAM,4BAA4B,CAAC;AAYpC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,UAAU,CAAC;AAgIlE;;;GAGG;AACH,eAAO,MAAM,iBAAiB,sDAA6D,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ngUseConfigSignal = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const schematics_2 = require("@o3r/schematics");
|
|
6
|
+
const ts = require("typescript");
|
|
7
|
+
const configObserverRegexp = /.*new ConfigurationObserver<(?<configName>\w+)>\(\s*(?<configId>\w+),\s*(?<defaultConfig>\w+)(,\s*\w+)?\s*\);/;
|
|
8
|
+
function ngUseConfigSignalFn(options) {
|
|
9
|
+
return (0, schematics_1.chain)([
|
|
10
|
+
(0, schematics_2.addImportsRule)(options.path, [
|
|
11
|
+
{
|
|
12
|
+
from: '@angular/core',
|
|
13
|
+
importNames: [
|
|
14
|
+
'inject',
|
|
15
|
+
'input'
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
from: '@angular/core/rxjs-interop',
|
|
20
|
+
importNames: [
|
|
21
|
+
'toObservable'
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
from: '@o3r/configuration',
|
|
26
|
+
importNames: [
|
|
27
|
+
'configSignal',
|
|
28
|
+
'O3rConfig',
|
|
29
|
+
'ConfigurationBaseService',
|
|
30
|
+
'DynamicConfigurableWithSignal'
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]),
|
|
34
|
+
(tree) => {
|
|
35
|
+
const content = tree.readText(options.path);
|
|
36
|
+
// Retrieve all info
|
|
37
|
+
const match = content.match(configObserverRegexp);
|
|
38
|
+
const { configName, configId, defaultConfig } = match?.groups || {};
|
|
39
|
+
if (!configName || !configId || !defaultConfig) {
|
|
40
|
+
throw new schematics_2.O3rCliError(`Configuration name, id or default value not found in ${options.path}.\nCannot migrate to signal based configuration.`);
|
|
41
|
+
}
|
|
42
|
+
const componentSourceFile = ts.createSourceFile(options.path, content, ts.ScriptTarget.ES2020, true);
|
|
43
|
+
const result = ts.transform(componentSourceFile, [
|
|
44
|
+
(0, schematics_2.addInterfaceToClassTransformerFactory)(`DynamicConfigurableWithSignal<${configName}>`, schematics_2.isO3rClassComponent, new Set(['DynamicConfigurable'])),
|
|
45
|
+
(ctx) => (rootNode) => {
|
|
46
|
+
const { factory } = ctx;
|
|
47
|
+
const visit = (node) => {
|
|
48
|
+
if (ts.isClassDeclaration(node) && (0, schematics_2.isO3rClassComponent)(node)) {
|
|
49
|
+
const propertiesToAdd = (0, schematics_2.generateClassElementsFromString)(`
|
|
50
|
+
private readonly configurationService = inject(ConfigurationBaseService);
|
|
51
|
+
|
|
52
|
+
public config = input<Partial<${configName}>>();
|
|
53
|
+
|
|
54
|
+
@O3rConfig()
|
|
55
|
+
public readonly configSignal = configSignal(this.config, ${configId}, ${defaultConfig}, this.configurationService);
|
|
56
|
+
|
|
57
|
+
public readonly config$ = toObservable(this.configSignal);`);
|
|
58
|
+
const newMembers = propertiesToAdd.concat(node.members.filter((member) => !member.name
|
|
59
|
+
|| (ts.isIdentifier(member.name)
|
|
60
|
+
&& member.name.escapedText !== 'config$'
|
|
61
|
+
&& member.name.escapedText !== 'config'
|
|
62
|
+
&& member.name.escapedText !== 'dynamicConfig$')));
|
|
63
|
+
(0, schematics_2.addCommentsOnClassProperties)(newMembers, {
|
|
64
|
+
config: 'Input configuration to override the default configuration of the component',
|
|
65
|
+
configSignal: 'Configuration signal based on the input and the stored configuration',
|
|
66
|
+
config$: '@deprecated use configSignal instead'
|
|
67
|
+
});
|
|
68
|
+
return factory.updateClassDeclaration(node, ts.getModifiers(node), node.name, node.typeParameters, node.heritageClauses, newMembers);
|
|
69
|
+
}
|
|
70
|
+
return ts.visitEachChild(node, visit, ctx);
|
|
71
|
+
};
|
|
72
|
+
return ts.visitNode(rootNode, visit);
|
|
73
|
+
}
|
|
74
|
+
]);
|
|
75
|
+
const printer = ts.createPrinter({
|
|
76
|
+
removeComments: false,
|
|
77
|
+
newLine: ts.NewLineKind.LineFeed
|
|
78
|
+
});
|
|
79
|
+
let newContent = printer.printFile(result.transformed[0]);
|
|
80
|
+
newContent = newContent
|
|
81
|
+
.replace(/this\.dynamicConfig\$\.next\(this.config\);/, '// TODO remove the ngOnChanges if empty')
|
|
82
|
+
.replace(configObserverRegexp, '')
|
|
83
|
+
.replace(/this\.config\$\s*=\s*this\.dynamicConfig\$\s*\.asObservable\(\);/, '');
|
|
84
|
+
tree.overwrite(options.path, newContent);
|
|
85
|
+
return tree;
|
|
86
|
+
},
|
|
87
|
+
options.skipLinter ? (0, schematics_1.noop)() : (0, schematics_2.applyEsLintFix)()
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Migrate from configuration observable to signal
|
|
92
|
+
* @param options
|
|
93
|
+
*/
|
|
94
|
+
exports.ngUseConfigSignal = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngUseConfigSignalFn);
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SchematicOptionObject } from '@o3r/schematics';
|
|
2
|
+
export interface NgUseConfigSignalSchematicsSchema extends SchematicOptionObject {
|
|
3
|
+
/** Path to the component */
|
|
4
|
+
path: string;
|
|
5
|
+
/** Skip the linter process */
|
|
6
|
+
skipLinter: boolean;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/use-config-signal/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,iCAAkC,SAAQ,qBAAqB;IAC9E,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "NgUseConfigSignalSchematicsSchema",
|
|
4
|
+
"title": "Migrate from configuration observable to signal",
|
|
5
|
+
"description": "Migrate from configuration observable to signal",
|
|
6
|
+
"properties": {
|
|
7
|
+
"path": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Path to the component"
|
|
10
|
+
},
|
|
11
|
+
"skipLinter": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"description": "Skip the linter process",
|
|
14
|
+
"default": false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"additionalProperties": true,
|
|
18
|
+
"required": [
|
|
19
|
+
"path"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorator to identify the configuration observer
|
|
3
|
+
* @deprecated please use O3rConfig, will be removed in v12
|
|
4
|
+
*/
|
|
5
|
+
export declare function ConfigObserver(): (target: any, key: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Decorator to identify the component's configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare function O3rConfig(): (target: any, key: string) => void;
|
|
10
|
+
//# sourceMappingURL=configuration.decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.decorators.d.ts","sourceRoot":"","sources":["../../src/tools/configuration.decorators.ts"],"names":[],"mappings":"AAwBA;;;GAGG;AAEH,wBAAgB,cAAc,uCAE7B;AAED;;GAEG;AAEH,wBAAgB,SAAS,uCAExB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { InputSignal, Signal } from '@angular/core';
|
|
2
|
+
import type { Configuration } from '@o3r/core';
|
|
3
|
+
import type { ConfigurationBaseService } from '../services';
|
|
4
|
+
/** Configuration signal */
|
|
5
|
+
export type ConfigurationSignal<T> = Signal<T> & {
|
|
6
|
+
configId: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Get a configuration signal
|
|
10
|
+
* @param configInput
|
|
11
|
+
* @param configId
|
|
12
|
+
* @param defaultConfig
|
|
13
|
+
* @param configurationService
|
|
14
|
+
*/
|
|
15
|
+
export declare const configSignal: <T extends Configuration>(configInput: InputSignal<Partial<T> | undefined>, configId: string, defaultConfig: T, configurationService?: ConfigurationBaseService | null) => ConfigurationSignal<T>;
|
|
16
|
+
//# sourceMappingURL=configuration.signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.signal.d.ts","sourceRoot":"","sources":["../../src/tools/configuration.signal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,2BAA2B;AAC3B,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,yCACV,YAAY,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC,YACtC,MAAM,iBACD,CAAC,yBACO,wBAAwB,GAAG,IAAI,KACrD,oBAAoB,CAAC,CAcvB,CAAC"}
|
package/tools/index.d.ts
CHANGED
package/tools/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { otterComponentInfoPropertyName } from '@o3r/core';
|
|
2
|
-
/**
|
|
3
|
-
* Decorator to identify the configuration observer
|
|
4
|
-
*/
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6
|
-
export function ConfigObserver() {
|
|
7
|
-
return (target, key) => {
|
|
8
|
-
const privateField = `_${key}`;
|
|
9
|
-
if (delete target[key]) {
|
|
10
|
-
Object.defineProperty(target, key, {
|
|
11
|
-
get: function () {
|
|
12
|
-
return this[privateField];
|
|
13
|
-
},
|
|
14
|
-
set: function (value) {
|
|
15
|
-
this[privateField] = value;
|
|
16
|
-
if (this[otterComponentInfoPropertyName]) {
|
|
17
|
-
this[otterComponentInfoPropertyName].configId = this[privateField].configId;
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5kZWNvcmF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdG9vbHMvY29uZmlndXJhdGlvbi5kZWNvcmF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFpQiw4QkFBOEIsRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUcxRTs7R0FFRztBQUNILGdFQUFnRTtBQUNoRSxNQUFNLFVBQVUsY0FBYztJQUM1QixPQUFPLENBQUMsTUFBVyxFQUFFLEd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0LWVzbGludC9uYW1pbmctY29udmVudGlvblxuZXhwb3J0IGZ1bmN0aW9uIENvbmZpZ09ic2VydmVyKCkge1xuICByZXR1cm4gKHRhcmdldDogYW55LCBrZXk6IHN0cmluZykgPT4ge1xuICAgIGNvbnN0IHByaXZhdGVGaWVsZCA9IGBfJHtrZXl9YDtcblxuICAgIGlmIChkZWxldGUgdGFyZ2V0W2tleV0pIHtcbiAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0YXJnZXQsIGtleSwge1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uICh0aGlzOiBhbnkpIHtcbiAgICAgICAgICByZXR1cm4gdGhpc1twcml2YXRlRmllbGRdO1xuICAgICAgICB9LFxuICAgICAgICBzZXQ6IGZ1bmN0aW9uICh0aGlzOiBhbnksIHZhbHVlOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPikge1xuICAgICAgICAgIHRoaXNbcHJpdmF0ZUZpZWxkXSA9IHZhbHVlO1xuICAgICAgICAgIGlmICh0aGlzW290dGVyQ29tcG9uZW50SW5mb1Byb3BlcnR5TmFtZV0pIHtcbiAgICAgICAgICAgIHRoaXNbb3R0ZXJDb21wb25lbnRJbmZvUHJvcGVydHlOYW1lXS5jb25maWdJZCA9ICh0aGlzW3ByaXZhdGVGaWVsZF0gYXMgQ29uZmlndXJhdGlvbk9ic2VydmVyPENvbmZpZ3VyYXRpb24+KS5jb25maWdJZDtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZVxuICAgICAgfSk7XG4gICAgfVxuICB9O1xufVxuIl19
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.decorator.d.ts","sourceRoot":"","sources":["../../src/tools/configuration.decorator.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,wBAAgB,cAAc,aACZ,GAAG,OAAO,MAAM,UAmBjC"}
|