@eui/tools 6.11.19 → 6.11.21

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 (35) 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/remotes/16.x/base/angular.json +87 -0
  5. package/scripts/csdr/init/remotes/16.x/base/browserslist +6 -0
  6. package/scripts/csdr/init/remotes/16.x/base/package.json_TO_REPLACE +10 -0
  7. package/scripts/csdr/init/remotes/16.x/base/tsconfig.app.json +24 -0
  8. package/scripts/csdr/init/remotes/16.x/base/yarn.lock +14275 -0
  9. package/scripts/csdr/init/remotes/16.x/full/common/app/eui-components.ts +9 -0
  10. package/scripts/csdr/init/remotes/16.x/full/common/app/fallback.component.ts +11 -0
  11. package/scripts/csdr/init/remotes/16.x/full/common/app/module.component.ts +91 -0
  12. package/scripts/csdr/init/remotes/16.x/full/common/app/module.ts +96 -0
  13. package/scripts/csdr/init/remotes/16.x/full/common/app/reducers/custom-route-serializer.ts +28 -0
  14. package/scripts/csdr/init/remotes/16.x/full/common/app/reducers/index.ts +42 -0
  15. package/scripts/csdr/init/remotes/16.x/full/common/app/routing.module.ts +34 -0
  16. package/scripts/csdr/init/remotes/16.x/full/common/assets/.gitkeep +0 -0
  17. package/scripts/csdr/init/remotes/16.x/full/common/config/global.ts +54 -0
  18. package/scripts/csdr/init/remotes/16.x/full/common/config/index.ts +10 -0
  19. package/scripts/csdr/init/remotes/16.x/full/common/config/modules.ts +3 -0
  20. package/scripts/csdr/init/remotes/16.x/full/common/environments/environment.prod.ts +3 -0
  21. package/scripts/csdr/init/remotes/16.x/full/common/environments/environment.ts +3 -0
  22. package/scripts/csdr/init/remotes/16.x/full/common/favicon.ico +0 -0
  23. package/scripts/csdr/init/remotes/16.x/full/common/index.html +10 -0
  24. package/scripts/csdr/init/remotes/16.x/full/common/main.ts +11 -0
  25. package/scripts/csdr/init/remotes/16.x/full/common/polyfills.ts +88 -0
  26. package/scripts/csdr/init/remotes/16.x/full/common/test.ts +20 -0
  27. package/scripts/csdr/init/remotes/16.x/full/options/definitions/dynamic-forms.json +4 -0
  28. package/scripts/csdr/init/remotes/16.x/full/options/definitions/dynatrace.json +4 -0
  29. package/scripts/csdr/init/remotes/16.x/full/options/definitions/participant.json +3 -0
  30. package/scripts/csdr/init/remotes/16.x/full/options/definitions/user-reducers.json +3 -0
  31. package/scripts/csdr/init/remotes/16.x/full/options/definitions/zipkin.json +5 -0
  32. package/scripts/csdr/init/remotes/16.x/full/options/participant/app/module.component.ts +94 -0
  33. package/scripts/csdr/init/remotes/16.x/full/options/participant/app/routing.module.ts +26 -0
  34. package/scripts/csdr/init/remotes/16.x/full/options/participant/config/index.ts +10 -0
  35. package/scripts/csdr/init/remotes/16.x/full/options/user-reducers/app/reducers/index.ts +66 -0
@@ -0,0 +1,26 @@
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
+ }
@@ -0,0 +1,10 @@
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
+ });
@@ -0,0 +1,66 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { ActionReducer, ActionReducerMap, MetaReducer, INIT } 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
+ }