@eui/tools 6.21.124 → 6.21.126

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.
Files changed (78) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/package.json +1 -1
  4. package/scripts/csdr/init/resources/17.x/yarn.lock +18166 -0
  5. package/scripts/csdr/init/resources/18.x/resolutions.json +2 -1
  6. package/scripts/csdr/init/resources/18.x/{yarn.lock.old → yarn.lock} +5086 -4702
  7. package/scripts/csdr/init/resources/19.x/yarn.lock +15686 -0
  8. package/scripts/csdr/install/common.js +1 -1
  9. package/scripts/csdr/init/remotes/10.x/base/angular.json +0 -89
  10. package/scripts/csdr/init/remotes/10.x/base/browserslist +0 -6
  11. package/scripts/csdr/init/remotes/10.x/base/package.json_TO_REPLACE +0 -14
  12. package/scripts/csdr/init/remotes/10.x/base/tsconfig.app.json +0 -20
  13. package/scripts/csdr/init/remotes/10.x/full/common/app/eui-components.ts +0 -11
  14. package/scripts/csdr/init/remotes/10.x/full/common/app/fallback.component.ts +0 -11
  15. package/scripts/csdr/init/remotes/10.x/full/common/app/module.component.ts +0 -98
  16. package/scripts/csdr/init/remotes/10.x/full/common/app/module.ts +0 -97
  17. package/scripts/csdr/init/remotes/10.x/full/common/app/reducers/custom-route-serializer.ts +0 -28
  18. package/scripts/csdr/init/remotes/10.x/full/common/app/reducers/index.ts +0 -51
  19. package/scripts/csdr/init/remotes/10.x/full/common/app/routing.module.ts +0 -34
  20. package/scripts/csdr/init/remotes/10.x/full/common/assets/.gitkeep +0 -0
  21. package/scripts/csdr/init/remotes/10.x/full/common/config/global.ts +0 -115
  22. package/scripts/csdr/init/remotes/10.x/full/common/config/index.ts +0 -10
  23. package/scripts/csdr/init/remotes/10.x/full/common/config/modules.ts +0 -3
  24. package/scripts/csdr/init/remotes/10.x/full/common/environments/environment.prod.ts +0 -3
  25. package/scripts/csdr/init/remotes/10.x/full/common/environments/environment.ts +0 -3
  26. package/scripts/csdr/init/remotes/10.x/full/common/favicon.ico +0 -0
  27. package/scripts/csdr/init/remotes/10.x/full/common/index.html +0 -10
  28. package/scripts/csdr/init/remotes/10.x/full/common/main.ts +0 -11
  29. package/scripts/csdr/init/remotes/10.x/full/common/polyfills.ts +0 -87
  30. package/scripts/csdr/init/remotes/10.x/full/common/test.ts +0 -20
  31. package/scripts/csdr/init/remotes/10.x/full/options/all-locales/config/global.ts +0 -119
  32. package/scripts/csdr/init/remotes/10.x/full/options/definitions/dynatrace.json +0 -4
  33. package/scripts/csdr/init/remotes/10.x/full/options/definitions/participant.json +0 -3
  34. package/scripts/csdr/init/remotes/10.x/full/options/definitions/user-reducers.json +0 -3
  35. package/scripts/csdr/init/remotes/10.x/full/options/definitions/zipkin.json +0 -5
  36. package/scripts/csdr/init/remotes/10.x/full/options/participant/app/module.component.ts +0 -101
  37. package/scripts/csdr/init/remotes/10.x/full/options/participant/app/routing.module.ts +0 -26
  38. package/scripts/csdr/init/remotes/10.x/full/options/participant/config/index.ts +0 -10
  39. package/scripts/csdr/init/remotes/10.x/full/options/user-reducers/app/reducers/index.ts +0 -75
  40. package/scripts/csdr/init/remotes/15.x/base/angular.json +0 -87
  41. package/scripts/csdr/init/remotes/15.x/base/browserslist +0 -6
  42. package/scripts/csdr/init/remotes/15.x/base/package.json_TO_REPLACE +0 -10
  43. package/scripts/csdr/init/remotes/15.x/base/tsconfig.app.json +0 -24
  44. package/scripts/csdr/init/remotes/15.x/base/yarn.lock.old +0 -14091
  45. package/scripts/csdr/init/remotes/15.x/full/common/app/eui-components.ts +0 -9
  46. package/scripts/csdr/init/remotes/15.x/full/common/app/fallback.component.ts +0 -11
  47. package/scripts/csdr/init/remotes/15.x/full/common/app/module.component.ts +0 -98
  48. package/scripts/csdr/init/remotes/15.x/full/common/app/module.ts +0 -100
  49. package/scripts/csdr/init/remotes/15.x/full/common/app/reducers/custom-route-serializer.ts +0 -28
  50. package/scripts/csdr/init/remotes/15.x/full/common/app/reducers/index.ts +0 -51
  51. package/scripts/csdr/init/remotes/15.x/full/common/app/routing.module.ts +0 -34
  52. package/scripts/csdr/init/remotes/15.x/full/common/assets/.gitkeep +0 -0
  53. package/scripts/csdr/init/remotes/15.x/full/common/config/global.ts +0 -118
  54. package/scripts/csdr/init/remotes/15.x/full/common/config/index.ts +0 -10
  55. package/scripts/csdr/init/remotes/15.x/full/common/config/modules.ts +0 -3
  56. package/scripts/csdr/init/remotes/15.x/full/common/environments/environment.prod.ts +0 -3
  57. package/scripts/csdr/init/remotes/15.x/full/common/environments/environment.ts +0 -3
  58. package/scripts/csdr/init/remotes/15.x/full/common/favicon.ico +0 -0
  59. package/scripts/csdr/init/remotes/15.x/full/common/index.html +0 -10
  60. package/scripts/csdr/init/remotes/15.x/full/common/main.ts +0 -11
  61. package/scripts/csdr/init/remotes/15.x/full/common/polyfills.ts +0 -88
  62. package/scripts/csdr/init/remotes/15.x/full/common/test.ts +0 -20
  63. package/scripts/csdr/init/remotes/15.x/full/options/ag-grid/main.ts +0 -17
  64. package/scripts/csdr/init/remotes/15.x/full/options/all-locales/config/global.ts +0 -122
  65. package/scripts/csdr/init/remotes/15.x/full/options/definitions/dynamic-forms.json +0 -4
  66. package/scripts/csdr/init/remotes/15.x/full/options/definitions/dynatrace.json +0 -4
  67. package/scripts/csdr/init/remotes/15.x/full/options/definitions/participant.json +0 -3
  68. package/scripts/csdr/init/remotes/15.x/full/options/definitions/user-reducers.json +0 -3
  69. package/scripts/csdr/init/remotes/15.x/full/options/definitions/zipkin.json +0 -5
  70. package/scripts/csdr/init/remotes/15.x/full/options/participant/app/module.component.ts +0 -101
  71. package/scripts/csdr/init/remotes/15.x/full/options/participant/app/routing.module.ts +0 -26
  72. package/scripts/csdr/init/remotes/15.x/full/options/participant/config/index.ts +0 -10
  73. package/scripts/csdr/init/remotes/15.x/full/options/user-reducers/app/reducers/index.ts +0 -75
  74. package/scripts/csdr/init/resources/15.x/browserslistrc +0 -6
  75. package/scripts/csdr/init/resources/15.x/resolutions.json +0 -11
  76. package/scripts/csdr/init/resources/15.x/yarn.lock.old +0 -14091
  77. package/scripts/csdr/init/resources/17.x/yarn.lock.old +0 -13395
  78. package/scripts/csdr/init/resources/nodejs-10.x/resolutions.json +0 -17
@@ -1,87 +0,0 @@
1
- /* eslint-disable */
2
- /**
3
- * This file includes polyfills needed by Angular and is loaded before the app.
4
- * You can add your own extra polyfills to this file.
5
- *
6
- * This file is divided into 2 sections:
7
- * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
8
- * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
9
- * file.
10
- *
11
- * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
12
- * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
13
- * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
14
- *
15
- * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
16
- */
17
-
18
- /***************************************************************************************************
19
- * BROWSER POLYFILLS
20
- */
21
-
22
- /** IE9, IE10 and IE11 requires all of the following polyfills. **/
23
- // import 'core-js/es6/symbol';
24
- // import 'core-js/es6/object';
25
- // import 'core-js/es6/function';
26
- // import 'core-js/es6/parse-int';
27
- // import 'core-js/es6/parse-float';
28
- // import 'core-js/es6/number';
29
- // import 'core-js/es6/math';
30
- // import 'core-js/es6/string';
31
- // import 'core-js/es6/date';
32
- // import 'core-js/es6/array';
33
- // import 'core-js/es6/regexp';
34
- // import 'core-js/es6/map';
35
- // import 'core-js/es6/weak-map';
36
- // import 'core-js/es6/set';
37
-
38
- /** IE10 and IE11 requires the following for NgClass support on SVG elements */
39
- // import 'classlist.js'; // Run `npm install --save classlist.js`.
40
-
41
- /** IE10 and IE11 requires the following for the Reflect API. */
42
- // import 'core-js/es6/reflect';
43
-
44
- /** Evergreen browsers require these. **/
45
- // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
46
- // import 'core-js/es7/reflect';
47
-
48
- /**
49
- * Web Animations `@angular/platform-browser/animations`
50
- * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
51
- * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
52
- **/
53
- // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
54
-
55
- /**
56
- * By default, zone.js will patch all possible macroTask and DomEvents
57
- * user can disable parts of macroTask/DomEvents patch by setting following flags
58
- */
59
-
60
- // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
61
- // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
62
- // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
63
-
64
- /*
65
- * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
66
- * with the following flag, it will bypass `zone.js` patch for IE/Edge
67
- */
68
- // (window as any).__Zone_enable_cross_context_check = true;
69
-
70
- /***************************************************************************************************
71
- * Zone JS is required by default for Angular itself.
72
- */
73
- import 'zone.js/dist/zone'; // Included with Angular CLI.
74
-
75
- /***************************************************************************************************
76
- * APPLICATION IMPORTS
77
- */
78
-
79
- /**
80
- * Date, currency, decimal and percent pipes.
81
- * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
82
- */
83
- // import 'intl'; // Run `npm install --save intl`.
84
- /**
85
- * Need to import at least one locale-data with intl.
86
- */
87
- // import 'intl/locale-data/jsonp/en';
@@ -1,20 +0,0 @@
1
- // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
-
3
- import 'zone.js/dist/zone-testing';
4
- import { getTestBed } from '@angular/core/testing';
5
- import {
6
- BrowserDynamicTestingModule,
7
- platformBrowserDynamicTesting,
8
- } from '@angular/platform-browser-dynamic/testing';
9
-
10
- declare const require: any;
11
-
12
- // First, initialize the Angular testing environment.
13
- getTestBed().initTestEnvironment(
14
- BrowserDynamicTestingModule,
15
- platformBrowserDynamicTesting(),
16
- );
17
- // Then we find all the tests.
18
- const context = require.context('./', true, /\.spec\.ts$/);
19
- // And load the modules.
20
- context.keys().map(context);
@@ -1,119 +0,0 @@
1
- import { registerLocaleData } from '@angular/common';
2
- import { GlobalConfig, I18nConfig, LocaleServiceConfig } from '@eui/core';
3
-
4
- import localeBg from '@angular/common/locales/bg';
5
- import localeBgExtra from '@angular/common/locales/extra/bg';
6
- import localeEs from '@angular/common/locales/es';
7
- import localeEsExtra from '@angular/common/locales/extra/es';
8
- import localeCs from '@angular/common/locales/cs';
9
- import localeCsExtra from '@angular/common/locales/extra/cs';
10
- import localeDa from '@angular/common/locales/da';
11
- import localeDaExtra from '@angular/common/locales/extra/da';
12
- import localeDe from '@angular/common/locales/de';
13
- import localeDeExtra from '@angular/common/locales/extra/de';
14
- import localeEt from '@angular/common/locales/et';
15
- import localeEtExtra from '@angular/common/locales/extra/et';
16
- import localeEl from '@angular/common/locales/el';
17
- import localeElExtra from '@angular/common/locales/extra/el';
18
- import localeEn from '@angular/common/locales/en';
19
- import localeEnExtra from '@angular/common/locales/extra/en';
20
- import localeFr from '@angular/common/locales/fr';
21
- import localeFrExtra from '@angular/common/locales/extra/fr';
22
- import localeGa from '@angular/common/locales/ga';
23
- import localeGaExtra from '@angular/common/locales/extra/ga';
24
- import localeHr from '@angular/common/locales/hr';
25
- import localeHrExtra from '@angular/common/locales/extra/hr';
26
- import localeIt from '@angular/common/locales/it';
27
- import localeItExtra from '@angular/common/locales/extra/it';
28
- import localeLv from '@angular/common/locales/lv';
29
- import localeLvExtra from '@angular/common/locales/extra/lv';
30
- import localeLt from '@angular/common/locales/lt';
31
- import localeLtExtra from '@angular/common/locales/extra/lt';
32
- import localeHu from '@angular/common/locales/hu';
33
- import localeHuExtra from '@angular/common/locales/extra/hu';
34
- import localeMt from '@angular/common/locales/mt';
35
- import localeMtExtra from '@angular/common/locales/extra/mt';
36
- import localeNl from '@angular/common/locales/nl';
37
- import localeNlExtra from '@angular/common/locales/extra/nl';
38
- import localePl from '@angular/common/locales/pl';
39
- import localePlExtra from '@angular/common/locales/extra/pl';
40
- import localePt from '@angular/common/locales/pt';
41
- import localePtExtra from '@angular/common/locales/extra/pt';
42
- import localeRo from '@angular/common/locales/ro';
43
- import localeRoExtra from '@angular/common/locales/extra/ro';
44
- import localeSk from '@angular/common/locales/sk';
45
- import localeSkExtra from '@angular/common/locales/extra/sk';
46
- import localeSl from '@angular/common/locales/sl';
47
- import localeSlExtra from '@angular/common/locales/extra/sl';
48
- import localeFi from '@angular/common/locales/fi';
49
- import localeFiExtra from '@angular/common/locales/extra/fi';
50
- import localeSv from '@angular/common/locales/sv';
51
- import localeSvExtra from '@angular/common/locales/extra/sv';
52
-
53
- /**
54
- * import and register locales (currently MWP uses only French and English)
55
- */
56
- registerLocaleData(localeBg, 'bg', localeBgExtra);
57
- registerLocaleData(localeEs, 'es', localeEsExtra);
58
- registerLocaleData(localeCs, 'cs', localeCsExtra);
59
- registerLocaleData(localeDa, 'da', localeDaExtra);
60
- registerLocaleData(localeDe, 'de', localeDeExtra);
61
- registerLocaleData(localeEt, 'et', localeEtExtra);
62
- registerLocaleData(localeEl, 'el', localeElExtra);
63
- registerLocaleData(localeEn, 'en', localeEnExtra);
64
- registerLocaleData(localeFr, 'fr', localeFrExtra);
65
- registerLocaleData(localeGa, 'ga', localeGaExtra);
66
- registerLocaleData(localeHr, 'hr', localeHrExtra);
67
- registerLocaleData(localeIt, 'it', localeItExtra);
68
- registerLocaleData(localeLv, 'lv', localeLvExtra);
69
- registerLocaleData(localeLt, 'lt', localeLtExtra);
70
- registerLocaleData(localeHu, 'hu', localeHuExtra);
71
- registerLocaleData(localeMt, 'mt', localeMtExtra);
72
- registerLocaleData(localeNl, 'nl', localeNlExtra);
73
- registerLocaleData(localePl, 'pl', localePlExtra);
74
- registerLocaleData(localePt, 'pt', localePtExtra);
75
- registerLocaleData(localeRo, 'ro', localeRoExtra);
76
- registerLocaleData(localeSk, 'sk', localeSkExtra);
77
- registerLocaleData(localeSl, 'sl', localeSlExtra);
78
- registerLocaleData(localeFi, 'fi', localeFiExtra);
79
- registerLocaleData(localeSv, 'sv', localeSvExtra);
80
-
81
- const languages = ['bg', 'es', 'cs', 'da', 'de', 'et', 'el', 'en', 'fr', 'ga', 'hr', 'it', 'lv', 'lt', 'hu', 'mt', 'nl', 'pl',
82
- 'pt', 'ro', 'sk', 'sl', 'fi', 'sv'];
83
-
84
- /**
85
- * Internationalization Configuration
86
- */
87
- const i18nConfig: I18nConfig = {
88
- i18nLoader: {
89
- i18nFolders: ['elements/@remote.name@/bundles/assets/i18n-compiled'],
90
- },
91
- i18nService: {
92
- languages: languages,
93
- defaultLanguage: 'en',
94
- },
95
- };
96
-
97
- /**
98
- * Locale Configuration
99
- */
100
- const localeConfig: LocaleServiceConfig = {
101
- id: 'en',
102
- available: languages,
103
- bindWithTranslate: true,
104
- affectGlobalLocale: true,
105
- };
106
-
107
- /**
108
- * Global Configuration
109
- */
110
- export const GLOBAL: GlobalConfig = {
111
- /* URL that needs to be used in the appRouting of the MWP */
112
- baseUrl: '@base.url@',
113
- /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
114
- elementName: '@element.name@',
115
- /* in case you are using NgRx give it a unique name (mostly for debugging) */
116
- storeName: '@store.name@',
117
- i18n: i18nConfig,
118
- locale: localeConfig,
119
- };
@@ -1,4 +0,0 @@
1
- {
2
- "declarations": "declare const window: { dT_: { initAngularNg?: any } | undefined };",
3
- "constructorDeclarations": "if (window?.dT_?.initAngularNg) { window.dT_.initAngularNg(http, HttpHeaders); }"
4
- }
@@ -1,3 +0,0 @@
1
- {
2
- "providers": "...CONTAINER_MAPPED_PROVIDERS"
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "providers": "{ provide: USER_PROVIDED_META_REDUCERS, deps: [CONFIG_TOKEN, ElementStorageService], useFactory: metaReducers }"
3
- }
@@ -1,5 +0,0 @@
1
- {
2
- "imports": "import { getZipkinConfig, TRACE_MODULE_CONFIGURATION, ZipkinModule } from '@csdr/zipkin-tracing';",
3
- "definitions": "ZipkinModule.forRoot()",
4
- "providers": "{ provide: TRACE_MODULE_CONFIGURATION, useFactory: getZipkinConfig, deps: [CONFIG_TOKEN] }"
5
- }
@@ -1,101 +0,0 @@
1
- import { Component, OnInit, Inject, ElementRef, OnDestroy } from '@angular/core';
2
-
3
- import { Subscription } from 'rxjs';
4
- import { first } from 'rxjs/operators';
5
-
6
- import { CONFIG_TOKEN } from '@eui/core';
7
- import { ElementSetupService, ElementLifeCycleService } from '@csdr/integration/element';
8
-
9
- enum ElementStatus {
10
- Loading = 'loading',
11
- Loaded = 'loaded',
12
- Error = 'error',
13
- }
14
-
15
- @Component({
16
- template: `
17
- <eui-block-content *ngIf="moduleStatus === ElementStatus.Loading" [isBlocked]="true">
18
- <div style="height: 100%"></div>
19
- </eui-block-content>
20
- <ng-container *ngIf="moduleStatus === ElementStatus.Loaded">
21
- <@block.container.name@ [block]="block"></@block.container.name@>
22
- </ng-container>
23
- <ng-container *ngIf="moduleStatus === ElementStatus.Error">
24
- <div class="error-container">
25
- <div>
26
- <h1>Translations or user data for this module failed to load.</h1>
27
- <p>Do you want to try again?</p>
28
- <button euiButton euiPrimary (click)="loadData()">
29
- <span euiLabel>{{ "global.RELOAD" | translate }}</span>
30
- </button>
31
- </div>
32
- </div>
33
- </ng-container>
34
- `,
35
- styles: [`
36
- .error-container {
37
- width: 50vw;
38
- height: 50vh;
39
- position: absolute;
40
- top: 50%;
41
- left: 50%;
42
- transform: translate(-50%, -50%);
43
- }
44
-
45
- .error-container div {
46
- text-align: center
47
- }
48
- `],
49
- })
50
- export class ModuleComponent implements OnInit, OnDestroy {
51
- ElementStatus = ElementStatus;
52
- moduleStatus: ElementStatus;
53
-
54
- block: any;
55
-
56
- private initSubscription: Subscription;
57
-
58
- constructor(private elRef: ElementRef,
59
- @Inject(CONFIG_TOKEN) public config: any,
60
- private elementLifeCycleService: ElementLifeCycleService,
61
- private elementSetupService: ElementSetupService) {
62
- }
63
-
64
- ngOnInit() {
65
- this.block = this.elRef.nativeElement.block;
66
- const elementData = this.elementLifeCycleService.getElementData(this.elRef);
67
- this.elementLifeCycleService.setup(elementData);
68
- this.loadData();
69
- }
70
-
71
- ngOnDestroy(): void {
72
- this.initSubscription?.unsubscribe();
73
- this.elementLifeCycleService.cleanup();
74
- }
75
-
76
- private loadData() {
77
- this.setStatus(ElementStatus.Loading);
78
- try {
79
- this.initSubscription?.unsubscribe();
80
-
81
- this.initSubscription = this.elementSetupService
82
- .init()
83
- .pipe(first())
84
- .subscribe((loadStatus: { success: boolean, error?: string }) => {
85
- if (!loadStatus.success) {
86
- this.setStatus(ElementStatus.Error);
87
- console.error(`[ELEMENT: ${this.config.global.elementName}] `, loadStatus.error);
88
- } else {
89
- this.setStatus(ElementStatus.Loaded);
90
- }
91
- });
92
- } catch (e) {
93
- console.log(e);
94
- this.setStatus(ElementStatus.Error);
95
- }
96
- }
97
-
98
- private setStatus(status: ElementStatus) {
99
- this.moduleStatus = status;
100
- }
101
- }
@@ -1,26 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { RouterModule, Routes } from '@angular/router';
3
-
4
- import { ELEMENT_ROUTES_TOKEN } from '@csdr/integration/element';
5
-
6
- import { appConfig } from '../config/index'; // tslint:disable-line
7
- import { FallbackComponent } from './fallback.component'; // tslint:disable-line
8
- import { ModuleComponent } from './module.component';
9
-
10
- const elementRoutes: Routes = [
11
- { path: '**', component: ModuleComponent },
12
- ];
13
-
14
- @NgModule({
15
- imports: [
16
- RouterModule.forRoot(elementRoutes),
17
- ],
18
- providers: [
19
- { provide: ELEMENT_ROUTES_TOKEN, useValue: elementRoutes },
20
- ],
21
- exports: [
22
- RouterModule,
23
- ],
24
- })
25
- export class RoutingModule {
26
- }
@@ -1,10 +0,0 @@
1
- import { GLOBAL } from './global';
2
- import { MODULES } from './modules';
3
-
4
- import { EuiAppConfig } from '@eui/core';
5
- import { configMapping } from '@csdr/integration/element';
6
-
7
- export const appConfig: EuiAppConfig = configMapping({
8
- global: GLOBAL,
9
- modules: MODULES,
10
- });
@@ -1,75 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- import { ActionReducer, ActionReducerMap, MetaReducer, INIT, RuntimeChecks } from '@ngrx/store';
3
- import * as fromRouter from '@ngrx/router-store';
4
- import { storeFreeze } from 'ngrx-store-freeze';
5
-
6
- import { reducers as coreReducers, CoreState, localStorageSync } from '@eui/core';
7
- import { ElementStorageService } from '@csdr/core';
8
-
9
- import { environment } from '../../environments/environment';
10
-
11
- export interface AppState extends CoreState {
12
- router: fromRouter.RouterReducerState<any>;
13
- }
14
-
15
- // -----------------
16
- // ------------ AOT
17
- export const TOKEN = new InjectionToken<any>('AppReducers');
18
-
19
- export function getReducers(): ActionReducerMap<AppState, any> {
20
- return {
21
- router: fromRouter.routerReducer,
22
- ...coreReducers,
23
- };
24
- }
25
-
26
- export const reducerProvider = [
27
- { provide: TOKEN, useFactory: getReducers },
28
- ];
29
-
30
- // console.log all actions
31
- export function logger(reducer: ActionReducer<AppState>): ActionReducer<AppState> {
32
- return (state, action) => {
33
- const result = reducer(state, action);
34
- console.groupCollapsed(action.type);
35
- console.log('prev state', state);
36
- console.log('action', action);
37
- console.log('next state', result);
38
- console.groupEnd();
39
-
40
- return result;
41
- };
42
- }
43
-
44
- export function hydrationFactory(config: any, elementStorage: ElementStorageService): MetaReducer<AppState> {
45
- return (reducer: ActionReducer<AppState>): ActionReducer<any> => {
46
- return (state, action) => {
47
- const key = `NgRx store: ${config.global.elementName}`;
48
- if (action.type === INIT && elementStorage.hasData(key)) {
49
- const cachedState = elementStorage.getData(key);
50
- const nextStateFromCache = reducer(cachedState as AppState, action);
51
- elementStorage.setData(key, nextStateFromCache);
52
- return nextStateFromCache;
53
- }
54
- const nextState = reducer(state, action);
55
- elementStorage.setData(key, nextState);
56
- return nextState;
57
- };
58
- };
59
- }
60
-
61
- export function metaReducers(config: any, elementStorage: ElementStorageService): MetaReducer<AppState>[] {
62
- if (!environment.production) {
63
- return [logger, localStorageSync, storeFreeze, hydrationFactory(config, elementStorage)];
64
- }
65
- return [localStorageSync, hydrationFactory(config, elementStorage)];
66
- }
67
-
68
- export const runtimeChecks: RuntimeChecks = {
69
- strictStateSerializability: false,
70
- strictActionSerializability: false,
71
- strictStateImmutability: false,
72
- strictActionImmutability: false,
73
- strictActionWithinNgZone: false,
74
- strictActionTypeUniqueness: false,
75
- };
@@ -1,87 +0,0 @@
1
- {
2
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
- "version": 1,
4
- "newProjectRoot": "apps",
5
- "projects": {
6
- "@remote.name@": {
7
- "root": ".",
8
- "sourceRoot": "src",
9
- "projectType": "application",
10
- "prefix": "app",
11
- "schematics": {},
12
- "architect": {
13
- "build": {
14
- "builder": "@angular-devkit/build-angular:browser",
15
- "options": {
16
- "outputPath": "dist",
17
- "index": "src/index.html",
18
- "main": "src/main.ts",
19
- "polyfills": "src/polyfills.ts",
20
- "tsConfig": "tsconfig.app.json",
21
- "sourceMap": {
22
- "scripts": true,
23
- "styles": false,
24
- "hidden": true,
25
- "vendor": true
26
- },
27
- "scripts": [
28
- "./node_modules/@webcomponents/custom-elements/src/native-shim.js"
29
- ],
30
- "assets": [
31
- "src/assets",
32
- {
33
- "glob": "**/*",
34
- "input": "node_modules/@eui/core/assets/",
35
- "output": "./assets"
36
- },
37
- {
38
- "glob": "**/*",
39
- "input": "node_modules/@eui/styles-base/dist/assets/",
40
- "output": "./assets"
41
- }
42
- ],
43
- "styles": [
44
- "node_modules/@eui/styles/dist/styles/eui.css",
45
- "node_modules/@eui/styles/dist/styles/eui-extra-utilities.css",
46
- "node_modules/@eui/styles/dist/styles/eui-legacy-bootstrap.css",
47
- "node_modules/@eui/styles/dist/styles/eui-legacy-icons-font.css",
48
- "node_modules/@eui/styles/dist/styles/eui-legacy-utilities.css"
49
- ]
50
- },
51
- "configurations": {
52
- "development": {
53
- "buildOptimizer": false,
54
- "optimization": false,
55
- "vendorChunk": true,
56
- "extractLicenses": false,
57
- "sourceMap": false,
58
- "namedChunks": true
59
- },
60
- "production": {
61
- "fileReplacements": [
62
- {
63
- "replace": "src/environments/environment.ts",
64
- "with": "src/environments/environment.prod.ts"
65
- }
66
- ],
67
- "optimization": true,
68
- "outputHashing": "all",
69
- "sourceMap": false,
70
- "namedChunks": false,
71
- "aot": true,
72
- "extractLicenses": true,
73
- "vendorChunk": false,
74
- "buildOptimizer": true
75
- },
76
- "serve-dist": {
77
- "outputPath": "serve-dist"
78
- }
79
- }
80
- }
81
- }
82
- }
83
- },
84
- "cli": {
85
- "analytics": false
86
- }
87
- }
@@ -1,6 +0,0 @@
1
- last 1 Chrome version
2
- last 1 Firefox version
3
- last 2 Edge major versions
4
- last 2 Safari major versions
5
- last 2 iOS major versions
6
- Firefox ESR
@@ -1,10 +0,0 @@
1
- {
2
- "name": "generated",
3
- "version": "1.0.0-SNAPSHOT.0",
4
- "files": [
5
- "bundles"
6
- ],
7
- "dependencies": {},
8
- "resolutions": {
9
- }
10
- }
@@ -1,24 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./out-tsc/app",
5
- "target": "ES2022",
6
- "module": "ES2022",
7
- "lib": [
8
- "ES2022",
9
- "dom"
10
- ],
11
- "types": [
12
- "node"
13
- ],
14
- "paths": {
15
- "os": ["./node_modules/empty-module/index.js"],
16
- "node-fetch": ["./node_modules/empty-module/index.js"],
17
- "zipkin": ["./node_modules/zipkin/dist/zipkin.js"]
18
- }
19
- },
20
- "exclude": [
21
- "src/test.ts",
22
- "**/*.spec.ts"
23
- ]
24
- }